From 5d865d1bbb25fd24df36798ffbd392ffd65f7bd3 Mon Sep 17 00:00:00 2001 From: zoujiandong <10130823232@qq.com> Date: Wed, 10 Jan 2024 08:57:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=82=A3=E8=80=851.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TUICallKit/README.md | 53 + TUICallKit/TUICallKit/TUICallKit.js | 196 + TUICallKit/TUICallKit/TUICallKit.json | 9 + TUICallKit/TUICallKit/TUICallKit.wxml | 29 + TUICallKit/TUICallKit/TUICallKit.wxss | 10 + .../component/GroupCall/GroupCall.js | 116 + .../component/GroupCall/GroupCall.json | 4 + .../component/GroupCall/GroupCall.wxml | 285 ++ .../component/GroupCall/GroupCall.wxss | 754 ++++ .../component/SingleCall/SingleCall.js | 107 + .../component/SingleCall/SingleCall.json | 4 + .../component/SingleCall/SingleCall.wxml | 172 + .../component/SingleCall/SingleCall.wxss | 508 +++ .../TUICallKit/pages/globalCall/globalCall.js | 66 + .../pages/globalCall/globalCall.json | 3 + .../pages/globalCall/globalCall.wxml | 2 + .../pages/globalCall/globalCall.wxss | 1 + .../CallService/bellContext.d.ts | 15 + .../TUICallService/CallService/bellContext.js | 106 + .../TUICallService/CallService/index.d.ts | 97 + .../TUICallService/CallService/index.js | 1147 +++++ .../CallService/miniProgram.d.ts | 6 + .../TUICallService/CallService/miniProgram.js | 76 + .../TUICallService/CallService/utils.d.ts | 9 + .../TUICallService/CallService/utils.js | 167 + .../TUICallService/TUIGlobal/tuiGlobal.d.ts | 21 + .../TUICallService/TUIGlobal/tuiGlobal.js | 40 + .../TUICallService/TUIStore/callStore.d.ts | 8 + .../TUICallService/TUIStore/callStore.js | 62 + .../TUICallService/TUIStore/tuiStore.d.ts | 50 + .../TUICallService/TUIStore/tuiStore.js | 155 + TUICallKit/TUICallService/const/call.d.ts | 93 + TUICallKit/TUICallService/const/call.js | 104 + TUICallKit/TUICallService/const/error.d.ts | 2 + TUICallKit/TUICallService/const/error.js | 22 + TUICallKit/TUICallService/const/index.d.ts | 12 + TUICallKit/TUICallService/const/index.js | 60 + TUICallKit/TUICallService/const/log.d.ts | 7 + TUICallKit/TUICallService/const/log.js | 13 + TUICallKit/TUICallService/index.d.ts | 5 + TUICallKit/TUICallService/index.js | 44 + .../interface/ICallService.d.ts | 93 + .../TUICallService/interface/ICallService.js | 2 + .../TUICallService/interface/ICallStore.d.ts | 33 + .../TUICallService/interface/ICallStore.js | 2 + .../TUICallService/interface/ITUIGlobal.d.ts | 36 + .../TUICallService/interface/ITUIGlobal.js | 2 + .../TUICallService/interface/ITUIStore.d.ts | 75 + .../TUICallService/interface/ITUIStore.js | 2 + .../TUICallService/interface/index.d.ts | 4 + TUICallKit/TUICallService/interface/index.js | 20 + TUICallKit/TUICallService/locales/en.d.ts | 90 + TUICallKit/TUICallService/locales/en.js | 93 + TUICallKit/TUICallService/locales/index.d.ts | 10 + TUICallKit/TUICallService/locales/index.js | 51 + TUICallKit/TUICallService/locales/ja_JP.d.ts | 85 + TUICallKit/TUICallService/locales/ja_JP.js | 88 + TUICallKit/TUICallService/locales/zh-cn.d.ts | 89 + TUICallKit/TUICallService/locales/zh-cn.js | 92 + .../TUICallService/serve/callManager.d.ts | 11 + .../TUICallService/serve/callManager.js | 133 + .../TUICallService/utils/common-utils.d.ts | 53 + .../TUICallService/utils/common-utils.js | 249 ++ TUICallKit/TUICallService/utils/env.d.ts | 10 + TUICallKit/TUICallService/utils/env.js | 39 + TUICallKit/TUICallService/utils/index.d.ts | 1 + TUICallKit/TUICallService/utils/index.js | 33 + TUICallKit/TUICallService/utils/is-empty.d.ts | 2 + TUICallKit/TUICallService/utils/is-empty.js | 38 + TUICallKit/TUICallService/utils/timer.d.ts | 64 + TUICallKit/TUICallService/utils/timer.js | 154 + .../utils/validate/avoidRepeatedCall.d.ts | 10 + .../utils/validate/avoidRepeatedCall.js | 49 + .../TUICallService/utils/validate/index.d.ts | 4 + .../TUICallService/utils/validate/index.js | 9 + .../utils/validate/validateConfig.d.ts | 173 + .../utils/validate/validateConfig.js | 190 + .../utils/validate/validateParams.d.ts | 1 + .../utils/validate/validateParams.js | 86 + TUICallKit/adapter-vue.d.ts | 2 + TUICallKit/adapter-vue.js | 23 + TUICallKit/debug/GenerateTestUserSig-es.js | 63 + .../debug/lib-generate-test-usersig-es.min.js | 2 + TUICallKit/index.d.ts | 3 + TUICallKit/index.js | 17 + TUICallKit/package.json | 40 + TUICallKit/pages/globalCall/globalCall.js | 4 + TUICallKit/pages/globalCall/globalCall.json | 7 + TUICallKit/pages/globalCall/globalCall.wxml | 3 + TUICallKit/pages/globalCall/globalCall.wxss | 0 TUICallKit/static/audio-false.png | Bin 0 -> 1285 bytes TUICallKit/static/audio-true.png | Bin 0 -> 1176 bytes TUICallKit/static/camera-false.png | Bin 0 -> 1017 bytes TUICallKit/static/camera-true.png | Bin 0 -> 974 bytes TUICallKit/static/default_avatar.png | Bin 0 -> 1727 bytes TUICallKit/static/dialing.png | Bin 0 -> 2197 bytes TUICallKit/static/hangup.png | Bin 0 -> 1262 bytes TUICallKit/static/loading.png | Bin 0 -> 1367 bytes TUICallKit/static/phone_dialing.mp3 | Bin 0 -> 9178 bytes TUICallKit/static/phone_ringing.mp3 | Bin 0 -> 8752 bytes TUICallKit/static/speaker-false.png | Bin 0 -> 821 bytes TUICallKit/static/speaker-true.png | Bin 0 -> 1073 bytes TUICallKit/static/switch_camera.png | Bin 0 -> 799 bytes TUICallKit/static/swtich-camera.png | Bin 0 -> 1218 bytes TUICallKit/static/trans.png | Bin 0 -> 714 bytes TUIService/TUICallKit/README.md | 53 + .../TUICallKit/TUICallKit/TUICallKit.js | 196 + .../TUICallKit/TUICallKit/TUICallKit.json | 9 + .../TUICallKit/TUICallKit/TUICallKit.wxml | 29 + .../TUICallKit/TUICallKit/TUICallKit.wxss | 10 + .../component/GroupCall/GroupCall.js | 116 + .../component/GroupCall/GroupCall.json | 4 + .../component/GroupCall/GroupCall.wxml | 285 ++ .../component/GroupCall/GroupCall.wxss | 754 ++++ .../component/SingleCall/SingleCall.js | 107 + .../component/SingleCall/SingleCall.json | 4 + .../component/SingleCall/SingleCall.wxml | 172 + .../component/SingleCall/SingleCall.wxss | 508 +++ .../TUICallKit/pages/globalCall/globalCall.js | 66 + .../pages/globalCall/globalCall.json | 3 + .../pages/globalCall/globalCall.wxml | 2 + .../pages/globalCall/globalCall.wxss | 1 + .../CallService/bellContext.d.ts | 15 + .../TUICallService/CallService/bellContext.js | 106 + .../TUICallService/CallService/index.d.ts | 97 + .../TUICallService/CallService/index.js | 1147 +++++ .../CallService/miniProgram.d.ts | 6 + .../TUICallService/CallService/miniProgram.js | 76 + .../TUICallService/CallService/utils.d.ts | 9 + .../TUICallService/CallService/utils.js | 167 + .../TUICallService/TUIGlobal/tuiGlobal.d.ts | 21 + .../TUICallService/TUIGlobal/tuiGlobal.js | 40 + .../TUICallService/TUIStore/callStore.d.ts | 8 + .../TUICallService/TUIStore/callStore.js | 62 + .../TUICallService/TUIStore/tuiStore.d.ts | 50 + .../TUICallService/TUIStore/tuiStore.js | 155 + .../TUICallKit/TUICallService/const/call.d.ts | 93 + .../TUICallKit/TUICallService/const/call.js | 104 + .../TUICallService/const/error.d.ts | 2 + .../TUICallKit/TUICallService/const/error.js | 22 + .../TUICallService/const/index.d.ts | 12 + .../TUICallKit/TUICallService/const/index.js | 60 + .../TUICallKit/TUICallService/const/log.d.ts | 7 + .../TUICallKit/TUICallService/const/log.js | 13 + .../TUICallKit/TUICallService/index.d.ts | 5 + TUIService/TUICallKit/TUICallService/index.js | 44 + .../interface/ICallService.d.ts | 93 + .../TUICallService/interface/ICallService.js | 2 + .../TUICallService/interface/ICallStore.d.ts | 33 + .../TUICallService/interface/ICallStore.js | 2 + .../TUICallService/interface/ITUIGlobal.d.ts | 36 + .../TUICallService/interface/ITUIGlobal.js | 2 + .../TUICallService/interface/ITUIStore.d.ts | 75 + .../TUICallService/interface/ITUIStore.js | 2 + .../TUICallService/interface/index.d.ts | 4 + .../TUICallService/interface/index.js | 20 + .../TUICallKit/TUICallService/locales/en.d.ts | 90 + .../TUICallKit/TUICallService/locales/en.js | 93 + .../TUICallService/locales/index.d.ts | 10 + .../TUICallService/locales/index.js | 51 + .../TUICallService/locales/ja_JP.d.ts | 85 + .../TUICallService/locales/ja_JP.js | 88 + .../TUICallService/locales/zh-cn.d.ts | 89 + .../TUICallService/locales/zh-cn.js | 92 + .../TUICallService/serve/callManager.d.ts | 11 + .../TUICallService/serve/callManager.js | 133 + .../TUICallService/utils/common-utils.d.ts | 53 + .../TUICallService/utils/common-utils.js | 249 ++ .../TUICallKit/TUICallService/utils/env.d.ts | 10 + .../TUICallKit/TUICallService/utils/env.js | 39 + .../TUICallService/utils/index.d.ts | 1 + .../TUICallKit/TUICallService/utils/index.js | 33 + .../TUICallService/utils/is-empty.d.ts | 2 + .../TUICallService/utils/is-empty.js | 38 + .../TUICallService/utils/timer.d.ts | 64 + .../TUICallKit/TUICallService/utils/timer.js | 154 + .../utils/validate/avoidRepeatedCall.d.ts | 10 + .../utils/validate/avoidRepeatedCall.js | 49 + .../TUICallService/utils/validate/index.d.ts | 4 + .../TUICallService/utils/validate/index.js | 9 + .../utils/validate/validateConfig.d.ts | 173 + .../utils/validate/validateConfig.js | 190 + .../utils/validate/validateParams.d.ts | 1 + .../utils/validate/validateParams.js | 86 + TUIService/TUICallKit/adapter-vue.d.ts | 2 + TUIService/TUICallKit/adapter-vue.js | 23 + .../debug/GenerateTestUserSig-es.js | 63 + .../debug/lib-generate-test-usersig-es.min.js | 2 + TUIService/TUICallKit/index.d.ts | 3 + TUIService/TUICallKit/index.js | 17 + TUIService/TUICallKit/package.json | 40 + .../TUICallKit/pages/globalCall/globalCall.js | 4 + .../pages/globalCall/globalCall.json | 7 + .../pages/globalCall/globalCall.wxml | 3 + .../pages/globalCall/globalCall.wxss | 0 TUIService/TUICallKit/static/audio-false.png | Bin 0 -> 1285 bytes TUIService/TUICallKit/static/audio-true.png | Bin 0 -> 1176 bytes TUIService/TUICallKit/static/camera-false.png | Bin 0 -> 1017 bytes TUIService/TUICallKit/static/camera-true.png | Bin 0 -> 974 bytes .../TUICallKit/static/default_avatar.png | Bin 0 -> 1727 bytes TUIService/TUICallKit/static/dialing.png | Bin 0 -> 2197 bytes TUIService/TUICallKit/static/hangup.png | Bin 0 -> 1262 bytes TUIService/TUICallKit/static/loading.png | Bin 0 -> 1367 bytes .../TUICallKit/static/phone_dialing.mp3 | Bin 0 -> 9178 bytes .../TUICallKit/static/phone_ringing.mp3 | Bin 0 -> 8752 bytes .../TUICallKit/static/speaker-false.png | Bin 0 -> 821 bytes TUIService/TUICallKit/static/speaker-true.png | Bin 0 -> 1073 bytes .../TUICallKit/static/switch_camera.png | Bin 0 -> 799 bytes .../TUICallKit/static/swtich-camera.png | Bin 0 -> 1218 bytes TUIService/TUICallKit/static/trans.png | Bin 0 -> 714 bytes .../TUIChat/components/MessageInput/index.js | 36 + .../components/MessageInput/index.wxml | 1 + TUIService/TUIKit/components/TUIChat/index.js | 5 +- .../TUIKit/components/TUIChat/index.wxml | 6 +- api/consultExpert.js | 6 +- app.js | 19 +- app.json | 29 +- assets/images/video_bg.png | Bin 0 -> 49229 bytes assets/images/video_bg_disable.png | Bin 0 -> 16677 bytes assets/images/video_disable.png | Bin 0 -> 7173 bytes filters/filter.wxs | 23 +- .../@tencentcloud/chat-uikit-wechat/index.js | 186 + .../chat-uikit-wechat/index.js.map | 1 + miniprogram_npm/@tencentcloud/chat/index.js | 14 + .../@tencentcloud/chat/index.js.map | 1 + .../@tencentcloud/tui-core/index.js | 14 + .../@tencentcloud/tui-core/index.js.map | 1 + miniprogram_npm/@vant/area-data/index.js | 3959 +++++++++++++++++ miniprogram_npm/@vant/area-data/index.js.map | 1 + miniprogram_npm/@vant/weapp/button/index.wxml | 1 + .../@vant/weapp/calendar/calendar.wxml | 4 +- miniprogram_npm/@vant/weapp/calendar/index.js | 14 +- .../@vant/weapp/calendar/index.wxml | 1 + .../@vant/weapp/calendar/index.wxs | 4 +- .../@vant/weapp/calendar/index.wxss | 2 +- miniprogram_npm/@vant/weapp/cascader/index.js | 46 +- .../@vant/weapp/cascader/index.wxml | 6 +- .../@vant/weapp/cascader/index.wxs | 10 +- .../@vant/weapp/circle/canvas.d.ts | 2 +- miniprogram_npm/@vant/weapp/circle/index.js | 4 + .../@vant/weapp/common/relation.d.ts | 2 +- miniprogram_npm/@vant/weapp/common/utils.d.ts | 3 + miniprogram_npm/@vant/weapp/common/utils.js | 12 +- .../@vant/weapp/count-down/utils.d.ts | 2 +- .../@vant/weapp/definitions/index.d.ts | 2 +- .../@vant/weapp/dialog/dialog.d.ts | 4 +- miniprogram_npm/@vant/weapp/dialog/index.js | 1 + miniprogram_npm/@vant/weapp/dialog/index.wxml | 8 +- .../@vant/weapp/dropdown-item/index.js | 8 +- .../@vant/weapp/dropdown-item/index.wxml | 2 + .../@vant/weapp/dropdown-menu/index.js | 4 + miniprogram_npm/@vant/weapp/field/index.js | 26 +- miniprogram_npm/@vant/weapp/field/index.wxml | 14 +- miniprogram_npm/@vant/weapp/field/input.wxml | 1 + .../@vant/weapp/field/textarea.wxml | 1 + .../@vant/weapp/goods-action-button/index.js | 4 + .../weapp/goods-action-button/index.wxml | 3 +- .../@vant/weapp/goods-action-icon/index.js | 4 +- .../@vant/weapp/goods-action-icon/index.wxml | 3 + miniprogram_npm/@vant/weapp/icon/index.js | 1 + miniprogram_npm/@vant/weapp/icon/index.wxml | 2 +- miniprogram_npm/@vant/weapp/icon/index.wxs | 4 + miniprogram_npm/@vant/weapp/icon/index.wxss | 2 +- miniprogram_npm/@vant/weapp/mixins/button.js | 3 + .../@vant/weapp/mixins/page-scroll.d.ts | 4 +- miniprogram_npm/@vant/weapp/overlay/index.js | 4 + .../@vant/weapp/overlay/index.wxml | 28 +- .../@vant/weapp/overlay/overlay.wxml | 10 + miniprogram_npm/@vant/weapp/popup/index.js | 8 + miniprogram_npm/@vant/weapp/popup/index.wxml | 23 +- miniprogram_npm/@vant/weapp/popup/index.wxss | 2 +- miniprogram_npm/@vant/weapp/popup/popup.wxml | 14 + miniprogram_npm/@vant/weapp/rate/index.wxss | 2 +- miniprogram_npm/@vant/weapp/slider/index.js | 8 +- miniprogram_npm/@vant/weapp/stepper/index.js | 5 +- .../@vant/weapp/stepper/index.wxml | 1 - miniprogram_npm/@vant/weapp/steps/index.wxss | 2 +- miniprogram_npm/@vant/weapp/sticky/index.js | 12 +- .../@vant/weapp/tabbar-item/index.js | 12 + miniprogram_npm/@vant/weapp/tabs/index.js | 3 + miniprogram_npm/@vant/weapp/tabs/index.wxml | 4 +- miniprogram_npm/@vant/weapp/tabs/index.wxss | 2 +- miniprogram_npm/@vant/weapp/toast/toast.d.ts | 4 +- miniprogram_npm/@vant/weapp/uploader/index.js | 8 +- .../@vant/weapp/uploader/index.wxml | 1 + .../@vant/weapp/uploader/shared.d.ts | 12 +- .../@vant/weapp/uploader/shared.js | 22 +- miniprogram_npm/@vant/weapp/uploader/utils.js | 30 +- miniprogram_npm/aegis-mp-sdk/index.js | 23 + miniprogram_npm/aegis-mp-sdk/index.js.map | 1 + miniprogram_npm/dayjs/index.js | 13 + miniprogram_npm/dayjs/index.js.map | 1 + .../tim-profanity-filter-plugin/index.js | 28 + .../tim-profanity-filter-plugin/index.js.map | 1 + miniprogram_npm/tim-upload-plugin/index.js | 14 + .../tim-upload-plugin/index.js.map | 1 + miniprogram_npm/tim-wx-sdk/index.js | 14 + miniprogram_npm/tim-wx-sdk/index.js.map | 1 + miniprogram_npm/trtc-wx-sdk/index.js | 15 + miniprogram_npm/trtc-wx-sdk/index.js.map | 1 + miniprogram_npm/tsignaling-wx/index.js | 22 + miniprogram_npm/tsignaling-wx/index.js.map | 1 + miniprogram_npm/tuicall-engine-wx/index.js | 22 + .../tuicall-engine-wx/index.js.map | 1 + package.json | 2 +- pages/expertConsult/expertConsult.js | 10 +- pages/expertConsult/expertConsult.wxml | 14 +- pages/expertConsult/expertConsult.wxss | 14 + pages/expertDetail/expertDetail.js | 139 +- pages/expertDetail/expertDetail.wxml | 205 +- pages/expertDetail/expertDetail.wxss | 142 +- pages/index/index.js | 2 +- pages/index/index.wxml | 13 +- pages/index/index.wxss | 13 +- pages/my/my.js | 2 +- pages/search/search.wxml | 11 +- pages/search/search.wxss | 12 + pages/selectPatient/selectPatient.js | 10 +- pages/writeSick/writeSick.js | 3 +- project.config.json | 2 +- project.private.config.json | 3 +- sugarCheck/pages/checkOrder/checkOrder.js | 274 ++ sugarCheck/pages/checkOrder/checkOrder.json | 11 + sugarCheck/pages/checkOrder/checkOrder.wxml | 107 + sugarCheck/pages/checkOrder/checkOrder.wxss | 332 ++ .../checkOrderDetail/checkOrderDetail.js | 643 +++ .../checkOrderDetail/checkOrderDetail.json | 12 + .../checkOrderDetail/checkOrderDetail.wxml | 258 ++ .../checkOrderDetail/checkOrderDetail.wxss | 887 ++++ sugarCheck/pages/sugarDetail/sugarDetail.js | 387 ++ sugarCheck/pages/sugarDetail/sugarDetail.json | 8 + sugarCheck/pages/sugarDetail/sugarDetail.wxml | 89 + sugarCheck/pages/sugarDetail/sugarDetail.wxss | 383 ++ .../pages/sugarSickInfo/sugarSickInfo.js | 668 +++ .../pages/sugarSickInfo/sugarSickInfo.json | 16 + .../pages/sugarSickInfo/sugarSickInfo.wxml | 127 + .../pages/sugarSickInfo/sugarSickInfo.wxss | 327 ++ utils/config.js | 2 +- utils/imLogin.js | 7 + 339 files changed, 23720 insertions(+), 267 deletions(-) create mode 100644 TUICallKit/README.md create mode 100644 TUICallKit/TUICallKit/TUICallKit.js create mode 100644 TUICallKit/TUICallKit/TUICallKit.json create mode 100644 TUICallKit/TUICallKit/TUICallKit.wxml create mode 100644 TUICallKit/TUICallKit/TUICallKit.wxss create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.js create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.json create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml create mode 100644 TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.js create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.json create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml create mode 100644 TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss create mode 100644 TUICallKit/TUICallKit/pages/globalCall/globalCall.js create mode 100644 TUICallKit/TUICallKit/pages/globalCall/globalCall.json create mode 100644 TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml create mode 100644 TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss create mode 100644 TUICallKit/TUICallService/CallService/bellContext.d.ts create mode 100644 TUICallKit/TUICallService/CallService/bellContext.js create mode 100644 TUICallKit/TUICallService/CallService/index.d.ts create mode 100644 TUICallKit/TUICallService/CallService/index.js create mode 100644 TUICallKit/TUICallService/CallService/miniProgram.d.ts create mode 100644 TUICallKit/TUICallService/CallService/miniProgram.js create mode 100644 TUICallKit/TUICallService/CallService/utils.d.ts create mode 100644 TUICallKit/TUICallService/CallService/utils.js create mode 100644 TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts create mode 100644 TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js create mode 100644 TUICallKit/TUICallService/TUIStore/callStore.d.ts create mode 100644 TUICallKit/TUICallService/TUIStore/callStore.js create mode 100644 TUICallKit/TUICallService/TUIStore/tuiStore.d.ts create mode 100644 TUICallKit/TUICallService/TUIStore/tuiStore.js create mode 100644 TUICallKit/TUICallService/const/call.d.ts create mode 100644 TUICallKit/TUICallService/const/call.js create mode 100644 TUICallKit/TUICallService/const/error.d.ts create mode 100644 TUICallKit/TUICallService/const/error.js create mode 100644 TUICallKit/TUICallService/const/index.d.ts create mode 100644 TUICallKit/TUICallService/const/index.js create mode 100644 TUICallKit/TUICallService/const/log.d.ts create mode 100644 TUICallKit/TUICallService/const/log.js create mode 100644 TUICallKit/TUICallService/index.d.ts create mode 100644 TUICallKit/TUICallService/index.js create mode 100644 TUICallKit/TUICallService/interface/ICallService.d.ts create mode 100644 TUICallKit/TUICallService/interface/ICallService.js create mode 100644 TUICallKit/TUICallService/interface/ICallStore.d.ts create mode 100644 TUICallKit/TUICallService/interface/ICallStore.js create mode 100644 TUICallKit/TUICallService/interface/ITUIGlobal.d.ts create mode 100644 TUICallKit/TUICallService/interface/ITUIGlobal.js create mode 100644 TUICallKit/TUICallService/interface/ITUIStore.d.ts create mode 100644 TUICallKit/TUICallService/interface/ITUIStore.js create mode 100644 TUICallKit/TUICallService/interface/index.d.ts create mode 100644 TUICallKit/TUICallService/interface/index.js create mode 100644 TUICallKit/TUICallService/locales/en.d.ts create mode 100644 TUICallKit/TUICallService/locales/en.js create mode 100644 TUICallKit/TUICallService/locales/index.d.ts create mode 100644 TUICallKit/TUICallService/locales/index.js create mode 100644 TUICallKit/TUICallService/locales/ja_JP.d.ts create mode 100644 TUICallKit/TUICallService/locales/ja_JP.js create mode 100644 TUICallKit/TUICallService/locales/zh-cn.d.ts create mode 100644 TUICallKit/TUICallService/locales/zh-cn.js create mode 100644 TUICallKit/TUICallService/serve/callManager.d.ts create mode 100644 TUICallKit/TUICallService/serve/callManager.js create mode 100644 TUICallKit/TUICallService/utils/common-utils.d.ts create mode 100644 TUICallKit/TUICallService/utils/common-utils.js create mode 100644 TUICallKit/TUICallService/utils/env.d.ts create mode 100644 TUICallKit/TUICallService/utils/env.js create mode 100644 TUICallKit/TUICallService/utils/index.d.ts create mode 100644 TUICallKit/TUICallService/utils/index.js create mode 100644 TUICallKit/TUICallService/utils/is-empty.d.ts create mode 100644 TUICallKit/TUICallService/utils/is-empty.js create mode 100644 TUICallKit/TUICallService/utils/timer.d.ts create mode 100644 TUICallKit/TUICallService/utils/timer.js create mode 100644 TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js create mode 100644 TUICallKit/TUICallService/utils/validate/index.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/index.js create mode 100644 TUICallKit/TUICallService/utils/validate/validateConfig.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/validateConfig.js create mode 100644 TUICallKit/TUICallService/utils/validate/validateParams.d.ts create mode 100644 TUICallKit/TUICallService/utils/validate/validateParams.js create mode 100644 TUICallKit/adapter-vue.d.ts create mode 100644 TUICallKit/adapter-vue.js create mode 100644 TUICallKit/debug/GenerateTestUserSig-es.js create mode 100644 TUICallKit/debug/lib-generate-test-usersig-es.min.js create mode 100644 TUICallKit/index.d.ts create mode 100644 TUICallKit/index.js create mode 100644 TUICallKit/package.json create mode 100644 TUICallKit/pages/globalCall/globalCall.js create mode 100644 TUICallKit/pages/globalCall/globalCall.json create mode 100644 TUICallKit/pages/globalCall/globalCall.wxml create mode 100644 TUICallKit/pages/globalCall/globalCall.wxss create mode 100644 TUICallKit/static/audio-false.png create mode 100644 TUICallKit/static/audio-true.png create mode 100644 TUICallKit/static/camera-false.png create mode 100644 TUICallKit/static/camera-true.png create mode 100644 TUICallKit/static/default_avatar.png create mode 100644 TUICallKit/static/dialing.png create mode 100644 TUICallKit/static/hangup.png create mode 100644 TUICallKit/static/loading.png create mode 100644 TUICallKit/static/phone_dialing.mp3 create mode 100644 TUICallKit/static/phone_ringing.mp3 create mode 100644 TUICallKit/static/speaker-false.png create mode 100644 TUICallKit/static/speaker-true.png create mode 100644 TUICallKit/static/switch_camera.png create mode 100644 TUICallKit/static/swtich-camera.png create mode 100644 TUICallKit/static/trans.png create mode 100644 TUIService/TUICallKit/README.md create mode 100644 TUIService/TUICallKit/TUICallKit/TUICallKit.js create mode 100644 TUIService/TUICallKit/TUICallKit/TUICallKit.json create mode 100644 TUIService/TUICallKit/TUICallKit/TUICallKit.wxml create mode 100644 TUIService/TUICallKit/TUICallKit/TUICallKit.wxss create mode 100644 TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js create mode 100644 TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json create mode 100644 TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml create mode 100644 TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss create mode 100644 TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js create mode 100644 TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json create mode 100644 TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml create mode 100644 TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss create mode 100644 TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.js create mode 100644 TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.json create mode 100644 TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml create mode 100644 TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss create mode 100644 TUIService/TUICallKit/TUICallService/CallService/bellContext.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/CallService/bellContext.js create mode 100644 TUIService/TUICallKit/TUICallService/CallService/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/CallService/index.js create mode 100644 TUIService/TUICallKit/TUICallService/CallService/miniProgram.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/CallService/miniProgram.js create mode 100644 TUIService/TUICallKit/TUICallService/CallService/utils.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/CallService/utils.js create mode 100644 TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js create mode 100644 TUIService/TUICallKit/TUICallService/TUIStore/callStore.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/TUIStore/callStore.js create mode 100644 TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.js create mode 100644 TUIService/TUICallKit/TUICallService/const/call.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/const/call.js create mode 100644 TUIService/TUICallKit/TUICallService/const/error.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/const/error.js create mode 100644 TUIService/TUICallKit/TUICallService/const/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/const/index.js create mode 100644 TUIService/TUICallKit/TUICallService/const/log.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/const/log.js create mode 100644 TUIService/TUICallKit/TUICallService/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/index.js create mode 100644 TUIService/TUICallKit/TUICallService/interface/ICallService.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/interface/ICallService.js create mode 100644 TUIService/TUICallKit/TUICallService/interface/ICallStore.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/interface/ICallStore.js create mode 100644 TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.js create mode 100644 TUIService/TUICallKit/TUICallService/interface/ITUIStore.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/interface/ITUIStore.js create mode 100644 TUIService/TUICallKit/TUICallService/interface/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/interface/index.js create mode 100644 TUIService/TUICallKit/TUICallService/locales/en.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/locales/en.js create mode 100644 TUIService/TUICallKit/TUICallService/locales/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/locales/index.js create mode 100644 TUIService/TUICallKit/TUICallService/locales/ja_JP.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/locales/ja_JP.js create mode 100644 TUIService/TUICallKit/TUICallService/locales/zh-cn.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/locales/zh-cn.js create mode 100644 TUIService/TUICallKit/TUICallService/serve/callManager.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/serve/callManager.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/common-utils.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/common-utils.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/env.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/env.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/index.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/is-empty.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/is-empty.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/timer.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/timer.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/index.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/index.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.js create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/validateParams.d.ts create mode 100644 TUIService/TUICallKit/TUICallService/utils/validate/validateParams.js create mode 100644 TUIService/TUICallKit/adapter-vue.d.ts create mode 100644 TUIService/TUICallKit/adapter-vue.js create mode 100644 TUIService/TUICallKit/debug/GenerateTestUserSig-es.js create mode 100644 TUIService/TUICallKit/debug/lib-generate-test-usersig-es.min.js create mode 100644 TUIService/TUICallKit/index.d.ts create mode 100644 TUIService/TUICallKit/index.js create mode 100644 TUIService/TUICallKit/package.json create mode 100644 TUIService/TUICallKit/pages/globalCall/globalCall.js create mode 100644 TUIService/TUICallKit/pages/globalCall/globalCall.json create mode 100644 TUIService/TUICallKit/pages/globalCall/globalCall.wxml create mode 100644 TUIService/TUICallKit/pages/globalCall/globalCall.wxss create mode 100644 TUIService/TUICallKit/static/audio-false.png create mode 100644 TUIService/TUICallKit/static/audio-true.png create mode 100644 TUIService/TUICallKit/static/camera-false.png create mode 100644 TUIService/TUICallKit/static/camera-true.png create mode 100644 TUIService/TUICallKit/static/default_avatar.png create mode 100644 TUIService/TUICallKit/static/dialing.png create mode 100644 TUIService/TUICallKit/static/hangup.png create mode 100644 TUIService/TUICallKit/static/loading.png create mode 100644 TUIService/TUICallKit/static/phone_dialing.mp3 create mode 100644 TUIService/TUICallKit/static/phone_ringing.mp3 create mode 100644 TUIService/TUICallKit/static/speaker-false.png create mode 100644 TUIService/TUICallKit/static/speaker-true.png create mode 100644 TUIService/TUICallKit/static/switch_camera.png create mode 100644 TUIService/TUICallKit/static/swtich-camera.png create mode 100644 TUIService/TUICallKit/static/trans.png create mode 100644 assets/images/video_bg.png create mode 100644 assets/images/video_bg_disable.png create mode 100644 assets/images/video_disable.png create mode 100644 miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js create mode 100644 miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js.map create mode 100644 miniprogram_npm/@tencentcloud/chat/index.js create mode 100644 miniprogram_npm/@tencentcloud/chat/index.js.map create mode 100644 miniprogram_npm/@tencentcloud/tui-core/index.js create mode 100644 miniprogram_npm/@tencentcloud/tui-core/index.js.map create mode 100644 miniprogram_npm/@vant/area-data/index.js create mode 100644 miniprogram_npm/@vant/area-data/index.js.map create mode 100644 miniprogram_npm/@vant/weapp/overlay/overlay.wxml create mode 100644 miniprogram_npm/@vant/weapp/popup/popup.wxml create mode 100644 miniprogram_npm/aegis-mp-sdk/index.js create mode 100644 miniprogram_npm/aegis-mp-sdk/index.js.map create mode 100644 miniprogram_npm/dayjs/index.js create mode 100644 miniprogram_npm/dayjs/index.js.map create mode 100644 miniprogram_npm/tim-profanity-filter-plugin/index.js create mode 100644 miniprogram_npm/tim-profanity-filter-plugin/index.js.map create mode 100644 miniprogram_npm/tim-upload-plugin/index.js create mode 100644 miniprogram_npm/tim-upload-plugin/index.js.map create mode 100644 miniprogram_npm/tim-wx-sdk/index.js create mode 100644 miniprogram_npm/tim-wx-sdk/index.js.map create mode 100644 miniprogram_npm/trtc-wx-sdk/index.js create mode 100644 miniprogram_npm/trtc-wx-sdk/index.js.map create mode 100644 miniprogram_npm/tsignaling-wx/index.js create mode 100644 miniprogram_npm/tsignaling-wx/index.js.map create mode 100644 miniprogram_npm/tuicall-engine-wx/index.js create mode 100644 miniprogram_npm/tuicall-engine-wx/index.js.map create mode 100644 sugarCheck/pages/checkOrder/checkOrder.js create mode 100644 sugarCheck/pages/checkOrder/checkOrder.json create mode 100644 sugarCheck/pages/checkOrder/checkOrder.wxml create mode 100644 sugarCheck/pages/checkOrder/checkOrder.wxss create mode 100644 sugarCheck/pages/checkOrderDetail/checkOrderDetail.js create mode 100644 sugarCheck/pages/checkOrderDetail/checkOrderDetail.json create mode 100644 sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxml create mode 100644 sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxss create mode 100644 sugarCheck/pages/sugarDetail/sugarDetail.js create mode 100644 sugarCheck/pages/sugarDetail/sugarDetail.json create mode 100644 sugarCheck/pages/sugarDetail/sugarDetail.wxml create mode 100644 sugarCheck/pages/sugarDetail/sugarDetail.wxss create mode 100644 sugarCheck/pages/sugarSickInfo/sugarSickInfo.js create mode 100644 sugarCheck/pages/sugarSickInfo/sugarSickInfo.json create mode 100644 sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxml create mode 100644 sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxss diff --git a/TUICallKit/README.md b/TUICallKit/README.md new file mode 100644 index 0000000..f3ec28e --- /dev/null +++ b/TUICallKit/README.md @@ -0,0 +1,53 @@ +# TUICallkit 组件接入说明 +TUICallkit 是小程序音视频通话 UI 组件,通过编写几行代码,就可以为您的小程序应用添加音视频通话功能。 + +**低于 v3.0.4 版本,参考的 [readme](https://www.npmjs.com/package/@tencentcloud/call-uikit-wechat/v/1.4.4)。** + +## 环境准备 + +- 微信 App iOS 最低版本要求:8.0.40 +- 微信 App Android 最低版本要求:8.0.40 +- 小程序基础库最低版本要求:2.10.0 +- 由于小程序测试号不具备 live-pusher 和 live-player 的使用权限,请使用企业小程序账号申请相关权限进行开发 +- 由于微信开发者工具不支持原生组件(即 live-pusher 和 live-player 标签),需要在真机上进行运行体验 + +## 特性 +- ⚡️ 功能全面 —— 支持单人/多人/音频/视频通话、支持视频转音频通话、支持自由选择通话设备 +- 🎨 灵活样式 —— 组件开源,可复用逻辑,自定义 UI 样式 +- 🛠 优秀生态 —— 与 [TUIKit](https://cloud.tencent.com/document/product/269/79737) 协同使用,可以在 [TIM](https://cloud.tencent.com/document/product/269) 会话中直接发起音视频通话 +- 🌍 跨平台 —— 支持 Android、iOS、Web、小程序、Flutter、UniApp 等 [多个开发平台](https://cloud.tencent.com/document/product/647/78742) +- ☁️ 低延迟 —— 腾讯云全球链路资源储备,保证国际链路端到端平均时延 < 300ms +- 🤙🏻 低卡顿 —— 抗丢包率超过 80%、抗网络抖动超过 1000ms,弱网环境仍顺畅稳定 +- 🌈 高品质 —— 支持 720P、1080P 高清画质,70% 丢包率仍可正常视频 + + +## 目录结构 + +``` +TUICallkit +├─ debug // 用来本地测试时生成 userSig +├─ src // UI 组件源码 + ├─ Components // 呼叫中 UI 组件 + └─ TUICallService // UI 组件的逻辑 + └─ adapter-vue.ts // 用来适配 vue2、vue3 的适配层 + └─ index.ts // UI 组件逻辑的入口 +├─ types +├─ package.json +├─ README.md +├─ tuicall-uikit-vue.es.js +├─ tuicall-uikit-vue.umd.js +``` + + +## 使用指引 +为方便您的使用,本组件配套多篇使用指引: +- 如果您想要了解 TUICallKit,请阅读 [组件介绍 TUICallKit](https://cloud.tencent.com/document/product/647/78742)。 +- 如果您想把我们的功能直接嵌入到您的项目中,请阅读 [快速接入 TUICallKit](https://cloud.tencent.com/document/product/647/78912)。 +- 如果您想要了解详细 API,请阅读 [API 概览](https://cloud.tencent.com/document/product/647/78759)。 + +## 附录 + +- 如果你遇到了困难,可以先参阅 [常见问题](https://cloud.tencent.com/document/product/647/78733)。 +- 如果发现了示例代码的 bug,欢迎提交 issue。 +- 欢迎加入 QQ 群:**646165204**,进行技术交流和反馈~ +- \ No newline at end of file diff --git a/TUICallKit/TUICallKit/TUICallKit.js b/TUICallKit/TUICallKit/TUICallKit.js new file mode 100644 index 0000000..bee38c7 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.js @@ -0,0 +1,196 @@ +import { TUIStore, StoreName, NAME } from "../index"; + +const { + CALL_STATUS, + CALL_ROLE, + CALL_MEDIA_TYPE, + LOCAL_USER_INFO, + REMOTE_USER_INFO_LIST, + CALLER_USER_INFO, + IS_GROUP, + CALL_DURATION, + PUSHER, + PLAYER, + BIG_SCREEN_USER_ID, + IS_EAR_PHONE, + LOCAL_VIDEO, + MYSELF, + TOAST_INFO, +} = NAME; + +Component({ + properties: {}, + data: { + callStatus: TUIStore.getData(StoreName.CALL, CALL_STATUS), // 通话状态 + isGroupCall: TUIStore.getData(StoreName.CALL, IS_GROUP), // 是否群通话 + callMediaType: TUIStore.getData(StoreName.CALL, CALL_MEDIA_TYPE), // 通话类型 + callDuration: TUIStore.getData(StoreName.CALL, CALL_DURATION), // 通话时长 + callRole: TUIStore.getData(StoreName.CALL, CALL_ROLE), // 通话角色 + isEarPhone: TUIStore.getData(StoreName.CALL, IS_EAR_PHONE), // 声音模式 听筒/扬声器 + bigScreenUserId: TUIStore.getData(StoreName.CALL, BIG_SCREEN_USER_ID), // 大屏显示的用户 + localUserInfo: TUIStore.getData(StoreName.CALL, LOCAL_USER_INFO), // 本地用户信息 + callerUserInfo: TUIStore.getData(StoreName.CALL, CALLER_USER_INFO),// 邀请者用户信息 + remoteUserInfoList: TUIStore.getData(StoreName.CALL, REMOTE_USER_INFO_LIST), // 远端用户信息 + pusher: TUIStore.getData(StoreName.CALL, PUSHER), // TRTC 本地流 + playerList: TUIStore.getData(StoreName.CALL, PLAYER), // TRTC 远端流 + playerProcess: {}, // 经过处理的的远端流(多人通话) + }, + methods: { + // 监听通话状态变更回调 + handleCallStatusChange(value) { + this.setData({ + callStatus: value, + }); + }, + // 监听是否群组通话变更回调 + handleIsGroupChange(value) { + this.setData({ + isGroupCall: value, + }); + }, + // 监听通话类型变更回调 + handleCallMediaTypeChange(value) { + this.setData({ + callMediaType: value, + }); + }, + // 监听通话角色变更回调 + handleCallRoleChange(value) { + this.setData({ + callRole: value, + }); + }, + // 监听通话时长变更回调 + handleCallDurationChange(value) { + this.setData({ + callDuration: value, + }); + }, + // 监听声音模式变更回调 + handleEarPhoneChange(value) { + this.setData({ + isEarPhone: value, + }); + }, + // 监听大屏显示的用户变更回调 + handleScreenChange(value) { + if (value === LOCAL_VIDEO) { + this.setData({ + bigScreenUserId: true, + }); + } else { + this.setData({ + bigScreenUserId: false, + }); + } + }, + // 监听本地用户信息变更回调 + handleLocalUserInfoChange(value) { + this.setData({ + localUserInfo: value, + }); + }, + // 监听到邀请者信息变更回调 + handleCallerUserInfoChange(value) { + this.setData({ + callerUserInfo: value, + }); + }, + // 监听远端用户信息变更回调 + handleRemoteUserInfoListChange(value) { + this.setData({ + remoteUserInfoList: value, + }); + }, + // 监听 TRTC 本地流变更回调 + handlePusherChange(value) { + this.setData({ + pusher: value, + }); + }, + // 监听 TRTC 远端流变更回调 + handlePlayerListChange(value) { + if (this.data.isGroupCall) { + const convertToPlayer = this.convertToObj(value); + this.setData({ + playerProcess: convertToPlayer, + }); + } else { + this.setData({ + playerList: value, + }); + } + }, + // 监听到弹窗信息变更回调 + handleToastInfoChange(value) { + if (value.text) { + this.showToast(value.text, value.type || "info"); + } + }, + showToast(value, type) { + switch (type) { + case "info": + wx.showToast({ + title: value, + icon: "none", + }); + break; + default: + break; + } + }, + convertToObj(arr = []) { + const tempObject = {}; + for (let i = 0; i < arr.length; i++) { + tempObject[arr[i].userID] = arr[i]; + } + return tempObject; + }, + }, + + // 生命周期方法 + lifetimes: { + attached() { + let that = this; + TUIStore.watch( + StoreName.CALL, + { + [CALL_STATUS]: this.handleCallStatusChange.bind(that), + [IS_GROUP]: this.handleIsGroupChange.bind(that), + [CALL_MEDIA_TYPE]: this.handleCallMediaTypeChange.bind(that), + [CALL_DURATION]: this.handleCallDurationChange.bind(that), + [CALL_ROLE]: this.handleCallRoleChange.bind(that), + [IS_EAR_PHONE]: this.handleEarPhoneChange.bind(that), + [BIG_SCREEN_USER_ID]: this.handleScreenChange.bind(that), + [LOCAL_USER_INFO]: this.handleLocalUserInfoChange.bind(that), + [CALLER_USER_INFO]: this.handleCallerUserInfoChange.bind(that), + [REMOTE_USER_INFO_LIST]: this.handleRemoteUserInfoListChange.bind(that), + [TOAST_INFO]: this.handleToastInfoChange.bind(that), + [PUSHER]: this.handlePusherChange.bind(that), + [PLAYER]: this.handlePlayerListChange.bind(that), + }, + { + notifyRangeWhenWatch: MYSELF, + } + ); + }, + async detached() { + let that = this; + TUIStore.unwatch(StoreName.CALL, { + [CALL_STATUS]: this.handleCallStatusChange.bind(that), + [IS_GROUP]: this.handleIsGroupChange.bind(that), + [CALL_MEDIA_TYPE]: this.handleCallMediaTypeChange.bind(that), + [CALL_DURATION]: this.handleCallDurationChange.bind(that), + [CALL_ROLE]: this.handleCallRoleChange.bind(that), + [IS_EAR_PHONE]: this.handleEarPhoneChange.bind(that), + [BIG_SCREEN_USER_ID]: this.handleScreenChange.bind(that), + [LOCAL_USER_INFO]: this.handleLocalUserInfoChange.bind(that), + [CALLER_USER_INFO]: this.handleCallerUserInfoChange.bind(that), + [REMOTE_USER_INFO_LIST]: this.handleRemoteUserInfoListChange.bind(that), + [TOAST_INFO]: this.handleToastInfoChange.bind(that), + [PUSHER]: this.handlePusherChange.bind(that), + [PLAYER]: this.handlePlayerListChange.bind(that), + }); + }, + }, +}); diff --git a/TUICallKit/TUICallKit/TUICallKit.json b/TUICallKit/TUICallKit/TUICallKit.json new file mode 100644 index 0000000..43e3f72 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.json @@ -0,0 +1,9 @@ +{ + "component": true, + "usingComponents": { + "SingleCall":"./component/SingleCall/SingleCall", + "GroupCall":"./component/GroupCall/GroupCall" + }, + "navigationStyle": "custom", + "disableScroll": true +} \ No newline at end of file diff --git a/TUICallKit/TUICallKit/TUICallKit.wxml b/TUICallKit/TUICallKit/TUICallKit.wxml new file mode 100644 index 0000000..05896d5 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.wxml @@ -0,0 +1,29 @@ + + + + diff --git a/TUICallKit/TUICallKit/TUICallKit.wxss b/TUICallKit/TUICallKit/TUICallKit.wxss new file mode 100644 index 0000000..135c364 --- /dev/null +++ b/TUICallKit/TUICallKit/TUICallKit.wxss @@ -0,0 +1,10 @@ +.TUICall-container { + width: 100vw; + height: 100vh; + overflow: hidden; + position: absolute; + top: 0; + left: 0; + z-index: 10; + margin: 0; +} \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js new file mode 100644 index 0000000..d1c5f1e --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js @@ -0,0 +1,116 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type: Object, + }, + callerUserInfo: { + type: Object + }, + remoteUserInfoList: { + type: Array, + }, + playerProcess: { + type: Object, + }, + isEarPhone: { + type: Boolean, + }, + }, + data: { + renderStreamList: [], + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_LOADING:`${PATH}/loading.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + }, + observers: { + "localUserInfo, remoteUserInfoList": function ( + localUserInfo, + remoteUserInfoList + ) { + this.setData({ + renderStreamList: [localUserInfo, ...remoteUserInfoList], + }); + }, + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + }, + async reject() { + await TUICallKitServer.reject(); + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml new file mode 100644 index 0000000..a94d708 --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml @@ -0,0 +1,285 @@ + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{callerUserInfo.nick || callerUserInfo.userId}} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{ callerUserInfo.nick || callerUserInfo.userId }} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{ item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss new file mode 100644 index 0000000..6f2a097 --- /dev/null +++ b/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss @@ -0,0 +1,754 @@ +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + + to { + transform: translateY(0); + } +} + +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100%; + height: 187px; +} + +.invite-call .local-video { + width: 100px; + height: 187px; +} + +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} + +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: 0; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.invite-calling-header-right { + display: flex; + align-items: center; +} + +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} + +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} + +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} + +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} + +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 120px auto 15px; +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.avatar { + background-color: black; +} + +/* 被叫者 */ +.invite-txt { + width: 126px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 16px auto 60px auto; +} + +.invite-other-txt { + width: 112px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 0 auto 24px auto; +} + +.invite-other-list { + position: absolute; + left: 14vw; + margin-top: 0 auto; + display: flex; + flex-wrap: wrap; + width: 272px; + justify-content: center; + flex-wrap: wrap; +} + +.invite-other-item { + flex: 0.25; + text-align: center; + max-width: 64px; + margin: 2px; +} + +.invite-other-item image { + border-radius: 10%; + max-width: 64px; + height: 64px; +} + +.invite-other-item-name { + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #666666; + letter-spacing: 0; + line-height: 18px; +} + +/* 全屏设置 */ +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.TUICalling-connected-video { + width: 100%; + height: 180%; +} + +/* 本地音频 */ +.stream-box { + float: left; + width: 187px; + height: 187px; + position: absolute; + top: 13vh; +} + +/* 远端音频列表 */ +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +/* 本地视频 */ +.play-item { + width: 100%; + height: 187px; + position: relative; + background-color: #000000; +} + +.pusher-ownvideo { + width: 100%; + height: 100%; +} + +/* 远端视频列表 */ +.swiper-list { + min-height: 189px; +} + +.player-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.player-item { + flex: 0.5; + min-width: 50%; + min-height: 187px; +} + +/* 音量图标 */ +.player-control { + background-color: rgba(0, 0, 0, 0.4); + border-radius: 0 6px 6px 0; + color: #fff; + z-index: 999; + position: absolute; + bottom: 0px; + left: 0px; + display: flex; + align-items: center; + height: 32px; + max-width: 50%; + z-index: 99; +} + +.player-control image { + width: 32px; + height: 32px; +} + +.player-control .name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-left: 10px; + margin-right: 10px; + flex: 1; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.control-buttons { + display: flex; +} + +.icon-button { + margin-right: 10px; +} + +/* 菜单 */ +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + font-weight: 400; + font-size: 14px; + color: #666666; + padding: 5px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + margin-top: 100px; + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.TRTCCalling-calling-list { + flex: 0.5; + /*设置最小宽度,才会让元素排不下,导致换行排列*/ + min-width: 50%; + min-height: 187px; + position: relative; +} + +.TRTCCalling-calling-list image { + width: 100%; + height: 100%; +} + +.TRTCCalling-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: -88px; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #666666; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js new file mode 100644 index 0000000..2958092 --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js @@ -0,0 +1,107 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type:Object + }, + remoteUserInfoList: { + type: Array, + }, + isEarPhone: { + type: Boolean, + }, + bigScreenUserId: { + type: Boolean + } + }, + data:{ + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + }, + async reject() { + await TUICallKitServer.reject(); + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async switchCallMediaType() { + await TUICallKitServer.switchCallMediaType(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + toggleViewSize() { + TUICallKitServer.switchScreen(this.data.bigScreenUserId ? 'player':'localVideo') + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml new file mode 100644 index 0000000..45c3bc2 --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + {{remoteUserInfoList[0].displayUserInfo}} + 等待对方接受 + + + + + + + + 邀请你视频通话 + 等待对方接受 + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + + + + + + 切到语音通话 + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + {{callDuration}} + + + + + + 切到语音通话 + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss new file mode 100644 index 0000000..06dee2d --- /dev/null +++ b/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss @@ -0,0 +1,508 @@ +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; + z-index: 9999; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.40); */ + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.30); */ + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100vw; + height: 100vh; + background-color: black; +} + +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + to { + transform: translateY(0); + } +} + +.invite-call .local-video { + width: 100vw; + height: 100vh; +} +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} +.btn-container { + display: flex; + align-items: center; + position: relative; +} +.invite-calling-header-left { + position: absolute; + right: 0; +} +.invite-calling-header-left image { + width: 32px; + height: 32px; +} +.invite-calling-header-right { + display: flex; + align-items: center; +} +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 140px auto 15px; + /* margin: 20vw 30vw; */ +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.invite-calling-list { + justify-content: flex-start; +} + +.invite-calling-item { + position: relative; + margin: 0 12px; +} +.invite-calling-item image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling-item-message { + position: absolute; + background: rgba(0, 0, 0, 0.5); + width: 100px; + height: 100px; + top: 0; + left: 0; + z-index: 2; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.avatar { + background: #dddddd; +} + +.player { + position: absolute; + right: 16px; + top: 107px; + width: 100px; + height: 178px; + padding: 16px; + z-index: 999; +} + +.pusher-video { + position: absolute; + width: 100%; + height: 100%; + z-index: 1; +} + +.stream-box { + position: relative; + float: left; + width: 50vw; + height: 260px; + /* background-color: #f75c45; */ + z-index: 3; +} + +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.live { + width: 100%; + height: 100%; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + color: #f0e9e9; + padding: 5px; + font-size: 14px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.mutil-img { + justify-content: flex-start !important; +} + +.TRTCCalling-call-audio-img { + display: flex; + flex-direction: column; + align-items: center; +} + +.TRTCCalling-call-audio-img > image { + width: 25vw; + height: 25vw; + margin: 0 4vw; + border-radius: 4vw; + position: relative; +} + +.TRTCCalling-call-audio-img text { + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-connected { + position: absolute; + right: -88px; +} + +.invite-calling-connected image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #ffffff; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} diff --git a/TUICallKit/TUICallKit/pages/globalCall/globalCall.js b/TUICallKit/TUICallKit/pages/globalCall/globalCall.js new file mode 100644 index 0000000..9b9130e --- /dev/null +++ b/TUICallKit/TUICallKit/pages/globalCall/globalCall.js @@ -0,0 +1,66 @@ +// TUICallKit/TUICallKit/pages/globalCall/globalCall.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/TUICallKit/TUICallKit/pages/globalCall/globalCall.json b/TUICallKit/TUICallKit/pages/globalCall/globalCall.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/TUICallKit/TUICallKit/pages/globalCall/globalCall.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml b/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml new file mode 100644 index 0000000..2f68333 --- /dev/null +++ b/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml @@ -0,0 +1,2 @@ + +TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml \ No newline at end of file diff --git a/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss b/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss new file mode 100644 index 0000000..53a9b4d --- /dev/null +++ b/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss @@ -0,0 +1 @@ +/* TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss */ \ No newline at end of file diff --git a/TUICallKit/TUICallService/CallService/bellContext.d.ts b/TUICallKit/TUICallService/CallService/bellContext.d.ts new file mode 100644 index 0000000..b3dd8e2 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/bellContext.d.ts @@ -0,0 +1,15 @@ +import { IBellParams } from '../interface/index'; +export declare class BellContext { + private _bellContext; + private _isMuteBell; + private _calleeBellFilePath; + private _callRole; + private _callStatus; + constructor(); + setBellSrc(): void; + setBellProperties(bellParams: IBellParams): void; + play(): Promise; + stop(): Promise; + setBellMute(enable: boolean): Promise; + destroy(): void; +} diff --git a/TUICallKit/TUICallService/CallService/bellContext.js b/TUICallKit/TUICallService/CallService/bellContext.js new file mode 100644 index 0000000..3afb593 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/bellContext.js @@ -0,0 +1,106 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BellContext = void 0; +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +const DEFAULT_CALLER_BELL_FILEPATH = '/TUICallKit/static/phone_dialing.mp3'; +const DEFAULT_CALLEE_BELL_FILEPATH = '/TUICallKit/static/phone_ringing.mp3'; +class BellContext { + constructor() { + this._bellContext = null; + this._isMuteBell = false; + this._calleeBellFilePath = DEFAULT_CALLEE_BELL_FILEPATH; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + // @ts-ignore + this._bellContext = wx.createInnerAudioContext(); + this._bellContext.loop = true; + } + setBellSrc() { + // @ts-ignore + const fs = wx.getFileSystemManager(); + try { + let playBellFilePath = DEFAULT_CALLER_BELL_FILEPATH; + if (this._callRole === index_1.CallRole.CALLEE) { + playBellFilePath = this._calleeBellFilePath || DEFAULT_CALLEE_BELL_FILEPATH; + } + fs.readFileSync(playBellFilePath, 'utf8', 0); + this._bellContext.src = playBellFilePath; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to setBellSrc, ${error}`); + } + } + setBellProperties(bellParams) { + this._callRole = bellParams.callRole || this._callRole; + this._callStatus = bellParams.callStatus || this._callStatus; + this._calleeBellFilePath = bellParams.calleeBellFilePath || this._calleeBellFilePath; + // undefined/false || isMuteBell => isMuteBell (不符合预期) + this._isMuteBell = (0, common_utils_1.isUndefined)(bellParams.isMuteBell) ? this._isMuteBell : bellParams.isMuteBell; + } + play() { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._callStatus !== index_1.CallStatus.CALLING) { + return; + } + this.setBellSrc(); + if (this._callRole === index_1.CallRole.CALLEE && !this._isMuteBell) { + yield this._bellContext.play(); + } + if (this._callRole === index_1.CallRole.CALLER) { + yield this._bellContext.play(); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to play audio file, ${error}`); + } + }); + } + stop() { + return __awaiter(this, void 0, void 0, function* () { + try { + this._bellContext.stop(); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to stop audio file, ${error}`); + } + }); + } + setBellMute(enable) { + return __awaiter(this, void 0, void 0, function* () { + if (this._callStatus !== index_1.CallStatus.CALLING && this._callRole !== index_1.CallRole.CALLEE) { + return; + } + if (enable) { + yield this.stop(); + } + else { + yield this.play(); + } + }); + } + destroy() { + try { + this._isMuteBell = false; + this._calleeBellFilePath = ''; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + this._bellContext.destroy(); + this._bellContext = null; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to destroy, ${error}`); + } + } +} +exports.BellContext = BellContext; diff --git a/TUICallKit/TUICallService/CallService/index.d.ts b/TUICallKit/TUICallService/CallService/index.d.ts new file mode 100644 index 0000000..c5872c6 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/index.d.ts @@ -0,0 +1,97 @@ +import { ITUICallService, ICallParams, IGroupCallParams, ICallbackParam, ISelfInfoParams, IInviteUserParams, IJoinInGroupCallParams, IInitParams } from '../interface/ICallService'; +import { LanguageType, LOG_LEVEL, VideoDisplayMode, VideoResolution } from '../const/index'; +import { ITUIGlobal } from '../interface/ITUIGlobal'; +import { ITUIStore } from '../interface/ITUIStore'; +declare const TUIGlobal: ITUIGlobal; +declare const TUIStore: ITUIStore; +export { TUIGlobal, TUIStore }; +export default class TUICallService implements ITUICallService { + static instance: TUICallService; + _tuiCallEngine: any; + private _tim; + private _TUICore; + private _timerId; + private _bellContext; + constructor(); + static getInstance(): TUICallService; + init(params: IInitParams): Promise; + destroyed(): Promise; + call(callParams: ICallParams): Promise; + groupCall(groupCallParams: IGroupCallParams): Promise; + inviteUser(params: IInviteUserParams): Promise; + joinInGroupCall(params: IJoinInGroupCallParams): Promise; + getTUICallEngineInstance(): any; + setLogLevel(level: LOG_LEVEL): void; + setLanguage(language: LanguageType): void; + enableFloatWindow(enable: boolean): void; + setSelfInfo(params: ISelfInfoParams): Promise; + setCallingBell(filePath?: string): Promise; + enableMuteMode(enable: boolean): Promise; + accept(): Promise; + hangup(): Promise; + reject(): Promise; + openCamera(videoViewDomID: string): Promise; + closeCamera(): Promise; + openMicrophone(): Promise; + closeMicrophone(): Promise; + switchScreen(userId: string): void; + switchCallMediaType(): Promise; + switchCamera(): Promise; + setSoundMode(type?: string): void; + getTim(): any; + private _addListenTuiCallEngineEvent; + private _removeListenTuiCallEngineEvent; + private _handleError; + private _handleNewInvitationReceived; + private _handleUserAccept; + private _handleUserEnter; + private _callerChangeToConnected; + private _handleUserLeave; + private _unNormalEventsManager; + private _handleInviteeReject; + private _handleNoResponse; + private _handleLineBusy; + private _handleCallingCancel; + private _handleCallingEnd; + private _handleSDKReady; + private _handleKickedOut; + private _handleCallTypeChange; + private _messageSentByMe; + private _handleUserUpdate; + private _handleCallError; + beforeCalling: ((...args: any[]) => void) | undefined; + afterCalling: ((...args: any[]) => void) | undefined; + onMinimized: ((...args: any[]) => void) | undefined; + onMessageSentByMe: ((...args: any[]) => void) | undefined; + kickedOut: ((...args: any[]) => void) | undefined; + statusChanged: ((...args: any[]) => void) | undefined; + setCallback(params: ICallbackParam): void; + toggleMinimize(): void; + private _executeExternalBeforeCalling; + private _executeExternalAfterCalling; + setVideoDisplayMode(displayMode: VideoDisplayMode): void; + setVideoResolution(resolution: VideoResolution): Promise; + private _handleExceptionExit; + private _setLocalUserInfoAudioVideoAvailable; + private _updateCallStoreBeforeCall; + private _updateCallStoreAfterCall; + private _resetCurrentDevice; + private _resetCallStore; + private _noDevicePermissionToast; + private _startTimer; + private _updateCallDuration; + private _stopTimer; + private _deleteRemoteUser; + private _analyzeEventData; + getGroupMemberList(count: number, offset: number): Promise; + getGroupProfile(): Promise; + private _handleCallStatusChange; + private _watchTUIStore; + private _unwatchTUIStore; + bindTUICore(TUICore: any): void; + private _callTUIService; + onNotifyEvent(eventName: string, subKey: string): Promise; + onCall(method: String, params: any): Promise; + private _handleTUICoreOnClick; + onGetExtension(extensionID: string, params: any): any[]; +} diff --git a/TUICallKit/TUICallService/CallService/index.js b/TUICallKit/TUICallService/CallService/index.js new file mode 100644 index 0000000..02072c9 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/index.js @@ -0,0 +1,1147 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TUIStore = exports.TUIGlobal = void 0; +const tui_core_1 = require("@tencentcloud/tui-core"); +const index_1 = require("../const/index"); +// @ts-ignore +const tuicall_engine_wx_1 = require("tuicall-engine-wx"); +const index_2 = require("../locales/index"); +const miniProgram_1 = require("./miniProgram"); +const bellContext_1 = require("./bellContext"); +const index_3 = require("../utils/validate/index"); +const common_utils_1 = require("../utils/common-utils"); +const utils_1 = require("./utils"); +const timer_1 = __importDefault(require("../utils/timer")); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const tuiStore_1 = __importDefault(require("../TUIStore/tuiStore")); +const TUIGlobal = tuiGlobal_1.default.getInstance(); +exports.TUIGlobal = TUIGlobal; +const TUIStore = tuiStore_1.default.getInstance(); +exports.TUIStore = TUIStore; +const version = '2.1.1'; +class TUICallService { + constructor() { + this._tim = null; + this._TUICore = null; + this._timerId = -1; + this._bellContext = null; + // =========================【监听 TUIStore 中的状态】========================= + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + const bellParams = { + callRole: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE), + callStatus: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS), + }; + this._bellContext.setBellProperties(bellParams); + if (value === index_1.CallStatus.CALLING) { + yield ((_a = this === null || this === void 0 ? void 0 : this._bellContext) === null || _a === void 0 ? void 0 : _a.play()); + } + else { + // 状态变更通知 + if (value === index_1.CallStatus.CONNECTED) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const oldStatus = isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + this.statusChanged && this.statusChanged({ oldStatus, newStatus: (0, utils_1.generateStatusChangeText)(TUIStore) }); + if (!isGroup && callMediaType === index_1.CallMediaType.VIDEO) { + this.switchScreen(remoteUserInfoList[0].domId); + } + } + yield ((_b = this === null || this === void 0 ? void 0 : this._bellContext) === null || _b === void 0 ? void 0 : _b.stop()); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}handleCallStatusChange, ${error}.`); + } + }); + console.log(`${index_1.NAME.PREFIX}version: ${version}`); + this._watchTUIStore(); + this._bellContext = new bellContext_1.BellContext(); + // 下面:TUICore注册事件,注册组件服务,注册界面拓展 + tui_core_1.TUICore.registerEvent(tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED, tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this); + tui_core_1.TUICore.registerService(tui_core_1.TUIConstants.TUICalling.SERVICE.NAME, this); + tui_core_1.TUICore.registerExtension(tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID, this); + } + static getInstance() { + if (!TUICallService.instance) { + TUICallService.instance = new TUICallService(); + } + return TUICallService.instance; + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._tuiCallEngine) + return; + // @ts-ignore + let { userID, tim, userSig, sdkAppID, SDKAppID, isFromChat } = params; + if (this._TUICore) { + sdkAppID = this._TUICore.SDKAppID; + tim = this._TUICore.tim; + } + this._tim = tim; + console.log(`${index_1.NAME.PREFIX}init sdkAppId: ${sdkAppID || SDKAppID}, userId: ${userID}`); + this._tuiCallEngine = tuicall_engine_wx_1.TUICallEngine.createInstance({ + tim, + // @ts-ignore + sdkAppID: sdkAppID || SDKAppID, + callkitVersion: version, + chat: isFromChat || false, + }); + this._addListenTuiCallEngineEvent(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, { userId: userID }); + yield this._tuiCallEngine.login({ userID, userSig, assetsPath: '' }); // web && mini + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}init failed, error: ${error}.`); + throw error; + } + }); + } + // component destroy + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + try { + const currentCallStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (currentCallStatus !== index_1.CallStatus.IDLE) { + throw new Error(`please destroyed when status is idle, current status: ${currentCallStatus}`); + } + if (this._tuiCallEngine) { + this._removeListenTuiCallEngineEvent(); + yield this._tuiCallEngine.destroyInstance(); + this._tuiCallEngine = null; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}destroyed failed, error: ${error}.`); + throw error; + } + }); + } + // ===============================【通话操作】=============================== + call(callParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { type, userID } = callParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + yield this._updateCallStoreBeforeCall(type, [{ userId: userID }]); + this._executeExternalBeforeCalling(); // 执行外部传入的 beforeCall 方法 + const response = yield this._tuiCallEngine.call(callParams); + yield this._updateCallStoreAfterCall([userID], response); + } + catch (error) { + this._handleCallError(error, 'call'); + } + }); + } + ; + groupCall(groupCallParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList, type, groupID } = groupCallParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + const remoteUserInfoList = userIDList.map(userId => ({ userId })); + yield this._updateCallStoreBeforeCall(type, remoteUserInfoList, groupID); + this._executeExternalBeforeCalling(); + const response = yield this._tuiCallEngine.groupCall(groupCallParams); + yield this._updateCallStoreAfterCall(userIDList, response); + } + catch (error) { + this._handleCallError(error, 'groupCall'); + } + }); + } + inviteUser(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList } = params; + let inviteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(userIDList, this.getTim(), TUIStore); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, [...remoteUserInfoList, ...inviteUserInfoList]); + this._tuiCallEngine && (yield this._tuiCallEngine.inviteUser(params)); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}inviteUser failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + joinInGroupCall(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: true, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CONNECTED, + [index_1.NAME.CALL_MEDIA_TYPE]: params.type, + [index_1.NAME.GROUP_ID]: params.groupID, + [index_1.NAME.ROOM_ID]: params.roomID, + }; + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const response = yield this._tuiCallEngine.joinInGroupCall(params); + (params.type === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response); + this.setSoundMode(params.type === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}joinInGroupCall failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + // ===============================【其它对外接口】=============================== + getTUICallEngineInstance() { + return (this === null || this === void 0 ? void 0 : this._tuiCallEngine) || null; + } + setLogLevel(level) { + var _a; + (_a = this === null || this === void 0 ? void 0 : this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.setLogLevel(level); + } + setLanguage(language) { + if (language && Object.values(index_1.LanguageType).includes(language)) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LANGUAGE, language); + } + } + enableFloatWindow(enable) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ENABLE_FLOAT_WINDOW, enable); + } + setSelfInfo(params) { + return __awaiter(this, void 0, void 0, function* () { + const { nickName, avatar } = params; + try { + yield this._tuiCallEngine.setSelfInfo(nickName, avatar); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSelfInfo failed, error: ${error}.`); + } + }); + } + // 修改默认铃声:只支持本地铃声文件,不支持在线铃声文件;修改铃声修改的是被叫的铃声 + setCallingBell(filePath) { + return __awaiter(this, void 0, void 0, function* () { + let isCheckFileExist = true; + if (!isCheckFileExist) { + console.warn(`${index_1.NAME.PREFIX}setCallingBell failed, filePath: ${filePath}.`); + return; + } + const bellParams = { calleeBellFilePath: filePath }; + this._bellContext.setBellProperties(bellParams); + }); + } + enableMuteMode(enable) { + return __awaiter(this, void 0, void 0, function* () { + try { + const bellParams = { isMuteBell: enable }; + this._bellContext.setBellProperties(bellParams); + yield this._bellContext.setBellMute(enable); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}enableMuteMode failed, error: ${error}.`); + } + }); + } + // =============================【内部按钮操作方法】============================= + accept() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.accept(); + if (response) { + // 小程序接通时会进行授权弹框, 状态需要放在 accept 后, 否则先接通后再拉起权限设置 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini default open audio + } + } + catch (error) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + this._resetCallStore(); + } + }); + } + hangup() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.hangup(); + response === null || response === void 0 ? void 0 : response.forEach((item) => { + var _a; + if ((item === null || item === void 0 ? void 0 : item.code) === 0) { + this._callTUIService({ message: (_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.message }); + } + }); + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + reject() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.reject(); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + openCamera(videoViewDomID) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openCamera(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.VIDEO); + } + catch (error) { + this._noDevicePermissionToast(error, index_1.CallMediaType.VIDEO); + console.error(`${index_1.NAME.PREFIX}openCamera error: ${error}.`); + } + }); + } + closeCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeCamera(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.VIDEO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeCamera error: ${error}.`); + } + }); + } + openMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}openMicrophone failed, error: ${error}.`); + } + }); + } + closeMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeMicrophone failed, error: ${error}.`); + } + }); + } + switchScreen(userId) { + if (!userId) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.BIG_SCREEN_USER_ID, userId); + } + // support video to audio; not support audio to video + switchCallMediaType() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (callMediaType === index_1.CallMediaType.AUDIO) { + console.warn(`${index_1.NAME.PREFIX}switchCallMediaType failed, ${callMediaType} not support.`); + return; + } + const response = yield this._tuiCallEngine.switchCallMediaType(index_1.CallMediaType.AUDIO); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, index_1.CallMediaType.AUDIO); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const oldStatus = isGroup ? index_1.StatusChange.CALLING_GROUP_VIDEO : index_1.StatusChange.CALLING_C2C_VIDEO; + const newStatus = (0, utils_1.generateStatusChangeText)(TUIStore); + this.statusChanged && this.statusChanged({ oldStatus, newStatus }); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}switchCallMediaType failed, error: ${error}.`); + } + }); + } + switchCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.switchCamera(); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}_switchCamera failed, error: ${error}.`); + } + }); + } + setSoundMode(type) { + var _a; + try { + let isEarPhone = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE); + const soundMode = type || (isEarPhone ? index_1.AudioPlayBackDevice.SPEAKER : index_1.AudioPlayBackDevice.EAR); // UI 层切换时传参数 + (_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.selectAudioPlaybackDevice(soundMode); + if (type) { + isEarPhone = type === index_1.AudioPlayBackDevice.EAR; + } + else { + isEarPhone = !isEarPhone; + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE, isEarPhone); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSoundMode failed, error: ${error}.`); + } + } + // 切前后置 miniProgram, 切扬声器 + getTim() { + var _a, _b; + if (this._tim) + return this._tim; + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}getTim warning: _tuiCallEngine Instance is not available.`); + return null; + } + return ((_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.tim) || ((_b = this._tuiCallEngine) === null || _b === void 0 ? void 0 : _b.getTim()); // mini support getTim interface + } + // ==========================【TUICallEngine 事件处理】========================== + _addListenTuiCallEngineEvent() { + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}add engine event listener failed, engine is empty.`); + return; + } + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.ERROR, this._handleError, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived, this); // 收到邀请事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept, this); // 主叫收到被叫接通事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter, this); // 有用户进房事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave, this); // 有用户离开通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject, this); // 主叫收到被叫的拒绝通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse, this); // 主叫收到被叫的无应答事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy, this); // 主叫收到被叫的忙线事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel, this); // 主被叫在通话未建立时, 收到的取消事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady, this); // SDK Ready 回调 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut, this); // 未开启多端登录时, 多端登录收到的被踢事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd, this); // 主被叫在通话结束时, 收到的通话结束事件 + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange, this); + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate, this); // mini: user data update + } + _removeListenTuiCallEngineEvent() { + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.ERROR, this._handleError); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd); + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange); // 切换通话事件 miniProgram CALL_MODE + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate); // mini: user data update + } + _handleError(event) { + const { code, message } = event || {}; + const index = Object.values(index_1.ErrorCode).indexOf(code); + let callTips = ''; + if (index !== -1) { + const key = Object.keys(index_1.ErrorCode)[index]; + callTips = (0, index_2.t)(index_1.ErrorMessage[key]); + callTips && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text: callTips, type: index_1.NAME.ERROR }); + } + this._executeExternalAfterCalling(); + console.error(`${index_1.NAME.PREFIX}_handleError, errorCode: ${code}; errorMessage: ${callTips || message}.`); + } + _handleNewInvitationReceived(event) { + return __awaiter(this, void 0, void 0, function* () { + console.log(`${index_1.NAME.PREFIX}onCallReceived event data: ${JSON.stringify(event)}.`); + const { sponsor = '', isFromGroup, callMediaType, inviteData = {}, calleeIdList = [], groupID = '' } = this._analyzeEventData(event); + const currentUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + const remoteUserIdList = [sponsor, ...calleeIdList.filter((userId) => userId !== currentUserInfo.userId)]; + const type = callMediaType || inviteData.callType; + const callTipsKey = type === index_1.CallMediaType.AUDIO ? index_2.CallTips.CALLEE_CALLING_AUDIO_MSG : index_2.CallTips.CALLEE_CALLING_VIDEO_MSG; + let updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: isFromGroup, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CALLING, + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(callTipsKey), + [index_1.NAME.CALLER_USER_INFO]: { userId: sponsor }, + [index_1.NAME.GROUP_ID]: groupID, + }; + (0, miniProgram_1.initAndCheckRunEnv)(); + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + this._executeExternalBeforeCalling(); + this.statusChanged && this.statusChanged({ oldStatus: index_1.StatusChange.IDLE, newStatus: index_1.StatusChange.BE_INVITED }); + const remoteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(remoteUserIdList, this.getTim(), TUIStore); + const [userInfo] = remoteUserInfoList.filter((userInfo) => userInfo.userId === sponsor); + remoteUserInfoList.length > 0 && TUIStore.updateStore({ + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.CALLER_USER_INFO]: { + userId: sponsor, + nick: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.nick) || '', + avatar: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) || '', + }, + }, index_1.StoreName.CALL); + }); + } + _handleUserAccept(event) { + this._callerChangeToConnected(); + console.log(`${index_1.NAME.PREFIX}accept event data: ${JSON.stringify(event)}.`); + } + _handleUserEnter(event) { + return __awaiter(this, void 0, void 0, function* () { + this._callerChangeToConnected(); + const { userID: userId, data } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const isInRemoteUserList = remoteUserInfoList.find(item => (item === null || item === void 0 ? void 0 : item.userId) === userId); + if (!isInRemoteUserList) { + remoteUserInfoList.push({ userId }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + const [userInfo] = yield (0, utils_1.getRemoteUserProfile)([userId], this.getTim(), TUIStore); + remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + remoteUserInfoList.forEach((obj) => { + if ((obj === null || obj === void 0 ? void 0 : obj.userId) === userId) { + obj = Object.assign(obj, userInfo); + } + }); + } + remoteUserInfoList = remoteUserInfoList.map((obj) => { + if (obj.userId === userId) + obj.isEnter = true; + return obj; + }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + console.log(`${index_1.NAME.PREFIX}userEnter event data: ${JSON.stringify(event)}.`); + }); + } + _callerChangeToConnected() { + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.CALLING && callRole === index_1.CallRole.CALLER) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._startTimer(); + } + } + _handleUserLeave(event) { + console.log(`${index_1.NAME.PREFIX}userLeave event data: ${JSON.stringify(event)}.`); + const { data, userID: userId } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP)) { + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + const text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.END_CALL, prefix); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + } + userId && this._deleteRemoteUser([userId]); + } + _unNormalEventsManager(event, eventName) { + console.log(`${index_1.NAME.PREFIX}${eventName} event data: ${JSON.stringify(event)}.`); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + switch (eventName) { + case tuicall_engine_wx_1.EVENT.REJECT: + case tuicall_engine_wx_1.EVENT.LINE_BUSY: { + const { userID: userId } = this._analyzeEventData(event); + let callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.OTHER_SIDE_REJECT_CALL : index_2.CallTips.OTHER_SIDE_LINE_BUSY; + let text = (0, utils_1.generateText)(TUIStore, callTipsKey); + if (isGroup) { + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.REJECT_CALL : index_2.CallTips.IN_BUSY; + text = (0, utils_1.generateText)(TUIStore, callTipsKey, prefix); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userId && this._deleteRemoteUser([userId]); + break; + } + case tuicall_engine_wx_1.EVENT.NO_RESP: { + const { userIDList = [] } = this._analyzeEventData(event); + const callTipsKey = isGroup ? index_2.CallTips.TIMEOUT : index_2.CallTips.CALL_TIMEOUT; + const userInfoList = userIDList.map(userId => { + const userInfo = remoteUserInfoList.find(obj => obj.userId === userId) || {}; + return userInfo.displayUserInfo || userId; + }); + const text = isGroup ? (0, utils_1.generateText)(TUIStore, callTipsKey, userInfoList.join()) : (0, utils_1.generateText)(TUIStore, callTipsKey); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userIDList.length > 0 && this._deleteRemoteUser(userIDList); + break; + } + case tuicall_engine_wx_1.EVENT.CALLING_CANCEL: { + // TUIStore.update(StoreName.CALL, NAME.TOAST_INFO, { text: generateText(TUIStore, CallTips.CANCEL) }); + this._resetCallStore(); + break; + } + } + } + _handleInviteeReject(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.REJECT); + } + _handleNoResponse(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.NO_RESP); + } + _handleLineBusy(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.LINE_BUSY); + } + _handleCallingCancel(event) { + this._executeExternalAfterCalling(); + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.CALLING_CANCEL); + } + _handleCallingEnd(event) { + console.log(`${index_1.NAME.PREFIX}callEnd event data: ${JSON.stringify(event)}.`); + this._executeExternalAfterCalling(); + this._resetCallStore(); + } + // SDK_READY 后才能调用 tim 接口, 否则登录后立刻获取导致调用接口失败. v2.27.4+、v3 接口 login 后会抛出 SDK_READY + _handleSDKReady(event) { + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + localUserInfo = yield (0, utils_1.getMyProfile)(localUserInfo.userId, this.getTim(), TUIStore); // 方法里已经 try...catch 了 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + }); + } + _handleKickedOut(event) { + console.log(`${index_1.NAME.PREFIX}kickOut event data: ${JSON.stringify(event)}.`); + this.kickedOut && this.kickedOut(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_TIPS, (0, utils_1.generateText)(TUIStore, index_2.CallTips.KICK_OUT)); + this._resetCallStore(); + } + _handleCallTypeChange(event) { + const { newCallType, type } = this._analyzeEventData(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, newCallType || type); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + _messageSentByMe(event) { + const message = event === null || event === void 0 ? void 0 : event.data; + this.onMessageSentByMe && this.onMessageSentByMe(message); + } + // ==========================【 miniProgram 私有事件】========================== + _handleUserUpdate(event) { + const data = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.pusher) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, data.pusher); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + } + // 处理 “呼叫” 抛出的异常 + _handleCallError(error, methodName) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + (0, miniProgram_1.handlePackageError)(error); // 无套餐提示, 小程序 engine 不抛出 onError + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + console.error(`${index_1.NAME.PREFIX}${methodName} failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + setCallback(params) { + const { beforeCalling, afterCalling, onMinimized, onMessageSentByMe, kickedOut, statusChanged } = params; + beforeCalling && (this.beforeCalling = beforeCalling); + afterCalling && (this.afterCalling = afterCalling); + onMinimized && (this.onMinimized = onMinimized); + onMessageSentByMe && (this.onMessageSentByMe = onMessageSentByMe); + kickedOut && (this.kickedOut = kickedOut); + statusChanged && (this.statusChanged = statusChanged); + } + toggleMinimize() { + const isMinimized = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED, !isMinimized); + console.log(`${index_1.NAME.PREFIX}toggleMinimize: ${isMinimized} -> ${!isMinimized}.`); + this.onMinimized && this.onMinimized(isMinimized, !isMinimized); + } + _executeExternalBeforeCalling() { + this.beforeCalling && this.beforeCalling(); + } + _executeExternalAfterCalling() { + this.afterCalling && this.afterCalling(); + } + // ========================【TUICallKit 组件属性设置方法】======================== + setVideoDisplayMode(displayMode) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DISPLAY_MODE, displayMode); + } + setVideoResolution(resolution) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (!resolution) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.VIDEO_RESOLUTION, resolution); + yield this._tuiCallEngine.setVideoQuality(resolution); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}setVideoResolution failed, error: ${error}.`); + } + }); + } + // =========================【 miniProgram 私有公共方法】========================= + // 处理用户异常退出的情况,处理了右滑退出,以及返回退出的情况。 + _handleExceptionExit() { + return __awaiter(this, void 0, void 0, function* () { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + // 在呼叫状态下, 被叫调用 reject,主叫调用 hangup + if (callStatus === index_1.CallStatus.CALLING) { + callRole === index_1.CallRole.CALLER && (yield this.hangup()); + callRole === index_1.CallRole.CALLEE && (yield this.reject()); + } + // 在通话状态下, 统一调用 hangup 接口 + callStatus === index_1.CallStatus.CONNECTED && (yield this.hangup()); + }); + } + _setLocalUserInfoAudioVideoAvailable(isAvailable, type) { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + if (type === index_1.NAME.AUDIO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isAudioAvailable: isAvailable }); + } + if (type === index_1.NAME.VIDEO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isVideoAvailable: isAvailable }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + } + _updateCallStoreBeforeCall(type, remoteUserInfoList, groupID) { + return __awaiter(this, void 0, void 0, function* () { + let updateStoreParams = { + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLER, + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.IS_GROUP]: !!groupID, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(index_2.CallTips.CALLER_CALLING_MSG), + [index_1.NAME.GROUP_ID]: groupID + }; + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const callStatus = yield (0, miniProgram_1.beforeCall)(type, this); // 如果没有权限, 此时为 false. 因此需要在 call 后设置为 calling. 和 web 存在差异 + console.log(`${index_1.NAME.PREFIX}mini beforeCall return callStatus: ${callStatus}.`); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, callStatus); + const remoteUserInfoLists = yield (0, utils_1.getRemoteUserProfile)(remoteUserInfoList.map(obj => obj.userId), this.getTim(), TUIStore); + remoteUserInfoLists.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoLists); + }); + } + _updateCallStoreAfterCall(userIdList, response) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + if (response) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ROOM_ID, response.roomID); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CALLING); // 小程序未授权时, 此时状态为 idle; web 直接设置为 calling + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini, default open audio + } + else { + this._resetCallStore(); + } + }); + } + _resetCurrentDevice() { + // 挂断后,重置当前摄像头和麦克风为默认设备 + const { cameraList, microphoneList } = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST, { microphoneList, cameraList, currentCamera: (cameraList === null || cameraList === void 0 ? void 0 : cameraList[0]) || {}, currentMicrophone: (microphoneList === null || microphoneList === void 0 ? void 0 : microphoneList[0]) || {} }); + } + _resetCallStore() { + const oldStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + this._stopTimer(); + // localUserInfo, language 在通话结束后不需要清除 + // callStatus 清除需要通知; isMinimized 也需要通知(basic-vue3 中切小窗关闭后, 再呼叫还是小窗, 因此需要通知到组件侧) + // isGroup 也不清除(engine 先抛 cancel 事件, 再抛 reject 事件) + // displayMode、videoResolution 也不能清除, 组件不卸载, 这些属性也需保留, 否则采用默认值. + // enableFloatWindow 不清除:开启/关闭悬浮窗功能。 + let notResetOrNotifyKeys = Object.keys(index_1.CALL_DATA_KEY).filter((key) => { + switch (index_1.CALL_DATA_KEY[key]) { + case index_1.NAME.CALL_STATUS: + case index_1.NAME.LANGUAGE: + case index_1.NAME.IS_GROUP: + case index_1.NAME.DISPLAY_MODE: + case index_1.NAME.VIDEO_RESOLUTION: + case index_1.NAME.ENABLE_FLOAT_WINDOW: + case index_1.NAME.LOCAL_USER_INFO: { + return false; + } + default: { + return true; + } + } + }); + notResetOrNotifyKeys = notResetOrNotifyKeys.map(key => index_1.CALL_DATA_KEY[key]); + TUIStore.reset(index_1.StoreName.CALL, notResetOrNotifyKeys); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + callStatus !== index_1.CallStatus.IDLE && TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.CALL_STATUS], true); // callStatus reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_MINIMIZED], true); // isMinimized reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_EAR_PHONE], true); // isEarPhone reset need notify + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO)), { isVideoAvailable: false, isAudioAvailable: false })); + this._resetCurrentDevice(); + const newStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + if (oldStatusStr !== newStatusStr) { + this.statusChanged && this.statusChanged({ oldStatus: oldStatusStr, newStatus: newStatusStr }); + } + } + _noDevicePermissionToast(error, type) { + if ((0, common_utils_1.handleNoDevicePermissionError)(error)) { + let text = ''; + if (type === index_1.CallMediaType.AUDIO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_MICROPHONE_DEVICE_PERMISSION); + } + if (type === index_1.CallMediaType.VIDEO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_CAMERA_DEVICE_PERMISSION); + } + text && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text, type: index_1.NAME.ERROR }); + console.error(`${index_1.NAME.PREFIX}call failed, error: ${error.message}.`); + } + } + // 通话时长更新 + _startTimer() { + if (this._timerId === -1) { + this._timerId = timer_1.default.run(index_1.NAME.TIMEOUT, this._updateCallDuration.bind(this), { delay: 1000 }); + } + } + _updateCallDuration() { + let callDurationStr = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION); + const callDurationNum = (0, common_utils_1.formatTimeInverse)(callDurationStr); + callDurationStr = (0, common_utils_1.formatTime)(callDurationNum + 1); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION, callDurationStr); + } + _stopTimer() { + if (this._timerId !== -1) { + timer_1.default.clearTask(this._timerId); + this._timerId = -1; + } + } + _deleteRemoteUser(userIdList) { + if (userIdList.length === 0) + return; + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + userIdList.forEach((userId) => { + remoteUserInfoList = remoteUserInfoList.filter((obj) => obj.userId !== userId); + }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + } + _analyzeEventData(event) { + return (event === null || event === void 0 ? void 0 : event.data) || {}; // mini INVITED + } + // =========================【调用 chat api】========================= + // 获取群成员 + getGroupMemberList(count, offset) { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + let groupMemberList = yield (0, utils_1.getGroupMemberList)(groupID, this.getTim(), count, offset); + return groupMemberList; + }); + } + // 获取群信息 + getGroupProfile() { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + return yield (0, utils_1.getGroupProfile)(groupID, this.getTim()); + }); + } + _watchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _unwatchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + // =========================【web 融合 chat 提供的方法】========================= + bindTUICore(TUICore) { + this._TUICore = TUICore; + } + // 下面方法用于接入 TUICore + _callTUIService(params) { + const { message } = params || {}; + tui_core_1.TUICore.callService({ + serviceName: tui_core_1.TUIConstants.TUIChat.SERVICE.NAME, + method: tui_core_1.TUIConstants.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST, + params: { message }, + }); + } + onNotifyEvent(eventName, subKey) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (eventName === tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED) { + if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) { + // TUICallkit 收到登录成功时执行自己的业务逻辑处理 + // @ts-ignore + const { chat, userID, userSig, SDKAppID } = tui_core_1.TUILogin.getContext(); + yield this.init({ tim: chat, userID, userSig, sdkAppID: SDKAppID, isFromChat: true }); + } + else if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS) { + yield this.destroyed(); + } + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}TUICore onNotifyEvent failed, error: ${error}.`); + } + }); + } + onCall(method, params) { + return __awaiter(this, void 0, void 0, function* () { + if (method === tui_core_1.TUIConstants.TUICalling.SERVICE.METHOD.START_CALL) { + yield this._handleTUICoreOnClick(params, params.type); + } + }); + } + _handleTUICoreOnClick(options, type) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { groupID, userIDList = [] } = options, rest = __rest(options, ["groupID", "userIDList"]); + if (groupID) { + yield this.groupCall(Object.assign({ groupID, userIDList, type }, rest)); + } + else if (userIDList.length === 1) { + yield this.call(Object.assign({ userID: userIDList[0], type }, rest)); + } + } + catch (error) { + console.debug(error); + } + }); + } + onGetExtension(extensionID, params) { + if (extensionID === tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID) { + const list = []; + const audioCallExtension = { + weight: 1000, + text: '语音通话', + icon: index_1.AudioCallIcon, + data: { + name: 'voiceCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.AUDIO); }), // 点击时发起通话 + }, + }; + const videoCallExtension = { + weight: 900, + text: '视频通话', + icon: index_1.VideoCallIcon, + data: { + name: 'videoCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.VIDEO); }), // 点击时发起通话 + }, + }; + if (!(params === null || params === void 0 ? void 0 : params.filterVoice)) { + list.push(audioCallExtension); + } + if (!(params === null || params === void 0 ? void 0 : params.filterVideo)) { + list.push(videoCallExtension); + } + return list; + } + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.init), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "init", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.call), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "call", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.groupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "groupCall", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.inviteUser), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "inviteUser", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.joinInGroupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "joinInGroupCall", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setLanguage), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setLanguage", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableFloatWindow), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "enableFloatWindow", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setSelfInfo), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setSelfInfo", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setCallingBell), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setCallingBell", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableMuteMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "enableMuteMode", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "accept", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "hangup", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "reject", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "switchScreen", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCallMediaType", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setSoundMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoDisplayMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setVideoDisplayMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoResolution), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setVideoResolution", null); +exports.default = TUICallService; diff --git a/TUICallKit/TUICallService/CallService/miniProgram.d.ts b/TUICallKit/TUICallService/CallService/miniProgram.d.ts new file mode 100644 index 0000000..bd5ede2 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/miniProgram.d.ts @@ -0,0 +1,6 @@ +import { CallMediaType, CallStatus } from '../const/index'; +export declare function initialUI(): void; +export declare function checkRunPlatform(): void; +export declare function initAndCheckRunEnv(): void; +export declare function beforeCall(type: CallMediaType, that: any): Promise; +export declare function handlePackageError(error: any): void; diff --git a/TUICallKit/TUICallService/CallService/miniProgram.js b/TUICallKit/TUICallService/CallService/miniProgram.js new file mode 100644 index 0000000..c279d08 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/miniProgram.js @@ -0,0 +1,76 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handlePackageError = exports.beforeCall = exports.initAndCheckRunEnv = exports.checkRunPlatform = exports.initialUI = void 0; +const index_1 = require("../const/index"); +function initialUI() { + // 收起键盘 + // @ts-ignore + wx.hideKeyboard({ + complete: () => { }, + }); +} +exports.initialUI = initialUI; +; +// 检测运行时环境, 当是微信开发者工具时, 提示用户需要手机调试 +function checkRunPlatform() { + // @ts-ignore + const systemInfo = wx.getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + // 当前运行在微信开发者工具里 + // @ts-ignore + wx.showModal({ + icon: 'none', + title: '运行环境提醒', + content: '微信开发者工具不支持原生推拉流组件(即 标签),请使用真机调试或者扫码预览。', + showCancel: false, + }); + } +} +exports.checkRunPlatform = checkRunPlatform; +; +function initAndCheckRunEnv() { + initialUI(); // miniProgram 收起键盘, 隐藏 tabBar + checkRunPlatform(); // miniProgram 检测运行时环境 +} +exports.initAndCheckRunEnv = initAndCheckRunEnv; +function beforeCall(type, that) { + return __awaiter(this, void 0, void 0, function* () { + try { + initAndCheckRunEnv(); + // 检查设备权限 + const deviceMap = { + microphone: true, + camera: type === index_1.CallMediaType.VIDEO, + }; + const hasDevicePermission = yield that._tuiCallEngine.deviceCheck(deviceMap); // miniProgram 检查设备权限 + return hasDevicePermission ? index_1.CallStatus.CALLING : index_1.CallStatus.IDLE; + } + catch (error) { + console.debug(error); + return index_1.CallStatus.IDLE; + } + }); +} +exports.beforeCall = beforeCall; +// 套餐问题提示, 小程序最低需要群组通话版, 1v1 通话版本使用 TRTC 就会报错 +function handlePackageError(error) { + if ((error === null || error === void 0 ? void 0 : error.code) === -1002) { + // @ts-ignore + wx.showModal({ + icon: 'none', + title: 'error', + content: (error === null || error === void 0 ? void 0 : error.message) || '', + showCancel: false, + }); + } +} +exports.handlePackageError = handlePackageError; diff --git a/TUICallKit/TUICallService/CallService/utils.d.ts b/TUICallKit/TUICallService/CallService/utils.d.ts new file mode 100644 index 0000000..ee19134 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/utils.d.ts @@ -0,0 +1,9 @@ +import { IUserInfo } from '../interface/ICallService'; +import { ITUIStore } from '../interface/ITUIStore'; +export declare function setDefaultUserInfo(userId: string, domId?: string): IUserInfo; +export declare function getMyProfile(myselfUserId: string, tim: any, TUIStore: any): Promise; +export declare function getRemoteUserProfile(userIdList: Array, tim: any, TUIStore: any): Promise; +export declare function generateText(TUIStore: ITUIStore, key: string, prefix?: string, suffix?: string): string; +export declare function generateStatusChangeText(TUIStore: ITUIStore): string; +export declare function getGroupMemberList(groupID: string, tim: any, count: any, offset: any): Promise; +export declare function getGroupProfile(groupID: string, tim: any): Promise; diff --git a/TUICallKit/TUICallService/CallService/utils.js b/TUICallKit/TUICallService/CallService/utils.js new file mode 100644 index 0000000..0eaed04 --- /dev/null +++ b/TUICallKit/TUICallService/CallService/utils.js @@ -0,0 +1,167 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGroupProfile = exports.getGroupMemberList = exports.generateStatusChangeText = exports.generateText = exports.getRemoteUserProfile = exports.getMyProfile = exports.setDefaultUserInfo = void 0; +const index_1 = require("../const/index"); +const index_2 = require("../locales/index"); +// 设置默认的 UserInfo 信息 +function setDefaultUserInfo(userId, domId) { + const userInfo = { + userId, + nick: '', + avatar: '', + remark: '', + displayUserInfo: '', + isAudioAvailable: false, + isVideoAvailable: false, + isEnter: false, + domId: domId || userId, + }; + return domId ? userInfo : Object.assign(Object.assign({}, userInfo), { isEnter: false }); // localUserInfo 没有 isEnter, remoteUserInfoList 有 isEnter +} +exports.setDefaultUserInfo = setDefaultUserInfo; +// 获取个人用户信息 +function getMyProfile(myselfUserId, tim, TUIStore) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = setDefaultUserInfo(myselfUserId, index_1.NAME.LOCAL_VIDEO); + try { + if (!tim) + return localUserInfo; + const res = yield tim.getMyProfile(); + const currentLocalUserInfo = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); // localUserInfo may have been updated + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + localUserInfo = Object.assign(Object.assign(Object.assign({}, localUserInfo), currentLocalUserInfo), { userId: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.userID, nick: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.nick, avatar: (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.avatar }); + } + return localUserInfo; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getMyProfile failed, error: ${error}.`); + return localUserInfo; + } + }); +} +exports.getMyProfile = getMyProfile; +// 获取远端用户列表信息 +function getRemoteUserProfile(userIdList, tim, TUIStore) { + return __awaiter(this, void 0, void 0, function* () { + let remoteUserInfoList = userIdList.map((userId) => setDefaultUserInfo(userId)); + try { + if (!tim) + return remoteUserInfoList; + const res = yield tim.getFriendProfile({ userIDList: userIdList }); + if (res.code === 0) { + const { friendList = [], failureUserIDList = [] } = res.data; + let unFriendList = failureUserIDList.map((obj) => obj.userID); + if (failureUserIDList.length > 0) { + const res = yield tim.getUserProfile({ userIDList: failureUserIDList.map((obj) => obj.userID) }); + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + unFriendList = (res === null || res === void 0 ? void 0 : res.data) || []; + } + } + const currentRemoteUserInfoList = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); // remoteUserInfoList may have been updated + const tempFriendIdList = friendList.map((obj) => obj.userID); + const tempUnFriendIdList = unFriendList.map((obj) => obj.userID); + remoteUserInfoList = userIdList.map((userId) => { + var _a, _b, _c, _d, _e, _f, _g; + const defaultUserInfo = setDefaultUserInfo(userId); + const friendListIndex = tempFriendIdList.indexOf(userId); + const unFriendListIndex = tempUnFriendIdList.indexOf(userId); + let remark = ''; + let nick = ''; + let displayUserInfo = ''; + let avatar = ''; + if (friendListIndex !== -1) { + remark = ((_a = friendList[friendListIndex]) === null || _a === void 0 ? void 0 : _a.remark) || ''; + nick = ((_c = (_b = friendList[friendListIndex]) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.nick) || ''; + displayUserInfo = remark || nick || defaultUserInfo.userId || ''; + avatar = ((_e = (_d = friendList[friendListIndex]) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.avatar) || ''; + } + if (unFriendListIndex !== -1) { + nick = ((_f = unFriendList[unFriendListIndex]) === null || _f === void 0 ? void 0 : _f.nick) || ''; + displayUserInfo = nick || defaultUserInfo.userId || ''; + avatar = ((_g = unFriendList[unFriendListIndex]) === null || _g === void 0 ? void 0 : _g.avatar) || ''; + } + const userInfo = currentRemoteUserInfoList.find(subObj => subObj.userId === userId) || {}; + return Object.assign(Object.assign(Object.assign({}, defaultUserInfo), userInfo), { remark, nick, displayUserInfo, avatar }); + }); + } + return remoteUserInfoList; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getRemoteUserProfile failed, error: ${error}.`); + return remoteUserInfoList; + } + }); +} +exports.getRemoteUserProfile = getRemoteUserProfile; +// 生成弹框提示文案 +function generateText(TUIStore, key, prefix, suffix) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + let callTips = `${(0, index_2.t)(key)}`; + if (isGroup) { + callTips = prefix ? `${prefix} ${callTips}` : callTips; + callTips = suffix ? `${callTips} ${suffix}` : callTips; + } + return callTips; +} +exports.generateText = generateText; +// 生成 statusChange 抛出的字符串 +function generateStatusChangeText(TUIStore) { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.IDLE) { + return index_1.StatusChange.IDLE; + } + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + if (callStatus === index_1.CallStatus.CALLING) { + return isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + } + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (isGroup) { + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_GROUP_AUDIO : index_1.StatusChange.CALLING_GROUP_VIDEO; + } + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_C2C_AUDIO : index_1.StatusChange.CALLING_C2C_VIDEO; +} +exports.generateStatusChangeText = generateStatusChangeText; +// 获取群组[offset, count + offset]区间成员 +function getGroupMemberList(groupID, tim, count, offset) { + return __awaiter(this, void 0, void 0, function* () { + let groupMemberList = []; + try { + const res = yield tim.getGroupMemberList({ groupID, count, offset }); + if (res.code === 0) { + return res.data.memberList || groupMemberList; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupMember failed, error: ${error}.`); + return groupMemberList; + } + }); +} +exports.getGroupMemberList = getGroupMemberList; +// 获取 IM 群信息 +function getGroupProfile(groupID, tim) { + return __awaiter(this, void 0, void 0, function* () { + let groupProfile = {}; + try { + const res = yield tim.getGroupProfile({ groupID }); + if (res.code === 0) { + return res.data.group || groupProfile; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupProfile failed, error: ${error}.`); + return groupProfile; + } + }); +} +exports.getGroupProfile = getGroupProfile; diff --git a/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts new file mode 100644 index 0000000..81b787d --- /dev/null +++ b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts @@ -0,0 +1,21 @@ +import { ITUIGlobal } from '../interface/ITUIGlobal'; +export default class TUIGlobal implements ITUIGlobal { + static instance: TUIGlobal; + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + constructor(); + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance(): TUIGlobal; + initEnv(): void; + initOfficial(SDKAppID: number): void; +} diff --git a/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js new file mode 100644 index 0000000..049ac74 --- /dev/null +++ b/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const env_1 = require("../utils/env"); +class TUIGlobal { + constructor() { + this.global = env_1.APP_NAMESPACE; + this.isPC = false; + this.isH5 = false; + this.isWeChat = false; + this.isApp = false; + this.isUniPlatform = false; + this.isOfficial = false; + this.isWIN = false; + this.isMAC = false; + this.initEnv(); + } + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance() { + if (!TUIGlobal.instance) { + TUIGlobal.instance = new TUIGlobal(); + } + return TUIGlobal.instance; + } + initEnv() { + this.isPC = env_1.IS_PC; + this.isH5 = env_1.IS_H5; + this.isWeChat = env_1.IN_WX_MINI_APP; + this.isApp = env_1.IN_UNI_NATIVE_APP && !env_1.IN_WX_MINI_APP; // uniApp 打包小程序时 IN_UNI_NATIVE_APP 为 true,所以此处需要增加条件 + this.isUniPlatform = env_1.IN_UNI_APP; + this.isWIN = env_1.IS_WIN; + this.isMAC = env_1.IS_MAC; + } + initOfficial(SDKAppID) { + this.isOfficial = (SDKAppID === 1400187352 || SDKAppID === 1400188366); + } +} +exports.default = TUIGlobal; diff --git a/TUICallKit/TUICallService/TUIStore/callStore.d.ts b/TUICallKit/TUICallService/TUIStore/callStore.d.ts new file mode 100644 index 0000000..b9ada5a --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/callStore.d.ts @@ -0,0 +1,8 @@ +import { ICallStore } from '../interface/ICallStore'; +export default class CallStore { + defaultStore: ICallStore; + store: ICallStore; + update(key: keyof ICallStore, data: any): void; + getData(key: string | undefined): any; + reset(keyList?: Array): void; +} diff --git a/TUICallKit/TUICallService/TUIStore/callStore.js b/TUICallKit/TUICallService/TUIStore/callStore.js new file mode 100644 index 0000000..8ac66ef --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/callStore.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +class CallStore { + constructor() { + this.defaultStore = { + callStatus: index_1.CallStatus.IDLE, + callRole: index_1.CallRole.UNKNOWN, + callMediaType: index_1.CallMediaType.UNKNOWN, + localUserInfo: { userId: '' }, + remoteUserInfoList: [], + callerUserInfo: { userId: '' }, + isGroup: false, + callDuration: '00:00:00', + callTips: '', + toastInfo: { text: '' }, + isMinimized: false, + enableFloatWindow: false, + bigScreenUserId: '', + language: (0, common_utils_1.getLanguage)(), + isClickable: false, + deviceList: { cameraList: [], microphoneList: [], currentCamera: {}, currentMicrophone: {} }, + showPermissionTip: false, + groupID: '', + roomID: 0, + // TUICallKit 组件上的属性 + displayMode: index_1.VideoDisplayMode.COVER, + videoResolution: index_1.VideoResolution.RESOLUTION_480P, + showSelectUser: false, + // 小程序相关属性 + pusher: {}, + player: [], + isEarPhone: false, // 是否是听筒, 默认: false + }; + this.store = Object.assign({}, this.defaultStore); + } + ; + update(key, data) { + switch (key) { + // case 'callTips': + // break; + default: + // resolve "Type 'any' is not assignable to type 'never'.ts", ref: https://github.com/microsoft/TypeScript/issues/31663 + this.store[key] = data; + } + } + getData(key) { + if (!key) + return this.store; + return this.store[key]; + } + // reset call store + reset(keyList = []) { + if (keyList.length === 0) { + keyList = Object.keys(this.store); + } + const resetToDefault = keyList.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: this.defaultStore[key] })), {}); + this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), resetToDefault); + } +} +exports.default = CallStore; diff --git a/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts b/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts new file mode 100644 index 0000000..964ae33 --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts @@ -0,0 +1,50 @@ +import { ITUIStore, IOptions, Task } from '../interface/ITUIStore'; +import { StoreName } from '../const/index'; +export default class TUIStore implements ITUIStore { + static instance: TUIStore; + task: Task; + private storeMap; + private timerId; + constructor(); + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance(): TUIStore; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName: StoreName, options: IOptions): void; + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName: StoreName, key: string): any; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + private notify; + reset(storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean): void; + updateStore(params: any, name?: StoreName): void; +} diff --git a/TUICallKit/TUICallService/TUIStore/tuiStore.js b/TUICallKit/TUICallService/TUIStore/tuiStore.js new file mode 100644 index 0000000..7acaa59 --- /dev/null +++ b/TUICallKit/TUICallService/TUIStore/tuiStore.js @@ -0,0 +1,155 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const callStore_1 = __importDefault(require("./callStore")); +const common_utils_1 = require("../utils/common-utils"); +class TUIStore { + constructor() { + this.timerId = -1; + this.storeMap = { + [index_1.StoreName.CALL]: new callStore_1.default(), + }; + // todo 此处后续优化结构后调整 + this.task = {}; // 保存监听回调列表 + } + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance() { + if (!TUIStore.instance) { + TUIStore.instance = new TUIStore(); + } + return TUIStore.instance; + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName, options, params) { + if (!this.task[storeName]) { + this.task[storeName] = {}; + } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + const callback = options[key]; + if (!watcher[key]) { + watcher[key] = new Map(); + } + watcher[key].set(callback, 1); + const { notifyRangeWhenWatch } = params || {}; + // 注册监听后, 通知所有注册该 key 的监听,使用 'all' 时要特别注意是否对其他地方的监听产生影响 + if (notifyRangeWhenWatch === index_1.NAME.ALL) { + this.notify(storeName, key); + } + // 注册监听后, 仅通知自己本次监听该 key 的数据 + if (notifyRangeWhenWatch === index_1.NAME.MYSELF) { + const data = this.getData(storeName, key); + callback.call(this, data); + } + }); + } + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName, options) { + // todo 该接口暂未支持,unwatch掉同一类,如仅传入store注销掉该store下的所有callback,同样options仅传入key注销掉该key下的所有callback + // options的callback function为必填参数,后续修改 + if (!this.task[storeName]) { + return; + } + ; + // if (isString(options)) { + // // 移除所有的监听 + // if (options === '*') { + // const watcher = this.task[storeName]; + // Object.keys(watcher).forEach(key => { + // watcher[key].clear(); + // }); + // } else { + // console.warn(`${NAME.PREFIX}unwatch warning: options is ${options}`); + // } + // return; + // } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + watcher[key].delete(options[key]); + }); + } + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName, key, data) { + var _a; + // 基本数据类型时, 如果相等, 就不进行更新, 减少不必要的 notify + if ((0, common_utils_1.isString)(data) || (0, common_utils_1.isNumber)(data) || (0, common_utils_1.isBoolean)(data)) { + const currentData = this.storeMap[storeName]['store'][key]; // eslint-disable-line + if (currentData === data) + return; + } + (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.update(key, data); + this.notify(storeName, key); + } + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName, key) { + var _a; + return (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.getData(key); + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + notify(storeName, key) { + if (!this.task[storeName]) { + return; + } + const watcher = this.task[storeName]; + if (watcher[key]) { + const callbackMap = watcher[key]; + const data = this.getData(storeName, key); + for (const [callback] of callbackMap.entries()) { + callback.call(this, data); + } + } + } + reset(storeName, keyList = [], isNotificationNeeded = false) { + if (storeName in this.storeMap) { + const store = this.storeMap[storeName]; + // reset all + if (keyList.length === 0) { + keyList = Object.keys(store === null || store === void 0 ? void 0 : store.store); + } + store.reset(keyList); + if (isNotificationNeeded) { + keyList.forEach((key) => { + this.notify(storeName, key); + }); + } + } + } + // 批量修改多个 key-value + updateStore(params, name) { + const storeName = name ? name : index_1.StoreName.CALL; + Object.keys(params).forEach((key) => { + this.update(storeName, key, params[key]); + }); + } +} +exports.default = TUIStore; diff --git a/TUICallKit/TUICallService/const/call.d.ts b/TUICallKit/TUICallService/const/call.d.ts new file mode 100644 index 0000000..8af20c4 --- /dev/null +++ b/TUICallKit/TUICallService/const/call.d.ts @@ -0,0 +1,93 @@ +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +export declare enum StoreName { + CALL = "call", + CUSTOM = "custom" +} +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallMediaType { + UNKNOWN = 0, + AUDIO = 1, + VIDEO = 2 +} +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +export declare enum CallRole { + UNKNOWN = "unknown", + CALLEE = "callee", + CALLER = "caller" +} +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallStatus { + IDLE = "idle", + CALLING = "calling", + CONNECTED = "connected" +} +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +export declare enum VideoDisplayMode { + CONTAIN = "contain", + COVER = "cover", + FILL = "fill" +} +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +export declare enum VideoResolution { + RESOLUTION_480P = "480p", + RESOLUTION_720P = "720p", + RESOLUTION_1080P = "1080p" +} +export declare enum LanguageType { + EN = "en", + 'ZH-CN' = "zh-cn", + JA_JP = "ja_JP" +} +export type TDeviceList = { + cameraList: any[]; + microphoneList: any[]; + currentCamera: any; + currentMicrophone: any; +}; +export declare const StatusChange: { + readonly IDLE: "idle"; + readonly BE_INVITED: "be-invited"; + readonly DIALING_C2C: "dialing-c2c"; + readonly DIALING_GROUP: "dialing-group"; + readonly CALLING_C2C_AUDIO: "calling-c2c-audio"; + readonly CALLING_C2C_VIDEO: "calling-c2c-video"; + readonly CALLING_GROUP_AUDIO: "calling-group-audio"; + readonly CALLING_GROUP_VIDEO: "calling-group-video"; +}; +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +export declare enum AudioPlayBackDevice { + EAR = "ear", + SPEAKER = "speaker" +} +export declare enum DeviceType { + MICROPHONE = "microphone", + CAMERA = "camera" +} diff --git a/TUICallKit/TUICallService/const/call.js b/TUICallKit/TUICallService/const/call.js new file mode 100644 index 0000000..e6a9f63 --- /dev/null +++ b/TUICallKit/TUICallService/const/call.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeviceType = exports.AudioPlayBackDevice = exports.StatusChange = exports.LanguageType = exports.VideoResolution = exports.VideoDisplayMode = exports.CallStatus = exports.CallRole = exports.CallMediaType = exports.StoreName = void 0; +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +var StoreName; +(function (StoreName) { + StoreName["CALL"] = "call"; + StoreName["CUSTOM"] = "custom"; +})(StoreName = exports.StoreName || (exports.StoreName = {})); +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallMediaType; +(function (CallMediaType) { + CallMediaType[CallMediaType["UNKNOWN"] = 0] = "UNKNOWN"; + CallMediaType[CallMediaType["AUDIO"] = 1] = "AUDIO"; + CallMediaType[CallMediaType["VIDEO"] = 2] = "VIDEO"; +})(CallMediaType = exports.CallMediaType || (exports.CallMediaType = {})); +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +var CallRole; +(function (CallRole) { + CallRole["UNKNOWN"] = "unknown"; + CallRole["CALLEE"] = "callee"; + CallRole["CALLER"] = "caller"; +})(CallRole = exports.CallRole || (exports.CallRole = {})); +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallStatus; +(function (CallStatus) { + CallStatus["IDLE"] = "idle"; + CallStatus["CALLING"] = "calling"; + CallStatus["CONNECTED"] = "connected"; +})(CallStatus = exports.CallStatus || (exports.CallStatus = {})); +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +var VideoDisplayMode; +(function (VideoDisplayMode) { + VideoDisplayMode["CONTAIN"] = "contain"; + VideoDisplayMode["COVER"] = "cover"; + VideoDisplayMode["FILL"] = "fill"; +})(VideoDisplayMode = exports.VideoDisplayMode || (exports.VideoDisplayMode = {})); +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +var VideoResolution; +(function (VideoResolution) { + VideoResolution["RESOLUTION_480P"] = "480p"; + VideoResolution["RESOLUTION_720P"] = "720p"; + VideoResolution["RESOLUTION_1080P"] = "1080p"; +})(VideoResolution = exports.VideoResolution || (exports.VideoResolution = {})); +// 支持的语言 +var LanguageType; +(function (LanguageType) { + LanguageType["EN"] = "en"; + LanguageType["ZH-CN"] = "zh-cn"; + LanguageType["JA_JP"] = "ja_JP"; +})(LanguageType = exports.LanguageType || (exports.LanguageType = {})); +/* === 【原来 TUICallKit 对外暴露】=== */ +// 原来 web callKit 定义通知外部状态变更的变量, 对外暴露 +exports.StatusChange = { + IDLE: "idle", + BE_INVITED: "be-invited", + DIALING_C2C: "dialing-c2c", + DIALING_GROUP: "dialing-group", + CALLING_C2C_AUDIO: "calling-c2c-audio", + CALLING_C2C_VIDEO: "calling-c2c-video", + CALLING_GROUP_AUDIO: "calling-group-audio", + CALLING_GROUP_VIDEO: "calling-group-video", +}; +/* === 【小程序使用】=== */ +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +var AudioPlayBackDevice; +(function (AudioPlayBackDevice) { + AudioPlayBackDevice["EAR"] = "ear"; + AudioPlayBackDevice["SPEAKER"] = "speaker"; +})(AudioPlayBackDevice = exports.AudioPlayBackDevice || (exports.AudioPlayBackDevice = {})); +; +var DeviceType; +(function (DeviceType) { + DeviceType["MICROPHONE"] = "microphone"; + DeviceType["CAMERA"] = "camera"; +})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); diff --git a/TUICallKit/TUICallService/const/error.d.ts b/TUICallKit/TUICallService/const/error.d.ts new file mode 100644 index 0000000..000d4a0 --- /dev/null +++ b/TUICallKit/TUICallService/const/error.d.ts @@ -0,0 +1,2 @@ +export declare const ErrorCode: any; +export declare const ErrorMessage: any; diff --git a/TUICallKit/TUICallService/const/error.js b/TUICallKit/TUICallService/const/error.js new file mode 100644 index 0000000..1449c3c --- /dev/null +++ b/TUICallKit/TUICallService/const/error.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorMessage = exports.ErrorCode = void 0; +// 错误码 +exports.ErrorCode = { + SWITCH_TO_AUDIO_CALL_FAILED: 60001, + SWITCH_TO_VIDEO_CALL_FAILED: 60002, + MICROPHONE_UNAVAILABLE: 60003, + CAMERA_UNAVAILABLE: 60004, + BAN_DEVICE: 60005, + NOT_SUPPORTED_WEBRTC: 60006, + ERROR_BLACKLIST: 20007, +}; +exports.ErrorMessage = { + SWITCH_TO_AUDIO_CALL_FAILED: 'switchToAudioCall-call-failed', + SWITCH_TO_VIDEO_CALL_FAILED: 'switchToVideoCall-call-failed', + MICROPHONE_UNAVAILABLE: 'microphone-unavailable', + CAMERA_UNAVAILABLE: 'camera-unavailable', + BAN_DEVICE: 'ban-device', + NOT_SUPPORTED_WEBRTC: 'not-supported-webrtc', + ERROR_BLACKLIST: 'blacklist-user-tips' +}; diff --git a/TUICallKit/TUICallService/const/index.d.ts b/TUICallKit/TUICallService/const/index.d.ts new file mode 100644 index 0000000..a81bc31 --- /dev/null +++ b/TUICallKit/TUICallService/const/index.d.ts @@ -0,0 +1,12 @@ +export * from './call'; +export * from './error'; +export * from './log'; +export declare const CALL_DATA_KEY: any; +export declare const NAME: any; +export declare const AudioCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call.png"; +export declare const VideoCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg"; +export declare const MAX_NUMBER_ROOM_ID = 2147483647; +export declare enum PLATFORM { + MAC = "mac", + WIN = "win" +} diff --git a/TUICallKit/TUICallService/const/index.js b/TUICallKit/TUICallService/const/index.js new file mode 100644 index 0000000..3ca1e32 --- /dev/null +++ b/TUICallKit/TUICallService/const/index.js @@ -0,0 +1,60 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PLATFORM = exports.MAX_NUMBER_ROOM_ID = exports.VideoCallIcon = exports.AudioCallIcon = exports.NAME = exports.CALL_DATA_KEY = void 0; +__exportStar(require("./call"), exports); +__exportStar(require("./error"), exports); +__exportStar(require("./log"), exports); +// import { keys } from 'ts-transformer-keys'; +// import { ICallStore } from '../interface/store'; +// console.warn('--> ', keys()) +exports.CALL_DATA_KEY = { + CALL_STATUS: 'callStatus', + CALL_ROLE: 'callRole', + CALL_MEDIA_TYPE: 'callMediaType', + LOCAL_USER_INFO: 'localUserInfo', + REMOTE_USER_INFO_LIST: 'remoteUserInfoList', + CALLER_USER_INFO: 'callerUserInfo', + IS_GROUP: 'isGroup', + CALL_DURATION: 'callDuration', + CALL_TIPS: 'callTips', + TOAST_INFO: 'toastInfo', + IS_MINIMIZED: 'isMinimized', + ENABLE_FLOAT_WINDOW: 'enableFloatWindow', + BIG_SCREEN_USER_ID: 'bigScreenUserId', + LANGUAGE: 'language', + IS_CLICKABLE: 'isClickable', + DISPLAY_MODE: 'displayMode', + VIDEO_RESOLUTION: 'videoResolution', + PUSHER: 'pusher', + PLAYER: 'player', + IS_EAR_PHONE: 'isEarPhone', + SHOW_PERMISSION_TIP: 'SHOW_PERMISSION_TIP', + GROUP_ID: 'groupID', + ROOM_ID: 'roomID', + SHOW_SELECT_USER: 'showSelectUser', +}; +exports.NAME = Object.assign({ PREFIX: '【CallService】', AUDIO: 'audio', VIDEO: 'video', LOCAL_VIDEO: 'localVideo', ERROR: 'error', TIMEOUT: 'timeout', RAF: 'raf', INTERVAL: 'interval', DEFAULT: 'default', BOOLEAN: 'boolean', STRING: 'string', NUMBER: 'number', OBJECT: 'object', ARRAY: 'array', FUNCTION: 'function', UNDEFINED: "undefined", ALL: 'all', MYSELF: 'myself', DEVICE_LIST: 'deviceList' }, exports.CALL_DATA_KEY); +exports.AudioCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call.png'; +exports.VideoCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg'; +exports.MAX_NUMBER_ROOM_ID = 2147483647; +var PLATFORM; +(function (PLATFORM) { + // eslint-disable-next-line no-unused-vars + PLATFORM["MAC"] = "mac"; + // eslint-disable-next-line no-unused-vars + PLATFORM["WIN"] = "win"; +})(PLATFORM = exports.PLATFORM || (exports.PLATFORM = {})); diff --git a/TUICallKit/TUICallService/const/log.d.ts b/TUICallKit/TUICallService/const/log.d.ts new file mode 100644 index 0000000..d265832 --- /dev/null +++ b/TUICallKit/TUICallService/const/log.d.ts @@ -0,0 +1,7 @@ +export declare enum LOG_LEVEL { + NORMAL = 0, + RELEASE = 1, + WARNING = 2, + ERROR = 3, + NONE = 4 +} diff --git a/TUICallKit/TUICallService/const/log.js b/TUICallKit/TUICallService/const/log.js new file mode 100644 index 0000000..44c05fc --- /dev/null +++ b/TUICallKit/TUICallService/const/log.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LOG_LEVEL = void 0; +/* eslint-disable */ +// 唯一一个变量格式有问题的, 但是为了和原来 TUICallKit 对外暴露的保持一致 +var LOG_LEVEL; +(function (LOG_LEVEL) { + LOG_LEVEL[LOG_LEVEL["NORMAL"] = 0] = "NORMAL"; + LOG_LEVEL[LOG_LEVEL["RELEASE"] = 1] = "RELEASE"; + LOG_LEVEL[LOG_LEVEL["WARNING"] = 2] = "WARNING"; + LOG_LEVEL[LOG_LEVEL["ERROR"] = 3] = "ERROR"; + LOG_LEVEL[LOG_LEVEL["NONE"] = 4] = "NONE"; +})(LOG_LEVEL = exports.LOG_LEVEL || (exports.LOG_LEVEL = {})); diff --git a/TUICallKit/TUICallService/index.d.ts b/TUICallKit/TUICallService/index.d.ts new file mode 100644 index 0000000..fc8bcff --- /dev/null +++ b/TUICallKit/TUICallService/index.d.ts @@ -0,0 +1,5 @@ +import TUICallService, { TUIGlobal, TUIStore } from './CallService/index'; +import { StoreName, NAME, CallRole, CallMediaType, CallStatus, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice } from './const/index'; +import { t } from './locales/index'; +declare const TUICallKitServer: TUICallService; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, CallStatus, CallRole, CallMediaType, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice, t, }; diff --git a/TUICallKit/TUICallService/index.js b/TUICallKit/TUICallService/index.js new file mode 100644 index 0000000..4c86f2e --- /dev/null +++ b/TUICallKit/TUICallService/index.js @@ -0,0 +1,44 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.AudioPlayBackDevice = exports.VideoDisplayMode = exports.VideoResolution = exports.StatusChange = exports.CallMediaType = exports.CallRole = exports.CallStatus = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = __importStar(require("./CallService/index")); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +const index_2 = require("./const/index"); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_2.StoreName; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_2.NAME; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_2.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_2.CallMediaType; } }); +Object.defineProperty(exports, "CallStatus", { enumerable: true, get: function () { return index_2.CallStatus; } }); +Object.defineProperty(exports, "StatusChange", { enumerable: true, get: function () { return index_2.StatusChange; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_2.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_2.VideoDisplayMode; } }); +Object.defineProperty(exports, "AudioPlayBackDevice", { enumerable: true, get: function () { return index_2.AudioPlayBackDevice; } }); +const index_3 = require("./locales/index"); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_3.t; } }); +// 实例化 +const TUICallKitServer = index_1.default.getInstance(); +exports.TUICallKitServer = TUICallKitServer; diff --git a/TUICallKit/TUICallService/interface/ICallService.d.ts b/TUICallKit/TUICallService/interface/ICallService.d.ts new file mode 100644 index 0000000..2e6eff1 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallService.d.ts @@ -0,0 +1,93 @@ +import { CallStatus, CallRole } from '../const/index'; +/** + * @interface ITUICallService +*/ +export interface ITUICallService { + /** + * 初始化 Service + * @function + * @private + */ + init(params: any): void; + /** + * 1v1 通话 + * @function + * @param {SwitchUserStatusParams} options 用户状态控制参数 + */ + call(callParams: ICallParams): void; +} +type SDKAppID = { + SDKAppID: number; +} | { + sdkAppID: number; +}; +export interface IInitParamsBase { + userID: string; + userSig: string; + tim?: any; + isFromChat?: boolean; +} +export type IInitParams = IInitParamsBase & SDKAppID; +export interface ICallParams { + userID: string; + type: number; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IGroupCallParams { + userIDList: Array; + type: number; + groupID: string; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IUserInfo { + userId: string; + nick?: string; + avatar?: string; + remark?: string; + displayUserInfo?: string; + isAudioAvailable?: boolean; + isVideoAvailable?: boolean; + volume?: number; + isEnter?: boolean; + domId?: string; +} +export interface IOfflinePushInfo { + title?: string; + description?: string; + androidOPPOChannelID?: string; + extension: String; +} +export interface ICallbackParam { + beforeCalling?: (...args: any[]) => void; + afterCalling?: (...args: any[]) => void; + onMinimized?: (...args: any[]) => void; + onMessageSentByMe?: (...args: any[]) => void; + kickedOut?: (...args: any[]) => void; + statusChanged?: (...args: any[]) => void; +} +export interface ISelfInfoParams { + nickName: string; + avatar: string; +} +export interface IBellParams { + callRole?: CallRole; + callStatus?: CallStatus; + isMuteBell?: boolean; + calleeBellFilePath?: string; +} +export interface IInviteUserParams { + userIDList: string[]; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IJoinInGroupCallParams { + type: number; + groupID: string; + roomID: number; +} +export {}; diff --git a/TUICallKit/TUICallService/interface/ICallService.js b/TUICallKit/TUICallService/interface/ICallService.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallService.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/ICallStore.d.ts b/TUICallKit/TUICallService/interface/ICallStore.d.ts new file mode 100644 index 0000000..9dcd2e2 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallStore.d.ts @@ -0,0 +1,33 @@ +import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList } from '../const/index'; +import { IUserInfo } from './index'; +export interface IToastInfo { + text: string; + type?: string; +} +export interface ICallStore { + callStatus: CallStatus; + callRole: CallRole; + callMediaType: CallMediaType; + localUserInfo: IUserInfo; + remoteUserInfoList: Array; + callerUserInfo: IUserInfo; + isGroup: boolean; + callDuration: string; + callTips: string; + toastInfo: IToastInfo; + isMinimized: boolean; + enableFloatWindow: boolean; + bigScreenUserId: string; + language: string; + isClickable: boolean; + showPermissionTip: boolean; + deviceList: TDeviceList; + groupID: string; + roomID: number; + displayMode: VideoDisplayMode; + videoResolution: VideoResolution; + pusher: any; + player: any[]; + isEarPhone: boolean; + showSelectUser: boolean; +} diff --git a/TUICallKit/TUICallService/interface/ICallStore.js b/TUICallKit/TUICallService/interface/ICallStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ICallStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts b/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts new file mode 100644 index 0000000..91b86ce --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts @@ -0,0 +1,36 @@ +/** + * @interface TUIGlobal + * @property {Object} global 根据运行环境代理 wx、uni、window + * @property {Boolean} isPC true 标识是 pc 网页 + * @property {Boolean} isH5 true 标识是 手机 H5 + * @property {Boolean} isWeChat true 标识是 微信小程序 + * @property {Boolean} isApp true 标识是 uniapp 打包的 native app + * @property {Boolean} isUniPlatform true 标识当前应用是通过 uniapp 平台打包的产物 + * @property {Boolean} isOfficial true 标识是腾讯云官网 Demo 应用 + * @property {Boolean} isWIN true 标识是window系统pc + * @property {Boolean} isMAC true 标识是mac os系统pc +*/ +export interface ITUIGlobal { + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + /** + * 初始化 TUIGlobal 环境变量 + * @function + * @private + */ + initEnv(): void; + /** + * 初始化 isOfficial + * @function + * @param {number} SDKAppID 当前实例的应用 SDKAppID + * @private + */ + initOfficial(SDKAppID: number): void; +} diff --git a/TUICallKit/TUICallService/interface/ITUIGlobal.js b/TUICallKit/TUICallService/interface/ITUIGlobal.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIGlobal.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/ITUIStore.d.ts b/TUICallKit/TUICallService/interface/ITUIStore.d.ts new file mode 100644 index 0000000..5784ffa --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIStore.d.ts @@ -0,0 +1,75 @@ +import { StoreName } from '../const/index'; +export type Task = Record void, 1>>>; +export interface IOptions { + [key: string]: (newData?: any) => void; +} +/** + * @class TUIStore + * @property {ICustomStore} customStore 自定义 store,可根据业务需要通过以下 API 进行数据操作。 +*/ +export interface ITUIStore { + task: Task; + /** + * UI 组件注册监听 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options UI 组件注册的监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围 + * @example + * // UI 层监听会话列表更新通知 + * let onConversationListUpdated = function(conversationList) { + * console.warn(conversationList); + * } + * TUIStore.watch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 组件取消监听回调 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回调等 + * @example + * // UI 层取消监听会话列表更新通知 + * TUIStore.unwatch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + unwatch(storeName: StoreName, options: IOptions | string): void; + /** + * 获取 store 中的数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要获取的 key + * @private + */ + getData(storeName: StoreName, key: string): any; + /** + * 更新 store + * - 需要使用自定义 store 时可以用此 API 更新自定义数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要更新的 key + * @example + * // UI 层更新自定义 Store 数据 + * TUIStore.update(StoreName.CUSTOM, 'customKey', 'customData') + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 重置 store 内数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {Array} keyList 需要 reset 的 keyList + * @param {boolean} isNotificationNeeded 是否需要触发更新 + * @private + */ + reset: (storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean) => void; + /** + * 修改多个 key-value + * @param {Object} params 多个 key-value 组成的 object + * @param {StoreName} storeName store 名称 + */ + updateStore: (params: any, name?: StoreName) => void; +} diff --git a/TUICallKit/TUICallService/interface/ITUIStore.js b/TUICallKit/TUICallService/interface/ITUIStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUICallKit/TUICallService/interface/ITUIStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUICallKit/TUICallService/interface/index.d.ts b/TUICallKit/TUICallService/interface/index.d.ts new file mode 100644 index 0000000..5f8f48c --- /dev/null +++ b/TUICallKit/TUICallService/interface/index.d.ts @@ -0,0 +1,4 @@ +export * from './ICallService'; +export * from './ICallStore'; +export * from './ITUIGlobal'; +export * from './ITUIStore'; diff --git a/TUICallKit/TUICallService/interface/index.js b/TUICallKit/TUICallService/interface/index.js new file mode 100644 index 0000000..ed699ff --- /dev/null +++ b/TUICallKit/TUICallService/interface/index.js @@ -0,0 +1,20 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./ICallService"), exports); +__exportStar(require("./ICallStore"), exports); +__exportStar(require("./ITUIGlobal"), exports); +__exportStar(require("./ITUIStore"), exports); diff --git a/TUICallKit/TUICallService/locales/en.d.ts b/TUICallKit/TUICallService/locales/en.d.ts new file mode 100644 index 0000000..c7efd74 --- /dev/null +++ b/TUICallKit/TUICallService/locales/en.d.ts @@ -0,0 +1,90 @@ +export declare const en: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'no response from the other side': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'no-user': string; + 'member-not-added': string; + 'input-phone-userID': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'Use-phone-and-computer': string; + 'Wechat scan right QR code': string; + 'Scan the QR code above': string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUICallKit/TUICallService/locales/en.js b/TUICallKit/TUICallService/locales/en.js new file mode 100644 index 0000000..9188607 --- /dev/null +++ b/TUICallKit/TUICallService/locales/en.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.en = void 0; +exports.en = { + 'hangup': 'Hang up', + 'reject': 'Decline', + 'other side reject call': 'other side reject call', + 'reject call': 'Reject Call', + 'accept': 'Accept', + 'cancel': 'Cancel Call', + 'other side line busy': 'other side line busy', + 'in busy': 'in busy', + 'call timeout': 'call timeout', + 'no response from the other side': 'no response from the other side', + 'end call': 'end call', + 'timeout': 'timeout', + 'kick out': 'kick out', + 'caller calling message': 'Waiting for the callee to accept the invitation...', + 'callee calling video message': 'You are invited to a video call...', + 'callee calling audio message': 'You are invited to a audio call...', + 'no microphone access': 'no microphone access', + 'no camera access': 'no camera access', + 'invite member': 'Invite Member', + 'speaker': 'speaker', + 'Invited group call': 'Invited you to a group call', + 'Those involved': 'Those involved in the call are', + 'call': 'call', + 'video-call': 'video call', + 'audio-call': 'audio call', + 'search': 'search', + 'search-result': 'search result', + 'no-user': 'user not found', + 'member-not-added': 'member not added', + 'input-phone-userID': 'phone number or userID', + 'not-login': 'not logged in', + 'login-status-expire': 'login status is invalid, please refresh the page and try again', + 'experience-multi-call': 'experience multi-person calls, please download the full-featured demo: ', + 'not-support-multi-call': 'multi-person call interface is not open', + 'userID': 'userID', + 'already-enter': 'entered the call', + 'waiting': 'Calling...', + 'camera-opened': 'Camera on', + 'camera-closed': 'Camera off', + 'microphone-opened': 'Mic on', + 'microphone-closed': 'Mic off', + 'camera': 'Camera', + 'microphone': 'Microphone', + 'image-resolution': 'Resolution', + 'default-image-resolution': 'Default', + 'invited-person': 'Invite', + 'video-to-audio': 'Switch to audio', + 'me': '(me)', + 'be-rejected': 'Call declined, ', + 'be-no-response': 'No response, ', + 'be-line-busy': 'Line busy, ', + 'be-canceled': 'The call is canceled, ', + 'voice-call-end': 'Voice call ended', + 'video-call-end': 'Video call ended', + 'method-call-failed': 'Failed to sync the operation', + 'failed-to-obtain-permission': 'Failed to obtain permissions', + 'environment-detection-failed': 'Failed to check the environment', + 'switchToAudioCall-call-failed': 'switch to audio call method failed', + 'switchToVideoCall-call-failed': 'switch to video call method failed', + 'microphone-unavailable': 'No mic found', + 'camera-unavailable': 'No camera found', + 'ban-device': 'Device access denied', + 'not-supported-webrtc': 'Your current environment does not support WebRTC', + 'blacklist-user-tips': 'The identifier is in blacklist. Failed to send this message!', + 'is-already-calling': 'TUICallKit is already on a call', + 'need-init': 'Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ', + "can't call yourself": "Can't call yourself", + 'Use-phone-and-computer': 'Use your mobile phone and computer to experience video calls', + 'Wechat scan right QR code': 'Wechat scan right QR code', + 'Scan the QR code above': 'Scan the QR code above', + 'accept-error': 'Accept failed', + 'accept-device-error': 'Accept failed, unable to auth calling device', + 'call-error': 'Start call failed', + 'browser-authorization': 'Browser authorization', + 'mac-privacy': 'System Preferences -> Security and Privacy -> Privacy', + 'win-privacy': 'Setting -> Privacy and Security -> App permissions', + 'mac-preferences': 'Open System Preferences', + 'win-preferences': 'Open Setting', + 'open camera': 'Open Camera', + 'close camera': 'Close Camera', + 'open microphone': 'Open Microphone', + 'close microphone': 'Close Microphone', + 'Please enter userID': 'Please enter userID', + 'View more': 'View more', + 'people selected': 'people selected', + 'Select all': 'Select all', + 'Cancel': 'Cancel', + 'Done': 'Done', +}; diff --git a/TUICallKit/TUICallService/locales/index.d.ts b/TUICallKit/TUICallService/locales/index.d.ts new file mode 100644 index 0000000..afbb43d --- /dev/null +++ b/TUICallKit/TUICallService/locales/index.d.ts @@ -0,0 +1,10 @@ +export declare const CallTips: any; +export declare const languageData: languageDataType; +export declare function t(key: any): string; +interface languageItemType { + [key: string]: string; +} +interface languageDataType { + [key: string]: languageItemType; +} +export {}; diff --git a/TUICallKit/TUICallService/locales/index.js b/TUICallKit/TUICallService/locales/index.js new file mode 100644 index 0000000..12a5316 --- /dev/null +++ b/TUICallKit/TUICallService/locales/index.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.languageData = exports.CallTips = void 0; +const index_1 = require("../CallService/index"); +const index_2 = require("../const/index"); +const en_1 = require("./en"); +const zh_cn_1 = require("./zh-cn"); +const ja_JP_1 = require("./ja_JP"); +exports.CallTips = { + OTHER_SIDE: 'other side', + CANCEL: 'cancel', + OTHER_SIDE_REJECT_CALL: 'other side reject call', + REJECT_CALL: 'reject call', + OTHER_SIDE_LINE_BUSY: 'other side line busy', + IN_BUSY: 'in busy', + CALL_TIMEOUT: 'call timeout', + END_CALL: 'end call', + TIMEOUT: 'timeout', + KICK_OUT: 'kick out', + CALLER_CALLING_MSG: 'caller calling message', + CALLEE_CALLING_VIDEO_MSG: 'callee calling video message', + CALLEE_CALLING_AUDIO_MSG: 'callee calling audio message', + NO_MICROPHONE_DEVICE_PERMISSION: 'no microphone access', + NO_CAMERA_DEVICE_PERMISSION: 'no camera access', +}; +exports.languageData = { + en: en_1.en, + 'zh-cn': zh_cn_1.zh, + ja_JP: ja_JP_1.ja_JP, +}; +// language translate +function t(key) { + var _a; + const language = index_1.TUIStore.getData(index_2.StoreName.CALL, index_2.NAME.LANGUAGE); + // eslint-disable-next-line + for (const langKey in exports.languageData) { + if (langKey === language) { + const currentLanguage = exports.languageData[langKey]; + // eslint-disable-next-line + for (const sentenceKey in currentLanguage) { + if (sentenceKey === key) { + return currentLanguage[sentenceKey]; + } + } + } + } + const enString = (_a = key['en']) === null || _a === void 0 ? void 0 : _a.key; // eslint-disable-line + console.error(`${index_2.NAME.PREFIX}translation is not found: ${key}.`); + return enString; +} +exports.t = t; diff --git a/TUICallKit/TUICallService/locales/ja_JP.d.ts b/TUICallKit/TUICallService/locales/ja_JP.d.ts new file mode 100644 index 0000000..d03dfc7 --- /dev/null +++ b/TUICallKit/TUICallService/locales/ja_JP.d.ts @@ -0,0 +1,85 @@ +export declare const ja_JP: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUICallKit/TUICallService/locales/ja_JP.js b/TUICallKit/TUICallService/locales/ja_JP.js new file mode 100644 index 0000000..ca52108 --- /dev/null +++ b/TUICallKit/TUICallService/locales/ja_JP.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ja_JP = void 0; +exports.ja_JP = { + 'hangup': '通話終了', + 'reject': '拒否', + 'other side reject call': '通話が拒否されました', + 'reject call': '通話拒否', + 'accept': '応答', + 'cancel': '通話をキャンセル', + 'other side line busy': '相手が通話中です', + 'in busy': '通話中', + 'call timeout': '呼び出しタイムアウト', + 'end call': '通話終了', + 'timeout': 'タイムアウト', + 'kick out': 'キックアウトされました', + 'caller calling message': '相手が招待を承諾するのを待っています。', + 'callee calling video message': 'ビデオ通話に招待されました。', + 'callee calling audio message': '音声通話に招待されました。', + 'no microphone access': 'マイクにアクセスできません', + 'no camera access': 'カメラにアクセスできません', + 'invite member': 'メンバーを招待する', + 'speaker': 'スピーカー', + 'Invited group call': 'グループ通話に招待されました。', + 'Those involved': '参加者:', + 'call': '通話', + 'video-call': 'ビデオ通話', + 'audio-call': '音声通話', + 'search': '検索', + 'search-result': '検索結果', + 'Wechat scan right QR code': 'WeChatで右側にあるQRコードを読み取ります。', + 'Use-phone-and-computer': '携帯電話とコンピュータを使用してビデオ通話を体験してください', + 'Scan the QR code above': '上のQRコードを読み取ります。', + 'no-user': 'ユーザーが見つかりませんでした', + 'member-not-added': 'メンバーが追加されていません', + 'not-login': 'ログインしていません', + 'login-status-expire': 'ログインの有効期限が過ぎています。ページを更新してもう一度お試しください', + 'experience-multi-call': '複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください', + 'not-support-multi-call': 'グループ通話インターフェイスが開いていません', + 'input-phone-userID': '携帯電話番号/ユーザーIDを入力してください', + 'userID': 'ユーザーID', + 'already-enter': 'すでに通話に参加しています', + 'waiting': '応答を待っています...', + 'camera-opened': 'カメラがオンになっています', + 'camera-closed': 'カメラがオフになっています', + 'microphone-opened': 'マイクがオンになっています', + 'microphone-closed': 'マイクがオフになっています', + 'camera': 'カメラ', + 'microphone': 'マイク', + 'image-resolution': '解像度', + 'default-image-resolution': 'デフォルト解像度', + 'invited-person': 'メンバーを招待', + 'video-to-audio': '音声通話に切り替えます', + 'me': '(自分)', + 'be-rejected': '通話が拒否されました, ', + 'be-no-response': '応答なし, ', + 'be-line-busy': '相手が通話中です, ', + 'be-canceled': '相手が通話をキャンセルしました', + 'voice-call-end': '音声通話が終了しました', + 'video-call-end': 'ビデオ通話が終了しました', + 'method-call-failed': '操作の同期に失敗しました', + 'failed-to-obtain-permission': '権限の取得に失敗しました', + 'environment-detection-failed': '環境の検出に失敗しました', + 'switchToAudioCall-call-failed': '音声通話に切り替えることはできません', + 'switchToVideoCall-call-failed': 'ビデオ通話に切り替えることはできません', + 'microphone-unavailable': '使用できるマイクがありません', + 'camera-unavailable': '使用できるカメラがありません', + 'ban-device': 'デバイスへのアクセスが拒否されました', + 'not-supported-webrtc': '現在の環境はWebRTCをサポートしていません', + 'blacklist-user-tips': 'ユーザーはブラックリストに登録され、通話が開始できませんでした', + 'is-already-calling': 'TUICallKit はすでに通話中です', + 'need-init': 'TUICallKitで通話を開始する前に、TUICallKitServer.init() メソッドが正常に実行されたことを確認してください。', + "can't call yourself": '自分に電話をかけることができません', + 'accept-error': '接続できませんでした', + 'accept-device-error': '接続できませんでした。発信側デバイスを認証できません', + 'call-error': '通話が開始できませんでした', + 'browser-authorization': 'ブラウザ認証', + 'mac-privacy': 'システム環境設定 -> セキュリティとプライバシー ->プライバシー', + 'win-privacy': '設定 -> セキュリティとプライバシー ->アプリのアクセス許可', + 'mac-preferences': 'システム環境設定を開く', + 'win-preferences': 'システム設定を開く', + 'Please enter userID': 'ユーザーIDを入力してください', + 'View more': 'もっと見る', + 'people selected': '人が選択されました', + 'Select all': 'すべて選択', + 'Cancel': 'キャンセル', + 'Done': '完了', +}; diff --git a/TUICallKit/TUICallService/locales/zh-cn.d.ts b/TUICallKit/TUICallService/locales/zh-cn.d.ts new file mode 100644 index 0000000..369b1c7 --- /dev/null +++ b/TUICallKit/TUICallService/locales/zh-cn.d.ts @@ -0,0 +1,89 @@ +export declare const zh: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUICallKit/TUICallService/locales/zh-cn.js b/TUICallKit/TUICallService/locales/zh-cn.js new file mode 100644 index 0000000..ac854ae --- /dev/null +++ b/TUICallKit/TUICallService/locales/zh-cn.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.zh = void 0; +exports.zh = { + 'hangup': '挂断', + 'reject': '拒绝', + 'other side reject call': '对方已拒绝', + 'reject call': '拒绝通话', + 'accept': '接受', + 'cancel': '取消通话', + 'other side line busy': '对方忙线', + 'in busy': '正在忙', + 'call timeout': '呼叫超时', + 'end call': '结束通话', + 'timeout': '超时', + 'kick out': '被踢', + 'caller calling message': '正在等待对方接受邀请…', + 'callee calling video message': '邀请您进行视频通话…', + 'callee calling audio message': '邀请您进行语音通话…', + 'no microphone access': '没有麦克风权限', + 'no camera access': '没有摄像头权限', + 'invite member': '邀请成员', + 'speaker': '扬声器', + 'Invited group call': '邀请你参加多人通话', + 'Those involved': '参与通话的有:', + 'call': '通话', + 'video-call': '视频通话', + 'audio-call': '音频通话', + 'search': '搜索', + 'search-result': '搜索结果', + 'Wechat scan right QR code': '微信扫右二维码', + 'Use-phone-and-computer': '用手机与电脑互打体验视频通话', + 'Scan the QR code above': '扫描上方二维码', + 'no-user': '未搜索到用户', + 'member-not-added': '未添加成员', + 'not-login': '未登录', + 'login-status-expire': '登录状态已失效,请刷新网页重试', + 'experience-multi-call': '体验多人通话请下载全功能demo:', + 'not-support-multi-call': '多人通话接口未开放', + 'input-phone-userID': '请输入手机号/用户ID', + 'userID': '用户ID', + 'already-enter': '已经进入当前通话', + 'waiting': '等待接听...', + 'camera-opened': '摄像头已开', + 'camera-closed': '摄像头已关', + 'microphone-opened': '麦克风已开', + 'microphone-closed': '麦克风已关', + 'camera': '摄像头', + 'microphone': '麦克风', + 'image-resolution': '分辨率', + 'default-image-resolution': '默认分辨率', + 'invited-person': '添加成员', + 'video-to-audio': '切到语音通话', + 'me': '(我)', + 'be-rejected': '对方已拒绝,', + 'be-no-response': '对方无应答,', + 'be-line-busy': '对方忙线中,', + 'be-canceled': '对方已取消', + 'voice-call-end': '语音通话结束', + 'video-call-end': '视频通话结束', + 'method-call-failed': '同步操作失败', + 'failed-to-obtain-permission': '权限获取失败', + 'environment-detection-failed': '环境检测失败', + 'switchToAudioCall-call-failed': '切语音调用失败', + 'switchToVideoCall-call-failed': '切视频调用失败', + 'microphone-unavailable': '没有可用的麦克风设备', + 'camera-unavailable': '没有可用的摄像头设备', + 'ban-device': '用户禁止使用设备', + 'not-supported-webrtc': '当前环境不支持 WebRTC', + 'blacklist-user-tips': '发起通话失败,被对方拉入黑名单,禁止发起!', + 'is-already-calling': 'TUICallKit 已在通话状态', + 'need-init': 'TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功', + "can't call yourself": '不能呼叫自己', + 'accept-error': '接通失败', + 'accept-device-error': '接通失败,通话设备获取失败', + 'call-error': '发起通话失败', + 'browser-authorization': '浏览器授权', + 'mac-privacy': '系统偏好设置 -> 安全与隐私 -> 隐私', + 'win-privacy': '设置 -> 隐私和安全性 -> 应用权限', + 'mac-preferences': '打开系统偏好设置', + 'win-preferences': '打开系统设置', + 'open camera': '打开摄像头', + 'close camera': '关闭摄像头', + 'open microphone': '打开麦克风', + 'close microphone': '关闭麦克风', + 'Please enter userID': '请输入 userID', + 'View more': '查看更多', + 'people selected': '人已选中', + 'Select all': '全选', + 'Cancel': '取消', + 'Done': '完成', +}; diff --git a/TUICallKit/TUICallService/serve/callManager.d.ts b/TUICallKit/TUICallService/serve/callManager.d.ts new file mode 100644 index 0000000..3474175 --- /dev/null +++ b/TUICallKit/TUICallService/serve/callManager.d.ts @@ -0,0 +1,11 @@ +export declare class CallManager { + private _globalCallPagePath; + private _isPageRedirected; + init(params: any): Promise; + private _watchTUIStore; + private _unwatchTUIStore; + private _handleCallStatusChange; + private _handleCallStatusToCalling; + private _handleCallStatusToIdle; + destroyed(): Promise; +} diff --git a/TUICallKit/TUICallService/serve/callManager.js b/TUICallKit/TUICallService/serve/callManager.js new file mode 100644 index 0000000..7f4fbe5 --- /dev/null +++ b/TUICallKit/TUICallService/serve/callManager.js @@ -0,0 +1,133 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallManager = void 0; +const index_1 = require("../../index"); +const index_2 = require("../const/index"); +const index_3 = require("../utils/validate/index"); +/** + * @param {Number} sdkAppID 用户的sdkAppID 必传 + * @param {String} userID 用户的userID 必传 + * @param {String} userSig 用户的userSig 必传 + * @param {String} globalCallPagePath 跳转的路径 必传 + * @param {ChatSDK} tim tim实例 非必传 + */ +const PREFIX = 'callManager'; +class CallManager { + constructor() { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + switch (value) { + case index_2.CallStatus.CALLING: + case index_2.CallStatus.CONNECTED: + this._handleCallStatusToCalling(); + break; + case index_2.CallStatus.IDLE: + this._handleCallStatusToIdle(); + break; + } + }); + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + const { sdkAppID, userID, userSig, globalCallPagePath, tim } = params; + if (!globalCallPagePath) { + console.error(`${PREFIX} globalCallPagePath Can not be empty!`); + return; + } + ; + this._globalCallPagePath = globalCallPagePath; + try { + yield index_1.TUICallKitServer.init({ + sdkAppID, + userID, + userSig, + tim, + }); + this._watchTUIStore(); + // 全局监听下,关闭悬浮窗 + index_1.TUICallKitServer.enableFloatWindow(false); + console.log(`${PREFIX} init Ready!`); + } + catch (error) { + console.error(`${PREFIX} init fail!`); + } + }); + } + // =========================【监听 TUIStore 中的状态】========================= + _watchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }, { + notifyRangeWhenWatch: index_1.NAME.MYSELF, + }); + } + _unwatchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _handleCallStatusToCalling() { + if (this._isPageRedirected) + return; + // @ts-ignore + wx.navigateTo({ + url: `/${this._globalCallPagePath}`, + success: () => { + this._isPageRedirected = true; + }, + fail: () => { + console.error(`${PREFIX} navigateTo fail!`); + }, + complete: () => { }, + }); + } + _handleCallStatusToIdle() { + if (!this._isPageRedirected) + return; + // @ts-ignore + wx.navigateBack({ + success: () => { + this._isPageRedirected = false; + }, + fail: () => { + console.error(`${PREFIX} navigateBack fail!`); + }, + complete: () => { }, + }); + } + // 卸载 callManger + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._unwatchTUIStore(); + yield index_1.TUICallKitServer.destroyed(); + }); + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], CallManager.prototype, "init", null); +exports.CallManager = CallManager; diff --git a/TUICallKit/TUICallService/utils/common-utils.d.ts b/TUICallKit/TUICallService/utils/common-utils.d.ts new file mode 100644 index 0000000..d9bfeaf --- /dev/null +++ b/TUICallKit/TUICallService/utils/common-utils.d.ts @@ -0,0 +1,53 @@ +export declare const isUndefined: (input: any) => boolean; +export declare const isPlainObject: (input: any) => boolean; +export declare const isArray: (input: any) => boolean; +export declare const isPrivateKey: (key: string) => boolean; +export declare const isUrl: (url: string) => boolean; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +export declare const isString: (input: any) => boolean; +export declare const isBoolean: (input: any) => boolean; +export declare const isNumber: (input: any) => boolean; +export declare function formatTime(secondTime: number): string; +export declare function formatTimeInverse(stringTime: string): number; +export declare function isJSON(str: string): boolean; +export declare const JSONToObject: (str: string) => any; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +export declare const retryPromise: (promise: Promise, num?: number, time?: number) => Promise; +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleRepeatedCallError(error: any): boolean; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleNoDevicePermissionError(error: any): boolean; +export declare function performanceNow(): number; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +export declare const isFunction: (input: any) => boolean; +export declare const getLanguage: () => string; +export declare function noop(e: any): void; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +export declare const getType: (input: any) => any; +export declare function modifyObjectKey(obj: any, oldKey: any, newKey: any): any; diff --git a/TUICallKit/TUICallService/utils/common-utils.js b/TUICallKit/TUICallService/utils/common-utils.js new file mode 100644 index 0000000..53237d0 --- /dev/null +++ b/TUICallKit/TUICallService/utils/common-utils.js @@ -0,0 +1,249 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modifyObjectKey = exports.getType = exports.noop = exports.getLanguage = exports.isFunction = exports.performanceNow = exports.handleNoDevicePermissionError = exports.handleRepeatedCallError = exports.retryPromise = exports.JSONToObject = exports.isJSON = exports.formatTimeInverse = exports.formatTime = exports.isNumber = exports.isBoolean = exports.isString = exports.isUrl = exports.isPrivateKey = exports.isArray = exports.isPlainObject = exports.isUndefined = void 0; +const index_1 = require("../const/index"); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const isUndefined = function (input) { + return typeof input === index_1.NAME.UNDEFINED; +}; +exports.isUndefined = isUndefined; +const isPlainObject = function (input) { + // 注意不能使用以下方式判断,因为IE9/IE10下,对象的__proto__是 undefined + // return isObject(input) && input.__proto__ === Object.prototype; + if (typeof input !== index_1.NAME.OBJECT || input === null) { + return false; + } + const proto = Object.getPrototypeOf(input); + if (proto === null) { // edge case Object.create(null) + return true; + } + let baseProto = proto; + while (Object.getPrototypeOf(baseProto) !== null) { + baseProto = Object.getPrototypeOf(baseProto); + } + // 原型链第一个和最后一个比较 + return proto === baseProto; +}; +exports.isPlainObject = isPlainObject; +const isArray = function (input) { + if (typeof Array.isArray === index_1.NAME.FUNCTION) { + return Array.isArray(input); + } + return Object.prototype.toString.call(input).match(/^\[object (.*)\]$/)[1].toLowerCase() === index_1.NAME.ARRAY; +}; +exports.isArray = isArray; +const isPrivateKey = function (key) { + return key.startsWith('_'); +}; +exports.isPrivateKey = isPrivateKey; +const isUrl = function (url) { + return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(url); +}; +exports.isUrl = isUrl; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +const isString = function (input) { + return typeof input === index_1.NAME.STRING; +}; +exports.isString = isString; +const isBoolean = function (input) { + return typeof input === index_1.NAME.BOOLEAN; +}; +exports.isBoolean = isBoolean; +const isNumber = function (input) { + return ( + // eslint-disable-next-line + input !== null && + ((typeof input === index_1.NAME.NUMBER && !isNaN(input - 0)) || (typeof input === index_1.NAME.OBJECT && input.constructor === Number))); +}; +exports.isNumber = isNumber; +function formatTime(secondTime) { + const hours = Math.floor(secondTime / 3600); + const minutes = Math.floor((secondTime % 3600) / 60); + const seconds = Math.floor(secondTime % 60); + let callDurationStr = hours > 9 ? `${hours}` : `0${hours}`; + callDurationStr += minutes > 9 ? `:${minutes}` : `:0${minutes}`; + callDurationStr += seconds > 9 ? `:${seconds}` : `:0${seconds}`; + return callDurationStr; +} +exports.formatTime = formatTime; +function formatTimeInverse(stringTime) { + const list = stringTime.split(':'); + return parseInt(list[0]) * 3600 + parseInt(list[1]) * 60 + parseInt(list[2]); // eslint-disable-line +} +exports.formatTimeInverse = formatTimeInverse; +// Determine if it is a JSON string +function isJSON(str) { + if (typeof str === index_1.NAME.STRING) { + try { + const data = JSON.parse(str); + if (data) { + return true; + } + return false; + } + catch (error) { + console.debug(error); + return false; + } + } + return false; +} +exports.isJSON = isJSON; +// Determine if it is a JSON string +const JSONToObject = function (str) { + if (!str || !isJSON(str)) { + return str; + } + return JSON.parse(str); +}; +exports.JSONToObject = JSONToObject; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +const retryPromise = (promise, num = 6, time = 0.5) => { + let n = num; + const func = () => promise; + return func() + .catch((error) => { + if (n === 0) { + throw error; + } + const timer = setTimeout(() => { + func(); + clearTimeout(timer); + n = n - 1; + }, time * 1000); + }); +}; +exports.retryPromise = retryPromise; +// /** +// * 节流函数(目前 TUICallKit 增加防重调用装饰器,该方法可删除) +// * @param {Function} func 传入的函数 +// * @param {wait} time 间隔时间(ms) +// */ +// export const throttle = (func: Function, wait: number) => { +// let previousTime = 0; +// return function () { +// const now = Date.now(); +// const args = [...arguments]; +// if (now - previousTime > wait) { +// func.apply(this, args); +// previousTime = now; +// } +// }; +// } +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleRepeatedCallError(error) { + if ((error === null || error === void 0 ? void 0 : error.message.indexOf('is ongoing, please avoid repeated calls')) !== -1) { + return true; + } + return false; +} +exports.handleRepeatedCallError = handleRepeatedCallError; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleNoDevicePermissionError(error) { + const { message } = error; + if (message.indexOf('NotAllowedError: Permission denied') !== -1) { + return true; + } + return false; +} +exports.handleNoDevicePermissionError = handleNoDevicePermissionError; +/* + * 获取向下取整的 performance.now() 值 + * @export + * @return {Number} + */ +function performanceNow() { + // 在不支持 performance.now 的浏览器中,使用 Date.now() + // 例如 ie 9,ie 10,避免加载 sdk 时报错 + if (!performance || !performance.now) { + return Date.now(); + } + return Math.floor(performance.now()); +} +exports.performanceNow = performanceNow; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +const isFunction = function (input) { + return typeof input === index_1.NAME.FUNCTION; +}; +exports.isFunction = isFunction; +/* + * 获取浏览器语言 + * @export + * @return {zh-cn | en} + */ +const getLanguage = () => { + if (tuiGlobal_1.default.getInstance().isWeChat) { + return 'zh-cn'; + } + // @ts-ignore + const lang = ((navigator === null || navigator === void 0 ? void 0 : navigator.language) || (navigator === null || navigator === void 0 ? void 0 : navigator.userLanguage) || '').substr(0, 2); + let language = 'en'; + switch (lang) { + case 'zh': + language = 'zh-cn'; + break; + case 'ja': + language = 'ja_JP'; + break; + default: + language = 'en'; + } + return language; +}; +exports.getLanguage = getLanguage; +function noop(e) { } +exports.noop = noop; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +const getType = function (input) { + return Object.prototype.toString + .call(input) + .match(/^\[object (.*)\]$/)[1] + .toLowerCase(); +}; +exports.getType = getType; +// 修改对象键名 +function modifyObjectKey(obj, oldKey, newKey) { + if (!obj.hasOwnProperty(oldKey)) { + return obj; + } + const newObj = {}; + Object.keys(obj).forEach(key => { + if (key === oldKey) { + newObj[newKey] = obj[key]; + } + else { + newObj[key] = obj[key]; + } + }); + return newObj; +} +exports.modifyObjectKey = modifyObjectKey; diff --git a/TUICallKit/TUICallService/utils/env.d.ts b/TUICallKit/TUICallService/utils/env.d.ts new file mode 100644 index 0000000..59cdbb7 --- /dev/null +++ b/TUICallKit/TUICallService/utils/env.d.ts @@ -0,0 +1,10 @@ +export declare const IN_WX_MINI_APP: boolean; +export declare const IN_UNI_NATIVE_APP: boolean; +export declare const IN_MINI_APP: boolean; +export declare const IN_UNI_APP: boolean; +export declare const IN_BROWSER: boolean; +export declare const APP_NAMESPACE: any; +export declare const IS_H5: boolean; +export declare const IS_PC: boolean; +export declare const IS_WIN: any; +export declare const IS_MAC: any; diff --git a/TUICallKit/TUICallService/utils/env.js b/TUICallKit/TUICallService/utils/env.js new file mode 100644 index 0000000..90200e0 --- /dev/null +++ b/TUICallKit/TUICallService/utils/env.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_MAC = exports.IS_WIN = exports.IS_PC = exports.IS_H5 = exports.APP_NAMESPACE = exports.IN_BROWSER = exports.IN_UNI_APP = exports.IN_MINI_APP = exports.IN_UNI_NATIVE_APP = exports.IN_WX_MINI_APP = void 0; +// 在 uniApp 框架下,打包 H5、ios app、android app 时存在 wx/qq/tt/swan/my 等变量会导致引入 web sdk 环境判断失效 +// 小程序 getSystemInfoSync 返回的 fontSizeSetting 在 H5 和 app 中为 undefined,所以通过 fontSizeSetting 增强小程序环境判断 +// wx 小程序 +exports.IN_WX_MINI_APP = (typeof wx !== 'undefined' && typeof wx.getSystemInfoSync === 'function' && Boolean(wx.getSystemInfoSync().fontSizeSetting)); +// 用 uni-app 打包 native app,此时运行于 js core,无 window 等对象,此时调用 api 都得 uni.xxx,由于风格跟小程序类似,就归为 IN_MINI_APP 的一种 +exports.IN_UNI_NATIVE_APP = (typeof uni !== 'undefined' && typeof uni === 'undefined'); +exports.IN_MINI_APP = exports.IN_WX_MINI_APP || exports.IN_UNI_NATIVE_APP; +exports.IN_UNI_APP = (typeof uni !== 'undefined'); +// 在 uniApp 框架下,由于客户打包 ios app、android app 时 window 不一定存在,所以通过 !IN_MINI_APP 进行判断 +// 非 uniApp 框架下,仍然通过 window 结合 IN_MINI_APP 进行判断,可兼容 Taro3.0+ 暴露 window 对象引起的 IN_BROWSER 判断失效问题 +exports.IN_BROWSER = (function () { + if (typeof uni !== 'undefined') { + return !exports.IN_MINI_APP; + } + return (typeof window !== 'undefined') && !exports.IN_MINI_APP; +}()); +// 命名空间 +exports.APP_NAMESPACE = (function () { + if (exports.IN_WX_MINI_APP) { + return wx; + } + if (exports.IN_UNI_APP) { + return uni; + } + return window; +}()); +// eslint-disable-next-line no-mixed-operators +const USER_AGENT = exports.IN_BROWSER && window && window.navigator && window.navigator.userAgent || ''; +const IS_ANDROID = /Android/i.test(USER_AGENT); +const IS_WIN_PHONE = /(?:Windows Phone)/.test(USER_AGENT); +const IS_SYMBIAN = /(?:SymbianOS)/.test(USER_AGENT); +const IS_IOS = /iPad/i.test(USER_AGENT) || /iPhone/i.test(USER_AGENT) || /iPod/i.test(USER_AGENT); +exports.IS_H5 = IS_ANDROID || IS_WIN_PHONE || IS_SYMBIAN || IS_IOS; +exports.IS_PC = exports.IN_BROWSER && !exports.IS_H5; +exports.IS_WIN = exports.IS_PC && USER_AGENT.includes('Windows NT'); +exports.IS_MAC = exports.IS_PC && USER_AGENT.includes('Mac'); diff --git a/TUICallKit/TUICallService/utils/index.d.ts b/TUICallKit/TUICallService/utils/index.d.ts new file mode 100644 index 0000000..e54866b --- /dev/null +++ b/TUICallKit/TUICallService/utils/index.d.ts @@ -0,0 +1 @@ +export declare function checkLocalMP3FileExists(src: string): Promise; diff --git a/TUICallKit/TUICallService/utils/index.js b/TUICallKit/TUICallService/utils/index.js new file mode 100644 index 0000000..2b54e87 --- /dev/null +++ b/TUICallKit/TUICallService/utils/index.js @@ -0,0 +1,33 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkLocalMP3FileExists = void 0; +function checkLocalMP3FileExists(src) { + return __awaiter(this, void 0, void 0, function* () { + if (!src) + return false; + try { + const response = yield new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.open('HEAD', src, true); + xhr.onload = () => resolve(xhr); + xhr.onerror = () => reject(xhr); + xhr.send(); + }); + return response.status === 200 && response.getResponseHeader('Content-Type') === 'audio/mpeg'; + } + catch (error) { + console.warn(error); + return false; + } + }); +} +exports.checkLocalMP3FileExists = checkLocalMP3FileExists; diff --git a/TUICallKit/TUICallService/utils/is-empty.d.ts b/TUICallKit/TUICallService/utils/is-empty.d.ts new file mode 100644 index 0000000..0ddd31f --- /dev/null +++ b/TUICallKit/TUICallService/utils/is-empty.d.ts @@ -0,0 +1,2 @@ +declare const isEmpty: (input: any) => boolean; +export default isEmpty; diff --git a/TUICallKit/TUICallService/utils/is-empty.js b/TUICallKit/TUICallService/utils/is-empty.js new file mode 100644 index 0000000..aee8359 --- /dev/null +++ b/TUICallKit/TUICallService/utils/is-empty.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common_utils_1 = require("./common-utils"); +const isEmpty = function (input) { + // Null and Undefined... + if (input === null || typeof (input) === 'undefined') + return true; + // Booleans... + if (typeof input === 'boolean') + return false; + // Numbers... + if (typeof input === 'number') + return input === 0; + // Strings... + if (typeof input === 'string') + return input.length === 0; + // Functions... + if (typeof input === 'function') + return input.length === 0; + // Arrays... + if (Array.isArray(input)) + return input.length === 0; + // Errors... + if (input instanceof Error) + return input.message === ''; + // plain object + if ((0, common_utils_1.isPlainObject)(input)) { + // eslint-disable-next-line + for (const key in input) { + if (Object.prototype.hasOwnProperty.call(input, key)) { + return false; + } + } + return true; + } + return false; +}; +exports.default = isEmpty; diff --git a/TUICallKit/TUICallService/utils/timer.d.ts b/TUICallKit/TUICallService/utils/timer.d.ts new file mode 100644 index 0000000..d88f832 --- /dev/null +++ b/TUICallKit/TUICallService/utils/timer.d.ts @@ -0,0 +1,64 @@ +/// +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +declare class Timer { + static taskMap: Map; + static currentTaskID: number; + static generateTaskID(): number; + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName: any, callback: any, options: any): any; + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem: any): NodeJS.Timer; + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem: any): NodeJS.Timeout; + static hasTask(taskID: any): boolean; + static clearTask(taskID: any): boolean; + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem: any): boolean; +} +export default Timer; diff --git a/TUICallKit/TUICallService/utils/timer.js b/TUICallKit/TUICallService/utils/timer.js new file mode 100644 index 0000000..55682e3 --- /dev/null +++ b/TUICallKit/TUICallService/utils/timer.js @@ -0,0 +1,154 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/* eslint-disable */ +const common_utils_1 = require("./common-utils"); +const index_1 = require("../const/index"); +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +class Timer { + static generateTaskID() { + return this.currentTaskID++; + } + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName = index_1.NAME.TIMEOUT, callback, options) { + // default options + if (taskName === index_1.NAME.INTERVAL) { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + else { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + // call run(function, {...}) + if ((0, common_utils_1.isPlainObject)(callback)) { + options = Object.assign(Object.assign({}, options), callback); + } + if ((0, common_utils_1.isFunction)(taskName)) { + callback = taskName; + taskName = index_1.NAME.TIMEOUT; + } + // 1. 创建 taskID,作为 timer task 的唯一标识,在本函数执行完后返回,用于在调用的地方实现互斥逻辑 + // 2. 根据 taskName 执行相应的函数 + const taskItem = Object.assign({ taskID: this.generateTaskID(), loopCount: 0, intervalID: null, timeoutID: null, taskName, + callback }, options); + this.taskMap.set(taskItem.taskID, taskItem); + // console.log(`timer run task:${taskItem.taskName}, task queue size: ${this.taskMap.size}`); + if (taskName === index_1.NAME.INTERNAL) { + this.interval(taskItem); + } + else { + this.timeout(taskItem); + } + return taskItem.taskID; + } + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem) { + // setInterval 缺点,浏览器退后台会降频,循环执行间隔时间不可靠 + // 创建进入定时器循环的任务函数,函数内:1. 判断是否满足执行条件,2.执行 callback + // 通过 setInterval 执行任务函数 + // 将 intervalID 记录到 taskMap 对应的 item + const task = () => { + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + }; + return taskItem.intervalID = setInterval(task, taskItem.delay); + } + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem) { + // setTimeout 浏览器退后台,延迟变为至少1s + const task = () => { + // 执行回调 + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + // 不修正延迟,每次callback间隔平均 + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + }; + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + } + static hasTask(taskID) { + return this.taskMap.has(taskID); + } + static clearTask(taskID) { + // console.log('timer clearTask start', `| taskID:${taskID} | size:${this.taskMap.size}`); + if (!this.taskMap.has(taskID)) { + return true; + } + const { intervalID, timeoutID, onVisibilitychange } = this.taskMap.get(taskID); + if (intervalID) { + clearInterval(intervalID); + } + if (timeoutID) { + clearTimeout(timeoutID); + } + if (onVisibilitychange) { + document.removeEventListener('visibilitychange', onVisibilitychange); + } + this.taskMap.delete(taskID); + // console.log('timer clearTask end ', `| size:${this.taskMap.size}`); + return true; + } + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem) { + if (!this.taskMap.has(taskItem.taskID)) { + return true; + } + if (taskItem.count !== 0 && taskItem.loopCount >= taskItem.count) { + this.clearTask(taskItem.taskID); + return true; + } + return false; + } +} +Timer.taskMap = new Map(); +Timer.currentTaskID = 1; +exports.default = Timer; diff --git a/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts new file mode 100644 index 0000000..85fdf03 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts @@ -0,0 +1,10 @@ +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +export declare function avoidRepeatedCall(): (target: any, name: string, descriptor: any) => any; diff --git a/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js new file mode 100644 index 0000000..c7675b9 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js @@ -0,0 +1,49 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = void 0; +const index_1 = require("../../const/index"); +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +function avoidRepeatedCall() { + return function (target, name, descriptor) { + const oldFn = descriptor.value; + const isCallingSet = new Set(); + descriptor.value = function (...args) { + return __awaiter(this, void 0, void 0, function* () { + if (isCallingSet.has(this)) { + console.warn((`${index_1.NAME.PREFIX}previous ${name}() is ongoing, please avoid repeated calls`)); + // throw new Error(`previous ${name}() is ongoing, please avoid repeated calls`); + return; + } + try { + isCallingSet.add(this); + const result = yield oldFn.apply(this, args); + isCallingSet.delete(this); + return result; + } + catch (error) { + isCallingSet.delete(this); + throw error; + } + }); + }; + return descriptor; + }; +} +exports.avoidRepeatedCall = avoidRepeatedCall; diff --git a/TUICallKit/TUICallService/utils/validate/index.d.ts b/TUICallKit/TUICallService/utils/validate/index.d.ts new file mode 100644 index 0000000..665c654 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/index.d.ts @@ -0,0 +1,4 @@ +import { avoidRepeatedCall } from './avoidRepeatedCall'; +import { paramValidate } from './validateParams'; +import { VALIDATE_PARAMS } from './validateConfig'; +export { VALIDATE_PARAMS, paramValidate, avoidRepeatedCall, }; diff --git a/TUICallKit/TUICallService/utils/validate/index.js b/TUICallKit/TUICallService/utils/validate/index.js new file mode 100644 index 0000000..7632874 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = exports.paramValidate = exports.VALIDATE_PARAMS = void 0; +const avoidRepeatedCall_1 = require("./avoidRepeatedCall"); +Object.defineProperty(exports, "avoidRepeatedCall", { enumerable: true, get: function () { return avoidRepeatedCall_1.avoidRepeatedCall; } }); +const validateParams_1 = require("./validateParams"); +Object.defineProperty(exports, "paramValidate", { enumerable: true, get: function () { return validateParams_1.paramValidate; } }); +const validateConfig_1 = require("./validateConfig"); +Object.defineProperty(exports, "VALIDATE_PARAMS", { enumerable: true, get: function () { return validateConfig_1.VALIDATE_PARAMS; } }); diff --git a/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts b/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts new file mode 100644 index 0000000..190b624 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts @@ -0,0 +1,173 @@ +import { VideoResolution, VideoDisplayMode } from "../../const/index"; +export declare const VALIDATE_PARAMS: { + init: { + SDKAppID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userSig: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + tim: { + required: boolean; + rules: any[]; + }; + }; + call: { + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + groupCall: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + offlinePushInfo: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + joinInGroupCall: { + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + inviteUser: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + setSelfInfo: { + nickName: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + avatar: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + enableFloatWindow: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableAIVoice: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableMuteMode: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setCallingBell: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setLanguage: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setVideoDisplayMode: { + key: string; + required: boolean; + rules: any[]; + range: VideoDisplayMode[]; + allowEmpty: boolean; + }[]; + setVideoResolution: { + key: string; + required: boolean; + rules: any[]; + range: VideoResolution[]; + allowEmpty: boolean; + }[]; +}; diff --git a/TUICallKit/TUICallService/utils/validate/validateConfig.js b/TUICallKit/TUICallService/utils/validate/validateConfig.js new file mode 100644 index 0000000..303d99b --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateConfig.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VALIDATE_PARAMS = void 0; +const index_1 = require("../../const/index"); +exports.VALIDATE_PARAMS = { + init: { + SDKAppID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + userSig: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + tim: { + required: false, + rules: [index_1.NAME.OBJECT], + }, + }, + call: { + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false, + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + } + }, + groupCall: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + offlinePushInfo: { + required: false, + rules: [index_1.NAME.OBJECT], + allowEmpty: false, + }, + }, + joinInGroupCall: { + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + }, + inviteUser: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + }, + setSelfInfo: { + nickName: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + avatar: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + } + }, + enableFloatWindow: [ + { + key: "enable", + required: false, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableAIVoice: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableMuteMode: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + setCallingBell: [ + { + key: "filePath", + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: true, + } + ], + setLanguage: [ + { + key: "language", + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + } + ], + setVideoDisplayMode: [ + { + key: "displayMode", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoDisplayMode.CONTAIN, index_1.VideoDisplayMode.COVER, index_1.VideoDisplayMode.FILL], + allowEmpty: false + } + ], + setVideoResolution: [ + { + key: "resolution", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoResolution.RESOLUTION_1080P, index_1.VideoResolution.RESOLUTION_480P, index_1.VideoResolution.RESOLUTION_720P], + allowEmpty: false + } + ] +}; diff --git a/TUICallKit/TUICallService/utils/validate/validateParams.d.ts b/TUICallKit/TUICallService/utils/validate/validateParams.d.ts new file mode 100644 index 0000000..4a37885 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateParams.d.ts @@ -0,0 +1 @@ +export declare function paramValidate(config: any): (target: any, propertyName: string, descriptor: PropertyDescriptor) => PropertyDescriptor; diff --git a/TUICallKit/TUICallService/utils/validate/validateParams.js b/TUICallKit/TUICallService/utils/validate/validateParams.js new file mode 100644 index 0000000..5073419 --- /dev/null +++ b/TUICallKit/TUICallService/utils/validate/validateParams.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paramValidate = void 0; +const common_utils_1 = require("../common-utils"); +const index_1 = require("../../const/index"); +const PREFIX = index_1.NAME.PREFIX + "API"; +function paramValidate(config) { + return function (target, propertyName, descriptor) { + let method = descriptor.value; + descriptor.value = function (...args) { + doValidate.call(this, config, args, propertyName); + return method.apply(this, args); + }; + return descriptor; + }; +} +exports.paramValidate = paramValidate; +function doValidate(config, args, name) { + try { + // 兼容 init 方法中: SDKAppID sdkAppID 两种写法的参数校验判断 + if (!args[0].SDKAppID) { + config = (0, common_utils_1.modifyObjectKey)(config, "SDKAppID", "sdkAppID"); + } + if ((0, common_utils_1.isArray)(config)) { + for (let i = 0; i < config.length; i++) { + check.call(this, Object.assign(Object.assign({}, config[i]), { value: args[i], name })); + } + } + else { + for (const key in config) { + if (config.hasOwnProperty(key)) { + check.call(this, Object.assign(Object.assign({}, config[key]), { value: args[0][key], name, + key })); + } + } + } + } + catch (error) { + console.error(error); + throw error; + } +} +function check({ required, rules, range, value, allowEmpty, name, key }) { + // 用户没传指定参数 + if ((0, common_utils_1.isUndefined)(value)) { + // 检查必填参数, 若配置是必填则报错 + if (required) { + throw new Error(`${PREFIX}<${name}>: ${key} is required.`); + } + else { + return; + } + } + // 判断参数类型是否正确 + const result = rules.some((item) => item === (0, common_utils_1.getType)(value)); + let type = ''; + if (!result) { + for (let i = 0; i < rules.length; i++) { + let str = rules[i]; + str = str.replace(str[0], str[0].toUpperCase()); + type += `${str}/`; + } + type = type.substring(0, type.length - 1); + throw new Error(`${PREFIX}<${name}>: ${key} must be ${type}, current ${key} is ${typeof value}.`); + } + // 不允许传空值, 例如: '', ' ' + if (allowEmpty === false) { + const isEmptyString = (0, common_utils_1.isString)(value) && value.trim() === ''; + if (isEmptyString) { + throw new Error(`${PREFIX}<${name}>: ${key} is blank.`); + } + } + // 判断是否符合限制条件 + if ((0, common_utils_1.isArray)(range)) { + if (range && range.indexOf(value) === -1) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } + // 取值范围, 前闭后闭 + if ((0, common_utils_1.isString)(range) && range.indexOf('~') !== -1) { + const valueList = range.split('~'); + if (value < +valueList[0] || value > +valueList[1] || ((0, common_utils_1.isNumber)(value) && Number.isNaN(value))) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } +} diff --git a/TUICallKit/adapter-vue.d.ts b/TUICallKit/adapter-vue.d.ts new file mode 100644 index 0000000..1d797f4 --- /dev/null +++ b/TUICallKit/adapter-vue.d.ts @@ -0,0 +1,2 @@ +export * from '@vue/composition-api'; +export * from 'vue'; diff --git a/TUICallKit/adapter-vue.js b/TUICallKit/adapter-vue.js new file mode 100644 index 0000000..38b9bfe --- /dev/null +++ b/TUICallKit/adapter-vue.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// #ifndef VUE3 +// @ts-ignore +__exportStar(require("@vue/composition-api"), exports); +// #endif +// #ifdef VUE3 +__exportStar(require("vue"), exports); +// #endif diff --git a/TUICallKit/debug/GenerateTestUserSig-es.js b/TUICallKit/debug/GenerateTestUserSig-es.js new file mode 100644 index 0000000..f61fb98 --- /dev/null +++ b/TUICallKit/debug/GenerateTestUserSig-es.js @@ -0,0 +1,63 @@ +import LibGenerateTestUserSig from './lib-generate-test-usersig-es.min.js'; + +/** + * 腾讯云 SDKAppId,需要替换为您自己账号下的 SDKAppId。 + * + * 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ) 创建应用,即可看到 SDKAppId, + * 它是腾讯云用于区分客户的唯一标识。 + */ +let SDKAPPID = 0; + + +/** + * 签名过期时间,建议不要设置的过短 + *

+ * 时间单位:秒 + * 默认时间:7 x 24 x 60 x 60 = 604800 = 7 天 + */ +const EXPIRETIME = 604800; + + +/** + * 计算签名用的加密密钥,获取步骤如下: + * + * step1. 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ),如果还没有应用就创建一个, + * step2. 单击“应用配置”进入基础配置页面,并进一步找到“帐号体系集成”部分。 + * step3. 点击“查看密钥”按钮,就可以看到计算 UserSig 使用的加密的密钥了,请将其拷贝并复制到如下的变量中 + * + * 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。 + * 文档:https://cloud.tencent.com/document/product/647/17275#Server + */ +let SECRETKEY = ''; + +/* + * Module: GenerateTestUserSig + * + * Function: 用于生成测试用的 UserSig,UserSig 是腾讯云为其云服务设计的一种安全保护签名。 + * 其计算方法是对 SDKAppID、UserID 和 EXPIRETIME 进行加密,加密算法为 HMAC-SHA256。 + * + * Attention: 请不要将如下代码发布到您的线上正式版本的 App 中,原因如下: + * + * 本文件中的代码虽然能够正确计算出 UserSig,但仅适合快速调通 SDK 的基本功能,不适合线上产品, + * 这是因为客户端代码中的 SECRETKEY 很容易被反编译逆向破解,尤其是 Web 端的代码被破解的难度几乎为零。 + * 一旦您的密钥泄露,攻击者就可以计算出正确的 UserSig 来盗用您的腾讯云流量。 + * + * 正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,然后由 App 按需向您的服务器获取实时算出的 UserSig。 + * 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。 + * + * Reference:https://cloud.tencent.com/document/product/647/17275#Server + */ + +export function genTestUserSig({ userID, SDKAppID, SecretKey }) { + if (SDKAppID) SDKAPPID = SDKAppID; + if (SecretKey) SECRETKEY = SecretKey; + const generator = new LibGenerateTestUserSig(SDKAPPID, SECRETKEY, EXPIRETIME); + const userSig = generator.genTestUserSig(userID); + + return { + SDKAppID: SDKAPPID, + userSig, + }; +} + +export default genTestUserSig; \ No newline at end of file diff --git a/TUICallKit/debug/lib-generate-test-usersig-es.min.js b/TUICallKit/debug/lib-generate-test-usersig-es.min.js new file mode 100644 index 0000000..b01b70b --- /dev/null +++ b/TUICallKit/debug/lib-generate-test-usersig-es.min.js @@ -0,0 +1,2 @@ +/*eslint-disable*/ +var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=e.length;n>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return a.join("")}function s(e){var r;i||o();for(var n=e.length,s=n%3,h="",l=[],f=0,c=n-s;fc?c:f+16383));return 1===s?(r=e[n-1],h+=t[r>>2],h+=t[r<<4&63],h+="=="):2===s&&(r=(e[n-2]<<8)+e[n-1],h+=t[r>>10],h+=t[r>>4&63],h+=t[r<<2&63],h+="="),l.push(h),l.join("")}function h(e,t,r,n,i){var o,a,s=8*i-n-1,h=(1<>1,f=-7,c=r?i-1:0,u=r?-1:1,d=e[t+c];for(c+=u,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=u,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=u,f-=8);if(0===o)o=1-l;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)}function l(e,t,r,n,i,o){var a,s,h,l=8*o-i-1,f=(1<>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-a))<1&&(a--,h*=2),(t+=a+c>=1?u/h:u*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*h-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*_}var f={}.toString,c=Array.isArray||function(e){return"[object Array]"==f.call(e)};function u(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(u()=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function y(e){return!(null==e||!e._isBuffer)}function m(e,t){if(y(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return q(e).length;t=(""+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),y(t))return 0===t.length?-1:x(e,t,r,n,i);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):x(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,n,i){var o,a=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,h/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-h),o=r;o>=0;o--){for(var c=!0,u=0;ui&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?s(e):s(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(h=(31&l)<<6|63&o)>127&&(f=h);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(h=(15&l)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,n,i){if(!y(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),h=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return B(this,e,t,r);case"latin1":case"binary":return z(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,o){if(!y(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,i){return i||j(e,0,r,4),l(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||j(e,0,r,8),l(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},p.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),h(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),h(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),h(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),h(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return function(e){var t,a,s,h,l,f;i||o();var c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");l="="===e[c-2]?2:"="===e[c-1]?1:0,f=new n(3*c/4-l),s=l>0?c-4:c;var u=0;for(t=0,a=0;t>16&255,f[u++]=h>>8&255,f[u++]=255&h;return 2===l?(h=r[e.charCodeAt(t)]<<2|r[e.charCodeAt(t+1)]>>4,f[u++]=255&h):1===l&&(h=r[e.charCodeAt(t)]<<10|r[e.charCodeAt(t+1)]<<4|r[e.charCodeAt(t+2)]>>2,f[u++]=h>>8&255,f[u++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e){return null!=e&&(!!e._isBuffer||J(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&J(e.slice(0,0))}(e))}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Q(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=Q(function(e,t){var r;e.exports=(r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,h=i/s,l=(h=t?e.ceil(h):e.max((0|h)-this._minBufferSize,0))*o,f=e.min(4*l,i);if(l){for(var c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)}),Q(function(e,t){var r,n,i;e.exports=(i=(n=r=ee).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|h)<<24-o%4*8,o++}return i.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],_=e[t+4],g=e[t+5],v=e[t+6],w=e[t+7],b=e[t+8],y=e[t+9],m=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],x=e[t+14],R=e[t+15],A=o[0],B=o[1],z=o[2],L=o[3];A=l(A,B,z,L,a,7,s[0]),L=l(L,A,B,z,h,12,s[1]),z=l(z,L,A,B,d,17,s[2]),B=l(B,z,L,A,p,22,s[3]),A=l(A,B,z,L,_,7,s[4]),L=l(L,A,B,z,g,12,s[5]),z=l(z,L,A,B,v,17,s[6]),B=l(B,z,L,A,w,22,s[7]),A=l(A,B,z,L,b,7,s[8]),L=l(L,A,B,z,y,12,s[9]),z=l(z,L,A,B,m,17,s[10]),B=l(B,z,L,A,k,22,s[11]),A=l(A,B,z,L,E,7,s[12]),L=l(L,A,B,z,S,12,s[13]),z=l(z,L,A,B,x,17,s[14]),A=f(A,B=l(B,z,L,A,R,22,s[15]),z,L,h,5,s[16]),L=f(L,A,B,z,v,9,s[17]),z=f(z,L,A,B,k,14,s[18]),B=f(B,z,L,A,a,20,s[19]),A=f(A,B,z,L,g,5,s[20]),L=f(L,A,B,z,m,9,s[21]),z=f(z,L,A,B,R,14,s[22]),B=f(B,z,L,A,_,20,s[23]),A=f(A,B,z,L,y,5,s[24]),L=f(L,A,B,z,x,9,s[25]),z=f(z,L,A,B,p,14,s[26]),B=f(B,z,L,A,b,20,s[27]),A=f(A,B,z,L,S,5,s[28]),L=f(L,A,B,z,d,9,s[29]),z=f(z,L,A,B,w,14,s[30]),A=c(A,B=f(B,z,L,A,E,20,s[31]),z,L,g,4,s[32]),L=c(L,A,B,z,b,11,s[33]),z=c(z,L,A,B,k,16,s[34]),B=c(B,z,L,A,x,23,s[35]),A=c(A,B,z,L,h,4,s[36]),L=c(L,A,B,z,_,11,s[37]),z=c(z,L,A,B,w,16,s[38]),B=c(B,z,L,A,m,23,s[39]),A=c(A,B,z,L,S,4,s[40]),L=c(L,A,B,z,a,11,s[41]),z=c(z,L,A,B,p,16,s[42]),B=c(B,z,L,A,v,23,s[43]),A=c(A,B,z,L,y,4,s[44]),L=c(L,A,B,z,E,11,s[45]),z=c(z,L,A,B,R,16,s[46]),A=u(A,B=c(B,z,L,A,d,23,s[47]),z,L,a,6,s[48]),L=u(L,A,B,z,w,10,s[49]),z=u(z,L,A,B,x,15,s[50]),B=u(B,z,L,A,g,21,s[51]),A=u(A,B,z,L,E,6,s[52]),L=u(L,A,B,z,p,10,s[53]),z=u(z,L,A,B,m,15,s[54]),B=u(B,z,L,A,h,21,s[55]),A=u(A,B,z,L,b,6,s[56]),L=u(L,A,B,z,R,10,s[57]),z=u(z,L,A,B,v,15,s[58]),B=u(B,z,L,A,S,21,s[59]),A=u(A,B,z,L,_,6,s[60]),L=u(L,A,B,z,k,10,s[61]),z=u(z,L,A,B,d,15,s[62]),B=u(B,z,L,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+B|0,o[2]=o[2]+z|0,o[3]=o[3]+L|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,h=s.words,l=0;l<4;l++){var f=h[l];h[l]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function c(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(h),t.HmacMD5=o._createHmacHelper(h)}(Math),r.MD5)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).lib,o=i.WordArray,a=i.Hasher,s=n.algo,h=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=0;l<80;l++){if(l<16)h[l]=0|e[t+l];else{var f=h[l-3]^h[l-8]^h[l-14]^h[l-16];h[l]=f<<1|f>>>31}var c=(n<<5|n>>>27)+s+h[l];c+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=a._createHelper(l),n.HmacSHA1=a._createHmacHelper(l),r.SHA1)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],h=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),h[i]=r(e.pow(n,1/3)),i++),n++}();var l=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=0;d<64;d++){if(d<16)l[d]=0|e[t+d];else{var p=l[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[d]=_+l[d-7]+v+l[d-16]}var w=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),y=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&c)+h[d]+l[d];u=c,c=f,f=s,s=a+y|0,a=o,o=i,i=n,n=y+(b+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+c|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),r.SHA256)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(i=(n=r=ee).lib.WordArray,o=n.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=a._createHelper(s),n.HmacSHA224=a._createHmacHelper(s),r.SHA224)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var h=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var f=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=n.high,p=n.low,_=i.high,g=i.low,v=o.high,w=o.low,b=a.high,y=a.low,m=s.high,k=s.low,E=f.high,S=f.low,x=c.high,R=c.low,A=u.high,B=u.low,z=d,L=p,T=_,M=g,C=v,D=w,I=b,P=y,O=m,U=k,H=E,F=S,N=x,Z=R,j=A,W=B,Y=0;Y<80;Y++){var K=l[Y];if(Y<16)var X=K.high=0|e[t+2*Y],q=K.low=0|e[t+2*Y+1];else{var V=l[Y-15],G=V.high,$=V.low,J=(G>>>1|$<<31)^(G>>>8|$<<24)^G>>>7,Q=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),ee=l[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[Y-7],ae=oe.high,se=oe.low,he=l[Y-16],le=he.high,fe=he.low;X=(X=(X=J+ae+((q=Q+se)>>>0>>0?1:0))+ne+((q+=ie)>>>0>>0?1:0))+le+((q+=fe)>>>0>>0?1:0),K.high=X,K.low=q}var ce,ue=O&H^~O&N,de=U&F^~U&Z,pe=z&T^z&C^T&C,_e=L&M^L&D^M&D,ge=(z>>>28|L<<4)^(z<<30|L>>>2)^(z<<25|L>>>7),ve=(L>>>28|z<<4)^(L<<30|z>>>2)^(L<<25|z>>>7),we=(O>>>14|U<<18)^(O>>>18|U<<14)^(O<<23|U>>>9),be=(U>>>14|O<<18)^(U>>>18|O<<14)^(U<<23|O>>>9),ye=h[Y],me=ye.high,ke=ye.low,Ee=j+we+((ce=W+be)>>>0>>0?1:0),Se=ve+_e;j=N,W=Z,N=H,Z=F,H=O,F=U,O=I+(Ee=(Ee=(Ee=Ee+ue+((ce+=de)>>>0>>0?1:0))+me+((ce+=ke)>>>0>>0?1:0))+X+((ce+=q)>>>0>>0?1:0))+((U=P+ce|0)>>>0

>>0?1:0)|0,I=C,P=D,C=T,D=M,T=z,M=L,z=Ee+(ge+pe+(Se>>>0>>0?1:0))+((L=ce+Se|0)>>>0>>0?1:0)|0}p=n.low=p+L,n.high=d+z+(p>>>0>>0?1:0),g=i.low=g+M,i.high=_+T+(g>>>0>>0?1:0),w=o.low=w+D,o.high=v+C+(w>>>0>>0?1:0),y=a.low=y+P,a.high=b+I+(y>>>0

>>0?1:0),k=s.low=k+U,s.high=m+O+(k>>>0>>0?1:0),S=f.low=S+F,f.high=E+H+(S>>>0>>0?1:0),R=c.low=R+Z,c.high=x+N+(R>>>0>>0?1:0),B=u.low=B+W,u.high=A+j+(B>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),r.SHA512)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).x64,o=i.Word,a=i.WordArray,s=n.algo,h=s.SHA512,l=s.SHA384=h.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=h._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=h._createHelper(l),n.HmacSHA384=h._createHmacHelper(l),r.SHA384)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,h=[],l=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){h[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,c=0,u=0;u<7;u++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=r[i]).high^=a,B.low^=o}for(var s=0;s<24;s++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(B=r[u+5*_]).high,p^=B.low;var g=c[u];g.high=d,g.low=p}for(u=0;u<5;u++){var v=c[(u+4)%5],w=c[(u+1)%5],b=w.high,y=w.low;for(d=v.high^(b<<1|y>>>31),p=v.low^(y<<1|b>>>31),_=0;_<5;_++)(B=r[u+5*_]).high^=d,B.low^=p}for(var m=1;m<25;m++){var k=(B=r[m]).high,E=B.low,S=h[m];S<32?(d=k<>>32-S,p=E<>>32-S):(d=E<>>64-S,p=k<>>64-S);var x=c[l[m]];x.high=d,x.low=p}var R=c[0],A=r[0];for(R.high=A.high,R.low=A.low,u=0;u<5;u++)for(_=0;_<5;_++){var B=r[m=u+5*_],z=c[m],L=c[(u+1)%5+5*_],T=c[(u+2)%5+5*_];B.high=z.high^~L.high&T.high,B.low=z.low^~L.low&T.low}B=r[0];var M=f[s];B.high^=M.high,B.low^=M.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,h=s/8,l=[],f=0;f>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(u)}return new i.init(l,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(u),t.HmacSHA3=o._createHmacHelper(u)}(Math),r.SHA3)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.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]),h=i.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]),l=i.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]),f=i.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]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,y,m,k,E,S,x,R,A,B=this._hash.words,z=c.words,L=u.words,T=s.words,M=h.words,C=l.words,D=f.words;for(k=o=B[0],E=a=B[1],S=d=B[2],x=y=B[3],R=m=B[4],r=0;r<80;r+=1)A=o+e[t+T[r]]|0,A+=r<16?p(a,d,y)+z[0]:r<32?_(a,d,y)+z[1]:r<48?g(a,d,y)+z[2]:r<64?v(a,d,y)+z[3]:w(a,d,y)+z[4],A=(A=b(A|=0,C[r]))+m|0,o=m,m=y,y=b(d,10),d=a,a=A,A=k+e[t+M[r]]|0,A+=r<16?w(E,S,x)+L[0]:r<32?v(E,S,x)+L[1]:r<48?g(E,S,x)+L[2]:r<64?_(E,S,x)+L[3]:p(E,S,x)+L[4],A=(A=b(A|=0,D[r]))+R|0,k=R,R=x,x=b(S,10),S=E,E=A;A=B[1]+d+x|0,B[1]=B[2]+y+R|0,B[2]=B[3]+m+k|0,B[3]=B[4]+o+E|0,B[4]=B[0]+a+S|0,B[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function _(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function w(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=ee).lib,i=n.Base,o=r.enc,a=o.Utf8,s=r.algo,void(s.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,h=o.words,l=0;l>>2];e.sigBytes-=t}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:g,padding:w}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),b=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=i.format={},m=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=s.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=s.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:n})}},k=o.SerializableCipher=a.extend({cfg:a.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),E=i.kdf={},S=E.OpenSSL={execute:function(e,t,r,n){n||(n=s.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=s.create(i.words.slice(t),4*r);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:n})}},x=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=k.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=k.decrypt.call(this,e,t,i.key,n);return o}})))}),Q(function(e,t){var r;e.exports=((r=ee).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var h=0;h>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)}),Q(function(e,t){var r;e.exports=((r=ee).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},r.pad.ZeroPadding)}),Q(function(e,t){var r;e.exports=((r=ee).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)}),Q(function(e,t){var r,n,i,o;e.exports=(i=(n=r=ee).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},r.format.Hex)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],o=[],a=[],s=[],h=[],l=[],f=[],c=[],u=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var _=e[r],g=e[_],v=e[g],w=257*e[p]^16843008*p;a[r]=w<<24|w>>>8,s[r]=w<<16|w>>>16,h[r]=w<<8|w>>>24,l[r]=w,w=16843009*v^65537*g^257*_^16843008*r,f[p]=w<<24|w>>>8,c[p]=w<<16|w>>>16,u[p]=w<<8|w>>>24,d[p]=w,r?(r=_^e[e[e[v^_]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var h=this._invKeySchedule=[],l=0;l>>24]]^c[i[s>>>16&255]]^u[i[s>>>8&255]]^d[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,h,l,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,c,u,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var h=this._nRounds,l=e[t]^r[0],f=e[t+1]^r[1],c=e[t+2]^r[2],u=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&u]^r[d++],g=n[f>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&l]^r[d++],v=n[c>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++],w=n[u>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&c]^r[d++];l=_,f=g,c=v,u=w}_=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^r[d++],g=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],w=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[d++],e[t]=_,e[t+1]=g,e[t+2]=v,e[t+3]=w},keySize:8});e.AES=t._createHelper(_)}(),r.AES)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[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],s=[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],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{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}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],f=h[o];for(r=0;r<24;r++)l[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,l[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(l[0]=l[0]<<1|l[0]>>>31,r=1;r<7;r++)l[r]=l[r]>>>4*(r-1)+3;l[7]=l[7]<<5|l[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,h=0;h<8;h++)s|=l[h][((a^i[h])&f[h])>>>0];this._lBlock=a,this._rBlock=o^s}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var h=n[i];n[i]=n[o],n[o]=h}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(i[0]^=l,i[1]^=c,i[2]^=f,i[3]^=u,i[4]^=l,i[5]^=c,i[6]^=f,i[7]^=u,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)h.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(n[0]^=l,n[1]^=c,n[2]^=f,n[3]^=u,n[4]^=l,n[5]^=c,n[6]^=f,n[7]^=u,i=0;i<4;i++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)}),Q(function(e,t){e.exports=ee}));function re(){throw new Error("setTimeout has not been defined")}function ne(){throw new Error("clearTimeout has not been defined")}var ie=re,oe=ne;function ae(e){if(ie===setTimeout)return setTimeout(e,0);if((ie===re||!ie)&&setTimeout)return ie=setTimeout,setTimeout(e,0);try{return ie(e,0)}catch(t){try{return ie.call(null,e,0)}catch(t){return ie.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ie=setTimeout),"function"==typeof e.clearTimeout&&(oe=clearTimeout);var se,he=[],le=!1,fe=-1;function ce(){le&&se&&(le=!1,se.length?he=se.concat(he):fe=-1,he.length&&ue())}function ue(){if(!le){var e=ae(ce);le=!0;for(var t=he.length;t;){for(se=he,he=[];++fe1)for(var r=1;r0&&a.length>i){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function xe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Re(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Ae(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}ge.prototype=Object.create(null),ve.EventEmitter=ve,ve.usingDomains=!1,ve.prototype.domain=void 0,ve.prototype._events=void 0,ve.prototype._maxListeners=void 0,ve.defaultMaxListeners=10,ve.init=function(){this.domain=null,ve.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ge,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ve.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ve.prototype.getMaxListeners=function(){return we(this)},ve.prototype.emit=function(e){var t,r,n,i,o,a,s,h="error"===e;if(a=this._events)h=h&&null==a.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:be(r,f,this);break;case 2:ye(r,f,this,arguments[1]);break;case 3:me(r,f,this,arguments[1],arguments[2]);break;case 4:ke(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new ge,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var Be="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},ze=/%[sdj%]/g;function Le(e){if(!Ze(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Fe(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ye(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),je(r.showHidden)&&(r.showHidden=!1),je(r.depth)&&(r.depth=2),je(r.colors)&&(r.colors=!1),je(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ie),Oe(r,e,r.depth)}function Ie(e,t){var r=De.styles[t];return r?"["+De.colors[r][0]+"m"+e+"["+De.colors[r][1]+"m":e}function Pe(e,t){return e}function Oe(e,t,r){if(e.customInspect&&t&&qe(t.inspect)&&t.inspect!==De&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Ze(n)||(n=Oe(e,n,r)),n}var i=function(e,t){if(je(t))return e.stylize("undefined","undefined");if(Ze(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Fe(t))return e.stylize(""+t,"boolean");if(Ne(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Xe(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ue(t);if(0===o.length){if(qe(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(We(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ke(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Xe(t))return Ue(t)}var h,l,f="",c=!1,u=["{","}"];(h=t,Array.isArray(h)&&(c=!0,u=["[","]"]),qe(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return We(t)&&(f=" "+RegExp.prototype.toString.call(t)),Ke(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Xe(t)&&(f=" "+Ue(t)),0!==o.length||c&&0!=t.length?r<0?We(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=c?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,f,u)):u[0]+f+u[1]}function Ue(e){return"["+Error.prototype.toString.call(e)+"]"}function He(e,t,r,n,i,o){var a,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),Ge(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=Ne(r)?Oe(e,h.value,null):Oe(e,h.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),je(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Fe(e){return"boolean"==typeof e}function Ne(e){return null===e}function Ze(e){return"string"==typeof e}function je(e){return void 0===e}function We(e){return Ye(e)&&"[object RegExp]"===Ve(e)}function Ye(e){return"object"==typeof e&&null!==e}function Ke(e){return Ye(e)&&"[object Date]"===Ve(e)}function Xe(e){return Ye(e)&&("[object Error]"===Ve(e)||e instanceof Error)}function qe(e){return"function"==typeof e}function Ve(e){return Object.prototype.toString.call(e)}function Ge(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $e(){this.head=null,this.tail=null,this.length=0}De.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},De.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},$e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},$e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},$e.prototype.clear=function(){this.head=this.tail=null,this.length=0},$e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},$e.prototype.concat=function(e){if(0===this.length)return p.alloc(0);if(1===this.length)return this.head.data;for(var t=p.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Je=p.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Qe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Je(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=tt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=rt;break;default:return void(this.write=et)}this.charBuffer=new p(6),this.charReceived=0,this.charLength=0}function et(e){return e.toString(this.encoding)}function tt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function rt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Qe.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},Qe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},Qe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},ot.ReadableState=it;var nt=function(e){je(Me)&&(Me=""),e=e.toUpperCase(),Ce[e]||(new RegExp("\\b"+e+"\\b","i").test(Me)?Ce[e]=function(){var t=Le.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Ce[e]=function(){});return Ce[e]}("stream");function it(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ct&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new $e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Qe(e.encoding),this.encoding=e.encoding)}function ot(e){if(!(this instanceof ot))return new ot(e);this._readableState=new it(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ve.call(this)}function at(e,t,r,n,i){var o=function(e,t){var r=null;$(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,lt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&<(e))),function(e,t){t.readingMore||(t.readingMore=!0,de(ct,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?de(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function ct(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=p.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,de(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):lt(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?_t(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},ot.prototype._read=function(e){this.emit("error",new Error("not implemented"))},ot.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){nt("onunpipe"),e===r&&l()}function a(){nt("onend"),e.end()}n.endEmitted?de(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function l(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",u),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",c),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function c(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==wt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function u(t){var r;nt("onerror",t),_(),e.removeListener("error",u),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),_()}function p(){nt("onfinish"),e.removeListener("close",d),_()}function _(){nt("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",u),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},ot.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},kt.prototype._write=function(e,t,r){r(new Error("not implemented"))},kt.prototype._writev=null,kt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Bt(e,t),r&&(t.finished?de(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Be(Ct,ot);for(var Lt=Object.keys(kt.prototype),Tt=0;Tt=0;)e[t]=0}var Jt=0,Qt=1,er=2,tr=29,rr=256,nr=rr+1+tr,ir=30,or=19,ar=2*nr+1,sr=15,hr=16,lr=7,fr=256,cr=16,ur=17,dr=18,pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],vr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wr=new Array(2*(nr+2));$t(wr);var br=new Array(2*ir);$t(br);var yr=new Array(512);$t(yr);var mr=new Array(256);$t(mr);var kr=new Array(tr);$t(kr);var Er,Sr,xr,Rr=new Array(ir);function Ar(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Br(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function zr(e){return e<256?yr[e]:yr[256+(e>>>7)]}function Lr(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Tr(e,t,r){e.bi_valid>hr-r?(e.bi_buf|=t<>hr-e.bi_valid,e.bi_valid+=r-hr):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function Dr(e,t,r){var n,i,o=new Array(sr+1),a=0;for(n=1;n<=sr;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=Cr(o[s]++,s))}}function Ir(e){var t;for(t=0;t8?Lr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Or(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)Ur(e,o,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ur(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Ur(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,h=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,c=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=sr;o++)e.bl_count[o]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(o=p,_++),h[2*n+1]=o,n>l||(e.bl_count[o]++,a=0,n>=d&&(a=u[n-d]),s=h[2*n],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>l||(h[2*i+1]!==o&&(e.opt_len+=(o-h[2*i+1])*h[2*i],h[2*i+1]=o),n--)}}(e,t),Dr(o,l,e.bl_count)}function Nr(e,t,r){var n,i,o=-1,a=t[1],s=0,h=7,l=4;for(0===a&&(h=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function Xr(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Gt&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return qt;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Vt;for(t=32;t=3&&0===e.bl_tree[2*vr[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Yr(e,t,r,n):e.strategy===Xt||o===i?(Tr(e,(Qt<<1)+(n?1:0),3),Hr(e,wr,br)):(Tr(e,(er<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Tr(e,t-257,5),Tr(e,r-1,5),Tr(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(mr[r]+rr+1)]++,e.dyn_dtree[2*zr(t)]++),e.last_lit===e.lit_bufsize-1}function Vr(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Gr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function $r(e,t,r,n){var i=Gr,o=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}var Jr,Qr=0,en=1,tn=3,rn=4,nn=5,on=0,an=1,sn=-2,hn=-3,ln=-5,fn=-1,cn=1,un=2,dn=3,pn=4,_n=2,gn=8,vn=9,wn=286,bn=30,yn=19,mn=2*wn+1,kn=15,En=3,Sn=258,xn=Sn+En+1,Rn=32,An=42,Bn=69,zn=73,Ln=91,Tn=103,Mn=113,Cn=666,Dn=1,In=2,Pn=3,On=4,Un=3;function Hn(e,t){return e.msg=Nt[t],t}function Fn(e){return(e<<1)-(e>4?9:0)}function Nn(e){for(var t=e.length;--t>=0;)e[t]=0}function Zn(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(jt(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function jn(e,t){Xr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zn(e.strm)}function Wn(e,t){e.pending_buf[e.pending++]=t}function Yn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Kn(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-xn?e.strstart-(e.w_size-xn):0,l=e.window,f=e.w_mask,c=e.prev,u=e.strstart+Sn,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}}while((t=c[t&f])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Xn(e){var t,r,n,i,o,a,s,h,l,f,c=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-xn)){jt(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=c?n-c:0}while(--r);t=r=c;do{n=e.prev[--t],e.prev[t]=n>=c?n-c:0}while(--r);i+=c}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,h=e.strstart+e.lookahead,l=i,f=void 0,(f=a.avail_in)>l&&(f=l),r=0===f?0:(a.avail_in-=f,jt(s,a.input,a.next_in,f,h),1===a.state.wrap?a.adler=Vr(a.adler,s,f,h):2===a.state.wrap&&(a.adler=$r(a.adler,s,f,h)),a.next_in+=f,a.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=En)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<=En)if(n=qr(e,e.strstart-e.match_start,e.match_length-En),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=En){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=En-1)),e.prev_length>=En&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-En,n=qr(e,e.strstart-1-e.prev_match,e.prev_length-En),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<nn||t<0)return e?Hn(e,sn):sn;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Cn&&t!==rn)return Hn(e,0===e.avail_out?ln:sn);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===An)if(2===n.wrap)e.adler=0,Wn(n,31),Wn(n,139),Wn(n,8),n.gzhead?(Wn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Wn(n,255&n.gzhead.time),Wn(n,n.gzhead.time>>8&255),Wn(n,n.gzhead.time>>16&255),Wn(n,n.gzhead.time>>24&255),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Wn(n,255&n.gzhead.extra.length),Wn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=$r(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Bn):(Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,Un),n.status=Mn);else{var a=gn+(n.w_bits-8<<4)<<8;a|=(n.strategy>=un||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=Rn),a+=31-a%31,n.status=Mn,Yn(n,a),0!==n.strstart&&(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),e.adler=1}if(n.status===Bn)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending!==n.pending_buf_size));)Wn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zn)}else n.status=zn;if(n.status===zn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=Ln)}else n.status=Ln;if(n.status===Ln)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=Tn)}else n.status=Tn;if(n.status===Tn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Zn(e),n.pending+2<=n.pending_buf_size&&(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),e.adler=0,n.status=Mn)):n.status=Mn),0!==n.pending){if(Zn(e),0===e.avail_out)return n.last_flush=-1,on}else if(0===e.avail_in&&Fn(t)<=Fn(r)&&t!==rn)return Hn(e,ln);if(n.status===Cn&&0!==e.avail_in)return Hn(e,ln);if(0!==e.avail_in||0!==n.lookahead||t!==Qr&&n.status!==Cn){var s=n.strategy===un?function(e,t){for(var r;;){if(0===e.lookahead&&(Xn(e),0===e.lookahead)){if(t===Qr)return Dn;break}if(e.match_length=0,r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):n.strategy===dn?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Sn){if(Xn(e),e.lookahead<=Sn&&t===Qr)return Dn;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=En&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+Sn;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=En?(r=qr(e,1,e.match_length-En),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):Jr[n.level].func(n,t);if(s!==Pn&&s!==On||(n.status=Cn),s===Dn||s===Pn)return 0===e.avail_out&&(n.last_flush=-1),on;if(s===In&&(t===en?Kr(n):t!==nn&&(Yr(n,0,0,!1),t===tn&&(Nn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Zn(e),0===e.avail_out))return n.last_flush=-1,on}return t!==rn?on:n.wrap<=0?an:(2===n.wrap?(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),Wn(n,e.adler>>16&255),Wn(n,e.adler>>24&255),Wn(n,255&e.total_in),Wn(n,e.total_in>>8&255),Wn(n,e.total_in>>16&255),Wn(n,e.total_in>>24&255)):(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),Zn(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?on:an)}Jr=[new Gn(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xn(e),0===e.lookahead&&t===Qr)return Dn;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,jn(e,!1),0===e.strm.avail_out))return Dn;if(e.strstart-e.block_start>=e.w_size-xn&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):(e.strstart>e.block_start&&(jn(e,!1),e.strm.avail_out),Dn)}),new Gn(4,4,8,4,qn),new Gn(4,5,16,8,qn),new Gn(4,6,32,32,qn),new Gn(4,4,16,16,Vn),new Gn(8,16,32,32,Vn),new Gn(8,16,128,128,Vn),new Gn(8,32,128,256,Vn),new Gn(32,128,258,1024,Vn),new Gn(32,258,258,4096,Vn)];var ei=30,ti=12;function ri(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R;r=e.state,n=e.next_in,x=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),h=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,u=r.window,d=r.hold,p=r.bits,_=r.lencode,g=r.distcode,v=(1<>>=y=b>>>24,p-=y,0===(y=b>>>16&255))R[o++]=65535&b;else{if(!(16&y)){if(0==(64&y)){b=_[(65535&b)+(d&(1<>>=y,p-=y),p<15&&(d+=x[n++]<>>=y=b>>>24,p-=y,!(16&(y=b>>>16&255))){if(0==(64&y)){b=g[(65535&b)+(d&(1<h){e.msg="invalid distance too far back",r.mode=ei;break e}if(d>>>=y,p-=y,k>(y=o-a)){if((y=k-y)>f&&r.sane){e.msg="invalid distance too far back",r.mode=ei;break e}if(E=0,S=u,0===c){if(E+=l-y,y2;)R[o++]=S[E++],R[o++]=S[E++],R[o++]=S[E++],m-=3;m&&(R[o++]=S[E++],m>1&&(R[o++]=S[E++]))}else{E=o-k;do{R[o++]=R[E++],R[o++]=R[E++],R[o++]=R[E++],m-=3}while(m>2);m&&(R[o++]=R[E++],m>1&&(R[o++]=R[E++]))}break}}break}}while(n>3,d&=(1<<(p-=m<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[m];m--);if(k>m&&(k=m),0===m)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y0&&(e===ai||1!==m))return-1;for(T[1]=0,w=1;wii||e===hi&&R>oi)return 1;for(;;){p=w-S,a[b]d?(_=M[C+a[b]],g=B[z+a[b]]):(_=96,g=0),h=1<>S)+(l-=h)]=p<<24|_<<16|g|0}while(0!==l);for(h=1<>=1;if(0!==h?(A&=h-1,A+=h):A=0,b++,0==--L[w]){if(w===m)break;w=t[r+a[b]]}if(w>k&&(A&c)!==f){for(0===S&&(S=k),u+=y,x=1<<(E=w-S);E+Sii||e===hi&&R>oi)return 1;i[f=A&c]=k<<24|E<<16|u-o|0}}return 0!==A&&(i[u+A]=w-S<<24|64<<16|0),s.bits=k,0}var pi=0,_i=1,gi=2,vi=4,wi=5,bi=6,yi=0,mi=1,ki=2,Ei=-2,Si=-3,xi=-4,Ri=-5,Ai=8,Bi=1,zi=2,Li=3,Ti=4,Mi=5,Ci=6,Di=7,Ii=8,Pi=9,Oi=10,Ui=11,Hi=12,Fi=13,Ni=14,Zi=15,ji=16,Wi=17,Yi=18,Ki=19,Xi=20,qi=21,Vi=22,Gi=23,$i=24,Ji=25,Qi=26,eo=27,to=28,ro=29,no=30,io=31,oo=32,ao=852,so=592;function ho(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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 Yt(320),this.work=new Yt(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fo(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Bi,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Kt(ao),t.distcode=t.distdyn=new Kt(so),t.sane=1,t.back=-1,yi):Ei}(e)):Ei}function co(e,t){var r,n;return e?(n=new lo,e.state=n,n.window=null,(r=function(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ei:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,fo(e))):Ei}(e,t))!==yi&&(e.state=null),r):Ei}var uo,po,_o=!0;function go(e){if(_o){var t;for(uo=new Kt(512),po=new Kt(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(di(_i,e.lens,0,288,uo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;di(gi,e.lens,0,32,po,0,e.work,{bits:5}),_o=!1}e.lencode=uo,e.lenbits=9,e.distcode=po,e.distbits=5}function vo(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R=0,A=new Wt(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ei;(r=e.state).mode===Hi&&(r.mode=Fi),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,c=s,u=h,E=yi;e:for(;;)switch(r.mode){case Bi:if(0===r.wrap){r.mode=Fi;break}for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0),l=0,f=0,r.mode=zi;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=no;break}if((15&l)!==Ai){e.msg="unknown compression method",r.mode=no;break}if(f-=4,k=8+(15&(l>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=no;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Li;case Li:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=$r(r.check,A,4,0)),l=0,f=0,r.mode=Ti;case Ti:for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>8),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Mi;case Mi:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0}else r.head&&(r.head.extra=null);r.mode=Ci;case Ci:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),jt(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=$r(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Di;case Di:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Hi;break;case Oi:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>=7&f,f-=7&f,r.mode=eo;break}for(;f<3;){if(0===s)break e;s--,l+=n[o++]<>>=1)){case 0:r.mode=Ni;break;case 1:if(go(r),r.mode=Xi,t===bi){l>>>=2,f-=2;break e}break;case 2:r.mode=Wi;break;case 3:e.msg="invalid block type",r.mode=no}l>>>=2,f-=2;break;case Ni:for(l>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,l+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=no;break}if(r.length=65535&l,l=0,f=0,r.mode=Zi,t===bi)break e;case Zi:r.mode=ji;case ji:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;jt(i,n,o,d,a),s-=d,o+=d,h-=d,a+=d,r.length-=d;break}r.mode=Hi;break;case Wi:for(;f<14;){if(0===s)break e;s--,l+=n[o++]<>>=5,f-=5,r.ndist=1+(31&l),l>>>=5,f-=5,r.ncode=4+(15&l),l>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=no;break}r.have=0,r.mode=Yi;case Yi:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},E=di(pi,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid code lengths set",r.mode=no;break}r.have=0,r.mode=Ki;case Ki:for(;r.have>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(x=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=no;break}k=r.lens[r.have-1],d=3+(3&l),l>>>=2,f-=2}else if(17===w){for(x=g+3;f>>=g)),l>>>=3,f-=3}else{for(x=g+7;f>>=g)),l>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=no;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===no)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=no;break}if(r.lenbits=9,S={bits:r.lenbits},E=di(_i,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid literal/lengths set",r.mode=no;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},E=di(gi,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,E){e.msg="invalid distances set",r.mode=no;break}if(r.mode=Xi,t===bi)break e;case Xi:r.mode=qi;case qi:if(s>=6&&h>=258){e.next_out=a,e.avail_out=h,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=f,ri(e,u),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,r.mode===Hi&&(r.back=-1);break}for(r.back=0;v=(R=r.lencode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,r.length=w,0===v){r.mode=Qi;break}if(32&v){r.back=-1,r.mode=Hi;break}if(64&v){e.msg="invalid literal/length code",r.mode=no;break}r.extra=15&v,r.mode=Vi;case Vi:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Gi;case Gi:for(;v=(R=r.distcode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=no;break}r.offset=w,r.extra=15&v,r.mode=$i;case $i:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=no;break}r.mode=Ji;case Ji:if(0===h)break e;if(d=u-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=no;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),_=r.window}else _=i,p=a-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[a++]=_[p++]}while(--d);0===r.length&&(r.mode=qi);break;case Qi:if(0===h)break e;i[a++]=r.length,h--,r.mode=qi;break;case eo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,l|=n[o++]<=o.wsize?(jt(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),jt(o.window,t,r-n,i,o.wnext),(n-=i)?(jt(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveyo)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function ko(e,t){for(var r=0;r15&&(a=2,n-=16),i<1||i>vn||r!==gn||n<8||n>15||t<0||t>9||o<0||o>pn)return Hn(e,sn);8===n&&(n=9);var s=new $n;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<So.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsSo.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelSo.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelSo.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=So.Z_FILTERED&&e.strategy!=So.Z_HUFFMAN_ONLY&&e.strategy!=So.Z_RLE&&e.strategy!=So.Z_FIXED&&e.strategy!=So.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!$(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new So.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=So.codes[t],r.emit("error",n)};var n=So.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=So.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||So.Z_DEFAULT_WINDOWBITS,n,e.memLevel||So.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new p(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(xo).forEach(function(e){xo[xo[e]]=e}),Be(Io,Ot),Io.prototype.params=function(e,t,r){if(eSo.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=So.Z_FILTERED&&t!=So.Z_HUFFMAN_ONLY&&t!=So.Z_RLE&&t!=So.Z_FIXED&&t!=So.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(So.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else de(r)},Io.prototype.reset=function(){return this._binding.reset()},Io.prototype._flush=function(e){this._transform(new p(0),"",e)},Io.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=So.Z_FULL_FLUSH),r.ended)t&&de(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new p(0),"",t)},Io.prototype.close=function(e){if(e&&de(e),!this._closed){this._closed=!0,this._binding.close();var t=this;de(function(){t.emit("close")})}},Io.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!$(e))return r(new Error("invalid input"));o?n=So.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||So.Z_NO_FLUSH)),this._processChunk(e,n,r)},Io.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof r;if(!s){var h,l=[],f=0;this.on("error",function(e){h=e});do{var c=this._binding.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&_(c[0],c[1]));if(this._hadError)throw h;var u=p.concat(l,f);return this.close(),u}var d=this._binding.write(t,e,o,n,this._buffer,this._offset,i);function _(h,c){if(!a._hadError){var u=i-c;if(function(e,t){if(!e)throw new Error(t)}(u>=0,"have should not go down"),u>0){var d=a._buffer.slice(a._offset,a._offset+u);a._offset+=u,s?a.push(d):(l.push(d),f+=d.length)}if((0===c||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new p(a._chunkSize)),0===c){if(o+=n-h,n=h,!s)return!0;var g=a._binding.write(t,e,o,n,a._buffer,a._offset,a._chunkSize);return g.callback=_,void(g.buffer=e)}if(!s)return!1;r()}}d.buffer=e,d.callback=_},Be(Bo,Io),Be(zo,Io),Be(Lo,Io),Be(To,Io),Be(Mo,Io),Be(Co,Io),Be(Do,Io);var Po={codes:xo,createDeflate:function(e){return new Bo(e)},createInflate:function(e){return new zo(e)},createDeflateRaw:function(e){return new Mo(e)},createInflateRaw:function(e){return new Co(e)},createGzip:function(e){return new Lo(e)},createGunzip:function(e){return new To(e)},createUnzip:function(e){return new Do(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Bo(t),e,r)},deflateSync:function(e,t){return Ao(new Bo(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Lo(t),e,r)},gzipSync:function(e,t){return Ao(new Lo(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Mo(t),e,r)},deflateRawSync:function(e,t){return Ao(new Mo(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Do(t),e,r)},unzipSync:function(e,t){return Ao(new Do(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new zo(t),e,r)},inflateSync:function(e,t){return Ao(new zo(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new To(t),e,r)},gunzipSync:function(e,t){return Ao(new To(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Co(t),e,r)},inflateRawSync:function(e,t){return Ao(new Co(t),e)},Deflate:Bo,Inflate:zo,Gzip:Lo,Gunzip:To,DeflateRaw:Mo,InflateRaw:Co,Unzip:Do,Zlib:Io};export default class{constructor(e,t,r){this.SDKAPPID=e,this.EXPIRETIME=r,this.PRIVATEKEY=t}genTestUserSig(e){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(e)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+e+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(e,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(e,t){return p.from?p.from(e,t):new p(e,t)}unescape(e){return e.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(e){return e.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(e){return this.escape(this.newBuffer(e).toString("base64"))}decode(e){return this.newBuffer(this.unescape(e),"base64")}base64encode(e){return this.newBuffer(e).toString("base64")}base64decode(e){return this.newBuffer(e,"base64").toString()}_hmacsha256(e,t,r,n){let i="TLS.identifier:"+e+"\n";i+="TLS.sdkappid:"+this.SDKAPPID+"\n",i+="TLS.time:"+t+"\n",i+="TLS.expire:"+r+"\n",null!=n&&(i+="TLS.userbuf:"+n+"\n");let o=te.HmacSHA256(i,this.PRIVATEKEY);return te.enc.Base64.stringify(o)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}_isString(e){return"string"==typeof e}genSigWithUserbuf(e,t,r){let n=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":n,"TLS.expire":t},o="";if(null!=r){let a=this.base64encode(r);i["TLS.userbuf"]=a,o=this._hmacsha256(e,n,t,a)}else o=this._hmacsha256(e,n,t,null);i["TLS.sig"]=o;let a=JSON.stringify(i),s=Po.deflateSync(this.newBuffer(a)).toString("base64"),h=this.escape(s);return console.log("ret="+h),h}validate(e){let t=this.decode(e),r=Po.inflateSync(t);console.log("validate ret="+r)}} diff --git a/TUICallKit/index.d.ts b/TUICallKit/index.d.ts new file mode 100644 index 0000000..df052ed --- /dev/null +++ b/TUICallKit/index.d.ts @@ -0,0 +1,3 @@ +import { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, StatusChange as STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, t } from './TUICallService/index'; +declare const Version = "2.1.1"; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, Version, t, }; diff --git a/TUICallKit/index.js b/TUICallKit/index.js new file mode 100644 index 0000000..fc3be4a --- /dev/null +++ b/TUICallKit/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.Version = exports.VideoDisplayMode = exports.VideoResolution = exports.CallMediaType = exports.CallRole = exports.STATUS = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = require("./TUICallService/index"); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_1.StoreName; } }); +Object.defineProperty(exports, "TUICallKitServer", { enumerable: true, get: function () { return index_1.TUICallKitServer; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_1.NAME; } }); +Object.defineProperty(exports, "STATUS", { enumerable: true, get: function () { return index_1.StatusChange; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_1.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_1.CallMediaType; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_1.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_1.VideoDisplayMode; } }); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_1.t; } }); +const Version = '2.1.1'; // basic-demo 原来上报使用 +exports.Version = Version; diff --git a/TUICallKit/package.json b/TUICallKit/package.json new file mode 100644 index 0000000..d2c79f6 --- /dev/null +++ b/TUICallKit/package.json @@ -0,0 +1,40 @@ +{ + "name": "@tencentcloud/call-uikit-wechat", + "version": "2.1.1", + "main": "./tuicall-uikit-vue.umd.js", + "module": "./tuicall-uikit-vue.es.js", + "types": "./types/index.d.ts", + "description": "An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.", + "homepage": "https://cloud.tencent.com/document/product/647/78912", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/tencentyun/TUICallKit/tree/main/uni-app/TUICallKit-Miniprogram", + "directory": "Web" + }, + "dependencies": { + "@tencentcloud/tui-core": "latest", + "tim-upload-plugin": "^1.3.0", + "tuicall-engine-wx": "latest" +}, + "bugs": { + "url": "https://github.com/tencentyun/TUICallKit/issues" + }, + "keywords": [ + "uikit", + "call", + "vue3", + "tencent", + "chat", + "vue", + "vue2", + "video", + "audio", + "voice", + "callkit", + "语音", + "视频", + "电话", + "通话" + ] +} diff --git a/TUICallKit/pages/globalCall/globalCall.js b/TUICallKit/pages/globalCall/globalCall.js new file mode 100644 index 0000000..6bcdc3f --- /dev/null +++ b/TUICallKit/pages/globalCall/globalCall.js @@ -0,0 +1,4 @@ +Page({ + data: {}, + onShow() {}, +}); diff --git a/TUICallKit/pages/globalCall/globalCall.json b/TUICallKit/pages/globalCall/globalCall.json new file mode 100644 index 0000000..4b341a7 --- /dev/null +++ b/TUICallKit/pages/globalCall/globalCall.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "TUICallKit": "../../TUICallKit/TUICallKit" + }, + "navigationStyle": "custom", + "disableScroll": true +} diff --git a/TUICallKit/pages/globalCall/globalCall.wxml b/TUICallKit/pages/globalCall/globalCall.wxml new file mode 100644 index 0000000..8c49932 --- /dev/null +++ b/TUICallKit/pages/globalCall/globalCall.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/TUICallKit/pages/globalCall/globalCall.wxss b/TUICallKit/pages/globalCall/globalCall.wxss new file mode 100644 index 0000000..e69de29 diff --git a/TUICallKit/static/audio-false.png b/TUICallKit/static/audio-false.png new file mode 100644 index 0000000000000000000000000000000000000000..15f5cf3b72fbf44c01a77b2163c1bdac09b99dc6 GIT binary patch literal 1285 zcmcJP{W}u~0LPaxSu<;?Oxmd}q4F~4B|?@lO>51%DBZE*DU_-o~gPPg=JS*cR@ z4!!*Hb?Ny_g?4#m;?4Uh<;;Ge_4|!YNEVqG1emMKN9wDFhye$;_jG9|UyOA=6eh*| zO7+_Eb$Wr2g(Ls~`k(+`A4>FVvAk=$)Di|Hv4NrSvVc`yQ&JS|n{jXPz^29PH~ekN z#7f-bXX3310%zgkF8wY8yUX7R;ZY%M!vNkB)8I%pHD{qu1o6V;HeDm1!S8=(b(>cG zl;4VPyOGM;xb;nx?S+4D`N>O@-ci&m3PD2lw`Rd9#{sv{*GhC7GuyRQX zKGQmt0CG$oV8g(oNYcJDJ9agZaKLJV;(W5dhL0G@2W_89pxD=Q?7IH}#e{yaf#1}` z-SLqI#fq>-h>~M%+*R98{&czuG+6iSqt&*1;@Mv7Q_-4-290j5n_Ete4;xF$G;6_= z?|0S+t8jDk?wD@p+NFN;oeklTVaU-FLUBcitNhX?P7@_#cM3GhG-v(szZwoD!j*;^GPN* zNzY(IEC^~L=&(o10izrO^|MTAmj`K~e=Z+4lC{NEv-%v`VLqSs77Kh>aUSP#5Mika zG$~`*#mVbTPwQLYZPhv^k8`p@a?QIIW>S-C@Z4!d;y|vfpqnc%oKO-PhK8@0`6Xvy z$fKpn)q3F({6%*7CG;O&o(yYR3-Dt9EwKYMkCF>_bQ`*`xBSScJhSMtYl9jL%e-Of zR?nj;U!@l%8Y<+XeV7J6RIDCQ8D{1fTwEYO1~A%FzXcV=%==IM~2Q%cG=eXGZ9h-TgsS~GAKA^>l21m=p#?_2a4wW9f=Psb%~vjb_g+s zX&U)8o>21J^}CI$E`}U#0VOsC-lS8L#v_wvn$hfiOfxqSQJ$tw%i?wzz?b9K+6!j?H& zZdu;Rjqg5up1OGJ)J0oj3VT^Uo?ZoXt6WKtUogX4IhNxuZeCjF=P7#fVb9O6J2oxu zE6+&{x6{|+?#=$dSkAz}-011z7?N>s&$a7)hYSQ*FBra@dhcfTvcWS%jm~Fv zi}$HV1ES#M9`n7bEIjr%n&LtnPye39@1mSx6?;U~n8 zo-43hl3*eKWcFc69?hv@4|aIAN?VAfUf`G5)*7O*E#bsz&F77Y%2Uk}KFBm5-!_NjN*8DQ+D@&N#%g;wPxz;gEQx){R#WCxHc*~!L{W>nvj!hbl(vBV( z_xvu*S@xF2_vP}r3+AxBW#K)MtA1kbok!EZ{#wMZwf`cwM)SR>Q(Ns;{BhG)J}9wl z|F4C=PD`w7+ST**!}56H`kvB@f7f4o6(!xWP^0JIuIWZMPQSSDtgDQFS=)-M|NozV z)@VB=)Yd$E+Ro3Hk`#{LIdW&cbLX*4vEA=}y!m2nq?BdFU%&U=DZ?i-U%p7p_;Bm> zK~AyT8xA}4o0~0|y0ySNDo5G+-k;{T2@AF|2u*wag8lS*1@p7XDV8c?#(#^ya6Ouy z)jxH|Q-%A9skZw=cFvaA;9aJfyYa@t#@(E+e(cLhKK0XOjfsTFyB{X&_8dAAYdJk? zn(Q&HR_$DOm)G+?_li9wp-Oufw-_T_C_~?E>Bs?T&hVlbf zNe3mBut@$4|JJpxS z`ab`);1y?(x9O{6{R)z`!Oyc4wz7Py6mXcrp6Gw+e})Tt(1i}yFCJbd7dz&8Uepx3 zD6F~IRk?~=n`hqh{5E5K9=2aS)51ifM@+wZzX`RR*@W!04)p$Y!ij6ANgcwW8c zd3A-?wJPtcK7W3H%ed3_-Yn|I$623lPn0|&=$GToRkVFaYIo6GYZi~&Q$zl`sBEjf zDP3^F#A)A~5A{nr4UbN%`k7ItD}T1>$>RC{U0=y^h-+T}W?KeNS3j3^P6_~p-GO~G|L-|Q8* zz`6JD(U~b$_uUKxa-RpY&)O{CsPgH&tf?`lTG2Jf;+{munwnta_=A(K#@sOe_<`-- z5wlBW+@59X9;eUBmGF%s_<%#Qa)y~h=nc-w4J`nXW5I1AD_MHy}Z-Te&?n7Te{_s zORhZsEG}ZO;jebrfrUmDCw6q~vk{-6p_Qw;#r=7a_}gB&sXIR;_{$22-u@gJ*zU@~ z-1Rn)i_J+$Zt zsCl^2m3QBY&$BPhYUQ+-a%~<$%PXww&Gc=SXozVBFX{LyuqdR(Cy;N! zHJfr%f03>RO)bVJv)EOGMK-vaHq3tJcu;iXcE0jk=h@3|L{E?ExK)^-=ymg9?2Dfd zzIE`YRe0wayr@*)&cSxl&vECx`&r!|zU}Y~{XgICN|)xR&g4T6GUdEey7-P9bYG($ z5OcA!c*^T}(Q%I_ChuI-vSZGS_o0=?L|dCkGo&%#iZvu zce{tO@t-SkTwGISr68#~>sTYZvD?L!MGrbHQ@1S0@+x^^5t3N2A?SI)(c1@4U33<` z!JaM2bCpGM!&>8-#aTbD&HkPC=zo6yuG}Aei(B8W)3l#w$ZXy${8)X4C@>!}c)I$ztaD0e0suUF B9OnQ4 literal 0 HcmV?d00001 diff --git a/TUICallKit/static/camera-true.png b/TUICallKit/static/camera-true.png new file mode 100644 index 0000000000000000000000000000000000000000..7abf24280c0152da51d53a997bf9d717e5a23f0b GIT binary patch literal 974 zcmeAS@N?(olHy`uVBq!ia0vp^86eET3?#J*0)=sh)`qW&uS8UU}-y8Sg%P-hSXrTyfvg z;){VmH_4O)`2{n0zm;Qoe)H1FW9xcE@BjR|W7Fck@|@IgJAEx~k+l~uGcYh+^mK6y z$+)-WdS~8h1A*3u8xQYGxnJFI!OZ)zN$vmbyNi~FX*`)_c;i0vhr<;r+>cIgdtD;d zzEh?@Rqoj4lD%h7Z2PM-B7;@}~cK@npHRl$%RJ7t7b}oQVo| z0_>F<7CKDW8Q3H@NpR-JX~JKOBCFiy3oqVY;gaK&#Gtt&IXYnhYj%x(FppX7Lcd5B z?nP^gd6^;vd#tQ1bxv+ws?%WVxa?*#hnVaCyBzsktCz{yZf{8CuJSry^|9ok%9_c_ zSs#-u1h)5Qa;i^Td(ij6ktc-}oHCwUq@U+~X0i|tILyYEE45I7uXUDiQK^^UoUS@+ z>koIj*~>rt`Ny~<;pZ;9wsr9do-f;NF zsBM3~`kb6qerc#d$XDr-Z!TLdm91mF92y-}8Y@tGFswXQOh`)9KE%;kDD^_7{W_by z@_g@?Z~Du1;bca((5iDkir4u#MMp`u=&_r~=&>y{UHT`WlU>z*%B3FJT@IGh! zr#y|ERU00!mE0v8I!khrNm`pS-B&)<+p1OB85ZxFXTf#GoO>MY}xN@y`Fc zsqAe&EtB@lia8MU9*UCwwk@({bcp)nNE96&RjLU zWOVkzsRLWSD>PPaa8!H7Ju4;6?rNk}noo(6so{^T$Sr{l965Pe#ZYnkJ$I%5 z#gAksryE^k%>Wfo6%eY>0To?!_||G z@(rzL8Qs`;qJhhCMMOK-stqrCxrG1A_dnyUsdc&W)2Y&ahNE1;A#tuE$-IvpuVWY{ w{80+s?~wFw<91_(`?VL2#B5M)>#t+{Iep2!yeKUWU?yPjboFyt=akR{0CtM%Q2+n{ literal 0 HcmV?d00001 diff --git a/TUICallKit/static/default_avatar.png b/TUICallKit/static/default_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..0e2222d209d847a746d7fb3aaef6e7e14a8cff4a GIT binary patch literal 1727 zcmV;w20;0VP)fG_|M2$zQl0)c;$d|2>iaDTV(SeE;6;|B%1` zOqu^JhyTpt|8lPXx7Po!(f^~$|7WQGVx|9!z5i^h|ADvvd9(kS#s8+v|D4DF69nSa z000HvNkl37E6a~<|8xsg2X_%)1MTH_Lg^K?Fzg_7nPJ%jMrw=|zUe7$( z3ig={&+|Ob^E}V_8q7Vp{|{}bbz!VaZ3EZBI&0Yox`!srH3Aq58q7`LTCtP` zEG&v`!?9;-Jy_^bdxl%Bdg*;jOjYnkZ4C=eYHx5WWKO|~l5!1onaf}$E2D>77v^4J z<(0V$+!`=9hLy3DY-s=24ea68;;$Q6z^wywBUl+psf%BjOJF6D(xB`8H4gOP)`?ml z7W&jqaI00XG}(yBg__qDv3*tSyfxIQl@oNu)B|{}6$r*<2I5#52x3@>rGx?CqfSAv zruG5XI(6=omY~*Lr6|6~k{Cdp4#`B$B?LS$_ZYxX@W|W)-0M+W!O)6QGNJ3$oMGrp zO~RXr8g0Vz2)J)fUmt>dJOaRnZ9=*c6vnQHb_d(B>>Lu5GnzOs`h6^DKJ#DKE-~m( zN>@&6(W*zX5L1m6vU2opGuY1{#e2QC67P^=OD$>RhIT?t(8Ir!+737DsHKqOU;B2p zoHz_b0kkjPcM}7_5H^zl8I}o?|Npm1Wnu(IGBzn$VM>TV5?i!~~x#mEgv z9*%+BL)C9rL#jFU6uGAvm6$ytmy%2p9l1`m$q-$#3GhFt@;dgV8#g;hBIE*#1grqL zNU{fTGP}Fbh)Y{YI=5RK!$RlM0ze?u7WB^;%qzbi$VhpSW(8*CQh_@HvmzN;9++@S zC#E47@9s?jJ|9OS)1d>$i~vYf5EU?S%t&pGK4^Ao05T4Jp9^s+${ruH2%n_<3N3OX zTog&TgEC|A$-aX!ZSYA~i4bu-l=7th1Ft#+Lv`vqD%7Y;foHO{p^wS zSgALi47TmjsJ$IbQrXJ6C464lWFY@%P|nSe^LeQuhEuk(XVki=q|xyvZ!gi3~fEHXMvRaOlM&rH(UC zuWO6$NSi#g3<#`=>=<8Sn`jNL-qzOW9<24qfY_XfVjRS*^2K`)KfWS{W(W~BQ;#DT zjtctY?&mU0%?#z9mc$D{8v|ncYV6YOY3mRdbj=y@1CW&(rNPq|x~*gzpj?*Pl=FbI ziAHzbicq5O)9uVs9c8liCgHd9uq4Ly-(!gN#&jF5X+W&EA6rypnfPQ{RPgfFkA66U z9Ya80%zcOWdg4Qj>+fR-^rzIcxoG<{ZI{F{e8@;-x)iL4$keDwPM^PEpWR9w{1*~) zpZ8sGgb6jr3329eFs(e$_(0``b4~`&r>3|e3c|O9s#sK>P`BR=6b%}^>&8UwAys45 zDF(T_9tz&55o;Xt9vrG_SM#2X-M>WwCjet?9jdNXd%AK`h+sD|SKoQ61x}dIH)UNBRv8g~Ggk@pq^OyW33{ZS=>EVYKQAnhS6zDu4>00;m8gfD{3?tvi$Fo{FL-7IGw0;_`ZxyR--0$=zv3RN8(&_a5*6r}m z>+FQlw|UL5;PLmr=HRj5)|=VLZ_BFF?C!ba+=|n@TEm+luyp0}`jXbdPrsB%y^lM% zhc>r@#OLH@$E0AzpQ78%LAr{z;@f}FwaV$}Rl%48h-aMu001j=QchC<=pL^$>~NhIG1Jbts$wcNCq!CW$4+HFy&Y*beB zSV(@gvO(dHs>N*xvE#Miv&k*nkYJZx3Q!|fgtTI;L4jyhSD?sBwMC|FueYI4dwrWs zYE~>LW>uPGN-|b}28CFXOh_hdXksS}giy1fkyRtTwzAMHyG8mm6B%fiNoX6*_17@s zb)9r@-oThQ4k`D_ff3IV7b~M8Jv-lJM3-;HA(rm19Xz* z(0oESfXA{lmo!2vJ=XxpA+&O@qB{WQ9tLj^YH#Q->JT*edbD$V1?}oIQ}Z>1jLwGa zm!mE;d)=g25)g9IXAh2+pjm=u*vde}G2_mlS!Ro#=Rw3Vn=l+eGmoBCgNQpem{K4z*h}tqLLj z0epjgRhqT}K}Rf@99p3%4G8iNU?2K5)Eve62e1eIVl=4;Q9I1fHMA?z1Q)`NSx`CT z5?6+>GZs`1mFZE+hOqZ6s2s9W5<4;Og!wvyel;c68F$Rr2j~~4F&pA8nZM7_&ZY+& zkZ{d{%b^Xv6A;&B{&t}o-xaJv#%^#qv`W9V@{n=Le0}UdyL^jJ!{UzpfBzi}a24FC z`p;yCH!va14@AYCvp)>?doaSIpHdk}xnWQ3eTE^K6cKGg(gB-x+=Vfl{8CBW5u4OM zhe34}*TVa3!qEU`@KL-5NtY83&l8xnMnubyG~!Fp8yL3Cm!cB(_<4|NHjx8ad@dgL zV46cNq@4?IB;~nOg|zOFJ-CHwRZ2kK5#Pm_mY_1E@s0f#m{z7ZGsFxT0NLkA`hy3We-kZjz@8*G8#{2{Vt4&QyI#<=hxiElqmsadLPDf!2qTt zs0wBHTyPIls^mhUL-yc13~|YUI($X6+l3hpkqw1*4DT&%ez>bf=YT!9f(gs~cwG&? zp!n8>0c+~NdpkAyBueuuCRI8gO|Gl!{E|-tny2K^57;n%F>K`s6y z`qYJ9o}RB)`Gv=+<_OaCiwo5*Ohw@G*KL&Q9nOy6^EH&nxA+TBY7P2q?90;#dbgic zUFEFuSI$(sWRFfqQ=#qm)$MsI{G~tT-m^y^u6gd<4^?iQH~4Fp>Rqr$A8+wX@9vOI zIEO4-Zyk>v#$EI<_`1uc46h(5PGdEw#2-c6;qj0?b#M(iwaJ&iH5lzNe~OkGc8VUA zp+jev&9*mygfek1q=-ZyzgTi*KSANdBlyyTsG^a2Je?10wjGFyNq>gL$wY7gK@FO+ z0!=!5Y_@#}S)plF=rTHGvzHAX>uh zkWG?bR9M^ehYB>h?6X;RJ6KFbpeTTx!55W_ib6Ah;&S^6C$yNN!Wf)<8hyw7>?HY0 zK$v_Q-D7?U!QwFTZu^WA{&vwyik9b*H`rnFAI{b2Sst`I-(|i|F|Vvti7I)ciy`xI zi#cVsXods~xZ!yuP*y1+U#3mo)ghbGKj~pkubVVe9cG;GO)Q1Zx|mx%ETsy2mlwZ> zbN}eBhxxq;Rk6tK;AVt{SkB8Y*BSkSsnIW48`_$wmh-QaZH|87?C6&+kACs^$d~Vr zeglQ*x3GwQ6Orh*afyB-o#?kRiheVx=(qEVenYkBx3r6XQ^6O|)-n2xHKX6!^aV7R zjedLI=r>q?0WGe7+VY^8w?%&bw|Rd#jrM;^#tP7&5KEFN&58xZtV)wi+Fox%q4xSV znbxYVK#`SdivrPz6(Ow{YfymPvJDA#*`=VRYH=Gv?079j;jmFz&0`_?)yf8iO3RIT z8O$Z)#oQK!QEIcEUR$>DEPHt^UEd5#-aN~3tBG>lE48gcK9|cEtaizZmlIXjA@zO$ X0+|69)Fq$b00000NkvXXu0mjfTr4g< literal 0 HcmV?d00001 diff --git a/TUICallKit/static/hangup.png b/TUICallKit/static/hangup.png new file mode 100644 index 0000000000000000000000000000000000000000..2bf0adc28f86f99941182f75f77aa1874a74cf79 GIT binary patch literal 1262 zcmVC0002PP)t-s0002{ zSzh~CU;9{I`&eK4Szr5EUiw&G`&nQ6T44HFVEB zUi(;H`&nN4SYP^CU;9~K`&nQ7Szh~CU;9~K{8?c9SYP~GUi(^K`&?l9SYrQOXa8Ve z`dD82SYH4C|Ni*+{_^wv&(ZsTg!*D=`;?gbjgk9^jQVMB{`~y>vb6lJu>6{y{JFdO zZ*=-xV*T3N{ngg}$I1P^!2GDI{_E@h<>vn1;rybd`*nIk>fhi1001R)QchC z)5fWVLN^=?1_U44`}yw3HU8_o^l2p}n z#V|Y8fVg<*sd5EZRb;jIKxwiwrd~v#qHbnvN{7{yz(i_Vl(>BB1rfZo@|2{fIwGq- zQBoci#G*V>5;8JklQVR$Yy)>`Wa%Ecb{Tgnw{sL*Uqb@4e%$d@Bt*@{+P;j$$T5=8 zm5?B*OA)C^m`YLD1`=o35h_Jk$IIq^9u9u>TrTR13|4 ztsqs3O~DML%!v2>;q^u8f`e{A|486Ky4g%Q8C=LYt^r_=K_A@ouP#6XH`=u&w82rE zE@aE#sGKFg2DoaFPX?T2=$s7BWIFQ*?#^$n3b<3w?*9C2|=24VoMN2vc=SZzYt6aW72Orgwaoz!6JkyJ`hn40`*RZae-73 zM-l(Aq=Fc{@5$Hlb#>gkv*FNn_p8_Kd@=G6RfTAPh`i};vv;m@*Yl}|CVVbfbTf3=xZCL`m~_Zwoqg*%QMmIDFfhqr8h&xSc+-c?{A)3uj;52z zc(;8$T&`w4K`4XeJp49yeba3gA6LTpzV@%^Fh&R^ya~Md`Omrm8S@tFS+qycNkbs- z{rvA&dw7U%U z0ikxz6=U2``o)}`BW+_1K!Evllmw~fg=2Jxl{)Ki}i zq;jufB3Z0H$r}EcA4@8P-fI=MBH2lQl(vT1+?%4JA5~?kf8+Y)Sw5}<{o7>^g$cYg zgBPdp@*Livz_)1NO)7Ys4&JE5w`zlgAd>yG>)`_n_{au7w1SWA@PkYE=oUY`hL7*x z-P=J403ZOszzUYIe?>tP_>dbe$IcH7eBtmD3*UJB$mCZpKC}6q&kv1$>GV@8-+KMn z?ALBTxBI={0|!q$0?5TP9}k^8^$K7&&;0`6F+e^8==HGQF)tdM{eA_X3-mjH-(T?m Y1sYUFjB@q@e*gdg07*qoM6N<$g8n9dZ~y=R literal 0 HcmV?d00001 diff --git a/TUICallKit/static/loading.png b/TUICallKit/static/loading.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe6f40cc202e5ec915fc0b3473b94f19e522876 GIT binary patch literal 1367 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBHU{{FxB}__Lkeu4Q8WkWXsePS zzhDL~X~m2PHQ_uz7ydX;vHcs3&Q5DcW(&5zysK5K(`|o-R&1_kU|^BtG^vZ0UwTNSdewU46!15^^cesDfF^m@Z;iB@6neCfX?wZ&~ zjFyj5SDtq<%SdQWYiwj*#M)plT$z4to8ASz3FV?JpVHj-toZPEV&WC|8eg8CYKL{3 zIS&bKO-lK+p!I#PW8p5N#b&9JIHjzZ0kSZ$v>J8hlyGIs6L`*IhRE+4*g+qq9t zBX8M+?I&X<@;HUPTkE<`f_i|_4;3~h}l4Z{W<*ySAIU7zM4Zg^JD>`K+0KLJc{eUvT>I<-M7t^yQ>k?Y9`CTFqHXCTX{;A z;7pCe3$FI{Lz8tGvE7W&1?Jhkt50Vm(s56J7)2{C1Ohc;N7&Uw@|`U*`V7LFZ($0>7M|$?j{$zL&jPrk`G>8`~Cj zQGRiI#nnt(0o%#-Rc6YLm-4q;2im{6kX#(bx?WDeOC)s8pL1)Un0Py0VLY{iN570<{v*PXKh`FMVvWEVY>wT~;L;AdsAo#XSfS-YmIB$|D;+FE4MLRPl%GU60 zd!#${t8Q!D_Apzfduw;FzIQ(p6#MAn{9cyxnoUGO{sK&To2~!X&C|bm#BT2AXHz;eJZ5fr^y{yw zzopr0C6hiIsgCw literal 0 HcmV?d00001 diff --git a/TUICallKit/static/phone_dialing.mp3 b/TUICallKit/static/phone_dialing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f392528b74f642871a5114f38577b39b8547db9d GIT binary patch literal 9178 zcmai)c{o&m^v6Fl_s*EH)L`t}*oOu~O!$&rh?`ob&mNqwQJ|8$4-XIY_bT*f z<& zF(WX!THtBS%r{xEuYbbezRoWxx%qL}0^?BN**9XKyB-ic@6mC|6!2;@;?iq_e97e@ z^RDOhE}plT@%t7i-fB!XgV&cXze12XWVrxA29*#*ioZ`o+%6sC5TW013_({SfGrJt za7h#paIN6l?2N~&^+U*ipP!3MHLdUTekwlEERPYK%w75iyZ*Paxr$}VC^Cs(W?&o= ze5IWZrb!^CP{SGb5P+f{vNe$Gi4QowbcIP;_X&hH-@8*oQQf;}0hq7z0ut2)yYw|89I9d9h@H?AX_m zYZ;Wf?vQk1wE;&#@PXUje1eM~3R>pRP$~xcXRNju_cpB9gYUji2TZ&#)T?a<$kA{( zg*Ck6!=L)axm{6tUkt)7WLpX|?%B1X4=>HL<1R^%1#3$ci4RJn-U~d5>rq9oV;m|J zt4as!NO)*g+ZKr9;rTC4W04Ys4V-R4?w8B793FP#XkvB`JKdkPTO*W9I58%NUCY0> z06SzW(O7Fxj;$O%QAq>nzoWoy20kPqnAnHs@4#;J$WFXHlS)#zztyc)J*Lto-ilsa z&T8VgZnu`qu$T1A_aVk%HyXT7T$K5Soov>z4m+DF&DpoJ@#I@5MNFWsJ|0~+H}nTo(MYx zeT5&ry?e#sOE(*sG%<0U=ewnuTh(lM=!1wHyYBJ8qy61s9B*suiGP=eE@Vrt_=knB z>@+0FLw+%{8V-Qu43PQd+iOWexYXq6-Lvf;UA=+%ei*^(Scya*YYh$LOwVYFk1QNm zJLmTcz5eoLGiHwsl&GKqc1EN2XjlT#RN%HWN-!Q>61e-7vy(1#nQ_U}~5zmTo2E z@Yiy6y0U5AP0J)Boh6L39|AWlAFJU*p&D&hjAQ=tUFq^eUDvjZgEqb<8)P}%Y3yoy zO-U0kiQy|*>lAR&NcDO3&*k&${A4pnmVZpWDaSa+U{aShY=#ep*eq879>53n|A{?u zHdeD^L^)1SVB_3?RGQYzy3IDXW0enOa*>9b7tGkrV=(Pnu$vaVjLbEs>w9l z87~HPTeHD2XJsu5^ghJ;X7s(ub#8GV=o`h8jb3-@M{h@v=g4HWo#l*UdV9?tX^$`b zUT^HyPhKk==yAI?><{gWuF+)!xeiwW_p!vf> z%GhaBBNs&faShO1^Yi(?4v39VL)bue(| z3!9d@HEx|LByC2}?3Iy3h=4sD)n^8<>w2;_18X4SmgjMz!8J zlXHp;KQ|1}olG!vX3DuSJplK9^!2bT)62Tya$xG{&DKtKmQhIWvy(VVfB2U zc+RrU+xE{!B4!>>k!i2irIgcFFWz9BO4wLk&Di`M4VuRMgX$_sca-kGB~uvr*1UOt z?M;h2T0)tZ%%0<>w0e~0k^VUU3n$10?^3=9U7fK{Muvx@R4`5z;mUnkV5aI5(~H(+ z&;bLXm{sz#@-ZDZrmObq5WRC{Vs>{~y?=ba6LryiP8jOOdkUt!D#ibd8M6-#Q$2#Jfn?jgKlViv9 z!0n66>1P^|lXOpkJms4DH+$8?ZRG2qv)U=os_kEEn+t5gIDrB=&92}>4j_-}jSQ96FeM=m+7&(L>_cviDpNV_Bj z<2Vo)|Lh+l#Hd2k_!$q9?WWHcOoH;nC@MDyyx4D6(oVUz<1@S?j!vAAml9JuSIoz? zLEYR#AO)EllwZ4UMnNQE5aU=A9=iuHB;Ke%y~(#ZxL7N+8`@X;`VZCm6KlNiB4e#W znU79Z3jYZDL1!VMIJDoT<=o`xamTi4mZ5u zMTom!?|8xWMem?q=a3&5hXv*7aXN(XG^ov>&I4=$6Vh7;K-9VSFZ%ob4ZMAE;bh+- zDhXUHT+WfaK0W^+lB^}2vTyJq?SK!i%`Jbc-D%es7{?rHlS^TcPXHL{_kn2Z!T(p1cBjaiAIg+R=c1D%=X7F55? zKLRh<{Qyh|6XvgD_H2go*2FNVL{a=Kegx&Iv1$?V-b)@z4+vjh8Kcst!z0weH}U zVI#R?Vda8N70-~lkX_>QB7CV6OyD}Z(;}iYL!eQP4u1i$IOBPO8V@#Pp!OS6GdU z=a0201da^TpI8>RL`uJYbVn)^vxkeui_;C7{_nl0tFt>pR(q8W&>3qc2V9-;C8Fmo zw?T286Lv5ARa;Kg+70BS_&3@#Nw?Y(&7Zg4+KM`A z+UJsG@0IZD`Txqw>wWbtF7CFL7CwC?*b)lU?mJ_STF;t*c}U<;ap{k%lCnop@M%oWXUl$>MfJkg1DVr=3vBm&YDxm2}(N=^`dQNJ!F zySq?Csv0^xyfMyULXO@M2HcIqcjIR)fjxeY4F8;*b=LUnMMY|4lgw&~USmO}le&VH z$lvXI_f~N#C_o78YtuC<3b*)ZtWC=Z|}1x|kod~NE%>aTTFuVcQYGoPN#N1!`K;QPdXtxv zwH1^a7QK&PoM8Bnj&Fw&x=z`wL;z-Cjco-IobZMCCgVphpKiK+g({((;!s<>?Aq^2 zQePb+VOB3J_&SAsrsgTKfJ|ycyxLWPaYEsAJ>PC6A`J?{zrp;x+59~}jeS2rL15;I z747_=u;wG{jyRq_<8t)W`?3UW+28qvOUKA?Yu~zkU-llqcI8o5_J5pN&jbbzPllPS z^crvpHok?Q6BgQ*Q8MoGO0Bb&N|6oQ8RecH+^tSb&Nx-sEV18gGMi4g-M{lJkmfnF zT5BjM$2JgR>v?db@HFCY-%79wRy+6lU~s75^E7H!uf)ih;I2D!?t=@pphtVh8PbSw zZ9x(tN9F#S;NC&?wD4heWS;J8EzF)>aIah#1L#5cKbtC>jNz8hG(`8`)}>c-0}jdo z&7VUHXf+z{2LyW8mt07bJ*`r@+A+6-lOD83O17=e@4GJ524Svn2!{Im7!s4JP$4VT z5`8aoLtrZqdo_9fmwZ-*yohSGp+c0@DUnJ-$BmR0Q?s}&zFAJo0SWt%W}lSn$ijxT zhFHJh??aH+i#dViGv)Lb4hc>^h6h3kAJ+zHm9-u{Oca;T4;XoxWnBFJO*%tpc;d8OW;d8 zy0fr2>XYYJPu`v<&bNXyh2*RKa%q9Rj#T!caAFi%j?ky8?8dlU+;s3{B>+Pg!l4($)K{2YUu(8MsN+zB+ zb+7%Zs7S!zE!vupSCbsqy0}40|CW)g&E7S;g651~NlCbV*h3+6+Ca;y|NQK;2F)L5 z2nsS7#NI1JXGp1+zWKhJa(wggfM%}l81r{dut7R3NZB!Etr4Tv(GYU~Rf;u#nsUCO zjH0Kb$i+C`u%$cd=X(NZ9UKKDIEm4);hs1$$3ud1lmZ4H()+BV8|$yQj}WJLtnT?J>~?Ns0?+p66xS2tO&jhc~Y9fmzv^h(gFtU z-&YWI@6yvVs3Gmt2nh}C_Mq}>;&;4?vQKW$RJ;+>w%>on&pvRQ36DV%5{0;mUpRn| z&k-a-0QYmtuPNll(j#hq)kxEOrv?~1;4R`SgL zF0T#I#)o9CBxM)nPPn(+#r)#|PwD-ahuu!2nEnu4>)pcK_e#ct7yhcm zw;R>@)6W5gm}t1|;*Z~-9v&4v|Hy{iwWqJ}hbb30)3VhIbN!IYwaXRKLTU}faglR8 zMUrER(}|@|VVFHm1hcC=hP=wrm>^bB8JdUkk!Hh>9=S`e-gap&>dO4JVwKj+{%VY4N1*6OFmQnc$ipBN;CyMKsRGo!k+rns zp$J^hW_n^^=Xaa?Ax>uvJlujb%M_o^Bb_|t0P>(h;YUXq3DODybeuFE z$}vc!flEZ==NX^hg%K7f=9Ap$Uo-JY^-B>mm%qyo0*Bu0;eDj_r^*-7IJSLfO3^Vd ziAu`NIE!)23DWv;3}8=)>18EaqIsBU>{2r2Ip#A`#C@2zhA|pv>mb|n{hj+P&6Czt zH(Vq|>FU`AwuCPu_j28GJSFa=1YjIvxI=Cq16+ro^uzf8AFDR_P_tiswUB!|T}6Lp zo~_w=tv~9c+GEq2GFQQ9=_0R(v2x?}e4_A)GZ$LtZpTrDsC5{J1^-6%hkjob&o#&g zsE!#Q1JM%0cTp7tVA$ zM3yT)nd7)2{e626AT-Z2^QTH)^-;AI2W#0f8QTvJc9IsQ`E5tjqVs&=VN-S_#?gms z+z-+Ty9j99SM;#;tD%D4{)JJxx@=Kb)KuH?SKLY!WtA^VNer{JjKCzh&!=kLSn166 zXqr6X%i(I*8*Lbe33K&h&~-t8_$u!>=$v9T1A_$jL{E7I*W)Q`R61VdKHhcCXlQ_8 z;9BVBRDJD?xqtD^+OL-$r&>aMAg$!=H~F7EQ)~C763{t!LiaAJ^B@gN{v8yO6}m-^ zQx-PTQf53l79Mh4O(cGwacl7MYrfUJCjmdUrU!Ni)?8slqM^Y!Is|zoZw44f`&EPX zCRCsC@2({wZx8VhWWh~FA#^#3{>E#6^0-dXlJty~%AHB;9!a(^tuf_<=j9Z~edR?{ z(PWIHNf7=AtzXfoj_KxbK@P2`&?}m>(NcQ;`lf%cFD!4N68jep=6UV(17fn)nom=& zJIob~eU8(md=KBK=<;B51nV`%QH3kr1L)*8*!(_-=?{H}N-u!;G{NaZYmkTg5#$4f zG*)LnbjXXt(vA&Y7;teEDbPF4`y>-s@t)pnGw063ILh#lei#GiK!_PK$WKS}XJE}q z!AcSnwCQ)OQ|S8#d4cY#;VXg!U1~q%3Q{lghe+L|@{$Dk2!pC4e&^*bWizop%3py% zbKglP+KHjMahn7FrAg2TjUS{OWWej%X^5!)&N`~nx^&^f8-syELUP#=GHL+@5C1q1 zov${|~63iw2=Fa7h!y?vl(fO;mNfi>|@a%uE7HvNG1Q4!1@Q8*o4Us&Hl z(kfq?{^39TW>p8{_^62dg%8V4T(P(3;&VefR_(eJ@+Q{}V>xy=YRX$BkgY zzKwNiTbG}NJ?+?T%m#o%C}z8xAlJ~qsbyuN;cu82h97*L!Z<>3JzC%4M>we0pz}An zzoBpHyZr93m(cLm7mYijh@nXvZuEPGakZV?9Z-dgs?795^>QKovQfW;QWaX@=^;@V zhYY97q5C9s2x?O4!}RAd1s`21z#mnsXZolx@3=Q;`|ox;U0=?;aQ7K!S5!QJHYFT9 zJ-x*HZp2LC9CFTI$9VJbN<6x>rP{rV*&N+Wab zZ;&IziT_F?04}r8&a30{a_d6t@=Xc3fS2797>5WO>YrTcqa0Z2B=C}W@Z*7avW$z} zon)P-*Tm{nLo8JAgz`^UI~|@|8HJio=((>$mUzgV4sCM1xX<9_vD^DFjv$<=@6!R{ zVKnZks4L;%veP?^GOd&b*b+21#YU+s-pOYZV{KOpcsk{iEp1f`o}(MNynK9CcvemR z)scs^^p*NWf^+naGYGqtA+8j9j2w#>{v8wtZS$E>6;0iGk)|TG=7Wc$^`{C>-LANs zg~~m6)RoPvD_i~EE6+&_$=9*o$*#m5^^ZQSg>;Tg)rZ=z6bUym`B|?W&)Gyyd4z6-oGEhUNK{^)3K=sQb~;eR+uX-`w;? ze>qU_Q6gjE#&au9Tu5rq@EdY@g9l~n_0&5-078y$)?3PKjK1nNe0{iBen-6RrImhO z5VloFF@sA8P?_#658#A{-{=cC8xkASlmV6!W#z| zgh^UVFY!wxnunzkT1ys78ZPUvKXW?p*(GFadB1Z)(q3s<^jiQloL%J}WTB%Kt^H)= zwp0_Yd`p%U3F8RChUk8RoGK0C7+~`|5%1S96SeKY(CrrM;+^efjizQwvg!vMwro!b zjf&7XzD!X^=Cp;$;%5!>6h<%cO%La-oL{Vh`3eUZAQXaV257zTg>OQdDiQ-DfupXM z?^D*)o^t)DEux<&O*E%)T-97Qjl7CnI3)b$w(U^=I|*M|n%TLrGRz(dJhcT~U%OPH zCRP>)t%K>Gice}?&b|?otQWK+N?+{Oq>EzD@{2sGGQY64T1h+d7kd2s@k6@))v2vX zaZk$VJ6CjGgupiE03k9B?Gv70x?v-(nd?BYgQOKtK(kEqMWiypd+G100t?!)@%2{H ztN5Kk6i@Uk5I>M5btz%wui3Xs%pM}lHb2yj)1adJb+xm=9#*I1$=dC*@~6IZIOiyN zZc}28$}#y6r2dBOj$-9Rm}D|;br(ybZ*5zW1=%XXq_7jS(VPJgXm9eD5^4s=}j;^PJsVSYC*2(^z9&Wyuq#=p3ZfaxRVy^AjkIWGG6#tRTF%K5zA2M8T!eS6;vJfrU2Y^&9?R{i@ z8Jr0#i`jx2@ScS>gHmQp-58Imp)ozb)TZoogg(fbGMSj`Fts?;$Z zgEhpUbSDRZ`dL?Al6@{96dzlE_kod8@W7IML6uuR`%j?BuJWD4rB?KemYJ%PbmaWD z%W7v2#Id#1HvX4C6ixJd1@G`sH+pVPYJ+vIUTJ+cz6@37h!u`*f?e}EQyKkX7v9HM zuj3(`pY14*vu&!gETVI?nKD~;k60jxE5;FrgvDt84{{#L<@4Wy3 literal 0 HcmV?d00001 diff --git a/TUICallKit/static/phone_ringing.mp3 b/TUICallKit/static/phone_ringing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..c3838f3323254eb5543dfe05e57a2c2a4a241ade GIT binary patch literal 8752 zcmXY12|SeR+kW1eF*6v(GPWY4DA^jJD4DSo+NcO^$Wl?3R63n%UIqz;a$22Cq#QZX za!wsBGiZ|*r)d3mY<4Mp4Mj{XMVq_4^Gk&0KTM{a*KVU-wh~K2CIm{}2m;mU}P4 z7c~5E4Dt?Giodh*!*k2}O)&}Ef@lQJVF@7m(4EY0ADq-dA#xweq(9H@dJqoIy9I@Yy6P(V3sc6Cs1i#_e~r5uwnW zdF>*Jgz4RqNdi=H-=du^FaAmN*T4IRNyycnanh|v{ACk=5-#u9tI|}v1G{TYj8A*@ zu4eZuuAaZM5MobND-DQ#sRxBm<2G*~npgtF(P|Hid`}WIQ~jwNhDhW}#4rXjQ0}4L zB_%_aA2g(T8~-s})i+1h|M}ImAcIQD#UMX-UexMcb|1fg5qq)!4W(_n_VmQvMX4dM zYGU;Lz=ur~KAo#br!`7wY{Wrs5dsS$ZBX5kVH|-R2}}7`gjg<*`MINOe)&9#PDW1* zegi|UHH~q!Y{M%V|4Uv>%MITnyd!LJ;F(CWXYDNB@i=Ozb@H|w9>vT^R7l}7@|%+w z3+YT_q{VkzCh$gSx7F>~93+^L7J~+|8C#0c?;H8FW4BGF5i72?o-22jlvbP#)1gnQ z6+isFI7huK@Q7*f$~GhMhM`LBMWed+E>76;m$~iWzURv^z7H#35lQ!#&~=cO)J+s2 zLd0#&sT@lYazx!}X$%IRzwDtXX3mtW@fDVKu1@P4PwD^lT3D9)+&(0f@#_t06757| zmf!LVP}XBjcv1Lz2b$N?n`nfNv8H_bA-*?31hMSw7$Uxa?7kntW;6UTG;*kvUfB?@x%sm0RAN*+mi+H-*n` zFNu`SOmZ;WbQ6>wIa5CEdTwtH#fy-I;3#Zp@%x9W|0J$r32IF1G)9{I=}GRB2_jU> znvo$ASQA!cT{bhf)*DT79(fOMrgnMx&sR5H_}2W7yFdCO5K*vn?Sv3z&{1tQVfssW;Cj7NvC}j;3^aq;Uj6_^3HF;QH96#fT!=43maW zB7kNO5kYVNg{xk@M0j=5Wl>m->w%r22EO0+fHDT5D1p8hT0fhfIY6J1$3K^lpY>_2 zF``lU0xd-(v8W)@n5_}vznx9hUtQpn9l^K3`21|I&@0%2<*x_!7T;iotM z%5_hyKlN7l>3vlnCuFI`JDykLcOiv8??Az7+G5=<#Ma`QY_+r?2s@U;R3zeClK+NA zkc^v6{X1!OD`c>Cy77y0DWX}(AL?#}{yEm~ijCc0@uRm-yHj8BO$S82tF|AHeb#0g zCOhMVe%sUb?KOqJKuZurEMa@IIUJF?fa8S-lImYRe=7P-hs&+@h=I?E2tJUeYTdckQ6IY%uEAg-RmUy|9p zm00ZGh3hY$9>M1mX;O7-RvsVOqFBGc3`R#xFT>iM$!J*ZAcm!f$xuzTBc}d~dp~{r zSmq^lYfWF53PUYTYSsoT&+5>2I!4o5_ulw(-H{p97uXd33eAF4qN%Wh&F09%MDCFU z5zVqYmw^OMWcf>6AAN+FCk@YupEf=Yh^r^qNIlbW8o*X~YOj%&LY zRFi<%!Cs!NQEc6rG|r5;uNE^Y{1DCNETXBVj?LB}0bwN&iRz?%zDFHIoy;pMmdhB*}np9%p*h-U$YGmYLd~ zyXCj9TXMqOK=va6;-nfpy+{dn`{OqSGX`4?xE6~|X}VY6!e5P+h_-mRnX13fX0Boj z(WE;W*FR$VR_7>!s4%i*qG)8DW+fV6qrtx3W`ikl8L>JIKKmACwxzyu{PQ-CFlGhM z5q{mU>68tJr_XVHm%}{x;w_BI`NWCnO_>)xl>Ey?5XCEWlMF3`QIGC_`jR8LmO2hvg+rsl(Rtfj$*lfuhcePsm2&>Z16TS5CYw88)H>3p!`a<%q4$|QJi;No(k)dwK$P)=>lHH6# z23q#*VtA{n!&+WYy&_wa5cX^pO1Z8Ea@IGQNdhA$SR+=%WJqJIJ7bTxzG%3QOoAK? z?fwSkTwmt6|K}2c3A9BQC6s>Lvh1)wZ)DjqvPA+HvfC#Op(1@l9hZCN<&D15(ccR)(U`B@7C8x;){PZ+7|=Josgc%jW==IZ@YIa0erG9no$YAx^8FP5e6Avf zwvbN8^OwZ@as7)mt#Ll&&mdw%0~w6q{QR)lB+bNX&`X&o*nRwzXJ%BFd5Rm|Pd1V> zJP>FzWy15eJ0+{nz4>lE^ESm}aN_<8)jMV#7_nKfV9SEdjf?Il-5+Ghk;WyL zBh7PDRYM7d+>KrWRqY1HWI` z*BzE`;;8@lIE7!lU$K&C!v4e2kedYBO(xQC{m^tCgc2=d$)bcn> zzTvH@sXQIi$*Iy~JN?{oKBi1XBs?~lu7ZNZzz^=H|I_IjavblJ#jHLu(WGWP(? z&N2y0Yz=nNlPBkalEd0B0}B5LB6KWQGWik6{7g<}9UJ+C9@uD{fsjNmp01sQ9?kaA zoqYJ86bokZuHbbqf2cL)%pWQ5+^$_NdR+I_bzg7o$(H%S1G<^M67lRi(Y_J8V)x8$ z`F7xV?xmk7{A5Dcd{XFpdl79?SM9^DVni?6ezcQZnY8?1WmWT}`?sd`MB1$6axFKx z8aP?)+L=8oc0)WuPA`wGVQD;A^jBlZqvp2ypKCXrgu6HN$J`~Sk-2isv)JcL5TC*i zMue%^JEf(FV{+SuEVoA9V+Z1lx02|m!t)aCBqBo`oH+Ump`CC`c6n6o*NTM(PR_}K zFL`tGeHIwe6DK=H*~i9ixz=(^24n0jg@7jTlw=8`r6tR|B@EHC^e^njK z$(FU3oIBe#$o2>psxG&ePnSW(LGJ)idhVp~4H4=xYwu=@IC_%WnzO~od$5q=&t9qX z!CNDcSby)LDtVB1)T=$x?pv3&&owb!*Hf1A@%&`w7z&)+ttYAmcCq9(3kI8atbwBi zZJg19bptmc;czB}PovlDFnhJnS&BI1#GrOILF4%*kc?7tM!s!Cv*G;{?rkcmH2~BX zaEEn>Whpz43qQa+ISlOJEnfNu(oi}>wh;KnVkO~OD^s1^BU#1cu=?Bhn&bLmAhcWe zwLK5xcRf&)W+U3h6-ma+N#sKRNa+*E+abO^r83AysQ@g1F&(A(l3jBa(0<-lX&G^0 z*i2Y`^Q-&?WF$RE?JNDQPe3WgQBgD_0-r{^l-%wF#^ZAV((*L6CJ5aB*Q8KDlH znFlN7(n zHh`wI5fa5?d>?g$HkrLrv&Q)RiPxlTlzx9)KkP`|-|37b!oVP{B?Qe^X&Oh60KM>P)(;Q5gu~%Wx z5GPSZ0Q4kTRKwT{Tsxb!Ff@gTP6S1+cxWEQpNY2{-7qz4Dbkv9o?ljsXymeJ<5ChW zFRW@{B%yE+X#-U30~zQC=J%hMoXsgKqe1^bR)b^Uy}|D*OO$IIzJu+jz_Vs2qIT^X zDH9(WiLQh%CX1Bg`oW#VTbsqe_>%ME{3}vpO;?i0`QUj;P9RzkUm<4V6M#x*7?F01 zRlnX6_Cx-8UuZE0Rh^SV8NkaK(z4-Lli39i3{x0Z?VwS6=repkNWpG*^4k}VG1K_KbXk-%%XsN?#~ zR|K1drHSkdG|Ot`&a6vBM(Rf16cP!vKhQ9KfYop~yqtLz#;%Fmqy81DPK!aYDga>M zsThoLKh&4tYl{cH%EEejMw-*6djm`B-xoC;{rIAX!q-6P)s)p)ymq9Q5ih96`Y%XL zFkOa_i}nZagM5^7ykY8u1S=Sva%Q^hS>H7!1cWbd%QbPG26vG?s3ZpfM%2V(?co4{ z)d0iE^IYIZ#$|viUkaZ=uUT#ODotu%pk<-?52C9RQet!}+BUV+z35F1can(SlHdxgf8tatBrPuTNt958fGpC`u*1m#yc-Df|rkCvf3M;<)tqju41{_D?(&YpecDEx5o7k_1#R>-}%4#dqm1q zY1N?eoBJj0<2mTTs$=_u;#(U?=VD0AoKN05F}kg8NyuPVvU6aM34dSGb5Qb9Z?{qS zng~6%#Qdc+U52KB>fd7X9mV7IsiNcidpjd%5!`P-2j}|puR?gfLNupQs<|@>NfRmEjf1Sj^3DI^y9wh0n}agqXdg>d%?-pxIRIKmAbtnQxnp z@zwEX_E_D)Z|H>)c_NI_co-=j#uoG2unFKB60!7;5jQ;}-DKAHJu{D0S%n@=_nlq+ zEjZxFxPRh9qi0iAVg1nbeKZlJAF2P=8*nB6oy0n|!fPTDS66Uk8b;7R&OcYNQEv@jI#;S$_CRh* zyF~2vjpc1eNRWNL{$LV=a3~4m`(XZ+yj4u>|E7$e`SlgZvu9b7G3Gxz$Dx51hz?t~ z%VfsUOW#F2t??+h<#==V^PVMN0uITAWA^KyH?PHU{Z6M@yHxq$_F3uNVz8m^){R@g z8^D+*{O51^ip_Ywu-ozcs%`Hq#`*TASSGnr3F|#84|V)xJf64ZjOv;2S6bm|_axoc9qrQ4 z7(XAzof@yZ&Wa&IoU+<+e;z!rneyi-ohmAyB-zJJXxRJe_~qSoKTZu-cobj!taLOY zEZUz8{IyN5E;;-~^u#{vM-5#89t%|<5R`yI7n5jS1U+<$Kbu<+YqpwYiswsIrJ@V_ z^S0Dzs{Yfp`&*If{iuL+6B>+k=mXq=dsts3c)Z*b1DL@V z=`tC-!_u8`19VaaUFPcFaBOG(kUyT6@e@KSipSEf>SRXER`wJ7Cz^2cubdL|14~_zZ5r zCbKsbe@?{2_;&0MYf`a({uJ39JWt|$BE<7Ahs0Bv&uyZIzY~s_L(R@a7``o3Tx#hyX{yNw8xhot3s!QX1O014QAYo*EC(HH8(CE}z+(D3F zlllclNX!i5)AAKDX8&X1`NEMjp$=1gK8f{%zKLdP_sN@W?vI>S$Mt+5gcdvuc^mNC zRpr1~#Zo-Mnd)siW-#a(399}nMd5WOeQY7nu)FDURo=dEd;ENrMWVI3|I@WMluz;l(Q9|JpvABJZ&PF9M0Qk!-kxE%~X$|(K>iBfs%@O(kq>A4Z( z`OrV%h83Rg>b6wAN{8%T>Eya(@nHNj=qNU=R@Dv+-i5{c=C|XUKT6`svs=(2`IEJ-s0E z$w&#*;nTH=-gWncz3^4ALj$^wFRm~M4aj&1e^8Z5fTA0{aV?efod; zA<-WGIwt1NJ);>&)nA&r*%bT#Oq_4A|L<3_3{9#*shS%Oztsp;wFeJJ?UfBB9(*lR zCE?$FP16^HY8f^lTzq!ZCV<=hNPG_^NenMi^1h?*ne!< zAJTL9XripVZIl!d@QpDMRMUm+ZSVm%#S_*NJSWS-s%#n)6#rEA z_S8Dn%pU6esccm8(6lf)x$Ua(&6ijsia(x@um8(e`j+v6Iv(<@!TAd32P$9T`Z$)} z6_2^RoCs%cnCtEQ3_r%sB}{a`bu+vo1XPo;2lQBK!WZnJ!&3o9i$a#bh{zsKds240 zfx^f9S5f&2=Ueap@=4zII3C_l9dW+G{DrDOEr8!XDx`Z$K#E5Vu^(Va{UUso&jnQ( z_70Jxay0(pT2uZ%zD1AcM@}=kp1x^laDKFN7=^D%qQ3v~iLOt)2_w+4asMgt;CI&E5>=@h{si@)^u@9{i9d^;Sr3ea zp1|qQ#M z+7>*Z#Bhg5!F~{qZ8<6!u5{R5KK%Ee526&U(L1L$!rCw3MDfS|d}GRMrh$mYvy4X# zMTq8y^9l9`j{a*1Z6gX7+6C+*hHZiti{JkGj&XN*GW-d(;|w&kS#%^h52B zhk2{1e5GG@JwlH2Py3>6#yH>3QBP>V{5w}bmPcuc%49Z7FKV%B*rZni0bZt`cIv=j zQo-VqXMJma`Y2ON{RH2VR?HsVvnYSw)y_5F`e3+Vd_L0D6`OFr8u$Oo_HG^`cBjTk zc?*#}yI(}#FIowzjo3JGtB#uDHBTYIF~nsg$cA*nx0L$=!1d{Ax)`L9=3|DRm%x}g zz3_KD_!FuS2T}E5acfrMd?lJI;CP=mW@CTw^G(3#19(6EfdA71pAHI~+4d!7R0J$- z8*46`4QhRiHt559z&g@v(#^Q4*%MW=cNbX!pz;J&gx>Ff;?ib~gwa&A%pxMYwnP$>!ABtBp|n^$}X5`$mn*C;0xB;raLu=PT@=L3qC7e1%rk zcZ6zJ|5!5mq^t9tujSTi(2Se_&$<>#&a_nrJeuaVu*vY+YgMu0bdqa**Q6V3OY&}e zXdJTBzwn5{r}SyCIt%N^us%o8fbZ{4dQvfgtR2ZXZxSJ0j}p*7$}`dwKY9=8+&O*e)~Sm(?>>C~`Rn%^cOU18>%IkAEL9TZ7tC_bB_yeI+w4WxZ<70U7tqBvl_iObq;R2Gh@kPjt!kH z&Rd0qPnebEND04O@o{eWjGWSC3nn|TJrap&mWsTx*-_KzFcQ>&H2Zh*QqqEzI}N>$D(*Ek;{L% zu4*h(EBdC9;qTYnB=v3Xf&KC=?(+y|)i>_Vmi%+Qsiuk+WyQ z?+6c<{$BY>F2~#7@BiwsN?F$6Txre1*GFxSXxs2@Icy;rctNxSFN1nRyv6 zB7Vn8SzY_(HS0>th4!t^nJ;R7epov!fPsbgxleOk~ zQ?XfoTCC%npw#3hUOTf>SBnl^)7|E zTo-$(hb>;2G$C~Esy(TtTeNOS8U+ZrB+9a`lBfzc_-H5hmUW*b$8P>p&okI;AGu89 zD$?1m^2&;xDQI0#=)@zRwr-c5_+Hj@qxZIyUoV*6mc*qo)lJL>CPM~KS3j3^P6$uHq2->54Z0pVnl71_Z$6wjf78RKuMVEPlG`xTIi|+czewLJ@AKF1Z$Er``r_^N zJCC>RKeKYn;l=Cs&sx5tZR)D@>Z#EMJ)zkh6`c#pJLaFhbo=iqw zE!k%1op)dU-AAC`luCm9f*Dxe9>28C?_{6c!{72fUtc`Gd1J?>#pOAv;a(ng`dZ>5 z+^yOdfg!>4%+tj&B;($etIsFhG7w>X(4CWPu(v#-PhHB0*L=$mN(L*PIvUuefR5nrObYCuGWJk!Omk za;;w`&Z^50%JT5lb!N9+vcjERFX&0udzR0CA1H^~z3p9)x-lkiVQR^_Yx8O!&xv>P z&a}TBs$#zXiICH^+4DPs&rUFLDC*XhseRycCJ_)J-cNCuXx;oYl=$#i_Jm>?xj|4{$bBO zZO68Z3(KclmdX9^IvuWIxQMgwwq9jV?YXY?buy=RS2tX0X|u>X>Ce9Rlz)BGmjd;3 z=L4jI#E*YuaeO^>j@g?(g2&4>N;T63TJFdEV9nIKe=G9LuIyPX51(yF%s*PlJyp%p z&GGuCJ*G>{3#*#DoYy&C_@|xwZ+*M;iX9>|Sapva7WcScu0FM4M&yO96+8YG1SN(T zaL?*&|IM#H_0ayTx3cUG0v(H1bn^CkZ`gP-b;tkE%r!naG785hp6Y8+_-r>l_eft~ zEL+*$oBXHeDSTV8$?zbXy!2DAIR-mL1twHaZb+FF(fMaZ?#=96ZsVkDQGAzw%3AL$ za0 j`PXc@^YNn4A$NXnuKePU3XVU4`GdjJ)z4*}Q$iB}PRu>p literal 0 HcmV?d00001 diff --git a/TUICallKit/static/switch_camera.png b/TUICallKit/static/switch_camera.png new file mode 100644 index 0000000000000000000000000000000000000000..ecf21f05ff6e27fe986b8625ebf15e63ca5f9652 GIT binary patch literal 799 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!ssnsNT>t<74`c#K`h((M?^gls z)+h<`3pQrZXVI1v){y0X@A>=n+3nTNin~J&v{;*cx!PAA=WDNW_t4_G4VjOtayJ6? zFll?bIEF+VUON3{(P{&pR{uQ=d?Fk-Z>wcqe){R3f5q`5B|Q_lt~_^FJNK!#PbY<2 z+s){r?(+ z>=KQVLT$_{Ggh{+rOa5{!?Y){@!qipp6)5F4J_PKc^KKcQ)?PTB6JjO9lGo_N*f%R zrY&deX}oTBK|A#jqlw$CHO>dBnkQ~yy}+1rd*Zef4zUH6%$Ll0A z)e@;#!SU(U%D=Aup>j4t5>_YJ4^DRbw2GCf)c@{W&F@HO7FzsQD-fLloH<=Dx zuFPc&Uf=&!GCzo#z`*LrTsO`aH8&nyY6c|m{*!_Mg-f)Zg!zWpW<>mSdw0RSB zWG=qkt#8j@ev4`H5$T3~tM*@f>7hRH=CRe=IseN&d^00A=Y~q%-zy>q)HWu1Rb~hO zcq8UI{n8}Or!6cZ*A6dJpK^|o(L>>85Sw3VrJZ=c)sD*yol}(<-*V5f+f|kk&)L8g z9c8U{=i0lQ??ktm9A>z+J3EejcLIZ2&g;W{+t%y<{8*$B(I6$O6XTs0HA_x5_o~SP zDcM}@zt^{|V?X};Q?u)d8{BShMAd&y60JVly*J}nTuh|qEAPZ8g4&-HwDSoVsq#Ipy@wbM5*&&m%_dvktQ zTiJvOH!^=QFfgz4ba4#HxOaBe%d$rXJgu%vB<4(D-6W83gL|p<`~M})jg~69ZQhFM z7xbe}{4ElVF3SmK=8ivp*nv}c0+S*~nbeFVl2b@%(;1ft!<({XvxPSX zv4mugPZ08GJD>b&cZ$uPc%j|n6nxlU^<*dN^&%6>pXRWnd)VA&6ee;4nwyCjai(T=VqqdpSpZ zWcUmYOki@7@!?93?u+~V?DOj)?c<9%nQolYej$0r<=IlJ=|(4cm^6frILaBdS9Wgr zEzQVb_-KK8O5V;-{4W(5)R<&;oIjRc88E{va$YRM2HpdXMoCIx^Hq;d`(V|~z+>T2 zCR=gWs${*+`Oi}WW;kdH9clFR*m;&~w!8v^BCExTplK$SLSjxXbJ7Bgc^TN>#hj?L zX8QGP<_VeC8O}?@Y&$QmHjA!1V=`6olKdO zNlIRvG*#g8=Y&VQ{(gUZd4@^2q{Rah5tBu}QBEo$OENdkcDM7rpt$*AVsg>{V*5EW zD|TgF=s#e1Gj^GdTU-hs^P;;)xMe3#K6qWrH#~lBxX6Jj`_eVpaZgqlPrkpKVb}4O zzt8f$xm@nu_l_~(TDXQY|8k22sd+3t=l8LEV(0tuV6%SXHqLL0`cHlrU%vjk-rkPS zD_Dr zyEH%G%HE?v-_-)|-j4ZSx%iyR_qMgij^EJv`?u`<lr*<{an^LB{Ts5h9_q3 literal 0 HcmV?d00001 diff --git a/TUICallKit/static/trans.png b/TUICallKit/static/trans.png new file mode 100644 index 0000000000000000000000000000000000000000..7a3cfb56a9bf099e4c37a555f643efa9b2bff32d GIT binary patch literal 714 zcmeAS@N?(olHy`uVBq!ia0vp^7C@}R!3-o{`*5BCQu70RLR^9L|3M76$}4vOooG@L z^$#+}jrq?ks31OmyIw6aDq$>Ato)BMG64XZJ424pvv@|8?zXSEa9&xz5_9 zQzwO+u}CZtY+ztuT;}QG7~*k!Zs_Z(CIcSUK$fWs8!Bc$`ulEK^u7N#r)?3iOK^Sr z^YFsIew>z`S$kUVPg~f!mATs6y@H`(cHai}j&*Gp`aO1D3Gln6!K2=Fx7Z|q)f92z zspUtPbyqL`lr-%Oi@9&BrbC7gx805n9&?u@Tbnu+9CPcl)8kRCRk*t?t0kezl{r!2 zCr{=gF`-{|+f0@++!mXC^N0T9I-!o!Ou*-n$f}f_@9di@ zJ0;KR+KBdPo>nd6eO+=cO77e@!_6@XD<)6=uzhb&>Fbg^?|IE0cIYe%;=HnH4@1 + + + diff --git a/TUIService/TUICallKit/TUICallKit/TUICallKit.wxss b/TUIService/TUICallKit/TUICallKit/TUICallKit.wxss new file mode 100644 index 0000000..135c364 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/TUICallKit.wxss @@ -0,0 +1,10 @@ +.TUICall-container { + width: 100vw; + height: 100vh; + overflow: hidden; + position: absolute; + top: 0; + left: 0; + z-index: 10; + margin: 0; +} \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js new file mode 100644 index 0000000..d1c5f1e --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.js @@ -0,0 +1,116 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type: Object, + }, + callerUserInfo: { + type: Object + }, + remoteUserInfoList: { + type: Array, + }, + playerProcess: { + type: Object, + }, + isEarPhone: { + type: Boolean, + }, + }, + data: { + renderStreamList: [], + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_LOADING:`${PATH}/loading.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + }, + observers: { + "localUserInfo, remoteUserInfoList": function ( + localUserInfo, + remoteUserInfoList + ) { + this.setData({ + renderStreamList: [localUserInfo, ...remoteUserInfoList], + }); + }, + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + }, + async reject() { + await TUICallKitServer.reject(); + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml new file mode 100644 index 0000000..a94d708 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxml @@ -0,0 +1,285 @@ + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{callerUserInfo.nick || callerUserInfo.userId}} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + + + + + + + + {{item.displayUserInfo || item.nick || item.userId}} + + + {{item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + {{ callerUserInfo.nick || callerUserInfo.userId }} + 邀请你参加多人通话 + + 参与通话的有: + + + + {{ item.displayUserInfo || item.nick || item.userId}} + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss new file mode 100644 index 0000000..6f2a097 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/GroupCall/GroupCall.wxss @@ -0,0 +1,754 @@ +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + + to { + transform: translateY(0); + } +} + +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100%; + height: 187px; +} + +.invite-call .local-video { + width: 100px; + height: 187px; +} + +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} + +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: 0; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.invite-calling-header-right { + display: flex; + align-items: center; +} + +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} + +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} + +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} + +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} + +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 120px auto 15px; +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.avatar { + background-color: black; +} + +/* 被叫者 */ +.invite-txt { + width: 126px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 16px auto 60px auto; +} + +.invite-other-txt { + width: 112px; + height: 20px; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 14px; + color: #333333; + letter-spacing: 0; + margin: 0 auto 24px auto; +} + +.invite-other-list { + position: absolute; + left: 14vw; + margin-top: 0 auto; + display: flex; + flex-wrap: wrap; + width: 272px; + justify-content: center; + flex-wrap: wrap; +} + +.invite-other-item { + flex: 0.25; + text-align: center; + max-width: 64px; + margin: 2px; +} + +.invite-other-item image { + border-radius: 10%; + max-width: 64px; + height: 64px; +} + +.invite-other-item-name { + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #666666; + letter-spacing: 0; + line-height: 18px; +} + +/* 全屏设置 */ +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.TUICalling-connected-video { + width: 100%; + height: 180%; +} + +/* 本地音频 */ +.stream-box { + float: left; + width: 187px; + height: 187px; + position: absolute; + top: 13vh; +} + +/* 远端音频列表 */ +.swiper { + margin-top: 107px; + min-height: 374px; +} + +.invite-calling-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: flex-start; +} + +.invite-calling-item { + flex: 0.5; + min-width: 50%; + height: 187px; + position: relative; +} + +.invite-calling-item image { + width: 100%; + height: 100%; +} + +/* 本地视频 */ +.play-item { + width: 100%; + height: 187px; + position: relative; + background-color: #000000; +} + +.pusher-ownvideo { + width: 100%; + height: 100%; +} + +/* 远端视频列表 */ +.swiper-list { + min-height: 189px; +} + +.player-list { + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.player-item { + flex: 0.5; + min-width: 50%; + min-height: 187px; +} + +/* 音量图标 */ +.player-control { + background-color: rgba(0, 0, 0, 0.4); + border-radius: 0 6px 6px 0; + color: #fff; + z-index: 999; + position: absolute; + bottom: 0px; + left: 0px; + display: flex; + align-items: center; + height: 32px; + max-width: 50%; + z-index: 99; +} + +.player-control image { + width: 32px; + height: 32px; +} + +.player-control .name { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-left: 10px; + margin-right: 10px; + flex: 1; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.control-buttons { + display: flex; +} + +.icon-button { + margin-right: 10px; +} + +/* 菜单 */ +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + font-weight: 400; + font-size: 14px; + color: #666666; + padding: 5px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + margin-top: 100px; + display: flex; + flex-wrap: wrap; + width: 100%; + justify-content: center; +} + +.TRTCCalling-calling-list { + flex: 0.5; + /*设置最小宽度,才会让元素排不下,导致换行排列*/ + min-width: 50%; + min-height: 187px; + position: relative; +} + +.TRTCCalling-calling-list image { + width: 100%; + height: 100%; +} + +.TRTCCalling-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-header-left { + position: absolute; + right: -88px; +} + +.invite-calling-header-left image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #666666; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} + +.invite-calling-item-message { + position: absolute; + top: 0; + left: 0; + float: left; + background: rgba(0, 0, 0, 0.6); + width: 100%; + height: 100%; + z-index: 2; +} + +.invite-calling-item-loadimg { + position: absolute; + left: calc(50% - 20px); + top: calc(50% - 20px); + width: 40px; + height: 40px; + -webkit-transform: rotate(360deg); + animation: rotation 2s linear infinite; + -moz-animation: rotation 2s linear infinite; + -webkit-animation: rotation 2s linear infinite; + -o-animation: rotation 2s linear infinite; +} + +@-webkit-keyframes rotation { + from { + -webkit-transform: rotate(0deg); + } + + to { + -webkit-transform: rotate(360deg); + } +} + +.invite-calling-item-loadimg image { + width: 100%; + height: 100%; +} + +.invite-calling-item-id { + position: absolute; + left: 2%; + bottom: 2%; + font-family: PingFangSC-Regular; + font-weight: 400; + font-size: 12px; + color: #ffffff; +} diff --git a/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js new file mode 100644 index 0000000..2958092 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.js @@ -0,0 +1,107 @@ +import { TUICallKitServer } from "../../../TUICallService/index"; +const PATH = '../../../static'; +Component({ + properties: { + callRole: { + type: String, + }, + callStatus: { + type: String, + }, + callMediaType: { + type: Number, + }, + callDuration: { + type: String, + }, + pusher: { + type: Object, + }, + playerList: { + type: Array, + }, + localUserInfo: { + type:Object + }, + remoteUserInfoList: { + type: Array, + }, + isEarPhone: { + type: Boolean, + }, + bigScreenUserId: { + type: Boolean + } + }, + data:{ + IMG_DEFAULT_AVATAR:`${PATH}/default_avatar.png`, + IMG_HANGUP:`${PATH}/hangup.png`, + IMG_ACCEPT: `${PATH}/dialing.png`, + IMG_SPEAKER_FALSE:`${PATH}/speaker-false.png`, + IMG_SPEAKER_TRUE:`${PATH}/speaker-true.png`, + IMG_AUDIO_TRUE:`${PATH}/audio-true.png`, + IMG_AUDIO_FALSE:`${PATH}/audio-false.png`, + IMG_CAMERA_TRUE:`${PATH}/camera-true.png`, + IMG_CAMERA_FALSE:`${PATH}/camera-false.png`, + IMG_TRANS:`${PATH}/trans.png`, + IMG_SWITCH_CAMERA:`${PATH}/switch_camera.png`, + }, + methods: { + async accept() { + await TUICallKitServer.accept(); + }, + async hangup() { + await TUICallKitServer.hangup(); + }, + async reject() { + await TUICallKitServer.reject(); + }, + async switchCamera() { + await TUICallKitServer.switchCamera(); + }, + async switchCallMediaType() { + await TUICallKitServer.switchCallMediaType(); + }, + async microPhoneHandler() { + if (this.data.localUserInfo.isAudioAvailable) { + await TUICallKitServer.closeMicrophone(); + } else { + await TUICallKitServer.openMicrophone(); + } + }, + async cameraHandler() { + if (this.data.localUserInfo.isVideoAvailable) { + await TUICallKitServer.closeCamera(); + } else { + await TUICallKitServer.openCamera(); + } + }, + async toggleSoundMode() { + await TUICallKitServer.setSoundMode(); + }, + toggleViewSize() { + TUICallKitServer.switchScreen(this.data.bigScreenUserId ? 'player':'localVideo') + }, + pusherStateChangeHandler(e) { + TUICallKitServer._tuiCallEngine._pusherStateChangeHandler(e); + }, + pusherNetStatus(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherErrorHandler(e) { + TUICallKitServer._tuiCallEngine._pusherNetStatus(e); + }, + pusherAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._pusherAudioVolumeNotify(e); + }, + playerStateChange(e) { + TUICallKitServer._tuiCallEngine._playerStateChange(e); + }, + playNetStatus(e) { + TUICallKitServer._tuiCallEngine._playNetStatus(e); + }, + playerAudioVolumeNotify(e) { + TUICallKitServer._tuiCallEngine._playerAudioVolumeNotify(e); + }, + }, +}); diff --git a/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json new file mode 100644 index 0000000..62389a9 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} + } \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml new file mode 100644 index 0000000..45c3bc2 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + {{remoteUserInfoList[0].displayUserInfo}} + 等待对方接受 + + + + + + + + 邀请你视频通话 + 等待对方接受 + + + + + + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + 挂断 + + + + + + + + + + + + 切到语音通话 + + + + + + + + + + + + + 挂断 + + + + + + + + 挂断 + + + + + + 接听 + + + + + + + + {{callDuration}} + + + + + + + 麦克风 + + + + + + 挂断 + + + + + + 扬声器 + + + + + + + + {{callDuration}} + + + + + + 切到语音通话 + + + + + + + 麦克风 + + + + + + 扬声器 + + + + + + 摄像头 + + + + + + + + + + + + + 挂断 + + + + + \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss new file mode 100644 index 0000000..06dee2d --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/component/SingleCall/SingleCall.wxss @@ -0,0 +1,508 @@ +.footer { + position: absolute; + bottom: 5vh; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-operate { + display: flex; + justify-content: space-between; + z-index: 9999; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; + margin-bottom: 20px; +} + +.btn-operate-item text { + font-size: 14px; + color: #f0e9e9; + padding: 5px; + letter-spacing: 0; + font-weight: 400; +} + +.call-switch text { + padding: 5px; + color: #f0e9e9; + font-size: 14px; +} + +.call-operate { + width: 8vh; + height: 8vh; + border-radius: 8vh; + margin: 0 15vw; + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; +} +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.tips { + font-size: 20px; + color: #ffffff; + letter-spacing: 0; + margin: 0 auto; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.40); */ + font-weight: 600; + max-width: 150px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.tips-subtitle { + font-family: PingFangSC-Regular; + font-size: 14px; + color: #ffffff; + letter-spacing: 0; + text-align: right; + /* text-shadow: 0 1px 2px rgba(0,0,0,0.30); */ + font-weight: 400; +} + +.invite-call { + position: absolute; + top: 0; + z-index: 100; + width: 100vw; + height: 100vh; + background-color: black; +} + +.transition-animation { + transform: translateY(-100%); + animation: slideInDown 0.5s ease forwards; +} + +@keyframes slideInDown { + from { + transform: translateY(-100%); + } + to { + transform: translateY(0); + } +} + +.invite-call .local-video { + width: 100vw; + height: 100vh; +} +.invite-call .invite-calling { + position: absolute; + top: 0; + z-index: 101; + width: 100vw; + height: 100vh; +} +.invite-calling-header { + margin-top: 107px; + display: flex; + justify-content: flex-end; + padding: 0 16px; +} +.btn-container { + display: flex; + align-items: center; + position: relative; +} +.invite-calling-header-left { + position: absolute; + right: 0; +} +.invite-calling-header-left image { + width: 32px; + height: 32px; +} +.invite-calling-header-right { + display: flex; + align-items: center; +} +.invite-calling-header-message { + display: flex; + flex-direction: column; + padding: 0 16px; +} +.invite-calling-header-right image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling .footer { + position: absolute; + bottom: 5vh; + width: 100%; +} +.invite-calling .btn-operate { + display: flex; + justify-content: center; + align-items: center; +} + +.hidden { + display: none; +} + +.trtc-calling { + width: 100vw; + height: 100vh; + overflow: hidden; + margin: 0; + z-index: 99; +} + +.audio-call { + width: 100vw; + height: 100vh; + position: absolute; + top: 0; + z-index: 100; + background: #ffffff; +} +.audio-call > .btn-operate { + display: flex; + justify-content: center; +} + +.audio-call > image { + width: 40vw; + height: 40vw; + display: block; + margin: 20vw 30vw; + margin-top: 40vw; +} + +.invite-calling-single > image { + width: 120px; + height: 120px; + border-radius: 12px; + display: block; + margin: 140px auto 15px; + /* margin: 20vw 30vw; */ +} + +.invite-calling-single .tips { + width: 100%; + height: 40px; + line-height: 40px; + text-align: center; + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} +.invite-calling-single .tips-subtitle { + height: 20px; + font-family: PingFangSC-Regular; + font-size: 14px; + color: #97989c; + letter-spacing: 0; + font-weight: 400; + text-align: center; +} + +.invite-calling-list { + justify-content: flex-start; +} + +.invite-calling-item { + position: relative; + margin: 0 12px; +} +.invite-calling-item image { + width: 100px; + height: 100px; + border-radius: 12px; +} +.invite-calling-item-message { + position: absolute; + background: rgba(0, 0, 0, 0.5); + width: 100px; + height: 100px; + top: 0; + left: 0; + z-index: 2; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.avatar { + background: #dddddd; +} + +.player { + position: absolute; + right: 16px; + top: 107px; + width: 100px; + height: 178px; + padding: 16px; + z-index: 999; +} + +.pusher-video { + position: absolute; + width: 100%; + height: 100%; + z-index: 1; +} + +.stream-box { + position: relative; + float: left; + width: 50vw; + height: 260px; + /* background-color: #f75c45; */ + z-index: 3; +} + +.handle-btns { + position: absolute; + bottom: 44px; + width: 100vw; + z-index: 3; + display: flex; + flex-direction: column; +} + +.handle-btns .btn-list { + display: flex; + flex-direction: row; + justify-content: space-around; + align-items: center; +} + +.button-container { + display: flex; + flex-direction: column; + text-align: center; +} + +.btn-normal { + width: 8vh; + height: 8vh; + box-sizing: border-box; + display: flex; + flex-direction: column; + /* background: white; */ + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-image { + width: 100%; + height: 100%; + background: none; +} + +.btn-hangup { + width: 8vh; + height: 8vh; + /*background: #f75c45;*/ + box-sizing: border-box; + display: flex; + justify-content: center; + align-items: center; + border-radius: 50%; +} + +.btn-hangup > .btn-image { + width: 100%; + height: 100%; + background: none; +} + +.TRTCCalling-call-audio { + width: 100%; + height: 100%; +} + +.btn-footer { + position: relative; +} + +.btn-footer .multi-camera { + width: 32px; + height: 32px; +} + +.btn-footer .camera { + width: 64px; + height: 64px; + position: fixed; + left: 16px; + top: 107px; + display: flex; + justify-content: center; + align-items: center; + background: rgba(255, 255, 255, 0.7); +} + +.btn-footer .camera .camera-image { + width: 32px; + height: 32px; +} + +.TUICalling-connected-layout { + width: 100%; + height: 100%; +} + +.audio { + padding-top: 15vh; + background: #ffffff; +} + +.pusher-audio { + width: 0; + height: 0; +} + +.player-audio { + width: 0; + height: 0; +} + +.live { + width: 100%; + height: 100%; +} + +.other-view { + display: flex; + flex-direction: column; + align-items: center; + font-size: 18px; + letter-spacing: 0; + font-weight: 400; + padding: 16px; +} + +.white { + color: #f0e9e9; + padding: 5px; + font-size: 14px; +} + +.black { + color: #000000; + padding: 5px; +} + +.TRTCCalling-call-audio-box { + display: flex; + flex-wrap: wrap; + justify-content: center; +} + +.mutil-img { + justify-content: flex-start !important; +} + +.TRTCCalling-call-audio-img { + display: flex; + flex-direction: column; + align-items: center; +} + +.TRTCCalling-call-audio-img > image { + width: 25vw; + height: 25vw; + margin: 0 4vw; + border-radius: 4vw; + position: relative; +} + +.TRTCCalling-call-audio-img text { + font-size: 20px; + color: #333333; + letter-spacing: 0; + font-weight: 500; +} + +.btn-list-item { + flex: 1; + display: flex; + justify-content: center; + padding: 16px 0; +} + +.btn-image-small { + transform: scale(0.7); +} + +.avatar { + background: #dddddd; +} + +.btn-container { + display: flex; + align-items: center; + position: relative; +} + +.invite-calling-connected { + position: absolute; + right: -88px; +} + +.invite-calling-connected image { + width: 32px; + height: 32px; +} + +.call-switch .call-operate { + width: 4vh; + height: 3vh; +} + +.call-operate image { + width: 100%; + height: 100%; + background: none; +} + +.call-switch text { + padding: 0; + font-size: 14px; +} + +.btn-operate-item { + display: flex; + flex-direction: column; + align-items: center; +} + +.btn-operate-item text { + padding: 8px 0; + font-size: 18px; + color: #ffffff; + letter-spacing: 0; + font-weight: 400; + font-size: 14px; +} diff --git a/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.js b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.js new file mode 100644 index 0000000..9b9130e --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.js @@ -0,0 +1,66 @@ +// TUICallKit/TUICallKit/pages/globalCall/globalCall.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.json b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml new file mode 100644 index 0000000..2f68333 --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml @@ -0,0 +1,2 @@ + +TUICallKit/TUICallKit/pages/globalCall/globalCall.wxml \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss new file mode 100644 index 0000000..53a9b4d --- /dev/null +++ b/TUIService/TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss @@ -0,0 +1 @@ +/* TUICallKit/TUICallKit/pages/globalCall/globalCall.wxss */ \ No newline at end of file diff --git a/TUIService/TUICallKit/TUICallService/CallService/bellContext.d.ts b/TUIService/TUICallKit/TUICallService/CallService/bellContext.d.ts new file mode 100644 index 0000000..b3dd8e2 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/bellContext.d.ts @@ -0,0 +1,15 @@ +import { IBellParams } from '../interface/index'; +export declare class BellContext { + private _bellContext; + private _isMuteBell; + private _calleeBellFilePath; + private _callRole; + private _callStatus; + constructor(); + setBellSrc(): void; + setBellProperties(bellParams: IBellParams): void; + play(): Promise; + stop(): Promise; + setBellMute(enable: boolean): Promise; + destroy(): void; +} diff --git a/TUIService/TUICallKit/TUICallService/CallService/bellContext.js b/TUIService/TUICallKit/TUICallService/CallService/bellContext.js new file mode 100644 index 0000000..3afb593 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/bellContext.js @@ -0,0 +1,106 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BellContext = void 0; +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +const DEFAULT_CALLER_BELL_FILEPATH = '/TUICallKit/static/phone_dialing.mp3'; +const DEFAULT_CALLEE_BELL_FILEPATH = '/TUICallKit/static/phone_ringing.mp3'; +class BellContext { + constructor() { + this._bellContext = null; + this._isMuteBell = false; + this._calleeBellFilePath = DEFAULT_CALLEE_BELL_FILEPATH; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + // @ts-ignore + this._bellContext = wx.createInnerAudioContext(); + this._bellContext.loop = true; + } + setBellSrc() { + // @ts-ignore + const fs = wx.getFileSystemManager(); + try { + let playBellFilePath = DEFAULT_CALLER_BELL_FILEPATH; + if (this._callRole === index_1.CallRole.CALLEE) { + playBellFilePath = this._calleeBellFilePath || DEFAULT_CALLEE_BELL_FILEPATH; + } + fs.readFileSync(playBellFilePath, 'utf8', 0); + this._bellContext.src = playBellFilePath; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to setBellSrc, ${error}`); + } + } + setBellProperties(bellParams) { + this._callRole = bellParams.callRole || this._callRole; + this._callStatus = bellParams.callStatus || this._callStatus; + this._calleeBellFilePath = bellParams.calleeBellFilePath || this._calleeBellFilePath; + // undefined/false || isMuteBell => isMuteBell (不符合预期) + this._isMuteBell = (0, common_utils_1.isUndefined)(bellParams.isMuteBell) ? this._isMuteBell : bellParams.isMuteBell; + } + play() { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._callStatus !== index_1.CallStatus.CALLING) { + return; + } + this.setBellSrc(); + if (this._callRole === index_1.CallRole.CALLEE && !this._isMuteBell) { + yield this._bellContext.play(); + } + if (this._callRole === index_1.CallRole.CALLER) { + yield this._bellContext.play(); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to play audio file, ${error}`); + } + }); + } + stop() { + return __awaiter(this, void 0, void 0, function* () { + try { + this._bellContext.stop(); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to stop audio file, ${error}`); + } + }); + } + setBellMute(enable) { + return __awaiter(this, void 0, void 0, function* () { + if (this._callStatus !== index_1.CallStatus.CALLING && this._callRole !== index_1.CallRole.CALLEE) { + return; + } + if (enable) { + yield this.stop(); + } + else { + yield this.play(); + } + }); + } + destroy() { + try { + this._isMuteBell = false; + this._calleeBellFilePath = ''; + this._callRole = index_1.CallRole.UNKNOWN; + this._callStatus = index_1.CallStatus.IDLE; + this._bellContext.destroy(); + this._bellContext = null; + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}Failed to destroy, ${error}`); + } + } +} +exports.BellContext = BellContext; diff --git a/TUIService/TUICallKit/TUICallService/CallService/index.d.ts b/TUIService/TUICallKit/TUICallService/CallService/index.d.ts new file mode 100644 index 0000000..c5872c6 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/index.d.ts @@ -0,0 +1,97 @@ +import { ITUICallService, ICallParams, IGroupCallParams, ICallbackParam, ISelfInfoParams, IInviteUserParams, IJoinInGroupCallParams, IInitParams } from '../interface/ICallService'; +import { LanguageType, LOG_LEVEL, VideoDisplayMode, VideoResolution } from '../const/index'; +import { ITUIGlobal } from '../interface/ITUIGlobal'; +import { ITUIStore } from '../interface/ITUIStore'; +declare const TUIGlobal: ITUIGlobal; +declare const TUIStore: ITUIStore; +export { TUIGlobal, TUIStore }; +export default class TUICallService implements ITUICallService { + static instance: TUICallService; + _tuiCallEngine: any; + private _tim; + private _TUICore; + private _timerId; + private _bellContext; + constructor(); + static getInstance(): TUICallService; + init(params: IInitParams): Promise; + destroyed(): Promise; + call(callParams: ICallParams): Promise; + groupCall(groupCallParams: IGroupCallParams): Promise; + inviteUser(params: IInviteUserParams): Promise; + joinInGroupCall(params: IJoinInGroupCallParams): Promise; + getTUICallEngineInstance(): any; + setLogLevel(level: LOG_LEVEL): void; + setLanguage(language: LanguageType): void; + enableFloatWindow(enable: boolean): void; + setSelfInfo(params: ISelfInfoParams): Promise; + setCallingBell(filePath?: string): Promise; + enableMuteMode(enable: boolean): Promise; + accept(): Promise; + hangup(): Promise; + reject(): Promise; + openCamera(videoViewDomID: string): Promise; + closeCamera(): Promise; + openMicrophone(): Promise; + closeMicrophone(): Promise; + switchScreen(userId: string): void; + switchCallMediaType(): Promise; + switchCamera(): Promise; + setSoundMode(type?: string): void; + getTim(): any; + private _addListenTuiCallEngineEvent; + private _removeListenTuiCallEngineEvent; + private _handleError; + private _handleNewInvitationReceived; + private _handleUserAccept; + private _handleUserEnter; + private _callerChangeToConnected; + private _handleUserLeave; + private _unNormalEventsManager; + private _handleInviteeReject; + private _handleNoResponse; + private _handleLineBusy; + private _handleCallingCancel; + private _handleCallingEnd; + private _handleSDKReady; + private _handleKickedOut; + private _handleCallTypeChange; + private _messageSentByMe; + private _handleUserUpdate; + private _handleCallError; + beforeCalling: ((...args: any[]) => void) | undefined; + afterCalling: ((...args: any[]) => void) | undefined; + onMinimized: ((...args: any[]) => void) | undefined; + onMessageSentByMe: ((...args: any[]) => void) | undefined; + kickedOut: ((...args: any[]) => void) | undefined; + statusChanged: ((...args: any[]) => void) | undefined; + setCallback(params: ICallbackParam): void; + toggleMinimize(): void; + private _executeExternalBeforeCalling; + private _executeExternalAfterCalling; + setVideoDisplayMode(displayMode: VideoDisplayMode): void; + setVideoResolution(resolution: VideoResolution): Promise; + private _handleExceptionExit; + private _setLocalUserInfoAudioVideoAvailable; + private _updateCallStoreBeforeCall; + private _updateCallStoreAfterCall; + private _resetCurrentDevice; + private _resetCallStore; + private _noDevicePermissionToast; + private _startTimer; + private _updateCallDuration; + private _stopTimer; + private _deleteRemoteUser; + private _analyzeEventData; + getGroupMemberList(count: number, offset: number): Promise; + getGroupProfile(): Promise; + private _handleCallStatusChange; + private _watchTUIStore; + private _unwatchTUIStore; + bindTUICore(TUICore: any): void; + private _callTUIService; + onNotifyEvent(eventName: string, subKey: string): Promise; + onCall(method: String, params: any): Promise; + private _handleTUICoreOnClick; + onGetExtension(extensionID: string, params: any): any[]; +} diff --git a/TUIService/TUICallKit/TUICallService/CallService/index.js b/TUIService/TUICallKit/TUICallService/CallService/index.js new file mode 100644 index 0000000..02072c9 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/index.js @@ -0,0 +1,1147 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +var __rest = (this && this.__rest) || function (s, e) { + var t = {}; + for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) + t[p] = s[p]; + if (s != null && typeof Object.getOwnPropertySymbols === "function") + for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { + if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) + t[p[i]] = s[p[i]]; + } + return t; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.TUIStore = exports.TUIGlobal = void 0; +const tui_core_1 = require("@tencentcloud/tui-core"); +const index_1 = require("../const/index"); +// @ts-ignore +const tuicall_engine_wx_1 = require("tuicall-engine-wx"); +const index_2 = require("../locales/index"); +const miniProgram_1 = require("./miniProgram"); +const bellContext_1 = require("./bellContext"); +const index_3 = require("../utils/validate/index"); +const common_utils_1 = require("../utils/common-utils"); +const utils_1 = require("./utils"); +const timer_1 = __importDefault(require("../utils/timer")); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const tuiStore_1 = __importDefault(require("../TUIStore/tuiStore")); +const TUIGlobal = tuiGlobal_1.default.getInstance(); +exports.TUIGlobal = TUIGlobal; +const TUIStore = tuiStore_1.default.getInstance(); +exports.TUIStore = TUIStore; +const version = '2.1.1'; +class TUICallService { + constructor() { + this._tim = null; + this._TUICore = null; + this._timerId = -1; + this._bellContext = null; + // =========================【监听 TUIStore 中的状态】========================= + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + var _a, _b; + try { + const bellParams = { + callRole: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE), + callStatus: TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS), + }; + this._bellContext.setBellProperties(bellParams); + if (value === index_1.CallStatus.CALLING) { + yield ((_a = this === null || this === void 0 ? void 0 : this._bellContext) === null || _a === void 0 ? void 0 : _a.play()); + } + else { + // 状态变更通知 + if (value === index_1.CallStatus.CONNECTED) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const oldStatus = isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + this.statusChanged && this.statusChanged({ oldStatus, newStatus: (0, utils_1.generateStatusChangeText)(TUIStore) }); + if (!isGroup && callMediaType === index_1.CallMediaType.VIDEO) { + this.switchScreen(remoteUserInfoList[0].domId); + } + } + yield ((_b = this === null || this === void 0 ? void 0 : this._bellContext) === null || _b === void 0 ? void 0 : _b.stop()); + } + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}handleCallStatusChange, ${error}.`); + } + }); + console.log(`${index_1.NAME.PREFIX}version: ${version}`); + this._watchTUIStore(); + this._bellContext = new bellContext_1.BellContext(); + // 下面:TUICore注册事件,注册组件服务,注册界面拓展 + tui_core_1.TUICore.registerEvent(tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED, tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS, this); + tui_core_1.TUICore.registerService(tui_core_1.TUIConstants.TUICalling.SERVICE.NAME, this); + tui_core_1.TUICore.registerExtension(tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID, this); + } + static getInstance() { + if (!TUICallService.instance) { + TUICallService.instance = new TUICallService(); + } + return TUICallService.instance; + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (this._tuiCallEngine) + return; + // @ts-ignore + let { userID, tim, userSig, sdkAppID, SDKAppID, isFromChat } = params; + if (this._TUICore) { + sdkAppID = this._TUICore.SDKAppID; + tim = this._TUICore.tim; + } + this._tim = tim; + console.log(`${index_1.NAME.PREFIX}init sdkAppId: ${sdkAppID || SDKAppID}, userId: ${userID}`); + this._tuiCallEngine = tuicall_engine_wx_1.TUICallEngine.createInstance({ + tim, + // @ts-ignore + sdkAppID: sdkAppID || SDKAppID, + callkitVersion: version, + chat: isFromChat || false, + }); + this._addListenTuiCallEngineEvent(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, { userId: userID }); + yield this._tuiCallEngine.login({ userID, userSig, assetsPath: '' }); // web && mini + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}init failed, error: ${error}.`); + throw error; + } + }); + } + // component destroy + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + try { + const currentCallStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (currentCallStatus !== index_1.CallStatus.IDLE) { + throw new Error(`please destroyed when status is idle, current status: ${currentCallStatus}`); + } + if (this._tuiCallEngine) { + this._removeListenTuiCallEngineEvent(); + yield this._tuiCallEngine.destroyInstance(); + this._tuiCallEngine = null; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}destroyed failed, error: ${error}.`); + throw error; + } + }); + } + // ===============================【通话操作】=============================== + call(callParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { type, userID } = callParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + yield this._updateCallStoreBeforeCall(type, [{ userId: userID }]); + this._executeExternalBeforeCalling(); // 执行外部传入的 beforeCall 方法 + const response = yield this._tuiCallEngine.call(callParams); + yield this._updateCallStoreAfterCall([userID], response); + } + catch (error) { + this._handleCallError(error, 'call'); + } + }); + } + ; + groupCall(groupCallParams) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList, type, groupID } = groupCallParams; + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS) !== index_1.CallStatus.IDLE) + return; + const remoteUserInfoList = userIDList.map(userId => ({ userId })); + yield this._updateCallStoreBeforeCall(type, remoteUserInfoList, groupID); + this._executeExternalBeforeCalling(); + const response = yield this._tuiCallEngine.groupCall(groupCallParams); + yield this._updateCallStoreAfterCall(userIDList, response); + } + catch (error) { + this._handleCallError(error, 'groupCall'); + } + }); + } + inviteUser(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { userIDList } = params; + let inviteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(userIDList, this.getTim(), TUIStore); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, [...remoteUserInfoList, ...inviteUserInfoList]); + this._tuiCallEngine && (yield this._tuiCallEngine.inviteUser(params)); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}inviteUser failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + joinInGroupCall(params) { + return __awaiter(this, void 0, void 0, function* () { + try { + const updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: true, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CONNECTED, + [index_1.NAME.CALL_MEDIA_TYPE]: params.type, + [index_1.NAME.GROUP_ID]: params.groupID, + [index_1.NAME.ROOM_ID]: params.roomID, + }; + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const response = yield this._tuiCallEngine.joinInGroupCall(params); + (params.type === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response); + this.setSoundMode(params.type === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}joinInGroupCall failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + }); + } + // ===============================【其它对外接口】=============================== + getTUICallEngineInstance() { + return (this === null || this === void 0 ? void 0 : this._tuiCallEngine) || null; + } + setLogLevel(level) { + var _a; + (_a = this === null || this === void 0 ? void 0 : this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.setLogLevel(level); + } + setLanguage(language) { + if (language && Object.values(index_1.LanguageType).includes(language)) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LANGUAGE, language); + } + } + enableFloatWindow(enable) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ENABLE_FLOAT_WINDOW, enable); + } + setSelfInfo(params) { + return __awaiter(this, void 0, void 0, function* () { + const { nickName, avatar } = params; + try { + yield this._tuiCallEngine.setSelfInfo(nickName, avatar); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSelfInfo failed, error: ${error}.`); + } + }); + } + // 修改默认铃声:只支持本地铃声文件,不支持在线铃声文件;修改铃声修改的是被叫的铃声 + setCallingBell(filePath) { + return __awaiter(this, void 0, void 0, function* () { + let isCheckFileExist = true; + if (!isCheckFileExist) { + console.warn(`${index_1.NAME.PREFIX}setCallingBell failed, filePath: ${filePath}.`); + return; + } + const bellParams = { calleeBellFilePath: filePath }; + this._bellContext.setBellProperties(bellParams); + }); + } + enableMuteMode(enable) { + return __awaiter(this, void 0, void 0, function* () { + try { + const bellParams = { isMuteBell: enable }; + this._bellContext.setBellProperties(bellParams); + yield this._bellContext.setBellMute(enable); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}enableMuteMode failed, error: ${error}.`); + } + }); + } + // =============================【内部按钮操作方法】============================= + accept() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.accept(); + if (response) { + // 小程序接通时会进行授权弹框, 状态需要放在 accept 后, 否则先接通后再拉起权限设置 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + this._startTimer(); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini default open audio + } + } + catch (error) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + this._resetCallStore(); + } + }); + } + hangup() { + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.hangup(); + response === null || response === void 0 ? void 0 : response.forEach((item) => { + var _a; + if ((item === null || item === void 0 ? void 0 : item.code) === 0) { + this._callTUIService({ message: (_a = item === null || item === void 0 ? void 0 : item.data) === null || _a === void 0 ? void 0 : _a.message }); + } + }); + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + reject() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const response = yield this._tuiCallEngine.reject(); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + } + catch (error) { + console.debug(error); + } + this._resetCallStore(); + }); + } + openCamera(videoViewDomID) { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openCamera(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.VIDEO); + } + catch (error) { + this._noDevicePermissionToast(error, index_1.CallMediaType.VIDEO); + console.error(`${index_1.NAME.PREFIX}openCamera error: ${error}.`); + } + }); + } + closeCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeCamera(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.VIDEO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeCamera error: ${error}.`); + } + }); + } + openMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.openMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}openMicrophone failed, error: ${error}.`); + } + }); + } + closeMicrophone() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.closeMicrophone(); + this._setLocalUserInfoAudioVideoAvailable(false, index_1.NAME.AUDIO); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}closeMicrophone failed, error: ${error}.`); + } + }); + } + switchScreen(userId) { + if (!userId) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.BIG_SCREEN_USER_ID, userId); + } + // support video to audio; not support audio to video + switchCallMediaType() { + var _a; + return __awaiter(this, void 0, void 0, function* () { + try { + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (callMediaType === index_1.CallMediaType.AUDIO) { + console.warn(`${index_1.NAME.PREFIX}switchCallMediaType failed, ${callMediaType} not support.`); + return; + } + const response = yield this._tuiCallEngine.switchCallMediaType(index_1.CallMediaType.AUDIO); + if ((response === null || response === void 0 ? void 0 : response.code) === 0) { + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, index_1.CallMediaType.AUDIO); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const oldStatus = isGroup ? index_1.StatusChange.CALLING_GROUP_VIDEO : index_1.StatusChange.CALLING_C2C_VIDEO; + const newStatus = (0, utils_1.generateStatusChangeText)(TUIStore); + this.statusChanged && this.statusChanged({ oldStatus, newStatus }); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}switchCallMediaType failed, error: ${error}.`); + } + }); + } + switchCamera() { + return __awaiter(this, void 0, void 0, function* () { + try { + yield this._tuiCallEngine.switchCamera(); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}_switchCamera failed, error: ${error}.`); + } + }); + } + setSoundMode(type) { + var _a; + try { + let isEarPhone = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE); + const soundMode = type || (isEarPhone ? index_1.AudioPlayBackDevice.SPEAKER : index_1.AudioPlayBackDevice.EAR); // UI 层切换时传参数 + (_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.selectAudioPlaybackDevice(soundMode); + if (type) { + isEarPhone = type === index_1.AudioPlayBackDevice.EAR; + } + else { + isEarPhone = !isEarPhone; + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_EAR_PHONE, isEarPhone); + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}setSoundMode failed, error: ${error}.`); + } + } + // 切前后置 miniProgram, 切扬声器 + getTim() { + var _a, _b; + if (this._tim) + return this._tim; + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}getTim warning: _tuiCallEngine Instance is not available.`); + return null; + } + return ((_a = this._tuiCallEngine) === null || _a === void 0 ? void 0 : _a.tim) || ((_b = this._tuiCallEngine) === null || _b === void 0 ? void 0 : _b.getTim()); // mini support getTim interface + } + // ==========================【TUICallEngine 事件处理】========================== + _addListenTuiCallEngineEvent() { + if (!this._tuiCallEngine) { + console.warn(`${index_1.NAME.PREFIX}add engine event listener failed, engine is empty.`); + return; + } + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.ERROR, this._handleError, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived, this); // 收到邀请事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept, this); // 主叫收到被叫接通事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter, this); // 有用户进房事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave, this); // 有用户离开通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject, this); // 主叫收到被叫的拒绝通话事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse, this); // 主叫收到被叫的无应答事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy, this); // 主叫收到被叫的忙线事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel, this); // 主被叫在通话未建立时, 收到的取消事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady, this); // SDK Ready 回调 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut, this); // 未开启多端登录时, 多端登录收到的被踢事件 + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe, this); + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd, this); // 主被叫在通话结束时, 收到的通话结束事件 + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange, this); + // @ts-ignore + this._tuiCallEngine.on(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate, this); // mini: user data update + } + _removeListenTuiCallEngineEvent() { + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.ERROR, this._handleError); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.INVITED, this._handleNewInvitationReceived); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ACCEPT, this._handleUserAccept); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_ENTER, this._handleUserEnter); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_LEAVE, this._handleUserLeave); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.REJECT, this._handleInviteeReject); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.NO_RESP, this._handleNoResponse); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.LINE_BUSY, this._handleLineBusy); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALLING_CANCEL, this._handleCallingCancel); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.SDK_READY, this._handleSDKReady); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.KICKED_OUT, this._handleKickedOut); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.MESSAGE_SENT_BY_ME, this._messageSentByMe); + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_END, this._handleCallingEnd); + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.CALL_MODE, this._handleCallTypeChange); // 切换通话事件 miniProgram CALL_MODE + // @ts-ignore + this._tuiCallEngine.off(tuicall_engine_wx_1.EVENT.USER_UPDATE, this._handleUserUpdate); // mini: user data update + } + _handleError(event) { + const { code, message } = event || {}; + const index = Object.values(index_1.ErrorCode).indexOf(code); + let callTips = ''; + if (index !== -1) { + const key = Object.keys(index_1.ErrorCode)[index]; + callTips = (0, index_2.t)(index_1.ErrorMessage[key]); + callTips && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text: callTips, type: index_1.NAME.ERROR }); + } + this._executeExternalAfterCalling(); + console.error(`${index_1.NAME.PREFIX}_handleError, errorCode: ${code}; errorMessage: ${callTips || message}.`); + } + _handleNewInvitationReceived(event) { + return __awaiter(this, void 0, void 0, function* () { + console.log(`${index_1.NAME.PREFIX}onCallReceived event data: ${JSON.stringify(event)}.`); + const { sponsor = '', isFromGroup, callMediaType, inviteData = {}, calleeIdList = [], groupID = '' } = this._analyzeEventData(event); + const currentUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + const remoteUserIdList = [sponsor, ...calleeIdList.filter((userId) => userId !== currentUserInfo.userId)]; + const type = callMediaType || inviteData.callType; + const callTipsKey = type === index_1.CallMediaType.AUDIO ? index_2.CallTips.CALLEE_CALLING_AUDIO_MSG : index_2.CallTips.CALLEE_CALLING_VIDEO_MSG; + let updateStoreParams = { + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLEE, + [index_1.NAME.IS_GROUP]: isFromGroup, + [index_1.NAME.CALL_STATUS]: index_1.CallStatus.CALLING, + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(callTipsKey), + [index_1.NAME.CALLER_USER_INFO]: { userId: sponsor }, + [index_1.NAME.GROUP_ID]: groupID, + }; + (0, miniProgram_1.initAndCheckRunEnv)(); + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + this._executeExternalBeforeCalling(); + this.statusChanged && this.statusChanged({ oldStatus: index_1.StatusChange.IDLE, newStatus: index_1.StatusChange.BE_INVITED }); + const remoteUserInfoList = yield (0, utils_1.getRemoteUserProfile)(remoteUserIdList, this.getTim(), TUIStore); + const [userInfo] = remoteUserInfoList.filter((userInfo) => userInfo.userId === sponsor); + remoteUserInfoList.length > 0 && TUIStore.updateStore({ + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.CALLER_USER_INFO]: { + userId: sponsor, + nick: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.nick) || '', + avatar: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.avatar) || '', + }, + }, index_1.StoreName.CALL); + }); + } + _handleUserAccept(event) { + this._callerChangeToConnected(); + console.log(`${index_1.NAME.PREFIX}accept event data: ${JSON.stringify(event)}.`); + } + _handleUserEnter(event) { + return __awaiter(this, void 0, void 0, function* () { + this._callerChangeToConnected(); + const { userID: userId, data } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const isInRemoteUserList = remoteUserInfoList.find(item => (item === null || item === void 0 ? void 0 : item.userId) === userId); + if (!isInRemoteUserList) { + remoteUserInfoList.push({ userId }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + const [userInfo] = yield (0, utils_1.getRemoteUserProfile)([userId], this.getTim(), TUIStore); + remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + remoteUserInfoList.forEach((obj) => { + if ((obj === null || obj === void 0 ? void 0 : obj.userId) === userId) { + obj = Object.assign(obj, userInfo); + } + }); + } + remoteUserInfoList = remoteUserInfoList.map((obj) => { + if (obj.userId === userId) + obj.isEnter = true; + return obj; + }); + remoteUserInfoList.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + console.log(`${index_1.NAME.PREFIX}userEnter event data: ${JSON.stringify(event)}.`); + }); + } + _callerChangeToConnected() { + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.CALLING && callRole === index_1.CallRole.CALLER) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CONNECTED); + this._startTimer(); + } + } + _handleUserLeave(event) { + console.log(`${index_1.NAME.PREFIX}userLeave event data: ${JSON.stringify(event)}.`); + const { data, userID: userId } = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + if (TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP)) { + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + const text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.END_CALL, prefix); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + } + userId && this._deleteRemoteUser([userId]); + } + _unNormalEventsManager(event, eventName) { + console.log(`${index_1.NAME.PREFIX}${eventName} event data: ${JSON.stringify(event)}.`); + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + const remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + switch (eventName) { + case tuicall_engine_wx_1.EVENT.REJECT: + case tuicall_engine_wx_1.EVENT.LINE_BUSY: { + const { userID: userId } = this._analyzeEventData(event); + let callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.OTHER_SIDE_REJECT_CALL : index_2.CallTips.OTHER_SIDE_LINE_BUSY; + let text = (0, utils_1.generateText)(TUIStore, callTipsKey); + if (isGroup) { + const prefix = (remoteUserInfoList.find(obj => obj.userId === userId) || {}).displayUserInfo || userId; + callTipsKey = eventName === tuicall_engine_wx_1.EVENT.REJECT ? index_2.CallTips.REJECT_CALL : index_2.CallTips.IN_BUSY; + text = (0, utils_1.generateText)(TUIStore, callTipsKey, prefix); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userId && this._deleteRemoteUser([userId]); + break; + } + case tuicall_engine_wx_1.EVENT.NO_RESP: { + const { userIDList = [] } = this._analyzeEventData(event); + const callTipsKey = isGroup ? index_2.CallTips.TIMEOUT : index_2.CallTips.CALL_TIMEOUT; + const userInfoList = userIDList.map(userId => { + const userInfo = remoteUserInfoList.find(obj => obj.userId === userId) || {}; + return userInfo.displayUserInfo || userId; + }); + const text = isGroup ? (0, utils_1.generateText)(TUIStore, callTipsKey, userInfoList.join()) : (0, utils_1.generateText)(TUIStore, callTipsKey); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text }); + userIDList.length > 0 && this._deleteRemoteUser(userIDList); + break; + } + case tuicall_engine_wx_1.EVENT.CALLING_CANCEL: { + // TUIStore.update(StoreName.CALL, NAME.TOAST_INFO, { text: generateText(TUIStore, CallTips.CANCEL) }); + this._resetCallStore(); + break; + } + } + } + _handleInviteeReject(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.REJECT); + } + _handleNoResponse(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.NO_RESP); + } + _handleLineBusy(event) { + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.LINE_BUSY); + } + _handleCallingCancel(event) { + this._executeExternalAfterCalling(); + this._unNormalEventsManager(event, tuicall_engine_wx_1.EVENT.CALLING_CANCEL); + } + _handleCallingEnd(event) { + console.log(`${index_1.NAME.PREFIX}callEnd event data: ${JSON.stringify(event)}.`); + this._executeExternalAfterCalling(); + this._resetCallStore(); + } + // SDK_READY 后才能调用 tim 接口, 否则登录后立刻获取导致调用接口失败. v2.27.4+、v3 接口 login 后会抛出 SDK_READY + _handleSDKReady(event) { + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + localUserInfo = yield (0, utils_1.getMyProfile)(localUserInfo.userId, this.getTim(), TUIStore); // 方法里已经 try...catch 了 + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + }); + } + _handleKickedOut(event) { + console.log(`${index_1.NAME.PREFIX}kickOut event data: ${JSON.stringify(event)}.`); + this.kickedOut && this.kickedOut(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_TIPS, (0, utils_1.generateText)(TUIStore, index_2.CallTips.KICK_OUT)); + this._resetCallStore(); + } + _handleCallTypeChange(event) { + const { newCallType, type } = this._analyzeEventData(event); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE, newCallType || type); + this.setSoundMode(index_1.AudioPlayBackDevice.EAR); + } + _messageSentByMe(event) { + const message = event === null || event === void 0 ? void 0 : event.data; + this.onMessageSentByMe && this.onMessageSentByMe(message); + } + // ==========================【 miniProgram 私有事件】========================== + _handleUserUpdate(event) { + const data = this._analyzeEventData(event); + (data === null || data === void 0 ? void 0 : data.pusher) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, data.pusher); + (data === null || data === void 0 ? void 0 : data.playerList) && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PLAYER, data.playerList); + } + // 处理 “呼叫” 抛出的异常 + _handleCallError(error, methodName) { + if ((0, common_utils_1.handleRepeatedCallError)(error)) + return; + (0, miniProgram_1.handlePackageError)(error); // 无套餐提示, 小程序 engine 不抛出 onError + this._noDevicePermissionToast(error, index_1.CallMediaType.AUDIO); + console.error(`${index_1.NAME.PREFIX}${methodName} failed, error: ${error}.`); + this._resetCallStore(); + throw error; + } + setCallback(params) { + const { beforeCalling, afterCalling, onMinimized, onMessageSentByMe, kickedOut, statusChanged } = params; + beforeCalling && (this.beforeCalling = beforeCalling); + afterCalling && (this.afterCalling = afterCalling); + onMinimized && (this.onMinimized = onMinimized); + onMessageSentByMe && (this.onMessageSentByMe = onMessageSentByMe); + kickedOut && (this.kickedOut = kickedOut); + statusChanged && (this.statusChanged = statusChanged); + } + toggleMinimize() { + const isMinimized = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_MINIMIZED, !isMinimized); + console.log(`${index_1.NAME.PREFIX}toggleMinimize: ${isMinimized} -> ${!isMinimized}.`); + this.onMinimized && this.onMinimized(isMinimized, !isMinimized); + } + _executeExternalBeforeCalling() { + this.beforeCalling && this.beforeCalling(); + } + _executeExternalAfterCalling() { + this.afterCalling && this.afterCalling(); + } + // ========================【TUICallKit 组件属性设置方法】======================== + setVideoDisplayMode(displayMode) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DISPLAY_MODE, displayMode); + } + setVideoResolution(resolution) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (!resolution) + return; + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.VIDEO_RESOLUTION, resolution); + yield this._tuiCallEngine.setVideoQuality(resolution); + } + catch (error) { + console.warn(`${index_1.NAME.PREFIX}setVideoResolution failed, error: ${error}.`); + } + }); + } + // =========================【 miniProgram 私有公共方法】========================= + // 处理用户异常退出的情况,处理了右滑退出,以及返回退出的情况。 + _handleExceptionExit() { + return __awaiter(this, void 0, void 0, function* () { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + const callRole = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_ROLE); + // 在呼叫状态下, 被叫调用 reject,主叫调用 hangup + if (callStatus === index_1.CallStatus.CALLING) { + callRole === index_1.CallRole.CALLER && (yield this.hangup()); + callRole === index_1.CallRole.CALLEE && (yield this.reject()); + } + // 在通话状态下, 统一调用 hangup 接口 + callStatus === index_1.CallStatus.CONNECTED && (yield this.hangup()); + }); + } + _setLocalUserInfoAudioVideoAvailable(isAvailable, type) { + let localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + if (type === index_1.NAME.AUDIO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isAudioAvailable: isAvailable }); + } + if (type === index_1.NAME.VIDEO) { + localUserInfo = Object.assign(Object.assign({}, localUserInfo), { isVideoAvailable: isAvailable }); + } + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, localUserInfo); + } + _updateCallStoreBeforeCall(type, remoteUserInfoList, groupID) { + return __awaiter(this, void 0, void 0, function* () { + let updateStoreParams = { + [index_1.NAME.CALL_MEDIA_TYPE]: type, + [index_1.NAME.CALL_ROLE]: index_1.CallRole.CALLER, + [index_1.NAME.REMOTE_USER_INFO_LIST]: remoteUserInfoList, + [index_1.NAME.IS_GROUP]: !!groupID, + [index_1.NAME.CALL_TIPS]: (0, index_2.t)(index_2.CallTips.CALLER_CALLING_MSG), + [index_1.NAME.GROUP_ID]: groupID + }; + const pusher = { enableCamera: type === index_1.CallMediaType.VIDEO, enableMic: true }; // mini 默认打开麦克风 + updateStoreParams = Object.assign(Object.assign({}, updateStoreParams), { [index_1.NAME.PUSHER]: pusher }); + TUIStore.updateStore(updateStoreParams, index_1.StoreName.CALL); + const callStatus = yield (0, miniProgram_1.beforeCall)(type, this); // 如果没有权限, 此时为 false. 因此需要在 call 后设置为 calling. 和 web 存在差异 + console.log(`${index_1.NAME.PREFIX}mini beforeCall return callStatus: ${callStatus}.`); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, callStatus); + const remoteUserInfoLists = yield (0, utils_1.getRemoteUserProfile)(remoteUserInfoList.map(obj => obj.userId), this.getTim(), TUIStore); + remoteUserInfoLists.length > 0 && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoLists); + }); + } + _updateCallStoreAfterCall(userIdList, response) { + var _a; + return __awaiter(this, void 0, void 0, function* () { + if (response) { + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.IS_CLICKABLE, true); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.ROOM_ID, response.roomID); + this._callTUIService({ message: (_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.message }); + response.pusher && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.PUSHER, response.pusher); + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + (callMediaType === index_1.CallMediaType.VIDEO) && (yield this.openCamera(index_1.NAME.LOCAL_VIDEO)); + this.setSoundMode(callMediaType === index_1.CallMediaType.AUDIO ? index_1.AudioPlayBackDevice.EAR : index_1.AudioPlayBackDevice.SPEAKER); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS, index_1.CallStatus.CALLING); // 小程序未授权时, 此时状态为 idle; web 直接设置为 calling + const localUserInfo = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, localUserInfo), { isEnter: true })); + this._setLocalUserInfoAudioVideoAvailable(true, index_1.NAME.AUDIO); // web && mini, default open audio + } + else { + this._resetCallStore(); + } + }); + } + _resetCurrentDevice() { + // 挂断后,重置当前摄像头和麦克风为默认设备 + const { cameraList, microphoneList } = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.DEVICE_LIST, { microphoneList, cameraList, currentCamera: (cameraList === null || cameraList === void 0 ? void 0 : cameraList[0]) || {}, currentMicrophone: (microphoneList === null || microphoneList === void 0 ? void 0 : microphoneList[0]) || {} }); + } + _resetCallStore() { + const oldStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + this._stopTimer(); + // localUserInfo, language 在通话结束后不需要清除 + // callStatus 清除需要通知; isMinimized 也需要通知(basic-vue3 中切小窗关闭后, 再呼叫还是小窗, 因此需要通知到组件侧) + // isGroup 也不清除(engine 先抛 cancel 事件, 再抛 reject 事件) + // displayMode、videoResolution 也不能清除, 组件不卸载, 这些属性也需保留, 否则采用默认值. + // enableFloatWindow 不清除:开启/关闭悬浮窗功能。 + let notResetOrNotifyKeys = Object.keys(index_1.CALL_DATA_KEY).filter((key) => { + switch (index_1.CALL_DATA_KEY[key]) { + case index_1.NAME.CALL_STATUS: + case index_1.NAME.LANGUAGE: + case index_1.NAME.IS_GROUP: + case index_1.NAME.DISPLAY_MODE: + case index_1.NAME.VIDEO_RESOLUTION: + case index_1.NAME.ENABLE_FLOAT_WINDOW: + case index_1.NAME.LOCAL_USER_INFO: { + return false; + } + default: { + return true; + } + } + }); + notResetOrNotifyKeys = notResetOrNotifyKeys.map(key => index_1.CALL_DATA_KEY[key]); + TUIStore.reset(index_1.StoreName.CALL, notResetOrNotifyKeys); + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + callStatus !== index_1.CallStatus.IDLE && TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.CALL_STATUS], true); // callStatus reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_MINIMIZED], true); // isMinimized reset need notify + TUIStore.reset(index_1.StoreName.CALL, [index_1.NAME.IS_EAR_PHONE], true); // isEarPhone reset need notify + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO, Object.assign(Object.assign({}, TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO)), { isVideoAvailable: false, isAudioAvailable: false })); + this._resetCurrentDevice(); + const newStatusStr = (0, utils_1.generateStatusChangeText)(TUIStore); + if (oldStatusStr !== newStatusStr) { + this.statusChanged && this.statusChanged({ oldStatus: oldStatusStr, newStatus: newStatusStr }); + } + } + _noDevicePermissionToast(error, type) { + if ((0, common_utils_1.handleNoDevicePermissionError)(error)) { + let text = ''; + if (type === index_1.CallMediaType.AUDIO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_MICROPHONE_DEVICE_PERMISSION); + } + if (type === index_1.CallMediaType.VIDEO) { + text = (0, utils_1.generateText)(TUIStore, index_2.CallTips.NO_CAMERA_DEVICE_PERMISSION); + } + text && TUIStore.update(index_1.StoreName.CALL, index_1.NAME.TOAST_INFO, { text, type: index_1.NAME.ERROR }); + console.error(`${index_1.NAME.PREFIX}call failed, error: ${error.message}.`); + } + } + // 通话时长更新 + _startTimer() { + if (this._timerId === -1) { + this._timerId = timer_1.default.run(index_1.NAME.TIMEOUT, this._updateCallDuration.bind(this), { delay: 1000 }); + } + } + _updateCallDuration() { + let callDurationStr = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION); + const callDurationNum = (0, common_utils_1.formatTimeInverse)(callDurationStr); + callDurationStr = (0, common_utils_1.formatTime)(callDurationNum + 1); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.CALL_DURATION, callDurationStr); + } + _stopTimer() { + if (this._timerId !== -1) { + timer_1.default.clearTask(this._timerId); + this._timerId = -1; + } + } + _deleteRemoteUser(userIdList) { + if (userIdList.length === 0) + return; + let remoteUserInfoList = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); + userIdList.forEach((userId) => { + remoteUserInfoList = remoteUserInfoList.filter((obj) => obj.userId !== userId); + }); + TUIStore.update(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST, remoteUserInfoList); + } + _analyzeEventData(event) { + return (event === null || event === void 0 ? void 0 : event.data) || {}; // mini INVITED + } + // =========================【调用 chat api】========================= + // 获取群成员 + getGroupMemberList(count, offset) { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + let groupMemberList = yield (0, utils_1.getGroupMemberList)(groupID, this.getTim(), count, offset); + return groupMemberList; + }); + } + // 获取群信息 + getGroupProfile() { + return __awaiter(this, void 0, void 0, function* () { + const groupID = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.GROUP_ID); + return yield (0, utils_1.getGroupProfile)(groupID, this.getTim()); + }); + } + _watchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _unwatchTUIStore() { + TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + // =========================【web 融合 chat 提供的方法】========================= + bindTUICore(TUICore) { + this._TUICore = TUICore; + } + // 下面方法用于接入 TUICore + _callTUIService(params) { + const { message } = params || {}; + tui_core_1.TUICore.callService({ + serviceName: tui_core_1.TUIConstants.TUIChat.SERVICE.NAME, + method: tui_core_1.TUIConstants.TUIChat.SERVICE.METHOD.UPDATE_MESSAGE_LIST, + params: { message }, + }); + } + onNotifyEvent(eventName, subKey) { + return __awaiter(this, void 0, void 0, function* () { + try { + if (eventName === tui_core_1.TUIConstants.TUILogin.EVENT.LOGIN_STATE_CHANGED) { + if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS) { + // TUICallkit 收到登录成功时执行自己的业务逻辑处理 + // @ts-ignore + const { chat, userID, userSig, SDKAppID } = tui_core_1.TUILogin.getContext(); + yield this.init({ tim: chat, userID, userSig, sdkAppID: SDKAppID, isFromChat: true }); + } + else if (subKey === tui_core_1.TUIConstants.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS) { + yield this.destroyed(); + } + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}TUICore onNotifyEvent failed, error: ${error}.`); + } + }); + } + onCall(method, params) { + return __awaiter(this, void 0, void 0, function* () { + if (method === tui_core_1.TUIConstants.TUICalling.SERVICE.METHOD.START_CALL) { + yield this._handleTUICoreOnClick(params, params.type); + } + }); + } + _handleTUICoreOnClick(options, type) { + return __awaiter(this, void 0, void 0, function* () { + try { + const { groupID, userIDList = [] } = options, rest = __rest(options, ["groupID", "userIDList"]); + if (groupID) { + yield this.groupCall(Object.assign({ groupID, userIDList, type }, rest)); + } + else if (userIDList.length === 1) { + yield this.call(Object.assign({ userID: userIDList[0], type }, rest)); + } + } + catch (error) { + console.debug(error); + } + }); + } + onGetExtension(extensionID, params) { + if (extensionID === tui_core_1.TUIConstants.TUIChat.EXTENSION.INPUT_MORE.EXT_ID) { + const list = []; + const audioCallExtension = { + weight: 1000, + text: '语音通话', + icon: index_1.AudioCallIcon, + data: { + name: 'voiceCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.AUDIO); }), // 点击时发起通话 + }, + }; + const videoCallExtension = { + weight: 900, + text: '视频通话', + icon: index_1.VideoCallIcon, + data: { + name: 'videoCall', + }, + listener: { + onClicked: (options) => __awaiter(this, void 0, void 0, function* () { return yield this._handleTUICoreOnClick(options, options.type || index_1.CallMediaType.VIDEO); }), // 点击时发起通话 + }, + }; + if (!(params === null || params === void 0 ? void 0 : params.filterVoice)) { + list.push(audioCallExtension); + } + if (!(params === null || params === void 0 ? void 0 : params.filterVideo)) { + list.push(videoCallExtension); + } + return list; + } + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.init), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "init", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.call), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "call", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.groupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "groupCall", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.inviteUser), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "inviteUser", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.joinInGroupCall), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "joinInGroupCall", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setLanguage), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setLanguage", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableFloatWindow), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "enableFloatWindow", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setSelfInfo), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setSelfInfo", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setCallingBell), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setCallingBell", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.enableMuteMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Boolean]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "enableMuteMode", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "accept", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "hangup", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "reject", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "openMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "closeMicrophone", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "switchScreen", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCallMediaType", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", []), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "switchCamera", null); +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setSoundMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoDisplayMode), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", void 0) +], TUICallService.prototype, "setVideoDisplayMode", null); +__decorate([ + (0, index_3.paramValidate)(index_3.VALIDATE_PARAMS.setVideoResolution), + __metadata("design:type", Function), + __metadata("design:paramtypes", [String]), + __metadata("design:returntype", Promise) +], TUICallService.prototype, "setVideoResolution", null); +exports.default = TUICallService; diff --git a/TUIService/TUICallKit/TUICallService/CallService/miniProgram.d.ts b/TUIService/TUICallKit/TUICallService/CallService/miniProgram.d.ts new file mode 100644 index 0000000..bd5ede2 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/miniProgram.d.ts @@ -0,0 +1,6 @@ +import { CallMediaType, CallStatus } from '../const/index'; +export declare function initialUI(): void; +export declare function checkRunPlatform(): void; +export declare function initAndCheckRunEnv(): void; +export declare function beforeCall(type: CallMediaType, that: any): Promise; +export declare function handlePackageError(error: any): void; diff --git a/TUIService/TUICallKit/TUICallService/CallService/miniProgram.js b/TUIService/TUICallKit/TUICallService/CallService/miniProgram.js new file mode 100644 index 0000000..c279d08 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/miniProgram.js @@ -0,0 +1,76 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.handlePackageError = exports.beforeCall = exports.initAndCheckRunEnv = exports.checkRunPlatform = exports.initialUI = void 0; +const index_1 = require("../const/index"); +function initialUI() { + // 收起键盘 + // @ts-ignore + wx.hideKeyboard({ + complete: () => { }, + }); +} +exports.initialUI = initialUI; +; +// 检测运行时环境, 当是微信开发者工具时, 提示用户需要手机调试 +function checkRunPlatform() { + // @ts-ignore + const systemInfo = wx.getSystemInfoSync(); + if (systemInfo.platform === 'devtools') { + // 当前运行在微信开发者工具里 + // @ts-ignore + wx.showModal({ + icon: 'none', + title: '运行环境提醒', + content: '微信开发者工具不支持原生推拉流组件(即 标签),请使用真机调试或者扫码预览。', + showCancel: false, + }); + } +} +exports.checkRunPlatform = checkRunPlatform; +; +function initAndCheckRunEnv() { + initialUI(); // miniProgram 收起键盘, 隐藏 tabBar + checkRunPlatform(); // miniProgram 检测运行时环境 +} +exports.initAndCheckRunEnv = initAndCheckRunEnv; +function beforeCall(type, that) { + return __awaiter(this, void 0, void 0, function* () { + try { + initAndCheckRunEnv(); + // 检查设备权限 + const deviceMap = { + microphone: true, + camera: type === index_1.CallMediaType.VIDEO, + }; + const hasDevicePermission = yield that._tuiCallEngine.deviceCheck(deviceMap); // miniProgram 检查设备权限 + return hasDevicePermission ? index_1.CallStatus.CALLING : index_1.CallStatus.IDLE; + } + catch (error) { + console.debug(error); + return index_1.CallStatus.IDLE; + } + }); +} +exports.beforeCall = beforeCall; +// 套餐问题提示, 小程序最低需要群组通话版, 1v1 通话版本使用 TRTC 就会报错 +function handlePackageError(error) { + if ((error === null || error === void 0 ? void 0 : error.code) === -1002) { + // @ts-ignore + wx.showModal({ + icon: 'none', + title: 'error', + content: (error === null || error === void 0 ? void 0 : error.message) || '', + showCancel: false, + }); + } +} +exports.handlePackageError = handlePackageError; diff --git a/TUIService/TUICallKit/TUICallService/CallService/utils.d.ts b/TUIService/TUICallKit/TUICallService/CallService/utils.d.ts new file mode 100644 index 0000000..ee19134 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/utils.d.ts @@ -0,0 +1,9 @@ +import { IUserInfo } from '../interface/ICallService'; +import { ITUIStore } from '../interface/ITUIStore'; +export declare function setDefaultUserInfo(userId: string, domId?: string): IUserInfo; +export declare function getMyProfile(myselfUserId: string, tim: any, TUIStore: any): Promise; +export declare function getRemoteUserProfile(userIdList: Array, tim: any, TUIStore: any): Promise; +export declare function generateText(TUIStore: ITUIStore, key: string, prefix?: string, suffix?: string): string; +export declare function generateStatusChangeText(TUIStore: ITUIStore): string; +export declare function getGroupMemberList(groupID: string, tim: any, count: any, offset: any): Promise; +export declare function getGroupProfile(groupID: string, tim: any): Promise; diff --git a/TUIService/TUICallKit/TUICallService/CallService/utils.js b/TUIService/TUICallKit/TUICallService/CallService/utils.js new file mode 100644 index 0000000..0eaed04 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/CallService/utils.js @@ -0,0 +1,167 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.getGroupProfile = exports.getGroupMemberList = exports.generateStatusChangeText = exports.generateText = exports.getRemoteUserProfile = exports.getMyProfile = exports.setDefaultUserInfo = void 0; +const index_1 = require("../const/index"); +const index_2 = require("../locales/index"); +// 设置默认的 UserInfo 信息 +function setDefaultUserInfo(userId, domId) { + const userInfo = { + userId, + nick: '', + avatar: '', + remark: '', + displayUserInfo: '', + isAudioAvailable: false, + isVideoAvailable: false, + isEnter: false, + domId: domId || userId, + }; + return domId ? userInfo : Object.assign(Object.assign({}, userInfo), { isEnter: false }); // localUserInfo 没有 isEnter, remoteUserInfoList 有 isEnter +} +exports.setDefaultUserInfo = setDefaultUserInfo; +// 获取个人用户信息 +function getMyProfile(myselfUserId, tim, TUIStore) { + var _a, _b, _c; + return __awaiter(this, void 0, void 0, function* () { + let localUserInfo = setDefaultUserInfo(myselfUserId, index_1.NAME.LOCAL_VIDEO); + try { + if (!tim) + return localUserInfo; + const res = yield tim.getMyProfile(); + const currentLocalUserInfo = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.LOCAL_USER_INFO); // localUserInfo may have been updated + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + localUserInfo = Object.assign(Object.assign(Object.assign({}, localUserInfo), currentLocalUserInfo), { userId: (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.userID, nick: (_b = res === null || res === void 0 ? void 0 : res.data) === null || _b === void 0 ? void 0 : _b.nick, avatar: (_c = res === null || res === void 0 ? void 0 : res.data) === null || _c === void 0 ? void 0 : _c.avatar }); + } + return localUserInfo; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getMyProfile failed, error: ${error}.`); + return localUserInfo; + } + }); +} +exports.getMyProfile = getMyProfile; +// 获取远端用户列表信息 +function getRemoteUserProfile(userIdList, tim, TUIStore) { + return __awaiter(this, void 0, void 0, function* () { + let remoteUserInfoList = userIdList.map((userId) => setDefaultUserInfo(userId)); + try { + if (!tim) + return remoteUserInfoList; + const res = yield tim.getFriendProfile({ userIDList: userIdList }); + if (res.code === 0) { + const { friendList = [], failureUserIDList = [] } = res.data; + let unFriendList = failureUserIDList.map((obj) => obj.userID); + if (failureUserIDList.length > 0) { + const res = yield tim.getUserProfile({ userIDList: failureUserIDList.map((obj) => obj.userID) }); + if ((res === null || res === void 0 ? void 0 : res.code) === 0) { + unFriendList = (res === null || res === void 0 ? void 0 : res.data) || []; + } + } + const currentRemoteUserInfoList = TUIStore === null || TUIStore === void 0 ? void 0 : TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.REMOTE_USER_INFO_LIST); // remoteUserInfoList may have been updated + const tempFriendIdList = friendList.map((obj) => obj.userID); + const tempUnFriendIdList = unFriendList.map((obj) => obj.userID); + remoteUserInfoList = userIdList.map((userId) => { + var _a, _b, _c, _d, _e, _f, _g; + const defaultUserInfo = setDefaultUserInfo(userId); + const friendListIndex = tempFriendIdList.indexOf(userId); + const unFriendListIndex = tempUnFriendIdList.indexOf(userId); + let remark = ''; + let nick = ''; + let displayUserInfo = ''; + let avatar = ''; + if (friendListIndex !== -1) { + remark = ((_a = friendList[friendListIndex]) === null || _a === void 0 ? void 0 : _a.remark) || ''; + nick = ((_c = (_b = friendList[friendListIndex]) === null || _b === void 0 ? void 0 : _b.profile) === null || _c === void 0 ? void 0 : _c.nick) || ''; + displayUserInfo = remark || nick || defaultUserInfo.userId || ''; + avatar = ((_e = (_d = friendList[friendListIndex]) === null || _d === void 0 ? void 0 : _d.profile) === null || _e === void 0 ? void 0 : _e.avatar) || ''; + } + if (unFriendListIndex !== -1) { + nick = ((_f = unFriendList[unFriendListIndex]) === null || _f === void 0 ? void 0 : _f.nick) || ''; + displayUserInfo = nick || defaultUserInfo.userId || ''; + avatar = ((_g = unFriendList[unFriendListIndex]) === null || _g === void 0 ? void 0 : _g.avatar) || ''; + } + const userInfo = currentRemoteUserInfoList.find(subObj => subObj.userId === userId) || {}; + return Object.assign(Object.assign(Object.assign({}, defaultUserInfo), userInfo), { remark, nick, displayUserInfo, avatar }); + }); + } + return remoteUserInfoList; + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getRemoteUserProfile failed, error: ${error}.`); + return remoteUserInfoList; + } + }); +} +exports.getRemoteUserProfile = getRemoteUserProfile; +// 生成弹框提示文案 +function generateText(TUIStore, key, prefix, suffix) { + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + let callTips = `${(0, index_2.t)(key)}`; + if (isGroup) { + callTips = prefix ? `${prefix} ${callTips}` : callTips; + callTips = suffix ? `${callTips} ${suffix}` : callTips; + } + return callTips; +} +exports.generateText = generateText; +// 生成 statusChange 抛出的字符串 +function generateStatusChangeText(TUIStore) { + const callStatus = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_STATUS); + if (callStatus === index_1.CallStatus.IDLE) { + return index_1.StatusChange.IDLE; + } + const isGroup = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.IS_GROUP); + if (callStatus === index_1.CallStatus.CALLING) { + return isGroup ? index_1.StatusChange.DIALING_GROUP : index_1.StatusChange.DIALING_C2C; + } + const callMediaType = TUIStore.getData(index_1.StoreName.CALL, index_1.NAME.CALL_MEDIA_TYPE); + if (isGroup) { + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_GROUP_AUDIO : index_1.StatusChange.CALLING_GROUP_VIDEO; + } + return callMediaType === index_1.CallMediaType.AUDIO ? index_1.StatusChange.CALLING_C2C_AUDIO : index_1.StatusChange.CALLING_C2C_VIDEO; +} +exports.generateStatusChangeText = generateStatusChangeText; +// 获取群组[offset, count + offset]区间成员 +function getGroupMemberList(groupID, tim, count, offset) { + return __awaiter(this, void 0, void 0, function* () { + let groupMemberList = []; + try { + const res = yield tim.getGroupMemberList({ groupID, count, offset }); + if (res.code === 0) { + return res.data.memberList || groupMemberList; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupMember failed, error: ${error}.`); + return groupMemberList; + } + }); +} +exports.getGroupMemberList = getGroupMemberList; +// 获取 IM 群信息 +function getGroupProfile(groupID, tim) { + return __awaiter(this, void 0, void 0, function* () { + let groupProfile = {}; + try { + const res = yield tim.getGroupProfile({ groupID }); + if (res.code === 0) { + return res.data.group || groupProfile; + } + } + catch (error) { + console.error(`${index_1.NAME.PREFIX}getGroupProfile failed, error: ${error}.`); + return groupProfile; + } + }); +} +exports.getGroupProfile = getGroupProfile; diff --git a/TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts b/TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts new file mode 100644 index 0000000..81b787d --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.d.ts @@ -0,0 +1,21 @@ +import { ITUIGlobal } from '../interface/ITUIGlobal'; +export default class TUIGlobal implements ITUIGlobal { + static instance: TUIGlobal; + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + constructor(); + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance(): TUIGlobal; + initEnv(): void; + initOfficial(SDKAppID: number): void; +} diff --git a/TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js b/TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js new file mode 100644 index 0000000..049ac74 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/TUIGlobal/tuiGlobal.js @@ -0,0 +1,40 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const env_1 = require("../utils/env"); +class TUIGlobal { + constructor() { + this.global = env_1.APP_NAMESPACE; + this.isPC = false; + this.isH5 = false; + this.isWeChat = false; + this.isApp = false; + this.isUniPlatform = false; + this.isOfficial = false; + this.isWIN = false; + this.isMAC = false; + this.initEnv(); + } + /** + * 获取 TUIGlobal 实例 + * @returns {TUIGlobal} + */ + static getInstance() { + if (!TUIGlobal.instance) { + TUIGlobal.instance = new TUIGlobal(); + } + return TUIGlobal.instance; + } + initEnv() { + this.isPC = env_1.IS_PC; + this.isH5 = env_1.IS_H5; + this.isWeChat = env_1.IN_WX_MINI_APP; + this.isApp = env_1.IN_UNI_NATIVE_APP && !env_1.IN_WX_MINI_APP; // uniApp 打包小程序时 IN_UNI_NATIVE_APP 为 true,所以此处需要增加条件 + this.isUniPlatform = env_1.IN_UNI_APP; + this.isWIN = env_1.IS_WIN; + this.isMAC = env_1.IS_MAC; + } + initOfficial(SDKAppID) { + this.isOfficial = (SDKAppID === 1400187352 || SDKAppID === 1400188366); + } +} +exports.default = TUIGlobal; diff --git a/TUIService/TUICallKit/TUICallService/TUIStore/callStore.d.ts b/TUIService/TUICallKit/TUICallService/TUIStore/callStore.d.ts new file mode 100644 index 0000000..b9ada5a --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/TUIStore/callStore.d.ts @@ -0,0 +1,8 @@ +import { ICallStore } from '../interface/ICallStore'; +export default class CallStore { + defaultStore: ICallStore; + store: ICallStore; + update(key: keyof ICallStore, data: any): void; + getData(key: string | undefined): any; + reset(keyList?: Array): void; +} diff --git a/TUIService/TUICallKit/TUICallService/TUIStore/callStore.js b/TUIService/TUICallKit/TUICallService/TUIStore/callStore.js new file mode 100644 index 0000000..8ac66ef --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/TUIStore/callStore.js @@ -0,0 +1,62 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const common_utils_1 = require("../utils/common-utils"); +class CallStore { + constructor() { + this.defaultStore = { + callStatus: index_1.CallStatus.IDLE, + callRole: index_1.CallRole.UNKNOWN, + callMediaType: index_1.CallMediaType.UNKNOWN, + localUserInfo: { userId: '' }, + remoteUserInfoList: [], + callerUserInfo: { userId: '' }, + isGroup: false, + callDuration: '00:00:00', + callTips: '', + toastInfo: { text: '' }, + isMinimized: false, + enableFloatWindow: false, + bigScreenUserId: '', + language: (0, common_utils_1.getLanguage)(), + isClickable: false, + deviceList: { cameraList: [], microphoneList: [], currentCamera: {}, currentMicrophone: {} }, + showPermissionTip: false, + groupID: '', + roomID: 0, + // TUICallKit 组件上的属性 + displayMode: index_1.VideoDisplayMode.COVER, + videoResolution: index_1.VideoResolution.RESOLUTION_480P, + showSelectUser: false, + // 小程序相关属性 + pusher: {}, + player: [], + isEarPhone: false, // 是否是听筒, 默认: false + }; + this.store = Object.assign({}, this.defaultStore); + } + ; + update(key, data) { + switch (key) { + // case 'callTips': + // break; + default: + // resolve "Type 'any' is not assignable to type 'never'.ts", ref: https://github.com/microsoft/TypeScript/issues/31663 + this.store[key] = data; + } + } + getData(key) { + if (!key) + return this.store; + return this.store[key]; + } + // reset call store + reset(keyList = []) { + if (keyList.length === 0) { + keyList = Object.keys(this.store); + } + const resetToDefault = keyList.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: this.defaultStore[key] })), {}); + this.store = Object.assign(Object.assign(Object.assign({}, this.defaultStore), this.store), resetToDefault); + } +} +exports.default = CallStore; diff --git a/TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts b/TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts new file mode 100644 index 0000000..964ae33 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.d.ts @@ -0,0 +1,50 @@ +import { ITUIStore, IOptions, Task } from '../interface/ITUIStore'; +import { StoreName } from '../const/index'; +export default class TUIStore implements ITUIStore { + static instance: TUIStore; + task: Task; + private storeMap; + private timerId; + constructor(); + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance(): TUIStore; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName: StoreName, options: IOptions): void; + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName: StoreName, key: string): any; + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + private notify; + reset(storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean): void; + updateStore(params: any, name?: StoreName): void; +} diff --git a/TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.js b/TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.js new file mode 100644 index 0000000..7acaa59 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/TUIStore/tuiStore.js @@ -0,0 +1,155 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = require("../const/index"); +const callStore_1 = __importDefault(require("./callStore")); +const common_utils_1 = require("../utils/common-utils"); +class TUIStore { + constructor() { + this.timerId = -1; + this.storeMap = { + [index_1.StoreName.CALL]: new callStore_1.default(), + }; + // todo 此处后续优化结构后调整 + this.task = {}; // 保存监听回调列表 + } + /** + * 获取 TUIStore 实例 + * @returns {TUIStore} + */ + static getInstance() { + if (!TUIStore.instance) { + TUIStore.instance = new TUIStore(); + } + return TUIStore.instance; + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围, 'all' - 通知所有注册该 key 的监听; 'myself' - 通知本次注册该 key 的监听; 默认不通知 + */ + watch(storeName, options, params) { + if (!this.task[storeName]) { + this.task[storeName] = {}; + } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + const callback = options[key]; + if (!watcher[key]) { + watcher[key] = new Map(); + } + watcher[key].set(callback, 1); + const { notifyRangeWhenWatch } = params || {}; + // 注册监听后, 通知所有注册该 key 的监听,使用 'all' 时要特别注意是否对其他地方的监听产生影响 + if (notifyRangeWhenWatch === index_1.NAME.ALL) { + this.notify(storeName, key); + } + // 注册监听后, 仅通知自己本次监听该 key 的数据 + if (notifyRangeWhenWatch === index_1.NAME.MYSELF) { + const data = this.getData(storeName, key); + callback.call(this, data); + } + }); + } + /** + * UI 取消组件监听回调 + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回掉等 + */ + unwatch(storeName, options) { + // todo 该接口暂未支持,unwatch掉同一类,如仅传入store注销掉该store下的所有callback,同样options仅传入key注销掉该key下的所有callback + // options的callback function为必填参数,后续修改 + if (!this.task[storeName]) { + return; + } + ; + // if (isString(options)) { + // // 移除所有的监听 + // if (options === '*') { + // const watcher = this.task[storeName]; + // Object.keys(watcher).forEach(key => { + // watcher[key].clear(); + // }); + // } else { + // console.warn(`${NAME.PREFIX}unwatch warning: options is ${options}`); + // } + // return; + // } + const watcher = this.task[storeName]; + Object.keys(options).forEach((key) => { + watcher[key].delete(options[key]); + }); + } + /** + * 通用 store 数据更新,messageList 的变更需要单独处理 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + * @param {unknown} data 变更的数据 + */ + update(storeName, key, data) { + var _a; + // 基本数据类型时, 如果相等, 就不进行更新, 减少不必要的 notify + if ((0, common_utils_1.isString)(data) || (0, common_utils_1.isNumber)(data) || (0, common_utils_1.isBoolean)(data)) { + const currentData = this.storeMap[storeName]['store'][key]; // eslint-disable-line + if (currentData === data) + return; + } + (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.update(key, data); + this.notify(storeName, key); + } + /** + * 获取 Store 数据 + * @param {StoreName} storeName store 名称 + * @param {string} key 待获取的 key + * @returns {Any} + */ + getData(storeName, key) { + var _a; + return (_a = this.storeMap[storeName]) === null || _a === void 0 ? void 0 : _a.getData(key); + } + /** + * UI 组件注册监听回调 + * @param {StoreName} storeName store 名称 + * @param {string} key 变更的 key + */ + notify(storeName, key) { + if (!this.task[storeName]) { + return; + } + const watcher = this.task[storeName]; + if (watcher[key]) { + const callbackMap = watcher[key]; + const data = this.getData(storeName, key); + for (const [callback] of callbackMap.entries()) { + callback.call(this, data); + } + } + } + reset(storeName, keyList = [], isNotificationNeeded = false) { + if (storeName in this.storeMap) { + const store = this.storeMap[storeName]; + // reset all + if (keyList.length === 0) { + keyList = Object.keys(store === null || store === void 0 ? void 0 : store.store); + } + store.reset(keyList); + if (isNotificationNeeded) { + keyList.forEach((key) => { + this.notify(storeName, key); + }); + } + } + } + // 批量修改多个 key-value + updateStore(params, name) { + const storeName = name ? name : index_1.StoreName.CALL; + Object.keys(params).forEach((key) => { + this.update(storeName, key, params[key]); + }); + } +} +exports.default = TUIStore; diff --git a/TUIService/TUICallKit/TUICallService/const/call.d.ts b/TUIService/TUICallKit/TUICallService/const/call.d.ts new file mode 100644 index 0000000..8af20c4 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/call.d.ts @@ -0,0 +1,93 @@ +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +export declare enum StoreName { + CALL = "call", + CUSTOM = "custom" +} +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallMediaType { + UNKNOWN = 0, + AUDIO = 1, + VIDEO = 2 +} +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +export declare enum CallRole { + UNKNOWN = "unknown", + CALLEE = "callee", + CALLER = "caller" +} +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +export declare enum CallStatus { + IDLE = "idle", + CALLING = "calling", + CONNECTED = "connected" +} +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +export declare enum VideoDisplayMode { + CONTAIN = "contain", + COVER = "cover", + FILL = "fill" +} +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +export declare enum VideoResolution { + RESOLUTION_480P = "480p", + RESOLUTION_720P = "720p", + RESOLUTION_1080P = "1080p" +} +export declare enum LanguageType { + EN = "en", + 'ZH-CN' = "zh-cn", + JA_JP = "ja_JP" +} +export type TDeviceList = { + cameraList: any[]; + microphoneList: any[]; + currentCamera: any; + currentMicrophone: any; +}; +export declare const StatusChange: { + readonly IDLE: "idle"; + readonly BE_INVITED: "be-invited"; + readonly DIALING_C2C: "dialing-c2c"; + readonly DIALING_GROUP: "dialing-group"; + readonly CALLING_C2C_AUDIO: "calling-c2c-audio"; + readonly CALLING_C2C_VIDEO: "calling-c2c-video"; + readonly CALLING_GROUP_AUDIO: "calling-group-audio"; + readonly CALLING_GROUP_VIDEO: "calling-group-video"; +}; +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +export declare enum AudioPlayBackDevice { + EAR = "ear", + SPEAKER = "speaker" +} +export declare enum DeviceType { + MICROPHONE = "microphone", + CAMERA = "camera" +} diff --git a/TUIService/TUICallKit/TUICallService/const/call.js b/TUIService/TUICallKit/TUICallService/const/call.js new file mode 100644 index 0000000..e6a9f63 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/call.js @@ -0,0 +1,104 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.DeviceType = exports.AudioPlayBackDevice = exports.StatusChange = exports.LanguageType = exports.VideoResolution = exports.VideoDisplayMode = exports.CallStatus = exports.CallRole = exports.CallMediaType = exports.StoreName = void 0; +/** + * @property {String} call 1v1 通话 + 群组通话 + * @property {String} CUSTOM 自定义 Store +*/ +var StoreName; +(function (StoreName) { + StoreName["CALL"] = "call"; + StoreName["CUSTOM"] = "custom"; +})(StoreName = exports.StoreName || (exports.StoreName = {})); +/** + * @property {String} idle 空闲 + * @property {String} connecting 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallMediaType; +(function (CallMediaType) { + CallMediaType[CallMediaType["UNKNOWN"] = 0] = "UNKNOWN"; + CallMediaType[CallMediaType["AUDIO"] = 1] = "AUDIO"; + CallMediaType[CallMediaType["VIDEO"] = 2] = "VIDEO"; +})(CallMediaType = exports.CallMediaType || (exports.CallMediaType = {})); +/** + * @property {String} caller 主叫 + * @property {String} callee 被叫 +*/ +var CallRole; +(function (CallRole) { + CallRole["UNKNOWN"] = "unknown"; + CallRole["CALLEE"] = "callee"; + CallRole["CALLER"] = "caller"; +})(CallRole = exports.CallRole || (exports.CallRole = {})); +/** + * @property {String} idle 空闲 + * @property {String} calling 呼叫等待中 + * @property {String} connected 通话中 +*/ +var CallStatus; +(function (CallStatus) { + CallStatus["IDLE"] = "idle"; + CallStatus["CALLING"] = "calling"; + CallStatus["CONNECTED"] = "connected"; +})(CallStatus = exports.CallStatus || (exports.CallStatus = {})); +/** + * 视频画面显示模式 + * 播放视频流默认使用 cover 模式; 播放屏幕共享流默认使用 contain 模式。 + * @property {String} contain 优先保证视频内容全部显示。视频尺寸等比缩放,直至视频窗口的一边与视窗边框对齐。如果视频尺寸与显示视窗尺寸不一致,在保持长宽比的前提下,将视频进行缩放后填满视窗,缩放后的视频四周会有一圈黑边。 + * @property {String} cover 优先保证视窗被填满。视频尺寸等比缩放,直至整个视窗被视频填满。如果视频长宽与显示窗口不同,则视频流会按照显示视窗的比例进行周边裁剪或图像拉伸后填满视窗 + * @property {String} fill 保证视窗被填满的同时保证视频内容全部显示,但是不保证视频尺寸比例不变。视频的宽高会被拉伸至和视窗尺寸一致。(该选项值自 v4.12.1 开始支持) +*/ +var VideoDisplayMode; +(function (VideoDisplayMode) { + VideoDisplayMode["CONTAIN"] = "contain"; + VideoDisplayMode["COVER"] = "cover"; + VideoDisplayMode["FILL"] = "fill"; +})(VideoDisplayMode = exports.VideoDisplayMode || (exports.VideoDisplayMode = {})); +/** + * 视频分辨率 + * @property {String} 480p + * @property {String} 720p + * @property {String} 1080p +*/ +var VideoResolution; +(function (VideoResolution) { + VideoResolution["RESOLUTION_480P"] = "480p"; + VideoResolution["RESOLUTION_720P"] = "720p"; + VideoResolution["RESOLUTION_1080P"] = "1080p"; +})(VideoResolution = exports.VideoResolution || (exports.VideoResolution = {})); +// 支持的语言 +var LanguageType; +(function (LanguageType) { + LanguageType["EN"] = "en"; + LanguageType["ZH-CN"] = "zh-cn"; + LanguageType["JA_JP"] = "ja_JP"; +})(LanguageType = exports.LanguageType || (exports.LanguageType = {})); +/* === 【原来 TUICallKit 对外暴露】=== */ +// 原来 web callKit 定义通知外部状态变更的变量, 对外暴露 +exports.StatusChange = { + IDLE: "idle", + BE_INVITED: "be-invited", + DIALING_C2C: "dialing-c2c", + DIALING_GROUP: "dialing-group", + CALLING_C2C_AUDIO: "calling-c2c-audio", + CALLING_C2C_VIDEO: "calling-c2c-video", + CALLING_GROUP_AUDIO: "calling-group-audio", + CALLING_GROUP_VIDEO: "calling-group-video", +}; +/* === 【小程序使用】=== */ +/** + * @property {String} ear 听筒 + * @property {String} speaker 免提 +*/ +var AudioPlayBackDevice; +(function (AudioPlayBackDevice) { + AudioPlayBackDevice["EAR"] = "ear"; + AudioPlayBackDevice["SPEAKER"] = "speaker"; +})(AudioPlayBackDevice = exports.AudioPlayBackDevice || (exports.AudioPlayBackDevice = {})); +; +var DeviceType; +(function (DeviceType) { + DeviceType["MICROPHONE"] = "microphone"; + DeviceType["CAMERA"] = "camera"; +})(DeviceType = exports.DeviceType || (exports.DeviceType = {})); diff --git a/TUIService/TUICallKit/TUICallService/const/error.d.ts b/TUIService/TUICallKit/TUICallService/const/error.d.ts new file mode 100644 index 0000000..000d4a0 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/error.d.ts @@ -0,0 +1,2 @@ +export declare const ErrorCode: any; +export declare const ErrorMessage: any; diff --git a/TUIService/TUICallKit/TUICallService/const/error.js b/TUIService/TUICallKit/TUICallService/const/error.js new file mode 100644 index 0000000..1449c3c --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/error.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorMessage = exports.ErrorCode = void 0; +// 错误码 +exports.ErrorCode = { + SWITCH_TO_AUDIO_CALL_FAILED: 60001, + SWITCH_TO_VIDEO_CALL_FAILED: 60002, + MICROPHONE_UNAVAILABLE: 60003, + CAMERA_UNAVAILABLE: 60004, + BAN_DEVICE: 60005, + NOT_SUPPORTED_WEBRTC: 60006, + ERROR_BLACKLIST: 20007, +}; +exports.ErrorMessage = { + SWITCH_TO_AUDIO_CALL_FAILED: 'switchToAudioCall-call-failed', + SWITCH_TO_VIDEO_CALL_FAILED: 'switchToVideoCall-call-failed', + MICROPHONE_UNAVAILABLE: 'microphone-unavailable', + CAMERA_UNAVAILABLE: 'camera-unavailable', + BAN_DEVICE: 'ban-device', + NOT_SUPPORTED_WEBRTC: 'not-supported-webrtc', + ERROR_BLACKLIST: 'blacklist-user-tips' +}; diff --git a/TUIService/TUICallKit/TUICallService/const/index.d.ts b/TUIService/TUICallKit/TUICallService/const/index.d.ts new file mode 100644 index 0000000..a81bc31 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/index.d.ts @@ -0,0 +1,12 @@ +export * from './call'; +export * from './error'; +export * from './log'; +export declare const CALL_DATA_KEY: any; +export declare const NAME: any; +export declare const AudioCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call.png"; +export declare const VideoCallIcon = "https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg"; +export declare const MAX_NUMBER_ROOM_ID = 2147483647; +export declare enum PLATFORM { + MAC = "mac", + WIN = "win" +} diff --git a/TUIService/TUICallKit/TUICallService/const/index.js b/TUIService/TUICallKit/TUICallService/const/index.js new file mode 100644 index 0000000..3ca1e32 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/index.js @@ -0,0 +1,60 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PLATFORM = exports.MAX_NUMBER_ROOM_ID = exports.VideoCallIcon = exports.AudioCallIcon = exports.NAME = exports.CALL_DATA_KEY = void 0; +__exportStar(require("./call"), exports); +__exportStar(require("./error"), exports); +__exportStar(require("./log"), exports); +// import { keys } from 'ts-transformer-keys'; +// import { ICallStore } from '../interface/store'; +// console.warn('--> ', keys()) +exports.CALL_DATA_KEY = { + CALL_STATUS: 'callStatus', + CALL_ROLE: 'callRole', + CALL_MEDIA_TYPE: 'callMediaType', + LOCAL_USER_INFO: 'localUserInfo', + REMOTE_USER_INFO_LIST: 'remoteUserInfoList', + CALLER_USER_INFO: 'callerUserInfo', + IS_GROUP: 'isGroup', + CALL_DURATION: 'callDuration', + CALL_TIPS: 'callTips', + TOAST_INFO: 'toastInfo', + IS_MINIMIZED: 'isMinimized', + ENABLE_FLOAT_WINDOW: 'enableFloatWindow', + BIG_SCREEN_USER_ID: 'bigScreenUserId', + LANGUAGE: 'language', + IS_CLICKABLE: 'isClickable', + DISPLAY_MODE: 'displayMode', + VIDEO_RESOLUTION: 'videoResolution', + PUSHER: 'pusher', + PLAYER: 'player', + IS_EAR_PHONE: 'isEarPhone', + SHOW_PERMISSION_TIP: 'SHOW_PERMISSION_TIP', + GROUP_ID: 'groupID', + ROOM_ID: 'roomID', + SHOW_SELECT_USER: 'showSelectUser', +}; +exports.NAME = Object.assign({ PREFIX: '【CallService】', AUDIO: 'audio', VIDEO: 'video', LOCAL_VIDEO: 'localVideo', ERROR: 'error', TIMEOUT: 'timeout', RAF: 'raf', INTERVAL: 'interval', DEFAULT: 'default', BOOLEAN: 'boolean', STRING: 'string', NUMBER: 'number', OBJECT: 'object', ARRAY: 'array', FUNCTION: 'function', UNDEFINED: "undefined", ALL: 'all', MYSELF: 'myself', DEVICE_LIST: 'deviceList' }, exports.CALL_DATA_KEY); +exports.AudioCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call.png'; +exports.VideoCallIcon = 'https://web.sdk.qcloud.com/component/TUIKit/assets/call-video-reverse.svg'; +exports.MAX_NUMBER_ROOM_ID = 2147483647; +var PLATFORM; +(function (PLATFORM) { + // eslint-disable-next-line no-unused-vars + PLATFORM["MAC"] = "mac"; + // eslint-disable-next-line no-unused-vars + PLATFORM["WIN"] = "win"; +})(PLATFORM = exports.PLATFORM || (exports.PLATFORM = {})); diff --git a/TUIService/TUICallKit/TUICallService/const/log.d.ts b/TUIService/TUICallKit/TUICallService/const/log.d.ts new file mode 100644 index 0000000..d265832 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/log.d.ts @@ -0,0 +1,7 @@ +export declare enum LOG_LEVEL { + NORMAL = 0, + RELEASE = 1, + WARNING = 2, + ERROR = 3, + NONE = 4 +} diff --git a/TUIService/TUICallKit/TUICallService/const/log.js b/TUIService/TUICallKit/TUICallService/const/log.js new file mode 100644 index 0000000..44c05fc --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/const/log.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.LOG_LEVEL = void 0; +/* eslint-disable */ +// 唯一一个变量格式有问题的, 但是为了和原来 TUICallKit 对外暴露的保持一致 +var LOG_LEVEL; +(function (LOG_LEVEL) { + LOG_LEVEL[LOG_LEVEL["NORMAL"] = 0] = "NORMAL"; + LOG_LEVEL[LOG_LEVEL["RELEASE"] = 1] = "RELEASE"; + LOG_LEVEL[LOG_LEVEL["WARNING"] = 2] = "WARNING"; + LOG_LEVEL[LOG_LEVEL["ERROR"] = 3] = "ERROR"; + LOG_LEVEL[LOG_LEVEL["NONE"] = 4] = "NONE"; +})(LOG_LEVEL = exports.LOG_LEVEL || (exports.LOG_LEVEL = {})); diff --git a/TUIService/TUICallKit/TUICallService/index.d.ts b/TUIService/TUICallKit/TUICallService/index.d.ts new file mode 100644 index 0000000..fc8bcff --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/index.d.ts @@ -0,0 +1,5 @@ +import TUICallService, { TUIGlobal, TUIStore } from './CallService/index'; +import { StoreName, NAME, CallRole, CallMediaType, CallStatus, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice } from './const/index'; +import { t } from './locales/index'; +declare const TUICallKitServer: TUICallService; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, CallStatus, CallRole, CallMediaType, StatusChange, VideoResolution, VideoDisplayMode, AudioPlayBackDevice, t, }; diff --git a/TUIService/TUICallKit/TUICallService/index.js b/TUIService/TUICallKit/TUICallService/index.js new file mode 100644 index 0000000..4c86f2e --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/index.js @@ -0,0 +1,44 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.AudioPlayBackDevice = exports.VideoDisplayMode = exports.VideoResolution = exports.StatusChange = exports.CallMediaType = exports.CallRole = exports.CallStatus = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = __importStar(require("./CallService/index")); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +const index_2 = require("./const/index"); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_2.StoreName; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_2.NAME; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_2.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_2.CallMediaType; } }); +Object.defineProperty(exports, "CallStatus", { enumerable: true, get: function () { return index_2.CallStatus; } }); +Object.defineProperty(exports, "StatusChange", { enumerable: true, get: function () { return index_2.StatusChange; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_2.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_2.VideoDisplayMode; } }); +Object.defineProperty(exports, "AudioPlayBackDevice", { enumerable: true, get: function () { return index_2.AudioPlayBackDevice; } }); +const index_3 = require("./locales/index"); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_3.t; } }); +// 实例化 +const TUICallKitServer = index_1.default.getInstance(); +exports.TUICallKitServer = TUICallKitServer; diff --git a/TUIService/TUICallKit/TUICallService/interface/ICallService.d.ts b/TUIService/TUICallKit/TUICallService/interface/ICallService.d.ts new file mode 100644 index 0000000..2e6eff1 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ICallService.d.ts @@ -0,0 +1,93 @@ +import { CallStatus, CallRole } from '../const/index'; +/** + * @interface ITUICallService +*/ +export interface ITUICallService { + /** + * 初始化 Service + * @function + * @private + */ + init(params: any): void; + /** + * 1v1 通话 + * @function + * @param {SwitchUserStatusParams} options 用户状态控制参数 + */ + call(callParams: ICallParams): void; +} +type SDKAppID = { + SDKAppID: number; +} | { + sdkAppID: number; +}; +export interface IInitParamsBase { + userID: string; + userSig: string; + tim?: any; + isFromChat?: boolean; +} +export type IInitParams = IInitParamsBase & SDKAppID; +export interface ICallParams { + userID: string; + type: number; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IGroupCallParams { + userIDList: Array; + type: number; + groupID: string; + roomID?: number; + userData?: string; + timeout?: number; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IUserInfo { + userId: string; + nick?: string; + avatar?: string; + remark?: string; + displayUserInfo?: string; + isAudioAvailable?: boolean; + isVideoAvailable?: boolean; + volume?: number; + isEnter?: boolean; + domId?: string; +} +export interface IOfflinePushInfo { + title?: string; + description?: string; + androidOPPOChannelID?: string; + extension: String; +} +export interface ICallbackParam { + beforeCalling?: (...args: any[]) => void; + afterCalling?: (...args: any[]) => void; + onMinimized?: (...args: any[]) => void; + onMessageSentByMe?: (...args: any[]) => void; + kickedOut?: (...args: any[]) => void; + statusChanged?: (...args: any[]) => void; +} +export interface ISelfInfoParams { + nickName: string; + avatar: string; +} +export interface IBellParams { + callRole?: CallRole; + callStatus?: CallStatus; + isMuteBell?: boolean; + calleeBellFilePath?: string; +} +export interface IInviteUserParams { + userIDList: string[]; + offlinePushInfo?: IOfflinePushInfo; +} +export interface IJoinInGroupCallParams { + type: number; + groupID: string; + roomID: number; +} +export {}; diff --git a/TUIService/TUICallKit/TUICallService/interface/ICallService.js b/TUIService/TUICallKit/TUICallService/interface/ICallService.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ICallService.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUIService/TUICallKit/TUICallService/interface/ICallStore.d.ts b/TUIService/TUICallKit/TUICallService/interface/ICallStore.d.ts new file mode 100644 index 0000000..9dcd2e2 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ICallStore.d.ts @@ -0,0 +1,33 @@ +import { CallStatus, CallRole, CallMediaType, VideoDisplayMode, VideoResolution, TDeviceList } from '../const/index'; +import { IUserInfo } from './index'; +export interface IToastInfo { + text: string; + type?: string; +} +export interface ICallStore { + callStatus: CallStatus; + callRole: CallRole; + callMediaType: CallMediaType; + localUserInfo: IUserInfo; + remoteUserInfoList: Array; + callerUserInfo: IUserInfo; + isGroup: boolean; + callDuration: string; + callTips: string; + toastInfo: IToastInfo; + isMinimized: boolean; + enableFloatWindow: boolean; + bigScreenUserId: string; + language: string; + isClickable: boolean; + showPermissionTip: boolean; + deviceList: TDeviceList; + groupID: string; + roomID: number; + displayMode: VideoDisplayMode; + videoResolution: VideoResolution; + pusher: any; + player: any[]; + isEarPhone: boolean; + showSelectUser: boolean; +} diff --git a/TUIService/TUICallKit/TUICallService/interface/ICallStore.js b/TUIService/TUICallKit/TUICallService/interface/ICallStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ICallStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts b/TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts new file mode 100644 index 0000000..91b86ce --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.d.ts @@ -0,0 +1,36 @@ +/** + * @interface TUIGlobal + * @property {Object} global 根据运行环境代理 wx、uni、window + * @property {Boolean} isPC true 标识是 pc 网页 + * @property {Boolean} isH5 true 标识是 手机 H5 + * @property {Boolean} isWeChat true 标识是 微信小程序 + * @property {Boolean} isApp true 标识是 uniapp 打包的 native app + * @property {Boolean} isUniPlatform true 标识当前应用是通过 uniapp 平台打包的产物 + * @property {Boolean} isOfficial true 标识是腾讯云官网 Demo 应用 + * @property {Boolean} isWIN true 标识是window系统pc + * @property {Boolean} isMAC true 标识是mac os系统pc +*/ +export interface ITUIGlobal { + global: any; + isPC: boolean; + isH5: boolean; + isWeChat: boolean; + isApp: boolean; + isUniPlatform: boolean; + isOfficial: boolean; + isWIN: boolean; + isMAC: boolean; + /** + * 初始化 TUIGlobal 环境变量 + * @function + * @private + */ + initEnv(): void; + /** + * 初始化 isOfficial + * @function + * @param {number} SDKAppID 当前实例的应用 SDKAppID + * @private + */ + initOfficial(SDKAppID: number): void; +} diff --git a/TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.js b/TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ITUIGlobal.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUIService/TUICallKit/TUICallService/interface/ITUIStore.d.ts b/TUIService/TUICallKit/TUICallService/interface/ITUIStore.d.ts new file mode 100644 index 0000000..5784ffa --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ITUIStore.d.ts @@ -0,0 +1,75 @@ +import { StoreName } from '../const/index'; +export type Task = Record void, 1>>>; +export interface IOptions { + [key: string]: (newData?: any) => void; +} +/** + * @class TUIStore + * @property {ICustomStore} customStore 自定义 store,可根据业务需要通过以下 API 进行数据操作。 +*/ +export interface ITUIStore { + task: Task; + /** + * UI 组件注册监听 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options UI 组件注册的监听信息 + * @param {Object} params 扩展参数 + * @param {String} params.notifyRangeWhenWatch 注册时监听时的通知范围 + * @example + * // UI 层监听会话列表更新通知 + * let onConversationListUpdated = function(conversationList) { + * console.warn(conversationList); + * } + * TUIStore.watch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + watch(storeName: StoreName, options: IOptions, params?: any): void; + /** + * UI 组件取消监听回调 + * @function + * @param {StoreName} storeName store 名称 + * @param {IOptions} options 监听信息,包含需要取消的回调等 + * @example + * // UI 层取消监听会话列表更新通知 + * TUIStore.unwatch(StoreName.CONV, { + * conversationList: onConversationListUpdated, + * }) + */ + unwatch(storeName: StoreName, options: IOptions | string): void; + /** + * 获取 store 中的数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要获取的 key + * @private + */ + getData(storeName: StoreName, key: string): any; + /** + * 更新 store + * - 需要使用自定义 store 时可以用此 API 更新自定义数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {String} key 需要更新的 key + * @example + * // UI 层更新自定义 Store 数据 + * TUIStore.update(StoreName.CUSTOM, 'customKey', 'customData') + */ + update(storeName: StoreName, key: string, data: unknown): void; + /** + * 重置 store 内数据 + * @function + * @param {StoreName} storeName store 名称 + * @param {Array} keyList 需要 reset 的 keyList + * @param {boolean} isNotificationNeeded 是否需要触发更新 + * @private + */ + reset: (storeName: StoreName, keyList?: Array, isNotificationNeeded?: boolean) => void; + /** + * 修改多个 key-value + * @param {Object} params 多个 key-value 组成的 object + * @param {StoreName} storeName store 名称 + */ + updateStore: (params: any, name?: StoreName) => void; +} diff --git a/TUIService/TUICallKit/TUICallService/interface/ITUIStore.js b/TUIService/TUICallKit/TUICallService/interface/ITUIStore.js new file mode 100644 index 0000000..c8ad2e5 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/ITUIStore.js @@ -0,0 +1,2 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/TUIService/TUICallKit/TUICallService/interface/index.d.ts b/TUIService/TUICallKit/TUICallService/interface/index.d.ts new file mode 100644 index 0000000..5f8f48c --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/index.d.ts @@ -0,0 +1,4 @@ +export * from './ICallService'; +export * from './ICallStore'; +export * from './ITUIGlobal'; +export * from './ITUIStore'; diff --git a/TUIService/TUICallKit/TUICallService/interface/index.js b/TUIService/TUICallKit/TUICallService/interface/index.js new file mode 100644 index 0000000..ed699ff --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/interface/index.js @@ -0,0 +1,20 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./ICallService"), exports); +__exportStar(require("./ICallStore"), exports); +__exportStar(require("./ITUIGlobal"), exports); +__exportStar(require("./ITUIStore"), exports); diff --git a/TUIService/TUICallKit/TUICallService/locales/en.d.ts b/TUIService/TUICallKit/TUICallService/locales/en.d.ts new file mode 100644 index 0000000..c7efd74 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/en.d.ts @@ -0,0 +1,90 @@ +export declare const en: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'no response from the other side': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'no-user': string; + 'member-not-added': string; + 'input-phone-userID': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'Use-phone-and-computer': string; + 'Wechat scan right QR code': string; + 'Scan the QR code above': string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUIService/TUICallKit/TUICallService/locales/en.js b/TUIService/TUICallKit/TUICallService/locales/en.js new file mode 100644 index 0000000..9188607 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/en.js @@ -0,0 +1,93 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.en = void 0; +exports.en = { + 'hangup': 'Hang up', + 'reject': 'Decline', + 'other side reject call': 'other side reject call', + 'reject call': 'Reject Call', + 'accept': 'Accept', + 'cancel': 'Cancel Call', + 'other side line busy': 'other side line busy', + 'in busy': 'in busy', + 'call timeout': 'call timeout', + 'no response from the other side': 'no response from the other side', + 'end call': 'end call', + 'timeout': 'timeout', + 'kick out': 'kick out', + 'caller calling message': 'Waiting for the callee to accept the invitation...', + 'callee calling video message': 'You are invited to a video call...', + 'callee calling audio message': 'You are invited to a audio call...', + 'no microphone access': 'no microphone access', + 'no camera access': 'no camera access', + 'invite member': 'Invite Member', + 'speaker': 'speaker', + 'Invited group call': 'Invited you to a group call', + 'Those involved': 'Those involved in the call are', + 'call': 'call', + 'video-call': 'video call', + 'audio-call': 'audio call', + 'search': 'search', + 'search-result': 'search result', + 'no-user': 'user not found', + 'member-not-added': 'member not added', + 'input-phone-userID': 'phone number or userID', + 'not-login': 'not logged in', + 'login-status-expire': 'login status is invalid, please refresh the page and try again', + 'experience-multi-call': 'experience multi-person calls, please download the full-featured demo: ', + 'not-support-multi-call': 'multi-person call interface is not open', + 'userID': 'userID', + 'already-enter': 'entered the call', + 'waiting': 'Calling...', + 'camera-opened': 'Camera on', + 'camera-closed': 'Camera off', + 'microphone-opened': 'Mic on', + 'microphone-closed': 'Mic off', + 'camera': 'Camera', + 'microphone': 'Microphone', + 'image-resolution': 'Resolution', + 'default-image-resolution': 'Default', + 'invited-person': 'Invite', + 'video-to-audio': 'Switch to audio', + 'me': '(me)', + 'be-rejected': 'Call declined, ', + 'be-no-response': 'No response, ', + 'be-line-busy': 'Line busy, ', + 'be-canceled': 'The call is canceled, ', + 'voice-call-end': 'Voice call ended', + 'video-call-end': 'Video call ended', + 'method-call-failed': 'Failed to sync the operation', + 'failed-to-obtain-permission': 'Failed to obtain permissions', + 'environment-detection-failed': 'Failed to check the environment', + 'switchToAudioCall-call-failed': 'switch to audio call method failed', + 'switchToVideoCall-call-failed': 'switch to video call method failed', + 'microphone-unavailable': 'No mic found', + 'camera-unavailable': 'No camera found', + 'ban-device': 'Device access denied', + 'not-supported-webrtc': 'Your current environment does not support WebRTC', + 'blacklist-user-tips': 'The identifier is in blacklist. Failed to send this message!', + 'is-already-calling': 'TUICallKit is already on a call', + 'need-init': 'Before initiating a call with TUICallKit, ensure that the TUICallKitServer.init() method has executed successfully. ', + "can't call yourself": "Can't call yourself", + 'Use-phone-and-computer': 'Use your mobile phone and computer to experience video calls', + 'Wechat scan right QR code': 'Wechat scan right QR code', + 'Scan the QR code above': 'Scan the QR code above', + 'accept-error': 'Accept failed', + 'accept-device-error': 'Accept failed, unable to auth calling device', + 'call-error': 'Start call failed', + 'browser-authorization': 'Browser authorization', + 'mac-privacy': 'System Preferences -> Security and Privacy -> Privacy', + 'win-privacy': 'Setting -> Privacy and Security -> App permissions', + 'mac-preferences': 'Open System Preferences', + 'win-preferences': 'Open Setting', + 'open camera': 'Open Camera', + 'close camera': 'Close Camera', + 'open microphone': 'Open Microphone', + 'close microphone': 'Close Microphone', + 'Please enter userID': 'Please enter userID', + 'View more': 'View more', + 'people selected': 'people selected', + 'Select all': 'Select all', + 'Cancel': 'Cancel', + 'Done': 'Done', +}; diff --git a/TUIService/TUICallKit/TUICallService/locales/index.d.ts b/TUIService/TUICallKit/TUICallService/locales/index.d.ts new file mode 100644 index 0000000..afbb43d --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/index.d.ts @@ -0,0 +1,10 @@ +export declare const CallTips: any; +export declare const languageData: languageDataType; +export declare function t(key: any): string; +interface languageItemType { + [key: string]: string; +} +interface languageDataType { + [key: string]: languageItemType; +} +export {}; diff --git a/TUIService/TUICallKit/TUICallService/locales/index.js b/TUIService/TUICallKit/TUICallService/locales/index.js new file mode 100644 index 0000000..12a5316 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/index.js @@ -0,0 +1,51 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.languageData = exports.CallTips = void 0; +const index_1 = require("../CallService/index"); +const index_2 = require("../const/index"); +const en_1 = require("./en"); +const zh_cn_1 = require("./zh-cn"); +const ja_JP_1 = require("./ja_JP"); +exports.CallTips = { + OTHER_SIDE: 'other side', + CANCEL: 'cancel', + OTHER_SIDE_REJECT_CALL: 'other side reject call', + REJECT_CALL: 'reject call', + OTHER_SIDE_LINE_BUSY: 'other side line busy', + IN_BUSY: 'in busy', + CALL_TIMEOUT: 'call timeout', + END_CALL: 'end call', + TIMEOUT: 'timeout', + KICK_OUT: 'kick out', + CALLER_CALLING_MSG: 'caller calling message', + CALLEE_CALLING_VIDEO_MSG: 'callee calling video message', + CALLEE_CALLING_AUDIO_MSG: 'callee calling audio message', + NO_MICROPHONE_DEVICE_PERMISSION: 'no microphone access', + NO_CAMERA_DEVICE_PERMISSION: 'no camera access', +}; +exports.languageData = { + en: en_1.en, + 'zh-cn': zh_cn_1.zh, + ja_JP: ja_JP_1.ja_JP, +}; +// language translate +function t(key) { + var _a; + const language = index_1.TUIStore.getData(index_2.StoreName.CALL, index_2.NAME.LANGUAGE); + // eslint-disable-next-line + for (const langKey in exports.languageData) { + if (langKey === language) { + const currentLanguage = exports.languageData[langKey]; + // eslint-disable-next-line + for (const sentenceKey in currentLanguage) { + if (sentenceKey === key) { + return currentLanguage[sentenceKey]; + } + } + } + } + const enString = (_a = key['en']) === null || _a === void 0 ? void 0 : _a.key; // eslint-disable-line + console.error(`${index_2.NAME.PREFIX}translation is not found: ${key}.`); + return enString; +} +exports.t = t; diff --git a/TUIService/TUICallKit/TUICallService/locales/ja_JP.d.ts b/TUIService/TUICallKit/TUICallService/locales/ja_JP.d.ts new file mode 100644 index 0000000..d03dfc7 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/ja_JP.d.ts @@ -0,0 +1,85 @@ +export declare const ja_JP: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUIService/TUICallKit/TUICallService/locales/ja_JP.js b/TUIService/TUICallKit/TUICallService/locales/ja_JP.js new file mode 100644 index 0000000..ca52108 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/ja_JP.js @@ -0,0 +1,88 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ja_JP = void 0; +exports.ja_JP = { + 'hangup': '通話終了', + 'reject': '拒否', + 'other side reject call': '通話が拒否されました', + 'reject call': '通話拒否', + 'accept': '応答', + 'cancel': '通話をキャンセル', + 'other side line busy': '相手が通話中です', + 'in busy': '通話中', + 'call timeout': '呼び出しタイムアウト', + 'end call': '通話終了', + 'timeout': 'タイムアウト', + 'kick out': 'キックアウトされました', + 'caller calling message': '相手が招待を承諾するのを待っています。', + 'callee calling video message': 'ビデオ通話に招待されました。', + 'callee calling audio message': '音声通話に招待されました。', + 'no microphone access': 'マイクにアクセスできません', + 'no camera access': 'カメラにアクセスできません', + 'invite member': 'メンバーを招待する', + 'speaker': 'スピーカー', + 'Invited group call': 'グループ通話に招待されました。', + 'Those involved': '参加者:', + 'call': '通話', + 'video-call': 'ビデオ通話', + 'audio-call': '音声通話', + 'search': '検索', + 'search-result': '検索結果', + 'Wechat scan right QR code': 'WeChatで右側にあるQRコードを読み取ります。', + 'Use-phone-and-computer': '携帯電話とコンピュータを使用してビデオ通話を体験してください', + 'Scan the QR code above': '上のQRコードを読み取ります。', + 'no-user': 'ユーザーが見つかりませんでした', + 'member-not-added': 'メンバーが追加されていません', + 'not-login': 'ログインしていません', + 'login-status-expire': 'ログインの有効期限が過ぎています。ページを更新してもう一度お試しください', + 'experience-multi-call': '複数人で同時に音声通話できるグループ通話機能を体験するには、全機能のデモをダウンロードしてください', + 'not-support-multi-call': 'グループ通話インターフェイスが開いていません', + 'input-phone-userID': '携帯電話番号/ユーザーIDを入力してください', + 'userID': 'ユーザーID', + 'already-enter': 'すでに通話に参加しています', + 'waiting': '応答を待っています...', + 'camera-opened': 'カメラがオンになっています', + 'camera-closed': 'カメラがオフになっています', + 'microphone-opened': 'マイクがオンになっています', + 'microphone-closed': 'マイクがオフになっています', + 'camera': 'カメラ', + 'microphone': 'マイク', + 'image-resolution': '解像度', + 'default-image-resolution': 'デフォルト解像度', + 'invited-person': 'メンバーを招待', + 'video-to-audio': '音声通話に切り替えます', + 'me': '(自分)', + 'be-rejected': '通話が拒否されました, ', + 'be-no-response': '応答なし, ', + 'be-line-busy': '相手が通話中です, ', + 'be-canceled': '相手が通話をキャンセルしました', + 'voice-call-end': '音声通話が終了しました', + 'video-call-end': 'ビデオ通話が終了しました', + 'method-call-failed': '操作の同期に失敗しました', + 'failed-to-obtain-permission': '権限の取得に失敗しました', + 'environment-detection-failed': '環境の検出に失敗しました', + 'switchToAudioCall-call-failed': '音声通話に切り替えることはできません', + 'switchToVideoCall-call-failed': 'ビデオ通話に切り替えることはできません', + 'microphone-unavailable': '使用できるマイクがありません', + 'camera-unavailable': '使用できるカメラがありません', + 'ban-device': 'デバイスへのアクセスが拒否されました', + 'not-supported-webrtc': '現在の環境はWebRTCをサポートしていません', + 'blacklist-user-tips': 'ユーザーはブラックリストに登録され、通話が開始できませんでした', + 'is-already-calling': 'TUICallKit はすでに通話中です', + 'need-init': 'TUICallKitで通話を開始する前に、TUICallKitServer.init() メソッドが正常に実行されたことを確認してください。', + "can't call yourself": '自分に電話をかけることができません', + 'accept-error': '接続できませんでした', + 'accept-device-error': '接続できませんでした。発信側デバイスを認証できません', + 'call-error': '通話が開始できませんでした', + 'browser-authorization': 'ブラウザ認証', + 'mac-privacy': 'システム環境設定 -> セキュリティとプライバシー ->プライバシー', + 'win-privacy': '設定 -> セキュリティとプライバシー ->アプリのアクセス許可', + 'mac-preferences': 'システム環境設定を開く', + 'win-preferences': 'システム設定を開く', + 'Please enter userID': 'ユーザーIDを入力してください', + 'View more': 'もっと見る', + 'people selected': '人が選択されました', + 'Select all': 'すべて選択', + 'Cancel': 'キャンセル', + 'Done': '完了', +}; diff --git a/TUIService/TUICallKit/TUICallService/locales/zh-cn.d.ts b/TUIService/TUICallKit/TUICallService/locales/zh-cn.d.ts new file mode 100644 index 0000000..369b1c7 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/zh-cn.d.ts @@ -0,0 +1,89 @@ +export declare const zh: { + hangup: string; + reject: string; + 'other side reject call': string; + 'reject call': string; + accept: string; + cancel: string; + 'other side line busy': string; + 'in busy': string; + 'call timeout': string; + 'end call': string; + timeout: string; + 'kick out': string; + 'caller calling message': string; + 'callee calling video message': string; + 'callee calling audio message': string; + 'no microphone access': string; + 'no camera access': string; + 'invite member': string; + speaker: string; + 'Invited group call': string; + 'Those involved': string; + call: string; + 'video-call': string; + 'audio-call': string; + search: string; + 'search-result': string; + 'Wechat scan right QR code': string; + 'Use-phone-and-computer': string; + 'Scan the QR code above': string; + 'no-user': string; + 'member-not-added': string; + 'not-login': string; + 'login-status-expire': string; + 'experience-multi-call': string; + 'not-support-multi-call': string; + 'input-phone-userID': string; + userID: string; + 'already-enter': string; + waiting: string; + 'camera-opened': string; + 'camera-closed': string; + 'microphone-opened': string; + 'microphone-closed': string; + camera: string; + microphone: string; + 'image-resolution': string; + 'default-image-resolution': string; + 'invited-person': string; + 'video-to-audio': string; + me: string; + 'be-rejected': string; + 'be-no-response': string; + 'be-line-busy': string; + 'be-canceled': string; + 'voice-call-end': string; + 'video-call-end': string; + 'method-call-failed': string; + 'failed-to-obtain-permission': string; + 'environment-detection-failed': string; + 'switchToAudioCall-call-failed': string; + 'switchToVideoCall-call-failed': string; + 'microphone-unavailable': string; + 'camera-unavailable': string; + 'ban-device': string; + 'not-supported-webrtc': string; + 'blacklist-user-tips': string; + 'is-already-calling': string; + 'need-init': string; + "can't call yourself": string; + 'accept-error': string; + 'accept-device-error': string; + 'call-error': string; + 'browser-authorization': string; + 'mac-privacy': string; + 'win-privacy': string; + 'mac-preferences': string; + 'win-preferences': string; + 'open camera': string; + 'close camera': string; + 'open microphone': string; + 'close microphone': string; + 'Please enter userID': string; + 'View more': string; + 'people selected': string; + 'Select all': string; + Cancel: string; + Done: string; +}; diff --git a/TUIService/TUICallKit/TUICallService/locales/zh-cn.js b/TUIService/TUICallKit/TUICallService/locales/zh-cn.js new file mode 100644 index 0000000..ac854ae --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/locales/zh-cn.js @@ -0,0 +1,92 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.zh = void 0; +exports.zh = { + 'hangup': '挂断', + 'reject': '拒绝', + 'other side reject call': '对方已拒绝', + 'reject call': '拒绝通话', + 'accept': '接受', + 'cancel': '取消通话', + 'other side line busy': '对方忙线', + 'in busy': '正在忙', + 'call timeout': '呼叫超时', + 'end call': '结束通话', + 'timeout': '超时', + 'kick out': '被踢', + 'caller calling message': '正在等待对方接受邀请…', + 'callee calling video message': '邀请您进行视频通话…', + 'callee calling audio message': '邀请您进行语音通话…', + 'no microphone access': '没有麦克风权限', + 'no camera access': '没有摄像头权限', + 'invite member': '邀请成员', + 'speaker': '扬声器', + 'Invited group call': '邀请你参加多人通话', + 'Those involved': '参与通话的有:', + 'call': '通话', + 'video-call': '视频通话', + 'audio-call': '音频通话', + 'search': '搜索', + 'search-result': '搜索结果', + 'Wechat scan right QR code': '微信扫右二维码', + 'Use-phone-and-computer': '用手机与电脑互打体验视频通话', + 'Scan the QR code above': '扫描上方二维码', + 'no-user': '未搜索到用户', + 'member-not-added': '未添加成员', + 'not-login': '未登录', + 'login-status-expire': '登录状态已失效,请刷新网页重试', + 'experience-multi-call': '体验多人通话请下载全功能demo:', + 'not-support-multi-call': '多人通话接口未开放', + 'input-phone-userID': '请输入手机号/用户ID', + 'userID': '用户ID', + 'already-enter': '已经进入当前通话', + 'waiting': '等待接听...', + 'camera-opened': '摄像头已开', + 'camera-closed': '摄像头已关', + 'microphone-opened': '麦克风已开', + 'microphone-closed': '麦克风已关', + 'camera': '摄像头', + 'microphone': '麦克风', + 'image-resolution': '分辨率', + 'default-image-resolution': '默认分辨率', + 'invited-person': '添加成员', + 'video-to-audio': '切到语音通话', + 'me': '(我)', + 'be-rejected': '对方已拒绝,', + 'be-no-response': '对方无应答,', + 'be-line-busy': '对方忙线中,', + 'be-canceled': '对方已取消', + 'voice-call-end': '语音通话结束', + 'video-call-end': '视频通话结束', + 'method-call-failed': '同步操作失败', + 'failed-to-obtain-permission': '权限获取失败', + 'environment-detection-failed': '环境检测失败', + 'switchToAudioCall-call-failed': '切语音调用失败', + 'switchToVideoCall-call-failed': '切视频调用失败', + 'microphone-unavailable': '没有可用的麦克风设备', + 'camera-unavailable': '没有可用的摄像头设备', + 'ban-device': '用户禁止使用设备', + 'not-supported-webrtc': '当前环境不支持 WebRTC', + 'blacklist-user-tips': '发起通话失败,被对方拉入黑名单,禁止发起!', + 'is-already-calling': 'TUICallKit 已在通话状态', + 'need-init': 'TUICallKit 发起通话前需保证 TUICallKitServer.init() 方法执行成功', + "can't call yourself": '不能呼叫自己', + 'accept-error': '接通失败', + 'accept-device-error': '接通失败,通话设备获取失败', + 'call-error': '发起通话失败', + 'browser-authorization': '浏览器授权', + 'mac-privacy': '系统偏好设置 -> 安全与隐私 -> 隐私', + 'win-privacy': '设置 -> 隐私和安全性 -> 应用权限', + 'mac-preferences': '打开系统偏好设置', + 'win-preferences': '打开系统设置', + 'open camera': '打开摄像头', + 'close camera': '关闭摄像头', + 'open microphone': '打开麦克风', + 'close microphone': '关闭麦克风', + 'Please enter userID': '请输入 userID', + 'View more': '查看更多', + 'people selected': '人已选中', + 'Select all': '全选', + 'Cancel': '取消', + 'Done': '完成', +}; diff --git a/TUIService/TUICallKit/TUICallService/serve/callManager.d.ts b/TUIService/TUICallKit/TUICallService/serve/callManager.d.ts new file mode 100644 index 0000000..3474175 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/serve/callManager.d.ts @@ -0,0 +1,11 @@ +export declare class CallManager { + private _globalCallPagePath; + private _isPageRedirected; + init(params: any): Promise; + private _watchTUIStore; + private _unwatchTUIStore; + private _handleCallStatusChange; + private _handleCallStatusToCalling; + private _handleCallStatusToIdle; + destroyed(): Promise; +} diff --git a/TUIService/TUICallKit/TUICallService/serve/callManager.js b/TUIService/TUICallKit/TUICallService/serve/callManager.js new file mode 100644 index 0000000..7f4fbe5 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/serve/callManager.js @@ -0,0 +1,133 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.CallManager = void 0; +const index_1 = require("../../index"); +const index_2 = require("../const/index"); +const index_3 = require("../utils/validate/index"); +/** + * @param {Number} sdkAppID 用户的sdkAppID 必传 + * @param {String} userID 用户的userID 必传 + * @param {String} userSig 用户的userSig 必传 + * @param {String} globalCallPagePath 跳转的路径 必传 + * @param {ChatSDK} tim tim实例 非必传 + */ +const PREFIX = 'callManager'; +class CallManager { + constructor() { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._handleCallStatusChange = (value) => __awaiter(this, void 0, void 0, function* () { + switch (value) { + case index_2.CallStatus.CALLING: + case index_2.CallStatus.CONNECTED: + this._handleCallStatusToCalling(); + break; + case index_2.CallStatus.IDLE: + this._handleCallStatusToIdle(); + break; + } + }); + } + init(params) { + return __awaiter(this, void 0, void 0, function* () { + const { sdkAppID, userID, userSig, globalCallPagePath, tim } = params; + if (!globalCallPagePath) { + console.error(`${PREFIX} globalCallPagePath Can not be empty!`); + return; + } + ; + this._globalCallPagePath = globalCallPagePath; + try { + yield index_1.TUICallKitServer.init({ + sdkAppID, + userID, + userSig, + tim, + }); + this._watchTUIStore(); + // 全局监听下,关闭悬浮窗 + index_1.TUICallKitServer.enableFloatWindow(false); + console.log(`${PREFIX} init Ready!`); + } + catch (error) { + console.error(`${PREFIX} init fail!`); + } + }); + } + // =========================【监听 TUIStore 中的状态】========================= + _watchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.watch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }, { + notifyRangeWhenWatch: index_1.NAME.MYSELF, + }); + } + _unwatchTUIStore() { + index_1.TUIStore === null || index_1.TUIStore === void 0 ? void 0 : index_1.TUIStore.unwatch(index_1.StoreName.CALL, { + [index_1.NAME.CALL_STATUS]: this._handleCallStatusChange, + }); + } + _handleCallStatusToCalling() { + if (this._isPageRedirected) + return; + // @ts-ignore + wx.navigateTo({ + url: `/${this._globalCallPagePath}`, + success: () => { + this._isPageRedirected = true; + }, + fail: () => { + console.error(`${PREFIX} navigateTo fail!`); + }, + complete: () => { }, + }); + } + _handleCallStatusToIdle() { + if (!this._isPageRedirected) + return; + // @ts-ignore + wx.navigateBack({ + success: () => { + this._isPageRedirected = false; + }, + fail: () => { + console.error(`${PREFIX} navigateBack fail!`); + }, + complete: () => { }, + }); + } + // 卸载 callManger + destroyed() { + return __awaiter(this, void 0, void 0, function* () { + this._globalCallPagePath = ''; + this._isPageRedirected = false; + this._unwatchTUIStore(); + yield index_1.TUICallKitServer.destroyed(); + }); + } +} +__decorate([ + (0, index_3.avoidRepeatedCall)(), + __metadata("design:type", Function), + __metadata("design:paramtypes", [Object]), + __metadata("design:returntype", Promise) +], CallManager.prototype, "init", null); +exports.CallManager = CallManager; diff --git a/TUIService/TUICallKit/TUICallService/utils/common-utils.d.ts b/TUIService/TUICallKit/TUICallService/utils/common-utils.d.ts new file mode 100644 index 0000000..d9bfeaf --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/common-utils.d.ts @@ -0,0 +1,53 @@ +export declare const isUndefined: (input: any) => boolean; +export declare const isPlainObject: (input: any) => boolean; +export declare const isArray: (input: any) => boolean; +export declare const isPrivateKey: (key: string) => boolean; +export declare const isUrl: (url: string) => boolean; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +export declare const isString: (input: any) => boolean; +export declare const isBoolean: (input: any) => boolean; +export declare const isNumber: (input: any) => boolean; +export declare function formatTime(secondTime: number): string; +export declare function formatTimeInverse(stringTime: string): number; +export declare function isJSON(str: string): boolean; +export declare const JSONToObject: (str: string) => any; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +export declare const retryPromise: (promise: Promise, num?: number, time?: number) => Promise; +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleRepeatedCallError(error: any): boolean; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +export declare function handleNoDevicePermissionError(error: any): boolean; +export declare function performanceNow(): number; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +export declare const isFunction: (input: any) => boolean; +export declare const getLanguage: () => string; +export declare function noop(e: any): void; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +export declare const getType: (input: any) => any; +export declare function modifyObjectKey(obj: any, oldKey: any, newKey: any): any; diff --git a/TUIService/TUICallKit/TUICallService/utils/common-utils.js b/TUIService/TUICallKit/TUICallService/utils/common-utils.js new file mode 100644 index 0000000..53237d0 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/common-utils.js @@ -0,0 +1,249 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.modifyObjectKey = exports.getType = exports.noop = exports.getLanguage = exports.isFunction = exports.performanceNow = exports.handleNoDevicePermissionError = exports.handleRepeatedCallError = exports.retryPromise = exports.JSONToObject = exports.isJSON = exports.formatTimeInverse = exports.formatTime = exports.isNumber = exports.isBoolean = exports.isString = exports.isUrl = exports.isPrivateKey = exports.isArray = exports.isPlainObject = exports.isUndefined = void 0; +const index_1 = require("../const/index"); +const tuiGlobal_1 = __importDefault(require("../TUIGlobal/tuiGlobal")); +const isUndefined = function (input) { + return typeof input === index_1.NAME.UNDEFINED; +}; +exports.isUndefined = isUndefined; +const isPlainObject = function (input) { + // 注意不能使用以下方式判断,因为IE9/IE10下,对象的__proto__是 undefined + // return isObject(input) && input.__proto__ === Object.prototype; + if (typeof input !== index_1.NAME.OBJECT || input === null) { + return false; + } + const proto = Object.getPrototypeOf(input); + if (proto === null) { // edge case Object.create(null) + return true; + } + let baseProto = proto; + while (Object.getPrototypeOf(baseProto) !== null) { + baseProto = Object.getPrototypeOf(baseProto); + } + // 原型链第一个和最后一个比较 + return proto === baseProto; +}; +exports.isPlainObject = isPlainObject; +const isArray = function (input) { + if (typeof Array.isArray === index_1.NAME.FUNCTION) { + return Array.isArray(input); + } + return Object.prototype.toString.call(input).match(/^\[object (.*)\]$/)[1].toLowerCase() === index_1.NAME.ARRAY; +}; +exports.isArray = isArray; +const isPrivateKey = function (key) { + return key.startsWith('_'); +}; +exports.isPrivateKey = isPrivateKey; +const isUrl = function (url) { + return /^(https?:\/\/(([a-zA-Z0-9]+-?)+[a-zA-Z0-9]+\.)+[a-zA-Z]+)(:\d+)?(\/.*)?(\?.*)?(#.*)?$/.test(url); +}; +exports.isUrl = isUrl; +/** + * 检测input类型是否为string + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->string / false->not a string + */ +const isString = function (input) { + return typeof input === index_1.NAME.STRING; +}; +exports.isString = isString; +const isBoolean = function (input) { + return typeof input === index_1.NAME.BOOLEAN; +}; +exports.isBoolean = isBoolean; +const isNumber = function (input) { + return ( + // eslint-disable-next-line + input !== null && + ((typeof input === index_1.NAME.NUMBER && !isNaN(input - 0)) || (typeof input === index_1.NAME.OBJECT && input.constructor === Number))); +}; +exports.isNumber = isNumber; +function formatTime(secondTime) { + const hours = Math.floor(secondTime / 3600); + const minutes = Math.floor((secondTime % 3600) / 60); + const seconds = Math.floor(secondTime % 60); + let callDurationStr = hours > 9 ? `${hours}` : `0${hours}`; + callDurationStr += minutes > 9 ? `:${minutes}` : `:0${minutes}`; + callDurationStr += seconds > 9 ? `:${seconds}` : `:0${seconds}`; + return callDurationStr; +} +exports.formatTime = formatTime; +function formatTimeInverse(stringTime) { + const list = stringTime.split(':'); + return parseInt(list[0]) * 3600 + parseInt(list[1]) * 60 + parseInt(list[2]); // eslint-disable-line +} +exports.formatTimeInverse = formatTimeInverse; +// Determine if it is a JSON string +function isJSON(str) { + if (typeof str === index_1.NAME.STRING) { + try { + const data = JSON.parse(str); + if (data) { + return true; + } + return false; + } + catch (error) { + console.debug(error); + return false; + } + } + return false; +} +exports.isJSON = isJSON; +// Determine if it is a JSON string +const JSONToObject = function (str) { + if (!str || !isJSON(str)) { + return str; + } + return JSON.parse(str); +}; +exports.JSONToObject = JSONToObject; +/** + * 重试函数, catch 时,重试 + * @param {Promise} promise 需重试的函数 + * @param {number} num 需要重试的次数 + * @param {number} time 间隔时间(s) + * @returns {Promise} im 接口的 response 原样返回 + */ +const retryPromise = (promise, num = 6, time = 0.5) => { + let n = num; + const func = () => promise; + return func() + .catch((error) => { + if (n === 0) { + throw error; + } + const timer = setTimeout(() => { + func(); + clearTimeout(timer); + n = n - 1; + }, time * 1000); + }); +}; +exports.retryPromise = retryPromise; +// /** +// * 节流函数(目前 TUICallKit 增加防重调用装饰器,该方法可删除) +// * @param {Function} func 传入的函数 +// * @param {wait} time 间隔时间(ms) +// */ +// export const throttle = (func: Function, wait: number) => { +// let previousTime = 0; +// return function () { +// const now = Date.now(); +// const args = [...arguments]; +// if (now - previousTime > wait) { +// func.apply(this, args); +// previousTime = now; +// } +// }; +// } +/** + * web call engine 重复调用时的错误, 这种错误在 TUICallKit 应该忽略 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleRepeatedCallError(error) { + if ((error === null || error === void 0 ? void 0 : error.message.indexOf('is ongoing, please avoid repeated calls')) !== -1) { + return true; + } + return false; +} +exports.handleRepeatedCallError = handleRepeatedCallError; +/** + * 设备无权限时的错误处理 + * @param {any} error 错误信息 + * @returns {Boolean} + */ +function handleNoDevicePermissionError(error) { + const { message } = error; + if (message.indexOf('NotAllowedError: Permission denied') !== -1) { + return true; + } + return false; +} +exports.handleNoDevicePermissionError = handleNoDevicePermissionError; +/* + * 获取向下取整的 performance.now() 值 + * @export + * @return {Number} + */ +function performanceNow() { + // 在不支持 performance.now 的浏览器中,使用 Date.now() + // 例如 ie 9,ie 10,避免加载 sdk 时报错 + if (!performance || !performance.now) { + return Date.now(); + } + return Math.floor(performance.now()); +} +exports.performanceNow = performanceNow; +/** + * 检测input类型是否为function + * @param {*} input 任意类型的输入 + * @returns {Boolean} true->input is a function + */ +const isFunction = function (input) { + return typeof input === index_1.NAME.FUNCTION; +}; +exports.isFunction = isFunction; +/* + * 获取浏览器语言 + * @export + * @return {zh-cn | en} + */ +const getLanguage = () => { + if (tuiGlobal_1.default.getInstance().isWeChat) { + return 'zh-cn'; + } + // @ts-ignore + const lang = ((navigator === null || navigator === void 0 ? void 0 : navigator.language) || (navigator === null || navigator === void 0 ? void 0 : navigator.userLanguage) || '').substr(0, 2); + let language = 'en'; + switch (lang) { + case 'zh': + language = 'zh-cn'; + break; + case 'ja': + language = 'ja_JP'; + break; + default: + language = 'en'; + } + return language; +}; +exports.getLanguage = getLanguage; +function noop(e) { } +exports.noop = noop; +/** + * Get the object type string + * @param {*} input 任意类型的输入 + * @returns {String} the object type string + */ +const getType = function (input) { + return Object.prototype.toString + .call(input) + .match(/^\[object (.*)\]$/)[1] + .toLowerCase(); +}; +exports.getType = getType; +// 修改对象键名 +function modifyObjectKey(obj, oldKey, newKey) { + if (!obj.hasOwnProperty(oldKey)) { + return obj; + } + const newObj = {}; + Object.keys(obj).forEach(key => { + if (key === oldKey) { + newObj[newKey] = obj[key]; + } + else { + newObj[key] = obj[key]; + } + }); + return newObj; +} +exports.modifyObjectKey = modifyObjectKey; diff --git a/TUIService/TUICallKit/TUICallService/utils/env.d.ts b/TUIService/TUICallKit/TUICallService/utils/env.d.ts new file mode 100644 index 0000000..59cdbb7 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/env.d.ts @@ -0,0 +1,10 @@ +export declare const IN_WX_MINI_APP: boolean; +export declare const IN_UNI_NATIVE_APP: boolean; +export declare const IN_MINI_APP: boolean; +export declare const IN_UNI_APP: boolean; +export declare const IN_BROWSER: boolean; +export declare const APP_NAMESPACE: any; +export declare const IS_H5: boolean; +export declare const IS_PC: boolean; +export declare const IS_WIN: any; +export declare const IS_MAC: any; diff --git a/TUIService/TUICallKit/TUICallService/utils/env.js b/TUIService/TUICallKit/TUICallService/utils/env.js new file mode 100644 index 0000000..90200e0 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/env.js @@ -0,0 +1,39 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IS_MAC = exports.IS_WIN = exports.IS_PC = exports.IS_H5 = exports.APP_NAMESPACE = exports.IN_BROWSER = exports.IN_UNI_APP = exports.IN_MINI_APP = exports.IN_UNI_NATIVE_APP = exports.IN_WX_MINI_APP = void 0; +// 在 uniApp 框架下,打包 H5、ios app、android app 时存在 wx/qq/tt/swan/my 等变量会导致引入 web sdk 环境判断失效 +// 小程序 getSystemInfoSync 返回的 fontSizeSetting 在 H5 和 app 中为 undefined,所以通过 fontSizeSetting 增强小程序环境判断 +// wx 小程序 +exports.IN_WX_MINI_APP = (typeof wx !== 'undefined' && typeof wx.getSystemInfoSync === 'function' && Boolean(wx.getSystemInfoSync().fontSizeSetting)); +// 用 uni-app 打包 native app,此时运行于 js core,无 window 等对象,此时调用 api 都得 uni.xxx,由于风格跟小程序类似,就归为 IN_MINI_APP 的一种 +exports.IN_UNI_NATIVE_APP = (typeof uni !== 'undefined' && typeof uni === 'undefined'); +exports.IN_MINI_APP = exports.IN_WX_MINI_APP || exports.IN_UNI_NATIVE_APP; +exports.IN_UNI_APP = (typeof uni !== 'undefined'); +// 在 uniApp 框架下,由于客户打包 ios app、android app 时 window 不一定存在,所以通过 !IN_MINI_APP 进行判断 +// 非 uniApp 框架下,仍然通过 window 结合 IN_MINI_APP 进行判断,可兼容 Taro3.0+ 暴露 window 对象引起的 IN_BROWSER 判断失效问题 +exports.IN_BROWSER = (function () { + if (typeof uni !== 'undefined') { + return !exports.IN_MINI_APP; + } + return (typeof window !== 'undefined') && !exports.IN_MINI_APP; +}()); +// 命名空间 +exports.APP_NAMESPACE = (function () { + if (exports.IN_WX_MINI_APP) { + return wx; + } + if (exports.IN_UNI_APP) { + return uni; + } + return window; +}()); +// eslint-disable-next-line no-mixed-operators +const USER_AGENT = exports.IN_BROWSER && window && window.navigator && window.navigator.userAgent || ''; +const IS_ANDROID = /Android/i.test(USER_AGENT); +const IS_WIN_PHONE = /(?:Windows Phone)/.test(USER_AGENT); +const IS_SYMBIAN = /(?:SymbianOS)/.test(USER_AGENT); +const IS_IOS = /iPad/i.test(USER_AGENT) || /iPhone/i.test(USER_AGENT) || /iPod/i.test(USER_AGENT); +exports.IS_H5 = IS_ANDROID || IS_WIN_PHONE || IS_SYMBIAN || IS_IOS; +exports.IS_PC = exports.IN_BROWSER && !exports.IS_H5; +exports.IS_WIN = exports.IS_PC && USER_AGENT.includes('Windows NT'); +exports.IS_MAC = exports.IS_PC && USER_AGENT.includes('Mac'); diff --git a/TUIService/TUICallKit/TUICallService/utils/index.d.ts b/TUIService/TUICallKit/TUICallService/utils/index.d.ts new file mode 100644 index 0000000..e54866b --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/index.d.ts @@ -0,0 +1 @@ +export declare function checkLocalMP3FileExists(src: string): Promise; diff --git a/TUIService/TUICallKit/TUICallService/utils/index.js b/TUIService/TUICallKit/TUICallService/utils/index.js new file mode 100644 index 0000000..2b54e87 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/index.js @@ -0,0 +1,33 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.checkLocalMP3FileExists = void 0; +function checkLocalMP3FileExists(src) { + return __awaiter(this, void 0, void 0, function* () { + if (!src) + return false; + try { + const response = yield new Promise((resolve, reject) => { + const xhr = new XMLHttpRequest(); + xhr.open('HEAD', src, true); + xhr.onload = () => resolve(xhr); + xhr.onerror = () => reject(xhr); + xhr.send(); + }); + return response.status === 200 && response.getResponseHeader('Content-Type') === 'audio/mpeg'; + } + catch (error) { + console.warn(error); + return false; + } + }); +} +exports.checkLocalMP3FileExists = checkLocalMP3FileExists; diff --git a/TUIService/TUICallKit/TUICallService/utils/is-empty.d.ts b/TUIService/TUICallKit/TUICallService/utils/is-empty.d.ts new file mode 100644 index 0000000..0ddd31f --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/is-empty.d.ts @@ -0,0 +1,2 @@ +declare const isEmpty: (input: any) => boolean; +export default isEmpty; diff --git a/TUIService/TUICallKit/TUICallService/utils/is-empty.js b/TUIService/TUICallKit/TUICallService/utils/is-empty.js new file mode 100644 index 0000000..aee8359 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/is-empty.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const common_utils_1 = require("./common-utils"); +const isEmpty = function (input) { + // Null and Undefined... + if (input === null || typeof (input) === 'undefined') + return true; + // Booleans... + if (typeof input === 'boolean') + return false; + // Numbers... + if (typeof input === 'number') + return input === 0; + // Strings... + if (typeof input === 'string') + return input.length === 0; + // Functions... + if (typeof input === 'function') + return input.length === 0; + // Arrays... + if (Array.isArray(input)) + return input.length === 0; + // Errors... + if (input instanceof Error) + return input.message === ''; + // plain object + if ((0, common_utils_1.isPlainObject)(input)) { + // eslint-disable-next-line + for (const key in input) { + if (Object.prototype.hasOwnProperty.call(input, key)) { + return false; + } + } + return true; + } + return false; +}; +exports.default = isEmpty; diff --git a/TUIService/TUICallKit/TUICallService/utils/timer.d.ts b/TUIService/TUICallKit/TUICallService/utils/timer.d.ts new file mode 100644 index 0000000..d88f832 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/timer.d.ts @@ -0,0 +1,64 @@ +/// +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +declare class Timer { + static taskMap: Map; + static currentTaskID: number; + static generateTaskID(): number; + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName: any, callback: any, options: any): any; + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem: any): NodeJS.Timer; + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem: any): NodeJS.Timeout; + static hasTask(taskID: any): boolean; + static clearTask(taskID: any): boolean; + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem: any): boolean; +} +export default Timer; diff --git a/TUIService/TUICallKit/TUICallService/utils/timer.js b/TUIService/TUICallKit/TUICallService/utils/timer.js new file mode 100644 index 0000000..55682e3 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/timer.js @@ -0,0 +1,154 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +/* eslint-disable */ +const common_utils_1 = require("./common-utils"); +const index_1 = require("../const/index"); +/** + * 定时器,功能: + * 1. 支持定时执行回调 [1,n] 次,用于常规延迟、定时操作 + * @example + * // 默认嵌套执行,count=0 无限次 + * timer.run(callback, {delay: 2000}); + * // count=1 等同于 原始setTimeout + * timer.run(callback, {delay: 2000, count:0}); + * 2. 支持 RAF 执行回调,用于小流渲染,audio音量获取等任务,需要渲染频率稳定,支持页面退后台后,用 setTimeout 接管,最短 1s 执行一次 + * @example + * // 默认60fps,可以根据单位时长换算,默认开启后台执行 + * timer.run('raf', callback, {fps: 60}); + * // 设置执行次数 + * timer.run('raf', callback, {fps: 60, count: 300, backgroundTask: false}); + * 3. 支持空闲任务执行回调, requestIdleCallback 在帧渲染的空闲时间执行任务,可以用于 storage 写入等低优先级的任务 + * @example + * // 支持原生setInterval 但不推荐使用,定时任务推荐用 timeout + * timer.run('interval', callback, {delay:2000, count:10}) + */ +class Timer { + static generateTaskID() { + return this.currentTaskID++; + } + /** + * + * @param {string} taskName 'interval' 'timeout' + * @param {function} callback + * @param {object} options include: + * @param {number} options.delay millisecond + * @param {number} options.count 定时器回调执行次数,0 无限次 or n次 + * @param {boolean} options.backgroundTask 在页面静默后是否继续执行定时器 + */ + static run(taskName = index_1.NAME.TIMEOUT, callback, options) { + // default options + if (taskName === index_1.NAME.INTERVAL) { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + else { + options = Object.assign({ delay: 2000, count: 0, backgroundTask: true }, options); + } + // call run(function, {...}) + if ((0, common_utils_1.isPlainObject)(callback)) { + options = Object.assign(Object.assign({}, options), callback); + } + if ((0, common_utils_1.isFunction)(taskName)) { + callback = taskName; + taskName = index_1.NAME.TIMEOUT; + } + // 1. 创建 taskID,作为 timer task 的唯一标识,在本函数执行完后返回,用于在调用的地方实现互斥逻辑 + // 2. 根据 taskName 执行相应的函数 + const taskItem = Object.assign({ taskID: this.generateTaskID(), loopCount: 0, intervalID: null, timeoutID: null, taskName, + callback }, options); + this.taskMap.set(taskItem.taskID, taskItem); + // console.log(`timer run task:${taskItem.taskName}, task queue size: ${this.taskMap.size}`); + if (taskName === index_1.NAME.INTERNAL) { + this.interval(taskItem); + } + else { + this.timeout(taskItem); + } + return taskItem.taskID; + } + /** + * 定时循环执行回调函数 + * 可以指定循环的时间间隔 + * 可以指定循环次数 + * @param {object} taskItem + * @param {function} callback + * @param {*} delay + * @param {*} count + * @returns ID + */ + static interval(taskItem) { + // setInterval 缺点,浏览器退后台会降频,循环执行间隔时间不可靠 + // 创建进入定时器循环的任务函数,函数内:1. 判断是否满足执行条件,2.执行 callback + // 通过 setInterval 执行任务函数 + // 将 intervalID 记录到 taskMap 对应的 item + const task = () => { + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + }; + return taskItem.intervalID = setInterval(task, taskItem.delay); + } + /** + * 延迟执行回调 + * count = 0,循环 + * count = n, 执行n次 + * @param {object} taskItem + * + */ + static timeout(taskItem) { + // setTimeout 浏览器退后台,延迟变为至少1s + const task = () => { + // 执行回调 + taskItem.callback(); + taskItem.loopCount += 1; + if (this.isBreakLoop(taskItem)) { + return; + } + // 不修正延迟,每次callback间隔平均 + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + }; + return taskItem.timeoutID = setTimeout(task, taskItem.delay); + } + static hasTask(taskID) { + return this.taskMap.has(taskID); + } + static clearTask(taskID) { + // console.log('timer clearTask start', `| taskID:${taskID} | size:${this.taskMap.size}`); + if (!this.taskMap.has(taskID)) { + return true; + } + const { intervalID, timeoutID, onVisibilitychange } = this.taskMap.get(taskID); + if (intervalID) { + clearInterval(intervalID); + } + if (timeoutID) { + clearTimeout(timeoutID); + } + if (onVisibilitychange) { + document.removeEventListener('visibilitychange', onVisibilitychange); + } + this.taskMap.delete(taskID); + // console.log('timer clearTask end ', `| size:${this.taskMap.size}`); + return true; + } + /** + * 1. 如果已移除出定时队列,退出当前任务 + * 2. 如果当前任务已满足次数限制,则退出当前任务 + * @param {object} taskItem + * @returns + */ + static isBreakLoop(taskItem) { + if (!this.taskMap.has(taskItem.taskID)) { + return true; + } + if (taskItem.count !== 0 && taskItem.loopCount >= taskItem.count) { + this.clearTask(taskItem.taskID); + return true; + } + return false; + } +} +Timer.taskMap = new Map(); +Timer.currentTaskID = 1; +exports.default = Timer; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts b/TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts new file mode 100644 index 0000000..85fdf03 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.d.ts @@ -0,0 +1,10 @@ +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +export declare function avoidRepeatedCall(): (target: any, name: string, descriptor: any) => any; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js b/TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js new file mode 100644 index 0000000..c7675b9 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/avoidRepeatedCall.js @@ -0,0 +1,49 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = void 0; +const index_1 = require("../../const/index"); +/** + * 装饰器:阻止函数重复调用 + * @export + * @param {Object} options 入参 + * @param {Function} options.fn 函数 + * @param {Object} options.context 上下文对象 + * @param {String} options.name 函数名 + * @returns {Function} 封装后的函数 + */ +function avoidRepeatedCall() { + return function (target, name, descriptor) { + const oldFn = descriptor.value; + const isCallingSet = new Set(); + descriptor.value = function (...args) { + return __awaiter(this, void 0, void 0, function* () { + if (isCallingSet.has(this)) { + console.warn((`${index_1.NAME.PREFIX}previous ${name}() is ongoing, please avoid repeated calls`)); + // throw new Error(`previous ${name}() is ongoing, please avoid repeated calls`); + return; + } + try { + isCallingSet.add(this); + const result = yield oldFn.apply(this, args); + isCallingSet.delete(this); + return result; + } + catch (error) { + isCallingSet.delete(this); + throw error; + } + }); + }; + return descriptor; + }; +} +exports.avoidRepeatedCall = avoidRepeatedCall; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/index.d.ts b/TUIService/TUICallKit/TUICallService/utils/validate/index.d.ts new file mode 100644 index 0000000..665c654 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/index.d.ts @@ -0,0 +1,4 @@ +import { avoidRepeatedCall } from './avoidRepeatedCall'; +import { paramValidate } from './validateParams'; +import { VALIDATE_PARAMS } from './validateConfig'; +export { VALIDATE_PARAMS, paramValidate, avoidRepeatedCall, }; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/index.js b/TUIService/TUICallKit/TUICallService/utils/validate/index.js new file mode 100644 index 0000000..7632874 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/index.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.avoidRepeatedCall = exports.paramValidate = exports.VALIDATE_PARAMS = void 0; +const avoidRepeatedCall_1 = require("./avoidRepeatedCall"); +Object.defineProperty(exports, "avoidRepeatedCall", { enumerable: true, get: function () { return avoidRepeatedCall_1.avoidRepeatedCall; } }); +const validateParams_1 = require("./validateParams"); +Object.defineProperty(exports, "paramValidate", { enumerable: true, get: function () { return validateParams_1.paramValidate; } }); +const validateConfig_1 = require("./validateConfig"); +Object.defineProperty(exports, "VALIDATE_PARAMS", { enumerable: true, get: function () { return validateConfig_1.VALIDATE_PARAMS; } }); diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts b/TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts new file mode 100644 index 0000000..190b624 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.d.ts @@ -0,0 +1,173 @@ +import { VideoResolution, VideoDisplayMode } from "../../const/index"; +export declare const VALIDATE_PARAMS: { + init: { + SDKAppID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userSig: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + tim: { + required: boolean; + rules: any[]; + }; + }; + call: { + userID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + groupCall: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + range: string; + allowEmpty: boolean; + }; + timeout: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + userData: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + offlinePushInfo: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + joinInGroupCall: { + type: { + required: boolean; + rules: any[]; + range: number[]; + allowEmpty: boolean; + }; + groupID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + roomID: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + inviteUser: { + userIDList: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + setSelfInfo: { + nickName: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + avatar: { + required: boolean; + rules: any[]; + allowEmpty: boolean; + }; + }; + enableFloatWindow: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableAIVoice: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + enableMuteMode: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setCallingBell: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setLanguage: { + key: string; + required: boolean; + rules: any[]; + allowEmpty: boolean; + }[]; + setVideoDisplayMode: { + key: string; + required: boolean; + rules: any[]; + range: VideoDisplayMode[]; + allowEmpty: boolean; + }[]; + setVideoResolution: { + key: string; + required: boolean; + rules: any[]; + range: VideoResolution[]; + allowEmpty: boolean; + }[]; +}; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.js b/TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.js new file mode 100644 index 0000000..303d99b --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/validateConfig.js @@ -0,0 +1,190 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VALIDATE_PARAMS = void 0; +const index_1 = require("../../const/index"); +exports.VALIDATE_PARAMS = { + init: { + SDKAppID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + userSig: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + tim: { + required: false, + rules: [index_1.NAME.OBJECT], + }, + }, + call: { + userID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false, + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + } + }, + groupCall: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: false, + rules: [index_1.NAME.NUMBER], + range: `1~${index_1.MAX_NUMBER_ROOM_ID}`, + allowEmpty: false + }, + timeout: { + required: false, + rules: [index_1.NAME.NUMBER], + allowEmpty: false + }, + userData: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + offlinePushInfo: { + required: false, + rules: [index_1.NAME.OBJECT], + allowEmpty: false, + }, + }, + joinInGroupCall: { + type: { + required: true, + rules: [index_1.NAME.NUMBER], + range: [1, 2], + allowEmpty: false + }, + groupID: { + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + }, + roomID: { + required: true, + rules: [index_1.NAME.NUMBER], + allowEmpty: false, + }, + }, + inviteUser: { + userIDList: { + required: true, + rules: [index_1.NAME.ARRAY], + allowEmpty: false + }, + }, + setSelfInfo: { + nickName: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + }, + avatar: { + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: false, + } + }, + enableFloatWindow: [ + { + key: "enable", + required: false, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableAIVoice: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + enableMuteMode: [ + { + key: "enable", + required: true, + rules: [index_1.NAME.BOOLEAN], + allowEmpty: false, + } + ], + setCallingBell: [ + { + key: "filePath", + required: false, + rules: [index_1.NAME.STRING], + allowEmpty: true, + } + ], + setLanguage: [ + { + key: "language", + required: true, + rules: [index_1.NAME.STRING], + allowEmpty: false + } + ], + setVideoDisplayMode: [ + { + key: "displayMode", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoDisplayMode.CONTAIN, index_1.VideoDisplayMode.COVER, index_1.VideoDisplayMode.FILL], + allowEmpty: false + } + ], + setVideoResolution: [ + { + key: "resolution", + required: true, + rules: [index_1.NAME.STRING], + range: [index_1.VideoResolution.RESOLUTION_1080P, index_1.VideoResolution.RESOLUTION_480P, index_1.VideoResolution.RESOLUTION_720P], + allowEmpty: false + } + ] +}; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/validateParams.d.ts b/TUIService/TUICallKit/TUICallService/utils/validate/validateParams.d.ts new file mode 100644 index 0000000..4a37885 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/validateParams.d.ts @@ -0,0 +1 @@ +export declare function paramValidate(config: any): (target: any, propertyName: string, descriptor: PropertyDescriptor) => PropertyDescriptor; diff --git a/TUIService/TUICallKit/TUICallService/utils/validate/validateParams.js b/TUIService/TUICallKit/TUICallService/utils/validate/validateParams.js new file mode 100644 index 0000000..5073419 --- /dev/null +++ b/TUIService/TUICallKit/TUICallService/utils/validate/validateParams.js @@ -0,0 +1,86 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.paramValidate = void 0; +const common_utils_1 = require("../common-utils"); +const index_1 = require("../../const/index"); +const PREFIX = index_1.NAME.PREFIX + "API"; +function paramValidate(config) { + return function (target, propertyName, descriptor) { + let method = descriptor.value; + descriptor.value = function (...args) { + doValidate.call(this, config, args, propertyName); + return method.apply(this, args); + }; + return descriptor; + }; +} +exports.paramValidate = paramValidate; +function doValidate(config, args, name) { + try { + // 兼容 init 方法中: SDKAppID sdkAppID 两种写法的参数校验判断 + if (!args[0].SDKAppID) { + config = (0, common_utils_1.modifyObjectKey)(config, "SDKAppID", "sdkAppID"); + } + if ((0, common_utils_1.isArray)(config)) { + for (let i = 0; i < config.length; i++) { + check.call(this, Object.assign(Object.assign({}, config[i]), { value: args[i], name })); + } + } + else { + for (const key in config) { + if (config.hasOwnProperty(key)) { + check.call(this, Object.assign(Object.assign({}, config[key]), { value: args[0][key], name, + key })); + } + } + } + } + catch (error) { + console.error(error); + throw error; + } +} +function check({ required, rules, range, value, allowEmpty, name, key }) { + // 用户没传指定参数 + if ((0, common_utils_1.isUndefined)(value)) { + // 检查必填参数, 若配置是必填则报错 + if (required) { + throw new Error(`${PREFIX}<${name}>: ${key} is required.`); + } + else { + return; + } + } + // 判断参数类型是否正确 + const result = rules.some((item) => item === (0, common_utils_1.getType)(value)); + let type = ''; + if (!result) { + for (let i = 0; i < rules.length; i++) { + let str = rules[i]; + str = str.replace(str[0], str[0].toUpperCase()); + type += `${str}/`; + } + type = type.substring(0, type.length - 1); + throw new Error(`${PREFIX}<${name}>: ${key} must be ${type}, current ${key} is ${typeof value}.`); + } + // 不允许传空值, 例如: '', ' ' + if (allowEmpty === false) { + const isEmptyString = (0, common_utils_1.isString)(value) && value.trim() === ''; + if (isEmptyString) { + throw new Error(`${PREFIX}<${name}>: ${key} is blank.`); + } + } + // 判断是否符合限制条件 + if ((0, common_utils_1.isArray)(range)) { + if (range && range.indexOf(value) === -1) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } + // 取值范围, 前闭后闭 + if ((0, common_utils_1.isString)(range) && range.indexOf('~') !== -1) { + const valueList = range.split('~'); + if (value < +valueList[0] || value > +valueList[1] || ((0, common_utils_1.isNumber)(value) && Number.isNaN(value))) { + throw new Error(`${PREFIX}<${name}>: ${key} error, only be ${range}, current ${key} is ${value}.`); + } + } +} diff --git a/TUIService/TUICallKit/adapter-vue.d.ts b/TUIService/TUICallKit/adapter-vue.d.ts new file mode 100644 index 0000000..1d797f4 --- /dev/null +++ b/TUIService/TUICallKit/adapter-vue.d.ts @@ -0,0 +1,2 @@ +export * from '@vue/composition-api'; +export * from 'vue'; diff --git a/TUIService/TUICallKit/adapter-vue.js b/TUIService/TUICallKit/adapter-vue.js new file mode 100644 index 0000000..38b9bfe --- /dev/null +++ b/TUIService/TUICallKit/adapter-vue.js @@ -0,0 +1,23 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +// #ifndef VUE3 +// @ts-ignore +__exportStar(require("@vue/composition-api"), exports); +// #endif +// #ifdef VUE3 +__exportStar(require("vue"), exports); +// #endif diff --git a/TUIService/TUICallKit/debug/GenerateTestUserSig-es.js b/TUIService/TUICallKit/debug/GenerateTestUserSig-es.js new file mode 100644 index 0000000..f61fb98 --- /dev/null +++ b/TUIService/TUICallKit/debug/GenerateTestUserSig-es.js @@ -0,0 +1,63 @@ +import LibGenerateTestUserSig from './lib-generate-test-usersig-es.min.js'; + +/** + * 腾讯云 SDKAppId,需要替换为您自己账号下的 SDKAppId。 + * + * 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ) 创建应用,即可看到 SDKAppId, + * 它是腾讯云用于区分客户的唯一标识。 + */ +let SDKAPPID = 0; + + +/** + * 签名过期时间,建议不要设置的过短 + *

+ * 时间单位:秒 + * 默认时间:7 x 24 x 60 x 60 = 604800 = 7 天 + */ +const EXPIRETIME = 604800; + + +/** + * 计算签名用的加密密钥,获取步骤如下: + * + * step1. 进入腾讯云实时音视频[控制台](https://console.cloud.tencent.com/rav ),如果还没有应用就创建一个, + * step2. 单击“应用配置”进入基础配置页面,并进一步找到“帐号体系集成”部分。 + * step3. 点击“查看密钥”按钮,就可以看到计算 UserSig 使用的加密的密钥了,请将其拷贝并复制到如下的变量中 + * + * 注意:该方案仅适用于调试Demo,正式上线前请将 UserSig 计算代码和密钥迁移到您的后台服务器上,以避免加密密钥泄露导致的流量盗用。 + * 文档:https://cloud.tencent.com/document/product/647/17275#Server + */ +let SECRETKEY = ''; + +/* + * Module: GenerateTestUserSig + * + * Function: 用于生成测试用的 UserSig,UserSig 是腾讯云为其云服务设计的一种安全保护签名。 + * 其计算方法是对 SDKAppID、UserID 和 EXPIRETIME 进行加密,加密算法为 HMAC-SHA256。 + * + * Attention: 请不要将如下代码发布到您的线上正式版本的 App 中,原因如下: + * + * 本文件中的代码虽然能够正确计算出 UserSig,但仅适合快速调通 SDK 的基本功能,不适合线上产品, + * 这是因为客户端代码中的 SECRETKEY 很容易被反编译逆向破解,尤其是 Web 端的代码被破解的难度几乎为零。 + * 一旦您的密钥泄露,攻击者就可以计算出正确的 UserSig 来盗用您的腾讯云流量。 + * + * 正确的做法是将 UserSig 的计算代码和加密密钥放在您的业务服务器上,然后由 App 按需向您的服务器获取实时算出的 UserSig。 + * 由于破解服务器的成本要高于破解客户端 App,所以服务器计算的方案能够更好地保护您的加密密钥。 + * + * Reference:https://cloud.tencent.com/document/product/647/17275#Server + */ + +export function genTestUserSig({ userID, SDKAppID, SecretKey }) { + if (SDKAppID) SDKAPPID = SDKAppID; + if (SecretKey) SECRETKEY = SecretKey; + const generator = new LibGenerateTestUserSig(SDKAPPID, SECRETKEY, EXPIRETIME); + const userSig = generator.genTestUserSig(userID); + + return { + SDKAppID: SDKAPPID, + userSig, + }; +} + +export default genTestUserSig; \ No newline at end of file diff --git a/TUIService/TUICallKit/debug/lib-generate-test-usersig-es.min.js b/TUIService/TUICallKit/debug/lib-generate-test-usersig-es.min.js new file mode 100644 index 0000000..b01b70b --- /dev/null +++ b/TUIService/TUICallKit/debug/lib-generate-test-usersig-es.min.js @@ -0,0 +1,2 @@ +/*eslint-disable*/ +var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},t=[],r=[],n="undefined"!=typeof Uint8Array?Uint8Array:Array,i=!1;function o(){i=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=0,o=e.length;n>18&63]+t[o>>12&63]+t[o>>6&63]+t[63&o]);return a.join("")}function s(e){var r;i||o();for(var n=e.length,s=n%3,h="",l=[],f=0,c=n-s;fc?c:f+16383));return 1===s?(r=e[n-1],h+=t[r>>2],h+=t[r<<4&63],h+="=="):2===s&&(r=(e[n-2]<<8)+e[n-1],h+=t[r>>10],h+=t[r>>4&63],h+=t[r<<2&63],h+="="),l.push(h),l.join("")}function h(e,t,r,n,i){var o,a,s=8*i-n-1,h=(1<>1,f=-7,c=r?i-1:0,u=r?-1:1,d=e[t+c];for(c+=u,o=d&(1<<-f)-1,d>>=-f,f+=s;f>0;o=256*o+e[t+c],c+=u,f-=8);for(a=o&(1<<-f)-1,o>>=-f,f+=n;f>0;a=256*a+e[t+c],c+=u,f-=8);if(0===o)o=1-l;else{if(o===h)return a?NaN:1/0*(d?-1:1);a+=Math.pow(2,n),o-=l}return(d?-1:1)*a*Math.pow(2,o-n)}function l(e,t,r,n,i,o){var a,s,h,l=8*o-i-1,f=(1<>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=f):(a=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-a))<1&&(a--,h*=2),(t+=a+c>=1?u/h:u*Math.pow(2,1-c))*h>=2&&(a++,h/=2),a+c>=f?(s=0,a=f):a+c>=1?(s=(t*h-1)*Math.pow(2,i),a+=c):(s=t*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;e[r+d]=255&s,d+=p,s/=256,i-=8);for(a=a<0;e[r+d]=255&a,d+=p,a/=256,l-=8);e[r+d-p]|=128*_}var f={}.toString,c=Array.isArray||function(e){return"[object Array]"==f.call(e)};function u(){return p.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function d(e,t){if(u()=u())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+u().toString(16)+" bytes");return 0|e}function y(e){return!(null==e||!e._isBuffer)}function m(e,t){if(y(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return V(e).length;default:if(n)return q(e).length;t=(""+t).toLowerCase(),n=!0}}function k(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return O(this,t,r);case"utf8":case"utf-8":return C(this,t,r);case"ascii":return I(this,t,r);case"latin1":case"binary":return P(this,t,r);case"base64":return M(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function S(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=p.from(t,n)),y(t))return 0===t.length?-1:x(e,t,r,n,i);if("number"==typeof t)return t&=255,p.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):x(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function x(e,t,r,n,i){var o,a=1,s=e.length,h=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;a=2,s/=2,h/=2,r/=2}function l(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(i){var f=-1;for(o=r;os&&(r=s-h),o=r;o>=0;o--){for(var c=!0,u=0;ui&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var a=0;a>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function M(e,t,r){return 0===t&&r===e.length?s(e):s(e.slice(t,r))}function C(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:l>223?3:l>191?2:1;if(i+c<=r)switch(c){case 1:l<128&&(f=l);break;case 2:128==(192&(o=e[i+1]))&&(h=(31&l)<<6|63&o)>127&&(f=h);break;case 3:o=e[i+1],a=e[i+2],128==(192&o)&&128==(192&a)&&(h=(15&l)<<12|(63&o)<<6|63&a)>2047&&(h<55296||h>57343)&&(f=h);break;case 4:o=e[i+1],a=e[i+2],s=e[i+3],128==(192&o)&&128==(192&a)&&128==(192&s)&&(h=(15&l)<<18|(63&o)<<12|(63&a)<<6|63&s)>65535&&h<1114112&&(f=h)}null===f?(f=65533,c=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=c}return function(e){var t=e.length;if(t<=D)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),""},p.prototype.compare=function(e,t,r,n,i){if(!y(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),s=Math.min(o,a),h=this.slice(n,i),l=e.slice(t,r),f=0;fi)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return R(this,e,t,r);case"utf8":case"utf-8":return A(this,e,t,r);case"ascii":return B(this,e,t,r);case"latin1":case"binary":return z(this,e,t,r);case"base64":return L(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var D=4096;function I(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,r,n,i,o){if(!y(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i>>8*(n?i:1-i)}function Z(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i>>8*(n?i:3-i)&255}function j(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,i){return i||j(e,0,r,4),l(e,t,r,n,23,4),r+4}function Y(e,t,r,n,i){return i||j(e,0,r,8),l(e,t,r,n,52,8),r+8}p.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)n+=this[e+--t]*i;return n},p.prototype.readUInt8=function(e,t){return t||H(e,1,this.length),this[e]},p.prototype.readUInt16LE=function(e,t){return t||H(e,2,this.length),this[e]|this[e+1]<<8},p.prototype.readUInt16BE=function(e,t){return t||H(e,2,this.length),this[e]<<8|this[e+1]},p.prototype.readUInt32LE=function(e,t){return t||H(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},p.prototype.readUInt32BE=function(e,t){return t||H(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},p.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},p.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||H(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},p.prototype.readInt8=function(e,t){return t||H(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},p.prototype.readInt16LE=function(e,t){t||H(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt16BE=function(e,t){t||H(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},p.prototype.readInt32LE=function(e,t){return t||H(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},p.prototype.readInt32BE=function(e,t){return t||H(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},p.prototype.readFloatLE=function(e,t){return t||H(e,4,this.length),h(this,e,!0,23,4)},p.prototype.readFloatBE=function(e,t){return t||H(e,4,this.length),h(this,e,!1,23,4)},p.prototype.readDoubleLE=function(e,t){return t||H(e,8,this.length),h(this,e,!0,52,8)},p.prototype.readDoubleBE=function(e,t){return t||H(e,8,this.length),h(this,e,!1,52,8)},p.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||F(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+r},p.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,255,0),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},p.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,65535,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Z(this,e,t,!0),t+4},p.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,4294967295,0),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+r},p.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);F(this,e,t,r,i-1,-i)}var o=r-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+r},p.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,1,127,-128),p.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},p.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):N(this,e,t,!0),t+2},p.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,2,32767,-32768),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):N(this,e,t,!1),t+2},p.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),p.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Z(this,e,t,!0),t+4},p.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),p.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Z(this,e,t,!1),t+4},p.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},p.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},p.prototype.writeDoubleLE=function(e,t,r){return Y(this,e,t,!0,r)},p.prototype.writeDoubleBE=function(e,t,r){return Y(this,e,t,!1,r)},p.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t=0;--i)e[i+t]=this[i+r];else if(o<1e3||!p.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function V(e){return function(e){var t,a,s,h,l,f;i||o();var c=e.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");l="="===e[c-2]?2:"="===e[c-1]?1:0,f=new n(3*c/4-l),s=l>0?c-4:c;var u=0;for(t=0,a=0;t>16&255,f[u++]=h>>8&255,f[u++]=255&h;return 2===l?(h=r[e.charCodeAt(t)]<<2|r[e.charCodeAt(t+1)]>>4,f[u++]=255&h):1===l&&(h=r[e.charCodeAt(t)]<<10|r[e.charCodeAt(t+1)]<<4|r[e.charCodeAt(t+2)]>>2,f[u++]=h>>8&255,f[u++]=255&h),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(K,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function $(e){return null!=e&&(!!e._isBuffer||J(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&J(e.slice(0,0))}(e))}function J(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Q(e,t){return e(t={exports:{}},t.exports),t.exports}var ee=Q(function(e,t){var r;e.exports=(r=r||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},o=i.Base={extend:function(e){var t=r(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},a=i.WordArray=o.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o>>2]>>>24-o%4*8&255;t[n+o>>>2]|=a<<24-(n+o)%4*8}else for(var o=0;o>>2]=r[o>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var t=t,r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},o=0;o>>2]>>>24-i%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new a.init(r,t/2)}},l=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new a.init(r,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},c=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,o=this.blockSize,s=4*o,h=i/s,l=(h=t?e.ceil(h):e.max((0|h)-this._minBufferSize,0))*o,f=e.min(4*l,i);if(l){for(var c=0;c>>2]|=e[i]<<24-i%4*8;t.call(this,n,r)}else t.apply(this,arguments)}).prototype=e}}(),r.lib.WordArray)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.WordArray,n=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var r=e.length,n=[],i=0;i>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(n,2*r)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var r=e.length,n=[],o=0;o>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(n,2*r)}}}(),r.enc.Utf16)}),Q(function(e,t){var r,n,i;e.exports=(i=(n=r=ee).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],o=0;o>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s>>6*(3-s)&63));var h=n.charAt(64);if(h)for(;i.length%4;)i.push(h);return i.join("")},parse:function(e){var t=e.length,r=this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var o=0;o>>6-a%4*2;n[o>>>2]|=(s|h)<<24-o%4*8,o++}return i.create(n,o)}(e,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},r.enc.Base64)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var h=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],h=e[t+1],d=e[t+2],p=e[t+3],_=e[t+4],g=e[t+5],v=e[t+6],w=e[t+7],b=e[t+8],y=e[t+9],m=e[t+10],k=e[t+11],E=e[t+12],S=e[t+13],x=e[t+14],R=e[t+15],A=o[0],B=o[1],z=o[2],L=o[3];A=l(A,B,z,L,a,7,s[0]),L=l(L,A,B,z,h,12,s[1]),z=l(z,L,A,B,d,17,s[2]),B=l(B,z,L,A,p,22,s[3]),A=l(A,B,z,L,_,7,s[4]),L=l(L,A,B,z,g,12,s[5]),z=l(z,L,A,B,v,17,s[6]),B=l(B,z,L,A,w,22,s[7]),A=l(A,B,z,L,b,7,s[8]),L=l(L,A,B,z,y,12,s[9]),z=l(z,L,A,B,m,17,s[10]),B=l(B,z,L,A,k,22,s[11]),A=l(A,B,z,L,E,7,s[12]),L=l(L,A,B,z,S,12,s[13]),z=l(z,L,A,B,x,17,s[14]),A=f(A,B=l(B,z,L,A,R,22,s[15]),z,L,h,5,s[16]),L=f(L,A,B,z,v,9,s[17]),z=f(z,L,A,B,k,14,s[18]),B=f(B,z,L,A,a,20,s[19]),A=f(A,B,z,L,g,5,s[20]),L=f(L,A,B,z,m,9,s[21]),z=f(z,L,A,B,R,14,s[22]),B=f(B,z,L,A,_,20,s[23]),A=f(A,B,z,L,y,5,s[24]),L=f(L,A,B,z,x,9,s[25]),z=f(z,L,A,B,p,14,s[26]),B=f(B,z,L,A,b,20,s[27]),A=f(A,B,z,L,S,5,s[28]),L=f(L,A,B,z,d,9,s[29]),z=f(z,L,A,B,w,14,s[30]),A=c(A,B=f(B,z,L,A,E,20,s[31]),z,L,g,4,s[32]),L=c(L,A,B,z,b,11,s[33]),z=c(z,L,A,B,k,16,s[34]),B=c(B,z,L,A,x,23,s[35]),A=c(A,B,z,L,h,4,s[36]),L=c(L,A,B,z,_,11,s[37]),z=c(z,L,A,B,w,16,s[38]),B=c(B,z,L,A,m,23,s[39]),A=c(A,B,z,L,S,4,s[40]),L=c(L,A,B,z,a,11,s[41]),z=c(z,L,A,B,p,16,s[42]),B=c(B,z,L,A,v,23,s[43]),A=c(A,B,z,L,y,4,s[44]),L=c(L,A,B,z,E,11,s[45]),z=c(z,L,A,B,R,16,s[46]),A=u(A,B=c(B,z,L,A,d,23,s[47]),z,L,a,6,s[48]),L=u(L,A,B,z,w,10,s[49]),z=u(z,L,A,B,x,15,s[50]),B=u(B,z,L,A,g,21,s[51]),A=u(A,B,z,L,E,6,s[52]),L=u(L,A,B,z,p,10,s[53]),z=u(z,L,A,B,m,15,s[54]),B=u(B,z,L,A,h,21,s[55]),A=u(A,B,z,L,b,6,s[56]),L=u(L,A,B,z,R,10,s[57]),z=u(z,L,A,B,v,15,s[58]),B=u(B,z,L,A,S,21,s[59]),A=u(A,B,z,L,_,6,s[60]),L=u(L,A,B,z,k,10,s[61]),z=u(z,L,A,B,d,15,s[62]),B=u(B,z,L,A,y,21,s[63]),o[0]=o[0]+A|0,o[1]=o[1]+B|0,o[2]=o[2]+z|0,o[3]=o[3]+L|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;r[i>>>5]|=128<<24-i%32;var o=e.floor(n/4294967296),a=n;r[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,h=s.words,l=0;l<4;l++){var f=h[l];h[l]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,r,n,i,o,a){var s=e+(t&r|~t&n)+i+a;return(s<>>32-o)+t}function f(e,t,r,n,i,o,a){var s=e+(t&n|r&~n)+i+a;return(s<>>32-o)+t}function c(e,t,r,n,i,o,a){var s=e+(t^r^n)+i+a;return(s<>>32-o)+t}function u(e,t,r,n,i,o,a){var s=e+(r^(t|~n))+i+a;return(s<>>32-o)+t}t.MD5=o._createHelper(h),t.HmacMD5=o._createHmacHelper(h)}(Math),r.MD5)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).lib,o=i.WordArray,a=i.Hasher,s=n.algo,h=[],l=s.SHA1=a.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],l=0;l<80;l++){if(l<16)h[l]=0|e[t+l];else{var f=h[l-3]^h[l-8]^h[l-14]^h[l-16];h[l]=f<<1|f>>>31}var c=(n<<5|n>>>27)+s+h[l];c+=l<20?1518500249+(i&o|~i&a):l<40?1859775393+(i^o^a):l<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,s=a,a=o,o=i<<30|i>>>2,i=n,n=c}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=a._createHelper(l),n.HmacSHA1=a._createHmacHelper(l),r.SHA1)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=[],h=[];!function(){function t(t){for(var r=e.sqrt(t),n=2;n<=r;n++)if(!(t%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)t(n)&&(i<8&&(s[i]=r(e.pow(n,.5))),h[i]=r(e.pow(n,1/3)),i++),n++}();var l=[],f=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=0;d<64;d++){if(d<16)l[d]=0|e[t+d];else{var p=l[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=l[d-2],v=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;l[d]=_+l[d-7]+v+l[d-16]}var w=n&i^n&o^i&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),y=u+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&c)+h[d]+l[d];u=c,c=f,f=s,s=a+y|0,a=o,o=i,i=n,n=y+(b+w)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+o|0,r[3]=r[3]+a|0,r[4]=r[4]+s|0,r[5]=r[5]+f|0,r[6]=r[6]+c|0,r[7]=r[7]+u|0},_doFinalize:function(){var t=this._data,r=t.words,n=8*this._nDataBytes,i=8*t.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=e.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,t.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(f),t.HmacSHA256=o._createHmacHelper(f)}(Math),r.SHA256)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(i=(n=r=ee).lib.WordArray,o=n.algo,a=o.SHA256,s=o.SHA224=a.extend({_doReset:function(){this._hash=new i.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=a._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=a._createHelper(s),n.HmacSHA224=a._createHmacHelper(s),r.SHA224)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.Hasher,n=e.x64,i=n.Word,o=n.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var h=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],l=[];!function(){for(var e=0;e<80;e++)l[e]=s()}();var f=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],o=r[2],a=r[3],s=r[4],f=r[5],c=r[6],u=r[7],d=n.high,p=n.low,_=i.high,g=i.low,v=o.high,w=o.low,b=a.high,y=a.low,m=s.high,k=s.low,E=f.high,S=f.low,x=c.high,R=c.low,A=u.high,B=u.low,z=d,L=p,T=_,M=g,C=v,D=w,I=b,P=y,O=m,U=k,H=E,F=S,N=x,Z=R,j=A,W=B,Y=0;Y<80;Y++){var K=l[Y];if(Y<16)var X=K.high=0|e[t+2*Y],q=K.low=0|e[t+2*Y+1];else{var V=l[Y-15],G=V.high,$=V.low,J=(G>>>1|$<<31)^(G>>>8|$<<24)^G>>>7,Q=($>>>1|G<<31)^($>>>8|G<<24)^($>>>7|G<<25),ee=l[Y-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),oe=l[Y-7],ae=oe.high,se=oe.low,he=l[Y-16],le=he.high,fe=he.low;X=(X=(X=J+ae+((q=Q+se)>>>0>>0?1:0))+ne+((q+=ie)>>>0>>0?1:0))+le+((q+=fe)>>>0>>0?1:0),K.high=X,K.low=q}var ce,ue=O&H^~O&N,de=U&F^~U&Z,pe=z&T^z&C^T&C,_e=L&M^L&D^M&D,ge=(z>>>28|L<<4)^(z<<30|L>>>2)^(z<<25|L>>>7),ve=(L>>>28|z<<4)^(L<<30|z>>>2)^(L<<25|z>>>7),we=(O>>>14|U<<18)^(O>>>18|U<<14)^(O<<23|U>>>9),be=(U>>>14|O<<18)^(U>>>18|O<<14)^(U<<23|O>>>9),ye=h[Y],me=ye.high,ke=ye.low,Ee=j+we+((ce=W+be)>>>0>>0?1:0),Se=ve+_e;j=N,W=Z,N=H,Z=F,H=O,F=U,O=I+(Ee=(Ee=(Ee=Ee+ue+((ce+=de)>>>0>>0?1:0))+me+((ce+=ke)>>>0>>0?1:0))+X+((ce+=q)>>>0>>0?1:0))+((U=P+ce|0)>>>0

>>0?1:0)|0,I=C,P=D,C=T,D=M,T=z,M=L,z=Ee+(ge+pe+(Se>>>0>>0?1:0))+((L=ce+Se|0)>>>0>>0?1:0)|0}p=n.low=p+L,n.high=d+z+(p>>>0>>0?1:0),g=i.low=g+M,i.high=_+T+(g>>>0>>0?1:0),w=o.low=w+D,o.high=v+C+(w>>>0>>0?1:0),y=a.low=y+P,a.high=b+I+(y>>>0

>>0?1:0),k=s.low=k+U,s.high=m+O+(k>>>0>>0?1:0),S=f.low=S+F,f.high=E+H+(S>>>0>>0?1:0),R=c.low=R+Z,c.high=x+N+(R>>>0>>0?1:0),B=u.low=B+W,u.high=A+j+(B>>>0>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(f),e.HmacSHA512=t._createHmacHelper(f)}(),r.SHA512)}),Q(function(e,t){var r,n,i,o,a,s,h,l;e.exports=(i=(n=r=ee).x64,o=i.Word,a=i.WordArray,s=n.algo,h=s.SHA512,l=s.SHA384=h.extend({_doReset:function(){this._hash=new a.init([new o.init(3418070365,3238371032),new o.init(1654270250,914150663),new o.init(2438529370,812702999),new o.init(355462360,4144912697),new o.init(1731405415,4290775857),new o.init(2394180231,1750603025),new o.init(3675008525,1694076839),new o.init(1203062813,3204075428)])},_doFinalize:function(){var e=h._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=h._createHelper(l),n.HmacSHA384=h._createHmacHelper(l),r.SHA384)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.x64.Word,s=t.algo,h=[],l=[],f=[];!function(){for(var e=1,t=0,r=0;r<24;r++){h[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)l[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,c=0,u=0;u<7;u++){if(1&i){var d=(1<>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(B=r[i]).high^=a,B.low^=o}for(var s=0;s<24;s++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(B=r[u+5*_]).high,p^=B.low;var g=c[u];g.high=d,g.low=p}for(u=0;u<5;u++){var v=c[(u+4)%5],w=c[(u+1)%5],b=w.high,y=w.low;for(d=v.high^(b<<1|y>>>31),p=v.low^(y<<1|b>>>31),_=0;_<5;_++)(B=r[u+5*_]).high^=d,B.low^=p}for(var m=1;m<25;m++){var k=(B=r[m]).high,E=B.low,S=h[m];S<32?(d=k<>>32-S,p=E<>>32-S):(d=E<>>64-S,p=k<>>64-S);var x=c[l[m]];x.high=d,x.low=p}var R=c[0],A=r[0];for(R.high=A.high,R.low=A.low,u=0;u<5;u++)for(_=0;_<5;_++){var B=r[m=u+5*_],z=c[m],L=c[(u+1)%5+5*_],T=c[(u+2)%5+5*_];B.high=z.high^~L.high&T.high,B.low=z.low^~L.low&T.low}B=r[0];var M=f[s];B.high^=M.high,B.low^=M.low}},_doFinalize:function(){var t=this._data,r=t.words,n=(this._nDataBytes,8*t.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(e.ceil((n+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*r.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,h=s/8,l=[],f=0;f>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),l.push(d),l.push(u)}return new i.init(l,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});t.SHA3=o._createHelper(u),t.HmacSHA3=o._createHmacHelper(u)}(Math),r.SHA3)}),Q(function(e,t){var r;e.exports=(r=ee,function(e){var t=r,n=t.lib,i=n.WordArray,o=n.Hasher,a=t.algo,s=i.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]),h=i.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]),l=i.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]),f=i.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]),c=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,d,y,m,k,E,S,x,R,A,B=this._hash.words,z=c.words,L=u.words,T=s.words,M=h.words,C=l.words,D=f.words;for(k=o=B[0],E=a=B[1],S=d=B[2],x=y=B[3],R=m=B[4],r=0;r<80;r+=1)A=o+e[t+T[r]]|0,A+=r<16?p(a,d,y)+z[0]:r<32?_(a,d,y)+z[1]:r<48?g(a,d,y)+z[2]:r<64?v(a,d,y)+z[3]:w(a,d,y)+z[4],A=(A=b(A|=0,C[r]))+m|0,o=m,m=y,y=b(d,10),d=a,a=A,A=k+e[t+M[r]]|0,A+=r<16?w(E,S,x)+L[0]:r<32?v(E,S,x)+L[1]:r<48?g(E,S,x)+L[2]:r<64?_(E,S,x)+L[3]:p(E,S,x)+L[4],A=(A=b(A|=0,D[r]))+R|0,k=R,R=x,x=b(S,10),S=E,E=A;A=B[1]+d+x|0,B[1]=B[2]+y+R|0,B[2]=B[3]+m+k|0,B[3]=B[4]+o+E|0,B[4]=B[0]+a+S|0,B[0]=A},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,r){return e^t^r}function _(e,t,r){return e&t|~e&r}function g(e,t,r){return(e|~t)^r}function v(e,t,r){return e&r|t&~r}function w(e,t,r){return e^(t|~r)}function b(e,t){return e<>>32-t}t.RIPEMD160=o._createHelper(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),r.RIPEMD160)}),Q(function(e,t){var r,n,i,o,a,s;e.exports=(n=(r=ee).lib,i=n.Base,o=r.enc,a=o.Utf8,s=r.algo,void(s.HMAC=i.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=a.parse(t));var r=e.blockSize,n=4*r;t.sigBytes>n&&(t=e.finalize(t)),t.clamp();for(var i=this._oKey=t.clone(),o=this._iKey=t.clone(),s=i.words,h=o.words,l=0;l>>2];e.sigBytes-=t}},o.BlockCipher=d.extend({cfg:d.cfg.extend({mode:g,padding:w}),reset:function(){d.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else{var n=r.createDecryptor;this._minBufferSize=1}this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else{var t=this._process(!0);e.unpad(t)}return t},blockSize:4}),b=o.CipherParams=a.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=i.format={},m=y.OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=s.create([1398893684,1701076831]).concat(r).concat(t);else var n=t;return n.toString(f)},parse:function(e){var t=f.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=s.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:n})}},k=o.SerializableCipher=a.extend({cfg:a.extend({format:m}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),o=i.finalize(t),a=i.cfg;return b.create({ciphertext:o,key:r,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=e.createDecryptor(r,n).finalize(t.ciphertext);return i},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),E=i.kdf={},S=E.OpenSSL={execute:function(e,t,r,n){n||(n=s.random(8));var i=u.create({keySize:t+r}).compute(e,n),o=s.create(i.words.slice(t),4*r);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:n})}},x=o.PasswordBasedCipher=k.extend({cfg:k.cfg.extend({kdf:S}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var o=k.encrypt.call(this,e,t,i.key,n);return o.mixIn(i),o},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);n.iv=i.iv;var o=k.decrypt.call(this,e,t,i.key,n);return o}})))}),Q(function(e,t){var r;e.exports=((r=ee).mode.CFB=function(){var e=r.lib.BlockCipherMode.extend();function t(e,t,r,n){var i=this._iv;if(i){var o=i.slice(0);this._iv=void 0}else o=this._prevBlock;n.encryptBlock(o,0);for(var a=0;a>24&255)){var t=e>>16&255,r=e>>8&255,n=255&e;255===t?(t=0,255===r?(r=0,255===n?n=0:++n):++r):++t,e=0,e+=t<<16,e+=r<<8,e+=n}else e+=1<<24;return e}var n=e.Encryptor=e.extend({processBlock:function(e,r){var n=this._cipher,i=n.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);n.encryptBlock(s,0);for(var h=0;h>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Ansix923)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso10126={pad:function(e,t){var n=4*t,i=n-e.sigBytes%n;e.concat(r.lib.WordArray.random(i-1)).concat(r.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},r.pad.Iso10126)}),Q(function(e,t){var r;e.exports=((r=ee).pad.Iso97971={pad:function(e,t){e.concat(r.lib.WordArray.create([2147483648],1)),r.pad.ZeroPadding.pad(e,t)},unpad:function(e){r.pad.ZeroPadding.unpad(e),e.sigBytes--}},r.pad.Iso97971)}),Q(function(e,t){var r;e.exports=((r=ee).pad.ZeroPadding={pad:function(e,t){var r=4*t;e.clamp(),e.sigBytes+=r-(e.sigBytes%r||r)},unpad:function(e){for(var t=e.words,r=e.sigBytes-1;!(t[r>>>2]>>>24-r%4*8&255);)r--;e.sigBytes=r+1}},r.pad.ZeroPadding)}),Q(function(e,t){var r;e.exports=((r=ee).pad.NoPadding={pad:function(){},unpad:function(){}},r.pad.NoPadding)}),Q(function(e,t){var r,n,i,o;e.exports=(i=(n=r=ee).lib.CipherParams,o=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(o)},parse:function(e){var t=o.parse(e);return i.create({ciphertext:t})}},r.format.Hex)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.BlockCipher,n=e.algo,i=[],o=[],a=[],s=[],h=[],l=[],f=[],c=[],u=[],d=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var r=0,n=0;for(t=0;t<256;t++){var p=n^n<<1^n<<2^n<<3^n<<4;p=p>>>8^255&p^99,i[r]=p,o[p]=r;var _=e[r],g=e[_],v=e[g],w=257*e[p]^16843008*p;a[r]=w<<24|w>>>8,s[r]=w<<16|w>>>16,h[r]=w<<8|w>>>24,l[r]=w,w=16843009*v^65537*g^257*_^16843008*r,f[p]=w<<24|w>>>8,c[p]=w<<16|w>>>16,u[p]=w<<8|w>>>24,d[p]=w,r?(r=_^e[e[e[v^_]]],n^=e[e[n]]):r=n=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=n.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,r=e.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],a=0;a6&&a%r==4&&(s=i[s>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s]):(s=i[(s=s<<8|s>>>24)>>>24]<<24|i[s>>>16&255]<<16|i[s>>>8&255]<<8|i[255&s],s^=p[a/r|0]<<24),o[a]=o[a-r]^s}for(var h=this._invKeySchedule=[],l=0;l>>24]]^c[i[s>>>16&255]]^u[i[s>>>8&255]]^d[i[255&s]]}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,h,l,i)},decryptBlock:function(e,t){var r=e[t+1];e[t+1]=e[t+3],e[t+3]=r,this._doCryptBlock(e,t,this._invKeySchedule,f,c,u,d,o),r=e[t+1],e[t+1]=e[t+3],e[t+3]=r},_doCryptBlock:function(e,t,r,n,i,o,a,s){for(var h=this._nRounds,l=e[t]^r[0],f=e[t+1]^r[1],c=e[t+2]^r[2],u=e[t+3]^r[3],d=4,p=1;p>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&u]^r[d++],g=n[f>>>24]^i[c>>>16&255]^o[u>>>8&255]^a[255&l]^r[d++],v=n[c>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&f]^r[d++],w=n[u>>>24]^i[l>>>16&255]^o[f>>>8&255]^a[255&c]^r[d++];l=_,f=g,c=v,u=w}_=(s[l>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&u])^r[d++],g=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^r[d++],v=(s[c>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&f])^r[d++],w=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^r[d++],e[t]=_,e[t+1]=g,e[t+2]=v,e[t+3]=w},keySize:8});e.AES=t._createHelper(_)}(),r.AES)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib,n=t.WordArray,i=t.BlockCipher,o=e.algo,a=[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],s=[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],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{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}],f=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],c=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],r=0;r<56;r++){var n=a[r]-1;t[r]=e[n>>>5]>>>31-n%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var l=i[o]=[],f=h[o];for(r=0;r<24;r++)l[r/6|0]|=t[(s[r]-1+f)%28]<<31-r%6,l[4+(r/6|0)]|=t[28+(s[r+24]-1+f)%28]<<31-r%6;for(l[0]=l[0]<<1|l[0]>>>31,r=1;r<7;r++)l[r]=l[r]>>>4*(r-1)+3;l[7]=l[7]<<5|l[7]>>>27}var c=this._invSubKeys=[];for(r=0;r<16;r++)c[r]=i[15-r]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,r){this._lBlock=e[t],this._rBlock=e[t+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var n=0;n<16;n++){for(var i=r[n],o=this._lBlock,a=this._rBlock,s=0,h=0;h<8;h++)s|=l[h][((a^i[h])&f[h])>>>0];this._lBlock=a,this._rBlock=o^s}var c=this._lBlock;this._lBlock=this._rBlock,this._rBlock=c,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(e,t){var r=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=r,this._lBlock^=r<>>e^this._lBlock)&t;this._lBlock^=r,this._rBlock^=r<>>2]>>>24-a%4*8&255;o=(o+n[i]+s)%256;var h=n[i];n[i]=n[o],n[o]=h}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,r=this._j,n=0,i=0;i<4;i++){r=(r+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[r],e[r]=o,n|=e[(e[t]+e[r])%256]<<24-8*i}return this._i=t,this._j=r,n}e.RC4=t._createHelper(i);var a=n.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),r.RC4)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,r=0;r<4;r++)e[r]=16711935&(e[r]<<8|e[r]>>>24)|4278255360&(e[r]<<24|e[r]>>>8);var n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,r=0;r<4;r++)h.call(this);for(r=0;r<8;r++)i[r]^=n[r+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(i[0]^=l,i[1]^=c,i[2]^=f,i[3]^=u,i[4]^=l,i[5]^=c,i[6]^=f,i[7]^=u,r=0;r<4;r++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),r.Rabbit)}),Q(function(e,t){var r;e.exports=(r=ee,function(){var e=r,t=e.lib.StreamCipher,n=e.algo,i=[],o=[],a=[],s=n.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],n=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)h.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),c=l>>>16|4294901760&f,u=f<<16|65535&l;for(n[0]^=l,n[1]^=c,n[2]^=f,n[3]^=u,n[4]^=l,n[5]^=c,n[6]^=f,n[7]^=u,i=0;i<4;i++)h.call(this)}},_doProcessBlock:function(e,t){var r=this._X;h.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),e[t+n]^=i[n]},blockSize:4,ivSize:2});function h(){for(var e=this._X,t=this._C,r=0;r<8;r++)o[r]=t[r];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0>>0?1:0)|0,this._b=t[7]>>>0>>0?1:0,r=0;r<8;r++){var n=e[r]+t[r],i=65535&n,s=n>>>16,h=((i*i>>>17)+i*s>>>15)+s*s,l=((4294901760&n)*n|0)+((65535&n)*n|0);a[r]=h^l}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),r.RabbitLegacy)}),Q(function(e,t){e.exports=ee}));function re(){throw new Error("setTimeout has not been defined")}function ne(){throw new Error("clearTimeout has not been defined")}var ie=re,oe=ne;function ae(e){if(ie===setTimeout)return setTimeout(e,0);if((ie===re||!ie)&&setTimeout)return ie=setTimeout,setTimeout(e,0);try{return ie(e,0)}catch(t){try{return ie.call(null,e,0)}catch(t){return ie.call(this,e,0)}}}"function"==typeof e.setTimeout&&(ie=setTimeout),"function"==typeof e.clearTimeout&&(oe=clearTimeout);var se,he=[],le=!1,fe=-1;function ce(){le&&se&&(le=!1,se.length?he=se.concat(he):fe=-1,he.length&&ue())}function ue(){if(!le){var e=ae(ce);le=!0;for(var t=he.length;t;){for(se=he,he=[];++fe1)for(var r=1;r0&&a.length>i){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=e,h.type=t,h.count=a.length,s=h,"function"==typeof console.warn?console.warn(s):console.log(s)}}else a=o[t]=r,++e._eventsCount;return e}function xe(e,t,r){var n=!1;function i(){e.removeListener(t,i),n||(n=!0,r.apply(e,arguments))}return i.listener=r,i}function Re(e){var t=this._events;if(t){var r=t[e];if("function"==typeof r)return 1;if(r)return r.length}return 0}function Ae(e,t){for(var r=new Array(t);t--;)r[t]=e[t];return r}ge.prototype=Object.create(null),ve.EventEmitter=ve,ve.usingDomains=!1,ve.prototype.domain=void 0,ve.prototype._events=void 0,ve.prototype._maxListeners=void 0,ve.defaultMaxListeners=10,ve.init=function(){this.domain=null,ve.usingDomains&&(void 0).active&&(void 0).Domain,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new ge,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},ve.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},ve.prototype.getMaxListeners=function(){return we(this)},ve.prototype.emit=function(e){var t,r,n,i,o,a,s,h="error"===e;if(a=this._events)h=h&&null==a.error;else if(!h)return!1;if(s=this.domain,h){if(t=arguments[1],!s){if(t instanceof Error)throw t;var l=new Error('Uncaught, unspecified "error" event. ('+t+")");throw l.context=t,l}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=s,t.domainThrown=!1,s.emit("error",t),!1}if(!(r=a[e]))return!1;var f="function"==typeof r;switch(n=arguments.length){case 1:be(r,f,this);break;case 2:ye(r,f,this,arguments[1]);break;case 3:me(r,f,this,arguments[1],arguments[2]);break;case 4:ke(r,f,this,arguments[1],arguments[2],arguments[3]);break;default:for(i=new Array(n-1),o=1;o0;)if(r[o]===t||r[o].listener&&r[o].listener===t){a=r[o].listener,i=o;break}if(i<0)return this;if(1===r.length){if(r[0]=void 0,0==--this._eventsCount)return this._events=new ge,this;delete n[e]}else!function(e,t){for(var r=t,n=r+1,i=e.length;n0?Reflect.ownKeys(this._events):[]};var Be="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e},ze=/%[sdj%]/g;function Le(e){if(!Ze(e)){for(var t=[],r=0;r=i)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Fe(t)?r.showHidden=t:t&&function(e,t){if(!t||!Ye(t))return e;var r=Object.keys(t),n=r.length;for(;n--;)e[r[n]]=t[r[n]]}(r,t),je(r.showHidden)&&(r.showHidden=!1),je(r.depth)&&(r.depth=2),je(r.colors)&&(r.colors=!1),je(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Ie),Oe(r,e,r.depth)}function Ie(e,t){var r=De.styles[t];return r?"["+De.colors[r][0]+"m"+e+"["+De.colors[r][1]+"m":e}function Pe(e,t){return e}function Oe(e,t,r){if(e.customInspect&&t&&qe(t.inspect)&&t.inspect!==De&&(!t.constructor||t.constructor.prototype!==t)){var n=t.inspect(r,e);return Ze(n)||(n=Oe(e,n,r)),n}var i=function(e,t){if(je(t))return e.stylize("undefined","undefined");if(Ze(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}if(n=t,"number"==typeof n)return e.stylize(""+t,"number");var n;if(Fe(t))return e.stylize(""+t,"boolean");if(Ne(t))return e.stylize("null","null")}(e,t);if(i)return i;var o=Object.keys(t),a=function(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),Xe(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return Ue(t);if(0===o.length){if(qe(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(We(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Ke(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Xe(t))return Ue(t)}var h,l,f="",c=!1,u=["{","}"];(h=t,Array.isArray(h)&&(c=!0,u=["[","]"]),qe(t))&&(f=" [Function"+(t.name?": "+t.name:"")+"]");return We(t)&&(f=" "+RegExp.prototype.toString.call(t)),Ke(t)&&(f=" "+Date.prototype.toUTCString.call(t)),Xe(t)&&(f=" "+Ue(t)),0!==o.length||c&&0!=t.length?r<0?We(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),l=c?function(e,t,r,n,i){for(var o=[],a=0,s=t.length;a60)return r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1];return r[0]+t+" "+e.join(", ")+" "+r[1]}(l,f,u)):u[0]+f+u[1]}function Ue(e){return"["+Error.prototype.toString.call(e)+"]"}function He(e,t,r,n,i,o){var a,s,h;if((h=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=h.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):h.set&&(s=e.stylize("[Setter]","special")),Ge(n,i)||(a="["+i+"]"),s||(e.seen.indexOf(h.value)<0?(s=Ne(r)?Oe(e,h.value,null):Oe(e,h.value,r-1)).indexOf("\n")>-1&&(s=o?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),je(a)){if(o&&i.match(/^\d+$/))return s;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=e.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=e.stylize(a,"string"))}return a+": "+s}function Fe(e){return"boolean"==typeof e}function Ne(e){return null===e}function Ze(e){return"string"==typeof e}function je(e){return void 0===e}function We(e){return Ye(e)&&"[object RegExp]"===Ve(e)}function Ye(e){return"object"==typeof e&&null!==e}function Ke(e){return Ye(e)&&"[object Date]"===Ve(e)}function Xe(e){return Ye(e)&&("[object Error]"===Ve(e)||e instanceof Error)}function qe(e){return"function"==typeof e}function Ve(e){return Object.prototype.toString.call(e)}function Ge(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $e(){this.head=null,this.tail=null,this.length=0}De.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},De.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},$e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},$e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},$e.prototype.clear=function(){this.head=this.tail=null,this.length=0},$e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},$e.prototype.concat=function(e){if(0===this.length)return p.alloc(0);if(1===this.length)return this.head.data;for(var t=p.allocUnsafe(e>>>0),r=this.head,n=0;r;)r.data.copy(t,n),n+=r.data.length,r=r.next;return t};var Je=p.isEncoding||function(e){switch(e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Qe(e){switch(this.encoding=(e||"utf8").toLowerCase().replace(/[-_]/,""),function(e){if(e&&!Je(e))throw new Error("Unknown encoding: "+e)}(e),this.encoding){case"utf8":this.surrogateSize=3;break;case"ucs2":case"utf16le":this.surrogateSize=2,this.detectIncompleteChar=tt;break;case"base64":this.surrogateSize=3,this.detectIncompleteChar=rt;break;default:return void(this.write=et)}this.charBuffer=new p(6),this.charReceived=0,this.charLength=0}function et(e){return e.toString(this.encoding)}function tt(e){this.charReceived=e.length%2,this.charLength=this.charReceived?2:0}function rt(e){this.charReceived=e.length%3,this.charLength=this.charReceived?3:0}Qe.prototype.write=function(e){for(var t="";this.charLength;){var r=e.length>=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,0,r),this.charReceived+=r,this.charReceived=55296&&i<=56319)){if(this.charReceived=this.charLength=0,0===e.length)return t;break}this.charLength+=this.surrogateSize,t=""}this.detectIncompleteChar(e);var n=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-this.charReceived,n),n-=this.charReceived);var i;n=(t+=e.toString(this.encoding,0,n)).length-1;if((i=t.charCodeAt(n))>=55296&&i<=56319){var o=this.surrogateSize;return this.charLength+=o,this.charReceived+=o,this.charBuffer.copy(this.charBuffer,o,0,o),e.copy(this.charBuffer,0,0,o),t.substring(0,n)}return t},Qe.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var r=e[e.length-t];if(1==t&&r>>5==6){this.charLength=2;break}if(t<=2&&r>>4==14){this.charLength=3;break}if(t<=3&&r>>3==30){this.charLength=4;break}}this.charReceived=t},Qe.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var r=this.charReceived,n=this.charBuffer,i=this.encoding;t+=n.slice(0,r).toString(i)}return t},ot.ReadableState=it;var nt=function(e){je(Me)&&(Me=""),e=e.toUpperCase(),Ce[e]||(new RegExp("\\b"+e+"\\b","i").test(Me)?Ce[e]=function(){var t=Le.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Ce[e]=function(){});return Ce[e]}("stream");function it(e,t){e=e||{},this.objectMode=!!e.objectMode,t instanceof Ct&&(this.objectMode=this.objectMode||!!e.readableObjectMode);var r=e.highWaterMark,n=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:n,this.highWaterMark=~~this.highWaterMark,this.buffer=new $e,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(this.decoder=new Qe(e.encoding),this.encoding=e.encoding)}function ot(e){if(!(this instanceof ot))return new ot(e);this._readableState=new it(e,this),this.readable=!0,e&&"function"==typeof e.read&&(this._read=e.read),ve.call(this)}function at(e,t,r,n,i){var o=function(e,t){var r=null;$(t)||"string"==typeof t||null==t||e.objectMode||(r=new TypeError("Invalid non-string/buffer chunk"));return r}(t,r);if(o)e.emit("error",o);else if(null===r)t.reading=!1,function(e,t){if(t.ended)return;if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,lt(e)}(e,t);else if(t.objectMode||r&&r.length>0)if(t.ended&&!i){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&i){var s=new Error("stream.unshift() after end event");e.emit("error",s)}else{var h;!t.decoder||i||n||(r=t.decoder.write(r),h=!t.objectMode&&0===r.length),i||(t.reading=!1),h||(t.flowing&&0===t.length&&!t.sync?(e.emit("data",r),e.read(0)):(t.length+=t.objectMode?1:r.length,i?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&<(e))),function(e,t){t.readingMore||(t.readingMore=!0,de(ct,e,t))}(e,t)}else i||(t.reading=!1);return function(e){return!e.ended&&(e.needReadable||e.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=st?e=st:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function lt(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(nt("emitReadable",t.flowing),t.emittedReadable=!0,t.sync?de(ft,e):ft(e))}function ft(e){nt("emit readable"),e.emit("readable"),pt(e)}function ct(e,t){for(var r=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.head.data:t.buffer.concat(t.length),t.buffer.clear()):r=function(e,t,r){var n;eo.length?o.length:e;if(a===o.length?i+=o:i+=o.slice(0,e),0===(e-=a)){a===o.length?(++n,r.next?t.head=r.next:t.head=t.tail=null):(t.head=r,r.data=o.slice(a));break}++n}return t.length-=n,i}(e,t):function(e,t){var r=p.allocUnsafe(e),n=t.head,i=1;n.data.copy(r),e-=n.data.length;for(;n=n.next;){var o=n.data,a=e>o.length?o.length:e;if(o.copy(r,r.length-e,0,a),0===(e-=a)){a===o.length?(++i,n.next?t.head=n.next:t.head=t.tail=null):(t.head=n,n.data=o.slice(a));break}++i}return t.length-=i,r}(e,t);return n}(e,t.buffer,t.decoder),r);var r}function gt(e){var t=e._readableState;if(t.length>0)throw new Error('"endReadable()" called on non-empty stream');t.endEmitted||(t.ended=!0,de(vt,t,e))}function vt(e,t){e.endEmitted||0!==e.length||(e.endEmitted=!0,t.readable=!1,t.emit("end"))}function wt(e,t){for(var r=0,n=e.length;r=t.highWaterMark||t.ended))return nt("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?gt(this):lt(this),null;if(0===(e=ht(e,t))&&t.ended)return 0===t.length&>(this),null;var n,i=t.needReadable;return nt("need readable",i),(0===t.length||t.length-e0?_t(e,t):null)?(t.needReadable=!0,e=0):t.length-=e,0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&>(this)),null!==n&&this.emit("data",n),n},ot.prototype._read=function(e){this.emit("error",new Error("not implemented"))},ot.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,nt("pipe count=%d opts=%j",n.pipesCount,t);var i=!t||!1!==t.end?a:l;function o(e){nt("onunpipe"),e===r&&l()}function a(){nt("onend"),e.end()}n.endEmitted?de(i):r.once("end",i),e.on("unpipe",o);var s=function(e){return function(){var t=e._readableState;nt("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&e.listeners("data").length&&(t.flowing=!0,pt(e))}}(r);e.on("drain",s);var h=!1;function l(){nt("cleanup"),e.removeListener("close",d),e.removeListener("finish",p),e.removeListener("drain",s),e.removeListener("error",u),e.removeListener("unpipe",o),r.removeListener("end",a),r.removeListener("end",l),r.removeListener("data",c),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||s()}var f=!1;function c(t){nt("ondata"),f=!1,!1!==e.write(t)||f||((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==wt(n.pipes,e))&&!h&&(nt("false write response, pause",r._readableState.awaitDrain),r._readableState.awaitDrain++,f=!0),r.pause())}function u(t){var r;nt("onerror",t),_(),e.removeListener("error",u),0===(r="error",e.listeners(r).length)&&e.emit("error",t)}function d(){e.removeListener("finish",p),_()}function p(){nt("onfinish"),e.removeListener("close",d),_()}function _(){nt("unpipe"),r.unpipe(e)}return r.on("data",c),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",u),e.once("close",d),e.once("finish",p),e.emit("pipe",r),n.flowing||(nt("pipe resume"),r.resume()),e},ot.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var r=t.pipes,n=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var i=0;i-1))throw new TypeError("Unknown encoding: "+e);return this._writableState.defaultEncoding=e,this},kt.prototype._write=function(e,t,r){r(new Error("not implemented"))},kt.prototype._writev=null,kt.prototype.end=function(e,t,r){var n=this._writableState;"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||n.finished||function(e,t,r){t.ending=!0,Bt(e,t),r&&(t.finished?de(r):e.once("finish",r));t.ended=!0,e.writable=!1}(this,n,r)},Be(Ct,ot);for(var Lt=Object.keys(kt.prototype),Tt=0;Tt=0;)e[t]=0}var Jt=0,Qt=1,er=2,tr=29,rr=256,nr=rr+1+tr,ir=30,or=19,ar=2*nr+1,sr=15,hr=16,lr=7,fr=256,cr=16,ur=17,dr=18,pr=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],_r=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],gr=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],vr=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],wr=new Array(2*(nr+2));$t(wr);var br=new Array(2*ir);$t(br);var yr=new Array(512);$t(yr);var mr=new Array(256);$t(mr);var kr=new Array(tr);$t(kr);var Er,Sr,xr,Rr=new Array(ir);function Ar(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function Br(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function zr(e){return e<256?yr[e]:yr[256+(e>>>7)]}function Lr(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function Tr(e,t,r){e.bi_valid>hr-r?(e.bi_buf|=t<>hr-e.bi_valid,e.bi_valid+=r-hr):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function Dr(e,t,r){var n,i,o=new Array(sr+1),a=0;for(n=1;n<=sr;n++)o[n]=a=a+r[n-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=Cr(o[s]++,s))}}function Ir(e){var t;for(t=0;t8?Lr(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function Or(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)Ur(e,o,r);i=h;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Ur(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,Ur(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,a,s,h=t.dyn_tree,l=t.max_code,f=t.stat_desc.static_tree,c=t.stat_desc.has_stree,u=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,_=0;for(o=0;o<=sr;o++)e.bl_count[o]=0;for(h[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;rp&&(o=p,_++),h[2*n+1]=o,n>l||(e.bl_count[o]++,a=0,n>=d&&(a=u[n-d]),s=h[2*n],e.opt_len+=s*(o+a),c&&(e.static_len+=s*(f[2*n+1]+a)));if(0!==_){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,_-=2}while(_>0);for(o=p;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>l||(h[2*i+1]!==o&&(e.opt_len+=(o-h[2*i+1])*h[2*i],h[2*i+1]=o),n--)}}(e,t),Dr(o,l,e.bl_count)}function Nr(e,t,r){var n,i,o=-1,a=t[1],s=0,h=7,l=4;for(0===a&&(h=138,l=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s>=7;n=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}function Xr(e,t,r,n){var i,o,a=0;e.level>0?(e.strm.data_type===Gt&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return qt;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return Vt;for(t=32;t=3&&0===e.bl_tree[2*vr[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?Yr(e,t,r,n):e.strategy===Xt||o===i?(Tr(e,(Qt<<1)+(n?1:0),3),Hr(e,wr,br)):(Tr(e,(er<<1)+(n?1:0),3),function(e,t,r,n){var i;for(Tr(e,t-257,5),Tr(e,r-1,5),Tr(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(mr[r]+rr+1)]++,e.dyn_dtree[2*zr(t)]++),e.last_lit===e.lit_bufsize-1}function Vr(e,t,r,n){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==r;){r-=a=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0}var Gr=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();function $r(e,t,r,n){var i=Gr,o=n+r;e^=-1;for(var a=n;a>>8^i[255&(e^t[a])];return-1^e}var Jr,Qr=0,en=1,tn=3,rn=4,nn=5,on=0,an=1,sn=-2,hn=-3,ln=-5,fn=-1,cn=1,un=2,dn=3,pn=4,_n=2,gn=8,vn=9,wn=286,bn=30,yn=19,mn=2*wn+1,kn=15,En=3,Sn=258,xn=Sn+En+1,Rn=32,An=42,Bn=69,zn=73,Ln=91,Tn=103,Mn=113,Cn=666,Dn=1,In=2,Pn=3,On=4,Un=3;function Hn(e,t){return e.msg=Nt[t],t}function Fn(e){return(e<<1)-(e>4?9:0)}function Nn(e){for(var t=e.length;--t>=0;)e[t]=0}function Zn(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(jt(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function jn(e,t){Xr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Zn(e.strm)}function Wn(e,t){e.pending_buf[e.pending++]=t}function Yn(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Kn(e,t){var r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,h=e.strstart>e.w_size-xn?e.strstart-(e.w_size-xn):0,l=e.window,f=e.w_mask,c=e.prev,u=e.strstart+Sn,d=l[o+a-1],p=l[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(l[(r=t)+a]===p&&l[r+a-1]===d&&l[r]===l[o]&&l[++r]===l[o+1]){o+=2,r++;do{}while(l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&l[++o]===l[++r]&&oa){if(e.match_start=t,a=n,n>=s)break;d=l[o+a-1],p=l[o+a]}}}while((t=c[t&f])>h&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Xn(e){var t,r,n,i,o,a,s,h,l,f,c=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=c+(c-xn)){jt(e.window,e.window,c,c,0),e.match_start-=c,e.strstart-=c,e.block_start-=c,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=c?n-c:0}while(--r);t=r=c;do{n=e.prev[--t],e.prev[t]=n>=c?n-c:0}while(--r);i+=c}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,h=e.strstart+e.lookahead,l=i,f=void 0,(f=a.avail_in)>l&&(f=l),r=0===f?0:(a.avail_in-=f,jt(s,a.input,a.next_in,f,h),1===a.state.wrap?a.adler=Vr(a.adler,s,f,h):2===a.state.wrap&&(a.adler=$r(a.adler,s,f,h)),a.next_in+=f,a.total_in+=f,f),e.lookahead+=r,e.lookahead+e.insert>=En)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<=En)if(n=qr(e,e.strstart-e.match_start,e.match_length-En),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=En){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=En&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=En-1)),e.prev_length>=En&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-En,n=qr(e,e.strstart-1-e.prev_match,e.prev_length-En),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<nn||t<0)return e?Hn(e,sn):sn;if(n=e.state,!e.output||!e.input&&0!==e.avail_in||n.status===Cn&&t!==rn)return Hn(e,0===e.avail_out?ln:sn);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===An)if(2===n.wrap)e.adler=0,Wn(n,31),Wn(n,139),Wn(n,8),n.gzhead?(Wn(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),Wn(n,255&n.gzhead.time),Wn(n,n.gzhead.time>>8&255),Wn(n,n.gzhead.time>>16&255),Wn(n,n.gzhead.time>>24&255),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,255&n.gzhead.os),n.gzhead.extra&&n.gzhead.extra.length&&(Wn(n,255&n.gzhead.extra.length),Wn(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=$r(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=Bn):(Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,0),Wn(n,9===n.level?2:n.strategy>=un||n.level<2?4:0),Wn(n,Un),n.status=Mn);else{var a=gn+(n.w_bits-8<<4)<<8;a|=(n.strategy>=un||n.level<2?0:n.level<6?1:6===n.level?2:3)<<6,0!==n.strstart&&(a|=Rn),a+=31-a%31,n.status=Mn,Yn(n,a),0!==n.strstart&&(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),e.adler=1}if(n.status===Bn)if(n.gzhead.extra){for(i=n.pending;n.gzindex<(65535&n.gzhead.extra.length)&&(n.pending!==n.pending_buf_size||(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending!==n.pending_buf_size));)Wn(n,255&n.gzhead.extra[n.gzindex]),n.gzindex++;n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=zn)}else n.status=zn;if(n.status===zn)if(n.gzhead.name){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.gzindex=0,n.status=Ln)}else n.status=Ln;if(n.status===Ln)if(n.gzhead.comment){i=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>i&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),Zn(e),i=n.pending,n.pending===n.pending_buf_size)){o=1;break}o=n.gzindexi&&(e.adler=$r(e.adler,n.pending_buf,n.pending-i,i)),0===o&&(n.status=Tn)}else n.status=Tn;if(n.status===Tn&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Zn(e),n.pending+2<=n.pending_buf_size&&(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),e.adler=0,n.status=Mn)):n.status=Mn),0!==n.pending){if(Zn(e),0===e.avail_out)return n.last_flush=-1,on}else if(0===e.avail_in&&Fn(t)<=Fn(r)&&t!==rn)return Hn(e,ln);if(n.status===Cn&&0!==e.avail_in)return Hn(e,ln);if(0!==e.avail_in||0!==n.lookahead||t!==Qr&&n.status!==Cn){var s=n.strategy===un?function(e,t){for(var r;;){if(0===e.lookahead&&(Xn(e),0===e.lookahead)){if(t===Qr)return Dn;break}if(e.match_length=0,r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):n.strategy===dn?function(e,t){for(var r,n,i,o,a=e.window;;){if(e.lookahead<=Sn){if(Xn(e),e.lookahead<=Sn&&t===Qr)return Dn;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=En&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){o=e.strstart+Sn;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=En?(r=qr(e,1,e.match_length-En),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=qr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):e.last_lit&&(jn(e,!1),0===e.strm.avail_out)?Dn:In}(n,t):Jr[n.level].func(n,t);if(s!==Pn&&s!==On||(n.status=Cn),s===Dn||s===Pn)return 0===e.avail_out&&(n.last_flush=-1),on;if(s===In&&(t===en?Kr(n):t!==nn&&(Yr(n,0,0,!1),t===tn&&(Nn(n.head),0===n.lookahead&&(n.strstart=0,n.block_start=0,n.insert=0))),Zn(e),0===e.avail_out))return n.last_flush=-1,on}return t!==rn?on:n.wrap<=0?an:(2===n.wrap?(Wn(n,255&e.adler),Wn(n,e.adler>>8&255),Wn(n,e.adler>>16&255),Wn(n,e.adler>>24&255),Wn(n,255&e.total_in),Wn(n,e.total_in>>8&255),Wn(n,e.total_in>>16&255),Wn(n,e.total_in>>24&255)):(Yn(n,e.adler>>>16),Yn(n,65535&e.adler)),Zn(e),n.wrap>0&&(n.wrap=-n.wrap),0!==n.pending?on:an)}Jr=[new Gn(0,0,0,0,function(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Xn(e),0===e.lookahead&&t===Qr)return Dn;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,jn(e,!1),0===e.strm.avail_out))return Dn;if(e.strstart-e.block_start>=e.w_size-xn&&(jn(e,!1),0===e.strm.avail_out))return Dn}return e.insert=0,t===rn?(jn(e,!0),0===e.strm.avail_out?Pn:On):(e.strstart>e.block_start&&(jn(e,!1),e.strm.avail_out),Dn)}),new Gn(4,4,8,4,qn),new Gn(4,5,16,8,qn),new Gn(4,6,32,32,qn),new Gn(4,4,16,16,Vn),new Gn(8,16,32,32,Vn),new Gn(8,16,128,128,Vn),new Gn(8,32,128,256,Vn),new Gn(32,128,258,1024,Vn),new Gn(32,258,258,4096,Vn)];var ei=30,ti=12;function ri(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R;r=e.state,n=e.next_in,x=e.input,i=n+(e.avail_in-5),o=e.next_out,R=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),h=r.dmax,l=r.wsize,f=r.whave,c=r.wnext,u=r.window,d=r.hold,p=r.bits,_=r.lencode,g=r.distcode,v=(1<>>=y=b>>>24,p-=y,0===(y=b>>>16&255))R[o++]=65535&b;else{if(!(16&y)){if(0==(64&y)){b=_[(65535&b)+(d&(1<>>=y,p-=y),p<15&&(d+=x[n++]<>>=y=b>>>24,p-=y,!(16&(y=b>>>16&255))){if(0==(64&y)){b=g[(65535&b)+(d&(1<h){e.msg="invalid distance too far back",r.mode=ei;break e}if(d>>>=y,p-=y,k>(y=o-a)){if((y=k-y)>f&&r.sane){e.msg="invalid distance too far back",r.mode=ei;break e}if(E=0,S=u,0===c){if(E+=l-y,y2;)R[o++]=S[E++],R[o++]=S[E++],R[o++]=S[E++],m-=3;m&&(R[o++]=S[E++],m>1&&(R[o++]=S[E++]))}else{E=o-k;do{R[o++]=R[E++],R[o++]=R[E++],R[o++]=R[E++],m-=3}while(m>2);m&&(R[o++]=R[E++],m>1&&(R[o++]=R[E++]))}break}}break}}while(n>3,d&=(1<<(p-=m<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n=1&&0===L[m];m--);if(k>m&&(k=m),0===m)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(y=1;y0&&(e===ai||1!==m))return-1;for(T[1]=0,w=1;wii||e===hi&&R>oi)return 1;for(;;){p=w-S,a[b]d?(_=M[C+a[b]],g=B[z+a[b]]):(_=96,g=0),h=1<>S)+(l-=h)]=p<<24|_<<16|g|0}while(0!==l);for(h=1<>=1;if(0!==h?(A&=h-1,A+=h):A=0,b++,0==--L[w]){if(w===m)break;w=t[r+a[b]]}if(w>k&&(A&c)!==f){for(0===S&&(S=k),u+=y,x=1<<(E=w-S);E+Sii||e===hi&&R>oi)return 1;i[f=A&c]=k<<24|E<<16|u-o|0}}return 0!==A&&(i[u+A]=w-S<<24|64<<16|0),s.bits=k,0}var pi=0,_i=1,gi=2,vi=4,wi=5,bi=6,yi=0,mi=1,ki=2,Ei=-2,Si=-3,xi=-4,Ri=-5,Ai=8,Bi=1,zi=2,Li=3,Ti=4,Mi=5,Ci=6,Di=7,Ii=8,Pi=9,Oi=10,Ui=11,Hi=12,Fi=13,Ni=14,Zi=15,ji=16,Wi=17,Yi=18,Ki=19,Xi=20,qi=21,Vi=22,Gi=23,$i=24,Ji=25,Qi=26,eo=27,to=28,ro=29,no=30,io=31,oo=32,ao=852,so=592;function ho(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lo(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,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 Yt(320),this.work=new Yt(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function fo(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,function(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Bi,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Kt(ao),t.distcode=t.distdyn=new Kt(so),t.sane=1,t.back=-1,yi):Ei}(e)):Ei}function co(e,t){var r,n;return e?(n=new lo,e.state=n,n.window=null,(r=function(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Ei:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,fo(e))):Ei}(e,t))!==yi&&(e.state=null),r):Ei}var uo,po,_o=!0;function go(e){if(_o){var t;for(uo=new Kt(512),po=new Kt(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(di(_i,e.lens,0,288,uo,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;di(gi,e.lens,0,32,po,0,e.work,{bits:5}),_o=!1}e.lencode=uo,e.lenbits=9,e.distcode=po,e.distbits=5}function vo(e,t){var r,n,i,o,a,s,h,l,f,c,u,d,p,_,g,v,w,b,y,m,k,E,S,x,R=0,A=new Wt(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return Ei;(r=e.state).mode===Hi&&(r.mode=Fi),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,c=s,u=h,E=yi;e:for(;;)switch(r.mode){case Bi:if(0===r.wrap){r.mode=Fi;break}for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0),l=0,f=0,r.mode=zi;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",r.mode=no;break}if((15&l)!==Ai){e.msg="unknown compression method",r.mode=no;break}if(f-=4,k=8+(15&(l>>>=4)),0===r.wbits)r.wbits=k;else if(k>r.wbits){e.msg="invalid window size",r.mode=no;break}r.dmax=1<>8&1),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Li;case Li:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>8&255,A[2]=l>>>16&255,A[3]=l>>>24&255,r.check=$r(r.check,A,4,0)),l=0,f=0,r.mode=Ti;case Ti:for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>8),512&r.flags&&(A[0]=255&l,A[1]=l>>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0,r.mode=Mi;case Mi:if(1024&r.flags){for(;f<16;){if(0===s)break e;s--,l+=n[o++]<>>8&255,r.check=$r(r.check,A,2,0)),l=0,f=0}else r.head&&(r.head.extra=null);r.mode=Ci;case Ci:if(1024&r.flags&&((d=r.length)>s&&(d=s),d&&(r.head&&(k=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),jt(r.head.extra,n,o,d,k)),512&r.flags&&(r.check=$r(r.check,n,d,o)),s-=d,o+=d,r.length-=d),r.length))break e;r.length=0,r.mode=Di;case Di:if(2048&r.flags){if(0===s)break e;d=0;do{k=n[o+d++],r.head&&k&&r.length<65536&&(r.head.name+=String.fromCharCode(k))}while(k&&d>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=Hi;break;case Oi:for(;f<32;){if(0===s)break e;s--,l+=n[o++]<>>=7&f,f-=7&f,r.mode=eo;break}for(;f<3;){if(0===s)break e;s--,l+=n[o++]<>>=1)){case 0:r.mode=Ni;break;case 1:if(go(r),r.mode=Xi,t===bi){l>>>=2,f-=2;break e}break;case 2:r.mode=Wi;break;case 3:e.msg="invalid block type",r.mode=no}l>>>=2,f-=2;break;case Ni:for(l>>>=7&f,f-=7&f;f<32;){if(0===s)break e;s--,l+=n[o++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=no;break}if(r.length=65535&l,l=0,f=0,r.mode=Zi,t===bi)break e;case Zi:r.mode=ji;case ji:if(d=r.length){if(d>s&&(d=s),d>h&&(d=h),0===d)break e;jt(i,n,o,d,a),s-=d,o+=d,h-=d,a+=d,r.length-=d;break}r.mode=Hi;break;case Wi:for(;f<14;){if(0===s)break e;s--,l+=n[o++]<>>=5,f-=5,r.ndist=1+(31&l),l>>>=5,f-=5,r.ncode=4+(15&l),l>>>=4,f-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=no;break}r.have=0,r.mode=Yi;case Yi:for(;r.have>>=3,f-=3}for(;r.have<19;)r.lens[B[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,S={bits:r.lenbits},E=di(pi,r.lens,0,19,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid code lengths set",r.mode=no;break}r.have=0,r.mode=Ki;case Ki:for(;r.have>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=g,f-=g,r.lens[r.have++]=w;else{if(16===w){for(x=g+2;f>>=g,f-=g,0===r.have){e.msg="invalid bit length repeat",r.mode=no;break}k=r.lens[r.have-1],d=3+(3&l),l>>>=2,f-=2}else if(17===w){for(x=g+3;f>>=g)),l>>>=3,f-=3}else{for(x=g+7;f>>=g)),l>>>=7,f-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=no;break}for(;d--;)r.lens[r.have++]=k}}if(r.mode===no)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=no;break}if(r.lenbits=9,S={bits:r.lenbits},E=di(_i,r.lens,0,r.nlen,r.lencode,0,r.work,S),r.lenbits=S.bits,E){e.msg="invalid literal/lengths set",r.mode=no;break}if(r.distbits=6,r.distcode=r.distdyn,S={bits:r.distbits},E=di(gi,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,S),r.distbits=S.bits,E){e.msg="invalid distances set",r.mode=no;break}if(r.mode=Xi,t===bi)break e;case Xi:r.mode=qi;case qi:if(s>=6&&h>=258){e.next_out=a,e.avail_out=h,e.next_in=o,e.avail_in=s,r.hold=l,r.bits=f,ri(e,u),a=e.next_out,i=e.output,h=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,l=r.hold,f=r.bits,r.mode===Hi&&(r.back=-1);break}for(r.back=0;v=(R=r.lencode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,r.length=w,0===v){r.mode=Qi;break}if(32&v){r.back=-1,r.mode=Hi;break}if(64&v){e.msg="invalid literal/length code",r.mode=no;break}r.extra=15&v,r.mode=Vi;case Vi:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=Gi;case Gi:for(;v=(R=r.distcode[l&(1<>>16&255,w=65535&R,!((g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>b)])>>>16&255,w=65535&R,!(b+(g=R>>>24)<=f);){if(0===s)break e;s--,l+=n[o++]<>>=b,f-=b,r.back+=b}if(l>>>=g,f-=g,r.back+=g,64&v){e.msg="invalid distance code",r.mode=no;break}r.offset=w,r.extra=15&v,r.mode=$i;case $i:if(r.extra){for(x=r.extra;f>>=r.extra,f-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=no;break}r.mode=Ji;case Ji:if(0===h)break e;if(d=u-h,r.offset>d){if((d=r.offset-d)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=no;break}d>r.wnext?(d-=r.wnext,p=r.wsize-d):p=r.wnext-d,d>r.length&&(d=r.length),_=r.window}else _=i,p=a-r.offset,d=r.length;d>h&&(d=h),h-=d,r.length-=d;do{i[a++]=_[p++]}while(--d);0===r.length&&(r.mode=qi);break;case Qi:if(0===h)break e;i[a++]=r.length,h--,r.mode=qi;break;case eo:if(r.wrap){for(;f<32;){if(0===s)break e;s--,l|=n[o++]<=o.wsize?(jt(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>n&&(i=n),jt(o.window,t,r-n,i,o.wnext),(n-=i)?(jt(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whaveyo)throw new TypeError("Bad argument");this.mode=e,this.init_done=!1,this.write_in_progress=!1,this.pending_close=!1,this.windowBits=0,this.level=0,this.memLevel=0,this.strategy=0,this.dictionary=null}function ko(e,t){for(var r=0;r15&&(a=2,n-=16),i<1||i>vn||r!==gn||n<8||n>15||t<0||t>9||o<0||o>pn)return Hn(e,sn);8===n&&(n=9);var s=new $n;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<So.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitsSo.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelSo.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelSo.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=So.Z_FILTERED&&e.strategy!=So.Z_HUFFMAN_ONLY&&e.strategy!=So.Z_RLE&&e.strategy!=So.Z_FIXED&&e.strategy!=So.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!$(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._binding=new So.Zlib(t);var r=this;this._hadError=!1,this._binding.onerror=function(e,t){r._binding=null,r._hadError=!0;var n=new Error(e);n.errno=t,n.code=So.codes[t],r.emit("error",n)};var n=So.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(n=e.level);var i=So.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(i=e.strategy),this._binding.init(e.windowBits||So.Z_DEFAULT_WINDOWBITS,n,e.memLevel||So.Z_DEFAULT_MEMLEVEL,i,e.dictionary),this._buffer=new p(this._chunkSize),this._offset=0,this._closed=!1,this._level=n,this._strategy=i,this.once("end",this.close)}Object.keys(xo).forEach(function(e){xo[xo[e]]=e}),Be(Io,Ot),Io.prototype.params=function(e,t,r){if(eSo.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(t!=So.Z_FILTERED&&t!=So.Z_HUFFMAN_ONLY&&t!=So.Z_RLE&&t!=So.Z_FIXED&&t!=So.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+t);if(this._level!==e||this._strategy!==t){var n=this;this.flush(So.Z_SYNC_FLUSH,function(){n._binding.params(e,t),n._hadError||(n._level=e,n._strategy=t,r&&r())})}else de(r)},Io.prototype.reset=function(){return this._binding.reset()},Io.prototype._flush=function(e){this._transform(new p(0),"",e)},Io.prototype.flush=function(e,t){var r=this._writableState;if(("function"==typeof e||void 0===e&&!t)&&(t=e,e=So.Z_FULL_FLUSH),r.ended)t&&de(t);else if(r.ending)t&&this.once("end",t);else if(r.needDrain){var n=this;this.once("drain",function(){n.flush(t)})}else this._flushFlag=e,this.write(new p(0),"",t)},Io.prototype.close=function(e){if(e&&de(e),!this._closed){this._closed=!0,this._binding.close();var t=this;de(function(){t.emit("close")})}},Io.prototype._transform=function(e,t,r){var n,i=this._writableState,o=(i.ending||i.ended)&&(!e||i.length===e.length);if(null===!e&&!$(e))return r(new Error("invalid input"));o?n=So.Z_FINISH:(n=this._flushFlag,e.length>=i.length&&(this._flushFlag=this._opts.flush||So.Z_NO_FLUSH)),this._processChunk(e,n,r)},Io.prototype._processChunk=function(e,t,r){var n=e&&e.length,i=this._chunkSize-this._offset,o=0,a=this,s="function"==typeof r;if(!s){var h,l=[],f=0;this.on("error",function(e){h=e});do{var c=this._binding.writeSync(t,e,o,n,this._buffer,this._offset,i)}while(!this._hadError&&_(c[0],c[1]));if(this._hadError)throw h;var u=p.concat(l,f);return this.close(),u}var d=this._binding.write(t,e,o,n,this._buffer,this._offset,i);function _(h,c){if(!a._hadError){var u=i-c;if(function(e,t){if(!e)throw new Error(t)}(u>=0,"have should not go down"),u>0){var d=a._buffer.slice(a._offset,a._offset+u);a._offset+=u,s?a.push(d):(l.push(d),f+=d.length)}if((0===c||a._offset>=a._chunkSize)&&(i=a._chunkSize,a._offset=0,a._buffer=new p(a._chunkSize)),0===c){if(o+=n-h,n=h,!s)return!0;var g=a._binding.write(t,e,o,n,a._buffer,a._offset,a._chunkSize);return g.callback=_,void(g.buffer=e)}if(!s)return!1;r()}}d.buffer=e,d.callback=_},Be(Bo,Io),Be(zo,Io),Be(Lo,Io),Be(To,Io),Be(Mo,Io),Be(Co,Io),Be(Do,Io);var Po={codes:xo,createDeflate:function(e){return new Bo(e)},createInflate:function(e){return new zo(e)},createDeflateRaw:function(e){return new Mo(e)},createInflateRaw:function(e){return new Co(e)},createGzip:function(e){return new Lo(e)},createGunzip:function(e){return new To(e)},createUnzip:function(e){return new Do(e)},deflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Bo(t),e,r)},deflateSync:function(e,t){return Ao(new Bo(t),e)},gzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Lo(t),e,r)},gzipSync:function(e,t){return Ao(new Lo(t),e)},deflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Mo(t),e,r)},deflateRawSync:function(e,t){return Ao(new Mo(t),e)},unzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Do(t),e,r)},unzipSync:function(e,t){return Ao(new Do(t),e)},inflate:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new zo(t),e,r)},inflateSync:function(e,t){return Ao(new zo(t),e)},gunzip:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new To(t),e,r)},gunzipSync:function(e,t){return Ao(new To(t),e)},inflateRaw:function(e,t,r){return"function"==typeof t&&(r=t,t={}),Ro(new Co(t),e,r)},inflateRawSync:function(e,t){return Ao(new Co(t),e)},Deflate:Bo,Inflate:zo,Gzip:Lo,Gunzip:To,DeflateRaw:Mo,InflateRaw:Co,Unzip:Do,Zlib:Io};export default class{constructor(e,t,r){this.SDKAPPID=e,this.EXPIRETIME=r,this.PRIVATEKEY=t}genTestUserSig(e){return this._isNumber(this.SDKAPPID)?this._isString(this.PRIVATEKEY)?this._isString(e)?this._isNumber(this.EXPIRETIME)?(console.log("sdkAppID="+this.SDKAPPID+" key="+this.PRIVATEKEY+" userID="+e+" expire="+this.EXPIRETIME),this.genSigWithUserbuf(e,this.EXPIRETIME,null)):(console.error("expireTime must be a number"),""):(console.error("userID must be a string"),""):(console.error("privateKey must be a string"),""):(console.error("sdkAppID must be a number"),"")}newBuffer(e,t){return p.from?p.from(e,t):new p(e,t)}unescape(e){return e.replace(/_/g,"=").replace(/\-/g,"/").replace(/\*/g,"+")}escape(e){return e.replace(/\+/g,"*").replace(/\//g,"-").replace(/=/g,"_")}encode(e){return this.escape(this.newBuffer(e).toString("base64"))}decode(e){return this.newBuffer(this.unescape(e),"base64")}base64encode(e){return this.newBuffer(e).toString("base64")}base64decode(e){return this.newBuffer(e,"base64").toString()}_hmacsha256(e,t,r,n){let i="TLS.identifier:"+e+"\n";i+="TLS.sdkappid:"+this.SDKAPPID+"\n",i+="TLS.time:"+t+"\n",i+="TLS.expire:"+r+"\n",null!=n&&(i+="TLS.userbuf:"+n+"\n");let o=te.HmacSHA256(i,this.PRIVATEKEY);return te.enc.Base64.stringify(o)}_utc(){return Math.round(Date.now()/1e3)}_isNumber(e){return null!==e&&("number"==typeof e&&!isNaN(e-0)||"object"==typeof e&&e.constructor===Number)}_isString(e){return"string"==typeof e}genSigWithUserbuf(e,t,r){let n=this._utc(),i={"TLS.ver":"2.0","TLS.identifier":e,"TLS.sdkappid":this.SDKAPPID,"TLS.time":n,"TLS.expire":t},o="";if(null!=r){let a=this.base64encode(r);i["TLS.userbuf"]=a,o=this._hmacsha256(e,n,t,a)}else o=this._hmacsha256(e,n,t,null);i["TLS.sig"]=o;let a=JSON.stringify(i),s=Po.deflateSync(this.newBuffer(a)).toString("base64"),h=this.escape(s);return console.log("ret="+h),h}validate(e){let t=this.decode(e),r=Po.inflateSync(t);console.log("validate ret="+r)}} diff --git a/TUIService/TUICallKit/index.d.ts b/TUIService/TUICallKit/index.d.ts new file mode 100644 index 0000000..df052ed --- /dev/null +++ b/TUIService/TUICallKit/index.d.ts @@ -0,0 +1,3 @@ +import { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, StatusChange as STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, t } from './TUICallService/index'; +declare const Version = "2.1.1"; +export { TUIGlobal, TUIStore, StoreName, TUICallKitServer, NAME, STATUS, CallRole, CallMediaType, VideoResolution, VideoDisplayMode, Version, t, }; diff --git a/TUIService/TUICallKit/index.js b/TUIService/TUICallKit/index.js new file mode 100644 index 0000000..fc3be4a --- /dev/null +++ b/TUIService/TUICallKit/index.js @@ -0,0 +1,17 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.t = exports.Version = exports.VideoDisplayMode = exports.VideoResolution = exports.CallMediaType = exports.CallRole = exports.STATUS = exports.NAME = exports.TUICallKitServer = exports.StoreName = exports.TUIStore = exports.TUIGlobal = void 0; +const index_1 = require("./TUICallService/index"); +Object.defineProperty(exports, "TUIGlobal", { enumerable: true, get: function () { return index_1.TUIGlobal; } }); +Object.defineProperty(exports, "TUIStore", { enumerable: true, get: function () { return index_1.TUIStore; } }); +Object.defineProperty(exports, "StoreName", { enumerable: true, get: function () { return index_1.StoreName; } }); +Object.defineProperty(exports, "TUICallKitServer", { enumerable: true, get: function () { return index_1.TUICallKitServer; } }); +Object.defineProperty(exports, "NAME", { enumerable: true, get: function () { return index_1.NAME; } }); +Object.defineProperty(exports, "STATUS", { enumerable: true, get: function () { return index_1.StatusChange; } }); +Object.defineProperty(exports, "CallRole", { enumerable: true, get: function () { return index_1.CallRole; } }); +Object.defineProperty(exports, "CallMediaType", { enumerable: true, get: function () { return index_1.CallMediaType; } }); +Object.defineProperty(exports, "VideoResolution", { enumerable: true, get: function () { return index_1.VideoResolution; } }); +Object.defineProperty(exports, "VideoDisplayMode", { enumerable: true, get: function () { return index_1.VideoDisplayMode; } }); +Object.defineProperty(exports, "t", { enumerable: true, get: function () { return index_1.t; } }); +const Version = '2.1.1'; // basic-demo 原来上报使用 +exports.Version = Version; diff --git a/TUIService/TUICallKit/package.json b/TUIService/TUICallKit/package.json new file mode 100644 index 0000000..d2c79f6 --- /dev/null +++ b/TUIService/TUICallKit/package.json @@ -0,0 +1,40 @@ +{ + "name": "@tencentcloud/call-uikit-wechat", + "version": "2.1.1", + "main": "./tuicall-uikit-vue.umd.js", + "module": "./tuicall-uikit-vue.es.js", + "types": "./types/index.d.ts", + "description": "An Open-source Voice & Video Calling UI Component Based on Tencent Cloud Service.", + "homepage": "https://cloud.tencent.com/document/product/647/78912", + "license": "ISC", + "repository": { + "type": "git", + "url": "https://github.com/tencentyun/TUICallKit/tree/main/uni-app/TUICallKit-Miniprogram", + "directory": "Web" + }, + "dependencies": { + "@tencentcloud/tui-core": "latest", + "tim-upload-plugin": "^1.3.0", + "tuicall-engine-wx": "latest" +}, + "bugs": { + "url": "https://github.com/tencentyun/TUICallKit/issues" + }, + "keywords": [ + "uikit", + "call", + "vue3", + "tencent", + "chat", + "vue", + "vue2", + "video", + "audio", + "voice", + "callkit", + "语音", + "视频", + "电话", + "通话" + ] +} diff --git a/TUIService/TUICallKit/pages/globalCall/globalCall.js b/TUIService/TUICallKit/pages/globalCall/globalCall.js new file mode 100644 index 0000000..6bcdc3f --- /dev/null +++ b/TUIService/TUICallKit/pages/globalCall/globalCall.js @@ -0,0 +1,4 @@ +Page({ + data: {}, + onShow() {}, +}); diff --git a/TUIService/TUICallKit/pages/globalCall/globalCall.json b/TUIService/TUICallKit/pages/globalCall/globalCall.json new file mode 100644 index 0000000..4b341a7 --- /dev/null +++ b/TUIService/TUICallKit/pages/globalCall/globalCall.json @@ -0,0 +1,7 @@ +{ + "usingComponents": { + "TUICallKit": "../../TUICallKit/TUICallKit" + }, + "navigationStyle": "custom", + "disableScroll": true +} diff --git a/TUIService/TUICallKit/pages/globalCall/globalCall.wxml b/TUIService/TUICallKit/pages/globalCall/globalCall.wxml new file mode 100644 index 0000000..8c49932 --- /dev/null +++ b/TUIService/TUICallKit/pages/globalCall/globalCall.wxml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/TUIService/TUICallKit/pages/globalCall/globalCall.wxss b/TUIService/TUICallKit/pages/globalCall/globalCall.wxss new file mode 100644 index 0000000..e69de29 diff --git a/TUIService/TUICallKit/static/audio-false.png b/TUIService/TUICallKit/static/audio-false.png new file mode 100644 index 0000000000000000000000000000000000000000..15f5cf3b72fbf44c01a77b2163c1bdac09b99dc6 GIT binary patch literal 1285 zcmcJP{W}u~0LPaxSu<;?Oxmd}q4F~4B|?@lO>51%DBZE*DU_-o~gPPg=JS*cR@ z4!!*Hb?Ny_g?4#m;?4Uh<;;Ge_4|!YNEVqG1emMKN9wDFhye$;_jG9|UyOA=6eh*| zO7+_Eb$Wr2g(Ls~`k(+`A4>FVvAk=$)Di|Hv4NrSvVc`yQ&JS|n{jXPz^29PH~ekN z#7f-bXX3310%zgkF8wY8yUX7R;ZY%M!vNkB)8I%pHD{qu1o6V;HeDm1!S8=(b(>cG zl;4VPyOGM;xb;nx?S+4D`N>O@-ci&m3PD2lw`Rd9#{sv{*GhC7GuyRQX zKGQmt0CG$oV8g(oNYcJDJ9agZaKLJV;(W5dhL0G@2W_89pxD=Q?7IH}#e{yaf#1}` z-SLqI#fq>-h>~M%+*R98{&czuG+6iSqt&*1;@Mv7Q_-4-290j5n_Ete4;xF$G;6_= z?|0S+t8jDk?wD@p+NFN;oeklTVaU-FLUBcitNhX?P7@_#cM3GhG-v(szZwoD!j*;^GPN* zNzY(IEC^~L=&(o10izrO^|MTAmj`K~e=Z+4lC{NEv-%v`VLqSs77Kh>aUSP#5Mika zG$~`*#mVbTPwQLYZPhv^k8`p@a?QIIW>S-C@Z4!d;y|vfpqnc%oKO-PhK8@0`6Xvy z$fKpn)q3F({6%*7CG;O&o(yYR3-Dt9EwKYMkCF>_bQ`*`xBSScJhSMtYl9jL%e-Of zR?nj;U!@l%8Y<+XeV7J6RIDCQ8D{1fTwEYO1~A%FzXcV=%==IM~2Q%cG=eXGZ9h-TgsS~GAKA^>l21m=p#?_2a4wW9f=Psb%~vjb_g+s zX&U)8o>21J^}CI$E`}U#0VOsC-lS8L#v_wvn$hfiOfxqSQJ$tw%i?wzz?b9K+6!j?H& zZdu;Rjqg5up1OGJ)J0oj3VT^Uo?ZoXt6WKtUogX4IhNxuZeCjF=P7#fVb9O6J2oxu zE6+&{x6{|+?#=$dSkAz}-011z7?N>s&$a7)hYSQ*FBra@dhcfTvcWS%jm~Fv zi}$HV1ES#M9`n7bEIjr%n&LtnPye39@1mSx6?;U~n8 zo-43hl3*eKWcFc69?hv@4|aIAN?VAfUf`G5)*7O*E#bsz&F77Y%2Uk}KFBm5-!_NjN*8DQ+D@&N#%g;wPxz;gEQx){R#WCxHc*~!L{W>nvj!hbl(vBV( z_xvu*S@xF2_vP}r3+AxBW#K)MtA1kbok!EZ{#wMZwf`cwM)SR>Q(Ns;{BhG)J}9wl z|F4C=PD`w7+ST**!}56H`kvB@f7f4o6(!xWP^0JIuIWZMPQSSDtgDQFS=)-M|NozV z)@VB=)Yd$E+Ro3Hk`#{LIdW&cbLX*4vEA=}y!m2nq?BdFU%&U=DZ?i-U%p7p_;Bm> zK~AyT8xA}4o0~0|y0ySNDo5G+-k;{T2@AF|2u*wag8lS*1@p7XDV8c?#(#^ya6Ouy z)jxH|Q-%A9skZw=cFvaA;9aJfyYa@t#@(E+e(cLhKK0XOjfsTFyB{X&_8dAAYdJk? zn(Q&HR_$DOm)G+?_li9wp-Oufw-_T_C_~?E>Bs?T&hVlbf zNe3mBut@$4|JJpxS z`ab`);1y?(x9O{6{R)z`!Oyc4wz7Py6mXcrp6Gw+e})Tt(1i}yFCJbd7dz&8Uepx3 zD6F~IRk?~=n`hqh{5E5K9=2aS)51ifM@+wZzX`RR*@W!04)p$Y!ij6ANgcwW8c zd3A-?wJPtcK7W3H%ed3_-Yn|I$623lPn0|&=$GToRkVFaYIo6GYZi~&Q$zl`sBEjf zDP3^F#A)A~5A{nr4UbN%`k7ItD}T1>$>RC{U0=y^h-+T}W?KeNS3j3^P6_~p-GO~G|L-|Q8* zz`6JD(U~b$_uUKxa-RpY&)O{CsPgH&tf?`lTG2Jf;+{munwnta_=A(K#@sOe_<`-- z5wlBW+@59X9;eUBmGF%s_<%#Qa)y~h=nc-w4J`nXW5I1AD_MHy}Z-Te&?n7Te{_s zORhZsEG}ZO;jebrfrUmDCw6q~vk{-6p_Qw;#r=7a_}gB&sXIR;_{$22-u@gJ*zU@~ z-1Rn)i_J+$Zt zsCl^2m3QBY&$BPhYUQ+-a%~<$%PXww&Gc=SXozVBFX{LyuqdR(Cy;N! zHJfr%f03>RO)bVJv)EOGMK-vaHq3tJcu;iXcE0jk=h@3|L{E?ExK)^-=ymg9?2Dfd zzIE`YRe0wayr@*)&cSxl&vECx`&r!|zU}Y~{XgICN|)xR&g4T6GUdEey7-P9bYG($ z5OcA!c*^T}(Q%I_ChuI-vSZGS_o0=?L|dCkGo&%#iZvu zce{tO@t-SkTwGISr68#~>sTYZvD?L!MGrbHQ@1S0@+x^^5t3N2A?SI)(c1@4U33<` z!JaM2bCpGM!&>8-#aTbD&HkPC=zo6yuG}Aei(B8W)3l#w$ZXy${8)X4C@>!}c)I$ztaD0e0suUF B9OnQ4 literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/camera-true.png b/TUIService/TUICallKit/static/camera-true.png new file mode 100644 index 0000000000000000000000000000000000000000..7abf24280c0152da51d53a997bf9d717e5a23f0b GIT binary patch literal 974 zcmeAS@N?(olHy`uVBq!ia0vp^86eET3?#J*0)=sh)`qW&uS8UU}-y8Sg%P-hSXrTyfvg z;){VmH_4O)`2{n0zm;Qoe)H1FW9xcE@BjR|W7Fck@|@IgJAEx~k+l~uGcYh+^mK6y z$+)-WdS~8h1A*3u8xQYGxnJFI!OZ)zN$vmbyNi~FX*`)_c;i0vhr<;r+>cIgdtD;d zzEh?@Rqoj4lD%h7Z2PM-B7;@}~cK@npHRl$%RJ7t7b}oQVo| z0_>F<7CKDW8Q3H@NpR-JX~JKOBCFiy3oqVY;gaK&#Gtt&IXYnhYj%x(FppX7Lcd5B z?nP^gd6^;vd#tQ1bxv+ws?%WVxa?*#hnVaCyBzsktCz{yZf{8CuJSry^|9ok%9_c_ zSs#-u1h)5Qa;i^Td(ij6ktc-}oHCwUq@U+~X0i|tILyYEE45I7uXUDiQK^^UoUS@+ z>koIj*~>rt`Ny~<;pZ;9wsr9do-f;NF zsBM3~`kb6qerc#d$XDr-Z!TLdm91mF92y-}8Y@tGFswXQOh`)9KE%;kDD^_7{W_by z@_g@?Z~Du1;bca((5iDkir4u#MMp`u=&_r~=&>y{UHT`WlU>z*%B3FJT@IGh! zr#y|ERU00!mE0v8I!khrNm`pS-B&)<+p1OB85ZxFXTf#GoO>MY}xN@y`Fc zsqAe&EtB@lia8MU9*UCwwk@({bcp)nNE96&RjLU zWOVkzsRLWSD>PPaa8!H7Ju4;6?rNk}noo(6so{^T$Sr{l965Pe#ZYnkJ$I%5 z#gAksryE^k%>Wfo6%eY>0To?!_||G z@(rzL8Qs`;qJhhCMMOK-stqrCxrG1A_dnyUsdc&W)2Y&ahNE1;A#tuE$-IvpuVWY{ w{80+s?~wFw<91_(`?VL2#B5M)>#t+{Iep2!yeKUWU?yPjboFyt=akR{0CtM%Q2+n{ literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/default_avatar.png b/TUIService/TUICallKit/static/default_avatar.png new file mode 100644 index 0000000000000000000000000000000000000000..0e2222d209d847a746d7fb3aaef6e7e14a8cff4a GIT binary patch literal 1727 zcmV;w20;0VP)fG_|M2$zQl0)c;$d|2>iaDTV(SeE;6;|B%1` zOqu^JhyTpt|8lPXx7Po!(f^~$|7WQGVx|9!z5i^h|ADvvd9(kS#s8+v|D4DF69nSa z000HvNkl37E6a~<|8xsg2X_%)1MTH_Lg^K?Fzg_7nPJ%jMrw=|zUe7$( z3ig={&+|Ob^E}V_8q7Vp{|{}bbz!VaZ3EZBI&0Yox`!srH3Aq58q7`LTCtP` zEG&v`!?9;-Jy_^bdxl%Bdg*;jOjYnkZ4C=eYHx5WWKO|~l5!1onaf}$E2D>77v^4J z<(0V$+!`=9hLy3DY-s=24ea68;;$Q6z^wywBUl+psf%BjOJF6D(xB`8H4gOP)`?ml z7W&jqaI00XG}(yBg__qDv3*tSyfxIQl@oNu)B|{}6$r*<2I5#52x3@>rGx?CqfSAv zruG5XI(6=omY~*Lr6|6~k{Cdp4#`B$B?LS$_ZYxX@W|W)-0M+W!O)6QGNJ3$oMGrp zO~RXr8g0Vz2)J)fUmt>dJOaRnZ9=*c6vnQHb_d(B>>Lu5GnzOs`h6^DKJ#DKE-~m( zN>@&6(W*zX5L1m6vU2opGuY1{#e2QC67P^=OD$>RhIT?t(8Ir!+737DsHKqOU;B2p zoHz_b0kkjPcM}7_5H^zl8I}o?|Npm1Wnu(IGBzn$VM>TV5?i!~~x#mEgv z9*%+BL)C9rL#jFU6uGAvm6$ytmy%2p9l1`m$q-$#3GhFt@;dgV8#g;hBIE*#1grqL zNU{fTGP}Fbh)Y{YI=5RK!$RlM0ze?u7WB^;%qzbi$VhpSW(8*CQh_@HvmzN;9++@S zC#E47@9s?jJ|9OS)1d>$i~vYf5EU?S%t&pGK4^Ao05T4Jp9^s+${ruH2%n_<3N3OX zTog&TgEC|A$-aX!ZSYA~i4bu-l=7th1Ft#+Lv`vqD%7Y;foHO{p^wS zSgALi47TmjsJ$IbQrXJ6C464lWFY@%P|nSe^LeQuhEuk(XVki=q|xyvZ!gi3~fEHXMvRaOlM&rH(UC zuWO6$NSi#g3<#`=>=<8Sn`jNL-qzOW9<24qfY_XfVjRS*^2K`)KfWS{W(W~BQ;#DT zjtctY?&mU0%?#z9mc$D{8v|ncYV6YOY3mRdbj=y@1CW&(rNPq|x~*gzpj?*Pl=FbI ziAHzbicq5O)9uVs9c8liCgHd9uq4Ly-(!gN#&jF5X+W&EA6rypnfPQ{RPgfFkA66U z9Ya80%zcOWdg4Qj>+fR-^rzIcxoG<{ZI{F{e8@;-x)iL4$keDwPM^PEpWR9w{1*~) zpZ8sGgb6jr3329eFs(e$_(0``b4~`&r>3|e3c|O9s#sK>P`BR=6b%}^>&8UwAys45 zDF(T_9tz&55o;Xt9vrG_SM#2X-M>WwCjet?9jdNXd%AK`h+sD|SKoQ61x}dIH)UNBRv8g~Ggk@pq^OyW33{ZS=>EVYKQAnhS6zDu4>00;m8gfD{3?tvi$Fo{FL-7IGw0;_`ZxyR--0$=zv3RN8(&_a5*6r}m z>+FQlw|UL5;PLmr=HRj5)|=VLZ_BFF?C!ba+=|n@TEm+luyp0}`jXbdPrsB%y^lM% zhc>r@#OLH@$E0AzpQ78%LAr{z;@f}FwaV$}Rl%48h-aMu001j=QchC<=pL^$>~NhIG1Jbts$wcNCq!CW$4+HFy&Y*beB zSV(@gvO(dHs>N*xvE#Miv&k*nkYJZx3Q!|fgtTI;L4jyhSD?sBwMC|FueYI4dwrWs zYE~>LW>uPGN-|b}28CFXOh_hdXksS}giy1fkyRtTwzAMHyG8mm6B%fiNoX6*_17@s zb)9r@-oThQ4k`D_ff3IV7b~M8Jv-lJM3-;HA(rm19Xz* z(0oESfXA{lmo!2vJ=XxpA+&O@qB{WQ9tLj^YH#Q->JT*edbD$V1?}oIQ}Z>1jLwGa zm!mE;d)=g25)g9IXAh2+pjm=u*vde}G2_mlS!Ro#=Rw3Vn=l+eGmoBCgNQpem{K4z*h}tqLLj z0epjgRhqT}K}Rf@99p3%4G8iNU?2K5)Eve62e1eIVl=4;Q9I1fHMA?z1Q)`NSx`CT z5?6+>GZs`1mFZE+hOqZ6s2s9W5<4;Og!wvyel;c68F$Rr2j~~4F&pA8nZM7_&ZY+& zkZ{d{%b^Xv6A;&B{&t}o-xaJv#%^#qv`W9V@{n=Le0}UdyL^jJ!{UzpfBzi}a24FC z`p;yCH!va14@AYCvp)>?doaSIpHdk}xnWQ3eTE^K6cKGg(gB-x+=Vfl{8CBW5u4OM zhe34}*TVa3!qEU`@KL-5NtY83&l8xnMnubyG~!Fp8yL3Cm!cB(_<4|NHjx8ad@dgL zV46cNq@4?IB;~nOg|zOFJ-CHwRZ2kK5#Pm_mY_1E@s0f#m{z7ZGsFxT0NLkA`hy3We-kZjz@8*G8#{2{Vt4&QyI#<=hxiElqmsadLPDf!2qTt zs0wBHTyPIls^mhUL-yc13~|YUI($X6+l3hpkqw1*4DT&%ez>bf=YT!9f(gs~cwG&? zp!n8>0c+~NdpkAyBueuuCRI8gO|Gl!{E|-tny2K^57;n%F>K`s6y z`qYJ9o}RB)`Gv=+<_OaCiwo5*Ohw@G*KL&Q9nOy6^EH&nxA+TBY7P2q?90;#dbgic zUFEFuSI$(sWRFfqQ=#qm)$MsI{G~tT-m^y^u6gd<4^?iQH~4Fp>Rqr$A8+wX@9vOI zIEO4-Zyk>v#$EI<_`1uc46h(5PGdEw#2-c6;qj0?b#M(iwaJ&iH5lzNe~OkGc8VUA zp+jev&9*mygfek1q=-ZyzgTi*KSANdBlyyTsG^a2Je?10wjGFyNq>gL$wY7gK@FO+ z0!=!5Y_@#}S)plF=rTHGvzHAX>uh zkWG?bR9M^ehYB>h?6X;RJ6KFbpeTTx!55W_ib6Ah;&S^6C$yNN!Wf)<8hyw7>?HY0 zK$v_Q-D7?U!QwFTZu^WA{&vwyik9b*H`rnFAI{b2Sst`I-(|i|F|Vvti7I)ciy`xI zi#cVsXods~xZ!yuP*y1+U#3mo)ghbGKj~pkubVVe9cG;GO)Q1Zx|mx%ETsy2mlwZ> zbN}eBhxxq;Rk6tK;AVt{SkB8Y*BSkSsnIW48`_$wmh-QaZH|87?C6&+kACs^$d~Vr zeglQ*x3GwQ6Orh*afyB-o#?kRiheVx=(qEVenYkBx3r6XQ^6O|)-n2xHKX6!^aV7R zjedLI=r>q?0WGe7+VY^8w?%&bw|Rd#jrM;^#tP7&5KEFN&58xZtV)wi+Fox%q4xSV znbxYVK#`SdivrPz6(Ow{YfymPvJDA#*`=VRYH=Gv?079j;jmFz&0`_?)yf8iO3RIT z8O$Z)#oQK!QEIcEUR$>DEPHt^UEd5#-aN~3tBG>lE48gcK9|cEtaizZmlIXjA@zO$ X0+|69)Fq$b00000NkvXXu0mjfTr4g< literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/hangup.png b/TUIService/TUICallKit/static/hangup.png new file mode 100644 index 0000000000000000000000000000000000000000..2bf0adc28f86f99941182f75f77aa1874a74cf79 GIT binary patch literal 1262 zcmVC0002PP)t-s0002{ zSzh~CU;9{I`&eK4Szr5EUiw&G`&nQ6T44HFVEB zUi(;H`&nN4SYP^CU;9~K`&nQ7Szh~CU;9~K{8?c9SYP~GUi(^K`&?l9SYrQOXa8Ve z`dD82SYH4C|Ni*+{_^wv&(ZsTg!*D=`;?gbjgk9^jQVMB{`~y>vb6lJu>6{y{JFdO zZ*=-xV*T3N{ngg}$I1P^!2GDI{_E@h<>vn1;rybd`*nIk>fhi1001R)QchC z)5fWVLN^=?1_U44`}yw3HU8_o^l2p}n z#V|Y8fVg<*sd5EZRb;jIKxwiwrd~v#qHbnvN{7{yz(i_Vl(>BB1rfZo@|2{fIwGq- zQBoci#G*V>5;8JklQVR$Yy)>`Wa%Ecb{Tgnw{sL*Uqb@4e%$d@Bt*@{+P;j$$T5=8 zm5?B*OA)C^m`YLD1`=o35h_Jk$IIq^9u9u>TrTR13|4 ztsqs3O~DML%!v2>;q^u8f`e{A|486Ky4g%Q8C=LYt^r_=K_A@ouP#6XH`=u&w82rE zE@aE#sGKFg2DoaFPX?T2=$s7BWIFQ*?#^$n3b<3w?*9C2|=24VoMN2vc=SZzYt6aW72Orgwaoz!6JkyJ`hn40`*RZae-73 zM-l(Aq=Fc{@5$Hlb#>gkv*FNn_p8_Kd@=G6RfTAPh`i};vv;m@*Yl}|CVVbfbTf3=xZCL`m~_Zwoqg*%QMmIDFfhqr8h&xSc+-c?{A)3uj;52z zc(;8$T&`w4K`4XeJp49yeba3gA6LTpzV@%^Fh&R^ya~Md`Omrm8S@tFS+qycNkbs- z{rvA&dw7U%U z0ikxz6=U2``o)}`BW+_1K!Evllmw~fg=2Jxl{)Ki}i zq;jufB3Z0H$r}EcA4@8P-fI=MBH2lQl(vT1+?%4JA5~?kf8+Y)Sw5}<{o7>^g$cYg zgBPdp@*Livz_)1NO)7Ys4&JE5w`zlgAd>yG>)`_n_{au7w1SWA@PkYE=oUY`hL7*x z-P=J403ZOszzUYIe?>tP_>dbe$IcH7eBtmD3*UJB$mCZpKC}6q&kv1$>GV@8-+KMn z?ALBTxBI={0|!q$0?5TP9}k^8^$K7&&;0`6F+e^8==HGQF)tdM{eA_X3-mjH-(T?m Y1sYUFjB@q@e*gdg07*qoM6N<$g8n9dZ~y=R literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/loading.png b/TUIService/TUICallKit/static/loading.png new file mode 100644 index 0000000000000000000000000000000000000000..bfe6f40cc202e5ec915fc0b3473b94f19e522876 GIT binary patch literal 1367 zcmeAS@N?(olHy`uVBq!ia0vp^0U*r53?z4+XPOVBHU{{FxB}__Lkeu4Q8WkWXsePS zzhDL~X~m2PHQ_uz7ydX;vHcs3&Q5DcW(&5zysK5K(`|o-R&1_kU|^BtG^vZ0UwTNSdewU46!15^^cesDfF^m@Z;iB@6neCfX?wZ&~ zjFyj5SDtq<%SdQWYiwj*#M)plT$z4to8ASz3FV?JpVHj-toZPEV&WC|8eg8CYKL{3 zIS&bKO-lK+p!I#PW8p5N#b&9JIHjzZ0kSZ$v>J8hlyGIs6L`*IhRE+4*g+qq9t zBX8M+?I&X<@;HUPTkE<`f_i|_4;3~h}l4Z{W<*ySAIU7zM4Zg^JD>`K+0KLJc{eUvT>I<-M7t^yQ>k?Y9`CTFqHXCTX{;A z;7pCe3$FI{Lz8tGvE7W&1?Jhkt50Vm(s56J7)2{C1Ohc;N7&Uw@|`U*`V7LFZ($0>7M|$?j{$zL&jPrk`G>8`~Cj zQGRiI#nnt(0o%#-Rc6YLm-4q;2im{6kX#(bx?WDeOC)s8pL1)Un0Py0VLY{iN570<{v*PXKh`FMVvWEVY>wT~;L;AdsAo#XSfS-YmIB$|D;+FE4MLRPl%GU60 zd!#${t8Q!D_Apzfduw;FzIQ(p6#MAn{9cyxnoUGO{sK&To2~!X&C|bm#BT2AXHz;eJZ5fr^y{yw zzopr0C6hiIsgCw literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/phone_dialing.mp3 b/TUIService/TUICallKit/static/phone_dialing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..f392528b74f642871a5114f38577b39b8547db9d GIT binary patch literal 9178 zcmai)c{o&m^v6Fl_s*EH)L`t}*oOu~O!$&rh?`ob&mNqwQJ|8$4-XIY_bT*f z<& zF(WX!THtBS%r{xEuYbbezRoWxx%qL}0^?BN**9XKyB-ic@6mC|6!2;@;?iq_e97e@ z^RDOhE}plT@%t7i-fB!XgV&cXze12XWVrxA29*#*ioZ`o+%6sC5TW013_({SfGrJt za7h#paIN6l?2N~&^+U*ipP!3MHLdUTekwlEERPYK%w75iyZ*Paxr$}VC^Cs(W?&o= ze5IWZrb!^CP{SGb5P+f{vNe$Gi4QowbcIP;_X&hH-@8*oQQf;}0hq7z0ut2)yYw|89I9d9h@H?AX_m zYZ;Wf?vQk1wE;&#@PXUje1eM~3R>pRP$~xcXRNju_cpB9gYUji2TZ&#)T?a<$kA{( zg*Ck6!=L)axm{6tUkt)7WLpX|?%B1X4=>HL<1R^%1#3$ci4RJn-U~d5>rq9oV;m|J zt4as!NO)*g+ZKr9;rTC4W04Ys4V-R4?w8B793FP#XkvB`JKdkPTO*W9I58%NUCY0> z06SzW(O7Fxj;$O%QAq>nzoWoy20kPqnAnHs@4#;J$WFXHlS)#zztyc)J*Lto-ilsa z&T8VgZnu`qu$T1A_aVk%HyXT7T$K5Soov>z4m+DF&DpoJ@#I@5MNFWsJ|0~+H}nTo(MYx zeT5&ry?e#sOE(*sG%<0U=ewnuTh(lM=!1wHyYBJ8qy61s9B*suiGP=eE@Vrt_=knB z>@+0FLw+%{8V-Qu43PQd+iOWexYXq6-Lvf;UA=+%ei*^(Scya*YYh$LOwVYFk1QNm zJLmTcz5eoLGiHwsl&GKqc1EN2XjlT#RN%HWN-!Q>61e-7vy(1#nQ_U}~5zmTo2E z@Yiy6y0U5AP0J)Boh6L39|AWlAFJU*p&D&hjAQ=tUFq^eUDvjZgEqb<8)P}%Y3yoy zO-U0kiQy|*>lAR&NcDO3&*k&${A4pnmVZpWDaSa+U{aShY=#ep*eq879>53n|A{?u zHdeD^L^)1SVB_3?RGQYzy3IDXW0enOa*>9b7tGkrV=(Pnu$vaVjLbEs>w9l z87~HPTeHD2XJsu5^ghJ;X7s(ub#8GV=o`h8jb3-@M{h@v=g4HWo#l*UdV9?tX^$`b zUT^HyPhKk==yAI?><{gWuF+)!xeiwW_p!vf> z%GhaBBNs&faShO1^Yi(?4v39VL)bue(| z3!9d@HEx|LByC2}?3Iy3h=4sD)n^8<>w2;_18X4SmgjMz!8J zlXHp;KQ|1}olG!vX3DuSJplK9^!2bT)62Tya$xG{&DKtKmQhIWvy(VVfB2U zc+RrU+xE{!B4!>>k!i2irIgcFFWz9BO4wLk&Di`M4VuRMgX$_sca-kGB~uvr*1UOt z?M;h2T0)tZ%%0<>w0e~0k^VUU3n$10?^3=9U7fK{Muvx@R4`5z;mUnkV5aI5(~H(+ z&;bLXm{sz#@-ZDZrmObq5WRC{Vs>{~y?=ba6LryiP8jOOdkUt!D#ibd8M6-#Q$2#Jfn?jgKlViv9 z!0n66>1P^|lXOpkJms4DH+$8?ZRG2qv)U=os_kEEn+t5gIDrB=&92}>4j_-}jSQ96FeM=m+7&(L>_cviDpNV_Bj z<2Vo)|Lh+l#Hd2k_!$q9?WWHcOoH;nC@MDyyx4D6(oVUz<1@S?j!vAAml9JuSIoz? zLEYR#AO)EllwZ4UMnNQE5aU=A9=iuHB;Ke%y~(#ZxL7N+8`@X;`VZCm6KlNiB4e#W znU79Z3jYZDL1!VMIJDoT<=o`xamTi4mZ5u zMTom!?|8xWMem?q=a3&5hXv*7aXN(XG^ov>&I4=$6Vh7;K-9VSFZ%ob4ZMAE;bh+- zDhXUHT+WfaK0W^+lB^}2vTyJq?SK!i%`Jbc-D%es7{?rHlS^TcPXHL{_kn2Z!T(p1cBjaiAIg+R=c1D%=X7F55? zKLRh<{Qyh|6XvgD_H2go*2FNVL{a=Kegx&Iv1$?V-b)@z4+vjh8Kcst!z0weH}U zVI#R?Vda8N70-~lkX_>QB7CV6OyD}Z(;}iYL!eQP4u1i$IOBPO8V@#Pp!OS6GdU z=a0201da^TpI8>RL`uJYbVn)^vxkeui_;C7{_nl0tFt>pR(q8W&>3qc2V9-;C8Fmo zw?T286Lv5ARa;Kg+70BS_&3@#Nw?Y(&7Zg4+KM`A z+UJsG@0IZD`Txqw>wWbtF7CFL7CwC?*b)lU?mJ_STF;t*c}U<;ap{k%lCnop@M%oWXUl$>MfJkg1DVr=3vBm&YDxm2}(N=^`dQNJ!F zySq?Csv0^xyfMyULXO@M2HcIqcjIR)fjxeY4F8;*b=LUnMMY|4lgw&~USmO}le&VH z$lvXI_f~N#C_o78YtuC<3b*)ZtWC=Z|}1x|kod~NE%>aTTFuVcQYGoPN#N1!`K;QPdXtxv zwH1^a7QK&PoM8Bnj&Fw&x=z`wL;z-Cjco-IobZMCCgVphpKiK+g({((;!s<>?Aq^2 zQePb+VOB3J_&SAsrsgTKfJ|ycyxLWPaYEsAJ>PC6A`J?{zrp;x+59~}jeS2rL15;I z747_=u;wG{jyRq_<8t)W`?3UW+28qvOUKA?Yu~zkU-llqcI8o5_J5pN&jbbzPllPS z^crvpHok?Q6BgQ*Q8MoGO0Bb&N|6oQ8RecH+^tSb&Nx-sEV18gGMi4g-M{lJkmfnF zT5BjM$2JgR>v?db@HFCY-%79wRy+6lU~s75^E7H!uf)ih;I2D!?t=@pphtVh8PbSw zZ9x(tN9F#S;NC&?wD4heWS;J8EzF)>aIah#1L#5cKbtC>jNz8hG(`8`)}>c-0}jdo z&7VUHXf+z{2LyW8mt07bJ*`r@+A+6-lOD83O17=e@4GJ524Svn2!{Im7!s4JP$4VT z5`8aoLtrZqdo_9fmwZ-*yohSGp+c0@DUnJ-$BmR0Q?s}&zFAJo0SWt%W}lSn$ijxT zhFHJh??aH+i#dViGv)Lb4hc>^h6h3kAJ+zHm9-u{Oca;T4;XoxWnBFJO*%tpc;d8OW;d8 zy0fr2>XYYJPu`v<&bNXyh2*RKa%q9Rj#T!caAFi%j?ky8?8dlU+;s3{B>+Pg!l4($)K{2YUu(8MsN+zB+ zb+7%Zs7S!zE!vupSCbsqy0}40|CW)g&E7S;g651~NlCbV*h3+6+Ca;y|NQK;2F)L5 z2nsS7#NI1JXGp1+zWKhJa(wggfM%}l81r{dut7R3NZB!Etr4Tv(GYU~Rf;u#nsUCO zjH0Kb$i+C`u%$cd=X(NZ9UKKDIEm4);hs1$$3ud1lmZ4H()+BV8|$yQj}WJLtnT?J>~?Ns0?+p66xS2tO&jhc~Y9fmzv^h(gFtU z-&YWI@6yvVs3Gmt2nh}C_Mq}>;&;4?vQKW$RJ;+>w%>on&pvRQ36DV%5{0;mUpRn| z&k-a-0QYmtuPNll(j#hq)kxEOrv?~1;4R`SgL zF0T#I#)o9CBxM)nPPn(+#r)#|PwD-ahuu!2nEnu4>)pcK_e#ct7yhcm zw;R>@)6W5gm}t1|;*Z~-9v&4v|Hy{iwWqJ}hbb30)3VhIbN!IYwaXRKLTU}faglR8 zMUrER(}|@|VVFHm1hcC=hP=wrm>^bB8JdUkk!Hh>9=S`e-gap&>dO4JVwKj+{%VY4N1*6OFmQnc$ipBN;CyMKsRGo!k+rns zp$J^hW_n^^=Xaa?Ax>uvJlujb%M_o^Bb_|t0P>(h;YUXq3DODybeuFE z$}vc!flEZ==NX^hg%K7f=9Ap$Uo-JY^-B>mm%qyo0*Bu0;eDj_r^*-7IJSLfO3^Vd ziAu`NIE!)23DWv;3}8=)>18EaqIsBU>{2r2Ip#A`#C@2zhA|pv>mb|n{hj+P&6Czt zH(Vq|>FU`AwuCPu_j28GJSFa=1YjIvxI=Cq16+ro^uzf8AFDR_P_tiswUB!|T}6Lp zo~_w=tv~9c+GEq2GFQQ9=_0R(v2x?}e4_A)GZ$LtZpTrDsC5{J1^-6%hkjob&o#&g zsE!#Q1JM%0cTp7tVA$ zM3yT)nd7)2{e626AT-Z2^QTH)^-;AI2W#0f8QTvJc9IsQ`E5tjqVs&=VN-S_#?gms z+z-+Ty9j99SM;#;tD%D4{)JJxx@=Kb)KuH?SKLY!WtA^VNer{JjKCzh&!=kLSn166 zXqr6X%i(I*8*Lbe33K&h&~-t8_$u!>=$v9T1A_$jL{E7I*W)Q`R61VdKHhcCXlQ_8 z;9BVBRDJD?xqtD^+OL-$r&>aMAg$!=H~F7EQ)~C763{t!LiaAJ^B@gN{v8yO6}m-^ zQx-PTQf53l79Mh4O(cGwacl7MYrfUJCjmdUrU!Ni)?8slqM^Y!Is|zoZw44f`&EPX zCRCsC@2({wZx8VhWWh~FA#^#3{>E#6^0-dXlJty~%AHB;9!a(^tuf_<=j9Z~edR?{ z(PWIHNf7=AtzXfoj_KxbK@P2`&?}m>(NcQ;`lf%cFD!4N68jep=6UV(17fn)nom=& zJIob~eU8(md=KBK=<;B51nV`%QH3kr1L)*8*!(_-=?{H}N-u!;G{NaZYmkTg5#$4f zG*)LnbjXXt(vA&Y7;teEDbPF4`y>-s@t)pnGw063ILh#lei#GiK!_PK$WKS}XJE}q z!AcSnwCQ)OQ|S8#d4cY#;VXg!U1~q%3Q{lghe+L|@{$Dk2!pC4e&^*bWizop%3py% zbKglP+KHjMahn7FrAg2TjUS{OWWej%X^5!)&N`~nx^&^f8-syELUP#=GHL+@5C1q1 zov${|~63iw2=Fa7h!y?vl(fO;mNfi>|@a%uE7HvNG1Q4!1@Q8*o4Us&Hl z(kfq?{^39TW>p8{_^62dg%8V4T(P(3;&VefR_(eJ@+Q{}V>xy=YRX$BkgY zzKwNiTbG}NJ?+?T%m#o%C}z8xAlJ~qsbyuN;cu82h97*L!Z<>3JzC%4M>we0pz}An zzoBpHyZr93m(cLm7mYijh@nXvZuEPGakZV?9Z-dgs?795^>QKovQfW;QWaX@=^;@V zhYY97q5C9s2x?O4!}RAd1s`21z#mnsXZolx@3=Q;`|ox;U0=?;aQ7K!S5!QJHYFT9 zJ-x*HZp2LC9CFTI$9VJbN<6x>rP{rV*&N+Wab zZ;&IziT_F?04}r8&a30{a_d6t@=Xc3fS2797>5WO>YrTcqa0Z2B=C}W@Z*7avW$z} zon)P-*Tm{nLo8JAgz`^UI~|@|8HJio=((>$mUzgV4sCM1xX<9_vD^DFjv$<=@6!R{ zVKnZks4L;%veP?^GOd&b*b+21#YU+s-pOYZV{KOpcsk{iEp1f`o}(MNynK9CcvemR z)scs^^p*NWf^+naGYGqtA+8j9j2w#>{v8wtZS$E>6;0iGk)|TG=7Wc$^`{C>-LANs zg~~m6)RoPvD_i~EE6+&_$=9*o$*#m5^^ZQSg>;Tg)rZ=z6bUym`B|?W&)Gyyd4z6-oGEhUNK{^)3K=sQb~;eR+uX-`w;? ze>qU_Q6gjE#&au9Tu5rq@EdY@g9l~n_0&5-078y$)?3PKjK1nNe0{iBen-6RrImhO z5VloFF@sA8P?_#658#A{-{=cC8xkASlmV6!W#z| zgh^UVFY!wxnunzkT1ys78ZPUvKXW?p*(GFadB1Z)(q3s<^jiQloL%J}WTB%Kt^H)= zwp0_Yd`p%U3F8RChUk8RoGK0C7+~`|5%1S96SeKY(CrrM;+^efjizQwvg!vMwro!b zjf&7XzD!X^=Cp;$;%5!>6h<%cO%La-oL{Vh`3eUZAQXaV257zTg>OQdDiQ-DfupXM z?^D*)o^t)DEux<&O*E%)T-97Qjl7CnI3)b$w(U^=I|*M|n%TLrGRz(dJhcT~U%OPH zCRP>)t%K>Gice}?&b|?otQWK+N?+{Oq>EzD@{2sGGQY64T1h+d7kd2s@k6@))v2vX zaZk$VJ6CjGgupiE03k9B?Gv70x?v-(nd?BYgQOKtK(kEqMWiypd+G100t?!)@%2{H ztN5Kk6i@Uk5I>M5btz%wui3Xs%pM}lHb2yj)1adJb+xm=9#*I1$=dC*@~6IZIOiyN zZc}28$}#y6r2dBOj$-9Rm}D|;br(ybZ*5zW1=%XXq_7jS(VPJgXm9eD5^4s=}j;^PJsVSYC*2(^z9&Wyuq#=p3ZfaxRVy^AjkIWGG6#tRTF%K5zA2M8T!eS6;vJfrU2Y^&9?R{i@ z8Jr0#i`jx2@ScS>gHmQp-58Imp)ozb)TZoogg(fbGMSj`Fts?;$Z zgEhpUbSDRZ`dL?Al6@{96dzlE_kod8@W7IML6uuR`%j?BuJWD4rB?KemYJ%PbmaWD z%W7v2#Id#1HvX4C6ixJd1@G`sH+pVPYJ+vIUTJ+cz6@37h!u`*f?e}EQyKkX7v9HM zuj3(`pY14*vu&!gETVI?nKD~;k60jxE5;FrgvDt84{{#L<@4Wy3 literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/phone_ringing.mp3 b/TUIService/TUICallKit/static/phone_ringing.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..c3838f3323254eb5543dfe05e57a2c2a4a241ade GIT binary patch literal 8752 zcmXY12|SeR+kW1eF*6v(GPWY4DA^jJD4DSo+NcO^$Wl?3R63n%UIqz;a$22Cq#QZX za!wsBGiZ|*r)d3mY<4Mp4Mj{XMVq_4^Gk&0KTM{a*KVU-wh~K2CIm{}2m;mU}P4 z7c~5E4Dt?Giodh*!*k2}O)&}Ef@lQJVF@7m(4EY0ADq-dA#xweq(9H@dJqoIy9I@Yy6P(V3sc6Cs1i#_e~r5uwnW zdF>*Jgz4RqNdi=H-=du^FaAmN*T4IRNyycnanh|v{ACk=5-#u9tI|}v1G{TYj8A*@ zu4eZuuAaZM5MobND-DQ#sRxBm<2G*~npgtF(P|Hid`}WIQ~jwNhDhW}#4rXjQ0}4L zB_%_aA2g(T8~-s})i+1h|M}ImAcIQD#UMX-UexMcb|1fg5qq)!4W(_n_VmQvMX4dM zYGU;Lz=ur~KAo#br!`7wY{Wrs5dsS$ZBX5kVH|-R2}}7`gjg<*`MINOe)&9#PDW1* zegi|UHH~q!Y{M%V|4Uv>%MITnyd!LJ;F(CWXYDNB@i=Ozb@H|w9>vT^R7l}7@|%+w z3+YT_q{VkzCh$gSx7F>~93+^L7J~+|8C#0c?;H8FW4BGF5i72?o-22jlvbP#)1gnQ z6+isFI7huK@Q7*f$~GhMhM`LBMWed+E>76;m$~iWzURv^z7H#35lQ!#&~=cO)J+s2 zLd0#&sT@lYazx!}X$%IRzwDtXX3mtW@fDVKu1@P4PwD^lT3D9)+&(0f@#_t06757| zmf!LVP}XBjcv1Lz2b$N?n`nfNv8H_bA-*?31hMSw7$Uxa?7kntW;6UTG;*kvUfB?@x%sm0RAN*+mi+H-*n` zFNu`SOmZ;WbQ6>wIa5CEdTwtH#fy-I;3#Zp@%x9W|0J$r32IF1G)9{I=}GRB2_jU> znvo$ASQA!cT{bhf)*DT79(fOMrgnMx&sR5H_}2W7yFdCO5K*vn?Sv3z&{1tQVfssW;Cj7NvC}j;3^aq;Uj6_^3HF;QH96#fT!=43maW zB7kNO5kYVNg{xk@M0j=5Wl>m->w%r22EO0+fHDT5D1p8hT0fhfIY6J1$3K^lpY>_2 zF``lU0xd-(v8W)@n5_}vznx9hUtQpn9l^K3`21|I&@0%2<*x_!7T;iotM z%5_hyKlN7l>3vlnCuFI`JDykLcOiv8??Az7+G5=<#Ma`QY_+r?2s@U;R3zeClK+NA zkc^v6{X1!OD`c>Cy77y0DWX}(AL?#}{yEm~ijCc0@uRm-yHj8BO$S82tF|AHeb#0g zCOhMVe%sUb?KOqJKuZurEMa@IIUJF?fa8S-lImYRe=7P-hs&+@h=I?E2tJUeYTdckQ6IY%uEAg-RmUy|9p zm00ZGh3hY$9>M1mX;O7-RvsVOqFBGc3`R#xFT>iM$!J*ZAcm!f$xuzTBc}d~dp~{r zSmq^lYfWF53PUYTYSsoT&+5>2I!4o5_ulw(-H{p97uXd33eAF4qN%Wh&F09%MDCFU z5zVqYmw^OMWcf>6AAN+FCk@YupEf=Yh^r^qNIlbW8o*X~YOj%&LY zRFi<%!Cs!NQEc6rG|r5;uNE^Y{1DCNETXBVj?LB}0bwN&iRz?%zDFHIoy;pMmdhB*}np9%p*h-U$YGmYLd~ zyXCj9TXMqOK=va6;-nfpy+{dn`{OqSGX`4?xE6~|X}VY6!e5P+h_-mRnX13fX0Boj z(WE;W*FR$VR_7>!s4%i*qG)8DW+fV6qrtx3W`ikl8L>JIKKmACwxzyu{PQ-CFlGhM z5q{mU>68tJr_XVHm%}{x;w_BI`NWCnO_>)xl>Ey?5XCEWlMF3`QIGC_`jR8LmO2hvg+rsl(Rtfj$*lfuhcePsm2&>Z16TS5CYw88)H>3p!`a<%q4$|QJi;No(k)dwK$P)=>lHH6# z23q#*VtA{n!&+WYy&_wa5cX^pO1Z8Ea@IGQNdhA$SR+=%WJqJIJ7bTxzG%3QOoAK? z?fwSkTwmt6|K}2c3A9BQC6s>Lvh1)wZ)DjqvPA+HvfC#Op(1@l9hZCN<&D15(ccR)(U`B@7C8x;){PZ+7|=Josgc%jW==IZ@YIa0erG9no$YAx^8FP5e6Avf zwvbN8^OwZ@as7)mt#Ll&&mdw%0~w6q{QR)lB+bNX&`X&o*nRwzXJ%BFd5Rm|Pd1V> zJP>FzWy15eJ0+{nz4>lE^ESm}aN_<8)jMV#7_nKfV9SEdjf?Il-5+Ghk;WyL zBh7PDRYM7d+>KrWRqY1HWI` z*BzE`;;8@lIE7!lU$K&C!v4e2kedYBO(xQC{m^tCgc2=d$)bcn> zzTvH@sXQIi$*Iy~JN?{oKBi1XBs?~lu7ZNZzz^=H|I_IjavblJ#jHLu(WGWP(? z&N2y0Yz=nNlPBkalEd0B0}B5LB6KWQGWik6{7g<}9UJ+C9@uD{fsjNmp01sQ9?kaA zoqYJ86bokZuHbbqf2cL)%pWQ5+^$_NdR+I_bzg7o$(H%S1G<^M67lRi(Y_J8V)x8$ z`F7xV?xmk7{A5Dcd{XFpdl79?SM9^DVni?6ezcQZnY8?1WmWT}`?sd`MB1$6axFKx z8aP?)+L=8oc0)WuPA`wGVQD;A^jBlZqvp2ypKCXrgu6HN$J`~Sk-2isv)JcL5TC*i zMue%^JEf(FV{+SuEVoA9V+Z1lx02|m!t)aCBqBo`oH+Ump`CC`c6n6o*NTM(PR_}K zFL`tGeHIwe6DK=H*~i9ixz=(^24n0jg@7jTlw=8`r6tR|B@EHC^e^njK z$(FU3oIBe#$o2>psxG&ePnSW(LGJ)idhVp~4H4=xYwu=@IC_%WnzO~od$5q=&t9qX z!CNDcSby)LDtVB1)T=$x?pv3&&owb!*Hf1A@%&`w7z&)+ttYAmcCq9(3kI8atbwBi zZJg19bptmc;czB}PovlDFnhJnS&BI1#GrOILF4%*kc?7tM!s!Cv*G;{?rkcmH2~BX zaEEn>Whpz43qQa+ISlOJEnfNu(oi}>wh;KnVkO~OD^s1^BU#1cu=?Bhn&bLmAhcWe zwLK5xcRf&)W+U3h6-ma+N#sKRNa+*E+abO^r83AysQ@g1F&(A(l3jBa(0<-lX&G^0 z*i2Y`^Q-&?WF$RE?JNDQPe3WgQBgD_0-r{^l-%wF#^ZAV((*L6CJ5aB*Q8KDlH znFlN7(n zHh`wI5fa5?d>?g$HkrLrv&Q)RiPxlTlzx9)KkP`|-|37b!oVP{B?Qe^X&Oh60KM>P)(;Q5gu~%Wx z5GPSZ0Q4kTRKwT{Tsxb!Ff@gTP6S1+cxWEQpNY2{-7qz4Dbkv9o?ljsXymeJ<5ChW zFRW@{B%yE+X#-U30~zQC=J%hMoXsgKqe1^bR)b^Uy}|D*OO$IIzJu+jz_Vs2qIT^X zDH9(WiLQh%CX1Bg`oW#VTbsqe_>%ME{3}vpO;?i0`QUj;P9RzkUm<4V6M#x*7?F01 zRlnX6_Cx-8UuZE0Rh^SV8NkaK(z4-Lli39i3{x0Z?VwS6=repkNWpG*^4k}VG1K_KbXk-%%XsN?#~ zR|K1drHSkdG|Ot`&a6vBM(Rf16cP!vKhQ9KfYop~yqtLz#;%Fmqy81DPK!aYDga>M zsThoLKh&4tYl{cH%EEejMw-*6djm`B-xoC;{rIAX!q-6P)s)p)ymq9Q5ih96`Y%XL zFkOa_i}nZagM5^7ykY8u1S=Sva%Q^hS>H7!1cWbd%QbPG26vG?s3ZpfM%2V(?co4{ z)d0iE^IYIZ#$|viUkaZ=uUT#ODotu%pk<-?52C9RQet!}+BUV+z35F1can(SlHdxgf8tatBrPuTNt958fGpC`u*1m#yc-Df|rkCvf3M;<)tqju41{_D?(&YpecDEx5o7k_1#R>-}%4#dqm1q zY1N?eoBJj0<2mTTs$=_u;#(U?=VD0AoKN05F}kg8NyuPVvU6aM34dSGb5Qb9Z?{qS zng~6%#Qdc+U52KB>fd7X9mV7IsiNcidpjd%5!`P-2j}|puR?gfLNupQs<|@>NfRmEjf1Sj^3DI^y9wh0n}agqXdg>d%?-pxIRIKmAbtnQxnp z@zwEX_E_D)Z|H>)c_NI_co-=j#uoG2unFKB60!7;5jQ;}-DKAHJu{D0S%n@=_nlq+ zEjZxFxPRh9qi0iAVg1nbeKZlJAF2P=8*nB6oy0n|!fPTDS66Uk8b;7R&OcYNQEv@jI#;S$_CRh* zyF~2vjpc1eNRWNL{$LV=a3~4m`(XZ+yj4u>|E7$e`SlgZvu9b7G3Gxz$Dx51hz?t~ z%VfsUOW#F2t??+h<#==V^PVMN0uITAWA^KyH?PHU{Z6M@yHxq$_F3uNVz8m^){R@g z8^D+*{O51^ip_Ywu-ozcs%`Hq#`*TASSGnr3F|#84|V)xJf64ZjOv;2S6bm|_axoc9qrQ4 z7(XAzof@yZ&Wa&IoU+<+e;z!rneyi-ohmAyB-zJJXxRJe_~qSoKTZu-cobj!taLOY zEZUz8{IyN5E;;-~^u#{vM-5#89t%|<5R`yI7n5jS1U+<$Kbu<+YqpwYiswsIrJ@V_ z^S0Dzs{Yfp`&*If{iuL+6B>+k=mXq=dsts3c)Z*b1DL@V z=`tC-!_u8`19VaaUFPcFaBOG(kUyT6@e@KSipSEf>SRXER`wJ7Cz^2cubdL|14~_zZ5r zCbKsbe@?{2_;&0MYf`a({uJ39JWt|$BE<7Ahs0Bv&uyZIzY~s_L(R@a7``o3Tx#hyX{yNw8xhot3s!QX1O014QAYo*EC(HH8(CE}z+(D3F zlllclNX!i5)AAKDX8&X1`NEMjp$=1gK8f{%zKLdP_sN@W?vI>S$Mt+5gcdvuc^mNC zRpr1~#Zo-Mnd)siW-#a(399}nMd5WOeQY7nu)FDURo=dEd;ENrMWVI3|I@WMluz;l(Q9|JpvABJZ&PF9M0Qk!-kxE%~X$|(K>iBfs%@O(kq>A4Z( z`OrV%h83Rg>b6wAN{8%T>Eya(@nHNj=qNU=R@Dv+-i5{c=C|XUKT6`svs=(2`IEJ-s0E z$w&#*;nTH=-gWncz3^4ALj$^wFRm~M4aj&1e^8Z5fTA0{aV?efod; zA<-WGIwt1NJ);>&)nA&r*%bT#Oq_4A|L<3_3{9#*shS%Oztsp;wFeJJ?UfBB9(*lR zCE?$FP16^HY8f^lTzq!ZCV<=hNPG_^NenMi^1h?*ne!< zAJTL9XripVZIl!d@QpDMRMUm+ZSVm%#S_*NJSWS-s%#n)6#rEA z_S8Dn%pU6esccm8(6lf)x$Ua(&6ijsia(x@um8(e`j+v6Iv(<@!TAd32P$9T`Z$)} z6_2^RoCs%cnCtEQ3_r%sB}{a`bu+vo1XPo;2lQBK!WZnJ!&3o9i$a#bh{zsKds240 zfx^f9S5f&2=Ueap@=4zII3C_l9dW+G{DrDOEr8!XDx`Z$K#E5Vu^(Va{UUso&jnQ( z_70Jxay0(pT2uZ%zD1AcM@}=kp1x^laDKFN7=^D%qQ3v~iLOt)2_w+4asMgt;CI&E5>=@h{si@)^u@9{i9d^;Sr3ea zp1|qQ#M z+7>*Z#Bhg5!F~{qZ8<6!u5{R5KK%Ee526&U(L1L$!rCw3MDfS|d}GRMrh$mYvy4X# zMTq8y^9l9`j{a*1Z6gX7+6C+*hHZiti{JkGj&XN*GW-d(;|w&kS#%^h52B zhk2{1e5GG@JwlH2Py3>6#yH>3QBP>V{5w}bmPcuc%49Z7FKV%B*rZni0bZt`cIv=j zQo-VqXMJma`Y2ON{RH2VR?HsVvnYSw)y_5F`e3+Vd_L0D6`OFr8u$Oo_HG^`cBjTk zc?*#}yI(}#FIowzjo3JGtB#uDHBTYIF~nsg$cA*nx0L$=!1d{Ax)`L9=3|DRm%x}g zz3_KD_!FuS2T}E5acfrMd?lJI;CP=mW@CTw^G(3#19(6EfdA71pAHI~+4d!7R0J$- z8*46`4QhRiHt559z&g@v(#^Q4*%MW=cNbX!pz;J&gx>Ff;?ib~gwa&A%pxMYwnP$>!ABtBp|n^$}X5`$mn*C;0xB;raLu=PT@=L3qC7e1%rk zcZ6zJ|5!5mq^t9tujSTi(2Se_&$<>#&a_nrJeuaVu*vY+YgMu0bdqa**Q6V3OY&}e zXdJTBzwn5{r}SyCIt%N^us%o8fbZ{4dQvfgtR2ZXZxSJ0j}p*7$}`dwKY9=8+&O*e)~Sm(?>>C~`Rn%^cOU18>%IkAEL9TZ7tC_bB_yeI+w4WxZ<70U7tqBvl_iObq;R2Gh@kPjt!kH z&Rd0qPnebEND04O@o{eWjGWSC3nn|TJrap&mWsTx*-_KzFcQ>&H2Zh*QqqEzI}N>$D(*Ek;{L% zu4*h(EBdC9;qTYnB=v3Xf&KC=?(+y|)i>_Vmi%+Qsiuk+WyQ z?+6c<{$BY>F2~#7@BiwsN?F$6Txre1*GFxSXxs2@Icy;rctNxSFN1nRyv6 zB7Vn8SzY_(HS0>th4!t^nJ;R7epov!fPsbgxleOk~ zQ?XfoTCC%npw#3hUOTf>SBnl^)7|E zTo-$(hb>;2G$C~Esy(TtTeNOS8U+ZrB+9a`lBfzc_-H5hmUW*b$8P>p&okI;AGu89 zD$?1m^2&;xDQI0#=)@zRwr-c5_+Hj@qxZIyUoV*6mc*qo)lJL>CPM~KS3j3^P6$uHq2->54Z0pVnl71_Z$6wjf78RKuMVEPlG`xTIi|+czewLJ@AKF1Z$Er``r_^N zJCC>RKeKYn;l=Cs&sx5tZR)D@>Z#EMJ)zkh6`c#pJLaFhbo=iqw zE!k%1op)dU-AAC`luCm9f*Dxe9>28C?_{6c!{72fUtc`Gd1J?>#pOAv;a(ng`dZ>5 z+^yOdfg!>4%+tj&B;($etIsFhG7w>X(4CWPu(v#-PhHB0*L=$mN(L*PIvUuefR5nrObYCuGWJk!Omk za;;w`&Z^50%JT5lb!N9+vcjERFX&0udzR0CA1H^~z3p9)x-lkiVQR^_Yx8O!&xv>P z&a}TBs$#zXiICH^+4DPs&rUFLDC*XhseRycCJ_)J-cNCuXx;oYl=$#i_Jm>?xj|4{$bBO zZO68Z3(KclmdX9^IvuWIxQMgwwq9jV?YXY?buy=RS2tX0X|u>X>Ce9Rlz)BGmjd;3 z=L4jI#E*YuaeO^>j@g?(g2&4>N;T63TJFdEV9nIKe=G9LuIyPX51(yF%s*PlJyp%p z&GGuCJ*G>{3#*#DoYy&C_@|xwZ+*M;iX9>|Sapva7WcScu0FM4M&yO96+8YG1SN(T zaL?*&|IM#H_0ayTx3cUG0v(H1bn^CkZ`gP-b;tkE%r!naG785hp6Y8+_-r>l_eft~ zEL+*$oBXHeDSTV8$?zbXy!2DAIR-mL1twHaZb+FF(fMaZ?#=96ZsVkDQGAzw%3AL$ za0 j`PXc@^YNn4A$NXnuKePU3XVU4`GdjJ)z4*}Q$iB}PRu>p literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/switch_camera.png b/TUIService/TUICallKit/static/switch_camera.png new file mode 100644 index 0000000000000000000000000000000000000000..ecf21f05ff6e27fe986b8625ebf15e63ca5f9652 GIT binary patch literal 799 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I3?%1nZ+ru!ssnsNT>t<74`c#K`h((M?^gls z)+h<`3pQrZXVI1v){y0X@A>=n+3nTNin~J&v{;*cx!PAA=WDNW_t4_G4VjOtayJ6? zFll?bIEF+VUON3{(P{&pR{uQ=d?Fk-Z>wcqe){R3f5q`5B|Q_lt~_^FJNK!#PbY<2 z+s){r?(+ z>=KQVLT$_{Ggh{+rOa5{!?Y){@!qipp6)5F4J_PKc^KKcQ)?PTB6JjO9lGo_N*f%R zrY&deX}oTBK|A#jqlw$CHO>dBnkQ~yy}+1rd*Zef4zUH6%$Ll0A z)e@;#!SU(U%D=Aup>j4t5>_YJ4^DRbw2GCf)c@{W&F@HO7FzsQD-fLloH<=Dx zuFPc&Uf=&!GCzo#z`*LrTsO`aH8&nyY6c|m{*!_Mg-f)Zg!zWpW<>mSdw0RSB zWG=qkt#8j@ev4`H5$T3~tM*@f>7hRH=CRe=IseN&d^00A=Y~q%-zy>q)HWu1Rb~hO zcq8UI{n8}Or!6cZ*A6dJpK^|o(L>>85Sw3VrJZ=c)sD*yol}(<-*V5f+f|kk&)L8g z9c8U{=i0lQ??ktm9A>z+J3EejcLIZ2&g;W{+t%y<{8*$B(I6$O6XTs0HA_x5_o~SP zDcM}@zt^{|V?X};Q?u)d8{BShMAd&y60JVly*J}nTuh|qEAPZ8g4&-HwDSoVsq#Ipy@wbM5*&&m%_dvktQ zTiJvOH!^=QFfgz4ba4#HxOaBe%d$rXJgu%vB<4(D-6W83gL|p<`~M})jg~69ZQhFM z7xbe}{4ElVF3SmK=8ivp*nv}c0+S*~nbeFVl2b@%(;1ft!<({XvxPSX zv4mugPZ08GJD>b&cZ$uPc%j|n6nxlU^<*dN^&%6>pXRWnd)VA&6ee;4nwyCjai(T=VqqdpSpZ zWcUmYOki@7@!?93?u+~V?DOj)?c<9%nQolYej$0r<=IlJ=|(4cm^6frILaBdS9Wgr zEzQVb_-KK8O5V;-{4W(5)R<&;oIjRc88E{va$YRM2HpdXMoCIx^Hq;d`(V|~z+>T2 zCR=gWs${*+`Oi}WW;kdH9clFR*m;&~w!8v^BCExTplK$SLSjxXbJ7Bgc^TN>#hj?L zX8QGP<_VeC8O}?@Y&$QmHjA!1V=`6olKdO zNlIRvG*#g8=Y&VQ{(gUZd4@^2q{Rah5tBu}QBEo$OENdkcDM7rpt$*AVsg>{V*5EW zD|TgF=s#e1Gj^GdTU-hs^P;;)xMe3#K6qWrH#~lBxX6Jj`_eVpaZgqlPrkpKVb}4O zzt8f$xm@nu_l_~(TDXQY|8k22sd+3t=l8LEV(0tuV6%SXHqLL0`cHlrU%vjk-rkPS zD_Dr zyEH%G%HE?v-_-)|-j4ZSx%iyR_qMgij^EJv`?u`<lr*<{an^LB{Ts5h9_q3 literal 0 HcmV?d00001 diff --git a/TUIService/TUICallKit/static/trans.png b/TUIService/TUICallKit/static/trans.png new file mode 100644 index 0000000000000000000000000000000000000000..7a3cfb56a9bf099e4c37a555f643efa9b2bff32d GIT binary patch literal 714 zcmeAS@N?(olHy`uVBq!ia0vp^7C@}R!3-o{`*5BCQu70RLR^9L|3M76$}4vOooG@L z^$#+}jrq?ks31OmyIw6aDq$>Ato)BMG64XZJ424pvv@|8?zXSEa9&xz5_9 zQzwO+u}CZtY+ztuT;}QG7~*k!Zs_Z(CIcSUK$fWs8!Bc$`ulEK^u7N#r)?3iOK^Sr z^YFsIew>z`S$kUVPg~f!mATs6y@H`(cHai}j&*Gp`aO1D3Gln6!K2=Fx7Z|q)f92z zspUtPbyqL`lr-%Oi@9&BrbC7gx805n9&?u@Tbnu+9CPcl)8kRCRk*t?t0kezl{r!2 zCr{=gF`-{|+f0@++!mXC^N0T9I-!o!Ou*-n$f}f_@9di@ zJ0;KR+KBdPo>nd6eO+=cO77e@!_6@XD<)6=uzhb&>Fbg^?|IE0cIYe%;=HnH4@1{ @@ -505,6 +538,7 @@ pageLifetimes:{ cloudCustomData: JSON.stringify({ order_inquiry_id:this.data.order_inquiry_id, inquiry_type:this.data.inquiry_type, + inquiry_mode:this.data.inquiry_mode, message_rounds:this.data.msgData.msg_round, patient_family_data:this.data.patient_family_data, is_system:0 @@ -843,6 +877,7 @@ pageLifetimes:{ cloudCustomData: JSON.stringify({ order_inquiry_id:this.data.order_inquiry_id, inquiry_type:this.data.inquiry_type, + inquiry_mode:this.data.inquiry_mode, message_rounds:this.data.msgData.msg_round, patient_family_data:this.data.patient_family_data, is_system:0 @@ -900,6 +935,7 @@ pageLifetimes:{ cloudCustomData: JSON.stringify({ order_inquiry_id:this.data.order_inquiry_id, inquiry_type:this.data.inquiry_type, + inquiry_mode:this.data.inquiry_mode, message_rounds:this.data.msgData.msg_round, patient_family_data:this.data.patient_family_data, is_system:0 diff --git a/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml b/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml index abb5f76..aef53d9 100644 --- a/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml +++ b/TUIService/TUIKit/components/TUIChat/components/MessageInput/index.wxml @@ -2,6 +2,7 @@ + 视频电话 更多 diff --git a/TUIService/TUIKit/components/TUIChat/index.js b/TUIService/TUIKit/components/TUIChat/index.js index fc1cc03..d980071 100644 --- a/TUIService/TUIKit/components/TUIChat/index.js +++ b/TUIService/TUIKit/components/TUIChat/index.js @@ -148,6 +148,7 @@ Component({ comment_id:'',//评论订单id fromType: '', inquiry_type: '', + inquiry_mode:'', patient_family_data: {}, rest_rounds: 0,//剩余回合数 msgData:{ @@ -164,6 +165,7 @@ Component({ reception_time: null, rest_time: 0, doctor_id: '', + doctor_user_id:'', timeData: {}, }, doctorDetail: { @@ -453,7 +455,8 @@ Component({ patient_age: data.patient_family_age }; this.setData({ - patient_family_data: patient_family_data + patient_family_data: patient_family_data, + inquiry_mode:data.inquiry_mode }) let duration='' if( data.duration == 0){ diff --git a/TUIService/TUIKit/components/TUIChat/index.wxml b/TUIService/TUIKit/components/TUIChat/index.wxml index 40aa121..c0cab66 100644 --- a/TUIService/TUIKit/components/TUIChat/index.wxml +++ b/TUIService/TUIKit/components/TUIChat/index.wxml @@ -48,8 +48,8 @@  不限 -  {{rest_rounds>=0?rest_rounds:0}} - 个沟通回合 +  {{rest_rounds>=0?rest_rounds:0}}个 + 沟通回合 @@ -83,7 +83,7 @@ - diff --git a/api/consultExpert.js b/api/consultExpert.js index 44912bc..472637b 100644 --- a/api/consultExpert.js +++ b/api/consultExpert.js @@ -3,8 +3,11 @@ function doctorList(data){ //创建问诊订单 return request('/patient/doctor/inquiry','GET',data,true) }; function doctorDetail(data){ //获取问诊医生详情 - return request('/patient/doctor/'+data,'GET',data,true) + return request('/doctor/info/inquiry/'+data,'GET',data,true) }; +function doctorService(data){ //获取医生开启的服务列表 + return request('/doctor/inquiry/service/'+data,'GET',data,true) + }; function getEvaluation(id,data){ //获取医生评价 return request('/patient/doctor/evaluation/'+id,'GET',data) }; @@ -40,6 +43,7 @@ function notfllowDoctor(id){ module.exports={ doctorList, doctorDetail, + doctorService, getConsultTime, isReceivepatient, getEvaluation, diff --git a/app.js b/app.js index bc6f605..2d387c4 100644 --- a/app.js +++ b/app.js @@ -15,6 +15,16 @@ import { hostConfig } from "./utils/config" const myconfig = hostConfig(); + +require.async('./TUICallKit/TUICallService/serve/callManager').then(CallManager => { + console.log(CallManager) + wx.callManager = new CallManager.CallManager(); + }).catch(({mod, errMsg}) => { + console.error(`path: ${mod}, ${errMsg}`) + }) +// import { CallManager } from './TUICallKit/TUICallService/serve/callManager'; +// // 实例化 +// wx.callManager = new CallManager(); //import { genTestUserSig } from './debug/GenerateTestUserSig'; //进去小程序方式origion // 0 正常进入 // 1分享 //2 订阅消息 App({ @@ -77,9 +87,16 @@ App({ userSig: data }).then(res => { console.log("登录成功"); + wx.callManager.init({ + sdkAppID: Number(this.globalData.config.SDKAPPID), // 请填入 sdkAppID + userID: wx.getStorageSync('USER_ID'), // 请填入 userID + userSig: data, // 请填入 userSig + globalCallPagePath: "TUICallKit/pages/globalCall/globalCall", + tim: wx.$TUIKit + }) callback(); }).catch(function (imError) { - //console.warn('login error:', imError); // 登录失败的相关信息 + console.warn('login error:', imError); // 登录失败的相关信息 if(type==1){ wx.showToast({ title: '登陆失败', diff --git a/app.json b/app.json index 5a7ab07..c72f3f8 100644 --- a/app.json +++ b/app.json @@ -19,8 +19,6 @@ "pages/address/address", "pages/editAddress/editAddress", "pages/consultOrder/consultOrder", - "pages/checkOrder/checkOrder", - "pages/checkOrderDetail/checkOrderDetail", "pages/orderDetail/orderDetail", "components/consultList/consultList", "pages/sickInfo/sickInfo", @@ -48,8 +46,6 @@ "pages/agreement/agreement", "pages/agreeList/agreeList", "pages/imgPreview/imgpreview", - "pages/sugarDetail/sugarDetail", - "pages/sugarSickInfo/sugarSickInfo", "pages/notify/notify", "pages/inquiryForm/inquiryForm", "pages/sickManage/sickManage", @@ -63,8 +59,33 @@ "pages/index" ], "independent": false + }, + { + "root": "sugarCheck", + "name": "sugarCheck", + "pages": [ + "pages/sugarDetail/sugarDetail", + "pages/sugarSickInfo/sugarSickInfo", + "pages/checkOrder/checkOrder", + "pages/checkOrderDetail/checkOrderDetail" + ], + "independent": true + }, + { + "root": "TUICallKit", + "name": "TUICallKit", + "pages": [ + "pages/globalCall/globalCall" + ], + "independent": true } ], + "preloadRule": { + "TUICallKit/pages/globalCall/globalCall": { + "network": "all", + "packages": ["TUICallKit"] + } + }, "window": { "backgroundTextStyle": "light", "navigationBarBackgroundColor": "#fff", diff --git a/assets/images/video_bg.png b/assets/images/video_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..b0d2d2cb69c01b498a9503630fbfea2827dccadf GIT binary patch literal 49229 zcmXuKby$<{`#%hb0)mtZl9N(t5l|R0rMm^BCZ*Edu!$0abT^Wd9Ni(E(lEMvl+<8j z?AiPCeSUx4$8rC49ao&^tIjYj4aEod8SfJi5Ij&;lG7m|AgUrDxbuSa9{!K;*&Q1E zhtN$&QHG#=gn5sE;3H#dm(?0`F%`}b%=a^C%X zVymk3m9k%{Cgkgk(r*gj7o{=_e#qEMiU+bb1(CPMt$uc58_N=vi!QmHU6WFsmc#vv z5J-EQhsLMg3jZIES+lad;!i$j?PRyBMdQ4)MsRB)OStAU_v<%DFwDxx z%~4Z&q4?2r)8_$vAj`m!wi~3v#E=KL%{Ir!b)(x zq3O#@xN6Wc_TNw9trrG29=8`OE$K(N0m&sC%xm%{9`tDPuKVy6aBKf}V1f9TfvHOf z)s7)2sqPnJjI5?xtdbEal ztxZyHu`Od*te8@0W%58XdGg%(Hc^X#%q8}U$`|X>tzTGnB{01#xi~M$Rr|D$+JT_w zrl(YS8_b8h0;*5qBuz(f=g|P%C64Uxcdn{4Nhr<-jb2fkT!M;go_RS(Ysi~%UxYxr zMt(hL;HXg{dlFT00MxsOD7JgZ^W$f1^I^~em$v3vdK^uRROgfRiTZmQqcifl0ee8> zc;J&3zQw5EUS{@7r-B(({y&eeV`zK6&-d8oUmji7(E%|TtsDW{6BCbC>qA=H!sbC~gT1MV)|GmaxX7 zdMli<*jLc&^fM70e9|2i{WLIGl_gPtK;o;48`FJGZR(#Nl^#)lP}AZLI&`U`De&{n z6!-&bUFKa08FpoUw=C?)+aW>9(Jt?(M@&_>s%W^>_S&G6=g?^8CpYWzuhZUi%QqvT&vk2M4qrFrY7W-zbk42QZ;|4(*4gac(Lsx@ZEl=toDn? z%J+$^XHqA0k6JT8IrR$ef_?v1X^&MLB%_W1*&|ewLtC-l)m)o_>qyP=nfV<(KUJDi zY)kjI46{{tLf?%wohNPzes9!q>r0^+=uK#I`*r(ohuI4!RZh>WquXeoG~DYXGLA5j zO$v9wsB<%uZO0#H-AemUn65KJ!MuY8|-@qKh|h3|N0Xg1kKHL{~!v zwGA{}?9&sf|8Ra^VZ8EzJ7zGu1Pj}=M+Zsc`WnTZ7( zmw8GN#_Ej9Hyrb|JlJUkQth5m;W%gOh`?P88H#_P z&{~mlm51L9iyw(W2zvSfSC+2fVN?m4+441VOHnBMMQ#Zll_3%X>R;!aNz}Rc#eLxZ z;$#UHRcHWXzpR33AmP!B9AqPUc6Zoh7^dBI4;d%@(`hkvqDov zbTg-9NKN0&k)|_1t0);^m42dQtLPZOA;{9_$0K*Ks{31m+Cm4QzH#IuVq071`TMR- zEoxNVebno>>L~X(189IC)3Zk2gh_FiJ<3#WJ3G0 zUu77r>tvDeLv7;)OJC9=FRASV@l#vuT^L|$1_;PO3{9SU_X1>psY~~OE-T^Yrn-57 z%ABj`cVLub2iCKX0_`bwY|wxs>Azr{W7;+p)SRf!y6M?I6?c!MpWo+}ZKi24NSltS z+IS}|MfwJL;^fZK;_p>Mw%g^-m<;h{G2j3dNAX6K!8V&t=M<1vt1rhq8I(*Q=LTsq zGvpf#Y)voHKOWOWJvQBXS-fFt=|p?b0W{hr;jA+J&W&At-F@3k=Y8QP4N@CT?yKjS zY0Gyzv;)lZR^I@<68A{{f*LNk_4=lztIIch^PLBmL~zGm+1rA+6%ln@MHE53ZLlu0 zMAoC8&hv@Zf>2XFMH9CB-k{dUGWCm2{vS?|Ex=NpFy2~G@wlNcdGgjXdw`lqA(<#| z!zx!kDs5Sa!{$uMbixJ6M31$9WqjM|W8$czy>n|{AIuXO9+&sWNhO-x=t|0#NW(r+ z`Y?r2Y)SLz83N{$*6uX*?)#?#mB7Dxrx;){kI#MG#{~ipx^HK!!p_wn8uis?y07!Y zW*^oE)z`w)IP4`R#O5!KNpmdycwuH2eWvgpSE|i;12ucLMskbHYtjsExbAsHz;@vpu=&UBB;3ch*fySnhf){dm(F zmDVmBBIw+c=le;m&$tP#!hEb45O!thGQe8oVN#aSiSC*f;S5; zr2Q{W|7^ria}4Nc{Do7ZYZa6tpS|v!y*MmL+c#bN(U)z?({_Q#cD{6C{5COeUWJqn zS>1@8@#9IVcZJS=Gn#Q}^|*F;YsJ<4QCcZO_j#E<3&PkSiSg)#0QMAE{)uErzE3ut zRn~VYT18S$pF7~kQ1a;ggdG0Ez)AhRGp?HQkb=!xwoKFez{PvCjw+`L3+qL6q|Vx6 z7%y%amj`fBUkyJ{`|aL>)q0){TlV+@U;JB2P>vaEA6x2O(L{Q<1WOp-B9p7?ug3^< z(~Jwt5@Apuy%*J(J9pIvl1k(CKV*w5jiEqD!b9_gdPyC{Y>U=KeYU#+gLlSiDW0aT zVo9LhgX5L8A=j4QfYn&qhxLNOz5;Rt^-j*?5jnymM8@QV87;K3Pd!aTw5Twz0J2wH z)8|f`w-vWn9ws)B^@ZeP(2U2XrH6@WYUyF?&=t>EY`@B%KNzJ0og!qpY4-iHp?jg( zo>8n49s~UsS?Pk{=6*GWh`43(Ij^4aI$% z1}k^&OOG@#EOZj)Nx62y??x*G?VG-P5|R~ORoH)gazdx}GQQunnVyI4j$&Vr?P|Ga z8TH9D^VPF#o4Hz>$H9Za!4hU-;Y0`L+Cc;fLDvdNxQE4)ww(Bz=l9}0IkMp3r_qu1 zkpE8_bXzCxCE;V!#K@Y^mKo0kv(G58>QLde80B$*+HsMRBn(g!0@tMar!s8@Nib_O z%YyZtCG+dmxn*;og3sa;faQ|7mq>ugWYP+jzW!26xUqWoRr3&MRZ(lf3%bHoqdw8c zhvP@lsvxtz>Fw5X-g`>XU;DV884vLaWc$w>kX#sXP-r8897{4uMZ155*1gZ^HUy93 zW&hMI(&jWQ=SMiUqJ!=7yZyX&+cE$!*pRIFVyGQkDd3cfbB&lNyTMiHrmLf|BZ!gu z1Mt@f;2cxy1^Wz%LJPA3oOJvVe(bDBqmk)Vyz1EY0%#%iQaSV?~qlJ}XLpPTj0(x{M(F2;V^5XpR z(dIYgrc?aZcj5~H6XV*KiFvJDO7oxFvmluxXGIFS-|J}Vo|bI@f6oSW-B(Wj(XT?K z`0@CN0mkQE4`IKV&zBV#XyRLIxp++!*x+uBe3HuJy`YYK z4!PxfI#XX8xG0fE2=^nxXkcVS%~&qot}_$0$|wG9z52iWG~qDnDaK59U5hYB(}=y9 zww8eD5=HQJK!Wnu@{RijfabQ~>o7o^(5Ta~>8Uo$*1)U1CVt*+z}NoHRt`~zmiqH# z*_3+~beN`RMiIsN2L*~W6a5=Mc&SB}L>W$zHNE>Sg;OqDNtV+D_N6nag~mJR!&!It z4aUubwrx^W4xo0dBmGCfu-W>x>kR!M(frc{c90`4rDA$joAOwR%P0&1BHM8y z{aQ@JhT;L02rLF?fmSNh6fgHRM(AhR!dcD>#BTOg5 zeHo0k0$}1$uSU<#uWP91q;Nr;>+LW?kj_!{6Atc?kV~ZLB_BdGUCES1%Qldvv1O6i zBqPFA%VXmAE>(m`zGCR5U=5w{FZR2S%1+#ZKi+?<%whnhKdrttdMd1+zIdc3&@R?w zeK~CrRD|x}=UxyLU zqLl}u(?DWhTn{+UAC*sTS^J7XmmLW@vbyLJXbr26SH-Ry9}#T<7JjscLR&B*(9AV~ znK<2y#IIh}Q^$0L|B|yDi0AVVF&TViJsu{9$NzlG4Lf=E^ioxlZw?Piwn@d)>cFkB zR~^p4k#R6115-`|G{UJ&#{m+A>ANmAFa*tL8@Pcuf1gazI~}O+s<)@qCXQ^)8a(h> z3dm|7fdId{bs6<}@Ol_3>g@d{T=cvG_kBx!8}l3evve-69PZ`<+I`k5g}_s%XfdpL(yB+SACVxHJK&Ow?y6U*}Ga`&L0izm`d zxX8)WN7y+t(E8=$QT6Rl+F*$Bs_1K(xbZFDdj7HUxt+;9DvWWWN+*$^1Hue$5cick>>A{Tylw67)J_xdhgeM z>x`DnlmlPz#J|l1mfw=^T*;~of=+8I)tdbAr0=cl2mjmtE=>qWl^DhGafrxHz8-ES(-)bGiBOEmBQbu7}u`4ro0x;5wnPxoj04{uJiYII998NUwB_i_>t9Fa&S&B$9Tp6 za_;tPYq_;KJ(9E*c#XaX+>KPd!$on4ef_D>BL<6qr8?Y ziP6_+%Uy1fn=LPx{jCS4ie63VC4Ub)XC?CR(U;AnA|)PXrx%5PS-hsXDi=u)Ug#>m z5O*$<_?~nMkEE>04~WS#c`!1aEfVCaSRb|bj{%#3vMch!*cd+}LXHf<+rDK5<5gcaQLzaVX{(hVnXwVUV~Zsh3F*fioW<*bFv#18faf z3Ex^5pK-GVw@4=Rv)gZaoGgBC`*vM)CngTPcUWPmBL8p2+1`SW11ZWFzUr)`W2wTX z^sBRt00PZMsZ)pj`89RI?*=mwim^@?|Tuh;C`lhi_ z4SfT%vmGiK*d%9s&yKmrs`l^~8MUOsII#RKF!|zl_n(}~&O7c0U;hQ&{3~s{Q-L?v#M;&M#U6V2fdhxd zQca?cAvZ~O#hHUUnHA`T!QNhi0A!Z(Nh*mUX4&|&`JnEy-MGIHpIYgw4GUZ4^ za;1e|QMqT0&u2YOO3Lt`Q`&H`9y7oDlN}BBYT+VG=^dWywtXcUmTB%S+VFad}+H17UijK)!6kKCb=Eu>tVvx*SauP zLX#L3&as+V92svzui*`jJ_=_i!kpw(zDmRmvpkq}}o~+7zCL zH;|4EUFU5@tZAJEXRig#ri(Ug=g&bQ6^}IvSAz4g=eJ((-7GAHfu?5g*trRSEk?Tw zw5*B3*8o7_@lktw664uiS5v4@R=MC2eGhv!c3kBi;`r*vkZ8~9Xl~n3{wTsF znDFcIk+hle!BS>H;}p6R>(F}JVrGWt**oRjkJw*IEQ?UY220TU`UrW=p6VkD{;XjB z2wFD=@Y{>mrM#tm#mct#o5KR-SR}1THJ>Z!@-B`>$EQ5y*Sx39IJ(mP*YtPE7R+9D&%dI@;HOR&V}(d$BR&FP4cCF zQ(#6cHAG!?-*mN)`qa7TY)bPO@}{*NrvlIZU0x)vo9l>;f z)QYCpq?7c`_c)tJpyqr-KCVU`2}BQMRhZ z<(cu2CJ&P}MbeL)Gu#w-;lm13@EhxL6gdRPgC28W$}6HD5|33QOhZRM_E~T*8IE74 z?H)K?(n{C`QqKgZ;8sOjdUk(1NYt{${_?ubJq;%qD*0^VJjcRnpqwK~Kf zcf#K3^&DUYSGYi}v^R2gzIP6r{#n$jParwd<86H2B@aBOO~ItdaKeS%UOkAupE2(Xhr*NNHwzI$*5+|q zZ^Q=wU2r&pk&&SZR}mn;Folb;X#afM$RkhoE!tGrV!XvWyZw!w9w2v$zPUV6aa2ib z8zhj|`rabmZ>fJSitju&=p)~Zw!hJdM~F$mNiu)VK;w2Xqtqc*I-=&Okw}smSHBY% zQ!^st!6;?r)z>M1#y9%p}&K|*F$XQGQ=OXu-Aq4GQCH=4xmDa{Cs};5>O5nErS$koTQ_m zqDxCl->(q|fqx=x!~S0uAmn1}Moh}A&AmgiEWUXUgNa5+t~J}0nc$x90(NYCGn13) z0kEM>Xl>b#ephW42@&I?LDt-qjYlc>os52&4WAB$DRuoT6a~#mKiKA2dJviR>ZIX@ zg7I(+;1YD0iC1@A|8tF0g5Ck^q)}V!tCCtQ4@Ok^=a$>hN;ZpTowQ2u4O@huVL44X z7((pH0zEWAZTn^j_!+ksP(UFl%-#|fvu~O|kC?n(Gb%5JL2tZqXXn^vu7axvr9Iz7FOdds^oU~1Jx5(>ZbyI(#!+jz6+LI~r#TMhV8oY$P|#QO z1%DXQ*GTo;CxNjOWI~3ea;k~P5$J?NP1@Wqop0T-yL~+Ds@y-?^``KAFF|qtvW&cv z!!`#ZYSQoN(7lxm?t35NIYKJ-N@k5TnY#4SJ1h`UAFn)e&@is@iK^_5@$lt~h*H3R znlKuV5dP0nB33BbXyS_7K^l}zEKfNJEhkJEZ(a5vVxiK|Ogsu)DST3Y`AQ_IkAnf-b+QM8Dw&`5Uh9x;5`%G)*z4!n)*@604u2Mkl6bhILeoy-HCgnDsI z1&SVsABzcUu5N(1gifsKRyvQrsOUWb2o_rJM!)W?Jb#Was--%oYrlQ%o@Y7=ag#bT zJtOky} z+4w%c%@n)VtK$f6gXUcIosNIqxUKK-I$z}VDcQfRtRAJ5MT?49B2MdI~35E9TY>}_f8|~mx?Kdsl zJWSIsG~w&( zwc}jSS4VxD@09X?BFe_lwFw1AQ8|9tn@cQM7<{}h`i(33d=EVh=Z7S@e>+~rt`@9y zk0`lahbmeX0ex;K)?7a<{WQK+B%K&Ee|P%LGQ{{TNFm$gAe=qlxtrO%AQvPQoEzKE z@Gg?(hy#-NowD%Llz5NyC(Qu{J8jJ%v1C#XhubR^h0s>|8aQ?UUJKwmb4I!v+;i~7 zRuwrPO>cMz@cBQ6If$3e^mks?ql@X2j&#iSV5s)zWDi<_&Rb&Kw}fv(r|_I8R9;rP z^)}$m6`rU3*EQbP-!??it+&Z%)m(G_JD#OSo?ekq?IiZQ{w#V=uyPVGt;$iZ$H$%g z-Km^o>0ZqGrBJ6>F5=S|o*(7R1biC1M?Y!H19ax=tDvMLl$dNFv1KUIOr(Of?k~BP zy^sgZOnu%2mN)*G@^%b@`+mTo@OA1f*Y8D&p)!zThiY2Ssf89Cpt|XM(RWcjWo{}> zJdWBqGIBjwT55I_%|B`z27iWDb~iIJ!$`4?Yrx*q1%oT;J>_>Sc}sNIj98cd9IWxp z(6SBhYN~NhH6w1Rb?Rc++CQ%75w~E@ixgL+HNVb;3WkB%;{sZrt^g|bEjdN|qHB@b zzWr#>GR{4~t~EnyvkZhsOQvq}e-Zc;!qD$;*c&t&-W0Xb+#GG%zUevLEO^${QodoE z=`#{IcgyjmHecgV#6{Blng#H@iz~Z{Qk}u952ZuH4t3;+a?Y@RPM=A89U<(;&0SX1 z5qHO@5xUl50Kyb+DPPWO%zkr4HgvjvP{7Oxe(C^j)~C(?+cHvgzaIXap8W{t4aL6v z11QgRyB)t7>LTtQGnN)2I zG3BU2!fiU_DFjJOb}acjgnraDjD+1i7OIy8=ZbM#-N|i%VwDnCDnCW@hlH0FuqVg} zO`IzNfftTaQs#yrys4!=nU$4NgDgQAv|7xx%UOfkrfGXPN#Z_yC!J z#BS0QcKZpu>&i|1I_Wto`hmLLuR?mF_=mxK@kdP>H2L|e3!wHbjnmV(sJEXwV0QdV z;AYiN;~V(pARnMFRGkHCgW5Bod#|GkJdf}ojq?0?qEiI)3PBiKfKuA_v<(as1TKv+ z{o;5smlN`x10@%u7GwQn1{`p zawK{gt~c^>9tR4Z`3G1+9aGF`I=z$&8ruDyKYlkJkO4g~h1eA_+$>>FmCbJAbItc| zHq$tephDtWrMy2~hVI@}$`_OL0RyBi8Wt-wGjYNBEGp9V!hRz@Z&6R>`)POT7zM`7 zB)@Ig!sWV*SGttDZ&(cI{{;2l98sn&*lODG)j2@JFY+nvFgZqHake|?%8n%=lm6OM0eDlXh{(^pa%Ag3gauPzl%Cp)Y0 z$jq`)zhyi`2z)`%4 zVHvJbU6%r|fSt=(5!23@3VjP->8p{Zs9qa|#?`9BX! zk~5O%gQS;n{g9XMz9Dt4aCp*!@M?d3|YMY*XH95#nGoQzQ+u?-68TF zHVOfE1R3z*pjlE&1i3?Q=SIc{?dI8-A}v`4=%x3R4)%|+AlV0gMWz2#QrDXLZ@x=! zADWX-0LwA@gfEu1&G0w56z3tH_$sSrCDM8$u z>_V={UtZlpin2%LfbUnlg6k&h0Lx{cj_tEri{Oh3@w_N0+0l<-rBHvAr8&#$ECm8V zrD(|Q)FtdA<@uw&Dwb(#>wwo|4?_r6XEuWK0e$1^6=C9>Med6TIMym z#XR@(>&y2Kky3SB@+nzNrhU^(B_1aA(_ydn=7G(4vuipr6PN^D)R%5-ZU0XygI-~c zwPD-Nf06S2 zJ-8epUn;(=sp)fzCjWhkP~sY$mLVB+1XL%pClmux)^!<8NOB%s7s!3(%!~hz-05&u zDBLL|)Di+_-23HWg0a;Lci%Hi!5}3yCt;J>`YXLW#w+M`m+s~A?6OvU+XjwFDU~ft zTN1ZvMjesTi0qpqEMPfzH04jy$jb^sLqx1p)P3{u;ExXuUFX@@8QAg{W7wVZ=Cf+H z*L!l<*c2A}1-%LzMvLzncnbAOGxkm8-bT#s!V5H4AQTn~wp;DPWUow+zqoPx{3K~B zhUSCg@mm^3u~sd^tnhwDuPj~p`X17MUo09UGGuDB6CNdx5wQs5X1ywhpz7W}RRm3l zv~;)WC?YiJI4<=H0Vci#j$>oTcUFh!>i3Df@E>+Hqmz z_jX8XJ6Hg=H*{^_Da_7Pwmf}5uxFdDs=j5hE*~e8u2Kj0NyB6H$&HI1fnkOdihY~a zCc%0cLGh0E0321hn;YC`zLIlPi!+2RjE@BLhNDHd;8ETo&9nNKb2KnMlf?-k0hdS{ zqoKJzH0uVs?czIQz!ytWA*YSH-Wc0)jrm%+*(!>>Io7w<*bO5S|}Guy+#7 zv57KKC^{{gdEiPKN4NQPU2~GibboVt9COM;1v zyV+c*Ysq#E_}Nfm_k^H(WQS&w_RY;LJWi!3ad)6lF6rm~AF=IICnfKsl^pIa-ZtX@B_ujMs3YOntS1Urq76{}Q@A8}dbAgWIUDT$^ zpVf)NC_6DCKliYy3~;%7X26_7XmLrLvuaErFwRJ`~)Fzl|*Ysl`2cC#YB#BYZYJ{@h`Z!cN;B%bawIQd%SeRRKy zMMl!T_8qENc2$NUI)o8NP~HwR#mF!VRJ7{>8NW#G z`Yn~D{1g^dk|!nLT7T;u*g-Bpzu}ku&&uSPsR={pK=+6Gq0a>?3;hg%#}3K$h-8j0 z*f|a&@zb3dMhwc~I*hHl{h|CP-OueYvjv-mqU^j31f0TpO$3if+&dFwM~v4GNyYAG z3d_v1JZ}4GxJ0D8srxX~lEyIXcGW?@95R;bl3}sh5HZ!pnO9OC(QIEa{OuIk&_r5x z3{VgMI1!L!9rz^jVB)h9`_Q2Vx6B>IE*e%I zJCQf>Q|E6wN&6zLYu|>>Q|VCpQLr07BrFOErH(s<^i{&MjvTt%I??e4eWD5Y7-;!C z!uOZPs@UL<{zG#$?qxz{Ue-GJp1|0hB~#Ngo&e4|MrzlG#BU9&ADWi(;mptW~maAEs7+aXvwt0IBLn7!us$fP#JTDH!f zE?F=sb7#^$4VrG0~zAD0{miykP8t%TvM?M97V$s6_f`4`mS~r1uo}bI_xw1mQH&zSN)5#h1v0L4= zMur%Lf1Df%FYXky`9$RnQ=evUzhp!s=WTQjc-i@|Dr5JE#&=}nb-Mc>3n)xA}8TQun!8wU`+pU#G zxWB!~ZKVpo62nuChD1WH2d%38;jN)MPjB7~euyYw9^)z;W?g2=wXX|E&8TZC35IO4 z*UX&I<;B|`>(ernth^$_2PiA^Q-Nu(_PXeg{0H~+Lo-7!#4Gq+&gYq4eS>t;xHtCVX%JK10{TbkY9C z+M~Z3vLb`HOhlUZRjuOVfqNqD=k%*be)jM{X*o+D?>%(zLraD6Ti)0nKVpfZ+orI@ zFvbsjlr2>A&pMK1yC$TIBR7V#jLTQ=J-^Gw^G2Qh?zNQ8As(G?x{3E@nqyxYWSaeP zC*sSyoOh$>HXf0&1-s&2`~yr)uvD!&NS!3(1>)0M4y;Y!+kgl5LW4#QDy4T&wTYK2 z0hxg9^H#!oznso(=i;~u;A8Sa1yV8xG=(jhu}uAe6xXiSKO$rWo{5moF%##bb*XY5 z9rkMfdvy5z|GYr{{e~td;WCg~1ps5aH@#n*X#uXeNFOA$!+qwxe}yn*Dw_d_4VERj z3Wtosq0fdMO~)^@8u1`rUKP=%-cA`qRcOk^{k{kdHRL0W_n39E!SYtROfgH@L=L1t z+r5<;7o~0JLiKT2jOqOEU@owx&Xz&F7a2scJv5$RnSH`o0)Nd6V1L$9;i8Jk%B|Ol z3&}N{bgaUP_PTuDd=IYA(WnbzH(~w)+o$w~O!3*wex3@-aGJR$baTrFTw$$Cby%{KQ;oI9O`#rnaL241XTqS-d#$+vG_{lRAHX zMceFWT(!J86v;nDds!ib(}CXd8@CK6@BM^K^Ac6cOba#jdeQXN{O{j~4Cv4=e|D#Lpn5$d*9_y)tkfG6N{RJ47GTmIYzZ6i0Iu zLzbQcllz#i?m1m?N=2eDduj6L(QhDr*0eDQmjbSuTe;G*2ezD>P@b8+;j4xt%OLBC9b^OWTl(ak z`ggrGbG|VFA2Wf2|C^7xjziCWMD6sqU!o_ov;U|(bnH5Oz3k=XH7T;9j=&Lf(%t8_ zI0XDmQ=N{Pp?Yg&ZWY1t(pelfad*|N^2>qYOO;{R_CbLK(hGc_Nc7^4!0VRVsp1V4 zYmoMkv6>%dz&aso@cd38+11MXSEpV!M3?(OBBWg(TGcq?GUD56R-bko@CsdBCpdeD z-YJ)p?+l_x~2ktMXHK zHc=0SY$Vsv<&h7-?{;Dwg*AyzxOk0s9zOf7g%I)y7PM@@#rzu2L!5 z*ymfC_PGF2t6tv^!##1sawlpY_-H_=U|@Wrgwe01>%#Rxa}luoOwzQ_jim9Hz>nSX z56|Bvpj3SQaQVnlrdV~Za%YP}cKg~@a*_gUi)vI#?|MXSZm%A7kanppT95|1I0Q5T7mA%Y{n#K>ZBX@F=MgexdrI zY2Za{>do9$T!k6BGI40)jw|2XNM0K_mP6z+lT8mAfSqJ=Ve+9A_l+$KG#-)e^Aos$ zCZ`;fLrJUb{F|^i^;^fA=Oi6I*H4L_RaLSKi)q}`NKI?&c`!n%`&!M!vO1bPcZa2s zbXI6ahIF5}48VO_B-NBfJ7)mSxLNU>cM^QCI$_{hji2|>|em;Jl=U8aPR{Cf9fC~{^!pfwo_aS>5z zUPi~QRxe#aI#_385I(PJ21#3(*Ja9|DELj}1g51bq08Xip>-cU^Fh0!RUHwDS-h$5 z_@2<7om3(d3$JGIz&Zo9SwhO3+#m9i>Zy`~7u%X?e+32`UU@B7hU;r$*R+dFW3_+h zD`llqC$;N3sW5lyxJS__q?E1c0j&BPRfC${K6S%O=wBp0!VR!hj1=-tQ3Q9uQLVUllaWY9vF6zQo=7a%aBBJy8n2@Q#Vzjn5l z4<}IEv6QfaQdFSQ^5VyLT=E;1lsakqi#Eb}DgQKfNE)R3u7UwJel3}LwihONFDca2 z*vp6N*2MC5!;tf}HP&_w02Umb+_-iNY;q9&4n%5pbi<|x4oDnZv!wuR+D)m{N(8XZ_(C1-+b>GPl^oMSd}Ir%%(6ciwx{{ob1d8w!9V{^l<);A@i(Z+tig203tk^xFVEFn;=`-0BcrL4 zYMF#PYYU~I)OcEu!e6td$`^?Xr~Vgk->}aDtwMdW!M~y5cl(L#e%S`P>sX`KOldra zXT>*yYfDiySxG#1gA-Vwe9YNSW;)5w7?w!C96M2Pq1U7ZzUIMCFbnt;vP9X7Sb;i- zFC81z(Dj1@!BcFXXaD7%kDhyb20quH3-@(#Q63m>xPVbziuy7{LWjHXqkDy+>l4b} zxVXO{751u%$tlwZwXpb@*-DdAxm~@*?lh|}E6LxqR4Aqz@06qF^GepfM$IYAep@9s z!qZ-ZzQmFRM)#H(vaN%n5|CBvOAkFvE)omtVyu<~6Yk zVm%%u%(Z=;W?7rm>-~J9p(4Zud0m6uImt7Af(!>`*%fzdOE=mR-=6)yEI{$89h^78 zog0&DML1B(z>P2(v>@6kWsGTp)Siv(HGOH@w+Dfj5 z#Q@(k9%`_C^?~!iU0b>9;p6)a^TEZ;=~6XX0w8I@#;AaTXlL%|lML=9Ej0<8QfwL&|$hmv&28;Vz@Riz*1eXRZe zczVmYCf_%1m=*;jL>iG2kP;E3N4IpRlt_n+4ndHTPLU8{2m&KVmvncJhDnT&*pR{C zxqkoqzMprz*@tV_&f_@G<69?1weY7q2o1?TI9@_|QHAi>LX0q+f9|L~DYE}qN&amB zNyGr(yZnyGzb+=H5>Tk7(KW)+b!e8(GS0915;MN&VRLjBOky=cI`B-L|6fDBZSY<8 z51S6OBsm?(LzcHylc# zFVP>cwOMU9G!8V>ZY289S8_=quSG#T^3*jj;mXD?Rpsc@%7yF2RQNleT*c9KuP1z> z{^zZd_9cJ5pCP$SV?!WU13K~Zj=keG2KdDcPgB+xZ>L5#Q2%2aDEFUP?6K9$CzXSy z=fK)G+tU~2R#aqJL~GMmvBj5WXauEcB9Fp?+L2G`-a*r!kF*5DoKdoe5~5Xlk@kpZ z6`I9GMO)$&_k%54=$OuB1Z1AhBmvf?7ocS-!{@ZVSlg^j{_@J8m;2LTixBgd`}i)` z-e4H&$tW-FSiKk?=1AUMqyp}mJ$)cbt zr#g&N{rZPVUJZ_EbHB)Q*4xFLFpF5%2d@5&pRR&63L9O%DRiM10b`Sb8a=bYGiQ*M z%e`4Gnjly43YJ$jFl$(Jq5`rhksIrc)OHIeA&V?ETuJ&8%gM07ayUhRWk=WiGiaVc3xkD{_{@_2(_VB z)C1S2JEYh~?tNPo`qM#UD)60*z0!ZPS~tnWAhIRDfq3qTrP+xanGZ{)LY?Ke7r+T? zQ~;J(UL$DAyb!Xqls)}W!|!Nj{&u4Ntv&8ty94tAeCo?7)(-j^0R`1Z-~H!a4*~q3 zopcUIOCON5jnj$y;GH5fwwSDa&ENt-V~`%*3dZ3r6YZbFr1%#1ArMrN=HbUjJ+~`d zu*MC|q~+b{UZukH&&fVMCSS!&At-^@4e%D=D+66~efeq4ZFPv6nX0Mg(|jS4M9cL? z*S~ujH+Ic_&~S(kk(ejj6iZkzfZ%G_Pe5rz`U}>S`H^%Aq5J3Bp|<%y&oc()x8e}i zP?i$#dYCHggW%1!d7^7Ag=mm0!_6O}Y&Q8)1F9D7utK~Fx?8h_fPOldbmZ z!!a}A4I@IWFn{v1eU$dPl>lGfWo8{O^EKVX2xT$ovrfPE3J+VQ;Pli{LRhkRtsOVP z6T%fnPZDD4CsMXGB*ej5ftJd091o_Qee8zIFG~U5;|U|6gI>F}4AUZi_Pf=Np>YV1 z9E*rNRcg7=+qeU}VLQT1J*d1~rrpW9p=Daows zk*N1Ijh&kW{FPzr6VYSi`<7wvlfG$}A;1_Vb3{R`MxcUpHR33Ng{D6)D%U+bx_IM^ z^}g04apxJM_CW^iG6<)Q;_O!RODP_y8pb2JJW@_RqMq0uT0t8-otmlV`q3~ z$OWWvjHzFI@|JM8MJ!Bxn#gub>AXgur(z$?!|DC<9j$>rtDN}nXG56ypH!=NdHY}s zn08I)W_NNG_czH~tm9?;sTmpvsP!JPD@fw156k(q6U5Zg|El&!~t_tLj zxndCDUEtp4^8cXiWF2ySAUKf_!{;c^gu@fpr%U3_^=N(5vmHLAx4_fWphYnLaxEwf zvS^)TgH0AEs;j9{d8HK^y3h9|0iZn^(#<0`qY|t{A;MSbvEf$6P#2?rYoi|^@ zBbRlb$b@0|PJvCKq^x&8S33TdD_+?x?WUCxGgvl_{`3&h^(WY-=}MWyz)QR! zb+{=R5@cp*WJlFR+wR zpMnHA(DK=psg&uC&I5es_v%^gtQGFb`?8Qv?OfE4H}SU4dJ5zw3AStry`j$X}VRtq=@Aq2hipt|2hjq|*5P&Gz_a^p`WZ~~$9 z-uE^LxAx~-O4xnoZO>kU3-~}zkxTfG8;d6g47`}`xbtwIl~C0#zrzltoXqTx00yg0 zw?FgCohM6(r+R0a&Cy#y)&sB!;R;rb-9)>q1UqX^v4t?vPlM`7?@W$0sckkbIDDTQ zRY--bIQyWK>K155IFj`T9=G5eLh4K2A$fuBld#|q%2DVmKPXdD;t=(KoeWi^P@VK+&u+B%esL<1urFoJ4WQ5vqZAIY+bnhW0?WS!%6kjml6WE8Ylt!Rikdk z@^!#6sge)$d~piv(CS2F%Q(_xF#!aCtS#DYwn#9V&@Skov{ja}yyL%3GIz4OmmQjV z%Gqq4)OUlF-!UBX3*^I}vO9IJ#;zBV80tEwO_CNFB3je`n(b9yRfVL{a(w|g*QcsM67HYM}0Ob;tQL?{sW|| zTvplhkNEbPFVnx>H@t^#Z|pt_9a}#K5Ky~a6qohFl;PzAipTA6$qslTh|f|@U||q! zaj9*uzw_vPEgSPYN@Ps(=iVW)@S;26d!Zm_a}_r_7pJ?&?TxQKbGH2RytPPKoL5wJ z#$_cSbAD%VV_eT2+P$D9Y}Q#VTXgUwlFXrUr|k|LES$u4P%dN<^O}1(yZoZ`gz? z?&AAfr<}FAwd7qzDt`(x<}54X2<5e~U{bOBzuZQ-@A3>@k{#@;?NNP*ni}t1+H8b} zu|jdWcEqu0j`>Uc^Ing`+m_xqOh@US0<+}t3up#m zl7^Am&195Ny0+!g{&5&_G&ZKeEY{*bKQv`h+ba2V2FPvNrHIG zS(N+7<%xC3;{z1-(_+(>HspJ!H^=B}fc73gL&ttJYuBhh4;JtHtpDIo zVZp%3CWUw{>vGdu{L9nHeVq};c8xws7JuV7e3Q%2_e=M=xTIT(z5%W~`Rse`{3@6Z ze7`c>#SV*f81O#YEEXvJ6N9<$vRn4%>Dy6vWoK2Jn>-%t*4BZ86F=s{d;`qRfy}e##io9=)2`x|gMAe=$=J>lTwHCS!Ag9^MuRuWtOCf`4?rYofIm0xJCj@-_ASn@n`M>f(*{M7rzwM`}@@NYpa(-d*Cw+ zG!+a~@gn>So3%-Z*U+$vs&G#9Bxb4lvN#Cz105zElB0DVk8@06YlO68{1!|gegeKz ze%sl4C$_rE-wDC;_0EP$yRnvLmM-5hY_)!Yj~pbLy zvv{xMn7=4={w$BGz6=Jxx#t?D9mzTQ1L&-Y`C*e^XxFed65}!Yha`#1O9d5)yd0V( zdCN3y$2M(#P~=dad{QPk_JIL0wgqhnweh*&cOaVm^%NjeIE_A_J^TH!-86HKzK}iD z{7cH4Gt7ujzSft!QV(3@o=g6v+49xxZL||>^`!=cn;ApN>%5i*+t11u~tt zQR2@hRu{X325v|?F{f)Ttko=4P6VQOaD5V5wh^W3Dn)co;ET=>twqHkvQ6-vyWm`) zbn#BR{7aX`p`3z$%Qn!?jP+FV9Em?$)A(YK56fPieLX^GmBAq#4hd^K_l%gV11|c8 z*UWw^p*VaUUqA2v*Ib~Z;UDyaCinRrlaK!O`=CyMsJU;m9r*9%iBmF*pRb#U9W$|z zF3Q^aE<)@0r#j( zMb}u39Po!FcC;Aas#sxPi*Lj=%zpz2+?SrgxluNo&<_Lr2L#nxva>Us{}DVa3zd(G z69}3t$=7h@5bD$K+5@6wTYUDVh9EYM*8O;v`!BCItxO)0m{}f*z4m2p?3+Qbm&!uH z>NnN}|Ll)RD=yTff+f_-DuwwMs*W6u@hiQtCRPy`AIyi1)zG$s);AQIl%DKfgY&8D zTS8t04Mc&>Zf#ciCFd*K4pp3S*XZtL*TExmS6am&+BWfS#(DDmutol)P8n0%ym8PL zmz0%aCZp(M&IjTy>RkgbZY<`;0QOf#dH*IasX5DtPeH{d&q$pHAUjo*ohD{sg4Uof znn3fL(Bg06Y;np-5AqwK{{msLIiZK9XQ`mmpa_-$xq2UZY!?^4bYi-D(cJp91PKw&7OUb{c&87~z1SQXK!=e1Tl*Zl zlF4!8Uq)EXnY79s_pHojKH83$o-0Qi>!H1hL0Mlz66-joQz!j6!WkR<4mT=m~Hc@}xz&_q5=G;Wt*7`DF@2h!;XPWLxFf6Qt=5uhF0^Un9 zp8pL2m#lOIC&Z6I8$&ZM8xum?ES>;9G+IxF_l{faqzhHaVZGWv1FCB7SLDHGu3Va% z(#(?yCV@V0VcBVIcNP7Hxq6PiO;ym}l&qo7Dn6CVH)KQI9xI*cG$`?K#nt*U<8>KU zDk>x1%w(k-zo=45$h)uL@>7qH%JUTWoRBD#UC2|F&0jR5PT#04$6vcw^|2<@S>+WG zQR6O!Di>1DHdfW_nuq!D5O0ws(~rpy0|K%iggP%s&q|l?bzvF-D-O4!3v3hv=E$~mAOMFY> zP`Pztw}X;|ZMkBD!TMP-vNIAv1>X#h4XeO|cqFiNG)1AEpICQH6hIDc5|JX8WXkLS<0AAG+STVBVLJ52B=*vz^3FV1CjVog2sWlQqS z78({Di`<6M9A+94>&<@)=!l68Q*XU(uP1naOZkV(V2$_kwW=%D;E|Zb5~eO09>u`# zZ#hHLrNTLSkMm}jv^>UD#=r4~!?A@Xt=g%|dL@F9#6-o-QU#}kqL=J0(;*#n={+#I z;3e|Tat&Ww$03oOCGWIAQz^^475*bz;#2x00kad5XO8-WhZVX%@@`_OVb4YKzhpp^ znfmbb+F}Dqm2SXtV*xQ=CR(rZZJF8RC6}v>g%uyI$@!6sCE-wkx%or@XPZV#4^_$$ z$-!DsT8kxWuF!O}b5OuS)p1}R_c$-7rUz42r$6pnUsbEF6nWt}5pT{)|S7VFEDaJpV zyJGm|o9lLWxV~Ecifm{H(H1UaHnZI8^R>6yLjmp$j!|CV?-I?}Z6^)K{zG#@-5iYO zgZ9d;%J|Q3dQQ_`-EPjm>}1M3rw=_~Osx7j{(TLrZg0xh40*Ks@T&JQEf#!lz$Z^? zm+w_0EZ=OvJXM`m@&gnBj>CbedWEIwl!g*;B(912d5*{=-ipOrcqn(Dxky);34ixt zEn%raf_DXAf@Kw$#0~+PfJ!yWVkv|CP%&E$z#6r~AKC#7^1crqcWT+y-x2fWFHj{| zI-g|TRiG5~1`N-1@d91#%s0rWOilOl^j}F7^uhpN_sE<2;;3pLPB5vZ3~#%Gm-J)_ zKeJrStO-HC?-OzF)E_-?YpV>4AzR*W+VS*V`3m(+Gcu)xwNqJZhAwEmqefu?X1~r| z7uMN+yr-s+z~scxW)D{T0`1NUD{8?3j2NZK7o|fxVvCMnZd|)9J5l^IGFBewy4w{B zz~H(7EBpPT9oYJzVmRh=5>Ui39|U-s{a3hQLMY3Bn7!tnkI>t@e}21%sj+%vz}i=Rgq0w zMRz*LT|ga$x+!yJPCq#gTQqzeVSo(~2X(Z2oq+bw$#V+m?sk9j$VX_Lle5d+(I9Cxy^jfj)G{8C;))>4kw?@Ksmqn+crxE~~D(WtlhS8NidyXe;Xu%vyTPeuKpDX_@3Msy4$m1-GeBy}H`J(J@)MD<#NG8W&_qR^|6oLcsdHEsq>+7vKX} z_jCoCHhs4EpB&=z;VH(T&$4q~;6zho)4T9uoc1dvPC`X1t0A zg&tcvZ?4ev&C=@(+}5yfxH-~UaCC`3zR2~yR-ek0Ui-FPC_fA8!#ki{FgSq$*b8U* zvjeXWZxxnDLgsh@(Zb|tivi7(-%X*A639vNpn4urh^PFVw)uh^cpP^oGiSra+=W2B z*u^{za?kUgOJV0oV3R}hpYIa$yhI|7)tyQlO4paKTNyG~z6JLr3&jdPPJm1(LYIRM8B!XqKpY)?E$V zUcQ9INteFK6WZ!AU=rSiN^-f8&%E8bC#A`A@_RHrzFJr4i^SrWN%cj{KZ#b~L$52C zvR^O#MNt^gO~#qNb6$K?($Gjw){}A(%Qqm4)(vnsJY63uT?%r$3K7S$@o|DR@kTOQ zy>BP>q7l?T1Fq=0XBubmF7d1a^R8AR-tkvDjWpcjs--~m7=-MhE%OyXvYV8~}z)`&t4CLHR0O`#V->L$Cr`f3b zHaB3&sV^F$POsq~2S5A$2BJhg>G|%i)&C(1AX=p%-8UKsr2VwJX!i78u~Juurg&KF zLAIXBy|>ncKgz;=2nrome-6NlmOTjcF8m#}I**^34m;FUh;#!Bg@AUqy@9Ko|J{V! z)8-1Ruer+YE*b<^!A84x^Waq0RMuhF{SV~8V%fT#**`I54fDJ7!rZPV&0trtrE#)} zyh&kAC8fJZ>snb^E(G5K3s*uOPuHddKKWpbH^}6w!o~}T!2OX+708X>H*6hRIbQw9 zRFfQm-^VucS(HifJ{hpb_=GA*RiMuCKX3p2wI;MB)r zxt&Ao-3UM3;w{XuIVXcPY4XnEE2Xr`)r=(S?Yw^0l1ksj|G4;L?qI*=+wL`eWE0g0 z%ddf_N|P7{b(I|q>y*~Yr#4iBfTQ@cJMUY>e`e^`))PPa@HcYzRm_`d2NHa{27m1% zt}sH8!U6maOo1LEY$JX5N=K>>zc`S1^y8o@ zCyA9$yw4@|+X=77?hwV@Ub)zDT+KiC6qA3X=t*#IK&#W(WW4TqxaMc06^(|F>pNrnWH7uNm5n zsR_lWYrPfv@vdk%1rAf!890N#OVrboAB&mk!upfO=IW)fHl)~wG7_aSY^GGz9sH!+0Dcx5~_t|pjNE^PU!tfGC7%Ih-;7ib;~&xv_KbnC*}?mH%iWwcq* z_qwe!crns1n_%K7O`cuVGTn?-)Tq_#YPMYX>+5qf_MJfOLW*Rx7d4wlCQs4GROm5% zVnxu%(*M%})Gp-pWmdu_S%ylM_M#<~icv}uEyPLm?Xn(vEKLRjC9t)UDmyP`oy< zclVj@)4i6{azkkL*L{*FLXvik#?JFzefE)NM2Vdok(EhW=UwqUv#IGO4i>Ey!UJab z1+F5Wgf7_oI=H23!pz}WcLpI>L&Yn{P&dkp`+TsDO01RjwR7~1j9KC%lRC_#OpN-Y zF5Fk^Aavz+OEBr?tIlHuYWkvd6F*lJcgyilnvKnWo!hnSVu5c%txsH<2u1M)LyB>5 zhlRFt2VV`-O=nF`SHfvx>GUTdd!5Be4VS9#l7EFeF)aIrh9Xy7c|c1aEUx!8;=Zq% z=nAL($B@-n4w6X$^hm|(snu{=ZcvCEGwje$7=cRw>W5Zy_!gL8f1!(aUGl8ad2{>e0T zKX)3}k1R+ccQ7^3?Slxe<2UE9f{bewklTU()ai{#>7g2Xc)GW7HAsLT$bE5s^+3Hn zKU%YI6LI5%rR$~)bvEl1Tt}%@Utlr@hnYUzzgcEy*v+Qr%gtdwnbJH+$ zfdi^;xfP%w#mcw5Vq5bMqjk;y?AQ(PvX3c26E5oG-PlS7tkJI7Cm1O;; z3{M!1pGWX8t~Z6M9=UvT(UejRMkQCktqZSER=$ zgf$~xE1#t4SKz^aDU#5kXP%X0`gh*H%zYKLvlUU8DNd&IrYnaX5=_0^Q0b;yDUR>{ zsP2fAv)IsAt10b}l()A1CilSek=`_{@y^m8Dq-`)hm8>oi;TV0E z@YbJK0q7(Hk7?5U^JZN*4-*VAOOD2o)(8RZ0 zNaE#H4dyUNl>Y$=WD@yqk!FD(z;ju^`h>)hc_7=8{Cb&2PVK}W?xwqBbsY$Jf@E?d zOMSw@^jc8wE;BRp_F_Z)seq3E0;w6^I5CpqJyn^XVidUz4oP`3>McF_5T_$pr##Wc z)gvm4%sqB+z`2)e1Tm0x+z5|uKpVOcUC$=vF6k5OH!T-@qWDQt!@m-!ZvcEC(Km6= zqn}aV1k@C4^z%MaVyC0x5Q8wLt9F3hWYvAY{Suw-qbS{ZFxTB;HxKGYHO@vbaE3u_ zrT>Ib5!Mv{-;w8NNXh>NOqW{9vKGfmj^|l=T5u8D-$sK?}o4IK-aMWr7E< zIlEwYVIOstdfg<$CA-0p@_6NEBMw2+DoNv8==rnFng_ud!ysQ%N!I`%3pi#awfznv zr6i+Mq=Oa^26jpCIhJKd(n1}sfS{iYnii} z`W3UiUGauez1nVTNccM!iPfuqjz0Zk)}jSrBT&FXc%Kyh0X-B@F?w=9;;ui`fzeq8jSc>8|1Td za9_vpa>@&~SgK!f?8Qk`gz68GinVuPUO+>O7ays3_vcxH9atGwXnyOQ=$*{rL(GqQ zQuNj*A`cq3d~i5_IxT-F2Eri6+SXTJ15sRJKcfmH6N{_#_wkV1)M2M&%>Ld($Fpa7 zRG$uhT2uxNXRy$ME&JiG@eG29Qhh#l2uC(Ve8`?Yg zm?7?tqOmHS642+rlLgv=BxI6PL&4a~fhWx9qKQu;av$vToIT^hi%6eA)x(~BbRSzY zZ@jne?=Ja}(4ia4_=qcJoo;V6F;vIP(HYJ9HG!*hezp`y*IItk2(U!@+0ST-7XrWspR*`#_y!A*pY=oY<5jT9QI3Ms(S5*@P&U;zz zwxch(t}_uYF#$ll!&sxBJLmW6p_+B}`Y<{+Udr#fyqIW-KNrle+CIhg_nZF>`mEA+ zYioPl3LJ;2ue>xwdS4T+N{qjBAj%~f&ijof`QpKhyh51WYlxJnUH*|_hLJ2=L~THr70)Bs#@?xm{C)X-J| z;7phJ!Lvp-H+77;;rBl(zrVgK5DS38~*Pm@~?mT~ob*SB0vok$YI1dpw^m zHoZH}!K56kIHRpt7~OQ$&B|J!?x^28)JV0KwNm@#r{7r=-hV5d(xZiL zAX(nm3<16(o-0Nmz&8?4H(s(@zzhkKVfiN&od&wofW-%J4_g727<4 zjYgcjmzwM*Tnw@jgh3@#RHewqO<9fy?kU7WGT&6G6Wi- z0d}*l%*viW@_?}P;{gfSE?1cif~?hT_eLwXosr$kyLoq!4z(Cesvd_*u$3)#6Nkb2 z)0(?T>2ATe_4*;`Bw*0W?90iEqf1Txu3>7-Y9IGMLSMHRh1||xnrt74{t$PUe8$s~ zd)UA%jd1t8_>#l=1Qkk?fdNXL;5zXsptNe->zQ)!?v``o5e7(h;8$aDeQ^fh1-Y=n zHXB!P?FZ_Ma)ksc5{#cCF9N5MSTB;_BoFEhn2J3aRtkB`0mgb@<>o$$2$&7ofUw!k>eF6_T zbdb#tc-JsP;KwOsEN!y*)}6_3X)G7;+?IJrC}7s%y7k-QNn*GA4pJQEL_9{-HrjweD-7%*0d68su z#om7|>O|`XGj8JP;#!dYr>#36QaR?@isr<7!niv1ZqhhR@7;v1S7`{(d`;eb$we+; z{J8r)6=DstVAcuL^1AaMS>shAKRb?c!m9_~`sOR#AdfvxzJiJzu79)PZKvxPeJbQY z8Ez4k0gv1#Yg9|$m0t#nCja*z#3t`IrMYQnt!hVtnjE65!+e_Qn-I@#aU-zGa`L(o zsur7Hd-##p5_J_s5pB1J>mBZv<~M`SpEU?rcIg;n96N6j4G_@UVZpct*%E~`i^pgX z^VI73jg;gJ&w|Q=gPPR4&W@4CW3gax^E2hv(_0v@q<=7kI?ezqRag;xq|6 zn0P*K8ynnTVCjnHSpaIoli64%qZlsN>!MB=k=Eu;(Iu`D;p z?Y=s$P|uPaCj8*0$GA>``bn{qT%lqy7c@6}zd01}5gRqRv{q7d0lU~-QiBUcld^rt zizXkOp>;Qn#u}+z?i2zgO)a4u_z&|BMDX$AhMQ{iiHEOv%!Xsrn}l}3Vh~e=H%YR4 zS*dR6`gLci3$CEVY$J}-NxHAQqjh5u^QSuKBT5nFZD>0(byxrRR~>hd6B7B4PyRUjavx3tvNR?}C= zX=~5A#lR&Y87Z!){vBHXtuXz|bi7lmMB9Gt@>Z-B26tE4jq*MAz2U%PjMsS#KF&ROfvn)QMdRUU%LGr~1nqRe2O8vEy=ZOnylzP9h^1XU~{T%v+r60(+k z9zpeRy-KXk)}7;xj#BYqTq|!6EzW3-5Uke$5AItS7u|dQo5^Xu{x}|xcYzyA>L1_z>xWW zfLu4op2{eAL)A{WfjD*}12g%A%y^;gNgVjHL*FJ5D!EO!fU*{J7xwh`vb z9#x7&%wjeNc!e*P0>Z=bIKG=w$Tr2UTz1biRe##3JyRqcvJNzGY?Pye{;oU88 zCJP&dsVK=(zEA2pj;XlVNdF|D7UZg!eQ9!Zms5HIp&z^}1Ug}HJCdEuaUQ86fxyeXUt@pP- zxdE&F!oa3=dMkunKt9Cn3*&O=ro-RZX=G$0VgJb_7hyp5?pl`scI#Ewt9VH4GA>IM z?xs!eJoY3lSLoe>UCJtr+)y-e1FY)FOS8(tBt&DuGpWMT`{x53Zw*Sr?e6_zX`4F&X1hq<*y#jBXid-qC0$6BK!S*Z z00YkJXJYEdf@NhI{V6BA7g3Uq->Z}V13iHhreP08<{e}c1Jy@;k{jI|$qS`QH~XLM z&++19W$?aHn2Ji>ps(uFk)HPlDA}9R`g(a-YA0{A*{G>ANSNF7YV404_#`tsQc|g} zR2?TM;V;GAP(CD))uQKu?*MhO8ABQ{bFWF>@kCY@*A#>%tQDuXo*nT5mr11X?8;q! zTIOaS176!*=>jueT-9pw^whq2zvCmecxLV48Z|(?oANZ^rmUB_1i(ac{_@$TEXoLz z7N*I=^&E}aGO$wL;+{6v6!OcaigwM|-kGGOt%p{xt*h$C@beWoh@xL)Jgq-nT}wLD zekoxKECf2-@MA?I^(*;-F?h>Lj_`)+L4$C5vXQ!szvzFEWZJ0QL!?4SXk=hxU6NZ~ z;CG+$kPQi_FC%N&$-$1}VEHXKUff4Ez+Li+vv$@?C{ZP+^tZ%;LSOFR_9IL15qY!d;{*sC#E5K#^P(1LV-;CX;z$5CD8m34w%j&SK zr|%~(&P^9+l7%JIPDGMh6GZ=K&^>S=zw6GNBgc>;MJEOG91^j;73Niv1k~32k7(k) zG)$8V0YjG3@K>FIZ0d|6)#pkk$h1Wx;VvI7i5|VILy({@g@$O*VAb(qV0{CB1d_Hk zm}C$p80(9c^}7q{1pq_A<%C^emgI+iuxj2Z$Fi^55>X-7Y;j8(T5`kYPfv3S&)U84 zEK|)sW~j(pARo=G%L0$%wbqwUOatR8kcT_FS&Ei8V-6+$Ye{!}y)Kz&;*Xl0)O8E6sULWMCy`0 zWv2saHg$r=j5%fTU;8mA_z(t`11)fodC$Q`?>;Z4`VfnVdkVxRaQJHrO!#Lik zqK6Uf2Tcbq(#@Dh^GTs#3&RL;s&tdrT7SE5^{W^ao96USb%P%kvb=!d%*gLi_s8&i zLiy7z>2l`$g}+e3S4LNacCzYnAyR;xo4bCCc>X}zp+C^$2_E2N;ZW*Yr)%xl21Y{^ zm&Y?qI@@>P=^7Kdo~vX^U@AybUWt4}8n!g{*5maHxWTcs06IsWQqppEuxiF1X^T-{ z2LNd2%krD?ym&m_Z&dChbBqWqnsz=ZAJ96qEnsb1v4cUT05ZD=X28vuNXTjqlw5x@ zCewi!TyAoZjN=l*)ez;$Zldg_;|zAM*p{NBeK?jlyoM@E4+yMSnlr(1*;jcIu?eW@ z;V2{c-!GSyc_KRtEeSy9_Lb8BK;ec=?WT}e@P`HmY=PCTkWp~P+qL=-KJi+3OOuXN zd>r|QUKlf>M-;iQi~%YA6-r0q?}hXIG}c2w*C^nU-$ z<=KDx$8}W}{W>=$pvF~t%SQke41$oy!tZqN{iN2dOnH<2jXy`m{5eKB+~{QxT@4xK za>%14rpRK#Cxv67u84g6aBf^pUw1LR4>BJ|1v%b%-1^{j#^Kt!$R)t*{2_ z*UaCz&-fHZ{H4PBtD@+iVf9j$NEatA8su`QjhfdA&?tXZd^oO(`VJ}bBo)FIuJ4gi z!t3Wh{GD{XA)LLFpI>hMXFVFBYX}5ycHFow528aAA<+L87*J-3viNKx5Pa2Jcdi%5 zKiD7^v#!9Mj4gN&5bG5F^NGhL_`O3suc0~ZKyGhA4C~Vn)A(P=gF})u{X^}3l%P=X zMa%z|L)^zC*~md}9-IcsV?gwq7q1~Ofk;bV?v_R$I)8^%hE9SlnAMzkIvMtuI}@ry zUCjp!hg>!9fKIFL`t}>9EeJRE!AEYHxTNKzQ@TEMN+$crS1ayTikbW4A&IbR)$rBb zLt71#V-(YZCadbcyamWzMe+kec>Du!4P^h=Z|!D=H-BIEoMzQ;VT2z_NKgU$3s8!< zJa~%0br4d~y7QCQHmrIs&5ds5cU#_vOKN>jTB>N|Em&-@-$9fI(+|9rRVXcPUi;JN z;P-7eP-cDv*7d?e4Kthi&*R~i3tmSj+KJD0nXb2fR8xyCcVxz8xiLuXBAobhixjzS7c!ACx7gHljiwZ^6h!x5X8c>d&vd>Q=vP6 zOb~2ybnZ@a=zNVa%s6-SAJJB?u)a@R#Tr*YS|LLLgzrF3tg z=Jz8h9on5_iKlwCo*bIKE3=;Idu-jKchCeVJ^DMuc;QK5OPvH@BH-u!PW&YaN1dOT z`FhJjIk)6XRpU3Q#%qW&xk^pa60Bzowt^?8>e}2B{HW%9=H7gfIz4lGS;D=oPL%A0 zNysGC_k(H-5O(e)vRnw<=eVa9hwZ&7vJwRL#DXnH%E3*pU!a%R0QOp&t<6sT&+MFV z6;-`NuzYWH9KIW5t@K;=A!3=86)hw?K z|5rZb|Mj}6bBO`hl|BUklr1LaP4;qJP;k(@j4}uo2EF;1O5&byZHZXW2kmwIHNW@<1tYRVmC%U|kKMB4l2eZku& zu@HN)bj->z{r|K8h{;yzE7*JyEb2Ek?!mffi+YM7fcltOEqDB%3c`uP8B96CPX?A9 zBN_NbqTe`rDI~SPjJS{DOW!+ggOFPF=d{5{}a4z-jGDB}rLe=#THz9?hi{2L9GriRRnN(|jr5k*Mx{EjEQ+?s!> zS3uKT!;4rNANOp*0ic&lL(ZnW^m@ntQ={S31Z!4k^#G1>%+g=Mm{lFM*}{5UCjp1N zul4SngsfsTYPL#Jj3O2T8QLtWDM=jTa0UdnK^v)ZCjrfz>>mfA<9*^&7XCNlfunH{ z1=K8k18mKRNBp_mzm-7LyMT>i6Zh#zK-?^RdjiK37? zRF!)H@yWc4Fmg7?mDH5UylD{egsx=FJgmbOS+zy%yfPZdXf?J&IGknuQ+Xcsz^v1% zk+B{%q8?WTW4~#6bK#87-J!*u(YE4ocGl z1g~aQDKXM(O)INOR^wr*Lpx{0f08LSPS$EsZ*`ZXyB~(?%*L2W#r5!tuw6~ag;q_GUCBxNk2?6Qnq3sDlSWC_iTU3AMjb_Qe2%ySM= zJ-^@mzDLjT{NDR`k3;7lDc5yg-{tdN&hz?S-*afUt&}U(`*S<$#Ql*e>5GIWO#VPF zRe}-57zs)Krc$3o8;4=uhpo=)lznQQw167p3~m8~r#GmkSl{El9QjVg)^Z25f=joR zm`k+ycR+~<^XC%tZ*G$D646}FhLFWer@>yq?i{DCrIlkK|9JMixIZ5=A-T8t>U)VD zyyemnblGC%xZ{=Yc`ozCKTi6%(buri_TIU1GPbY$jli}Iz4^qlp?putyR8eG@$v=v z8EK>6DdgV~=(?$`H`3^UlDN}*5#y<{(NK)3R+_qz>tr(~FUPh{(x{3z${;NLvs}Jy zoh~AE8Ad4_Bb8FpU3Mb%xGUnIDJ;_|%r+$(N#&GAT%k)(UB z#K-+0s`O@lX1?Q9x)maPWd2E#mgI!Qh6{H;&=v+Z`zH7nabugm%Csx9@))7W3F;qJKW7KI?so{vfgcqJmQ|W@x<-A1x9~l%GrFyrJS50Wm%rn>UPdD?awxX z7dyw+4}D3f;r~F+b4H2pwz_4|5g~E4zA60?i-`S`5d`~SwE*=^Oh}o5r=^R6n1fWw z+#S3>cv1KzchvcTnB@|bwg zkp{Ze@{2xVb8bI1l*4?pXy^W6hX`D<-;L=e7meE{>22#VkE&nu10Z(PxNk zi6;byVVG$10Bmh}3h(X6kDMGWy9lVf7s@pc3+MXxRDv#&9k8U*cE$o*VT2^UVh|~; zkX`C_8RKKU;cq=KCG#XV!?B~Ibm;#XK5?nrRA zYDml-jtPB--1}u`oT^!&G%P=@I#JY}rapO@Bg;RVnni6KXhO`vc5Q0I+aJ0ye{(`Zl@?3F**?q*=M)RGw)%o1@6f(Hd7 z`aUy@pi5Hva8-KJrKCmc1&+B}Xe zD|chdF1I|-%7qEbrhiz}JJj{0nG|Z)cVcrhv_K~pCm^gc1Ud?ogM+EMk~I4EKOVbJ z9U?tK8~AQbZd}M%NCo4N_T7*J)|;PaNZ+IEua~;Jh3DjW`1-d^RTi;QbQBB|5XEDR zi>B-n$;uopE}GdZN%(V>6mJeY9y2K$!uyY(xw72~5&3iR2WvDp#el6Q6g+9rqF(Gk zV1j&sTYBoYXLXxu(koO-@s32|U zZ6vz0_)>d@U%aRuMmeX7L)`C?xL0{I;ZX+8?{rN2F?Y)NJ1; zxdZtSbJIjaMn#G$`U`K&E3g#Ju!ywG&OGg!O(IScvqJyUMMzuZDdnJZ(0>eLXRjzw zwq)|9-x7F{rhcPFB0qEXRakGI6nP`+042Ey3ASw5Ogf7nQ4 z(i3s-cEduc2}zZtN_7yWJApV}FO@NPF5&p4oAo5_ZGGNEIV0uduRJNASw+MlndLyq z`_B?itO!qelZL8txOq>Na5Fe1*E8wrW&MYGb|($G1zmDVE**>2ztCrEU8=d~(W}Mz zZO`uPD|O+FokK}PIv#2OA8b^gt)tDnP*t8J95ygNA2w%+gdt(V?d*b2j)LXsV{|8R z%V~bk%iRS7`#u&+W%uShmgn4id&_BIS@YvYI|G~DqkF6e1gr!-0=K&drd->2??Wyv z2aI910BE@EGia1BSBR66OZvmC`5SqQ%|sqH7uFNWi-QNWE&Vu=yG;p#Kls?r$~^NV zc25y;Fn7mAv8bb7i71y12qy%y{fv82Rxk3~ww!5XdPd))n&O~PYyDYPA8>4(b9Mq< zf3fF-@#Ne0g2r$o_yNeU%^VT-#emC=7lMAQW9F?Y&Z22qdyP*kN@t0bnoZuJ)l+4MUutnu$Eq#NJ3@uHejcSsf&@ zD-g#Hw$)vb0ht{5<2D`oEADn{V7aiHUz_uI)F9j+MOPu5yssMCd&hrhzBo*bzQdLP1;LCF&I&M^cD8v4535L%p7Cv`_OpXdkMQFc;q=-~ zMtci{HVuJx+bcqF`-A0P^}bM}6XxKR6B)BnOir6GREc5D->*3q9I&}9pt=i-8g=k- zHzK?woE(=QD5#VacDuaEY)I7lDvF4F*6t&AZC8%6TkU#N z`MLU9U&lloksRnt8R*WQ!W}lrfg|C=a7PwAyq{bZ56(W&4lvl0-)pXUs6(lcEyvaIl=79Y64xA4%!LNhmiHGc#Ap5bYA zQu6}cvP?N5q{Jic?r0Gp;>}JvC#vT^&05ex6c%ykH>VoYvuN&I^iuG7Pa^p}sj`fV4@kb{vd)(2VFUkt3Y*dSp zxMI(oV%>NcQ5lveRe`-j>-8M=hcla<_VZn&Sm4;++EACOkX~tw&FxrGleM!G>UH!Bem-6+5~t*y0%W>u<}(ZY)u1QMv|?^iUaKbgbn{>%VmNZQ zffdZdPs0j!IOM{e{p1$hElJByom%GLtLcrG%PoGmoUMUr!eD(gHN@mgH92Kae66yH zpfiB|Nes$z5EY?#iz))QMER#&n`uufxn+tIbYC*Z>Jw#~LX^ad# zUYp?fASzz!^3?2cPKQH`7>a}~q8`qsf}!87RFKU&W`&STEi3+$z?{9#fZeE@xs8wT z3coZwf=&si&<_0tb3wk&-(;9r`0I0CF#^(<&*ox8p(i-wIjz~<(jvM!8!w+|j-5VA z^pN_ZJZdwFHlmmcS;VtC`~0kIF^Cn9o=^wt`BAlB#FKIq61?w;IaZfAd$=ep zx7i(_g*KH<3@U)WP~x}qYm6;Nj&Ced{1KoT8}kAj{8B=>_WO(OU}7e}S_QW+5BA`I z1$GkDX9ilf=Lzx*@{Etn!Ll=1OS!=QKqJUWz@a|XHUf>uUlRy)9sN~XfE?8mcA%@= z5)saZE%IUJRqlBCu+V2Y{)~Z4{3v@2lL%Kq5qO}hhNP&fw0DUWMzp+|4jY)PyA+v7a`!Fnb~rt5pWOYRb8myl2<%i zE7Pu?LjM38y4th@tuC2-xl(CcI0oKJ9>iTc01qpJekX$|@K)tl97Hi1wVz}(oQ*fk z#v17Mb;u&&?U-5HPt+`biAy6_Bv+~4$;{p+gL!k8!NL+_YAiF=W9G4QDZGgph3r{a zJ>Ar#H!eHtumU!UuR!t#Z-vgjeFa;5Z2GNp+Nz29QTr+6n8 z716RLqa?d!F-QjHPN`rn4B#N_33CwB@)U<;vxJQil&5DTPjemZxE5_Qsv9(7N+D^* zLzDUJ$nKqfztF^Ij)IU_hB@onwv>itlVy_oalXUPn=e!Qp>V3uF1fj~m?iqbO@g5T z0&NF$-~5>1I)f?8WsxYH4^Gl#$fxANBiIN#WzVGlgp#^%;o2lZN^jP8YlzQ%K;t%3P2;!21GKS2-&66WtDoy!}-2H z{JTEd3cF{6sAu5cI-$cQ#|QkkZCMe&9l%xnlt?H0s)jU_F(aQcMD=u2k}7Sz1|tZ< zxd^X#PReWlN3hM~?C23*`T4T@tGtH*-iKAPCcVAyR(DYXQZ!Nd8m#4=@tAsuAS*LEjlCmB{W7U2H!;{=)0;k55nxB;JqH zopw^H$0j)_Hn`FzK1n}G4XOy`T;Vp7V=zK{O0e_C1g8M~V=MG~{|o)eeD8E<1^d3E zkEeQ13gQ`x8+i(UU*W|EHO$yIa!G8I?>$WaTi+s@v&0CXfmW#8T+l*( z>+5d9>cuBn`0b(;I7(EOErLgoXG^1Sna>a>eoL0<#C8Fc9jSUaqU-z{pn;L#ca+yK zpZEWchvWF`8}d1ua5>oGDC!h~R-HT>a34DDz7TxB(8jJ@(3*#Nzp@2nN`+zWg0N4l z-+JFO?3o{aw~T8QjQ4>;-)I5tD=P-d`9N9@$ugiHr>oe2O6p$xnrLHZD~dK<1<*I1 zM&bBgxzZmKq<{%_pIV-vYNipu#{@HSbjuO|MZQ3lBsm1ARyr%Zf>w5z3#9FMM@!4J zR0rb*r0C9iEZJyXvj7ipPDy{jx&VCK4+*k;3t2Z6$2?v!*G(B`B5V$a0zNG7gXuIT zYfIx-@XW)pelS9^a%R;RWhB+$=tu5T9CW`x$Ajm3M^8@IOh+x`_k8T`Th)LZ(7mz6JS~3c+Toy_6)y zf(ZdT8ztCgNZcs;OY|2wy9RspWoGjH1j7by+kEI^S+xN@AQEOTduTgq7mbX%Kx!R+ zOfbyB8tD#oMBSk}!k^8i{f8J(5U}n&M4mI9#(z3bUJ59VoYle3-<{BuJ?WbD^tD$> z%xD@n4`U2Kru3DRtVSD9O9LOih&FlEPzwRw9_a_ik@97czdrKgotqf(h19N0VT=5hK^9GN&Bq!ia6&8My#0`cwJ(R_% zzvXbzJ~iFkq-LF&S{PXv-M;ReQeD*$>_xeM1nHW$3QHD~3+Iv<1C0Fv0>QR{G+i!( z#lvI!evu;AK}KFd@)#b%!f3jl`2qyVES${_12zREa zp>AeUoh@oG1i$4$rs!1q=v&GVb;keV1M2*AD13JP{{v(GHuSN!J<8O-v2ehsAv+0I z60hT5>q@593Am9gUPo2bu7-n49Dh{zdvlNdqC_utA75yE(uZR%%*!FU6Jnq=+}8Zm zPr<4U8ZsO7H(UT))=&HVX&*yn!DL_v>|{4}rNM|%UvoX~TxQu6(+z{f-7~bSz@E9o zxx;}mOnzlJ)U6eF$~adYD#IT_PC-)zjw@bo7};ZKTe%pIo_3{?Jh}_97F3goZ{wF% zFXo4EKaoocD*MHsb-kVu89s@R@;(Js3<*JPCMgiF7Q~c+qy$w^k~$H3;lE9RvIFIA zb0eFw$==@eRUf5o`+WYQPWWeiL`ol9VP-LX*(?Ir)%XM^&#?MXT_@nKfo5m;T4T#A zztz%g@)w}3u1boJD_}(xr0V{8r%tPtsLSz=kz-h+L`WLL5qRNj#FW2cr1Kr16UmC? z2i>$*39pGOva3ki43a((=$juY3gh-M>*ctnc=KQLqblpiQ5CsAX>~9nKPf0qOjaNH zu>I>whQ|zoSV8so2z^#Ig>B|GvtN187x;McTm$oG<|#{MB_#!hZ|cRm|K!_2bhYpv z+Jjfk3Z8hNc-?u!eTF*fD+GopB#qqe+q)O7v{%EETBXX-k3nv`R$~Ptw3o#)q9Y1| z`I-uXTb@9h%RZ3Vz4q65$w*X3zKtV)QYgsn22wusew7u7LZfAMN8MteAUFWe6yRIB z?|X2tF_9jWl^!JSm>3vm`U-}-lpw6HH*LD<-)9yAClw=?rT@|f^KEDEl!broxI=%* ze<-u~pJqq<9wPIZm|(Rh)l`iBkC_s~Hc%YNZK|ao0?5bc{oRYih*vh4qW=&-f0rp8 zg#pt^=DXKx7qB6m)%NvL1YgQD61X-nGVO1_VFkk_=h%NrltdUSxZlZCL2USwTo$() zj)EDnL2g4~NTYBLqUZ?a3mk0cCM*R8#=5T<{Q47?b#Dw4ZwkaH;29(N_`j0QLE;(S z<9i})DbKsT=5exo`pZ|lT=OUi{?~wjCzUTi3($}Q^Z&sCmhxPw8z^qAqP3php z9M?R|KLMCEsjo@>x6E|Sum2N(S(Eyj)PKuN*ZlfF0hl$ZuSxy4%yiAK{}X^&llq#} zf6GkQ{Q5rum^G=dN&UCXbj`2-6M$Kh`kK^#%S`{re*KJp$xDjegBT16)F|MhuJ8*e z=Aev7Sr?C-WfU$3QT5i_wPB`Z&@X606dRlj_4vplarNaeGbDEX;@m>$$XtvQ`EHBL zhQgDLX*mdRWV#O>zdid95_)T;k|+sOj>yn);946U+zdjO#gTf-e>QUBF{75{9YhXP zfPhMznyS#L$-;hnGyl1+nXz#x>e*KKYMD)dvT{$*P*Ar8^hx*W%sxtO(PDytlAe1Yf`M-z18@Dg8nt-lr(ReG3Ifw#Sm@w$p7sEglACBK?c&Vq~RZnTMxLNa}^+utk(6YE5- zvN!ji4%K->qpy|-aQG4+K+LX5{oQc`WZYX7FL<5*&(7w7RNHrtJmL-i=J&= zE_n^6UR`>>t{acR$MN8Qrsr&2+c0oRZz}vi?NlycqeQ6=#atc$ALSZEf4NrD zBRPMBneyKMF(|^5Zih~L-J&)tG|xUg$XPtIP>UL+yF`) zFdg{fC-cVy%7E`zm1pxeW_RIa{D=S&B?C^hVjw-Ir2b@^%)VZIx)5z{Ra1*2>+5if zLx&~lM|7vr2XIr;uv4(bw=&w@i34PIdNP_wUx)XMa>B;FM=^mvC)IV-3XY$-_Fvr7 B!yo_v literal 0 HcmV?d00001 diff --git a/assets/images/video_bg_disable.png b/assets/images/video_bg_disable.png new file mode 100644 index 0000000000000000000000000000000000000000..fbf0777cccd76313728b8d794f60930ab10c1425 GIT binary patch literal 16677 zcmeHPdpOi-`)8V|K`pTpDU8}uxj*;$zQ51cPu7-Z z8^qXEpA+wI03uq}gGUZ+<--zcD`L=G}~~`?lqLo2C44 z*S=fVuSXodf9Lx*f95=~vQK5R@3h~ap9uCD;P>Y3?&+SGtQyucEDVVA&M4VphUW{G zp34oHdBzMVdM0K6F zGcegU%NK;--n+!@X9O?Ly_9uZB$V|S8r2hdS+e6iz8fGnA~(cqkQ4XzxbUfKN{bErwSrb`)xf0JV{Ti6T)07f zc`Zh7=sSoLFHCuL^;WA4BiFI17_T1@ReckmxMQsF`435MOODju{_m@|T;qh*F29o- zQmU7$t=K11rwn~F6?0{2alX8~yo)opVexwu;N5C+pmzD7q@uyx!jLBb#B&KY3d#JP5aY;xOf&a{H#skR2Sg-1aL~1aIOtcKntEq?2x*DWB<}~pT1@P|KPE+3J`*#&PQ`fN8d#%9 z?{B*%c|*THG`oy0I5Ox{yZGsqaWBL0X@2Q`->&CQ*_{W3%DT$b7L8J#J6dpju!&d0 zV<_3j3;Oof570=yH%y`9&@LNu`^1SXge--Q=8&rf^09me&lqE;SD7)_U;)lmUagY~ zQSIDWG%&eb8Nsn?kgI)K`h2q_Bwp;)GNSE);TG=DwxUfGLD+H|hOm4#W?I5)^WBR= z761`9*((d5M*x_^rtTJqWoKOJ5|{H!BBc3}N;v(r>W z1jp%YXE`hcX9|nv7FSZTUlD1qf^97H{+|suA#5Rb%qMuGjb0c)LcgT`2&@6|_EKlM z;9fMd8;NAoTXLr%7!)srCHK>vQ~6i1Rh=o?8jw3o*$=*df7&+Lf8(iCuwJ@ZTM=6K zwHRzlP#Jm|E$f0Vur!Hx?Yk>41<7kJ@2U+WWLu{y;KTn+Y&672H71u@MwHM1N)Q7e zQ%?-RM$bYj8ih1oXR4x*Y&*+*9OTcG3?W7pj~0OO{#jNRx7ke7iNxuQ0xg;a{vmH-DnaP{0SH0l-!gWy?G zdt5YA9-OG%nzt7|u?zuRRv{@V$pBq&5)k?DO#WLKO^VPqq&xQjG=b#USRoo6P3wc3 z+FMZ?2(NE}To2^eA6}8GLD1)O99}Tc!fvqtlGBD;5c(Kh(b9;5Xr>c5lipfzQFtcv zBPwl_J|D*%6-BZ;te%QW3m5HC_?nRUkFW56_P^>ZRrUbahC#0C%gqQn{KBs$b@{*m z8r!(w0&6Z&JnhXBJa3|J3vY5jX<)8iw|}vHxhBXio@%y(m{<{}`lt$xE;d>NN4Uob zSy|bKFE~F7!v!H^VI*fLbzt$MS>G8{kN%%o^$wyex&;t%>Wp{0@Eb*<6cwund&nP( z?OkgH<36>Hp^R5{l+qUko>wM+xl%caAy@@W^yCf}+8wpmP4|;dNqCH0`DJgl0suC~a?tf{g49F!kXTNqmV}T>5%)BpzO*J07m3ORG0qKB-RYj^JGS_#z#afDYxc!VPO6X43n-ry1a1^F3F( zX`Mxtw(TyONmv(E*&~2xh-BNO?&X<7+PW>3D`M;6E#?sUY@MXyGb0&()vtV#4#7V&Z#tH`?74bdA&X88Ur8%I&Ap~X)F$WU+Y{7^So@zjS0UNd zmhx%H&~_s4`O3XWi^FW)S#bz|!BmH(?SGS@-@0&VV7DUr;#{$_Alj;h^=>#>Plgb8 z;*&h=^`{XS;>Uh-|GZku<*p~muYR%jP;1OCd~7JQSa^{oyFBW4Y1CNl*Z$AVQy#CL zI{jE^#|A|^7HY~s`TW#-`!*w=fk+c2F;jE^;?mD^GcZu7GB3KL%elV$Ug(mzFe zN2SXn*%jfhxGGS*Zb6tk-bvlp7_#1RVKaLNa;}2cW?`V@>H$(x@&J;y1KOnm_|RNz zX6y@0&ih=5atoP$Sr9zjSw6g&l%gL|7ABp9O||ZX6B82kaqiMvi@N+_&oMo=9__R2 zz^H_UKl;~RmP=exyKEKlh`zsA@$U1XkgJ#+#R?ooCb!r}R#t^M3p7Y035++m30EDz z(07^wlre5rqgJ6GHvUb!imux*zS+}Md#2{R>YKJ(8t=X@xpb6v*rDySs8okdyzAhy zXvGd#>9UlC`h}CXRnz^{^7Je#oqoH;*@`3I)~paK4ww%YpM;S~e0ybX>fJ9B#6mmv zXCf&}^IgSYW!&e7C_lq3dm1%H9r{{e3#bxnekvW%tdNtDe%yFVuvRYS&u+T=gqq+- znx3NC)Vb%q8T$l~o0*g_w}z*OHA@j+7QP^%7*A+Uu?6a7s_ktTADi+mJdgW4*Lf+1 zZ)i@(us!cq-++Q`+D)d5+MR}}_L+zD6H9kJN)M3?Pg+yL3cU)g1N^H;8dN`CG3va< zamnxvg`N2@!q5A9cyoOA`V!1(uZ9~HwSVgH{EGby@cUS*&j9JLvA<}SoNfC-uxCE6 zVg2Y_w>aI^!BEC2Ki<#K(l>OgAJw`u^pTQU?t=&tOT|$E5?_%AWrxCzsjTz4+euz# z*QyMN*7-C{uh)*CV=NbblYKmG_}bh2H-4x9wPN#y_9|Ie=w_79C3ga<`*f8{Yo_tW zT!&8$cqB+Dt(Wz?>1jYFmd-jCYI5)W?iSdb>XeZK%_GBFfU+q+d$zwgI$+(sO# zR{R-vK<$rCE9ySzr)yN=!U(3JCnkS_vGkjv|KZ8BgZAyCL7`3Rp<>17FACtOdmRy{ zXz0}J_lwLoGlc(f*hQ-)*S;E(X;@F5(5!6XqCjDnY!$_V6)Gc@Jk&F)!raGKx2&)+ z-B4(MdhE{66%J2~mltQcMrS-uqS$QXes9Qy(Vx+e;&zNzj9svOf_W8mrj)<;n)p)? zaiz&#$wRwNSj{g#CgW0N~T$`>$yeVh@B&j z?3i&O0IsLJ)wLRam@BJs^a+_s#znI0EH_L#H5E(+by44aOC}vvybaRq5x68%+n8H> z2LGuhPtD^2Ne)Aj?73~1PIe3)1_IYjEV^xQ8#`prhtXj8Z1}Up5#2 zu2do4j)>FI%MbdZr_r7DBkAp$H=$IoKyjk#8ygR_ zUXA_y2sL`=ns^D_{;IJ40AdP;ov_nN@17*0@Gg!C`b^8K|!w$YDwq&7d(Xlh|(br#6Y+4 zaJvB3R(&VnEA86;epOI0RD=YacO-Q!>W) zm9M|ai~{UQip>v0+HijdYGbE4WCf!MEH|CQz^%__%5YmoTy%8w@%^soJx4*|_?l3T zfrR3_g(6I00MJeV=t6yL5(G$PQ0sb!#S>8lP#`LbefSZk{sh52LR)x|6wT}e4t@*bRcV$g_4plRMihOZgi^ZzXK6Qn6#(ijIKtExN?J z8Pcgd#es&8otc^Gh-olEhs0dP^7lI7S2Dp)z)_^d&7Pk?_i@6z1x_V2=7$d-Ku>et z=R^lO?dDZ%@HUwbI&iqO_}UKr;}EA47#+M)9=PCiU4* z{Dv$L5hR&M`ygUi^{K`AnTr=M-to>?qPzsPa&(Hg?ja~*8CkCM*Hj^}^uQqqSc0r? z9;?YJOSBi5J!5-j8Qe8jAV;I|kX!#__m}?XAItwI5j|wusCHE419Q;%CFyLRh=Rnh zRe5T(BmZJpSlF*>jO)xGU=!R{>K&+=xFu{R-ZyDKdk9t^KBC>h5S!WG| z^Cl@mnE}7vQV2;!ZHmJ#Ibr;7%fJ*8()D%wcVQcKPOHM*;z5--rW?Omc3c)LEN>z^?Cn^4@!D1Fm?zxV+G|+jX0w^Wf;MD-Vz`w30RtR4GJ$v$ zR-X<+7uC~En_b8l$S&ncB_A@0Pd{X50f(y7l>9hNgTPOOm)o_UJq8_|d4@923{uA? zRcp#D2#r|*!=sq_*%aFxtNwmQ!g=r`t`` zsi5U0!8H4921BgapE2hCQ+||1S3tm0+#~G4<*nswVDdjBKqOHFlO%(tU|OmXvdhX? zaJjcCVDe$ZbdBlG!nOTz8k`Mg0GgRipfXhLV}0!g7Z*c7XPHCp(`JTou1IE;9tsb| z6&BW=_ljCx?7EL%-Y<&lRH4Ag$`hFn&Eooz#Ws~hF1J*zC_v#XiXA|8ciZrcWjgVE zuDxJ#)W4aJ`l~vUn!9BZnI~SHbE##syW|ga`Ct}?lWKpdth!RI@xgCCnS6MTB_Vwv z(S~tP%3boUeNW;J^5OEz2!73ARc72Ly+?y!;=_kz@SGZkYV z7>C#7n(gf@0^~Hfy01gwY=@HA!_~UJV{O;twQNr#yt!K+h7gx>ga&6YWX(3~{AiHX zqfa;dD=QjZ0ysJqWsrA>;^>(Zz2U@*p<@vzT}g{nSNgwdNH->YcdOu7$;wik=XIiSM8U z_0Ir>|ExSv8y+4q%RV~<29*iz8Tsc%ZD|$tx(;qQvPR%amHLx-`{?O$r`Lg0Z6IgR z6gv#}wm6#qi$zBu(!nW)OvUVgmMG=s`HhkNWRL)&e zNh&AEf|tLo(eiBmKFD-WJvJFXWqnX~tKS7Zrea7MusW3wWZFi8&+tcANZjrv!jdv* zrgxZMsBXB1pCuV#!!Y{pGCy3SvA@6dAe>u1B8@J~MTqdZao6jlviaH@2{|QpDG&ls zQ9R%o96ZSHE=P6+Ska-+rT+H$(*4Ehp$226BoY3*-J1x;q{}@H=;E@(86#NWI7*!d z8o`-Pn6#x0QH^F3BRCDW0u3PqT}39LYr@NVVuN`T7f!t!x)H{z+iq0YQ;Jt_^!BQW zy$8D-TKvFz4<{0i?Bvz~u`EK_AOV)Tn}962cIoi0t|Bls%1#gY`!--1mNnReRNCl@ z0p0*nTYLNuiN7ocO*#bzcK^0*>kX}c+vb7(Pqu-GNB)FjpAWTzyHuo(Dk!N&RPgcX z{ioJJVli>Q22$evus107NUT2`29Y|uKrR?jasB%?(7FF7+afrh6EqqveG1mVajggk z^7?V(5wKpb57l6zh%I1rmXmQAM-K8-fNBmPNTF;OjsZdHcCJLYu4Ev{eKH!2XVUyv zVuj9kfU{>ZIzt5# zD{LtPwg@|&<691l!KofiItpb>FsFSBlKodlMw6^T36cU>+uvIG1%R}#+@Zf8@dK#W z;#1Gzbk0)Y5hR$LiQ;s0n<7Z9PAV(HUIT>vn?*4;wWRZ>6>GT)Kwe7N)A+H#A8s^| zI#>X*_dAJVJ+JgHAkhHiKS@Q9ynjZq)998fAlC{(rV{?nK~B(zosRJ>j$`nc5=}Az zHdb+L6Tz=jABw7?2sK#%h8%%n7nFIgkh+BeVA5T1I%Cu=EAl!`ak>L$Bz261vucWA zA?G4UX)dNKuwEfprsGvFChx`GR;a=T7u;p7kVYOtV7z^tni%Klx|hwPN!uGWE;;qW z(^ag=U>zdLJ=pLwetAaHLB9pKYmT1JmnR!o-)Bs2!{$-*^DKwZIE~UwS@B|t`|HbA zlqHpHJ}5;}`=kHai{QDEiiyeWnh4I%XX+R$8bWT;D0-B>8Oe?eKh>)UV=x(PM|v+5 zcXtevCG%?n6q2yP4!Fq`-vG~25}6il6ZTo2Jdi4UUQSrR!T@>_qwvO?v5h;=m`K8i zLGB}q;!4wPabJJGe)X^64d5Zu)g=CciXB{wf#0#p;QM#ED;|cHIwvbd=sAXg6D~OD zC@4F{el&#j4cP4lwH)~*3Jx>icWGeLha6Xrht#_&{8iIibv&p9|8It!lx@guU+w~c zi1^=RW%c;g^t1BhWHtG&mL98x*Gk2^T6V4$-C$A&S;K0}vD$Ebv4z!kbG6xqTItnM z!|I@AbWJ~bK4M&*>#ff9R_A(fAXPG zs8;>lt~8O?3*G`x-CM8pEYTi*SywoWV_rstgX_mjQ&NQR zz?kVt&lvt&t_^$x68bzHr2$?~E(TkMEaF3}RQW@D>oa;Qp8bUlnJqIH-RI5Av0EYv z?`JQakC{$=%U!uf2@#>9h&^2c-Q(o8T4};S;crX6G1Hnr7}frPK3}gRVP9)bxq-!j zaWehb^VG3nwc;pa@KUz$74)C9dT6w5&?5yQ(^RDDuS@4t-t5u?e(WXU!nd$RBQm`9crS+b3i#!d{P zlwyWZ#3*E!op-+Pzwo|4et)``>zw;6*XRD6>pCYHWog32F2c^hz`$i@YGgxSCm0wQ zVE|V8uB+H$k-jkEY)lLo>OYG8W?&HQGBeV*d+74V`PQhwHE}YGgwi48P z^W`~AQ&Y5$pWixy+5}*q1eA1@3OxcScBy}n_$hm0A!SW)VQGtT)B%K z=}Knfm1N45+F(z5Ff9~oE-6Ysev$NN>bpFebEtN&Nl@DVTnvZggvOjClaZ?kp~vD*zb<673pQghg-tQ=5*Qgl-mIueSzbxv zJ!T_UR=T>d-rWKtx-!@QLD|cPxj@-jHTrlnadK)(HTv{mX`?6PFYaLL?&{G$5ufM* zZ%j6O7fg19?|oc4TxrnUU!8n4Fzx@2>)oEuAG*)rKJkV9lfCaB{JKswA~w!a1yw#u z_dK9Dd-%3*8solLXmUv$OT^u|#Y&IBy-2^PH2QS%cxzaNM!6lWzM-ciqCNdV^Sh5P zX%UQDscR7dX5QERPjrpfghJ+e!g}(E?A)6gKI>Jt>Vk zte%IRB+f=1{h`q%-Lsz?+&QA>zO7;3Vz*mwaijBS4SVkwqd7+Fkt_b7+P2dD ziO`jN1ajs4HaCxiuJ%Zc#}Nl3XeC9~)o1x-LnlU8Jx6%3jr+poK12g_KO0Tvyfms0 zQQAH-o;qEvl%g<^;IUC(zLEJ>jt{mCwTkawW3>pnlGKJ)A;W8i&E zv;WVe_<)*Rd8?-KPGB1<!8fDUGtfKshYHl^l;sSx0@@#r79^p%^`xFxP6!auY+t<#J8l5lq``md zyT!pihrn)eVJh@_!2}l(K0Kdmr8{R6UV%?0#qwM|_SbxcXq5slu|V$T$pl;B0BurW z_eNx7_M52O+cfTt-hh#a^|A;0we)Yv?I!soiUr7xDdqfA$ALj`e)UZ_E9fflZ{)zZ z4e8)#k@o-|8$GrmlzL~7kqGmD1^XI_DaUEL1r7$4gDdN*5KrGv1IP%HEol&?eUxjeE-S~VtDR12x!2GouPIi0D2CObZkpDJ~M48Tf3OwTq}W%nyu^e>-7pp>FE?Rlnd&F_Pt{Mwr2 z-MK^w4QD2VCUN6acaTinH5@k{GtCuxqh{_L9}>h7`Wu_6V~lCmqa#}PUch9r_eV2W zyX+#JDMZKA6ei3{=i9&p;KAL~I!t=v75l9RP^{I>Xg@n%b$ff7X z>4D+N1CD_eh)T6|n?*Hwv*Nh6wV8A&aByO8Qy#)Xn)nY}NSd7dWs~Km><4~+oW#ag zpQ)q=1lK3q=KJFD~_K#fR7hyzY&)9kR<|8iPh}XM)dJ|n^|$(g z)8F!cxqo;^xHAP`Z>ig=B?Xosgwk}*^T^eLvbI!P#kXE6rwG1HwrB32I**8P9!6c> zf&XIs;+r(Syf{nPPjTQW6xB%9AGb39IowfkZ$3q=&b?Ja`=P&rg||=D<@pn|P2peR zKgt=)1H{!2ui4LAcn zeoP{yRtc?M1H4`M_=XhD=nG)R;lQ{P(}NDt%yW9TmN*FPaR=c5Pq>l^`_M)sV=}5r zPq%sD^if4ZMk1(p*~Rf@Uyl9Ua=$75ZKgPDeA@_d)k4Y-9rz_zHm!coTk`5TVwjh6 zC``e4ez+!Fm7ukD?$vHZ=kw6jli+Kx1fq_WYmV{i{4r9 z!BxxQ*Q=f48x0gnU7}>+6;=l!xaK%#Aap10)$q{fWigFVfNMKX>@s4;bI%EqoFCRi z>T+9zf;Y_y-6Ti*3JL(Ppp6S;=V2PC_WbC$0MUTmQ$5i?6gQ5$)~0sRSQ6yz=A1xd zd{GhvO7@N^74HOK zv~KLyHh*I1;OsDT%w9I3+U|&{;CIbu44nM=&zo_)-P_hH?u*NE7adHycF>o8!TCc5 z@JVs)f_abAPezNcXvPMuswOhHq$S?}04s~Q&_7tA{@vy$kqjJ;?kzKaxcpU-c1sI< z{rJjO&AUXN+pnJIk9&^r9k@Mv0g7npONmbzY(b55clm6~Jc?lNXMb`tK2QCkHbzrh?@ZplfOqbD=tp1&hlKCd_}m` zqZ+=dB{7_OjDXV9I9}0vrQmwm*8Qr>Nw`%Z!Mx=7?1$I5z6AkX-OquQ9gERpedOBJ z{F$HF8}FQYu&r(A26=UHs3v4RA(n{x^r6Lx+DLl;`%9%TxZVT#jxZO)e7-*PQVJ4w z2J%%968*;hyHm~N);8X_boLw(Ib8iI#l#`#4sq#Lz75t&|6+JeZ<2ds%Um$e0IqN~S3f3=8={xp_WUmBnJpk|UP zYj36wXVtH9%|7HhiLo0b;Um7Usnz&=;rMG~WVx7OTLE~@O;WpYzMl_@zvYlM<$8)V5iFS-o?M-@xP(z`T8v_@)>F>%$rTx7v59f=RbJ%rDDTxTK(C#d z)y6A%auTQKV_z;13O1AT-gix7dBG(*;ct#+f~|GGcSWB8PY+1h>)C-_ZSjB*K4B#6 zYV`XXJPz$bW`nXxi-OuV*SPo4N74M6C@mxL30uR{JGV{p*mrI2uortgFvqCB#y?0} zOf7z&y2|(E>I-++NN0$7cnot1+j@2HYVs#npO2{wAz5S|-pI(eeeBtnf^}a$<^wj# z5)H~zLN!G}b7DY_13_(v+Dx{m|GwrBg1)B_)Vw_`_v1^P6lYF~`wo#h&iUU?{69GU zm=+(F80_2CQ-&e4m-~MdH`X$jZ)tw4mBL$H2ED{$4$6!&&}GNfq2^u!9WPAXtrMGNWT{oru&R$(WB%nJf{)Qq~+u7pN zbw5u7Rg4U-vIO-E%5L})Qfj1i2@GjG+Au(3^yVg8+Dh*~n~X6VDsnyZu_@xZWlZ{m z9Et28-`QV$Nk7qd<-Xs@5Rk^lyKxc&=Uh|JcQ=N0AR4yM$c6{A!_m}z3Lw;UFRYf` z(pAMa6!txJVbJENZT-M}5PU^$K?gJE{+ozhFbgH3T-4lh0+nmG* zIE@sM^EP?_;MS0RG_#BDR2F8p)O(Y)nHLt9=TWoksMx@Jq_lW0a8E#WN~{QbI1*Ze zD2K4|;YtQOC_thOPrjHX@>E%af2Xv&x$H)oUfHM7y{L({gHSy-MP%MmxWiddp7oLe z>ib*ltb)7;8>5p7|6!L^PL8f^AV~w2YP}X!dFm`c#LQX3e0I_y0^Im4a);&6rtEuj zVWe{0PC8Wnwq=PO0ndIG!4%)lefZaq^eKe25*Jk5)&TAb(T8a&x7?{=JCFPrkk5B% z-|lKPa9}r0QD&E`T#W@Lb?^PF{4kNLEjt|^%3Uc#PZe9HNK1djmX&_3IbEWqJ5`WM z6pR@tm-b7b3zO4Pt9ey~L?LEt$W4Vv$WkMl&WZOOu9=4QyO^>{q-x8(`Pq<~GipEu z_3QMK*g(xDS~uH(gcWpaEBkp5(NVktC_s@DilLnPXWa+_(@G z<(x9w+A16#rP;TI%P*37;{s)MO35nw)Hmw4iqO)s;Yo9>NZ^D|Btma1j6%7(Y*@v& zeTj|#2$;Xnj!?2him8;K*S>t>x=$908lj$a8q9Khr#F2NP5X213fJGyyvsA+Th|Oa zBf>vuMu{b6QRR^eDqBOeTq=*X?VR(f_=`TzjLxsTFBjO>A#E4qhC}n6B-Bf!%loRg z5)=>FLL2Oa1Y1i{{|K$f7>(p*R3tvS(u7oT*%yDAhd#CCjsCVlCtm7zTPdfMN3v$5 z4&y(3W126fVb^Sg%pve#!Izvb{=yTM}iarJ~pS5&XJu-(E zJx@u*d6VQGyioKAN1r$(sKRlKIiPK8;gZL(=)IW}*zScnVA%K0CH9&d#n(>fz#2k9m8 zE^kDKuO?LtS|AZu^5!&zD5emy#!q(1T^bi!E@~=U&uLenDIz}>-#V2&Tz`*^-zv82 z?br@-s0*g?(hQzcbG!283#UwN_6j&6ZD(iuFIQAnuUFoP7B#HRJ1>$;c}t=awr?qF zhd8%LX1^cBoWwPnhANi&YaP5kp1nZy>V5Yq_fk-&AFMh;)}$#X;D3p1Hm`@0CG}Tw z3mVf*feL>aGbp+9us&4mr4eIwfMWP56|OuHVj*3+Rler80)qbS?%5+I>fi5?p+%Yp zp`IZv27=a!Uh@b1J%J_n*efz+_ig6vxMRnTaWJ>a?uXU78hA8Gm>maky}qVuUs6#o zuw7N5MWG($hRqrSp)65pXxRZ;#*j{Sfokwd9de<1Gpzd5%Rk>dMR8#Yjj0ICK>6}9 zw_S{YR;O5$ji4m34bFySk#<_EmFGzg`lgy{u%&qNgJ!cOfMPlWZpaWLn{@%H(J~C0 z|4=b)*QL%vU`hn&PMBgAAxTR4j^Tf%JF?KtNg{@rajZsB_9b%mjD}WSWwyKv_Cq@c?N%0p6KT~d#C%W51lhrSE8_>6LkOa(c<41jCbyv+*_!&XSDvSc&m)>KZ zIefljKyNPpSKz;S_%9y*|Nezu?KYXv(drjF#>Z$4aAF{4h+<3lWx?@MOs%~CFk(7< z(hgeIj-Kuq>G3l)JVI~S52PX5t|c40B|WlaQ5MFQIO_lX^XJdabi~=$P>H-kK$5|a z=5eoG6=barnV^}Dh~|@({?BW`{RRZ>VBD*jKFms?cl2FU$;Yv7Wy<$$rf2}kmrZZ!xDlGbd}G6@qRX R(&u^%X4fo@>J3~U{|~1LbAkW> literal 0 HcmV?d00001 diff --git a/filters/filter.wxs b/filters/filter.wxs index 982eeef..fc2eb98 100644 --- a/filters/filter.wxs +++ b/filters/filter.wxs @@ -168,10 +168,31 @@ function formatwenzhenList(arr,type){ }; return {ISHAS:false} } - +function formatPrice(arr){ + var price=null; + if(arr){ + for (var i = 0; i < arr.length; i++) { + if(arr[i].inquiry_type==1 && arr[i].is_enable==1 && arr[i].inquiry_mode==1){ + price=arr[i].inquiry_price; + } + + } + } + return price +} +function hasFree(arr){ + if(arr){ + return arr.some(function(item){ + return item.inquiry_type==3 && item.is_enable==1 + }) + } + return false +} module.exports = { formatwenzhenList:formatwenzhenList, formatChufang:formatChufang, + formatPrice:formatPrice, + hasFree:hasFree, formatInquiryType:formatInquiryType, formatDate: formatDate, formatNumber: formatNumber, diff --git a/miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js b/miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js new file mode 100644 index 0000000..e5421c6 --- /dev/null +++ b/miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js @@ -0,0 +1,186 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242893, function(require, module, exports) { +// TUIKitWChat/Chat/index.js +var __TEMP__ = require('aegis-mp-sdk');var Aegis = __REQUIRE_DEFAULT__(__TEMP__); +var __TEMP__ = require('./utils/constant');var constant = __REQUIRE_DEFAULT__(__TEMP__); +const app = getApp(); +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + + /** + * 组件的初始数据 + */ + data: { + isShowConversation: false, + isShowConversationList: true, + currentConversationID: '', + unreadCount: 0, + hasCallKit: false, + config: { + userID: '', + userSig: '', + type: 1, + tim: null, + SDKAppID: 0, + }, + }, + + /** + * 组件的方法列表 + */ + methods: { + init() { + const { config } = this.data; + config.userID = wx.$chat_userID; + config.userSig = wx.$chat_userSig; + config.tim = wx.$TUIKit; + config.SDKAppID = wx.$chat_SDKAppID; + this.setData({ + config, + }, () => { + this.TUICallKit = this.selectComponent('#TUICallKit'); + // 这里的 isExitInit 用来判断 TUICallKit init 方法是否存在 + // 当 isExitInit 为 true 时,进行 callkit 初始化和日志上报 + const isExitInit = (this.TUICallKit.init !== undefined); + if (this.TUICallKit !== null && isExitInit) { + wx.aegis.reportEvent({ + name: 'TUICallKit', + ext1: 'TUICallKitInit', + ext2: wx.$chat_reportType, + ext3: wx.$chat_SDKAppID, + }); + this.TUICallKit.init(); + wx.setStorageSync('_isTIMCallKit', true); + wx.$_isTIMCallKit = '_isTIMCallKit'; + this.setData({ + hasCallKit: true, + }); + } + }); + const TUIConversation = this.selectComponent('#TUIConversation'); + TUIConversation.init(); + if (!app.globalData || app.globalData.reportType !== constant.OPERATING_ENVIRONMENT) { + this.aegisInit(); + } + wx.$chat_reportType = 'chat-uikit-wechat'; + wx.aegis.reportEvent({ + name: 'time', + ext1: 'first-run-time', + ext2: wx.$chat_reportType, + ext3: wx.$chat_SDKAppID, + }); + }, + aegisInit() { + wx.aegis = new Aegis({ + id: 'iHWefAYquFxvklBblC', // 项目key + reportApiSpeed: true, // 接口测速 + reportAssetSpeed: true, // 静态资源测速 + pagePerformance: true, // 开启页面测速 + }); + }, + currentConversationID(event) { + this.setData({ + isShowConversation: true, + isShowConversationList: false, + currentConversationID: event.detail.currentConversationID, + unreadCount: event.detail.unreadCount, + }, () => { + const TUIChat = this.selectComponent('#TUIChat'); + TUIChat.init(); + }); + }, + showConversationList() { + this.setData({ + isShowConversation: false, + isShowConversationList: true, + }, () => { + const TUIConversation = this.selectComponent('#TUIConversation'); + TUIConversation.init(); + }); + }, + handleCall(event) { + if (event.detail.groupID) { + this.TUICallKit.groupCall(event.detail); + } else { + this.TUICallKit.call(event.detail); + } + }, + sendMessage(event) { + this.selectComponent('#TUIChat').sendMessage(event); + }, + }, +}); + +}, function(modId) {var map = {"./utils/constant":1704768242894}; return __REQUIRE__(map[modId], modId); }) +__DEFINE__(1704768242894, function(require, module, exports) { +const constant = { + FEAT_NATIVE_CODE: { + NATIVE_VERSION: 1, + ISTYPING_STATUS: 1, + NOTTYPING_STATUS: 1, + ISTYPING_ACTION: 14, + NOTTYPING_ACTION: 0, + FEAT_TYPING: 1 + }, + TYPE_INPUT_STATUS_ING: 'EIMAMSG_InputStatus_Ing', + TYPE_INPUT_STATUS_END: 'EIMAMSG_InputStatus_End', + MESSAGE_TYPE_TEXT: { + TIM_CUSTOM_ELEM: 'TIMCustomElem', + }, + BUSINESS_ID_TEXT: { + USER_TYPING: 'user_typing_status', + EVALUATION: 'evaluation', + ORDER: 'order', + LINK: 'text_link', + CREATE_GROUP: 'group_create', + CONSULTION: 'consultion', + }, + + STRING_TEXT: { + TYPETYPING: '对方正在输入...', + TYPETEXT: '对本次服务的评价', + }, + MESSAGE_ERROR_CODE: { + DIRTY_WORDS: 80001, + UPLOAD_FAIL: 6008, + REQUESTOR_TIME: 2081, + DISCONNECT_NETWORK: 2800, + DIRTY_MEDIA: 80004, + UNUPLOADED_PICTURE: 2040, + UNUPLOADED_MEDIA: 2350, + BLACKLIST_MEMBER: 20007, + NOT_GROUP_MEMBER: 10007 + }, + TOAST_TITLE_TEXT: { + DIRTY_WORDS: '您发送的消息包含违禁词汇!', + UPLOAD_FAIL: '文件上传失败!', + CONNECT_ERROR: '网络已断开', + DIRTY_MEDIA: '您发送的消息包含违禁内容!', + RESEND_SUCCESS: '重发成功', + UNUPLOADED_PICTURE: '上传图片失败,请检查您是否未注册上传插件', + UNUPLOADED_MEDIA: '上传视频失败,请检查您是否未注册上传插件', + BLACKLIST_MEMBER: '您已被拉黑,无法对此人发送信息!', + NOT_GROUP_MEMBER: '您已不在此群组中!' + }, + + OPERATING_ENVIRONMENT: 'imWxTuikit' +}; + + +if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });exports.default = constant; + +}, function(modId) { var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242893); +})() +//miniprogram-npm-outsideDeps=["aegis-mp-sdk"] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js.map b/miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js.map new file mode 100644 index 0000000..3be829d --- /dev/null +++ b/miniprogram_npm/@tencentcloud/chat-uikit-wechat/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js","utils/constant.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA,ACHA;ADIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["// TUIKitWChat/Chat/index.js\nvar __TEMP__ = require('aegis-mp-sdk');var Aegis = __REQUIRE_DEFAULT__(__TEMP__);\nvar __TEMP__ = require('./utils/constant');var constant = __REQUIRE_DEFAULT__(__TEMP__);\nconst app = getApp();\nComponent({\n /**\n * 组件的属性列表\n */\n properties: {\n\n },\n\n /**\n * 组件的初始数据\n */\n data: {\n isShowConversation: false,\n isShowConversationList: true,\n currentConversationID: '',\n unreadCount: 0,\n hasCallKit: false,\n config: {\n userID: '',\n userSig: '',\n type: 1,\n tim: null,\n SDKAppID: 0,\n },\n },\n\n /**\n * 组件的方法列表\n */\n methods: {\n init() {\n const { config } = this.data;\n config.userID = wx.$chat_userID;\n config.userSig = wx.$chat_userSig;\n config.tim = wx.$TUIKit;\n config.SDKAppID = wx.$chat_SDKAppID;\n this.setData({\n config,\n }, () => {\n this.TUICallKit = this.selectComponent('#TUICallKit');\n // 这里的 isExitInit 用来判断 TUICallKit init 方法是否存在\n // 当 isExitInit 为 true 时,进行 callkit 初始化和日志上报\n const isExitInit = (this.TUICallKit.init !== undefined);\n if (this.TUICallKit !== null && isExitInit) {\n wx.aegis.reportEvent({\n name: 'TUICallKit',\n ext1: 'TUICallKitInit',\n ext2: wx.$chat_reportType,\n ext3: wx.$chat_SDKAppID,\n });\n this.TUICallKit.init();\n wx.setStorageSync('_isTIMCallKit', true);\n wx.$_isTIMCallKit = '_isTIMCallKit';\n this.setData({\n hasCallKit: true,\n });\n }\n });\n const TUIConversation = this.selectComponent('#TUIConversation');\n TUIConversation.init();\n if (!app.globalData || app.globalData.reportType !== constant.OPERATING_ENVIRONMENT) {\n this.aegisInit();\n }\n wx.$chat_reportType = 'chat-uikit-wechat';\n wx.aegis.reportEvent({\n name: 'time',\n ext1: 'first-run-time',\n ext2: wx.$chat_reportType,\n ext3: wx.$chat_SDKAppID,\n });\n },\n aegisInit() {\n wx.aegis = new Aegis({\n id: 'iHWefAYquFxvklBblC', // 项目key\n reportApiSpeed: true, // 接口测速\n reportAssetSpeed: true, // 静态资源测速\n pagePerformance: true, // 开启页面测速\n });\n },\n currentConversationID(event) {\n this.setData({\n isShowConversation: true,\n isShowConversationList: false,\n currentConversationID: event.detail.currentConversationID,\n unreadCount: event.detail.unreadCount,\n }, () => {\n const TUIChat = this.selectComponent('#TUIChat');\n TUIChat.init();\n });\n },\n showConversationList() {\n this.setData({\n isShowConversation: false,\n isShowConversationList: true,\n }, () => {\n const TUIConversation = this.selectComponent('#TUIConversation');\n TUIConversation.init();\n });\n },\n handleCall(event) {\n if (event.detail.groupID) {\n this.TUICallKit.groupCall(event.detail);\n } else {\n this.TUICallKit.call(event.detail);\n }\n },\n sendMessage(event) {\n this.selectComponent('#TUIChat').sendMessage(event);\n },\n },\n});\n","const constant = {\n FEAT_NATIVE_CODE: {\n NATIVE_VERSION: 1,\n ISTYPING_STATUS: 1,\n NOTTYPING_STATUS: 1,\n ISTYPING_ACTION: 14,\n NOTTYPING_ACTION: 0,\n FEAT_TYPING: 1\n },\n TYPE_INPUT_STATUS_ING: 'EIMAMSG_InputStatus_Ing',\n TYPE_INPUT_STATUS_END: 'EIMAMSG_InputStatus_End',\n MESSAGE_TYPE_TEXT: {\n TIM_CUSTOM_ELEM: 'TIMCustomElem',\n },\n BUSINESS_ID_TEXT: {\n USER_TYPING: 'user_typing_status',\n EVALUATION: 'evaluation',\n ORDER: 'order',\n LINK: 'text_link',\n CREATE_GROUP: 'group_create',\n CONSULTION: 'consultion',\n },\n\n STRING_TEXT: {\n TYPETYPING: '对方正在输入...',\n TYPETEXT: '对本次服务的评价',\n },\n MESSAGE_ERROR_CODE: {\n DIRTY_WORDS: 80001,\n UPLOAD_FAIL: 6008,\n REQUESTOR_TIME: 2081,\n DISCONNECT_NETWORK: 2800,\n DIRTY_MEDIA: 80004,\n UNUPLOADED_PICTURE: 2040,\n UNUPLOADED_MEDIA: 2350,\n BLACKLIST_MEMBER: 20007,\n NOT_GROUP_MEMBER: 10007\n },\n TOAST_TITLE_TEXT: {\n DIRTY_WORDS: '您发送的消息包含违禁词汇!',\n UPLOAD_FAIL: '文件上传失败!',\n CONNECT_ERROR: '网络已断开',\n DIRTY_MEDIA: '您发送的消息包含违禁内容!',\n RESEND_SUCCESS: '重发成功',\n UNUPLOADED_PICTURE: '上传图片失败,请检查您是否未注册上传插件',\n UNUPLOADED_MEDIA: '上传视频失败,请检查您是否未注册上传插件',\n BLACKLIST_MEMBER: '您已被拉黑,无法对此人发送信息!',\n NOT_GROUP_MEMBER: '您已不在此群组中!'\n },\n\n OPERATING_ENVIRONMENT: 'imWxTuikit'\n};\n\n\nif (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });exports.default = constant;\n"]} \ No newline at end of file diff --git a/miniprogram_npm/@tencentcloud/chat/index.js b/miniprogram_npm/@tencentcloud/chat/index.js new file mode 100644 index 0000000..3824c5b --- /dev/null +++ b/miniprogram_npm/@tencentcloud/chat/index.js @@ -0,0 +1,14 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242895, function(require, module, exports) { +!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()}(this,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}function f(e){var t=l();return function(){var n,o=c(e);if(t){var a=c(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return h(this,n)}}function v(e,t){return M(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var o,a,i=[],s=!0,r=!1;try{for(n=n.call(e);!(s=(o=n.next()).done)&&(i.push(o.value),!t||i.length!==t);s=!0);}catch(c){r=!0,a=c}finally{try{s||null==n.return||n.return()}finally{if(r)throw a}}return i}(e,t)||y(e,t)||C()}function m(e){return function(e){if(Array.isArray(e))return T(e)}(e)||I(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e){if(Array.isArray(e))return e}function I(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function y(e,t){if(e){if("string"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}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 i,s=!0,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){r=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(r)throw i}}}}var E={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",ROOM_CUSTOM_DATA_RECEIVED:"onRoomCustomDataReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",MESSAGE_REACTIONS_UPDATED:"onMessageReactionsUpdated",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange"},S={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},N={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},k=function(){function e(){o(this,e),this.cache=[],this.options=null}return i(e,[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),e}(),A=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n}return i(e,[{key:"equal",value:function(e){return null!==e&&(this.low===e.low&&this.high===e.high)}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),e}(),L={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:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com",ANYCAST:"wss://162.14.19.159"},KOREA:{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:{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:{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:{DEFAULT:"wss://wssjpn.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT:"wss://wssusa.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com",ANYCAST:"wss://162.14.10.42"},INDONESIA:{DEFAULT:"wss://wssidn.im.qcloud.com",BACKUP:"wss://wssidn.my-imcloud.com",STAT:"https://apiidn.my-imcloud.com",ANYCAST:"wss://43.129.34.169"}}},R={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},O="1.7.3",G=537048168,P="CHINA",U="OVERSEA",b="SINGAPORE",w="KOREA",F="GERMANY",q="IND",x="JPN",V="USA",H="INDONESIA",B={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;this.CURRENT=L.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GROUP:"group_open_http_svc",GROUP_AVCHATROOM:"group_open_avchatroom_http_svc",GROUP_COMMUNITY:"million_group_open_http_svc",GROUP_ATTR:"group_open_attr_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP_NO_AUTH:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_svc",BIG_GROUP_LONG_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MESSAGE:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate",IM_OPEN_SPEECH:"im_open_speech",MESSAGE_SEARCH:"message_search"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v4",group_open_long_polling_http_svc:"v4",group_open_long_polling_http_noauth_svc:"v4",imopenstat:"v4",im_cos_sign_svr:"v4",im_cos_msg:"v4",webim:"v4",im_open_push:"v4",im_open_status:"v4"}},K={SEARCH_MSG:new A(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new A(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new A(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new A(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new A(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new A(0,Math.pow(2,6)).toString(),USER_STATUS:new A(0,Math.pow(2,7)).toString(),CONV_MARK:new A(0,Math.pow(2,9)).toString(),CONV_GROUP:new A(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new A(0,Math.pow(2,11)).toString(),MSG_EXT:new A(0,Math.pow(2,13)).toString(),GRP_COUNTER:new A(0,Math.pow(2,15)).toString(),MSG_REACTION:new A(Math.pow(2,16)).toString()},Y="c2c_text_message",W="c2c_custom_message",j="group_text_message",J="group_custom_message",z="user_profile",X="sns",Q="group_profile",Z="group_member_profile";B.HOST.setCurrent(P);var $="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),ee=$&&"function"==typeof wx.createGamePortal,te="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),ne="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),oe="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),ae="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),ie="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,se="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,re="undefined"!=typeof uni,ce=$||te||ne||oe||ae||se||ie,ue=("undefined"!=typeof uni||"undefined"!=typeof window)&&!ce,le=te?qq:ne?tt:oe?swan:ae?my:$?wx:se?uni:ie?jd:{},de=ue&&window&&window.navigator&&window.navigator.userAgent||"",pe=/(micromessenger|webbrowser)/i.test(de),_e=/AppleWebKit\/([\d.]+)/i.exec(de);_e&&parseFloat(_e.pop());var ge,he,fe=(ge="WEB",pe?ge="WEB":te?ge="QQ_MP":ne?ge="TT_MP":oe?ge="BAIDU_MP":ae?ge="ALI_MP":$?ge="WX_MP":se&&(ge="UNI_NATIVE_APP"),R[ge]),ve=/iPad/i.test(de),me=/iPhone/i.test(de)&&!ve,Me=/iPod/i.test(de),Ie=me||ve||Me,ye=(he=de.match(/OS (\d+)_/i))&&he[1]?he[1]:null,Te=/Android/i.test(de),Ce=function(){var e=de.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}(),De=/Edge/i.test(de),Ee=!De&&/Chrome/i.test(de);!function(){var e=de.match(/Chrome\/(\d+)/);e&&e[1]&&parseFloat(e[1])}();var Se=/MSIE/.test(de)||de.indexOf("Trident")>-1&&de.indexOf("rv:11.0")>-1,Ne=function(){var e=/MSIE\s(\d+)\.\d/.exec(de),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(de)&&/rv:11.0/.test(de)&&(t=11),t}(),ke=/Safari/i.test(de)&&!Ee&&!Te&&!De;!function(){var e=de.match(/TBS\/(\d+)/i);if(e&&e[1])e[1]}();var Ae,Le,Re=/Windows/i.test(de),Oe=/MAC OS X/i.test(de),Ge=ue&&"undefined"!=typeof Worker&&!Se,Pe=Te||Ie,Ue=ue&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy,be=function(){if("undefined"==typeof window)return!1;var e=window.navigator.standalone;return!(!Ie||e||ke)}();Ae="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var we=function(){},Fe=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],qe=Fe.length;qe--;)Le=Fe[qe],console[Le]||(Ae[Le]=we);var xe=Ae,Ve=0,He=function(){return(new Date).getTime()+Ve},Be=function(){Ve=0},Ke=function(){return Math.floor(He()/1e3)},Ye=0;function We(){return on()?"%c Chat %c":"Chat"}function je(){var e,t=((e=new Date).setTime(He()),e);return t.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){var t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(t.getMilliseconds())}var Je={arguments2String:function(e){var t="";if(1===e.length)t=e[0];else for(var n=0,o=e.length;n=0?o[i]=t[i]:o[i]=e(t[i])):o[i]=void 0:o[i]=null;return o};function Ut(e,t){if(!vt(e)||!vt(t))return!1;var n=!1;return t.forEach((function(t){var o=t.key,a=t.value,i=e.find((function(e){return e.key===o}));i?i.value!==a&&(i.value=a,n=!0):(e.push({key:o,value:a}),n=!0)})),n}var bt=function(e){return e===S.GRP_AVCHATROOM},wt=function(e){var t=e.type,n=e.groupID;return t===S.GRP_COMMUNITY||"".concat(n).startsWith(ct)&&!"".concat(n).includes(ut)},Ft=function(e){return"".concat(e).startsWith(ct)&&"".concat(e).includes(ut)},qt=function(e){return gt(e)&&e.slice(0,3)===S.CONV_C2C},xt=function(e){return gt(e)&&e.slice(0,5)===S.CONV_GROUP},Vt=function(e){return gt(e)&&e===S.CONV_SYSTEM};function Ht(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function Bt(e){return ce?new Promise((function(t,n){le.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):Se&&9===Ne?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Kt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function Yt(){var e="unknown";if(Oe&&(e="mac"),Re&&(e="windows"),Ie&&(e="ios"),Te&&(e="android"),ce)try{var t=le.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(n){}return e}function Wt(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengthi)return 1;if(a-1?"".concat(n,"&"):"".concat(n,"?");u.url="".concat(l,198===s?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")}return mt(n)?(u.url,_(u,lt)):u}function Jt(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n=0;o--)"1"===e[o]&&t.push(Math.pow(2,n-o-1));return t}function on(){return!Se&&!ce}function an(e){return"the length of userIDList cannot exceed ".concat(e)}function sn(e,t){if(e){var n=e;return t&&(e.startsWith("http://")?n=e.replace(/^http:\/\/[^/]+/,t):e.startsWith("https://")&&(n=e.replace(/^https:\/\/[^/]+/,t))),n}}function rn(e){if(vt(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),t.toFixed(0)}}function cn(e){if(vt(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),(t/e.length).toFixed(0)}}function un(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=Date.now();return t?n?"".concat(o-e," ms"):"".concat(Math.round((o-e)/1e3)," s"):n?o-e:Math.round((o-e)/1e3)}function ln(e){var t=!1;return e&&e>1&&(t=!0),t}var dn=Object.prototype.hasOwnProperty;function pn(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(ft(e)){for(var t in e)if(dn.call(e,t))return!1;return!0}return!(!dt(e)&&(n=e,"set"!==Ct(n))&&!pt(e))&&0===e.size;var n}function _n(e,t,n){if(void 0===t)return!0;var o=!0;if(ft(t))Object.keys(t).forEach((function(a){var i=1===e.length?e[0][a]:void 0;o=!!gn(i,t[a],n,a)&&o}));else if(vt(t))for(var a=0;a256)||(Mn({api:t,paramName:n,desc:Ln(n,256)}),!1):(Mn({api:t,paramName:n,desc:In()}),!1)}}},markConversation:{conversationIDList:t({},Bn),markType:{type:"number",validator:function(e,t,n){return _t(e)?e<=0?(Mn({api:t,paramName:n,desc:(o=n,a=0,jn("NumberGreaterThanLog",o,a))}),!1):!(e>=Math.pow(2,64))||(Mn({api:t,paramName:n,desc:Rn(n,"Math.pow(2,64)")}),!1):(Mn({api:t,paramName:n,desc:Tn()}),!1);var o,a}},enableMark:t({},Yn)},createConversationGroup:{conversationIDList:t({},Bn),groupName:t(t({},Hn),{},{validator:function(e,t,n){return!!e&&(!(e.length>32)||(Mn({api:t,paramName:n,desc:Ln(n,32)}),!1))}})},deleteConversationGroup:[t({name:"groupName"},Hn)],renameConversationGroup:{oldName:t({},Hn),newName:t(t({},Hn),{},{validator:function(e,t,n){return!!e&&(!(e.length>32)||(Mn({api:t,paramName:n,desc:Ln(n,32)}),!1))}})},addConversationsToGroup:{conversationIDList:t({},Bn),groupName:t({},Hn)},deleteConversationsFromGroup:{conversationIDList:t({},Bn),groupName:t({},Hn)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:Hn,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Bn},createGroup:{name:Hn},joinGroup:{groupID:Hn,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[t({name:"groupID"},Hn)],handleApplication:{message:Kn,handleAction:Hn,handleMessage:{type:"String"}},changeGroupOwner:{groupID:Hn,newOwnerID:Hn},updateGroupProfile:{groupID:Hn,muteAllMembers:{type:"Boolean"}},dismissGroup:[t({name:"groupID"},Hn)],searchGroupByID:[t({name:"groupID"},Hn)],getGroupOnlineMemberCount:[t({name:"groupID"},Hn)],initGroupAttributes:{groupID:Hn,groupAttributes:t(t({},Kn),{},{validator:function(e,t,n){var o=!0;return Object.keys(e).forEach((function(a){if(!gt(e[a]))return Mn({api:t,paramName:n,desc:Gn("value")}),o=!1})),o}})},setGroupAttributes:{groupID:Hn,groupAttributes:t(t({},Kn),{},{validator:function(e,t,n){var o=!0;return Object.keys(e).forEach((function(a){if(!gt(e[a]))return Mn({api:t,paramName:n,desc:Gn("value")}),o=!1})),o}})},deleteGroupAttributes:{groupID:Hn,keyList:{type:"Array",validator:function(e,t,n){if(mt(e)||!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;if(!pn(e)){var o=!0;return e.forEach((function(e){if(!gt(e))return Mn({api:t,paramName:n,desc:jn("StringArrayRequiredLog")}),o=!1})),o}return!0}}},getGroupAttributes:{groupID:Hn,keyList:{type:"Array",validator:function(e,t,n){if(mt(e)||!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;if(!pn(e)){var o=!0;return e.forEach((function(e){if(!gt(e))return Mn({api:t,paramName:n,desc:Gn("key")}),o=!1})),o}return!0}}},setGroupCounters:{groupID:Hn,counters:Kn},increaseGroupCounter:{groupID:Hn,key:Hn,value:Wn},decreaseGroupCounter:{groupID:Hn,key:Hn,value:Wn},getGroupCounters:{groupID:Hn},getGroupMemberList:{groupID:Hn,count:{type:"Number"}},getGroupMemberProfile:{groupID:Hn,userIDList:Bn,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:Hn,userIDList:Bn},setGroupMemberRole:{groupID:Hn,userID:Hn,role:Hn},setGroupMemberMuteTime:{groupID:Hn,userID:Hn,muteTime:{type:"Number",validator:function(e){return e>=0}}},setGroupMemberNameCard:{groupID:Hn,userID:{type:"String"},nameCard:{type:"String",validator:function(e,t,n){return gt(e)?(e.length,!0):(Mn({api:t,paramName:n,desc:In()}),!1)}}},setGroupMemberCustomField:{groupID:Hn,userID:{type:"String"},memberCustomField:Bn},deleteGroupMember:{groupID:Hn},markGroupMemberList:{groupID:Hn,markType:{type:"number",validator:function(e,t,n){return _t(e)?!(e<1e3)||(Mn({api:t,paramName:n,desc:On(n,1e3)}),!1):(Mn({api:t,paramName:n,desc:Tn()}),!1)}},userIDList:t({},Bn),enableMark:t({},Yn)},createTextMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.text)?0!==e.text.length||(Mn({api:t,paramName:"payload.text",desc:Un()}),!1):(Mn({api:t,paramName:"payload.text",desc:In()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createTextAtMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.text)?0===e.text.length?(Mn({api:t,paramName:"payload.text",desc:Un()}),!1):!(e.atUserList&&!vt(e.atUserList))||(Mn({api:t,paramName:"payload.atUserList",desc:Sn()}),!1):(Mn({api:t,paramName:"payload.text",desc:In()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createCustomMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?e.data&&!gt(e.data)?(Mn({api:t,paramName:"payload.data",desc:In()}),!1):e.description&&!gt(e.description)?(Mn({api:t,paramName:"payload.description",desc:In()}),!1):!(e.extension&&!gt(e.extension))||(Mn({api:t,paramName:"payload.extension",desc:In()}),!1):(Mn({api:t,paramName:"payload",desc:Pn()}),!1)}})},createImageMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(!ft(e))return Mn({api:t,paramName:n,desc:Pn()}),!1;if(mt(e.file))return Mn({api:t,paramName:"payload.file",desc:Cn()}),!1;if(ue){if(!(e.file instanceof HTMLInputElement||pt(e.file)))return ft(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Mn({api:t,paramName:"payload.file",desc:bn()}),!1):(Mn({api:t,paramName:"payload.file",desc:Dn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Mn({api:t,paramName:"payload.file",desc:bn()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}})},createAudioMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return!!ft(e)||(Mn({api:t,paramName:n,desc:Pn()}),!1)}}),onProgress:{type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}},createVideoMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(!ft(e))return Mn({api:t,paramName:n,desc:Pn()}),!1;if(mt(e.file))return Mn({api:t,paramName:"payload.file",desc:Cn()}),!1;if(ue){if(!(e.file instanceof HTMLInputElement||pt(e.file)))return ft(e.file)&&"undefined"!=typeof uni?!!pt(e.file.tempFile)||(Mn({api:t,paramName:"payload.file",desc:bn()}),!1):(Mn({api:t,paramName:"payload.file",desc:Dn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Mn({api:t,paramName:"payload.file",desc:bn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}},createFaceMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?_t(e.index)?!!gt(e.data)||(Mn({api:t,paramName:"payload.data",desc:In()}),!1):(Mn({api:t,paramName:"payload.index",desc:Tn()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createFileMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(!ft(e))return Mn({api:t,paramName:n,desc:Pn()}),!1;if(mt(e.file))return Mn({api:t,paramName:"payload.file",desc:Cn()}),!1;if(ue){if(!(e.file instanceof HTMLInputElement||pt(e.file)))return ft(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Mn({api:t,paramName:"payload.file",desc:bn()}),!1):(Mn({api:t,paramName:"payload.file",desc:Dn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Mn({api:t,paramName:"payload.file",desc:bn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}},createLocationMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.description)?_t(e.longitude)?!!_t(e.latitude)||(Mn({api:t,paramName:"payload.latitude",desc:Tn()}),!1):(Mn({api:t,paramName:"payload.longitude",desc:Tn()}),!1):(Mn({api:t,paramName:"payload.description",desc:In()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createMergerMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(pn(e.messageList))return Mn({api:t,paramName:"payload.messageList",desc:Nn()}),!1;if(pn(e.compatibleText))return Mn({api:t,paramName:"payload.compatibleText",desc:yn("compatibleText")}),!1;var o=!1;return e.messageList.forEach((function(e){e.status===fn.FAIL&&(o=!0)})),!o||(Mn({api:t,paramName:"payload.messageList",desc:jn("MergeFailedMessageLog")}),!1)}})},revokeMessage:[t(t({name:"message"},Kn),{},{validator:function(e,t,n){return pn(e)?(Mn({api:t,paramName:n,desc:wn()}),!1):e.conversationType===S.CONV_SYSTEM?(Mn({api:t,paramName:n,desc:jn("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(Mn({api:t,paramName:n,desc:jn("MessageRevokedLog")}),!1)}})],deleteMessage:[t(t({name:"messageList"},Bn),{},{validator:function(e,t,n){return!pn(e)||(Mn({api:t,paramName:n,desc:Nn()}),!1)}})],translateText:{sourceTextList:Bn,sourceLanguage:Hn,targetLanguage:Hn},convertVoiceToText:{message:t(t({},Kn),{},{validator:function(e,t,n){return pn(e)?(Mn({api:t,paramName:n,desc:wn()}),!1):e.type===S.MSG_AUDIO&&e.status===fn.SUCCESS||(Mn({api:t,paramName:n,desc:jn("AudioMessageRequiredLog")}),!1)}})},modifyMessage:[t(t({name:"message"},Kn),{},{validator:function(e,t,n){return pn(e)?(Mn({api:t,paramName:n,desc:wn()}),!1):e.conversationType===S.CONV_SYSTEM?(Mn({api:t,paramName:n,desc:jn("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(Mn({api:t,paramName:n,desc:jn("OnlineMessageNotSupportLog")}),!1)}})],searchCloudMessages:{keywordList:{type:"Array",required:!1,validator:function(e,t,n){return!e||(vt(e)?0===e.length?(Mn({api:t,paramName:n,desc:Nn()}),!1):!(e.length>5)||(Mn({api:t,paramName:n,desc:Vn(n,5)}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1))}},keywordListMatchType:{type:"String",required:!1,validator:function(e,t,n){return!e||("or"===e||"and"===e||Mn({api:t,paramName:n,desc:"".concat(e," is invalid match type")}))}},senderUserIDList:{type:"Array",required:!1,validator:function(e,t,n){return!e||(vt(e)?(0===e.length&&Mn({api:t,paramName:n,desc:Nn()}),!(e.length>5)||(Mn({api:t,paramName:n,desc:Vn(n,5)}),!1)):(Mn({api:t,paramName:n,desc:Sn()}),!1))}},messageTypeList:{type:"Array",required:!1,validator:function(e,t,n){if(!e)return!0;if(!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;0===e.length&&Mn({api:t,paramName:n,desc:Nn()});var o,a=[S.MSG_TEXT,S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_FILE,S.MSG_VIDEO,S.MSG_LOCATION,S.MSG_CUSTOM,S.MSG_MERGER];return!(e.filter((function(e){return-1===a.indexOf(e)})).length>0)||(Mn({api:t,paramName:n,desc:(o=n,jn("ContainsUnsupportedMessageTypeLog",o))}),!1)}},conversationID:{type:"String",required:!1,validator:function(e){return!e||mn(e)}},timePosition:{type:"number",required:!1,validator:function(e,t,n){return!e||(!(e<0)||(Mn({api:t,paramName:n,desc:On(n,0)}),!1))}},timePeriod:{type:"number",required:!1,validator:function(e,t,n){return!e||(!(e<0)||(Mn({api:t,paramName:n,desc:On(n,0)}),!1))}},cursor:{type:"String",required:!1}},getUserProfile:{userIDList:{type:"Array",validator:function(e,t,n){return vt(e)?(0===e.length&&Mn({api:t,paramName:n,desc:Nn()}),!0):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(e,t,n){return!!mt(e)||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},setSelfStatus:{customStatus:{type:"String",validator:function(e,t,n){return!!gt(e)||(Mn({api:t,paramName:n,desc:In()}),!1)}}},getUserStatus:{userIDList:{type:"Array",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(e,t,n){return!e||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},addFriend:{to:Hn,source:{type:"String",required:!0,validator:function(e,t,n){return!!e&&(e.startsWith("AddSource_Type_")?!(e.replace("AddSource_Type_","").length>8)||(Mn({api:t,paramName:n,desc:Ln("keyword",8)}),!1):(Mn({api:t,paramName:n,desc:jn("SourcePrefixLog")}),!1))}},remark:{type:"String",required:!1,validator:function(e,t,n){return!(gt(e)&&e.length>96)||(Mn({api:t,paramName:n,desc:Ln(n,96)}),!1)}}},deleteFriend:{userIDList:Bn},checkFriend:{userIDList:Bn},getFriendProfile:{userIDList:Bn},updateFriend:{userID:Hn,remark:{type:"String",required:!1,validator:function(e,t,n){return!(gt(e)&&e.length>96)||(Mn({api:t,paramName:n,desc:Ln(n,96)}),!1)}},friendCustomField:{type:"Array",required:!1,validator:function(e,t,n){if(e){if(!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;var o=!0;return e.forEach((function(e){return gt(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")?gt(e.value)?e.key.replace("Tag_SNS_Custom_","").length>8?(Mn({api:t,paramName:n,desc:Ln("keyword",8)}),o=!1):void 0:(Mn({api:t,paramName:n,desc:Gn("value")}),o=!1):(Mn({api:t,paramName:n,desc:jn("FriendCustomFieldPrefixLog")}),o=!1)})),o}return!0}}},acceptFriendApplication:{userID:Hn},refuseFriendApplication:{userID:Hn},deleteFriendApplication:{userID:Hn},createFriendGroup:{name:Hn},deleteFriendGroup:{name:Hn},addToFriendGroup:{name:Hn,userIDList:Bn},removeFromFriendGroup:{name:Hn,userIDList:Bn},renameFriendGroup:{oldName:Hn,newName:Hn},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}],createTopicInCommunity:{groupID:Hn,topicName:Hn},deleteTopicFromCommunity:{groupID:Hn,topicIDList:{type:"Array",validator:function(e,t,n){return!e||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},updateTopicProfile:{groupID:Hn,topicID:Hn},getTopicList:{groupID:Hn,topicIDList:{type:"Array",validator:function(e,t,n){return!e||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},addSignalingListener:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Mn({api:t,paramName:n,desc:yn(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Mn({api:t,paramName:n,desc:En()}),!1):(""===e.name&&Mn({api:t,paramName:n,desc:Fn()}),!0)}}],removeSignalingListener:[{name:"eventName",type:"String",validator:function(e,t,n){return"string"==typeof e&&0!==e.length||(Mn({api:t,paramName:n,desc:yn(n)}),!1)}},{name:"handler",type:"Function",validator:function(e,t,n){return"function"!=typeof e?(Mn({api:t,paramName:n,desc:En()}),!1):(""===e.name&&Mn({api:t,paramName:n,desc:Fn()}),!0)}}],invite:{userID:Hn},inviteSync:[t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?!!gt(e.userID)||(Mn({api:t,paramName:"options.userID",desc:In()}),!1):(Mn({api:t,paramName:"options",desc:Pn()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}}],inviteInGroup:{groupID:Hn,inviteeList:Bn},inviteInGroupSync:[t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.groupID)?!!vt(e.inviteeList)||(Mn({api:t,paramName:"options.inviteeList",desc:Sn()}),!1):(Mn({api:t,paramName:"options.groupID",desc:In()}),!1):(Mn({api:t,paramName:"options",desc:Pn()}),!1)}}),{name:"successCb",type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}},{name:"errorCb",type:"Function",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}}],accept:{inviteID:Hn},reject:{inviteID:Hn},getSignalingInfo:[t(t({name:"message"},Kn),{},{validator:function(e,t,n){return!pn(e)||(Mn({api:t,paramName:n,desc:wn()}),!1)}})],modifyInvitation:{inviteID:Hn,data:Hn}},zn={login:1,logout:1,getLoginUser: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,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},Xn=1,Qn=2,Zn=3,$n=4,eo=6,to=7,no=8,oo=10,ao=11,io=12,so=13,ro=14,co=15,uo=17,lo=18,po=19,_o=20,go=21,ho=23,fo=24,vo=25,mo=26,Mo=27,Io=28,yo=29,To=30,Co=31,Do=32,Eo=33,So=34,No=function(e){return{code:0,data:e||{}}},ko=function(e){r(n,e);var t=f(n);function n(e){var a;o(this,n),a=t.call(this);var i=e.code,s=e.message,r=e.data;return a.code=i,a.message=s||a._getErrorMessage(a.code),a.data=r||{},a}return i(n)}(p(Error)),Ao={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_AVCHATROOM:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_FUNCTION_ERROR: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_AVCHATROOM:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_WORK:2622,MEMBER_NOT_IN_GRP:2623,JOIN_GRP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,OPERATION_NOT_SUPPORTED_IN_AVCHATROOM: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,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_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,CANNOT_USE_COMMERCIAL_ABILITY: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},Lo=null,Ro=function(e){Lo=e},Oo=function(e){return Promise.resolve(No(e))},Go=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof ko)return t&&null!==Lo&&Lo.emit(E.ERROR,e),Promise.reject(e);if(e instanceof Error){var n=new ko({code:Ao.UNCAUGHT_ERROR});return t&&null!==Lo&&Lo.emit(E.ERROR,n),Promise.reject(n)}if(mt(e)||mt(e.code))return Promise.reject(new ko({code:Ao.UNCAUGHT_ERROR}));var o=new ko(e);return t&&null!==Lo&&Lo.emit(E.ERROR,o),Promise.reject(o)},Po=function(){function e(t){o(this,e),this._m=t,this._n=""}return i(e,[{key:"isLoggedIn",value:function(){return this._m.getModule(io).isLoggedIn()}},{key:"isOversea",value:function(){return this._m.getModule(io).isOversea()}},{key:"isPrivateNetWork",value:function(){return this._m.getModule(io).isPrivateNetWork()}},{key:"getFileDownloadProxy",value:function(){return this._m.getModule(io).getFileDownloadProxy()}},{key:"getMyUserID",value:function(){return this._m.getModule(io).getUserID()}},{key:"getMyTinyID",value:function(){return this._m.getModule(io).getTinyID()}},{key:"getSDKAppID",value:function(){return this._m.getModule(io).getSDKAppID()}},{key:"isIntl",value:function(){return this._m.getModule(io).isIntl()}},{key:"isUsingChatCore",value:function(){return this._m.getModule(io).isUsingChatCore()}},{key:"isDevMode",value:function(){return this._m.getModule(io).isDevMode()}},{key:"getModule",value:function(e){return this._m.getModule(e)}},{key:"getPlatform",value:function(){return fe}},{key:"getNetworkType",value:function(){return this._m.getModule(co).getNetworkType()}},{key:"probeNetwork",value:function(e){return this._m.getModule(co).probe(e)}},{key:"getCloudConfig",value:function(e){return this._m.getModule(ho).getCloudConfig(e)}},{key:"emitOuterEvent",value:function(e,t){this._m.getOuterEmitterInstance().emit(e,t)}},{key:"emitInnerEvent",value:function(e,t){this._m.getInnerEmitterInstance().emit(e,t)}},{key:"getInnerEmitterInstance",value:function(){return this._m.getInnerEmitterInstance()}},{key:"generateTjgID",value:function(e){return this._m.getModule(io).getTinyID()+"-"+e.random}},{key:"filterModifiedMessage",value:function(e){if(!pn(e)){var t=e.filter((function(e){return!0===e.isModified}));t.length>0&&this.emitOuterEvent(E.MESSAGE_MODIFIED,t)}}},{key:"filterUnmodifiedMessage",value:function(e){return pn(e)?[]:e.filter((function(e){return!1===e.isModified}))}},{key:"request",value:function(e){return this._m.getModule(_o).request(e)}},{key:"canIUse",value:function(e){return this._m.getModule(Mo).canIUse(e)}},{key:"getErrorMessage",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:"outputWarning",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&Je.w(o)}},{key:"cannotUseCommercialAbility",value:function(e){var t=Ao.CANNOT_USE_COMMERCIAL_ABILITY;return Go({code:t,message:this.getErrorMessage(t,e)})}}]),e}(),Uo={LOGIN:"wslogin",LOGOUT:"wslogout",HELLO:"wshello",KICK_OTHER:"KickOther",SYNC_UNREAD_MESSAGE:"getmsg",SEND_C2C_MESSAGE:"sendmsg",SEND_GROUP_MESSAGE:"send_group_msg",GET_USER_PROFILE:"portrait_get_all",UPDATE_MY_PROFILE:"portrait_set",GET_BLACKLIST:"black_list_get",ADD_TO_BLACKLIST:"black_list_add",REMOVE_FROM_BLACKLIST:"black_list_delete",GET_FRIEND_LIST:"friend_get",GET_FRIEND_PROFILE:"friend_get_specified",CHECK_FRIEND:"friend_check",DELETE_FRIEND:"friend_delete",ADD_FRIEND:"friend_add",UPDATE_FRIEND:"friend_update",RESPOND_FRIEND_APPLICATION:"friend_response",GET_FRIEND_APPLICATION_LIST:"pendency_get",DELETE_FRIEND_APPLICATION:"pendency_delete",REFUSE_FRIEND_APPLICATION:"pendency_refuse",REPORT_FRIEND_APPLICATION:"pendency_report",GET_FRIEND_GROUP_LIST:"group_get",CREATE_FRIEND_GROUP:"group_add",DELETE_FRIEND_GROUP:"group_delete",UPDATE_FRIEND_GROUP:"group_update",REVOKE_C2C_MESSAGE:"msgwithdraw",SET_C2C_MESSAGE_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_MESSAGE:"getroammsg",GET_C2C_PEER_READ_TIME:"get_peer_read_time",DELETE_C2C_MESSAGE:"delete_c2c_msg_ramble",MODIFY_C2C_MESSAGE:"modify_c2c_msg",MODIFY_C2C_MESSAGE_EXTENSIONS:"set_key_values",GET_C2C_MESSAGE_EXTENSIONS:"get_key_values",ADD_C2C_MSG_REACTION:"reaction_add",REMOVE_C2C_MSG_REACTION:"reaction_del",GET_C2C_MSG_REACTIONS:"reaction_multi_stat",GET_C2C_MSG_REACTION_USER_LIST:"reaction_iterate",PAGING_GET_CONVERSATION_LIST:"page_get",DELETE_CONVERSATION:"batch_delete",CLEAR_HISTORY_MESSAGE:"clear_msg",PIN_CONVERSATION:"top",DELETE_GROUP_AT_TIPS:"deletemsg",SET_CONVERSATION_CUSTOM_DATA:"set_conv_custom_data",MARK_CONVERSATION:"mark_contact",CREATE_CONVERSATION_GROUP:"create_contact_group",DELETE_CONVERSATION_GROUP:"del_contact_group",RENAME_CONVERSATION_GROUP:"update_contact_group",ADD_CONVERSATIONS_TO_GROUP:"add_conv_to_group",DELETE_CONVERSATIONS_FROM_GROUP:"del_conv_from_group",GET_CONVERSATION_GROUP_LIST:"get_contact_group",GET_GROUP_LIST:"get_joined_group_list",GET_GROUP_PROFILE:"get_group_self_member_info",CREATE_GROUP:"create_group",DISMISS_GROUP:"destroy_group",UPDATE_GROUP_PROFILE:"modify_group_base_info",APPLY_JOIN_GROUP:"apply_join_group",APPLY_JOIN_GROUP_NOAUTH:"apply_join_group_noauth",QUIT_GROUP:"quit_group",SEARCH_GROUP:"get_group_public_info",CHANGE_GROUP_OWNER:"change_group_owner",HANDLE_GROUP_APPLICATION:"handle_apply_join_group",HANDLE_INVITE_JOIN_GROUP:"handle_invite_join_permission_group",HANDLE_GROUP_INVITATION:"handle_invite_join_group",REVOKE_GROUP_MESSAGE:"group_msg_recall",SET_GROUP_MESSAGE_READ:"msg_read_report",SET_ALL_MESSAGE_READ:"read_all_unread_msg",GET_GROUP_ROAMING_MESSAGE:"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_GROUP_PENDENCY:"get_pendency",DELETE_GROUP_SYSTEM_NOTICE:"deletemsg",AVCHATROOM_POLLING:"get_msg",AVCHATROOM_NOAUTH_POLLING:"get_msg_noauth",GET_ONLINE_MEMBER_NUM:"get_online_member_num",DELETE_GROUP_MESSAGE:"delete_group_ramble_msg_by_seq",MODIFY_GROUP_MESSAGE:"modify_group_msg",SET_GROUP_ATTRIBUTES:"set_group_attr",MODIFY_GROUP_ATTRIBUTES:"modify_group_attr",DELETE_GROUP_ATTRIBUTES:"delete_group_attr",CLEAR_GROUP_ATTRIBUTES:"clear_group_attr",GET_GROUP_ATTRIBUTES:"get_group_attr",MODIFY_GROUP_MESSAGE_EXTENSIONS:"group_set_key_values",GET_GROUP_MESSAGE_EXTENSIONS:"group_get_key_values",GET_GROUP_NOTIFY:"batch_get_group_notify",UPDATE_GROUP_COUNTER:"update_group_counter",GET_GROUP_COUNTER:"get_group_counter",ADD_GRP_MSG_REACTION:"group_reaction_add",REMOVE_GRP_MSG_REACTION:"group_reaction_del",GET_GRP_MSG_REACTIONS:"group_reaction_multi_stat",GET_GRP_MSG_REACTION_USER_LIST:"group_reaction_iterate",GET_GROUP_MEMBER_LIST:"get_group_member_info",GET_AVCHATROOM_MEMBER_LIST:"get_members",GET_GROUP_MEMBER_PROFILE:"get_specified_group_member_info",ADD_GROUP_MEMBER:"add_group_member",DELETE_GROUP_MEMBER:"delete_group_member",BAN_AVCHATROOM_MEMBER:"ban_group_member",MODIFY_GROUP_MEMBER_INFO:"modify_group_member_info",MARK_AVCHATROOM_MEMBER_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",MESSAGE_PUSH:"msg_push",MESSAGE_CLOUD_SEARCH:"query",MULTI_MESSAGE_PUSH:"multi_msg_push_ws",MESSAGE_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",UPLOAD_MERGER_MESSAGE:"save_relay_json_msg",DOWNLOAD_MERGER_MESSAGE:"get_relay_json_msg",FETCH_CLOUD_CONTROL_CONFIG:"fetch_config",PUSHED_CLOUD_CONTROL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",OVERLOAD_NOTIFY:"notify2",CREATE_TOPIC:"create_topic",DELETE_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUBSCRIBE_USER_STATUS:"ws_status_subscribe",UNSUBSCRIBE_USER_STATUS:"ws_status_unsubscribe",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",GET_PROFANITY_LIST:"get_local_words",TRANSLATE_TEXT:"ws_batch_trans_text",VOICE_TO_TEXT:"ws_sentence_recognition"},bo="networkRTT",wo="messageE2EDelay",Fo="sendMessageC2C",qo="sendMessageGroup",xo="sendMessageGroupAV",Vo="sendMessageRichMedia",Ho="cosUpload",Bo="messageReceivedGroup",Ko="messageReceivedGroupAVPush",Yo="messageReceivedGroupAVPull",Wo=(s(hn={},bo,2),s(hn,wo,3),s(hn,Fo,4),s(hn,qo,5),s(hn,xo,6),s(hn,Vo,7),s(hn,Bo,8),s(hn,Ko,9),s(hn,Yo,10),s(hn,Ho,11),hn),jo={info:4,warning:5,error:6},Jo={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},zo={login:4},Xo=function(){function e(t){o(this,e),this._n="SSOLogData",this.eventType=zo[t]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=t,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=He()}return i(e,[{key:"updateTimeStamp",value:function(){this.timestamp=He()}},{key:"start",value:function(e){return this._startts=e,this}},{key:"end",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var n=He();0===this.costTime&&(this.costTime=n-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(n)),t?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){e._sentFlag=!0,e._eventStatModule&&e._eventStatModule.pushIn(e)}),0)}}},{key:"setError",value:function(e,t,n){if(!(e instanceof Error))return Je.w("".concat(this._n,".setError value not instanceof Error, please check!")),this;if(this._sentFlag)return this;if(this.setNetworkType(n),t)e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message);else{var o=Ao.NO_NETWORK;this.setCode(o)}return this.setLevel("error"),this}},{key:"setCode",value:function(e){return mt(e)||this._sentFlag||("ECONNABORTED"===e&&(this.code=103),_t(e)?this.code=e:Je.w("".concat(this._n,".setCode value not a number, please check!"),e,n(e))),this}},{key:"setMessage",value:function(e){return mt(e)||this._sentFlag||(_t(e)&&(this.message=e.toString()),gt(e)&&(this.message=e)),this}},{key:"setCostTime",value:function(e){return this.costTime=e,this}},{key:"setLevel",value:function(e){return mt(e)||this._sentFlag||(this.level=jo[e]),this}},{key:"setMoreMessage",value:function(e){return pn(this.moreMessage)?this.moreMessage="".concat(e):this.moreMessage+=" ".concat(e),this}},{key:"setNetworkType",value:function(e){if(mt(e))Je.w("".concat(this._n,".setNetworkType value is undefined, please check!"));else{var t=Jo[e.toLowerCase()];mt(t)||(this.networkType=t)}return this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(e){this.uiPlatform=e}},{key:"setExtension",value:function(e){return this.extension=e,this}},{key:"setEventType",value:function(e){return this.eventType=e,this}}],[{key:"bindEventStatModule",value:function(t){e.prototype._eventStatModule=t}}]),e}(),Qo=function(){function e(t){o(this,e),this.type=S.MSG_TEXT,this.content={text:t.text||""}}return i(e,[{key:"setText",value:function(e){this.content.text=e}},{key:"sendable",value:function(){return 0!==this.content.text.length}}]),e}(),Zo=function(){function e(t,n){o(this,e),this._imageMemoryURL="",this._fileDownloadProxy=n,ce?this.createImageDataASURLInWXMiniApp(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=S.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||ze.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._autoFixUrl()}return i(e,[{key:"_initImageInfoModel",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=kt(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.imageUrl||t.url||"",this.url=sn(t.url||e._imageMemoryURL,e._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(e){e&&(this.imageUrl=e)},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(e){for(var t=0,n=null,o=null;t<=2;)o=mt(e)||mt(e[t])?{type:0,size:0,width:0,height:0,url:""}:e[t],(n=new this._ImageInfoModel(o)).setSizeType(t+1),n.setType(t),this.addImageInfo(n),t++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o1&&(this._percent=1)}},{key:"updateImageFormat",value:function(e){this.content.imageFormat=ze[e.toUpperCase()]||ze.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(e){void 0!==e&&e.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:"createImageDataASURLInWXMiniApp",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:"replaceImageInfo",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:"addImageInfo",value:function(e){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(e)}},{key:"updateAccessSideImageInfoArray",value:function(){var e=this.content.imageInfoArray,t=e[0],n=t.width,o=void 0===n?0:n,a=t.height,i=void 0===a?0:a;0!==o&&0!==i&&(Jt(e),Object.assign(e[2],jt({originWidth:o,originHeight:i,min:720})))}},{key:"sendable",value:function(){return 0!==this.content.imageInfoArray.length&&(""!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size)}}]),e}(),$o=function(){function e(t){o(this,e),this.type=S.MSG_FACE,this.content=t||null}return i(e,[{key:"sendable",value:function(){return null!==this.content}}]),e}(),ea=function(){function e(t,n){o(this,e),this.type=S.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:t.second,size:t.size,url:sn(t.url,n),remoteAudioUrl:t.url||"",uuid:t.uuid}}return i(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateAudioUrl",value:function(e){this.content.remoteAudioUrl=e}},{key:"sendable",value:function(){return""!==this.content.remoteAudioUrl}}]),e}(),ta={from:!0,groupID:!0,groupName:!0,to:!0},na=function(){function e(t){o(this,e),this.type=S.MSG_GRP_TIP,this.content={},this._initContent(t)}return i(e,[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"remarkInfo":break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case"operatorInfo":break;case"memberInfoList":case"msgMemberInfo":t._updateMemberList(e[n]);break;case"memberExtraInfo":case"onlineMemberInfo":break;case"memberNum":t.content[n]=e[n],t.content.memberCount=e[n];break;case"newGroupProfile":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n1&&(this._percent=1)}},{key:"updateFileUrl",value:function(e){this.content.fileUrl=e}},{key:"sendable",value:function(){return""!==this.content.fileUrl&&(""!==this.content.fileName&&0!==this.content.fileSize)}}]),e}(),sa=function(){function e(t){o(this,e),this.type=S.MSG_CUSTOM,this.content={data:t.data||"",description:t.description||"",extension:t.extension||""}}return i(e,[{key:"setData",value:function(e){return this.content.data=e,this}},{key:"setDescription",value:function(e){return this.content.description=e,this}},{key:"setExtension",value:function(e){return this.content.extension=e,this}},{key:"sendable",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),ra=function(){function e(t,n){o(this,e),this.type=S.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:t.remoteVideoUrl||t.videoUrl||"",videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:sn(t.videoUrl,n),videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:sn(t.thumbUrl,n),snapshotUrl:sn(t.thumbUrl,n)}}return i(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateVideoUrl",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:"updateSnapshotInfo",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth,o=e.snapshotHeight;pn(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),pn(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),pn(o)||(this.content.thumbHeight=this.content.snapshotHeight=Number(o))}},{key:"sendable",value:function(){return""!==this.content.remoteVideoUrl}}]),e}(),ca=function(){function e(t){o(this,e),this.type=S.MSG_LOCATION;var n=t.description,a=t.longitude,i=t.latitude;this.content={description:n,longitude:a,latitude:i}}return i(e,[{key:"sendable",value:function(){return!0}}]),e}(),ua=function(){function e(t,n){if(o(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||"",this.clientTime=t.clientTime||void 0,t.ID)this.ID=t.ID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",t.messageBody?this.messageBody=JSON.parse(JSON.stringify(t.messageBody)):this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType?t.conversationType.startsWith(S.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(S.CONV_GROUP)&&(this.receiverGroupID=t.to):t.receiverGroupID?this.receiverGroupID=t.receiverGroupID:t.receiverUserID&&(this.receiverUserID=t.receiverUserID),this.messageReceiver=t.to||t.messageReceiver;else{this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[];var a=t.elements[0].type,i=t.elements[0].content;this._patchRichMediaPayload(a,i),this._updateRichMediaDownloadUrl(a,i,n),a===S.MSG_MERGER?this.messageBody.push({type:a,payload:new la(i).content}):this.messageBody.push({type:a,payload:i}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID="".concat(t.tinyID,"-").concat(t.clientTime,"-").concat(t.random)}}return i(e,[{key:"_patchRichMediaPayload",value:function(e,t){e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(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===S.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===S.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===S.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}},{key:"_updateRichMediaDownloadUrl",value:function(e,t,n){n&&(e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){e.url=sn(e.url,n)})):e===S.MSG_VIDEO?(t.videoUrl=sn(t.videoUrl,n),t.snapshotUrl=sn(t.thumbUrl,n),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===S.MSG_AUDIO?t.url=sn(t.url,n):e===S.MSG_FILE&&(t.fileUrl=sn(t.fileUrl,n)))}}]),e}(),la=function(){function e(t,n){if(o(this,e),this.type=S.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},t.downloadKey){var a=t.downloadKey,i=t.pbDownloadKey,s=t.title,r=t.abstractList,c=t.compatibleText,u=t.version;this.content.downloadKey=a,this.content.pbDownloadKey=i,this.content.title=s,this.content.abstractList=r,this.content.compatibleText=c,this.content.version=u||0}else if(pn(t.messageList))1===t.layersOverLimit&&(this.content.layersOverLimit=!0);else{var l=t.messageList,d=t.title,p=t.abstractList,_=t.compatibleText,g=t.version,h=[];l.forEach((function(e){if(!pn(e)){var t=new ua(e,n);h.push(t)}})),this.content.messageList=h,this.content.title=d,this.content.abstractList=p,this.content.compatibleText=_,this.content.version=g||0}}return i(e,[{key:"sendable",value:function(){return!pn(this.content.messageList)||!pn(this.content.downloadKey)}}]),e}(),da={1:S.MSG_PRIORITY_HIGH,2:S.MSG_PRIORITY_NORMAL,3:S.MSG_PRIORITY_LOW,4:S.MSG_PRIORITY_LOWEST},pa=function(){function e(t){o(this,e),this.ID="",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||S.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:kt(),this.priority=this._computePriority(t.priority),this.nick=t.nick||"",this.avatar=t.avatar||"",this.isPeerRead=!1,this.nameCard="",this.hasRiskContent=ln(t.checkResult),this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow="",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=t.status||fn.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||Ke()||0,this.senderTinyID=t.senderTinyID||t.tinyID||"",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this._receiverList=t.receiverList||void 0,this.isSupportExtension=!0===t.isSupportExtension||1===t.isSupportExtension,this.revoker=t.revokerInfo&&t.revokerInfo.revoker||"",this.revokerInfo=t.revokerInfo||{userID:"",nick:"",avatar:""},this.revokeReason=t.revokeReason||"",this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t),this.initC2CReadReceiptInfo(t.readReceiptSentByPeer)}return i(e,[{key:"elements",get:function(){return this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(e){if(null!==e){gt(e.nick)&&(this.nick=e.nick),gt(e.avatar)&&(this.avatar=e.avatar);var t=e.messageFromAccountExtraInformation;ft(t)&>(t.nameCard)&&(this.nameCard=t.nameCard)}}},{key:"handleGroupAtInfo",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==S.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(S.MSG_AT_ALL))})),vt(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(S.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(e){e&&(this.status=this.from?fn.SUCCESS:fn.UNSEND,!this.from&&(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:"isSendable",value:function(){return 0!==this._elements.length&&(!0===this._relayFlag||"function"==typeof this._elements[0].sendable&&this._elements[0].sendable())}},{key:"_initTo",value:function(e){this.conversationType===S.CONV_GROUP&&(this.to=e.groupID)}},{key:"_initSequence",value:function(e){0===this.clientSequence&&e&&(this.clientSequence=function(e){if(!e)return!1;if(void 0===Ot[e]){var t=new Date,n="3".concat(t.getHours()).slice(-2),o="0".concat(t.getMinutes()).slice(-2),a="0".concat(t.getSeconds()).slice(-2);Ot[e]=parseInt([n,o,a,"0001"].join("")),n=null,o=null,a=null,Je.l("autoIncrementIndex start index:".concat(Ot[e]))}return Ot[e]++}(e)),0===this.sequence&&this.conversationType===S.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===S.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(e){""!==e&&(e===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(e){var t=this.to,n="",o=this.conversationType;o!==S.CONV_SYSTEM?(n=o===S.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID=n?"".concat(o).concat(n):null):this.conversationID=S.CONV_SYSTEM}},{key:"isElement",value:function(e){return e instanceof Qo||e instanceof Zo||e instanceof $o||e instanceof ea||e instanceof ia||e instanceof ra||e instanceof na||e instanceof aa||e instanceof sa||e instanceof ca||e instanceof la}},{key:"setElement",value:function(e,t){var n=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();var o=function(e){if(e.type&&e.content)switch(e.type){case S.MSG_TEXT:n.setTextElement(e.content);break;case S.MSG_IMAGE:n.setImageElement(e.content,t);break;case S.MSG_AUDIO:n.setAudioElement(e.content,t);break;case S.MSG_FILE:n.setFileElement(e.content,t);break;case S.MSG_VIDEO:n.setVideoElement(e.content,t);break;case S.MSG_CUSTOM:n.setCustomElement(e.content);break;case S.MSG_LOCATION:n.setLocationElement(e.content);break;case S.MSG_GRP_TIP:n.setGroupTipElement(e.content);break;case S.MSG_GRP_SYS_NOTICE:n.setGroupSystemNoticeElement(e.content);break;case S.MSG_FACE:n.setFaceElement(e.content);break;case S.MSG_MERGER:n.setMergerElement(e.content,t)}};if(vt(e))for(var a=0;a0&&this.emitOuterEvent(E.MESSAGE_RECEIVED,l),c.length=0}},{key:"_newC2CMessageStoredAndSummary",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,a=e.isInstantMessage,i=null,s=[],r=[],c={},u=this.getModule(mo),l=!1,d=this.getModule(ao),p=this.getModule($n),_=this.getFileDownloadProxy(),g=0,h=t.length;g0&&u.addMessageDelay(i.clientTime)}else this._messageFromUnreadDBMap.set(i.ID,1);if(0!==f.msgLifeTime){if(!1===i._onlineOnlyFlag){var N=d.getLastMessageTime(v);if(_t(N)&&i.time0){L=!0;var n=s.find((function(t){return t.conversationID==="C2C".concat(o[e].from)}));n?n.unreadCount=o[e].unreadCount:s.push({conversationID:"C2C".concat(o[e].from),unreadCount:o[e].unreadCount,type:S.CONV_C2C})}},O=0,G=o.length;O0&&(o=e.cloudCustomData);var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push("NoUnread"),!0===r&&a.push("NoLastMsg"),!0===c&&a.push("NoMsgCheck")}var u=this.isOnlineMessage(e,t)?0:void 0;return{protocolName:Uo.SEND_C2C_MESSAGE,tjgID:this.generateTjgID(e),requestData:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:u,nick:e.nick,avatar:e.avatar,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:0!==u?a:void 0,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}},{key:"_isVoipPush",value:function(e){var t=void 0;return mt(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:"isOnlineMessage",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:"revokeMessage",value:function(e){return this.request({protocolName:Uo.REVOKE_C2C_MESSAGE,requestData:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;return Je.l("".concat(this._n,".deleteMessage toAccount:").concat(t," count:").concat(n.length)),this.request({protocolName:Uo.DELETE_C2C_MESSAGE,requestData:{fromAccount:this.getMyUserID(),to:t,keyList:n}})}},{key:"modifyRemoteMessage",value:function(e){var t=e.from,n=e.to,o=e.version,a=void 0===o?0:o,i=e.sequence,s=e.random,r=e.time,c=e.payload,u=e.type,l=e.cloudCustomData,d=void 0;return tn(u)&&(d=[]).push({type:u,content:c}),this.request({protocolName:Uo.MODIFY_C2C_MESSAGE,requestData:{from:t,to:n,version:a,sequence:i,random:s,time:r,elements:d,cloudCustomData:l}})}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,a="".concat(this._n,".setMessageRead");Je.l("".concat(a," conversationID:").concat(n," lastMessageTime:").concat(o)),_t(o)||this.outputWarning("DoNotModifyLastTime");var i=new Xo("setC2CMessageRead");return i.setMessage("conversationID:".concat(n," lastMessageTime:").concat(o)),this.request({protocolName:Uo.SET_C2C_MESSAGE_READ,requestData:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:n.replace("C2C",""),lastMessageTime:o,receipt:1}]}}}).then((function(){i.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(a," ok"));var e=t.getModule(ao);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),No()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.l("".concat(a," failed. error:"),e),Go(e)}))}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessage"),o=e.peerAccount,a=e.conversationID,i=e.count,s=e.lastMessageTime,r=e.messageKey,c="peerAccount:".concat(o," count:").concat(i||15," lastMessageTime:").concat(s||0," messageKey:").concat(r);Je.l("".concat(n," ").concat(c));var u=new Xo("getC2CRoamingMessages");return this.request({protocolName:Uo.GET_C2C_ROAMING_MESSAGE,requestData:{peerAccount:o,count:i||15,lastMessageTime:s||0,messageKey:r}}).then((function(e){var o=e.data,i=o.complete,s=o.messageList,r=o.messageKey,l=o.lastMessageTime;mt(s)?Je.l("".concat(n," ok. complete:").concat(i," but messageList is undefined!")):Je.l("".concat(n," ok. complete:").concat(i," count:").concat(s.length)),u.setNetworkType(t.getNetworkType()).setMessage("".concat(c," complete:").concat(i," length:").concat(s.length)).end();var d=t.getModule(ao);1===i&&d.setCompleted(a);var p=d.onRoamingMessage(s,a);d.modifyMessageList(a),d.updateIsRead(a),d.updateRoamingMessageKeyAndTime(a,r,l);var _=d.getPeerReadTime(a);if(Je.l("".concat(n," update isPeerRead property. conversationID:").concat(a," peerReadTime:").concat(_)),_)d.updateMessageIsPeerReadProperty(a,_);else{var g=a.replace(S.CONV_C2C,"");t.getRemotePeerReadTime([g]).then((function(){d.updateMessageIsPeerReadProperty(a,d.getPeerReadTime(a))}))}var h="";if(p.length>0)h=p[0].ID;else{var f=d.getLocalOldestMessage(a);f&&(h=f.ID)}return Je.l("".concat(n," nextReqID:").concat(h," stored message count:").concat(p.length)),{nextReqID:h,storedMessageList:p}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setMessage(c).setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessagesHopping"),o=e.peerAccount,a=e.time,i=void 0===a?0:a,s=e.count,r=e.direction,c="".concat(S.CONV_C2C).concat(o),u="peerAccount:".concat(o," count:").concat(s," time:").concat(i," direction:").concat(r);Je.l("".concat(n," ").concat(u));var l=new Xo("getC2CRoamingMessagesHopping");return this.request({protocolName:Uo.GET_C2C_ROAMING_MESSAGE,requestData:{peerAccount:o,count:s+1,lastMessageTime:i,direction:r}}).then((function(e){var o=e.data,a=o.complete,i=o.messageList,s=void 0===i?[]:i,d=o.lastMessageTime;Je.l("".concat(n," ok. complete:").concat(a," count:").concat(s.length)),l.setNetworkType(t.getNetworkType()).setMessage("".concat(u," complete:").concat(a," length:").concat(s.length)).end(),1!==a&&(1===r?s.pop():s.shift());var p=t.getModule(ao).onRoamingMessage(s,c,!1);t._modifyMessageList(c,p);var _=t._computeResult({complete:a,lastMessageTime:d,resultList:p});return No(_)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setMessage(u).setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_computeResult",value:function(e){var t=e.complete,n=void 0===t?0:t,o=e.lastMessageTime,a=e.resultList,i={messageList:m(void 0===a?[]:a),isCompleted:!1,nextMessageTime:""};return 1===n?(i.isCompleted=!0,i):(i.nextMessageTime=o,i)}},{key:"_modifyMessageList",value:function(e,t){var n=this.getModule(ao).getLocalConversation(e);if(n)for(var o=n.userProfile.nick,a=n.userProfile.avatar,i=this.getModule($n).getNickAndAvatarByUserID(this.getMyUserID()),s=i.nick,r=i.avatar,c=t.length-1;c>=0;c--){var u=t[c];"in"===u.flow&&(u.nick!==o&&u.setNickAndAvatar({nick:o}),u.avatar!==a&&u.setNickAndAvatar({avatar:a})),"out"===u.flow&&(u.nick!==s&&u.setNickAndAvatar({nick:s}),u.avatar!==r&&u.setNickAndAvatar({avatar:r}))}}},{key:"getRemotePeerReadTime",value:function(e){var t=this,n="".concat(this._n,".getRemotePeerReadTime");if(pn(e))return Je.w("".concat(n," userIDList is empty!")),Promise.resolve();var o=new Xo("getPeerReadTime");return Je.l("".concat(n," userIDList:").concat(e)),this.request({protocolName:Uo.GET_C2C_PEER_READ_TIME,requestData:{userIDList:e}}).then((function(a){var i=a.data.peerReadTimeList;Je.l("".concat(n," ok. peerReadTimeList:").concat(i));for(var s="",r=t.getModule(ao),c=0;c0&&r.recordPeerReadTime("C2C".concat(e[c]),i[c]);o.setNetworkType(t.getNetworkType()).setMessage(s).end()})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.w("".concat(n," failed. error:"),e)}))}},{key:"sendReadReceipt",value:function(e){var t=this,n=e[0].conversationID.replace(S.CONV_C2C,""),o=new Xo("sendC2CReadReceipt");o.setMessage("peerAccount:".concat(n));var a=this.getMyUserID(),i=e.filter((function(e){return e.from!==a&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}));if(0===i.length)return Go({code:Ao.READ_RECEIPT_MSG_LIST_EMPTY});var s="".concat(this._n,".sendReadReceipt");return Je.l("".concat(s,". peerAccount:").concat(n," messageInfoList length:").concat(i.length)),this.request({protocolName:Uo.SEND_C2C_READ_RECEIPT,requestData:{peerAccount:n,messageInfoList:i}}).then((function(e){return o.end(),Je.l("".concat(s," ok")),No()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.w("".concat(s," failed. error:"),e),Go(e)}))}},{key:"getReadReceiptList",value:function(e){var t="".concat(this._n,".getReadReceiptList"),n=this.getMyUserID(),o=e.filter((function(e){return e.from===n&&!0===e.needReadReceipt}));return Je.l("".concat(t," userID:").concat(n," messageList length:").concat(o.length)),Oo({messageList:o})}},{key:"getMessageExtensions",value:function(e,t){return Je.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.request({protocolName:Uo.GET_C2C_MESSAGE_EXTENSIONS,requestData:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Je.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n)),this.request({protocolName:Uo.MODIFY_C2C_MESSAGE_EXTENSIONS,requestData:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),extensionList:t,operateType:n}})}},{key:"getMessageKey",value:function(e){var t=e.clientSequence,n=e.random,o=e.time;return"".concat(t,"_").concat(n,"_").concat(o)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._messageFromUnreadDBMap.clear(),this._noticeFromUnreadDBList.length=0}}]),a}(Po),ga=function(){function e(){o(this,e),this.list=new Map,this._n="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}return i(e,[{key:"getLocalOldestMessageByConversationID",value:function(e){if(!e)return null;if(!this.list.has(e))return null;var t=this.list.get(e).values();return t?t.next().value:null}},{key:"pushIn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0;this.list.has(n)||this.list.set(n,new Map);var a=this._getUniqueIDOfMessage(e),i=this.list.get(n).has(a);if(i){var s=this.list.get(n).get(a);if(!t||!0===s.isModified)return o=!1}return this.list.get(n).set(a,e),this._setLatestMessageSentByPeer(n,e),this._setLatestMessageSentByMe(n,e),o}},{key:"unshift",value:function(e,t){var n;if(vt(e)?e.length>0&&(n=e[0].conversationID,this._unshiftMultipleMessages(e,t)):(n=e.conversationID,this._unshiftSingleMessage(e,t)),n){var o=Array.from(this.list.get(n).values()),a=o.length;if(0===a)return;for(var i=a-1;i>=0;i--)if("out"===o[i].flow){this._setLatestMessageSentByMe(n,o[i]);break}if(n.startsWith(S.CONV_C2C))for(var s=a-1;s>=0;s--)if("in"===o[s].flow){this._setLatestMessageSentByPeer(n,o[s]);break}}}},{key:"_unshiftSingleMessage",value:function(e,t){var n=e.conversationID,o=this._getUniqueIDOfMessage(e);if(!this.list.has(n))return this.list.set(n,new Map),this.list.get(n).set(o,e),void t.push(e);var a=this.list.get(n),i=Array.from(a);a.has(o)||(i.unshift([o,e]),this.list.set(n,new Map(i)),t.push(e))}},{key:"_unshiftMultipleMessages",value:function(e,t){for(var n=e.length,o=[],a=e[0].conversationID,i=this.list.get(a),s=this.list.has(a)?Array.from(i):[],r=0;r=0;l--)"in"===i[l].flow&&((r=i[l]).nick!==n&&(r.setNickAndAvatar({nick:n}),u=!0),r.avatar!==o&&(r.setNickAndAvatar({avatar:o}),u=!0),u&&(c+=1));Je.l("".concat(this._n,".modifyMessageSentByPeer conversationID:").concat(t," count:").concat(c))}}}},{key:"modifyMessageSentByMe",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,a=this.list.get(t);if(!pn(a)){var i=Array.from(a.values()),s=i.length;if(0!==s){for(var r=null,c=0,u=!1,l=s-1;l>=0;l--)"out"===i[l].flow&&((r=i[l]).nick!==n&&(r.setNickAndAvatar({nick:n}),u=!0),r.avatar!==o&&(r.setNickAndAvatar({avatar:o}),u=!0),u&&(c+=1));Je.l("".concat(this._n,".modifyMessageSentByMe conversationID:").concat(t," count:").concat(c))}}}},{key:"getTopicConversationIDList",value:function(e){return m(this.list.keys()).filter((function(t){return t.startsWith("".concat(S.CONV_GROUP).concat(e))}))}},{key:"traversal",value:function(){if(0!==this.list.size&&-1===Je.getLevel()){console.group("conversationID-messageCount");var e,t=D(this.list);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],a=n[1];console.log("".concat(o,"-").concat(a.size))}}catch(i){t.e(i)}finally{t.f()}console.groupEnd()}}},{key:"onMessageModified",value:function(e,t){if(!this.list.has(e))return{isUpdated:!1,message:null};var n="".concat(this._n,".onMessageModified"),o=this._getUniqueIDOfMessage(t),a=this.list.get(e).has(o);if(Je.l("".concat(n," conversationID:").concat(e," uniqueID:").concat(o," has:").concat(a)),a){var i=this.list.get(e).get(o),s=t.messageVersion,r=t.elements,c=t.cloudCustomData,u=t.checkResult;return Je.l("".concat(n," localVersion:").concat(i.version," remoteVersion:").concat(s)),i.version1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isReady?void(t?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},t.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&t.length>0&&t.forEach((function(e){e.call(this)}),e)}),1)},t.resetReady=function(){this._isReady=!1,this._readyQueue=[]},t.isReady=function(){return this._isReady}};var va=["jpg","jpeg","gif","png","bmp","image","webp"],ma=["mp4","quicktime","mov"],Ma=1,Ia=2,ya=3,Ta=255,Ca=function(){function e(t){var n=this;o(this,e),pn(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.gender=t.gender||"",this.birthday=t.birthday||0,this.location=t.location||"",this.selfSignature=t.selfSignature||"",this.allowType=t.allowType||S.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||"",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||S.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],pn(t.profileCustomField)||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})})))}return i(e,[{key:"validate",value:function(e){var t=!0,n="";if(pn(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var o=e.profileCustomField.length,a=null,i=0;i500&&(n="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Nt(e[s])," bytes"),t=!1);break;case"gender":Rt(ot,e.gender)||(n="key:gender, invalid value:"+e.gender,t=!1);break;case"birthday":_t(e.birthday)||(n="birthday must be a number",t=!1);break;case"location":gt(e.location)||(n="location must be a string",t=!1);break;case"selfSignature":gt(e.selfSignature)||(n="selfSignature must be a string",t=!1);break;case"allowType":Rt(it,e.allowType)||(n="key:allowType, invalid value:"+e.allowType,t=!1);break;case"language":_t(e.language)||(n="language must be a number",t=!1);break;case"avatar":gt(e.avatar)||(n="avatar must be a string",t=!1);break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n="messageSettings must be 0 or 1",t=!1);break;case"adminForbidType":Rt(at,e.adminForbidType)||(n="key:adminForbidType, invalid value:"+e.adminForbidType,t=!1);break;case"level":_t(e.level)||(n="level must be a number",t=!1);break;case"role":_t(e.role)||(n="role must be a number",t=!1);break;default:n="unknown key:"+s+" "+e[s],t=!1}}return{valid:t,tips:n}}}]),e}(),Da=i((function e(t){o(this,e),this.value=t,this.next=null})),Ea=function(){function e(t){o(this,e),this.MAX_LENGTH=t,this.pTail=null,this.pNodeToDel=null,this.map=new Map}return i(e,[{key:"set",value:function(e){var t=new Da(e);if(this.map.size0&&n.members.forEach((function(e){e.userID===t.selfInfo.userID&&Et(t.selfInfo,e,["sequence"])}))}},{key:"updateSelfInfo",value:function(e){var n={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList};Et(this.selfInfo,t({},n),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(e){this.selfInfo.nameCard=e}}]),e}(),ka=function(e,n,o){return mt(e)?{lastTime:0,lastSequence:0,fromAccount:"",messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1,revoker:null}:o&&e.ID||e instanceof pa?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",messageForShow:en(e.type,e.payload,n),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||"",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||"",nameCard:e.nameCard||"",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:t(t({},e),{},{messageForShow:en(e.type,e.payload,n)})},Aa=function(){function e(t,n){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,e),this.conversationID=t.conversationID||"",this.unreadCount=t.unreadCount||0,this.type=t.type||"",this.lastMessage=ka(t.lastMessage,n,a),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark="",this.isPinned=t.isPinned||!1,this.messageRemindType=t.messageRemindType,this.markList=t.markList||[],this.customData=t.customData||"",this.conversationGroupList=t.conversationGroupList||[],this.draftText=t.draftText||"",this._initProfile(t),this.subType=this.groupProfile?this.groupProfile.type:""}return i(e,[{key:"toAccount",get:function(){return this.conversationID.startsWith(S.CONV_C2C)?this.conversationID.replace(S.CONV_C2C,""):this.conversationID.startsWith(S.CONV_GROUP)?this.conversationID.replace(S.CONV_GROUP,""):""}},{key:"_initProfile",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"userProfile":t.userProfile=e.userProfile;break;case"groupProfile":t.groupProfile=e.groupProfile}})),mt(this.userProfile)&&this.type===S.CONV_C2C?this.userProfile=new Ca({userID:e.conversationID.replace("C2C","")}):mt(this.groupProfile)&&this.type===S.CONV_GROUP&&(this.groupProfile=new Na({groupID:e.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations,o=e.isUnreadC2CMessage;mt(t)||(bt(this.subType)?this.unreadCount=0:n&&this.type===S.CONV_GROUP||n&&this.type===S.CONV_TOPIC||o&&this.type===S.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:"updateLastMessage",value:function(e){this.lastMessage=ka(e)}},{key:"updateGroupAtInfoList",value:function(e){if(!this._isNeedMergeGroupAtInfo(e)){var t=function(e){return M(e)||I(e)||y(e)||C()}(e.groupAtType).slice(0);-1!==t.indexOf(S.CONV_AT_ME)&&-1!==t.indexOf(S.CONV_AT_ALL)&&(t=[S.CONV_AT_ALL_AT_ME]);var n={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:t,__random:e.__random,__sequence:e.__sequence};this.groupAtInfoList.push(n)}}},{key:"_isNeedMergeGroupAtInfo",value:function(e){var t=e.groupID,n=e.sequence;if(!wt({groupID:t}))return!1;var o=!1;return this.groupAtInfoList.forEach((function(t){t.messageSequence===n&&(t.atTypeArray.indexOf(S.CONV_AT_ME)>-1&&e.groupAtType.indexOf(S.CONV_AT_ALL)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME]),t.atTypeArray.indexOf(S.CONV_AT_ALL)>-1&&e.groupAtType.indexOf(S.CONV_AT_ME)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME],t.__random=e.__random,t.__sequence=e.__sequence),o=!0)})),o}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){var t=e.sequence,n=e.time;return this.type===S.CONV_C2C&&t===this.lastMessage.lastSequence&&n===this.lastMessage.lastTime||this.type===S.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}},{key:"setDraftText",value:function(e){this.draftText=e}}]),e}(),La=function(){function e(t){o(this,e),this._conversationModule=t,this._n="MessageRemindHandler"}return i(e,[{key:"getC2CMessageRemindType",value:function(e){var t=this,n="".concat(this._n,".getC2CMessageRemindType");return this._conversationModule.request({protocolName:Uo.GET_C2C_PEER_MUTE_NOTIFICATIONS,requestData:{toAccount:this._conversationModule.getMyUserID(),userIDList:e}}).then((function(o){Je.l("".concat(n," ok. userIDList:").concat(e));var a=o.data.muteFlagList;t._conversationModule.onC2CMessageRemindTypeFetched(a)})).catch((function(e){Je.e("".concat(n," failed. error:"),e)}))}},{key:"set",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):vt(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:"_setGroupMessageRemindType",value:function(e){var t=this,n="".concat(this._n,"._setGroupMessageRemindType"),o=e.groupID,a=e.messageRemindType,i="groupID:".concat(o," messageRemindType:").concat(a),s=new Xo("setMessageRemindType");s.setMessage(i);var r=this._getModule(to);return r?r.modifyGroupMemberInfo({groupID:o,messageRemindType:a,userID:this._conversationModule.getMyUserID()}).then((function(){s.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(n," ok. ").concat(i));var o=t.onGroupMessageRemindTypeUpdated(e);return t._conversationModule.emitTotalUnreadMessageCountUpdate(),No(o)})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)})):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"onGroupMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.messageRemindType;Je.l("".concat(this._n,".onGroupMessageRemindTypeUpdated groupID:").concat(t," messageRemindType:").concat(n));var o=this._getModule(to).getLocalGroupProfile(t);if(o&&(o.selfInfo.messageRemindType=n),Ft(t)){var a=t,i=$t(a),s=this._getModule(oo).getLocalTopic(i,a);return s&&(s.updateSelfInfo({messageRemindType:n}),this._conversationModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:i,topic:s})),{topic:s}}return this._conversationModule.patchMessageRemindType({ID:t,isC2CConversation:!1,messageRemindType:n})&&this._emitConversationUpdate(),{group:o}}},{key:"_setC2CMessageRemindType",value:function(e){var t=this,n="".concat(this._n,"._setC2CMessageRemindType"),o=e.userIDList,a=e.messageRemindType,i=o.slice(0,30),s=0;a===S.MSG_REMIND_DISCARD?s=1:a===S.MSG_REMIND_ACPT_NOT_NOTE&&(s=2);var r="userIDList:".concat(i," messageRemindType:").concat(a),c=new Xo("setMessageRemindType");return c.setMessage(r),this._conversationModule.request({protocolName:Uo.SET_C2C_PEER_MUTE_NOTIFICATIONS,requestData:{userIDList:i,muteFlag:s}}).then((function(e){c.setNetworkType(t._conversationModule.getNetworkType()).end();var o=e.data.errorList,s=[],u=[];vt(o)&&o.forEach((function(e){s.push(e.userID),u.push({userID:e.userID,code:e.errorCode})}));var l=i.filter((function(e){return-1===s.indexOf(e)}));Je.l("".concat(n," ok. ").concat(r," successUserIDList:").concat(l," failureUserIDList:").concat(JSON.stringify(u)));var d=0;return l.forEach((function(e){t._conversationModule.patchMessageRemindType({ID:e,isC2CConversation:!0,messageRemindType:a})&&(d+=1)})),d>=1&&t._emitConversationUpdate(),i.length=s.length=0,t._conversationModule.emitTotalUnreadMessageCountUpdate(),Oo({successUserIDList:l.map((function(e){return{userID:e}})),failureUserIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_getModule",value:function(e){return this._conversationModule.getModule(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset"))}}]),e}(),Ra=function(){function e(t){o(this,e),this._conversationModule=t,this._n="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=vn.NOT_START}return i(e,[{key:"setConvCustomData",value:function(e){var t=this,n="".concat(this._n,".").concat("setConvCustomData"),o=e.conversationIDList,a=e.customData;Je.l("".concat(n," options:"),e);var i=new Xo("setConvCustomData");i.setMessage(JSON.stringify(e));var s={fromAccount:this._getMyUserID(),itemList:[]},r=[],c=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(c,e),!0;if(!qt(e)&&!xt(e))return t._onConversationIDInvalid(c,e),!0;var n={operationType:2,contactItem:void 0,customMark:a};qt(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:xt(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),s.itemList.push(n)})),c.length===o.length?Oo({successConversationIDList:r,failureConversationIDList:c}):this._conversationModule.request({protocolName:Uo.SET_CONVERSATION_CUSTOM_DATA,requestData:s}).then((function(e){i.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(n," ok"));var o=e.data.resultItem;if(vt(o)){var s,u,l=!1;o.forEach((function(e){s=t._concatConversationID(e.contactItem),0===e.resultCode?(r.push(s),(u=t._getLocalConversation(s))&&u.customData!==a&&(u.customData=a,l=!0)):c.push({conversationID:s,code:e.resultCode,message:e.resultInfo})})),!0===l&&t._emitConversationUpdate()}return No({successConversationIDList:r,failureConversationIDList:c})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"markConversation",value:function(e){var t=this;if(!this._conversationModule.canIUse(K.CONV_MARK))return this._conversationModule.cannotUseCommercialAbility("markConversation");var n="".concat(this._n,".").concat("markConversation"),o=e.conversationIDList,a=e.markType,i=e.enableMark;Je.l("".concat(n," options:"),e);var s=new Xo("markConversation");s.setMessage(JSON.stringify(e));var r=void 0,c=void 0,u=this._getFlagBit(a);!0===i?c=[u]:r=[u];var l={fromAccount:this._getMyUserID(),itemList:[]},d=[],p=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(p,e),!0;if(!qt(e)&&!xt(e))return t._onConversationIDInvalid(p,e),!0;var n={operationType:1,contactItem:void 0,clearMark:r,setMark:c};qt(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:xt(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),l.itemList.push(n)})),p.length===o.length?Oo({successConversationIDList:d,failureConversationIDList:p}):this._conversationModule.request({protocolName:Uo.MARK_CONVERSATION,requestData:l}).then((function(e){s.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(n," ok"));var o=e.data.resultItem;if(vt(o)){var r,c,u=!1;o.forEach((function(e){if(r=t._concatConversationID(e.contactItem),0===e.resultCode){if(d.push(r),c=t._getLocalConversation(r)){var n=c.markList.indexOf(a);!0===i?-1===n&&(c.markList.push(a),u=!0):-1!==n&&(c.markList.splice(n,1),u=!0)}}else p.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===u&&t._emitConversationUpdate()}return No({successConversationIDList:d,failureConversationIDList:p})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"getLocalConvGroupList",value:function(){var e=this;return Je.l("".concat(this._n,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===vn.REJECTED?this.getRemoteConvGroupList().then((function(){return No(m(e._convGroupMap.values()))})):Oo(m(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var e=this,t="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=vn.PENDING,this._conversationModule.request({protocolName:Uo.GET_CONVERSATION_GROUP_LIST,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:Ke()}}).then((function(n){var o,a,i=n.data,s=i.completeFlag,r=i.contactItem,c=i.nextStartIndex,u=void 0===c?0:c,l=i.groupItem;(e._startIndex=u,Je.l("".concat(t," completeFlag:").concat(s," nextStartIndex:").concat(u)),vt(l)&&l.forEach((function(t){var n=t.convGroupID,o=t.groupName;e._convGroupMap.set(n,o)})),vt(r))&&r.forEach((function(t){var n=t.standardMark,i=t.customData,s=t.convGroupIDList;if(o=e._concatConversationID(t),(a=e._getLocalConversation(o))&&(a.markList=nn(n),a.customData=i||"",vt(s))){var r=[];s.forEach((function(t){e._convGroupMap.has(t)&&r.push(e._convGroupMap.get(t))})),a.conversationGroupList=[].concat(r),r.length=0}}));if(0===s)return e.getRemoteConvGroupList();1===s&&(e._pagingStatus=vn.RESOLVED,e._emitConversationUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=vn.REJECTED,Je.w("".concat(t," failed. error:"),n)}))}},{key:"createConvGroup",value:function(e){var t=this,n="createConversationGroup";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n);Je.l("".concat(o," options:"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.groupName,s=e.conversationIDList,r={fromAccount:this._getMyUserID(),itemList:[{groupName:i,contactItem:[]}]},c=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?qt(e)||xt(e)?void(qt(e)?r.itemList[0].contactItem.push({type:1,toAccount:e.replace(S.CONV_C2C,"")}):xt(e)&&r.itemList[0].contactItem.push({type:2,groupID:e.replace(S.CONV_GROUP,"")})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?Oo({successConversationIDList:c,failureConversationIDList:u}):this._conversationModule.request({protocolName:Uo.CREATE_CONVERSATION_GROUP,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(o," ok"));var n=e.data.groupResultItem[0],s=n.groupItem,r=n.resultItem;if(ft(s)&&(t._convGroupMap.set(s.convGroupID,s.groupName),t._emitConvGroupListUpdate()),vt(r)){var l,d,p=!1;r.forEach((function(e){l=t._concatConversationID(e.contactItem),0===e.resultCode?(c.push(l),(d=t._getLocalConversation(l))&&-1===d.conversationGroupList.indexOf(i)&&(d.conversationGroupList.push(i),p=!0)):u.push({conversationID:l,code:e.resultCode,message:e.resultInfo})})),!0===p&&(t._emitConversationUpdate(),t._emitConvGroupListUpdate())}return No({successConversationIDList:c,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"deleteConvGroup",value:function(e){var t=this,n="deleteConversationGroup";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n);Je.l("".concat(o," groupName:").concat(e));var a=new Xo(n);return a.setMessage(e),this._conversationModule.request({protocolName:Uo.DELETE_CONVERSATION_GROUP,requestData:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(n){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(o," ok"));var i=n.data.groupItem;if(vt(i)){var s=!1;i.forEach((function(e){t._convGroupMap.has(e.convGroupID)&&(t._convGroupMap.delete(e.convGroupID),s=!0)})),!0===s&&t._emitConvGroupListUpdate()}t._eraseFromConversationGroupList([e])})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"renameConvGroup",value:function(e){var t=this,n="renameConversationGroup";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n);Je.l("".concat(o," options:"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.oldName,s=e.newName;return this._conversationModule.request({protocolName:Uo.RENAME_CONVERSATION_GROUP,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:i,newName:s}}}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(o," ok"));var n=e.data.updateGroupResult.convGroupID;t._convGroupMap.set(n,s),t._emitConvGroupListUpdate();var r,c,u=t._conversationModule.getLocalConversationList(),l=!1;u.forEach((function(e){r=e.conversationGroupList,-1!==(c=r.indexOf(i))&&(r.splice(c,1,s),l=!0)})),!0===l&&t._emitConversationUpdate()})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"addConvsToGroup",value:function(e){var t=this,n="addConversationsToGroup";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n);Je.l("".concat(o," options:"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.conversationIDList,s=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:s,updateItem:[]}},c=[],u=[];return i.forEach((function(e){return t._hasLocalConversation(e)?qt(e)||xt(e)?void(qt(e)?r.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):xt(e)&&r.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===i.length?Oo({successConversationIDList:c,failureConversationIDList:u}):this._conversationModule.request({protocolName:Uo.ADD_CONVERSATIONS_TO_GROUP,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(o," ok"));var n=e.data.updateGroupResult.contactResultItem;if(vt(n)){var i,r,l=!1;n.forEach((function(e){i=t._concatConversationID(e.contactItem),0===e.resultCode?(r=t._getLocalConversation(i))&&-1===r.conversationGroupList.indexOf(s)&&(r.conversationGroupList.push(s),c.push(i),l=!0):u.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(s))}return No({successConversationIDList:c,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"deleteConvsFromGroup",value:function(e){var t=this,n="deleteConversationsFromGroup";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n);Je.l("".concat(o," options:"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.conversationIDList,s=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:s,updateItem:[]}},c=[],u=[];return i.forEach((function(e){return t._hasLocalConversation(e)?qt(e)||xt(e)?void(qt(e)?r.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):xt(e)&&r.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===i.length?Oo({successConversationIDList:c,failureConversationIDList:u}):this._conversationModule.request({protocolName:Uo.DELETE_CONVERSATIONS_FROM_GROUP,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l("".concat(o," ok"));var n=e.data.updateGroupResult.contactResultItem;if(vt(n)){var i,r,l=!1;n.forEach((function(e){if(i=t._concatConversationID(e.contactItem),0===e.resultCode){if(r=t._getLocalConversation(i)){var n=r.conversationGroupList.indexOf(s);-1!==n&&(r.conversationGroupList.splice(n,1),c.push(i),l=!0)}}else u.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(s))}return No({successConversationIDList:c,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"onConvMarkUpdated",value:function(e){var t=this;if(!pn(e)){var n,o;Je.d("".concat(this._n,".onConvMarkUpdated markItemList:"),e);var a=!1;e.forEach((function(e){var i=e.recentContactItem,s=e.optType,r=e.standardMark,c=e.customMark;n=t._concatConversationID(i),(o=t._getLocalConversation(n))&&(1===s?a=t._diffStandardMark(o,r):2===s?a=t._diffCustomMark(o,c):3===s&&(a=t._diffStandardMark(o,r)||t._diffCustomMark(o,c)))})),!0===a&&this._emitConversationUpdate()}}},{key:"_diffStandardMark",value:function(e,t){var n=nn(t),o=!1;return!0!==function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n=0;o--)if("1"===t[o])return n-o-1}},{key:"_concatConversationID",value:function(e){var t,n=e.type,o=e.to,a=e.groupID,i=e.userID;return 1===n?mt(i)?mt(o)||(t="".concat(S.CONV_C2C).concat(o)):t="".concat(S.CONV_C2C).concat(i):2===n&&(t="".concat(S.CONV_GROUP).concat(a)),t}},{key:"_getMyUserID",value:function(){return this._conversationModule.getMyUserID()}},{key:"_insertConversationGroup",value:function(e,t){var n=this._getLocalConversation(e);if(n){var o=n.conversationGroupList;-1===o.indexOf(t)&&o.push(t)}}},{key:"_getLocalConversation",value:function(e){return this._conversationModule.getLocalConversation(e)}},{key:"_hasLocalConversation",value:function(e){return this._conversationModule.hasLocalConversation(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._conversationModule.emitOuterEvent(E.CONVERSATION_GROUP_LIST_UPDATED,m(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(e){var t={groupName:e,conversationList:[]},n=this._conversationModule.getLocalConversationList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._conversationModule.emitOuterEvent(E.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=vn.NOT_START}}]),e}(),Oa=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n="ConversationModule",fa.mixin(g(t)),t._messageListHandler=new ga,t._messageRemindHandler=new La(g(t)),t._convGroupHandler=new Ra(g(t)),t.singlyLinkedList=new Ea(100),t._pagingStatus=vn.NOT_START,t._pagingTimeStamp=0,t._pagingStartIndex=0,t._pagingPinnedTimeStamp=0,t._pagingPinnedStartIndex=0,t._pagingConvIDMap=new Map,t._convIDFromUnreadDBMap=new Map,t._conversationMap=new Map,t._tmpGroupList=[],t._tmpGroupAtTipsList=[],t._peerReadTimeMap=new Map,t._completedMap=new Map,t._roamingMessageKeyAndTimeMap=new Map,t._roamingMessageSequenceMap=new Map,t._remoteGroupReadSequenceMap=new Map,t._convTotalUnreadCount=0,t._pagingGetCostList=[],t._initListeners(),t}return i(a,[{key:"_initListeners",value:function(){var e=this.getInnerEmitterInstance();e.on(ha.A2KEY_AND_TINYID_UPDATED,this._init,this),e.on(ha.PROFILE_UPDATED,this._onProfileUpdated,this)}},{key:"onCheckTimer",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:"_init",value:function(){var e=this;Je.l("".concat(this._n,"._init"));var t=this.getModule(so).getItem("conversationMap"),n=this.isIntl(),o=this.isUsingChatCore();if(t){for(var a=t.length,i=0;i0&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConversationList()}},{key:"_isNonExistentAccount",value:function(e){var t;return e.startsWith(S.CONV_C2C)&&(t=e.replace(S.CONV_C2C,"")),"@TLS#ERROR"===t||"@TLS#NOT_FOUND"===t}},{key:"onMessageSent",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(e){this._onSendOrReceiveMessage(e)}},{key:"_onSendOrReceiveMessage",value:function(e){var t=this,n=e.conversationOptionsList,o=e.isInstantMessage,a=void 0===o||o,i=e.isUnreadC2CMessage,s=void 0!==i&&i,r=e.updateUnreadCount,c=void 0===r||r,u=e.isSyncingEnded,l=void 0!==u&&u;this._isReady?0!==n.length?(!0===a&&this._checkNewConversation(n),this._updateLocalConversationList({conversationOptionsList:n,isInstantMessage:a,isUnreadC2CMessage:s,isFromGetConversations:!1,updateUnreadCount:c}),a||(this._convIDFromUnreadDBMap=new Map([].concat(m(this._convIDFromUnreadDBMap),m(n.map((function(e){return[e.conversationID,1]}))))),this._diffAndDeleteConversation(),l&&this.emitInnerEvent(ha.C2C_UNREAD_HANDLE_COMPLETED)),n.filter((function(e){return e.type===S.CONV_TOPIC})).length>0||this.emitConversationUpdate()):l&&this.emitInnerEvent(ha.C2C_UNREAD_HANDLE_COMPLETED):this.ready((function(){t._onSendOrReceiveMessage(e)}))}},{key:"updateConversationGroupProfile",value:function(e){var t=this;if(!vt(e)||0!==e.length)if(0!==this._conversationMap.size){var n=!1;e.forEach((function(e){var o="GROUP".concat(e.groupID);if(t._conversationMap.has(o)){n=!0;var a=t._conversationMap.get(o);a.groupProfile=JSON.parse(JSON.stringify(e)),a.lastMessage.lastSequence=0;s--)if(!a[s].isDeleted){i=a[s];break}var r=this._conversationMap.get(o);if(r){var c=!1;r.lastMessage.lastSequence===i.sequence&&r.lastMessage.lastTime===i.time||(pn(i)&&(i=void 0),r.updateLastMessage(i),r.type!==S.CONV_TOPIC&&(c=!0),Je.l("".concat(this._n,".onMessageDeleted. update conversationID:").concat(o," with lastMessage:"),r.lastMessage)),o.startsWith(S.CONV_C2C)&&this.updateUnreadCount(o),c&&this.emitConversationUpdate(!0,!1)}}}},{key:"onMessageModified",value:function(e){var t="".concat(this._n,".onMessageModified"),n=e.conversationType,o=e.from,a=e.to,i=e.time,s=e.sequence,r=e.elements,c=e.cloudCustomData,u=e.messageVersion,l=this.getMyUserID(),d="".concat(n).concat(a);a===l&&n===S.CONV_C2C&&(d="".concat(n).concat(o));var p=this._messageListHandler.onMessageModified(d,e),_=p.isUpdated,g=p.message;!0===_&&this.emitOuterEvent(E.MESSAGE_MODIFIED,[g]);var h=this._isTopicConversation(d);if(null===g?Je.l("".concat(t," message is null! options:").concat(JSON.stringify(e),"}")):Je.l("".concat(t," isUpdated:").concat(_," isTopicMessage:").concat(h," from:").concat(o," to:").concat(a," sequence:").concat(g.sequence," time:").concat(g.time)),h){this.getModule(oo).onMessageModified(e)}else{var f=this._conversationMap.get(d);if(f){var v=f.lastMessage;v&&v.lastTime===i&&v.lastSequence===s&&v.version!==u&&(Je.l("".concat(t," conversationID:").concat(d," lastMessage updated")),v.type=r[0].type,v.payload=r[0].content,v.messageForShow=en(v.type,v.payload,this.isIntl()),v.cloudCustomData=c,v.version=u,this.emitConversationUpdate(!0,!1))}}return g}},{key:"onNewGroupAtTips",value:function(e){var n=this,o=e.dataList,a=null;o.forEach((function(e){e.groupAtTips?a=e.groupAtTips:e.elements?a=t(t({},e.elements),{},{sync:!0}):e.groupAtType&&(a=t(t({},e),{},{sync:!0})),a.__random=e.random,a.__sequence=e.clientSequence,n._tmpGroupAtTipsList.push(a)})),Je.d("".concat(this._n,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var e=this;if(0!==this._tmpGroupAtTipsList.length){var t=!1;this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,a=n.from,i=n.topicID,s=void 0===i?void 0:i,r=n.sync,c=void 0!==r&&r;if(a!==e.getMyUserID())if(mt(s)){var u=e._conversationMap.get("".concat(S.CONV_GROUP).concat(o));u&&(u.updateGroupAtInfoList(n),t=!0)}else{var l=e._conversationMap.get("".concat(S.CONV_GROUP).concat(s));if(l){l.updateGroupAtInfoList(n);var d=e.getModule(oo),p=l.groupAtInfoList;d.onConversationProxy({topicID:s,groupAtInfoList:p})}if(pn(l)&&c)e.updateTopicConversation([{conversationID:"".concat(S.CONV_GROUP).concat(s),type:S.CONV_TOPIC}]),e._conversationMap.get("".concat(S.CONV_GROUP).concat(s)).updateGroupAtInfoList(n)}})),t&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:"_checkNewConversation",value:function(e){var t=this,n=[],o=[];e.forEach((function(e){t._conversationMap.has(e.conversationID)||(e.type===S.CONV_C2C?n.push(e.conversationID.replace(S.CONV_C2C,"")):e.type===S.CONV_GROUP&&o.push(e.conversationID.replace(S.CONV_GROUP,"")))})),n.length>0&&(this._onNewC2CConversation(n),n=null),o.length>0&&(this._onNewGroupConversation(o),o=null)}},{key:"_onNewC2CConversation",value:function(e){this.getModule(eo).getRemotePeerReadTime(e),this._messageRemindHandler.getC2CMessageRemindType(e)}},{key:"_onNewGroupConversation",value:function(e){var t=this.getModule(to);t&&t.getMessageRemindType(e)}},{key:"_setStorageConversationList",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getLocalConversationList(),n=t.filter((function(e){return e.type===S.CONV_C2C||e.type===S.CONV_GROUP&&e.lastMessage.type!==S.MSG_GRP_TIP})).slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}})),o=this.getModule(so);o.setItem("conversationMap",n,e)}},{key:"emitConversationUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversationList();if(t){var o=this.getModule(to);o&&o.updateGroupLastMessage(n)}e&&this.emitOuterEvent(E.CONVERSATION_LIST_UPDATED)}},{key:"getLocalConversationList",value:function(){return m(this._conversationMap.values()).filter((function(e){return e.type!==S.CONV_TOPIC}))}},{key:"getLocalConversation",value:function(e){return this._conversationMap.get(e)}},{key:"hasLocalConversation",value:function(e){return this._conversationMap.has(e)}},{key:"getLocalOldestMessage",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:"syncConversationList",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="syncConversationList",o=new Xo(n);return this._pagingStatus===vn.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList(t).then((function(t){var a=cn(e._pagingGetCostList),i=rn(e._pagingGetCostList);e._pagingGetCostList.length=0,e._pagingStatus=vn.RESOLVED,e._diffAndDeleteConversation(),e.emitConversationUpdate(!0,!1),e._setStorageConversationList(),e._handleC2CPeerReadTime(),e.emitInnerEvent(ha.CONV_SYNC_COMPLETED);var s="count:".concat(e._conversationMap.size," sum:").concat(i," avg:").concat(a);return Je.l("".concat(e._n,".").concat(n,". ").concat(s)),o.setMessage(s).setNetworkType(e.getNetworkType()).end(),t})).catch((function(t){return e._pagingStatus=vn.REJECTED,o.setMessage(e._pagingTimeStamp),e.probeNetwork().then((function(e){var n=v(e,2),a=n[0],i=n[1];o.setError(t,a,i).end()})),Go(t)}))}},{key:"_diffAndDeleteConversation",value:function(){var e=this;if(this._isSyncCompleted()){var t=[];this._conversationMap.forEach((function(n,o){!e._pagingConvIDMap.has(o)&&e._convIDFromUnreadDBMap.has(o)&&(e._conversationMap.delete(o),t.push(o))})),Je.l("".concat(this._n,"._diffAndDeleteConversation list:").concat(t)),t=null}}},{key:"_pagingGetConversationList",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="".concat(this._n,"._pagingGetConversationList");Je.l("".concat(n," incrementalPullFlag:").concat(t," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex));var o=Date.now();return this._pagingStatus=vn.PENDING,this.request({protocolName:Uo.PAGING_GET_CONVERSATION_LIST,requestData:{fromAccount:this.getMyUserID(),timeStamp:t?this._pagingTimeStamp:0,startIndex:t?this._pagingStartIndex:0,pinnedTimeStamp:t?this._pagingPinnedTimeStamp:0,pinnedStartIndex:t?this._pagingPinnedStartIndex:0,orderType:1}}).then((function(t){var a=t.data,i=a.completeFlag,s=a.conversations,r=void 0===s?[]:s,c=a.timeStamp,u=a.startIndex,l=a.pinnedTimeStamp,d=a.pinnedStartIndex,p=a.groupItem;if(e._pagingGetCostList.push(un(o,!1)),Je.l("".concat(n," ok. completeFlag:").concat(i," count:").concat(r.length," cost:").concat(un(o))),e._convGroupHandler.onConvGroupListSynced(p),r.length>0){var _=e._getConversationOptions(r);e._pagingConvIDMap=new Map([].concat(m(e._pagingConvIDMap),m(_.map((function(e){return[e.conversationID,1]}))))),e._updateLocalConversationList({conversationOptionsList:_,isFromGetConversations:!0,updateUnreadCount:!0}),e.isLoggedIn()&&e.emitConversationUpdate()}if(!e._isReady){if(!e.isLoggedIn())return Oo();e.triggerReady()}return e._pagingTimeStamp=c,e._pagingStartIndex=u,e._pagingPinnedTimeStamp=l,e._pagingPinnedStartIndex=d,1!==i?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),Oo())})).catch((function(t){throw e.isLoggedIn()&&(e._isReady||(Je.w("".concat(n," failed. error:"),t),e.triggerReady())),t}))}},{key:"_updateLocalConversationList",value:function(e){var t,n=e.isFromGetConversations,o=e.isInstantMessage,a=Date.now();t=this._getTmpConversationListMapping(e),this._conversationMap=new Map(this._sortConversationList([].concat(m(t.toBeUpdatedConversationList),m(this._conversationMap)))),n||(this._updateUserOrGroupProfile(t.newConversationList),o&&this.emitTotalUnreadMessageCountUpdate()),Je.l("".concat(this._n,"._updateLocalConversationList cost:").concat(un(a)))}},{key:"_getTmpConversationListMapping",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,a=e.isUnreadC2CMessage,i=void 0!==a&&a,s=e.updateUnreadCount,r=[],c=[],u=this.getModule(to),l=this.getModule(no),d=this.isIntl(),p=this.isUsingChatCore(),_=0,g=t.length;_0&&a.getUserProfile({userIDList:n}).then((function(e){var n=e.data;vt(n)?n.forEach((function(e){t._doUpdateUserProfile("C2C".concat(e.userID),e)})):t._doUpdateUserProfile("C2C".concat(n.userID),n)})),o.length>0&&i.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then((function(e){e.data.successGroupList.forEach((function(e){var n="GROUP".concat(e.groupID);if(t._conversationMap.has(n)){var o=t._conversationMap.get(n);Et(o.groupProfile,e,[],[null,void 0,"",0,NaN]),!o.subType&&e.type&&(o.subType=e.type)}}))}))}}},{key:"_doUpdateUserProfile",value:function(e,t){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=t)}},{key:"_getConversationOptions",value:function(e){var n=this,o=[],a=e.filter((function(e){var t=e.type,o=e.userID;return 1===t&&!n._isNonExistentAccount(o)||2===t})),i=this.getMyUserID(),s=a.map((function(e){if(mt(e.lastMsg)&&(e.lastMsg={elements:[]}),1===e.type){var a={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar};return o.push(a),{conversationID:"C2C".concat(e.userID),type:"C2C",lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?n._amendLayersOverLimitProperty(e.lastMsg.elements[0].content):null,cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:e.lastC2CMsgFromAccount===i&&e.time<=e.c2cPeerReadTime,revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null},userProfile:new Ca(a),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,customData:e.customMark||"",markList:nn(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId),remark:e.friendRemark||"",messageRemindType:n._transMessageRemindType(e.messageRemindType)}}return{conversationID:"GROUP".concat(e.groupID),type:"GROUP",lastMessage:t(t({lastTime:e.time,lastSequence:e.sequence,fromAccount:e.msgGroupFromAccount},n._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||"",nameCard:e.senderNameCard||"",revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null}),groupProfile:new Na({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage,type:e.groupType,nextMessageSeq:e.nextMessageSeq}),unreadCount:n._computeGroupUnreadCount(e),peerReadTime:0,isPinned:1===e.isPinned,version:0,customData:e.customMark||"",markList:nn(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId),messageRemindType:n._transMessageRemindType(e.messageRemindType)}}));o.length>0&&this.getModule($n).onConversationsProfileUpdated(o);return s}},{key:"_transMessageRemindType",value:function(e){var t="";return 0===e?t=S.MSG_REMIND_ACPT_AND_NOTE:1===e?t=S.MSG_REMIND_DISCARD:2===e&&(t=S.MSG_REMIND_ACPT_NOT_NOTE),t}},{key:"_computeGroupUnreadCount",value:function(e){var t=e.unreadCount,n=void 0===t?0:t,o=e.noUnreadCount,a=n-(void 0===o?0:o);return a>0?a:0}},{key:"_patchTypeAndPayload",value:function(e){var n=e.lastMsg,o=n.event,a=void 0===o?void 0:o,i=n.elements,s=void 0===i?[]:i,r=n.groupTips,c=void 0===r?{}:r;if(!mt(a)&&!pn(c)){var u=new pa(c);u.setElement({type:S.MSG_GRP_TIP,content:t(t({},c.elements),{},{groupProfile:c.groupProfile})});var l=JSON.parse(JSON.stringify(u.payload));return u=null,{type:S.MSG_GRP_TIP,payload:l}}return{type:s[0]?s[0].type:null,payload:s[0]?this._amendLayersOverLimitProperty(s[0].content):null}}},{key:"_amendLayersOverLimitProperty",value:function(e){var t=e.layersOverLimit;return 0===t?e.layersOverLimit=!1:1===t&&(e.layersOverLimit=!0),e}},{key:"getLocalMessageList",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:"deleteLocalMessage",value:function(e){e instanceof pa&&this._messageListHandler.remove(e)}},{key:"onConversationDeleted",value:function(e){if(vt(e)){var t=e.map((function(e){var t=e.type,n=e.userID,o=e.groupID;return 1===t?"".concat(S.CONV_C2C).concat(n):2===t?"".concat(S.CONV_GROUP).concat(o):void 0}));Je.l("".concat(this._n,".onConversationDeleted conversationIDList:").concat(t)),this.deleteLocalConversationList(t)}}},{key:"onConversationPinned",value:function(e){var t=this;if(vt(e)){var n=!1;e.forEach((function(e){var o,a=e.type,i=e.userID,s=e.groupID;1===a?o=t.getLocalConversation("".concat(S.CONV_C2C).concat(i)):2===a&&(o=t.getLocalConversation("".concat(S.CONV_GROUP).concat(s))),o&&(Je.l("".concat(t._n,".onConversationPinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned||(o.isPinned=!0,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"onConversationUnpinned",value:function(e){var t=this;if(vt(e)){var n=!1;e.forEach((function(e){var o,a=e.type,i=e.userID,s=e.groupID;1===a?o=t.getLocalConversation("".concat(S.CONV_C2C).concat(i)):2===a&&(o=t.getLocalConversation("".concat(S.CONV_GROUP).concat(s))),o&&(Je.l("".concat(t._n,".onConversationUnpinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned&&(o.isPinned=!1,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"getMessageList",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,a=e.count,i="".concat(this._n,".getMessageList"),s=this.getLocalConversation(n),r="";if(s&&s.groupProfile&&(r=s.groupProfile.type),bt(r))return Je.l("".concat(i," not available in avchatroom. conversationID:").concat(n)),Oo({messageList:[],nextReqMessageID:"",isCompleted:!0});(mt(a)||a>15)&&(a=15),!o&&this._isNotInCommunity(n)&&(this._messageListHandler.removeByConversationID(n),this._completedMap.delete(n),this._roamingMessageSequenceMap.delete(n));var c=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),u=this._completedMap.has(n);if(Je.l("".concat(i," conversationID:").concat(n," nextReqMessageID:").concat(o)+" remainingCount:".concat(c," count:").concat(a," isCompleted:").concat(u)),this._needGetHistory({conversationID:n,remainingCount:c,count:a}))return this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,a=e.storedMessageList,s=t._completedMap.has(n),r=a;c>0&&(r=t._messageListHandler.getLocalMessageList(n).slice(0,a.length+c));var u={nextReqMessageID:s?"":o,messageList:r,isCompleted:s},l=u.messageList.filter((function(e){return e.isRevoked}))||[],d=r.map((function(e){return e.sequence}));return Je.l("".concat(i," ret.nextReqMessageID:").concat(u.nextReqMessageID," ret.isCompleted:").concat(u.isCompleted," ret.length:").concat(r.length," sequenceList:").concat(d)),vt(l)&&0!==l.length?t.updateRevokerInfo(l).then((function(e){return e.forEach((function(e){var t=e.revokerInfo;u.messageList=u.messageList.map((function(n){return n.ID===e.ID&&t&&(n.revokeReason=t.reason||"",n.revokerInfo={userID:t.revoker||n.revoker,nick:t.nick,avatar:t.avatar}),n}))})),No(u)})):No(u)}));this.modifyMessageList(n);var l=this._getMessageListFromMemory({conversationID:n,nextReqMessageID:o,count:a});return Oo(l)}},{key:"_getMessageListFromMemory",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=e.count,a="".concat(this._n,"._getMessageListFromMemory"),i=this._messageListHandler.getLocalMessageList(t),s=i.length,r=0,c={isCompleted:!1,nextReqMessageID:"",messageList:[]};return n?(r=i.findIndex((function(e){return e.ID===n})))>o?(c.messageList=i.slice(r-o,r),c.nextReqMessageID=i[r-o].ID):(c.messageList=i.slice(0,r),c.isCompleted=!0):s>o?(r=s-o,c.messageList=i.slice(r,s),c.nextReqMessageID=i[r].ID):(c.messageList=i.slice(0,s),c.isCompleted=!0),Je.l("".concat(a," conversationID:").concat(t)+" ret.nextReqMessageID:".concat(c.nextReqMessageID," ret.isCompleted:").concat(c.isCompleted," ret.length:").concat(c.messageList.length)),c}},{key:"getMessageListHopping",value:function(e){var t=e.conversationID,n=e.sequence,o=e.time,a=e.count,i=e.direction,s=void 0===i?0:i;if((mt(a)||a>15)&&(a=15),t.startsWith(S.CONV_C2C)){var r=this.getModule(eo),c=t.replace(S.CONV_C2C,"");return r.getRoamingMessagesHopping({peerAccount:c,time:o,count:a,direction:s})}if(t.startsWith(S.CONV_GROUP)){var u=this.getModule(to),l=t.replace(S.CONV_GROUP,"");return u.getRoamingMessagesHopping({groupID:l,sequence:n,count:a,direction:s})}}},{key:"_computeRemainingCount",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=this._messageListHandler.getLocalMessageList(t),a=o.length;if(!n)return a;var i=0;return qt(t)?i=o.findIndex((function(e){return e.ID===n})):xt(t)&&(i=-1!==n.indexOf("-")?o.findIndex((function(e){return e.ID===n})):o.findIndex((function(e){return e.sequence===n}))),-1===i&&(i=0),i}},{key:"_getMessageListSize",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:"_needGetHistory",value:function(e){var t=e.conversationID,n=e.remainingCount,o=e.count,a=this.getLocalConversation(t),i="";if(a&&a.groupProfile&&(i=a.groupProfile.type),Vt(t)||bt(i))return!1;var s=!1,r="".concat(this._n,"._needGetHistory conversationID:").concat(t);if(xt(t)){var c=this._isPagingGetGroupListCompleted(),u=this._getLocalGroupCount(),l=this._hasLocalGroup(t),d=this._isTopicConversation(t);if(Je.l("".concat(r," isGroupListCompleted:").concat(c," localGroupCount:").concat(u)+" isGroupInList:".concat(l," isTopic:").concat(d)),c&&u<=500&&!l&&!d)return s}return s=n<=o&&!this._completedMap.has(t),Je.l("".concat(r," ret:").concat(s)),s}},{key:"_isTopicConversation",value:function(e){var t=e.replace(S.CONV_GROUP,"");return Ft(t)}},{key:"getHistoryMessages",value:function(e){var t=e.conversationID,n=e.count;if(t===S.CONV_SYSTEM)return Oo();var o=15;n>20&&(o=20);var a=null;if(qt(t)){var i=this._roamingMessageKeyAndTimeMap.has(t);return(a=this.getModule(eo))?a.getRoamingMessage({conversationID:t,peerAccount:t.replace(S.CONV_C2C,""),count:o,lastMessageTime:i?this._roamingMessageKeyAndTimeMap.get(t).lastMessageTime:0,messageKey:i?this._roamingMessageKeyAndTimeMap.get(t).messageKey:""}):Go({code:Ao.CANNOT_FIND_MODULE})}if(xt(t)){if(!(a=this.getModule(to)))return Go({code:Ao.CANNOT_FIND_MODULE});var s=t.replace(S.CONV_GROUP,""),r=null;this._conversationMap.has(t)&&!Ft(s)&&(r=this._conversationMap.get(t).lastMessage);var c=0;r&&(c=r.lastSequence);var u=this._roamingMessageSequenceMap.get(t);return a.getRoamingMessage({conversationID:t,groupID:s,count:o,sequence:u||c})}return Oo()}},{key:"patchConversationLastMessage",value:function(e){var t=this.getLocalConversation(e);if(t){var n=t.lastMessage,o=n.messageForShow,a=n.payload;if(pn(o)||pn(a)){var i=this._messageListHandler.getLocalMessageList(e);if(0===i.length)return;var s=i[i.length-1];Je.l("".concat(this._n,".patchConversationLastMessage conversationID:").concat(e," payload:"),s.payload),t.updateLastMessage(s)}}}},{key:"onRoamingMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=n.startsWith(S.CONV_C2C)?S.CONV_C2C:S.CONV_GROUP,i=null,s=[],r=[],c=0,u=e.length,l=null,d=a===S.CONV_GROUP,p=this.getFileDownloadProxy(),_=function(){c=d?e.length-1:0,u=d?0:e.length},g=function(){d?--c:++c},h=function(){return d?c>=u:c0&&void 0!==arguments[0]?arguments[0]:{},n="setAllMessageRead",o="".concat(this._n,".").concat(n);t.scope||(t.scope=S.READ_ALL_MSG),Je.l("".concat(o," options:"),t);var a=this._createSetAllMessageReadPack(t);if(0===a.readAllC2CMessage&&0===a.groupMessageReadInfoList.length)return Oo();var i=new Xo(n);return this.request({protocolName:Uo.SET_ALL_MESSAGE_READ,requestData:a}).then((function(n){var o=n.data,a=e._handleAllMessageRead(o);return i.setMessage("scope:".concat(t.scope," failureGroups:").concat(JSON.stringify(a))).setNetworkType(e.getNetworkType()).end(),Oo()})).catch((function(t){return e.probeNetwork().then((function(e){var n=v(e,2),o=n[0],a=n[1];i.setError(t,o,a).end()})),Je.w("".concat(o," failed. error:"),t),Go({code:t&&t.code?t.code:Ao.MSG_UNREAD_ALL_FAIL,message:t&&t.message?t.message:void 0})}))}},{key:"setConversationCustomData",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:"onConversationMarkUpdated",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:"onConversationGroupCreated",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:"onConversationGroupDeleted",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:"onConversationGroupNameUpdated",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:"onConversationInGroupUpdated",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:"onConversationAddedToOrDeletedFromGroup",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:"_getConversationLastMessageSequence",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastSequence;return t&&n0)if(i.type===S.CONV_C2C&&0===n.readAllC2CMessage){if(o===S.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===S.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else if(i.type===S.CONV_GROUP&&(o===S.READ_ALL_GROUP_MSG||o===S.READ_ALL_MSG)){var s=this._getConversationLastMessageSequence(i);n.groupMessageReadInfoList.push({groupID:i.groupProfile.groupID,messageSequence:s})}}}catch(r){a.e(r)}finally{a.f()}return n}},{key:"onPushedAllMessageRead",value:function(e){this._handleAllMessageRead(e)}},{key:"_handleAllMessageRead",value:function(e){var t=e.groupMessageReadInfoList,n=e.readAllC2CMessage,o=this._parseGroupReadInfo(t);return this._updateAllConversationUnreadCount({readAllC2CMessage:n})>=1&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate()),o}},{key:"_parseGroupReadInfo",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n=1){if(1===n&&r.type===S.CONV_C2C){var c=this._getConversationLastMessageTime(r);this.updateIsReadAfterReadReport({conversationID:s,lastMessageTime:c})}else if(r.type===S.CONV_GROUP){var u=s.replace(S.CONV_GROUP,"");if(this._remoteGroupReadSequenceMap.has(u)){var l=this._remoteGroupReadSequenceMap.get(u),d=this._getConversationLastMessageSequence(r);this.updateIsReadAfterReadReport({conversationID:s,remoteReadSequence:l}),d>=l&&this._remoteGroupReadSequenceMap.delete(u)}}this.updateUnreadCount(s,!1)&&(o+=1)}}}catch(p){a.e(p)}finally{a.f()}return o}},{key:"isRemoteRead",value:function(e){var t=e.conversationID,n=e.sequence,o=t.replace(S.CONV_GROUP,""),a=!1;if(this._remoteGroupReadSequenceMap.has(o)){var i=this._remoteGroupReadSequenceMap.get(o);n<=i&&(a=!0,Je.l("".concat(this._n,".isRemoteRead conversationID:").concat(t," messageSequence:").concat(n," remoteReadSequence:").concat(i))),n>=i+10&&this._remoteGroupReadSequenceMap.delete(o)}return a}},{key:"updateIsReadAfterReadReport",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,a=this._messageListHandler.getLocalMessageList(t);if(0!==a.length)for(var i,s=a.length-1;s>=0;s--)if(i=a[s],!(o&&i.time>o||n&&i.sequence>n)){if("in"===i.flow&&i.isRead)break;i.setIsRead(!0)}}},{key:"updateUnreadCount",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!1,o=this.getLocalConversation(e),a=this._messageListHandler.getLocalMessageList(e);if(o){var i=o.unreadCount,s=a.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length;if(i!==s&&(o.unreadCount=s,n=!0,Je.l("".concat(this._n,".updateUnreadCount from ").concat(i," to ").concat(s,", conversationID:").concat(e)),!0===t&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())),n&&o.type===S.CONV_TOPIC){var r=o.unreadCount,c=this.getModule(oo),u=e.replace(S.CONV_GROUP,"");c.onConversationProxy({topicID:u,unreadCount:r})}return n}}},{key:"clearGroupAtInfoList",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversation(e);if(n&&n.groupAtInfoList.length>0){if(n.clearGroupAtInfoList(),Je.l("".concat(this._n,".clearGroupAtInfoList conversationID:").concat(e)),n.type===S.CONV_TOPIC){var o=n.groupAtInfoList,a=this.getModule(oo),i=e.replace(S.CONV_GROUP,"");a.onConversationProxy({topicID:i,groupAtInfoList:o})}!0===t&&this.emitConversationUpdate(!0,!1)}}},{key:"updateReadReceiptInfo",value:function(e){var t=this,n=e.userID,o=void 0===n?void 0:n,a=e.groupID,i=void 0===a?void 0:a,s=e.readReceiptList;if(!pn(s)){var r=[];if(mt(o)){if(!mt(i)){var c="".concat(S.CONV_GROUP).concat(i);s.forEach((function(e){var n=e.tinyID,o=e.clientTime,a=e.random,s=e.readCount,u=e.unreadCount,l="".concat(n,"-").concat(o,"-").concat(a),d=t._messageListHandler.getLocalMessage(c,l),p={groupID:i,messageID:l,readCount:0,unreadCount:0};d&&(_t(s)&&(d.readReceiptInfo.readCount=s,p.readCount=s),_t(u)&&(d.readReceiptInfo.unreadCount=u,p.unreadCount=u),r.push(p))}))}}else{var u="".concat(S.CONV_C2C).concat(o);s.forEach((function(e){var n=e.tinyID,a=e.clientTime,i=e.random,s="".concat(n,"-").concat(a,"-").concat(i),c=t._messageListHandler.getLocalMessage(u,s);if(c){c.readReceiptInfo.isPeerRead=!0;var l={userID:o,messageID:s,isPeerRead:!0};r.push(l)}}))}r.length>0&&this.emitOuterEvent(E.MESSAGE_READ_RECEIPT_RECEIVED,r)}}},{key:"updateIsRead",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!Vt(t.type)){for(var o=[],a=0,i=n.length;a0){var n=this._messageListHandler.updateMessageIsPeerReadProperty(e,t);if(n.length>0&&this.emitOuterEvent(E.MESSAGE_READ_BY_PEER,n),this._conversationMap.has(e)){var o=this._conversationMap.get(e).lastMessage;pn(o)||o.fromAccount===this.getMyUserID()&&o.lastTime<=t&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:"updateMessageIsModifiedProperty",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:"setCompleted",value:function(e){Je.l("".concat(this._n,".setCompleted. conversationID:").concat(e)),this._completedMap.set(e,!0)}},{key:"updateRoamingMessageKeyAndTime",value:function(e,t,n){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:"updateRoamingMessageSequence",value:function(e,t){this._roamingMessageSequenceMap.set(e,t)}},{key:"getConversationList",value:function(e){var t=this,n="".concat(this._n,".").concat("getConversationList"),o="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._conversationMap.size,", options:").concat(e);if(Je.l("".concat(n,". ").concat(o)),this._pagingStatus===vn.REJECTED){var a=new Xo("getConversationList");return a.setMessage(o),this.syncConversationList().then((function(){a.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return No({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}var i=this._getConversationList(e);return Je.l("".concat(n,". returned conversation count:").concat(i.length)),Oo({conversationList:i,isSyncCompleted:this._isSyncCompleted()})}},{key:"_getConversationList",value:function(e){if(mt(e))return this.getLocalConversationList();if(vt(e))return 0===e.length?[]:this.getLocalConversationList().filter((function(t){return e.includes(t.conversationID)}));if(ft(e)){var t=e.type,n=e.markType,o=e.groupName;return this.getLocalConversationList().filter((function(e){return(t!==S.CONV_C2C&&t!==S.CONV_GROUP||e.type===t)&&(!gt(o)||e.conversationGroupList.includes(o))&&(!_t(n)||e.markList.includes(n))}))}return[]}},{key:"_handleC2CPeerReadTime",value:function(){var e,t=D(this._conversationMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],a=n[1];a.type===S.CONV_C2C&&(Je.d("".concat(this._n,"._handleC2CPeerReadTime conversationID:").concat(o," peerReadTime:").concat(a.peerReadTime)),this.recordPeerReadTime(o,a.peerReadTime))}}catch(i){t.e(i)}finally{t.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){var e=this.getModule(to);return!e||e.isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){var e=this.getModule(to);return e?e.getLocalGroupList().length:0}},{key:"_hasLocalGroup",value:function(e){var t=this.getModule(to);return!!t&&t.hasLocalGroup(e.replace(S.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(e){var t,n=this;if((t=this._conversationMap.has(e)?this._conversationMap.get(e):new Aa({conversationID:e,type:e.slice(0,3)===S.CONV_C2C?S.CONV_C2C:S.CONV_GROUP},this.isIntl(),this.isUsingChatCore()))._isInfoCompleted||t.type===S.CONV_SYSTEM)return Oo({conversation:t});if(xt(e)&&!this._hasLocalGroup(e))return Oo({conversation:t});var o="".concat(this._n,".").concat("getConversationProfile"),a=new Xo("getConversationProfile");return Je.l("".concat(o,". conversationID:").concat(e," remark:").concat(t.remark," lastMessage:"),t.lastMessage),this._updateUserOrGroupProfileCompletely(t).then((function(i){a.setNetworkType(n.getNetworkType()).setMessage("conversationID:".concat(e," unreadCount:").concat(i.data.conversation.unreadCount)).end();var s=n.getModule(no);if(s&&t.type===S.CONV_C2C){var r=e.replace(S.CONV_C2C,"");if(s.isMyFriend(r)){var c=s.getFriendRemark(r);t.remark!==c&&(t.remark=c,Je.l("".concat(o,". conversationID:").concat(e," patch remark:").concat(t.remark)))}}return Je.l("".concat(o," ok. conversationID:").concat(e)),i})).catch((function(t){return n.probeNetwork().then((function(n){var o=v(n,2),i=o[0],s=o[1];a.setError(t,i,s).setMessage("conversationID:".concat(e)).end()})),Je.e("".concat(o," failed. error:"),t),Go(t)}))}},{key:"_updateUserOrGroupProfileCompletely",value:function(e){var t=this;return e.type===S.CONV_C2C?this.getModule($n).getUserProfile({userIDList:[e.toAccount]}).then((function(n){var o=n.data;return 0===o.length?Go(new ko({code:Ao.USER_OR_GRP_NOT_FOUND})):(e.userProfile=o[0],e._isInfoCompleted=!0,t._unshiftConversation(e),Oo({conversation:e}))})):this.getModule(to).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._unshiftConversation(e),Oo({conversation:e})}))}},{key:"_unshiftConversation",value:function(e){e instanceof Aa&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(m(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;if(n===t.getMyUserID())t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar});else{var o=t._conversationMap.get("".concat(S.CONV_C2C).concat(n));o&&(o.userProfile=e)}}))}},{key:"_isSyncCompleted",value:function(){return this._pagingStatus===vn.RESOLVED}},{key:"_errorLog",value:function(e,t,n,o){var a=new Error("Params validate failed."),i="".concat(this.getErrorMessage("API_REFER")).concat(e);throw Je.w("[".concat(e,"] | ").concat(t," | ").concat(this.getErrorMessage(n,o),", ").concat(i)),Je.e("[".concat(e,"] Invalid ").concat(t,": type check failed for ").concat(t,".")),a}},{key:"_isValidConversationID",value:function(e){return qt(e)||xt(e)||Vt(e)}},{key:"deleteConversation",value:function(e){var t=this,n="deleteConversation";return gt(e)||ht(e)||this._errorLog(n,"options","StringOrObjectRequiredLog"),gt(e)?(this._isValidConversationID(e)||this._errorLog(n,"options","InvalidConversationID",e),Je.l("".concat(this._n,".").concat(n," conversationID:").concat(e)),this.deleteConversationList({conversationIDList:[e],flag:1})):(vt(e.conversationIDList)||this._errorLog(n,"conversationIDList","ArrayRequiredLog"),0===e.conversationIDList.length&&this._errorLog(n,"conversationIDList","NonEmptyArrayLog"),e.conversationIDList.forEach((function(e){t._isValidConversationID(e)||t._errorLog(n,"conversationIDList","InvalidConversationID",e)})),"clearHistoryMessage"in e&&"boolean"!=typeof e.clearHistoryMessage&&this._errorLog(n,"clearHistoryMessage","BooleanRequiredLog"),e.conversationIDList.length>100&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConversationList(e))}},{key:"deleteConversationList",value:function(e){var t=this,n=e.conversationIDList,o=void 0===n?[]:n,a=e.clearHistoryMessage,i=void 0===a||a,s=e.flag,r=void 0===s?0:s,c="".concat(this._n,".").concat("deleteConversationList");Je.l("".concat(c," conversationIDList.length:").concat(o.length," clearHistoryMessage:").concat(i));var u=new Xo("deleteConversationList");return u.setMessage("conversationIDList:".concat(o)),Promise.all([this.rmLocalOnlyConversationList(o),this.rmLocalAndRemoteConversationList(o,i)]).then((function(e){u.setNetworkType(t.getNetworkType()).end();var n=[].concat(m(e[0]),m(e[1]));return 0===n.length?Go(new ko({code:Ao.CONV_NOT_FOUND})):(Je.l("".concat(c," ok")),Oo(1===r?{conversationID:n[0]}:{conversationIDList:n}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(c," failed. error:"),e),Go(e)}))}},{key:"rmLocalOnlyConversationList",value:function(e){var t=this;return e.filter((function(e){if(!t._conversationMap.has(e))return!1;var n=t.getLocalConversation(e).type;return n!==S.CONV_GROUP||t._hasLocalGroup(e)?n===S.CONV_SYSTEM&&(t.getModule(to).deleteGroupSystemNotice({messageList:t._messageListHandler.getLocalMessageList(e)}),t.deleteLocalConversation(e),!0):(t.deleteLocalConversation(e),!0)}))}},{key:"rmLocalAndRemoteConversationList",value:function(e,t){var n=this,o={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:t?1:0};return e.forEach((function(e){if(n._conversationMap.has(e)){var t=n.getLocalConversation(e).type;t===S.CONV_C2C?o.conversationList.push({toAccount:e.replace(t,""),type:1}):t===S.CONV_GROUP&&n._hasLocalGroup(e)&&o.conversationList.push({toGroupID:e.replace(t,""),type:2})}})),0===o.conversationList.length?[]:this.request({protocolName:Uo.DELETE_CONVERSATION,requestData:o}).then((function(e){var t=[];return e.data.resultList.length>0&&e.data.resultList.map((function(e){if(0===e.code){var n=1===e.type?"".concat(S.CONV_C2C).concat(e.to):"".concat(S.CONV_GROUP).concat(e.groupID);t.push(n)}})),n.deleteLocalConversationList(t),t}))}},{key:"setConversationDraft",value:function(e){var t=e.conversationID,n=e.draftText,o="".concat(this._n,".").concat("setConversationDraft");if(Je.l("".concat(o," conversationID:").concat(t," draftText:").concat(n)),!this._conversationMap.has(t))return Go({code:Ao.CONV_NOT_FOUND});var a=this._conversationMap.get(t);return a.setDraftText(n),Oo({code:0,conversation:a})}},{key:"clearHistoryMessage",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e))return Go({code:Ao.CONV_NOT_FOUND});var o=this._conversationMap.get(e).type;if(o===S.CONV_C2C)n.type=1,n.toAccount=e.replace(S.CONV_C2C,"");else{if(o!==S.CONV_GROUP)return o===S.CONV_SYSTEM?(this.getModule(to).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),Oo({conversationID:e})):Go({code:Ao.CONV_UN_RECORDED_TYPE});n.type=2,n.toGroupID=e.replace(S.CONV_GROUP,"")}var a="".concat(this._n,".").concat("clearHistoryMessage"),i=new Xo("clearHistoryMessage");return i.setMessage("conversationID:".concat(e)),Je.l("".concat(a,". conversationID:").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.request({protocolName:Uo.CLEAR_HISTORY_MESSAGE,requestData:n})})).then((function(){i.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(a," ok")),t._messageListHandler.removeByConversationID(e),t.setCompleted(e);var n=t.getLocalConversation(e);return n&&(n.updateLastMessage(),t._sortConversationListAndEmitEvent()),Oo({conversationID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e("".concat(a," failed. error:"),e),Go(e)}))}},{key:"pinConversation",value:function(e){var t=this,n=e.conversationID,o=e.isPinned;if(!this._conversationMap.has(n))return Go({code:Ao.CONV_NOT_FOUND});var a=this.getLocalConversation(n);if(a.isPinned===o)return Oo({conversationID:n});var i="".concat(this._n,".").concat("pinConversation"),s=new Xo("pinConversation");s.setMessage("conversationID:".concat(n," isPinned:").concat(o)),Je.l("".concat(i,". conversationID:").concat(n," isPinned:").concat(o));var r=null;return qt(n)?r={type:1,toAccount:n.replace(S.CONV_C2C,"")}:xt(n)&&(r={type:2,groupID:n.replace(S.CONV_GROUP,"")}),this.request({protocolName:Uo.PIN_CONVERSATION,requestData:{fromAccount:this.getMyUserID(),operationType:!0===o?1:2,itemList:[r]}}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(i," ok")),a.isPinned!==o&&(a.isPinned=o,t._sortConversationListAndEmitEvent()),No({conversationID:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e("".concat(i," failed. error:"),e),Go(e)}))}},{key:"setMessageRemindType",value:function(e){return this._messageRemindHandler.set(e)}},{key:"patchMessageRemindType",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,a=!1,i=this.getLocalConversation(n?"".concat(S.CONV_C2C).concat(t):"".concat(S.CONV_GROUP).concat(t));return i&&i.messageRemindType!==o&&(i.messageRemindType=o,a=!0),Je.d("".concat(this._n,".patchMessageRemindType options:"),e,"ret:".concat(a)),a}},{key:"onC2CMessageRemindTypeFetched",value:function(e){var t=this;if(vt(e)&&e.length>0){var n=0;e.forEach((function(e){var o=e.userID,a=e.muteFlag,i=t._transMessageRemindType(a);!0===t.patchMessageRemindType({ID:o,isC2CConversation:!0,messageRemindType:i})&&(n+=1)})),Je.l("".concat(this._n,".onC2CMessageRemindTypeFetched updateCount:").concat(n)),n>=1&&this.emitConversationUpdate(!0,!1)}}},{key:"onC2CMessageRemindTypeSynced",value:function(e){var t=this,n="".concat(this._n,".onC2CMessageRemindTypeSynced");Je.d(n,e),e.dataList.forEach((function(e){if(!pn(e.muteNotificationsSync)){var o=e.muteNotificationsSync,a=o.to,i=o.muteFlag,s=t._transMessageRemindType(i),r=0;t.patchMessageRemindType({ID:a,isC2CConversation:!0,messageRemindType:s})&&(r+=1),Je.l("".concat(n," updateCount:").concat(r)),r>=1&&t.emitConversationUpdate(!0,!1)}}))}},{key:"onGroupMessageRemindTypeUpdated",value:function(e){Je.d("".concat(this._n,".onGroupMessageRemindTypeUpdated options:"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:"deleteLocalConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._conversationMap.has(e);if(Je.d("".concat(this._n,".deleteLocalConversation conversationID:").concat(e," has:").concat(n)),n&&(this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e),t)){var o=!this._isTopicConversation(e);this.emitConversationUpdate(o,!1)}}},{key:"deleteLocalConversationList",value:function(e){var t=this,n=0,o=!1;e.forEach((function(e){t._conversationMap.has(e)&&(n+=t._conversationMap.get(e).unreadCount||0,t.deleteLocalConversation(e,!1),o=!0)})),Je.l("".concat(this._n,".deleteLocalConversationList conversationIDList.length:").concat(e.length," isConvIDExisted:").concat(o)),o&&(this.emitConversationUpdate(!0,!1),n>0&&this.emitTotalUnreadMessageCountUpdate())}},{key:"isMessageSentByCurrentInstance",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:"modifyMessageList",value:function(e){if(e.startsWith(S.CONV_C2C)&&this._conversationMap.has(e)){var t=this._conversationMap.get(e),n=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:t.userProfile.nick,latestAvatar:t.userProfile.avatar});var o=this.getModule($n).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),Je.l("".concat(this._n,".modifyMessageList conversationID:").concat(e," cost:").concat(un(n)))}}},{key:"updateUserProfileSpecifiedKey",value:function(e){Je.l("".concat(this._n,".updateUserProfileSpecifiedKey options:"),e);var t=e.conversationID,n=e.nick,o=e.avatar;if(this._conversationMap.has(t)){var a=this._conversationMap.get(t).userProfile;gt(n)&&a.nick!==n&&(a.nick=n),gt(o)&&a.avatar!==o&&(a.avatar=o),this.emitConversationUpdate(!0,!1)}}},{key:"_onMyProfileModified",value:function(e){var n=this,o=this.getLocalConversationList(),a=Date.now();o.forEach((function(o){n.modifyMessageSentByMe(t({conversationID:o.conversationID},e))})),Je.l("".concat(this._n,"._onMyProfileModified. modify all messages sent by me, cost:").concat(un(a)))}},{key:"modifyMessageSentByMe",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:"modifyMessageSentByPeer",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:"pushIntoNoticeResult",value:function(e,t){return!(!this._messageListHandler.pushIn(t)||this.singlyLinkedList.has(t.random))&&(e.push(t),!0)}},{key:"getLocalLastMessage",value:function(e){return this._messageListHandler.getLocalLastMessage(e)}},{key:"checkAndPatchRemark",value:function(){var e=this.getModule(no);if(0!==this._conversationMap.size&&e){var t=m(this._conversationMap.values()).filter((function(e){return e.type===S.CONV_C2C}));if(0!==t.length){var n=0;t.forEach((function(t){var o=t.conversationID.replace(S.CONV_C2C,"");if(e.isMyFriend(o)){var a=e.getFriendRemark(o);t.remark!==a&&(t.remark=a,n+=1)}})),Je.l("".concat(this._n,".checkAndPatchRemark. c2c conversation count:").concat(t.length,", patched count:").concat(n))}}}},{key:"updateTopicConversation",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0,updateUnreadCount:!0})}},{key:"sendReadReceipt",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(eo):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(to)),n?n.sendReadReceipt(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getReadReceiptList",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(eo):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(to)),n?n.getReadReceiptList(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getLastMessageTime",value:function(e){var t=this.getLocalConversation(e);return t?t.lastMessage.lastTime:0}},{key:"getTotalUnreadMessageCount",value:function(){var e=this.getLocalConversationList(),t=0;return e.forEach((function(e){e.type!==S.CONV_SYSTEM&&(""!==e.messageRemindType&&e.messageRemindType!==S.MSG_REMIND_ACPT_AND_NOTE||(t+=e.unreadCount))})),t}},{key:"emitTotalUnreadMessageCountUpdate",value:function(){var e=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==e&&(Je.l("".concat(this._n,".emitTotalUnreadMessageCountUpdate from ").concat(this._convTotalUnreadCount," to ").concat(e)),this._convTotalUnreadCount=e,this.emitOuterEvent(E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._setStorageConversationList(!0),this._pagingStatus=vn.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this._pagingConvIDMap.clear(),this._convIDFromUnreadDBMap.clear(),this._pagingGetCostList.length=0,this.resetReady()}}]),a}(Po),Ga=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return i(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:"_checkCachedGroupTips",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),a=e._groupModule.hasLocalGroup(n);Je.l("".concat(e._n,"._checkCachedGroupTips groupID:").concat(n," hasLocalGroup:").concat(a," checkCount:").concat(o)),a?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"onNewGroupTips",value:function(e){Je.d("".concat(this._n,".onReceiveGroupTips count:").concat(e.dataList.length));var t=this.newGroupTipsStoredAndSummary(e),n=t.eventDataList,o=t.result,a=t.AVChatRoomMessageList;(a.length>0&&this._groupModule.onAVChatRoomMessage(a),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(ao).onNewMessage({conversationOptionsList:n,isInstantMessage:!0}));o.length>0&&(this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:"newGroupTipsStoredAndSummary",value:function(e){for(var n=this,o=e.event,a=e.dataList,i=null,s=[],r=[],c={},u=[],l=function(e,l){var d=Pt(a[e]);if(6===o){if(n._groupModule.isGroupAttributesUpdatedNotice(d))return"continue";if(n._groupModule.isGroupCountersNotice(d))return"continue"}var p=d.groupProfile,_=p.groupID,g=p.communityType,h=void 0===g?0:g,f=p.topicID,v=void 0===f?void 0:f,m=p.invisible,M=void 0,I=n._groupModule.isMessageFromTopic(h,v);if(I){M=S.CONV_TOPIC,d.to=v;var y=n._groupModule.getModule(oo);y.hasLocalTopic(_,v)||n._getTopicPendingMap.has(v)||(n._getTopicPendingMap.set(v,1),y.getTopicList({groupID:_,topicIDList:[v]}).finally((function(){n._getTopicPendingMap.delete(v)})))}var T=n._groupModule.hasLocalGroup(_);if(!T&&n._groupModule.isUnjoinedAVChatRoom(_))return"continue";if(!T&&!I)return n._cacheGroupTipsAndProbe({groupID:_,event:o,item:d}),"continue";if(n._groupModule.isMessageFromOrToAVChatroom(_))return d.event=o,u.push(d),"continue";if(d.currentUser=n._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,(i=new pa(d)).setElement({type:S.MSG_GRP_TIP,content:t(t({},d.elements),{},{groupProfile:d.groupProfile})}),i.isSystemMessage=!1,1===m)return n._qualityStat(i),"continue";var C=n._groupModule.getModule(ao),D=i,E=D.conversationID,N=D.sequence;if(6===o)i._onlineOnlyFlag=!0,r.push(i);else if(!C.pushIntoNoticeResult(r,i))return"continue";if(n._groupModule.isMessageFromCommunityOfTopic(h,v))return"continue";if(6===o&&C.getLocalConversation(E))return"continue";6!==o&&n._qualityStat(i);var k=C.isRemoteRead({conversationID:E,sequence:N});if(mt(c[E])){var A=0;"in"===i.flow&&(i._isExcludedFromUnreadCount||i._onlineOnlyFlag||k||(A=1)),c[E]=s.push({conversationID:E,unreadCount:A,type:mt(M)?i.conversationType:M,subType:i.conversationSubType,lastMessage:i._isExcludedFromLastMessage?"":i})-1}else{var L=c[E];s[L].type=i.conversationType,s[L].subType=i.conversationSubType,s[L].lastMessage=i._isExcludedFromLastMessage?"":i,"in"===i.flow&&(i._isExcludedFromUnreadCount||i._onlineOnlyFlag||k||s[L].unreadCount++)}},d=0,p=a.length;d=0){c.updateSelfInfo({muteTime:d.muteTime}),u=!0;break}}u&&this._groupModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:r,topic:c})}}},{key:"_onTopicProfileUpdated",value:function(e){var n=e.payload,o=n.groupProfile.groupID,a=n.newTopicInfo;this._groupModule.getModule(oo).onTopicProfileUpdated(t({groupID:o,topicID:e.to},a))}},{key:"_cacheGroupTips",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:"_deleteCachedGroupTips",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:"_notifyCachedGroupTips",value:function(e){var t=this,n=this._cachedGroupTipsMap.get(e)||[];n.forEach((function(e){t.onNewGroupTips(e)})),this._deleteCachedGroupTips(e),Je.l("".concat(this._n,"._notifyCachedGroupTips groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupTipsAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,a=e.item;this._cacheGroupTips(n,{event:o,dataList:[a]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupTips(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupTips(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),Je.l("".concat(this._n,"._cacheGroupTipsAndProbe groupID:").concat(n))}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),e}(),Pa=function(){function e(t){o(this,e),this._groupModule=t,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._getTopicPendingMap=new Map,this._pagingStatus=vn.NOT_START,this._pagingGetCostList=[],t.getInnerEmitterInstance().on(ha.A2KEY_AND_TINYID_UPDATED,this.syncGroupList,this)}return i(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:"_checkCachedGroupMessage",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),a=e._groupModule.hasLocalGroup(n);Je.l("".concat(e._n,"._checkCachedGroupMessage groupID:").concat(n," hasLocalGroup:").concat(a," checkCount:").concat(o)),a?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"handleUpdateGroupLastMessage",value:function(e){var n="".concat(this._n,".handleUpdateGroupLastMessage");if(0!==this._groupModule.getGroupMap().size){for(var o,a,i,s,r,c=!1,u=0,l=e.length;u0&&this._groupModule.onAVChatRoomMessage(a),this._groupModule.filterModifiedMessage(o),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(ao).onNewMessage({conversationOptionsList:n,isInstantMessage:e.isInstantMessage||!0,updateUnreadCount:e.updateUnreadCount||!0}));var i=this._groupModule.filterUnmodifiedMessage(o);i.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,i),o.length=0}},{key:"_newGroupMessageStoredAndSummary",value:function(e){var t=this,n=e.dataList,o=e.event,a=e.isInstantMessage,i=null,s=[],r=[],c=[],u={},l=this._groupModule.getFileDownloadProxy(),d=n.length;d>1&&n.sort((function(e,t){return e.sequence-t.sequence}));for(var p=this._groupModule.getModule(ao),_=this._groupModule.getModule($n),g=function(e){var d=Pt(n[e]),g=d.groupProfile,h=g.groupID,f=g.communityType,v=void 0===f?0:f,m=g.topicID,M=void 0===m?void 0:m,I=g.invisible,y=void 0,T=t._groupModule.isMessageFromTopic(v,M);if(T){y=S.CONV_TOPIC,d.to=M;var C=t._groupModule.getModule(oo);C.hasLocalTopic(h,M)||t._getTopicPendingMap.has(M)||(t._getTopicPendingMap.set(M,1),C.getTopicList({groupID:h,topicIDList:[M]}).finally((function(){t._getTopicPendingMap.delete(M)})))}var D=t._groupModule.hasLocalGroup(h);if(!D&&t._groupModule.isUnjoinedAVChatRoom(h))return"continue";if(!D&&!T)return t._cacheGroupMessageAndProbe({groupID:h,event:o,item:d}),"continue";if(t._groupModule.isMessageFromOrToAVChatroom(h))return d.event=o,c.push(d),"continue";if(d.currentUser=t._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,d.isSystemMessage=!!d.isSystemMessage,(i=new pa(d)).setElement(d.elements,l),1===I)return t._qualityStat(a,i),"continue";var E=1===n[e].isModified;if(p.isMessageSentByCurrentInstance(i)?i.isModified=E:E=!1,1===d.onlineOnlyFlag)i._onlineOnlyFlag=!0,p.isMessageSentByCurrentInstance(i)||r.push(i);else{if(t._groupModule.isMessageFromCommunityOfTopic(v,M))return r.push(i),"continue";if(i.from===t._groupModule.getMyUserID()){var N=p.getLatestMessageSentByMe(i.conversationID);if(N){var k=N.nick,A=N.avatar;k===i.nick&&A===i.avatar||(p.modifyMessageSentByMe({conversationID:R,latestNick:i.nick,latestAvatar:i.avatar}),_.mockOnNickAvatarModified(i.nick,i.avatar))}}if(!p.pushIntoMessageList(r,i,E))return"continue";t._qualityStat(a,i);var L=i,R=L.conversationID,O=L.sequence,G=p.isRemoteRead({conversationID:R,sequence:O});if(mt(u[R])){var P=0;"in"===i.flow&&(i._isExcludedFromUnreadCount||G||(P=1)),u[R]=s.push({conversationID:R,unreadCount:P,type:mt(y)?i.conversationType:y,subType:i.conversationSubType,lastMessage:i._isExcludedFromLastMessage?"":i})-1}else{var U=u[R];s[U].type=mt(y)?i.conversationType:y,s[U].subType=i.conversationSubType,s[U].lastMessage=i._isExcludedFromLastMessage?"":i,"in"===i.flow&&(i._isExcludedFromUnreadCount||G||s[U].unreadCount++)}}},h=0;h0&&n.addMessageDelay(t.clientTime)}},{key:"onGroupMessageRevoked",value:function(e){var t=this,n=this._groupModule.getModule(ao),o=[];e.dataList.forEach((function(e){var t=e.elements.revokedInfos,a=e.revokerInfo;mt(t)||t.forEach((function(e){var t,i=pn(e.topicID)?"GROUP".concat(e.groupID):"GROUP".concat(e.topicID),s=n.getLocalConversation(i),r=e.revokerInfo&&e.revokerInfo.revoker||a&&a.revoker,c=a&&a.reason||"";if(bt(s.type))t={conversationID:i,sequence:e.sequence,ID:"".concat(e.tinyID,"-").concat(e.clientTime,"-").concat(e.random)};else{var u=n.revoke(i,e.sequence,e.random);u?t=u:(t={conversationID:i,sequence:e.sequence},e.tinyID&&e.clientTime&&e.random&&(t.ID="".concat(e.tinyID,"-").concat(e.clientTime,"-").concat(e.random)),e.time&&(t.time=e.time))}t&&(t.revoker=r,t.revokeReason=c,t.revokerInfo={userID:r,nick:"",avatar:""},o.push(t))}))})),0!==o.length&&(n.onMessageRevoked(o),n.updateRevokerInfo(o).then((function(e){t._groupModule.emitOuterEvent(E.MESSAGE_REVOKED,e)})))}},{key:"_groupListTreeShaking",value:function(e){for(var t=new Map(m(this._groupModule.getGroupMap())),n=0,o=e.length;n0&&void 0!==arguments[0]&&arguments[0];this._pagingStatus===vn.NOT_START&&this._groupModule.clearGroupMap();var n=["Type","Name","FaceUrl","NextMsgSeq","LastMsgTime","AtInfoList","LastRecallTime"],o=this.PAGING_GRP_COUNT_LIMIT,a=0,i=[];if(!0===t)return this._pagingGetGroupListWithTopic({limit:o,offset:a,groupBaseInfoFilter:n,groupList:i});var s="syncGroupList",r="".concat(this._n,".").concat(s),c=new Xo(s);return this._pagingGetGroupList({limit:o,offset:a,groupBaseInfoFilter:n,groupList:i}).then((function(){var t=cn(e._pagingGetCostList),n=rn(e._pagingGetCostList);e._pagingGetCostList.length=0,e._pagingStatus=vn.RESOLVED,e._groupListTreeShaking(i),e._groupModule.updateGroupMap(i);var o=e._groupModule.getLocalGroupList().length,a="count:".concat(o," sum:").concat(n," avg:").concat(t);return Je.l("".concat(r," ok. ").concat(a)),c.setNetworkType(e._groupModule.getNetworkType()).setMessage(a).end(),e.tempConversationList&&(e.handleUpdateGroupLastMessage(e.tempConversationList),e.tempConversationList=null),e._groupModule.emitGroupListUpdate(!0,!0),No({groupList:e._groupModule.getLocalGroupList()})})).catch((function(t){return e._pagingStatus=vn.REJECTED,e._groupModule.probeNetwork().then((function(e){var n=v(e,2),o=n[0],a=n[1];c.setError(t,o,a).end()})),Je.e("".concat(r," failed. error:"),t),Go(t)}))}},{key:"getGroupList",value:function(){var e=this,t="".concat(this._n,".").concat("getGroupList");if(Je.l("".concat(t," pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===vn.REJECTED||this._pagingStatus===vn.NOT_START)return this.syncGroupList().then((function(){var t=e._groupModule.getLocalGroupList();return No({groupList:t,isSyncCompleted:e.isPagingGetCompleted()})})).catch((function(e){return Je.e("".concat(t," failed. error:"),e),Go(e)}));var n=this._groupModule.getLocalGroupList();return Je.l("".concat(t,". returned group count:").concat(n.length)),Oo({groupList:n,isSyncCompleted:this.isPagingGetCompleted()})}},{key:"isPagingGetCompleted",value:function(){return this._pagingStatus===vn.RESOLVED}},{key:"_pagingGetGroupList",value:function(e){var t=this,n="".concat(this._n,".").concat("_pagingGetGroupList"),o=e.isCommunityRelay,a=void 0!==o&&o,i=e.limit,s=e.offset,r=e.groupBaseInfoFilter,c=e.groupList,u=Date.now();return this._groupModule.request({protocolName:Uo.GET_GROUP_LIST,requestData:{type:a?S.GRP_COMMUNITY:void 0,memberAccount:this._groupModule.getMyUserID(),limit:i,offset:s,responseFilter:{groupBaseInfoFilter:r,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]}}}).then((function(e){var o=e.data,l=o.groups,d=void 0===l?[]:l,p=o.totalCount;c.push.apply(c,m(d)),t._handleGroupAtInfoWithoutTopic(a,d);var _=s+i,g=!(p>_),h="offset:".concat(s," limit:").concat(i," totalCount:").concat(p," isCompleted:").concat(g," ")+"currentCount:".concat(c.length," isCommunityRelay:").concat(a);return t._pagingGetCostList.push(un(u,!1)),Je.l("".concat(n," ok. ").concat(h," cost:").concat(un(u))),a||g?!a&&g?(Je.l("".concat(n," start to get community list")),s=0,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c,isCommunityRelay:!0})):a&&!g?(s=_,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c,isCommunityRelay:!0})):No({groupList:c}):(s=_,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c}))})).catch((function(e){return 10018===e.code?(Je.w("".concat(t.logPrefix," response size exceeds the limit, request count:").concat(i)),i=50,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c,isCommunityRelay:a})):a?(11e3===e.code&&Je.l("".concat(n," ok. community unavailable")),Oo({groupList:c})):Go(e)}))}},{key:"_pagingGetGroupListWithTopic",value:function(e){var t=this,n="".concat(this._n,"._pagingGetGroupListWithTopic"),o=e.limit,a=e.offset,i=e.groupBaseInfoFilter,s=e.groupList,r=Date.now();return this._groupModule.request({protocolName:Uo.GET_GROUP_LIST,requestData:{type:S.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:o,offset:a,responseFilter:{groupBaseInfoFilter:i,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]},isSupportTopic:1}}).then((function(e){var c=e.data,u=c.groups,l=void 0===u?[]:u,d=c.totalCount;s.push.apply(s,m(l));var p=a+o,_=!(d>p);if(Je.l("".concat(n," ok. offset:").concat(a," limit:").concat(o," totalCount:").concat(d," isCompleted:").concat(_," currentCount:").concat(s.length," cost:").concat(un(r))),!_)return a=p,t._pagingGetGroupListWithTopic({limit:o,offset:a,groupBaseInfoFilter:i,groupList:s});t._groupModule.updateGroupMap(s),t._groupModule.emitGroupListUpdate(!0,!1);var g=t._groupModule.getLocalGroupList().filter((function(e){return!0===e.isSupportTopic}));return No({groupList:g})})).catch((function(e){return 10018===e.code?(Je.w("".concat(t.logPrefix," response size exceeds the limit, request count:").concat(o)),o=50,t._pagingGetGroupListWithTopic({limit:o,offset:a,groupBaseInfoFilter:i,groupList:s})):Go(e)}))}},{key:"_cacheGroupMessage",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:"_deleteCachedGroupMessage",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:"_notifyCachedGroupMessage",value:function(e){var t=this,n=this._cachedGroupMessageMap.get(e)||[];n.forEach((function(e){t.onNewGroupMessage(e)})),this._deleteCachedGroupMessage(e),Je.l("".concat(this._n,"._notifyCachedGroupMessage groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupMessageAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,a=e.item;this._cacheGroupMessage(n,{event:o,dataList:[a]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupMessage(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupMessage(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),Je.l("".concat(this._n,"._cacheGroupMessageAndProbe groupID:").concat(n))}},{key:"_handleGroupAtInfoWithoutTopic",value:function(e,n){var o=this;e&&0!==n.length&&n.forEach((function(e){var n=e.groupID,a=e.groupAtInfoList,i=[];mt(a)||(a.forEach((function(e){i.push(t(t({},e),{},{groupID:n}))})),o._groupModule.getModule(ao).onNewGroupAtTips({dataList:i}))}))}},{key:"setPagingGroupCount",value:function(e){mt(e)||(this.PAGING_GRP_COUNT_LIMIT=parseInt(e,10))}},{key:"reset",value:function(){this.PAGING_GRP_COUNT_LIMIT=200,this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._pagingStatus=vn.NOT_START,this._pagingGetCostList=[]}}]),e}(),Ua=1,ba=2,wa=3,Fa=4,qa=5,xa=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupAttributesHandler",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return i(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_attr_cache_time");mt(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:"isGroupAttributesUpdatedNotice",value:function(e){var t=e.to,n=e.elements.newGroupProfile,o=!mt(n)&&!pn(n.groupAttributeOption);return o&&this._onGroupAttributesUpdated({groupID:t,groupAttributeOption:n.groupAttributeOption}),o}},{key:"_onGroupAttributesUpdated",value:function(e){var t=this,n=e.groupID,o=e.groupAttributeOption,a=o.mainSequence,i=o.isWithChangedAttributeInfo,s=o.groupAttributeList,r=void 0===s?[]:s,c=o.operationType;if(Je.l("".concat(this._n,".onGroupAttributesUpdated. ")+"groupID:".concat(n," isWithChangedAttributeInfo:").concat(i," operationType:").concat(c)),!mt(c)){this._groupAttributesCopy=this._getCachedAttributes({groupID:n});var u=a-this._getLocalGroupAttributes(n).localMainSequence;if(0!==u){if(1===i&&1===u)return this._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:r,operationType:c}),void this._emitGroupAttributesUpdated(n);if(this._hasLocalGroupAttributes(n)){var l=this._getLocalGroupAttributes(n).avChatRoomKey;this._getGroupAttributes({groupID:n,avChatRoomKey:l}).then((function(){t._emitGroupAttributesUpdated(n)}))}}}}},{key:"initGroupAttributesCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey,o=void 0===n?void 0:n;this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:o}),Je.l("".concat(this._n,".initGroupAttributesCache groupID:").concat(t," avChatRoomKey:").concat(o))}},{key:"initGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,a=this._getLocalGroupAttributes(n),i=a.remoteMainSequence,s=a.avChatRoomKey,r=new Xo("initGroupAttributes");return r.setMessage("groupID:".concat(n," avChatRoomKey:").concat(s," mainSequence:").concat(i)),this._groupModule.request({protocolName:Uo.SET_GROUP_ATTRIBUTES,requestData:{groupID:n,avChatRoomKey:s,mainSequence:i,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){Je.l("".concat(t._n,".").concat("initGroupAttributes"," ok. groupID:").concat(n));var a=e.data,i=a.mainSequence,s=m(a.groupAttributeList);return s.forEach((function(e){e.value=o[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:i,groupAttributeList:s,operationType:Ua}),t._emitGroupAttributesUpdated(n),r.setNetworkType(t._groupModule.getNetworkType()).end(),No({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Go(e)}))}},{key:"setGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupAttributes"),o=e.groupID,a=e.groupAttributes,i=this._getLocalGroupAttributes(o),s=i.remoteMainSequence,r=i.avChatRoomKey,c=i.attributes,u=this._transformGroupAttributes(a);u.forEach((function(e){var t=e.key;e.sequence=0,c.has(t)&&(e.sequence=c.get(t).sequence)}));var l=new Xo("setGroupAttributes");return l.setMessage("groupID:".concat(o," groupAttributes:").concat(JSON.stringify(a))),Je.l("".concat(n,". groupID:").concat(o," mainSequence:").concat(s)),this._groupModule.request({protocolName:Uo.MODIFY_GROUP_ATTRIBUTES,requestData:{groupID:o,avChatRoomKey:r,mainSequence:s,groupAttributeList:u}}).then((function(e){Je.l("".concat(n," ok."));var i=e.data,s=i.mainSequence,r=m(i.groupAttributeList);return r.forEach((function(e){e.value=a[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:o}),t._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:s,groupAttributeList:r,operationType:ba}),t._emitGroupAttributesUpdated(o),l.setNetworkType(t._groupModule.getNetworkType()).end(),No({groupAttributes:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setError(e,o,a).end()})),Go(e)}))}},{key:"deleteGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.keyList,a=void 0===o?[]:o,i=this._getLocalGroupAttributes(n),s=i.remoteMainSequence,r=i.avChatRoomKey,c=i.attributes,u=m(c.keys()),l=Uo.CLEAR_GROUP_ATTRIBUTES,d=wa,p={groupID:n,avChatRoomKey:r,mainSequence:s},_=[];a.length>0&&(u=[],l=Uo.DELETE_GROUP_ATTRIBUTES,d=Fa,a.forEach((function(e){var t=0;c.has(e)&&(t=c.get(e).sequence,u.push(e)),_.push({key:e,sequence:t})})),p.groupAttributeList=_);var g=new Xo("deleteGroupAttributes");return g.setMessage("groupID:".concat(n," mainSequence:").concat(s," keyList:").concat(a," protocolName:").concat(l)),this._groupModule.request({protocolName:l,requestData:p}).then((function(e){Je.l("".concat(t._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(n));var o=e.data.mainSequence;return t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:o,groupAttributeList:_,operationType:d}),t._emitGroupAttributesUpdated(n),g.setNetworkType(t._groupModule.getNetworkType()).end(),No({keyList:u})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];g.setError(e,o,a).end()})),Go(e)}))}},{key:"getGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupAttributes"),o=e.groupID,a=this._getLocalGroupAttributes(o),i=a.avChatRoomKey,s=a.lastUpdateTime,r=a.localMainSequence,c=a.remoteMainSequence,u=new Xo("getGroupAttributes");if(u.setMessage("groupID:".concat(o," localMainSequence:").concat(r," remoteMainSequence:").concat(c," keyList:").concat(e.keyList)),Date.now()-s>=this.CACHE_EXPIRE_TIME||r0)o.forEach((function(e){i.has(e)&&(a[e]=i.get(e).value)}));else{var s,r=D(i.keys());try{for(r.s();!(s=r.n()).done;){var c=s.value;a[c]=i.get(c).value}}catch(u){r.e(u)}finally{r.f()}}}return a}},{key:"_updateCachedAttributes",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList,o=e.operationType;o!==wa?o!==Fa?(o===Ua&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value,a=e.sequence;t.attributes.set(n,{value:o,sequence:a})}))):n.forEach((function(e){t.attributes.delete(e.key)})):t.attributes.clear()}},{key:"_hasLocalGroupAttributes",value:function(e){return this._groupAttributesMap.has(e)}},{key:"_getLocalGroupAttributes",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:"_transformGroupAttributes",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_emitGroupAttributesUpdated",value:function(e){var t=this._getCachedAttributes({groupID:e}),n=this._computeAttrChangedInfo(t),o=n.updatedKeyList,a=n.deletedKeyList;Je.l("".concat(this._n,"._emitGroupAttributesUpdated update:").concat(o.length,", delete:").concat(a.length)),0===o.length&&0===a.length||this._groupModule.emitOuterEvent(E.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t,updatedKeyList:o,deletedKeyList:a})}},{key:"_computeAttrChangedInfo",value:function(e){var t=this,n=[],o=[];return Object.keys(e).forEach((function(o){e[o]!==t._groupAttributesCopy[o]&&n.push(o)})),Object.keys(this._groupAttributesCopy).forEach((function(t){mt(e[t])&&o.push(t)})),this._groupAttributesCopy={},{updatedKeyList:n,deletedKeyList:o}}},{key:"deleteLocalGroupAttributes",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),e}(),Va="Set",Ha="Increase",Ba="Decrease",Ka=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupCountersHandler",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return i(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_counter_expire_time");mt(e)||(this.EXPIRE_TIME=Number(e))}},{key:"isGroupCountersNotice",value:function(e){var t=e.to,n=e.elements.groupCounterInfo,o=!1;return pn(n)||(this._onGroupCountersUpdated({groupID:t,groupCounterInfo:n}),o=!0),o}},{key:"_onGroupCountersUpdated",value:function(e){var t=this,n=e.groupID;e.groupCounterInfo.forEach((function(e){var o=e.type,a=e.groupCounterSeq,i=e.counterList,s=void 0===i?[]:i;0!==o&&2!==o||(t._updateLocalGroupCounters({groupID:n,groupCounterSeq:a,counterList:s}),s.forEach((function(e){t._groupModule.emitOuterEvent(E.GROUP_COUNTER_UPDATED,{groupID:n,key:e.key,value:e.value})}))),1===o&&t._deleteLocalGroupCounters({groupID:n,groupCounterSeq:a,counterList:s})})),Je.l("".concat(this._n,"._onGroupCountersUpdated groupID:").concat(n))}},{key:"initGroupCountersCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey;this._groupCountersMap.set(t,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:n}),Je.l("".concat(this._n,".initGroupCountersCache groupID:").concat(t," avChatRoomKey:").concat(n))}},{key:"setGroupCounters",value:function(e){var t=this;if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility("setGroupCounters");var n="".concat(this._n,".").concat("setGroupCounters"),o=e.groupID,a=e.counters,i=this._convertObjectToList(a),s=this._getLocalGroupCounters(o).avChatRoomKey,r="groupID:".concat(o," count:").concat(i.length),c=new Xo("setGroupCounters");return c.setMessage("".concat(r)),Je.l("".concat(n,". ").concat(r)),this._updateGroupCounters({groupID:o,counterList:i,avChatRoomKey:s,mode:Va}).then((function(e){return c.end(),Je.l("".concat(n," ok.")),No({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"increaseGroupCounter",value:function(e){var t=this,n="increaseGroupCounter";if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=e.groupID,i=e.key,s=e.value,r=this._getLocalGroupCounters(a).avChatRoomKey,c="groupID:".concat(a," key:").concat(i," value:").concat(s),u=new Xo(n);u.setMessage("".concat(c)),Je.l("".concat(o,". ").concat(c));var l=[{key:i,value:s}];return this._updateGroupCounters({groupID:a,counterList:l,avChatRoomKey:r,mode:Ha}).then((function(e){return u.end(),Je.l("".concat(o," ok.")),No({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"decreaseGroupCounter",value:function(e){var t=this,n="decreaseGroupCounter";if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=e.groupID,i=e.key,s=e.value,r=this._getLocalGroupCounters(a).avChatRoomKey,c="groupID:".concat(a," key:").concat(i," value:").concat(s),u=new Xo(n);u.setMessage("".concat(c)),Je.l("".concat(o,". ").concat(c));var l=[{key:i,value:s}];return this._updateGroupCounters({groupID:a,counterList:l,avChatRoomKey:r,mode:Ba}).then((function(e){return u.end(),Je.l("".concat(o," ok.")),No({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"getGroupCounters",value:function(e){var t=this;if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility("getGroupCounters");var n="".concat(this._n,".").concat("getGroupCounters"),o=e.groupID,a=e.keyList,i=void 0===a?[]:a,s=this._getLocalGroupCounters(o),r=s.avChatRoomKey,c=s.lastUpdateTime,u=new Xo("getGroupCounters");if(u.setMessage("groupID:".concat(o)),Date.now()-c>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:o,avChatRoomKey:r}).then((function(e){u.setMoreMessage("from remote. count:".concat(e.length)).end(),Je.l("".concat(n," from remote. groupID:").concat(o));var a=t._getLocalCounters(o,i);return No({counters:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Go(e)}));u.setMoreMessage("from cache").end(),Je.l("".concat(n," from cache. groupID:").concat(o));var l=this._getLocalCounters(o,i);return Oo({counters:l})}},{key:"_getRemoteGroupCounters",value:function(e){var n=this;return this._groupModule.request({protocolName:Uo.GET_GROUP_COUNTER,requestData:t({},e)}).then((function(t){var o=t.data,a=o.counterList,i=void 0===a?[]:a,s=o.groupCounterSeq;return n._updateLocalGroupCounters({groupID:e.groupID,counterList:i,groupCounterSeq:s}),Je.l("".concat(n._n,"._getRemoteGroupCounters ok. groupID:").concat(e.groupID)),i})).catch((function(e){return Go(e)}))}},{key:"_convertObjectToList",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_updateGroupCounters",value:function(e){var n="".concat(this._n,"._updateGroupCounters"),o=e.groupID,a=e.avChatRoomKey,i=e.mode;return Je.l("".concat(n,". groupID:").concat(o," avChatRoomKey:").concat(a," mode:").concat(i)),this._groupModule.request({protocolName:Uo.UPDATE_GROUP_COUNTER,requestData:t({},e)}).then((function(e){Je.l("".concat(n," ok."));var t=e.data.counterList,o={};return(void 0===t?[]:t).forEach((function(e){var t=e.key,n=e.value;o[t]=n})),o})).catch((function(e){return Go(e)}))}},{key:"_hasLocalGroupCounters",value:function(e){return this._groupCountersMap.has(e)}},{key:"_getLocalGroupCounters",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:"_updateLocalGroupCounters",value:function(e){var t=e.groupID,n=e.counterList,o=void 0===n?[]:n,a=e.groupCounterSeq;if(this._hasLocalGroupCounters(t)){var i=this._getLocalGroupCounters(t),s=i.counters,r=i.avChatRoomKey,c=i.groupCounterSeq;if(a>0&&a0)t.forEach((function(e){o.has(e)&&(n[e]=o.get(e))}));else{var a,i=D(o.keys());try{for(i.s();!(a=i.n()).done;){var s=a.value;n[s]=o.get(s)}}catch(r){i.e(r)}finally{i.f()}}return n}},{key:"reset",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),e}(),Ya=function(){function e(t){o(this,e);var n=t.manager,a=t.groupID,i=t.onInit,s=t.onSuccess,r=t.onFail;this._n="Polling",this._manager=n,this._groupModule=n._groupModule,this._onInit=i,this._onSuccess=s,this._onFail=r,this._groupID=a,this._timeoutID=-1,this._isRunning=!1,this._protocolName=Uo.AVCHATROOM_POLLING}return i(e,[{key:"start",value:function(){var e=this._groupModule.isLoggedIn();e||(this._protocolName=Uo.AVCHATROOM_NOAUTH_POLLING),Je.l("".concat(this._n,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(e)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var e=this,t=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:"stop",value:function(){Je.l("".concat(this._n,".stop")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:"getPollingTimerID",value:function(){return this._timeoutID}}]),e}(),Wa={3:!0,4:!0,5:!0,6:!0,17:!0,20:!0,21:!0},ja=function(){function e(t){o(this,e),this._groupModule=t,this._n="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new Ea(200),this.messageIDLinkedList=new Ea(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}return i(e,[{key:"hasJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._joinedGroupMap.has(e)}},{key:"getJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0?m(this._joinedGroupMap.keys()):[]}},{key:"_updateRequestData",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===m(this._pollingInstanceMap.keys())[0]?t(t({},n),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):t(t({},n),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:"_handleSuccess",value:function(e,t){var n=t.data,o=n.key,a=n.nextSeq,i=n.rspMsgList,s=n.errorCode,r=n.nextBroadcastSeq,c=n.broadcastMessageList;if(0!==s){var u=this._pollingRequestInfoMap.get(e),l=new Xo("longPollingAVError"),d=u?"".concat(u.key,"-").concat(u.startSeq):"requestInfo is undefined";l.setMessage("".concat(e,"-").concat(d,"-").concat(t.errorInfo)).setCode(t.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(e))return;gt(o)&&_t(a)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:a}),_t(r)&&r>this._startBroadcastSeq&&(this._startBroadcastSeq=r),vt(i)&&i.length>0?(i.forEach((function(e){e.to=e.groupID})),this.onMessage(i,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(c)}}},{key:"_handleFailure",value:function(e,t){}},{key:"onMessage",value:function(e,t){if(vt(e)&&0!==e.length){var n="".concat(this._n,".onMessage");t&&(n+=" groupID:".concat(t)),0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var o=null,a=[],i=this._getModule(ao),s=this._getModule(mo),r=e.length;r>1&&e.sort((function(e,t){return e.sequence-t.sequence}));var c=this._getModule(io).isUnlimitedAVChatRoom(),u=!1;if(Je.getLevel()<=0){var l=e.map((function(e){return e.sequence}));Je.l("".concat(n," count:").concat(l.length," sequenceList:").concat(l)),l.length=0}for(var d=0;d0&&s.addMessageDelay(o.clientTime),s.addMessageSequence({key:Ko,message:o}))}a.push(o)}}}else{this._getModule(So).onMessageReactionNotify({event:21,dataList:p.elements.messageReactionNotifyList})}else this.handleMessageRevokedNotice(p)}else Je.w("".concat(n,". unknown event:").concat(p.event))}if(0!==a.length){if(this._groupModule.filterModifiedMessage(a),!u){var v=this.packConversationOption(a);v.length>0&&i.onNewMessage({conversationOptionsList:v,isInstantMessage:!0})}this._checkMessageStacked(a);var m=this._groupModule.filterUnmodifiedMessage(a);m.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,m),a.length=0}}}},{key:"handleMessageRevokedNotice",value:function(e){var t=this,n=e.groupID,o=e.elements.revokeMsgList,a=e.revokerInfo,i=[];(o.forEach((function(e){var t=e.tinyID,o=e.clientTime,s=e.random,r=e.sequence,c={conversationID:"".concat(S.CONV_GROUP).concat(n),ID:"".concat(t,"-").concat(o,"-").concat(s),revoker:a.revoker,revokeReason:a.reason||"",revokerInfo:{userID:a.revoker,nick:"",avatar:""},sequence:r};i.push(c)})),0!==i.length)&&this._getModule(ao).updateRevokerInfo(i).then((function(e){t._groupModule.emitOuterEvent(E.MESSAGE_REVOKED,e)}))}},{key:"isBroadcastOrNormal",value:function(e){return 3===e||17===e}},{key:"isGroupTip",value:function(e){return 4===e||6===e}},{key:"isGroupSystemNotice",value:function(e){return 5===e}},{key:"restoreGroupTipElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.operatorInfo,n=void 0===t?{}:t,o=e.operatorID,a=e.userIDList,i=void 0===a?[]:a,s=e.operationType;_t(e.groupJoinType)||1!==s&&2!==s||(e.groupJoinType=2===s?0:1);var r=n.userID,c=void 0===r?o:r,u=n.avatar,l=void 0===u?"":u,d=n.nick,p=void 0===d?"":d;e.operatorInfo={userID:c,avatar:l,nick:p};var _=i.map((function(e){return{userID:e}}));return e.memberInfoList=e.memberInfoList||_,e}},{key:"restoreMessageFromSimplified",value:function(e){var n=e.event;if(this.isBroadcastOrNormal(n)&&(e.cloudCustomData=e.cloudCustomData||"",e.elements=e.elements.map((function(e){if(e.type===S.MSG_CUSTOM){var n=e.content,o=void 0===n?{}:n;e.content=t({data:"",description:"",extension:""},o)}return e}))),(this.isGroupTip(n)||this.isGroupSystemNotice(n))&&(e.from=e.from||"@TIM#SYSTEM"),this.isGroupTip(n)){e.elements=this.restoreGroupTipElements(e.elements);var o=e.elements,a=void 0===o?{}:o,i=a.operationType,r=a.operatorInfo;if(1===i){var c=[{userID:(void 0===r?{}:r).userID}];a.memberInfoList=a.memberInfoList||c}}if(this.isGroupSystemNotice(n)){var u=e.elements,l=u.memberInfoList,d=u.operatorInfo;l||(l=void 0===d?{}:d),e.elements.memberInfoList=t({userID:e.elements.operatorID,avatar:"",nick:""},l),e.elements=t({authentication:"",remarkInfo:"",messageKey:1e3*e.time},e.elements);var p=Object.keys(e.elements).filter((function(e){return"operatorInfo"!==e})).reduce((function(n,o){return t(t({},n),{},s({},o,e.elements[o]))}),{});e.elements=p}return e}},{key:"_onGroupDismissed",value:function(e){Je.l("".concat(this._n,"._onGroupDismissed groupID:").concat(e)),this._groupModule.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"_checkMessageStacked",value:function(e){var t="MessageStacked",n=e.length;n>=100&&(this._groupModule.outputWarning(t,n),this._reportMessageStackedCount<5&&(new Xo(t).setNetworkType(this._groupModule.getNetworkType()).setMessage("count:".concat(n," groupID:").concat(m(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{key:"_isMessageSentByCurrentInstance",value:function(e){return!!this._getModule(ao).isMessageSentByCurrentInstance(e)}},{key:"packMessage",value:function(e,t){e.currentUser=this._groupModule.getMyUserID(),e.conversationType=5===t?S.CONV_SYSTEM:S.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new pa(e),o=this.packElements(e,t);return n.setElement(o,this._groupModule.getFileDownloadProxy()),n}},{key:"packElements",value:function(e,n){return 4===n||6===n?(this._updateMemberCountByGroupTips(e),{type:S.MSG_GRP_TIP,content:t(t({},e.elements),{},{groupProfile:e.groupProfile})}):5===n?{type:S.MSG_GRP_SYS_NOTICE,content:t(t({},e.elements),{},{groupProfile:t(t({},e.groupProfile),{},{groupID:e.groupID})})}:e.elements}},{key:"packConversationOption",value:function(e){for(var t=new Map,n=0;n0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,t)}}},{key:"start",value:function(e){if(this._pollingInstanceMap.has(e)){var t=this._pollingInstanceMap.get(e);t.isRunning()||t.start()}else{var n=new Ya({manager:this,groupID:e,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});n.start(),this._pollingInstanceMap.set(e,n),Je.l("".concat(this._n,".start groupID:").concat(e))}}},{key:"handleJoinResult",value:function(e){var t=this;return this._preCheck().then((function(){var n=e.longPollingKey,o=e.group,a=o.groupID;return t._joinedGroupMap.set(a,o),t._groupModule.updateGroupMap([o]),t._groupModule.deleteUnjoinedAVChatRoom(a),t._groupModule.emitGroupListUpdate(!0,!1),mt(n)?Oo({status:st,group:o}):Promise.resolve()}))}},{key:"startRunLoop",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,a=e.startSeq,i=void 0===a?0:a,s=o.groupID;return t._pollingRequestInfoMap.set(s,{key:n,startSeq:i}),t.start(s),t._groupModule.isLoggedIn()?Oo({status:st,group:o}):Oo({status:st})}))}},{key:"_preCheck",value:function(){if(this._getModule(io).isUnlimitedAVChatRoom())return Promise.resolve();if(!this.hasJoinedAVChatRoom())return Promise.resolve();var e=v(this._joinedGroupMap.entries().next().value,2),t=e[0],n=e[1];if(this._groupModule.isLoggedIn()){if(!(n.selfInfo.role===S.GRP_MBR_ROLE_OWNER||n.ownerID===this._groupModule.getMyUserID()))return this._groupModule.quitGroup(t);this._groupModule.deleteLocalGroupAndConversation(t)}else this._groupModule.deleteLocalGroupAndConversation(t);return this.reset(t),Promise.resolve()}},{key:"joinWithoutAuth",value:function(e){var t=this,n=e.groupID,o="".concat(this._n,".").concat("joinWithoutAuth"),a=new Xo("joinWithoutAuth");return this._groupModule.request({protocolName:Uo.APPLY_JOIN_GROUP_NOAUTH,requestData:e}).then((function(e){var i=e.data.longPollingKey;if(t._groupModule.probeNetwork().then((function(e){var t=v(e,2);t[0];var o=t[1];a.setNetworkType(o).setMessage("groupID:".concat(n," longPollingKey:").concat(i)).end(!0)})),mt(i))return Go({code:Ao.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN});Je.l("".concat(o," ok. groupID:").concat(n)),t._getModule(ao).setCompleted("".concat(S.CONV_GROUP).concat(n));var s=new Na({groupID:n});return t.startRunLoop({group:s,longPollingKey:i}),No({status:st})})).catch((function(e){return Je.e("".concat(o," failed. groupID:").concat(n," error:"),e),t._groupModule.probeNetwork().then((function(t){var o=v(t,2),i=o[0],s=o[1];a.setError(e,i,s).setMessage("groupID:".concat(n)).end(!0)})),Go(e)})).finally((function(){t._groupModule.getModule(ro).reportAtOnce()}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return pn(t)||n-t.lastSyncTime>1e3*t.expireTime&&n-t.latestUpdateTime>1e4&&n-t.lastReqTime>3e3?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return No({memberCount:e.memberCount})})).catch((function(e){return Go(e)}))):Oo({memberCount:t.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._n,".").concat("_getGroupOnlineMemberCount");return this._groupModule.requestOnlineCount(e).then((function(o){var a=t._onlineMemberCountMap.get(e)||{},i=o.data,s=i.memberCount,r=void 0===s?0:s,c=i.expireTime,u=void 0===c?t.DEFAULT_EXPIRE_TIME:c;Je.l("".concat(n," ok. groupID:").concat(e," memberCount:").concat(r," expireTime:").concat(u));var l=Date.now();return pn(a)&&(a.lastReqTime=l),t._onlineMemberCountMap.set(e,Object.assign(a,{lastSyncTime:l,latestUpdateTime:l,memberCount:r,expireTime:u})),{memberCount:r}})).catch((function(o){return Je.w("".concat(n," failed. error:"),o),new Xo("_getGroupOnlineMemberCount").setCode(o.code).setMessage("groupID:".concat(e," error:").concat(JSON.stringify(o))).setNetworkType(t._groupModule.getNetworkType()).end(),Promise.reject(o)}))}},{key:"_getModule",value:function(e){return this._groupModule.getModule(e)}},{key:"setPollingInterval",value:function(e){mt(e)||(_t(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:"setPollingIntervalPlus",value:function(e){mt(e)||(_t(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:"setPollingNoMessageCount",value:function(e){mt(e)||(_t(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:"setPollingSimplifiedMessage",value:function(e){mt(e)||"0"!==e&&"1"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(e){var t=e.payload.groupProfile.groupID;Je.l("".concat(this._n,".onAVChatRoomMemberBanned groupID:").concat(t)),this._groupModule.deleteLocalGroupAndConversation(t),this.reset(t)}},{key:"restartPolling",value:function(){Je.l("".concat(this._n,".restartPolling count:").concat(this._pollingInstanceMap.size));var e,t=D(this._pollingInstanceMap.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.stop(),n.start()}}catch(o){t.e(o)}finally{t.f()}}},{key:"getPollingTimerID",value:function(e){if(!this._pollingInstanceMap.has(e))return-1;var t=this._pollingInstanceMap.get(e).getPollingTimerID();return Je.l("".concat(this._n,".getPollingTimerID groupID:").concat(e," timerID:").concat(t)),t}},{key:"reset",value:function(e){if(e){Je.l("".concat(this._n,".reset groupID:").concat(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{Je.l("".concat(this._n,".reset all"));var n,o=D(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;){n.value.stop()}}catch(a){o.e(a)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.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}}]),e}(),Ja=function(){function e(t){o(this,e),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this.isOnline="Online"===t.onlineStatus,this._initMember(t)}return i(e,[{key:"_initMember",value:function(e){this.updateMember(e)}},{key:"updateMember",value:function(e){var t=[null,void 0,"",0,NaN];e.memberCustomField&&Ut(this.memberCustomField,e.memberCustomField),Et(this,e,["memberCustomField","marks","onlineStatus"],t)}},{key:"updateRole",value:function(e){["Owner","Admin","Member"].indexOf(e)<0||(this.role=e)}},{key:"updateMuteUntil",value:function(e){mt(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:"updateNameCard",value:function(e){mt(e)||(this.nameCard=e)}},{key:"updateMemberCustomField",value:function(e){e&&Ut(this.memberCustomField,e)}}]),e}(),za=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupMemberHandler",this.groupMemberListMap=new Map,this.DEFAULT_MEMBER_INFO_FILTER=["Role","JoinTime","NameCard","ShutUpUntil","OnlineStatus"],this._groupModule.getInnerEmitterInstance().on(ha.PROFILE_UPDATED,this._onProfileUpdated,this)}return i(e,[{key:"_onProfileUpdated",value:function(e){for(var t=this,n=e.data,o=function(e){var o=n[e];t.groupMemberListMap.forEach((function(e){e.has(o.userID)&&e.get(o.userID).updateMember({nick:o.nick,avatar:o.avatar})}))},a=0;a100?100:u,memberRoleFilter:t?[t]:void 0,memberInfoFilter:this.DEFAULT_MEMBER_INFO_FILTER};wt({groupID:o})?f.next="".concat(r):(f.offset=r,h=r+u);var m=[];return this._groupModule.request({protocolName:Uo.GET_GROUP_MEMBER_LIST,requestData:f}).then((function(e){var t=e.data,a=t.members,i=t.memberNum,s=t.next,r=void 0===s?void 0:s;return mt(r)||(h=pn(r)?0:r),vt(a)&&0!==a.length?(n._groupModule.hasLocalGroup(o)&&(n._groupModule.getLocalGroupProfile(o).memberNum=i),m=n._updateLocalGroupMemberMap(o,a),n._groupModule.getModule($n).getUserProfile({userIDList:a.map((function(e){return e.userID})),tagList:[Xe.NICK,Xe.AVATAR]})):(h=0,Promise.resolve([]))})).then((function(e){var t=e.data;if(!vt(t)||0===t.length)return Oo({memberList:[],offset:h});var a=t.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));return n._updateLocalGroupMemberMap(o,a),m.length5?i+=" userIDList.length:".concat(e.userIDList.length):i+=" userIDList:".concat(e.userIDList),Je.l("".concat(a," ").concat(i)),e.userIDList.length>50&&(e.userIDList=e.userIDList.slice(0,50));var s=e.groupID,r=e.userIDList,c=this._groupModule.getLocalGroupProfile(s);if(c&&bt(c.type)){var u=Ao.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Go({code:u,message:this._groupModule.getErrorMessage(u,o)})}var l=new Xo(o);return l.setMessage(i),this._getGroupMemberProfileAdvance(t(t({},e),{},{userIDList:r})).then((function(e){var t=e.data.members;return vt(t)&&0!==t.length?(n._updateLocalGroupMemberMap(s,t),n._groupModule.getModule($n).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[Xe.NICK,Xe.AVATAR]})):Oo([])})).then((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));n._updateLocalGroupMemberMap(s,t);var o=r.filter((function(e){return n.hasLocalGroupMember(s,e)})).map((function(e){return n.getLocalGroupMemberInfo(s,e)}));return l.setNetworkType(n._groupModule.getNetworkType()).end(),No({memberList:o})}))}},{key:"addGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("addGroupMember"),o=e.groupID,a=this._groupModule.getLocalGroupProfile(o),i=a.type,s=new Xo("addGroupMember");if(s.setMessage("groupID:".concat(o," groupType:").concat(i)),bt(i)){var r=new ko({code:Ao.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return s.setError(r,!0,this._groupModule.getNetworkType()).end(),Go(r)}return e.userIDList=e.userIDList.map((function(e){return{userID:e}})),Je.l("".concat(n," groupID:").concat(o)),this._groupModule.request({protocolName:Uo.ADD_GROUP_MEMBER,requestData:e}).then((function(o){var i=o.data.members;Je.l("".concat(n," ok"));var r=i.filter((function(e){return 1===e.result})).map((function(e){return e.userID})),c=i.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),u=i.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),l=i.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),d="groupID:".concat(e.groupID,", ")+"successUserIDList:".concat(r,", ")+"failureUserIDList:".concat(c,", ")+"existedUserIDList:".concat(u,", ")+"overLimitUserIDList:".concat(l);return s.setNetworkType(t._groupModule.getNetworkType()).setMoreMessage(d).end(),0===r.length?No({successUserIDList:r,failureUserIDList:c,existedUserIDList:u,overLimitUserIDList:l}):(a.memberCount+=r.length,t._updateConversationGroupProfile(a),No({successUserIDList:r,failureUserIDList:c,existedUserIDList:u,overLimitUserIDList:l,group:a}))})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"deleteGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteGroupMember"),o=e.groupID,a=e.userIDList,i=this._groupModule.getLocalGroupProfile(o);if(mt(i))return Go({code:Ao.CANNOT_FIND_GRP});if(bt(i.type))return this._groupModule.canIUse(K.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(e):this._groupModule.cannotUseCommercialAbility("deleteGroupMember");var s="groupID:".concat(o," ").concat(a.length>5?"userIDList.length:".concat(a.length):"userIDList:".concat(a));Je.l("".concat(n," groupID:").concat(o," userIDList:"),a);var r=new Xo("deleteGroupMember");return r.setMessage(s),this._groupModule.request({protocolName:Uo.DELETE_GROUP_MEMBER,requestData:e}).then((function(){return r.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l("".concat(n," ok")),i.memberCount-=1,t._updateConversationGroupProfile(i),t.deleteLocalGroupMembers(o,a),No({group:i,userIDList:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_updateConversationGroupProfile",value:function(e){this._groupModule.getModule(ao).updateConversationGroupProfile([e])}},{key:"_banAVChatRoomMember",value:function(e){var t=this,n="".concat(this._n,".").concat("_banAVChatRoomMember"),o=e.groupID,a=e.userIDList,i="groupID:".concat(o," ").concat(a.length>5?"userIDList.length:".concat(a.length):"userIDList:".concat(a)),s=new Xo("_banAVChatRoomMember");s.setMessage(i),Je.l("".concat(n," groupID:").concat(o," userIDList:"),a);var r=this._groupModule.getLocalGroupProfile(o);return mt(e.duration)||0===e.duration?Go({code:Ao.BAN_DURATION_INVALID}):this._groupModule.request({protocolName:Uo.BAN_AVCHATROOM_MEMBER,requestData:e}).then((function(){return s.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l("".concat(n," ok")),t.deleteLocalGroupMembers(o,a),No({group:r,userIDList:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"setGroupMemberMuteTime",value:function(e){var t=this,n=e.groupID,o=e.userID,a=e.muteTime,i="".concat(this._n,".").concat("setGroupMemberMuteTime");if(o===this._groupModule.getMyUserID())return Go({code:Ao.CANNOT_MUTE_SELF});var s="groupID:".concat(n," userID:").concat(o," muteTime:").concat(a);Je.l("".concat(i," ").concat(s));var r=new Xo("setGroupMemberMuteTime");return r.setMessage(s),this.modifyGroupMemberInfo({groupID:n,userID:o,muteTime:a}).then((function(e){r.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l("".concat(i," ok"));var o=t._groupModule.getLocalGroupProfile(n);return No({group:o,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Je.e("".concat(i," failed. error:"),e),Go(e)}))}},{key:"setGroupMemberRole",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberRole"),o=e.groupID,a=e.userID,i=e.role,s="groupID:".concat(o," userID:").concat(a," role:").concat(i),r=this._groupModule.getLocalGroupProfile(o);if(!r||r.type===S.GRP_WORK||r.type===S.GRP_AVCHATROOM)return Go({code:Ao.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});if(r&&r.selfInfo.role!==S.GRP_MBR_ROLE_OWNER)return Go({code:Ao.NOT_OWNER});var c=[S.GRP_MBR_ROLE_ADMIN,S.GRP_MBR_ROLE_MEMBER];if(wt({groupID:o})&&c.push(S.GRP_MBR_ROLE_CUSTOM),c.indexOf(i)<0)return Go({code:Ao.INVALID_MEMBER_ROLE});if(a===this._groupModule.getMyUserID())return Go({code:Ao.CANNOT_SET_SELF_MEMBER_ROLE});var u=new Xo("setGroupMemberRole");return u.setMessage(s),Je.l("".concat(n," ").concat(s)),this.modifyGroupMemberInfo({groupID:o,userID:a,role:i}).then((function(e){return u.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l("".concat(n," ok")),No({group:r,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_filterProfanity",value:function(e,t){var n=this._groupModule.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],Z),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:"setGroupMemberNameCard",value:function(e){var t=this,n="setGroupMemberNameCard",o="".concat(this._n,".").concat(n);if(e.nameCard&&!1===this._filterProfanity("nameCard",e))return Go({code:Ao.PROFANITY_FOUND});var a=e.groupID,i=e.userID,s=void 0===i?this._groupModule.getMyUserID():i,r=e.nameCard,c="groupID:".concat(a," userID:").concat(s," nameCard:").concat(r);Je.l("".concat(o," ").concat(c));var u=this._groupModule.getLocalGroupProfile(a);if(u&&bt(u.type)){var l=Ao.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Go({code:l,message:this._groupModule.getErrorMessage(l,n)})}var d=new Xo(n);return d.setMessage(c),this.modifyGroupMemberInfo({groupID:a,userID:s,nameCard:r}).then((function(e){Je.l("".concat(o," ok")),d.setNetworkType(t._groupModule.getNetworkType()).end();var n=t._groupModule.getLocalGroupProfile(a);return s===t._groupModule.getMyUserID()&&n&&n.setSelfNameCard(r),No({group:n,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"setGroupMemberCustomField",value:function(e){var t=this,n="setGroupMemberCustomField",o="".concat(this._n,".").concat(n),a=e.groupID,i=e.userID,s=void 0===i?this._groupModule.getMyUserID():i,r=e.memberCustomField,c="groupID:".concat(a," userID:").concat(s," memberCustomField:").concat(JSON.stringify(r));Je.l("".concat(o," ").concat(c));var u=this._groupModule.getLocalGroupProfile(a);if(u&&bt(u.type)){var l=Ao.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Go({code:l,message:this._groupModule.getErrorMessage(l,n)})}var d=new Xo(n);return d.setMessage(c),this.modifyGroupMemberInfo({groupID:a,userID:s,memberCustomField:r}).then((function(e){d.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l("".concat(o," ok"));var n=t._groupModule.getLocalGroupProfile(a);return No({group:n,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"modifyGroupMemberInfo",value:function(e){var n=this,o=e.groupID,a=e.userID,i=void 0;return Ft(o)&&(o=$t(i=o)),this._groupModule.request({protocolName:Uo.MODIFY_GROUP_MEMBER_INFO,requestData:t(t({},e),{},{groupID:o,topicID:i})}).then((function(){if(n.hasLocalGroupMember(o,a)){var t=n.getLocalGroupMemberInfo(o,a);return mt(e.muteTime)||t.updateMuteUntil(e.muteTime),mt(e.role)||t.updateRole(e.role),mt(e.nameCard)||t.updateNameCard(e.nameCard),mt(e.memberCustomField)||t.updateMemberCustomField(e.memberCustomField),t}var i=n._groupModule.getLocalGroupProfile(o);if(i&&!bt(i.type))return n.getGroupMemberProfile({groupID:o,userIDList:[a]}).then((function(e){return v(e.data.memberList,1)[0]}))}))}},{key:"markGroupMemberList",value:function(e){var t=this,n="".concat(this._n,".").concat("markGroupMemberList"),o=e.groupID,a=e.markType,i=e.enableMark,s=e.userIDList,r=void 0===s?[]:s,c="groupID:".concat(o," markType:").concat(a," enableMark:").concat(i," userIDList count:").concat(r.length);Je.l("".concat(n," ").concat(c));var u=2,l=[];!0===i&&(u=1);var d=m(r);r.length>500&&(d=r.slice(0,500),Je.w("".concat(n," ").concat(an(500)))),d.forEach((function(e){l.push({userID:e,markType:[a]})})),d=null;var p=new Xo("markGroupMemberList");return p.setMessage(c),this._groupModule.request({protocolName:Uo.MARK_AVCHATROOM_MEMBER_INFO,requestData:{groupID:o,operationType:u,memberList:l}}).then((function(e){var o=e.data.memberList,a=void 0===o?[]:o,i=[],s=[];a.length===r.length?i.push.apply(i,m(r)):(a.forEach((function(e){i.push(e.userID)})),r.forEach((function(e){i.includes(e)||s.push(e)})));var c="success count:".concat(i.length," fail count:").concat(s.length);return p.setNetworkType(t._groupModule.getNetworkType()).setMessage(c).end(),Je.l("".concat(n," ok. ").concat(c)),No({successUserIDList:i,failureUserIDList:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_getGroupMemberProfileAdvance",value:function(e){return this._groupModule.request({protocolName:Uo.GET_GROUP_MEMBER_PROFILE,requestData:t(t({},e),{},{memberInfoFilter:e.memberInfoFilter?e.memberInfoFilter:this.DEFAULT_MEMBER_INFO_FILTER})})}},{key:"_updateLocalGroupMemberMap",value:function(e,t){var n=this;return vt(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new Ja(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:"deleteLocalGroupMembers",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:"getLocalGroupMemberInfo",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:"setLocalGroupMember",value:function(e,t){if(this.groupMemberListMap.has(e))this.groupMemberListMap.get(e).set(t.userID,t);else{var n=(new Map).set(t.userID,t);this.groupMemberListMap.set(e,n)}}},{key:"getLocalGroupMemberList",value:function(e){return this.groupMemberListMap.get(e)}},{key:"hasLocalGroupMember",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:"hasLocalGroupMemberMap",value:function(e){return this.groupMemberListMap.has(e)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),e}(),Xa=1,Qa=15,Za=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupSystemNoticeHandler",this.pendencyMap=new Map}return i(e,[{key:"onNewGroupSystemNotice",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=e.isInstantMessage;Je.d("".concat(this._n,".onReceiveSystemNotice count:").concat(t.length));var a=this.newSystemNoticeStoredAndSummary({notifiesList:t,isInstantMessage:o}),i=a.eventDataList,s=a.result;i.length>0&&(this._groupModule.getModule(ao).onNewMessage({conversationOptionsList:i,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:s,isInstantMessage:o}));o?s.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,s):!0===n&&this._clearGroupSystemNotice()}},{key:"newSystemNoticeStoredAndSummary",value:function(e){var n=e.notifiesList,o=e.isInstantMessage,a=null,i=n.length,s=0,r=[],c={conversationID:S.CONV_SYSTEM,unreadCount:0,type:S.CONV_SYSTEM,subType:null,lastMessage:null};for(s=0;s0?[c]:[],result:r}}},{key:"_clearGroupSystemNotice",value:function(){var e=this;this._getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set("".concat(t.from,"_").concat(t.groupID,"_").concat(t.to),t)}));var n=e._groupModule.getModule(ao).getLocalMessageList(S.CONV_SYSTEM),o=[];n.forEach((function(t){var n=t.payload,a=n.operatorID,i=n.operationType,s=n.groupProfile;if(i===Xa){var r="".concat(a,"_").concat(s.groupID,"_").concat(s.to),c=e.pendencyMap.get(r);c&&_t(c.handled)&&0!==c.handled&&o.push(t)}})),e.deleteGroupSystemNotice({messageList:o})}))}},{key:"deleteGroupSystemNotice",value:function(e){var t=this,n="".concat(this._n,".deleteGroupSystemNotice");return vt(e.messageList)&&0!==e.messageList.length?(Je.l("".concat(n," ")+e.messageList.map((function(e){return e.ID}))),this._groupModule.request({protocolName:Uo.DELETE_GROUP_SYSTEM_NOTICE,requestData:{messageListToDelete:e.messageList.map((function(e){return{from:S.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){Je.l("".concat(n," ok"));var o=t._groupModule.getModule(ao);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),No()})).catch((function(e){return Je.e("".concat(n," error:"),e),Go(e)}))):Oo()}},{key:"_getPendencyList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,o=void 0===n?void 0:n,a=t.startTime,i=void 0===a?0:a,s=t.limit,r=void 0===s?20:s;return this._groupModule.request({protocolName:Uo.GET_GROUP_PENDENCY,requestData:{type:o,startTime:i,limit:r,handleAccount:this._groupModule.getMyUserID()}}).then((function(t){var n=t.data.pendencyList;return 0!==t.data.nextStartTime?e._getPendencyList({startTime:t.data.nextStartTime}).then((function(e){return[].concat(m(n),m(e))})):n}))}},{key:"getGroupApplicationList",value:function(){var e=this;return this._getPendencyList().then((function(t){return e._getPendencyList({type:S.GRP_COMMUNITY}).then((function(n){return t.push.apply(t,m(n)),e._handlePendencyResult(t)})).catch((function(n){return e._handlePendencyResult(t)}))}))}},{key:"_handlePendencyResult",value:function(e){var t=this,n=[];return e.forEach((function(e){t.pendencyMap.set("".concat(e.from,"_").concat(e.groupID,"_").concat(e.to),e),0===e.handled&&n.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})})),Oo({applicationList:n})}},{key:"_onReceivedGroupSystemNotice",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:break;case 2:t._onApplyGroupRequestAgreed(e);break;case 3:break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 6:break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._groupModule.onAVChatRoomMemberBanned(e)}}))}},{key:"_onApplyGroupRequestAgreed",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;if(n){t._groupModule.updateGroupMap([n]);var o=!n.isSupportTopic;t._groupModule.emitGroupListUpdate(!0,o)}}))}},{key:"_onMemberKicked",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onGroupDismissed",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t);var n=this._groupModule._AVChatRoomHandler;n&&n.checkJoinedAVChatRoomByID(t)&&n.reset(t)}},{key:"_onInviteGroup",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;n&&(t._groupModule.updateGroupMap([n]),t._groupModule.emitGroupListUpdate())}))}},{key:"_onQuitGroup",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onSetManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,a=this._groupModule.getGroupMemberHandler().getLocalGroupMemberInfo(o,n);a&&a.updateRole(S.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,a=this._groupModule.getGroupMemberHandler().getLocalGroupMemberInfo(o,n);a&&a.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.messageRemindType;this._groupModule.getModule(ao).onGroupMessageRemindTypeUpdated({groupID:t,messageRemindType:n})}},{key:"_handleTopicSystemNotice",value:function(e){var t=e.groupProfile,n=t.groupID,o=t.topicID,a=e.elements,i=a.operationType,s=a.topicIDList,r=a.messageRemindType,c=this._groupModule.getModule(oo);17===i?c.onTopicCreated({groupID:n,topicID:o}):18===i?c.onTopicDeleted({groupID:n,topicIDList:s}):20===i&&c.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:r})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),e}(),$a=["relayFlag"],ei=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n="GroupModule",t._commonGroupHandler=new Pa(g(t)),t._groupAttributesHandler=new xa(g(t)),t._groupCountersHandler=new Ka(g(t)),t._AVChatRoomHandler=new ja(g(t)),t._groupTipsHandler=new Ga(g(t)),t._groupSystemNoticeHandler=new Za(g(t)),t._groupMemberHandler=new za(g(t)),t.groupMap=new Map,t._unjoinedAVChatRoomList=new Map,t._receiptDetailCompleteMap=new Map,t._onlineMemberCountMap=new Map,t._timeoutIDs=[],t.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("polling_interval"),t=this.getCloudConfig("polling_interval_plus"),n=this.getCloudConfig("polling_no_msg_count"),o=this.getCloudConfig("polling_simplified_msg"),a=this.getCloudConfig("paging_grp_count");Je.l("".concat(this._n,"._onCloudConfigUpdated pollingInterval:").concat(e)+" pollingIntervalPlus:".concat(t," pollingNoMessageCount:").concat(n)+" pollingSimplifiedMessage:".concat(o," pagingGroupCount:").concat(a)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n),this._AVChatRoomHandler.setPollingSimplifiedMessage(o),this._commonGroupHandler.setPagingGroupCount(a)}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:"guardForAVChatRoom",value:function(e){var t=this;if(e.conversationType===S.CONV_GROUP){var n=Ft(e.to)?$t(e.to):e.to;return this.hasLocalGroup(n)?Oo():this.getGroupProfile({groupID:n}).then((function(o){var a=o.data.group.type;if(Je.l("".concat(t._n,".guardForAVChatRoom. groupID:").concat(n," type:").concat(a)),a===S.GRP_AVCHATROOM){var i=Ao.MSG_SEND_FAIL_NOT_IN_AVCHATROOM;return Go(new ko({code:i,message:t.getErrorMessage(i,e.from,n),data:{message:e}}))}return Oo()}))}return Oo()}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"onNewGroupMessage",value:function(e){this._commonGroupHandler.onNewGroupMessage(e)}},{key:"updateNextMessageSeq",value:function(e){var t=this;if(vt(e)){var n=this.getModule(oo);e.forEach((function(e){var o=e.conversationID.replace(S.CONV_GROUP,"");Ft(o)&&n.updateLastMessage(o,e.lastMessage),t.groupMap.has(o)&&(t.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)}))}}},{key:"onNewGroupTips",value:function(e){this._groupTipsHandler.onNewGroupTips(e)}},{key:"onGroupMessageRevoked",value:function(e){this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:"onNewGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:"onGroupMessageReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){var n=e.elements.groupMessageReadNotice;if(!mt(n)){var o=t.getModule(ao);n.forEach((function(e){var n=e.groupID,a=e.topicID,i=void 0===a?void 0:a,s=e.lastMessageSeq;Je.d("".concat(t._n,".onGroupMessageReadNotice groupID:").concat(n," lastMessageSeq:").concat(s));var r="".concat(S.CONV_GROUP).concat(n),c=!0;pn(i)||(r="".concat(S.CONV_GROUP).concat(i),c=!1),o.updateIsReadAfterReadReport({conversationID:r,lastMessageSeq:s}),o.updateUnreadCount(r,c),o.clearGroupAtInfoList(r,c)}))}}))}},{key:"onReadReceiptList",value:function(e){var t=this;Je.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(e)),e.dataList.forEach((function(e){var n=e.groupProfile,o=e.elements,a=n.groupID,i=t.getModule(ao),s=o.readReceiptList;i.updateReadReceiptInfo({groupID:a,readReceiptList:s})}))}},{key:"onGroupMessageModified",value:function(e){Je.d("".concat(this._n,".onGroupMessageModified options:"),JSON.stringify(e));var n=this.getModule(ao);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:S.CONV_GROUP,to:e.topicID?e.topicID:e.groupID}))}))}},{key:"deleteGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:"initGroupMap",value:function(e){this.groupMap.set(e.groupID,new Na(e))}},{key:"clearGroupMap",value:function(){this.groupMap.clear()}},{key:"deleteGroup",value:function(e){this.groupMap.delete(e)}},{key:"updateGroupMap",value:function(e){var t,n=this,o=this.getModule(ao);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new Na(e)),o.deleteGroupRoamingMessageInfo(t))}));var a,i=this.getMyUserID(),s=D(this.groupMap);try{for(s.s();!(a=s.n()).done;){var r=v(a.value,2)[1];r.selfInfo.userID=i,"Owner"===r.selfInfo.role&&(r.ownerID=i)}}catch(c){s.e(c)}finally{s.f()}}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return m(this.groupMap.values())}},{key:"getLocalGroupProfile",value:function(e){return this.groupMap.get(e)}},{key:"sortLocalGroupList",value:function(){var e=m(this.groupMap).filter((function(e){var t=v(e,2);return t[0],!pn(t[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(m(e))}},{key:"updateGroupLastMessage",value:function(e){this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:"emitGroupListUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();if(e&&this.emitOuterEvent(E.GROUP_LIST_UPDATED),t){var o=JSON.parse(JSON.stringify(n)),a=this.getModule(ao);a.updateConversationGroupProfile(o)}}},{key:"getMyNameCardByGroupID",value:function(e){var t=this.getLocalGroupProfile(e);return t?t.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return this._commonGroupHandler.isPagingGetCompleted()}},{key:"getMessageRemindType",value:function(e){var t=this;if(vt(e)&&0!==e.length){var n=e.filter((function(e){return!bt(t.getLocalGroupProfile(e).type)}));0!==n.length&&(Je.l("".concat(this._n,".getMessageRemindType groupIDList:").concat(n)),this.getGroupProfileAdvance({groupIDList:n,responseFilter:{memberInfoFilter:["MsgFlag"]}}).then((function(e){var n=e.data.successGroupList,o=t.getModule(ao);n.forEach((function(e){o.onGroupMessageRemindTypeUpdated({groupID:e.groupID,messageRemindType:vt(e.members)?e.members[0].messageRemindType:""})}))})))}}},{key:"getGroupList",value:function(){return this._commonGroupHandler.getGroupList()}},{key:"syncCommunityWithTopic",value:function(){return this._commonGroupHandler.syncGroupList(!0)}},{key:"getGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupProfile"),o=new Xo("getGroupProfile"),a=e.groupID,i=e.groupCustomFieldFilter;Je.l("".concat(n," groupID:").concat(a));var s={groupIDList:[a],responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],groupCustomFieldFilter:i,memberInfoFilter:["Role","JoinTime","MsgSeq","MsgFlag","NameCard"]}};return this.getGroupProfileAdvance(s).then((function(e){var i,s=e.data,r=s.successGroupList,c=s.failureGroupList;if(Je.l("".concat(n," ok")),c.length>0)return Go(c[0]);(bt(r[0].type)&&!t.hasLocalGroup(a)?i=new Na(r[0]):(t.updateGroupMap(r),i=t.getLocalGroupProfile(a)),i.isSupportTopic)||t.getModule(ao).updateConversationGroupProfile([i]);return o.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(a," type:").concat(i.type," muteAllMembers:").concat(i.muteAllMembers," ownerID:").concat(i.ownerID)).end(),No({group:i})})).catch((function(a){return t.probeNetwork().then((function(t){var n=v(t,2),i=n[0],s=n[1];o.setError(a,i,s).setMessage("groupID:".concat(e.groupID)).end()})),Je.e("".concat(n," failed. error:"),a),Go(a)}))}},{key:"getGroupProfileAdvance",value:function(e){var n="".concat(this._n,".getGroupProfileAdvance"),o=e.groupIDList;vt(o)&&o.length>50&&(this.outputWarning("GetGroupProfileLimit"),o.length=50);var a=[],i=[];o.forEach((function(e){wt({groupID:e})?i.push(e):a.push(e)}));var s=[];if(a.length>0){var r=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:a}));s.push(r)}if(i.length>0){var c=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:i,relayFlag:a.length>0}));s.push(c)}return Promise.all(s).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,m(e.successGroupList)),n.push.apply(n,m(e.failureGroupList))})),No({successGroupList:t,failureGroupList:n})})).catch((function(e){return Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_getGroupProfileAdvance",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,a=_(e,$a);return this.request({protocolName:Uo.GET_GROUP_PROFILE,requestData:a}).then((function(e){Je.l("".concat(t._n,"._getGroupProfileAdvance ok. options:"),a);var n=e.data.groups;return{successGroupList:n.filter((function(e){return mt(e.errorCode)||0===e.errorCode})),failureGroupList:n.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new ko({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&wt({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Go(t)}))}},{key:"createGroup",value:function(e){var n=this,o=[S.GRP_PUBLIC,S.GRP_WORK,S.GRP_MEETING,S.GRP_AVCHATROOM,S.GRP_COMMUNITY],a="".concat(this._n,".").concat("createGroup"),i=e.type,s=e.groupID;if(e.name&&!1===this._filterProfanity("name",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Go({code:Ao.PROFANITY_FOUND});if(!o.includes(i))return Go({code:Ao.ILLEGAL_GRP_TYPE});if(!wt({type:i})){if(!pn(s)&&wt({groupID:s}))return Go({code:Ao.ILLEGAL_GRP_ID});e.isSupportTopic=void 0}if(bt(i)&&!mt(e.memberList)&&e.memberList.length>0&&(e.memberList=void 0),this._canIUseJoinOption(i)||mt(e.joinOption)||(e.joinOption=void 0),wt({type:i})){if(!pn(s)&&!wt({groupID:s}))return Go({code:Ao.ILLEGAL_GRP_ID});e.isSupportTopic=!0===e.isSupportTopic?1:0}var r=new Xo("createGroup");Je.l("".concat(a," options:"),e);var c=null,u=[];return this.request({protocolName:Uo.CREATE_GROUP,requestData:t(t({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(o){var i=o.data,s=i.groupID,l=i.overLimitUserIDList,d=void 0===l?[]:l;c=s,u=d;var p="groupType:".concat(e.type," groupID:").concat(s," overLimitUserIDList:").concat(d);if(r.setNetworkType(n.getNetworkType()).setMessage(p).end(),Je.l("".concat(a," ok. ").concat(p)),e.type===S.GRP_AVCHATROOM)return n.getGroupProfile({groupID:s});if(e.type===S.GRP_COMMUNITY&&1===e.isSupportTopic)return n.getGroupProfile({groupID:s});pn(e.memberList)||pn(d)||(e.memberList=e.memberList.filter((function(e){return-1===d.indexOf(e.userID)}))),n.updateGroupMap([t(t({},e),{},{groupID:s})]);var _=n.getModule(Qn),g="",h=0;e.type===S.GRP_COMMUNITY?(g=n.isIntl()?"Create Community":"创建社群",h=1):g=n.isIntl()?"Create Group":"创建群组";var f=n.getModule($n).getMyNick(),v=_.createCustomMessage({to:s,conversationType:S.CONV_GROUP,payload:{data:JSON.stringify({businessID:"group_create",content:g,cmd:h,opUser:f||n.getMyUserID(),version:4})}});return _.sendMessageInstance(v),n.emitGroupListUpdate(),n.getGroupProfile({groupID:s})})).then((function(e){var t=e.data.group,n=t.selfInfo,o=n.nameCard,a=n.joinTime;return t.updateSelfInfo({nameCard:o,joinTime:a,messageRemindType:S.MSG_REMIND_ACPT_AND_NOTE,role:S.GRP_MBR_ROLE_OWNER}),No({group:t,overLimitUserIDList:u})})).catch((function(o){if(r.setMessage("groupType:".concat(e.type)),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],a=t[1];r.setError(o,n,a).end()})),10010===o.code||10007===o.code){n._silentlyGetGroupProfile(o.code,c),n.updateGroupMap([t(t({},e),{},{groupID:c})]);var i=n.getLocalGroupProfile(c);return i.selfInfo.role=S.GRP_MBR_ROLE_OWNER,No({group:i,overLimitUserIDList:u})}return Je.e("".concat(a," failed. error:"),o),Go(o)}))}},{key:"dismissGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("dismissGroup"),o="groupID:".concat(e);if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===S.GRP_WORK)return Go(new ko({code:Ao.CANNOT_DISMISS_WORK}));var a=new Xo("dismissGroup");return a.setMessage(o),Je.l("".concat(n," ").concat(o)),this.request({protocolName:Uo.DISMISS_GROUP,requestData:{groupID:e}}).then((function(){return a.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),No({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"updateGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("updateGroupProfile");if(this.hasLocalGroup(e.groupID)){var o=this.getLocalGroupProfile(e.groupID).type;this._canIUseJoinOption(o)||mt(e.joinOption)||(Je.w("".concat(n," joinOption is unavailable for Work/Meeting/AVChatRoom")),e.joinOption=void 0)}if(mt(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers="On":e.muteAllMembers="Off"),e.name&&!1===this._filterProfanity("name",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Go({code:Ao.PROFANITY_FOUND});var a=new Xo("updateGroupProfile");return a.setMessage(JSON.stringify(e)),Je.l("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:Uo.UPDATE_GROUP_PROFILE,requestData:e}).then((function(){(a.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(n," ok")),t.hasLocalGroup(e.groupID))&&t.groupMap.get(e.groupID).updateGroup(e);return No({group:t.groupMap.get(e.groupID)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.l("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],Q),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:"joinGroup",value:function(e){var t=this,n=e.groupID,o=e.type,a="".concat(this._n,".joinGroup");if(o===S.GRP_WORK)return Go({code:Ao.CANNOT_JOIN_WORK});if(this.deleteUnjoinedAVChatRoom(n),this.hasLocalGroup(n)){if(!this.isLoggedIn())return Oo({status:S.JOIN_STATUS_ALREADY_IN_GROUP});var i=new Xo("applyJoinGroup");return this.getGroupProfile({groupID:n}).then((function(){return i.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," joinedStatus:").concat(S.JOIN_STATUS_ALREADY_IN_GROUP)).end(),Oo({status:S.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(o){return i.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," unjoined")).end(),Je.w("".concat(a," ").concat(n," was unjoined, now join!")),t.groupMap.delete(n),t.applyJoinGroup(e)}))}return Je.l("".concat(a," groupID:").concat(n)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:"applyJoinGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("applyJoinGroup"),a=e.groupID;if(!pn(e.applyMessage)&&!1===this._filterProfanity("applyMessage",e))return Go({code:Ao.PROFANITY_FOUND});var i=new Xo("applyJoinGroup"),s=t({},e),r=this.canIUse(K.AVCHATROOM_HISTORY_MSG);return r&&(s.historyMessageFlag=1),this.getModule(ao).deleteTopicRoamingMessageInfo(a),this.request({protocolName:Uo.APPLY_JOIN_GROUP,requestData:s}).then((function(e){var t=e.data,s=t.joinedStatus,c=t.longPollingKey,u=t.startSeq,l=t.avChatRoomFlag,d=t.avChatRoomKey,p=t.messageList,_="groupID:".concat(a," joinedStatus:").concat(s," longPollingKey:").concat(c," startSeq:").concat(u)+" avChatRoomFlag:".concat(l," canGetAVChatRoomHistoryMessage:").concat(r,",")+" history message count:".concat(pn(p)?0:p.length);switch(i.setNetworkType(n.getNetworkType()).setMessage("".concat(_)).end(),Je.l("".concat(o," ok. ").concat(_)),s){case rt:return No({status:rt});case st:return n.getGroupProfile({groupID:a}).then((function(e){var t=e.data.group;return n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:c,startSeq:u,avChatRoomKey:d,messageList:p})})).catch((function(e){if(10010===e.code||10007===e.code){n._silentlyGetGroupProfile(e.code,a);var t=new Na({groupID:a});return n.updateGroupMap([t]),n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:c,startSeq:u,avChatRoomKey:d,messageList:p})}return Je.e("".concat(o," failed. error:"),e),Go(e)}));default:var g=new ko({code:Ao.JOIN_GRP_FAIL});return Je.e("".concat(o," failed. error:"),g),Go(g)}})).catch((function(e){return i.setMessage("groupID:".concat(a)),n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"_handleJoinResult",value:function(e){var t,n=this,o=e.group,a=e.avChatRoomFlag,i=e.longPollingKey,s=e.startSeq,r=e.avChatRoomKey,c=e.messageList,u=o.groupID;return 1===a?(this.getModule(ao).setCompleted("".concat(S.CONV_GROUP).concat(u)),this._groupAttributesHandler.initGroupAttributesCache({groupID:u,avChatRoomKey:r}),this._groupCountersHandler.initGroupCountersCache({groupID:u,avChatRoomKey:r}),(t=mt(i)?this._AVChatRoomHandler.handleJoinResult({group:o}):this._AVChatRoomHandler.startRunLoop({group:o,longPollingKey:i,startSeq:s})).then((function(){n._onAVChatRoomHistoryMessage(c,u)})),t):(this.emitGroupListUpdate(!0,!1),No({status:st,group:o}))}},{key:"quitGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("quitGroup"),o="groupID:".concat(e);Je.l("".concat(n," ").concat(o));var a=this.checkJoinedAVChatRoomByID(e);if(!a&&!this.hasLocalGroup(e))return Go({code:Ao.MEMBER_NOT_IN_GRP});if(a&&!this.isLoggedIn())return Je.l("".concat(n," anonymously ok. ").concat(o)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),Oo({groupID:e});var i=new Xo("quitGroup");return i.setMessage(o),this.request({protocolName:Uo.QUIT_GROUP,requestData:{groupID:e}}).then((function(){return i.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),a&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),No({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"searchGroupByID",value:function(e){var t=this,n="".concat(this._n,".").concat("searchGroupByID"),o={groupIDList:[e]},a=new Xo("searchGroupByID");return a.setMessage("groupID:".concat(e)),Je.l("".concat(n," groupID:").concat(e)),this.request({protocolName:Uo.SEARCH_GROUP,requestData:o}).then((function(e){var o=e.data.groupProfile;if(0!==o[0].errorCode)throw new ko({code:o[0].errorCode,message:o[0].errorInfo});return a.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(n," ok")),No({group:new Na(o[0])})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"changeGroupOwner",value:function(e){var t=this,n="".concat(this._n,".").concat("changeGroupOwner");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===S.GRP_AVCHATROOM)return Go({code:Ao.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(e.newOwnerID===this.getMyUserID())return Go({code:Ao.CANNOT_CHANGE_OWNER_TO_SELF});var o=new Xo("changeGroupOwner");return o.setMessage("groupID:".concat(e.groupID," newOwnerID:").concat(e.newOwnerID)),Je.l("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:Uo.CHANGE_GROUP_OWNER,requestData:e}).then((function(){o.setNetworkType(t.getNetworkType()).end(),Je.l("".concat(n," ok"));var a=e.groupID,i=e.newOwnerID;t.groupMap.get(a).ownerID=i;var s=t._groupMemberHandler.getLocalGroupMemberList(a);if(s instanceof Map){var r=s.get(t.getMyUserID());mt(r)||(r.updateRole("Member"),t.groupMap.get(a).selfInfo.role="Member");var c=s.get(i);mt(c)||c.updateRole("Owner")}return t.emitGroupListUpdate(!0,!1),No({group:t.groupMap.get(a)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"getGroupApplicationList",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){var t,n,o,a,i,s=this,r="".concat(this._n,".").concat("handleGroupApplication"),c=e.handleAction,u=e.handleMessage,l=e.message,d=e.application;l?(t=l.payload.operatorID,n=l.payload.groupProfile.groupID,o=l.payload.authentication,a=l.payload.messageKey):d&&(t=d.applicant,n=d.groupID,o=d.authentication,a=d.messageKey);var p=Uo.HANDLE_GROUP_APPLICATION;d&&2===d.applicationType&&(p=Uo.HANDLE_INVITE_JOIN_GROUP,i=d.userID);var _=new Xo("handleGroupApplication");return _.setMessage("groupID:".concat(n)),Je.l("".concat(r," groupID:").concat(n)),this.request({protocolName:p,requestData:{handleAction:c,handleMessage:u,applicant:t,invitee:i,groupID:n,authentication:o,messageKey:a}}).then((function(){return _.setNetworkType(s.getNetworkType()).end(),Je.l("".concat(r," ok")),l&&s._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),No({group:s.getLocalGroupProfile(n)})})).catch((function(e){return s.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];_.setError(e,o,a).end()})),Je.e("".concat(r," failed. error"),e),Go(e)}))}},{key:"handleGroupInvitation",value:function(e){var n=this,o="".concat(this._n,".").concat("handleGroupInvitation"),a=e.message.payload,i=a.groupProfile.groupID,s=a.authentication,r=a.messageKey,c=a.operatorID,u=e.handleAction,l=new Xo("handleGroupInvitation");return l.setMessage("groupID:".concat(i," inviter:").concat(c," handleAction:").concat(u)),Je.l("".concat(o," groupID:").concat(i," inviter:").concat(c," handleAction:").concat(u)),this.request({protocolName:Uo.HANDLE_GROUP_INVITATION,requestData:t(t({},e),{},{inviter:c,groupID:i,authentication:s,messageKey:r})}).then((function(){return l.setNetworkType(n.getNetworkType()).end(),Je.l("".concat(o," ok")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),No({group:n.getLocalGroupProfile(i)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setError(e,o,a).end()})),Je.e("".concat(o," failed. error"),e),Go(e)}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._n,".getGroupOnlineMemberCount"),o=this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e),a=this.hasLocalGroup(e);if(Je.l("".concat(n," groupID:").concat(e," isAVChatRoom:").concat(o," has:").concat(a)),o)return this._AVChatRoomHandler.getGroupOnlineMemberCount(e);if(!a)return Oo({memberCount:0});var i=Date.now();if(this._onlineMemberCountMap.has(e)){var s=this._onlineMemberCountMap.get(e);if(i-s.lastReqTime<=6e4)return Oo({memberCount:s.memberCount});s.lastReqTime=i}return this.requestOnlineCount(e).then((function(o){var a=o.data.memberCount,i=void 0===a?0:a;return t._onlineMemberCountMap.set(e,{lastReqTime:Date.now(),memberCount:i}),Je.l("".concat(n," ok. groupID:").concat(e," memberCount:").concat(i)),Oo({memberCount:i})})).catch((function(e){return Je.w("".concat(n," failed. error:"),e),Promise.reject(e)}))}},{key:"requestOnlineCount",value:function(e){return this.request({protocolName:Uo.GET_ONLINE_MEMBER_NUM,requestData:{groupID:e}})}},{key:"hasLocalGroup",value:function(e){return this.groupMap.has(e)}},{key:"deleteLocalGroupAndConversation",value:function(e){var t=this.checkJoinedAVChatRoomByID(e);(Je.l("".concat(this._n,".deleteLocalGroupAndConversation isJoinedAVChatRoom:").concat(t)),t)&&this.getModule(ao).deleteLocalConversation("".concat(S.CONV_GROUP).concat(e));if(wt({groupID:e})){var n=this.getLocalGroupProfile(e);if(n&&!0===n.isSupportTopic)this.getModule(oo).deleteTopicListInCommunity(e)}this._deleteLocalGroup(e),this._onlineMemberCountMap.delete(e),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(e){this.groupMap.delete(e),this._groupMemberHandler.deleteGroupMemberList(e)}},{key:"sendMessage",value:function(e,t){if(vt(e._receiverList)&&e._receiverList.length>0&&!this.canIUse(K.MSG_TO_SPECIFIED_GRP_MBR))return this.cannotUseCommercialAbility("group direct messages");var n=this.createGroupMessagePack(e,t);return this.request(n)}},{key:"createGroupMessagePack",value:function(e,t){var n=null;t&&t.offlinePushInfo&&(n=t.offlinePushInfo);var o="";gt(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push("NoUnread"),!0===r&&a.push("NoLastMsg"),!0===c&&a.push("NoMsgCheck")}var u=void 0;vt(e._receiverList)&&e._receiverList.length>0&&(u=e._receiverList,e._receiverList.length>50&&(u=e._receiverList.slice(0,50),this.outputWarning("ReceiverListLimit")));var l=this.isOnlineMessage(e,t)?1:0,d=e.getGroupAtInfoList(),p={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==S.MSG_TEXT||pn(d)?void 0:d,onlineOnlyFlag:l,clientTime:e.clientTime,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:0===l?a:void 0,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:u,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0};return Ft(e.to)&&(p.groupID=$t(e.to),p.topicID=e.to),{protocolName:Uo.SEND_GROUP_MESSAGE,tjgID:this.generateTjgID(e),requestData:p}}},{key:"_isVoipPush",value:function(e){var t=void 0;return mt(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:"revokeMessage",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Ft(e.to)&&(t.groupID=$t(e.to),t.topicID=e.to),this.request({protocolName:Uo.REVOKE_GROUP_MESSAGE,requestData:t})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;Je.l("".concat(this._n,".deleteMessage groupID:").concat(t," count:").concat(n.length));var o={groupID:t,deleter:this.getMyUserID(),keyList:n};return Ft(t)&&(o.groupID=$t(t),o.topicID=t),this.request({protocolName:Uo.DELETE_GROUP_MESSAGE,requestData:o})}},{key:"modifyRemoteMessage",value:function(e){var t=e.to,n=e.sequence,o=e.payload,a=e.type,i=e.version,s=void 0===i?0:i,r=e.cloudCustomData,c=t,u=void 0;Ft(t)&&(c=$t(t),u=t);var l=void 0;return tn(a)&&(l=[]).push({type:a,content:o}),this.request({protocolName:Uo.MODIFY_GROUP_MESSAGE,requestData:{groupID:c,topicID:u,sequence:n,version:s,elements:l,cloudCustomData:r}})}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessage"),o=e.conversationID,a=e.groupID,i=e.sequence,s=new Xo("getGroupRoamingMessages"),r=0,c=void 0;return Ft(a)&&(a=$t(c=a)),this._computeLastSequence({groupID:a,topicID:c,sequence:i}).then((function(e){return r=e,Je.l("".concat(n," groupID:").concat(a," startSequence:").concat(r)),t.request({protocolName:Uo.GET_GROUP_ROAMING_MESSAGE,requestData:{groupID:a,count:21,sequence:r,topicID:c}})})).then((function(e){var i=e.data,u=i.messageList,l=i.complete,d=i.invisibleSequenceList,p=void 0===d?[]:d,_=e.data.nextSequence,g=void 0===_?0:_;mt(u)?Je.l("".concat(n," ok. complete:").concat(l," nextSequence:").concat(g," but messageList is undefined!")):Je.l("".concat(n," ok. complete:").concat(l," nextSequence:").concat(g," count:").concat(u.length)),s.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(a," topicID:").concat(c," startSequence:").concat(r," complete:").concat(l," nextSequence:").concat(g)).end();var h=t.getModule(ao),f=[];return pn(u)?g>=1&&h.updateRoamingMessageSequence(o,g):(h.updateRoamingMessageSequence(o,g),f=h.onRoamingMessage(u,o),h.updateIsRead(o),h.patchConversationLastMessage(o)),(2===l||g<1)&&(h.setCompleted(o),g=""),Je.l("".concat(n," nextReqID:").concat(g,", stored message count:").concat(f.length,", invisible sequence count:").concat(p.length)),{nextReqID:g+"",storedMessageList:f}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];s.setError(e,o,i).setMessage("groupID:".concat(a," topicID:").concat(c," startSequence:").concat(r)).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_getGroupIDOfMessage",value:function(e){return e.conversationID.replace(S.CONV_GROUP,"")}},{key:"getReadReceiptList",value:function(e){var t=this,n="".concat(this._n,".").concat("getReadReceiptList"),o=this._getGroupIDOfMessage(e[0]),a=this.getMyUserID(),i=e.filter((function(e){return e.from===a&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));if(Je.l("".concat(n," groupID:").concat(o," sequenceList:").concat(JSON.stringify(i))),0===i.length)return Oo({messageList:e});var s=new Xo("getReadReceiptList");return s.setMessage("groupID:".concat(o)),this.request({protocolName:Uo.GET_READ_RECEIPT,requestData:{groupID:o,sequenceList:i}}).then((function(t){s.end(),Je.l("".concat(n," ok"));var o=t.data.readReceiptList;return vt(o)&&o.forEach((function(t){e.forEach((function(e){0===t.code&&t.sequence===e.sequence&&(e.readReceiptInfo.readCount=t.readCount,e.readReceiptInfo.unreadCount=t.unreadCount)}))})),No({messageList:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"sendReadReceipt",value:function(e){var t=this,n="".concat(this._n,".").concat("sendReadReceipt"),o=this._getGroupIDOfMessage(e[0]),a=new Xo("sendReadReceipt");a.setMessage("groupID:".concat(o));var i=this.getMyUserID(),s=e.filter((function(e){return e.from!==i&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));return 0===s.length?Go({code:Ao.READ_RECEIPT_MSG_LIST_EMPTY}):(Je.l("".concat(n,". sequenceList:").concat(JSON.stringify(s))),this.request({protocolName:Uo.SEND_READ_RECEIPT,requestData:{groupID:o,sequenceList:s}}).then((function(e){return a.end(),Je.l("".concat(n," ok")),No()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)})))}},{key:"getReadReceiptDetail",value:function(e){var t=this,n=e.message,o=e.filter,a=e.cursor,i=e.count,s=this._getGroupIDOfMessage(n),r=n.ID,c=n.sequence,u="".concat(this._n,".").concat("getReadReceiptDetail"),l=this._receiptDetailCompleteMap.get(r)||!1,d=0!==o&&1!==o?0:o,p=gt(a)?a:"",_=!_t(i)||i<=0||i>=100?100:i,g="groupID:".concat(s," sequence:").concat(c," cursor:").concat(p," filter:").concat(d," completeFlag:").concat(l);Je.l("".concat(u," ").concat(g));var h={cursor:"",isCompleted:!1,messageID:r,unreadUserIDList:[],readUserIDList:[]},f=new Xo("getReadReceiptDetail");return f.setMessage(g),this.request({protocolName:Uo.GET_READ_RECEIPT_DETAIL,requestData:{groupID:s,sequence:c,flag:d,cursor:p,count:_}}).then((function(e){f.end();var n=e.data,o=n.cursor,a=n.isCompleted,i=n.unreadUserIDList,s=n.readUserIDList;return h.cursor=o,1===a&&(h.isCompleted=!0,t._receiptDetailCompleteMap.set(r,!0)),0===d?h.readUserIDList=s.map((function(e){return e.userID})):1===d&&(h.unreadUserIDList=i.map((function(e){return e.userID}))),Je.l("".concat(u," ok")),No(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];f.setError(e,o,a).end()})),Je.w("".concat(u," failed. error:"),e),Go(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessagesHopping"),o=e.groupID,a=e.count,i=e.sequence,s=e.direction,r=i;if(mt(i)){if(1===s)return Oo({messageList:[],isCompleted:!0,nextMessageSeq:""});if(this.hasLocalGroup(o)){var c=this.getLocalGroupProfile(o).nextMessageSeq;r=c>1?c-1:0}Ft(o)&&(r=0)}else 1===s&&(r=i+a-1);var u=void 0;Ft(o)&&(o=$t(u=o));var l="".concat(u?"topicID:".concat(u):"groupID:".concat(o)," sequence:").concat(i," direction:").concat(s);Je.l("".concat(n," ").concat(l));var d=new Xo("getGroupRoamingMessagesHopping");return this.request({protocolName:Uo.GET_GROUP_ROAMING_MESSAGE,requestData:{groupID:o,topicID:u,count:a,sequence:r}}).then((function(o){var a=o.data,r=a.messageList,c=a.complete,u="complete:".concat(c," count:").concat(r?r.length:0);if(Je.l("".concat(n," ok. ").concat(u)),d.setNetworkType(t.getNetworkType()).setMessage("".concat(l," ").concat(u)).end(),2===c||pn(r)){var p=t._computeResult();return No(p)}var _="".concat(S.CONV_GROUP).concat(e.groupID),g=t.getModule(ao).onRoamingMessage(r,_,!1),h=t._computeResult({direction:s,sequence:i,remoteMessageList:r,processedMessageList:g});return No(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],r=n[1];d.setError(e,s,r).setMessage("groupID:".concat(o," sequence:").concat(i," count:").concat(a)).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_computeResult",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:""};if(mt(e))return t.isCompleted=!0,t;var n=e.direction,o=e.sequence,a=e.remoteMessageList,i=void 0===a?[]:a,s=e.processedMessageList,r=void 0===s?[]:s,c=i.length;return 1===n?(t.nextMessageSeq=i[0].sequence+1,r.forEach((function(e){e.sequence>=o&&t.messageList.push(e)})),0===t.messageList.length&&i[0].sequence0?Promise.resolve(a):mt(o)?this.getGroupLastSequence(t):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupLastSequence"),o=new Xo("getGroupLastSequence"),a=0,i="",s="groupID:".concat(e);if(this.hasLocalGroup(e)){var r=this.getLocalGroupProfile(e),c=r.lastMessage;if(c.lastSequence>0&&!1===c.onlineOnlyFlag)return a=c.lastSequence,i="".concat(s,", ").concat(a," from group.lastMessage.lastSequence"),Je.l("".concat(n," ").concat(i)),o.setNetworkType(this.getNetworkType()).setMessage(i).end(),Promise.resolve(a);if(r.nextMessageSeq>1)return a=r.nextMessageSeq-1,i="".concat(s,", ").concat(a," from group.nextMessageSeq"),Je.l("".concat(n," ").concat(i)),o.setNetworkType(this.getNetworkType()).setMessage(i).end(),Promise.resolve(a)}var u=this.getModule(ao).getLocalConversation("GROUP".concat(e));if(u&&u.lastMessage.lastSequence&&!1===u.lastMessage.onlineOnlyFlag)return a=u.lastMessage.lastSequence,i="".concat(s,", ").concat(a," from conversation.lastMessage.lastSequence"),Je.l("".concat(n," ").concat(i)),o.setNetworkType(this.getNetworkType()).setMessage(i).end(),Promise.resolve(a);var l={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}};return this.getGroupProfileAdvance(l).then((function(e){var r=e.data.successGroupList;return pn(r)?Je.w("".concat(n," ").concat(s,", empty successGroupList")):(a=r[0].nextMessageSeq-1,i="".concat(s,", ").concat(a," from remote"),Je.l("".concat(n," ").concat(i))),o.setNetworkType(t.getNetworkType()).setMessage(i).end(),a})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).setMessage(s).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"isMessageFromOrToAVChatroom",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.hasJoinedAVChatRoom()}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler.getJoinedAVChatRoom()}},{key:"isOnlineMessage",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:"_canIUseOnlineOnlyFlag",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==S.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(e,n){if(!pn(e)){Je.l("".concat(this._n,"._onAVChatRoomHistoryMessage groupID:").concat(n," count:").concat(e.length));var o=[];e.forEach((function(e){o.push(t(t({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(o,n)}}},{key:"onAVChatRoomMessage",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";this._AVChatRoomHandler.onMessage(e,t)}},{key:"onAVChatRoomMemberBanned",value:function(e){this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:"getGroupSimplifiedInfo",value:function(e){var t=this,n=new Xo("getGroupSimplifiedInfo"),o={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["Type","Name"]}};return this.getGroupProfileAdvance(o).then((function(o){var a=o.data.successGroupList;return n.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(e," type:").concat(a[0].type)).end(),a[0]})).catch((function(o){t.probeNetwork().then((function(t){var a=v(t,2),i=a[0],s=a[1];n.setError(o,i,s).setMessage("groupID:".concat(e)).end()}))}))}},{key:"setUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:"isUnjoinedAVChatRoom",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:"isGroupAttributesUpdatedNotice",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:"isMessageFromTopic",value:function(e,t){return 2===e&&!pn(t)}},{key:"isMessageFromCommunityOfTopic",value:function(e,t){return 2===e&&pn(t)}},{key:"getMessageExtensions",value:function(e,t){return Je.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.request({protocolName:Uo.GET_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Je.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n)),this.request({protocolName:Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"_genNotifyReqList",value:function(e){for(var t=[],n=0,o=e.length;n0&&t.getGroupNotify(a);var s="nextGroupIDList.length:".concat(a.length);a.length<=10&&(s="nextGroupIDList:".concat(JSON.stringify(a))),Je.l("".concat(n," ").concat(s))})).catch((function(e){Je.e("".concat(n," failed. error:"),e)}))}},{key:"_genRevokedInfos",value:function(e){var n=e.notifyList,o=e.groupID,a=[];return vt(n)&&n.forEach((function(e){a.push({groupID:o,sequence:e.sequence,random:e.random,revokerInfo:t({},e.revokerInfo)})})),a}},{key:"_getGroupLastRevokedTime",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:"_setGroupLastRevokedTime",value:function(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}},{key:"isGroupCountersNotice",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:"setGroupCounters",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:"getGroupMemberHandler",value:function(){return this._groupMemberHandler}},{key:"getGroupMemberList",value:function(e){return this._groupMemberHandler.getGroupMemberList(e)}},{key:"getGroupMemberProfile",value:function(e){return this._groupMemberHandler.getGroupMemberProfile(e)}},{key:"addGroupMember",value:function(e){return this._groupMemberHandler.addGroupMember(e)}},{key:"deleteGroupMember",value:function(e){return this._groupMemberHandler.deleteGroupMember(e)}},{key:"setGroupMemberMuteTime",value:function(e){return this._groupMemberHandler.setGroupMemberMuteTime(e)}},{key:"setGroupMemberRole",value:function(e){return this._groupMemberHandler.setGroupMemberRole(e)}},{key:"setGroupMemberNameCard",value:function(e){return this._groupMemberHandler.setGroupMemberNameCard(e)}},{key:"setGroupMemberCustomField",value:function(e){return this._groupMemberHandler.setGroupMemberCustomField(e)}},{key:"markGroupMemberList",value:function(e){return this._groupMemberHandler.markGroupMemberList(e)}},{key:"modifyGroupMemberInfo",value:function(e){return this._groupMemberHandler.modifyGroupMemberInfo(e)}},{key:"restartPolling",value:function(){this._AVChatRoomHandler.restartPolling()}},{key:"getPollingTimerID",value:function(e){if(!e)return-1;var t=this.getLocalGroupProfile(e);return t&&bt(t.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}},{key:"_canIUseJoinOption",value:function(e){return function(e){return e===S.GRP_PUBLIC}(e)||wt({type:e})}},{key:"_silentlyGetGroupProfile",value:function(e,t){var n=setTimeout(this.getGroupProfile.bind(this,{groupID:t}),3e3);this._timeoutIDs.push(n),Je.l("".concat(this._n,"._silentlyGetGroupProfile errorCode:").concat(e," groupID:").concat(t," timeoutIDs:").concat(this._timeoutIDs))}},{key:"_clearTimeoutIDs",value:function(){this._timeoutIDs.forEach((function(e){clearTimeout(e)})),this._timeoutIDs=[]}},{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()}}]),a}(Po),ti=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],ni=function(e,t){return pn(e)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",avatar:"",version:0,cloudCustomData:"",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",payload:e.payload||null,type:e.type||"",messageForShow:en(e.type,e.payload,t),nick:e.nick||"",avatar:e.avatar||"",version:e.version||0,cloudCustomData:e.cloudCustomData||"",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}},oi=function(){function e(t,n){o(this,e),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=ni(t.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:"",excludedUnreadSequenceList:void 0},this._initTopic(t)}return i(e,[{key:"_initTopic",value:function(e){for(var t in e)ti.indexOf(t)<0||("selfInfo"===t?this.updateSelfInfo(e[t]):this[t]="muteAllMembers"===t?1===e[t]:e[t])}},{key:"updateUnreadCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.unreadCount=e}},{key:"updateNextMessageSeq",value:function(e){this.nextMessageSeq=e}},{key:"updateLastMessage",value:function(e){this.lastMessage=ni(e)}},{key:"updateGroupAtInfoList",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:"updateTopic",value:function(e){mt(e.selfInfo)||this.updateSelfInfo(e.selfInfo),mt(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),Et(this,e,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(e){return 0!==Et(this.selfInfo,e,[],[""])}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),e}(),ai=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n="TopicModule",t._topicMap=new Map,t._getTopicTimeMap=new Map,t.TOPIC_CACHE_TIME=300,t.TOPIC_LAST_ACTIVE_TIME=3600,t.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("topic_cache_time"),t=this.getCloudConfig("topic_last_active_time");mt(e)||(this.TOPIC_CACHE_TIME=Number(e)),mt(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:"onTopicCreated",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOuterEvent(E.TOPIC_CREATED,e)}},{key:"onTopicDeleted",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOuterEvent(E.TOPIC_DELETED,e)}},{key:"onTopicMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=e.messageRemindType,a=this.getLocalTopic(t,n);if(a){var i=a.updateSelfInfo({messageRemindType:o});i&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:a}),Je.d("".concat(this._n,".onTopicMessageRemindTypeUpdated topicID:").concat(n)+" messageRemindType:".concat(o," isTopicUpdated:").concat(i))}}},{key:"onTopicProfileUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=this.getLocalTopic(t,n);o&&(o.updateTopic(e),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:o}))}},{key:"onConversationProxy",value:function(e){var t=e.topicID,n=e.unreadCount,o=e.groupAtInfoList,a=$t(t),i=this.getLocalTopic(a,t),s=!1;i&&(mt(n)||i.unreadCount===n||(i.updateUnreadCount(n),s=!0),mt(o)||(i.updateGroupAtInfoList(o),s=!0)),s&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:a,topic:i})}},{key:"onMessageSent",value:function(e){var t=e.groupID,n=e.topicID,o=e.lastMessage,a=this.getLocalTopic(t,n);a&&(a.nextMessageSeq+=1,a.updateLastMessage(o),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:a}))}},{key:"onMessageModified",value:function(e){var t=e.to,n=e.time,o=e.sequence,a=e.elements,i=e.cloudCustomData,s=e.messageVersion,r=$t(t),c=this.getLocalTopic(r,t);if(c){var u=c.lastMessage;Je.d("".concat(this._n,".onMessageModified topicID:").concat(t," lastMessage:"),JSON.stringify(u),"options:",JSON.stringify(e)),u&&(null===u.payload||u.lastTime===n&&u.lastSequence===o&&u.version!==s)&&(u.type=a[0].type,u.payload=a[0].content,u.messageForShow=en(u.type,u.payload,this.isIntl()),u.cloudCustomData=i,u.version=s,u.lastSequence=o,u.lastTime=n,this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:r,topic:c}))}}},{key:"onMessageRevoked",value:function(e){var t=this;if(0!==e.length){var n=null,o=null,a=!1;e.forEach((function(e){var i=e.to;o=$t(i),(n=t.getLocalTopic(o,i))&&(n.reduceUnreadCount()&&(a=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),a=!0))})),a&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:o,topic:n})}}},{key:"isLastMessageRevoked",value:function(e){var t=e.topicID,n=e.sequence,o=$t(t),a=this.getLocalTopic(o,t),i=!1;return a&&(i=a.isLastMessageRevoked({sequence:n})),i}},{key:"getJoinedCommunityList",value:function(){return this.getModule(to).syncCommunityWithTopic()}},{key:"createTopicInCommunity",value:function(e){var n=this,o="".concat(this._n,".").concat("createTopicInCommunity"),a=e.topicID;if(!mt(a)&&!Ft(a))return Go({code:Ao.ILLEGAL_TOPIC_ID});if(e.topicName&&!1===this._filterProfanity("topicName",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Go({code:Ao.PROFANITY_FOUND});var i=new Xo("createTopicInCommunity");return this.request({protocolName:Uo.CREATE_TOPIC,requestData:t({},e)}).then((function(a){var s=a.data.topicID;return i.setMessage("topicID:".concat(s)).setNetworkType(n.getNetworkType()).end(),Je.l("".concat(o," ok. topicID:").concat(s)),n._updateTopicMap([t(t({},e),{},{topicID:s})]),No({topicID:s})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"deleteTopicFromCommunity",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteTopicFromCommunity"),o=e.groupID,a=e.topicIDList,i=void 0===a?[]:a,s=new Xo("deleteTopicFromCommunity");return s.setMessage("groupID:".concat(o," topicIDList:").concat(i)),this.request({protocolName:Uo.DELETE_TOPIC,requestData:{groupID:o,topicIDList:i}}).then((function(e){var a=e.data.resultList,i=[],r=[];(void 0===a?[]:a).forEach((function(e){var t=e.topicID,n=e.errorCode,o=e.errorInfo;0===n?i.push({topicID:t}):r.push({topicID:t,code:n,message:o})}));var c="success count:".concat(i.length,", fail count:").concat(r.length);return s.setMoreMessage(c).setNetworkType(t.getNetworkType()).end(),Je.l("".concat(n," ok. ").concat(c)),i.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),No({successTopicList:i,failureTopicList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"updateTopicProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("updateTopicProfile");if(Je.l("".concat(o," options:"),e),e.topicName&&!1===this._filterProfanity("topicName",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Go({code:Ao.PROFANITY_FOUND});var a=new Xo("updateTopicProfile");return a.setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),mt(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?"On":"Off"),this.request({protocolName:Uo.UPDATE_TOPIC_PROFILE,requestData:t({},e)}).then((function(){return a.setNetworkType(n.getNetworkType()).end(),Je.l("".concat(o," ok")),n._updateTopicMap([e]),No({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"getTopicList",value:function(e){var n=this,o="".concat(this._n,".").concat("getTopicList"),a=e.groupID,i=e.topicIDList,s=void 0===i?[]:i,r=0===s.length,c=new Xo("getTopicList");if(c.setMessage("groupID:".concat(a)),this._getTopicTimeMap.has(a)){var u=this._getTopicTimeMap.get(a),l=u.isGetAll,d=u.time;if((l||!l&&!r)&&Date.now()-d<1e3*this.TOPIC_CACHE_TIME){var p=this._getLocalTopicList(a,s);if(r||p.length===s.length)return c.setNetworkType(this.getNetworkType()).setMoreMessage("from cache, topic count:".concat(p.length)).end(),Je.l("".concat(o," groupID:").concat(a," from cache, topic count:").concat(p.length)),Oo({successTopicList:p,failureTopicList:[]})}}return this.request({protocolName:Uo.GET_TOPIC_LIST,requestData:{groupID:a,topicIDList:s}}).then((function(e){var i=e.data.topicInfoList,s=[],u=[],l=[];(void 0===i?[]:i).forEach((function(e){var n=e.topic,o=e.selfInfo,a=e.errorCode,i=e.errorInfo,r=n.topicID;0===a?(s.push(t(t({},n),{},{selfInfo:o})),u.push(r)):l.push({topicID:r,code:a,message:i})})),n._updateTopicMap(s),n._handleTopicAtInfo(s);var d="success count:".concat(u.length,", fail count:").concat(l.length);c.setNetworkType(n.getNetworkType()).setMoreMessage(d).end(),Je.l("".concat(o," groupID:").concat(a," from remote, ").concat(d));var p=[];return pn(u)||(n._getTopicTimeMap.set(a,{time:Date.now(),isGetAll:r}),p=n._getLocalTopicList(a,u)),No({successTopicList:p,failureTopicList:l})})).catch((function(e){return n.probeNetwork(e).then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"hasLocalTopic",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:"getLocalTopic",value:function(e,t){var n=null;return this._topicMap.has(e)&&(n=this._topicMap.get(e).get(t)),n}},{key:"_getLocalTopicList",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._topicMap.get(e),o=[];return n&&(o=m(n.values())),0===t.length?o:o.filter((function(e){return t.includes(e.topicID)}))}},{key:"_deleteLocalTopic",value:function(e,t){this._topicMap.has(e)&&this._topicMap.get(e).has(t)&&(this._topicMap.get(e).delete(t),Je.l("".concat(this._n,"._deleteLocalTopic groupID:").concat(e," topicID:").concat(t)))}},{key:"_updateTopicMap",value:function(e){var t=this,n=[];(e.forEach((function(e){var o=e.groupID,a=e.topicID,i=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(a)?(i=t._topicMap.get(o).get(a)).updateTopic(e):(t._getTopicLastMessage(e),i=new oi(e,t.isIntl()),t._topicMap.get(o).set(a,i));var s=t._computeUnreadCount(i);i.updateUnreadCount(s),n.push({conversationID:"".concat(S.CONV_GROUP).concat(a),type:S.CONV_TOPIC,unreadCount:s})})),n.length>0)&&this.getModule(ao).updateTopicConversation(n)}},{key:"resetGetTopicTime",value:function(e){var t=this;mt(e)?m(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:"getTopicListOnReconnected",value:function(){var e=this,t=m(this._topicMap.keys()),n=[],o=this.getModule(ao);t.forEach((function(t){var a=[],i=e._getLocalTopicList(t);o.deleteTopicRoamingMessageInfo(t),i.forEach((function(t){var n=t.lastMessage.lastTime,o=void 0===n?0:n;Date.now()-1e3*o<1e3*e.TOPIC_LAST_ACTIVE_TIME&&a.push(t.topicID)})),a.length>0&&n.push({groupID:t,topicIDList:a})})),Je.l("".concat(this._n,".getTopicListOnReconnected. active community count:").concat(n.length)),this._relayGetTopicList(n)}},{key:"_relayGetTopicList",value:function(e){var t=this;if(0!==e.length){var n=e.shift(),o=n.topicIDList.length>5?"topicIDList.length:".concat(n.topicIDList.length):"topicIDList:".concat(n.topicIDList),a=new Xo("relayGetTopicList");a.setMessage(o),Je.l("".concat(this._n,"._relayGetTopicList. ").concat(o)),this.getTopicList(n).then((function(){a.setNetworkType(t.getNetworkType()).end(),t._relayGetTopicList(e)})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),o=t[0],i=t[1];a.setError(n,o,i).end()})),t._relayGetTopicList(e)}))}}},{key:"_handleTopicAtInfo",value:function(e){var n=this;0!==e.length&&e.forEach((function(e){var o=e.groupID,a=e.topicID,i=e.groupAtInfoList,s=[];mt(i)||(i.forEach((function(e){s.push(t(t({},e),{},{groupID:o,topicID:a}))})),n.getModule(ao).onNewGroupAtTips({dataList:s}))}))}},{key:"_getTopicLastMessage",value:function(e){if(!mt(e.lastMsg)){var t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:"",nick:e.lastMsg.nick,avatar:e.lastMsg.avatar,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:2===e.lastMsg.isPlaceMessage,revoker:pn(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker};e.lastMessage=t}}},{key:"deleteTopicListInCommunity",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.getModule(ao);n.forEach((function(n){var a=n.topicID;t._deleteLocalTopic(e,a),t._getTopicTimeMap.delete(e),o.deleteLocalConversation("".concat(S.CONV_GROUP).concat(a))}))}},{key:"_computeUnreadCount",value:function(e){var t=e.selfInfo,n=t.excludedUnreadSequenceList,o=t.readedSequence,a=e.nextMessageSeq-e.selfInfo.readedSequence-1;if(vt(n)){var i=0;n.forEach((function(t){t>=o&&t<=e.nextMessageSeq-1&&(i+=1)})),i>=1&&(a-=i)}return a<0?0:a}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],Q),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:"updateLastMessage",value:function(e,t){var n=$t(e),o=this.getLocalTopic(n,e);if(o){var a=t.sequence+1;o.updateNextMessageSeq(a),o.updateLastMessage(t),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:n,topic:o})}}},{key:"getMessageExtensions",value:function(e,t){Je.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t));var n=$t(e.to);return this.request({protocolName:Uo.GET_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:n,topicID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;Je.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n));var o=$t(e.to);return this.request({protocolName:Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:o,topicID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),a}(Po),ii=function(){function e(t){o(this,e),this._userModule=t,this._n="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}return i(e,[{key:"setExpirationTime",value:function(e){this.expirationTime=e}},{key:"getUserProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getUserProfile"),o=e.userIDList;e.fromAccount=this._userModule.getMyAccount(),o.length>100&&(Je.w("".concat(n," ").concat(an(100))),o.length=100);for(var a,i=[],s=[],r=0,c=o.length;r5?"userIDList.length:".concat(o.length):"userIDList:".concat(o)),this._userModule.request({protocolName:Uo.GET_USER_PROFILE,requestData:e}).then((function(e){d.setNetworkType(t._userModule.getNetworkType()).end(),Je.i("".concat(n," ok"));var o=t._handleResponse(e).concat(s);return No(u?o[0]:o)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"getMyProfile",value:function(){var e=this._userModule.getMyAccount(),t="".concat(this._n,".getMyProfile");if(Je.l("".concat(t," myAccount:").concat(e)),this._fill(),this._contains(e)){var n=this._getProfileFromMap(e);return Je.d("".concat(t," from cache, myProfile:").concat(JSON.stringify(n))),Oo(n)}return this.getUserProfile({fromAccount:e,userIDList:[e],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(e){var t=e.data.userProfileItem;if(!vt(t))return[];for(var n=[],o=Date.now(),a=0,i=t.length;a-1)n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case Xe.NICK:n.nick=t[o].value;break;case Xe.GENDER:n.gender=t[o].value;break;case Xe.BIRTHDAY:n.birthday=t[o].value;break;case Xe.LOCATION:n.location=t[o].value;break;case Xe.SELFSIGNATURE:n.selfSignature=t[o].value;break;case Xe.ALLOWTYPE:n.allowType=t[o].value;break;case Xe.LANGUAGE:n.language=t[o].value;break;case Xe.AVATAR:n.avatar=t[o].value;break;case Xe.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case Xe.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case Xe.LEVEL:n.level=t[o].value;break;case Xe.ROLE:n.role=t[o].value;break;default:Je.w("".concat(this._n,"._getLatestProfileFromResponse unknown tag:"),t[o].tag,t[o].value)}return n}},{key:"updateMyProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("updateMyProfile");if(e.nick&&!1===this._userModule.filterProfanity("nick",e))return Go({code:Ao.PROFANITY_FOUND});if(e.selfSignature&&!1===this._userModule.filterProfanity("selfSignature",e))return Go({code:Ao.PROFANITY_FOUND});var o=new Xo("updateMyProfile");o.setMessage(JSON.stringify(e));var a=(new Ca).validate(e);if(!a.valid)return o.setCode(Ao.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(a.tips)).setNetworkType(this._userModule.getNetworkType()).end(),Je.e("".concat(n," info:").concat(a.tips)),Go({code:Ao.UPDATE_PROFILE_INVALID_PARAM});var i=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&("profileCustomField"===s?e.profileCustomField.forEach((function(e){i.push({tag:e.key,value:e.value})})):i.push({tag:Xe[s.toUpperCase()],value:e[s]}));if(0===i.length){var r=new ko({code:Ao.UPDATE_PROFILE_NO_KEY});return o.setError(r,!0,this._userModule.getNetworkType()).end(),Je.e("".concat(n," failed. error:"),r),Go(r)}var c=this._userModule.getMyAccount();return this._userModule.request({protocolName:Uo.UPDATE_MY_PROFILE,requestData:{fromAccount:c,profileItem:i}}).then((function(a){o.setNetworkType(t._userModule.getNetworkType()).end(),Je.i("".concat(n," ok"));var i=t._update(c,e),s=i.isProfileUpdated,r=i.latestProfile;return!0===s&&t._userModule.emitOuterEvent(E.PROFILE_UPDATED,[r]),Oo(r)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"onProfileModified",value:function(e){var t=e.dataList;if(!pn(t)){var n,o=t.length;Je.d("".concat(this._n,".onProfileModified count:").concat(o," dataList:"),e.dataList);for(var a=[],i=0;i0&&(this._userModule.emitInnerEvent(ha.PROFILE_UPDATED,a),this._userModule.emitOuterEvent(E.PROFILE_UPDATED,a))}}},{key:"_fill",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n0&&(n.lastUpdatedTime=a,o=!0)):(n=new Ca(t),(this._userModule.isMyFriend(e)||e===this._userModule.getMyAccount())&&(n.lastUpdatedTime=a,o=!0,this.accountProfileMap.set(e,n)));return this._flush(e===this._userModule.getMyAccount()),!0===o&&Je.l("".concat(this._n,"._update account:").concat(e," isProfileUpdated:").concat(o)),{isProfileUpdated:o,latestProfile:n}}},{key:"_flush",value:function(e){var t=m(this.accountProfileMap.values()),n=this._userModule.getStorageModule();Je.d("".concat(this._n,"._flush length:").concat(t.length," flushAtOnce:").concat(e)),n.setItem(this.TAG,t,e)}},{key:"_contains",value:function(e){return this.accountProfileMap.has(e)}},{key:"_getProfileFromMap",value:function(e){return this.accountProfileMap.get(e)}},{key:"_getCachedProfiles",value:function(){var e=this._userModule.getStorageModule().getItem(this.TAG);return pn(e)?[]:e}},{key:"onConversationsProfileUpdated",value:function(e){for(var t,n,o,a=[],i=0,s=e.length;i0&&a.push(n)):a.push(t.userID));0!==a.length&&(Je.i("".concat(this._n,".onConversationsProfileUpdated toAccountList:").concat(a)),this.getUserProfile({userIDList:a}))}},{key:"getNickAndAvatarByUserID",value:function(e){if(this._contains(e)){var t=this._getProfileFromMap(e);return{nick:t.nick,avatar:t.avatar}}return{nick:"",avatar:""}}},{key:"getUserNickAndAvatar",value:function(e){var t=this,n=m(new Set(e));Je.l("".concat(this._n,".getUserNickAndAvatar userIDList.length:").concat(e.length," uniqueUserIDList.length:").concat(n.length));var o=[];if(0===e.length)return Promise.resolve(o);var a=this._createUserIDListGroup(n),i=[];return a.forEach((function(e){i.push(t.getUserProfile({userIDList:e}))})),Promise.all(i).then((function(e){return e.forEach((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));o.push.apply(o,m(t))})),o}))}},{key:"_createUserIDListGroup",value:function(e){for(var t=[],n=0;n5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),Je.i("".concat(o," ok")),t._handleResponse(a.resultItem,!0),No(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var o=v(t,2),a=o[0],i=o[1];n.setError(e,a,i).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"_handleResponse",value:function(e,t){if(!pn(e))for(var n,o,a,i=0,s=e.length;i5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),Je.i("".concat(n," ok")),t._handleResponse(a.data.resultItem,!1),No(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"onAccountDeleted",value:function(e){for(var t=0,n=e.length;t0&&(Je.l("".concat(this._n,".onAccountDeleted count:").concat(a," ").concat(a<30?"userIDList:".concat(e):"")),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(e){for(var t,n=[],o=0,a=e.length;o0&&(Je.l("".concat(this._n,".onAccountAdded count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),ci=function(e){var t=String(e).replace(/[=]+$/,""),n="";if(t.length%4==1)return"";for(var o,a,i=0,s=0;a=t.charAt(s++);~a&&(o=i%4?64*o+a:a,i++%4)?n+=String.fromCharCode(255&o>>(-2*i&6)):0)a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(a);try{return decodeURIComponent(escape(n))}catch(r){return""}},ui=function(){function e(t){o(this,e),this._userModule=t,this._n="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return i(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._userModule.getCloudConfig("status_query_count"),t=this._userModule.getCloudConfig("status_sub_count"),n=this._userModule.getCloudConfig("status_unsub_count");Je.l("".concat(this._n,"._onCloudConfigUpdated statusQueryCount:").concat(e," statusSubscribeCount:").concat(t)+" statusUnsubscribeCount:".concat(n)),mt(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),mt(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),mt(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:"onUserStatusUpdated",value:function(e){var t=e.dataList,n=this._userModule.getMyUserID(),o=this._userModule.getModule(io),a=t.map((function(e){var t=e.to,a=e.statusType,i=e.customStatus,s=ci(i);return t===n&&o.setCustomStatus(s),{userID:t,statusType:a,customStatus:s}}));this._userModule.emitOuterEvent(E.USER_STATUS_UPDATED,a)}},{key:"setSelfStatus",value:function(e){var t=this,n="".concat(this._n,".setSelfStatus");if(!1===this._userModule.filterProfanity("customStatus",e))return Go({code:Ao.PROFANITY_FOUND});var o=new Xo("setSelfStatus"),a=e.customStatus;return this._userModule.request({protocolName:Uo.SET_SELF_STATUS,requestData:{customStatus:a}}).then((function(e){return o.setNetworkType(t._userModule.getNetworkType()).setMessage("customStatus:".concat(a)).end(),Je.l("".concat(n," ok. customStatus:").concat(a)),t._userModule.getModule(io).setCustomStatus(a),No({userID:t._userModule.getMyUserID(),statusType:1,customStatus:a})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"getUserStatus",value:function(e){var t=this,n="".concat(this._n,".").concat("getUserStatus"),o=e.userIDList,a=void 0===o?[]:o,i=this._userModule.getMyUserID(),s=m(a),r=void 0,c=s.indexOf(i);if(c>-1){s.splice(c,1);var u=this._userModule.getModule(io).getCustomStatus();r={userID:i,statusType:1,customStatus:u}}if(0===s.length)return Oo({successUserList:[r],failureUserList:[]});if(!this._userModule.canIUse(K.USER_STATUS))return this._userModule.cannotUseCommercialAbility("getUserStatus");s.length>this.MAX_QUERY_USER_COUNT&&(Je.w("".concat(n," ").concat(an(this.MAX_QUERY_USER_COUNT))),s=a.slice(0,this.MAX_QUERY_USER_COUNT));var l=new Xo("getUserStatus");return this._userModule.request({protocolName:Uo.GET_USER_STATUS,requestData:{userIDList:s}}).then((function(e){var o=e.data,i=o.successUserList,s=void 0===i?[]:i,c=o.failureUserList,u=void 0===c?[]:c,d=s.map((function(e){var t=e.userID,n=e.statusType,o=e.customStatus;return{userID:t,statusType:n,customStatus:ci(o)}})),p=u.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,a=e.errorInfo;return{userID:pn(n)?t:n,code:o,message:a}}));mt(r)||d.unshift(r);var _="userID count:".concat(a.length,", success count:").concat(d.length,", fail count:").concat(p.length);return l.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(_)).end(),Je.l("".concat(n," ok. ").concat(_,".")),No({successUserList:d,failureUserList:p})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];l.setMessage("userID count:".concat(a.length)).setError(e,o,i).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"subscribeUserStatus",value:function(e){var t=this,n="subscribeUserStatus";if(!this._userModule.canIUse(K.USER_STATUS))return this._userModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=e.userIDList,i=void 0===a?[]:a,s=m(i);s.length>this.MAX_SUBSCRIBE_USER_COUNT&&(Je.w("".concat(o," ").concat(an(this.MAX_SUBSCRIBE_USER_COUNT))),s=i.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var r=new Xo(n),c="userID count:".concat(i.length);return Je.l("".concat(o," ").concat(c)),this._userModule.request({protocolName:Uo.SUBSCRIBE_USER_STATUS,requestData:{userIDList:s}}).then((function(e){var n=e.data.failureUserList,a=(void 0===n?[]:n).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,a=e.errorInfo;return{userID:pn(n)?t:n,code:o,message:a}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(c," fail count:").concat(a.length)).end(),Je.l("".concat(o," ok. fail count:").concat(a.length,".")),No({failureUserList:a})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setMessage("".concat(c)).setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"unsubscribeUserStatus",value:function(e){var t=this,n="unsubscribeUserStatus";if(!this._userModule.canIUse(K.USER_STATUS))return this._userModule.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=(e||{}).userIDList,i=void 0===a?[]:a,s=m(i);i.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(Je.w("".concat(o," ").concat(an(this.MAX_UNSUBSCRIBE_USER_COUNT))),s=i.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var r=new Xo(n),c="userID count:".concat(i.length);Je.l("".concat(o," ").concat(c));var u={userIDList:s};return 0===s.length&&(u.userIDList=void 0,u.unsubscribeAll=1),this._userModule.request({protocolName:Uo.UNSUBSCRIBE_USER_STATUS,requestData:u}).then((function(e){var n=e.data.failureUserList,a=(void 0===n?[]:n).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,a=e.errorInfo;return{userID:pn(n)?t:n,code:o,message:a}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(c," fail count:").concat(a.length)).end(),Je.l("".concat(o," ok. fail count:").concat(a.length,".")),No({failureUserList:a})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setMessage("".concat(c)).setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),e}(),li=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="UserModule",a._profileHandler=new ii(g(a)),a._blacklistHandler=new ri(g(a)),a._userStatusHandler=new ui(g(a)),a.getInnerEmitterInstance().on(ha.A2KEY_AND_TINYID_UPDATED,a.onContextUpdated,g(a)),a}return i(n,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"mockOnNickAvatarModified",value:function(e,t){Je.l("".concat(this._n,"._mockOnNickAvatarModified nick:").concat(e," avatar:").concat(t)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:Xe.NICK,value:e},{tag:Xe.AVATAR,value:t}]}]})}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(e){var t=e.dataList;if(!pn(t)){var n=[];t.forEach((function(e){e.blackListDelAccount&&n.push.apply(n,m(e.blackListDelAccount))})),n.length>0&&this._blacklistHandler.onAccountDeleted(n);var o=[];t.forEach((function(e){e.blackListAddAccount&&o.push.apply(o,m(e.blackListAddAccount))})),o.length>0&&this._blacklistHandler.onAccountAdded(o)}}},{key:"onConversationsProfileUpdated",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{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.getModule(so)}},{key:"filterProfanity",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],z),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:"isMyFriend",value:function(e){var t=this.getModule(no);return!!t&&t.isMyFriend(e)}},{key:"getUserProfile",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:"getNickAndAvatarByUserID",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:"getUserNickAndAvatar",value:function(e){return this._profileHandler.getUserNickAndAvatar(e)}},{key:"getLocalBlacklist",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return Oo(e)}},{key:"addBlacklist",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:"deleteBlacklist",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:"onUserStatusUpdated",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:"setSelfStatus",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),n}(Po),di=function(){function e(t,n){o(this,e),this._m=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||"",this._userSig=n.userSig||"",this._version="3.2.3",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||"",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy,this._applicationID=0,this._isUsingChatCore=!1}return i(e,[{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:"isSingaporeSite",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7||this._SDKAppID>=172e7&&this._SDKAppID<173e7}},{key:"isKoreaSite",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7||this._SDKAppID>=173e7&&this._SDKAppID<174e7}},{key:"isGermanySite",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7||this._SDKAppID>=174e7&&this._SDKAppID<175e7}},{key:"isIndiaSite",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7||this._SDKAppID>=175e7&&this._SDKAppID<176e7}},{key:"isJapanSite",value:function(){return this._SDKAppID>=6e7&&this._SDKAppID<7e7||this._SDKAppID>=176e7&&this._SDKAppID<177e7}},{key:"isUSASite",value:function(){return this._SDKAppID>=7e7&&this._SDKAppID<8e7||this._SDKAppID>=177e7&&this._SDKAppID<178e7}},{key:"isIndonesiaSite",value:function(){return this._SDKAppID>=8e7&&this._SDKAppID<9e7||this._SDKAppID>=178e7&&this._SDKAppID<179e7}},{key:"isIntl",value:function(){return 0===(e=this._SDKAppID)||e>=2e7&&e<9e7||e>=172e7&&e<179e7;var e}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"isUsingChatCore",value:function(){return this._isUsingChatCore}},{key:"setUsingChatCore",value:function(e){this._isUsingChatCore=e}},{key:"setUserID",value:function(e){this._userID=e}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(e){this._userSig=e}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(e){this._customStatus=e}},{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(e){this._statusInstanceID=e}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(e){this._a2Key=e}},{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(e){this._applicationID=e}},{key:"getApplicationID",value:function(){return this._applicationID}},{key:"_isTUIKit",value:function(){var e=!1,t=!1,n=!1,o=!1,a=[];ce&&(a=Object.keys(le)),ue&&(a=re?Object.keys(uni):Object.keys(window));for(var i=0,s=a.length;i0){for(var u=0,l=c.length;u0&&void 0!==arguments[0]?arguments[0]:0;if(!this.isLoggedIn())return Go({code:Ao.USER_NOT_LOGGED_IN});var n=new Xo("logout");n.setNetworkType(this.getNetworkType()).setMessage("identifier:".concat(this.getMyUserID())).end(!0);var o="".concat(this._n,".logout");return Je.i("".concat(o," type:").concat(t)),0===t&&this._m.setNotReadyReason(Ao.LOGGED_OUT),this.request({protocolName:Uo.LOGOUT,requestData:{type:t}}).then((function(){return e.resetReady(),Oo({})})).catch((function(t){return Je.e("".concat(o," error:"),t),e.resetReady(),Oo({})}))}},{key:"getLoginUser",value:function(){return this.isLoggedIn()?this.getMyUserID():""}},{key:"_fetchCloudControlConfig",value:function(){this.getModule(ho).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")}},{key:"_hello",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:Uo.HELLO,requestData:{isWebUniapp:this._isWebUniapp}}).catch((function(t){Je.w("".concat(e._n,"._hello error:"),t)}))}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(e){var t=0;return pn(this.getModule(io).getSDKAppID())?t=Ao.NO_SDKAPPID:pn(e.userID)?t=Ao.NO_IDENTIFIER:pn(e.userSig)&&(t=Ao.NO_USERSIG),{code:t}}},{key:"_isReactUIKit",value:function(){return ue&&void 0!==window.tencent_cloud_im_csig_react_uikit_23F_xa}},{key:"onMultipleAccountKickedOut",value:function(e){var t=this;new Xo("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),Je.w("".concat(this._n,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_ACCOUNT}),t._m.setNotReadyReason(Ao.KICKED_OUT_MULT_ACCOUNT),t._m.reset()}))}},{key:"onMultipleDeviceKickedOut",value:function(e){var t=this;new Xo("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),Je.w("".concat(this._n,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_DEVICE}),t._m.setNotReadyReason(Ao.KICKED_OUT_MULT_DEVICE),t._m.reset()}))}},{key:"onUserSigExpired",value:function(){new Xo("kickedOut").setNetworkType(this.getNetworkType()).setMessage(S.KICKED_OUT_USERSIG_EXPIRED).end(!0),Je.w("".concat(this._n,".onUserSigExpired userID:").concat(this.getMyUserID())),0!==this.getModule(io).getStatusInstanceID()&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(Ao.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:"onRestApiKickedOut",value:function(e){(new Xo("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),Je.w("".concat(this._n,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),0!==this.getModule(io).getStatusInstanceID())&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_REST_API}),this._m.setNotReadyReason(Ao.KICKED_OUT_REST_API),this._m.reset(),this.getModule(go).onRestApiKickedOut())}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),n}(Po);function gi(){return null}var hi=function(){function e(t){o(this,e),this._m=t,this._n="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}return i(e,[{key:"_errorTolerantHandle",value:function(){ce||!mt(window)&&this._canIUseCookies()||(this.getItem=gi,this.setItem=gi,this.removeItem=gi,this.clear=gi)}},{key:"onCheckTimer",value:function(e){if(e%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{key:"_doFlush",value:function(){try{var e,t=D(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],a=n[1];this._setStorageSync(this._getKey(o),a)}}catch(i){t.e(i)}finally{t.f()}this._storageQueue.clear()}catch(s){Je.w("".concat(this._n,"._doFlush error:"),s)}}},{key:"_getPrefix",value:function(){var e=this._m.getModule(io);return"TIM_".concat(e.getSDKAppID(),"_").concat(e.getUserID(),"_")}},{key:"_getKey",value:function(e){return"".concat(this._getPrefix()).concat(e)}},{key:"getItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(o){return Je.w("".concat(this._n,".getItem error:"),o),{}}}},{key:"setItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n){var a=o?this._getKey(e):e;this._setStorageSync(a,t)}else this._storageQueue.set(e,t)}},{key:"clear",value:function(){try{ce?le.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){Je.w("".concat(this._n,".clear error:"),e)}}},{key:"removeItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(o){Je.w("".concat(this._n,".removeItem error:"),o)}}},{key:"getSize",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"b";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,"leftSize",{enumerable:!0,get:function(){return o.limitSize-o.size}}),ce&&(o.limitSize=1024*le.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(ce){var a=le.getStorageInfoSync(),i=a.keys;i.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}))}else if(this._canIUseCookies())for(var s in localStorage)localStorage.hasOwnProperty(s)&&(o.size+=localStorage.getItem(s).length+s.length);return this._convertUnit(o)}catch(r){Je.w("".concat(this._n," error:"),r)}}},{key:"_convertUnit",value:function(e){var t={},n=e.unit;for(var o in t.unit=n,e)"number"==typeof e[o]&&("kb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024):"mb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024/1024):t[o]=e[o]);return t}},{key:"_setStorageSync",value:function(e,t){ce?ae?my.setStorageSync({key:e,data:t}):le.setStorageSync(e,t):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(t))}},{key:"getStorageSync",value:function(e){return ce?ae?my.getStorageSync({key:e}).data:le.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:"_removeStorageSync",value:function(e){ce?ae?my.removeStorageSync({key:e}):le.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:"_canIUseCookies",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._doFlush()}}]),e}(),fi=function(){function e(t){o(this,e),this._n="SSOLogBody",this._report=[]}return i(e,[{key:"pushIn",value:function(e){Je.d("".concat(this._n,".pushIn"),this._report.length,e),this._report.push(e)}},{key:"backfill",value:function(e){var t;vt(e)&&0!==e.length&&(Je.d("".concat(this._n,".backfill"),this._report.length,e.length),(t=this._report).unshift.apply(t,m(e)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var e=this._report.slice();return this._reset(),e}}]),e}(),vi=function(e){var t=e.getModule(io);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:He()}},mi=function(e){r(a,e);var n=f(a);function a(e){var t;o(this,a),(t=n.call(this,e))._n="EventStatModule",t.TAG="im-ssolog-event",t._reportBody=new fi,t.MIN_THRESHOLD=20,t.MAX_THRESHOLD=100,t.WAITING_TIME=6e4,t.REPORT_LEVEL=[4,5,6],t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._lastReportTime=Date.now();var i=t.getInnerEmitterInstance();return i.on(ha.A2KEY_AND_TINYID_UPDATED,t._onLoginSuccess,g(t)),i.on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:"reportAtOnce",value:function(){this._report()}},{key:"_onLoginSuccess",value:function(){var e=this,t=this.getModule(so),n=t.getItem(this.TAG,!1);!pn(n)&&It(n.forEach)&&(Je.l("".concat(this._n,"._onLoginSuccess. logs count:").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("evt_rpt_threshold"),t=this.getCloudConfig("evt_rpt_waiting"),n=this.getCloudConfig("evt_rpt_level"),o=this.getCloudConfig("evt_rpt_sdkappid_bl"),a=this.getCloudConfig("evt_rpt_tinyid_wl");mt(e)||(this.MIN_THRESHOLD=Number(e)),mt(t)||(this.WAITING_TIME=Number(t)),mt(n)||(this.REPORT_LEVEL=n.split(",").map((function(e){return Number(e)}))),mt(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(",").map((function(e){return Number(e)}))),mt(a)||(this.REPORT_TINYID_WHITELIST=a.split(","))}},{key:"pushIn",value:function(e){e instanceof Xo&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:"onCheckTimer",value:function(){Date.now()e.MAX_THRESHOLD&&e._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{key:"_flushAtOnce",value:function(){var e=this.getModule(so),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o="".concat(this._n,"._flushAtOnce");if(pn(t))Je.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var a=n.concat(t);a.length>this.MAX_THRESHOLD&&(a=a.slice(0,this.MAX_THRESHOLD)),Je.l("".concat(o," count:").concat(a.length)),e.setItem(this.TAG,a,!0,!1)}}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),a}(Po),Mi="none",Ii="online",yi=[Ao.OVER_FREQUENCY_LIMIT,Ao.OPEN_SERVICE_OVERLOAD_ERROR],Ti=function(){function e(t){o(this,e),this._m=t,this._networkType="",this._n="NetMonitorModule",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return i(e,[{key:"start",value:function(){var e=this;ce?(le.getNetworkType({success:function(t){e._networkType=t.networkType||t.subtype||"",t.networkType===Mi?Je.w("".concat(e._n,".start no network, please check!")):Je.i("".concat(e._n,".start networkType:").concat(t.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),le.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=Ii,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback)))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:Ii})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:Mi})}},{key:"_onNetworkStatusChange",value:function(e){var t=e.isConnected,n=e.networkType,o="".concat(this._n,"._onNetworkStatusChange"),a=!1;t?(Je.i("".concat(o," previous:").concat(this._networkType," current:").concat(n)),this._networkType!==n&&(a=!0,this._m.getModule(go).reConnect(!0))):this._networkType!==n&&(a=!0,Je.w("".concat(o," no network, please check!")),this._m.getModule(go).offline());a&&(new Xo("networkChange").setMessage("isConnected:".concat(t," previousNetworkType:").concat(this._networkType," networkType:").concat(n)).end(),this._networkType=n)}},{key:"probe",value:function(e){var t=this;if(!mt(e)&&yi.includes(e.code))return Promise.resolve([!0,this._networkType]);var n="".concat(this._n,".probe");return new Promise((function(e,o){ce?le.getNetworkType({success:function(o){t._networkType=o.networkType,o.networkType===Mi?(Je.w("".concat(n," no network, please check!")),e([!1,o.networkType])):(Je.i("".concat(n," networkType:").concat(o.networkType)),e([!0,o.networkType]))}}):t._networkType===Mi?e([!1,Mi]):e([!0,Ii])}))}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),ce?null!==this._mpNetworkStatusCallback&&(le.offNetworkStatusChange&&(se||ne?le.offNetworkStatusChange(this._mpNetworkStatusCallback):le.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(null!==this._webOnlineCallback&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null))}}]),e}();var Ci=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,o,i,s){if("function"!=typeof o)throw new TypeError("The listener must be a function");var r=new a(o,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],r]:e._events[c].push(r):(e._events[c]=r,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function r(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),r.prototype.eventNames=function(){var e,o,a=[];if(0===this._eventsCount)return a;for(o in e=this._events)t.call(e,o)&&a.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},r.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var a=0,i=o.length,s=new Array(i);a=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:"_getAuthorization",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(!0===e._relayFlag)return Promise.resolve();var t=this.getModule(mo);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(Ho),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(Ho),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(Ho),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(Ho),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var n=this,o=this.getModule(Qn),a=e.getElements()[0],i=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(a.updatePercent(e),It(i.onProgress))try{i.onProgress(e)}catch(t){return Go({code:Ao.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(o){var i=o.location,s=o.fileType,r=o.fileSize,c=o.width,u=o.height,l=o.smallImageUrl,d=o.smallImageWidth,p=o.smallImageHeight,_=o.largeImageUrl,g=o.largeImageWidth,h=o.largeImageHeight,f=o.imageInfoArray,v=n.isPrivateNetWork()?i:Gt(i);a.updateImageFormat(s);var m,M,I={size:r,url:v,width:c,height:u};if(f&&f.length>0)for(var y=0;y=0||Go({code:Ao.MSG_I_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(e){var t=0;return 0===(t=ce?e.size:e.files[0].size)?Go({code:Ao.MSG_F_IS_EMPTY}):tthis.UPLOAD_SIZE_LIMIT.F?this._checkSizeError("F"):0===e.file.files[0].size?Go({code:Ao.MSG_F_IS_EMPTY}):(this._setUploadFileType(Ta),this.uploadByCOS(e))}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError("V"):0===e.file.videoFile.size?Go({code:Ao.MSG_F_IS_EMPTY}):-1===ma.indexOf(e.file.videoFile.type)?Go({code:Ao.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(Ia),ce?this.handleVideoUpload(t(t({},e),{},{file:e.file.videoFile})):ue?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new ko({code:Ao.MSG_V_UPLOAD_FAIL}))}))}))}))}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError("A"):0===e.file.size?Go({code:Ao.MSG_F_IS_EMPTY}):(this._setUploadFileType(ya),this.uploadByCOS(e)):Go({code:Ao.MSG_A_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(e){var t=this;if(!It(this._cosUploadMethod))return this.outputWarning("PluginUndetected"),Go({code:Ao.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var n=new Xo("upload"),o="".concat(this._n,".uploadByCOS"),a=Date.now(),i=this._getFile(e);return new Promise((function(s,r){var c=ce?t._createCosOptionsWXMiniApp(e):t._createCosOptionsWeb(e),u=t;t._cosUploadMethod(c,(function(e,c){var l=Object.create(null);if(c){if(e||vt(c.files)&&c.files[0].error){var d=new ko({code:Ao.MSG_F_UPLOAD_FAIL});return n.setError(d,!0,t.getNetworkType()).end(),Je.l("".concat(o," failed. error:"),c.files[0].error),403===c.files[0].error.statusCode&&(Je.w("".concat(o," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),void r(d)}l.fileName=i.name,l.fileSize=i.size,l.fileType=i.type.slice(i.type.indexOf("/")+1).toLowerCase(),l.location=ce?c.Location:c.files[0].data.Location;var p=Date.now()-a,_=u._formatFileSize(i.size),g=u._formatSpeed(1e3*i.size/p),h="size:".concat(_," time:").concat(p,"ms speed:").concat(g);Je.l("".concat(o," success. name:").concat(i.name," ").concat(h)),s(l);var f=t.getModule(mo);return f.addCost(Ho,p),f.addFileSize(Ho,i.size),void n.setNetworkType(t.getNetworkType()).setMessage(h).end()}var v=new ko({code:Ao.MSG_F_UPLOAD_FAIL});n.setError(v,!0,u.getNetworkType()).end(),Je.w("".concat(o," failed. error:"),e),403===e.statusCode&&(Je.w("".concat(o," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),r(v)}))}))}},{key:"_uploadWithPreSigUrl",value:function(e){var t=this,n="".concat(this._n,"._uploadWithPreSigUrl"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(a,i){var s=new Xo("upload"),r=e.requestSnapshotUrl,c=void 0===r?void 0:r,u=_(e,Di),l=Date.now();t._cosUploadMethod(u,(function(r,d){if(r||403===d.statusCode){s.setError(new ko(r),!0,t.getNetworkType()).end();var p={HttpStatusCode:Ei,CostTime:un(l,!1),error:r,url:e.url};return d.data&&d.data.uploadIP&&(p.uploadIP=d.data.uploadIP),t._uploadSSOLog(p),Je.l("".concat(n," failed, error:"),r),void i(new ko({code:Ao.MSG_F_UPLOAD_FAIL}))}var _=Object.create(null),g=d.data.location||"";t.isPrivateNetWork()||0!==g.indexOf("https://")&&0!==g.indexOf("http://")||(g=g.split("//")[1]),_.fileName=o.name,_.fileSize=o.size,_.fileType=o.type.slice(o.type.indexOf("/")+1).toLowerCase(),_.location=g;var h=un(l,!1),f=t._formatFileSize(o.size),v=t._formatSpeed(1e3*o.size/h),m="size:".concat(f," time:").concat(h,"ms speed:").concat(v," res:").concat(JSON.stringify(d.data));Je.l("".concat(n," ok. name:").concat(o.name," ").concat(m)),s.setNetworkType(t.getNetworkType()).setMessage(m).end();var M={HttpStatusCode:d.statusCode,FileSize:o.size,CostTime:h,url:e.url};d.data&&d.data.uploadIP&&(M.uploadIP=d.data.uploadIP),t._uploadSSOLog(M);var I=t.getModule(mo);I.addCost(Ho,h),I.addFileSize(Ho,o.size);var y=[];if(u.thumbUrl&&u.largeUrl&&y.push.apply(y,[t._getSmallImageInfoByUrl(u.thumbUrl,_),t._getLargeImageInfoByUrl(u.largeUrl,_)]),t.uploadFileType===Ma&&t.isSimpleCos&&(y.push(t._getImageInfoArray(u.downloadUrl,_)),d.data.uploadIP&&y.push(t._getDownloadIP(u.downloadUrl.split("//")[1].split("/")[0],_))),c&&y.push(t._getSnapshotInfoByUrl(c,_)),y.length>0)return Promise.all(y).then((function(){a(_)}));a(_)}))}))}))}},{key:"_getDownloadIP",value:function(e,t){var n="".concat(this._n,"._getDownloadIP"),o=Date.now();return this.request({protocolName:Uo.GET_IP,requestData:{domainName:e}}).then((function(e){if(e.data&&e.data.ip){Je.l("".concat(n," ok. downloadIP:").concat(e.data.ip," cost:").concat(un(o)));var a=t.location.split("/");a[0]=e.data.ip,t.location=a.join("/")}})).catch((function(e){}))}},{key:"_getImageInfoArray",value:function(e,t){var n=this,o="".concat(this._n,"._getImageInfoArray"),a=Date.now();return this.request({protocolName:Uo.GET_IMAGE_INFO,requestData:{imageUrl:e}}).then((function(e){var n=e.data||{};return Je.l("".concat(o," ok. data: ").concat(JSON.stringify(n)," cost:").concat(un(a))),t.imageInfoArray=n.imageInfoArray,n})).catch((function(o){t.imageInfoArray=void 0,n._uploadSSOLog({HttpStatusCode:Si,CostTime:un(a,!1),url:e})}))}},{key:"_uploadSSOLog",value:function(e){if(this.isSimpleCos){var t=new Xo;t.setEventType(18),e.error?t.setError(new ko(e.error),!0,this.getNetworkType()):t.setNetworkType(this.getNetworkType());var n="HttpStatusCode:".concat(e.HttpStatusCode,"|CosRequestId:").concat(e.CosRequestId||"","|")+"FileAlreadyExist:".concat(e.FileAlreadyExist||0,"|FileSize:").concat(e.FileSize||0,"|CostTime:").concat(e.CostTime);e.uploadIP&&(n+="|FinalIP:".concat(e.uploadIP)),t.setMessage("OK").setMoreMessage(e.url).setExtension(n).end()}}},{key:"_getRawOrUploadProxyUrl",value:function(e){var t=this.getModule(io).getFileUploadProxy(),n=e;return t&&(n=e.replace(/^https:\/\/[^/]+/,t)),n}},{key:"_getFile",value:function(e){return vt(e.file.files)||Tt(e.file.files)?e.file.files[0]:e.file}},{key:"_formatFileSize",value:function(e){return e<1024?e+"B":e<1048576?Math.floor(e/1024)+"KB":Math.floor(e/1048576)+"MB"}},{key:"_formatSpeed",value:function(e){return e<=1048576?Xt(e/1024,1)+"KB/s":Xt(e/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(e){var t=this._getFile(e),n=t.name,o=n.slice(n.lastIndexOf(".")),a=this._genFileName("".concat(kt(999999)).concat(o));return{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(a),Body:t}],SliceSize:1048576,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Je.w("onProgress callback error:",n)}},onFileFinish:function(e,t,n){}}}},{key:"_createCosOptionsWXMiniApp",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name),o=t.url;return{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),FilePath:o,onProgress:function(t){if(Je.l(JSON.stringify(t)),"function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Je.w("onProgress callback error:",n)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(e){var t=this,n="",o="",a=0,i=this._getFile(e);if(ce){if(e.message.type===S.MSG_FILE){var s=i.name,r=s.slice(s.lastIndexOf("."));n=this._genFileName("".concat(kt(999999)).concat(r))}else n=this._genFileName(i.name);o=i.url,a=1}else{var c=i.name,u=c.slice(c.lastIndexOf("."));n=this._genFileName("".concat(kt(999999)).concat(u)),o=i,a=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:n,uploadMethod:a,duration:this.duration,userID:e.message.from,conversationType:qt(e.message.conversationID)?1:2}).then((function(a){var i=t.isSimpleCos?a.preSig[0]:a,s=i.uploadUrl,r=i.downloadUrl,c=i.requestSnapshotUrl,u=void 0===c?void 0:c,l=i.thumbUrl,d=i.largeUrl,p=i.fileKey,_=a.uploadIP,g=void 0===_?"":_;return{url:t._getRawOrUploadProxyUrl(s),fileType:t.uploadFileType,fileName:n,resources:o,downloadUrl:r,requestSnapshotUrl:u,thumbUrl:l,largeUrl:d,fileKey:p,uploadIP:!t.isPrivateNetWork()&&g,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Je.w("onProgress callback error:",n),Je.e(n)}}}}))}},{key:"_genFileName",value:function(e){return"".concat(Kt(),"-").concat(e)}},{key:"_setUploadFileType",value:function(e){this.uploadFileType=e}},{key:"_getSnapshotInfoByUrl",value:function(e,t){var n=this,o="_getSnapshotInfoByUrl",a=new Xo(o);return this.request({protocolName:Uo.VIDEO_COVER,requestData:{platform:this.getPlatform(),coverName:this._genFileName(kt(99999)),requestSnapshotUrl:e}}).then((function(e){var i=(e.data||{}).snapshotUrl;return Je.l("".concat(n._n,".").concat(o," ok. snapshotUrl:").concat(i)),a.setMessage("snapshotUrl:".concat(i)).end(),pn(i)?{}:Bt(i).then((function(e){t.snapshotInfo={snapshotUrl:i,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return Je.w("".concat(n._n,".").concat(o," failed. error:"),e),a.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:"_getSmallImageInfoByUrl",value:function(e,t){return Bt(e).then((function(n){t.smallImageUrl=e,t.smallImageWidth=n.width,t.smallImageHeight=n.height}))}},{key:"_getLargeImageInfoByUrl",value:function(e,t){return Bt(e).then((function(n){t.largeImageUrl=e,t.largeImageWidth=n.width,t.largeImageHeight=n.height}))}},{key:"_isEmptyFileList",value:function(e){return!(!Tt(e)||0!==e.length)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset"))}}]),a}(Po),ki=["downloadKey","pbDownloadKey","messageList"],Ai=function(){function e(t){o(this,e),this._n="MergerMessageHandler",this._messageModule=t}return i(e,[{key:"uploadMergerMessage",value:function(e,t){var n=this,o="".concat(this._n,".").concat("uploadMergerMessage");Je.d("".concat(o," message:"),e,"messageBytes:".concat(t));var a=e.payload.messageList,i=a.length,s=new Xo("uploadMergerMessage");return this._messageModule.request({protocolName:Uo.UPLOAD_MERGER_MESSAGE,requestData:{messageList:a}}).then((function(e){Je.d("".concat(o," ok. response:"),e.data);var a=e.data,r=a.pbDownloadKey,c=a.downloadKey,u={pbDownloadKey:r,downloadKey:c,messageNumber:i};return s.setNetworkType(n._messageModule.getNetworkType()).setMessage("".concat(i,"-").concat(t,"-").concat(c)).end(),u})).catch((function(e){throw Je.w("".concat(o," failed. error:"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),e}))}},{key:"downloadMergerMessage",value:function(e){var n=this,o="".concat(this._n,".").concat("downloadMergerMessage");Je.d("".concat(o," message:"),e);var a=e.payload.downloadKey,i=this._messageModule.getFileDownloadProxy(),s=new Xo("downloadMergerMessage");return s.setMessage("downloadKey:".concat(a)),this._messageModule.request({protocolName:Uo.DOWNLOAD_MERGER_MESSAGE,requestData:{downloadKey:a}}).then((function(a){if(Je.d("".concat(o," ok. response:"),a.data),It(e.clearElement)){var r=e.payload;r.downloadKey,r.pbDownloadKey,r.messageList;var c=_(r,ki);e.clearElement(),e.setElement({type:e.type,content:t({messageList:a.data.messageList},c)},i)}else{var u=[];a.data.messageList.forEach((function(e){if(!pn(e)){var t=new ua(e,i);u.push(t)}})),e.payload.messageList=u,e.payload.downloadKey="",e.payload.pbDownloadKey=""}return s.setNetworkType(n._messageModule.getNetworkType()).end(),e})).catch((function(e){throw Je.w("".concat(o," failed. key:").concat(a," error:"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),e}))}},{key:"createMergerMessagePack",value:function(e,t,n){return e.conversationType===S.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:"_createC2CMergerMessagePack",value:function(e,t,n){var o=null;t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly&&(o?o.disablePush=!0:o={disablePush:!0}));var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push("NoUnread"),!0===r&&a.push("NoLastMsg"),!0===c&&a.push("NoMsgCheck")}var u="";gt(e.cloudCustomData)&&e.cloudCustomData.length>0&&(u=e.cloudCustomData);var l=n.pbDownloadKey,d=n.downloadKey,p=n.messageNumber,_=e.payload,g=_.title,h=_.abstractList,f=_.compatibleText,v=this._messageModule.getModule(eo),m=v&&v.isOnlineMessage(e,t)?0:void 0;return{protocolName:Uo.SEND_C2C_MESSAGE,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:d,title:g,abstractList:h,compatibleText:f,messageNumber:p}}],cloudCustomData:u,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,messageControlInfo:0!==m?a:void 0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}},{key:"_createGroupMergerMessagePack",value:function(e,t,n){var o=null;t&&t.offlinePushInfo&&(o=t.offlinePushInfo);var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push("NoUnread"),!0===r&&a.push("NoLastMsg"),!0===c&&a.push("NoMsgCheck")}var u="";gt(e.cloudCustomData)&&e.cloudCustomData.length>0&&(u=e.cloudCustomData);var l=n.pbDownloadKey,d=n.downloadKey,p=n.messageNumber,_=e.payload,g=_.title,h=_.abstractList,f=_.compatibleText,v=this._messageModule.getModule(to),m=v&&v.isOnlineMessage(e,t)?1:0;return{protocolName:Uo.SEND_GROUP_MESSAGE,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:d,title:g,abstractList:h,compatibleText:f,messageNumber:p}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:u,onlineOnlyFlag:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||v.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:0===m?a:void 0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}}]),e}(),Li={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},Ri=[Ao.MSG_ONPROGRESS_FUNCTION_ERROR,Ao.MSG_I_SELECT_F_FIRST,Ao.MSG_I_TYPES_LIMIT,Ao.MSG_F_IS_EMPTY,Ao.MSG_I_SIZE_LIMIT,Ao.MSG_F_SELECT_F_FIRST,Ao.MSG_F_SIZE_LIMIT,Ao.MSG_V_SIZE_LIMIT,Ao.MSG_V_TYPES_LIMIT,Ao.MSG_A_UPLOAD_FAIL,Ao.MSG_A_SIZE_LIMIT,Ao.COS_UNDETECTED];function Oi(e){var t=!1;return Object.values(Li).includes(e)&&(t=!0),(e>=120001&&e<=13e4||e>=10100&&e<=10200)&&(t=!0),t}var Gi=["conversationID","timePosition","timePeriod"],Pi=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n="MessageModule",t._messageOptionsMap=new Map,t._mergerMessageHandler=new Ai(g(t)),t}return i(a,[{key:"createTextMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=gt(e.payload)?e.payload:e.payload.text,a=new Qo({text:o}),i=this._getNickAndAvatarByUserID(t);return n.setElement(a),n.setNickAndAvatar(i),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createImageMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e);if(ce){var o=e.payload.file;if(pt(o))return void this.outputWarning("FileUnsupportedInMP","createImageMessage");var a=o.tempFiles[0].path||o.tempFiles[0].tempFilePath,i={url:a,name:a.slice(a.lastIndexOf("/")+1),size:o.tempFiles&&o.tempFiles[0].size||1,type:a.slice(a.lastIndexOf(".")+1).toLowerCase()};e.payload.file=i}else if(ue)if(pt(e.payload.file)){var s=e.payload.file;e.payload.file={files:[s]}}else if(ft(e.payload.file)&&"undefined"!=typeof uni){var r=e.payload.file.tempFiles[0];e.payload.file={files:[r]}}var c=new Zo({imageFormat:ze.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file}),u=this._getNickAndAvatarByUserID(t);return n.setElement(c),n.setNickAndAvatar(u),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createAudioMessage",value:function(e){var t=e.payload.file;if(ce){var n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".")+1).toLowerCase()};e.payload.file=n}var o=this.getMyUserID();e.currentUser=o,e.senderTinyID=this.getMyTinyID();var a=new pa(e),i=new ea({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size,url:t.tempFilePath,uuid:this._generateUUID(e.payload.file)}),s=this._getNickAndAvatarByUserID(o);return a.setElement(i),a.setNickAndAvatar(s),a.setNameCard(this._getNameCardByGroupID(a)),this._messageOptionsMap.set(a.clientSequence,e),a}},{key:"createVideoMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl="",e.payload.file.thumbSize=0;var n={};if(ce){if(ae)return void this.outputWarning("VideoUnsupportedInAlipay");if(pt(e.payload.file))return void this.outputWarning("FileUnsupportedInMP","createVideoMessage");var o=e.payload.file;vt(o.tempFiles)&&(o=o.tempFiles[0]),n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf("/")+1),n.size=o.size||1,n.second=o.duration||0,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else if(ue){if(pt(e.payload.file)){var a=e.payload.file;e.payload.file.files=[a]}else if(ft(e.payload.file)&&"undefined"!=typeof uni){var i=e.payload.file.tempFile;e.payload.file.files=[i]}var s=e.payload.file;n.url=window.URL.createObjectURL(s.files[0]),n.name=s.files[0].name,n.size=s.files[0].size||1,n.second=s.files[0].duration||0,n.type=s.files[0].type.split("/")[1]}e.payload.file.videoFile=n;var r=new pa(e),c=new ra({videoFormat:n.type,videoSecond:Xt(n.second,0),videoSize:n.size,remoteVideoUrl:"",videoUrl:n.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),u=this._getNickAndAvatarByUserID(t);return r.setElement(c),r.setNickAndAvatar(u),r.setNameCard(this._getNameCardByGroupID(r)),this._messageOptionsMap.set(r.clientSequence,e),r}},{key:"createCustomMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=new sa({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),a=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createFaceMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=new $o(e.payload),a=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createMergerMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=this._getNickAndAvatarByUserID(t),o=new pa(e),a=new la(e.payload);return o.setElement(a),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:"createForwardMessage",value:function(e){var t=e.to,n=e.conversationType,o=e.priority,a=e.payload,i=e.needReadReceipt,s=e.receiverList;if(!vt(a._elements))return Go({code:Ao.MSG_FORWARD_INVALID_ELEMENTS});var r=this.getMyUserID(),c=this._getNickAndAvatarByUserID(r);if(a.type===S.MSG_GRP_TIP)return Go({code:Ao.MSG_FORWARD_TYPE_INVALID});var u={to:t,conversationType:n,conversationID:"".concat(n).concat(t),priority:o,isPlaceMessage:0,status:fn.UNSEND,currentUser:r,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||a.cloudCustomData||"",needReadReceipt:i,receiverList:s,isSupportExtension:e.isSupportExtension||!1},l=new pa(u);return l.setElement(a._elements[0]),l.setNickAndAvatar(c),l.setNameCard(this._getNameCardByGroupID(a)),l.setRelayFlag(!0),l}},{key:"downloadMergerMessage",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:"createFileMessage",value:function(e){if(ce){if(!$&&!te&&!se)return;var n=le.getSystemInfoSync().SDKVersion;if($&&Wt(n,"2.5.0")<0)return void this.outputWarning("WXChooseMessageFile");if(te&&Wt(n,"1.18.0")<0)return void this.outputWarning("QQChooseMessageFile")}if(ue||se){if(pt(e.payload.file)){var o=e.payload.file;e.payload.file={files:[o]}}else if(ft(e.payload.file)&&"undefined"!=typeof uni){var a=e.payload.file,i=a.tempFiles,s=a.files,r=null;vt(i)?r=i[0]:vt(s)&&(r=s[0]),e.payload.file={files:[r]}}}else if($||te){var c=e.payload.file.tempFiles,u=t(t({},c[0]),{},{url:c[0].path});e.payload.file={files:[u]}}var l=this.getMyUserID();e.currentUser=l,e.senderTinyID=this.getMyTinyID();var d=new pa(e),p=new ia({uuid:this._generateUUID(e.payload.file),file:e.payload.file}),_=this._getNickAndAvatarByUserID(l);return d.setElement(p),d.setNickAndAvatar(_),d.setNameCard(this._getNameCardByGroupID(d)),this._messageOptionsMap.set(d.clientSequence,e),d}},{key:"createLocationMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=new ca(e.payload),a=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"_onCannotFindModule",value:function(){return Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"sendMessageInstance",value:function(e,t){var n=this;if(!1===this.getModule(yo).filterMessage(e,t))return e.hasRiskContent=!0,this._onSendMessageFailed(e,new ko({code:Ao.PROFANITY_FOUND}));var o=null;if(e.conversationType===S.CONV_C2C)o=this.getModule(eo);else{if(e.conversationType!==S.CONV_GROUP)return Go({code:Ao.MSG_INVALID_CONV_TYPE});o=this.getModule(to)}var a,i="".concat(this._n,".sendMessageInstance"),s=this.getModule(ao),r=o.isOnlineMessage(e,t);return this.getModule(uo).upload(e).then((function(){n._getSendMessageSpecifiedKey(e)===Vo&&n.getModule(mo).addSuccessCount(Ho);return n._guardForGroup(e).then((function(){if(!e.isSendable())return Go({code:Ao.MSG_F_URL_IS_EMPTY});n._addSendMessageTotalCount(e),a=Date.now();var i=function(e){var t="utf-8";ue&&document&&(t=document.charset.toLowerCase());var n,o,a=0;if(o=e.length,"utf-8"===t||"utf8"===t)for(var i=0;i11264?n._mergerMessageHandler.uploadMergerMessage(e,i).then((function(o){var a=n._mergerMessageHandler.createMergerMessagePack(e,t,o);return n.request(a)})):(s.setMessageRandom(e),o.sendMessage(e,t))})).then((function(o){var c=o.data,u=c.time,l=c.sequence,d=c.readReceiptCode,p=c.messageDropReason;_t(d)&&0!==d&&(new Xo("sendMessageWithReceipt").setMessage("from:".concat(e.from," to:").concat(e.to," sequence:").concat(l," readReceiptCode:").concat(d)).end(),Je.w("".concat(i," readReceiptCode:").concat(d," message:").concat(n.getErrorMessage(d))));if(p){var _=new Xo("messageDropReason"),g="from:".concat(e.from," to:").concat(e.to," sequence:").concat(l," messageDropReason:").concat(p);_.setMessage(g).end(),Je.w("".concat(i," ").concat(g))}if(n._addSendMessageSuccessCount(e,a),n._messageOptionsMap.delete(e.clientSequence),!0===e.isResend){var h=s.findMessage(e.ID);h&&(Je.l("".concat(i," resend ok. ID:").concat(h.ID)),s.deleteLocalMessage(h))}e.status=fn.SUCCESS,e.time=u;var f=!1;if(e.conversationType===S.CONV_GROUP)e.sequence=l;else if(e.conversationType===S.CONV_C2C){var v=s.getLatestMessageSentByMe(e.conversationID);if(v){var m=v.nick,M=v.avatar;m===e.nick&&M===e.avatar||(f=!0)}}if(f&&s.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),!0===r)e._onlineOnlyFlag=!0;else{s.appendToMessageList(e);var I=e;ft(t)&&ft(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,I=""),!0===t.messageControlInfo.excludedFromUnreadCount&&(e._isExcludedFromUnreadCount=!0));var y=e.conversationType;if(Ft(e.to))y=S.CONV_TOPIC,n.getModule(oo).onMessageSent({groupID:$t(e.to),topicID:e.to,lastMessage:I});s.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:y,subType:e.conversationSubType,lastMessage:I}]})}return e._relayFlag||"TIMImageElem"!==e.type||Jt(e.payload.imageInfoArray),No({message:e})}))})).catch((function(t){return n._onSendMessageFailed(e,t,r)}))}},{key:"_guardForGroup",value:function(e){if(e.conversationType!==S.CONV_GROUP)return Promise.resolve();var t=this.getModule(to);if(!t)return this._onCannotFindModule();if(wt({groupID:e.to})){var n=t.getLocalGroupProfile(e.to);if(n&&n.isSupportTopic)return Go({code:Ao.MSG_SEND_GRP_WITH_TOPIC_FAIL})}return t.guardForAVChatRoom(e)}},{key:"_onSendMessageFailed",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o="".concat(this._n,"._onSendMessageFailed");e.status=fn.FAIL,80001!==t.code&&80004!==t.code||(e.hasRiskContent=!0);var a=this.getModule(ao);a.deleteMessageRandom(e);var i=t.code>=10100&&t.code<=10200||t.code>=120001&&t.code<=13e4;if(!n&&!i){var s=a.appendToMessageList(e);!0===s&&Je.l("".concat(o," message stored, ID:").concat(e.ID))}this._addSendMessageFailCountOnUser(e,t);var r=new Xo("sendMessage");return r.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)),this.probeNetwork().then((function(e){var n=v(e,2),o=n[0],a=n[1];r.setError(t,o,a).end()})),Je.e("".concat(o," error:"),t),Go(new ko({code:t&&t.code?t.code:Ao.MSG_SEND_FAIL,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if([S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_VIDEO,S.MSG_FILE].includes(e.type))return Vo;if(e.conversationType===S.CONV_C2C)return Fo;if(e.conversationType===S.CONV_GROUP){var t=this.getModule(to);if(!t)return;var n=t.getLocalGroupProfile(e.to);if(!n)return;var o=n.type;return bt(o)?xo:qo}}},{key:"_addSendMessageTotalCount",value:function(e){var t=this._getSendMessageSpecifiedKey(e);t&&this.getModule(mo).addTotalCount(t)}},{key:"_addSendMessageSuccessCount",value:function(e,t){var n=this._getSendMessageSpecifiedKey(e);if(n){var o=this.getModule(mo);o.addSuccessCount(n),o.addCost(n,un(t,!1))}}},{key:"_addSendMessageFailCountOnUser",value:function(e,t){var n,o,a=t.code,i=void 0===a?-1:a,s=this.getModule(mo),r=this._getSendMessageSpecifiedKey(e);r===Vo&&(n=i,o=!1,Ri.includes(n)&&(o=!0),o)?s.addFailedCountOfUserSide(Ho):Oi(i)&&r&&s.addFailedCountOfUserSide(r)}},{key:"resendMessage",value:function(e,t){return e.isResend=!0,e.status=fn.UNSEND,this.sendMessageInstance(e,t)}},{key:"revokeMessage",value:function(e){var t=this,n=null;if(e.conversationType===S.CONV_C2C?n=this.getModule(eo):e.conversationType===S.CONV_GROUP&&(n=this.getModule(to)),!n)return this._onCannotFindModule();var o=new Xo("revokeMessage");o.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to));var a="".concat(this._n,".").concat("revokeMessage");return n.revokeMessage(e).then((function(n){var i=n.data.recallRetList;if(!pn(i)&&0!==i[0].retCode){var s=new ko({code:i[0].retCode,data:{message:e}});return o.setCode(s.code).setMoreMessage(s.message).end(),Go(s)}return Je.i("".concat(a," ok. ID:").concat(e.ID)),e.isRevoked=!0,o.end(),t.getModule(ao).onMessageRevoked([e]),No({message:e})})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];o.setError(n,a,i).end()}));var i=new ko({code:n&&n.code?n.code:Ao.MSG_REVOKE_FAIL,message:n&&n.message?n.message:void 0,data:{message:e}});return Je.w("".concat(a," failed. error:"),n),Go(i)}))}},{key:"deleteMessage",value:function(e){var t=this,n=null,o=e[0],a=o.conversationID,i="",s=[],r=[];if(o.conversationType===S.CONV_C2C)n=this.getModule(eo),i=a.replace(S.CONV_C2C,""),e.forEach((function(e){e&&e.status===fn.SUCCESS&&e.conversationID===a&&(e._onlineOnlyFlag||s.push("".concat(e.sequence,"_").concat(e.random,"_").concat(e.time)),r.push(e))}));else if(o.conversationType===S.CONV_GROUP)n=this.getModule(to),i=a.replace(S.CONV_GROUP,""),e.forEach((function(e){e&&e.status===fn.SUCCESS&&e.conversationID===a&&(e._onlineOnlyFlag||s.push("".concat(e.sequence)),r.push(e))}));else if(o.conversationType===S.CONV_SYSTEM)return Go({code:Ao.CANNOT_DELETE_GRP_SYSTEM_NOTICE});if(!n)return this._onCannotFindModule();if(0===s.length)return this._onMessageDeleted(r);s.length>30&&(s=s.slice(0,30),r=r.slice(0,30));var c=new Xo("deleteMessage");c.setMessage("to:".concat(i," count:").concat(s.length));var u="".concat(this._n,".").concat("deleteMessage");return n.deleteMessage({to:i,keyList:s}).then((function(e){return c.end(),Je.i("".concat(u," ok")),t._onMessageDeleted(r)})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.w("".concat(u," failed. error:"),e);var n=new ko({code:e&&e.code?e.code:Ao.MSG_DELETE_FAIL,message:e&&e.message?e.message:void 0});return Go(n)}))}},{key:"_onMessageDeleted",value:function(e){return this.getModule(ao).onMessageDeleted(e),Oo({messageList:e})}},{key:"translateText",value:function(e){var n="".concat(this._n,".").concat("translateText"),o=e.sourceTextList,a=e.sourceLanguage,i=e.targetLanguage,s=new Xo("translateText");return s.setMessage("sourceLanguage:".concat(a," targetLanguage:").concat(i)),this.request({protocolName:Uo.TRANSLATE_TEXT,requestData:{sourceTextList:o,source:a||"auto",target:i,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then((function(e){var o=e.data,a=o.error,i=o.requestID,r=o.translatedTextList;if(0===a.code)return s.end(),Je.i("".concat(n," ok. requestID:").concat(i)),No({translatedTextList:r});throw t(t({},a),{},{requestID:i})})).catch((function(e){return s.setCode(e.code).setMoreMessage(e.requestID).end(),Je.w("".concat(n," failed. error:"),e),Go({code:Ao.TRANSLATE_TEXT_FAIL})}))}},{key:"convertVoiceToText",value:function(e){var n=e.message,o=e.language,a=n.payload.url;n.from===this.getMyUserID()&&"out"===n.flow&&(a=n.payload.remoteAudioUrl);var i=/\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/;if(!i.test(a))return Go({code:Ao.UNSUPPORTED_VOICE_FORMAT});var s=i.exec(a)[1]||"mp3",r="16k_zh-PY";o?"zh (cmn-Hans-CN)"===o?r="16k_zh":"en-US"===o?r="16k_en":"yue-Hant-HK"===o?r="16k_yue":"ja-JP"===o&&(r="16k_ja"):r="16k_zh-PY";var c="serviceType:".concat(r," url:").concat(a),u="".concat(this._n,".").concat("convertVoiceToText");Je.i("".concat(u," ").concat(c));var l=new Xo("convertVoiceToText");return l.setMessage(c),this.request({protocolName:Uo.VOICE_TO_TEXT,requestData:{url:a,language:r,SDKAppID:this.getSDKAppID(),format:s}}).then((function(e){var n=e.data,o=n.error,a=n.requestID,i=n.result;if(0===o.code)return l.end(),Je.i("".concat(u," ok. requestID:").concat(a)),No({result:i});throw t(t({},o),{},{requestID:a})})).catch((function(e){return l.setCode(e.code).setMoreMessage(e.requestID||"").end(),Je.w("".concat(u," failed. error:"),e),Go({code:Ao.VOICE_TO_TEXT_FAIL})}))}},{key:"modifyRemoteMessage",value:function(e){var t=this,n=null,o=e.conversationType,a=e.to,i=this.getModule(to);if(!i)return this._onCannotFindModule();if(i.isMessageFromOrToAVChatroom(a))return Go({code:Ao.MSG_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:e}});if(!1===this.getModule(yo).filterMessage(e))return e.hasRiskContent=!0,Go({code:Ao.PROFANITY_FOUND,data:{message:e}});o===S.CONV_C2C?n=this.getModule(eo):o===S.CONV_GROUP&&(n=this.getModule(to));var s=new Xo("modifyMessage");s.setMessage("to:".concat(a));var r="".concat(this._n,".modifyRemoteMessage");return n.modifyRemoteMessage(e).then((function(n){s.end(),Je.i("".concat(r," ok"));var o=t._onModifyRemoteMessageResp(e,n.data);return No({message:o})})).catch((function(n){if(s.setCode(n.code).setMoreMessage(n.message).end(),Je.w("".concat(r," failed. error:"),n),20027===n.code){var o=t._onModifyRemoteMessageResp(e,n.data);return Go({code:Ao.MSG_MODIFY_CONFLICT,data:{message:o}})}return Go({code:n.code,message:n.message,data:{message:e}})}))}},{key:"_generateSearchRequestData",value:function(e){var t=e.conversationID,n=e.timePosition,o=e.timePeriod,a=_(e,Gi);return mt(t)||(qt(t)&&(a.account=t.replace(S.CONV_C2C,"")),xt(t)&&(a.groupID=t.replace(S.CONV_GROUP,""))),_t(o)&&o>0&&(_t(n)&&n>0?a.startTime=n-o:a.startTime=Ke()-o),a.startTime&&a.startTime<0&&(a.startTime=void 0),_t(n)&&n>0&&(a.endTime=n),a}},{key:"searchCloudMessages",value:function(e){var t=this,n="searchCloudMessages",o="".concat(this._n,".").concat(n);if(!e)return Go({code:Ao.OPTIONS_IS_EMPTY,message:this.getErrorMessage(Ao.OPTIONS_IS_EMPTY,n)});var a=e.keywordList,i=e.keywordListMatchType,s=e.conversationID,r=e.cursor,c=vt(e.senderUserIDList)&&e.senderUserIDList.length>0,u=vt(e.messageTypeList)&&e.messageTypeList.length>0;if(!a&&!c&&!u)throw Je.e("[".concat(n,'] Missing required params: "keywordList".')),new Error("Params validate failed.");var l=Date.now(),d=new Xo(n),p="keywordList:".concat(a," keywordListMatchType:").concat(i," ")+"conversationID:".concat(s," cursor:").concat(r);return Je.l("".concat(o," ").concat(p)),this.request({protocolName:Uo.MESSAGE_CLOUD_SEARCH,requestData:this._generateSearchRequestData(e)}).then((function(n){var a=n.data,i=a.code,s=a.message;if(0!==i){var r=i;60020===i&&(r="SearchCloudMessagesUnavailable");var c=t.getErrorMessage(r)||s,u=new ko({code:i,message:c});return t.probeNetwork().then((function(e){var t=v(e,2),n=t[0],o=t[1];d.setMessage(p).setError(u,n,o).end()})),Go(u)}var _=n.data,g=_.cursor,h=_.totalCount,f=_.searchResult,m="totalCount:".concat(h," cost:").concat(un(l));Je.l("".concat(o," ok. cursor:").concat(g," ").concat(m)),d.setNetworkType(t.getNetworkType()).setMessage("".concat(p," ").concat(m)).end();var M=t._handleSearchResults(f,!e.conversationID);return No({searchResultList:M,cursor:g,totalCount:h})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setMessage(p).setError(e,o,a).end()})),Go(e)}))}},{key:"_handleSearchResults",value:function(e,t){var n=this.getModule(ao);return vt(e)&&0!==e.length?e.map((function(e){var o=e.groupID,a=e.userID,i=e.messageCount,s=e.messageList,r=o?"".concat(S.CONV_GROUP).concat(o):"".concat(S.CONV_C2C).concat(a),c={conversationID:r,messageCount:i,messageList:[]};if(t&&i>1)return c;if(s&&s.length>0){var u=n.onRoamingMessage(s,r,!1);o&&u.reverse(),c.messageList=u}return c})):[]}},{key:"_onModifyRemoteMessageResp",value:function(e,t){Je.d("".concat(this._n,"._onModifyRemoteMessageResp options:"),t);var n=e.conversationType,o=e.from,a=e.to,i=e.random,s=e.sequence,r=e.time,c=t.elements,u=t.messageVersion,l=t.cloudCustomData,d=void 0===l?"":l;return this.getModule(ao).onMessageModified({conversationType:n,from:o,to:a,time:r,random:i,sequence:s,elements:c,cloudCustomData:d,messageVersion:u})}},{key:"_generateUUID",value:function(e){var t=this.getModule(io),n="".concat(t.getSDKAppID(),"-").concat(t.getUserID(),"-").concat(function(){for(var e="",t=32;t>0;--t)e+=At[Math.floor(Math.random()*Lt)];return e}()),o=e.name||e.value||e.url||e.tempFilePath,a=o&&o.slice(o.lastIndexOf(".")+1);return a&&(n="".concat(n,".").concat(a)),n}},{key:"getMessageOption",value:function(e){return this._messageOptionsMap.get(e)}},{key:"_getNickAndAvatarByUserID",value:function(e){return this.getModule($n).getNickAndAvatarByUserID(e)}},{key:"_getNameCardByGroupID",value:function(e){if(e.conversationType===S.CONV_GROUP){var t=this.getModule(to);if(t)return t.getMyNameCardByGroupID(e.to)}return""}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),a}(Po),Ui=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="MessageExtensionModule",a.messageExtensionMap=new Map,a.globalSeqMap=new Map,a.getMessageExtensionsMap=new Map,a}return i(n,[{key:"onMessageExtensionNotify",value:function(e){var t=this,n=e.dataList,o=n.messageInfo,a=n.operateType,i=n.operateResultList,s=n.tinyID,r=n.globalSequence,c=o.clientTime,u=o.random,l="".concat(s,"-").concat(c,"-").concat(u),d=[],p=[];Je.l("".concat(this._n,".onMessageExtensionNotify messageID:").concat(l," operateType:").concat(a," globalSequence:").concat(r)),this._updateGlobalSequence(l,r);var _=!1,g=!1;i.forEach((function(e){var n=e.extensions,o=void 0===n?[]:n,i=e.clearSequence;if(1===a)_=!0,o.forEach((function(e){d.push({key:e.key,value:e.value})})),t._updateLocalExtension(l,o);else if(2===a)g=!0,o.forEach((function(e){p.push(e.key)})),t._updateLocalExtension(l,o);else if(3===a){if(g=!0,t._hasLocalExtension(l))t._getLocalExtension(l).forEach((function(e,t){e.seq<=i&&!pn(e.value)&&p.push(t)}));t._clearLocalExtension(l,i)}})),_&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_UPDATED,{messageID:l,extensions:d}),g&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_DELETED,{messageID:l,keyList:p})}},{key:"setMessageExtensions",value:function(e,t){var n=this,o="setMessageExtensions";if(!this.canIUse(K.MSG_EXT))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),i=e.ID,s=e.conversationID,r=e.sequence,c=e.time,u=m(t);t.length>20&&(u=t.slice(0,20),Je.w("".concat(a,". the length of extensions cannot exceed 20.")));var l="conversationID:".concat(s," messageID:").concat(i," sequence:").concat(r," time:").concat(c," count:").concat(u.length),d=new Xo(o);return d.setMessage(l),Je.l("".concat(a," ").concat(l)),this._modifyMessageExtensions(e,u).then((function(e){var t=e.resultList,n=e.successCount,o=e.failureCount,i="success count:".concat(n," fail count:").concat(o);return d.setMoreMessage(i).end(),Je.l("".concat(a," ok. ").concat(i)),No({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e("".concat(a," failed. error:"),e),Go(e)}))}},{key:"getMessageExtensions",value:function(e){var t=this,n="getMessageExtensions";if(!this.canIUse(K.MSG_EXT))return this.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=e.ID,i=e.conversationID,s=e.sequence,r=e.time,c="conversationID:".concat(i," messageID:").concat(a," sequence:").concat(s," time:").concat(r),u=new Xo(n);u.setMessage(c),Je.l("".concat(o," ").concat(c));var l=void 0;return this.getMessageExtensionsMap.has(a)&&(l=this._getGlobalSequence(a)),this._getMessageExtensions(e,l).then((function(e){return u.end(),Je.l("".concat(o," ok. total count:").concat(e.length)),mt(l)&&e.length>0&&t.getMessageExtensionsMap.set(a,1),No({extensions:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"deleteMessageExtensions",value:function(e,t){var n=this,o="deleteMessageExtensions";if(!this.canIUse(K.MSG_EXT))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),i=[],s=3;pn(t)||(s=2,t.forEach((function(e){i.push({key:e,value:"",seq:0})})));var r=e.ID,c=e.conversationID,u=e.sequence,l=e.time,d="conversationID:".concat(c," messageID:").concat(r," sequence:").concat(u," time:").concat(l," operateType:").concat(s),p=new Xo(o);return p.setMessage(d),Je.l("".concat(a," ").concat(d)),this._modifyMessageExtensions(e,i,s).then((function(e){var t=e.resultList,n=e.successCount,o=e.failureCount,i="";return 2===s&&(i="success count:".concat(n," fail count:").concat(o)),p.setMoreMessage("".concat(i)).end(),Je.l("".concat(a," ok. ").concat(i)),No({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setError(e,o,a).end()})),Je.e("".concat(a," failed. error:"),e),Go(e)}))}},{key:"_modifyMessageExtensions",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=Ft(e.to)?S.CONV_TOPIC:e.conversationType,i=void 0;3!==o&&(i=this._getRequestExtensions(e,t));var s=null;switch(a){case S.CONV_C2C:s=this.getModule(eo);break;case S.CONV_GROUP:s=this.getModule(to);break;case S.CONV_TOPIC:s=this.getModule(oo);break;default:return Go({code:Ao.CANNOT_FIND_MODULE})}return s.modifyMessageExtensions(e,i,o).then((function(t){var o=t.data,a=o.extensions,i=o.seq,s=[],r=0,c=0,u=[];return(a=pn(a)?[]:a).forEach((function(e){var t=e.errorCode,n=e.extension,o=n.key,a=n.value,i=n.seq;s.push({code:t,key:o,value:a}),0===t?r++:c++,u.push({key:o,value:a,seq:i})})),n._updateGlobalSequence(e.ID,i),u.length>0&&(n._updateLocalExtension(e.ID,u),u=null),{resultList:s,successCount:r,failureCount:c}})).catch((function(e){return Go(e)}))}},{key:"_getRequestExtensions",value:function(e,t){var n=[];if(this._hasLocalExtension(e.ID)){var o=this._getLocalExtension(e.ID);return t.forEach((function(e){var t=e.key,a=e.value,i=0;o.has(t)&&(i=o.get(t).seq),n.push({key:t,value:a,seq:i})})),n}return t.forEach((function(e){var t=e.key,o=e.value;n.push({key:t,value:o,seq:0})})),n}},{key:"_getMessageExtensions",value:function(e,t){var n=this,o="".concat(this._n,"._getMessageExtensions"),a=e.ID,i=e.to,s=null;switch(Ft(i)?S.CONV_TOPIC:e.conversationType){case S.CONV_C2C:s=this.getModule(eo);break;case S.CONV_GROUP:s=this.getModule(to);break;case S.CONV_TOPIC:s=this.getModule(oo);break;default:return Go({code:Ao.CANNOT_FIND_MODULE})}return s.getMessageExtensions(e,t).then((function(t){var i=t.data,s=i.extensions,r=i.completeFlag,c=i.globalSequence,u=i.clearSequence;if(s=pn(s)?[]:s,Je.l("".concat(o," ok. completeFlag:").concat(r," globalSequence:").concat(c," clearSequence:").concat(u," count:").concat(s.length)),n._updateLocalExtension(a,s),n._clearLocalExtension(a,u),n._updateGlobalSequence(a,c),1!==r){var l=s.slice(-1)[0].seq+1;return n._getMessageExtensions(e,l)}return n._getLocalExtensions(a)})).catch((function(e){return Go(e)}))}},{key:"_hasLocalExtension",value:function(e){return this.messageExtensionMap.has(e)}},{key:"_getLocalExtension",value:function(e){return this.messageExtensionMap.get(e)}},{key:"_updateLocalExtension",value:function(e,t){this._hasLocalExtension(e)||this.messageExtensionMap.set(e,new Map);var n=this._getLocalExtension(e);t.forEach((function(e){var t=e.key,o=e.value,a=void 0===o?"":o,i=e.seq;n.set(t,{value:a,seq:i})}))}},{key:"_clearLocalExtension",value:function(e,t){if(!(t<=0)&&this._hasLocalExtension(e)){var n=this._getLocalExtension(e);n.forEach((function(e,o){e.seq<=t&&n.delete(o)}))}}},{key:"_getLocalExtensions",value:function(e){var t=[];this._hasLocalExtension(e)&&this._getLocalExtension(e).forEach((function(e,n){var o=e.value;pn(o)||t.push({key:n,value:o})}));return t}},{key:"_getGlobalSequence",value:function(e){return this.globalSeqMap.get(e)}},{key:"_updateGlobalSequence",value:function(e,t){this.globalSeqMap.set(e,t)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),n}(Po),bi=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n="MessageReactionModule",t._reactedByMyselfMap=new Map,t._reactionInfoMap=new Map,t}return i(a,[{key:"onMessageReactionNotifyList",value:function(e){var n=this,o=(e||{}).dataList;(void 0===o?[]:o).forEach((function(e){var o=e.C2CMessageInfo,a=void 0===o?{}:o,i=e.groupMessageInfo,s=void 0===i?{}:i,r=e.reactionList,c=void 0===r?[]:r,u=t(t({},a),s),l=u.tinyID,d=u.clientTime,p=u.random,_="".concat(l,"-").concat(d,"-").concat(p),g=[];c.forEach((function(e){mt(e.userIDList)&&(e.userIDList=[],e.count=0),g.push.apply(g,m(e.userIDList))})),Je.l("".concat(n._n,".onMessageReactionNotifyList messageID:").concat(_," reactionList:").concat(c.length)),n._handleReactionSummary([{messageID:_,reactionList:c}],g).then((function(e){n.emitOuterEvent(E.MESSAGE_REACTIONS_UPDATED,t({},e[0]))}))}))}},{key:"onMessageReactionNotify",value:function(e){var n=e.dataList||{},o=n.C2CMessageInfo,a=void 0===o?{}:o,i=n.groupMessageInfo,s=void 0===i?{}:i,r=n.reactionID,c=n.operateType,u=t(t({},a),s),l=u.tinyID,d=u.clientTime,p=u.random,_="".concat(l,"-").concat(d,"-").concat(p);Je.l("".concat(this._n,".onMessageReactionNotify messageID:").concat(_," reactionID:").concat(r," operateType:").concat(c)),1===c?this._addReactedByMyselfMap(_,r):this._removeReactedByMyselfMap(_,r);var g="".concat(_,"-").concat(r);if(this._reactionInfoMap.has(g)){var h=this._reactionInfoMap.get(g);h.reactedByMyself=1===c,this.emitOuterEvent(E.MESSAGE_REACTIONS_UPDATED,{messageID:_,reactionList:[h]})}}},{key:"addMessageReaction",value:function(e,t){var n=this,o="addMessageReaction";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),i=e.ID,s=e.conversationID,r="conversationID:".concat(s," messageID:").concat(i," reactionID:").concat(t),c=new Xo(o);c.setMessage(r),Je.l("".concat(a," ").concat(r));var u=this._createReactionOperationPack(e,t,1);return this._addReactedByMyselfMap(e.ID,t),this.request(u).then((function(){return c.end(),Je.l("".concat(a," ok.")),No()})).catch((function(o){return n._removeReactedByMyselfMap(e.ID,t),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],a=t[1];c.setError(o,n,a).end()})),Je.e("".concat(a," failed. error:"),o),Go(o)}))}},{key:"removeMessageReaction",value:function(e,t){var n=this,o="removeMessageReaction";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),i=e.ID,s=e.conversationID,r="conversationID:".concat(s," messageID:").concat(i," reactionID:").concat(t),c=new Xo(o);c.setMessage(r),Je.l("".concat(a," ").concat(r));var u=this._createReactionOperationPack(e,t,2);return this._removeReactedByMyselfMap(e.ID,t),this.request(u).then((function(){return c.end(),Je.l("".concat(a," ok.")),No()})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e("".concat(a," failed. error:"),e),Go(e)}))}},{key:"getMessageReactions",value:function(e){var n=this,o="getMessageReactions";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a="".concat(this._n,".").concat(o),i=e.messageList,s=e.maxUserCountPerReaction,r=i[0].conversationID,c="conversationID:".concat(r," maxUserCountPerReaction:").concat(s," messageList:").concat(i.length),u=new Xo(o);u.setMessage(c),Je.l("".concat(a," ").concat(c));var l=new Map,d=this._createReactionSummaryPack(t(t({},e),{},{messageIDMap:l}));return this.request(d).then((function(e){var t=e.data.resultList,o=[],a=[];return(void 0===t?[]:t).forEach((function(e){var t=e.messageKey,n=void 0===t?void 0:t,i=e.messageSequence,s=void 0===i?void 0:i,r=e.reactionList,c=void 0===r?[]:r,u=mt(n)?l.get(s):l.get(n);o.push({messageID:u,reactionList:c}),c.forEach((function(e){a.push.apply(a,m(e.userIDList))}))})),n._handleReactionSummary(o,a)})).then((function(e){return u.end(),Je.l("".concat(a," ok.")),l.clear(),No({resultList:e})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(a," failed. error:"),e),Go(e)}))}},{key:"getAllUserListOfMessageReaction",value:function(e){var t=this,n="getAllUserListOfMessageReaction";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(n);var o="".concat(this._n,".").concat(n),a=e.message,i=e.reactionID,s=e.nextSeq,r=e.count,c=a.ID,u=a.conversationID,l="conversationID:".concat(u," messageID:").concat(c," reactionID:").concat(i," nextSeq:").concat(s," count:").concat(r),d=new Xo(n);d.setMessage(l),Je.l("".concat(o," ").concat(l));var p={userList:[],nextSeq:0,isCompleted:!1},_=this._createReactionUserListPack(e);return this.request(_).then((function(e){var n=e.data,o=n.userIDList,a=void 0===o?[]:o,i=n.nextSeq,s=void 0===i?0:i;return p.nextSeq=s,p.isCompleted=0===s,t.getModule($n).getUserNickAndAvatar(a)})).then((function(e){return p.userList=e,d.end(),Je.l("".concat(o," ok.")),No(p)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e("".concat(o," failed. error:"),e),Go(e)}))}},{key:"_createReactionOperationPack",value:function(e,t,n){var o=void 0,a={reactionID:t,userIDList:[this.getMyUserID()]};if(e.conversationType===S.CONV_C2C){var i=this.getModule(eo);o=1===n?Uo.ADD_C2C_MSG_REACTION:Uo.REMOVE_C2C_MSG_REACTION,a.from=e.from,a.to=e.to,a.messageKey=i.getMessageKey(e)}if(e.conversationType===S.CONV_GROUP){var s=void 0,r=e.to;Ft(e.to)&&(r=$t(s=e.to)),o=1===n?Uo.ADD_GRP_MSG_REACTION:Uo.REMOVE_GRP_MSG_REACTION,a.groupID=r,a.topicID=s,a.messageSequence=e.sequence}return{protocolName:o,requestData:a}}},{key:"_createReactionSummaryPack",value:function(e){var t=e.messageList,n=e.maxUserCountPerReaction,o=void 0===n?10:n,a=e.messageIDMap,i=t[0],s=void 0,r=void 0;if(i.conversationType===S.CONV_C2C){var c=this.getModule(eo),u=t.map((function(e){var t=c.getMessageKey(e);return a.set(t,e.ID),t}));s=Uo.GET_C2C_MSG_REACTIONS,r={from:i.from,to:i.to,messageKeyList:u,count:o}}if(i.conversationType===S.CONV_GROUP){var l=void 0,d=i.to;Ft(i.to)&&(d=$t(l=i.to));var p=t.map((function(e){return a.set(e.sequence,e.ID),e.sequence}));s=Uo.GET_GRP_MSG_REACTIONS,r={groupID:d,topicID:l,messageSequenceList:p,count:o}}return{protocolName:s,requestData:r}}},{key:"_createReactionUserListPack",value:function(e){var t=e.message,n=e.reactionID,o=e.nextSeq,a=void 0===o?0:o,i=e.count,s=void 0===i?100:i,r=void 0,c={reactionID:n,nextSeq:a,count:s>100?100:s};if(t.conversationType===S.CONV_C2C){var u=this.getModule(eo);r=Uo.GET_C2C_MSG_REACTION_USER_LIST,c.from=t.from,c.to=t.to,c.messageKey=u.getMessageKey(t)}if(t.conversationType===S.CONV_GROUP){var l=void 0,d=t.to;Ft(t.to)&&(d=$t(l=t.to)),r=Uo.GET_GRP_MSG_REACTION_USER_LIST,c.groupID=d,c.topicID=l,c.messageSequence=t.sequence}return{protocolName:r,requestData:c}}},{key:"_handleReactionSummary",value:function(e,t){var n=this;return this.getModule($n).getUserNickAndAvatar(t).then((function(t){var o=[];return e.forEach((function(e){var a=[];e.reactionList.forEach((function(o){var i=o.reactionID,s=o.count,r=o.userIDList,c=o.reactedByMyself,u=void 0===c?void 0:c,l=[];r.forEach((function(e){t.forEach((function(t){e===t.userID&&l.push(t)}))}));var d={reactionID:i,totalUserCount:s,partialUserList:l,reactedByMyself:n._computeReactedByMyself({reactedByMyself:u,messageID:e.messageID,reactionID:i})};if(a.push(d),mt(u)&&!n._reactedByMyselfMap.has(e.messageID)){var p="".concat(e.messageID,"-").concat(i);n._reactionInfoMap.set(p,d)}})),o.push({messageID:e.messageID,reactionList:a})})),o}))}},{key:"_addReactedByMyselfMap",value:function(e,t){this._reactedByMyselfMap.has(e)||this._reactedByMyselfMap.set(e,[]);var n=this._reactedByMyselfMap.get(e);-1===n.indexOf(t)&&n.push(t)}},{key:"_removeReactedByMyselfMap",value:function(e,t){if(this._reactedByMyselfMap.has(e)){var n=this._reactedByMyselfMap.get(e),o=n.indexOf(t);o>-1&&n.splice(o,1)}}},{key:"_computeReactedByMyself",value:function(e){var t=e.reactedByMyself,n=e.messageID,o=e.reactionID;return mt(t)?!!this._reactedByMyselfMap.has(n)&&this._reactedByMyselfMap.get(n).includes(o):1===t}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._reactedByMyselfMap.clear(),this._reactionInfoMap.clear()}}]),a}(Po),wi=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="ComboMessageModule",a}return i(n,[{key:"sendMessage",value:function(e){var t=this,n=this._constructMessageInstance(e);if(null===n)return Go({code:Ao.MSG_SEND_FAIL});this._addSendMessageTotalCount(n);var o=Date.now();return this.getModule(ao).setMessageRandom(n),this._sendComboMessage(n,e).then((function(e){var a=e.data,i=a.time,s=a.sequence,r=a.readReceiptCode;_t(r)&&0!==r&&(new Xo("sendMessageWithReceipt").setMessage("from:".concat(n.from," to:").concat(n.to," sequence:").concat(s," readReceiptCode:").concat(r)).end(),Je.w("".concat(t._n,".sendMessage readReceiptCode:").concat(r," message:").concat(t.getErrorMessage(r))));t._addSendMessageSuccessCount(n,o);var c=t.getModule(ao);n.status=fn.SUCCESS,n.time=i,n.conversationType===S.CONV_GROUP&&(n.sequence=s),c.appendToMessageList(n);var u=n;return!0===n._isExcludedFromLastMessage&&(u=""),c.onMessageSent({conversationOptionsList:[{conversationID:n.conversationID,unreadCount:0,type:n.conversationType,subType:n.conversationSubType,lastMessage:u}]}),No({message:n})})).catch((function(e){return t._onSendMessageFailed(n,e)}))}},{key:"_sendComboMessage",value:function(e,t){var n=this._m.getModule(_o),o="";return e.conversationType===S.CONV_C2C&&(o="".concat(B.NAME.OPEN_IM,".").concat(Uo.SEND_C2C_MESSAGE)),e.conversationType===S.CONV_GROUP&&(o="".concat(B.NAME.GROUP,".").concat(Uo.SEND_GROUP_MESSAGE)),n.sendComboMessage({servcmd:o,data:t})}},{key:"_constructMessageInstance",value:function(e){var t="".concat(this._n,"._constructMessageInstance"),n=null;try{var o=this.getMyUserID(),a={};if(a.senderTinyID=this.getMyTinyID(),a.currentUser=o,a.from=e.From_Account||o,e.GroupId?(a.conversationID="".concat(S.CONV_GROUP).concat(e.GroupId),a.conversationType=S.CONV_GROUP,a.to=e.GroupId):e.To_Account&&(a.conversationID="".concat(S.CONV_C2C).concat(e.To_Account),a.conversationType=S.CONV_C2C,a.to=e.To_Account),a.time=e.MsgTimeStamp||0,a.random=e.Random||e.MsgRandom||0,a.priority=e.MsgPriority,gt(e.CloudCustomData)&&e.CloudCustomData.length>0&&(a.cloudCustomData=e.CloudCustomData),vt(e.SendMsgControl)&&(a.messageControlInfo={},e.SendMsgControl.includes("NoUnread")&&(a.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes("NoLastMsg")&&(a.messageControlInfo.excludedFromLastMessage=1)),a.conversationType===S.CONV_GROUP&&vt(e.To_Account)&&e.To_Account.length>0){var i=e.To_Account;e.To_Account.length>50&&(i=e.To_Account.slice(0,50),Je.w("".concat(t," To_Account must be less than or equal to 50."))),a.receiverList=m(i),e.To_Account=m(i)}1!==e.IsNeedReadReceipt&&1!==e.NeedReadReceipt||(a.needReadReceipt=!0),1===e.SupportMessageExtension&&(a.isSupportExtension=!0),(n=new pa(a)).status=fn.UNSEND,e.MsgClientTime=n.clientTime,n.conversationType===S.CONV_C2C&&(e.MsgSeq=n.sequence);for(var s,r=e.MsgBody.length,c=0;c100)return n--,t;if(vt(t)){var a=t.map((function(t){return ht(t)?e(t,o):t}));return n--,a}if(ht(t)){var i=(s=t,r=function(e,t){if(!Dt(t))return!1;if((a=t)!==Vi(a))for(var n=0;n65535)return Yi(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?Yi(192|t>>>6,128|63&t):Yi(224|t>>>12,128|t>>>6&63,128|63&t)},ji=function(e){for(var t=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,Wi),n=0|t.length,o=new Uint8Array(n),a=0;a0)for(var c=0;c=i&&(Je.l("".concat(e._n,"._checkPromiseMap request timeout, delete requestID:").concat(n)),e._promiseMap.delete(n),o(new ko({code:Ao.NETWORK_TIMEOUT})),e._channelModule.onRequestTimeout(n))}))}},{key:"onOpen",value:function(e){if(""!==this._readyState){this._onOpenTs=Date.now();var t=e.id;this._socketID=t;var n=un(this._startTs,!1);Je.l("".concat(this._n,"._onOpen cost:").concat(n," ms. socketID:").concat(t)),new Xo("wsOnOpen").setMessage(n).setCostTime(n).setMoreMessage("socketID:".concat(t)).end(),e.id===this._socketID&&(this._readyState=es,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:"onClose",value:function(e){var t=new Xo("wsOnClose"),n=e.id,o=e.e,a="sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID," code:").concat(o.code," reason:").concat(o.reason),i=0;0!==this._onOpenTs&&(i=Date.now()-this._onOpenTs),t.setMessage(i).setCostTime(i).setMoreMessage(a).setCode(o.code).end(),Je.l("".concat(this._n,"._onClose ").concat(a," onlineTime:").concat(i)),n===this._socketID&&(this._readyState=ns,i<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:"onError",value:function(e){var t=e.id,n=e.e,o="sourceSocketID:".concat(t," currentSocketID:").concat(this._socketID);new Xo("wsOnError").setMessage(n.errMsg||St(n)).setMoreMessage(o).setLevel("error").end(),Je.w("".concat(this._n,"._onError"),n,o),t===this._socketID&&(this._readyState="",this._channelModule.onError())}},{key:"onMessage",value:function(e){var t;try{t=JSON.parse(e.data)}catch(u){new Xo("jsonParseError").setMessage(e.data).end()}if(t&&t.head){var n=this._getRequestIDFromHead(t.head),o=t.body;if(!this._channelModule.getModule(To).isTRTCCommand(n)){var a=zt(t.head);o=Ki(t.body,this._getResponseKeyMap(a))}if(Je.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(o)," requestID:").concat(n," has:").concat(this._promiseMap.has(n))),this._setNextPingTs(),this._promiseMap.has(n)){var i=this._promiseMap.get(n),s=i.resolve,r=i.reject,c=i.timestamp;return this._promiseMap.delete(n),this._calcRTT(c),void(o.errorCode&&0!==o.errorCode?(this._channelModule.onErrorCodeNotZero(o),r(new ko({code:o.errorCode,message:o.errorInfo||"",data:n.includes(Uo.MODIFY_C2C_MESSAGE)||n.includes(Uo.MODIFY_GROUP_MESSAGE)?{elements:o.elements,messageVersion:o.messageVersion,cloudCustomData:o.cloudCustomData}:void 0}))):s(No(o)))}this._channelModule.onMessage({head:t.head,body:o})}}},{key:"_calcRTT",value:function(e){var t=Date.now()-e;this._channelModule.getModule(mo).addRTT(t)}},{key:"_connect",value:function(){this._startTs=Date.now(),this._onOpenTs=0,this._socket=new zi(this),this._socketID=this._socket.getID(),this._readyState=ts,Je.l("".concat(this._n,"._connect isWorkerEnabled:").concat(this.getIsWorkerEnabled()," socketID:").concat(this._socketID," url:").concat(this.getURL())),new Xo("wsConnect").setMessage("socketID:".concat(this._socketID," url:").concat(this.getURL())).end()}},{key:"getURL",value:function(){this._channelModule.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=Yt();(ae||$&&"windows"===e||se)&&(this._canIUseBinaryFrame=!1);var t=-1;"ios"===e?t=ye||-1:"android"===e&&(t=Ce||-1);var n=this._channelModule.getModule(io),o=this._channelModule.getPlatform(),a=n.getSDKAppID(),i=n.getInstanceID(),s="sdkappid=".concat(a,"&instanceid=").concat(i,"&random=").concat(this._getRandom(),"&platform=").concat(o,"&host=").concat(e,"&version=").concat(t,"&sdkversion=").concat("3.2.3");return ee&&(s+="&isminigame=1"),this._canIUseBinaryFrame?"".concat(this._url,"/binfo?").concat(s):"".concat(this._url,"/info?").concat(s)}},{key:"_closeConnection",value:function(e){Je.l("".concat(this._n,"._closeConnection socketID:").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=ns)}},{key:"_resend",value:function(){var e=this;if(Je.l("".concat(this._n,"._resend reConnectFlag:").concat(this._reConnectFlag),"promiseMap.size:".concat(this._promiseMap.size," simpleRequestMap.size:").concat(this._simpleRequestMap.size)),this._promiseMap.size>0&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,a=t.resolve,i=t.reject;e._promiseMap.set(n,{resolve:a,reject:i,timestamp:Date.now(),uplinkData:o}),e._execute(n,o)})),this._simpleRequestMap.size>0){var t,n=D(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=v(t.value,2),a=o[0],i=o[1];this._execute(a,i)}}catch(s){n.e(s)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(e){var t=this;e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var n=_(e,Zi),o=this._getRequestIDFromHead(e.head),a=JSON.stringify(n);return new Promise((function(e,i){(t._promiseMap.set(o,{resolve:e,reject:i,timestamp:Date.now(),uplinkData:a}),Je.d("".concat(t._n,".send uplinkData:").concat(JSON.stringify(n)," requestID:").concat(o," readyState:").concat(t._readyState)),t._readyState!==es)?t._reConnect():(t._execute(o,a),t._channelModule.getModule(mo).addRequestCount())}))}},{key:"simplySend",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var t=_(e,$i),n=this._getRequestIDFromHead(e.head),o=JSON.stringify(t);this._readyState!==es?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(e){this.getModule(_o).onErrorCodeNotZero(e)}},{key:"onMessage",value:function(e){this.getModule(_o).onMessage(e)}},{key:"send",value:function(e){if(!this._socketHandler)return Promise.reject();if(this._previousState!==S.NET_STATE_CONNECTED&&e.head.servcmd.includes(Uo.SSO_STAT))return this.reConnect(),this.getModule(io).getProxyServer()?Promise.resolve():this._sendLogViaHTTP(e);return this._socketHandler.send(e)}},{key:"_sendLogViaHTTP",value:function(e){var t=B.HOST.CURRENT.STAT;return new Promise((function(n,o){var a="".concat(t,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e.head.sdkappid,"&reqtime=").concat(Date.now()),i=JSON.stringify(e.body),s="application/x-www-form-urlencoded;charset=UTF-8";if(ce)le.request({url:a,data:i,method:"POST",timeout:3e3,header:{"content-type":s},success:function(){n()},fail:function(){o(new ko({code:Ao.NETWORK_ERROR}))}});else{var r=new XMLHttpRequest,c=setTimeout((function(){r.abort(),o(new ko({code:Ao.NETWORK_TIMEOUT}))}),3e3);r.onreadystatechange=function(){4===r.readyState&&(clearTimeout(c),200===r.status||304===r.status?n():o(new ko({code:Ao.NETWORK_ERROR})))},r.open("POST",a,!0),r.setRequestHeader("Content-type",s),r.send(i)}}))}},{key:"simplySend",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&(this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED));this.reConnect()}},{key:"onError",value:function(){ce&&!se&&this.outputWarning("DomainNameInMP"),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(e){return this.getModule(_o).getKeyMap(e)}},{key:"_onAppHide",value:function(){this._isAppShowing=!1}},{key:"_onAppShow",value:function(){this._isAppShowing=!0}},{key:"onRequestTimeout",value:function(e){}},{key:"onReconnected",value:function(){Je.l("".concat(this._n,".onReconnected cost:").concat(un(this._disconnectedTS,!0,!1))),this._m.restartTimer(),this.getModule(_o).onReconnected(un(this._disconnectedTS,!1,!1)),this._disconnectedTS=0,this._emitNetStateChangeEvent(S.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){Je.l("".concat(this._n,".onReconnectFailed")),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1;this._socketHandler&&(t=this._socketHandler.getReconnectFlag());var n="forcedFlag:".concat(e," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(t);if(Je.l("".concat(this._n,".reConnect ").concat(n)),!this._fatalErrorFlag&&this._socketHandler){if(!0===e)this._socketHandler.forcedReconnect();else{if(this._previousState===S.NET_STATE_CONNECTING&&t)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(S.NET_STATE_CONNECTING)}}},{key:"_emitNetStateChangeEvent",value:function(e){this._previousState!==e&&(Je.l("".concat(this._n,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(e)),e===S.NET_STATE_DISCONNECTED&&0===this._disconnectedTS&&(this._disconnectedTS=Date.now()),this._previousState=e,this.emitOuterEvent(E.NET_STATE_CHANGE,{state:e}))}},{key:"_ping",value:function(){var e=this;if(!0!==this._probing){this._probing=!0;var t=this.getModule(_o).getProtocolData({protocolName:Uo.PING});this.send(t).then((function(){e._probing=!1})).catch((function(t){if(Je.w("".concat(e._n,"._ping failed. error:"),t),e._probing=!1,t&&60002===t.code)return new Xo("error").setMessage("code:".concat(t.code," message:").concat(t.message)).setNetworkType(e.getModule(co).getNetworkType()).end(),e._fatalErrorFlag=!0,void e._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED);e.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];Je.l("".concat(e._n,"._ping failed. probe network, isAppShowing:").concat(e._isAppShowing," online:").concat(o," networkType:").concat(a)),o?e.reConnect():e._emitNetStateChangeEvent(S.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),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._previousState=S.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3),this._disconnectedTS=0}}]),n}(Po),is=["a2","tinyid"],ss=["a2","tinyid"],rs=function(){function e(t){o(this,e),this._n="ProtocolHandler",this._sessionModule=t,this._configMap=new Map,this._fillConfigMap()}return i(e,[{key:"_fillConfigMap",value:function(){this._configMap.clear();var e=this._sessionModule.genCommonHead(),n=this._sessionModule.genCosSpecifiedHead(),o=this._sessionModule.genSSOReportHead();this._configMap.set(Uo.LOGIN,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.LOGIN)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}}(e)),this._configMap.set(Uo.LOGOUT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.LOGOUT)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}}(e)),this._configMap.set(Uo.HELLO,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(Uo.KICK_OTHER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.STAT_SERVICE,".").concat(Uo.KICK_OTHER)}),body:{}}}(e)),this._configMap.set(Uo.COS_SIGN,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_COS_SIGN,".").concat(Uo.COS_SIGN)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{request:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},response:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}}(n)),this._configMap.set(Uo.COS_PRE_SIG,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.CUSTOM_UPLOAD,".").concat(Uo.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},response:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}}(n)),this._configMap.set(Uo.SIMPLE_COS_PRE_SIG,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.CUSTOM_UPLOAD,".").concat(Uo.SIMPLE_COS_PRE_SIG)}),body:{uploadMethod:0,platform:2,SDKAppID:0,userID:"",conversationType:1,uploadConfig:[{fileID:1,fileType:1,fileName:""}]},keyMap:{request:{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"},response:{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"}}}}(n)),this._configMap.set(Uo.GET_IMAGE_INFO,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.CUSTOM_UPLOAD,".").concat(Uo.GET_IMAGE_INFO)}),body:{imageUrl:""},keyMap:{request:{imageUrl:"str_image_url"},response:{rpt_msg_image_info:"imageInfoArray",uint32_image_type:"type",str_url:"url",uint32_width:"width",uint32_height:"height",str_image_format:"imageFormat"}}}}(n)),this._configMap.set(Uo.GET_IP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.CUSTOM_UPLOAD,".").concat(Uo.GET_IP)}),body:{domainName:""},keyMap:{request:{domainName:"str_domain"},response:{str_final_ip:"ip"}}}}(n)),this._configMap.set(Uo.VIDEO_COVER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.CUSTOM_UPLOAD,".").concat(Uo.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},response:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}}(n)),this._configMap.set(Uo.FETCH_COMMERCIAL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_CONFIG_MANAGER,".").concat(Uo.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:"uint32_sdkappid"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(Uo.PUSHED_COMMERCIAL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_CONFIG_MANAGER,".").concat(Uo.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(Uo.FETCH_CLOUD_CONTROL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_CONFIG_MANAGER,".").concat(Uo.FETCH_CLOUD_CONTROL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(Uo.PUSHED_CLOUD_CONTROL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_CONFIG_MANAGER,".").concat(Uo.PUSHED_CLOUD_CONTROL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(Uo.OVERLOAD_NOTIFY,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OVERLOAD_PUSH,".").concat(Uo.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}}(e)),this._configMap.set(Uo.SYNC_UNREAD_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.SYNC_UNREAD_MESSAGE)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},response:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"to",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}}(e)),this._configMap.set(Uo.GET_PROFANITY_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_MSG_AUDIT_MGR,".").concat(Uo.GET_PROFANITY_LIST)}),body:{version:0,deviceID:"",startIndex:void 0},keyMap:{request:{version:"uint64_version",deviceID:"str_device_id",startIndex:"uint64_start_index"},response:{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"}}}}(e)),this._configMap.set(Uo.SEND_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.SEND_C2C_MESSAGE)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0,isRelayMessage:0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",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"}}}}(e)),this._configMap.set(Uo.SEND_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.SEND_GROUP_MESSAGE)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0,isRelayMessage:0},keyMap:{request:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",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"},response:{MsgTime:"time",MsgSeq:"sequence"}}}}(e)),this._configMap.set(Uo.REVOKE_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.REVOKE_C2C_MESSAGE)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}}(e)),this._configMap.set(Uo.REVOKE_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.REVOKE_GROUP_MESSAGE)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}}(e)),this._configMap.set(Uo.GET_C2C_ROAMING_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.GET_C2C_ROAMING_MESSAGE)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},response:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer"}}}}(e)),this._configMap.set(Uo.MODIFY_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.MODIFY_C2C_MESSAGE)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(Uo.GET_GROUP_ROAMING_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_ROAMING_MESSAGE)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{request:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},response:{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"}}}}(e)),this._configMap.set(Uo.SET_C2C_MESSAGE_READ,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.SET_C2C_MESSAGE_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}}(e)),this._configMap.set(Uo.SET_C2C_PEER_MUTE_NOTIFICATIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}}(e)),this._configMap.set(Uo.GET_C2C_PEER_MUTE_NOTIFICATIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{toAccount:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Peer_Account"},response:{MuteNotificationsList:"muteFlagList"}}}}(e)),this._configMap.set(Uo.SET_GROUP_MESSAGE_READ,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.SET_GROUP_MESSAGE_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:"MsgReadedSeq"}}}}(e)),this._configMap.set(Uo.SET_ALL_MESSAGE_READ,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.SET_ALL_MESSAGE_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},response:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}}(e)),this._configMap.set(Uo.DELETE_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.DELETE_C2C_MESSAGE)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.DELETE_GROUP_MESSAGE)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}}(e)),this._configMap.set(Uo.TRANSLATE_TEXT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_TRANSLATE,".").concat(Uo.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:"",target:""},keyMap:{request:{sourceTextList:"SourceText",SDKAppID:"SdkAppId",from:"FromAccount"},response:{TargetText:"translatedTextList",RequestId:"requestID",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}}(e)),this._configMap.set(Uo.VOICE_TO_TEXT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_SPEECH,".").concat(Uo.VOICE_TO_TEXT)}),body:{url:"",SDKAppID:0,format:"",sourceType:0,language:""},keyMap:{request:{url:"BytesUrl",SDKAppID:"Uint32Sdkappid",format:"BytesVoiceFormat",sourceType:"Uint64SourceType",language:"BytesEngServiceType"},response:{BytesRequestid:"requestID",BytesResult:"result",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.MODIFY_GROUP_MESSAGE)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(Uo.GET_READ_RECEIPT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}}(e)),this._configMap.set(Uo.SEND_C2C_READ_RECEIPT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{request:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}}(e)),this._configMap.set(Uo.SEND_READ_RECEIPT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.SEND_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}}(e)),this._configMap.set(Uo.GET_READ_RECEIPT_DETAIL,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_READ_RECEIPT_DETAIL)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:"MsgSeq",count:"Num"},response:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}}(e)),this._configMap.set(Uo.MODIFY_C2C_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.MODIFY_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Uo.GET_C2C_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.GET_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Uo.GET_GROUP_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.GET_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}}(e)),this._configMap.set(Uo.MESSAGE_CLOUD_SEARCH,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.MESSAGE_SEARCH,".").concat(Uo.MESSAGE_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:{request:{keywordListMatchType:"MatchType",account:"PeerAccount",groupID:"GroupID",messageTypeList:"MsgTypeList",senderUserIDList:"SendUserIDList"},response:{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"}}}}(e)),this._configMap.set(Uo.ADD_C2C_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.ADD_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Add_Account"}}}}(e)),this._configMap.set(Uo.REMOVE_C2C_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.REMOVE_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Del_Account"}}}}(e)),this._configMap.set(Uo.GET_C2C_MSG_REACTIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.GET_C2C_MSG_REACTIONS)}),body:{from:void 0,to:void 0,messageKeyList:void 0,count:void 0}}}(e)),this._configMap.set(Uo.GET_C2C_MSG_REACTION_USER_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.GET_C2C_MSG_REACTION_USER_LIST)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,count:void 0}}}(e)),this._configMap.set(Uo.ADD_GRP_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.ADD_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Add_Account"}}}}(e)),this._configMap.set(Uo.REMOVE_GRP_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.REMOVE_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{request:{userIDList:"Del_Account"}}}}(e)),this._configMap.set(Uo.GET_GRP_MSG_REACTIONS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.GET_GRP_MSG_REACTIONS)}),body:{groupID:void 0,topicID:void 0,messageSequenceList:void 0,count:void 0},keyMap:{response:{MsgSeq:"messageSequence"}}}}(e)),this._configMap.set(Uo.GET_GRP_MSG_REACTION_USER_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM_MSG_EXT,".").concat(Uo.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}}}(e)),this._configMap.set(Uo.GET_C2C_PEER_READ_TIME,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.GET_C2C_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}}(e)),this._configMap.set(Uo.PAGING_GET_CONVERSATION_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.PAGING_GET_CONVERSATION_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:{request:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},response:{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"}}}}(e)),this._configMap.set(Uo.DELETE_CONVERSATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.DELETE_CONVERSATION)}),body:{fromAccount:"",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble",conversationList:"ContactItem"},response:{ResultItem:"resultList",ToGroupid:"groupID",ResultCode:"code",ResultInfo:"info"}}}}(e)),this._configMap.set(Uo.CLEAR_HISTORY_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.CLEAR_HISTORY_MESSAGE)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:"ToGroupid"}}}}(e)),this._configMap.set(Uo.PIN_CONVERSATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.PIN_CONVERSATION)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_AT_TIPS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.DELETE_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(Uo.SET_CONVERSATION_CUSTOM_DATA,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Uo.MARK_CONVERSATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Uo.CREATE_CONVERSATION_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Uo.DELETE_CONVERSATION_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.DELETE_CONVERSATION_GROUP)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}}(e)),this._configMap.set(Uo.RENAME_CONVERSATION_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},response:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}}(e)),this._configMap.set(Uo.ADD_CONVERSATIONS_TO_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Uo.DELETE_CONVERSATIONS_FROM_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Uo.GET_CONVERSATION_GROUP_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.RECENT_CONTACT,".").concat(Uo.GET_CONVERSATION_GROUP_LIST)}),body:{fromAccount:"",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}}(e)),this._configMap.set(Uo.GET_USER_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.PROFILE,".").concat(Uo.GET_USER_PROFILE)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(Uo.UPDATE_MY_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.PROFILE,".").concat(Uo.UPDATE_MY_PROFILE)}),body:{fromAccount:"",profileItem:[{tag:Xe.NICK,value:""},{tag:Xe.GENDER,value:""},{tag:Xe.ALLOWTYPE,value:""},{tag:Xe.AVATAR,value:""}]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(Uo.GET_BLACKLIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.GET_BLACKLIST)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}}(e)),this._configMap.set(Uo.ADD_TO_BLACKLIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.ADD_TO_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(Uo.REMOVE_FROM_BLACKLIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.REMOVE_FROM_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(Uo.SET_SELF_STATUS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.SET_SELF_STATUS)}),body:{customStatus:""},keyMap:{}}}(e)),this._configMap.set(Uo.GET_USER_STATUS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}}(e)),this._configMap.set(Uo.SUBSCRIBE_USER_STATUS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.SUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(Uo.UNSUBSCRIBE_USER_STATUS,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.UNSUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.GET_FRIEND_LIST)}),body:{fromAccount:"",startIndex:0,standardSequence:0,customSequence:0},keyMap:{response:{FriendNum:"friendCount",UserDataItem:"resultList",ValueItem:"tagValueList"}}}}(e)),this._configMap.set(Uo.ADD_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.ADD_FRIEND)}),body:{fromAccount:"",addFriendItem:[],type:""},keyMap:{request:{source:"AddSource",wording:"AddWording",type:"AddType"},response:{ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.UPDATE_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.UPDATE_FRIEND)}),body:{fromAccount:"",updateItem:void 0},keyMap:{request:{snsItem:"SnsItem"},response:{ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.DELETE_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.DELETE_FRIEND)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"DeleteType"},response:{ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.GET_FRIEND_PROFILE)}),body:{fromAccount:"",userIDList:void 0},keyMap:{response:{InfoItem:"resultList",SnsProfileItem:"tagValueList"}}}}(e)),this._configMap.set(Uo.CHECK_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.CHECK_FRIEND)}),body:{fromAccount:"",userIDList:[],type:""},keyMap:{request:{type:"CheckType"},response:{InfoItem:"resultList"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_APPLICATION_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.GET_FRIEND_APPLICATION_LIST)}),body:{fromAccount:"",applicationType:"",startTime:0,maxLimited:0,lastSequence:0},keyMap:{response:{PendencyItem:"resultList",AddSource:"source",AddTime:"time",AddWording:"wording",Image:"avatar",UnreadPendencyCount:"unreadCount",To_Account:"userID",PendencyType:"type"}}}}(e)),this._configMap.set(Uo.RESPOND_FRIEND_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.RESPOND_FRIEND_APPLICATION)}),body:{fromAccount:"",responseFriendItem:[]},keyMap:{request:{tag:"TagName",action:"ResponseAction"},response:{ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.DELETE_FRIEND_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.DELETE_FRIEND_APPLICATION)}),body:{fromAccount:"",type:"",userIDList:void 0},keyMap:{request:{type:"PendencyType",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.REPORT_FRIEND_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.REPORT_FRIEND_APPLICATION)}),body:{fromAccount:"",latestTimeStamp:""},keyMap:{request:{latestTimeStamp:"LatestPendencyTimeStamp"}}}}(e)),this._configMap.set(Uo.CREATE_FRIEND_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.CREATE_FRIEND_GROUP)}),body:{fromAccount:"",groupName:void 0,userIDList:void 0},keyMap:{request:{groupName:"GroupName",userIDList:"To_Account"},response:{ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.DELETE_FRIEND_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.DELETE_FRIEND_GROUP)}),body:{fromAccount:"",nameList:void 0},keyMap:{request:{nameList:"GroupName"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_GROUP_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.GET_FRIEND_GROUP_LIST)}),body:{fromAccount:"",lastSequence:0,needFriend:"Need_Friend_Type_Yes"},keyMap:{response:{ResultItem:"resultList",GroupName:"name",FriendNumber:"friendCount",To_Account:"userIDList"}}}}(e)),this._configMap.set(Uo.UPDATE_FRIEND_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.FRIEND,".").concat(Uo.UPDATE_FRIEND_GROUP)}),body:{fromAccount:"",oldName:"",newName:void 0,updateGroupItem:void 0},keyMap:{request:{oldName:"GroupOldName",newName:"GroupNewName"},response:{UpdateType:"type",ResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.GET_GROUP_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_LIST)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:"Member_Account"},response:{GroupIdList:"groups",NoUnreadSeqList:"excludedUnreadSequenceList",MsgSeq:"readedSequence",LastRecallTime:"_lastRevokedTime"}}}}(e)),this._configMap.set(Uo.GET_GROUP_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_PROFILE)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:void 0,groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(Uo.CREATE_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.CREATE_GROUP)}),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:{request:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",inviteOption:"InviteJoinOption"},response:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}}(e)),this._configMap.set(Uo.DISMISS_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.DISMISS_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(Uo.UPDATE_GROUP_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.UPDATE_GROUP_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:{request:{groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl",inviteOption:"InviteJoinOption"},response:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(Uo.APPLY_JOIN_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},response:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}}(e)),this._configMap.set(Uo.APPLY_JOIN_GROUP_NOAUTH,function(e){return e.a2,e.tinyid,{head:t(t({},_(e,is)),{},{servcmd:"".concat(B.NAME.BIG_GROUP_NO_AUTH,".").concat(Uo.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:"ApplyMsg"},response:{HugeGroupFlag:"avChatRoomFlag"}}}}(e)),this._configMap.set(Uo.QUIT_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.QUIT_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(Uo.SEARCH_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.SEARCH_GROUP)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption","InviteJoinOption"]}},keyMap:{response:{}}}}(e)),this._configMap.set(Uo.CHANGE_GROUP_OWNER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.CHANGE_GROUP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}}(e)),this._configMap.set(Uo.HANDLE_GROUP_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.HANDLE_GROUP_APPLICATION)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(Uo.HANDLE_INVITE_JOIN_GROUP,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.HANDLE_INVITE_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",invitee:"Invited_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg"}}}}(e)),this._configMap.set(Uo.HANDLE_GROUP_INVITATION,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.HANDLE_GROUP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(Uo.GET_GROUP_PENDENCY,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_PENDENCY)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:"Handle_Account"},response:{To_Account:"userID",ApplyInviteMsg:"note"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_SYSTEM_NOTICE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.DELETE_GROUP_SYSTEM_NOTICE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(Uo.AVCHATROOM_POLLING,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.BIG_GROUP_LONG_POLLING,".").concat(Uo.AVCHATROOM_POLLING)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(Uo.AVCHATROOM_NOAUTH_POLLING,function(e){return e.a2,e.tinyid,{head:t(t({},_(e,ss)),{},{servcmd:"".concat(B.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,".").concat(Uo.AVCHATROOM_POLLING)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(Uo.GET_ONLINE_MEMBER_NUM,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_ONLINE_MEMBER_NUM)}),body:{groupID:void 0},keyMap:{response:{OnlineMemberNum:"memberCount"}}}}(e)),this._configMap.set(Uo.SET_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.SET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.MODIFY_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.DELETE_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key"}}}}(e)),this._configMap.set(Uo.CLEAR_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.CLEAR_GROUP_ATTRIBUTES)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}}(e)),this._configMap.set(Uo.GET_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_ATTR,".").concat(Uo.GET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}}(e)),this._configMap.set(Uo.GET_GROUP_NOTIFY,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_NOTIFY)}),body:{notifyReqList:[]},keyMap:{request:{notifyReqList:"NotifyReqList"},response:{NextMsgTime:"nextRevokedTime",NotifyMsgList:"notifyList",NotifyRspList:"notifyRspList"}}}}(e)),this._configMap.set(Uo.UPDATE_GROUP_COUNTER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.UPDATE_GROUP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:"GroupCounter"}}}}(e)),this._configMap.set(Uo.GET_GROUP_COUNTER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:"GroupCounterKeys"}}}}(e)),this._configMap.set(Uo.CREATE_TOPIC,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_COMMUNITY,".").concat(Uo.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:{request:{avatar:"FaceUrl"}}}}(e)),this._configMap.set(Uo.DELETE_TOPIC,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_COMMUNITY,".").concat(Uo.DELETE_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}}(e)),this._configMap.set(Uo.UPDATE_TOPIC_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_COMMUNITY,".").concat(Uo.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:{request:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}}(e)),this._configMap.set(Uo.GET_TOPIC_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_COMMUNITY,".").concat(Uo.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:["NoUnreadSeqList"]},keyMap:{request:{topicIDList:"TopicIdList"},response:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence",NoUnreadSeqList:"excludedUnreadSequenceList"}}}}(e)),this._configMap.set(Uo.GET_GROUP_MEMBER_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_MEMBER_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}}(e)),this._configMap.set(Uo.GET_AVCHATROOM_MEMBER_LIST,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_AVCHATROOM,".").concat(Uo.GET_AVCHATROOM_MEMBER_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:"Timestamp",filter:"Mark"},response:{NextTimestamp:"offset"}}}}(e)),this._configMap.set(Uo.GET_GROUP_MEMBER_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.GET_GROUP_MEMBER_PROFILE)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}}(e)),this._configMap.set(Uo.ADD_GROUP_MEMBER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.ADD_GROUP_MEMBER)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_MEMBER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.DELETE_GROUP_MEMBER)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}}(e)),this._configMap.set(Uo.BAN_AVCHATROOM_MEMBER,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.BAN_AVCHATROOM_MEMBER)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_MEMBER_INFO,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP,".").concat(Uo.MODIFY_GROUP_MEMBER_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:{request:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}}(e)),this._configMap.set(Uo.MARK_AVCHATROOM_MEMBER_INFO,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.GROUP_AVCHATROOM,".").concat(Uo.MARK_AVCHATROOM_MEMBER_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:"CommandType",memberList:"MemberList",markType:"Marks",userID:"Member_Account"},response:{CommandType:"operationType",Marks:"markType",Member_Account:"userID"}}}}(e)),this._configMap.set(Uo.SSO_STAT,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STAT,".").concat(Uo.SSO_STAT)}),body:{header:{},event:[],quality:[]},keyMap:{request:{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"}}}}(o)),this._configMap.set(Uo.PING,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.HEARTBEAT,".").concat(Uo.PING)}),body:{}}}(e)),this._configMap.set(Uo.MESSAGE_PUSH,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_PUSH,".").concat(Uo.MESSAGE_PUSH)}),body:{},keyMap:{response:{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"}}}}(e)),this._configMap.set(Uo.MULTI_MESSAGE_PUSH,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_PUSH,".").concat(Uo.MULTI_MESSAGE_PUSH)}),body:{},keyMap:{response:{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"}}}}(e)),this._configMap.set(Uo.MESSAGE_PUSH_ACK,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.OPEN_IM,".").concat(Uo.MESSAGE_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}}(e)),this._configMap.set(Uo.STATUS_FORCE_OFFLINE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(Uo.DOWNLOAD_MERGER_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_LONG_MESSAGE,".").concat(Uo.DOWNLOAD_MERGER_MESSAGE)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}}(e)),this._configMap.set(Uo.UPLOAD_MERGER_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_LONG_MESSAGE,".").concat(Uo.UPLOAD_MERGER_MESSAGE)}),body:{messageList:[]},keyMap:{request:{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"}}}}(e)),this._configMap.set(Uo.SET_TOKEN,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.SET_TOKEN)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns"}}}}(e)),this._configMap.set(Uo.STAT_FOREGROUND,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.STAT_FOREGROUND)}),body:{isWebUniapp:0}}}(e)),this._configMap.set(Uo.STAT_BACKGROUND,function(e){return{head:t(t({},e),{},{servcmd:"".concat(B.NAME.IM_OPEN_STATUS,".").concat(Uo.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}}(e))}},{key:"has",value:function(e){return this._configMap.has(e)}},{key:"get",value:function(e){return this._configMap.get(e)}},{key:"update",value:function(){this._fillConfigMap()}},{key:"getKeyMap",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(Je.w("".concat(this._n,".getKeyMap unknown protocolName:").concat(e)),{})}},{key:"getProtocolData",value:function(e){var t=e.protocolName,n=e.requestData,o=this.get(t),a=null;if(n){var i=this._simpleDeepCopy(o),s=this._updateService(n,i),r=s.body,c=Object.create(null);for(var u in r)if(Object.prototype.hasOwnProperty.call(r,u)){if(c[u]=r[u],void 0===n[u])continue;c[u]=n[u]}s.body=c,a=this._getUplinkData(s)}else a=this._getUplinkData(o);return a}},{key:"_getUplinkData",value:function(e){var t=this._requestDataCleaner(e),n=zt(t.head),o=Bi(t.body,this._getRequestKeyMap(n));return t.body=o,t}},{key:"_updateService",value:function(e,t){var n=zt(t.head);if(this._isFromGroupRequest(t)){var o=e.type,a=e.groupID,i=void 0===a?void 0:a,s=e.groupIDList,r=void 0===s?[]:s;mt(i)&&(i=r[0]||""),wt({type:o,groupID:i})&&(t.head.servcmd="".concat(B.NAME.GROUP_COMMUNITY,".").concat(n))}return t}},{key:"_isFromGroupRequest",value:function(e){return e.head.servcmd.includes(B.NAME.GROUP)||e.head.servcmd.includes(B.NAME.GROUP_ATTR)}},{key:"_getRequestKeyMap",value:function(e){var n=this.getKeyMap(e);return t(t({},xi.request),n.request)}},{key:"_requestDataCleaner",value:function(e){var t=Array.isArray(e)?[]:Object.create(null);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&Dt(o)&&null!==e[o]&&void 0!==e[o]&&("object"!==n(e[o])?t[o]=e[o]:t[o]=this._requestDataCleaner.bind(this)(e[o]));return t}},{key:"_simpleDeepCopy",value:function(e){for(var t,n=Object.keys(e),o={},a=0,i=n.length;a1e3*a)return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;r+=1,this._commandRequestInfoMap.set(t,{startTime:s,requestCount:r});var c=!1;return r>o&&(c=!0),c}},{key:"_isServerOverload",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var t=this._serverOverloadInfoMap.get(e),n=t.overloadTime,o=t.waitingTime,a=!1;return Date.now()-n<=1e3*o?a=!0:(this._serverOverloadInfoMap.delete(e),a=!1),a}},{key:"_getCmd",value:function(e){var t="";if(!e.includes("."))return t;var n=e.split(".")[1];for(var o in Uo)if(Uo[o]===n){t=o;break}return t}},{key:"onPushedServerOverload",value:function(e){var t=e.overloadCommand,n=e.waitingTime;this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:n}),Je.w("".concat(this._n,".onPushedServerOverload waitingTime:").concat(n,"s cmd:").concat(this._getCmd(t)))}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._updateCommandFrequencyLimitMap(ls),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear(),this._incrementalPullContactFlag=!0}}]),a}(Po),vs=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="CloudControlModule",a._cloudConfig=new Map,a._expiredTime=0,a._version=0,a._isFetching=!1,a}return i(n,[{key:"getCloudConfig",value:function(e){return mt(e)?this._cloudConfig:this._cloudConfig.has(e)?this._cloudConfig.get(e):void 0}},{key:"getServerConfig",value:function(e){var t={code:0,data:""};return!mt(e)&&this._cloudConfig.has(e)&&(t.data=this._cloudConfig.get(e)),Promise.resolve(t)}},{key:"_canFetchConfig",value:function(){return this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetchConfig();if(Je.l("".concat(this._n,".fetchConfig canFetchConfig:").concat(t)),t){var n=new Xo("fetchCloudControlConfig"),o=this.getModule(io).getSDKAppID();this._isFetching=!0,this.request({protocolName:Uo.FETCH_CLOUD_CONTROL_CONFIG,requestData:{SDKAppID:o,version:this._version}}).then((function(t){e._isFetching=!1,n.setMessage("version:".concat(e._version," newVersion:").concat(t.data.version," config:").concat(t.data.cloudControlConfig)).setNetworkType(e.getNetworkType()).end(),Je.l("".concat(e._n,".fetchConfig ok")),e._parseCloudControlConfig(t.data)})).catch((function(t){e._isFetching=!1,e.probeNetwork().then((function(e){var o=v(e,2),a=o[0],i=o[1];n.setError(t,a,i).end()})),Je.l("".concat(e._n,".fetchConfig failed. error:"),t),e._setExpiredTimeOnResponseError(12e4)}))}}},{key:"onPushedCloudControlConfig",value:function(e){Je.l("".concat(this._n,".onPushedCloudControlConfig")),new Xo("pushedCloudControlConfig").setNetworkType(this.getNetworkType()).setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:"onCheckTimer",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:"_parseCloudControlConfig",value:function(e){var t=this,n="".concat(this._n,"._parseCloudControlConfig"),o=e.errorCode,a=e.errorMessage,i=e.cloudControlConfig,s=e.version,r=e.expiredTime;if(0===o){if(this._version!==s){var c=null;try{c=JSON.parse(i)}catch(u){this.isPrivateNetWork()||Je.e("".concat(n," JSON parse error. cloudControlConfig:"),i)}c&&(this._cloudConfig.clear(),Object.keys(c).forEach((function(e){t._cloudConfig.set(e,c[e])})),this._version=s,this.emitInnerEvent(ha.CLOUD_CONFIG_UPDATED))}this._expiredTime=Date.now()+1e3*r}else mt(o)?(Je.l("".concat(n," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(Je.e("".concat(n," errorCode:").concat(o," errorMessage:").concat(a)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(Po),ms=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="RecoverMessageModule",a.PULL_LIMIT_COUNT=15,a}return i(n,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var e,t,n=this,o=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),a=this.getModule(ao),i=0,s=0,r=0,c=[];o.forEach((function(o){var u=o.conversationID,l=o.lastMessage;t=u.replace(S.CONV_GROUP,""),e=a.getLocalLastMessage(u),l&&0!==l.lastSequence&&e?(s=l.lastSequence,i=e.sequence,r=s-i,i>0&&r>=1&&r<300?n._recoverGroupMessage({groupID:t,localLastMessageSequence:i,remoteLastMessageSequence:s}):c.push(t)):c.push(t)})),this._getGroupNotify(c)}},{key:"_recoverC2CChat",value:function(){var e,t=this,n=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C})),o=this.getModule(ao),a=0,i=0,s=0,r=[Promise.resolve()];n.forEach((function(n){var c=n.conversationID,u=n.lastMessage;e=o.getLocalLastMessage(c),u&&0!==u.lastTime&&e&&(i=u.lastTime,a=e.time,s=i-a,a>0&&s>=1&&s<=600&&r.push(t._recoverC2CMessage({conversationID:c,localLastMessageTime:a,remoteLastMessageTime:i})))})),Promise.all(r).then((function(){Je.l("".concat(t._n,"._recoverC2CChat all promise fulfilled, start to sync unread messages")),t.getModule(po).startSyncOnReconnected()}))}},{key:"_getLocalConversationList",value:function(){return this.getModule(ao).getLocalConversationList()}},{key:"_recoverGroupMessage",value:function(e){var t=this,n="".concat(this._n,"._recoverGroupMessage");Je.l("".concat(n," options:"),e);var o=e.groupID,a=e.localLastMessageSequence,i=e.remoteLastMessageSequence;this._getGroupRoamingMessage({groupID:o,sequence:a}).then((function(e){var a=e.data,s=a.complete,r=a.messageList;if(!mt(r)){var c=r[0].sequence,u="groupID:".concat(o," pkgLastSequence:").concat(c," remoteLastSequence:").concat(i," complete:").concat(s," count:").concat(r.length);Je.l("".concat(n," ").concat(u)),c1&&r.sort((function(e,t){return e.sequence-t.sequence}));for(var d=0;d1?t:1,o=e.length,a=[];if(o>0)for(var i=0;i0)for(var n=this.getModule(to),o=0,a=t.length;o=0&&this._e2eDelayArray.push(t)}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),Xt(n/t,1)}},{key:"_calcCountWithLimit",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e100&&(n=100),n}},{key:"_checkE2EDelayException",value:function(e,t){var n=e.filter((function(e){return e>t}));if(n.length>0){var o=n.length,a=Math.min.apply(Math,m(n)),i=Math.max.apply(Math,m(n)),s=this._calcAvg(n,o),r=Xt(o/e.length*100,2);if(r>50)new Xo("messageE2EDelayException").setMessage("count:".concat(o," min:").concat(a," max:").concat(i," avg:").concat(s," percent:").concat(r)).setLevel("warning").end()}}},{key:"getStatResult",value:function(){var e=this._e2eDelayArray.length;if(0===e)return null;var t=m(this._e2eDelayArray),n=this._calcCountWithLimit({e2eDelayArray:t,min:0,max:1}),o=this._calcCountWithLimit({e2eDelayArray:t,min:1,max:3}),a=this._calcPercent(n,e),i=this._calcPercent(o,e),s=this._calcAvg(t,e);return this._checkE2EDelayException(t,3),t.length=0,this.reset(),{totalCount:e,countLessThan1Second:n,percentOfCountLessThan1Second:a,countLessThan3Second:o,percentOfCountLessThan3Second:i,avgDelay:s}}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),e}(),Is=function(){function e(){o(this,e),this._n="AvgRTT",this._requestCount=0,this._rttArray=[]}return i(e,[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(e){this._rttArray.push(e)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(e){return e.length}},{key:"_calcSuccessRateOfRequest",value:function(e,t){if(0===t)return 0;var n=Xt(e/t*100,2);return n>100&&(n=100),n}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcMax",value:function(){return Math.max.apply(Math,m(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,m(this._rttArray))}},{key:"getStatResult",value:function(){var e=this._calcTotalCount(),t=m(this._rttArray);if(0===e)return null;var n=this._calcRTTCount(t),o=this._calcSuccessRateOfRequest(n,e),a=this._calcAvg(t,n);return Je.l("".concat(this._n,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(a)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:a}}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),e}(),ys=function(){function e(){o(this,e),this._map=new Map}return i(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:"addTotalCount",value:function(e){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).totalCount+=1,!0)}},{key:"addSuccessCount",value:function(e){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).successCount+=1,!0)}},{key:"addFailedCountOfUserSide",value:function(e){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).failedCountOfUserSide+=1,!0)}},{key:"addCost",value:function(e,t){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).costArray.push(t),!0)}},{key:"addFileSize",value:function(e,t){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).fileSizeArray.push(t),!0)}},{key:"_calcSuccessRateOfBusiness",value:function(e){if(mt(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=Xt(t.successCount/t.totalCount*100,2);return n>100&&(n=100),n}},{key:"_calcSuccessRateOfPlatform",value:function(e){if(mt(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=this._calcSuccessCountOfPlatform(e)/t.totalCount*100;return(n=Xt(n,2))>100&&(n=100),n}},{key:"_calcTotalCount",value:function(e){return mt(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(e){return mt(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(e){if(mt(e)||!this._map.has(e))return-1;var t=this._map.get(e);return t.successCount+t.failedCountOfUserSide}},{key:"_calcAvg",value:function(e){return mt(e)||!this._map.has(e)?-1:e===Ho?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:"_calcAvgCost",value:function(e){var t=this._map.get(e).costArray.length;if(0===t)return 0;var n=0;return this._map.get(e).costArray.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcAvgSpeed",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:"getStatResult",value:function(e){var t=this._calcTotalCount(e);if(0===t)return null;var n=this._calcSuccessCountOfBusiness(e),o=this._calcSuccessRateOfBusiness(e),a=this._calcSuccessCountOfPlatform(e),i=this._calcSuccessRateOfPlatform(e),s=this._calcAvg(e);return this.reset(e),{totalCount:t,successCountOfBusiness:n,successRateOfBusiness:o,successCountOfPlatform:a,successRateOfPlatform:i,avgValue:s}}},{key:"reset",value:function(e){mt(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),e}(),Ts=function(){function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}return i(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:"addMessageSequence",value:function(e){var t=e.key,n=e.message;if(mt(t)||!this._lastMap.has(t)||!this._currentMap.has(t))return!1;var o=n.conversationID,a=n.sequence,i=o.replace(S.CONV_GROUP,"");if(0===this._lastMap.get(t).size)this._addCurrentMap(e);else if(this._lastMap.get(t).has(i)){var s=this._lastMap.get(t).get(i),r=s.length-1;a>s[0]&&a100&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),Cs=function(e){r(a,e);var n=f(a);function a(e){var t;o(this,a),(t=n.call(this,e))._n="QualityStatModule",t.TAG="im-ssolog-quality-stat",t.reportIndex=0,t.wholePeriod=!1,t._qualityItems=[bo,wo,Fo,qo,xo,Vo,Ho,Bo,Ko,Yo],t._messageSentItems=[Fo,qo,xo,Vo,Ho],t._messageReceivedItems=[Bo,Ko,Yo],t.REPORT_INTERVAL=120,t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._statInfoArr=[],t._avgRTT=new Is,t._avgE2EDelay=new Ms,t._rateMessageSent=new ys,t._rateMessageReceived=new Ts;var i=t.getInnerEmitterInstance();return i.on(ha.A2KEY_AND_TINYID_UPDATED,t._onLoginSuccess,g(t)),i.on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:"_onLoginSuccess",value:function(){var e=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var t=this.getModule(so),n=t.getItem(this.TAG,!1);!pn(n)&&It(n.forEach)&&(Je.l("".concat(this._n,"._onLoginSuccess. logs count:").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("q_rpt_interval"),t=this.getCloudConfig("q_rpt_sdkappid_bl"),n=this.getCloudConfig("q_rpt_tinyid_wl");mt(e)||(this.REPORT_INTERVAL=Number(e)),mt(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(",").map((function(e){return Number(e)}))),mt(n)||(this.REPORT_TINYID_WHITELIST=n.split(","))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(e){this._avgRTT.addRTT(e)}},{key:"addMessageDelay",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:"addTotalCount",value:function(e){this._rateMessageSent.addTotalCount(e)||Je.w("".concat(this._n,".addTotalCount invalid key:"),e)}},{key:"addSuccessCount",value:function(e){this._rateMessageSent.addSuccessCount(e)||Je.w("".concat(this._n,".addSuccessCount invalid key:"),e)}},{key:"addFailedCountOfUserSide",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||Je.w("".concat(this._n,".addFailedCountOfUserSide invalid key:"),e)}},{key:"addCost",value:function(e,t){this._rateMessageSent.addCost(e,t)||Je.w("".concat(this._n,".addCost invalid key or cost:"),e,t)}},{key:"addFileSize",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||Je.w("".concat(this._n,".addFileSize invalid key or size:"),e,t)}},{key:"addMessageSequence",value:function(e){this._rateMessageReceived.addMessageSequence(e)||Je.w("".concat(this._n,".addMessageSequence invalid key:"),e.key)}},{key:"_getQualityItem",value:function(e){var n={},o=Jo[this.getNetworkType()];mt(o)&&(o=8);var a={qualityType:Wo[e],timestamp:He(),networkType:o,extension:""};switch(e){case bo:n=this._avgRTT.getStatResult();break;case wo:n=this._avgE2EDelay.getStatResult();break;case Fo:case qo:case xo:case Vo:case Ho:n=this._rateMessageSent.getStatResult(e);break;case Bo:case Ko:case Yo:n=this._rateMessageReceived.getStatResult(e)}return null===n?null:t(t({},a),n)}},{key:"_report",value:function(e){var t=this,n=[],o=null;mt(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),Je.d("".concat(this._n,"._report"),n),this._statInfoArr.length>0&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]);var a=this.getModule(io),i=a.getSDKAppID(),s=a.getTinyID();Qt(this.REPORT_SDKAPPID_BLACKLIST,i)&&!Zt(this.REPORT_TINYID_WHITELIST,s)&&(n=[]),n.length>0&&this._doReport(n)}},{key:"_doReport",value:function(e){var n=this,o={header:vi(this),quality:e};this.request({protocolName:Uo.SSO_STAT,requestData:t({},o)}).then((function(){n.reportIndex++,n.wholePeriod=!1})).catch((function(t){Je.w("".concat(n._n,"._doReport failed. networkType:").concat(n.getNetworkType()," error:"),t),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()}))}},{key:"_flushAtOnce",value:function(){var e=this.getModule(so),t=e.getItem(this.TAG,!1),n=this._statInfoArr,o="".concat(this._n,"._flushAtOnce");if(pn(t))Je.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var a=n.concat(t);a.length>10&&(a=a.slice(0,10)),Je.l("".concat(o," count:").concat(a.length)),e.setItem(this.TAG,a,!0,!1)}this._statInfoArr=[]}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),a}(Po),Ds=i((function e(t){o(this,e),pn(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",this.time=t.time||0,this.source=t.source||"",this.wording=t.wording||"",this.type=t.type||"")})),Es=function(){function e(t){o(this,e),this._snsModule=t,this._n="FriendApplicationHandler",this._startTime=0,this._maxLimited=100,this._currentSequence=0,this._friendApplicationMap=new Map,this._unreadCount=0}return i(e,[{key:"getLocalFriendApplicationList",value:function(){return{friendApplicationList:m(this._friendApplicationMap.values()),unreadCount:this._unreadCount}}},{key:"_onFriendApplicationListUpdated",value:function(){this._snsModule.emitOuterEvent(E.FRIEND_APPLICATION_LIST_UPDATED,{friendApplicationList:m(this._friendApplicationMap.values()),unreadCount:this._unreadCount})}},{key:"onFriendApplicationRead",value:function(){this._unreadCount=0,this._onFriendApplicationListUpdated()}},{key:"onFriendApplicationAdded",value:function(e,n){var o=this;if(!pn(e)){var a="";a=n===this._snsModule.getMyUserID()?S.SNS_APPLICATION_SENT_BY_ME:S.SNS_APPLICATION_SENT_TO_ME;var i=!1;e.forEach((function(e){var n="".concat(e.userID,"_").concat(a);a!==S.SNS_APPLICATION_SENT_TO_ME||o._friendApplicationMap.has(n)||(o._unreadCount+=1),o._friendApplicationMap.set(n,new Ds(t(t({},e),{},{type:a}))),i=!0})),i&&this._onFriendApplicationListUpdated()}}},{key:"onFriendApplicationDeleted",value:function(e){pn(e)||(this._startTime=0,this._currentSequence=0,this.getFriendApplicationList())}},{key:"getFriendApplicationList",value:function(){var e=this,t="".concat(this._n,".").concat("getFriendApplicationList"),n=new Xo("getFriendApplicationList");return this._snsModule.request({protocolName:Uo.GET_FRIEND_APPLICATION_LIST,requestData:{applicationType:S.SNS_APPLICATION_TYPE_BOTH,fromAccount:this._snsModule.getMyUserID(),maxLimited:this._maxLimited,startTime:this._startTime,lastSequence:this._currentSequence}}).then((function(o){var a=o.data,i=a.resultList,s=a.unreadCount,r=a.startTime,c=a.currentSequence;e._startTime=r,e._currentSequence=c,e._unreadCount=s;var u=vt(i)?i.length:0,l="applicationCount:".concat(u," unreadCount:").concat(s," startTime:").concat(r," currentSequence:").concat(c);n.setNetworkType(e._snsModule.getNetworkType()).setMessage(l).end(),Je.i("".concat(t," ok. ").concat(l)),e._friendApplicationMap.clear(),vt(i)&&i.forEach((function(t){var n=t.userID,o=t.type,a=new Ds(t);e._friendApplicationMap.set("".concat(n,"_").concat(o),a)})),e._onFriendApplicationListUpdated()})).catch((function(o){return e._snsModule.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.w("".concat(t," failed. error:"),o),Go(o)}))}},{key:"deleteFriendApplication",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteFriendApplication"),o=e.userID,a=e.type;if((!a||a!==S.SNS_APPLICATION_SENT_BY_ME&&a!==S.SNS_APPLICATION_SENT_TO_ME)&&(a=S.SNS_APPLICATION_SENT_TO_ME),!this._friendApplicationMap.has("".concat(o,"_").concat(a)))return Go({code:Ao.FRIEND_APPLICATION_NOT_EXIST});var i=new Xo("deleteFriendApplication");return i.setMessage("userID:".concat(o," type:").concat(a)),this._snsModule.request({protocolName:Uo.DELETE_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:[o],type:a}}).then((function(e){var s=e.data.resultList,r=s[0],c=r.to,u=r.resultCode,l=r.resultInfo;return i.setNetworkType(t._snsModule.getNetworkType()).setMoreMessage("resultList:".concat(JSON.stringify(s))).end(),Je.i("".concat(n," ok. userID:").concat(o," type:").concat(a)),0===u?No():Go({userID:c,code:u,message:l})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"acceptFriendApplication",value:function(e){var t=this,n="".concat(this._n,".").concat("acceptFriendApplication"),o=e.userID,a=e.remark,i=e.tag,s=e.type;(!s||s!==S.SNS_APPLICATION_AGREE&&s!==S.SNS_APPLICATION_AGREE_AND_ADD)&&(s=S.SNS_APPLICATION_AGREE_AND_ADD);var r=new Xo("acceptFriendApplication");return r.setMessage("userID:".concat(o," type:").concat(s)),this._snsModule.request({protocolName:Uo.RESPOND_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),responseFriendItem:[{userID:o,remark:a,tag:i,action:s}]}}).then((function(e){r.setNetworkType(t._snsModule.getNetworkType()).end();var a=e.data.resultList[0],i=a.resultCode,c=a.resultInfo;if(0!==i)return Go({code:i,message:c});Je.i("".concat(n," ok. userID:").concat(o," type:").concat(s))})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"refuseFriendApplication",value:function(e){var t=this,n="".concat(this._n,".").concat("refuseFriendApplication"),o=e.userID,a=new Xo("refuseFriendApplication");return a.setMessage("userID:".concat(o)),this._snsModule.request({protocolName:Uo.RESPOND_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),responseFriendItem:[{userID:o,action:"Response_Action_Reject"}]}}).then((function(e){a.setNetworkType(t._snsModule.getNetworkType()).end();var i=e.data.resultList[0],s=i.resultCode,r=i.resultInfo;if(0!==s)return Go({code:s,message:r});Je.i("".concat(n," ok. userID:").concat(o))})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_onFriendApplicationProcessed",value:function(e){var t=this;if(0!==e.length){var n=!1;e.forEach((function(e){var o="".concat(e.to,"_").concat(S.SNS_APPLICATION_SENT_TO_ME);t._friendApplicationMap.has(o)&&(t._friendApplicationMap.delete(o),t._unreadCount-=1,n=!0)})),this._unreadCount<0&&(this._unreadCount=0),n&&this._onFriendApplicationListUpdated()}}},{key:"setFriendApplicationRead",value:function(){var e=this,t="".concat(this._n,".").concat("setFriendApplicationRead"),n=new Xo("setFriendApplicationRead");return this._snsModule.request({protocolName:Uo.REPORT_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),latestTimeStamp:Xt(He()/1e3,0)}}).then((function(o){n.setNetworkType(e._snsModule.getNetworkType()).end(),Je.i("".concat(t," ok")),e._unreadCount=0})).catch((function(o){return e._snsModule.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.w("".concat(t," failed. error:"),o),Go(o)}))}},{key:"reset",value:function(){this._startIndex=0,this._maxLimited=100,this._currentSequence=0,this._unreadCount=0,this._friendApplicationMap.clear()}}]),e}(),Ss=function(){function e(n,a){o(this,e),this.userID=n,this.remark="",this.groupList=[],this.source="",this.addTime=0,this.friendCustomField=[],this.timestamp=0;var i={},s=[];if(i.userID=n,!pn(a))for(var r="",c="",u=0,l=a.length;u-1)this.friendCustomField.push({key:r,value:c});else if(r.indexOf("Tag_Profile_Custom")>-1)s.push({key:r,value:c});else switch(r){case Xe.NICK:i.nick=c;break;case Xe.GENDER:i.gender=c;break;case Xe.BIRTHDAY:i.birthday=c;break;case Xe.LOCATION:i.location=c;break;case Xe.SELFSIGNATURE:i.selfSignature=c;break;case Xe.ALLOWTYPE:i.allowType=c;break;case Xe.LANGUAGE:i.language=c;break;case Xe.AVATAR:i.avatar=c;break;case Xe.MESSAGESETTINGS:i.messageSettings=c;break;case Xe.ADMINFORBIDTYPE:i.adminForbidType=c;break;case Xe.LEVEL:i.level=c;break;case Xe.ROLE:i.role=c;break;case Ze:this.remark=c;break;case nt:this.addTime=c;break;case Qe:this.groupList=JSON.parse(JSON.stringify(c));break;case $e:this.source=c;break;case et:break;default:Je.l("snsProfileItem unknown tag->",a[u].tag)}this.profile=new Ca(t(t({},i),{},{profileCustomField:s}))}return i(e,[{key:"validate",value:function(e){var t=!0,n="";if(pn(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var o=e.profileCustomField.length,a=null,i=0;i500&&(n="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(Nt(e[s])," bytes"),t=!1);break;case"gender":Rt(ot,e.gender)||(n="key:gender, invalid value:"+e.gender,t=!1);break;case"birthday":_t(e.birthday)||(n="birthday must be a number",t=!1);break;case"location":gt(e.location)||(n="location must be a string",t=!1);break;case"selfSignature":gt(e.selfSignature)||(n="selfSignature must be a string",t=!1);break;case"allowType":Rt(it,e.allowType)||(n="key:allowType, invalid value:"+e.allowType,t=!1);break;case"language":_t(e.language)||(n="language must be a number",t=!1);break;case"avatar":gt(e.avatar)||(n="avatar must be a string",t=!1);break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n="messageSettings must be 0 or 1",t=!1);break;case"adminForbidType":Rt(at,e.adminForbidType)||(n="key:adminForbidType, invalid value:"+e.adminForbidType,t=!1);break;case"level":_t(e.level)||(n="level must be a number",t=!1);break;case"role":_t(e.role)||(n="role must be a number",t=!1);break;default:n="unknown key:"+s+" "+e[s],t=!1}}return{valid:t,tips:n}}},{key:"update",value:function(e){var t="",n="",o=[];this.friendCustomField.forEach((function(e){o.push(e.key)}));for(var a=0,i=e.length;a-1)o.indexOf(t)>-1?this.friendCustomField.forEach((function(e){e.key===t&&(e.value=n)})):this.friendCustomField.push({key:t,value:n});else if(t.indexOf("Tag_Profile_Custom")>-1){var s=!1;this.profile.profileCustomField.forEach((function(e){e.key===t&&(e.value=n,s=!0)})),s||this.profile.profileCustomField.push({key:t,value:n})}else switch(t){case Xe.NICK:this.profile.nick=n;break;case Xe.GENDER:this.profile.gender=n;break;case Xe.BIRTHDAY:this.profile.birthday=n;break;case Xe.LOCATION:this.profile.location=n;break;case Xe.SELFSIGNATURE:this.profile.selfSignature=n;break;case Xe.ALLOWTYPE:this.profile.allowType=n;break;case Xe.LANGUAGE:this.profile.language=n;break;case Xe.AVATAR:this.profile.avatar=n;break;case Xe.MESSAGESETTINGS:this.profile.messageSettings=n;break;case Xe.ADMINFORBIDTYPE:this.profile.adminForbidType=n;break;case Xe.LEVEL:this.profile.level=n;break;case Xe.ROLE:this.profile.role=n;break;case Ze:this.remark=n;break;case nt:this.addTime=n;break;case Qe:this.groupList=JSON.parse(JSON.stringify(n));break;case $e:this.source=n;break;case et:break;default:Je.d("snsProfileItem unkown tag->",e[a].tag)}this.timestamp=Date.now(),o.length=0}},{key:"updateProfile",value:function(e){this.profile=JSON.parse(JSON.stringify(e)),this.timestamp=Date.now()}},{key:"addToGroupList",value:function(e){-1===this.groupList.indexOf(e)&&(this.groupList.push(e),this.count=this.groupList.length)}},{key:"removeFromGroupList",value:function(e){var t=this.groupList.indexOf(e);t>-1&&(this.groupList.splice(t,1),this.count=this.groupList.length)}}]),e}(),Ns=function(){function e(t){o(this,e),this._snsModule=t,this._n="FriendHandler",this._friendMap=new Map,this._startIndex=0,this._standardSequence=0,this._customSequence=0,this._expirationTime=18e4}return i(e,[{key:"getLocalFriendList",value:function(){return m(this._friendMap.values())}},{key:"getFriendRemark",value:function(e){return this._friendMap.has(e)?this._friendMap.get(e).remark:""}},{key:"onFriendProfileModified",value:function(e){var t=this,n=e.dataList;if(!pn(n)){var o=this._snsModule.getModule(ao);n.forEach((function(e){var n=e.userID,a=e.profileList;if(t.isMyFriend(n)){Je.l("".concat(t._n,".onFriendProfileModified. friend account:").concat(n,", profileList:").concat(JSON.stringify(a)));var i=t._friendMap.get(n);i.update(a),o.modifyMessageSentByPeer({conversationID:"".concat(S.CONV_C2C).concat(n),latestNick:i.profile.nick,latestAvatar:i.profile.avatar})}})),this._onFriendListUpdated()}}},{key:"onFriendAdded",value:function(e){var t=this;0!==e.length&&(Je.l("".concat(this._n,".onFriendAdded userIDList:").concat(e)),e.forEach((function(e){t._friendMap.set(e,new Ss(e))})),this.getFriendProfile({userIDList:e}).then((function(n){e.forEach((function(e){var n=t._friendMap.get(e);n.groupList.length>0&&t._snsModule.updateWhenFriendAdded({nameList:n.groupList,userID:e})})),t._onFriendListUpdated()})))}},{key:"onFriendDeleted",value:function(e){var t=this;0!==e.length&&(Je.l("".concat(this._n,".onFriendDeleted userIDList:").concat(e)),e.forEach((function(e){var n=t._friendMap.get(e);n.groupList.length>0&&t._snsModule.updateWhenFriendDeleted({nameList:n.groupList,userID:e}),t._friendMap.delete(e)})),this._onFriendListUpdated())}},{key:"_onFriendListUpdated",value:function(){this._snsModule.emitOuterEvent(E.FRIEND_LIST_UPDATED),this._snsModule.getModule(ao).checkAndPatchRemark()}},{key:"getFriendProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getFriendProfile"),o=e.userIDList,a=[],i=[],s=[];if(o.forEach((function(e){if(t._friendMap.has(e)){var n=t._friendMap.get(e);Date.now()-n.timestamp1e3&&(Je.w("".concat(n," ").concat(an(1e3))),o.length=1e3);var i=[],s=[],r=[];if(o.forEach((function(e){t._friendMap.has(e)?r.push(e):i.push({userID:e,code:Ao.NOT_MY_FRIEND,message:t._snsModule.getErrorMessage(Ao.NOT_MY_FRIEND)})})),0===r.length)return Oo({successUserIDList:s,failureUserIDList:i});var c=a;(!c||c!==S.SNS_DELETE_TYPE_SINGLE&&c!==S.SNS_DELETE_TYPE_BOTH)&&(c=S.SNS_DELETE_TYPE_BOTH);var u=new Xo("deleteFriend");return u.setMessage("userIDList:".concat(r," type:").concat(c)),this._snsModule.request({protocolName:Uo.DELETE_FRIEND,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:r,type:c}}).then((function(e){u.setNetworkType(t._snsModule.getNetworkType()).end(),Je.i("".concat(n," ok"));var o=e.data.resultList;return pn(o)||o.forEach((function(e){var t=e.to,n=e.resultCode,o=e.resultInfo;mt(n)||0===n?s.push({userID:t}):i.push({userID:t,code:n,message:o})})),No({successUserIDList:s,failureUserIDList:i})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.w("".concat(n," error:"),e),Go(e)}))}},{key:"updateFriend",value:function(e){var t=this,n=e.userID,o=e.remark,a=e.friendCustomField;if(!this._friendMap.has(n))return Go({code:Ao.NOT_MY_FRIEND});var i="".concat(this._n,".").concat("updateFriend"),s=new Xo("updateFriend");s.setMessage("userID:".concat(n," remark:").concat(o," friendCustomField:").concat(a));var r=[];return mt(o)||r.push({tag:Ze,value:o}),vt(a)&&a.length>0&&a.forEach((function(e){r.push({tag:e.key,value:e.value})})),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND,requestData:{fromAccount:this._snsModule.getMyUserID(),updateItem:[{to:n,snsItem:r}]}}).then((function(e){s.setNetworkType(t._snsModule.getNetworkType()).end(),Je.i("".concat(i," ok"));var n=e.data.resultList[0],r=n.to,c=n.resultCode,u=n.resultInfo;if(mt(c)||0===c){var l=t._friendMap.get(r);return l&&(mt(o)||(l.remark=o),vt(a)&&a.length>0&&Ut(l.friendCustomField,a),t._onFriendListUpdated()),No(l)}return Go({code:c,message:u})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.w("".concat(i," failed. error:"),e),Go(e)}))}},{key:"checkFriend",value:function(e){var t=this,n="".concat(this._n,".").concat("checkFriend"),o=e.userIDList,a=e.type;(!a||a!==S.SNS_CHECK_TYPE_SINGLE&&a!==S.SNS_CHECK_TYPE_BOTH)&&(a=S.SNS_CHECK_TYPE_BOTH);var i=new Xo("checkFriend");return i.setMessage("userIDList:".concat(o," type:").concat(a)),this._snsModule.request({protocolName:Uo.CHECK_FRIEND,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:o,type:a}}).then((function(e){i.setNetworkType(t._snsModule.getNetworkType()).end(),Je.i("".concat(n," ok. userIDList:").concat(o," type:").concat(a));var s=[],r=[],c=e.data.resultList;return vt(c)&&c.forEach((function(e){var t=e.to,n=e.relation,o=e.resultCode,a=e.resultInfo;mt(o)||0===o?s.push({userID:t,code:0,relation:n}):r.push({userID:t,code:o,message:a})})),No({successUserIDList:s,failureUserIDList:r})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"updateWhenAddedToFriendGroup",value:function(e){var t=this,n=e.name,o=e.userIDList;Je.l("".concat(this._n,".updateWhenAddedToFriendGroup groupName:").concat(n," userIDList:").concat(o)),n&&!pn(o)&&o.forEach((function(e){t._friendMap.has(e)&&t._friendMap.get(e).addToGroupList(n)}))}},{key:"updateWhenRemovedFromFriendGroup",value:function(e){var t=this,n=e.name,o=e.userIDList;Je.l("".concat(this._n,".updateWhenRemovedFromFriendGroup groupName:").concat(n," userIDList:").concat(o)),n&&!pn(o)&&o.forEach((function(e){t._friendMap.has(e)&&t._friendMap.get(e).removeFromGroupList(n)}))}},{key:"reset",value:function(){this._friendMap.clear(),this._startIndex=0,this._standardSequence=0,this._customSequence=0}}]),e}(),ks=function(){function e(t){o(this,e),pn(t)||(this.name=t.name||"",this.userIDList=t.userIDList||[],this.count=this.userIDList.length||0)}return i(e,[{key:"addToUserIDList",value:function(e){-1===this.userIDList.indexOf(e)&&(this.userIDList.push(e),this.count=this.userIDList.length)}},{key:"removeFromUserIDList",value:function(e){var t=this.userIDList.indexOf(e);t>-1&&(this.userIDList.splice(t,1),this.count=this.userIDList.length)}}]),e}(),As=function(){function e(t){o(this,e),this._snsModule=t,this._n="FriendGroupHandler",this._friendGroupMap=new Map}return i(e,[{key:"getLocalFriendGroupList",value:function(){return m(this._friendGroupMap.values())}},{key:"_emitFriendGroupListUpdated",value:function(){var e=m(this._friendGroupMap.values());this._snsModule.emitOuterEvent(E.FRIEND_GROUP_LIST_UPDATED,e)}},{key:"getFriendGroupList",value:function(){var e=this,t="".concat(this._n,".").concat("getFriendGroupList"),n=new Xo("getFriendGroupList");return this._snsModule.request({protocolName:Uo.GET_FRIEND_GROUP_LIST,requestData:{fromAccount:this._snsModule.getMyUserID()}}).then((function(o){n.setNetworkType(e._snsModule.getNetworkType()).end();var a=o.data.resultList;pn(a)?Je.i("".concat(t," ok. friend group count:0")):(Je.i("".concat(t," ok. friend group count:").concat(a.length)),e._friendGroupMap.clear(),a.forEach((function(t){var n=new ks(t);e._friendGroupMap.set(t.name,n)})),e._emitFriendGroupListUpdated())})).catch((function(o){return e._snsModule.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.w("".concat(t," error:"),o),Go(o)}))}},{key:"createFriendGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("createFriendGroup"),o=e.name,a=e.userIDList;if(this._friendGroupMap.has(o))return Go({code:Ao.FRIEND_GRP_EXISTED});var i=new Xo("createFriendGroup");return i.setMessage("name:".concat(o," userIDList:").concat(a)),this._snsModule.request({protocolName:Uo.CREATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),groupName:[o],userIDList:vt(a)?a:void 0}}).then((function(e){i.setNetworkType(t._snsModule.getNetworkType()).end(),Je.l("".concat(n," ok. name:").concat(o," userIDList:").concat(a));var s=e.data.resultList,r=[],c=[];s&&s.forEach((function(e){var t=e.to,n=e.resultCode,o=e.resultInfo;if(mt(n)||0===n)r.push(t);else{var a={userID:e.to,code:n,message:o};c.push(a)}}));var u=new ks({name:o,userIDList:r});return t._friendGroupMap.set(o,u),t._snsModule.updateWhenAddedToFriendGroup({name:o,userIDList:r}),t._emitFriendGroupListUpdated(),No({friendGroup:u,failureUserIDList:c})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"deleteFriendGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteFriendGroup"),o=e.name;if(!this._friendGroupMap.has(o))return Go({code:Ao.FRIEND_GRP_NOT_EXIST});var a=new Xo("deleteFriendGroup");return a.setMessage("name:".concat(o)),this._snsModule.request({protocolName:Uo.DELETE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),nameList:[o]}}).then((function(e){a.setNetworkType(t._snsModule.getNetworkType()).end(),Je.l("".concat(n," ok. name:").concat(o));var i=t._friendGroupMap.get(o);return i&&(t._snsModule.updateWhenRemovedFromFriendGroup({name:o,userIDList:i.userIDList}),t._friendGroupMap.delete(o),i.userIDList.length=0),t._emitFriendGroupListUpdated(),No(i)})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"renameFriendGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("renameFriendGroup"),o=e.oldName,a=e.newName;if(!this._friendGroupMap.has(o))return Go({code:Ao.FRIEND_GRP_NOT_EXIST});var i=new Xo("renameFriendGroup");return i.setMessage("oldName:".concat(o," newName:").concat(a)),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:o,newName:a}}).then((function(){if(i.setNetworkType(t._snsModule.getNetworkType()).end(),Je.l("".concat(n," ok. oldName:").concat(o," newName:").concat(a)),t._friendGroupMap.has(o)){var e=t._friendGroupMap.get(o);return e.name=a,t._friendGroupMap.delete(o),t._friendGroupMap.set(a,e),t._snsModule.updateWhenRemovedFromFriendGroup({name:o,userIDList:e.userIDList}),t._snsModule.updateWhenAddedToFriendGroup({name:a,userIDList:e.userIDList}),t._emitFriendGroupListUpdated(),No(e)}return No()})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"addToFriendGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("addToFriendGroup"),o=e.name,a=e.userIDList;if(!this._friendGroupMap.has(o))return this._onFriendGroupNotExist(o);var i=new Xo("addToFriendGroup");return i.setMessage("name:".concat(o," userIDList:").concat(a)),Je.l("".concat(n," name:").concat(o," userIDList:").concat(a)),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:o,updateGroupItem:a.filter((function(e){return t._snsModule.isMyFriend(e)})).map((function(e){return{to:e,updateType:"Update_Type_Add"}}))}}).then((function(e){return i.setNetworkType(t._snsModule.getNetworkType()).end(),t._onFriendGroupUpdated(o,e)})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"removeFromFriendGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("removeFromFriendGroup"),o=e.name,a=e.userIDList;if(!this._friendGroupMap.has(o))return this._onFriendGroupNotExist(o);var i=new Xo("removeFromFriendGroup");return i.setMessage("name:".concat(o," userIDList:").concat(a)),Je.l("".concat(n," name:").concat(o," userIDList:").concat(a)),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:o,updateGroupItem:a.filter((function(e){return t._snsModule.isMyFriend(e)})).map((function(e){return{to:e,updateType:"Update_Type_Delete"}}))}}).then((function(e){return i.setNetworkType(t._snsModule.getNetworkType()).end(),t._onFriendGroupUpdated(o,e)})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_onFriendGroupUpdated",value:function(e,t){var n=t.data.resultList,o=this._friendGroupMap.get(e),a=[],i=[],s=[];return vt(n)&&n.forEach((function(e){var t=e.to,n=e.resultCode,r=e.resultInfo,c=e.type;0===n?"Update_Type_Add"===c?o&&(o.addToUserIDList(t),i.push(t)):"Update_Type_Delete"===c&&o&&(o.removeFromUserIDList(t),s.push(t)):a.push({to:e.to,code:n,message:r})})),Je.l("".concat(this._n,"._onFriendGroupUpdated name:").concat(e," userIDList:").concat(o.userIDList)),i.length>0&&this._snsModule.updateWhenAddedToFriendGroup({name:e,userIDList:i}),s.length>0&&this._snsModule.updateWhenRemovedFromFriendGroup({name:e,userIDList:s}),No({friendGroup:o,failureUserIDList:a})}},{key:"updateWhenFriendAdded",value:function(e){var t=this,n=e.nameList,o=e.userID;Je.l("".concat(this._n,".updateWhenFriendAdded userID:").concat(o," nameList:").concat(n)),pn(n)||n.forEach((function(e){t._friendGroupMap.has(e)&&t._friendGroupMap.get(e).addToUserIDList(o)}))}},{key:"updateWhenFriendDeleted",value:function(e){var t=this,n=e.nameList,o=e.userID;Je.l("".concat(this._n,".updateWhenFriendDeleted userID:").concat(o," nameList:").concat(n)),pn(n)||n.forEach((function(e){t._friendGroupMap.has(e)&&t._friendGroupMap.get(e).removeFromUserIDList(o)}))}},{key:"reset",value:function(){this._friendGroupMap.clear()}}]),e}(),Ls=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="SnsModule",a._friendHandler=new Ns(g(a)),a._friendApplicationHandler=new Es(g(a)),a._friendGroupHandler=new As(g(a)),a.getInnerEmitterInstance().on(ha.A2KEY_AND_TINYID_UPDATED,a.onContextUpdated,g(a)),a}return i(n,[{key:"onContextUpdated",value:function(e){this._friendHandler.pagingGetFriendList(),this._friendGroupHandler.getFriendGroupList(),this._friendApplicationHandler.getFriendApplicationList()}},{key:"onRelationChainModified",value:function(e){var t=this,n=e.dataList;if(!pn(n)){var o=[],a=[],i=[],s=[],r=!1,c="";n.forEach((function(e){if(3!==e.pushType&&4!==e.pushType||!e.from||(c=e.from),e.friendAddAccount&&(o.push.apply(o,m(e.friendAddAccount)),s.push.apply(s,m(e.friendAddAccount))),e.friendDelAccount&&a.push.apply(a,m(e.friendDelAccount)),e.friendApplicationAdded&&i.push.apply(i,m(e.friendApplicationAdded)),e.friendApplicationDeletedUserIDList&&s.push.apply(s,m(e.friendApplicationDeletedUserIDList)),e.reportTime&&7===e.pushType&&(r=!0),e.friendUpInfo){var n={dataList:[]};e.friendUpInfo.forEach((function(e){n.dataList.push({userID:e.friendAccount,profileList:m(e.sns)})})),t.onFriendProfileModified(n)}})),r&&this._friendApplicationHandler.onFriendApplicationRead(),this._friendApplicationHandler.onFriendApplicationAdded(i,c),this._friendApplicationHandler.onFriendApplicationDeleted(s),this._friendHandler.onFriendAdded(o),this._friendHandler.onFriendDeleted(a)}}},{key:"isMyFriend",value:function(e){return this._friendHandler.isMyFriend(e)}},{key:"filterProfanity",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],X),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:"onFriendProfileModified",value:function(e){this._friendHandler.onFriendProfileModified(e)}},{key:"getLocalFriendList",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this._friendHandler.getLocalFriendList();return e?Oo(t):t}},{key:"getFriendRemark",value:function(e){return this._friendHandler.getFriendRemark(e)}},{key:"getFriendList",value:function(){return this._friendHandler.pagingGetFriendList()}},{key:"addFriend",value:function(e){return this._friendHandler.addFriend(e)}},{key:"deleteFriend",value:function(e){return this._friendHandler.deleteFriend(e)}},{key:"checkFriend",value:function(e){return this._friendHandler.checkFriend(e)}},{key:"getFriendProfile",value:function(e){return this._friendHandler.getFriendProfile(e)}},{key:"updateFriend",value:function(e){return this._friendHandler.updateFriend(e)}},{key:"updateWhenAddedToFriendGroup",value:function(e){this._friendHandler.updateWhenAddedToFriendGroup(e)}},{key:"updateWhenRemovedFromFriendGroup",value:function(e){this._friendHandler.updateWhenRemovedFromFriendGroup(e)}},{key:"getLocalFriendApplicationList",value:function(){var e=this._friendApplicationHandler.getLocalFriendApplicationList();return Oo(e)}},{key:"deleteFriendApplication",value:function(e){return this._friendApplicationHandler.deleteFriendApplication(e)}},{key:"refuseFriendApplication",value:function(e){return this._friendApplicationHandler.refuseFriendApplication(e)}},{key:"acceptFriendApplication",value:function(e){return this._friendApplicationHandler.acceptFriendApplication(e)}},{key:"setFriendApplicationRead",value:function(e){return this._friendApplicationHandler.setFriendApplicationRead(e)}},{key:"getLocalFriendGroupList",value:function(){var e=this._friendGroupHandler.getLocalFriendGroupList();return Oo(e)}},{key:"createFriendGroup",value:function(e){return this._friendGroupHandler.createFriendGroup(e)}},{key:"deleteFriendGroup",value:function(e){return this._friendGroupHandler.deleteFriendGroup(e)}},{key:"addToFriendGroup",value:function(e){return this._friendGroupHandler.addToFriendGroup(e)}},{key:"removeFromFriendGroup",value:function(e){return this._friendGroupHandler.removeFromFriendGroup(e)}},{key:"renameFriendGroup",value:function(e){return this._friendGroupHandler.renameFriendGroup(e)}},{key:"onAddToFriendGroup",value:function(e){return this._friendGroupHandler.onAddToFriendGroup(e)}},{key:"updateWhenFriendAdded",value:function(e){this._friendGroupHandler.updateWhenFriendAdded(e)}},{key:"updateWhenFriendDeleted",value:function(e){this._friendGroupHandler.updateWhenFriendDeleted(e)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._friendHandler.reset(),this._friendGroupHandler.reset(),this._friendApplicationHandler.reset()}}]),n}(Po),Rs=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="WorkerTimerModule",a._isWorkerEnabled=!0,a._workerTimer=null,a._timerID=-1,a._init(),a.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,a._onCloudConfigUpdated,g(a)),a}return i(n,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&Ge}},{key:"startWorkerTimer",value:function(){Je.l("".concat(this._n,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){Je.l("".concat(this._n,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){if(Ge){var e=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(e);var t=this;this._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,Je.l("".concat(t._n,"._init seed:").concat(t._timerID))):t._m.onCheckTimer()}}}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("enable_worker");Je.l("".concat(this._n,"._onCloudConfigUpdated enableWorker:").concat(e)),mt(e)||"1"===e?!this._isWorkerEnabled&&Ge&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&Ge&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){Je.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(){Je.l("".concat(this._n,".reset"))}}]),n}(Po),Os=function(){function e(){o(this,e),this._n="PurchasedFeatureHandler",this._purchasedFeatureMap=new Map}return i(e,[{key:"isValidPurchaseBits",value:function(e){return e&&"string"==typeof e&&e.length>=1&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){if(this.isValidPurchaseBits(e)){this._purchasedFeatureMap.clear();for(var t=null,n=e.length-1,o=0;n>=0;n--,o++)t=o<32?new A(0,Math.pow(2,o)).toString():new A(Math.pow(2,o-32),0).toString(),"1"===e[n]?this._purchasedFeatureMap.set(t,!0):this._purchasedFeatureMap.set(t,!1)}else Je.w("".concat(this._n,".parsePurchaseBits invalid purchasebits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._purchasedFeatureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,a=t.length-1,i=0;a>=0;a--,i++)if("1"===t.charAt(a)&&(n=i<32?new A(0,Math.pow(2,i)).toString():new A(Math.pow(2,i-32),0).toString(),!this._purchasedFeatureMap.get(n))){o=!1;break}return Je.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(e," binaryString:").concat(t," ret:").concat(o)),Oo({enabled:o})}},{key:"clear",value:function(){this._purchasedFeatureMap.clear()}}]),e}(),Gs=function(){function e(t){o(this,e),this._m=t,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new Os}return i(e,[{key:"_canFetch",value:function(){return this._getModule(io).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetch(),n="".concat(this._n,".fetchConfig");if(Je.l("".concat(n," canFetch:").concat(t)),t){var o=this._getModule(co),a=new Xo("fetchCommercialConfig");a.setNetworkType(o.getNetworkType());var i=this._getModule(io).getSDKAppID(),s=this._getModule(_o);this._isFetching=!0,s.request({protocolName:Uo.FETCH_COMMERCIAL_CONFIG,requestData:{SDKAppID:i}}).then((function(t){a.setMessage("purchaseBits:".concat(t.data.purchaseBits)).end(),Je.l("".concat(n," ok.")),e._parseConfig(t.data),e._isFetching=!1})).catch((function(t){o.probe().then((function(e){var n=v(e,2),o=n[0],i=n[1];a.setError(t,o,i).end()})),e._isFetching=!1}))}}},{key:"onPushedConfig",value:function(e){var t="".concat(this._n,".onPushedConfig data:").concat(JSON.stringify(e));Je.l("".concat(t)),new Xo("pushedCommercialConfig").setNetworkType(this._getModule(co).getNetworkType()).setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var t="".concat(this._n,"._parseConfig"),n=e.errorCode,o=e.errorMessage,a=e.purchaseBits,i=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(a),this._expiredTime=Date.now()+1e3*i):mt(n)?(Je.l("".concat(t," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(Je.e("".concat(t," errorCode:").concat(n," errorMessage:").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"_getModule",value:function(e){return this._m.getModule(e)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),e}(),Ps=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._m=e,a._n="OfflinePushModule",a._offlinePushPlugin=void 0,a._androidPushConfig={huaweiPushBussinessId:"",xiaomiPushBussinessId:"",xiaomiPushAppId:"",xiaomiPushAppKey:"",meizuPushBussinessId:"",meizuPushAppId:"",meizuPushAppKey:"",vivoPushBussinessId:"",fcmPushBussinessId:"",oppoPushBussinessId:"",oppoPushAppKey:"",oppoPushAppSecret:"",honorPushBussinessId:""},a._deviceToken="",a._businessID=0,a._iosBusinessID=0,a._c2cUnreadCount=0,a._groupUnreadCount=0,a._isWebUniapp=0,a}return i(n,[{key:"registerPlugin",value:function(e){if(se){this._offlinePushPlugin=e["tim-offline-push-plugin"];var t=e.offlinePushConfig||{},n=t.huaweiBusinessID,o=t.xiaomiBusinessID,a=t.xiaomiAppID,i=t.xiaomiAppKey,s=t.meizuBusinessID,r=t.meizuAppID,c=t.meizuAppKey,u=t.vivoBusinessID,l=t.oppoBusinessID,d=t.oppoAppKey,p=t.oppoAppSecret,_=t.honorBusinessID,g=t.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=a,this._androidPushConfig.xiaomiPushAppKey=i,this._androidPushConfig.meizuPushBussinessId=s,this._androidPushConfig.meizuPushAppId=r,this._androidPushConfig.meizuPushAppKey=c,this._androidPushConfig.vivoPushBussinessId=u,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=d,this._androidPushConfig.oppoPushAppSecret=p,this._androidPushConfig.honorPushBussinessId=_,new Xo("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!mt(this._offlinePushPlugin))).end(!0),Je.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=g,this._setAppShowListener()}else this.outputWarning("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e=this,t="".concat(this._n,".").concat("_getDeviceToken");if(It(this._offlinePushPlugin.getDeviceToken)){var n="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID);Je.l("".concat(t," start. ").concat(n)),new Xo("_getDeviceToken").setMessage("".concat(n)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var a=new Xo("getDeviceTokenRes"),i=o.code,s=o.msg;if(0===i){var r=o.data,c=r.deviceToken,u=r.deviceBrand,l=r.deviceType,d=r.bussinessId;e._deviceToken=c,e._businessID=d||e._iosBusinessID,n="deviceToken:".concat(c,", deviceBrand:").concat(u||l,", businessID:").concat(e._businessID),Je.l("".concat(t," ok. ").concat(n)),a.setMessage(n).end(!0),e._setToken()}else a.setMessage("code:".concat(i,", msg:").concat(s)).end(!0),Je.e("".concat(t," failed. error:"),o)}))}else Je.e("".concat(t," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return se&&!mt(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setAppShowListener");mt(this._offlinePushPlugin)?Je.e("".concat(t," offlinePushPlugin is undefined")):It(this._offlinePushPlugin.setAppShowListener)?(new Xo("_setAppShowListener").end(!0),Je.l("".concat(t," start")),this._offlinePushPlugin.setAppShowListener((function(n){var o=(n||{}).appShow;new Xo("setAppShowListenerRes").setMessage("appShow:".concat(o)).end(!0),Je.l("".concat(t," ok. appShow:").concat(o)),e._m.isReady()&&(0===o?(e._getConvUnreadCount(),e._onBackground()):1===o&&e._onForeground())}))):Je.e("".concat(t," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){if(!mt(this._offlinePushPlugin)&&It(this._offlinePushPlugin.getDeviceType)){var e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType;return Je.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}}},{key:"_setToken",value:function(){var e,t=this,n="".concat(this._n,"._setToken"),o=this.getModule(io),a=1,i="",s="";pn(this._deviceToken)&&(a=0);var r=this.getUniAppPlatform(),c=this.getDeviceBrand();r===R.IOS||r===R.IPAD||r===R.MAC?s=this._deviceToken:r===R.ANDROID&&(i=this._deviceToken);var u=new Xo("offlinePushSetToken");return e="deviceToken:".concat(s||i,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(c,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(a,", platform:").concat(r),u.setMessage("".concat(e)),Je.l("".concat(n," ").concat(e)),this.request({protocolName:Uo.SET_TOKEN,requestData:{tokenID:i,pushMsg:a,sdkAppID:o.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:c,deviceToken:s,isWebUniapp:this._isWebUniapp}}).then((function(e){return u.end(),Je.l("".concat(n," ok")),e})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e("".concat(n," failed. error:"),e),Go(e)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(ao).getLocalConversationList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this,t="".concat(this._n,".").concat("_onBackground"),n=new Xo("_onBackground");this.request({protocolName:Uo.STAT_BACKGROUND,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage("c2cUnreadCount: ".concat(e._c2cUnreadCount,", groupUnreadCount: ").concat(e._groupUnreadCount)).end(),Je.l("".concat(t," ok")),o})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.e("".concat(t," failed. error:"),o)}))}},{key:"_onForeground",value:function(){var e=this,t="".concat(this._n,".").concat("_onForeground"),n=new Xo("_onForeground");this.request({protocolName:Uo.STAT_FOREGROUND,requestData:{isWebUniapp:this._isWebUniapp}}).then((function(e){return n.end(),Je.l("".concat(t," ok")),e})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.e("".concat(t," failed. error:"),o)}))}},{key:"getUniAppPlatform",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?R.IOS:"android"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,Je.l("".concat(this._n,".reset"))}}]),n}(Po),Us=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n="ProfanityFilterModule",a._plugin=null,a._filterConfigMap=new Map,a._startIndex=0,a._version=0,a._canIUseLexicon=!1,a._isFetching=!1,a._expiredTime=0,a}return i(n,[{key:"init",value:function(){var e=this.getModule(lo).getPlugin("tim-profanity-filter-plugin");e?(this._plugin=new e({logger:Je,isArray:vt,isMap:dt,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning("ProfanityPluginNotFound")}},{key:"onCheckTimer",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(e,t){var n=!0;if(!this._plugin||!this._canIUseLexicon)return n;if(t&&t.messageControlInfo&&!0===t.messageControlInfo.excludedFromContentModeration)return n;var o=e.type,a=e.conversationType;if(o!==S.MSG_TEXT&&o!==S.MSG_CUSTOM)return n;var i,s="".concat(this._n,".filterMessage");if(Je.l("".concat(s)),o===S.MSG_TEXT){if(a===S.CONV_C2C?i=Y:a===S.CONV_GROUP&&(i=j),!this._isConfigOn(i))return n;var r=this._plugin.filter(e.payload.text),c=r.type,u=r.modifiedText;1===c?n=!1:2===c&&(e.payload.text=u)}else if(o===S.MSG_CUSTOM){if(a===S.CONV_C2C?i=W:a===S.CONV_GROUP&&(i=J),!this._isConfigOn(i))return n;var l=this._plugin.filter(e.payload.data),d=this._plugin.filter(e.payload.description),p=this._plugin.filter(e.payload.extension);1===l.type||1===d.type||1===p.type?n=!1:(2===l.type&&(e.payload.data=l.modifiedText),2===d.type&&(e.payload.description=d.modifiedText),2===p.type&&(e.payload.extension=p.modifiedText))}return Je.l("".concat(s," done. isAllowedToSend:").concat(n)),n}},{key:"filterText",value:function(e,t){var n="".concat(this._n,".filterText"),o={isAllowedToSend:!0,modifiedText:e};if(!this._plugin||!this._canIUseLexicon)return o;if(!this._isConfigOn(t))return o;Je.l("".concat(n));var a=this._plugin.filter(e),i=a.type,s=a.modifiedText;return 1===i?o.isAllowedToSend=!1:2===i&&(o.modifiedText=s),Je.l("".concat(n," done. ret:"),o),o}},{key:"_getLexicon",value:function(){var e=this,t=new Xo("profanityFilter"),n="".concat(this._n,"._getLexicon");this._isFetching=!0,this.request({protocolName:Uo.GET_PROFANITY_LIST,requestData:{startIndex:this._startIndex,version:this._version}}).then((function(o){var a=o.data,i=a.errorInfo,s=a.filterConfig,r=a.lexicon,c=a.strToken,u=a.completeFlag,l=a.nextStartIndex,d=a.version,p=a.expiredTime,_=i.errorCode,g=i.errorMessage;return 0!==_?(e._isFetching=!1,Je.w("".concat(n," failed. error:"),i),void t.setCode(_).setMessage(g).end()):(e._onFilterConfig(s),e._getToken(c),1===u?(Je.l("".concat(n," done. version:").concat(d," expiredTime:").concat(p)),e._version=d,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*p,void e._plugin.onLexiconCompleted(r)):(e._startIndex=l,e._plugin.onLexiconSliced(r),void e._getLexicon()))})).catch((function(o){e.probeNetwork().then((function(e){var n=v(e,2),a=n[0],i=n[1];t.setError(o,a,i).end()})),e._isFetching=!1,Je.l("".concat(n," failed. error:"),o)}))}},{key:"_onFilterConfig",value:function(e){var t=this;pn(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),Je.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:"_getToken",value:function(e){if(gt(e)){var t=e.length,n="";if(t%2==0)for(var o=0;o<=t-1;o+=2)n+=e[o+1],n+=e[o];else{for(var a=0;a=this.STORAGE_EXPIRES_TIME,a=!n||"3.2.3"!==n;return Je.l("".concat(this._n,"._needToUpdate isTimeout:").concat(o," isDifferentVersion:").concat(a)),o||a}},{key:"_fetch",value:function(){if(!this._m.getModule(io).isPrivateNetWork()){var e="https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.4/tim-error-message.txt",t="application/x-www-form-urlencoded;charset=UTF-8",n="".concat(this._n,"._fetch ok in"),o=this;if(ce)le.request({url:e,method:"GET",timeout:3e3,header:{"content-type":t},dataType:"text",success:function(e){o._fillAndSave(e.data),Je.l("".concat(n," mini program"))},fail:function(){}});else{var a=new XMLHttpRequest,i=setTimeout((function(){a.abort()}),3e3);a.onreadystatechange=function(){4===a.readyState&&(clearTimeout(i),200!==a.status&&304!==a.status||(Je.l("".concat(n," browser")),o._fillAndSave(a.responseText)))},a.open("GET",e,!0),a.setRequestHeader("Content-type",t),a.send()}}}},{key:"_fillAndSave",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:"3.2.3"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.getModule(so)}},{key:"_fillMap",value:function(e){this._map.clear();for(var t,n,o,a=e.split(";\n"),i=a.length,s=new RegExp(/'/g),r=0;r0&&n.forEach((function(e){var n=t.getPayloadData(e);n&&t._handleActionType(n,e)}))}},{key:"onMessageModified",value:function(e){var t=this,n=this._signalingModule.filterMessageList(e);n.length>0&&n.forEach((function(e){var n=t.getPayloadData(e);n&&t._onInvitationModified(n,e)}))}},{key:"getPayloadData",value:function(e){var t="".concat(this._n,".getPayloadData"),n=e.payload.data;try{return JSON.parse(n)}catch(o){return Je.e("".concat(t," JSON parse error. signalingData:").concat(n)),null}}},{key:"_handleActionType",value:function(e,t){switch(e.actionType){case N.ACTION_TYPE_INVITE:this._onNewInvitationReceived(e,t);break;case N.ACTION_TYPE_REJECT_INVITE:this._onInviteeRejected(e);break;case N.ACTION_TYPE_ACCEPT_INVITE:this._onInviteeAccepted(e);break;case N.ACTION_TYPE_CANCEL_INVITE:this._onInvitationCancelled(e);break;case N.ACTION_TYPE_INVITE_TIMEOUT:this._onInvitationTimeout(e)}}},{key:"_createDefaultEmitData",value:function(e){return{inviteID:e.inviteID,inviter:e.inviter,groupID:e.groupID,data:e.data||""}}},{key:"_onNewInvitationReceived",value:function(e,n){var o="".concat(this._n,"._onNewInvitationReceived"),a=e.inviteID,i=e.inviteeList,s=e.groupID,r=e.inviter,c=this._signalingModule.getMyUserID(),u=i.includes(c),l=Math.round(e.timeout-((new Date).getTime()-1e3*n.time)/1e3);if(Je.l("".concat(o," myselfIncluded:").concat(u," groupID:").concat(s," timeout:").concat(l,"s signalObj:").concat(JSON.stringify(e))),s&&u||!s){var d=this._signalingModule.getInviteInfo(a);if(d&&d===e)return;d||this._signalingModule.setInviteInfo(a,t(t({},e),{},{message:n})),this._signalingModule.emitEvent(N.NEW_INVITATION_RECEIVED,t(t({},this._createDefaultEmitData(e)),{},{inviteeList:i})),r!==c&&this._signalingModule.startTimer(t(t({},e),{},{timeout:l}))}}},{key:"_onInviteeRejected",value:function(e){var n="".concat(this._n,"._onInviteeRejected"),o=e.inviteID,a=e.inviter,i=e.groupID,s=this._signalingModule.hasInviteInfo(o);Je.l("".concat(n," inviteID:").concat(o," hasInviteID:").concat(s," inviter:").concat(a," groupID:").concat(i)),(i&&s||!i)&&(this._signalingModule.updateInviteInfo(e),this._signalingModule.emitEvent(N.INVITEE_REJECTED,t(t({},this._createDefaultEmitData(e)),{},{invitee:e.inviteeList[0]})))}},{key:"_onInviteeAccepted",value:function(e){var n="".concat(this._n,"._onInviteeAccepted"),o=e.inviteID,a=e.inviter,i=e.groupID,s=this._signalingModule.hasInviteInfo(o);Je.l("".concat(n," inviteID:").concat(o," hasInviteID:").concat(s," inviter:").concat(a," groupID:").concat(i)),(i&&s||!i)&&(this._signalingModule.updateInviteInfo(e),this._signalingModule.emitEvent(N.INVITEE_ACCEPTED,t(t({},this._createDefaultEmitData(e)),{},{invitee:e.inviteeList[0]})))}},{key:"_onInvitationCancelled",value:function(e){var t="".concat(this._n,"._onInvitationCancelled"),n=e.inviteID,o=e.inviter,a=e.groupID,i=this._signalingModule.hasInviteInfo(n);Je.l("".concat(t," inviteID:").concat(n," hasInviteID:").concat(i," inviter:").concat(o," groupID:").concat(a)),(a&&i||!a)&&(this._signalingModule.deleteInviteInfo(n),this._signalingModule.emitEvent(N.INVITATION_CANCELLED,this._createDefaultEmitData(e)))}},{key:"_onInvitationTimeout",value:function(e){var n="".concat(this._n,"._onInvitationTimeout"),o=e.inviteID,a=e.inviter,i=e.groupID,s=e.inviteeList,r=this._signalingModule.hasInviteInfo(o);Je.l("".concat(n," inviteID:").concat(o," hasInviteID:").concat(r," inviter:").concat(a," groupID:").concat(i," data:").concat(e.data)),(i&&r||!i)&&(this._signalingModule.updateInviteInfo(e),this._signalingModule.emitEvent(N.INVITATION_TIMEOUT,t(t({},this._createDefaultEmitData(e)),{},{inviteeList:s,isSelfTimeout:!1})))}},{key:"_onInvitationModified",value:function(e,n){var o="".concat(this._n,"._onInvitationModified"),a=e.inviteID,i=e.data;Je.l("".concat(o," inviteID:").concat(a," data:").concat(i)),this._signalingModule.setInviteInfo(a,t(t({},e),{},{message:n})),this._signalingModule.emitEvent(N.INVITATION_MODIFIED,{inviteID:a,data:i})}}]),e}(),qs=function(e){if(e<0||e>53)return NaN;var t=0|1073741824*Math.random();return e>30?t+1073741824*(0|Math.random()*(1<>>30-e},xs=function(e,t){for(var n=e.toString(16),o=t-n.length,a="0";o>0;o>>>=1,a+=a)1&o&&(n=a+n);return n},Vs=function(){function e(t){o(this,e),this._n="LocalSignalingHandler",this._signalingModule=t}return i(e,[{key:"generateInviteID",value:function(){var e,t,n=(t=xs)((e=qs)(32),8)+"-"+t(e(16),4)+"-"+t(16384|e(12),4)+"-"+t(32768|e(14),4)+"-"+t(e(48),12);return Je.l("".concat(this._n,".generateInviteID inviteID:").concat(n)),n}},{key:"createInviteInfo",value:function(e){var n=this.generateInviteID(),o=this.createInviteCustomData(t(t({},e),{},{inviteID:n})),a=o.groupID,i=o.inviteeList,s=a||i[0];return{customData:o,message:this.createSignalingMessage(o,s),inviteID:n}}},{key:"_createDefaultCustomData",value:function(e){var t=e.data,n=void 0===t?"":t,o=e.inviteID,a=void 0===o?"":o,i=e.groupID;return{businessID:1,timeout:0,data:n,inviteID:a,groupID:void 0===i?"":i}}},{key:"createInviteCustomData",value:function(e){var n=e.userID,o=e.timeout,a=void 0===o?0:o,i=e.groupID,s=void 0===i?"":i,r=this._signalingModule.getMyUserID(),c=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_INVITE,inviter:r,inviteeList:s?e.inviteeList:[n],timeout:a});return Je.l("".concat(this._n,".createInviteCustomData customData:").concat(JSON.stringify(c))),c}},{key:"createCancelCustomData",value:function(e){var n,o="".concat(this._n,".createCancelCustomData"),a=e.inviteID,i=this._signalingModule.getMyUserID(),s=this._signalingModule.getInviteInfo(a),r=s.inviteeList,c=s.groupID,u=s.inviter;return u===i?n=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_CANCEL_INVITE,groupID:c,inviter:i,inviteeList:r}):Je.e("".concat(o," unmatched inviter:").concat(u," and my userID:").concat(i)),Je.l("".concat(o," customData:").concat(JSON.stringify(n))),n}},{key:"createAcceptCustomData",value:function(e){var n,o="".concat(this._n,".createAcceptCustomData"),a=e.inviteID,i=this._signalingModule.getMyUserID(),s=this._signalingModule.getInviteInfo(a),r=s.inviter,c=s.groupID;return s.inviteeList.includes(i)?n=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_ACCEPT_INVITE,groupID:c,inviter:r,inviteeList:[i]}):Je.e("".concat(o," userID:").concat(i," not in inviteeList. inviteID:").concat(a," groupID:").concat(c)),Je.l("".concat(o," customData:").concat(JSON.stringify(n))),n}},{key:"createRejectCustomData",value:function(e){var n,o="".concat(this._n,".createRejectCustomData"),a=e.inviteID,i=this._signalingModule.getMyUserID(),s=this._signalingModule.getInviteInfo(a),r=s.inviter,c=s.groupID;return s.inviteeList.includes(i)?n=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_REJECT_INVITE,groupID:c,inviter:r,inviteeList:[i]}):Je.e("".concat(o," userID:").concat(i," not in inviteeList. inviteID:").concat(a," groupID:").concat(c)),Je.l("".concat(o," customData:").concat(JSON.stringify(n))),n}},{key:"createTimeoutCustomData",value:function(e){var n="".concat(this._n,".createTimeoutCustomData"),o=e.inviteeList,a=e.inviter,i=e.isInviter,s=void 0!==i&&i,r=this._signalingModule.getMyUserID(),c=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_INVITE_TIMEOUT,inviter:a,inviteeList:s?o:[r]});return Je.l("".concat(n," customData:").concat(JSON.stringify(c))),c}},{key:"createSignalingMessage",value:function(e,t){var n=e.groupID,o=e.inviter,a=this._signalingModule.getModule(Qn),i={to:t||n||o,conversationType:n?S.CONV_GROUP:S.CONV_C2C,priority:S.MSG_PRIORITY_HIGH,payload:{data:JSON.stringify(e)}},s=a.createCustomMessage(i);return Je.d("".concat(this._n,".createSignalingMessage. message:").concat(JSON.stringify(s))),s}}]),e}(),Hs=function(){function e(t){o(this,e),this._n="HistorySignalingHandler",this._signalingModule=t,this.EXPIRED_TIME=3e4,this.COUNT=20,this._signalingMap=new Map,this._signalingRelatedToMeMap=new Map}return i(e,[{key:"getHistorySignaling",value:function(){var e=this,t=this._signalingModule.getModule(ao).getLocalConversationList();pn(t)||this._getSignalingList(t).then((function(t){e._handleSignalingList(t)}))}},{key:"_getSignalingList",value:function(e){var t=this,n=this._getValidConversationList(e),o=this._createPromiseList(n);return pn(o)?Promise.resolve([]):this._concurrentGetMessageList(o).then((function(e){var n=new Map;return e.forEach((function(e){var o=e.signalingList,a=t._getSignalingRelatedToMeMap(o);n=new Map([].concat(m(n),m(a)))})),t._sortSignaling(n)}))}},{key:"_handleSignalingList",value:function(e){pn(e)||(Je.d("".concat(this._n,"._handleSignalingList signalingList:").concat(JSON.stringify(e))),this._signalingModule.onNewMessageList(e))}},{key:"_isSignalingNotExpired",value:function(e,t){return e[t]&&1e3*e[t]>(new Date).getTime()-this.EXPIRED_TIME}},{key:"_getValidConversationList",value:function(e){for(var t=[],n=0;n0&&r&&t.push(e[n])}return t}},{key:"_createPromiseList",value:function(e){for(var t=[],n=0;n0?t._concurrentGetMessageList(n):t._signalingMap}))}},{key:"_relayGetMessageList",value:function(e){var t=e.messageList,n=e.nextReqMessageID,o=e.isCompleted,a=t.length;if(0===a)return null;var i=t[0],s=i.conversationID,r=i.conversationType,c=this._signalingMap.get(s).needMessageCount,u=r===S.CONV_GROUP,l=0===c||o,d=this._isSignalingNotExpired(t[a-1],"time");return u||l||!d?null:this._signalingModule.getModule(ao).getMessageList({conversationID:s,nextReqMessageID:n,count:c})}},{key:"_handleMessageList",value:function(e){for(var t=e.length,n=e[0].conversationID,o=this._signalingMap.get(n),a=o.needMessageCount,i=o.signalingList,s=a-t>0?a-t:0,r=[],c=0;c0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=void 0===t?"":t,o=e.onlineUserOnly,a=e.inviteID,i=void 0===a?"":a,s=e.offlinePushInfo,r=e.actionType,c={_onlineOnlyFlag:!1};i&&this.getInviteInfo(i)&&(c=this.getInviteInfo(i).message);var u={onlineUserOnly:c._onlineOnlyFlag||o||!1,offlinePushInfo:s,messageControlInfo:{excludedFromContentModeration:!0,excludedFromUnreadCount:!1,excludedFromLastMessage:!1}};if(r===N.ACTION_TYPE_INVITE_TIMEOUT){var l=!!n.match(/excludeTimeoutSignalingFromHistoryMessage/);return u.messageControlInfo.excludedFromUnreadCount=l,u.messageControlInfo.excludedFromLastMessage=l,u}var d=!!n.match(/excludeFromHistoryMessage/),p=!!n.match(/excludeOriginalSignalingFromHistoryMessage/);return u.messageControlInfo.excludedFromUnreadCount=d||p,u.messageControlInfo.excludedFromLastMessage=d||p,u}},{key:"sendSignaling",value:function(e,t){var n=this;return this.getModule(Qn).sendMessageInstance(e,this._genMessageControlInfo(t)).catch((function(e){return n._isHandling=!1,Go(e)}))}},{key:"filterMessageList",value:function(e){var t=this;return e.filter((function(e){return t._filterSignalingMessage(e)}))}},{key:"_filterSignalingMessage",value:function(e){var t=!1;if(e.type&&e.type===S.MSG_CUSTOM){var n=e.cloudCustomData,o=void 0===n?"":n,a=e.payload.data,i=void 0===a?"":a,s=o.match(/"type":"tsignaling"/),r=i.match(/inviteID/),c=i.match(/actionType/);t=s||r&&c}return!!t}},{key:"startTimer",value:function(e){var t=this,n="".concat(this._n,".startTimer"),o=e.timeout,a=e.inviteID,i=e.inviter,s=e.groupID,r=i===this.getMyUserID();if(Je.l("".concat(n," timeout:").concat(o," isInviter:").concat(r," groupID:").concat(s)),!(o<=0))var c=r?o+5:o,u=1,l=setInterval((function(){var o=t._hasLocalInviteInfo(e,r);u0:i.length>0&&i.includes(this.getMyUserID()))}},{key:"_getReceiver",value:function(e,t){var n=t.groupID,o=t.inviteeList,a=t.inviter;return e?n||o[0]:n||a}},{key:"_sendTimeoutNotice",value:function(e,n){var o=this,a=this.getInviteInfo(e),i=this._getReceiver(n,a);Je.l("".concat(this._n,"._sendTimeoutNotice inviteID:").concat(e," to:").concat(i," isInviter:").concat(n));var s=this._localSignalingHandler.createTimeoutCustomData(t(t({},a),{},{isInviter:n})),r=this._localSignalingHandler.createSignalingMessage(s,i);return this.sendSignaling(r,s).then((function(t){if(t&&0===t.code){var a=s.data,i=s.groupID,c=s.inviteeList,u=s.inviter;o.emitEvent(N.INVITATION_TIMEOUT,{data:a,groupID:i,inviteID:e,inviteeList:c,inviter:u,isSelfTimeout:!0,message:r}),n?o.deleteInviteInfo(e):o.updateInviteInfo(s)}}))}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._inviteInfoMap.clear(),this._canIUseSignaling=!1,this._isHandling=!1,this._historySignalingHandler.reset(),this._isC2CUnreadHandleCompleted=!1,this._isConvSyncCompleted=!1,this._isSyncCompleted=!1}}]),a}(Po),js=function(){function e(t){var n=this;o(this,e);var a,i=new Xo("sdkConstruct");(this._n="ModuleManager",this._isReady=!1,this._reason=Ao.USER_NOT_LOGGED_IN,this._startLoginTs=0,this._moduleMap=new Map,this._innerEmitter=null,this._outerEmitter=null,this._checkCount=0,this._checkTimer=-1,this._moduleMap.set(io,new di(this,t)),this._moduleMap.set(Mo,new Gs(this)),this._moduleMap.set(ho,new vs(this)),this._moduleMap.set(fo,new Rs(this)),this._moduleMap.set(mo,new Cs(this)),this._moduleMap.set(go,new as(this)),this._moduleMap.set(_o,new fs(this)),this._moduleMap.set(Xn,new _i(this)),this._moduleMap.set(Qn,new Pi(this)),this._moduleMap.set(Zn,new Ui(this)),this._moduleMap.set(So,new bi(this)),this._moduleMap.set(Co,new wi(this)),this._moduleMap.set($n,new li(this)),this._moduleMap.set(eo,new _a(this)),this._moduleMap.set(ao,new Oa(this)),this._moduleMap.set(to,new ei(this)),this._moduleMap.set(oo,new ai(this)),this._moduleMap.set(so,new hi(this)),this._moduleMap.set(Do,new ws(this)),this._moduleMap.set(ro,new mi(this)),this._moduleMap.set(co,new Ti(this)),this._moduleMap.set(uo,new Ni(this)),this._moduleMap.set(lo,new Fi(this)),this._moduleMap.set(po,new qi(this)),this._moduleMap.set(vo,new ms(this)),this._moduleMap.set(no,new Ls(this)),this._moduleMap.set(Io,new Ps(this)),this._moduleMap.set(yo,new Us(this)),this._moduleMap.set(To,new bs(this)),this._moduleMap.set(Eo,new Ws(this)),this._eventThrottleMap=new Map,ft(t.modules))?(Object.keys(t.modules).forEach((function(e){a=t.modules[e],"group-module"===e?n._moduleMap.set(to,new a(n)):"relationship-module"===e?n._moduleMap.set(no,new a(n)):"signaling-module"===e&&n._moduleMap.set(Eo,new a(n))})),this._moduleMap.get(io).setUsingChatCore(!0)):this._moduleMap.has(to)||this._moduleMap.get(io).setUsingChatCore(!0);var s=t.instanceID,r=t.SDKAppID,c=this._moduleMap.get(io).isIntl(),u=this._moduleMap.get(io).isUsingChatCore(),l="instanceID:".concat(s," SDKAppID:").concat(r," isIntl:").concat(c," isUsingChatCore:").concat(u," host:").concat(Yt()," isIOSWebView:").concat(be)+" inBrowser:".concat(ue," inMiniApp:").concat(ce)+" workerAvailable:".concat(Ge," UserAgent:").concat(de);Xo.bindEventStatModule(this._moduleMap.get(ro)),i.setMessage("".concat(l," ").concat(function(){var e="";if(ce)try{var t=le.getSystemInfoSync(),n=t.model,o=t.version,a=t.system,i=t.platform,s=t.SDKVersion;e="model:".concat(n," version:").concat(o," system:").concat(a," platform:").concat(i," SDKVersion:").concat(s)}catch(r){e=""}return e}())).end(),Je.i("SDK ".concat(l)),ko.prototype._getErrorMessage=this.getErrorMessage.bind(this),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}return i(e,[{key:"_startTimer",value:function(){var e=this._moduleMap.get(fo),t=e.isWorkerEnabled();Je.l("".concat(this._n,".startTimer isWorkerEnabled:").concat(t," seed:").concat(this._checkTimer)),t?e.startWorkerTimer():this._startMainThreadTimer()}},{key:"_startMainThreadTimer",value:function(){this._checkTimer<0&&(this._checkTimer=setInterval(this.onCheckTimer.bind(this),1e3)),Je.l("".concat(this._n,"._startMainThreadTimer seed:").concat(this._checkTimer))}},{key:"stopTimer",value:function(){var e=this._moduleMap.get(fo),t=e.isWorkerEnabled();Je.l("".concat(this._n,".stopTimer isWorkerEnabled:").concat(t," seed:").concat(this._checkTimer)),t?e.stopWorkerTimer():this._stopMainThreadTimer()}},{key:"_stopMainThreadTimer",value:function(){Je.l("".concat(this._n,"._stopMainThreadTimer")),this._checkTimer>0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:"_stopMainThreadSocket",value:function(){Je.l("".concat(this._n,"._stopMainThreadSocket"));var e=this._moduleMap.get(go);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:"_startMainThreadSocket",value:function(){Je.l("".concat(this._n,"._startMainThreadSocket"));var e=this._moduleMap.get(go);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:"onWorkerTimerEnabled",value:function(){Je.l("".concat(this._n,".onWorkerTimerEnabled, disable main thread timer and socket")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:"onWorkerTimerDisabled",value:function(){Je.l("".concat(this._n,".onWorkerTimerDisabled, enable main thread timer and socket")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:"onCheckTimer",value:function(){this._checkCount+=1;var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(o){t.e(o)}finally{t.f()}}},{key:"_initReadyList",value:function(){var e=this;this._readyList=[this._moduleMap.get(Xn)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:"_onModuleReady",value:function(){var e=!0;if(this._readyList.forEach((function(t){t.isReady()||(e=!1)})),e&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(E.SDK_READY);var t=Date.now()-this._startLoginTs;Je.w("SDK is ready. cost ".concat(t," ms")),this._startLoginTs=Date.now();var n=this._moduleMap.get(co).getNetworkType(),o=this._ssoLogForReady.getStartTs()+Ve;this._ssoLogForReady.setNetworkType(n).setMessage(t).start(o).end()}}},{key:"login",value:function(){0===this._startLoginTs&&(Be(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(co).start(),this._ssoLogForReady=new Xo("sdkReady"),this._reason=Ao.LOGGING_IN)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOuterEmitterInstance",value:function(){return null===this._outerEmitter&&(this._outerEmitter=new Ci,Ro(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(e,t){var n=this;if(this._canIUseSignaling()){if(e===E.MESSAGE_RECEIVED){var o=this.getModule(Eo);o.onNewMessageList(t)}if(e===E.MESSAGE_MODIFIED){var a=this.getModule(Eo);a.onMessageModified(t)}}if(e===E.CONVERSATION_LIST_UPDATED||e===E.FRIEND_LIST_UPDATED||e===E.GROUP_LIST_UPDATED||e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)if(this._eventThrottleMap.has(e)){var i=Date.now(),s=this._eventThrottleMap.get(e);i-s.last<=1e3?(s.timeoutID&&clearTimeout(s.timeoutID),s.timeoutID=setTimeout((function(){s.last=Date.now(),n._outerEmitter._emit.apply(n._outerEmitter,[e,{name:e,data:n._getEventData(e)}])}),1e3)):(s.last=i,this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]))}else this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:arguments[1]}])}.bind(this)),this._outerEmitter}},{key:"_canIUseSignaling",value:function(){var e=this.getModule(Eo);return!!e&&e.canIUseSignaling()}},{key:"_getEventData",value:function(e){return e===E.CONVERSATION_LIST_UPDATED?this._moduleMap.get(ao).getLocalConversationList():e===E.FRIEND_LIST_UPDATED?this._moduleMap.get(no).getLocalFriendList(!1):e===E.GROUP_LIST_UPDATED?this._moduleMap.get(to).getLocalGroupList():e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(ao).getTotalUnreadMessageCount():void 0}},{key:"getInnerEmitterInstance",value:function(){return null===this._innerEmitter&&(this._innerEmitter=new Ci,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(e,t){var n;n=ft(arguments[1])&&arguments[1].data?[e,{name:arguments[0],data:arguments[1].data}]:[e,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,n)}.bind(this)),this._innerEmitter}},{key:"hasModule",value:function(e){return this._moduleMap.has(e)}},{key:"getModule",value:function(e){return this._moduleMap.get(e)}},{key:"isReady",value:function(){return this._isReady}},{key:"isIntl",value:function(){return this.getModule(io).isIntl()}},{key:"getNotReadyReason",value:function(){return this._reason}},{key:"setNotReadyReason",value:function(e){this._reason=e}},{key:"getErrorMessage",value:function(e,t,n){return this._moduleMap.get(Do).get({key:e,replacement1:t,replacement2:n,isIntl:this.isIntl()})}},{key:"outputWarning",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&Je.w(o)}},{key:"onError",value:function(e){var t="code:".concat(e.code," message:").concat(e.message);Je.w("Oops! ".concat(t)),new Xo("error").setMessage(t).setNetworkType(this.getModule(co).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(E.ERROR,e)}},{key:"restartTimer",value:function(){Je.l("".concat(this._n,".restartTimer")),this.stopTimer(),this._startTimer();var e=this.getModule(to);e&&e.restartPolling()}},{key:"getTimerID",value:function(){var e=this._moduleMap.get(fo);return e.isWorkerEnabled()?e.getTimerID():this._checkTimer}},{key:"getPollingTimerID",value:function(e){return this._moduleMap.get(to).getPollingTimerID(e)}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),Be();var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.reset&&n.reset()}}catch(s){t.e(s)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(E.SDK_NOT_READY);var o,a=D(this._eventThrottleMap);try{for(a.s();!(o=a.n()).done;){var i=v(o.value,2)[1];i.timeoutID&&clearTimeout(i.timeoutID)}}catch(s){a.e(s)}finally{a.f()}this._eventThrottleMap.clear()}}]),e}(),Js=function(){function e(t){o(this,e),this._funcMap=new Map,this._m=t,this._n="SafetyCallback",this._reportCount=0}return i(e,[{key:"defense",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("string"!=typeof e)return null;if(0===e.length)return null;if("function"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:"defenseOnce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return"function"!=typeof t?null:this._pack(e,t,n)}},{key:"find",value:function(e,t){return"string"!=typeof e||0===e.length||"function"!=typeof t?null:this._funcMap.has(e)&&this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(this._m.outputWarning("ListenerFnNotFound",e),null)}},{key:"delete",value:function(e,t){return"function"==typeof t&&(!!this._funcMap.has(e)&&(!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)))}},{key:"_pack",value:function(e,t,n){var o=this;return function(){try{t.apply(n,Array.from(arguments))}catch(c){var a=Object.values(E).indexOf(e),i="CallbackError";if(-1!==a){var s=Object.keys(E)[a];o._m.outputWarning(i,s,c)}if(o._reportCount<5){var r=new Xo(i);r.setMessage("eventName:".concat(e)).setMoreMessage(c.message).end(),o._reportCount+=1}}}}},{key:"destroy",value:function(){this._funcMap.clear()}},{key:"reset",value:function(){Je.l("".concat(this._n,".reset")),this._reportCount=0}}]),e}(),zs=function(){function e(t){o(this,e);var n={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||"",oversea:t.oversea||!1,instanceID:Kt(),devMode:t.devMode||!1,proxyServer:t.proxyServer||void 0,fileUploadProxy:t.fileUploadProxy||void 0,fileDownloadProxy:t.fileDownloadProxy||t.fileUploadProxy||void 0,modules:t.modules||void 0};this._m=new js(n),this._vendorMap=new Map,this._safetyCallbackFactory=new Js(this._m)}return i(e,[{key:"onError",value:function(e){this._m.onError(e)}},{key:"login",value:function(e){return this._m.login(),this._getModule(Xn).login(e)}},{key:"logout",value:function(){var e=this;return this._getModule(Xn).logout().then((function(t){return e._safetyCallbackFactory.reset(),e._m.reset(),t}))}},{key:"getLoginUser",value:function(){return this._getModule(Xn).getLoginUser()}},{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:"getErrorMessage",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:"_getModule",value:function(e){return this._m.getModule(e)}},{key:"destroy",value:function(){var e=this;return this.logout().finally((function(){e._safetyCallbackFactory.destroy(),e._m.stopTimer(),e._getModule(fo).terminate(),e._getModule(go).dealloc();var t=e._m.getOuterEmitterInstance(),n=e._getModule(io);t.emit(E.SDK_DESTROY,{SDKAppID:n.getSDKAppID()})}))}},{key:"on",value:function(e,t,n){Je.d("on","eventName:".concat(e)),this._m.getOuterEmitterInstance().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"once",value:function(e,t,n){Je.d("once","eventName:".concat(e)),this._m.getOuterEmitterInstance().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:"off",value:function(e,t,n,o){Je.d("off","eventName:".concat(e));var a=this._safetyCallbackFactory.find(e,t);null!==a&&(this._m.getOuterEmitterInstance().off(e,a,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:"registerPlugin",value:function(e){mt(e["tim-offline-push-plugin"])?this._getModule(lo).registerPlugin(e):this._getModule(Io).registerPlugin(e)}},{key:"setLogLevel",value:function(e){if(e<=0){var t=this.getErrorMessage("TIM_ASCII_ART");t&&console.log(t);var n=this.getErrorMessage("API_REFER");if(n){on()?console.log("%c ".concat("IM SDK API ->"," %c"),"background:#ff9d00; padding:1px; border-radius:3px; color: #fff","background:transparent",n):console.log("IM SDK API ->",n)}var o=this.getErrorMessage("DOCS_GUIDE");o&&console.log(o);var a=this.getErrorMessage("IOS_WEBVIEW_WARNING");be&&a&&console.warn(a)}Je.setLevel(e)}},{key:"createTextMessage",value:function(e){return this._getModule(Qn).createTextMessage(e)}},{key:"createTextAtMessage",value:function(e){return this._getModule(Qn).createTextMessage(e)}},{key:"createImageMessage",value:function(e){return this._getModule(Qn).createImageMessage(e)}},{key:"createAudioMessage",value:function(e){return this._getModule(Qn).createAudioMessage(e)}},{key:"createVideoMessage",value:function(e){return this._getModule(Qn).createVideoMessage(e)}},{key:"createCustomMessage",value:function(e){return this._getModule(Qn).createCustomMessage(e)}},{key:"createFaceMessage",value:function(e){return this._getModule(Qn).createFaceMessage(e)}},{key:"createFileMessage",value:function(e){return this._getModule(Qn).createFileMessage(e)}},{key:"createLocationMessage",value:function(e){return this._getModule(Qn).createLocationMessage(e)}},{key:"createMergerMessage",value:function(e){return this._getModule(Qn).createMergerMessage(e)}},{key:"downloadMergerMessage",value:function(e){return e.type!==S.MSG_MERGER?Go({code:Ao.MSG_MERGER_TYPE_INVALID}):pn(e.payload.downloadKey)?Go({code:Ao.MSG_MERGER_KEY_INVALID}):this._getModule(Qn).downloadMergerMessage(e).catch((function(e){return Go({code:Ao.MSG_MERGER_DOWNLOAD_FAIL})}))}},{key:"createForwardMessage",value:function(e){return this._getModule(Qn).createForwardMessage(e)}},{key:"sendMessage",value:function(e,t){return e instanceof pa?this._getModule(Qn).sendMessageInstance(e,t):Go({code:Ao.MSG_INSTANCE_REQUIRED})}},{key:"searchCloudMessages",value:function(e){return this._getModule(Qn).searchCloudMessages(e)}},{key:"callExperimentalAPI",value:function(e,t){return"sendComboMessage"===e?this._getModule(Co).sendMessage(t):"handleGroupInvitation"===e?this._getModule(to).handleGroupInvitation(t):"isCommercialAbilityEnabled"===e?this._getModule(Mo).isFeatureEnabled(t):"isIntl"===e?this.isIntl():"sendTRTCCustomData"===e||"sendRoomCustomData"===e?this._getModule(To).sendTRTCCustomData(t):"getTimerID"===e?this._m.getTimerID():"getPollingTimerID"===e?this._m.getPollingTimerID(t):"setApplicationID"===e?(this._getModule(io).setApplicationID(t),void this._getModule(_o).updateProtocolConfig()):"getServerConfig"===e?this._getModule(ho).getServerConfig(t):Go({code:Ao.INVALID_OPERATION})}},{key:"revokeMessage",value:function(e){return this._getModule(Qn).revokeMessage(e)}},{key:"resendMessage",value:function(e,t){return e instanceof pa?this._getModule(Qn).resendMessage(e,t):Go({code:Ao.MSG_INSTANCE_REQUIRED})}},{key:"deleteMessage",value:function(e){return this._getModule(Qn).deleteMessage(e)}},{key:"translateText",value:function(e){return this._getModule(Qn).translateText(e)}},{key:"convertVoiceToText",value:function(e){return this._getModule(Qn).convertVoiceToText(e)}},{key:"setMessageExtensions",value:function(e,t){return this._getModule(Zn).setMessageExtensions(e,t)}},{key:"getMessageExtensions",value:function(e){return this._getModule(Zn).getMessageExtensions(e)}},{key:"deleteMessageExtensions",value:function(e,t){return this._getModule(Zn).deleteMessageExtensions(e,t)}},{key:"addMessageReaction",value:function(e,t){return this._getModule(So).addMessageReaction(e,t)}},{key:"removeMessageReaction",value:function(e,t){return this._getModule(So).removeMessageReaction(e,t)}},{key:"getMessageReactions",value:function(e){return this._getModule(So).getMessageReactions(e)}},{key:"getAllUserListOfMessageReaction",value:function(e){return this._getModule(So).getAllUserListOfMessageReaction(e)}},{key:"modifyMessage",value:function(e){return this._getModule(Qn).modifyRemoteMessage(e)}},{key:"getMessageList",value:function(e){return this._getModule(ao).getMessageList(e)}},{key:"getMessageListHopping",value:function(e){return this._getModule(ao).getMessageListHopping(e)}},{key:"sendMessageReadReceipt",value:function(e){return this._getModule(ao).sendReadReceipt(e)}},{key:"getMessageReadReceiptList",value:function(e){return this._getModule(ao).getReadReceiptList(e)}},{key:"getGroupMessageReadMemberList",value:function(e){var t=this._getModule(to);return t?t.getReadReceiptDetail(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"findMessage",value:function(e){return this._getModule(ao).findMessage(e)}},{key:"setMessageRead",value:function(e){return this._getModule(ao).setMessageRead(e)}},{key:"getConversationList",value:function(e){return this._getModule(ao).getConversationList(e)}},{key:"getConversationProfile",value:function(e){return this._getModule(ao).getConversationProfile(e)}},{key:"deleteConversation",value:function(e){return this._getModule(ao).deleteConversation(e)}},{key:"setConversationDraft",value:function(e){return this._getModule(ao).setConversationDraft(e)}},{key:"clearHistoryMessage",value:function(e){return this._getModule(ao).clearHistoryMessage(e)}},{key:"pinConversation",value:function(e){return this._getModule(ao).pinConversation(e)}},{key:"setAllMessageRead",value:function(e){return this._getModule(ao).setAllMessageRead(e)}},{key:"setMessageRemindType",value:function(e){return this._getModule(ao).setMessageRemindType(e)}},{key:"getTotalUnreadMessageCount",value:function(){return this._getModule(ao).getTotalUnreadMessageCount()}},{key:"setConversationCustomData",value:function(e){return this._getModule(ao).setConversationCustomData(e)}},{key:"markConversation",value:function(e){return this._getModule(ao).markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._getModule(ao).getConversationGroupList()}},{key:"createConversationGroup",value:function(e){return this._getModule(ao).createConversationGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._getModule(ao).deleteConversationGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._getModule(ao).renameConversationGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._getModule(ao).addConversationsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._getModule(ao).deleteConversationsFromGroup(e)}},{key:"getMyProfile",value:function(){return this._getModule($n).getMyProfile()}},{key:"getUserProfile",value:function(e){return this._getModule($n).getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._getModule($n).updateMyProfile(e)}},{key:"getBlacklist",value:function(){return this._getModule($n).getLocalBlacklist()}},{key:"addToBlacklist",value:function(e){return this._getModule($n).addBlacklist(e)}},{key:"removeFromBlacklist",value:function(e){return this._getModule($n).deleteBlacklist(e)}},{key:"setSelfStatus",value:function(e){return this._getModule($n).setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._getModule($n).getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._getModule($n).subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._getModule($n).unsubscribeUserStatus(e)}},{key:"getFriendList",value:function(){var e=this._getModule(no);return e?e.getLocalFriendList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"addFriend",value:function(e){var t=this._getModule(no);return t?t.addFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"deleteFriend",value:function(e){var t=this._getModule(no);return t?t.deleteFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"checkFriend",value:function(e){var t=this._getModule(no);return t?t.checkFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getFriendProfile",value:function(e){var t=this._getModule(no);return t?t.getFriendProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"updateFriend",value:function(e){var t=this._getModule(no);return t?t.updateFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getFriendApplicationList",value:function(){var e=this._getModule(no);return e?e.getLocalFriendApplicationList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"acceptFriendApplication",value:function(e){var t=this._getModule(no);return t?t.acceptFriendApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"refuseFriendApplication",value:function(e){var t=this._getModule(no);return t?t.refuseFriendApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"deleteFriendApplication",value:function(e){var t=this._getModule(no);return t?t.deleteFriendApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setFriendApplicationRead",value:function(){var e=this._getModule(no);return e?e.setFriendApplicationRead():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getFriendGroupList",value:function(){var e=this._getModule(no);return e?e.getLocalFriendGroupList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"createFriendGroup",value:function(e){var t=this._getModule(no);return t?t.createFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"deleteFriendGroup",value:function(e){var t=this._getModule(no);return t?t.deleteFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"addToFriendGroup",value:function(e){var t=this._getModule(no);return t?t.addToFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"removeFromFriendGroup",value:function(e){var t=this._getModule(no);return t?t.removeFromFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"renameFriendGroup",value:function(e){var t=this._getModule(no);return t?t.renameFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupList",value:function(){var e=this._getModule(to);return e?e.getGroupList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupProfile",value:function(e){var t=this._getModule(to);return t?t.getGroupProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"createGroup",value:function(e){var t=this._getModule(to);return t?t.createGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"dismissGroup",value:function(e){var t=this._getModule(to);return t?t.dismissGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"updateGroupProfile",value:function(e){var t=this._getModule(to);return t?t.updateGroupProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"joinGroup",value:function(e){var t=this._getModule(to);return t?t.joinGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"quitGroup",value:function(e){var t=this._getModule(to);return t?t.quitGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"searchGroupByID",value:function(e){var t=this._getModule(to);return t?t.searchGroupByID(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._getModule(to);return t?t.getGroupOnlineMemberCount(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"changeGroupOwner",value:function(e){var t=this._getModule(to);return t?t.changeGroupOwner(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupApplicationList",value:function(){var e=this._getModule(to);return e?e.getGroupApplicationList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"handleGroupApplication",value:function(e){var t=this._getModule(to);return t?t.handleGroupApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"initGroupAttributes",value:function(e){var t=this._getModule(to);return t?t.initGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setGroupAttributes",value:function(e){var t=this._getModule(to);return t?t.setGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"deleteGroupAttributes",value:function(e){var t=this._getModule(to);return t?t.deleteGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupAttributes",value:function(e){var t=this._getModule(to);return t?t.getGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setGroupCounters",value:function(e){var t=this._getModule(to);return t?t.setGroupCounters(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"increaseGroupCounter",value:function(e){var t=this._getModule(to);return t?t.increaseGroupCounter(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"decreaseGroupCounter",value:function(e){var t=this._getModule(to);return t?t.decreaseGroupCounter(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupCounters",value:function(e){var t=this._getModule(to);return t?t.getGroupCounters(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupMemberList",value:function(e){var t=this._getModule(to);return t?t.getGroupMemberList(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getGroupMemberProfile",value:function(e){var t=this._getModule(to);return t?t.getGroupMemberProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"addGroupMember",value:function(e){var t=this._getModule(to);return t?t.addGroupMember(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"deleteGroupMember",value:function(e){var t=this._getModule(to);return t?t.deleteGroupMember(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setGroupMemberMuteTime",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberMuteTime(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setGroupMemberRole",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberRole(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setGroupMemberNameCard",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberNameCard(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"setGroupMemberCustomField",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberCustomField(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"markGroupMemberList",value:function(e){var t=this._getModule(to);return t?t.markGroupMemberList(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getJoinedCommunityList",value:function(){return this._getModule(oo).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(e){return this._getModule(oo).createTopicInCommunity(e)}},{key:"deleteTopicFromCommunity",value:function(e){return this._getModule(oo).deleteTopicFromCommunity(e)}},{key:"updateTopicProfile",value:function(e){return this._getModule(oo).updateTopicProfile(e)}},{key:"getTopicList",value:function(e){return this._getModule(oo).getTopicList(e)}},{key:"addSignalingListener",value:function(e,t,n){var o=this._getModule(Eo);o&&o.addSignalingListener(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"removeSignalingListener",value:function(e,t,n){var o=this._safetyCallbackFactory.find(e,t);if(null!==o){var a=this._getModule(Eo);a&&(a.removeSignalingListener(e,o,n),this._safetyCallbackFactory.delete(e,t))}}},{key:"invite",value:function(e){var t=this._getModule(Eo);return t?t.invite(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"inviteSync",value:function(e,t,n){var o=this._getModule(Eo);return o?o.inviteSync(e,t,n):""}},{key:"inviteInGroup",value:function(e){var t=this._getModule(Eo);return t?t.invite(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"inviteInGroupSync",value:function(e,t,n){var o=this._getModule(Eo);return o?o.inviteSync(e,t,n):""}},{key:"cancel",value:function(e){var t=this._getModule(Eo);return t?t.cancel(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"accept",value:function(e){var t=this._getModule(Eo);return t?t.accept(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"reject",value:function(e){var t=this._getModule(Eo);return t?t.reject(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:"getSignalingInfo",value:function(e){var t=this._getModule(Eo);return t?t.getSignalingInfo(e):null}},{key:"modifyInvitation",value:function(e){var t=this._getModule(Eo);return t?t.modifyInvitation(e):Go({code:Ao.CANNOT_FIND_MODULE})}}]),e}(),Xs={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 Qs(e,t){if(e.isReady()||1===Xs[t])return!0;var n=e.getNotReadyReason(),o={code:n,message:"".concat(e.getErrorMessage(n)," | ").concat(t," | ").concat(e.getErrorMessage(Ao.SDK_IS_NOT_READY))};return e.onError(o),o}var Zs={},$s={};return $s.create=function(e){var n="TencentCloudChat.create",o=0,a=e.SDKAppID;if(_t(a))o=a;else if(o=parseInt(a),isNaN(a))return Je.e("".concat(n," failed. Failed to parse the SDKAppID, please check the arguments")),null;if(o&&Zs[o])return Zs[o];Je.l("".concat(n));var i=new zs(t(t({},e),{},{SDKAppID:o}));i.on(E.SDK_DESTROY,(function(e){Zs[e.data.SDKAppID]=null,delete Zs[e.data.SDKAppID]}));var s=function(e){var t=Object.create(null);return Object.keys(zn).forEach((function(n){if(e[n]){var o=new k;t[n]=function(){var t=Array.from(arguments);return o.use((function(t,o){var a=Qs(e,n);return!0===a?o():Go(a)})).use((function(e,t){if(!0===_n(e,Jn[n],n))return t()})).use((function(t,o){return e[n].apply(e,t)})),o.run(t)}}})),t}(i);return Zs[o]=s,Jn.hookGetAPITips(i.getErrorMessage.bind(i)),Je.l("".concat(n," ok")),s},$s.TYPES=S,$s.EVENT=E,$s.TSignaling=N,$s.VERSION="3.2.3",Je.l("TencentCloudChat.VERSION:".concat($s.VERSION)),$s})); + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242895); +})() +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/@tencentcloud/chat/index.js.map b/miniprogram_npm/@tencentcloud/chat/index.js.map new file mode 100644 index 0000000..1555d53 --- /dev/null +++ b/miniprogram_npm/@tencentcloud/chat/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA","file":"index.js","sourcesContent":["!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()}(this,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}function g(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}function h(e,t){if(t&&(\"object\"==typeof t||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return g(e)}function f(e){var t=l();return function(){var n,o=c(e);if(t){var a=c(this).constructor;n=Reflect.construct(o,arguments,a)}else n=o.apply(this,arguments);return h(this,n)}}function v(e,t){return M(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null==n)return;var o,a,i=[],s=!0,r=!1;try{for(n=n.call(e);!(s=(o=n.next()).done)&&(i.push(o.value),!t||i.length!==t);s=!0);}catch(c){r=!0,a=c}finally{try{s||null==n.return||n.return()}finally{if(r)throw a}}return i}(e,t)||y(e,t)||C()}function m(e){return function(e){if(Array.isArray(e))return T(e)}(e)||I(e)||y(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function M(e){if(Array.isArray(e))return e}function I(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}function y(e,t){if(e){if(\"string\"==typeof e)return T(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:a}}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 i,s=!0,r=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){r=!0,i=e},f:function(){try{s||null==n.return||n.return()}finally{if(r)throw i}}}}var E={SDK_READY:\"sdkStateReady\",SDK_NOT_READY:\"sdkStateNotReady\",SDK_DESTROY:\"sdkDestroy\",MESSAGE_RECEIVED:\"onMessageReceived\",ROOM_CUSTOM_DATA_RECEIVED:\"onRoomCustomDataReceived\",MESSAGE_MODIFIED:\"onMessageModified\",MESSAGE_REVOKED:\"onMessageRevoked\",MESSAGE_READ_BY_PEER:\"onMessageReadByPeer\",MESSAGE_READ_RECEIPT_RECEIVED:\"onMessageReadReceiptReceived\",MESSAGE_EXTENSIONS_UPDATED:\"onMessageExtensionsUpdated\",MESSAGE_EXTENSIONS_DELETED:\"onMessageExtensionsDeleted\",MESSAGE_REACTIONS_UPDATED:\"onMessageReactionsUpdated\",CONVERSATION_LIST_UPDATED:\"onConversationListUpdated\",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:\"onTotalUnreadMessageCountUpdated\",CONVERSATION_GROUP_LIST_UPDATED:\"onConversationGroupListUpdated\",CONVERSATION_IN_GROUP_UPDATED:\"onConversationInGroupUpdated\",GROUP_LIST_UPDATED:\"onGroupListUpdated\",GROUP_ATTRIBUTES_UPDATED:\"groupAttributesUpdated\",GROUP_COUNTER_UPDATED:\"onGroupCounterUpdated\",TOPIC_CREATED:\"onTopicCreated\",TOPIC_DELETED:\"onTopicDeleted\",TOPIC_UPDATED:\"onTopicUpdated\",PROFILE_UPDATED:\"onProfileUpdated\",USER_STATUS_UPDATED:\"onUserStatusUpdated\",BLACKLIST_UPDATED:\"blacklistUpdated\",FRIEND_LIST_UPDATED:\"onFriendListUpdated\",FRIEND_GROUP_LIST_UPDATED:\"onFriendGroupListUpdated\",FRIEND_APPLICATION_LIST_UPDATED:\"onFriendApplicationListUpdated\",KICKED_OUT:\"kickedOut\",ERROR:\"error\",NET_STATE_CHANGE:\"netStateChange\"},S={MSG_TEXT:\"TIMTextElem\",MSG_IMAGE:\"TIMImageElem\",MSG_SOUND:\"TIMSoundElem\",MSG_AUDIO:\"TIMSoundElem\",MSG_FILE:\"TIMFileElem\",MSG_FACE:\"TIMFaceElem\",MSG_VIDEO:\"TIMVideoFileElem\",MSG_GEO:\"TIMLocationElem\",MSG_LOCATION:\"TIMLocationElem\",MSG_GRP_TIP:\"TIMGroupTipElem\",MSG_GRP_SYS_NOTICE:\"TIMGroupSystemNoticeElem\",MSG_CUSTOM:\"TIMCustomElem\",MSG_MERGER:\"TIMRelayElem\",MSG_PRIORITY_HIGH:\"High\",MSG_PRIORITY_NORMAL:\"Normal\",MSG_PRIORITY_LOW:\"Low\",MSG_PRIORITY_LOWEST:\"Lowest\",CONV_C2C:\"C2C\",CONV_GROUP:\"GROUP\",CONV_TOPIC:\"TOPIC\",CONV_SYSTEM:\"@TIM#SYSTEM\",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:\"Private\",GRP_WORK:\"Private\",GRP_PUBLIC:\"Public\",GRP_CHATROOM:\"ChatRoom\",GRP_MEETING:\"ChatRoom\",GRP_AVCHATROOM:\"AVChatRoom\",GRP_COMMUNITY:\"Community\",GRP_MBR_ROLE_OWNER:\"Owner\",GRP_MBR_ROLE_ADMIN:\"Admin\",GRP_MBR_ROLE_MEMBER:\"Member\",GRP_MBR_ROLE_CUSTOM:\"Custom\",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:\"AcceptAndNotify\",MSG_REMIND_ACPT_NOT_NOTE:\"AcceptNotNotify\",MSG_REMIND_DISCARD:\"Discard\",GENDER_UNKNOWN:\"Gender_Type_Unknown\",GENDER_FEMALE:\"Gender_Type_Female\",GENDER_MALE:\"Gender_Type_Male\",KICKED_OUT_MULT_ACCOUNT:\"multipleAccount\",KICKED_OUT_MULT_DEVICE:\"multipleDevice\",KICKED_OUT_USERSIG_EXPIRED:\"userSigExpired\",KICKED_OUT_REST_API:\"REST_API_Kick\",ALLOW_TYPE_ALLOW_ANY:\"AllowType_Type_AllowAny\",ALLOW_TYPE_NEED_CONFIRM:\"AllowType_Type_NeedConfirm\",ALLOW_TYPE_DENY_ANY:\"AllowType_Type_DenyAny\",FORBID_TYPE_NONE:\"AdminForbid_Type_None\",FORBID_TYPE_SEND_OUT:\"AdminForbid_Type_SendOut\",JOIN_OPTIONS_FREE_ACCESS:\"FreeAccess\",JOIN_OPTIONS_NEED_PERMISSION:\"NeedPermission\",JOIN_OPTIONS_DISABLE_APPLY:\"DisableApply\",JOIN_STATUS_SUCCESS:\"JoinedSuccess\",JOIN_STATUS_ALREADY_IN_GROUP:\"AlreadyInGroup\",JOIN_STATUS_WAIT_APPROVAL:\"WaitAdminApproval\",INVITE_OPTIONS_DISABLE_INVITE:\"DisableInvite\",INVITE_OPTIONS_NEED_PERMISSION:\"NeedPermission\",INVITE_OPTIONS_FREE_ACCESS:\"FreeAccess\",GRP_PROFILE_OWNER_ID:\"ownerID\",GRP_PROFILE_CREATE_TIME:\"createTime\",GRP_PROFILE_LAST_INFO_TIME:\"lastInfoTime\",GRP_PROFILE_MEMBER_NUM:\"memberNum\",GRP_PROFILE_MAX_MEMBER_NUM:\"maxMemberNum\",GRP_PROFILE_JOIN_OPTION:\"joinOption\",GRP_PROFILE_INVITE_OPTION:\"inviteOption\",GRP_PROFILE_INTRODUCTION:\"introduction\",GRP_PROFILE_NOTIFICATION:\"notification\",GRP_PROFILE_MUTE_ALL_MBRS:\"muteAllMembers\",SNS_ADD_TYPE_SINGLE:\"Add_Type_Single\",SNS_ADD_TYPE_BOTH:\"Add_Type_Both\",SNS_DELETE_TYPE_SINGLE:\"Delete_Type_Single\",SNS_DELETE_TYPE_BOTH:\"Delete_Type_Both\",SNS_APPLICATION_TYPE_BOTH:\"Pendency_Type_Both\",SNS_APPLICATION_SENT_TO_ME:\"Pendency_Type_ComeIn\",SNS_APPLICATION_SENT_BY_ME:\"Pendency_Type_SendOut\",SNS_APPLICATION_AGREE:\"Response_Action_Agree\",SNS_APPLICATION_AGREE_AND_ADD:\"Response_Action_AgreeAndAdd\",SNS_CHECK_TYPE_BOTH:\"CheckResult_Type_Both\",SNS_CHECK_TYPE_SINGLE:\"CheckResult_Type_Single\",SNS_TYPE_NO_RELATION:\"CheckResult_Type_NoRelation\",SNS_TYPE_A_WITH_B:\"CheckResult_Type_AWithB\",SNS_TYPE_B_WITH_A:\"CheckResult_Type_BWithA\",SNS_TYPE_BOTH_WAY:\"CheckResult_Type_BothWay\",NET_STATE_CONNECTED:\"connected\",NET_STATE_CONNECTING:\"connecting\",NET_STATE_DISCONNECTED:\"disconnected\",MSG_AT_ALL:\"__kImSDK_MesssageAtALL__\",READ_ALL_C2C_MSG:\"readAllC2CMessage\",READ_ALL_GROUP_MSG:\"readAllGroupMessage\",READ_ALL_MSG:\"readAllMessage\",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},N={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},k=function(){function e(){o(this,e),this.cache=[],this.options=null}return i(e,[{key:\"use\",value:function(e){if(\"function\"!=typeof e)throw\"middleware must be a function\";return this.cache.push(e),this}},{key:\"next\",value:function(e){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:\"run\",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),e}(),A=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n}return i(e,[{key:\"equal\",value:function(e){return null!==e&&(this.low===e.low&&this.high===e.high)}},{key:\"toString\",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t=\"0\"+t,n--;return e+t}}]),e}(),L={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:{DEFAULT:\"wss://wss.im.qcloud.com\",BACKUP:\"wss://wss.tim.qq.com\",STAT:\"https://events.im.qcloud.com\",ANYCAST:\"wss://162.14.13.203\"},OVERSEA:{DEFAULT:\"wss://wss.im.qcloud.com\",BACKUP:\"wss://wss.my-imcloud.com\",STAT:\"https://api.my-imcloud.com\"},SINGAPORE:{DEFAULT:\"wss://wsssgp.im.qcloud.com\",BACKUP:\"wss://wsssgp.my-imcloud.com\",STAT:\"https://apisgp.my-imcloud.com\",ANYCAST:\"wss://162.14.19.159\"},KOREA:{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:{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:{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:{DEFAULT:\"wss://wssjpn.im.qcloud.com\",BACKUP:\"wss://wssjpn.my-imcloud.com\",STAT:\"https://apijpn.my-imcloud.com\"},USA:{DEFAULT:\"wss://wssusa.im.qcloud.com\",BACKUP:\"wss://wssusa.my-imcloud.com\",STAT:\"https://apiusa.my-imcloud.com\",ANYCAST:\"wss://162.14.10.42\"},INDONESIA:{DEFAULT:\"wss://wssidn.im.qcloud.com\",BACKUP:\"wss://wssidn.my-imcloud.com\",STAT:\"https://apiidn.my-imcloud.com\",ANYCAST:\"wss://43.129.34.169\"}}},R={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},O=\"1.7.3\",G=537048168,P=\"CHINA\",U=\"OVERSEA\",b=\"SINGAPORE\",w=\"KOREA\",F=\"GERMANY\",q=\"IND\",x=\"JPN\",V=\"USA\",H=\"INDONESIA\",B={HOST:{CURRENT:{DEFAULT:\"wss://wss.im.qcloud.com\",STAT:\"https://events.im.qcloud.com\"},setCurrent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:P;this.CURRENT=L.PRODUCTION[e]}},NAME:{OPEN_IM:\"openim\",OPEN_IM_MSG_EXT:\"openim_msg_ext_http_svc\",GROUP:\"group_open_http_svc\",GROUP_AVCHATROOM:\"group_open_avchatroom_http_svc\",GROUP_COMMUNITY:\"million_group_open_http_svc\",GROUP_ATTR:\"group_open_attr_http_svc\",FRIEND:\"sns\",PROFILE:\"profile\",RECENT_CONTACT:\"recentcontact\",PIC:\"openpic\",BIG_GROUP_NO_AUTH:\"group_open_http_noauth_svc\",BIG_GROUP_LONG_POLLING:\"group_open_long_polling_http_svc\",BIG_GROUP_LONG_POLLING_NO_AUTH:\"group_open_long_polling_http_noauth_svc\",IM_OPEN_STAT:\"imopenstat\",WEB_IM:\"webim\",IM_COS_SIGN:\"im_cos_sign_svr\",CUSTOM_UPLOAD:\"im_cos_msg\",HEARTBEAT:\"heartbeat\",IM_OPEN_PUSH:\"im_open_push\",IM_OPEN_STATUS:\"im_open_status\",IM_LONG_MESSAGE:\"im_long_msg\",IM_CONFIG_MANAGER:\"im_sdk_config_mgr\",STAT_SERVICE:\"StatSvc\",OVERLOAD_PUSH:\"OverLoadPush\",IM_MSG_AUDIT_MGR:\"im_msg_audit_mgr\",TUIROOM_SVR:\"tui_room_svr\",IM_OPEN_TRANSLATE:\"im_open_translate\",IM_OPEN_SPEECH:\"im_open_speech\",MESSAGE_SEARCH:\"message_search\"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:\"v4\",group_open_http_svc:\"v4\",sns:\"v4\",profile:\"v4\",recentcontact:\"v4\",openpic:\"v4\",group_open_http_noauth_svc:\"v4\",group_open_long_polling_http_svc:\"v4\",group_open_long_polling_http_noauth_svc:\"v4\",imopenstat:\"v4\",im_cos_sign_svr:\"v4\",im_cos_msg:\"v4\",webim:\"v4\",im_open_push:\"v4\",im_open_status:\"v4\"}},K={SEARCH_MSG:new A(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new A(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new A(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new A(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new A(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new A(0,Math.pow(2,6)).toString(),USER_STATUS:new A(0,Math.pow(2,7)).toString(),CONV_MARK:new A(0,Math.pow(2,9)).toString(),CONV_GROUP:new A(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new A(0,Math.pow(2,11)).toString(),MSG_EXT:new A(0,Math.pow(2,13)).toString(),GRP_COUNTER:new A(0,Math.pow(2,15)).toString(),MSG_REACTION:new A(Math.pow(2,16)).toString()},Y=\"c2c_text_message\",W=\"c2c_custom_message\",j=\"group_text_message\",J=\"group_custom_message\",z=\"user_profile\",X=\"sns\",Q=\"group_profile\",Z=\"group_member_profile\";B.HOST.setCurrent(P);var $=\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),ee=$&&\"function\"==typeof wx.createGamePortal,te=\"undefined\"!=typeof qq&&\"function\"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),ne=\"undefined\"!=typeof tt&&\"function\"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),oe=\"undefined\"!=typeof swan&&\"function\"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),ae=\"undefined\"!=typeof my&&\"function\"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),ie=\"undefined\"!=typeof jd&&\"function\"==typeof jd.getSystemInfoSync,se=\"undefined\"!=typeof uni&&\"undefined\"==typeof window&&\"function\"==typeof uni.requireNativePlugin,re=\"undefined\"!=typeof uni,ce=$||te||ne||oe||ae||se||ie,ue=(\"undefined\"!=typeof uni||\"undefined\"!=typeof window)&&!ce,le=te?qq:ne?tt:oe?swan:ae?my:$?wx:se?uni:ie?jd:{},de=ue&&window&&window.navigator&&window.navigator.userAgent||\"\",pe=/(micromessenger|webbrowser)/i.test(de),_e=/AppleWebKit\\/([\\d.]+)/i.exec(de);_e&&parseFloat(_e.pop());var ge,he,fe=(ge=\"WEB\",pe?ge=\"WEB\":te?ge=\"QQ_MP\":ne?ge=\"TT_MP\":oe?ge=\"BAIDU_MP\":ae?ge=\"ALI_MP\":$?ge=\"WX_MP\":se&&(ge=\"UNI_NATIVE_APP\"),R[ge]),ve=/iPad/i.test(de),me=/iPhone/i.test(de)&&!ve,Me=/iPod/i.test(de),Ie=me||ve||Me,ye=(he=de.match(/OS (\\d+)_/i))&&he[1]?he[1]:null,Te=/Android/i.test(de),Ce=function(){var e=de.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+\".\"+e[2]):t||null}(),De=/Edge/i.test(de),Ee=!De&&/Chrome/i.test(de);!function(){var e=de.match(/Chrome\\/(\\d+)/);e&&e[1]&&parseFloat(e[1])}();var Se=/MSIE/.test(de)||de.indexOf(\"Trident\")>-1&&de.indexOf(\"rv:11.0\")>-1,Ne=function(){var e=/MSIE\\s(\\d+)\\.\\d/.exec(de),t=e&&parseFloat(e[1]);return!t&&/Trident\\/7.0/i.test(de)&&/rv:11.0/.test(de)&&(t=11),t}(),ke=/Safari/i.test(de)&&!Ee&&!Te&&!De;!function(){var e=de.match(/TBS\\/(\\d+)/i);if(e&&e[1])e[1]}();var Ae,Le,Re=/Windows/i.test(de),Oe=/MAC OS X/i.test(de),Ge=ue&&\"undefined\"!=typeof Worker&&!Se,Pe=Te||Ie,Ue=ue&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy,be=function(){if(\"undefined\"==typeof window)return!1;var e=window.navigator.standalone;return!(!Ie||e||ke)}();Ae=\"undefined\"!=typeof console?console:\"undefined\"!=typeof global&&global.console?global.console:\"undefined\"!=typeof window&&window.console?window.console:{};for(var we=function(){},Fe=[\"assert\",\"clear\",\"count\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"profile\",\"profileEnd\",\"table\",\"time\",\"timeEnd\",\"timeStamp\",\"trace\",\"warn\"],qe=Fe.length;qe--;)Le=Fe[qe],console[Le]||(Ae[Le]=we);var xe=Ae,Ve=0,He=function(){return(new Date).getTime()+Ve},Be=function(){Ve=0},Ke=function(){return Math.floor(He()/1e3)},Ye=0;function We(){return on()?\"%c Chat %c\":\"Chat\"}function je(){var e,t=((e=new Date).setTime(He()),e);return t.toLocaleTimeString(\"en-US\",{hour12:!1})+\".\"+function(e){var t;switch(e.toString().length){case 1:t=\"00\"+e;break;case 2:t=\"0\"+e;break;default:t=e}return t}(t.getMilliseconds())}var Je={arguments2String:function(e){var t=\"\";if(1===e.length)t=e[0];else for(var n=0,o=e.length;n=0?o[i]=t[i]:o[i]=e(t[i])):o[i]=void 0:o[i]=null;return o};function Ut(e,t){if(!vt(e)||!vt(t))return!1;var n=!1;return t.forEach((function(t){var o=t.key,a=t.value,i=e.find((function(e){return e.key===o}));i?i.value!==a&&(i.value=a,n=!0):(e.push({key:o,value:a}),n=!0)})),n}var bt=function(e){return e===S.GRP_AVCHATROOM},wt=function(e){var t=e.type,n=e.groupID;return t===S.GRP_COMMUNITY||\"\".concat(n).startsWith(ct)&&!\"\".concat(n).includes(ut)},Ft=function(e){return\"\".concat(e).startsWith(ct)&&\"\".concat(e).includes(ut)},qt=function(e){return gt(e)&&e.slice(0,3)===S.CONV_C2C},xt=function(e){return gt(e)&&e.slice(0,5)===S.CONV_GROUP},Vt=function(e){return gt(e)&&e===S.CONV_SYSTEM};function Ht(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function Bt(e){return ce?new Promise((function(t,n){le.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):Se&&9===Ne?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Kt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return\"\".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function Yt(){var e=\"unknown\";if(Oe&&(e=\"mac\"),Re&&(e=\"windows\"),Ie&&(e=\"ios\"),Te&&(e=\"android\"),ce)try{var t=le.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(n){}return e}function Wt(e,t){e=e.split(\".\"),t=t.split(\".\");for(var n=Math.max(e.length,t.length);e.lengthi)return 1;if(a-1?\"\".concat(n,\"&\"):\"\".concat(n,\"?\");u.url=\"\".concat(l,198===s?\"imageView2/3/w/198/h/198\":\"imageView2/3/w/720/h/720\")}return mt(n)?(u.url,_(u,lt)):u}function Jt(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n=0;o--)\"1\"===e[o]&&t.push(Math.pow(2,n-o-1));return t}function on(){return!Se&&!ce}function an(e){return\"the length of userIDList cannot exceed \".concat(e)}function sn(e,t){if(e){var n=e;return t&&(e.startsWith(\"http://\")?n=e.replace(/^http:\\/\\/[^/]+/,t):e.startsWith(\"https://\")&&(n=e.replace(/^https:\\/\\/[^/]+/,t))),n}}function rn(e){if(vt(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),t.toFixed(0)}}function cn(e){if(vt(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),(t/e.length).toFixed(0)}}function un(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],o=Date.now();return t?n?\"\".concat(o-e,\" ms\"):\"\".concat(Math.round((o-e)/1e3),\" s\"):n?o-e:Math.round((o-e)/1e3)}function ln(e){var t=!1;return e&&e>1&&(t=!0),t}var dn=Object.prototype.hasOwnProperty;function pn(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(ft(e)){for(var t in e)if(dn.call(e,t))return!1;return!0}return!(!dt(e)&&(n=e,\"set\"!==Ct(n))&&!pt(e))&&0===e.size;var n}function _n(e,t,n){if(void 0===t)return!0;var o=!0;if(ft(t))Object.keys(t).forEach((function(a){var i=1===e.length?e[0][a]:void 0;o=!!gn(i,t[a],n,a)&&o}));else if(vt(t))for(var a=0;a256)||(Mn({api:t,paramName:n,desc:Ln(n,256)}),!1):(Mn({api:t,paramName:n,desc:In()}),!1)}}},markConversation:{conversationIDList:t({},Bn),markType:{type:\"number\",validator:function(e,t,n){return _t(e)?e<=0?(Mn({api:t,paramName:n,desc:(o=n,a=0,jn(\"NumberGreaterThanLog\",o,a))}),!1):!(e>=Math.pow(2,64))||(Mn({api:t,paramName:n,desc:Rn(n,\"Math.pow(2,64)\")}),!1):(Mn({api:t,paramName:n,desc:Tn()}),!1);var o,a}},enableMark:t({},Yn)},createConversationGroup:{conversationIDList:t({},Bn),groupName:t(t({},Hn),{},{validator:function(e,t,n){return!!e&&(!(e.length>32)||(Mn({api:t,paramName:n,desc:Ln(n,32)}),!1))}})},deleteConversationGroup:[t({name:\"groupName\"},Hn)],renameConversationGroup:{oldName:t({},Hn),newName:t(t({},Hn),{},{validator:function(e,t,n){return!!e&&(!(e.length>32)||(Mn({api:t,paramName:n,desc:Ln(n,32)}),!1))}})},addConversationsToGroup:{conversationIDList:t({},Bn),groupName:t({},Hn)},deleteConversationsFromGroup:{conversationIDList:t({},Bn),groupName:t({},Hn)},getGroupList:{groupProfileFilter:{type:\"Array\"}},getGroupProfile:{groupID:Hn,groupCustomFieldFilter:{type:\"Array\"},memberCustomFieldFilter:{type:\"Array\"}},getGroupProfileAdvance:{groupIDList:Bn},createGroup:{name:Hn},joinGroup:{groupID:Hn,type:{type:\"String\"},applyMessage:{type:\"String\"}},quitGroup:[t({name:\"groupID\"},Hn)],handleApplication:{message:Kn,handleAction:Hn,handleMessage:{type:\"String\"}},changeGroupOwner:{groupID:Hn,newOwnerID:Hn},updateGroupProfile:{groupID:Hn,muteAllMembers:{type:\"Boolean\"}},dismissGroup:[t({name:\"groupID\"},Hn)],searchGroupByID:[t({name:\"groupID\"},Hn)],getGroupOnlineMemberCount:[t({name:\"groupID\"},Hn)],initGroupAttributes:{groupID:Hn,groupAttributes:t(t({},Kn),{},{validator:function(e,t,n){var o=!0;return Object.keys(e).forEach((function(a){if(!gt(e[a]))return Mn({api:t,paramName:n,desc:Gn(\"value\")}),o=!1})),o}})},setGroupAttributes:{groupID:Hn,groupAttributes:t(t({},Kn),{},{validator:function(e,t,n){var o=!0;return Object.keys(e).forEach((function(a){if(!gt(e[a]))return Mn({api:t,paramName:n,desc:Gn(\"value\")}),o=!1})),o}})},deleteGroupAttributes:{groupID:Hn,keyList:{type:\"Array\",validator:function(e,t,n){if(mt(e)||!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;if(!pn(e)){var o=!0;return e.forEach((function(e){if(!gt(e))return Mn({api:t,paramName:n,desc:jn(\"StringArrayRequiredLog\")}),o=!1})),o}return!0}}},getGroupAttributes:{groupID:Hn,keyList:{type:\"Array\",validator:function(e,t,n){if(mt(e)||!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;if(!pn(e)){var o=!0;return e.forEach((function(e){if(!gt(e))return Mn({api:t,paramName:n,desc:Gn(\"key\")}),o=!1})),o}return!0}}},setGroupCounters:{groupID:Hn,counters:Kn},increaseGroupCounter:{groupID:Hn,key:Hn,value:Wn},decreaseGroupCounter:{groupID:Hn,key:Hn,value:Wn},getGroupCounters:{groupID:Hn},getGroupMemberList:{groupID:Hn,count:{type:\"Number\"}},getGroupMemberProfile:{groupID:Hn,userIDList:Bn,memberCustomFieldFilter:{type:\"Array\"}},addGroupMember:{groupID:Hn,userIDList:Bn},setGroupMemberRole:{groupID:Hn,userID:Hn,role:Hn},setGroupMemberMuteTime:{groupID:Hn,userID:Hn,muteTime:{type:\"Number\",validator:function(e){return e>=0}}},setGroupMemberNameCard:{groupID:Hn,userID:{type:\"String\"},nameCard:{type:\"String\",validator:function(e,t,n){return gt(e)?(e.length,!0):(Mn({api:t,paramName:n,desc:In()}),!1)}}},setGroupMemberCustomField:{groupID:Hn,userID:{type:\"String\"},memberCustomField:Bn},deleteGroupMember:{groupID:Hn},markGroupMemberList:{groupID:Hn,markType:{type:\"number\",validator:function(e,t,n){return _t(e)?!(e<1e3)||(Mn({api:t,paramName:n,desc:On(n,1e3)}),!1):(Mn({api:t,paramName:n,desc:Tn()}),!1)}},userIDList:t({},Bn),enableMark:t({},Yn)},createTextMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.text)?0!==e.text.length||(Mn({api:t,paramName:\"payload.text\",desc:Un()}),!1):(Mn({api:t,paramName:\"payload.text\",desc:In()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createTextAtMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.text)?0===e.text.length?(Mn({api:t,paramName:\"payload.text\",desc:Un()}),!1):!(e.atUserList&&!vt(e.atUserList))||(Mn({api:t,paramName:\"payload.atUserList\",desc:Sn()}),!1):(Mn({api:t,paramName:\"payload.text\",desc:In()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createCustomMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?e.data&&!gt(e.data)?(Mn({api:t,paramName:\"payload.data\",desc:In()}),!1):e.description&&!gt(e.description)?(Mn({api:t,paramName:\"payload.description\",desc:In()}),!1):!(e.extension&&!gt(e.extension))||(Mn({api:t,paramName:\"payload.extension\",desc:In()}),!1):(Mn({api:t,paramName:\"payload\",desc:Pn()}),!1)}})},createImageMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(!ft(e))return Mn({api:t,paramName:n,desc:Pn()}),!1;if(mt(e.file))return Mn({api:t,paramName:\"payload.file\",desc:Cn()}),!1;if(ue){if(!(e.file instanceof HTMLInputElement||pt(e.file)))return ft(e.file)&&\"undefined\"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Mn({api:t,paramName:\"payload.file\",desc:bn()}),!1):(Mn({api:t,paramName:\"payload.file\",desc:Dn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Mn({api:t,paramName:\"payload.file\",desc:bn()}),!1}return!0},onProgress:{type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}})},createAudioMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return!!ft(e)||(Mn({api:t,paramName:n,desc:Pn()}),!1)}}),onProgress:{type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}},createVideoMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(!ft(e))return Mn({api:t,paramName:n,desc:Pn()}),!1;if(mt(e.file))return Mn({api:t,paramName:\"payload.file\",desc:Cn()}),!1;if(ue){if(!(e.file instanceof HTMLInputElement||pt(e.file)))return ft(e.file)&&\"undefined\"!=typeof uni?!!pt(e.file.tempFile)||(Mn({api:t,paramName:\"payload.file\",desc:bn()}),!1):(Mn({api:t,paramName:\"payload.file\",desc:Dn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Mn({api:t,paramName:\"payload.file\",desc:bn()}),!1}return!0}}),onProgress:{type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}},createFaceMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?_t(e.index)?!!gt(e.data)||(Mn({api:t,paramName:\"payload.data\",desc:In()}),!1):(Mn({api:t,paramName:\"payload.index\",desc:Tn()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createFileMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(!ft(e))return Mn({api:t,paramName:n,desc:Pn()}),!1;if(mt(e.file))return Mn({api:t,paramName:\"payload.file\",desc:Cn()}),!1;if(ue){if(!(e.file instanceof HTMLInputElement||pt(e.file)))return ft(e.file)&&\"undefined\"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(Mn({api:t,paramName:\"payload.file\",desc:bn()}),!1):(Mn({api:t,paramName:\"payload.file\",desc:Dn()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return Mn({api:t,paramName:\"payload.file\",desc:bn()}),!1}return!0}}),onProgress:{type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:kn()}),!0}}},createLocationMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.description)?_t(e.longitude)?!!_t(e.latitude)||(Mn({api:t,paramName:\"payload.latitude\",desc:Tn()}),!1):(Mn({api:t,paramName:\"payload.longitude\",desc:Tn()}),!1):(Mn({api:t,paramName:\"payload.description\",desc:In()}),!1):(Mn({api:t,paramName:n,desc:Pn()}),!1)}})},createMergerMessage:{to:Hn,conversationType:Hn,payload:t(t({},Kn),{},{validator:function(e,t,n){if(pn(e.messageList))return Mn({api:t,paramName:\"payload.messageList\",desc:Nn()}),!1;if(pn(e.compatibleText))return Mn({api:t,paramName:\"payload.compatibleText\",desc:yn(\"compatibleText\")}),!1;var o=!1;return e.messageList.forEach((function(e){e.status===fn.FAIL&&(o=!0)})),!o||(Mn({api:t,paramName:\"payload.messageList\",desc:jn(\"MergeFailedMessageLog\")}),!1)}})},revokeMessage:[t(t({name:\"message\"},Kn),{},{validator:function(e,t,n){return pn(e)?(Mn({api:t,paramName:n,desc:wn()}),!1):e.conversationType===S.CONV_SYSTEM?(Mn({api:t,paramName:n,desc:jn(\"MessageCanBeRevokedDesc\")}),!1):!0!==e.isRevoked||(Mn({api:t,paramName:n,desc:jn(\"MessageRevokedLog\")}),!1)}})],deleteMessage:[t(t({name:\"messageList\"},Bn),{},{validator:function(e,t,n){return!pn(e)||(Mn({api:t,paramName:n,desc:Nn()}),!1)}})],translateText:{sourceTextList:Bn,sourceLanguage:Hn,targetLanguage:Hn},convertVoiceToText:{message:t(t({},Kn),{},{validator:function(e,t,n){return pn(e)?(Mn({api:t,paramName:n,desc:wn()}),!1):e.type===S.MSG_AUDIO&&e.status===fn.SUCCESS||(Mn({api:t,paramName:n,desc:jn(\"AudioMessageRequiredLog\")}),!1)}})},modifyMessage:[t(t({name:\"message\"},Kn),{},{validator:function(e,t,n){return pn(e)?(Mn({api:t,paramName:n,desc:wn()}),!1):e.conversationType===S.CONV_SYSTEM?(Mn({api:t,paramName:n,desc:jn(\"MessageCanBeModifiedLog\")}),!1):!0!==e._onlineOnlyFlag||(Mn({api:t,paramName:n,desc:jn(\"OnlineMessageNotSupportLog\")}),!1)}})],searchCloudMessages:{keywordList:{type:\"Array\",required:!1,validator:function(e,t,n){return!e||(vt(e)?0===e.length?(Mn({api:t,paramName:n,desc:Nn()}),!1):!(e.length>5)||(Mn({api:t,paramName:n,desc:Vn(n,5)}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1))}},keywordListMatchType:{type:\"String\",required:!1,validator:function(e,t,n){return!e||(\"or\"===e||\"and\"===e||Mn({api:t,paramName:n,desc:\"\".concat(e,\" is invalid match type\")}))}},senderUserIDList:{type:\"Array\",required:!1,validator:function(e,t,n){return!e||(vt(e)?(0===e.length&&Mn({api:t,paramName:n,desc:Nn()}),!(e.length>5)||(Mn({api:t,paramName:n,desc:Vn(n,5)}),!1)):(Mn({api:t,paramName:n,desc:Sn()}),!1))}},messageTypeList:{type:\"Array\",required:!1,validator:function(e,t,n){if(!e)return!0;if(!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;0===e.length&&Mn({api:t,paramName:n,desc:Nn()});var o,a=[S.MSG_TEXT,S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_FILE,S.MSG_VIDEO,S.MSG_LOCATION,S.MSG_CUSTOM,S.MSG_MERGER];return!(e.filter((function(e){return-1===a.indexOf(e)})).length>0)||(Mn({api:t,paramName:n,desc:(o=n,jn(\"ContainsUnsupportedMessageTypeLog\",o))}),!1)}},conversationID:{type:\"String\",required:!1,validator:function(e){return!e||mn(e)}},timePosition:{type:\"number\",required:!1,validator:function(e,t,n){return!e||(!(e<0)||(Mn({api:t,paramName:n,desc:On(n,0)}),!1))}},timePeriod:{type:\"number\",required:!1,validator:function(e,t,n){return!e||(!(e<0)||(Mn({api:t,paramName:n,desc:On(n,0)}),!1))}},cursor:{type:\"String\",required:!1}},getUserProfile:{userIDList:{type:\"Array\",validator:function(e,t,n){return vt(e)?(0===e.length&&Mn({api:t,paramName:n,desc:Nn()}),!0):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}},updateMyProfile:{profileCustomField:{type:\"Array\",validator:function(e,t,n){return!!mt(e)||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},setSelfStatus:{customStatus:{type:\"String\",validator:function(e,t,n){return!!gt(e)||(Mn({api:t,paramName:n,desc:In()}),!1)}}},getUserStatus:{userIDList:{type:\"Array\",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}},subscribeUserStatus:{userIDList:{type:\"Array\",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:\"Array\",validator:function(e,t,n){return!e||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},addFriend:{to:Hn,source:{type:\"String\",required:!0,validator:function(e,t,n){return!!e&&(e.startsWith(\"AddSource_Type_\")?!(e.replace(\"AddSource_Type_\",\"\").length>8)||(Mn({api:t,paramName:n,desc:Ln(\"keyword\",8)}),!1):(Mn({api:t,paramName:n,desc:jn(\"SourcePrefixLog\")}),!1))}},remark:{type:\"String\",required:!1,validator:function(e,t,n){return!(gt(e)&&e.length>96)||(Mn({api:t,paramName:n,desc:Ln(n,96)}),!1)}}},deleteFriend:{userIDList:Bn},checkFriend:{userIDList:Bn},getFriendProfile:{userIDList:Bn},updateFriend:{userID:Hn,remark:{type:\"String\",required:!1,validator:function(e,t,n){return!(gt(e)&&e.length>96)||(Mn({api:t,paramName:n,desc:Ln(n,96)}),!1)}},friendCustomField:{type:\"Array\",required:!1,validator:function(e,t,n){if(e){if(!vt(e))return Mn({api:t,paramName:n,desc:Sn()}),!1;var o=!0;return e.forEach((function(e){return gt(e.key)&&-1!==e.key.indexOf(\"Tag_SNS_Custom\")?gt(e.value)?e.key.replace(\"Tag_SNS_Custom_\",\"\").length>8?(Mn({api:t,paramName:n,desc:Ln(\"keyword\",8)}),o=!1):void 0:(Mn({api:t,paramName:n,desc:Gn(\"value\")}),o=!1):(Mn({api:t,paramName:n,desc:jn(\"FriendCustomFieldPrefixLog\")}),o=!1)})),o}return!0}}},acceptFriendApplication:{userID:Hn},refuseFriendApplication:{userID:Hn},deleteFriendApplication:{userID:Hn},createFriendGroup:{name:Hn},deleteFriendGroup:{name:Hn},addToFriendGroup:{name:Hn,userIDList:Bn},removeFromFriendGroup:{name:Hn,userIDList:Bn},renameFriendGroup:{oldName:Hn,newName:Hn},sendMessageReadReceipt:[{name:\"messageList\",type:\"Array\",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}],getMessageReadReceiptList:[{name:\"messageList\",type:\"Array\",validator:function(e,t,n){return vt(e)?0!==e.length||(Mn({api:t,paramName:n,desc:Nn()}),!1):(Mn({api:t,paramName:n,desc:Sn()}),!1)}}],createTopicInCommunity:{groupID:Hn,topicName:Hn},deleteTopicFromCommunity:{groupID:Hn,topicIDList:{type:\"Array\",validator:function(e,t,n){return!e||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},updateTopicProfile:{groupID:Hn,topicID:Hn},getTopicList:{groupID:Hn,topicIDList:{type:\"Array\",validator:function(e,t,n){return!e||(!!vt(e)||(Mn({api:t,paramName:n,desc:Sn()}),!1))}}},addSignalingListener:[{name:\"eventName\",type:\"String\",validator:function(e,t,n){return\"string\"==typeof e&&0!==e.length||(Mn({api:t,paramName:n,desc:yn(n)}),!1)}},{name:\"handler\",type:\"Function\",validator:function(e,t,n){return\"function\"!=typeof e?(Mn({api:t,paramName:n,desc:En()}),!1):(\"\"===e.name&&Mn({api:t,paramName:n,desc:Fn()}),!0)}}],removeSignalingListener:[{name:\"eventName\",type:\"String\",validator:function(e,t,n){return\"string\"==typeof e&&0!==e.length||(Mn({api:t,paramName:n,desc:yn(n)}),!1)}},{name:\"handler\",type:\"Function\",validator:function(e,t,n){return\"function\"!=typeof e?(Mn({api:t,paramName:n,desc:En()}),!1):(\"\"===e.name&&Mn({api:t,paramName:n,desc:Fn()}),!0)}}],invite:{userID:Hn},inviteSync:[t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?!!gt(e.userID)||(Mn({api:t,paramName:\"options.userID\",desc:In()}),!1):(Mn({api:t,paramName:\"options\",desc:Pn()}),!1)}}),{name:\"successCb\",type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}},{name:\"errorCb\",type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}}],inviteInGroup:{groupID:Hn,inviteeList:Bn},inviteInGroupSync:[t(t({},Kn),{},{validator:function(e,t,n){return ft(e)?gt(e.groupID)?!!vt(e.inviteeList)||(Mn({api:t,paramName:\"options.inviteeList\",desc:Sn()}),!1):(Mn({api:t,paramName:\"options.groupID\",desc:In()}),!1):(Mn({api:t,paramName:\"options\",desc:Pn()}),!1)}}),{name:\"successCb\",type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}},{name:\"errorCb\",type:\"Function\",required:!1,validator:function(e,t,n){return mt(e)&&Mn({api:t,paramName:n,desc:En()}),!0}}],accept:{inviteID:Hn},reject:{inviteID:Hn},getSignalingInfo:[t(t({name:\"message\"},Kn),{},{validator:function(e,t,n){return!pn(e)||(Mn({api:t,paramName:n,desc:wn()}),!1)}})],modifyInvitation:{inviteID:Hn,data:Hn}},zn={login:1,logout:1,getLoginUser: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,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1,addSignalingListener:1,removeSignalingListener:1,invite:1,inviteSync:1,inviteInGroup:1,inviteInGroupSync:1,cancel:1,accept:1,reject:1,getSignalingInfo:1,modifyInvitation:1},Xn=1,Qn=2,Zn=3,$n=4,eo=6,to=7,no=8,oo=10,ao=11,io=12,so=13,ro=14,co=15,uo=17,lo=18,po=19,_o=20,go=21,ho=23,fo=24,vo=25,mo=26,Mo=27,Io=28,yo=29,To=30,Co=31,Do=32,Eo=33,So=34,No=function(e){return{code:0,data:e||{}}},ko=function(e){r(n,e);var t=f(n);function n(e){var a;o(this,n),a=t.call(this);var i=e.code,s=e.message,r=e.data;return a.code=i,a.message=s||a._getErrorMessage(a.code),a.data=r||{},a}return i(n)}(p(Error)),Ao={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_AVCHATROOM:2101,MSG_INSTANCE_REQUIRED:2105,MSG_INVALID_CONV_TYPE:2106,MSG_F_IS_EMPTY:2108,MSG_ONPROGRESS_FUNCTION_ERROR: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_AVCHATROOM:2481,CONV_NOT_FOUND:2500,USER_OR_GRP_NOT_FOUND:2501,CONV_UN_RECORDED_TYPE:2502,INVALID_CONV_ID:2503,ILLEGAL_GRP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GRP_ID:2602,CANNOT_FIND_GRP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_WORK:2622,MEMBER_NOT_IN_GRP:2623,JOIN_GRP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,OPERATION_NOT_SUPPORTED_IN_AVCHATROOM: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,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_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,CANNOT_USE_COMMERCIAL_ABILITY: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},Lo=null,Ro=function(e){Lo=e},Oo=function(e){return Promise.resolve(No(e))},Go=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e instanceof ko)return t&&null!==Lo&&Lo.emit(E.ERROR,e),Promise.reject(e);if(e instanceof Error){var n=new ko({code:Ao.UNCAUGHT_ERROR});return t&&null!==Lo&&Lo.emit(E.ERROR,n),Promise.reject(n)}if(mt(e)||mt(e.code))return Promise.reject(new ko({code:Ao.UNCAUGHT_ERROR}));var o=new ko(e);return t&&null!==Lo&&Lo.emit(E.ERROR,o),Promise.reject(o)},Po=function(){function e(t){o(this,e),this._m=t,this._n=\"\"}return i(e,[{key:\"isLoggedIn\",value:function(){return this._m.getModule(io).isLoggedIn()}},{key:\"isOversea\",value:function(){return this._m.getModule(io).isOversea()}},{key:\"isPrivateNetWork\",value:function(){return this._m.getModule(io).isPrivateNetWork()}},{key:\"getFileDownloadProxy\",value:function(){return this._m.getModule(io).getFileDownloadProxy()}},{key:\"getMyUserID\",value:function(){return this._m.getModule(io).getUserID()}},{key:\"getMyTinyID\",value:function(){return this._m.getModule(io).getTinyID()}},{key:\"getSDKAppID\",value:function(){return this._m.getModule(io).getSDKAppID()}},{key:\"isIntl\",value:function(){return this._m.getModule(io).isIntl()}},{key:\"isUsingChatCore\",value:function(){return this._m.getModule(io).isUsingChatCore()}},{key:\"isDevMode\",value:function(){return this._m.getModule(io).isDevMode()}},{key:\"getModule\",value:function(e){return this._m.getModule(e)}},{key:\"getPlatform\",value:function(){return fe}},{key:\"getNetworkType\",value:function(){return this._m.getModule(co).getNetworkType()}},{key:\"probeNetwork\",value:function(e){return this._m.getModule(co).probe(e)}},{key:\"getCloudConfig\",value:function(e){return this._m.getModule(ho).getCloudConfig(e)}},{key:\"emitOuterEvent\",value:function(e,t){this._m.getOuterEmitterInstance().emit(e,t)}},{key:\"emitInnerEvent\",value:function(e,t){this._m.getInnerEmitterInstance().emit(e,t)}},{key:\"getInnerEmitterInstance\",value:function(){return this._m.getInnerEmitterInstance()}},{key:\"generateTjgID\",value:function(e){return this._m.getModule(io).getTinyID()+\"-\"+e.random}},{key:\"filterModifiedMessage\",value:function(e){if(!pn(e)){var t=e.filter((function(e){return!0===e.isModified}));t.length>0&&this.emitOuterEvent(E.MESSAGE_MODIFIED,t)}}},{key:\"filterUnmodifiedMessage\",value:function(e){return pn(e)?[]:e.filter((function(e){return!1===e.isModified}))}},{key:\"request\",value:function(e){return this._m.getModule(_o).request(e)}},{key:\"canIUse\",value:function(e){return this._m.getModule(Mo).canIUse(e)}},{key:\"getErrorMessage\",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:\"outputWarning\",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&Je.w(o)}},{key:\"cannotUseCommercialAbility\",value:function(e){var t=Ao.CANNOT_USE_COMMERCIAL_ABILITY;return Go({code:t,message:this.getErrorMessage(t,e)})}}]),e}(),Uo={LOGIN:\"wslogin\",LOGOUT:\"wslogout\",HELLO:\"wshello\",KICK_OTHER:\"KickOther\",SYNC_UNREAD_MESSAGE:\"getmsg\",SEND_C2C_MESSAGE:\"sendmsg\",SEND_GROUP_MESSAGE:\"send_group_msg\",GET_USER_PROFILE:\"portrait_get_all\",UPDATE_MY_PROFILE:\"portrait_set\",GET_BLACKLIST:\"black_list_get\",ADD_TO_BLACKLIST:\"black_list_add\",REMOVE_FROM_BLACKLIST:\"black_list_delete\",GET_FRIEND_LIST:\"friend_get\",GET_FRIEND_PROFILE:\"friend_get_specified\",CHECK_FRIEND:\"friend_check\",DELETE_FRIEND:\"friend_delete\",ADD_FRIEND:\"friend_add\",UPDATE_FRIEND:\"friend_update\",RESPOND_FRIEND_APPLICATION:\"friend_response\",GET_FRIEND_APPLICATION_LIST:\"pendency_get\",DELETE_FRIEND_APPLICATION:\"pendency_delete\",REFUSE_FRIEND_APPLICATION:\"pendency_refuse\",REPORT_FRIEND_APPLICATION:\"pendency_report\",GET_FRIEND_GROUP_LIST:\"group_get\",CREATE_FRIEND_GROUP:\"group_add\",DELETE_FRIEND_GROUP:\"group_delete\",UPDATE_FRIEND_GROUP:\"group_update\",REVOKE_C2C_MESSAGE:\"msgwithdraw\",SET_C2C_MESSAGE_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_MESSAGE:\"getroammsg\",GET_C2C_PEER_READ_TIME:\"get_peer_read_time\",DELETE_C2C_MESSAGE:\"delete_c2c_msg_ramble\",MODIFY_C2C_MESSAGE:\"modify_c2c_msg\",MODIFY_C2C_MESSAGE_EXTENSIONS:\"set_key_values\",GET_C2C_MESSAGE_EXTENSIONS:\"get_key_values\",ADD_C2C_MSG_REACTION:\"reaction_add\",REMOVE_C2C_MSG_REACTION:\"reaction_del\",GET_C2C_MSG_REACTIONS:\"reaction_multi_stat\",GET_C2C_MSG_REACTION_USER_LIST:\"reaction_iterate\",PAGING_GET_CONVERSATION_LIST:\"page_get\",DELETE_CONVERSATION:\"batch_delete\",CLEAR_HISTORY_MESSAGE:\"clear_msg\",PIN_CONVERSATION:\"top\",DELETE_GROUP_AT_TIPS:\"deletemsg\",SET_CONVERSATION_CUSTOM_DATA:\"set_conv_custom_data\",MARK_CONVERSATION:\"mark_contact\",CREATE_CONVERSATION_GROUP:\"create_contact_group\",DELETE_CONVERSATION_GROUP:\"del_contact_group\",RENAME_CONVERSATION_GROUP:\"update_contact_group\",ADD_CONVERSATIONS_TO_GROUP:\"add_conv_to_group\",DELETE_CONVERSATIONS_FROM_GROUP:\"del_conv_from_group\",GET_CONVERSATION_GROUP_LIST:\"get_contact_group\",GET_GROUP_LIST:\"get_joined_group_list\",GET_GROUP_PROFILE:\"get_group_self_member_info\",CREATE_GROUP:\"create_group\",DISMISS_GROUP:\"destroy_group\",UPDATE_GROUP_PROFILE:\"modify_group_base_info\",APPLY_JOIN_GROUP:\"apply_join_group\",APPLY_JOIN_GROUP_NOAUTH:\"apply_join_group_noauth\",QUIT_GROUP:\"quit_group\",SEARCH_GROUP:\"get_group_public_info\",CHANGE_GROUP_OWNER:\"change_group_owner\",HANDLE_GROUP_APPLICATION:\"handle_apply_join_group\",HANDLE_INVITE_JOIN_GROUP:\"handle_invite_join_permission_group\",HANDLE_GROUP_INVITATION:\"handle_invite_join_group\",REVOKE_GROUP_MESSAGE:\"group_msg_recall\",SET_GROUP_MESSAGE_READ:\"msg_read_report\",SET_ALL_MESSAGE_READ:\"read_all_unread_msg\",GET_GROUP_ROAMING_MESSAGE:\"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_GROUP_PENDENCY:\"get_pendency\",DELETE_GROUP_SYSTEM_NOTICE:\"deletemsg\",AVCHATROOM_POLLING:\"get_msg\",AVCHATROOM_NOAUTH_POLLING:\"get_msg_noauth\",GET_ONLINE_MEMBER_NUM:\"get_online_member_num\",DELETE_GROUP_MESSAGE:\"delete_group_ramble_msg_by_seq\",MODIFY_GROUP_MESSAGE:\"modify_group_msg\",SET_GROUP_ATTRIBUTES:\"set_group_attr\",MODIFY_GROUP_ATTRIBUTES:\"modify_group_attr\",DELETE_GROUP_ATTRIBUTES:\"delete_group_attr\",CLEAR_GROUP_ATTRIBUTES:\"clear_group_attr\",GET_GROUP_ATTRIBUTES:\"get_group_attr\",MODIFY_GROUP_MESSAGE_EXTENSIONS:\"group_set_key_values\",GET_GROUP_MESSAGE_EXTENSIONS:\"group_get_key_values\",GET_GROUP_NOTIFY:\"batch_get_group_notify\",UPDATE_GROUP_COUNTER:\"update_group_counter\",GET_GROUP_COUNTER:\"get_group_counter\",ADD_GRP_MSG_REACTION:\"group_reaction_add\",REMOVE_GRP_MSG_REACTION:\"group_reaction_del\",GET_GRP_MSG_REACTIONS:\"group_reaction_multi_stat\",GET_GRP_MSG_REACTION_USER_LIST:\"group_reaction_iterate\",GET_GROUP_MEMBER_LIST:\"get_group_member_info\",GET_AVCHATROOM_MEMBER_LIST:\"get_members\",GET_GROUP_MEMBER_PROFILE:\"get_specified_group_member_info\",ADD_GROUP_MEMBER:\"add_group_member\",DELETE_GROUP_MEMBER:\"delete_group_member\",BAN_AVCHATROOM_MEMBER:\"ban_group_member\",MODIFY_GROUP_MEMBER_INFO:\"modify_group_member_info\",MARK_AVCHATROOM_MEMBER_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\",MESSAGE_PUSH:\"msg_push\",MESSAGE_CLOUD_SEARCH:\"query\",MULTI_MESSAGE_PUSH:\"multi_msg_push_ws\",MESSAGE_PUSH_ACK:\"ws_msg_push_ack\",STATUS_FORCE_OFFLINE:\"stat_forceoffline\",UPLOAD_MERGER_MESSAGE:\"save_relay_json_msg\",DOWNLOAD_MERGER_MESSAGE:\"get_relay_json_msg\",FETCH_CLOUD_CONTROL_CONFIG:\"fetch_config\",PUSHED_CLOUD_CONTROL_CONFIG:\"push_configv2\",FETCH_COMMERCIAL_CONFIG:\"fetch_imsdk_purchase_bitsv2\",PUSHED_COMMERCIAL_CONFIG:\"push_imsdk_purchase_bitsv2\",OVERLOAD_NOTIFY:\"notify2\",CREATE_TOPIC:\"create_topic\",DELETE_TOPIC:\"destroy_topic\",UPDATE_TOPIC_PROFILE:\"modify_topic\",GET_TOPIC_LIST:\"get_topic\",SET_SELF_STATUS:\"ws_set_custom_status\",GET_USER_STATUS:\"ws_get_user_status\",SUBSCRIBE_USER_STATUS:\"ws_status_subscribe\",UNSUBSCRIBE_USER_STATUS:\"ws_status_unsubscribe\",STAT_BACKGROUND:\"ws_stat_background\",STAT_FOREGROUND:\"ws_stat_foreground\",SET_TOKEN:\"ws_stat_settoken\",GET_PROFANITY_LIST:\"get_local_words\",TRANSLATE_TEXT:\"ws_batch_trans_text\",VOICE_TO_TEXT:\"ws_sentence_recognition\"},bo=\"networkRTT\",wo=\"messageE2EDelay\",Fo=\"sendMessageC2C\",qo=\"sendMessageGroup\",xo=\"sendMessageGroupAV\",Vo=\"sendMessageRichMedia\",Ho=\"cosUpload\",Bo=\"messageReceivedGroup\",Ko=\"messageReceivedGroupAVPush\",Yo=\"messageReceivedGroupAVPull\",Wo=(s(hn={},bo,2),s(hn,wo,3),s(hn,Fo,4),s(hn,qo,5),s(hn,xo,6),s(hn,Vo,7),s(hn,Bo,8),s(hn,Ko,9),s(hn,Yo,10),s(hn,Ho,11),hn),jo={info:4,warning:5,error:6},Jo={wifi:1,\"2g\":2,\"3g\":3,\"4g\":4,\"5g\":5,unknown:6,none:7,online:8},zo={login:4},Xo=function(){function e(t){o(this,e),this._n=\"SSOLogData\",this.eventType=zo[t]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message=\"\",this.moreMessage=\"\",this.extension=t,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=He()}return i(e,[{key:\"updateTimeStamp\",value:function(){this.timestamp=He()}},{key:\"start\",value:function(e){return this._startts=e,this}},{key:\"end\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var n=He();0===this.costTime&&(this.costTime=n-this._startts),this.setMoreMessage(\"startts:\".concat(this._startts,\" endts:\").concat(n)),t?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){e._sentFlag=!0,e._eventStatModule&&e._eventStatModule.pushIn(e)}),0)}}},{key:\"setError\",value:function(e,t,n){if(!(e instanceof Error))return Je.w(\"\".concat(this._n,\".setError value not instanceof Error, please check!\")),this;if(this._sentFlag)return this;if(this.setNetworkType(n),t)e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message);else{var o=Ao.NO_NETWORK;this.setCode(o)}return this.setLevel(\"error\"),this}},{key:\"setCode\",value:function(e){return mt(e)||this._sentFlag||(\"ECONNABORTED\"===e&&(this.code=103),_t(e)?this.code=e:Je.w(\"\".concat(this._n,\".setCode value not a number, please check!\"),e,n(e))),this}},{key:\"setMessage\",value:function(e){return mt(e)||this._sentFlag||(_t(e)&&(this.message=e.toString()),gt(e)&&(this.message=e)),this}},{key:\"setCostTime\",value:function(e){return this.costTime=e,this}},{key:\"setLevel\",value:function(e){return mt(e)||this._sentFlag||(this.level=jo[e]),this}},{key:\"setMoreMessage\",value:function(e){return pn(this.moreMessage)?this.moreMessage=\"\".concat(e):this.moreMessage+=\" \".concat(e),this}},{key:\"setNetworkType\",value:function(e){if(mt(e))Je.w(\"\".concat(this._n,\".setNetworkType value is undefined, please check!\"));else{var t=Jo[e.toLowerCase()];mt(t)||(this.networkType=t)}return this}},{key:\"getStartTs\",value:function(){return this._startts}},{key:\"setUIPlatform\",value:function(e){this.uiPlatform=e}},{key:\"setExtension\",value:function(e){return this.extension=e,this}},{key:\"setEventType\",value:function(e){return this.eventType=e,this}}],[{key:\"bindEventStatModule\",value:function(t){e.prototype._eventStatModule=t}}]),e}(),Qo=function(){function e(t){o(this,e),this.type=S.MSG_TEXT,this.content={text:t.text||\"\"}}return i(e,[{key:\"setText\",value:function(e){this.content.text=e}},{key:\"sendable\",value:function(){return 0!==this.content.text.length}}]),e}(),Zo=function(){function e(t,n){o(this,e),this._imageMemoryURL=\"\",this._fileDownloadProxy=n,ce?this.createImageDataASURLInWXMiniApp(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=S.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||ze.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._autoFixUrl()}return i(e,[{key:\"_initImageInfoModel\",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=kt(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.imageUrl||t.url||\"\",this.url=sn(t.url||e._imageMemoryURL,e._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(e){e&&(this.imageUrl=e)},getImageUrl:function(){return this.imageUrl}}}},{key:\"initImageInfoArray\",value:function(e){for(var t=0,n=null,o=null;t<=2;)o=mt(e)||mt(e[t])?{type:0,size:0,width:0,height:0,url:\"\"}:e[t],(n=new this._ImageInfoModel(o)).setSizeType(t+1),n.setType(t),this.addImageInfo(n),t++;this.updateAccessSideImageInfoArray()}},{key:\"updateImageInfoArray\",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o1&&(this._percent=1)}},{key:\"updateImageFormat\",value:function(e){this.content.imageFormat=ze[e.toUpperCase()]||ze.UNKNOWN}},{key:\"createImageDataASURLInWeb\",value:function(e){void 0!==e&&e.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:\"createImageDataASURLInWXMiniApp\",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:\"replaceImageInfo\",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:\"addImageInfo\",value:function(e){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(e)}},{key:\"updateAccessSideImageInfoArray\",value:function(){var e=this.content.imageInfoArray,t=e[0],n=t.width,o=void 0===n?0:n,a=t.height,i=void 0===a?0:a;0!==o&&0!==i&&(Jt(e),Object.assign(e[2],jt({originWidth:o,originHeight:i,min:720})))}},{key:\"sendable\",value:function(){return 0!==this.content.imageInfoArray.length&&(\"\"!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size)}}]),e}(),$o=function(){function e(t){o(this,e),this.type=S.MSG_FACE,this.content=t||null}return i(e,[{key:\"sendable\",value:function(){return null!==this.content}}]),e}(),ea=function(){function e(t,n){o(this,e),this.type=S.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:t.second,size:t.size,url:sn(t.url,n),remoteAudioUrl:t.url||\"\",uuid:t.uuid}}return i(e,[{key:\"updatePercent\",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:\"updateAudioUrl\",value:function(e){this.content.remoteAudioUrl=e}},{key:\"sendable\",value:function(){return\"\"!==this.content.remoteAudioUrl}}]),e}(),ta={from:!0,groupID:!0,groupName:!0,to:!0},na=function(){function e(t){o(this,e),this.type=S.MSG_GRP_TIP,this.content={},this._initContent(t)}return i(e,[{key:\"_initContent\",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case\"remarkInfo\":break;case\"groupProfile\":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case\"operatorInfo\":break;case\"memberInfoList\":case\"msgMemberInfo\":t._updateMemberList(e[n]);break;case\"memberExtraInfo\":case\"onlineMemberInfo\":break;case\"memberNum\":t.content[n]=e[n],t.content.memberCount=e[n];break;case\"newGroupProfile\":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:\"_initGroupProfile\",value:function(e){for(var t=Object.keys(e),n=0;n1&&(this._percent=1)}},{key:\"updateFileUrl\",value:function(e){this.content.fileUrl=e}},{key:\"sendable\",value:function(){return\"\"!==this.content.fileUrl&&(\"\"!==this.content.fileName&&0!==this.content.fileSize)}}]),e}(),sa=function(){function e(t){o(this,e),this.type=S.MSG_CUSTOM,this.content={data:t.data||\"\",description:t.description||\"\",extension:t.extension||\"\"}}return i(e,[{key:\"setData\",value:function(e){return this.content.data=e,this}},{key:\"setDescription\",value:function(e){return this.content.description=e,this}},{key:\"setExtension\",value:function(e){return this.content.extension=e,this}},{key:\"sendable\",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),ra=function(){function e(t,n){o(this,e),this.type=S.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:t.remoteVideoUrl||t.videoUrl||\"\",videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:sn(t.videoUrl,n),videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:sn(t.thumbUrl,n),snapshotUrl:sn(t.thumbUrl,n)}}return i(e,[{key:\"updatePercent\",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:\"updateVideoUrl\",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:\"updateSnapshotInfo\",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth,o=e.snapshotHeight;pn(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),pn(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),pn(o)||(this.content.thumbHeight=this.content.snapshotHeight=Number(o))}},{key:\"sendable\",value:function(){return\"\"!==this.content.remoteVideoUrl}}]),e}(),ca=function(){function e(t){o(this,e),this.type=S.MSG_LOCATION;var n=t.description,a=t.longitude,i=t.latitude;this.content={description:n,longitude:a,latitude:i}}return i(e,[{key:\"sendable\",value:function(){return!0}}]),e}(),ua=function(){function e(t,n){if(o(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||\"\",this.clientTime=t.clientTime||void 0,t.ID)this.ID=t.ID||\"\",this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",t.messageBody?this.messageBody=JSON.parse(JSON.stringify(t.messageBody)):this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType?t.conversationType.startsWith(S.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(S.CONV_GROUP)&&(this.receiverGroupID=t.to):t.receiverGroupID?this.receiverGroupID=t.receiverGroupID:t.receiverUserID&&(this.receiverUserID=t.receiverUserID),this.messageReceiver=t.to||t.messageReceiver;else{this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",this.messageBody=[];var a=t.elements[0].type,i=t.elements[0].content;this._patchRichMediaPayload(a,i),this._updateRichMediaDownloadUrl(a,i,n),a===S.MSG_MERGER?this.messageBody.push({type:a,payload:new la(i).content}):this.messageBody.push({type:a,payload:i}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID=\"\".concat(t.tinyID,\"-\").concat(t.clientTime,\"-\").concat(t.random)}}return i(e,[{key:\"_patchRichMediaPayload\",value:function(e,t){e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(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===S.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===S.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===S.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}},{key:\"_updateRichMediaDownloadUrl\",value:function(e,t,n){n&&(e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){e.url=sn(e.url,n)})):e===S.MSG_VIDEO?(t.videoUrl=sn(t.videoUrl,n),t.snapshotUrl=sn(t.thumbUrl,n),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===S.MSG_AUDIO?t.url=sn(t.url,n):e===S.MSG_FILE&&(t.fileUrl=sn(t.fileUrl,n)))}}]),e}(),la=function(){function e(t,n){if(o(this,e),this.type=S.MSG_MERGER,this.content={downloadKey:\"\",pbDownloadKey:\"\",messageList:[],title:\"\",abstractList:[],compatibleText:\"\",version:0,layersOverLimit:!1},t.downloadKey){var a=t.downloadKey,i=t.pbDownloadKey,s=t.title,r=t.abstractList,c=t.compatibleText,u=t.version;this.content.downloadKey=a,this.content.pbDownloadKey=i,this.content.title=s,this.content.abstractList=r,this.content.compatibleText=c,this.content.version=u||0}else if(pn(t.messageList))1===t.layersOverLimit&&(this.content.layersOverLimit=!0);else{var l=t.messageList,d=t.title,p=t.abstractList,_=t.compatibleText,g=t.version,h=[];l.forEach((function(e){if(!pn(e)){var t=new ua(e,n);h.push(t)}})),this.content.messageList=h,this.content.title=d,this.content.abstractList=p,this.content.compatibleText=_,this.content.version=g||0}}return i(e,[{key:\"sendable\",value:function(){return!pn(this.content.messageList)||!pn(this.content.downloadKey)}}]),e}(),da={1:S.MSG_PRIORITY_HIGH,2:S.MSG_PRIORITY_NORMAL,3:S.MSG_PRIORITY_LOW,4:S.MSG_PRIORITY_LOWEST},pa=function(){function e(t){o(this,e),this.ID=\"\",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||S.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:kt(),this.priority=this._computePriority(t.priority),this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",this.isPeerRead=!1,this.nameCard=\"\",this.hasRiskContent=ln(t.checkResult),this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow=\"\",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||\"JSON\",this.isResend=!1,this.isRead=!1,this.status=t.status||fn.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||\"\",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||Ke()||0,this.senderTinyID=t.senderTinyID||t.tinyID||\"\",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this._receiverList=t.receiverList||void 0,this.isSupportExtension=!0===t.isSupportExtension||1===t.isSupportExtension,this.revoker=t.revokerInfo&&t.revokerInfo.revoker||\"\",this.revokerInfo=t.revokerInfo||{userID:\"\",nick:\"\",avatar:\"\"},this.revokeReason=t.revokeReason||\"\",this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t),this.initC2CReadReceiptInfo(t.readReceiptSentByPeer)}return i(e,[{key:\"elements\",get:function(){return this._elements}},{key:\"getElements\",value:function(){return this._elements}},{key:\"extractGroupInfo\",value:function(e){if(null!==e){gt(e.nick)&&(this.nick=e.nick),gt(e.avatar)&&(this.avatar=e.avatar);var t=e.messageFromAccountExtraInformation;ft(t)&>(t.nameCard)&&(this.nameCard=t.nameCard)}}},{key:\"handleGroupAtInfo\",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==S.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(S.MSG_AT_ALL))})),vt(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(S.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(e){e&&(this.status=this.from?fn.SUCCESS:fn.UNSEND,!this.from&&(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:\"isSendable\",value:function(){return 0!==this._elements.length&&(!0===this._relayFlag||\"function\"==typeof this._elements[0].sendable&&this._elements[0].sendable())}},{key:\"_initTo\",value:function(e){this.conversationType===S.CONV_GROUP&&(this.to=e.groupID)}},{key:\"_initSequence\",value:function(e){0===this.clientSequence&&e&&(this.clientSequence=function(e){if(!e)return!1;if(void 0===Ot[e]){var t=new Date,n=\"3\".concat(t.getHours()).slice(-2),o=\"0\".concat(t.getMinutes()).slice(-2),a=\"0\".concat(t.getSeconds()).slice(-2);Ot[e]=parseInt([n,o,a,\"0001\"].join(\"\")),n=null,o=null,a=null,Je.l(\"autoIncrementIndex start index:\".concat(Ot[e]))}return Ot[e]++}(e)),0===this.sequence&&this.conversationType===S.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:\"generateMessageID\",value:function(){this.from===S.CONV_SYSTEM&&(this.senderTinyID=\"144115198244471703\"),this.ID=\"\".concat(this.senderTinyID,\"-\").concat(this.clientTime,\"-\").concat(this.random)}},{key:\"_initFlow\",value:function(e){\"\"!==e&&(e===this.from?(this.flow=\"out\",this.isRead=!0):this.flow=\"in\")}},{key:\"_concatConversationID\",value:function(e){var t=this.to,n=\"\",o=this.conversationType;o!==S.CONV_SYSTEM?(n=o===S.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID=n?\"\".concat(o).concat(n):null):this.conversationID=S.CONV_SYSTEM}},{key:\"isElement\",value:function(e){return e instanceof Qo||e instanceof Zo||e instanceof $o||e instanceof ea||e instanceof ia||e instanceof ra||e instanceof na||e instanceof aa||e instanceof sa||e instanceof ca||e instanceof la}},{key:\"setElement\",value:function(e,t){var n=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();var o=function(e){if(e.type&&e.content)switch(e.type){case S.MSG_TEXT:n.setTextElement(e.content);break;case S.MSG_IMAGE:n.setImageElement(e.content,t);break;case S.MSG_AUDIO:n.setAudioElement(e.content,t);break;case S.MSG_FILE:n.setFileElement(e.content,t);break;case S.MSG_VIDEO:n.setVideoElement(e.content,t);break;case S.MSG_CUSTOM:n.setCustomElement(e.content);break;case S.MSG_LOCATION:n.setLocationElement(e.content);break;case S.MSG_GRP_TIP:n.setGroupTipElement(e.content);break;case S.MSG_GRP_SYS_NOTICE:n.setGroupSystemNoticeElement(e.content);break;case S.MSG_FACE:n.setFaceElement(e.content);break;case S.MSG_MERGER:n.setMergerElement(e.content,t)}};if(vt(e))for(var a=0;a0&&this.emitOuterEvent(E.MESSAGE_RECEIVED,l),c.length=0}},{key:\"_newC2CMessageStoredAndSummary\",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,a=e.isInstantMessage,i=null,s=[],r=[],c={},u=this.getModule(mo),l=!1,d=this.getModule(ao),p=this.getModule($n),_=this.getFileDownloadProxy(),g=0,h=t.length;g0&&u.addMessageDelay(i.clientTime)}else this._messageFromUnreadDBMap.set(i.ID,1);if(0!==f.msgLifeTime){if(!1===i._onlineOnlyFlag){var N=d.getLastMessageTime(v);if(_t(N)&&i.time0){L=!0;var n=s.find((function(t){return t.conversationID===\"C2C\".concat(o[e].from)}));n?n.unreadCount=o[e].unreadCount:s.push({conversationID:\"C2C\".concat(o[e].from),unreadCount:o[e].unreadCount,type:S.CONV_C2C})}},O=0,G=o.length;O0&&(o=e.cloudCustomData);var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push(\"NoUnread\"),!0===r&&a.push(\"NoLastMsg\"),!0===c&&a.push(\"NoMsgCheck\")}var u=this.isOnlineMessage(e,t)?0:void 0;return{protocolName:Uo.SEND_C2C_MESSAGE,tjgID:this.generateTjgID(e),requestData:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:u,nick:e.nick,avatar:e.avatar,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||\"\",desc:n.description||\"\",ext:n.extension||\"\",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||\"\"}}:void 0,messageControlInfo:0!==u?a:void 0,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}},{key:\"_isVoipPush\",value:function(e){var t=void 0;return mt(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:\"isOnlineMessage\",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:\"revokeMessage\",value:function(e){return this.request({protocolName:Uo.REVOKE_C2C_MESSAGE,requestData:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:\"deleteMessage\",value:function(e){var t=e.to,n=e.keyList;return Je.l(\"\".concat(this._n,\".deleteMessage toAccount:\").concat(t,\" count:\").concat(n.length)),this.request({protocolName:Uo.DELETE_C2C_MESSAGE,requestData:{fromAccount:this.getMyUserID(),to:t,keyList:n}})}},{key:\"modifyRemoteMessage\",value:function(e){var t=e.from,n=e.to,o=e.version,a=void 0===o?0:o,i=e.sequence,s=e.random,r=e.time,c=e.payload,u=e.type,l=e.cloudCustomData,d=void 0;return tn(u)&&(d=[]).push({type:u,content:c}),this.request({protocolName:Uo.MODIFY_C2C_MESSAGE,requestData:{from:t,to:n,version:a,sequence:i,random:s,time:r,elements:d,cloudCustomData:l}})}},{key:\"setMessageRead\",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,a=\"\".concat(this._n,\".setMessageRead\");Je.l(\"\".concat(a,\" conversationID:\").concat(n,\" lastMessageTime:\").concat(o)),_t(o)||this.outputWarning(\"DoNotModifyLastTime\");var i=new Xo(\"setC2CMessageRead\");return i.setMessage(\"conversationID:\".concat(n,\" lastMessageTime:\").concat(o)),this.request({protocolName:Uo.SET_C2C_MESSAGE_READ,requestData:{C2CMsgReaded:{cookie:\"\",C2CMsgReadedItem:[{toAccount:n.replace(\"C2C\",\"\"),lastMessageTime:o,receipt:1}]}}}).then((function(){i.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(a,\" ok\"));var e=t.getModule(ao);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),No()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.l(\"\".concat(a,\" failed. error:\"),e),Go(e)}))}},{key:\"getRoamingMessage\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessage\"),o=e.peerAccount,a=e.conversationID,i=e.count,s=e.lastMessageTime,r=e.messageKey,c=\"peerAccount:\".concat(o,\" count:\").concat(i||15,\" lastMessageTime:\").concat(s||0,\" messageKey:\").concat(r);Je.l(\"\".concat(n,\" \").concat(c));var u=new Xo(\"getC2CRoamingMessages\");return this.request({protocolName:Uo.GET_C2C_ROAMING_MESSAGE,requestData:{peerAccount:o,count:i||15,lastMessageTime:s||0,messageKey:r}}).then((function(e){var o=e.data,i=o.complete,s=o.messageList,r=o.messageKey,l=o.lastMessageTime;mt(s)?Je.l(\"\".concat(n,\" ok. complete:\").concat(i,\" but messageList is undefined!\")):Je.l(\"\".concat(n,\" ok. complete:\").concat(i,\" count:\").concat(s.length)),u.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(c,\" complete:\").concat(i,\" length:\").concat(s.length)).end();var d=t.getModule(ao);1===i&&d.setCompleted(a);var p=d.onRoamingMessage(s,a);d.modifyMessageList(a),d.updateIsRead(a),d.updateRoamingMessageKeyAndTime(a,r,l);var _=d.getPeerReadTime(a);if(Je.l(\"\".concat(n,\" update isPeerRead property. conversationID:\").concat(a,\" peerReadTime:\").concat(_)),_)d.updateMessageIsPeerReadProperty(a,_);else{var g=a.replace(S.CONV_C2C,\"\");t.getRemotePeerReadTime([g]).then((function(){d.updateMessageIsPeerReadProperty(a,d.getPeerReadTime(a))}))}var h=\"\";if(p.length>0)h=p[0].ID;else{var f=d.getLocalOldestMessage(a);f&&(h=f.ID)}return Je.l(\"\".concat(n,\" nextReqID:\").concat(h,\" stored message count:\").concat(p.length)),{nextReqID:h,storedMessageList:p}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setMessage(c).setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"getRoamingMessagesHopping\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessagesHopping\"),o=e.peerAccount,a=e.time,i=void 0===a?0:a,s=e.count,r=e.direction,c=\"\".concat(S.CONV_C2C).concat(o),u=\"peerAccount:\".concat(o,\" count:\").concat(s,\" time:\").concat(i,\" direction:\").concat(r);Je.l(\"\".concat(n,\" \").concat(u));var l=new Xo(\"getC2CRoamingMessagesHopping\");return this.request({protocolName:Uo.GET_C2C_ROAMING_MESSAGE,requestData:{peerAccount:o,count:s+1,lastMessageTime:i,direction:r}}).then((function(e){var o=e.data,a=o.complete,i=o.messageList,s=void 0===i?[]:i,d=o.lastMessageTime;Je.l(\"\".concat(n,\" ok. complete:\").concat(a,\" count:\").concat(s.length)),l.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(u,\" complete:\").concat(a,\" length:\").concat(s.length)).end(),1!==a&&(1===r?s.pop():s.shift());var p=t.getModule(ao).onRoamingMessage(s,c,!1);t._modifyMessageList(c,p);var _=t._computeResult({complete:a,lastMessageTime:d,resultList:p});return No(_)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setMessage(u).setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_computeResult\",value:function(e){var t=e.complete,n=void 0===t?0:t,o=e.lastMessageTime,a=e.resultList,i={messageList:m(void 0===a?[]:a),isCompleted:!1,nextMessageTime:\"\"};return 1===n?(i.isCompleted=!0,i):(i.nextMessageTime=o,i)}},{key:\"_modifyMessageList\",value:function(e,t){var n=this.getModule(ao).getLocalConversation(e);if(n)for(var o=n.userProfile.nick,a=n.userProfile.avatar,i=this.getModule($n).getNickAndAvatarByUserID(this.getMyUserID()),s=i.nick,r=i.avatar,c=t.length-1;c>=0;c--){var u=t[c];\"in\"===u.flow&&(u.nick!==o&&u.setNickAndAvatar({nick:o}),u.avatar!==a&&u.setNickAndAvatar({avatar:a})),\"out\"===u.flow&&(u.nick!==s&&u.setNickAndAvatar({nick:s}),u.avatar!==r&&u.setNickAndAvatar({avatar:r}))}}},{key:\"getRemotePeerReadTime\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRemotePeerReadTime\");if(pn(e))return Je.w(\"\".concat(n,\" userIDList is empty!\")),Promise.resolve();var o=new Xo(\"getPeerReadTime\");return Je.l(\"\".concat(n,\" userIDList:\").concat(e)),this.request({protocolName:Uo.GET_C2C_PEER_READ_TIME,requestData:{userIDList:e}}).then((function(a){var i=a.data.peerReadTimeList;Je.l(\"\".concat(n,\" ok. peerReadTimeList:\").concat(i));for(var s=\"\",r=t.getModule(ao),c=0;c0&&r.recordPeerReadTime(\"C2C\".concat(e[c]),i[c]);o.setNetworkType(t.getNetworkType()).setMessage(s).end()})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e)}))}},{key:\"sendReadReceipt\",value:function(e){var t=this,n=e[0].conversationID.replace(S.CONV_C2C,\"\"),o=new Xo(\"sendC2CReadReceipt\");o.setMessage(\"peerAccount:\".concat(n));var a=this.getMyUserID(),i=e.filter((function(e){return e.from!==a&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}));if(0===i.length)return Go({code:Ao.READ_RECEIPT_MSG_LIST_EMPTY});var s=\"\".concat(this._n,\".sendReadReceipt\");return Je.l(\"\".concat(s,\". peerAccount:\").concat(n,\" messageInfoList length:\").concat(i.length)),this.request({protocolName:Uo.SEND_C2C_READ_RECEIPT,requestData:{peerAccount:n,messageInfoList:i}}).then((function(e){return o.end(),Je.l(\"\".concat(s,\" ok\")),No()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.w(\"\".concat(s,\" failed. error:\"),e),Go(e)}))}},{key:\"getReadReceiptList\",value:function(e){var t=\"\".concat(this._n,\".getReadReceiptList\"),n=this.getMyUserID(),o=e.filter((function(e){return e.from===n&&!0===e.needReadReceipt}));return Je.l(\"\".concat(t,\" userID:\").concat(n,\" messageList length:\").concat(o.length)),Oo({messageList:o})}},{key:\"getMessageExtensions\",value:function(e,t){return Je.l(\"\".concat(this._n,\".getMessageExtensions startSequence:\").concat(t)),this.request({protocolName:Uo.GET_C2C_MESSAGE_EXTENSIONS,requestData:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),startSequence:t}})}},{key:\"modifyMessageExtensions\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Je.l(\"\".concat(this._n,\".modifyMessageExtensions operateType:\").concat(n)),this.request({protocolName:Uo.MODIFY_C2C_MESSAGE_EXTENSIONS,requestData:{from:e.from,to:e.to,messageKey:this.getMessageKey(e),extensionList:t,operateType:n}})}},{key:\"getMessageKey\",value:function(e){var t=e.clientSequence,n=e.random,o=e.time;return\"\".concat(t,\"_\").concat(n,\"_\").concat(o)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._messageFromUnreadDBMap.clear(),this._noticeFromUnreadDBList.length=0}}]),a}(Po),ga=function(){function e(){o(this,e),this.list=new Map,this._n=\"MessageListHandler\",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}return i(e,[{key:\"getLocalOldestMessageByConversationID\",value:function(e){if(!e)return null;if(!this.list.has(e))return null;var t=this.list.get(e).values();return t?t.next().value:null}},{key:\"pushIn\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0;this.list.has(n)||this.list.set(n,new Map);var a=this._getUniqueIDOfMessage(e),i=this.list.get(n).has(a);if(i){var s=this.list.get(n).get(a);if(!t||!0===s.isModified)return o=!1}return this.list.get(n).set(a,e),this._setLatestMessageSentByPeer(n,e),this._setLatestMessageSentByMe(n,e),o}},{key:\"unshift\",value:function(e,t){var n;if(vt(e)?e.length>0&&(n=e[0].conversationID,this._unshiftMultipleMessages(e,t)):(n=e.conversationID,this._unshiftSingleMessage(e,t)),n){var o=Array.from(this.list.get(n).values()),a=o.length;if(0===a)return;for(var i=a-1;i>=0;i--)if(\"out\"===o[i].flow){this._setLatestMessageSentByMe(n,o[i]);break}if(n.startsWith(S.CONV_C2C))for(var s=a-1;s>=0;s--)if(\"in\"===o[s].flow){this._setLatestMessageSentByPeer(n,o[s]);break}}}},{key:\"_unshiftSingleMessage\",value:function(e,t){var n=e.conversationID,o=this._getUniqueIDOfMessage(e);if(!this.list.has(n))return this.list.set(n,new Map),this.list.get(n).set(o,e),void t.push(e);var a=this.list.get(n),i=Array.from(a);a.has(o)||(i.unshift([o,e]),this.list.set(n,new Map(i)),t.push(e))}},{key:\"_unshiftMultipleMessages\",value:function(e,t){for(var n=e.length,o=[],a=e[0].conversationID,i=this.list.get(a),s=this.list.has(a)?Array.from(i):[],r=0;r=0;l--)\"in\"===i[l].flow&&((r=i[l]).nick!==n&&(r.setNickAndAvatar({nick:n}),u=!0),r.avatar!==o&&(r.setNickAndAvatar({avatar:o}),u=!0),u&&(c+=1));Je.l(\"\".concat(this._n,\".modifyMessageSentByPeer conversationID:\").concat(t,\" count:\").concat(c))}}}},{key:\"modifyMessageSentByMe\",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,a=this.list.get(t);if(!pn(a)){var i=Array.from(a.values()),s=i.length;if(0!==s){for(var r=null,c=0,u=!1,l=s-1;l>=0;l--)\"out\"===i[l].flow&&((r=i[l]).nick!==n&&(r.setNickAndAvatar({nick:n}),u=!0),r.avatar!==o&&(r.setNickAndAvatar({avatar:o}),u=!0),u&&(c+=1));Je.l(\"\".concat(this._n,\".modifyMessageSentByMe conversationID:\").concat(t,\" count:\").concat(c))}}}},{key:\"getTopicConversationIDList\",value:function(e){return m(this.list.keys()).filter((function(t){return t.startsWith(\"\".concat(S.CONV_GROUP).concat(e))}))}},{key:\"traversal\",value:function(){if(0!==this.list.size&&-1===Je.getLevel()){console.group(\"conversationID-messageCount\");var e,t=D(this.list);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],a=n[1];console.log(\"\".concat(o,\"-\").concat(a.size))}}catch(i){t.e(i)}finally{t.f()}console.groupEnd()}}},{key:\"onMessageModified\",value:function(e,t){if(!this.list.has(e))return{isUpdated:!1,message:null};var n=\"\".concat(this._n,\".onMessageModified\"),o=this._getUniqueIDOfMessage(t),a=this.list.get(e).has(o);if(Je.l(\"\".concat(n,\" conversationID:\").concat(e,\" uniqueID:\").concat(o,\" has:\").concat(a)),a){var i=this.list.get(e).get(o),s=t.messageVersion,r=t.elements,c=t.cloudCustomData,u=t.checkResult;return Je.l(\"\".concat(n,\" localVersion:\").concat(i.version,\" remoteVersion:\").concat(s)),i.version1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isReady?void(t?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},t.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&t.length>0&&t.forEach((function(e){e.call(this)}),e)}),1)},t.resetReady=function(){this._isReady=!1,this._readyQueue=[]},t.isReady=function(){return this._isReady}};var va=[\"jpg\",\"jpeg\",\"gif\",\"png\",\"bmp\",\"image\",\"webp\"],ma=[\"mp4\",\"quicktime\",\"mov\"],Ma=1,Ia=2,ya=3,Ta=255,Ca=function(){function e(t){var n=this;o(this,e),pn(t)||(this.userID=t.userID||\"\",this.nick=t.nick||\"\",this.gender=t.gender||\"\",this.birthday=t.birthday||0,this.location=t.location||\"\",this.selfSignature=t.selfSignature||\"\",this.allowType=t.allowType||S.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||\"\",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||S.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],pn(t.profileCustomField)||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})})))}return i(e,[{key:\"validate\",value:function(e){var t=!0,n=\"\";if(pn(e))return{valid:!1,tips:\"empty options\"};if(e.profileCustomField)for(var o=e.profileCustomField.length,a=null,i=0;i500&&(n=\"nick name limited: must less than or equal to \".concat(500,\" bytes, current size: \").concat(Nt(e[s]),\" bytes\"),t=!1);break;case\"gender\":Rt(ot,e.gender)||(n=\"key:gender, invalid value:\"+e.gender,t=!1);break;case\"birthday\":_t(e.birthday)||(n=\"birthday must be a number\",t=!1);break;case\"location\":gt(e.location)||(n=\"location must be a string\",t=!1);break;case\"selfSignature\":gt(e.selfSignature)||(n=\"selfSignature must be a string\",t=!1);break;case\"allowType\":Rt(it,e.allowType)||(n=\"key:allowType, invalid value:\"+e.allowType,t=!1);break;case\"language\":_t(e.language)||(n=\"language must be a number\",t=!1);break;case\"avatar\":gt(e.avatar)||(n=\"avatar must be a string\",t=!1);break;case\"messageSettings\":0!==e.messageSettings&&1!==e.messageSettings&&(n=\"messageSettings must be 0 or 1\",t=!1);break;case\"adminForbidType\":Rt(at,e.adminForbidType)||(n=\"key:adminForbidType, invalid value:\"+e.adminForbidType,t=!1);break;case\"level\":_t(e.level)||(n=\"level must be a number\",t=!1);break;case\"role\":_t(e.role)||(n=\"role must be a number\",t=!1);break;default:n=\"unknown key:\"+s+\" \"+e[s],t=!1}}return{valid:t,tips:n}}}]),e}(),Da=i((function e(t){o(this,e),this.value=t,this.next=null})),Ea=function(){function e(t){o(this,e),this.MAX_LENGTH=t,this.pTail=null,this.pNodeToDel=null,this.map=new Map}return i(e,[{key:\"set\",value:function(e){var t=new Da(e);if(this.map.size0&&n.members.forEach((function(e){e.userID===t.selfInfo.userID&&Et(t.selfInfo,e,[\"sequence\"])}))}},{key:\"updateSelfInfo\",value:function(e){var n={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList};Et(this.selfInfo,t({},n),[],[\"\",null,void 0,0,NaN])}},{key:\"setSelfNameCard\",value:function(e){this.selfInfo.nameCard=e}}]),e}(),ka=function(e,n,o){return mt(e)?{lastTime:0,lastSequence:0,fromAccount:\"\",messageForShow:\"\",payload:null,type:\"\",isRevoked:!1,cloudCustomData:\"\",onlineOnlyFlag:!1,nick:\"\",nameCard:\"\",version:0,isPeerRead:!1,revoker:null}:o&&e.ID||e instanceof pa?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||\"\",messageForShow:en(e.type,e.payload,n),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||\"\",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||\"\",nameCard:e.nameCard||\"\",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:t(t({},e),{},{messageForShow:en(e.type,e.payload,n)})},Aa=function(){function e(t,n){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2];o(this,e),this.conversationID=t.conversationID||\"\",this.unreadCount=t.unreadCount||0,this.type=t.type||\"\",this.lastMessage=ka(t.lastMessage,n,a),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark=\"\",this.isPinned=t.isPinned||!1,this.messageRemindType=t.messageRemindType,this.markList=t.markList||[],this.customData=t.customData||\"\",this.conversationGroupList=t.conversationGroupList||[],this.draftText=t.draftText||\"\",this._initProfile(t),this.subType=this.groupProfile?this.groupProfile.type:\"\"}return i(e,[{key:\"toAccount\",get:function(){return this.conversationID.startsWith(S.CONV_C2C)?this.conversationID.replace(S.CONV_C2C,\"\"):this.conversationID.startsWith(S.CONV_GROUP)?this.conversationID.replace(S.CONV_GROUP,\"\"):\"\"}},{key:\"_initProfile\",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case\"userProfile\":t.userProfile=e.userProfile;break;case\"groupProfile\":t.groupProfile=e.groupProfile}})),mt(this.userProfile)&&this.type===S.CONV_C2C?this.userProfile=new Ca({userID:e.conversationID.replace(\"C2C\",\"\")}):mt(this.groupProfile)&&this.type===S.CONV_GROUP&&(this.groupProfile=new Na({groupID:e.conversationID.replace(\"GROUP\",\"\")}))}},{key:\"updateUnreadCount\",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations,o=e.isUnreadC2CMessage;mt(t)||(bt(this.subType)?this.unreadCount=0:n&&this.type===S.CONV_GROUP||n&&this.type===S.CONV_TOPIC||o&&this.type===S.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:\"updateLastMessage\",value:function(e){this.lastMessage=ka(e)}},{key:\"updateGroupAtInfoList\",value:function(e){if(!this._isNeedMergeGroupAtInfo(e)){var t=function(e){return M(e)||I(e)||y(e)||C()}(e.groupAtType).slice(0);-1!==t.indexOf(S.CONV_AT_ME)&&-1!==t.indexOf(S.CONV_AT_ALL)&&(t=[S.CONV_AT_ALL_AT_ME]);var n={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:t,__random:e.__random,__sequence:e.__sequence};this.groupAtInfoList.push(n)}}},{key:\"_isNeedMergeGroupAtInfo\",value:function(e){var t=e.groupID,n=e.sequence;if(!wt({groupID:t}))return!1;var o=!1;return this.groupAtInfoList.forEach((function(t){t.messageSequence===n&&(t.atTypeArray.indexOf(S.CONV_AT_ME)>-1&&e.groupAtType.indexOf(S.CONV_AT_ALL)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME]),t.atTypeArray.indexOf(S.CONV_AT_ALL)>-1&&e.groupAtType.indexOf(S.CONV_AT_ME)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME],t.__random=e.__random,t.__sequence=e.__sequence),o=!0)})),o}},{key:\"clearGroupAtInfoList\",value:function(){this.groupAtInfoList.length=0}},{key:\"reduceUnreadCount\",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:\"isLastMessageRevoked\",value:function(e){var t=e.sequence,n=e.time;return this.type===S.CONV_C2C&&t===this.lastMessage.lastSequence&&n===this.lastMessage.lastTime||this.type===S.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:\"setLastMessageRevoked\",value:function(e){this.lastMessage.isRevoked=e}},{key:\"setLastMessageRevoker\",value:function(e){this.lastMessage.revoker=e}},{key:\"setDraftText\",value:function(e){this.draftText=e}}]),e}(),La=function(){function e(t){o(this,e),this._conversationModule=t,this._n=\"MessageRemindHandler\"}return i(e,[{key:\"getC2CMessageRemindType\",value:function(e){var t=this,n=\"\".concat(this._n,\".getC2CMessageRemindType\");return this._conversationModule.request({protocolName:Uo.GET_C2C_PEER_MUTE_NOTIFICATIONS,requestData:{toAccount:this._conversationModule.getMyUserID(),userIDList:e}}).then((function(o){Je.l(\"\".concat(n,\" ok. userIDList:\").concat(e));var a=o.data.muteFlagList;t._conversationModule.onC2CMessageRemindTypeFetched(a)})).catch((function(e){Je.e(\"\".concat(n,\" failed. error:\"),e)}))}},{key:\"set\",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):vt(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:\"_setGroupMessageRemindType\",value:function(e){var t=this,n=\"\".concat(this._n,\"._setGroupMessageRemindType\"),o=e.groupID,a=e.messageRemindType,i=\"groupID:\".concat(o,\" messageRemindType:\").concat(a),s=new Xo(\"setMessageRemindType\");s.setMessage(i);var r=this._getModule(to);return r?r.modifyGroupMemberInfo({groupID:o,messageRemindType:a,userID:this._conversationModule.getMyUserID()}).then((function(){s.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok. \").concat(i));var o=t.onGroupMessageRemindTypeUpdated(e);return t._conversationModule.emitTotalUnreadMessageCountUpdate(),No(o)})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)})):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"onGroupMessageRemindTypeUpdated\",value:function(e){var t=e.groupID,n=e.messageRemindType;Je.l(\"\".concat(this._n,\".onGroupMessageRemindTypeUpdated groupID:\").concat(t,\" messageRemindType:\").concat(n));var o=this._getModule(to).getLocalGroupProfile(t);if(o&&(o.selfInfo.messageRemindType=n),Ft(t)){var a=t,i=$t(a),s=this._getModule(oo).getLocalTopic(i,a);return s&&(s.updateSelfInfo({messageRemindType:n}),this._conversationModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:i,topic:s})),{topic:s}}return this._conversationModule.patchMessageRemindType({ID:t,isC2CConversation:!1,messageRemindType:n})&&this._emitConversationUpdate(),{group:o}}},{key:\"_setC2CMessageRemindType\",value:function(e){var t=this,n=\"\".concat(this._n,\"._setC2CMessageRemindType\"),o=e.userIDList,a=e.messageRemindType,i=o.slice(0,30),s=0;a===S.MSG_REMIND_DISCARD?s=1:a===S.MSG_REMIND_ACPT_NOT_NOTE&&(s=2);var r=\"userIDList:\".concat(i,\" messageRemindType:\").concat(a),c=new Xo(\"setMessageRemindType\");return c.setMessage(r),this._conversationModule.request({protocolName:Uo.SET_C2C_PEER_MUTE_NOTIFICATIONS,requestData:{userIDList:i,muteFlag:s}}).then((function(e){c.setNetworkType(t._conversationModule.getNetworkType()).end();var o=e.data.errorList,s=[],u=[];vt(o)&&o.forEach((function(e){s.push(e.userID),u.push({userID:e.userID,code:e.errorCode})}));var l=i.filter((function(e){return-1===s.indexOf(e)}));Je.l(\"\".concat(n,\" ok. \").concat(r,\" successUserIDList:\").concat(l,\" failureUserIDList:\").concat(JSON.stringify(u)));var d=0;return l.forEach((function(e){t._conversationModule.patchMessageRemindType({ID:e,isC2CConversation:!0,messageRemindType:a})&&(d+=1)})),d>=1&&t._emitConversationUpdate(),i.length=s.length=0,t._conversationModule.emitTotalUnreadMessageCountUpdate(),Oo({successUserIDList:l.map((function(e){return{userID:e}})),failureUserIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_getModule\",value:function(e){return this._conversationModule.getModule(e)}},{key:\"_emitConversationUpdate\",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\"))}}]),e}(),Ra=function(){function e(t){o(this,e),this._conversationModule=t,this._n=\"ConvGroupHandler\",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=vn.NOT_START}return i(e,[{key:\"setConvCustomData\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setConvCustomData\"),o=e.conversationIDList,a=e.customData;Je.l(\"\".concat(n,\" options:\"),e);var i=new Xo(\"setConvCustomData\");i.setMessage(JSON.stringify(e));var s={fromAccount:this._getMyUserID(),itemList:[]},r=[],c=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(c,e),!0;if(!qt(e)&&!xt(e))return t._onConversationIDInvalid(c,e),!0;var n={operationType:2,contactItem:void 0,customMark:a};qt(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,\"\")}:xt(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,\"\")}),s.itemList.push(n)})),c.length===o.length?Oo({successConversationIDList:r,failureConversationIDList:c}):this._conversationModule.request({protocolName:Uo.SET_CONVERSATION_CUSTOM_DATA,requestData:s}).then((function(e){i.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\"));var o=e.data.resultItem;if(vt(o)){var s,u,l=!1;o.forEach((function(e){s=t._concatConversationID(e.contactItem),0===e.resultCode?(r.push(s),(u=t._getLocalConversation(s))&&u.customData!==a&&(u.customData=a,l=!0)):c.push({conversationID:s,code:e.resultCode,message:e.resultInfo})})),!0===l&&t._emitConversationUpdate()}return No({successConversationIDList:r,failureConversationIDList:c})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"markConversation\",value:function(e){var t=this;if(!this._conversationModule.canIUse(K.CONV_MARK))return this._conversationModule.cannotUseCommercialAbility(\"markConversation\");var n=\"\".concat(this._n,\".\").concat(\"markConversation\"),o=e.conversationIDList,a=e.markType,i=e.enableMark;Je.l(\"\".concat(n,\" options:\"),e);var s=new Xo(\"markConversation\");s.setMessage(JSON.stringify(e));var r=void 0,c=void 0,u=this._getFlagBit(a);!0===i?c=[u]:r=[u];var l={fromAccount:this._getMyUserID(),itemList:[]},d=[],p=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(p,e),!0;if(!qt(e)&&!xt(e))return t._onConversationIDInvalid(p,e),!0;var n={operationType:1,contactItem:void 0,clearMark:r,setMark:c};qt(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,\"\")}:xt(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,\"\")}),l.itemList.push(n)})),p.length===o.length?Oo({successConversationIDList:d,failureConversationIDList:p}):this._conversationModule.request({protocolName:Uo.MARK_CONVERSATION,requestData:l}).then((function(e){s.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\"));var o=e.data.resultItem;if(vt(o)){var r,c,u=!1;o.forEach((function(e){if(r=t._concatConversationID(e.contactItem),0===e.resultCode){if(d.push(r),c=t._getLocalConversation(r)){var n=c.markList.indexOf(a);!0===i?-1===n&&(c.markList.push(a),u=!0):-1!==n&&(c.markList.splice(n,1),u=!0)}}else p.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===u&&t._emitConversationUpdate()}return No({successConversationIDList:d,failureConversationIDList:p})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"getLocalConvGroupList\",value:function(){var e=this;return Je.l(\"\".concat(this._n,\".getLocalConvGroupList pagingStatus:\").concat(this._pagingStatus)),this._pagingStatus===vn.REJECTED?this.getRemoteConvGroupList().then((function(){return No(m(e._convGroupMap.values()))})):Oo(m(this._convGroupMap.values()))}},{key:\"getRemoteConvGroupList\",value:function(){var e=this,t=\"\".concat(this._n,\".getRemoteConvGroupList\");return this._pagingStatus=vn.PENDING,this._conversationModule.request({protocolName:Uo.GET_CONVERSATION_GROUP_LIST,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:Ke()}}).then((function(n){var o,a,i=n.data,s=i.completeFlag,r=i.contactItem,c=i.nextStartIndex,u=void 0===c?0:c,l=i.groupItem;(e._startIndex=u,Je.l(\"\".concat(t,\" completeFlag:\").concat(s,\" nextStartIndex:\").concat(u)),vt(l)&&l.forEach((function(t){var n=t.convGroupID,o=t.groupName;e._convGroupMap.set(n,o)})),vt(r))&&r.forEach((function(t){var n=t.standardMark,i=t.customData,s=t.convGroupIDList;if(o=e._concatConversationID(t),(a=e._getLocalConversation(o))&&(a.markList=nn(n),a.customData=i||\"\",vt(s))){var r=[];s.forEach((function(t){e._convGroupMap.has(t)&&r.push(e._convGroupMap.get(t))})),a.conversationGroupList=[].concat(r),r.length=0}}));if(0===s)return e.getRemoteConvGroupList();1===s&&(e._pagingStatus=vn.RESOLVED,e._emitConversationUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=vn.REJECTED,Je.w(\"\".concat(t,\" failed. error:\"),n)}))}},{key:\"createConvGroup\",value:function(e){var t=this,n=\"createConversationGroup\";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n);Je.l(\"\".concat(o,\" options:\"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.groupName,s=e.conversationIDList,r={fromAccount:this._getMyUserID(),itemList:[{groupName:i,contactItem:[]}]},c=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?qt(e)||xt(e)?void(qt(e)?r.itemList[0].contactItem.push({type:1,toAccount:e.replace(S.CONV_C2C,\"\")}):xt(e)&&r.itemList[0].contactItem.push({type:2,groupID:e.replace(S.CONV_GROUP,\"\")})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?Oo({successConversationIDList:c,failureConversationIDList:u}):this._conversationModule.request({protocolName:Uo.CREATE_CONVERSATION_GROUP,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\"));var n=e.data.groupResultItem[0],s=n.groupItem,r=n.resultItem;if(ft(s)&&(t._convGroupMap.set(s.convGroupID,s.groupName),t._emitConvGroupListUpdate()),vt(r)){var l,d,p=!1;r.forEach((function(e){l=t._concatConversationID(e.contactItem),0===e.resultCode?(c.push(l),(d=t._getLocalConversation(l))&&-1===d.conversationGroupList.indexOf(i)&&(d.conversationGroupList.push(i),p=!0)):u.push({conversationID:l,code:e.resultCode,message:e.resultInfo})})),!0===p&&(t._emitConversationUpdate(),t._emitConvGroupListUpdate())}return No({successConversationIDList:c,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"deleteConvGroup\",value:function(e){var t=this,n=\"deleteConversationGroup\";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n);Je.l(\"\".concat(o,\" groupName:\").concat(e));var a=new Xo(n);return a.setMessage(e),this._conversationModule.request({protocolName:Uo.DELETE_CONVERSATION_GROUP,requestData:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(n){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\"));var i=n.data.groupItem;if(vt(i)){var s=!1;i.forEach((function(e){t._convGroupMap.has(e.convGroupID)&&(t._convGroupMap.delete(e.convGroupID),s=!0)})),!0===s&&t._emitConvGroupListUpdate()}t._eraseFromConversationGroupList([e])})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"renameConvGroup\",value:function(e){var t=this,n=\"renameConversationGroup\";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n);Je.l(\"\".concat(o,\" options:\"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.oldName,s=e.newName;return this._conversationModule.request({protocolName:Uo.RENAME_CONVERSATION_GROUP,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:i,newName:s}}}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\"));var n=e.data.updateGroupResult.convGroupID;t._convGroupMap.set(n,s),t._emitConvGroupListUpdate();var r,c,u=t._conversationModule.getLocalConversationList(),l=!1;u.forEach((function(e){r=e.conversationGroupList,-1!==(c=r.indexOf(i))&&(r.splice(c,1,s),l=!0)})),!0===l&&t._emitConversationUpdate()})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"addConvsToGroup\",value:function(e){var t=this,n=\"addConversationsToGroup\";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n);Je.l(\"\".concat(o,\" options:\"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.conversationIDList,s=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:s,updateItem:[]}},c=[],u=[];return i.forEach((function(e){return t._hasLocalConversation(e)?qt(e)||xt(e)?void(qt(e)?r.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,\"\")}}):xt(e)&&r.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,\"\")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===i.length?Oo({successConversationIDList:c,failureConversationIDList:u}):this._conversationModule.request({protocolName:Uo.ADD_CONVERSATIONS_TO_GROUP,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\"));var n=e.data.updateGroupResult.contactResultItem;if(vt(n)){var i,r,l=!1;n.forEach((function(e){i=t._concatConversationID(e.contactItem),0===e.resultCode?(r=t._getLocalConversation(i))&&-1===r.conversationGroupList.indexOf(s)&&(r.conversationGroupList.push(s),c.push(i),l=!0):u.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(s))}return No({successConversationIDList:c,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"deleteConvsFromGroup\",value:function(e){var t=this,n=\"deleteConversationsFromGroup\";if(!this._conversationModule.canIUse(K.CONV_GROUP))return this._conversationModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n);Je.l(\"\".concat(o,\" options:\"),e);var a=new Xo(n);a.setMessage(JSON.stringify(e));var i=e.conversationIDList,s=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:s,updateItem:[]}},c=[],u=[];return i.forEach((function(e){return t._hasLocalConversation(e)?qt(e)||xt(e)?void(qt(e)?r.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,\"\")}}):xt(e)&&r.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,\"\")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===i.length?Oo({successConversationIDList:c,failureConversationIDList:u}):this._conversationModule.request({protocolName:Uo.DELETE_CONVERSATIONS_FROM_GROUP,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\"));var n=e.data.updateGroupResult.contactResultItem;if(vt(n)){var i,r,l=!1;n.forEach((function(e){if(i=t._concatConversationID(e.contactItem),0===e.resultCode){if(r=t._getLocalConversation(i)){var n=r.conversationGroupList.indexOf(s);-1!==n&&(r.conversationGroupList.splice(n,1),c.push(i),l=!0)}}else u.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(s))}return No({successConversationIDList:c,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"onConvMarkUpdated\",value:function(e){var t=this;if(!pn(e)){var n,o;Je.d(\"\".concat(this._n,\".onConvMarkUpdated markItemList:\"),e);var a=!1;e.forEach((function(e){var i=e.recentContactItem,s=e.optType,r=e.standardMark,c=e.customMark;n=t._concatConversationID(i),(o=t._getLocalConversation(n))&&(1===s?a=t._diffStandardMark(o,r):2===s?a=t._diffCustomMark(o,c):3===s&&(a=t._diffStandardMark(o,r)||t._diffCustomMark(o,c)))})),!0===a&&this._emitConversationUpdate()}}},{key:\"_diffStandardMark\",value:function(e,t){var n=nn(t),o=!1;return!0!==function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n=0;o--)if(\"1\"===t[o])return n-o-1}},{key:\"_concatConversationID\",value:function(e){var t,n=e.type,o=e.to,a=e.groupID,i=e.userID;return 1===n?mt(i)?mt(o)||(t=\"\".concat(S.CONV_C2C).concat(o)):t=\"\".concat(S.CONV_C2C).concat(i):2===n&&(t=\"\".concat(S.CONV_GROUP).concat(a)),t}},{key:\"_getMyUserID\",value:function(){return this._conversationModule.getMyUserID()}},{key:\"_insertConversationGroup\",value:function(e,t){var n=this._getLocalConversation(e);if(n){var o=n.conversationGroupList;-1===o.indexOf(t)&&o.push(t)}}},{key:\"_getLocalConversation\",value:function(e){return this._conversationModule.getLocalConversation(e)}},{key:\"_hasLocalConversation\",value:function(e){return this._conversationModule.hasLocalConversation(e)}},{key:\"_emitConversationUpdate\",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:\"_emitConvGroupListUpdate\",value:function(){this._conversationModule.emitOuterEvent(E.CONVERSATION_GROUP_LIST_UPDATED,m(this._convGroupMap.values()))}},{key:\"_emitConvInGroupUpdate\",value:function(e){var t={groupName:e,conversationList:[]},n=this._conversationModule.getLocalConversationList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._conversationModule.emitOuterEvent(E.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=vn.NOT_START}}]),e}(),Oa=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n=\"ConversationModule\",fa.mixin(g(t)),t._messageListHandler=new ga,t._messageRemindHandler=new La(g(t)),t._convGroupHandler=new Ra(g(t)),t.singlyLinkedList=new Ea(100),t._pagingStatus=vn.NOT_START,t._pagingTimeStamp=0,t._pagingStartIndex=0,t._pagingPinnedTimeStamp=0,t._pagingPinnedStartIndex=0,t._pagingConvIDMap=new Map,t._convIDFromUnreadDBMap=new Map,t._conversationMap=new Map,t._tmpGroupList=[],t._tmpGroupAtTipsList=[],t._peerReadTimeMap=new Map,t._completedMap=new Map,t._roamingMessageKeyAndTimeMap=new Map,t._roamingMessageSequenceMap=new Map,t._remoteGroupReadSequenceMap=new Map,t._convTotalUnreadCount=0,t._pagingGetCostList=[],t._initListeners(),t}return i(a,[{key:\"_initListeners\",value:function(){var e=this.getInnerEmitterInstance();e.on(ha.A2KEY_AND_TINYID_UPDATED,this._init,this),e.on(ha.PROFILE_UPDATED,this._onProfileUpdated,this)}},{key:\"onCheckTimer\",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:\"_init\",value:function(){var e=this;Je.l(\"\".concat(this._n,\"._init\"));var t=this.getModule(so).getItem(\"conversationMap\"),n=this.isIntl(),o=this.isUsingChatCore();if(t){for(var a=t.length,i=0;i0&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConversationList()}},{key:\"_isNonExistentAccount\",value:function(e){var t;return e.startsWith(S.CONV_C2C)&&(t=e.replace(S.CONV_C2C,\"\")),\"@TLS#ERROR\"===t||\"@TLS#NOT_FOUND\"===t}},{key:\"onMessageSent\",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:\"onNewMessage\",value:function(e){this._onSendOrReceiveMessage(e)}},{key:\"_onSendOrReceiveMessage\",value:function(e){var t=this,n=e.conversationOptionsList,o=e.isInstantMessage,a=void 0===o||o,i=e.isUnreadC2CMessage,s=void 0!==i&&i,r=e.updateUnreadCount,c=void 0===r||r,u=e.isSyncingEnded,l=void 0!==u&&u;this._isReady?0!==n.length?(!0===a&&this._checkNewConversation(n),this._updateLocalConversationList({conversationOptionsList:n,isInstantMessage:a,isUnreadC2CMessage:s,isFromGetConversations:!1,updateUnreadCount:c}),a||(this._convIDFromUnreadDBMap=new Map([].concat(m(this._convIDFromUnreadDBMap),m(n.map((function(e){return[e.conversationID,1]}))))),this._diffAndDeleteConversation(),l&&this.emitInnerEvent(ha.C2C_UNREAD_HANDLE_COMPLETED)),n.filter((function(e){return e.type===S.CONV_TOPIC})).length>0||this.emitConversationUpdate()):l&&this.emitInnerEvent(ha.C2C_UNREAD_HANDLE_COMPLETED):this.ready((function(){t._onSendOrReceiveMessage(e)}))}},{key:\"updateConversationGroupProfile\",value:function(e){var t=this;if(!vt(e)||0!==e.length)if(0!==this._conversationMap.size){var n=!1;e.forEach((function(e){var o=\"GROUP\".concat(e.groupID);if(t._conversationMap.has(o)){n=!0;var a=t._conversationMap.get(o);a.groupProfile=JSON.parse(JSON.stringify(e)),a.lastMessage.lastSequence=0;s--)if(!a[s].isDeleted){i=a[s];break}var r=this._conversationMap.get(o);if(r){var c=!1;r.lastMessage.lastSequence===i.sequence&&r.lastMessage.lastTime===i.time||(pn(i)&&(i=void 0),r.updateLastMessage(i),r.type!==S.CONV_TOPIC&&(c=!0),Je.l(\"\".concat(this._n,\".onMessageDeleted. update conversationID:\").concat(o,\" with lastMessage:\"),r.lastMessage)),o.startsWith(S.CONV_C2C)&&this.updateUnreadCount(o),c&&this.emitConversationUpdate(!0,!1)}}}},{key:\"onMessageModified\",value:function(e){var t=\"\".concat(this._n,\".onMessageModified\"),n=e.conversationType,o=e.from,a=e.to,i=e.time,s=e.sequence,r=e.elements,c=e.cloudCustomData,u=e.messageVersion,l=this.getMyUserID(),d=\"\".concat(n).concat(a);a===l&&n===S.CONV_C2C&&(d=\"\".concat(n).concat(o));var p=this._messageListHandler.onMessageModified(d,e),_=p.isUpdated,g=p.message;!0===_&&this.emitOuterEvent(E.MESSAGE_MODIFIED,[g]);var h=this._isTopicConversation(d);if(null===g?Je.l(\"\".concat(t,\" message is null! options:\").concat(JSON.stringify(e),\"}\")):Je.l(\"\".concat(t,\" isUpdated:\").concat(_,\" isTopicMessage:\").concat(h,\" from:\").concat(o,\" to:\").concat(a,\" sequence:\").concat(g.sequence,\" time:\").concat(g.time)),h){this.getModule(oo).onMessageModified(e)}else{var f=this._conversationMap.get(d);if(f){var v=f.lastMessage;v&&v.lastTime===i&&v.lastSequence===s&&v.version!==u&&(Je.l(\"\".concat(t,\" conversationID:\").concat(d,\" lastMessage updated\")),v.type=r[0].type,v.payload=r[0].content,v.messageForShow=en(v.type,v.payload,this.isIntl()),v.cloudCustomData=c,v.version=u,this.emitConversationUpdate(!0,!1))}}return g}},{key:\"onNewGroupAtTips\",value:function(e){var n=this,o=e.dataList,a=null;o.forEach((function(e){e.groupAtTips?a=e.groupAtTips:e.elements?a=t(t({},e.elements),{},{sync:!0}):e.groupAtType&&(a=t(t({},e),{},{sync:!0})),a.__random=e.random,a.__sequence=e.clientSequence,n._tmpGroupAtTipsList.push(a)})),Je.d(\"\".concat(this._n,\".onNewGroupAtTips isReady:\").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:\"_handleGroupAtTipsList\",value:function(){var e=this;if(0!==this._tmpGroupAtTipsList.length){var t=!1;this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,a=n.from,i=n.topicID,s=void 0===i?void 0:i,r=n.sync,c=void 0!==r&&r;if(a!==e.getMyUserID())if(mt(s)){var u=e._conversationMap.get(\"\".concat(S.CONV_GROUP).concat(o));u&&(u.updateGroupAtInfoList(n),t=!0)}else{var l=e._conversationMap.get(\"\".concat(S.CONV_GROUP).concat(s));if(l){l.updateGroupAtInfoList(n);var d=e.getModule(oo),p=l.groupAtInfoList;d.onConversationProxy({topicID:s,groupAtInfoList:p})}if(pn(l)&&c)e.updateTopicConversation([{conversationID:\"\".concat(S.CONV_GROUP).concat(s),type:S.CONV_TOPIC}]),e._conversationMap.get(\"\".concat(S.CONV_GROUP).concat(s)).updateGroupAtInfoList(n)}})),t&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:\"_checkNewConversation\",value:function(e){var t=this,n=[],o=[];e.forEach((function(e){t._conversationMap.has(e.conversationID)||(e.type===S.CONV_C2C?n.push(e.conversationID.replace(S.CONV_C2C,\"\")):e.type===S.CONV_GROUP&&o.push(e.conversationID.replace(S.CONV_GROUP,\"\")))})),n.length>0&&(this._onNewC2CConversation(n),n=null),o.length>0&&(this._onNewGroupConversation(o),o=null)}},{key:\"_onNewC2CConversation\",value:function(e){this.getModule(eo).getRemotePeerReadTime(e),this._messageRemindHandler.getC2CMessageRemindType(e)}},{key:\"_onNewGroupConversation\",value:function(e){var t=this.getModule(to);t&&t.getMessageRemindType(e)}},{key:\"_setStorageConversationList\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.getLocalConversationList(),n=t.filter((function(e){return e.type===S.CONV_C2C||e.type===S.CONV_GROUP&&e.lastMessage.type!==S.MSG_GRP_TIP})).slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}})),o=this.getModule(so);o.setItem(\"conversationMap\",n,e)}},{key:\"emitConversationUpdate\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversationList();if(t){var o=this.getModule(to);o&&o.updateGroupLastMessage(n)}e&&this.emitOuterEvent(E.CONVERSATION_LIST_UPDATED)}},{key:\"getLocalConversationList\",value:function(){return m(this._conversationMap.values()).filter((function(e){return e.type!==S.CONV_TOPIC}))}},{key:\"getLocalConversation\",value:function(e){return this._conversationMap.get(e)}},{key:\"hasLocalConversation\",value:function(e){return this._conversationMap.has(e)}},{key:\"getLocalOldestMessage\",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:\"syncConversationList\",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=\"syncConversationList\",o=new Xo(n);return this._pagingStatus===vn.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList(t).then((function(t){var a=cn(e._pagingGetCostList),i=rn(e._pagingGetCostList);e._pagingGetCostList.length=0,e._pagingStatus=vn.RESOLVED,e._diffAndDeleteConversation(),e.emitConversationUpdate(!0,!1),e._setStorageConversationList(),e._handleC2CPeerReadTime(),e.emitInnerEvent(ha.CONV_SYNC_COMPLETED);var s=\"count:\".concat(e._conversationMap.size,\" sum:\").concat(i,\" avg:\").concat(a);return Je.l(\"\".concat(e._n,\".\").concat(n,\". \").concat(s)),o.setMessage(s).setNetworkType(e.getNetworkType()).end(),t})).catch((function(t){return e._pagingStatus=vn.REJECTED,o.setMessage(e._pagingTimeStamp),e.probeNetwork().then((function(e){var n=v(e,2),a=n[0],i=n[1];o.setError(t,a,i).end()})),Go(t)}))}},{key:\"_diffAndDeleteConversation\",value:function(){var e=this;if(this._isSyncCompleted()){var t=[];this._conversationMap.forEach((function(n,o){!e._pagingConvIDMap.has(o)&&e._convIDFromUnreadDBMap.has(o)&&(e._conversationMap.delete(o),t.push(o))})),Je.l(\"\".concat(this._n,\"._diffAndDeleteConversation list:\").concat(t)),t=null}}},{key:\"_pagingGetConversationList\",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=\"\".concat(this._n,\"._pagingGetConversationList\");Je.l(\"\".concat(n,\" incrementalPullFlag:\").concat(t,\" timeStamp:\").concat(this._pagingTimeStamp,\" startIndex:\").concat(this._pagingStartIndex)+\" pinnedTimeStamp:\".concat(this._pagingPinnedTimeStamp,\" pinnedStartIndex:\").concat(this._pagingPinnedStartIndex));var o=Date.now();return this._pagingStatus=vn.PENDING,this.request({protocolName:Uo.PAGING_GET_CONVERSATION_LIST,requestData:{fromAccount:this.getMyUserID(),timeStamp:t?this._pagingTimeStamp:0,startIndex:t?this._pagingStartIndex:0,pinnedTimeStamp:t?this._pagingPinnedTimeStamp:0,pinnedStartIndex:t?this._pagingPinnedStartIndex:0,orderType:1}}).then((function(t){var a=t.data,i=a.completeFlag,s=a.conversations,r=void 0===s?[]:s,c=a.timeStamp,u=a.startIndex,l=a.pinnedTimeStamp,d=a.pinnedStartIndex,p=a.groupItem;if(e._pagingGetCostList.push(un(o,!1)),Je.l(\"\".concat(n,\" ok. completeFlag:\").concat(i,\" count:\").concat(r.length,\" cost:\").concat(un(o))),e._convGroupHandler.onConvGroupListSynced(p),r.length>0){var _=e._getConversationOptions(r);e._pagingConvIDMap=new Map([].concat(m(e._pagingConvIDMap),m(_.map((function(e){return[e.conversationID,1]}))))),e._updateLocalConversationList({conversationOptionsList:_,isFromGetConversations:!0,updateUnreadCount:!0}),e.isLoggedIn()&&e.emitConversationUpdate()}if(!e._isReady){if(!e.isLoggedIn())return Oo();e.triggerReady()}return e._pagingTimeStamp=c,e._pagingStartIndex=u,e._pagingPinnedTimeStamp=l,e._pagingPinnedStartIndex=d,1!==i?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),Oo())})).catch((function(t){throw e.isLoggedIn()&&(e._isReady||(Je.w(\"\".concat(n,\" failed. error:\"),t),e.triggerReady())),t}))}},{key:\"_updateLocalConversationList\",value:function(e){var t,n=e.isFromGetConversations,o=e.isInstantMessage,a=Date.now();t=this._getTmpConversationListMapping(e),this._conversationMap=new Map(this._sortConversationList([].concat(m(t.toBeUpdatedConversationList),m(this._conversationMap)))),n||(this._updateUserOrGroupProfile(t.newConversationList),o&&this.emitTotalUnreadMessageCountUpdate()),Je.l(\"\".concat(this._n,\"._updateLocalConversationList cost:\").concat(un(a)))}},{key:\"_getTmpConversationListMapping\",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,a=e.isUnreadC2CMessage,i=void 0!==a&&a,s=e.updateUnreadCount,r=[],c=[],u=this.getModule(to),l=this.getModule(no),d=this.isIntl(),p=this.isUsingChatCore(),_=0,g=t.length;_0&&a.getUserProfile({userIDList:n}).then((function(e){var n=e.data;vt(n)?n.forEach((function(e){t._doUpdateUserProfile(\"C2C\".concat(e.userID),e)})):t._doUpdateUserProfile(\"C2C\".concat(n.userID),n)})),o.length>0&&i.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\",\"FaceUrl\"]}}).then((function(e){e.data.successGroupList.forEach((function(e){var n=\"GROUP\".concat(e.groupID);if(t._conversationMap.has(n)){var o=t._conversationMap.get(n);Et(o.groupProfile,e,[],[null,void 0,\"\",0,NaN]),!o.subType&&e.type&&(o.subType=e.type)}}))}))}}},{key:\"_doUpdateUserProfile\",value:function(e,t){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=t)}},{key:\"_getConversationOptions\",value:function(e){var n=this,o=[],a=e.filter((function(e){var t=e.type,o=e.userID;return 1===t&&!n._isNonExistentAccount(o)||2===t})),i=this.getMyUserID(),s=a.map((function(e){if(mt(e.lastMsg)&&(e.lastMsg={elements:[]}),1===e.type){var a={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar};return o.push(a),{conversationID:\"C2C\".concat(e.userID),type:\"C2C\",lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?n._amendLayersOverLimitProperty(e.lastMsg.elements[0].content):null,cloudCustomData:e.lastMsg.cloudCustomData||\"\",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:\"\",nameCard:\"\",version:0,isPeerRead:e.lastC2CMsgFromAccount===i&&e.time<=e.c2cPeerReadTime,revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null},userProfile:new Ca(a),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,customData:e.customMark||\"\",markList:nn(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId),remark:e.friendRemark||\"\",messageRemindType:n._transMessageRemindType(e.messageRemindType)}}return{conversationID:\"GROUP\".concat(e.groupID),type:\"GROUP\",lastMessage:t(t({lastTime:e.time,lastSequence:e.sequence,fromAccount:e.msgGroupFromAccount},n._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||\"\",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||\"\",nameCard:e.senderNameCard||\"\",revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null}),groupProfile:new Na({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage,type:e.groupType,nextMessageSeq:e.nextMessageSeq}),unreadCount:n._computeGroupUnreadCount(e),peerReadTime:0,isPinned:1===e.isPinned,version:0,customData:e.customMark||\"\",markList:nn(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId),messageRemindType:n._transMessageRemindType(e.messageRemindType)}}));o.length>0&&this.getModule($n).onConversationsProfileUpdated(o);return s}},{key:\"_transMessageRemindType\",value:function(e){var t=\"\";return 0===e?t=S.MSG_REMIND_ACPT_AND_NOTE:1===e?t=S.MSG_REMIND_DISCARD:2===e&&(t=S.MSG_REMIND_ACPT_NOT_NOTE),t}},{key:\"_computeGroupUnreadCount\",value:function(e){var t=e.unreadCount,n=void 0===t?0:t,o=e.noUnreadCount,a=n-(void 0===o?0:o);return a>0?a:0}},{key:\"_patchTypeAndPayload\",value:function(e){var n=e.lastMsg,o=n.event,a=void 0===o?void 0:o,i=n.elements,s=void 0===i?[]:i,r=n.groupTips,c=void 0===r?{}:r;if(!mt(a)&&!pn(c)){var u=new pa(c);u.setElement({type:S.MSG_GRP_TIP,content:t(t({},c.elements),{},{groupProfile:c.groupProfile})});var l=JSON.parse(JSON.stringify(u.payload));return u=null,{type:S.MSG_GRP_TIP,payload:l}}return{type:s[0]?s[0].type:null,payload:s[0]?this._amendLayersOverLimitProperty(s[0].content):null}}},{key:\"_amendLayersOverLimitProperty\",value:function(e){var t=e.layersOverLimit;return 0===t?e.layersOverLimit=!1:1===t&&(e.layersOverLimit=!0),e}},{key:\"getLocalMessageList\",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:\"deleteLocalMessage\",value:function(e){e instanceof pa&&this._messageListHandler.remove(e)}},{key:\"onConversationDeleted\",value:function(e){if(vt(e)){var t=e.map((function(e){var t=e.type,n=e.userID,o=e.groupID;return 1===t?\"\".concat(S.CONV_C2C).concat(n):2===t?\"\".concat(S.CONV_GROUP).concat(o):void 0}));Je.l(\"\".concat(this._n,\".onConversationDeleted conversationIDList:\").concat(t)),this.deleteLocalConversationList(t)}}},{key:\"onConversationPinned\",value:function(e){var t=this;if(vt(e)){var n=!1;e.forEach((function(e){var o,a=e.type,i=e.userID,s=e.groupID;1===a?o=t.getLocalConversation(\"\".concat(S.CONV_C2C).concat(i)):2===a&&(o=t.getLocalConversation(\"\".concat(S.CONV_GROUP).concat(s))),o&&(Je.l(\"\".concat(t._n,\".onConversationPinned conversationID:\").concat(o.conversationID,\" isPinned:\").concat(o.isPinned)),o.isPinned||(o.isPinned=!0,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:\"onConversationUnpinned\",value:function(e){var t=this;if(vt(e)){var n=!1;e.forEach((function(e){var o,a=e.type,i=e.userID,s=e.groupID;1===a?o=t.getLocalConversation(\"\".concat(S.CONV_C2C).concat(i)):2===a&&(o=t.getLocalConversation(\"\".concat(S.CONV_GROUP).concat(s))),o&&(Je.l(\"\".concat(t._n,\".onConversationUnpinned conversationID:\").concat(o.conversationID,\" isPinned:\").concat(o.isPinned)),o.isPinned&&(o.isPinned=!1,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:\"getMessageList\",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,a=e.count,i=\"\".concat(this._n,\".getMessageList\"),s=this.getLocalConversation(n),r=\"\";if(s&&s.groupProfile&&(r=s.groupProfile.type),bt(r))return Je.l(\"\".concat(i,\" not available in avchatroom. conversationID:\").concat(n)),Oo({messageList:[],nextReqMessageID:\"\",isCompleted:!0});(mt(a)||a>15)&&(a=15),!o&&this._isNotInCommunity(n)&&(this._messageListHandler.removeByConversationID(n),this._completedMap.delete(n),this._roamingMessageSequenceMap.delete(n));var c=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),u=this._completedMap.has(n);if(Je.l(\"\".concat(i,\" conversationID:\").concat(n,\" nextReqMessageID:\").concat(o)+\" remainingCount:\".concat(c,\" count:\").concat(a,\" isCompleted:\").concat(u)),this._needGetHistory({conversationID:n,remainingCount:c,count:a}))return this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,a=e.storedMessageList,s=t._completedMap.has(n),r=a;c>0&&(r=t._messageListHandler.getLocalMessageList(n).slice(0,a.length+c));var u={nextReqMessageID:s?\"\":o,messageList:r,isCompleted:s},l=u.messageList.filter((function(e){return e.isRevoked}))||[],d=r.map((function(e){return e.sequence}));return Je.l(\"\".concat(i,\" ret.nextReqMessageID:\").concat(u.nextReqMessageID,\" ret.isCompleted:\").concat(u.isCompleted,\" ret.length:\").concat(r.length,\" sequenceList:\").concat(d)),vt(l)&&0!==l.length?t.updateRevokerInfo(l).then((function(e){return e.forEach((function(e){var t=e.revokerInfo;u.messageList=u.messageList.map((function(n){return n.ID===e.ID&&t&&(n.revokeReason=t.reason||\"\",n.revokerInfo={userID:t.revoker||n.revoker,nick:t.nick,avatar:t.avatar}),n}))})),No(u)})):No(u)}));this.modifyMessageList(n);var l=this._getMessageListFromMemory({conversationID:n,nextReqMessageID:o,count:a});return Oo(l)}},{key:\"_getMessageListFromMemory\",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=e.count,a=\"\".concat(this._n,\"._getMessageListFromMemory\"),i=this._messageListHandler.getLocalMessageList(t),s=i.length,r=0,c={isCompleted:!1,nextReqMessageID:\"\",messageList:[]};return n?(r=i.findIndex((function(e){return e.ID===n})))>o?(c.messageList=i.slice(r-o,r),c.nextReqMessageID=i[r-o].ID):(c.messageList=i.slice(0,r),c.isCompleted=!0):s>o?(r=s-o,c.messageList=i.slice(r,s),c.nextReqMessageID=i[r].ID):(c.messageList=i.slice(0,s),c.isCompleted=!0),Je.l(\"\".concat(a,\" conversationID:\").concat(t)+\" ret.nextReqMessageID:\".concat(c.nextReqMessageID,\" ret.isCompleted:\").concat(c.isCompleted,\" ret.length:\").concat(c.messageList.length)),c}},{key:\"getMessageListHopping\",value:function(e){var t=e.conversationID,n=e.sequence,o=e.time,a=e.count,i=e.direction,s=void 0===i?0:i;if((mt(a)||a>15)&&(a=15),t.startsWith(S.CONV_C2C)){var r=this.getModule(eo),c=t.replace(S.CONV_C2C,\"\");return r.getRoamingMessagesHopping({peerAccount:c,time:o,count:a,direction:s})}if(t.startsWith(S.CONV_GROUP)){var u=this.getModule(to),l=t.replace(S.CONV_GROUP,\"\");return u.getRoamingMessagesHopping({groupID:l,sequence:n,count:a,direction:s})}}},{key:\"_computeRemainingCount\",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=this._messageListHandler.getLocalMessageList(t),a=o.length;if(!n)return a;var i=0;return qt(t)?i=o.findIndex((function(e){return e.ID===n})):xt(t)&&(i=-1!==n.indexOf(\"-\")?o.findIndex((function(e){return e.ID===n})):o.findIndex((function(e){return e.sequence===n}))),-1===i&&(i=0),i}},{key:\"_getMessageListSize\",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:\"_needGetHistory\",value:function(e){var t=e.conversationID,n=e.remainingCount,o=e.count,a=this.getLocalConversation(t),i=\"\";if(a&&a.groupProfile&&(i=a.groupProfile.type),Vt(t)||bt(i))return!1;var s=!1,r=\"\".concat(this._n,\"._needGetHistory conversationID:\").concat(t);if(xt(t)){var c=this._isPagingGetGroupListCompleted(),u=this._getLocalGroupCount(),l=this._hasLocalGroup(t),d=this._isTopicConversation(t);if(Je.l(\"\".concat(r,\" isGroupListCompleted:\").concat(c,\" localGroupCount:\").concat(u)+\" isGroupInList:\".concat(l,\" isTopic:\").concat(d)),c&&u<=500&&!l&&!d)return s}return s=n<=o&&!this._completedMap.has(t),Je.l(\"\".concat(r,\" ret:\").concat(s)),s}},{key:\"_isTopicConversation\",value:function(e){var t=e.replace(S.CONV_GROUP,\"\");return Ft(t)}},{key:\"getHistoryMessages\",value:function(e){var t=e.conversationID,n=e.count;if(t===S.CONV_SYSTEM)return Oo();var o=15;n>20&&(o=20);var a=null;if(qt(t)){var i=this._roamingMessageKeyAndTimeMap.has(t);return(a=this.getModule(eo))?a.getRoamingMessage({conversationID:t,peerAccount:t.replace(S.CONV_C2C,\"\"),count:o,lastMessageTime:i?this._roamingMessageKeyAndTimeMap.get(t).lastMessageTime:0,messageKey:i?this._roamingMessageKeyAndTimeMap.get(t).messageKey:\"\"}):Go({code:Ao.CANNOT_FIND_MODULE})}if(xt(t)){if(!(a=this.getModule(to)))return Go({code:Ao.CANNOT_FIND_MODULE});var s=t.replace(S.CONV_GROUP,\"\"),r=null;this._conversationMap.has(t)&&!Ft(s)&&(r=this._conversationMap.get(t).lastMessage);var c=0;r&&(c=r.lastSequence);var u=this._roamingMessageSequenceMap.get(t);return a.getRoamingMessage({conversationID:t,groupID:s,count:o,sequence:u||c})}return Oo()}},{key:\"patchConversationLastMessage\",value:function(e){var t=this.getLocalConversation(e);if(t){var n=t.lastMessage,o=n.messageForShow,a=n.payload;if(pn(o)||pn(a)){var i=this._messageListHandler.getLocalMessageList(e);if(0===i.length)return;var s=i[i.length-1];Je.l(\"\".concat(this._n,\".patchConversationLastMessage conversationID:\").concat(e,\" payload:\"),s.payload),t.updateLastMessage(s)}}}},{key:\"onRoamingMessage\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],a=n.startsWith(S.CONV_C2C)?S.CONV_C2C:S.CONV_GROUP,i=null,s=[],r=[],c=0,u=e.length,l=null,d=a===S.CONV_GROUP,p=this.getFileDownloadProxy(),_=function(){c=d?e.length-1:0,u=d?0:e.length},g=function(){d?--c:++c},h=function(){return d?c>=u:c0&&void 0!==arguments[0]?arguments[0]:{},n=\"setAllMessageRead\",o=\"\".concat(this._n,\".\").concat(n);t.scope||(t.scope=S.READ_ALL_MSG),Je.l(\"\".concat(o,\" options:\"),t);var a=this._createSetAllMessageReadPack(t);if(0===a.readAllC2CMessage&&0===a.groupMessageReadInfoList.length)return Oo();var i=new Xo(n);return this.request({protocolName:Uo.SET_ALL_MESSAGE_READ,requestData:a}).then((function(n){var o=n.data,a=e._handleAllMessageRead(o);return i.setMessage(\"scope:\".concat(t.scope,\" failureGroups:\").concat(JSON.stringify(a))).setNetworkType(e.getNetworkType()).end(),Oo()})).catch((function(t){return e.probeNetwork().then((function(e){var n=v(e,2),o=n[0],a=n[1];i.setError(t,o,a).end()})),Je.w(\"\".concat(o,\" failed. error:\"),t),Go({code:t&&t.code?t.code:Ao.MSG_UNREAD_ALL_FAIL,message:t&&t.message?t.message:void 0})}))}},{key:\"setConversationCustomData\",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:\"markConversation\",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:\"getConversationGroupList\",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:\"createConversationGroup\",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:\"deleteConversationGroup\",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:\"renameConversationGroup\",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:\"addConversationsToGroup\",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:\"deleteConversationsFromGroup\",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:\"onConversationMarkUpdated\",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:\"onConversationGroupCreated\",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:\"onConversationGroupDeleted\",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:\"onConversationGroupNameUpdated\",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:\"onConversationInGroupUpdated\",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:\"onConversationAddedToOrDeletedFromGroup\",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:\"_getConversationLastMessageSequence\",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastSequence;return t&&n0)if(i.type===S.CONV_C2C&&0===n.readAllC2CMessage){if(o===S.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===S.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else if(i.type===S.CONV_GROUP&&(o===S.READ_ALL_GROUP_MSG||o===S.READ_ALL_MSG)){var s=this._getConversationLastMessageSequence(i);n.groupMessageReadInfoList.push({groupID:i.groupProfile.groupID,messageSequence:s})}}}catch(r){a.e(r)}finally{a.f()}return n}},{key:\"onPushedAllMessageRead\",value:function(e){this._handleAllMessageRead(e)}},{key:\"_handleAllMessageRead\",value:function(e){var t=e.groupMessageReadInfoList,n=e.readAllC2CMessage,o=this._parseGroupReadInfo(t);return this._updateAllConversationUnreadCount({readAllC2CMessage:n})>=1&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate()),o}},{key:\"_parseGroupReadInfo\",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n=1){if(1===n&&r.type===S.CONV_C2C){var c=this._getConversationLastMessageTime(r);this.updateIsReadAfterReadReport({conversationID:s,lastMessageTime:c})}else if(r.type===S.CONV_GROUP){var u=s.replace(S.CONV_GROUP,\"\");if(this._remoteGroupReadSequenceMap.has(u)){var l=this._remoteGroupReadSequenceMap.get(u),d=this._getConversationLastMessageSequence(r);this.updateIsReadAfterReadReport({conversationID:s,remoteReadSequence:l}),d>=l&&this._remoteGroupReadSequenceMap.delete(u)}}this.updateUnreadCount(s,!1)&&(o+=1)}}}catch(p){a.e(p)}finally{a.f()}return o}},{key:\"isRemoteRead\",value:function(e){var t=e.conversationID,n=e.sequence,o=t.replace(S.CONV_GROUP,\"\"),a=!1;if(this._remoteGroupReadSequenceMap.has(o)){var i=this._remoteGroupReadSequenceMap.get(o);n<=i&&(a=!0,Je.l(\"\".concat(this._n,\".isRemoteRead conversationID:\").concat(t,\" messageSequence:\").concat(n,\" remoteReadSequence:\").concat(i))),n>=i+10&&this._remoteGroupReadSequenceMap.delete(o)}return a}},{key:\"updateIsReadAfterReadReport\",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,a=this._messageListHandler.getLocalMessageList(t);if(0!==a.length)for(var i,s=a.length-1;s>=0;s--)if(i=a[s],!(o&&i.time>o||n&&i.sequence>n)){if(\"in\"===i.flow&&i.isRead)break;i.setIsRead(!0)}}},{key:\"updateUnreadCount\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!1,o=this.getLocalConversation(e),a=this._messageListHandler.getLocalMessageList(e);if(o){var i=o.unreadCount,s=a.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length;if(i!==s&&(o.unreadCount=s,n=!0,Je.l(\"\".concat(this._n,\".updateUnreadCount from \").concat(i,\" to \").concat(s,\", conversationID:\").concat(e)),!0===t&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())),n&&o.type===S.CONV_TOPIC){var r=o.unreadCount,c=this.getModule(oo),u=e.replace(S.CONV_GROUP,\"\");c.onConversationProxy({topicID:u,unreadCount:r})}return n}}},{key:\"clearGroupAtInfoList\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversation(e);if(n&&n.groupAtInfoList.length>0){if(n.clearGroupAtInfoList(),Je.l(\"\".concat(this._n,\".clearGroupAtInfoList conversationID:\").concat(e)),n.type===S.CONV_TOPIC){var o=n.groupAtInfoList,a=this.getModule(oo),i=e.replace(S.CONV_GROUP,\"\");a.onConversationProxy({topicID:i,groupAtInfoList:o})}!0===t&&this.emitConversationUpdate(!0,!1)}}},{key:\"updateReadReceiptInfo\",value:function(e){var t=this,n=e.userID,o=void 0===n?void 0:n,a=e.groupID,i=void 0===a?void 0:a,s=e.readReceiptList;if(!pn(s)){var r=[];if(mt(o)){if(!mt(i)){var c=\"\".concat(S.CONV_GROUP).concat(i);s.forEach((function(e){var n=e.tinyID,o=e.clientTime,a=e.random,s=e.readCount,u=e.unreadCount,l=\"\".concat(n,\"-\").concat(o,\"-\").concat(a),d=t._messageListHandler.getLocalMessage(c,l),p={groupID:i,messageID:l,readCount:0,unreadCount:0};d&&(_t(s)&&(d.readReceiptInfo.readCount=s,p.readCount=s),_t(u)&&(d.readReceiptInfo.unreadCount=u,p.unreadCount=u),r.push(p))}))}}else{var u=\"\".concat(S.CONV_C2C).concat(o);s.forEach((function(e){var n=e.tinyID,a=e.clientTime,i=e.random,s=\"\".concat(n,\"-\").concat(a,\"-\").concat(i),c=t._messageListHandler.getLocalMessage(u,s);if(c){c.readReceiptInfo.isPeerRead=!0;var l={userID:o,messageID:s,isPeerRead:!0};r.push(l)}}))}r.length>0&&this.emitOuterEvent(E.MESSAGE_READ_RECEIPT_RECEIVED,r)}}},{key:\"updateIsRead\",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!Vt(t.type)){for(var o=[],a=0,i=n.length;a0){var n=this._messageListHandler.updateMessageIsPeerReadProperty(e,t);if(n.length>0&&this.emitOuterEvent(E.MESSAGE_READ_BY_PEER,n),this._conversationMap.has(e)){var o=this._conversationMap.get(e).lastMessage;pn(o)||o.fromAccount===this.getMyUserID()&&o.lastTime<=t&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:\"updateMessageIsModifiedProperty\",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:\"setCompleted\",value:function(e){Je.l(\"\".concat(this._n,\".setCompleted. conversationID:\").concat(e)),this._completedMap.set(e,!0)}},{key:\"updateRoamingMessageKeyAndTime\",value:function(e,t,n){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:\"updateRoamingMessageSequence\",value:function(e,t){this._roamingMessageSequenceMap.set(e,t)}},{key:\"getConversationList\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getConversationList\"),o=\"pagingStatus:\".concat(this._pagingStatus,\", local conversation count:\").concat(this._conversationMap.size,\", options:\").concat(e);if(Je.l(\"\".concat(n,\". \").concat(o)),this._pagingStatus===vn.REJECTED){var a=new Xo(\"getConversationList\");return a.setMessage(o),this.syncConversationList().then((function(){a.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return No({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}var i=this._getConversationList(e);return Je.l(\"\".concat(n,\". returned conversation count:\").concat(i.length)),Oo({conversationList:i,isSyncCompleted:this._isSyncCompleted()})}},{key:\"_getConversationList\",value:function(e){if(mt(e))return this.getLocalConversationList();if(vt(e))return 0===e.length?[]:this.getLocalConversationList().filter((function(t){return e.includes(t.conversationID)}));if(ft(e)){var t=e.type,n=e.markType,o=e.groupName;return this.getLocalConversationList().filter((function(e){return(t!==S.CONV_C2C&&t!==S.CONV_GROUP||e.type===t)&&(!gt(o)||e.conversationGroupList.includes(o))&&(!_t(n)||e.markList.includes(n))}))}return[]}},{key:\"_handleC2CPeerReadTime\",value:function(){var e,t=D(this._conversationMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],a=n[1];a.type===S.CONV_C2C&&(Je.d(\"\".concat(this._n,\"._handleC2CPeerReadTime conversationID:\").concat(o,\" peerReadTime:\").concat(a.peerReadTime)),this.recordPeerReadTime(o,a.peerReadTime))}}catch(i){t.e(i)}finally{t.f()}}},{key:\"_isPagingGetGroupListCompleted\",value:function(){var e=this.getModule(to);return!e||e.isPagingGetCompleted()}},{key:\"_getLocalGroupCount\",value:function(){var e=this.getModule(to);return e?e.getLocalGroupList().length:0}},{key:\"_hasLocalGroup\",value:function(e){var t=this.getModule(to);return!!t&&t.hasLocalGroup(e.replace(S.CONV_GROUP,\"\"))}},{key:\"getConversationProfile\",value:function(e){var t,n=this;if((t=this._conversationMap.has(e)?this._conversationMap.get(e):new Aa({conversationID:e,type:e.slice(0,3)===S.CONV_C2C?S.CONV_C2C:S.CONV_GROUP},this.isIntl(),this.isUsingChatCore()))._isInfoCompleted||t.type===S.CONV_SYSTEM)return Oo({conversation:t});if(xt(e)&&!this._hasLocalGroup(e))return Oo({conversation:t});var o=\"\".concat(this._n,\".\").concat(\"getConversationProfile\"),a=new Xo(\"getConversationProfile\");return Je.l(\"\".concat(o,\". conversationID:\").concat(e,\" remark:\").concat(t.remark,\" lastMessage:\"),t.lastMessage),this._updateUserOrGroupProfileCompletely(t).then((function(i){a.setNetworkType(n.getNetworkType()).setMessage(\"conversationID:\".concat(e,\" unreadCount:\").concat(i.data.conversation.unreadCount)).end();var s=n.getModule(no);if(s&&t.type===S.CONV_C2C){var r=e.replace(S.CONV_C2C,\"\");if(s.isMyFriend(r)){var c=s.getFriendRemark(r);t.remark!==c&&(t.remark=c,Je.l(\"\".concat(o,\". conversationID:\").concat(e,\" patch remark:\").concat(t.remark)))}}return Je.l(\"\".concat(o,\" ok. conversationID:\").concat(e)),i})).catch((function(t){return n.probeNetwork().then((function(n){var o=v(n,2),i=o[0],s=o[1];a.setError(t,i,s).setMessage(\"conversationID:\".concat(e)).end()})),Je.e(\"\".concat(o,\" failed. error:\"),t),Go(t)}))}},{key:\"_updateUserOrGroupProfileCompletely\",value:function(e){var t=this;return e.type===S.CONV_C2C?this.getModule($n).getUserProfile({userIDList:[e.toAccount]}).then((function(n){var o=n.data;return 0===o.length?Go(new ko({code:Ao.USER_OR_GRP_NOT_FOUND})):(e.userProfile=o[0],e._isInfoCompleted=!0,t._unshiftConversation(e),Oo({conversation:e}))})):this.getModule(to).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._unshiftConversation(e),Oo({conversation:e})}))}},{key:\"_unshiftConversation\",value:function(e){e instanceof Aa&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(m(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:\"_onProfileUpdated\",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;if(n===t.getMyUserID())t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar});else{var o=t._conversationMap.get(\"\".concat(S.CONV_C2C).concat(n));o&&(o.userProfile=e)}}))}},{key:\"_isSyncCompleted\",value:function(){return this._pagingStatus===vn.RESOLVED}},{key:\"_errorLog\",value:function(e,t,n,o){var a=new Error(\"Params validate failed.\"),i=\"\".concat(this.getErrorMessage(\"API_REFER\")).concat(e);throw Je.w(\"[\".concat(e,\"] | \").concat(t,\" | \").concat(this.getErrorMessage(n,o),\", \").concat(i)),Je.e(\"[\".concat(e,\"] Invalid \").concat(t,\": type check failed for \").concat(t,\".\")),a}},{key:\"_isValidConversationID\",value:function(e){return qt(e)||xt(e)||Vt(e)}},{key:\"deleteConversation\",value:function(e){var t=this,n=\"deleteConversation\";return gt(e)||ht(e)||this._errorLog(n,\"options\",\"StringOrObjectRequiredLog\"),gt(e)?(this._isValidConversationID(e)||this._errorLog(n,\"options\",\"InvalidConversationID\",e),Je.l(\"\".concat(this._n,\".\").concat(n,\" conversationID:\").concat(e)),this.deleteConversationList({conversationIDList:[e],flag:1})):(vt(e.conversationIDList)||this._errorLog(n,\"conversationIDList\",\"ArrayRequiredLog\"),0===e.conversationIDList.length&&this._errorLog(n,\"conversationIDList\",\"NonEmptyArrayLog\"),e.conversationIDList.forEach((function(e){t._isValidConversationID(e)||t._errorLog(n,\"conversationIDList\",\"InvalidConversationID\",e)})),\"clearHistoryMessage\"in e&&\"boolean\"!=typeof e.clearHistoryMessage&&this._errorLog(n,\"clearHistoryMessage\",\"BooleanRequiredLog\"),e.conversationIDList.length>100&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConversationList(e))}},{key:\"deleteConversationList\",value:function(e){var t=this,n=e.conversationIDList,o=void 0===n?[]:n,a=e.clearHistoryMessage,i=void 0===a||a,s=e.flag,r=void 0===s?0:s,c=\"\".concat(this._n,\".\").concat(\"deleteConversationList\");Je.l(\"\".concat(c,\" conversationIDList.length:\").concat(o.length,\" clearHistoryMessage:\").concat(i));var u=new Xo(\"deleteConversationList\");return u.setMessage(\"conversationIDList:\".concat(o)),Promise.all([this.rmLocalOnlyConversationList(o),this.rmLocalAndRemoteConversationList(o,i)]).then((function(e){u.setNetworkType(t.getNetworkType()).end();var n=[].concat(m(e[0]),m(e[1]));return 0===n.length?Go(new ko({code:Ao.CONV_NOT_FOUND})):(Je.l(\"\".concat(c,\" ok\")),Oo(1===r?{conversationID:n[0]}:{conversationIDList:n}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(c,\" failed. error:\"),e),Go(e)}))}},{key:\"rmLocalOnlyConversationList\",value:function(e){var t=this;return e.filter((function(e){if(!t._conversationMap.has(e))return!1;var n=t.getLocalConversation(e).type;return n!==S.CONV_GROUP||t._hasLocalGroup(e)?n===S.CONV_SYSTEM&&(t.getModule(to).deleteGroupSystemNotice({messageList:t._messageListHandler.getLocalMessageList(e)}),t.deleteLocalConversation(e),!0):(t.deleteLocalConversation(e),!0)}))}},{key:\"rmLocalAndRemoteConversationList\",value:function(e,t){var n=this,o={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:t?1:0};return e.forEach((function(e){if(n._conversationMap.has(e)){var t=n.getLocalConversation(e).type;t===S.CONV_C2C?o.conversationList.push({toAccount:e.replace(t,\"\"),type:1}):t===S.CONV_GROUP&&n._hasLocalGroup(e)&&o.conversationList.push({toGroupID:e.replace(t,\"\"),type:2})}})),0===o.conversationList.length?[]:this.request({protocolName:Uo.DELETE_CONVERSATION,requestData:o}).then((function(e){var t=[];return e.data.resultList.length>0&&e.data.resultList.map((function(e){if(0===e.code){var n=1===e.type?\"\".concat(S.CONV_C2C).concat(e.to):\"\".concat(S.CONV_GROUP).concat(e.groupID);t.push(n)}})),n.deleteLocalConversationList(t),t}))}},{key:\"setConversationDraft\",value:function(e){var t=e.conversationID,n=e.draftText,o=\"\".concat(this._n,\".\").concat(\"setConversationDraft\");if(Je.l(\"\".concat(o,\" conversationID:\").concat(t,\" draftText:\").concat(n)),!this._conversationMap.has(t))return Go({code:Ao.CONV_NOT_FOUND});var a=this._conversationMap.get(t);return a.setDraftText(n),Oo({code:0,conversation:a})}},{key:\"clearHistoryMessage\",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e))return Go({code:Ao.CONV_NOT_FOUND});var o=this._conversationMap.get(e).type;if(o===S.CONV_C2C)n.type=1,n.toAccount=e.replace(S.CONV_C2C,\"\");else{if(o!==S.CONV_GROUP)return o===S.CONV_SYSTEM?(this.getModule(to).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),Oo({conversationID:e})):Go({code:Ao.CONV_UN_RECORDED_TYPE});n.type=2,n.toGroupID=e.replace(S.CONV_GROUP,\"\")}var a=\"\".concat(this._n,\".\").concat(\"clearHistoryMessage\"),i=new Xo(\"clearHistoryMessage\");return i.setMessage(\"conversationID:\".concat(e)),Je.l(\"\".concat(a,\". conversationID:\").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.request({protocolName:Uo.CLEAR_HISTORY_MESSAGE,requestData:n})})).then((function(){i.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(a,\" ok\")),t._messageListHandler.removeByConversationID(e),t.setCompleted(e);var n=t.getLocalConversation(e);return n&&(n.updateLastMessage(),t._sortConversationListAndEmitEvent()),Oo({conversationID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e(\"\".concat(a,\" failed. error:\"),e),Go(e)}))}},{key:\"pinConversation\",value:function(e){var t=this,n=e.conversationID,o=e.isPinned;if(!this._conversationMap.has(n))return Go({code:Ao.CONV_NOT_FOUND});var a=this.getLocalConversation(n);if(a.isPinned===o)return Oo({conversationID:n});var i=\"\".concat(this._n,\".\").concat(\"pinConversation\"),s=new Xo(\"pinConversation\");s.setMessage(\"conversationID:\".concat(n,\" isPinned:\").concat(o)),Je.l(\"\".concat(i,\". conversationID:\").concat(n,\" isPinned:\").concat(o));var r=null;return qt(n)?r={type:1,toAccount:n.replace(S.CONV_C2C,\"\")}:xt(n)&&(r={type:2,groupID:n.replace(S.CONV_GROUP,\"\")}),this.request({protocolName:Uo.PIN_CONVERSATION,requestData:{fromAccount:this.getMyUserID(),operationType:!0===o?1:2,itemList:[r]}}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(i,\" ok\")),a.isPinned!==o&&(a.isPinned=o,t._sortConversationListAndEmitEvent()),No({conversationID:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e(\"\".concat(i,\" failed. error:\"),e),Go(e)}))}},{key:\"setMessageRemindType\",value:function(e){return this._messageRemindHandler.set(e)}},{key:\"patchMessageRemindType\",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,a=!1,i=this.getLocalConversation(n?\"\".concat(S.CONV_C2C).concat(t):\"\".concat(S.CONV_GROUP).concat(t));return i&&i.messageRemindType!==o&&(i.messageRemindType=o,a=!0),Je.d(\"\".concat(this._n,\".patchMessageRemindType options:\"),e,\"ret:\".concat(a)),a}},{key:\"onC2CMessageRemindTypeFetched\",value:function(e){var t=this;if(vt(e)&&e.length>0){var n=0;e.forEach((function(e){var o=e.userID,a=e.muteFlag,i=t._transMessageRemindType(a);!0===t.patchMessageRemindType({ID:o,isC2CConversation:!0,messageRemindType:i})&&(n+=1)})),Je.l(\"\".concat(this._n,\".onC2CMessageRemindTypeFetched updateCount:\").concat(n)),n>=1&&this.emitConversationUpdate(!0,!1)}}},{key:\"onC2CMessageRemindTypeSynced\",value:function(e){var t=this,n=\"\".concat(this._n,\".onC2CMessageRemindTypeSynced\");Je.d(n,e),e.dataList.forEach((function(e){if(!pn(e.muteNotificationsSync)){var o=e.muteNotificationsSync,a=o.to,i=o.muteFlag,s=t._transMessageRemindType(i),r=0;t.patchMessageRemindType({ID:a,isC2CConversation:!0,messageRemindType:s})&&(r+=1),Je.l(\"\".concat(n,\" updateCount:\").concat(r)),r>=1&&t.emitConversationUpdate(!0,!1)}}))}},{key:\"onGroupMessageRemindTypeUpdated\",value:function(e){Je.d(\"\".concat(this._n,\".onGroupMessageRemindTypeUpdated options:\"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:\"deleteLocalConversation\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._conversationMap.has(e);if(Je.d(\"\".concat(this._n,\".deleteLocalConversation conversationID:\").concat(e,\" has:\").concat(n)),n&&(this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e),t)){var o=!this._isTopicConversation(e);this.emitConversationUpdate(o,!1)}}},{key:\"deleteLocalConversationList\",value:function(e){var t=this,n=0,o=!1;e.forEach((function(e){t._conversationMap.has(e)&&(n+=t._conversationMap.get(e).unreadCount||0,t.deleteLocalConversation(e,!1),o=!0)})),Je.l(\"\".concat(this._n,\".deleteLocalConversationList conversationIDList.length:\").concat(e.length,\" isConvIDExisted:\").concat(o)),o&&(this.emitConversationUpdate(!0,!1),n>0&&this.emitTotalUnreadMessageCountUpdate())}},{key:\"isMessageSentByCurrentInstance\",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:\"modifyMessageList\",value:function(e){if(e.startsWith(S.CONV_C2C)&&this._conversationMap.has(e)){var t=this._conversationMap.get(e),n=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:t.userProfile.nick,latestAvatar:t.userProfile.avatar});var o=this.getModule($n).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),Je.l(\"\".concat(this._n,\".modifyMessageList conversationID:\").concat(e,\" cost:\").concat(un(n)))}}},{key:\"updateUserProfileSpecifiedKey\",value:function(e){Je.l(\"\".concat(this._n,\".updateUserProfileSpecifiedKey options:\"),e);var t=e.conversationID,n=e.nick,o=e.avatar;if(this._conversationMap.has(t)){var a=this._conversationMap.get(t).userProfile;gt(n)&&a.nick!==n&&(a.nick=n),gt(o)&&a.avatar!==o&&(a.avatar=o),this.emitConversationUpdate(!0,!1)}}},{key:\"_onMyProfileModified\",value:function(e){var n=this,o=this.getLocalConversationList(),a=Date.now();o.forEach((function(o){n.modifyMessageSentByMe(t({conversationID:o.conversationID},e))})),Je.l(\"\".concat(this._n,\"._onMyProfileModified. modify all messages sent by me, cost:\").concat(un(a)))}},{key:\"modifyMessageSentByMe\",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:\"getLatestMessageSentByMe\",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:\"modifyMessageSentByPeer\",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:\"getLatestMessageSentByPeer\",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:\"pushIntoNoticeResult\",value:function(e,t){return!(!this._messageListHandler.pushIn(t)||this.singlyLinkedList.has(t.random))&&(e.push(t),!0)}},{key:\"getLocalLastMessage\",value:function(e){return this._messageListHandler.getLocalLastMessage(e)}},{key:\"checkAndPatchRemark\",value:function(){var e=this.getModule(no);if(0!==this._conversationMap.size&&e){var t=m(this._conversationMap.values()).filter((function(e){return e.type===S.CONV_C2C}));if(0!==t.length){var n=0;t.forEach((function(t){var o=t.conversationID.replace(S.CONV_C2C,\"\");if(e.isMyFriend(o)){var a=e.getFriendRemark(o);t.remark!==a&&(t.remark=a,n+=1)}})),Je.l(\"\".concat(this._n,\".checkAndPatchRemark. c2c conversation count:\").concat(t.length,\", patched count:\").concat(n))}}}},{key:\"updateTopicConversation\",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0,updateUnreadCount:!0})}},{key:\"sendReadReceipt\",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(eo):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(to)),n?n.sendReadReceipt(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getReadReceiptList\",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(eo):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(to)),n?n.getReadReceiptList(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getLastMessageTime\",value:function(e){var t=this.getLocalConversation(e);return t?t.lastMessage.lastTime:0}},{key:\"getTotalUnreadMessageCount\",value:function(){var e=this.getLocalConversationList(),t=0;return e.forEach((function(e){e.type!==S.CONV_SYSTEM&&(\"\"!==e.messageRemindType&&e.messageRemindType!==S.MSG_REMIND_ACPT_AND_NOTE||(t+=e.unreadCount))})),t}},{key:\"emitTotalUnreadMessageCountUpdate\",value:function(){var e=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==e&&(Je.l(\"\".concat(this._n,\".emitTotalUnreadMessageCountUpdate from \").concat(this._convTotalUnreadCount,\" to \").concat(e)),this._convTotalUnreadCount=e,this.emitOuterEvent(E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._setStorageConversationList(!0),this._pagingStatus=vn.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this._pagingConvIDMap.clear(),this._convIDFromUnreadDBMap.clear(),this._pagingGetCostList.length=0,this.resetReady()}}]),a}(Po),Ga=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupTipsHandler\",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return i(e,[{key:\"onCheckTimer\",value:function(e){e%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:\"_checkCachedGroupTips\",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),a=e._groupModule.hasLocalGroup(n);Je.l(\"\".concat(e._n,\"._checkCachedGroupTips groupID:\").concat(n,\" hasLocalGroup:\").concat(a,\" checkCount:\").concat(o)),a?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:\"onNewGroupTips\",value:function(e){Je.d(\"\".concat(this._n,\".onReceiveGroupTips count:\").concat(e.dataList.length));var t=this.newGroupTipsStoredAndSummary(e),n=t.eventDataList,o=t.result,a=t.AVChatRoomMessageList;(a.length>0&&this._groupModule.onAVChatRoomMessage(a),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(ao).onNewMessage({conversationOptionsList:n,isInstantMessage:!0}));o.length>0&&(this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:\"newGroupTipsStoredAndSummary\",value:function(e){for(var n=this,o=e.event,a=e.dataList,i=null,s=[],r=[],c={},u=[],l=function(e,l){var d=Pt(a[e]);if(6===o){if(n._groupModule.isGroupAttributesUpdatedNotice(d))return\"continue\";if(n._groupModule.isGroupCountersNotice(d))return\"continue\"}var p=d.groupProfile,_=p.groupID,g=p.communityType,h=void 0===g?0:g,f=p.topicID,v=void 0===f?void 0:f,m=p.invisible,M=void 0,I=n._groupModule.isMessageFromTopic(h,v);if(I){M=S.CONV_TOPIC,d.to=v;var y=n._groupModule.getModule(oo);y.hasLocalTopic(_,v)||n._getTopicPendingMap.has(v)||(n._getTopicPendingMap.set(v,1),y.getTopicList({groupID:_,topicIDList:[v]}).finally((function(){n._getTopicPendingMap.delete(v)})))}var T=n._groupModule.hasLocalGroup(_);if(!T&&n._groupModule.isUnjoinedAVChatRoom(_))return\"continue\";if(!T&&!I)return n._cacheGroupTipsAndProbe({groupID:_,event:o,item:d}),\"continue\";if(n._groupModule.isMessageFromOrToAVChatroom(_))return d.event=o,u.push(d),\"continue\";if(d.currentUser=n._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,(i=new pa(d)).setElement({type:S.MSG_GRP_TIP,content:t(t({},d.elements),{},{groupProfile:d.groupProfile})}),i.isSystemMessage=!1,1===m)return n._qualityStat(i),\"continue\";var C=n._groupModule.getModule(ao),D=i,E=D.conversationID,N=D.sequence;if(6===o)i._onlineOnlyFlag=!0,r.push(i);else if(!C.pushIntoNoticeResult(r,i))return\"continue\";if(n._groupModule.isMessageFromCommunityOfTopic(h,v))return\"continue\";if(6===o&&C.getLocalConversation(E))return\"continue\";6!==o&&n._qualityStat(i);var k=C.isRemoteRead({conversationID:E,sequence:N});if(mt(c[E])){var A=0;\"in\"===i.flow&&(i._isExcludedFromUnreadCount||i._onlineOnlyFlag||k||(A=1)),c[E]=s.push({conversationID:E,unreadCount:A,type:mt(M)?i.conversationType:M,subType:i.conversationSubType,lastMessage:i._isExcludedFromLastMessage?\"\":i})-1}else{var L=c[E];s[L].type=i.conversationType,s[L].subType=i.conversationSubType,s[L].lastMessage=i._isExcludedFromLastMessage?\"\":i,\"in\"===i.flow&&(i._isExcludedFromUnreadCount||i._onlineOnlyFlag||k||s[L].unreadCount++)}},d=0,p=a.length;d=0){c.updateSelfInfo({muteTime:d.muteTime}),u=!0;break}}u&&this._groupModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:r,topic:c})}}},{key:\"_onTopicProfileUpdated\",value:function(e){var n=e.payload,o=n.groupProfile.groupID,a=n.newTopicInfo;this._groupModule.getModule(oo).onTopicProfileUpdated(t({groupID:o,topicID:e.to},a))}},{key:\"_cacheGroupTips\",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:\"_deleteCachedGroupTips\",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:\"_notifyCachedGroupTips\",value:function(e){var t=this,n=this._cachedGroupTipsMap.get(e)||[];n.forEach((function(e){t.onNewGroupTips(e)})),this._deleteCachedGroupTips(e),Je.l(\"\".concat(this._n,\"._notifyCachedGroupTips groupID:\").concat(e,\" count:\").concat(n.length))}},{key:\"_cacheGroupTipsAndProbe\",value:function(e){var t=this,n=e.groupID,o=e.event,a=e.item;this._cacheGroupTips(n,{event:o,dataList:[a]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupTips(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupTips(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),Je.l(\"\".concat(this._n,\"._cacheGroupTipsAndProbe groupID:\").concat(n))}},{key:\"reset\",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),e}(),Pa=function(){function e(t){o(this,e),this._groupModule=t,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._getTopicPendingMap=new Map,this._pagingStatus=vn.NOT_START,this._pagingGetCostList=[],t.getInnerEmitterInstance().on(ha.A2KEY_AND_TINYID_UPDATED,this.syncGroupList,this)}return i(e,[{key:\"onCheckTimer\",value:function(e){e%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:\"_checkCachedGroupMessage\",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),a=e._groupModule.hasLocalGroup(n);Je.l(\"\".concat(e._n,\"._checkCachedGroupMessage groupID:\").concat(n,\" hasLocalGroup:\").concat(a,\" checkCount:\").concat(o)),a?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:\"handleUpdateGroupLastMessage\",value:function(e){var n=\"\".concat(this._n,\".handleUpdateGroupLastMessage\");if(0!==this._groupModule.getGroupMap().size){for(var o,a,i,s,r,c=!1,u=0,l=e.length;u0&&this._groupModule.onAVChatRoomMessage(a),this._groupModule.filterModifiedMessage(o),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(ao).onNewMessage({conversationOptionsList:n,isInstantMessage:e.isInstantMessage||!0,updateUnreadCount:e.updateUnreadCount||!0}));var i=this._groupModule.filterUnmodifiedMessage(o);i.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,i),o.length=0}},{key:\"_newGroupMessageStoredAndSummary\",value:function(e){var t=this,n=e.dataList,o=e.event,a=e.isInstantMessage,i=null,s=[],r=[],c=[],u={},l=this._groupModule.getFileDownloadProxy(),d=n.length;d>1&&n.sort((function(e,t){return e.sequence-t.sequence}));for(var p=this._groupModule.getModule(ao),_=this._groupModule.getModule($n),g=function(e){var d=Pt(n[e]),g=d.groupProfile,h=g.groupID,f=g.communityType,v=void 0===f?0:f,m=g.topicID,M=void 0===m?void 0:m,I=g.invisible,y=void 0,T=t._groupModule.isMessageFromTopic(v,M);if(T){y=S.CONV_TOPIC,d.to=M;var C=t._groupModule.getModule(oo);C.hasLocalTopic(h,M)||t._getTopicPendingMap.has(M)||(t._getTopicPendingMap.set(M,1),C.getTopicList({groupID:h,topicIDList:[M]}).finally((function(){t._getTopicPendingMap.delete(M)})))}var D=t._groupModule.hasLocalGroup(h);if(!D&&t._groupModule.isUnjoinedAVChatRoom(h))return\"continue\";if(!D&&!T)return t._cacheGroupMessageAndProbe({groupID:h,event:o,item:d}),\"continue\";if(t._groupModule.isMessageFromOrToAVChatroom(h))return d.event=o,c.push(d),\"continue\";if(d.currentUser=t._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,d.isSystemMessage=!!d.isSystemMessage,(i=new pa(d)).setElement(d.elements,l),1===I)return t._qualityStat(a,i),\"continue\";var E=1===n[e].isModified;if(p.isMessageSentByCurrentInstance(i)?i.isModified=E:E=!1,1===d.onlineOnlyFlag)i._onlineOnlyFlag=!0,p.isMessageSentByCurrentInstance(i)||r.push(i);else{if(t._groupModule.isMessageFromCommunityOfTopic(v,M))return r.push(i),\"continue\";if(i.from===t._groupModule.getMyUserID()){var N=p.getLatestMessageSentByMe(i.conversationID);if(N){var k=N.nick,A=N.avatar;k===i.nick&&A===i.avatar||(p.modifyMessageSentByMe({conversationID:R,latestNick:i.nick,latestAvatar:i.avatar}),_.mockOnNickAvatarModified(i.nick,i.avatar))}}if(!p.pushIntoMessageList(r,i,E))return\"continue\";t._qualityStat(a,i);var L=i,R=L.conversationID,O=L.sequence,G=p.isRemoteRead({conversationID:R,sequence:O});if(mt(u[R])){var P=0;\"in\"===i.flow&&(i._isExcludedFromUnreadCount||G||(P=1)),u[R]=s.push({conversationID:R,unreadCount:P,type:mt(y)?i.conversationType:y,subType:i.conversationSubType,lastMessage:i._isExcludedFromLastMessage?\"\":i})-1}else{var U=u[R];s[U].type=mt(y)?i.conversationType:y,s[U].subType=i.conversationSubType,s[U].lastMessage=i._isExcludedFromLastMessage?\"\":i,\"in\"===i.flow&&(i._isExcludedFromUnreadCount||G||s[U].unreadCount++)}}},h=0;h0&&n.addMessageDelay(t.clientTime)}},{key:\"onGroupMessageRevoked\",value:function(e){var t=this,n=this._groupModule.getModule(ao),o=[];e.dataList.forEach((function(e){var t=e.elements.revokedInfos,a=e.revokerInfo;mt(t)||t.forEach((function(e){var t,i=pn(e.topicID)?\"GROUP\".concat(e.groupID):\"GROUP\".concat(e.topicID),s=n.getLocalConversation(i),r=e.revokerInfo&&e.revokerInfo.revoker||a&&a.revoker,c=a&&a.reason||\"\";if(bt(s.type))t={conversationID:i,sequence:e.sequence,ID:\"\".concat(e.tinyID,\"-\").concat(e.clientTime,\"-\").concat(e.random)};else{var u=n.revoke(i,e.sequence,e.random);u?t=u:(t={conversationID:i,sequence:e.sequence},e.tinyID&&e.clientTime&&e.random&&(t.ID=\"\".concat(e.tinyID,\"-\").concat(e.clientTime,\"-\").concat(e.random)),e.time&&(t.time=e.time))}t&&(t.revoker=r,t.revokeReason=c,t.revokerInfo={userID:r,nick:\"\",avatar:\"\"},o.push(t))}))})),0!==o.length&&(n.onMessageRevoked(o),n.updateRevokerInfo(o).then((function(e){t._groupModule.emitOuterEvent(E.MESSAGE_REVOKED,e)})))}},{key:\"_groupListTreeShaking\",value:function(e){for(var t=new Map(m(this._groupModule.getGroupMap())),n=0,o=e.length;n0&&void 0!==arguments[0]&&arguments[0];this._pagingStatus===vn.NOT_START&&this._groupModule.clearGroupMap();var n=[\"Type\",\"Name\",\"FaceUrl\",\"NextMsgSeq\",\"LastMsgTime\",\"AtInfoList\",\"LastRecallTime\"],o=this.PAGING_GRP_COUNT_LIMIT,a=0,i=[];if(!0===t)return this._pagingGetGroupListWithTopic({limit:o,offset:a,groupBaseInfoFilter:n,groupList:i});var s=\"syncGroupList\",r=\"\".concat(this._n,\".\").concat(s),c=new Xo(s);return this._pagingGetGroupList({limit:o,offset:a,groupBaseInfoFilter:n,groupList:i}).then((function(){var t=cn(e._pagingGetCostList),n=rn(e._pagingGetCostList);e._pagingGetCostList.length=0,e._pagingStatus=vn.RESOLVED,e._groupListTreeShaking(i),e._groupModule.updateGroupMap(i);var o=e._groupModule.getLocalGroupList().length,a=\"count:\".concat(o,\" sum:\").concat(n,\" avg:\").concat(t);return Je.l(\"\".concat(r,\" ok. \").concat(a)),c.setNetworkType(e._groupModule.getNetworkType()).setMessage(a).end(),e.tempConversationList&&(e.handleUpdateGroupLastMessage(e.tempConversationList),e.tempConversationList=null),e._groupModule.emitGroupListUpdate(!0,!0),No({groupList:e._groupModule.getLocalGroupList()})})).catch((function(t){return e._pagingStatus=vn.REJECTED,e._groupModule.probeNetwork().then((function(e){var n=v(e,2),o=n[0],a=n[1];c.setError(t,o,a).end()})),Je.e(\"\".concat(r,\" failed. error:\"),t),Go(t)}))}},{key:\"getGroupList\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"getGroupList\");if(Je.l(\"\".concat(t,\" pagingStatus:\").concat(this._pagingStatus)),this._pagingStatus===vn.REJECTED||this._pagingStatus===vn.NOT_START)return this.syncGroupList().then((function(){var t=e._groupModule.getLocalGroupList();return No({groupList:t,isSyncCompleted:e.isPagingGetCompleted()})})).catch((function(e){return Je.e(\"\".concat(t,\" failed. error:\"),e),Go(e)}));var n=this._groupModule.getLocalGroupList();return Je.l(\"\".concat(t,\". returned group count:\").concat(n.length)),Oo({groupList:n,isSyncCompleted:this.isPagingGetCompleted()})}},{key:\"isPagingGetCompleted\",value:function(){return this._pagingStatus===vn.RESOLVED}},{key:\"_pagingGetGroupList\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"_pagingGetGroupList\"),o=e.isCommunityRelay,a=void 0!==o&&o,i=e.limit,s=e.offset,r=e.groupBaseInfoFilter,c=e.groupList,u=Date.now();return this._groupModule.request({protocolName:Uo.GET_GROUP_LIST,requestData:{type:a?S.GRP_COMMUNITY:void 0,memberAccount:this._groupModule.getMyUserID(),limit:i,offset:s,responseFilter:{groupBaseInfoFilter:r,selfInfoFilter:[\"Role\",\"JoinTime\",\"MsgFlag\",\"MsgSeq\"]}}}).then((function(e){var o=e.data,l=o.groups,d=void 0===l?[]:l,p=o.totalCount;c.push.apply(c,m(d)),t._handleGroupAtInfoWithoutTopic(a,d);var _=s+i,g=!(p>_),h=\"offset:\".concat(s,\" limit:\").concat(i,\" totalCount:\").concat(p,\" isCompleted:\").concat(g,\" \")+\"currentCount:\".concat(c.length,\" isCommunityRelay:\").concat(a);return t._pagingGetCostList.push(un(u,!1)),Je.l(\"\".concat(n,\" ok. \").concat(h,\" cost:\").concat(un(u))),a||g?!a&&g?(Je.l(\"\".concat(n,\" start to get community list\")),s=0,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c,isCommunityRelay:!0})):a&&!g?(s=_,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c,isCommunityRelay:!0})):No({groupList:c}):(s=_,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c}))})).catch((function(e){return 10018===e.code?(Je.w(\"\".concat(t.logPrefix,\" response size exceeds the limit, request count:\").concat(i)),i=50,t._pagingGetGroupList({limit:i,offset:s,groupBaseInfoFilter:r,groupList:c,isCommunityRelay:a})):a?(11e3===e.code&&Je.l(\"\".concat(n,\" ok. community unavailable\")),Oo({groupList:c})):Go(e)}))}},{key:\"_pagingGetGroupListWithTopic\",value:function(e){var t=this,n=\"\".concat(this._n,\"._pagingGetGroupListWithTopic\"),o=e.limit,a=e.offset,i=e.groupBaseInfoFilter,s=e.groupList,r=Date.now();return this._groupModule.request({protocolName:Uo.GET_GROUP_LIST,requestData:{type:S.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:o,offset:a,responseFilter:{groupBaseInfoFilter:i,selfInfoFilter:[\"Role\",\"JoinTime\",\"MsgFlag\",\"MsgSeq\"]},isSupportTopic:1}}).then((function(e){var c=e.data,u=c.groups,l=void 0===u?[]:u,d=c.totalCount;s.push.apply(s,m(l));var p=a+o,_=!(d>p);if(Je.l(\"\".concat(n,\" ok. offset:\").concat(a,\" limit:\").concat(o,\" totalCount:\").concat(d,\" isCompleted:\").concat(_,\" currentCount:\").concat(s.length,\" cost:\").concat(un(r))),!_)return a=p,t._pagingGetGroupListWithTopic({limit:o,offset:a,groupBaseInfoFilter:i,groupList:s});t._groupModule.updateGroupMap(s),t._groupModule.emitGroupListUpdate(!0,!1);var g=t._groupModule.getLocalGroupList().filter((function(e){return!0===e.isSupportTopic}));return No({groupList:g})})).catch((function(e){return 10018===e.code?(Je.w(\"\".concat(t.logPrefix,\" response size exceeds the limit, request count:\").concat(o)),o=50,t._pagingGetGroupListWithTopic({limit:o,offset:a,groupBaseInfoFilter:i,groupList:s})):Go(e)}))}},{key:\"_cacheGroupMessage\",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:\"_deleteCachedGroupMessage\",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:\"_notifyCachedGroupMessage\",value:function(e){var t=this,n=this._cachedGroupMessageMap.get(e)||[];n.forEach((function(e){t.onNewGroupMessage(e)})),this._deleteCachedGroupMessage(e),Je.l(\"\".concat(this._n,\"._notifyCachedGroupMessage groupID:\").concat(e,\" count:\").concat(n.length))}},{key:\"_cacheGroupMessageAndProbe\",value:function(e){var t=this,n=e.groupID,o=e.event,a=e.item;this._cacheGroupMessage(n,{event:o,dataList:[a]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupMessage(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupMessage(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),Je.l(\"\".concat(this._n,\"._cacheGroupMessageAndProbe groupID:\").concat(n))}},{key:\"_handleGroupAtInfoWithoutTopic\",value:function(e,n){var o=this;e&&0!==n.length&&n.forEach((function(e){var n=e.groupID,a=e.groupAtInfoList,i=[];mt(a)||(a.forEach((function(e){i.push(t(t({},e),{},{groupID:n}))})),o._groupModule.getModule(ao).onNewGroupAtTips({dataList:i}))}))}},{key:\"setPagingGroupCount\",value:function(e){mt(e)||(this.PAGING_GRP_COUNT_LIMIT=parseInt(e,10))}},{key:\"reset\",value:function(){this.PAGING_GRP_COUNT_LIMIT=200,this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._pagingStatus=vn.NOT_START,this._pagingGetCostList=[]}}]),e}(),Ua=1,ba=2,wa=3,Fa=4,qa=5,xa=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupAttributesHandler\",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return i(e,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this._groupModule.getCloudConfig(\"grp_attr_cache_time\");mt(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:\"updateLocalMainSequenceOnReconnected\",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:\"isGroupAttributesUpdatedNotice\",value:function(e){var t=e.to,n=e.elements.newGroupProfile,o=!mt(n)&&!pn(n.groupAttributeOption);return o&&this._onGroupAttributesUpdated({groupID:t,groupAttributeOption:n.groupAttributeOption}),o}},{key:\"_onGroupAttributesUpdated\",value:function(e){var t=this,n=e.groupID,o=e.groupAttributeOption,a=o.mainSequence,i=o.isWithChangedAttributeInfo,s=o.groupAttributeList,r=void 0===s?[]:s,c=o.operationType;if(Je.l(\"\".concat(this._n,\".onGroupAttributesUpdated. \")+\"groupID:\".concat(n,\" isWithChangedAttributeInfo:\").concat(i,\" operationType:\").concat(c)),!mt(c)){this._groupAttributesCopy=this._getCachedAttributes({groupID:n});var u=a-this._getLocalGroupAttributes(n).localMainSequence;if(0!==u){if(1===i&&1===u)return this._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:r,operationType:c}),void this._emitGroupAttributesUpdated(n);if(this._hasLocalGroupAttributes(n)){var l=this._getLocalGroupAttributes(n).avChatRoomKey;this._getGroupAttributes({groupID:n,avChatRoomKey:l}).then((function(){t._emitGroupAttributesUpdated(n)}))}}}}},{key:\"initGroupAttributesCache\",value:function(e){var t=e.groupID,n=e.avChatRoomKey,o=void 0===n?void 0:n;this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:o}),Je.l(\"\".concat(this._n,\".initGroupAttributesCache groupID:\").concat(t,\" avChatRoomKey:\").concat(o))}},{key:\"initGroupAttributes\",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,a=this._getLocalGroupAttributes(n),i=a.remoteMainSequence,s=a.avChatRoomKey,r=new Xo(\"initGroupAttributes\");return r.setMessage(\"groupID:\".concat(n,\" avChatRoomKey:\").concat(s,\" mainSequence:\").concat(i)),this._groupModule.request({protocolName:Uo.SET_GROUP_ATTRIBUTES,requestData:{groupID:n,avChatRoomKey:s,mainSequence:i,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){Je.l(\"\".concat(t._n,\".\").concat(\"initGroupAttributes\",\" ok. groupID:\").concat(n));var a=e.data,i=a.mainSequence,s=m(a.groupAttributeList);return s.forEach((function(e){e.value=o[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:i,groupAttributeList:s,operationType:Ua}),t._emitGroupAttributesUpdated(n),r.setNetworkType(t._groupModule.getNetworkType()).end(),No({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Go(e)}))}},{key:\"setGroupAttributes\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setGroupAttributes\"),o=e.groupID,a=e.groupAttributes,i=this._getLocalGroupAttributes(o),s=i.remoteMainSequence,r=i.avChatRoomKey,c=i.attributes,u=this._transformGroupAttributes(a);u.forEach((function(e){var t=e.key;e.sequence=0,c.has(t)&&(e.sequence=c.get(t).sequence)}));var l=new Xo(\"setGroupAttributes\");return l.setMessage(\"groupID:\".concat(o,\" groupAttributes:\").concat(JSON.stringify(a))),Je.l(\"\".concat(n,\". groupID:\").concat(o,\" mainSequence:\").concat(s)),this._groupModule.request({protocolName:Uo.MODIFY_GROUP_ATTRIBUTES,requestData:{groupID:o,avChatRoomKey:r,mainSequence:s,groupAttributeList:u}}).then((function(e){Je.l(\"\".concat(n,\" ok.\"));var i=e.data,s=i.mainSequence,r=m(i.groupAttributeList);return r.forEach((function(e){e.value=a[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:o}),t._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:s,groupAttributeList:r,operationType:ba}),t._emitGroupAttributesUpdated(o),l.setNetworkType(t._groupModule.getNetworkType()).end(),No({groupAttributes:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setError(e,o,a).end()})),Go(e)}))}},{key:\"deleteGroupAttributes\",value:function(e){var t=this,n=e.groupID,o=e.keyList,a=void 0===o?[]:o,i=this._getLocalGroupAttributes(n),s=i.remoteMainSequence,r=i.avChatRoomKey,c=i.attributes,u=m(c.keys()),l=Uo.CLEAR_GROUP_ATTRIBUTES,d=wa,p={groupID:n,avChatRoomKey:r,mainSequence:s},_=[];a.length>0&&(u=[],l=Uo.DELETE_GROUP_ATTRIBUTES,d=Fa,a.forEach((function(e){var t=0;c.has(e)&&(t=c.get(e).sequence,u.push(e)),_.push({key:e,sequence:t})})),p.groupAttributeList=_);var g=new Xo(\"deleteGroupAttributes\");return g.setMessage(\"groupID:\".concat(n,\" mainSequence:\").concat(s,\" keyList:\").concat(a,\" protocolName:\").concat(l)),this._groupModule.request({protocolName:l,requestData:p}).then((function(e){Je.l(\"\".concat(t._n,\".\").concat(\"deleteGroupAttributes\",\" ok. groupID:\").concat(n));var o=e.data.mainSequence;return t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:o,groupAttributeList:_,operationType:d}),t._emitGroupAttributesUpdated(n),g.setNetworkType(t._groupModule.getNetworkType()).end(),No({keyList:u})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];g.setError(e,o,a).end()})),Go(e)}))}},{key:\"getGroupAttributes\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getGroupAttributes\"),o=e.groupID,a=this._getLocalGroupAttributes(o),i=a.avChatRoomKey,s=a.lastUpdateTime,r=a.localMainSequence,c=a.remoteMainSequence,u=new Xo(\"getGroupAttributes\");if(u.setMessage(\"groupID:\".concat(o,\" localMainSequence:\").concat(r,\" remoteMainSequence:\").concat(c,\" keyList:\").concat(e.keyList)),Date.now()-s>=this.CACHE_EXPIRE_TIME||r0)o.forEach((function(e){i.has(e)&&(a[e]=i.get(e).value)}));else{var s,r=D(i.keys());try{for(r.s();!(s=r.n()).done;){var c=s.value;a[c]=i.get(c).value}}catch(u){r.e(u)}finally{r.f()}}}return a}},{key:\"_updateCachedAttributes\",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList,o=e.operationType;o!==wa?o!==Fa?(o===Ua&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value,a=e.sequence;t.attributes.set(n,{value:o,sequence:a})}))):n.forEach((function(e){t.attributes.delete(e.key)})):t.attributes.clear()}},{key:\"_hasLocalGroupAttributes\",value:function(e){return this._groupAttributesMap.has(e)}},{key:\"_getLocalGroupAttributes\",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:\"_transformGroupAttributes\",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:\"_emitGroupAttributesUpdated\",value:function(e){var t=this._getCachedAttributes({groupID:e}),n=this._computeAttrChangedInfo(t),o=n.updatedKeyList,a=n.deletedKeyList;Je.l(\"\".concat(this._n,\"._emitGroupAttributesUpdated update:\").concat(o.length,\", delete:\").concat(a.length)),0===o.length&&0===a.length||this._groupModule.emitOuterEvent(E.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t,updatedKeyList:o,deletedKeyList:a})}},{key:\"_computeAttrChangedInfo\",value:function(e){var t=this,n=[],o=[];return Object.keys(e).forEach((function(o){e[o]!==t._groupAttributesCopy[o]&&n.push(o)})),Object.keys(this._groupAttributesCopy).forEach((function(t){mt(e[t])&&o.push(t)})),this._groupAttributesCopy={},{updatedKeyList:n,deletedKeyList:o}}},{key:\"deleteLocalGroupAttributes\",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:\"reset\",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),e}(),Va=\"Set\",Ha=\"Increase\",Ba=\"Decrease\",Ka=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupCountersHandler\",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return i(e,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this._groupModule.getCloudConfig(\"grp_counter_expire_time\");mt(e)||(this.EXPIRE_TIME=Number(e))}},{key:\"isGroupCountersNotice\",value:function(e){var t=e.to,n=e.elements.groupCounterInfo,o=!1;return pn(n)||(this._onGroupCountersUpdated({groupID:t,groupCounterInfo:n}),o=!0),o}},{key:\"_onGroupCountersUpdated\",value:function(e){var t=this,n=e.groupID;e.groupCounterInfo.forEach((function(e){var o=e.type,a=e.groupCounterSeq,i=e.counterList,s=void 0===i?[]:i;0!==o&&2!==o||(t._updateLocalGroupCounters({groupID:n,groupCounterSeq:a,counterList:s}),s.forEach((function(e){t._groupModule.emitOuterEvent(E.GROUP_COUNTER_UPDATED,{groupID:n,key:e.key,value:e.value})}))),1===o&&t._deleteLocalGroupCounters({groupID:n,groupCounterSeq:a,counterList:s})})),Je.l(\"\".concat(this._n,\"._onGroupCountersUpdated groupID:\").concat(n))}},{key:\"initGroupCountersCache\",value:function(e){var t=e.groupID,n=e.avChatRoomKey;this._groupCountersMap.set(t,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:n}),Je.l(\"\".concat(this._n,\".initGroupCountersCache groupID:\").concat(t,\" avChatRoomKey:\").concat(n))}},{key:\"setGroupCounters\",value:function(e){var t=this;if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility(\"setGroupCounters\");var n=\"\".concat(this._n,\".\").concat(\"setGroupCounters\"),o=e.groupID,a=e.counters,i=this._convertObjectToList(a),s=this._getLocalGroupCounters(o).avChatRoomKey,r=\"groupID:\".concat(o,\" count:\").concat(i.length),c=new Xo(\"setGroupCounters\");return c.setMessage(\"\".concat(r)),Je.l(\"\".concat(n,\". \").concat(r)),this._updateGroupCounters({groupID:o,counterList:i,avChatRoomKey:s,mode:Va}).then((function(e){return c.end(),Je.l(\"\".concat(n,\" ok.\")),No({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"increaseGroupCounter\",value:function(e){var t=this,n=\"increaseGroupCounter\";if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n),a=e.groupID,i=e.key,s=e.value,r=this._getLocalGroupCounters(a).avChatRoomKey,c=\"groupID:\".concat(a,\" key:\").concat(i,\" value:\").concat(s),u=new Xo(n);u.setMessage(\"\".concat(c)),Je.l(\"\".concat(o,\". \").concat(c));var l=[{key:i,value:s}];return this._updateGroupCounters({groupID:a,counterList:l,avChatRoomKey:r,mode:Ha}).then((function(e){return u.end(),Je.l(\"\".concat(o,\" ok.\")),No({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"decreaseGroupCounter\",value:function(e){var t=this,n=\"decreaseGroupCounter\";if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n),a=e.groupID,i=e.key,s=e.value,r=this._getLocalGroupCounters(a).avChatRoomKey,c=\"groupID:\".concat(a,\" key:\").concat(i,\" value:\").concat(s),u=new Xo(n);u.setMessage(\"\".concat(c)),Je.l(\"\".concat(o,\". \").concat(c));var l=[{key:i,value:s}];return this._updateGroupCounters({groupID:a,counterList:l,avChatRoomKey:r,mode:Ba}).then((function(e){return u.end(),Je.l(\"\".concat(o,\" ok.\")),No({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"getGroupCounters\",value:function(e){var t=this;if(!this._groupModule.canIUse(K.GRP_COUNTER))return this._groupModule.cannotUseCommercialAbility(\"getGroupCounters\");var n=\"\".concat(this._n,\".\").concat(\"getGroupCounters\"),o=e.groupID,a=e.keyList,i=void 0===a?[]:a,s=this._getLocalGroupCounters(o),r=s.avChatRoomKey,c=s.lastUpdateTime,u=new Xo(\"getGroupCounters\");if(u.setMessage(\"groupID:\".concat(o)),Date.now()-c>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:o,avChatRoomKey:r}).then((function(e){u.setMoreMessage(\"from remote. count:\".concat(e.length)).end(),Je.l(\"\".concat(n,\" from remote. groupID:\").concat(o));var a=t._getLocalCounters(o,i);return No({counters:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Go(e)}));u.setMoreMessage(\"from cache\").end(),Je.l(\"\".concat(n,\" from cache. groupID:\").concat(o));var l=this._getLocalCounters(o,i);return Oo({counters:l})}},{key:\"_getRemoteGroupCounters\",value:function(e){var n=this;return this._groupModule.request({protocolName:Uo.GET_GROUP_COUNTER,requestData:t({},e)}).then((function(t){var o=t.data,a=o.counterList,i=void 0===a?[]:a,s=o.groupCounterSeq;return n._updateLocalGroupCounters({groupID:e.groupID,counterList:i,groupCounterSeq:s}),Je.l(\"\".concat(n._n,\"._getRemoteGroupCounters ok. groupID:\").concat(e.groupID)),i})).catch((function(e){return Go(e)}))}},{key:\"_convertObjectToList\",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:\"_updateGroupCounters\",value:function(e){var n=\"\".concat(this._n,\"._updateGroupCounters\"),o=e.groupID,a=e.avChatRoomKey,i=e.mode;return Je.l(\"\".concat(n,\". groupID:\").concat(o,\" avChatRoomKey:\").concat(a,\" mode:\").concat(i)),this._groupModule.request({protocolName:Uo.UPDATE_GROUP_COUNTER,requestData:t({},e)}).then((function(e){Je.l(\"\".concat(n,\" ok.\"));var t=e.data.counterList,o={};return(void 0===t?[]:t).forEach((function(e){var t=e.key,n=e.value;o[t]=n})),o})).catch((function(e){return Go(e)}))}},{key:\"_hasLocalGroupCounters\",value:function(e){return this._groupCountersMap.has(e)}},{key:\"_getLocalGroupCounters\",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:\"_updateLocalGroupCounters\",value:function(e){var t=e.groupID,n=e.counterList,o=void 0===n?[]:n,a=e.groupCounterSeq;if(this._hasLocalGroupCounters(t)){var i=this._getLocalGroupCounters(t),s=i.counters,r=i.avChatRoomKey,c=i.groupCounterSeq;if(a>0&&a0)t.forEach((function(e){o.has(e)&&(n[e]=o.get(e))}));else{var a,i=D(o.keys());try{for(i.s();!(a=i.n()).done;){var s=a.value;n[s]=o.get(s)}}catch(r){i.e(r)}finally{i.f()}}return n}},{key:\"reset\",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),e}(),Ya=function(){function e(t){o(this,e);var n=t.manager,a=t.groupID,i=t.onInit,s=t.onSuccess,r=t.onFail;this._n=\"Polling\",this._manager=n,this._groupModule=n._groupModule,this._onInit=i,this._onSuccess=s,this._onFail=r,this._groupID=a,this._timeoutID=-1,this._isRunning=!1,this._protocolName=Uo.AVCHATROOM_POLLING}return i(e,[{key:\"start\",value:function(){var e=this._groupModule.isLoggedIn();e||(this._protocolName=Uo.AVCHATROOM_NOAUTH_POLLING),Je.l(\"\".concat(this._n,\".start pollingInterval:\").concat(this._manager.getPollingInterval(),\" isLoggedIn:\").concat(e)),this._isRunning=!0,this._request()}},{key:\"isRunning\",value:function(){return this._isRunning}},{key:\"_request\",value:function(){var e=this,t=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:\"stop\",value:function(){Je.l(\"\".concat(this._n,\".stop\")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:\"getPollingTimerID\",value:function(){return this._timeoutID}}]),e}(),Wa={3:!0,4:!0,5:!0,6:!0,17:!0,20:!0,21:!0},ja=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"AVChatRoomHandler\",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new Ea(200),this.messageIDLinkedList=new Ea(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}return i(e,[{key:\"hasJoinedAVChatRoom\",value:function(){return this._joinedGroupMap.size>0}},{key:\"checkJoinedAVChatRoomByID\",value:function(e){return this._joinedGroupMap.has(e)}},{key:\"getJoinedAVChatRoom\",value:function(){return this._joinedGroupMap.size>0?m(this._joinedGroupMap.keys()):[]}},{key:\"_updateRequestData\",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===m(this._pollingInstanceMap.keys())[0]?t(t({},n),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):t(t({},n),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:\"_handleSuccess\",value:function(e,t){var n=t.data,o=n.key,a=n.nextSeq,i=n.rspMsgList,s=n.errorCode,r=n.nextBroadcastSeq,c=n.broadcastMessageList;if(0!==s){var u=this._pollingRequestInfoMap.get(e),l=new Xo(\"longPollingAVError\"),d=u?\"\".concat(u.key,\"-\").concat(u.startSeq):\"requestInfo is undefined\";l.setMessage(\"\".concat(e,\"-\").concat(d,\"-\").concat(t.errorInfo)).setCode(t.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(e))return;gt(o)&&_t(a)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:a}),_t(r)&&r>this._startBroadcastSeq&&(this._startBroadcastSeq=r),vt(i)&&i.length>0?(i.forEach((function(e){e.to=e.groupID})),this.onMessage(i,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(c)}}},{key:\"_handleFailure\",value:function(e,t){}},{key:\"onMessage\",value:function(e,t){if(vt(e)&&0!==e.length){var n=\"\".concat(this._n,\".onMessage\");t&&(n+=\" groupID:\".concat(t)),0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var o=null,a=[],i=this._getModule(ao),s=this._getModule(mo),r=e.length;r>1&&e.sort((function(e,t){return e.sequence-t.sequence}));var c=this._getModule(io).isUnlimitedAVChatRoom(),u=!1;if(Je.getLevel()<=0){var l=e.map((function(e){return e.sequence}));Je.l(\"\".concat(n,\" count:\").concat(l.length,\" sequenceList:\").concat(l)),l.length=0}for(var d=0;d0&&s.addMessageDelay(o.clientTime),s.addMessageSequence({key:Ko,message:o}))}a.push(o)}}}else{this._getModule(So).onMessageReactionNotify({event:21,dataList:p.elements.messageReactionNotifyList})}else this.handleMessageRevokedNotice(p)}else Je.w(\"\".concat(n,\". unknown event:\").concat(p.event))}if(0!==a.length){if(this._groupModule.filterModifiedMessage(a),!u){var v=this.packConversationOption(a);v.length>0&&i.onNewMessage({conversationOptionsList:v,isInstantMessage:!0})}this._checkMessageStacked(a);var m=this._groupModule.filterUnmodifiedMessage(a);m.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,m),a.length=0}}}},{key:\"handleMessageRevokedNotice\",value:function(e){var t=this,n=e.groupID,o=e.elements.revokeMsgList,a=e.revokerInfo,i=[];(o.forEach((function(e){var t=e.tinyID,o=e.clientTime,s=e.random,r=e.sequence,c={conversationID:\"\".concat(S.CONV_GROUP).concat(n),ID:\"\".concat(t,\"-\").concat(o,\"-\").concat(s),revoker:a.revoker,revokeReason:a.reason||\"\",revokerInfo:{userID:a.revoker,nick:\"\",avatar:\"\"},sequence:r};i.push(c)})),0!==i.length)&&this._getModule(ao).updateRevokerInfo(i).then((function(e){t._groupModule.emitOuterEvent(E.MESSAGE_REVOKED,e)}))}},{key:\"isBroadcastOrNormal\",value:function(e){return 3===e||17===e}},{key:\"isGroupTip\",value:function(e){return 4===e||6===e}},{key:\"isGroupSystemNotice\",value:function(e){return 5===e}},{key:\"restoreGroupTipElements\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.operatorInfo,n=void 0===t?{}:t,o=e.operatorID,a=e.userIDList,i=void 0===a?[]:a,s=e.operationType;_t(e.groupJoinType)||1!==s&&2!==s||(e.groupJoinType=2===s?0:1);var r=n.userID,c=void 0===r?o:r,u=n.avatar,l=void 0===u?\"\":u,d=n.nick,p=void 0===d?\"\":d;e.operatorInfo={userID:c,avatar:l,nick:p};var _=i.map((function(e){return{userID:e}}));return e.memberInfoList=e.memberInfoList||_,e}},{key:\"restoreMessageFromSimplified\",value:function(e){var n=e.event;if(this.isBroadcastOrNormal(n)&&(e.cloudCustomData=e.cloudCustomData||\"\",e.elements=e.elements.map((function(e){if(e.type===S.MSG_CUSTOM){var n=e.content,o=void 0===n?{}:n;e.content=t({data:\"\",description:\"\",extension:\"\"},o)}return e}))),(this.isGroupTip(n)||this.isGroupSystemNotice(n))&&(e.from=e.from||\"@TIM#SYSTEM\"),this.isGroupTip(n)){e.elements=this.restoreGroupTipElements(e.elements);var o=e.elements,a=void 0===o?{}:o,i=a.operationType,r=a.operatorInfo;if(1===i){var c=[{userID:(void 0===r?{}:r).userID}];a.memberInfoList=a.memberInfoList||c}}if(this.isGroupSystemNotice(n)){var u=e.elements,l=u.memberInfoList,d=u.operatorInfo;l||(l=void 0===d?{}:d),e.elements.memberInfoList=t({userID:e.elements.operatorID,avatar:\"\",nick:\"\"},l),e.elements=t({authentication:\"\",remarkInfo:\"\",messageKey:1e3*e.time},e.elements);var p=Object.keys(e.elements).filter((function(e){return\"operatorInfo\"!==e})).reduce((function(n,o){return t(t({},n),{},s({},o,e.elements[o]))}),{});e.elements=p}return e}},{key:\"_onGroupDismissed\",value:function(e){Je.l(\"\".concat(this._n,\"._onGroupDismissed groupID:\").concat(e)),this._groupModule.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:\"_checkMessageStacked\",value:function(e){var t=\"MessageStacked\",n=e.length;n>=100&&(this._groupModule.outputWarning(t,n),this._reportMessageStackedCount<5&&(new Xo(t).setNetworkType(this._groupModule.getNetworkType()).setMessage(\"count:\".concat(n,\" groupID:\").concat(m(this._joinedGroupMap.keys()))).setLevel(\"warning\").end(),this._reportMessageStackedCount+=1))}},{key:\"_isMessageSentByCurrentInstance\",value:function(e){return!!this._getModule(ao).isMessageSentByCurrentInstance(e)}},{key:\"packMessage\",value:function(e,t){e.currentUser=this._groupModule.getMyUserID(),e.conversationType=5===t?S.CONV_SYSTEM:S.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new pa(e),o=this.packElements(e,t);return n.setElement(o,this._groupModule.getFileDownloadProxy()),n}},{key:\"packElements\",value:function(e,n){return 4===n||6===n?(this._updateMemberCountByGroupTips(e),{type:S.MSG_GRP_TIP,content:t(t({},e.elements),{},{groupProfile:e.groupProfile})}):5===n?{type:S.MSG_GRP_SYS_NOTICE,content:t(t({},e.elements),{},{groupProfile:t(t({},e.groupProfile),{},{groupID:e.groupID})})}:e.elements}},{key:\"packConversationOption\",value:function(e){for(var t=new Map,n=0;n0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,t)}}},{key:\"start\",value:function(e){if(this._pollingInstanceMap.has(e)){var t=this._pollingInstanceMap.get(e);t.isRunning()||t.start()}else{var n=new Ya({manager:this,groupID:e,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});n.start(),this._pollingInstanceMap.set(e,n),Je.l(\"\".concat(this._n,\".start groupID:\").concat(e))}}},{key:\"handleJoinResult\",value:function(e){var t=this;return this._preCheck().then((function(){var n=e.longPollingKey,o=e.group,a=o.groupID;return t._joinedGroupMap.set(a,o),t._groupModule.updateGroupMap([o]),t._groupModule.deleteUnjoinedAVChatRoom(a),t._groupModule.emitGroupListUpdate(!0,!1),mt(n)?Oo({status:st,group:o}):Promise.resolve()}))}},{key:\"startRunLoop\",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,a=e.startSeq,i=void 0===a?0:a,s=o.groupID;return t._pollingRequestInfoMap.set(s,{key:n,startSeq:i}),t.start(s),t._groupModule.isLoggedIn()?Oo({status:st,group:o}):Oo({status:st})}))}},{key:\"_preCheck\",value:function(){if(this._getModule(io).isUnlimitedAVChatRoom())return Promise.resolve();if(!this.hasJoinedAVChatRoom())return Promise.resolve();var e=v(this._joinedGroupMap.entries().next().value,2),t=e[0],n=e[1];if(this._groupModule.isLoggedIn()){if(!(n.selfInfo.role===S.GRP_MBR_ROLE_OWNER||n.ownerID===this._groupModule.getMyUserID()))return this._groupModule.quitGroup(t);this._groupModule.deleteLocalGroupAndConversation(t)}else this._groupModule.deleteLocalGroupAndConversation(t);return this.reset(t),Promise.resolve()}},{key:\"joinWithoutAuth\",value:function(e){var t=this,n=e.groupID,o=\"\".concat(this._n,\".\").concat(\"joinWithoutAuth\"),a=new Xo(\"joinWithoutAuth\");return this._groupModule.request({protocolName:Uo.APPLY_JOIN_GROUP_NOAUTH,requestData:e}).then((function(e){var i=e.data.longPollingKey;if(t._groupModule.probeNetwork().then((function(e){var t=v(e,2);t[0];var o=t[1];a.setNetworkType(o).setMessage(\"groupID:\".concat(n,\" longPollingKey:\").concat(i)).end(!0)})),mt(i))return Go({code:Ao.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN});Je.l(\"\".concat(o,\" ok. groupID:\").concat(n)),t._getModule(ao).setCompleted(\"\".concat(S.CONV_GROUP).concat(n));var s=new Na({groupID:n});return t.startRunLoop({group:s,longPollingKey:i}),No({status:st})})).catch((function(e){return Je.e(\"\".concat(o,\" failed. groupID:\").concat(n,\" error:\"),e),t._groupModule.probeNetwork().then((function(t){var o=v(t,2),i=o[0],s=o[1];a.setError(e,i,s).setMessage(\"groupID:\".concat(n)).end(!0)})),Go(e)})).finally((function(){t._groupModule.getModule(ro).reportAtOnce()}))}},{key:\"getGroupOnlineMemberCount\",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return pn(t)||n-t.lastSyncTime>1e3*t.expireTime&&n-t.latestUpdateTime>1e4&&n-t.lastReqTime>3e3?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return No({memberCount:e.memberCount})})).catch((function(e){return Go(e)}))):Oo({memberCount:t.memberCount})}},{key:\"_getGroupOnlineMemberCount\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"_getGroupOnlineMemberCount\");return this._groupModule.requestOnlineCount(e).then((function(o){var a=t._onlineMemberCountMap.get(e)||{},i=o.data,s=i.memberCount,r=void 0===s?0:s,c=i.expireTime,u=void 0===c?t.DEFAULT_EXPIRE_TIME:c;Je.l(\"\".concat(n,\" ok. groupID:\").concat(e,\" memberCount:\").concat(r,\" expireTime:\").concat(u));var l=Date.now();return pn(a)&&(a.lastReqTime=l),t._onlineMemberCountMap.set(e,Object.assign(a,{lastSyncTime:l,latestUpdateTime:l,memberCount:r,expireTime:u})),{memberCount:r}})).catch((function(o){return Je.w(\"\".concat(n,\" failed. error:\"),o),new Xo(\"_getGroupOnlineMemberCount\").setCode(o.code).setMessage(\"groupID:\".concat(e,\" error:\").concat(JSON.stringify(o))).setNetworkType(t._groupModule.getNetworkType()).end(),Promise.reject(o)}))}},{key:\"_getModule\",value:function(e){return this._groupModule.getModule(e)}},{key:\"setPollingInterval\",value:function(e){mt(e)||(_t(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:\"setPollingIntervalPlus\",value:function(e){mt(e)||(_t(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:\"setPollingNoMessageCount\",value:function(e){mt(e)||(_t(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:\"setPollingSimplifiedMessage\",value:function(e){mt(e)||\"0\"!==e&&\"1\"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:\"getPollingInterval\",value:function(){return this._pollingInterval}},{key:\"onAVChatRoomMemberBanned\",value:function(e){var t=e.payload.groupProfile.groupID;Je.l(\"\".concat(this._n,\".onAVChatRoomMemberBanned groupID:\").concat(t)),this._groupModule.deleteLocalGroupAndConversation(t),this.reset(t)}},{key:\"restartPolling\",value:function(){Je.l(\"\".concat(this._n,\".restartPolling count:\").concat(this._pollingInstanceMap.size));var e,t=D(this._pollingInstanceMap.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.stop(),n.start()}}catch(o){t.e(o)}finally{t.f()}}},{key:\"getPollingTimerID\",value:function(e){if(!this._pollingInstanceMap.has(e))return-1;var t=this._pollingInstanceMap.get(e).getPollingTimerID();return Je.l(\"\".concat(this._n,\".getPollingTimerID groupID:\").concat(e,\" timerID:\").concat(t)),t}},{key:\"reset\",value:function(e){if(e){Je.l(\"\".concat(this._n,\".reset groupID:\").concat(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{Je.l(\"\".concat(this._n,\".reset all\"));var n,o=D(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;){n.value.stop()}}catch(a){o.e(a)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.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}}]),e}(),Ja=function(){function e(t){o(this,e),this.userID=\"\",this.avatar=\"\",this.nick=\"\",this.role=\"\",this.joinTime=\"\",this.lastSendMsgTime=\"\",this.nameCard=\"\",this.muteUntil=0,this.memberCustomField=[],this.isOnline=\"Online\"===t.onlineStatus,this._initMember(t)}return i(e,[{key:\"_initMember\",value:function(e){this.updateMember(e)}},{key:\"updateMember\",value:function(e){var t=[null,void 0,\"\",0,NaN];e.memberCustomField&&Ut(this.memberCustomField,e.memberCustomField),Et(this,e,[\"memberCustomField\",\"marks\",\"onlineStatus\"],t)}},{key:\"updateRole\",value:function(e){[\"Owner\",\"Admin\",\"Member\"].indexOf(e)<0||(this.role=e)}},{key:\"updateMuteUntil\",value:function(e){mt(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:\"updateNameCard\",value:function(e){mt(e)||(this.nameCard=e)}},{key:\"updateMemberCustomField\",value:function(e){e&&Ut(this.memberCustomField,e)}}]),e}(),za=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupMemberHandler\",this.groupMemberListMap=new Map,this.DEFAULT_MEMBER_INFO_FILTER=[\"Role\",\"JoinTime\",\"NameCard\",\"ShutUpUntil\",\"OnlineStatus\"],this._groupModule.getInnerEmitterInstance().on(ha.PROFILE_UPDATED,this._onProfileUpdated,this)}return i(e,[{key:\"_onProfileUpdated\",value:function(e){for(var t=this,n=e.data,o=function(e){var o=n[e];t.groupMemberListMap.forEach((function(e){e.has(o.userID)&&e.get(o.userID).updateMember({nick:o.nick,avatar:o.avatar})}))},a=0;a100?100:u,memberRoleFilter:t?[t]:void 0,memberInfoFilter:this.DEFAULT_MEMBER_INFO_FILTER};wt({groupID:o})?f.next=\"\".concat(r):(f.offset=r,h=r+u);var m=[];return this._groupModule.request({protocolName:Uo.GET_GROUP_MEMBER_LIST,requestData:f}).then((function(e){var t=e.data,a=t.members,i=t.memberNum,s=t.next,r=void 0===s?void 0:s;return mt(r)||(h=pn(r)?0:r),vt(a)&&0!==a.length?(n._groupModule.hasLocalGroup(o)&&(n._groupModule.getLocalGroupProfile(o).memberNum=i),m=n._updateLocalGroupMemberMap(o,a),n._groupModule.getModule($n).getUserProfile({userIDList:a.map((function(e){return e.userID})),tagList:[Xe.NICK,Xe.AVATAR]})):(h=0,Promise.resolve([]))})).then((function(e){var t=e.data;if(!vt(t)||0===t.length)return Oo({memberList:[],offset:h});var a=t.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));return n._updateLocalGroupMemberMap(o,a),m.length5?i+=\" userIDList.length:\".concat(e.userIDList.length):i+=\" userIDList:\".concat(e.userIDList),Je.l(\"\".concat(a,\" \").concat(i)),e.userIDList.length>50&&(e.userIDList=e.userIDList.slice(0,50));var s=e.groupID,r=e.userIDList,c=this._groupModule.getLocalGroupProfile(s);if(c&&bt(c.type)){var u=Ao.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Go({code:u,message:this._groupModule.getErrorMessage(u,o)})}var l=new Xo(o);return l.setMessage(i),this._getGroupMemberProfileAdvance(t(t({},e),{},{userIDList:r})).then((function(e){var t=e.data.members;return vt(t)&&0!==t.length?(n._updateLocalGroupMemberMap(s,t),n._groupModule.getModule($n).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[Xe.NICK,Xe.AVATAR]})):Oo([])})).then((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));n._updateLocalGroupMemberMap(s,t);var o=r.filter((function(e){return n.hasLocalGroupMember(s,e)})).map((function(e){return n.getLocalGroupMemberInfo(s,e)}));return l.setNetworkType(n._groupModule.getNetworkType()).end(),No({memberList:o})}))}},{key:\"addGroupMember\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"addGroupMember\"),o=e.groupID,a=this._groupModule.getLocalGroupProfile(o),i=a.type,s=new Xo(\"addGroupMember\");if(s.setMessage(\"groupID:\".concat(o,\" groupType:\").concat(i)),bt(i)){var r=new ko({code:Ao.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return s.setError(r,!0,this._groupModule.getNetworkType()).end(),Go(r)}return e.userIDList=e.userIDList.map((function(e){return{userID:e}})),Je.l(\"\".concat(n,\" groupID:\").concat(o)),this._groupModule.request({protocolName:Uo.ADD_GROUP_MEMBER,requestData:e}).then((function(o){var i=o.data.members;Je.l(\"\".concat(n,\" ok\"));var r=i.filter((function(e){return 1===e.result})).map((function(e){return e.userID})),c=i.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),u=i.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),l=i.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),d=\"groupID:\".concat(e.groupID,\", \")+\"successUserIDList:\".concat(r,\", \")+\"failureUserIDList:\".concat(c,\", \")+\"existedUserIDList:\".concat(u,\", \")+\"overLimitUserIDList:\".concat(l);return s.setNetworkType(t._groupModule.getNetworkType()).setMoreMessage(d).end(),0===r.length?No({successUserIDList:r,failureUserIDList:c,existedUserIDList:u,overLimitUserIDList:l}):(a.memberCount+=r.length,t._updateConversationGroupProfile(a),No({successUserIDList:r,failureUserIDList:c,existedUserIDList:u,overLimitUserIDList:l,group:a}))})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"deleteGroupMember\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteGroupMember\"),o=e.groupID,a=e.userIDList,i=this._groupModule.getLocalGroupProfile(o);if(mt(i))return Go({code:Ao.CANNOT_FIND_GRP});if(bt(i.type))return this._groupModule.canIUse(K.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(e):this._groupModule.cannotUseCommercialAbility(\"deleteGroupMember\");var s=\"groupID:\".concat(o,\" \").concat(a.length>5?\"userIDList.length:\".concat(a.length):\"userIDList:\".concat(a));Je.l(\"\".concat(n,\" groupID:\").concat(o,\" userIDList:\"),a);var r=new Xo(\"deleteGroupMember\");return r.setMessage(s),this._groupModule.request({protocolName:Uo.DELETE_GROUP_MEMBER,requestData:e}).then((function(){return r.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),i.memberCount-=1,t._updateConversationGroupProfile(i),t.deleteLocalGroupMembers(o,a),No({group:i,userIDList:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_updateConversationGroupProfile\",value:function(e){this._groupModule.getModule(ao).updateConversationGroupProfile([e])}},{key:\"_banAVChatRoomMember\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"_banAVChatRoomMember\"),o=e.groupID,a=e.userIDList,i=\"groupID:\".concat(o,\" \").concat(a.length>5?\"userIDList.length:\".concat(a.length):\"userIDList:\".concat(a)),s=new Xo(\"_banAVChatRoomMember\");s.setMessage(i),Je.l(\"\".concat(n,\" groupID:\").concat(o,\" userIDList:\"),a);var r=this._groupModule.getLocalGroupProfile(o);return mt(e.duration)||0===e.duration?Go({code:Ao.BAN_DURATION_INVALID}):this._groupModule.request({protocolName:Uo.BAN_AVCHATROOM_MEMBER,requestData:e}).then((function(){return s.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),t.deleteLocalGroupMembers(o,a),No({group:r,userIDList:a})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"setGroupMemberMuteTime\",value:function(e){var t=this,n=e.groupID,o=e.userID,a=e.muteTime,i=\"\".concat(this._n,\".\").concat(\"setGroupMemberMuteTime\");if(o===this._groupModule.getMyUserID())return Go({code:Ao.CANNOT_MUTE_SELF});var s=\"groupID:\".concat(n,\" userID:\").concat(o,\" muteTime:\").concat(a);Je.l(\"\".concat(i,\" \").concat(s));var r=new Xo(\"setGroupMemberMuteTime\");return r.setMessage(s),this.modifyGroupMemberInfo({groupID:n,userID:o,muteTime:a}).then((function(e){r.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l(\"\".concat(i,\" ok\"));var o=t._groupModule.getLocalGroupProfile(n);return No({group:o,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Je.e(\"\".concat(i,\" failed. error:\"),e),Go(e)}))}},{key:\"setGroupMemberRole\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setGroupMemberRole\"),o=e.groupID,a=e.userID,i=e.role,s=\"groupID:\".concat(o,\" userID:\").concat(a,\" role:\").concat(i),r=this._groupModule.getLocalGroupProfile(o);if(!r||r.type===S.GRP_WORK||r.type===S.GRP_AVCHATROOM)return Go({code:Ao.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});if(r&&r.selfInfo.role!==S.GRP_MBR_ROLE_OWNER)return Go({code:Ao.NOT_OWNER});var c=[S.GRP_MBR_ROLE_ADMIN,S.GRP_MBR_ROLE_MEMBER];if(wt({groupID:o})&&c.push(S.GRP_MBR_ROLE_CUSTOM),c.indexOf(i)<0)return Go({code:Ao.INVALID_MEMBER_ROLE});if(a===this._groupModule.getMyUserID())return Go({code:Ao.CANNOT_SET_SELF_MEMBER_ROLE});var u=new Xo(\"setGroupMemberRole\");return u.setMessage(s),Je.l(\"\".concat(n,\" \").concat(s)),this.modifyGroupMemberInfo({groupID:o,userID:a,role:i}).then((function(e){return u.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),No({group:r,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_filterProfanity\",value:function(e,t){var n=this._groupModule.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],Z),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:\"setGroupMemberNameCard\",value:function(e){var t=this,n=\"setGroupMemberNameCard\",o=\"\".concat(this._n,\".\").concat(n);if(e.nameCard&&!1===this._filterProfanity(\"nameCard\",e))return Go({code:Ao.PROFANITY_FOUND});var a=e.groupID,i=e.userID,s=void 0===i?this._groupModule.getMyUserID():i,r=e.nameCard,c=\"groupID:\".concat(a,\" userID:\").concat(s,\" nameCard:\").concat(r);Je.l(\"\".concat(o,\" \").concat(c));var u=this._groupModule.getLocalGroupProfile(a);if(u&&bt(u.type)){var l=Ao.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Go({code:l,message:this._groupModule.getErrorMessage(l,n)})}var d=new Xo(n);return d.setMessage(c),this.modifyGroupMemberInfo({groupID:a,userID:s,nameCard:r}).then((function(e){Je.l(\"\".concat(o,\" ok\")),d.setNetworkType(t._groupModule.getNetworkType()).end();var n=t._groupModule.getLocalGroupProfile(a);return s===t._groupModule.getMyUserID()&&n&&n.setSelfNameCard(r),No({group:n,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"setGroupMemberCustomField\",value:function(e){var t=this,n=\"setGroupMemberCustomField\",o=\"\".concat(this._n,\".\").concat(n),a=e.groupID,i=e.userID,s=void 0===i?this._groupModule.getMyUserID():i,r=e.memberCustomField,c=\"groupID:\".concat(a,\" userID:\").concat(s,\" memberCustomField:\").concat(JSON.stringify(r));Je.l(\"\".concat(o,\" \").concat(c));var u=this._groupModule.getLocalGroupProfile(a);if(u&&bt(u.type)){var l=Ao.OPERATION_NOT_SUPPORTED_IN_AVCHATROOM;return Go({code:l,message:this._groupModule.getErrorMessage(l,n)})}var d=new Xo(n);return d.setMessage(c),this.modifyGroupMemberInfo({groupID:a,userID:s,memberCustomField:r}).then((function(e){d.setNetworkType(t._groupModule.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\"));var n=t._groupModule.getLocalGroupProfile(a);return No({group:n,member:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"modifyGroupMemberInfo\",value:function(e){var n=this,o=e.groupID,a=e.userID,i=void 0;return Ft(o)&&(o=$t(i=o)),this._groupModule.request({protocolName:Uo.MODIFY_GROUP_MEMBER_INFO,requestData:t(t({},e),{},{groupID:o,topicID:i})}).then((function(){if(n.hasLocalGroupMember(o,a)){var t=n.getLocalGroupMemberInfo(o,a);return mt(e.muteTime)||t.updateMuteUntil(e.muteTime),mt(e.role)||t.updateRole(e.role),mt(e.nameCard)||t.updateNameCard(e.nameCard),mt(e.memberCustomField)||t.updateMemberCustomField(e.memberCustomField),t}var i=n._groupModule.getLocalGroupProfile(o);if(i&&!bt(i.type))return n.getGroupMemberProfile({groupID:o,userIDList:[a]}).then((function(e){return v(e.data.memberList,1)[0]}))}))}},{key:\"markGroupMemberList\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"markGroupMemberList\"),o=e.groupID,a=e.markType,i=e.enableMark,s=e.userIDList,r=void 0===s?[]:s,c=\"groupID:\".concat(o,\" markType:\").concat(a,\" enableMark:\").concat(i,\" userIDList count:\").concat(r.length);Je.l(\"\".concat(n,\" \").concat(c));var u=2,l=[];!0===i&&(u=1);var d=m(r);r.length>500&&(d=r.slice(0,500),Je.w(\"\".concat(n,\" \").concat(an(500)))),d.forEach((function(e){l.push({userID:e,markType:[a]})})),d=null;var p=new Xo(\"markGroupMemberList\");return p.setMessage(c),this._groupModule.request({protocolName:Uo.MARK_AVCHATROOM_MEMBER_INFO,requestData:{groupID:o,operationType:u,memberList:l}}).then((function(e){var o=e.data.memberList,a=void 0===o?[]:o,i=[],s=[];a.length===r.length?i.push.apply(i,m(r)):(a.forEach((function(e){i.push(e.userID)})),r.forEach((function(e){i.includes(e)||s.push(e)})));var c=\"success count:\".concat(i.length,\" fail count:\").concat(s.length);return p.setNetworkType(t._groupModule.getNetworkType()).setMessage(c).end(),Je.l(\"\".concat(n,\" ok. \").concat(c)),No({successUserIDList:i,failureUserIDList:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_getGroupMemberProfileAdvance\",value:function(e){return this._groupModule.request({protocolName:Uo.GET_GROUP_MEMBER_PROFILE,requestData:t(t({},e),{},{memberInfoFilter:e.memberInfoFilter?e.memberInfoFilter:this.DEFAULT_MEMBER_INFO_FILTER})})}},{key:\"_updateLocalGroupMemberMap\",value:function(e,t){var n=this;return vt(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new Ja(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:\"deleteLocalGroupMembers\",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:\"getLocalGroupMemberInfo\",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:\"setLocalGroupMember\",value:function(e,t){if(this.groupMemberListMap.has(e))this.groupMemberListMap.get(e).set(t.userID,t);else{var n=(new Map).set(t.userID,t);this.groupMemberListMap.set(e,n)}}},{key:\"getLocalGroupMemberList\",value:function(e){return this.groupMemberListMap.get(e)}},{key:\"hasLocalGroupMember\",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:\"hasLocalGroupMemberMap\",value:function(e){return this.groupMemberListMap.has(e)}},{key:\"reset\",value:function(){this.groupMemberListMap.clear()}}]),e}(),Xa=1,Qa=15,Za=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupSystemNoticeHandler\",this.pendencyMap=new Map}return i(e,[{key:\"onNewGroupSystemNotice\",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=e.isInstantMessage;Je.d(\"\".concat(this._n,\".onReceiveSystemNotice count:\").concat(t.length));var a=this.newSystemNoticeStoredAndSummary({notifiesList:t,isInstantMessage:o}),i=a.eventDataList,s=a.result;i.length>0&&(this._groupModule.getModule(ao).onNewMessage({conversationOptionsList:i,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:s,isInstantMessage:o}));o?s.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,s):!0===n&&this._clearGroupSystemNotice()}},{key:\"newSystemNoticeStoredAndSummary\",value:function(e){var n=e.notifiesList,o=e.isInstantMessage,a=null,i=n.length,s=0,r=[],c={conversationID:S.CONV_SYSTEM,unreadCount:0,type:S.CONV_SYSTEM,subType:null,lastMessage:null};for(s=0;s0?[c]:[],result:r}}},{key:\"_clearGroupSystemNotice\",value:function(){var e=this;this._getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set(\"\".concat(t.from,\"_\").concat(t.groupID,\"_\").concat(t.to),t)}));var n=e._groupModule.getModule(ao).getLocalMessageList(S.CONV_SYSTEM),o=[];n.forEach((function(t){var n=t.payload,a=n.operatorID,i=n.operationType,s=n.groupProfile;if(i===Xa){var r=\"\".concat(a,\"_\").concat(s.groupID,\"_\").concat(s.to),c=e.pendencyMap.get(r);c&&_t(c.handled)&&0!==c.handled&&o.push(t)}})),e.deleteGroupSystemNotice({messageList:o})}))}},{key:\"deleteGroupSystemNotice\",value:function(e){var t=this,n=\"\".concat(this._n,\".deleteGroupSystemNotice\");return vt(e.messageList)&&0!==e.messageList.length?(Je.l(\"\".concat(n,\" \")+e.messageList.map((function(e){return e.ID}))),this._groupModule.request({protocolName:Uo.DELETE_GROUP_SYSTEM_NOTICE,requestData:{messageListToDelete:e.messageList.map((function(e){return{from:S.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){Je.l(\"\".concat(n,\" ok\"));var o=t._groupModule.getModule(ao);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),No()})).catch((function(e){return Je.e(\"\".concat(n,\" error:\"),e),Go(e)}))):Oo()}},{key:\"_getPendencyList\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,o=void 0===n?void 0:n,a=t.startTime,i=void 0===a?0:a,s=t.limit,r=void 0===s?20:s;return this._groupModule.request({protocolName:Uo.GET_GROUP_PENDENCY,requestData:{type:o,startTime:i,limit:r,handleAccount:this._groupModule.getMyUserID()}}).then((function(t){var n=t.data.pendencyList;return 0!==t.data.nextStartTime?e._getPendencyList({startTime:t.data.nextStartTime}).then((function(e){return[].concat(m(n),m(e))})):n}))}},{key:\"getGroupApplicationList\",value:function(){var e=this;return this._getPendencyList().then((function(t){return e._getPendencyList({type:S.GRP_COMMUNITY}).then((function(n){return t.push.apply(t,m(n)),e._handlePendencyResult(t)})).catch((function(n){return e._handlePendencyResult(t)}))}))}},{key:\"_handlePendencyResult\",value:function(e){var t=this,n=[];return e.forEach((function(e){t.pendencyMap.set(\"\".concat(e.from,\"_\").concat(e.groupID,\"_\").concat(e.to),e),0===e.handled&&n.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})})),Oo({applicationList:n})}},{key:\"_onReceivedGroupSystemNotice\",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:break;case 2:t._onApplyGroupRequestAgreed(e);break;case 3:break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 6:break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._groupModule.onAVChatRoomMemberBanned(e)}}))}},{key:\"_onApplyGroupRequestAgreed\",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;if(n){t._groupModule.updateGroupMap([n]);var o=!n.isSupportTopic;t._groupModule.emitGroupListUpdate(!0,o)}}))}},{key:\"_onMemberKicked\",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:\"_onGroupDismissed\",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t);var n=this._groupModule._AVChatRoomHandler;n&&n.checkJoinedAVChatRoomByID(t)&&n.reset(t)}},{key:\"_onInviteGroup\",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;n&&(t._groupModule.updateGroupMap([n]),t._groupModule.emitGroupListUpdate())}))}},{key:\"_onQuitGroup\",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:\"_onSetManager\",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,a=this._groupModule.getGroupMemberHandler().getLocalGroupMemberInfo(o,n);a&&a.updateRole(S.GRP_MBR_ROLE_ADMIN)}},{key:\"_onDeleteManager\",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,a=this._groupModule.getGroupMemberHandler().getLocalGroupMemberInfo(o,n);a&&a.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:\"_onMessageRemindTypeSynced\",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.messageRemindType;this._groupModule.getModule(ao).onGroupMessageRemindTypeUpdated({groupID:t,messageRemindType:n})}},{key:\"_handleTopicSystemNotice\",value:function(e){var t=e.groupProfile,n=t.groupID,o=t.topicID,a=e.elements,i=a.operationType,s=a.topicIDList,r=a.messageRemindType,c=this._groupModule.getModule(oo);17===i?c.onTopicCreated({groupID:n,topicID:o}):18===i?c.onTopicDeleted({groupID:n,topicIDList:s}):20===i&&c.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:r})}},{key:\"reset\",value:function(){this.pendencyMap.clear()}}]),e}(),$a=[\"relayFlag\"],ei=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n=\"GroupModule\",t._commonGroupHandler=new Pa(g(t)),t._groupAttributesHandler=new xa(g(t)),t._groupCountersHandler=new Ka(g(t)),t._AVChatRoomHandler=new ja(g(t)),t._groupTipsHandler=new Ga(g(t)),t._groupSystemNoticeHandler=new Za(g(t)),t._groupMemberHandler=new za(g(t)),t.groupMap=new Map,t._unjoinedAVChatRoomList=new Map,t._receiptDetailCompleteMap=new Map,t._onlineMemberCountMap=new Map,t._timeoutIDs=[],t.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"polling_interval\"),t=this.getCloudConfig(\"polling_interval_plus\"),n=this.getCloudConfig(\"polling_no_msg_count\"),o=this.getCloudConfig(\"polling_simplified_msg\"),a=this.getCloudConfig(\"paging_grp_count\");Je.l(\"\".concat(this._n,\"._onCloudConfigUpdated pollingInterval:\").concat(e)+\" pollingIntervalPlus:\".concat(t,\" pollingNoMessageCount:\").concat(n)+\" pollingSimplifiedMessage:\".concat(o,\" pagingGroupCount:\").concat(a)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n),this._AVChatRoomHandler.setPollingSimplifiedMessage(o),this._commonGroupHandler.setPagingGroupCount(a)}},{key:\"onCheckTimer\",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:\"guardForAVChatRoom\",value:function(e){var t=this;if(e.conversationType===S.CONV_GROUP){var n=Ft(e.to)?$t(e.to):e.to;return this.hasLocalGroup(n)?Oo():this.getGroupProfile({groupID:n}).then((function(o){var a=o.data.group.type;if(Je.l(\"\".concat(t._n,\".guardForAVChatRoom. groupID:\").concat(n,\" type:\").concat(a)),a===S.GRP_AVCHATROOM){var i=Ao.MSG_SEND_FAIL_NOT_IN_AVCHATROOM;return Go(new ko({code:i,message:t.getErrorMessage(i,e.from,n),data:{message:e}}))}return Oo()}))}return Oo()}},{key:\"checkJoinedAVChatRoomByID\",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:\"onNewGroupMessage\",value:function(e){this._commonGroupHandler.onNewGroupMessage(e)}},{key:\"updateNextMessageSeq\",value:function(e){var t=this;if(vt(e)){var n=this.getModule(oo);e.forEach((function(e){var o=e.conversationID.replace(S.CONV_GROUP,\"\");Ft(o)&&n.updateLastMessage(o,e.lastMessage),t.groupMap.has(o)&&(t.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)}))}}},{key:\"onNewGroupTips\",value:function(e){this._groupTipsHandler.onNewGroupTips(e)}},{key:\"onGroupMessageRevoked\",value:function(e){this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:\"onNewGroupSystemNotice\",value:function(e){this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:\"onGroupMessageReadNotice\",value:function(e){var t=this;e.dataList.forEach((function(e){var n=e.elements.groupMessageReadNotice;if(!mt(n)){var o=t.getModule(ao);n.forEach((function(e){var n=e.groupID,a=e.topicID,i=void 0===a?void 0:a,s=e.lastMessageSeq;Je.d(\"\".concat(t._n,\".onGroupMessageReadNotice groupID:\").concat(n,\" lastMessageSeq:\").concat(s));var r=\"\".concat(S.CONV_GROUP).concat(n),c=!0;pn(i)||(r=\"\".concat(S.CONV_GROUP).concat(i),c=!1),o.updateIsReadAfterReadReport({conversationID:r,lastMessageSeq:s}),o.updateUnreadCount(r,c),o.clearGroupAtInfoList(r,c)}))}}))}},{key:\"onReadReceiptList\",value:function(e){var t=this;Je.d(\"\".concat(this._n,\".onReadReceiptList options:\"),JSON.stringify(e)),e.dataList.forEach((function(e){var n=e.groupProfile,o=e.elements,a=n.groupID,i=t.getModule(ao),s=o.readReceiptList;i.updateReadReceiptInfo({groupID:a,readReceiptList:s})}))}},{key:\"onGroupMessageModified\",value:function(e){Je.d(\"\".concat(this._n,\".onGroupMessageModified options:\"),JSON.stringify(e));var n=this.getModule(ao);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:S.CONV_GROUP,to:e.topicID?e.topicID:e.groupID}))}))}},{key:\"deleteGroupSystemNotice\",value:function(e){this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:\"initGroupMap\",value:function(e){this.groupMap.set(e.groupID,new Na(e))}},{key:\"clearGroupMap\",value:function(){this.groupMap.clear()}},{key:\"deleteGroup\",value:function(e){this.groupMap.delete(e)}},{key:\"updateGroupMap\",value:function(e){var t,n=this,o=this.getModule(ao);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new Na(e)),o.deleteGroupRoamingMessageInfo(t))}));var a,i=this.getMyUserID(),s=D(this.groupMap);try{for(s.s();!(a=s.n()).done;){var r=v(a.value,2)[1];r.selfInfo.userID=i,\"Owner\"===r.selfInfo.role&&(r.ownerID=i)}}catch(c){s.e(c)}finally{s.f()}}},{key:\"getGroupMap\",value:function(){return this.groupMap}},{key:\"getLocalGroupList\",value:function(){return m(this.groupMap.values())}},{key:\"getLocalGroupProfile\",value:function(e){return this.groupMap.get(e)}},{key:\"sortLocalGroupList\",value:function(){var e=m(this.groupMap).filter((function(e){var t=v(e,2);return t[0],!pn(t[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(m(e))}},{key:\"updateGroupLastMessage\",value:function(e){this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:\"emitGroupListUpdate\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();if(e&&this.emitOuterEvent(E.GROUP_LIST_UPDATED),t){var o=JSON.parse(JSON.stringify(n)),a=this.getModule(ao);a.updateConversationGroupProfile(o)}}},{key:\"getMyNameCardByGroupID\",value:function(e){var t=this.getLocalGroupProfile(e);return t?t.selfInfo.nameCard:\"\"}},{key:\"isPagingGetCompleted\",value:function(){return this._commonGroupHandler.isPagingGetCompleted()}},{key:\"getMessageRemindType\",value:function(e){var t=this;if(vt(e)&&0!==e.length){var n=e.filter((function(e){return!bt(t.getLocalGroupProfile(e).type)}));0!==n.length&&(Je.l(\"\".concat(this._n,\".getMessageRemindType groupIDList:\").concat(n)),this.getGroupProfileAdvance({groupIDList:n,responseFilter:{memberInfoFilter:[\"MsgFlag\"]}}).then((function(e){var n=e.data.successGroupList,o=t.getModule(ao);n.forEach((function(e){o.onGroupMessageRemindTypeUpdated({groupID:e.groupID,messageRemindType:vt(e.members)?e.members[0].messageRemindType:\"\"})}))})))}}},{key:\"getGroupList\",value:function(){return this._commonGroupHandler.getGroupList()}},{key:\"syncCommunityWithTopic\",value:function(){return this._commonGroupHandler.syncGroupList(!0)}},{key:\"getGroupProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getGroupProfile\"),o=new Xo(\"getGroupProfile\"),a=e.groupID,i=e.groupCustomFieldFilter;Je.l(\"\".concat(n,\" groupID:\").concat(a));var s={groupIDList:[a],responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\",\"Introduction\",\"Notification\",\"FaceUrl\",\"Owner_Account\",\"CreateTime\",\"InfoSeq\",\"LastInfoTime\",\"LastMsgTime\",\"MemberNum\",\"MaxMemberNum\",\"ApplyJoinOption\",\"NextMsgSeq\",\"ShutUpAllMember\",\"InviteJoinOption\"],groupCustomFieldFilter:i,memberInfoFilter:[\"Role\",\"JoinTime\",\"MsgSeq\",\"MsgFlag\",\"NameCard\"]}};return this.getGroupProfileAdvance(s).then((function(e){var i,s=e.data,r=s.successGroupList,c=s.failureGroupList;if(Je.l(\"\".concat(n,\" ok\")),c.length>0)return Go(c[0]);(bt(r[0].type)&&!t.hasLocalGroup(a)?i=new Na(r[0]):(t.updateGroupMap(r),i=t.getLocalGroupProfile(a)),i.isSupportTopic)||t.getModule(ao).updateConversationGroupProfile([i]);return o.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(a,\" type:\").concat(i.type,\" muteAllMembers:\").concat(i.muteAllMembers,\" ownerID:\").concat(i.ownerID)).end(),No({group:i})})).catch((function(a){return t.probeNetwork().then((function(t){var n=v(t,2),i=n[0],s=n[1];o.setError(a,i,s).setMessage(\"groupID:\".concat(e.groupID)).end()})),Je.e(\"\".concat(n,\" failed. error:\"),a),Go(a)}))}},{key:\"getGroupProfileAdvance\",value:function(e){var n=\"\".concat(this._n,\".getGroupProfileAdvance\"),o=e.groupIDList;vt(o)&&o.length>50&&(this.outputWarning(\"GetGroupProfileLimit\"),o.length=50);var a=[],i=[];o.forEach((function(e){wt({groupID:e})?i.push(e):a.push(e)}));var s=[];if(a.length>0){var r=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:a}));s.push(r)}if(i.length>0){var c=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:i,relayFlag:a.length>0}));s.push(c)}return Promise.all(s).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,m(e.successGroupList)),n.push.apply(n,m(e.failureGroupList))})),No({successGroupList:t,failureGroupList:n})})).catch((function(e){return Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_getGroupProfileAdvance\",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,a=_(e,$a);return this.request({protocolName:Uo.GET_GROUP_PROFILE,requestData:a}).then((function(e){Je.l(\"\".concat(t._n,\"._getGroupProfileAdvance ok. options:\"),a);var n=e.data.groups;return{successGroupList:n.filter((function(e){return mt(e.errorCode)||0===e.errorCode})),failureGroupList:n.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new ko({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&wt({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Go(t)}))}},{key:\"createGroup\",value:function(e){var n=this,o=[S.GRP_PUBLIC,S.GRP_WORK,S.GRP_MEETING,S.GRP_AVCHATROOM,S.GRP_COMMUNITY],a=\"\".concat(this._n,\".\").concat(\"createGroup\"),i=e.type,s=e.groupID;if(e.name&&!1===this._filterProfanity(\"name\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Go({code:Ao.PROFANITY_FOUND});if(!o.includes(i))return Go({code:Ao.ILLEGAL_GRP_TYPE});if(!wt({type:i})){if(!pn(s)&&wt({groupID:s}))return Go({code:Ao.ILLEGAL_GRP_ID});e.isSupportTopic=void 0}if(bt(i)&&!mt(e.memberList)&&e.memberList.length>0&&(e.memberList=void 0),this._canIUseJoinOption(i)||mt(e.joinOption)||(e.joinOption=void 0),wt({type:i})){if(!pn(s)&&!wt({groupID:s}))return Go({code:Ao.ILLEGAL_GRP_ID});e.isSupportTopic=!0===e.isSupportTopic?1:0}var r=new Xo(\"createGroup\");Je.l(\"\".concat(a,\" options:\"),e);var c=null,u=[];return this.request({protocolName:Uo.CREATE_GROUP,requestData:t(t({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(o){var i=o.data,s=i.groupID,l=i.overLimitUserIDList,d=void 0===l?[]:l;c=s,u=d;var p=\"groupType:\".concat(e.type,\" groupID:\").concat(s,\" overLimitUserIDList:\").concat(d);if(r.setNetworkType(n.getNetworkType()).setMessage(p).end(),Je.l(\"\".concat(a,\" ok. \").concat(p)),e.type===S.GRP_AVCHATROOM)return n.getGroupProfile({groupID:s});if(e.type===S.GRP_COMMUNITY&&1===e.isSupportTopic)return n.getGroupProfile({groupID:s});pn(e.memberList)||pn(d)||(e.memberList=e.memberList.filter((function(e){return-1===d.indexOf(e.userID)}))),n.updateGroupMap([t(t({},e),{},{groupID:s})]);var _=n.getModule(Qn),g=\"\",h=0;e.type===S.GRP_COMMUNITY?(g=n.isIntl()?\"Create Community\":\"创建社群\",h=1):g=n.isIntl()?\"Create Group\":\"创建群组\";var f=n.getModule($n).getMyNick(),v=_.createCustomMessage({to:s,conversationType:S.CONV_GROUP,payload:{data:JSON.stringify({businessID:\"group_create\",content:g,cmd:h,opUser:f||n.getMyUserID(),version:4})}});return _.sendMessageInstance(v),n.emitGroupListUpdate(),n.getGroupProfile({groupID:s})})).then((function(e){var t=e.data.group,n=t.selfInfo,o=n.nameCard,a=n.joinTime;return t.updateSelfInfo({nameCard:o,joinTime:a,messageRemindType:S.MSG_REMIND_ACPT_AND_NOTE,role:S.GRP_MBR_ROLE_OWNER}),No({group:t,overLimitUserIDList:u})})).catch((function(o){if(r.setMessage(\"groupType:\".concat(e.type)),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],a=t[1];r.setError(o,n,a).end()})),10010===o.code||10007===o.code){n._silentlyGetGroupProfile(o.code,c),n.updateGroupMap([t(t({},e),{},{groupID:c})]);var i=n.getLocalGroupProfile(c);return i.selfInfo.role=S.GRP_MBR_ROLE_OWNER,No({group:i,overLimitUserIDList:u})}return Je.e(\"\".concat(a,\" failed. error:\"),o),Go(o)}))}},{key:\"dismissGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"dismissGroup\"),o=\"groupID:\".concat(e);if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===S.GRP_WORK)return Go(new ko({code:Ao.CANNOT_DISMISS_WORK}));var a=new Xo(\"dismissGroup\");return a.setMessage(o),Je.l(\"\".concat(n,\" \").concat(o)),this.request({protocolName:Uo.DISMISS_GROUP,requestData:{groupID:e}}).then((function(){return a.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),No({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"updateGroupProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"updateGroupProfile\");if(this.hasLocalGroup(e.groupID)){var o=this.getLocalGroupProfile(e.groupID).type;this._canIUseJoinOption(o)||mt(e.joinOption)||(Je.w(\"\".concat(n,\" joinOption is unavailable for Work/Meeting/AVChatRoom\")),e.joinOption=void 0)}if(mt(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers=\"On\":e.muteAllMembers=\"Off\"),e.name&&!1===this._filterProfanity(\"name\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Go({code:Ao.PROFANITY_FOUND});var a=new Xo(\"updateGroupProfile\");return a.setMessage(JSON.stringify(e)),Je.l(\"\".concat(n,\" groupID:\").concat(e.groupID)),this.request({protocolName:Uo.UPDATE_GROUP_PROFILE,requestData:e}).then((function(){(a.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),t.hasLocalGroup(e.groupID))&&t.groupMap.get(e.groupID).updateGroup(e);return No({group:t.groupMap.get(e.groupID)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.l(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_filterProfanity\",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],Q),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:\"joinGroup\",value:function(e){var t=this,n=e.groupID,o=e.type,a=\"\".concat(this._n,\".joinGroup\");if(o===S.GRP_WORK)return Go({code:Ao.CANNOT_JOIN_WORK});if(this.deleteUnjoinedAVChatRoom(n),this.hasLocalGroup(n)){if(!this.isLoggedIn())return Oo({status:S.JOIN_STATUS_ALREADY_IN_GROUP});var i=new Xo(\"applyJoinGroup\");return this.getGroupProfile({groupID:n}).then((function(){return i.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(n,\" joinedStatus:\").concat(S.JOIN_STATUS_ALREADY_IN_GROUP)).end(),Oo({status:S.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(o){return i.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(n,\" unjoined\")).end(),Je.w(\"\".concat(a,\" \").concat(n,\" was unjoined, now join!\")),t.groupMap.delete(n),t.applyJoinGroup(e)}))}return Je.l(\"\".concat(a,\" groupID:\").concat(n)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:\"applyJoinGroup\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"applyJoinGroup\"),a=e.groupID;if(!pn(e.applyMessage)&&!1===this._filterProfanity(\"applyMessage\",e))return Go({code:Ao.PROFANITY_FOUND});var i=new Xo(\"applyJoinGroup\"),s=t({},e),r=this.canIUse(K.AVCHATROOM_HISTORY_MSG);return r&&(s.historyMessageFlag=1),this.getModule(ao).deleteTopicRoamingMessageInfo(a),this.request({protocolName:Uo.APPLY_JOIN_GROUP,requestData:s}).then((function(e){var t=e.data,s=t.joinedStatus,c=t.longPollingKey,u=t.startSeq,l=t.avChatRoomFlag,d=t.avChatRoomKey,p=t.messageList,_=\"groupID:\".concat(a,\" joinedStatus:\").concat(s,\" longPollingKey:\").concat(c,\" startSeq:\").concat(u)+\" avChatRoomFlag:\".concat(l,\" canGetAVChatRoomHistoryMessage:\").concat(r,\",\")+\" history message count:\".concat(pn(p)?0:p.length);switch(i.setNetworkType(n.getNetworkType()).setMessage(\"\".concat(_)).end(),Je.l(\"\".concat(o,\" ok. \").concat(_)),s){case rt:return No({status:rt});case st:return n.getGroupProfile({groupID:a}).then((function(e){var t=e.data.group;return n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:c,startSeq:u,avChatRoomKey:d,messageList:p})})).catch((function(e){if(10010===e.code||10007===e.code){n._silentlyGetGroupProfile(e.code,a);var t=new Na({groupID:a});return n.updateGroupMap([t]),n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:c,startSeq:u,avChatRoomKey:d,messageList:p})}return Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}));default:var g=new ko({code:Ao.JOIN_GRP_FAIL});return Je.e(\"\".concat(o,\" failed. error:\"),g),Go(g)}})).catch((function(e){return i.setMessage(\"groupID:\".concat(a)),n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"_handleJoinResult\",value:function(e){var t,n=this,o=e.group,a=e.avChatRoomFlag,i=e.longPollingKey,s=e.startSeq,r=e.avChatRoomKey,c=e.messageList,u=o.groupID;return 1===a?(this.getModule(ao).setCompleted(\"\".concat(S.CONV_GROUP).concat(u)),this._groupAttributesHandler.initGroupAttributesCache({groupID:u,avChatRoomKey:r}),this._groupCountersHandler.initGroupCountersCache({groupID:u,avChatRoomKey:r}),(t=mt(i)?this._AVChatRoomHandler.handleJoinResult({group:o}):this._AVChatRoomHandler.startRunLoop({group:o,longPollingKey:i,startSeq:s})).then((function(){n._onAVChatRoomHistoryMessage(c,u)})),t):(this.emitGroupListUpdate(!0,!1),No({status:st,group:o}))}},{key:\"quitGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"quitGroup\"),o=\"groupID:\".concat(e);Je.l(\"\".concat(n,\" \").concat(o));var a=this.checkJoinedAVChatRoomByID(e);if(!a&&!this.hasLocalGroup(e))return Go({code:Ao.MEMBER_NOT_IN_GRP});if(a&&!this.isLoggedIn())return Je.l(\"\".concat(n,\" anonymously ok. \").concat(o)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),Oo({groupID:e});var i=new Xo(\"quitGroup\");return i.setMessage(o),this.request({protocolName:Uo.QUIT_GROUP,requestData:{groupID:e}}).then((function(){return i.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),t.deleteLocalGroupAndConversation(e),a&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),No({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"searchGroupByID\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"searchGroupByID\"),o={groupIDList:[e]},a=new Xo(\"searchGroupByID\");return a.setMessage(\"groupID:\".concat(e)),Je.l(\"\".concat(n,\" groupID:\").concat(e)),this.request({protocolName:Uo.SEARCH_GROUP,requestData:o}).then((function(e){var o=e.data.groupProfile;if(0!==o[0].errorCode)throw new ko({code:o[0].errorCode,message:o[0].errorInfo});return a.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\")),No({group:new Na(o[0])})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"changeGroupOwner\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"changeGroupOwner\");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===S.GRP_AVCHATROOM)return Go({code:Ao.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(e.newOwnerID===this.getMyUserID())return Go({code:Ao.CANNOT_CHANGE_OWNER_TO_SELF});var o=new Xo(\"changeGroupOwner\");return o.setMessage(\"groupID:\".concat(e.groupID,\" newOwnerID:\").concat(e.newOwnerID)),Je.l(\"\".concat(n,\" groupID:\").concat(e.groupID)),this.request({protocolName:Uo.CHANGE_GROUP_OWNER,requestData:e}).then((function(){o.setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok\"));var a=e.groupID,i=e.newOwnerID;t.groupMap.get(a).ownerID=i;var s=t._groupMemberHandler.getLocalGroupMemberList(a);if(s instanceof Map){var r=s.get(t.getMyUserID());mt(r)||(r.updateRole(\"Member\"),t.groupMap.get(a).selfInfo.role=\"Member\");var c=s.get(i);mt(c)||c.updateRole(\"Owner\")}return t.emitGroupListUpdate(!0,!1),No({group:t.groupMap.get(a)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"getGroupApplicationList\",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:\"handleGroupApplication\",value:function(e){var t,n,o,a,i,s=this,r=\"\".concat(this._n,\".\").concat(\"handleGroupApplication\"),c=e.handleAction,u=e.handleMessage,l=e.message,d=e.application;l?(t=l.payload.operatorID,n=l.payload.groupProfile.groupID,o=l.payload.authentication,a=l.payload.messageKey):d&&(t=d.applicant,n=d.groupID,o=d.authentication,a=d.messageKey);var p=Uo.HANDLE_GROUP_APPLICATION;d&&2===d.applicationType&&(p=Uo.HANDLE_INVITE_JOIN_GROUP,i=d.userID);var _=new Xo(\"handleGroupApplication\");return _.setMessage(\"groupID:\".concat(n)),Je.l(\"\".concat(r,\" groupID:\").concat(n)),this.request({protocolName:p,requestData:{handleAction:c,handleMessage:u,applicant:t,invitee:i,groupID:n,authentication:o,messageKey:a}}).then((function(){return _.setNetworkType(s.getNetworkType()).end(),Je.l(\"\".concat(r,\" ok\")),l&&s._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),No({group:s.getLocalGroupProfile(n)})})).catch((function(e){return s.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];_.setError(e,o,a).end()})),Je.e(\"\".concat(r,\" failed. error\"),e),Go(e)}))}},{key:\"handleGroupInvitation\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"handleGroupInvitation\"),a=e.message.payload,i=a.groupProfile.groupID,s=a.authentication,r=a.messageKey,c=a.operatorID,u=e.handleAction,l=new Xo(\"handleGroupInvitation\");return l.setMessage(\"groupID:\".concat(i,\" inviter:\").concat(c,\" handleAction:\").concat(u)),Je.l(\"\".concat(o,\" groupID:\").concat(i,\" inviter:\").concat(c,\" handleAction:\").concat(u)),this.request({protocolName:Uo.HANDLE_GROUP_INVITATION,requestData:t(t({},e),{},{inviter:c,groupID:i,authentication:s,messageKey:r})}).then((function(){return l.setNetworkType(n.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),No({group:n.getLocalGroupProfile(i)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error\"),e),Go(e)}))}},{key:\"getGroupOnlineMemberCount\",value:function(e){var t=this,n=\"\".concat(this._n,\".getGroupOnlineMemberCount\"),o=this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e),a=this.hasLocalGroup(e);if(Je.l(\"\".concat(n,\" groupID:\").concat(e,\" isAVChatRoom:\").concat(o,\" has:\").concat(a)),o)return this._AVChatRoomHandler.getGroupOnlineMemberCount(e);if(!a)return Oo({memberCount:0});var i=Date.now();if(this._onlineMemberCountMap.has(e)){var s=this._onlineMemberCountMap.get(e);if(i-s.lastReqTime<=6e4)return Oo({memberCount:s.memberCount});s.lastReqTime=i}return this.requestOnlineCount(e).then((function(o){var a=o.data.memberCount,i=void 0===a?0:a;return t._onlineMemberCountMap.set(e,{lastReqTime:Date.now(),memberCount:i}),Je.l(\"\".concat(n,\" ok. groupID:\").concat(e,\" memberCount:\").concat(i)),Oo({memberCount:i})})).catch((function(e){return Je.w(\"\".concat(n,\" failed. error:\"),e),Promise.reject(e)}))}},{key:\"requestOnlineCount\",value:function(e){return this.request({protocolName:Uo.GET_ONLINE_MEMBER_NUM,requestData:{groupID:e}})}},{key:\"hasLocalGroup\",value:function(e){return this.groupMap.has(e)}},{key:\"deleteLocalGroupAndConversation\",value:function(e){var t=this.checkJoinedAVChatRoomByID(e);(Je.l(\"\".concat(this._n,\".deleteLocalGroupAndConversation isJoinedAVChatRoom:\").concat(t)),t)&&this.getModule(ao).deleteLocalConversation(\"\".concat(S.CONV_GROUP).concat(e));if(wt({groupID:e})){var n=this.getLocalGroupProfile(e);if(n&&!0===n.isSupportTopic)this.getModule(oo).deleteTopicListInCommunity(e)}this._deleteLocalGroup(e),this._onlineMemberCountMap.delete(e),this.emitGroupListUpdate(!0,!1)}},{key:\"_deleteLocalGroup\",value:function(e){this.groupMap.delete(e),this._groupMemberHandler.deleteGroupMemberList(e)}},{key:\"sendMessage\",value:function(e,t){if(vt(e._receiverList)&&e._receiverList.length>0&&!this.canIUse(K.MSG_TO_SPECIFIED_GRP_MBR))return this.cannotUseCommercialAbility(\"group direct messages\");var n=this.createGroupMessagePack(e,t);return this.request(n)}},{key:\"createGroupMessagePack\",value:function(e,t){var n=null;t&&t.offlinePushInfo&&(n=t.offlinePushInfo);var o=\"\";gt(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push(\"NoUnread\"),!0===r&&a.push(\"NoLastMsg\"),!0===c&&a.push(\"NoMsgCheck\")}var u=void 0;vt(e._receiverList)&&e._receiverList.length>0&&(u=e._receiverList,e._receiverList.length>50&&(u=e._receiverList.slice(0,50),this.outputWarning(\"ReceiverListLimit\")));var l=this.isOnlineMessage(e,t)?1:0,d=e.getGroupAtInfoList(),p={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==S.MSG_TEXT||pn(d)?void 0:d,onlineOnlyFlag:l,clientTime:e.clientTime,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||\"\",desc:n.description||\"\",ext:n.extension||\"\",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||\"\"}}:void 0,messageControlInfo:0===l?a:void 0,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:u,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0};return Ft(e.to)&&(p.groupID=$t(e.to),p.topicID=e.to),{protocolName:Uo.SEND_GROUP_MESSAGE,tjgID:this.generateTjgID(e),requestData:p}}},{key:\"_isVoipPush\",value:function(e){var t=void 0;return mt(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:\"revokeMessage\",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Ft(e.to)&&(t.groupID=$t(e.to),t.topicID=e.to),this.request({protocolName:Uo.REVOKE_GROUP_MESSAGE,requestData:t})}},{key:\"deleteMessage\",value:function(e){var t=e.to,n=e.keyList;Je.l(\"\".concat(this._n,\".deleteMessage groupID:\").concat(t,\" count:\").concat(n.length));var o={groupID:t,deleter:this.getMyUserID(),keyList:n};return Ft(t)&&(o.groupID=$t(t),o.topicID=t),this.request({protocolName:Uo.DELETE_GROUP_MESSAGE,requestData:o})}},{key:\"modifyRemoteMessage\",value:function(e){var t=e.to,n=e.sequence,o=e.payload,a=e.type,i=e.version,s=void 0===i?0:i,r=e.cloudCustomData,c=t,u=void 0;Ft(t)&&(c=$t(t),u=t);var l=void 0;return tn(a)&&(l=[]).push({type:a,content:o}),this.request({protocolName:Uo.MODIFY_GROUP_MESSAGE,requestData:{groupID:c,topicID:u,sequence:n,version:s,elements:l,cloudCustomData:r}})}},{key:\"getRoamingMessage\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessage\"),o=e.conversationID,a=e.groupID,i=e.sequence,s=new Xo(\"getGroupRoamingMessages\"),r=0,c=void 0;return Ft(a)&&(a=$t(c=a)),this._computeLastSequence({groupID:a,topicID:c,sequence:i}).then((function(e){return r=e,Je.l(\"\".concat(n,\" groupID:\").concat(a,\" startSequence:\").concat(r)),t.request({protocolName:Uo.GET_GROUP_ROAMING_MESSAGE,requestData:{groupID:a,count:21,sequence:r,topicID:c}})})).then((function(e){var i=e.data,u=i.messageList,l=i.complete,d=i.invisibleSequenceList,p=void 0===d?[]:d,_=e.data.nextSequence,g=void 0===_?0:_;mt(u)?Je.l(\"\".concat(n,\" ok. complete:\").concat(l,\" nextSequence:\").concat(g,\" but messageList is undefined!\")):Je.l(\"\".concat(n,\" ok. complete:\").concat(l,\" nextSequence:\").concat(g,\" count:\").concat(u.length)),s.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(a,\" topicID:\").concat(c,\" startSequence:\").concat(r,\" complete:\").concat(l,\" nextSequence:\").concat(g)).end();var h=t.getModule(ao),f=[];return pn(u)?g>=1&&h.updateRoamingMessageSequence(o,g):(h.updateRoamingMessageSequence(o,g),f=h.onRoamingMessage(u,o),h.updateIsRead(o),h.patchConversationLastMessage(o)),(2===l||g<1)&&(h.setCompleted(o),g=\"\"),Je.l(\"\".concat(n,\" nextReqID:\").concat(g,\", stored message count:\").concat(f.length,\", invisible sequence count:\").concat(p.length)),{nextReqID:g+\"\",storedMessageList:f}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];s.setError(e,o,i).setMessage(\"groupID:\".concat(a,\" topicID:\").concat(c,\" startSequence:\").concat(r)).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_getGroupIDOfMessage\",value:function(e){return e.conversationID.replace(S.CONV_GROUP,\"\")}},{key:\"getReadReceiptList\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getReadReceiptList\"),o=this._getGroupIDOfMessage(e[0]),a=this.getMyUserID(),i=e.filter((function(e){return e.from===a&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));if(Je.l(\"\".concat(n,\" groupID:\").concat(o,\" sequenceList:\").concat(JSON.stringify(i))),0===i.length)return Oo({messageList:e});var s=new Xo(\"getReadReceiptList\");return s.setMessage(\"groupID:\".concat(o)),this.request({protocolName:Uo.GET_READ_RECEIPT,requestData:{groupID:o,sequenceList:i}}).then((function(t){s.end(),Je.l(\"\".concat(n,\" ok\"));var o=t.data.readReceiptList;return vt(o)&&o.forEach((function(t){e.forEach((function(e){0===t.code&&t.sequence===e.sequence&&(e.readReceiptInfo.readCount=t.readCount,e.readReceiptInfo.unreadCount=t.unreadCount)}))})),No({messageList:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"sendReadReceipt\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"sendReadReceipt\"),o=this._getGroupIDOfMessage(e[0]),a=new Xo(\"sendReadReceipt\");a.setMessage(\"groupID:\".concat(o));var i=this.getMyUserID(),s=e.filter((function(e){return e.from!==i&&!0===e.needReadReceipt})).map((function(e){return{sequence:e.sequence}}));return 0===s.length?Go({code:Ao.READ_RECEIPT_MSG_LIST_EMPTY}):(Je.l(\"\".concat(n,\". sequenceList:\").concat(JSON.stringify(s))),this.request({protocolName:Uo.SEND_READ_RECEIPT,requestData:{groupID:o,sequenceList:s}}).then((function(e){return a.end(),Je.l(\"\".concat(n,\" ok\")),No()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)})))}},{key:\"getReadReceiptDetail\",value:function(e){var t=this,n=e.message,o=e.filter,a=e.cursor,i=e.count,s=this._getGroupIDOfMessage(n),r=n.ID,c=n.sequence,u=\"\".concat(this._n,\".\").concat(\"getReadReceiptDetail\"),l=this._receiptDetailCompleteMap.get(r)||!1,d=0!==o&&1!==o?0:o,p=gt(a)?a:\"\",_=!_t(i)||i<=0||i>=100?100:i,g=\"groupID:\".concat(s,\" sequence:\").concat(c,\" cursor:\").concat(p,\" filter:\").concat(d,\" completeFlag:\").concat(l);Je.l(\"\".concat(u,\" \").concat(g));var h={cursor:\"\",isCompleted:!1,messageID:r,unreadUserIDList:[],readUserIDList:[]},f=new Xo(\"getReadReceiptDetail\");return f.setMessage(g),this.request({protocolName:Uo.GET_READ_RECEIPT_DETAIL,requestData:{groupID:s,sequence:c,flag:d,cursor:p,count:_}}).then((function(e){f.end();var n=e.data,o=n.cursor,a=n.isCompleted,i=n.unreadUserIDList,s=n.readUserIDList;return h.cursor=o,1===a&&(h.isCompleted=!0,t._receiptDetailCompleteMap.set(r,!0)),0===d?h.readUserIDList=s.map((function(e){return e.userID})):1===d&&(h.unreadUserIDList=i.map((function(e){return e.userID}))),Je.l(\"\".concat(u,\" ok\")),No(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];f.setError(e,o,a).end()})),Je.w(\"\".concat(u,\" failed. error:\"),e),Go(e)}))}},{key:\"getRoamingMessagesHopping\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessagesHopping\"),o=e.groupID,a=e.count,i=e.sequence,s=e.direction,r=i;if(mt(i)){if(1===s)return Oo({messageList:[],isCompleted:!0,nextMessageSeq:\"\"});if(this.hasLocalGroup(o)){var c=this.getLocalGroupProfile(o).nextMessageSeq;r=c>1?c-1:0}Ft(o)&&(r=0)}else 1===s&&(r=i+a-1);var u=void 0;Ft(o)&&(o=$t(u=o));var l=\"\".concat(u?\"topicID:\".concat(u):\"groupID:\".concat(o),\" sequence:\").concat(i,\" direction:\").concat(s);Je.l(\"\".concat(n,\" \").concat(l));var d=new Xo(\"getGroupRoamingMessagesHopping\");return this.request({protocolName:Uo.GET_GROUP_ROAMING_MESSAGE,requestData:{groupID:o,topicID:u,count:a,sequence:r}}).then((function(o){var a=o.data,r=a.messageList,c=a.complete,u=\"complete:\".concat(c,\" count:\").concat(r?r.length:0);if(Je.l(\"\".concat(n,\" ok. \").concat(u)),d.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(l,\" \").concat(u)).end(),2===c||pn(r)){var p=t._computeResult();return No(p)}var _=\"\".concat(S.CONV_GROUP).concat(e.groupID),g=t.getModule(ao).onRoamingMessage(r,_,!1),h=t._computeResult({direction:s,sequence:i,remoteMessageList:r,processedMessageList:g});return No(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],r=n[1];d.setError(e,s,r).setMessage(\"groupID:\".concat(o,\" sequence:\").concat(i,\" count:\").concat(a)).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_computeResult\",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:\"\"};if(mt(e))return t.isCompleted=!0,t;var n=e.direction,o=e.sequence,a=e.remoteMessageList,i=void 0===a?[]:a,s=e.processedMessageList,r=void 0===s?[]:s,c=i.length;return 1===n?(t.nextMessageSeq=i[0].sequence+1,r.forEach((function(e){e.sequence>=o&&t.messageList.push(e)})),0===t.messageList.length&&i[0].sequence0?Promise.resolve(a):mt(o)?this.getGroupLastSequence(t):Promise.resolve(0)}},{key:\"getGroupLastSequence\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getGroupLastSequence\"),o=new Xo(\"getGroupLastSequence\"),a=0,i=\"\",s=\"groupID:\".concat(e);if(this.hasLocalGroup(e)){var r=this.getLocalGroupProfile(e),c=r.lastMessage;if(c.lastSequence>0&&!1===c.onlineOnlyFlag)return a=c.lastSequence,i=\"\".concat(s,\", \").concat(a,\" from group.lastMessage.lastSequence\"),Je.l(\"\".concat(n,\" \").concat(i)),o.setNetworkType(this.getNetworkType()).setMessage(i).end(),Promise.resolve(a);if(r.nextMessageSeq>1)return a=r.nextMessageSeq-1,i=\"\".concat(s,\", \").concat(a,\" from group.nextMessageSeq\"),Je.l(\"\".concat(n,\" \").concat(i)),o.setNetworkType(this.getNetworkType()).setMessage(i).end(),Promise.resolve(a)}var u=this.getModule(ao).getLocalConversation(\"GROUP\".concat(e));if(u&&u.lastMessage.lastSequence&&!1===u.lastMessage.onlineOnlyFlag)return a=u.lastMessage.lastSequence,i=\"\".concat(s,\", \").concat(a,\" from conversation.lastMessage.lastSequence\"),Je.l(\"\".concat(n,\" \").concat(i)),o.setNetworkType(this.getNetworkType()).setMessage(i).end(),Promise.resolve(a);var l={groupIDList:[e],responseFilter:{groupBaseInfoFilter:[\"NextMsgSeq\"]}};return this.getGroupProfileAdvance(l).then((function(e){var r=e.data.successGroupList;return pn(r)?Je.w(\"\".concat(n,\" \").concat(s,\", empty successGroupList\")):(a=r[0].nextMessageSeq-1,i=\"\".concat(s,\", \").concat(a,\" from remote\"),Je.l(\"\".concat(n,\" \").concat(i))),o.setNetworkType(t.getNetworkType()).setMessage(i).end(),a})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).setMessage(s).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"isMessageFromOrToAVChatroom\",value:function(e){return this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:\"hasJoinedAVChatRoom\",value:function(){return this._AVChatRoomHandler.hasJoinedAVChatRoom()}},{key:\"getJoinedAVChatRoom\",value:function(){return this._AVChatRoomHandler.getJoinedAVChatRoom()}},{key:\"isOnlineMessage\",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:\"_canIUseOnlineOnlyFlag\",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==S.CONV_GROUP}},{key:\"_onAVChatRoomHistoryMessage\",value:function(e,n){if(!pn(e)){Je.l(\"\".concat(this._n,\"._onAVChatRoomHistoryMessage groupID:\").concat(n,\" count:\").concat(e.length));var o=[];e.forEach((function(e){o.push(t(t({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(o,n)}}},{key:\"onAVChatRoomMessage\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"\";this._AVChatRoomHandler.onMessage(e,t)}},{key:\"onAVChatRoomMemberBanned\",value:function(e){this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:\"getGroupSimplifiedInfo\",value:function(e){var t=this,n=new Xo(\"getGroupSimplifiedInfo\"),o={groupIDList:[e],responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\"]}};return this.getGroupProfileAdvance(o).then((function(o){var a=o.data.successGroupList;return n.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(e,\" type:\").concat(a[0].type)).end(),a[0]})).catch((function(o){t.probeNetwork().then((function(t){var a=v(t,2),i=a[0],s=a[1];n.setError(o,i,s).setMessage(\"groupID:\".concat(e)).end()}))}))}},{key:\"setUnjoinedAVChatRoom\",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:\"deleteUnjoinedAVChatRoom\",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:\"isUnjoinedAVChatRoom\",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:\"isGroupAttributesUpdatedNotice\",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:\"updateLocalMainSequenceOnReconnected\",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:\"initGroupAttributes\",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:\"setGroupAttributes\",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:\"deleteGroupAttributes\",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:\"getGroupAttributes\",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:\"isMessageFromTopic\",value:function(e,t){return 2===e&&!pn(t)}},{key:\"isMessageFromCommunityOfTopic\",value:function(e,t){return 2===e&&pn(t)}},{key:\"getMessageExtensions\",value:function(e,t){return Je.l(\"\".concat(this._n,\".getMessageExtensions startSequence:\").concat(t)),this.request({protocolName:Uo.GET_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:\"modifyMessageExtensions\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Je.l(\"\".concat(this._n,\".modifyMessageExtensions operateType:\").concat(n)),this.request({protocolName:Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:\"_genNotifyReqList\",value:function(e){for(var t=[],n=0,o=e.length;n0&&t.getGroupNotify(a);var s=\"nextGroupIDList.length:\".concat(a.length);a.length<=10&&(s=\"nextGroupIDList:\".concat(JSON.stringify(a))),Je.l(\"\".concat(n,\" \").concat(s))})).catch((function(e){Je.e(\"\".concat(n,\" failed. error:\"),e)}))}},{key:\"_genRevokedInfos\",value:function(e){var n=e.notifyList,o=e.groupID,a=[];return vt(n)&&n.forEach((function(e){a.push({groupID:o,sequence:e.sequence,random:e.random,revokerInfo:t({},e.revokerInfo)})})),a}},{key:\"_getGroupLastRevokedTime\",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:\"_setGroupLastRevokedTime\",value:function(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}},{key:\"isGroupCountersNotice\",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:\"setGroupCounters\",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:\"increaseGroupCounter\",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:\"decreaseGroupCounter\",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:\"getGroupCounters\",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:\"getGroupMemberHandler\",value:function(){return this._groupMemberHandler}},{key:\"getGroupMemberList\",value:function(e){return this._groupMemberHandler.getGroupMemberList(e)}},{key:\"getGroupMemberProfile\",value:function(e){return this._groupMemberHandler.getGroupMemberProfile(e)}},{key:\"addGroupMember\",value:function(e){return this._groupMemberHandler.addGroupMember(e)}},{key:\"deleteGroupMember\",value:function(e){return this._groupMemberHandler.deleteGroupMember(e)}},{key:\"setGroupMemberMuteTime\",value:function(e){return this._groupMemberHandler.setGroupMemberMuteTime(e)}},{key:\"setGroupMemberRole\",value:function(e){return this._groupMemberHandler.setGroupMemberRole(e)}},{key:\"setGroupMemberNameCard\",value:function(e){return this._groupMemberHandler.setGroupMemberNameCard(e)}},{key:\"setGroupMemberCustomField\",value:function(e){return this._groupMemberHandler.setGroupMemberCustomField(e)}},{key:\"markGroupMemberList\",value:function(e){return this._groupMemberHandler.markGroupMemberList(e)}},{key:\"modifyGroupMemberInfo\",value:function(e){return this._groupMemberHandler.modifyGroupMemberInfo(e)}},{key:\"restartPolling\",value:function(){this._AVChatRoomHandler.restartPolling()}},{key:\"getPollingTimerID\",value:function(e){if(!e)return-1;var t=this.getLocalGroupProfile(e);return t&&bt(t.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}},{key:\"_canIUseJoinOption\",value:function(e){return function(e){return e===S.GRP_PUBLIC}(e)||wt({type:e})}},{key:\"_silentlyGetGroupProfile\",value:function(e,t){var n=setTimeout(this.getGroupProfile.bind(this,{groupID:t}),3e3);this._timeoutIDs.push(n),Je.l(\"\".concat(this._n,\"._silentlyGetGroupProfile errorCode:\").concat(e,\" groupID:\").concat(t,\" timeoutIDs:\").concat(this._timeoutIDs))}},{key:\"_clearTimeoutIDs\",value:function(){this._timeoutIDs.forEach((function(e){clearTimeout(e)})),this._timeoutIDs=[]}},{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()}}]),a}(Po),ti=[\"topicID\",\"topicName\",\"avatar\",\"introduction\",\"notification\",\"unreadCount\",\"muteAllMembers\",\"customData\",\"groupAtInfoList\",\"nextMessageSeq\",\"selfInfo\"],ni=function(e,t){return pn(e)?{lastTime:0,lastSequence:0,fromAccount:\"\",payload:null,type:\"\",messageForShow:\"\",nick:\"\",avatar:\"\",version:0,cloudCustomData:\"\",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||\"\",payload:e.payload||null,type:e.type||\"\",messageForShow:en(e.type,e.payload,t),nick:e.nick||\"\",avatar:e.avatar||\"\",version:e.version||0,cloudCustomData:e.cloudCustomData||\"\",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}},oi=function(){function e(t,n){o(this,e),this.topicID=\"\",this.topicName=\"\",this.avatar=\"\",this.introduction=\"\",this.notification=\"\",this.unreadCount=0,this.muteAllMembers=!1,this.customData=\"\",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=ni(t.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:\"\",excludedUnreadSequenceList:void 0},this._initTopic(t)}return i(e,[{key:\"_initTopic\",value:function(e){for(var t in e)ti.indexOf(t)<0||(\"selfInfo\"===t?this.updateSelfInfo(e[t]):this[t]=\"muteAllMembers\"===t?1===e[t]:e[t])}},{key:\"updateUnreadCount\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.unreadCount=e}},{key:\"updateNextMessageSeq\",value:function(e){this.nextMessageSeq=e}},{key:\"updateLastMessage\",value:function(e){this.lastMessage=ni(e)}},{key:\"updateGroupAtInfoList\",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:\"updateTopic\",value:function(e){mt(e.selfInfo)||this.updateSelfInfo(e.selfInfo),mt(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),Et(this,e,[\"groupID\",\"lastMessageTime\",\"selfInfo\",\"muteAllMembers\",\"lastMsg\"])}},{key:\"updateSelfInfo\",value:function(e){return 0!==Et(this.selfInfo,e,[],[\"\"])}},{key:\"reduceUnreadCount\",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:\"isLastMessageRevoked\",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:\"setLastMessageRevoked\",value:function(e){this.lastMessage.isRevoked=e}},{key:\"setLastMessageRevoker\",value:function(e){this.lastMessage.revoker=e}}]),e}(),ai=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n=\"TopicModule\",t._topicMap=new Map,t._getTopicTimeMap=new Map,t.TOPIC_CACHE_TIME=300,t.TOPIC_LAST_ACTIVE_TIME=3600,t.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"topic_cache_time\"),t=this.getCloudConfig(\"topic_last_active_time\");mt(e)||(this.TOPIC_CACHE_TIME=Number(e)),mt(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:\"onTopicCreated\",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOuterEvent(E.TOPIC_CREATED,e)}},{key:\"onTopicDeleted\",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOuterEvent(E.TOPIC_DELETED,e)}},{key:\"onTopicMessageRemindTypeUpdated\",value:function(e){var t=e.groupID,n=e.topicID,o=e.messageRemindType,a=this.getLocalTopic(t,n);if(a){var i=a.updateSelfInfo({messageRemindType:o});i&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:a}),Je.d(\"\".concat(this._n,\".onTopicMessageRemindTypeUpdated topicID:\").concat(n)+\" messageRemindType:\".concat(o,\" isTopicUpdated:\").concat(i))}}},{key:\"onTopicProfileUpdated\",value:function(e){var t=e.groupID,n=e.topicID,o=this.getLocalTopic(t,n);o&&(o.updateTopic(e),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:o}))}},{key:\"onConversationProxy\",value:function(e){var t=e.topicID,n=e.unreadCount,o=e.groupAtInfoList,a=$t(t),i=this.getLocalTopic(a,t),s=!1;i&&(mt(n)||i.unreadCount===n||(i.updateUnreadCount(n),s=!0),mt(o)||(i.updateGroupAtInfoList(o),s=!0)),s&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:a,topic:i})}},{key:\"onMessageSent\",value:function(e){var t=e.groupID,n=e.topicID,o=e.lastMessage,a=this.getLocalTopic(t,n);a&&(a.nextMessageSeq+=1,a.updateLastMessage(o),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:a}))}},{key:\"onMessageModified\",value:function(e){var t=e.to,n=e.time,o=e.sequence,a=e.elements,i=e.cloudCustomData,s=e.messageVersion,r=$t(t),c=this.getLocalTopic(r,t);if(c){var u=c.lastMessage;Je.d(\"\".concat(this._n,\".onMessageModified topicID:\").concat(t,\" lastMessage:\"),JSON.stringify(u),\"options:\",JSON.stringify(e)),u&&(null===u.payload||u.lastTime===n&&u.lastSequence===o&&u.version!==s)&&(u.type=a[0].type,u.payload=a[0].content,u.messageForShow=en(u.type,u.payload,this.isIntl()),u.cloudCustomData=i,u.version=s,u.lastSequence=o,u.lastTime=n,this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:r,topic:c}))}}},{key:\"onMessageRevoked\",value:function(e){var t=this;if(0!==e.length){var n=null,o=null,a=!1;e.forEach((function(e){var i=e.to;o=$t(i),(n=t.getLocalTopic(o,i))&&(n.reduceUnreadCount()&&(a=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),a=!0))})),a&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:o,topic:n})}}},{key:\"isLastMessageRevoked\",value:function(e){var t=e.topicID,n=e.sequence,o=$t(t),a=this.getLocalTopic(o,t),i=!1;return a&&(i=a.isLastMessageRevoked({sequence:n})),i}},{key:\"getJoinedCommunityList\",value:function(){return this.getModule(to).syncCommunityWithTopic()}},{key:\"createTopicInCommunity\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"createTopicInCommunity\"),a=e.topicID;if(!mt(a)&&!Ft(a))return Go({code:Ao.ILLEGAL_TOPIC_ID});if(e.topicName&&!1===this._filterProfanity(\"topicName\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Go({code:Ao.PROFANITY_FOUND});var i=new Xo(\"createTopicInCommunity\");return this.request({protocolName:Uo.CREATE_TOPIC,requestData:t({},e)}).then((function(a){var s=a.data.topicID;return i.setMessage(\"topicID:\".concat(s)).setNetworkType(n.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok. topicID:\").concat(s)),n._updateTopicMap([t(t({},e),{},{topicID:s})]),No({topicID:s})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"deleteTopicFromCommunity\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteTopicFromCommunity\"),o=e.groupID,a=e.topicIDList,i=void 0===a?[]:a,s=new Xo(\"deleteTopicFromCommunity\");return s.setMessage(\"groupID:\".concat(o,\" topicIDList:\").concat(i)),this.request({protocolName:Uo.DELETE_TOPIC,requestData:{groupID:o,topicIDList:i}}).then((function(e){var a=e.data.resultList,i=[],r=[];(void 0===a?[]:a).forEach((function(e){var t=e.topicID,n=e.errorCode,o=e.errorInfo;0===n?i.push({topicID:t}):r.push({topicID:t,code:n,message:o})}));var c=\"success count:\".concat(i.length,\", fail count:\").concat(r.length);return s.setMoreMessage(c).setNetworkType(t.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok. \").concat(c)),i.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),No({successTopicList:i,failureTopicList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"updateTopicProfile\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"updateTopicProfile\");if(Je.l(\"\".concat(o,\" options:\"),e),e.topicName&&!1===this._filterProfanity(\"topicName\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Go({code:Ao.PROFANITY_FOUND});var a=new Xo(\"updateTopicProfile\");return a.setMessage(\"groupID:\".concat(e.groupID,\" topicID:\").concat(e.topicID)),mt(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?\"On\":\"Off\"),this.request({protocolName:Uo.UPDATE_TOPIC_PROFILE,requestData:t({},e)}).then((function(){return a.setNetworkType(n.getNetworkType()).end(),Je.l(\"\".concat(o,\" ok\")),n._updateTopicMap([e]),No({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"getTopicList\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"getTopicList\"),a=e.groupID,i=e.topicIDList,s=void 0===i?[]:i,r=0===s.length,c=new Xo(\"getTopicList\");if(c.setMessage(\"groupID:\".concat(a)),this._getTopicTimeMap.has(a)){var u=this._getTopicTimeMap.get(a),l=u.isGetAll,d=u.time;if((l||!l&&!r)&&Date.now()-d<1e3*this.TOPIC_CACHE_TIME){var p=this._getLocalTopicList(a,s);if(r||p.length===s.length)return c.setNetworkType(this.getNetworkType()).setMoreMessage(\"from cache, topic count:\".concat(p.length)).end(),Je.l(\"\".concat(o,\" groupID:\").concat(a,\" from cache, topic count:\").concat(p.length)),Oo({successTopicList:p,failureTopicList:[]})}}return this.request({protocolName:Uo.GET_TOPIC_LIST,requestData:{groupID:a,topicIDList:s}}).then((function(e){var i=e.data.topicInfoList,s=[],u=[],l=[];(void 0===i?[]:i).forEach((function(e){var n=e.topic,o=e.selfInfo,a=e.errorCode,i=e.errorInfo,r=n.topicID;0===a?(s.push(t(t({},n),{},{selfInfo:o})),u.push(r)):l.push({topicID:r,code:a,message:i})})),n._updateTopicMap(s),n._handleTopicAtInfo(s);var d=\"success count:\".concat(u.length,\", fail count:\").concat(l.length);c.setNetworkType(n.getNetworkType()).setMoreMessage(d).end(),Je.l(\"\".concat(o,\" groupID:\").concat(a,\" from remote, \").concat(d));var p=[];return pn(u)||(n._getTopicTimeMap.set(a,{time:Date.now(),isGetAll:r}),p=n._getLocalTopicList(a,u)),No({successTopicList:p,failureTopicList:l})})).catch((function(e){return n.probeNetwork(e).then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"hasLocalTopic\",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:\"getLocalTopic\",value:function(e,t){var n=null;return this._topicMap.has(e)&&(n=this._topicMap.get(e).get(t)),n}},{key:\"_getLocalTopicList\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._topicMap.get(e),o=[];return n&&(o=m(n.values())),0===t.length?o:o.filter((function(e){return t.includes(e.topicID)}))}},{key:\"_deleteLocalTopic\",value:function(e,t){this._topicMap.has(e)&&this._topicMap.get(e).has(t)&&(this._topicMap.get(e).delete(t),Je.l(\"\".concat(this._n,\"._deleteLocalTopic groupID:\").concat(e,\" topicID:\").concat(t)))}},{key:\"_updateTopicMap\",value:function(e){var t=this,n=[];(e.forEach((function(e){var o=e.groupID,a=e.topicID,i=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(a)?(i=t._topicMap.get(o).get(a)).updateTopic(e):(t._getTopicLastMessage(e),i=new oi(e,t.isIntl()),t._topicMap.get(o).set(a,i));var s=t._computeUnreadCount(i);i.updateUnreadCount(s),n.push({conversationID:\"\".concat(S.CONV_GROUP).concat(a),type:S.CONV_TOPIC,unreadCount:s})})),n.length>0)&&this.getModule(ao).updateTopicConversation(n)}},{key:\"resetGetTopicTime\",value:function(e){var t=this;mt(e)?m(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:\"getTopicListOnReconnected\",value:function(){var e=this,t=m(this._topicMap.keys()),n=[],o=this.getModule(ao);t.forEach((function(t){var a=[],i=e._getLocalTopicList(t);o.deleteTopicRoamingMessageInfo(t),i.forEach((function(t){var n=t.lastMessage.lastTime,o=void 0===n?0:n;Date.now()-1e3*o<1e3*e.TOPIC_LAST_ACTIVE_TIME&&a.push(t.topicID)})),a.length>0&&n.push({groupID:t,topicIDList:a})})),Je.l(\"\".concat(this._n,\".getTopicListOnReconnected. active community count:\").concat(n.length)),this._relayGetTopicList(n)}},{key:\"_relayGetTopicList\",value:function(e){var t=this;if(0!==e.length){var n=e.shift(),o=n.topicIDList.length>5?\"topicIDList.length:\".concat(n.topicIDList.length):\"topicIDList:\".concat(n.topicIDList),a=new Xo(\"relayGetTopicList\");a.setMessage(o),Je.l(\"\".concat(this._n,\"._relayGetTopicList. \").concat(o)),this.getTopicList(n).then((function(){a.setNetworkType(t.getNetworkType()).end(),t._relayGetTopicList(e)})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),o=t[0],i=t[1];a.setError(n,o,i).end()})),t._relayGetTopicList(e)}))}}},{key:\"_handleTopicAtInfo\",value:function(e){var n=this;0!==e.length&&e.forEach((function(e){var o=e.groupID,a=e.topicID,i=e.groupAtInfoList,s=[];mt(i)||(i.forEach((function(e){s.push(t(t({},e),{},{groupID:o,topicID:a}))})),n.getModule(ao).onNewGroupAtTips({dataList:s}))}))}},{key:\"_getTopicLastMessage\",value:function(e){if(!mt(e.lastMsg)){var t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:\"\",nick:e.lastMsg.nick,avatar:e.lastMsg.avatar,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:2===e.lastMsg.isPlaceMessage,revoker:pn(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker};e.lastMessage=t}}},{key:\"deleteTopicListInCommunity\",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.getModule(ao);n.forEach((function(n){var a=n.topicID;t._deleteLocalTopic(e,a),t._getTopicTimeMap.delete(e),o.deleteLocalConversation(\"\".concat(S.CONV_GROUP).concat(a))}))}},{key:\"_computeUnreadCount\",value:function(e){var t=e.selfInfo,n=t.excludedUnreadSequenceList,o=t.readedSequence,a=e.nextMessageSeq-e.selfInfo.readedSequence-1;if(vt(n)){var i=0;n.forEach((function(t){t>=o&&t<=e.nextMessageSeq-1&&(i+=1)})),i>=1&&(a-=i)}return a<0?0:a}},{key:\"_filterProfanity\",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],Q),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:\"updateLastMessage\",value:function(e,t){var n=$t(e),o=this.getLocalTopic(n,e);if(o){var a=t.sequence+1;o.updateNextMessageSeq(a),o.updateLastMessage(t),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:n,topic:o})}}},{key:\"getMessageExtensions\",value:function(e,t){Je.l(\"\".concat(this._n,\".getMessageExtensions startSequence:\").concat(t));var n=$t(e.to);return this.request({protocolName:Uo.GET_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:n,topicID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:\"modifyMessageExtensions\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;Je.l(\"\".concat(this._n,\".modifyMessageExtensions operateType:\").concat(n));var o=$t(e.to);return this.request({protocolName:Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS,requestData:{groupID:o,topicID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),a}(Po),ii=function(){function e(t){o(this,e),this._userModule=t,this._n=\"ProfileHandler\",this.TAG=\"profile\",this.accountProfileMap=new Map,this.expirationTime=864e5}return i(e,[{key:\"setExpirationTime\",value:function(e){this.expirationTime=e}},{key:\"getUserProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getUserProfile\"),o=e.userIDList;e.fromAccount=this._userModule.getMyAccount(),o.length>100&&(Je.w(\"\".concat(n,\" \").concat(an(100))),o.length=100);for(var a,i=[],s=[],r=0,c=o.length;r5?\"userIDList.length:\".concat(o.length):\"userIDList:\".concat(o)),this._userModule.request({protocolName:Uo.GET_USER_PROFILE,requestData:e}).then((function(e){d.setNetworkType(t._userModule.getNetworkType()).end(),Je.i(\"\".concat(n,\" ok\"));var o=t._handleResponse(e).concat(s);return No(u?o[0]:o)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"getMyProfile\",value:function(){var e=this._userModule.getMyAccount(),t=\"\".concat(this._n,\".getMyProfile\");if(Je.l(\"\".concat(t,\" myAccount:\").concat(e)),this._fill(),this._contains(e)){var n=this._getProfileFromMap(e);return Je.d(\"\".concat(t,\" from cache, myProfile:\").concat(JSON.stringify(n))),Oo(n)}return this.getUserProfile({fromAccount:e,userIDList:[e],bFromGetMyProfile:!0})}},{key:\"_handleResponse\",value:function(e){var t=e.data.userProfileItem;if(!vt(t))return[];for(var n=[],o=Date.now(),a=0,i=t.length;a-1)n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case Xe.NICK:n.nick=t[o].value;break;case Xe.GENDER:n.gender=t[o].value;break;case Xe.BIRTHDAY:n.birthday=t[o].value;break;case Xe.LOCATION:n.location=t[o].value;break;case Xe.SELFSIGNATURE:n.selfSignature=t[o].value;break;case Xe.ALLOWTYPE:n.allowType=t[o].value;break;case Xe.LANGUAGE:n.language=t[o].value;break;case Xe.AVATAR:n.avatar=t[o].value;break;case Xe.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case Xe.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case Xe.LEVEL:n.level=t[o].value;break;case Xe.ROLE:n.role=t[o].value;break;default:Je.w(\"\".concat(this._n,\"._getLatestProfileFromResponse unknown tag:\"),t[o].tag,t[o].value)}return n}},{key:\"updateMyProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"updateMyProfile\");if(e.nick&&!1===this._userModule.filterProfanity(\"nick\",e))return Go({code:Ao.PROFANITY_FOUND});if(e.selfSignature&&!1===this._userModule.filterProfanity(\"selfSignature\",e))return Go({code:Ao.PROFANITY_FOUND});var o=new Xo(\"updateMyProfile\");o.setMessage(JSON.stringify(e));var a=(new Ca).validate(e);if(!a.valid)return o.setCode(Ao.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage(\"info:\".concat(a.tips)).setNetworkType(this._userModule.getNetworkType()).end(),Je.e(\"\".concat(n,\" info:\").concat(a.tips)),Go({code:Ao.UPDATE_PROFILE_INVALID_PARAM});var i=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(\"profileCustomField\"===s?e.profileCustomField.forEach((function(e){i.push({tag:e.key,value:e.value})})):i.push({tag:Xe[s.toUpperCase()],value:e[s]}));if(0===i.length){var r=new ko({code:Ao.UPDATE_PROFILE_NO_KEY});return o.setError(r,!0,this._userModule.getNetworkType()).end(),Je.e(\"\".concat(n,\" failed. error:\"),r),Go(r)}var c=this._userModule.getMyAccount();return this._userModule.request({protocolName:Uo.UPDATE_MY_PROFILE,requestData:{fromAccount:c,profileItem:i}}).then((function(a){o.setNetworkType(t._userModule.getNetworkType()).end(),Je.i(\"\".concat(n,\" ok\"));var i=t._update(c,e),s=i.isProfileUpdated,r=i.latestProfile;return!0===s&&t._userModule.emitOuterEvent(E.PROFILE_UPDATED,[r]),Oo(r)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"onProfileModified\",value:function(e){var t=e.dataList;if(!pn(t)){var n,o=t.length;Je.d(\"\".concat(this._n,\".onProfileModified count:\").concat(o,\" dataList:\"),e.dataList);for(var a=[],i=0;i0&&(this._userModule.emitInnerEvent(ha.PROFILE_UPDATED,a),this._userModule.emitOuterEvent(E.PROFILE_UPDATED,a))}}},{key:\"_fill\",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n0&&(n.lastUpdatedTime=a,o=!0)):(n=new Ca(t),(this._userModule.isMyFriend(e)||e===this._userModule.getMyAccount())&&(n.lastUpdatedTime=a,o=!0,this.accountProfileMap.set(e,n)));return this._flush(e===this._userModule.getMyAccount()),!0===o&&Je.l(\"\".concat(this._n,\"._update account:\").concat(e,\" isProfileUpdated:\").concat(o)),{isProfileUpdated:o,latestProfile:n}}},{key:\"_flush\",value:function(e){var t=m(this.accountProfileMap.values()),n=this._userModule.getStorageModule();Je.d(\"\".concat(this._n,\"._flush length:\").concat(t.length,\" flushAtOnce:\").concat(e)),n.setItem(this.TAG,t,e)}},{key:\"_contains\",value:function(e){return this.accountProfileMap.has(e)}},{key:\"_getProfileFromMap\",value:function(e){return this.accountProfileMap.get(e)}},{key:\"_getCachedProfiles\",value:function(){var e=this._userModule.getStorageModule().getItem(this.TAG);return pn(e)?[]:e}},{key:\"onConversationsProfileUpdated\",value:function(e){for(var t,n,o,a=[],i=0,s=e.length;i0&&a.push(n)):a.push(t.userID));0!==a.length&&(Je.i(\"\".concat(this._n,\".onConversationsProfileUpdated toAccountList:\").concat(a)),this.getUserProfile({userIDList:a}))}},{key:\"getNickAndAvatarByUserID\",value:function(e){if(this._contains(e)){var t=this._getProfileFromMap(e);return{nick:t.nick,avatar:t.avatar}}return{nick:\"\",avatar:\"\"}}},{key:\"getUserNickAndAvatar\",value:function(e){var t=this,n=m(new Set(e));Je.l(\"\".concat(this._n,\".getUserNickAndAvatar userIDList.length:\").concat(e.length,\" uniqueUserIDList.length:\").concat(n.length));var o=[];if(0===e.length)return Promise.resolve(o);var a=this._createUserIDListGroup(n),i=[];return a.forEach((function(e){i.push(t.getUserProfile({userIDList:e}))})),Promise.all(i).then((function(e){return e.forEach((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));o.push.apply(o,m(t))})),o}))}},{key:\"_createUserIDListGroup\",value:function(e){for(var t=[],n=0;n5?\"userIDList.length:\".concat(e.userIDList.length):\"userIDList:\".concat(e.userIDList)).end(),Je.i(\"\".concat(o,\" ok\")),t._handleResponse(a.resultItem,!0),No(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var o=v(t,2),a=o[0],i=o[1];n.setError(e,a,i).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"_handleResponse\",value:function(e,t){if(!pn(e))for(var n,o,a,i=0,s=e.length;i5?\"userIDList.length:\".concat(e.userIDList.length):\"userIDList:\".concat(e.userIDList)).end(),Je.i(\"\".concat(n,\" ok\")),t._handleResponse(a.data.resultItem,!1),No(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"onAccountDeleted\",value:function(e){for(var t=0,n=e.length;t0&&(Je.l(\"\".concat(this._n,\".onAccountDeleted count:\").concat(a,\" \").concat(a<30?\"userIDList:\".concat(e):\"\")),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:\"onAccountAdded\",value:function(e){for(var t,n=[],o=0,a=e.length;o0&&(Je.l(\"\".concat(this._n,\".onAccountAdded count:\").concat(n.length,\" userIDList:\"),n),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:\"reset\",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),ci=function(e){var t=String(e).replace(/[=]+$/,\"\"),n=\"\";if(t.length%4==1)return\"\";for(var o,a,i=0,s=0;a=t.charAt(s++);~a&&(o=i%4?64*o+a:a,i++%4)?n+=String.fromCharCode(255&o>>(-2*i&6)):0)a=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(a);try{return decodeURIComponent(escape(n))}catch(r){return\"\"}},ui=function(){function e(t){o(this,e),this._userModule=t,this._n=\"UserStatusHandler\",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,this._onCloudConfigUpdated,this)}return i(e,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this._userModule.getCloudConfig(\"status_query_count\"),t=this._userModule.getCloudConfig(\"status_sub_count\"),n=this._userModule.getCloudConfig(\"status_unsub_count\");Je.l(\"\".concat(this._n,\"._onCloudConfigUpdated statusQueryCount:\").concat(e,\" statusSubscribeCount:\").concat(t)+\" statusUnsubscribeCount:\".concat(n)),mt(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),mt(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),mt(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:\"onUserStatusUpdated\",value:function(e){var t=e.dataList,n=this._userModule.getMyUserID(),o=this._userModule.getModule(io),a=t.map((function(e){var t=e.to,a=e.statusType,i=e.customStatus,s=ci(i);return t===n&&o.setCustomStatus(s),{userID:t,statusType:a,customStatus:s}}));this._userModule.emitOuterEvent(E.USER_STATUS_UPDATED,a)}},{key:\"setSelfStatus\",value:function(e){var t=this,n=\"\".concat(this._n,\".setSelfStatus\");if(!1===this._userModule.filterProfanity(\"customStatus\",e))return Go({code:Ao.PROFANITY_FOUND});var o=new Xo(\"setSelfStatus\"),a=e.customStatus;return this._userModule.request({protocolName:Uo.SET_SELF_STATUS,requestData:{customStatus:a}}).then((function(e){return o.setNetworkType(t._userModule.getNetworkType()).setMessage(\"customStatus:\".concat(a)).end(),Je.l(\"\".concat(n,\" ok. customStatus:\").concat(a)),t._userModule.getModule(io).setCustomStatus(a),No({userID:t._userModule.getMyUserID(),statusType:1,customStatus:a})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),a=n[0],i=n[1];o.setError(e,a,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"getUserStatus\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getUserStatus\"),o=e.userIDList,a=void 0===o?[]:o,i=this._userModule.getMyUserID(),s=m(a),r=void 0,c=s.indexOf(i);if(c>-1){s.splice(c,1);var u=this._userModule.getModule(io).getCustomStatus();r={userID:i,statusType:1,customStatus:u}}if(0===s.length)return Oo({successUserList:[r],failureUserList:[]});if(!this._userModule.canIUse(K.USER_STATUS))return this._userModule.cannotUseCommercialAbility(\"getUserStatus\");s.length>this.MAX_QUERY_USER_COUNT&&(Je.w(\"\".concat(n,\" \").concat(an(this.MAX_QUERY_USER_COUNT))),s=a.slice(0,this.MAX_QUERY_USER_COUNT));var l=new Xo(\"getUserStatus\");return this._userModule.request({protocolName:Uo.GET_USER_STATUS,requestData:{userIDList:s}}).then((function(e){var o=e.data,i=o.successUserList,s=void 0===i?[]:i,c=o.failureUserList,u=void 0===c?[]:c,d=s.map((function(e){var t=e.userID,n=e.statusType,o=e.customStatus;return{userID:t,statusType:n,customStatus:ci(o)}})),p=u.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,a=e.errorInfo;return{userID:pn(n)?t:n,code:o,message:a}}));mt(r)||d.unshift(r);var _=\"userID count:\".concat(a.length,\", success count:\").concat(d.length,\", fail count:\").concat(p.length);return l.setNetworkType(t._userModule.getNetworkType()).setMessage(\"\".concat(_)).end(),Je.l(\"\".concat(n,\" ok. \").concat(_,\".\")),No({successUserList:d,failureUserList:p})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];l.setMessage(\"userID count:\".concat(a.length)).setError(e,o,i).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"subscribeUserStatus\",value:function(e){var t=this,n=\"subscribeUserStatus\";if(!this._userModule.canIUse(K.USER_STATUS))return this._userModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n),a=e.userIDList,i=void 0===a?[]:a,s=m(i);s.length>this.MAX_SUBSCRIBE_USER_COUNT&&(Je.w(\"\".concat(o,\" \").concat(an(this.MAX_SUBSCRIBE_USER_COUNT))),s=i.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var r=new Xo(n),c=\"userID count:\".concat(i.length);return Je.l(\"\".concat(o,\" \").concat(c)),this._userModule.request({protocolName:Uo.SUBSCRIBE_USER_STATUS,requestData:{userIDList:s}}).then((function(e){var n=e.data.failureUserList,a=(void 0===n?[]:n).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,a=e.errorInfo;return{userID:pn(n)?t:n,code:o,message:a}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage(\"\".concat(c,\" fail count:\").concat(a.length)).end(),Je.l(\"\".concat(o,\" ok. fail count:\").concat(a.length,\".\")),No({failureUserList:a})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setMessage(\"\".concat(c)).setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"unsubscribeUserStatus\",value:function(e){var t=this,n=\"unsubscribeUserStatus\";if(!this._userModule.canIUse(K.USER_STATUS))return this._userModule.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n),a=(e||{}).userIDList,i=void 0===a?[]:a,s=m(i);i.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(Je.w(\"\".concat(o,\" \").concat(an(this.MAX_UNSUBSCRIBE_USER_COUNT))),s=i.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var r=new Xo(n),c=\"userID count:\".concat(i.length);Je.l(\"\".concat(o,\" \").concat(c));var u={userIDList:s};return 0===s.length&&(u.userIDList=void 0,u.unsubscribeAll=1),this._userModule.request({protocolName:Uo.UNSUBSCRIBE_USER_STATUS,requestData:u}).then((function(e){var n=e.data.failureUserList,a=(void 0===n?[]:n).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,a=e.errorInfo;return{userID:pn(n)?t:n,code:o,message:a}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage(\"\".concat(c,\" fail count:\").concat(a.length)).end(),Je.l(\"\".concat(o,\" ok. fail count:\").concat(a.length,\".\")),No({failureUserList:a})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setMessage(\"\".concat(c)).setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"reset\",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),e}(),li=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"UserModule\",a._profileHandler=new ii(g(a)),a._blacklistHandler=new ri(g(a)),a._userStatusHandler=new ui(g(a)),a.getInnerEmitterInstance().on(ha.A2KEY_AND_TINYID_UPDATED,a.onContextUpdated,g(a)),a}return i(n,[{key:\"onContextUpdated\",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:\"mockOnNickAvatarModified\",value:function(e,t){Je.l(\"\".concat(this._n,\"._mockOnNickAvatarModified nick:\").concat(e,\" avatar:\").concat(t)),this.onProfileModified({dataList:[{pushType:1,userID:this.getMyUserID(),profileList:[{tag:Xe.NICK,value:e},{tag:Xe.AVATAR,value:t}]}]})}},{key:\"onProfileModified\",value:function(e){this._profileHandler.onProfileModified(e)}},{key:\"onRelationChainModified\",value:function(e){var t=e.dataList;if(!pn(t)){var n=[];t.forEach((function(e){e.blackListDelAccount&&n.push.apply(n,m(e.blackListDelAccount))})),n.length>0&&this._blacklistHandler.onAccountDeleted(n);var o=[];t.forEach((function(e){e.blackListAddAccount&&o.push.apply(o,m(e.blackListAddAccount))})),o.length>0&&this._blacklistHandler.onAccountAdded(o)}}},{key:\"onConversationsProfileUpdated\",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{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.getModule(so)}},{key:\"filterProfanity\",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],z),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:\"isMyFriend\",value:function(e){var t=this.getModule(no);return!!t&&t.isMyFriend(e)}},{key:\"getUserProfile\",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:\"updateMyProfile\",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:\"getNickAndAvatarByUserID\",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:\"getUserNickAndAvatar\",value:function(e){return this._profileHandler.getUserNickAndAvatar(e)}},{key:\"getLocalBlacklist\",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return Oo(e)}},{key:\"addBlacklist\",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:\"deleteBlacklist\",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:\"onUserStatusUpdated\",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:\"setSelfStatus\",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:\"getUserStatus\",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:\"subscribeUserStatus\",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:\"unsubscribeUserStatus\",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),n}(Po),di=function(){function e(t,n){o(this,e),this._m=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||\"\",this._userSig=n.userSig||\"\",this._version=\"3.2.3\",this._a2Key=\"\",this._tinyID=\"\",this._customStatus=\"\",this._contentType=\"json\",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||\"\",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy,this._applicationID=0,this._isUsingChatCore=!1}return i(e,[{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:\"isSingaporeSite\",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7||this._SDKAppID>=172e7&&this._SDKAppID<173e7}},{key:\"isKoreaSite\",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7||this._SDKAppID>=173e7&&this._SDKAppID<174e7}},{key:\"isGermanySite\",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7||this._SDKAppID>=174e7&&this._SDKAppID<175e7}},{key:\"isIndiaSite\",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7||this._SDKAppID>=175e7&&this._SDKAppID<176e7}},{key:\"isJapanSite\",value:function(){return this._SDKAppID>=6e7&&this._SDKAppID<7e7||this._SDKAppID>=176e7&&this._SDKAppID<177e7}},{key:\"isUSASite\",value:function(){return this._SDKAppID>=7e7&&this._SDKAppID<8e7||this._SDKAppID>=177e7&&this._SDKAppID<178e7}},{key:\"isIndonesiaSite\",value:function(){return this._SDKAppID>=8e7&&this._SDKAppID<9e7||this._SDKAppID>=178e7&&this._SDKAppID<179e7}},{key:\"isIntl\",value:function(){return 0===(e=this._SDKAppID)||e>=2e7&&e<9e7||e>=172e7&&e<179e7;var e}},{key:\"isUnlimitedAVChatRoom\",value:function(){return this._unlimitedAVChatRoom}},{key:\"isUsingChatCore\",value:function(){return this._isUsingChatCore}},{key:\"setUsingChatCore\",value:function(e){this._isUsingChatCore=e}},{key:\"setUserID\",value:function(e){this._userID=e}},{key:\"getUserID\",value:function(){return this._userID}},{key:\"setUserSig\",value:function(e){this._userSig=e}},{key:\"getUserSig\",value:function(){return this._userSig}},{key:\"getSDKAppID\",value:function(){return this._SDKAppID}},{key:\"setTinyID\",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:\"getTinyID\",value:function(){return this._tinyID}},{key:\"setCustomStatus\",value:function(e){this._customStatus=e}},{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(e){this._statusInstanceID=e}},{key:\"getVersion\",value:function(){return this._version}},{key:\"getA2Key\",value:function(){return this._a2Key}},{key:\"setA2Key\",value:function(e){this._a2Key=e}},{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(e){this._applicationID=e}},{key:\"getApplicationID\",value:function(){return this._applicationID}},{key:\"_isTUIKit\",value:function(){var e=!1,t=!1,n=!1,o=!1,a=[];ce&&(a=Object.keys(le)),ue&&(a=re?Object.keys(uni):Object.keys(window));for(var i=0,s=a.length;i0){for(var u=0,l=c.length;u0&&void 0!==arguments[0]?arguments[0]:0;if(!this.isLoggedIn())return Go({code:Ao.USER_NOT_LOGGED_IN});var n=new Xo(\"logout\");n.setNetworkType(this.getNetworkType()).setMessage(\"identifier:\".concat(this.getMyUserID())).end(!0);var o=\"\".concat(this._n,\".logout\");return Je.i(\"\".concat(o,\" type:\").concat(t)),0===t&&this._m.setNotReadyReason(Ao.LOGGED_OUT),this.request({protocolName:Uo.LOGOUT,requestData:{type:t}}).then((function(){return e.resetReady(),Oo({})})).catch((function(t){return Je.e(\"\".concat(o,\" error:\"),t),e.resetReady(),Oo({})}))}},{key:\"getLoginUser\",value:function(){return this.isLoggedIn()?this.getMyUserID():\"\"}},{key:\"_fetchCloudControlConfig\",value:function(){this.getModule(ho).fetchConfig()}},{key:\"_getStatusInstanceID\",value:function(){return uni.getStorageSync(\"timUniAppInstanceID\")}},{key:\"_hello\",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:Uo.HELLO,requestData:{isWebUniapp:this._isWebUniapp}}).catch((function(t){Je.w(\"\".concat(e._n,\"._hello error:\"),t)}))}},{key:\"getLastWsHelloTs\",value:function(){return this._lastWsHelloTs}},{key:\"_checkLoginInfo\",value:function(e){var t=0;return pn(this.getModule(io).getSDKAppID())?t=Ao.NO_SDKAPPID:pn(e.userID)?t=Ao.NO_IDENTIFIER:pn(e.userSig)&&(t=Ao.NO_USERSIG),{code:t}}},{key:\"_isReactUIKit\",value:function(){return ue&&void 0!==window.tencent_cloud_im_csig_react_uikit_23F_xa}},{key:\"onMultipleAccountKickedOut\",value:function(e){var t=this;new Xo(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(\"type:\".concat(S.KICKED_OUT_MULT_ACCOUNT,\" newInstanceInfo:\").concat(JSON.stringify(e))).end(!0),Je.w(\"\".concat(this._n,\".onMultipleAccountKickedOut userID:\").concat(this.getMyUserID(),\" newInstanceInfo:\"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_ACCOUNT}),t._m.setNotReadyReason(Ao.KICKED_OUT_MULT_ACCOUNT),t._m.reset()}))}},{key:\"onMultipleDeviceKickedOut\",value:function(e){var t=this;new Xo(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(\"type:\".concat(S.KICKED_OUT_MULT_DEVICE,\" newInstanceInfo:\").concat(JSON.stringify(e))).end(!0),Je.w(\"\".concat(this._n,\".onMultipleDeviceKickedOut userID:\").concat(this.getMyUserID(),\" newInstanceInfo:\"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_DEVICE}),t._m.setNotReadyReason(Ao.KICKED_OUT_MULT_DEVICE),t._m.reset()}))}},{key:\"onUserSigExpired\",value:function(){new Xo(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(S.KICKED_OUT_USERSIG_EXPIRED).end(!0),Je.w(\"\".concat(this._n,\".onUserSigExpired userID:\").concat(this.getMyUserID())),0!==this.getModule(io).getStatusInstanceID()&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(Ao.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:\"onRestApiKickedOut\",value:function(e){(new Xo(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(\"type:\".concat(S.KICKED_OUT_REST_API,\" newInstanceInfo:\").concat(JSON.stringify(e))).end(!0),Je.w(\"\".concat(this._n,\".onRestApiKickedOut userID:\").concat(this.getMyUserID(),\" newInstanceInfo:\"),e),0!==this.getModule(io).getStatusInstanceID())&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_REST_API}),this._m.setNotReadyReason(Ao.KICKED_OUT_REST_API),this._m.reset(),this.getModule(go).onRestApiKickedOut())}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),n}(Po);function gi(){return null}var hi=function(){function e(t){o(this,e),this._m=t,this._n=\"StorageModule\",this._storageQueue=new Map,this._errorTolerantHandle()}return i(e,[{key:\"_errorTolerantHandle\",value:function(){ce||!mt(window)&&this._canIUseCookies()||(this.getItem=gi,this.setItem=gi,this.removeItem=gi,this.clear=gi)}},{key:\"onCheckTimer\",value:function(e){if(e%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{key:\"_doFlush\",value:function(){try{var e,t=D(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],a=n[1];this._setStorageSync(this._getKey(o),a)}}catch(i){t.e(i)}finally{t.f()}this._storageQueue.clear()}catch(s){Je.w(\"\".concat(this._n,\"._doFlush error:\"),s)}}},{key:\"_getPrefix\",value:function(){var e=this._m.getModule(io);return\"TIM_\".concat(e.getSDKAppID(),\"_\").concat(e.getUserID(),\"_\")}},{key:\"_getKey\",value:function(e){return\"\".concat(this._getPrefix()).concat(e)}},{key:\"getItem\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(o){return Je.w(\"\".concat(this._n,\".getItem error:\"),o),{}}}},{key:\"setItem\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n){var a=o?this._getKey(e):e;this._setStorageSync(a,t)}else this._storageQueue.set(e,t)}},{key:\"clear\",value:function(){try{ce?le.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){Je.w(\"\".concat(this._n,\".clear error:\"),e)}}},{key:\"removeItem\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(o){Je.w(\"\".concat(this._n,\".removeItem error:\"),o)}}},{key:\"getSize\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"b\";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,\"leftSize\",{enumerable:!0,get:function(){return o.limitSize-o.size}}),ce&&(o.limitSize=1024*le.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(ce){var a=le.getStorageInfoSync(),i=a.keys;i.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}))}else if(this._canIUseCookies())for(var s in localStorage)localStorage.hasOwnProperty(s)&&(o.size+=localStorage.getItem(s).length+s.length);return this._convertUnit(o)}catch(r){Je.w(\"\".concat(this._n,\" error:\"),r)}}},{key:\"_convertUnit\",value:function(e){var t={},n=e.unit;for(var o in t.unit=n,e)\"number\"==typeof e[o]&&(\"kb\"===n.toLowerCase()?t[o]=Math.round(e[o]/1024):\"mb\"===n.toLowerCase()?t[o]=Math.round(e[o]/1024/1024):t[o]=e[o]);return t}},{key:\"_setStorageSync\",value:function(e,t){ce?ae?my.setStorageSync({key:e,data:t}):le.setStorageSync(e,t):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(t))}},{key:\"getStorageSync\",value:function(e){return ce?ae?my.getStorageSync({key:e}).data:le.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:\"_removeStorageSync\",value:function(e){ce?ae?my.removeStorageSync({key:e}):le.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:\"_canIUseCookies\",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._doFlush()}}]),e}(),fi=function(){function e(t){o(this,e),this._n=\"SSOLogBody\",this._report=[]}return i(e,[{key:\"pushIn\",value:function(e){Je.d(\"\".concat(this._n,\".pushIn\"),this._report.length,e),this._report.push(e)}},{key:\"backfill\",value:function(e){var t;vt(e)&&0!==e.length&&(Je.d(\"\".concat(this._n,\".backfill\"),this._report.length,e.length),(t=this._report).unshift.apply(t,m(e)))}},{key:\"getLogsNumInMemory\",value:function(){return this._report.length}},{key:\"isEmpty\",value:function(){return 0===this._report.length}},{key:\"_reset\",value:function(){this._report.length=0,this._report=[]}},{key:\"getLogsInMemory\",value:function(){var e=this._report.slice();return this._reset(),e}}]),e}(),vi=function(e){var t=e.getModule(io);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:He()}},mi=function(e){r(a,e);var n=f(a);function a(e){var t;o(this,a),(t=n.call(this,e))._n=\"EventStatModule\",t.TAG=\"im-ssolog-event\",t._reportBody=new fi,t.MIN_THRESHOLD=20,t.MAX_THRESHOLD=100,t.WAITING_TIME=6e4,t.REPORT_LEVEL=[4,5,6],t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._lastReportTime=Date.now();var i=t.getInnerEmitterInstance();return i.on(ha.A2KEY_AND_TINYID_UPDATED,t._onLoginSuccess,g(t)),i.on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:\"reportAtOnce\",value:function(){this._report()}},{key:\"_onLoginSuccess\",value:function(){var e=this,t=this.getModule(so),n=t.getItem(this.TAG,!1);!pn(n)&&It(n.forEach)&&(Je.l(\"\".concat(this._n,\"._onLoginSuccess. logs count:\").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"evt_rpt_threshold\"),t=this.getCloudConfig(\"evt_rpt_waiting\"),n=this.getCloudConfig(\"evt_rpt_level\"),o=this.getCloudConfig(\"evt_rpt_sdkappid_bl\"),a=this.getCloudConfig(\"evt_rpt_tinyid_wl\");mt(e)||(this.MIN_THRESHOLD=Number(e)),mt(t)||(this.WAITING_TIME=Number(t)),mt(n)||(this.REPORT_LEVEL=n.split(\",\").map((function(e){return Number(e)}))),mt(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(\",\").map((function(e){return Number(e)}))),mt(a)||(this.REPORT_TINYID_WHITELIST=a.split(\",\"))}},{key:\"pushIn\",value:function(e){e instanceof Xo&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:\"onCheckTimer\",value:function(){Date.now()e.MAX_THRESHOLD&&e._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{key:\"_flushAtOnce\",value:function(){var e=this.getModule(so),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o=\"\".concat(this._n,\"._flushAtOnce\");if(pn(t))Je.l(\"\".concat(o,\" count:\").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var a=n.concat(t);a.length>this.MAX_THRESHOLD&&(a=a.slice(0,this.MAX_THRESHOLD)),Je.l(\"\".concat(o,\" count:\").concat(a.length)),e.setItem(this.TAG,a,!0,!1)}}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),a}(Po),Mi=\"none\",Ii=\"online\",yi=[Ao.OVER_FREQUENCY_LIMIT,Ao.OPEN_SERVICE_OVERLOAD_ERROR],Ti=function(){function e(t){o(this,e),this._m=t,this._networkType=\"\",this._n=\"NetMonitorModule\",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return i(e,[{key:\"start\",value:function(){var e=this;ce?(le.getNetworkType({success:function(t){e._networkType=t.networkType||t.subtype||\"\",t.networkType===Mi?Je.w(\"\".concat(e._n,\".start no network, please check!\")):Je.i(\"\".concat(e._n,\".start networkType:\").concat(t.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),le.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=Ii,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener(\"online\",this._webOnlineCallback),window.addEventListener(\"offline\",this._webOfflineCallback)))}},{key:\"_onWebOnline\",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:Ii})}},{key:\"_onWebOffline\",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:Mi})}},{key:\"_onNetworkStatusChange\",value:function(e){var t=e.isConnected,n=e.networkType,o=\"\".concat(this._n,\"._onNetworkStatusChange\"),a=!1;t?(Je.i(\"\".concat(o,\" previous:\").concat(this._networkType,\" current:\").concat(n)),this._networkType!==n&&(a=!0,this._m.getModule(go).reConnect(!0))):this._networkType!==n&&(a=!0,Je.w(\"\".concat(o,\" no network, please check!\")),this._m.getModule(go).offline());a&&(new Xo(\"networkChange\").setMessage(\"isConnected:\".concat(t,\" previousNetworkType:\").concat(this._networkType,\" networkType:\").concat(n)).end(),this._networkType=n)}},{key:\"probe\",value:function(e){var t=this;if(!mt(e)&&yi.includes(e.code))return Promise.resolve([!0,this._networkType]);var n=\"\".concat(this._n,\".probe\");return new Promise((function(e,o){ce?le.getNetworkType({success:function(o){t._networkType=o.networkType,o.networkType===Mi?(Je.w(\"\".concat(n,\" no network, please check!\")),e([!1,o.networkType])):(Je.i(\"\".concat(n,\" networkType:\").concat(o.networkType)),e([!0,o.networkType]))}}):t._networkType===Mi?e([!1,Mi]):e([!0,Ii])}))}},{key:\"getNetworkType\",value:function(){return this._networkType}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),ce?null!==this._mpNetworkStatusCallback&&(le.offNetworkStatusChange&&(se||ne?le.offNetworkStatusChange(this._mpNetworkStatusCallback):le.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(null!==this._webOnlineCallback&&(window.removeEventListener(\"online\",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener(\"offline\",this._webOfflineCallback),this._webOfflineCallback=null))}}]),e}();var Ci=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=Object.prototype.hasOwnProperty,n=\"~\";function o(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,o,i,s){if(\"function\"!=typeof o)throw new TypeError(\"The listener must be a function\");var r=new a(o,i||e,s),c=n?n+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],r]:e._events[c].push(r):(e._events[c]=r,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function r(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),r.prototype.eventNames=function(){var e,o,a=[];if(0===this._eventsCount)return a;for(o in e=this._events)t.call(e,o)&&a.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?a.concat(Object.getOwnPropertySymbols(e)):a},r.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var a=0,i=o.length,s=new Array(i);a=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:\"_getAuthorization\",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:\"upload\",value:function(e){if(!0===e._relayFlag)return Promise.resolve();var t=this.getModule(mo);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(Ho),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(Ho),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(Ho),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(Ho),this._uploadVideo(e);default:return Promise.resolve()}}},{key:\"_uploadImage\",value:function(e){var n=this,o=this.getModule(Qn),a=e.getElements()[0],i=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:i.payload.file,to:i.to,message:e,onProgress:function(e){if(a.updatePercent(e),It(i.onProgress))try{i.onProgress(e)}catch(t){return Go({code:Ao.MSG_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(o){var i=o.location,s=o.fileType,r=o.fileSize,c=o.width,u=o.height,l=o.smallImageUrl,d=o.smallImageWidth,p=o.smallImageHeight,_=o.largeImageUrl,g=o.largeImageWidth,h=o.largeImageHeight,f=o.imageInfoArray,v=n.isPrivateNetWork()?i:Gt(i);a.updateImageFormat(s);var m,M,I={size:r,url:v,width:c,height:u};if(f&&f.length>0)for(var y=0;y=0||Go({code:Ao.MSG_I_TYPES_LIMIT})}},{key:\"_checkImageSize\",value:function(e){var t=0;return 0===(t=ce?e.size:e.files[0].size)?Go({code:Ao.MSG_F_IS_EMPTY}):tthis.UPLOAD_SIZE_LIMIT.F?this._checkSizeError(\"F\"):0===e.file.files[0].size?Go({code:Ao.MSG_F_IS_EMPTY}):(this._setUploadFileType(Ta),this.uploadByCOS(e))}},{key:\"doUploadVideo\",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.V?this._checkSizeError(\"V\"):0===e.file.videoFile.size?Go({code:Ao.MSG_F_IS_EMPTY}):-1===ma.indexOf(e.file.videoFile.type)?Go({code:Ao.MSG_V_TYPES_LIMIT}):(this._setUploadFileType(Ia),ce?this.handleVideoUpload(t(t({},e),{},{file:e.file.videoFile})):ue?this.handleVideoUpload(e):void 0)}},{key:\"handleVideoUpload\",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new ko({code:Ao.MSG_V_UPLOAD_FAIL}))}))}))}))}},{key:\"doUploadAudio\",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.A?this._checkSizeError(\"A\"):0===e.file.size?Go({code:Ao.MSG_F_IS_EMPTY}):(this._setUploadFileType(ya),this.uploadByCOS(e)):Go({code:Ao.MSG_A_UPLOAD_FAIL})}},{key:\"uploadByCOS\",value:function(e){var t=this;if(!It(this._cosUploadMethod))return this.outputWarning(\"PluginUndetected\"),Go({code:Ao.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var n=new Xo(\"upload\"),o=\"\".concat(this._n,\".uploadByCOS\"),a=Date.now(),i=this._getFile(e);return new Promise((function(s,r){var c=ce?t._createCosOptionsWXMiniApp(e):t._createCosOptionsWeb(e),u=t;t._cosUploadMethod(c,(function(e,c){var l=Object.create(null);if(c){if(e||vt(c.files)&&c.files[0].error){var d=new ko({code:Ao.MSG_F_UPLOAD_FAIL});return n.setError(d,!0,t.getNetworkType()).end(),Je.l(\"\".concat(o,\" failed. error:\"),c.files[0].error),403===c.files[0].error.statusCode&&(Je.w(\"\".concat(o,\" failed. cos AccessKeyId was invalid, regain auth key!\")),t._getAuthorizationKey()),void r(d)}l.fileName=i.name,l.fileSize=i.size,l.fileType=i.type.slice(i.type.indexOf(\"/\")+1).toLowerCase(),l.location=ce?c.Location:c.files[0].data.Location;var p=Date.now()-a,_=u._formatFileSize(i.size),g=u._formatSpeed(1e3*i.size/p),h=\"size:\".concat(_,\" time:\").concat(p,\"ms speed:\").concat(g);Je.l(\"\".concat(o,\" success. name:\").concat(i.name,\" \").concat(h)),s(l);var f=t.getModule(mo);return f.addCost(Ho,p),f.addFileSize(Ho,i.size),void n.setNetworkType(t.getNetworkType()).setMessage(h).end()}var v=new ko({code:Ao.MSG_F_UPLOAD_FAIL});n.setError(v,!0,u.getNetworkType()).end(),Je.w(\"\".concat(o,\" failed. error:\"),e),403===e.statusCode&&(Je.w(\"\".concat(o,\" failed. cos AccessKeyId was invalid, regain auth key!\")),t._getAuthorizationKey()),r(v)}))}))}},{key:\"_uploadWithPreSigUrl\",value:function(e){var t=this,n=\"\".concat(this._n,\"._uploadWithPreSigUrl\"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(a,i){var s=new Xo(\"upload\"),r=e.requestSnapshotUrl,c=void 0===r?void 0:r,u=_(e,Di),l=Date.now();t._cosUploadMethod(u,(function(r,d){if(r||403===d.statusCode){s.setError(new ko(r),!0,t.getNetworkType()).end();var p={HttpStatusCode:Ei,CostTime:un(l,!1),error:r,url:e.url};return d.data&&d.data.uploadIP&&(p.uploadIP=d.data.uploadIP),t._uploadSSOLog(p),Je.l(\"\".concat(n,\" failed, error:\"),r),void i(new ko({code:Ao.MSG_F_UPLOAD_FAIL}))}var _=Object.create(null),g=d.data.location||\"\";t.isPrivateNetWork()||0!==g.indexOf(\"https://\")&&0!==g.indexOf(\"http://\")||(g=g.split(\"//\")[1]),_.fileName=o.name,_.fileSize=o.size,_.fileType=o.type.slice(o.type.indexOf(\"/\")+1).toLowerCase(),_.location=g;var h=un(l,!1),f=t._formatFileSize(o.size),v=t._formatSpeed(1e3*o.size/h),m=\"size:\".concat(f,\" time:\").concat(h,\"ms speed:\").concat(v,\" res:\").concat(JSON.stringify(d.data));Je.l(\"\".concat(n,\" ok. name:\").concat(o.name,\" \").concat(m)),s.setNetworkType(t.getNetworkType()).setMessage(m).end();var M={HttpStatusCode:d.statusCode,FileSize:o.size,CostTime:h,url:e.url};d.data&&d.data.uploadIP&&(M.uploadIP=d.data.uploadIP),t._uploadSSOLog(M);var I=t.getModule(mo);I.addCost(Ho,h),I.addFileSize(Ho,o.size);var y=[];if(u.thumbUrl&&u.largeUrl&&y.push.apply(y,[t._getSmallImageInfoByUrl(u.thumbUrl,_),t._getLargeImageInfoByUrl(u.largeUrl,_)]),t.uploadFileType===Ma&&t.isSimpleCos&&(y.push(t._getImageInfoArray(u.downloadUrl,_)),d.data.uploadIP&&y.push(t._getDownloadIP(u.downloadUrl.split(\"//\")[1].split(\"/\")[0],_))),c&&y.push(t._getSnapshotInfoByUrl(c,_)),y.length>0)return Promise.all(y).then((function(){a(_)}));a(_)}))}))}))}},{key:\"_getDownloadIP\",value:function(e,t){var n=\"\".concat(this._n,\"._getDownloadIP\"),o=Date.now();return this.request({protocolName:Uo.GET_IP,requestData:{domainName:e}}).then((function(e){if(e.data&&e.data.ip){Je.l(\"\".concat(n,\" ok. downloadIP:\").concat(e.data.ip,\" cost:\").concat(un(o)));var a=t.location.split(\"/\");a[0]=e.data.ip,t.location=a.join(\"/\")}})).catch((function(e){}))}},{key:\"_getImageInfoArray\",value:function(e,t){var n=this,o=\"\".concat(this._n,\"._getImageInfoArray\"),a=Date.now();return this.request({protocolName:Uo.GET_IMAGE_INFO,requestData:{imageUrl:e}}).then((function(e){var n=e.data||{};return Je.l(\"\".concat(o,\" ok. data: \").concat(JSON.stringify(n),\" cost:\").concat(un(a))),t.imageInfoArray=n.imageInfoArray,n})).catch((function(o){t.imageInfoArray=void 0,n._uploadSSOLog({HttpStatusCode:Si,CostTime:un(a,!1),url:e})}))}},{key:\"_uploadSSOLog\",value:function(e){if(this.isSimpleCos){var t=new Xo;t.setEventType(18),e.error?t.setError(new ko(e.error),!0,this.getNetworkType()):t.setNetworkType(this.getNetworkType());var n=\"HttpStatusCode:\".concat(e.HttpStatusCode,\"|CosRequestId:\").concat(e.CosRequestId||\"\",\"|\")+\"FileAlreadyExist:\".concat(e.FileAlreadyExist||0,\"|FileSize:\").concat(e.FileSize||0,\"|CostTime:\").concat(e.CostTime);e.uploadIP&&(n+=\"|FinalIP:\".concat(e.uploadIP)),t.setMessage(\"OK\").setMoreMessage(e.url).setExtension(n).end()}}},{key:\"_getRawOrUploadProxyUrl\",value:function(e){var t=this.getModule(io).getFileUploadProxy(),n=e;return t&&(n=e.replace(/^https:\\/\\/[^/]+/,t)),n}},{key:\"_getFile\",value:function(e){return vt(e.file.files)||Tt(e.file.files)?e.file.files[0]:e.file}},{key:\"_formatFileSize\",value:function(e){return e<1024?e+\"B\":e<1048576?Math.floor(e/1024)+\"KB\":Math.floor(e/1048576)+\"MB\"}},{key:\"_formatSpeed\",value:function(e){return e<=1048576?Xt(e/1024,1)+\"KB/s\":Xt(e/1048576,1)+\"MB/s\"}},{key:\"_createCosOptionsWeb\",value:function(e){var t=this._getFile(e),n=t.name,o=n.slice(n.lastIndexOf(\".\")),a=this._genFileName(\"\".concat(kt(999999)).concat(o));return{files:[{Bucket:\"\".concat(this.bucketName,\"-\").concat(this.appid),Region:this.region,Key:\"\".concat(this.directory,\"/\").concat(a),Body:t}],SliceSize:1048576,onProgress:function(t){if(\"function\"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Je.w(\"onProgress callback error:\",n)}},onFileFinish:function(e,t,n){}}}},{key:\"_createCosOptionsWXMiniApp\",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name),o=t.url;return{Bucket:\"\".concat(this.bucketName,\"-\").concat(this.appid),Region:this.region,Key:\"\".concat(this.directory,\"/\").concat(n),FilePath:o,onProgress:function(t){if(Je.l(JSON.stringify(t)),\"function\"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Je.w(\"onProgress callback error:\",n)}}}}},{key:\"_createCosOptionsPreSigUrl\",value:function(e){var t=this,n=\"\",o=\"\",a=0,i=this._getFile(e);if(ce){if(e.message.type===S.MSG_FILE){var s=i.name,r=s.slice(s.lastIndexOf(\".\"));n=this._genFileName(\"\".concat(kt(999999)).concat(r))}else n=this._genFileName(i.name);o=i.url,a=1}else{var c=i.name,u=c.slice(c.lastIndexOf(\".\"));n=this._genFileName(\"\".concat(kt(999999)).concat(u)),o=i,a=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:n,uploadMethod:a,duration:this.duration,userID:e.message.from,conversationType:qt(e.message.conversationID)?1:2}).then((function(a){var i=t.isSimpleCos?a.preSig[0]:a,s=i.uploadUrl,r=i.downloadUrl,c=i.requestSnapshotUrl,u=void 0===c?void 0:c,l=i.thumbUrl,d=i.largeUrl,p=i.fileKey,_=a.uploadIP,g=void 0===_?\"\":_;return{url:t._getRawOrUploadProxyUrl(s),fileType:t.uploadFileType,fileName:n,resources:o,downloadUrl:r,requestSnapshotUrl:u,thumbUrl:l,largeUrl:d,fileKey:p,uploadIP:!t.isPrivateNetWork()&&g,onProgress:function(t){if(\"function\"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){Je.w(\"onProgress callback error:\",n),Je.e(n)}}}}))}},{key:\"_genFileName\",value:function(e){return\"\".concat(Kt(),\"-\").concat(e)}},{key:\"_setUploadFileType\",value:function(e){this.uploadFileType=e}},{key:\"_getSnapshotInfoByUrl\",value:function(e,t){var n=this,o=\"_getSnapshotInfoByUrl\",a=new Xo(o);return this.request({protocolName:Uo.VIDEO_COVER,requestData:{platform:this.getPlatform(),coverName:this._genFileName(kt(99999)),requestSnapshotUrl:e}}).then((function(e){var i=(e.data||{}).snapshotUrl;return Je.l(\"\".concat(n._n,\".\").concat(o,\" ok. snapshotUrl:\").concat(i)),a.setMessage(\"snapshotUrl:\".concat(i)).end(),pn(i)?{}:Bt(i).then((function(e){t.snapshotInfo={snapshotUrl:i,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return Je.w(\"\".concat(n._n,\".\").concat(o,\" failed. error:\"),e),a.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:\"_getSmallImageInfoByUrl\",value:function(e,t){return Bt(e).then((function(n){t.smallImageUrl=e,t.smallImageWidth=n.width,t.smallImageHeight=n.height}))}},{key:\"_getLargeImageInfoByUrl\",value:function(e,t){return Bt(e).then((function(n){t.largeImageUrl=e,t.largeImageWidth=n.width,t.largeImageHeight=n.height}))}},{key:\"_isEmptyFileList\",value:function(e){return!(!Tt(e)||0!==e.length)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\"))}}]),a}(Po),ki=[\"downloadKey\",\"pbDownloadKey\",\"messageList\"],Ai=function(){function e(t){o(this,e),this._n=\"MergerMessageHandler\",this._messageModule=t}return i(e,[{key:\"uploadMergerMessage\",value:function(e,t){var n=this,o=\"\".concat(this._n,\".\").concat(\"uploadMergerMessage\");Je.d(\"\".concat(o,\" message:\"),e,\"messageBytes:\".concat(t));var a=e.payload.messageList,i=a.length,s=new Xo(\"uploadMergerMessage\");return this._messageModule.request({protocolName:Uo.UPLOAD_MERGER_MESSAGE,requestData:{messageList:a}}).then((function(e){Je.d(\"\".concat(o,\" ok. response:\"),e.data);var a=e.data,r=a.pbDownloadKey,c=a.downloadKey,u={pbDownloadKey:r,downloadKey:c,messageNumber:i};return s.setNetworkType(n._messageModule.getNetworkType()).setMessage(\"\".concat(i,\"-\").concat(t,\"-\").concat(c)).end(),u})).catch((function(e){throw Je.w(\"\".concat(o,\" failed. error:\"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),e}))}},{key:\"downloadMergerMessage\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"downloadMergerMessage\");Je.d(\"\".concat(o,\" message:\"),e);var a=e.payload.downloadKey,i=this._messageModule.getFileDownloadProxy(),s=new Xo(\"downloadMergerMessage\");return s.setMessage(\"downloadKey:\".concat(a)),this._messageModule.request({protocolName:Uo.DOWNLOAD_MERGER_MESSAGE,requestData:{downloadKey:a}}).then((function(a){if(Je.d(\"\".concat(o,\" ok. response:\"),a.data),It(e.clearElement)){var r=e.payload;r.downloadKey,r.pbDownloadKey,r.messageList;var c=_(r,ki);e.clearElement(),e.setElement({type:e.type,content:t({messageList:a.data.messageList},c)},i)}else{var u=[];a.data.messageList.forEach((function(e){if(!pn(e)){var t=new ua(e,i);u.push(t)}})),e.payload.messageList=u,e.payload.downloadKey=\"\",e.payload.pbDownloadKey=\"\"}return s.setNetworkType(n._messageModule.getNetworkType()).end(),e})).catch((function(e){throw Je.w(\"\".concat(o,\" failed. key:\").concat(a,\" error:\"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),e}))}},{key:\"createMergerMessagePack\",value:function(e,t,n){return e.conversationType===S.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:\"_createC2CMergerMessagePack\",value:function(e,t,n){var o=null;t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly&&(o?o.disablePush=!0:o={disablePush:!0}));var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push(\"NoUnread\"),!0===r&&a.push(\"NoLastMsg\"),!0===c&&a.push(\"NoMsgCheck\")}var u=\"\";gt(e.cloudCustomData)&&e.cloudCustomData.length>0&&(u=e.cloudCustomData);var l=n.pbDownloadKey,d=n.downloadKey,p=n.messageNumber,_=e.payload,g=_.title,h=_.abstractList,f=_.compatibleText,v=this._messageModule.getModule(eo),m=v&&v.isOnlineMessage(e,t)?0:void 0;return{protocolName:Uo.SEND_C2C_MESSAGE,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:d,title:g,abstractList:h,compatibleText:f,messageNumber:p}}],cloudCustomData:u,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||\"\",desc:o.description||\"\",ext:o.extension||\"\",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||\"\"}}:void 0,messageControlInfo:0!==m?a:void 0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}},{key:\"_createGroupMergerMessagePack\",value:function(e,t,n){var o=null;t&&t.offlinePushInfo&&(o=t.offlinePushInfo);var a=[];if(ft(t)&&ft(t.messageControlInfo)){var i=t.messageControlInfo,s=i.excludedFromUnreadCount,r=i.excludedFromLastMessage,c=i.excludedFromContentModeration;!0===s&&a.push(\"NoUnread\"),!0===r&&a.push(\"NoLastMsg\"),!0===c&&a.push(\"NoMsgCheck\")}var u=\"\";gt(e.cloudCustomData)&&e.cloudCustomData.length>0&&(u=e.cloudCustomData);var l=n.pbDownloadKey,d=n.downloadKey,p=n.messageNumber,_=e.payload,g=_.title,h=_.abstractList,f=_.compatibleText,v=this._messageModule.getModule(to),m=v&&v.isOnlineMessage(e,t)?1:0;return{protocolName:Uo.SEND_GROUP_MESSAGE,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:d,title:g,abstractList:h,compatibleText:f,messageNumber:p}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:u,onlineOnlyFlag:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||\"\",desc:o.description||\"\",ext:o.extension||\"\",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||\"\"}}:void 0,clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||v.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:0===m?a:void 0,isSupportExtension:!0===e.isSupportExtension?1:0,isRelayMessage:!0===e._relayFlag?1:0}}}}]),e}(),Li={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},Ri=[Ao.MSG_ONPROGRESS_FUNCTION_ERROR,Ao.MSG_I_SELECT_F_FIRST,Ao.MSG_I_TYPES_LIMIT,Ao.MSG_F_IS_EMPTY,Ao.MSG_I_SIZE_LIMIT,Ao.MSG_F_SELECT_F_FIRST,Ao.MSG_F_SIZE_LIMIT,Ao.MSG_V_SIZE_LIMIT,Ao.MSG_V_TYPES_LIMIT,Ao.MSG_A_UPLOAD_FAIL,Ao.MSG_A_SIZE_LIMIT,Ao.COS_UNDETECTED];function Oi(e){var t=!1;return Object.values(Li).includes(e)&&(t=!0),(e>=120001&&e<=13e4||e>=10100&&e<=10200)&&(t=!0),t}var Gi=[\"conversationID\",\"timePosition\",\"timePeriod\"],Pi=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n=\"MessageModule\",t._messageOptionsMap=new Map,t._mergerMessageHandler=new Ai(g(t)),t}return i(a,[{key:\"createTextMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=gt(e.payload)?e.payload:e.payload.text,a=new Qo({text:o}),i=this._getNickAndAvatarByUserID(t);return n.setElement(a),n.setNickAndAvatar(i),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"createImageMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e);if(ce){var o=e.payload.file;if(pt(o))return void this.outputWarning(\"FileUnsupportedInMP\",\"createImageMessage\");var a=o.tempFiles[0].path||o.tempFiles[0].tempFilePath,i={url:a,name:a.slice(a.lastIndexOf(\"/\")+1),size:o.tempFiles&&o.tempFiles[0].size||1,type:a.slice(a.lastIndexOf(\".\")+1).toLowerCase()};e.payload.file=i}else if(ue)if(pt(e.payload.file)){var s=e.payload.file;e.payload.file={files:[s]}}else if(ft(e.payload.file)&&\"undefined\"!=typeof uni){var r=e.payload.file.tempFiles[0];e.payload.file={files:[r]}}var c=new Zo({imageFormat:ze.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file}),u=this._getNickAndAvatarByUserID(t);return n.setElement(c),n.setNickAndAvatar(u),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:\"createAudioMessage\",value:function(e){var t=e.payload.file;if(ce){var n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(\"/\")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(\".\")+1).toLowerCase()};e.payload.file=n}var o=this.getMyUserID();e.currentUser=o,e.senderTinyID=this.getMyTinyID();var a=new pa(e),i=new ea({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size,url:t.tempFilePath,uuid:this._generateUUID(e.payload.file)}),s=this._getNickAndAvatarByUserID(o);return a.setElement(i),a.setNickAndAvatar(s),a.setNameCard(this._getNameCardByGroupID(a)),this._messageOptionsMap.set(a.clientSequence,e),a}},{key:\"createVideoMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl=\"\",e.payload.file.thumbSize=0;var n={};if(ce){if(ae)return void this.outputWarning(\"VideoUnsupportedInAlipay\");if(pt(e.payload.file))return void this.outputWarning(\"FileUnsupportedInMP\",\"createVideoMessage\");var o=e.payload.file;vt(o.tempFiles)&&(o=o.tempFiles[0]),n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(\"/\")+1),n.size=o.size||1,n.second=o.duration||0,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(\".\")+1).toLowerCase()}else if(ue){if(pt(e.payload.file)){var a=e.payload.file;e.payload.file.files=[a]}else if(ft(e.payload.file)&&\"undefined\"!=typeof uni){var i=e.payload.file.tempFile;e.payload.file.files=[i]}var s=e.payload.file;n.url=window.URL.createObjectURL(s.files[0]),n.name=s.files[0].name,n.size=s.files[0].size||1,n.second=s.files[0].duration||0,n.type=s.files[0].type.split(\"/\")[1]}e.payload.file.videoFile=n;var r=new pa(e),c=new ra({videoFormat:n.type,videoSecond:Xt(n.second,0),videoSize:n.size,remoteVideoUrl:\"\",videoUrl:n.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(\".\")+1).toLowerCase()}),u=this._getNickAndAvatarByUserID(t);return r.setElement(c),r.setNickAndAvatar(u),r.setNameCard(this._getNameCardByGroupID(r)),this._messageOptionsMap.set(r.clientSequence,e),r}},{key:\"createCustomMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=new sa({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),a=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"createFaceMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=new $o(e.payload),a=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"createMergerMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=this._getNickAndAvatarByUserID(t),o=new pa(e),a=new la(e.payload);return o.setElement(a),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:\"createForwardMessage\",value:function(e){var t=e.to,n=e.conversationType,o=e.priority,a=e.payload,i=e.needReadReceipt,s=e.receiverList;if(!vt(a._elements))return Go({code:Ao.MSG_FORWARD_INVALID_ELEMENTS});var r=this.getMyUserID(),c=this._getNickAndAvatarByUserID(r);if(a.type===S.MSG_GRP_TIP)return Go({code:Ao.MSG_FORWARD_TYPE_INVALID});var u={to:t,conversationType:n,conversationID:\"\".concat(n).concat(t),priority:o,isPlaceMessage:0,status:fn.UNSEND,currentUser:r,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||a.cloudCustomData||\"\",needReadReceipt:i,receiverList:s,isSupportExtension:e.isSupportExtension||!1},l=new pa(u);return l.setElement(a._elements[0]),l.setNickAndAvatar(c),l.setNameCard(this._getNameCardByGroupID(a)),l.setRelayFlag(!0),l}},{key:\"downloadMergerMessage\",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:\"createFileMessage\",value:function(e){if(ce){if(!$&&!te&&!se)return;var n=le.getSystemInfoSync().SDKVersion;if($&&Wt(n,\"2.5.0\")<0)return void this.outputWarning(\"WXChooseMessageFile\");if(te&&Wt(n,\"1.18.0\")<0)return void this.outputWarning(\"QQChooseMessageFile\")}if(ue||se){if(pt(e.payload.file)){var o=e.payload.file;e.payload.file={files:[o]}}else if(ft(e.payload.file)&&\"undefined\"!=typeof uni){var a=e.payload.file,i=a.tempFiles,s=a.files,r=null;vt(i)?r=i[0]:vt(s)&&(r=s[0]),e.payload.file={files:[r]}}}else if($||te){var c=e.payload.file.tempFiles,u=t(t({},c[0]),{},{url:c[0].path});e.payload.file={files:[u]}}var l=this.getMyUserID();e.currentUser=l,e.senderTinyID=this.getMyTinyID();var d=new pa(e),p=new ia({uuid:this._generateUUID(e.payload.file),file:e.payload.file}),_=this._getNickAndAvatarByUserID(l);return d.setElement(p),d.setNickAndAvatar(_),d.setNameCard(this._getNameCardByGroupID(d)),this._messageOptionsMap.set(d.clientSequence,e),d}},{key:\"createLocationMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new pa(e),o=new ca(e.payload),a=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"_onCannotFindModule\",value:function(){return Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"sendMessageInstance\",value:function(e,t){var n=this;if(!1===this.getModule(yo).filterMessage(e,t))return e.hasRiskContent=!0,this._onSendMessageFailed(e,new ko({code:Ao.PROFANITY_FOUND}));var o=null;if(e.conversationType===S.CONV_C2C)o=this.getModule(eo);else{if(e.conversationType!==S.CONV_GROUP)return Go({code:Ao.MSG_INVALID_CONV_TYPE});o=this.getModule(to)}var a,i=\"\".concat(this._n,\".sendMessageInstance\"),s=this.getModule(ao),r=o.isOnlineMessage(e,t);return this.getModule(uo).upload(e).then((function(){n._getSendMessageSpecifiedKey(e)===Vo&&n.getModule(mo).addSuccessCount(Ho);return n._guardForGroup(e).then((function(){if(!e.isSendable())return Go({code:Ao.MSG_F_URL_IS_EMPTY});n._addSendMessageTotalCount(e),a=Date.now();var i=function(e){var t=\"utf-8\";ue&&document&&(t=document.charset.toLowerCase());var n,o,a=0;if(o=e.length,\"utf-8\"===t||\"utf8\"===t)for(var i=0;i11264?n._mergerMessageHandler.uploadMergerMessage(e,i).then((function(o){var a=n._mergerMessageHandler.createMergerMessagePack(e,t,o);return n.request(a)})):(s.setMessageRandom(e),o.sendMessage(e,t))})).then((function(o){var c=o.data,u=c.time,l=c.sequence,d=c.readReceiptCode,p=c.messageDropReason;_t(d)&&0!==d&&(new Xo(\"sendMessageWithReceipt\").setMessage(\"from:\".concat(e.from,\" to:\").concat(e.to,\" sequence:\").concat(l,\" readReceiptCode:\").concat(d)).end(),Je.w(\"\".concat(i,\" readReceiptCode:\").concat(d,\" message:\").concat(n.getErrorMessage(d))));if(p){var _=new Xo(\"messageDropReason\"),g=\"from:\".concat(e.from,\" to:\").concat(e.to,\" sequence:\").concat(l,\" messageDropReason:\").concat(p);_.setMessage(g).end(),Je.w(\"\".concat(i,\" \").concat(g))}if(n._addSendMessageSuccessCount(e,a),n._messageOptionsMap.delete(e.clientSequence),!0===e.isResend){var h=s.findMessage(e.ID);h&&(Je.l(\"\".concat(i,\" resend ok. ID:\").concat(h.ID)),s.deleteLocalMessage(h))}e.status=fn.SUCCESS,e.time=u;var f=!1;if(e.conversationType===S.CONV_GROUP)e.sequence=l;else if(e.conversationType===S.CONV_C2C){var v=s.getLatestMessageSentByMe(e.conversationID);if(v){var m=v.nick,M=v.avatar;m===e.nick&&M===e.avatar||(f=!0)}}if(f&&s.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),!0===r)e._onlineOnlyFlag=!0;else{s.appendToMessageList(e);var I=e;ft(t)&&ft(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,I=\"\"),!0===t.messageControlInfo.excludedFromUnreadCount&&(e._isExcludedFromUnreadCount=!0));var y=e.conversationType;if(Ft(e.to))y=S.CONV_TOPIC,n.getModule(oo).onMessageSent({groupID:$t(e.to),topicID:e.to,lastMessage:I});s.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:y,subType:e.conversationSubType,lastMessage:I}]})}return e._relayFlag||\"TIMImageElem\"!==e.type||Jt(e.payload.imageInfoArray),No({message:e})}))})).catch((function(t){return n._onSendMessageFailed(e,t,r)}))}},{key:\"_guardForGroup\",value:function(e){if(e.conversationType!==S.CONV_GROUP)return Promise.resolve();var t=this.getModule(to);if(!t)return this._onCannotFindModule();if(wt({groupID:e.to})){var n=t.getLocalGroupProfile(e.to);if(n&&n.isSupportTopic)return Go({code:Ao.MSG_SEND_GRP_WITH_TOPIC_FAIL})}return t.guardForAVChatRoom(e)}},{key:\"_onSendMessageFailed\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=\"\".concat(this._n,\"._onSendMessageFailed\");e.status=fn.FAIL,80001!==t.code&&80004!==t.code||(e.hasRiskContent=!0);var a=this.getModule(ao);a.deleteMessageRandom(e);var i=t.code>=10100&&t.code<=10200||t.code>=120001&&t.code<=13e4;if(!n&&!i){var s=a.appendToMessageList(e);!0===s&&Je.l(\"\".concat(o,\" message stored, ID:\").concat(e.ID))}this._addSendMessageFailCountOnUser(e,t);var r=new Xo(\"sendMessage\");return r.setMessage(\"tjg_id:\".concat(this.generateTjgID(e),\" type:\").concat(e.type,\" from:\").concat(e.from,\" to:\").concat(e.to)),this.probeNetwork().then((function(e){var n=v(e,2),o=n[0],a=n[1];r.setError(t,o,a).end()})),Je.e(\"\".concat(o,\" error:\"),t),Go(new ko({code:t&&t.code?t.code:Ao.MSG_SEND_FAIL,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:\"_getSendMessageSpecifiedKey\",value:function(e){if([S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_VIDEO,S.MSG_FILE].includes(e.type))return Vo;if(e.conversationType===S.CONV_C2C)return Fo;if(e.conversationType===S.CONV_GROUP){var t=this.getModule(to);if(!t)return;var n=t.getLocalGroupProfile(e.to);if(!n)return;var o=n.type;return bt(o)?xo:qo}}},{key:\"_addSendMessageTotalCount\",value:function(e){var t=this._getSendMessageSpecifiedKey(e);t&&this.getModule(mo).addTotalCount(t)}},{key:\"_addSendMessageSuccessCount\",value:function(e,t){var n=this._getSendMessageSpecifiedKey(e);if(n){var o=this.getModule(mo);o.addSuccessCount(n),o.addCost(n,un(t,!1))}}},{key:\"_addSendMessageFailCountOnUser\",value:function(e,t){var n,o,a=t.code,i=void 0===a?-1:a,s=this.getModule(mo),r=this._getSendMessageSpecifiedKey(e);r===Vo&&(n=i,o=!1,Ri.includes(n)&&(o=!0),o)?s.addFailedCountOfUserSide(Ho):Oi(i)&&r&&s.addFailedCountOfUserSide(r)}},{key:\"resendMessage\",value:function(e,t){return e.isResend=!0,e.status=fn.UNSEND,this.sendMessageInstance(e,t)}},{key:\"revokeMessage\",value:function(e){var t=this,n=null;if(e.conversationType===S.CONV_C2C?n=this.getModule(eo):e.conversationType===S.CONV_GROUP&&(n=this.getModule(to)),!n)return this._onCannotFindModule();var o=new Xo(\"revokeMessage\");o.setMessage(\"tjg_id:\".concat(this.generateTjgID(e),\" type:\").concat(e.type,\" from:\").concat(e.from,\" to:\").concat(e.to));var a=\"\".concat(this._n,\".\").concat(\"revokeMessage\");return n.revokeMessage(e).then((function(n){var i=n.data.recallRetList;if(!pn(i)&&0!==i[0].retCode){var s=new ko({code:i[0].retCode,data:{message:e}});return o.setCode(s.code).setMoreMessage(s.message).end(),Go(s)}return Je.i(\"\".concat(a,\" ok. ID:\").concat(e.ID)),e.isRevoked=!0,o.end(),t.getModule(ao).onMessageRevoked([e]),No({message:e})})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];o.setError(n,a,i).end()}));var i=new ko({code:n&&n.code?n.code:Ao.MSG_REVOKE_FAIL,message:n&&n.message?n.message:void 0,data:{message:e}});return Je.w(\"\".concat(a,\" failed. error:\"),n),Go(i)}))}},{key:\"deleteMessage\",value:function(e){var t=this,n=null,o=e[0],a=o.conversationID,i=\"\",s=[],r=[];if(o.conversationType===S.CONV_C2C)n=this.getModule(eo),i=a.replace(S.CONV_C2C,\"\"),e.forEach((function(e){e&&e.status===fn.SUCCESS&&e.conversationID===a&&(e._onlineOnlyFlag||s.push(\"\".concat(e.sequence,\"_\").concat(e.random,\"_\").concat(e.time)),r.push(e))}));else if(o.conversationType===S.CONV_GROUP)n=this.getModule(to),i=a.replace(S.CONV_GROUP,\"\"),e.forEach((function(e){e&&e.status===fn.SUCCESS&&e.conversationID===a&&(e._onlineOnlyFlag||s.push(\"\".concat(e.sequence)),r.push(e))}));else if(o.conversationType===S.CONV_SYSTEM)return Go({code:Ao.CANNOT_DELETE_GRP_SYSTEM_NOTICE});if(!n)return this._onCannotFindModule();if(0===s.length)return this._onMessageDeleted(r);s.length>30&&(s=s.slice(0,30),r=r.slice(0,30));var c=new Xo(\"deleteMessage\");c.setMessage(\"to:\".concat(i,\" count:\").concat(s.length));var u=\"\".concat(this._n,\".\").concat(\"deleteMessage\");return n.deleteMessage({to:i,keyList:s}).then((function(e){return c.end(),Je.i(\"\".concat(u,\" ok\")),t._onMessageDeleted(r)})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.w(\"\".concat(u,\" failed. error:\"),e);var n=new ko({code:e&&e.code?e.code:Ao.MSG_DELETE_FAIL,message:e&&e.message?e.message:void 0});return Go(n)}))}},{key:\"_onMessageDeleted\",value:function(e){return this.getModule(ao).onMessageDeleted(e),Oo({messageList:e})}},{key:\"translateText\",value:function(e){var n=\"\".concat(this._n,\".\").concat(\"translateText\"),o=e.sourceTextList,a=e.sourceLanguage,i=e.targetLanguage,s=new Xo(\"translateText\");return s.setMessage(\"sourceLanguage:\".concat(a,\" targetLanguage:\").concat(i)),this.request({protocolName:Uo.TRANSLATE_TEXT,requestData:{sourceTextList:o,source:a||\"auto\",target:i,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then((function(e){var o=e.data,a=o.error,i=o.requestID,r=o.translatedTextList;if(0===a.code)return s.end(),Je.i(\"\".concat(n,\" ok. requestID:\").concat(i)),No({translatedTextList:r});throw t(t({},a),{},{requestID:i})})).catch((function(e){return s.setCode(e.code).setMoreMessage(e.requestID).end(),Je.w(\"\".concat(n,\" failed. error:\"),e),Go({code:Ao.TRANSLATE_TEXT_FAIL})}))}},{key:\"convertVoiceToText\",value:function(e){var n=e.message,o=e.language,a=n.payload.url;n.from===this.getMyUserID()&&\"out\"===n.flow&&(a=n.payload.remoteAudioUrl);var i=/\\.(wav|pcm|ogg-opus|speex|silk|mp3|m4a|aac|amr)/;if(!i.test(a))return Go({code:Ao.UNSUPPORTED_VOICE_FORMAT});var s=i.exec(a)[1]||\"mp3\",r=\"16k_zh-PY\";o?\"zh (cmn-Hans-CN)\"===o?r=\"16k_zh\":\"en-US\"===o?r=\"16k_en\":\"yue-Hant-HK\"===o?r=\"16k_yue\":\"ja-JP\"===o&&(r=\"16k_ja\"):r=\"16k_zh-PY\";var c=\"serviceType:\".concat(r,\" url:\").concat(a),u=\"\".concat(this._n,\".\").concat(\"convertVoiceToText\");Je.i(\"\".concat(u,\" \").concat(c));var l=new Xo(\"convertVoiceToText\");return l.setMessage(c),this.request({protocolName:Uo.VOICE_TO_TEXT,requestData:{url:a,language:r,SDKAppID:this.getSDKAppID(),format:s}}).then((function(e){var n=e.data,o=n.error,a=n.requestID,i=n.result;if(0===o.code)return l.end(),Je.i(\"\".concat(u,\" ok. requestID:\").concat(a)),No({result:i});throw t(t({},o),{},{requestID:a})})).catch((function(e){return l.setCode(e.code).setMoreMessage(e.requestID||\"\").end(),Je.w(\"\".concat(u,\" failed. error:\"),e),Go({code:Ao.VOICE_TO_TEXT_FAIL})}))}},{key:\"modifyRemoteMessage\",value:function(e){var t=this,n=null,o=e.conversationType,a=e.to,i=this.getModule(to);if(!i)return this._onCannotFindModule();if(i.isMessageFromOrToAVChatroom(a))return Go({code:Ao.MSG_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:e}});if(!1===this.getModule(yo).filterMessage(e))return e.hasRiskContent=!0,Go({code:Ao.PROFANITY_FOUND,data:{message:e}});o===S.CONV_C2C?n=this.getModule(eo):o===S.CONV_GROUP&&(n=this.getModule(to));var s=new Xo(\"modifyMessage\");s.setMessage(\"to:\".concat(a));var r=\"\".concat(this._n,\".modifyRemoteMessage\");return n.modifyRemoteMessage(e).then((function(n){s.end(),Je.i(\"\".concat(r,\" ok\"));var o=t._onModifyRemoteMessageResp(e,n.data);return No({message:o})})).catch((function(n){if(s.setCode(n.code).setMoreMessage(n.message).end(),Je.w(\"\".concat(r,\" failed. error:\"),n),20027===n.code){var o=t._onModifyRemoteMessageResp(e,n.data);return Go({code:Ao.MSG_MODIFY_CONFLICT,data:{message:o}})}return Go({code:n.code,message:n.message,data:{message:e}})}))}},{key:\"_generateSearchRequestData\",value:function(e){var t=e.conversationID,n=e.timePosition,o=e.timePeriod,a=_(e,Gi);return mt(t)||(qt(t)&&(a.account=t.replace(S.CONV_C2C,\"\")),xt(t)&&(a.groupID=t.replace(S.CONV_GROUP,\"\"))),_t(o)&&o>0&&(_t(n)&&n>0?a.startTime=n-o:a.startTime=Ke()-o),a.startTime&&a.startTime<0&&(a.startTime=void 0),_t(n)&&n>0&&(a.endTime=n),a}},{key:\"searchCloudMessages\",value:function(e){var t=this,n=\"searchCloudMessages\",o=\"\".concat(this._n,\".\").concat(n);if(!e)return Go({code:Ao.OPTIONS_IS_EMPTY,message:this.getErrorMessage(Ao.OPTIONS_IS_EMPTY,n)});var a=e.keywordList,i=e.keywordListMatchType,s=e.conversationID,r=e.cursor,c=vt(e.senderUserIDList)&&e.senderUserIDList.length>0,u=vt(e.messageTypeList)&&e.messageTypeList.length>0;if(!a&&!c&&!u)throw Je.e(\"[\".concat(n,'] Missing required params: \"keywordList\".')),new Error(\"Params validate failed.\");var l=Date.now(),d=new Xo(n),p=\"keywordList:\".concat(a,\" keywordListMatchType:\").concat(i,\" \")+\"conversationID:\".concat(s,\" cursor:\").concat(r);return Je.l(\"\".concat(o,\" \").concat(p)),this.request({protocolName:Uo.MESSAGE_CLOUD_SEARCH,requestData:this._generateSearchRequestData(e)}).then((function(n){var a=n.data,i=a.code,s=a.message;if(0!==i){var r=i;60020===i&&(r=\"SearchCloudMessagesUnavailable\");var c=t.getErrorMessage(r)||s,u=new ko({code:i,message:c});return t.probeNetwork().then((function(e){var t=v(e,2),n=t[0],o=t[1];d.setMessage(p).setError(u,n,o).end()})),Go(u)}var _=n.data,g=_.cursor,h=_.totalCount,f=_.searchResult,m=\"totalCount:\".concat(h,\" cost:\").concat(un(l));Je.l(\"\".concat(o,\" ok. cursor:\").concat(g,\" \").concat(m)),d.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(p,\" \").concat(m)).end();var M=t._handleSearchResults(f,!e.conversationID);return No({searchResultList:M,cursor:g,totalCount:h})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setMessage(p).setError(e,o,a).end()})),Go(e)}))}},{key:\"_handleSearchResults\",value:function(e,t){var n=this.getModule(ao);return vt(e)&&0!==e.length?e.map((function(e){var o=e.groupID,a=e.userID,i=e.messageCount,s=e.messageList,r=o?\"\".concat(S.CONV_GROUP).concat(o):\"\".concat(S.CONV_C2C).concat(a),c={conversationID:r,messageCount:i,messageList:[]};if(t&&i>1)return c;if(s&&s.length>0){var u=n.onRoamingMessage(s,r,!1);o&&u.reverse(),c.messageList=u}return c})):[]}},{key:\"_onModifyRemoteMessageResp\",value:function(e,t){Je.d(\"\".concat(this._n,\"._onModifyRemoteMessageResp options:\"),t);var n=e.conversationType,o=e.from,a=e.to,i=e.random,s=e.sequence,r=e.time,c=t.elements,u=t.messageVersion,l=t.cloudCustomData,d=void 0===l?\"\":l;return this.getModule(ao).onMessageModified({conversationType:n,from:o,to:a,time:r,random:i,sequence:s,elements:c,cloudCustomData:d,messageVersion:u})}},{key:\"_generateUUID\",value:function(e){var t=this.getModule(io),n=\"\".concat(t.getSDKAppID(),\"-\").concat(t.getUserID(),\"-\").concat(function(){for(var e=\"\",t=32;t>0;--t)e+=At[Math.floor(Math.random()*Lt)];return e}()),o=e.name||e.value||e.url||e.tempFilePath,a=o&&o.slice(o.lastIndexOf(\".\")+1);return a&&(n=\"\".concat(n,\".\").concat(a)),n}},{key:\"getMessageOption\",value:function(e){return this._messageOptionsMap.get(e)}},{key:\"_getNickAndAvatarByUserID\",value:function(e){return this.getModule($n).getNickAndAvatarByUserID(e)}},{key:\"_getNameCardByGroupID\",value:function(e){if(e.conversationType===S.CONV_GROUP){var t=this.getModule(to);if(t)return t.getMyNameCardByGroupID(e.to)}return\"\"}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._messageOptionsMap.clear()}}]),a}(Po),Ui=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"MessageExtensionModule\",a.messageExtensionMap=new Map,a.globalSeqMap=new Map,a.getMessageExtensionsMap=new Map,a}return i(n,[{key:\"onMessageExtensionNotify\",value:function(e){var t=this,n=e.dataList,o=n.messageInfo,a=n.operateType,i=n.operateResultList,s=n.tinyID,r=n.globalSequence,c=o.clientTime,u=o.random,l=\"\".concat(s,\"-\").concat(c,\"-\").concat(u),d=[],p=[];Je.l(\"\".concat(this._n,\".onMessageExtensionNotify messageID:\").concat(l,\" operateType:\").concat(a,\" globalSequence:\").concat(r)),this._updateGlobalSequence(l,r);var _=!1,g=!1;i.forEach((function(e){var n=e.extensions,o=void 0===n?[]:n,i=e.clearSequence;if(1===a)_=!0,o.forEach((function(e){d.push({key:e.key,value:e.value})})),t._updateLocalExtension(l,o);else if(2===a)g=!0,o.forEach((function(e){p.push(e.key)})),t._updateLocalExtension(l,o);else if(3===a){if(g=!0,t._hasLocalExtension(l))t._getLocalExtension(l).forEach((function(e,t){e.seq<=i&&!pn(e.value)&&p.push(t)}));t._clearLocalExtension(l,i)}})),_&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_UPDATED,{messageID:l,extensions:d}),g&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_DELETED,{messageID:l,keyList:p})}},{key:\"setMessageExtensions\",value:function(e,t){var n=this,o=\"setMessageExtensions\";if(!this.canIUse(K.MSG_EXT))return this.cannotUseCommercialAbility(o);var a=\"\".concat(this._n,\".\").concat(o),i=e.ID,s=e.conversationID,r=e.sequence,c=e.time,u=m(t);t.length>20&&(u=t.slice(0,20),Je.w(\"\".concat(a,\". the length of extensions cannot exceed 20.\")));var l=\"conversationID:\".concat(s,\" messageID:\").concat(i,\" sequence:\").concat(r,\" time:\").concat(c,\" count:\").concat(u.length),d=new Xo(o);return d.setMessage(l),Je.l(\"\".concat(a,\" \").concat(l)),this._modifyMessageExtensions(e,u).then((function(e){var t=e.resultList,n=e.successCount,o=e.failureCount,i=\"success count:\".concat(n,\" fail count:\").concat(o);return d.setMoreMessage(i).end(),Je.l(\"\".concat(a,\" ok. \").concat(i)),No({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e(\"\".concat(a,\" failed. error:\"),e),Go(e)}))}},{key:\"getMessageExtensions\",value:function(e){var t=this,n=\"getMessageExtensions\";if(!this.canIUse(K.MSG_EXT))return this.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n),a=e.ID,i=e.conversationID,s=e.sequence,r=e.time,c=\"conversationID:\".concat(i,\" messageID:\").concat(a,\" sequence:\").concat(s,\" time:\").concat(r),u=new Xo(n);u.setMessage(c),Je.l(\"\".concat(o,\" \").concat(c));var l=void 0;return this.getMessageExtensionsMap.has(a)&&(l=this._getGlobalSequence(a)),this._getMessageExtensions(e,l).then((function(e){return u.end(),Je.l(\"\".concat(o,\" ok. total count:\").concat(e.length)),mt(l)&&e.length>0&&t.getMessageExtensionsMap.set(a,1),No({extensions:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"deleteMessageExtensions\",value:function(e,t){var n=this,o=\"deleteMessageExtensions\";if(!this.canIUse(K.MSG_EXT))return this.cannotUseCommercialAbility(o);var a=\"\".concat(this._n,\".\").concat(o),i=[],s=3;pn(t)||(s=2,t.forEach((function(e){i.push({key:e,value:\"\",seq:0})})));var r=e.ID,c=e.conversationID,u=e.sequence,l=e.time,d=\"conversationID:\".concat(c,\" messageID:\").concat(r,\" sequence:\").concat(u,\" time:\").concat(l,\" operateType:\").concat(s),p=new Xo(o);return p.setMessage(d),Je.l(\"\".concat(a,\" \").concat(d)),this._modifyMessageExtensions(e,i,s).then((function(e){var t=e.resultList,n=e.successCount,o=e.failureCount,i=\"\";return 2===s&&(i=\"success count:\".concat(n,\" fail count:\").concat(o)),p.setMoreMessage(\"\".concat(i)).end(),Je.l(\"\".concat(a,\" ok. \").concat(i)),No({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setError(e,o,a).end()})),Je.e(\"\".concat(a,\" failed. error:\"),e),Go(e)}))}},{key:\"_modifyMessageExtensions\",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,a=Ft(e.to)?S.CONV_TOPIC:e.conversationType,i=void 0;3!==o&&(i=this._getRequestExtensions(e,t));var s=null;switch(a){case S.CONV_C2C:s=this.getModule(eo);break;case S.CONV_GROUP:s=this.getModule(to);break;case S.CONV_TOPIC:s=this.getModule(oo);break;default:return Go({code:Ao.CANNOT_FIND_MODULE})}return s.modifyMessageExtensions(e,i,o).then((function(t){var o=t.data,a=o.extensions,i=o.seq,s=[],r=0,c=0,u=[];return(a=pn(a)?[]:a).forEach((function(e){var t=e.errorCode,n=e.extension,o=n.key,a=n.value,i=n.seq;s.push({code:t,key:o,value:a}),0===t?r++:c++,u.push({key:o,value:a,seq:i})})),n._updateGlobalSequence(e.ID,i),u.length>0&&(n._updateLocalExtension(e.ID,u),u=null),{resultList:s,successCount:r,failureCount:c}})).catch((function(e){return Go(e)}))}},{key:\"_getRequestExtensions\",value:function(e,t){var n=[];if(this._hasLocalExtension(e.ID)){var o=this._getLocalExtension(e.ID);return t.forEach((function(e){var t=e.key,a=e.value,i=0;o.has(t)&&(i=o.get(t).seq),n.push({key:t,value:a,seq:i})})),n}return t.forEach((function(e){var t=e.key,o=e.value;n.push({key:t,value:o,seq:0})})),n}},{key:\"_getMessageExtensions\",value:function(e,t){var n=this,o=\"\".concat(this._n,\"._getMessageExtensions\"),a=e.ID,i=e.to,s=null;switch(Ft(i)?S.CONV_TOPIC:e.conversationType){case S.CONV_C2C:s=this.getModule(eo);break;case S.CONV_GROUP:s=this.getModule(to);break;case S.CONV_TOPIC:s=this.getModule(oo);break;default:return Go({code:Ao.CANNOT_FIND_MODULE})}return s.getMessageExtensions(e,t).then((function(t){var i=t.data,s=i.extensions,r=i.completeFlag,c=i.globalSequence,u=i.clearSequence;if(s=pn(s)?[]:s,Je.l(\"\".concat(o,\" ok. completeFlag:\").concat(r,\" globalSequence:\").concat(c,\" clearSequence:\").concat(u,\" count:\").concat(s.length)),n._updateLocalExtension(a,s),n._clearLocalExtension(a,u),n._updateGlobalSequence(a,c),1!==r){var l=s.slice(-1)[0].seq+1;return n._getMessageExtensions(e,l)}return n._getLocalExtensions(a)})).catch((function(e){return Go(e)}))}},{key:\"_hasLocalExtension\",value:function(e){return this.messageExtensionMap.has(e)}},{key:\"_getLocalExtension\",value:function(e){return this.messageExtensionMap.get(e)}},{key:\"_updateLocalExtension\",value:function(e,t){this._hasLocalExtension(e)||this.messageExtensionMap.set(e,new Map);var n=this._getLocalExtension(e);t.forEach((function(e){var t=e.key,o=e.value,a=void 0===o?\"\":o,i=e.seq;n.set(t,{value:a,seq:i})}))}},{key:\"_clearLocalExtension\",value:function(e,t){if(!(t<=0)&&this._hasLocalExtension(e)){var n=this._getLocalExtension(e);n.forEach((function(e,o){e.seq<=t&&n.delete(o)}))}}},{key:\"_getLocalExtensions\",value:function(e){var t=[];this._hasLocalExtension(e)&&this._getLocalExtension(e).forEach((function(e,n){var o=e.value;pn(o)||t.push({key:n,value:o})}));return t}},{key:\"_getGlobalSequence\",value:function(e){return this.globalSeqMap.get(e)}},{key:\"_updateGlobalSequence\",value:function(e,t){this.globalSeqMap.set(e,t)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),n}(Po),bi=function(e){r(a,e);var n=f(a);function a(e){var t;return o(this,a),(t=n.call(this,e))._n=\"MessageReactionModule\",t._reactedByMyselfMap=new Map,t._reactionInfoMap=new Map,t}return i(a,[{key:\"onMessageReactionNotifyList\",value:function(e){var n=this,o=(e||{}).dataList;(void 0===o?[]:o).forEach((function(e){var o=e.C2CMessageInfo,a=void 0===o?{}:o,i=e.groupMessageInfo,s=void 0===i?{}:i,r=e.reactionList,c=void 0===r?[]:r,u=t(t({},a),s),l=u.tinyID,d=u.clientTime,p=u.random,_=\"\".concat(l,\"-\").concat(d,\"-\").concat(p),g=[];c.forEach((function(e){mt(e.userIDList)&&(e.userIDList=[],e.count=0),g.push.apply(g,m(e.userIDList))})),Je.l(\"\".concat(n._n,\".onMessageReactionNotifyList messageID:\").concat(_,\" reactionList:\").concat(c.length)),n._handleReactionSummary([{messageID:_,reactionList:c}],g).then((function(e){n.emitOuterEvent(E.MESSAGE_REACTIONS_UPDATED,t({},e[0]))}))}))}},{key:\"onMessageReactionNotify\",value:function(e){var n=e.dataList||{},o=n.C2CMessageInfo,a=void 0===o?{}:o,i=n.groupMessageInfo,s=void 0===i?{}:i,r=n.reactionID,c=n.operateType,u=t(t({},a),s),l=u.tinyID,d=u.clientTime,p=u.random,_=\"\".concat(l,\"-\").concat(d,\"-\").concat(p);Je.l(\"\".concat(this._n,\".onMessageReactionNotify messageID:\").concat(_,\" reactionID:\").concat(r,\" operateType:\").concat(c)),1===c?this._addReactedByMyselfMap(_,r):this._removeReactedByMyselfMap(_,r);var g=\"\".concat(_,\"-\").concat(r);if(this._reactionInfoMap.has(g)){var h=this._reactionInfoMap.get(g);h.reactedByMyself=1===c,this.emitOuterEvent(E.MESSAGE_REACTIONS_UPDATED,{messageID:_,reactionList:[h]})}}},{key:\"addMessageReaction\",value:function(e,t){var n=this,o=\"addMessageReaction\";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a=\"\".concat(this._n,\".\").concat(o),i=e.ID,s=e.conversationID,r=\"conversationID:\".concat(s,\" messageID:\").concat(i,\" reactionID:\").concat(t),c=new Xo(o);c.setMessage(r),Je.l(\"\".concat(a,\" \").concat(r));var u=this._createReactionOperationPack(e,t,1);return this._addReactedByMyselfMap(e.ID,t),this.request(u).then((function(){return c.end(),Je.l(\"\".concat(a,\" ok.\")),No()})).catch((function(o){return n._removeReactedByMyselfMap(e.ID,t),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],a=t[1];c.setError(o,n,a).end()})),Je.e(\"\".concat(a,\" failed. error:\"),o),Go(o)}))}},{key:\"removeMessageReaction\",value:function(e,t){var n=this,o=\"removeMessageReaction\";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a=\"\".concat(this._n,\".\").concat(o),i=e.ID,s=e.conversationID,r=\"conversationID:\".concat(s,\" messageID:\").concat(i,\" reactionID:\").concat(t),c=new Xo(o);c.setMessage(r),Je.l(\"\".concat(a,\" \").concat(r));var u=this._createReactionOperationPack(e,t,2);return this._removeReactedByMyselfMap(e.ID,t),this.request(u).then((function(){return c.end(),Je.l(\"\".concat(a,\" ok.\")),No()})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];c.setError(e,o,a).end()})),Je.e(\"\".concat(a,\" failed. error:\"),e),Go(e)}))}},{key:\"getMessageReactions\",value:function(e){var n=this,o=\"getMessageReactions\";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(o);var a=\"\".concat(this._n,\".\").concat(o),i=e.messageList,s=e.maxUserCountPerReaction,r=i[0].conversationID,c=\"conversationID:\".concat(r,\" maxUserCountPerReaction:\").concat(s,\" messageList:\").concat(i.length),u=new Xo(o);u.setMessage(c),Je.l(\"\".concat(a,\" \").concat(c));var l=new Map,d=this._createReactionSummaryPack(t(t({},e),{},{messageIDMap:l}));return this.request(d).then((function(e){var t=e.data.resultList,o=[],a=[];return(void 0===t?[]:t).forEach((function(e){var t=e.messageKey,n=void 0===t?void 0:t,i=e.messageSequence,s=void 0===i?void 0:i,r=e.reactionList,c=void 0===r?[]:r,u=mt(n)?l.get(s):l.get(n);o.push({messageID:u,reactionList:c}),c.forEach((function(e){a.push.apply(a,m(e.userIDList))}))})),n._handleReactionSummary(o,a)})).then((function(e){return u.end(),Je.l(\"\".concat(a,\" ok.\")),l.clear(),No({resultList:e})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(a,\" failed. error:\"),e),Go(e)}))}},{key:\"getAllUserListOfMessageReaction\",value:function(e){var t=this,n=\"getAllUserListOfMessageReaction\";if(!this.canIUse(K.MSG_REACTION))return this.cannotUseCommercialAbility(n);var o=\"\".concat(this._n,\".\").concat(n),a=e.message,i=e.reactionID,s=e.nextSeq,r=e.count,c=a.ID,u=a.conversationID,l=\"conversationID:\".concat(u,\" messageID:\").concat(c,\" reactionID:\").concat(i,\" nextSeq:\").concat(s,\" count:\").concat(r),d=new Xo(n);d.setMessage(l),Je.l(\"\".concat(o,\" \").concat(l));var p={userList:[],nextSeq:0,isCompleted:!1},_=this._createReactionUserListPack(e);return this.request(_).then((function(e){var n=e.data,o=n.userIDList,a=void 0===o?[]:o,i=n.nextSeq,s=void 0===i?0:i;return p.nextSeq=s,p.isCompleted=0===s,t.getModule($n).getUserNickAndAvatar(a)})).then((function(e){return p.userList=e,d.end(),Je.l(\"\".concat(o,\" ok.\")),No(p)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];d.setError(e,o,a).end()})),Je.e(\"\".concat(o,\" failed. error:\"),e),Go(e)}))}},{key:\"_createReactionOperationPack\",value:function(e,t,n){var o=void 0,a={reactionID:t,userIDList:[this.getMyUserID()]};if(e.conversationType===S.CONV_C2C){var i=this.getModule(eo);o=1===n?Uo.ADD_C2C_MSG_REACTION:Uo.REMOVE_C2C_MSG_REACTION,a.from=e.from,a.to=e.to,a.messageKey=i.getMessageKey(e)}if(e.conversationType===S.CONV_GROUP){var s=void 0,r=e.to;Ft(e.to)&&(r=$t(s=e.to)),o=1===n?Uo.ADD_GRP_MSG_REACTION:Uo.REMOVE_GRP_MSG_REACTION,a.groupID=r,a.topicID=s,a.messageSequence=e.sequence}return{protocolName:o,requestData:a}}},{key:\"_createReactionSummaryPack\",value:function(e){var t=e.messageList,n=e.maxUserCountPerReaction,o=void 0===n?10:n,a=e.messageIDMap,i=t[0],s=void 0,r=void 0;if(i.conversationType===S.CONV_C2C){var c=this.getModule(eo),u=t.map((function(e){var t=c.getMessageKey(e);return a.set(t,e.ID),t}));s=Uo.GET_C2C_MSG_REACTIONS,r={from:i.from,to:i.to,messageKeyList:u,count:o}}if(i.conversationType===S.CONV_GROUP){var l=void 0,d=i.to;Ft(i.to)&&(d=$t(l=i.to));var p=t.map((function(e){return a.set(e.sequence,e.ID),e.sequence}));s=Uo.GET_GRP_MSG_REACTIONS,r={groupID:d,topicID:l,messageSequenceList:p,count:o}}return{protocolName:s,requestData:r}}},{key:\"_createReactionUserListPack\",value:function(e){var t=e.message,n=e.reactionID,o=e.nextSeq,a=void 0===o?0:o,i=e.count,s=void 0===i?100:i,r=void 0,c={reactionID:n,nextSeq:a,count:s>100?100:s};if(t.conversationType===S.CONV_C2C){var u=this.getModule(eo);r=Uo.GET_C2C_MSG_REACTION_USER_LIST,c.from=t.from,c.to=t.to,c.messageKey=u.getMessageKey(t)}if(t.conversationType===S.CONV_GROUP){var l=void 0,d=t.to;Ft(t.to)&&(d=$t(l=t.to)),r=Uo.GET_GRP_MSG_REACTION_USER_LIST,c.groupID=d,c.topicID=l,c.messageSequence=t.sequence}return{protocolName:r,requestData:c}}},{key:\"_handleReactionSummary\",value:function(e,t){var n=this;return this.getModule($n).getUserNickAndAvatar(t).then((function(t){var o=[];return e.forEach((function(e){var a=[];e.reactionList.forEach((function(o){var i=o.reactionID,s=o.count,r=o.userIDList,c=o.reactedByMyself,u=void 0===c?void 0:c,l=[];r.forEach((function(e){t.forEach((function(t){e===t.userID&&l.push(t)}))}));var d={reactionID:i,totalUserCount:s,partialUserList:l,reactedByMyself:n._computeReactedByMyself({reactedByMyself:u,messageID:e.messageID,reactionID:i})};if(a.push(d),mt(u)&&!n._reactedByMyselfMap.has(e.messageID)){var p=\"\".concat(e.messageID,\"-\").concat(i);n._reactionInfoMap.set(p,d)}})),o.push({messageID:e.messageID,reactionList:a})})),o}))}},{key:\"_addReactedByMyselfMap\",value:function(e,t){this._reactedByMyselfMap.has(e)||this._reactedByMyselfMap.set(e,[]);var n=this._reactedByMyselfMap.get(e);-1===n.indexOf(t)&&n.push(t)}},{key:\"_removeReactedByMyselfMap\",value:function(e,t){if(this._reactedByMyselfMap.has(e)){var n=this._reactedByMyselfMap.get(e),o=n.indexOf(t);o>-1&&n.splice(o,1)}}},{key:\"_computeReactedByMyself\",value:function(e){var t=e.reactedByMyself,n=e.messageID,o=e.reactionID;return mt(t)?!!this._reactedByMyselfMap.has(n)&&this._reactedByMyselfMap.get(n).includes(o):1===t}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._reactedByMyselfMap.clear(),this._reactionInfoMap.clear()}}]),a}(Po),wi=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"ComboMessageModule\",a}return i(n,[{key:\"sendMessage\",value:function(e){var t=this,n=this._constructMessageInstance(e);if(null===n)return Go({code:Ao.MSG_SEND_FAIL});this._addSendMessageTotalCount(n);var o=Date.now();return this.getModule(ao).setMessageRandom(n),this._sendComboMessage(n,e).then((function(e){var a=e.data,i=a.time,s=a.sequence,r=a.readReceiptCode;_t(r)&&0!==r&&(new Xo(\"sendMessageWithReceipt\").setMessage(\"from:\".concat(n.from,\" to:\").concat(n.to,\" sequence:\").concat(s,\" readReceiptCode:\").concat(r)).end(),Je.w(\"\".concat(t._n,\".sendMessage readReceiptCode:\").concat(r,\" message:\").concat(t.getErrorMessage(r))));t._addSendMessageSuccessCount(n,o);var c=t.getModule(ao);n.status=fn.SUCCESS,n.time=i,n.conversationType===S.CONV_GROUP&&(n.sequence=s),c.appendToMessageList(n);var u=n;return!0===n._isExcludedFromLastMessage&&(u=\"\"),c.onMessageSent({conversationOptionsList:[{conversationID:n.conversationID,unreadCount:0,type:n.conversationType,subType:n.conversationSubType,lastMessage:u}]}),No({message:n})})).catch((function(e){return t._onSendMessageFailed(n,e)}))}},{key:\"_sendComboMessage\",value:function(e,t){var n=this._m.getModule(_o),o=\"\";return e.conversationType===S.CONV_C2C&&(o=\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SEND_C2C_MESSAGE)),e.conversationType===S.CONV_GROUP&&(o=\"\".concat(B.NAME.GROUP,\".\").concat(Uo.SEND_GROUP_MESSAGE)),n.sendComboMessage({servcmd:o,data:t})}},{key:\"_constructMessageInstance\",value:function(e){var t=\"\".concat(this._n,\"._constructMessageInstance\"),n=null;try{var o=this.getMyUserID(),a={};if(a.senderTinyID=this.getMyTinyID(),a.currentUser=o,a.from=e.From_Account||o,e.GroupId?(a.conversationID=\"\".concat(S.CONV_GROUP).concat(e.GroupId),a.conversationType=S.CONV_GROUP,a.to=e.GroupId):e.To_Account&&(a.conversationID=\"\".concat(S.CONV_C2C).concat(e.To_Account),a.conversationType=S.CONV_C2C,a.to=e.To_Account),a.time=e.MsgTimeStamp||0,a.random=e.Random||e.MsgRandom||0,a.priority=e.MsgPriority,gt(e.CloudCustomData)&&e.CloudCustomData.length>0&&(a.cloudCustomData=e.CloudCustomData),vt(e.SendMsgControl)&&(a.messageControlInfo={},e.SendMsgControl.includes(\"NoUnread\")&&(a.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes(\"NoLastMsg\")&&(a.messageControlInfo.excludedFromLastMessage=1)),a.conversationType===S.CONV_GROUP&&vt(e.To_Account)&&e.To_Account.length>0){var i=e.To_Account;e.To_Account.length>50&&(i=e.To_Account.slice(0,50),Je.w(\"\".concat(t,\" To_Account must be less than or equal to 50.\"))),a.receiverList=m(i),e.To_Account=m(i)}1!==e.IsNeedReadReceipt&&1!==e.NeedReadReceipt||(a.needReadReceipt=!0),1===e.SupportMessageExtension&&(a.isSupportExtension=!0),(n=new pa(a)).status=fn.UNSEND,e.MsgClientTime=n.clientTime,n.conversationType===S.CONV_C2C&&(e.MsgSeq=n.sequence);for(var s,r=e.MsgBody.length,c=0;c100)return n--,t;if(vt(t)){var a=t.map((function(t){return ht(t)?e(t,o):t}));return n--,a}if(ht(t)){var i=(s=t,r=function(e,t){if(!Dt(t))return!1;if((a=t)!==Vi(a))for(var n=0;n65535)return Yi(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?Yi(192|t>>>6,128|63&t):Yi(224|t>>>12,128|t>>>6&63,128|63&t)},ji=function(e){for(var t=void 0===e?\"\":(\"\"+e).replace(/[\\x80-\\uD7ff\\uDC00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,Wi),n=0|t.length,o=new Uint8Array(n),a=0;a0)for(var c=0;c=i&&(Je.l(\"\".concat(e._n,\"._checkPromiseMap request timeout, delete requestID:\").concat(n)),e._promiseMap.delete(n),o(new ko({code:Ao.NETWORK_TIMEOUT})),e._channelModule.onRequestTimeout(n))}))}},{key:\"onOpen\",value:function(e){if(\"\"!==this._readyState){this._onOpenTs=Date.now();var t=e.id;this._socketID=t;var n=un(this._startTs,!1);Je.l(\"\".concat(this._n,\"._onOpen cost:\").concat(n,\" ms. socketID:\").concat(t)),new Xo(\"wsOnOpen\").setMessage(n).setCostTime(n).setMoreMessage(\"socketID:\".concat(t)).end(),e.id===this._socketID&&(this._readyState=es,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:\"onClose\",value:function(e){var t=new Xo(\"wsOnClose\"),n=e.id,o=e.e,a=\"sourceSocketID:\".concat(n,\" currentSocketID:\").concat(this._socketID,\" code:\").concat(o.code,\" reason:\").concat(o.reason),i=0;0!==this._onOpenTs&&(i=Date.now()-this._onOpenTs),t.setMessage(i).setCostTime(i).setMoreMessage(a).setCode(o.code).end(),Je.l(\"\".concat(this._n,\"._onClose \").concat(a,\" onlineTime:\").concat(i)),n===this._socketID&&(this._readyState=ns,i<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:\"onError\",value:function(e){var t=e.id,n=e.e,o=\"sourceSocketID:\".concat(t,\" currentSocketID:\").concat(this._socketID);new Xo(\"wsOnError\").setMessage(n.errMsg||St(n)).setMoreMessage(o).setLevel(\"error\").end(),Je.w(\"\".concat(this._n,\"._onError\"),n,o),t===this._socketID&&(this._readyState=\"\",this._channelModule.onError())}},{key:\"onMessage\",value:function(e){var t;try{t=JSON.parse(e.data)}catch(u){new Xo(\"jsonParseError\").setMessage(e.data).end()}if(t&&t.head){var n=this._getRequestIDFromHead(t.head),o=t.body;if(!this._channelModule.getModule(To).isTRTCCommand(n)){var a=zt(t.head);o=Ki(t.body,this._getResponseKeyMap(a))}if(Je.d(\"\".concat(this._n,\".onMessage ret:\").concat(JSON.stringify(o),\" requestID:\").concat(n,\" has:\").concat(this._promiseMap.has(n))),this._setNextPingTs(),this._promiseMap.has(n)){var i=this._promiseMap.get(n),s=i.resolve,r=i.reject,c=i.timestamp;return this._promiseMap.delete(n),this._calcRTT(c),void(o.errorCode&&0!==o.errorCode?(this._channelModule.onErrorCodeNotZero(o),r(new ko({code:o.errorCode,message:o.errorInfo||\"\",data:n.includes(Uo.MODIFY_C2C_MESSAGE)||n.includes(Uo.MODIFY_GROUP_MESSAGE)?{elements:o.elements,messageVersion:o.messageVersion,cloudCustomData:o.cloudCustomData}:void 0}))):s(No(o)))}this._channelModule.onMessage({head:t.head,body:o})}}},{key:\"_calcRTT\",value:function(e){var t=Date.now()-e;this._channelModule.getModule(mo).addRTT(t)}},{key:\"_connect\",value:function(){this._startTs=Date.now(),this._onOpenTs=0,this._socket=new zi(this),this._socketID=this._socket.getID(),this._readyState=ts,Je.l(\"\".concat(this._n,\"._connect isWorkerEnabled:\").concat(this.getIsWorkerEnabled(),\" socketID:\").concat(this._socketID,\" url:\").concat(this.getURL())),new Xo(\"wsConnect\").setMessage(\"socketID:\".concat(this._socketID,\" url:\").concat(this.getURL())).end()}},{key:\"getURL\",value:function(){this._channelModule.isDevMode()&&(this._canIUseBinaryFrame=!1);var e=Yt();(ae||$&&\"windows\"===e||se)&&(this._canIUseBinaryFrame=!1);var t=-1;\"ios\"===e?t=ye||-1:\"android\"===e&&(t=Ce||-1);var n=this._channelModule.getModule(io),o=this._channelModule.getPlatform(),a=n.getSDKAppID(),i=n.getInstanceID(),s=\"sdkappid=\".concat(a,\"&instanceid=\").concat(i,\"&random=\").concat(this._getRandom(),\"&platform=\").concat(o,\"&host=\").concat(e,\"&version=\").concat(t,\"&sdkversion=\").concat(\"3.2.3\");return ee&&(s+=\"&isminigame=1\"),this._canIUseBinaryFrame?\"\".concat(this._url,\"/binfo?\").concat(s):\"\".concat(this._url,\"/info?\").concat(s)}},{key:\"_closeConnection\",value:function(e){Je.l(\"\".concat(this._n,\"._closeConnection socketID:\").concat(this._socketID)),this._socket&&(this._socket.close(e),this._socketID=-1,this._socket=null,this._readyState=ns)}},{key:\"_resend\",value:function(){var e=this;if(Je.l(\"\".concat(this._n,\"._resend reConnectFlag:\").concat(this._reConnectFlag),\"promiseMap.size:\".concat(this._promiseMap.size,\" simpleRequestMap.size:\").concat(this._simpleRequestMap.size)),this._promiseMap.size>0&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,a=t.resolve,i=t.reject;e._promiseMap.set(n,{resolve:a,reject:i,timestamp:Date.now(),uplinkData:o}),e._execute(n,o)})),this._simpleRequestMap.size>0){var t,n=D(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=v(t.value,2),a=o[0],i=o[1];this._execute(a,i)}}catch(s){n.e(s)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:\"send\",value:function(e){var t=this;e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var n=_(e,Zi),o=this._getRequestIDFromHead(e.head),a=JSON.stringify(n);return new Promise((function(e,i){(t._promiseMap.set(o,{resolve:e,reject:i,timestamp:Date.now(),uplinkData:a}),Je.d(\"\".concat(t._n,\".send uplinkData:\").concat(JSON.stringify(n),\" requestID:\").concat(o,\" readyState:\").concat(t._readyState)),t._readyState!==es)?t._reConnect():(t._execute(o,a),t._channelModule.getModule(mo).addRequestCount())}))}},{key:\"simplySend\",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var t=_(e,$i),n=this._getRequestIDFromHead(e.head),o=JSON.stringify(t);this._readyState!==es?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:\"onErrorCodeNotZero\",value:function(e){this.getModule(_o).onErrorCodeNotZero(e)}},{key:\"onMessage\",value:function(e){this.getModule(_o).onMessage(e)}},{key:\"send\",value:function(e){if(!this._socketHandler)return Promise.reject();if(this._previousState!==S.NET_STATE_CONNECTED&&e.head.servcmd.includes(Uo.SSO_STAT))return this.reConnect(),this.getModule(io).getProxyServer()?Promise.resolve():this._sendLogViaHTTP(e);return this._socketHandler.send(e)}},{key:\"_sendLogViaHTTP\",value:function(e){var t=B.HOST.CURRENT.STAT;return new Promise((function(n,o){var a=\"\".concat(t,\"/v4/imopenstat/tim_web_report_v2?sdkappid=\").concat(e.head.sdkappid,\"&reqtime=\").concat(Date.now()),i=JSON.stringify(e.body),s=\"application/x-www-form-urlencoded;charset=UTF-8\";if(ce)le.request({url:a,data:i,method:\"POST\",timeout:3e3,header:{\"content-type\":s},success:function(){n()},fail:function(){o(new ko({code:Ao.NETWORK_ERROR}))}});else{var r=new XMLHttpRequest,c=setTimeout((function(){r.abort(),o(new ko({code:Ao.NETWORK_TIMEOUT}))}),3e3);r.onreadystatechange=function(){4===r.readyState&&(clearTimeout(c),200===r.status||304===r.status?n():o(new ko({code:Ao.NETWORK_ERROR})))},r.open(\"POST\",a,!0),r.setRequestHeader(\"Content-type\",s),r.send(i)}}))}},{key:\"simplySend\",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:\"onOpen\",value:function(){this._ping()}},{key:\"onClose\",value:function(){this._socketHandler&&(this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED));this.reConnect()}},{key:\"onError\",value:function(){ce&&!se&&this.outputWarning(\"DomainNameInMP\"),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:\"getKeyMap\",value:function(e){return this.getModule(_o).getKeyMap(e)}},{key:\"_onAppHide\",value:function(){this._isAppShowing=!1}},{key:\"_onAppShow\",value:function(){this._isAppShowing=!0}},{key:\"onRequestTimeout\",value:function(e){}},{key:\"onReconnected\",value:function(){Je.l(\"\".concat(this._n,\".onReconnected cost:\").concat(un(this._disconnectedTS,!0,!1))),this._m.restartTimer(),this.getModule(_o).onReconnected(un(this._disconnectedTS,!1,!1)),this._disconnectedTS=0,this._emitNetStateChangeEvent(S.NET_STATE_CONNECTED)}},{key:\"onReconnectFailed\",value:function(){Je.l(\"\".concat(this._n,\".onReconnectFailed\")),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:\"setIsWorkerEnabled\",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:\"offline\",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:\"reConnect\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1;this._socketHandler&&(t=this._socketHandler.getReconnectFlag());var n=\"forcedFlag:\".concat(e,\" fatalErrorFlag:\").concat(this._fatalErrorFlag,\" previousState:\").concat(this._previousState,\" reconnectFlag:\").concat(t);if(Je.l(\"\".concat(this._n,\".reConnect \").concat(n)),!this._fatalErrorFlag&&this._socketHandler){if(!0===e)this._socketHandler.forcedReconnect();else{if(this._previousState===S.NET_STATE_CONNECTING&&t)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(S.NET_STATE_CONNECTING)}}},{key:\"_emitNetStateChangeEvent\",value:function(e){this._previousState!==e&&(Je.l(\"\".concat(this._n,\"._emitNetStateChangeEvent from \").concat(this._previousState,\" to \").concat(e)),e===S.NET_STATE_DISCONNECTED&&0===this._disconnectedTS&&(this._disconnectedTS=Date.now()),this._previousState=e,this.emitOuterEvent(E.NET_STATE_CHANGE,{state:e}))}},{key:\"_ping\",value:function(){var e=this;if(!0!==this._probing){this._probing=!0;var t=this.getModule(_o).getProtocolData({protocolName:Uo.PING});this.send(t).then((function(){e._probing=!1})).catch((function(t){if(Je.w(\"\".concat(e._n,\"._ping failed. error:\"),t),e._probing=!1,t&&60002===t.code)return new Xo(\"error\").setMessage(\"code:\".concat(t.code,\" message:\").concat(t.message)).setNetworkType(e.getModule(co).getNetworkType()).end(),e._fatalErrorFlag=!0,void e._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED);e.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];Je.l(\"\".concat(e._n,\"._ping failed. probe network, isAppShowing:\").concat(e._isAppShowing,\" online:\").concat(o,\" networkType:\").concat(a)),o?e.reConnect():e._emitNetStateChangeEvent(S.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),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:\"onRestApiKickedOut\",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._previousState=S.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3),this._disconnectedTS=0}}]),n}(Po),is=[\"a2\",\"tinyid\"],ss=[\"a2\",\"tinyid\"],rs=function(){function e(t){o(this,e),this._n=\"ProtocolHandler\",this._sessionModule=t,this._configMap=new Map,this._fillConfigMap()}return i(e,[{key:\"_fillConfigMap\",value:function(){this._configMap.clear();var e=this._sessionModule.genCommonHead(),n=this._sessionModule.genCosSpecifiedHead(),o=this._sessionModule.genSSOReportHead();this._configMap.set(Uo.LOGIN,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.LOGIN)}),body:{state:\"Online\",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:\"InstType\"},response:{InstId:\"instanceID\",HelloInterval:\"helloInterval\"}}}}(e)),this._configMap.set(Uo.LOGOUT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.LOGOUT)}),body:{type:0},keyMap:{request:{type:\"wslogout_type\"}}}}(e)),this._configMap.set(Uo.HELLO,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:\"newInstanceInfo\"}}}}(e)),this._configMap.set(Uo.KICK_OTHER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.STAT_SERVICE,\".\").concat(Uo.KICK_OTHER)}),body:{}}}(e)),this._configMap.set(Uo.COS_SIGN,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_COS_SIGN,\".\").concat(Uo.COS_SIGN)}),body:{cmd:\"open_im_cos_svc\",subCmd:\"get_cos_token\",duration:300,version:2},keyMap:{request:{userSig:\"usersig\",subCmd:\"sub_cmd\",cmd:\"cmd\",duration:\"duration\",version:\"version\"},response:{expired_time:\"expiredTime\",bucket_name:\"bucketName\",session_token:\"sessionToken\",tmp_secret_id:\"secretId\",tmp_secret_key:\"secretKey\"}}}}(n)),this._configMap.set(Uo.COS_PRE_SIG,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.CUSTOM_UPLOAD,\".\").concat(Uo.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:\"usersig\",fileType:\"file_type\",fileName:\"file_name\",uploadMethod:\"upload_method\"},response:{expired_time:\"expiredTime\",request_id:\"requestId\",head_url:\"headUrl\",upload_url:\"uploadUrl\",download_url:\"downloadUrl\",ci_url:\"ciUrl\",snapshot_url:\"requestSnapshotUrl\"}}}}(n)),this._configMap.set(Uo.SIMPLE_COS_PRE_SIG,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.CUSTOM_UPLOAD,\".\").concat(Uo.SIMPLE_COS_PRE_SIG)}),body:{uploadMethod:0,platform:2,SDKAppID:0,userID:\"\",conversationType:1,uploadConfig:[{fileID:1,fileType:1,fileName:\"\"}]},keyMap:{request:{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\"},response:{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\"}}}}(n)),this._configMap.set(Uo.GET_IMAGE_INFO,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.CUSTOM_UPLOAD,\".\").concat(Uo.GET_IMAGE_INFO)}),body:{imageUrl:\"\"},keyMap:{request:{imageUrl:\"str_image_url\"},response:{rpt_msg_image_info:\"imageInfoArray\",uint32_image_type:\"type\",str_url:\"url\",uint32_width:\"width\",uint32_height:\"height\",str_image_format:\"imageFormat\"}}}}(n)),this._configMap.set(Uo.GET_IP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.CUSTOM_UPLOAD,\".\").concat(Uo.GET_IP)}),body:{domainName:\"\"},keyMap:{request:{domainName:\"str_domain\"},response:{str_final_ip:\"ip\"}}}}(n)),this._configMap.set(Uo.VIDEO_COVER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.CUSTOM_UPLOAD,\".\").concat(Uo.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:\"version\",platform:\"platform\",coverName:\"cover_name\",requestSnapshotUrl:\"snapshot_url\"},response:{error_code:\"errorCode\",error_msg:\"errorInfo\",download_url:\"snapshotUrl\"}}}}(n)),this._configMap.set(Uo.FETCH_COMMERCIAL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_CONFIG_MANAGER,\".\").concat(Uo.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:\"uint32_sdkappid\"},response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_purchase_bits:\"purchaseBits\",uint32_expired_time:\"expiredTime\"}}}}(e)),this._configMap.set(Uo.PUSHED_COMMERCIAL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_CONFIG_MANAGER,\".\").concat(Uo.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_purchase_bits:\"purchaseBits\",uint32_expired_time:\"expiredTime\"}}}}(e)),this._configMap.set(Uo.FETCH_CLOUD_CONTROL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_CONFIG_MANAGER,\".\").concat(Uo.FETCH_CLOUD_CONTROL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:\"uint32_sdkappid\",version:\"uint64_version\"},response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_json_config:\"cloudControlConfig\",uint32_expired_time:\"expiredTime\",uint32_sdkappid:\"SDKAppID\",uint64_version:\"version\"}}}}(e)),this._configMap.set(Uo.PUSHED_CLOUD_CONTROL_CONFIG,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_CONFIG_MANAGER,\".\").concat(Uo.PUSHED_CLOUD_CONTROL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_json_config:\"cloudControlConfig\",uint32_expired_time:\"expiredTime\",uint32_sdkappid:\"SDKAppID\",uint64_version:\"version\"}}}}(e)),this._configMap.set(Uo.OVERLOAD_NOTIFY,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OVERLOAD_PUSH,\".\").concat(Uo.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:\"overloadCommand\",DelaySecs:\"waitingTime\"}}}}(e)),this._configMap.set(Uo.SYNC_UNREAD_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SYNC_UNREAD_MESSAGE)}),body:{cookie:\"\",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:\"From_Account\",toAccount:\"To_Account\",from:\"From_Account\",to:\"To_Account\",time:\"MsgTimeStamp\",sequence:\"MsgSeq\",random:\"MsgRandom\",elements:\"MsgBody\"},response:{MsgList:\"messageList\",SyncFlag:\"syncFlag\",To_Account:\"to\",From_Account:\"from\",ClientSeq:\"clientSequence\",MsgSeq:\"sequence\",NoticeSeq:\"noticeSequence\",NotifySeq:\"notifySequence\",MsgRandom:\"random\",MsgTimeStamp:\"time\",MsgContent:\"content\",ToGroupId:\"to\",MsgKey:\"messageKey\",GroupTips:\"groupTips\",MsgBody:\"elements\",MsgType:\"type\",C2CRemainingUnreadCount:\"C2CRemainingUnreadList\",C2CPairUnreadCount:\"C2CPairUnreadList\"}}}}(e)),this._configMap.set(Uo.GET_PROFANITY_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_MSG_AUDIT_MGR,\".\").concat(Uo.GET_PROFANITY_LIST)}),body:{version:0,deviceID:\"\",startIndex:void 0},keyMap:{request:{version:\"uint64_version\",deviceID:\"str_device_id\",startIndex:\"uint64_start_index\"},response:{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\"}}}}(e)),this._configMap.set(Uo.SEND_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SEND_C2C_MESSAGE)}),body:{fromAccount:\"\",toAccount:\"\",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:\"\",avatar:\"\",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:\"\",desc:\"\",ext:\"\",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:\"\"}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0,isRelayMessage:0},keyMap:{request:{fromAccount:\"From_Account\",toAccount:\"To_Account\",msgTimeStamp:\"MsgTimeStamp\",msgSeq:\"MsgSeq\",msgRandom:\"MsgRandom\",msgBody:\"MsgBody\",count:\"MaxCnt\",lastMessageTime:\"LastMsgTime\",messageKey:\"MsgKey\",peerAccount:\"Peer_Account\",data:\"Data\",description:\"Desc\",extension:\"Ext\",type:\"MsgType\",content:\"MsgContent\",sizeType:\"Type\",uuid:\"UUID\",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\"}}}}(e)),this._configMap.set(Uo.SEND_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.SEND_GROUP_MESSAGE)}),body:{fromAccount:\"\",groupID:\"\",random:0,clientSequence:0,priority:\"\",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:\"\",desc:\"\",ext:\"\",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:\"\"}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0,isRelayMessage:0},keyMap:{request:{to:\"GroupId\",extension:\"Ext\",data:\"Data\",description:\"Desc\",random:\"Random\",sequence:\"ReqMsgSeq\",count:\"ReqMsgNumber\",type:\"MsgType\",priority:\"MsgPriority\",content:\"MsgContent\",elements:\"MsgBody\",sizeType:\"Type\",uuid:\"UUID\",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\"},response:{MsgTime:\"time\",MsgSeq:\"sequence\"}}}}(e)),this._configMap.set(Uo.REVOKE_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.REVOKE_C2C_MESSAGE)}),body:{msgInfo:{fromAccount:\"\",toAccount:\"\",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:\"MsgInfo\",msgTimeStamp:\"MsgTimeStamp\",msgSeq:\"MsgSeq\",msgRandom:\"MsgRandom\"}}}}(e)),this._configMap.set(Uo.REVOKE_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.REVOKE_GROUP_MESSAGE)}),body:{groupID:\"\",msgSeqList:void 0,topicID:\"\"},keyMap:{request:{msgSeqList:\"MsgSeqList\",msgSeq:\"MsgSeq\"}}}}(e)),this._configMap.set(Uo.GET_C2C_ROAMING_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.GET_C2C_ROAMING_MESSAGE)}),body:{peerAccount:\"\",count:15,lastMessageTime:0,messageKey:\"\",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:\"MsgKey\",peerAccount:\"Peer_Account\",count:\"MaxCnt\",lastMessageTime:\"LastMsgTime\",withRecalledMessage:\"WithRecalledMsg\",direction:\"GetDirection\"},response:{LastMsgTime:\"lastMessageTime\",IsNeedReadReceipt:\"needReadReceipt\",IsPeerRead:\"readReceiptSentByPeer\"}}}}(e)),this._configMap.set(Uo.MODIFY_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.MODIFY_C2C_MESSAGE)}),body:{from:\"\",to:\"\",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:\"MsgSeq\",random:\"MsgRandom\",time:\"MsgTime\",version:\"MsgVersion\",type:\"MsgType\",content:\"MsgContent\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_ROAMING_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_ROAMING_MESSAGE)}),body:{withRecalledMsg:1,groupID:\"\",count:15,sequence:\"\",topicID:void 0},keyMap:{request:{sequence:\"ReqMsgSeq\",count:\"ReqMsgNumber\",withRecalledMessage:\"WithRecalledMsg\"},response:{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\"}}}}(e)),this._configMap.set(Uo.SET_C2C_MESSAGE_READ,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SET_C2C_MESSAGE_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:\"LastedMsgTime\"}}}}(e)),this._configMap.set(Uo.SET_C2C_PEER_MUTE_NOTIFICATIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:\"Peer_Account\",muteFlag:\"Mute_Notifications\"}}}}(e)),this._configMap.set(Uo.GET_C2C_PEER_MUTE_NOTIFICATIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{toAccount:void 0,userIDList:void 0},keyMap:{request:{userIDList:\"Peer_Account\"},response:{MuteNotificationsList:\"muteFlagList\"}}}}(e)),this._configMap.set(Uo.SET_GROUP_MESSAGE_READ,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.SET_GROUP_MESSAGE_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:\"MsgReadedSeq\"}}}}(e)),this._configMap.set(Uo.SET_ALL_MESSAGE_READ,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SET_ALL_MESSAGE_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:\"C2CReadAllMsg\",groupMessageReadInfoList:\"GroupReadInfo\",messageSequence:\"MsgSeq\"},response:{C2CReadAllMsg:\"readAllC2CMessage\",GroupReadInfoArray:\"groupMessageReadInfoList\"}}}}(e)),this._configMap.set(Uo.DELETE_C2C_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.DELETE_C2C_MESSAGE)}),body:{fromAccount:\"\",to:\"\",keyList:void 0},keyMap:{request:{keyList:\"MsgKeyList\"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.DELETE_GROUP_MESSAGE)}),body:{groupID:\"\",deleter:\"\",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:\"Deleter_Account\",keyList:\"Seqs\"}}}}(e)),this._configMap.set(Uo.TRANSLATE_TEXT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_TRANSLATE,\".\").concat(Uo.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:\"\",target:\"\"},keyMap:{request:{sourceTextList:\"SourceText\",SDKAppID:\"SdkAppId\",from:\"FromAccount\"},response:{TargetText:\"translatedTextList\",RequestId:\"requestID\",CmdErrorCode:\"error\",ErrorCode:\"code\",ErrorInfo:\"message\"}}}}(e)),this._configMap.set(Uo.VOICE_TO_TEXT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_SPEECH,\".\").concat(Uo.VOICE_TO_TEXT)}),body:{url:\"\",SDKAppID:0,format:\"\",sourceType:0,language:\"\"},keyMap:{request:{url:\"BytesUrl\",SDKAppID:\"Uint32Sdkappid\",format:\"BytesVoiceFormat\",sourceType:\"Uint64SourceType\",language:\"BytesEngServiceType\"},response:{BytesRequestid:\"requestID\",BytesResult:\"result\",CmdErrorCode:\"error\",ErrorCode:\"code\",ErrorInfo:\"message\"}}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.MODIFY_GROUP_MESSAGE)}),body:{groupID:\"\",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:\"MsgSeq\",version:\"MsgVersion\",type:\"MsgType\",content:\"MsgContent\"}}}}(e)),this._configMap.set(Uo.GET_READ_RECEIPT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_READ_RECEIPT)}),body:{groupID:\"\",sequenceList:void 0},keyMap:{request:{sequence:\"MsgSeq\"}}}}(e)),this._configMap.set(Uo.SEND_C2C_READ_RECEIPT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:\"\",messageInfoList:void 0},keyMap:{request:{peerAccount:\"Peer_Account\",messageInfoList:\"C2CMsgInfo\",fromAccount:\"From_Account\",toAccount:\"To_Account\",sequence:\"MsgSeq\",random:\"MsgRandom\",time:\"MsgTime\",clientTime:\"MsgClientTime\"}}}}(e)),this._configMap.set(Uo.SEND_READ_RECEIPT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.SEND_READ_RECEIPT)}),body:{groupID:\"\",sequenceList:void 0},keyMap:{request:{sequenceList:\"MsgSeqList\",sequence:\"MsgSeq\"}}}}(e)),this._configMap.set(Uo.GET_READ_RECEIPT_DETAIL,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_READ_RECEIPT_DETAIL)}),body:{groupID:\"\",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:\"MsgSeq\",count:\"Num\"},response:{ReadList:\"readUserIDList\",Read_Account:\"userID\",UnreadList:\"unreadUserIDList\",Unread_Account:\"userID\",IsFinish:\"isCompleted\"}}}}(e)),this._configMap.set(Uo.MODIFY_C2C_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.MODIFY_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Uo.GET_C2C_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.GET_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.MODIFY_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Uo.GET_GROUP_MESSAGE_EXTENSIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.GET_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}}(e)),this._configMap.set(Uo.MESSAGE_CLOUD_SEARCH,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.MESSAGE_SEARCH,\".\").concat(Uo.MESSAGE_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:{request:{keywordListMatchType:\"MatchType\",account:\"PeerAccount\",groupID:\"GroupID\",messageTypeList:\"MsgTypeList\",senderUserIDList:\"SendUserIDList\"},response:{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\"}}}}(e)),this._configMap.set(Uo.ADD_C2C_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.ADD_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{request:{userIDList:\"Add_Account\"}}}}(e)),this._configMap.set(Uo.REMOVE_C2C_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.REMOVE_C2C_MSG_REACTION)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,userIDList:void 0},keyMap:{request:{userIDList:\"Del_Account\"}}}}(e)),this._configMap.set(Uo.GET_C2C_MSG_REACTIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.GET_C2C_MSG_REACTIONS)}),body:{from:void 0,to:void 0,messageKeyList:void 0,count:void 0}}}(e)),this._configMap.set(Uo.GET_C2C_MSG_REACTION_USER_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.GET_C2C_MSG_REACTION_USER_LIST)}),body:{from:void 0,to:void 0,reactionID:void 0,messageKey:void 0,count:void 0}}}(e)),this._configMap.set(Uo.ADD_GRP_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.ADD_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{request:{userIDList:\"Add_Account\"}}}}(e)),this._configMap.set(Uo.REMOVE_GRP_MSG_REACTION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.REMOVE_GRP_MSG_REACTION)}),body:{groupID:void 0,topicID:void 0,reactionID:void 0,messageSequence:void 0,userIDList:void 0},keyMap:{request:{userIDList:\"Del_Account\"}}}}(e)),this._configMap.set(Uo.GET_GRP_MSG_REACTIONS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.GET_GRP_MSG_REACTIONS)}),body:{groupID:void 0,topicID:void 0,messageSequenceList:void 0,count:void 0},keyMap:{response:{MsgSeq:\"messageSequence\"}}}}(e)),this._configMap.set(Uo.GET_GRP_MSG_REACTION_USER_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM_MSG_EXT,\".\").concat(Uo.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}}}(e)),this._configMap.set(Uo.GET_C2C_PEER_READ_TIME,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.GET_C2C_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:\"To_Account\"},response:{ReadTime:\"peerReadTimeList\"}}}}(e)),this._configMap.set(Uo.PAGING_GET_CONVERSATION_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.PAGING_GET_CONVERSATION_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:{request:{messageAssistFlag:\"MsgAssistFlags\",assistFlag:\"AssistFlags\",pinnedTimeStamp:\"TopTimeStamp\",pinnedStartIndex:\"TopStartIndex\"},response:{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\"}}}}(e)),this._configMap.set(Uo.DELETE_CONVERSATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.DELETE_CONVERSATION)}),body:{fromAccount:\"\",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:\"ToGroupid\",clearHistoryMessage:\"ClearRamble\",conversationList:\"ContactItem\"},response:{ResultItem:\"resultList\",ToGroupid:\"groupID\",ResultCode:\"code\",ResultInfo:\"info\"}}}}(e)),this._configMap.set(Uo.CLEAR_HISTORY_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.CLEAR_HISTORY_MESSAGE)}),body:{fromAccount:\"\",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:\"ToGroupid\"}}}}(e)),this._configMap.set(Uo.PIN_CONVERSATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.PIN_CONVERSATION)}),body:{fromAccount:\"\",operationType:1,itemList:void 0},keyMap:{request:{itemList:\"RecentContactItem\"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_AT_TIPS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.DELETE_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:\"DelMsgList\",messageSeq:\"MsgSeq\",messageRandom:\"MsgRandom\"}}}}(e)),this._configMap.set(Uo.SET_CONVERSATION_CUSTOM_DATA,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.MARK_CONVERSATION)}),body:{fromAccount:\"\",itemList:void 0},keyMap:{request:{itemList:\"MarkItem\",operationType:\"OptType\",groupID:\"ToGroupId\"},response:{ToGroupId:\"groupID\",OptType:\"operationType\"}}}}(e)),this._configMap.set(Uo.MARK_CONVERSATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.MARK_CONVERSATION)}),body:{fromAccount:\"\",itemList:void 0},keyMap:{request:{itemList:\"MarkItem\",operationType:\"OptType\",groupID:\"ToGroupId\"},response:{ToGroupId:\"groupID\",OptType:\"operationType\"}}}}(e)),this._configMap.set(Uo.CREATE_CONVERSATION_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:\"\",itemList:void 0},keyMap:{request:{itemList:\"GroupContactItem\",groupID:\"ToGroupId\"},response:{GroupId:\"convGroupID\",ToGroupId:\"groupID\",OptType:\"operationType\"}}}}(e)),this._configMap.set(Uo.DELETE_CONVERSATION_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.DELETE_CONVERSATION_GROUP)}),body:{fromAccount:\"\",groupName:void 0},keyMap:{request:{},response:{GroupId:\"convGroupID\"}}}}(e)),this._configMap.set(Uo.RENAME_CONVERSATION_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:\"\",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:\"OldGroupName\",newName:\"NewGroupName\",groupID:\"ToGroupId\",operationType:\"ContactOptType\",groupName:\"OldGroupName\",updateItem:\"ContactUpdateItem\"},response:{ContactOptType:\"operationType\",ToGroupId:\"groupID\",GroupId:\"convGroupID\"}}}}(e)),this._configMap.set(Uo.ADD_CONVERSATIONS_TO_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:\"\",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Uo.DELETE_CONVERSATIONS_FROM_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.RENAME_CONVERSATION_GROUP)}),body:{fromAccount:\"\",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Uo.GET_CONVERSATION_GROUP_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.RECENT_CONTACT,\".\").concat(Uo.GET_CONVERSATION_GROUP_LIST)}),body:{fromAccount:\"\",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:\"convGroupID\",ToGroupId:\"groupID\",OptType:\"operationType\",CustomMark:\"customData\",ContactGroupId:\"convGroupIDList\"}}}}(e)),this._configMap.set(Uo.GET_USER_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.PROFILE,\".\").concat(Uo.GET_USER_PROFILE)}),body:{fromAccount:\"\",userItem:[]},keyMap:{request:{toAccount:\"To_Account\",standardSequence:\"StandardSequence\",customSequence:\"CustomSequence\"}}}}(e)),this._configMap.set(Uo.UPDATE_MY_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.PROFILE,\".\").concat(Uo.UPDATE_MY_PROFILE)}),body:{fromAccount:\"\",profileItem:[{tag:Xe.NICK,value:\"\"},{tag:Xe.GENDER,value:\"\"},{tag:Xe.ALLOWTYPE,value:\"\"},{tag:Xe.AVATAR,value:\"\"}]},keyMap:{request:{toAccount:\"To_Account\",standardSequence:\"StandardSequence\",customSequence:\"CustomSequence\"}}}}(e)),this._configMap.set(Uo.GET_BLACKLIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.GET_BLACKLIST)}),body:{fromAccount:\"\",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:\"currentSequence\"}}}}(e)),this._configMap.set(Uo.ADD_TO_BLACKLIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.ADD_TO_BLACKLIST)}),body:{fromAccount:\"\",toAccount:[]}}}(e)),this._configMap.set(Uo.REMOVE_FROM_BLACKLIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.REMOVE_FROM_BLACKLIST)}),body:{fromAccount:\"\",toAccount:[]}}}(e)),this._configMap.set(Uo.SET_SELF_STATUS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.SET_SELF_STATUS)}),body:{customStatus:\"\"},keyMap:{}}}(e)),this._configMap.set(Uo.GET_USER_STATUS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:\"successUserList\",ErrorList:\"failureUserList\",To_Account:\"userID\",Invalid_Account:\"invalidUserID\",Status:\"statusType\"}}}}(e)),this._configMap.set(Uo.SUBSCRIBE_USER_STATUS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.SUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:\"failureUserList\",To_Account:\"userID\",Invalid_Account:\"invalidUserID\"}}}}(e)),this._configMap.set(Uo.UNSUBSCRIBE_USER_STATUS,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.UNSUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:\"failureUserList\",To_Account:\"userID\",Invalid_Account:\"invalidUserID\"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.GET_FRIEND_LIST)}),body:{fromAccount:\"\",startIndex:0,standardSequence:0,customSequence:0},keyMap:{response:{FriendNum:\"friendCount\",UserDataItem:\"resultList\",ValueItem:\"tagValueList\"}}}}(e)),this._configMap.set(Uo.ADD_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.ADD_FRIEND)}),body:{fromAccount:\"\",addFriendItem:[],type:\"\"},keyMap:{request:{source:\"AddSource\",wording:\"AddWording\",type:\"AddType\"},response:{ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.UPDATE_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.UPDATE_FRIEND)}),body:{fromAccount:\"\",updateItem:void 0},keyMap:{request:{snsItem:\"SnsItem\"},response:{ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.DELETE_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.DELETE_FRIEND)}),body:{fromAccount:\"\",userIDList:[],type:\"\"},keyMap:{request:{type:\"DeleteType\"},response:{ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.GET_FRIEND_PROFILE)}),body:{fromAccount:\"\",userIDList:void 0},keyMap:{response:{InfoItem:\"resultList\",SnsProfileItem:\"tagValueList\"}}}}(e)),this._configMap.set(Uo.CHECK_FRIEND,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.CHECK_FRIEND)}),body:{fromAccount:\"\",userIDList:[],type:\"\"},keyMap:{request:{type:\"CheckType\"},response:{InfoItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_APPLICATION_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.GET_FRIEND_APPLICATION_LIST)}),body:{fromAccount:\"\",applicationType:\"\",startTime:0,maxLimited:0,lastSequence:0},keyMap:{response:{PendencyItem:\"resultList\",AddSource:\"source\",AddTime:\"time\",AddWording:\"wording\",Image:\"avatar\",UnreadPendencyCount:\"unreadCount\",To_Account:\"userID\",PendencyType:\"type\"}}}}(e)),this._configMap.set(Uo.RESPOND_FRIEND_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.RESPOND_FRIEND_APPLICATION)}),body:{fromAccount:\"\",responseFriendItem:[]},keyMap:{request:{tag:\"TagName\",action:\"ResponseAction\"},response:{ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.DELETE_FRIEND_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.DELETE_FRIEND_APPLICATION)}),body:{fromAccount:\"\",type:\"\",userIDList:void 0},keyMap:{request:{type:\"PendencyType\",userIDList:\"To_Account\"},response:{ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.REPORT_FRIEND_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.REPORT_FRIEND_APPLICATION)}),body:{fromAccount:\"\",latestTimeStamp:\"\"},keyMap:{request:{latestTimeStamp:\"LatestPendencyTimeStamp\"}}}}(e)),this._configMap.set(Uo.CREATE_FRIEND_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.CREATE_FRIEND_GROUP)}),body:{fromAccount:\"\",groupName:void 0,userIDList:void 0},keyMap:{request:{groupName:\"GroupName\",userIDList:\"To_Account\"},response:{ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.DELETE_FRIEND_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.DELETE_FRIEND_GROUP)}),body:{fromAccount:\"\",nameList:void 0},keyMap:{request:{nameList:\"GroupName\"}}}}(e)),this._configMap.set(Uo.GET_FRIEND_GROUP_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.GET_FRIEND_GROUP_LIST)}),body:{fromAccount:\"\",lastSequence:0,needFriend:\"Need_Friend_Type_Yes\"},keyMap:{response:{ResultItem:\"resultList\",GroupName:\"name\",FriendNumber:\"friendCount\",To_Account:\"userIDList\"}}}}(e)),this._configMap.set(Uo.UPDATE_FRIEND_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.FRIEND,\".\").concat(Uo.UPDATE_FRIEND_GROUP)}),body:{fromAccount:\"\",oldName:\"\",newName:void 0,updateGroupItem:void 0},keyMap:{request:{oldName:\"GroupOldName\",newName:\"GroupNewName\"},response:{UpdateType:\"type\",ResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_LIST)}),body:{memberAccount:\"\",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:\"Member_Account\"},response:{GroupIdList:\"groups\",NoUnreadSeqList:\"excludedUnreadSequenceList\",MsgSeq:\"readedSequence\",LastRecallTime:\"_lastRevokedTime\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_PROFILE)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:void 0,groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:\"GroupIdList\",groupCustomField:\"AppDefinedData\",memberCustomField:\"AppMemberDefinedData\",groupCustomFieldFilter:\"AppDefinedDataFilter_Group\",memberCustomFieldFilter:\"AppDefinedDataFilter_GroupMember\"},response:{GroupIdList:\"groups\",AppDefinedData:\"groupCustomField\",AppMemberDefinedData:\"memberCustomField\",AppDefinedDataFilter_Group:\"groupCustomFieldFilter\",AppDefinedDataFilter_GroupMember:\"memberCustomFieldFilter\",InfoSeq:\"infoSequence\",MemberList:\"members\",GroupInfo:\"groups\",ShutUpUntil:\"muteUntil\",ShutUpAllMember:\"muteAllMembers\"}}}}(e)),this._configMap.set(Uo.CREATE_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.CREATE_GROUP)}),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:{request:{ownerID:\"Owner_Account\",userID:\"Member_Account\",avatar:\"FaceUrl\",maxMemberNum:\"MaxMemberCount\",joinOption:\"ApplyJoinOption\",groupCustomField:\"AppDefinedData\",memberCustomField:\"AppMemberDefinedData\",inviteOption:\"InviteJoinOption\"},response:{HugeGroupFlag:\"avChatRoomFlag\",OverJoinedGroupLimit_Account:\"overLimitUserIDList\"}}}}(e)),this._configMap.set(Uo.DISMISS_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.DISMISS_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(Uo.UPDATE_GROUP_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.UPDATE_GROUP_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:{request:{groupCustomField:\"AppDefinedData\",muteAllMembers:\"ShutUpAllMember\",joinOption:\"ApplyJoinOption\",avatar:\"FaceUrl\",inviteOption:\"InviteJoinOption\"},response:{AppDefinedData:\"groupCustomField\",ShutUpAllMember:\"muteAllMembers\"}}}}(e)),this._configMap.set(Uo.APPLY_JOIN_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:\"ApplyMsg\",historyMessageFlag:\"HugeGroupHistoryMsgFlag\"},response:{HugeGroupFlag:\"avChatRoomFlag\",AVChatRoomKey:\"avChatRoomKey\",RspMsgList:\"messageList\",ToGroupId:\"to\"}}}}(e)),this._configMap.set(Uo.APPLY_JOIN_GROUP_NOAUTH,function(e){return e.a2,e.tinyid,{head:t(t({},_(e,is)),{},{servcmd:\"\".concat(B.NAME.BIG_GROUP_NO_AUTH,\".\").concat(Uo.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:\"ApplyMsg\"},response:{HugeGroupFlag:\"avChatRoomFlag\"}}}}(e)),this._configMap.set(Uo.QUIT_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.QUIT_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(Uo.SEARCH_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.SEARCH_GROUP)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:[\"Type\",\"Name\",\"Introduction\",\"Notification\",\"FaceUrl\",\"CreateTime\",\"Owner_Account\",\"LastInfoTime\",\"LastMsgTime\",\"NextMsgSeq\",\"MemberNum\",\"MaxMemberNum\",\"ApplyJoinOption\",\"InviteJoinOption\"]}},keyMap:{response:{}}}}(e)),this._configMap.set(Uo.CHANGE_GROUP_OWNER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.CHANGE_GROUP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:\"NewOwner_Account\"}}}}(e)),this._configMap.set(Uo.HANDLE_GROUP_APPLICATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.HANDLE_GROUP_APPLICATION)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:\"Applicant_Account\",handleAction:\"HandleMsg\",handleMessage:\"ApprovalMsg\",messageKey:\"MsgKey\"}}}}(e)),this._configMap.set(Uo.HANDLE_INVITE_JOIN_GROUP,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.HANDLE_INVITE_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:\"Applicant_Account\",invitee:\"Invited_Account\",handleAction:\"HandleMsg\",handleMessage:\"ApprovalMsg\"}}}}(e)),this._configMap.set(Uo.HANDLE_GROUP_INVITATION,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.HANDLE_GROUP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:\"Inviter_Account\",handleAction:\"HandleMsg\",handleMessage:\"ApprovalMsg\",messageKey:\"MsgKey\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_PENDENCY,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_PENDENCY)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:\"Handle_Account\"},response:{To_Account:\"userID\",ApplyInviteMsg:\"note\"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_SYSTEM_NOTICE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.DELETE_GROUP_SYSTEM_NOTICE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:\"DelMsgList\",messageSeq:\"MsgSeq\",messageRandom:\"MsgRandom\"}}}}(e)),this._configMap.set(Uo.AVCHATROOM_POLLING,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.BIG_GROUP_LONG_POLLING,\".\").concat(Uo.AVCHATROOM_POLLING)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:\"USP\"},response:{ToGroupId:\"groupID\",RspBroadcastMsgList:\"broadcastMessageList\",IsSystemMsg:\"isSystemMessage\"}}}}(e)),this._configMap.set(Uo.AVCHATROOM_NOAUTH_POLLING,function(e){return e.a2,e.tinyid,{head:t(t({},_(e,ss)),{},{servcmd:\"\".concat(B.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,\".\").concat(Uo.AVCHATROOM_POLLING)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:\"USP\"},response:{ToGroupId:\"groupID\",RspBroadcastMsgList:\"broadcastMessageList\",IsSystemMsg:\"isSystemMessage\"}}}}(e)),this._configMap.set(Uo.GET_ONLINE_MEMBER_NUM,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_ONLINE_MEMBER_NUM)}),body:{groupID:void 0},keyMap:{response:{OnlineMemberNum:\"memberCount\"}}}}(e)),this._configMap.set(Uo.SET_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.SET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]},keyMap:{request:{key:\"key\",value:\"value\"}}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.MODIFY_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]},keyMap:{request:{key:\"key\",value:\"value\"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.DELETE_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]},keyMap:{request:{key:\"key\"}}}}(e)),this._configMap.set(Uo.CLEAR_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.CLEAR_GROUP_ATTRIBUTES)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]}}}(e)),this._configMap.set(Uo.GET_GROUP_ATTRIBUTES,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_ATTR,\".\").concat(Uo.GET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:\"Key\",groupType:\"GroupType\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_NOTIFY,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_NOTIFY)}),body:{notifyReqList:[]},keyMap:{request:{notifyReqList:\"NotifyReqList\"},response:{NextMsgTime:\"nextRevokedTime\",NotifyMsgList:\"notifyList\",NotifyRspList:\"notifyRspList\"}}}}(e)),this._configMap.set(Uo.UPDATE_GROUP_COUNTER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.UPDATE_GROUP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:\"GroupCounter\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_COUNTER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:\"GroupCounterKeys\"}}}}(e)),this._configMap.set(Uo.CREATE_TOPIC,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_COMMUNITY,\".\").concat(Uo.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:{request:{avatar:\"FaceUrl\"}}}}(e)),this._configMap.set(Uo.DELETE_TOPIC,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_COMMUNITY,\".\").concat(Uo.DELETE_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:\"TopicIdList\"},response:{DestroyResultItem:\"resultList\"}}}}(e)),this._configMap.set(Uo.UPDATE_TOPIC_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_COMMUNITY,\".\").concat(Uo.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:{request:{avatar:\"FaceUrl\",muteAllMembers:\"ShutUpAllMember\"}}}}(e)),this._configMap.set(Uo.GET_TOPIC_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_COMMUNITY,\".\").concat(Uo.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:[\"NoUnreadSeqList\"]},keyMap:{request:{topicIDList:\"TopicIdList\"},response:{TopicAndSelfInfo:\"topicInfoList\",TopicInfo:\"topic\",GroupID:\"groupID\",ShutUpTime:\"muteTime\",ShutUpAllFlag:\"muteAllMembers\",LastMsgTime:\"lastMessageTime\",MsgSeq:\"readedSequence\",LastMsgSeq:\"sequence\",NoUnreadSeqList:\"excludedUnreadSequenceList\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_MEMBER_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_MEMBER_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:\"AppDefinedDataFilter_GroupMember\"},response:{AppMemberDefinedData:\"memberCustomField\",AppDefinedDataFilter_GroupMember:\"memberCustomFieldFilter\",MemberList:\"members\",ShutUpUntil:\"muteUntil\"}}}}(e)),this._configMap.set(Uo.GET_AVCHATROOM_MEMBER_LIST,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_AVCHATROOM,\".\").concat(Uo.GET_AVCHATROOM_MEMBER_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:\"Timestamp\",filter:\"Mark\"},response:{NextTimestamp:\"offset\"}}}}(e)),this._configMap.set(Uo.GET_GROUP_MEMBER_PROFILE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.GET_GROUP_MEMBER_PROFILE)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:\"Member_List_Account\",memberCustomFieldFilter:\"AppDefinedDataFilter_GroupMember\"},response:{MemberList:\"members\",ShutUpUntil:\"muteUntil\",AppDefinedDataFilter_GroupMember:\"memberCustomFieldFilter\",AppMemberDefinedData:\"memberCustomField\"}}}}(e)),this._configMap.set(Uo.ADD_GROUP_MEMBER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.ADD_GROUP_MEMBER)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:\"Member_Account\",userIDList:\"MemberList\"},response:{MemberList:\"members\"}}}}(e)),this._configMap.set(Uo.DELETE_GROUP_MEMBER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.DELETE_GROUP_MEMBER)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:\"MemberToDel_Account\"}}}}(e)),this._configMap.set(Uo.BAN_AVCHATROOM_MEMBER,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.BAN_AVCHATROOM_MEMBER)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:\"\"},keyMap:{request:{userIDList:\"Members_Account\",duration:\"Duration\",reason:\"Description\"}}}}(e)),this._configMap.set(Uo.MODIFY_GROUP_MEMBER_INFO,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP,\".\").concat(Uo.MODIFY_GROUP_MEMBER_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:{request:{userID:\"Member_Account\",memberCustomField:\"AppMemberDefinedData\",muteTime:\"ShutUpTime\",messageRemindType:\"MsgFlag\"}}}}(e)),this._configMap.set(Uo.MARK_AVCHATROOM_MEMBER_INFO,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.GROUP_AVCHATROOM,\".\").concat(Uo.MARK_AVCHATROOM_MEMBER_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:\"CommandType\",memberList:\"MemberList\",markType:\"Marks\",userID:\"Member_Account\"},response:{CommandType:\"operationType\",Marks:\"markType\",Member_Account:\"userID\"}}}}(e)),this._configMap.set(Uo.SSO_STAT,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STAT,\".\").concat(Uo.SSO_STAT)}),body:{header:{},event:[],quality:[]},keyMap:{request:{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\"}}}}(o)),this._configMap.set(Uo.PING,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.HEARTBEAT,\".\").concat(Uo.PING)}),body:{}}}(e)),this._configMap.set(Uo.MESSAGE_PUSH,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_PUSH,\".\").concat(Uo.MESSAGE_PUSH)}),body:{},keyMap:{response:{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\"}}}}(e)),this._configMap.set(Uo.MULTI_MESSAGE_PUSH,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_PUSH,\".\").concat(Uo.MULTI_MESSAGE_PUSH)}),body:{},keyMap:{response:{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\"}}}}(e)),this._configMap.set(Uo.MESSAGE_PUSH_ACK,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.OPEN_IM,\".\").concat(Uo.MESSAGE_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:\"SessionData\"}}}}(e)),this._configMap.set(Uo.STATUS_FORCE_OFFLINE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:\"C2CNotifyMessageArray\",NoticeSeq:\"noticeSequence\",KickoutMsgNotify:\"kickoutMsgNotify\",NewInstInfo:\"newInstanceInfo\"}}}}(e)),this._configMap.set(Uo.DOWNLOAD_MERGER_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_LONG_MESSAGE,\".\").concat(Uo.DOWNLOAD_MERGER_MESSAGE)}),body:{downloadKey:\"\"},keyMap:{response:{Data:\"data\",Desc:\"description\",Ext:\"extension\",Download_Flag:\"downloadFlag\",ThumbUUID:\"thumbUUID\",VideoUUID:\"videoUUID\"}}}}(e)),this._configMap.set(Uo.UPLOAD_MERGER_MESSAGE,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_LONG_MESSAGE,\".\").concat(Uo.UPLOAD_MERGER_MESSAGE)}),body:{messageList:[]},keyMap:{request:{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\"}}}}(e)),this._configMap.set(Uo.SET_TOKEN,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.SET_TOKEN)}),body:{tokenID:\"\",pushMsg:0,sdkAppID:0,businessID:\"\",deviceBrand:\"\",deviceToken:\"\",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:\"TokenID\",pushMsg:\"PushMsg\",sdkAppID:\"EnterVersion\",businessID:\"BusiID\",deviceBrand:\"InstType\",deviceToken:\"VarToken\",isTpns:\"IsTpns\"}}}}(e)),this._configMap.set(Uo.STAT_FOREGROUND,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.STAT_FOREGROUND)}),body:{isWebUniapp:0}}}(e)),this._configMap.set(Uo.STAT_BACKGROUND,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(B.NAME.IM_OPEN_STATUS,\".\").concat(Uo.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:\"C2cUnread\",groupUnreadCount:\"GrpUnread\"}}}}(e))}},{key:\"has\",value:function(e){return this._configMap.has(e)}},{key:\"get\",value:function(e){return this._configMap.get(e)}},{key:\"update\",value:function(){this._fillConfigMap()}},{key:\"getKeyMap\",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(Je.w(\"\".concat(this._n,\".getKeyMap unknown protocolName:\").concat(e)),{})}},{key:\"getProtocolData\",value:function(e){var t=e.protocolName,n=e.requestData,o=this.get(t),a=null;if(n){var i=this._simpleDeepCopy(o),s=this._updateService(n,i),r=s.body,c=Object.create(null);for(var u in r)if(Object.prototype.hasOwnProperty.call(r,u)){if(c[u]=r[u],void 0===n[u])continue;c[u]=n[u]}s.body=c,a=this._getUplinkData(s)}else a=this._getUplinkData(o);return a}},{key:\"_getUplinkData\",value:function(e){var t=this._requestDataCleaner(e),n=zt(t.head),o=Bi(t.body,this._getRequestKeyMap(n));return t.body=o,t}},{key:\"_updateService\",value:function(e,t){var n=zt(t.head);if(this._isFromGroupRequest(t)){var o=e.type,a=e.groupID,i=void 0===a?void 0:a,s=e.groupIDList,r=void 0===s?[]:s;mt(i)&&(i=r[0]||\"\"),wt({type:o,groupID:i})&&(t.head.servcmd=\"\".concat(B.NAME.GROUP_COMMUNITY,\".\").concat(n))}return t}},{key:\"_isFromGroupRequest\",value:function(e){return e.head.servcmd.includes(B.NAME.GROUP)||e.head.servcmd.includes(B.NAME.GROUP_ATTR)}},{key:\"_getRequestKeyMap\",value:function(e){var n=this.getKeyMap(e);return t(t({},xi.request),n.request)}},{key:\"_requestDataCleaner\",value:function(e){var t=Array.isArray(e)?[]:Object.create(null);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&Dt(o)&&null!==e[o]&&void 0!==e[o]&&(\"object\"!==n(e[o])?t[o]=e[o]:t[o]=this._requestDataCleaner.bind(this)(e[o]));return t}},{key:\"_simpleDeepCopy\",value:function(e){for(var t,n=Object.keys(e),o={},a=0,i=n.length;a1e3*a)return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;r+=1,this._commandRequestInfoMap.set(t,{startTime:s,requestCount:r});var c=!1;return r>o&&(c=!0),c}},{key:\"_isServerOverload\",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var t=this._serverOverloadInfoMap.get(e),n=t.overloadTime,o=t.waitingTime,a=!1;return Date.now()-n<=1e3*o?a=!0:(this._serverOverloadInfoMap.delete(e),a=!1),a}},{key:\"_getCmd\",value:function(e){var t=\"\";if(!e.includes(\".\"))return t;var n=e.split(\".\")[1];for(var o in Uo)if(Uo[o]===n){t=o;break}return t}},{key:\"onPushedServerOverload\",value:function(e){var t=e.overloadCommand,n=e.waitingTime;this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:n}),Je.w(\"\".concat(this._n,\".onPushedServerOverload waitingTime:\").concat(n,\"s cmd:\").concat(this._getCmd(t)))}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._updateCommandFrequencyLimitMap(ls),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear(),this._incrementalPullContactFlag=!0}}]),a}(Po),vs=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"CloudControlModule\",a._cloudConfig=new Map,a._expiredTime=0,a._version=0,a._isFetching=!1,a}return i(n,[{key:\"getCloudConfig\",value:function(e){return mt(e)?this._cloudConfig:this._cloudConfig.has(e)?this._cloudConfig.get(e):void 0}},{key:\"getServerConfig\",value:function(e){var t={code:0,data:\"\"};return!mt(e)&&this._cloudConfig.has(e)&&(t.data=this._cloudConfig.get(e)),Promise.resolve(t)}},{key:\"_canFetchConfig\",value:function(){return this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime}},{key:\"fetchConfig\",value:function(){var e=this,t=this._canFetchConfig();if(Je.l(\"\".concat(this._n,\".fetchConfig canFetchConfig:\").concat(t)),t){var n=new Xo(\"fetchCloudControlConfig\"),o=this.getModule(io).getSDKAppID();this._isFetching=!0,this.request({protocolName:Uo.FETCH_CLOUD_CONTROL_CONFIG,requestData:{SDKAppID:o,version:this._version}}).then((function(t){e._isFetching=!1,n.setMessage(\"version:\".concat(e._version,\" newVersion:\").concat(t.data.version,\" config:\").concat(t.data.cloudControlConfig)).setNetworkType(e.getNetworkType()).end(),Je.l(\"\".concat(e._n,\".fetchConfig ok\")),e._parseCloudControlConfig(t.data)})).catch((function(t){e._isFetching=!1,e.probeNetwork().then((function(e){var o=v(e,2),a=o[0],i=o[1];n.setError(t,a,i).end()})),Je.l(\"\".concat(e._n,\".fetchConfig failed. error:\"),t),e._setExpiredTimeOnResponseError(12e4)}))}}},{key:\"onPushedCloudControlConfig\",value:function(e){Je.l(\"\".concat(this._n,\".onPushedCloudControlConfig\")),new Xo(\"pushedCloudControlConfig\").setNetworkType(this.getNetworkType()).setMessage(\"newVersion:\".concat(e.version,\" config:\").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:\"onCheckTimer\",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:\"_parseCloudControlConfig\",value:function(e){var t=this,n=\"\".concat(this._n,\"._parseCloudControlConfig\"),o=e.errorCode,a=e.errorMessage,i=e.cloudControlConfig,s=e.version,r=e.expiredTime;if(0===o){if(this._version!==s){var c=null;try{c=JSON.parse(i)}catch(u){this.isPrivateNetWork()||Je.e(\"\".concat(n,\" JSON parse error. cloudControlConfig:\"),i)}c&&(this._cloudConfig.clear(),Object.keys(c).forEach((function(e){t._cloudConfig.set(e,c[e])})),this._version=s,this.emitInnerEvent(ha.CLOUD_CONFIG_UPDATED))}this._expiredTime=Date.now()+1e3*r}else mt(o)?(Je.l(\"\".concat(n,\" failed. Invalid message format:\"),e),this._setExpiredTimeOnResponseError(36e5)):(Je.e(\"\".concat(n,\" errorCode:\").concat(o,\" errorMessage:\").concat(a)),this._setExpiredTimeOnResponseError(12e4))}},{key:\"_setExpiredTimeOnResponseError\",value:function(e){this._expiredTime=Date.now()+e}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(Po),ms=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"RecoverMessageModule\",a.PULL_LIMIT_COUNT=15,a}return i(n,[{key:\"start\",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:\"_recoverGroupChat\",value:function(){var e,t,n=this,o=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),a=this.getModule(ao),i=0,s=0,r=0,c=[];o.forEach((function(o){var u=o.conversationID,l=o.lastMessage;t=u.replace(S.CONV_GROUP,\"\"),e=a.getLocalLastMessage(u),l&&0!==l.lastSequence&&e?(s=l.lastSequence,i=e.sequence,r=s-i,i>0&&r>=1&&r<300?n._recoverGroupMessage({groupID:t,localLastMessageSequence:i,remoteLastMessageSequence:s}):c.push(t)):c.push(t)})),this._getGroupNotify(c)}},{key:\"_recoverC2CChat\",value:function(){var e,t=this,n=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C})),o=this.getModule(ao),a=0,i=0,s=0,r=[Promise.resolve()];n.forEach((function(n){var c=n.conversationID,u=n.lastMessage;e=o.getLocalLastMessage(c),u&&0!==u.lastTime&&e&&(i=u.lastTime,a=e.time,s=i-a,a>0&&s>=1&&s<=600&&r.push(t._recoverC2CMessage({conversationID:c,localLastMessageTime:a,remoteLastMessageTime:i})))})),Promise.all(r).then((function(){Je.l(\"\".concat(t._n,\"._recoverC2CChat all promise fulfilled, start to sync unread messages\")),t.getModule(po).startSyncOnReconnected()}))}},{key:\"_getLocalConversationList\",value:function(){return this.getModule(ao).getLocalConversationList()}},{key:\"_recoverGroupMessage\",value:function(e){var t=this,n=\"\".concat(this._n,\"._recoverGroupMessage\");Je.l(\"\".concat(n,\" options:\"),e);var o=e.groupID,a=e.localLastMessageSequence,i=e.remoteLastMessageSequence;this._getGroupRoamingMessage({groupID:o,sequence:a}).then((function(e){var a=e.data,s=a.complete,r=a.messageList;if(!mt(r)){var c=r[0].sequence,u=\"groupID:\".concat(o,\" pkgLastSequence:\").concat(c,\" remoteLastSequence:\").concat(i,\" complete:\").concat(s,\" count:\").concat(r.length);Je.l(\"\".concat(n,\" \").concat(u)),c1&&r.sort((function(e,t){return e.sequence-t.sequence}));for(var d=0;d1?t:1,o=e.length,a=[];if(o>0)for(var i=0;i0)for(var n=this.getModule(to),o=0,a=t.length;o=0&&this._e2eDelayArray.push(t)}},{key:\"_calcAvg\",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),Xt(n/t,1)}},{key:\"_calcCountWithLimit\",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e100&&(n=100),n}},{key:\"_checkE2EDelayException\",value:function(e,t){var n=e.filter((function(e){return e>t}));if(n.length>0){var o=n.length,a=Math.min.apply(Math,m(n)),i=Math.max.apply(Math,m(n)),s=this._calcAvg(n,o),r=Xt(o/e.length*100,2);if(r>50)new Xo(\"messageE2EDelayException\").setMessage(\"count:\".concat(o,\" min:\").concat(a,\" max:\").concat(i,\" avg:\").concat(s,\" percent:\").concat(r)).setLevel(\"warning\").end()}}},{key:\"getStatResult\",value:function(){var e=this._e2eDelayArray.length;if(0===e)return null;var t=m(this._e2eDelayArray),n=this._calcCountWithLimit({e2eDelayArray:t,min:0,max:1}),o=this._calcCountWithLimit({e2eDelayArray:t,min:1,max:3}),a=this._calcPercent(n,e),i=this._calcPercent(o,e),s=this._calcAvg(t,e);return this._checkE2EDelayException(t,3),t.length=0,this.reset(),{totalCount:e,countLessThan1Second:n,percentOfCountLessThan1Second:a,countLessThan3Second:o,percentOfCountLessThan3Second:i,avgDelay:s}}},{key:\"reset\",value:function(){this._e2eDelayArray.length=0}}]),e}(),Is=function(){function e(){o(this,e),this._n=\"AvgRTT\",this._requestCount=0,this._rttArray=[]}return i(e,[{key:\"addRequestCount\",value:function(){this._requestCount+=1}},{key:\"addRTT\",value:function(e){this._rttArray.push(e)}},{key:\"_calcTotalCount\",value:function(){return this._requestCount}},{key:\"_calcRTTCount\",value:function(e){return e.length}},{key:\"_calcSuccessRateOfRequest\",value:function(e,t){if(0===t)return 0;var n=Xt(e/t*100,2);return n>100&&(n=100),n}},{key:\"_calcAvg\",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),parseInt(n/t)}},{key:\"_calcMax\",value:function(){return Math.max.apply(Math,m(this._rttArray))}},{key:\"_calcMin\",value:function(){return Math.min.apply(Math,m(this._rttArray))}},{key:\"getStatResult\",value:function(){var e=this._calcTotalCount(),t=m(this._rttArray);if(0===e)return null;var n=this._calcRTTCount(t),o=this._calcSuccessRateOfRequest(n,e),a=this._calcAvg(t,n);return Je.l(\"\".concat(this._n,\".getStatResult max:\").concat(this._calcMax(),\" min:\").concat(this._calcMin(),\" avg:\").concat(a)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:a}}},{key:\"reset\",value:function(){this._requestCount=0,this._rttArray.length=0}}]),e}(),ys=function(){function e(){o(this,e),this._map=new Map}return i(e,[{key:\"initMap\",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:\"addTotalCount\",value:function(e){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).totalCount+=1,!0)}},{key:\"addSuccessCount\",value:function(e){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).successCount+=1,!0)}},{key:\"addFailedCountOfUserSide\",value:function(e){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).failedCountOfUserSide+=1,!0)}},{key:\"addCost\",value:function(e,t){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).costArray.push(t),!0)}},{key:\"addFileSize\",value:function(e,t){return!(mt(e)||!this._map.has(e))&&(this._map.get(e).fileSizeArray.push(t),!0)}},{key:\"_calcSuccessRateOfBusiness\",value:function(e){if(mt(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=Xt(t.successCount/t.totalCount*100,2);return n>100&&(n=100),n}},{key:\"_calcSuccessRateOfPlatform\",value:function(e){if(mt(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=this._calcSuccessCountOfPlatform(e)/t.totalCount*100;return(n=Xt(n,2))>100&&(n=100),n}},{key:\"_calcTotalCount\",value:function(e){return mt(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:\"_calcSuccessCountOfBusiness\",value:function(e){return mt(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:\"_calcSuccessCountOfPlatform\",value:function(e){if(mt(e)||!this._map.has(e))return-1;var t=this._map.get(e);return t.successCount+t.failedCountOfUserSide}},{key:\"_calcAvg\",value:function(e){return mt(e)||!this._map.has(e)?-1:e===Ho?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:\"_calcAvgCost\",value:function(e){var t=this._map.get(e).costArray.length;if(0===t)return 0;var n=0;return this._map.get(e).costArray.forEach((function(e){n+=e})),parseInt(n/t)}},{key:\"_calcAvgSpeed\",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:\"getStatResult\",value:function(e){var t=this._calcTotalCount(e);if(0===t)return null;var n=this._calcSuccessCountOfBusiness(e),o=this._calcSuccessRateOfBusiness(e),a=this._calcSuccessCountOfPlatform(e),i=this._calcSuccessRateOfPlatform(e),s=this._calcAvg(e);return this.reset(e),{totalCount:t,successCountOfBusiness:n,successRateOfBusiness:o,successCountOfPlatform:a,successRateOfPlatform:i,avgValue:s}}},{key:\"reset\",value:function(e){mt(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),e}(),Ts=function(){function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}return i(e,[{key:\"initMap\",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:\"addMessageSequence\",value:function(e){var t=e.key,n=e.message;if(mt(t)||!this._lastMap.has(t)||!this._currentMap.has(t))return!1;var o=n.conversationID,a=n.sequence,i=o.replace(S.CONV_GROUP,\"\");if(0===this._lastMap.get(t).size)this._addCurrentMap(e);else if(this._lastMap.get(t).has(i)){var s=this._lastMap.get(t).get(i),r=s.length-1;a>s[0]&&a100&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}}},{key:\"reset\",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),Cs=function(e){r(a,e);var n=f(a);function a(e){var t;o(this,a),(t=n.call(this,e))._n=\"QualityStatModule\",t.TAG=\"im-ssolog-quality-stat\",t.reportIndex=0,t.wholePeriod=!1,t._qualityItems=[bo,wo,Fo,qo,xo,Vo,Ho,Bo,Ko,Yo],t._messageSentItems=[Fo,qo,xo,Vo,Ho],t._messageReceivedItems=[Bo,Ko,Yo],t.REPORT_INTERVAL=120,t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._statInfoArr=[],t._avgRTT=new Is,t._avgE2EDelay=new Ms,t._rateMessageSent=new ys,t._rateMessageReceived=new Ts;var i=t.getInnerEmitterInstance();return i.on(ha.A2KEY_AND_TINYID_UPDATED,t._onLoginSuccess,g(t)),i.on(ha.CLOUD_CONFIG_UPDATED,t._onCloudConfigUpdated,g(t)),t}return i(a,[{key:\"_onLoginSuccess\",value:function(){var e=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var t=this.getModule(so),n=t.getItem(this.TAG,!1);!pn(n)&&It(n.forEach)&&(Je.l(\"\".concat(this._n,\"._onLoginSuccess. logs count:\").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"q_rpt_interval\"),t=this.getCloudConfig(\"q_rpt_sdkappid_bl\"),n=this.getCloudConfig(\"q_rpt_tinyid_wl\");mt(e)||(this.REPORT_INTERVAL=Number(e)),mt(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(\",\").map((function(e){return Number(e)}))),mt(n)||(this.REPORT_TINYID_WHITELIST=n.split(\",\"))}},{key:\"onCheckTimer\",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:\"addRequestCount\",value:function(){this._avgRTT.addRequestCount()}},{key:\"addRTT\",value:function(e){this._avgRTT.addRTT(e)}},{key:\"addMessageDelay\",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:\"addTotalCount\",value:function(e){this._rateMessageSent.addTotalCount(e)||Je.w(\"\".concat(this._n,\".addTotalCount invalid key:\"),e)}},{key:\"addSuccessCount\",value:function(e){this._rateMessageSent.addSuccessCount(e)||Je.w(\"\".concat(this._n,\".addSuccessCount invalid key:\"),e)}},{key:\"addFailedCountOfUserSide\",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||Je.w(\"\".concat(this._n,\".addFailedCountOfUserSide invalid key:\"),e)}},{key:\"addCost\",value:function(e,t){this._rateMessageSent.addCost(e,t)||Je.w(\"\".concat(this._n,\".addCost invalid key or cost:\"),e,t)}},{key:\"addFileSize\",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||Je.w(\"\".concat(this._n,\".addFileSize invalid key or size:\"),e,t)}},{key:\"addMessageSequence\",value:function(e){this._rateMessageReceived.addMessageSequence(e)||Je.w(\"\".concat(this._n,\".addMessageSequence invalid key:\"),e.key)}},{key:\"_getQualityItem\",value:function(e){var n={},o=Jo[this.getNetworkType()];mt(o)&&(o=8);var a={qualityType:Wo[e],timestamp:He(),networkType:o,extension:\"\"};switch(e){case bo:n=this._avgRTT.getStatResult();break;case wo:n=this._avgE2EDelay.getStatResult();break;case Fo:case qo:case xo:case Vo:case Ho:n=this._rateMessageSent.getStatResult(e);break;case Bo:case Ko:case Yo:n=this._rateMessageReceived.getStatResult(e)}return null===n?null:t(t({},a),n)}},{key:\"_report\",value:function(e){var t=this,n=[],o=null;mt(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),Je.d(\"\".concat(this._n,\"._report\"),n),this._statInfoArr.length>0&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]);var a=this.getModule(io),i=a.getSDKAppID(),s=a.getTinyID();Qt(this.REPORT_SDKAPPID_BLACKLIST,i)&&!Zt(this.REPORT_TINYID_WHITELIST,s)&&(n=[]),n.length>0&&this._doReport(n)}},{key:\"_doReport\",value:function(e){var n=this,o={header:vi(this),quality:e};this.request({protocolName:Uo.SSO_STAT,requestData:t({},o)}).then((function(){n.reportIndex++,n.wholePeriod=!1})).catch((function(t){Je.w(\"\".concat(n._n,\"._doReport failed. networkType:\").concat(n.getNetworkType(),\" error:\"),t),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()}))}},{key:\"_flushAtOnce\",value:function(){var e=this.getModule(so),t=e.getItem(this.TAG,!1),n=this._statInfoArr,o=\"\".concat(this._n,\"._flushAtOnce\");if(pn(t))Je.l(\"\".concat(o,\" count:\").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var a=n.concat(t);a.length>10&&(a=a.slice(0,10)),Je.l(\"\".concat(o,\" count:\").concat(a.length)),e.setItem(this.TAG,a,!0,!1)}this._statInfoArr=[]}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),a}(Po),Ds=i((function e(t){o(this,e),pn(t)||(this.userID=t.userID||\"\",this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",this.time=t.time||0,this.source=t.source||\"\",this.wording=t.wording||\"\",this.type=t.type||\"\")})),Es=function(){function e(t){o(this,e),this._snsModule=t,this._n=\"FriendApplicationHandler\",this._startTime=0,this._maxLimited=100,this._currentSequence=0,this._friendApplicationMap=new Map,this._unreadCount=0}return i(e,[{key:\"getLocalFriendApplicationList\",value:function(){return{friendApplicationList:m(this._friendApplicationMap.values()),unreadCount:this._unreadCount}}},{key:\"_onFriendApplicationListUpdated\",value:function(){this._snsModule.emitOuterEvent(E.FRIEND_APPLICATION_LIST_UPDATED,{friendApplicationList:m(this._friendApplicationMap.values()),unreadCount:this._unreadCount})}},{key:\"onFriendApplicationRead\",value:function(){this._unreadCount=0,this._onFriendApplicationListUpdated()}},{key:\"onFriendApplicationAdded\",value:function(e,n){var o=this;if(!pn(e)){var a=\"\";a=n===this._snsModule.getMyUserID()?S.SNS_APPLICATION_SENT_BY_ME:S.SNS_APPLICATION_SENT_TO_ME;var i=!1;e.forEach((function(e){var n=\"\".concat(e.userID,\"_\").concat(a);a!==S.SNS_APPLICATION_SENT_TO_ME||o._friendApplicationMap.has(n)||(o._unreadCount+=1),o._friendApplicationMap.set(n,new Ds(t(t({},e),{},{type:a}))),i=!0})),i&&this._onFriendApplicationListUpdated()}}},{key:\"onFriendApplicationDeleted\",value:function(e){pn(e)||(this._startTime=0,this._currentSequence=0,this.getFriendApplicationList())}},{key:\"getFriendApplicationList\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"getFriendApplicationList\"),n=new Xo(\"getFriendApplicationList\");return this._snsModule.request({protocolName:Uo.GET_FRIEND_APPLICATION_LIST,requestData:{applicationType:S.SNS_APPLICATION_TYPE_BOTH,fromAccount:this._snsModule.getMyUserID(),maxLimited:this._maxLimited,startTime:this._startTime,lastSequence:this._currentSequence}}).then((function(o){var a=o.data,i=a.resultList,s=a.unreadCount,r=a.startTime,c=a.currentSequence;e._startTime=r,e._currentSequence=c,e._unreadCount=s;var u=vt(i)?i.length:0,l=\"applicationCount:\".concat(u,\" unreadCount:\").concat(s,\" startTime:\").concat(r,\" currentSequence:\").concat(c);n.setNetworkType(e._snsModule.getNetworkType()).setMessage(l).end(),Je.i(\"\".concat(t,\" ok. \").concat(l)),e._friendApplicationMap.clear(),vt(i)&&i.forEach((function(t){var n=t.userID,o=t.type,a=new Ds(t);e._friendApplicationMap.set(\"\".concat(n,\"_\").concat(o),a)})),e._onFriendApplicationListUpdated()})).catch((function(o){return e._snsModule.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.w(\"\".concat(t,\" failed. error:\"),o),Go(o)}))}},{key:\"deleteFriendApplication\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteFriendApplication\"),o=e.userID,a=e.type;if((!a||a!==S.SNS_APPLICATION_SENT_BY_ME&&a!==S.SNS_APPLICATION_SENT_TO_ME)&&(a=S.SNS_APPLICATION_SENT_TO_ME),!this._friendApplicationMap.has(\"\".concat(o,\"_\").concat(a)))return Go({code:Ao.FRIEND_APPLICATION_NOT_EXIST});var i=new Xo(\"deleteFriendApplication\");return i.setMessage(\"userID:\".concat(o,\" type:\").concat(a)),this._snsModule.request({protocolName:Uo.DELETE_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:[o],type:a}}).then((function(e){var s=e.data.resultList,r=s[0],c=r.to,u=r.resultCode,l=r.resultInfo;return i.setNetworkType(t._snsModule.getNetworkType()).setMoreMessage(\"resultList:\".concat(JSON.stringify(s))).end(),Je.i(\"\".concat(n,\" ok. userID:\").concat(o,\" type:\").concat(a)),0===u?No():Go({userID:c,code:u,message:l})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"acceptFriendApplication\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"acceptFriendApplication\"),o=e.userID,a=e.remark,i=e.tag,s=e.type;(!s||s!==S.SNS_APPLICATION_AGREE&&s!==S.SNS_APPLICATION_AGREE_AND_ADD)&&(s=S.SNS_APPLICATION_AGREE_AND_ADD);var r=new Xo(\"acceptFriendApplication\");return r.setMessage(\"userID:\".concat(o,\" type:\").concat(s)),this._snsModule.request({protocolName:Uo.RESPOND_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),responseFriendItem:[{userID:o,remark:a,tag:i,action:s}]}}).then((function(e){r.setNetworkType(t._snsModule.getNetworkType()).end();var a=e.data.resultList[0],i=a.resultCode,c=a.resultInfo;if(0!==i)return Go({code:i,message:c});Je.i(\"\".concat(n,\" ok. userID:\").concat(o,\" type:\").concat(s))})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"refuseFriendApplication\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"refuseFriendApplication\"),o=e.userID,a=new Xo(\"refuseFriendApplication\");return a.setMessage(\"userID:\".concat(o)),this._snsModule.request({protocolName:Uo.RESPOND_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),responseFriendItem:[{userID:o,action:\"Response_Action_Reject\"}]}}).then((function(e){a.setNetworkType(t._snsModule.getNetworkType()).end();var i=e.data.resultList[0],s=i.resultCode,r=i.resultInfo;if(0!==s)return Go({code:s,message:r});Je.i(\"\".concat(n,\" ok. userID:\").concat(o))})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_onFriendApplicationProcessed\",value:function(e){var t=this;if(0!==e.length){var n=!1;e.forEach((function(e){var o=\"\".concat(e.to,\"_\").concat(S.SNS_APPLICATION_SENT_TO_ME);t._friendApplicationMap.has(o)&&(t._friendApplicationMap.delete(o),t._unreadCount-=1,n=!0)})),this._unreadCount<0&&(this._unreadCount=0),n&&this._onFriendApplicationListUpdated()}}},{key:\"setFriendApplicationRead\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"setFriendApplicationRead\"),n=new Xo(\"setFriendApplicationRead\");return this._snsModule.request({protocolName:Uo.REPORT_FRIEND_APPLICATION,requestData:{fromAccount:this._snsModule.getMyUserID(),latestTimeStamp:Xt(He()/1e3,0)}}).then((function(o){n.setNetworkType(e._snsModule.getNetworkType()).end(),Je.i(\"\".concat(t,\" ok\")),e._unreadCount=0})).catch((function(o){return e._snsModule.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.w(\"\".concat(t,\" failed. error:\"),o),Go(o)}))}},{key:\"reset\",value:function(){this._startIndex=0,this._maxLimited=100,this._currentSequence=0,this._unreadCount=0,this._friendApplicationMap.clear()}}]),e}(),Ss=function(){function e(n,a){o(this,e),this.userID=n,this.remark=\"\",this.groupList=[],this.source=\"\",this.addTime=0,this.friendCustomField=[],this.timestamp=0;var i={},s=[];if(i.userID=n,!pn(a))for(var r=\"\",c=\"\",u=0,l=a.length;u-1)this.friendCustomField.push({key:r,value:c});else if(r.indexOf(\"Tag_Profile_Custom\")>-1)s.push({key:r,value:c});else switch(r){case Xe.NICK:i.nick=c;break;case Xe.GENDER:i.gender=c;break;case Xe.BIRTHDAY:i.birthday=c;break;case Xe.LOCATION:i.location=c;break;case Xe.SELFSIGNATURE:i.selfSignature=c;break;case Xe.ALLOWTYPE:i.allowType=c;break;case Xe.LANGUAGE:i.language=c;break;case Xe.AVATAR:i.avatar=c;break;case Xe.MESSAGESETTINGS:i.messageSettings=c;break;case Xe.ADMINFORBIDTYPE:i.adminForbidType=c;break;case Xe.LEVEL:i.level=c;break;case Xe.ROLE:i.role=c;break;case Ze:this.remark=c;break;case nt:this.addTime=c;break;case Qe:this.groupList=JSON.parse(JSON.stringify(c));break;case $e:this.source=c;break;case et:break;default:Je.l(\"snsProfileItem unknown tag->\",a[u].tag)}this.profile=new Ca(t(t({},i),{},{profileCustomField:s}))}return i(e,[{key:\"validate\",value:function(e){var t=!0,n=\"\";if(pn(e))return{valid:!1,tips:\"empty options\"};if(e.profileCustomField)for(var o=e.profileCustomField.length,a=null,i=0;i500&&(n=\"nick name limited: must less than or equal to \".concat(500,\" bytes, current size: \").concat(Nt(e[s]),\" bytes\"),t=!1);break;case\"gender\":Rt(ot,e.gender)||(n=\"key:gender, invalid value:\"+e.gender,t=!1);break;case\"birthday\":_t(e.birthday)||(n=\"birthday must be a number\",t=!1);break;case\"location\":gt(e.location)||(n=\"location must be a string\",t=!1);break;case\"selfSignature\":gt(e.selfSignature)||(n=\"selfSignature must be a string\",t=!1);break;case\"allowType\":Rt(it,e.allowType)||(n=\"key:allowType, invalid value:\"+e.allowType,t=!1);break;case\"language\":_t(e.language)||(n=\"language must be a number\",t=!1);break;case\"avatar\":gt(e.avatar)||(n=\"avatar must be a string\",t=!1);break;case\"messageSettings\":0!==e.messageSettings&&1!==e.messageSettings&&(n=\"messageSettings must be 0 or 1\",t=!1);break;case\"adminForbidType\":Rt(at,e.adminForbidType)||(n=\"key:adminForbidType, invalid value:\"+e.adminForbidType,t=!1);break;case\"level\":_t(e.level)||(n=\"level must be a number\",t=!1);break;case\"role\":_t(e.role)||(n=\"role must be a number\",t=!1);break;default:n=\"unknown key:\"+s+\" \"+e[s],t=!1}}return{valid:t,tips:n}}},{key:\"update\",value:function(e){var t=\"\",n=\"\",o=[];this.friendCustomField.forEach((function(e){o.push(e.key)}));for(var a=0,i=e.length;a-1)o.indexOf(t)>-1?this.friendCustomField.forEach((function(e){e.key===t&&(e.value=n)})):this.friendCustomField.push({key:t,value:n});else if(t.indexOf(\"Tag_Profile_Custom\")>-1){var s=!1;this.profile.profileCustomField.forEach((function(e){e.key===t&&(e.value=n,s=!0)})),s||this.profile.profileCustomField.push({key:t,value:n})}else switch(t){case Xe.NICK:this.profile.nick=n;break;case Xe.GENDER:this.profile.gender=n;break;case Xe.BIRTHDAY:this.profile.birthday=n;break;case Xe.LOCATION:this.profile.location=n;break;case Xe.SELFSIGNATURE:this.profile.selfSignature=n;break;case Xe.ALLOWTYPE:this.profile.allowType=n;break;case Xe.LANGUAGE:this.profile.language=n;break;case Xe.AVATAR:this.profile.avatar=n;break;case Xe.MESSAGESETTINGS:this.profile.messageSettings=n;break;case Xe.ADMINFORBIDTYPE:this.profile.adminForbidType=n;break;case Xe.LEVEL:this.profile.level=n;break;case Xe.ROLE:this.profile.role=n;break;case Ze:this.remark=n;break;case nt:this.addTime=n;break;case Qe:this.groupList=JSON.parse(JSON.stringify(n));break;case $e:this.source=n;break;case et:break;default:Je.d(\"snsProfileItem unkown tag->\",e[a].tag)}this.timestamp=Date.now(),o.length=0}},{key:\"updateProfile\",value:function(e){this.profile=JSON.parse(JSON.stringify(e)),this.timestamp=Date.now()}},{key:\"addToGroupList\",value:function(e){-1===this.groupList.indexOf(e)&&(this.groupList.push(e),this.count=this.groupList.length)}},{key:\"removeFromGroupList\",value:function(e){var t=this.groupList.indexOf(e);t>-1&&(this.groupList.splice(t,1),this.count=this.groupList.length)}}]),e}(),Ns=function(){function e(t){o(this,e),this._snsModule=t,this._n=\"FriendHandler\",this._friendMap=new Map,this._startIndex=0,this._standardSequence=0,this._customSequence=0,this._expirationTime=18e4}return i(e,[{key:\"getLocalFriendList\",value:function(){return m(this._friendMap.values())}},{key:\"getFriendRemark\",value:function(e){return this._friendMap.has(e)?this._friendMap.get(e).remark:\"\"}},{key:\"onFriendProfileModified\",value:function(e){var t=this,n=e.dataList;if(!pn(n)){var o=this._snsModule.getModule(ao);n.forEach((function(e){var n=e.userID,a=e.profileList;if(t.isMyFriend(n)){Je.l(\"\".concat(t._n,\".onFriendProfileModified. friend account:\").concat(n,\", profileList:\").concat(JSON.stringify(a)));var i=t._friendMap.get(n);i.update(a),o.modifyMessageSentByPeer({conversationID:\"\".concat(S.CONV_C2C).concat(n),latestNick:i.profile.nick,latestAvatar:i.profile.avatar})}})),this._onFriendListUpdated()}}},{key:\"onFriendAdded\",value:function(e){var t=this;0!==e.length&&(Je.l(\"\".concat(this._n,\".onFriendAdded userIDList:\").concat(e)),e.forEach((function(e){t._friendMap.set(e,new Ss(e))})),this.getFriendProfile({userIDList:e}).then((function(n){e.forEach((function(e){var n=t._friendMap.get(e);n.groupList.length>0&&t._snsModule.updateWhenFriendAdded({nameList:n.groupList,userID:e})})),t._onFriendListUpdated()})))}},{key:\"onFriendDeleted\",value:function(e){var t=this;0!==e.length&&(Je.l(\"\".concat(this._n,\".onFriendDeleted userIDList:\").concat(e)),e.forEach((function(e){var n=t._friendMap.get(e);n.groupList.length>0&&t._snsModule.updateWhenFriendDeleted({nameList:n.groupList,userID:e}),t._friendMap.delete(e)})),this._onFriendListUpdated())}},{key:\"_onFriendListUpdated\",value:function(){this._snsModule.emitOuterEvent(E.FRIEND_LIST_UPDATED),this._snsModule.getModule(ao).checkAndPatchRemark()}},{key:\"getFriendProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getFriendProfile\"),o=e.userIDList,a=[],i=[],s=[];if(o.forEach((function(e){if(t._friendMap.has(e)){var n=t._friendMap.get(e);Date.now()-n.timestamp1e3&&(Je.w(\"\".concat(n,\" \").concat(an(1e3))),o.length=1e3);var i=[],s=[],r=[];if(o.forEach((function(e){t._friendMap.has(e)?r.push(e):i.push({userID:e,code:Ao.NOT_MY_FRIEND,message:t._snsModule.getErrorMessage(Ao.NOT_MY_FRIEND)})})),0===r.length)return Oo({successUserIDList:s,failureUserIDList:i});var c=a;(!c||c!==S.SNS_DELETE_TYPE_SINGLE&&c!==S.SNS_DELETE_TYPE_BOTH)&&(c=S.SNS_DELETE_TYPE_BOTH);var u=new Xo(\"deleteFriend\");return u.setMessage(\"userIDList:\".concat(r,\" type:\").concat(c)),this._snsModule.request({protocolName:Uo.DELETE_FRIEND,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:r,type:c}}).then((function(e){u.setNetworkType(t._snsModule.getNetworkType()).end(),Je.i(\"\".concat(n,\" ok\"));var o=e.data.resultList;return pn(o)||o.forEach((function(e){var t=e.to,n=e.resultCode,o=e.resultInfo;mt(n)||0===n?s.push({userID:t}):i.push({userID:t,code:n,message:o})})),No({successUserIDList:s,failureUserIDList:i})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" error:\"),e),Go(e)}))}},{key:\"updateFriend\",value:function(e){var t=this,n=e.userID,o=e.remark,a=e.friendCustomField;if(!this._friendMap.has(n))return Go({code:Ao.NOT_MY_FRIEND});var i=\"\".concat(this._n,\".\").concat(\"updateFriend\"),s=new Xo(\"updateFriend\");s.setMessage(\"userID:\".concat(n,\" remark:\").concat(o,\" friendCustomField:\").concat(a));var r=[];return mt(o)||r.push({tag:Ze,value:o}),vt(a)&&a.length>0&&a.forEach((function(e){r.push({tag:e.key,value:e.value})})),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND,requestData:{fromAccount:this._snsModule.getMyUserID(),updateItem:[{to:n,snsItem:r}]}}).then((function(e){s.setNetworkType(t._snsModule.getNetworkType()).end(),Je.i(\"\".concat(i,\" ok\"));var n=e.data.resultList[0],r=n.to,c=n.resultCode,u=n.resultInfo;if(mt(c)||0===c){var l=t._friendMap.get(r);return l&&(mt(o)||(l.remark=o),vt(a)&&a.length>0&&Ut(l.friendCustomField,a),t._onFriendListUpdated()),No(l)}return Go({code:c,message:u})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),Je.w(\"\".concat(i,\" failed. error:\"),e),Go(e)}))}},{key:\"checkFriend\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"checkFriend\"),o=e.userIDList,a=e.type;(!a||a!==S.SNS_CHECK_TYPE_SINGLE&&a!==S.SNS_CHECK_TYPE_BOTH)&&(a=S.SNS_CHECK_TYPE_BOTH);var i=new Xo(\"checkFriend\");return i.setMessage(\"userIDList:\".concat(o,\" type:\").concat(a)),this._snsModule.request({protocolName:Uo.CHECK_FRIEND,requestData:{fromAccount:this._snsModule.getMyUserID(),userIDList:o,type:a}}).then((function(e){i.setNetworkType(t._snsModule.getNetworkType()).end(),Je.i(\"\".concat(n,\" ok. userIDList:\").concat(o,\" type:\").concat(a));var s=[],r=[],c=e.data.resultList;return vt(c)&&c.forEach((function(e){var t=e.to,n=e.relation,o=e.resultCode,a=e.resultInfo;mt(o)||0===o?s.push({userID:t,code:0,relation:n}):r.push({userID:t,code:o,message:a})})),No({successUserIDList:s,failureUserIDList:r})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"updateWhenAddedToFriendGroup\",value:function(e){var t=this,n=e.name,o=e.userIDList;Je.l(\"\".concat(this._n,\".updateWhenAddedToFriendGroup groupName:\").concat(n,\" userIDList:\").concat(o)),n&&!pn(o)&&o.forEach((function(e){t._friendMap.has(e)&&t._friendMap.get(e).addToGroupList(n)}))}},{key:\"updateWhenRemovedFromFriendGroup\",value:function(e){var t=this,n=e.name,o=e.userIDList;Je.l(\"\".concat(this._n,\".updateWhenRemovedFromFriendGroup groupName:\").concat(n,\" userIDList:\").concat(o)),n&&!pn(o)&&o.forEach((function(e){t._friendMap.has(e)&&t._friendMap.get(e).removeFromGroupList(n)}))}},{key:\"reset\",value:function(){this._friendMap.clear(),this._startIndex=0,this._standardSequence=0,this._customSequence=0}}]),e}(),ks=function(){function e(t){o(this,e),pn(t)||(this.name=t.name||\"\",this.userIDList=t.userIDList||[],this.count=this.userIDList.length||0)}return i(e,[{key:\"addToUserIDList\",value:function(e){-1===this.userIDList.indexOf(e)&&(this.userIDList.push(e),this.count=this.userIDList.length)}},{key:\"removeFromUserIDList\",value:function(e){var t=this.userIDList.indexOf(e);t>-1&&(this.userIDList.splice(t,1),this.count=this.userIDList.length)}}]),e}(),As=function(){function e(t){o(this,e),this._snsModule=t,this._n=\"FriendGroupHandler\",this._friendGroupMap=new Map}return i(e,[{key:\"getLocalFriendGroupList\",value:function(){return m(this._friendGroupMap.values())}},{key:\"_emitFriendGroupListUpdated\",value:function(){var e=m(this._friendGroupMap.values());this._snsModule.emitOuterEvent(E.FRIEND_GROUP_LIST_UPDATED,e)}},{key:\"getFriendGroupList\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"getFriendGroupList\"),n=new Xo(\"getFriendGroupList\");return this._snsModule.request({protocolName:Uo.GET_FRIEND_GROUP_LIST,requestData:{fromAccount:this._snsModule.getMyUserID()}}).then((function(o){n.setNetworkType(e._snsModule.getNetworkType()).end();var a=o.data.resultList;pn(a)?Je.i(\"\".concat(t,\" ok. friend group count:0\")):(Je.i(\"\".concat(t,\" ok. friend group count:\").concat(a.length)),e._friendGroupMap.clear(),a.forEach((function(t){var n=new ks(t);e._friendGroupMap.set(t.name,n)})),e._emitFriendGroupListUpdated())})).catch((function(o){return e._snsModule.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.w(\"\".concat(t,\" error:\"),o),Go(o)}))}},{key:\"createFriendGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"createFriendGroup\"),o=e.name,a=e.userIDList;if(this._friendGroupMap.has(o))return Go({code:Ao.FRIEND_GRP_EXISTED});var i=new Xo(\"createFriendGroup\");return i.setMessage(\"name:\".concat(o,\" userIDList:\").concat(a)),this._snsModule.request({protocolName:Uo.CREATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),groupName:[o],userIDList:vt(a)?a:void 0}}).then((function(e){i.setNetworkType(t._snsModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok. name:\").concat(o,\" userIDList:\").concat(a));var s=e.data.resultList,r=[],c=[];s&&s.forEach((function(e){var t=e.to,n=e.resultCode,o=e.resultInfo;if(mt(n)||0===n)r.push(t);else{var a={userID:e.to,code:n,message:o};c.push(a)}}));var u=new ks({name:o,userIDList:r});return t._friendGroupMap.set(o,u),t._snsModule.updateWhenAddedToFriendGroup({name:o,userIDList:r}),t._emitFriendGroupListUpdated(),No({friendGroup:u,failureUserIDList:c})})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"deleteFriendGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteFriendGroup\"),o=e.name;if(!this._friendGroupMap.has(o))return Go({code:Ao.FRIEND_GRP_NOT_EXIST});var a=new Xo(\"deleteFriendGroup\");return a.setMessage(\"name:\".concat(o)),this._snsModule.request({protocolName:Uo.DELETE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),nameList:[o]}}).then((function(e){a.setNetworkType(t._snsModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok. name:\").concat(o));var i=t._friendGroupMap.get(o);return i&&(t._snsModule.updateWhenRemovedFromFriendGroup({name:o,userIDList:i.userIDList}),t._friendGroupMap.delete(o),i.userIDList.length=0),t._emitFriendGroupListUpdated(),No(i)})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],i=n[1];a.setError(e,o,i).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"renameFriendGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"renameFriendGroup\"),o=e.oldName,a=e.newName;if(!this._friendGroupMap.has(o))return Go({code:Ao.FRIEND_GRP_NOT_EXIST});var i=new Xo(\"renameFriendGroup\");return i.setMessage(\"oldName:\".concat(o,\" newName:\").concat(a)),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:o,newName:a}}).then((function(){if(i.setNetworkType(t._snsModule.getNetworkType()).end(),Je.l(\"\".concat(n,\" ok. oldName:\").concat(o,\" newName:\").concat(a)),t._friendGroupMap.has(o)){var e=t._friendGroupMap.get(o);return e.name=a,t._friendGroupMap.delete(o),t._friendGroupMap.set(a,e),t._snsModule.updateWhenRemovedFromFriendGroup({name:o,userIDList:e.userIDList}),t._snsModule.updateWhenAddedToFriendGroup({name:a,userIDList:e.userIDList}),t._emitFriendGroupListUpdated(),No(e)}return No()})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"addToFriendGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"addToFriendGroup\"),o=e.name,a=e.userIDList;if(!this._friendGroupMap.has(o))return this._onFriendGroupNotExist(o);var i=new Xo(\"addToFriendGroup\");return i.setMessage(\"name:\".concat(o,\" userIDList:\").concat(a)),Je.l(\"\".concat(n,\" name:\").concat(o,\" userIDList:\").concat(a)),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:o,updateGroupItem:a.filter((function(e){return t._snsModule.isMyFriend(e)})).map((function(e){return{to:e,updateType:\"Update_Type_Add\"}}))}}).then((function(e){return i.setNetworkType(t._snsModule.getNetworkType()).end(),t._onFriendGroupUpdated(o,e)})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"removeFromFriendGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"removeFromFriendGroup\"),o=e.name,a=e.userIDList;if(!this._friendGroupMap.has(o))return this._onFriendGroupNotExist(o);var i=new Xo(\"removeFromFriendGroup\");return i.setMessage(\"name:\".concat(o,\" userIDList:\").concat(a)),Je.l(\"\".concat(n,\" name:\").concat(o,\" userIDList:\").concat(a)),this._snsModule.request({protocolName:Uo.UPDATE_FRIEND_GROUP,requestData:{fromAccount:this._snsModule.getMyUserID(),oldName:o,updateGroupItem:a.filter((function(e){return t._snsModule.isMyFriend(e)})).map((function(e){return{to:e,updateType:\"Update_Type_Delete\"}}))}}).then((function(e){return i.setNetworkType(t._snsModule.getNetworkType()).end(),t._onFriendGroupUpdated(o,e)})).catch((function(e){return t._snsModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];i.setError(e,o,a).end()})),Je.w(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_onFriendGroupUpdated\",value:function(e,t){var n=t.data.resultList,o=this._friendGroupMap.get(e),a=[],i=[],s=[];return vt(n)&&n.forEach((function(e){var t=e.to,n=e.resultCode,r=e.resultInfo,c=e.type;0===n?\"Update_Type_Add\"===c?o&&(o.addToUserIDList(t),i.push(t)):\"Update_Type_Delete\"===c&&o&&(o.removeFromUserIDList(t),s.push(t)):a.push({to:e.to,code:n,message:r})})),Je.l(\"\".concat(this._n,\"._onFriendGroupUpdated name:\").concat(e,\" userIDList:\").concat(o.userIDList)),i.length>0&&this._snsModule.updateWhenAddedToFriendGroup({name:e,userIDList:i}),s.length>0&&this._snsModule.updateWhenRemovedFromFriendGroup({name:e,userIDList:s}),No({friendGroup:o,failureUserIDList:a})}},{key:\"updateWhenFriendAdded\",value:function(e){var t=this,n=e.nameList,o=e.userID;Je.l(\"\".concat(this._n,\".updateWhenFriendAdded userID:\").concat(o,\" nameList:\").concat(n)),pn(n)||n.forEach((function(e){t._friendGroupMap.has(e)&&t._friendGroupMap.get(e).addToUserIDList(o)}))}},{key:\"updateWhenFriendDeleted\",value:function(e){var t=this,n=e.nameList,o=e.userID;Je.l(\"\".concat(this._n,\".updateWhenFriendDeleted userID:\").concat(o,\" nameList:\").concat(n)),pn(n)||n.forEach((function(e){t._friendGroupMap.has(e)&&t._friendGroupMap.get(e).removeFromUserIDList(o)}))}},{key:\"reset\",value:function(){this._friendGroupMap.clear()}}]),e}(),Ls=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"SnsModule\",a._friendHandler=new Ns(g(a)),a._friendApplicationHandler=new Es(g(a)),a._friendGroupHandler=new As(g(a)),a.getInnerEmitterInstance().on(ha.A2KEY_AND_TINYID_UPDATED,a.onContextUpdated,g(a)),a}return i(n,[{key:\"onContextUpdated\",value:function(e){this._friendHandler.pagingGetFriendList(),this._friendGroupHandler.getFriendGroupList(),this._friendApplicationHandler.getFriendApplicationList()}},{key:\"onRelationChainModified\",value:function(e){var t=this,n=e.dataList;if(!pn(n)){var o=[],a=[],i=[],s=[],r=!1,c=\"\";n.forEach((function(e){if(3!==e.pushType&&4!==e.pushType||!e.from||(c=e.from),e.friendAddAccount&&(o.push.apply(o,m(e.friendAddAccount)),s.push.apply(s,m(e.friendAddAccount))),e.friendDelAccount&&a.push.apply(a,m(e.friendDelAccount)),e.friendApplicationAdded&&i.push.apply(i,m(e.friendApplicationAdded)),e.friendApplicationDeletedUserIDList&&s.push.apply(s,m(e.friendApplicationDeletedUserIDList)),e.reportTime&&7===e.pushType&&(r=!0),e.friendUpInfo){var n={dataList:[]};e.friendUpInfo.forEach((function(e){n.dataList.push({userID:e.friendAccount,profileList:m(e.sns)})})),t.onFriendProfileModified(n)}})),r&&this._friendApplicationHandler.onFriendApplicationRead(),this._friendApplicationHandler.onFriendApplicationAdded(i,c),this._friendApplicationHandler.onFriendApplicationDeleted(s),this._friendHandler.onFriendAdded(o),this._friendHandler.onFriendDeleted(a)}}},{key:\"isMyFriend\",value:function(e){return this._friendHandler.isMyFriend(e)}},{key:\"filterProfanity\",value:function(e,t){var n=this.getModule(yo);if(!n)return!0;var o=n.filterText(t[e],X),a=o.isAllowedToSend,i=o.modifiedText;return!0===a&&(t[e]=i,!0)}},{key:\"onFriendProfileModified\",value:function(e){this._friendHandler.onFriendProfileModified(e)}},{key:\"getLocalFriendList\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this._friendHandler.getLocalFriendList();return e?Oo(t):t}},{key:\"getFriendRemark\",value:function(e){return this._friendHandler.getFriendRemark(e)}},{key:\"getFriendList\",value:function(){return this._friendHandler.pagingGetFriendList()}},{key:\"addFriend\",value:function(e){return this._friendHandler.addFriend(e)}},{key:\"deleteFriend\",value:function(e){return this._friendHandler.deleteFriend(e)}},{key:\"checkFriend\",value:function(e){return this._friendHandler.checkFriend(e)}},{key:\"getFriendProfile\",value:function(e){return this._friendHandler.getFriendProfile(e)}},{key:\"updateFriend\",value:function(e){return this._friendHandler.updateFriend(e)}},{key:\"updateWhenAddedToFriendGroup\",value:function(e){this._friendHandler.updateWhenAddedToFriendGroup(e)}},{key:\"updateWhenRemovedFromFriendGroup\",value:function(e){this._friendHandler.updateWhenRemovedFromFriendGroup(e)}},{key:\"getLocalFriendApplicationList\",value:function(){var e=this._friendApplicationHandler.getLocalFriendApplicationList();return Oo(e)}},{key:\"deleteFriendApplication\",value:function(e){return this._friendApplicationHandler.deleteFriendApplication(e)}},{key:\"refuseFriendApplication\",value:function(e){return this._friendApplicationHandler.refuseFriendApplication(e)}},{key:\"acceptFriendApplication\",value:function(e){return this._friendApplicationHandler.acceptFriendApplication(e)}},{key:\"setFriendApplicationRead\",value:function(e){return this._friendApplicationHandler.setFriendApplicationRead(e)}},{key:\"getLocalFriendGroupList\",value:function(){var e=this._friendGroupHandler.getLocalFriendGroupList();return Oo(e)}},{key:\"createFriendGroup\",value:function(e){return this._friendGroupHandler.createFriendGroup(e)}},{key:\"deleteFriendGroup\",value:function(e){return this._friendGroupHandler.deleteFriendGroup(e)}},{key:\"addToFriendGroup\",value:function(e){return this._friendGroupHandler.addToFriendGroup(e)}},{key:\"removeFromFriendGroup\",value:function(e){return this._friendGroupHandler.removeFromFriendGroup(e)}},{key:\"renameFriendGroup\",value:function(e){return this._friendGroupHandler.renameFriendGroup(e)}},{key:\"onAddToFriendGroup\",value:function(e){return this._friendGroupHandler.onAddToFriendGroup(e)}},{key:\"updateWhenFriendAdded\",value:function(e){this._friendGroupHandler.updateWhenFriendAdded(e)}},{key:\"updateWhenFriendDeleted\",value:function(e){this._friendGroupHandler.updateWhenFriendDeleted(e)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._friendHandler.reset(),this._friendGroupHandler.reset(),this._friendApplicationHandler.reset()}}]),n}(Po),Rs=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"WorkerTimerModule\",a._isWorkerEnabled=!0,a._workerTimer=null,a._timerID=-1,a._init(),a.getInnerEmitterInstance().on(ha.CLOUD_CONFIG_UPDATED,a._onCloudConfigUpdated,g(a)),a}return i(n,[{key:\"isWorkerEnabled\",value:function(){return this._isWorkerEnabled&&Ge}},{key:\"startWorkerTimer\",value:function(){Je.l(\"\".concat(this._n,\".startWorkerTimer\")),this._workerTimer&&this._workerTimer.postMessage(\"start\")}},{key:\"stopWorkerTimer\",value:function(){Je.l(\"\".concat(this._n,\".stopWorkerTimer\")),this._workerTimer&&this._workerTimer.postMessage(\"stop\")}},{key:\"_init\",value:function(){if(Ge){var e=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(e);var t=this;this._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,Je.l(\"\".concat(t._n,\"._init seed:\").concat(t._timerID))):t._m.onCheckTimer()}}}},{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"enable_worker\");Je.l(\"\".concat(this._n,\"._onCloudConfigUpdated enableWorker:\").concat(e)),mt(e)||\"1\"===e?!this._isWorkerEnabled&&Ge&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&Ge&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:\"terminate\",value:function(){Je.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(){Je.l(\"\".concat(this._n,\".reset\"))}}]),n}(Po),Os=function(){function e(){o(this,e),this._n=\"PurchasedFeatureHandler\",this._purchasedFeatureMap=new Map}return i(e,[{key:\"isValidPurchaseBits\",value:function(e){return e&&\"string\"==typeof e&&e.length>=1&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:\"parsePurchaseBits\",value:function(e){if(this.isValidPurchaseBits(e)){this._purchasedFeatureMap.clear();for(var t=null,n=e.length-1,o=0;n>=0;n--,o++)t=o<32?new A(0,Math.pow(2,o)).toString():new A(Math.pow(2,o-32),0).toString(),\"1\"===e[n]?this._purchasedFeatureMap.set(t,!0):this._purchasedFeatureMap.set(t,!1)}else Je.w(\"\".concat(this._n,\".parsePurchaseBits invalid purchasebits:\").concat(e))}},{key:\"hasPurchasedFeature\",value:function(e){return!!this._purchasedFeatureMap.get(e)}},{key:\"isFeatureEnabled\",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,a=t.length-1,i=0;a>=0;a--,i++)if(\"1\"===t.charAt(a)&&(n=i<32?new A(0,Math.pow(2,i)).toString():new A(Math.pow(2,i-32),0).toString(),!this._purchasedFeatureMap.get(n))){o=!1;break}return Je.l(\"\".concat(this._n,\".isFeatureEnabled decimalNumber:\").concat(e,\" binaryString:\").concat(t,\" ret:\").concat(o)),Oo({enabled:o})}},{key:\"clear\",value:function(){this._purchasedFeatureMap.clear()}}]),e}(),Gs=function(){function e(t){o(this,e),this._m=t,this._n=\"CommercialConfigModule\",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new Os}return i(e,[{key:\"_canFetch\",value:function(){return this._getModule(io).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:\"onCheckTimer\",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:\"fetchConfig\",value:function(){var e=this,t=this._canFetch(),n=\"\".concat(this._n,\".fetchConfig\");if(Je.l(\"\".concat(n,\" canFetch:\").concat(t)),t){var o=this._getModule(co),a=new Xo(\"fetchCommercialConfig\");a.setNetworkType(o.getNetworkType());var i=this._getModule(io).getSDKAppID(),s=this._getModule(_o);this._isFetching=!0,s.request({protocolName:Uo.FETCH_COMMERCIAL_CONFIG,requestData:{SDKAppID:i}}).then((function(t){a.setMessage(\"purchaseBits:\".concat(t.data.purchaseBits)).end(),Je.l(\"\".concat(n,\" ok.\")),e._parseConfig(t.data),e._isFetching=!1})).catch((function(t){o.probe().then((function(e){var n=v(e,2),o=n[0],i=n[1];a.setError(t,o,i).end()})),e._isFetching=!1}))}}},{key:\"onPushedConfig\",value:function(e){var t=\"\".concat(this._n,\".onPushedConfig data:\").concat(JSON.stringify(e));Je.l(\"\".concat(t)),new Xo(\"pushedCommercialConfig\").setNetworkType(this._getModule(co).getNetworkType()).setMessage(\"purchaseBits:\".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:\"_parseConfig\",value:function(e){var t=\"\".concat(this._n,\"._parseConfig\"),n=e.errorCode,o=e.errorMessage,a=e.purchaseBits,i=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(a),this._expiredTime=Date.now()+1e3*i):mt(n)?(Je.l(\"\".concat(t,\" failed. Invalid message format:\"),e),this._setExpiredTimeOnResponseError(36e5)):(Je.e(\"\".concat(t,\" errorCode:\").concat(n,\" errorMessage:\").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:\"_setExpiredTimeOnResponseError\",value:function(e){this._expiredTime=Date.now()+e}},{key:\"canIUse\",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:\"isFeatureEnabled\",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:\"_getModule\",value:function(e){return this._m.getModule(e)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),e}(),Ps=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._m=e,a._n=\"OfflinePushModule\",a._offlinePushPlugin=void 0,a._androidPushConfig={huaweiPushBussinessId:\"\",xiaomiPushBussinessId:\"\",xiaomiPushAppId:\"\",xiaomiPushAppKey:\"\",meizuPushBussinessId:\"\",meizuPushAppId:\"\",meizuPushAppKey:\"\",vivoPushBussinessId:\"\",fcmPushBussinessId:\"\",oppoPushBussinessId:\"\",oppoPushAppKey:\"\",oppoPushAppSecret:\"\",honorPushBussinessId:\"\"},a._deviceToken=\"\",a._businessID=0,a._iosBusinessID=0,a._c2cUnreadCount=0,a._groupUnreadCount=0,a._isWebUniapp=0,a}return i(n,[{key:\"registerPlugin\",value:function(e){if(se){this._offlinePushPlugin=e[\"tim-offline-push-plugin\"];var t=e.offlinePushConfig||{},n=t.huaweiBusinessID,o=t.xiaomiBusinessID,a=t.xiaomiAppID,i=t.xiaomiAppKey,s=t.meizuBusinessID,r=t.meizuAppID,c=t.meizuAppKey,u=t.vivoBusinessID,l=t.oppoBusinessID,d=t.oppoAppKey,p=t.oppoAppSecret,_=t.honorBusinessID,g=t.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=a,this._androidPushConfig.xiaomiPushAppKey=i,this._androidPushConfig.meizuPushBussinessId=s,this._androidPushConfig.meizuPushAppId=r,this._androidPushConfig.meizuPushAppKey=c,this._androidPushConfig.vivoPushBussinessId=u,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=d,this._androidPushConfig.oppoPushAppSecret=p,this._androidPushConfig.honorPushBussinessId=_,new Xo(\"registerPlugin\").setMessage(\"tim-offline-push-plugin\").setMoreMessage(\"isExist:\".concat(!mt(this._offlinePushPlugin))).end(!0),Je.l(\"\".concat(this._n,\".\").concat(\"registerPlugin\",\" ok. offlinePushConfig:\").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=g,this._setAppShowListener()}else this.outputWarning(\"OfflinePushInUniapp\")}},{key:\"init\",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:\"_getDeviceToken\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_getDeviceToken\");if(It(this._offlinePushPlugin.getDeviceToken)){var n=\"androidPushConfig:\".concat(JSON.stringify(this._androidPushConfig),\", iosBusinessID:\").concat(this._iosBusinessID);Je.l(\"\".concat(t,\" start. \").concat(n)),new Xo(\"_getDeviceToken\").setMessage(\"\".concat(n)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var a=new Xo(\"getDeviceTokenRes\"),i=o.code,s=o.msg;if(0===i){var r=o.data,c=r.deviceToken,u=r.deviceBrand,l=r.deviceType,d=r.bussinessId;e._deviceToken=c,e._businessID=d||e._iosBusinessID,n=\"deviceToken:\".concat(c,\", deviceBrand:\").concat(u||l,\", businessID:\").concat(e._businessID),Je.l(\"\".concat(t,\" ok. \").concat(n)),a.setMessage(n).end(!0),e._setToken()}else a.setMessage(\"code:\".concat(i,\", msg:\").concat(s)).end(!0),Je.e(\"\".concat(t,\" failed. error:\"),o)}))}else Je.e(\"\".concat(t,\" getDeviceToken is not a function\"))}},{key:\"canIUseOfflinePush\",value:function(){return se&&!mt(this._offlinePushPlugin)}},{key:\"_setAppShowListener\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_setAppShowListener\");mt(this._offlinePushPlugin)?Je.e(\"\".concat(t,\" offlinePushPlugin is undefined\")):It(this._offlinePushPlugin.setAppShowListener)?(new Xo(\"_setAppShowListener\").end(!0),Je.l(\"\".concat(t,\" start\")),this._offlinePushPlugin.setAppShowListener((function(n){var o=(n||{}).appShow;new Xo(\"setAppShowListenerRes\").setMessage(\"appShow:\".concat(o)).end(!0),Je.l(\"\".concat(t,\" ok. appShow:\").concat(o)),e._m.isReady()&&(0===o?(e._getConvUnreadCount(),e._onBackground()):1===o&&e._onForeground())}))):Je.e(\"\".concat(t,\" setAppShowListener is not a function\"))}},{key:\"getDeviceBrand\",value:function(){if(!mt(this._offlinePushPlugin)&&It(this._offlinePushPlugin.getDeviceType)){var e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType;return Je.l(\"\".concat(this._n,\".getDeviceBrand ok. deviceType:\").concat(e)),e}}},{key:\"_setToken\",value:function(){var e,t=this,n=\"\".concat(this._n,\"._setToken\"),o=this.getModule(io),a=1,i=\"\",s=\"\";pn(this._deviceToken)&&(a=0);var r=this.getUniAppPlatform(),c=this.getDeviceBrand();r===R.IOS||r===R.IPAD||r===R.MAC?s=this._deviceToken:r===R.ANDROID&&(i=this._deviceToken);var u=new Xo(\"offlinePushSetToken\");return e=\"deviceToken:\".concat(s||i,\", businessID:\").concat(this._businessID,\", \")+\"deviceBrand:\".concat(c,\", isWebUniapp:\").concat(this._isWebUniapp,\", pushMsg:\").concat(a,\", platform:\").concat(r),u.setMessage(\"\".concat(e)),Je.l(\"\".concat(n,\" \").concat(e)),this.request({protocolName:Uo.SET_TOKEN,requestData:{tokenID:i,pushMsg:a,sdkAppID:o.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:c,deviceToken:s,isWebUniapp:this._isWebUniapp}}).then((function(e){return u.end(),Je.l(\"\".concat(n,\" ok\")),e})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];u.setError(e,o,a).end()})),Je.e(\"\".concat(n,\" failed. error:\"),e),Go(e)}))}},{key:\"_getConvUnreadCount\",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(ao).getLocalConversationList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:\"_onBackground\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_onBackground\"),n=new Xo(\"_onBackground\");this.request({protocolName:Uo.STAT_BACKGROUND,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage(\"c2cUnreadCount: \".concat(e._c2cUnreadCount,\", groupUnreadCount: \").concat(e._groupUnreadCount)).end(),Je.l(\"\".concat(t,\" ok\")),o})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.e(\"\".concat(t,\" failed. error:\"),o)}))}},{key:\"_onForeground\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_onForeground\"),n=new Xo(\"_onForeground\");this.request({protocolName:Uo.STAT_FOREGROUND,requestData:{isWebUniapp:this._isWebUniapp}}).then((function(e){return n.end(),Je.l(\"\".concat(t,\" ok\")),e})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),a=t[0],i=t[1];n.setError(o,a,i).end()})),Je.e(\"\".concat(t,\" failed. error:\"),o)}))}},{key:\"getUniAppPlatform\",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return\"ios\"===e?R.IOS:\"android\"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:\"reset\",value:function(){this._deviceToken=\"\",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,Je.l(\"\".concat(this._n,\".reset\"))}}]),n}(Po),Us=function(e){r(n,e);var t=f(n);function n(e){var a;return o(this,n),(a=t.call(this,e))._n=\"ProfanityFilterModule\",a._plugin=null,a._filterConfigMap=new Map,a._startIndex=0,a._version=0,a._canIUseLexicon=!1,a._isFetching=!1,a._expiredTime=0,a}return i(n,[{key:\"init\",value:function(){var e=this.getModule(lo).getPlugin(\"tim-profanity-filter-plugin\");e?(this._plugin=new e({logger:Je,isArray:vt,isMap:dt,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning(\"ProfanityPluginNotFound\")}},{key:\"onCheckTimer\",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:\"filterMessage\",value:function(e,t){var n=!0;if(!this._plugin||!this._canIUseLexicon)return n;if(t&&t.messageControlInfo&&!0===t.messageControlInfo.excludedFromContentModeration)return n;var o=e.type,a=e.conversationType;if(o!==S.MSG_TEXT&&o!==S.MSG_CUSTOM)return n;var i,s=\"\".concat(this._n,\".filterMessage\");if(Je.l(\"\".concat(s)),o===S.MSG_TEXT){if(a===S.CONV_C2C?i=Y:a===S.CONV_GROUP&&(i=j),!this._isConfigOn(i))return n;var r=this._plugin.filter(e.payload.text),c=r.type,u=r.modifiedText;1===c?n=!1:2===c&&(e.payload.text=u)}else if(o===S.MSG_CUSTOM){if(a===S.CONV_C2C?i=W:a===S.CONV_GROUP&&(i=J),!this._isConfigOn(i))return n;var l=this._plugin.filter(e.payload.data),d=this._plugin.filter(e.payload.description),p=this._plugin.filter(e.payload.extension);1===l.type||1===d.type||1===p.type?n=!1:(2===l.type&&(e.payload.data=l.modifiedText),2===d.type&&(e.payload.description=d.modifiedText),2===p.type&&(e.payload.extension=p.modifiedText))}return Je.l(\"\".concat(s,\" done. isAllowedToSend:\").concat(n)),n}},{key:\"filterText\",value:function(e,t){var n=\"\".concat(this._n,\".filterText\"),o={isAllowedToSend:!0,modifiedText:e};if(!this._plugin||!this._canIUseLexicon)return o;if(!this._isConfigOn(t))return o;Je.l(\"\".concat(n));var a=this._plugin.filter(e),i=a.type,s=a.modifiedText;return 1===i?o.isAllowedToSend=!1:2===i&&(o.modifiedText=s),Je.l(\"\".concat(n,\" done. ret:\"),o),o}},{key:\"_getLexicon\",value:function(){var e=this,t=new Xo(\"profanityFilter\"),n=\"\".concat(this._n,\"._getLexicon\");this._isFetching=!0,this.request({protocolName:Uo.GET_PROFANITY_LIST,requestData:{startIndex:this._startIndex,version:this._version}}).then((function(o){var a=o.data,i=a.errorInfo,s=a.filterConfig,r=a.lexicon,c=a.strToken,u=a.completeFlag,l=a.nextStartIndex,d=a.version,p=a.expiredTime,_=i.errorCode,g=i.errorMessage;return 0!==_?(e._isFetching=!1,Je.w(\"\".concat(n,\" failed. error:\"),i),void t.setCode(_).setMessage(g).end()):(e._onFilterConfig(s),e._getToken(c),1===u?(Je.l(\"\".concat(n,\" done. version:\").concat(d,\" expiredTime:\").concat(p)),e._version=d,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*p,void e._plugin.onLexiconCompleted(r)):(e._startIndex=l,e._plugin.onLexiconSliced(r),void e._getLexicon()))})).catch((function(o){e.probeNetwork().then((function(e){var n=v(e,2),a=n[0],i=n[1];t.setError(o,a,i).end()})),e._isFetching=!1,Je.l(\"\".concat(n,\" failed. error:\"),o)}))}},{key:\"_onFilterConfig\",value:function(e){var t=this;pn(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),Je.l(\"\".concat(this._n,\"._onFilterConfig. keys:\").concat(Array.from(this._filterConfigMap.keys()),\" values:\").concat(Array.from(this._filterConfigMap.values()))))}},{key:\"_isConfigOn\",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:\"_getToken\",value:function(e){if(gt(e)){var t=e.length,n=\"\";if(t%2==0)for(var o=0;o<=t-1;o+=2)n+=e[o+1],n+=e[o];else{for(var a=0;a=this.STORAGE_EXPIRES_TIME,a=!n||\"3.2.3\"!==n;return Je.l(\"\".concat(this._n,\"._needToUpdate isTimeout:\").concat(o,\" isDifferentVersion:\").concat(a)),o||a}},{key:\"_fetch\",value:function(){if(!this._m.getModule(io).isPrivateNetWork()){var e=\"https://web.sdk.qcloud.com/im/download/error-message/v3/0.0.4/tim-error-message.txt\",t=\"application/x-www-form-urlencoded;charset=UTF-8\",n=\"\".concat(this._n,\"._fetch ok in\"),o=this;if(ce)le.request({url:e,method:\"GET\",timeout:3e3,header:{\"content-type\":t},dataType:\"text\",success:function(e){o._fillAndSave(e.data),Je.l(\"\".concat(n,\" mini program\"))},fail:function(){}});else{var a=new XMLHttpRequest,i=setTimeout((function(){a.abort()}),3e3);a.onreadystatechange=function(){4===a.readyState&&(clearTimeout(i),200!==a.status&&304!==a.status||(Je.l(\"\".concat(n,\" browser\")),o._fillAndSave(a.responseText)))},a.open(\"GET\",e,!0),a.setRequestHeader(\"Content-type\",t),a.send()}}}},{key:\"_fillAndSave\",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:\"3.2.3\"}),!0,!1)}},{key:\"_getStorageModule\",value:function(){return this._m.getModule(so)}},{key:\"_fillMap\",value:function(e){this._map.clear();for(var t,n,o,a=e.split(\";\\n\"),i=a.length,s=new RegExp(/'/g),r=0;r0&&n.forEach((function(e){var n=t.getPayloadData(e);n&&t._handleActionType(n,e)}))}},{key:\"onMessageModified\",value:function(e){var t=this,n=this._signalingModule.filterMessageList(e);n.length>0&&n.forEach((function(e){var n=t.getPayloadData(e);n&&t._onInvitationModified(n,e)}))}},{key:\"getPayloadData\",value:function(e){var t=\"\".concat(this._n,\".getPayloadData\"),n=e.payload.data;try{return JSON.parse(n)}catch(o){return Je.e(\"\".concat(t,\" JSON parse error. signalingData:\").concat(n)),null}}},{key:\"_handleActionType\",value:function(e,t){switch(e.actionType){case N.ACTION_TYPE_INVITE:this._onNewInvitationReceived(e,t);break;case N.ACTION_TYPE_REJECT_INVITE:this._onInviteeRejected(e);break;case N.ACTION_TYPE_ACCEPT_INVITE:this._onInviteeAccepted(e);break;case N.ACTION_TYPE_CANCEL_INVITE:this._onInvitationCancelled(e);break;case N.ACTION_TYPE_INVITE_TIMEOUT:this._onInvitationTimeout(e)}}},{key:\"_createDefaultEmitData\",value:function(e){return{inviteID:e.inviteID,inviter:e.inviter,groupID:e.groupID,data:e.data||\"\"}}},{key:\"_onNewInvitationReceived\",value:function(e,n){var o=\"\".concat(this._n,\"._onNewInvitationReceived\"),a=e.inviteID,i=e.inviteeList,s=e.groupID,r=e.inviter,c=this._signalingModule.getMyUserID(),u=i.includes(c),l=Math.round(e.timeout-((new Date).getTime()-1e3*n.time)/1e3);if(Je.l(\"\".concat(o,\" myselfIncluded:\").concat(u,\" groupID:\").concat(s,\" timeout:\").concat(l,\"s signalObj:\").concat(JSON.stringify(e))),s&&u||!s){var d=this._signalingModule.getInviteInfo(a);if(d&&d===e)return;d||this._signalingModule.setInviteInfo(a,t(t({},e),{},{message:n})),this._signalingModule.emitEvent(N.NEW_INVITATION_RECEIVED,t(t({},this._createDefaultEmitData(e)),{},{inviteeList:i})),r!==c&&this._signalingModule.startTimer(t(t({},e),{},{timeout:l}))}}},{key:\"_onInviteeRejected\",value:function(e){var n=\"\".concat(this._n,\"._onInviteeRejected\"),o=e.inviteID,a=e.inviter,i=e.groupID,s=this._signalingModule.hasInviteInfo(o);Je.l(\"\".concat(n,\" inviteID:\").concat(o,\" hasInviteID:\").concat(s,\" inviter:\").concat(a,\" groupID:\").concat(i)),(i&&s||!i)&&(this._signalingModule.updateInviteInfo(e),this._signalingModule.emitEvent(N.INVITEE_REJECTED,t(t({},this._createDefaultEmitData(e)),{},{invitee:e.inviteeList[0]})))}},{key:\"_onInviteeAccepted\",value:function(e){var n=\"\".concat(this._n,\"._onInviteeAccepted\"),o=e.inviteID,a=e.inviter,i=e.groupID,s=this._signalingModule.hasInviteInfo(o);Je.l(\"\".concat(n,\" inviteID:\").concat(o,\" hasInviteID:\").concat(s,\" inviter:\").concat(a,\" groupID:\").concat(i)),(i&&s||!i)&&(this._signalingModule.updateInviteInfo(e),this._signalingModule.emitEvent(N.INVITEE_ACCEPTED,t(t({},this._createDefaultEmitData(e)),{},{invitee:e.inviteeList[0]})))}},{key:\"_onInvitationCancelled\",value:function(e){var t=\"\".concat(this._n,\"._onInvitationCancelled\"),n=e.inviteID,o=e.inviter,a=e.groupID,i=this._signalingModule.hasInviteInfo(n);Je.l(\"\".concat(t,\" inviteID:\").concat(n,\" hasInviteID:\").concat(i,\" inviter:\").concat(o,\" groupID:\").concat(a)),(a&&i||!a)&&(this._signalingModule.deleteInviteInfo(n),this._signalingModule.emitEvent(N.INVITATION_CANCELLED,this._createDefaultEmitData(e)))}},{key:\"_onInvitationTimeout\",value:function(e){var n=\"\".concat(this._n,\"._onInvitationTimeout\"),o=e.inviteID,a=e.inviter,i=e.groupID,s=e.inviteeList,r=this._signalingModule.hasInviteInfo(o);Je.l(\"\".concat(n,\" inviteID:\").concat(o,\" hasInviteID:\").concat(r,\" inviter:\").concat(a,\" groupID:\").concat(i,\" data:\").concat(e.data)),(i&&r||!i)&&(this._signalingModule.updateInviteInfo(e),this._signalingModule.emitEvent(N.INVITATION_TIMEOUT,t(t({},this._createDefaultEmitData(e)),{},{inviteeList:s,isSelfTimeout:!1})))}},{key:\"_onInvitationModified\",value:function(e,n){var o=\"\".concat(this._n,\"._onInvitationModified\"),a=e.inviteID,i=e.data;Je.l(\"\".concat(o,\" inviteID:\").concat(a,\" data:\").concat(i)),this._signalingModule.setInviteInfo(a,t(t({},e),{},{message:n})),this._signalingModule.emitEvent(N.INVITATION_MODIFIED,{inviteID:a,data:i})}}]),e}(),qs=function(e){if(e<0||e>53)return NaN;var t=0|1073741824*Math.random();return e>30?t+1073741824*(0|Math.random()*(1<>>30-e},xs=function(e,t){for(var n=e.toString(16),o=t-n.length,a=\"0\";o>0;o>>>=1,a+=a)1&o&&(n=a+n);return n},Vs=function(){function e(t){o(this,e),this._n=\"LocalSignalingHandler\",this._signalingModule=t}return i(e,[{key:\"generateInviteID\",value:function(){var e,t,n=(t=xs)((e=qs)(32),8)+\"-\"+t(e(16),4)+\"-\"+t(16384|e(12),4)+\"-\"+t(32768|e(14),4)+\"-\"+t(e(48),12);return Je.l(\"\".concat(this._n,\".generateInviteID inviteID:\").concat(n)),n}},{key:\"createInviteInfo\",value:function(e){var n=this.generateInviteID(),o=this.createInviteCustomData(t(t({},e),{},{inviteID:n})),a=o.groupID,i=o.inviteeList,s=a||i[0];return{customData:o,message:this.createSignalingMessage(o,s),inviteID:n}}},{key:\"_createDefaultCustomData\",value:function(e){var t=e.data,n=void 0===t?\"\":t,o=e.inviteID,a=void 0===o?\"\":o,i=e.groupID;return{businessID:1,timeout:0,data:n,inviteID:a,groupID:void 0===i?\"\":i}}},{key:\"createInviteCustomData\",value:function(e){var n=e.userID,o=e.timeout,a=void 0===o?0:o,i=e.groupID,s=void 0===i?\"\":i,r=this._signalingModule.getMyUserID(),c=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_INVITE,inviter:r,inviteeList:s?e.inviteeList:[n],timeout:a});return Je.l(\"\".concat(this._n,\".createInviteCustomData customData:\").concat(JSON.stringify(c))),c}},{key:\"createCancelCustomData\",value:function(e){var n,o=\"\".concat(this._n,\".createCancelCustomData\"),a=e.inviteID,i=this._signalingModule.getMyUserID(),s=this._signalingModule.getInviteInfo(a),r=s.inviteeList,c=s.groupID,u=s.inviter;return u===i?n=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_CANCEL_INVITE,groupID:c,inviter:i,inviteeList:r}):Je.e(\"\".concat(o,\" unmatched inviter:\").concat(u,\" and my userID:\").concat(i)),Je.l(\"\".concat(o,\" customData:\").concat(JSON.stringify(n))),n}},{key:\"createAcceptCustomData\",value:function(e){var n,o=\"\".concat(this._n,\".createAcceptCustomData\"),a=e.inviteID,i=this._signalingModule.getMyUserID(),s=this._signalingModule.getInviteInfo(a),r=s.inviter,c=s.groupID;return s.inviteeList.includes(i)?n=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_ACCEPT_INVITE,groupID:c,inviter:r,inviteeList:[i]}):Je.e(\"\".concat(o,\" userID:\").concat(i,\" not in inviteeList. inviteID:\").concat(a,\" groupID:\").concat(c)),Je.l(\"\".concat(o,\" customData:\").concat(JSON.stringify(n))),n}},{key:\"createRejectCustomData\",value:function(e){var n,o=\"\".concat(this._n,\".createRejectCustomData\"),a=e.inviteID,i=this._signalingModule.getMyUserID(),s=this._signalingModule.getInviteInfo(a),r=s.inviter,c=s.groupID;return s.inviteeList.includes(i)?n=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_REJECT_INVITE,groupID:c,inviter:r,inviteeList:[i]}):Je.e(\"\".concat(o,\" userID:\").concat(i,\" not in inviteeList. inviteID:\").concat(a,\" groupID:\").concat(c)),Je.l(\"\".concat(o,\" customData:\").concat(JSON.stringify(n))),n}},{key:\"createTimeoutCustomData\",value:function(e){var n=\"\".concat(this._n,\".createTimeoutCustomData\"),o=e.inviteeList,a=e.inviter,i=e.isInviter,s=void 0!==i&&i,r=this._signalingModule.getMyUserID(),c=t(t({},this._createDefaultCustomData(e)),{},{actionType:N.ACTION_TYPE_INVITE_TIMEOUT,inviter:a,inviteeList:s?o:[r]});return Je.l(\"\".concat(n,\" customData:\").concat(JSON.stringify(c))),c}},{key:\"createSignalingMessage\",value:function(e,t){var n=e.groupID,o=e.inviter,a=this._signalingModule.getModule(Qn),i={to:t||n||o,conversationType:n?S.CONV_GROUP:S.CONV_C2C,priority:S.MSG_PRIORITY_HIGH,payload:{data:JSON.stringify(e)}},s=a.createCustomMessage(i);return Je.d(\"\".concat(this._n,\".createSignalingMessage. message:\").concat(JSON.stringify(s))),s}}]),e}(),Hs=function(){function e(t){o(this,e),this._n=\"HistorySignalingHandler\",this._signalingModule=t,this.EXPIRED_TIME=3e4,this.COUNT=20,this._signalingMap=new Map,this._signalingRelatedToMeMap=new Map}return i(e,[{key:\"getHistorySignaling\",value:function(){var e=this,t=this._signalingModule.getModule(ao).getLocalConversationList();pn(t)||this._getSignalingList(t).then((function(t){e._handleSignalingList(t)}))}},{key:\"_getSignalingList\",value:function(e){var t=this,n=this._getValidConversationList(e),o=this._createPromiseList(n);return pn(o)?Promise.resolve([]):this._concurrentGetMessageList(o).then((function(e){var n=new Map;return e.forEach((function(e){var o=e.signalingList,a=t._getSignalingRelatedToMeMap(o);n=new Map([].concat(m(n),m(a)))})),t._sortSignaling(n)}))}},{key:\"_handleSignalingList\",value:function(e){pn(e)||(Je.d(\"\".concat(this._n,\"._handleSignalingList signalingList:\").concat(JSON.stringify(e))),this._signalingModule.onNewMessageList(e))}},{key:\"_isSignalingNotExpired\",value:function(e,t){return e[t]&&1e3*e[t]>(new Date).getTime()-this.EXPIRED_TIME}},{key:\"_getValidConversationList\",value:function(e){for(var t=[],n=0;n0&&r&&t.push(e[n])}return t}},{key:\"_createPromiseList\",value:function(e){for(var t=[],n=0;n0?t._concurrentGetMessageList(n):t._signalingMap}))}},{key:\"_relayGetMessageList\",value:function(e){var t=e.messageList,n=e.nextReqMessageID,o=e.isCompleted,a=t.length;if(0===a)return null;var i=t[0],s=i.conversationID,r=i.conversationType,c=this._signalingMap.get(s).needMessageCount,u=r===S.CONV_GROUP,l=0===c||o,d=this._isSignalingNotExpired(t[a-1],\"time\");return u||l||!d?null:this._signalingModule.getModule(ao).getMessageList({conversationID:s,nextReqMessageID:n,count:c})}},{key:\"_handleMessageList\",value:function(e){for(var t=e.length,n=e[0].conversationID,o=this._signalingMap.get(n),a=o.needMessageCount,i=o.signalingList,s=a-t>0?a-t:0,r=[],c=0;c0&&void 0!==arguments[0]?arguments[0]:{},t=e.data,n=void 0===t?\"\":t,o=e.onlineUserOnly,a=e.inviteID,i=void 0===a?\"\":a,s=e.offlinePushInfo,r=e.actionType,c={_onlineOnlyFlag:!1};i&&this.getInviteInfo(i)&&(c=this.getInviteInfo(i).message);var u={onlineUserOnly:c._onlineOnlyFlag||o||!1,offlinePushInfo:s,messageControlInfo:{excludedFromContentModeration:!0,excludedFromUnreadCount:!1,excludedFromLastMessage:!1}};if(r===N.ACTION_TYPE_INVITE_TIMEOUT){var l=!!n.match(/excludeTimeoutSignalingFromHistoryMessage/);return u.messageControlInfo.excludedFromUnreadCount=l,u.messageControlInfo.excludedFromLastMessage=l,u}var d=!!n.match(/excludeFromHistoryMessage/),p=!!n.match(/excludeOriginalSignalingFromHistoryMessage/);return u.messageControlInfo.excludedFromUnreadCount=d||p,u.messageControlInfo.excludedFromLastMessage=d||p,u}},{key:\"sendSignaling\",value:function(e,t){var n=this;return this.getModule(Qn).sendMessageInstance(e,this._genMessageControlInfo(t)).catch((function(e){return n._isHandling=!1,Go(e)}))}},{key:\"filterMessageList\",value:function(e){var t=this;return e.filter((function(e){return t._filterSignalingMessage(e)}))}},{key:\"_filterSignalingMessage\",value:function(e){var t=!1;if(e.type&&e.type===S.MSG_CUSTOM){var n=e.cloudCustomData,o=void 0===n?\"\":n,a=e.payload.data,i=void 0===a?\"\":a,s=o.match(/\"type\":\"tsignaling\"/),r=i.match(/inviteID/),c=i.match(/actionType/);t=s||r&&c}return!!t}},{key:\"startTimer\",value:function(e){var t=this,n=\"\".concat(this._n,\".startTimer\"),o=e.timeout,a=e.inviteID,i=e.inviter,s=e.groupID,r=i===this.getMyUserID();if(Je.l(\"\".concat(n,\" timeout:\").concat(o,\" isInviter:\").concat(r,\" groupID:\").concat(s)),!(o<=0))var c=r?o+5:o,u=1,l=setInterval((function(){var o=t._hasLocalInviteInfo(e,r);u0:i.length>0&&i.includes(this.getMyUserID()))}},{key:\"_getReceiver\",value:function(e,t){var n=t.groupID,o=t.inviteeList,a=t.inviter;return e?n||o[0]:n||a}},{key:\"_sendTimeoutNotice\",value:function(e,n){var o=this,a=this.getInviteInfo(e),i=this._getReceiver(n,a);Je.l(\"\".concat(this._n,\"._sendTimeoutNotice inviteID:\").concat(e,\" to:\").concat(i,\" isInviter:\").concat(n));var s=this._localSignalingHandler.createTimeoutCustomData(t(t({},a),{},{isInviter:n})),r=this._localSignalingHandler.createSignalingMessage(s,i);return this.sendSignaling(r,s).then((function(t){if(t&&0===t.code){var a=s.data,i=s.groupID,c=s.inviteeList,u=s.inviter;o.emitEvent(N.INVITATION_TIMEOUT,{data:a,groupID:i,inviteID:e,inviteeList:c,inviter:u,isSelfTimeout:!0,message:r}),n?o.deleteInviteInfo(e):o.updateInviteInfo(s)}}))}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._inviteInfoMap.clear(),this._canIUseSignaling=!1,this._isHandling=!1,this._historySignalingHandler.reset(),this._isC2CUnreadHandleCompleted=!1,this._isConvSyncCompleted=!1,this._isSyncCompleted=!1}}]),a}(Po),js=function(){function e(t){var n=this;o(this,e);var a,i=new Xo(\"sdkConstruct\");(this._n=\"ModuleManager\",this._isReady=!1,this._reason=Ao.USER_NOT_LOGGED_IN,this._startLoginTs=0,this._moduleMap=new Map,this._innerEmitter=null,this._outerEmitter=null,this._checkCount=0,this._checkTimer=-1,this._moduleMap.set(io,new di(this,t)),this._moduleMap.set(Mo,new Gs(this)),this._moduleMap.set(ho,new vs(this)),this._moduleMap.set(fo,new Rs(this)),this._moduleMap.set(mo,new Cs(this)),this._moduleMap.set(go,new as(this)),this._moduleMap.set(_o,new fs(this)),this._moduleMap.set(Xn,new _i(this)),this._moduleMap.set(Qn,new Pi(this)),this._moduleMap.set(Zn,new Ui(this)),this._moduleMap.set(So,new bi(this)),this._moduleMap.set(Co,new wi(this)),this._moduleMap.set($n,new li(this)),this._moduleMap.set(eo,new _a(this)),this._moduleMap.set(ao,new Oa(this)),this._moduleMap.set(to,new ei(this)),this._moduleMap.set(oo,new ai(this)),this._moduleMap.set(so,new hi(this)),this._moduleMap.set(Do,new ws(this)),this._moduleMap.set(ro,new mi(this)),this._moduleMap.set(co,new Ti(this)),this._moduleMap.set(uo,new Ni(this)),this._moduleMap.set(lo,new Fi(this)),this._moduleMap.set(po,new qi(this)),this._moduleMap.set(vo,new ms(this)),this._moduleMap.set(no,new Ls(this)),this._moduleMap.set(Io,new Ps(this)),this._moduleMap.set(yo,new Us(this)),this._moduleMap.set(To,new bs(this)),this._moduleMap.set(Eo,new Ws(this)),this._eventThrottleMap=new Map,ft(t.modules))?(Object.keys(t.modules).forEach((function(e){a=t.modules[e],\"group-module\"===e?n._moduleMap.set(to,new a(n)):\"relationship-module\"===e?n._moduleMap.set(no,new a(n)):\"signaling-module\"===e&&n._moduleMap.set(Eo,new a(n))})),this._moduleMap.get(io).setUsingChatCore(!0)):this._moduleMap.has(to)||this._moduleMap.get(io).setUsingChatCore(!0);var s=t.instanceID,r=t.SDKAppID,c=this._moduleMap.get(io).isIntl(),u=this._moduleMap.get(io).isUsingChatCore(),l=\"instanceID:\".concat(s,\" SDKAppID:\").concat(r,\" isIntl:\").concat(c,\" isUsingChatCore:\").concat(u,\" host:\").concat(Yt(),\" isIOSWebView:\").concat(be)+\" inBrowser:\".concat(ue,\" inMiniApp:\").concat(ce)+\" workerAvailable:\".concat(Ge,\" UserAgent:\").concat(de);Xo.bindEventStatModule(this._moduleMap.get(ro)),i.setMessage(\"\".concat(l,\" \").concat(function(){var e=\"\";if(ce)try{var t=le.getSystemInfoSync(),n=t.model,o=t.version,a=t.system,i=t.platform,s=t.SDKVersion;e=\"model:\".concat(n,\" version:\").concat(o,\" system:\").concat(a,\" platform:\").concat(i,\" SDKVersion:\").concat(s)}catch(r){e=\"\"}return e}())).end(),Je.i(\"SDK \".concat(l)),ko.prototype._getErrorMessage=this.getErrorMessage.bind(this),this._readyList=void 0,this._ssoLogForReady=null,this._initReadyList()}return i(e,[{key:\"_startTimer\",value:function(){var e=this._moduleMap.get(fo),t=e.isWorkerEnabled();Je.l(\"\".concat(this._n,\".startTimer isWorkerEnabled:\").concat(t,\" seed:\").concat(this._checkTimer)),t?e.startWorkerTimer():this._startMainThreadTimer()}},{key:\"_startMainThreadTimer\",value:function(){this._checkTimer<0&&(this._checkTimer=setInterval(this.onCheckTimer.bind(this),1e3)),Je.l(\"\".concat(this._n,\"._startMainThreadTimer seed:\").concat(this._checkTimer))}},{key:\"stopTimer\",value:function(){var e=this._moduleMap.get(fo),t=e.isWorkerEnabled();Je.l(\"\".concat(this._n,\".stopTimer isWorkerEnabled:\").concat(t,\" seed:\").concat(this._checkTimer)),t?e.stopWorkerTimer():this._stopMainThreadTimer()}},{key:\"_stopMainThreadTimer\",value:function(){Je.l(\"\".concat(this._n,\"._stopMainThreadTimer\")),this._checkTimer>0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:\"_stopMainThreadSocket\",value:function(){Je.l(\"\".concat(this._n,\"._stopMainThreadSocket\"));var e=this._moduleMap.get(go);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:\"_startMainThreadSocket\",value:function(){Je.l(\"\".concat(this._n,\"._startMainThreadSocket\"));var e=this._moduleMap.get(go);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:\"onWorkerTimerEnabled\",value:function(){Je.l(\"\".concat(this._n,\".onWorkerTimerEnabled, disable main thread timer and socket\")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:\"onWorkerTimerDisabled\",value:function(){Je.l(\"\".concat(this._n,\".onWorkerTimerDisabled, enable main thread timer and socket\")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:\"onCheckTimer\",value:function(){this._checkCount+=1;var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(o){t.e(o)}finally{t.f()}}},{key:\"_initReadyList\",value:function(){var e=this;this._readyList=[this._moduleMap.get(Xn)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:\"_onModuleReady\",value:function(){var e=!0;if(this._readyList.forEach((function(t){t.isReady()||(e=!1)})),e&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(E.SDK_READY);var t=Date.now()-this._startLoginTs;Je.w(\"SDK is ready. cost \".concat(t,\" ms\")),this._startLoginTs=Date.now();var n=this._moduleMap.get(co).getNetworkType(),o=this._ssoLogForReady.getStartTs()+Ve;this._ssoLogForReady.setNetworkType(n).setMessage(t).start(o).end()}}},{key:\"login\",value:function(){0===this._startLoginTs&&(Be(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(co).start(),this._ssoLogForReady=new Xo(\"sdkReady\"),this._reason=Ao.LOGGING_IN)}},{key:\"onLoginFailed\",value:function(){this._startLoginTs=0}},{key:\"getOuterEmitterInstance\",value:function(){return null===this._outerEmitter&&(this._outerEmitter=new Ci,Ro(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(e,t){var n=this;if(this._canIUseSignaling()){if(e===E.MESSAGE_RECEIVED){var o=this.getModule(Eo);o.onNewMessageList(t)}if(e===E.MESSAGE_MODIFIED){var a=this.getModule(Eo);a.onMessageModified(t)}}if(e===E.CONVERSATION_LIST_UPDATED||e===E.FRIEND_LIST_UPDATED||e===E.GROUP_LIST_UPDATED||e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)if(this._eventThrottleMap.has(e)){var i=Date.now(),s=this._eventThrottleMap.get(e);i-s.last<=1e3?(s.timeoutID&&clearTimeout(s.timeoutID),s.timeoutID=setTimeout((function(){s.last=Date.now(),n._outerEmitter._emit.apply(n._outerEmitter,[e,{name:e,data:n._getEventData(e)}])}),1e3)):(s.last=i,this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]))}else this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:arguments[1]}])}.bind(this)),this._outerEmitter}},{key:\"_canIUseSignaling\",value:function(){var e=this.getModule(Eo);return!!e&&e.canIUseSignaling()}},{key:\"_getEventData\",value:function(e){return e===E.CONVERSATION_LIST_UPDATED?this._moduleMap.get(ao).getLocalConversationList():e===E.FRIEND_LIST_UPDATED?this._moduleMap.get(no).getLocalFriendList(!1):e===E.GROUP_LIST_UPDATED?this._moduleMap.get(to).getLocalGroupList():e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(ao).getTotalUnreadMessageCount():void 0}},{key:\"getInnerEmitterInstance\",value:function(){return null===this._innerEmitter&&(this._innerEmitter=new Ci,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(e,t){var n;n=ft(arguments[1])&&arguments[1].data?[e,{name:arguments[0],data:arguments[1].data}]:[e,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,n)}.bind(this)),this._innerEmitter}},{key:\"hasModule\",value:function(e){return this._moduleMap.has(e)}},{key:\"getModule\",value:function(e){return this._moduleMap.get(e)}},{key:\"isReady\",value:function(){return this._isReady}},{key:\"isIntl\",value:function(){return this.getModule(io).isIntl()}},{key:\"getNotReadyReason\",value:function(){return this._reason}},{key:\"setNotReadyReason\",value:function(e){this._reason=e}},{key:\"getErrorMessage\",value:function(e,t,n){return this._moduleMap.get(Do).get({key:e,replacement1:t,replacement2:n,isIntl:this.isIntl()})}},{key:\"outputWarning\",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&Je.w(o)}},{key:\"onError\",value:function(e){var t=\"code:\".concat(e.code,\" message:\").concat(e.message);Je.w(\"Oops! \".concat(t)),new Xo(\"error\").setMessage(t).setNetworkType(this.getModule(co).getNetworkType()).setLevel(\"error\").end(),this.getOuterEmitterInstance().emit(E.ERROR,e)}},{key:\"restartTimer\",value:function(){Je.l(\"\".concat(this._n,\".restartTimer\")),this.stopTimer(),this._startTimer();var e=this.getModule(to);e&&e.restartPolling()}},{key:\"getTimerID\",value:function(){var e=this._moduleMap.get(fo);return e.isWorkerEnabled()?e.getTimerID():this._checkTimer}},{key:\"getPollingTimerID\",value:function(e){return this._moduleMap.get(to).getPollingTimerID(e)}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),Be();var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.reset&&n.reset()}}catch(s){t.e(s)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(E.SDK_NOT_READY);var o,a=D(this._eventThrottleMap);try{for(a.s();!(o=a.n()).done;){var i=v(o.value,2)[1];i.timeoutID&&clearTimeout(i.timeoutID)}}catch(s){a.e(s)}finally{a.f()}this._eventThrottleMap.clear()}}]),e}(),Js=function(){function e(t){o(this,e),this._funcMap=new Map,this._m=t,this._n=\"SafetyCallback\",this._reportCount=0}return i(e,[{key:\"defense\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(\"string\"!=typeof e)return null;if(0===e.length)return null;if(\"function\"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:\"defenseOnce\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return\"function\"!=typeof t?null:this._pack(e,t,n)}},{key:\"find\",value:function(e,t){return\"string\"!=typeof e||0===e.length||\"function\"!=typeof t?null:this._funcMap.has(e)&&this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(this._m.outputWarning(\"ListenerFnNotFound\",e),null)}},{key:\"delete\",value:function(e,t){return\"function\"==typeof t&&(!!this._funcMap.has(e)&&(!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)))}},{key:\"_pack\",value:function(e,t,n){var o=this;return function(){try{t.apply(n,Array.from(arguments))}catch(c){var a=Object.values(E).indexOf(e),i=\"CallbackError\";if(-1!==a){var s=Object.keys(E)[a];o._m.outputWarning(i,s,c)}if(o._reportCount<5){var r=new Xo(i);r.setMessage(\"eventName:\".concat(e)).setMoreMessage(c.message).end(),o._reportCount+=1}}}}},{key:\"destroy\",value:function(){this._funcMap.clear()}},{key:\"reset\",value:function(){Je.l(\"\".concat(this._n,\".reset\")),this._reportCount=0}}]),e}(),zs=function(){function e(t){o(this,e);var n={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||\"\",oversea:t.oversea||!1,instanceID:Kt(),devMode:t.devMode||!1,proxyServer:t.proxyServer||void 0,fileUploadProxy:t.fileUploadProxy||void 0,fileDownloadProxy:t.fileDownloadProxy||t.fileUploadProxy||void 0,modules:t.modules||void 0};this._m=new js(n),this._vendorMap=new Map,this._safetyCallbackFactory=new Js(this._m)}return i(e,[{key:\"onError\",value:function(e){this._m.onError(e)}},{key:\"login\",value:function(e){return this._m.login(),this._getModule(Xn).login(e)}},{key:\"logout\",value:function(){var e=this;return this._getModule(Xn).logout().then((function(t){return e._safetyCallbackFactory.reset(),e._m.reset(),t}))}},{key:\"getLoginUser\",value:function(){return this._getModule(Xn).getLoginUser()}},{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:\"getErrorMessage\",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:\"_getModule\",value:function(e){return this._m.getModule(e)}},{key:\"destroy\",value:function(){var e=this;return this.logout().finally((function(){e._safetyCallbackFactory.destroy(),e._m.stopTimer(),e._getModule(fo).terminate(),e._getModule(go).dealloc();var t=e._m.getOuterEmitterInstance(),n=e._getModule(io);t.emit(E.SDK_DESTROY,{SDKAppID:n.getSDKAppID()})}))}},{key:\"on\",value:function(e,t,n){Je.d(\"on\",\"eventName:\".concat(e)),this._m.getOuterEmitterInstance().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:\"once\",value:function(e,t,n){Je.d(\"once\",\"eventName:\".concat(e)),this._m.getOuterEmitterInstance().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:\"off\",value:function(e,t,n,o){Je.d(\"off\",\"eventName:\".concat(e));var a=this._safetyCallbackFactory.find(e,t);null!==a&&(this._m.getOuterEmitterInstance().off(e,a,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:\"registerPlugin\",value:function(e){mt(e[\"tim-offline-push-plugin\"])?this._getModule(lo).registerPlugin(e):this._getModule(Io).registerPlugin(e)}},{key:\"setLogLevel\",value:function(e){if(e<=0){var t=this.getErrorMessage(\"TIM_ASCII_ART\");t&&console.log(t);var n=this.getErrorMessage(\"API_REFER\");if(n){on()?console.log(\"%c \".concat(\"IM SDK API ->\",\" %c\"),\"background:#ff9d00; padding:1px; border-radius:3px; color: #fff\",\"background:transparent\",n):console.log(\"IM SDK API ->\",n)}var o=this.getErrorMessage(\"DOCS_GUIDE\");o&&console.log(o);var a=this.getErrorMessage(\"IOS_WEBVIEW_WARNING\");be&&a&&console.warn(a)}Je.setLevel(e)}},{key:\"createTextMessage\",value:function(e){return this._getModule(Qn).createTextMessage(e)}},{key:\"createTextAtMessage\",value:function(e){return this._getModule(Qn).createTextMessage(e)}},{key:\"createImageMessage\",value:function(e){return this._getModule(Qn).createImageMessage(e)}},{key:\"createAudioMessage\",value:function(e){return this._getModule(Qn).createAudioMessage(e)}},{key:\"createVideoMessage\",value:function(e){return this._getModule(Qn).createVideoMessage(e)}},{key:\"createCustomMessage\",value:function(e){return this._getModule(Qn).createCustomMessage(e)}},{key:\"createFaceMessage\",value:function(e){return this._getModule(Qn).createFaceMessage(e)}},{key:\"createFileMessage\",value:function(e){return this._getModule(Qn).createFileMessage(e)}},{key:\"createLocationMessage\",value:function(e){return this._getModule(Qn).createLocationMessage(e)}},{key:\"createMergerMessage\",value:function(e){return this._getModule(Qn).createMergerMessage(e)}},{key:\"downloadMergerMessage\",value:function(e){return e.type!==S.MSG_MERGER?Go({code:Ao.MSG_MERGER_TYPE_INVALID}):pn(e.payload.downloadKey)?Go({code:Ao.MSG_MERGER_KEY_INVALID}):this._getModule(Qn).downloadMergerMessage(e).catch((function(e){return Go({code:Ao.MSG_MERGER_DOWNLOAD_FAIL})}))}},{key:\"createForwardMessage\",value:function(e){return this._getModule(Qn).createForwardMessage(e)}},{key:\"sendMessage\",value:function(e,t){return e instanceof pa?this._getModule(Qn).sendMessageInstance(e,t):Go({code:Ao.MSG_INSTANCE_REQUIRED})}},{key:\"searchCloudMessages\",value:function(e){return this._getModule(Qn).searchCloudMessages(e)}},{key:\"callExperimentalAPI\",value:function(e,t){return\"sendComboMessage\"===e?this._getModule(Co).sendMessage(t):\"handleGroupInvitation\"===e?this._getModule(to).handleGroupInvitation(t):\"isCommercialAbilityEnabled\"===e?this._getModule(Mo).isFeatureEnabled(t):\"isIntl\"===e?this.isIntl():\"sendTRTCCustomData\"===e||\"sendRoomCustomData\"===e?this._getModule(To).sendTRTCCustomData(t):\"getTimerID\"===e?this._m.getTimerID():\"getPollingTimerID\"===e?this._m.getPollingTimerID(t):\"setApplicationID\"===e?(this._getModule(io).setApplicationID(t),void this._getModule(_o).updateProtocolConfig()):\"getServerConfig\"===e?this._getModule(ho).getServerConfig(t):Go({code:Ao.INVALID_OPERATION})}},{key:\"revokeMessage\",value:function(e){return this._getModule(Qn).revokeMessage(e)}},{key:\"resendMessage\",value:function(e,t){return e instanceof pa?this._getModule(Qn).resendMessage(e,t):Go({code:Ao.MSG_INSTANCE_REQUIRED})}},{key:\"deleteMessage\",value:function(e){return this._getModule(Qn).deleteMessage(e)}},{key:\"translateText\",value:function(e){return this._getModule(Qn).translateText(e)}},{key:\"convertVoiceToText\",value:function(e){return this._getModule(Qn).convertVoiceToText(e)}},{key:\"setMessageExtensions\",value:function(e,t){return this._getModule(Zn).setMessageExtensions(e,t)}},{key:\"getMessageExtensions\",value:function(e){return this._getModule(Zn).getMessageExtensions(e)}},{key:\"deleteMessageExtensions\",value:function(e,t){return this._getModule(Zn).deleteMessageExtensions(e,t)}},{key:\"addMessageReaction\",value:function(e,t){return this._getModule(So).addMessageReaction(e,t)}},{key:\"removeMessageReaction\",value:function(e,t){return this._getModule(So).removeMessageReaction(e,t)}},{key:\"getMessageReactions\",value:function(e){return this._getModule(So).getMessageReactions(e)}},{key:\"getAllUserListOfMessageReaction\",value:function(e){return this._getModule(So).getAllUserListOfMessageReaction(e)}},{key:\"modifyMessage\",value:function(e){return this._getModule(Qn).modifyRemoteMessage(e)}},{key:\"getMessageList\",value:function(e){return this._getModule(ao).getMessageList(e)}},{key:\"getMessageListHopping\",value:function(e){return this._getModule(ao).getMessageListHopping(e)}},{key:\"sendMessageReadReceipt\",value:function(e){return this._getModule(ao).sendReadReceipt(e)}},{key:\"getMessageReadReceiptList\",value:function(e){return this._getModule(ao).getReadReceiptList(e)}},{key:\"getGroupMessageReadMemberList\",value:function(e){var t=this._getModule(to);return t?t.getReadReceiptDetail(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"findMessage\",value:function(e){return this._getModule(ao).findMessage(e)}},{key:\"setMessageRead\",value:function(e){return this._getModule(ao).setMessageRead(e)}},{key:\"getConversationList\",value:function(e){return this._getModule(ao).getConversationList(e)}},{key:\"getConversationProfile\",value:function(e){return this._getModule(ao).getConversationProfile(e)}},{key:\"deleteConversation\",value:function(e){return this._getModule(ao).deleteConversation(e)}},{key:\"setConversationDraft\",value:function(e){return this._getModule(ao).setConversationDraft(e)}},{key:\"clearHistoryMessage\",value:function(e){return this._getModule(ao).clearHistoryMessage(e)}},{key:\"pinConversation\",value:function(e){return this._getModule(ao).pinConversation(e)}},{key:\"setAllMessageRead\",value:function(e){return this._getModule(ao).setAllMessageRead(e)}},{key:\"setMessageRemindType\",value:function(e){return this._getModule(ao).setMessageRemindType(e)}},{key:\"getTotalUnreadMessageCount\",value:function(){return this._getModule(ao).getTotalUnreadMessageCount()}},{key:\"setConversationCustomData\",value:function(e){return this._getModule(ao).setConversationCustomData(e)}},{key:\"markConversation\",value:function(e){return this._getModule(ao).markConversation(e)}},{key:\"getConversationGroupList\",value:function(){return this._getModule(ao).getConversationGroupList()}},{key:\"createConversationGroup\",value:function(e){return this._getModule(ao).createConversationGroup(e)}},{key:\"deleteConversationGroup\",value:function(e){return this._getModule(ao).deleteConversationGroup(e)}},{key:\"renameConversationGroup\",value:function(e){return this._getModule(ao).renameConversationGroup(e)}},{key:\"addConversationsToGroup\",value:function(e){return this._getModule(ao).addConversationsToGroup(e)}},{key:\"deleteConversationsFromGroup\",value:function(e){return this._getModule(ao).deleteConversationsFromGroup(e)}},{key:\"getMyProfile\",value:function(){return this._getModule($n).getMyProfile()}},{key:\"getUserProfile\",value:function(e){return this._getModule($n).getUserProfile(e)}},{key:\"updateMyProfile\",value:function(e){return this._getModule($n).updateMyProfile(e)}},{key:\"getBlacklist\",value:function(){return this._getModule($n).getLocalBlacklist()}},{key:\"addToBlacklist\",value:function(e){return this._getModule($n).addBlacklist(e)}},{key:\"removeFromBlacklist\",value:function(e){return this._getModule($n).deleteBlacklist(e)}},{key:\"setSelfStatus\",value:function(e){return this._getModule($n).setSelfStatus(e)}},{key:\"getUserStatus\",value:function(e){return this._getModule($n).getUserStatus(e)}},{key:\"subscribeUserStatus\",value:function(e){return this._getModule($n).subscribeUserStatus(e)}},{key:\"unsubscribeUserStatus\",value:function(e){return this._getModule($n).unsubscribeUserStatus(e)}},{key:\"getFriendList\",value:function(){var e=this._getModule(no);return e?e.getLocalFriendList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"addFriend\",value:function(e){var t=this._getModule(no);return t?t.addFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"deleteFriend\",value:function(e){var t=this._getModule(no);return t?t.deleteFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"checkFriend\",value:function(e){var t=this._getModule(no);return t?t.checkFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getFriendProfile\",value:function(e){var t=this._getModule(no);return t?t.getFriendProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"updateFriend\",value:function(e){var t=this._getModule(no);return t?t.updateFriend(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getFriendApplicationList\",value:function(){var e=this._getModule(no);return e?e.getLocalFriendApplicationList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"acceptFriendApplication\",value:function(e){var t=this._getModule(no);return t?t.acceptFriendApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"refuseFriendApplication\",value:function(e){var t=this._getModule(no);return t?t.refuseFriendApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"deleteFriendApplication\",value:function(e){var t=this._getModule(no);return t?t.deleteFriendApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setFriendApplicationRead\",value:function(){var e=this._getModule(no);return e?e.setFriendApplicationRead():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getFriendGroupList\",value:function(){var e=this._getModule(no);return e?e.getLocalFriendGroupList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"createFriendGroup\",value:function(e){var t=this._getModule(no);return t?t.createFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"deleteFriendGroup\",value:function(e){var t=this._getModule(no);return t?t.deleteFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"addToFriendGroup\",value:function(e){var t=this._getModule(no);return t?t.addToFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"removeFromFriendGroup\",value:function(e){var t=this._getModule(no);return t?t.removeFromFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"renameFriendGroup\",value:function(e){var t=this._getModule(no);return t?t.renameFriendGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupList\",value:function(){var e=this._getModule(to);return e?e.getGroupList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupProfile\",value:function(e){var t=this._getModule(to);return t?t.getGroupProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"createGroup\",value:function(e){var t=this._getModule(to);return t?t.createGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"dismissGroup\",value:function(e){var t=this._getModule(to);return t?t.dismissGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"updateGroupProfile\",value:function(e){var t=this._getModule(to);return t?t.updateGroupProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"joinGroup\",value:function(e){var t=this._getModule(to);return t?t.joinGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"quitGroup\",value:function(e){var t=this._getModule(to);return t?t.quitGroup(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"searchGroupByID\",value:function(e){var t=this._getModule(to);return t?t.searchGroupByID(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupOnlineMemberCount\",value:function(e){var t=this._getModule(to);return t?t.getGroupOnlineMemberCount(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"changeGroupOwner\",value:function(e){var t=this._getModule(to);return t?t.changeGroupOwner(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupApplicationList\",value:function(){var e=this._getModule(to);return e?e.getGroupApplicationList():Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"handleGroupApplication\",value:function(e){var t=this._getModule(to);return t?t.handleGroupApplication(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"initGroupAttributes\",value:function(e){var t=this._getModule(to);return t?t.initGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setGroupAttributes\",value:function(e){var t=this._getModule(to);return t?t.setGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"deleteGroupAttributes\",value:function(e){var t=this._getModule(to);return t?t.deleteGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupAttributes\",value:function(e){var t=this._getModule(to);return t?t.getGroupAttributes(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setGroupCounters\",value:function(e){var t=this._getModule(to);return t?t.setGroupCounters(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"increaseGroupCounter\",value:function(e){var t=this._getModule(to);return t?t.increaseGroupCounter(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"decreaseGroupCounter\",value:function(e){var t=this._getModule(to);return t?t.decreaseGroupCounter(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupCounters\",value:function(e){var t=this._getModule(to);return t?t.getGroupCounters(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupMemberList\",value:function(e){var t=this._getModule(to);return t?t.getGroupMemberList(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getGroupMemberProfile\",value:function(e){var t=this._getModule(to);return t?t.getGroupMemberProfile(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"addGroupMember\",value:function(e){var t=this._getModule(to);return t?t.addGroupMember(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"deleteGroupMember\",value:function(e){var t=this._getModule(to);return t?t.deleteGroupMember(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setGroupMemberMuteTime\",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberMuteTime(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setGroupMemberRole\",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberRole(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setGroupMemberNameCard\",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberNameCard(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"setGroupMemberCustomField\",value:function(e){var t=this._getModule(to);return t?t.setGroupMemberCustomField(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"markGroupMemberList\",value:function(e){var t=this._getModule(to);return t?t.markGroupMemberList(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getJoinedCommunityList\",value:function(){return this._getModule(oo).getJoinedCommunityList()}},{key:\"createTopicInCommunity\",value:function(e){return this._getModule(oo).createTopicInCommunity(e)}},{key:\"deleteTopicFromCommunity\",value:function(e){return this._getModule(oo).deleteTopicFromCommunity(e)}},{key:\"updateTopicProfile\",value:function(e){return this._getModule(oo).updateTopicProfile(e)}},{key:\"getTopicList\",value:function(e){return this._getModule(oo).getTopicList(e)}},{key:\"addSignalingListener\",value:function(e,t,n){var o=this._getModule(Eo);o&&o.addSignalingListener(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:\"removeSignalingListener\",value:function(e,t,n){var o=this._safetyCallbackFactory.find(e,t);if(null!==o){var a=this._getModule(Eo);a&&(a.removeSignalingListener(e,o,n),this._safetyCallbackFactory.delete(e,t))}}},{key:\"invite\",value:function(e){var t=this._getModule(Eo);return t?t.invite(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"inviteSync\",value:function(e,t,n){var o=this._getModule(Eo);return o?o.inviteSync(e,t,n):\"\"}},{key:\"inviteInGroup\",value:function(e){var t=this._getModule(Eo);return t?t.invite(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"inviteInGroupSync\",value:function(e,t,n){var o=this._getModule(Eo);return o?o.inviteSync(e,t,n):\"\"}},{key:\"cancel\",value:function(e){var t=this._getModule(Eo);return t?t.cancel(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"accept\",value:function(e){var t=this._getModule(Eo);return t?t.accept(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"reject\",value:function(e){var t=this._getModule(Eo);return t?t.reject(e):Go({code:Ao.CANNOT_FIND_MODULE})}},{key:\"getSignalingInfo\",value:function(e){var t=this._getModule(Eo);return t?t.getSignalingInfo(e):null}},{key:\"modifyInvitation\",value:function(e){var t=this._getModule(Eo);return t?t.modifyInvitation(e):Go({code:Ao.CANNOT_FIND_MODULE})}}]),e}(),Xs={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 Qs(e,t){if(e.isReady()||1===Xs[t])return!0;var n=e.getNotReadyReason(),o={code:n,message:\"\".concat(e.getErrorMessage(n),\" | \").concat(t,\" | \").concat(e.getErrorMessage(Ao.SDK_IS_NOT_READY))};return e.onError(o),o}var Zs={},$s={};return $s.create=function(e){var n=\"TencentCloudChat.create\",o=0,a=e.SDKAppID;if(_t(a))o=a;else if(o=parseInt(a),isNaN(a))return Je.e(\"\".concat(n,\" failed. Failed to parse the SDKAppID, please check the arguments\")),null;if(o&&Zs[o])return Zs[o];Je.l(\"\".concat(n));var i=new zs(t(t({},e),{},{SDKAppID:o}));i.on(E.SDK_DESTROY,(function(e){Zs[e.data.SDKAppID]=null,delete Zs[e.data.SDKAppID]}));var s=function(e){var t=Object.create(null);return Object.keys(zn).forEach((function(n){if(e[n]){var o=new k;t[n]=function(){var t=Array.from(arguments);return o.use((function(t,o){var a=Qs(e,n);return!0===a?o():Go(a)})).use((function(e,t){if(!0===_n(e,Jn[n],n))return t()})).use((function(t,o){return e[n].apply(e,t)})),o.run(t)}}})),t}(i);return Zs[o]=s,Jn.hookGetAPITips(i.getErrorMessage.bind(i)),Je.l(\"\".concat(n,\" ok\")),s},$s.TYPES=S,$s.EVENT=E,$s.TSignaling=N,$s.VERSION=\"3.2.3\",Je.l(\"TencentCloudChat.VERSION:\".concat($s.VERSION)),$s}));\n"]} \ No newline at end of file diff --git a/miniprogram_npm/@tencentcloud/tui-core/index.js b/miniprogram_npm/@tencentcloud/tui-core/index.js new file mode 100644 index 0000000..165725d --- /dev/null +++ b/miniprogram_npm/@tencentcloud/tui-core/index.js @@ -0,0 +1,14 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242896, function(require, module, exports) { +var __TEMP__ = require('@tencentcloud/chat');var e = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-upload-plugin');var t = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-profanity-filter-plugin');var n = __REQUIRE_DEFAULT__(__TEMP__);class i{constructor(){this.serviceMap=new Map}registerService(e,t){this.serviceMap.has(e)||(console.log(`TUIServiceManager.registerService serviceName:${e}`),this.serviceMap.set(e,t))}unregisterService(e){this.serviceMap.has(e)&&(console.log(`TUIServiceManager.unregisterService serviceName:${e}`),this.serviceMap.delete(e))}getService(e){return this.serviceMap.get(e)}callService(e){const{serviceName:t,method:n,params:i,callback:s}=e,r=this.getService(t);if(console.log(`TUIServiceManager.callService serviceName:${t}, service:`,r),r)return r.onCall(n,i,s)}}class s{constructor(){this.extensionMap=new Map}registerExtension(e,t){if(console.log(`TUIExtensionManager.registerExtension extensionID:${e}`),!this.extensionMap.has(e)){const t=[];this.extensionMap.set(e,t)}const n=this.extensionMap.get(e);-1===n.indexOf(t)&&n.push(t)}unregisterExtension(e,t){if(console.log(`TUIExtensionManager.unregisterExtension extensionID:${e}`),this.extensionMap.has(e)){const n=this.extensionMap.get(e),i=n.indexOf(t);i>-1&&n.splice(i,1)}}getExtensionList(e,t){console.log(`TUIExtensionManager.getExtensionList extensionID:${e}, params:${t?JSON.stringify(t):void 0}`);let n=[],i=[];if(this.extensionMap.has(e)){n=this.extensionMap.get(e);for(let s=0;s-1&&e.splice(t,1)}}notifyEvent(e,t,n){const i=this.getKey(e,t);if(console.log(`TUIEventManager.notifyEvent eventName:${e} subKey:${t} params:${JSON.stringify(n)}`),this.eventMap.has(i)){this.eventMap.get(i).forEach((i=>{i.onNotifyEvent(e,t,n)}))}}getKey(e,t){let n=e;return t&&(n=`${e}-${n}`),n}}class o{constructor(){this.serviceManager=new i,this.extensionManager=new s,this.eventManager=new r}static getInstance(){return o.instance||(console.log("TUICore.getInstance ok."),o.instance=new o),o.instance}registerService(e,t){return this.serviceManager.registerService(e,t)}unregisterService(e){return this.serviceManager.unregisterService(e)}getService(e){return this.serviceManager.getService(e)}callService(e){return this.serviceManager.callService(e)}registerExtension(e,t){return this.extensionManager.registerExtension(e,t)}unregisterExtension(e,t){return this.extensionManager.unregisterExtension(e,t)}getExtensionList(e,t){return this.extensionManager.getExtensionList(e,t)}registerEvent(e,t,n){return this.eventManager.registerEvent(e,t,n)}unregisterEvent(e,t,n){return this.eventManager.unregisterEvent(e,t,n)}notifyEvent(e,t,n){return this.eventManager.notifyEvent(e,t,n)}}const a=["vue2","vue3"],E={TUILogin:{EVENT:{LOGIN_STATE_CHANGED:"loginStateChanged"},EVENT_SUB_KEY:{USER_LOGIN_SUCCESS:"userLoginSuccess",USER_LOGOUT_SUCCESS:"userLogoutSuccess",USER_KICKED_OFFLINE:"userKickedOffline",USER_SIG_EXPIRED:"userSigExpired"}},TUIConversation:{SERVICE:{NAME:"TUIConversationService",METHOD:{CREATE_CONVERSATION:"createConversation",HIDE_CONVERSATION_HEADER:"hideConversationHeader"}},EXTENSION:{CONV_POP_MENU:{EXT_ID:"conversationPopMenu"},CONV_GROUP:{EXT_ID:"conversationGroup"}}},TUIChat:{SERVICE:{NAME:"TUIChatService",METHOD:{UPDATE_MESSAGE_LIST:"updateMessageList",SEND_CUSTOM_MESSAGE:"sendCustomMessage",SEND_TEXT_MESSAGE:"sendTextMessage",SET_CHAT_TYPE:"setChatType"}},EXTENSION:{INPUT_MORE:{EXT_ID:"inputToolBarMore"},MSG_POP_MENU:{EXT_ID:"messagePopMenu"},CHAT_HEADER:{EXT_ID:"chatHeader"}}},TUIGroup:{SERVICE:{NAME:"TUIGroupService",METHOD:{CREATE_GROUP:"createGroup",OPEN_GROUP_MANAGEMENT:"openGroupManagement",SELECT_GROUP_MEMBER:"selectGroupMember"}}},TUIContact:{SERVICE:{NAME:"TUIContactService",METHOD:{SELECT_FRIEND:"selectFriend"}},EXTENSION:{CONTACT_LIST:{EXT_ID:"contactList"}}},TUISearch:{SERVICE:{NAME:"TUISearchService",METHOD:{SEARCH_GROUP:"searchGroup",SEARCH_USER:"searchUser",SEARCH_FRIEND:"searchFriend",SEARCH_GROUP_MEMBER:"searchGroupMember"}},EXTENSION:{SEARCH_MORE:{EXT_ID:"searchMore"}}},TUICalling:{SERVICE:{NAME:"TUICallingService",METHOD:{START_CALL:"startCall"}}},TUICustomerServicePlugin:{SERVICE:{NAME:"TUICustomerServicePlugin",METHOD:{ACTIVE_CONVERSATION:"activeConversation",FILTER_MESSAGE:"filterMessage"}},EXTENSION:{}},TUITranslate:{EVENT:{LANGUAGE_CHANGED:"languageChanged"},EVENT_SUB_KEY:{CHANGE_SUCCESS:"changeSuccess"}}},g="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),c="undefined"!=typeof uni&&"undefined"==typeof window,S=g||c,h="undefined"!=typeof uni,u=("undefined"!=typeof uni||"undefined"!=typeof window)&&!S;g?wx:h?uni:window;const T=u&&window&&window.navigator&&window.navigator.userAgent||"",l=/Android/i.test(T),I=/(?:Windows Phone)/.test(T),v=/(?:SymbianOS)/.test(T),_=/iPad/i.test(T)||/iPhone/i.test(T)||/iPod/i.test(T),p=l||I||v||_,M=u&&!p,N=c&&!g;class U{constructor(){this.loginStatusPromise=new Map,this.SDKAppID=0,this.userID="",this.userSig=""}static getInstance(){return U.instance||(U.instance=new U),U.instance}login(t){const{SDKAppID:n,userID:i,userSig:s,framework:r}=t;return this.chat=e.create(Object.assign(Object.assign({},t),{scene:this.getStatScene(r)})),this.EVENT=e.EVENT,this.TYPES=e.TYPES,this.SDKAppID=n,this.userID=i,this.userSig=s,this.onChatEvent(),this.registerPlugin(t),this.loginChat(t)}logout(){return this.chat.logout().then((e=>(o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}destroy(){return this.chat.destroy().then((e=>(o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}setLogLevel(e){return this.chat.setLogLevel(e)}getContext(){return{chat:this.chat,SDKAppID:this.SDKAppID,userID:this.userID,userSig:this.userSig}}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,i)=>{this.chat.login({userID:t,userSig:n}).then((t=>{t.data.repeatLogin&&this.chat.isReady()&&e(t),this.loginStatusPromise.set("login",{resolve:e,reject:i,imResponse:t})})).catch((e=>{i(e)}))}))}onChatEvent(){this.chat.on(this.EVENT.SDK_READY,this.onSDKReady,this),this.chat.on(this.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.chat.on(this.EVENT.KICKED_OUT,this.onUserKicked,this)}onSDKReady(){if(this.loginStatusPromise.has("login")){const e=this.loginStatusPromise.get("login");e.resolve(e.imResponse),o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS)}this.loginStatusPromise.delete("login")}onSDKNotReady(){if(this.loginStatusPromise.has("login")){this.loginStatusPromise.get("login").reject(new Error("sdk not ready"))}this.loginStatusPromise.delete("login")}onUserKicked(e){e.data.type!==this.TYPES.KICKED_OUT_USERSIG_EXPIRED?o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_KICKED_OFFLINE):o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_SIG_EXPIRED)}registerPlugin(e){const{useUploadPlugin:i=!1,useProfanityFilterPlugin:s=!1,TUIOfflinePush:r,offlinePushConfig:o}=e;!0===i&&this.chat.registerPlugin({"tim-upload-plugin":t}),!0===s&&this.chat.registerPlugin({"tim-profanity-filter-plugin":n}),N&&r&&o&&this.chat.registerPlugin({"tim-offline-push-plugin":r,offlinePushConfig:o})}getStatScene(e){let t;return e&&a.indexOf(e)>-1&&(t=this.genStatScene(e)),t}genStatScene(e){let t="";return h?(M&&(t=`k-${e}-pc-uni`),p&&(t=`k-${e}-h5-uni`),N&&(t=`k-${e}-app-uni`),g&&(t=`k-${e}-mp-uni`),t):(M&&(t=`k-${e}-pc`),p&&(t=`k-${e}-h5`),t)}}console.log("TUICore.VERSION:2.0.2");const C=o.getInstance(),f=U.getInstance();if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });Object.defineProperty(exports, 'TUIConstants', { enumerable: true, configurable: true, get: function() { return E; } });Object.defineProperty(exports, 'TUICore', { enumerable: true, configurable: true, get: function() { return C; } });Object.defineProperty(exports, 'TUILogin', { enumerable: true, configurable: true, get: function() { return f; } });Object.defineProperty(exports, 'default', { enumerable: true, configurable: true, get: function() { return C; } }); + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242896); +})() +//miniprogram-npm-outsideDeps=["@tencentcloud/chat","tim-upload-plugin","tim-profanity-filter-plugin"] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/@tencentcloud/tui-core/index.js.map b/miniprogram_npm/@tencentcloud/tui-core/index.js.map new file mode 100644 index 0000000..6cf25b0 --- /dev/null +++ b/miniprogram_npm/@tencentcloud/tui-core/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA","file":"index.js","sourcesContent":["var __TEMP__ = require('@tencentcloud/chat');var e = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-upload-plugin');var t = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-profanity-filter-plugin');var n = __REQUIRE_DEFAULT__(__TEMP__);class i{constructor(){this.serviceMap=new Map}registerService(e,t){this.serviceMap.has(e)||(console.log(`TUIServiceManager.registerService serviceName:${e}`),this.serviceMap.set(e,t))}unregisterService(e){this.serviceMap.has(e)&&(console.log(`TUIServiceManager.unregisterService serviceName:${e}`),this.serviceMap.delete(e))}getService(e){return this.serviceMap.get(e)}callService(e){const{serviceName:t,method:n,params:i,callback:s}=e,r=this.getService(t);if(console.log(`TUIServiceManager.callService serviceName:${t}, service:`,r),r)return r.onCall(n,i,s)}}class s{constructor(){this.extensionMap=new Map}registerExtension(e,t){if(console.log(`TUIExtensionManager.registerExtension extensionID:${e}`),!this.extensionMap.has(e)){const t=[];this.extensionMap.set(e,t)}const n=this.extensionMap.get(e);-1===n.indexOf(t)&&n.push(t)}unregisterExtension(e,t){if(console.log(`TUIExtensionManager.unregisterExtension extensionID:${e}`),this.extensionMap.has(e)){const n=this.extensionMap.get(e),i=n.indexOf(t);i>-1&&n.splice(i,1)}}getExtensionList(e,t){console.log(`TUIExtensionManager.getExtensionList extensionID:${e}, params:${t?JSON.stringify(t):void 0}`);let n=[],i=[];if(this.extensionMap.has(e)){n=this.extensionMap.get(e);for(let s=0;s-1&&e.splice(t,1)}}notifyEvent(e,t,n){const i=this.getKey(e,t);if(console.log(`TUIEventManager.notifyEvent eventName:${e} subKey:${t} params:${JSON.stringify(n)}`),this.eventMap.has(i)){this.eventMap.get(i).forEach((i=>{i.onNotifyEvent(e,t,n)}))}}getKey(e,t){let n=e;return t&&(n=`${e}-${n}`),n}}class o{constructor(){this.serviceManager=new i,this.extensionManager=new s,this.eventManager=new r}static getInstance(){return o.instance||(console.log(\"TUICore.getInstance ok.\"),o.instance=new o),o.instance}registerService(e,t){return this.serviceManager.registerService(e,t)}unregisterService(e){return this.serviceManager.unregisterService(e)}getService(e){return this.serviceManager.getService(e)}callService(e){return this.serviceManager.callService(e)}registerExtension(e,t){return this.extensionManager.registerExtension(e,t)}unregisterExtension(e,t){return this.extensionManager.unregisterExtension(e,t)}getExtensionList(e,t){return this.extensionManager.getExtensionList(e,t)}registerEvent(e,t,n){return this.eventManager.registerEvent(e,t,n)}unregisterEvent(e,t,n){return this.eventManager.unregisterEvent(e,t,n)}notifyEvent(e,t,n){return this.eventManager.notifyEvent(e,t,n)}}const a=[\"vue2\",\"vue3\"],E={TUILogin:{EVENT:{LOGIN_STATE_CHANGED:\"loginStateChanged\"},EVENT_SUB_KEY:{USER_LOGIN_SUCCESS:\"userLoginSuccess\",USER_LOGOUT_SUCCESS:\"userLogoutSuccess\",USER_KICKED_OFFLINE:\"userKickedOffline\",USER_SIG_EXPIRED:\"userSigExpired\"}},TUIConversation:{SERVICE:{NAME:\"TUIConversationService\",METHOD:{CREATE_CONVERSATION:\"createConversation\",HIDE_CONVERSATION_HEADER:\"hideConversationHeader\"}},EXTENSION:{CONV_POP_MENU:{EXT_ID:\"conversationPopMenu\"},CONV_GROUP:{EXT_ID:\"conversationGroup\"}}},TUIChat:{SERVICE:{NAME:\"TUIChatService\",METHOD:{UPDATE_MESSAGE_LIST:\"updateMessageList\",SEND_CUSTOM_MESSAGE:\"sendCustomMessage\",SEND_TEXT_MESSAGE:\"sendTextMessage\",SET_CHAT_TYPE:\"setChatType\"}},EXTENSION:{INPUT_MORE:{EXT_ID:\"inputToolBarMore\"},MSG_POP_MENU:{EXT_ID:\"messagePopMenu\"},CHAT_HEADER:{EXT_ID:\"chatHeader\"}}},TUIGroup:{SERVICE:{NAME:\"TUIGroupService\",METHOD:{CREATE_GROUP:\"createGroup\",OPEN_GROUP_MANAGEMENT:\"openGroupManagement\",SELECT_GROUP_MEMBER:\"selectGroupMember\"}}},TUIContact:{SERVICE:{NAME:\"TUIContactService\",METHOD:{SELECT_FRIEND:\"selectFriend\"}},EXTENSION:{CONTACT_LIST:{EXT_ID:\"contactList\"}}},TUISearch:{SERVICE:{NAME:\"TUISearchService\",METHOD:{SEARCH_GROUP:\"searchGroup\",SEARCH_USER:\"searchUser\",SEARCH_FRIEND:\"searchFriend\",SEARCH_GROUP_MEMBER:\"searchGroupMember\"}},EXTENSION:{SEARCH_MORE:{EXT_ID:\"searchMore\"}}},TUICalling:{SERVICE:{NAME:\"TUICallingService\",METHOD:{START_CALL:\"startCall\"}}},TUICustomerServicePlugin:{SERVICE:{NAME:\"TUICustomerServicePlugin\",METHOD:{ACTIVE_CONVERSATION:\"activeConversation\",FILTER_MESSAGE:\"filterMessage\"}},EXTENSION:{}},TUITranslate:{EVENT:{LANGUAGE_CHANGED:\"languageChanged\"},EVENT_SUB_KEY:{CHANGE_SUCCESS:\"changeSuccess\"}}},g=\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),c=\"undefined\"!=typeof uni&&\"undefined\"==typeof window,S=g||c,h=\"undefined\"!=typeof uni,u=(\"undefined\"!=typeof uni||\"undefined\"!=typeof window)&&!S;g?wx:h?uni:window;const T=u&&window&&window.navigator&&window.navigator.userAgent||\"\",l=/Android/i.test(T),I=/(?:Windows Phone)/.test(T),v=/(?:SymbianOS)/.test(T),_=/iPad/i.test(T)||/iPhone/i.test(T)||/iPod/i.test(T),p=l||I||v||_,M=u&&!p,N=c&&!g;class U{constructor(){this.loginStatusPromise=new Map,this.SDKAppID=0,this.userID=\"\",this.userSig=\"\"}static getInstance(){return U.instance||(U.instance=new U),U.instance}login(t){const{SDKAppID:n,userID:i,userSig:s,framework:r}=t;return this.chat=e.create(Object.assign(Object.assign({},t),{scene:this.getStatScene(r)})),this.EVENT=e.EVENT,this.TYPES=e.TYPES,this.SDKAppID=n,this.userID=i,this.userSig=s,this.onChatEvent(),this.registerPlugin(t),this.loginChat(t)}logout(){return this.chat.logout().then((e=>(o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}destroy(){return this.chat.destroy().then((e=>(o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_LOGOUT_SUCCESS),Promise.resolve(e))))}setLogLevel(e){return this.chat.setLogLevel(e)}getContext(){return{chat:this.chat,SDKAppID:this.SDKAppID,userID:this.userID,userSig:this.userSig}}loginChat(e){const{userID:t,userSig:n}=e;return new Promise(((e,i)=>{this.chat.login({userID:t,userSig:n}).then((t=>{t.data.repeatLogin&&this.chat.isReady()&&e(t),this.loginStatusPromise.set(\"login\",{resolve:e,reject:i,imResponse:t})})).catch((e=>{i(e)}))}))}onChatEvent(){this.chat.on(this.EVENT.SDK_READY,this.onSDKReady,this),this.chat.on(this.EVENT.SDK_NOT_READY,this.onSDKNotReady,this),this.chat.on(this.EVENT.KICKED_OUT,this.onUserKicked,this)}onSDKReady(){if(this.loginStatusPromise.has(\"login\")){const e=this.loginStatusPromise.get(\"login\");e.resolve(e.imResponse),o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_LOGIN_SUCCESS)}this.loginStatusPromise.delete(\"login\")}onSDKNotReady(){if(this.loginStatusPromise.has(\"login\")){this.loginStatusPromise.get(\"login\").reject(new Error(\"sdk not ready\"))}this.loginStatusPromise.delete(\"login\")}onUserKicked(e){e.data.type!==this.TYPES.KICKED_OUT_USERSIG_EXPIRED?o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_KICKED_OFFLINE):o.getInstance().notifyEvent(E.TUILogin.EVENT.LOGIN_STATE_CHANGED,E.TUILogin.EVENT_SUB_KEY.USER_SIG_EXPIRED)}registerPlugin(e){const{useUploadPlugin:i=!1,useProfanityFilterPlugin:s=!1,TUIOfflinePush:r,offlinePushConfig:o}=e;!0===i&&this.chat.registerPlugin({\"tim-upload-plugin\":t}),!0===s&&this.chat.registerPlugin({\"tim-profanity-filter-plugin\":n}),N&&r&&o&&this.chat.registerPlugin({\"tim-offline-push-plugin\":r,offlinePushConfig:o})}getStatScene(e){let t;return e&&a.indexOf(e)>-1&&(t=this.genStatScene(e)),t}genStatScene(e){let t=\"\";return h?(M&&(t=`k-${e}-pc-uni`),p&&(t=`k-${e}-h5-uni`),N&&(t=`k-${e}-app-uni`),g&&(t=`k-${e}-mp-uni`),t):(M&&(t=`k-${e}-pc`),p&&(t=`k-${e}-h5`),t)}}console.log(\"TUICore.VERSION:2.0.2\");const C=o.getInstance(),f=U.getInstance();if (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });Object.defineProperty(exports, 'TUIConstants', { enumerable: true, configurable: true, get: function() { return E; } });Object.defineProperty(exports, 'TUICore', { enumerable: true, configurable: true, get: function() { return C; } });Object.defineProperty(exports, 'TUILogin', { enumerable: true, configurable: true, get: function() { return f; } });Object.defineProperty(exports, 'default', { enumerable: true, configurable: true, get: function() { return C; } });\n"]} \ No newline at end of file diff --git a/miniprogram_npm/@vant/area-data/index.js b/miniprogram_npm/@vant/area-data/index.js new file mode 100644 index 0000000..4a97b4a --- /dev/null +++ b/miniprogram_npm/@vant/area-data/index.js @@ -0,0 +1,3959 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242897, function(require, module, exports) { + +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); + +// src/index.ts +var src_exports = {}; +__export(src_exports, { + areaList: () => areaList, + useCascaderAreaData: () => useCascaderAreaData +}); +module.exports = __toCommonJS(src_exports); +var areaList = { + province_list: { + 11e4: "北京市", + 12e4: "天津市", + 13e4: "河北省", + 14e4: "山西省", + 15e4: "内蒙古自治区", + 21e4: "辽宁省", + 22e4: "吉林省", + 23e4: "黑龙江省", + 31e4: "上海市", + 32e4: "江苏省", + 33e4: "浙江省", + 34e4: "安徽省", + 35e4: "福建省", + 36e4: "江西省", + 37e4: "山东省", + 41e4: "河南省", + 42e4: "湖北省", + 43e4: "湖南省", + 44e4: "广东省", + 45e4: "广西壮族自治区", + 46e4: "海南省", + 5e5: "重庆市", + 51e4: "四川省", + 52e4: "贵州省", + 53e4: "云南省", + 54e4: "西藏自治区", + 61e4: "陕西省", + 62e4: "甘肃省", + 63e4: "青海省", + 64e4: "宁夏回族自治区", + 65e4: "新疆维吾尔自治区", + 71e4: "台湾省", + 81e4: "香港特别行政区", + 82e4: "澳门特别行政区" + }, + city_list: { + 110100: "北京市", + 120100: "天津市", + 130100: "石家庄市", + 130200: "唐山市", + 130300: "秦皇岛市", + 130400: "邯郸市", + 130500: "邢台市", + 130600: "保定市", + 130700: "张家口市", + 130800: "承德市", + 130900: "沧州市", + 131e3: "廊坊市", + 131100: "衡水市", + 140100: "太原市", + 140200: "大同市", + 140300: "阳泉市", + 140400: "长治市", + 140500: "晋城市", + 140600: "朔州市", + 140700: "晋中市", + 140800: "运城市", + 140900: "忻州市", + 141e3: "临汾市", + 141100: "吕梁市", + 150100: "呼和浩特市", + 150200: "包头市", + 150300: "乌海市", + 150400: "赤峰市", + 150500: "通辽市", + 150600: "鄂尔多斯市", + 150700: "呼伦贝尔市", + 150800: "巴彦淖尔市", + 150900: "乌兰察布市", + 152200: "兴安盟", + 152500: "锡林郭勒盟", + 152900: "阿拉善盟", + 210100: "沈阳市", + 210200: "大连市", + 210300: "鞍山市", + 210400: "抚顺市", + 210500: "本溪市", + 210600: "丹东市", + 210700: "锦州市", + 210800: "营口市", + 210900: "阜新市", + 211e3: "辽阳市", + 211100: "盘锦市", + 211200: "铁岭市", + 211300: "朝阳市", + 211400: "葫芦岛市", + 220100: "长春市", + 220200: "吉林市", + 220300: "四平市", + 220400: "辽源市", + 220500: "通化市", + 220600: "白山市", + 220700: "松原市", + 220800: "白城市", + 222400: "延边朝鲜族自治州", + 230100: "哈尔滨市", + 230200: "齐齐哈尔市", + 230300: "鸡西市", + 230400: "鹤岗市", + 230500: "双鸭山市", + 230600: "大庆市", + 230700: "伊春市", + 230800: "佳木斯市", + 230900: "七台河市", + 231e3: "牡丹江市", + 231100: "黑河市", + 231200: "绥化市", + 232700: "大兴安岭地区", + 310100: "上海市", + 320100: "南京市", + 320200: "无锡市", + 320300: "徐州市", + 320400: "常州市", + 320500: "苏州市", + 320600: "南通市", + 320700: "连云港市", + 320800: "淮安市", + 320900: "盐城市", + 321e3: "扬州市", + 321100: "镇江市", + 321200: "泰州市", + 321300: "宿迁市", + 330100: "杭州市", + 330200: "宁波市", + 330300: "温州市", + 330400: "嘉兴市", + 330500: "湖州市", + 330600: "绍兴市", + 330700: "金华市", + 330800: "衢州市", + 330900: "舟山市", + 331e3: "台州市", + 331100: "丽水市", + 340100: "合肥市", + 340200: "芜湖市", + 340300: "蚌埠市", + 340400: "淮南市", + 340500: "马鞍山市", + 340600: "淮北市", + 340700: "铜陵市", + 340800: "安庆市", + 341e3: "黄山市", + 341100: "滁州市", + 341200: "阜阳市", + 341300: "宿州市", + 341500: "六安市", + 341600: "亳州市", + 341700: "池州市", + 341800: "宣城市", + 350100: "福州市", + 350200: "厦门市", + 350300: "莆田市", + 350400: "三明市", + 350500: "泉州市", + 350600: "漳州市", + 350700: "南平市", + 350800: "龙岩市", + 350900: "宁德市", + 360100: "南昌市", + 360200: "景德镇市", + 360300: "萍乡市", + 360400: "九江市", + 360500: "新余市", + 360600: "鹰潭市", + 360700: "赣州市", + 360800: "吉安市", + 360900: "宜春市", + 361e3: "抚州市", + 361100: "上饶市", + 370100: "济南市", + 370200: "青岛市", + 370300: "淄博市", + 370400: "枣庄市", + 370500: "东营市", + 370600: "烟台市", + 370700: "潍坊市", + 370800: "济宁市", + 370900: "泰安市", + 371e3: "威海市", + 371100: "日照市", + 371300: "临沂市", + 371400: "德州市", + 371500: "聊城市", + 371600: "滨州市", + 371700: "菏泽市", + 410100: "郑州市", + 410200: "开封市", + 410300: "洛阳市", + 410400: "平顶山市", + 410500: "安阳市", + 410600: "鹤壁市", + 410700: "新乡市", + 410800: "焦作市", + 410900: "濮阳市", + 411e3: "许昌市", + 411100: "漯河市", + 411200: "三门峡市", + 411300: "南阳市", + 411400: "商丘市", + 411500: "信阳市", + 411600: "周口市", + 411700: "驻马店市", + 419e3: "省直辖县", + 420100: "武汉市", + 420200: "黄石市", + 420300: "十堰市", + 420500: "宜昌市", + 420600: "襄阳市", + 420700: "鄂州市", + 420800: "荆门市", + 420900: "孝感市", + 421e3: "荆州市", + 421100: "黄冈市", + 421200: "咸宁市", + 421300: "随州市", + 422800: "恩施土家族苗族自治州", + 429e3: "省直辖县", + 430100: "长沙市", + 430200: "株洲市", + 430300: "湘潭市", + 430400: "衡阳市", + 430500: "邵阳市", + 430600: "岳阳市", + 430700: "常德市", + 430800: "张家界市", + 430900: "益阳市", + 431e3: "郴州市", + 431100: "永州市", + 431200: "怀化市", + 431300: "娄底市", + 433100: "湘西土家族苗族自治州", + 440100: "广州市", + 440200: "韶关市", + 440300: "深圳市", + 440400: "珠海市", + 440500: "汕头市", + 440600: "佛山市", + 440700: "江门市", + 440800: "湛江市", + 440900: "茂名市", + 441200: "肇庆市", + 441300: "惠州市", + 441400: "梅州市", + 441500: "汕尾市", + 441600: "河源市", + 441700: "阳江市", + 441800: "清远市", + 441900: "东莞市", + 442e3: "中山市", + 445100: "潮州市", + 445200: "揭阳市", + 445300: "云浮市", + 450100: "南宁市", + 450200: "柳州市", + 450300: "桂林市", + 450400: "梧州市", + 450500: "北海市", + 450600: "防城港市", + 450700: "钦州市", + 450800: "贵港市", + 450900: "玉林市", + 451e3: "百色市", + 451100: "贺州市", + 451200: "河池市", + 451300: "来宾市", + 451400: "崇左市", + 460100: "海口市", + 460200: "三亚市", + 460300: "三沙市", + 460400: "儋州市", + 469e3: "省直辖县", + 500100: "重庆市", + 500200: "县", + 510100: "成都市", + 510300: "自贡市", + 510400: "攀枝花市", + 510500: "泸州市", + 510600: "德阳市", + 510700: "绵阳市", + 510800: "广元市", + 510900: "遂宁市", + 511e3: "内江市", + 511100: "乐山市", + 511300: "南充市", + 511400: "眉山市", + 511500: "宜宾市", + 511600: "广安市", + 511700: "达州市", + 511800: "雅安市", + 511900: "巴中市", + 512e3: "资阳市", + 513200: "阿坝藏族羌族自治州", + 513300: "甘孜藏族自治州", + 513400: "凉山彝族自治州", + 520100: "贵阳市", + 520200: "六盘水市", + 520300: "遵义市", + 520400: "安顺市", + 520500: "毕节市", + 520600: "铜仁市", + 522300: "黔西南布依族苗族自治州", + 522600: "黔东南苗族侗族自治州", + 522700: "黔南布依族苗族自治州", + 530100: "昆明市", + 530300: "曲靖市", + 530400: "玉溪市", + 530500: "保山市", + 530600: "昭通市", + 530700: "丽江市", + 530800: "普洱市", + 530900: "临沧市", + 532300: "楚雄彝族自治州", + 532500: "红河哈尼族彝族自治州", + 532600: "文山壮族苗族自治州", + 532800: "西双版纳傣族自治州", + 532900: "大理白族自治州", + 533100: "德宏傣族景颇族自治州", + 533300: "怒江傈僳族自治州", + 533400: "迪庆藏族自治州", + 540100: "拉萨市", + 540200: "日喀则市", + 540300: "昌都市", + 540400: "林芝市", + 540500: "山南市", + 540600: "那曲市", + 542500: "阿里地区", + 610100: "西安市", + 610200: "铜川市", + 610300: "宝鸡市", + 610400: "咸阳市", + 610500: "渭南市", + 610600: "延安市", + 610700: "汉中市", + 610800: "榆林市", + 610900: "安康市", + 611e3: "商洛市", + 620100: "兰州市", + 620200: "嘉峪关市", + 620300: "金昌市", + 620400: "白银市", + 620500: "天水市", + 620600: "武威市", + 620700: "张掖市", + 620800: "平凉市", + 620900: "酒泉市", + 621e3: "庆阳市", + 621100: "定西市", + 621200: "陇南市", + 622900: "临夏回族自治州", + 623e3: "甘南藏族自治州", + 630100: "西宁市", + 630200: "海东市", + 632200: "海北藏族自治州", + 632300: "黄南藏族自治州", + 632500: "海南藏族自治州", + 632600: "果洛藏族自治州", + 632700: "玉树藏族自治州", + 632800: "海西蒙古族藏族自治州", + 640100: "银川市", + 640200: "石嘴山市", + 640300: "吴忠市", + 640400: "固原市", + 640500: "中卫市", + 650100: "乌鲁木齐市", + 650200: "克拉玛依市", + 650400: "吐鲁番市", + 650500: "哈密市", + 652300: "昌吉回族自治州", + 652700: "博尔塔拉蒙古自治州", + 652800: "巴音郭楞蒙古自治州", + 652900: "阿克苏地区", + 653e3: "克孜勒苏柯尔克孜自治州", + 653100: "喀什地区", + 653200: "和田地区", + 654e3: "伊犁哈萨克自治州", + 654200: "塔城地区", + 654300: "阿勒泰地区", + 659e3: "自治区直辖县级行政区划", + 710100: "台北市", + 710200: "高雄市", + 710300: "台南市", + 710400: "台中市", + 710500: "金门县", + 710600: "南投县", + 710700: "基隆市", + 710800: "新竹市", + 710900: "嘉义市", + 711100: "新北市", + 711200: "宜兰县", + 711300: "新竹县", + 711400: "桃园市", + 711500: "苗栗县", + 711700: "彰化县", + 711900: "嘉义县", + 712100: "云林县", + 712400: "屏东县", + 712500: "台东县", + 712600: "花莲县", + 712700: "澎湖县", + 712800: "连江县", + 810100: "香港岛", + 810200: "九龙", + 810300: "新界", + 820100: "澳门半岛", + 820200: "离岛" + }, + county_list: { + 110101: "东城区", + 110102: "西城区", + 110105: "朝阳区", + 110106: "丰台区", + 110107: "石景山区", + 110108: "海淀区", + 110109: "门头沟区", + 110111: "房山区", + 110112: "通州区", + 110113: "顺义区", + 110114: "昌平区", + 110115: "大兴区", + 110116: "怀柔区", + 110117: "平谷区", + 110118: "密云区", + 110119: "延庆区", + 120101: "和平区", + 120102: "河东区", + 120103: "河西区", + 120104: "南开区", + 120105: "河北区", + 120106: "红桥区", + 120110: "东丽区", + 120111: "西青区", + 120112: "津南区", + 120113: "北辰区", + 120114: "武清区", + 120115: "宝坻区", + 120116: "滨海新区", + 120117: "宁河区", + 120118: "静海区", + 120119: "蓟州区", + 130102: "长安区", + 130104: "桥西区", + 130105: "新华区", + 130107: "井陉矿区", + 130108: "裕华区", + 130109: "藁城区", + 130110: "鹿泉区", + 130111: "栾城区", + 130121: "井陉县", + 130123: "正定县", + 130125: "行唐县", + 130126: "灵寿县", + 130127: "高邑县", + 130128: "深泽县", + 130129: "赞皇县", + 130130: "无极县", + 130131: "平山县", + 130132: "元氏县", + 130133: "赵县", + 130171: "石家庄高新技术产业开发区", + 130172: "石家庄循环化工园区", + 130181: "辛集市", + 130183: "晋州市", + 130184: "新乐市", + 130202: "路南区", + 130203: "路北区", + 130204: "古冶区", + 130205: "开平区", + 130207: "丰南区", + 130208: "丰润区", + 130209: "曹妃甸区", + 130224: "滦南县", + 130225: "乐亭县", + 130227: "迁西县", + 130229: "玉田县", + 130273: "唐山高新技术产业开发区", + 130274: "河北唐山海港经济开发区", + 130281: "遵化市", + 130283: "迁安市", + 130284: "滦州市", + 130302: "海港区", + 130303: "山海关区", + 130304: "北戴河区", + 130306: "抚宁区", + 130321: "青龙满族自治县", + 130322: "昌黎县", + 130324: "卢龙县", + 130371: "秦皇岛市经济技术开发区", + 130372: "北戴河新区", + 130390: "经济技术开发区", + 130402: "邯山区", + 130403: "丛台区", + 130404: "复兴区", + 130406: "峰峰矿区", + 130407: "肥乡区", + 130408: "永年区", + 130423: "临漳县", + 130424: "成安县", + 130425: "大名县", + 130426: "涉县", + 130427: "磁县", + 130430: "邱县", + 130431: "鸡泽县", + 130432: "广平县", + 130433: "馆陶县", + 130434: "魏县", + 130435: "曲周县", + 130471: "邯郸经济技术开发区", + 130473: "邯郸冀南新区", + 130481: "武安市", + 130502: "襄都区", + 130503: "信都区", + 130505: "任泽区", + 130506: "南和区", + 130522: "临城县", + 130523: "内丘县", + 130524: "柏乡县", + 130525: "隆尧县", + 130528: "宁晋县", + 130529: "巨鹿县", + 130530: "新河县", + 130531: "广宗县", + 130532: "平乡县", + 130533: "威县", + 130534: "清河县", + 130535: "临西县", + 130571: "河北邢台经济开发区", + 130581: "南宫市", + 130582: "沙河市", + 130602: "竞秀区", + 130606: "莲池区", + 130607: "满城区", + 130608: "清苑区", + 130609: "徐水区", + 130623: "涞水县", + 130624: "阜平县", + 130626: "定兴县", + 130627: "唐县", + 130628: "高阳县", + 130629: "容城县", + 130630: "涞源县", + 130631: "望都县", + 130632: "安新县", + 130633: "易县", + 130634: "曲阳县", + 130635: "蠡县", + 130636: "顺平县", + 130637: "博野县", + 130638: "雄县", + 130671: "保定高新技术产业开发区", + 130672: "保定白沟新城", + 130681: "涿州市", + 130682: "定州市", + 130683: "安国市", + 130684: "高碑店市", + 130702: "桥东区", + 130703: "桥西区", + 130705: "宣化区", + 130706: "下花园区", + 130708: "万全区", + 130709: "崇礼区", + 130722: "张北县", + 130723: "康保县", + 130724: "沽源县", + 130725: "尚义县", + 130726: "蔚县", + 130727: "阳原县", + 130728: "怀安县", + 130730: "怀来县", + 130731: "涿鹿县", + 130732: "赤城县", + 130772: "张家口市察北管理区", + 130802: "双桥区", + 130803: "双滦区", + 130804: "鹰手营子矿区", + 130821: "承德县", + 130822: "兴隆县", + 130824: "滦平县", + 130825: "隆化县", + 130826: "丰宁满族自治县", + 130827: "宽城满族自治县", + 130828: "围场满族蒙古族自治县", + 130871: "承德高新技术产业开发区", + 130881: "平泉市", + 130902: "新华区", + 130903: "运河区", + 130921: "沧县", + 130922: "青县", + 130923: "东光县", + 130924: "海兴县", + 130925: "盐山县", + 130926: "肃宁县", + 130927: "南皮县", + 130928: "吴桥县", + 130929: "献县", + 130930: "孟村回族自治县", + 130971: "河北沧州经济开发区", + 130972: "沧州高新技术产业开发区", + 130973: "沧州渤海新区", + 130981: "泊头市", + 130982: "任丘市", + 130983: "黄骅市", + 130984: "河间市", + 131002: "安次区", + 131003: "广阳区", + 131022: "固安县", + 131023: "永清县", + 131024: "香河县", + 131025: "大城县", + 131026: "文安县", + 131028: "大厂回族自治县", + 131071: "廊坊经济技术开发区", + 131081: "霸州市", + 131082: "三河市", + 131090: "开发区", + 131102: "桃城区", + 131103: "冀州区", + 131121: "枣强县", + 131122: "武邑县", + 131123: "武强县", + 131124: "饶阳县", + 131125: "安平县", + 131126: "故城县", + 131127: "景县", + 131128: "阜城县", + 131171: "河北衡水经济开发区", + 131172: "衡水滨湖新区", + 131182: "深州市", + 140105: "小店区", + 140106: "迎泽区", + 140107: "杏花岭区", + 140108: "尖草坪区", + 140109: "万柏林区", + 140110: "晋源区", + 140121: "清徐县", + 140122: "阳曲县", + 140123: "娄烦县", + 140181: "古交市", + 140212: "新荣区", + 140213: "平城区", + 140214: "云冈区", + 140215: "云州区", + 140221: "阳高县", + 140222: "天镇县", + 140223: "广灵县", + 140224: "灵丘县", + 140225: "浑源县", + 140226: "左云县", + 140271: "山西大同经济开发区", + 140302: "城区", + 140303: "矿区", + 140311: "郊区", + 140321: "平定县", + 140322: "盂县", + 140403: "潞州区", + 140404: "上党区", + 140405: "屯留区", + 140406: "潞城区", + 140423: "襄垣县", + 140425: "平顺县", + 140426: "黎城县", + 140427: "壶关县", + 140428: "长子县", + 140429: "武乡县", + 140430: "沁县", + 140431: "沁源县", + 140471: "山西长治高新技术产业园区", + 140502: "城区", + 140521: "沁水县", + 140522: "阳城县", + 140524: "陵川县", + 140525: "泽州县", + 140581: "高平市", + 140602: "朔城区", + 140603: "平鲁区", + 140621: "山阴县", + 140622: "应县", + 140623: "右玉县", + 140671: "山西朔州经济开发区", + 140681: "怀仁市", + 140702: "榆次区", + 140703: "太谷区", + 140721: "榆社县", + 140722: "左权县", + 140723: "和顺县", + 140724: "昔阳县", + 140725: "寿阳县", + 140727: "祁县", + 140728: "平遥县", + 140729: "灵石县", + 140781: "介休市", + 140802: "盐湖区", + 140821: "临猗县", + 140822: "万荣县", + 140823: "闻喜县", + 140824: "稷山县", + 140825: "新绛县", + 140826: "绛县", + 140827: "垣曲县", + 140828: "夏县", + 140829: "平陆县", + 140830: "芮城县", + 140881: "永济市", + 140882: "河津市", + 140902: "忻府区", + 140921: "定襄县", + 140922: "五台县", + 140923: "代县", + 140924: "繁峙县", + 140925: "宁武县", + 140926: "静乐县", + 140927: "神池县", + 140928: "五寨县", + 140929: "岢岚县", + 140930: "河曲县", + 140931: "保德县", + 140932: "偏关县", + 140971: "五台山风景名胜区", + 140981: "原平市", + 141002: "尧都区", + 141021: "曲沃县", + 141022: "翼城县", + 141023: "襄汾县", + 141024: "洪洞县", + 141025: "古县", + 141026: "安泽县", + 141027: "浮山县", + 141028: "吉县", + 141029: "乡宁县", + 141030: "大宁县", + 141031: "隰县", + 141032: "永和县", + 141033: "蒲县", + 141034: "汾西县", + 141081: "侯马市", + 141082: "霍州市", + 141102: "离石区", + 141121: "文水县", + 141122: "交城县", + 141123: "兴县", + 141124: "临县", + 141125: "柳林县", + 141126: "石楼县", + 141127: "岚县", + 141128: "方山县", + 141129: "中阳县", + 141130: "交口县", + 141181: "孝义市", + 141182: "汾阳市", + 150102: "新城区", + 150103: "回民区", + 150104: "玉泉区", + 150105: "赛罕区", + 150121: "土默特左旗", + 150122: "托克托县", + 150123: "和林格尔县", + 150124: "清水河县", + 150125: "武川县", + 150172: "呼和浩特经济技术开发区", + 150202: "东河区", + 150203: "昆都仑区", + 150204: "青山区", + 150205: "石拐区", + 150206: "白云鄂博矿区", + 150207: "九原区", + 150221: "土默特右旗", + 150222: "固阳县", + 150223: "达尔罕茂明安联合旗", + 150271: "包头稀土高新技术产业开发区", + 150302: "海勃湾区", + 150303: "海南区", + 150304: "乌达区", + 150402: "红山区", + 150403: "元宝山区", + 150404: "松山区", + 150421: "阿鲁科尔沁旗", + 150422: "巴林左旗", + 150423: "巴林右旗", + 150424: "林西县", + 150425: "克什克腾旗", + 150426: "翁牛特旗", + 150428: "喀喇沁旗", + 150429: "宁城县", + 150430: "敖汉旗", + 150502: "科尔沁区", + 150521: "科尔沁左翼中旗", + 150522: "科尔沁左翼后旗", + 150523: "开鲁县", + 150524: "库伦旗", + 150525: "奈曼旗", + 150526: "扎鲁特旗", + 150571: "通辽经济技术开发区", + 150581: "霍林郭勒市", + 150602: "东胜区", + 150603: "康巴什区", + 150621: "达拉特旗", + 150622: "准格尔旗", + 150623: "鄂托克前旗", + 150624: "鄂托克旗", + 150625: "杭锦旗", + 150626: "乌审旗", + 150627: "伊金霍洛旗", + 150702: "海拉尔区", + 150703: "扎赉诺尔区", + 150721: "阿荣旗", + 150722: "莫力达瓦达斡尔族自治旗", + 150723: "鄂伦春自治旗", + 150724: "鄂温克族自治旗", + 150725: "陈巴尔虎旗", + 150726: "新巴尔虎左旗", + 150727: "新巴尔虎右旗", + 150781: "满洲里市", + 150782: "牙克石市", + 150783: "扎兰屯市", + 150784: "额尔古纳市", + 150785: "根河市", + 150802: "临河区", + 150821: "五原县", + 150822: "磴口县", + 150823: "乌拉特前旗", + 150824: "乌拉特中旗", + 150825: "乌拉特后旗", + 150826: "杭锦后旗", + 150902: "集宁区", + 150921: "卓资县", + 150922: "化德县", + 150923: "商都县", + 150924: "兴和县", + 150925: "凉城县", + 150926: "察哈尔右翼前旗", + 150927: "察哈尔右翼中旗", + 150928: "察哈尔右翼后旗", + 150929: "四子王旗", + 150981: "丰镇市", + 152201: "乌兰浩特市", + 152202: "阿尔山市", + 152221: "科尔沁右翼前旗", + 152222: "科尔沁右翼中旗", + 152223: "扎赉特旗", + 152224: "突泉县", + 152501: "二连浩特市", + 152502: "锡林浩特市", + 152522: "阿巴嘎旗", + 152523: "苏尼特左旗", + 152524: "苏尼特右旗", + 152525: "东乌珠穆沁旗", + 152526: "西乌珠穆沁旗", + 152527: "太仆寺旗", + 152528: "镶黄旗", + 152529: "正镶白旗", + 152530: "正蓝旗", + 152531: "多伦县", + 152571: "乌拉盖管委会", + 152921: "阿拉善左旗", + 152922: "阿拉善右旗", + 152923: "额济纳旗", + 152971: "内蒙古阿拉善经济开发区", + 210102: "和平区", + 210103: "沈河区", + 210104: "大东区", + 210105: "皇姑区", + 210106: "铁西区", + 210111: "苏家屯区", + 210112: "浑南区", + 210113: "沈北新区", + 210114: "于洪区", + 210115: "辽中区", + 210123: "康平县", + 210124: "法库县", + 210181: "新民市", + 210190: "经济技术开发区", + 210202: "中山区", + 210203: "西岗区", + 210204: "沙河口区", + 210211: "甘井子区", + 210212: "旅顺口区", + 210213: "金州区", + 210214: "普兰店区", + 210224: "长海县", + 210281: "瓦房店市", + 210283: "庄河市", + 210302: "铁东区", + 210303: "铁西区", + 210304: "立山区", + 210311: "千山区", + 210321: "台安县", + 210323: "岫岩满族自治县", + 210381: "海城市", + 210390: "高新区", + 210402: "新抚区", + 210403: "东洲区", + 210404: "望花区", + 210411: "顺城区", + 210421: "抚顺县", + 210422: "新宾满族自治县", + 210423: "清原满族自治县", + 210502: "平山区", + 210503: "溪湖区", + 210504: "明山区", + 210505: "南芬区", + 210521: "本溪满族自治县", + 210522: "桓仁满族自治县", + 210602: "元宝区", + 210603: "振兴区", + 210604: "振安区", + 210624: "宽甸满族自治县", + 210681: "东港市", + 210682: "凤城市", + 210702: "古塔区", + 210703: "凌河区", + 210711: "太和区", + 210726: "黑山县", + 210727: "义县", + 210781: "凌海市", + 210782: "北镇市", + 210793: "经济技术开发区", + 210802: "站前区", + 210803: "西市区", + 210804: "鲅鱼圈区", + 210811: "老边区", + 210881: "盖州市", + 210882: "大石桥市", + 210902: "海州区", + 210903: "新邱区", + 210904: "太平区", + 210905: "清河门区", + 210911: "细河区", + 210921: "阜新蒙古族自治县", + 210922: "彰武县", + 211002: "白塔区", + 211003: "文圣区", + 211004: "宏伟区", + 211005: "弓长岭区", + 211011: "太子河区", + 211021: "辽阳县", + 211081: "灯塔市", + 211102: "双台子区", + 211103: "兴隆台区", + 211104: "大洼区", + 211122: "盘山县", + 211202: "银州区", + 211204: "清河区", + 211221: "铁岭县", + 211223: "西丰县", + 211224: "昌图县", + 211281: "调兵山市", + 211282: "开原市", + 211302: "双塔区", + 211303: "龙城区", + 211321: "朝阳县", + 211322: "建平县", + 211324: "喀喇沁左翼蒙古族自治县", + 211381: "北票市", + 211382: "凌源市", + 211402: "连山区", + 211403: "龙港区", + 211404: "南票区", + 211421: "绥中县", + 211422: "建昌县", + 211481: "兴城市", + 220102: "南关区", + 220103: "宽城区", + 220104: "朝阳区", + 220105: "二道区", + 220106: "绿园区", + 220112: "双阳区", + 220113: "九台区", + 220122: "农安县", + 220171: "长春经济技术开发区", + 220172: "长春净月高新技术产业开发区", + 220173: "长春高新技术产业开发区", + 220174: "长春汽车经济技术开发区", + 220182: "榆树市", + 220183: "德惠市", + 220192: "经济技术开发区", + 220202: "昌邑区", + 220203: "龙潭区", + 220204: "船营区", + 220211: "丰满区", + 220221: "永吉县", + 220271: "吉林经济开发区", + 220272: "吉林高新技术产业开发区", + 220281: "蛟河市", + 220282: "桦甸市", + 220283: "舒兰市", + 220284: "磐石市", + 220302: "铁西区", + 220303: "铁东区", + 220322: "梨树县", + 220323: "伊通满族自治县", + 220381: "公主岭市", + 220382: "双辽市", + 220402: "龙山区", + 220403: "西安区", + 220421: "东丰县", + 220422: "东辽县", + 220502: "东昌区", + 220503: "二道江区", + 220521: "通化县", + 220523: "辉南县", + 220524: "柳河县", + 220581: "梅河口市", + 220582: "集安市", + 220602: "浑江区", + 220605: "江源区", + 220621: "抚松县", + 220622: "靖宇县", + 220623: "长白朝鲜族自治县", + 220681: "临江市", + 220702: "宁江区", + 220721: "前郭尔罗斯蒙古族自治县", + 220722: "长岭县", + 220723: "乾安县", + 220771: "吉林松原经济开发区", + 220781: "扶余市", + 220802: "洮北区", + 220821: "镇赉县", + 220822: "通榆县", + 220871: "吉林白城经济开发区", + 220881: "洮南市", + 220882: "大安市", + 222401: "延吉市", + 222402: "图们市", + 222403: "敦化市", + 222404: "珲春市", + 222405: "龙井市", + 222406: "和龙市", + 222424: "汪清县", + 222426: "安图县", + 230102: "道里区", + 230103: "南岗区", + 230104: "道外区", + 230108: "平房区", + 230109: "松北区", + 230110: "香坊区", + 230111: "呼兰区", + 230112: "阿城区", + 230113: "双城区", + 230123: "依兰县", + 230124: "方正县", + 230125: "宾县", + 230126: "巴彦县", + 230127: "木兰县", + 230128: "通河县", + 230129: "延寿县", + 230183: "尚志市", + 230184: "五常市", + 230202: "龙沙区", + 230203: "建华区", + 230204: "铁锋区", + 230205: "昂昂溪区", + 230206: "富拉尔基区", + 230207: "碾子山区", + 230208: "梅里斯达斡尔族区", + 230221: "龙江县", + 230223: "依安县", + 230224: "泰来县", + 230225: "甘南县", + 230227: "富裕县", + 230229: "克山县", + 230230: "克东县", + 230231: "拜泉县", + 230281: "讷河市", + 230302: "鸡冠区", + 230303: "恒山区", + 230304: "滴道区", + 230305: "梨树区", + 230306: "城子河区", + 230307: "麻山区", + 230321: "鸡东县", + 230381: "虎林市", + 230382: "密山市", + 230402: "向阳区", + 230403: "工农区", + 230404: "南山区", + 230405: "兴安区", + 230406: "东山区", + 230407: "兴山区", + 230421: "萝北县", + 230422: "绥滨县", + 230502: "尖山区", + 230503: "岭东区", + 230505: "四方台区", + 230506: "宝山区", + 230521: "集贤县", + 230522: "友谊县", + 230523: "宝清县", + 230524: "饶河县", + 230602: "萨尔图区", + 230603: "龙凤区", + 230604: "让胡路区", + 230605: "红岗区", + 230606: "大同区", + 230621: "肇州县", + 230622: "肇源县", + 230623: "林甸县", + 230624: "杜尔伯特蒙古族自治县", + 230671: "大庆高新技术产业开发区", + 230717: "伊美区", + 230718: "乌翠区", + 230719: "友好区", + 230722: "嘉荫县", + 230723: "汤旺县", + 230724: "丰林县", + 230725: "大箐山县", + 230726: "南岔县", + 230751: "金林区", + 230781: "铁力市", + 230803: "向阳区", + 230804: "前进区", + 230805: "东风区", + 230811: "郊区", + 230822: "桦南县", + 230826: "桦川县", + 230828: "汤原县", + 230881: "同江市", + 230882: "富锦市", + 230883: "抚远市", + 230902: "新兴区", + 230903: "桃山区", + 230904: "茄子河区", + 230921: "勃利县", + 231002: "东安区", + 231003: "阳明区", + 231004: "爱民区", + 231005: "西安区", + 231025: "林口县", + 231081: "绥芬河市", + 231083: "海林市", + 231084: "宁安市", + 231085: "穆棱市", + 231086: "东宁市", + 231102: "爱辉区", + 231123: "逊克县", + 231124: "孙吴县", + 231181: "北安市", + 231182: "五大连池市", + 231183: "嫩江市", + 231202: "北林区", + 231221: "望奎县", + 231222: "兰西县", + 231223: "青冈县", + 231224: "庆安县", + 231225: "明水县", + 231226: "绥棱县", + 231281: "安达市", + 231282: "肇东市", + 231283: "海伦市", + 232701: "漠河市", + 232721: "呼玛县", + 232722: "塔河县", + 232761: "加格达奇区", + 232762: "松岭区", + 232763: "新林区", + 232764: "呼中区", + 310101: "黄浦区", + 310104: "徐汇区", + 310105: "长宁区", + 310106: "静安区", + 310107: "普陀区", + 310109: "虹口区", + 310110: "杨浦区", + 310112: "闵行区", + 310113: "宝山区", + 310114: "嘉定区", + 310115: "浦东新区", + 310116: "金山区", + 310117: "松江区", + 310118: "青浦区", + 310120: "奉贤区", + 310151: "崇明区", + 320102: "玄武区", + 320104: "秦淮区", + 320105: "建邺区", + 320106: "鼓楼区", + 320111: "浦口区", + 320112: "江北新区", + 320113: "栖霞区", + 320114: "雨花台区", + 320115: "江宁区", + 320116: "六合区", + 320117: "溧水区", + 320118: "高淳区", + 320205: "锡山区", + 320206: "惠山区", + 320211: "滨湖区", + 320213: "梁溪区", + 320214: "新吴区", + 320281: "江阴市", + 320282: "宜兴市", + 320302: "鼓楼区", + 320303: "云龙区", + 320305: "贾汪区", + 320311: "泉山区", + 320312: "铜山区", + 320321: "丰县", + 320322: "沛县", + 320324: "睢宁县", + 320371: "徐州经济技术开发区", + 320381: "新沂市", + 320382: "邳州市", + 320391: "工业园区", + 320402: "天宁区", + 320404: "钟楼区", + 320411: "新北区", + 320412: "武进区", + 320413: "金坛区", + 320481: "溧阳市", + 320505: "虎丘区", + 320506: "吴中区", + 320507: "相城区", + 320508: "姑苏区", + 320509: "吴江区", + 320571: "苏州工业园区", + 320581: "常熟市", + 320582: "张家港市", + 320583: "昆山市", + 320585: "太仓市", + 320590: "工业园区", + 320591: "高新区", + 320602: "崇川区", + 320611: "港闸区", + 320612: "通州区", + 320623: "如东县", + 320681: "启东市", + 320682: "如皋市", + 320684: "海门市", + 320685: "海安市", + 320691: "高新区", + 320703: "连云区", + 320706: "海州区", + 320707: "赣榆区", + 320722: "东海县", + 320723: "灌云县", + 320724: "灌南县", + 320771: "连云港经济技术开发区", + 320803: "淮安区", + 320804: "淮阴区", + 320812: "清江浦区", + 320813: "洪泽区", + 320826: "涟水县", + 320830: "盱眙县", + 320831: "金湖县", + 320871: "淮安经济技术开发区", + 320890: "经济开发区", + 320902: "亭湖区", + 320903: "盐都区", + 320904: "大丰区", + 320921: "响水县", + 320922: "滨海县", + 320923: "阜宁县", + 320924: "射阳县", + 320925: "建湖县", + 320971: "盐城经济技术开发区", + 320981: "东台市", + 321002: "广陵区", + 321003: "邗江区", + 321012: "江都区", + 321023: "宝应县", + 321071: "扬州经济技术开发区", + 321081: "仪征市", + 321084: "高邮市", + 321090: "经济开发区", + 321102: "京口区", + 321111: "润州区", + 321112: "丹徒区", + 321150: "镇江新区", + 321181: "丹阳市", + 321182: "扬中市", + 321183: "句容市", + 321202: "海陵区", + 321203: "高港区", + 321204: "姜堰区", + 321271: "泰州医药高新技术产业开发区", + 321281: "兴化市", + 321282: "靖江市", + 321283: "泰兴市", + 321302: "宿城区", + 321311: "宿豫区", + 321322: "沭阳县", + 321323: "泗阳县", + 321324: "泗洪县", + 321371: "宿迁经济技术开发区", + 330102: "上城区", + 330105: "拱墅区", + 330106: "西湖区", + 330108: "滨江区", + 330109: "萧山区", + 330110: "余杭区", + 330111: "富阳区", + 330112: "临安区", + 330113: "临平区", + 330114: "钱塘区", + 330122: "桐庐县", + 330127: "淳安县", + 330182: "建德市", + 330203: "海曙区", + 330205: "江北区", + 330206: "北仑区", + 330211: "镇海区", + 330212: "鄞州区", + 330213: "奉化区", + 330225: "象山县", + 330226: "宁海县", + 330281: "余姚市", + 330282: "慈溪市", + 330302: "鹿城区", + 330303: "龙湾区", + 330304: "瓯海区", + 330305: "洞头区", + 330324: "永嘉县", + 330326: "平阳县", + 330327: "苍南县", + 330328: "文成县", + 330329: "泰顺县", + 330381: "瑞安市", + 330382: "乐清市", + 330383: "龙港市", + 330402: "南湖区", + 330411: "秀洲区", + 330421: "嘉善县", + 330424: "海盐县", + 330481: "海宁市", + 330482: "平湖市", + 330483: "桐乡市", + 330502: "吴兴区", + 330503: "南浔区", + 330521: "德清县", + 330522: "长兴县", + 330523: "安吉县", + 330602: "越城区", + 330603: "柯桥区", + 330604: "上虞区", + 330624: "新昌县", + 330681: "诸暨市", + 330683: "嵊州市", + 330702: "婺城区", + 330703: "金东区", + 330723: "武义县", + 330726: "浦江县", + 330727: "磐安县", + 330781: "兰溪市", + 330782: "义乌市", + 330783: "东阳市", + 330784: "永康市", + 330802: "柯城区", + 330803: "衢江区", + 330822: "常山县", + 330824: "开化县", + 330825: "龙游县", + 330881: "江山市", + 330902: "定海区", + 330903: "普陀区", + 330921: "岱山县", + 330922: "嵊泗县", + 331002: "椒江区", + 331003: "黄岩区", + 331004: "路桥区", + 331022: "三门县", + 331023: "天台县", + 331024: "仙居县", + 331081: "温岭市", + 331082: "临海市", + 331083: "玉环市", + 331102: "莲都区", + 331121: "青田县", + 331122: "缙云县", + 331123: "遂昌县", + 331124: "松阳县", + 331125: "云和县", + 331126: "庆元县", + 331127: "景宁畲族自治县", + 331181: "龙泉市", + 340102: "瑶海区", + 340103: "庐阳区", + 340104: "蜀山区", + 340111: "包河区", + 340121: "长丰县", + 340122: "肥东县", + 340123: "肥西县", + 340124: "庐江县", + 340171: "合肥高新技术产业开发区", + 340172: "合肥经济技术开发区", + 340173: "合肥新站高新技术产业开发区", + 340181: "巢湖市", + 340190: "高新技术开发区", + 340191: "经济技术开发区", + 340202: "镜湖区", + 340203: "弋江区", + 340207: "鸠江区", + 340208: "三山区", + 340221: "芜湖县", + 340222: "繁昌县", + 340223: "南陵县", + 340281: "无为市", + 340302: "龙子湖区", + 340303: "蚌山区", + 340304: "禹会区", + 340311: "淮上区", + 340321: "怀远县", + 340322: "五河县", + 340323: "固镇县", + 340371: "蚌埠市高新技术开发区", + 340372: "蚌埠市经济开发区", + 340402: "大通区", + 340403: "田家庵区", + 340404: "谢家集区", + 340405: "八公山区", + 340406: "潘集区", + 340421: "凤台县", + 340422: "寿县", + 340503: "花山区", + 340504: "雨山区", + 340506: "博望区", + 340521: "当涂县", + 340522: "含山县", + 340523: "和县", + 340602: "杜集区", + 340603: "相山区", + 340604: "烈山区", + 340621: "濉溪县", + 340705: "铜官区", + 340706: "义安区", + 340711: "郊区", + 340722: "枞阳县", + 340802: "迎江区", + 340803: "大观区", + 340811: "宜秀区", + 340822: "怀宁县", + 340825: "太湖县", + 340826: "宿松县", + 340827: "望江县", + 340828: "岳西县", + 340881: "桐城市", + 340882: "潜山市", + 341002: "屯溪区", + 341003: "黄山区", + 341004: "徽州区", + 341021: "歙县", + 341022: "休宁县", + 341023: "黟县", + 341024: "祁门县", + 341102: "琅琊区", + 341103: "南谯区", + 341122: "来安县", + 341124: "全椒县", + 341125: "定远县", + 341126: "凤阳县", + 341181: "天长市", + 341182: "明光市", + 341202: "颍州区", + 341203: "颍东区", + 341204: "颍泉区", + 341221: "临泉县", + 341222: "太和县", + 341225: "阜南县", + 341226: "颍上县", + 341271: "阜阳合肥现代产业园区", + 341282: "界首市", + 341302: "埇桥区", + 341321: "砀山县", + 341322: "萧县", + 341323: "灵璧县", + 341324: "泗县", + 341371: "宿州马鞍山现代产业园区", + 341372: "宿州经济技术开发区", + 341390: "经济开发区", + 341502: "金安区", + 341503: "裕安区", + 341504: "叶集区", + 341522: "霍邱县", + 341523: "舒城县", + 341524: "金寨县", + 341525: "霍山县", + 341602: "谯城区", + 341621: "涡阳县", + 341622: "蒙城县", + 341623: "利辛县", + 341702: "贵池区", + 341721: "东至县", + 341722: "石台县", + 341723: "青阳县", + 341802: "宣州区", + 341821: "郎溪县", + 341823: "泾县", + 341824: "绩溪县", + 341825: "旌德县", + 341871: "宣城市经济开发区", + 341881: "宁国市", + 341882: "广德市", + 350102: "鼓楼区", + 350103: "台江区", + 350104: "仓山区", + 350105: "马尾区", + 350111: "晋安区", + 350112: "长乐区", + 350121: "闽侯县", + 350122: "连江县", + 350123: "罗源县", + 350124: "闽清县", + 350125: "永泰县", + 350128: "平潭县", + 350181: "福清市", + 350203: "思明区", + 350205: "海沧区", + 350206: "湖里区", + 350211: "集美区", + 350212: "同安区", + 350213: "翔安区", + 350302: "城厢区", + 350303: "涵江区", + 350304: "荔城区", + 350305: "秀屿区", + 350322: "仙游县", + 350402: "梅列区", + 350403: "三元区", + 350421: "明溪县", + 350423: "清流县", + 350424: "宁化县", + 350425: "大田县", + 350426: "尤溪县", + 350427: "沙县", + 350428: "将乐县", + 350429: "泰宁县", + 350430: "建宁县", + 350481: "永安市", + 350502: "鲤城区", + 350503: "丰泽区", + 350504: "洛江区", + 350505: "泉港区", + 350521: "惠安县", + 350524: "安溪县", + 350525: "永春县", + 350526: "德化县", + 350527: "金门县", + 350581: "石狮市", + 350582: "晋江市", + 350583: "南安市", + 350602: "芗城区", + 350603: "龙文区", + 350622: "云霄县", + 350623: "漳浦县", + 350624: "诏安县", + 350625: "长泰县", + 350626: "东山县", + 350627: "南靖县", + 350628: "平和县", + 350629: "华安县", + 350681: "龙海市", + 350702: "延平区", + 350703: "建阳区", + 350721: "顺昌县", + 350722: "浦城县", + 350723: "光泽县", + 350724: "松溪县", + 350725: "政和县", + 350781: "邵武市", + 350782: "武夷山市", + 350783: "建瓯市", + 350802: "新罗区", + 350803: "永定区", + 350821: "长汀县", + 350823: "上杭县", + 350824: "武平县", + 350825: "连城县", + 350881: "漳平市", + 350902: "蕉城区", + 350921: "霞浦县", + 350922: "古田县", + 350923: "屏南县", + 350924: "寿宁县", + 350925: "周宁县", + 350926: "柘荣县", + 350981: "福安市", + 350982: "福鼎市", + 360102: "东湖区", + 360103: "西湖区", + 360104: "青云谱区", + 360111: "青山湖区", + 360112: "新建区", + 360113: "红谷滩区", + 360121: "南昌县", + 360123: "安义县", + 360124: "进贤县", + 360190: "经济技术开发区", + 360192: "高新区", + 360202: "昌江区", + 360203: "珠山区", + 360222: "浮梁县", + 360281: "乐平市", + 360302: "安源区", + 360313: "湘东区", + 360321: "莲花县", + 360322: "上栗县", + 360323: "芦溪县", + 360402: "濂溪区", + 360403: "浔阳区", + 360404: "柴桑区", + 360423: "武宁县", + 360424: "修水县", + 360425: "永修县", + 360426: "德安县", + 360428: "都昌县", + 360429: "湖口县", + 360430: "彭泽县", + 360481: "瑞昌市", + 360482: "共青城市", + 360483: "庐山市", + 360490: "经济技术开发区", + 360502: "渝水区", + 360521: "分宜县", + 360602: "月湖区", + 360603: "余江区", + 360681: "贵溪市", + 360702: "章贡区", + 360703: "南康区", + 360704: "赣县区", + 360722: "信丰县", + 360723: "大余县", + 360724: "上犹县", + 360725: "崇义县", + 360726: "安远县", + 360728: "定南县", + 360729: "全南县", + 360730: "宁都县", + 360731: "于都县", + 360732: "兴国县", + 360733: "会昌县", + 360734: "寻乌县", + 360735: "石城县", + 360781: "瑞金市", + 360783: "龙南市", + 360802: "吉州区", + 360803: "青原区", + 360821: "吉安县", + 360822: "吉水县", + 360823: "峡江县", + 360824: "新干县", + 360825: "永丰县", + 360826: "泰和县", + 360827: "遂川县", + 360828: "万安县", + 360829: "安福县", + 360830: "永新县", + 360881: "井冈山市", + 360902: "袁州区", + 360921: "奉新县", + 360922: "万载县", + 360923: "上高县", + 360924: "宜丰县", + 360925: "靖安县", + 360926: "铜鼓县", + 360981: "丰城市", + 360982: "樟树市", + 360983: "高安市", + 361002: "临川区", + 361003: "东乡区", + 361021: "南城县", + 361022: "黎川县", + 361023: "南丰县", + 361024: "崇仁县", + 361025: "乐安县", + 361026: "宜黄县", + 361027: "金溪县", + 361028: "资溪县", + 361030: "广昌县", + 361102: "信州区", + 361103: "广丰区", + 361104: "广信区", + 361123: "玉山县", + 361124: "铅山县", + 361125: "横峰县", + 361126: "弋阳县", + 361127: "余干县", + 361128: "鄱阳县", + 361129: "万年县", + 361130: "婺源县", + 361181: "德兴市", + 370102: "历下区", + 370103: "市中区", + 370104: "槐荫区", + 370105: "天桥区", + 370112: "历城区", + 370113: "长清区", + 370114: "章丘区", + 370115: "济阳区", + 370116: "莱芜区", + 370117: "钢城区", + 370124: "平阴县", + 370126: "商河县", + 370171: "济南高新技术产业开发区", + 370190: "高新区", + 370202: "市南区", + 370203: "市北区", + 370211: "黄岛区", + 370212: "崂山区", + 370213: "李沧区", + 370214: "城阳区", + 370215: "即墨区", + 370271: "青岛高新技术产业开发区", + 370281: "胶州市", + 370283: "平度市", + 370285: "莱西市", + 370290: "开发区", + 370302: "淄川区", + 370303: "张店区", + 370304: "博山区", + 370305: "临淄区", + 370306: "周村区", + 370321: "桓台县", + 370322: "高青县", + 370323: "沂源县", + 370402: "市中区", + 370403: "薛城区", + 370404: "峄城区", + 370405: "台儿庄区", + 370406: "山亭区", + 370481: "滕州市", + 370502: "东营区", + 370503: "河口区", + 370505: "垦利区", + 370522: "利津县", + 370523: "广饶县", + 370571: "东营经济技术开发区", + 370572: "东营港经济开发区", + 370602: "芝罘区", + 370611: "福山区", + 370612: "牟平区", + 370613: "莱山区", + 370634: "长岛县", + 370671: "烟台高新技术产业开发区", + 370672: "烟台经济技术开发区", + 370681: "龙口市", + 370682: "莱阳市", + 370683: "莱州市", + 370684: "蓬莱市", + 370685: "招远市", + 370686: "栖霞市", + 370687: "海阳市", + 370690: "开发区", + 370702: "潍城区", + 370703: "寒亭区", + 370704: "坊子区", + 370705: "奎文区", + 370724: "临朐县", + 370725: "昌乐县", + 370772: "潍坊滨海经济技术开发区", + 370781: "青州市", + 370782: "诸城市", + 370783: "寿光市", + 370784: "安丘市", + 370785: "高密市", + 370786: "昌邑市", + 370790: "开发区", + 370791: "高新区", + 370811: "任城区", + 370812: "兖州区", + 370826: "微山县", + 370827: "鱼台县", + 370828: "金乡县", + 370829: "嘉祥县", + 370830: "汶上县", + 370831: "泗水县", + 370832: "梁山县", + 370871: "济宁高新技术产业开发区", + 370881: "曲阜市", + 370883: "邹城市", + 370890: "高新区", + 370902: "泰山区", + 370911: "岱岳区", + 370921: "宁阳县", + 370923: "东平县", + 370982: "新泰市", + 370983: "肥城市", + 371002: "环翠区", + 371003: "文登区", + 371071: "威海火炬高技术产业开发区", + 371072: "威海经济技术开发区", + 371082: "荣成市", + 371083: "乳山市", + 371091: "经济技术开发区", + 371102: "东港区", + 371103: "岚山区", + 371121: "五莲县", + 371122: "莒县", + 371171: "日照经济技术开发区", + 371302: "兰山区", + 371311: "罗庄区", + 371312: "河东区", + 371321: "沂南县", + 371322: "郯城县", + 371323: "沂水县", + 371324: "兰陵县", + 371325: "费县", + 371326: "平邑县", + 371327: "莒南县", + 371328: "蒙阴县", + 371329: "临沭县", + 371371: "临沂高新技术产业开发区", + 371402: "德城区", + 371403: "陵城区", + 371422: "宁津县", + 371423: "庆云县", + 371424: "临邑县", + 371425: "齐河县", + 371426: "平原县", + 371427: "夏津县", + 371428: "武城县", + 371472: "德州运河经济开发区", + 371481: "乐陵市", + 371482: "禹城市", + 371502: "东昌府区", + 371503: "茌平区", + 371521: "阳谷县", + 371522: "莘县", + 371524: "东阿县", + 371525: "冠县", + 371526: "高唐县", + 371581: "临清市", + 371602: "滨城区", + 371603: "沾化区", + 371621: "惠民县", + 371622: "阳信县", + 371623: "无棣县", + 371625: "博兴县", + 371681: "邹平市", + 371702: "牡丹区", + 371703: "定陶区", + 371721: "曹县", + 371722: "单县", + 371723: "成武县", + 371724: "巨野县", + 371725: "郓城县", + 371726: "鄄城县", + 371728: "东明县", + 371771: "菏泽经济技术开发区", + 371772: "菏泽高新技术开发区", + 410102: "中原区", + 410103: "二七区", + 410104: "管城回族区", + 410105: "金水区", + 410106: "上街区", + 410108: "惠济区", + 410122: "中牟县", + 410171: "郑州经济技术开发区", + 410172: "郑州高新技术产业开发区", + 410173: "郑州航空港经济综合实验区", + 410181: "巩义市", + 410182: "荥阳市", + 410183: "新密市", + 410184: "新郑市", + 410185: "登封市", + 410190: "高新技术开发区", + 410191: "经济技术开发区", + 410202: "龙亭区", + 410203: "顺河回族区", + 410204: "鼓楼区", + 410205: "禹王台区", + 410212: "祥符区", + 410221: "杞县", + 410222: "通许县", + 410223: "尉氏县", + 410225: "兰考县", + 410302: "老城区", + 410303: "西工区", + 410304: "瀍河回族区", + 410305: "涧西区", + 410306: "吉利区", + 410311: "洛龙区", + 410322: "孟津县", + 410323: "新安县", + 410324: "栾川县", + 410325: "嵩县", + 410326: "汝阳县", + 410327: "宜阳县", + 410328: "洛宁县", + 410329: "伊川县", + 410381: "偃师市", + 410402: "新华区", + 410403: "卫东区", + 410404: "石龙区", + 410411: "湛河区", + 410421: "宝丰县", + 410422: "叶县", + 410423: "鲁山县", + 410425: "郏县", + 410471: "平顶山高新技术产业开发区", + 410481: "舞钢市", + 410482: "汝州市", + 410502: "文峰区", + 410503: "北关区", + 410505: "殷都区", + 410506: "龙安区", + 410522: "安阳县", + 410523: "汤阴县", + 410526: "滑县", + 410527: "内黄县", + 410581: "林州市", + 410590: "开发区", + 410602: "鹤山区", + 410603: "山城区", + 410611: "淇滨区", + 410621: "浚县", + 410622: "淇县", + 410702: "红旗区", + 410703: "卫滨区", + 410704: "凤泉区", + 410711: "牧野区", + 410721: "新乡县", + 410724: "获嘉县", + 410725: "原阳县", + 410726: "延津县", + 410727: "封丘县", + 410771: "新乡高新技术产业开发区", + 410772: "新乡经济技术开发区", + 410781: "卫辉市", + 410782: "辉县市", + 410783: "长垣市", + 410802: "解放区", + 410803: "中站区", + 410804: "马村区", + 410811: "山阳区", + 410821: "修武县", + 410822: "博爱县", + 410823: "武陟县", + 410825: "温县", + 410871: "焦作城乡一体化示范区", + 410882: "沁阳市", + 410883: "孟州市", + 410902: "华龙区", + 410922: "清丰县", + 410923: "南乐县", + 410926: "范县", + 410927: "台前县", + 410928: "濮阳县", + 410971: "河南濮阳工业园区", + 411002: "魏都区", + 411003: "建安区", + 411024: "鄢陵县", + 411025: "襄城县", + 411071: "许昌经济技术开发区", + 411081: "禹州市", + 411082: "长葛市", + 411102: "源汇区", + 411103: "郾城区", + 411104: "召陵区", + 411121: "舞阳县", + 411122: "临颍县", + 411171: "漯河经济技术开发区", + 411202: "湖滨区", + 411203: "陕州区", + 411221: "渑池县", + 411224: "卢氏县", + 411271: "河南三门峡经济开发区", + 411281: "义马市", + 411282: "灵宝市", + 411302: "宛城区", + 411303: "卧龙区", + 411321: "南召县", + 411322: "方城县", + 411323: "西峡县", + 411324: "镇平县", + 411325: "内乡县", + 411326: "淅川县", + 411327: "社旗县", + 411328: "唐河县", + 411329: "新野县", + 411330: "桐柏县", + 411372: "南阳市城乡一体化示范区", + 411381: "邓州市", + 411402: "梁园区", + 411403: "睢阳区", + 411421: "民权县", + 411422: "睢县", + 411423: "宁陵县", + 411424: "柘城县", + 411425: "虞城县", + 411426: "夏邑县", + 411481: "永城市", + 411502: "浉河区", + 411503: "平桥区", + 411521: "罗山县", + 411522: "光山县", + 411523: "新县", + 411524: "商城县", + 411525: "固始县", + 411526: "潢川县", + 411527: "淮滨县", + 411528: "息县", + 411602: "川汇区", + 411603: "淮阳区", + 411621: "扶沟县", + 411622: "西华县", + 411623: "商水县", + 411624: "沈丘县", + 411625: "郸城县", + 411627: "太康县", + 411628: "鹿邑县", + 411671: "河南周口经济开发区", + 411681: "项城市", + 411690: "经济开发区", + 411702: "驿城区", + 411721: "西平县", + 411722: "上蔡县", + 411723: "平舆县", + 411724: "正阳县", + 411725: "确山县", + 411726: "泌阳县", + 411727: "汝南县", + 411728: "遂平县", + 411729: "新蔡县", + 419001: "济源市", + 420102: "江岸区", + 420103: "江汉区", + 420104: "硚口区", + 420105: "汉阳区", + 420106: "武昌区", + 420107: "青山区", + 420111: "洪山区", + 420112: "东西湖区", + 420113: "汉南区", + 420114: "蔡甸区", + 420115: "江夏区", + 420116: "黄陂区", + 420117: "新洲区", + 420202: "黄石港区", + 420203: "西塞山区", + 420204: "下陆区", + 420205: "铁山区", + 420222: "阳新县", + 420281: "大冶市", + 420302: "茅箭区", + 420303: "张湾区", + 420304: "郧阳区", + 420322: "郧西县", + 420323: "竹山县", + 420324: "竹溪县", + 420325: "房县", + 420381: "丹江口市", + 420502: "西陵区", + 420503: "伍家岗区", + 420504: "点军区", + 420505: "猇亭区", + 420506: "夷陵区", + 420525: "远安县", + 420526: "兴山县", + 420527: "秭归县", + 420528: "长阳土家族自治县", + 420529: "五峰土家族自治县", + 420581: "宜都市", + 420582: "当阳市", + 420583: "枝江市", + 420590: "经济开发区", + 420602: "襄城区", + 420606: "樊城区", + 420607: "襄州区", + 420624: "南漳县", + 420625: "谷城县", + 420626: "保康县", + 420682: "老河口市", + 420683: "枣阳市", + 420684: "宜城市", + 420702: "梁子湖区", + 420703: "华容区", + 420704: "鄂城区", + 420802: "东宝区", + 420804: "掇刀区", + 420822: "沙洋县", + 420881: "钟祥市", + 420882: "京山市", + 420902: "孝南区", + 420921: "孝昌县", + 420922: "大悟县", + 420923: "云梦县", + 420981: "应城市", + 420982: "安陆市", + 420984: "汉川市", + 421002: "沙市区", + 421003: "荆州区", + 421022: "公安县", + 421023: "监利县", + 421024: "江陵县", + 421081: "石首市", + 421083: "洪湖市", + 421087: "松滋市", + 421102: "黄州区", + 421121: "团风县", + 421122: "红安县", + 421123: "罗田县", + 421124: "英山县", + 421125: "浠水县", + 421126: "蕲春县", + 421127: "黄梅县", + 421171: "龙感湖管理区", + 421181: "麻城市", + 421182: "武穴市", + 421202: "咸安区", + 421221: "嘉鱼县", + 421222: "通城县", + 421223: "崇阳县", + 421224: "通山县", + 421281: "赤壁市", + 421303: "曾都区", + 421321: "随县", + 421381: "广水市", + 422801: "恩施市", + 422802: "利川市", + 422822: "建始县", + 422823: "巴东县", + 422825: "宣恩县", + 422826: "咸丰县", + 422827: "来凤县", + 422828: "鹤峰县", + 429004: "仙桃市", + 429005: "潜江市", + 429006: "天门市", + 429021: "神农架林区", + 430102: "芙蓉区", + 430103: "天心区", + 430104: "岳麓区", + 430105: "开福区", + 430111: "雨花区", + 430112: "望城区", + 430121: "长沙县", + 430181: "浏阳市", + 430182: "宁乡市", + 430202: "荷塘区", + 430203: "芦淞区", + 430204: "石峰区", + 430211: "天元区", + 430212: "渌口区", + 430223: "攸县", + 430224: "茶陵县", + 430225: "炎陵县", + 430271: "云龙示范区", + 430281: "醴陵市", + 430302: "雨湖区", + 430304: "岳塘区", + 430321: "湘潭县", + 430373: "湘潭九华示范区", + 430381: "湘乡市", + 430382: "韶山市", + 430405: "珠晖区", + 430406: "雁峰区", + 430407: "石鼓区", + 430408: "蒸湘区", + 430412: "南岳区", + 430421: "衡阳县", + 430422: "衡南县", + 430423: "衡山县", + 430424: "衡东县", + 430426: "祁东县", + 430481: "耒阳市", + 430482: "常宁市", + 430502: "双清区", + 430503: "大祥区", + 430511: "北塔区", + 430522: "新邵县", + 430523: "邵阳县", + 430524: "隆回县", + 430525: "洞口县", + 430527: "绥宁县", + 430528: "新宁县", + 430529: "城步苗族自治县", + 430581: "武冈市", + 430582: "邵东市", + 430602: "岳阳楼区", + 430603: "云溪区", + 430611: "君山区", + 430621: "岳阳县", + 430623: "华容县", + 430624: "湘阴县", + 430626: "平江县", + 430681: "汨罗市", + 430682: "临湘市", + 430702: "武陵区", + 430703: "鼎城区", + 430721: "安乡县", + 430722: "汉寿县", + 430723: "澧县", + 430724: "临澧县", + 430725: "桃源县", + 430726: "石门县", + 430781: "津市市", + 430802: "永定区", + 430811: "武陵源区", + 430821: "慈利县", + 430822: "桑植县", + 430902: "资阳区", + 430903: "赫山区", + 430921: "南县", + 430922: "桃江县", + 430923: "安化县", + 430971: "益阳市大通湖管理区", + 430981: "沅江市", + 431002: "北湖区", + 431003: "苏仙区", + 431021: "桂阳县", + 431022: "宜章县", + 431023: "永兴县", + 431024: "嘉禾县", + 431025: "临武县", + 431026: "汝城县", + 431027: "桂东县", + 431028: "安仁县", + 431081: "资兴市", + 431102: "零陵区", + 431103: "冷水滩区", + 431121: "祁阳县", + 431122: "东安县", + 431123: "双牌县", + 431124: "道县", + 431125: "江永县", + 431126: "宁远县", + 431127: "蓝山县", + 431128: "新田县", + 431129: "江华瑶族自治县", + 431202: "鹤城区", + 431221: "中方县", + 431222: "沅陵县", + 431223: "辰溪县", + 431224: "溆浦县", + 431225: "会同县", + 431226: "麻阳苗族自治县", + 431227: "新晃侗族自治县", + 431228: "芷江侗族自治县", + 431229: "靖州苗族侗族自治县", + 431230: "通道侗族自治县", + 431271: "怀化市洪江管理区", + 431281: "洪江市", + 431302: "娄星区", + 431321: "双峰县", + 431322: "新化县", + 431381: "冷水江市", + 431382: "涟源市", + 433101: "吉首市", + 433122: "泸溪县", + 433123: "凤凰县", + 433124: "花垣县", + 433125: "保靖县", + 433126: "古丈县", + 433127: "永顺县", + 433130: "龙山县", + 440103: "荔湾区", + 440104: "越秀区", + 440105: "海珠区", + 440106: "天河区", + 440111: "白云区", + 440112: "黄埔区", + 440113: "番禺区", + 440114: "花都区", + 440115: "南沙区", + 440117: "从化区", + 440118: "增城区", + 440203: "武江区", + 440204: "浈江区", + 440205: "曲江区", + 440222: "始兴县", + 440224: "仁化县", + 440229: "翁源县", + 440232: "乳源瑶族自治县", + 440233: "新丰县", + 440281: "乐昌市", + 440282: "南雄市", + 440303: "罗湖区", + 440304: "福田区", + 440305: "南山区", + 440306: "宝安区", + 440307: "龙岗区", + 440308: "盐田区", + 440309: "龙华区", + 440310: "坪山区", + 440311: "光明区", + 440402: "香洲区", + 440403: "斗门区", + 440404: "金湾区", + 440507: "龙湖区", + 440511: "金平区", + 440512: "濠江区", + 440513: "潮阳区", + 440514: "潮南区", + 440515: "澄海区", + 440523: "南澳县", + 440604: "禅城区", + 440605: "南海区", + 440606: "顺德区", + 440607: "三水区", + 440608: "高明区", + 440703: "蓬江区", + 440704: "江海区", + 440705: "新会区", + 440781: "台山市", + 440783: "开平市", + 440784: "鹤山市", + 440785: "恩平市", + 440802: "赤坎区", + 440803: "霞山区", + 440804: "坡头区", + 440811: "麻章区", + 440823: "遂溪县", + 440825: "徐闻县", + 440881: "廉江市", + 440882: "雷州市", + 440883: "吴川市", + 440890: "经济技术开发区", + 440902: "茂南区", + 440904: "电白区", + 440981: "高州市", + 440982: "化州市", + 440983: "信宜市", + 441202: "端州区", + 441203: "鼎湖区", + 441204: "高要区", + 441223: "广宁县", + 441224: "怀集县", + 441225: "封开县", + 441226: "德庆县", + 441284: "四会市", + 441302: "惠城区", + 441303: "惠阳区", + 441322: "博罗县", + 441323: "惠东县", + 441324: "龙门县", + 441402: "梅江区", + 441403: "梅县区", + 441422: "大埔县", + 441423: "丰顺县", + 441424: "五华县", + 441426: "平远县", + 441427: "蕉岭县", + 441481: "兴宁市", + 441502: "城区", + 441521: "海丰县", + 441523: "陆河县", + 441581: "陆丰市", + 441602: "源城区", + 441621: "紫金县", + 441622: "龙川县", + 441623: "连平县", + 441624: "和平县", + 441625: "东源县", + 441702: "江城区", + 441704: "阳东区", + 441721: "阳西县", + 441781: "阳春市", + 441802: "清城区", + 441803: "清新区", + 441821: "佛冈县", + 441823: "阳山县", + 441825: "连山壮族瑶族自治县", + 441826: "连南瑶族自治县", + 441881: "英德市", + 441882: "连州市", + 441901: "中堂镇", + 441903: "南城街道", + 441904: "长安镇", + 441905: "东坑镇", + 441906: "樟木头镇", + 441907: "莞城街道", + 441908: "石龙镇", + 441909: "桥头镇", + 441910: "万江街道", + 441911: "麻涌镇", + 441912: "虎门镇", + 441913: "谢岗镇", + 441914: "石碣镇", + 441915: "茶山镇", + 441916: "东城街道", + 441917: "洪梅镇", + 441918: "道滘镇", + 441919: "高埗镇", + 441920: "企石镇", + 441921: "凤岗镇", + 441922: "大岭山镇", + 441923: "松山湖", + 441924: "清溪镇", + 441925: "望牛墩镇", + 441926: "厚街镇", + 441927: "常平镇", + 441928: "寮步镇", + 441929: "石排镇", + 441930: "横沥镇", + 441931: "塘厦镇", + 441932: "黄江镇", + 441933: "大朗镇", + 441934: "东莞港", + 441935: "东莞生态园", + 441990: "沙田镇", + 442001: "南头镇", + 442002: "神湾镇", + 442003: "东凤镇", + 442004: "五桂山街道", + 442005: "黄圃镇", + 442006: "小榄镇", + 442007: "石岐街道", + 442008: "横栏镇", + 442009: "三角镇", + 442010: "三乡镇", + 442011: "港口镇", + 442012: "沙溪镇", + 442013: "板芙镇", + 442015: "东升镇", + 442016: "阜沙镇", + 442017: "民众镇", + 442018: "东区街道", + 442019: "火炬开发区街道办事处", + 442020: "西区街道", + 442021: "南区街道", + 442022: "古镇镇", + 442023: "坦洲镇", + 442024: "大涌镇", + 442025: "南朗镇", + 445102: "湘桥区", + 445103: "潮安区", + 445122: "饶平县", + 445202: "榕城区", + 445203: "揭东区", + 445222: "揭西县", + 445224: "惠来县", + 445281: "普宁市", + 445302: "云城区", + 445303: "云安区", + 445321: "新兴县", + 445322: "郁南县", + 445381: "罗定市", + 450102: "兴宁区", + 450103: "青秀区", + 450105: "江南区", + 450107: "西乡塘区", + 450108: "良庆区", + 450109: "邕宁区", + 450110: "武鸣区", + 450123: "隆安县", + 450124: "马山县", + 450125: "上林县", + 450126: "宾阳县", + 450127: "横县", + 450202: "城中区", + 450203: "鱼峰区", + 450204: "柳南区", + 450205: "柳北区", + 450206: "柳江区", + 450222: "柳城县", + 450223: "鹿寨县", + 450224: "融安县", + 450225: "融水苗族自治县", + 450226: "三江侗族自治县", + 450302: "秀峰区", + 450303: "叠彩区", + 450304: "象山区", + 450305: "七星区", + 450311: "雁山区", + 450312: "临桂区", + 450321: "阳朔县", + 450323: "灵川县", + 450324: "全州县", + 450325: "兴安县", + 450326: "永福县", + 450327: "灌阳县", + 450328: "龙胜各族自治县", + 450329: "资源县", + 450330: "平乐县", + 450332: "恭城瑶族自治县", + 450381: "荔浦市", + 450403: "万秀区", + 450405: "长洲区", + 450406: "龙圩区", + 450421: "苍梧县", + 450422: "藤县", + 450423: "蒙山县", + 450481: "岑溪市", + 450502: "海城区", + 450503: "银海区", + 450512: "铁山港区", + 450521: "合浦县", + 450602: "港口区", + 450603: "防城区", + 450621: "上思县", + 450681: "东兴市", + 450702: "钦南区", + 450703: "钦北区", + 450721: "灵山县", + 450722: "浦北县", + 450802: "港北区", + 450803: "港南区", + 450804: "覃塘区", + 450821: "平南县", + 450881: "桂平市", + 450902: "玉州区", + 450903: "福绵区", + 450921: "容县", + 450922: "陆川县", + 450923: "博白县", + 450924: "兴业县", + 450981: "北流市", + 451002: "右江区", + 451003: "田阳区", + 451022: "田东县", + 451024: "德保县", + 451026: "那坡县", + 451027: "凌云县", + 451028: "乐业县", + 451029: "田林县", + 451030: "西林县", + 451031: "隆林各族自治县", + 451081: "靖西市", + 451082: "平果市", + 451102: "八步区", + 451103: "平桂区", + 451121: "昭平县", + 451122: "钟山县", + 451123: "富川瑶族自治县", + 451202: "金城江区", + 451203: "宜州区", + 451221: "南丹县", + 451222: "天峨县", + 451223: "凤山县", + 451224: "东兰县", + 451225: "罗城仫佬族自治县", + 451226: "环江毛南族自治县", + 451227: "巴马瑶族自治县", + 451228: "都安瑶族自治县", + 451229: "大化瑶族自治县", + 451302: "兴宾区", + 451321: "忻城县", + 451322: "象州县", + 451323: "武宣县", + 451324: "金秀瑶族自治县", + 451381: "合山市", + 451402: "江州区", + 451421: "扶绥县", + 451422: "宁明县", + 451423: "龙州县", + 451424: "大新县", + 451425: "天等县", + 451481: "凭祥市", + 460105: "秀英区", + 460106: "龙华区", + 460107: "琼山区", + 460108: "美兰区", + 460202: "海棠区", + 460203: "吉阳区", + 460204: "天涯区", + 460205: "崖州区", + 460321: "西沙区", + 460322: "南沙区", + 460401: "那大镇", + 460402: "和庆镇", + 460403: "南丰镇", + 460404: "大成镇", + 460405: "雅星镇", + 460406: "兰洋镇", + 460407: "光村镇", + 460408: "木棠镇", + 460409: "海头镇", + 460410: "峨蔓镇", + 460411: "王五镇", + 460412: "白马井镇", + 460413: "中和镇", + 460414: "排浦镇", + 460415: "东成镇", + 460416: "新州镇", + 460417: "洋浦经济开发区", + 460418: "华南热作学院", + 469001: "五指山市", + 469002: "琼海市", + 469005: "文昌市", + 469006: "万宁市", + 469007: "东方市", + 469021: "定安县", + 469022: "屯昌县", + 469023: "澄迈县", + 469024: "临高县", + 469025: "白沙黎族自治县", + 469026: "昌江黎族自治县", + 469027: "乐东黎族自治县", + 469028: "陵水黎族自治县", + 469029: "保亭黎族苗族自治县", + 469030: "琼中黎族苗族自治县", + 500101: "万州区", + 500102: "涪陵区", + 500103: "渝中区", + 500104: "大渡口区", + 500105: "江北区", + 500106: "沙坪坝区", + 500107: "九龙坡区", + 500108: "南岸区", + 500109: "北碚区", + 500110: "綦江区", + 500111: "大足区", + 500112: "渝北区", + 500113: "巴南区", + 500114: "黔江区", + 500115: "长寿区", + 500116: "江津区", + 500117: "合川区", + 500118: "永川区", + 500119: "南川区", + 500120: "璧山区", + 500151: "铜梁区", + 500152: "潼南区", + 500153: "荣昌区", + 500154: "开州区", + 500155: "梁平区", + 500156: "武隆区", + 500229: "城口县", + 500230: "丰都县", + 500231: "垫江县", + 500233: "忠县", + 500235: "云阳县", + 500236: "奉节县", + 500237: "巫山县", + 500238: "巫溪县", + 500240: "石柱土家族自治县", + 500241: "秀山土家族苗族自治县", + 500242: "酉阳土家族苗族自治县", + 500243: "彭水苗族土家族自治县", + 510104: "锦江区", + 510105: "青羊区", + 510106: "金牛区", + 510107: "武侯区", + 510108: "成华区", + 510112: "龙泉驿区", + 510113: "青白江区", + 510114: "新都区", + 510115: "温江区", + 510116: "双流区", + 510117: "郫都区", + 510121: "金堂县", + 510129: "大邑县", + 510131: "蒲江县", + 510132: "新津县", + 510181: "都江堰市", + 510182: "彭州市", + 510183: "邛崃市", + 510184: "崇州市", + 510185: "简阳市", + 510191: "高新区", + 510302: "自流井区", + 510303: "贡井区", + 510304: "大安区", + 510311: "沿滩区", + 510321: "荣县", + 510322: "富顺县", + 510402: "东区", + 510403: "西区", + 510411: "仁和区", + 510421: "米易县", + 510422: "盐边县", + 510502: "江阳区", + 510503: "纳溪区", + 510504: "龙马潭区", + 510521: "泸县", + 510522: "合江县", + 510524: "叙永县", + 510525: "古蔺县", + 510603: "旌阳区", + 510604: "罗江区", + 510623: "中江县", + 510681: "广汉市", + 510682: "什邡市", + 510683: "绵竹市", + 510703: "涪城区", + 510704: "游仙区", + 510705: "安州区", + 510722: "三台县", + 510723: "盐亭县", + 510725: "梓潼县", + 510726: "北川羌族自治县", + 510727: "平武县", + 510781: "江油市", + 510791: "高新区", + 510802: "利州区", + 510811: "昭化区", + 510812: "朝天区", + 510821: "旺苍县", + 510822: "青川县", + 510823: "剑阁县", + 510824: "苍溪县", + 510903: "船山区", + 510904: "安居区", + 510921: "蓬溪县", + 510923: "大英县", + 510981: "射洪市", + 511002: "市中区", + 511011: "东兴区", + 511024: "威远县", + 511025: "资中县", + 511083: "隆昌市", + 511102: "市中区", + 511111: "沙湾区", + 511112: "五通桥区", + 511113: "金口河区", + 511123: "犍为县", + 511124: "井研县", + 511126: "夹江县", + 511129: "沐川县", + 511132: "峨边彝族自治县", + 511133: "马边彝族自治县", + 511181: "峨眉山市", + 511302: "顺庆区", + 511303: "高坪区", + 511304: "嘉陵区", + 511321: "南部县", + 511322: "营山县", + 511323: "蓬安县", + 511324: "仪陇县", + 511325: "西充县", + 511381: "阆中市", + 511402: "东坡区", + 511403: "彭山区", + 511421: "仁寿县", + 511423: "洪雅县", + 511424: "丹棱县", + 511425: "青神县", + 511502: "翠屏区", + 511503: "南溪区", + 511504: "叙州区", + 511523: "江安县", + 511524: "长宁县", + 511525: "高县", + 511526: "珙县", + 511527: "筠连县", + 511528: "兴文县", + 511529: "屏山县", + 511602: "广安区", + 511603: "前锋区", + 511621: "岳池县", + 511622: "武胜县", + 511623: "邻水县", + 511681: "华蓥市", + 511702: "通川区", + 511703: "达川区", + 511722: "宣汉县", + 511723: "开江县", + 511724: "大竹县", + 511725: "渠县", + 511781: "万源市", + 511802: "雨城区", + 511803: "名山区", + 511822: "荥经县", + 511823: "汉源县", + 511824: "石棉县", + 511825: "天全县", + 511826: "芦山县", + 511827: "宝兴县", + 511902: "巴州区", + 511903: "恩阳区", + 511921: "通江县", + 511922: "南江县", + 511923: "平昌县", + 511971: "巴中经济开发区", + 512002: "雁江区", + 512021: "安岳县", + 512022: "乐至县", + 513201: "马尔康市", + 513221: "汶川县", + 513222: "理县", + 513223: "茂县", + 513224: "松潘县", + 513225: "九寨沟县", + 513226: "金川县", + 513227: "小金县", + 513228: "黑水县", + 513230: "壤塘县", + 513231: "阿坝县", + 513232: "若尔盖县", + 513233: "红原县", + 513301: "康定市", + 513322: "泸定县", + 513323: "丹巴县", + 513324: "九龙县", + 513325: "雅江县", + 513326: "道孚县", + 513327: "炉霍县", + 513328: "甘孜县", + 513329: "新龙县", + 513330: "德格县", + 513331: "白玉县", + 513332: "石渠县", + 513333: "色达县", + 513334: "理塘县", + 513335: "巴塘县", + 513336: "乡城县", + 513337: "稻城县", + 513338: "得荣县", + 513401: "西昌市", + 513422: "木里藏族自治县", + 513423: "盐源县", + 513424: "德昌县", + 513425: "会理县", + 513426: "会东县", + 513427: "宁南县", + 513428: "普格县", + 513429: "布拖县", + 513430: "金阳县", + 513431: "昭觉县", + 513432: "喜德县", + 513433: "冕宁县", + 513434: "越西县", + 513435: "甘洛县", + 513436: "美姑县", + 513437: "雷波县", + 520102: "南明区", + 520103: "云岩区", + 520111: "花溪区", + 520112: "乌当区", + 520113: "白云区", + 520115: "观山湖区", + 520121: "开阳县", + 520122: "息烽县", + 520123: "修文县", + 520181: "清镇市", + 520201: "钟山区", + 520203: "六枝特区", + 520221: "水城县", + 520281: "盘州市", + 520302: "红花岗区", + 520303: "汇川区", + 520304: "播州区", + 520322: "桐梓县", + 520323: "绥阳县", + 520324: "正安县", + 520325: "道真仡佬族苗族自治县", + 520326: "务川仡佬族苗族自治县", + 520327: "凤冈县", + 520328: "湄潭县", + 520329: "余庆县", + 520330: "习水县", + 520381: "赤水市", + 520382: "仁怀市", + 520402: "西秀区", + 520403: "平坝区", + 520422: "普定县", + 520423: "镇宁布依族苗族自治县", + 520424: "关岭布依族苗族自治县", + 520425: "紫云苗族布依族自治县", + 520502: "七星关区", + 520521: "大方县", + 520522: "黔西县", + 520523: "金沙县", + 520524: "织金县", + 520525: "纳雍县", + 520526: "威宁彝族回族苗族自治县", + 520527: "赫章县", + 520602: "碧江区", + 520603: "万山区", + 520621: "江口县", + 520622: "玉屏侗族自治县", + 520623: "石阡县", + 520624: "思南县", + 520625: "印江土家族苗族自治县", + 520626: "德江县", + 520627: "沿河土家族自治县", + 520628: "松桃苗族自治县", + 522301: "兴义市", + 522302: "兴仁市", + 522323: "普安县", + 522324: "晴隆县", + 522325: "贞丰县", + 522326: "望谟县", + 522327: "册亨县", + 522328: "安龙县", + 522601: "凯里市", + 522622: "黄平县", + 522623: "施秉县", + 522624: "三穗县", + 522625: "镇远县", + 522626: "岑巩县", + 522627: "天柱县", + 522628: "锦屏县", + 522629: "剑河县", + 522630: "台江县", + 522631: "黎平县", + 522632: "榕江县", + 522633: "从江县", + 522634: "雷山县", + 522635: "麻江县", + 522636: "丹寨县", + 522701: "都匀市", + 522702: "福泉市", + 522722: "荔波县", + 522723: "贵定县", + 522725: "瓮安县", + 522726: "独山县", + 522727: "平塘县", + 522728: "罗甸县", + 522729: "长顺县", + 522730: "龙里县", + 522731: "惠水县", + 522732: "三都水族自治县", + 530102: "五华区", + 530103: "盘龙区", + 530111: "官渡区", + 530112: "西山区", + 530113: "东川区", + 530114: "呈贡区", + 530115: "晋宁区", + 530124: "富民县", + 530125: "宜良县", + 530126: "石林彝族自治县", + 530127: "嵩明县", + 530128: "禄劝彝族苗族自治县", + 530129: "寻甸回族彝族自治县", + 530181: "安宁市", + 530302: "麒麟区", + 530303: "沾益区", + 530304: "马龙区", + 530322: "陆良县", + 530323: "师宗县", + 530324: "罗平县", + 530325: "富源县", + 530326: "会泽县", + 530381: "宣威市", + 530402: "红塔区", + 530403: "江川区", + 530423: "通海县", + 530424: "华宁县", + 530425: "易门县", + 530426: "峨山彝族自治县", + 530427: "新平彝族傣族自治县", + 530428: "元江哈尼族彝族傣族自治县", + 530481: "澄江市", + 530502: "隆阳区", + 530521: "施甸县", + 530523: "龙陵县", + 530524: "昌宁县", + 530581: "腾冲市", + 530602: "昭阳区", + 530621: "鲁甸县", + 530622: "巧家县", + 530623: "盐津县", + 530624: "大关县", + 530625: "永善县", + 530626: "绥江县", + 530627: "镇雄县", + 530628: "彝良县", + 530629: "威信县", + 530681: "水富市", + 530702: "古城区", + 530721: "玉龙纳西族自治县", + 530722: "永胜县", + 530723: "华坪县", + 530724: "宁蒗彝族自治县", + 530802: "思茅区", + 530821: "宁洱哈尼族彝族自治县", + 530822: "墨江哈尼族自治县", + 530823: "景东彝族自治县", + 530824: "景谷傣族彝族自治县", + 530825: "镇沅彝族哈尼族拉祜族自治县", + 530826: "江城哈尼族彝族自治县", + 530827: "孟连傣族拉祜族佤族自治县", + 530828: "澜沧拉祜族自治县", + 530829: "西盟佤族自治县", + 530902: "临翔区", + 530921: "凤庆县", + 530922: "云县", + 530923: "永德县", + 530924: "镇康县", + 530925: "双江拉祜族佤族布朗族傣族自治县", + 530926: "耿马傣族佤族自治县", + 530927: "沧源佤族自治县", + 532301: "楚雄市", + 532322: "双柏县", + 532323: "牟定县", + 532324: "南华县", + 532325: "姚安县", + 532326: "大姚县", + 532327: "永仁县", + 532328: "元谋县", + 532329: "武定县", + 532331: "禄丰县", + 532501: "个旧市", + 532502: "开远市", + 532503: "蒙自市", + 532504: "弥勒市", + 532523: "屏边苗族自治县", + 532524: "建水县", + 532525: "石屏县", + 532527: "泸西县", + 532528: "元阳县", + 532529: "红河县", + 532530: "金平苗族瑶族傣族自治县", + 532531: "绿春县", + 532532: "河口瑶族自治县", + 532601: "文山市", + 532622: "砚山县", + 532623: "西畴县", + 532624: "麻栗坡县", + 532625: "马关县", + 532626: "丘北县", + 532627: "广南县", + 532628: "富宁县", + 532801: "景洪市", + 532822: "勐海县", + 532823: "勐腊县", + 532901: "大理市", + 532922: "漾濞彝族自治县", + 532923: "祥云县", + 532924: "宾川县", + 532925: "弥渡县", + 532926: "南涧彝族自治县", + 532927: "巍山彝族回族自治县", + 532928: "永平县", + 532929: "云龙县", + 532930: "洱源县", + 532931: "剑川县", + 532932: "鹤庆县", + 533102: "瑞丽市", + 533103: "芒市", + 533122: "梁河县", + 533123: "盈江县", + 533124: "陇川县", + 533301: "泸水市", + 533323: "福贡县", + 533324: "贡山独龙族怒族自治县", + 533325: "兰坪白族普米族自治县", + 533401: "香格里拉市", + 533422: "德钦县", + 533423: "维西傈僳族自治县", + 540102: "城关区", + 540103: "堆龙德庆区", + 540104: "达孜区", + 540121: "林周县", + 540122: "当雄县", + 540123: "尼木县", + 540124: "曲水县", + 540127: "墨竹工卡县", + 540202: "桑珠孜区", + 540221: "南木林县", + 540222: "江孜县", + 540223: "定日县", + 540224: "萨迦县", + 540225: "拉孜县", + 540226: "昂仁县", + 540227: "谢通门县", + 540228: "白朗县", + 540229: "仁布县", + 540230: "康马县", + 540231: "定结县", + 540232: "仲巴县", + 540233: "亚东县", + 540234: "吉隆县", + 540235: "聂拉木县", + 540236: "萨嘎县", + 540237: "岗巴县", + 540302: "卡若区", + 540321: "江达县", + 540322: "贡觉县", + 540323: "类乌齐县", + 540324: "丁青县", + 540325: "察雅县", + 540326: "八宿县", + 540327: "左贡县", + 540328: "芒康县", + 540329: "洛隆县", + 540330: "边坝县", + 540402: "巴宜区", + 540421: "工布江达县", + 540422: "米林县", + 540423: "墨脱县", + 540424: "波密县", + 540425: "察隅县", + 540426: "朗县", + 540502: "乃东区", + 540521: "扎囊县", + 540522: "贡嘎县", + 540523: "桑日县", + 540524: "琼结县", + 540525: "曲松县", + 540526: "措美县", + 540527: "洛扎县", + 540528: "加查县", + 540529: "隆子县", + 540530: "错那县", + 540531: "浪卡子县", + 540602: "色尼区", + 540621: "嘉黎县", + 540622: "比如县", + 540623: "聂荣县", + 540624: "安多县", + 540625: "申扎县", + 540626: "索县", + 540627: "班戈县", + 540628: "巴青县", + 540629: "尼玛县", + 540630: "双湖县", + 542521: "普兰县", + 542522: "札达县", + 542523: "噶尔县", + 542524: "日土县", + 542525: "革吉县", + 542526: "改则县", + 542527: "措勤县", + 610102: "新城区", + 610103: "碑林区", + 610104: "莲湖区", + 610111: "灞桥区", + 610112: "未央区", + 610113: "雁塔区", + 610114: "阎良区", + 610115: "临潼区", + 610116: "长安区", + 610117: "高陵区", + 610118: "鄠邑区", + 610122: "蓝田县", + 610124: "周至县", + 610202: "王益区", + 610203: "印台区", + 610204: "耀州区", + 610222: "宜君县", + 610302: "渭滨区", + 610303: "金台区", + 610304: "陈仓区", + 610322: "凤翔县", + 610323: "岐山县", + 610324: "扶风县", + 610326: "眉县", + 610327: "陇县", + 610328: "千阳县", + 610329: "麟游县", + 610330: "凤县", + 610331: "太白县", + 610402: "秦都区", + 610403: "杨陵区", + 610404: "渭城区", + 610422: "三原县", + 610423: "泾阳县", + 610424: "乾县", + 610425: "礼泉县", + 610426: "永寿县", + 610428: "长武县", + 610429: "旬邑县", + 610430: "淳化县", + 610431: "武功县", + 610481: "兴平市", + 610482: "彬州市", + 610502: "临渭区", + 610503: "华州区", + 610522: "潼关县", + 610523: "大荔县", + 610524: "合阳县", + 610525: "澄城县", + 610526: "蒲城县", + 610527: "白水县", + 610528: "富平县", + 610581: "韩城市", + 610582: "华阴市", + 610602: "宝塔区", + 610603: "安塞区", + 610621: "延长县", + 610622: "延川县", + 610625: "志丹县", + 610626: "吴起县", + 610627: "甘泉县", + 610628: "富县", + 610629: "洛川县", + 610630: "宜川县", + 610631: "黄龙县", + 610632: "黄陵县", + 610681: "子长市", + 610702: "汉台区", + 610703: "南郑区", + 610722: "城固县", + 610723: "洋县", + 610724: "西乡县", + 610725: "勉县", + 610726: "宁强县", + 610727: "略阳县", + 610728: "镇巴县", + 610729: "留坝县", + 610730: "佛坪县", + 610802: "榆阳区", + 610803: "横山区", + 610822: "府谷县", + 610824: "靖边县", + 610825: "定边县", + 610826: "绥德县", + 610827: "米脂县", + 610828: "佳县", + 610829: "吴堡县", + 610830: "清涧县", + 610831: "子洲县", + 610881: "神木市", + 610902: "汉滨区", + 610921: "汉阴县", + 610922: "石泉县", + 610923: "宁陕县", + 610924: "紫阳县", + 610925: "岚皋县", + 610926: "平利县", + 610927: "镇坪县", + 610928: "旬阳县", + 610929: "白河县", + 611002: "商州区", + 611021: "洛南县", + 611022: "丹凤县", + 611023: "商南县", + 611024: "山阳县", + 611025: "镇安县", + 611026: "柞水县", + 620102: "城关区", + 620103: "七里河区", + 620104: "西固区", + 620105: "安宁区", + 620111: "红古区", + 620121: "永登县", + 620122: "皋兰县", + 620123: "榆中县", + 620171: "兰州新区", + 620201: "市辖区", + 620290: "雄关区", + 620291: "长城区", + 620292: "镜铁区", + 620293: "新城镇", + 620294: "峪泉镇", + 620295: "文殊镇", + 620302: "金川区", + 620321: "永昌县", + 620402: "白银区", + 620403: "平川区", + 620421: "靖远县", + 620422: "会宁县", + 620423: "景泰县", + 620502: "秦州区", + 620503: "麦积区", + 620521: "清水县", + 620522: "秦安县", + 620523: "甘谷县", + 620524: "武山县", + 620525: "张家川回族自治县", + 620602: "凉州区", + 620621: "民勤县", + 620622: "古浪县", + 620623: "天祝藏族自治县", + 620702: "甘州区", + 620721: "肃南裕固族自治县", + 620722: "民乐县", + 620723: "临泽县", + 620724: "高台县", + 620725: "山丹县", + 620802: "崆峒区", + 620821: "泾川县", + 620822: "灵台县", + 620823: "崇信县", + 620825: "庄浪县", + 620826: "静宁县", + 620881: "华亭市", + 620902: "肃州区", + 620921: "金塔县", + 620922: "瓜州县", + 620923: "肃北蒙古族自治县", + 620924: "阿克塞哈萨克族自治县", + 620981: "玉门市", + 620982: "敦煌市", + 621002: "西峰区", + 621021: "庆城县", + 621022: "环县", + 621023: "华池县", + 621024: "合水县", + 621025: "正宁县", + 621026: "宁县", + 621027: "镇原县", + 621102: "安定区", + 621121: "通渭县", + 621122: "陇西县", + 621123: "渭源县", + 621124: "临洮县", + 621125: "漳县", + 621126: "岷县", + 621202: "武都区", + 621221: "成县", + 621222: "文县", + 621223: "宕昌县", + 621224: "康县", + 621225: "西和县", + 621226: "礼县", + 621227: "徽县", + 621228: "两当县", + 622901: "临夏市", + 622921: "临夏县", + 622922: "康乐县", + 622923: "永靖县", + 622924: "广河县", + 622925: "和政县", + 622926: "东乡族自治县", + 622927: "积石山保安族东乡族撒拉族自治县", + 623001: "合作市", + 623021: "临潭县", + 623022: "卓尼县", + 623023: "舟曲县", + 623024: "迭部县", + 623025: "玛曲县", + 623026: "碌曲县", + 623027: "夏河县", + 630102: "城东区", + 630103: "城中区", + 630104: "城西区", + 630105: "城北区", + 630106: "湟中区", + 630121: "大通回族土族自治县", + 630123: "湟源县", + 630202: "乐都区", + 630203: "平安区", + 630222: "民和回族土族自治县", + 630223: "互助土族自治县", + 630224: "化隆回族自治县", + 630225: "循化撒拉族自治县", + 632221: "门源回族自治县", + 632222: "祁连县", + 632223: "海晏县", + 632224: "刚察县", + 632321: "同仁县", + 632322: "尖扎县", + 632323: "泽库县", + 632324: "河南蒙古族自治县", + 632521: "共和县", + 632522: "同德县", + 632523: "贵德县", + 632524: "兴海县", + 632525: "贵南县", + 632621: "玛沁县", + 632622: "班玛县", + 632623: "甘德县", + 632624: "达日县", + 632625: "久治县", + 632626: "玛多县", + 632701: "玉树市", + 632722: "杂多县", + 632723: "称多县", + 632724: "治多县", + 632725: "囊谦县", + 632726: "曲麻莱县", + 632801: "格尔木市", + 632802: "德令哈市", + 632803: "茫崖市", + 632821: "乌兰县", + 632822: "都兰县", + 632823: "天峻县", + 632857: "大柴旦行政委员会", + 640104: "兴庆区", + 640105: "西夏区", + 640106: "金凤区", + 640121: "永宁县", + 640122: "贺兰县", + 640181: "灵武市", + 640202: "大武口区", + 640205: "惠农区", + 640221: "平罗县", + 640302: "利通区", + 640303: "红寺堡区", + 640323: "盐池县", + 640324: "同心县", + 640381: "青铜峡市", + 640402: "原州区", + 640422: "西吉县", + 640423: "隆德县", + 640424: "泾源县", + 640425: "彭阳县", + 640502: "沙坡头区", + 640521: "中宁县", + 640522: "海原县", + 650102: "天山区", + 650103: "沙依巴克区", + 650104: "新市区", + 650105: "水磨沟区", + 650106: "头屯河区", + 650107: "达坂城区", + 650109: "米东区", + 650121: "乌鲁木齐县", + 650202: "独山子区", + 650203: "克拉玛依区", + 650204: "白碱滩区", + 650205: "乌尔禾区", + 650402: "高昌区", + 650421: "鄯善县", + 650422: "托克逊县", + 650502: "伊州区", + 650521: "巴里坤哈萨克自治县", + 650522: "伊吾县", + 652301: "昌吉市", + 652302: "阜康市", + 652323: "呼图壁县", + 652324: "玛纳斯县", + 652325: "奇台县", + 652327: "吉木萨尔县", + 652328: "木垒哈萨克自治县", + 652701: "博乐市", + 652702: "阿拉山口市", + 652722: "精河县", + 652723: "温泉县", + 652801: "库尔勒市", + 652822: "轮台县", + 652823: "尉犁县", + 652824: "若羌县", + 652825: "且末县", + 652826: "焉耆回族自治县", + 652827: "和静县", + 652828: "和硕县", + 652829: "博湖县", + 652901: "阿克苏市", + 652902: "库车市", + 652922: "温宿县", + 652924: "沙雅县", + 652925: "新和县", + 652926: "拜城县", + 652927: "乌什县", + 652928: "阿瓦提县", + 652929: "柯坪县", + 653001: "阿图什市", + 653022: "阿克陶县", + 653023: "阿合奇县", + 653024: "乌恰县", + 653101: "喀什市", + 653121: "疏附县", + 653122: "疏勒县", + 653123: "英吉沙县", + 653124: "泽普县", + 653125: "莎车县", + 653126: "叶城县", + 653127: "麦盖提县", + 653128: "岳普湖县", + 653129: "伽师县", + 653130: "巴楚县", + 653131: "塔什库尔干塔吉克自治县", + 653201: "和田市", + 653221: "和田县", + 653222: "墨玉县", + 653223: "皮山县", + 653224: "洛浦县", + 653225: "策勒县", + 653226: "于田县", + 653227: "民丰县", + 654002: "伊宁市", + 654003: "奎屯市", + 654004: "霍尔果斯市", + 654021: "伊宁县", + 654022: "察布查尔锡伯自治县", + 654023: "霍城县", + 654024: "巩留县", + 654025: "新源县", + 654026: "昭苏县", + 654027: "特克斯县", + 654028: "尼勒克县", + 654201: "塔城市", + 654202: "乌苏市", + 654221: "额敏县", + 654223: "沙湾县", + 654224: "托里县", + 654225: "裕民县", + 654226: "和布克赛尔蒙古自治县", + 654301: "阿勒泰市", + 654321: "布尔津县", + 654322: "富蕴县", + 654323: "福海县", + 654324: "哈巴河县", + 654325: "青河县", + 654326: "吉木乃县", + 659001: "石河子市", + 659002: "阿拉尔市", + 659003: "图木舒克市", + 659004: "五家渠市", + 659005: "北屯市", + 659006: "铁门关市", + 659007: "双河市", + 659008: "可克达拉市", + 659009: "昆玉市", + 659010: "胡杨河市", + 710101: "中正区", + 710102: "大同区", + 710103: "中山区", + 710104: "松山区", + 710105: "大安区", + 710106: "万华区", + 710107: "信义区", + 710108: "士林区", + 710109: "北投区", + 710110: "内湖区", + 710111: "南港区", + 710112: "文山区", + 710199: "其它区", + 710201: "新兴区", + 710202: "前金区", + 710203: "芩雅区", + 710204: "盐埕区", + 710205: "鼓山区", + 710206: "旗津区", + 710207: "前镇区", + 710208: "三民区", + 710209: "左营区", + 710210: "楠梓区", + 710211: "小港区", + 710241: "苓雅区", + 710242: "仁武区", + 710243: "大社区", + 710244: "冈山区", + 710245: "路竹区", + 710246: "阿莲区", + 710247: "田寮区", + 710248: "燕巢区", + 710249: "桥头区", + 710250: "梓官区", + 710251: "弥陀区", + 710252: "永安区", + 710253: "湖内区", + 710254: "凤山区", + 710255: "大寮区", + 710256: "林园区", + 710257: "鸟松区", + 710258: "大树区", + 710259: "旗山区", + 710260: "美浓区", + 710261: "六龟区", + 710262: "内门区", + 710263: "杉林区", + 710264: "甲仙区", + 710265: "桃源区", + 710266: "那玛夏区", + 710267: "茂林区", + 710268: "茄萣区", + 710299: "其它区", + 710301: "中西区", + 710302: "东区", + 710303: "南区", + 710304: "北区", + 710305: "安平区", + 710306: "安南区", + 710339: "永康区", + 710340: "归仁区", + 710341: "新化区", + 710342: "左镇区", + 710343: "玉井区", + 710344: "楠西区", + 710345: "南化区", + 710346: "仁德区", + 710347: "关庙区", + 710348: "龙崎区", + 710349: "官田区", + 710350: "麻豆区", + 710351: "佳里区", + 710352: "西港区", + 710353: "七股区", + 710354: "将军区", + 710355: "学甲区", + 710356: "北门区", + 710357: "新营区", + 710358: "后壁区", + 710359: "白河区", + 710360: "东山区", + 710361: "六甲区", + 710362: "下营区", + 710363: "柳营区", + 710364: "盐水区", + 710365: "善化区", + 710366: "大内区", + 710367: "山上区", + 710368: "新市区", + 710369: "安定区", + 710399: "其它区", + 710401: "中区", + 710402: "东区", + 710403: "南区", + 710404: "西区", + 710405: "北区", + 710406: "北屯区", + 710407: "西屯区", + 710408: "南屯区", + 710431: "太平区", + 710432: "大里区", + 710433: "雾峰区", + 710434: "乌日区", + 710435: "丰原区", + 710436: "后里区", + 710437: "石冈区", + 710438: "东势区", + 710439: "和平区", + 710440: "新社区", + 710441: "潭子区", + 710442: "大雅区", + 710443: "神冈区", + 710444: "大肚区", + 710445: "沙鹿区", + 710446: "龙井区", + 710447: "梧栖区", + 710448: "清水区", + 710449: "大甲区", + 710450: "外埔区", + 710451: "大安区", + 710499: "其它区", + 710507: "金沙镇", + 710508: "金湖镇", + 710509: "金宁乡", + 710510: "金城镇", + 710511: "烈屿乡", + 710512: "乌坵乡", + 710614: "南投市", + 710615: "中寮乡", + 710616: "草屯镇", + 710617: "国姓乡", + 710618: "埔里镇", + 710619: "仁爱乡", + 710620: "名间乡", + 710621: "集集镇", + 710622: "水里乡", + 710623: "鱼池乡", + 710624: "信义乡", + 710625: "竹山镇", + 710626: "鹿谷乡", + 710701: "仁爱区", + 710702: "信义区", + 710703: "中正区", + 710704: "中山区", + 710705: "安乐区", + 710706: "暖暖区", + 710707: "七堵区", + 710799: "其它区", + 710801: "东区", + 710802: "北区", + 710803: "香山区", + 710899: "其它区", + 710901: "东区", + 710902: "西区", + 710999: "其它区", + 711130: "万里区", + 711132: "板桥区", + 711133: "汐止区", + 711134: "深坑区", + 711135: "石碇区", + 711136: "瑞芳区", + 711137: "平溪区", + 711138: "双溪区", + 711139: "贡寮区", + 711140: "新店区", + 711141: "坪林区", + 711142: "乌来区", + 711143: "永和区", + 711144: "中和区", + 711145: "土城区", + 711146: "三峡区", + 711147: "树林区", + 711148: "莺歌区", + 711149: "三重区", + 711150: "新庄区", + 711151: "泰山区", + 711152: "林口区", + 711153: "芦洲区", + 711154: "五股区", + 711155: "八里区", + 711156: "淡水区", + 711157: "三芝区", + 711158: "石门区", + 711287: "宜兰市", + 711288: "头城镇", + 711289: "礁溪乡", + 711290: "壮围乡", + 711291: "员山乡", + 711292: "罗东镇", + 711293: "三星乡", + 711294: "大同乡", + 711295: "五结乡", + 711296: "冬山乡", + 711297: "苏澳镇", + 711298: "南澳乡", + 711299: "钓鱼台", + 711387: "竹北市", + 711388: "湖口乡", + 711389: "新丰乡", + 711390: "新埔镇", + 711391: "关西镇", + 711392: "芎林乡", + 711393: "宝山乡", + 711394: "竹东镇", + 711395: "五峰乡", + 711396: "横山乡", + 711397: "尖石乡", + 711398: "北埔乡", + 711399: "峨眉乡", + 711414: "中坜区", + 711415: "平镇区", + 711417: "杨梅区", + 711418: "新屋区", + 711419: "观音区", + 711420: "桃园区", + 711421: "龟山区", + 711422: "八德区", + 711423: "大溪区", + 711425: "大园区", + 711426: "芦竹区", + 711487: "中坜市", + 711488: "平镇市", + 711489: "龙潭乡", + 711490: "杨梅市", + 711491: "新屋乡", + 711492: "观音乡", + 711493: "桃园市", + 711494: "龟山乡", + 711495: "八德市", + 711496: "大溪镇", + 711497: "复兴乡", + 711498: "大园乡", + 711499: "芦竹乡", + 711520: "头份市", + 711582: "竹南镇", + 711583: "头份镇", + 711584: "三湾乡", + 711585: "南庄乡", + 711586: "狮潭乡", + 711587: "后龙镇", + 711588: "通霄镇", + 711589: "苑里镇", + 711590: "苗栗市", + 711591: "造桥乡", + 711592: "头屋乡", + 711593: "公馆乡", + 711594: "大湖乡", + 711595: "泰安乡", + 711596: "铜锣乡", + 711597: "三义乡", + 711598: "西湖乡", + 711599: "卓兰镇", + 711736: "员林市", + 711774: "彰化市", + 711775: "芬园乡", + 711776: "花坛乡", + 711777: "秀水乡", + 711778: "鹿港镇", + 711779: "福兴乡", + 711780: "线西乡", + 711781: "和美镇", + 711782: "伸港乡", + 711783: "员林镇", + 711784: "社头乡", + 711785: "永靖乡", + 711786: "埔心乡", + 711787: "溪湖镇", + 711788: "大村乡", + 711789: "埔盐乡", + 711790: "田中镇", + 711791: "北斗镇", + 711792: "田尾乡", + 711793: "埤头乡", + 711794: "溪州乡", + 711795: "竹塘乡", + 711796: "二林镇", + 711797: "大城乡", + 711798: "芳苑乡", + 711799: "二水乡", + 711982: "番路乡", + 711983: "梅山乡", + 711984: "竹崎乡", + 711985: "阿里山乡", + 711986: "中埔乡", + 711987: "大埔乡", + 711988: "水上乡", + 711989: "鹿草乡", + 711990: "太保市", + 711991: "朴子市", + 711992: "东石乡", + 711993: "六脚乡", + 711994: "新港乡", + 711995: "民雄乡", + 711996: "大林镇", + 711997: "溪口乡", + 711998: "义竹乡", + 711999: "布袋镇", + 712180: "斗南镇", + 712181: "大埤乡", + 712182: "虎尾镇", + 712183: "土库镇", + 712184: "褒忠乡", + 712185: "东势乡", + 712186: "台西乡", + 712187: "仑背乡", + 712188: "麦寮乡", + 712189: "斗六市", + 712190: "林内乡", + 712191: "古坑乡", + 712192: "莿桐乡", + 712193: "西螺镇", + 712194: "二仑乡", + 712195: "北港镇", + 712196: "水林乡", + 712197: "口湖乡", + 712198: "四湖乡", + 712199: "元长乡", + 712451: "崁顶乡", + 712467: "屏东市", + 712468: "三地门乡", + 712469: "雾台乡", + 712470: "玛家乡", + 712471: "九如乡", + 712472: "里港乡", + 712473: "高树乡", + 712474: "盐埔乡", + 712475: "长治乡", + 712476: "麟洛乡", + 712477: "竹田乡", + 712478: "内埔乡", + 712479: "万丹乡", + 712480: "潮州镇", + 712481: "泰武乡", + 712482: "来义乡", + 712483: "万峦乡", + 712484: "莰顶乡", + 712485: "新埤乡", + 712486: "南州乡", + 712487: "林边乡", + 712488: "东港镇", + 712489: "琉球乡", + 712490: "佳冬乡", + 712491: "新园乡", + 712492: "枋寮乡", + 712493: "枋山乡", + 712494: "春日乡", + 712495: "狮子乡", + 712496: "车城乡", + 712497: "牡丹乡", + 712498: "恒春镇", + 712499: "满州乡", + 712584: "台东市", + 712585: "绿岛乡", + 712586: "兰屿乡", + 712587: "延平乡", + 712588: "卑南乡", + 712589: "鹿野乡", + 712590: "关山镇", + 712591: "海端乡", + 712592: "池上乡", + 712593: "东河乡", + 712594: "成功镇", + 712595: "长滨乡", + 712596: "金峰乡", + 712597: "大武乡", + 712598: "达仁乡", + 712599: "太麻里乡", + 712686: "花莲市", + 712687: "新城乡", + 712688: "太鲁阁", + 712689: "秀林乡", + 712690: "吉安乡", + 712691: "寿丰乡", + 712692: "凤林镇", + 712693: "光复乡", + 712694: "丰滨乡", + 712695: "瑞穗乡", + 712696: "万荣乡", + 712697: "玉里镇", + 712698: "卓溪乡", + 712699: "富里乡", + 712794: "马公市", + 712795: "西屿乡", + 712796: "望安乡", + 712797: "七美乡", + 712798: "白沙乡", + 712799: "湖西乡", + 712896: "南竿乡", + 712897: "北竿乡", + 712898: "东引乡", + 712899: "莒光乡", + 810101: "中西区", + 810102: "湾仔区", + 810103: "东区", + 810104: "南区", + 810201: "九龙城区", + 810202: "油尖旺区", + 810203: "深水埗区", + 810204: "黄大仙区", + 810205: "观塘区", + 810301: "北区", + 810302: "大埔区", + 810303: "沙田区", + 810304: "西贡区", + 810305: "元朗区", + 810306: "屯门区", + 810307: "荃湾区", + 810308: "葵青区", + 810309: "离岛区", + 820102: "花地玛堂区", + 820103: "花王堂区", + 820104: "望德堂区", + 820105: "大堂区", + 820106: "风顺堂区", + 820202: "嘉模堂区", + 820203: "路氹填海区", + 820204: "圣方济各堂区" + } +}; +var makeOption = (text, value, children) => ({ + text, + value, + children +}); +function useCascaderAreaData() { + const { + city_list: city, + county_list: county, + province_list: province + } = areaList; + const provinceMap = /* @__PURE__ */ new Map(); + Object.keys(province).forEach((code) => { + provinceMap.set(code.slice(0, 2), makeOption(province[code], code, [])); + }); + const cityMap = /* @__PURE__ */ new Map(); + Object.keys(city).forEach((code) => { + const option = makeOption(city[code], code, []); + cityMap.set(code.slice(0, 4), option); + const province2 = provinceMap.get(code.slice(0, 2)); + if (province2) { + province2.children.push(option); + } + }); + Object.keys(county).forEach((code) => { + const city2 = cityMap.get(code.slice(0, 4)); + if (city2) { + city2.children.push(makeOption(county[code], code)); + } + }); + return Array.from(provinceMap.values()); +} + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242897); +})() +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/@vant/area-data/index.js.map b/miniprogram_npm/@vant/area-data/index.js.map new file mode 100644 index 0000000..0001f78 --- /dev/null +++ b/miniprogram_npm/@vant/area-data/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.cjs.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\n\n// src/index.ts\nvar src_exports = {};\n__export(src_exports, {\n areaList: () => areaList,\n useCascaderAreaData: () => useCascaderAreaData\n});\nmodule.exports = __toCommonJS(src_exports);\nvar areaList = {\n province_list: {\n 11e4: \"北京市\",\n 12e4: \"天津市\",\n 13e4: \"河北省\",\n 14e4: \"山西省\",\n 15e4: \"内蒙古自治区\",\n 21e4: \"辽宁省\",\n 22e4: \"吉林省\",\n 23e4: \"黑龙江省\",\n 31e4: \"上海市\",\n 32e4: \"江苏省\",\n 33e4: \"浙江省\",\n 34e4: \"安徽省\",\n 35e4: \"福建省\",\n 36e4: \"江西省\",\n 37e4: \"山东省\",\n 41e4: \"河南省\",\n 42e4: \"湖北省\",\n 43e4: \"湖南省\",\n 44e4: \"广东省\",\n 45e4: \"广西壮族自治区\",\n 46e4: \"海南省\",\n 5e5: \"重庆市\",\n 51e4: \"四川省\",\n 52e4: \"贵州省\",\n 53e4: \"云南省\",\n 54e4: \"西藏自治区\",\n 61e4: \"陕西省\",\n 62e4: \"甘肃省\",\n 63e4: \"青海省\",\n 64e4: \"宁夏回族自治区\",\n 65e4: \"新疆维吾尔自治区\",\n 71e4: \"台湾省\",\n 81e4: \"香港特别行政区\",\n 82e4: \"澳门特别行政区\"\n },\n city_list: {\n 110100: \"北京市\",\n 120100: \"天津市\",\n 130100: \"石家庄市\",\n 130200: \"唐山市\",\n 130300: \"秦皇岛市\",\n 130400: \"邯郸市\",\n 130500: \"邢台市\",\n 130600: \"保定市\",\n 130700: \"张家口市\",\n 130800: \"承德市\",\n 130900: \"沧州市\",\n 131e3: \"廊坊市\",\n 131100: \"衡水市\",\n 140100: \"太原市\",\n 140200: \"大同市\",\n 140300: \"阳泉市\",\n 140400: \"长治市\",\n 140500: \"晋城市\",\n 140600: \"朔州市\",\n 140700: \"晋中市\",\n 140800: \"运城市\",\n 140900: \"忻州市\",\n 141e3: \"临汾市\",\n 141100: \"吕梁市\",\n 150100: \"呼和浩特市\",\n 150200: \"包头市\",\n 150300: \"乌海市\",\n 150400: \"赤峰市\",\n 150500: \"通辽市\",\n 150600: \"鄂尔多斯市\",\n 150700: \"呼伦贝尔市\",\n 150800: \"巴彦淖尔市\",\n 150900: \"乌兰察布市\",\n 152200: \"兴安盟\",\n 152500: \"锡林郭勒盟\",\n 152900: \"阿拉善盟\",\n 210100: \"沈阳市\",\n 210200: \"大连市\",\n 210300: \"鞍山市\",\n 210400: \"抚顺市\",\n 210500: \"本溪市\",\n 210600: \"丹东市\",\n 210700: \"锦州市\",\n 210800: \"营口市\",\n 210900: \"阜新市\",\n 211e3: \"辽阳市\",\n 211100: \"盘锦市\",\n 211200: \"铁岭市\",\n 211300: \"朝阳市\",\n 211400: \"葫芦岛市\",\n 220100: \"长春市\",\n 220200: \"吉林市\",\n 220300: \"四平市\",\n 220400: \"辽源市\",\n 220500: \"通化市\",\n 220600: \"白山市\",\n 220700: \"松原市\",\n 220800: \"白城市\",\n 222400: \"延边朝鲜族自治州\",\n 230100: \"哈尔滨市\",\n 230200: \"齐齐哈尔市\",\n 230300: \"鸡西市\",\n 230400: \"鹤岗市\",\n 230500: \"双鸭山市\",\n 230600: \"大庆市\",\n 230700: \"伊春市\",\n 230800: \"佳木斯市\",\n 230900: \"七台河市\",\n 231e3: \"牡丹江市\",\n 231100: \"黑河市\",\n 231200: \"绥化市\",\n 232700: \"大兴安岭地区\",\n 310100: \"上海市\",\n 320100: \"南京市\",\n 320200: \"无锡市\",\n 320300: \"徐州市\",\n 320400: \"常州市\",\n 320500: \"苏州市\",\n 320600: \"南通市\",\n 320700: \"连云港市\",\n 320800: \"淮安市\",\n 320900: \"盐城市\",\n 321e3: \"扬州市\",\n 321100: \"镇江市\",\n 321200: \"泰州市\",\n 321300: \"宿迁市\",\n 330100: \"杭州市\",\n 330200: \"宁波市\",\n 330300: \"温州市\",\n 330400: \"嘉兴市\",\n 330500: \"湖州市\",\n 330600: \"绍兴市\",\n 330700: \"金华市\",\n 330800: \"衢州市\",\n 330900: \"舟山市\",\n 331e3: \"台州市\",\n 331100: \"丽水市\",\n 340100: \"合肥市\",\n 340200: \"芜湖市\",\n 340300: \"蚌埠市\",\n 340400: \"淮南市\",\n 340500: \"马鞍山市\",\n 340600: \"淮北市\",\n 340700: \"铜陵市\",\n 340800: \"安庆市\",\n 341e3: \"黄山市\",\n 341100: \"滁州市\",\n 341200: \"阜阳市\",\n 341300: \"宿州市\",\n 341500: \"六安市\",\n 341600: \"亳州市\",\n 341700: \"池州市\",\n 341800: \"宣城市\",\n 350100: \"福州市\",\n 350200: \"厦门市\",\n 350300: \"莆田市\",\n 350400: \"三明市\",\n 350500: \"泉州市\",\n 350600: \"漳州市\",\n 350700: \"南平市\",\n 350800: \"龙岩市\",\n 350900: \"宁德市\",\n 360100: \"南昌市\",\n 360200: \"景德镇市\",\n 360300: \"萍乡市\",\n 360400: \"九江市\",\n 360500: \"新余市\",\n 360600: \"鹰潭市\",\n 360700: \"赣州市\",\n 360800: \"吉安市\",\n 360900: \"宜春市\",\n 361e3: \"抚州市\",\n 361100: \"上饶市\",\n 370100: \"济南市\",\n 370200: \"青岛市\",\n 370300: \"淄博市\",\n 370400: \"枣庄市\",\n 370500: \"东营市\",\n 370600: \"烟台市\",\n 370700: \"潍坊市\",\n 370800: \"济宁市\",\n 370900: \"泰安市\",\n 371e3: \"威海市\",\n 371100: \"日照市\",\n 371300: \"临沂市\",\n 371400: \"德州市\",\n 371500: \"聊城市\",\n 371600: \"滨州市\",\n 371700: \"菏泽市\",\n 410100: \"郑州市\",\n 410200: \"开封市\",\n 410300: \"洛阳市\",\n 410400: \"平顶山市\",\n 410500: \"安阳市\",\n 410600: \"鹤壁市\",\n 410700: \"新乡市\",\n 410800: \"焦作市\",\n 410900: \"濮阳市\",\n 411e3: \"许昌市\",\n 411100: \"漯河市\",\n 411200: \"三门峡市\",\n 411300: \"南阳市\",\n 411400: \"商丘市\",\n 411500: \"信阳市\",\n 411600: \"周口市\",\n 411700: \"驻马店市\",\n 419e3: \"省直辖县\",\n 420100: \"武汉市\",\n 420200: \"黄石市\",\n 420300: \"十堰市\",\n 420500: \"宜昌市\",\n 420600: \"襄阳市\",\n 420700: \"鄂州市\",\n 420800: \"荆门市\",\n 420900: \"孝感市\",\n 421e3: \"荆州市\",\n 421100: \"黄冈市\",\n 421200: \"咸宁市\",\n 421300: \"随州市\",\n 422800: \"恩施土家族苗族自治州\",\n 429e3: \"省直辖县\",\n 430100: \"长沙市\",\n 430200: \"株洲市\",\n 430300: \"湘潭市\",\n 430400: \"衡阳市\",\n 430500: \"邵阳市\",\n 430600: \"岳阳市\",\n 430700: \"常德市\",\n 430800: \"张家界市\",\n 430900: \"益阳市\",\n 431e3: \"郴州市\",\n 431100: \"永州市\",\n 431200: \"怀化市\",\n 431300: \"娄底市\",\n 433100: \"湘西土家族苗族自治州\",\n 440100: \"广州市\",\n 440200: \"韶关市\",\n 440300: \"深圳市\",\n 440400: \"珠海市\",\n 440500: \"汕头市\",\n 440600: \"佛山市\",\n 440700: \"江门市\",\n 440800: \"湛江市\",\n 440900: \"茂名市\",\n 441200: \"肇庆市\",\n 441300: \"惠州市\",\n 441400: \"梅州市\",\n 441500: \"汕尾市\",\n 441600: \"河源市\",\n 441700: \"阳江市\",\n 441800: \"清远市\",\n 441900: \"东莞市\",\n 442e3: \"中山市\",\n 445100: \"潮州市\",\n 445200: \"揭阳市\",\n 445300: \"云浮市\",\n 450100: \"南宁市\",\n 450200: \"柳州市\",\n 450300: \"桂林市\",\n 450400: \"梧州市\",\n 450500: \"北海市\",\n 450600: \"防城港市\",\n 450700: \"钦州市\",\n 450800: \"贵港市\",\n 450900: \"玉林市\",\n 451e3: \"百色市\",\n 451100: \"贺州市\",\n 451200: \"河池市\",\n 451300: \"来宾市\",\n 451400: \"崇左市\",\n 460100: \"海口市\",\n 460200: \"三亚市\",\n 460300: \"三沙市\",\n 460400: \"儋州市\",\n 469e3: \"省直辖县\",\n 500100: \"重庆市\",\n 500200: \"县\",\n 510100: \"成都市\",\n 510300: \"自贡市\",\n 510400: \"攀枝花市\",\n 510500: \"泸州市\",\n 510600: \"德阳市\",\n 510700: \"绵阳市\",\n 510800: \"广元市\",\n 510900: \"遂宁市\",\n 511e3: \"内江市\",\n 511100: \"乐山市\",\n 511300: \"南充市\",\n 511400: \"眉山市\",\n 511500: \"宜宾市\",\n 511600: \"广安市\",\n 511700: \"达州市\",\n 511800: \"雅安市\",\n 511900: \"巴中市\",\n 512e3: \"资阳市\",\n 513200: \"阿坝藏族羌族自治州\",\n 513300: \"甘孜藏族自治州\",\n 513400: \"凉山彝族自治州\",\n 520100: \"贵阳市\",\n 520200: \"六盘水市\",\n 520300: \"遵义市\",\n 520400: \"安顺市\",\n 520500: \"毕节市\",\n 520600: \"铜仁市\",\n 522300: \"黔西南布依族苗族自治州\",\n 522600: \"黔东南苗族侗族自治州\",\n 522700: \"黔南布依族苗族自治州\",\n 530100: \"昆明市\",\n 530300: \"曲靖市\",\n 530400: \"玉溪市\",\n 530500: \"保山市\",\n 530600: \"昭通市\",\n 530700: \"丽江市\",\n 530800: \"普洱市\",\n 530900: \"临沧市\",\n 532300: \"楚雄彝族自治州\",\n 532500: \"红河哈尼族彝族自治州\",\n 532600: \"文山壮族苗族自治州\",\n 532800: \"西双版纳傣族自治州\",\n 532900: \"大理白族自治州\",\n 533100: \"德宏傣族景颇族自治州\",\n 533300: \"怒江傈僳族自治州\",\n 533400: \"迪庆藏族自治州\",\n 540100: \"拉萨市\",\n 540200: \"日喀则市\",\n 540300: \"昌都市\",\n 540400: \"林芝市\",\n 540500: \"山南市\",\n 540600: \"那曲市\",\n 542500: \"阿里地区\",\n 610100: \"西安市\",\n 610200: \"铜川市\",\n 610300: \"宝鸡市\",\n 610400: \"咸阳市\",\n 610500: \"渭南市\",\n 610600: \"延安市\",\n 610700: \"汉中市\",\n 610800: \"榆林市\",\n 610900: \"安康市\",\n 611e3: \"商洛市\",\n 620100: \"兰州市\",\n 620200: \"嘉峪关市\",\n 620300: \"金昌市\",\n 620400: \"白银市\",\n 620500: \"天水市\",\n 620600: \"武威市\",\n 620700: \"张掖市\",\n 620800: \"平凉市\",\n 620900: \"酒泉市\",\n 621e3: \"庆阳市\",\n 621100: \"定西市\",\n 621200: \"陇南市\",\n 622900: \"临夏回族自治州\",\n 623e3: \"甘南藏族自治州\",\n 630100: \"西宁市\",\n 630200: \"海东市\",\n 632200: \"海北藏族自治州\",\n 632300: \"黄南藏族自治州\",\n 632500: \"海南藏族自治州\",\n 632600: \"果洛藏族自治州\",\n 632700: \"玉树藏族自治州\",\n 632800: \"海西蒙古族藏族自治州\",\n 640100: \"银川市\",\n 640200: \"石嘴山市\",\n 640300: \"吴忠市\",\n 640400: \"固原市\",\n 640500: \"中卫市\",\n 650100: \"乌鲁木齐市\",\n 650200: \"克拉玛依市\",\n 650400: \"吐鲁番市\",\n 650500: \"哈密市\",\n 652300: \"昌吉回族自治州\",\n 652700: \"博尔塔拉蒙古自治州\",\n 652800: \"巴音郭楞蒙古自治州\",\n 652900: \"阿克苏地区\",\n 653e3: \"克孜勒苏柯尔克孜自治州\",\n 653100: \"喀什地区\",\n 653200: \"和田地区\",\n 654e3: \"伊犁哈萨克自治州\",\n 654200: \"塔城地区\",\n 654300: \"阿勒泰地区\",\n 659e3: \"自治区直辖县级行政区划\",\n 710100: \"台北市\",\n 710200: \"高雄市\",\n 710300: \"台南市\",\n 710400: \"台中市\",\n 710500: \"金门县\",\n 710600: \"南投县\",\n 710700: \"基隆市\",\n 710800: \"新竹市\",\n 710900: \"嘉义市\",\n 711100: \"新北市\",\n 711200: \"宜兰县\",\n 711300: \"新竹县\",\n 711400: \"桃园市\",\n 711500: \"苗栗县\",\n 711700: \"彰化县\",\n 711900: \"嘉义县\",\n 712100: \"云林县\",\n 712400: \"屏东县\",\n 712500: \"台东县\",\n 712600: \"花莲县\",\n 712700: \"澎湖县\",\n 712800: \"连江县\",\n 810100: \"香港岛\",\n 810200: \"九龙\",\n 810300: \"新界\",\n 820100: \"澳门半岛\",\n 820200: \"离岛\"\n },\n county_list: {\n 110101: \"东城区\",\n 110102: \"西城区\",\n 110105: \"朝阳区\",\n 110106: \"丰台区\",\n 110107: \"石景山区\",\n 110108: \"海淀区\",\n 110109: \"门头沟区\",\n 110111: \"房山区\",\n 110112: \"通州区\",\n 110113: \"顺义区\",\n 110114: \"昌平区\",\n 110115: \"大兴区\",\n 110116: \"怀柔区\",\n 110117: \"平谷区\",\n 110118: \"密云区\",\n 110119: \"延庆区\",\n 120101: \"和平区\",\n 120102: \"河东区\",\n 120103: \"河西区\",\n 120104: \"南开区\",\n 120105: \"河北区\",\n 120106: \"红桥区\",\n 120110: \"东丽区\",\n 120111: \"西青区\",\n 120112: \"津南区\",\n 120113: \"北辰区\",\n 120114: \"武清区\",\n 120115: \"宝坻区\",\n 120116: \"滨海新区\",\n 120117: \"宁河区\",\n 120118: \"静海区\",\n 120119: \"蓟州区\",\n 130102: \"长安区\",\n 130104: \"桥西区\",\n 130105: \"新华区\",\n 130107: \"井陉矿区\",\n 130108: \"裕华区\",\n 130109: \"藁城区\",\n 130110: \"鹿泉区\",\n 130111: \"栾城区\",\n 130121: \"井陉县\",\n 130123: \"正定县\",\n 130125: \"行唐县\",\n 130126: \"灵寿县\",\n 130127: \"高邑县\",\n 130128: \"深泽县\",\n 130129: \"赞皇县\",\n 130130: \"无极县\",\n 130131: \"平山县\",\n 130132: \"元氏县\",\n 130133: \"赵县\",\n 130171: \"石家庄高新技术产业开发区\",\n 130172: \"石家庄循环化工园区\",\n 130181: \"辛集市\",\n 130183: \"晋州市\",\n 130184: \"新乐市\",\n 130202: \"路南区\",\n 130203: \"路北区\",\n 130204: \"古冶区\",\n 130205: \"开平区\",\n 130207: \"丰南区\",\n 130208: \"丰润区\",\n 130209: \"曹妃甸区\",\n 130224: \"滦南县\",\n 130225: \"乐亭县\",\n 130227: \"迁西县\",\n 130229: \"玉田县\",\n 130273: \"唐山高新技术产业开发区\",\n 130274: \"河北唐山海港经济开发区\",\n 130281: \"遵化市\",\n 130283: \"迁安市\",\n 130284: \"滦州市\",\n 130302: \"海港区\",\n 130303: \"山海关区\",\n 130304: \"北戴河区\",\n 130306: \"抚宁区\",\n 130321: \"青龙满族自治县\",\n 130322: \"昌黎县\",\n 130324: \"卢龙县\",\n 130371: \"秦皇岛市经济技术开发区\",\n 130372: \"北戴河新区\",\n 130390: \"经济技术开发区\",\n 130402: \"邯山区\",\n 130403: \"丛台区\",\n 130404: \"复兴区\",\n 130406: \"峰峰矿区\",\n 130407: \"肥乡区\",\n 130408: \"永年区\",\n 130423: \"临漳县\",\n 130424: \"成安县\",\n 130425: \"大名县\",\n 130426: \"涉县\",\n 130427: \"磁县\",\n 130430: \"邱县\",\n 130431: \"鸡泽县\",\n 130432: \"广平县\",\n 130433: \"馆陶县\",\n 130434: \"魏县\",\n 130435: \"曲周县\",\n 130471: \"邯郸经济技术开发区\",\n 130473: \"邯郸冀南新区\",\n 130481: \"武安市\",\n 130502: \"襄都区\",\n 130503: \"信都区\",\n 130505: \"任泽区\",\n 130506: \"南和区\",\n 130522: \"临城县\",\n 130523: \"内丘县\",\n 130524: \"柏乡县\",\n 130525: \"隆尧县\",\n 130528: \"宁晋县\",\n 130529: \"巨鹿县\",\n 130530: \"新河县\",\n 130531: \"广宗县\",\n 130532: \"平乡县\",\n 130533: \"威县\",\n 130534: \"清河县\",\n 130535: \"临西县\",\n 130571: \"河北邢台经济开发区\",\n 130581: \"南宫市\",\n 130582: \"沙河市\",\n 130602: \"竞秀区\",\n 130606: \"莲池区\",\n 130607: \"满城区\",\n 130608: \"清苑区\",\n 130609: \"徐水区\",\n 130623: \"涞水县\",\n 130624: \"阜平县\",\n 130626: \"定兴县\",\n 130627: \"唐县\",\n 130628: \"高阳县\",\n 130629: \"容城县\",\n 130630: \"涞源县\",\n 130631: \"望都县\",\n 130632: \"安新县\",\n 130633: \"易县\",\n 130634: \"曲阳县\",\n 130635: \"蠡县\",\n 130636: \"顺平县\",\n 130637: \"博野县\",\n 130638: \"雄县\",\n 130671: \"保定高新技术产业开发区\",\n 130672: \"保定白沟新城\",\n 130681: \"涿州市\",\n 130682: \"定州市\",\n 130683: \"安国市\",\n 130684: \"高碑店市\",\n 130702: \"桥东区\",\n 130703: \"桥西区\",\n 130705: \"宣化区\",\n 130706: \"下花园区\",\n 130708: \"万全区\",\n 130709: \"崇礼区\",\n 130722: \"张北县\",\n 130723: \"康保县\",\n 130724: \"沽源县\",\n 130725: \"尚义县\",\n 130726: \"蔚县\",\n 130727: \"阳原县\",\n 130728: \"怀安县\",\n 130730: \"怀来县\",\n 130731: \"涿鹿县\",\n 130732: \"赤城县\",\n 130772: \"张家口市察北管理区\",\n 130802: \"双桥区\",\n 130803: \"双滦区\",\n 130804: \"鹰手营子矿区\",\n 130821: \"承德县\",\n 130822: \"兴隆县\",\n 130824: \"滦平县\",\n 130825: \"隆化县\",\n 130826: \"丰宁满族自治县\",\n 130827: \"宽城满族自治县\",\n 130828: \"围场满族蒙古族自治县\",\n 130871: \"承德高新技术产业开发区\",\n 130881: \"平泉市\",\n 130902: \"新华区\",\n 130903: \"运河区\",\n 130921: \"沧县\",\n 130922: \"青县\",\n 130923: \"东光县\",\n 130924: \"海兴县\",\n 130925: \"盐山县\",\n 130926: \"肃宁县\",\n 130927: \"南皮县\",\n 130928: \"吴桥县\",\n 130929: \"献县\",\n 130930: \"孟村回族自治县\",\n 130971: \"河北沧州经济开发区\",\n 130972: \"沧州高新技术产业开发区\",\n 130973: \"沧州渤海新区\",\n 130981: \"泊头市\",\n 130982: \"任丘市\",\n 130983: \"黄骅市\",\n 130984: \"河间市\",\n 131002: \"安次区\",\n 131003: \"广阳区\",\n 131022: \"固安县\",\n 131023: \"永清县\",\n 131024: \"香河县\",\n 131025: \"大城县\",\n 131026: \"文安县\",\n 131028: \"大厂回族自治县\",\n 131071: \"廊坊经济技术开发区\",\n 131081: \"霸州市\",\n 131082: \"三河市\",\n 131090: \"开发区\",\n 131102: \"桃城区\",\n 131103: \"冀州区\",\n 131121: \"枣强县\",\n 131122: \"武邑县\",\n 131123: \"武强县\",\n 131124: \"饶阳县\",\n 131125: \"安平县\",\n 131126: \"故城县\",\n 131127: \"景县\",\n 131128: \"阜城县\",\n 131171: \"河北衡水经济开发区\",\n 131172: \"衡水滨湖新区\",\n 131182: \"深州市\",\n 140105: \"小店区\",\n 140106: \"迎泽区\",\n 140107: \"杏花岭区\",\n 140108: \"尖草坪区\",\n 140109: \"万柏林区\",\n 140110: \"晋源区\",\n 140121: \"清徐县\",\n 140122: \"阳曲县\",\n 140123: \"娄烦县\",\n 140181: \"古交市\",\n 140212: \"新荣区\",\n 140213: \"平城区\",\n 140214: \"云冈区\",\n 140215: \"云州区\",\n 140221: \"阳高县\",\n 140222: \"天镇县\",\n 140223: \"广灵县\",\n 140224: \"灵丘县\",\n 140225: \"浑源县\",\n 140226: \"左云县\",\n 140271: \"山西大同经济开发区\",\n 140302: \"城区\",\n 140303: \"矿区\",\n 140311: \"郊区\",\n 140321: \"平定县\",\n 140322: \"盂县\",\n 140403: \"潞州区\",\n 140404: \"上党区\",\n 140405: \"屯留区\",\n 140406: \"潞城区\",\n 140423: \"襄垣县\",\n 140425: \"平顺县\",\n 140426: \"黎城县\",\n 140427: \"壶关县\",\n 140428: \"长子县\",\n 140429: \"武乡县\",\n 140430: \"沁县\",\n 140431: \"沁源县\",\n 140471: \"山西长治高新技术产业园区\",\n 140502: \"城区\",\n 140521: \"沁水县\",\n 140522: \"阳城县\",\n 140524: \"陵川县\",\n 140525: \"泽州县\",\n 140581: \"高平市\",\n 140602: \"朔城区\",\n 140603: \"平鲁区\",\n 140621: \"山阴县\",\n 140622: \"应县\",\n 140623: \"右玉县\",\n 140671: \"山西朔州经济开发区\",\n 140681: \"怀仁市\",\n 140702: \"榆次区\",\n 140703: \"太谷区\",\n 140721: \"榆社县\",\n 140722: \"左权县\",\n 140723: \"和顺县\",\n 140724: \"昔阳县\",\n 140725: \"寿阳县\",\n 140727: \"祁县\",\n 140728: \"平遥县\",\n 140729: \"灵石县\",\n 140781: \"介休市\",\n 140802: \"盐湖区\",\n 140821: \"临猗县\",\n 140822: \"万荣县\",\n 140823: \"闻喜县\",\n 140824: \"稷山县\",\n 140825: \"新绛县\",\n 140826: \"绛县\",\n 140827: \"垣曲县\",\n 140828: \"夏县\",\n 140829: \"平陆县\",\n 140830: \"芮城县\",\n 140881: \"永济市\",\n 140882: \"河津市\",\n 140902: \"忻府区\",\n 140921: \"定襄县\",\n 140922: \"五台县\",\n 140923: \"代县\",\n 140924: \"繁峙县\",\n 140925: \"宁武县\",\n 140926: \"静乐县\",\n 140927: \"神池县\",\n 140928: \"五寨县\",\n 140929: \"岢岚县\",\n 140930: \"河曲县\",\n 140931: \"保德县\",\n 140932: \"偏关县\",\n 140971: \"五台山风景名胜区\",\n 140981: \"原平市\",\n 141002: \"尧都区\",\n 141021: \"曲沃县\",\n 141022: \"翼城县\",\n 141023: \"襄汾县\",\n 141024: \"洪洞县\",\n 141025: \"古县\",\n 141026: \"安泽县\",\n 141027: \"浮山县\",\n 141028: \"吉县\",\n 141029: \"乡宁县\",\n 141030: \"大宁县\",\n 141031: \"隰县\",\n 141032: \"永和县\",\n 141033: \"蒲县\",\n 141034: \"汾西县\",\n 141081: \"侯马市\",\n 141082: \"霍州市\",\n 141102: \"离石区\",\n 141121: \"文水县\",\n 141122: \"交城县\",\n 141123: \"兴县\",\n 141124: \"临县\",\n 141125: \"柳林县\",\n 141126: \"石楼县\",\n 141127: \"岚县\",\n 141128: \"方山县\",\n 141129: \"中阳县\",\n 141130: \"交口县\",\n 141181: \"孝义市\",\n 141182: \"汾阳市\",\n 150102: \"新城区\",\n 150103: \"回民区\",\n 150104: \"玉泉区\",\n 150105: \"赛罕区\",\n 150121: \"土默特左旗\",\n 150122: \"托克托县\",\n 150123: \"和林格尔县\",\n 150124: \"清水河县\",\n 150125: \"武川县\",\n 150172: \"呼和浩特经济技术开发区\",\n 150202: \"东河区\",\n 150203: \"昆都仑区\",\n 150204: \"青山区\",\n 150205: \"石拐区\",\n 150206: \"白云鄂博矿区\",\n 150207: \"九原区\",\n 150221: \"土默特右旗\",\n 150222: \"固阳县\",\n 150223: \"达尔罕茂明安联合旗\",\n 150271: \"包头稀土高新技术产业开发区\",\n 150302: \"海勃湾区\",\n 150303: \"海南区\",\n 150304: \"乌达区\",\n 150402: \"红山区\",\n 150403: \"元宝山区\",\n 150404: \"松山区\",\n 150421: \"阿鲁科尔沁旗\",\n 150422: \"巴林左旗\",\n 150423: \"巴林右旗\",\n 150424: \"林西县\",\n 150425: \"克什克腾旗\",\n 150426: \"翁牛特旗\",\n 150428: \"喀喇沁旗\",\n 150429: \"宁城县\",\n 150430: \"敖汉旗\",\n 150502: \"科尔沁区\",\n 150521: \"科尔沁左翼中旗\",\n 150522: \"科尔沁左翼后旗\",\n 150523: \"开鲁县\",\n 150524: \"库伦旗\",\n 150525: \"奈曼旗\",\n 150526: \"扎鲁特旗\",\n 150571: \"通辽经济技术开发区\",\n 150581: \"霍林郭勒市\",\n 150602: \"东胜区\",\n 150603: \"康巴什区\",\n 150621: \"达拉特旗\",\n 150622: \"准格尔旗\",\n 150623: \"鄂托克前旗\",\n 150624: \"鄂托克旗\",\n 150625: \"杭锦旗\",\n 150626: \"乌审旗\",\n 150627: \"伊金霍洛旗\",\n 150702: \"海拉尔区\",\n 150703: \"扎赉诺尔区\",\n 150721: \"阿荣旗\",\n 150722: \"莫力达瓦达斡尔族自治旗\",\n 150723: \"鄂伦春自治旗\",\n 150724: \"鄂温克族自治旗\",\n 150725: \"陈巴尔虎旗\",\n 150726: \"新巴尔虎左旗\",\n 150727: \"新巴尔虎右旗\",\n 150781: \"满洲里市\",\n 150782: \"牙克石市\",\n 150783: \"扎兰屯市\",\n 150784: \"额尔古纳市\",\n 150785: \"根河市\",\n 150802: \"临河区\",\n 150821: \"五原县\",\n 150822: \"磴口县\",\n 150823: \"乌拉特前旗\",\n 150824: \"乌拉特中旗\",\n 150825: \"乌拉特后旗\",\n 150826: \"杭锦后旗\",\n 150902: \"集宁区\",\n 150921: \"卓资县\",\n 150922: \"化德县\",\n 150923: \"商都县\",\n 150924: \"兴和县\",\n 150925: \"凉城县\",\n 150926: \"察哈尔右翼前旗\",\n 150927: \"察哈尔右翼中旗\",\n 150928: \"察哈尔右翼后旗\",\n 150929: \"四子王旗\",\n 150981: \"丰镇市\",\n 152201: \"乌兰浩特市\",\n 152202: \"阿尔山市\",\n 152221: \"科尔沁右翼前旗\",\n 152222: \"科尔沁右翼中旗\",\n 152223: \"扎赉特旗\",\n 152224: \"突泉县\",\n 152501: \"二连浩特市\",\n 152502: \"锡林浩特市\",\n 152522: \"阿巴嘎旗\",\n 152523: \"苏尼特左旗\",\n 152524: \"苏尼特右旗\",\n 152525: \"东乌珠穆沁旗\",\n 152526: \"西乌珠穆沁旗\",\n 152527: \"太仆寺旗\",\n 152528: \"镶黄旗\",\n 152529: \"正镶白旗\",\n 152530: \"正蓝旗\",\n 152531: \"多伦县\",\n 152571: \"乌拉盖管委会\",\n 152921: \"阿拉善左旗\",\n 152922: \"阿拉善右旗\",\n 152923: \"额济纳旗\",\n 152971: \"内蒙古阿拉善经济开发区\",\n 210102: \"和平区\",\n 210103: \"沈河区\",\n 210104: \"大东区\",\n 210105: \"皇姑区\",\n 210106: \"铁西区\",\n 210111: \"苏家屯区\",\n 210112: \"浑南区\",\n 210113: \"沈北新区\",\n 210114: \"于洪区\",\n 210115: \"辽中区\",\n 210123: \"康平县\",\n 210124: \"法库县\",\n 210181: \"新民市\",\n 210190: \"经济技术开发区\",\n 210202: \"中山区\",\n 210203: \"西岗区\",\n 210204: \"沙河口区\",\n 210211: \"甘井子区\",\n 210212: \"旅顺口区\",\n 210213: \"金州区\",\n 210214: \"普兰店区\",\n 210224: \"长海县\",\n 210281: \"瓦房店市\",\n 210283: \"庄河市\",\n 210302: \"铁东区\",\n 210303: \"铁西区\",\n 210304: \"立山区\",\n 210311: \"千山区\",\n 210321: \"台安县\",\n 210323: \"岫岩满族自治县\",\n 210381: \"海城市\",\n 210390: \"高新区\",\n 210402: \"新抚区\",\n 210403: \"东洲区\",\n 210404: \"望花区\",\n 210411: \"顺城区\",\n 210421: \"抚顺县\",\n 210422: \"新宾满族自治县\",\n 210423: \"清原满族自治县\",\n 210502: \"平山区\",\n 210503: \"溪湖区\",\n 210504: \"明山区\",\n 210505: \"南芬区\",\n 210521: \"本溪满族自治县\",\n 210522: \"桓仁满族自治县\",\n 210602: \"元宝区\",\n 210603: \"振兴区\",\n 210604: \"振安区\",\n 210624: \"宽甸满族自治县\",\n 210681: \"东港市\",\n 210682: \"凤城市\",\n 210702: \"古塔区\",\n 210703: \"凌河区\",\n 210711: \"太和区\",\n 210726: \"黑山县\",\n 210727: \"义县\",\n 210781: \"凌海市\",\n 210782: \"北镇市\",\n 210793: \"经济技术开发区\",\n 210802: \"站前区\",\n 210803: \"西市区\",\n 210804: \"鲅鱼圈区\",\n 210811: \"老边区\",\n 210881: \"盖州市\",\n 210882: \"大石桥市\",\n 210902: \"海州区\",\n 210903: \"新邱区\",\n 210904: \"太平区\",\n 210905: \"清河门区\",\n 210911: \"细河区\",\n 210921: \"阜新蒙古族自治县\",\n 210922: \"彰武县\",\n 211002: \"白塔区\",\n 211003: \"文圣区\",\n 211004: \"宏伟区\",\n 211005: \"弓长岭区\",\n 211011: \"太子河区\",\n 211021: \"辽阳县\",\n 211081: \"灯塔市\",\n 211102: \"双台子区\",\n 211103: \"兴隆台区\",\n 211104: \"大洼区\",\n 211122: \"盘山县\",\n 211202: \"银州区\",\n 211204: \"清河区\",\n 211221: \"铁岭县\",\n 211223: \"西丰县\",\n 211224: \"昌图县\",\n 211281: \"调兵山市\",\n 211282: \"开原市\",\n 211302: \"双塔区\",\n 211303: \"龙城区\",\n 211321: \"朝阳县\",\n 211322: \"建平县\",\n 211324: \"喀喇沁左翼蒙古族自治县\",\n 211381: \"北票市\",\n 211382: \"凌源市\",\n 211402: \"连山区\",\n 211403: \"龙港区\",\n 211404: \"南票区\",\n 211421: \"绥中县\",\n 211422: \"建昌县\",\n 211481: \"兴城市\",\n 220102: \"南关区\",\n 220103: \"宽城区\",\n 220104: \"朝阳区\",\n 220105: \"二道区\",\n 220106: \"绿园区\",\n 220112: \"双阳区\",\n 220113: \"九台区\",\n 220122: \"农安县\",\n 220171: \"长春经济技术开发区\",\n 220172: \"长春净月高新技术产业开发区\",\n 220173: \"长春高新技术产业开发区\",\n 220174: \"长春汽车经济技术开发区\",\n 220182: \"榆树市\",\n 220183: \"德惠市\",\n 220192: \"经济技术开发区\",\n 220202: \"昌邑区\",\n 220203: \"龙潭区\",\n 220204: \"船营区\",\n 220211: \"丰满区\",\n 220221: \"永吉县\",\n 220271: \"吉林经济开发区\",\n 220272: \"吉林高新技术产业开发区\",\n 220281: \"蛟河市\",\n 220282: \"桦甸市\",\n 220283: \"舒兰市\",\n 220284: \"磐石市\",\n 220302: \"铁西区\",\n 220303: \"铁东区\",\n 220322: \"梨树县\",\n 220323: \"伊通满族自治县\",\n 220381: \"公主岭市\",\n 220382: \"双辽市\",\n 220402: \"龙山区\",\n 220403: \"西安区\",\n 220421: \"东丰县\",\n 220422: \"东辽县\",\n 220502: \"东昌区\",\n 220503: \"二道江区\",\n 220521: \"通化县\",\n 220523: \"辉南县\",\n 220524: \"柳河县\",\n 220581: \"梅河口市\",\n 220582: \"集安市\",\n 220602: \"浑江区\",\n 220605: \"江源区\",\n 220621: \"抚松县\",\n 220622: \"靖宇县\",\n 220623: \"长白朝鲜族自治县\",\n 220681: \"临江市\",\n 220702: \"宁江区\",\n 220721: \"前郭尔罗斯蒙古族自治县\",\n 220722: \"长岭县\",\n 220723: \"乾安县\",\n 220771: \"吉林松原经济开发区\",\n 220781: \"扶余市\",\n 220802: \"洮北区\",\n 220821: \"镇赉县\",\n 220822: \"通榆县\",\n 220871: \"吉林白城经济开发区\",\n 220881: \"洮南市\",\n 220882: \"大安市\",\n 222401: \"延吉市\",\n 222402: \"图们市\",\n 222403: \"敦化市\",\n 222404: \"珲春市\",\n 222405: \"龙井市\",\n 222406: \"和龙市\",\n 222424: \"汪清县\",\n 222426: \"安图县\",\n 230102: \"道里区\",\n 230103: \"南岗区\",\n 230104: \"道外区\",\n 230108: \"平房区\",\n 230109: \"松北区\",\n 230110: \"香坊区\",\n 230111: \"呼兰区\",\n 230112: \"阿城区\",\n 230113: \"双城区\",\n 230123: \"依兰县\",\n 230124: \"方正县\",\n 230125: \"宾县\",\n 230126: \"巴彦县\",\n 230127: \"木兰县\",\n 230128: \"通河县\",\n 230129: \"延寿县\",\n 230183: \"尚志市\",\n 230184: \"五常市\",\n 230202: \"龙沙区\",\n 230203: \"建华区\",\n 230204: \"铁锋区\",\n 230205: \"昂昂溪区\",\n 230206: \"富拉尔基区\",\n 230207: \"碾子山区\",\n 230208: \"梅里斯达斡尔族区\",\n 230221: \"龙江县\",\n 230223: \"依安县\",\n 230224: \"泰来县\",\n 230225: \"甘南县\",\n 230227: \"富裕县\",\n 230229: \"克山县\",\n 230230: \"克东县\",\n 230231: \"拜泉县\",\n 230281: \"讷河市\",\n 230302: \"鸡冠区\",\n 230303: \"恒山区\",\n 230304: \"滴道区\",\n 230305: \"梨树区\",\n 230306: \"城子河区\",\n 230307: \"麻山区\",\n 230321: \"鸡东县\",\n 230381: \"虎林市\",\n 230382: \"密山市\",\n 230402: \"向阳区\",\n 230403: \"工农区\",\n 230404: \"南山区\",\n 230405: \"兴安区\",\n 230406: \"东山区\",\n 230407: \"兴山区\",\n 230421: \"萝北县\",\n 230422: \"绥滨县\",\n 230502: \"尖山区\",\n 230503: \"岭东区\",\n 230505: \"四方台区\",\n 230506: \"宝山区\",\n 230521: \"集贤县\",\n 230522: \"友谊县\",\n 230523: \"宝清县\",\n 230524: \"饶河县\",\n 230602: \"萨尔图区\",\n 230603: \"龙凤区\",\n 230604: \"让胡路区\",\n 230605: \"红岗区\",\n 230606: \"大同区\",\n 230621: \"肇州县\",\n 230622: \"肇源县\",\n 230623: \"林甸县\",\n 230624: \"杜尔伯特蒙古族自治县\",\n 230671: \"大庆高新技术产业开发区\",\n 230717: \"伊美区\",\n 230718: \"乌翠区\",\n 230719: \"友好区\",\n 230722: \"嘉荫县\",\n 230723: \"汤旺县\",\n 230724: \"丰林县\",\n 230725: \"大箐山县\",\n 230726: \"南岔县\",\n 230751: \"金林区\",\n 230781: \"铁力市\",\n 230803: \"向阳区\",\n 230804: \"前进区\",\n 230805: \"东风区\",\n 230811: \"郊区\",\n 230822: \"桦南县\",\n 230826: \"桦川县\",\n 230828: \"汤原县\",\n 230881: \"同江市\",\n 230882: \"富锦市\",\n 230883: \"抚远市\",\n 230902: \"新兴区\",\n 230903: \"桃山区\",\n 230904: \"茄子河区\",\n 230921: \"勃利县\",\n 231002: \"东安区\",\n 231003: \"阳明区\",\n 231004: \"爱民区\",\n 231005: \"西安区\",\n 231025: \"林口县\",\n 231081: \"绥芬河市\",\n 231083: \"海林市\",\n 231084: \"宁安市\",\n 231085: \"穆棱市\",\n 231086: \"东宁市\",\n 231102: \"爱辉区\",\n 231123: \"逊克县\",\n 231124: \"孙吴县\",\n 231181: \"北安市\",\n 231182: \"五大连池市\",\n 231183: \"嫩江市\",\n 231202: \"北林区\",\n 231221: \"望奎县\",\n 231222: \"兰西县\",\n 231223: \"青冈县\",\n 231224: \"庆安县\",\n 231225: \"明水县\",\n 231226: \"绥棱县\",\n 231281: \"安达市\",\n 231282: \"肇东市\",\n 231283: \"海伦市\",\n 232701: \"漠河市\",\n 232721: \"呼玛县\",\n 232722: \"塔河县\",\n 232761: \"加格达奇区\",\n 232762: \"松岭区\",\n 232763: \"新林区\",\n 232764: \"呼中区\",\n 310101: \"黄浦区\",\n 310104: \"徐汇区\",\n 310105: \"长宁区\",\n 310106: \"静安区\",\n 310107: \"普陀区\",\n 310109: \"虹口区\",\n 310110: \"杨浦区\",\n 310112: \"闵行区\",\n 310113: \"宝山区\",\n 310114: \"嘉定区\",\n 310115: \"浦东新区\",\n 310116: \"金山区\",\n 310117: \"松江区\",\n 310118: \"青浦区\",\n 310120: \"奉贤区\",\n 310151: \"崇明区\",\n 320102: \"玄武区\",\n 320104: \"秦淮区\",\n 320105: \"建邺区\",\n 320106: \"鼓楼区\",\n 320111: \"浦口区\",\n 320112: \"江北新区\",\n 320113: \"栖霞区\",\n 320114: \"雨花台区\",\n 320115: \"江宁区\",\n 320116: \"六合区\",\n 320117: \"溧水区\",\n 320118: \"高淳区\",\n 320205: \"锡山区\",\n 320206: \"惠山区\",\n 320211: \"滨湖区\",\n 320213: \"梁溪区\",\n 320214: \"新吴区\",\n 320281: \"江阴市\",\n 320282: \"宜兴市\",\n 320302: \"鼓楼区\",\n 320303: \"云龙区\",\n 320305: \"贾汪区\",\n 320311: \"泉山区\",\n 320312: \"铜山区\",\n 320321: \"丰县\",\n 320322: \"沛县\",\n 320324: \"睢宁县\",\n 320371: \"徐州经济技术开发区\",\n 320381: \"新沂市\",\n 320382: \"邳州市\",\n 320391: \"工业园区\",\n 320402: \"天宁区\",\n 320404: \"钟楼区\",\n 320411: \"新北区\",\n 320412: \"武进区\",\n 320413: \"金坛区\",\n 320481: \"溧阳市\",\n 320505: \"虎丘区\",\n 320506: \"吴中区\",\n 320507: \"相城区\",\n 320508: \"姑苏区\",\n 320509: \"吴江区\",\n 320571: \"苏州工业园区\",\n 320581: \"常熟市\",\n 320582: \"张家港市\",\n 320583: \"昆山市\",\n 320585: \"太仓市\",\n 320590: \"工业园区\",\n 320591: \"高新区\",\n 320602: \"崇川区\",\n 320611: \"港闸区\",\n 320612: \"通州区\",\n 320623: \"如东县\",\n 320681: \"启东市\",\n 320682: \"如皋市\",\n 320684: \"海门市\",\n 320685: \"海安市\",\n 320691: \"高新区\",\n 320703: \"连云区\",\n 320706: \"海州区\",\n 320707: \"赣榆区\",\n 320722: \"东海县\",\n 320723: \"灌云县\",\n 320724: \"灌南县\",\n 320771: \"连云港经济技术开发区\",\n 320803: \"淮安区\",\n 320804: \"淮阴区\",\n 320812: \"清江浦区\",\n 320813: \"洪泽区\",\n 320826: \"涟水县\",\n 320830: \"盱眙县\",\n 320831: \"金湖县\",\n 320871: \"淮安经济技术开发区\",\n 320890: \"经济开发区\",\n 320902: \"亭湖区\",\n 320903: \"盐都区\",\n 320904: \"大丰区\",\n 320921: \"响水县\",\n 320922: \"滨海县\",\n 320923: \"阜宁县\",\n 320924: \"射阳县\",\n 320925: \"建湖县\",\n 320971: \"盐城经济技术开发区\",\n 320981: \"东台市\",\n 321002: \"广陵区\",\n 321003: \"邗江区\",\n 321012: \"江都区\",\n 321023: \"宝应县\",\n 321071: \"扬州经济技术开发区\",\n 321081: \"仪征市\",\n 321084: \"高邮市\",\n 321090: \"经济开发区\",\n 321102: \"京口区\",\n 321111: \"润州区\",\n 321112: \"丹徒区\",\n 321150: \"镇江新区\",\n 321181: \"丹阳市\",\n 321182: \"扬中市\",\n 321183: \"句容市\",\n 321202: \"海陵区\",\n 321203: \"高港区\",\n 321204: \"姜堰区\",\n 321271: \"泰州医药高新技术产业开发区\",\n 321281: \"兴化市\",\n 321282: \"靖江市\",\n 321283: \"泰兴市\",\n 321302: \"宿城区\",\n 321311: \"宿豫区\",\n 321322: \"沭阳县\",\n 321323: \"泗阳县\",\n 321324: \"泗洪县\",\n 321371: \"宿迁经济技术开发区\",\n 330102: \"上城区\",\n 330105: \"拱墅区\",\n 330106: \"西湖区\",\n 330108: \"滨江区\",\n 330109: \"萧山区\",\n 330110: \"余杭区\",\n 330111: \"富阳区\",\n 330112: \"临安区\",\n 330113: \"临平区\",\n 330114: \"钱塘区\",\n 330122: \"桐庐县\",\n 330127: \"淳安县\",\n 330182: \"建德市\",\n 330203: \"海曙区\",\n 330205: \"江北区\",\n 330206: \"北仑区\",\n 330211: \"镇海区\",\n 330212: \"鄞州区\",\n 330213: \"奉化区\",\n 330225: \"象山县\",\n 330226: \"宁海县\",\n 330281: \"余姚市\",\n 330282: \"慈溪市\",\n 330302: \"鹿城区\",\n 330303: \"龙湾区\",\n 330304: \"瓯海区\",\n 330305: \"洞头区\",\n 330324: \"永嘉县\",\n 330326: \"平阳县\",\n 330327: \"苍南县\",\n 330328: \"文成县\",\n 330329: \"泰顺县\",\n 330381: \"瑞安市\",\n 330382: \"乐清市\",\n 330383: \"龙港市\",\n 330402: \"南湖区\",\n 330411: \"秀洲区\",\n 330421: \"嘉善县\",\n 330424: \"海盐县\",\n 330481: \"海宁市\",\n 330482: \"平湖市\",\n 330483: \"桐乡市\",\n 330502: \"吴兴区\",\n 330503: \"南浔区\",\n 330521: \"德清县\",\n 330522: \"长兴县\",\n 330523: \"安吉县\",\n 330602: \"越城区\",\n 330603: \"柯桥区\",\n 330604: \"上虞区\",\n 330624: \"新昌县\",\n 330681: \"诸暨市\",\n 330683: \"嵊州市\",\n 330702: \"婺城区\",\n 330703: \"金东区\",\n 330723: \"武义县\",\n 330726: \"浦江县\",\n 330727: \"磐安县\",\n 330781: \"兰溪市\",\n 330782: \"义乌市\",\n 330783: \"东阳市\",\n 330784: \"永康市\",\n 330802: \"柯城区\",\n 330803: \"衢江区\",\n 330822: \"常山县\",\n 330824: \"开化县\",\n 330825: \"龙游县\",\n 330881: \"江山市\",\n 330902: \"定海区\",\n 330903: \"普陀区\",\n 330921: \"岱山县\",\n 330922: \"嵊泗县\",\n 331002: \"椒江区\",\n 331003: \"黄岩区\",\n 331004: \"路桥区\",\n 331022: \"三门县\",\n 331023: \"天台县\",\n 331024: \"仙居县\",\n 331081: \"温岭市\",\n 331082: \"临海市\",\n 331083: \"玉环市\",\n 331102: \"莲都区\",\n 331121: \"青田县\",\n 331122: \"缙云县\",\n 331123: \"遂昌县\",\n 331124: \"松阳县\",\n 331125: \"云和县\",\n 331126: \"庆元县\",\n 331127: \"景宁畲族自治县\",\n 331181: \"龙泉市\",\n 340102: \"瑶海区\",\n 340103: \"庐阳区\",\n 340104: \"蜀山区\",\n 340111: \"包河区\",\n 340121: \"长丰县\",\n 340122: \"肥东县\",\n 340123: \"肥西县\",\n 340124: \"庐江县\",\n 340171: \"合肥高新技术产业开发区\",\n 340172: \"合肥经济技术开发区\",\n 340173: \"合肥新站高新技术产业开发区\",\n 340181: \"巢湖市\",\n 340190: \"高新技术开发区\",\n 340191: \"经济技术开发区\",\n 340202: \"镜湖区\",\n 340203: \"弋江区\",\n 340207: \"鸠江区\",\n 340208: \"三山区\",\n 340221: \"芜湖县\",\n 340222: \"繁昌县\",\n 340223: \"南陵县\",\n 340281: \"无为市\",\n 340302: \"龙子湖区\",\n 340303: \"蚌山区\",\n 340304: \"禹会区\",\n 340311: \"淮上区\",\n 340321: \"怀远县\",\n 340322: \"五河县\",\n 340323: \"固镇县\",\n 340371: \"蚌埠市高新技术开发区\",\n 340372: \"蚌埠市经济开发区\",\n 340402: \"大通区\",\n 340403: \"田家庵区\",\n 340404: \"谢家集区\",\n 340405: \"八公山区\",\n 340406: \"潘集区\",\n 340421: \"凤台县\",\n 340422: \"寿县\",\n 340503: \"花山区\",\n 340504: \"雨山区\",\n 340506: \"博望区\",\n 340521: \"当涂县\",\n 340522: \"含山县\",\n 340523: \"和县\",\n 340602: \"杜集区\",\n 340603: \"相山区\",\n 340604: \"烈山区\",\n 340621: \"濉溪县\",\n 340705: \"铜官区\",\n 340706: \"义安区\",\n 340711: \"郊区\",\n 340722: \"枞阳县\",\n 340802: \"迎江区\",\n 340803: \"大观区\",\n 340811: \"宜秀区\",\n 340822: \"怀宁县\",\n 340825: \"太湖县\",\n 340826: \"宿松县\",\n 340827: \"望江县\",\n 340828: \"岳西县\",\n 340881: \"桐城市\",\n 340882: \"潜山市\",\n 341002: \"屯溪区\",\n 341003: \"黄山区\",\n 341004: \"徽州区\",\n 341021: \"歙县\",\n 341022: \"休宁县\",\n 341023: \"黟县\",\n 341024: \"祁门县\",\n 341102: \"琅琊区\",\n 341103: \"南谯区\",\n 341122: \"来安县\",\n 341124: \"全椒县\",\n 341125: \"定远县\",\n 341126: \"凤阳县\",\n 341181: \"天长市\",\n 341182: \"明光市\",\n 341202: \"颍州区\",\n 341203: \"颍东区\",\n 341204: \"颍泉区\",\n 341221: \"临泉县\",\n 341222: \"太和县\",\n 341225: \"阜南县\",\n 341226: \"颍上县\",\n 341271: \"阜阳合肥现代产业园区\",\n 341282: \"界首市\",\n 341302: \"埇桥区\",\n 341321: \"砀山县\",\n 341322: \"萧县\",\n 341323: \"灵璧县\",\n 341324: \"泗县\",\n 341371: \"宿州马鞍山现代产业园区\",\n 341372: \"宿州经济技术开发区\",\n 341390: \"经济开发区\",\n 341502: \"金安区\",\n 341503: \"裕安区\",\n 341504: \"叶集区\",\n 341522: \"霍邱县\",\n 341523: \"舒城县\",\n 341524: \"金寨县\",\n 341525: \"霍山县\",\n 341602: \"谯城区\",\n 341621: \"涡阳县\",\n 341622: \"蒙城县\",\n 341623: \"利辛县\",\n 341702: \"贵池区\",\n 341721: \"东至县\",\n 341722: \"石台县\",\n 341723: \"青阳县\",\n 341802: \"宣州区\",\n 341821: \"郎溪县\",\n 341823: \"泾县\",\n 341824: \"绩溪县\",\n 341825: \"旌德县\",\n 341871: \"宣城市经济开发区\",\n 341881: \"宁国市\",\n 341882: \"广德市\",\n 350102: \"鼓楼区\",\n 350103: \"台江区\",\n 350104: \"仓山区\",\n 350105: \"马尾区\",\n 350111: \"晋安区\",\n 350112: \"长乐区\",\n 350121: \"闽侯县\",\n 350122: \"连江县\",\n 350123: \"罗源县\",\n 350124: \"闽清县\",\n 350125: \"永泰县\",\n 350128: \"平潭县\",\n 350181: \"福清市\",\n 350203: \"思明区\",\n 350205: \"海沧区\",\n 350206: \"湖里区\",\n 350211: \"集美区\",\n 350212: \"同安区\",\n 350213: \"翔安区\",\n 350302: \"城厢区\",\n 350303: \"涵江区\",\n 350304: \"荔城区\",\n 350305: \"秀屿区\",\n 350322: \"仙游县\",\n 350402: \"梅列区\",\n 350403: \"三元区\",\n 350421: \"明溪县\",\n 350423: \"清流县\",\n 350424: \"宁化县\",\n 350425: \"大田县\",\n 350426: \"尤溪县\",\n 350427: \"沙县\",\n 350428: \"将乐县\",\n 350429: \"泰宁县\",\n 350430: \"建宁县\",\n 350481: \"永安市\",\n 350502: \"鲤城区\",\n 350503: \"丰泽区\",\n 350504: \"洛江区\",\n 350505: \"泉港区\",\n 350521: \"惠安县\",\n 350524: \"安溪县\",\n 350525: \"永春县\",\n 350526: \"德化县\",\n 350527: \"金门县\",\n 350581: \"石狮市\",\n 350582: \"晋江市\",\n 350583: \"南安市\",\n 350602: \"芗城区\",\n 350603: \"龙文区\",\n 350622: \"云霄县\",\n 350623: \"漳浦县\",\n 350624: \"诏安县\",\n 350625: \"长泰县\",\n 350626: \"东山县\",\n 350627: \"南靖县\",\n 350628: \"平和县\",\n 350629: \"华安县\",\n 350681: \"龙海市\",\n 350702: \"延平区\",\n 350703: \"建阳区\",\n 350721: \"顺昌县\",\n 350722: \"浦城县\",\n 350723: \"光泽县\",\n 350724: \"松溪县\",\n 350725: \"政和县\",\n 350781: \"邵武市\",\n 350782: \"武夷山市\",\n 350783: \"建瓯市\",\n 350802: \"新罗区\",\n 350803: \"永定区\",\n 350821: \"长汀县\",\n 350823: \"上杭县\",\n 350824: \"武平县\",\n 350825: \"连城县\",\n 350881: \"漳平市\",\n 350902: \"蕉城区\",\n 350921: \"霞浦县\",\n 350922: \"古田县\",\n 350923: \"屏南县\",\n 350924: \"寿宁县\",\n 350925: \"周宁县\",\n 350926: \"柘荣县\",\n 350981: \"福安市\",\n 350982: \"福鼎市\",\n 360102: \"东湖区\",\n 360103: \"西湖区\",\n 360104: \"青云谱区\",\n 360111: \"青山湖区\",\n 360112: \"新建区\",\n 360113: \"红谷滩区\",\n 360121: \"南昌县\",\n 360123: \"安义县\",\n 360124: \"进贤县\",\n 360190: \"经济技术开发区\",\n 360192: \"高新区\",\n 360202: \"昌江区\",\n 360203: \"珠山区\",\n 360222: \"浮梁县\",\n 360281: \"乐平市\",\n 360302: \"安源区\",\n 360313: \"湘东区\",\n 360321: \"莲花县\",\n 360322: \"上栗县\",\n 360323: \"芦溪县\",\n 360402: \"濂溪区\",\n 360403: \"浔阳区\",\n 360404: \"柴桑区\",\n 360423: \"武宁县\",\n 360424: \"修水县\",\n 360425: \"永修县\",\n 360426: \"德安县\",\n 360428: \"都昌县\",\n 360429: \"湖口县\",\n 360430: \"彭泽县\",\n 360481: \"瑞昌市\",\n 360482: \"共青城市\",\n 360483: \"庐山市\",\n 360490: \"经济技术开发区\",\n 360502: \"渝水区\",\n 360521: \"分宜县\",\n 360602: \"月湖区\",\n 360603: \"余江区\",\n 360681: \"贵溪市\",\n 360702: \"章贡区\",\n 360703: \"南康区\",\n 360704: \"赣县区\",\n 360722: \"信丰县\",\n 360723: \"大余县\",\n 360724: \"上犹县\",\n 360725: \"崇义县\",\n 360726: \"安远县\",\n 360728: \"定南县\",\n 360729: \"全南县\",\n 360730: \"宁都县\",\n 360731: \"于都县\",\n 360732: \"兴国县\",\n 360733: \"会昌县\",\n 360734: \"寻乌县\",\n 360735: \"石城县\",\n 360781: \"瑞金市\",\n 360783: \"龙南市\",\n 360802: \"吉州区\",\n 360803: \"青原区\",\n 360821: \"吉安县\",\n 360822: \"吉水县\",\n 360823: \"峡江县\",\n 360824: \"新干县\",\n 360825: \"永丰县\",\n 360826: \"泰和县\",\n 360827: \"遂川县\",\n 360828: \"万安县\",\n 360829: \"安福县\",\n 360830: \"永新县\",\n 360881: \"井冈山市\",\n 360902: \"袁州区\",\n 360921: \"奉新县\",\n 360922: \"万载县\",\n 360923: \"上高县\",\n 360924: \"宜丰县\",\n 360925: \"靖安县\",\n 360926: \"铜鼓县\",\n 360981: \"丰城市\",\n 360982: \"樟树市\",\n 360983: \"高安市\",\n 361002: \"临川区\",\n 361003: \"东乡区\",\n 361021: \"南城县\",\n 361022: \"黎川县\",\n 361023: \"南丰县\",\n 361024: \"崇仁县\",\n 361025: \"乐安县\",\n 361026: \"宜黄县\",\n 361027: \"金溪县\",\n 361028: \"资溪县\",\n 361030: \"广昌县\",\n 361102: \"信州区\",\n 361103: \"广丰区\",\n 361104: \"广信区\",\n 361123: \"玉山县\",\n 361124: \"铅山县\",\n 361125: \"横峰县\",\n 361126: \"弋阳县\",\n 361127: \"余干县\",\n 361128: \"鄱阳县\",\n 361129: \"万年县\",\n 361130: \"婺源县\",\n 361181: \"德兴市\",\n 370102: \"历下区\",\n 370103: \"市中区\",\n 370104: \"槐荫区\",\n 370105: \"天桥区\",\n 370112: \"历城区\",\n 370113: \"长清区\",\n 370114: \"章丘区\",\n 370115: \"济阳区\",\n 370116: \"莱芜区\",\n 370117: \"钢城区\",\n 370124: \"平阴县\",\n 370126: \"商河县\",\n 370171: \"济南高新技术产业开发区\",\n 370190: \"高新区\",\n 370202: \"市南区\",\n 370203: \"市北区\",\n 370211: \"黄岛区\",\n 370212: \"崂山区\",\n 370213: \"李沧区\",\n 370214: \"城阳区\",\n 370215: \"即墨区\",\n 370271: \"青岛高新技术产业开发区\",\n 370281: \"胶州市\",\n 370283: \"平度市\",\n 370285: \"莱西市\",\n 370290: \"开发区\",\n 370302: \"淄川区\",\n 370303: \"张店区\",\n 370304: \"博山区\",\n 370305: \"临淄区\",\n 370306: \"周村区\",\n 370321: \"桓台县\",\n 370322: \"高青县\",\n 370323: \"沂源县\",\n 370402: \"市中区\",\n 370403: \"薛城区\",\n 370404: \"峄城区\",\n 370405: \"台儿庄区\",\n 370406: \"山亭区\",\n 370481: \"滕州市\",\n 370502: \"东营区\",\n 370503: \"河口区\",\n 370505: \"垦利区\",\n 370522: \"利津县\",\n 370523: \"广饶县\",\n 370571: \"东营经济技术开发区\",\n 370572: \"东营港经济开发区\",\n 370602: \"芝罘区\",\n 370611: \"福山区\",\n 370612: \"牟平区\",\n 370613: \"莱山区\",\n 370634: \"长岛县\",\n 370671: \"烟台高新技术产业开发区\",\n 370672: \"烟台经济技术开发区\",\n 370681: \"龙口市\",\n 370682: \"莱阳市\",\n 370683: \"莱州市\",\n 370684: \"蓬莱市\",\n 370685: \"招远市\",\n 370686: \"栖霞市\",\n 370687: \"海阳市\",\n 370690: \"开发区\",\n 370702: \"潍城区\",\n 370703: \"寒亭区\",\n 370704: \"坊子区\",\n 370705: \"奎文区\",\n 370724: \"临朐县\",\n 370725: \"昌乐县\",\n 370772: \"潍坊滨海经济技术开发区\",\n 370781: \"青州市\",\n 370782: \"诸城市\",\n 370783: \"寿光市\",\n 370784: \"安丘市\",\n 370785: \"高密市\",\n 370786: \"昌邑市\",\n 370790: \"开发区\",\n 370791: \"高新区\",\n 370811: \"任城区\",\n 370812: \"兖州区\",\n 370826: \"微山县\",\n 370827: \"鱼台县\",\n 370828: \"金乡县\",\n 370829: \"嘉祥县\",\n 370830: \"汶上县\",\n 370831: \"泗水县\",\n 370832: \"梁山县\",\n 370871: \"济宁高新技术产业开发区\",\n 370881: \"曲阜市\",\n 370883: \"邹城市\",\n 370890: \"高新区\",\n 370902: \"泰山区\",\n 370911: \"岱岳区\",\n 370921: \"宁阳县\",\n 370923: \"东平县\",\n 370982: \"新泰市\",\n 370983: \"肥城市\",\n 371002: \"环翠区\",\n 371003: \"文登区\",\n 371071: \"威海火炬高技术产业开发区\",\n 371072: \"威海经济技术开发区\",\n 371082: \"荣成市\",\n 371083: \"乳山市\",\n 371091: \"经济技术开发区\",\n 371102: \"东港区\",\n 371103: \"岚山区\",\n 371121: \"五莲县\",\n 371122: \"莒县\",\n 371171: \"日照经济技术开发区\",\n 371302: \"兰山区\",\n 371311: \"罗庄区\",\n 371312: \"河东区\",\n 371321: \"沂南县\",\n 371322: \"郯城县\",\n 371323: \"沂水县\",\n 371324: \"兰陵县\",\n 371325: \"费县\",\n 371326: \"平邑县\",\n 371327: \"莒南县\",\n 371328: \"蒙阴县\",\n 371329: \"临沭县\",\n 371371: \"临沂高新技术产业开发区\",\n 371402: \"德城区\",\n 371403: \"陵城区\",\n 371422: \"宁津县\",\n 371423: \"庆云县\",\n 371424: \"临邑县\",\n 371425: \"齐河县\",\n 371426: \"平原县\",\n 371427: \"夏津县\",\n 371428: \"武城县\",\n 371472: \"德州运河经济开发区\",\n 371481: \"乐陵市\",\n 371482: \"禹城市\",\n 371502: \"东昌府区\",\n 371503: \"茌平区\",\n 371521: \"阳谷县\",\n 371522: \"莘县\",\n 371524: \"东阿县\",\n 371525: \"冠县\",\n 371526: \"高唐县\",\n 371581: \"临清市\",\n 371602: \"滨城区\",\n 371603: \"沾化区\",\n 371621: \"惠民县\",\n 371622: \"阳信县\",\n 371623: \"无棣县\",\n 371625: \"博兴县\",\n 371681: \"邹平市\",\n 371702: \"牡丹区\",\n 371703: \"定陶区\",\n 371721: \"曹县\",\n 371722: \"单县\",\n 371723: \"成武县\",\n 371724: \"巨野县\",\n 371725: \"郓城县\",\n 371726: \"鄄城县\",\n 371728: \"东明县\",\n 371771: \"菏泽经济技术开发区\",\n 371772: \"菏泽高新技术开发区\",\n 410102: \"中原区\",\n 410103: \"二七区\",\n 410104: \"管城回族区\",\n 410105: \"金水区\",\n 410106: \"上街区\",\n 410108: \"惠济区\",\n 410122: \"中牟县\",\n 410171: \"郑州经济技术开发区\",\n 410172: \"郑州高新技术产业开发区\",\n 410173: \"郑州航空港经济综合实验区\",\n 410181: \"巩义市\",\n 410182: \"荥阳市\",\n 410183: \"新密市\",\n 410184: \"新郑市\",\n 410185: \"登封市\",\n 410190: \"高新技术开发区\",\n 410191: \"经济技术开发区\",\n 410202: \"龙亭区\",\n 410203: \"顺河回族区\",\n 410204: \"鼓楼区\",\n 410205: \"禹王台区\",\n 410212: \"祥符区\",\n 410221: \"杞县\",\n 410222: \"通许县\",\n 410223: \"尉氏县\",\n 410225: \"兰考县\",\n 410302: \"老城区\",\n 410303: \"西工区\",\n 410304: \"瀍河回族区\",\n 410305: \"涧西区\",\n 410306: \"吉利区\",\n 410311: \"洛龙区\",\n 410322: \"孟津县\",\n 410323: \"新安县\",\n 410324: \"栾川县\",\n 410325: \"嵩县\",\n 410326: \"汝阳县\",\n 410327: \"宜阳县\",\n 410328: \"洛宁县\",\n 410329: \"伊川县\",\n 410381: \"偃师市\",\n 410402: \"新华区\",\n 410403: \"卫东区\",\n 410404: \"石龙区\",\n 410411: \"湛河区\",\n 410421: \"宝丰县\",\n 410422: \"叶县\",\n 410423: \"鲁山县\",\n 410425: \"郏县\",\n 410471: \"平顶山高新技术产业开发区\",\n 410481: \"舞钢市\",\n 410482: \"汝州市\",\n 410502: \"文峰区\",\n 410503: \"北关区\",\n 410505: \"殷都区\",\n 410506: \"龙安区\",\n 410522: \"安阳县\",\n 410523: \"汤阴县\",\n 410526: \"滑县\",\n 410527: \"内黄县\",\n 410581: \"林州市\",\n 410590: \"开发区\",\n 410602: \"鹤山区\",\n 410603: \"山城区\",\n 410611: \"淇滨区\",\n 410621: \"浚县\",\n 410622: \"淇县\",\n 410702: \"红旗区\",\n 410703: \"卫滨区\",\n 410704: \"凤泉区\",\n 410711: \"牧野区\",\n 410721: \"新乡县\",\n 410724: \"获嘉县\",\n 410725: \"原阳县\",\n 410726: \"延津县\",\n 410727: \"封丘县\",\n 410771: \"新乡高新技术产业开发区\",\n 410772: \"新乡经济技术开发区\",\n 410781: \"卫辉市\",\n 410782: \"辉县市\",\n 410783: \"长垣市\",\n 410802: \"解放区\",\n 410803: \"中站区\",\n 410804: \"马村区\",\n 410811: \"山阳区\",\n 410821: \"修武县\",\n 410822: \"博爱县\",\n 410823: \"武陟县\",\n 410825: \"温县\",\n 410871: \"焦作城乡一体化示范区\",\n 410882: \"沁阳市\",\n 410883: \"孟州市\",\n 410902: \"华龙区\",\n 410922: \"清丰县\",\n 410923: \"南乐县\",\n 410926: \"范县\",\n 410927: \"台前县\",\n 410928: \"濮阳县\",\n 410971: \"河南濮阳工业园区\",\n 411002: \"魏都区\",\n 411003: \"建安区\",\n 411024: \"鄢陵县\",\n 411025: \"襄城县\",\n 411071: \"许昌经济技术开发区\",\n 411081: \"禹州市\",\n 411082: \"长葛市\",\n 411102: \"源汇区\",\n 411103: \"郾城区\",\n 411104: \"召陵区\",\n 411121: \"舞阳县\",\n 411122: \"临颍县\",\n 411171: \"漯河经济技术开发区\",\n 411202: \"湖滨区\",\n 411203: \"陕州区\",\n 411221: \"渑池县\",\n 411224: \"卢氏县\",\n 411271: \"河南三门峡经济开发区\",\n 411281: \"义马市\",\n 411282: \"灵宝市\",\n 411302: \"宛城区\",\n 411303: \"卧龙区\",\n 411321: \"南召县\",\n 411322: \"方城县\",\n 411323: \"西峡县\",\n 411324: \"镇平县\",\n 411325: \"内乡县\",\n 411326: \"淅川县\",\n 411327: \"社旗县\",\n 411328: \"唐河县\",\n 411329: \"新野县\",\n 411330: \"桐柏县\",\n 411372: \"南阳市城乡一体化示范区\",\n 411381: \"邓州市\",\n 411402: \"梁园区\",\n 411403: \"睢阳区\",\n 411421: \"民权县\",\n 411422: \"睢县\",\n 411423: \"宁陵县\",\n 411424: \"柘城县\",\n 411425: \"虞城县\",\n 411426: \"夏邑县\",\n 411481: \"永城市\",\n 411502: \"浉河区\",\n 411503: \"平桥区\",\n 411521: \"罗山县\",\n 411522: \"光山县\",\n 411523: \"新县\",\n 411524: \"商城县\",\n 411525: \"固始县\",\n 411526: \"潢川县\",\n 411527: \"淮滨县\",\n 411528: \"息县\",\n 411602: \"川汇区\",\n 411603: \"淮阳区\",\n 411621: \"扶沟县\",\n 411622: \"西华县\",\n 411623: \"商水县\",\n 411624: \"沈丘县\",\n 411625: \"郸城县\",\n 411627: \"太康县\",\n 411628: \"鹿邑县\",\n 411671: \"河南周口经济开发区\",\n 411681: \"项城市\",\n 411690: \"经济开发区\",\n 411702: \"驿城区\",\n 411721: \"西平县\",\n 411722: \"上蔡县\",\n 411723: \"平舆县\",\n 411724: \"正阳县\",\n 411725: \"确山县\",\n 411726: \"泌阳县\",\n 411727: \"汝南县\",\n 411728: \"遂平县\",\n 411729: \"新蔡县\",\n 419001: \"济源市\",\n 420102: \"江岸区\",\n 420103: \"江汉区\",\n 420104: \"硚口区\",\n 420105: \"汉阳区\",\n 420106: \"武昌区\",\n 420107: \"青山区\",\n 420111: \"洪山区\",\n 420112: \"东西湖区\",\n 420113: \"汉南区\",\n 420114: \"蔡甸区\",\n 420115: \"江夏区\",\n 420116: \"黄陂区\",\n 420117: \"新洲区\",\n 420202: \"黄石港区\",\n 420203: \"西塞山区\",\n 420204: \"下陆区\",\n 420205: \"铁山区\",\n 420222: \"阳新县\",\n 420281: \"大冶市\",\n 420302: \"茅箭区\",\n 420303: \"张湾区\",\n 420304: \"郧阳区\",\n 420322: \"郧西县\",\n 420323: \"竹山县\",\n 420324: \"竹溪县\",\n 420325: \"房县\",\n 420381: \"丹江口市\",\n 420502: \"西陵区\",\n 420503: \"伍家岗区\",\n 420504: \"点军区\",\n 420505: \"猇亭区\",\n 420506: \"夷陵区\",\n 420525: \"远安县\",\n 420526: \"兴山县\",\n 420527: \"秭归县\",\n 420528: \"长阳土家族自治县\",\n 420529: \"五峰土家族自治县\",\n 420581: \"宜都市\",\n 420582: \"当阳市\",\n 420583: \"枝江市\",\n 420590: \"经济开发区\",\n 420602: \"襄城区\",\n 420606: \"樊城区\",\n 420607: \"襄州区\",\n 420624: \"南漳县\",\n 420625: \"谷城县\",\n 420626: \"保康县\",\n 420682: \"老河口市\",\n 420683: \"枣阳市\",\n 420684: \"宜城市\",\n 420702: \"梁子湖区\",\n 420703: \"华容区\",\n 420704: \"鄂城区\",\n 420802: \"东宝区\",\n 420804: \"掇刀区\",\n 420822: \"沙洋县\",\n 420881: \"钟祥市\",\n 420882: \"京山市\",\n 420902: \"孝南区\",\n 420921: \"孝昌县\",\n 420922: \"大悟县\",\n 420923: \"云梦县\",\n 420981: \"应城市\",\n 420982: \"安陆市\",\n 420984: \"汉川市\",\n 421002: \"沙市区\",\n 421003: \"荆州区\",\n 421022: \"公安县\",\n 421023: \"监利县\",\n 421024: \"江陵县\",\n 421081: \"石首市\",\n 421083: \"洪湖市\",\n 421087: \"松滋市\",\n 421102: \"黄州区\",\n 421121: \"团风县\",\n 421122: \"红安县\",\n 421123: \"罗田县\",\n 421124: \"英山县\",\n 421125: \"浠水县\",\n 421126: \"蕲春县\",\n 421127: \"黄梅县\",\n 421171: \"龙感湖管理区\",\n 421181: \"麻城市\",\n 421182: \"武穴市\",\n 421202: \"咸安区\",\n 421221: \"嘉鱼县\",\n 421222: \"通城县\",\n 421223: \"崇阳县\",\n 421224: \"通山县\",\n 421281: \"赤壁市\",\n 421303: \"曾都区\",\n 421321: \"随县\",\n 421381: \"广水市\",\n 422801: \"恩施市\",\n 422802: \"利川市\",\n 422822: \"建始县\",\n 422823: \"巴东县\",\n 422825: \"宣恩县\",\n 422826: \"咸丰县\",\n 422827: \"来凤县\",\n 422828: \"鹤峰县\",\n 429004: \"仙桃市\",\n 429005: \"潜江市\",\n 429006: \"天门市\",\n 429021: \"神农架林区\",\n 430102: \"芙蓉区\",\n 430103: \"天心区\",\n 430104: \"岳麓区\",\n 430105: \"开福区\",\n 430111: \"雨花区\",\n 430112: \"望城区\",\n 430121: \"长沙县\",\n 430181: \"浏阳市\",\n 430182: \"宁乡市\",\n 430202: \"荷塘区\",\n 430203: \"芦淞区\",\n 430204: \"石峰区\",\n 430211: \"天元区\",\n 430212: \"渌口区\",\n 430223: \"攸县\",\n 430224: \"茶陵县\",\n 430225: \"炎陵县\",\n 430271: \"云龙示范区\",\n 430281: \"醴陵市\",\n 430302: \"雨湖区\",\n 430304: \"岳塘区\",\n 430321: \"湘潭县\",\n 430373: \"湘潭九华示范区\",\n 430381: \"湘乡市\",\n 430382: \"韶山市\",\n 430405: \"珠晖区\",\n 430406: \"雁峰区\",\n 430407: \"石鼓区\",\n 430408: \"蒸湘区\",\n 430412: \"南岳区\",\n 430421: \"衡阳县\",\n 430422: \"衡南县\",\n 430423: \"衡山县\",\n 430424: \"衡东县\",\n 430426: \"祁东县\",\n 430481: \"耒阳市\",\n 430482: \"常宁市\",\n 430502: \"双清区\",\n 430503: \"大祥区\",\n 430511: \"北塔区\",\n 430522: \"新邵县\",\n 430523: \"邵阳县\",\n 430524: \"隆回县\",\n 430525: \"洞口县\",\n 430527: \"绥宁县\",\n 430528: \"新宁县\",\n 430529: \"城步苗族自治县\",\n 430581: \"武冈市\",\n 430582: \"邵东市\",\n 430602: \"岳阳楼区\",\n 430603: \"云溪区\",\n 430611: \"君山区\",\n 430621: \"岳阳县\",\n 430623: \"华容县\",\n 430624: \"湘阴县\",\n 430626: \"平江县\",\n 430681: \"汨罗市\",\n 430682: \"临湘市\",\n 430702: \"武陵区\",\n 430703: \"鼎城区\",\n 430721: \"安乡县\",\n 430722: \"汉寿县\",\n 430723: \"澧县\",\n 430724: \"临澧县\",\n 430725: \"桃源县\",\n 430726: \"石门县\",\n 430781: \"津市市\",\n 430802: \"永定区\",\n 430811: \"武陵源区\",\n 430821: \"慈利县\",\n 430822: \"桑植县\",\n 430902: \"资阳区\",\n 430903: \"赫山区\",\n 430921: \"南县\",\n 430922: \"桃江县\",\n 430923: \"安化县\",\n 430971: \"益阳市大通湖管理区\",\n 430981: \"沅江市\",\n 431002: \"北湖区\",\n 431003: \"苏仙区\",\n 431021: \"桂阳县\",\n 431022: \"宜章县\",\n 431023: \"永兴县\",\n 431024: \"嘉禾县\",\n 431025: \"临武县\",\n 431026: \"汝城县\",\n 431027: \"桂东县\",\n 431028: \"安仁县\",\n 431081: \"资兴市\",\n 431102: \"零陵区\",\n 431103: \"冷水滩区\",\n 431121: \"祁阳县\",\n 431122: \"东安县\",\n 431123: \"双牌县\",\n 431124: \"道县\",\n 431125: \"江永县\",\n 431126: \"宁远县\",\n 431127: \"蓝山县\",\n 431128: \"新田县\",\n 431129: \"江华瑶族自治县\",\n 431202: \"鹤城区\",\n 431221: \"中方县\",\n 431222: \"沅陵县\",\n 431223: \"辰溪县\",\n 431224: \"溆浦县\",\n 431225: \"会同县\",\n 431226: \"麻阳苗族自治县\",\n 431227: \"新晃侗族自治县\",\n 431228: \"芷江侗族自治县\",\n 431229: \"靖州苗族侗族自治县\",\n 431230: \"通道侗族自治县\",\n 431271: \"怀化市洪江管理区\",\n 431281: \"洪江市\",\n 431302: \"娄星区\",\n 431321: \"双峰县\",\n 431322: \"新化县\",\n 431381: \"冷水江市\",\n 431382: \"涟源市\",\n 433101: \"吉首市\",\n 433122: \"泸溪县\",\n 433123: \"凤凰县\",\n 433124: \"花垣县\",\n 433125: \"保靖县\",\n 433126: \"古丈县\",\n 433127: \"永顺县\",\n 433130: \"龙山县\",\n 440103: \"荔湾区\",\n 440104: \"越秀区\",\n 440105: \"海珠区\",\n 440106: \"天河区\",\n 440111: \"白云区\",\n 440112: \"黄埔区\",\n 440113: \"番禺区\",\n 440114: \"花都区\",\n 440115: \"南沙区\",\n 440117: \"从化区\",\n 440118: \"增城区\",\n 440203: \"武江区\",\n 440204: \"浈江区\",\n 440205: \"曲江区\",\n 440222: \"始兴县\",\n 440224: \"仁化县\",\n 440229: \"翁源县\",\n 440232: \"乳源瑶族自治县\",\n 440233: \"新丰县\",\n 440281: \"乐昌市\",\n 440282: \"南雄市\",\n 440303: \"罗湖区\",\n 440304: \"福田区\",\n 440305: \"南山区\",\n 440306: \"宝安区\",\n 440307: \"龙岗区\",\n 440308: \"盐田区\",\n 440309: \"龙华区\",\n 440310: \"坪山区\",\n 440311: \"光明区\",\n 440402: \"香洲区\",\n 440403: \"斗门区\",\n 440404: \"金湾区\",\n 440507: \"龙湖区\",\n 440511: \"金平区\",\n 440512: \"濠江区\",\n 440513: \"潮阳区\",\n 440514: \"潮南区\",\n 440515: \"澄海区\",\n 440523: \"南澳县\",\n 440604: \"禅城区\",\n 440605: \"南海区\",\n 440606: \"顺德区\",\n 440607: \"三水区\",\n 440608: \"高明区\",\n 440703: \"蓬江区\",\n 440704: \"江海区\",\n 440705: \"新会区\",\n 440781: \"台山市\",\n 440783: \"开平市\",\n 440784: \"鹤山市\",\n 440785: \"恩平市\",\n 440802: \"赤坎区\",\n 440803: \"霞山区\",\n 440804: \"坡头区\",\n 440811: \"麻章区\",\n 440823: \"遂溪县\",\n 440825: \"徐闻县\",\n 440881: \"廉江市\",\n 440882: \"雷州市\",\n 440883: \"吴川市\",\n 440890: \"经济技术开发区\",\n 440902: \"茂南区\",\n 440904: \"电白区\",\n 440981: \"高州市\",\n 440982: \"化州市\",\n 440983: \"信宜市\",\n 441202: \"端州区\",\n 441203: \"鼎湖区\",\n 441204: \"高要区\",\n 441223: \"广宁县\",\n 441224: \"怀集县\",\n 441225: \"封开县\",\n 441226: \"德庆县\",\n 441284: \"四会市\",\n 441302: \"惠城区\",\n 441303: \"惠阳区\",\n 441322: \"博罗县\",\n 441323: \"惠东县\",\n 441324: \"龙门县\",\n 441402: \"梅江区\",\n 441403: \"梅县区\",\n 441422: \"大埔县\",\n 441423: \"丰顺县\",\n 441424: \"五华县\",\n 441426: \"平远县\",\n 441427: \"蕉岭县\",\n 441481: \"兴宁市\",\n 441502: \"城区\",\n 441521: \"海丰县\",\n 441523: \"陆河县\",\n 441581: \"陆丰市\",\n 441602: \"源城区\",\n 441621: \"紫金县\",\n 441622: \"龙川县\",\n 441623: \"连平县\",\n 441624: \"和平县\",\n 441625: \"东源县\",\n 441702: \"江城区\",\n 441704: \"阳东区\",\n 441721: \"阳西县\",\n 441781: \"阳春市\",\n 441802: \"清城区\",\n 441803: \"清新区\",\n 441821: \"佛冈县\",\n 441823: \"阳山县\",\n 441825: \"连山壮族瑶族自治县\",\n 441826: \"连南瑶族自治县\",\n 441881: \"英德市\",\n 441882: \"连州市\",\n 441901: \"中堂镇\",\n 441903: \"南城街道\",\n 441904: \"长安镇\",\n 441905: \"东坑镇\",\n 441906: \"樟木头镇\",\n 441907: \"莞城街道\",\n 441908: \"石龙镇\",\n 441909: \"桥头镇\",\n 441910: \"万江街道\",\n 441911: \"麻涌镇\",\n 441912: \"虎门镇\",\n 441913: \"谢岗镇\",\n 441914: \"石碣镇\",\n 441915: \"茶山镇\",\n 441916: \"东城街道\",\n 441917: \"洪梅镇\",\n 441918: \"道滘镇\",\n 441919: \"高埗镇\",\n 441920: \"企石镇\",\n 441921: \"凤岗镇\",\n 441922: \"大岭山镇\",\n 441923: \"松山湖\",\n 441924: \"清溪镇\",\n 441925: \"望牛墩镇\",\n 441926: \"厚街镇\",\n 441927: \"常平镇\",\n 441928: \"寮步镇\",\n 441929: \"石排镇\",\n 441930: \"横沥镇\",\n 441931: \"塘厦镇\",\n 441932: \"黄江镇\",\n 441933: \"大朗镇\",\n 441934: \"东莞港\",\n 441935: \"东莞生态园\",\n 441990: \"沙田镇\",\n 442001: \"南头镇\",\n 442002: \"神湾镇\",\n 442003: \"东凤镇\",\n 442004: \"五桂山街道\",\n 442005: \"黄圃镇\",\n 442006: \"小榄镇\",\n 442007: \"石岐街道\",\n 442008: \"横栏镇\",\n 442009: \"三角镇\",\n 442010: \"三乡镇\",\n 442011: \"港口镇\",\n 442012: \"沙溪镇\",\n 442013: \"板芙镇\",\n 442015: \"东升镇\",\n 442016: \"阜沙镇\",\n 442017: \"民众镇\",\n 442018: \"东区街道\",\n 442019: \"火炬开发区街道办事处\",\n 442020: \"西区街道\",\n 442021: \"南区街道\",\n 442022: \"古镇镇\",\n 442023: \"坦洲镇\",\n 442024: \"大涌镇\",\n 442025: \"南朗镇\",\n 445102: \"湘桥区\",\n 445103: \"潮安区\",\n 445122: \"饶平县\",\n 445202: \"榕城区\",\n 445203: \"揭东区\",\n 445222: \"揭西县\",\n 445224: \"惠来县\",\n 445281: \"普宁市\",\n 445302: \"云城区\",\n 445303: \"云安区\",\n 445321: \"新兴县\",\n 445322: \"郁南县\",\n 445381: \"罗定市\",\n 450102: \"兴宁区\",\n 450103: \"青秀区\",\n 450105: \"江南区\",\n 450107: \"西乡塘区\",\n 450108: \"良庆区\",\n 450109: \"邕宁区\",\n 450110: \"武鸣区\",\n 450123: \"隆安县\",\n 450124: \"马山县\",\n 450125: \"上林县\",\n 450126: \"宾阳县\",\n 450127: \"横县\",\n 450202: \"城中区\",\n 450203: \"鱼峰区\",\n 450204: \"柳南区\",\n 450205: \"柳北区\",\n 450206: \"柳江区\",\n 450222: \"柳城县\",\n 450223: \"鹿寨县\",\n 450224: \"融安县\",\n 450225: \"融水苗族自治县\",\n 450226: \"三江侗族自治县\",\n 450302: \"秀峰区\",\n 450303: \"叠彩区\",\n 450304: \"象山区\",\n 450305: \"七星区\",\n 450311: \"雁山区\",\n 450312: \"临桂区\",\n 450321: \"阳朔县\",\n 450323: \"灵川县\",\n 450324: \"全州县\",\n 450325: \"兴安县\",\n 450326: \"永福县\",\n 450327: \"灌阳县\",\n 450328: \"龙胜各族自治县\",\n 450329: \"资源县\",\n 450330: \"平乐县\",\n 450332: \"恭城瑶族自治县\",\n 450381: \"荔浦市\",\n 450403: \"万秀区\",\n 450405: \"长洲区\",\n 450406: \"龙圩区\",\n 450421: \"苍梧县\",\n 450422: \"藤县\",\n 450423: \"蒙山县\",\n 450481: \"岑溪市\",\n 450502: \"海城区\",\n 450503: \"银海区\",\n 450512: \"铁山港区\",\n 450521: \"合浦县\",\n 450602: \"港口区\",\n 450603: \"防城区\",\n 450621: \"上思县\",\n 450681: \"东兴市\",\n 450702: \"钦南区\",\n 450703: \"钦北区\",\n 450721: \"灵山县\",\n 450722: \"浦北县\",\n 450802: \"港北区\",\n 450803: \"港南区\",\n 450804: \"覃塘区\",\n 450821: \"平南县\",\n 450881: \"桂平市\",\n 450902: \"玉州区\",\n 450903: \"福绵区\",\n 450921: \"容县\",\n 450922: \"陆川县\",\n 450923: \"博白县\",\n 450924: \"兴业县\",\n 450981: \"北流市\",\n 451002: \"右江区\",\n 451003: \"田阳区\",\n 451022: \"田东县\",\n 451024: \"德保县\",\n 451026: \"那坡县\",\n 451027: \"凌云县\",\n 451028: \"乐业县\",\n 451029: \"田林县\",\n 451030: \"西林县\",\n 451031: \"隆林各族自治县\",\n 451081: \"靖西市\",\n 451082: \"平果市\",\n 451102: \"八步区\",\n 451103: \"平桂区\",\n 451121: \"昭平县\",\n 451122: \"钟山县\",\n 451123: \"富川瑶族自治县\",\n 451202: \"金城江区\",\n 451203: \"宜州区\",\n 451221: \"南丹县\",\n 451222: \"天峨县\",\n 451223: \"凤山县\",\n 451224: \"东兰县\",\n 451225: \"罗城仫佬族自治县\",\n 451226: \"环江毛南族自治县\",\n 451227: \"巴马瑶族自治县\",\n 451228: \"都安瑶族自治县\",\n 451229: \"大化瑶族自治县\",\n 451302: \"兴宾区\",\n 451321: \"忻城县\",\n 451322: \"象州县\",\n 451323: \"武宣县\",\n 451324: \"金秀瑶族自治县\",\n 451381: \"合山市\",\n 451402: \"江州区\",\n 451421: \"扶绥县\",\n 451422: \"宁明县\",\n 451423: \"龙州县\",\n 451424: \"大新县\",\n 451425: \"天等县\",\n 451481: \"凭祥市\",\n 460105: \"秀英区\",\n 460106: \"龙华区\",\n 460107: \"琼山区\",\n 460108: \"美兰区\",\n 460202: \"海棠区\",\n 460203: \"吉阳区\",\n 460204: \"天涯区\",\n 460205: \"崖州区\",\n 460321: \"西沙区\",\n 460322: \"南沙区\",\n 460401: \"那大镇\",\n 460402: \"和庆镇\",\n 460403: \"南丰镇\",\n 460404: \"大成镇\",\n 460405: \"雅星镇\",\n 460406: \"兰洋镇\",\n 460407: \"光村镇\",\n 460408: \"木棠镇\",\n 460409: \"海头镇\",\n 460410: \"峨蔓镇\",\n 460411: \"王五镇\",\n 460412: \"白马井镇\",\n 460413: \"中和镇\",\n 460414: \"排浦镇\",\n 460415: \"东成镇\",\n 460416: \"新州镇\",\n 460417: \"洋浦经济开发区\",\n 460418: \"华南热作学院\",\n 469001: \"五指山市\",\n 469002: \"琼海市\",\n 469005: \"文昌市\",\n 469006: \"万宁市\",\n 469007: \"东方市\",\n 469021: \"定安县\",\n 469022: \"屯昌县\",\n 469023: \"澄迈县\",\n 469024: \"临高县\",\n 469025: \"白沙黎族自治县\",\n 469026: \"昌江黎族自治县\",\n 469027: \"乐东黎族自治县\",\n 469028: \"陵水黎族自治县\",\n 469029: \"保亭黎族苗族自治县\",\n 469030: \"琼中黎族苗族自治县\",\n 500101: \"万州区\",\n 500102: \"涪陵区\",\n 500103: \"渝中区\",\n 500104: \"大渡口区\",\n 500105: \"江北区\",\n 500106: \"沙坪坝区\",\n 500107: \"九龙坡区\",\n 500108: \"南岸区\",\n 500109: \"北碚区\",\n 500110: \"綦江区\",\n 500111: \"大足区\",\n 500112: \"渝北区\",\n 500113: \"巴南区\",\n 500114: \"黔江区\",\n 500115: \"长寿区\",\n 500116: \"江津区\",\n 500117: \"合川区\",\n 500118: \"永川区\",\n 500119: \"南川区\",\n 500120: \"璧山区\",\n 500151: \"铜梁区\",\n 500152: \"潼南区\",\n 500153: \"荣昌区\",\n 500154: \"开州区\",\n 500155: \"梁平区\",\n 500156: \"武隆区\",\n 500229: \"城口县\",\n 500230: \"丰都县\",\n 500231: \"垫江县\",\n 500233: \"忠县\",\n 500235: \"云阳县\",\n 500236: \"奉节县\",\n 500237: \"巫山县\",\n 500238: \"巫溪县\",\n 500240: \"石柱土家族自治县\",\n 500241: \"秀山土家族苗族自治县\",\n 500242: \"酉阳土家族苗族自治县\",\n 500243: \"彭水苗族土家族自治县\",\n 510104: \"锦江区\",\n 510105: \"青羊区\",\n 510106: \"金牛区\",\n 510107: \"武侯区\",\n 510108: \"成华区\",\n 510112: \"龙泉驿区\",\n 510113: \"青白江区\",\n 510114: \"新都区\",\n 510115: \"温江区\",\n 510116: \"双流区\",\n 510117: \"郫都区\",\n 510121: \"金堂县\",\n 510129: \"大邑县\",\n 510131: \"蒲江县\",\n 510132: \"新津县\",\n 510181: \"都江堰市\",\n 510182: \"彭州市\",\n 510183: \"邛崃市\",\n 510184: \"崇州市\",\n 510185: \"简阳市\",\n 510191: \"高新区\",\n 510302: \"自流井区\",\n 510303: \"贡井区\",\n 510304: \"大安区\",\n 510311: \"沿滩区\",\n 510321: \"荣县\",\n 510322: \"富顺县\",\n 510402: \"东区\",\n 510403: \"西区\",\n 510411: \"仁和区\",\n 510421: \"米易县\",\n 510422: \"盐边县\",\n 510502: \"江阳区\",\n 510503: \"纳溪区\",\n 510504: \"龙马潭区\",\n 510521: \"泸县\",\n 510522: \"合江县\",\n 510524: \"叙永县\",\n 510525: \"古蔺县\",\n 510603: \"旌阳区\",\n 510604: \"罗江区\",\n 510623: \"中江县\",\n 510681: \"广汉市\",\n 510682: \"什邡市\",\n 510683: \"绵竹市\",\n 510703: \"涪城区\",\n 510704: \"游仙区\",\n 510705: \"安州区\",\n 510722: \"三台县\",\n 510723: \"盐亭县\",\n 510725: \"梓潼县\",\n 510726: \"北川羌族自治县\",\n 510727: \"平武县\",\n 510781: \"江油市\",\n 510791: \"高新区\",\n 510802: \"利州区\",\n 510811: \"昭化区\",\n 510812: \"朝天区\",\n 510821: \"旺苍县\",\n 510822: \"青川县\",\n 510823: \"剑阁县\",\n 510824: \"苍溪县\",\n 510903: \"船山区\",\n 510904: \"安居区\",\n 510921: \"蓬溪县\",\n 510923: \"大英县\",\n 510981: \"射洪市\",\n 511002: \"市中区\",\n 511011: \"东兴区\",\n 511024: \"威远县\",\n 511025: \"资中县\",\n 511083: \"隆昌市\",\n 511102: \"市中区\",\n 511111: \"沙湾区\",\n 511112: \"五通桥区\",\n 511113: \"金口河区\",\n 511123: \"犍为县\",\n 511124: \"井研县\",\n 511126: \"夹江县\",\n 511129: \"沐川县\",\n 511132: \"峨边彝族自治县\",\n 511133: \"马边彝族自治县\",\n 511181: \"峨眉山市\",\n 511302: \"顺庆区\",\n 511303: \"高坪区\",\n 511304: \"嘉陵区\",\n 511321: \"南部县\",\n 511322: \"营山县\",\n 511323: \"蓬安县\",\n 511324: \"仪陇县\",\n 511325: \"西充县\",\n 511381: \"阆中市\",\n 511402: \"东坡区\",\n 511403: \"彭山区\",\n 511421: \"仁寿县\",\n 511423: \"洪雅县\",\n 511424: \"丹棱县\",\n 511425: \"青神县\",\n 511502: \"翠屏区\",\n 511503: \"南溪区\",\n 511504: \"叙州区\",\n 511523: \"江安县\",\n 511524: \"长宁县\",\n 511525: \"高县\",\n 511526: \"珙县\",\n 511527: \"筠连县\",\n 511528: \"兴文县\",\n 511529: \"屏山县\",\n 511602: \"广安区\",\n 511603: \"前锋区\",\n 511621: \"岳池县\",\n 511622: \"武胜县\",\n 511623: \"邻水县\",\n 511681: \"华蓥市\",\n 511702: \"通川区\",\n 511703: \"达川区\",\n 511722: \"宣汉县\",\n 511723: \"开江县\",\n 511724: \"大竹县\",\n 511725: \"渠县\",\n 511781: \"万源市\",\n 511802: \"雨城区\",\n 511803: \"名山区\",\n 511822: \"荥经县\",\n 511823: \"汉源县\",\n 511824: \"石棉县\",\n 511825: \"天全县\",\n 511826: \"芦山县\",\n 511827: \"宝兴县\",\n 511902: \"巴州区\",\n 511903: \"恩阳区\",\n 511921: \"通江县\",\n 511922: \"南江县\",\n 511923: \"平昌县\",\n 511971: \"巴中经济开发区\",\n 512002: \"雁江区\",\n 512021: \"安岳县\",\n 512022: \"乐至县\",\n 513201: \"马尔康市\",\n 513221: \"汶川县\",\n 513222: \"理县\",\n 513223: \"茂县\",\n 513224: \"松潘县\",\n 513225: \"九寨沟县\",\n 513226: \"金川县\",\n 513227: \"小金县\",\n 513228: \"黑水县\",\n 513230: \"壤塘县\",\n 513231: \"阿坝县\",\n 513232: \"若尔盖县\",\n 513233: \"红原县\",\n 513301: \"康定市\",\n 513322: \"泸定县\",\n 513323: \"丹巴县\",\n 513324: \"九龙县\",\n 513325: \"雅江县\",\n 513326: \"道孚县\",\n 513327: \"炉霍县\",\n 513328: \"甘孜县\",\n 513329: \"新龙县\",\n 513330: \"德格县\",\n 513331: \"白玉县\",\n 513332: \"石渠县\",\n 513333: \"色达县\",\n 513334: \"理塘县\",\n 513335: \"巴塘县\",\n 513336: \"乡城县\",\n 513337: \"稻城县\",\n 513338: \"得荣县\",\n 513401: \"西昌市\",\n 513422: \"木里藏族自治县\",\n 513423: \"盐源县\",\n 513424: \"德昌县\",\n 513425: \"会理县\",\n 513426: \"会东县\",\n 513427: \"宁南县\",\n 513428: \"普格县\",\n 513429: \"布拖县\",\n 513430: \"金阳县\",\n 513431: \"昭觉县\",\n 513432: \"喜德县\",\n 513433: \"冕宁县\",\n 513434: \"越西县\",\n 513435: \"甘洛县\",\n 513436: \"美姑县\",\n 513437: \"雷波县\",\n 520102: \"南明区\",\n 520103: \"云岩区\",\n 520111: \"花溪区\",\n 520112: \"乌当区\",\n 520113: \"白云区\",\n 520115: \"观山湖区\",\n 520121: \"开阳县\",\n 520122: \"息烽县\",\n 520123: \"修文县\",\n 520181: \"清镇市\",\n 520201: \"钟山区\",\n 520203: \"六枝特区\",\n 520221: \"水城县\",\n 520281: \"盘州市\",\n 520302: \"红花岗区\",\n 520303: \"汇川区\",\n 520304: \"播州区\",\n 520322: \"桐梓县\",\n 520323: \"绥阳县\",\n 520324: \"正安县\",\n 520325: \"道真仡佬族苗族自治县\",\n 520326: \"务川仡佬族苗族自治县\",\n 520327: \"凤冈县\",\n 520328: \"湄潭县\",\n 520329: \"余庆县\",\n 520330: \"习水县\",\n 520381: \"赤水市\",\n 520382: \"仁怀市\",\n 520402: \"西秀区\",\n 520403: \"平坝区\",\n 520422: \"普定县\",\n 520423: \"镇宁布依族苗族自治县\",\n 520424: \"关岭布依族苗族自治县\",\n 520425: \"紫云苗族布依族自治县\",\n 520502: \"七星关区\",\n 520521: \"大方县\",\n 520522: \"黔西县\",\n 520523: \"金沙县\",\n 520524: \"织金县\",\n 520525: \"纳雍县\",\n 520526: \"威宁彝族回族苗族自治县\",\n 520527: \"赫章县\",\n 520602: \"碧江区\",\n 520603: \"万山区\",\n 520621: \"江口县\",\n 520622: \"玉屏侗族自治县\",\n 520623: \"石阡县\",\n 520624: \"思南县\",\n 520625: \"印江土家族苗族自治县\",\n 520626: \"德江县\",\n 520627: \"沿河土家族自治县\",\n 520628: \"松桃苗族自治县\",\n 522301: \"兴义市\",\n 522302: \"兴仁市\",\n 522323: \"普安县\",\n 522324: \"晴隆县\",\n 522325: \"贞丰县\",\n 522326: \"望谟县\",\n 522327: \"册亨县\",\n 522328: \"安龙县\",\n 522601: \"凯里市\",\n 522622: \"黄平县\",\n 522623: \"施秉县\",\n 522624: \"三穗县\",\n 522625: \"镇远县\",\n 522626: \"岑巩县\",\n 522627: \"天柱县\",\n 522628: \"锦屏县\",\n 522629: \"剑河县\",\n 522630: \"台江县\",\n 522631: \"黎平县\",\n 522632: \"榕江县\",\n 522633: \"从江县\",\n 522634: \"雷山县\",\n 522635: \"麻江县\",\n 522636: \"丹寨县\",\n 522701: \"都匀市\",\n 522702: \"福泉市\",\n 522722: \"荔波县\",\n 522723: \"贵定县\",\n 522725: \"瓮安县\",\n 522726: \"独山县\",\n 522727: \"平塘县\",\n 522728: \"罗甸县\",\n 522729: \"长顺县\",\n 522730: \"龙里县\",\n 522731: \"惠水县\",\n 522732: \"三都水族自治县\",\n 530102: \"五华区\",\n 530103: \"盘龙区\",\n 530111: \"官渡区\",\n 530112: \"西山区\",\n 530113: \"东川区\",\n 530114: \"呈贡区\",\n 530115: \"晋宁区\",\n 530124: \"富民县\",\n 530125: \"宜良县\",\n 530126: \"石林彝族自治县\",\n 530127: \"嵩明县\",\n 530128: \"禄劝彝族苗族自治县\",\n 530129: \"寻甸回族彝族自治县\",\n 530181: \"安宁市\",\n 530302: \"麒麟区\",\n 530303: \"沾益区\",\n 530304: \"马龙区\",\n 530322: \"陆良县\",\n 530323: \"师宗县\",\n 530324: \"罗平县\",\n 530325: \"富源县\",\n 530326: \"会泽县\",\n 530381: \"宣威市\",\n 530402: \"红塔区\",\n 530403: \"江川区\",\n 530423: \"通海县\",\n 530424: \"华宁县\",\n 530425: \"易门县\",\n 530426: \"峨山彝族自治县\",\n 530427: \"新平彝族傣族自治县\",\n 530428: \"元江哈尼族彝族傣族自治县\",\n 530481: \"澄江市\",\n 530502: \"隆阳区\",\n 530521: \"施甸县\",\n 530523: \"龙陵县\",\n 530524: \"昌宁县\",\n 530581: \"腾冲市\",\n 530602: \"昭阳区\",\n 530621: \"鲁甸县\",\n 530622: \"巧家县\",\n 530623: \"盐津县\",\n 530624: \"大关县\",\n 530625: \"永善县\",\n 530626: \"绥江县\",\n 530627: \"镇雄县\",\n 530628: \"彝良县\",\n 530629: \"威信县\",\n 530681: \"水富市\",\n 530702: \"古城区\",\n 530721: \"玉龙纳西族自治县\",\n 530722: \"永胜县\",\n 530723: \"华坪县\",\n 530724: \"宁蒗彝族自治县\",\n 530802: \"思茅区\",\n 530821: \"宁洱哈尼族彝族自治县\",\n 530822: \"墨江哈尼族自治县\",\n 530823: \"景东彝族自治县\",\n 530824: \"景谷傣族彝族自治县\",\n 530825: \"镇沅彝族哈尼族拉祜族自治县\",\n 530826: \"江城哈尼族彝族自治县\",\n 530827: \"孟连傣族拉祜族佤族自治县\",\n 530828: \"澜沧拉祜族自治县\",\n 530829: \"西盟佤族自治县\",\n 530902: \"临翔区\",\n 530921: \"凤庆县\",\n 530922: \"云县\",\n 530923: \"永德县\",\n 530924: \"镇康县\",\n 530925: \"双江拉祜族佤族布朗族傣族自治县\",\n 530926: \"耿马傣族佤族自治县\",\n 530927: \"沧源佤族自治县\",\n 532301: \"楚雄市\",\n 532322: \"双柏县\",\n 532323: \"牟定县\",\n 532324: \"南华县\",\n 532325: \"姚安县\",\n 532326: \"大姚县\",\n 532327: \"永仁县\",\n 532328: \"元谋县\",\n 532329: \"武定县\",\n 532331: \"禄丰县\",\n 532501: \"个旧市\",\n 532502: \"开远市\",\n 532503: \"蒙自市\",\n 532504: \"弥勒市\",\n 532523: \"屏边苗族自治县\",\n 532524: \"建水县\",\n 532525: \"石屏县\",\n 532527: \"泸西县\",\n 532528: \"元阳县\",\n 532529: \"红河县\",\n 532530: \"金平苗族瑶族傣族自治县\",\n 532531: \"绿春县\",\n 532532: \"河口瑶族自治县\",\n 532601: \"文山市\",\n 532622: \"砚山县\",\n 532623: \"西畴县\",\n 532624: \"麻栗坡县\",\n 532625: \"马关县\",\n 532626: \"丘北县\",\n 532627: \"广南县\",\n 532628: \"富宁县\",\n 532801: \"景洪市\",\n 532822: \"勐海县\",\n 532823: \"勐腊县\",\n 532901: \"大理市\",\n 532922: \"漾濞彝族自治县\",\n 532923: \"祥云县\",\n 532924: \"宾川县\",\n 532925: \"弥渡县\",\n 532926: \"南涧彝族自治县\",\n 532927: \"巍山彝族回族自治县\",\n 532928: \"永平县\",\n 532929: \"云龙县\",\n 532930: \"洱源县\",\n 532931: \"剑川县\",\n 532932: \"鹤庆县\",\n 533102: \"瑞丽市\",\n 533103: \"芒市\",\n 533122: \"梁河县\",\n 533123: \"盈江县\",\n 533124: \"陇川县\",\n 533301: \"泸水市\",\n 533323: \"福贡县\",\n 533324: \"贡山独龙族怒族自治县\",\n 533325: \"兰坪白族普米族自治县\",\n 533401: \"香格里拉市\",\n 533422: \"德钦县\",\n 533423: \"维西傈僳族自治县\",\n 540102: \"城关区\",\n 540103: \"堆龙德庆区\",\n 540104: \"达孜区\",\n 540121: \"林周县\",\n 540122: \"当雄县\",\n 540123: \"尼木县\",\n 540124: \"曲水县\",\n 540127: \"墨竹工卡县\",\n 540202: \"桑珠孜区\",\n 540221: \"南木林县\",\n 540222: \"江孜县\",\n 540223: \"定日县\",\n 540224: \"萨迦县\",\n 540225: \"拉孜县\",\n 540226: \"昂仁县\",\n 540227: \"谢通门县\",\n 540228: \"白朗县\",\n 540229: \"仁布县\",\n 540230: \"康马县\",\n 540231: \"定结县\",\n 540232: \"仲巴县\",\n 540233: \"亚东县\",\n 540234: \"吉隆县\",\n 540235: \"聂拉木县\",\n 540236: \"萨嘎县\",\n 540237: \"岗巴县\",\n 540302: \"卡若区\",\n 540321: \"江达县\",\n 540322: \"贡觉县\",\n 540323: \"类乌齐县\",\n 540324: \"丁青县\",\n 540325: \"察雅县\",\n 540326: \"八宿县\",\n 540327: \"左贡县\",\n 540328: \"芒康县\",\n 540329: \"洛隆县\",\n 540330: \"边坝县\",\n 540402: \"巴宜区\",\n 540421: \"工布江达县\",\n 540422: \"米林县\",\n 540423: \"墨脱县\",\n 540424: \"波密县\",\n 540425: \"察隅县\",\n 540426: \"朗县\",\n 540502: \"乃东区\",\n 540521: \"扎囊县\",\n 540522: \"贡嘎县\",\n 540523: \"桑日县\",\n 540524: \"琼结县\",\n 540525: \"曲松县\",\n 540526: \"措美县\",\n 540527: \"洛扎县\",\n 540528: \"加查县\",\n 540529: \"隆子县\",\n 540530: \"错那县\",\n 540531: \"浪卡子县\",\n 540602: \"色尼区\",\n 540621: \"嘉黎县\",\n 540622: \"比如县\",\n 540623: \"聂荣县\",\n 540624: \"安多县\",\n 540625: \"申扎县\",\n 540626: \"索县\",\n 540627: \"班戈县\",\n 540628: \"巴青县\",\n 540629: \"尼玛县\",\n 540630: \"双湖县\",\n 542521: \"普兰县\",\n 542522: \"札达县\",\n 542523: \"噶尔县\",\n 542524: \"日土县\",\n 542525: \"革吉县\",\n 542526: \"改则县\",\n 542527: \"措勤县\",\n 610102: \"新城区\",\n 610103: \"碑林区\",\n 610104: \"莲湖区\",\n 610111: \"灞桥区\",\n 610112: \"未央区\",\n 610113: \"雁塔区\",\n 610114: \"阎良区\",\n 610115: \"临潼区\",\n 610116: \"长安区\",\n 610117: \"高陵区\",\n 610118: \"鄠邑区\",\n 610122: \"蓝田县\",\n 610124: \"周至县\",\n 610202: \"王益区\",\n 610203: \"印台区\",\n 610204: \"耀州区\",\n 610222: \"宜君县\",\n 610302: \"渭滨区\",\n 610303: \"金台区\",\n 610304: \"陈仓区\",\n 610322: \"凤翔县\",\n 610323: \"岐山县\",\n 610324: \"扶风县\",\n 610326: \"眉县\",\n 610327: \"陇县\",\n 610328: \"千阳县\",\n 610329: \"麟游县\",\n 610330: \"凤县\",\n 610331: \"太白县\",\n 610402: \"秦都区\",\n 610403: \"杨陵区\",\n 610404: \"渭城区\",\n 610422: \"三原县\",\n 610423: \"泾阳县\",\n 610424: \"乾县\",\n 610425: \"礼泉县\",\n 610426: \"永寿县\",\n 610428: \"长武县\",\n 610429: \"旬邑县\",\n 610430: \"淳化县\",\n 610431: \"武功县\",\n 610481: \"兴平市\",\n 610482: \"彬州市\",\n 610502: \"临渭区\",\n 610503: \"华州区\",\n 610522: \"潼关县\",\n 610523: \"大荔县\",\n 610524: \"合阳县\",\n 610525: \"澄城县\",\n 610526: \"蒲城县\",\n 610527: \"白水县\",\n 610528: \"富平县\",\n 610581: \"韩城市\",\n 610582: \"华阴市\",\n 610602: \"宝塔区\",\n 610603: \"安塞区\",\n 610621: \"延长县\",\n 610622: \"延川县\",\n 610625: \"志丹县\",\n 610626: \"吴起县\",\n 610627: \"甘泉县\",\n 610628: \"富县\",\n 610629: \"洛川县\",\n 610630: \"宜川县\",\n 610631: \"黄龙县\",\n 610632: \"黄陵县\",\n 610681: \"子长市\",\n 610702: \"汉台区\",\n 610703: \"南郑区\",\n 610722: \"城固县\",\n 610723: \"洋县\",\n 610724: \"西乡县\",\n 610725: \"勉县\",\n 610726: \"宁强县\",\n 610727: \"略阳县\",\n 610728: \"镇巴县\",\n 610729: \"留坝县\",\n 610730: \"佛坪县\",\n 610802: \"榆阳区\",\n 610803: \"横山区\",\n 610822: \"府谷县\",\n 610824: \"靖边县\",\n 610825: \"定边县\",\n 610826: \"绥德县\",\n 610827: \"米脂县\",\n 610828: \"佳县\",\n 610829: \"吴堡县\",\n 610830: \"清涧县\",\n 610831: \"子洲县\",\n 610881: \"神木市\",\n 610902: \"汉滨区\",\n 610921: \"汉阴县\",\n 610922: \"石泉县\",\n 610923: \"宁陕县\",\n 610924: \"紫阳县\",\n 610925: \"岚皋县\",\n 610926: \"平利县\",\n 610927: \"镇坪县\",\n 610928: \"旬阳县\",\n 610929: \"白河县\",\n 611002: \"商州区\",\n 611021: \"洛南县\",\n 611022: \"丹凤县\",\n 611023: \"商南县\",\n 611024: \"山阳县\",\n 611025: \"镇安县\",\n 611026: \"柞水县\",\n 620102: \"城关区\",\n 620103: \"七里河区\",\n 620104: \"西固区\",\n 620105: \"安宁区\",\n 620111: \"红古区\",\n 620121: \"永登县\",\n 620122: \"皋兰县\",\n 620123: \"榆中县\",\n 620171: \"兰州新区\",\n 620201: \"市辖区\",\n 620290: \"雄关区\",\n 620291: \"长城区\",\n 620292: \"镜铁区\",\n 620293: \"新城镇\",\n 620294: \"峪泉镇\",\n 620295: \"文殊镇\",\n 620302: \"金川区\",\n 620321: \"永昌县\",\n 620402: \"白银区\",\n 620403: \"平川区\",\n 620421: \"靖远县\",\n 620422: \"会宁县\",\n 620423: \"景泰县\",\n 620502: \"秦州区\",\n 620503: \"麦积区\",\n 620521: \"清水县\",\n 620522: \"秦安县\",\n 620523: \"甘谷县\",\n 620524: \"武山县\",\n 620525: \"张家川回族自治县\",\n 620602: \"凉州区\",\n 620621: \"民勤县\",\n 620622: \"古浪县\",\n 620623: \"天祝藏族自治县\",\n 620702: \"甘州区\",\n 620721: \"肃南裕固族自治县\",\n 620722: \"民乐县\",\n 620723: \"临泽县\",\n 620724: \"高台县\",\n 620725: \"山丹县\",\n 620802: \"崆峒区\",\n 620821: \"泾川县\",\n 620822: \"灵台县\",\n 620823: \"崇信县\",\n 620825: \"庄浪县\",\n 620826: \"静宁县\",\n 620881: \"华亭市\",\n 620902: \"肃州区\",\n 620921: \"金塔县\",\n 620922: \"瓜州县\",\n 620923: \"肃北蒙古族自治县\",\n 620924: \"阿克塞哈萨克族自治县\",\n 620981: \"玉门市\",\n 620982: \"敦煌市\",\n 621002: \"西峰区\",\n 621021: \"庆城县\",\n 621022: \"环县\",\n 621023: \"华池县\",\n 621024: \"合水县\",\n 621025: \"正宁县\",\n 621026: \"宁县\",\n 621027: \"镇原县\",\n 621102: \"安定区\",\n 621121: \"通渭县\",\n 621122: \"陇西县\",\n 621123: \"渭源县\",\n 621124: \"临洮县\",\n 621125: \"漳县\",\n 621126: \"岷县\",\n 621202: \"武都区\",\n 621221: \"成县\",\n 621222: \"文县\",\n 621223: \"宕昌县\",\n 621224: \"康县\",\n 621225: \"西和县\",\n 621226: \"礼县\",\n 621227: \"徽县\",\n 621228: \"两当县\",\n 622901: \"临夏市\",\n 622921: \"临夏县\",\n 622922: \"康乐县\",\n 622923: \"永靖县\",\n 622924: \"广河县\",\n 622925: \"和政县\",\n 622926: \"东乡族自治县\",\n 622927: \"积石山保安族东乡族撒拉族自治县\",\n 623001: \"合作市\",\n 623021: \"临潭县\",\n 623022: \"卓尼县\",\n 623023: \"舟曲县\",\n 623024: \"迭部县\",\n 623025: \"玛曲县\",\n 623026: \"碌曲县\",\n 623027: \"夏河县\",\n 630102: \"城东区\",\n 630103: \"城中区\",\n 630104: \"城西区\",\n 630105: \"城北区\",\n 630106: \"湟中区\",\n 630121: \"大通回族土族自治县\",\n 630123: \"湟源县\",\n 630202: \"乐都区\",\n 630203: \"平安区\",\n 630222: \"民和回族土族自治县\",\n 630223: \"互助土族自治县\",\n 630224: \"化隆回族自治县\",\n 630225: \"循化撒拉族自治县\",\n 632221: \"门源回族自治县\",\n 632222: \"祁连县\",\n 632223: \"海晏县\",\n 632224: \"刚察县\",\n 632321: \"同仁县\",\n 632322: \"尖扎县\",\n 632323: \"泽库县\",\n 632324: \"河南蒙古族自治县\",\n 632521: \"共和县\",\n 632522: \"同德县\",\n 632523: \"贵德县\",\n 632524: \"兴海县\",\n 632525: \"贵南县\",\n 632621: \"玛沁县\",\n 632622: \"班玛县\",\n 632623: \"甘德县\",\n 632624: \"达日县\",\n 632625: \"久治县\",\n 632626: \"玛多县\",\n 632701: \"玉树市\",\n 632722: \"杂多县\",\n 632723: \"称多县\",\n 632724: \"治多县\",\n 632725: \"囊谦县\",\n 632726: \"曲麻莱县\",\n 632801: \"格尔木市\",\n 632802: \"德令哈市\",\n 632803: \"茫崖市\",\n 632821: \"乌兰县\",\n 632822: \"都兰县\",\n 632823: \"天峻县\",\n 632857: \"大柴旦行政委员会\",\n 640104: \"兴庆区\",\n 640105: \"西夏区\",\n 640106: \"金凤区\",\n 640121: \"永宁县\",\n 640122: \"贺兰县\",\n 640181: \"灵武市\",\n 640202: \"大武口区\",\n 640205: \"惠农区\",\n 640221: \"平罗县\",\n 640302: \"利通区\",\n 640303: \"红寺堡区\",\n 640323: \"盐池县\",\n 640324: \"同心县\",\n 640381: \"青铜峡市\",\n 640402: \"原州区\",\n 640422: \"西吉县\",\n 640423: \"隆德县\",\n 640424: \"泾源县\",\n 640425: \"彭阳县\",\n 640502: \"沙坡头区\",\n 640521: \"中宁县\",\n 640522: \"海原县\",\n 650102: \"天山区\",\n 650103: \"沙依巴克区\",\n 650104: \"新市区\",\n 650105: \"水磨沟区\",\n 650106: \"头屯河区\",\n 650107: \"达坂城区\",\n 650109: \"米东区\",\n 650121: \"乌鲁木齐县\",\n 650202: \"独山子区\",\n 650203: \"克拉玛依区\",\n 650204: \"白碱滩区\",\n 650205: \"乌尔禾区\",\n 650402: \"高昌区\",\n 650421: \"鄯善县\",\n 650422: \"托克逊县\",\n 650502: \"伊州区\",\n 650521: \"巴里坤哈萨克自治县\",\n 650522: \"伊吾县\",\n 652301: \"昌吉市\",\n 652302: \"阜康市\",\n 652323: \"呼图壁县\",\n 652324: \"玛纳斯县\",\n 652325: \"奇台县\",\n 652327: \"吉木萨尔县\",\n 652328: \"木垒哈萨克自治县\",\n 652701: \"博乐市\",\n 652702: \"阿拉山口市\",\n 652722: \"精河县\",\n 652723: \"温泉县\",\n 652801: \"库尔勒市\",\n 652822: \"轮台县\",\n 652823: \"尉犁县\",\n 652824: \"若羌县\",\n 652825: \"且末县\",\n 652826: \"焉耆回族自治县\",\n 652827: \"和静县\",\n 652828: \"和硕县\",\n 652829: \"博湖县\",\n 652901: \"阿克苏市\",\n 652902: \"库车市\",\n 652922: \"温宿县\",\n 652924: \"沙雅县\",\n 652925: \"新和县\",\n 652926: \"拜城县\",\n 652927: \"乌什县\",\n 652928: \"阿瓦提县\",\n 652929: \"柯坪县\",\n 653001: \"阿图什市\",\n 653022: \"阿克陶县\",\n 653023: \"阿合奇县\",\n 653024: \"乌恰县\",\n 653101: \"喀什市\",\n 653121: \"疏附县\",\n 653122: \"疏勒县\",\n 653123: \"英吉沙县\",\n 653124: \"泽普县\",\n 653125: \"莎车县\",\n 653126: \"叶城县\",\n 653127: \"麦盖提县\",\n 653128: \"岳普湖县\",\n 653129: \"伽师县\",\n 653130: \"巴楚县\",\n 653131: \"塔什库尔干塔吉克自治县\",\n 653201: \"和田市\",\n 653221: \"和田县\",\n 653222: \"墨玉县\",\n 653223: \"皮山县\",\n 653224: \"洛浦县\",\n 653225: \"策勒县\",\n 653226: \"于田县\",\n 653227: \"民丰县\",\n 654002: \"伊宁市\",\n 654003: \"奎屯市\",\n 654004: \"霍尔果斯市\",\n 654021: \"伊宁县\",\n 654022: \"察布查尔锡伯自治县\",\n 654023: \"霍城县\",\n 654024: \"巩留县\",\n 654025: \"新源县\",\n 654026: \"昭苏县\",\n 654027: \"特克斯县\",\n 654028: \"尼勒克县\",\n 654201: \"塔城市\",\n 654202: \"乌苏市\",\n 654221: \"额敏县\",\n 654223: \"沙湾县\",\n 654224: \"托里县\",\n 654225: \"裕民县\",\n 654226: \"和布克赛尔蒙古自治县\",\n 654301: \"阿勒泰市\",\n 654321: \"布尔津县\",\n 654322: \"富蕴县\",\n 654323: \"福海县\",\n 654324: \"哈巴河县\",\n 654325: \"青河县\",\n 654326: \"吉木乃县\",\n 659001: \"石河子市\",\n 659002: \"阿拉尔市\",\n 659003: \"图木舒克市\",\n 659004: \"五家渠市\",\n 659005: \"北屯市\",\n 659006: \"铁门关市\",\n 659007: \"双河市\",\n 659008: \"可克达拉市\",\n 659009: \"昆玉市\",\n 659010: \"胡杨河市\",\n 710101: \"中正区\",\n 710102: \"大同区\",\n 710103: \"中山区\",\n 710104: \"松山区\",\n 710105: \"大安区\",\n 710106: \"万华区\",\n 710107: \"信义区\",\n 710108: \"士林区\",\n 710109: \"北投区\",\n 710110: \"内湖区\",\n 710111: \"南港区\",\n 710112: \"文山区\",\n 710199: \"其它区\",\n 710201: \"新兴区\",\n 710202: \"前金区\",\n 710203: \"芩雅区\",\n 710204: \"盐埕区\",\n 710205: \"鼓山区\",\n 710206: \"旗津区\",\n 710207: \"前镇区\",\n 710208: \"三民区\",\n 710209: \"左营区\",\n 710210: \"楠梓区\",\n 710211: \"小港区\",\n 710241: \"苓雅区\",\n 710242: \"仁武区\",\n 710243: \"大社区\",\n 710244: \"冈山区\",\n 710245: \"路竹区\",\n 710246: \"阿莲区\",\n 710247: \"田寮区\",\n 710248: \"燕巢区\",\n 710249: \"桥头区\",\n 710250: \"梓官区\",\n 710251: \"弥陀区\",\n 710252: \"永安区\",\n 710253: \"湖内区\",\n 710254: \"凤山区\",\n 710255: \"大寮区\",\n 710256: \"林园区\",\n 710257: \"鸟松区\",\n 710258: \"大树区\",\n 710259: \"旗山区\",\n 710260: \"美浓区\",\n 710261: \"六龟区\",\n 710262: \"内门区\",\n 710263: \"杉林区\",\n 710264: \"甲仙区\",\n 710265: \"桃源区\",\n 710266: \"那玛夏区\",\n 710267: \"茂林区\",\n 710268: \"茄萣区\",\n 710299: \"其它区\",\n 710301: \"中西区\",\n 710302: \"东区\",\n 710303: \"南区\",\n 710304: \"北区\",\n 710305: \"安平区\",\n 710306: \"安南区\",\n 710339: \"永康区\",\n 710340: \"归仁区\",\n 710341: \"新化区\",\n 710342: \"左镇区\",\n 710343: \"玉井区\",\n 710344: \"楠西区\",\n 710345: \"南化区\",\n 710346: \"仁德区\",\n 710347: \"关庙区\",\n 710348: \"龙崎区\",\n 710349: \"官田区\",\n 710350: \"麻豆区\",\n 710351: \"佳里区\",\n 710352: \"西港区\",\n 710353: \"七股区\",\n 710354: \"将军区\",\n 710355: \"学甲区\",\n 710356: \"北门区\",\n 710357: \"新营区\",\n 710358: \"后壁区\",\n 710359: \"白河区\",\n 710360: \"东山区\",\n 710361: \"六甲区\",\n 710362: \"下营区\",\n 710363: \"柳营区\",\n 710364: \"盐水区\",\n 710365: \"善化区\",\n 710366: \"大内区\",\n 710367: \"山上区\",\n 710368: \"新市区\",\n 710369: \"安定区\",\n 710399: \"其它区\",\n 710401: \"中区\",\n 710402: \"东区\",\n 710403: \"南区\",\n 710404: \"西区\",\n 710405: \"北区\",\n 710406: \"北屯区\",\n 710407: \"西屯区\",\n 710408: \"南屯区\",\n 710431: \"太平区\",\n 710432: \"大里区\",\n 710433: \"雾峰区\",\n 710434: \"乌日区\",\n 710435: \"丰原区\",\n 710436: \"后里区\",\n 710437: \"石冈区\",\n 710438: \"东势区\",\n 710439: \"和平区\",\n 710440: \"新社区\",\n 710441: \"潭子区\",\n 710442: \"大雅区\",\n 710443: \"神冈区\",\n 710444: \"大肚区\",\n 710445: \"沙鹿区\",\n 710446: \"龙井区\",\n 710447: \"梧栖区\",\n 710448: \"清水区\",\n 710449: \"大甲区\",\n 710450: \"外埔区\",\n 710451: \"大安区\",\n 710499: \"其它区\",\n 710507: \"金沙镇\",\n 710508: \"金湖镇\",\n 710509: \"金宁乡\",\n 710510: \"金城镇\",\n 710511: \"烈屿乡\",\n 710512: \"乌坵乡\",\n 710614: \"南投市\",\n 710615: \"中寮乡\",\n 710616: \"草屯镇\",\n 710617: \"国姓乡\",\n 710618: \"埔里镇\",\n 710619: \"仁爱乡\",\n 710620: \"名间乡\",\n 710621: \"集集镇\",\n 710622: \"水里乡\",\n 710623: \"鱼池乡\",\n 710624: \"信义乡\",\n 710625: \"竹山镇\",\n 710626: \"鹿谷乡\",\n 710701: \"仁爱区\",\n 710702: \"信义区\",\n 710703: \"中正区\",\n 710704: \"中山区\",\n 710705: \"安乐区\",\n 710706: \"暖暖区\",\n 710707: \"七堵区\",\n 710799: \"其它区\",\n 710801: \"东区\",\n 710802: \"北区\",\n 710803: \"香山区\",\n 710899: \"其它区\",\n 710901: \"东区\",\n 710902: \"西区\",\n 710999: \"其它区\",\n 711130: \"万里区\",\n 711132: \"板桥区\",\n 711133: \"汐止区\",\n 711134: \"深坑区\",\n 711135: \"石碇区\",\n 711136: \"瑞芳区\",\n 711137: \"平溪区\",\n 711138: \"双溪区\",\n 711139: \"贡寮区\",\n 711140: \"新店区\",\n 711141: \"坪林区\",\n 711142: \"乌来区\",\n 711143: \"永和区\",\n 711144: \"中和区\",\n 711145: \"土城区\",\n 711146: \"三峡区\",\n 711147: \"树林区\",\n 711148: \"莺歌区\",\n 711149: \"三重区\",\n 711150: \"新庄区\",\n 711151: \"泰山区\",\n 711152: \"林口区\",\n 711153: \"芦洲区\",\n 711154: \"五股区\",\n 711155: \"八里区\",\n 711156: \"淡水区\",\n 711157: \"三芝区\",\n 711158: \"石门区\",\n 711287: \"宜兰市\",\n 711288: \"头城镇\",\n 711289: \"礁溪乡\",\n 711290: \"壮围乡\",\n 711291: \"员山乡\",\n 711292: \"罗东镇\",\n 711293: \"三星乡\",\n 711294: \"大同乡\",\n 711295: \"五结乡\",\n 711296: \"冬山乡\",\n 711297: \"苏澳镇\",\n 711298: \"南澳乡\",\n 711299: \"钓鱼台\",\n 711387: \"竹北市\",\n 711388: \"湖口乡\",\n 711389: \"新丰乡\",\n 711390: \"新埔镇\",\n 711391: \"关西镇\",\n 711392: \"芎林乡\",\n 711393: \"宝山乡\",\n 711394: \"竹东镇\",\n 711395: \"五峰乡\",\n 711396: \"横山乡\",\n 711397: \"尖石乡\",\n 711398: \"北埔乡\",\n 711399: \"峨眉乡\",\n 711414: \"中坜区\",\n 711415: \"平镇区\",\n 711417: \"杨梅区\",\n 711418: \"新屋区\",\n 711419: \"观音区\",\n 711420: \"桃园区\",\n 711421: \"龟山区\",\n 711422: \"八德区\",\n 711423: \"大溪区\",\n 711425: \"大园区\",\n 711426: \"芦竹区\",\n 711487: \"中坜市\",\n 711488: \"平镇市\",\n 711489: \"龙潭乡\",\n 711490: \"杨梅市\",\n 711491: \"新屋乡\",\n 711492: \"观音乡\",\n 711493: \"桃园市\",\n 711494: \"龟山乡\",\n 711495: \"八德市\",\n 711496: \"大溪镇\",\n 711497: \"复兴乡\",\n 711498: \"大园乡\",\n 711499: \"芦竹乡\",\n 711520: \"头份市\",\n 711582: \"竹南镇\",\n 711583: \"头份镇\",\n 711584: \"三湾乡\",\n 711585: \"南庄乡\",\n 711586: \"狮潭乡\",\n 711587: \"后龙镇\",\n 711588: \"通霄镇\",\n 711589: \"苑里镇\",\n 711590: \"苗栗市\",\n 711591: \"造桥乡\",\n 711592: \"头屋乡\",\n 711593: \"公馆乡\",\n 711594: \"大湖乡\",\n 711595: \"泰安乡\",\n 711596: \"铜锣乡\",\n 711597: \"三义乡\",\n 711598: \"西湖乡\",\n 711599: \"卓兰镇\",\n 711736: \"员林市\",\n 711774: \"彰化市\",\n 711775: \"芬园乡\",\n 711776: \"花坛乡\",\n 711777: \"秀水乡\",\n 711778: \"鹿港镇\",\n 711779: \"福兴乡\",\n 711780: \"线西乡\",\n 711781: \"和美镇\",\n 711782: \"伸港乡\",\n 711783: \"员林镇\",\n 711784: \"社头乡\",\n 711785: \"永靖乡\",\n 711786: \"埔心乡\",\n 711787: \"溪湖镇\",\n 711788: \"大村乡\",\n 711789: \"埔盐乡\",\n 711790: \"田中镇\",\n 711791: \"北斗镇\",\n 711792: \"田尾乡\",\n 711793: \"埤头乡\",\n 711794: \"溪州乡\",\n 711795: \"竹塘乡\",\n 711796: \"二林镇\",\n 711797: \"大城乡\",\n 711798: \"芳苑乡\",\n 711799: \"二水乡\",\n 711982: \"番路乡\",\n 711983: \"梅山乡\",\n 711984: \"竹崎乡\",\n 711985: \"阿里山乡\",\n 711986: \"中埔乡\",\n 711987: \"大埔乡\",\n 711988: \"水上乡\",\n 711989: \"鹿草乡\",\n 711990: \"太保市\",\n 711991: \"朴子市\",\n 711992: \"东石乡\",\n 711993: \"六脚乡\",\n 711994: \"新港乡\",\n 711995: \"民雄乡\",\n 711996: \"大林镇\",\n 711997: \"溪口乡\",\n 711998: \"义竹乡\",\n 711999: \"布袋镇\",\n 712180: \"斗南镇\",\n 712181: \"大埤乡\",\n 712182: \"虎尾镇\",\n 712183: \"土库镇\",\n 712184: \"褒忠乡\",\n 712185: \"东势乡\",\n 712186: \"台西乡\",\n 712187: \"仑背乡\",\n 712188: \"麦寮乡\",\n 712189: \"斗六市\",\n 712190: \"林内乡\",\n 712191: \"古坑乡\",\n 712192: \"莿桐乡\",\n 712193: \"西螺镇\",\n 712194: \"二仑乡\",\n 712195: \"北港镇\",\n 712196: \"水林乡\",\n 712197: \"口湖乡\",\n 712198: \"四湖乡\",\n 712199: \"元长乡\",\n 712451: \"崁顶乡\",\n 712467: \"屏东市\",\n 712468: \"三地门乡\",\n 712469: \"雾台乡\",\n 712470: \"玛家乡\",\n 712471: \"九如乡\",\n 712472: \"里港乡\",\n 712473: \"高树乡\",\n 712474: \"盐埔乡\",\n 712475: \"长治乡\",\n 712476: \"麟洛乡\",\n 712477: \"竹田乡\",\n 712478: \"内埔乡\",\n 712479: \"万丹乡\",\n 712480: \"潮州镇\",\n 712481: \"泰武乡\",\n 712482: \"来义乡\",\n 712483: \"万峦乡\",\n 712484: \"莰顶乡\",\n 712485: \"新埤乡\",\n 712486: \"南州乡\",\n 712487: \"林边乡\",\n 712488: \"东港镇\",\n 712489: \"琉球乡\",\n 712490: \"佳冬乡\",\n 712491: \"新园乡\",\n 712492: \"枋寮乡\",\n 712493: \"枋山乡\",\n 712494: \"春日乡\",\n 712495: \"狮子乡\",\n 712496: \"车城乡\",\n 712497: \"牡丹乡\",\n 712498: \"恒春镇\",\n 712499: \"满州乡\",\n 712584: \"台东市\",\n 712585: \"绿岛乡\",\n 712586: \"兰屿乡\",\n 712587: \"延平乡\",\n 712588: \"卑南乡\",\n 712589: \"鹿野乡\",\n 712590: \"关山镇\",\n 712591: \"海端乡\",\n 712592: \"池上乡\",\n 712593: \"东河乡\",\n 712594: \"成功镇\",\n 712595: \"长滨乡\",\n 712596: \"金峰乡\",\n 712597: \"大武乡\",\n 712598: \"达仁乡\",\n 712599: \"太麻里乡\",\n 712686: \"花莲市\",\n 712687: \"新城乡\",\n 712688: \"太鲁阁\",\n 712689: \"秀林乡\",\n 712690: \"吉安乡\",\n 712691: \"寿丰乡\",\n 712692: \"凤林镇\",\n 712693: \"光复乡\",\n 712694: \"丰滨乡\",\n 712695: \"瑞穗乡\",\n 712696: \"万荣乡\",\n 712697: \"玉里镇\",\n 712698: \"卓溪乡\",\n 712699: \"富里乡\",\n 712794: \"马公市\",\n 712795: \"西屿乡\",\n 712796: \"望安乡\",\n 712797: \"七美乡\",\n 712798: \"白沙乡\",\n 712799: \"湖西乡\",\n 712896: \"南竿乡\",\n 712897: \"北竿乡\",\n 712898: \"东引乡\",\n 712899: \"莒光乡\",\n 810101: \"中西区\",\n 810102: \"湾仔区\",\n 810103: \"东区\",\n 810104: \"南区\",\n 810201: \"九龙城区\",\n 810202: \"油尖旺区\",\n 810203: \"深水埗区\",\n 810204: \"黄大仙区\",\n 810205: \"观塘区\",\n 810301: \"北区\",\n 810302: \"大埔区\",\n 810303: \"沙田区\",\n 810304: \"西贡区\",\n 810305: \"元朗区\",\n 810306: \"屯门区\",\n 810307: \"荃湾区\",\n 810308: \"葵青区\",\n 810309: \"离岛区\",\n 820102: \"花地玛堂区\",\n 820103: \"花王堂区\",\n 820104: \"望德堂区\",\n 820105: \"大堂区\",\n 820106: \"风顺堂区\",\n 820202: \"嘉模堂区\",\n 820203: \"路氹填海区\",\n 820204: \"圣方济各堂区\"\n }\n};\nvar makeOption = (text, value, children) => ({\n text,\n value,\n children\n});\nfunction useCascaderAreaData() {\n const {\n city_list: city,\n county_list: county,\n province_list: province\n } = areaList;\n const provinceMap = /* @__PURE__ */ new Map();\n Object.keys(province).forEach((code) => {\n provinceMap.set(code.slice(0, 2), makeOption(province[code], code, []));\n });\n const cityMap = /* @__PURE__ */ new Map();\n Object.keys(city).forEach((code) => {\n const option = makeOption(city[code], code, []);\n cityMap.set(code.slice(0, 4), option);\n const province2 = provinceMap.get(code.slice(0, 2));\n if (province2) {\n province2.children.push(option);\n }\n });\n Object.keys(county).forEach((code) => {\n const city2 = cityMap.get(code.slice(0, 4));\n if (city2) {\n city2.children.push(makeOption(county[code], code));\n }\n });\n return Array.from(provinceMap.values());\n}\n"]} \ No newline at end of file diff --git a/miniprogram_npm/@vant/weapp/button/index.wxml b/miniprogram_npm/@vant/weapp/button/index.wxml index b5abebb..b87b9b8 100644 --- a/miniprogram_npm/@vant/weapp/button/index.wxml +++ b/miniprogram_npm/@vant/weapp/button/index.wxml @@ -22,6 +22,7 @@ bindgetuserinfo="onGetUserInfo" bindcontact="onContact" bindgetphonenumber="onGetPhoneNumber" + bindgetrealtimephonenumber="onGetRealTimePhoneNumber" binderror="onError" bindlaunchapp="onLaunchApp" bindopensetting="onOpenSetting" diff --git a/miniprogram_npm/@vant/weapp/calendar/calendar.wxml b/miniprogram_npm/@vant/weapp/calendar/calendar.wxml index 808f739..2ba6f30 100644 --- a/miniprogram_npm/@vant/weapp/calendar/calendar.wxml +++ b/miniprogram_npm/@vant/weapp/calendar/calendar.wxml @@ -54,12 +54,12 @@ type="danger" color="{{ color }}" custom-class="van-calendar__confirm" - disabled="{{ computed.getButtonDisabled(type, currentDate) }}" + disabled="{{ computed.getButtonDisabled(type, currentDate, minRange) }}" nativeType="text" bind:click="onConfirm" > {{ - computed.getButtonDisabled(type, currentDate) + computed.getButtonDisabled(type, currentDate, minRange) ? confirmDisabledText : confirmText }} diff --git a/miniprogram_npm/@vant/weapp/calendar/index.js b/miniprogram_npm/@vant/weapp/calendar/index.js index 3baa5f0..d4fbd91 100644 --- a/miniprogram_npm/@vant/weapp/calendar/index.js +++ b/miniprogram_npm/@vant/weapp/calendar/index.js @@ -56,6 +56,7 @@ var getTime = function (date) { }, defaultDate: { type: null, + value: (0, utils_1.getToday)().getTime(), observer: function (val) { this.setData({ currentDate: val }); this.scrollIntoView(); @@ -119,6 +120,10 @@ var getTime = function (date) { type: null, value: null, }, + minRange: { + type: Number, + value: 1, + }, firstDayOfWeek: { type: Number, value: 0, @@ -181,13 +186,16 @@ var getTime = function (date) { var _this = this; if (defaultDate === void 0) { defaultDate = null; } var _a = this.data, type = _a.type, minDate = _a.minDate, maxDate = _a.maxDate, allowSameDay = _a.allowSameDay; + if (!defaultDate) + return []; var now = (0, utils_1.getToday)().getTime(); if (type === 'range') { if (!Array.isArray(defaultDate)) { defaultDate = []; } var _b = defaultDate || [], startDay = _b[0], endDay = _b[1]; - var start = this.limitDateRange(startDay || now, minDate, (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); + var startDate = getTime(startDay || now); + var start = this.limitDateRange(startDate, minDate, allowSameDay ? startDate : (0, utils_1.getPrevDay)(new Date(maxDate)).getTime()); var date = getTime(endDay || now); var end = this.limitDateRange(date, allowSameDay ? date : (0, utils_1.getNextDay)(new Date(minDate)).getTime()); return [start, end]; @@ -207,6 +215,8 @@ var getTime = function (date) { var _this = this; (0, utils_2.requestAnimationFrame)(function () { var _a = _this.data, currentDate = _a.currentDate, type = _a.type, show = _a.show, poppable = _a.poppable, minDate = _a.minDate, maxDate = _a.maxDate; + if (!currentDate) + return; // @ts-ignore var targetDate = type === 'single' ? currentDate : currentDate[0]; var displayed = show || !poppable; @@ -263,7 +273,7 @@ var getTime = function (date) { this.select([date, null]); } else if (allowSameDay) { - this.select([date, date]); + this.select([date, date], true); } } else { diff --git a/miniprogram_npm/@vant/weapp/calendar/index.wxml b/miniprogram_npm/@vant/weapp/calendar/index.wxml index bc8bcfd..9667eef 100644 --- a/miniprogram_npm/@vant/weapp/calendar/index.wxml +++ b/miniprogram_npm/@vant/weapp/calendar/index.wxml @@ -12,6 +12,7 @@ position="{{ position }}" closeable="{{ showTitle || showSubtitle }}" close-on-click-overlay="{{ closeOnClickOverlay }}" + safe-area-inset-bottom="{{ safeAreaInsetBottom }}" bind:enter="onOpen" bind:close="onClose" bind:after-enter="onOpened" diff --git a/miniprogram_npm/@vant/weapp/calendar/index.wxs b/miniprogram_npm/@vant/weapp/calendar/index.wxs index 2c04be1..0a56646 100644 --- a/miniprogram_npm/@vant/weapp/calendar/index.wxs +++ b/miniprogram_npm/@vant/weapp/calendar/index.wxs @@ -15,7 +15,7 @@ function getMonths(minDate, maxDate) { return months; } -function getButtonDisabled(type, currentDate) { +function getButtonDisabled(type, currentDate, minRange) { if (currentDate == null) { return true; } @@ -25,7 +25,7 @@ function getButtonDisabled(type, currentDate) { } if (type === 'multiple') { - return !currentDate.length; + return currentDate.length < minRange; } return !currentDate; diff --git a/miniprogram_npm/@vant/weapp/calendar/index.wxss b/miniprogram_npm/@vant/weapp/calendar/index.wxss index 05df518..a1f1cf0 100644 --- a/miniprogram_npm/@vant/weapp/calendar/index.wxss +++ b/miniprogram_npm/@vant/weapp/calendar/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,80%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important} \ No newline at end of file +@import '../common/index.wxss';.van-calendar{background-color:var(--calendar-background-color,#fff);display:flex;flex-direction:column;height:var(--calendar-height,100%)}.van-calendar__close-icon{top:11px}.van-calendar__popup--bottom,.van-calendar__popup--top{height:var(--calendar-popup-height,90%)}.van-calendar__popup--left,.van-calendar__popup--right{height:100%}.van-calendar__body{-webkit-overflow-scrolling:touch;flex:1;overflow:auto}.van-calendar__footer{flex-shrink:0;padding:0 var(--padding-md,16px)}.van-calendar__footer--safe-area-inset-bottom{padding-bottom:env(safe-area-inset-bottom)}.van-calendar__footer+.van-calendar__footer,.van-calendar__footer:empty{display:none}.van-calendar__footer:empty+.van-calendar__footer{display:block!important}.van-calendar__confirm{height:var(--calendar-confirm-button-height,36px)!important;line-height:var(--calendar-confirm-button-line-height,34px)!important;margin:var(--calendar-confirm-button-margin,7px 0)!important} \ No newline at end of file diff --git a/miniprogram_npm/@vant/weapp/cascader/index.js b/miniprogram_npm/@vant/weapp/cascader/index.js index a3662ba..63915ee 100644 --- a/miniprogram_npm/@vant/weapp/cascader/index.js +++ b/miniprogram_npm/@vant/weapp/cascader/index.js @@ -26,7 +26,6 @@ var defaultFieldNames = { title: String, value: { type: String, - observer: 'updateValue', }, placeholder: { type: String, @@ -39,7 +38,6 @@ var defaultFieldNames = { options: { type: Array, value: [], - observer: 'updateOptions', }, swipeable: { type: Boolean, @@ -69,15 +67,20 @@ var defaultFieldNames = { textKey: FieldName.TEXT, valueKey: FieldName.VALUE, childrenKey: FieldName.CHILDREN, + innerValue: '', + }, + watch: { + options: function () { + this.updateTabs(); + }, + value: function (newVal) { + this.updateValue(newVal); + }, }, created: function () { this.updateTabs(); }, methods: { - updateOptions: function (val, oldVal) { - var isAsync = !!(val.length && oldVal.length); - this.updateTabs(isAsync); - }, updateValue: function (val) { var _this = this; if (val !== undefined) { @@ -86,6 +89,7 @@ var defaultFieldNames = { return; } } + this.innerValue = val; this.updateTabs(); }, updateFieldNames: function () { @@ -110,12 +114,15 @@ var defaultFieldNames = { } } }, - updateTabs: function (isAsync) { + updateTabs: function () { var _this = this; - if (isAsync === void 0) { isAsync = false; } - var _a = this.data, options = _a.options, value = _a.value; - if (value !== undefined) { - var selectedOptions = this.getSelectedOptionsByValue(options, value); + var options = this.data.options; + var innerValue = this.innerValue; + if (!options.length) { + return; + } + if (innerValue !== undefined) { + var selectedOptions = this.getSelectedOptionsByValue(options, innerValue); if (selectedOptions) { var optionsCursor_1 = options; var tabs_1 = selectedOptions.map(function (option) { @@ -146,16 +153,6 @@ var defaultFieldNames = { return; } } - // 异步更新 - if (isAsync) { - var tabs = this.data.tabs; - tabs[tabs.length - 1].options = - options[options.length - 1][this.data.childrenKey]; - this.setData({ - tabs: tabs, - }); - return; - } this.setData({ tabs: [ { @@ -171,6 +168,9 @@ var defaultFieldNames = { onClickTab: function (e) { var _a = e.detail, tabIndex = _a.index, title = _a.title; this.$emit('click-tab', { title: title, tabIndex: tabIndex }); + this.setData({ + activeTab: tabIndex, + }); }, // 选中 onSelect: function (e) { @@ -206,11 +206,13 @@ var defaultFieldNames = { tabs: tabs, }); var selectedOptions = tabs.map(function (tab) { return tab.selected; }).filter(Boolean); + var value = option[valueKey]; var params = { - value: option[valueKey], + value: value, tabIndex: tabIndex, selectedOptions: selectedOptions, }; + this.innerValue = value; this.$emit('change', params); if (!option[childrenKey]) { this.$emit('finish', params); diff --git a/miniprogram_npm/@vant/weapp/cascader/index.wxml b/miniprogram_npm/@vant/weapp/cascader/index.wxml index b1d724b..1794b82 100644 --- a/miniprogram_npm/@vant/weapp/cascader/index.wxml +++ b/miniprogram_npm/@vant/weapp/cascader/index.wxml @@ -37,14 +37,14 @@ wx:for="{{ tab.options }}" wx:for-item="option" wx:key="index" - class="{{ option.className }} {{ utils.optionClass(tab, textKey, option) }}" - style="{{ utils.optionStyle({ tab, textKey, option, activeColor }) }}" + class="{{ option.className }} {{ utils.optionClass(tab, valueKey, option) }}" + style="{{ utils.optionStyle({ tab, valueKey, option, activeColor }) }}" data-option="{{ option }}" data-tab-index="{{ tabIndex }}" bind:tap="onSelect" > {{ option[textKey] }} - + diff --git a/miniprogram_npm/@vant/weapp/cascader/index.wxs b/miniprogram_npm/@vant/weapp/cascader/index.wxs index cba6465..b1aab58 100644 --- a/miniprogram_npm/@vant/weapp/cascader/index.wxs +++ b/miniprogram_npm/@vant/weapp/cascader/index.wxs @@ -1,16 +1,16 @@ var utils = require('../wxs/utils.wxs'); var style = require('../wxs/style.wxs'); -function isSelected(tab, textKey, option) { - return tab.selected && tab.selected[textKey] === option[textKey] +function isSelected(tab, valueKey, option) { + return tab.selected && tab.selected[valueKey] === option[valueKey] } -function optionClass(tab, textKey, option) { - return utils.bem('cascader__option', { selected: isSelected({ tab, textKey, option }), disabled: option.disabled }) +function optionClass(tab, valueKey, option) { + return utils.bem('cascader__option', { selected: isSelected(tab, valueKey, option), disabled: option.disabled }) } function optionStyle(data) { - var color = data.option.color || (isSelected(data.tab, data.textKey, data.option) ? data.activeColor : undefined); + var color = data.option.color || (isSelected(data.tab, data.valueKey, data.option) ? data.activeColor : undefined); return style({ color }); diff --git a/miniprogram_npm/@vant/weapp/circle/canvas.d.ts b/miniprogram_npm/@vant/weapp/circle/canvas.d.ts index 15268c9..8a0b71e 100644 --- a/miniprogram_npm/@vant/weapp/circle/canvas.d.ts +++ b/miniprogram_npm/@vant/weapp/circle/canvas.d.ts @@ -1,4 +1,4 @@ /// -declare type CanvasContext = WechatMiniprogram.CanvasContext; +type CanvasContext = WechatMiniprogram.CanvasContext; export declare function adaptor(ctx: CanvasContext & Record): CanvasContext; export {}; diff --git a/miniprogram_npm/@vant/weapp/circle/index.js b/miniprogram_npm/@vant/weapp/circle/index.js index 9037e1c..e131e4b 100644 --- a/miniprogram_npm/@vant/weapp/circle/index.js +++ b/miniprogram_npm/@vant/weapp/circle/index.js @@ -98,6 +98,8 @@ var STEP = 1; var _a = this.data, color = _a.color, size = _a.size; if ((0, validator_1.isObj)(color)) { return this.getContext().then(function (context) { + if (!context) + return; var LinearColor = context.createLinearGradient(size, 0, 0, 0); Object.keys(color) .sort(function (a, b) { return parseFloat(a) - parseFloat(b); }) @@ -142,6 +144,8 @@ var STEP = 1; var _this = this; var size = this.data.size; this.getContext().then(function (context) { + if (!context) + return; context.clearRect(0, 0, size, size); _this.renderLayerCircle(context); var formatValue = format(currentValue); diff --git a/miniprogram_npm/@vant/weapp/common/relation.d.ts b/miniprogram_npm/@vant/weapp/common/relation.d.ts index 4b5af00..10193fa 100644 --- a/miniprogram_npm/@vant/weapp/common/relation.d.ts +++ b/miniprogram_npm/@vant/weapp/common/relation.d.ts @@ -1,5 +1,5 @@ /// -declare type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; +type TrivialInstance = WechatMiniprogram.Component.TrivialInstance; export declare function useParent(name: string, onEffect?: (this: TrivialInstance) => void): { relations: { [x: string]: WechatMiniprogram.Component.RelationOption; diff --git a/miniprogram_npm/@vant/weapp/common/utils.d.ts b/miniprogram_npm/@vant/weapp/common/utils.d.ts index 719f2ed..805b399 100644 --- a/miniprogram_npm/@vant/weapp/common/utils.d.ts +++ b/miniprogram_npm/@vant/weapp/common/utils.d.ts @@ -14,4 +14,7 @@ export declare function getRect(context: WechatMiniprogram.Component.TrivialInst export declare function getAllRect(context: WechatMiniprogram.Component.TrivialInstance, selector: string): Promise; export declare function groupSetData(context: WechatMiniprogram.Component.TrivialInstance, cb: () => void): void; export declare function toPromise(promiseLike: Promise | unknown): Promise; +export declare function addNumber(num1: any, num2: any): number; +export declare const clamp: (num: any, min: any, max: any) => number; export declare function getCurrentPage(): T & WechatMiniprogram.OptionalInterface & WechatMiniprogram.Page.InstanceProperties & WechatMiniprogram.Page.InstanceMethods & WechatMiniprogram.Page.Data & WechatMiniprogram.IAnyObject; +export declare const isPC: boolean; diff --git a/miniprogram_npm/@vant/weapp/common/utils.js b/miniprogram_npm/@vant/weapp/common/utils.js index 1e35ad2..80fb803 100644 --- a/miniprogram_npm/@vant/weapp/common/utils.js +++ b/miniprogram_npm/@vant/weapp/common/utils.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getCurrentPage = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0; +exports.isPC = exports.getCurrentPage = exports.clamp = exports.addNumber = exports.toPromise = exports.groupSetData = exports.getAllRect = exports.getRect = exports.pickExclude = exports.requestAnimationFrame = exports.addUnit = exports.nextTick = exports.range = exports.getSystemInfoSync = exports.isDef = void 0; var validator_1 = require("./validator"); var version_1 = require("./version"); var validator_2 = require("./validator"); @@ -90,8 +90,18 @@ function toPromise(promiseLike) { return Promise.resolve(promiseLike); } exports.toPromise = toPromise; +// 浮点数精度处理 +function addNumber(num1, num2) { + var cardinal = Math.pow(10, 10); + return Math.round((num1 + num2) * cardinal) / cardinal; +} +exports.addNumber = addNumber; +// 限制value在[min, max]之间 +var clamp = function (num, min, max) { return Math.min(Math.max(num, min), max); }; +exports.clamp = clamp; function getCurrentPage() { var pages = getCurrentPages(); return pages[pages.length - 1]; } exports.getCurrentPage = getCurrentPage; +exports.isPC = ['mac', 'windows'].includes((0, version_1.getSystemInfoSync)().platform); diff --git a/miniprogram_npm/@vant/weapp/count-down/utils.d.ts b/miniprogram_npm/@vant/weapp/count-down/utils.d.ts index e4a58dd..876a6c1 100644 --- a/miniprogram_npm/@vant/weapp/count-down/utils.d.ts +++ b/miniprogram_npm/@vant/weapp/count-down/utils.d.ts @@ -1,4 +1,4 @@ -export declare type TimeData = { +export type TimeData = { days: number; hours: number; minutes: number; diff --git a/miniprogram_npm/@vant/weapp/definitions/index.d.ts b/miniprogram_npm/@vant/weapp/definitions/index.d.ts index c4c98f9..d0554f6 100644 --- a/miniprogram_npm/@vant/weapp/definitions/index.d.ts +++ b/miniprogram_npm/@vant/weapp/definitions/index.d.ts @@ -5,7 +5,7 @@ interface VantComponentInstance { index: number; $emit: (name: string, detail?: unknown, options?: WechatMiniprogram.Component.TriggerEventOption) => void; } -export declare type VantComponentOptions = { +export type VantComponentOptions = { data?: Data; field?: boolean; classes?: string[]; diff --git a/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts b/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts index 1770810..db2da5f 100644 --- a/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts +++ b/miniprogram_npm/@vant/weapp/dialog/dialog.d.ts @@ -1,7 +1,7 @@ /// /// -export declare type Action = 'confirm' | 'cancel' | 'overlay'; -declare type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; +export type Action = 'confirm' | 'cancel' | 'overlay'; +type DialogContext = WechatMiniprogram.Page.TrivialInstance | WechatMiniprogram.Component.TrivialInstance; interface DialogOptions { lang?: string; show?: boolean; diff --git a/miniprogram_npm/@vant/weapp/dialog/index.js b/miniprogram_npm/@vant/weapp/dialog/index.js index 3d59264..3ca0b44 100644 --- a/miniprogram_npm/@vant/weapp/dialog/index.js +++ b/miniprogram_npm/@vant/weapp/dialog/index.js @@ -6,6 +6,7 @@ var color_1 = require("../common/color"); var utils_1 = require("../common/utils"); (0, component_1.VantComponent)({ mixins: [button_1.button], + classes: ['cancle-button-class', 'confirm-button-class'], props: { show: { type: Boolean, diff --git a/miniprogram_npm/@vant/weapp/dialog/index.wxml b/miniprogram_npm/@vant/weapp/dialog/index.wxml index e1ac81e..364dd4c 100644 --- a/miniprogram_npm/@vant/weapp/dialog/index.wxml +++ b/miniprogram_npm/@vant/weapp/dialog/index.wxml @@ -33,7 +33,7 @@ size="large" loading="{{ loading.cancel }}" class="van-dialog__button van-hairline--right" - custom-class="van-dialog__cancel" + custom-class="van-dialog__cancel cancle-button-class" custom-style="color: {{ cancelButtonColor }}" bind:click="onCancel" > @@ -44,7 +44,7 @@ size="large" class="van-dialog__button" loading="{{ loading.confirm }}" - custom-class="van-dialog__confirm" + custom-class="van-dialog__confirm confirm-button-class" custom-style="color: {{ confirmButtonColor }}" open-type="{{ confirmButtonOpenType }}" @@ -75,7 +75,7 @@ size="large" loading="{{ loading.cancel }}" class="van-dialog__button van-hairline--right" - custom-class="van-dialog__cancel" + custom-class="van-dialog__cancel cancle-button-class" custom-style="color: {{ cancelButtonColor }}" bind:click="onCancel" > @@ -86,7 +86,7 @@ size="large" class="van-dialog__button" loading="{{ loading.confirm }}" - custom-class="van-dialog__confirm" + custom-class="van-dialog__confirm confirm-button-class" custom-style="color: {{ confirmButtonColor }}" open-type="{{ confirmButtonOpenType }}" diff --git a/miniprogram_npm/@vant/weapp/dropdown-item/index.js b/miniprogram_npm/@vant/weapp/dropdown-item/index.js index 0dd143d..826c26a 100644 --- a/miniprogram_npm/@vant/weapp/dropdown-item/index.js +++ b/miniprogram_npm/@vant/weapp/dropdown-item/index.js @@ -32,12 +32,17 @@ var component_1 = require("../common/component"); type: Boolean, value: false, }, + rootPortal: { + type: Boolean, + value: false, + }, }, data: { transition: true, showPopup: false, showWrapper: false, displayTitle: '', + safeAreaTabBar: false, }, methods: { rerender: function () { @@ -49,13 +54,14 @@ var component_1 = require("../common/component"); }, updateDataFromParent: function () { if (this.parent) { - var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction; + var _a = this.parent.data, overlay = _a.overlay, duration = _a.duration, activeColor = _a.activeColor, closeOnClickOverlay = _a.closeOnClickOverlay, direction = _a.direction, safeAreaTabBar = _a.safeAreaTabBar; this.setData({ overlay: overlay, duration: duration, activeColor: activeColor, closeOnClickOverlay: closeOnClickOverlay, direction: direction, + safeAreaTabBar: safeAreaTabBar, }); } }, diff --git a/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml b/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml index c9d4aa5..63904f4 100644 --- a/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml +++ b/miniprogram_npm/@vant/weapp/dropdown-item/index.wxml @@ -12,7 +12,9 @@ overlay="{{ overlay }}" position="{{ direction === 'down' ? 'top' : 'bottom' }}" duration="{{ transition ? duration : 0 }}" + safe-area-tab-bar="{{ safeAreaTabBar }}" close-on-click-overlay="{{ closeOnClickOverlay }}" + rootPortal="{{ rootPortal }}" bind:enter="onOpen" bind:leave="onClose" bind:close="toggle" diff --git a/miniprogram_npm/@vant/weapp/dropdown-menu/index.js b/miniprogram_npm/@vant/weapp/dropdown-menu/index.js index 86ae618..aed2921 100644 --- a/miniprogram_npm/@vant/weapp/dropdown-menu/index.js +++ b/miniprogram_npm/@vant/weapp/dropdown-menu/index.js @@ -34,6 +34,10 @@ var ARRAY = []; value: 'down', observer: 'updateChildrenData', }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, closeOnClickOverlay: { type: Boolean, value: true, diff --git a/miniprogram_npm/@vant/weapp/field/index.js b/miniprogram_npm/@vant/weapp/field/index.js index 7bb7393..c20d266 100644 --- a/miniprogram_npm/@vant/weapp/field/index.js +++ b/miniprogram_npm/@vant/weapp/field/index.js @@ -49,11 +49,19 @@ var props_1 = require("./props"); this.setData({ innerValue: this.value }); }, methods: { + formatValue: function (value) { + var maxlength = this.data.maxlength; + if (maxlength !== -1 && value.length > maxlength) { + return value.slice(0, maxlength); + } + return value; + }, onInput: function (event) { var _a = (event.detail || {}).value, value = _a === void 0 ? '' : _a; - this.value = value; + var formatValue = this.formatValue(value); + this.value = formatValue; this.setShowClear(); - this.emitChange(event.detail); + return this.emitChange(__assign(__assign({}, event.detail), { value: formatValue })); }, onFocus: function (event) { this.focused = true; @@ -102,14 +110,16 @@ var props_1 = require("./props"); this.$emit('keyboardheightchange', event.detail); }, emitChange: function (detail) { - var _this = this; var extraEventParams = this.data.extraEventParams; this.setData({ value: detail.value }); - (0, utils_1.nextTick)(function () { - var data = extraEventParams ? detail : detail.value; - _this.$emit('input', data); - _this.$emit('change', data); - }); + var result; + var data = extraEventParams + ? __assign(__assign({}, detail), { callback: function (data) { + result = data; + } }) : detail.value; + this.$emit('input', data); + this.$emit('change', data); + return result; }, setShowClear: function () { var _a = this.data, clearable = _a.clearable, readonly = _a.readonly, clearTrigger = _a.clearTrigger; diff --git a/miniprogram_npm/@vant/weapp/field/index.wxml b/miniprogram_npm/@vant/weapp/field/index.wxml index ec2e0ea..6018993 100644 --- a/miniprogram_npm/@vant/weapp/field/index.wxml +++ b/miniprogram_npm/@vant/weapp/field/index.wxml @@ -13,12 +13,12 @@ title-style="margin-right: 12px;" custom-style="{{ customStyle }}" arrow-direction="{{ arrowDirection }}" - custom-class="van-field" + custom-class="custom-class van-field" > - + + @@ -47,10 +47,10 @@ - + - + + + diff --git a/miniprogram_npm/@vant/weapp/field/input.wxml b/miniprogram_npm/@vant/weapp/field/input.wxml index efe9a08..e39a5ee 100644 --- a/miniprogram_npm/@vant/weapp/field/input.wxml +++ b/miniprogram_npm/@vant/weapp/field/input.wxml @@ -1,4 +1,5 @@ {{ text }} diff --git a/miniprogram_npm/@vant/weapp/icon/index.js b/miniprogram_npm/@vant/weapp/icon/index.js index 103b11e..6758092 100644 --- a/miniprogram_npm/@vant/weapp/icon/index.js +++ b/miniprogram_npm/@vant/weapp/icon/index.js @@ -2,6 +2,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); var component_1 = require("../common/component"); (0, component_1.VantComponent)({ + classes: ['info-class'], props: { dot: Boolean, info: null, diff --git a/miniprogram_npm/@vant/weapp/icon/index.wxml b/miniprogram_npm/@vant/weapp/icon/index.wxml index 3c70174..91b47f9 100644 --- a/miniprogram_npm/@vant/weapp/icon/index.wxml +++ b/miniprogram_npm/@vant/weapp/icon/index.wxml @@ -9,7 +9,7 @@ wx:if="{{ info !== null || dot }}" dot="{{ dot }}" info="{{ info }}" - custom-class="van-icon__info" + custom-class="van-icon__info info-class" /> /// -declare type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; -declare type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; +type IPageScrollOption = WechatMiniprogram.Page.IPageScrollOption; +type Scroller = (this: WechatMiniprogram.Component.TrivialInstance, event?: IPageScrollOption) => void; export declare function pageScrollMixin(scroller: Scroller): string; export {}; diff --git a/miniprogram_npm/@vant/weapp/overlay/index.js b/miniprogram_npm/@vant/weapp/overlay/index.js index 1828343..9b58b5f 100644 --- a/miniprogram_npm/@vant/weapp/overlay/index.js +++ b/miniprogram_npm/@vant/weapp/overlay/index.js @@ -17,6 +17,10 @@ var component_1 = require("../common/component"); type: Boolean, value: true, }, + rootPortal: { + type: Boolean, + value: false, + }, }, methods: { onClick: function () { diff --git a/miniprogram_npm/@vant/weapp/overlay/index.wxml b/miniprogram_npm/@vant/weapp/overlay/index.wxml index 4ac2c6d..17fc56f 100644 --- a/miniprogram_npm/@vant/weapp/overlay/index.wxml +++ b/miniprogram_npm/@vant/weapp/overlay/index.wxml @@ -1,21 +1,7 @@ - - - - - - + + + + + + + diff --git a/miniprogram_npm/@vant/weapp/overlay/overlay.wxml b/miniprogram_npm/@vant/weapp/overlay/overlay.wxml new file mode 100644 index 0000000..017e801 --- /dev/null +++ b/miniprogram_npm/@vant/weapp/overlay/overlay.wxml @@ -0,0 +1,10 @@ + + + \ No newline at end of file diff --git a/miniprogram_npm/@vant/weapp/popup/index.js b/miniprogram_npm/@vant/weapp/popup/index.js index 56367a4..18b08e6 100644 --- a/miniprogram_npm/@vant/weapp/popup/index.js +++ b/miniprogram_npm/@vant/weapp/popup/index.js @@ -55,10 +55,18 @@ var transition_1 = require("../mixins/transition"); type: Boolean, value: false, }, + safeAreaTabBar: { + type: Boolean, + value: false, + }, lockScroll: { type: Boolean, value: true, }, + rootPortal: { + type: Boolean, + value: false, + }, }, created: function () { this.observeClass(); diff --git a/miniprogram_npm/@vant/weapp/popup/index.wxml b/miniprogram_npm/@vant/weapp/popup/index.wxml index ea7d696..ab824b1 100644 --- a/miniprogram_npm/@vant/weapp/popup/index.wxml +++ b/miniprogram_npm/@vant/weapp/popup/index.wxml @@ -1,6 +1,8 @@ + + - - - - + + + + + + diff --git a/miniprogram_npm/@vant/weapp/popup/index.wxss b/miniprogram_npm/@vant/weapp/popup/index.wxss index a840541..91983b4 100644 --- a/miniprogram_npm/@vant/weapp/popup/index.wxss +++ b/miniprogram_npm/@vant/weapp/popup/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)} \ No newline at end of file +@import '../common/index.wxss';.van-popup{-webkit-overflow-scrolling:touch;animation:ease both;background-color:var(--popup-background-color,#fff);box-sizing:border-box;max-height:100%;overflow-y:auto;position:fixed;transition-timing-function:ease}.van-popup--center{left:50%;top:50%;transform:translate3d(-50%,-50%,0)}.van-popup--center.van-popup--round{border-radius:var(--popup-round-border-radius,16px)}.van-popup--top{left:0;top:0;width:100%}.van-popup--top.van-popup--round{border-radius:0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--right{right:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--right.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px))}.van-popup--bottom{bottom:0;left:0;width:100%}.van-popup--bottom.van-popup--round{border-radius:var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0 0}.van-popup--left{left:0;top:50%;transform:translate3d(0,-50%,0)}.van-popup--left.van-popup--round{border-radius:0 var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) var(--popup-round-border-radius,var(--popup-round-border-radius,16px)) 0}.van-popup--bottom.van-popup--safe{padding-bottom:env(safe-area-inset-bottom)}.van-popup--bottom.van-popup--safeTabBar,.van-popup--top.van-popup--safeTabBar{bottom:var(--tabbar-height,50px)}.van-popup--safeTop{padding-top:env(safe-area-inset-top)}.van-popup__close-icon{color:var(--popup-close-icon-color,#969799);font-size:var(--popup-close-icon-size,18px);position:absolute;z-index:var(--popup-close-icon-z-index,1)}.van-popup__close-icon--top-left{left:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--top-right{right:var(--popup-close-icon-margin,16px);top:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-left{bottom:var(--popup-close-icon-margin,16px);left:var(--popup-close-icon-margin,16px)}.van-popup__close-icon--bottom-right{bottom:var(--popup-close-icon-margin,16px);right:var(--popup-close-icon-margin,16px)}.van-popup__close-icon:active{opacity:.6}.van-scale-enter-active,.van-scale-leave-active{transition-property:opacity,transform}.van-scale-enter,.van-scale-leave-to{opacity:0;transform:translate3d(-50%,-50%,0) scale(.7)}.van-fade-enter-active,.van-fade-leave-active{transition-property:opacity}.van-fade-enter,.van-fade-leave-to{opacity:0}.van-center-enter-active,.van-center-leave-active{transition-property:opacity}.van-center-enter,.van-center-leave-to{opacity:0}.van-bottom-enter-active,.van-bottom-leave-active,.van-left-enter-active,.van-left-leave-active,.van-right-enter-active,.van-right-leave-active,.van-top-enter-active,.van-top-leave-active{transition-property:transform}.van-bottom-enter,.van-bottom-leave-to{transform:translate3d(0,100%,0)}.van-top-enter,.van-top-leave-to{transform:translate3d(0,-100%,0)}.van-left-enter,.van-left-leave-to{transform:translate3d(-100%,-50%,0)}.van-right-enter,.van-right-leave-to{transform:translate3d(100%,-50%,0)} \ No newline at end of file diff --git a/miniprogram_npm/@vant/weapp/popup/popup.wxml b/miniprogram_npm/@vant/weapp/popup/popup.wxml new file mode 100644 index 0000000..25b57fe --- /dev/null +++ b/miniprogram_npm/@vant/weapp/popup/popup.wxml @@ -0,0 +1,14 @@ + + + + diff --git a/miniprogram_npm/@vant/weapp/rate/index.wxss b/miniprogram_npm/@vant/weapp/rate/index.wxss index e2a517e..470e4f4 100644 --- a/miniprogram_npm/@vant/weapp/rate/index.wxss +++ b/miniprogram_npm/@vant/weapp/rate/index.wxss @@ -1 +1 @@ -@import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{padding:0 var(--rate-horizontal-padding,2px);position:relative}.van-rate__item:not(:last-child){padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{color:var(--rate-icon-void-color,#c8c9cc);display:block;font-size:var(--rate-icon-size,20px);height:1em}.van-rate__icon--half{left:var(--rate-horizontal-padding,2px);overflow:hidden;position:absolute;top:0;width:.5em}.van-rate__icon--full,.van-rate__icon--half{color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:var(--rate-icon-disabled-color,#c8c9cc)} \ No newline at end of file +@import '../common/index.wxss';.van-rate{display:inline-flex;-webkit-user-select:none;user-select:none}.van-rate__item{padding:0 var(--rate-horizontal-padding,2px);position:relative}.van-rate__item:not(:last-child){padding-right:var(--rate-icon-gutter,4px)}.van-rate__icon{color:var(--rate-icon-void-color,#c8c9cc);display:block;font-size:var(--rate-icon-size,20px);height:100%}.van-rate__icon--half{left:var(--rate-horizontal-padding,2px);overflow:hidden;position:absolute;top:0;width:.5em}.van-rate__icon--full,.van-rate__icon--half{color:var(--rate-icon-full-color,#ee0a24)}.van-rate__icon--disabled{color:var(--rate-icon-disabled-color,#c8c9cc)} \ No newline at end of file diff --git a/miniprogram_npm/@vant/weapp/slider/index.js b/miniprogram_npm/@vant/weapp/slider/index.js index 73923a2..92adca8 100644 --- a/miniprogram_npm/@vant/weapp/slider/index.js +++ b/miniprogram_npm/@vant/weapp/slider/index.js @@ -195,8 +195,12 @@ var DRAG_STATUS = { return '0%'; }, format: function (value) { - var _a = this.data, max = _a.max, min = _a.min, step = _a.step; - return Math.round(Math.max(min, Math.min(value, max)) / step) * step; + var min = +this.data.min; + var max = +this.data.max; + var step = +this.data.step; + value = (0, utils_1.clamp)(value, min, max); + var diff = Math.round((value - min) / step) * step; + return (0, utils_1.addNumber)(min, diff); }, }, }); diff --git a/miniprogram_npm/@vant/weapp/stepper/index.js b/miniprogram_npm/@vant/weapp/stepper/index.js index d9694e2..1aa2c27 100644 --- a/miniprogram_npm/@vant/weapp/stepper/index.js +++ b/miniprogram_npm/@vant/weapp/stepper/index.js @@ -102,9 +102,9 @@ function equal(value1, value2) { isDisabled: function (type) { var _a = this.data, disabled = _a.disabled, disablePlus = _a.disablePlus, disableMinus = _a.disableMinus, currentValue = _a.currentValue, max = _a.max, min = _a.min; if (type === 'plus') { - return disabled || disablePlus || currentValue >= max; + return disabled || disablePlus || +currentValue >= +max; } - return disabled || disableMinus || currentValue <= min; + return disabled || disableMinus || +currentValue <= +min; }, onFocus: function (event) { this.$emit('focus', event.detail); @@ -112,6 +112,7 @@ function equal(value1, value2) { onBlur: function (event) { var value = this.format(event.detail.value); this.setData({ currentValue: value }); + this.emitChange(value); this.$emit('blur', __assign(__assign({}, event.detail), { value: value })); }, // filter illegal characters diff --git a/miniprogram_npm/@vant/weapp/stepper/index.wxml b/miniprogram_npm/@vant/weapp/stepper/index.wxml index 6a58fd2..6dd44bc 100644 --- a/miniprogram_npm/@vant/weapp/stepper/index.wxml +++ b/miniprogram_npm/@vant/weapp/stepper/index.wxml @@ -16,7 +16,6 @@ container.height + container.top) { _this.setDataAfterDiff({ @@ -82,7 +80,8 @@ var ROOT_ELEMENT = '.van-sticky'; else { _this.setDataAfterDiff({ fixed: false, transform: 0 }); } - }); + }) + .catch(function () { }); return; } (0, utils_1.getRect)(this, ROOT_ELEMENT).then(function (root) { @@ -118,6 +117,9 @@ var ROOT_ELEMENT = '.van-sticky'; }, getContainerRect: function () { var nodesRef = this.data.container(); + if (!nodesRef) { + return Promise.reject(new Error('not found container')); + } return new Promise(function (resolve) { return nodesRef.boundingClientRect(resolve).exec(); }); }, }, diff --git a/miniprogram_npm/@vant/weapp/tabbar-item/index.js b/miniprogram_npm/@vant/weapp/tabbar-item/index.js index 1a88d4e..58a5065 100644 --- a/miniprogram_npm/@vant/weapp/tabbar-item/index.js +++ b/miniprogram_npm/@vant/weapp/tabbar-item/index.js @@ -8,6 +8,14 @@ var relation_1 = require("../common/relation"); name: null, icon: String, dot: Boolean, + url: { + type: String, + value: '', + }, + linkType: { + type: String, + value: 'redirectTo', + }, iconPrefix: { type: String, value: 'van-icon', @@ -29,6 +37,10 @@ var relation_1 = require("../common/relation"); parent.$emit('change', active); } } + var _a = this.data, url = _a.url, linkType = _a.linkType; + if (url && wx[linkType]) { + return wx[linkType]({ url: url }); + } this.$emit('click'); }, updateFromParent: function () { diff --git a/miniprogram_npm/@vant/weapp/tabs/index.js b/miniprogram_npm/@vant/weapp/tabs/index.js index e16ace9..3121957 100644 --- a/miniprogram_npm/@vant/weapp/tabs/index.js +++ b/miniprogram_npm/@vant/weapp/tabs/index.js @@ -179,6 +179,9 @@ var relation_1 = require("../common/relation"); }); }); if (currentIndex === data.currentIndex) { + if (!data.inited) { + this.resize(); + } return; } var shouldEmitChange = data.currentIndex !== null; diff --git a/miniprogram_npm/@vant/weapp/tabs/index.wxml b/miniprogram_npm/@vant/weapp/tabs/index.wxml index f0a01bb..05bb1e1 100644 --- a/miniprogram_npm/@vant/weapp/tabs/index.wxml +++ b/miniprogram_npm/@vant/weapp/tabs/index.wxml @@ -1,7 +1,7 @@ - + - + /// -declare type ToastMessage = string | number; -declare type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; +type ToastMessage = string | number; +type ToastContext = WechatMiniprogram.Component.TrivialInstance | WechatMiniprogram.Page.TrivialInstance; interface ToastOptions { show?: boolean; type?: string; diff --git a/miniprogram_npm/@vant/weapp/uploader/index.js b/miniprogram_npm/@vant/weapp/uploader/index.js index 7eff33c..5492d40 100644 --- a/miniprogram_npm/@vant/weapp/uploader/index.js +++ b/miniprogram_npm/@vant/weapp/uploader/index.js @@ -47,13 +47,16 @@ var validator_1 = require("../common/validator"); }, previewFullImage: { type: Boolean, value: true, + }, videoFit: { + type: String, + value: 'contain', }, imageFit: { type: String, value: 'scaleToFill', }, uploadIcon: { type: String, value: 'photograph', - } }, shared_1.chooseImageProps), shared_1.chooseVideoProps), shared_1.chooseMediaProps), shared_1.chooseMessageFileProps), + } }, shared_1.imageProps), shared_1.videoProps), shared_1.mediaProps), shared_1.messageFileProps), data: { lists: [], isInCount: true, @@ -129,11 +132,12 @@ var validator_1 = require("../common/validator"); if (!this.data.previewFullImage) return; var index = event.currentTarget.dataset.index; - var lists = this.data.lists; + var _a = this.data, lists = _a.lists, showmenu = _a.showmenu; var item = lists[index]; wx.previewImage({ urls: lists.filter(function (item) { return (0, utils_1.isImageFile)(item); }).map(function (item) { return item.url; }), current: item.url, + showmenu: showmenu, fail: function () { wx.showToast({ title: '预览图片失败', icon: 'none' }); }, diff --git a/miniprogram_npm/@vant/weapp/uploader/index.wxml b/miniprogram_npm/@vant/weapp/uploader/index.wxml index 50fb0c8..3e61fd9 100644 --- a/miniprogram_npm/@vant/weapp/uploader/index.wxml +++ b/miniprogram_npm/@vant/weapp/uploader/index.wxml @@ -28,6 +28,7 @@ title="{{ item.name || ('视频' + index) }}" poster="{{ item.thumb }}" autoplay="{{ item.autoplay }}" + object-fit="{{videoFit}}" class="van-uploader__preview-image" style="{{ computed.sizeStyle({ previewSize }) }}" data-index="{{ index }}" diff --git a/miniprogram_npm/@vant/weapp/uploader/shared.d.ts b/miniprogram_npm/@vant/weapp/uploader/shared.d.ts index 50913eb..e0a0d7e 100644 --- a/miniprogram_npm/@vant/weapp/uploader/shared.d.ts +++ b/miniprogram_npm/@vant/weapp/uploader/shared.d.ts @@ -1,4 +1,4 @@ -export declare const chooseImageProps: { +export declare const imageProps: { sizeType: { type: ArrayConstructor; value: string[]; @@ -7,8 +7,12 @@ export declare const chooseImageProps: { type: ArrayConstructor; value: string[]; }; + showmenu: { + type: BooleanConstructor; + value: boolean; + }; }; -export declare const chooseVideoProps: { +export declare const videoProps: { capture: { type: ArrayConstructor; value: string[]; @@ -26,7 +30,7 @@ export declare const chooseVideoProps: { value: string; }; }; -export declare const chooseMediaProps: { +export declare const mediaProps: { capture: { type: ArrayConstructor; value: string[]; @@ -44,6 +48,6 @@ export declare const chooseMediaProps: { value: string; }; }; -export declare const chooseMessageFileProps: { +export declare const messageFileProps: { extension: null; }; diff --git a/miniprogram_npm/@vant/weapp/uploader/shared.js b/miniprogram_npm/@vant/weapp/uploader/shared.js index 5986ebe..4e07727 100644 --- a/miniprogram_npm/@vant/weapp/uploader/shared.js +++ b/miniprogram_npm/@vant/weapp/uploader/shared.js @@ -1,8 +1,8 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.chooseMessageFileProps = exports.chooseMediaProps = exports.chooseVideoProps = exports.chooseImageProps = void 0; -// props for choose image -exports.chooseImageProps = { +exports.messageFileProps = exports.mediaProps = exports.videoProps = exports.imageProps = void 0; +// props for image +exports.imageProps = { sizeType: { type: Array, value: ['original', 'compressed'], @@ -11,9 +11,13 @@ exports.chooseImageProps = { type: Array, value: ['album', 'camera'], }, + showmenu: { + type: Boolean, + value: true, + }, }; -// props for choose video -exports.chooseVideoProps = { +// props for video +exports.videoProps = { capture: { type: Array, value: ['album', 'camera'], @@ -31,8 +35,8 @@ exports.chooseVideoProps = { value: 'back', }, }; -// props for choose media -exports.chooseMediaProps = { +// props for media +exports.mediaProps = { capture: { type: Array, value: ['album', 'camera'], @@ -50,7 +54,7 @@ exports.chooseMediaProps = { value: 'back', }, }; -// props for choose file -exports.chooseMessageFileProps = { +// props for file +exports.messageFileProps = { extension: null, }; diff --git a/miniprogram_npm/@vant/weapp/uploader/utils.js b/miniprogram_npm/@vant/weapp/uploader/utils.js index 89d7dd5..b8cf452 100644 --- a/miniprogram_npm/@vant/weapp/uploader/utils.js +++ b/miniprogram_npm/@vant/weapp/uploader/utils.js @@ -41,7 +41,7 @@ function isVideoFile(item) { } exports.isVideoFile = isVideoFile; function formatImage(res) { - return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { type: 'image', url: item.path, thumb: item.path })); }); + return res.tempFiles.map(function (item) { return (__assign(__assign({}, (0, utils_1.pickExclude)(item, ['path'])), { type: 'image', url: item.tempFilePath || item.path, thumb: item.tempFilePath || item.path })); }); } function formatVideo(res) { return [ @@ -59,13 +59,27 @@ function chooseFile(_a) { return new Promise(function (resolve, reject) { switch (accept) { case 'image': - wx.chooseImage({ - count: multiple ? Math.min(maxCount, 9) : 1, - sourceType: capture, - sizeType: sizeType, - success: function (res) { return resolve(formatImage(res)); }, - fail: reject, - }); + if (utils_1.isPC) { + wx.chooseImage({ + count: multiple ? Math.min(maxCount, 9) : 1, + sourceType: capture, + sizeType: sizeType, + success: function (res) { return resolve(formatImage(res)); }, + fail: reject, + }); + } + else { + wx.chooseMedia({ + count: multiple ? Math.min(maxCount, 9) : 1, + mediaType: ['image'], + sourceType: capture, + maxDuration: maxDuration, + sizeType: sizeType, + camera: camera, + success: function (res) { return resolve(formatImage(res)); }, + fail: reject, + }); + } break; case 'media': wx.chooseMedia({ diff --git a/miniprogram_npm/aegis-mp-sdk/index.js b/miniprogram_npm/aegis-mp-sdk/index.js new file mode 100644 index 0000000..1935573 --- /dev/null +++ b/miniprogram_npm/aegis-mp-sdk/index.js @@ -0,0 +1,23 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242898, function(require, module, exports) { +/** + * ================================================================ + * aegis-mp-sdk@1.36.7 (c) 2023 TencentCloud Real User Monitoring. + * Author pumpkincai. + * Last Release Time Tue Feb 21 2023 18:54:30 GMT+0800 (中国标准时间). + * Released under the MIT License. + * Thanks for supporting RUM & Aegis! + * ================================================================ + **/ +!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).Aegis=t()}(this,function(){var j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)};function e(e,t){function n(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var f=function(){return(f=Object.assign||function(e){for(var t,n=1,i=arguments.length;ns[0]&&t[1]=i||n.sendNow&&0n.maxCount||0===e||(n.count=n.count+1,(e=n.taskQueue.shift())&&n.sendRequest(e.options,null==e?void 0:e.success,null==e?void 0:e.fail))},this.complete=function(){1l){for(var t=e.split("\n"),n="",i=t.length-1;0<=i&&!(t[i]&&(n=t[i]+"\n"+n).length>l);i--);a.writeFile({filePath:s,data:n,success:r})}else a.appendFile({data:o,filePath:s,encoding:"utf8",success:r,fail:function(e){console.error(e)}})}})},Oe),pe=new o({name:"device",onNewAegis:function(t){return e=this,l=function(){return H(this,function(e){return this.setSystemInfo(t),this.refreshNetwork(t),this.setNetworkChange(t),[2]})},new(s=(s=a=void 0)||Promise)(function(n,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function o(e){try{r(l.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(i,o)}r((l=l.apply(e,a||[])).next())});var e,a,s,l},setSystemInfo:function(a){var s=this;try{l("getSystemInfo")&&w.getSystemInfo({success:function(e){var t=e.platform,n=e.model,i=e.windowHeight,o=e.windowWidth,r=e.screenWidth,r=void 0===r?0:r,e=e.screenHeight,e=void 0===e?0:e;a.extendBean("platform",s.getPlatFormType(t)),a.extendBean("model",n),a.extendBean("vp",Math.round(o)+" * "+Math.round(i)),a.extendBean("sr",Math.round(r)+" * "+Math.round(e))}})}catch(a){}},getPlatFormType:function(e){for(var t,n={android:/android/i,ios:/ios/i,windows:/windows/i,macos:/mac/i,devtools:/devtools/i},i=g.other,o=0;on))}))}),(p=this.lifeCycle.emit,d=this.config,function(e,t){var n,i=d.logCreated;return"function"==typeof i?(n=e.filter(function(e){return!1!==i(e)}),p("beforeWrite",n),t(n)):(p("beforeWrite",e),t(e))}),(f=this,setTimeout(function(){var e=f.config.pvUrl,n=void 0===e?"":e,e="undefined"!=typeof location?(null===location||void 0===location?void 0:location.pathname)+(null===location||void 0===location?void 0:location.hash):void 0;n&&e!==f.originFireUrl&&(f.sendPipeline([function(e,t){t({url:n,type:O.PV})}],O.PV)(null),e)&&location&&(f.originFireUrl=e)},100),function(e,t){t(e)}),(u=l=s=!1,c=[],(a=this).lifeCycle.on("onConfigChange",function(){r&&clearTimeout(r),r=setTimeout(function(){var e,n;!u&&a.config&&(u=!0,e=a.config.whiteListUrl,(n=void 0===e?"":e)&&a.sendPipeline([function(e,t){t({url:n,type:O.WHITE_LIST,success:function(e){l=!0;try{var t=e.data||JSON.parse(e),n=t.retcode,i=t.result,o=void 0===i?{}:i,r=(0===n&&(s=o.is_in_white_list,a.isWhiteList=s,0<=o.rate)&&o.rate<=1&&(a.config.random=o.rate,a.isGetSample=!1),a.isWhiteList&&c.length?se(a)(c.splice(0),function(){}):!a.isWhiteList&&c.length&&(c.length=0),a.config.onWhitelist);"function"==typeof r&&r(s)}catch(e){}},fail:function(){l=!0}})}],O.WHITE_LIST)(null),u=!1)},a.config.uin?50:500)}),a.lifeCycle.on("destroy",function(){c.length=0}),function(e,t){var n;s||null!=(n=null==(n=a.config)?void 0:n.api)&&n.reportRequest?t(e.concat(c.splice(0)).map(function(e){return re(e),e})):(n=e.filter(function(e){return e.level!==b.INFO&&e.level!==b.API_RESPONSE?(re(e),!0):(l||(c.push(e),200<=c.length&&(c.length=200)),!1)})).length&&t(n)}),function(e,t){try{var n=JSON.parse(JSON.stringify(e)),i=(m.lifeCycle.emit("beforeReport",n),m.config.beforeReport);(e="function"==typeof i?e.filter(function(e){return!1!==i(e)}):e).length&&t(e)}catch(e){}},se(this)]),this.eventPipeline=v([y(this,10),(o=this,function(e){o.sendPipeline([function(e,t){var n=e.map(function(e){return{name:e.name,ext1:e.ext1||o.config.ext1||"",ext2:e.ext2||o.config.ext2||"",ext3:e.ext3||o.config.ext3||""}});t({url:o.config.eventUrl+"?payload="+encodeURIComponent(JSON.stringify(n)),type:O.EVENT,log:e})}],O.EVENT)(e)})]),this.timeMap={},this.failRequestCount=0,this.customTimePipeline=v([y(this,10),(i=this,function(e){return i.sendPipeline([function(e,t){t({url:i.config.customTimeUrl+"?payload="+encodeURIComponent(JSON.stringify({custom:e})),type:O.CUSTOM,log:e})}],O.CUSTOM)(e)})]),this.config=(t=this.config,void 0===(e=e.hostUrl)&&(e="https://aegis.qq.com"),t.url=t.url||e+"/collect",t.offlineUrl=t.offlineUrl||e+"/offline",t.whiteListUrl=t.whiteListUrl||e+"/collect/whitelist",t.pvUrl=t.pvUrl||e+"/collect/pv",t.eventUrl=t.eventUrl||e+"/collect/events",t.speedUrl=t.speedUrl||e+"/speed",t.customTimeUrl=t.customTimeUrl||e+"/speed/custom",t.performanceUrl=t.performanceUrl||e+"/speed/performance",t.webVitalsUrl=t.webVitalsUrl||e+"/speed/webvitals",t.setDataReportUrl=t.SetDataReportUrl||e+"/speed/miniProgramData",t),A.instances.push(this)}function Ee(){return null!==Y&&Y.apply(this,arguments)||this}e(Ee,Y=r),Ee.prototype.defineApiProperty=function(){var e=this;Object.defineProperty(ve,"request",{get:function(){return e.hackHandler.bind(e)}})};function q(i,e,o){return null!=e&&e.length&&"object"==typeof i?e.reduce(function(e,t){var n=i[t];return n?e+(""===e?"\n":"\n\n")+o+" header "+t+": "+n:e},""):""}var U,Re,we=new o({name:"reportApiSpeed",override:!(Ee.prototype.hackHandler=function(e){var t=this,n=this.prefixHandler(e);return be(f(f({},n),{success:function(e){t.successHandler(e,n)},fail:function(e){t.failHandler(e,n)},complete:function(e){t.completeHandler(e,n)}}))}),onNewAegis:function(e){this.override||(this.override=!0,this.hackRequest(e.config),this.overrideCallFunction(e.config),this.overrideCallContainer(e.config))},hackRequest:function(u){var c=this;$({apiName:"request",success:function(e,t){var n,i,o,r,a,s,l;u.hostUrl&&-1s[0]&&t[1]=i||n.sendNow&&0n.maxCount||0===e||(n.count=n.count+1,(e=n.taskQueue.shift())&&n.sendRequest(e.options,null==e?void 0:e.success,null==e?void 0:e.fail))},this.complete=function(){1l){for(var t=e.split(\"\\n\"),n=\"\",i=t.length-1;0<=i&&!(t[i]&&(n=t[i]+\"\\n\"+n).length>l);i--);a.writeFile({filePath:s,data:n,success:r})}else a.appendFile({data:o,filePath:s,encoding:\"utf8\",success:r,fail:function(e){console.error(e)}})}})},Oe),pe=new o({name:\"device\",onNewAegis:function(t){return e=this,l=function(){return H(this,function(e){return this.setSystemInfo(t),this.refreshNetwork(t),this.setNetworkChange(t),[2]})},new(s=(s=a=void 0)||Promise)(function(n,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function o(e){try{r(l.throw(e))}catch(e){t(e)}}function r(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(i,o)}r((l=l.apply(e,a||[])).next())});var e,a,s,l},setSystemInfo:function(a){var s=this;try{l(\"getSystemInfo\")&&w.getSystemInfo({success:function(e){var t=e.platform,n=e.model,i=e.windowHeight,o=e.windowWidth,r=e.screenWidth,r=void 0===r?0:r,e=e.screenHeight,e=void 0===e?0:e;a.extendBean(\"platform\",s.getPlatFormType(t)),a.extendBean(\"model\",n),a.extendBean(\"vp\",Math.round(o)+\" * \"+Math.round(i)),a.extendBean(\"sr\",Math.round(r)+\" * \"+Math.round(e))}})}catch(a){}},getPlatFormType:function(e){for(var t,n={android:/android/i,ios:/ios/i,windows:/windows/i,macos:/mac/i,devtools:/devtools/i},i=g.other,o=0;on))}))}),(p=this.lifeCycle.emit,d=this.config,function(e,t){var n,i=d.logCreated;return\"function\"==typeof i?(n=e.filter(function(e){return!1!==i(e)}),p(\"beforeWrite\",n),t(n)):(p(\"beforeWrite\",e),t(e))}),(f=this,setTimeout(function(){var e=f.config.pvUrl,n=void 0===e?\"\":e,e=\"undefined\"!=typeof location?(null===location||void 0===location?void 0:location.pathname)+(null===location||void 0===location?void 0:location.hash):void 0;n&&e!==f.originFireUrl&&(f.sendPipeline([function(e,t){t({url:n,type:O.PV})}],O.PV)(null),e)&&location&&(f.originFireUrl=e)},100),function(e,t){t(e)}),(u=l=s=!1,c=[],(a=this).lifeCycle.on(\"onConfigChange\",function(){r&&clearTimeout(r),r=setTimeout(function(){var e,n;!u&&a.config&&(u=!0,e=a.config.whiteListUrl,(n=void 0===e?\"\":e)&&a.sendPipeline([function(e,t){t({url:n,type:O.WHITE_LIST,success:function(e){l=!0;try{var t=e.data||JSON.parse(e),n=t.retcode,i=t.result,o=void 0===i?{}:i,r=(0===n&&(s=o.is_in_white_list,a.isWhiteList=s,0<=o.rate)&&o.rate<=1&&(a.config.random=o.rate,a.isGetSample=!1),a.isWhiteList&&c.length?se(a)(c.splice(0),function(){}):!a.isWhiteList&&c.length&&(c.length=0),a.config.onWhitelist);\"function\"==typeof r&&r(s)}catch(e){}},fail:function(){l=!0}})}],O.WHITE_LIST)(null),u=!1)},a.config.uin?50:500)}),a.lifeCycle.on(\"destroy\",function(){c.length=0}),function(e,t){var n;s||null!=(n=null==(n=a.config)?void 0:n.api)&&n.reportRequest?t(e.concat(c.splice(0)).map(function(e){return re(e),e})):(n=e.filter(function(e){return e.level!==b.INFO&&e.level!==b.API_RESPONSE?(re(e),!0):(l||(c.push(e),200<=c.length&&(c.length=200)),!1)})).length&&t(n)}),function(e,t){try{var n=JSON.parse(JSON.stringify(e)),i=(m.lifeCycle.emit(\"beforeReport\",n),m.config.beforeReport);(e=\"function\"==typeof i?e.filter(function(e){return!1!==i(e)}):e).length&&t(e)}catch(e){}},se(this)]),this.eventPipeline=v([y(this,10),(o=this,function(e){o.sendPipeline([function(e,t){var n=e.map(function(e){return{name:e.name,ext1:e.ext1||o.config.ext1||\"\",ext2:e.ext2||o.config.ext2||\"\",ext3:e.ext3||o.config.ext3||\"\"}});t({url:o.config.eventUrl+\"?payload=\"+encodeURIComponent(JSON.stringify(n)),type:O.EVENT,log:e})}],O.EVENT)(e)})]),this.timeMap={},this.failRequestCount=0,this.customTimePipeline=v([y(this,10),(i=this,function(e){return i.sendPipeline([function(e,t){t({url:i.config.customTimeUrl+\"?payload=\"+encodeURIComponent(JSON.stringify({custom:e})),type:O.CUSTOM,log:e})}],O.CUSTOM)(e)})]),this.config=(t=this.config,void 0===(e=e.hostUrl)&&(e=\"https://aegis.qq.com\"),t.url=t.url||e+\"/collect\",t.offlineUrl=t.offlineUrl||e+\"/offline\",t.whiteListUrl=t.whiteListUrl||e+\"/collect/whitelist\",t.pvUrl=t.pvUrl||e+\"/collect/pv\",t.eventUrl=t.eventUrl||e+\"/collect/events\",t.speedUrl=t.speedUrl||e+\"/speed\",t.customTimeUrl=t.customTimeUrl||e+\"/speed/custom\",t.performanceUrl=t.performanceUrl||e+\"/speed/performance\",t.webVitalsUrl=t.webVitalsUrl||e+\"/speed/webvitals\",t.setDataReportUrl=t.SetDataReportUrl||e+\"/speed/miniProgramData\",t),A.instances.push(this)}function Ee(){return null!==Y&&Y.apply(this,arguments)||this}e(Ee,Y=r),Ee.prototype.defineApiProperty=function(){var e=this;Object.defineProperty(ve,\"request\",{get:function(){return e.hackHandler.bind(e)}})};function q(i,e,o){return null!=e&&e.length&&\"object\"==typeof i?e.reduce(function(e,t){var n=i[t];return n?e+(\"\"===e?\"\\n\":\"\\n\\n\")+o+\" header \"+t+\": \"+n:e},\"\"):\"\"}var U,Re,we=new o({name:\"reportApiSpeed\",override:!(Ee.prototype.hackHandler=function(e){var t=this,n=this.prefixHandler(e);return be(f(f({},n),{success:function(e){t.successHandler(e,n)},fail:function(e){t.failHandler(e,n)},complete:function(e){t.completeHandler(e,n)}}))}),onNewAegis:function(e){this.override||(this.override=!0,this.hackRequest(e.config),this.overrideCallFunction(e.config),this.overrideCallContainer(e.config))},hackRequest:function(u){var c=this;$({apiName:\"request\",success:function(e,t){var n,i,o,r,a,s,l;u.hostUrl&&-1=e?t:""+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new b(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var b=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},w=function(t,e){if(p(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new b(n)},O=v;O.l=S,O.i=p,O.w=function(t,e){return w(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var b=function(){function M(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(O.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return O},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=w(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return w(t)t.length)&&(e=t.length);for(var r=0,i=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}var c=function(){for(var t=" \t\r\n~!@#$%^&*()_+-=【】、{}|;':\",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄",e=new Map,r=0,i=t.length;r1&&(a+=h),f){if(o=!0,!r)break;var d=this._map.get(l)||"*";n=n.replace(new RegExp(l,"g"),d)}}return{isMatched:o,modifiedText:n}}},{key:"reset",value:function(){this._trieTree={},this._map=null}}]),e}(),l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var f={},u=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var r,i,n,o,s,a;t.exports=(a=a||function(t,e){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==l&&l.crypto&&(r=l.crypto),!r)try{r=f}catch(v){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(v){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(v){}}throw new Error("Native crypto module could not be used to get secure random number.")},n=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},s=o.lib={},a=s.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new c.init(r,e/2)}},d=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var e=t.length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new c.init(r,e)}},p=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},_=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,a=o/(4*s),h=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,l=t.min(4*h,o);if(h){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var c=i.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join("")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-o%4*2,h=a|c;i[n>>>2]|=h<<24-n%4*8,n++}return s.create(i,n)}(t,e,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},function(t){var e=a,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,a=t[e+0],c=t[e+1],d=t[e+2],p=t[e+3],_=t[e+4],y=t[e+5],v=t[e+6],g=t[e+7],w=t[e+8],B=t[e+9],k=t[e+10],m=t[e+11],b=t[e+12],x=t[e+13],S=t[e+14],A=t[e+15],H=o[0],M=o[1],z=o[2],C=o[3];H=h(H,M,z,C,a,7,s[0]),C=h(C,H,M,z,c,12,s[1]),z=h(z,C,H,M,d,17,s[2]),M=h(M,z,C,H,p,22,s[3]),H=h(H,M,z,C,_,7,s[4]),C=h(C,H,M,z,y,12,s[5]),z=h(z,C,H,M,v,17,s[6]),M=h(M,z,C,H,g,22,s[7]),H=h(H,M,z,C,w,7,s[8]),C=h(C,H,M,z,B,12,s[9]),z=h(z,C,H,M,k,17,s[10]),M=h(M,z,C,H,m,22,s[11]),H=h(H,M,z,C,b,7,s[12]),C=h(C,H,M,z,x,12,s[13]),z=h(z,C,H,M,S,17,s[14]),H=l(H,M=h(M,z,C,H,A,22,s[15]),z,C,c,5,s[16]),C=l(C,H,M,z,v,9,s[17]),z=l(z,C,H,M,m,14,s[18]),M=l(M,z,C,H,a,20,s[19]),H=l(H,M,z,C,y,5,s[20]),C=l(C,H,M,z,k,9,s[21]),z=l(z,C,H,M,A,14,s[22]),M=l(M,z,C,H,_,20,s[23]),H=l(H,M,z,C,B,5,s[24]),C=l(C,H,M,z,S,9,s[25]),z=l(z,C,H,M,p,14,s[26]),M=l(M,z,C,H,w,20,s[27]),H=l(H,M,z,C,x,5,s[28]),C=l(C,H,M,z,d,9,s[29]),z=l(z,C,H,M,g,14,s[30]),H=f(H,M=l(M,z,C,H,b,20,s[31]),z,C,y,4,s[32]),C=f(C,H,M,z,w,11,s[33]),z=f(z,C,H,M,m,16,s[34]),M=f(M,z,C,H,S,23,s[35]),H=f(H,M,z,C,c,4,s[36]),C=f(C,H,M,z,_,11,s[37]),z=f(z,C,H,M,g,16,s[38]),M=f(M,z,C,H,k,23,s[39]),H=f(H,M,z,C,x,4,s[40]),C=f(C,H,M,z,a,11,s[41]),z=f(z,C,H,M,p,16,s[42]),M=f(M,z,C,H,v,23,s[43]),H=f(H,M,z,C,B,4,s[44]),C=f(C,H,M,z,b,11,s[45]),z=f(z,C,H,M,A,16,s[46]),H=u(H,M=f(M,z,C,H,d,23,s[47]),z,C,a,6,s[48]),C=u(C,H,M,z,g,10,s[49]),z=u(z,C,H,M,S,15,s[50]),M=u(M,z,C,H,y,21,s[51]),H=u(H,M,z,C,b,6,s[52]),C=u(C,H,M,z,p,10,s[53]),z=u(z,C,H,M,k,15,s[54]),M=u(M,z,C,H,c,21,s[55]),H=u(H,M,z,C,w,6,s[56]),C=u(C,H,M,z,A,10,s[57]),z=u(z,C,H,M,v,15,s[58]),M=u(M,z,C,H,x,21,s[59]),H=u(H,M,z,C,_,6,s[60]),C=u(C,H,M,z,m,10,s[61]),z=u(z,C,H,M,d,15,s[62]),M=u(M,z,C,H,B,21,s[63]),o[0]=o[0]+H|0,o[1]=o[1]+M|0,o[2]=o[2]+z|0,o[3]=o[3]+C|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,h=0;h<4;h++){var l=c[h];c[h]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function h(t,e,r,i,n,o,s){var a=t+(e&r|~e&i)+n+s;return(a<>>32-o)+e}function l(t,e,r,i,n,o,s){var a=t+(e&i|r&~i)+n+s;return(a<>>32-o)+e}function f(t,e,r,i,n,o,s){var a=t+(e^r^i)+n+s;return(a<>>32-o)+e}function u(t,e,r,i,n,o,s){var a=t+(r^(e|~i))+n+s;return(a<>>32-o)+e}e.MD5=n._createHelper(c),e.HmacMD5=n._createHmacHelper(c)}(Math),function(){var t=a,e=t.lib,r=e.WordArray,i=e.Hasher,n=t.algo,o=[],s=n.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],a=r[3],c=r[4],h=0;h<80;h++){if(h<16)o[h]=0|t[e+h];else{var l=o[h-3]^o[h-8]^o[h-14]^o[h-16];o[h]=l<<1|l>>>31}var f=(i<<5|i>>>27)+c+o[h];f+=h<20?1518500249+(n&s|~n&a):h<40?1859775393+(n^s^a):h<60?(n&s|n&a|s&a)-1894007588:(n^s^a)-899497514,c=a,a=s,s=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),function(t){var e=a,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),i=2;i<=r;i++)if(!(e%i))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)e(i)&&(n<8&&(s[n]=r(t.pow(i,.5))),c[n]=r(t.pow(i,1/3)),n++),i++}();var h=[],l=o.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],l=r[5],f=r[6],u=r[7],d=0;d<64;d++){if(d<16)h[d]=0|t[e+d];else{var p=h[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=h[d-2],v=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;h[d]=_+h[d-7]+v+h[d-16]}var g=i&n^i&o^n&o,w=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),B=u+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&f)+c[d]+h[d];u=f,f=l,l=a,a=s+B|0,s=o,o=n,n=i,i=B+(w+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+u|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=n._createHelper(l),e.HmacSHA256=n._createHmacHelper(l)}(Math),function(){var t=a,e=t.lib.WordArray,r=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join("")},parse:function(t){for(var r=t.length,i=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return e.create(i,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join("")},parse:function(t){for(var r=t.length,n=[],o=0;o>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(n,2*r)}}}(),function(){if("function"==typeof ArrayBuffer){var t=a.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,i=[],n=0;n>>2]|=t[n]<<24-n%4*8;e.call(this,i,r)}else e.apply(this,arguments)}).prototype=t}}(), +/** @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. + */ +function(t){var e=a,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=i.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]),c=i.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]),h=i.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]),l=i.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]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=o.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,a,d,B,k,m,b,x,S,A,H,M=this._hash.words,z=f.words,C=u.words,E=s.words,R=c.words,P=h.words,D=l.words;for(m=o=M[0],b=a=M[1],x=d=M[2],S=B=M[3],A=k=M[4],r=0;r<80;r+=1)H=o+t[e+E[r]]|0,H+=r<16?p(a,d,B)+z[0]:r<32?_(a,d,B)+z[1]:r<48?y(a,d,B)+z[2]:r<64?v(a,d,B)+z[3]:g(a,d,B)+z[4],H=(H=w(H|=0,P[r]))+k|0,o=k,k=B,B=w(d,10),d=a,a=H,H=m+t[e+R[r]]|0,H+=r<16?g(b,x,S)+C[0]:r<32?v(b,x,S)+C[1]:r<48?y(b,x,S)+C[2]:r<64?_(b,x,S)+C[3]:p(b,x,S)+C[4],H=(H=w(H|=0,D[r]))+A|0,m=A,A=S,S=w(x,10),x=b,b=H;H=M[1]+d+S|0,M[1]=M[2]+B+A|0,M[2]=M[3]+k+m|0,M[3]=M[4]+o+b|0,M[4]=M[0]+a+x|0,M[0]=H},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,o=n.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return n},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function _(t,e,r){return t&e|~t&r}function y(t,e,r){return(t|~e)^r}function v(t,e,r){return t&r|e&~r}function g(t,e,r){return t^(e|~r)}function w(t,e){return t<>>32-e}e.RIPEMD160=n._createHelper(d),e.HmacRIPEMD160=n._createHmacHelper(d)}(),function(){var t=a,e=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=e.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=r.parse(e));var i=t.blockSize,n=4*i;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,c=s.words,h=0;h>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(M=r[n]).high^=s,M.low^=o}for(var a=0;a<24;a++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(M=r[u+5*_]).high,p^=M.low;var y=f[u];y.high=d,y.low=p}for(u=0;u<5;u++){var v=f[(u+4)%5],g=f[(u+1)%5],w=g.high,B=g.low;for(d=v.high^(w<<1|B>>>31),p=v.low^(B<<1|w>>>31),_=0;_<5;_++)(M=r[u+5*_]).high^=d,M.low^=p}for(var k=1;k<25;k++){var m=(M=r[k]).high,b=M.low,x=c[k];x<32?(d=m<>>32-x,p=b<>>32-x):(d=b<>>64-x,p=m<>>64-x);var S=f[h[k]];S.high=d,S.low=p}var A=f[0],H=r[0];for(A.high=H.high,A.low=H.low,u=0;u<5;u++)for(_=0;_<5;_++){var M=r[k=u+5*_],z=f[k],C=f[(u+1)%5+5*_],E=f[(u+2)%5+5*_];M.high=z.high^~C.high&E.high,M.low=z.low^~C.low&E.low}M=r[0];var R=l[a];M.high^=R.high,M.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,h=[],l=0;l>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),h.push(d),h.push(u)}return new i.init(h,a)},clone:function(){for(var t=n.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=n._createHelper(u),e.HmacSHA3=n._createHmacHelper(u)}(Math),function(){var t=a,e=t.lib.Hasher,r=t.x64,i=r.Word,n=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=s()}();var l=o.SHA512=e.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],l=r[5],f=r[6],u=r[7],d=i.high,p=i.low,_=n.high,y=n.low,v=o.high,g=o.low,w=s.high,B=s.low,k=a.high,m=a.low,b=l.high,x=l.low,S=f.high,A=f.low,H=u.high,M=u.low,z=d,C=p,E=_,R=y,P=v,D=g,F=w,T=B,I=k,O=m,L=b,W=x,U=S,j=A,K=H,X=M,N=0;N<80;N++){var V,Z,$=h[N];if(N<16)Z=$.high=0|t[e+2*N],V=$.low=0|t[e+2*N+1];else{var q=h[N-15],G=q.high,J=q.low,Q=(G>>>1|J<<31)^(G>>>8|J<<24)^G>>>7,Y=(J>>>1|G<<31)^(J>>>8|G<<24)^(J>>>7|G<<25),tt=h[N-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=h[N-7],st=ot.high,at=ot.low,ct=h[N-16],ht=ct.high,lt=ct.low;Z=(Z=(Z=Q+st+((V=Y+at)>>>0>>0?1:0))+it+((V+=nt)>>>0>>0?1:0))+ht+((V+=lt)>>>0>>0?1:0),$.high=Z,$.low=V}var ft,ut=I&L^~I&U,dt=O&W^~O&j,pt=z&E^z&P^E&P,_t=C&R^C&D^R&D,yt=(z>>>28|C<<4)^(z<<30|C>>>2)^(z<<25|C>>>7),vt=(C>>>28|z<<4)^(C<<30|z>>>2)^(C<<25|z>>>7),gt=(I>>>14|O<<18)^(I>>>18|O<<14)^(I<<23|O>>>9),wt=(O>>>14|I<<18)^(O>>>18|I<<14)^(O<<23|I>>>9),Bt=c[N],kt=Bt.high,mt=Bt.low,bt=K+gt+((ft=X+wt)>>>0>>0?1:0),xt=vt+_t;K=U,X=j,U=L,j=W,L=I,W=O,I=F+(bt=(bt=(bt=bt+ut+((ft+=dt)>>>0

>>0?1:0))+kt+((ft+=mt)>>>0>>0?1:0))+Z+((ft+=V)>>>0>>0?1:0))+((O=T+ft|0)>>>0>>0?1:0)|0,F=P,T=D,P=E,D=R,E=z,R=C,z=bt+(yt+pt+(xt>>>0>>0?1:0))+((C=ft+xt|0)>>>0>>0?1:0)|0}p=i.low=p+C,i.high=d+z+(p>>>0>>0?1:0),y=n.low=y+R,n.high=_+E+(y>>>0>>0?1:0),g=o.low=g+D,o.high=v+P+(g>>>0>>0?1:0),B=s.low=B+T,s.high=w+F+(B>>>0>>0?1:0),m=a.low=m+O,a.high=k+I+(m>>>0>>0?1:0),x=l.low=x+W,l.high=b+L+(x>>>0>>0?1:0),A=f.low=A+j,f.high=S+U+(A>>>0>>0?1:0),M=u.low=M+X,u.high=H+K+(M>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l)}(),function(){var t=a,e=t.x64,r=e.Word,i=e.WordArray,n=t.algo,o=n.SHA512,s=n.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),a.lib.Cipher||function(t){var e=a,r=e.lib,i=r.Base,n=r.WordArray,o=r.BufferedBlockAlgorithm,s=e.enc,c=(s.Utf8,s.Base64),h=e.algo.EvpKDF,l=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?w:v}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),f=(r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),u=r.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),d=f.CBC=function(){var t=u.extend();function e(t,e,r){var i,n=this._iv;n?(i=n,this._iv=void 0):i=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},_=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:p}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,i=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=i.createEncryptor:(t=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(i,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?n.create([1398893684,1701076831]).concat(r).concat(e):e).toString(c)},parse:function(t){var e,r=c.parse(t),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(e=n.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),_.create({ciphertext:r,salt:e})}},v=r.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),o=n.finalize(e),s=n.cfg;return _.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),g=(e.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=n.random(8));var o=h.create({keySize:e+r}).compute(t,i),s=n.create(o.words.slice(e),4*r);return o.sigBytes=4*e,_.create({key:o,iv:s,salt:i})}},w=r.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:g}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var o=v.encrypt.call(this,t,e,n.key,i);return o.mixIn(n),o},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,v.decrypt.call(this,t,e,n.key,i)}})}(),a.mode.CFB=function(){var t=a.lib.BlockCipherMode.extend();function e(t,e,r,i){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,i.encryptBlock(n,0);for(var s=0;s>>2]|=n<<24-o%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},a.pad.Iso10126={pad:function(t,e){var r=4*e,i=r-t.sigBytes%r;t.concat(a.lib.WordArray.random(i-1)).concat(a.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},a.pad.Iso97971={pad:function(t,e){t.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(t,e)},unpad:function(t){a.pad.ZeroPadding.unpad(t),t.sigBytes--}},a.mode.OFB=(r=a.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s>>8^255&p^99,i[r]=p,n[p]=r;var _=t[r],y=t[_],v=t[y],g=257*t[p]^16843008*p;o[r]=g<<24|g>>>8,s[r]=g<<16|g>>>16,c[r]=g<<8|g>>>24,h[r]=g,g=16843009*v^65537*y^257*_^16843008*r,l[p]=g<<24|g>>>8,f[p]=g<<16|g>>>16,u[p]=g<<8|g>>>24,d[p]=g,r?(r=_^t[t[t[v^_]]],a^=t[t[a]]):r=a=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(h=i[h>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[255&h]):(h=i[(h=h<<8|h>>>24)>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[255&h],h^=p[s/r|0]<<24),o[s]=o[s-r]^h);for(var a=this._invKeySchedule=[],c=0;c>>24]]^f[i[h>>>16&255]]^u[i[h>>>8&255]]^d[i[255&h]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,s,c,h,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,l,f,u,d,n),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,a){for(var c=this._nRounds,h=t[e]^r[0],l=t[e+1]^r[1],f=t[e+2]^r[2],u=t[e+3]^r[3],d=4,p=1;p>>24]^n[l>>>16&255]^o[f>>>8&255]^s[255&u]^r[d++],y=i[l>>>24]^n[f>>>16&255]^o[u>>>8&255]^s[255&h]^r[d++],v=i[f>>>24]^n[u>>>16&255]^o[h>>>8&255]^s[255&l]^r[d++],g=i[u>>>24]^n[h>>>16&255]^o[l>>>8&255]^s[255&f]^r[d++];h=_,l=y,f=v,u=g}_=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[d++],y=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&h])^r[d++],v=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^r[d++],g=(a[u>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^r[d++],t[e]=_,t[e+1]=y,t[e+2]=v,t[e+3]=g},keySize:8});t.AES=e._createHelper(_)}(),function(){var t=a,e=t.lib,r=e.WordArray,i=e.BlockCipher,n=t.algo,o=[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],s=[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],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{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}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=n.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=o[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var h=n[a]=[],l=c[a];for(r=0;r<24;r++)h[r/6|0]|=e[(s[r]-1+l)%28]<<31-r%6,h[4+(r/6|0)]|=e[28+(s[r+24]-1+l)%28]<<31-r%6;for(h[0]=h[0]<<1|h[0]>>>31,r=1;r<7;r++)h[r]=h[r]>>>4*(r-1)+3;h[7]=h[7]<<5|h[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=h[c][((s^n[c])&l[c])>>>0];this._lBlock=s,this._rBlock=o^a}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<192.");var e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),n=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=f.createEncryptor(r.create(e)),this._des2=f.createEncryptor(r.create(i)),this._des3=f.createEncryptor(r.create(n))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),function(){var t=a,e=t.lib.StreamCipher,r=t.algo,i=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;n=0;for(var o=0;n<256;n++){var s=n%r,a=e[s>>>2]>>>24-s%4*8&255;o=(o+i[n]+a)%256;var c=i[n];i[n]=i[o],i[o]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=n.call(this)},keySize:8,ivSize:0});function n(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}t.RC4=e._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)n.call(this)}});t.RC4Drop=e._createHelper(o)}(), +/** @preserve + * Counter block mode compatible with Dr Brian Gladman fileenc.c + * derived from CryptoJS.mode.CTR + * Jan Hruby jhruby.web@gmail.com + */ +a.mode.CTRGladman=function(){var t=a.lib.BlockCipherMode.extend();function e(t){if(255==(t>>24&255)){var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}else t+=1<<24;return t}var r=t.Encryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var a=s.slice(0);i.encryptBlock(a,0);for(var c=0;c>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=h>>>16|4294901760&l,u=l<<16|65535&h;for(n[0]^=h,n[1]^=f,n[2]^=l,n[3]^=u,n[4]^=h,n[5]^=f,n[6]^=l,n[7]^=u,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(t,e){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,r=0;r<8;r++)n[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],s=65535&i,a=i>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&i)*i|0)+((65535&i)*i|0);o[r]=c^h}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=e._createHelper(s)}(),a.mode.CTR=function(){var t=a.lib.BlockCipherMode.extend(),e=t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[i-1]=o[i-1]+1|0;for(var a=0;a>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=h>>>16|4294901760&l,u=l<<16|65535&h;for(i[0]^=h,i[1]^=f,i[2]^=l,i[3]^=u,i[4]^=h,i[5]^=f,i[6]^=l,i[7]^=u,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,r=0;r<8;r++)n[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],s=65535&i,a=i>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&i)*i|0)+((65535&i)*i|0);o[r]=c^h}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=e._createHelper(s)}(),a.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){var e=t.words,r=t.sigBytes-1;for(r=t.sigBytes-1;r>=0;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},a)}));return function(){function e(r){t(this,e);var i=r.logger,n=r.isArray,o=r.isMap,s=r.isDevMode;this._isArray=n,this._isMap=o,this._isDevMode=s,i.log("TIMProfanityFilterPlugin.VERSION:".concat("0.9.0")),this._interceptProfanityList=[],this._interceptFilter=null,this._interceptRegExpList=[],this._replacingProfanityMap=new Map,this._replacingFilter=null,this._replacingRegExpMap=new Map,this._key="",this._iv="",this._decryptOptions=void 0}return r(e,[{key:"onToken",value:function(t){this._key=u.enc.Utf8.parse(t.slice(0,32)),this._iv=this._key,this._decryptOptions={iv:this._iv,mode:u.mode.CBC,padding:u.pad.Pkcs7}}},{key:"onLexiconSliced",value:function(t){if(this._isArray(t)&&0!==t.length){var e,r,i,n=a(t);try{for(n.s();!(i=n.n()).done;){var o=i.value,s=o.filterType,c=o.profanityType,h=o.profanity,l=o.replacement;e=this._getDecryptedString(h),r=this._getDecryptedString(l),1===s?1===c?this._interceptProfanityList.push(e):2===c&&this._interceptRegExpList.push(e):2===s&&(1===c?this._replacingProfanityMap.set(e,r):2===c&&this._replacingRegExpMap.set(e,r))}}catch(f){n.e(f)}finally{n.f()}}}},{key:"_getDecryptedString",value:function(t){var e=u.AES.decrypt(t,this._key,this._decryptOptions);return u.enc.Utf8.stringify(e).toLowerCase()}},{key:"onLexiconCompleted",value:function(t){this.onLexiconSliced(t),this._interceptFilter=new h({input:this._interceptProfanityList,isArray:this._isArray,isMap:this._isMap}),this._replacingFilter=new h({input:this._replacingProfanityMap,isArray:this._isArray,isMap:this._isMap}),!0===this._isDevMode&&(console.log("TIMProfanityFilterPlugin _interceptProfanityList ->",this._interceptProfanityList),console.log("TIMProfanityFilterPlugin _interceptRegExpList ->",this._interceptRegExpList),console.log("TIMProfanityFilterPlugin _replacingProfanityMap ->",this._replacingProfanityMap),console.log("TIMProfanityFilterPlugin _replacingRegExpMap ->",this._replacingRegExpMap))}},{key:"filter",value:function(t){var e={type:0,modifiedText:t};if(!0===this._interceptFilter.filter({text:t,replacingEnabled:!1}).isMatched)return e.type=1,e;for(var r=!1,n=0,o=this._interceptRegExpList.length;nt.length)&&(e=t.length);for(var r=0,i=new Array(e);r=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:n}}throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}var s,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){c=!0,s=t},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}var c=function(){for(var t=\" \\t\\r\\n~!@#$%^&*()_+-=【】、{}|;':\\\",。、《》?αβγδεζηθικλμνξοπρστυφχψωΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ。,、;:?!…—·ˉ¨‘’“”々~‖∶"'`|〃〔〕〈〉《》「」『』.〖〗【】()[]{}ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫ⒈⒉⒊⒋⒌⒍⒎⒏⒐⒑⒒⒓⒔⒕⒖⒗⒘⒙⒚⒛㈠㈡㈢㈣㈤㈥㈦㈧㈨㈩①②③④⑤⑥⑦⑧⑨⑩⑴⑵⑶⑷⑸⑹⑺⑻⑼⑽⑾⑿⒀⒁⒂⒃⒄⒅⒆⒇≈≡≠=≤≥<>≮≯∷±+-×÷/∫∮∝∞∧∨∑∏∪∩∈∵∴⊥∥∠⌒⊙≌∽√§№☆★○●◎◇◆□℃‰€■△▲※→←↑↓〓¤°#&@\︿_ ̄―♂♀┌┍┎┐┑┒┓─┄┈├┝┞┟┠┡┢┣│┆┊┬┭┮┯┰┱┲┳┼┽┾┿╀╁╂╃└┕┖┗┘┙┚┛━┅┉┤┥┦┧┨┩┪┫┃┇┋┴┵┶┷┸┹┺┻╋╊╉╈╇╆╅╄\",e=new Map,r=0,i=t.length;r1&&(a+=h),f){if(o=!0,!r)break;var d=this._map.get(l)||\"*\";n=n.replace(new RegExp(l,\"g\"),d)}}return{isMatched:o,modifiedText:n}}},{key:\"reset\",value:function(){this._trieTree={},this._map=null}}]),e}(),l=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};var f={},u=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t,e){var r,i,n,o,s,a;t.exports=(a=a||function(t,e){var r;if(\"undefined\"!=typeof window&&window.crypto&&(r=window.crypto),!r&&\"undefined\"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==l&&l.crypto&&(r=l.crypto),!r)try{r=f}catch(v){}var i=function(){if(r){if(\"function\"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(v){}if(\"function\"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(v){}}throw new Error(\"Native crypto module could not be used to get secure random number.\")},n=Object.create||function(){function t(){}return function(e){var r;return t.prototype=e,r=new t,t.prototype=null,r}}(),o={},s=o.lib={},a=s.Base={extend:function(t){var e=n(this);return t&&e.mixIn(t),e.hasOwnProperty(\"init\")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty(\"toString\")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}},c=s.WordArray=a.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=null!=e?e:4*t.length},toString:function(t){return(t||u).stringify(this)},concat:function(t){var e=this.words,r=t.words,i=this.sigBytes,n=t.sigBytes;if(this.clamp(),i%4)for(var o=0;o>>2]>>>24-o%4*8&255;e[i+o>>>2]|=s<<24-(i+o)%4*8}else for(o=0;o>>2]=r[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,r=this.sigBytes;e[r>>>2]&=4294967295<<32-r%4*8,e.length=t.ceil(r/4)},clone:function(){var t=a.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],r=0;r>>2]>>>24-n%4*8&255;i.push((o>>>4).toString(16)),i.push((15&o).toString(16))}return i.join(\"\")},parse:function(t){for(var e=t.length,r=[],i=0;i>>3]|=parseInt(t.substr(i,2),16)<<24-i%8*4;return new c.init(r,e/2)}},d=h.Latin1={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>24-n%4*8&255;i.push(String.fromCharCode(o))}return i.join(\"\")},parse:function(t){for(var e=t.length,r=[],i=0;i>>2]|=(255&t.charCodeAt(i))<<24-i%4*8;return new c.init(r,e)}},p=h.Utf8={stringify:function(t){try{return decodeURIComponent(escape(d.stringify(t)))}catch(e){throw new Error(\"Malformed UTF-8 data\")}},parse:function(t){return d.parse(unescape(encodeURIComponent(t)))}},_=s.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(t){\"string\"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var r,i=this._data,n=i.words,o=i.sigBytes,s=this.blockSize,a=o/(4*s),h=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,l=t.min(4*h,o);if(h){for(var f=0;f>>2]>>>24-o%4*8&255)<<16|(e[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|e[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a>>6*(3-a)&63));var c=i.charAt(64);if(c)for(;n.length%4;)n.push(c);return n.join(\"\")},parse:function(t){var e=t.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var n=0;n>>6-o%4*2,h=a|c;i[n>>>2]|=h<<24-n%4*8,n++}return s.create(i,n)}(t,e,i)},_map:\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\"},function(t){var e=a,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=n.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o=this._hash.words,a=t[e+0],c=t[e+1],d=t[e+2],p=t[e+3],_=t[e+4],y=t[e+5],v=t[e+6],g=t[e+7],w=t[e+8],B=t[e+9],k=t[e+10],m=t[e+11],b=t[e+12],x=t[e+13],S=t[e+14],A=t[e+15],H=o[0],M=o[1],z=o[2],C=o[3];H=h(H,M,z,C,a,7,s[0]),C=h(C,H,M,z,c,12,s[1]),z=h(z,C,H,M,d,17,s[2]),M=h(M,z,C,H,p,22,s[3]),H=h(H,M,z,C,_,7,s[4]),C=h(C,H,M,z,y,12,s[5]),z=h(z,C,H,M,v,17,s[6]),M=h(M,z,C,H,g,22,s[7]),H=h(H,M,z,C,w,7,s[8]),C=h(C,H,M,z,B,12,s[9]),z=h(z,C,H,M,k,17,s[10]),M=h(M,z,C,H,m,22,s[11]),H=h(H,M,z,C,b,7,s[12]),C=h(C,H,M,z,x,12,s[13]),z=h(z,C,H,M,S,17,s[14]),H=l(H,M=h(M,z,C,H,A,22,s[15]),z,C,c,5,s[16]),C=l(C,H,M,z,v,9,s[17]),z=l(z,C,H,M,m,14,s[18]),M=l(M,z,C,H,a,20,s[19]),H=l(H,M,z,C,y,5,s[20]),C=l(C,H,M,z,k,9,s[21]),z=l(z,C,H,M,A,14,s[22]),M=l(M,z,C,H,_,20,s[23]),H=l(H,M,z,C,B,5,s[24]),C=l(C,H,M,z,S,9,s[25]),z=l(z,C,H,M,p,14,s[26]),M=l(M,z,C,H,w,20,s[27]),H=l(H,M,z,C,x,5,s[28]),C=l(C,H,M,z,d,9,s[29]),z=l(z,C,H,M,g,14,s[30]),H=f(H,M=l(M,z,C,H,b,20,s[31]),z,C,y,4,s[32]),C=f(C,H,M,z,w,11,s[33]),z=f(z,C,H,M,m,16,s[34]),M=f(M,z,C,H,S,23,s[35]),H=f(H,M,z,C,c,4,s[36]),C=f(C,H,M,z,_,11,s[37]),z=f(z,C,H,M,g,16,s[38]),M=f(M,z,C,H,k,23,s[39]),H=f(H,M,z,C,x,4,s[40]),C=f(C,H,M,z,a,11,s[41]),z=f(z,C,H,M,p,16,s[42]),M=f(M,z,C,H,v,23,s[43]),H=f(H,M,z,C,B,4,s[44]),C=f(C,H,M,z,b,11,s[45]),z=f(z,C,H,M,A,16,s[46]),H=u(H,M=f(M,z,C,H,d,23,s[47]),z,C,a,6,s[48]),C=u(C,H,M,z,g,10,s[49]),z=u(z,C,H,M,S,15,s[50]),M=u(M,z,C,H,y,21,s[51]),H=u(H,M,z,C,b,6,s[52]),C=u(C,H,M,z,p,10,s[53]),z=u(z,C,H,M,k,15,s[54]),M=u(M,z,C,H,c,21,s[55]),H=u(H,M,z,C,w,6,s[56]),C=u(C,H,M,z,A,10,s[57]),z=u(z,C,H,M,v,15,s[58]),M=u(M,z,C,H,x,21,s[59]),H=u(H,M,z,C,_,6,s[60]),C=u(C,H,M,z,m,10,s[61]),z=u(z,C,H,M,d,15,s[62]),M=u(M,z,C,H,B,21,s[63]),o[0]=o[0]+H|0,o[1]=o[1]+M|0,o[2]=o[2]+z|0,o[3]=o[3]+C|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;r[n>>>5]|=128<<24-n%32;var o=t.floor(i/4294967296),s=i;r[15+(n+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),r[14+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),e.sigBytes=4*(r.length+1),this._process();for(var a=this._hash,c=a.words,h=0;h<4;h++){var l=c[h];c[h]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return a},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function h(t,e,r,i,n,o,s){var a=t+(e&r|~e&i)+n+s;return(a<>>32-o)+e}function l(t,e,r,i,n,o,s){var a=t+(e&i|r&~i)+n+s;return(a<>>32-o)+e}function f(t,e,r,i,n,o,s){var a=t+(e^r^i)+n+s;return(a<>>32-o)+e}function u(t,e,r,i,n,o,s){var a=t+(r^(e|~i))+n+s;return(a<>>32-o)+e}e.MD5=n._createHelper(c),e.HmacMD5=n._createHmacHelper(c)}(Math),function(){var t=a,e=t.lib,r=e.WordArray,i=e.Hasher,n=t.algo,o=[],s=n.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],s=r[2],a=r[3],c=r[4],h=0;h<80;h++){if(h<16)o[h]=0|t[e+h];else{var l=o[h-3]^o[h-8]^o[h-14]^o[h-16];o[h]=l<<1|l>>>31}var f=(i<<5|i>>>27)+c+o[h];f+=h<20?1518500249+(n&s|~n&a):h<40?1859775393+(n^s^a):h<60?(n&s|n&a|s&a)-1894007588:(n^s^a)-899497514,c=a,a=s,s=n<<30|n>>>2,n=i,i=f}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=Math.floor(r/4294967296),e[15+(i+64>>>9<<4)]=r,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=i.clone.call(this);return t._hash=this._hash.clone(),t}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),function(t){var e=a,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=[],c=[];!function(){function e(e){for(var r=t.sqrt(e),i=2;i<=r;i++)if(!(e%i))return!1;return!0}function r(t){return 4294967296*(t-(0|t))|0}for(var i=2,n=0;n<64;)e(i)&&(n<8&&(s[n]=r(t.pow(i,.5))),c[n]=r(t.pow(i,1/3)),n++),i++}();var h=[],l=o.SHA256=n.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],l=r[5],f=r[6],u=r[7],d=0;d<64;d++){if(d<16)h[d]=0|t[e+d];else{var p=h[d-15],_=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,y=h[d-2],v=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;h[d]=_+h[d-7]+v+h[d-16]}var g=i&n^i&o^n&o,w=(i<<30|i>>>2)^(i<<19|i>>>13)^(i<<10|i>>>22),B=u+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&f)+c[d]+h[d];u=f,f=l,l=a,a=s+B|0,s=o,o=n,n=i,i=B+(w+g)|0}r[0]=r[0]+i|0,r[1]=r[1]+n|0,r[2]=r[2]+o|0,r[3]=r[3]+s|0,r[4]=r[4]+a|0,r[5]=r[5]+l|0,r[6]=r[6]+f|0,r[7]=r[7]+u|0},_doFinalize:function(){var e=this._data,r=e.words,i=8*this._nDataBytes,n=8*e.sigBytes;return r[n>>>5]|=128<<24-n%32,r[14+(n+64>>>9<<4)]=t.floor(i/4294967296),r[15+(n+64>>>9<<4)]=i,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA256=n._createHelper(l),e.HmacSHA256=n._createHmacHelper(l)}(Math),function(){var t=a,e=t.lib.WordArray,r=t.enc;function i(t){return t<<8&4278255360|t>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(t){for(var e=t.words,r=t.sigBytes,i=[],n=0;n>>2]>>>16-n%4*8&65535;i.push(String.fromCharCode(o))}return i.join(\"\")},parse:function(t){for(var r=t.length,i=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return e.create(i,2*r)}},r.Utf16LE={stringify:function(t){for(var e=t.words,r=t.sigBytes,n=[],o=0;o>>2]>>>16-o%4*8&65535);n.push(String.fromCharCode(s))}return n.join(\"\")},parse:function(t){for(var r=t.length,n=[],o=0;o>>1]|=i(t.charCodeAt(o)<<16-o%2*16);return e.create(n,2*r)}}}(),function(){if(\"function\"==typeof ArrayBuffer){var t=a.lib.WordArray,e=t.init;(t.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||\"undefined\"!=typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var r=t.byteLength,i=[],n=0;n>>2]|=t[n]<<24-n%4*8;e.call(this,i,r)}else e.apply(this,arguments)}).prototype=t}}(),\n/** @preserve\n (c) 2012 by C��dric Mesnil. All rights reserved.\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n - 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 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.\n */\nfunction(t){var e=a,r=e.lib,i=r.WordArray,n=r.Hasher,o=e.algo,s=i.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]),c=i.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]),h=i.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]),l=i.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]),f=i.create([0,1518500249,1859775393,2400959708,2840853838]),u=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=o.RIPEMD160=n.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var r=0;r<16;r++){var i=e+r,n=t[i];t[i]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var o,a,d,B,k,m,b,x,S,A,H,M=this._hash.words,z=f.words,C=u.words,E=s.words,R=c.words,P=h.words,D=l.words;for(m=o=M[0],b=a=M[1],x=d=M[2],S=B=M[3],A=k=M[4],r=0;r<80;r+=1)H=o+t[e+E[r]]|0,H+=r<16?p(a,d,B)+z[0]:r<32?_(a,d,B)+z[1]:r<48?y(a,d,B)+z[2]:r<64?v(a,d,B)+z[3]:g(a,d,B)+z[4],H=(H=w(H|=0,P[r]))+k|0,o=k,k=B,B=w(d,10),d=a,a=H,H=m+t[e+R[r]]|0,H+=r<16?g(b,x,S)+C[0]:r<32?v(b,x,S)+C[1]:r<48?y(b,x,S)+C[2]:r<64?_(b,x,S)+C[3]:p(b,x,S)+C[4],H=(H=w(H|=0,D[r]))+A|0,m=A,A=S,S=w(x,10),x=b,b=H;H=M[1]+d+S|0,M[1]=M[2]+B+A|0,M[2]=M[3]+k+m|0,M[3]=M[4]+o+b|0,M[4]=M[0]+a+x|0,M[0]=H},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;e[i>>>5]|=128<<24-i%32,e[14+(i+64>>>9<<4)]=16711935&(r<<8|r>>>24)|4278255360&(r<<24|r>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,o=n.words,s=0;s<5;s++){var a=o[s];o[s]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return n},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,r){return t^e^r}function _(t,e,r){return t&e|~t&r}function y(t,e,r){return(t|~e)^r}function v(t,e,r){return t&r|e&~r}function g(t,e,r){return t^(e|~r)}function w(t,e){return t<>>32-e}e.RIPEMD160=n._createHelper(d),e.HmacRIPEMD160=n._createHmacHelper(d)}(),function(){var t=a,e=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=e.extend({init:function(t,e){t=this._hasher=new t.init,\"string\"==typeof e&&(e=r.parse(e));var i=t.blockSize,n=4*i;e.sigBytes>n&&(e=t.finalize(e)),e.clamp();for(var o=this._oKey=e.clone(),s=this._iKey=e.clone(),a=o.words,c=s.words,h=0;h>>24)|4278255360&(o<<24|o>>>8),s=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),(M=r[n]).high^=s,M.low^=o}for(var a=0;a<24;a++){for(var u=0;u<5;u++){for(var d=0,p=0,_=0;_<5;_++)d^=(M=r[u+5*_]).high,p^=M.low;var y=f[u];y.high=d,y.low=p}for(u=0;u<5;u++){var v=f[(u+4)%5],g=f[(u+1)%5],w=g.high,B=g.low;for(d=v.high^(w<<1|B>>>31),p=v.low^(B<<1|w>>>31),_=0;_<5;_++)(M=r[u+5*_]).high^=d,M.low^=p}for(var k=1;k<25;k++){var m=(M=r[k]).high,b=M.low,x=c[k];x<32?(d=m<>>32-x,p=b<>>32-x):(d=b<>>64-x,p=m<>>64-x);var S=f[h[k]];S.high=d,S.low=p}var A=f[0],H=r[0];for(A.high=H.high,A.low=H.low,u=0;u<5;u++)for(_=0;_<5;_++){var M=r[k=u+5*_],z=f[k],C=f[(u+1)%5+5*_],E=f[(u+2)%5+5*_];M.high=z.high^~C.high&E.high,M.low=z.low^~C.low&E.low}M=r[0];var R=l[a];M.high^=R.high,M.low^=R.low}},_doFinalize:function(){var e=this._data,r=e.words,n=(this._nDataBytes,8*e.sigBytes),o=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/o)*o>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var s=this._state,a=this.cfg.outputLength/8,c=a/8,h=[],l=0;l>>24)|4278255360&(u<<24|u>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),h.push(d),h.push(u)}return new i.init(h,a)},clone:function(){for(var t=n.clone.call(this),e=t._state=this._state.slice(0),r=0;r<25;r++)e[r]=e[r].clone();return t}});e.SHA3=n._createHelper(u),e.HmacSHA3=n._createHmacHelper(u)}(Math),function(){var t=a,e=t.lib.Hasher,r=t.x64,i=r.Word,n=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],h=[];!function(){for(var t=0;t<80;t++)h[t]=s()}();var l=o.SHA512=e.extend({_doReset:function(){this._hash=new n.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(t,e){for(var r=this._hash.words,i=r[0],n=r[1],o=r[2],s=r[3],a=r[4],l=r[5],f=r[6],u=r[7],d=i.high,p=i.low,_=n.high,y=n.low,v=o.high,g=o.low,w=s.high,B=s.low,k=a.high,m=a.low,b=l.high,x=l.low,S=f.high,A=f.low,H=u.high,M=u.low,z=d,C=p,E=_,R=y,P=v,D=g,F=w,T=B,I=k,O=m,L=b,W=x,U=S,j=A,K=H,X=M,N=0;N<80;N++){var V,Z,$=h[N];if(N<16)Z=$.high=0|t[e+2*N],V=$.low=0|t[e+2*N+1];else{var q=h[N-15],G=q.high,J=q.low,Q=(G>>>1|J<<31)^(G>>>8|J<<24)^G>>>7,Y=(J>>>1|G<<31)^(J>>>8|G<<24)^(J>>>7|G<<25),tt=h[N-2],et=tt.high,rt=tt.low,it=(et>>>19|rt<<13)^(et<<3|rt>>>29)^et>>>6,nt=(rt>>>19|et<<13)^(rt<<3|et>>>29)^(rt>>>6|et<<26),ot=h[N-7],st=ot.high,at=ot.low,ct=h[N-16],ht=ct.high,lt=ct.low;Z=(Z=(Z=Q+st+((V=Y+at)>>>0>>0?1:0))+it+((V+=nt)>>>0>>0?1:0))+ht+((V+=lt)>>>0>>0?1:0),$.high=Z,$.low=V}var ft,ut=I&L^~I&U,dt=O&W^~O&j,pt=z&E^z&P^E&P,_t=C&R^C&D^R&D,yt=(z>>>28|C<<4)^(z<<30|C>>>2)^(z<<25|C>>>7),vt=(C>>>28|z<<4)^(C<<30|z>>>2)^(C<<25|z>>>7),gt=(I>>>14|O<<18)^(I>>>18|O<<14)^(I<<23|O>>>9),wt=(O>>>14|I<<18)^(O>>>18|I<<14)^(O<<23|I>>>9),Bt=c[N],kt=Bt.high,mt=Bt.low,bt=K+gt+((ft=X+wt)>>>0>>0?1:0),xt=vt+_t;K=U,X=j,U=L,j=W,L=I,W=O,I=F+(bt=(bt=(bt=bt+ut+((ft+=dt)>>>0
>>0?1:0))+kt+((ft+=mt)>>>0>>0?1:0))+Z+((ft+=V)>>>0>>0?1:0))+((O=T+ft|0)>>>0>>0?1:0)|0,F=P,T=D,P=E,D=R,E=z,R=C,z=bt+(yt+pt+(xt>>>0>>0?1:0))+((C=ft+xt|0)>>>0>>0?1:0)|0}p=i.low=p+C,i.high=d+z+(p>>>0>>0?1:0),y=n.low=y+R,n.high=_+E+(y>>>0>>0?1:0),g=o.low=g+D,o.high=v+P+(g>>>0>>0?1:0),B=s.low=B+T,s.high=w+F+(B>>>0>>0?1:0),m=a.low=m+O,a.high=k+I+(m>>>0>>0?1:0),x=l.low=x+W,l.high=b+L+(x>>>0>>0?1:0),A=f.low=A+j,f.high=S+U+(A>>>0>>0?1:0),M=u.low=M+X,u.high=H+K+(M>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return e[i>>>5]|=128<<24-i%32,e[30+(i+128>>>10<<5)]=Math.floor(r/4294967296),e[31+(i+128>>>10<<5)]=r,t.sigBytes=4*e.length,this._process(),this._hash.toX32()},clone:function(){var t=e.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});t.SHA512=e._createHelper(l),t.HmacSHA512=e._createHmacHelper(l)}(),function(){var t=a,e=t.x64,r=e.Word,i=e.WordArray,n=t.algo,o=n.SHA512,s=n.SHA384=o.extend({_doReset:function(){this._hash=new i.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=o._doFinalize.call(this);return t.sigBytes-=16,t}});t.SHA384=o._createHelper(s),t.HmacSHA384=o._createHmacHelper(s)}(),a.lib.Cipher||function(t){var e=a,r=e.lib,i=r.Base,n=r.WordArray,o=r.BufferedBlockAlgorithm,s=e.enc,c=(s.Utf8,s.Base64),h=e.algo.EvpKDF,l=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,r){this.cfg=this.cfg.extend(r),this._xformMode=t,this._key=e,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){return t&&this._append(t),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return\"string\"==typeof t?w:v}return function(e){return{encrypt:function(r,i,n){return t(i).encrypt(e,r,i,n)},decrypt:function(r,i,n){return t(i).decrypt(e,r,i,n)}}}}()}),f=(r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),e.mode={}),u=r.BlockCipherMode=i.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),d=f.CBC=function(){var t=u.extend();function e(t,e,r){var i,n=this._iv;n?(i=n,this._iv=void 0):i=this._prevBlock;for(var o=0;o>>2];t.sigBytes-=e}},_=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:d,padding:p}),reset:function(){var t;l.reset.call(this);var e=this.cfg,r=e.iv,i=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=i.createEncryptor:(t=i.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,r&&r.words):(this._mode=t.call(i,this,r&&r.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=i.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=(e.format={}).OpenSSL={stringify:function(t){var e=t.ciphertext,r=t.salt;return(r?n.create([1398893684,1701076831]).concat(r).concat(e):e).toString(c)},parse:function(t){var e,r=c.parse(t),i=r.words;return 1398893684==i[0]&&1701076831==i[1]&&(e=n.create(i.slice(2,4)),i.splice(0,4),r.sigBytes-=16),_.create({ciphertext:r,salt:e})}},v=r.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(t,e,r,i){i=this.cfg.extend(i);var n=t.createEncryptor(r,i),o=n.finalize(e),s=n.cfg;return _.create({ciphertext:o,key:r,iv:s.iv,algorithm:t,mode:s.mode,padding:s.padding,blockSize:t.blockSize,formatter:i.format})},decrypt:function(t,e,r,i){return i=this.cfg.extend(i),e=this._parse(e,i.format),t.createDecryptor(r,i).finalize(e.ciphertext)},_parse:function(t,e){return\"string\"==typeof t?e.parse(t,this):t}}),g=(e.kdf={}).OpenSSL={execute:function(t,e,r,i){i||(i=n.random(8));var o=h.create({keySize:e+r}).compute(t,i),s=n.create(o.words.slice(e),4*r);return o.sigBytes=4*e,_.create({key:o,iv:s,salt:i})}},w=r.PasswordBasedCipher=v.extend({cfg:v.cfg.extend({kdf:g}),encrypt:function(t,e,r,i){var n=(i=this.cfg.extend(i)).kdf.execute(r,t.keySize,t.ivSize);i.iv=n.iv;var o=v.encrypt.call(this,t,e,n.key,i);return o.mixIn(n),o},decrypt:function(t,e,r,i){i=this.cfg.extend(i),e=this._parse(e,i.format);var n=i.kdf.execute(r,t.keySize,t.ivSize,e.salt);return i.iv=n.iv,v.decrypt.call(this,t,e,n.key,i)}})}(),a.mode.CFB=function(){var t=a.lib.BlockCipherMode.extend();function e(t,e,r,i){var n,o=this._iv;o?(n=o.slice(0),this._iv=void 0):n=this._prevBlock,i.encryptBlock(n,0);for(var s=0;s>>2]|=n<<24-o%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},a.pad.Iso10126={pad:function(t,e){var r=4*e,i=r-t.sigBytes%r;t.concat(a.lib.WordArray.random(i-1)).concat(a.lib.WordArray.create([i<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},a.pad.Iso97971={pad:function(t,e){t.concat(a.lib.WordArray.create([2147483648],1)),a.pad.ZeroPadding.pad(t,e)},unpad:function(t){a.pad.ZeroPadding.unpad(t),t.sigBytes--}},a.mode.OFB=(r=a.lib.BlockCipherMode.extend(),i=r.Encryptor=r.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._keystream;n&&(o=this._keystream=n.slice(0),this._iv=void 0),r.encryptBlock(o,0);for(var s=0;s>>8^255&p^99,i[r]=p,n[p]=r;var _=t[r],y=t[_],v=t[y],g=257*t[p]^16843008*p;o[r]=g<<24|g>>>8,s[r]=g<<16|g>>>16,c[r]=g<<8|g>>>24,h[r]=g,g=16843009*v^65537*y^257*_^16843008*r,l[p]=g<<24|g>>>8,f[p]=g<<16|g>>>16,u[p]=g<<8|g>>>24,d[p]=g,r?(r=_^t[t[t[v^_]]],a^=t[t[a]]):r=a=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],_=r.AES=e.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,r=t.sigBytes/4,n=4*((this._nRounds=r+6)+1),o=this._keySchedule=[],s=0;s6&&s%r==4&&(h=i[h>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[255&h]):(h=i[(h=h<<8|h>>>24)>>>24]<<24|i[h>>>16&255]<<16|i[h>>>8&255]<<8|i[255&h],h^=p[s/r|0]<<24),o[s]=o[s-r]^h);for(var a=this._invKeySchedule=[],c=0;c>>24]]^f[i[h>>>16&255]]^u[i[h>>>8&255]]^d[i[255&h]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,s,c,h,i)},decryptBlock:function(t,e){var r=t[e+1];t[e+1]=t[e+3],t[e+3]=r,this._doCryptBlock(t,e,this._invKeySchedule,l,f,u,d,n),r=t[e+1],t[e+1]=t[e+3],t[e+3]=r},_doCryptBlock:function(t,e,r,i,n,o,s,a){for(var c=this._nRounds,h=t[e]^r[0],l=t[e+1]^r[1],f=t[e+2]^r[2],u=t[e+3]^r[3],d=4,p=1;p>>24]^n[l>>>16&255]^o[f>>>8&255]^s[255&u]^r[d++],y=i[l>>>24]^n[f>>>16&255]^o[u>>>8&255]^s[255&h]^r[d++],v=i[f>>>24]^n[u>>>16&255]^o[h>>>8&255]^s[255&l]^r[d++],g=i[u>>>24]^n[h>>>16&255]^o[l>>>8&255]^s[255&f]^r[d++];h=_,l=y,f=v,u=g}_=(a[h>>>24]<<24|a[l>>>16&255]<<16|a[f>>>8&255]<<8|a[255&u])^r[d++],y=(a[l>>>24]<<24|a[f>>>16&255]<<16|a[u>>>8&255]<<8|a[255&h])^r[d++],v=(a[f>>>24]<<24|a[u>>>16&255]<<16|a[h>>>8&255]<<8|a[255&l])^r[d++],g=(a[u>>>24]<<24|a[h>>>16&255]<<16|a[l>>>8&255]<<8|a[255&f])^r[d++],t[e]=_,t[e+1]=y,t[e+2]=v,t[e+3]=g},keySize:8});t.AES=e._createHelper(_)}(),function(){var t=a,e=t.lib,r=e.WordArray,i=e.BlockCipher,n=t.algo,o=[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],s=[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],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],h=[{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}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],f=n.DES=i.extend({_doReset:function(){for(var t=this._key.words,e=[],r=0;r<56;r++){var i=o[r]-1;e[r]=t[i>>>5]>>>31-i%32&1}for(var n=this._subKeys=[],a=0;a<16;a++){var h=n[a]=[],l=c[a];for(r=0;r<24;r++)h[r/6|0]|=e[(s[r]-1+l)%28]<<31-r%6,h[4+(r/6|0)]|=e[28+(s[r+24]-1+l)%28]<<31-r%6;for(h[0]=h[0]<<1|h[0]>>>31,r=1;r<7;r++)h[r]=h[r]>>>4*(r-1)+3;h[7]=h[7]<<5|h[7]>>>27}var f=this._invSubKeys=[];for(r=0;r<16;r++)f[r]=n[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,r){this._lBlock=t[e],this._rBlock=t[e+1],u.call(this,4,252645135),u.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),u.call(this,1,1431655765);for(var i=0;i<16;i++){for(var n=r[i],o=this._lBlock,s=this._rBlock,a=0,c=0;c<8;c++)a|=h[c][((s^n[c])&l[c])>>>0];this._lBlock=s,this._rBlock=o^a}var f=this._lBlock;this._lBlock=this._rBlock,this._rBlock=f,u.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),u.call(this,16,65535),u.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function u(t,e){var r=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=r,this._lBlock^=r<>>t^this._lBlock)&e;this._lBlock^=r,this._rBlock^=r<192.\");var e=t.slice(0,2),i=t.length<4?t.slice(0,2):t.slice(2,4),n=t.length<6?t.slice(0,2):t.slice(4,6);this._des1=f.createEncryptor(r.create(e)),this._des2=f.createEncryptor(r.create(i)),this._des3=f.createEncryptor(r.create(n))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});t.TripleDES=i._createHelper(p)}(),function(){var t=a,e=t.lib.StreamCipher,r=t.algo,i=r.RC4=e.extend({_doReset:function(){for(var t=this._key,e=t.words,r=t.sigBytes,i=this._S=[],n=0;n<256;n++)i[n]=n;n=0;for(var o=0;n<256;n++){var s=n%r,a=e[s>>>2]>>>24-s%4*8&255;o=(o+i[n]+a)%256;var c=i[n];i[n]=i[o],i[o]=c}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=n.call(this)},keySize:8,ivSize:0});function n(){for(var t=this._S,e=this._i,r=this._j,i=0,n=0;n<4;n++){r=(r+t[e=(e+1)%256])%256;var o=t[e];t[e]=t[r],t[r]=o,i|=t[(t[e]+t[r])%256]<<24-8*n}return this._i=e,this._j=r,i}t.RC4=e._createHelper(i);var o=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)n.call(this)}});t.RC4Drop=e._createHelper(o)}(),\n/** @preserve\n * Counter block mode compatible with Dr Brian Gladman fileenc.c\n * derived from CryptoJS.mode.CTR\n * Jan Hruby jhruby.web@gmail.com\n */\na.mode.CTRGladman=function(){var t=a.lib.BlockCipherMode.extend();function e(t){if(255==(t>>24&255)){var e=t>>16&255,r=t>>8&255,i=255&t;255===e?(e=0,255===r?(r=0,255===i?i=0:++i):++r):++e,t=0,t+=e<<16,t+=r<<8,t+=i}else t+=1<<24;return t}var r=t.Encryptor=t.extend({processBlock:function(t,r){var i=this._cipher,n=i.blockSize,o=this._iv,s=this._counter;o&&(s=this._counter=o.slice(0),this._iv=void 0),function(t){0===(t[0]=e(t[0]))&&(t[1]=e(t[1]))}(s);var a=s.slice(0);i.encryptBlock(a,0);for(var c=0;c>>24)|4278255360&(t[r]<<24|t[r]>>>8);var i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];for(this._b=0,r=0;r<4;r++)c.call(this);for(r=0;r<8;r++)n[r]^=i[r+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=h>>>16|4294901760&l,u=l<<16|65535&h;for(n[0]^=h,n[1]^=f,n[2]^=l,n[3]^=u,n[4]^=h,n[5]^=f,n[6]^=l,n[7]^=u,r=0;r<4;r++)c.call(this)}},_doProcessBlock:function(t,e){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,r=0;r<8;r++)n[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],s=65535&i,a=i>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&i)*i|0)+((65535&i)*i|0);o[r]=c^h}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.Rabbit=e._createHelper(s)}(),a.mode.CTR=function(){var t=a.lib.BlockCipherMode.extend(),e=t.Encryptor=t.extend({processBlock:function(t,e){var r=this._cipher,i=r.blockSize,n=this._iv,o=this._counter;n&&(o=this._counter=n.slice(0),this._iv=void 0);var s=o.slice(0);r.encryptBlock(s,0),o[i-1]=o[i-1]+1|0;for(var a=0;a>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],i=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(e){var o=e.words,s=o[0],a=o[1],h=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),l=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),f=h>>>16|4294901760&l,u=l<<16|65535&h;for(i[0]^=h,i[1]^=f,i[2]^=l,i[3]^=u,i[4]^=h,i[5]^=f,i[6]^=l,i[7]^=u,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var r=this._X;c.call(this),i[0]=r[0]^r[5]>>>16^r[3]<<16,i[1]=r[2]^r[7]>>>16^r[5]<<16,i[2]=r[4]^r[1]>>>16^r[7]<<16,i[3]=r[6]^r[3]>>>16^r[1]<<16;for(var n=0;n<4;n++)i[n]=16711935&(i[n]<<8|i[n]>>>24)|4278255360&(i[n]<<24|i[n]>>>8),t[e+n]^=i[n]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,r=0;r<8;r++)n[r]=e[r];for(e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0,r=0;r<8;r++){var i=t[r]+e[r],s=65535&i,a=i>>>16,c=((s*s>>>17)+s*a>>>15)+a*a,h=((4294901760&i)*i|0)+((65535&i)*i|0);o[r]=c^h}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}t.RabbitLegacy=e._createHelper(s)}(),a.pad.ZeroPadding={pad:function(t,e){var r=4*e;t.clamp(),t.sigBytes+=r-(t.sigBytes%r||r)},unpad:function(t){var e=t.words,r=t.sigBytes-1;for(r=t.sigBytes-1;r>=0;r--)if(e[r>>>2]>>>24-r%4*8&255){t.sigBytes=r+1;break}}},a)}));return function(){function e(r){t(this,e);var i=r.logger,n=r.isArray,o=r.isMap,s=r.isDevMode;this._isArray=n,this._isMap=o,this._isDevMode=s,i.log(\"TIMProfanityFilterPlugin.VERSION:\".concat(\"0.9.0\")),this._interceptProfanityList=[],this._interceptFilter=null,this._interceptRegExpList=[],this._replacingProfanityMap=new Map,this._replacingFilter=null,this._replacingRegExpMap=new Map,this._key=\"\",this._iv=\"\",this._decryptOptions=void 0}return r(e,[{key:\"onToken\",value:function(t){this._key=u.enc.Utf8.parse(t.slice(0,32)),this._iv=this._key,this._decryptOptions={iv:this._iv,mode:u.mode.CBC,padding:u.pad.Pkcs7}}},{key:\"onLexiconSliced\",value:function(t){if(this._isArray(t)&&0!==t.length){var e,r,i,n=a(t);try{for(n.s();!(i=n.n()).done;){var o=i.value,s=o.filterType,c=o.profanityType,h=o.profanity,l=o.replacement;e=this._getDecryptedString(h),r=this._getDecryptedString(l),1===s?1===c?this._interceptProfanityList.push(e):2===c&&this._interceptRegExpList.push(e):2===s&&(1===c?this._replacingProfanityMap.set(e,r):2===c&&this._replacingRegExpMap.set(e,r))}}catch(f){n.e(f)}finally{n.f()}}}},{key:\"_getDecryptedString\",value:function(t){var e=u.AES.decrypt(t,this._key,this._decryptOptions);return u.enc.Utf8.stringify(e).toLowerCase()}},{key:\"onLexiconCompleted\",value:function(t){this.onLexiconSliced(t),this._interceptFilter=new h({input:this._interceptProfanityList,isArray:this._isArray,isMap:this._isMap}),this._replacingFilter=new h({input:this._replacingProfanityMap,isArray:this._isArray,isMap:this._isMap}),!0===this._isDevMode&&(console.log(\"TIMProfanityFilterPlugin _interceptProfanityList ->\",this._interceptProfanityList),console.log(\"TIMProfanityFilterPlugin _interceptRegExpList ->\",this._interceptRegExpList),console.log(\"TIMProfanityFilterPlugin _replacingProfanityMap ->\",this._replacingProfanityMap),console.log(\"TIMProfanityFilterPlugin _replacingRegExpMap ->\",this._replacingRegExpMap))}},{key:\"filter\",value:function(t){var e={type:0,modifiedText:t};if(!0===this._interceptFilter.filter({text:t,replacingEnabled:!1}).isMatched)return e.type=1,e;for(var r=!1,n=0,o=this._interceptRegExpList.length;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var f="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),u="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),l="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),c="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),y="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),d="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,p=d&&"ios"===uni.getDeviceInfo().platform.toLocaleLowerCase(),g=(d&&uni.getDeviceInfo().platform.toLocaleLowerCase(),f||u||l||c||y||d),m=u?qq:l?tt:c?swan:y?my:f?wx:d?uni:{},h=function(e){if("object"!==n(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o};function v(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(h(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var b=function(){function e(){o(this,e)}return a(e,[{key:"request",value:function(e,t){var n=this,o=e.downloadUrl||"",r=(e.method||"PUT").toUpperCase(),a=e.url;if(e.qs){var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"&",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"=";return v(e)?"":h(e)?Object.keys(e).map((function(o){var r=encodeURIComponent(o)+n;return Array.isArray(e[o])?e[o].map((function(e){return r+encodeURIComponent(e)})).join(t):r+encodeURIComponent(e[o])})).filter(Boolean).join(t):void 0}(e.qs);s&&(a+="".concat(-1===a.indexOf("?")?"?":"&").concat(s))}var i=new XMLHttpRequest;i.open(r,a,!0),i.responseType=e.dataType||"text";var f=e.headers||{};if(!v(f))for(var u in f)f.hasOwnProperty(u)&&"content-length"!==u.toLowerCase()&&"user-agent"!==u.toLowerCase()&&"origin"!==u.toLowerCase()&&"host"!==u.toLowerCase()&&i.setRequestHeader(u,f[u]);return i.onload=function(){if(200===i.status)t(null,n._xhrRes(i,n._xhrBody(i,o)));else{var e={code:i.status,message:JSON.stringify(i.responseText)};t(e,n._xhrRes(i,n._xhrBody(i)))}},i.onerror=function(e){var o=n._xhrBody(i),r={code:i.status,message:JSON.stringify(i.responseText)};o||i.statusText||0!==i.status||(e.message="CORS blocked or network error"),t(r,n._xhrRes(i,o)),r=null},e.onProgress&&i.upload&&(i.upload.onprogress=function(t){var n=t.total,o=t.loaded,r=Math.floor(100*o/n);e.onProgress({total:n,loaded:o,percent:(r>=100?100:r)/100})}),i.send(e.resources),i}},{key:"_xhrRes",value:function(e,t){var n={};return e.getAllResponseHeaders().trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),o=e.substr(0,t).trim().toLowerCase(),r=e.substr(t+1).trim();n[o]=r}})),{statusCode:e.status,statusMessage:e.statusText,headers:n,data:t}}},{key:"_xhrBody",value:function(e,t){return 200===e.status&&t?{location:t}:{response:e.responseText}}}]),e}(),O=["unknown","image","video","audio","log"],w=["name"],S=function(){function e(){o(this,e)}return a(e,[{key:"request",value:function(e,n){var o=this,r=e.resources,a=void 0===r?"":r,s=e.headers,f=void 0===s?{}:s,u=e.url,l=e.downloadUrl,c=void 0===l?"":l,d=u,g=null,h=c.match(/^(https?:\/\/[^/]+\/)([^/]*\/?)(.*)$/),v=decodeURIComponent(h[3]),b=v.indexOf("?")>-1?v.split("?")[0]:v,S={key:e.fileKey?e.fileKey:b,success_action_status:200,"Content-Type":""},C={};if(p){var P=u.split("?sign=");if(P.length>1){var j=P[1];d="".concat(P[0],"?sign=").concat(encodeURIComponent("".concat(j))),C.sign=decodeURIComponent(j),C.signature=decodeURIComponent(j)}}var x={url:d,header:f,name:"file",filePath:a,formData:t(t({},S),C),timeout:e.timeout||3e5};if(y){var R=x;R.name,x=t(t({},i(R,w)),{},{fileName:"file",fileType:O[e.fileType]})}return(g=m.uploadFile(t(t({},x),{},{success:function(e){o._handleResponse({response:e,downloadUrl:c,callback:n})},fail:function(e){o._handleResponse({response:e,downloadUrl:c,callback:n})}}))).onProgressUpdate&&g.onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),g}},{key:"_handleResponse",value:function(e){var n=e.downloadUrl,o=e.response,r=e.callback,a=o.header,s={};if(a)for(var i in a)a.hasOwnProperty(i)&&(s[i.toLowerCase()]=a[i]);var f=+o.statusCode;200===f?r(null,{statusCode:f,headers:s,data:t(t({},o.data),{},{location:n})}):r({code:f,message:JSON.stringify(o.data)},{statusCode:f,headers:s,data:void 0})}}]),e}();return function(){function e(){o(this,e),console.log("TIMUploadPlugin.VERSION: ".concat("1.3.0")),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=g?new S:new b}return a(e,[{key:"uploadFile",value:function(e,t){var n=this;return this.httpRequest.request(e,(function(o,r){o&&n.tryCount=3e4&&(this.systemClockOffset=i-s,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}]),e}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):(global=global||self).TIMUploadPlugin=factory(); + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242901); +})() +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/tim-upload-plugin/index.js.map b/miniprogram_npm/tim-upload-plugin/index.js.map new file mode 100644 index 0000000..60583af --- /dev/null +++ b/miniprogram_npm/tim-upload-plugin/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA","file":"index.js","sourcesContent":["var global,factory;global=this,factory=function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(r[n]=e[n]);return r}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var f=\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),u=\"undefined\"!=typeof qq&&\"function\"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),l=\"undefined\"!=typeof tt&&\"function\"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),c=\"undefined\"!=typeof swan&&\"function\"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),y=\"undefined\"!=typeof my&&\"function\"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),d=\"undefined\"!=typeof uni&&\"undefined\"==typeof window&&\"function\"==typeof uni.requireNativePlugin,p=d&&\"ios\"===uni.getDeviceInfo().platform.toLocaleLowerCase(),g=(d&&uni.getDeviceInfo().platform.toLocaleLowerCase(),f||u||l||c||y||d),m=u?qq:l?tt:c?swan:y?my:f?wx:d?uni:{},h=function(e){if(\"object\"!==n(e)||null===e)return!1;var t=Object.getPrototypeOf(e);if(null===t)return!0;for(var o=t;null!==Object.getPrototypeOf(o);)o=Object.getPrototypeOf(o);return t===o};function v(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(h(e)){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}return!1}var b=function(){function e(){o(this,e)}return a(e,[{key:\"request\",value:function(e,t){var n=this,o=e.downloadUrl||\"\",r=(e.method||\"PUT\").toUpperCase(),a=e.url;if(e.qs){var s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"&\",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"=\";return v(e)?\"\":h(e)?Object.keys(e).map((function(o){var r=encodeURIComponent(o)+n;return Array.isArray(e[o])?e[o].map((function(e){return r+encodeURIComponent(e)})).join(t):r+encodeURIComponent(e[o])})).filter(Boolean).join(t):void 0}(e.qs);s&&(a+=\"\".concat(-1===a.indexOf(\"?\")?\"?\":\"&\").concat(s))}var i=new XMLHttpRequest;i.open(r,a,!0),i.responseType=e.dataType||\"text\";var f=e.headers||{};if(!v(f))for(var u in f)f.hasOwnProperty(u)&&\"content-length\"!==u.toLowerCase()&&\"user-agent\"!==u.toLowerCase()&&\"origin\"!==u.toLowerCase()&&\"host\"!==u.toLowerCase()&&i.setRequestHeader(u,f[u]);return i.onload=function(){if(200===i.status)t(null,n._xhrRes(i,n._xhrBody(i,o)));else{var e={code:i.status,message:JSON.stringify(i.responseText)};t(e,n._xhrRes(i,n._xhrBody(i)))}},i.onerror=function(e){var o=n._xhrBody(i),r={code:i.status,message:JSON.stringify(i.responseText)};o||i.statusText||0!==i.status||(e.message=\"CORS blocked or network error\"),t(r,n._xhrRes(i,o)),r=null},e.onProgress&&i.upload&&(i.upload.onprogress=function(t){var n=t.total,o=t.loaded,r=Math.floor(100*o/n);e.onProgress({total:n,loaded:o,percent:(r>=100?100:r)/100})}),i.send(e.resources),i}},{key:\"_xhrRes\",value:function(e,t){var n={};return e.getAllResponseHeaders().trim().split(\"\\n\").forEach((function(e){if(e){var t=e.indexOf(\":\"),o=e.substr(0,t).trim().toLowerCase(),r=e.substr(t+1).trim();n[o]=r}})),{statusCode:e.status,statusMessage:e.statusText,headers:n,data:t}}},{key:\"_xhrBody\",value:function(e,t){return 200===e.status&&t?{location:t}:{response:e.responseText}}}]),e}(),O=[\"unknown\",\"image\",\"video\",\"audio\",\"log\"],w=[\"name\"],S=function(){function e(){o(this,e)}return a(e,[{key:\"request\",value:function(e,n){var o=this,r=e.resources,a=void 0===r?\"\":r,s=e.headers,f=void 0===s?{}:s,u=e.url,l=e.downloadUrl,c=void 0===l?\"\":l,d=u,g=null,h=c.match(/^(https?:\\/\\/[^/]+\\/)([^/]*\\/?)(.*)$/),v=decodeURIComponent(h[3]),b=v.indexOf(\"?\")>-1?v.split(\"?\")[0]:v,S={key:e.fileKey?e.fileKey:b,success_action_status:200,\"Content-Type\":\"\"},C={};if(p){var P=u.split(\"?sign=\");if(P.length>1){var j=P[1];d=\"\".concat(P[0],\"?sign=\").concat(encodeURIComponent(\"\".concat(j))),C.sign=decodeURIComponent(j),C.signature=decodeURIComponent(j)}}var x={url:d,header:f,name:\"file\",filePath:a,formData:t(t({},S),C),timeout:e.timeout||3e5};if(y){var R=x;R.name,x=t(t({},i(R,w)),{},{fileName:\"file\",fileType:O[e.fileType]})}return(g=m.uploadFile(t(t({},x),{},{success:function(e){o._handleResponse({response:e,downloadUrl:c,callback:n})},fail:function(e){o._handleResponse({response:e,downloadUrl:c,callback:n})}}))).onProgressUpdate&&g.onProgressUpdate((function(t){e.onProgress&&e.onProgress({total:t.totalBytesExpectedToSend,loaded:t.totalBytesSent,percent:Math.floor(t.progress)/100})})),g}},{key:\"_handleResponse\",value:function(e){var n=e.downloadUrl,o=e.response,r=e.callback,a=o.header,s={};if(a)for(var i in a)a.hasOwnProperty(i)&&(s[i.toLowerCase()]=a[i]);var f=+o.statusCode;200===f?r(null,{statusCode:f,headers:s,data:t(t({},o.data),{},{location:n})}):r({code:f,message:JSON.stringify(o.data)},{statusCode:f,headers:s,data:void 0})}}]),e}();return function(){function e(){o(this,e),console.log(\"TIMUploadPlugin.VERSION: \".concat(\"1.3.0\")),this.retry=1,this.tryCount=0,this.systemClockOffset=0,this.httpRequest=g?new S:new b}return a(e,[{key:\"uploadFile\",value:function(e,t){var n=this;return this.httpRequest.request(e,(function(o,r){o&&n.tryCount=3e4&&(this.systemClockOffset=i-s,t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0)}return t}}]),e}()},\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=factory():\"function\"==typeof define&&define.amd?define(factory):(global=global||self).TIMUploadPlugin=factory();\n"]} \ No newline at end of file diff --git a/miniprogram_npm/tim-wx-sdk/index.js b/miniprogram_npm/tim-wx-sdk/index.js new file mode 100644 index 0000000..6814589 --- /dev/null +++ b/miniprogram_npm/tim-wx-sdk/index.js @@ -0,0 +1,14 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242902, function(require, module, exports) { +!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).TIM=t()}(this,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _(e)}function f(e){var t=l();return function(){var n,o=u(e);if(t){var s=u(this).constructor;n=Reflect.construct(o,arguments,s)}else n=o.apply(this,arguments);return h(this,n)}}function v(e,t){return M(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var o,s,a=[],r=!0,i=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(u){i=!0,s=u}finally{try{r||null==n.return||n.return()}finally{if(i)throw s}}return a}(e,t)||I(e,t)||T()}function m(e){return function(e){if(Array.isArray(e))return C(e)}(e)||y(e)||I(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function M(e){if(Array.isArray(e))return e}function y(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function I(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:s}}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 a,r=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){i=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(i)throw a}}}}var E={SDK_READY:"sdkStateReady",SDK_NOT_READY:"sdkStateNotReady",SDK_DESTROY:"sdkDestroy",MESSAGE_RECEIVED:"onMessageReceived",MESSAGE_MODIFIED:"onMessageModified",MESSAGE_REVOKED:"onMessageRevoked",MESSAGE_READ_BY_PEER:"onMessageReadByPeer",MESSAGE_READ_RECEIPT_RECEIVED:"onMessageReadReceiptReceived",MESSAGE_EXTENSIONS_UPDATED:"onMessageExtensionsUpdated",MESSAGE_EXTENSIONS_DELETED:"onMessageExtensionsDeleted",CONVERSATION_LIST_UPDATED:"onConversationListUpdated",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:"onTotalUnreadMessageCountUpdated",CONVERSATION_GROUP_LIST_UPDATED:"onConversationGroupListUpdated",CONVERSATION_IN_GROUP_UPDATED:"onConversationInGroupUpdated",GROUP_LIST_UPDATED:"onGroupListUpdated",GROUP_SYSTEM_NOTICE_RECEIVED:"receiveGroupSystemNotice",GROUP_ATTRIBUTES_UPDATED:"groupAttributesUpdated",GROUP_COUNTER_UPDATED:"onGroupCounterUpdated",TOPIC_CREATED:"onTopicCreated",TOPIC_DELETED:"onTopicDeleted",TOPIC_UPDATED:"onTopicUpdated",PROFILE_UPDATED:"onProfileUpdated",USER_STATUS_UPDATED:"onUserStatusUpdated",BLACKLIST_UPDATED:"blacklistUpdated",FRIEND_LIST_UPDATED:"onFriendListUpdated",FRIEND_GROUP_LIST_UPDATED:"onFriendGroupListUpdated",FRIEND_APPLICATION_LIST_UPDATED:"onFriendApplicationListUpdated",KICKED_OUT:"kickedOut",ERROR:"error",NET_STATE_CHANGE:"netStateChange",SDK_RELOAD:"sdkReload"},S={MSG_TEXT:"TIMTextElem",MSG_IMAGE:"TIMImageElem",MSG_SOUND:"TIMSoundElem",MSG_AUDIO:"TIMSoundElem",MSG_FILE:"TIMFileElem",MSG_FACE:"TIMFaceElem",MSG_VIDEO:"TIMVideoFileElem",MSG_GEO:"TIMLocationElem",MSG_LOCATION:"TIMLocationElem",MSG_GRP_TIP:"TIMGroupTipElem",MSG_GRP_SYS_NOTICE:"TIMGroupSystemNoticeElem",MSG_CUSTOM:"TIMCustomElem",MSG_MERGER:"TIMRelayElem",MSG_PRIORITY_HIGH:"High",MSG_PRIORITY_NORMAL:"Normal",MSG_PRIORITY_LOW:"Low",MSG_PRIORITY_LOWEST:"Lowest",CONV_C2C:"C2C",CONV_GROUP:"GROUP",CONV_TOPIC:"TOPIC",CONV_SYSTEM:"@TIM#SYSTEM",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:"Private",GRP_WORK:"Private",GRP_PUBLIC:"Public",GRP_CHATROOM:"ChatRoom",GRP_MEETING:"ChatRoom",GRP_AVCHATROOM:"AVChatRoom",GRP_COMMUNITY:"Community",GRP_MBR_ROLE_OWNER:"Owner",GRP_MBR_ROLE_ADMIN:"Admin",GRP_MBR_ROLE_MEMBER:"Member",GRP_MBR_ROLE_CUSTOM:"Custom",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:"AcceptAndNotify",MSG_REMIND_ACPT_NOT_NOTE:"AcceptNotNotify",MSG_REMIND_DISCARD:"Discard",GENDER_UNKNOWN:"Gender_Type_Unknown",GENDER_FEMALE:"Gender_Type_Female",GENDER_MALE:"Gender_Type_Male",KICKED_OUT_MULT_ACCOUNT:"multipleAccount",KICKED_OUT_MULT_DEVICE:"multipleDevice",KICKED_OUT_USERSIG_EXPIRED:"userSigExpired",KICKED_OUT_REST_API:"REST_API_Kick",ALLOW_TYPE_ALLOW_ANY:"AllowType_Type_AllowAny",ALLOW_TYPE_NEED_CONFIRM:"AllowType_Type_NeedConfirm",ALLOW_TYPE_DENY_ANY:"AllowType_Type_DenyAny",FORBID_TYPE_NONE:"AdminForbid_Type_None",FORBID_TYPE_SEND_OUT:"AdminForbid_Type_SendOut",JOIN_OPTIONS_FREE_ACCESS:"FreeAccess",JOIN_OPTIONS_NEED_PERMISSION:"NeedPermission",JOIN_OPTIONS_DISABLE_APPLY:"DisableApply",JOIN_STATUS_SUCCESS:"JoinedSuccess",JOIN_STATUS_ALREADY_IN_GROUP:"AlreadyInGroup",JOIN_STATUS_WAIT_APPROVAL:"WaitAdminApproval",INVITE_OPTIONS_DISABLE_INVITE:"DisableInvite",INVITE_OPTIONS_NEED_PERMISSION:"NeedPermission",INVITE_OPTIONS_FREE_ACCESS:"FreeAccess",GRP_PROFILE_OWNER_ID:"ownerID",GRP_PROFILE_CREATE_TIME:"createTime",GRP_PROFILE_LAST_INFO_TIME:"lastInfoTime",GRP_PROFILE_MEMBER_NUM:"memberNum",GRP_PROFILE_MAX_MEMBER_NUM:"maxMemberNum",GRP_PROFILE_JOIN_OPTION:"joinOption",GRP_PROFILE_INVITE_OPTION:"inviteOption",GRP_PROFILE_INTRODUCTION:"introduction",GRP_PROFILE_NOTIFICATION:"notification",GRP_PROFILE_MUTE_ALL_MBRS:"muteAllMembers",SNS_ADD_TYPE_SINGLE:"Add_Type_Single",SNS_ADD_TYPE_BOTH:"Add_Type_Both",SNS_DELETE_TYPE_SINGLE:"Delete_Type_Single",SNS_DELETE_TYPE_BOTH:"Delete_Type_Both",SNS_APPLICATION_TYPE_BOTH:"Pendency_Type_Both",SNS_APPLICATION_SENT_TO_ME:"Pendency_Type_ComeIn",SNS_APPLICATION_SENT_BY_ME:"Pendency_Type_SendOut",SNS_APPLICATION_AGREE:"Response_Action_Agree",SNS_APPLICATION_AGREE_AND_ADD:"Response_Action_AgreeAndAdd",SNS_CHECK_TYPE_BOTH:"CheckResult_Type_Both",SNS_CHECK_TYPE_SINGLE:"CheckResult_Type_Single",SNS_TYPE_NO_RELATION:"CheckResult_Type_NoRelation",SNS_TYPE_A_WITH_B:"CheckResult_Type_AWithB",SNS_TYPE_B_WITH_A:"CheckResult_Type_BWithA",SNS_TYPE_BOTH_WAY:"CheckResult_Type_BothWay",NET_STATE_CONNECTED:"connected",NET_STATE_CONNECTING:"connecting",NET_STATE_DISCONNECTED:"disconnected",MSG_AT_ALL:"__kImSDK_MesssageAtALL__",READ_ALL_C2C_MSG:"readAllC2CMessage",READ_ALL_GROUP_MSG:"readAllGroupMessage",READ_ALL_MSG:"readAllMessage",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},k=function(){function e(){o(this,e),this.cache=[],this.options=null}return a(e,[{key:"use",value:function(e){if("function"!=typeof e)throw"middleware must be a function";return this.cache.push(e),this}},{key:"next",value:function(e){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:"run",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),e}(),L=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n}return a(e,[{key:"equal",value:function(e){return null!==e&&(this.low===e.low&&this.high===e.high)}},{key:"toString",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t="0"+t,n--;return e+t}}]),e}(),A={TEST:{CHINA:{DEFAULT:"wss://wss-dev.tim.qq.com"},OVERSEA:{DEFAULT:"wss://wss-dev.tim.qq.com"},SINGAPORE:{DEFAULT:"wss://wsssgp-dev.im.qcloud.com"},KOREA:{DEFAULT:"wss://wsskr-dev.im.qcloud.com"},GERMANY:{DEFAULT:"wss://wssger-dev.im.qcloud.com"},IND:{DEFAULT:"wss://wssind-dev.im.qcloud.com"},JPN:{DEFAULT:"wss://wssjpn-dev.im.qcloud.com"},USA:{DEFAULT:"wss://wssusa-dev.im.qcloud.com"}},PRODUCTION:{CHINA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.tim.qq.com",STAT:"https://events.im.qcloud.com",ANYCAST:"wss://162.14.13.203"},OVERSEA:{DEFAULT:"wss://wss.im.qcloud.com",BACKUP:"wss://wss.my-imcloud.com",STAT:"https://api.my-imcloud.com"},SINGAPORE:{DEFAULT:"wss://wsssgp.im.qcloud.com",BACKUP:"wss://wsssgp.my-imcloud.com",STAT:"https://apisgp.my-imcloud.com"},KOREA:{DEFAULT:"wss://wsskr.im.qcloud.com",BACKUP:"wss://wsskr.my-imcloud.com",STAT:"https://apikr.my-imcloud.com"},GERMANY:{DEFAULT:"wss://wssger.im.qcloud.com",BACKUP:"wss://wssger.my-imcloud.com",STAT:"https://apiger.my-imcloud.com"},IND:{DEFAULT:"wss://wssind.my-imcloud.com",BACKUP:"wss://wssind.im.qcloud.com",STAT:"https://apiind.my-imcloud.com"},JPN:{DEFAULT:"wss://wssjpn.im.qcloud.com",BACKUP:"wss://wssjpn.my-imcloud.com",STAT:"https://apijpn.my-imcloud.com"},USA:{DEFAULT:"wss://wssusa.im.qcloud.com",BACKUP:"wss://wssusa.my-imcloud.com",STAT:"https://apiusa.my-imcloud.com"}}},R={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},N="1.7.3",O=537048168,G="CHINA",U="OVERSEA",P="SINGAPORE",b="KOREA",w="GERMANY",F="IND",q="JPN",x="USA",V={HOST:{CURRENT:{DEFAULT:"wss://wss.im.qcloud.com",STAT:"https://events.im.qcloud.com"},setCurrent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;this.CURRENT=A.PRODUCTION[e]}},NAME:{OPEN_IM:"openim",OPEN_IM_MSG_EXT:"openim_msg_ext_http_svc",GROUP:"group_open_http_svc",GROUP_AVCHATROOM:"group_open_avchatroom_http_svc",GROUP_COMMUNITY:"million_group_open_http_svc",GROUP_ATTR:"group_open_attr_http_svc",FRIEND:"sns",PROFILE:"profile",RECENT_CONTACT:"recentcontact",PIC:"openpic",BIG_GROUP_NO_AUTH:"group_open_http_noauth_svc",BIG_GROUP_LONG_POLLING:"group_open_long_polling_http_svc",BIG_GROUP_LONG_POLLING_NO_AUTH:"group_open_long_polling_http_noauth_svc",IM_OPEN_STAT:"imopenstat",WEB_IM:"webim",IM_COS_SIGN:"im_cos_sign_svr",CUSTOM_UPLOAD:"im_cos_msg",HEARTBEAT:"heartbeat",IM_OPEN_PUSH:"im_open_push",IM_OPEN_STATUS:"im_open_status",IM_LONG_MESSAGE:"im_long_msg",IM_CONFIG_MANAGER:"im_sdk_config_mgr",STAT_SERVICE:"StatSvc",OVERLOAD_PUSH:"OverLoadPush",IM_MSG_AUDIT_MGR:"im_msg_audit_mgr",TUIROOM_SVR:"tui_room_svr",IM_OPEN_TRANSLATE:"im_open_translate"},CMD:{LOGIN:"wslogin",LOGOUT_LONG_POLL:"longpollinglogout",LOGOUT:"wslogout",HELLO:"wshello",STAT_BACKGROUND:"ws_stat_background",STAT_FOREGROUND:"ws_stat_foreground",SET_TOKEN:"ws_stat_settoken",PORTRAIT_GET:"portrait_get_all",PORTRAIT_SET:"portrait_set",GET_LONG_POLL_ID:"getlongpollingid",LONG_POLL:"longpolling",AVCHATROOM_LONG_POLL:"get_msg",ADD_FRIEND:"friend_add",UPDATE_FRIEND:"friend_update",GET_FRIEND_LIST:"friend_get",GET_FRIEND_PROFILE:"friend_get_specified",DELETE_FRIEND:"friend_delete",CHECK_FRIEND:"friend_check",GET_FRIEND_GROUP_LIST:"group_get",RESPOND_FRIEND_APPLICATION:"friend_response",GET_FRIEND_APPLICATION_LIST:"pendency_get",DELETE_FRIEND_APPLICATION:"pendency_delete",REPORT_FRIEND_APPLICATION:"pendency_report",GET_GROUP_APPLICATION:"get_pendency",CREATE_FRIEND_GROUP:"group_add",DELETE_FRIEND_GROUP:"group_delete",UPDATE_FRIEND_GROUP:"group_update",GET_BLACKLIST:"black_list_get",ADD_BLACKLIST:"black_list_add",DELETE_BLACKLIST:"black_list_delete",CREATE_GROUP:"create_group",GET_JOINED_GROUPS:"get_joined_group_list",SET_GROUP_ATTRIBUTES:"set_group_attr",MODIFY_GROUP_ATTRIBUTES:"modify_group_attr",DELETE_GROUP_ATTRIBUTES:"delete_group_attr",CLEAR_GROUP_ATTRIBUTES:"clear_group_attr",GET_GROUP_ATTRIBUTES:"get_group_attr",SEND_MESSAGE:"sendmsg",REVOKE_C2C_MESSAGE:"msgwithdraw",DELETE_C2C_MESSAGE:"delete_c2c_msg_ramble",MODIFY_C2C_MESSAGE:"modify_c2c_msg",MODIFY_C2C_MESSAGE_EXTENSIONS:"set_key_values",GET_C2C_MESSAGE_EXTENSIONS:"get_key_values",SEND_GROUP_MESSAGE:"send_group_msg",REVOKE_GROUP_MESSAGE:"group_msg_recall",DELETE_GROUP_MESSAGE:"delete_group_ramble_msg_by_seq",MODIFY_GROUP_MESSAGE:"modify_group_msg",MODIFY_GROUP_MESSAGE_EXTENSIONS:"group_set_key_values",GET_GROUP_MESSAGE_EXTENSIONS:"group_get_key_values",GET_GROUP_INFO:"get_group_self_member_info",GET_GROUP_MEMBER_INFO:"get_specified_group_member_info",GET_GROUP_MEMBER_LIST:"get_group_member_info",GET_AVCHATROOM_MEMBER_LIST:"get_members",MARK_AVCHATROOM_MEMBER_INFO:"modify_user_info",QUIT_GROUP:"quit_group",CHANGE_GROUP_OWNER:"change_group_owner",DESTROY_GROUP:"destroy_group",ADD_GROUP_MEMBER:"add_group_member",DELETE_GROUP_MEMBER:"delete_group_member",BAN_AVCHATROOM_MEMBER:"ban_group_member",SEARCH_GROUP_BY_ID:"get_group_public_info",APPLY_JOIN_GROUP:"apply_join_group",HANDLE_APPLY_JOIN_GROUP:"handle_apply_join_group",HANDLE_INVITE_JOIN_GROUP:"handle_invite_join_permission_group",HANDLE_GROUP_INVITATION:"handle_invite_join_group",MODIFY_GROUP_INFO:"modify_group_base_info",MODIFY_GROUP_MEMBER_INFO:"modify_group_member_info",DELETE_GROUP_SYSTEM_MESSAGE:"deletemsg",DELETE_GROUP_AT_TIPS:"deletemsg",GET_GROUP_NOTIFY:"get_group_notify",GET_CONVERSATION_LIST:"get",PAGING_GET_CONVERSATION_LIST:"page_get",DELETE_CONVERSATION:"batch_delete",CLEAR_HISTORY_MESSAGE:"clear_msg",PIN_CONVERSATION:"top",SET_CONVERSATION_CUSTOM_DATA:"mark_contact",MARK_CONVERSATION:"mark_contact",CREATE_CONVERSATION_GROUP:"create_contact_group",DELETE_CONVERSATION_GROUP:"del_contact_group",UPDATE_CONVERSATION_GROUP:"update_contact_group",GET_CONVERSATION_GROUP_LIST:"get_contact_group",GET_MESSAGES:"getmsg",GET_C2C_ROAM_MESSAGES:"getroammsg",SET_C2C_PEER_MUTE_NOTIFICATIONS:"set_c2c_peer_mute_notifications",GET_C2C_PEER_MUTE_NOTIFICATIONS:"get_c2c_peer_mute_notifications",GET_GROUP_ROAM_MESSAGES:"group_msg_get",GET_READ_RECEIPT:"get_group_msg_receipt",GET_READ_RECEIPT_DETAIL:"get_group_msg_receipt_detail",SEND_READ_RECEIPT:"group_msg_receipt",SEND_C2C_READ_RECEIPT:"c2c_msg_read_receipt",SET_C2C_MESSAGE_READ:"msgreaded",GET_PEER_READ_TIME:"get_peer_read_time",SET_GROUP_MESSAGE_READ:"msg_read_report",FILE_READ_AND_WRITE_AUTHKEY:"authkey",FILE_UPLOAD:"pic_up",COS_SIGN:"cos",COS_PRE_SIG:"pre_sig",VIDEO_COVER:"video_cover",TIM_WEB_REPORT_V2:"tim_web_report_v2",BIG_DATA_HALLWAY_AUTH_KEY:"authkey",GET_ONLINE_MEMBER_NUM:"get_online_member_num",ALIVE:"alive",MESSAGE_PUSH:"msg_push",MULTI_MESSAGE_PUSH:"multi_msg_push_ws",MESSAGE_PUSH_ACK:"ws_msg_push_ack",STATUS_FORCE_OFFLINE:"stat_forceoffline",DOWNLOAD_MERGER_MESSAGE:"get_relay_json_msg",UPLOAD_MERGER_MESSAGE:"save_relay_json_msg",FETCH_CLOUD_CONTROL_CONFIG:"fetch_config",PUSHED_CLOUD_CONTROL_CONFIG:"push_configv2",FETCH_COMMERCIAL_CONFIG:"fetch_imsdk_purchase_bitsv2",PUSHED_COMMERCIAL_CONFIG:"push_imsdk_purchase_bitsv2",KICK_OTHER:"KickOther",OVERLOAD_NOTIFY:"notify2",SET_ALL_MESSAGE_READ:"read_all_unread_msg",CREATE_TOPIC:"create_topic",DELETE_TOPIC:"destroy_topic",UPDATE_TOPIC_PROFILE:"modify_topic",GET_TOPIC_LIST:"get_topic",SET_SELF_STATUS:"ws_set_custom_status",GET_USER_STATUS:"ws_get_user_status",SUBSCRIBE_USER_STATUS:"ws_status_subscribe",UNSUBSCRIBE_USER_STATUS:"ws_status_unsubscribe",GET_RPOFANITY_LIST:"get_local_words",TRANSLATE_TEXT:"ws_batch_trans_text",UPDATE_GROUP_COUNTER:"update_group_counter",GET_GROUP_COUNTER:"get_group_counter"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:"v4",group_open_http_svc:"v4",sns:"v4",profile:"v4",recentcontact:"v4",openpic:"v4",group_open_http_noauth_svc:"v4",group_open_long_polling_http_svc:"v4",group_open_long_polling_http_noauth_svc:"v4",imopenstat:"v4",im_cos_sign_svr:"v4",im_cos_msg:"v4",webim:"v4",im_open_push:"v4",im_open_status:"v4"}},B={SEARCH_MSG:new L(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new L(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new L(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new L(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new L(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new L(0,Math.pow(2,6)).toString(),USER_STATUS:new L(0,Math.pow(2,7)).toString(),CONV_MARK:new L(0,Math.pow(2,9)).toString(),CONV_GROUP:new L(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new L(0,Math.pow(2,11)).toString(),MSG_EXT:new L(0,Math.pow(2,13)).toString(),GRP_COUNTER:new L(0,Math.pow(2,15)).toString()},H="c2c_text_message",K="c2c_custom_message",W="group_text_message",Y="group_custom_message",j="user_profile",z="group_profile",J="group_member_profile";V.HOST.setCurrent(G);var X="undefined"!=typeof wx&&"function"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),Q="undefined"!=typeof qq&&"function"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),Z="undefined"!=typeof tt&&"function"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),$="undefined"!=typeof swan&&"function"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),ee="undefined"!=typeof my&&"function"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),te="undefined"!=typeof jd&&"function"==typeof jd.getSystemInfoSync,ne="undefined"!=typeof uni&&"undefined"==typeof window&&"function"==typeof uni.requireNativePlugin,oe="undefined"!=typeof uni,se=X||Q||Z||$||ee||ne||te,ae=("undefined"!=typeof uni||"undefined"!=typeof window)&&!se,re=Q?qq:Z?tt:$?swan:ee?my:X?wx:ne?uni:te?jd:{},ie=ae&&window&&window.navigator&&window.navigator.userAgent||"",ue=/(micromessenger|webbrowser)/i.test(ie),ce=/AppleWebKit\/([\d.]+)/i.exec(ie);ce&&parseFloat(ce.pop());var le,pe,de=(le="WEB",ue?le="WEB":Q?le="QQ_MP":Z?le="TT_MP":$?le="BAIDU_MP":ee?le="ALI_MP":X?le="WX_MP":ne&&(le="UNI_NATIVE_APP"),R[le]),ge=/iPad/i.test(ie),_e=/iPhone/i.test(ie)&&!ge,he=/iPod/i.test(ie),fe=_e||ge||he,ve=(pe=ie.match(/OS (\d+)_/i))&&pe[1]?pe[1]:null,me=/Android/i.test(ie),Me=function(){var e=ie.match(/Android (\d+)(?:\.(\d+))?(?:\.(\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+"."+e[2]):t||null}();!function(){var e=ie.match(/Chrome\/(\d+)/);e&&e[1]&&parseFloat(e[1])}();var ye=/MSIE/.test(ie)||ie.indexOf("Trident")>-1&&ie.indexOf("rv:11.0")>-1,Ie=function(){var e=/MSIE\s(\d+)\.\d/.exec(ie),t=e&&parseFloat(e[1]);return!t&&/Trident\/7.0/i.test(ie)&&/rv:11.0/.test(ie)&&(t=11),t}();!function(){var e=ie.match(/TBS\/(\d+)/i);if(e&&e[1])e[1]}();var Ce,Te,De=/Windows/i.test(ie),Ee=/MAC OS X/i.test(ie),Se=ae&&"undefined"!=typeof Worker&&!ye,ke=me||fe,Le=ae&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy;Ce="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Ae=function(){},Re=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],Ne=Re.length;Ne--;)Te=Re[Ne],console[Te]||(Ce[Te]=Ae);var Oe=Ce,Ge=0,Ue=function(){return(new Date).getTime()+Ge},Pe=function(){Ge=0},be=function(){return Math.floor(Ue()/1e3)},we=0;function Fe(){return Ht()?"%c TIM %c":"TIM"}function qe(){var e,t=((e=new Date).setTime(Ue()),e);return t.toLocaleTimeString("en-US",{hour12:!1})+"."+function(e){var t;switch(e.toString().length){case 1:t="00"+e;break;case 2:t="0"+e;break;default:t=e}return t}(t.getMilliseconds())}var xe={arguments2String:function(e){var t="";if(1===e.length)t=e[0];else for(var n=0,o=e.length;n=0?o[a]=t[a]:o[a]=e(t[a])):o[a]=void 0:o[a]=null;return o};function It(e,t){if(!st(e)||!st(t))return!1;var n=!1;return t.forEach((function(t){var o=t.key,s=t.value,a=e.find((function(e){return e.key===o}));a?a.value!==s&&(a.value=s,n=!0):(e.push({key:o,value:s}),n=!0)})),n}var Ct=function(e){return e===S.GRP_AVCHATROOM},Tt=function(e){var t=e.type,n=e.groupID;return t===S.GRP_COMMUNITY||"".concat(n).startsWith(ze)&&!"".concat(n).includes(Je)},Dt=function(e){return"".concat(e).startsWith(ze)&&"".concat(e).includes(Je)},Et=function(e){return et(e)&&e.slice(0,3)===S.CONV_C2C},St=function(e){return et(e)&&e.slice(0,5)===S.CONV_GROUP},kt=function(e){return et(e)&&e===S.CONV_SYSTEM};function Lt(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function At(e){return se?new Promise((function(t,n){re.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):ye&&9===Ie?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Rt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return"".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function Nt(){var e="unknown";if(Ee&&(e="mac"),De&&(e="windows"),fe&&(e="ios"),me&&(e="android"),se)try{var t=re.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(n){}return e}function Ot(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtha)return 1;if(s-1?"".concat(n,"&"):"".concat(n,"?");c.url="".concat(l,198===r?"imageView2/3/w/198/h/198":"imageView2/3/w/720/h/720")}return at(n)?(c.url,g(c,Xe)):c}function Ut(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n=0;o--)"1"===e[o]&&t.push(Math.pow(2,n-o-1));return t}function Ht(){return!ye&&!se}function Kt(e){return"the length of userIDList cannot exceed ".concat(e)}function Wt(e,t){if(e){var n=e;return t&&(e.startsWith("http://")?n=e.replace(/^http:\/\/[^/]+/,t):e.startsWith("https://")&&(n=e.replace(/^https:\/\/[^/]+/,t))),n}}var Yt=Object.prototype.hasOwnProperty;function jt(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(ot(e)){for(var t in e)if(Yt.call(e,t))return!1;return!0}return!(!Qe(e)&&(n=e,"set"!==ct(n))&&!Ze(e))&&0===e.size;var n}function zt(e,t,n){if(void 0===t)return!0;var o=!0;if(ot(t))Object.keys(t).forEach((function(s){var a=1===e.length?e[0][s]:void 0;o=!!Jt(a,t[s],n,s)&&o}));else if(st(t))for(var s=0;s256)||(en({api:"setConversationCustomData",param:"customData",desc:dn("customData",256)}),!1):(en({api:"setConversationCustomData",param:"customData",desc:tn()}),!1)}}},markConversation:{conversationIDList:t({},Cn),markType:{type:"number",validator:function(e){return $e(e)?e<=0?(en({api:"markConversation",param:"markType",desc:(t="markType",n=0,Sn("NumberGreaterThanLog",t,n))}),!1):!(e>=Math.pow(2,64))||(en({api:"markConversation",param:"markType",desc:gn("markType","Math.pow(2,64)")}),!1):(en({api:"markConversation",param:"markType",desc:on()}),!1);var t,n}},enableMark:t({},Dn)},createConversationGroup:{conversationIDList:t({},Cn),groupName:t(t({},In),{},{validator:function(e){return!!e&&(!(e.length>32)||(en({api:"createConversationGroup",param:"groupName",desc:dn("groupName",32)}),!1))}})},deleteConversationGroup:[t({name:"groupName"},In)],renameConversationGroup:{oldName:t({},In),newName:t(t({},In),{},{validator:function(e){return!!e&&(!(e.length>32)||(en({api:"renameConversationGroup",param:"newName",desc:dn("newName",32)}),!1))}})},addConversationsToGroup:{conversationIDList:t({},Cn),groupName:t({},In)},deleteConversationsFromGroup:{conversationIDList:t({},Cn),groupName:t({},In)},getGroupList:{groupProfileFilter:{type:"Array"}},getGroupProfile:{groupID:In,groupCustomFieldFilter:{type:"Array"},memberCustomFieldFilter:{type:"Array"}},getGroupProfileAdvance:{groupIDList:Cn},createGroup:{name:In},joinGroup:{groupID:In,type:{type:"String"},applyMessage:{type:"String"}},quitGroup:[t({name:"groupID"},In)],handleApplication:{message:Tn,handleAction:In,handleMessage:{type:"String"}},changeGroupOwner:{groupID:In,newOwnerID:In},updateGroupProfile:{groupID:In,muteAllMembers:{type:"Boolean"}},dismissGroup:[t({name:"groupID"},In)],searchGroupByID:[t({name:"groupID"},In)],initGroupAttributes:{groupID:In,groupAttributes:t(t({},Tn),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!et(e[n]))return en({api:"initGroupAttributes",param:"groupAttributes",desc:_n("value")}),t=!1})),t}})},setGroupAttributes:{groupID:In,groupAttributes:t(t({},Tn),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!et(e[n]))return en({api:"setGroupAttributes",param:"groupAttributes",desc:_n("value")}),t=!1})),t}})},deleteGroupAttributes:{groupID:In,keyList:{type:"Array",validator:function(e){if(at(e)||!st(e))return en({api:"deleteGroupAttributes",param:"keyList",desc:un()}),!1;if(!jt(e)){var t=!0;return e.forEach((function(e){if(!et(e))return en({api:"deleteGroupAttributes",param:"keyList",desc:Sn("StringArrayRequiredLog")}),t=!1})),t}return!0}}},getGroupAttributes:{groupID:In,keyList:{type:"Array",validator:function(e){if(at(e)||!st(e))return en({api:"getGroupAttributes",param:"keyList",desc:un()}),!1;if(!jt(e)){var t=!0;return e.forEach((function(e){if(!et(e))return en({api:"getGroupAttributes",param:"keyList",desc:_n("key")}),t=!1})),t}return!0}}},setGroupCounters:{groupID:In,counters:Tn},increaseGroupCounter:{groupID:In,key:In,value:En},decreaseGroupCounter:{groupID:In,key:In,value:En},getGroupCounters:{groupID:In},getGroupMemberList:{groupID:In,count:{type:"Number"}},getGroupMemberProfile:{groupID:In,userIDList:Cn,memberCustomFieldFilter:{type:"Array"}},addGroupMember:{groupID:In,userIDList:Cn},setGroupMemberRole:{groupID:In,userID:In,role:In},setGroupMemberMuteTime:{groupID:In,userID:In,muteTime:{type:"Number",validator:function(e){return e>=0}}},setGroupMemberNameCard:{groupID:In,userID:{type:"String"},nameCard:{type:"String",validator:function(e){return et(e)?(e.length,!0):(en({api:"setGroupMemberNameCard",param:"nameCard",desc:tn()}),!1)}}},setGroupMemberCustomField:{groupID:In,userID:{type:"String"},memberCustomField:Cn},deleteGroupMember:{groupID:In},markGroupMemberList:{groupID:In,markType:{type:"number",validator:function(e){return $e(e)?!(e<1e3)||(en({api:"markGroupMemberList",param:"markType",desc:(t="markType",n=1e3,Sn("NumberGreaterOrEqualLog",t,n))}),!1):(en({api:"markGroupMemberList",param:"markType",desc:on()}),!1);var t,n}},userIDList:t({},Cn),enableMark:t({},Dn)},createTextMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?et(e.text)?0!==e.text.length||(en({api:"createTextMessage",param:"payload.text",desc:fn()}),!1):(en({api:"createTextMessage",param:"payload.text",desc:tn()}),!1):(en({api:"createTextMessage",param:"payload",desc:hn()}),!1)}})},createTextAtMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?et(e.text)?0===e.text.length?(en({api:"createTextAtMessage",param:"payload.text",desc:fn()}),!1):!(e.atUserList&&!st(e.atUserList))||(en({api:"createTextAtMessage",param:"payload.atUserList",desc:un()}),!1):(en({api:"createTextAtMessage",param:"payload.text",desc:tn()}),!1):(en({api:"createTextAtMessage",param:"payload",desc:hn()}),!1)}})},createCustomMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?e.data&&!et(e.data)?(en({api:"createCustomMessage",param:"payload.data",desc:tn()}),!1):e.description&&!et(e.description)?(en({api:"createCustomMessage",param:"payload.description",desc:tn()}),!1):!(e.extension&&!et(e.extension))||(en({api:"createCustomMessage",param:"payload.extension",desc:tn()}),!1):(en({api:"createCustomMessage",param:"payload",desc:hn()}),!1)}})},createImageMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(!ot(e))return en({api:"createImageMessage",param:"payload",desc:hn()}),!1;if(at(e.file))return en({api:"createImageMessage",param:"payload.file",desc:sn()}),!1;if(ae){if(!(e.file instanceof HTMLInputElement||Ze(e.file)))return ot(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(en({api:"createImageMessage",param:"payload.file",desc:vn()}),!1):(en({api:"createImageMessage",param:"payload.file",desc:an()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return en({api:"createImageMessage",param:"payload.file",desc:vn()}),!1}return!0},onProgress:{type:"Function",required:!1,validator:function(e){return at(e)&&en({api:"createImageMessage",param:"onProgress",desc:ln()}),!0}}})},createAudioMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return!!ot(e)||(en({api:"createAudioMessage",param:"payload",desc:hn()}),!1)}}),onProgress:{type:"Function",required:!1,validator:function(e){return at(e)&&en({api:"createAudioMessage",param:"onProgress",desc:ln()}),!0}}},createVideoMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(!ot(e))return en({api:"createVideoMessage",param:"payload",desc:hn()}),!1;if(at(e.file))return en({api:"createVideoMessage",param:"payload.file",desc:sn()}),!1;if(ae){if(!(e.file instanceof HTMLInputElement||Ze(e.file)))return ot(e.file)&&"undefined"!=typeof uni?!!Ze(e.file.tempFile)||(en({api:"createVideoMessage",param:"payload.file",desc:vn()}),!1):(en({api:"createVideoMessage",param:"payload.file",desc:an()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return en({api:"createVideoMessage",param:"payload.file",desc:vn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e){return at(e)&&en({api:"createVideoMessage",param:"onProgress",desc:ln()}),!0}}},createFaceMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?$e(e.index)?!!et(e.data)||(en({api:"createFaceMessage",param:"payload.data",desc:tn()}),!1):(en({api:"createFaceMessage",param:"payload.index",desc:on()}),!1):(en({api:"createFaceMessage",param:"payload",desc:hn()}),!1)}})},createFileMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(!ot(e))return en({api:"createFileMessage",param:"payload",desc:hn()}),!1;if(at(e.file))return en({api:"createFileMessage",param:"payload.file",desc:sn()}),!1;if(ae){if(!(e.file instanceof HTMLInputElement||Ze(e.file)))return ot(e.file)&&"undefined"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(en({api:"createFileMessage",param:"payload.file",desc:vn()}),!1):(en({api:"createFileMessage",param:"payload.file",desc:an()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return en({api:"createFileMessage",param:"payload.file",desc:vn()}),!1}return!0}}),onProgress:{type:"Function",required:!1,validator:function(e){return at(e)&&en({api:"createFileMessage",param:"onProgress",desc:ln()}),!0}}},createLocationMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?et(e.description)?$e(e.longitude)?!!$e(e.latitude)||(en({api:"createLocationMessage",param:"payload.latitude",desc:on()}),!1):(en({api:"createLocationMessage",param:"payload.longitude",desc:on()}),!1):(en({api:"createLocationMessage",param:"payload.description",desc:tn()}),!1):(en({api:"createLocationMessage",param:"payload",desc:hn()}),!1)}})},createMergerMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(jt(e.messageList))return en({api:"createMergerMessage",param:"payload.messageList",desc:cn()}),!1;if(jt(e.compatibleText))return en({api:"createMergerMessage",param:"payload.compatibleText",desc:nn("compatibleText")}),!1;var t=!1;return e.messageList.forEach((function(e){e.status===Qt.FAIL&&(t=!0)})),!t||(en({api:"createMergerMessage",param:"payload.messageList",desc:Sn("MergeFailedMessageLog")}),!1)}})},revokeMessage:[t(t({name:"message"},Tn),{},{validator:function(e){return jt(e)?(en({api:"revokeMessage",param:"message",desc:mn()}),!1):e.conversationType===S.CONV_SYSTEM?(en({api:"revokeMessage",param:"message",desc:Sn("MessageCanBeRevokedDesc")}),!1):!0!==e.isRevoked||(en({api:"revokeMessage",param:"message",desc:Sn("MessageRevokedLog")}),!1)}})],deleteMessage:[t(t({name:"messageList"},Cn),{},{validator:function(e){return!jt(e)||(en({api:"deleteMessage",param:"messageList",desc:cn()}),!1)}})],translateText:{sourceTextList:Cn,sourceLanguage:In,targetLanguage:In},modifyMessage:[t(t({name:"message"},Tn),{},{validator:function(e){return jt(e)?(en({api:"modifyMessage",param:"message",desc:mn()}),!1):e.conversationType===S.CONV_SYSTEM?(en({api:"modifyMessage",param:"message",desc:Sn("MessageCanBeModifiedLog")}),!1):!0!==e._onlineOnlyFlag||(en({api:"modifyMessage",param:"message",desc:Sn("OnlineMessageNotSupportLog")}),!1)}})],getUserProfile:{userIDList:{type:"Array",validator:function(e){return st(e)?(0===e.length&&en({api:"getUserProfile",param:"userIDList",desc:cn()}),!0):(en({api:"getUserProfile",param:"userIDList",desc:un()}),!1)}}},updateMyProfile:{profileCustomField:{type:"Array",validator:function(e){return!!at(e)||(!!st(e)||(en({api:"updateMyProfile",param:"profileCustomField",desc:un()}),!1))}}},setSelfStatus:{customStatus:{type:"String",validator:function(e){return!!et(e)||(en({api:"setSelfStatus",param:"customStatus",desc:tn()}),!1)}}},getUserStatus:{userIDList:{type:"Array",validator:function(e){return st(e)?0!==e.length||(en({api:"getUserStatus",param:"userIDList",desc:cn()}),!1):(en({api:"getUserStatus",param:"userIDList",desc:un()}),!1)}}},subscribeUserStatus:{userIDList:{type:"Array",validator:function(e){return st(e)?0!==e.length||(en({api:"subscribeUserStatus",param:"userIDList",desc:cn()}),!1):(en({api:"subscribeUserStatus",param:"userIDList",desc:un()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:"Array",validator:function(e){return!e||(!!st(e)||(en({api:"subscribeUserStatus",param:"userIDList",desc:un()}),!1))}}},addFriend:{to:In,source:{type:"String",required:!0,validator:function(e){return!!e&&(e.startsWith("AddSource_Type_")?!(e.replace("AddSource_Type_","").length>8)||(en({api:"addFriend",param:"source",desc:dn("keyword",8)}),!1):(en({api:"addFriend",param:"source",desc:Sn("SourcePrefixLog")}),!1))}},remark:{type:"String",required:!1,validator:function(e){return!(et(e)&&e.length>96)||(en({api:"addFriend",param:"remark",desc:dn("remark",96)}),!1)}}},deleteFriend:{userIDList:Cn},checkFriend:{userIDList:Cn},getFriendProfile:{userIDList:Cn},updateFriend:{userID:In,remark:{type:"String",required:!1,validator:function(e){return!(et(e)&&e.length>96)||(en({api:"updateFriend",param:"remark",desc:dn("remark",96)}),!1)}},friendCustomField:{type:"Array",required:!1,validator:function(e){if(e){if(!st(e))return en({api:"updateFriend",param:"friendCustomField",desc:un()}),!1;var t=!0;return e.forEach((function(e){return et(e.key)&&-1!==e.key.indexOf("Tag_SNS_Custom")?et(e.value)?e.key.replace("Tag_SNS_Custom_","").length>8?(en({api:"updateFriend",param:"friendCustomField",desc:dn("keyword",8)}),t=!1):void 0:(en({api:"updateFriend",param:"friendCustomField",desc:_n("value")}),t=!1):(en({api:"updateFriend",param:"friendCustomField",desc:Sn("FriendCustomFieldPrefixLog")}),t=!1)})),t}return!0}}},acceptFriendApplication:{userID:In},refuseFriendApplication:{userID:In},deleteFriendApplication:{userID:In},createFriendGroup:{name:In},deleteFriendGroup:{name:In},addToFriendGroup:{name:In,userIDList:Cn},removeFromFriendGroup:{name:In,userIDList:Cn},renameFriendGroup:{oldName:In,newName:In},sendMessageReadReceipt:[{name:"messageList",type:"Array",validator:function(e){return st(e)?0!==e.length||(en({api:"sendMessageReadReceipt",param:"messageList",desc:cn()}),!1):(en({api:"sendMessageReadReceipt",param:"messageList",desc:un()}),!1)}}],getMessageReadReceiptList:[{name:"messageList",type:"Array",validator:function(e){return st(e)?0!==e.length||(en({api:"getMessageReadReceiptList",param:"messageList",desc:cn()}),!1):(en({api:"getMessageReadReceiptList",param:"messageList",desc:un()}),!1)}}],createTopicInCommunity:{groupID:In,topicName:In},deleteTopicFromCommunity:{groupID:In,topicIDList:{type:"Array",validator:function(e){return!e||(!!st(e)||(en({api:"deleteTopicFromCommunity",param:"topicIDList",desc:un()}),!1))}}},updateTopicProfile:{groupID:In,topicID:In},getTopicList:{groupID:In,topicIDList:{type:"Array",validator:function(e){return!e||(!!st(e)||(en({api:"getTopicList",param:"topicIDList",desc:un()}),!1))}}}},Ln={login:1,logout:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1},An=1,Rn=2,Nn=3,On=4,Gn=6,Un=7,Pn=8,bn=9,wn=10,Fn=11,qn=12,xn=13,Vn=14,Bn=15,Hn=16,Kn=17,Wn=18,Yn=19,jn=20,zn=21,Jn=22,Xn=23,Qn=24,Zn=25,$n=26,eo=27,to=28,no=29,oo=30,so=31,ao=32,ro=function(){function e(t){o(this,e),this._m=t,this._n=""}return a(e,[{key:"isLoggedIn",value:function(){return this._m.getModule(qn).isLoggedIn()}},{key:"isOversea",value:function(){return this._m.getModule(qn).isOversea()}},{key:"isPrivateNetWork",value:function(){return this._m.getModule(qn).isPrivateNetWork()}},{key:"getFileDownloadProxy",value:function(){return this._m.getModule(qn).getFileDownloadProxy()}},{key:"getMyUserID",value:function(){return this._m.getModule(qn).getUserID()}},{key:"getMyTinyID",value:function(){return this._m.getModule(qn).getTinyID()}},{key:"getSDKAppID",value:function(){return this._m.getModule(qn).getSDKAppID()}},{key:"isIntl",value:function(){return this._m.getModule(qn).isIntl()}},{key:"isDevMode",value:function(){return this._m.getModule(qn).isDevMode()}},{key:"getModule",value:function(e){return this._m.getModule(e)}},{key:"getPlatform",value:function(){return de}},{key:"getNetworkType",value:function(){return this._m.getModule(Bn).getNetworkType()}},{key:"probeNetwork",value:function(e){return this._m.getModule(Bn).probe(e)}},{key:"getCloudConfig",value:function(e){return this._m.getModule(Xn).getCloudConfig(e)}},{key:"emitOuterEvent",value:function(e,t){this._m.getOuterEmitterInstance().emit(e,t)}},{key:"emitInnerEvent",value:function(e,t){this._m.getInnerEmitterInstance().emit(e,t)}},{key:"getInnerEmitterInstance",value:function(){return this._m.getInnerEmitterInstance()}},{key:"generateTjgID",value:function(e){return this._m.getModule(qn).getTinyID()+"-"+e.random}},{key:"filterModifiedMessage",value:function(e){if(!jt(e)){var t=e.filter((function(e){return!0===e.isModified}));t.length>0&&this.emitOuterEvent(E.MESSAGE_MODIFIED,t)}}},{key:"filterUnmodifiedMessage",value:function(e){return jt(e)?[]:e.filter((function(e){return!1===e.isModified}))}},{key:"request",value:function(e){return this._m.getModule(jn).request(e)}},{key:"canIUse",value:function(e){return this._m.getModule(eo).canIUse(e)}},{key:"getErrorMessage",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:"outputWarning",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&xe.w(o)}}]),e}(),io="wslogin",uo="wslogout",co="wshello",lo="KickOther",po="getmsg",go="authkey",_o="sendmsg",ho="send_group_msg",fo="portrait_get_all",vo="portrait_set",mo="black_list_get",Mo="black_list_add",yo="black_list_delete",Io="msgwithdraw",Co="msgreaded",To="set_c2c_peer_mute_notifications",Do="get_c2c_peer_mute_notifications",Eo="getroammsg",So="get_peer_read_time",ko="delete_c2c_msg_ramble",Lo="modify_c2c_msg",Ao="set_key_values",Ro="get_key_values",No="page_get",Oo="get",Go="batch_delete",Uo="clear_msg",Po="top",bo="deletemsg",wo="set_conv_custom_data",Fo="mark_contact",qo="create_contact_group",xo="del_contact_group",Vo="update_contact_group",Bo="add_conv_to_group",Ho="del_conv_from_group",Ko="get_contact_group",Wo="get_joined_group_list",Yo="get_group_self_member_info",jo="create_group",zo="destroy_group",Jo="modify_group_base_info",Xo="apply_join_group",Qo="apply_join_group_noauth",Zo="quit_group",$o="get_group_public_info",es="change_group_owner",ts="handle_apply_join_group",ns="handle_invite_join_permission_group",os="handle_invite_join_group",ss="group_msg_recall",as="msg_read_report",rs="read_all_unread_msg",is="group_msg_get",us="get_group_msg_receipt",cs="group_msg_receipt",ls="c2c_msg_read_receipt",ps="get_group_msg_receipt_detail",ds="get_pendency",gs="deletemsg",_s="get_msg",hs="get_msg_noauth",fs="get_online_member_num",vs="delete_group_ramble_msg_by_seq",ms="modify_group_msg",Ms="set_group_attr",ys="modify_group_attr",Is="delete_group_attr",Cs="clear_group_attr",Ts="get_group_attr",Ds="group_set_key_values",Es="group_get_key_values",Ss="get_group_notify",ks="update_group_counter",Ls="get_group_counter",As="get_group_member_info",Rs="get_members",Ns="get_specified_group_member_info",Os="add_group_member",Gs="delete_group_member",Us="ban_group_member",Ps="modify_group_member_info",bs="modify_user_info",ws="cos",Fs="pre_sig",qs="video_cover",xs="tim_web_report_v2",Vs="alive",Bs="msg_push",Hs="multi_msg_push_ws",Ks="ws_msg_push_ack",Ws="stat_forceoffline",Ys="save_relay_json_msg",js="get_relay_json_msg",zs="fetch_config",Js="push_configv2",Xs="fetch_imsdk_purchase_bitsv2",Qs="push_imsdk_purchase_bitsv2",Zs="notify2",$s="create_topic",ea="destroy_topic",ta="modify_topic",na="get_topic",oa="ws_set_custom_status",sa="ws_get_user_status",aa="ws_status_subscribe",ra="ws_status_unsubscribe",ia="ws_stat_background",ua="ws_stat_foreground",ca="ws_stat_settoken",la="get_local_words",pa="ws_batch_trans_text",da={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,MESSAGE_SEND_FAIL:2100,MESSAGE_SEND_FAIL_NOT_IN_AVCHATROOM:2101,MESSAGE_SEND_NEED_MESSAGE_INSTANCE:2105,MESSAGE_SEND_INVALID_CONVERSATION_TYPE:2106,MESSAGE_FILE_IS_EMPTY:2108,MESSAGE_ONPROGRESS_FUNCTION_ERROR:2109,MESSAGE_REVOKE_FAIL:2110,MESSAGE_DELETE_FAIL:2111,MESSAGE_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MESSAGE_LIST_EMPTY:2114,MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GROUP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,MESSAGE_IMAGE_SELECT_FILE_FIRST:2251,MESSAGE_IMAGE_TYPES_LIMIT:2252,MESSAGE_IMAGE_SIZE_LIMIT:2253,MESSAGE_AUDIO_UPLOAD_FAIL:2300,MESSAGE_AUDIO_SIZE_LIMIT:2301,MESSAGE_VIDEO_UPLOAD_FAIL:2350,MESSAGE_VIDEO_SIZE_LIMIT:2351,MESSAGE_VIDEO_TYPES_LIMIT:2352,MESSAGE_FILE_UPLOAD_FAIL:2400,MESSAGE_FILE_SELECT_FILE_FIRST:2401,MESSAGE_FILE_SIZE_LIMIT:2402,MESSAGE_FILE_URL_IS_EMPTY:2403,MESSAGE_MERGER_TYPE_INVALID:2450,MESSAGE_MERGER_KEY_INVALID:2451,MESSAGE_MERGER_DOWNLOAD_FAIL:2452,MESSAGE_FORWARD_TYPE_INVALID:2453,MESSAGE_MODIFY_CONFLICT:2480,MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM:2481,CONVERSATION_NOT_FOUND:2500,USER_OR_GROUP_NOT_FOUND:2501,CONVERSATION_UN_RECORDED_TYPE:2502,INVALID_CONVERSATION_ID:2503,ILLEGAL_GROUP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GROUP_ID:2602,CANNOT_FIND_GROUP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_WORK:2622,MEMBER_NOT_IN_GROUP:2623,JOIN_GROUP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GROUP_EXISTED:2710,FRIEND_GROUP_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,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_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,CANNOT_USE_COMMERCIAL_ABILITY:3122,PROFANITY_FOUND:3123,MESSAGE_A2KEY_EXPIRED:20002,ACCOUNT_A2KEY_EXPIRED:70001,HELLO_ANSWER_KICKED_OUT:1002,OPEN_SERVICE_OVERLOAD_ERROR:60022},ga="networkRTT",_a="messageE2EDelay",ha="sendMessageC2C",fa="sendMessageGroup",va="sendMessageGroupAV",ma="sendMessageRichMedia",Ma="cosUpload",ya="messageReceivedGroup",Ia="messageReceivedGroupAVPush",Ca="messageReceivedGroupAVPull",Ta=(r(Xt={},ga,2),r(Xt,_a,3),r(Xt,ha,4),r(Xt,fa,5),r(Xt,va,6),r(Xt,ma,7),r(Xt,ya,8),r(Xt,Ia,9),r(Xt,Ca,10),r(Xt,Ma,11),Xt),Da={info:4,warning:5,error:6},Ea={wifi:1,"2g":2,"3g":3,"4g":4,"5g":5,unknown:6,none:7,online:8},Sa={login:4},ka=function(){function e(t){o(this,e),this._n="SSOLogData",this.eventType=Sa[t]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message="",this.moreMessage="",this.extension=t,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=Ue()}return a(e,[{key:"updateTimeStamp",value:function(){this.timestamp=Ue()}},{key:"start",value:function(e){return this._startts=e,this}},{key:"end",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var n=Ue();0===this.costTime&&(this.costTime=n-this._startts),this.setMoreMessage("startts:".concat(this._startts," endts:").concat(n)),t?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){e._sentFlag=!0,e._eventStatModule&&e._eventStatModule.pushIn(e)}),0)}}},{key:"setError",value:function(e,t,n){if(!(e instanceof Error))return xe.w("".concat(this._n,".setError value not instanceof Error, please check!")),this;if(this._sentFlag)return this;if(this.setNetworkType(n),t)e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message);else{var o=da.NO_NETWORK;this.setCode(o)}return this.setLevel("error"),this}},{key:"setCode",value:function(e){return at(e)||this._sentFlag||("ECONNABORTED"===e&&(this.code=103),$e(e)?this.code=e:xe.w("".concat(this._n,".setCode value not a number, please check!"),e,n(e))),this}},{key:"setMessage",value:function(e){return at(e)||this._sentFlag||($e(e)&&(this.message=e.toString()),et(e)&&(this.message=e)),this}},{key:"setCostTime",value:function(e){return this.costTime=e,this}},{key:"setLevel",value:function(e){return at(e)||this._sentFlag||(this.level=Da[e]),this}},{key:"setMoreMessage",value:function(e){return jt(this.moreMessage)?this.moreMessage="".concat(e):this.moreMessage+=" ".concat(e),this}},{key:"setNetworkType",value:function(e){if(at(e))xe.w("".concat(this._n,".setNetworkType value is undefined, please check!"));else{var t=Ea[e.toLowerCase()];at(t)||(this.networkType=t)}return this}},{key:"getStartTs",value:function(){return this._startts}},{key:"setUIPlatform",value:function(e){this.uiPlatform=e}}],[{key:"bindEventStatModule",value:function(t){e.prototype._eventStatModule=t}}]),e}(),La=function(){function e(t){o(this,e),this.type=S.MSG_TEXT,this.content={text:t.text||""}}return a(e,[{key:"setText",value:function(e){this.content.text=e}},{key:"sendable",value:function(){return 0!==this.content.text.length}}]),e}(),Aa=function(){function e(t,n){o(this,e),this._imageMemoryURL="",this._fileDownloadProxy=n,se?this.createImageDataASURLInWXMiniApp(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=S.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||Ve.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._autoFixUrl()}return a(e,[{key:"_initImageInfoModel",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=_t(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.url||"",this.url=Wt(t.url||e._imageMemoryURL,e._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(e){e&&(this.imageUrl=e)},getImageUrl:function(){return this.imageUrl}}}},{key:"initImageInfoArray",value:function(e){for(var t=0,n=null,o=null;t<=2;)o=at(e)||at(e[t])?{type:0,size:0,width:0,height:0,url:""}:e[t],(n=new this._ImageInfoModel(o)).setSizeType(t+1),n.setType(t),this.addImageInfo(n),t++;this.updateAccessSideImageInfoArray()}},{key:"updateImageInfoArray",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o1&&(this._percent=1)}},{key:"updateImageFormat",value:function(e){this.content.imageFormat=Ve[e.toUpperCase()]||Ve.UNKNOWN}},{key:"createImageDataASURLInWeb",value:function(e){void 0!==e&&e.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:"createImageDataASURLInWXMiniApp",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:"replaceImageInfo",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:"addImageInfo",value:function(e){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(e)}},{key:"updateAccessSideImageInfoArray",value:function(){var e=this.content.imageInfoArray,t=e[0],n=t.width,o=void 0===n?0:n,s=t.height,a=void 0===s?0:s;0!==o&&0!==a&&(Ut(e),Object.assign(e[2],Gt({originWidth:o,originHeight:a,min:720})))}},{key:"sendable",value:function(){return 0!==this.content.imageInfoArray.length&&(""!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size)}}]),e}(),Ra=function(){function e(t){o(this,e),this.type=S.MSG_FACE,this.content=t||null}return a(e,[{key:"sendable",value:function(){return null!==this.content}}]),e}(),Na=function(){function e(t,n){o(this,e),this.type=S.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:t.second,size:t.size,url:Wt(t.url,n),remoteAudioUrl:t.url||"",uuid:t.uuid}}return a(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateAudioUrl",value:function(e){this.content.remoteAudioUrl=e}},{key:"sendable",value:function(){return""!==this.content.remoteAudioUrl}}]),e}(),Oa={from:!0,groupID:!0,groupName:!0,to:!0},Ga=function(){function e(t){o(this,e),this.type=S.MSG_GRP_TIP,this.content={},this._initContent(t)}return a(e,[{key:"_initContent",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"remarkInfo":break;case"groupProfile":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case"operatorInfo":break;case"memberInfoList":case"msgMemberInfo":t._updateMemberList(e[n]);break;case"memberExtraInfo":case"onlineMemberInfo":break;case"memberNum":t.content[n]=e[n],t.content.memberCount=e[n];break;case"newGroupProfile":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:"_initGroupProfile",value:function(e){for(var t=Object.keys(e),n=0;n1&&(this._percent=1)}},{key:"updateFileUrl",value:function(e){this.content.fileUrl=e}},{key:"sendable",value:function(){return""!==this.content.fileUrl&&(""!==this.content.fileName&&0!==this.content.fileSize)}}]),e}(),wa=function(){function e(t){o(this,e),this.type=S.MSG_CUSTOM,this.content={data:t.data||"",description:t.description||"",extension:t.extension||""}}return a(e,[{key:"setData",value:function(e){return this.content.data=e,this}},{key:"setDescription",value:function(e){return this.content.description=e,this}},{key:"setExtension",value:function(e){return this.content.extension=e,this}},{key:"sendable",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),Fa=function(){function e(t,n){o(this,e),this.type=S.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:t.remoteVideoUrl||t.videoUrl||"",videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:Wt(t.videoUrl,n),videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:Wt(t.thumbUrl,n),snapshotUrl:Wt(t.thumbUrl,n)}}return a(e,[{key:"updatePercent",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:"updateVideoUrl",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:"updateSnapshotInfo",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth,o=e.snapshotHeight;jt(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),jt(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),jt(o)||(this.content.thumbHeight=this.content.snapshotHeight=Number(o))}},{key:"sendable",value:function(){return""!==this.content.remoteVideoUrl}}]),e}(),qa=function(){function e(t){o(this,e),this.type=S.MSG_LOCATION;var n=t.description,s=t.longitude,a=t.latitude;this.content={description:n,longitude:s,latitude:a}}return a(e,[{key:"sendable",value:function(){return!0}}]),e}(),xa=function(){function e(t,n){if(o(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||"",this.clientTime=t.clientTime||void 0,t.ID)this.ID=t.ID||"",this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType.startsWith(S.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(S.CONV_GROUP)&&(this.receiverGroupID=t.to),this.messageReceiver=t.to;else{this.nick=t.nick||"",this.avatar=t.avatar||"",this.messageBody=[];var s=t.elements[0].type,a=t.elements[0].content;this._patchRichMediaPayload(s,a),this._updateRichMediaDownloadUrl(s,a,n),s===S.MSG_MERGER?this.messageBody.push({type:s,payload:new Va(a).content}):this.messageBody.push({type:s,payload:a}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID="".concat(t.tinyID,"-").concat(t.clientTime,"-").concat(t.random)}}return a(e,[{key:"_patchRichMediaPayload",value:function(e,t){e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(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===S.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===S.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===S.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}},{key:"_updateRichMediaDownloadUrl",value:function(e,t,n){n&&(e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){e.url=Wt(e.url,n)})):e===S.MSG_VIDEO?(t.videoUrl=Wt(t.videoUrl,n),t.snapshotUrl=Wt(t.thumbUrl,n),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===S.MSG_AUDIO?t.url=Wt(t.url,n):e===S.MSG_FILE&&(t.fileUrl=Wt(t.fileUrl,n)))}}]),e}(),Va=function(){function e(t,n){if(o(this,e),this.type=S.MSG_MERGER,this.content={downloadKey:"",pbDownloadKey:"",messageList:[],title:"",abstractList:[],compatibleText:"",version:0,layersOverLimit:!1},t.downloadKey){var s=t.downloadKey,a=t.pbDownloadKey,r=t.title,i=t.abstractList,u=t.compatibleText,c=t.version;this.content.downloadKey=s,this.content.pbDownloadKey=a,this.content.title=r,this.content.abstractList=i,this.content.compatibleText=u,this.content.version=c||0}else if(jt(t.messageList))1===t.layersOverLimit&&(this.content.layersOverLimit=!0);else{var l=t.messageList,p=t.title,d=t.abstractList,g=t.compatibleText,_=t.version,h=[];l.forEach((function(e){if(!jt(e)){var t=new xa(e,n);h.push(t)}})),this.content.messageList=h,this.content.title=p,this.content.abstractList=d,this.content.compatibleText=g,this.content.version=_||0}}return a(e,[{key:"sendable",value:function(){return!jt(this.content.messageList)||!jt(this.content.downloadKey)}}]),e}(),Ba={1:S.MSG_PRIORITY_HIGH,2:S.MSG_PRIORITY_NORMAL,3:S.MSG_PRIORITY_LOW,4:S.MSG_PRIORITY_LOWEST},Ha=function(){function e(t){o(this,e),this.ID="",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||S.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:_t(),this.priority=this._computePriority(t.priority),this.nick=t.nick||"",this.avatar=t.avatar||"",this.isPeerRead=!1,this.nameCard="",this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow="",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||"JSON",this.isResend=!1,this.isRead=!1,this.status=t.status||Qt.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||"",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||be()||0,this.senderTinyID=t.senderTinyID||t.tinyID||"",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this._receiverList=t.receiverList||void 0,this.isSupportExtension=!0===t.isSupportExtension||1===t.isSupportExtension,this.revoker=t.revokerInfo&&t.revokerInfo.revoker||null,this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t),this.initC2CReadReceiptInfo(t.readReceiptSentByPeer)}return a(e,[{key:"elements",get:function(){return this._elements}},{key:"getElements",value:function(){return this._elements}},{key:"extractGroupInfo",value:function(e){if(null!==e){et(e.nick)&&(this.nick=e.nick),et(e.avatar)&&(this.avatar=e.avatar);var t=e.messageFromAccountExtraInformation;ot(t)&&et(t.nameCard)&&(this.nameCard=t.nameCard)}}},{key:"handleGroupAtInfo",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==S.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(S.MSG_AT_ALL))})),st(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(S.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(e){e&&(this.status=this.from?Qt.SUCCESS:Qt.UNSEND,!this.from&&(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:"isSendable",value:function(){return 0!==this._elements.length&&("function"==typeof this._elements[0].sendable&&this._elements[0].sendable())}},{key:"_initTo",value:function(e){this.conversationType===S.CONV_GROUP&&(this.to=e.groupID)}},{key:"_initSequence",value:function(e){0===this.clientSequence&&e&&(this.clientSequence=function(e){if(!e)return!1;if(void 0===mt[e]){var t=new Date,n="3".concat(t.getHours()).slice(-2),o="0".concat(t.getMinutes()).slice(-2),s="0".concat(t.getSeconds()).slice(-2);mt[e]=parseInt([n,o,s,"0001"].join("")),n=null,o=null,s=null,xe.l("autoIncrementIndex start index:".concat(mt[e]))}return mt[e]++}(e)),0===this.sequence&&this.conversationType===S.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:"generateMessageID",value:function(){this.from===S.CONV_SYSTEM&&(this.senderTinyID="144115198244471703"),this.ID="".concat(this.senderTinyID,"-").concat(this.clientTime,"-").concat(this.random)}},{key:"_initFlow",value:function(e){""!==e&&(e===this.from?(this.flow="out",this.isRead=!0):this.flow="in")}},{key:"_concatConversationID",value:function(e){var t=this.to,n="",o=this.conversationType;o!==S.CONV_SYSTEM?(n=o===S.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID=n?"".concat(o).concat(n):null):this.conversationID=S.CONV_SYSTEM}},{key:"isElement",value:function(e){return e instanceof La||e instanceof Aa||e instanceof Ra||e instanceof Na||e instanceof ba||e instanceof Fa||e instanceof Ga||e instanceof Pa||e instanceof wa||e instanceof qa||e instanceof Va}},{key:"setElement",value:function(e,t){var n=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();var o=function(e){if(e.type&&e.content)switch(e.type){case S.MSG_TEXT:n.setTextElement(e.content);break;case S.MSG_IMAGE:n.setImageElement(e.content,t);break;case S.MSG_AUDIO:n.setAudioElement(e.content,t);break;case S.MSG_FILE:n.setFileElement(e.content,t);break;case S.MSG_VIDEO:n.setVideoElement(e.content,t);break;case S.MSG_CUSTOM:n.setCustomElement(e.content);break;case S.MSG_LOCATION:n.setLocationElement(e.content);break;case S.MSG_GRP_TIP:n.setGroupTipElement(e.content);break;case S.MSG_GRP_SYS_NOTICE:n.setGroupSystemNoticeElement(e.content);break;case S.MSG_FACE:n.setFaceElement(e.content);break;case S.MSG_MERGER:n.setMergerElement(e.content,t)}};if(st(e))for(var s=0;s1&&void 0!==arguments[1]&&arguments[1];if(e instanceof Wa)return t&&null!==Ya&&Ya.emit(E.ERROR,e),Promise.reject(e);if(e instanceof Error){var n=new Wa({code:da.UNCAUGHT_ERROR});return t&&null!==Ya&&Ya.emit(E.ERROR,n),Promise.reject(n)}if(!at(e)&&!at(e.code)){var o=new Wa(e);return t&&null!==Ya&&Ya.emit(E.ERROR,o),Promise.reject(o)}},Xa=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="C2CModule",t._messageFromUnreadDBMap=new Map,t._signalingFromUnreadDBList=[],t}return a(s,[{key:"onNewC2CMessage",value:function(e){var t=e.dataList,n=e.isInstantMessage,o=e.C2CRemainingUnreadList,s=e.C2CPairUnreadList;xe.d("".concat(this._n,".onNewC2CMessage count:").concat(t.length," isInstantMessage:").concat(n));var a=this._newC2CMessageStoredAndSummary({dataList:t,C2CRemainingUnreadList:o,C2CPairUnreadList:s,isInstantMessage:n}),r=a.conversationOptionsList,i=a.messageList,u=a.isUnreadC2CMessage;(this.filterModifiedMessage(i),r.length>0)&&this.getModule(Fn).onNewMessage({conversationOptionsList:r,isInstantMessage:n,isUnreadC2CMessage:u});var c=this.filterUnmodifiedMessage(i);n&&c.length>0&&this.emitOuterEvent(E.MESSAGE_RECEIVED,c),i.length=0}},{key:"_newC2CMessageStoredAndSummary",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,s=e.isInstantMessage,a=null,r=[],i=[],u={},c=this.getModule(Hn),l=this.getModule($n),p=!1,d=this.getModule(Fn),g=this.getFileDownloadProxy(),_=0,h=t.length;_0&&l.addMessageDelay(a.clientTime)}else this._messageFromUnreadDBMap.set(a.ID,1);if(0!==f.msgLifeTime){if(!1===a._onlineOnlyFlag){var k=d.getLastMessageTime(v);if($e(k)&&a.time0){R=!0;var n=r.find((function(t){return t.conversationID==="C2C".concat(o[e].from)}));n?n.unreadCount=o[e].unreadCount:r.push({conversationID:"C2C".concat(o[e].from),unreadCount:o[e].unreadCount,type:S.CONV_C2C})}},O=0,G=o.length;O0&&(o=e.cloudCustomData);var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c=this.isOnlineMessage(e,t)?0:void 0;return{protocolName:_o,tjgID:this.generateTjgID(e),requestData:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:c,nick:e.nick,avatar:e.avatar,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:0!==c?s:void 0,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0,isSupportExtension:!0===e.isSupportExtension?1:0}}}},{key:"_isVoipPush",value:function(e){var t=void 0;return at(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:"isOnlineMessage",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:"revokeMessage",value:function(e){return this.request({protocolName:Io,requestData:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;return xe.l("".concat(this._n,".deleteMessage toAccount:").concat(t," count:").concat(n.length)),this.request({protocolName:ko,requestData:{fromAccount:this.getMyUserID(),to:t,keyList:n}})}},{key:"modifyRemoteMessage",value:function(e){var t=e.from,n=e.to,o=e.version,s=void 0===o?0:o,a=e.sequence,r=e.random,i=e.time,u=e.payload,c=e.type,l=e.cloudCustomData,p=void 0;return Vt(c)&&(p=[]).push({type:c,content:u}),this.request({protocolName:Lo,requestData:{from:t,to:n,version:s,sequence:a,random:r,time:i,elements:p,cloudCustomData:l}})}},{key:"setMessageRead",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,s="".concat(this._n,".setMessageRead");xe.l("".concat(s," conversationID:").concat(n," lastMessageTime:").concat(o)),$e(o)||this.outputWarning("DoNotModifyLastTime");var a=new ka("setC2CMessageRead");return a.setMessage("conversationID:".concat(n," lastMessageTime:").concat(o)),this.request({protocolName:Co,requestData:{C2CMsgReaded:{cookie:"",C2CMsgReadedItem:[{toAccount:n.replace("C2C",""),lastMessageTime:o,receipt:1}]}}}).then((function(){a.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(s," ok"));var e=t.getModule(Fn);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),Ka()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.l("".concat(s," failed. error:"),e),Ja(e)}))}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessage"),o=e.peerAccount,s=e.conversationID,a=e.count,r=e.lastMessageTime,i=e.messageKey,u="peerAccount:".concat(o," count:").concat(a||15," lastMessageTime:").concat(r||0," messageKey:").concat(i);xe.l("".concat(n," ").concat(u));var c=new ka("getC2CRoamingMessages");return this.request({protocolName:Eo,requestData:{peerAccount:o,count:a||15,lastMessageTime:r||0,messageKey:i}}).then((function(e){var o=e.data,a=o.complete,r=o.messageList,i=o.messageKey,l=o.lastMessageTime;at(r)?xe.l("".concat(n," ok. complete:").concat(a," but messageList is undefined!")):xe.l("".concat(n," ok. complete:").concat(a," count:").concat(r.length)),c.setNetworkType(t.getNetworkType()).setMessage("".concat(u," complete:").concat(a," length:").concat(r.length)).end();var p=t.getModule(Fn);1===a&&p.setCompleted(s);var d=p.onRoamingMessage(r,s);p.modifyMessageList(s),p.updateIsRead(s),p.updateRoamingMessageKeyAndTime(s,i,l);var g=p.getPeerReadTime(s);if(xe.l("".concat(n," update isPeerRead property. conversationID:").concat(s," peerReadTime:").concat(g)),g)p.updateMessageIsPeerReadProperty(s,g);else{var _=s.replace(S.CONV_C2C,"");t.getRemotePeerReadTime([_]).then((function(){p.updateMessageIsPeerReadProperty(s,p.getPeerReadTime(s))}))}var h="";if(d.length>0)h=d[0].ID;else{var f=p.getLocalOldestMessage(s);f&&(h=f.ID)}return xe.l("".concat(n," nextReqID:").concat(h," stored message count:").concat(d.length)),{nextReqID:h,storedMessageList:d}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setMessage(u).setError(e,o,s).end()})),xe.w("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessagesHopping"),o=e.peerAccount,s=e.time,a=void 0===s?0:s,r=e.count,i=e.direction,u="".concat(S.CONV_C2C).concat(o),c="peerAccount:".concat(o," count:").concat(r," time:").concat(a," direction:").concat(i);xe.l("".concat(n," ").concat(c));var l=new ka("getC2CRoamingMessagesHopping");return this.request({protocolName:Eo,requestData:{peerAccount:o,count:r+1,lastMessageTime:a,direction:i}}).then((function(e){var o=e.data,s=o.complete,a=o.messageList,r=void 0===a?[]:a,p=o.lastMessageTime;xe.l("".concat(n," ok. complete:").concat(s," count:").concat(r.length)),l.setNetworkType(t.getNetworkType()).setMessage("".concat(c," complete:").concat(s," length:").concat(r.length)).end(),1!==s&&(1===i?r.pop():r.shift());var d=t.getModule(Fn).onRoamingMessage(r,u,!1);t._modifyMessageList(u,d);var g=t._computeResult({complete:s,lastMessageTime:p,resultList:d});return Ka(g)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setMessage(c).setError(e,o,s).end()})),xe.w("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_computeResult",value:function(e){var t=e.complete,n=void 0===t?0:t,o=e.lastMessageTime,s=e.resultList,a={messageList:m(void 0===s?[]:s),isCompleted:!1,nextMessageTime:""};return 1===n?(a.isCompleted=!0,a):(a.nextMessageTime=o,a)}},{key:"_modifyMessageList",value:function(e,t){var n=this.getModule(Fn).getLocalConversation(e);if(n)for(var o=n.userProfile.nick,s=n.userProfile.avatar,a=this.getModule(On).getNickAndAvatarByUserID(this.getMyUserID()),r=a.nick,i=a.avatar,u=t.length-1;u>=0;u--){var c=t[u];"in"===c.flow&&(c.nick!==o&&c.setNickAndAvatar({nick:o}),c.avatar!==s&&c.setNickAndAvatar({avatar:s})),"out"===c.flow&&(c.nick!==r&&c.setNickAndAvatar({nick:r}),c.avatar!==i&&c.setNickAndAvatar({avatar:i}))}}},{key:"getRemotePeerReadTime",value:function(e){var t=this,n="".concat(this._n,".getRemotePeerReadTime");if(jt(e))return xe.w("".concat(n," userIDList is empty!")),Promise.resolve();var o=new ka("getPeerReadTime");return xe.l("".concat(n," userIDList:").concat(e)),this.request({protocolName:So,requestData:{userIDList:e}}).then((function(s){var a=s.data.peerReadTimeList;xe.l("".concat(n," ok. peerReadTimeList:").concat(a));for(var r="",i=t.getModule(Fn),u=0;u0&&i.recordPeerReadTime("C2C".concat(e[u]),a[u]);o.setNetworkType(t.getNetworkType()).setMessage(r).end()})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.w("".concat(n," failed. error:"),e)}))}},{key:"sendReadReceipt",value:function(e){var t=this,n=e[0].conversationID.replace(S.CONV_C2C,""),o=new ka("sendC2CReadReceipt");o.setMessage("peerAccount:".concat(n));var s=this.getMyUserID(),a=e.filter((function(e){return e.from!==s&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}));if(0===a.length)return Ja({code:da.READ_RECEIPT_MESSAGE_LIST_EMPTY});var r="".concat(this._n,".sendReadReceipt");return xe.l("".concat(r,". peerAccount:").concat(n," messageInfoList length:").concat(a.length)),this.request({protocolName:ls,requestData:{peerAccount:n,messageInfoList:a}}).then((function(e){return o.end(),xe.l("".concat(r," ok")),Ka()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.w("".concat(r," failed. error:"),e),Ja(e)}))}},{key:"getReadReceiptList",value:function(e){var t="".concat(this._n,".getReadReceiptList"),n=this.getMyUserID(),o=e.filter((function(e){return e.from===n&&!0===e.needReadReceipt}));return xe.l("".concat(t," userID:").concat(n," messageList length:").concat(o.length)),za({messageList:o})}},{key:"getMessageExtensions",value:function(e,t){return xe.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.request({protocolName:Ro,requestData:{from:e.from,to:e.to,messageKey:this._getMessageKey(e),startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return xe.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n)),this.request({protocolName:Ao,requestData:{from:e.from,to:e.to,messageKey:this._getMessageKey(e),extensionList:t,operateType:n}})}},{key:"_getMessageKey",value:function(e){var t=e.clientSequence,n=e.random,o=e.time;return"".concat(t,"_").concat(n,"_").concat(o)}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._messageFromUnreadDBMap.clear(),this._signalingFromUnreadDBList.length=0}}]),s}(ro),Qa=function(){function e(){o(this,e),this.list=new Map,this._n="MessageListHandler",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}return a(e,[{key:"getLocalOldestMessageByConversationID",value:function(e){if(!e)return null;if(!this.list.has(e))return null;var t=this.list.get(e).values();return t?t.next().value:null}},{key:"pushIn",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0;this.list.has(n)||this.list.set(n,new Map);var s=this._getUniqueIDOfMessage(e),a=this.list.get(n).has(s);if(a){var r=this.list.get(n).get(s);if(!t||!0===r.isModified)return o=!1}return this.list.get(n).set(s,e),this._setLatestMessageSentByPeer(n,e),this._setLatestMessageSentByMe(n,e),o}},{key:"unshift",value:function(e,t){var n;if(st(e)?e.length>0&&(n=e[0].conversationID,this._unshiftMultipleMessages(e,t)):(n=e.conversationID,this._unshiftSingleMessage(e,t)),n&&n.startsWith(S.CONV_C2C)){var o=Array.from(this.list.get(n).values()),s=o.length;if(0===s)return;for(var a=s-1;a>=0;a--)if("out"===o[a].flow){this._setLatestMessageSentByMe(n,o[a]);break}for(var r=s-1;r>=0;r--)if("in"===o[r].flow){this._setLatestMessageSentByPeer(n,o[r]);break}}}},{key:"_unshiftSingleMessage",value:function(e,t){var n=e.conversationID,o=this._getUniqueIDOfMessage(e);if(!this.list.has(n))return this.list.set(n,new Map),this.list.get(n).set(o,e),void t.push(e);var s=this.list.get(n),a=Array.from(s);s.has(o)||(a.unshift([o,e]),this.list.set(n,new Map(a)),t.push(e))}},{key:"_unshiftMultipleMessages",value:function(e,t){for(var n=e.length,o=[],s=e[0].conversationID,a=this.list.get(s),r=this.list.has(s)?Array.from(a):[],i=0;i=0;l--)"in"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));xe.l("".concat(this._n,".modifyMessageSentByPeer conversationID:").concat(t," count:").concat(u))}}}},{key:"modifyMessageSentByMe",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,s=this.list.get(t);if(!jt(s)){var a=Array.from(s.values()),r=a.length;if(0!==r){for(var i=null,u=0,c=!1,l=r-1;l>=0;l--)"out"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));xe.l("".concat(this._n,".modifyMessageSentByMe conversationID:").concat(t," count:").concat(u))}}}},{key:"getTopicConversationIDList",value:function(e){return m(this.list.keys()).filter((function(t){return t.startsWith("".concat(S.CONV_GROUP).concat(e))}))}},{key:"traversal",value:function(){if(0!==this.list.size&&-1===xe.getLevel()){console.group("conversationID-messageCount");var e,t=D(this.list);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];console.log("".concat(o,"-").concat(s.size))}}catch(a){t.e(a)}finally{t.f()}console.groupEnd()}}},{key:"onMessageModified",value:function(e,t){if(!this.list.has(e))return{isUpdated:!1,message:null};var n=this._getUniqueIDOfMessage(t),o=this.list.get(e).has(n);if(xe.d("".concat(this._n,".onMessageModified conversationID:").concat(e," uniqueID:").concat(n," has:").concat(o)),o){var s=this.list.get(e).get(n),a=t.messageVersion,r=t.elements,i=t.cloudCustomData;return s.version1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isReady?void(t?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},t.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&t.length>0&&t.forEach((function(e){e.call(this)}),e)}),1)},t.resetReady=function(){this._isReady=!1,this._readyQueue=[]},t.isReady=function(){return this._isReady}};var nr=["jpg","jpeg","gif","png","bmp","image","webp"],or=["mp4","quicktime","mov"],sr=1,ar=2,rr=3,ir=255,ur=function(){function e(t){var n=this;o(this,e),jt(t)||(this.userID=t.userID||"",this.nick=t.nick||"",this.gender=t.gender||"",this.birthday=t.birthday||0,this.location=t.location||"",this.selfSignature=t.selfSignature||"",this.allowType=t.allowType||S.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||"",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||S.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],jt(t.profileCustomField)||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})})))}return a(e,[{key:"validate",value:function(e){var t=!0,n="";if(jt(e))return{valid:!1,tips:"empty options"};if(e.profileCustomField)for(var o=e.profileCustomField.length,s=null,a=0;a500&&(n="nick name limited: must less than or equal to ".concat(500," bytes, current size: ").concat(gt(e[r])," bytes"),t=!1);break;case"gender":vt(He,e.gender)||(n="key:gender, invalid value:"+e.gender,t=!1);break;case"birthday":$e(e.birthday)||(n="birthday must be a number",t=!1);break;case"location":et(e.location)||(n="location must be a string",t=!1);break;case"selfSignature":et(e.selfSignature)||(n="selfSignature must be a string",t=!1);break;case"allowType":vt(We,e.allowType)||(n="key:allowType, invalid value:"+e.allowType,t=!1);break;case"language":$e(e.language)||(n="language must be a number",t=!1);break;case"avatar":et(e.avatar)||(n="avatar must be a string",t=!1);break;case"messageSettings":0!==e.messageSettings&&1!==e.messageSettings&&(n="messageSettings must be 0 or 1",t=!1);break;case"adminForbidType":vt(Ke,e.adminForbidType)||(n="key:adminForbidType, invalid value:"+e.adminForbidType,t=!1);break;case"level":$e(e.level)||(n="level must be a number",t=!1);break;case"role":$e(e.role)||(n="role must be a number",t=!1);break;default:n="unknown key:"+r+" "+e[r],t=!1}}return{valid:t,tips:n}}}]),e}(),cr=a((function e(t){o(this,e),this.value=t,this.next=null})),lr=function(){function e(t){o(this,e),this.MAX_LENGTH=t,this.pTail=null,this.pNodeToDel=null,this.map=new Map}return a(e,[{key:"set",value:function(e){var t=new cr(e);if(this.map.size0&&n.members.forEach((function(e){e.userID===t.selfInfo.userID&&pt(t.selfInfo,e,["sequence"])}))}},{key:"updateSelfInfo",value:function(e){var n={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList};pt(this.selfInfo,t({},n),[],["",null,void 0,0,NaN])}},{key:"setSelfNameCard",value:function(e){this.selfInfo.nameCard=e}}]),e}(),gr=function(e,n){return at(e)?{lastTime:0,lastSequence:0,fromAccount:0,messageForShow:"",payload:null,type:"",isRevoked:!1,cloudCustomData:"",onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:!1,revoker:null}:e instanceof Ha?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",messageForShow:xt(e.type,e.payload,n),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||"",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||"",nameCard:e.nameCard||"",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:t(t({},e),{},{messageForShow:xt(e.type,e.payload,n)})},_r=function(){function e(t,n){o(this,e),this.conversationID=t.conversationID||"",this.unreadCount=t.unreadCount||0,this.type=t.type||"",this.lastMessage=gr(t.lastMessage,n),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark="",this.isPinned=t.isPinned||!1,this.messageRemindType="",this.markList=t.markList||[],this.customData=t.customData||"",this.conversationGroupList=t.conversationGroupList||[],this._initProfile(t)}return a(e,[{key:"toAccount",get:function(){return this.conversationID.startsWith(S.CONV_C2C)?this.conversationID.replace(S.CONV_C2C,""):this.conversationID.startsWith(S.CONV_GROUP)?this.conversationID.replace(S.CONV_GROUP,""):""}},{key:"subType",get:function(){return this.groupProfile?this.groupProfile.type:""}},{key:"_initProfile",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case"userProfile":t.userProfile=e.userProfile;break;case"groupProfile":t.groupProfile=e.groupProfile}})),at(this.userProfile)&&this.type===S.CONV_C2C?this.userProfile=new ur({userID:e.conversationID.replace("C2C","")}):at(this.groupProfile)&&this.type===S.CONV_GROUP&&(this.groupProfile=new dr({groupID:e.conversationID.replace("GROUP","")}))}},{key:"updateUnreadCount",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations,o=e.isUnreadC2CMessage;at(t)||(Ct(this.subType)?this.unreadCount=0:n&&this.type===S.CONV_GROUP||n&&this.type===S.CONV_TOPIC||o&&this.type===S.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:"updateLastMessage",value:function(e){this.lastMessage=gr(e)}},{key:"updateGroupAtInfoList",value:function(e){if(!this._isNeedMergeGroupAtInfo(e)){var t,n=(M(t=e.groupAtType)||y(t)||I(t)||T()).slice(0);-1!==n.indexOf(S.CONV_AT_ME)&&-1!==n.indexOf(S.CONV_AT_ALL)&&(n=[S.CONV_AT_ALL_AT_ME]);var o={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:n,__random:e.__random,__sequence:e.__sequence};this.groupAtInfoList.push(o)}}},{key:"_isNeedMergeGroupAtInfo",value:function(e){var t=e.groupID,n=e.sequence;if(!Tt({groupID:t}))return!1;var o=!1;return this.groupAtInfoList.forEach((function(t){t.messageSequence===n&&(t.atTypeArray.indexOf(S.CONV_AT_ME)>-1&&e.groupAtType.indexOf(S.CONV_AT_ALL)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME]),t.atTypeArray.indexOf(S.CONV_AT_ALL)>-1&&e.groupAtType.indexOf(S.CONV_AT_ME)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME],t.__random=e.__random,t.__sequence=e.__sequence),o=!0)})),o}},{key:"clearGroupAtInfoList",value:function(){this.groupAtInfoList.length=0}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){var t=e.sequence,n=e.time;return this.type===S.CONV_C2C&&t===this.lastMessage.lastSequence&&n===this.lastMessage.lastTime||this.type===S.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),e}(),hr=function(){function e(t){o(this,e),this._conversationModule=t,this._n="MessageRemindHandler",this._updateSequence=0}return a(e,[{key:"getC2CMessageRemindType",value:function(){var e=this,t="".concat(this._n,".getC2CMessageRemindType");return this._conversationModule.request({protocolName:Do,updateSequence:this._updateSequence}).then((function(n){xe.l("".concat(t," ok"));var o=n.data,s=o.updateSequence,a=o.muteFlagList;e._updateSequence=s,e._patchC2CMessageRemindType(a)})).catch((function(e){xe.e("".concat(t," failed. error:"),e)}))}},{key:"_patchC2CMessageRemindType",value:function(e){var t=this,n=0,o="";st(e)&&e.length>0&&e.forEach((function(e){var s=e.userID,a=e.muteFlag;0===a?o=S.MSG_REMIND_ACPT_AND_NOTE:1===a?o=S.MSG_REMIND_DISCARD:2===a&&(o=S.MSG_REMIND_ACPT_NOT_NOTE),!0===t._conversationModule.patchMessageRemindType({ID:s,isC2CConversation:!0,messageRemindType:o})&&(n+=1)})),xe.l("".concat(this._n,"._patchC2CMessageRemindType count:").concat(n))}},{key:"set",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):st(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:"_setGroupMessageRemindType",value:function(e){var t=this,n="".concat(this._n,"._setGroupMessageRemindType"),o=e.groupID,s=e.messageRemindType,a="groupID:".concat(o," messageRemindType:").concat(s),r=new ka("setMessageRemindType");return r.setMessage(a),this._getModule(bn).modifyGroupMemberInfo({groupID:o,messageRemindType:s,userID:this._conversationModule.getMyUserID()}).then((function(){r.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok. ").concat(a));var o=t.onGroupMessageRemindTypeUpdated(e);return t._conversationModule.emitTotalUnreadMessageCountUpdate(),Ka(o)})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"onGroupMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.messageRemindType,o=this._getModule(Un).getLocalGroupProfile(t);if(o&&(o.selfInfo.messageRemindType=n),Dt(t)){var s=t,a=qt(s),r=this._getModule(wn).getLocalTopic(a,s);return r&&(r.updateSelfInfo({messageRemindType:n}),this._conversationModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:a,topic:r})),{topic:r}}return this._conversationModule.patchMessageRemindType({ID:t,isC2CConversation:!1,messageRemindType:n})&&this._emitConversationUpdate(),{group:o}}},{key:"_setC2CMessageRemindType",value:function(e){var t=this,n="".concat(this._n,"._setC2CMessageRemindType"),o=e.userIDList,s=e.messageRemindType,a=o.slice(0,30),r=0;s===S.MSG_REMIND_DISCARD?r=1:s===S.MSG_REMIND_ACPT_NOT_NOTE&&(r=2);var i="userIDList:".concat(a," messageRemindType:").concat(s),u=new ka("setMessageRemindType");return u.setMessage(i),this._conversationModule.request({protocolName:To,requestData:{userIDList:a,muteFlag:r}}).then((function(e){u.setNetworkType(t._conversationModule.getNetworkType()).end();var o=e.data,r=o.updateSequence,i=o.errorList;t._updateSequence=r;var c=[],l=[];st(i)&&i.forEach((function(e){c.push(e.userID),l.push({userID:e.userID,code:e.errorCode})}));var p=a.filter((function(e){return-1===c.indexOf(e)}));xe.l("".concat(n," ok. successUserIDList:").concat(p," failureUserIDList:").concat(JSON.stringify(l)));var d=0;return p.forEach((function(e){t._conversationModule.patchMessageRemindType({ID:e,isC2CConversation:!0,messageRemindType:s})&&(d+=1)})),d>=1&&t._emitConversationUpdate(),a.length=c.length=0,t._conversationModule.emitTotalUnreadMessageCountUpdate(),za({successUserIDList:p.map((function(e){return{userID:e}})),failureUserIDList:l})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_getModule",value:function(e){return this._conversationModule.getModule(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"setUpdateSequence",value:function(e){this._updateSequence=e}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._updateSequence=0}}]),e}(),fr=function(){function e(t){o(this,e),this._conversationModule=t,this._n="ConvGroupHandler",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=Zt.NOT_START}return a(e,[{key:"setConvCustomData",value:function(e){var t=this,n="".concat(this._n,".").concat("setConvCustomData"),o=e.conversationIDList,s=e.customData;xe.l("".concat(n," options:"),e);var a=new ka("setConvCustomData");a.setMessage(JSON.stringify(e));var r={fromAccount:this._getMyUserID(),itemList:[]},i=[],u=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(u,e),!0;if(!Et(e)&&!St(e))return t._onConversationIDInvalid(u,e),!0;var n={operationType:2,contactItem:void 0,customMark:s};Et(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:St(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),r.itemList.push(n)})),u.length===o.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:wo,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var o=e.data.resultItem;if(st(o)){var r,c,l=!1;o.forEach((function(e){r=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(r),(c=t._getLocalConversation(r))&&c.customData!==s&&(c.customData=s,l=!0)):u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&t._emitConversationUpdate()}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"markConversation",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_MARK))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("markConversation"),o=e.conversationIDList,s=e.markType,a=e.enableMark;xe.l("".concat(n," options:"),e);var r=new ka("markConversation");r.setMessage(JSON.stringify(e));var i=void 0,u=void 0,c=this._getFlagBit(s);!0===a?u=[c]:i=[c];var l={fromAccount:this._getMyUserID(),itemList:[]},p=[],d=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(d,e),!0;if(!Et(e)&&!St(e))return t._onConversationIDInvalid(d,e),!0;var n={operationType:1,contactItem:void 0,clearMark:i,setMark:u};Et(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,"")}:St(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,"")}),l.itemList.push(n)})),d.length===o.length?za({successConversationIDList:p,failureConversationIDList:d}):this._conversationModule.request({protocolName:Fo,requestData:l}).then((function(e){r.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var o=e.data.resultItem;if(st(o)){var i,u,c=!1;o.forEach((function(e){if(i=t._concatConversationID(e.contactItem),0===e.resultCode){if(p.push(i),u=t._getLocalConversation(i)){var n=u.markList.indexOf(s);!0===a?-1===n&&(u.markList.push(s),c=!0):-1!==n&&(u.markList.splice(n,1),c=!0)}}else d.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===c&&t._emitConversationUpdate()}return Ka({successConversationIDList:p,failureConversationIDList:d})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"getLocalConvGroupList",value:function(){var e=this;return xe.l("".concat(this._n,".getLocalConvGroupList pagingStatus:").concat(this._pagingStatus)),this._pagingStatus===Zt.REJECTED?this.getRemoteConvGroupList().then((function(){return Ka(m(e._convGroupMap.values()))})):za(m(this._convGroupMap.values()))}},{key:"getRemoteConvGroupList",value:function(){var e=this,t="".concat(this._n,".getRemoteConvGroupList");return this._pagingStatus=Zt.PENDING,this._conversationModule.request({protocolName:Ko,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:be()}}).then((function(n){var o,s,a=n.data,r=a.completeFlag,i=a.contactItem,u=a.nextStartIndex,c=void 0===u?0:u,l=a.groupItem;(e._startIndex=c,xe.l("".concat(t," completeFlag:").concat(r," nextStartIndex:").concat(c)),st(l)&&l.forEach((function(t){var n=t.convGroupID,o=t.groupName;e._convGroupMap.set(n,o)})),st(i))&&i.forEach((function(t){var n=t.standardMark,a=t.customData,r=t.convGroupIDList;if(o=e._concatConversationID(t),(s=e._getLocalConversation(o))&&(s.markList=Bt(n),s.customData=a||"",st(r))){var i=[];r.forEach((function(t){e._convGroupMap.has(t)&&i.push(e._convGroupMap.get(t))})),s.conversationGroupList=[].concat(i),i.length=0}}));if(0===r)return e.getRemoteConvGroupList();1===r&&(e._pagingStatus=Zt.RESOLVED,e._emitConversationUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=Zt.REJECTED,xe.w("".concat(t," failed. error:"),n)}))}},{key:"createConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("createConvGroup");xe.l("".concat(n," options:"),e);var o=new ka("createConvGroup");o.setMessage(JSON.stringify(e));var s=e.groupName,a=e.conversationIDList,r={fromAccount:this._getMyUserID(),itemList:[{groupName:s,contactItem:[]}]},i=[],u=[];return a.forEach((function(e){return t._hasLocalConversation(e)?Et(e)||St(e)?void(Et(e)?r.itemList[0].contactItem.push({type:1,toAccount:e.replace(S.CONV_C2C,"")}):St(e)&&r.itemList[0].contactItem.push({type:2,groupID:e.replace(S.CONV_GROUP,"")})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===a.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:qo,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var a=e.data.groupResultItem[0],r=a.groupItem,c=a.resultItem;if(ot(r)&&(t._convGroupMap.set(r.convGroupID,r.groupName),t._emitConvGroupListUpdate()),st(c)){var l,p,d=!1;c.forEach((function(e){l=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(l),(p=t._getLocalConversation(l))&&-1===p.conversationGroupList.indexOf(s)&&(p.conversationGroupList.push(s),d=!0)):u.push({conversationID:l,code:e.resultCode,message:e.resultInfo})})),!0===d&&(t._emitConversationUpdate(),t._emitConvGroupListUpdate())}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"deleteConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("deleteConvGroup");xe.l("".concat(n," groupName:").concat(e));var o=new ka("deleteConvGroup");return o.setMessage(e),this._conversationModule.request({protocolName:xo,requestData:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(s){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var a=s.data.groupItem;if(st(a)){var r=!1;a.forEach((function(e){t._convGroupMap.has(e.convGroupID)&&(t._convGroupMap.delete(e.convGroupID),r=!0)})),!0===r&&t._emitConvGroupListUpdate()}t._eraseFromConversationGroupList([e])})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"renameConvGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("renameConvGroup");xe.l("".concat(n," options:"),e);var o=new ka("renameConvGroup");o.setMessage(JSON.stringify(e));var s=e.oldName,a=e.newName;return this._conversationModule.request({protocolName:Vo,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:s,newName:a}}}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var r=e.data.updateGroupResult.convGroupID;t._convGroupMap.set(r,a),t._emitConvGroupListUpdate();var i,u,c=t._conversationModule.getLocalConversationList(),l=!1;c.forEach((function(e){i=e.conversationGroupList,-1!==(u=i.indexOf(s))&&(i.splice(u,1,a),l=!0)})),!0===l&&t._emitConversationUpdate()})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"addConvsToGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("addConvsToGroup");xe.l("".concat(n," options:"),e);var o=new ka("addConvsToGroup");o.setMessage(JSON.stringify(e));var s=e.conversationIDList,a=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?Et(e)||St(e)?void(Et(e)?r.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):St(e)&&r.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Bo,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var s=e.data.updateGroupResult.contactResultItem;if(st(s)){var r,c,l=!1;s.forEach((function(e){r=t._concatConversationID(e.contactItem),0===e.resultCode?(c=t._getLocalConversation(r))&&-1===c.conversationGroupList.indexOf(a)&&(c.conversationGroupList.push(a),i.push(r),l=!0):u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"deleteConvsFromGroup",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("deleteConvsFromGroup");xe.l("".concat(n," options:"),e);var o=new ka("deleteConvsFromGroup");o.setMessage(JSON.stringify(e));var s=e.conversationIDList,a=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?Et(e)||St(e)?void(Et(e)?r.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,"")}}):St(e)&&r.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,"")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Ho,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l("".concat(n," ok"));var s=e.data.updateGroupResult.contactResultItem;if(st(s)){var r,c,l=!1;s.forEach((function(e){if(r=t._concatConversationID(e.contactItem),0===e.resultCode){if(c=t._getLocalConversation(r)){var n=c.conversationGroupList.indexOf(a);-1!==n&&(c.conversationGroupList.splice(n,1),i.push(r),l=!0)}}else u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"onConvMarkUpdated",value:function(e){var t=this;if(!jt(e)){var n,o;xe.d("".concat(this._n,".onConvMarkUpdated markItemList:"),e);var s=!1;e.forEach((function(e){var a=e.recentContactItem,r=e.optType,i=e.standardMark,u=e.customMark;if(n=t._concatConversationID(a),o=t._getLocalConversation(n))if(1===r){var c=Bt(i);!0!==function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n=0;o--)if("1"===t[o])return n-o-1}},{key:"_concatConversationID",value:function(e){var t,n=e.type,o=e.to,s=e.groupID,a=e.userID;return 1===n?at(a)?at(o)||(t="".concat(S.CONV_C2C).concat(o)):t="".concat(S.CONV_C2C).concat(a):2===n&&(t="".concat(S.CONV_GROUP).concat(s)),t}},{key:"_getMyUserID",value:function(){return this._conversationModule.getMyUserID()}},{key:"_insertConversationGroup",value:function(e,t){var n=this._getLocalConversation(e);if(n){var o=n.conversationGroupList;-1===o.indexOf(t)&&o.push(t)}}},{key:"_getLocalConversation",value:function(e){return this._conversationModule.getLocalConversation(e)}},{key:"_hasLocalConversation",value:function(e){return this._conversationModule.hasLocalConversation(e)}},{key:"_emitConversationUpdate",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:"_emitConvGroupListUpdate",value:function(){this._conversationModule.emitOuterEvent(E.CONVERSATION_GROUP_LIST_UPDATED,m(this._convGroupMap.values()))}},{key:"_emitConvInGroupUpdate",value:function(e){var t={groupName:e,conversationList:[]},n=this._conversationModule.getLocalConversationList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._conversationModule.emitOuterEvent(E.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=Zt.NOT_START}}]),e}(),vr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="ConversationModule",tr.mixin(_(t)),t._messageListHandler=new Qa,t._messageRemindHandler=new hr(_(t)),t._convGroupHandler=new fr(_(t)),t.singlyLinkedList=new lr(100),t._pagingStatus=Zt.NOT_START,t._pagingTimeStamp=0,t._pagingStartIndex=0,t._pagingPinnedTimeStamp=0,t._pagingPinnedStartIndex=0,t._pagingConvIDMap=new Map,t._convIDFromUnreadDBMap=new Map,t._conversationMap=new Map,t._tmpGroupList=[],t._tmpGroupAtTipsList=[],t._peerReadTimeMap=new Map,t._completedMap=new Map,t._roamingMessageKeyAndTimeMap=new Map,t._roamingMessageSequenceMap=new Map,t._remoteGroupReadSequenceMap=new Map,t._convTotalUnreadCount=0,t._pagingGetCostList=[],t._initListeners(),t}return a(s,[{key:"_initListeners",value:function(){var e=this.getInnerEmitterInstance();e.on(Za,this._initLocalConversationList,this),e.on(er,this._onProfileUpdated,this)}},{key:"onCheckTimer",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:"_initLocalConversationList",value:function(){var e=this,t=new ka("_initLocalConversationList");xe.l("".concat(this._n,".").concat("_initLocalConversationList"));var n="",o=this._getStorageConversationList(),s=this.isIntl();if(o){for(var a=o.length,r=0;r0&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConversationList()}},{key:"onMessageSent",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:"onNewMessage",value:function(e){this._onSendOrReceiveMessage(e)}},{key:"_onSendOrReceiveMessage",value:function(e){var t=this,n=e.conversationOptionsList,o=e.isInstantMessage,s=void 0===o||o,a=e.isUnreadC2CMessage,r=void 0!==a&&a,i=e.updateUnreadCount,u=void 0===i||i;this._isReady?0!==n.length&&(this._getC2CPeerReadTime(n),this._updateLocalConversationList({conversationOptionsList:n,isInstantMessage:s,isUnreadC2CMessage:r,isFromGetConversations:!1,updateUnreadCount:u}),s||(this._convIDFromUnreadDBMap=new Map([].concat(m(this._convIDFromUnreadDBMap),m(n.map((function(e){return[e.conversationID,1]}))))),this._diffAndDeleteConversation()),this._setStorageConversationList(),n.filter((function(e){return e.type===S.CONV_TOPIC})).length>0||this.emitConversationUpdate()):this.ready((function(){t._onSendOrReceiveMessage(e)}))}},{key:"updateConversationGroupProfile",value:function(e){var t=this;if(!st(e)||0!==e.length)if(0!==this._conversationMap.size){var n=!1;e.forEach((function(e){var o="GROUP".concat(e.groupID);if(t._conversationMap.has(o)){n=!0;var s=t._conversationMap.get(o);s.groupProfile=JSON.parse(JSON.stringify(e)),s.lastMessage.lastSequence=0;r--)if(!s[r].isDeleted){a=s[r];break}var i=this._conversationMap.get(o);if(i){var u=!1;i.lastMessage.lastSequence===a.sequence&&i.lastMessage.lastTime===a.time||(jt(a)&&(a=void 0),i.updateLastMessage(a),i.type!==S.CONV_TOPIC&&(u=!0),xe.l("".concat(this._n,".onMessageDeleted. update conversationID:").concat(o," with lastMessage:"),i.lastMessage)),o.startsWith(S.CONV_C2C)&&this.updateUnreadCount(o),u&&this.emitConversationUpdate(!0,!1)}}}},{key:"onMessageModified",value:function(e){var t=e.conversationType,n=e.from,o=e.to,s=e.time,a=e.sequence,r=e.elements,i=e.cloudCustomData,u=e.messageVersion,c=this.getMyUserID(),l="".concat(t).concat(o);o===c&&t===S.CONV_C2C&&(l="".concat(t).concat(n));var p=this._messageListHandler.onMessageModified(l,e),d=p.isUpdated,g=p.message;!0===d&&this.emitOuterEvent(E.MESSAGE_MODIFIED,[g]);var _=this._isTopicConversation(l);if(xe.l("".concat(this._n,".onMessageModified isUpdated:").concat(d," isTopicMessage:").concat(_," from:").concat(n," to:").concat(o)),_){this.getModule(wn).onMessageModified(e)}else{var h=this._conversationMap.get(l);if(h){var f=h.lastMessage;xe.d("".concat(this._n.onMessageModified," lastMessage:"),JSON.stringify(f),"options:",JSON.stringify(e)),f&&f.lastTime===s&&f.lastSequence===a&&f.version!==u&&(f.type=r[0].type,f.payload=r[0].content,f.messageForShow=xt(f.type,f.payload,this.isIntl()),f.cloudCustomData=i,f.version=u,this.emitConversationUpdate(!0,!1))}}return g}},{key:"onNewGroupAtTips",value:function(e){var n=this,o=e.dataList,s=null;o.forEach((function(e){e.groupAtTips?s=e.groupAtTips:e.elements?s=t(t({},e.elements),{},{sync:!0}):e.groupAtType&&(s=t(t({},e),{},{sync:!0})),s.__random=e.random,s.__sequence=e.clientSequence,n._tmpGroupAtTipsList.push(s)})),xe.d("".concat(this._n,".onNewGroupAtTips isReady:").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:"_handleGroupAtTipsList",value:function(){var e=this;if(0!==this._tmpGroupAtTipsList.length){var t=!1;this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,s=n.from,a=n.topicID,r=void 0===a?void 0:a,i=n.sync,u=void 0!==i&&i;if(s!==e.getMyUserID())if(at(r)){var c=e._conversationMap.get("".concat(S.CONV_GROUP).concat(o));c&&(c.updateGroupAtInfoList(n),t=!0)}else{var l=e._conversationMap.get("".concat(S.CONV_GROUP).concat(r));if(l){l.updateGroupAtInfoList(n);var p=e.getModule(wn),d=l.groupAtInfoList;p.onConversationProxy({topicID:r,groupAtInfoList:d})}if(jt(l)&&u)e.updateTopicConversation([{conversationID:"".concat(S.CONV_GROUP).concat(r),type:S.CONV_TOPIC}]),e._conversationMap.get("".concat(S.CONV_GROUP).concat(r)).updateGroupAtInfoList(n)}})),t&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:"_getC2CPeerReadTime",value:function(e){var t=this,n=[];if(e.forEach((function(e){t._conversationMap.has(e.conversationID)||e.type!==S.CONV_C2C||n.push(e.conversationID.replace(S.CONV_C2C,""))})),n.length>0){xe.d("".concat(this._n,"._getC2CPeerReadTime userIDList:").concat(n));var o=this.getModule(Gn);o&&o.getRemotePeerReadTime(n)}}},{key:"_getStorageConversationList",value:function(){return this.getModule(xn).getItem("conversationMap")}},{key:"_setStorageConversationList",value:function(){var e=this.getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C||e.type===S.CONV_GROUP&&e.lastMessage.type!==S.MSG_GRP_TIP})).slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}}));this.getModule(xn).setItem("conversationMap",e)}},{key:"emitConversationUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversationList();if(t){var o=this.getModule(Un);o&&o.updateGroupLastMessage(n)}e&&this.emitOuterEvent(E.CONVERSATION_LIST_UPDATED)}},{key:"getLocalConversationList",value:function(){return m(this._conversationMap.values()).filter((function(e){return e.type!==S.CONV_TOPIC}))}},{key:"getLocalConversation",value:function(e){return this._conversationMap.get(e)}},{key:"hasLocalConversation",value:function(e){return this._conversationMap.has(e)}},{key:"getLocalOldestMessage",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:"syncConversationList",value:function(){var e=this,t=new ka("syncConversationList");return this._pagingStatus===Zt.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList().then((function(n){var o=function(e){if(st(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),(t/e.length).toFixed(0)}}(e._pagingGetCostList);return xe.l("".concat(e._n,".").concat("syncConversationList",". sum ").concat(function(e){if(st(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),t.toFixed(0)}}(e._pagingGetCostList)," ms, average ").concat(o," ms")),e._pagingGetCostList.length=0,e._pagingStatus=Zt.RESOLVED,e._diffAndDeleteConversation(),e.emitConversationUpdate(!0,!1),e._setStorageConversationList(),e._handleC2CPeerReadTime(),e._patchConversationProperties(),t.setMessage(e._conversationMap.size).setMoreMessage(o).setNetworkType(e.getNetworkType()).end(),n})).catch((function(n){return e._pagingStatus=Zt.REJECTED,t.setMessage(e._pagingTimeStamp),e.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];t.setError(n,s,a).end()})),Ja(n)}))}},{key:"_diffAndDeleteConversation",value:function(){var e=this;if(this._isSyncCompleted()){var t=[];this._conversationMap.forEach((function(n,o){!e._pagingConvIDMap.has(o)&&e._convIDFromUnreadDBMap.has(o)&&(e._conversationMap.delete(o),t.push(o))})),xe.l("".concat(this._n,"._diffAndDeleteConversation list:").concat(t))}}},{key:"_patchConversationProperties",value:function(){var e=this,t=Date.now(),n=this.checkAndPatchRemark(),o=this._messageRemindHandler.getC2CMessageRemindType(),s=this.getModule(Un).getGroupList();Promise.all([n,o,s]).then((function(){var n=Date.now()-t;xe.l("".concat(e._n,"._patchConversationProperties ok. cost ").concat(n," ms")),e.emitConversationUpdate(!0,!1),e.emitTotalUnreadMessageCountUpdate()}))}},{key:"_pagingGetConversationList",value:function(){var e=this,t="".concat(this._n,"._pagingGetConversationList");xe.l("".concat(t," timeStamp:").concat(this._pagingTimeStamp," startIndex:").concat(this._pagingStartIndex)+" pinnedTimeStamp:".concat(this._pagingPinnedTimeStamp," pinnedStartIndex:").concat(this._pagingPinnedStartIndex));var n=Date.now();return this._pagingStatus=Zt.PENDING,this.request({protocolName:No,requestData:{fromAccount:this.getMyUserID(),timeStamp:this._pagingTimeStamp,startIndex:this._pagingStartIndex,pinnedTimeStamp:this._pagingPinnedTimeStamp,pinnedStartIndex:this._pagingPinnedStartIndex,orderType:1}}).then((function(o){var s=o.data,a=s.completeFlag,r=s.conversations,i=void 0===r?[]:r,u=s.timeStamp,c=s.startIndex,l=s.pinnedTimeStamp,p=s.pinnedStartIndex,d=s.groupItem,g=Date.now()-n;if(e._pagingGetCostList.push(g),xe.l("".concat(t," ok. completeFlag:").concat(a," count:").concat(i.length," cost ").concat(g," ms")),e._convGroupHandler.onConvGroupListSynced(d),i.length>0){var _=e._getConversationOptions(i);e._pagingConvIDMap=new Map([].concat(m(e._pagingConvIDMap),m(_.map((function(e){return[e.conversationID,1]}))))),e._updateLocalConversationList({conversationOptionsList:_,isFromGetConversations:!0}),e.isLoggedIn()&&e.emitConversationUpdate()}if(!e._isReady){if(!e.isLoggedIn())return za();e.triggerReady()}return e._pagingTimeStamp=u,e._pagingStartIndex=c,e._pagingPinnedTimeStamp=l,e._pagingPinnedStartIndex=p,1!==a?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),za())})).catch((function(n){throw e.isLoggedIn()&&(e._isReady||(xe.w("".concat(t," failed. error:"),n),e.triggerReady())),n}))}},{key:"_updateLocalConversationList",value:function(e){var t,n=e.isFromGetConversations,o=e.isInstantMessage,s=Date.now();t=this._getTmpConversationListMapping(e),this._conversationMap=new Map(this._sortConversationList([].concat(m(t.toBeUpdatedConversationList),m(this._conversationMap)))),n||(this._updateUserOrGroupProfile(t.newConversationList),o&&this.emitTotalUnreadMessageCountUpdate()),xe.d("".concat(this._n,"._updateLocalConversationList cost ").concat(Date.now()-s," ms"))}},{key:"_getTmpConversationListMapping",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,s=e.isUnreadC2CMessage,a=void 0!==s&&s,r=e.updateUnreadCount,i=[],u=[],c=this.getModule(Un),l=this.getModule(Pn),p=this.isIntl(),d=0,g=t.length;d0&&s.getUserProfile({userIDList:n}).then((function(e){var n=e.data;st(n)?n.forEach((function(e){t._doUpdateUserProfile("C2C".concat(e.userID),e)})):t._doUpdateUserProfile("C2C".concat(n.userID),n)})),o.length>0&&a.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:["Type","Name","FaceUrl"]}}).then((function(e){e.data.successGroupList.forEach((function(e){var n="GROUP".concat(e.groupID);if(t._conversationMap.has(n)){var o=t._conversationMap.get(n);pt(o.groupProfile,e,[],[null,void 0,"",0,NaN]),!o.subType&&e.type&&(o.subType=e.type)}}))}))}}},{key:"_doUpdateUserProfile",value:function(e,t){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=t)}},{key:"_getConversationOptions",value:function(e){var n=this,o=[],s=e.filter((function(e){var t=e.type,n=e.userID;return 1===t&&"@TLS#NOT_FOUND"!==n&&"@TLS#ERROR"!==n||2===t})),a=this.getMyUserID(),r=s.map((function(e){if(at(e.lastMsg)&&(e.lastMsg={elements:[]}),1===e.type){var s={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar};return o.push(s),{conversationID:"C2C".concat(e.userID),type:"C2C",lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,messageForShow:e.messageShow,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?n._amendLayersOverLimitProperty(e.lastMsg.elements[0].content):null,cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:"",nameCard:"",version:0,isPeerRead:e.lastC2CMsgFromAccount===a&&e.time<=e.c2cPeerReadTime,revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null},userProfile:new ur(s),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,messageRemindType:"",customData:e.customMark||"",markList:Bt(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}return{conversationID:"GROUP".concat(e.groupID),type:"GROUP",lastMessage:t(t({lastTime:e.time,lastSequence:e.sequence,fromAccount:e.msgGroupFromAccount,messageForShow:e.messageShow},n._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||"",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||"",nameCard:e.senderNameCard||"",revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null}),groupProfile:new dr({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage}),unreadCount:e.unreadCount,peerReadTime:0,isPinned:1===e.isPinned,messageRemindType:"",version:0,customData:e.customMark||"",markList:Bt(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}));o.length>0&&this.getModule(On).onConversationsProfileUpdated(o);return r}},{key:"_patchTypeAndPayload",value:function(e){var n=e.lastMsg,o=n.event,s=void 0===o?void 0:o,a=n.elements,r=void 0===a?[]:a,i=n.groupTips,u=void 0===i?{}:i;if(!at(s)&&!jt(u)){var c=new Ha(u);c.setElement({type:S.MSG_GRP_TIP,content:t(t({},u.elements),{},{groupProfile:u.groupProfile})});var l=JSON.parse(JSON.stringify(c.payload));return c=null,{type:S.MSG_GRP_TIP,payload:l}}return{type:r[0]?r[0].type:null,payload:r[0]?this._amendLayersOverLimitProperty(r[0].content):null}}},{key:"_amendLayersOverLimitProperty",value:function(e){var t=e.layersOverLimit;return 0===t?e.layersOverLimit=!1:1===t&&(e.layersOverLimit=!0),e}},{key:"getLocalMessageList",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:"deleteLocalMessage",value:function(e){e instanceof Ha&&this._messageListHandler.remove(e)}},{key:"onConversationDeleted",value:function(e){if(st(e)){var t=e.map((function(e){var t=e.type,n=e.userID,o=e.groupID;return 1===t?"".concat(S.CONV_C2C).concat(n):2===t?"".concat(S.CONV_GROUP).concat(o):void 0}));xe.l("".concat(this._n,".onConversationDeleted conversationIDList:").concat(t)),this.deleteLocalConversationList(t)}}},{key:"onConversationPinned",value:function(e){var t=this;if(st(e)){var n=!1;e.forEach((function(e){var o,s=e.type,a=e.userID,r=e.groupID;1===s?o=t.getLocalConversation("".concat(S.CONV_C2C).concat(a)):2===s&&(o=t.getLocalConversation("".concat(S.CONV_GROUP).concat(r))),o&&(xe.l("".concat(t._n,".onConversationPinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned||(o.isPinned=!0,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"onConversationUnpinned",value:function(e){var t=this;if(st(e)){var n=!1;e.forEach((function(e){var o,s=e.type,a=e.userID,r=e.groupID;1===s?o=t.getLocalConversation("".concat(S.CONV_C2C).concat(a)):2===s&&(o=t.getLocalConversation("".concat(S.CONV_GROUP).concat(r))),o&&(xe.l("".concat(t._n,".onConversationUnpinned conversationID:").concat(o.conversationID," isPinned:").concat(o.isPinned)),o.isPinned&&(o.isPinned=!1,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:"getMessageList",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,s=e.count,a="".concat(this._n,".getMessageList"),r=this.getLocalConversation(n),i="";if(r&&r.groupProfile&&(i=r.groupProfile.type),Ct(i))return xe.l("".concat(a," not available in avchatroom. conversationID:").concat(n)),za({messageList:[],nextReqMessageID:"",isCompleted:!0});(at(s)||s>15)&&(s=15),!o&&this._isNotInCommunity(n)&&(this._messageListHandler.removeByConversationID(n),this._completedMap.delete(n),this._roamingMessageSequenceMap.delete(n));var u=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),c=this._completedMap.has(n);if(xe.l("".concat(a," conversationID:").concat(n," nextReqMessageID:").concat(o)+" remainingCount:".concat(u," count:").concat(s," isCompleted:").concat(c)),this._needGetHistory({conversationID:n,remainingCount:u,count:s}))return this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,s=e.storedMessageList,r=t._completedMap.has(n),i=s;u>0&&(i=t._messageListHandler.getLocalMessageList(n).slice(0,s.length+u));var c={nextReqMessageID:r?"":o,messageList:i,isCompleted:r};return xe.l("".concat(a," ret.nextReqMessageID:").concat(c.nextReqMessageID," ret.isCompleted:").concat(c.isCompleted," ret.length:").concat(i.length)),Ka(c)}));this.modifyMessageList(n);var l=this._getMessageListFromMemory({conversationID:n,nextReqMessageID:o,count:s});return za(l)}},{key:"_getMessageListFromMemory",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=e.count,s="".concat(this._n,"._getMessageListFromMemory"),a=this._messageListHandler.getLocalMessageList(t),r=a.length,i=0,u={isCompleted:!1,nextReqMessageID:"",messageList:[]};return n?(i=a.findIndex((function(e){return e.ID===n})))>o?(u.messageList=a.slice(i-o,i),u.nextReqMessageID=a[i-o].ID):(u.messageList=a.slice(0,i),u.isCompleted=!0):r>o?(i=r-o,u.messageList=a.slice(i,r),u.nextReqMessageID=a[i].ID):(u.messageList=a.slice(0,r),u.isCompleted=!0),xe.l("".concat(s," conversationID:").concat(t)+" ret.nextReqMessageID:".concat(u.nextReqMessageID," ret.isCompleted:").concat(u.isCompleted," ret.length:").concat(u.messageList.length)),u}},{key:"getMessageListHopping",value:function(e){var t=e.conversationID,n=e.sequence,o=e.time,s=e.count,a=e.direction,r=void 0===a?0:a;if((at(s)||s>15)&&(s=15),t.startsWith(S.CONV_C2C)){var i=this.getModule(Gn),u=t.replace(S.CONV_C2C,"");return i.getRoamingMessagesHopping({peerAccount:u,time:o,count:s,direction:r})}if(t.startsWith(S.CONV_GROUP)){var c=this.getModule(Un),l=t.replace(S.CONV_GROUP,"");return c.getRoamingMessagesHopping({groupID:l,sequence:n,count:s,direction:r})}}},{key:"_computeRemainingCount",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=this._messageListHandler.getLocalMessageList(t),s=o.length;if(!n)return s;var a=0;return Et(t)?a=o.findIndex((function(e){return e.ID===n})):St(t)&&(a=-1!==n.indexOf("-")?o.findIndex((function(e){return e.ID===n})):o.findIndex((function(e){return e.sequence===n}))),-1===a&&(a=0),a}},{key:"_getMessageListSize",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:"_needGetHistory",value:function(e){var t=e.conversationID,n=e.remainingCount,o=e.count,s=this.getLocalConversation(t),a="";return s&&s.groupProfile&&(a=s.groupProfile.type),!kt(t)&&!Ct(a)&&(!(St(t)&&this._isPagingGetGroupListCompleted()&&this._getLocalGroupCount()<=4e3&&!this._hasLocalGroup(t)&&!this._isTopicConversation(t))&&(n<=o&&!this._completedMap.has(t)))}},{key:"_isTopicConversation",value:function(e){var t=e.replace(S.CONV_GROUP,"");return Dt(t)}},{key:"getHistoryMessages",value:function(e){var t=e.conversationID,n=e.count;if(t===S.CONV_SYSTEM)return za();var o=15;n>20&&(o=20);var s=null;if(Et(t)){var a=this._roamingMessageKeyAndTimeMap.has(t);return(s=this.getModule(Gn))?s.getRoamingMessage({conversationID:t,peerAccount:t.replace(S.CONV_C2C,""),count:o,lastMessageTime:a?this._roamingMessageKeyAndTimeMap.get(t).lastMessageTime:0,messageKey:a?this._roamingMessageKeyAndTimeMap.get(t).messageKey:""}):Ja({code:da.CANNOT_FIND_MODULE})}if(St(t)){if(!(s=this.getModule(Un)))return Ja({code:da.CANNOT_FIND_MODULE});var r=null;this._conversationMap.has(t)&&(r=this._conversationMap.get(t).lastMessage);var i=0;r&&(i=r.lastSequence);var u=this._roamingMessageSequenceMap.get(t);return s.getRoamingMessage({conversationID:t,groupID:t.replace(S.CONV_GROUP,""),count:o,sequence:u||i})}return za()}},{key:"patchConversationLastMessage",value:function(e){var t=this.getLocalConversation(e);if(t){var n=t.lastMessage,o=n.messageForShow,s=n.payload;if(jt(o)||jt(s)){var a=this._messageListHandler.getLocalMessageList(e);if(0===a.length)return;var r=a[a.length-1];xe.l("".concat(this._n,".patchConversationLastMessage conversationID:").concat(e," payload:"),r.payload),t.updateLastMessage(r)}}}},{key:"onRoamingMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=n.startsWith(S.CONV_C2C)?S.CONV_C2C:S.CONV_GROUP,a=null,r=[],i=[],u=0,c=e.length,l=null,p=s===S.CONV_GROUP,d=this.getModule(Hn),g=this.getFileDownloadProxy(),_=function(){u=p?e.length-1:0,c=p?0:e.length},h=function(){p?--u:++u},f=function(){return p?u>=c:u0&&void 0!==arguments[0]?arguments[0]:{},n="setAllMessageRead",o="".concat(this._n,".").concat(n);t.scope||(t.scope=S.READ_ALL_MSG),xe.l("".concat(o," options:"),t);var s=this._createSetAllMessageReadPack(t);if(0===s.readAllC2CMessage&&0===s.groupMessageReadInfoList.length)return za();var a=new ka(n);return this.request({protocolName:rs,requestData:s}).then((function(n){var o=n.data,s=e._handleAllMessageRead(o);return a.setMessage("scope:".concat(t.scope," failureGroups:").concat(JSON.stringify(s))).setNetworkType(e.getNetworkType()).end(),za()})).catch((function(t){return e.probeNetwork().then((function(e){var n=v(e,2),o=n[0],s=n[1];a.setError(t,o,s).end()})),xe.w("".concat(o," failed. error:"),t),Ja({code:t&&t.code?t.code:da.MESSAGE_UNREAD_ALL_FAIL,message:t&&t.message?t.message:void 0})}))}},{key:"setConversationCustomData",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:"markConversation",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:"createConversationGroup",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:"onConversationMarkUpdated",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:"onConversationGroupCreated",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:"onConversationGroupDeleted",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:"onConversationGroupNameUpdated",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:"onConversationInGroupUpdated",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:"onConversationAddedToOrDeletedFromGroup",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:"_getConversationLastMessageSequence",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastSequence;return t&&n0)if(a.type===S.CONV_C2C&&0===n.readAllC2CMessage){if(o===S.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===S.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else if(a.type===S.CONV_GROUP&&(o===S.READ_ALL_GROUP_MSG||o===S.READ_ALL_MSG)){var r=this._getConversationLastMessageSequence(a);n.groupMessageReadInfoList.push({groupID:a.groupProfile.groupID,messageSequence:r})}}}catch(i){s.e(i)}finally{s.f()}return n}},{key:"onPushedAllMessageRead",value:function(e){this._handleAllMessageRead(e)}},{key:"_handleAllMessageRead",value:function(e){var t=e.groupMessageReadInfoList,n=e.readAllC2CMessage,o=this._parseGroupReadInfo(t);return this._updateAllConversationUnreadCount({readAllC2CMessage:n})>=1&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate()),o}},{key:"_parseGroupReadInfo",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n=1){if(1===n&&i.type===S.CONV_C2C){var u=this._getConversationLastMessageTime(i);this.updateIsReadAfterReadReport({conversationID:r,lastMessageTime:u})}else if(i.type===S.CONV_GROUP){var c=r.replace(S.CONV_GROUP,"");if(this._remoteGroupReadSequenceMap.has(c)){var l=this._remoteGroupReadSequenceMap.get(c),p=this._getConversationLastMessageSequence(i);this.updateIsReadAfterReadReport({conversationID:r,remoteReadSequence:l}),p>=l&&this._remoteGroupReadSequenceMap.delete(c)}}this.updateUnreadCount(r,!1)&&(o+=1)}}}catch(d){s.e(d)}finally{s.f()}return o}},{key:"isRemoteRead",value:function(e){var t=e.conversationID,n=e.sequence,o=t.replace(S.CONV_GROUP,""),s=!1;if(this._remoteGroupReadSequenceMap.has(o)){var a=this._remoteGroupReadSequenceMap.get(o);n<=a&&(s=!0,xe.l("".concat(this._n,".isRemoteRead conversationID:").concat(t," messageSequence:").concat(n," remoteReadSequence:").concat(a))),n>=a+10&&this._remoteGroupReadSequenceMap.delete(o)}return s}},{key:"updateIsReadAfterReadReport",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,s=this._messageListHandler.getLocalMessageList(t);if(0!==s.length)for(var a,r=s.length-1;r>=0;r--)if(a=s[r],!(o&&a.time>o||n&&a.sequence>n)){if("in"===a.flow&&a.isRead)break;a.setIsRead(!0)}}},{key:"updateUnreadCount",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!1,o=this.getLocalConversation(e),s=this._messageListHandler.getLocalMessageList(e);if(o){var a=o.unreadCount,r=s.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length;if(a!==r&&(o.unreadCount=r,n=!0,xe.l("".concat(this._n,".updateUnreadCount from ").concat(a," to ").concat(r,", conversationID:").concat(e)),!0===t&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())),n&&o.type===S.CONV_TOPIC){var i=o.unreadCount,u=this.getModule(wn),c=e.replace(S.CONV_GROUP,"");u.onConversationProxy({topicID:c,unreadCount:i})}return n}}},{key:"clearGroupAtInfoList",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversation(e);if(n&&n.groupAtInfoList.length>0){if(n.clearGroupAtInfoList(),xe.l("".concat(this._n,".clearGroupAtInfoList conversationID:").concat(e)),n.type===S.CONV_TOPIC){var o=n.groupAtInfoList,s=this.getModule(wn),a=e.replace(S.CONV_GROUP,"");s.onConversationProxy({topicID:a,groupAtInfoList:o})}!0===t&&this.emitConversationUpdate(!0,!1)}}},{key:"updateReadReceiptInfo",value:function(e){var t=this,n=e.userID,o=void 0===n?void 0:n,s=e.groupID,a=void 0===s?void 0:s,r=e.readReceiptList;if(!jt(r)){var i=[];if(at(o)){if(!at(a)){var u="".concat(S.CONV_GROUP).concat(a);r.forEach((function(e){var n=e.tinyID,o=e.clientTime,s=e.random,r=e.readCount,c=e.unreadCount,l="".concat(n,"-").concat(o,"-").concat(s),p=t._messageListHandler.getLocalMessage(u,l),d={groupID:a,messageID:l,readCount:0,unreadCount:0};p&&($e(r)&&(p.readReceiptInfo.readCount=r,d.readCount=r),$e(c)&&(p.readReceiptInfo.unreadCount=c,d.unreadCount=c),i.push(d))}))}}else{var c="".concat(S.CONV_C2C).concat(o);r.forEach((function(e){var n=e.tinyID,s=e.clientTime,a=e.random,r="".concat(n,"-").concat(s,"-").concat(a),u=t._messageListHandler.getLocalMessage(c,r);if(u){u.readReceiptInfo.isPeerRead=!0;var l={userID:o,messageID:r,isPeerRead:!0};i.push(l)}}))}i.length>0&&this.emitOuterEvent(E.MESSAGE_READ_RECEIPT_RECEIVED,i)}}},{key:"recomputeGroupUnreadCount",value:function(e){var t=e.conversationID,n=e.count,o=this.getLocalConversation(t);if(o){var s=o.unreadCount,a=s-n;a<0&&(a=0),o.unreadCount=a,xe.l("".concat(this._n,".recomputeGroupUnreadCount from ").concat(s," to ").concat(a,", conversationID:").concat(t))}}},{key:"updateIsRead",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!kt(t.type)){for(var o=[],s=0,a=n.length;s0){var n=this._messageListHandler.updateMessageIsPeerReadProperty(e,t);if(n.length>0&&this.emitOuterEvent(E.MESSAGE_READ_BY_PEER,n),this._conversationMap.has(e)){var o=this._conversationMap.get(e).lastMessage;jt(o)||o.fromAccount===this.getMyUserID()&&o.lastTime<=t&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:"updateMessageIsModifiedProperty",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:"setCompleted",value:function(e){xe.l("".concat(this._n,".setCompleted. conversationID:").concat(e)),this._completedMap.set(e,!0)}},{key:"updateRoamingMessageKeyAndTime",value:function(e,t,n){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:"updateRoamingMessageSequence",value:function(e,t){this._roamingMessageSequenceMap.set(e,t)}},{key:"getConversationList",value:function(e){var t=this,n="getConversationList",o="".concat(this._n,".").concat(n),s="pagingStatus:".concat(this._pagingStatus,", local conversation count:").concat(this._conversationMap.size,", options:").concat(e);if(xe.l("".concat(o,". ").concat(s)),this._pagingStatus===Zt.REJECTED){var a=new ka(n);return a.setMessage(s),this.syncConversationList().then((function(){a.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Ka({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}if(0===this._conversationMap.size){var r=new ka(n);return r.setMessage(s),this.syncConversationList().then((function(){r.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Ka({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}var i=this._getConversationList(e);return xe.l("".concat(o,". returned conversation count:").concat(i.length)),za({conversationList:i,isSyncCompleted:this._isSyncCompleted()})}},{key:"_getConversationList",value:function(e){if(at(e))return this.getLocalConversationList();if(st(e))return 0===e.length?[]:this.getLocalConversationList().filter((function(t){return e.includes(t.conversationID)}));if(ot(e)){var t=e.type,n=e.markType,o=e.groupName;return this.getLocalConversationList().filter((function(e){return(t!==S.CONV_C2C&&t!==S.CONV_GROUP||e.type===t)&&(!et(o)||e.conversationGroupList.includes(o))&&(!$e(n)||e.markList.includes(n))}))}return[]}},{key:"_handleC2CPeerReadTime",value:function(){var e,t=D(this._conversationMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];s.type===S.CONV_C2C&&(xe.d("".concat(this._n,"._handleC2CPeerReadTime conversationID:").concat(o," peerReadTime:").concat(s.peerReadTime)),this.recordPeerReadTime(o,s.peerReadTime))}}catch(a){t.e(a)}finally{t.f()}}},{key:"_isPagingGetGroupListCompleted",value:function(){return this.getModule(Un).isPagingGetCompleted()}},{key:"_getLocalGroupCount",value:function(){return this.getModule(Un).getLocalGroupList().length}},{key:"_hasLocalGroup",value:function(e){return this.getModule(Un).hasLocalGroup(e.replace(S.CONV_GROUP,""))}},{key:"getConversationProfile",value:function(e){var t,n=this;if((t=this._conversationMap.has(e)?this._conversationMap.get(e):new _r({conversationID:e,type:e.slice(0,3)===S.CONV_C2C?S.CONV_C2C:S.CONV_GROUP},this.isIntl()))._isInfoCompleted||t.type===S.CONV_SYSTEM)return za({conversation:t});if(St(e)&&!this._hasLocalGroup(e))return za({conversation:t});var o="".concat(this._n,".").concat("getConversationProfile"),s=new ka("getConversationProfile");return xe.l("".concat(o,". conversationID:").concat(e," remark:").concat(t.remark," lastMessage:"),t.lastMessage),this._updateUserOrGroupProfileCompletely(t).then((function(a){s.setNetworkType(n.getNetworkType()).setMessage("conversationID:".concat(e," unreadCount:").concat(a.data.conversation.unreadCount)).end();var r=n.getModule(Pn);if(r&&t.type===S.CONV_C2C){var i=e.replace(S.CONV_C2C,"");if(r.isMyFriend(i)){var u=r.getFriendRemark(i);t.remark!==u&&(t.remark=u,xe.l("".concat(o,". conversationID:").concat(e," patch remark:").concat(t.remark)))}}return xe.l("".concat(o," ok. conversationID:").concat(e)),a})).catch((function(t){return n.probeNetwork().then((function(n){var o=v(n,2),a=o[0],r=o[1];s.setError(t,a,r).setMessage("conversationID:".concat(e)).end()})),xe.e("".concat(o," failed. error:"),t),Ja(t)}))}},{key:"_updateUserOrGroupProfileCompletely",value:function(e){var t=this;return e.type===S.CONV_C2C?this.getModule(On).getUserProfile({userIDList:[e.toAccount]}).then((function(n){var o=n.data;return 0===o.length?Ja(new Wa({code:da.USER_OR_GROUP_NOT_FOUND})):(e.userProfile=o[0],e._isInfoCompleted=!0,t._unshiftConversation(e),za({conversation:e}))})):this.getModule(Un).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._unshiftConversation(e),za({conversation:e})}))}},{key:"_unshiftConversation",value:function(e){e instanceof _r&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(m(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:"_onProfileUpdated",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;if(n===t.getMyUserID())t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar});else{var o=t._conversationMap.get("".concat(S.CONV_C2C).concat(n));o&&(o.userProfile=e)}}))}},{key:"_isSyncCompleted",value:function(){return this._pagingStatus===Zt.RESOLVED}},{key:"_errorLog",value:function(e,t,n,o){var s=new Error("Params validate failed."),a="".concat(this.getErrorMessage("API_REFER")).concat(e);throw xe.w("[".concat(e,"] | ").concat(t," | ").concat(this.getErrorMessage(n,o),", ").concat(a)),xe.e("[".concat(e,"] Invalid ").concat(t,": type check failed for ").concat(t,".")),s}},{key:"_isValidConversationID",value:function(e){return Et(e)||St(e)||kt(e)}},{key:"deleteConversation",value:function(e){var t=this,n="deleteConversation";return et(e)||nt(e)||this._errorLog(n,"options","StringOrObjectRequiredLog"),et(e)?(this._isValidConversationID(e)||this._errorLog(n,"options","InvalidConversationID",e),xe.l("".concat(this._n,".").concat(n," conversationID:").concat(e)),this.deleteConversationList({conversationIDList:[e],flag:1})):(st(e.conversationIDList)||this._errorLog(n,"conversationIDList","ArrayRequiredLog"),0===e.conversationIDList.length&&this._errorLog(n,"conversationIDList","NonEmptyArrayLog"),e.conversationIDList.forEach((function(e){t._isValidConversationID(e)||t._errorLog(n,"conversationIDList","InvalidConversationID",e)})),"clearHistoryMessage"in e&&"boolean"!=typeof e.clearHistoryMessage&&this._errorLog(n,"clearHistoryMessage","BooleanRequiredLog"),e.conversationIDList.length>100&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConversationList(e))}},{key:"deleteConversationList",value:function(e){var t=this,n=e.conversationIDList,o=void 0===n?[]:n,s=e.clearHistoryMessage,a=void 0===s||s,r=e.flag,i=void 0===r?0:r,u="".concat(this._n,".").concat("deleteConversationList");xe.l("".concat(u," conversationIDList.length:").concat(o.length," clearHistoryMessage:").concat(a));var c=new ka("deleteConversationList");return c.setMessage("conversationIDList:".concat(o)),Promise.all([this.rmLocalOnlyConversationList(o),this.rmLocalAndRemoteConversationList(o,a)]).then((function(e){c.setNetworkType(t.getNetworkType()).end();var n=[].concat(m(e[0]),m(e[1]));return 0===n.length?Ja(new Wa({code:da.CONVERSATION_NOT_FOUND})):(xe.l("".concat(u," ok")),za(1===i?{conversationID:n[0]}:{conversationIDList:n}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),xe.e("".concat(u," failed. error:"),e),Ja(e)}))}},{key:"rmLocalOnlyConversationList",value:function(e){var t=this;return e.filter((function(e){if(!t._conversationMap.has(e))return!1;var n=t.getLocalConversation(e).type;return n!==S.CONV_GROUP||t._hasLocalGroup(e)?n===S.CONV_SYSTEM&&(t.getModule(Un).deleteGroupSystemNotice({messageList:t._messageListHandler.getLocalMessageList(e)}),t.deleteLocalConversation(e),!0):(t.deleteLocalConversation(e),!0)}))}},{key:"rmLocalAndRemoteConversationList",value:function(e,t){var n=this,o={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:t?1:0};return e.forEach((function(e){if(n._conversationMap.has(e)){var t=n.getLocalConversation(e).type;t===S.CONV_C2C?o.conversationList.push({toAccount:e.replace(t,""),type:1}):t===S.CONV_GROUP&&n._hasLocalGroup(e)&&o.conversationList.push({toGroupID:e.replace(t,""),type:2})}})),0===o.conversationList.length?[]:this.request({protocolName:Go,requestData:o}).then((function(e){var t=[];return e.data.resultList.length>0&&e.data.resultList.map((function(e){if(0===e.code){var n=1===e.type?"".concat(S.CONV_C2C).concat(e.to):"".concat(S.CONV_GROUP).concat(e.groupID);t.push(n)}})),n.deleteLocalConversationList(t),t}))}},{key:"clearHistoryMessage",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e))return Ja({code:da.CONVERSATION_NOT_FOUND});var o=this._conversationMap.get(e).type;if(o===S.CONV_C2C)n.type=1,n.toAccount=e.replace(S.CONV_C2C,"");else{if(o!==S.CONV_GROUP)return o===S.CONV_SYSTEM?(this.getModule(Un).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),za({conversationID:e})):Ja({code:da.CONVERSATION_UN_RECORDED_TYPE});n.type=2,n.toGroupID=e.replace(S.CONV_GROUP,"")}var s="".concat(this._n,".").concat("clearHistoryMessage"),a=new ka("clearHistoryMessage");return a.setMessage("conversationID:".concat(e)),xe.l("".concat(s,". conversationID:").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.request({protocolName:Uo,requestData:n})})).then((function(){a.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(s," ok")),t._messageListHandler.removeByConversationID(e),t.setCompleted(e);var n=t.getLocalConversation(e);return n&&(n.updateLastMessage(),t._sortConversationListAndEmitEvent()),za({conversationID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e("".concat(s," failed. error:"),e),Ja(e)}))}},{key:"pinConversation",value:function(e){var t=this,n=e.conversationID,o=e.isPinned;if(!this._conversationMap.has(n))return Ja({code:da.CONVERSATION_NOT_FOUND});var s=this.getLocalConversation(n);if(s.isPinned===o)return za({conversationID:n});var a="".concat(this._n,".").concat("pinConversation"),r=new ka("pinConversation");r.setMessage("conversationID:".concat(n," isPinned:").concat(o)),xe.l("".concat(a,". conversationID:").concat(n," isPinned:").concat(o));var i=null;return Et(n)?i={type:1,toAccount:n.replace(S.CONV_C2C,"")}:St(n)&&(i={type:2,groupID:n.replace(S.CONV_GROUP,"")}),this.request({protocolName:Po,requestData:{fromAccount:this.getMyUserID(),operationType:!0===o?1:2,itemList:[i]}}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(a," ok")),s.isPinned!==o&&(s.isPinned=o,t._sortConversationListAndEmitEvent()),Ka({conversationID:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(a," failed. error:"),e),Ja(e)}))}},{key:"setMessageRemindType",value:function(e){return this._messageRemindHandler.set(e)}},{key:"patchMessageRemindType",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,s=!1,a=this.getLocalConversation(n?"".concat(S.CONV_C2C).concat(t):"".concat(S.CONV_GROUP).concat(t));return a&&a.messageRemindType!==o&&(a.messageRemindType=o,s=!0),xe.d("".concat(this._n,".patchMessageRemindType options:"),e,"ret:".concat(s)),s}},{key:"onC2CMessageRemindTypeSynced",value:function(e){var t=this,n="".concat(this._n,".onC2CMessageRemindTypeSynced");xe.d(n,e),e.dataList.forEach((function(e){if(!jt(e.muteNotificationsSync)){var o,s=e.muteNotificationsSync,a=s.to,r=s.updateSequence,i=s.muteFlag;t._messageRemindHandler.setUpdateSequence(r),0===i?o=S.MSG_REMIND_ACPT_AND_NOTE:1===i?o=S.MSG_REMIND_DISCARD:2===i&&(o=S.MSG_REMIND_ACPT_NOT_NOTE);var u=0;t.patchMessageRemindType({ID:a,isC2CConversation:!0,messageRemindType:o})&&(u+=1),xe.l("".concat(n," updateCount:").concat(u)),u>=1&&t.emitConversationUpdate(!0,!1)}}))}},{key:"onGroupMessageRemindTypeSynced",value:function(e){xe.d("".concat(this._n,".onGroupMessageRemindTypeSynced options:"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:"deleteLocalConversation",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._conversationMap.has(e);if(xe.d("".concat(this._n,".deleteLocalConversation conversationID:").concat(e," has:").concat(n)),n&&(this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e),t)){var o=!this._isTopicConversation(e);this.emitConversationUpdate(o,!1)}}},{key:"deleteLocalConversationList",value:function(e){var t=this,n=0,o=!1;e.forEach((function(e){t._conversationMap.has(e)&&(n+=t._conversationMap.get(e).unreadCount||0,t.deleteLocalConversation(e,!1),o=!0)})),xe.l("".concat(this._n,".deleteLocalConversationList conversationIDList.length:").concat(e.length," isConvIDExisted:").concat(o)),o&&(this.emitConversationUpdate(!0,!1),n>0&&this.emitTotalUnreadMessageCountUpdate())}},{key:"isMessageSentByCurrentInstance",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:"modifyMessageList",value:function(e){if(e.startsWith(S.CONV_C2C)&&this._conversationMap.has(e)){var t=this._conversationMap.get(e),n=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:t.userProfile.nick,latestAvatar:t.userProfile.avatar});var o=this.getModule(On).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),xe.l("".concat(this._n,".modifyMessageList conversationID:").concat(e," cost ").concat(Date.now()-n," ms"))}}},{key:"updateUserProfileSpecifiedKey",value:function(e){xe.l("".concat(this._n,".updateUserProfileSpecifiedKey options:"),e);var t=e.conversationID,n=e.nick,o=e.avatar;if(this._conversationMap.has(t)){var s=this._conversationMap.get(t).userProfile;et(n)&&s.nick!==n&&(s.nick=n),et(o)&&s.avatar!==o&&(s.avatar=o),this.emitConversationUpdate(!0,!1)}}},{key:"_onMyProfileModified",value:function(e){var n=this,o=this.getLocalConversationList(),s=Date.now();o.forEach((function(o){n.modifyMessageSentByMe(t({conversationID:o.conversationID},e))})),xe.l("".concat(this._n,"._onMyProfileModified. modify all messages sent by me, cost ").concat(Date.now()-s," ms"))}},{key:"modifyMessageSentByMe",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:"getLatestMessageSentByMe",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:"modifyMessageSentByPeer",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:"getLatestMessageSentByPeer",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:"pushIntoNoticeResult",value:function(e,t){return!(!this._messageListHandler.pushIn(t)||this.singlyLinkedList.has(t.random))&&(e.push(t),!0)}},{key:"getLocalLastMessage",value:function(e){return this._messageListHandler.getLocalLastMessage(e)}},{key:"checkAndPatchRemark",value:function(){var e=Promise.resolve();if(0===this._conversationMap.size)return e;var t=this.getModule(Pn);if(!t)return e;var n=m(this._conversationMap.values()).filter((function(e){return e.type===S.CONV_C2C}));if(0===n.length)return e;var o=0;return n.forEach((function(e){var n=e.conversationID.replace(S.CONV_C2C,"");if(t.isMyFriend(n)){var s=t.getFriendRemark(n);e.remark!==s&&(e.remark=s,o+=1)}})),xe.l("".concat(this._n,".checkAndPatchRemark. c2c conversation count:").concat(n.length,", patched count:").concat(o)),e}},{key:"updateTopicConversation",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0})}},{key:"sendReadReceipt",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(Gn):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(Un)),n?n.sendReadReceipt(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"getReadReceiptList",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(Gn):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(Un)),n?n.getReadReceiptList(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"getLastMessageTime",value:function(e){var t=this.getLocalConversation(e);return t?t.lastMessage.lastTime:0}},{key:"getTotalUnreadMessageCount",value:function(){var e=this.getLocalConversationList(),t=0;return e.forEach((function(e){e.type!==S.CONV_SYSTEM&&(""!==e.messageRemindType&&e.messageRemindType!==S.MSG_REMIND_ACPT_AND_NOTE||(t+=e.unreadCount))})),t}},{key:"emitTotalUnreadMessageCountUpdate",value:function(){var e=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==e&&(xe.l("".concat(this._n,".emitTotalUnreadMessageCountUpdate from ").concat(this._convTotalUnreadCount," to ").concat(e)),this._convTotalUnreadCount=e,this.emitOuterEvent(E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._pagingStatus=Zt.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this.resetReady()}}]),s}(ro),mr=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupTipsHandler",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return a(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:"_checkCachedGroupTips",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),s=e._groupModule.hasLocalGroup(n);xe.l("".concat(e._n,"._checkCachedGroupTips groupID:").concat(n," hasLocalGroup:").concat(s," checkCount:").concat(o)),s?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"onNewGroupTips",value:function(e){xe.d("".concat(this._n,".onReceiveGroupTips count:").concat(e.dataList.length));var t=this.newGroupTipsStoredAndSummary(e),n=t.eventDataList,o=t.result,s=t.AVChatRoomMessageList;(s.length>0&&this._groupModule.onAVChatRoomMessage(s),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(Fn).onNewMessage({conversationOptionsList:n,isInstantMessage:!0}));o.length>0&&(this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:"newGroupTipsStoredAndSummary",value:function(e){for(var n=this,o=e.event,s=e.dataList,a=null,r=[],i=[],u={},c=[],l=function(e,l){var p=yt(s[e]);if(6===o){if(n._groupModule.isGroupAttributesUpdatedNotice(p))return"continue";if(n._groupModule.isGroupCountersNotice(p))return"continue"}var d=p.groupProfile,g=d.groupID,_=d.communityType,h=void 0===_?0:_,f=d.topicID,v=void 0===f?void 0:f,m=d.invisible,M=void 0,y=n._groupModule.isMessageFromTopic(h,v);if(y){M=S.CONV_TOPIC,p.to=v;var I=n._groupModule.getModule(wn);I.hasLocalTopic(g,v)||n._getTopicPendingMap.has(v)||(n._getTopicPendingMap.set(v,1),I.getTopicList({groupID:g,topicIDList:[v]}).finally((function(){n._getTopicPendingMap.delete(v)})))}var C=n._groupModule.hasLocalGroup(g);if(!C&&n._groupModule.isUnjoinedAVChatRoom(g))return"continue";if(!C&&!y)return n._cacheGroupTipsAndProbe({groupID:g,event:o,item:p}),"continue";if(n._groupModule.isMessageFromOrToAVChatroom(g))return p.event=o,c.push(p),"continue";if(p.currentUser=n._groupModule.getMyUserID(),p.conversationType=S.CONV_GROUP,(a=new Ha(p)).setElement({type:S.MSG_GRP_TIP,content:t(t({},p.elements),{},{groupProfile:p.groupProfile})}),a.isSystemMessage=!1,1===m)return n._qualityStat(a),"continue";var T=n._groupModule.getModule(Fn),D=a,E=D.conversationID,k=D.sequence;if(6===o)a._onlineOnlyFlag=!0,i.push(a);else if(!T.pushIntoNoticeResult(i,a))return"continue";if(n._groupModule.isMessageFromCommunityOfTopic(h,v))return"continue";if(6===o&&T.getLocalConversation(E))return"continue";6!==o&&n._qualityStat(a);var L=T.isRemoteRead({conversationID:E,sequence:k});if(at(u[E])){var A=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||L||(A=1)),u[E]=r.push({conversationID:E,unreadCount:A,type:at(M)?a.conversationType:M,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var R=u[E];r[R].type=a.conversationType,r[R].subType=a.conversationSubType,r[R].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||L||r[R].unreadCount++)}},p=0,d=s.length;p=0){u.updateSelfInfo({muteTime:p.muteTime}),c=!0;break}}c&&this._groupModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:i,topic:u})}}},{key:"_onTopicProfileUpdated",value:function(e){var n=e.payload,o=n.groupProfile.groupID,s=n.newTopicInfo;this._groupModule.getModule(wn).onTopicProfileUpdated(t({groupID:o,topicID:e.to},s))}},{key:"_cacheGroupTips",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:"_deleteCachedGroupTips",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:"_notifyCachedGroupTips",value:function(e){var t=this,n=this._cachedGroupTipsMap.get(e)||[];n.forEach((function(e){t.onNewGroupTips(e)})),this._deleteCachedGroupTips(e),xe.l("".concat(this._n,"._notifyCachedGroupTips groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupTipsAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,s=e.item;this._cacheGroupTips(n,{event:o,dataList:[s]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupTips(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupTips(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),xe.l("".concat(this._n,"._cacheGroupTipsAndProbe groupID:").concat(n))}},{key:"reset",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),e}(),Mr=function(){function e(t){o(this,e),this._groupModule=t,this._n="CommonGroupHandler",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map,this._isPagingGetCompleted=!1,t.getInnerEmitterInstance().once(Za,this._initGroupList,this)}return a(e,[{key:"onCheckTimer",value:function(e){e%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:"_checkCachedGroupMessage",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),s=e._groupModule.hasLocalGroup(n);xe.l("".concat(e._n,"._checkCachedGroupMessage groupID:").concat(n," hasLocalGroup:").concat(s," checkCount:").concat(o)),s?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:"_initGroupList",value:function(){var e=this;xe.l("".concat(this._n,"._initGroupList"));var t=new ka("getGroupListInStorage"),n=this._groupModule.getStorageGroupList();if(st(n)&&n.length>0){n.forEach((function(t){e._groupModule.initGroupMap(t)})),this._groupModule.emitGroupListUpdate(!0,!1);var o=this._groupModule.getLocalGroupList().length;t.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:".concat(o)).end()}else t.setNetworkType(this._groupModule.getNetworkType()).setMessage("group count:0").end();xe.l("".concat(this._n,"._initGroupList ok"))}},{key:"handleUpdateGroupLastMessage",value:function(e){var n="".concat(this._n,".handleUpdateGroupLastMessage");if(xe.l("".concat(n," conversation count:").concat(e.length,", local group count:").concat(this._groupModule.getLocalGroupList().length)),0!==this._groupModule.getGroupMap().size){for(var o,s,a,r=!1,i=0,u=e.length;i0&&this._groupModule.onAVChatRoomMessage(s),this._groupModule.filterModifiedMessage(o),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(Fn).onNewMessage({conversationOptionsList:n,isInstantMessage:e.isInstantMessage||!0,updateUnreadCount:e.updateUnreadCount||!0}));var a=this._groupModule.filterUnmodifiedMessage(o);a.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,a),o.length=0}},{key:"_newGroupMessageStoredAndSummary",value:function(e){var t=this,n=e.dataList,o=e.event,s=e.isInstantMessage,a=null,r=[],i=[],u=[],c={},l=this._groupModule.getModule(Hn),p=this._groupModule.getFileDownloadProxy(),d=n.length;d>1&&n.sort((function(e,t){return e.sequence-t.sequence}));for(var g=function(e){var d=yt(n[e]),g=d.groupProfile,_=g.groupID,h=g.communityType,f=void 0===h?0:h,v=g.topicID,m=void 0===v?void 0:v,M=g.invisible,y=void 0,I=t._groupModule.isMessageFromTopic(f,m);if(I){y=S.CONV_TOPIC,d.to=m;var C=t._groupModule.getModule(wn);C.hasLocalTopic(_,m)||t._getTopicPendingMap.has(m)||(t._getTopicPendingMap.set(m,1),C.getTopicList({groupID:_,topicIDList:[m]}).finally((function(){t._getTopicPendingMap.delete(m)})))}var T=t._groupModule.hasLocalGroup(_);if(!T&&t._groupModule.isUnjoinedAVChatRoom(_))return"continue";if(!T&&!I)return t._cacheGroupMessageAndProbe({groupID:_,event:o,item:d}),"continue";if(t._groupModule.isMessageFromOrToAVChatroom(_))return d.event=o,u.push(d),"continue";if(d.currentUser=t._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,d.isSystemMessage=!!d.isSystemMessage,a=new Ha(d),d.elements=l.parseElements(d.elements,d.from),a.setElement(d.elements,p),1===M)return t._qualityStat(s,a),"continue";var D=1===n[e].isModified,E=t._groupModule.getModule(Fn);if(E.isMessageSentByCurrentInstance(a)?a.isModified=D:D=!1,1===d.onlineOnlyFlag)a._onlineOnlyFlag=!0,E.isMessageSentByCurrentInstance(a)||i.push(a);else{if(t._groupModule.isMessageFromCommunityOfTopic(f,m))return i.push(a),"continue";if(!E.pushIntoMessageList(i,a,D))return"continue";t._qualityStat(s,a);var k=a,L=k.conversationID,A=k.sequence,R=E.isRemoteRead({conversationID:L,sequence:A});if(at(c[L])){var N=0;"in"===a.flow&&(a._isExcludedFromUnreadCount||R||(N=1)),c[L]=r.push({conversationID:L,unreadCount:N,type:at(y)?a.conversationType:y,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?"":a})-1}else{var O=c[L];r[O].type=at(y)?a.conversationType:y,r[O].subType=a.conversationSubType,r[O].lastMessage=a._isExcludedFromLastMessage?"":a,"in"===a.flow&&(a._isExcludedFromUnreadCount||R||r[O].unreadCount++)}}},_=0;_0&&n.addMessageDelay(t.clientTime)}},{key:"onGroupMessageRevoked",value:function(e){var t=this._groupModule.getModule(Fn),n=[],o=null,s=!0;e.dataList.forEach((function(e){var a=e.elements.revokedInfos;at(a)||a.forEach((function(e){var a=jt(e.topicID)?"GROUP".concat(e.groupID):"GROUP".concat(e.topicID);o=t.revoke(a,e.sequence,e.random);var r=e.revokerInfo&&e.revokerInfo.revoker;if(o)o.revoker=r,n.push(o);else{var i={conversationID:a,to:e.topicID||"",sequence:e.sequence,time:e.time,revoker:r};t.isLastMessageRevoked(i)&&(n.push(i),s=!1)}}))})),0!==n.length&&(t.onMessageRevoked(n),!0===s&&(xe.l("".concat(this._n,".onGroupMessageRevoked count:").concat(n.length)),this._groupModule.emitOuterEvent(E.MESSAGE_REVOKED,n)))}},{key:"_groupListTreeShaking",value:function(e){for(var t=new Map(m(this._groupModule.getGroupMap())),n=0,o=e.length;ng),h="offset:".concat(u," totalCount:").concat(d," isCompleted:").concat(_," ")+"currentCount:".concat(l.length," isCommunityRelay:").concat(s);return p.setNetworkType(t._groupModule.getNetworkType()).setMessage("".concat(h)).end(),s||_?!s&&_?(xe.l("".concat(n," start to get community list")),u=0,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):s&&!_?(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):(xe.l("".concat(n," ok. totalCount:").concat(l.length)),Ka({groupList:l})):(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l}))})).catch((function(e){return 11e3!==e.code&&t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setMessage("isCommunityRelay:".concat(s)).setError(e,o,a).end()})),s?(11e3===e.code&&(p=null,xe.l("".concat(n," ok. community unavailable"))),za({groupList:l})):Ja(e)}))}},{key:"_pagingGetGroupListWithTopic",value:function(e){var t=this,n="".concat(this._n,"._pagingGetGroupListWithTopic"),o=e.limit,s=e.offset,a=e.groupBaseInfoFilter,r=e.groupList,i=new ka("pagingGetGroupListWithTopic");return this._groupModule.request({protocolName:Wo,requestData:{type:S.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:o,offset:s,responseFilter:{groupBaseInfoFilter:a,selfInfoFilter:["Role","JoinTime","MsgFlag","MsgSeq"]},isSupportTopic:1}}).then((function(e){var u=e.data,c=u.groups,l=void 0===c?[]:c,p=u.totalCount;r.push.apply(r,m(l));var d=s+o,g=!(p>d),_="offset:".concat(s," totalCount:").concat(p," isCompleted:").concat(g," ")+"currentCount:".concat(r.length);return i.setNetworkType(t._groupModule.getNetworkType()).setMessage("".concat(_)).end(),g?(xe.l("".concat(n," ok. totalCount:").concat(r.length)),Ka({groupList:r})):(s=d,t._pagingGetGroupListWithTopic({limit:o,offset:s,groupBaseInfoFilter:a,groupList:r}))})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),Ja(e)}))}},{key:"_cacheGroupMessage",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:"_deleteCachedGroupMessage",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:"_notifyCachedGroupMessage",value:function(e){var t=this,n=this._cachedGroupMessageMap.get(e)||[];n.forEach((function(e){t.onNewGroupMessage(e)})),this._deleteCachedGroupMessage(e),xe.l("".concat(this._n,"._notifyCachedGroupMessage groupID:").concat(e," count:").concat(n.length))}},{key:"_cacheGroupMessageAndProbe",value:function(e){var t=this,n=e.groupID,o=e.event,s=e.item;this._cacheGroupMessage(n,{event:o,dataList:[s]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupMessage(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupMessage(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),xe.l("".concat(this._n,"._cacheGroupMessageAndProbe groupID:").concat(n))}},{key:"_handleGroupAtInfoWithoutTopic",value:function(e,n){var o=this;e&&0!==n.length&&n.forEach((function(e){var n=e.groupID,s=e.groupAtInfoList,a=[];at(s)||(s.forEach((function(e){a.push(t(t({},e),{},{groupID:n}))})),o._groupModule.getModule(Fn).onNewGroupAtTips({dataList:a}))}))}},{key:"reset",value:function(){this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._isPagingGetCompleted=!1,this._groupModule.getInnerEmitterInstance().once(Za,this._initGroupList,this)}}]),e}(),yr=1,Ir=2,Cr=3,Tr=4,Dr=5,Er=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupAttributesHandler",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on($a,this._onCloudConfigUpdated,this)}return a(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_attr_cache_time");at(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:"isGroupAttributesUpdatedNotice",value:function(e){var t=e.to,n=e.elements.newGroupProfile,o=!at(n)&&!jt(n.groupAttributeOption);return o&&this._onGroupAttributesUpdated({groupID:t,groupAttributeOption:n.groupAttributeOption}),o}},{key:"_onGroupAttributesUpdated",value:function(e){var t=this,n=e.groupID,o=e.groupAttributeOption,s=o.mainSequence,a=o.isWithChangedAttributeInfo,r=o.groupAttributeList,i=void 0===r?[]:r,u=o.operationType;if(xe.l("".concat(this._n,".onGroupAttributesUpdated. ")+"groupID:".concat(n," isWithChangedAttributeInfo:").concat(a," operationType:").concat(u)),!at(u)){this._groupAttributesCopy=this._getCachedAttributes({groupID:n});var c=s-this._getLocalGroupAttributes(n).localMainSequence;if(0!==c){if(1===a&&1===c)return this._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:s,groupAttributeList:i,operationType:u}),void this._emitGroupAttributesUpdated(n);if(this._hasLocalGroupAttributes(n)){var l=this._getLocalGroupAttributes(n).avChatRoomKey;this._getGroupAttributes({groupID:n,avChatRoomKey:l}).then((function(){t._emitGroupAttributesUpdated(n)}))}}}}},{key:"initGroupAttributesCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey,o=void 0===n?void 0:n;this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:o}),xe.l("".concat(this._n,".initGroupAttributesCache groupID:").concat(t," avChatRoomKey:").concat(o))}},{key:"initGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,s=this._getLocalGroupAttributes(n),a=s.remoteMainSequence,r=s.avChatRoomKey,i=new ka("initGroupAttributes");return i.setMessage("groupID:".concat(n," avChatRoomKey:").concat(r," mainSequence:").concat(a)),this._groupModule.request({protocolName:Ms,requestData:{groupID:n,avChatRoomKey:r,mainSequence:a,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){xe.l("".concat(t._n,".").concat("initGroupAttributes"," ok. groupID:").concat(n));var s=e.data,a=s.mainSequence,r=m(s.groupAttributeList);return r.forEach((function(e){e.value=o[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:r,operationType:yr}),t._emitGroupAttributesUpdated(n),i.setNetworkType(t._groupModule.getNetworkType()).end(),Ka({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),Ja(e)}))}},{key:"setGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupAttributes"),o=e.groupID,s=e.groupAttributes,a=this._getLocalGroupAttributes(o),r=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=this._transformGroupAttributes(s);c.forEach((function(e){var t=e.key;e.sequence=0,u.has(t)&&(e.sequence=u.get(t).sequence)}));var l=new ka("setGroupAttributes");return l.setMessage("groupID:".concat(o," groupAttributes:").concat(JSON.stringify(s))),xe.l("".concat(n,". groupID:").concat(o," mainSequence:").concat(r)),this._groupModule.request({protocolName:ys,requestData:{groupID:o,avChatRoomKey:i,mainSequence:r,groupAttributeList:c}}).then((function(e){xe.l("".concat(n," ok."));var a=e.data,r=a.mainSequence,i=m(a.groupAttributeList);return i.forEach((function(e){e.value=s[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:o}),t._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:r,groupAttributeList:i,operationType:Ir}),t._emitGroupAttributesUpdated(o),l.setNetworkType(t._groupModule.getNetworkType()).end(),Ka({groupAttributes:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),Ja(e)}))}},{key:"deleteGroupAttributes",value:function(e){var t=this,n=e.groupID,o=e.keyList,s=void 0===o?[]:o,a=this._getLocalGroupAttributes(n),r=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=m(u.keys()),l=Cs,p=Cr,d={groupID:n,avChatRoomKey:i,mainSequence:r},g=[];s.length>0&&(c=[],l=Is,p=Tr,s.forEach((function(e){var t=0;u.has(e)&&(t=u.get(e).sequence,c.push(e)),g.push({key:e,sequence:t})})),d.groupAttributeList=g);var _=new ka("deleteGroupAttributes");return _.setMessage("groupID:".concat(n," mainSequence:").concat(r," keyList:").concat(s," protocolName:").concat(l)),this._groupModule.request({protocolName:l,requestData:d}).then((function(e){xe.l("".concat(t._n,".").concat("deleteGroupAttributes"," ok. groupID:").concat(n));var o=e.data.mainSequence;return t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:o,groupAttributeList:g,operationType:p}),t._emitGroupAttributesUpdated(n),_.setNetworkType(t._groupModule.getNetworkType()).end(),Ka({keyList:c})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];_.setError(e,o,s).end()})),Ja(e)}))}},{key:"getGroupAttributes",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupAttributes"),o=e.groupID,s=this._getLocalGroupAttributes(o),a=s.avChatRoomKey,r=s.lastUpdateTime,i=s.localMainSequence,u=s.remoteMainSequence,c=new ka("getGroupAttributes");if(c.setMessage("groupID:".concat(o," localMainSequence:").concat(i," remoteMainSequence:").concat(u," keyList:").concat(e.keyList)),Date.now()-r>=this.CACHE_EXPIRE_TIME||i0)o.forEach((function(e){a.has(e)&&(s[e]=a.get(e).value)}));else{var r,i=D(a.keys());try{for(i.s();!(r=i.n()).done;){var u=r.value;s[u]=a.get(u).value}}catch(c){i.e(c)}finally{i.f()}}}return s}},{key:"_updateCachedAttributes",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList,o=e.operationType;o!==Cr?o!==Tr?(o===yr&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value,s=e.sequence;t.attributes.set(n,{value:o,sequence:s})}))):n.forEach((function(e){t.attributes.delete(e.key)})):t.attributes.clear()}},{key:"_hasLocalGroupAttributes",value:function(e){return this._groupAttributesMap.has(e)}},{key:"_getLocalGroupAttributes",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:"_transformGroupAttributes",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_emitGroupAttributesUpdated",value:function(e){var t=this._getCachedAttributes({groupID:e}),n=this._computeAttrChangedInfo(t),o=n.updatedKeyList,s=n.deletedKeyList;xe.l("".concat(this._n,"._emitGroupAttributesUpdated update:").concat(o.length,", delete:").concat(s.length)),0===o.length&&0===s.length||this._groupModule.emitOuterEvent(E.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t,updatedKeyList:o,deletedKeyList:s})}},{key:"_computeAttrChangedInfo",value:function(e){var t=this,n=[],o=[];return Object.keys(e).forEach((function(o){e[o]!==t._groupAttributesCopy[o]&&n.push(o)})),Object.keys(this._groupAttributesCopy).forEach((function(t){at(e[t])&&o.push(t)})),this._groupAttributesCopy={},{updatedKeyList:n,deletedKeyList:o}}},{key:"deleteLocalGroupAttributes",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:"reset",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),e}(),Sr="Set",kr="Increase",Lr="Decrease",Ar=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupCountersHandler",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on($a,this._onCloudConfigUpdated,this)}return a(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._groupModule.getCloudConfig("grp_counter_expire_time");at(e)||(this.EXPIRE_TIME=Number(e))}},{key:"isGroupCountersNotice",value:function(e){var t=e.to,n=e.elements.groupCounterInfo,o=!1;return jt(n)||(this._onGroupCountersUpdated({groupID:t,groupCounterInfo:n}),o=!0),o}},{key:"_onGroupCountersUpdated",value:function(e){var t=this,n=e.groupID;e.groupCounterInfo.forEach((function(e){var o=e.type,s=e.groupCounterSeq,a=e.counterList,r=void 0===a?[]:a;0!==o&&2!==o||(t._updateLocalGroupCounters({groupID:n,groupCounterSeq:s,counterList:r}),r.forEach((function(e){t._groupModule.emitOuterEvent(E.GROUP_COUNTER_UPDATED,{groupID:n,key:e.key,value:e.value})}))),1===o&&t._deleteLocalGroupCounters({groupID:n,groupCounterSeq:s,counterList:r})})),xe.l("".concat(this._n,"._onGroupCountersUpdated groupID:").concat(n))}},{key:"initGroupCountersCache",value:function(e){var t=e.groupID,n=e.avChatRoomKey;this._groupCountersMap.set(t,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:n}),xe.l("".concat(this._n,".initGroupCountersCache groupID:").concat(t," avChatRoomKey:").concat(n))}},{key:"setGroupCounters",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".setGroupCounters"),o=e.groupID,s=e.counters,a=this._convertObjectToList(s),r=this._getLocalGroupCounters(o).avChatRoomKey,i="groupID:".concat(o," count:").concat(a.length),u=new ka("setGroupCounters");return u.setMessage("".concat(i)),xe.l("".concat(n,". ").concat(i)),this._updateGroupCounters({groupID:o,counterList:a,avChatRoomKey:r,mode:Sr}).then((function(e){return u.end(),xe.l("".concat(n," ok.")),Ka({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"increaseGroupCounter",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".increaseGroupCounters"),o=e.groupID,s=e.key,a=e.value,r=this._getLocalGroupCounters(o).avChatRoomKey,i="groupID:".concat(o," key:").concat(s," value:").concat(a),u=new ka("increaseGroupCounter");u.setMessage("".concat(i)),xe.l("".concat(n,". ").concat(i));var c=[{key:s,value:a}];return this._updateGroupCounters({groupID:o,counterList:c,avChatRoomKey:r,mode:kr}).then((function(e){return u.end(),xe.l("".concat(n," ok.")),Ka({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"decreaseGroupCounter",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".decreaseGroupCounter"),o=e.groupID,s=e.key,a=e.value,r=this._getLocalGroupCounters(o).avChatRoomKey,i="groupID:".concat(o," key:").concat(s," value:").concat(a),u=new ka("decreaseGroupCounter");u.setMessage("".concat(i)),xe.l("".concat(n,". ").concat(i));var c=[{key:s,value:a}];return this._updateGroupCounters({groupID:o,counterList:c,avChatRoomKey:r,mode:Lr}).then((function(e){return u.end(),xe.l("".concat(n," ok.")),Ka({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"getGroupCounters",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".getGroupCounters"),o=e.groupID,s=e.keyList,a=void 0===s?[]:s,r=this._getLocalGroupCounters(o),i=r.avChatRoomKey,u=r.lastUpdateTime,c=new ka("getGroupCounters");if(c.setMessage("groupID:".concat(o)),Date.now()-u>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:o,avChatRoomKey:i}).then((function(e){c.setMoreMessage("from remote. count:".concat(e.length)).end(),xe.l("".concat(n," from remote. groupID:").concat(o));var s=t._getLocalCounters(o,a);return Ka({counters:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),Ja(e)}));c.setMoreMessage("from cache").end(),xe.l("".concat(n," from cache. groupID:").concat(o));var l=this._getLocalCounters(o,a);return za({counters:l})}},{key:"_getRemoteGroupCounters",value:function(e){var n=this;return this._groupModule.request({protocolName:Ls,requestData:t({},e)}).then((function(t){var o=t.data,s=o.counterList,a=void 0===s?[]:s,r=o.groupCounterSeq;return n._updateLocalGroupCounters({groupID:e.groupID,counterList:a,groupCounterSeq:r}),xe.l("".concat(n._n,"._getRemoteGroupCounters ok. groupID:").concat(e.groupID)),a})).catch((function(e){return Ja(e)}))}},{key:"_convertObjectToList",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:"_updateGroupCounters",value:function(e){var n="".concat(this._n,"._updateGroupCounters"),o=e.groupID,s=e.avChatRoomKey,a=e.mode;return xe.l("".concat(n,". groupID:").concat(o," avChatRoomKey:").concat(s," mode:").concat(a)),this._groupModule.request({protocolName:ks,requestData:t({},e)}).then((function(e){xe.l("".concat(n," ok."));var t=e.data.counterList,o={};return(void 0===t?[]:t).forEach((function(e){var t=e.key,n=e.value;o[t]=n})),o})).catch((function(e){return Ja(e)}))}},{key:"_hasLocalGroupCounters",value:function(e){return this._groupCountersMap.has(e)}},{key:"_getLocalGroupCounters",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:"_updateLocalGroupCounters",value:function(e){var t=e.groupID,n=e.counterList,o=void 0===n?[]:n,s=e.groupCounterSeq;if(this._hasLocalGroupCounters(t)){var a=this._getLocalGroupCounters(t),r=a.counters,i=a.avChatRoomKey,u=a.groupCounterSeq;if(s>0&&s0)t.forEach((function(e){o.has(e)&&(n[e]=o.get(e))}));else{var s,a=D(o.keys());try{for(a.s();!(s=a.n()).done;){var r=s.value;n[r]=o.get(r)}}catch(i){a.e(i)}finally{a.f()}}return n}},{key:"reset",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),e}(),Rr=function(){function e(t){o(this,e);var n=t.manager,s=t.groupID,a=t.onInit,r=t.onSuccess,i=t.onFail;this._n="Polling",this._manager=n,this._groupModule=n._groupModule,this._onInit=a,this._onSuccess=r,this._onFail=i,this._groupID=s,this._timeoutID=-1,this._isRunning=!1,this._protocolName=_s}return a(e,[{key:"start",value:function(){var e=this._groupModule.isLoggedIn();e||(this._protocolName=hs),xe.l("".concat(this._n,".start pollingInterval:").concat(this._manager.getPollingInterval()," isLoggedIn:").concat(e)),this._isRunning=!0,this._request()}},{key:"isRunning",value:function(){return this._isRunning}},{key:"_request",value:function(){var e=this,t=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:"stop",value:function(){xe.l("".concat(this._n,".stop")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:"getPollingTimerID",value:function(){return this._timeoutID}}]),e}(),Nr={3:!0,4:!0,5:!0,6:!0,17:!0},Or=function(){function e(t){o(this,e),this._groupModule=t,this._n="AVChatRoomHandler",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new lr(200),this.messageIDLinkedList=new lr(100),this.receivedMessageCount=0,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}return a(e,[{key:"hasJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0}},{key:"checkJoinedAVChatRoomByID",value:function(e){return this._joinedGroupMap.has(e)}},{key:"getJoinedAVChatRoom",value:function(){return this._joinedGroupMap.size>0?m(this._joinedGroupMap.keys()):null}},{key:"_updateRequestData",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===m(this._pollingInstanceMap.keys())[0]?t(t({},n),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):t(t({},n),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:"_handleSuccess",value:function(e,t){var n=t.data,o=n.key,s=n.nextSeq,a=n.rspMsgList,r=n.errorCode,i=n.nextBroadcastSeq,u=n.broadcastMessageList;if(0!==r){var c=this._pollingRequestInfoMap.get(e),l=new ka("longPollingAVError"),p=c?"".concat(c.key,"-").concat(c.startSeq):"requestInfo is undefined";l.setMessage("".concat(e,"-").concat(p,"-").concat(t.errorInfo)).setCode(t.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(e))return;et(o)&&$e(s)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:s}),$e(i)&&i>this._startBroadcastSeq&&(this._startBroadcastSeq=i),st(a)&&a.length>0?(a.forEach((function(e){e.to=e.groupID})),this.onMessage(a)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(u)}}},{key:"_handleFailure",value:function(e,t){}},{key:"onMessage",value:function(e){if(st(e)&&0!==e.length){0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var t=null,n=[],o=this._getModule(Fn),s=this._getModule($n),a=e.length;a>1&&e.sort((function(e,t){return e.sequence-t.sequence}));for(var r=this._getModule(qn),i=0;i1&&g<=20?this._getModule(Jn).onMessageMaybeLost(p,d+1,g-1):g<-1&&g>=-20&&this._getModule(Jn).onMessageMaybeLost(p,t.sequence+1,Math.abs(g)-1)}this.sequencesLinkedList.set(t.sequence),this.messageIDLinkedList.set(t.ID);var _=!1;if(this._isMessageSentByCurrentInstance(t)?c&&(_=!0,t.isModified=c,o.updateMessageIsModifiedProperty(t)):_=!0,_){if(t.conversationType===S.CONV_SYSTEM&&5===t.payload.operationType&&this._onGroupDismissed(t.payload.groupProfile.groupID),!l&&t.conversationType!==S.CONV_SYSTEM){var h=t.conversationID.replace(S.CONV_GROUP,"");this._pollingInstanceMap.has(h)?this._groupModule.isLoggedIn()&&s.addMessageSequence({key:Ca,message:t}):(t.type!==S.MSG_GRP_TIP&&t.clientTime>0&&s.addMessageDelay(t.clientTime),s.addMessageSequence({key:Ia,message:t}))}n.push(t)}}}else xe.w("".concat(this._n,".onMessage unknown event:").concat(u.event))}if(0!==n.length){this._groupModule.filterModifiedMessage(n);var f=this.packConversationOption(n);if(f.length>0)this._getModule(Fn).onNewMessage({conversationOptionsList:f,isInstantMessage:!0});xe.d("".concat(this._n,".onMessage count:").concat(n.length)),this._checkMessageStacked(n);var v=this._groupModule.filterUnmodifiedMessage(n);v.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,v),n.length=0}}}},{key:"isBroadcastOrNormal",value:function(e){return 3===e||17===e}},{key:"isGroupTip",value:function(e){return 4===e||6===e}},{key:"isGroupSystemNotice",value:function(e){return 5===e}},{key:"restoreGroupTipElements",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.groupJoinType||(e.groupJoinType=1);var t=e.operatorInfo,n=void 0===t?{}:t,o=e.operatorID,s=e.userIDList,a=void 0===s?[]:s,r=n.userID,i=void 0===r?o:r,u=n.avatar,c=void 0===u?"":u,l=n.nick,p=void 0===l?"":l;e.operatorInfo={userID:i,avatar:c,nick:p};var d=a.map((function(e){return{userID:e}}));return e.memberInfoList=e.memberInfoList||d,e}},{key:"restoreMessageFromSimplified",value:function(e){var n=e.event;if(this.isBroadcastOrNormal(n)&&(e.cloudCustomData=e.cloudCustomData||"",e.elements=e.elements.map((function(e){if(e.type===S.MSG_CUSTOM){var n=e.content,o=void 0===n?{}:n;e.content=t({data:"",description:"",extension:""},o)}return e}))),(this.isGroupTip(n)||this.isGroupSystemNotice(n))&&(e.from=e.from||"@TIM#SYSTEM"),this.isGroupTip(n)){e.elements=this.restoreGroupTipElements(e.elements);var o=e.elements,s=void 0===o?{}:o,a=s.operationType,i=s.operatorInfo;if(1===a){var u=[{userID:(void 0===i?{}:i).userID}];s.memberInfoList=s.memberInfoList||u}}if(this.isGroupSystemNotice(n)){var c=e.elements,l=c.memberInfoList,p=c.operatorInfo;l||(l=void 0===p?{}:p),e.elements.memberInfoList=t({userID:e.elements.operatorID,avatar:"",nick:""},l),e.elements=t({authentication:"",remarkInfo:"",messageKey:1e3*e.time},e.elements);var d=Object.keys(e.elements).filter((function(e){return"operatorInfo"!==e})).reduce((function(n,o){return t(t({},n),{},r({},o,e.elements[o]))}),{});e.elements=d}return e}},{key:"_onGroupDismissed",value:function(e){xe.l("".concat(this._n,"._onGroupDismissed groupID:").concat(e)),this._groupModule.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:"_checkMessageStacked",value:function(e){var t="MessageStacked",n=e.length;n>=100&&(this._groupModule.outputWarning(t,n),this._reportMessageStackedCount<5&&(new ka(t).setNetworkType(this._groupModule.getNetworkType()).setMessage("count:".concat(n," groupID:").concat(m(this._joinedGroupMap.keys()))).setLevel("warning").end(),this._reportMessageStackedCount+=1))}},{key:"_isMessageSentByCurrentInstance",value:function(e){return!!this._getModule(Fn).isMessageSentByCurrentInstance(e)}},{key:"packMessage",value:function(e,t){e.currentUser=this._groupModule.getMyUserID(),e.conversationType=5===t?S.CONV_SYSTEM:S.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new Ha(e),o=this.packElements(e,t);return n.setElement(o,this._groupModule.getFileDownloadProxy()),n}},{key:"packElements",value:function(e,n){return 4===n||6===n?(this._updateMemberCountByGroupTips(e),{type:S.MSG_GRP_TIP,content:t(t({},e.elements),{},{groupProfile:e.groupProfile})}):5===n?{type:S.MSG_GRP_SYS_NOTICE,content:t(t({},e.elements),{},{groupProfile:t(t({},e.groupProfile),{},{groupID:e.groupID})})}:this._getModule(Hn).parseElements(e.elements,e.from)}},{key:"packConversationOption",value:function(e){for(var t=new Map,n=0;n0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,t)}}},{key:"start",value:function(e){if(this._pollingInstanceMap.has(e)){var t=this._pollingInstanceMap.get(e);t.isRunning()||t.start()}else{var n=new Rr({manager:this,groupID:e,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});n.start(),this._pollingInstanceMap.set(e,n),xe.l("".concat(this._n,".start groupID:").concat(e))}}},{key:"handleJoinResult",value:function(e){var t=this;return this._preCheck().then((function(){var n=e.longPollingKey,o=e.group,s=o.groupID;return t._joinedGroupMap.set(s,o),t._groupModule.updateGroupMap([o]),t._groupModule.deleteUnjoinedAVChatRoom(s),t._groupModule.emitGroupListUpdate(!0,!1),at(n)?za({status:Ye,group:o}):Promise.resolve()}))}},{key:"startRunLoop",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,s=e.startSeq,a=void 0===s?0:s,r=o.groupID;return t._pollingRequestInfoMap.set(r,{key:n,startSeq:a}),t.start(r),t._groupModule.isLoggedIn()?za({status:Ye,group:o}):za({status:Ye})}))}},{key:"_preCheck",value:function(){if(this._getModule(qn).isUnlimitedAVChatRoom())return Promise.resolve();if(!this.hasJoinedAVChatRoom())return Promise.resolve();var e=v(this._joinedGroupMap.entries().next().value,2),t=e[0],n=e[1];if(this._groupModule.isLoggedIn()){if(!(n.selfInfo.role===S.GRP_MBR_ROLE_OWNER||n.ownerID===this._groupModule.getMyUserID()))return this._groupModule.quitGroup(t);this._groupModule.deleteLocalGroupAndConversation(t)}else this._groupModule.deleteLocalGroupAndConversation(t);return this.reset(t),Promise.resolve()}},{key:"joinWithoutAuth",value:function(e){var t=this,n=e.groupID,o="".concat(this._n,".").concat("joinWithoutAuth"),s=new ka("joinWithoutAuth");return this._groupModule.request({protocolName:Qo,requestData:e}).then((function(e){var a=e.data.longPollingKey;if(t._groupModule.probeNetwork().then((function(e){var t=v(e,2);t[0];var o=t[1];s.setNetworkType(o).setMessage("groupID:".concat(n," longPollingKey:").concat(a)).end(!0)})),at(a))return Ja({code:da.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN});xe.l("".concat(o," ok. groupID:").concat(n)),t._getModule(Fn).setCompleted("".concat(S.CONV_GROUP).concat(n));var r=new dr({groupID:n});return t.startRunLoop({group:r,longPollingKey:a}),Ka({status:Ye})})).catch((function(e){return xe.e("".concat(o," failed. groupID:").concat(n," error:"),e),t._groupModule.probeNetwork().then((function(t){var o=v(t,2),a=o[0],r=o[1];s.setError(e,a,r).setMessage("groupID:".concat(n)).end(!0)})),Ja(e)})).finally((function(){t._groupModule.getModule(Vn).reportAtOnce()}))}},{key:"getGroupOnlineMemberCount",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return jt(t)||n-t.lastSyncTime>1e3*t.expireTime&&n-t.latestUpdateTime>1e4&&n-t.lastReqTime>3e3?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return Ka({memberCount:e.memberCount})})).catch((function(e){return Ja(e)}))):za({memberCount:t.memberCount})}},{key:"_getGroupOnlineMemberCount",value:function(e){var t=this,n="".concat(this._n,".").concat("_getGroupOnlineMemberCount");return this._groupModule.request({protocolName:fs,requestData:{groupID:e}}).then((function(o){var s=t._onlineMemberCountMap.get(e)||{},a=o.data,r=a.onlineMemberNum,i=void 0===r?0:r,u=a.expireTime,c=void 0===u?t.DEFAULT_EXPIRE_TIME:u;xe.l("".concat(n," ok. groupID:").concat(e," memberCount:").concat(i," expireTime:").concat(c));var l=Date.now();return jt(s)&&(s.lastReqTime=l),t._onlineMemberCountMap.set(e,Object.assign(s,{lastSyncTime:l,latestUpdateTime:l,memberCount:i,expireTime:c})),{memberCount:i}})).catch((function(o){return xe.w("".concat(n," failed. error:"),o),new ka("_getGroupOnlineMemberCount").setCode(o.code).setMessage("groupID:".concat(e," error:").concat(JSON.stringify(o))).setNetworkType(t._groupModule.getNetworkType()).end(),Promise.reject(o)}))}},{key:"_getModule",value:function(e){return this._groupModule.getModule(e)}},{key:"setPollingInterval",value:function(e){at(e)||($e(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:"setPollingIntervalPlus",value:function(e){at(e)||($e(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:"setPollingNoMessageCount",value:function(e){at(e)||($e(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:"setPollingSimplifiedMessage",value:function(e){at(e)||"0"!==e&&"1"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:"getPollingInterval",value:function(){return this._pollingInterval}},{key:"onAVChatRoomMemberBanned",value:function(e){var t=e.payload.groupProfile.groupID;xe.l("".concat(this._n,".onAVChatRoomMemberBanned groupID:").concat(t)),this._groupModule.deleteLocalGroupAndConversation(t),this.reset(t)}},{key:"restartPolling",value:function(){xe.l("".concat(this._n,".restartPolling count:").concat(this._pollingInstanceMap.size));var e,t=D(this._pollingInstanceMap.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.stop(),n.start()}}catch(o){t.e(o)}finally{t.f()}}},{key:"getPollingTimerID",value:function(e){if(!this._pollingInstanceMap.has(e))return-1;var t=this._pollingInstanceMap.get(e).getPollingTimerID();return xe.l("".concat(this._n,".getPollingTimerID groupID:").concat(e," timerID:").concat(t)),t}},{key:"reset",value:function(e){if(e){xe.l("".concat(this._n,".reset groupID:").concat(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{xe.l("".concat(this._n,".reset all"));var n,o=D(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;){n.value.stop()}}catch(s){o.e(s)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this.receivedMessageCount=0,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}}]),e}(),Gr=1,Ur=15,Pr=function(){function e(t){o(this,e),this._groupModule=t,this._n="GroupSystemNoticeHandler",this.pendencyMap=new Map}return a(e,[{key:"onNewGroupSystemNotice",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=e.isInstantMessage;xe.d("".concat(this._n,".onReceiveSystemNotice count:").concat(t.length));var s=this.newSystemNoticeStoredAndSummary({notifiesList:t,isInstantMessage:o}),a=s.eventDataList,r=s.result;a.length>0&&(this._groupModule.getModule(Fn).onNewMessage({conversationOptionsList:a,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:r,isInstantMessage:o}));o?r.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,r):!0===n&&this._clearGroupSystemNotice()}},{key:"newSystemNoticeStoredAndSummary",value:function(e){var n=e.notifiesList,o=e.isInstantMessage,s=null,a=n.length,r=0,i=[],u={conversationID:S.CONV_SYSTEM,unreadCount:0,type:S.CONV_SYSTEM,subType:null,lastMessage:null};for(r=0;r0?[u]:[],result:i}}},{key:"_clearGroupSystemNotice",value:function(){var e=this;this._getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set("".concat(t.from,"_").concat(t.groupID,"_").concat(t.to),t)}));var n=e._groupModule.getModule(Fn).getLocalMessageList(S.CONV_SYSTEM),o=[];n.forEach((function(t){var n=t.payload,s=n.operatorID,a=n.operationType,r=n.groupProfile;if(a===Gr){var i="".concat(s,"_").concat(r.groupID,"_").concat(r.to),u=e.pendencyMap.get(i);u&&$e(u.handled)&&0!==u.handled&&o.push(t)}})),e.deleteGroupSystemNotice({messageList:o})}))}},{key:"deleteGroupSystemNotice",value:function(e){var t=this,n="".concat(this._n,".deleteGroupSystemNotice");return st(e.messageList)&&0!==e.messageList.length?(xe.l("".concat(n," ")+e.messageList.map((function(e){return e.ID}))),this._groupModule.request({protocolName:gs,requestData:{messageListToDelete:e.messageList.map((function(e){return{from:S.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){xe.l("".concat(n," ok"));var o=t._groupModule.getModule(Fn);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),Ka()})).catch((function(e){return xe.e("".concat(n," error:"),e),Ja(e)}))):za()}},{key:"_getPendencyList",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,o=void 0===n?void 0:n,s=t.startTime,a=void 0===s?0:s,r=t.limit,i=void 0===r?20:r;return this._groupModule.request({protocolName:ds,requestData:{type:o,startTime:a,limit:i,handleAccount:this._groupModule.getMyUserID()}}).then((function(t){var n=t.data.pendencyList;return 0!==t.data.nextStartTime?e._getPendencyList({startTime:t.data.nextStartTime}).then((function(e){return[].concat(m(n),m(e))})):n}))}},{key:"getGroupApplicationList",value:function(){var e=this;return this._getPendencyList().then((function(t){return e._getPendencyList({type:S.GRP_COMMUNITY}).then((function(n){return t.push.apply(t,m(n)),e._handlePendencyResult(t)})).catch((function(n){return e._handlePendencyResult(t)}))}))}},{key:"_handlePendencyResult",value:function(e){var t=this,n=[];return e.forEach((function(e){t.pendencyMap.set("".concat(e.from,"_").concat(e.groupID,"_").concat(e.to),e),0===e.handled&&n.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})})),za({applicationList:n})}},{key:"_onReceivedGroupSystemNotice",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:break;case 2:t._onApplyGroupRequestAgreed(e);break;case 3:break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 6:break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._groupModule.onAVChatRoomMemberBanned(e)}}))}},{key:"_onApplyGroupRequestAgreed",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;if(n){t._groupModule.updateGroupMap([n]);var o=!n.isSupportTopic;t._groupModule.emitGroupListUpdate(!0,o)}}))}},{key:"_onMemberKicked",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onGroupDismissed",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t);var n=this._groupModule._AVChatRoomHandler;n&&n.checkJoinedAVChatRoomByID(t)&&n.reset(t)}},{key:"_onInviteGroup",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;n&&(t._groupModule.updateGroupMap([n]),t._groupModule.emitGroupListUpdate())}))}},{key:"_onQuitGroup",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:"_onSetManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,s=this._groupModule.getModule(bn).getLocalGroupMemberInfo(o,n);s&&s.updateRole(S.GRP_MBR_ROLE_ADMIN)}},{key:"_onDeleteManager",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,s=this._groupModule.getModule(bn).getLocalGroupMemberInfo(o,n);s&&s.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:"_onMessageRemindTypeSynced",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.messageRemindType;this._groupModule.getModule(Fn).onGroupMessageRemindTypeSynced({groupID:t,messageRemindType:n})}},{key:"_handleTopicSystemNotice",value:function(e){var t=e.groupProfile,n=t.groupID,o=t.topicID,s=e.elements,a=s.operationType,r=s.topicIDList,i=s.messageRemindType,u=this._groupModule.getModule(wn);17===a?u.onTopicCreated({groupID:n,topicID:o}):18===a?u.onTopicDeleted({groupID:n,topicIDList:r}):20===a&&u.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:i})}},{key:"reset",value:function(){this.pendencyMap.clear()}}]),e}(),br=["relayFlag"],wr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="GroupModule",t._commonGroupHandler=null,t._AVChatRoomHandler=null,t._groupSystemNoticeHandler=null,t._commonGroupHandler=new Mr(_(t)),t._groupAttributesHandler=new Er(_(t)),t._groupCountersHandler=new Ar(_(t)),t._AVChatRoomHandler=new Or(_(t)),t._groupTipsHandler=new mr(_(t)),t._groupSystemNoticeHandler=new Pr(_(t)),t.groupMap=new Map,t._unjoinedAVChatRoomList=new Map,t._receiptDetailCompleteMap=new Map,t.getInnerEmitterInstance().on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("polling_interval"),t=this.getCloudConfig("polling_interval_plus"),n=this.getCloudConfig("polling_no_msg_count"),o=this.getCloudConfig("polling_simplified_msg");this._AVChatRoomHandler&&(xe.l("".concat(this._n,"._onCloudConfigUpdated pollingInterval:").concat(e)+" pollingIntervalPlus:".concat(t," pollingNoMessageCount:").concat(n)+" pollingSimplifiedMessage:".concat(o)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n),this._AVChatRoomHandler.setPollingSimplifiedMessage(o))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:"guardForAVChatRoom",value:function(e){var t=this;if(e.conversationType===S.CONV_GROUP){var n=Dt(e.to)?qt(e.to):e.to;return this.hasLocalGroup(n)?za():this.getGroupProfile({groupID:n}).then((function(o){var s=o.data.group.type;if(xe.l("".concat(t._n,".guardForAVChatRoom. groupID:").concat(n," type:").concat(s)),s===S.GRP_AVCHATROOM){var a=da.MESSAGE_SEND_FAIL_NOT_IN_AVCHATROOM;return Ja(new Wa({code:a,message:t.getErrorMessage(a,e.from,n),data:{message:e}}))}return za()}))}return za()}},{key:"checkJoinedAVChatRoomByID",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"onNewGroupMessage",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onNewGroupMessage(e)}},{key:"updateNextMessageSeq",value:function(e){var t=this;if(st(e)){var n=this.getModule(wn);e.forEach((function(e){var o=e.conversationID.replace(S.CONV_GROUP,"");Dt(o)&&n.updateLastMessage(o,e.lastMessage),t.groupMap.has(o)&&(t.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)}))}}},{key:"onNewGroupTips",value:function(e){this._groupTipsHandler&&this._groupTipsHandler.onNewGroupTips(e)}},{key:"onGroupMessageRevoked",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:"onNewGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:"onGroupMessageReadNotice",value:function(e){var t=this;e.dataList.forEach((function(e){var n=e.elements.groupMessageReadNotice;if(!at(n)){var o=t.getModule(Fn);n.forEach((function(e){var n=e.groupID,s=e.topicID,a=void 0===s?void 0:s,r=e.lastMessageSeq;xe.d("".concat(t._n,".onGroupMessageReadNotice groupID:").concat(n," lastMessageSeq:").concat(r));var i="".concat(S.CONV_GROUP).concat(n),u=!0;jt(a)||(i="".concat(S.CONV_GROUP).concat(a),u=!1),o.updateIsReadAfterReadReport({conversationID:i,lastMessageSeq:r}),o.updateUnreadCount(i,u),o.clearGroupAtInfoList(i,u)}))}}))}},{key:"onReadReceiptList",value:function(e){var t=this;xe.d("".concat(this._n,".onReadReceiptList options:"),JSON.stringify(e)),e.dataList.forEach((function(e){var n=e.groupProfile,o=e.elements,s=n.groupID,a=t.getModule(Fn),r=o.readReceiptList;a.updateReadReceiptInfo({groupID:s,readReceiptList:r})}))}},{key:"onGroupMessageModified",value:function(e){xe.d("".concat(this._n,".onGroupMessageModified options:"),JSON.stringify(e));var n=this.getModule(Fn);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:S.CONV_GROUP,to:e.topicID?e.topicID:e.groupID}))}))}},{key:"deleteGroupSystemNotice",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:"initGroupMap",value:function(e){this.groupMap.set(e.groupID,new dr(e))}},{key:"deleteGroup",value:function(e){this.groupMap.delete(e)}},{key:"updateGroupMap",value:function(e){var t,n=this,o=this.getModule(Fn);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new dr(e)),o.deleteGroupRomaingMessageInfo(t))}));var s,a=this.getMyUserID(),r=D(this.groupMap);try{for(r.s();!(s=r.n()).done;){var i=v(s.value,2)[1];i.selfInfo.userID=a,"Owner"===i.selfInfo.role&&(i.ownerID=a)}}catch(u){r.e(u)}finally{r.f()}this._setStorageGroupList()}},{key:"getStorageGroupList",value:function(){return this.getModule(xn).getItem("groupMap")}},{key:"_setStorageGroupList",value:function(){var e=this.getLocalGroupList().filter((function(e){var t=e.type;return!Ct(t)})).filter((function(e){return!e.isSupportTopic})).slice(0,20).map((function(e){return{groupID:e.groupID,name:e.name,avatar:e.avatar,type:e.type}}));this.getModule(xn).setItem("groupMap",e)}},{key:"getGroupMap",value:function(){return this.groupMap}},{key:"getLocalGroupList",value:function(){return m(this.groupMap.values())}},{key:"getLocalGroupProfile",value:function(e){return this.groupMap.get(e)}},{key:"sortLocalGroupList",value:function(){var e=m(this.groupMap).filter((function(e){var t=v(e,2);return t[0],!jt(t[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(m(e))}},{key:"updateGroupLastMessage",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:"emitGroupListUpdate",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();if(e&&this.emitOuterEvent(E.GROUP_LIST_UPDATED),t){var o=JSON.parse(JSON.stringify(n)),s=this.getModule(Fn);s.updateConversationGroupProfile(o)}}},{key:"patchGroupMessageRemindType",value:function(){var e=this.getLocalGroupList(),t=this.getModule(Fn),n=0;e.forEach((function(e){!0===t.patchMessageRemindType({ID:e.groupID,isC2CConversation:!1,messageRemindType:e.selfInfo.messageRemindType})&&(n+=1)})),xe.l("".concat(this._n,".patchGroupMessageRemindType count:").concat(n))}},{key:"recomputeUnreadCount",value:function(){var e=this.getLocalGroupList(),t=this.getModule(Fn);e.forEach((function(e){var n=e.groupID,o=e.selfInfo,s=o.excludedUnreadSequenceList,a=o.readedSequence;if(st(s)){var r=0;s.forEach((function(t){t>=a&&t<=e.nextMessageSeq-1&&(r+=1)})),r>=1&&t.recomputeGroupUnreadCount({conversationID:"".concat(S.CONV_GROUP).concat(n),count:r})}}))}},{key:"getMyNameCardByGroupID",value:function(e){var t=this.getLocalGroupProfile(e);return t?t.selfInfo.nameCard:""}},{key:"isPagingGetCompleted",value:function(){return!!this._commonGroupHandler&&this._commonGroupHandler.isPagingGetCompleted()}},{key:"getGroupList",value:function(e){return this._commonGroupHandler?this._commonGroupHandler.getGroupList(e):za()}},{key:"getGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupProfile"),o=new ka("getGroupProfile"),s=e.groupID,a=e.groupCustomFieldFilter;xe.l("".concat(n," groupID:").concat(s));var r={groupIDList:[s],responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember","InviteJoinOption"],groupCustomFieldFilter:a,memberInfoFilter:["Role","JoinTime","MsgSeq","MsgFlag","NameCard"]}};return this.getGroupProfileAdvance(r).then((function(e){var a,r=e.data,i=r.successGroupList,u=r.failureGroupList;if(xe.l("".concat(n," ok")),u.length>0)return Ja(u[0]);(Ct(i[0].type)&&!t.hasLocalGroup(s)?a=new dr(i[0]):(t.updateGroupMap(i),a=t.getLocalGroupProfile(s)),a.isSupportTopic)||t.getModule(Fn).updateConversationGroupProfile([a]);return o.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(s," type:").concat(a.type," muteAllMembers:").concat(a.muteAllMembers," ownerID:").concat(a.ownerID)).end(),Ka({group:a})})).catch((function(s){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],r=n[1];o.setError(s,a,r).setMessage("groupID:".concat(e.groupID)).end()})),xe.e("".concat(n," failed. error:"),s),Ja(s)}))}},{key:"getGroupProfileAdvance",value:function(e){var n="".concat(this._n,".getGroupProfileAdvance"),o=e.groupIDList;st(o)&&o.length>50&&(this.outputWarning("GetGroupProfileLimit"),o.length=50);var s=[],a=[];o.forEach((function(e){Tt({groupID:e})?a.push(e):s.push(e)}));var r=[];if(s.length>0){var i=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:s}));r.push(i)}if(a.length>0){var u=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:a,relayFlag:s.length>0}));r.push(u)}return Promise.all(r).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,m(e.successGroupList)),n.push.apply(n,m(e.failureGroupList))})),Ka({successGroupList:t,failureGroupList:n})})).catch((function(e){return xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_getGroupProfileAdvance",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,s=g(e,br);return this.request({protocolName:Yo,requestData:s}).then((function(e){xe.l("".concat(t._n,"._getGroupProfileAdvance ok."));var n=e.data.groups;return{successGroupList:n.filter((function(e){return at(e.errorCode)||0===e.errorCode})),failureGroupList:n.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new Wa({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&Tt({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Ja(t)}))}},{key:"createGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("createGroup"),s=e.type,a=e.groupID;if(e.name&&!1===this._filterProfanity("name",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Ja({code:da.PROFANITY_FOUND});if(!["Public","Private","ChatRoom","AVChatRoom","Community"].includes(s))return Ja({code:da.ILLEGAL_GROUP_TYPE});if(!Tt({type:s})){if(!jt(a)&&Tt({groupID:a}))return Ja({code:da.ILLEGAL_GROUP_ID});e.isSupportTopic=void 0}if(Ct(s)&&!at(e.memberList)&&e.memberList.length>0&&(e.memberList=void 0),this._canIUseJoinOption(s)||at(e.joinOption)||(e.joinOption=void 0),Tt({type:s})){if(!jt(a)&&!Tt({groupID:a}))return Ja({code:da.ILLEGAL_GROUP_ID});e.isSupportTopic=!0===e.isSupportTopic?1:0}var r=new ka("createGroup");xe.l("".concat(o," options:"),e);var i=null,u=[];return this.request({protocolName:jo,requestData:t(t({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(s){var a=s.data,c=a.groupID,l=a.overLimitUserIDList,p=void 0===l?[]:l;if(i=c,u=p,r.setNetworkType(n.getNetworkType()).setMessage("groupType:".concat(e.type," groupID:").concat(c," overLimitUserIDList=").concat(p)).end(),xe.l("".concat(o," ok groupID:").concat(c," overLimitUserIDList:"),p),e.type===S.GRP_AVCHATROOM)return n.getGroupProfile({groupID:c});if(e.type===S.GRP_COMMUNITY&&1===e.isSupportTopic)return n.getGroupProfile({groupID:c});jt(e.memberList)||jt(p)||(e.memberList=e.memberList.filter((function(e){return-1===p.indexOf(e.userID)}))),n.updateGroupMap([t(t({},e),{},{groupID:c})]);var d=n.getModule(Rn),g=d.createCustomMessage({to:c,conversationType:S.CONV_GROUP,payload:{data:"group_create",extension:n.isIntl()?"".concat(n.getMyUserID()," created a group"):"".concat(n.getMyUserID(),"创建群组")}});return d.sendMessageInstance(g),n.emitGroupListUpdate(),n.getGroupProfile({groupID:c})})).then((function(e){var t=e.data.group,n=t.selfInfo,o=n.nameCard,s=n.joinTime;return t.updateSelfInfo({nameCard:o,joinTime:s,messageRemindType:S.MSG_REMIND_ACPT_AND_NOTE,role:S.GRP_MBR_ROLE_OWNER}),Ka({group:t,overLimitUserIDList:u})})).catch((function(s){if(r.setMessage("groupType:".concat(e.type)),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],o=t[1];r.setError(s,n,o).end()})),10010===s.code||10007===s.code){n.updateGroupMap([t(t({},e),{},{groupID:i})]);var a=n.getLocalGroupProfile(i);return xe.l("".concat(o," success, but failed to get group profile.")),Ka({group:a,overLimitUserIDList:u})}return xe.e("".concat(o," failed. error:"),s),Ja(s)}))}},{key:"dismissGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("dismissGroup");if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===S.GRP_WORK)return Ja(new Wa({code:da.CANNOT_DISMISS_WORK}));var o=new ka("dismissGroup");return o.setMessage("groupID:".concat(e)),xe.l("".concat(n," groupID:").concat(e)),this.request({protocolName:zo,requestData:{groupID:e}}).then((function(){return o.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Ka({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"updateGroupProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("updateGroupProfile");if(this.hasLocalGroup(e.groupID)){var o=this.getLocalGroupProfile(e.groupID).type;this._canIUseJoinOption(o)||at(e.joinOption)||(xe.w("".concat(n," joinOption is unavailable for Work/Meeting/AVChatRoom")),e.joinOption=void 0)}if(at(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers="On":e.muteAllMembers="Off"),e.name&&!1===this._filterProfanity("name",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Ja({code:da.PROFANITY_FOUND});var s=new ka("updateGroupProfile");return s.setMessage(JSON.stringify(e)),xe.l("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:Jo,requestData:e}).then((function(){(s.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),t.hasLocalGroup(e.groupID))&&(t.groupMap.get(e.groupID).updateGroup(e),t._setStorageGroupList());return Ka({group:t.groupMap.get(e.groupID)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.l("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],z),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"joinGroup",value:function(e){var t=this,n=e.groupID,o=e.type,s="".concat(this._n,".joinGroup");if(o===S.GRP_WORK)return Ja({code:da.CANNOT_JOIN_WORK});if(this.deleteUnjoinedAVChatRoom(n),this.hasLocalGroup(n)){if(!this.isLoggedIn())return za({status:S.JOIN_STATUS_ALREADY_IN_GROUP});var a=new ka("applyJoinGroup");return this.getGroupProfile({groupID:n}).then((function(){return a.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," joinedStatus:").concat(S.JOIN_STATUS_ALREADY_IN_GROUP)).end(),za({status:S.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(o){return a.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(n," unjoined")).end(),xe.w("".concat(s," ").concat(n," was unjoined, now join!")),t.groupMap.delete(n),t.applyJoinGroup(e)}))}return xe.l("".concat(s," groupID:").concat(n)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:"applyJoinGroup",value:function(e){var n=this,o="".concat(this._n,".").concat("applyJoinGroup"),s=e.groupID;if(!jt(e.applyMessage)&&!1===this._filterProfanity("applyMessage",e))return Ja({code:da.PROFANITY_FOUND});var a=new ka("applyJoinGroup"),r=t({},e),i=this.canIUse(B.AVCHATROOM_HISTORY_MSG);return i&&(r.historyMessageFlag=1),this.getModule(Fn).deleteTopicRoamingMessageInfo(s),this.request({protocolName:Xo,requestData:r}).then((function(e){var t=e.data,r=t.joinedStatus,u=t.longPollingKey,c=t.startSeq,l=t.avChatRoomFlag,p=t.avChatRoomKey,d=t.messageList,g="groupID:".concat(s," joinedStatus:").concat(r," longPollingKey:").concat(u," startSeq:").concat(c)+" avChatRoomFlag:".concat(l," canGetAVChatRoomHistoryMessage:").concat(i,",")+" history message count:".concat(jt(d)?0:d.length);switch(a.setNetworkType(n.getNetworkType()).setMessage("".concat(g)).end(),xe.l("".concat(o," ok. ").concat(g)),r){case je:return Ka({status:je});case Ye:return n.getGroupProfile({groupID:s}).then((function(e){var t=e.data.group;return n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:u,startSeq:c,avChatRoomKey:p,messageList:d})})).catch((function(){var e=new dr({groupID:s});return n._handleJoinResult({group:e,avChatRoomFlag:l,longPollingKey:u,startSeq:c,avChatRoomKey:p,messageList:d})}));default:var _=new Wa({code:da.JOIN_GROUP_FAIL});return xe.e("".concat(o," failed. error:"),_),Ja(_)}})).catch((function(e){return a.setMessage("groupID:".concat(s)),n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"_handleJoinResult",value:function(e){var t,n=this,o=e.group,s=e.avChatRoomFlag,a=e.longPollingKey,r=e.startSeq,i=e.avChatRoomKey,u=e.messageList,c=o.groupID;return 1===s?(this.getModule(Fn).setCompleted("".concat(S.CONV_GROUP).concat(c)),this._groupAttributesHandler.initGroupAttributesCache({groupID:c,avChatRoomKey:i}),this._groupCountersHandler.initGroupCountersCache({groupID:c,avChatRoomKey:i}),(t=at(a)?this._AVChatRoomHandler.handleJoinResult({group:o}):this._AVChatRoomHandler.startRunLoop({group:o,longPollingKey:a,startSeq:r})).then((function(){n._onAVChatRoomHistoryMessage(u)})),t):(this.emitGroupListUpdate(!0,!1),Ka({status:Ye,group:o}))}},{key:"quitGroup",value:function(e){var t=this,n="".concat(this._n,".").concat("quitGroup");xe.l("".concat(n," groupID:").concat(e));var o=this.checkJoinedAVChatRoomByID(e);if(!o&&!this.hasLocalGroup(e))return Ja({code:da.MEMBER_NOT_IN_GROUP});if(o&&!this.isLoggedIn())return xe.l("".concat(n," anonymously ok. groupID:").concat(e)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),za({groupID:e});var s=new ka("quitGroup");return s.setMessage("groupID:".concat(e)),this.request({protocolName:Zo,requestData:{groupID:e}}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),t.deleteLocalGroupAndConversation(e),o&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Ka({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"searchGroupByID",value:function(e){var t=this,n="".concat(this._n,".").concat("searchGroupByID"),o={groupIDList:[e]},s=new ka("searchGroupByID");return s.setMessage("groupID:".concat(e)),xe.l("".concat(n," groupID:").concat(e)),this.request({protocolName:$o,requestData:o}).then((function(e){var o=e.data.groupProfile;if(0!==o[0].errorCode)throw new Wa({code:o[0].errorCode,message:o[0].errorInfo});return s.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),Ka({group:new dr(o[0])})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.w("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"changeGroupOwner",value:function(e){var t=this,n="".concat(this._n,".").concat("changeGroupOwner");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===S.GRP_AVCHATROOM)return Ja({code:da.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(e.newOwnerID===this.getMyUserID())return Ja({code:da.CANNOT_CHANGE_OWNER_TO_SELF});var o=new ka("changeGroupOwner");return o.setMessage("groupID:".concat(e.groupID," newOwnerID:").concat(e.newOwnerID)),xe.l("".concat(n," groupID:").concat(e.groupID)),this.request({protocolName:es,requestData:e}).then((function(){o.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok"));var s=e.groupID,a=e.newOwnerID;t.groupMap.get(s).ownerID=a;var r=t.getModule(bn).getLocalGroupMemberList(s);if(r instanceof Map){var i=r.get(t.getMyUserID());at(i)||(i.updateRole("Member"),t.groupMap.get(s).selfInfo.role="Member");var u=r.get(a);at(u)||u.updateRole("Owner")}return t.emitGroupListUpdate(!0,!1),Ka({group:t.groupMap.get(s)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"getGroupApplicationList",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){var t,n,o,s,a,r=this,i="".concat(this._n,".").concat("handleGroupApplication"),u=e.handleAction,c=e.handleMessage,l=e.message,p=e.application;l?(t=l.payload.operatorID,n=l.payload.groupProfile.groupID,o=l.payload.authentication,s=l.payload.messageKey):p&&(t=p.applicant,n=p.groupID,o=p.authentication,s=p.messageKey);var d=ts;p&&2===p.applicationType&&(d=ns,a=p.userID);var g=new ka("handleGroupApplication");return g.setMessage("groupID:".concat(n)),xe.l("".concat(i," groupID:").concat(n)),this.request({protocolName:d,requestData:{handleAction:u,handleMessage:c,applicant:t,invitee:a,groupID:n,authentication:o,messageKey:s}}).then((function(){return g.setNetworkType(r.getNetworkType()).end(),xe.l("".concat(i," ok")),l&&r._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Ka({group:r.getLocalGroupProfile(n)})})).catch((function(e){return r.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];g.setError(e,o,s).end()})),xe.e("".concat(i," failed. error"),e),Ja(e)}))}},{key:"handleGroupInvitation",value:function(e){var n=this,o="".concat(this._n,".").concat("handleGroupInvitation"),s=e.message.payload,a=s.groupProfile.groupID,r=s.authentication,i=s.messageKey,u=s.operatorID,c=e.handleAction,l=new ka("handleGroupInvitation");return l.setMessage("groupID:".concat(a," inviter:").concat(u," handleAction:").concat(c)),xe.l("".concat(o," groupID:").concat(a," inviter:").concat(u," handleAction:").concat(c)),this.request({protocolName:os,requestData:t(t({},e),{},{inviter:u,groupID:a,authentication:r,messageKey:i})}).then((function(){return l.setNetworkType(n.getNetworkType()).end(),xe.l("".concat(o," ok")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Ka({group:n.getLocalGroupProfile(a)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),xe.e("".concat(o," failed. error"),e),Ja(e)}))}},{key:"getGroupOnlineMemberCount",value:function(e){return this._AVChatRoomHandler?this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)?this._AVChatRoomHandler.getGroupOnlineMemberCount(e):za({memberCount:0}):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"hasLocalGroup",value:function(e){return this.groupMap.has(e)}},{key:"deleteLocalGroupAndConversation",value:function(e){var t=this.checkJoinedAVChatRoomByID(e);(xe.l("".concat(this._n,".deleteLocalGroupAndConversation isJoinedAVChatRoom:").concat(t)),t)&&this.getModule(Fn).deleteLocalConversation("".concat(S.CONV_GROUP).concat(e));if(Tt({groupID:e})){var n=this.getLocalGroupProfile(e);if(n&&!0===n.isSupportTopic)this.getModule(wn).deleteTopicListInCommunity(e)}this._deleteLocalGroup(e),this.emitGroupListUpdate(!0,!1)}},{key:"_deleteLocalGroup",value:function(e){this.groupMap.delete(e),this.getModule(bn).deleteGroupMemberList(e),this._setStorageGroupList()}},{key:"sendMessage",value:function(e,t){if(st(e._receiverList)&&e._receiverList.length>0&&!this.canIUse(B.MSG_TO_SPECIFIED_GRP_MBR))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=this.createGroupMessagePack(e,t);return this.request(n)}},{key:"createGroupMessagePack",value:function(e,t){var n=null;t&&t.offlinePushInfo&&(n=t.offlinePushInfo);var o="";et(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c=void 0;st(e._receiverList)&&e._receiverList.length>0&&(c=e._receiverList,e._receiverList.length>50&&(c=e._receiverList.slice(0,50),this.outputWarning("ReceiverListLimit")));var l=this.isOnlineMessage(e,t)?1:0,p=e.getGroupAtInfoList(),d={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==S.MSG_TEXT||jt(p)?void 0:p,onlineOnlyFlag:l,clientTime:e.clientTime,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||"",desc:n.description||"",ext:n.extension||"",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||""}}:void 0,messageControlInfo:0===l?s:void 0,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:c,isSupportExtension:!0===e.isSupportExtension?1:0};return Dt(e.to)&&(d.groupID=qt(e.to),d.topicID=e.to),{protocolName:ho,tjgID:this.generateTjgID(e),requestData:d}}},{key:"_isVoipPush",value:function(e){var t=void 0;return at(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:"revokeMessage",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Dt(e.to)&&(t.groupID=qt(e.to),t.topicID=e.to),this.request({protocolName:ss,requestData:t})}},{key:"deleteMessage",value:function(e){var t=e.to,n=e.keyList;xe.l("".concat(this._n,".deleteMessage groupID:").concat(t," count:").concat(n.length));var o={groupID:t,deleter:this.getMyUserID(),keyList:n};return Dt(t)&&(o.groupID=qt(t),o.topicID=t),this.request({protocolName:vs,requestData:o})}},{key:"modifyRemoteMessage",value:function(e){var t=e.to,n=e.sequence,o=e.payload,s=e.type,a=e.version,r=void 0===a?0:a,i=e.cloudCustomData,u=t,c=void 0;Dt(t)&&(u=qt(t),c=t);var l=void 0;return Vt(s)&&(l=[]).push({type:s,content:o}),this.request({protocolName:ms,requestData:{groupID:u,topicID:c,sequence:n,version:r,elements:l,cloudCustomData:i}})}},{key:"getRoamingMessage",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessage"),o=e.conversationID,s=e.groupID,a=e.sequence,r=new ka("getGroupRoamingMessages"),i=0,u=void 0;return Dt(s)&&(s=qt(u=s)),this._computeLastSequence({groupID:s,topicID:u,sequence:a}).then((function(e){return i=e,xe.l("".concat(n," groupID:").concat(s," startSequence:").concat(i)),t.request({protocolName:is,requestData:{groupID:s,count:21,sequence:i,topicID:u}})})).then((function(e){var a=e.data,c=a.messageList,l=a.complete,p=a.invisibleSequenceList,d=void 0===p?[]:p;at(c)?xe.l("".concat(n," ok. complete:").concat(l," but messageList is undefined!")):xe.l("".concat(n," ok. complete:").concat(l," count:").concat(c.length));var g=t._getMinSequence(d,c)-1;r.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(s," topicID:").concat(u," startSequence:").concat(i," complete:").concat(l," nextSequence:").concat(g)).end();var _=t.getModule(Fn),h=[];return jt(c)||(_.updateRoamingMessageSequence(o,g),h=_.onRoamingMessage(c,o),_.updateIsRead(o),_.patchConversationLastMessage(o)),(2===l||g<=1)&&(_.setCompleted(o),g=""),xe.l("".concat(n," nextReqID:").concat(g,", stored message count:").concat(h.length,", invisible sequence count:").concat(d.length)),{nextReqID:g+"",storedMessageList:h}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).setMessage("groupID:".concat(s," topicID:").concat(u," startSequence:").concat(i)).end()})),xe.w("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_getGroupIDOfMessage",value:function(e){return e.conversationID.replace(S.CONV_GROUP,"")}},{key:"_getMinSequence",value:function(e,t){var n=0;jt(t)||(n=t[t.length-1].sequence);var o=0;jt(e)||(o=e[e.length-1]);return xe.l("".concat(this._n,"._getMinSequence minVisibleSequence:").concat(n," minInvisibleSequence:").concat(o)),o>0&&o=100?100:a,_="groupID:".concat(r," sequence:").concat(u," cursor:").concat(d," filter:").concat(p," completeFlag:").concat(l);xe.l("".concat(c," ").concat(_));var h={cursor:"",isCompleted:!1,messageID:i,unreadUserIDList:[],readUserIDList:[]},f=new ka("getReadReceiptDetail");return f.setMessage(_),this.request({protocolName:ps,requestData:{groupID:r,sequence:u,flag:p,cursor:d,count:g}}).then((function(e){f.end();var n=e.data,o=n.cursor,s=n.isCompleted,a=n.unreadUserIDList,r=n.readUserIDList;return h.cursor=o,1===s&&(h.isCompleted=!0,t._receiptDetailCompleteMap.set(i,!0)),0===p?h.readUserIDList=r.map((function(e){return e.userID})):1===p&&(h.unreadUserIDList=a.map((function(e){return e.userID}))),xe.l("".concat(c," ok")),Ka(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];f.setError(e,o,s).end()})),xe.w("".concat(c," failed. error:"),e),Ja(e)}))}},{key:"getRoamingMessagesHopping",value:function(e){var t=this,n="".concat(this._n,".getRoamingMessagesHopping"),o=new ka("getGroupRoamingMessagesHopping"),s=e.groupID,a=e.count,r=e.sequence,i=e.direction,u=r;1===i&&(u=r+a-1);var c=void 0;Dt(s)&&(s=qt(c=s));var l="".concat(c?"topicID:".concat(c):"groupID:".concat(s)," sequence:").concat(r," direction:").concat(i);return xe.l("".concat(n," ").concat(l)),this.request({protocolName:is,requestData:{groupID:s,topicID:c,count:a,sequence:u}}).then((function(s){var a=s.data,u=a.messageList,c=a.complete,p="complete:".concat(c," count:").concat(u?u.length:0);if(xe.l("".concat(n," ok. ").concat(p)),o.setNetworkType(t.getNetworkType()).setMessage("".concat(l," ").concat(p)).end(),2===c||jt(u)){var d=t._computeResult();return Ka(d)}var g="".concat(S.CONV_GROUP).concat(e.groupID),_=t.getModule(Fn).onRoamingMessage(u,g,!1),h=t._computeResult({direction:i,sequence:r,remoteMessageList:u,processedMessageList:_});return Ka(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),i=n[0],u=n[1];o.setError(e,i,u).setMessage("groupID:".concat(s," sequence:").concat(r," count:").concat(a)).end()})),xe.w("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_computeResult",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:""};if(at(e))return t.isCompleted=!0,t;var n=e.direction,o=e.sequence,s=e.remoteMessageList,a=void 0===s?[]:s,r=e.processedMessageList,i=void 0===r?[]:r,u=a.length;return 1===n?(t.nextMessageSeq=a[0].sequence+1,i.forEach((function(e){e.sequence>=o&&t.messageList.push(e)})),0===t.messageList.length&&a[0].sequence0?Promise.resolve(s):at(o)||this.hasLocalGroup(t)?at(o)?this.getGroupLastSequence(t):this.getTopicLastSequence({groupID:t,topicID:o}):Promise.resolve(0)}},{key:"getGroupLastSequence",value:function(e){var t=this,n="".concat(this._n,".").concat("getGroupLastSequence"),o=new ka("getGroupLastSequence"),s=0,a="";if(this.hasLocalGroup(e)){var r=this.getLocalGroupProfile(e),i=r.lastMessage;if(i.lastSequence>0&&!1===i.onlineOnlyFlag)return s=i.lastSequence,a="got lastSequence:".concat(s," from local group profile[lastMessage.lastSequence]. groupID:").concat(e),xe.l("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(s);if(r.nextMessageSeq>1)return s=r.nextMessageSeq-1,a="got lastSequence:".concat(s," from local group profile[nextMessageSeq]. groupID:").concat(e),xe.l("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(s)}var u="GROUP".concat(e),c=this.getModule(Fn).getLocalConversation(u);if(c&&c.lastMessage.lastSequence&&!1===c.lastMessage.onlineOnlyFlag)return s=c.lastMessage.lastSequence,a="got lastSequence:".concat(s," from local conversation profile[lastMessage.lastSequence]. groupID:").concat(e),xe.l("".concat(n," ").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage("".concat(a)).end(),Promise.resolve(s);var l={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["NextMsgSeq"]}};return this.getGroupProfileAdvance(l).then((function(r){var i=r.data.successGroupList;return jt(i)?xe.l("".concat(n," successGroupList is empty. groupID:").concat(e)):(s=i[0].nextMessageSeq-1,a="got lastSequence:".concat(s," from getGroupProfileAdvance. groupID:").concat(e),xe.l("".concat(n," ").concat(a))),o.setNetworkType(t.getNetworkType()).setMessage("".concat(a)).end(),s})).catch((function(s){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],r=n[1];o.setError(s,a,r).setMessage("get lastSequence failed from getGroupProfileAdvance. groupID:".concat(e)).end()})),xe.w("".concat(n," failed. error:"),s),Ja(s)}))}},{key:"getTopicLastSequence",value:function(e){var t=this,n=e.groupID,o=e.topicID,s="".concat(this._n,".").concat("getTopicLastSequence"),a=new ka("getTopicLastSequence"),r=0,i="",u=this.getModule(wn);return u.hasLocalTopic(n,o)?(r=u.getLocalTopic(n,o).nextMessageSeq-1,i="get lastSequence:".concat(r," from local topic info[nextMessageSeq]. topicID:").concat(o),xe.l("".concat(s," ").concat(i)),a.setNetworkType(this.getNetworkType()).setMessage("".concat(i)).end(),Promise.resolve(r)):u.getTopicList({groupID:n,topicIDList:[o]}).then((function(e){var n=e.data.successTopicList;return jt(n)?xe.l("".concat(s," successTopicList is empty. topicID:").concat(o)):(r=n[0].nextMessageSeq-1,i="get lastSequence:".concat(r," from getTopicList. topicID:").concat(o),xe.l("".concat(s," ").concat(i))),a.setNetworkType(t.getNetworkType()).setMessage("".concat(i)).end(),r})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],r=n[1];a.setError(e,s,r).setMessage("get lastSequence failed from getTopicList. topicID:".concat(o)).end()})),xe.w("".concat(s," failed. error:"),e),Ja(e)}))}},{key:"isMessageFromOrToAVChatroom",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:"hasJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.hasJoinedAVChatRoom():0}},{key:"getJoinedAVChatRoom",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.getJoinedAVChatRoom():[]}},{key:"isOnlineMessage",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:"_canIUseOnlineOnlyFlag",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==S.CONV_GROUP}},{key:"_onAVChatRoomHistoryMessage",value:function(e){if(!jt(e)){xe.l("".concat(this._n,"._onAVChatRoomHistoryMessage count:").concat(e.length));var n=[];e.forEach((function(e){n.push(t(t({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(n)}}},{key:"onAVChatRoomMessage",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onMessage(e)}},{key:"onAVChatRoomMemberBanned",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:"getGroupSimplifiedInfo",value:function(e){var t=this,n=new ka("getGroupSimplifiedInfo"),o={groupIDList:[e],responseFilter:{groupBaseInfoFilter:["Type","Name"]}};return this.getGroupProfileAdvance(o).then((function(o){var s=o.data.successGroupList;return n.setNetworkType(t.getNetworkType()).setMessage("groupID:".concat(e," type:").concat(s[0].type)).end(),s[0]})).catch((function(o){t.probeNetwork().then((function(t){var s=v(t,2),a=s[0],r=s[1];n.setError(o,a,r).setMessage("groupID:".concat(e)).end()}))}))}},{key:"setUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:"deleteUnjoinedAVChatRoom",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:"isUnjoinedAVChatRoom",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:"isGroupAttributesUpdatedNotice",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:"updateLocalMainSequenceOnReconnected",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:"initGroupAttributes",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:"isMessageFromTopic",value:function(e,t){return 2===e&&!jt(t)}},{key:"isMessageFromCommunityOfTopic",value:function(e,t){return 2===e&&jt(t)}},{key:"getMessageExtensions",value:function(e,t){return xe.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t)),this.request({protocolName:Es,requestData:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return xe.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n)),this.request({protocolName:Ds,requestData:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"getGroupNotify",value:function(e){var n=this;if(this.hasLocalGroup(e)){var o=this.getLocalGroupProfile(e),s=o.type,a=o.isSupportTopic;if(!Ct(s)&&!a){var r="".concat(this._n,".getGroupNotify"),i=this._getGroupLastRevokedTime(e),u=1e3*Ue();xe.l("".concat(r," groupID:").concat(e," type:").concat(s," beginTime:").concat(i," endTime:").concat(u)),this.request({protocolName:Ss,requestData:{type:Tt({type:s,groupID:e})?S.GRP_COMMUNITY:void 0,groupID:e,beginTime:i,endTime:u}}).then((function(o){var s=o.data,a=s.nextRevokedTime,i=s.notifyList;xe.l("".concat(r," ok. groupID:").concat(e," nextRevokedTime:").concat(a));var u={dataList:[{elements:{revokedInfos:[]}}]};st(i)&&i.forEach((function(n){u.dataList[0].elements.revokedInfos.push({groupID:e,sequence:n.sequence,random:n.random,revokerInfo:t({},n.revokerInfo)})})),n.onGroupMessageRevoked(u),0!==a?(n._setGroupLastRevokedTime(e,a),n.getGroupNotify(e)):n._setGroupLastRevokedTime(e,1e3*Ue())})).catch((function(e){xe.e("".concat(r," failed. error:"),e)}))}}}},{key:"_getGroupLastRevokedTime",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:"_setGroupLastRevokedTime",value:function(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}},{key:"isGroupCountersNotice",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:"setGroupCounters",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:"restartPolling",value:function(){this._AVChatRoomHandler&&this._AVChatRoomHandler.restartPolling()}},{key:"getPollingTimerID",value:function(e){if(!e)return-1;var t=this.getLocalGroupProfile(e);return t&&Ct(t.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}},{key:"_canIUseJoinOption",value:function(e){return function(e){return e===S.GRP_PUBLIC}(e)||Tt({type:e})}},{key:"reset",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._groupAttributesHandler.reset(),this._groupCountersHandler.reset(),this._AVChatRoomHandler&&this._AVChatRoomHandler.reset()}}]),s}(ro),Fr=function(){function e(t){o(this,e),this.userID="",this.avatar="",this.nick="",this.role="",this.joinTime="",this.lastSendMsgTime="",this.nameCard="",this.muteUntil=0,this.memberCustomField=[],this._initMember(t)}return a(e,[{key:"_initMember",value:function(e){this.updateMember(e)}},{key:"updateMember",value:function(e){var t=[null,void 0,"",0,NaN];e.memberCustomField&&It(this.memberCustomField,e.memberCustomField),pt(this,e,["memberCustomField","marks"],t)}},{key:"updateRole",value:function(e){["Owner","Admin","Member"].indexOf(e)<0||(this.role=e)}},{key:"updateMuteUntil",value:function(e){at(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:"updateNameCard",value:function(e){at(e)||(this.nameCard=e)}},{key:"updateMemberCustomField",value:function(e){e&&It(this.memberCustomField,e)}}]),e}(),qr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="GroupMemberModule",t.groupMemberListMap=new Map,t.getInnerEmitterInstance().on(er,t._onProfileUpdated,_(t)),t}return a(s,[{key:"_onProfileUpdated",value:function(e){for(var t=this,n=e.data,o=function(e){var o=n[e];t.groupMemberListMap.forEach((function(e){e.has(o.userID)&&e.get(o.userID).updateMember({nick:o.nick,avatar:o.avatar})}))},s=0;s100?100:r};Tt({groupID:n})?_.next="".concat(s):(_.offset=s,g=s+r);var h=[];return this.request({protocolName:As,requestData:_}).then((function(e){var o=e.data,s=o.members,a=o.memberNum,r=o.next,i=void 0===r?void 0:r;if(at(i)||(g=jt(i)?0:i),!st(s)||0===s.length)return g=0,Promise.resolve([]);var u=t.getModule(Un);return u.hasLocalGroup(n)&&(u.getLocalGroupProfile(n).memberNum=a),h=t._updateLocalGroupMemberMap(n,s),t.getModule(On).getUserProfile({userIDList:s.map((function(e){return e.userID})),tagList:[Be.NICK,Be.AVATAR]})})).then((function(e){var o=e.data;if(!st(o)||0===o.length)return za({memberList:[],offset:g});var a=o.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));return t._updateLocalGroupMemberMap(n,a),h.length5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)),xe.l("".concat(o," groupID:").concat(e.groupID," userIDList:").concat(e.userIDList.join(","))),e.userIDList.length>50&&(e.userIDList=e.userIDList.slice(0,50));var a=e.groupID,r=e.userIDList;return this._getGroupMemberProfileAdvance(t(t({},e),{},{userIDList:r})).then((function(e){var t=e.data.members;return st(t)&&0!==t.length?(n._updateLocalGroupMemberMap(a,t),n.getModule(On).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[Be.NICK,Be.AVATAR]})):za([])})).then((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));n._updateLocalGroupMemberMap(a,t);var o=r.filter((function(e){return n.hasLocalGroupMember(a,e)})).map((function(e){return n.getLocalGroupMemberInfo(a,e)}));return s.setNetworkType(n.getNetworkType()).end(),Ka({memberList:o})}))}},{key:"addGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("addGroupMember"),o=e.groupID,s=this.getModule(Un).getLocalGroupProfile(o),a=s.type,r=new ka("addGroupMember");if(r.setMessage("groupID:".concat(o," groupType:").concat(a)),Ct(a)){var i=new Wa({code:da.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return r.setError(i,!0,this.getNetworkType()).end(),Ja(i)}return e.userIDList=e.userIDList.map((function(e){return{userID:e}})),xe.l("".concat(n," groupID:").concat(o)),this.request({protocolName:Os,requestData:e}).then((function(o){var a=o.data.members;xe.l("".concat(n," ok"));var i=a.filter((function(e){return 1===e.result})).map((function(e){return e.userID})),u=a.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),c=a.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),l=a.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),p="groupID:".concat(e.groupID,", ")+"successUserIDList:".concat(i,", ")+"failureUserIDList:".concat(u,", ")+"existedUserIDList:".concat(c,", ")+"overLimitUserIDList:".concat(l);return r.setNetworkType(t.getNetworkType()).setMoreMessage(p).end(),0===i.length?Ka({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l}):(s.memberCount+=i.length,t._updateConversationGroupProfile(s),Ka({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l,group:s}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"deleteGroupMember",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteGroupMember"),o=e.groupID,s=e.userIDList,a=this.getModule(Un).getLocalGroupProfile(o);if(at(a))return Ja({code:da.CANNOT_FIND_GROUP});if(Ct(a.type))return this.canIUse(B.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(e):Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var r=new ka("deleteGroupMember"),i="groupID:".concat(o," ").concat(s.length>5?"userIDList.length:".concat(s.length):"userIDList:".concat(s));return r.setMessage(i),xe.l("".concat(n," groupID:").concat(o," userIDList:"),s),this.request({protocolName:Gs,requestData:e}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),a.memberCount-=1,t._updateConversationGroupProfile(a),t.deleteLocalGroupMembers(o,s),Ka({group:a,userIDList:s})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_updateConversationGroupProfile",value:function(e){this.getModule(Fn).updateConversationGroupProfile([e])}},{key:"_banAVChatRoomMember",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteGroupMember"),o=e.groupID,s=e.userIDList,a="groupID:".concat(o," ").concat(s.length>5?"userIDList.length:".concat(s.length):"userIDList:".concat(s)),r=new ka("deleteGroupMember");r.setMessage(a),xe.l("".concat(n," groupID:").concat(o," userIDList:"),s);var i=this.getModule(Un).getLocalGroupProfile(o);return at(e.duration)||0===e.duration?Ja({code:da.BAN_DURATION_INVALID}):this.request({protocolName:Us,requestData:e}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),t.deleteLocalGroupMembers(o,s),Ka({group:i,userIDList:s})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"setGroupMemberMuteTime",value:function(e){var t=this,n=e.groupID,o=e.userID,s=e.muteTime,a="".concat(this._n,".").concat("setGroupMemberMuteTime");if(o===this.getMyUserID())return Ja(new Wa({code:da.CANNOT_MUTE_SELF}));xe.l("".concat(a," groupID:").concat(n," userID:").concat(o));var r=new ka("setGroupMemberMuteTime");return r.setMessage("groupID:".concat(n," userID:").concat(o," muteTime:").concat(s)),this.modifyGroupMemberInfo({groupID:n,userID:o,muteTime:s}).then((function(e){r.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(a," ok"));var o=t.getModule(Un);return Ka({group:o.getLocalGroupProfile(n),member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(a," failed. error:"),e),Ja(e)}))}},{key:"setGroupMemberRole",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberRole"),o=e.groupID,s=e.userID,a=e.role,r=this.getModule(Un).getLocalGroupProfile(o);if(r.selfInfo.role!==S.GRP_MBR_ROLE_OWNER)return Ja({code:da.NOT_OWNER});if([S.GRP_WORK,S.GRP_AVCHATROOM].includes(r.type))return Ja({code:da.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});var i=[S.GRP_MBR_ROLE_ADMIN,S.GRP_MBR_ROLE_MEMBER];if(Tt({groupID:o})&&i.push(S.GRP_MBR_ROLE_CUSTOM),i.indexOf(a)<0)return Ja({code:da.INVALID_MEMBER_ROLE});if(s===this.getMyUserID())return Ja({code:da.CANNOT_SET_SELF_MEMBER_ROLE});var u=new ka("setGroupMemberRole");return u.setMessage("groupID:".concat(o," userID:").concat(s," role:").concat(a)),xe.l("".concat(n," groupID:").concat(o," userID:").concat(s)),this.modifyGroupMemberInfo({groupID:o,userID:s,role:a}).then((function(e){return u.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok")),Ka({group:r,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],J),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"setGroupMemberNameCard",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberNameCard");if(e.nameCard&&!1===this._filterProfanity("nameCard",e))return Ja({code:da.PROFANITY_FOUND});var o=e.groupID,s=e.userID,a=void 0===s?this.getMyUserID():s,r=e.nameCard;xe.l("".concat(n," groupID:").concat(o," userID:").concat(a));var i=new ka("setGroupMemberNameCard");return i.setMessage("groupID:".concat(o," userID:").concat(a," nameCard:").concat(r)),this.modifyGroupMemberInfo({groupID:o,userID:a,nameCard:r}).then((function(e){xe.l("".concat(n," ok")),i.setNetworkType(t.getNetworkType()).end();var s=t.getModule(Un).getLocalGroupProfile(o);return a===t.getMyUserID()&&s&&s.setSelfNameCard(r),Ka({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"setGroupMemberCustomField",value:function(e){var t=this,n="".concat(this._n,".").concat("setGroupMemberCustomField"),o=e.groupID,s=e.userID,a=void 0===s?this.getMyUserID():s,r=e.memberCustomField;xe.l("".concat(n," groupID:").concat(o," userID:").concat(a));var i=new ka("setGroupMemberCustomField");return i.setMessage("groupID:".concat(o," userID:").concat(a," memberCustomField:").concat(JSON.stringify(r))),this.modifyGroupMemberInfo({groupID:o,userID:a,memberCustomField:r}).then((function(e){i.setNetworkType(t.getNetworkType()).end(),xe.l("".concat(n," ok"));var s=t.getModule(Un).getLocalGroupProfile(o);return Ka({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"modifyGroupMemberInfo",value:function(e){var n=this,o=e.groupID,s=e.userID,a=void 0;return Dt(o)&&(o=qt(a=o)),this.request({protocolName:Ps,requestData:t(t({},e),{},{groupID:o,topicID:a})}).then((function(){if(n.hasLocalGroupMember(o,s)){var t=n.getLocalGroupMemberInfo(o,s);return at(e.muteTime)||t.updateMuteUntil(e.muteTime),at(e.role)||t.updateRole(e.role),at(e.nameCard)||t.updateNameCard(e.nameCard),at(e.memberCustomField)||t.updateMemberCustomField(e.memberCustomField),t}return n.getGroupMemberProfile({groupID:o,userIDList:[s]}).then((function(e){return v(e.data.memberList,1)[0]}))}))}},{key:"markGroupMemberList",value:function(e){var t=this,n="".concat(this._n,".").concat("markGroupMemberList"),o=e.groupID,s=e.markType,a=e.enableMark,r=e.userIDList,i=void 0===r?[]:r,u="groupID:".concat(o," markType:").concat(s," enableMark:").concat(a," userIDList count: ").concat(i.length);xe.l("".concat(n," ").concat(u));var c=2,l=[];!0===a&&(c=1);var p=m(i);i.length>500&&(p=i.slice(0,500),xe.w("".concat(n," ").concat(Kt(500)))),p.forEach((function(e){l.push({userID:e,markType:[s]})})),p=null;var d=new ka("markGroupMemberList");return d.setMessage("".concat(u)),this.request({protocolName:bs,requestData:{groupID:o,operationType:c,memberList:l}}).then((function(e){var o=e.data.memberList,s=void 0===o?[]:o,a=[],r=[];s.length===i.length?a.push.apply(a,m(i)):(s.forEach((function(e){a.push(e.userID)})),i.forEach((function(e){a.includes(e)||r.push(e)})));var u="success count:".concat(a.length," fail count:").concat(r.length);return d.setNetworkType(t.getNetworkType()).setMessage(u).end(),xe.l("".concat(n," ok. ").concat(u)),Ka({successUserIDList:a,failureUserIDList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];d.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_getGroupMemberProfileAdvance",value:function(e){return this.request({protocolName:Ns,requestData:t(t({},e),{},{memberInfoFilter:e.memberInfoFilter?e.memberInfoFilter:["Role","JoinTime","NameCard","ShutUpUntil"]})})}},{key:"_updateLocalGroupMemberMap",value:function(e,t){var n=this;return st(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new Fr(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:"deleteLocalGroupMembers",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:"getLocalGroupMemberInfo",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:"setLocalGroupMember",value:function(e,t){if(this.groupMemberListMap.has(e))this.groupMemberListMap.get(e).set(t.userID,t);else{var n=(new Map).set(t.userID,t);this.groupMemberListMap.set(e,n)}}},{key:"getLocalGroupMemberList",value:function(e){return this.groupMemberListMap.get(e)}},{key:"hasLocalGroupMember",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:"hasLocalGroupMemberMap",value:function(e){return this.groupMemberListMap.has(e)}},{key:"reset",value:function(){this.groupMemberListMap.clear()}}]),s}(ro),xr=["topicID","topicName","avatar","introduction","notification","unreadCount","muteAllMembers","customData","groupAtInfoList","nextMessageSeq","selfInfo"],Vr=function(e,t){return jt(e)?{lastTime:0,lastSequence:0,fromAccount:"",payload:null,type:"",messageForShow:"",nick:"",version:0,cloudCustomData:"",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||"",payload:e.payload||null,type:e.type||"",messageForShow:xt(e.type,e.payload,t),nick:e.nick||"",version:e.version||0,cloudCustomData:e.cloudCustomData||"",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}},Br=function(){function e(t,n){o(this,e),this.topicID="",this.topicName="",this.avatar="",this.introduction="",this.notification="",this.unreadCount=0,this.muteAllMembers=!1,this.customData="",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=Vr(t.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:"",excludedUnreadSequenceList:void 0},this._initTopic(t)}return a(e,[{key:"_initTopic",value:function(e){for(var t in e)xr.indexOf(t)<0||("selfInfo"===t?this.updateSelfInfo(e[t]):this[t]="muteAllMembers"===t?1===e[t]:e[t])}},{key:"updateUnreadCount",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.unreadCount=e}},{key:"updateNextMessageSeq",value:function(e){this.nextMessageSeq=e}},{key:"updateLastMessage",value:function(e){this.lastMessage=Vr(e)}},{key:"updateGroupAtInfoList",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:"updateTopic",value:function(e){at(e.selfInfo)||this.updateSelfInfo(e.selfInfo),at(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),pt(this,e,["groupID","lastMessageTime","selfInfo","muteAllMembers","lastMsg"])}},{key:"updateSelfInfo",value:function(e){return 0!==pt(this.selfInfo,e,[],[""])}},{key:"reduceUnreadCount",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:"isLastMessageRevoked",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:"setLastMessageRevoked",value:function(e){this.lastMessage.isRevoked=e}},{key:"setLastMessageRevoker",value:function(e){this.lastMessage.revoker=e}}]),e}(),Hr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="TopicModule",t._topicMap=new Map,t._getTopicTimeMap=new Map,t.TOPIC_CACHE_TIME=300,t.TOPIC_LAST_ACTIVE_TIME=3600,t.getInnerEmitterInstance().on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("topic_cache_time"),t=this.getCloudConfig("topic_last_active_time");at(e)||(this.TOPIC_CACHE_TIME=Number(e)),at(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:"onTopicCreated",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOuterEvent(E.TOPIC_CREATED,e)}},{key:"onTopicDeleted",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOuterEvent(E.TOPIC_DELETED,e)}},{key:"onTopicMessageRemindTypeUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=e.messageRemindType,s=this.getLocalTopic(t,n);if(s){var a=s.updateSelfInfo({messageRemindType:o});a&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:s}),xe.d("".concat(this._n,".onTopicMessageRemindTypeUpdated topicID:").concat(n)+" messageRemindType:".concat(o," isTopicUpdated:").concat(a))}}},{key:"onTopicProfileUpdated",value:function(e){var t=e.groupID,n=e.topicID,o=this.getLocalTopic(t,n);o&&(o.updateTopic(e),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:o}))}},{key:"onConversationProxy",value:function(e){var t=e.topicID,n=e.unreadCount,o=e.groupAtInfoList,s=qt(t),a=this.getLocalTopic(s,t),r=!1;a&&(at(n)||a.unreadCount===n||(a.updateUnreadCount(n),r=!0),at(o)||(a.updateGroupAtInfoList(o),r=!0)),r&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:s,topic:a})}},{key:"onMessageSent",value:function(e){var t=e.groupID,n=e.topicID,o=e.lastMessage,s=this.getLocalTopic(t,n);s&&(s.nextMessageSeq+=1,s.updateLastMessage(o),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:s}))}},{key:"onMessageModified",value:function(e){var t=e.to,n=e.time,o=e.sequence,s=e.elements,a=e.cloudCustomData,r=e.messageVersion,i=qt(t),u=this.getLocalTopic(i,t);if(u){var c=u.lastMessage;xe.d("".concat(this._n,".onMessageModified topicID:").concat(t," lastMessage:"),JSON.stringify(c),"options:",JSON.stringify(e)),c&&(null===c.payload||c.lastTime===n&&c.lastSequence===o&&c.version!==r)&&(c.type=s[0].type,c.payload=s[0].content,c.messageForShow=xt(c.type,c.payload,this.isIntl()),c.cloudCustomData=a,c.version=r,c.lastSequence=o,c.lastTime=n,this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:i,topic:u}))}}},{key:"onMessageRevoked",value:function(e){var t=this;if(0!==e.length){var n=null,o=null,s=!1;e.forEach((function(e){var a=e.to;o=qt(a),(n=t.getLocalTopic(o,a))&&(n.reduceUnreadCount()&&(s=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),s=!0))})),s&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:o,topic:n})}}},{key:"isLastMessageRevoked",value:function(e){var t=e.topicID,n=e.sequence,o=qt(t),s=this.getLocalTopic(o,t),a=!1;return s&&(a=s.isLastMessageRevoked({sequence:n})),a}},{key:"getJoinedCommunityList",value:function(){return this.getModule(Un).getGroupList({isGroupWithTopicOnly:!0}).then((function(e){var t=e.data.groupList;return Ka({groupList:void 0===t?[]:t})})).catch((function(e){return Ja(e)}))}},{key:"createTopicInCommunity",value:function(e){var n=this,o="".concat(this._n,".").concat("createTopicInCommunity"),s=e.topicID;if(!at(s)&&!Dt(s))return Ja({code:da.ILLEGAL_TOPIC_ID});if(e.topicName&&!1===this._filterProfanity("topicName",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Ja({code:da.PROFANITY_FOUND});var a=new ka("createTopicInCommunity");return this.request({protocolName:$s,requestData:t({},e)}).then((function(s){var r=s.data.topicID;return a.setMessage("topicID:".concat(r)).setNetworkType(n.getNetworkType()).end(),xe.l("".concat(o," ok")),n._updateTopicMap([t(t({},e),{},{topicID:r})]),Ka({topicID:r})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"deleteTopicFromCommunity",value:function(e){var t=this,n="".concat(this._n,".").concat("deleteTopicFromCommunity"),o=e.groupID,s=e.topicIDList,a=void 0===s?[]:s,r=new ka("deleteTopicFromCommunity");return r.setMessage("groupID:".concat(o," topicIDList:").concat(a)),this.request({protocolName:ea,requestData:{groupID:o,topicIDList:a}}).then((function(e){var n=e.data.resultList,s=[],a=[];(void 0===n?[]:n).forEach((function(e){var t=e.topicID,n=e.errorCode,o=e.errorInfo;0===n?s.push({topicID:t}):a.push({topicID:t,code:n,message:o})}));var i="success count:".concat(s.length,", fail count:").concat(a.length);return r.setMoreMessage("".concat(i)).setNetworkType(t.getNetworkType()).end(),xe.l("".concat(i)),s.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),Ka({successTopicList:s,failureTopicList:a})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"updateTopicProfile",value:function(e){var n=this,o="".concat(this._n,".").concat("updateTopicProfile");if(xe.l("".concat(o," options:"),e),e.topicName&&!1===this._filterProfanity("topicName",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity("introduction",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity("notification",e))return Ja({code:da.PROFANITY_FOUND});var s=new ka("updateTopicProfile");return s.setMessage("groupID:".concat(e.groupID," topicID:").concat(e.topicID)),at(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?"On":"Off"),this.request({protocolName:ta,requestData:t({},e)}).then((function(){return s.setNetworkType(n.getNetworkType()).end(),xe.l("".concat(o," ok")),n._updateTopicMap([e]),Ka({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"getTopicList",value:function(e){var n=this,o="".concat(this._n,".").concat("getTopicList"),s=e.groupID,a=e.topicIDList,r=void 0===a?[]:a,i=0===r.length,u=new ka("getTopicList");if(u.setMessage("groupID:".concat(s)),this._getTopicTimeMap.has(s)){var c=this._getTopicTimeMap.get(s),l=c.isGetAll,p=c.time;if((l||!l&&!i)&&Date.now()-p<1e3*this.TOPIC_CACHE_TIME){var d=this._getLocalTopicList(s,r);if(i||d.length===r.length)return u.setNetworkType(this.getNetworkType()).setMoreMessage("from cache, topic count:".concat(d.length)).end(),xe.l("".concat(o," groupID:").concat(s," from cache, topic count:").concat(d.length)),za({successTopicList:d,failureTopicList:[]})}}return this.request({protocolName:na,requestData:{groupID:s,topicIDList:r}}).then((function(e){var a=e.data.topicInfoList,r=[],c=[],l=[];(void 0===a?[]:a).forEach((function(e){var n=e.topic,o=e.selfInfo,s=e.errorCode,a=e.errorInfo,i=n.topicID;0===s?(r.push(t(t({},n),{},{selfInfo:o})),c.push(i)):l.push({topicID:i,code:s,message:a})})),n._updateTopicMap(r),n._handleTopicAtInfo(r);var p="success count:".concat(c.length,", fail count:").concat(l.length);u.setNetworkType(n.getNetworkType()).setMoreMessage("".concat(p)).end(),xe.l("".concat(o," groupID:").concat(s," from remote, ").concat(p));var d=[];return jt(c)||(n._getTopicTimeMap.set(s,{time:Date.now(),isGetAll:i}),d=n._getLocalTopicList(s,c)),Ka({successTopicList:d,failureTopicList:l})})).catch((function(e){return n.probeNetwork(e).then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"hasLocalTopic",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:"getLocalTopic",value:function(e,t){var n=null;return this._topicMap.has(e)&&(n=this._topicMap.get(e).get(t)),n}},{key:"_getLocalTopicList",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._topicMap.get(e),o=[];return n&&(o=m(n.values())),0===t.length?o:o.filter((function(e){return t.includes(e.topicID)}))}},{key:"_deleteLocalTopic",value:function(e,t){this._topicMap.has(e)&&(this._topicMap.get(e).delete(t),xe.l("".concat(this._n,"._deleteLocalTopic groupID:").concat(e," topicID:").concat(t)))}},{key:"_updateTopicMap",value:function(e){var t=this,n=[];(e.forEach((function(e){var o=e.groupID,s=e.topicID,a=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(s)?(a=t._topicMap.get(o).get(s)).updateTopic(e):(t._getTopicLastMessage(e),a=new Br(e,t.isIntl()),t._topicMap.get(o).set(s,a));var r=t._computeUnreadCount(a);a.updateUnreadCount(r),n.push({conversationID:"".concat(S.CONV_GROUP).concat(s),type:S.CONV_TOPIC,unreadCount:r})})),n.length>0)&&this.getModule(Fn).updateTopicConversation(n)}},{key:"resetGetTopicTime",value:function(e){var t=this;at(e)?m(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:"getTopicListOnReconnected",value:function(){var e=this,t=m(this._topicMap.keys()),n=[];t.forEach((function(t){var o=[];e._getLocalTopicList(t).forEach((function(t){var n=t.lastMessage.lastTime,s=void 0===n?0:n;Date.now()-1e3*s<1e3*e.TOPIC_LAST_ACTIVE_TIME&&o.push(t.topicID)})),o.length>0&&n.push({groupID:t,topicIDList:o})})),xe.l("".concat(this._n,".getTopicListOnReconnected. active community count:").concat(n.length)),this._relayGetTopicList(n)}},{key:"_relayGetTopicList",value:function(e){var t=this;if(0!==e.length){var n=e.shift(),o=n.topicIDList.length>5?"topicIDList.length:".concat(n.topicIDList.length):"topicIDList:".concat(n.topicIDList),s=new ka("relayGetTopicList");s.setMessage(o),xe.l("".concat(this._n,"._relayGetTopicList. ").concat(o)),this.getTopicList(n).then((function(){s.setNetworkType(t.getNetworkType()).end(),t._relayGetTopicList(e)})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),o=t[0],a=t[1];s.setError(n,o,a).end()})),t._relayGetTopicList(e)}))}}},{key:"_handleTopicAtInfo",value:function(e){var n=this;0!==e.length&&e.forEach((function(e){var o=e.groupID,s=e.topicID,a=e.groupAtInfoList,r=[];at(a)||(a.forEach((function(e){r.push(t(t({},e),{},{groupID:o,topicID:s}))})),n.getModule(Fn).onNewGroupAtTips({dataList:r}))}))}},{key:"_getTopicLastMessage",value:function(e){if(!at(e.lastMsg)){var t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:"",nick:e.lastMsg.nick,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:2===e.lastMsg.isPlaceMessage,revoker:jt(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker};e.lastMessage=t}}},{key:"deleteTopicListInCommunity",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.getModule(Fn);n.forEach((function(n){var s=n.topicID;t._deleteLocalTopic(e,s),t._getTopicTimeMap.delete(e),o.deleteLocalConversation("".concat(S.CONV_GROUP).concat(s))}))}},{key:"_computeUnreadCount",value:function(e){var t=e.selfInfo,n=t.excludedUnreadSequenceList,o=t.readedSequence,s=e.nextMessageSeq-e.selfInfo.readedSequence-1;if(st(n)){var a=0;n.forEach((function(t){t>=o&&t<=e.nextMessageSeq-1&&(a+=1)})),a>=1&&(s-=a)}return s<0?0:s}},{key:"_filterProfanity",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],z),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"updateLastMessage",value:function(e,t){var n=qt(e),o=this.getLocalTopic(n,e);if(o){var s=t.sequence+1;o.updateNextMessageSeq(s),o.updateLastMessage(t),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:n,topic:o})}}},{key:"getMessageExtensions",value:function(e,t){xe.l("".concat(this._n,".getMessageExtensions startSequence:").concat(t));var n=qt(e.to);return this.request({protocolName:Es,requestData:{groupID:n,topicID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:"modifyMessageExtensions",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;xe.l("".concat(this._n,".modifyMessageExtensions operateType:").concat(n));var o=qt(e.to);return this.request({protocolName:Ds,requestData:{groupID:o,topicID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),s}(ro),Kr=function(){function e(t){o(this,e),this._userModule=t,this._n="ProfileHandler",this.TAG="profile",this.accountProfileMap=new Map,this.expirationTime=864e5}return a(e,[{key:"setExpirationTime",value:function(e){this.expirationTime=e}},{key:"getUserProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("getUserProfile"),o=e.userIDList;e.fromAccount=this._userModule.getMyAccount(),o.length>100&&(xe.w("".concat(n," ").concat(Kt(100))),o.length=100);for(var s,a=[],r=[],i=0,u=o.length;i5?"userIDList.length:".concat(o.length):"userIDList:".concat(o)),this._userModule.request({protocolName:fo,requestData:e}).then((function(e){p.setNetworkType(t._userModule.getNetworkType()).end(),xe.i("".concat(n," ok"));var o=t._handleResponse(e).concat(r);return Ka(c?o[0]:o)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];p.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"getMyProfile",value:function(){var e=this._userModule.getMyAccount(),t="".concat(this._n,".getMyProfile");if(xe.l("".concat(t," myAccount:").concat(e)),this._fill(),this._contains(e)){var n=this._getProfileFromMap(e);return xe.d("".concat(t," from cache, myProfile:").concat(JSON.stringify(n))),za(n)}return this.getUserProfile({fromAccount:e,userIDList:[e],bFromGetMyProfile:!0})}},{key:"_handleResponse",value:function(e){var t=e.data.userProfileItem;if(!st(t))return[];for(var n=[],o=Date.now(),s=0,a=t.length;s-1)n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case Be.NICK:n.nick=t[o].value;break;case Be.GENDER:n.gender=t[o].value;break;case Be.BIRTHDAY:n.birthday=t[o].value;break;case Be.LOCATION:n.location=t[o].value;break;case Be.SELFSIGNATURE:n.selfSignature=t[o].value;break;case Be.ALLOWTYPE:n.allowType=t[o].value;break;case Be.LANGUAGE:n.language=t[o].value;break;case Be.AVATAR:n.avatar=t[o].value;break;case Be.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case Be.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case Be.LEVEL:n.level=t[o].value;break;case Be.ROLE:n.role=t[o].value;break;default:xe.w("".concat(this._n,"._getLatestProfileFromResponse unknown tag:"),t[o].tag,t[o].value)}return n}},{key:"updateMyProfile",value:function(e){var t=this,n="".concat(this._n,".").concat("updateMyProfile");if(e.nick&&!1===this._userModule.filterProfanity("nick",e))return Ja({code:da.PROFANITY_FOUND});if(e.selfSignature&&!1===this._userModule.filterProfanity("selfSignature",e))return Ja({code:da.PROFANITY_FOUND});var o=new ka("updateMyProfile");o.setMessage(JSON.stringify(e));var s=(new ur).validate(e);if(!s.valid)return o.setCode(da.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage("info:".concat(s.tips)).setNetworkType(this._userModule.getNetworkType()).end(),xe.e("".concat(n," info:").concat(s.tips)),Ja({code:da.UPDATE_PROFILE_INVALID_PARAM});var a=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&("profileCustomField"===r?e.profileCustomField.forEach((function(e){a.push({tag:e.key,value:e.value})})):a.push({tag:Be[r.toUpperCase()],value:e[r]}));if(0===a.length){var i=new Wa({code:da.UPDATE_PROFILE_NO_KEY});return o.setError(i,!0,this._userModule.getNetworkType()).end(),xe.e("".concat(n," failed. error:"),i),Ja(i)}var u=this._userModule.getMyAccount();return this._userModule.request({protocolName:vo,requestData:{fromAccount:u,profileItem:a}}).then((function(s){o.setNetworkType(t._userModule.getNetworkType()).end(),xe.i("".concat(n," ok"));var a=t._update(u,e),r=a.isProfileUpdated,i=a.latestProfile;return!0===r&&t._userModule.emitOuterEvent(E.PROFILE_UPDATED,[i]),za(i)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"onProfileModified",value:function(e){var t=e.dataList;if(!jt(t)){var n,o=t.length;xe.d("".concat(this._n,".onProfileModified count:").concat(o," dataList:"),e.dataList);for(var s=[],a=0;a0&&(this._userModule.emitInnerEvent(er,s),this._userModule.emitOuterEvent(E.PROFILE_UPDATED,s))}}},{key:"_fill",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n0&&(n.lastUpdatedTime=s,o=!0)):(n=new ur(t),(this._userModule.isMyFriend(e)||e===this._userModule.getMyAccount())&&(n.lastUpdatedTime=s,o=!0,this.accountProfileMap.set(e,n)));return this._flush(e===this._userModule.getMyAccount()),xe.l("".concat(this._n,"._update account:").concat(e," isProfileUpdated:").concat(o)),{isProfileUpdated:o,latestProfile:n}}},{key:"_flush",value:function(e){var t=m(this.accountProfileMap.values()),n=this._userModule.getStorageModule();xe.d("".concat(this._n,"._flush length:").concat(t.length," flushAtOnce:").concat(e)),n.setItem(this.TAG,t,e)}},{key:"_contains",value:function(e){return this.accountProfileMap.has(e)}},{key:"_getProfileFromMap",value:function(e){return this.accountProfileMap.get(e)}},{key:"_getCachedProfiles",value:function(){var e=this._userModule.getStorageModule().getItem(this.TAG);return jt(e)?[]:e}},{key:"onConversationsProfileUpdated",value:function(e){for(var t,n,o,s=[],a=0,r=e.length;a0&&s.push(n)):s.push(t.userID));0!==s.length&&(xe.i("".concat(this._n,".onConversationsProfileUpdated toAccountList:").concat(s)),this.getUserProfile({userIDList:s}))}},{key:"getNickAndAvatarByUserID",value:function(e){if(this._contains(e)){var t=this._getProfileFromMap(e);return{nick:t.nick,avatar:t.avatar}}return{nick:"",avatar:""}}},{key:"reset",value:function(){this._flush(!0),this.accountProfileMap.clear()}}]),e}(),Wr=a((function e(t){o(this,e),jt||(this.userID=t.userID||"",this.timeStamp=t.timeStamp||0)})),Yr=function(){function e(t){o(this,e),this._userModule=t,this._n="BlacklistHandler",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}return a(e,[{key:"getLocalBlacklist",value:function(){return m(this._blacklistMap.keys())}},{key:"getBlacklist",value:function(){var e=this,t="".concat(this._n,".getBlacklist"),n={fromAccount:this._userModule.getMyAccount(),maxLimited:this.maxLimited,startIndex:0,lastSequence:this.currentSequence},o=new ka("getBlacklist");return this._userModule.request({protocolName:mo,requestData:n}).then((function(n){var s=n.data,a=s.blackListItem,r=s.currentSequence,i=jt(a)?0:a.length;o.setNetworkType(e._userModule.getNetworkType()).setMessage("count:".concat(i)).end(),xe.i("".concat(t," ok")),e.currentSequence=r,e._handleResponse(a,!0),e._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(e._blacklistMap.keys()))})).catch((function(n){return e._userModule.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];o.setError(n,s,a).end()})),xe.e("".concat(t," failed. error:"),n),Ja(n)}))}},{key:"addBlacklist",value:function(e){var t=this,n=new ka("addToBlacklist"),o="".concat(this._n,".addBlacklist"),s=this._userModule.getMyAccount();if(1===e.userIDList.length&&e.userIDList[0]===s){var a=da.CANNOT_ADD_SELF_TO_BLACKLIST,r=this._userModule.getErrorMessage(a);n.setCode(a).setMessage(r).setNetworkType(this._userModule.getNetworkType()).end();var i=new Wa({code:a});return xe.e("".concat(o," failed. error:"),i),Ja(i)}return e.userIDList.includes(s)&&(e.userIDList=e.userIDList.filter((function(e){return e!==s}))),e.fromAccount=this._userModule.getMyAccount(),e.toAccount=e.userIDList,this._userModule.request({protocolName:Mo,requestData:e}).then((function(s){return n.setNetworkType(t._userModule.getNetworkType()).setMessage(e.userIDList.length>5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),xe.i("".concat(o," ok")),t._handleResponse(s.resultItem,!0),Ka(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var o=v(t,2),s=o[0],a=o[1];n.setError(e,s,a).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"_handleResponse",value:function(e,t){if(!jt(e))for(var n,o,s,a=0,r=e.length;a5?"userIDList.length:".concat(e.userIDList.length):"userIDList:".concat(e.userIDList)).end(),xe.i("".concat(n," ok")),t._handleResponse(s.data.resultItem,!1),Ka(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"onAccountDeleted",value:function(e){for(var t,n=[],o=0,s=e.length;o0&&(xe.l("".concat(this._n,".onAccountDeleted count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:"onAccountAdded",value:function(e){for(var t,n=[],o=0,s=e.length;o0&&(xe.l("".concat(this._n,".onAccountAdded count:").concat(n.length," userIDList:"),n),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:"reset",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),jr=function(e){var t=String(e).replace(/[=]+$/,""),n="";if(t.length%4==1)return"";for(var o,s,a=0,r=0;s=t.charAt(r++);~s&&(o=a%4?64*o+s:s,a++%4)?n+=String.fromCharCode(255&o>>(-2*a&6)):0)s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(s);try{return decodeURIComponent(escape(n))}catch(i){return""}},zr=function(){function e(t){o(this,e),this._userModule=t,this._n="UserStatusHandler",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on($a,this._onCloudConfigUpdated,this)}return a(e,[{key:"_onCloudConfigUpdated",value:function(){var e=this._userModule.getCloudConfig("status_query_count"),t=this._userModule.getCloudConfig("status_sub_count"),n=this._userModule.getCloudConfig("status_unsub_count");xe.l("".concat(this._n,"._onCloudConfigUpdated statusQueryCount:").concat(e," statusSubscribeCount:").concat(t)+" statusUnsubscribeCount:".concat(n)),at(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),at(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),at(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:"onUserStatusUpdated",value:function(e){var t=e.dataList,n=this._userModule.getMyUserID(),o=this._userModule.getModule(qn),s=t.map((function(e){var t=e.to,s=e.statusType,a=e.customStatus,r=jr(a);return t===n&&o.setCustomStatus(r),{userID:t,statusType:s,customStatus:r}}));this._userModule.emitOuterEvent(E.USER_STATUS_UPDATED,s)}},{key:"setSelfStatus",value:function(e){var t=this,n="".concat(this._n,".setSelfStatus");if(!1===this._userModule.filterProfanity("customStatus",e))return Ja({code:da.PROFANITY_FOUND});var o=new ka("setSelfStatus"),s=e.customStatus;return this._userModule.request({protocolName:oa,requestData:{customStatus:s}}).then((function(e){return o.setNetworkType(t._userModule.getNetworkType()).setMessage("customStatus:".concat(s)).end(),xe.l("".concat(n," ok. customStatus:").concat(s)),t._userModule.getModule(qn).setCustomStatus(s),Ka({userID:t._userModule.getMyUserID(),statusType:1,customStatus:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"getUserStatus",value:function(e){var t=this,n="".concat(this._n,".getUserStatus"),o=e.userIDList,s=void 0===o?[]:o,a=this._userModule.getMyUserID(),r=m(s),i=void 0,u=r.indexOf(a);if(u>-1){r.splice(u,1);var c=this._userModule.getModule(qn).getCustomStatus();i={userID:a,statusType:1,customStatus:c}}if(0===r.length)return za({successUserList:[i],failureUserList:[]});if(!this._userModule.canIUse(B.USER_STATUS))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});r.length>this.MAX_QUERY_USER_COUNT&&(xe.w("".concat(n," ").concat(Kt(this.MAX_QUERY_USER_COUNT))),r=s.slice(0,this.MAX_QUERY_USER_COUNT));var l=new ka("getUserStatus");return this._userModule.request({protocolName:sa,requestData:{userIDList:r}}).then((function(e){var o=e.data,a=o.successUserList,r=void 0===a?[]:a,u=o.failureUserList,c=void 0===u?[]:u,p=r.map((function(e){var t=e.userID,n=e.statusType,o=e.customStatus;return{userID:t,statusType:n,customStatus:jr(o)}})),d=c.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:jt(n)?t:n,code:o,message:s}}));at(i)||p.unshift(i);var g="userID count:".concat(s.length,", success count:").concat(p.length,", fail count:").concat(d.length);return l.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(g)).end(),xe.l("".concat(n," ok. ").concat(g,".")),Ka({successUserList:p,failureUserList:d})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setMessage("userID count:".concat(s.length)).setError(e,o,a).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"subscribeUserStatus",value:function(e){var t=this;if(!this._userModule.canIUse(B.USER_STATUS))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".subscribeUserStatus"),o=e.userIDList,s=void 0===o?[]:o,a=m(s);a.length>this.MAX_SUBSCRIBE_USER_COUNT&&(xe.w("".concat(n," ").concat(Kt(this.MAX_SUBSCRIBE_USER_COUNT))),a=s.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var r=new ka("subscribeUserStatus"),i="userID count:".concat(s.length);return xe.l("".concat(n," ").concat(i)),this._userModule.request({protocolName:aa,requestData:{userIDList:a}}).then((function(e){var o=e.data.failureUserList,s=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:jt(n)?t:n,code:o,message:s}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(i," fail count:").concat(s.length)).end(),xe.l("".concat(n," ok. fail count:").concat(s.length,".")),Ka({failureUserList:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setMessage("".concat(i)).setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"unsubscribeUserStatus",value:function(e){var t=this;if(!this._userModule.canIUse(B.USER_STATUS))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".unsubscribeUserStatus"),o=(e||{}).userIDList,s=void 0===o?[]:o,a=m(s);s.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(xe.w("".concat(n," ").concat(Kt(this.MAX_UNSUBSCRIBE_USER_COUNT))),a=s.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var r=new ka("unsubscribeUserStatus"),i="userID count:".concat(s.length);xe.l("".concat(n," ").concat(i));var u={userIDList:a};return 0===a.length&&(u.userIDList=void 0,u.unsubscribeAll=1),this._userModule.request({protocolName:ra,requestData:u}).then((function(e){var o=e.data.failureUserList,s=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:jt(n)?t:n,code:o,message:s}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage("".concat(i," fail count:").concat(s.length)).end(),xe.l("".concat(n," ok. fail count:").concat(s.length,".")),Ka({failureUserList:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setMessage("".concat(i)).setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"reset",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),e}(),Jr=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="UserModule",s._profileHandler=new Kr(_(s)),s._blacklistHandler=new Yr(_(s)),s._userStatusHandler=new zr(_(s)),s.getInnerEmitterInstance().on(Za,s.onContextUpdated,_(s)),s}return a(n,[{key:"onContextUpdated",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:"onProfileModified",value:function(e){this._profileHandler.onProfileModified(e)}},{key:"onRelationChainModified",value:function(e){var t=e.dataList;if(!jt(t)){var n=[];t.forEach((function(e){e.blackListDelAccount&&n.push.apply(n,m(e.blackListDelAccount))})),n.length>0&&this._blacklistHandler.onAccountDeleted(n);var o=[];t.forEach((function(e){e.blackListAddAccount&&o.push.apply(o,m(e.blackListAddAccount))})),o.length>0&&this._blacklistHandler.onAccountAdded(o)}}},{key:"onConversationsProfileUpdated",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{key:"getMyAccount",value:function(){return this.getMyUserID()}},{key:"getMyProfile",value:function(){return this._profileHandler.getMyProfile()}},{key:"getStorageModule",value:function(){return this.getModule(xn)}},{key:"filterProfanity",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],j),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:"isMyFriend",value:function(e){var t=this.getModule(Pn);return!!t&&t.isMyFriend(e)}},{key:"getUserProfile",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:"getNickAndAvatarByUserID",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:"getLocalBlacklist",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return za(e)}},{key:"addBlacklist",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:"deleteBlacklist",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:"onUserStatusUpdated",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:"setSelfStatus",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),n}(ro),Xr=function(){function e(t,n){o(this,e),this._m=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||"",this._userSig=n.userSig||"",this._version="2.27.5",this._a2Key="",this._tinyID="",this._customStatus="",this._contentType="json",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||"",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy}return a(e,[{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:"isSingaporeSite",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7||this._SDKAppID>=172e7&&this._SDKAppID<173e7}},{key:"isKoreaSite",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7||this._SDKAppID>=173e7&&this._SDKAppID<174e7}},{key:"isGermanySite",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7||this._SDKAppID>=174e7&&this._SDKAppID<175e7}},{key:"isIndiaSite",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7||this._SDKAppID>=175e7&&this._SDKAppID<176e7}},{key:"isJapanSite",value:function(){return this._SDKAppID>=6e7&&this._SDKAppID<7e7||this._SDKAppID>=176e7&&this._SDKAppID<177e7}},{key:"isUSASite",value:function(){return this._SDKAppID>=7e7&&this._SDKAppID<8e7||this._SDKAppID>=177e7&&this._SDKAppID<178e7}},{key:"isIntl",value:function(){return 0===(e=this._SDKAppID)||e>=2e7&&e<8e7||e>=172e7&&e<178e7;var e}},{key:"isUnlimitedAVChatRoom",value:function(){return this._unlimitedAVChatRoom}},{key:"setUserID",value:function(e){this._userID=e}},{key:"getUserID",value:function(){return this._userID}},{key:"setUserSig",value:function(e){this._userSig=e}},{key:"getUserSig",value:function(){return this._userSig}},{key:"getSDKAppID",value:function(){return this._SDKAppID}},{key:"setTinyID",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:"getTinyID",value:function(){return this._tinyID}},{key:"setCustomStatus",value:function(e){this._customStatus=e}},{key:"getCustomStatus",value:function(){return this._customStatus}},{key:"getScene",value:function(){return Le?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(e){this._statusInstanceID=e}},{key:"getVersion",value:function(){return this._version}},{key:"getA2Key",value:function(){return this._a2Key}},{key:"setA2Key",value:function(e){this._a2Key=e}},{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:"_isTUIKit",value:function(){var e=!1,t=!1,n=!1,o=!1,s=[];se&&(s=Object.keys(re)),ae&&(s=oe?Object.keys(uni):Object.keys(window));for(var a=0,r=s.length;a0){for(var c=0,l=u.length;c0&&void 0!==arguments[0]?arguments[0]:0;if(!this.isLoggedIn())return Ja({code:da.USER_NOT_LOGGED_IN});var n=new ka("logout");n.setNetworkType(this.getNetworkType()).setMessage("identifier:".concat(this.getMyUserID())).end(!0);var o="".concat(this._n,".logout");return xe.i("".concat(o," type:").concat(t)),0===t&&this._m.setNotReadyReason(da.LOGGED_OUT),this.request({protocolName:uo,requestData:{type:t}}).then((function(){return e.resetReady(),za({})})).catch((function(t){return xe.e("".concat(o," error:"),t),e.resetReady(),za({})}))}},{key:"_fetchCloudControlConfig",value:function(){this.getModule(Xn).fetchConfig()}},{key:"_getStatusInstanceID",value:function(){return uni.getStorageSync("timUniAppInstanceID")}},{key:"_hello",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:co,requestData:{isWebUniapp:this._isWebUniapp}}).catch((function(t){xe.w("".concat(e._n,"._hello error:"),t)}))}},{key:"getLastWsHelloTs",value:function(){return this._lastWsHelloTs}},{key:"_checkLoginInfo",value:function(e){var t=0;return jt(this.getModule(qn).getSDKAppID())?t=da.NO_SDKAPPID:jt(e.userID)?t=da.NO_IDENTIFIER:jt(e.userSig)&&(t=da.NO_USERSIG),{code:t}}},{key:"_isReactUIKit",value:function(){return ae&&void 0!==window.tencent_cloud_im_csig_react_uikit_23F_xa}},{key:"onMultipleAccountKickedOut",value:function(e){var t=this;new ka("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_MULT_ACCOUNT," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),xe.w("".concat(this._n,".onMultipleAccountKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_ACCOUNT}),t._m.setNotReadyReason(da.KICKED_OUT_MULT_ACCOUNT),t._m.reset()}))}},{key:"onMultipleDeviceKickedOut",value:function(e){var t=this;new ka("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_MULT_DEVICE," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),xe.w("".concat(this._n,".onMultipleDeviceKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_DEVICE}),t._m.setNotReadyReason(da.KICKED_OUT_MULT_DEVICE),t._m.reset()}))}},{key:"onUserSigExpired",value:function(){new ka("kickedOut").setNetworkType(this.getNetworkType()).setMessage(S.KICKED_OUT_USERSIG_EXPIRED).end(!0),xe.w("".concat(this._n,".onUserSigExpired: userSig expired")),0!==this.getModule(qn).getStatusInstanceID()&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(da.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:"onRestApiKickedOut",value:function(e){(new ka("kickedOut").setNetworkType(this.getNetworkType()).setMessage("type:".concat(S.KICKED_OUT_REST_API," newInstanceInfo:").concat(JSON.stringify(e))).end(!0),xe.w("".concat(this._n,".onRestApiKickedOut userID:").concat(this.getMyUserID()," newInstanceInfo:"),e),0!==this.getModule(qn).getStatusInstanceID())&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_REST_API}),this._m.setNotReadyReason(da.KICKED_OUT_REST_API),this._m.reset(),this.getModule(zn).onRestApiKickedOut())}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),n}(ro);function Zr(){return null}var $r=function(){function e(t){o(this,e),this._m=t,this._n="StorageModule",this._storageQueue=new Map,this._errorTolerantHandle()}return a(e,[{key:"_errorTolerantHandle",value:function(){se||!at(window)&&this._canIUseCookies()||(this.getItem=Zr,this.setItem=Zr,this.removeItem=Zr,this.clear=Zr)}},{key:"onCheckTimer",value:function(e){if(e%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{key:"_doFlush",value:function(){try{var e,t=D(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];this._setStorageSync(this._getKey(o),s)}}catch(a){t.e(a)}finally{t.f()}this._storageQueue.clear()}catch(r){xe.w("".concat(this._n,"._doFlush error:"),r)}}},{key:"_getPrefix",value:function(){var e=this._m.getModule(qn);return"TIM_".concat(e.getSDKAppID(),"_").concat(e.getUserID(),"_")}},{key:"_getKey",value:function(e){return"".concat(this._getPrefix()).concat(e)}},{key:"getItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(o){return xe.w("".concat(this._n,".getItem error:"),o),{}}}},{key:"setItem",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n){var s=o?this._getKey(e):e;this._setStorageSync(s,t)}else this._storageQueue.set(e,t)}},{key:"clear",value:function(){try{se?re.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){xe.w("".concat(this._n,".clear error:"),e)}}},{key:"removeItem",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(o){xe.w("".concat(this._n,".removeItem error:"),o)}}},{key:"getSize",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"b";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,"leftSize",{enumerable:!0,get:function(){return o.limitSize-o.size}}),se&&(o.limitSize=1024*re.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(se){var s=re.getStorageInfoSync(),a=s.keys;a.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}))}else if(this._canIUseCookies())for(var r in localStorage)localStorage.hasOwnProperty(r)&&(o.size+=localStorage.getItem(r).length+r.length);return this._convertUnit(o)}catch(i){xe.w("".concat(this._n," error:"),i)}}},{key:"_convertUnit",value:function(e){var t={},n=e.unit;for(var o in t.unit=n,e)"number"==typeof e[o]&&("kb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024):"mb"===n.toLowerCase()?t[o]=Math.round(e[o]/1024/1024):t[o]=e[o]);return t}},{key:"_setStorageSync",value:function(e,t){se?ee?my.setStorageSync({key:e,data:t}):re.setStorageSync(e,t):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(t))}},{key:"getStorageSync",value:function(e){return se?ee?my.getStorageSync({key:e}).data:re.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:"_removeStorageSync",value:function(e){se?ee?my.removeStorageSync({key:e}):re.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:"_canIUseCookies",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._doFlush()}}]),e}(),ei=function(){function e(t){o(this,e),this._n="SSOLogBody",this._report=[]}return a(e,[{key:"pushIn",value:function(e){xe.d("".concat(this._n,".pushIn"),this._report.length,e),this._report.push(e)}},{key:"backfill",value:function(e){var t;st(e)&&0!==e.length&&(xe.d("".concat(this._n,".backfill"),this._report.length,e.length),(t=this._report).unshift.apply(t,m(e)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getLogsInMemory",value:function(){var e=this._report.slice();return this._reset(),e}}]),e}(),ti=function(e){var t=e.getModule(qn);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:Ue()}},ni=function(e){i(s,e);var n=f(s);function s(e){var t;o(this,s),(t=n.call(this,e))._n="EventStatModule",t.TAG="im-ssolog-event",t._reportBody=new ei,t.MIN_THRESHOLD=20,t.MAX_THRESHOLD=100,t.WAITING_TIME=6e4,t.REPORT_LEVEL=[4,5,6],t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._lastReportTime=Date.now();var a=t.getInnerEmitterInstance();return a.on(Za,t._onLoginSuccess,_(t)),a.on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:"reportAtOnce",value:function(){xe.d("".concat(this._n,".reportAtOnce")),this._report()}},{key:"_onLoginSuccess",value:function(){var e=this,t=this.getModule(xn),n=t.getItem(this.TAG,!1);!jt(n)&&it(n.forEach)&&(xe.l("".concat(this._n,"._onLoginSuccess get ssolog in storage, count:").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("evt_rpt_threshold"),t=this.getCloudConfig("evt_rpt_waiting"),n=this.getCloudConfig("evt_rpt_level"),o=this.getCloudConfig("evt_rpt_sdkappid_bl"),s=this.getCloudConfig("evt_rpt_tinyid_wl");at(e)||(this.MIN_THRESHOLD=Number(e)),at(t)||(this.WAITING_TIME=Number(t)),at(n)||(this.REPORT_LEVEL=n.split(",").map((function(e){return Number(e)}))),at(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(",").map((function(e){return Number(e)}))),at(s)||(this.REPORT_TINYID_WHITELIST=s.split(","))}},{key:"pushIn",value:function(e){e instanceof ka&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:"onCheckTimer",value:function(){Date.now()e.MAX_THRESHOLD&&e._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{key:"_flushAtOnce",value:function(){var e=this.getModule(xn),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o="".concat(this._n,"._flushAtOnce");if(jt(t))xe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var s=n.concat(t);s.length>this.MAX_THRESHOLD&&(s=s.slice(0,this.MAX_THRESHOLD)),xe.l("".concat(o," count:").concat(s.length)),e.setItem(this.TAG,s,!0,!1)}}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),s}(ro),oi="none",si="online",ai=[da.OVER_FREQUENCY_LIMIT,da.OPEN_SERVICE_OVERLOAD_ERROR],ri=function(){function e(t){o(this,e),this._m=t,this._networkType="",this._n="NetMonitorModule",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return a(e,[{key:"start",value:function(){var e=this;se?(re.getNetworkType({success:function(t){e._networkType=t.networkType||t.subtype||"",t.networkType===oi?xe.w("".concat(e._n,".start no network, please check!")):xe.i("".concat(e._n,".start networkType:").concat(t.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),re.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=si,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener("online",this._webOnlineCallback),window.addEventListener("offline",this._webOfflineCallback)))}},{key:"_onWebOnline",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:si})}},{key:"_onWebOffline",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:oi})}},{key:"_onNetworkStatusChange",value:function(e){var t=e.isConnected,n=e.networkType,o="".concat(this._n,"._onNetworkStatusChange"),s=!1;t?(xe.i("".concat(o," previous:").concat(this._networkType," current:").concat(n)),this._networkType!==n&&(s=!0,this._m.getModule(zn).reConnect(!0))):this._networkType!==n&&(s=!0,xe.w("".concat(o," no network, please check!")),this._m.getModule(zn).offline());s&&(new ka("networkChange").setMessage("isConnected:".concat(t," previousNetworkType:").concat(this._networkType," networkType:").concat(n)).end(),this._networkType=n)}},{key:"probe",value:function(e){var t=this;if(!at(e)&&ai.includes(e.code))return Promise.resolve([!0,this._networkType]);var n="".concat(this._n,".probe");return new Promise((function(e,o){se?re.getNetworkType({success:function(o){t._networkType=o.networkType,o.networkType===oi?(xe.w("".concat(n," no network, please check!")),e([!1,o.networkType])):(xe.i("".concat(n," networkType:").concat(o.networkType)),e([!0,o.networkType]))}}):t._networkType===oi?e([!1,oi]):e([!0,si])}))}},{key:"getNetworkType",value:function(){return this._networkType}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),se?null!==this._mpNetworkStatusCallback&&(re.offNetworkStatusChange&&(ne||Z?re.offNetworkStatusChange(this._mpNetworkStatusCallback):re.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(null!==this._webOnlineCallback&&(window.removeEventListener("online",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener("offline",this._webOfflineCallback),this._webOfflineCallback=null))}}]),e}();var ii=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=Object.prototype.hasOwnProperty,n="~";function o(){}function s(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,o,a,r){if("function"!=typeof o)throw new TypeError("The listener must be a function");var i=new s(o,a||e,r),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],i]:e._events[u].push(i):(e._events[u]=i,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function i(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),i.prototype.eventNames=function(){var e,o,s=[];if(0===this._eventsCount)return s;for(o in e=this._events)t.call(e,o)&&s.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},i.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var s=0,a=o.length,r=new Array(a);s=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:"_getAuthorization",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:"upload",value:function(e){if(!0===e.getRelayFlag())return Promise.resolve();var t=this.getModule($n);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(Ma),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(Ma),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(Ma),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(Ma),this._uploadVideo(e);default:return Promise.resolve()}}},{key:"_uploadImage",value:function(e){var n=this,o=this.getModule(Rn),s=e.getElements()[0],a=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:a.payload.file,to:a.to,onProgress:function(e){if(s.updatePercent(e),it(a.onProgress))try{a.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(o){var a,r,i=o.location,u=o.fileType,c=o.fileSize,l=o.width,p=o.height,d=o.smallImageUrl,g=o.smallImageWidth,_=o.smallImageHeight,h=o.largeImageUrl,f=o.largeImageWidth,v=o.largeImageHeight,m=n.isPrivateNetWork()?i:Mt(i);return s.updateImageFormat(u),d&&h?(a={url:d,width:g,height:_},r={url:h,width:f,height:v}):(a=Gt({originUrl:m,originWidth:l,originHeight:p,min:198}),r=Gt({originUrl:m,originWidth:l,originHeight:p,min:720})),s.updateImageInfoArray([{size:c,url:m,width:l,height:p},t({},r),t({},a)]),e}))}},{key:"_uploadFile",value:function(e){var t=this,n=this.getModule(Rn),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadFile({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),it(s.onProgress))try{s.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var s=n.location,a=t.isPrivateNetWork()?s:Mt(s);return o.updateFileUrl(a),e}))}},{key:"_uploadAudio",value:function(e){var t=this,n=this.getModule(Rn),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadAudio({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),it(s.onProgress))try{s.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var s=n.location,a=t.isPrivateNetWork()?s:Mt(s);return o.updateAudioUrl(a),e}))}},{key:"_uploadVideo",value:function(e){var t=this,n=this.getModule(Rn),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadVideo({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),it(s.onProgress))try{s.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var s=n.location,a=n.snapshotInfo,r=t.isPrivateNetWork()?s:Mt(s);return o.updateVideoUrl(r),jt(a)||o.updateSnapshotInfo(a),e}))}},{key:"_checkSizeError",value:function(e){return Ja({code:da["MESSAGE_".concat(e,"_SIZE_LIMIT")],message:this.getErrorMessage("UploadSizeLimit",e.toLowerCase(),"".concat(this.UPLOAD_SIZE_LIMIT[e]/1048576," MB"))})}},{key:"doUploadImage",value:function(e){var t=this;if(!e.file)return Ja({code:da.MESSAGE_IMAGE_SELECT_FILE_FIRST});var n=this._checkImageType(e.file);if(!0!==n)return n;var o=this._checkImageSize(e.file);if(!0!==o)return o;var s=null;return this._setUploadFileType(sr),this.uploadByCOS(e).then((function(e){return s=e,t.isPrivateNetWork()?At(e.location):At("https://".concat(e.location))})).then((function(e){return s.width=e.width,s.height=e.height,Promise.resolve(s)}))}},{key:"_checkImageType",value:function(e){var t="";return t=se?e.url.slice(e.url.lastIndexOf(".")+1):e.files[0].name.slice(e.files[0].name.lastIndexOf(".")+1),nr.indexOf(t.toLowerCase())>=0||Ja({code:da.MESSAGE_IMAGE_TYPES_LIMIT})}},{key:"_checkImageSize",value:function(e){var t=0;return 0===(t=se?e.size:e.files[0].size)?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):tthis.UPLOAD_SIZE_LIMIT.FILE?this._checkSizeError("FILE"):0===e.file.files[0].size?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):(this._setUploadFileType(ir),this.uploadByCOS(e)):Ja({code:da.MESSAGE_FILE_SELECT_FILE_FIRST})}},{key:"doUploadVideo",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.VIDEO?this._checkSizeError("VIDEO"):0===e.file.videoFile.size?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):-1===or.indexOf(e.file.videoFile.type)?Ja({code:da.MESSAGE_VIDEO_TYPES_LIMIT}):(this._setUploadFileType(ar),se?this.handleVideoUpload({file:e.file.videoFile,onProgress:e.onProgress}):ae?this.handleVideoUpload(e):void 0)}},{key:"handleVideoUpload",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new Wa({code:da.MESSAGE_VIDEO_UPLOAD_FAIL}))}))}))}))}},{key:"doUploadAudio",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.AUDIO?this._checkSizeError("AUDIO"):0===e.file.size?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):(this._setUploadFileType(rr),this.uploadByCOS(e)):Ja({code:da.MESSAGE_AUDIO_UPLOAD_FAIL})}},{key:"uploadByCOS",value:function(e){var t=this;if(!it(this._cosUploadMethod))return this.outputWarning("PluginUndetected"),Ja({code:da.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var n=new ka("upload"),o="".concat(this._n,".uploadByCOS"),s=Date.now(),a=this._getFile(e);return new Promise((function(r,i){var u=se?t._createCosOptionsWXMiniApp(e):t._createCosOptionsWeb(e),c=t;t._cosUploadMethod(u,(function(e,u){var l=Object.create(null);if(u){if(e||st(u.files)&&u.files[0].error){var p=new Wa({code:da.MESSAGE_FILE_UPLOAD_FAIL});return n.setError(p,!0,t.getNetworkType()).end(),xe.l("".concat(o," failed. error:"),u.files[0].error),403===u.files[0].error.statusCode&&(xe.w("".concat(o," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),void i(p)}l.fileName=a.name,l.fileSize=a.size,l.fileType=a.type.slice(a.type.indexOf("/")+1).toLowerCase(),l.location=se?u.Location:u.files[0].data.Location;var d=Date.now()-s,g=c._formatFileSize(a.size),_=c._formatSpeed(1e3*a.size/d),h="size:".concat(g," time:").concat(d,"ms speed:").concat(_);xe.l("".concat(o," success. name:").concat(a.name," ").concat(h)),r(l);var f=t.getModule($n);return f.addCost(Ma,d),f.addFileSize(Ma,a.size),void n.setNetworkType(t.getNetworkType()).setMessage(h).end()}var v=new Wa({code:da.MESSAGE_FILE_UPLOAD_FAIL});n.setError(v,!0,c.getNetworkType()).end(),xe.w("".concat(o," failed. error:"),e),403===e.statusCode&&(xe.w("".concat(o," failed. cos AccessKeyId was invalid, regain auth key!")),t._getAuthorizationKey()),i(v)}))}))}},{key:"_uploadWithPreSigUrl",value:function(e){var t=this,n="".concat(this._n,"._uploadWithPreSigUrl"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(s,a){var r=new ka("upload"),i=e.requestSnapshotUrl,u=void 0===i?void 0:i,c=g(e,ci),l=Date.now();t._cosUploadMethod(c,(function(e,i){if(e||403===i.statusCode)return r.setError(new Wa(e),!0,t.getNetworkType()).end(),xe.l("".concat(n," failed, error:"),e),void a(new Wa({code:da.MESSAGE_FILE_UPLOAD_FAIL}));var p=Object.create(null),d=i.data.location||"";t.isPrivateNetWork()||0!==d.indexOf("https://")&&0!==d.indexOf("http://")||(d=d.split("//")[1]),p.fileName=o.name,p.fileSize=o.size,p.fileType=o.type.slice(o.type.indexOf("/")+1).toLowerCase(),p.location=d;var g=Date.now()-l,_=t._formatFileSize(o.size),h=t._formatSpeed(1e3*o.size/g),f="size:".concat(_,",time:").concat(g,"ms,speed:").concat(h," res:").concat(JSON.stringify(i.data));xe.l("".concat(n," success name:").concat(o.name,",").concat(f)),r.setNetworkType(t.getNetworkType()).setMessage(f).end();var v=t.getModule($n);v.addCost(Ma,g),v.addFileSize(Ma,o.size);var m=[];if(c.thumbUrl&&c.largeUrl&&(m=[t._getSmallImageInfoByUrl(c.thumbUrl,p),t._getLargeImageInfoByUrl(c.largeUrl,p)]),u&&m.push(t._getSnapshotInfoByUrl(u,p)),m.length>0)return Promise.all(m).then((function(){s(p)}));s(p)}))}))}))}},{key:"_getRawOrUploadProxyUrl",value:function(e){var t=this.getModule(qn).getFileUploadProxy(),n=e;return t&&(n=e.replace(/^https:\/\/[^/]+/,t)),n}},{key:"_getFile",value:function(e){var t;return st(e.file.files)||(t=e.file.files,"filelist"===ct(t))?e.file.files[0]:e.file}},{key:"_formatFileSize",value:function(e){return e<1024?e+"B":e<1048576?Math.floor(e/1024)+"KB":Math.floor(e/1048576)+"MB"}},{key:"_formatSpeed",value:function(e){return e<=1048576?bt(e/1024,1)+"KB/s":bt(e/1048576,1)+"MB/s"}},{key:"_createCosOptionsWeb",value:function(e){var t=this._getFile(e),n=t.name,o=n.slice(n.lastIndexOf(".")),s=this._genFileName("".concat(_t(999999)).concat(o));return{files:[{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(s),Body:t}],SliceSize:1048576,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){xe.w("onProgress callback error:",n)}},onFileFinish:function(e,t,n){}}}},{key:"_createCosOptionsWXMiniApp",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name),o=t.url;return{Bucket:"".concat(this.bucketName,"-").concat(this.appid),Region:this.region,Key:"".concat(this.directory,"/").concat(n),FilePath:o,onProgress:function(t){if(xe.l(JSON.stringify(t)),"function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){xe.w("onProgress callback error:",n)}}}}},{key:"_createCosOptionsPreSigUrl",value:function(e){var t=this,n="",o="",s=0,a=this._getFile(e);if(se)n=this._genFileName(a.name),o=a.url,s=1;else{var r=a.name,i=r.slice(r.lastIndexOf("."));n=this._genFileName("".concat(_t(999999)).concat(i)),o=a,s=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:n,uploadMethod:s,duration:this.duration}).then((function(s){var a=s.uploadUrl,r=s.downloadUrl,i=s.requestSnapshotUrl,u=void 0===i?void 0:i,c=s.thumbUrl,l=s.largeUrl;return{url:t._getRawOrUploadProxyUrl(a),fileType:t.uploadFileType,fileName:n,resources:o,downloadUrl:r,requestSnapshotUrl:u,thumbUrl:c,largeUrl:l,onProgress:function(t){if("function"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){xe.w("onProgress callback error:",n),xe.e(n)}}}}))}},{key:"_genFileName",value:function(e){return"".concat(Rt(),"-").concat(e)}},{key:"_setUploadFileType",value:function(e){this.uploadFileType=e}},{key:"_getSnapshotInfoByUrl",value:function(e,t){var n=this,o=new ka("getSnapshotInfo");return this.request({protocolName:qs,requestData:{platform:this.getPlatform(),coverName:this._genFileName(_t(99999)),requestSnapshotUrl:e}}).then((function(e){var n=(e.data||{}).snapshotUrl;return o.setMessage("snapshotUrl:".concat(n)).end(),jt(n)?{}:At(n).then((function(e){t.snapshotInfo={snapshotUrl:n,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return xe.w("".concat(n._n,"._getSnapshotInfoByUrl failed. error:"),e),o.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:"_getSmallImageInfoByUrl",value:function(e,t){return At(e).then((function(n){t.smallImageUrl=e,t.smallImageWidth=n.width,t.smallImageHeight=n.height}))}},{key:"_getLargeImageInfoByUrl",value:function(e,t){return At(e).then((function(n){t.largeImageUrl=e,t.largeImageWidth=n.width,t.largeImageHeight=n.height}))}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset"))}}]),s}(ro),pi=["downloadKey","pbDownloadKey","messageList"],di=function(){function e(t){o(this,e),this._n="MergerMessageHandler",this._messageModule=t}return a(e,[{key:"uploadMergerMessage",value:function(e,t){var n=this,o="".concat(this._n,".").concat("uploadMergerMessage");xe.d("".concat(o," message:"),e,"messageBytes:".concat(t));var s=e.payload.messageList,a=s.length,r=new ka("uploadMergerMessage");return this._messageModule.request({protocolName:Ys,requestData:{messageList:s}}).then((function(e){xe.d("".concat(o," ok. response:"),e.data);var s=e.data,i=s.pbDownloadKey,u=s.downloadKey,c={pbDownloadKey:i,downloadKey:u,messageNumber:a};return r.setNetworkType(n._messageModule.getNetworkType()).setMessage("".concat(a,"-").concat(t,"-").concat(u)).end(),c})).catch((function(e){throw xe.w("".concat(o," failed. error:"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),e}))}},{key:"downloadMergerMessage",value:function(e){var n=this,o="".concat(this._n,".").concat("downloadMergerMessage");xe.d("".concat(o," message:"),e);var s=e.payload.downloadKey,a=this._messageModule.getFileDownloadProxy(),r=new ka("downloadMergerMessage");return r.setMessage("downloadKey:".concat(s)),this._messageModule.request({protocolName:js,requestData:{downloadKey:s}}).then((function(s){if(xe.d("".concat(o," ok. response:"),s.data),it(e.clearElement)){var i=e.payload;i.downloadKey,i.pbDownloadKey,i.messageList;var u=g(i,pi);e.clearElement(),e.setElement({type:e.type,content:t({messageList:s.data.messageList},u)},a)}else{var c=[];s.data.messageList.forEach((function(e){if(!jt(e)){var t=new xa(e,a);c.push(t)}})),e.payload.messageList=c,e.payload.downloadKey="",e.payload.pbDownloadKey=""}return r.setNetworkType(n._messageModule.getNetworkType()).end(),e})).catch((function(e){throw xe.w("".concat(o," failed. key:").concat(s," error:"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),e}))}},{key:"createMergerMessagePack",value:function(e,t,n){return e.conversationType===S.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:"_createC2CMergerMessagePack",value:function(e,t,n){var o=null;t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly&&(o?o.disablePush=!0:o={disablePush:!0}));var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c="";et(e.cloudCustomData)&&e.cloudCustomData.length>0&&(c=e.cloudCustomData);var l=n.pbDownloadKey,p=n.downloadKey,d=n.messageNumber,g=e.payload,_=g.title,h=g.abstractList,f=g.compatibleText,v=this._messageModule.getModule(Gn),m=v&&v.isOnlineMessage(e,t)?0:void 0;return{protocolName:_o,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:p,title:_,abstractList:h,compatibleText:f,messageNumber:d}}],cloudCustomData:c,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,messageControlInfo:0!==m?s:void 0,isSupportExtension:!0===e.isSupportExtension?1:0}}}},{key:"_createGroupMergerMessagePack",value:function(e,t,n){var o=null;t&&t.offlinePushInfo&&(o=t.offlinePushInfo);var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push("NoUnread"),!0===i&&s.push("NoLastMsg"),!0===u&&s.push("NoMsgCheck")}var c="";et(e.cloudCustomData)&&e.cloudCustomData.length>0&&(c=e.cloudCustomData);var l=n.pbDownloadKey,p=n.downloadKey,d=n.messageNumber,g=e.payload,_=g.title,h=g.abstractList,f=g.compatibleText,v=this._messageModule.getModule(Un),m=v&&v.isOnlineMessage(e,t)?1:0;return{protocolName:ho,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:p,title:_,abstractList:h,compatibleText:f,messageNumber:d}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:c,onlineOnlyFlag:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||"",desc:o.description||"",ext:o.extension||"",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||""}}:void 0,clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||v.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:0===m?s:void 0,isSupportExtension:!0===e.isSupportExtension?1:0}}}}]),e}(),gi={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,MESSAGE_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},_i=[da.MESSAGE_ONPROGRESS_FUNCTION_ERROR,da.MESSAGE_IMAGE_SELECT_FILE_FIRST,da.MESSAGE_IMAGE_TYPES_LIMIT,da.MESSAGE_FILE_IS_EMPTY,da.MESSAGE_IMAGE_SIZE_LIMIT,da.MESSAGE_FILE_SELECT_FILE_FIRST,da.MESSAGE_FILE_SIZE_LIMIT,da.MESSAGE_VIDEO_SIZE_LIMIT,da.MESSAGE_VIDEO_TYPES_LIMIT,da.MESSAGE_AUDIO_UPLOAD_FAIL,da.MESSAGE_AUDIO_SIZE_LIMIT,da.COS_UNDETECTED];function hi(e){var t=!1;return Object.values(gi).includes(e)&&(t=!0),(e>=120001&&e<=13e4||e>=10100&&e<=10200)&&(t=!0),t}var fi=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n="MessageModule",t._messageOptionsMap=new Map,t._mergerMessageHandler=new di(_(t)),t}return a(s,[{key:"createTextMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o="string"==typeof e.payload?e.payload:e.payload.text,s=new La({text:o}),a=this._getNickAndAvatarByUserID(t);return n.setElement(s),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createImageMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e);if(se){var o=e.payload.file;if(Ze(o))return void this.outputWarning("FileUnsupportedInMP","createImageMessage");var s=o.tempFiles[0].path||o.tempFiles[0].tempFilePath,a={url:s,name:s.slice(s.lastIndexOf("/")+1),size:o.tempFiles&&o.tempFiles[0].size||1,type:s.slice(s.lastIndexOf(".")+1).toLowerCase()};e.payload.file=a}else if(ae)if(Ze(e.payload.file)){var r=e.payload.file;e.payload.file={files:[r]}}else if(ot(e.payload.file)&&"undefined"!=typeof uni){var i=e.payload.file.tempFiles[0];e.payload.file={files:[i]}}var u=new Aa({imageFormat:Ve.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file}),c=this._getNickAndAvatarByUserID(t);return n.setElement(u),n.setNickAndAvatar(c),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:"createAudioMessage",value:function(e){var t=e.payload.file;if(se){var n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf("/")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(".")+1).toLowerCase()};e.payload.file=n}var o=this.getMyUserID();e.currentUser=o,e.senderTinyID=this.getMyTinyID();var s=new Ha(e),a=new Na({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size,url:t.tempFilePath,uuid:this._generateUUID(e.payload.file)}),r=this._getNickAndAvatarByUserID(o);return s.setElement(a),s.setNickAndAvatar(r),s.setNameCard(this._getNameCardByGroupID(s)),this._messageOptionsMap.set(s.clientSequence,e),s}},{key:"createVideoMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl="",e.payload.file.thumbSize=0;var n={};if(se){if(ee)return void this.outputWarning("VideoUnsupportedInAlipay");if(Ze(e.payload.file))return void this.outputWarning("FileUnsupportedInMP","createVideoMessage");var o=e.payload.file;st(o.tempFiles)&&(o=o.tempFiles[0]),n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf("/")+1),n.size=o.size||1,n.second=o.duration||0,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(".")+1).toLowerCase()}else if(ae){if(Ze(e.payload.file)){var s=e.payload.file;e.payload.file.files=[s]}else if(ot(e.payload.file)&&"undefined"!=typeof uni){var a=e.payload.file.tempFile;e.payload.file.files=[a]}var r=e.payload.file;n.url=window.URL.createObjectURL(r.files[0]),n.name=r.files[0].name,n.size=r.files[0].size||1,n.second=r.files[0].duration||0,n.type=r.files[0].type.split("/")[1]}e.payload.file.videoFile=n;var i=new Ha(e),u=new Fa({videoFormat:n.type,videoSecond:bt(n.second,0),videoSize:n.size,remoteVideoUrl:"",videoUrl:n.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(".")+1).toLowerCase()}),c=this._getNickAndAvatarByUserID(t);return i.setElement(u),i.setNickAndAvatar(c),i.setNameCard(this._getNameCardByGroupID(i)),this._messageOptionsMap.set(i.clientSequence,e),i}},{key:"createCustomMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=new wa({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createFaceMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=new Ra(e.payload),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"createMergerMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=this._getNickAndAvatarByUserID(t),o=new Ha(e),s=new Va(e.payload);return o.setElement(s),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:"createForwardMessage",value:function(e){var t=e.to,n=e.conversationType,o=e.priority,s=e.payload,a=e.needReadReceipt,r=e.receiverList,i=this.getMyUserID(),u=this._getNickAndAvatarByUserID(i);if(s.type===S.MSG_GRP_TIP)return Ja({code:da.MESSAGE_FORWARD_TYPE_INVALID});var c={to:t,conversationType:n,conversationID:"".concat(n).concat(t),priority:o,isPlaceMessage:0,status:Qt.UNSEND,currentUser:i,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||s.cloudCustomData||"",needReadReceipt:a,receiverList:r,isSupportExtension:e.isSupportExtension||!1},l=new Ha(c);return l.setElement(s.getElements()[0]),l.setNickAndAvatar(u),l.setNameCard(this._getNameCardByGroupID(s)),l.setRelayFlag(!0),l}},{key:"downloadMergerMessage",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:"createFileMessage",value:function(e){if(se){if(!X&&!Q&&!ne)return;var n=re.getSystemInfoSync().SDKVersion;if(X&&Ot(n,"2.5.0")<0)return void this.outputWarning("WXChooseMessageFile");if(Q&&Ot(n,"1.18.0")<0)return void this.outputWarning("QQChooseMessageFile")}if(ae||ne){if(Ze(e.payload.file)){var o=e.payload.file;e.payload.file={files:[o]}}else if(ot(e.payload.file)&&"undefined"!=typeof uni){var s=e.payload.file,a=s.tempFiles,r=s.files,i=null;st(a)?i=a[0]:st(r)&&(i=r[0]),e.payload.file={files:[i]}}}else if(X||Q){var u=e.payload.file.tempFiles,c=t(t({},u[0]),{},{url:u[0].path});e.payload.file={files:[c]}}var l=this.getMyUserID();e.currentUser=l,e.senderTinyID=this.getMyTinyID();var p=new Ha(e),d=new ba({uuid:this._generateUUID(e.payload.file),file:e.payload.file}),g=this._getNickAndAvatarByUserID(l);return p.setElement(d),p.setNickAndAvatar(g),p.setNameCard(this._getNameCardByGroupID(p)),this._messageOptionsMap.set(p.clientSequence,e),p}},{key:"createLocationMessage",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=new qa(e.payload),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:"_onCannotFindModule",value:function(){return Ja({code:da.CANNOT_FIND_MODULE})}},{key:"sendMessageInstance",value:function(e,t){var n=this;if(!1===this.getModule(no).filterMessage(e,t))return this._onSendMessageFailed(e,new Wa({code:da.PROFANITY_FOUND}));var o,s=null;switch(e.conversationType){case S.CONV_C2C:if(!(s=this.getModule(Gn)))return this._onCannotFindModule();break;case S.CONV_GROUP:if(!(s=this.getModule(Un)))return this._onCannotFindModule();if(Tt({groupID:e.to})){var a=s.getLocalGroupProfile(e.to);if(a&&a.isSupportTopic)return Ja({code:da.MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL})}break;default:return Ja({code:da.MESSAGE_SEND_INVALID_CONVERSATION_TYPE})}var r=this.getModule(Kn),i=this.getModule(Un);return r.upload(e).then((function(){n._getSendMessageSpecifiedKey(e)===ma&&n.getModule($n).addSuccessCount(Ma);return i.guardForAVChatRoom(e).then((function(){if(!e.isSendable())return Ja({code:da.MESSAGE_FILE_URL_IS_EMPTY});n._addSendMessageTotalCount(e),o=Date.now();var a=function(e){var t="utf-8";ae&&document&&(t=document.charset.toLowerCase());var n,o,s=0;if(o=e.length,"utf-8"===t||"utf8"===t)for(var a=0;a11264?n._mergerMessageHandler.uploadMergerMessage(e,a).then((function(o){var s=n._mergerMessageHandler.createMergerMessagePack(e,t,o);return n.request(s)})):(n.getModule(Fn).setMessageRandom(e),e.conversationType===S.CONV_C2C||e.conversationType===S.CONV_GROUP?s.sendMessage(e,t):void 0)})).then((function(a){var r=a.data,i=r.time,u=r.sequence,c=r.readReceiptCode;$e(c)&&0!==c&&(new ka("sendMessageWithReceipt").setMessage("from:".concat(e.from," to:").concat(e.to," sequence:").concat(u," readReceiptCode:").concat(c)).end(),xe.w("".concat(n._n,".sendMessageInstance readReceiptCode:").concat(c," message:").concat(n.getErrorMessage(c))));n._addSendMessageSuccessCount(e,o),n._messageOptionsMap.delete(e.clientSequence);var l=n.getModule(Fn);e.status=Qt.SUCCESS,e.time=i;var p=!1;if(e.conversationType===S.CONV_GROUP)e.sequence=u;else if(e.conversationType===S.CONV_C2C){var d=l.getLatestMessageSentByMe(e.conversationID);if(d){var g=d.nick,_=d.avatar;g===e.nick&&_===e.avatar||(p=!0)}}if(p&&l.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),s.isOnlineMessage(e,t))e._onlineOnlyFlag=!0;else{l.appendToMessageList(e);var h=e;ot(t)&&ot(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,h=""),!0===t.messageControlInfo.excludedFromUnreadCount&&(e._isExcludedFromUnreadCount=!0));var f=e.conversationType;if(Dt(e.to))f=S.CONV_TOPIC,n.getModule(wn).onMessageSent({groupID:qt(e.to),topicID:e.to,lastMessage:h});l.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:f,subType:e.conversationSubType,lastMessage:h}]})}return e.getRelayFlag()||"TIMImageElem"!==e.type||Ut(e.payload.imageInfoArray),Ka({message:e})}))})).catch((function(t){return n._onSendMessageFailed(e,t)}))}},{key:"_onSendMessageFailed",value:function(e,t){e.status=Qt.FAIL,this.getModule(Fn).deleteMessageRandom(e),this._addSendMessageFailCountOnUser(e,t);var n=new ka("sendMessage");return n.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to)),this.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];n.setError(t,s,a).end()})),xe.e("".concat(this._n,"._onSendMessageFailed error:"),t),Ja(new Wa({code:t&&t.code?t.code:da.MESSAGE_SEND_FAIL,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:"_getSendMessageSpecifiedKey",value:function(e){if([S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_VIDEO,S.MSG_FILE].includes(e.type))return ma;if(e.conversationType===S.CONV_C2C)return ha;if(e.conversationType===S.CONV_GROUP){var t=this.getModule(Un).getLocalGroupProfile(e.to);if(!t)return;var n=t.type;return Ct(n)?va:fa}}},{key:"_addSendMessageTotalCount",value:function(e){var t=this._getSendMessageSpecifiedKey(e);t&&this.getModule($n).addTotalCount(t)}},{key:"_addSendMessageSuccessCount",value:function(e,t){var n=Math.abs(Date.now()-t),o=this._getSendMessageSpecifiedKey(e);if(o){var s=this.getModule($n);s.addSuccessCount(o),s.addCost(o,n)}}},{key:"_addSendMessageFailCountOnUser",value:function(e,t){var n,o,s=t.code,a=void 0===s?-1:s,r=this.getModule($n),i=this._getSendMessageSpecifiedKey(e);i===ma&&(n=a,o=!1,_i.includes(n)&&(o=!0),o)?r.addFailedCountOfUserSide(Ma):hi(a)&&i&&r.addFailedCountOfUserSide(i)}},{key:"resendMessage",value:function(e){return e.isResend=!0,e.status=Qt.UNSEND,this.sendMessageInstance(e)}},{key:"revokeMessage",value:function(e){var t=this,n=null;if(e.conversationType===S.CONV_C2C?n=this.getModule(Gn):e.conversationType===S.CONV_GROUP&&(n=this.getModule(Un)),!n)return this._onCannotFindModule();var o=new ka("revokeMessage");o.setMessage("tjg_id:".concat(this.generateTjgID(e)," type:").concat(e.type," from:").concat(e.from," to:").concat(e.to));var s="".concat(this._n,".").concat("revokeMessage");return n.revokeMessage(e).then((function(n){var a=n.data.recallRetList;if(!jt(a)&&0!==a[0].retCode){var r=new Wa({code:a[0].retCode,data:{message:e}});return o.setCode(r.code).setMoreMessage(r.message).end(),Ja(r)}return xe.i("".concat(s," ok. ID:").concat(e.ID)),e.isRevoked=!0,o.end(),t.getModule(Fn).onMessageRevoked([e]),Ka({message:e})})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];o.setError(n,s,a).end()}));var a=new Wa({code:n&&n.code?n.code:da.MESSAGE_REVOKE_FAIL,message:n&&n.message?n.message:void 0,data:{message:e}});return xe.w("".concat(s," failed. error:"),n),Ja(a)}))}},{key:"deleteMessage",value:function(e){var t=this,n=null,o=e[0],s=o.conversationID,a="",r=[],i=[];if(o.conversationType===S.CONV_C2C)n=this.getModule(Gn),a=s.replace(S.CONV_C2C,""),e.forEach((function(e){e&&e.status===Qt.SUCCESS&&e.conversationID===s&&(e._onlineOnlyFlag||r.push("".concat(e.sequence,"_").concat(e.random,"_").concat(e.time)),i.push(e))}));else if(o.conversationType===S.CONV_GROUP)n=this.getModule(Un),a=s.replace(S.CONV_GROUP,""),e.forEach((function(e){e&&e.status===Qt.SUCCESS&&e.conversationID===s&&(e._onlineOnlyFlag||r.push("".concat(e.sequence)),i.push(e))}));else if(o.conversationType===S.CONV_SYSTEM)return Ja({code:da.CANNOT_DELETE_GROUP_SYSTEM_NOTICE});if(!n)return this._onCannotFindModule();if(0===r.length)return this._onMessageDeleted(i);r.length>30&&(r=r.slice(0,30),i=i.slice(0,30));var u=new ka("deleteMessage");u.setMessage("to:".concat(a," count:").concat(r.length));var c="".concat(this._n,".").concat("deleteMessage");return n.deleteMessage({to:a,keyList:r}).then((function(e){return u.end(),xe.i("".concat(c," ok")),t._onMessageDeleted(i)})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.w("".concat(c," failed. error:"),e);var n=new Wa({code:e&&e.code?e.code:da.MESSAGE_DELETE_FAIL,message:e&&e.message?e.message:void 0});return Ja(n)}))}},{key:"_onMessageDeleted",value:function(e){return this.getModule(Fn).onMessageDeleted(e),za({messageList:e})}},{key:"translateText",value:function(e){var n="".concat(this._n,".").concat("translateText"),o=e.sourceTextList,s=e.sourceLanguage,a=e.targetLanguage,r=new ka("translateText");return r.setMessage("sourceLanguage:".concat(s," targetLanguage:").concat(a)),this.request({protocolName:pa,requestData:{sourceTextList:o,source:s||"auto",target:a,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then((function(e){var o=e.data,s=o.error,a=o.requestID,i=o.translatedTextList;if(0===s.code)return r.end(),xe.i("".concat(n," ok. requestID:").concat(a)),Ka({translatedTextList:i});throw t(t({},s),{},{requestID:a})})).catch((function(e){return r.setCode(e.code).setMoreMessage(e.requestID).end(),xe.w("".concat(n," failed. error:"),e),Ja({code:da.TRANSLATE_TEXT_FAIL})}))}},{key:"modifyRemoteMessage",value:function(e){var t=this,n=null,o=e.conversationType,s=e.to;if(this.getModule(Un).isMessageFromOrToAVChatroom(s))return Ja({code:da.MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:e}});if(!1===this.getModule(no).filterMessage(e))return Ja({code:da.PROFANITY_FOUND,data:{message:e}});o===S.CONV_C2C?n=this.getModule(Gn):o===S.CONV_GROUP&&(n=this.getModule(Un));var a=new ka("modifyMessage");a.setMessage("to:".concat(s));var r="".concat(this._n,".modifyRemoteMessage");return n.modifyRemoteMessage(e).then((function(n){a.end(),xe.i("".concat(r," ok"));var o=t._onModifyRemoteMessageResp(e,n.data);return Ka({message:o})})).catch((function(n){if(a.setCode(n.code).setMoreMessage(n.message).end(),xe.w("".concat(r," failed. error:"),n),20027===n.code){var o=t._onModifyRemoteMessageResp(e,n.data);return Ja({code:da.MESSAGE_MODIFY_CONFLICT,data:{message:o}})}return Ja({code:n.code,message:n.message,data:{message:e}})}))}},{key:"_onModifyRemoteMessageResp",value:function(e,t){xe.d("".concat(this._n,"._onModifyRemoteMessageResp options:"),t);var n=e.conversationType,o=e.from,s=e.to,a=e.random,r=e.sequence,i=e.time,u=t.elements,c=t.messageVersion,l=t.cloudCustomData,p=void 0===l?"":l;return this.getModule(Fn).onMessageModified({conversationType:n,from:o,to:s,time:i,random:a,sequence:r,elements:u,cloudCustomData:p,messageVersion:c})}},{key:"_generateUUID",value:function(e){var t=this.getModule(qn),n="".concat(t.getSDKAppID(),"-").concat(t.getUserID(),"-").concat(function(){for(var e="",t=32;t>0;--t)e+=ht[Math.floor(Math.random()*ft)];return e}()),o=e.name||e.value||e.url||e.tempFilePath,s=o&&o.slice(o.lastIndexOf(".")+1);return s&&(n="".concat(n,".").concat(s)),n}},{key:"getMessageOption",value:function(e){return this._messageOptionsMap.get(e)}},{key:"_getNickAndAvatarByUserID",value:function(e){return this.getModule(On).getNickAndAvatarByUserID(e)}},{key:"_getNameCardByGroupID",value:function(e){if(e.conversationType===S.CONV_GROUP){var t=this.getModule(Un);if(t)return t.getMyNameCardByGroupID(e.to)}return""}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._messageOptionsMap.clear()}}]),s}(ro),vi=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="MessageExtensionModule",s.messageExtensionMap=new Map,s.globalSeqMap=new Map,s.getMessageExtensionsMap=new Map,s}return a(n,[{key:"onMessageExtensionNotify",value:function(e){var t=this,n=e.dataList,o=n.messageInfo,s=n.operateType,a=n.operateResultList,r=n.tinyID,i=n.globalSequence,u=o.clientTime,c=o.random,l="".concat(r,"-").concat(u,"-").concat(c),p=[],d=[];xe.l("".concat(this._n,".onMessageExtensionNotify messageID:").concat(l," operateType:").concat(s," globalSequence:").concat(i)),this._updateGlobalSequence(l,i);var g=!1,_=!1;a.forEach((function(e){var n=e.extensions,o=void 0===n?[]:n,a=e.clearSequence;if(1===s)g=!0,o.forEach((function(e){p.push({key:e.key,value:e.value})})),t._updateLocalExtension(l,o);else if(2===s)_=!0,o.forEach((function(e){d.push(e.key)})),t._updateLocalExtension(l,o);else if(3===s){if(_=!0,t._hasLocalExtension(l))t._getLocalExtension(l).forEach((function(e,t){e.seq<=a&&!jt(e.value)&&d.push(t)}));t._clearLocalExtension(l,a)}})),g&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_UPDATED,{messageID:l,extensions:p}),_&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_DELETED,{messageID:l,keyList:d})}},{key:"setMessageExtensions",value:function(e,t){var n=this;if(!this.canIUse(B.MSG_EXT))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var o="".concat(this._n,".").concat("setMessageExtensions"),s=e.ID,a=e.conversationID,r=e.sequence,i=e.time,u=m(t);t.length>20&&(u=t.slice(0,20),xe.w("".concat(o,". the length of extensions cannot exceed 20.")));var c="conversationID:".concat(a," messageID:").concat(s," sequence:").concat(r," time:").concat(i," count:").concat(u.length),l=new ka("setMessageExtensions");return l.setMessage(c),xe.l("".concat(o," ").concat(c)),this._modifyMessageExtensions(e,u).then((function(e){var t=e.resultList,n=e.successCount,s=e.failureCount,a="success count:".concat(n," fail count:").concat(s);return l.setMoreMessage(a).end(),xe.l("".concat(o," ok. ").concat(a)),Ka({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"getMessageExtensions",value:function(e){var t=this;if(!this.canIUse(B.MSG_EXT))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n="".concat(this._n,".").concat("getMessageExtensions"),o=e.ID,s=e.conversationID,a=e.sequence,r=e.time,i="conversationID:".concat(s," messageID:").concat(o," sequence:").concat(a," time:").concat(r),u=new ka("getMessageExtensions");u.setMessage(i),xe.l("".concat(n," ").concat(i));var c=void 0;return this.getMessageExtensionsMap.has(o)&&(c=this._getGlobalSequence(o)),this._getMessageExtensions(e,c).then((function(e){return u.end(),xe.l("".concat(n," ok. total count:").concat(e.length)),at(c)&&e.length>0&&t.getMessageExtensionsMap.set(o,1),Ka({extensions:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"deleteMessageExtensions",value:function(e,t){var n=this;if(!this.canIUse(B.MSG_EXT))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var o="".concat(this._n,".").concat("deleteMessageExtensions"),s=[],a=3;jt(t)||(a=2,t.forEach((function(e){s.push({key:e,value:"",seq:0})})));var r=e.ID,i=e.conversationID,u=e.sequence,c=e.time,l="conversationID:".concat(i," messageID:").concat(r," sequence:").concat(u," time:").concat(c," operateType:").concat(a),p=new ka("deleteMessageExtensions");return p.setMessage(l),xe.l("".concat(o," ").concat(l)),this._modifyMessageExtensions(e,s,a).then((function(e){var t=e.resultList,n=e.successCount,s=e.failureCount,r="";return 2===a&&(r="success count:".concat(n," fail count:").concat(s)),p.setMoreMessage("".concat(r)).end(),xe.l("".concat(o," ok. ").concat(r)),Ka({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];p.setError(e,o,s).end()})),xe.e("".concat(o," failed. error:"),e),Ja(e)}))}},{key:"_modifyMessageExtensions",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=Dt(e.to)?S.CONV_TOPIC:e.conversationType,a=void 0;3!==o&&(a=this._getRequestExtensions(e,t));var r=null;switch(s){case S.CONV_C2C:r=this.getModule(Gn);break;case S.CONV_GROUP:r=this.getModule(Un);break;case S.CONV_TOPIC:r=this.getModule(wn);break;default:return Ja({code:da.CANNOT_FIND_MODULE})}return r.modifyMessageExtensions(e,a,o).then((function(t){var o=t.data,s=o.extensions,a=o.seq,r=[],i=0,u=0,c=[];return(s=jt(s)?[]:s).forEach((function(e){var t=e.errorCode,n=e.extension,o=n.key,s=n.value,a=n.seq;r.push({code:t,key:o,value:s}),0===t?i++:u++,c.push({key:o,value:s,seq:a})})),n._updateGlobalSequence(e.ID,a),c.length>0&&(n._updateLocalExtension(e.ID,c),c=null),{resultList:r,successCount:i,failureCount:u}})).catch((function(e){return Ja(e)}))}},{key:"_getRequestExtensions",value:function(e,t){var n=[];if(this._hasLocalExtension(e.ID)){var o=this._getLocalExtension(e.ID);return t.forEach((function(e){var t=e.key,s=e.value,a=0;o.has(t)&&(a=o.get(t).seq),n.push({key:t,value:s,seq:a})})),n}return t.forEach((function(e){var t=e.key,o=e.value;n.push({key:t,value:o,seq:0})})),n}},{key:"_getMessageExtensions",value:function(e,t){var n=this,o="".concat(this._n,"._getMessageExtensions"),s=e.ID,a=e.to,r=null;switch(Dt(a)?S.CONV_TOPIC:e.conversationType){case S.CONV_C2C:r=this.getModule(Gn);break;case S.CONV_GROUP:r=this.getModule(Un);break;case S.CONV_TOPIC:r=this.getModule(wn);break;default:return Ja({code:da.CANNOT_FIND_MODULE})}return r.getMessageExtensions(e,t).then((function(t){var a=t.data,r=a.extensions,i=a.completeFlag,u=a.globalSequence,c=a.clearSequence;if(r=jt(r)?[]:r,xe.l("".concat(o," ok. completeFlag:").concat(i," globalSequence:").concat(u," clearSequence:").concat(c," count:").concat(r.length)),n._updateLocalExtension(s,r),n._clearLocalExtension(s,c),n._updateGlobalSequence(s,u),1!==i){var l=r.slice(-1)[0].seq+1;return n._getMessageExtensions(e,l)}return n._getLocalExtensions(s)})).catch((function(e){return Ja(e)}))}},{key:"_hasLocalExtension",value:function(e){return this.messageExtensionMap.has(e)}},{key:"_getLocalExtension",value:function(e){return this.messageExtensionMap.get(e)}},{key:"_updateLocalExtension",value:function(e,t){this._hasLocalExtension(e)||this.messageExtensionMap.set(e,new Map);var n=this._getLocalExtension(e);t.forEach((function(e){var t=e.key,o=e.value,s=void 0===o?"":o,a=e.seq;n.set(t,{value:s,seq:a})}))}},{key:"_clearLocalExtension",value:function(e,t){if(!(t<=0)&&this._hasLocalExtension(e)){var n=this._getLocalExtension(e);n.forEach((function(e,o){e.seq<=t&&n.delete(o)}))}}},{key:"_getLocalExtensions",value:function(e){var t=[];this._hasLocalExtension(e)&&this._getLocalExtension(e).forEach((function(e,n){var o=e.value;jt(o)||t.push({key:n,value:o})}));return t}},{key:"_getGlobalSequence",value:function(e){return this.globalSeqMap.get(e)}},{key:"_updateGlobalSequence",value:function(e,t){this.globalSeqMap.set(e,t)}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),n}(ro),mi=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="ComboMessageModule",s}return a(n,[{key:"sendMessage",value:function(e){var t=this,n=this._constructMessageInstance(e);if(null===n)return Ja({code:da.MESSAGE_SEND_FAIL});this._addSendMessageTotalCount(n);var o=Date.now();return this.getModule(Fn).setMessageRandom(n),this._sendComboMessage(n,e).then((function(e){var s=e.data,a=s.time,r=s.sequence,i=s.readReceiptCode;$e(i)&&0!==i&&(new ka("sendMessageWithReceipt").setMessage("from:".concat(n.from," to:").concat(n.to," sequence:").concat(r," readReceiptCode:").concat(i)).end(),xe.w("".concat(t._n,".sendMessage readReceiptCode:").concat(i," message:").concat(t.getErrorMessage(i))));t._addSendMessageSuccessCount(n,o);var u=t.getModule(Fn);n.status=Qt.SUCCESS,n.time=a,n.conversationType===S.CONV_GROUP&&(n.sequence=r),u.appendToMessageList(n);var c=n;return!0===n._isExcludedFromLastMessage&&(c=""),u.onMessageSent({conversationOptionsList:[{conversationID:n.conversationID,unreadCount:0,type:n.conversationType,subType:n.conversationSubType,lastMessage:c}]}),Ka({message:n})})).catch((function(e){return t._onSendMessageFailed(n,e)}))}},{key:"_sendComboMessage",value:function(e,t){var n=this._m.getModule(jn),o="";return e.conversationType===S.CONV_C2C&&(o="".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SEND_MESSAGE)),e.conversationType===S.CONV_GROUP&&(o="".concat(V.NAME.GROUP,".").concat(V.CMD.SEND_GROUP_MESSAGE)),n.sendComboMessage({servcmd:o,data:t})}},{key:"_constructMessageInstance",value:function(e){var t="".concat(this._n,"._constructMessageInstance"),n=null;try{var o=this.getMyUserID(),s={};if(s.senderTinyID=this.getMyTinyID(),s.currentUser=o,s.from=e.From_Account||o,e.GroupId?(s.conversationID="".concat(S.CONV_GROUP).concat(e.GroupId),s.conversationType=S.CONV_GROUP,s.to=e.GroupId):e.To_Account&&(s.conversationID="".concat(S.CONV_C2C).concat(e.To_Account),s.conversationType=S.CONV_C2C,s.to=e.To_Account),s.time=e.MsgTimeStamp||0,s.random=e.Random||e.MsgRandom||0,s.priority=e.MsgPriority,et(e.CloudCustomData)&&e.CloudCustomData.length>0&&(s.cloudCustomData=e.CloudCustomData),st(e.SendMsgControl)&&(s.messageControlInfo={},e.SendMsgControl.includes("NoUnread")&&(s.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes("NoLastMsg")&&(s.messageControlInfo.excludedFromLastMessage=1)),s.conversationType===S.CONV_GROUP&&st(e.To_Account)&&e.To_Account.length>0){var a=e.To_Account;e.To_Account.length>50&&(a=e.To_Account.slice(0,50),xe.w("".concat(t," To_Account must be less than or equal to 50."))),s.receiverList=m(a),e.To_Account=m(a)}1!==e.IsNeedReadReceipt&&1!==e.NeedReadReceipt||(s.needReadReceipt=!0),1===e.SupportMessageExtension&&(s.isSupportExtension=!0),(n=new Ha(s)).status=Qt.UNSEND,e.MsgClientTime=n.clientTime,n.conversationType===S.CONV_C2C&&(e.MsgSeq=n.sequence);for(var r,i=e.MsgBody.length,u=0;u100)return n--,t;if(st(t)){var s=t.map((function(t){return nt(t)?e(t,o):t}));return n--,s}if(nt(t)){var a=(r=t,i=function(e,t){if(!lt(t))return!1;if((s=t)!==Ci(s))for(var n=0;n65535)return Si(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?Si(192|t>>>6,128|63&t):Si(224|t>>>12,128|t>>>6&63,128|63&t)},Li=function(e){for(var t=void 0===e?"":(""+e).replace(/[\x80-\uD7ff\uDC00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]?/g,ki),n=0|t.length,o=new Uint8Array(n),s=0;s0)for(var u=0;u=a&&(xe.l("".concat(e._n,"._checkPromiseMap request timeout, delete requestID:").concat(n)),e._promiseMap.delete(n),o(new Wa({code:da.NETWORK_TIMEOUT})),e._channelModule.onRequestTimeout(n))}))}},{key:"onOpen",value:function(e){if(""!==this._readyState){this._onOpenTs=Date.now();var t=e.id;this._socketID=t;var n=Date.now()-this._startTs;xe.l("".concat(this._n,"._onOpen cost ").concat(n," ms. socketID:").concat(t)),new ka("wsOnOpen").setMessage(n).setCostTime(n).setMoreMessage("socketID:".concat(t)).end(),e.id===this._socketID&&(this._readyState=Pi,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:"onClose",value:function(e){var t=new ka("wsOnClose"),n=e.id,o=e.e,s="sourceSocketID:".concat(n," currentSocketID:").concat(this._socketID," code:").concat(o.code," reason:").concat(o.reason),a=0;0!==this._onOpenTs&&(a=Date.now()-this._onOpenTs),t.setMessage(a).setCostTime(a).setMoreMessage(s).setCode(o.code).end(),xe.l("".concat(this._n,"._onClose ").concat(s," onlineTime:").concat(a)),n===this._socketID&&(this._readyState=wi,a<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:"onError",value:function(e){var t=e.id,n=e.e,o="sourceSocketID:".concat(t," currentSocketID:").concat(this._socketID);new ka("wsOnError").setMessage(n.errMsg||dt(n)).setMoreMessage(o).setLevel("error").end(),xe.w("".concat(this._n,"._onError"),n,o),t===this._socketID&&(this._readyState="",this._channelModule.onError())}},{key:"onMessage",value:function(e){var t;try{t=JSON.parse(e.data)}catch(c){new ka("jsonParseError").setMessage(e.data).end()}if(t&&t.head){var n=this._getRequestIDFromHead(t.head),o=t.body;if(!this._isTRTCCommand(n)){var s=Pt(t.head);o=Ei(t.body,this._getResponseKeyMap(s))}if(xe.d("".concat(this._n,".onMessage ret:").concat(JSON.stringify(o)," requestID:").concat(n," has:").concat(this._promiseMap.has(n))),this._setNextPingTs(),this._promiseMap.has(n)){var a=this._promiseMap.get(n),r=a.resolve,i=a.reject,u=a.timestamp;return this._promiseMap.delete(n),this._calcRTT(u),void(o.errorCode&&0!==o.errorCode?(this._channelModule.onErrorCodeNotZero(o),i(new Wa({code:o.errorCode,message:o.errorInfo||"",data:n.includes(Lo)||n.includes(ms)?{elements:o.elements,messageVersion:o.messageVersion,cloudCustomData:o.cloudCustomData}:void 0}))):r(Ka(o)))}this._channelModule.onMessage({head:t.head,body:o})}}},{key:"_isTRTCCommand",value:function(e){for(var t=this._channelModule.getModule(oo).getCommandList(),n=!1,o=0;o0&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,s=t.resolve,a=t.reject;e._promiseMap.set(n,{resolve:s,reject:a,timestamp:Date.now(),uplinkData:o}),e._execute(n,o)})),this._simpleRequestMap.size>0){var t,n=D(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=v(t.value,2),s=o[0],a=o[1];this._execute(s,a)}}catch(r){n.e(r)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:"send",value:function(e){var t=this;e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var n=g(e,Gi),o=this._getRequestIDFromHead(e.head),s=JSON.stringify(n);return new Promise((function(e,a){(t._promiseMap.set(o,{resolve:e,reject:a,timestamp:Date.now(),uplinkData:s}),xe.d("".concat(t._n,".send uplinkData:").concat(JSON.stringify(n)," requestID:").concat(o," readyState:").concat(t._readyState)),t._readyState!==Pi)?t._reConnect():(t._execute(o,s),t._channelModule.getModule($n).addRequestCount())}))}},{key:"simplySend",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var t=g(e,Ui),n=this._getRequestIDFromHead(e.head),o=JSON.stringify(t);this._readyState!==Pi?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:"onErrorCodeNotZero",value:function(e){this.getModule(jn).onErrorCodeNotZero(e)}},{key:"onMessage",value:function(e){this.getModule(jn).onMessage(e)}},{key:"send",value:function(e){return this._socketHandler?this._previousState!==S.NET_STATE_CONNECTED&&e.head.servcmd.includes(xs)?(this.reConnect(),this._sendLogViaHTTP(e)):this._socketHandler.send(e):Promise.reject()}},{key:"_sendLogViaHTTP",value:function(e){var t=V.HOST.CURRENT.STAT;return new Promise((function(n,o){var s="".concat(t,"/v4/imopenstat/tim_web_report_v2?sdkappid=").concat(e.head.sdkappid,"&reqtime=").concat(Date.now()),a=JSON.stringify(e.body),r="application/x-www-form-urlencoded;charset=UTF-8";if(se)re.request({url:s,data:a,method:"POST",timeout:3e3,header:{"content-type":r},success:function(){n()},fail:function(){o(new Wa({code:da.NETWORK_ERROR}))}});else{var i=new XMLHttpRequest,u=setTimeout((function(){i.abort(),o(new Wa({code:da.NETWORK_TIMEOUT}))}),3e3);i.onreadystatechange=function(){4===i.readyState&&(clearTimeout(u),200===i.status||304===i.status?n():o(new Wa({code:da.NETWORK_ERROR})))},i.open("POST",s,!0),i.setRequestHeader("Content-type",r),i.send(a)}}))}},{key:"simplySend",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:"onOpen",value:function(){this._ping()}},{key:"onClose",value:function(){this._socketHandler&&(this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED));this.reConnect()}},{key:"onError",value:function(){se&&!ne&&this.outputWarning("DomainNameInMP"),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"getKeyMap",value:function(e){return this.getModule(jn).getKeyMap(e)}},{key:"_onAppHide",value:function(){this._isAppShowing=!1}},{key:"_onAppShow",value:function(){this._isAppShowing=!0}},{key:"onRequestTimeout",value:function(e){}},{key:"onReconnected",value:function(){xe.l("".concat(this._n,".onReconnected")),this._m.restartTimer(),this.getModule(jn).onReconnected(),this._emitNetStateChangeEvent(S.NET_STATE_CONNECTED)}},{key:"onReconnectFailed",value:function(){xe.l("".concat(this._n,".onReconnectFailed")),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"setIsWorkerEnabled",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:"offline",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:"reConnect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1;this._socketHandler&&(t=this._socketHandler.getReconnectFlag());var n="forcedFlag:".concat(e," fatalErrorFlag:").concat(this._fatalErrorFlag," previousState:").concat(this._previousState," reconnectFlag:").concat(t);if(xe.l("".concat(this._n,".reConnect ").concat(n)),!this._fatalErrorFlag&&this._socketHandler){if(!0===e)this._socketHandler.forcedReconnect();else{if(this._previousState===S.NET_STATE_CONNECTING&&t)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(S.NET_STATE_CONNECTING)}}},{key:"_emitNetStateChangeEvent",value:function(e){this._previousState!==e&&(xe.l("".concat(this._n,"._emitNetStateChangeEvent from ").concat(this._previousState," to ").concat(e)),this._previousState=e,this.emitOuterEvent(E.NET_STATE_CHANGE,{state:e}))}},{key:"_ping",value:function(){var e=this;if(!0!==this._probing){this._probing=!0;var t=this.getModule(jn).getProtocolData({protocolName:Vs});this.send(t).then((function(){e._probing=!1})).catch((function(t){if(xe.w("".concat(e._n,"._ping failed. error:"),t),e._probing=!1,t&&60002===t.code)return new ka("error").setMessage("code:".concat(t.code," message:").concat(t.message)).setNetworkType(e.getModule(Bn).getNetworkType()).end(),e._fatalErrorFlag=!0,void e._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED);e.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];xe.l("".concat(e._n,"._ping failed. probe network, isAppShowing:").concat(e._isAppShowing," online:").concat(o," networkType:").concat(s)),o?e.reConnect():e._emitNetStateChangeEvent(S.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),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:"onRestApiKickedOut",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._previousState=S.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3)}}]),n}(ro),xi=["a2","tinyid"],Vi=["a2","tinyid"],Bi=function(){function e(t){o(this,e),this._n="ProtocolHandler",this._sessionModule=t,this._configMap=new Map,this._fillConfigMap()}return a(e,[{key:"_fillConfigMap",value:function(){this._configMap.clear();var e=this._sessionModule.genCommonHead(),n=this._sessionModule.genCosSpecifiedHead(),o=this._sessionModule.genSSOReportHead(),s=this._sessionModule.isIntl();this._configMap.set(io,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.LOGIN)}),body:{state:"Online",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:"InstType"},response:{InstId:"instanceID",HelloInterval:"helloInterval"}}}}(e)),this._configMap.set(uo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.LOGOUT)}),body:{type:0},keyMap:{request:{type:"wslogout_type"}}}}(e)),this._configMap.set(co,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(lo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.STAT_SERVICE,".").concat(V.CMD.KICK_OTHER)}),body:{}}}(e)),this._configMap.set(ws,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_COS_SIGN,".").concat(V.CMD.COS_SIGN)}),body:{cmd:"open_im_cos_svc",subCmd:"get_cos_token",duration:300,version:2},keyMap:{request:{userSig:"usersig",subCmd:"sub_cmd",cmd:"cmd",duration:"duration",version:"version"},response:{expired_time:"expiredTime",bucket_name:"bucketName",session_token:"sessionToken",tmp_secret_id:"secretId",tmp_secret_key:"secretKey"}}}}(n)),this._configMap.set(Fs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.CUSTOM_UPLOAD,".").concat(V.CMD.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:"usersig",fileType:"file_type",fileName:"file_name",uploadMethod:"upload_method"},response:{expired_time:"expiredTime",request_id:"requestId",head_url:"headUrl",upload_url:"uploadUrl",download_url:"downloadUrl",ci_url:"ciUrl",snapshot_url:"requestSnapshotUrl"}}}}(n)),this._configMap.set(qs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.CUSTOM_UPLOAD,".").concat(V.CMD.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:"version",platform:"platform",coverName:"cover_name",requestSnapshotUrl:"snapshot_url"},response:{error_code:"errorCode",error_msg:"errorInfo",download_url:"snapshotUrl"}}}}(n)),this._configMap.set(Xs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:"uint32_sdkappid"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(Qs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_purchase_bits:"purchaseBits",uint32_expired_time:"expiredTime"}}}}(e)),this._configMap.set(zs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.FETCH_CLOUD_CONTROL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:"uint32_sdkappid",version:"uint64_version"},response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(Js,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_CONFIG_MANAGER,".").concat(V.CMD.PUSHED_CLOUD_CONTROL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:"errorCode",str_error_message:"errorMessage",str_json_config:"cloudControlConfig",uint32_expired_time:"expiredTime",uint32_sdkappid:"SDKAppID",uint64_version:"version"}}}}(e)),this._configMap.set(Zs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OVERLOAD_PUSH,".").concat(V.CMD.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:"overloadCommand",DelaySecs:"waitingTime"}}}}(e)),this._configMap.set(po,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_MESSAGES)}),body:{cookie:"",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",from:"From_Account",to:"To_Account",time:"MsgTimeStamp",sequence:"MsgSeq",random:"MsgRandom",elements:"MsgBody"},response:{MsgList:"messageList",SyncFlag:"syncFlag",To_Account:"to",From_Account:"from",ClientSeq:"clientSequence",MsgSeq:"sequence",NoticeSeq:"noticeSequence",NotifySeq:"notifySequence",MsgRandom:"random",MsgTimeStamp:"time",MsgContent:"content",ToGroupId:"to",MsgKey:"messageKey",GroupTips:"groupTips",MsgBody:"elements",MsgType:"type",C2CRemainingUnreadCount:"C2CRemainingUnreadList",C2CPairUnreadCount:"C2CPairUnreadList"}}}}(e)),s||(this._configMap.set(go,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.BIG_DATA_HALLWAY_AUTH_KEY)}),body:{}}}(e)),this._configMap.set(la,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_MSG_AUDIT_MGR,".").concat(V.CMD.GET_RPOFANITY_LIST)}),body:{version:0,deviceID:"",startIndex:void 0},keyMap:{request:{version:"uint64_version",deviceID:"str_device_id",startIndex:"uint64_start_index"},response:{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"}}}}(e))),this._configMap.set(_o,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SEND_MESSAGE)}),body:{fromAccount:"",toAccount:"",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:"",avatar:"",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0},keyMap:{request:{fromAccount:"From_Account",toAccount:"To_Account",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom",msgBody:"MsgBody",count:"MaxCnt",lastMessageTime:"LastMsgTime",messageKey:"MsgKey",peerAccount:"Peer_Account",data:"Data",description:"Desc",extension:"Ext",type:"MsgType",content:"MsgContent",sizeType:"Type",uuid:"UUID",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"}}}}(e)),this._configMap.set(ho,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SEND_GROUP_MESSAGE)}),body:{fromAccount:"",groupID:"",random:0,clientSequence:0,priority:"",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:"",desc:"",ext:"",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:""}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0},keyMap:{request:{to:"GroupId",extension:"Ext",data:"Data",description:"Desc",random:"Random",sequence:"ReqMsgSeq",count:"ReqMsgNumber",type:"MsgType",priority:"MsgPriority",content:"MsgContent",elements:"MsgBody",sizeType:"Type",uuid:"UUID",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"},response:{MsgTime:"time",MsgSeq:"sequence"}}}}(e)),this._configMap.set(Io,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.REVOKE_C2C_MESSAGE)}),body:{msgInfo:{fromAccount:"",toAccount:"",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:"MsgInfo",msgTimeStamp:"MsgTimeStamp",msgSeq:"MsgSeq",msgRandom:"MsgRandom"}}}}(e)),this._configMap.set(ss,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.REVOKE_GROUP_MESSAGE)}),body:{groupID:"",msgSeqList:void 0,topicID:""},keyMap:{request:{msgSeqList:"MsgSeqList",msgSeq:"MsgSeq"}}}}(e)),this._configMap.set(Eo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_C2C_ROAM_MESSAGES)}),body:{peerAccount:"",count:15,lastMessageTime:0,messageKey:"",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:"MsgKey",peerAccount:"Peer_Account",count:"MaxCnt",lastMessageTime:"LastMsgTime",withRecalledMessage:"WithRecalledMsg",direction:"GetDirection"},response:{LastMsgTime:"lastMessageTime",IsNeedReadReceipt:"needReadReceipt",IsPeerRead:"readReceiptSentByPeer"}}}}(e)),this._configMap.set(Lo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.MODIFY_C2C_MESSAGE)}),body:{from:"",to:"",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(is,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_ROAM_MESSAGES)}),body:{withRecalledMsg:1,groupID:"",count:15,sequence:"",topicID:void 0},keyMap:{request:{sequence:"ReqMsgSeq",count:"ReqMsgNumber",withRecalledMessage:"WithRecalledMsg"},response:{Random:"random",MsgTime:"time",MsgSeq:"sequence",ReqMsgSeq:"sequence",RspMsgList:"messageList",IsPlaceMsg:"isPlaceMessage",IsSystemMsg:"isSystemMessage",ToGroupId:"to",EnumFrom_AccountType:"fromAccountType",EnumTo_AccountType:"toAccountType",GroupCode:"groupCode",MsgPriority:"priority",MsgBody:"elements",MsgType:"type",MsgContent:"content",IsFinished:"complete",Download_Flag:"downloadFlag",ClientSeq:"clientSequence",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID",ToTopicId:"topicID",InvisibleMsgSeq:"invisibleSequenceList"}}}}(e)),this._configMap.set(Co,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SET_C2C_MESSAGE_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:"LastedMsgTime"}}}}(e)),this._configMap.set(To,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:"Peer_Account",muteFlag:"Mute_Notifications"}}}}(e)),this._configMap.set(Do,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{updateSequence:0},keyMap:{response:{MuteNotificationsList:"muteFlagList"}}}}(e)),this._configMap.set(as,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SET_GROUP_MESSAGE_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:"MsgReadedSeq"}}}}(e)),this._configMap.set(rs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SET_ALL_MESSAGE_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:"C2CReadAllMsg",groupMessageReadInfoList:"GroupReadInfo",messageSequence:"MsgSeq"},response:{C2CReadAllMsg:"readAllC2CMessage",GroupReadInfoArray:"groupMessageReadInfoList"}}}}(e)),this._configMap.set(ko,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.DELETE_C2C_MESSAGE)}),body:{fromAccount:"",to:"",keyList:void 0},keyMap:{request:{keyList:"MsgKeyList"}}}}(e)),this._configMap.set(vs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DELETE_GROUP_MESSAGE)}),body:{groupID:"",deleter:"",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:"Deleter_Account",keyList:"Seqs"}}}}(e)),this._configMap.set(pa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_TRANSLATE,".").concat(V.CMD.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:"",target:""},keyMap:{request:{sourceTextList:"SourceText",SDKAppID:"SdkAppId",from:"FromAccount"},response:{TargetText:"translatedTextList",RequestId:"requestID",CmdErrorCode:"error",ErrorCode:"code",ErrorInfo:"message"}}}}(e)),this._configMap.set(ms,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.MODIFY_GROUP_MESSAGE)}),body:{groupID:"",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:"MsgSeq",version:"MsgVersion",type:"MsgType",content:"MsgContent"}}}}(e)),this._configMap.set(us,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequence:"MsgSeq"}}}}(e)),this._configMap.set(ls,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:"",messageInfoList:void 0},keyMap:{request:{peerAccount:"Peer_Account",messageInfoList:"C2CMsgInfo",fromAccount:"From_Account",toAccount:"To_Account",sequence:"MsgSeq",random:"MsgRandom",time:"MsgTime",clientTime:"MsgClientTime"}}}}(e)),this._configMap.set(cs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SEND_READ_RECEIPT)}),body:{groupID:"",sequenceList:void 0},keyMap:{request:{sequenceList:"MsgSeqList",sequence:"MsgSeq"}}}}(e)),this._configMap.set(ps,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_READ_RECEIPT_DETAIL)}),body:{groupID:"",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:"MsgSeq",count:"Num"},response:{ReadList:"readUserIDList",Read_Account:"userID",UnreadList:"unreadUserIDList",Unread_Account:"userID",IsFinish:"isCompleted"}}}}(e)),this._configMap.set(Ao,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.MODIFY_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Ro,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.GET_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}}(e)),this._configMap.set(Ds,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.MODIFY_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Es,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM_MSG_EXT,".").concat(V.CMD.GET_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}}(e)),this._configMap.set(So,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.GET_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:"To_Account"},response:{ReadTime:"peerReadTimeList"}}}}(e)),this._configMap.set(Oo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,count:0},keyMap:{request:{},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime"}}}}(e)),this._configMap.set(No,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.PAGING_GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:4,assistFlag:15},keyMap:{request:{messageAssistFlag:"MsgAssistFlags",assistFlag:"AssistFlags",pinnedTimeStamp:"TopTimeStamp",pinnedStartIndex:"TopStartIndex"},response:{SessionItem:"conversations",ToAccount:"groupID",To_Account:"userID",UnreadMsgCount:"unreadCount",MsgGroupReadedSeq:"messageReadSeq",C2cPeerReadTime:"c2cPeerReadTime",LastMsgFlags:"lastMessageFlag",TopFlags:"isPinned",TopTimeStamp:"pinnedTimeStamp",TopStartIndex:"pinnedStartIndex",GroupId:"convGroupID"}}}}(e)),this._configMap.set(Go,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.DELETE_CONVERSATION)}),body:{fromAccount:"",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:"ToGroupid",clearHistoryMessage:"ClearRamble",conversationList:"ContactItem"},response:{ResultItem:"resultList",ToGroupid:"groupID",ResultCode:"code",ResultInfo:"info"}}}}(e)),this._configMap.set(Uo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.CLEAR_HISTORY_MESSAGE)}),body:{fromAccount:"",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:"ToGroupid"}}}}(e)),this._configMap.set(Po,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.PIN_CONVERSATION)}),body:{fromAccount:"",operationType:1,itemList:void 0},keyMap:{request:{itemList:"RecentContactItem"}}}}(e)),this._configMap.set(bo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.DELETE_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(wo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(Fo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.MARK_CONVERSATION)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"MarkItem",operationType:"OptType",groupID:"ToGroupId"},response:{ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(qo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.CREATE_CONVERSATION_GROUP)}),body:{fromAccount:"",itemList:void 0},keyMap:{request:{itemList:"GroupContactItem",groupID:"ToGroupId"},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType"}}}}(e)),this._configMap.set(xo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.DELETE_CONVERSATION_GROUP)}),body:{fromAccount:"",groupName:void 0},keyMap:{request:{},response:{GroupId:"convGroupID"}}}}(e)),this._configMap.set(Vo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:"OldGroupName",newName:"NewGroupName",groupID:"ToGroupId",operationType:"ContactOptType",groupName:"OldGroupName",updateItem:"ContactUpdateItem"},response:{ContactOptType:"operationType",ToGroupId:"groupID",GroupId:"convGroupID"}}}}(e)),this._configMap.set(Bo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Ho,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:"",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Ko,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.RECENT_CONTACT,".").concat(V.CMD.GET_CONVERSATION_GROUP_LIST)}),body:{fromAccount:"",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:"convGroupID",ToGroupId:"groupID",OptType:"operationType",CustomMark:"customData",ContactGroupId:"convGroupIDList"}}}}(e)),this._configMap.set(fo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.PROFILE,".").concat(V.CMD.PORTRAIT_GET)}),body:{fromAccount:"",userItem:[]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(vo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.PROFILE,".").concat(V.CMD.PORTRAIT_SET)}),body:{fromAccount:"",profileItem:[{tag:Be.NICK,value:""},{tag:Be.GENDER,value:""},{tag:Be.ALLOWTYPE,value:""},{tag:Be.AVATAR,value:""}]},keyMap:{request:{toAccount:"To_Account",standardSequence:"StandardSequence",customSequence:"CustomSequence"}}}}(e)),this._configMap.set(mo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.FRIEND,".").concat(V.CMD.GET_BLACKLIST)}),body:{fromAccount:"",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:"currentSequence"}}}}(e)),this._configMap.set(Mo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.FRIEND,".").concat(V.CMD.ADD_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(yo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.FRIEND,".").concat(V.CMD.DELETE_BLACKLIST)}),body:{fromAccount:"",toAccount:[]}}}(e)),this._configMap.set(oa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.SET_SELF_STATUS)}),body:{customStatus:""},keyMap:{}}}(e)),this._configMap.set(sa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:"successUserList",ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID",Status:"statusType"}}}}(e)),this._configMap.set(aa,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.SUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(ra,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.UNSUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:"failureUserList",To_Account:"userID",Invalid_Account:"invalidUserID"}}}}(e)),this._configMap.set(Wo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_JOINED_GROUPS)}),body:{memberAccount:"",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:"Member_Account"},response:{GroupIdList:"groups",NoUnreadSeqList:"excludedUnreadSequenceList",MsgSeq:"readedSequence",LastRecallTime:"_lastRevokedTime"}}}}(e)),this._configMap.set(Yo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_INFO)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","Owner_Account","CreateTime","InfoSeq","LastInfoTime","LastMsgTime","MemberNum","MaxMemberNum","ApplyJoinOption","NextMsgSeq","ShutUpAllMember"],groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:"GroupIdList",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",groupCustomFieldFilter:"AppDefinedDataFilter_Group",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{GroupIdList:"groups",AppDefinedData:"groupCustomField",AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_Group:"groupCustomFieldFilter",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",InfoSeq:"infoSequence",MemberList:"members",GroupInfo:"groups",ShutUpUntil:"muteUntil",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(jo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.CREATE_GROUP)}),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:{request:{ownerID:"Owner_Account",userID:"Member_Account",avatar:"FaceUrl",maxMemberNum:"MaxMemberCount",joinOption:"ApplyJoinOption",groupCustomField:"AppDefinedData",memberCustomField:"AppMemberDefinedData",inviteOption:"InviteJoinOption"},response:{HugeGroupFlag:"avChatRoomFlag",OverJoinedGroupLimit_Account:"overLimitUserIDList"}}}}(e)),this._configMap.set(zo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DESTROY_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(Jo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.MODIFY_GROUP_INFO)}),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:{request:{groupCustomField:"AppDefinedData",muteAllMembers:"ShutUpAllMember",joinOption:"ApplyJoinOption",avatar:"FaceUrl",inviteOption:"InviteJoinOption"},response:{AppDefinedData:"groupCustomField",ShutUpAllMember:"muteAllMembers"}}}}(e)),this._configMap.set(Xo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:"ApplyMsg",historyMessageFlag:"HugeGroupHistoryMsgFlag"},response:{HugeGroupFlag:"avChatRoomFlag",AVChatRoomKey:"avChatRoomKey",RspMsgList:"messageList",ToGroupId:"to"}}}}(e)),this._configMap.set(Qo,function(e){return e.a2,e.tinyid,{head:t(t({},g(e,xi)),{},{servcmd:"".concat(V.NAME.BIG_GROUP_NO_AUTH,".").concat(V.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:"ApplyMsg"},response:{HugeGroupFlag:"avChatRoomFlag"}}}}(e)),this._configMap.set(Zo,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.QUIT_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set($o,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SEARCH_GROUP_BY_ID)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:["Type","Name","Introduction","Notification","FaceUrl","CreateTime","Owner_Account","LastInfoTime","LastMsgTime","NextMsgSeq","MemberNum","MaxMemberNum","ApplyJoinOption","InviteJoinOption"]}},keyMap:{response:{}}}}(e)),this._configMap.set(es,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.CHANGE_GROUP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:"NewOwner_Account"}}}}(e)),this._configMap.set(ts,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.HANDLE_APPLY_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(ns,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.HANDLE_INVITE_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:"Applicant_Account",invitee:"Invited_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg"}}}}(e)),this._configMap.set(os,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.HANDLE_GROUP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:"Inviter_Account",handleAction:"HandleMsg",handleMessage:"ApprovalMsg",messageKey:"MsgKey"}}}}(e)),this._configMap.set(ds,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_APPLICATION)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:"Handle_Account"},response:{To_Account:"userID"}}}}(e)),this._configMap.set(gs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.DELETE_GROUP_SYSTEM_MESSAGE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:"DelMsgList",messageSeq:"MsgSeq",messageRandom:"MsgRandom"}}}}(e)),this._configMap.set(_s,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.BIG_GROUP_LONG_POLLING,".").concat(V.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(hs,function(e){return e.a2,e.tinyid,{head:t(t({},g(e,Vi)),{},{servcmd:"".concat(V.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,".").concat(V.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:"USP"},response:{ToGroupId:"groupID",RspBroadcastMsgList:"broadcastMessageList",IsSystemMsg:"isSystemMessage"}}}}(e)),this._configMap.set(fs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_ONLINE_MEMBER_NUM)}),body:{groupID:void 0}}}(e)),this._configMap.set(Ms,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.SET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(ys,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.MODIFY_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key",value:"value"}}}}(e)),this._configMap.set(Is,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DELETE_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]},keyMap:{request:{key:"key"}}}}(e)),this._configMap.set(Cs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.CLEAR_GROUP_ATTRIBUTES)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:["RaceConflict"]}}}(e)),this._configMap.set(Ts,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_ATTR,".").concat(V.CMD.GET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:"Key",groupType:"GroupType"}}}}(e)),this._configMap.set(Ss,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_NOTIFY)}),body:{notifyType:1,groupID:"",beginTime:0,endTime:0,limit:20},keyMap:{request:{},response:{NextMsgTime:"nextRevokedTime",NotifyMsgList:"notifyList"}}}}(e)),this._configMap.set(ks,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.UPDATE_GROUP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:"GroupCounter"}}}}(e)),this._configMap.set(Ls,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:"GroupCounterKeys"}}}}(e)),this._configMap.set($s,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.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:{request:{avatar:"FaceUrl"}}}}(e)),this._configMap.set(ea,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.DELETE_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:"TopicIdList"},response:{DestroyResultItem:"resultList"}}}}(e)),this._configMap.set(ta,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.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:{request:{avatar:"FaceUrl",muteAllMembers:"ShutUpAllMember"}}}}(e)),this._configMap.set(na,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_COMMUNITY,".").concat(V.CMD.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:["NoUnreadSeqList"]},keyMap:{request:{topicIDList:"TopicIdList"},response:{TopicAndSelfInfo:"topicInfoList",TopicInfo:"topic",GroupID:"groupID",ShutUpTime:"muteTime",ShutUpAllFlag:"muteAllMembers",LastMsgTime:"lastMessageTime",MsgSeq:"readedSequence",LastMsgSeq:"sequence",NoUnreadSeqList:"excludedUnreadSequenceList"}}}}(e)),this._configMap.set(As,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_MEMBER_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:["Role","NameCard","ShutUpUntil","JoinTime"],memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{AppMemberDefinedData:"memberCustomField",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",MemberList:"members",ShutUpUntil:"muteUntil"}}}}(e)),this._configMap.set(Rs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_AVCHATROOM,".").concat(V.CMD.GET_AVCHATROOM_MEMBER_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:"Timestamp",filter:"Mark"},response:{NextTimestamp:"offset"}}}}(e)),this._configMap.set(Ns,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.GET_GROUP_MEMBER_INFO)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:"Member_List_Account",memberCustomFieldFilter:"AppDefinedDataFilter_GroupMember"},response:{MemberList:"members",ShutUpUntil:"muteUntil",AppDefinedDataFilter_GroupMember:"memberCustomFieldFilter",AppMemberDefinedData:"memberCustomField"}}}}(e)),this._configMap.set(Os,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.ADD_GROUP_MEMBER)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:"Member_Account",userIDList:"MemberList"},response:{MemberList:"members"}}}}(e)),this._configMap.set(Gs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.DELETE_GROUP_MEMBER)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:"MemberToDel_Account"}}}}(e)),this._configMap.set(Us,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.BAN_AVCHATROOM_MEMBER)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:""},keyMap:{request:{userIDList:"Members_Account",duration:"Duration",reason:"Description"}}}}(e)),this._configMap.set(Ps,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP,".").concat(V.CMD.MODIFY_GROUP_MEMBER_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:{request:{userID:"Member_Account",memberCustomField:"AppMemberDefinedData",muteTime:"ShutUpTime",messageRemindType:"MsgFlag"}}}}(e)),this._configMap.set(bs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.GROUP_AVCHATROOM,".").concat(V.CMD.MARK_AVCHATROOM_MEMBER_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:"CommandType",memberList:"MemberList",markType:"Marks",userID:"Member_Account"},response:{CommandType:"operationType",Marks:"markType",Member_Account:"userID"}}}}(e)),this._configMap.set(xs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STAT,".").concat(V.CMD.TIM_WEB_REPORT_V2)}),body:{header:{},event:[],quality:[]},keyMap:{request:{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"}}}}(o)),this._configMap.set(Vs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.HEARTBEAT,".").concat(V.CMD.ALIVE)}),body:{}}}(e)),this._configMap.set(Bs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_PUSH,".").concat(V.CMD.MESSAGE_PUSH)}),body:{},keyMap:{response:{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"}}}}(e)),this._configMap.set(Hs,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_PUSH,".").concat(V.CMD.MULTI_MESSAGE_PUSH)}),body:{},keyMap:{response:{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"}}}}(e)),this._configMap.set(Ks,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.OPEN_IM,".").concat(V.CMD.MESSAGE_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:"SessionData"}}}}(e)),this._configMap.set(Ws,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:"C2CNotifyMessageArray",NoticeSeq:"noticeSequence",KickoutMsgNotify:"kickoutMsgNotify",NewInstInfo:"newInstanceInfo"}}}}(e)),this._configMap.set(js,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_LONG_MESSAGE,".").concat(V.CMD.DOWNLOAD_MERGER_MESSAGE)}),body:{downloadKey:""},keyMap:{response:{Data:"data",Desc:"description",Ext:"extension",Download_Flag:"downloadFlag",ThumbUUID:"thumbUUID",VideoUUID:"videoUUID"}}}}(e)),this._configMap.set(Ys,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_LONG_MESSAGE,".").concat(V.CMD.UPLOAD_MERGER_MESSAGE)}),body:{messageList:[]},keyMap:{request:{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"}}}}(e)),this._configMap.set(ca,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.SET_TOKEN)}),body:{tokenID:"",pushMsg:0,sdkAppID:0,businessID:"",deviceBrand:"",deviceToken:"",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:"TokenID",pushMsg:"PushMsg",sdkAppID:"EnterVersion",businessID:"BusiID",deviceBrand:"InstType",deviceToken:"VarToken",isTpns:"IsTpns"}}}}(e)),this._configMap.set(ua,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.STAT_FOREGROUND)}),body:{isWebUniapp:0}}}(e)),this._configMap.set(ia,function(e){return{head:t(t({},e),{},{servcmd:"".concat(V.NAME.IM_OPEN_STATUS,".").concat(V.CMD.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:"C2cUnread",groupUnreadCount:"GrpUnread"}}}}(e))}},{key:"has",value:function(e){return this._configMap.has(e)}},{key:"get",value:function(e){return this._configMap.get(e)}},{key:"update",value:function(){this._fillConfigMap()}},{key:"getKeyMap",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(xe.w("".concat(this._n,".getKeyMap unknown protocolName:").concat(e)),{})}},{key:"getProtocolData",value:function(e){var t=e.protocolName,n=e.requestData,o=this.get(t),s=null;if(n){var a=this._simpleDeepCopy(o),r=this._updateService(n,a),i=r.body,u=Object.create(null);for(var c in i)if(Object.prototype.hasOwnProperty.call(i,c)){if(u[c]=i[c],void 0===n[c])continue;u[c]=n[c]}r.body=u,s=this._getUplinkData(r)}else s=this._getUplinkData(o);return s}},{key:"_getUplinkData",value:function(e){var t=this._requestDataCleaner(e),n=Pt(t.head),o=Di(t.body,this._getRequestKeyMap(n));return t.body=o,t}},{key:"_updateService",value:function(e,t){var n=Pt(t.head);if(this._isFromGroupRequest(t)){var o=e.type,s=e.groupID,a=void 0===s?void 0:s,r=e.groupIDList,i=void 0===r?[]:r;at(a)&&(a=i[0]||""),Tt({type:o,groupID:a})&&(t.head.servcmd="".concat(V.NAME.GROUP_COMMUNITY,".").concat(n))}return t}},{key:"_isFromGroupRequest",value:function(e){return e.head.servcmd.includes(V.NAME.GROUP)||e.head.servcmd.includes(V.NAME.GROUP_ATTR)}},{key:"_getRequestKeyMap",value:function(e){var n=this.getKeyMap(e);return t(t({},Ii.request),n.request)}},{key:"_requestDataCleaner",value:function(e){var t=Array.isArray(e)?[]:Object.create(null);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&<(o)&&null!==e[o]&&void 0!==e[o]&&("object"!==n(e[o])?t[o]=e[o]:t[o]=this._requestDataCleaner.bind(this)(e[o]));return t}},{key:"_simpleDeepCopy",value:function(e){for(var t,n=Object.keys(e),o={},s=0,a=n.length;s1e3*s)return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;i+=1,this._commandRequestInfoMap.set(t,{startTime:r,requestCount:i});var u=!1;return i>o&&(u=!0),u}},{key:"_isServerOverload",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var t=this._serverOverloadInfoMap.get(e),n=t.overloadTime,o=t.waitingTime,s=!1;return Date.now()-n<=1e3*o?s=!0:(this._serverOverloadInfoMap.delete(e),s=!1),s}},{key:"onPushedServerOverload",value:function(e){var t=e.overloadCommand,n=e.waitingTime;this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:n}),xe.w("".concat(this._n,".onPushedServerOverload waitingTime:").concat(n,"s"))}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._updateCommandFrequencyLimitMap(Wi),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear()}}]),s}(ro),ji=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="MessageLossDetectionModule",s._maybeLostSequencesMap=new Map,s._firstRoundRet=[],s}return a(n,[{key:"onMessageMaybeLost",value:function(e,t,n){this._maybeLostSequencesMap.has(e)||this._maybeLostSequencesMap.set(e,[]);for(var o=this._maybeLostSequencesMap.get(e),s=0;s=this._expiredTime}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetchConfig();if(xe.l("".concat(this._n,".fetchConfig canFetchConfig:").concat(t)),t){var n=new ka("fetchCloudControlConfig"),o=this.getModule(qn).getSDKAppID();this._isFetching=!0,this.request({protocolName:zs,requestData:{SDKAppID:o,version:this._version}}).then((function(t){e._isFetching=!1,n.setMessage("version:".concat(e._version," newVersion:").concat(t.data.version," config:").concat(t.data.cloudControlConfig)).setNetworkType(e.getNetworkType()).end(),xe.l("".concat(e._n,".fetchConfig ok")),e._parseCloudControlConfig(t.data)})).catch((function(t){e._isFetching=!1,e.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];n.setError(t,s,a).end()})),xe.l("".concat(e._n,".fetchConfig failed. error:"),t),e._setExpiredTimeOnResponseError(12e4)}))}}},{key:"onPushedCloudControlConfig",value:function(e){xe.l("".concat(this._n,".onPushedCloudControlConfig")),new ka("pushedCloudControlConfig").setNetworkType(this.getNetworkType()).setMessage("newVersion:".concat(e.version," config:").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:"onCheckTimer",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:"_parseCloudControlConfig",value:function(e){var t=this,n="".concat(this._n,"._parseCloudControlConfig"),o=e.errorCode,s=e.errorMessage,a=e.cloudControlConfig,r=e.version,i=e.expiredTime;if(0===o){if(this._version!==r){var u=null;try{u=JSON.parse(a)}catch(c){this.isPrivateNetWork()||xe.e("".concat(n," JSON parse error. cloudControlConfig:"),a)}u&&(this._cloudConfig.clear(),Object.keys(u).forEach((function(e){t._cloudConfig.set(e,u[e])})),this._version=r,this.emitInnerEvent($a))}this._expiredTime=Date.now()+1e3*i}else at(o)?(xe.l("".concat(n," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(xe.e("".concat(n," errorCode:").concat(o," errorMessage:").concat(s)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(ro),Ji=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="RecoverMessageModule",s.PULL_LIMIT_COUNT=15,s}return a(n,[{key:"start",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:"_recoverGroupChat",value:function(){var e,t,n=this,o=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),s=this.getModule(Fn),a=0,r=0,i=0;o.forEach((function(o){var u=o.conversationID,c=o.lastMessage;t=u.replace(S.CONV_GROUP,""),e=s.getLocalLastMessage(u),c&&0!==c.lastSequence&&e?(r=c.lastSequence,a=e.sequence,i=r-a,a>0&&i>=1&&i<300?n._recoverGroupMessage({groupID:t,localLastMessageSequence:a,remoteLastMessageSequence:r}):n._getGroupNotify(t)):n._getGroupNotify(t)}))}},{key:"_recoverC2CChat",value:function(){var e,t=this,n=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C})),o=this.getModule(Fn),s=0,a=0,r=0,i=[Promise.resolve()];n.forEach((function(n){var u=n.conversationID,c=n.lastMessage;e=o.getLocalLastMessage(u),c&&0!==c.lastTime&&e&&(a=c.lastTime,s=e.time,r=a-s,s>0&&r>=1&&r<=600&&i.push(t._recoverC2CMessage({conversationID:u,localLastMessageTime:s,remoteLastMessageTime:a})))})),Promise.all(i).then((function(){xe.l("".concat(t._n,"._recoverC2CChat all promise fulfilled, start to sync unread messages")),t.getModule(Yn).startSyncOnReconnected()}))}},{key:"_getLocalConversationList",value:function(){return this.getModule(Fn).getLocalConversationList()}},{key:"_recoverGroupMessage",value:function(e){var t=this,n="".concat(this._n,"._recoverGroupMessage");xe.l("".concat(n," options:"),e);var o=e.groupID,s=e.localLastMessageSequence,a=e.remoteLastMessageSequence;this._getGroupRomaingMessage({groupID:o,sequence:s}).then((function(e){var s=e.data,r=s.complete,i=s.messageList;if(!at(i)){var u=i[0].sequence;xe.l("".concat(n," pkgLastMessageSequence:").concat(u," complete:").concat(r)),u1&&i.sort((function(e,t){return e.sequence-t.sequence}));for(var l=0;l=0&&this._e2eDelayArray.push(t)}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),bt(n/t,1)}},{key:"_calcCountWithLimit",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e100&&(n=100),n}},{key:"_checkE2EDelayException",value:function(e,t){var n=e.filter((function(e){return e>t}));if(n.length>0){var o=n.length,s=Math.min.apply(Math,m(n)),a=Math.max.apply(Math,m(n)),r=this._calcAvg(n,o),i=bt(o/e.length*100,2);if(i>50)new ka("messageE2EDelayException").setMessage("count:".concat(o," min:").concat(s," max:").concat(a," avg:").concat(r," percent:").concat(i)).setLevel("warning").end()}}},{key:"getStatResult",value:function(){var e=this._e2eDelayArray.length;if(0===e)return null;var t=m(this._e2eDelayArray),n=this._calcCountWithLimit({e2eDelayArray:t,min:0,max:1}),o=this._calcCountWithLimit({e2eDelayArray:t,min:1,max:3}),s=this._calcPercent(n,e),a=this._calcPercent(o,e),r=this._calcAvg(t,e);return this._checkE2EDelayException(t,3),t.length=0,this.reset(),{totalCount:e,countLessThan1Second:n,percentOfCountLessThan1Second:s,countLessThan3Second:o,percentOfCountLessThan3Second:a,avgDelay:r}}},{key:"reset",value:function(){this._e2eDelayArray.length=0}}]),e}(),Qi=function(){function e(){o(this,e),this._n="AvgRTT",this._requestCount=0,this._rttArray=[]}return a(e,[{key:"addRequestCount",value:function(){this._requestCount+=1}},{key:"addRTT",value:function(e){this._rttArray.push(e)}},{key:"_calcTotalCount",value:function(){return this._requestCount}},{key:"_calcRTTCount",value:function(e){return e.length}},{key:"_calcSuccessRateOfRequest",value:function(e,t){if(0===t)return 0;var n=bt(e/t*100,2);return n>100&&(n=100),n}},{key:"_calcAvg",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcMax",value:function(){return Math.max.apply(Math,m(this._rttArray))}},{key:"_calcMin",value:function(){return Math.min.apply(Math,m(this._rttArray))}},{key:"getStatResult",value:function(){var e=this._calcTotalCount(),t=m(this._rttArray);if(0===e)return null;var n=this._calcRTTCount(t),o=this._calcSuccessRateOfRequest(n,e),s=this._calcAvg(t,n);return xe.l("".concat(this._n,".getStatResult max:").concat(this._calcMax()," min:").concat(this._calcMin()," avg:").concat(s)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:s}}},{key:"reset",value:function(){this._requestCount=0,this._rttArray.length=0}}]),e}(),Zi=function(){function e(){o(this,e),this._map=new Map}return a(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:"addTotalCount",value:function(e){return!(at(e)||!this._map.has(e))&&(this._map.get(e).totalCount+=1,!0)}},{key:"addSuccessCount",value:function(e){return!(at(e)||!this._map.has(e))&&(this._map.get(e).successCount+=1,!0)}},{key:"addFailedCountOfUserSide",value:function(e){return!(at(e)||!this._map.has(e))&&(this._map.get(e).failedCountOfUserSide+=1,!0)}},{key:"addCost",value:function(e,t){return!(at(e)||!this._map.has(e))&&(this._map.get(e).costArray.push(t),!0)}},{key:"addFileSize",value:function(e,t){return!(at(e)||!this._map.has(e))&&(this._map.get(e).fileSizeArray.push(t),!0)}},{key:"_calcSuccessRateOfBusiness",value:function(e){if(at(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=bt(t.successCount/t.totalCount*100,2);return n>100&&(n=100),n}},{key:"_calcSuccessRateOfPlatform",value:function(e){if(at(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=this._calcSuccessCountOfPlatform(e)/t.totalCount*100;return(n=bt(n,2))>100&&(n=100),n}},{key:"_calcTotalCount",value:function(e){return at(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:"_calcSuccessCountOfBusiness",value:function(e){return at(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:"_calcSuccessCountOfPlatform",value:function(e){if(at(e)||!this._map.has(e))return-1;var t=this._map.get(e);return t.successCount+t.failedCountOfUserSide}},{key:"_calcAvg",value:function(e){return at(e)||!this._map.has(e)?-1:e===Ma?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:"_calcAvgCost",value:function(e){var t=this._map.get(e).costArray.length;if(0===t)return 0;var n=0;return this._map.get(e).costArray.forEach((function(e){n+=e})),parseInt(n/t)}},{key:"_calcAvgSpeed",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:"getStatResult",value:function(e){var t=this._calcTotalCount(e);if(0===t)return null;var n=this._calcSuccessCountOfBusiness(e),o=this._calcSuccessRateOfBusiness(e),s=this._calcSuccessCountOfPlatform(e),a=this._calcSuccessRateOfPlatform(e),r=this._calcAvg(e);return this.reset(e),{totalCount:t,successCountOfBusiness:n,successRateOfBusiness:o,successCountOfPlatform:s,successRateOfPlatform:a,avgValue:r}}},{key:"reset",value:function(e){at(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),e}(),$i=function(){function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}return a(e,[{key:"initMap",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:"addMessageSequence",value:function(e){var t=e.key,n=e.message;if(at(t)||!this._lastMap.has(t)||!this._currentMap.has(t))return!1;var o=n.conversationID,s=n.sequence,a=o.replace(S.CONV_GROUP,"");if(0===this._lastMap.get(t).size)this._addCurrentMap(e);else if(this._lastMap.get(t).has(a)){var r=this._lastMap.get(t).get(a),i=r.length-1;s>r[0]&&s100&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}}},{key:"reset",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),eu=function(e){i(s,e);var n=f(s);function s(e){var t;o(this,s),(t=n.call(this,e))._n="QualityStatModule",t.TAG="im-ssolog-quality-stat",t.reportIndex=0,t.wholePeriod=!1,t._qualityItems=[ga,_a,ha,fa,va,ma,Ma,ya,Ia,Ca],t._messageSentItems=[ha,fa,va,ma,Ma],t._messageReceivedItems=[ya,Ia,Ca],t.REPORT_INTERVAL=120,t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._statInfoArr=[],t._avgRTT=new Qi,t._avgE2EDelay=new Xi,t._rateMessageSent=new Zi,t._rateMessageReceived=new $i;var a=t.getInnerEmitterInstance();return a.on(Za,t._onLoginSuccess,_(t)),a.on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:"_onLoginSuccess",value:function(){var e=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var t=this.getModule(xn),n=t.getItem(this.TAG,!1);!jt(n)&&it(n.forEach)&&(xe.l("".concat(this._n,"._onLoginSuccess get quality stat logs from local storage, count:").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("q_rpt_interval"),t=this.getCloudConfig("q_rpt_sdkappid_bl"),n=this.getCloudConfig("q_rpt_tinyid_wl");at(e)||(this.REPORT_INTERVAL=Number(e)),at(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(",").map((function(e){return Number(e)}))),at(n)||(this.REPORT_TINYID_WHITELIST=n.split(","))}},{key:"onCheckTimer",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:"addRequestCount",value:function(){this._avgRTT.addRequestCount()}},{key:"addRTT",value:function(e){this._avgRTT.addRTT(e)}},{key:"addMessageDelay",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:"addTotalCount",value:function(e){this._rateMessageSent.addTotalCount(e)||xe.w("".concat(this._n,".addTotalCount invalid key:"),e)}},{key:"addSuccessCount",value:function(e){this._rateMessageSent.addSuccessCount(e)||xe.w("".concat(this._n,".addSuccessCount invalid key:"),e)}},{key:"addFailedCountOfUserSide",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||xe.w("".concat(this._n,".addFailedCountOfUserSide invalid key:"),e)}},{key:"addCost",value:function(e,t){this._rateMessageSent.addCost(e,t)||xe.w("".concat(this._n,".addCost invalid key or cost:"),e,t)}},{key:"addFileSize",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||xe.w("".concat(this._n,".addFileSize invalid key or size:"),e,t)}},{key:"addMessageSequence",value:function(e){this._rateMessageReceived.addMessageSequence(e)||xe.w("".concat(this._n,".addMessageSequence invalid key:"),e.key)}},{key:"_getQualityItem",value:function(e){var n={},o=Ea[this.getNetworkType()];at(o)&&(o=8);var s={qualityType:Ta[e],timestamp:Ue(),networkType:o,extension:""};switch(e){case ga:n=this._avgRTT.getStatResult();break;case _a:n=this._avgE2EDelay.getStatResult();break;case ha:case fa:case va:case ma:case Ma:n=this._rateMessageSent.getStatResult(e);break;case ya:case Ia:case Ca:n=this._rateMessageReceived.getStatResult(e)}return null===n?null:t(t({},s),n)}},{key:"_report",value:function(e){var t=this,n=[],o=null;at(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),xe.d("".concat(this._n,"._report"),n),this._statInfoArr.length>0&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]);var s=this.getModule(qn),a=s.getSDKAppID(),r=s.getTinyID();wt(this.REPORT_SDKAPPID_BLACKLIST,a)&&!Ft(this.REPORT_TINYID_WHITELIST,r)&&(n=[]),n.length>0&&this._doReport(n)}},{key:"_doReport",value:function(e){var n=this,o={header:ti(this),quality:e};this.request({protocolName:xs,requestData:t({},o)}).then((function(){n.reportIndex++,n.wholePeriod=!1})).catch((function(t){xe.w("".concat(n._n,"._doReport, online:").concat(n.getNetworkType()," error:"),t),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()}))}},{key:"_flushAtOnce",value:function(){var e=this.getModule(xn),t=e.getItem(this.TAG,!1),n=this._statInfoArr,o="".concat(this._n,"._flushAtOnce");if(jt(t))xe.l("".concat(o," count:").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var s=n.concat(t);s.length>10&&(s=s.slice(0,10)),xe.l("".concat(o," count:").concat(s.length)),e.setItem(this.TAG,s,!0,!1)}this._statInfoArr=[]}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),s}(ro),tu=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="WorkerTimerModule",s._isWorkerEnabled=!0,s._workerTimer=null,s._timerID=-1,s._init(),s.getInnerEmitterInstance().on($a,s._onCloudConfigUpdated,_(s)),s}return a(n,[{key:"isWorkerEnabled",value:function(){return this._isWorkerEnabled&&Se}},{key:"startWorkerTimer",value:function(){xe.l("".concat(this._n,".startWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("start")}},{key:"stopWorkerTimer",value:function(){xe.l("".concat(this._n,".stopWorkerTimer")),this._workerTimer&&this._workerTimer.postMessage("stop")}},{key:"_init",value:function(){if(Se){var e=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(e);var t=this;this._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,xe.l("".concat(t._n,"._init seed:").concat(t._timerID))):t._m.onCheckTimer()}}}},{key:"_onCloudConfigUpdated",value:function(){var e=this.getCloudConfig("enable_worker");xe.l("".concat(this._n,"._onCloudConfigUpdated enableWorker:").concat(e)),at(e)||"1"===e?!this._isWorkerEnabled&&Se&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&Se&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:"terminate",value:function(){xe.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(){xe.l("".concat(this._n,".reset"))}}]),n}(ro),nu=function(){function e(){o(this,e),this._n="PurchasedFeatureHandler",this._purchasedFeatureMap=new Map}return a(e,[{key:"isValidPurchaseBits",value:function(e){return e&&"string"==typeof e&&e.length>=1&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:"parsePurchaseBits",value:function(e){if(this.isValidPurchaseBits(e)){this._purchasedFeatureMap.clear();for(var t=null,n=e.length-1,o=0;n>=0;n--,o++)t=o<32?new L(0,Math.pow(2,o)).toString():new L(Math.pow(2,o-32),0).toString(),"1"===e[n]?this._purchasedFeatureMap.set(t,!0):this._purchasedFeatureMap.set(t,!1)}else xe.w("".concat(this._n,".parsePurchaseBits invalid purchasebits:").concat(e))}},{key:"hasPurchasedFeature",value:function(e){return!!this._purchasedFeatureMap.get(e)}},{key:"isFeatureEnabled",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,s=t.length-1,a=0;s>=0;s--,a++)if("1"===t.charAt(s)&&(n=a<32?new L(0,Math.pow(2,a)).toString():new L(Math.pow(2,a-32),0).toString(),!this._purchasedFeatureMap.get(n))){o=!1;break}return xe.l("".concat(this._n,".isFeatureEnabled decimalNumber:").concat(e," binaryString:").concat(t," ret:").concat(o)),za({enabled:o})}},{key:"clear",value:function(){this._purchasedFeatureMap.clear()}}]),e}(),ou=function(){function e(t){o(this,e),this._m=t,this._n="CommercialConfigModule",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new nu}return a(e,[{key:"_canFetch",value:function(){return this._getModule(qn).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:"onCheckTimer",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:"fetchConfig",value:function(){var e=this,t=this._canFetch(),n="".concat(this._n,".fetchConfig");if(xe.l("".concat(n," canFetch:").concat(t)),t){var o=this._getModule(Bn),s=new ka("fetchCommercialConfig");s.setNetworkType(o.getNetworkType());var a=this._getModule(qn).getSDKAppID(),r=this._getModule(jn);this._isFetching=!0,r.request({protocolName:Xs,requestData:{SDKAppID:a}}).then((function(t){s.setMessage("purchaseBits:".concat(t.data.purchaseBits)).end(),xe.l("".concat(n," ok.")),e._parseConfig(t.data),e._isFetching=!1})).catch((function(t){o.probe().then((function(e){var n=v(e,2),o=n[0],a=n[1];s.setError(t,o,a).end()})),e._isFetching=!1}))}}},{key:"onPushedConfig",value:function(e){var t="".concat(this._n,".onPushedConfig data:").concat(JSON.stringify(e));xe.l("".concat(t)),new ka("pushedCommercialConfig").setNetworkType(this._getModule(Bn).getNetworkType()).setMessage("purchaseBits:".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:"_parseConfig",value:function(e){var t="".concat(this._n,"._parseConfig"),n=e.errorCode,o=e.errorMessage,s=e.purchaseBits,a=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(s),this._expiredTime=Date.now()+1e3*a):at(n)?(xe.l("".concat(t," failed. Invalid message format:"),e),this._setExpiredTimeOnResponseError(36e5)):(xe.e("".concat(t," errorCode:").concat(n," errorMessage:").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:"_setExpiredTimeOnResponseError",value:function(e){this._expiredTime=Date.now()+e}},{key:"canIUse",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:"isFeatureEnabled",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:"_getModule",value:function(e){return this._m.getModule(e)}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),e}(),su=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._m=e,s._n="OfflinePushModule",s._offlinePushPlugin=void 0,s._androidPushConfig={huaweiPushBussinessId:"",xiaomiPushBussinessId:"",xiaomiPushAppId:"",xiaomiPushAppKey:"",meizuPushBussinessId:"",meizuPushAppId:"",meizuPushAppKey:"",vivoPushBussinessId:"",fcmPushBussinessId:"",oppoPushBussinessId:"",oppoPushAppKey:"",oppoPushAppSecret:"",honorPushBussinessId:""},s._deviceToken="",s._businessID=0,s._iosBusinessID=0,s._c2cUnreadCount=0,s._groupUnreadCount=0,s._isWebUniapp=0,s}return a(n,[{key:"registerPlugin",value:function(e){if(ne){this._offlinePushPlugin=e["tim-offline-push-plugin"];var t=e.offlinePushConfig||{},n=t.huaweiBusinessID,o=t.xiaomiBusinessID,s=t.xiaomiAppID,a=t.xiaomiAppKey,r=t.meizuBusinessID,i=t.meizuAppID,u=t.meizuAppKey,c=t.vivoBusinessID,l=t.oppoBusinessID,p=t.oppoAppKey,d=t.oppoAppSecret,g=t.honorBusinessID,_=t.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=s,this._androidPushConfig.xiaomiPushAppKey=a,this._androidPushConfig.meizuPushBussinessId=r,this._androidPushConfig.meizuPushAppId=i,this._androidPushConfig.meizuPushAppKey=u,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=p,this._androidPushConfig.oppoPushAppSecret=d,this._androidPushConfig.honorPushBussinessId=g,new ka("registerPlugin").setMessage("tim-offline-push-plugin").setMoreMessage("isExist:".concat(!at(this._offlinePushPlugin))).end(!0),xe.l("".concat(this._n,".").concat("registerPlugin"," ok. offlinePushConfig:").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=_,this._setAppShowListener()}else this.outputWarning("OfflinePushInUniapp")}},{key:"init",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:"_getDeviceToken",value:function(){var e=this,t="".concat(this._n,".").concat("_getDeviceToken");if(it(this._offlinePushPlugin.getDeviceToken)){var n="androidPushConfig:".concat(JSON.stringify(this._androidPushConfig),", iosBusinessID:").concat(this._iosBusinessID);xe.l("".concat(t," start. ").concat(n)),new ka("_getDeviceToken").setMessage("".concat(n)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var s=new ka("getDeviceTokenRes"),a=o.code,r=o.msg;if(0===a){var i=o.data,u=i.deviceToken,c=i.deviceBrand,l=i.deviceType,p=i.bussinessId;e._deviceToken=u,e._businessID=p||e._iosBusinessID,n="deviceToken:".concat(u,", deviceBrand:").concat(c||l,", businessID:").concat(e._businessID),xe.l("".concat(t," ok. ").concat(n)),s.setMessage(n).end(!0),e._setToken()}else s.setMessage("code:".concat(a,", msg:").concat(r)).end(!0),xe.e("".concat(t," failed. error:"),o)}))}else xe.e("".concat(t," getDeviceToken is not a function"))}},{key:"canIUseOfflinePush",value:function(){return ne&&!at(this._offlinePushPlugin)}},{key:"_setAppShowListener",value:function(){var e=this,t="".concat(this._n,".").concat("_setAppShowListener");at(this._offlinePushPlugin)?xe.e("".concat(t," offlinePushPlugin is undefined")):it(this._offlinePushPlugin.setAppShowListener)?(new ka("_setAppShowListener").end(!0),xe.l("".concat(t," start")),this._offlinePushPlugin.setAppShowListener((function(n){var o=(n||{}).appShow;new ka("setAppShowListenerRes").setMessage("appShow:".concat(o)).end(!0),xe.l("".concat(t," ok. appShow:").concat(o)),e._m.isReady()&&(0===o?(e._getConvUnreadCount(),e._onBackground()):1===o&&e._onForeground())}))):xe.e("".concat(t," setAppShowListener is not a function"))}},{key:"getDeviceBrand",value:function(){if(!at(this._offlinePushPlugin)&&it(this._offlinePushPlugin.getDeviceType)){var e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType;return xe.l("".concat(this._n,".getDeviceBrand ok. deviceType:").concat(e)),e}}},{key:"_setToken",value:function(){var e,t=this,n="".concat(this._n,"._setToken"),o=this.getModule(qn),s=1,a="",r="";jt(this._deviceToken)&&(s=0);var i=this.getUniAppPlatform(),u=this.getDeviceBrand();i===R.IOS||i===R.IPAD||i===R.MAC?r=this._deviceToken:i===R.ANDROID&&(a=this._deviceToken);var c=new ka("offlinePushSetToken");return e="deviceToken:".concat(r||a,", businessID:").concat(this._businessID,", ")+"deviceBrand:".concat(u,", isWebUniapp:").concat(this._isWebUniapp,", pushMsg:").concat(s,", platform:").concat(i),c.setMessage("".concat(e)),xe.l("".concat(n," ").concat(e)),this.request({protocolName:ca,requestData:{tokenID:a,pushMsg:s,sdkAppID:o.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:u,deviceToken:r,isWebUniapp:this._isWebUniapp}}).then((function(e){return c.end(),xe.l("".concat(n," ok")),e})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),xe.e("".concat(n," failed. error:"),e),Ja(e)}))}},{key:"_getConvUnreadCount",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(Fn).getLocalConversationList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:"_onBackground",value:function(){var e=this,t="".concat(this._n,".").concat("_onBackground"),n=new ka("_onBackground");this.request({protocolName:ia,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage("c2cUnreadCount: ".concat(e._c2cUnreadCount,", groupUnreadCount: ").concat(e._groupUnreadCount)).end(),xe.l("".concat(t," ok")),o})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];n.setError(o,s,a).end()})),xe.e("".concat(t," failed. error:"),o)}))}},{key:"_onForeground",value:function(){var e=this,t="".concat(this._n,".").concat("_onForeground"),n=new ka("_onForeground");this.request({protocolName:ua,requestData:{isWebUniapp:this._isWebUniapp}}).then((function(e){return n.end(),xe.l("".concat(t," ok")),e})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];n.setError(o,s,a).end()})),xe.e("".concat(t," failed. error:"),o)}))}},{key:"getUniAppPlatform",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return"ios"===e?R.IOS:"android"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:"reset",value:function(){this._deviceToken="",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,xe.l("".concat(this._n,".reset"))}}]),n}(ro),au=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n="ProfanityFilterModule",s._plugin=null,s._filterConfigMap=new Map,s._startIndex=0,s._version=0,s._canIUseLexicon=!1,s._isFetching=!1,s._expiredTime=0,s}return a(n,[{key:"init",value:function(){var e=this.getModule(Wn).getPlugin("tim-profanity-filter-plugin");e?(this._plugin=new e({logger:xe,isArray:st,isMap:Qe,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning("ProfanityPluginNotFound")}},{key:"onCheckTimer",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:"filterMessage",value:function(e,t){var n=!0;if(!this._plugin||!this._canIUseLexicon)return n;if(t&&t.messageControlInfo&&!0===t.messageControlInfo.excludedFromContentModeration)return n;var o=e.type,s=e.conversationType;if(o!==S.MSG_TEXT&&o!==S.MSG_CUSTOM)return n;var a,r="".concat(this._n,".filterMessage");if(xe.l("".concat(r)),o===S.MSG_TEXT){if(s===S.CONV_C2C?a=H:s===S.CONV_GROUP&&(a=W),!this._isConfigOn(a))return n;var i=this._plugin.filter(e.payload.text),u=i.type,c=i.modifiedText;1===u?n=!1:2===u&&(e.payload.text=c)}else if(o===S.MSG_CUSTOM){if(s===S.CONV_C2C?a=K:s===S.CONV_GROUP&&(a=Y),!this._isConfigOn(a))return n;var l=this._plugin.filter(e.payload.data),p=this._plugin.filter(e.payload.description),d=this._plugin.filter(e.payload.extension);1===l.type||1===p.type||1===d.type?n=!1:(2===l.type&&(e.payload.data=l.modifiedText),2===p.type&&(e.payload.description=p.modifiedText),2===d.type&&(e.payload.extension=d.modifiedText))}return xe.l("".concat(r," done. isAllowedToSend:").concat(n)),n}},{key:"filterText",value:function(e,t){var n="".concat(this._n,".filterText"),o={isAllowedToSend:!0,modifiedText:e};if(!this._plugin||!this._canIUseLexicon)return o;if(!this._isConfigOn(t))return o;xe.l("".concat(n));var s=this._plugin.filter(e),a=s.type,r=s.modifiedText;return 1===a?o.isAllowedToSend=!1:2===a&&(o.modifiedText=r),xe.l("".concat(n," done. ret:"),o),o}},{key:"_getLexicon",value:function(){var e=this,t=new ka("profanityFilter"),n="".concat(this._n,"._getLexicon");this._isFetching=!0,this.request({protocolName:la,requestData:{startIndex:this._startIndex,version:this._version}}).then((function(o){var s=o.data,a=s.errorInfo,r=s.filterConfig,i=s.lexicon,u=s.strToken,c=s.completeFlag,l=s.nextStartIndex,p=s.version,d=s.expiredTime,g=a.errorCode,_=a.errorMessage;return 0!==g?(e._isFetching=!1,xe.w("".concat(n," failed. error:"),a),void t.setCode(g).setMessage(_).end()):(e._onFilterConfig(r),e._getToken(u),1===c?(xe.l("".concat(n," done. version:").concat(p," expiredTime:").concat(d)),e._version=p,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*d,void e._plugin.onLexiconCompleted(i)):(e._startIndex=l,e._plugin.onLexiconSliced(i),void e._getLexicon()))})).catch((function(o){e.probeNetwork().then((function(e){var n=v(e,2),s=n[0],a=n[1];t.setError(o,s,a).end()})),e._isFetching=!1,xe.l("".concat(n," failed. error:"),o)}))}},{key:"_onFilterConfig",value:function(e){var t=this;jt(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),xe.l("".concat(this._n,"._onFilterConfig. keys:").concat(Array.from(this._filterConfigMap.keys())," values:").concat(Array.from(this._filterConfigMap.values()))))}},{key:"_isConfigOn",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:"_getToken",value:function(e){if(et(e)){var t=e.length,n="";if(t%2==0)for(var o=0;o<=t-1;o+=2)n+=e[o+1],n+=e[o];else{for(var s=0;s=this.STORAGE_EXPIRES_TIME,s=!n||"2.27.5"!==n;return xe.l("".concat(this._n,"._needToUpdate isTimeout:").concat(o," isDifferentVersion:").concat(s)),o||s}},{key:"_fetch",value:function(){if(!this._m.getModule(qn).isPrivateNetWork()){var e="https://web.sdk.qcloud.com/im/download/error-message/0.0.1/tim-error-message.txt",t="application/x-www-form-urlencoded;charset=UTF-8",n="".concat(this._n,"._fetch ok in"),o=this;if(se)re.request({url:e,method:"GET",timeout:3e3,header:{"content-type":t},dataType:"text",success:function(e){o._fillAndSave(e.data),xe.l("".concat(n," mini program"))},fail:function(){}});else{var s=new XMLHttpRequest,a=setTimeout((function(){s.abort()}),3e3);s.onreadystatechange=function(){4===s.readyState&&(clearTimeout(a),200!==s.status&&304!==s.status||(xe.l("".concat(n," browser")),o._fillAndSave(s.responseText)))},s.open("GET",e,!0),s.setRequestHeader("Content-type",t),s.send()}}}},{key:"_fillAndSave",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:"2.27.5"}),!0,!1)}},{key:"_getStorageModule",value:function(){return this._m.getModule(xn)}},{key:"_fillMap",value:function(e){this._map.clear();for(var t,n,o,s=e.split(";\n"),a=s.length,r=new RegExp(/'/g),i=0;i0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:"_stopMainThreadSocket",value:function(){xe.l("".concat(this._n,"._stopMainThreadSocket"));var e=this._moduleMap.get(zn);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:"_startMainThreadSocket",value:function(){xe.l("".concat(this._n,"._startMainThreadSocket"));var e=this._moduleMap.get(zn);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:"onWorkerTimerEnabled",value:function(){xe.l("".concat(this._n,".onWorkerTimerEnabled, disable main thread timer and socket")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:"onWorkerTimerDisabled",value:function(){xe.l("".concat(this._n,".onWorkerTimerDisabled, enable main thread timer and socket")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:"onCheckTimer",value:function(){this._checkCount+=1;var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(o){t.e(o)}finally{t.f()}}},{key:"_initReadyList",value:function(){var e=this;this._readyList=[this._moduleMap.get(An),this._moduleMap.get(Fn)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:"_onModuleReady",value:function(){var e=!0;if(this._readyList.forEach((function(t){t.isReady()||(e=!1)})),e&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(E.SDK_READY);var t=Date.now()-this._startLoginTs;xe.w("SDK is ready. cost ".concat(t," ms")),this._startLoginTs=Date.now();var n=this._moduleMap.get(Bn).getNetworkType(),o=this._ssoLogForReady.getStartTs()+Ge;this._ssoLogForReady.setNetworkType(n).setMessage(t).start(o).end()}}},{key:"login",value:function(){0===this._startLoginTs&&(Pe(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(Bn).start(),this._ssoLogForReady=new ka("sdkReady"),this._reason=da.LOGGING_IN)}},{key:"onLoginFailed",value:function(){this._startLoginTs=0}},{key:"getOuterEmitterInstance",value:function(){return null===this._outerEmitter&&(this._outerEmitter=new ii,ja(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(e,t){var n=this;if(e===E.CONVERSATION_LIST_UPDATED||e===E.FRIEND_LIST_UPDATED||e===E.GROUP_LIST_UPDATED||e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)if(this._eventThrottleMap.has(e)){var o=Date.now(),s=this._eventThrottleMap.get(e);o-s.last<=1e3?(s.timeoutID&&clearTimeout(s.timeoutID),s.timeoutID=setTimeout((function(){s.last=Date.now(),n._outerEmitter._emit.apply(n._outerEmitter,[e,{name:e,data:n._getEventData(e)}])}),1e3)):(s.last=o,this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]))}else this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:arguments[1]}])}.bind(this)),this._outerEmitter}},{key:"_getEventData",value:function(e){return e===E.CONVERSATION_LIST_UPDATED?this._moduleMap.get(Fn).getLocalConversationList():e===E.FRIEND_LIST_UPDATED?this._moduleMap.get(Pn).getLocalFriendList(!1):e===E.GROUP_LIST_UPDATED?this._moduleMap.get(Un).getLocalGroupList():e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(Fn).getTotalUnreadMessageCount():void 0}},{key:"getInnerEmitterInstance",value:function(){return null===this._innerEmitter&&(this._innerEmitter=new ii,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(e,t){var n;n=ot(arguments[1])&&arguments[1].data?[e,{name:arguments[0],data:arguments[1].data}]:[e,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,n)}.bind(this)),this._innerEmitter}},{key:"hasModule",value:function(e){return this._moduleMap.has(e)}},{key:"getModule",value:function(e){return this._moduleMap.get(e)}},{key:"isReady",value:function(){return this._isReady}},{key:"isIntl",value:function(){return this.getModule(qn).isIntl()}},{key:"getNotReadyReason",value:function(){return this._reason}},{key:"setNotReadyReason",value:function(e){this._reason=e}},{key:"getErrorMessage",value:function(e,t,n){return this._moduleMap.get(ao).get({key:e,replacement1:t,replacement2:n,isIntl:this.isIntl()})}},{key:"outputWarning",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&xe.w(o)}},{key:"onError",value:function(e){var t="code:".concat(e.code," message:").concat(e.message);xe.w("Oops! ".concat(t)),new ka("error").setMessage(t).setNetworkType(this.getModule(Bn).getNetworkType()).setLevel("error").end(),this.getOuterEmitterInstance().emit(E.ERROR,e)}},{key:"restartTimer",value:function(){xe.l("".concat(this._n,".restartTimer")),this.stopTimer(),this._startTimer(),this.getModule(Un).restartPolling()}},{key:"getTimerID",value:function(){var e=this._moduleMap.get(Qn);return e.isWorkerEnabled()?e.getTimerID():this._checkTimer}},{key:"getPollingTimerID",value:function(e){return this._moduleMap.get(Un).getPollingTimerID(e)}},{key:"reset",value:function(){xe.l("".concat(this._n,".reset")),Pe();var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.reset&&n.reset()}}catch(r){t.e(r)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(E.SDK_NOT_READY);var o,s=D(this._eventThrottleMap);try{for(s.s();!(o=s.n()).done;){var a=v(o.value,2)[1];a.timeoutID&&clearTimeout(a.timeoutID)}}catch(r){s.e(r)}finally{s.f()}this._eventThrottleMap.clear()}}]),e}(),cu=function(){function e(t){o(this,e),this._funcMap=new Map,this._m=t}return a(e,[{key:"defense",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if("string"!=typeof e)return null;if(0===e.length)return null;if("function"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:"defenseOnce",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return"function"!=typeof t?null:this._pack(e,t,n)}},{key:"find",value:function(e,t){return"string"!=typeof e||0===e.length||"function"!=typeof t?null:this._funcMap.has(e)&&this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(this._m.outputWarning("ListenerFnNotFound",e),null)}},{key:"delete",value:function(e,t){return"function"==typeof t&&(!!this._funcMap.has(e)&&(!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)))}},{key:"_pack",value:function(e,t,n){var o=this;return function(){try{t.apply(n,Array.from(arguments))}catch(u){var s=Object.values(E).indexOf(e),a="CallbackError";if(-1!==s){var r=Object.keys(E)[s];o._m.outputWarning(a,r,u)}var i=new ka(a);i.setMessage("eventName:".concat(e)).setMoreMessage(u.message).end()}}}}]),e}(),lu=function(){function e(t){o(this,e);var n={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||"",oversea:t.oversea||!1,instanceID:Rt(),devMode:t.devMode||!1,proxyServer:t.proxyServer||void 0,fileUploadProxy:t.fileUploadProxy||void 0,fileDownloadProxy:t.fileDownloadProxy||t.fileUploadProxy||void 0};this._m=new uu(n),this._safetyCallbackFactory=new cu(this._m)}return a(e,[{key:"onError",value:function(e){this._m.onError(e)}},{key:"login",value:function(e){return this._m.login(),this._getModule(An).login(e)}},{key:"logout",value:function(){var e=this;return this._getModule(An).logout().then((function(t){return e._m.reset(),t}))}},{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:"getErrorMessage",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:"_getModule",value:function(e){return this._m.getModule(e)}},{key:"destroy",value:function(){var e=this;return this.logout().finally((function(){e._m.stopTimer(),e._getModule(Qn).terminate(),e._getModule(zn).dealloc();var t=e._m.getOuterEmitterInstance(),n=e._getModule(qn);t.emit(E.SDK_DESTROY,{SDKAppID:n.getSDKAppID()})}))}},{key:"on",value:function(e,t,n){xe.d("on","eventName:".concat(e)),this._m.getOuterEmitterInstance().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:"once",value:function(e,t,n){xe.d("once","eventName:".concat(e)),this._m.getOuterEmitterInstance().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:"off",value:function(e,t,n,o){xe.d("off","eventName:".concat(e));var s=this._safetyCallbackFactory.find(e,t);null!==s&&(this._m.getOuterEmitterInstance().off(e,s,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:"registerPlugin",value:function(e){at(e["tim-offline-push-plugin"])?this._getModule(Wn).registerPlugin(e):this._getModule(to).registerPlugin(e)}},{key:"setLogLevel",value:function(e){if(e<=0){var t=this.getErrorMessage("TIM_ASCII_ART");t&&console.log(t);var n=this.getErrorMessage("API_REFER");if(n){Ht()?console.log("%c ".concat("IM SDK API ->"," %c"),"background:#ff9d00; padding:1px; border-radius:3px; color: #fff","background:transparent",n):console.log("IM SDK API ->",n)}var o=this.getErrorMessage("DOCS_GUIDE");o&&console.log(o)}xe.setLevel(e)}},{key:"createTextMessage",value:function(e){return this._getModule(Rn).createTextMessage(e)}},{key:"createTextAtMessage",value:function(e){return this._getModule(Rn).createTextMessage(e)}},{key:"createImageMessage",value:function(e){return this._getModule(Rn).createImageMessage(e)}},{key:"createAudioMessage",value:function(e){return this._getModule(Rn).createAudioMessage(e)}},{key:"createVideoMessage",value:function(e){return this._getModule(Rn).createVideoMessage(e)}},{key:"createCustomMessage",value:function(e){return this._getModule(Rn).createCustomMessage(e)}},{key:"createFaceMessage",value:function(e){return this._getModule(Rn).createFaceMessage(e)}},{key:"createFileMessage",value:function(e){return this._getModule(Rn).createFileMessage(e)}},{key:"createLocationMessage",value:function(e){return this._getModule(Rn).createLocationMessage(e)}},{key:"createMergerMessage",value:function(e){return this._getModule(Rn).createMergerMessage(e)}},{key:"downloadMergerMessage",value:function(e){return e.type!==S.MSG_MERGER?Ja({code:da.MESSAGE_MERGER_TYPE_INVALID}):jt(e.payload.downloadKey)?Ja({code:da.MESSAGE_MERGER_KEY_INVALID}):this._getModule(Rn).downloadMergerMessage(e).catch((function(e){return Ja({code:da.MESSAGE_MERGER_DOWNLOAD_FAIL})}))}},{key:"createForwardMessage",value:function(e){return this._getModule(Rn).createForwardMessage(e)}},{key:"sendMessage",value:function(e,t){return e instanceof Ha?this._getModule(Rn).sendMessageInstance(e,t):Ja({code:da.MESSAGE_SEND_NEED_MESSAGE_INSTANCE})}},{key:"callExperimentalAPI",value:function(e,t){return"sendComboMessage"===e?this._getModule(so).sendMessage(t):"handleGroupInvitation"===e?this._getModule(Un).handleGroupInvitation(t):"isCommercialAbilityEnabled"===e?this._getModule(eo).isFeatureEnabled(t):"isIntl"===e?this.isIntl():"sendTRTCCustomData"===e?this._getModule(oo).sendTRTCCustomData(t):"getTimerID"===e?this._m.getTimerID():"getPollingTimerID"===e?this._m.getPollingTimerID(t):Ja({code:da.INVALID_OPERATION})}},{key:"revokeMessage",value:function(e){return this._getModule(Rn).revokeMessage(e)}},{key:"resendMessage",value:function(e){return this._getModule(Rn).resendMessage(e)}},{key:"deleteMessage",value:function(e){return this._getModule(Rn).deleteMessage(e)}},{key:"translateText",value:function(e){return this._getModule(Rn).translateText(e)}},{key:"setMessageExtensions",value:function(e,t){return this._getModule(Nn).setMessageExtensions(e,t)}},{key:"getMessageExtensions",value:function(e){return this._getModule(Nn).getMessageExtensions(e)}},{key:"deleteMessageExtensions",value:function(e,t){return this._getModule(Nn).deleteMessageExtensions(e,t)}},{key:"modifyMessage",value:function(e){return this._getModule(Rn).modifyRemoteMessage(e)}},{key:"getMessageList",value:function(e){return this._getModule(Fn).getMessageList(e)}},{key:"getMessageListHopping",value:function(e){return this._getModule(Fn).getMessageListHopping(e)}},{key:"sendMessageReadReceipt",value:function(e){return this._getModule(Fn).sendReadReceipt(e)}},{key:"getMessageReadReceiptList",value:function(e){return this._getModule(Fn).getReadReceiptList(e)}},{key:"getGroupMessageReadMemberList",value:function(e){return this._getModule(Un).getReadReceiptDetail(e)}},{key:"findMessage",value:function(e){return this._getModule(Fn).findMessage(e)}},{key:"setMessageRead",value:function(e){return this._getModule(Fn).setMessageRead(e)}},{key:"getConversationList",value:function(e){return this._getModule(Fn).getConversationList(e)}},{key:"getConversationProfile",value:function(e){return this._getModule(Fn).getConversationProfile(e)}},{key:"deleteConversation",value:function(e){return this._getModule(Fn).deleteConversation(e)}},{key:"clearHistoryMessage",value:function(e){return this._getModule(Fn).clearHistoryMessage(e)}},{key:"pinConversation",value:function(e){return this._getModule(Fn).pinConversation(e)}},{key:"setAllMessageRead",value:function(e){return this._getModule(Fn).setAllMessageRead(e)}},{key:"setMessageRemindType",value:function(e){return this._getModule(Fn).setMessageRemindType(e)}},{key:"getTotalUnreadMessageCount",value:function(){return this._getModule(Fn).getTotalUnreadMessageCount()}},{key:"setConversationCustomData",value:function(e){return this._getModule(Fn).setConversationCustomData(e)}},{key:"markConversation",value:function(e){return this._getModule(Fn).markConversation(e)}},{key:"getConversationGroupList",value:function(){return this._getModule(Fn).getConversationGroupList()}},{key:"createConversationGroup",value:function(e){return this._getModule(Fn).createConversationGroup(e)}},{key:"deleteConversationGroup",value:function(e){return this._getModule(Fn).deleteConversationGroup(e)}},{key:"renameConversationGroup",value:function(e){return this._getModule(Fn).renameConversationGroup(e)}},{key:"addConversationsToGroup",value:function(e){return this._getModule(Fn).addConversationsToGroup(e)}},{key:"deleteConversationsFromGroup",value:function(e){return this._getModule(Fn).deleteConversationsFromGroup(e)}},{key:"getMyProfile",value:function(){return this._getModule(On).getMyProfile()}},{key:"getUserProfile",value:function(e){return this._getModule(On).getUserProfile(e)}},{key:"updateMyProfile",value:function(e){return this._getModule(On).updateMyProfile(e)}},{key:"getBlacklist",value:function(){return this._getModule(On).getLocalBlacklist()}},{key:"addToBlacklist",value:function(e){return this._getModule(On).addBlacklist(e)}},{key:"removeFromBlacklist",value:function(e){return this._getModule(On).deleteBlacklist(e)}},{key:"setSelfStatus",value:function(e){return this._getModule(On).setSelfStatus(e)}},{key:"getUserStatus",value:function(e){return this._getModule(On).getUserStatus(e)}},{key:"subscribeUserStatus",value:function(e){return this._getModule(On).subscribeUserStatus(e)}},{key:"unsubscribeUserStatus",value:function(e){return this._getModule(On).unsubscribeUserStatus(e)}},{key:"getFriendList",value:function(){var e=this._getModule(Pn);return e?e.getLocalFriendList():Ja({code:da.CANNOT_FIND_MODULE})}},{key:"addFriend",value:function(e){var t=this._getModule(Pn);return t?t.addFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"deleteFriend",value:function(e){var t=this._getModule(Pn);return t?t.deleteFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"checkFriend",value:function(e){var t=this._getModule(Pn);return t?t.checkFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"getFriendProfile",value:function(e){var t=this._getModule(Pn);return t?t.getFriendProfile(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"updateFriend",value:function(e){var t=this._getModule(Pn);return t?t.updateFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"getFriendApplicationList",value:function(){var e=this._getModule(Pn);return e?e.getLocalFriendApplicationList():Ja({code:da.CANNOT_FIND_MODULE})}},{key:"acceptFriendApplication",value:function(e){var t=this._getModule(Pn);return t?t.acceptFriendApplication(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"refuseFriendApplication",value:function(e){var t=this._getModule(Pn);return t?t.refuseFriendApplication(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"deleteFriendApplication",value:function(e){var t=this._getModule(Pn);return t?t.deleteFriendApplication(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"setFriendApplicationRead",value:function(){var e=this._getModule(Pn);return e?e.setFriendApplicationRead():Ja({code:da.CANNOT_FIND_MODULE})}},{key:"getFriendGroupList",value:function(){var e=this._getModule(Pn);return e?e.getLocalFriendGroupList():Ja({code:da.CANNOT_FIND_MODULE})}},{key:"createFriendGroup",value:function(e){var t=this._getModule(Pn);return t?t.createFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"deleteFriendGroup",value:function(e){var t=this._getModule(Pn);return t?t.deleteFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"addToFriendGroup",value:function(e){var t=this._getModule(Pn);return t?t.addToFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"removeFromFriendGroup",value:function(e){var t=this._getModule(Pn);return t?t.removeFromFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"renameFriendGroup",value:function(e){var t=this._getModule(Pn);return t?t.renameFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:"getGroupList",value:function(e){return this._getModule(Un).getGroupList(e)}},{key:"getGroupProfile",value:function(e){return this._getModule(Un).getGroupProfile(e)}},{key:"createGroup",value:function(e){return this._getModule(Un).createGroup(e)}},{key:"dismissGroup",value:function(e){return this._getModule(Un).dismissGroup(e)}},{key:"updateGroupProfile",value:function(e){return this._getModule(Un).updateGroupProfile(e)}},{key:"joinGroup",value:function(e){return this._getModule(Un).joinGroup(e)}},{key:"quitGroup",value:function(e){return this._getModule(Un).quitGroup(e)}},{key:"searchGroupByID",value:function(e){return this._getModule(Un).searchGroupByID(e)}},{key:"getGroupOnlineMemberCount",value:function(e){return this._getModule(Un).getGroupOnlineMemberCount(e)}},{key:"changeGroupOwner",value:function(e){return this._getModule(Un).changeGroupOwner(e)}},{key:"getGroupApplicationList",value:function(){return this._getModule(Un).getGroupApplicationList()}},{key:"handleGroupApplication",value:function(e){return this._getModule(Un).handleGroupApplication(e)}},{key:"initGroupAttributes",value:function(e){return this._getModule(Un).initGroupAttributes(e)}},{key:"setGroupAttributes",value:function(e){return this._getModule(Un).setGroupAttributes(e)}},{key:"deleteGroupAttributes",value:function(e){return this._getModule(Un).deleteGroupAttributes(e)}},{key:"getGroupAttributes",value:function(e){return this._getModule(Un).getGroupAttributes(e)}},{key:"setGroupCounters",value:function(e){return this._getModule(Un).setGroupCounters(e)}},{key:"increaseGroupCounter",value:function(e){return this._getModule(Un).increaseGroupCounter(e)}},{key:"decreaseGroupCounter",value:function(e){return this._getModule(Un).decreaseGroupCounter(e)}},{key:"getGroupCounters",value:function(e){return this._getModule(Un).getGroupCounters(e)}},{key:"getGroupMemberList",value:function(e){return this._getModule(bn).getGroupMemberList(e)}},{key:"getGroupMemberProfile",value:function(e){return this._getModule(bn).getGroupMemberProfile(e)}},{key:"addGroupMember",value:function(e){return this._getModule(bn).addGroupMember(e)}},{key:"deleteGroupMember",value:function(e){return this._getModule(bn).deleteGroupMember(e)}},{key:"setGroupMemberMuteTime",value:function(e){return this._getModule(bn).setGroupMemberMuteTime(e)}},{key:"setGroupMemberRole",value:function(e){return this._getModule(bn).setGroupMemberRole(e)}},{key:"setGroupMemberNameCard",value:function(e){return this._getModule(bn).setGroupMemberNameCard(e)}},{key:"setGroupMemberCustomField",value:function(e){return this._getModule(bn).setGroupMemberCustomField(e)}},{key:"markGroupMemberList",value:function(e){return this._getModule(bn).markGroupMemberList(e)}},{key:"getJoinedCommunityList",value:function(){return this._getModule(wn).getJoinedCommunityList()}},{key:"createTopicInCommunity",value:function(e){return this._getModule(wn).createTopicInCommunity(e)}},{key:"deleteTopicFromCommunity",value:function(e){return this._getModule(wn).deleteTopicFromCommunity(e)}},{key:"updateTopicProfile",value:function(e){return this._getModule(wn).updateTopicProfile(e)}},{key:"getTopicList",value:function(e){return this._getModule(wn).getTopicList(e)}}]),e}(),pu={login:1,logout:1,destroy:1,on:1,off:1,ready:1,setLogLevel:1,joinGroup:1,quitGroup:1,registerPlugin:1,getGroupOnlineMemberCount:1};function du(e,t){if(e.isReady()||1===pu[t])return!0;var n=e.getNotReadyReason(),o={code:n,message:"".concat(e.getErrorMessage(n)," | ").concat(t," | ").concat(e.getErrorMessage(da.SDK_IS_NOT_READY))};return e.onError(o),o}var gu={},_u={};return _u.create=function(e){var n=0,o=e.SDKAppID;if($e(o))n=o;else if(n=parseInt(o),isNaN(o))return xe.e("".concat("TIM.create"," failed. Failed to parse the SDKAppID, please check the arguments")),null;if(n&&gu[n])return gu[n];xe.l("".concat("TIM.create"));var s=new lu(t(t({},e),{},{SDKAppID:n}));s.on(E.SDK_DESTROY,(function(e){gu[e.data.SDKAppID]=null,delete gu[e.data.SDKAppID]}));var a=function(e){var t=Object.create(null);return Object.keys(Ln).forEach((function(n){if(e[n]){var o=new k;t[n]=function(){var t=Array.from(arguments);return o.use((function(t,o){var s=du(e,n);return!0===s?o():Ja(s)})).use((function(e,t){if(!0===zt(e,kn[n],n))return t()})).use((function(t,o){return e[n].apply(e,t)})),o.run(t)}}})),t}(s);return gu[n]=a,kn.hookGetAPITips(s.getErrorMessage.bind(s)),xe.l("".concat("TIM.create"," ok")),a},_u.TYPES=S,_u.EVENT=E,_u.VERSION="2.27.5",xe.l("TIM.VERSION:".concat(_u.VERSION)),_u})); + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242902); +})() +//miniprogram-npm-outsideDeps=[] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/tim-wx-sdk/index.js.map b/miniprogram_npm/tim-wx-sdk/index.js.map new file mode 100644 index 0000000..db06002 --- /dev/null +++ b/miniprogram_npm/tim-wx-sdk/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["tim-wx.js"],"names":[],"mappings":";;;;;;;AAAA;AACA","file":"index.js","sourcesContent":["!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).TIM=t()}(this,(function(){function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function t(t){for(var n=1;n=0||(s[n]=e[n]);return s}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(o=0;o=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(s[n]=e[n])}return s}function _(e){if(void 0===e)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return e}function h(e,t){if(t&&(\"object\"==typeof t||\"function\"==typeof t))return t;if(void 0!==t)throw new TypeError(\"Derived constructors may only return object or undefined\");return _(e)}function f(e){var t=l();return function(){var n,o=u(e);if(t){var s=u(this).constructor;n=Reflect.construct(o,arguments,s)}else n=o.apply(this,arguments);return h(this,n)}}function v(e,t){return M(e)||function(e,t){var n=null==e?null:\"undefined\"!=typeof Symbol&&e[Symbol.iterator]||e[\"@@iterator\"];if(null==n)return;var o,s,a=[],r=!0,i=!1;try{for(n=n.call(e);!(r=(o=n.next()).done)&&(a.push(o.value),!t||a.length!==t);r=!0);}catch(u){i=!0,s=u}finally{try{r||null==n.return||n.return()}finally{if(i)throw s}}return a}(e,t)||I(e,t)||T()}function m(e){return function(e){if(Array.isArray(e))return C(e)}(e)||y(e)||I(e)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function M(e){if(Array.isArray(e))return e}function y(e){if(\"undefined\"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e[\"@@iterator\"])return Array.from(e)}function I(e,t){if(e){if(\"string\"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return\"Object\"===n&&e.constructor&&(n=e.constructor.name),\"Map\"===n||\"Set\"===n?Array.from(e):\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:s}}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 a,r=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){i=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(i)throw a}}}}var E={SDK_READY:\"sdkStateReady\",SDK_NOT_READY:\"sdkStateNotReady\",SDK_DESTROY:\"sdkDestroy\",MESSAGE_RECEIVED:\"onMessageReceived\",MESSAGE_MODIFIED:\"onMessageModified\",MESSAGE_REVOKED:\"onMessageRevoked\",MESSAGE_READ_BY_PEER:\"onMessageReadByPeer\",MESSAGE_READ_RECEIPT_RECEIVED:\"onMessageReadReceiptReceived\",MESSAGE_EXTENSIONS_UPDATED:\"onMessageExtensionsUpdated\",MESSAGE_EXTENSIONS_DELETED:\"onMessageExtensionsDeleted\",CONVERSATION_LIST_UPDATED:\"onConversationListUpdated\",TOTAL_UNREAD_MESSAGE_COUNT_UPDATED:\"onTotalUnreadMessageCountUpdated\",CONVERSATION_GROUP_LIST_UPDATED:\"onConversationGroupListUpdated\",CONVERSATION_IN_GROUP_UPDATED:\"onConversationInGroupUpdated\",GROUP_LIST_UPDATED:\"onGroupListUpdated\",GROUP_SYSTEM_NOTICE_RECEIVED:\"receiveGroupSystemNotice\",GROUP_ATTRIBUTES_UPDATED:\"groupAttributesUpdated\",GROUP_COUNTER_UPDATED:\"onGroupCounterUpdated\",TOPIC_CREATED:\"onTopicCreated\",TOPIC_DELETED:\"onTopicDeleted\",TOPIC_UPDATED:\"onTopicUpdated\",PROFILE_UPDATED:\"onProfileUpdated\",USER_STATUS_UPDATED:\"onUserStatusUpdated\",BLACKLIST_UPDATED:\"blacklistUpdated\",FRIEND_LIST_UPDATED:\"onFriendListUpdated\",FRIEND_GROUP_LIST_UPDATED:\"onFriendGroupListUpdated\",FRIEND_APPLICATION_LIST_UPDATED:\"onFriendApplicationListUpdated\",KICKED_OUT:\"kickedOut\",ERROR:\"error\",NET_STATE_CHANGE:\"netStateChange\",SDK_RELOAD:\"sdkReload\"},S={MSG_TEXT:\"TIMTextElem\",MSG_IMAGE:\"TIMImageElem\",MSG_SOUND:\"TIMSoundElem\",MSG_AUDIO:\"TIMSoundElem\",MSG_FILE:\"TIMFileElem\",MSG_FACE:\"TIMFaceElem\",MSG_VIDEO:\"TIMVideoFileElem\",MSG_GEO:\"TIMLocationElem\",MSG_LOCATION:\"TIMLocationElem\",MSG_GRP_TIP:\"TIMGroupTipElem\",MSG_GRP_SYS_NOTICE:\"TIMGroupSystemNoticeElem\",MSG_CUSTOM:\"TIMCustomElem\",MSG_MERGER:\"TIMRelayElem\",MSG_PRIORITY_HIGH:\"High\",MSG_PRIORITY_NORMAL:\"Normal\",MSG_PRIORITY_LOW:\"Low\",MSG_PRIORITY_LOWEST:\"Lowest\",CONV_C2C:\"C2C\",CONV_GROUP:\"GROUP\",CONV_TOPIC:\"TOPIC\",CONV_SYSTEM:\"@TIM#SYSTEM\",CONV_AT_ME:1,CONV_AT_ALL:2,CONV_AT_ALL_AT_ME:3,CONV_MARK_TYPE_STAR:1,CONV_MARK_TYPE_UNREAD:2,CONV_MARK_TYPE_FOLD:4,CONV_MARK_TYPE_HIDE:8,GRP_PRIVATE:\"Private\",GRP_WORK:\"Private\",GRP_PUBLIC:\"Public\",GRP_CHATROOM:\"ChatRoom\",GRP_MEETING:\"ChatRoom\",GRP_AVCHATROOM:\"AVChatRoom\",GRP_COMMUNITY:\"Community\",GRP_MBR_ROLE_OWNER:\"Owner\",GRP_MBR_ROLE_ADMIN:\"Admin\",GRP_MBR_ROLE_MEMBER:\"Member\",GRP_MBR_ROLE_CUSTOM:\"Custom\",GRP_TIP_MBR_JOIN:1,GRP_TIP_MBR_QUIT:2,GRP_TIP_MBR_KICKED_OUT:3,GRP_TIP_MBR_SET_ADMIN:4,GRP_TIP_MBR_CANCELED_ADMIN:5,GRP_TIP_GRP_PROFILE_UPDATED:6,GRP_TIP_MBR_PROFILE_UPDATED:7,GRP_TIP_BAN_AVCHATROOM_MEMBER:10,GRP_TIP_UNBAN_AVCHATROOM_MEMBER:11,MSG_REMIND_ACPT_AND_NOTE:\"AcceptAndNotify\",MSG_REMIND_ACPT_NOT_NOTE:\"AcceptNotNotify\",MSG_REMIND_DISCARD:\"Discard\",GENDER_UNKNOWN:\"Gender_Type_Unknown\",GENDER_FEMALE:\"Gender_Type_Female\",GENDER_MALE:\"Gender_Type_Male\",KICKED_OUT_MULT_ACCOUNT:\"multipleAccount\",KICKED_OUT_MULT_DEVICE:\"multipleDevice\",KICKED_OUT_USERSIG_EXPIRED:\"userSigExpired\",KICKED_OUT_REST_API:\"REST_API_Kick\",ALLOW_TYPE_ALLOW_ANY:\"AllowType_Type_AllowAny\",ALLOW_TYPE_NEED_CONFIRM:\"AllowType_Type_NeedConfirm\",ALLOW_TYPE_DENY_ANY:\"AllowType_Type_DenyAny\",FORBID_TYPE_NONE:\"AdminForbid_Type_None\",FORBID_TYPE_SEND_OUT:\"AdminForbid_Type_SendOut\",JOIN_OPTIONS_FREE_ACCESS:\"FreeAccess\",JOIN_OPTIONS_NEED_PERMISSION:\"NeedPermission\",JOIN_OPTIONS_DISABLE_APPLY:\"DisableApply\",JOIN_STATUS_SUCCESS:\"JoinedSuccess\",JOIN_STATUS_ALREADY_IN_GROUP:\"AlreadyInGroup\",JOIN_STATUS_WAIT_APPROVAL:\"WaitAdminApproval\",INVITE_OPTIONS_DISABLE_INVITE:\"DisableInvite\",INVITE_OPTIONS_NEED_PERMISSION:\"NeedPermission\",INVITE_OPTIONS_FREE_ACCESS:\"FreeAccess\",GRP_PROFILE_OWNER_ID:\"ownerID\",GRP_PROFILE_CREATE_TIME:\"createTime\",GRP_PROFILE_LAST_INFO_TIME:\"lastInfoTime\",GRP_PROFILE_MEMBER_NUM:\"memberNum\",GRP_PROFILE_MAX_MEMBER_NUM:\"maxMemberNum\",GRP_PROFILE_JOIN_OPTION:\"joinOption\",GRP_PROFILE_INVITE_OPTION:\"inviteOption\",GRP_PROFILE_INTRODUCTION:\"introduction\",GRP_PROFILE_NOTIFICATION:\"notification\",GRP_PROFILE_MUTE_ALL_MBRS:\"muteAllMembers\",SNS_ADD_TYPE_SINGLE:\"Add_Type_Single\",SNS_ADD_TYPE_BOTH:\"Add_Type_Both\",SNS_DELETE_TYPE_SINGLE:\"Delete_Type_Single\",SNS_DELETE_TYPE_BOTH:\"Delete_Type_Both\",SNS_APPLICATION_TYPE_BOTH:\"Pendency_Type_Both\",SNS_APPLICATION_SENT_TO_ME:\"Pendency_Type_ComeIn\",SNS_APPLICATION_SENT_BY_ME:\"Pendency_Type_SendOut\",SNS_APPLICATION_AGREE:\"Response_Action_Agree\",SNS_APPLICATION_AGREE_AND_ADD:\"Response_Action_AgreeAndAdd\",SNS_CHECK_TYPE_BOTH:\"CheckResult_Type_Both\",SNS_CHECK_TYPE_SINGLE:\"CheckResult_Type_Single\",SNS_TYPE_NO_RELATION:\"CheckResult_Type_NoRelation\",SNS_TYPE_A_WITH_B:\"CheckResult_Type_AWithB\",SNS_TYPE_B_WITH_A:\"CheckResult_Type_BWithA\",SNS_TYPE_BOTH_WAY:\"CheckResult_Type_BothWay\",NET_STATE_CONNECTED:\"connected\",NET_STATE_CONNECTING:\"connecting\",NET_STATE_DISCONNECTED:\"disconnected\",MSG_AT_ALL:\"__kImSDK_MesssageAtALL__\",READ_ALL_C2C_MSG:\"readAllC2CMessage\",READ_ALL_GROUP_MSG:\"readAllGroupMessage\",READ_ALL_MSG:\"readAllMessage\",USER_STATUS_UNKNOWN:0,USER_STATUS_ONLINE:1,USER_STATUS_OFFLINE:2,USER_STATUS_UNLOGINED:3},k=function(){function e(){o(this,e),this.cache=[],this.options=null}return a(e,[{key:\"use\",value:function(e){if(\"function\"!=typeof e)throw\"middleware must be a function\";return this.cache.push(e),this}},{key:\"next\",value:function(e){if(this.middlewares&&this.middlewares.length>0)return this.middlewares.shift().call(this,this.options,this.next.bind(this))}},{key:\"run\",value:function(e){return this.middlewares=this.cache.map((function(e){return e})),this.options=e,this.next()}}]),e}(),L=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;o(this,e),this.high=t,this.low=n}return a(e,[{key:\"equal\",value:function(e){return null!==e&&(this.low===e.low&&this.high===e.high)}},{key:\"toString\",value:function(){var e=Number(this.high).toString(16),t=Number(this.low).toString(16);if(t.length<8)for(var n=8-t.length;n;)t=\"0\"+t,n--;return e+t}}]),e}(),A={TEST:{CHINA:{DEFAULT:\"wss://wss-dev.tim.qq.com\"},OVERSEA:{DEFAULT:\"wss://wss-dev.tim.qq.com\"},SINGAPORE:{DEFAULT:\"wss://wsssgp-dev.im.qcloud.com\"},KOREA:{DEFAULT:\"wss://wsskr-dev.im.qcloud.com\"},GERMANY:{DEFAULT:\"wss://wssger-dev.im.qcloud.com\"},IND:{DEFAULT:\"wss://wssind-dev.im.qcloud.com\"},JPN:{DEFAULT:\"wss://wssjpn-dev.im.qcloud.com\"},USA:{DEFAULT:\"wss://wssusa-dev.im.qcloud.com\"}},PRODUCTION:{CHINA:{DEFAULT:\"wss://wss.im.qcloud.com\",BACKUP:\"wss://wss.tim.qq.com\",STAT:\"https://events.im.qcloud.com\",ANYCAST:\"wss://162.14.13.203\"},OVERSEA:{DEFAULT:\"wss://wss.im.qcloud.com\",BACKUP:\"wss://wss.my-imcloud.com\",STAT:\"https://api.my-imcloud.com\"},SINGAPORE:{DEFAULT:\"wss://wsssgp.im.qcloud.com\",BACKUP:\"wss://wsssgp.my-imcloud.com\",STAT:\"https://apisgp.my-imcloud.com\"},KOREA:{DEFAULT:\"wss://wsskr.im.qcloud.com\",BACKUP:\"wss://wsskr.my-imcloud.com\",STAT:\"https://apikr.my-imcloud.com\"},GERMANY:{DEFAULT:\"wss://wssger.im.qcloud.com\",BACKUP:\"wss://wssger.my-imcloud.com\",STAT:\"https://apiger.my-imcloud.com\"},IND:{DEFAULT:\"wss://wssind.my-imcloud.com\",BACKUP:\"wss://wssind.im.qcloud.com\",STAT:\"https://apiind.my-imcloud.com\"},JPN:{DEFAULT:\"wss://wssjpn.im.qcloud.com\",BACKUP:\"wss://wssjpn.my-imcloud.com\",STAT:\"https://apijpn.my-imcloud.com\"},USA:{DEFAULT:\"wss://wssusa.im.qcloud.com\",BACKUP:\"wss://wssusa.my-imcloud.com\",STAT:\"https://apiusa.my-imcloud.com\"}}},R={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},N=\"1.7.3\",O=537048168,G=\"CHINA\",U=\"OVERSEA\",P=\"SINGAPORE\",b=\"KOREA\",w=\"GERMANY\",F=\"IND\",q=\"JPN\",x=\"USA\",V={HOST:{CURRENT:{DEFAULT:\"wss://wss.im.qcloud.com\",STAT:\"https://events.im.qcloud.com\"},setCurrent:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:G;this.CURRENT=A.PRODUCTION[e]}},NAME:{OPEN_IM:\"openim\",OPEN_IM_MSG_EXT:\"openim_msg_ext_http_svc\",GROUP:\"group_open_http_svc\",GROUP_AVCHATROOM:\"group_open_avchatroom_http_svc\",GROUP_COMMUNITY:\"million_group_open_http_svc\",GROUP_ATTR:\"group_open_attr_http_svc\",FRIEND:\"sns\",PROFILE:\"profile\",RECENT_CONTACT:\"recentcontact\",PIC:\"openpic\",BIG_GROUP_NO_AUTH:\"group_open_http_noauth_svc\",BIG_GROUP_LONG_POLLING:\"group_open_long_polling_http_svc\",BIG_GROUP_LONG_POLLING_NO_AUTH:\"group_open_long_polling_http_noauth_svc\",IM_OPEN_STAT:\"imopenstat\",WEB_IM:\"webim\",IM_COS_SIGN:\"im_cos_sign_svr\",CUSTOM_UPLOAD:\"im_cos_msg\",HEARTBEAT:\"heartbeat\",IM_OPEN_PUSH:\"im_open_push\",IM_OPEN_STATUS:\"im_open_status\",IM_LONG_MESSAGE:\"im_long_msg\",IM_CONFIG_MANAGER:\"im_sdk_config_mgr\",STAT_SERVICE:\"StatSvc\",OVERLOAD_PUSH:\"OverLoadPush\",IM_MSG_AUDIT_MGR:\"im_msg_audit_mgr\",TUIROOM_SVR:\"tui_room_svr\",IM_OPEN_TRANSLATE:\"im_open_translate\"},CMD:{LOGIN:\"wslogin\",LOGOUT_LONG_POLL:\"longpollinglogout\",LOGOUT:\"wslogout\",HELLO:\"wshello\",STAT_BACKGROUND:\"ws_stat_background\",STAT_FOREGROUND:\"ws_stat_foreground\",SET_TOKEN:\"ws_stat_settoken\",PORTRAIT_GET:\"portrait_get_all\",PORTRAIT_SET:\"portrait_set\",GET_LONG_POLL_ID:\"getlongpollingid\",LONG_POLL:\"longpolling\",AVCHATROOM_LONG_POLL:\"get_msg\",ADD_FRIEND:\"friend_add\",UPDATE_FRIEND:\"friend_update\",GET_FRIEND_LIST:\"friend_get\",GET_FRIEND_PROFILE:\"friend_get_specified\",DELETE_FRIEND:\"friend_delete\",CHECK_FRIEND:\"friend_check\",GET_FRIEND_GROUP_LIST:\"group_get\",RESPOND_FRIEND_APPLICATION:\"friend_response\",GET_FRIEND_APPLICATION_LIST:\"pendency_get\",DELETE_FRIEND_APPLICATION:\"pendency_delete\",REPORT_FRIEND_APPLICATION:\"pendency_report\",GET_GROUP_APPLICATION:\"get_pendency\",CREATE_FRIEND_GROUP:\"group_add\",DELETE_FRIEND_GROUP:\"group_delete\",UPDATE_FRIEND_GROUP:\"group_update\",GET_BLACKLIST:\"black_list_get\",ADD_BLACKLIST:\"black_list_add\",DELETE_BLACKLIST:\"black_list_delete\",CREATE_GROUP:\"create_group\",GET_JOINED_GROUPS:\"get_joined_group_list\",SET_GROUP_ATTRIBUTES:\"set_group_attr\",MODIFY_GROUP_ATTRIBUTES:\"modify_group_attr\",DELETE_GROUP_ATTRIBUTES:\"delete_group_attr\",CLEAR_GROUP_ATTRIBUTES:\"clear_group_attr\",GET_GROUP_ATTRIBUTES:\"get_group_attr\",SEND_MESSAGE:\"sendmsg\",REVOKE_C2C_MESSAGE:\"msgwithdraw\",DELETE_C2C_MESSAGE:\"delete_c2c_msg_ramble\",MODIFY_C2C_MESSAGE:\"modify_c2c_msg\",MODIFY_C2C_MESSAGE_EXTENSIONS:\"set_key_values\",GET_C2C_MESSAGE_EXTENSIONS:\"get_key_values\",SEND_GROUP_MESSAGE:\"send_group_msg\",REVOKE_GROUP_MESSAGE:\"group_msg_recall\",DELETE_GROUP_MESSAGE:\"delete_group_ramble_msg_by_seq\",MODIFY_GROUP_MESSAGE:\"modify_group_msg\",MODIFY_GROUP_MESSAGE_EXTENSIONS:\"group_set_key_values\",GET_GROUP_MESSAGE_EXTENSIONS:\"group_get_key_values\",GET_GROUP_INFO:\"get_group_self_member_info\",GET_GROUP_MEMBER_INFO:\"get_specified_group_member_info\",GET_GROUP_MEMBER_LIST:\"get_group_member_info\",GET_AVCHATROOM_MEMBER_LIST:\"get_members\",MARK_AVCHATROOM_MEMBER_INFO:\"modify_user_info\",QUIT_GROUP:\"quit_group\",CHANGE_GROUP_OWNER:\"change_group_owner\",DESTROY_GROUP:\"destroy_group\",ADD_GROUP_MEMBER:\"add_group_member\",DELETE_GROUP_MEMBER:\"delete_group_member\",BAN_AVCHATROOM_MEMBER:\"ban_group_member\",SEARCH_GROUP_BY_ID:\"get_group_public_info\",APPLY_JOIN_GROUP:\"apply_join_group\",HANDLE_APPLY_JOIN_GROUP:\"handle_apply_join_group\",HANDLE_INVITE_JOIN_GROUP:\"handle_invite_join_permission_group\",HANDLE_GROUP_INVITATION:\"handle_invite_join_group\",MODIFY_GROUP_INFO:\"modify_group_base_info\",MODIFY_GROUP_MEMBER_INFO:\"modify_group_member_info\",DELETE_GROUP_SYSTEM_MESSAGE:\"deletemsg\",DELETE_GROUP_AT_TIPS:\"deletemsg\",GET_GROUP_NOTIFY:\"get_group_notify\",GET_CONVERSATION_LIST:\"get\",PAGING_GET_CONVERSATION_LIST:\"page_get\",DELETE_CONVERSATION:\"batch_delete\",CLEAR_HISTORY_MESSAGE:\"clear_msg\",PIN_CONVERSATION:\"top\",SET_CONVERSATION_CUSTOM_DATA:\"mark_contact\",MARK_CONVERSATION:\"mark_contact\",CREATE_CONVERSATION_GROUP:\"create_contact_group\",DELETE_CONVERSATION_GROUP:\"del_contact_group\",UPDATE_CONVERSATION_GROUP:\"update_contact_group\",GET_CONVERSATION_GROUP_LIST:\"get_contact_group\",GET_MESSAGES:\"getmsg\",GET_C2C_ROAM_MESSAGES:\"getroammsg\",SET_C2C_PEER_MUTE_NOTIFICATIONS:\"set_c2c_peer_mute_notifications\",GET_C2C_PEER_MUTE_NOTIFICATIONS:\"get_c2c_peer_mute_notifications\",GET_GROUP_ROAM_MESSAGES:\"group_msg_get\",GET_READ_RECEIPT:\"get_group_msg_receipt\",GET_READ_RECEIPT_DETAIL:\"get_group_msg_receipt_detail\",SEND_READ_RECEIPT:\"group_msg_receipt\",SEND_C2C_READ_RECEIPT:\"c2c_msg_read_receipt\",SET_C2C_MESSAGE_READ:\"msgreaded\",GET_PEER_READ_TIME:\"get_peer_read_time\",SET_GROUP_MESSAGE_READ:\"msg_read_report\",FILE_READ_AND_WRITE_AUTHKEY:\"authkey\",FILE_UPLOAD:\"pic_up\",COS_SIGN:\"cos\",COS_PRE_SIG:\"pre_sig\",VIDEO_COVER:\"video_cover\",TIM_WEB_REPORT_V2:\"tim_web_report_v2\",BIG_DATA_HALLWAY_AUTH_KEY:\"authkey\",GET_ONLINE_MEMBER_NUM:\"get_online_member_num\",ALIVE:\"alive\",MESSAGE_PUSH:\"msg_push\",MULTI_MESSAGE_PUSH:\"multi_msg_push_ws\",MESSAGE_PUSH_ACK:\"ws_msg_push_ack\",STATUS_FORCE_OFFLINE:\"stat_forceoffline\",DOWNLOAD_MERGER_MESSAGE:\"get_relay_json_msg\",UPLOAD_MERGER_MESSAGE:\"save_relay_json_msg\",FETCH_CLOUD_CONTROL_CONFIG:\"fetch_config\",PUSHED_CLOUD_CONTROL_CONFIG:\"push_configv2\",FETCH_COMMERCIAL_CONFIG:\"fetch_imsdk_purchase_bitsv2\",PUSHED_COMMERCIAL_CONFIG:\"push_imsdk_purchase_bitsv2\",KICK_OTHER:\"KickOther\",OVERLOAD_NOTIFY:\"notify2\",SET_ALL_MESSAGE_READ:\"read_all_unread_msg\",CREATE_TOPIC:\"create_topic\",DELETE_TOPIC:\"destroy_topic\",UPDATE_TOPIC_PROFILE:\"modify_topic\",GET_TOPIC_LIST:\"get_topic\",SET_SELF_STATUS:\"ws_set_custom_status\",GET_USER_STATUS:\"ws_get_user_status\",SUBSCRIBE_USER_STATUS:\"ws_status_subscribe\",UNSUBSCRIBE_USER_STATUS:\"ws_status_unsubscribe\",GET_RPOFANITY_LIST:\"get_local_words\",TRANSLATE_TEXT:\"ws_batch_trans_text\",UPDATE_GROUP_COUNTER:\"update_group_counter\",GET_GROUP_COUNTER:\"get_group_counter\"},CHANNEL:{SOCKET:1,XHR:2,AUTO:0},NAME_VERSION:{openim:\"v4\",group_open_http_svc:\"v4\",sns:\"v4\",profile:\"v4\",recentcontact:\"v4\",openpic:\"v4\",group_open_http_noauth_svc:\"v4\",group_open_long_polling_http_svc:\"v4\",group_open_long_polling_http_noauth_svc:\"v4\",imopenstat:\"v4\",im_cos_sign_svr:\"v4\",im_cos_msg:\"v4\",webim:\"v4\",im_open_push:\"v4\",im_open_status:\"v4\"}},B={SEARCH_MSG:new L(0,Math.pow(2,0)).toString(),SEARCH_GRP_SNS:new L(0,Math.pow(2,1)).toString(),AVCHATROOM_HISTORY_MSG:new L(0,Math.pow(2,2)).toString(),GRP_COMMUNITY:new L(0,Math.pow(2,3)).toString(),MSG_TO_SPECIFIED_GRP_MBR:new L(0,Math.pow(2,4)).toString(),AVCHATROOM_MBR_LIST:new L(0,Math.pow(2,6)).toString(),USER_STATUS:new L(0,Math.pow(2,7)).toString(),CONV_MARK:new L(0,Math.pow(2,9)).toString(),CONV_GROUP:new L(0,Math.pow(2,10)).toString(),AVCHATROOM_BAN_MBR:new L(0,Math.pow(2,11)).toString(),MSG_EXT:new L(0,Math.pow(2,13)).toString(),GRP_COUNTER:new L(0,Math.pow(2,15)).toString()},H=\"c2c_text_message\",K=\"c2c_custom_message\",W=\"group_text_message\",Y=\"group_custom_message\",j=\"user_profile\",z=\"group_profile\",J=\"group_member_profile\";V.HOST.setCurrent(G);var X=\"undefined\"!=typeof wx&&\"function\"==typeof wx.getSystemInfoSync&&Boolean(wx.getSystemInfoSync().fontSizeSetting),Q=\"undefined\"!=typeof qq&&\"function\"==typeof qq.getSystemInfoSync&&Boolean(qq.getSystemInfoSync().fontSizeSetting),Z=\"undefined\"!=typeof tt&&\"function\"==typeof tt.getSystemInfoSync&&Boolean(tt.getSystemInfoSync().fontSizeSetting),$=\"undefined\"!=typeof swan&&\"function\"==typeof swan.getSystemInfoSync&&Boolean(swan.getSystemInfoSync().fontSizeSetting),ee=\"undefined\"!=typeof my&&\"function\"==typeof my.getSystemInfoSync&&Boolean(my.getSystemInfoSync().fontSizeSetting),te=\"undefined\"!=typeof jd&&\"function\"==typeof jd.getSystemInfoSync,ne=\"undefined\"!=typeof uni&&\"undefined\"==typeof window&&\"function\"==typeof uni.requireNativePlugin,oe=\"undefined\"!=typeof uni,se=X||Q||Z||$||ee||ne||te,ae=(\"undefined\"!=typeof uni||\"undefined\"!=typeof window)&&!se,re=Q?qq:Z?tt:$?swan:ee?my:X?wx:ne?uni:te?jd:{},ie=ae&&window&&window.navigator&&window.navigator.userAgent||\"\",ue=/(micromessenger|webbrowser)/i.test(ie),ce=/AppleWebKit\\/([\\d.]+)/i.exec(ie);ce&&parseFloat(ce.pop());var le,pe,de=(le=\"WEB\",ue?le=\"WEB\":Q?le=\"QQ_MP\":Z?le=\"TT_MP\":$?le=\"BAIDU_MP\":ee?le=\"ALI_MP\":X?le=\"WX_MP\":ne&&(le=\"UNI_NATIVE_APP\"),R[le]),ge=/iPad/i.test(ie),_e=/iPhone/i.test(ie)&&!ge,he=/iPod/i.test(ie),fe=_e||ge||he,ve=(pe=ie.match(/OS (\\d+)_/i))&&pe[1]?pe[1]:null,me=/Android/i.test(ie),Me=function(){var e=ie.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);if(!e)return null;var t=e[1]&&parseFloat(e[1]),n=e[2]&&parseFloat(e[2]);return t&&n?parseFloat(e[1]+\".\"+e[2]):t||null}();!function(){var e=ie.match(/Chrome\\/(\\d+)/);e&&e[1]&&parseFloat(e[1])}();var ye=/MSIE/.test(ie)||ie.indexOf(\"Trident\")>-1&&ie.indexOf(\"rv:11.0\")>-1,Ie=function(){var e=/MSIE\\s(\\d+)\\.\\d/.exec(ie),t=e&&parseFloat(e[1]);return!t&&/Trident\\/7.0/i.test(ie)&&/rv:11.0/.test(ie)&&(t=11),t}();!function(){var e=ie.match(/TBS\\/(\\d+)/i);if(e&&e[1])e[1]}();var Ce,Te,De=/Windows/i.test(ie),Ee=/MAC OS X/i.test(ie),Se=ae&&\"undefined\"!=typeof Worker&&!ye,ke=me||fe,Le=ae&&void 0!==window.tencent_cloud_im_csig_flutter_for_web_25F_cy;Ce=\"undefined\"!=typeof console?console:\"undefined\"!=typeof global&&global.console?global.console:\"undefined\"!=typeof window&&window.console?window.console:{};for(var Ae=function(){},Re=[\"assert\",\"clear\",\"count\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"profile\",\"profileEnd\",\"table\",\"time\",\"timeEnd\",\"timeStamp\",\"trace\",\"warn\"],Ne=Re.length;Ne--;)Te=Re[Ne],console[Te]||(Ce[Te]=Ae);var Oe=Ce,Ge=0,Ue=function(){return(new Date).getTime()+Ge},Pe=function(){Ge=0},be=function(){return Math.floor(Ue()/1e3)},we=0;function Fe(){return Ht()?\"%c TIM %c\":\"TIM\"}function qe(){var e,t=((e=new Date).setTime(Ue()),e);return t.toLocaleTimeString(\"en-US\",{hour12:!1})+\".\"+function(e){var t;switch(e.toString().length){case 1:t=\"00\"+e;break;case 2:t=\"0\"+e;break;default:t=e}return t}(t.getMilliseconds())}var xe={arguments2String:function(e){var t=\"\";if(1===e.length)t=e[0];else for(var n=0,o=e.length;n=0?o[a]=t[a]:o[a]=e(t[a])):o[a]=void 0:o[a]=null;return o};function It(e,t){if(!st(e)||!st(t))return!1;var n=!1;return t.forEach((function(t){var o=t.key,s=t.value,a=e.find((function(e){return e.key===o}));a?a.value!==s&&(a.value=s,n=!0):(e.push({key:o,value:s}),n=!0)})),n}var Ct=function(e){return e===S.GRP_AVCHATROOM},Tt=function(e){var t=e.type,n=e.groupID;return t===S.GRP_COMMUNITY||\"\".concat(n).startsWith(ze)&&!\"\".concat(n).includes(Je)},Dt=function(e){return\"\".concat(e).startsWith(ze)&&\"\".concat(e).includes(Je)},Et=function(e){return et(e)&&e.slice(0,3)===S.CONV_C2C},St=function(e){return et(e)&&e.slice(0,5)===S.CONV_GROUP},kt=function(e){return et(e)&&e===S.CONV_SYSTEM};function Lt(e,t){var n={};return Object.keys(e).forEach((function(o){n[o]=t(e[o],o)})),n}function At(e){return se?new Promise((function(t,n){re.getImageInfo({src:e,success:function(e){t({width:e.width,height:e.height})},fail:function(){t({width:0,height:0})}})})):ye&&9===Ie?Promise.resolve({width:0,height:0}):new Promise((function(t,n){var o=new Image;o.onload=function(){t({width:this.width,height:this.height}),o=null},o.onerror=function(){t({width:0,height:0}),o=null},o.src=e}))}function Rt(){function e(){return(65536*(1+Math.random())|0).toString(16).substring(1)}return\"\".concat(e()+e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e()).concat(e())}function Nt(){var e=\"unknown\";if(Ee&&(e=\"mac\"),De&&(e=\"windows\"),fe&&(e=\"ios\"),me&&(e=\"android\"),se)try{var t=re.getSystemInfoSync().platform;void 0!==t&&(e=t)}catch(n){}return e}function Ot(e,t){e=e.split(\".\"),t=t.split(\".\");for(var n=Math.max(e.length,t.length);e.lengtha)return 1;if(s-1?\"\".concat(n,\"&\"):\"\".concat(n,\"?\");c.url=\"\".concat(l,198===r?\"imageView2/3/w/198/h/198\":\"imageView2/3/w/720/h/720\")}return at(n)?(c.url,g(c,Xe)):c}function Ut(e){var t=e[2];e[2]=e[1],e[1]=t;for(var n=0;n=0;o--)\"1\"===e[o]&&t.push(Math.pow(2,n-o-1));return t}function Ht(){return!ye&&!se}function Kt(e){return\"the length of userIDList cannot exceed \".concat(e)}function Wt(e,t){if(e){var n=e;return t&&(e.startsWith(\"http://\")?n=e.replace(/^http:\\/\\/[^/]+/,t):e.startsWith(\"https://\")&&(n=e.replace(/^https:\\/\\/[^/]+/,t))),n}}var Yt=Object.prototype.hasOwnProperty;function jt(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(ot(e)){for(var t in e)if(Yt.call(e,t))return!1;return!0}return!(!Qe(e)&&(n=e,\"set\"!==ct(n))&&!Ze(e))&&0===e.size;var n}function zt(e,t,n){if(void 0===t)return!0;var o=!0;if(ot(t))Object.keys(t).forEach((function(s){var a=1===e.length?e[0][s]:void 0;o=!!Jt(a,t[s],n,s)&&o}));else if(st(t))for(var s=0;s256)||(en({api:\"setConversationCustomData\",param:\"customData\",desc:dn(\"customData\",256)}),!1):(en({api:\"setConversationCustomData\",param:\"customData\",desc:tn()}),!1)}}},markConversation:{conversationIDList:t({},Cn),markType:{type:\"number\",validator:function(e){return $e(e)?e<=0?(en({api:\"markConversation\",param:\"markType\",desc:(t=\"markType\",n=0,Sn(\"NumberGreaterThanLog\",t,n))}),!1):!(e>=Math.pow(2,64))||(en({api:\"markConversation\",param:\"markType\",desc:gn(\"markType\",\"Math.pow(2,64)\")}),!1):(en({api:\"markConversation\",param:\"markType\",desc:on()}),!1);var t,n}},enableMark:t({},Dn)},createConversationGroup:{conversationIDList:t({},Cn),groupName:t(t({},In),{},{validator:function(e){return!!e&&(!(e.length>32)||(en({api:\"createConversationGroup\",param:\"groupName\",desc:dn(\"groupName\",32)}),!1))}})},deleteConversationGroup:[t({name:\"groupName\"},In)],renameConversationGroup:{oldName:t({},In),newName:t(t({},In),{},{validator:function(e){return!!e&&(!(e.length>32)||(en({api:\"renameConversationGroup\",param:\"newName\",desc:dn(\"newName\",32)}),!1))}})},addConversationsToGroup:{conversationIDList:t({},Cn),groupName:t({},In)},deleteConversationsFromGroup:{conversationIDList:t({},Cn),groupName:t({},In)},getGroupList:{groupProfileFilter:{type:\"Array\"}},getGroupProfile:{groupID:In,groupCustomFieldFilter:{type:\"Array\"},memberCustomFieldFilter:{type:\"Array\"}},getGroupProfileAdvance:{groupIDList:Cn},createGroup:{name:In},joinGroup:{groupID:In,type:{type:\"String\"},applyMessage:{type:\"String\"}},quitGroup:[t({name:\"groupID\"},In)],handleApplication:{message:Tn,handleAction:In,handleMessage:{type:\"String\"}},changeGroupOwner:{groupID:In,newOwnerID:In},updateGroupProfile:{groupID:In,muteAllMembers:{type:\"Boolean\"}},dismissGroup:[t({name:\"groupID\"},In)],searchGroupByID:[t({name:\"groupID\"},In)],initGroupAttributes:{groupID:In,groupAttributes:t(t({},Tn),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!et(e[n]))return en({api:\"initGroupAttributes\",param:\"groupAttributes\",desc:_n(\"value\")}),t=!1})),t}})},setGroupAttributes:{groupID:In,groupAttributes:t(t({},Tn),{},{validator:function(e){var t=!0;return Object.keys(e).forEach((function(n){if(!et(e[n]))return en({api:\"setGroupAttributes\",param:\"groupAttributes\",desc:_n(\"value\")}),t=!1})),t}})},deleteGroupAttributes:{groupID:In,keyList:{type:\"Array\",validator:function(e){if(at(e)||!st(e))return en({api:\"deleteGroupAttributes\",param:\"keyList\",desc:un()}),!1;if(!jt(e)){var t=!0;return e.forEach((function(e){if(!et(e))return en({api:\"deleteGroupAttributes\",param:\"keyList\",desc:Sn(\"StringArrayRequiredLog\")}),t=!1})),t}return!0}}},getGroupAttributes:{groupID:In,keyList:{type:\"Array\",validator:function(e){if(at(e)||!st(e))return en({api:\"getGroupAttributes\",param:\"keyList\",desc:un()}),!1;if(!jt(e)){var t=!0;return e.forEach((function(e){if(!et(e))return en({api:\"getGroupAttributes\",param:\"keyList\",desc:_n(\"key\")}),t=!1})),t}return!0}}},setGroupCounters:{groupID:In,counters:Tn},increaseGroupCounter:{groupID:In,key:In,value:En},decreaseGroupCounter:{groupID:In,key:In,value:En},getGroupCounters:{groupID:In},getGroupMemberList:{groupID:In,count:{type:\"Number\"}},getGroupMemberProfile:{groupID:In,userIDList:Cn,memberCustomFieldFilter:{type:\"Array\"}},addGroupMember:{groupID:In,userIDList:Cn},setGroupMemberRole:{groupID:In,userID:In,role:In},setGroupMemberMuteTime:{groupID:In,userID:In,muteTime:{type:\"Number\",validator:function(e){return e>=0}}},setGroupMemberNameCard:{groupID:In,userID:{type:\"String\"},nameCard:{type:\"String\",validator:function(e){return et(e)?(e.length,!0):(en({api:\"setGroupMemberNameCard\",param:\"nameCard\",desc:tn()}),!1)}}},setGroupMemberCustomField:{groupID:In,userID:{type:\"String\"},memberCustomField:Cn},deleteGroupMember:{groupID:In},markGroupMemberList:{groupID:In,markType:{type:\"number\",validator:function(e){return $e(e)?!(e<1e3)||(en({api:\"markGroupMemberList\",param:\"markType\",desc:(t=\"markType\",n=1e3,Sn(\"NumberGreaterOrEqualLog\",t,n))}),!1):(en({api:\"markGroupMemberList\",param:\"markType\",desc:on()}),!1);var t,n}},userIDList:t({},Cn),enableMark:t({},Dn)},createTextMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?et(e.text)?0!==e.text.length||(en({api:\"createTextMessage\",param:\"payload.text\",desc:fn()}),!1):(en({api:\"createTextMessage\",param:\"payload.text\",desc:tn()}),!1):(en({api:\"createTextMessage\",param:\"payload\",desc:hn()}),!1)}})},createTextAtMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?et(e.text)?0===e.text.length?(en({api:\"createTextAtMessage\",param:\"payload.text\",desc:fn()}),!1):!(e.atUserList&&!st(e.atUserList))||(en({api:\"createTextAtMessage\",param:\"payload.atUserList\",desc:un()}),!1):(en({api:\"createTextAtMessage\",param:\"payload.text\",desc:tn()}),!1):(en({api:\"createTextAtMessage\",param:\"payload\",desc:hn()}),!1)}})},createCustomMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?e.data&&!et(e.data)?(en({api:\"createCustomMessage\",param:\"payload.data\",desc:tn()}),!1):e.description&&!et(e.description)?(en({api:\"createCustomMessage\",param:\"payload.description\",desc:tn()}),!1):!(e.extension&&!et(e.extension))||(en({api:\"createCustomMessage\",param:\"payload.extension\",desc:tn()}),!1):(en({api:\"createCustomMessage\",param:\"payload\",desc:hn()}),!1)}})},createImageMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(!ot(e))return en({api:\"createImageMessage\",param:\"payload\",desc:hn()}),!1;if(at(e.file))return en({api:\"createImageMessage\",param:\"payload.file\",desc:sn()}),!1;if(ae){if(!(e.file instanceof HTMLInputElement||Ze(e.file)))return ot(e.file)&&\"undefined\"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(en({api:\"createImageMessage\",param:\"payload.file\",desc:vn()}),!1):(en({api:\"createImageMessage\",param:\"payload.file\",desc:an()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return en({api:\"createImageMessage\",param:\"payload.file\",desc:vn()}),!1}return!0},onProgress:{type:\"Function\",required:!1,validator:function(e){return at(e)&&en({api:\"createImageMessage\",param:\"onProgress\",desc:ln()}),!0}}})},createAudioMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return!!ot(e)||(en({api:\"createAudioMessage\",param:\"payload\",desc:hn()}),!1)}}),onProgress:{type:\"Function\",required:!1,validator:function(e){return at(e)&&en({api:\"createAudioMessage\",param:\"onProgress\",desc:ln()}),!0}}},createVideoMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(!ot(e))return en({api:\"createVideoMessage\",param:\"payload\",desc:hn()}),!1;if(at(e.file))return en({api:\"createVideoMessage\",param:\"payload.file\",desc:sn()}),!1;if(ae){if(!(e.file instanceof HTMLInputElement||Ze(e.file)))return ot(e.file)&&\"undefined\"!=typeof uni?!!Ze(e.file.tempFile)||(en({api:\"createVideoMessage\",param:\"payload.file\",desc:vn()}),!1):(en({api:\"createVideoMessage\",param:\"payload.file\",desc:an()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return en({api:\"createVideoMessage\",param:\"payload.file\",desc:vn()}),!1}return!0}}),onProgress:{type:\"Function\",required:!1,validator:function(e){return at(e)&&en({api:\"createVideoMessage\",param:\"onProgress\",desc:ln()}),!0}}},createFaceMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?$e(e.index)?!!et(e.data)||(en({api:\"createFaceMessage\",param:\"payload.data\",desc:tn()}),!1):(en({api:\"createFaceMessage\",param:\"payload.index\",desc:on()}),!1):(en({api:\"createFaceMessage\",param:\"payload\",desc:hn()}),!1)}})},createFileMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(!ot(e))return en({api:\"createFileMessage\",param:\"payload\",desc:hn()}),!1;if(at(e.file))return en({api:\"createFileMessage\",param:\"payload.file\",desc:sn()}),!1;if(ae){if(!(e.file instanceof HTMLInputElement||Ze(e.file)))return ot(e.file)&&\"undefined\"!=typeof uni?0!==e.file.tempFilePaths.length&&0!==e.file.tempFiles.length||(en({api:\"createFileMessage\",param:\"payload.file\",desc:vn()}),!1):(en({api:\"createFileMessage\",param:\"payload.file\",desc:an()}),!1);if(e.file instanceof HTMLInputElement&&0===e.file.files.length)return en({api:\"createFileMessage\",param:\"payload.file\",desc:vn()}),!1}return!0}}),onProgress:{type:\"Function\",required:!1,validator:function(e){return at(e)&&en({api:\"createFileMessage\",param:\"onProgress\",desc:ln()}),!0}}},createLocationMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){return ot(e)?et(e.description)?$e(e.longitude)?!!$e(e.latitude)||(en({api:\"createLocationMessage\",param:\"payload.latitude\",desc:on()}),!1):(en({api:\"createLocationMessage\",param:\"payload.longitude\",desc:on()}),!1):(en({api:\"createLocationMessage\",param:\"payload.description\",desc:tn()}),!1):(en({api:\"createLocationMessage\",param:\"payload\",desc:hn()}),!1)}})},createMergerMessage:{to:In,conversationType:In,payload:t(t({},Tn),{},{validator:function(e){if(jt(e.messageList))return en({api:\"createMergerMessage\",param:\"payload.messageList\",desc:cn()}),!1;if(jt(e.compatibleText))return en({api:\"createMergerMessage\",param:\"payload.compatibleText\",desc:nn(\"compatibleText\")}),!1;var t=!1;return e.messageList.forEach((function(e){e.status===Qt.FAIL&&(t=!0)})),!t||(en({api:\"createMergerMessage\",param:\"payload.messageList\",desc:Sn(\"MergeFailedMessageLog\")}),!1)}})},revokeMessage:[t(t({name:\"message\"},Tn),{},{validator:function(e){return jt(e)?(en({api:\"revokeMessage\",param:\"message\",desc:mn()}),!1):e.conversationType===S.CONV_SYSTEM?(en({api:\"revokeMessage\",param:\"message\",desc:Sn(\"MessageCanBeRevokedDesc\")}),!1):!0!==e.isRevoked||(en({api:\"revokeMessage\",param:\"message\",desc:Sn(\"MessageRevokedLog\")}),!1)}})],deleteMessage:[t(t({name:\"messageList\"},Cn),{},{validator:function(e){return!jt(e)||(en({api:\"deleteMessage\",param:\"messageList\",desc:cn()}),!1)}})],translateText:{sourceTextList:Cn,sourceLanguage:In,targetLanguage:In},modifyMessage:[t(t({name:\"message\"},Tn),{},{validator:function(e){return jt(e)?(en({api:\"modifyMessage\",param:\"message\",desc:mn()}),!1):e.conversationType===S.CONV_SYSTEM?(en({api:\"modifyMessage\",param:\"message\",desc:Sn(\"MessageCanBeModifiedLog\")}),!1):!0!==e._onlineOnlyFlag||(en({api:\"modifyMessage\",param:\"message\",desc:Sn(\"OnlineMessageNotSupportLog\")}),!1)}})],getUserProfile:{userIDList:{type:\"Array\",validator:function(e){return st(e)?(0===e.length&&en({api:\"getUserProfile\",param:\"userIDList\",desc:cn()}),!0):(en({api:\"getUserProfile\",param:\"userIDList\",desc:un()}),!1)}}},updateMyProfile:{profileCustomField:{type:\"Array\",validator:function(e){return!!at(e)||(!!st(e)||(en({api:\"updateMyProfile\",param:\"profileCustomField\",desc:un()}),!1))}}},setSelfStatus:{customStatus:{type:\"String\",validator:function(e){return!!et(e)||(en({api:\"setSelfStatus\",param:\"customStatus\",desc:tn()}),!1)}}},getUserStatus:{userIDList:{type:\"Array\",validator:function(e){return st(e)?0!==e.length||(en({api:\"getUserStatus\",param:\"userIDList\",desc:cn()}),!1):(en({api:\"getUserStatus\",param:\"userIDList\",desc:un()}),!1)}}},subscribeUserStatus:{userIDList:{type:\"Array\",validator:function(e){return st(e)?0!==e.length||(en({api:\"subscribeUserStatus\",param:\"userIDList\",desc:cn()}),!1):(en({api:\"subscribeUserStatus\",param:\"userIDList\",desc:un()}),!1)}}},unsubscribeUserStatus:{userIDList:{type:\"Array\",validator:function(e){return!e||(!!st(e)||(en({api:\"subscribeUserStatus\",param:\"userIDList\",desc:un()}),!1))}}},addFriend:{to:In,source:{type:\"String\",required:!0,validator:function(e){return!!e&&(e.startsWith(\"AddSource_Type_\")?!(e.replace(\"AddSource_Type_\",\"\").length>8)||(en({api:\"addFriend\",param:\"source\",desc:dn(\"keyword\",8)}),!1):(en({api:\"addFriend\",param:\"source\",desc:Sn(\"SourcePrefixLog\")}),!1))}},remark:{type:\"String\",required:!1,validator:function(e){return!(et(e)&&e.length>96)||(en({api:\"addFriend\",param:\"remark\",desc:dn(\"remark\",96)}),!1)}}},deleteFriend:{userIDList:Cn},checkFriend:{userIDList:Cn},getFriendProfile:{userIDList:Cn},updateFriend:{userID:In,remark:{type:\"String\",required:!1,validator:function(e){return!(et(e)&&e.length>96)||(en({api:\"updateFriend\",param:\"remark\",desc:dn(\"remark\",96)}),!1)}},friendCustomField:{type:\"Array\",required:!1,validator:function(e){if(e){if(!st(e))return en({api:\"updateFriend\",param:\"friendCustomField\",desc:un()}),!1;var t=!0;return e.forEach((function(e){return et(e.key)&&-1!==e.key.indexOf(\"Tag_SNS_Custom\")?et(e.value)?e.key.replace(\"Tag_SNS_Custom_\",\"\").length>8?(en({api:\"updateFriend\",param:\"friendCustomField\",desc:dn(\"keyword\",8)}),t=!1):void 0:(en({api:\"updateFriend\",param:\"friendCustomField\",desc:_n(\"value\")}),t=!1):(en({api:\"updateFriend\",param:\"friendCustomField\",desc:Sn(\"FriendCustomFieldPrefixLog\")}),t=!1)})),t}return!0}}},acceptFriendApplication:{userID:In},refuseFriendApplication:{userID:In},deleteFriendApplication:{userID:In},createFriendGroup:{name:In},deleteFriendGroup:{name:In},addToFriendGroup:{name:In,userIDList:Cn},removeFromFriendGroup:{name:In,userIDList:Cn},renameFriendGroup:{oldName:In,newName:In},sendMessageReadReceipt:[{name:\"messageList\",type:\"Array\",validator:function(e){return st(e)?0!==e.length||(en({api:\"sendMessageReadReceipt\",param:\"messageList\",desc:cn()}),!1):(en({api:\"sendMessageReadReceipt\",param:\"messageList\",desc:un()}),!1)}}],getMessageReadReceiptList:[{name:\"messageList\",type:\"Array\",validator:function(e){return st(e)?0!==e.length||(en({api:\"getMessageReadReceiptList\",param:\"messageList\",desc:cn()}),!1):(en({api:\"getMessageReadReceiptList\",param:\"messageList\",desc:un()}),!1)}}],createTopicInCommunity:{groupID:In,topicName:In},deleteTopicFromCommunity:{groupID:In,topicIDList:{type:\"Array\",validator:function(e){return!e||(!!st(e)||(en({api:\"deleteTopicFromCommunity\",param:\"topicIDList\",desc:un()}),!1))}}},updateTopicProfile:{groupID:In,topicID:In},getTopicList:{groupID:In,topicIDList:{type:\"Array\",validator:function(e){return!e||(!!st(e)||(en({api:\"getTopicList\",param:\"topicIDList\",desc:un()}),!1))}}}},Ln={login:1,logout:1,on:1,once:1,off:1,setLogLevel:1,registerPlugin:1,destroy:1,createTextMessage:1,createTextAtMessage:1,createImageMessage:1,createAudioMessage:1,createVideoMessage:1,createCustomMessage:1,createFaceMessage:1,createFileMessage:1,createLocationMessage:1,createMergerMessage:1,downloadMergerMessage:1,createForwardMessage:1,sendMessage:1,resendMessage:1,revokeMessage:1,deleteMessage:1,translateText:1,modifyMessage:1,sendMessageReadReceipt:1,getGroupMessageReadMemberList:1,getMessageReadReceiptList:1,setMessageExtensions:1,getMessageExtensions:1,deleteMessageExtensions:1,getMessageList:1,findMessage:1,getMessageListHopping:1,setMessageRead:1,setAllMessageRead:1,getConversationList:1,getConversationProfile:1,deleteConversation:1,pinConversation:1,getTotalUnreadMessageCount:1,setConversationCustomData:1,markConversation:1,createConversationGroup:1,getConversationGroupList:1,deleteConversationGroup:1,renameConversationGroup:1,addConversationsToGroup:1,deleteConversationsFromGroup:1,clearHistoryMessage:1,getGroupList:1,getGroupProfile:1,createGroup:1,joinGroup:1,updateGroupProfile:1,quitGroup:1,dismissGroup:1,changeGroupOwner:1,searchGroupByID:1,setMessageRemindType:1,getGroupApplicationList:1,handleGroupApplication:1,initGroupAttributes:1,setGroupAttributes:1,deleteGroupAttributes:1,getGroupAttributes:1,setGroupCounters:1,increaseGroupCounter:1,decreaseGroupCounter:1,getGroupCounters:1,getJoinedCommunityList:1,createTopicInCommunity:1,deleteTopicFromCommunity:1,updateTopicProfile:1,getTopicList:1,getGroupMemberProfile:1,getGroupMemberList:1,addGroupMember:1,deleteGroupMember:1,setGroupMemberNameCard:1,setGroupMemberMuteTime:1,setGroupMemberRole:1,setGroupMemberCustomField:1,getGroupOnlineMemberCount:1,markGroupMemberList:1,getMyProfile:1,getUserProfile:1,updateMyProfile:1,setSelfStatus:1,getUserStatus:1,subscribeUserStatus:1,unsubscribeUserStatus:1,getBlacklist:1,addToBlacklist:1,removeFromBlacklist:1,getFriendList:1,addFriend:1,deleteFriend:1,checkFriend:1,updateFriend:1,getFriendProfile:1,getFriendApplicationList:1,refuseFriendApplication:1,deleteFriendApplication:1,acceptFriendApplication:1,setFriendApplicationRead:1,getFriendGroupList:1,createFriendGroup:1,renameFriendGroup:1,deleteFriendGroup:1,addToFriendGroup:1,removeFromFriendGroup:1,callExperimentalAPI:1},An=1,Rn=2,Nn=3,On=4,Gn=6,Un=7,Pn=8,bn=9,wn=10,Fn=11,qn=12,xn=13,Vn=14,Bn=15,Hn=16,Kn=17,Wn=18,Yn=19,jn=20,zn=21,Jn=22,Xn=23,Qn=24,Zn=25,$n=26,eo=27,to=28,no=29,oo=30,so=31,ao=32,ro=function(){function e(t){o(this,e),this._m=t,this._n=\"\"}return a(e,[{key:\"isLoggedIn\",value:function(){return this._m.getModule(qn).isLoggedIn()}},{key:\"isOversea\",value:function(){return this._m.getModule(qn).isOversea()}},{key:\"isPrivateNetWork\",value:function(){return this._m.getModule(qn).isPrivateNetWork()}},{key:\"getFileDownloadProxy\",value:function(){return this._m.getModule(qn).getFileDownloadProxy()}},{key:\"getMyUserID\",value:function(){return this._m.getModule(qn).getUserID()}},{key:\"getMyTinyID\",value:function(){return this._m.getModule(qn).getTinyID()}},{key:\"getSDKAppID\",value:function(){return this._m.getModule(qn).getSDKAppID()}},{key:\"isIntl\",value:function(){return this._m.getModule(qn).isIntl()}},{key:\"isDevMode\",value:function(){return this._m.getModule(qn).isDevMode()}},{key:\"getModule\",value:function(e){return this._m.getModule(e)}},{key:\"getPlatform\",value:function(){return de}},{key:\"getNetworkType\",value:function(){return this._m.getModule(Bn).getNetworkType()}},{key:\"probeNetwork\",value:function(e){return this._m.getModule(Bn).probe(e)}},{key:\"getCloudConfig\",value:function(e){return this._m.getModule(Xn).getCloudConfig(e)}},{key:\"emitOuterEvent\",value:function(e,t){this._m.getOuterEmitterInstance().emit(e,t)}},{key:\"emitInnerEvent\",value:function(e,t){this._m.getInnerEmitterInstance().emit(e,t)}},{key:\"getInnerEmitterInstance\",value:function(){return this._m.getInnerEmitterInstance()}},{key:\"generateTjgID\",value:function(e){return this._m.getModule(qn).getTinyID()+\"-\"+e.random}},{key:\"filterModifiedMessage\",value:function(e){if(!jt(e)){var t=e.filter((function(e){return!0===e.isModified}));t.length>0&&this.emitOuterEvent(E.MESSAGE_MODIFIED,t)}}},{key:\"filterUnmodifiedMessage\",value:function(e){return jt(e)?[]:e.filter((function(e){return!1===e.isModified}))}},{key:\"request\",value:function(e){return this._m.getModule(jn).request(e)}},{key:\"canIUse\",value:function(e){return this._m.getModule(eo).canIUse(e)}},{key:\"getErrorMessage\",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:\"outputWarning\",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&xe.w(o)}}]),e}(),io=\"wslogin\",uo=\"wslogout\",co=\"wshello\",lo=\"KickOther\",po=\"getmsg\",go=\"authkey\",_o=\"sendmsg\",ho=\"send_group_msg\",fo=\"portrait_get_all\",vo=\"portrait_set\",mo=\"black_list_get\",Mo=\"black_list_add\",yo=\"black_list_delete\",Io=\"msgwithdraw\",Co=\"msgreaded\",To=\"set_c2c_peer_mute_notifications\",Do=\"get_c2c_peer_mute_notifications\",Eo=\"getroammsg\",So=\"get_peer_read_time\",ko=\"delete_c2c_msg_ramble\",Lo=\"modify_c2c_msg\",Ao=\"set_key_values\",Ro=\"get_key_values\",No=\"page_get\",Oo=\"get\",Go=\"batch_delete\",Uo=\"clear_msg\",Po=\"top\",bo=\"deletemsg\",wo=\"set_conv_custom_data\",Fo=\"mark_contact\",qo=\"create_contact_group\",xo=\"del_contact_group\",Vo=\"update_contact_group\",Bo=\"add_conv_to_group\",Ho=\"del_conv_from_group\",Ko=\"get_contact_group\",Wo=\"get_joined_group_list\",Yo=\"get_group_self_member_info\",jo=\"create_group\",zo=\"destroy_group\",Jo=\"modify_group_base_info\",Xo=\"apply_join_group\",Qo=\"apply_join_group_noauth\",Zo=\"quit_group\",$o=\"get_group_public_info\",es=\"change_group_owner\",ts=\"handle_apply_join_group\",ns=\"handle_invite_join_permission_group\",os=\"handle_invite_join_group\",ss=\"group_msg_recall\",as=\"msg_read_report\",rs=\"read_all_unread_msg\",is=\"group_msg_get\",us=\"get_group_msg_receipt\",cs=\"group_msg_receipt\",ls=\"c2c_msg_read_receipt\",ps=\"get_group_msg_receipt_detail\",ds=\"get_pendency\",gs=\"deletemsg\",_s=\"get_msg\",hs=\"get_msg_noauth\",fs=\"get_online_member_num\",vs=\"delete_group_ramble_msg_by_seq\",ms=\"modify_group_msg\",Ms=\"set_group_attr\",ys=\"modify_group_attr\",Is=\"delete_group_attr\",Cs=\"clear_group_attr\",Ts=\"get_group_attr\",Ds=\"group_set_key_values\",Es=\"group_get_key_values\",Ss=\"get_group_notify\",ks=\"update_group_counter\",Ls=\"get_group_counter\",As=\"get_group_member_info\",Rs=\"get_members\",Ns=\"get_specified_group_member_info\",Os=\"add_group_member\",Gs=\"delete_group_member\",Us=\"ban_group_member\",Ps=\"modify_group_member_info\",bs=\"modify_user_info\",ws=\"cos\",Fs=\"pre_sig\",qs=\"video_cover\",xs=\"tim_web_report_v2\",Vs=\"alive\",Bs=\"msg_push\",Hs=\"multi_msg_push_ws\",Ks=\"ws_msg_push_ack\",Ws=\"stat_forceoffline\",Ys=\"save_relay_json_msg\",js=\"get_relay_json_msg\",zs=\"fetch_config\",Js=\"push_configv2\",Xs=\"fetch_imsdk_purchase_bitsv2\",Qs=\"push_imsdk_purchase_bitsv2\",Zs=\"notify2\",$s=\"create_topic\",ea=\"destroy_topic\",ta=\"modify_topic\",na=\"get_topic\",oa=\"ws_set_custom_status\",sa=\"ws_get_user_status\",aa=\"ws_status_subscribe\",ra=\"ws_status_unsubscribe\",ia=\"ws_stat_background\",ua=\"ws_stat_foreground\",ca=\"ws_stat_settoken\",la=\"get_local_words\",pa=\"ws_batch_trans_text\",da={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,MESSAGE_SEND_FAIL:2100,MESSAGE_SEND_FAIL_NOT_IN_AVCHATROOM:2101,MESSAGE_SEND_NEED_MESSAGE_INSTANCE:2105,MESSAGE_SEND_INVALID_CONVERSATION_TYPE:2106,MESSAGE_FILE_IS_EMPTY:2108,MESSAGE_ONPROGRESS_FUNCTION_ERROR:2109,MESSAGE_REVOKE_FAIL:2110,MESSAGE_DELETE_FAIL:2111,MESSAGE_UNREAD_ALL_FAIL:2112,READ_RECEIPT_MESSAGE_LIST_EMPTY:2114,MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL:2115,CANNOT_DELETE_GROUP_SYSTEM_NOTICE:2116,TRANSLATE_TEXT_FAIL:2117,MESSAGE_IMAGE_SELECT_FILE_FIRST:2251,MESSAGE_IMAGE_TYPES_LIMIT:2252,MESSAGE_IMAGE_SIZE_LIMIT:2253,MESSAGE_AUDIO_UPLOAD_FAIL:2300,MESSAGE_AUDIO_SIZE_LIMIT:2301,MESSAGE_VIDEO_UPLOAD_FAIL:2350,MESSAGE_VIDEO_SIZE_LIMIT:2351,MESSAGE_VIDEO_TYPES_LIMIT:2352,MESSAGE_FILE_UPLOAD_FAIL:2400,MESSAGE_FILE_SELECT_FILE_FIRST:2401,MESSAGE_FILE_SIZE_LIMIT:2402,MESSAGE_FILE_URL_IS_EMPTY:2403,MESSAGE_MERGER_TYPE_INVALID:2450,MESSAGE_MERGER_KEY_INVALID:2451,MESSAGE_MERGER_DOWNLOAD_FAIL:2452,MESSAGE_FORWARD_TYPE_INVALID:2453,MESSAGE_MODIFY_CONFLICT:2480,MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM:2481,CONVERSATION_NOT_FOUND:2500,USER_OR_GROUP_NOT_FOUND:2501,CONVERSATION_UN_RECORDED_TYPE:2502,INVALID_CONVERSATION_ID:2503,ILLEGAL_GROUP_TYPE:2600,CANNOT_JOIN_WORK:2601,ILLEGAL_GROUP_ID:2602,CANNOT_FIND_GROUP:2603,CANNOT_CHANGE_OWNER_IN_AVCHATROOM:2620,CANNOT_CHANGE_OWNER_TO_SELF:2621,CANNOT_DISMISS_WORK:2622,MEMBER_NOT_IN_GROUP:2623,JOIN_GROUP_FAIL:2660,CANNOT_ADD_MEMBER_IN_AVCHATROOM:2661,CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN:2662,NOT_OWNER:2681,CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM:2682,INVALID_MEMBER_ROLE:2683,CANNOT_SET_SELF_MEMBER_ROLE:2684,CANNOT_MUTE_SELF:2685,BAN_DURATION_INVALID:2686,NOT_MY_FRIEND:2700,ALREADY_MY_FRIEND:2701,FRIEND_GROUP_EXISTED:2710,FRIEND_GROUP_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,CANNOT_FIND_PROTOCOL:2997,CANNOT_FIND_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,CANNOT_USE_COMMERCIAL_ABILITY:3122,PROFANITY_FOUND:3123,MESSAGE_A2KEY_EXPIRED:20002,ACCOUNT_A2KEY_EXPIRED:70001,HELLO_ANSWER_KICKED_OUT:1002,OPEN_SERVICE_OVERLOAD_ERROR:60022},ga=\"networkRTT\",_a=\"messageE2EDelay\",ha=\"sendMessageC2C\",fa=\"sendMessageGroup\",va=\"sendMessageGroupAV\",ma=\"sendMessageRichMedia\",Ma=\"cosUpload\",ya=\"messageReceivedGroup\",Ia=\"messageReceivedGroupAVPush\",Ca=\"messageReceivedGroupAVPull\",Ta=(r(Xt={},ga,2),r(Xt,_a,3),r(Xt,ha,4),r(Xt,fa,5),r(Xt,va,6),r(Xt,ma,7),r(Xt,ya,8),r(Xt,Ia,9),r(Xt,Ca,10),r(Xt,Ma,11),Xt),Da={info:4,warning:5,error:6},Ea={wifi:1,\"2g\":2,\"3g\":3,\"4g\":4,\"5g\":5,unknown:6,none:7,online:8},Sa={login:4},ka=function(){function e(t){o(this,e),this._n=\"SSOLogData\",this.eventType=Sa[t]||0,this.timestamp=0,this.networkType=8,this.code=0,this.message=\"\",this.moreMessage=\"\",this.extension=t,this.costTime=0,this.duplicate=!1,this.level=4,this.uiPlatform=void 0,this._sentFlag=!1,this._startts=Ue()}return a(e,[{key:\"updateTimeStamp\",value:function(){this.timestamp=Ue()}},{key:\"start\",value:function(e){return this._startts=e,this}},{key:\"end\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this._sentFlag){var n=Ue();0===this.costTime&&(this.costTime=n-this._startts),this.setMoreMessage(\"startts:\".concat(this._startts,\" endts:\").concat(n)),t?(this._sentFlag=!0,this._eventStatModule&&this._eventStatModule.pushIn(this)):setTimeout((function(){e._sentFlag=!0,e._eventStatModule&&e._eventStatModule.pushIn(e)}),0)}}},{key:\"setError\",value:function(e,t,n){if(!(e instanceof Error))return xe.w(\"\".concat(this._n,\".setError value not instanceof Error, please check!\")),this;if(this._sentFlag)return this;if(this.setNetworkType(n),t)e.code&&this.setCode(e.code),e.message&&this.setMoreMessage(e.message);else{var o=da.NO_NETWORK;this.setCode(o)}return this.setLevel(\"error\"),this}},{key:\"setCode\",value:function(e){return at(e)||this._sentFlag||(\"ECONNABORTED\"===e&&(this.code=103),$e(e)?this.code=e:xe.w(\"\".concat(this._n,\".setCode value not a number, please check!\"),e,n(e))),this}},{key:\"setMessage\",value:function(e){return at(e)||this._sentFlag||($e(e)&&(this.message=e.toString()),et(e)&&(this.message=e)),this}},{key:\"setCostTime\",value:function(e){return this.costTime=e,this}},{key:\"setLevel\",value:function(e){return at(e)||this._sentFlag||(this.level=Da[e]),this}},{key:\"setMoreMessage\",value:function(e){return jt(this.moreMessage)?this.moreMessage=\"\".concat(e):this.moreMessage+=\" \".concat(e),this}},{key:\"setNetworkType\",value:function(e){if(at(e))xe.w(\"\".concat(this._n,\".setNetworkType value is undefined, please check!\"));else{var t=Ea[e.toLowerCase()];at(t)||(this.networkType=t)}return this}},{key:\"getStartTs\",value:function(){return this._startts}},{key:\"setUIPlatform\",value:function(e){this.uiPlatform=e}}],[{key:\"bindEventStatModule\",value:function(t){e.prototype._eventStatModule=t}}]),e}(),La=function(){function e(t){o(this,e),this.type=S.MSG_TEXT,this.content={text:t.text||\"\"}}return a(e,[{key:\"setText\",value:function(e){this.content.text=e}},{key:\"sendable\",value:function(){return 0!==this.content.text.length}}]),e}(),Aa=function(){function e(t,n){o(this,e),this._imageMemoryURL=\"\",this._fileDownloadProxy=n,se?this.createImageDataASURLInWXMiniApp(t.file):this.createImageDataASURLInWeb(t.file),this._initImageInfoModel(),this.type=S.MSG_IMAGE,this._percent=0,this.content={imageFormat:t.imageFormat||Ve.UNKNOWN,uuid:t.uuid,imageInfoArray:[]},this.initImageInfoArray(t.imageInfoArray),this._autoFixUrl()}return a(e,[{key:\"_initImageInfoModel\",value:function(){var e=this;this._ImageInfoModel=function(t){this.instanceID=_t(9999999),this.sizeType=t.type||0,this.type=0,this.size=t.size||0,this.width=t.width||0,this.height=t.height||0,this.imageUrl=t.url||\"\",this.url=Wt(t.url||e._imageMemoryURL,e._fileDownloadProxy)},this._ImageInfoModel.prototype={setSizeType:function(e){this.sizeType=e},setType:function(e){this.type=e},setImageUrl:function(e){e&&(this.imageUrl=e)},getImageUrl:function(){return this.imageUrl}}}},{key:\"initImageInfoArray\",value:function(e){for(var t=0,n=null,o=null;t<=2;)o=at(e)||at(e[t])?{type:0,size:0,width:0,height:0,url:\"\"}:e[t],(n=new this._ImageInfoModel(o)).setSizeType(t+1),n.setType(t),this.addImageInfo(n),t++;this.updateAccessSideImageInfoArray()}},{key:\"updateImageInfoArray\",value:function(e){for(var t,n=this.content.imageInfoArray.length,o=0;o1&&(this._percent=1)}},{key:\"updateImageFormat\",value:function(e){this.content.imageFormat=Ve[e.toUpperCase()]||Ve.UNKNOWN}},{key:\"createImageDataASURLInWeb\",value:function(e){void 0!==e&&e.files.length>0&&(this._imageMemoryURL=window.URL.createObjectURL(e.files[0]))}},{key:\"createImageDataASURLInWXMiniApp\",value:function(e){e&&e.url&&(this._imageMemoryURL=e.url)}},{key:\"replaceImageInfo\",value:function(e,t){this.content.imageInfoArray[t]instanceof this._ImageInfoModel||(this.content.imageInfoArray[t]=e)}},{key:\"addImageInfo\",value:function(e){this.content.imageInfoArray.length>=3||this.content.imageInfoArray.push(e)}},{key:\"updateAccessSideImageInfoArray\",value:function(){var e=this.content.imageInfoArray,t=e[0],n=t.width,o=void 0===n?0:n,s=t.height,a=void 0===s?0:s;0!==o&&0!==a&&(Ut(e),Object.assign(e[2],Gt({originWidth:o,originHeight:a,min:720})))}},{key:\"sendable\",value:function(){return 0!==this.content.imageInfoArray.length&&(\"\"!==this.content.imageInfoArray[0].imageUrl&&0!==this.content.imageInfoArray[0].size)}}]),e}(),Ra=function(){function e(t){o(this,e),this.type=S.MSG_FACE,this.content=t||null}return a(e,[{key:\"sendable\",value:function(){return null!==this.content}}]),e}(),Na=function(){function e(t,n){o(this,e),this.type=S.MSG_AUDIO,this._percent=0,this.content={downloadFlag:2,second:t.second,size:t.size,url:Wt(t.url,n),remoteAudioUrl:t.url||\"\",uuid:t.uuid}}return a(e,[{key:\"updatePercent\",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:\"updateAudioUrl\",value:function(e){this.content.remoteAudioUrl=e}},{key:\"sendable\",value:function(){return\"\"!==this.content.remoteAudioUrl}}]),e}(),Oa={from:!0,groupID:!0,groupName:!0,to:!0},Ga=function(){function e(t){o(this,e),this.type=S.MSG_GRP_TIP,this.content={},this._initContent(t)}return a(e,[{key:\"_initContent\",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case\"remarkInfo\":break;case\"groupProfile\":t.content.groupProfile={},t._initGroupProfile(e[n]);break;case\"operatorInfo\":break;case\"memberInfoList\":case\"msgMemberInfo\":t._updateMemberList(e[n]);break;case\"memberExtraInfo\":case\"onlineMemberInfo\":break;case\"memberNum\":t.content[n]=e[n],t.content.memberCount=e[n];break;case\"newGroupProfile\":t.content.newGroupProfile={},t._initNewGroupProfile(e[n]);break;default:t.content[n]=e[n]}})),this.content.userIDList||(this.content.userIDList=[this.content.operatorID])}},{key:\"_initGroupProfile\",value:function(e){for(var t=Object.keys(e),n=0;n1&&(this._percent=1)}},{key:\"updateFileUrl\",value:function(e){this.content.fileUrl=e}},{key:\"sendable\",value:function(){return\"\"!==this.content.fileUrl&&(\"\"!==this.content.fileName&&0!==this.content.fileSize)}}]),e}(),wa=function(){function e(t){o(this,e),this.type=S.MSG_CUSTOM,this.content={data:t.data||\"\",description:t.description||\"\",extension:t.extension||\"\"}}return a(e,[{key:\"setData\",value:function(e){return this.content.data=e,this}},{key:\"setDescription\",value:function(e){return this.content.description=e,this}},{key:\"setExtension\",value:function(e){return this.content.extension=e,this}},{key:\"sendable\",value:function(){return 0!==this.content.data.length||0!==this.content.description.length||0!==this.content.extension.length}}]),e}(),Fa=function(){function e(t,n){o(this,e),this.type=S.MSG_VIDEO,this._percent=0,this.content={remoteVideoUrl:t.remoteVideoUrl||t.videoUrl||\"\",videoFormat:t.videoFormat,videoSecond:parseInt(t.videoSecond,10),videoSize:t.videoSize,videoUrl:Wt(t.videoUrl,n),videoDownloadFlag:2,videoUUID:t.videoUUID,thumbUUID:t.thumbUUID,thumbFormat:t.thumbFormat,thumbWidth:t.thumbWidth,snapshotWidth:t.thumbWidth,thumbHeight:t.thumbHeight,snapshotHeight:t.thumbHeight,thumbSize:t.thumbSize,snapshotSize:t.thumbSize,thumbDownloadFlag:2,thumbUrl:Wt(t.thumbUrl,n),snapshotUrl:Wt(t.thumbUrl,n)}}return a(e,[{key:\"updatePercent\",value:function(e){this._percent=e,this._percent>1&&(this._percent=1)}},{key:\"updateVideoUrl\",value:function(e){e&&(this.content.remoteVideoUrl=e)}},{key:\"updateSnapshotInfo\",value:function(e){var t=e.snapshotUrl,n=e.snapshotWidth,o=e.snapshotHeight;jt(t)||(this.content.thumbUrl=this.content.snapshotUrl=t),jt(n)||(this.content.thumbWidth=this.content.snapshotWidth=Number(n)),jt(o)||(this.content.thumbHeight=this.content.snapshotHeight=Number(o))}},{key:\"sendable\",value:function(){return\"\"!==this.content.remoteVideoUrl}}]),e}(),qa=function(){function e(t){o(this,e),this.type=S.MSG_LOCATION;var n=t.description,s=t.longitude,a=t.latitude;this.content={description:n,longitude:s,latitude:a}}return a(e,[{key:\"sendable\",value:function(){return!0}}]),e}(),xa=function(){function e(t,n){if(o(this,e),this.from=t.from,this.messageSender=t.from,this.time=t.time,this.messageSequence=t.sequence,this.clientSequence=t.clientSequence||t.sequence,this.messageRandom=t.random,this.cloudCustomData=t.cloudCustomData||\"\",this.clientTime=t.clientTime||void 0,t.ID)this.ID=t.ID||\"\",this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",this.messageBody=[{type:t.type,payload:t.payload}],t.conversationType.startsWith(S.CONV_C2C)?this.receiverUserID=t.to:t.conversationType.startsWith(S.CONV_GROUP)&&(this.receiverGroupID=t.to),this.messageReceiver=t.to;else{this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",this.messageBody=[];var s=t.elements[0].type,a=t.elements[0].content;this._patchRichMediaPayload(s,a),this._updateRichMediaDownloadUrl(s,a,n),s===S.MSG_MERGER?this.messageBody.push({type:s,payload:new Va(a).content}):this.messageBody.push({type:s,payload:a}),t.groupID&&(this.receiverGroupID=t.groupID,this.messageReceiver=t.groupID),t.to&&(this.receiverUserID=t.to,this.messageReceiver=t.to),this.ID=\"\".concat(t.tinyID,\"-\").concat(t.clientTime,\"-\").concat(t.random)}}return a(e,[{key:\"_patchRichMediaPayload\",value:function(e,t){e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(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===S.MSG_VIDEO?!t.remoteVideoUrl&&t.videoUrl&&(t.remoteVideoUrl=t.videoUrl):e===S.MSG_AUDIO?!t.remoteAudioUrl&&t.url&&(t.remoteAudioUrl=t.url):e===S.MSG_FILE&&!t.fileUrl&&t.url&&(t.fileUrl=t.url,t.url=void 0)}},{key:\"_updateRichMediaDownloadUrl\",value:function(e,t,n){n&&(e===S.MSG_IMAGE?t.imageInfoArray.forEach((function(e){e.url=Wt(e.url,n)})):e===S.MSG_VIDEO?(t.videoUrl=Wt(t.videoUrl,n),t.snapshotUrl=Wt(t.thumbUrl,n),t.snapshotHeight=t.thumbHeight,t.snapshotWidth=t.thumbWidth):e===S.MSG_AUDIO?t.url=Wt(t.url,n):e===S.MSG_FILE&&(t.fileUrl=Wt(t.fileUrl,n)))}}]),e}(),Va=function(){function e(t,n){if(o(this,e),this.type=S.MSG_MERGER,this.content={downloadKey:\"\",pbDownloadKey:\"\",messageList:[],title:\"\",abstractList:[],compatibleText:\"\",version:0,layersOverLimit:!1},t.downloadKey){var s=t.downloadKey,a=t.pbDownloadKey,r=t.title,i=t.abstractList,u=t.compatibleText,c=t.version;this.content.downloadKey=s,this.content.pbDownloadKey=a,this.content.title=r,this.content.abstractList=i,this.content.compatibleText=u,this.content.version=c||0}else if(jt(t.messageList))1===t.layersOverLimit&&(this.content.layersOverLimit=!0);else{var l=t.messageList,p=t.title,d=t.abstractList,g=t.compatibleText,_=t.version,h=[];l.forEach((function(e){if(!jt(e)){var t=new xa(e,n);h.push(t)}})),this.content.messageList=h,this.content.title=p,this.content.abstractList=d,this.content.compatibleText=g,this.content.version=_||0}}return a(e,[{key:\"sendable\",value:function(){return!jt(this.content.messageList)||!jt(this.content.downloadKey)}}]),e}(),Ba={1:S.MSG_PRIORITY_HIGH,2:S.MSG_PRIORITY_NORMAL,3:S.MSG_PRIORITY_LOW,4:S.MSG_PRIORITY_LOWEST},Ha=function(){function e(t){o(this,e),this.ID=\"\",this.conversationID=t.conversationID||null,this.conversationType=t.conversationType||S.CONV_C2C,this.conversationSubType=t.conversationSubType,this.time=t.time||Math.ceil(Date.now()/1e3),this.sequence=t.sequence||0,this.clientSequence=t.clientSequence||t.sequence||0,this.random=t.random||0===t.random?t.random:_t(),this.priority=this._computePriority(t.priority),this.nick=t.nick||\"\",this.avatar=t.avatar||\"\",this.isPeerRead=!1,this.nameCard=\"\",this._elements=[],this.isPlaceMessage=t.isPlaceMessage||0,this.isRevoked=2===t.isPlaceMessage||8===t.msgFlagBits,this.from=t.from||null,this.to=t.to||null,this.flow=\"\",this.isSystemMessage=t.isSystemMessage||!1,this.protocol=t.protocol||\"JSON\",this.isResend=!1,this.isRead=!1,this.status=t.status||Qt.SUCCESS,this._onlineOnlyFlag=!1,this._groupAtInfoList=[],this._relayFlag=!1,this.atUserList=[],this.cloudCustomData=t.cloudCustomData||\"\",this.isDeleted=!1,this.isModified=!1,this._isExcludedFromUnreadCount=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromUnreadCount),this._isExcludedFromLastMessage=!(!t.messageControlInfo||1!==t.messageControlInfo.excludedFromLastMessage),this.clientTime=t.clientTime||be()||0,this.senderTinyID=t.senderTinyID||t.tinyID||\"\",this.readReceiptInfo=t.readReceiptInfo||{readCount:void 0,unreadCount:void 0,isPeerRead:void 0},this.needReadReceipt=!0===t.needReadReceipt||1===t.needReadReceipt,this.version=t.messageVersion||0,this.isBroadcastMessage=t.isBroadcastMessage||!1,this._receiverList=t.receiverList||void 0,this.isSupportExtension=!0===t.isSupportExtension||1===t.isSupportExtension,this.revoker=t.revokerInfo&&t.revokerInfo.revoker||null,this.reInitialize(t.currentUser),this.extractGroupInfo(t.groupProfile||null),this.handleGroupAtInfo(t),this.initC2CReadReceiptInfo(t.readReceiptSentByPeer)}return a(e,[{key:\"elements\",get:function(){return this._elements}},{key:\"getElements\",value:function(){return this._elements}},{key:\"extractGroupInfo\",value:function(e){if(null!==e){et(e.nick)&&(this.nick=e.nick),et(e.avatar)&&(this.avatar=e.avatar);var t=e.messageFromAccountExtraInformation;ot(t)&&et(t.nameCard)&&(this.nameCard=t.nameCard)}}},{key:\"handleGroupAtInfo\",value:function(e){var t=this;e.payload&&e.payload.atUserList&&e.payload.atUserList.forEach((function(e){e!==S.MSG_AT_ALL?(t._groupAtInfoList.push({groupAtAllFlag:0,groupAtUserID:e}),t.atUserList.push(e)):(t._groupAtInfoList.push({groupAtAllFlag:1}),t.atUserList.push(S.MSG_AT_ALL))})),st(e.groupAtInfo)&&e.groupAtInfo.forEach((function(e){0===e.groupAtAllFlag?t.atUserList.push(e.groupAtUserID):1===e.groupAtAllFlag&&t.atUserList.push(S.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(e){e&&(this.status=this.from?Qt.SUCCESS:Qt.UNSEND,!this.from&&(this.from=e)),this._initFlow(e),this._initSequence(e),this._concatConversationID(e),this.generateMessageID()}},{key:\"isSendable\",value:function(){return 0!==this._elements.length&&(\"function\"==typeof this._elements[0].sendable&&this._elements[0].sendable())}},{key:\"_initTo\",value:function(e){this.conversationType===S.CONV_GROUP&&(this.to=e.groupID)}},{key:\"_initSequence\",value:function(e){0===this.clientSequence&&e&&(this.clientSequence=function(e){if(!e)return!1;if(void 0===mt[e]){var t=new Date,n=\"3\".concat(t.getHours()).slice(-2),o=\"0\".concat(t.getMinutes()).slice(-2),s=\"0\".concat(t.getSeconds()).slice(-2);mt[e]=parseInt([n,o,s,\"0001\"].join(\"\")),n=null,o=null,s=null,xe.l(\"autoIncrementIndex start index:\".concat(mt[e]))}return mt[e]++}(e)),0===this.sequence&&this.conversationType===S.CONV_C2C&&(this.sequence=this.clientSequence)}},{key:\"generateMessageID\",value:function(){this.from===S.CONV_SYSTEM&&(this.senderTinyID=\"144115198244471703\"),this.ID=\"\".concat(this.senderTinyID,\"-\").concat(this.clientTime,\"-\").concat(this.random)}},{key:\"_initFlow\",value:function(e){\"\"!==e&&(e===this.from?(this.flow=\"out\",this.isRead=!0):this.flow=\"in\")}},{key:\"_concatConversationID\",value:function(e){var t=this.to,n=\"\",o=this.conversationType;o!==S.CONV_SYSTEM?(n=o===S.CONV_C2C?e===this.from?t:this.from:this.to,this.conversationID=n?\"\".concat(o).concat(n):null):this.conversationID=S.CONV_SYSTEM}},{key:\"isElement\",value:function(e){return e instanceof La||e instanceof Aa||e instanceof Ra||e instanceof Na||e instanceof ba||e instanceof Fa||e instanceof Ga||e instanceof Pa||e instanceof wa||e instanceof qa||e instanceof Va}},{key:\"setElement\",value:function(e,t){var n=this;if(this.isElement(e))return this._elements=[e],void this._initProxy();var o=function(e){if(e.type&&e.content)switch(e.type){case S.MSG_TEXT:n.setTextElement(e.content);break;case S.MSG_IMAGE:n.setImageElement(e.content,t);break;case S.MSG_AUDIO:n.setAudioElement(e.content,t);break;case S.MSG_FILE:n.setFileElement(e.content,t);break;case S.MSG_VIDEO:n.setVideoElement(e.content,t);break;case S.MSG_CUSTOM:n.setCustomElement(e.content);break;case S.MSG_LOCATION:n.setLocationElement(e.content);break;case S.MSG_GRP_TIP:n.setGroupTipElement(e.content);break;case S.MSG_GRP_SYS_NOTICE:n.setGroupSystemNoticeElement(e.content);break;case S.MSG_FACE:n.setFaceElement(e.content);break;case S.MSG_MERGER:n.setMergerElement(e.content,t)}};if(st(e))for(var s=0;s1&&void 0!==arguments[1]&&arguments[1];if(e instanceof Wa)return t&&null!==Ya&&Ya.emit(E.ERROR,e),Promise.reject(e);if(e instanceof Error){var n=new Wa({code:da.UNCAUGHT_ERROR});return t&&null!==Ya&&Ya.emit(E.ERROR,n),Promise.reject(n)}if(!at(e)&&!at(e.code)){var o=new Wa(e);return t&&null!==Ya&&Ya.emit(E.ERROR,o),Promise.reject(o)}},Xa=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n=\"C2CModule\",t._messageFromUnreadDBMap=new Map,t._signalingFromUnreadDBList=[],t}return a(s,[{key:\"onNewC2CMessage\",value:function(e){var t=e.dataList,n=e.isInstantMessage,o=e.C2CRemainingUnreadList,s=e.C2CPairUnreadList;xe.d(\"\".concat(this._n,\".onNewC2CMessage count:\").concat(t.length,\" isInstantMessage:\").concat(n));var a=this._newC2CMessageStoredAndSummary({dataList:t,C2CRemainingUnreadList:o,C2CPairUnreadList:s,isInstantMessage:n}),r=a.conversationOptionsList,i=a.messageList,u=a.isUnreadC2CMessage;(this.filterModifiedMessage(i),r.length>0)&&this.getModule(Fn).onNewMessage({conversationOptionsList:r,isInstantMessage:n,isUnreadC2CMessage:u});var c=this.filterUnmodifiedMessage(i);n&&c.length>0&&this.emitOuterEvent(E.MESSAGE_RECEIVED,c),i.length=0}},{key:\"_newC2CMessageStoredAndSummary\",value:function(e){for(var t=e.dataList,n=e.C2CRemainingUnreadList,o=e.C2CPairUnreadList,s=e.isInstantMessage,a=null,r=[],i=[],u={},c=this.getModule(Hn),l=this.getModule($n),p=!1,d=this.getModule(Fn),g=this.getFileDownloadProxy(),_=0,h=t.length;_0&&l.addMessageDelay(a.clientTime)}else this._messageFromUnreadDBMap.set(a.ID,1);if(0!==f.msgLifeTime){if(!1===a._onlineOnlyFlag){var k=d.getLastMessageTime(v);if($e(k)&&a.time0){R=!0;var n=r.find((function(t){return t.conversationID===\"C2C\".concat(o[e].from)}));n?n.unreadCount=o[e].unreadCount:r.push({conversationID:\"C2C\".concat(o[e].from),unreadCount:o[e].unreadCount,type:S.CONV_C2C})}},O=0,G=o.length;O0&&(o=e.cloudCustomData);var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push(\"NoUnread\"),!0===i&&s.push(\"NoLastMsg\"),!0===u&&s.push(\"NoMsgCheck\")}var c=this.isOnlineMessage(e,t)?0:void 0;return{protocolName:_o,tjgID:this.generateTjgID(e),requestData:{fromAccount:this.getMyUserID(),toAccount:e.to,msgBody:e.getElements(),cloudCustomData:o,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:c,nick:e.nick,avatar:e.avatar,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||\"\",desc:n.description||\"\",ext:n.extension||\"\",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||\"\"}}:void 0,messageControlInfo:0!==c?s:void 0,clientTime:e.clientTime,needReadReceipt:!0===e.needReadReceipt?1:0,isSupportExtension:!0===e.isSupportExtension?1:0}}}},{key:\"_isVoipPush\",value:function(e){var t=void 0;return at(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:\"isOnlineMessage\",value:function(e,t){return!(!t||!0!==t.onlineUserOnly)}},{key:\"revokeMessage\",value:function(e){return this.request({protocolName:Io,requestData:{msgInfo:{fromAccount:e.from,toAccount:e.to,msgSeq:e.sequence,msgRandom:e.random,msgTimeStamp:e.time}}})}},{key:\"deleteMessage\",value:function(e){var t=e.to,n=e.keyList;return xe.l(\"\".concat(this._n,\".deleteMessage toAccount:\").concat(t,\" count:\").concat(n.length)),this.request({protocolName:ko,requestData:{fromAccount:this.getMyUserID(),to:t,keyList:n}})}},{key:\"modifyRemoteMessage\",value:function(e){var t=e.from,n=e.to,o=e.version,s=void 0===o?0:o,a=e.sequence,r=e.random,i=e.time,u=e.payload,c=e.type,l=e.cloudCustomData,p=void 0;return Vt(c)&&(p=[]).push({type:c,content:u}),this.request({protocolName:Lo,requestData:{from:t,to:n,version:s,sequence:a,random:r,time:i,elements:p,cloudCustomData:l}})}},{key:\"setMessageRead\",value:function(e){var t=this,n=e.conversationID,o=e.lastMessageTime,s=\"\".concat(this._n,\".setMessageRead\");xe.l(\"\".concat(s,\" conversationID:\").concat(n,\" lastMessageTime:\").concat(o)),$e(o)||this.outputWarning(\"DoNotModifyLastTime\");var a=new ka(\"setC2CMessageRead\");return a.setMessage(\"conversationID:\".concat(n,\" lastMessageTime:\").concat(o)),this.request({protocolName:Co,requestData:{C2CMsgReaded:{cookie:\"\",C2CMsgReadedItem:[{toAccount:n.replace(\"C2C\",\"\"),lastMessageTime:o,receipt:1}]}}}).then((function(){a.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(s,\" ok\"));var e=t.getModule(Fn);return e.updateIsReadAfterReadReport({conversationID:n,lastMessageTime:o}),e.updateUnreadCount(n),Ka()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.l(\"\".concat(s,\" failed. error:\"),e),Ja(e)}))}},{key:\"getRoamingMessage\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessage\"),o=e.peerAccount,s=e.conversationID,a=e.count,r=e.lastMessageTime,i=e.messageKey,u=\"peerAccount:\".concat(o,\" count:\").concat(a||15,\" lastMessageTime:\").concat(r||0,\" messageKey:\").concat(i);xe.l(\"\".concat(n,\" \").concat(u));var c=new ka(\"getC2CRoamingMessages\");return this.request({protocolName:Eo,requestData:{peerAccount:o,count:a||15,lastMessageTime:r||0,messageKey:i}}).then((function(e){var o=e.data,a=o.complete,r=o.messageList,i=o.messageKey,l=o.lastMessageTime;at(r)?xe.l(\"\".concat(n,\" ok. complete:\").concat(a,\" but messageList is undefined!\")):xe.l(\"\".concat(n,\" ok. complete:\").concat(a,\" count:\").concat(r.length)),c.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(u,\" complete:\").concat(a,\" length:\").concat(r.length)).end();var p=t.getModule(Fn);1===a&&p.setCompleted(s);var d=p.onRoamingMessage(r,s);p.modifyMessageList(s),p.updateIsRead(s),p.updateRoamingMessageKeyAndTime(s,i,l);var g=p.getPeerReadTime(s);if(xe.l(\"\".concat(n,\" update isPeerRead property. conversationID:\").concat(s,\" peerReadTime:\").concat(g)),g)p.updateMessageIsPeerReadProperty(s,g);else{var _=s.replace(S.CONV_C2C,\"\");t.getRemotePeerReadTime([_]).then((function(){p.updateMessageIsPeerReadProperty(s,p.getPeerReadTime(s))}))}var h=\"\";if(d.length>0)h=d[0].ID;else{var f=p.getLocalOldestMessage(s);f&&(h=f.ID)}return xe.l(\"\".concat(n,\" nextReqID:\").concat(h,\" stored message count:\").concat(d.length)),{nextReqID:h,storedMessageList:d}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setMessage(u).setError(e,o,s).end()})),xe.w(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"getRoamingMessagesHopping\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessagesHopping\"),o=e.peerAccount,s=e.time,a=void 0===s?0:s,r=e.count,i=e.direction,u=\"\".concat(S.CONV_C2C).concat(o),c=\"peerAccount:\".concat(o,\" count:\").concat(r,\" time:\").concat(a,\" direction:\").concat(i);xe.l(\"\".concat(n,\" \").concat(c));var l=new ka(\"getC2CRoamingMessagesHopping\");return this.request({protocolName:Eo,requestData:{peerAccount:o,count:r+1,lastMessageTime:a,direction:i}}).then((function(e){var o=e.data,s=o.complete,a=o.messageList,r=void 0===a?[]:a,p=o.lastMessageTime;xe.l(\"\".concat(n,\" ok. complete:\").concat(s,\" count:\").concat(r.length)),l.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(c,\" complete:\").concat(s,\" length:\").concat(r.length)).end(),1!==s&&(1===i?r.pop():r.shift());var d=t.getModule(Fn).onRoamingMessage(r,u,!1);t._modifyMessageList(u,d);var g=t._computeResult({complete:s,lastMessageTime:p,resultList:d});return Ka(g)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setMessage(c).setError(e,o,s).end()})),xe.w(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_computeResult\",value:function(e){var t=e.complete,n=void 0===t?0:t,o=e.lastMessageTime,s=e.resultList,a={messageList:m(void 0===s?[]:s),isCompleted:!1,nextMessageTime:\"\"};return 1===n?(a.isCompleted=!0,a):(a.nextMessageTime=o,a)}},{key:\"_modifyMessageList\",value:function(e,t){var n=this.getModule(Fn).getLocalConversation(e);if(n)for(var o=n.userProfile.nick,s=n.userProfile.avatar,a=this.getModule(On).getNickAndAvatarByUserID(this.getMyUserID()),r=a.nick,i=a.avatar,u=t.length-1;u>=0;u--){var c=t[u];\"in\"===c.flow&&(c.nick!==o&&c.setNickAndAvatar({nick:o}),c.avatar!==s&&c.setNickAndAvatar({avatar:s})),\"out\"===c.flow&&(c.nick!==r&&c.setNickAndAvatar({nick:r}),c.avatar!==i&&c.setNickAndAvatar({avatar:i}))}}},{key:\"getRemotePeerReadTime\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRemotePeerReadTime\");if(jt(e))return xe.w(\"\".concat(n,\" userIDList is empty!\")),Promise.resolve();var o=new ka(\"getPeerReadTime\");return xe.l(\"\".concat(n,\" userIDList:\").concat(e)),this.request({protocolName:So,requestData:{userIDList:e}}).then((function(s){var a=s.data.peerReadTimeList;xe.l(\"\".concat(n,\" ok. peerReadTimeList:\").concat(a));for(var r=\"\",i=t.getModule(Fn),u=0;u0&&i.recordPeerReadTime(\"C2C\".concat(e[u]),a[u]);o.setNetworkType(t.getNetworkType()).setMessage(r).end()})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.w(\"\".concat(n,\" failed. error:\"),e)}))}},{key:\"sendReadReceipt\",value:function(e){var t=this,n=e[0].conversationID.replace(S.CONV_C2C,\"\"),o=new ka(\"sendC2CReadReceipt\");o.setMessage(\"peerAccount:\".concat(n));var s=this.getMyUserID(),a=e.filter((function(e){return e.from!==s&&!0===e.needReadReceipt})).map((function(e){return{fromAccount:e.from,toAccount:e.to,sequence:e.sequence,random:e.random,time:e.time,clientTime:e.clientTime}}));if(0===a.length)return Ja({code:da.READ_RECEIPT_MESSAGE_LIST_EMPTY});var r=\"\".concat(this._n,\".sendReadReceipt\");return xe.l(\"\".concat(r,\". peerAccount:\").concat(n,\" messageInfoList length:\").concat(a.length)),this.request({protocolName:ls,requestData:{peerAccount:n,messageInfoList:a}}).then((function(e){return o.end(),xe.l(\"\".concat(r,\" ok\")),Ka()})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.w(\"\".concat(r,\" failed. error:\"),e),Ja(e)}))}},{key:\"getReadReceiptList\",value:function(e){var t=\"\".concat(this._n,\".getReadReceiptList\"),n=this.getMyUserID(),o=e.filter((function(e){return e.from===n&&!0===e.needReadReceipt}));return xe.l(\"\".concat(t,\" userID:\").concat(n,\" messageList length:\").concat(o.length)),za({messageList:o})}},{key:\"getMessageExtensions\",value:function(e,t){return xe.l(\"\".concat(this._n,\".getMessageExtensions startSequence:\").concat(t)),this.request({protocolName:Ro,requestData:{from:e.from,to:e.to,messageKey:this._getMessageKey(e),startSequence:t}})}},{key:\"modifyMessageExtensions\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return xe.l(\"\".concat(this._n,\".modifyMessageExtensions operateType:\").concat(n)),this.request({protocolName:Ao,requestData:{from:e.from,to:e.to,messageKey:this._getMessageKey(e),extensionList:t,operateType:n}})}},{key:\"_getMessageKey\",value:function(e){var t=e.clientSequence,n=e.random,o=e.time;return\"\".concat(t,\"_\").concat(n,\"_\").concat(o)}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._messageFromUnreadDBMap.clear(),this._signalingFromUnreadDBList.length=0}}]),s}(ro),Qa=function(){function e(){o(this,e),this.list=new Map,this._n=\"MessageListHandler\",this._latestMessageSentByPeerMap=new Map,this._latestMessageSentByMeMap=new Map}return a(e,[{key:\"getLocalOldestMessageByConversationID\",value:function(e){if(!e)return null;if(!this.list.has(e))return null;var t=this.list.get(e).values();return t?t.next().value:null}},{key:\"pushIn\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.conversationID,o=!0;this.list.has(n)||this.list.set(n,new Map);var s=this._getUniqueIDOfMessage(e),a=this.list.get(n).has(s);if(a){var r=this.list.get(n).get(s);if(!t||!0===r.isModified)return o=!1}return this.list.get(n).set(s,e),this._setLatestMessageSentByPeer(n,e),this._setLatestMessageSentByMe(n,e),o}},{key:\"unshift\",value:function(e,t){var n;if(st(e)?e.length>0&&(n=e[0].conversationID,this._unshiftMultipleMessages(e,t)):(n=e.conversationID,this._unshiftSingleMessage(e,t)),n&&n.startsWith(S.CONV_C2C)){var o=Array.from(this.list.get(n).values()),s=o.length;if(0===s)return;for(var a=s-1;a>=0;a--)if(\"out\"===o[a].flow){this._setLatestMessageSentByMe(n,o[a]);break}for(var r=s-1;r>=0;r--)if(\"in\"===o[r].flow){this._setLatestMessageSentByPeer(n,o[r]);break}}}},{key:\"_unshiftSingleMessage\",value:function(e,t){var n=e.conversationID,o=this._getUniqueIDOfMessage(e);if(!this.list.has(n))return this.list.set(n,new Map),this.list.get(n).set(o,e),void t.push(e);var s=this.list.get(n),a=Array.from(s);s.has(o)||(a.unshift([o,e]),this.list.set(n,new Map(a)),t.push(e))}},{key:\"_unshiftMultipleMessages\",value:function(e,t){for(var n=e.length,o=[],s=e[0].conversationID,a=this.list.get(s),r=this.list.has(s)?Array.from(a):[],i=0;i=0;l--)\"in\"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));xe.l(\"\".concat(this._n,\".modifyMessageSentByPeer conversationID:\").concat(t,\" count:\").concat(u))}}}},{key:\"modifyMessageSentByMe\",value:function(e){var t=e.conversationID,n=e.latestNick,o=e.latestAvatar,s=this.list.get(t);if(!jt(s)){var a=Array.from(s.values()),r=a.length;if(0!==r){for(var i=null,u=0,c=!1,l=r-1;l>=0;l--)\"out\"===a[l].flow&&((i=a[l]).nick!==n&&(i.setNickAndAvatar({nick:n}),c=!0),i.avatar!==o&&(i.setNickAndAvatar({avatar:o}),c=!0),c&&(u+=1));xe.l(\"\".concat(this._n,\".modifyMessageSentByMe conversationID:\").concat(t,\" count:\").concat(u))}}}},{key:\"getTopicConversationIDList\",value:function(e){return m(this.list.keys()).filter((function(t){return t.startsWith(\"\".concat(S.CONV_GROUP).concat(e))}))}},{key:\"traversal\",value:function(){if(0!==this.list.size&&-1===xe.getLevel()){console.group(\"conversationID-messageCount\");var e,t=D(this.list);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];console.log(\"\".concat(o,\"-\").concat(s.size))}}catch(a){t.e(a)}finally{t.f()}console.groupEnd()}}},{key:\"onMessageModified\",value:function(e,t){if(!this.list.has(e))return{isUpdated:!1,message:null};var n=this._getUniqueIDOfMessage(t),o=this.list.get(e).has(n);if(xe.d(\"\".concat(this._n,\".onMessageModified conversationID:\").concat(e,\" uniqueID:\").concat(n,\" has:\").concat(o)),o){var s=this.list.get(e).get(n),a=t.messageVersion,r=t.elements,i=t.cloudCustomData;return s.version1&&void 0!==arguments[1]&&arguments[1];if(e)return this._isReady?void(t?e.call(this):setTimeout(e,1)):(this._readyQueue=this._readyQueue||[],void this._readyQueue.push(e))},t.triggerReady=function(){var e=this;this._isReady=!0,setTimeout((function(){var t=e._readyQueue;e._readyQueue=[],t&&t.length>0&&t.forEach((function(e){e.call(this)}),e)}),1)},t.resetReady=function(){this._isReady=!1,this._readyQueue=[]},t.isReady=function(){return this._isReady}};var nr=[\"jpg\",\"jpeg\",\"gif\",\"png\",\"bmp\",\"image\",\"webp\"],or=[\"mp4\",\"quicktime\",\"mov\"],sr=1,ar=2,rr=3,ir=255,ur=function(){function e(t){var n=this;o(this,e),jt(t)||(this.userID=t.userID||\"\",this.nick=t.nick||\"\",this.gender=t.gender||\"\",this.birthday=t.birthday||0,this.location=t.location||\"\",this.selfSignature=t.selfSignature||\"\",this.allowType=t.allowType||S.ALLOW_TYPE_ALLOW_ANY,this.language=t.language||0,this.avatar=t.avatar||\"\",this.messageSettings=t.messageSettings||0,this.adminForbidType=t.adminForbidType||S.FORBID_TYPE_NONE,this.level=t.level||0,this.role=t.role||0,this.lastUpdatedTime=0,this.profileCustomField=[],jt(t.profileCustomField)||t.profileCustomField.forEach((function(e){n.profileCustomField.push({key:e.key,value:e.value})})))}return a(e,[{key:\"validate\",value:function(e){var t=!0,n=\"\";if(jt(e))return{valid:!1,tips:\"empty options\"};if(e.profileCustomField)for(var o=e.profileCustomField.length,s=null,a=0;a500&&(n=\"nick name limited: must less than or equal to \".concat(500,\" bytes, current size: \").concat(gt(e[r]),\" bytes\"),t=!1);break;case\"gender\":vt(He,e.gender)||(n=\"key:gender, invalid value:\"+e.gender,t=!1);break;case\"birthday\":$e(e.birthday)||(n=\"birthday must be a number\",t=!1);break;case\"location\":et(e.location)||(n=\"location must be a string\",t=!1);break;case\"selfSignature\":et(e.selfSignature)||(n=\"selfSignature must be a string\",t=!1);break;case\"allowType\":vt(We,e.allowType)||(n=\"key:allowType, invalid value:\"+e.allowType,t=!1);break;case\"language\":$e(e.language)||(n=\"language must be a number\",t=!1);break;case\"avatar\":et(e.avatar)||(n=\"avatar must be a string\",t=!1);break;case\"messageSettings\":0!==e.messageSettings&&1!==e.messageSettings&&(n=\"messageSettings must be 0 or 1\",t=!1);break;case\"adminForbidType\":vt(Ke,e.adminForbidType)||(n=\"key:adminForbidType, invalid value:\"+e.adminForbidType,t=!1);break;case\"level\":$e(e.level)||(n=\"level must be a number\",t=!1);break;case\"role\":$e(e.role)||(n=\"role must be a number\",t=!1);break;default:n=\"unknown key:\"+r+\" \"+e[r],t=!1}}return{valid:t,tips:n}}}]),e}(),cr=a((function e(t){o(this,e),this.value=t,this.next=null})),lr=function(){function e(t){o(this,e),this.MAX_LENGTH=t,this.pTail=null,this.pNodeToDel=null,this.map=new Map}return a(e,[{key:\"set\",value:function(e){var t=new cr(e);if(this.map.size0&&n.members.forEach((function(e){e.userID===t.selfInfo.userID&&pt(t.selfInfo,e,[\"sequence\"])}))}},{key:\"updateSelfInfo\",value:function(e){var n={nameCard:e.nameCard,joinTime:e.joinTime,role:e.role,messageRemindType:e.messageRemindType,readedSequence:e.readedSequence,excludedUnreadSequenceList:e.excludedUnreadSequenceList};pt(this.selfInfo,t({},n),[],[\"\",null,void 0,0,NaN])}},{key:\"setSelfNameCard\",value:function(e){this.selfInfo.nameCard=e}}]),e}(),gr=function(e,n){return at(e)?{lastTime:0,lastSequence:0,fromAccount:0,messageForShow:\"\",payload:null,type:\"\",isRevoked:!1,cloudCustomData:\"\",onlineOnlyFlag:!1,nick:\"\",nameCard:\"\",version:0,isPeerRead:!1,revoker:null}:e instanceof Ha?{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||\"\",messageForShow:xt(e.type,e.payload,n),payload:e.payload||null,type:e.type||null,isRevoked:e.isRevoked||!1,cloudCustomData:e.cloudCustomData||\"\",onlineOnlyFlag:e._onlineOnlyFlag||!1,nick:e.nick||\"\",nameCard:e.nameCard||\"\",version:e.version||0,isPeerRead:e.isPeerRead||!1,revoker:e.revoker||null}:t(t({},e),{},{messageForShow:xt(e.type,e.payload,n)})},_r=function(){function e(t,n){o(this,e),this.conversationID=t.conversationID||\"\",this.unreadCount=t.unreadCount||0,this.type=t.type||\"\",this.lastMessage=gr(t.lastMessage,n),t.lastMsgTime&&(this.lastMessage.lastTime=t.lastMsgTime),this._isInfoCompleted=!1,this.peerReadTime=t.peerReadTime||0,this.groupAtInfoList=[],this.remark=\"\",this.isPinned=t.isPinned||!1,this.messageRemindType=\"\",this.markList=t.markList||[],this.customData=t.customData||\"\",this.conversationGroupList=t.conversationGroupList||[],this._initProfile(t)}return a(e,[{key:\"toAccount\",get:function(){return this.conversationID.startsWith(S.CONV_C2C)?this.conversationID.replace(S.CONV_C2C,\"\"):this.conversationID.startsWith(S.CONV_GROUP)?this.conversationID.replace(S.CONV_GROUP,\"\"):\"\"}},{key:\"subType\",get:function(){return this.groupProfile?this.groupProfile.type:\"\"}},{key:\"_initProfile\",value:function(e){var t=this;Object.keys(e).forEach((function(n){switch(n){case\"userProfile\":t.userProfile=e.userProfile;break;case\"groupProfile\":t.groupProfile=e.groupProfile}})),at(this.userProfile)&&this.type===S.CONV_C2C?this.userProfile=new ur({userID:e.conversationID.replace(\"C2C\",\"\")}):at(this.groupProfile)&&this.type===S.CONV_GROUP&&(this.groupProfile=new dr({groupID:e.conversationID.replace(\"GROUP\",\"\")}))}},{key:\"updateUnreadCount\",value:function(e){var t=e.nextUnreadCount,n=e.isFromGetConversations,o=e.isUnreadC2CMessage;at(t)||(Ct(this.subType)?this.unreadCount=0:n&&this.type===S.CONV_GROUP||n&&this.type===S.CONV_TOPIC||o&&this.type===S.CONV_C2C?this.unreadCount=t:this.unreadCount=this.unreadCount+t)}},{key:\"updateLastMessage\",value:function(e){this.lastMessage=gr(e)}},{key:\"updateGroupAtInfoList\",value:function(e){if(!this._isNeedMergeGroupAtInfo(e)){var t,n=(M(t=e.groupAtType)||y(t)||I(t)||T()).slice(0);-1!==n.indexOf(S.CONV_AT_ME)&&-1!==n.indexOf(S.CONV_AT_ALL)&&(n=[S.CONV_AT_ALL_AT_ME]);var o={from:e.from,groupID:e.groupID,topicID:e.topicID,messageSequence:e.sequence,atTypeArray:n,__random:e.__random,__sequence:e.__sequence};this.groupAtInfoList.push(o)}}},{key:\"_isNeedMergeGroupAtInfo\",value:function(e){var t=e.groupID,n=e.sequence;if(!Tt({groupID:t}))return!1;var o=!1;return this.groupAtInfoList.forEach((function(t){t.messageSequence===n&&(t.atTypeArray.indexOf(S.CONV_AT_ME)>-1&&e.groupAtType.indexOf(S.CONV_AT_ALL)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME]),t.atTypeArray.indexOf(S.CONV_AT_ALL)>-1&&e.groupAtType.indexOf(S.CONV_AT_ME)>-1&&(t.atTypeArray=[S.CONV_AT_ALL_AT_ME],t.__random=e.__random,t.__sequence=e.__sequence),o=!0)})),o}},{key:\"clearGroupAtInfoList\",value:function(){this.groupAtInfoList.length=0}},{key:\"reduceUnreadCount\",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:\"isLastMessageRevoked\",value:function(e){var t=e.sequence,n=e.time;return this.type===S.CONV_C2C&&t===this.lastMessage.lastSequence&&n===this.lastMessage.lastTime||this.type===S.CONV_GROUP&&t===this.lastMessage.lastSequence}},{key:\"setLastMessageRevoked\",value:function(e){this.lastMessage.isRevoked=e}},{key:\"setLastMessageRevoker\",value:function(e){this.lastMessage.revoker=e}}]),e}(),hr=function(){function e(t){o(this,e),this._conversationModule=t,this._n=\"MessageRemindHandler\",this._updateSequence=0}return a(e,[{key:\"getC2CMessageRemindType\",value:function(){var e=this,t=\"\".concat(this._n,\".getC2CMessageRemindType\");return this._conversationModule.request({protocolName:Do,updateSequence:this._updateSequence}).then((function(n){xe.l(\"\".concat(t,\" ok\"));var o=n.data,s=o.updateSequence,a=o.muteFlagList;e._updateSequence=s,e._patchC2CMessageRemindType(a)})).catch((function(e){xe.e(\"\".concat(t,\" failed. error:\"),e)}))}},{key:\"_patchC2CMessageRemindType\",value:function(e){var t=this,n=0,o=\"\";st(e)&&e.length>0&&e.forEach((function(e){var s=e.userID,a=e.muteFlag;0===a?o=S.MSG_REMIND_ACPT_AND_NOTE:1===a?o=S.MSG_REMIND_DISCARD:2===a&&(o=S.MSG_REMIND_ACPT_NOT_NOTE),!0===t._conversationModule.patchMessageRemindType({ID:s,isC2CConversation:!0,messageRemindType:o})&&(n+=1)})),xe.l(\"\".concat(this._n,\"._patchC2CMessageRemindType count:\").concat(n))}},{key:\"set\",value:function(e){return e.groupID?this._setGroupMessageRemindType(e):st(e.userIDList)?this._setC2CMessageRemindType(e):void 0}},{key:\"_setGroupMessageRemindType\",value:function(e){var t=this,n=\"\".concat(this._n,\"._setGroupMessageRemindType\"),o=e.groupID,s=e.messageRemindType,a=\"groupID:\".concat(o,\" messageRemindType:\").concat(s),r=new ka(\"setMessageRemindType\");return r.setMessage(a),this._getModule(bn).modifyGroupMemberInfo({groupID:o,messageRemindType:s,userID:this._conversationModule.getMyUserID()}).then((function(){r.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok. \").concat(a));var o=t.onGroupMessageRemindTypeUpdated(e);return t._conversationModule.emitTotalUnreadMessageCountUpdate(),Ka(o)})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"onGroupMessageRemindTypeUpdated\",value:function(e){var t=e.groupID,n=e.messageRemindType,o=this._getModule(Un).getLocalGroupProfile(t);if(o&&(o.selfInfo.messageRemindType=n),Dt(t)){var s=t,a=qt(s),r=this._getModule(wn).getLocalTopic(a,s);return r&&(r.updateSelfInfo({messageRemindType:n}),this._conversationModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:a,topic:r})),{topic:r}}return this._conversationModule.patchMessageRemindType({ID:t,isC2CConversation:!1,messageRemindType:n})&&this._emitConversationUpdate(),{group:o}}},{key:\"_setC2CMessageRemindType\",value:function(e){var t=this,n=\"\".concat(this._n,\"._setC2CMessageRemindType\"),o=e.userIDList,s=e.messageRemindType,a=o.slice(0,30),r=0;s===S.MSG_REMIND_DISCARD?r=1:s===S.MSG_REMIND_ACPT_NOT_NOTE&&(r=2);var i=\"userIDList:\".concat(a,\" messageRemindType:\").concat(s),u=new ka(\"setMessageRemindType\");return u.setMessage(i),this._conversationModule.request({protocolName:To,requestData:{userIDList:a,muteFlag:r}}).then((function(e){u.setNetworkType(t._conversationModule.getNetworkType()).end();var o=e.data,r=o.updateSequence,i=o.errorList;t._updateSequence=r;var c=[],l=[];st(i)&&i.forEach((function(e){c.push(e.userID),l.push({userID:e.userID,code:e.errorCode})}));var p=a.filter((function(e){return-1===c.indexOf(e)}));xe.l(\"\".concat(n,\" ok. successUserIDList:\").concat(p,\" failureUserIDList:\").concat(JSON.stringify(l)));var d=0;return p.forEach((function(e){t._conversationModule.patchMessageRemindType({ID:e,isC2CConversation:!0,messageRemindType:s})&&(d+=1)})),d>=1&&t._emitConversationUpdate(),a.length=c.length=0,t._conversationModule.emitTotalUnreadMessageCountUpdate(),za({successUserIDList:p.map((function(e){return{userID:e}})),failureUserIDList:l})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_getModule\",value:function(e){return this._conversationModule.getModule(e)}},{key:\"_emitConversationUpdate\",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:\"setUpdateSequence\",value:function(e){this._updateSequence=e}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._updateSequence=0}}]),e}(),fr=function(){function e(t){o(this,e),this._conversationModule=t,this._n=\"ConvGroupHandler\",this._convGroupMap=new Map,this._startIndex=0,this._pagingStatus=Zt.NOT_START}return a(e,[{key:\"setConvCustomData\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setConvCustomData\"),o=e.conversationIDList,s=e.customData;xe.l(\"\".concat(n,\" options:\"),e);var a=new ka(\"setConvCustomData\");a.setMessage(JSON.stringify(e));var r={fromAccount:this._getMyUserID(),itemList:[]},i=[],u=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(u,e),!0;if(!Et(e)&&!St(e))return t._onConversationIDInvalid(u,e),!0;var n={operationType:2,contactItem:void 0,customMark:s};Et(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,\"\")}:St(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,\"\")}),r.itemList.push(n)})),u.length===o.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:wo,requestData:r}).then((function(e){a.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var o=e.data.resultItem;if(st(o)){var r,c,l=!1;o.forEach((function(e){r=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(r),(c=t._getLocalConversation(r))&&c.customData!==s&&(c.customData=s,l=!0)):u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&t._emitConversationUpdate()}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"markConversation\",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_MARK))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"markConversation\"),o=e.conversationIDList,s=e.markType,a=e.enableMark;xe.l(\"\".concat(n,\" options:\"),e);var r=new ka(\"markConversation\");r.setMessage(JSON.stringify(e));var i=void 0,u=void 0,c=this._getFlagBit(s);!0===a?u=[c]:i=[c];var l={fromAccount:this._getMyUserID(),itemList:[]},p=[],d=[];return o.forEach((function(e){if(!t._hasLocalConversation(e))return t._onConversationNotFound(d,e),!0;if(!Et(e)&&!St(e))return t._onConversationIDInvalid(d,e),!0;var n={operationType:1,contactItem:void 0,clearMark:i,setMark:u};Et(e)?n.contactItem={type:1,toAccount:e.replace(S.CONV_C2C,\"\")}:St(e)&&(n.contactItem={type:2,groupID:e.replace(S.CONV_GROUP,\"\")}),l.itemList.push(n)})),d.length===o.length?za({successConversationIDList:p,failureConversationIDList:d}):this._conversationModule.request({protocolName:Fo,requestData:l}).then((function(e){r.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var o=e.data.resultItem;if(st(o)){var i,u,c=!1;o.forEach((function(e){if(i=t._concatConversationID(e.contactItem),0===e.resultCode){if(p.push(i),u=t._getLocalConversation(i)){var n=u.markList.indexOf(s);!0===a?-1===n&&(u.markList.push(s),c=!0):-1!==n&&(u.markList.splice(n,1),c=!0)}}else d.push({conversationID:i,code:e.resultCode,message:e.resultInfo})})),!0===c&&t._emitConversationUpdate()}return Ka({successConversationIDList:p,failureConversationIDList:d})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"getLocalConvGroupList\",value:function(){var e=this;return xe.l(\"\".concat(this._n,\".getLocalConvGroupList pagingStatus:\").concat(this._pagingStatus)),this._pagingStatus===Zt.REJECTED?this.getRemoteConvGroupList().then((function(){return Ka(m(e._convGroupMap.values()))})):za(m(this._convGroupMap.values()))}},{key:\"getRemoteConvGroupList\",value:function(){var e=this,t=\"\".concat(this._n,\".getRemoteConvGroupList\");return this._pagingStatus=Zt.PENDING,this._conversationModule.request({protocolName:Ko,requestData:{fromAccount:this._getMyUserID(),startIndex:this._startIndex,startTime:be()}}).then((function(n){var o,s,a=n.data,r=a.completeFlag,i=a.contactItem,u=a.nextStartIndex,c=void 0===u?0:u,l=a.groupItem;(e._startIndex=c,xe.l(\"\".concat(t,\" completeFlag:\").concat(r,\" nextStartIndex:\").concat(c)),st(l)&&l.forEach((function(t){var n=t.convGroupID,o=t.groupName;e._convGroupMap.set(n,o)})),st(i))&&i.forEach((function(t){var n=t.standardMark,a=t.customData,r=t.convGroupIDList;if(o=e._concatConversationID(t),(s=e._getLocalConversation(o))&&(s.markList=Bt(n),s.customData=a||\"\",st(r))){var i=[];r.forEach((function(t){e._convGroupMap.has(t)&&i.push(e._convGroupMap.get(t))})),s.conversationGroupList=[].concat(i),i.length=0}}));if(0===r)return e.getRemoteConvGroupList();1===r&&(e._pagingStatus=Zt.RESOLVED,e._emitConversationUpdate(),e._emitConvGroupListUpdate())})).catch((function(n){e._pagingStatus=Zt.REJECTED,xe.w(\"\".concat(t,\" failed. error:\"),n)}))}},{key:\"createConvGroup\",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"createConvGroup\");xe.l(\"\".concat(n,\" options:\"),e);var o=new ka(\"createConvGroup\");o.setMessage(JSON.stringify(e));var s=e.groupName,a=e.conversationIDList,r={fromAccount:this._getMyUserID(),itemList:[{groupName:s,contactItem:[]}]},i=[],u=[];return a.forEach((function(e){return t._hasLocalConversation(e)?Et(e)||St(e)?void(Et(e)?r.itemList[0].contactItem.push({type:1,toAccount:e.replace(S.CONV_C2C,\"\")}):St(e)&&r.itemList[0].contactItem.push({type:2,groupID:e.replace(S.CONV_GROUP,\"\")})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===a.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:qo,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var a=e.data.groupResultItem[0],r=a.groupItem,c=a.resultItem;if(ot(r)&&(t._convGroupMap.set(r.convGroupID,r.groupName),t._emitConvGroupListUpdate()),st(c)){var l,p,d=!1;c.forEach((function(e){l=t._concatConversationID(e.contactItem),0===e.resultCode?(i.push(l),(p=t._getLocalConversation(l))&&-1===p.conversationGroupList.indexOf(s)&&(p.conversationGroupList.push(s),d=!0)):u.push({conversationID:l,code:e.resultCode,message:e.resultInfo})})),!0===d&&(t._emitConversationUpdate(),t._emitConvGroupListUpdate())}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"deleteConvGroup\",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"deleteConvGroup\");xe.l(\"\".concat(n,\" groupName:\").concat(e));var o=new ka(\"deleteConvGroup\");return o.setMessage(e),this._conversationModule.request({protocolName:xo,requestData:{fromAccount:this._getMyUserID(),groupName:[e]}}).then((function(s){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var a=s.data.groupItem;if(st(a)){var r=!1;a.forEach((function(e){t._convGroupMap.has(e.convGroupID)&&(t._convGroupMap.delete(e.convGroupID),r=!0)})),!0===r&&t._emitConvGroupListUpdate()}t._eraseFromConversationGroupList([e])})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"renameConvGroup\",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"renameConvGroup\");xe.l(\"\".concat(n,\" options:\"),e);var o=new ka(\"renameConvGroup\");o.setMessage(JSON.stringify(e));var s=e.oldName,a=e.newName;return this._conversationModule.request({protocolName:Vo,requestData:{fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:1,oldName:s,newName:a}}}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var r=e.data.updateGroupResult.convGroupID;t._convGroupMap.set(r,a),t._emitConvGroupListUpdate();var i,u,c=t._conversationModule.getLocalConversationList(),l=!1;c.forEach((function(e){i=e.conversationGroupList,-1!==(u=i.indexOf(s))&&(i.splice(u,1,a),l=!0)})),!0===l&&t._emitConversationUpdate()})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"addConvsToGroup\",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"addConvsToGroup\");xe.l(\"\".concat(n,\" options:\"),e);var o=new ka(\"addConvsToGroup\");o.setMessage(JSON.stringify(e));var s=e.conversationIDList,a=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?Et(e)||St(e)?void(Et(e)?r.updateGroup.updateItem.push({operationType:1,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,\"\")}}):St(e)&&r.updateGroup.updateItem.push({operationType:1,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,\"\")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Bo,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var s=e.data.updateGroupResult.contactResultItem;if(st(s)){var r,c,l=!1;s.forEach((function(e){r=t._concatConversationID(e.contactItem),0===e.resultCode?(c=t._getLocalConversation(r))&&-1===c.conversationGroupList.indexOf(a)&&(c.conversationGroupList.push(a),i.push(r),l=!0):u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"deleteConvsFromGroup\",value:function(e){var t=this;if(!this._conversationModule.canIUse(B.CONV_GROUP))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"deleteConvsFromGroup\");xe.l(\"\".concat(n,\" options:\"),e);var o=new ka(\"deleteConvsFromGroup\");o.setMessage(JSON.stringify(e));var s=e.conversationIDList,a=e.groupName,r={fromAccount:this._getMyUserID(),updateType:1,updateGroup:{updateGroupType:2,groupName:a,updateItem:[]}},i=[],u=[];return s.forEach((function(e){return t._hasLocalConversation(e)?Et(e)||St(e)?void(Et(e)?r.updateGroup.updateItem.push({operationType:2,contactItem:{type:1,toAccount:e.replace(S.CONV_C2C,\"\")}}):St(e)&&r.updateGroup.updateItem.push({operationType:2,contactItem:{type:2,groupID:e.replace(S.CONV_GROUP,\"\")}})):(t._onConversationIDInvalid(u,e),!0):(t._onConversationNotFound(u,e),!0)})),u.length===s.length?za({successConversationIDList:i,failureConversationIDList:u}):this._conversationModule.request({protocolName:Ho,requestData:r}).then((function(e){o.setNetworkType(t._conversationModule.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var s=e.data.updateGroupResult.contactResultItem;if(st(s)){var r,c,l=!1;s.forEach((function(e){if(r=t._concatConversationID(e.contactItem),0===e.resultCode){if(c=t._getLocalConversation(r)){var n=c.conversationGroupList.indexOf(a);-1!==n&&(c.conversationGroupList.splice(n,1),i.push(r),l=!0)}}else u.push({conversationID:r,code:e.resultCode,message:e.resultInfo})})),!0===l&&(t._emitConversationUpdate(),t._emitConvInGroupUpdate(a))}return Ka({successConversationIDList:i,failureConversationIDList:u})})).catch((function(e){return t._conversationModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"onConvMarkUpdated\",value:function(e){var t=this;if(!jt(e)){var n,o;xe.d(\"\".concat(this._n,\".onConvMarkUpdated markItemList:\"),e);var s=!1;e.forEach((function(e){var a=e.recentContactItem,r=e.optType,i=e.standardMark,u=e.customMark;if(n=t._concatConversationID(a),o=t._getLocalConversation(n))if(1===r){var c=Bt(i);!0!==function(e,t){if(e===t)return!0;if(!e||!t)return!1;if(e.length!==t.length)return!1;for(var n=0,o=e.length;n=0;o--)if(\"1\"===t[o])return n-o-1}},{key:\"_concatConversationID\",value:function(e){var t,n=e.type,o=e.to,s=e.groupID,a=e.userID;return 1===n?at(a)?at(o)||(t=\"\".concat(S.CONV_C2C).concat(o)):t=\"\".concat(S.CONV_C2C).concat(a):2===n&&(t=\"\".concat(S.CONV_GROUP).concat(s)),t}},{key:\"_getMyUserID\",value:function(){return this._conversationModule.getMyUserID()}},{key:\"_insertConversationGroup\",value:function(e,t){var n=this._getLocalConversation(e);if(n){var o=n.conversationGroupList;-1===o.indexOf(t)&&o.push(t)}}},{key:\"_getLocalConversation\",value:function(e){return this._conversationModule.getLocalConversation(e)}},{key:\"_hasLocalConversation\",value:function(e){return this._conversationModule.hasLocalConversation(e)}},{key:\"_emitConversationUpdate\",value:function(){this._conversationModule.emitConversationUpdate(!0,!1)}},{key:\"_emitConvGroupListUpdate\",value:function(){this._conversationModule.emitOuterEvent(E.CONVERSATION_GROUP_LIST_UPDATED,m(this._convGroupMap.values()))}},{key:\"_emitConvInGroupUpdate\",value:function(e){var t={groupName:e,conversationList:[]},n=this._conversationModule.getLocalConversationList();t.conversationList=n.filter((function(t){return t.conversationGroupList.includes(e)})),this._conversationModule.emitOuterEvent(E.CONVERSATION_IN_GROUP_UPDATED,t)}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._convGroupMap.clear(),this._startIndex=0,this._pagingStatus=Zt.NOT_START}}]),e}(),vr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n=\"ConversationModule\",tr.mixin(_(t)),t._messageListHandler=new Qa,t._messageRemindHandler=new hr(_(t)),t._convGroupHandler=new fr(_(t)),t.singlyLinkedList=new lr(100),t._pagingStatus=Zt.NOT_START,t._pagingTimeStamp=0,t._pagingStartIndex=0,t._pagingPinnedTimeStamp=0,t._pagingPinnedStartIndex=0,t._pagingConvIDMap=new Map,t._convIDFromUnreadDBMap=new Map,t._conversationMap=new Map,t._tmpGroupList=[],t._tmpGroupAtTipsList=[],t._peerReadTimeMap=new Map,t._completedMap=new Map,t._roamingMessageKeyAndTimeMap=new Map,t._roamingMessageSequenceMap=new Map,t._remoteGroupReadSequenceMap=new Map,t._convTotalUnreadCount=0,t._pagingGetCostList=[],t._initListeners(),t}return a(s,[{key:\"_initListeners\",value:function(){var e=this.getInnerEmitterInstance();e.on(Za,this._initLocalConversationList,this),e.on(er,this._onProfileUpdated,this)}},{key:\"onCheckTimer\",value:function(e){e%60==0&&this._messageListHandler.traversal()}},{key:\"_initLocalConversationList\",value:function(){var e=this,t=new ka(\"_initLocalConversationList\");xe.l(\"\".concat(this._n,\".\").concat(\"_initLocalConversationList\"));var n=\"\",o=this._getStorageConversationList(),s=this.isIntl();if(o){for(var a=o.length,r=0;r0&&(e.updateConversationGroupProfile(e._tmpGroupList),e._tmpGroupList.length=0)})),this.syncConversationList()}},{key:\"onMessageSent\",value:function(e){this._onSendOrReceiveMessage({conversationOptionsList:e.conversationOptionsList,isInstantMessage:!0})}},{key:\"onNewMessage\",value:function(e){this._onSendOrReceiveMessage(e)}},{key:\"_onSendOrReceiveMessage\",value:function(e){var t=this,n=e.conversationOptionsList,o=e.isInstantMessage,s=void 0===o||o,a=e.isUnreadC2CMessage,r=void 0!==a&&a,i=e.updateUnreadCount,u=void 0===i||i;this._isReady?0!==n.length&&(this._getC2CPeerReadTime(n),this._updateLocalConversationList({conversationOptionsList:n,isInstantMessage:s,isUnreadC2CMessage:r,isFromGetConversations:!1,updateUnreadCount:u}),s||(this._convIDFromUnreadDBMap=new Map([].concat(m(this._convIDFromUnreadDBMap),m(n.map((function(e){return[e.conversationID,1]}))))),this._diffAndDeleteConversation()),this._setStorageConversationList(),n.filter((function(e){return e.type===S.CONV_TOPIC})).length>0||this.emitConversationUpdate()):this.ready((function(){t._onSendOrReceiveMessage(e)}))}},{key:\"updateConversationGroupProfile\",value:function(e){var t=this;if(!st(e)||0!==e.length)if(0!==this._conversationMap.size){var n=!1;e.forEach((function(e){var o=\"GROUP\".concat(e.groupID);if(t._conversationMap.has(o)){n=!0;var s=t._conversationMap.get(o);s.groupProfile=JSON.parse(JSON.stringify(e)),s.lastMessage.lastSequence=0;r--)if(!s[r].isDeleted){a=s[r];break}var i=this._conversationMap.get(o);if(i){var u=!1;i.lastMessage.lastSequence===a.sequence&&i.lastMessage.lastTime===a.time||(jt(a)&&(a=void 0),i.updateLastMessage(a),i.type!==S.CONV_TOPIC&&(u=!0),xe.l(\"\".concat(this._n,\".onMessageDeleted. update conversationID:\").concat(o,\" with lastMessage:\"),i.lastMessage)),o.startsWith(S.CONV_C2C)&&this.updateUnreadCount(o),u&&this.emitConversationUpdate(!0,!1)}}}},{key:\"onMessageModified\",value:function(e){var t=e.conversationType,n=e.from,o=e.to,s=e.time,a=e.sequence,r=e.elements,i=e.cloudCustomData,u=e.messageVersion,c=this.getMyUserID(),l=\"\".concat(t).concat(o);o===c&&t===S.CONV_C2C&&(l=\"\".concat(t).concat(n));var p=this._messageListHandler.onMessageModified(l,e),d=p.isUpdated,g=p.message;!0===d&&this.emitOuterEvent(E.MESSAGE_MODIFIED,[g]);var _=this._isTopicConversation(l);if(xe.l(\"\".concat(this._n,\".onMessageModified isUpdated:\").concat(d,\" isTopicMessage:\").concat(_,\" from:\").concat(n,\" to:\").concat(o)),_){this.getModule(wn).onMessageModified(e)}else{var h=this._conversationMap.get(l);if(h){var f=h.lastMessage;xe.d(\"\".concat(this._n.onMessageModified,\" lastMessage:\"),JSON.stringify(f),\"options:\",JSON.stringify(e)),f&&f.lastTime===s&&f.lastSequence===a&&f.version!==u&&(f.type=r[0].type,f.payload=r[0].content,f.messageForShow=xt(f.type,f.payload,this.isIntl()),f.cloudCustomData=i,f.version=u,this.emitConversationUpdate(!0,!1))}}return g}},{key:\"onNewGroupAtTips\",value:function(e){var n=this,o=e.dataList,s=null;o.forEach((function(e){e.groupAtTips?s=e.groupAtTips:e.elements?s=t(t({},e.elements),{},{sync:!0}):e.groupAtType&&(s=t(t({},e),{},{sync:!0})),s.__random=e.random,s.__sequence=e.clientSequence,n._tmpGroupAtTipsList.push(s)})),xe.d(\"\".concat(this._n,\".onNewGroupAtTips isReady:\").concat(this._isReady),this._tmpGroupAtTipsList),this._isReady&&this._handleGroupAtTipsList()}},{key:\"_handleGroupAtTipsList\",value:function(){var e=this;if(0!==this._tmpGroupAtTipsList.length){var t=!1;this._tmpGroupAtTipsList.forEach((function(n){var o=n.groupID,s=n.from,a=n.topicID,r=void 0===a?void 0:a,i=n.sync,u=void 0!==i&&i;if(s!==e.getMyUserID())if(at(r)){var c=e._conversationMap.get(\"\".concat(S.CONV_GROUP).concat(o));c&&(c.updateGroupAtInfoList(n),t=!0)}else{var l=e._conversationMap.get(\"\".concat(S.CONV_GROUP).concat(r));if(l){l.updateGroupAtInfoList(n);var p=e.getModule(wn),d=l.groupAtInfoList;p.onConversationProxy({topicID:r,groupAtInfoList:d})}if(jt(l)&&u)e.updateTopicConversation([{conversationID:\"\".concat(S.CONV_GROUP).concat(r),type:S.CONV_TOPIC}]),e._conversationMap.get(\"\".concat(S.CONV_GROUP).concat(r)).updateGroupAtInfoList(n)}})),t&&this.emitConversationUpdate(!0,!1),this._tmpGroupAtTipsList.length=0}}},{key:\"_getC2CPeerReadTime\",value:function(e){var t=this,n=[];if(e.forEach((function(e){t._conversationMap.has(e.conversationID)||e.type!==S.CONV_C2C||n.push(e.conversationID.replace(S.CONV_C2C,\"\"))})),n.length>0){xe.d(\"\".concat(this._n,\"._getC2CPeerReadTime userIDList:\").concat(n));var o=this.getModule(Gn);o&&o.getRemotePeerReadTime(n)}}},{key:\"_getStorageConversationList\",value:function(){return this.getModule(xn).getItem(\"conversationMap\")}},{key:\"_setStorageConversationList\",value:function(){var e=this.getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C||e.type===S.CONV_GROUP&&e.lastMessage.type!==S.MSG_GRP_TIP})).slice(0,20).map((function(e){return{conversationID:e.conversationID,type:e.type,subType:e.subType,lastMessage:e.lastMessage,groupProfile:e.groupProfile,userProfile:e.userProfile}}));this.getModule(xn).setItem(\"conversationMap\",e)}},{key:\"emitConversationUpdate\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversationList();if(t){var o=this.getModule(Un);o&&o.updateGroupLastMessage(n)}e&&this.emitOuterEvent(E.CONVERSATION_LIST_UPDATED)}},{key:\"getLocalConversationList\",value:function(){return m(this._conversationMap.values()).filter((function(e){return e.type!==S.CONV_TOPIC}))}},{key:\"getLocalConversation\",value:function(e){return this._conversationMap.get(e)}},{key:\"hasLocalConversation\",value:function(e){return this._conversationMap.has(e)}},{key:\"getLocalOldestMessage\",value:function(e){return this._messageListHandler.getLocalOldestMessage(e)}},{key:\"syncConversationList\",value:function(){var e=this,t=new ka(\"syncConversationList\");return this._pagingStatus===Zt.NOT_START&&this._conversationMap.clear(),this._pagingGetConversationList().then((function(n){var o=function(e){if(st(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),(t/e.length).toFixed(0)}}(e._pagingGetCostList);return xe.l(\"\".concat(e._n,\".\").concat(\"syncConversationList\",\". sum \").concat(function(e){if(st(e)&&0!==e.length){var t=0;return e.forEach((function(e){t+=e})),t.toFixed(0)}}(e._pagingGetCostList),\" ms, average \").concat(o,\" ms\")),e._pagingGetCostList.length=0,e._pagingStatus=Zt.RESOLVED,e._diffAndDeleteConversation(),e.emitConversationUpdate(!0,!1),e._setStorageConversationList(),e._handleC2CPeerReadTime(),e._patchConversationProperties(),t.setMessage(e._conversationMap.size).setMoreMessage(o).setNetworkType(e.getNetworkType()).end(),n})).catch((function(n){return e._pagingStatus=Zt.REJECTED,t.setMessage(e._pagingTimeStamp),e.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];t.setError(n,s,a).end()})),Ja(n)}))}},{key:\"_diffAndDeleteConversation\",value:function(){var e=this;if(this._isSyncCompleted()){var t=[];this._conversationMap.forEach((function(n,o){!e._pagingConvIDMap.has(o)&&e._convIDFromUnreadDBMap.has(o)&&(e._conversationMap.delete(o),t.push(o))})),xe.l(\"\".concat(this._n,\"._diffAndDeleteConversation list:\").concat(t))}}},{key:\"_patchConversationProperties\",value:function(){var e=this,t=Date.now(),n=this.checkAndPatchRemark(),o=this._messageRemindHandler.getC2CMessageRemindType(),s=this.getModule(Un).getGroupList();Promise.all([n,o,s]).then((function(){var n=Date.now()-t;xe.l(\"\".concat(e._n,\"._patchConversationProperties ok. cost \").concat(n,\" ms\")),e.emitConversationUpdate(!0,!1),e.emitTotalUnreadMessageCountUpdate()}))}},{key:\"_pagingGetConversationList\",value:function(){var e=this,t=\"\".concat(this._n,\"._pagingGetConversationList\");xe.l(\"\".concat(t,\" timeStamp:\").concat(this._pagingTimeStamp,\" startIndex:\").concat(this._pagingStartIndex)+\" pinnedTimeStamp:\".concat(this._pagingPinnedTimeStamp,\" pinnedStartIndex:\").concat(this._pagingPinnedStartIndex));var n=Date.now();return this._pagingStatus=Zt.PENDING,this.request({protocolName:No,requestData:{fromAccount:this.getMyUserID(),timeStamp:this._pagingTimeStamp,startIndex:this._pagingStartIndex,pinnedTimeStamp:this._pagingPinnedTimeStamp,pinnedStartIndex:this._pagingPinnedStartIndex,orderType:1}}).then((function(o){var s=o.data,a=s.completeFlag,r=s.conversations,i=void 0===r?[]:r,u=s.timeStamp,c=s.startIndex,l=s.pinnedTimeStamp,p=s.pinnedStartIndex,d=s.groupItem,g=Date.now()-n;if(e._pagingGetCostList.push(g),xe.l(\"\".concat(t,\" ok. completeFlag:\").concat(a,\" count:\").concat(i.length,\" cost \").concat(g,\" ms\")),e._convGroupHandler.onConvGroupListSynced(d),i.length>0){var _=e._getConversationOptions(i);e._pagingConvIDMap=new Map([].concat(m(e._pagingConvIDMap),m(_.map((function(e){return[e.conversationID,1]}))))),e._updateLocalConversationList({conversationOptionsList:_,isFromGetConversations:!0}),e.isLoggedIn()&&e.emitConversationUpdate()}if(!e._isReady){if(!e.isLoggedIn())return za();e.triggerReady()}return e._pagingTimeStamp=u,e._pagingStartIndex=c,e._pagingPinnedTimeStamp=l,e._pagingPinnedStartIndex=p,1!==a?e._pagingGetConversationList():(e._handleGroupAtTipsList(),e._convGroupHandler.getRemoteConvGroupList(),za())})).catch((function(n){throw e.isLoggedIn()&&(e._isReady||(xe.w(\"\".concat(t,\" failed. error:\"),n),e.triggerReady())),n}))}},{key:\"_updateLocalConversationList\",value:function(e){var t,n=e.isFromGetConversations,o=e.isInstantMessage,s=Date.now();t=this._getTmpConversationListMapping(e),this._conversationMap=new Map(this._sortConversationList([].concat(m(t.toBeUpdatedConversationList),m(this._conversationMap)))),n||(this._updateUserOrGroupProfile(t.newConversationList),o&&this.emitTotalUnreadMessageCountUpdate()),xe.d(\"\".concat(this._n,\"._updateLocalConversationList cost \").concat(Date.now()-s,\" ms\"))}},{key:\"_getTmpConversationListMapping\",value:function(e){for(var t=e.conversationOptionsList,n=e.isFromGetConversations,o=e.isInstantMessage,s=e.isUnreadC2CMessage,a=void 0!==s&&s,r=e.updateUnreadCount,i=[],u=[],c=this.getModule(Un),l=this.getModule(Pn),p=this.isIntl(),d=0,g=t.length;d0&&s.getUserProfile({userIDList:n}).then((function(e){var n=e.data;st(n)?n.forEach((function(e){t._doUpdateUserProfile(\"C2C\".concat(e.userID),e)})):t._doUpdateUserProfile(\"C2C\".concat(n.userID),n)})),o.length>0&&a.getGroupProfileAdvance({groupIDList:o,responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\",\"FaceUrl\"]}}).then((function(e){e.data.successGroupList.forEach((function(e){var n=\"GROUP\".concat(e.groupID);if(t._conversationMap.has(n)){var o=t._conversationMap.get(n);pt(o.groupProfile,e,[],[null,void 0,\"\",0,NaN]),!o.subType&&e.type&&(o.subType=e.type)}}))}))}}},{key:\"_doUpdateUserProfile\",value:function(e,t){this.hasLocalConversation(e)&&(this.getLocalConversation(e).userProfile=t)}},{key:\"_getConversationOptions\",value:function(e){var n=this,o=[],s=e.filter((function(e){var t=e.type,n=e.userID;return 1===t&&\"@TLS#NOT_FOUND\"!==n&&\"@TLS#ERROR\"!==n||2===t})),a=this.getMyUserID(),r=s.map((function(e){if(at(e.lastMsg)&&(e.lastMsg={elements:[]}),1===e.type){var s={userID:e.userID,nick:e.peerNick,avatar:e.peerAvatar};return o.push(s),{conversationID:\"C2C\".concat(e.userID),type:\"C2C\",lastMessage:{lastTime:e.time,lastSequence:e.sequence,fromAccount:e.lastC2CMsgFromAccount,messageForShow:e.messageShow,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:null,payload:e.lastMsg.elements[0]?n._amendLayersOverLimitProperty(e.lastMsg.elements[0].content):null,cloudCustomData:e.lastMsg.cloudCustomData||\"\",isRevoked:8===e.lastMessageFlag,onlineOnlyFlag:!1,nick:\"\",nameCard:\"\",version:0,isPeerRead:e.lastC2CMsgFromAccount===a&&e.time<=e.c2cPeerReadTime,revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null},userProfile:new ur(s),peerReadTime:e.c2cPeerReadTime,isPinned:1===e.isPinned,messageRemindType:\"\",customData:e.customMark||\"\",markList:Bt(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}return{conversationID:\"GROUP\".concat(e.groupID),type:\"GROUP\",lastMessage:t(t({lastTime:e.time,lastSequence:e.sequence,fromAccount:e.msgGroupFromAccount,messageForShow:e.messageShow},n._patchTypeAndPayload(e)),{},{cloudCustomData:e.lastMsg.cloudCustomData||\"\",isRevoked:2===e.lastMessageFlag,onlineOnlyFlag:!1,nick:e.senderNick||\"\",nameCard:e.senderNameCard||\"\",revoker:e.lastMsg.revokerInfo?e.lastMsg.revokerInfo.revoker:null}),groupProfile:new dr({groupID:e.groupID,name:e.groupNick,avatar:e.groupImage}),unreadCount:e.unreadCount,peerReadTime:0,isPinned:1===e.isPinned,messageRemindType:\"\",version:0,customData:e.customMark||\"\",markList:Bt(e.standardMark),conversationGroupList:n._convGroupHandler.getConvGroupListByID(e.contactGroupId)}}));o.length>0&&this.getModule(On).onConversationsProfileUpdated(o);return r}},{key:\"_patchTypeAndPayload\",value:function(e){var n=e.lastMsg,o=n.event,s=void 0===o?void 0:o,a=n.elements,r=void 0===a?[]:a,i=n.groupTips,u=void 0===i?{}:i;if(!at(s)&&!jt(u)){var c=new Ha(u);c.setElement({type:S.MSG_GRP_TIP,content:t(t({},u.elements),{},{groupProfile:u.groupProfile})});var l=JSON.parse(JSON.stringify(c.payload));return c=null,{type:S.MSG_GRP_TIP,payload:l}}return{type:r[0]?r[0].type:null,payload:r[0]?this._amendLayersOverLimitProperty(r[0].content):null}}},{key:\"_amendLayersOverLimitProperty\",value:function(e){var t=e.layersOverLimit;return 0===t?e.layersOverLimit=!1:1===t&&(e.layersOverLimit=!0),e}},{key:\"getLocalMessageList\",value:function(e){return this._messageListHandler.getLocalMessageList(e)}},{key:\"deleteLocalMessage\",value:function(e){e instanceof Ha&&this._messageListHandler.remove(e)}},{key:\"onConversationDeleted\",value:function(e){if(st(e)){var t=e.map((function(e){var t=e.type,n=e.userID,o=e.groupID;return 1===t?\"\".concat(S.CONV_C2C).concat(n):2===t?\"\".concat(S.CONV_GROUP).concat(o):void 0}));xe.l(\"\".concat(this._n,\".onConversationDeleted conversationIDList:\").concat(t)),this.deleteLocalConversationList(t)}}},{key:\"onConversationPinned\",value:function(e){var t=this;if(st(e)){var n=!1;e.forEach((function(e){var o,s=e.type,a=e.userID,r=e.groupID;1===s?o=t.getLocalConversation(\"\".concat(S.CONV_C2C).concat(a)):2===s&&(o=t.getLocalConversation(\"\".concat(S.CONV_GROUP).concat(r))),o&&(xe.l(\"\".concat(t._n,\".onConversationPinned conversationID:\").concat(o.conversationID,\" isPinned:\").concat(o.isPinned)),o.isPinned||(o.isPinned=!0,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:\"onConversationUnpinned\",value:function(e){var t=this;if(st(e)){var n=!1;e.forEach((function(e){var o,s=e.type,a=e.userID,r=e.groupID;1===s?o=t.getLocalConversation(\"\".concat(S.CONV_C2C).concat(a)):2===s&&(o=t.getLocalConversation(\"\".concat(S.CONV_GROUP).concat(r))),o&&(xe.l(\"\".concat(t._n,\".onConversationUnpinned conversationID:\").concat(o.conversationID,\" isPinned:\").concat(o.isPinned)),o.isPinned&&(o.isPinned=!1,n=!0))})),n&&this._sortConversationListAndEmitEvent()}}},{key:\"getMessageList\",value:function(e){var t=this,n=e.conversationID,o=e.nextReqMessageID,s=e.count,a=\"\".concat(this._n,\".getMessageList\"),r=this.getLocalConversation(n),i=\"\";if(r&&r.groupProfile&&(i=r.groupProfile.type),Ct(i))return xe.l(\"\".concat(a,\" not available in avchatroom. conversationID:\").concat(n)),za({messageList:[],nextReqMessageID:\"\",isCompleted:!0});(at(s)||s>15)&&(s=15),!o&&this._isNotInCommunity(n)&&(this._messageListHandler.removeByConversationID(n),this._completedMap.delete(n),this._roamingMessageSequenceMap.delete(n));var u=this._computeRemainingCount({conversationID:n,nextReqMessageID:o}),c=this._completedMap.has(n);if(xe.l(\"\".concat(a,\" conversationID:\").concat(n,\" nextReqMessageID:\").concat(o)+\" remainingCount:\".concat(u,\" count:\").concat(s,\" isCompleted:\").concat(c)),this._needGetHistory({conversationID:n,remainingCount:u,count:s}))return this.getHistoryMessages({conversationID:n,nextReqMessageID:o,count:20}).then((function(e){var o=e.nextReqID,s=e.storedMessageList,r=t._completedMap.has(n),i=s;u>0&&(i=t._messageListHandler.getLocalMessageList(n).slice(0,s.length+u));var c={nextReqMessageID:r?\"\":o,messageList:i,isCompleted:r};return xe.l(\"\".concat(a,\" ret.nextReqMessageID:\").concat(c.nextReqMessageID,\" ret.isCompleted:\").concat(c.isCompleted,\" ret.length:\").concat(i.length)),Ka(c)}));this.modifyMessageList(n);var l=this._getMessageListFromMemory({conversationID:n,nextReqMessageID:o,count:s});return za(l)}},{key:\"_getMessageListFromMemory\",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=e.count,s=\"\".concat(this._n,\"._getMessageListFromMemory\"),a=this._messageListHandler.getLocalMessageList(t),r=a.length,i=0,u={isCompleted:!1,nextReqMessageID:\"\",messageList:[]};return n?(i=a.findIndex((function(e){return e.ID===n})))>o?(u.messageList=a.slice(i-o,i),u.nextReqMessageID=a[i-o].ID):(u.messageList=a.slice(0,i),u.isCompleted=!0):r>o?(i=r-o,u.messageList=a.slice(i,r),u.nextReqMessageID=a[i].ID):(u.messageList=a.slice(0,r),u.isCompleted=!0),xe.l(\"\".concat(s,\" conversationID:\").concat(t)+\" ret.nextReqMessageID:\".concat(u.nextReqMessageID,\" ret.isCompleted:\").concat(u.isCompleted,\" ret.length:\").concat(u.messageList.length)),u}},{key:\"getMessageListHopping\",value:function(e){var t=e.conversationID,n=e.sequence,o=e.time,s=e.count,a=e.direction,r=void 0===a?0:a;if((at(s)||s>15)&&(s=15),t.startsWith(S.CONV_C2C)){var i=this.getModule(Gn),u=t.replace(S.CONV_C2C,\"\");return i.getRoamingMessagesHopping({peerAccount:u,time:o,count:s,direction:r})}if(t.startsWith(S.CONV_GROUP)){var c=this.getModule(Un),l=t.replace(S.CONV_GROUP,\"\");return c.getRoamingMessagesHopping({groupID:l,sequence:n,count:s,direction:r})}}},{key:\"_computeRemainingCount\",value:function(e){var t=e.conversationID,n=e.nextReqMessageID,o=this._messageListHandler.getLocalMessageList(t),s=o.length;if(!n)return s;var a=0;return Et(t)?a=o.findIndex((function(e){return e.ID===n})):St(t)&&(a=-1!==n.indexOf(\"-\")?o.findIndex((function(e){return e.ID===n})):o.findIndex((function(e){return e.sequence===n}))),-1===a&&(a=0),a}},{key:\"_getMessageListSize\",value:function(e){return this._messageListHandler.getLocalMessageList(e).length}},{key:\"_needGetHistory\",value:function(e){var t=e.conversationID,n=e.remainingCount,o=e.count,s=this.getLocalConversation(t),a=\"\";return s&&s.groupProfile&&(a=s.groupProfile.type),!kt(t)&&!Ct(a)&&(!(St(t)&&this._isPagingGetGroupListCompleted()&&this._getLocalGroupCount()<=4e3&&!this._hasLocalGroup(t)&&!this._isTopicConversation(t))&&(n<=o&&!this._completedMap.has(t)))}},{key:\"_isTopicConversation\",value:function(e){var t=e.replace(S.CONV_GROUP,\"\");return Dt(t)}},{key:\"getHistoryMessages\",value:function(e){var t=e.conversationID,n=e.count;if(t===S.CONV_SYSTEM)return za();var o=15;n>20&&(o=20);var s=null;if(Et(t)){var a=this._roamingMessageKeyAndTimeMap.has(t);return(s=this.getModule(Gn))?s.getRoamingMessage({conversationID:t,peerAccount:t.replace(S.CONV_C2C,\"\"),count:o,lastMessageTime:a?this._roamingMessageKeyAndTimeMap.get(t).lastMessageTime:0,messageKey:a?this._roamingMessageKeyAndTimeMap.get(t).messageKey:\"\"}):Ja({code:da.CANNOT_FIND_MODULE})}if(St(t)){if(!(s=this.getModule(Un)))return Ja({code:da.CANNOT_FIND_MODULE});var r=null;this._conversationMap.has(t)&&(r=this._conversationMap.get(t).lastMessage);var i=0;r&&(i=r.lastSequence);var u=this._roamingMessageSequenceMap.get(t);return s.getRoamingMessage({conversationID:t,groupID:t.replace(S.CONV_GROUP,\"\"),count:o,sequence:u||i})}return za()}},{key:\"patchConversationLastMessage\",value:function(e){var t=this.getLocalConversation(e);if(t){var n=t.lastMessage,o=n.messageForShow,s=n.payload;if(jt(o)||jt(s)){var a=this._messageListHandler.getLocalMessageList(e);if(0===a.length)return;var r=a[a.length-1];xe.l(\"\".concat(this._n,\".patchConversationLastMessage conversationID:\").concat(e,\" payload:\"),r.payload),t.updateLastMessage(r)}}}},{key:\"onRoamingMessage\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],s=n.startsWith(S.CONV_C2C)?S.CONV_C2C:S.CONV_GROUP,a=null,r=[],i=[],u=0,c=e.length,l=null,p=s===S.CONV_GROUP,d=this.getModule(Hn),g=this.getFileDownloadProxy(),_=function(){u=p?e.length-1:0,c=p?0:e.length},h=function(){p?--u:++u},f=function(){return p?u>=c:u0&&void 0!==arguments[0]?arguments[0]:{},n=\"setAllMessageRead\",o=\"\".concat(this._n,\".\").concat(n);t.scope||(t.scope=S.READ_ALL_MSG),xe.l(\"\".concat(o,\" options:\"),t);var s=this._createSetAllMessageReadPack(t);if(0===s.readAllC2CMessage&&0===s.groupMessageReadInfoList.length)return za();var a=new ka(n);return this.request({protocolName:rs,requestData:s}).then((function(n){var o=n.data,s=e._handleAllMessageRead(o);return a.setMessage(\"scope:\".concat(t.scope,\" failureGroups:\").concat(JSON.stringify(s))).setNetworkType(e.getNetworkType()).end(),za()})).catch((function(t){return e.probeNetwork().then((function(e){var n=v(e,2),o=n[0],s=n[1];a.setError(t,o,s).end()})),xe.w(\"\".concat(o,\" failed. error:\"),t),Ja({code:t&&t.code?t.code:da.MESSAGE_UNREAD_ALL_FAIL,message:t&&t.message?t.message:void 0})}))}},{key:\"setConversationCustomData\",value:function(e){return this._convGroupHandler.setConvCustomData(e)}},{key:\"markConversation\",value:function(e){return this._convGroupHandler.markConversation(e)}},{key:\"getConversationGroupList\",value:function(){return this._convGroupHandler.getLocalConvGroupList()}},{key:\"createConversationGroup\",value:function(e){return this._convGroupHandler.createConvGroup(e)}},{key:\"deleteConversationGroup\",value:function(e){return this._convGroupHandler.deleteConvGroup(e)}},{key:\"renameConversationGroup\",value:function(e){return this._convGroupHandler.renameConvGroup(e)}},{key:\"addConversationsToGroup\",value:function(e){return this._convGroupHandler.addConvsToGroup(e)}},{key:\"deleteConversationsFromGroup\",value:function(e){return this._convGroupHandler.deleteConvsFromGroup(e)}},{key:\"onConversationMarkUpdated\",value:function(e){this._convGroupHandler.onConvMarkUpdated(e)}},{key:\"onConversationGroupCreated\",value:function(e){this._convGroupHandler.onConvGroupCreated(e)}},{key:\"onConversationGroupDeleted\",value:function(e){this._convGroupHandler.onConvGroupDeleted(e)}},{key:\"onConversationGroupNameUpdated\",value:function(e){this._convGroupHandler.onConvGroupNameUpdated(e)}},{key:\"onConversationInGroupUpdated\",value:function(e){this._convGroupHandler.onConvInGroupUpdated(e)}},{key:\"onConversationAddedToOrDeletedFromGroup\",value:function(e){this._convGroupHandler.onConvAddedToOrDeletedFromGroup(e)}},{key:\"_getConversationLastMessageSequence\",value:function(e){var t=this._messageListHandler.getLocalLastMessage(e.conversationID),n=e.lastMessage.lastSequence;return t&&n0)if(a.type===S.CONV_C2C&&0===n.readAllC2CMessage){if(o===S.READ_ALL_MSG)n.readAllC2CMessage=1;else if(o===S.READ_ALL_C2C_MSG){n.readAllC2CMessage=1;break}}else if(a.type===S.CONV_GROUP&&(o===S.READ_ALL_GROUP_MSG||o===S.READ_ALL_MSG)){var r=this._getConversationLastMessageSequence(a);n.groupMessageReadInfoList.push({groupID:a.groupProfile.groupID,messageSequence:r})}}}catch(i){s.e(i)}finally{s.f()}return n}},{key:\"onPushedAllMessageRead\",value:function(e){this._handleAllMessageRead(e)}},{key:\"_handleAllMessageRead\",value:function(e){var t=e.groupMessageReadInfoList,n=e.readAllC2CMessage,o=this._parseGroupReadInfo(t);return this._updateAllConversationUnreadCount({readAllC2CMessage:n})>=1&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate()),o}},{key:\"_parseGroupReadInfo\",value:function(e){var t=[];if(e&&e.length)for(var n=0,o=e.length;n=1){if(1===n&&i.type===S.CONV_C2C){var u=this._getConversationLastMessageTime(i);this.updateIsReadAfterReadReport({conversationID:r,lastMessageTime:u})}else if(i.type===S.CONV_GROUP){var c=r.replace(S.CONV_GROUP,\"\");if(this._remoteGroupReadSequenceMap.has(c)){var l=this._remoteGroupReadSequenceMap.get(c),p=this._getConversationLastMessageSequence(i);this.updateIsReadAfterReadReport({conversationID:r,remoteReadSequence:l}),p>=l&&this._remoteGroupReadSequenceMap.delete(c)}}this.updateUnreadCount(r,!1)&&(o+=1)}}}catch(d){s.e(d)}finally{s.f()}return o}},{key:\"isRemoteRead\",value:function(e){var t=e.conversationID,n=e.sequence,o=t.replace(S.CONV_GROUP,\"\"),s=!1;if(this._remoteGroupReadSequenceMap.has(o)){var a=this._remoteGroupReadSequenceMap.get(o);n<=a&&(s=!0,xe.l(\"\".concat(this._n,\".isRemoteRead conversationID:\").concat(t,\" messageSequence:\").concat(n,\" remoteReadSequence:\").concat(a))),n>=a+10&&this._remoteGroupReadSequenceMap.delete(o)}return s}},{key:\"updateIsReadAfterReadReport\",value:function(e){var t=e.conversationID,n=e.lastMessageSeq,o=e.lastMessageTime,s=this._messageListHandler.getLocalMessageList(t);if(0!==s.length)for(var a,r=s.length-1;r>=0;r--)if(a=s[r],!(o&&a.time>o||n&&a.sequence>n)){if(\"in\"===a.flow&&a.isRead)break;a.setIsRead(!0)}}},{key:\"updateUnreadCount\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!1,o=this.getLocalConversation(e),s=this._messageListHandler.getLocalMessageList(e);if(o){var a=o.unreadCount,r=s.filter((function(e){return!e.isRead&&!e._onlineOnlyFlag&&!e.isDeleted})).length;if(a!==r&&(o.unreadCount=r,n=!0,xe.l(\"\".concat(this._n,\".updateUnreadCount from \").concat(a,\" to \").concat(r,\", conversationID:\").concat(e)),!0===t&&(this.emitConversationUpdate(!0,!1),this.emitTotalUnreadMessageCountUpdate())),n&&o.type===S.CONV_TOPIC){var i=o.unreadCount,u=this.getModule(wn),c=e.replace(S.CONV_GROUP,\"\");u.onConversationProxy({topicID:c,unreadCount:i})}return n}}},{key:\"clearGroupAtInfoList\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalConversation(e);if(n&&n.groupAtInfoList.length>0){if(n.clearGroupAtInfoList(),xe.l(\"\".concat(this._n,\".clearGroupAtInfoList conversationID:\").concat(e)),n.type===S.CONV_TOPIC){var o=n.groupAtInfoList,s=this.getModule(wn),a=e.replace(S.CONV_GROUP,\"\");s.onConversationProxy({topicID:a,groupAtInfoList:o})}!0===t&&this.emitConversationUpdate(!0,!1)}}},{key:\"updateReadReceiptInfo\",value:function(e){var t=this,n=e.userID,o=void 0===n?void 0:n,s=e.groupID,a=void 0===s?void 0:s,r=e.readReceiptList;if(!jt(r)){var i=[];if(at(o)){if(!at(a)){var u=\"\".concat(S.CONV_GROUP).concat(a);r.forEach((function(e){var n=e.tinyID,o=e.clientTime,s=e.random,r=e.readCount,c=e.unreadCount,l=\"\".concat(n,\"-\").concat(o,\"-\").concat(s),p=t._messageListHandler.getLocalMessage(u,l),d={groupID:a,messageID:l,readCount:0,unreadCount:0};p&&($e(r)&&(p.readReceiptInfo.readCount=r,d.readCount=r),$e(c)&&(p.readReceiptInfo.unreadCount=c,d.unreadCount=c),i.push(d))}))}}else{var c=\"\".concat(S.CONV_C2C).concat(o);r.forEach((function(e){var n=e.tinyID,s=e.clientTime,a=e.random,r=\"\".concat(n,\"-\").concat(s,\"-\").concat(a),u=t._messageListHandler.getLocalMessage(c,r);if(u){u.readReceiptInfo.isPeerRead=!0;var l={userID:o,messageID:r,isPeerRead:!0};i.push(l)}}))}i.length>0&&this.emitOuterEvent(E.MESSAGE_READ_RECEIPT_RECEIVED,i)}}},{key:\"recomputeGroupUnreadCount\",value:function(e){var t=e.conversationID,n=e.count,o=this.getLocalConversation(t);if(o){var s=o.unreadCount,a=s-n;a<0&&(a=0),o.unreadCount=a,xe.l(\"\".concat(this._n,\".recomputeGroupUnreadCount from \").concat(s,\" to \").concat(a,\", conversationID:\").concat(t))}}},{key:\"updateIsRead\",value:function(e){var t=this.getLocalConversation(e),n=this.getLocalMessageList(e);if(t&&0!==n.length&&!kt(t.type)){for(var o=[],s=0,a=n.length;s0){var n=this._messageListHandler.updateMessageIsPeerReadProperty(e,t);if(n.length>0&&this.emitOuterEvent(E.MESSAGE_READ_BY_PEER,n),this._conversationMap.has(e)){var o=this._conversationMap.get(e).lastMessage;jt(o)||o.fromAccount===this.getMyUserID()&&o.lastTime<=t&&!o.isPeerRead&&(o.isPeerRead=!0,this.emitConversationUpdate(!0,!1))}}}},{key:\"updateMessageIsModifiedProperty\",value:function(e){this._messageListHandler.updateMessageIsModifiedProperty(e)}},{key:\"setCompleted\",value:function(e){xe.l(\"\".concat(this._n,\".setCompleted. conversationID:\").concat(e)),this._completedMap.set(e,!0)}},{key:\"updateRoamingMessageKeyAndTime\",value:function(e,t,n){this._roamingMessageKeyAndTimeMap.set(e,{messageKey:t,lastMessageTime:n})}},{key:\"updateRoamingMessageSequence\",value:function(e,t){this._roamingMessageSequenceMap.set(e,t)}},{key:\"getConversationList\",value:function(e){var t=this,n=\"getConversationList\",o=\"\".concat(this._n,\".\").concat(n),s=\"pagingStatus:\".concat(this._pagingStatus,\", local conversation count:\").concat(this._conversationMap.size,\", options:\").concat(e);if(xe.l(\"\".concat(o,\". \").concat(s)),this._pagingStatus===Zt.REJECTED){var a=new ka(n);return a.setMessage(s),this.syncConversationList().then((function(){a.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Ka({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}if(0===this._conversationMap.size){var r=new ka(n);return r.setMessage(s),this.syncConversationList().then((function(){r.setNetworkType(t.getNetworkType()).end();var n=t._getConversationList(e);return Ka({conversationList:n,isSyncCompleted:t._isSyncCompleted()})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}var i=this._getConversationList(e);return xe.l(\"\".concat(o,\". returned conversation count:\").concat(i.length)),za({conversationList:i,isSyncCompleted:this._isSyncCompleted()})}},{key:\"_getConversationList\",value:function(e){if(at(e))return this.getLocalConversationList();if(st(e))return 0===e.length?[]:this.getLocalConversationList().filter((function(t){return e.includes(t.conversationID)}));if(ot(e)){var t=e.type,n=e.markType,o=e.groupName;return this.getLocalConversationList().filter((function(e){return(t!==S.CONV_C2C&&t!==S.CONV_GROUP||e.type===t)&&(!et(o)||e.conversationGroupList.includes(o))&&(!$e(n)||e.markList.includes(n))}))}return[]}},{key:\"_handleC2CPeerReadTime\",value:function(){var e,t=D(this._conversationMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];s.type===S.CONV_C2C&&(xe.d(\"\".concat(this._n,\"._handleC2CPeerReadTime conversationID:\").concat(o,\" peerReadTime:\").concat(s.peerReadTime)),this.recordPeerReadTime(o,s.peerReadTime))}}catch(a){t.e(a)}finally{t.f()}}},{key:\"_isPagingGetGroupListCompleted\",value:function(){return this.getModule(Un).isPagingGetCompleted()}},{key:\"_getLocalGroupCount\",value:function(){return this.getModule(Un).getLocalGroupList().length}},{key:\"_hasLocalGroup\",value:function(e){return this.getModule(Un).hasLocalGroup(e.replace(S.CONV_GROUP,\"\"))}},{key:\"getConversationProfile\",value:function(e){var t,n=this;if((t=this._conversationMap.has(e)?this._conversationMap.get(e):new _r({conversationID:e,type:e.slice(0,3)===S.CONV_C2C?S.CONV_C2C:S.CONV_GROUP},this.isIntl()))._isInfoCompleted||t.type===S.CONV_SYSTEM)return za({conversation:t});if(St(e)&&!this._hasLocalGroup(e))return za({conversation:t});var o=\"\".concat(this._n,\".\").concat(\"getConversationProfile\"),s=new ka(\"getConversationProfile\");return xe.l(\"\".concat(o,\". conversationID:\").concat(e,\" remark:\").concat(t.remark,\" lastMessage:\"),t.lastMessage),this._updateUserOrGroupProfileCompletely(t).then((function(a){s.setNetworkType(n.getNetworkType()).setMessage(\"conversationID:\".concat(e,\" unreadCount:\").concat(a.data.conversation.unreadCount)).end();var r=n.getModule(Pn);if(r&&t.type===S.CONV_C2C){var i=e.replace(S.CONV_C2C,\"\");if(r.isMyFriend(i)){var u=r.getFriendRemark(i);t.remark!==u&&(t.remark=u,xe.l(\"\".concat(o,\". conversationID:\").concat(e,\" patch remark:\").concat(t.remark)))}}return xe.l(\"\".concat(o,\" ok. conversationID:\").concat(e)),a})).catch((function(t){return n.probeNetwork().then((function(n){var o=v(n,2),a=o[0],r=o[1];s.setError(t,a,r).setMessage(\"conversationID:\".concat(e)).end()})),xe.e(\"\".concat(o,\" failed. error:\"),t),Ja(t)}))}},{key:\"_updateUserOrGroupProfileCompletely\",value:function(e){var t=this;return e.type===S.CONV_C2C?this.getModule(On).getUserProfile({userIDList:[e.toAccount]}).then((function(n){var o=n.data;return 0===o.length?Ja(new Wa({code:da.USER_OR_GROUP_NOT_FOUND})):(e.userProfile=o[0],e._isInfoCompleted=!0,t._unshiftConversation(e),za({conversation:e}))})):this.getModule(Un).getGroupProfile({groupID:e.toAccount}).then((function(n){return e.groupProfile=n.data.group,e._isInfoCompleted=!0,t._unshiftConversation(e),za({conversation:e})}))}},{key:\"_unshiftConversation\",value:function(e){e instanceof _r&&!this._conversationMap.has(e.conversationID)&&(this._conversationMap=new Map([[e.conversationID,e]].concat(m(this._conversationMap))),this._setStorageConversationList(),this.emitConversationUpdate(!0,!1))}},{key:\"_onProfileUpdated\",value:function(e){var t=this;e.data.forEach((function(e){var n=e.userID;if(n===t.getMyUserID())t._onMyProfileModified({latestNick:e.nick,latestAvatar:e.avatar});else{var o=t._conversationMap.get(\"\".concat(S.CONV_C2C).concat(n));o&&(o.userProfile=e)}}))}},{key:\"_isSyncCompleted\",value:function(){return this._pagingStatus===Zt.RESOLVED}},{key:\"_errorLog\",value:function(e,t,n,o){var s=new Error(\"Params validate failed.\"),a=\"\".concat(this.getErrorMessage(\"API_REFER\")).concat(e);throw xe.w(\"[\".concat(e,\"] | \").concat(t,\" | \").concat(this.getErrorMessage(n,o),\", \").concat(a)),xe.e(\"[\".concat(e,\"] Invalid \").concat(t,\": type check failed for \").concat(t,\".\")),s}},{key:\"_isValidConversationID\",value:function(e){return Et(e)||St(e)||kt(e)}},{key:\"deleteConversation\",value:function(e){var t=this,n=\"deleteConversation\";return et(e)||nt(e)||this._errorLog(n,\"options\",\"StringOrObjectRequiredLog\"),et(e)?(this._isValidConversationID(e)||this._errorLog(n,\"options\",\"InvalidConversationID\",e),xe.l(\"\".concat(this._n,\".\").concat(n,\" conversationID:\").concat(e)),this.deleteConversationList({conversationIDList:[e],flag:1})):(st(e.conversationIDList)||this._errorLog(n,\"conversationIDList\",\"ArrayRequiredLog\"),0===e.conversationIDList.length&&this._errorLog(n,\"conversationIDList\",\"NonEmptyArrayLog\"),e.conversationIDList.forEach((function(e){t._isValidConversationID(e)||t._errorLog(n,\"conversationIDList\",\"InvalidConversationID\",e)})),\"clearHistoryMessage\"in e&&\"boolean\"!=typeof e.clearHistoryMessage&&this._errorLog(n,\"clearHistoryMessage\",\"BooleanRequiredLog\"),e.conversationIDList.length>100&&(e.conversationIDList=e.conversationIDList.slice(0,100)),this.deleteConversationList(e))}},{key:\"deleteConversationList\",value:function(e){var t=this,n=e.conversationIDList,o=void 0===n?[]:n,s=e.clearHistoryMessage,a=void 0===s||s,r=e.flag,i=void 0===r?0:r,u=\"\".concat(this._n,\".\").concat(\"deleteConversationList\");xe.l(\"\".concat(u,\" conversationIDList.length:\").concat(o.length,\" clearHistoryMessage:\").concat(a));var c=new ka(\"deleteConversationList\");return c.setMessage(\"conversationIDList:\".concat(o)),Promise.all([this.rmLocalOnlyConversationList(o),this.rmLocalAndRemoteConversationList(o,a)]).then((function(e){c.setNetworkType(t.getNetworkType()).end();var n=[].concat(m(e[0]),m(e[1]));return 0===n.length?Ja(new Wa({code:da.CONVERSATION_NOT_FOUND})):(xe.l(\"\".concat(u,\" ok\")),za(1===i?{conversationID:n[0]}:{conversationIDList:n}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),xe.e(\"\".concat(u,\" failed. error:\"),e),Ja(e)}))}},{key:\"rmLocalOnlyConversationList\",value:function(e){var t=this;return e.filter((function(e){if(!t._conversationMap.has(e))return!1;var n=t.getLocalConversation(e).type;return n!==S.CONV_GROUP||t._hasLocalGroup(e)?n===S.CONV_SYSTEM&&(t.getModule(Un).deleteGroupSystemNotice({messageList:t._messageListHandler.getLocalMessageList(e)}),t.deleteLocalConversation(e),!0):(t.deleteLocalConversation(e),!0)}))}},{key:\"rmLocalAndRemoteConversationList\",value:function(e,t){var n=this,o={fromAccount:this.getMyUserID(),conversationList:[],clearHistoryMessage:t?1:0};return e.forEach((function(e){if(n._conversationMap.has(e)){var t=n.getLocalConversation(e).type;t===S.CONV_C2C?o.conversationList.push({toAccount:e.replace(t,\"\"),type:1}):t===S.CONV_GROUP&&n._hasLocalGroup(e)&&o.conversationList.push({toGroupID:e.replace(t,\"\"),type:2})}})),0===o.conversationList.length?[]:this.request({protocolName:Go,requestData:o}).then((function(e){var t=[];return e.data.resultList.length>0&&e.data.resultList.map((function(e){if(0===e.code){var n=1===e.type?\"\".concat(S.CONV_C2C).concat(e.to):\"\".concat(S.CONV_GROUP).concat(e.groupID);t.push(n)}})),n.deleteLocalConversationList(t),t}))}},{key:\"clearHistoryMessage\",value:function(e){var t=this,n={fromAccount:this.getMyUserID(),toAccount:void 0,type:void 0,toGroupID:void 0};if(!this._conversationMap.has(e))return Ja({code:da.CONVERSATION_NOT_FOUND});var o=this._conversationMap.get(e).type;if(o===S.CONV_C2C)n.type=1,n.toAccount=e.replace(S.CONV_C2C,\"\");else{if(o!==S.CONV_GROUP)return o===S.CONV_SYSTEM?(this.getModule(Un).deleteGroupSystemNotice({messageList:this._messageListHandler.getLocalMessageList(e)}),za({conversationID:e})):Ja({code:da.CONVERSATION_UN_RECORDED_TYPE});n.type=2,n.toGroupID=e.replace(S.CONV_GROUP,\"\")}var s=\"\".concat(this._n,\".\").concat(\"clearHistoryMessage\"),a=new ka(\"clearHistoryMessage\");return a.setMessage(\"conversationID:\".concat(e)),xe.l(\"\".concat(s,\". conversationID:\").concat(e)),this.setMessageRead({conversationID:e}).then((function(){return t.request({protocolName:Uo,requestData:n})})).then((function(){a.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(s,\" ok\")),t._messageListHandler.removeByConversationID(e),t.setCompleted(e);var n=t.getLocalConversation(e);return n&&(n.updateLastMessage(),t._sortConversationListAndEmitEvent()),za({conversationID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e(\"\".concat(s,\" failed. error:\"),e),Ja(e)}))}},{key:\"pinConversation\",value:function(e){var t=this,n=e.conversationID,o=e.isPinned;if(!this._conversationMap.has(n))return Ja({code:da.CONVERSATION_NOT_FOUND});var s=this.getLocalConversation(n);if(s.isPinned===o)return za({conversationID:n});var a=\"\".concat(this._n,\".\").concat(\"pinConversation\"),r=new ka(\"pinConversation\");r.setMessage(\"conversationID:\".concat(n,\" isPinned:\").concat(o)),xe.l(\"\".concat(a,\". conversationID:\").concat(n,\" isPinned:\").concat(o));var i=null;return Et(n)?i={type:1,toAccount:n.replace(S.CONV_C2C,\"\")}:St(n)&&(i={type:2,groupID:n.replace(S.CONV_GROUP,\"\")}),this.request({protocolName:Po,requestData:{fromAccount:this.getMyUserID(),operationType:!0===o?1:2,itemList:[i]}}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(a,\" ok\")),s.isPinned!==o&&(s.isPinned=o,t._sortConversationListAndEmitEvent()),Ka({conversationID:n})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(a,\" failed. error:\"),e),Ja(e)}))}},{key:\"setMessageRemindType\",value:function(e){return this._messageRemindHandler.set(e)}},{key:\"patchMessageRemindType\",value:function(e){var t=e.ID,n=e.isC2CConversation,o=e.messageRemindType,s=!1,a=this.getLocalConversation(n?\"\".concat(S.CONV_C2C).concat(t):\"\".concat(S.CONV_GROUP).concat(t));return a&&a.messageRemindType!==o&&(a.messageRemindType=o,s=!0),xe.d(\"\".concat(this._n,\".patchMessageRemindType options:\"),e,\"ret:\".concat(s)),s}},{key:\"onC2CMessageRemindTypeSynced\",value:function(e){var t=this,n=\"\".concat(this._n,\".onC2CMessageRemindTypeSynced\");xe.d(n,e),e.dataList.forEach((function(e){if(!jt(e.muteNotificationsSync)){var o,s=e.muteNotificationsSync,a=s.to,r=s.updateSequence,i=s.muteFlag;t._messageRemindHandler.setUpdateSequence(r),0===i?o=S.MSG_REMIND_ACPT_AND_NOTE:1===i?o=S.MSG_REMIND_DISCARD:2===i&&(o=S.MSG_REMIND_ACPT_NOT_NOTE);var u=0;t.patchMessageRemindType({ID:a,isC2CConversation:!0,messageRemindType:o})&&(u+=1),xe.l(\"\".concat(n,\" updateCount:\").concat(u)),u>=1&&t.emitConversationUpdate(!0,!1)}}))}},{key:\"onGroupMessageRemindTypeSynced\",value:function(e){xe.d(\"\".concat(this._n,\".onGroupMessageRemindTypeSynced options:\"),e),this._messageRemindHandler.onGroupMessageRemindTypeUpdated(e)}},{key:\"deleteLocalConversation\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this._conversationMap.has(e);if(xe.d(\"\".concat(this._n,\".deleteLocalConversation conversationID:\").concat(e,\" has:\").concat(n)),n&&(this._conversationMap.delete(e),this._roamingMessageKeyAndTimeMap.has(e)&&this._roamingMessageKeyAndTimeMap.delete(e),this._roamingMessageSequenceMap.has(e)&&this._roamingMessageSequenceMap.delete(e),this._setStorageConversationList(),this._messageListHandler.removeByConversationID(e),this._completedMap.delete(e),t)){var o=!this._isTopicConversation(e);this.emitConversationUpdate(o,!1)}}},{key:\"deleteLocalConversationList\",value:function(e){var t=this,n=0,o=!1;e.forEach((function(e){t._conversationMap.has(e)&&(n+=t._conversationMap.get(e).unreadCount||0,t.deleteLocalConversation(e,!1),o=!0)})),xe.l(\"\".concat(this._n,\".deleteLocalConversationList conversationIDList.length:\").concat(e.length,\" isConvIDExisted:\").concat(o)),o&&(this.emitConversationUpdate(!0,!1),n>0&&this.emitTotalUnreadMessageCountUpdate())}},{key:\"isMessageSentByCurrentInstance\",value:function(e){return!(!this._messageListHandler.hasLocalMessage(e.conversationID,e.ID)&&!this.singlyLinkedList.has(e.random))}},{key:\"modifyMessageList\",value:function(e){if(e.startsWith(S.CONV_C2C)&&this._conversationMap.has(e)){var t=this._conversationMap.get(e),n=Date.now();this._messageListHandler.modifyMessageSentByPeer({conversationID:e,latestNick:t.userProfile.nick,latestAvatar:t.userProfile.avatar});var o=this.getModule(On).getNickAndAvatarByUserID(this.getMyUserID());this._messageListHandler.modifyMessageSentByMe({conversationID:e,latestNick:o.nick,latestAvatar:o.avatar}),xe.l(\"\".concat(this._n,\".modifyMessageList conversationID:\").concat(e,\" cost \").concat(Date.now()-n,\" ms\"))}}},{key:\"updateUserProfileSpecifiedKey\",value:function(e){xe.l(\"\".concat(this._n,\".updateUserProfileSpecifiedKey options:\"),e);var t=e.conversationID,n=e.nick,o=e.avatar;if(this._conversationMap.has(t)){var s=this._conversationMap.get(t).userProfile;et(n)&&s.nick!==n&&(s.nick=n),et(o)&&s.avatar!==o&&(s.avatar=o),this.emitConversationUpdate(!0,!1)}}},{key:\"_onMyProfileModified\",value:function(e){var n=this,o=this.getLocalConversationList(),s=Date.now();o.forEach((function(o){n.modifyMessageSentByMe(t({conversationID:o.conversationID},e))})),xe.l(\"\".concat(this._n,\"._onMyProfileModified. modify all messages sent by me, cost \").concat(Date.now()-s,\" ms\"))}},{key:\"modifyMessageSentByMe\",value:function(e){this._messageListHandler.modifyMessageSentByMe(e)}},{key:\"getLatestMessageSentByMe\",value:function(e){return this._messageListHandler.getLatestMessageSentByMe(e)}},{key:\"modifyMessageSentByPeer\",value:function(e){this._messageListHandler.modifyMessageSentByPeer(e)}},{key:\"getLatestMessageSentByPeer\",value:function(e){return this._messageListHandler.getLatestMessageSentByPeer(e)}},{key:\"pushIntoNoticeResult\",value:function(e,t){return!(!this._messageListHandler.pushIn(t)||this.singlyLinkedList.has(t.random))&&(e.push(t),!0)}},{key:\"getLocalLastMessage\",value:function(e){return this._messageListHandler.getLocalLastMessage(e)}},{key:\"checkAndPatchRemark\",value:function(){var e=Promise.resolve();if(0===this._conversationMap.size)return e;var t=this.getModule(Pn);if(!t)return e;var n=m(this._conversationMap.values()).filter((function(e){return e.type===S.CONV_C2C}));if(0===n.length)return e;var o=0;return n.forEach((function(e){var n=e.conversationID.replace(S.CONV_C2C,\"\");if(t.isMyFriend(n)){var s=t.getFriendRemark(n);e.remark!==s&&(e.remark=s,o+=1)}})),xe.l(\"\".concat(this._n,\".checkAndPatchRemark. c2c conversation count:\").concat(n.length,\", patched count:\").concat(o)),e}},{key:\"updateTopicConversation\",value:function(e){this._updateLocalConversationList({conversationOptionsList:e,isFromGetConversations:!0})}},{key:\"sendReadReceipt\",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(Gn):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(Un)),n?n.sendReadReceipt(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"getReadReceiptList\",value:function(e){var t=e[0],n=null;return t.conversationType===S.CONV_C2C?n=this._m.getModule(Gn):t.conversationType===S.CONV_GROUP&&(n=this._m.getModule(Un)),n?n.getReadReceiptList(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"getLastMessageTime\",value:function(e){var t=this.getLocalConversation(e);return t?t.lastMessage.lastTime:0}},{key:\"getTotalUnreadMessageCount\",value:function(){var e=this.getLocalConversationList(),t=0;return e.forEach((function(e){e.type!==S.CONV_SYSTEM&&(\"\"!==e.messageRemindType&&e.messageRemindType!==S.MSG_REMIND_ACPT_AND_NOTE||(t+=e.unreadCount))})),t}},{key:\"emitTotalUnreadMessageCountUpdate\",value:function(){var e=this.getTotalUnreadMessageCount();this._convTotalUnreadCount!==e&&(xe.l(\"\".concat(this._n,\".emitTotalUnreadMessageCountUpdate from \").concat(this._convTotalUnreadCount,\" to \").concat(e)),this._convTotalUnreadCount=e,this.emitOuterEvent(E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED))}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._pagingStatus=Zt.NOT_START,this._messageListHandler.reset(),this._messageRemindHandler.reset(),this._roamingMessageKeyAndTimeMap.clear(),this._roamingMessageSequenceMap.clear(),this.singlyLinkedList.reset(),this._peerReadTimeMap.clear(),this._completedMap.clear(),this._conversationMap.clear(),this._pagingTimeStamp=0,this._pagingStartIndex=0,this._pagingPinnedTimeStamp=0,this._pagingPinnedStartIndex=0,this._remoteGroupReadSequenceMap.clear(),this._convTotalUnreadCount=0,this._pagingGetCostList.length=0,this.resetReady()}}]),s}(ro),mr=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupTipsHandler\",this._cachedGroupTipsMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map}return a(e,[{key:\"onCheckTimer\",value:function(e){e%1==0&&this._cachedGroupTipsMap.size>0&&this._checkCachedGroupTips()}},{key:\"_checkCachedGroupTips\",value:function(){var e=this;this._cachedGroupTipsMap.forEach((function(t,n){var o=e._checkCountMap.get(n),s=e._groupModule.hasLocalGroup(n);xe.l(\"\".concat(e._n,\"._checkCachedGroupTips groupID:\").concat(n,\" hasLocalGroup:\").concat(s,\" checkCount:\").concat(o)),s?(e._notifyCachedGroupTips(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupTips(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:\"onNewGroupTips\",value:function(e){xe.d(\"\".concat(this._n,\".onReceiveGroupTips count:\").concat(e.dataList.length));var t=this.newGroupTipsStoredAndSummary(e),n=t.eventDataList,o=t.result,s=t.AVChatRoomMessageList;(s.length>0&&this._groupModule.onAVChatRoomMessage(s),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(Fn).onNewMessage({conversationOptionsList:n,isInstantMessage:!0}));o.length>0&&(this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,o),this.handleMessageList(o))}},{key:\"newGroupTipsStoredAndSummary\",value:function(e){for(var n=this,o=e.event,s=e.dataList,a=null,r=[],i=[],u={},c=[],l=function(e,l){var p=yt(s[e]);if(6===o){if(n._groupModule.isGroupAttributesUpdatedNotice(p))return\"continue\";if(n._groupModule.isGroupCountersNotice(p))return\"continue\"}var d=p.groupProfile,g=d.groupID,_=d.communityType,h=void 0===_?0:_,f=d.topicID,v=void 0===f?void 0:f,m=d.invisible,M=void 0,y=n._groupModule.isMessageFromTopic(h,v);if(y){M=S.CONV_TOPIC,p.to=v;var I=n._groupModule.getModule(wn);I.hasLocalTopic(g,v)||n._getTopicPendingMap.has(v)||(n._getTopicPendingMap.set(v,1),I.getTopicList({groupID:g,topicIDList:[v]}).finally((function(){n._getTopicPendingMap.delete(v)})))}var C=n._groupModule.hasLocalGroup(g);if(!C&&n._groupModule.isUnjoinedAVChatRoom(g))return\"continue\";if(!C&&!y)return n._cacheGroupTipsAndProbe({groupID:g,event:o,item:p}),\"continue\";if(n._groupModule.isMessageFromOrToAVChatroom(g))return p.event=o,c.push(p),\"continue\";if(p.currentUser=n._groupModule.getMyUserID(),p.conversationType=S.CONV_GROUP,(a=new Ha(p)).setElement({type:S.MSG_GRP_TIP,content:t(t({},p.elements),{},{groupProfile:p.groupProfile})}),a.isSystemMessage=!1,1===m)return n._qualityStat(a),\"continue\";var T=n._groupModule.getModule(Fn),D=a,E=D.conversationID,k=D.sequence;if(6===o)a._onlineOnlyFlag=!0,i.push(a);else if(!T.pushIntoNoticeResult(i,a))return\"continue\";if(n._groupModule.isMessageFromCommunityOfTopic(h,v))return\"continue\";if(6===o&&T.getLocalConversation(E))return\"continue\";6!==o&&n._qualityStat(a);var L=T.isRemoteRead({conversationID:E,sequence:k});if(at(u[E])){var A=0;\"in\"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||L||(A=1)),u[E]=r.push({conversationID:E,unreadCount:A,type:at(M)?a.conversationType:M,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?\"\":a})-1}else{var R=u[E];r[R].type=a.conversationType,r[R].subType=a.conversationSubType,r[R].lastMessage=a._isExcludedFromLastMessage?\"\":a,\"in\"===a.flow&&(a._isExcludedFromUnreadCount||a._onlineOnlyFlag||L||r[R].unreadCount++)}},p=0,d=s.length;p=0){u.updateSelfInfo({muteTime:p.muteTime}),c=!0;break}}c&&this._groupModule.emitOuterEvent(E.TOPIC_UPDATED,{groupID:i,topic:u})}}},{key:\"_onTopicProfileUpdated\",value:function(e){var n=e.payload,o=n.groupProfile.groupID,s=n.newTopicInfo;this._groupModule.getModule(wn).onTopicProfileUpdated(t({groupID:o,topicID:e.to},s))}},{key:\"_cacheGroupTips\",value:function(e,t){this._cachedGroupTipsMap.has(e)||this._cachedGroupTipsMap.set(e,[]),this._cachedGroupTipsMap.get(e).push(t)}},{key:\"_deleteCachedGroupTips\",value:function(e){this._cachedGroupTipsMap.has(e)&&this._cachedGroupTipsMap.delete(e)}},{key:\"_notifyCachedGroupTips\",value:function(e){var t=this,n=this._cachedGroupTipsMap.get(e)||[];n.forEach((function(e){t.onNewGroupTips(e)})),this._deleteCachedGroupTips(e),xe.l(\"\".concat(this._n,\"._notifyCachedGroupTips groupID:\").concat(e,\" count:\").concat(n.length))}},{key:\"_cacheGroupTipsAndProbe\",value:function(e){var t=this,n=e.groupID,o=e.event,s=e.item;this._cacheGroupTips(n,{event:o,dataList:[s]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupTips(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupTips(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),xe.l(\"\".concat(this._n,\"._cacheGroupTipsAndProbe groupID:\").concat(n))}},{key:\"reset\",value:function(){this._cachedGroupTipsMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear()}}]),e}(),Mr=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"CommonGroupHandler\",this.tempConversationList=null,this._cachedGroupMessageMap=new Map,this._checkCountMap=new Map,this.MAX_CHECK_COUNT=4,this._getTopicPendingMap=new Map,this._isPagingGetCompleted=!1,t.getInnerEmitterInstance().once(Za,this._initGroupList,this)}return a(e,[{key:\"onCheckTimer\",value:function(e){e%1==0&&this._cachedGroupMessageMap.size>0&&this._checkCachedGroupMessage()}},{key:\"_checkCachedGroupMessage\",value:function(){var e=this;this._cachedGroupMessageMap.forEach((function(t,n){var o=e._checkCountMap.get(n),s=e._groupModule.hasLocalGroup(n);xe.l(\"\".concat(e._n,\"._checkCachedGroupMessage groupID:\").concat(n,\" hasLocalGroup:\").concat(s,\" checkCount:\").concat(o)),s?(e._notifyCachedGroupMessage(n),e._checkCountMap.delete(n),e._groupModule.deleteUnjoinedAVChatRoom(n)):o>=e.MAX_CHECK_COUNT?(e._deleteCachedGroupMessage(n),e._checkCountMap.delete(n)):(o++,e._checkCountMap.set(n,o))}))}},{key:\"_initGroupList\",value:function(){var e=this;xe.l(\"\".concat(this._n,\"._initGroupList\"));var t=new ka(\"getGroupListInStorage\"),n=this._groupModule.getStorageGroupList();if(st(n)&&n.length>0){n.forEach((function(t){e._groupModule.initGroupMap(t)})),this._groupModule.emitGroupListUpdate(!0,!1);var o=this._groupModule.getLocalGroupList().length;t.setNetworkType(this._groupModule.getNetworkType()).setMessage(\"group count:\".concat(o)).end()}else t.setNetworkType(this._groupModule.getNetworkType()).setMessage(\"group count:0\").end();xe.l(\"\".concat(this._n,\"._initGroupList ok\"))}},{key:\"handleUpdateGroupLastMessage\",value:function(e){var n=\"\".concat(this._n,\".handleUpdateGroupLastMessage\");if(xe.l(\"\".concat(n,\" conversation count:\").concat(e.length,\", local group count:\").concat(this._groupModule.getLocalGroupList().length)),0!==this._groupModule.getGroupMap().size){for(var o,s,a,r=!1,i=0,u=e.length;i0&&this._groupModule.onAVChatRoomMessage(s),this._groupModule.filterModifiedMessage(o),n.length>0)&&(this._groupModule.updateNextMessageSeq(n),this._groupModule.getModule(Fn).onNewMessage({conversationOptionsList:n,isInstantMessage:e.isInstantMessage||!0,updateUnreadCount:e.updateUnreadCount||!0}));var a=this._groupModule.filterUnmodifiedMessage(o);a.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,a),o.length=0}},{key:\"_newGroupMessageStoredAndSummary\",value:function(e){var t=this,n=e.dataList,o=e.event,s=e.isInstantMessage,a=null,r=[],i=[],u=[],c={},l=this._groupModule.getModule(Hn),p=this._groupModule.getFileDownloadProxy(),d=n.length;d>1&&n.sort((function(e,t){return e.sequence-t.sequence}));for(var g=function(e){var d=yt(n[e]),g=d.groupProfile,_=g.groupID,h=g.communityType,f=void 0===h?0:h,v=g.topicID,m=void 0===v?void 0:v,M=g.invisible,y=void 0,I=t._groupModule.isMessageFromTopic(f,m);if(I){y=S.CONV_TOPIC,d.to=m;var C=t._groupModule.getModule(wn);C.hasLocalTopic(_,m)||t._getTopicPendingMap.has(m)||(t._getTopicPendingMap.set(m,1),C.getTopicList({groupID:_,topicIDList:[m]}).finally((function(){t._getTopicPendingMap.delete(m)})))}var T=t._groupModule.hasLocalGroup(_);if(!T&&t._groupModule.isUnjoinedAVChatRoom(_))return\"continue\";if(!T&&!I)return t._cacheGroupMessageAndProbe({groupID:_,event:o,item:d}),\"continue\";if(t._groupModule.isMessageFromOrToAVChatroom(_))return d.event=o,u.push(d),\"continue\";if(d.currentUser=t._groupModule.getMyUserID(),d.conversationType=S.CONV_GROUP,d.isSystemMessage=!!d.isSystemMessage,a=new Ha(d),d.elements=l.parseElements(d.elements,d.from),a.setElement(d.elements,p),1===M)return t._qualityStat(s,a),\"continue\";var D=1===n[e].isModified,E=t._groupModule.getModule(Fn);if(E.isMessageSentByCurrentInstance(a)?a.isModified=D:D=!1,1===d.onlineOnlyFlag)a._onlineOnlyFlag=!0,E.isMessageSentByCurrentInstance(a)||i.push(a);else{if(t._groupModule.isMessageFromCommunityOfTopic(f,m))return i.push(a),\"continue\";if(!E.pushIntoMessageList(i,a,D))return\"continue\";t._qualityStat(s,a);var k=a,L=k.conversationID,A=k.sequence,R=E.isRemoteRead({conversationID:L,sequence:A});if(at(c[L])){var N=0;\"in\"===a.flow&&(a._isExcludedFromUnreadCount||R||(N=1)),c[L]=r.push({conversationID:L,unreadCount:N,type:at(y)?a.conversationType:y,subType:a.conversationSubType,lastMessage:a._isExcludedFromLastMessage?\"\":a})-1}else{var O=c[L];r[O].type=at(y)?a.conversationType:y,r[O].subType=a.conversationSubType,r[O].lastMessage=a._isExcludedFromLastMessage?\"\":a,\"in\"===a.flow&&(a._isExcludedFromUnreadCount||R||r[O].unreadCount++)}}},_=0;_0&&n.addMessageDelay(t.clientTime)}},{key:\"onGroupMessageRevoked\",value:function(e){var t=this._groupModule.getModule(Fn),n=[],o=null,s=!0;e.dataList.forEach((function(e){var a=e.elements.revokedInfos;at(a)||a.forEach((function(e){var a=jt(e.topicID)?\"GROUP\".concat(e.groupID):\"GROUP\".concat(e.topicID);o=t.revoke(a,e.sequence,e.random);var r=e.revokerInfo&&e.revokerInfo.revoker;if(o)o.revoker=r,n.push(o);else{var i={conversationID:a,to:e.topicID||\"\",sequence:e.sequence,time:e.time,revoker:r};t.isLastMessageRevoked(i)&&(n.push(i),s=!1)}}))})),0!==n.length&&(t.onMessageRevoked(n),!0===s&&(xe.l(\"\".concat(this._n,\".onGroupMessageRevoked count:\").concat(n.length)),this._groupModule.emitOuterEvent(E.MESSAGE_REVOKED,n)))}},{key:\"_groupListTreeShaking\",value:function(e){for(var t=new Map(m(this._groupModule.getGroupMap())),n=0,o=e.length;ng),h=\"offset:\".concat(u,\" totalCount:\").concat(d,\" isCompleted:\").concat(_,\" \")+\"currentCount:\".concat(l.length,\" isCommunityRelay:\").concat(s);return p.setNetworkType(t._groupModule.getNetworkType()).setMessage(\"\".concat(h)).end(),s||_?!s&&_?(xe.l(\"\".concat(n,\" start to get community list\")),u=0,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):s&&!_?(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l,isCommunityRelay:!0})):(xe.l(\"\".concat(n,\" ok. totalCount:\").concat(l.length)),Ka({groupList:l})):(u=g,t._pagingGetGroupList({limit:i,offset:u,groupBaseInfoFilter:c,groupList:l}))})).catch((function(e){return 11e3!==e.code&&t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];p.setMessage(\"isCommunityRelay:\".concat(s)).setError(e,o,a).end()})),s?(11e3===e.code&&(p=null,xe.l(\"\".concat(n,\" ok. community unavailable\"))),za({groupList:l})):Ja(e)}))}},{key:\"_pagingGetGroupListWithTopic\",value:function(e){var t=this,n=\"\".concat(this._n,\"._pagingGetGroupListWithTopic\"),o=e.limit,s=e.offset,a=e.groupBaseInfoFilter,r=e.groupList,i=new ka(\"pagingGetGroupListWithTopic\");return this._groupModule.request({protocolName:Wo,requestData:{type:S.GRP_COMMUNITY,memberAccount:this._groupModule.getMyUserID(),limit:o,offset:s,responseFilter:{groupBaseInfoFilter:a,selfInfoFilter:[\"Role\",\"JoinTime\",\"MsgFlag\",\"MsgSeq\"]},isSupportTopic:1}}).then((function(e){var u=e.data,c=u.groups,l=void 0===c?[]:c,p=u.totalCount;r.push.apply(r,m(l));var d=s+o,g=!(p>d),_=\"offset:\".concat(s,\" totalCount:\").concat(p,\" isCompleted:\").concat(g,\" \")+\"currentCount:\".concat(r.length);return i.setNetworkType(t._groupModule.getNetworkType()).setMessage(\"\".concat(_)).end(),g?(xe.l(\"\".concat(n,\" ok. totalCount:\").concat(r.length)),Ka({groupList:r})):(s=d,t._pagingGetGroupListWithTopic({limit:o,offset:s,groupBaseInfoFilter:a,groupList:r}))})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),Ja(e)}))}},{key:\"_cacheGroupMessage\",value:function(e,t){this._cachedGroupMessageMap.has(e)||this._cachedGroupMessageMap.set(e,[]),this._cachedGroupMessageMap.get(e).push(t)}},{key:\"_deleteCachedGroupMessage\",value:function(e){this._cachedGroupMessageMap.has(e)&&this._cachedGroupMessageMap.delete(e)}},{key:\"_notifyCachedGroupMessage\",value:function(e){var t=this,n=this._cachedGroupMessageMap.get(e)||[];n.forEach((function(e){t.onNewGroupMessage(e)})),this._deleteCachedGroupMessage(e),xe.l(\"\".concat(this._n,\"._notifyCachedGroupMessage groupID:\").concat(e,\" count:\").concat(n.length))}},{key:\"_cacheGroupMessageAndProbe\",value:function(e){var t=this,n=e.groupID,o=e.event,s=e.item;this._cacheGroupMessage(n,{event:o,dataList:[s]}),this._groupModule.getGroupSimplifiedInfo(n).then((function(e){e.type===S.GRP_AVCHATROOM?t._groupModule.hasLocalGroup(n)?t._notifyCachedGroupMessage(n):t._groupModule.setUnjoinedAVChatRoom(n):(t._groupModule.updateGroupMap([e]),t._notifyCachedGroupMessage(n))})),this._checkCountMap.has(n)||this._checkCountMap.set(n,0),xe.l(\"\".concat(this._n,\"._cacheGroupMessageAndProbe groupID:\").concat(n))}},{key:\"_handleGroupAtInfoWithoutTopic\",value:function(e,n){var o=this;e&&0!==n.length&&n.forEach((function(e){var n=e.groupID,s=e.groupAtInfoList,a=[];at(s)||(s.forEach((function(e){a.push(t(t({},e),{},{groupID:n}))})),o._groupModule.getModule(Fn).onNewGroupAtTips({dataList:a}))}))}},{key:\"reset\",value:function(){this._cachedGroupMessageMap.clear(),this._checkCountMap.clear(),this._getTopicPendingMap.clear(),this._isPagingGetCompleted=!1,this._groupModule.getInnerEmitterInstance().once(Za,this._initGroupList,this)}}]),e}(),yr=1,Ir=2,Cr=3,Tr=4,Dr=5,Er=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupAttributesHandler\",this._groupAttributesMap=new Map,this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on($a,this._onCloudConfigUpdated,this)}return a(e,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this._groupModule.getCloudConfig(\"grp_attr_cache_time\");at(e)||(this.CACHE_EXPIRE_TIME=Number(e))}},{key:\"updateLocalMainSequenceOnReconnected\",value:function(){this._groupAttributesMap.forEach((function(e){e.localMainSequence=0}))}},{key:\"isGroupAttributesUpdatedNotice\",value:function(e){var t=e.to,n=e.elements.newGroupProfile,o=!at(n)&&!jt(n.groupAttributeOption);return o&&this._onGroupAttributesUpdated({groupID:t,groupAttributeOption:n.groupAttributeOption}),o}},{key:\"_onGroupAttributesUpdated\",value:function(e){var t=this,n=e.groupID,o=e.groupAttributeOption,s=o.mainSequence,a=o.isWithChangedAttributeInfo,r=o.groupAttributeList,i=void 0===r?[]:r,u=o.operationType;if(xe.l(\"\".concat(this._n,\".onGroupAttributesUpdated. \")+\"groupID:\".concat(n,\" isWithChangedAttributeInfo:\").concat(a,\" operationType:\").concat(u)),!at(u)){this._groupAttributesCopy=this._getCachedAttributes({groupID:n});var c=s-this._getLocalGroupAttributes(n).localMainSequence;if(0!==c){if(1===a&&1===c)return this._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:s,groupAttributeList:i,operationType:u}),void this._emitGroupAttributesUpdated(n);if(this._hasLocalGroupAttributes(n)){var l=this._getLocalGroupAttributes(n).avChatRoomKey;this._getGroupAttributes({groupID:n,avChatRoomKey:l}).then((function(){t._emitGroupAttributesUpdated(n)}))}}}}},{key:\"initGroupAttributesCache\",value:function(e){var t=e.groupID,n=e.avChatRoomKey,o=void 0===n?void 0:n;this._groupAttributesMap.set(t,{lastUpdateTime:0,localMainSequence:0,remoteMainSequence:0,attributes:new Map,avChatRoomKey:o}),xe.l(\"\".concat(this._n,\".initGroupAttributesCache groupID:\").concat(t,\" avChatRoomKey:\").concat(o))}},{key:\"initGroupAttributes\",value:function(e){var t=this,n=e.groupID,o=e.groupAttributes,s=this._getLocalGroupAttributes(n),a=s.remoteMainSequence,r=s.avChatRoomKey,i=new ka(\"initGroupAttributes\");return i.setMessage(\"groupID:\".concat(n,\" avChatRoomKey:\").concat(r,\" mainSequence:\").concat(a)),this._groupModule.request({protocolName:Ms,requestData:{groupID:n,avChatRoomKey:r,mainSequence:a,groupAttributeList:this._transformGroupAttributes(o)}}).then((function(e){xe.l(\"\".concat(t._n,\".\").concat(\"initGroupAttributes\",\" ok. groupID:\").concat(n));var s=e.data,a=s.mainSequence,r=m(s.groupAttributeList);return r.forEach((function(e){e.value=o[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:a,groupAttributeList:r,operationType:yr}),t._emitGroupAttributesUpdated(n),i.setNetworkType(t._groupModule.getNetworkType()).end(),Ka({groupAttributes:o})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),Ja(e)}))}},{key:\"setGroupAttributes\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setGroupAttributes\"),o=e.groupID,s=e.groupAttributes,a=this._getLocalGroupAttributes(o),r=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=this._transformGroupAttributes(s);c.forEach((function(e){var t=e.key;e.sequence=0,u.has(t)&&(e.sequence=u.get(t).sequence)}));var l=new ka(\"setGroupAttributes\");return l.setMessage(\"groupID:\".concat(o,\" groupAttributes:\").concat(JSON.stringify(s))),xe.l(\"\".concat(n,\". groupID:\").concat(o,\" mainSequence:\").concat(r)),this._groupModule.request({protocolName:ys,requestData:{groupID:o,avChatRoomKey:i,mainSequence:r,groupAttributeList:c}}).then((function(e){xe.l(\"\".concat(n,\" ok.\"));var a=e.data,r=a.mainSequence,i=m(a.groupAttributeList);return i.forEach((function(e){e.value=s[e.key]})),t._groupAttributesCopy=t._getCachedAttributes({groupID:o}),t._refreshCachedGroupAttributes({groupID:o,remoteMainSequence:r,groupAttributeList:i,operationType:Ir}),t._emitGroupAttributesUpdated(o),l.setNetworkType(t._groupModule.getNetworkType()).end(),Ka({groupAttributes:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),Ja(e)}))}},{key:\"deleteGroupAttributes\",value:function(e){var t=this,n=e.groupID,o=e.keyList,s=void 0===o?[]:o,a=this._getLocalGroupAttributes(n),r=a.remoteMainSequence,i=a.avChatRoomKey,u=a.attributes,c=m(u.keys()),l=Cs,p=Cr,d={groupID:n,avChatRoomKey:i,mainSequence:r},g=[];s.length>0&&(c=[],l=Is,p=Tr,s.forEach((function(e){var t=0;u.has(e)&&(t=u.get(e).sequence,c.push(e)),g.push({key:e,sequence:t})})),d.groupAttributeList=g);var _=new ka(\"deleteGroupAttributes\");return _.setMessage(\"groupID:\".concat(n,\" mainSequence:\").concat(r,\" keyList:\").concat(s,\" protocolName:\").concat(l)),this._groupModule.request({protocolName:l,requestData:d}).then((function(e){xe.l(\"\".concat(t._n,\".\").concat(\"deleteGroupAttributes\",\" ok. groupID:\").concat(n));var o=e.data.mainSequence;return t._groupAttributesCopy=t._getCachedAttributes({groupID:n}),t._refreshCachedGroupAttributes({groupID:n,remoteMainSequence:o,groupAttributeList:g,operationType:p}),t._emitGroupAttributesUpdated(n),_.setNetworkType(t._groupModule.getNetworkType()).end(),Ka({keyList:c})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];_.setError(e,o,s).end()})),Ja(e)}))}},{key:\"getGroupAttributes\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getGroupAttributes\"),o=e.groupID,s=this._getLocalGroupAttributes(o),a=s.avChatRoomKey,r=s.lastUpdateTime,i=s.localMainSequence,u=s.remoteMainSequence,c=new ka(\"getGroupAttributes\");if(c.setMessage(\"groupID:\".concat(o,\" localMainSequence:\").concat(i,\" remoteMainSequence:\").concat(u,\" keyList:\").concat(e.keyList)),Date.now()-r>=this.CACHE_EXPIRE_TIME||i0)o.forEach((function(e){a.has(e)&&(s[e]=a.get(e).value)}));else{var r,i=D(a.keys());try{for(i.s();!(r=i.n()).done;){var u=r.value;s[u]=a.get(u).value}}catch(c){i.e(c)}finally{i.f()}}}return s}},{key:\"_updateCachedAttributes\",value:function(e){var t=e.groupAttributes,n=e.groupAttributeList,o=e.operationType;o!==Cr?o!==Tr?(o===yr&&t.attributes.clear(),n.forEach((function(e){var n=e.key,o=e.value,s=e.sequence;t.attributes.set(n,{value:o,sequence:s})}))):n.forEach((function(e){t.attributes.delete(e.key)})):t.attributes.clear()}},{key:\"_hasLocalGroupAttributes\",value:function(e){return this._groupAttributesMap.has(e)}},{key:\"_getLocalGroupAttributes\",value:function(e){return this._hasLocalGroupAttributes(e)||this.initGroupAttributesCache({groupID:e}),this._groupAttributesMap.get(e)}},{key:\"_transformGroupAttributes\",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:\"_emitGroupAttributesUpdated\",value:function(e){var t=this._getCachedAttributes({groupID:e}),n=this._computeAttrChangedInfo(t),o=n.updatedKeyList,s=n.deletedKeyList;xe.l(\"\".concat(this._n,\"._emitGroupAttributesUpdated update:\").concat(o.length,\", delete:\").concat(s.length)),0===o.length&&0===s.length||this._groupModule.emitOuterEvent(E.GROUP_ATTRIBUTES_UPDATED,{groupID:e,groupAttributes:t,updatedKeyList:o,deletedKeyList:s})}},{key:\"_computeAttrChangedInfo\",value:function(e){var t=this,n=[],o=[];return Object.keys(e).forEach((function(o){e[o]!==t._groupAttributesCopy[o]&&n.push(o)})),Object.keys(this._groupAttributesCopy).forEach((function(t){at(e[t])&&o.push(t)})),this._groupAttributesCopy={},{updatedKeyList:n,deletedKeyList:o}}},{key:\"deleteLocalGroupAttributes\",value:function(e){this._hasLocalGroupAttributes(e)&&this._groupAttributesMap.delete(e)}},{key:\"reset\",value:function(){this._groupAttributesMap.clear(),this._groupAttributesCopy={},this.CACHE_EXPIRE_TIME=3e4}}]),e}(),Sr=\"Set\",kr=\"Increase\",Lr=\"Decrease\",Ar=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupCountersHandler\",this._groupCountersMap=new Map,this.EXPIRE_TIME=3e4,this._groupModule.getInnerEmitterInstance().on($a,this._onCloudConfigUpdated,this)}return a(e,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this._groupModule.getCloudConfig(\"grp_counter_expire_time\");at(e)||(this.EXPIRE_TIME=Number(e))}},{key:\"isGroupCountersNotice\",value:function(e){var t=e.to,n=e.elements.groupCounterInfo,o=!1;return jt(n)||(this._onGroupCountersUpdated({groupID:t,groupCounterInfo:n}),o=!0),o}},{key:\"_onGroupCountersUpdated\",value:function(e){var t=this,n=e.groupID;e.groupCounterInfo.forEach((function(e){var o=e.type,s=e.groupCounterSeq,a=e.counterList,r=void 0===a?[]:a;0!==o&&2!==o||(t._updateLocalGroupCounters({groupID:n,groupCounterSeq:s,counterList:r}),r.forEach((function(e){t._groupModule.emitOuterEvent(E.GROUP_COUNTER_UPDATED,{groupID:n,key:e.key,value:e.value})}))),1===o&&t._deleteLocalGroupCounters({groupID:n,groupCounterSeq:s,counterList:r})})),xe.l(\"\".concat(this._n,\"._onGroupCountersUpdated groupID:\").concat(n))}},{key:\"initGroupCountersCache\",value:function(e){var t=e.groupID,n=e.avChatRoomKey;this._groupCountersMap.set(t,{lastUpdateTime:0,groupCounterSeq:0,counters:new Map,avChatRoomKey:n}),xe.l(\"\".concat(this._n,\".initGroupCountersCache groupID:\").concat(t,\" avChatRoomKey:\").concat(n))}},{key:\"setGroupCounters\",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".setGroupCounters\"),o=e.groupID,s=e.counters,a=this._convertObjectToList(s),r=this._getLocalGroupCounters(o).avChatRoomKey,i=\"groupID:\".concat(o,\" count:\").concat(a.length),u=new ka(\"setGroupCounters\");return u.setMessage(\"\".concat(i)),xe.l(\"\".concat(n,\". \").concat(i)),this._updateGroupCounters({groupID:o,counterList:a,avChatRoomKey:r,mode:Sr}).then((function(e){return u.end(),xe.l(\"\".concat(n,\" ok.\")),Ka({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"increaseGroupCounter\",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".increaseGroupCounters\"),o=e.groupID,s=e.key,a=e.value,r=this._getLocalGroupCounters(o).avChatRoomKey,i=\"groupID:\".concat(o,\" key:\").concat(s,\" value:\").concat(a),u=new ka(\"increaseGroupCounter\");u.setMessage(\"\".concat(i)),xe.l(\"\".concat(n,\". \").concat(i));var c=[{key:s,value:a}];return this._updateGroupCounters({groupID:o,counterList:c,avChatRoomKey:r,mode:kr}).then((function(e){return u.end(),xe.l(\"\".concat(n,\" ok.\")),Ka({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"decreaseGroupCounter\",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".decreaseGroupCounter\"),o=e.groupID,s=e.key,a=e.value,r=this._getLocalGroupCounters(o).avChatRoomKey,i=\"groupID:\".concat(o,\" key:\").concat(s,\" value:\").concat(a),u=new ka(\"decreaseGroupCounter\");u.setMessage(\"\".concat(i)),xe.l(\"\".concat(n,\". \").concat(i));var c=[{key:s,value:a}];return this._updateGroupCounters({groupID:o,counterList:c,avChatRoomKey:r,mode:Lr}).then((function(e){return u.end(),xe.l(\"\".concat(n,\" ok.\")),Ka({counters:e})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"getGroupCounters\",value:function(e){var t=this;if(!this._groupModule.canIUse(B.GRP_COUNTER))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".getGroupCounters\"),o=e.groupID,s=e.keyList,a=void 0===s?[]:s,r=this._getLocalGroupCounters(o),i=r.avChatRoomKey,u=r.lastUpdateTime,c=new ka(\"getGroupCounters\");if(c.setMessage(\"groupID:\".concat(o)),Date.now()-u>=this.EXPIRE_TIME)return this._getRemoteGroupCounters({groupID:o,avChatRoomKey:i}).then((function(e){c.setMoreMessage(\"from remote. count:\".concat(e.length)).end(),xe.l(\"\".concat(n,\" from remote. groupID:\").concat(o));var s=t._getLocalCounters(o,a);return Ka({counters:s})})).catch((function(e){return t._groupModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),Ja(e)}));c.setMoreMessage(\"from cache\").end(),xe.l(\"\".concat(n,\" from cache. groupID:\").concat(o));var l=this._getLocalCounters(o,a);return za({counters:l})}},{key:\"_getRemoteGroupCounters\",value:function(e){var n=this;return this._groupModule.request({protocolName:Ls,requestData:t({},e)}).then((function(t){var o=t.data,s=o.counterList,a=void 0===s?[]:s,r=o.groupCounterSeq;return n._updateLocalGroupCounters({groupID:e.groupID,counterList:a,groupCounterSeq:r}),xe.l(\"\".concat(n._n,\"._getRemoteGroupCounters ok. groupID:\").concat(e.groupID)),a})).catch((function(e){return Ja(e)}))}},{key:\"_convertObjectToList\",value:function(e){var t=[];return Object.keys(e).forEach((function(n){t.push({key:n,value:e[n]})})),t}},{key:\"_updateGroupCounters\",value:function(e){var n=\"\".concat(this._n,\"._updateGroupCounters\"),o=e.groupID,s=e.avChatRoomKey,a=e.mode;return xe.l(\"\".concat(n,\". groupID:\").concat(o,\" avChatRoomKey:\").concat(s,\" mode:\").concat(a)),this._groupModule.request({protocolName:ks,requestData:t({},e)}).then((function(e){xe.l(\"\".concat(n,\" ok.\"));var t=e.data.counterList,o={};return(void 0===t?[]:t).forEach((function(e){var t=e.key,n=e.value;o[t]=n})),o})).catch((function(e){return Ja(e)}))}},{key:\"_hasLocalGroupCounters\",value:function(e){return this._groupCountersMap.has(e)}},{key:\"_getLocalGroupCounters\",value:function(e){return this._hasLocalGroupCounters(e)||this.initGroupCountersCache({groupID:e}),this._groupCountersMap.get(e)}},{key:\"_updateLocalGroupCounters\",value:function(e){var t=e.groupID,n=e.counterList,o=void 0===n?[]:n,s=e.groupCounterSeq;if(this._hasLocalGroupCounters(t)){var a=this._getLocalGroupCounters(t),r=a.counters,i=a.avChatRoomKey,u=a.groupCounterSeq;if(s>0&&s0)t.forEach((function(e){o.has(e)&&(n[e]=o.get(e))}));else{var s,a=D(o.keys());try{for(a.s();!(s=a.n()).done;){var r=s.value;n[r]=o.get(r)}}catch(i){a.e(i)}finally{a.f()}}return n}},{key:\"reset\",value:function(){this._groupCountersMap.clear(),this.EXPIRE_TIME=3e4}}]),e}(),Rr=function(){function e(t){o(this,e);var n=t.manager,s=t.groupID,a=t.onInit,r=t.onSuccess,i=t.onFail;this._n=\"Polling\",this._manager=n,this._groupModule=n._groupModule,this._onInit=a,this._onSuccess=r,this._onFail=i,this._groupID=s,this._timeoutID=-1,this._isRunning=!1,this._protocolName=_s}return a(e,[{key:\"start\",value:function(){var e=this._groupModule.isLoggedIn();e||(this._protocolName=hs),xe.l(\"\".concat(this._n,\".start pollingInterval:\").concat(this._manager.getPollingInterval(),\" isLoggedIn:\").concat(e)),this._isRunning=!0,this._request()}},{key:\"isRunning\",value:function(){return this._isRunning}},{key:\"_request\",value:function(){var e=this,t=this._onInit(this._groupID);this._groupModule.request({protocolName:this._protocolName,requestData:t}).then((function(t){e._onSuccess(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.getPollingInterval()))})).catch((function(t){e._onFail(e._groupID,t),e.isRunning()&&(clearTimeout(e._timeoutID),e._timeoutID=setTimeout(e._request.bind(e),e._manager.MAX_POLLING_INTERVAL))}))}},{key:\"stop\",value:function(){xe.l(\"\".concat(this._n,\".stop\")),this._timeoutID>0&&(clearTimeout(this._timeoutID),this._timeoutID=-1),this._isRunning=!1}},{key:\"getPollingTimerID\",value:function(){return this._timeoutID}}]),e}(),Nr={3:!0,4:!0,5:!0,6:!0,17:!0},Or=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"AVChatRoomHandler\",this._joinedGroupMap=new Map,this._pollingRequestInfoMap=new Map,this._pollingInstanceMap=new Map,this.sequencesLinkedList=new lr(200),this.messageIDLinkedList=new lr(100),this.receivedMessageCount=0,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}return a(e,[{key:\"hasJoinedAVChatRoom\",value:function(){return this._joinedGroupMap.size>0}},{key:\"checkJoinedAVChatRoomByID\",value:function(e){return this._joinedGroupMap.has(e)}},{key:\"getJoinedAVChatRoom\",value:function(){return this._joinedGroupMap.size>0?m(this._joinedGroupMap.keys()):null}},{key:\"_updateRequestData\",value:function(e){var n=this._pollingRequestInfoMap.get(e);return e===m(this._pollingInstanceMap.keys())[0]?t(t({},n),{},{startBroadcastSeq:this._startBroadcastSeq,simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG}):t(t({},n),{},{simplifiedMessage:this.DEFAULT_POLLING_SIMPLIFIED_MSG})}},{key:\"_handleSuccess\",value:function(e,t){var n=t.data,o=n.key,s=n.nextSeq,a=n.rspMsgList,r=n.errorCode,i=n.nextBroadcastSeq,u=n.broadcastMessageList;if(0!==r){var c=this._pollingRequestInfoMap.get(e),l=new ka(\"longPollingAVError\"),p=c?\"\".concat(c.key,\"-\").concat(c.startSeq):\"requestInfo is undefined\";l.setMessage(\"\".concat(e,\"-\").concat(p,\"-\").concat(t.errorInfo)).setCode(t.errorCode).setNetworkType(this._groupModule.getNetworkType()).end(!0)}else{if(!this.checkJoinedAVChatRoomByID(e))return;et(o)&&$e(s)&&this._pollingRequestInfoMap.set(e,{key:o,startSeq:s}),$e(i)&&i>this._startBroadcastSeq&&(this._startBroadcastSeq=i),st(a)&&a.length>0?(a.forEach((function(e){e.to=e.groupID})),this.onMessage(a)):(this._pollingNoMessageCount+=1,this._pollingNoMessageCount===this.DEFAULT_POLLING_NO_MESSAGE_COUNT&&(this._pollingInterval=this.DEFAULT_POLLING_INTERVAL+this.DEFAULT_POLLING_INTERVAL_PLUS)),this._onBroadcastMessage(u)}}},{key:\"_handleFailure\",value:function(e,t){}},{key:\"onMessage\",value:function(e){if(st(e)&&0!==e.length){0!==this._pollingNoMessageCount&&(this._pollingNoMessageCount=0,this._pollingInterval=this.DEFAULT_POLLING_INTERVAL);var t=null,n=[],o=this._getModule(Fn),s=this._getModule($n),a=e.length;a>1&&e.sort((function(e,t){return e.sequence-t.sequence}));for(var r=this._getModule(qn),i=0;i1&&g<=20?this._getModule(Jn).onMessageMaybeLost(p,d+1,g-1):g<-1&&g>=-20&&this._getModule(Jn).onMessageMaybeLost(p,t.sequence+1,Math.abs(g)-1)}this.sequencesLinkedList.set(t.sequence),this.messageIDLinkedList.set(t.ID);var _=!1;if(this._isMessageSentByCurrentInstance(t)?c&&(_=!0,t.isModified=c,o.updateMessageIsModifiedProperty(t)):_=!0,_){if(t.conversationType===S.CONV_SYSTEM&&5===t.payload.operationType&&this._onGroupDismissed(t.payload.groupProfile.groupID),!l&&t.conversationType!==S.CONV_SYSTEM){var h=t.conversationID.replace(S.CONV_GROUP,\"\");this._pollingInstanceMap.has(h)?this._groupModule.isLoggedIn()&&s.addMessageSequence({key:Ca,message:t}):(t.type!==S.MSG_GRP_TIP&&t.clientTime>0&&s.addMessageDelay(t.clientTime),s.addMessageSequence({key:Ia,message:t}))}n.push(t)}}}else xe.w(\"\".concat(this._n,\".onMessage unknown event:\").concat(u.event))}if(0!==n.length){this._groupModule.filterModifiedMessage(n);var f=this.packConversationOption(n);if(f.length>0)this._getModule(Fn).onNewMessage({conversationOptionsList:f,isInstantMessage:!0});xe.d(\"\".concat(this._n,\".onMessage count:\").concat(n.length)),this._checkMessageStacked(n);var v=this._groupModule.filterUnmodifiedMessage(n);v.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,v),n.length=0}}}},{key:\"isBroadcastOrNormal\",value:function(e){return 3===e||17===e}},{key:\"isGroupTip\",value:function(e){return 4===e||6===e}},{key:\"isGroupSystemNotice\",value:function(e){return 5===e}},{key:\"restoreGroupTipElements\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.groupJoinType||(e.groupJoinType=1);var t=e.operatorInfo,n=void 0===t?{}:t,o=e.operatorID,s=e.userIDList,a=void 0===s?[]:s,r=n.userID,i=void 0===r?o:r,u=n.avatar,c=void 0===u?\"\":u,l=n.nick,p=void 0===l?\"\":l;e.operatorInfo={userID:i,avatar:c,nick:p};var d=a.map((function(e){return{userID:e}}));return e.memberInfoList=e.memberInfoList||d,e}},{key:\"restoreMessageFromSimplified\",value:function(e){var n=e.event;if(this.isBroadcastOrNormal(n)&&(e.cloudCustomData=e.cloudCustomData||\"\",e.elements=e.elements.map((function(e){if(e.type===S.MSG_CUSTOM){var n=e.content,o=void 0===n?{}:n;e.content=t({data:\"\",description:\"\",extension:\"\"},o)}return e}))),(this.isGroupTip(n)||this.isGroupSystemNotice(n))&&(e.from=e.from||\"@TIM#SYSTEM\"),this.isGroupTip(n)){e.elements=this.restoreGroupTipElements(e.elements);var o=e.elements,s=void 0===o?{}:o,a=s.operationType,i=s.operatorInfo;if(1===a){var u=[{userID:(void 0===i?{}:i).userID}];s.memberInfoList=s.memberInfoList||u}}if(this.isGroupSystemNotice(n)){var c=e.elements,l=c.memberInfoList,p=c.operatorInfo;l||(l=void 0===p?{}:p),e.elements.memberInfoList=t({userID:e.elements.operatorID,avatar:\"\",nick:\"\"},l),e.elements=t({authentication:\"\",remarkInfo:\"\",messageKey:1e3*e.time},e.elements);var d=Object.keys(e.elements).filter((function(e){return\"operatorInfo\"!==e})).reduce((function(n,o){return t(t({},n),{},r({},o,e.elements[o]))}),{});e.elements=d}return e}},{key:\"_onGroupDismissed\",value:function(e){xe.l(\"\".concat(this._n,\"._onGroupDismissed groupID:\").concat(e)),this._groupModule.deleteLocalGroupAndConversation(e),this.reset(e)}},{key:\"_checkMessageStacked\",value:function(e){var t=\"MessageStacked\",n=e.length;n>=100&&(this._groupModule.outputWarning(t,n),this._reportMessageStackedCount<5&&(new ka(t).setNetworkType(this._groupModule.getNetworkType()).setMessage(\"count:\".concat(n,\" groupID:\").concat(m(this._joinedGroupMap.keys()))).setLevel(\"warning\").end(),this._reportMessageStackedCount+=1))}},{key:\"_isMessageSentByCurrentInstance\",value:function(e){return!!this._getModule(Fn).isMessageSentByCurrentInstance(e)}},{key:\"packMessage\",value:function(e,t){e.currentUser=this._groupModule.getMyUserID(),e.conversationType=5===t?S.CONV_SYSTEM:S.CONV_GROUP,e.isSystemMessage=!!e.isSystemMessage;var n=new Ha(e),o=this.packElements(e,t);return n.setElement(o,this._groupModule.getFileDownloadProxy()),n}},{key:\"packElements\",value:function(e,n){return 4===n||6===n?(this._updateMemberCountByGroupTips(e),{type:S.MSG_GRP_TIP,content:t(t({},e.elements),{},{groupProfile:e.groupProfile})}):5===n?{type:S.MSG_GRP_SYS_NOTICE,content:t(t({},e.elements),{},{groupProfile:t(t({},e.groupProfile),{},{groupID:e.groupID})})}:this._getModule(Hn).parseElements(e.elements,e.from)}},{key:\"packConversationOption\",value:function(e){for(var t=new Map,n=0;n0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,t)}}},{key:\"start\",value:function(e){if(this._pollingInstanceMap.has(e)){var t=this._pollingInstanceMap.get(e);t.isRunning()||t.start()}else{var n=new Rr({manager:this,groupID:e,onInit:this._updateRequestData.bind(this),onSuccess:this._handleSuccess.bind(this),onFail:this._handleFailure.bind(this)});n.start(),this._pollingInstanceMap.set(e,n),xe.l(\"\".concat(this._n,\".start groupID:\").concat(e))}}},{key:\"handleJoinResult\",value:function(e){var t=this;return this._preCheck().then((function(){var n=e.longPollingKey,o=e.group,s=o.groupID;return t._joinedGroupMap.set(s,o),t._groupModule.updateGroupMap([o]),t._groupModule.deleteUnjoinedAVChatRoom(s),t._groupModule.emitGroupListUpdate(!0,!1),at(n)?za({status:Ye,group:o}):Promise.resolve()}))}},{key:\"startRunLoop\",value:function(e){var t=this;return this.handleJoinResult(e).then((function(){var n=e.longPollingKey,o=e.group,s=e.startSeq,a=void 0===s?0:s,r=o.groupID;return t._pollingRequestInfoMap.set(r,{key:n,startSeq:a}),t.start(r),t._groupModule.isLoggedIn()?za({status:Ye,group:o}):za({status:Ye})}))}},{key:\"_preCheck\",value:function(){if(this._getModule(qn).isUnlimitedAVChatRoom())return Promise.resolve();if(!this.hasJoinedAVChatRoom())return Promise.resolve();var e=v(this._joinedGroupMap.entries().next().value,2),t=e[0],n=e[1];if(this._groupModule.isLoggedIn()){if(!(n.selfInfo.role===S.GRP_MBR_ROLE_OWNER||n.ownerID===this._groupModule.getMyUserID()))return this._groupModule.quitGroup(t);this._groupModule.deleteLocalGroupAndConversation(t)}else this._groupModule.deleteLocalGroupAndConversation(t);return this.reset(t),Promise.resolve()}},{key:\"joinWithoutAuth\",value:function(e){var t=this,n=e.groupID,o=\"\".concat(this._n,\".\").concat(\"joinWithoutAuth\"),s=new ka(\"joinWithoutAuth\");return this._groupModule.request({protocolName:Qo,requestData:e}).then((function(e){var a=e.data.longPollingKey;if(t._groupModule.probeNetwork().then((function(e){var t=v(e,2);t[0];var o=t[1];s.setNetworkType(o).setMessage(\"groupID:\".concat(n,\" longPollingKey:\").concat(a)).end(!0)})),at(a))return Ja({code:da.CANNOT_JOIN_NON_AVCHATROOM_WITHOUT_LOGIN});xe.l(\"\".concat(o,\" ok. groupID:\").concat(n)),t._getModule(Fn).setCompleted(\"\".concat(S.CONV_GROUP).concat(n));var r=new dr({groupID:n});return t.startRunLoop({group:r,longPollingKey:a}),Ka({status:Ye})})).catch((function(e){return xe.e(\"\".concat(o,\" failed. groupID:\").concat(n,\" error:\"),e),t._groupModule.probeNetwork().then((function(t){var o=v(t,2),a=o[0],r=o[1];s.setError(e,a,r).setMessage(\"groupID:\".concat(n)).end(!0)})),Ja(e)})).finally((function(){t._groupModule.getModule(Vn).reportAtOnce()}))}},{key:\"getGroupOnlineMemberCount\",value:function(e){var t=this._onlineMemberCountMap.get(e)||{},n=Date.now();return jt(t)||n-t.lastSyncTime>1e3*t.expireTime&&n-t.latestUpdateTime>1e4&&n-t.lastReqTime>3e3?(t.lastReqTime=n,this._onlineMemberCountMap.set(e,t),this._getGroupOnlineMemberCount(e).then((function(e){return Ka({memberCount:e.memberCount})})).catch((function(e){return Ja(e)}))):za({memberCount:t.memberCount})}},{key:\"_getGroupOnlineMemberCount\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"_getGroupOnlineMemberCount\");return this._groupModule.request({protocolName:fs,requestData:{groupID:e}}).then((function(o){var s=t._onlineMemberCountMap.get(e)||{},a=o.data,r=a.onlineMemberNum,i=void 0===r?0:r,u=a.expireTime,c=void 0===u?t.DEFAULT_EXPIRE_TIME:u;xe.l(\"\".concat(n,\" ok. groupID:\").concat(e,\" memberCount:\").concat(i,\" expireTime:\").concat(c));var l=Date.now();return jt(s)&&(s.lastReqTime=l),t._onlineMemberCountMap.set(e,Object.assign(s,{lastSyncTime:l,latestUpdateTime:l,memberCount:i,expireTime:c})),{memberCount:i}})).catch((function(o){return xe.w(\"\".concat(n,\" failed. error:\"),o),new ka(\"_getGroupOnlineMemberCount\").setCode(o.code).setMessage(\"groupID:\".concat(e,\" error:\").concat(JSON.stringify(o))).setNetworkType(t._groupModule.getNetworkType()).end(),Promise.reject(o)}))}},{key:\"_getModule\",value:function(e){return this._groupModule.getModule(e)}},{key:\"setPollingInterval\",value:function(e){at(e)||($e(e)?this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=e:this._pollingInterval=this.DEFAULT_POLLING_INTERVAL=parseInt(e,10))}},{key:\"setPollingIntervalPlus\",value:function(e){at(e)||($e(e)?this.DEFAULT_POLLING_INTERVAL_PLUS=e:this.DEFAULT_POLLING_INTERVAL_PLUS=parseInt(e,10))}},{key:\"setPollingNoMessageCount\",value:function(e){at(e)||($e(e)?this.DEFAULT_POLLING_NO_MESSAGE_COUNT=e:this.DEFAULT_POLLING_NO_MESSAGE_COUNT=parseInt(e,10))}},{key:\"setPollingSimplifiedMessage\",value:function(e){at(e)||\"0\"!==e&&\"1\"!==e||(this.DEFAULT_POLLING_SIMPLIFIED_MSG=parseInt(e,10))}},{key:\"getPollingInterval\",value:function(){return this._pollingInterval}},{key:\"onAVChatRoomMemberBanned\",value:function(e){var t=e.payload.groupProfile.groupID;xe.l(\"\".concat(this._n,\".onAVChatRoomMemberBanned groupID:\").concat(t)),this._groupModule.deleteLocalGroupAndConversation(t),this.reset(t)}},{key:\"restartPolling\",value:function(){xe.l(\"\".concat(this._n,\".restartPolling count:\").concat(this._pollingInstanceMap.size));var e,t=D(this._pollingInstanceMap.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;n.stop(),n.start()}}catch(o){t.e(o)}finally{t.f()}}},{key:\"getPollingTimerID\",value:function(e){if(!this._pollingInstanceMap.has(e))return-1;var t=this._pollingInstanceMap.get(e).getPollingTimerID();return xe.l(\"\".concat(this._n,\".getPollingTimerID groupID:\").concat(e,\" timerID:\").concat(t)),t}},{key:\"reset\",value:function(e){if(e){xe.l(\"\".concat(this._n,\".reset groupID:\").concat(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{xe.l(\"\".concat(this._n,\".reset all\"));var n,o=D(this._pollingInstanceMap.values());try{for(o.s();!(n=o.n()).done;){n.value.stop()}}catch(s){o.e(s)}finally{o.f()}this._pollingInstanceMap.clear(),this._joinedGroupMap.clear(),this._pollingRequestInfoMap.clear(),this._onlineMemberCountMap.clear(),this._broadcastMessageIDMap.clear()}this.sequencesLinkedList.reset(),this.messageIDLinkedList.reset(),this.receivedMessageCount=0,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}}]),e}(),Gr=1,Ur=15,Pr=function(){function e(t){o(this,e),this._groupModule=t,this._n=\"GroupSystemNoticeHandler\",this.pendencyMap=new Map}return a(e,[{key:\"onNewGroupSystemNotice\",value:function(e){var t=e.dataList,n=e.isSyncingEnded,o=e.isInstantMessage;xe.d(\"\".concat(this._n,\".onReceiveSystemNotice count:\").concat(t.length));var s=this.newSystemNoticeStoredAndSummary({notifiesList:t,isInstantMessage:o}),a=s.eventDataList,r=s.result;a.length>0&&(this._groupModule.getModule(Fn).onNewMessage({conversationOptionsList:a,isInstantMessage:o}),this._onReceivedGroupSystemNotice({result:r,isInstantMessage:o}));o?r.length>0&&this._groupModule.emitOuterEvent(E.MESSAGE_RECEIVED,r):!0===n&&this._clearGroupSystemNotice()}},{key:\"newSystemNoticeStoredAndSummary\",value:function(e){var n=e.notifiesList,o=e.isInstantMessage,s=null,a=n.length,r=0,i=[],u={conversationID:S.CONV_SYSTEM,unreadCount:0,type:S.CONV_SYSTEM,subType:null,lastMessage:null};for(r=0;r0?[u]:[],result:i}}},{key:\"_clearGroupSystemNotice\",value:function(){var e=this;this._getPendencyList().then((function(t){t.forEach((function(t){e.pendencyMap.set(\"\".concat(t.from,\"_\").concat(t.groupID,\"_\").concat(t.to),t)}));var n=e._groupModule.getModule(Fn).getLocalMessageList(S.CONV_SYSTEM),o=[];n.forEach((function(t){var n=t.payload,s=n.operatorID,a=n.operationType,r=n.groupProfile;if(a===Gr){var i=\"\".concat(s,\"_\").concat(r.groupID,\"_\").concat(r.to),u=e.pendencyMap.get(i);u&&$e(u.handled)&&0!==u.handled&&o.push(t)}})),e.deleteGroupSystemNotice({messageList:o})}))}},{key:\"deleteGroupSystemNotice\",value:function(e){var t=this,n=\"\".concat(this._n,\".deleteGroupSystemNotice\");return st(e.messageList)&&0!==e.messageList.length?(xe.l(\"\".concat(n,\" \")+e.messageList.map((function(e){return e.ID}))),this._groupModule.request({protocolName:gs,requestData:{messageListToDelete:e.messageList.map((function(e){return{from:S.CONV_SYSTEM,messageSeq:e.clientSequence,messageRandom:e.random}}))}}).then((function(){xe.l(\"\".concat(n,\" ok\"));var o=t._groupModule.getModule(Fn);return e.messageList.forEach((function(e){o.deleteLocalMessage(e)})),Ka()})).catch((function(e){return xe.e(\"\".concat(n,\" error:\"),e),Ja(e)}))):za()}},{key:\"_getPendencyList\",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.type,o=void 0===n?void 0:n,s=t.startTime,a=void 0===s?0:s,r=t.limit,i=void 0===r?20:r;return this._groupModule.request({protocolName:ds,requestData:{type:o,startTime:a,limit:i,handleAccount:this._groupModule.getMyUserID()}}).then((function(t){var n=t.data.pendencyList;return 0!==t.data.nextStartTime?e._getPendencyList({startTime:t.data.nextStartTime}).then((function(e){return[].concat(m(n),m(e))})):n}))}},{key:\"getGroupApplicationList\",value:function(){var e=this;return this._getPendencyList().then((function(t){return e._getPendencyList({type:S.GRP_COMMUNITY}).then((function(n){return t.push.apply(t,m(n)),e._handlePendencyResult(t)})).catch((function(n){return e._handlePendencyResult(t)}))}))}},{key:\"_handlePendencyResult\",value:function(e){var t=this,n=[];return e.forEach((function(e){t.pendencyMap.set(\"\".concat(e.from,\"_\").concat(e.groupID,\"_\").concat(e.to),e),0===e.handled&&n.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})})),za({applicationList:n})}},{key:\"_onReceivedGroupSystemNotice\",value:function(e){var t=this,n=e.result;e.isInstantMessage&&n.forEach((function(e){switch(e.payload.operationType){case 1:break;case 2:t._onApplyGroupRequestAgreed(e);break;case 3:break;case 4:t._onMemberKicked(e);break;case 5:t._onGroupDismissed(e);break;case 6:break;case 7:t._onInviteGroup(e);break;case 8:t._onQuitGroup(e);break;case 9:t._onSetManager(e);break;case 10:t._onDeleteManager(e);break;case 11:case 12:case 15:break;case 20:t._onMessageRemindTypeSynced(e);break;case 21:t._groupModule.onAVChatRoomMemberBanned(e)}}))}},{key:\"_onApplyGroupRequestAgreed\",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;if(n){t._groupModule.updateGroupMap([n]);var o=!n.isSupportTopic;t._groupModule.emitGroupListUpdate(!0,o)}}))}},{key:\"_onMemberKicked\",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:\"_onGroupDismissed\",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t);var n=this._groupModule._AVChatRoomHandler;n&&n.checkJoinedAVChatRoomByID(t)&&n.reset(t)}},{key:\"_onInviteGroup\",value:function(e){var t=this,n=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(n)||this._groupModule.getGroupProfile({groupID:n}).then((function(e){var n=e.data.group;n&&(t._groupModule.updateGroupMap([n]),t._groupModule.emitGroupListUpdate())}))}},{key:\"_onQuitGroup\",value:function(e){var t=e.payload.groupProfile.groupID;this._groupModule.hasLocalGroup(t)&&this._groupModule.deleteLocalGroupAndConversation(t)}},{key:\"_onSetManager\",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,s=this._groupModule.getModule(bn).getLocalGroupMemberInfo(o,n);s&&s.updateRole(S.GRP_MBR_ROLE_ADMIN)}},{key:\"_onDeleteManager\",value:function(e){var t=e.payload.groupProfile,n=t.to,o=t.groupID,s=this._groupModule.getModule(bn).getLocalGroupMemberInfo(o,n);s&&s.updateRole(S.GRP_MBR_ROLE_MEMBER)}},{key:\"_onMessageRemindTypeSynced\",value:function(e){var t=e.payload.groupProfile.groupID,n=e.payload.messageRemindType;this._groupModule.getModule(Fn).onGroupMessageRemindTypeSynced({groupID:t,messageRemindType:n})}},{key:\"_handleTopicSystemNotice\",value:function(e){var t=e.groupProfile,n=t.groupID,o=t.topicID,s=e.elements,a=s.operationType,r=s.topicIDList,i=s.messageRemindType,u=this._groupModule.getModule(wn);17===a?u.onTopicCreated({groupID:n,topicID:o}):18===a?u.onTopicDeleted({groupID:n,topicIDList:r}):20===a&&u.onTopicMessageRemindTypeUpdated({groupID:n,topicID:o,messageRemindType:i})}},{key:\"reset\",value:function(){this.pendencyMap.clear()}}]),e}(),br=[\"relayFlag\"],wr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n=\"GroupModule\",t._commonGroupHandler=null,t._AVChatRoomHandler=null,t._groupSystemNoticeHandler=null,t._commonGroupHandler=new Mr(_(t)),t._groupAttributesHandler=new Er(_(t)),t._groupCountersHandler=new Ar(_(t)),t._AVChatRoomHandler=new Or(_(t)),t._groupTipsHandler=new mr(_(t)),t._groupSystemNoticeHandler=new Pr(_(t)),t.groupMap=new Map,t._unjoinedAVChatRoomList=new Map,t._receiptDetailCompleteMap=new Map,t.getInnerEmitterInstance().on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"polling_interval\"),t=this.getCloudConfig(\"polling_interval_plus\"),n=this.getCloudConfig(\"polling_no_msg_count\"),o=this.getCloudConfig(\"polling_simplified_msg\");this._AVChatRoomHandler&&(xe.l(\"\".concat(this._n,\"._onCloudConfigUpdated pollingInterval:\").concat(e)+\" pollingIntervalPlus:\".concat(t,\" pollingNoMessageCount:\").concat(n)+\" pollingSimplifiedMessage:\".concat(o)),this._AVChatRoomHandler.setPollingInterval(e),this._AVChatRoomHandler.setPollingIntervalPlus(t),this._AVChatRoomHandler.setPollingNoMessageCount(n),this._AVChatRoomHandler.setPollingSimplifiedMessage(o))}},{key:\"onCheckTimer\",value:function(e){this.isLoggedIn()&&(this._commonGroupHandler.onCheckTimer(e),this._groupTipsHandler.onCheckTimer(e))}},{key:\"guardForAVChatRoom\",value:function(e){var t=this;if(e.conversationType===S.CONV_GROUP){var n=Dt(e.to)?qt(e.to):e.to;return this.hasLocalGroup(n)?za():this.getGroupProfile({groupID:n}).then((function(o){var s=o.data.group.type;if(xe.l(\"\".concat(t._n,\".guardForAVChatRoom. groupID:\").concat(n,\" type:\").concat(s)),s===S.GRP_AVCHATROOM){var a=da.MESSAGE_SEND_FAIL_NOT_IN_AVCHATROOM;return Ja(new Wa({code:a,message:t.getErrorMessage(a,e.from,n),data:{message:e}}))}return za()}))}return za()}},{key:\"checkJoinedAVChatRoomByID\",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:\"onNewGroupMessage\",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onNewGroupMessage(e)}},{key:\"updateNextMessageSeq\",value:function(e){var t=this;if(st(e)){var n=this.getModule(wn);e.forEach((function(e){var o=e.conversationID.replace(S.CONV_GROUP,\"\");Dt(o)&&n.updateLastMessage(o,e.lastMessage),t.groupMap.has(o)&&(t.groupMap.get(o).nextMessageSeq=e.lastMessage.sequence+1)}))}}},{key:\"onNewGroupTips\",value:function(e){this._groupTipsHandler&&this._groupTipsHandler.onNewGroupTips(e)}},{key:\"onGroupMessageRevoked\",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.onGroupMessageRevoked(e)}},{key:\"onNewGroupSystemNotice\",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.onNewGroupSystemNotice(e)}},{key:\"onGroupMessageReadNotice\",value:function(e){var t=this;e.dataList.forEach((function(e){var n=e.elements.groupMessageReadNotice;if(!at(n)){var o=t.getModule(Fn);n.forEach((function(e){var n=e.groupID,s=e.topicID,a=void 0===s?void 0:s,r=e.lastMessageSeq;xe.d(\"\".concat(t._n,\".onGroupMessageReadNotice groupID:\").concat(n,\" lastMessageSeq:\").concat(r));var i=\"\".concat(S.CONV_GROUP).concat(n),u=!0;jt(a)||(i=\"\".concat(S.CONV_GROUP).concat(a),u=!1),o.updateIsReadAfterReadReport({conversationID:i,lastMessageSeq:r}),o.updateUnreadCount(i,u),o.clearGroupAtInfoList(i,u)}))}}))}},{key:\"onReadReceiptList\",value:function(e){var t=this;xe.d(\"\".concat(this._n,\".onReadReceiptList options:\"),JSON.stringify(e)),e.dataList.forEach((function(e){var n=e.groupProfile,o=e.elements,s=n.groupID,a=t.getModule(Fn),r=o.readReceiptList;a.updateReadReceiptInfo({groupID:s,readReceiptList:r})}))}},{key:\"onGroupMessageModified\",value:function(e){xe.d(\"\".concat(this._n,\".onGroupMessageModified options:\"),JSON.stringify(e));var n=this.getModule(Fn);e.dataList.forEach((function(e){n.onMessageModified(t(t({},e),{},{conversationType:S.CONV_GROUP,to:e.topicID?e.topicID:e.groupID}))}))}},{key:\"deleteGroupSystemNotice\",value:function(e){this._groupSystemNoticeHandler&&this._groupSystemNoticeHandler.deleteGroupSystemNotice(e)}},{key:\"initGroupMap\",value:function(e){this.groupMap.set(e.groupID,new dr(e))}},{key:\"deleteGroup\",value:function(e){this.groupMap.delete(e)}},{key:\"updateGroupMap\",value:function(e){var t,n=this,o=this.getModule(Fn);e.forEach((function(e){t=e.groupID,n.groupMap.has(t)?n.groupMap.get(t).updateGroup(e):(n.groupMap.set(t,new dr(e)),o.deleteGroupRomaingMessageInfo(t))}));var s,a=this.getMyUserID(),r=D(this.groupMap);try{for(r.s();!(s=r.n()).done;){var i=v(s.value,2)[1];i.selfInfo.userID=a,\"Owner\"===i.selfInfo.role&&(i.ownerID=a)}}catch(u){r.e(u)}finally{r.f()}this._setStorageGroupList()}},{key:\"getStorageGroupList\",value:function(){return this.getModule(xn).getItem(\"groupMap\")}},{key:\"_setStorageGroupList\",value:function(){var e=this.getLocalGroupList().filter((function(e){var t=e.type;return!Ct(t)})).filter((function(e){return!e.isSupportTopic})).slice(0,20).map((function(e){return{groupID:e.groupID,name:e.name,avatar:e.avatar,type:e.type}}));this.getModule(xn).setItem(\"groupMap\",e)}},{key:\"getGroupMap\",value:function(){return this.groupMap}},{key:\"getLocalGroupList\",value:function(){return m(this.groupMap.values())}},{key:\"getLocalGroupProfile\",value:function(e){return this.groupMap.get(e)}},{key:\"sortLocalGroupList\",value:function(){var e=m(this.groupMap).filter((function(e){var t=v(e,2);return t[0],!jt(t[1].lastMessage)}));e.sort((function(e,t){return t[1].lastMessage.lastTime-e[1].lastMessage.lastTime})),this.groupMap=new Map(m(e))}},{key:\"updateGroupLastMessage\",value:function(e){this._commonGroupHandler&&this._commonGroupHandler.handleUpdateGroupLastMessage(e)}},{key:\"emitGroupListUpdate\",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.getLocalGroupList();if(e&&this.emitOuterEvent(E.GROUP_LIST_UPDATED),t){var o=JSON.parse(JSON.stringify(n)),s=this.getModule(Fn);s.updateConversationGroupProfile(o)}}},{key:\"patchGroupMessageRemindType\",value:function(){var e=this.getLocalGroupList(),t=this.getModule(Fn),n=0;e.forEach((function(e){!0===t.patchMessageRemindType({ID:e.groupID,isC2CConversation:!1,messageRemindType:e.selfInfo.messageRemindType})&&(n+=1)})),xe.l(\"\".concat(this._n,\".patchGroupMessageRemindType count:\").concat(n))}},{key:\"recomputeUnreadCount\",value:function(){var e=this.getLocalGroupList(),t=this.getModule(Fn);e.forEach((function(e){var n=e.groupID,o=e.selfInfo,s=o.excludedUnreadSequenceList,a=o.readedSequence;if(st(s)){var r=0;s.forEach((function(t){t>=a&&t<=e.nextMessageSeq-1&&(r+=1)})),r>=1&&t.recomputeGroupUnreadCount({conversationID:\"\".concat(S.CONV_GROUP).concat(n),count:r})}}))}},{key:\"getMyNameCardByGroupID\",value:function(e){var t=this.getLocalGroupProfile(e);return t?t.selfInfo.nameCard:\"\"}},{key:\"isPagingGetCompleted\",value:function(){return!!this._commonGroupHandler&&this._commonGroupHandler.isPagingGetCompleted()}},{key:\"getGroupList\",value:function(e){return this._commonGroupHandler?this._commonGroupHandler.getGroupList(e):za()}},{key:\"getGroupProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getGroupProfile\"),o=new ka(\"getGroupProfile\"),s=e.groupID,a=e.groupCustomFieldFilter;xe.l(\"\".concat(n,\" groupID:\").concat(s));var r={groupIDList:[s],responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\",\"Introduction\",\"Notification\",\"FaceUrl\",\"Owner_Account\",\"CreateTime\",\"InfoSeq\",\"LastInfoTime\",\"LastMsgTime\",\"MemberNum\",\"MaxMemberNum\",\"ApplyJoinOption\",\"NextMsgSeq\",\"ShutUpAllMember\",\"InviteJoinOption\"],groupCustomFieldFilter:a,memberInfoFilter:[\"Role\",\"JoinTime\",\"MsgSeq\",\"MsgFlag\",\"NameCard\"]}};return this.getGroupProfileAdvance(r).then((function(e){var a,r=e.data,i=r.successGroupList,u=r.failureGroupList;if(xe.l(\"\".concat(n,\" ok\")),u.length>0)return Ja(u[0]);(Ct(i[0].type)&&!t.hasLocalGroup(s)?a=new dr(i[0]):(t.updateGroupMap(i),a=t.getLocalGroupProfile(s)),a.isSupportTopic)||t.getModule(Fn).updateConversationGroupProfile([a]);return o.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(s,\" type:\").concat(a.type,\" muteAllMembers:\").concat(a.muteAllMembers,\" ownerID:\").concat(a.ownerID)).end(),Ka({group:a})})).catch((function(s){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],r=n[1];o.setError(s,a,r).setMessage(\"groupID:\".concat(e.groupID)).end()})),xe.e(\"\".concat(n,\" failed. error:\"),s),Ja(s)}))}},{key:\"getGroupProfileAdvance\",value:function(e){var n=\"\".concat(this._n,\".getGroupProfileAdvance\"),o=e.groupIDList;st(o)&&o.length>50&&(this.outputWarning(\"GetGroupProfileLimit\"),o.length=50);var s=[],a=[];o.forEach((function(e){Tt({groupID:e})?a.push(e):s.push(e)}));var r=[];if(s.length>0){var i=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:s}));r.push(i)}if(a.length>0){var u=this._getGroupProfileAdvance(t(t({},e),{},{groupIDList:a,relayFlag:s.length>0}));r.push(u)}return Promise.all(r).then((function(e){var t=[],n=[];return e.forEach((function(e){t.push.apply(t,m(e.successGroupList)),n.push.apply(n,m(e.failureGroupList))})),Ka({successGroupList:t,failureGroupList:n})})).catch((function(e){return xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_getGroupProfileAdvance\",value:function(e){var t=this,n=e.relayFlag,o=void 0!==n&&n,s=g(e,br);return this.request({protocolName:Yo,requestData:s}).then((function(e){xe.l(\"\".concat(t._n,\"._getGroupProfileAdvance ok.\"));var n=e.data.groups;return{successGroupList:n.filter((function(e){return at(e.errorCode)||0===e.errorCode})),failureGroupList:n.filter((function(e){return e.errorCode&&0!==e.errorCode})).map((function(e){return new Wa({code:e.errorCode,message:e.errorInfo,data:{groupID:e.groupID}})}))}})).catch((function(t){return o&&Tt({groupID:e.groupIDList[0]})?{successGroupList:[],failureGroupList:[]}:Ja(t)}))}},{key:\"createGroup\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"createGroup\"),s=e.type,a=e.groupID;if(e.name&&!1===this._filterProfanity(\"name\",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Ja({code:da.PROFANITY_FOUND});if(![\"Public\",\"Private\",\"ChatRoom\",\"AVChatRoom\",\"Community\"].includes(s))return Ja({code:da.ILLEGAL_GROUP_TYPE});if(!Tt({type:s})){if(!jt(a)&&Tt({groupID:a}))return Ja({code:da.ILLEGAL_GROUP_ID});e.isSupportTopic=void 0}if(Ct(s)&&!at(e.memberList)&&e.memberList.length>0&&(e.memberList=void 0),this._canIUseJoinOption(s)||at(e.joinOption)||(e.joinOption=void 0),Tt({type:s})){if(!jt(a)&&!Tt({groupID:a}))return Ja({code:da.ILLEGAL_GROUP_ID});e.isSupportTopic=!0===e.isSupportTopic?1:0}var r=new ka(\"createGroup\");xe.l(\"\".concat(o,\" options:\"),e);var i=null,u=[];return this.request({protocolName:jo,requestData:t(t({},e),{},{ownerID:this.getMyUserID(),webPushFlag:1})}).then((function(s){var a=s.data,c=a.groupID,l=a.overLimitUserIDList,p=void 0===l?[]:l;if(i=c,u=p,r.setNetworkType(n.getNetworkType()).setMessage(\"groupType:\".concat(e.type,\" groupID:\").concat(c,\" overLimitUserIDList=\").concat(p)).end(),xe.l(\"\".concat(o,\" ok groupID:\").concat(c,\" overLimitUserIDList:\"),p),e.type===S.GRP_AVCHATROOM)return n.getGroupProfile({groupID:c});if(e.type===S.GRP_COMMUNITY&&1===e.isSupportTopic)return n.getGroupProfile({groupID:c});jt(e.memberList)||jt(p)||(e.memberList=e.memberList.filter((function(e){return-1===p.indexOf(e.userID)}))),n.updateGroupMap([t(t({},e),{},{groupID:c})]);var d=n.getModule(Rn),g=d.createCustomMessage({to:c,conversationType:S.CONV_GROUP,payload:{data:\"group_create\",extension:n.isIntl()?\"\".concat(n.getMyUserID(),\" created a group\"):\"\".concat(n.getMyUserID(),\"创建群组\")}});return d.sendMessageInstance(g),n.emitGroupListUpdate(),n.getGroupProfile({groupID:c})})).then((function(e){var t=e.data.group,n=t.selfInfo,o=n.nameCard,s=n.joinTime;return t.updateSelfInfo({nameCard:o,joinTime:s,messageRemindType:S.MSG_REMIND_ACPT_AND_NOTE,role:S.GRP_MBR_ROLE_OWNER}),Ka({group:t,overLimitUserIDList:u})})).catch((function(s){if(r.setMessage(\"groupType:\".concat(e.type)),n.probeNetwork().then((function(e){var t=v(e,2),n=t[0],o=t[1];r.setError(s,n,o).end()})),10010===s.code||10007===s.code){n.updateGroupMap([t(t({},e),{},{groupID:i})]);var a=n.getLocalGroupProfile(i);return xe.l(\"\".concat(o,\" success, but failed to get group profile.\")),Ka({group:a,overLimitUserIDList:u})}return xe.e(\"\".concat(o,\" failed. error:\"),s),Ja(s)}))}},{key:\"dismissGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"dismissGroup\");if(this.hasLocalGroup(e)&&this.getLocalGroupProfile(e).type===S.GRP_WORK)return Ja(new Wa({code:da.CANNOT_DISMISS_WORK}));var o=new ka(\"dismissGroup\");return o.setMessage(\"groupID:\".concat(e)),xe.l(\"\".concat(n,\" groupID:\").concat(e)),this.request({protocolName:zo,requestData:{groupID:e}}).then((function(){return o.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),t.deleteLocalGroupAndConversation(e),t.checkJoinedAVChatRoomByID(e)&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Ka({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"updateGroupProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"updateGroupProfile\");if(this.hasLocalGroup(e.groupID)){var o=this.getLocalGroupProfile(e.groupID).type;this._canIUseJoinOption(o)||at(e.joinOption)||(xe.w(\"\".concat(n,\" joinOption is unavailable for Work/Meeting/AVChatRoom\")),e.joinOption=void 0)}if(at(e.muteAllMembers)||(e.muteAllMembers?e.muteAllMembers=\"On\":e.muteAllMembers=\"Off\"),e.name&&!1===this._filterProfanity(\"name\",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Ja({code:da.PROFANITY_FOUND});var s=new ka(\"updateGroupProfile\");return s.setMessage(JSON.stringify(e)),xe.l(\"\".concat(n,\" groupID:\").concat(e.groupID)),this.request({protocolName:Jo,requestData:e}).then((function(){(s.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),t.hasLocalGroup(e.groupID))&&(t.groupMap.get(e.groupID).updateGroup(e),t._setStorageGroupList());return Ka({group:t.groupMap.get(e.groupID)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.l(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_filterProfanity\",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],z),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:\"joinGroup\",value:function(e){var t=this,n=e.groupID,o=e.type,s=\"\".concat(this._n,\".joinGroup\");if(o===S.GRP_WORK)return Ja({code:da.CANNOT_JOIN_WORK});if(this.deleteUnjoinedAVChatRoom(n),this.hasLocalGroup(n)){if(!this.isLoggedIn())return za({status:S.JOIN_STATUS_ALREADY_IN_GROUP});var a=new ka(\"applyJoinGroup\");return this.getGroupProfile({groupID:n}).then((function(){return a.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(n,\" joinedStatus:\").concat(S.JOIN_STATUS_ALREADY_IN_GROUP)).end(),za({status:S.JOIN_STATUS_ALREADY_IN_GROUP})})).catch((function(o){return a.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(n,\" unjoined\")).end(),xe.w(\"\".concat(s,\" \").concat(n,\" was unjoined, now join!\")),t.groupMap.delete(n),t.applyJoinGroup(e)}))}return xe.l(\"\".concat(s,\" groupID:\").concat(n)),this.isLoggedIn()?this.applyJoinGroup(e):this._AVChatRoomHandler.joinWithoutAuth(e)}},{key:\"applyJoinGroup\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"applyJoinGroup\"),s=e.groupID;if(!jt(e.applyMessage)&&!1===this._filterProfanity(\"applyMessage\",e))return Ja({code:da.PROFANITY_FOUND});var a=new ka(\"applyJoinGroup\"),r=t({},e),i=this.canIUse(B.AVCHATROOM_HISTORY_MSG);return i&&(r.historyMessageFlag=1),this.getModule(Fn).deleteTopicRoamingMessageInfo(s),this.request({protocolName:Xo,requestData:r}).then((function(e){var t=e.data,r=t.joinedStatus,u=t.longPollingKey,c=t.startSeq,l=t.avChatRoomFlag,p=t.avChatRoomKey,d=t.messageList,g=\"groupID:\".concat(s,\" joinedStatus:\").concat(r,\" longPollingKey:\").concat(u,\" startSeq:\").concat(c)+\" avChatRoomFlag:\".concat(l,\" canGetAVChatRoomHistoryMessage:\").concat(i,\",\")+\" history message count:\".concat(jt(d)?0:d.length);switch(a.setNetworkType(n.getNetworkType()).setMessage(\"\".concat(g)).end(),xe.l(\"\".concat(o,\" ok. \").concat(g)),r){case je:return Ka({status:je});case Ye:return n.getGroupProfile({groupID:s}).then((function(e){var t=e.data.group;return n._handleJoinResult({group:t,avChatRoomFlag:l,longPollingKey:u,startSeq:c,avChatRoomKey:p,messageList:d})})).catch((function(){var e=new dr({groupID:s});return n._handleJoinResult({group:e,avChatRoomFlag:l,longPollingKey:u,startSeq:c,avChatRoomKey:p,messageList:d})}));default:var _=new Wa({code:da.JOIN_GROUP_FAIL});return xe.e(\"\".concat(o,\" failed. error:\"),_),Ja(_)}})).catch((function(e){return a.setMessage(\"groupID:\".concat(s)),n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"_handleJoinResult\",value:function(e){var t,n=this,o=e.group,s=e.avChatRoomFlag,a=e.longPollingKey,r=e.startSeq,i=e.avChatRoomKey,u=e.messageList,c=o.groupID;return 1===s?(this.getModule(Fn).setCompleted(\"\".concat(S.CONV_GROUP).concat(c)),this._groupAttributesHandler.initGroupAttributesCache({groupID:c,avChatRoomKey:i}),this._groupCountersHandler.initGroupCountersCache({groupID:c,avChatRoomKey:i}),(t=at(a)?this._AVChatRoomHandler.handleJoinResult({group:o}):this._AVChatRoomHandler.startRunLoop({group:o,longPollingKey:a,startSeq:r})).then((function(){n._onAVChatRoomHistoryMessage(u)})),t):(this.emitGroupListUpdate(!0,!1),Ka({status:Ye,group:o}))}},{key:\"quitGroup\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"quitGroup\");xe.l(\"\".concat(n,\" groupID:\").concat(e));var o=this.checkJoinedAVChatRoomByID(e);if(!o&&!this.hasLocalGroup(e))return Ja({code:da.MEMBER_NOT_IN_GROUP});if(o&&!this.isLoggedIn())return xe.l(\"\".concat(n,\" anonymously ok. groupID:\").concat(e)),this.deleteLocalGroupAndConversation(e),this._AVChatRoomHandler.reset(e),za({groupID:e});var s=new ka(\"quitGroup\");return s.setMessage(\"groupID:\".concat(e)),this.request({protocolName:Zo,requestData:{groupID:e}}).then((function(){return s.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),t.deleteLocalGroupAndConversation(e),o&&t._AVChatRoomHandler.reset(e),t._groupAttributesHandler.deleteLocalGroupAttributes(e),Ka({groupID:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"searchGroupByID\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"searchGroupByID\"),o={groupIDList:[e]},s=new ka(\"searchGroupByID\");return s.setMessage(\"groupID:\".concat(e)),xe.l(\"\".concat(n,\" groupID:\").concat(e)),this.request({protocolName:$o,requestData:o}).then((function(e){var o=e.data.groupProfile;if(0!==o[0].errorCode)throw new Wa({code:o[0].errorCode,message:o[0].errorInfo});return s.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),Ka({group:new dr(o[0])})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.w(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"changeGroupOwner\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"changeGroupOwner\");if(this.hasLocalGroup(e.groupID)&&this.getLocalGroupProfile(e.groupID).type===S.GRP_AVCHATROOM)return Ja({code:da.CANNOT_CHANGE_OWNER_IN_AVCHATROOM});if(e.newOwnerID===this.getMyUserID())return Ja({code:da.CANNOT_CHANGE_OWNER_TO_SELF});var o=new ka(\"changeGroupOwner\");return o.setMessage(\"groupID:\".concat(e.groupID,\" newOwnerID:\").concat(e.newOwnerID)),xe.l(\"\".concat(n,\" groupID:\").concat(e.groupID)),this.request({protocolName:es,requestData:e}).then((function(){o.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var s=e.groupID,a=e.newOwnerID;t.groupMap.get(s).ownerID=a;var r=t.getModule(bn).getLocalGroupMemberList(s);if(r instanceof Map){var i=r.get(t.getMyUserID());at(i)||(i.updateRole(\"Member\"),t.groupMap.get(s).selfInfo.role=\"Member\");var u=r.get(a);at(u)||u.updateRole(\"Owner\")}return t.emitGroupListUpdate(!0,!1),Ka({group:t.groupMap.get(s)})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"getGroupApplicationList\",value:function(){return this._groupSystemNoticeHandler.getGroupApplicationList()}},{key:\"handleGroupApplication\",value:function(e){var t,n,o,s,a,r=this,i=\"\".concat(this._n,\".\").concat(\"handleGroupApplication\"),u=e.handleAction,c=e.handleMessage,l=e.message,p=e.application;l?(t=l.payload.operatorID,n=l.payload.groupProfile.groupID,o=l.payload.authentication,s=l.payload.messageKey):p&&(t=p.applicant,n=p.groupID,o=p.authentication,s=p.messageKey);var d=ts;p&&2===p.applicationType&&(d=ns,a=p.userID);var g=new ka(\"handleGroupApplication\");return g.setMessage(\"groupID:\".concat(n)),xe.l(\"\".concat(i,\" groupID:\").concat(n)),this.request({protocolName:d,requestData:{handleAction:u,handleMessage:c,applicant:t,invitee:a,groupID:n,authentication:o,messageKey:s}}).then((function(){return g.setNetworkType(r.getNetworkType()).end(),xe.l(\"\".concat(i,\" ok\")),l&&r._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Ka({group:r.getLocalGroupProfile(n)})})).catch((function(e){return r.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];g.setError(e,o,s).end()})),xe.e(\"\".concat(i,\" failed. error\"),e),Ja(e)}))}},{key:\"handleGroupInvitation\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"handleGroupInvitation\"),s=e.message.payload,a=s.groupProfile.groupID,r=s.authentication,i=s.messageKey,u=s.operatorID,c=e.handleAction,l=new ka(\"handleGroupInvitation\");return l.setMessage(\"groupID:\".concat(a,\" inviter:\").concat(u,\" handleAction:\").concat(c)),xe.l(\"\".concat(o,\" groupID:\").concat(a,\" inviter:\").concat(u,\" handleAction:\").concat(c)),this.request({protocolName:os,requestData:t(t({},e),{},{inviter:u,groupID:a,authentication:r,messageKey:i})}).then((function(){return l.setNetworkType(n.getNetworkType()).end(),xe.l(\"\".concat(o,\" ok\")),n._groupSystemNoticeHandler.deleteGroupSystemNotice({messageList:[e.message]}),Ka({group:n.getLocalGroupProfile(a)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error\"),e),Ja(e)}))}},{key:\"getGroupOnlineMemberCount\",value:function(e){return this._AVChatRoomHandler?this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)?this._AVChatRoomHandler.getGroupOnlineMemberCount(e):za({memberCount:0}):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"hasLocalGroup\",value:function(e){return this.groupMap.has(e)}},{key:\"deleteLocalGroupAndConversation\",value:function(e){var t=this.checkJoinedAVChatRoomByID(e);(xe.l(\"\".concat(this._n,\".deleteLocalGroupAndConversation isJoinedAVChatRoom:\").concat(t)),t)&&this.getModule(Fn).deleteLocalConversation(\"\".concat(S.CONV_GROUP).concat(e));if(Tt({groupID:e})){var n=this.getLocalGroupProfile(e);if(n&&!0===n.isSupportTopic)this.getModule(wn).deleteTopicListInCommunity(e)}this._deleteLocalGroup(e),this.emitGroupListUpdate(!0,!1)}},{key:\"_deleteLocalGroup\",value:function(e){this.groupMap.delete(e),this.getModule(bn).deleteGroupMemberList(e),this._setStorageGroupList()}},{key:\"sendMessage\",value:function(e,t){if(st(e._receiverList)&&e._receiverList.length>0&&!this.canIUse(B.MSG_TO_SPECIFIED_GRP_MBR))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=this.createGroupMessagePack(e,t);return this.request(n)}},{key:\"createGroupMessagePack\",value:function(e,t){var n=null;t&&t.offlinePushInfo&&(n=t.offlinePushInfo);var o=\"\";et(e.cloudCustomData)&&e.cloudCustomData.length>0&&(o=e.cloudCustomData);var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push(\"NoUnread\"),!0===i&&s.push(\"NoLastMsg\"),!0===u&&s.push(\"NoMsgCheck\")}var c=void 0;st(e._receiverList)&&e._receiverList.length>0&&(c=e._receiverList,e._receiverList.length>50&&(c=e._receiverList.slice(0,50),this.outputWarning(\"ReceiverListLimit\")));var l=this.isOnlineMessage(e,t)?1:0,p=e.getGroupAtInfoList(),d={fromAccount:this.getMyUserID(),groupID:e.to,msgBody:e.getElements(),cloudCustomData:o,random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:e.type!==S.MSG_TEXT||jt(p)?void 0:p,onlineOnlyFlag:l,clientTime:e.clientTime,offlinePushInfo:n?{pushFlag:!0===n.disablePush?1:0,title:n.title||\"\",desc:n.description||\"\",ext:n.extension||\"\",apnsInfo:{badgeMode:!0===n.ignoreIOSBadge?1:0,isVoipPush:this._isVoipPush(n)},androidInfo:{OPPOChannelID:n.androidOPPOChannelID||\"\"}}:void 0,messageControlInfo:0===l?s:void 0,needReadReceipt:!0!==e.needReadReceipt||this.isMessageFromOrToAVChatroom(e.to)?0:1,receiverList:c,isSupportExtension:!0===e.isSupportExtension?1:0};return Dt(e.to)&&(d.groupID=qt(e.to),d.topicID=e.to),{protocolName:ho,tjgID:this.generateTjgID(e),requestData:d}}},{key:\"_isVoipPush\",value:function(e){var t=void 0;return at(e.disableVoipPush)||(t=!1===e.disableVoipPush?1:0),t}},{key:\"revokeMessage\",value:function(e){var t={groupID:e.to,msgSeqList:[{msgSeq:e.sequence}]};return Dt(e.to)&&(t.groupID=qt(e.to),t.topicID=e.to),this.request({protocolName:ss,requestData:t})}},{key:\"deleteMessage\",value:function(e){var t=e.to,n=e.keyList;xe.l(\"\".concat(this._n,\".deleteMessage groupID:\").concat(t,\" count:\").concat(n.length));var o={groupID:t,deleter:this.getMyUserID(),keyList:n};return Dt(t)&&(o.groupID=qt(t),o.topicID=t),this.request({protocolName:vs,requestData:o})}},{key:\"modifyRemoteMessage\",value:function(e){var t=e.to,n=e.sequence,o=e.payload,s=e.type,a=e.version,r=void 0===a?0:a,i=e.cloudCustomData,u=t,c=void 0;Dt(t)&&(u=qt(t),c=t);var l=void 0;return Vt(s)&&(l=[]).push({type:s,content:o}),this.request({protocolName:ms,requestData:{groupID:u,topicID:c,sequence:n,version:r,elements:l,cloudCustomData:i}})}},{key:\"getRoamingMessage\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessage\"),o=e.conversationID,s=e.groupID,a=e.sequence,r=new ka(\"getGroupRoamingMessages\"),i=0,u=void 0;return Dt(s)&&(s=qt(u=s)),this._computeLastSequence({groupID:s,topicID:u,sequence:a}).then((function(e){return i=e,xe.l(\"\".concat(n,\" groupID:\").concat(s,\" startSequence:\").concat(i)),t.request({protocolName:is,requestData:{groupID:s,count:21,sequence:i,topicID:u}})})).then((function(e){var a=e.data,c=a.messageList,l=a.complete,p=a.invisibleSequenceList,d=void 0===p?[]:p;at(c)?xe.l(\"\".concat(n,\" ok. complete:\").concat(l,\" but messageList is undefined!\")):xe.l(\"\".concat(n,\" ok. complete:\").concat(l,\" count:\").concat(c.length));var g=t._getMinSequence(d,c)-1;r.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(s,\" topicID:\").concat(u,\" startSequence:\").concat(i,\" complete:\").concat(l,\" nextSequence:\").concat(g)).end();var _=t.getModule(Fn),h=[];return jt(c)||(_.updateRoamingMessageSequence(o,g),h=_.onRoamingMessage(c,o),_.updateIsRead(o),_.patchConversationLastMessage(o)),(2===l||g<=1)&&(_.setCompleted(o),g=\"\"),xe.l(\"\".concat(n,\" nextReqID:\").concat(g,\", stored message count:\").concat(h.length,\", invisible sequence count:\").concat(d.length)),{nextReqID:g+\"\",storedMessageList:h}})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];r.setError(e,o,a).setMessage(\"groupID:\".concat(s,\" topicID:\").concat(u,\" startSequence:\").concat(i)).end()})),xe.w(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_getGroupIDOfMessage\",value:function(e){return e.conversationID.replace(S.CONV_GROUP,\"\")}},{key:\"_getMinSequence\",value:function(e,t){var n=0;jt(t)||(n=t[t.length-1].sequence);var o=0;jt(e)||(o=e[e.length-1]);return xe.l(\"\".concat(this._n,\"._getMinSequence minVisibleSequence:\").concat(n,\" minInvisibleSequence:\").concat(o)),o>0&&o=100?100:a,_=\"groupID:\".concat(r,\" sequence:\").concat(u,\" cursor:\").concat(d,\" filter:\").concat(p,\" completeFlag:\").concat(l);xe.l(\"\".concat(c,\" \").concat(_));var h={cursor:\"\",isCompleted:!1,messageID:i,unreadUserIDList:[],readUserIDList:[]},f=new ka(\"getReadReceiptDetail\");return f.setMessage(_),this.request({protocolName:ps,requestData:{groupID:r,sequence:u,flag:p,cursor:d,count:g}}).then((function(e){f.end();var n=e.data,o=n.cursor,s=n.isCompleted,a=n.unreadUserIDList,r=n.readUserIDList;return h.cursor=o,1===s&&(h.isCompleted=!0,t._receiptDetailCompleteMap.set(i,!0)),0===p?h.readUserIDList=r.map((function(e){return e.userID})):1===p&&(h.unreadUserIDList=a.map((function(e){return e.userID}))),xe.l(\"\".concat(c,\" ok\")),Ka(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];f.setError(e,o,s).end()})),xe.w(\"\".concat(c,\" failed. error:\"),e),Ja(e)}))}},{key:\"getRoamingMessagesHopping\",value:function(e){var t=this,n=\"\".concat(this._n,\".getRoamingMessagesHopping\"),o=new ka(\"getGroupRoamingMessagesHopping\"),s=e.groupID,a=e.count,r=e.sequence,i=e.direction,u=r;1===i&&(u=r+a-1);var c=void 0;Dt(s)&&(s=qt(c=s));var l=\"\".concat(c?\"topicID:\".concat(c):\"groupID:\".concat(s),\" sequence:\").concat(r,\" direction:\").concat(i);return xe.l(\"\".concat(n,\" \").concat(l)),this.request({protocolName:is,requestData:{groupID:s,topicID:c,count:a,sequence:u}}).then((function(s){var a=s.data,u=a.messageList,c=a.complete,p=\"complete:\".concat(c,\" count:\").concat(u?u.length:0);if(xe.l(\"\".concat(n,\" ok. \").concat(p)),o.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(l,\" \").concat(p)).end(),2===c||jt(u)){var d=t._computeResult();return Ka(d)}var g=\"\".concat(S.CONV_GROUP).concat(e.groupID),_=t.getModule(Fn).onRoamingMessage(u,g,!1),h=t._computeResult({direction:i,sequence:r,remoteMessageList:u,processedMessageList:_});return Ka(h)})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),i=n[0],u=n[1];o.setError(e,i,u).setMessage(\"groupID:\".concat(s,\" sequence:\").concat(r,\" count:\").concat(a)).end()})),xe.w(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_computeResult\",value:function(e){var t={messageList:[],isCompleted:!1,nextMessageSeq:\"\"};if(at(e))return t.isCompleted=!0,t;var n=e.direction,o=e.sequence,s=e.remoteMessageList,a=void 0===s?[]:s,r=e.processedMessageList,i=void 0===r?[]:r,u=a.length;return 1===n?(t.nextMessageSeq=a[0].sequence+1,i.forEach((function(e){e.sequence>=o&&t.messageList.push(e)})),0===t.messageList.length&&a[0].sequence0?Promise.resolve(s):at(o)||this.hasLocalGroup(t)?at(o)?this.getGroupLastSequence(t):this.getTopicLastSequence({groupID:t,topicID:o}):Promise.resolve(0)}},{key:\"getGroupLastSequence\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getGroupLastSequence\"),o=new ka(\"getGroupLastSequence\"),s=0,a=\"\";if(this.hasLocalGroup(e)){var r=this.getLocalGroupProfile(e),i=r.lastMessage;if(i.lastSequence>0&&!1===i.onlineOnlyFlag)return s=i.lastSequence,a=\"got lastSequence:\".concat(s,\" from local group profile[lastMessage.lastSequence]. groupID:\").concat(e),xe.l(\"\".concat(n,\" \").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage(\"\".concat(a)).end(),Promise.resolve(s);if(r.nextMessageSeq>1)return s=r.nextMessageSeq-1,a=\"got lastSequence:\".concat(s,\" from local group profile[nextMessageSeq]. groupID:\").concat(e),xe.l(\"\".concat(n,\" \").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage(\"\".concat(a)).end(),Promise.resolve(s)}var u=\"GROUP\".concat(e),c=this.getModule(Fn).getLocalConversation(u);if(c&&c.lastMessage.lastSequence&&!1===c.lastMessage.onlineOnlyFlag)return s=c.lastMessage.lastSequence,a=\"got lastSequence:\".concat(s,\" from local conversation profile[lastMessage.lastSequence]. groupID:\").concat(e),xe.l(\"\".concat(n,\" \").concat(a)),o.setNetworkType(this.getNetworkType()).setMessage(\"\".concat(a)).end(),Promise.resolve(s);var l={groupIDList:[e],responseFilter:{groupBaseInfoFilter:[\"NextMsgSeq\"]}};return this.getGroupProfileAdvance(l).then((function(r){var i=r.data.successGroupList;return jt(i)?xe.l(\"\".concat(n,\" successGroupList is empty. groupID:\").concat(e)):(s=i[0].nextMessageSeq-1,a=\"got lastSequence:\".concat(s,\" from getGroupProfileAdvance. groupID:\").concat(e),xe.l(\"\".concat(n,\" \").concat(a))),o.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(a)).end(),s})).catch((function(s){return t.probeNetwork().then((function(t){var n=v(t,2),a=n[0],r=n[1];o.setError(s,a,r).setMessage(\"get lastSequence failed from getGroupProfileAdvance. groupID:\".concat(e)).end()})),xe.w(\"\".concat(n,\" failed. error:\"),s),Ja(s)}))}},{key:\"getTopicLastSequence\",value:function(e){var t=this,n=e.groupID,o=e.topicID,s=\"\".concat(this._n,\".\").concat(\"getTopicLastSequence\"),a=new ka(\"getTopicLastSequence\"),r=0,i=\"\",u=this.getModule(wn);return u.hasLocalTopic(n,o)?(r=u.getLocalTopic(n,o).nextMessageSeq-1,i=\"get lastSequence:\".concat(r,\" from local topic info[nextMessageSeq]. topicID:\").concat(o),xe.l(\"\".concat(s,\" \").concat(i)),a.setNetworkType(this.getNetworkType()).setMessage(\"\".concat(i)).end(),Promise.resolve(r)):u.getTopicList({groupID:n,topicIDList:[o]}).then((function(e){var n=e.data.successTopicList;return jt(n)?xe.l(\"\".concat(s,\" successTopicList is empty. topicID:\").concat(o)):(r=n[0].nextMessageSeq-1,i=\"get lastSequence:\".concat(r,\" from getTopicList. topicID:\").concat(o),xe.l(\"\".concat(s,\" \").concat(i))),a.setNetworkType(t.getNetworkType()).setMessage(\"\".concat(i)).end(),r})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),s=n[0],r=n[1];a.setError(e,s,r).setMessage(\"get lastSequence failed from getTopicList. topicID:\".concat(o)).end()})),xe.w(\"\".concat(s,\" failed. error:\"),e),Ja(e)}))}},{key:\"isMessageFromOrToAVChatroom\",value:function(e){return!!this._AVChatRoomHandler&&this._AVChatRoomHandler.checkJoinedAVChatRoomByID(e)}},{key:\"hasJoinedAVChatRoom\",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.hasJoinedAVChatRoom():0}},{key:\"getJoinedAVChatRoom\",value:function(){return this._AVChatRoomHandler?this._AVChatRoomHandler.getJoinedAVChatRoom():[]}},{key:\"isOnlineMessage\",value:function(e,t){return!(!this._canIUseOnlineOnlyFlag(e)||!t||!0!==t.onlineUserOnly)}},{key:\"_canIUseOnlineOnlyFlag\",value:function(e){var t=this.getJoinedAVChatRoom();return!t||!t.includes(e.to)||e.conversationType!==S.CONV_GROUP}},{key:\"_onAVChatRoomHistoryMessage\",value:function(e){if(!jt(e)){xe.l(\"\".concat(this._n,\"._onAVChatRoomHistoryMessage count:\").concat(e.length));var n=[];e.forEach((function(e){n.push(t(t({},e),{},{isHistoryMessage:1}))})),this.onAVChatRoomMessage(n)}}},{key:\"onAVChatRoomMessage\",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onMessage(e)}},{key:\"onAVChatRoomMemberBanned\",value:function(e){this._AVChatRoomHandler&&this._AVChatRoomHandler.onAVChatRoomMemberBanned(e)}},{key:\"getGroupSimplifiedInfo\",value:function(e){var t=this,n=new ka(\"getGroupSimplifiedInfo\"),o={groupIDList:[e],responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\"]}};return this.getGroupProfileAdvance(o).then((function(o){var s=o.data.successGroupList;return n.setNetworkType(t.getNetworkType()).setMessage(\"groupID:\".concat(e,\" type:\").concat(s[0].type)).end(),s[0]})).catch((function(o){t.probeNetwork().then((function(t){var s=v(t,2),a=s[0],r=s[1];n.setError(o,a,r).setMessage(\"groupID:\".concat(e)).end()}))}))}},{key:\"setUnjoinedAVChatRoom\",value:function(e){this._unjoinedAVChatRoomList.set(e,1)}},{key:\"deleteUnjoinedAVChatRoom\",value:function(e){this._unjoinedAVChatRoomList.has(e)&&this._unjoinedAVChatRoomList.delete(e)}},{key:\"isUnjoinedAVChatRoom\",value:function(e){return this._unjoinedAVChatRoomList.has(e)}},{key:\"isGroupAttributesUpdatedNotice\",value:function(e){return this._groupAttributesHandler.isGroupAttributesUpdatedNotice(e)}},{key:\"updateLocalMainSequenceOnReconnected\",value:function(){this._groupAttributesHandler.updateLocalMainSequenceOnReconnected()}},{key:\"initGroupAttributes\",value:function(e){return this._groupAttributesHandler.initGroupAttributes(e)}},{key:\"setGroupAttributes\",value:function(e){return this._groupAttributesHandler.setGroupAttributes(e)}},{key:\"deleteGroupAttributes\",value:function(e){return this._groupAttributesHandler.deleteGroupAttributes(e)}},{key:\"getGroupAttributes\",value:function(e){return this._groupAttributesHandler.getGroupAttributes(e)}},{key:\"isMessageFromTopic\",value:function(e,t){return 2===e&&!jt(t)}},{key:\"isMessageFromCommunityOfTopic\",value:function(e,t){return 2===e&&jt(t)}},{key:\"getMessageExtensions\",value:function(e,t){return xe.l(\"\".concat(this._n,\".getMessageExtensions startSequence:\").concat(t)),this.request({protocolName:Es,requestData:{groupID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:\"modifyMessageExtensions\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return xe.l(\"\".concat(this._n,\".modifyMessageExtensions operateType:\").concat(n)),this.request({protocolName:Ds,requestData:{groupID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:\"getGroupNotify\",value:function(e){var n=this;if(this.hasLocalGroup(e)){var o=this.getLocalGroupProfile(e),s=o.type,a=o.isSupportTopic;if(!Ct(s)&&!a){var r=\"\".concat(this._n,\".getGroupNotify\"),i=this._getGroupLastRevokedTime(e),u=1e3*Ue();xe.l(\"\".concat(r,\" groupID:\").concat(e,\" type:\").concat(s,\" beginTime:\").concat(i,\" endTime:\").concat(u)),this.request({protocolName:Ss,requestData:{type:Tt({type:s,groupID:e})?S.GRP_COMMUNITY:void 0,groupID:e,beginTime:i,endTime:u}}).then((function(o){var s=o.data,a=s.nextRevokedTime,i=s.notifyList;xe.l(\"\".concat(r,\" ok. groupID:\").concat(e,\" nextRevokedTime:\").concat(a));var u={dataList:[{elements:{revokedInfos:[]}}]};st(i)&&i.forEach((function(n){u.dataList[0].elements.revokedInfos.push({groupID:e,sequence:n.sequence,random:n.random,revokerInfo:t({},n.revokerInfo)})})),n.onGroupMessageRevoked(u),0!==a?(n._setGroupLastRevokedTime(e,a),n.getGroupNotify(e)):n._setGroupLastRevokedTime(e,1e3*Ue())})).catch((function(e){xe.e(\"\".concat(r,\" failed. error:\"),e)}))}}}},{key:\"_getGroupLastRevokedTime\",value:function(e){return this.hasLocalGroup(e)?this.getLocalGroupProfile(e)._lastRevokedTime:0}},{key:\"_setGroupLastRevokedTime\",value:function(e,t){this.hasLocalGroup(e)&&(this.getLocalGroupProfile(e)._lastRevokedTime=t)}},{key:\"isGroupCountersNotice\",value:function(e){return this._groupCountersHandler.isGroupCountersNotice(e)}},{key:\"setGroupCounters\",value:function(e){return this._groupCountersHandler.setGroupCounters(e)}},{key:\"increaseGroupCounter\",value:function(e){return this._groupCountersHandler.increaseGroupCounter(e)}},{key:\"decreaseGroupCounter\",value:function(e){return this._groupCountersHandler.decreaseGroupCounter(e)}},{key:\"getGroupCounters\",value:function(e){return this._groupCountersHandler.getGroupCounters(e)}},{key:\"restartPolling\",value:function(){this._AVChatRoomHandler&&this._AVChatRoomHandler.restartPolling()}},{key:\"getPollingTimerID\",value:function(e){if(!e)return-1;var t=this.getLocalGroupProfile(e);return t&&Ct(t.type)?this._AVChatRoomHandler.getPollingTimerID(e):-1}},{key:\"_canIUseJoinOption\",value:function(e){return function(e){return e===S.GRP_PUBLIC}(e)||Tt({type:e})}},{key:\"reset\",value:function(){this.groupMap.clear(),this._unjoinedAVChatRoomList.clear(),this._receiptDetailCompleteMap.clear(),this._commonGroupHandler.reset(),this._groupSystemNoticeHandler.reset(),this._groupTipsHandler.reset(),this._groupAttributesHandler.reset(),this._groupCountersHandler.reset(),this._AVChatRoomHandler&&this._AVChatRoomHandler.reset()}}]),s}(ro),Fr=function(){function e(t){o(this,e),this.userID=\"\",this.avatar=\"\",this.nick=\"\",this.role=\"\",this.joinTime=\"\",this.lastSendMsgTime=\"\",this.nameCard=\"\",this.muteUntil=0,this.memberCustomField=[],this._initMember(t)}return a(e,[{key:\"_initMember\",value:function(e){this.updateMember(e)}},{key:\"updateMember\",value:function(e){var t=[null,void 0,\"\",0,NaN];e.memberCustomField&&It(this.memberCustomField,e.memberCustomField),pt(this,e,[\"memberCustomField\",\"marks\"],t)}},{key:\"updateRole\",value:function(e){[\"Owner\",\"Admin\",\"Member\"].indexOf(e)<0||(this.role=e)}},{key:\"updateMuteUntil\",value:function(e){at(e)||(this.muteUntil=Math.floor((Date.now()+1e3*e)/1e3))}},{key:\"updateNameCard\",value:function(e){at(e)||(this.nameCard=e)}},{key:\"updateMemberCustomField\",value:function(e){e&&It(this.memberCustomField,e)}}]),e}(),qr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n=\"GroupMemberModule\",t.groupMemberListMap=new Map,t.getInnerEmitterInstance().on(er,t._onProfileUpdated,_(t)),t}return a(s,[{key:\"_onProfileUpdated\",value:function(e){for(var t=this,n=e.data,o=function(e){var o=n[e];t.groupMemberListMap.forEach((function(e){e.has(o.userID)&&e.get(o.userID).updateMember({nick:o.nick,avatar:o.avatar})}))},s=0;s100?100:r};Tt({groupID:n})?_.next=\"\".concat(s):(_.offset=s,g=s+r);var h=[];return this.request({protocolName:As,requestData:_}).then((function(e){var o=e.data,s=o.members,a=o.memberNum,r=o.next,i=void 0===r?void 0:r;if(at(i)||(g=jt(i)?0:i),!st(s)||0===s.length)return g=0,Promise.resolve([]);var u=t.getModule(Un);return u.hasLocalGroup(n)&&(u.getLocalGroupProfile(n).memberNum=a),h=t._updateLocalGroupMemberMap(n,s),t.getModule(On).getUserProfile({userIDList:s.map((function(e){return e.userID})),tagList:[Be.NICK,Be.AVATAR]})})).then((function(e){var o=e.data;if(!st(o)||0===o.length)return za({memberList:[],offset:g});var a=o.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));return t._updateLocalGroupMemberMap(n,a),h.length5?\"userIDList.length:\".concat(e.userIDList.length):\"userIDList:\".concat(e.userIDList)),xe.l(\"\".concat(o,\" groupID:\").concat(e.groupID,\" userIDList:\").concat(e.userIDList.join(\",\"))),e.userIDList.length>50&&(e.userIDList=e.userIDList.slice(0,50));var a=e.groupID,r=e.userIDList;return this._getGroupMemberProfileAdvance(t(t({},e),{},{userIDList:r})).then((function(e){var t=e.data.members;return st(t)&&0!==t.length?(n._updateLocalGroupMemberMap(a,t),n.getModule(On).getUserProfile({userIDList:t.map((function(e){return e.userID})),tagList:[Be.NICK,Be.AVATAR]})):za([])})).then((function(e){var t=e.data.map((function(e){return{userID:e.userID,nick:e.nick,avatar:e.avatar}}));n._updateLocalGroupMemberMap(a,t);var o=r.filter((function(e){return n.hasLocalGroupMember(a,e)})).map((function(e){return n.getLocalGroupMemberInfo(a,e)}));return s.setNetworkType(n.getNetworkType()).end(),Ka({memberList:o})}))}},{key:\"addGroupMember\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"addGroupMember\"),o=e.groupID,s=this.getModule(Un).getLocalGroupProfile(o),a=s.type,r=new ka(\"addGroupMember\");if(r.setMessage(\"groupID:\".concat(o,\" groupType:\").concat(a)),Ct(a)){var i=new Wa({code:da.CANNOT_ADD_MEMBER_IN_AVCHATROOM});return r.setError(i,!0,this.getNetworkType()).end(),Ja(i)}return e.userIDList=e.userIDList.map((function(e){return{userID:e}})),xe.l(\"\".concat(n,\" groupID:\").concat(o)),this.request({protocolName:Os,requestData:e}).then((function(o){var a=o.data.members;xe.l(\"\".concat(n,\" ok\"));var i=a.filter((function(e){return 1===e.result})).map((function(e){return e.userID})),u=a.filter((function(e){return 0===e.result})).map((function(e){return e.userID})),c=a.filter((function(e){return 2===e.result})).map((function(e){return e.userID})),l=a.filter((function(e){return 4===e.result})).map((function(e){return e.userID})),p=\"groupID:\".concat(e.groupID,\", \")+\"successUserIDList:\".concat(i,\", \")+\"failureUserIDList:\".concat(u,\", \")+\"existedUserIDList:\".concat(c,\", \")+\"overLimitUserIDList:\".concat(l);return r.setNetworkType(t.getNetworkType()).setMoreMessage(p).end(),0===i.length?Ka({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l}):(s.memberCount+=i.length,t._updateConversationGroupProfile(s),Ka({successUserIDList:i,failureUserIDList:u,existedUserIDList:c,overLimitUserIDList:l,group:s}))})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"deleteGroupMember\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteGroupMember\"),o=e.groupID,s=e.userIDList,a=this.getModule(Un).getLocalGroupProfile(o);if(at(a))return Ja({code:da.CANNOT_FIND_GROUP});if(Ct(a.type))return this.canIUse(B.AVCHATROOM_BAN_MBR)?this._banAVChatRoomMember(e):Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var r=new ka(\"deleteGroupMember\"),i=\"groupID:\".concat(o,\" \").concat(s.length>5?\"userIDList.length:\".concat(s.length):\"userIDList:\".concat(s));return r.setMessage(i),xe.l(\"\".concat(n,\" groupID:\").concat(o,\" userIDList:\"),s),this.request({protocolName:Gs,requestData:e}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),a.memberCount-=1,t._updateConversationGroupProfile(a),t.deleteLocalGroupMembers(o,s),Ka({group:a,userIDList:s})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_updateConversationGroupProfile\",value:function(e){this.getModule(Fn).updateConversationGroupProfile([e])}},{key:\"_banAVChatRoomMember\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteGroupMember\"),o=e.groupID,s=e.userIDList,a=\"groupID:\".concat(o,\" \").concat(s.length>5?\"userIDList.length:\".concat(s.length):\"userIDList:\".concat(s)),r=new ka(\"deleteGroupMember\");r.setMessage(a),xe.l(\"\".concat(n,\" groupID:\").concat(o,\" userIDList:\"),s);var i=this.getModule(Un).getLocalGroupProfile(o);return at(e.duration)||0===e.duration?Ja({code:da.BAN_DURATION_INVALID}):this.request({protocolName:Us,requestData:e}).then((function(){return r.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),t.deleteLocalGroupMembers(o,s),Ka({group:i,userIDList:s})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"setGroupMemberMuteTime\",value:function(e){var t=this,n=e.groupID,o=e.userID,s=e.muteTime,a=\"\".concat(this._n,\".\").concat(\"setGroupMemberMuteTime\");if(o===this.getMyUserID())return Ja(new Wa({code:da.CANNOT_MUTE_SELF}));xe.l(\"\".concat(a,\" groupID:\").concat(n,\" userID:\").concat(o));var r=new ka(\"setGroupMemberMuteTime\");return r.setMessage(\"groupID:\".concat(n,\" userID:\").concat(o,\" muteTime:\").concat(s)),this.modifyGroupMemberInfo({groupID:n,userID:o,muteTime:s}).then((function(e){r.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(a,\" ok\"));var o=t.getModule(Un);return Ka({group:o.getLocalGroupProfile(n),member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(a,\" failed. error:\"),e),Ja(e)}))}},{key:\"setGroupMemberRole\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setGroupMemberRole\"),o=e.groupID,s=e.userID,a=e.role,r=this.getModule(Un).getLocalGroupProfile(o);if(r.selfInfo.role!==S.GRP_MBR_ROLE_OWNER)return Ja({code:da.NOT_OWNER});if([S.GRP_WORK,S.GRP_AVCHATROOM].includes(r.type))return Ja({code:da.CANNOT_SET_MEMBER_ROLE_IN_WORK_AND_AVCHATROOM});var i=[S.GRP_MBR_ROLE_ADMIN,S.GRP_MBR_ROLE_MEMBER];if(Tt({groupID:o})&&i.push(S.GRP_MBR_ROLE_CUSTOM),i.indexOf(a)<0)return Ja({code:da.INVALID_MEMBER_ROLE});if(s===this.getMyUserID())return Ja({code:da.CANNOT_SET_SELF_MEMBER_ROLE});var u=new ka(\"setGroupMemberRole\");return u.setMessage(\"groupID:\".concat(o,\" userID:\").concat(s,\" role:\").concat(a)),xe.l(\"\".concat(n,\" groupID:\").concat(o,\" userID:\").concat(s)),this.modifyGroupMemberInfo({groupID:o,userID:s,role:a}).then((function(e){return u.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\")),Ka({group:r,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_filterProfanity\",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],J),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:\"setGroupMemberNameCard\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setGroupMemberNameCard\");if(e.nameCard&&!1===this._filterProfanity(\"nameCard\",e))return Ja({code:da.PROFANITY_FOUND});var o=e.groupID,s=e.userID,a=void 0===s?this.getMyUserID():s,r=e.nameCard;xe.l(\"\".concat(n,\" groupID:\").concat(o,\" userID:\").concat(a));var i=new ka(\"setGroupMemberNameCard\");return i.setMessage(\"groupID:\".concat(o,\" userID:\").concat(a,\" nameCard:\").concat(r)),this.modifyGroupMemberInfo({groupID:o,userID:a,nameCard:r}).then((function(e){xe.l(\"\".concat(n,\" ok\")),i.setNetworkType(t.getNetworkType()).end();var s=t.getModule(Un).getLocalGroupProfile(o);return a===t.getMyUserID()&&s&&s.setSelfNameCard(r),Ka({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"setGroupMemberCustomField\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"setGroupMemberCustomField\"),o=e.groupID,s=e.userID,a=void 0===s?this.getMyUserID():s,r=e.memberCustomField;xe.l(\"\".concat(n,\" groupID:\").concat(o,\" userID:\").concat(a));var i=new ka(\"setGroupMemberCustomField\");return i.setMessage(\"groupID:\".concat(o,\" userID:\").concat(a,\" memberCustomField:\").concat(JSON.stringify(r))),this.modifyGroupMemberInfo({groupID:o,userID:a,memberCustomField:r}).then((function(e){i.setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(n,\" ok\"));var s=t.getModule(Un).getLocalGroupProfile(o);return Ka({group:s,member:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];i.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"modifyGroupMemberInfo\",value:function(e){var n=this,o=e.groupID,s=e.userID,a=void 0;return Dt(o)&&(o=qt(a=o)),this.request({protocolName:Ps,requestData:t(t({},e),{},{groupID:o,topicID:a})}).then((function(){if(n.hasLocalGroupMember(o,s)){var t=n.getLocalGroupMemberInfo(o,s);return at(e.muteTime)||t.updateMuteUntil(e.muteTime),at(e.role)||t.updateRole(e.role),at(e.nameCard)||t.updateNameCard(e.nameCard),at(e.memberCustomField)||t.updateMemberCustomField(e.memberCustomField),t}return n.getGroupMemberProfile({groupID:o,userIDList:[s]}).then((function(e){return v(e.data.memberList,1)[0]}))}))}},{key:\"markGroupMemberList\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"markGroupMemberList\"),o=e.groupID,s=e.markType,a=e.enableMark,r=e.userIDList,i=void 0===r?[]:r,u=\"groupID:\".concat(o,\" markType:\").concat(s,\" enableMark:\").concat(a,\" userIDList count: \").concat(i.length);xe.l(\"\".concat(n,\" \").concat(u));var c=2,l=[];!0===a&&(c=1);var p=m(i);i.length>500&&(p=i.slice(0,500),xe.w(\"\".concat(n,\" \").concat(Kt(500)))),p.forEach((function(e){l.push({userID:e,markType:[s]})})),p=null;var d=new ka(\"markGroupMemberList\");return d.setMessage(\"\".concat(u)),this.request({protocolName:bs,requestData:{groupID:o,operationType:c,memberList:l}}).then((function(e){var o=e.data.memberList,s=void 0===o?[]:o,a=[],r=[];s.length===i.length?a.push.apply(a,m(i)):(s.forEach((function(e){a.push(e.userID)})),i.forEach((function(e){a.includes(e)||r.push(e)})));var u=\"success count:\".concat(a.length,\" fail count:\").concat(r.length);return d.setNetworkType(t.getNetworkType()).setMessage(u).end(),xe.l(\"\".concat(n,\" ok. \").concat(u)),Ka({successUserIDList:a,failureUserIDList:r})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];d.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_getGroupMemberProfileAdvance\",value:function(e){return this.request({protocolName:Ns,requestData:t(t({},e),{},{memberInfoFilter:e.memberInfoFilter?e.memberInfoFilter:[\"Role\",\"JoinTime\",\"NameCard\",\"ShutUpUntil\"]})})}},{key:\"_updateLocalGroupMemberMap\",value:function(e,t){var n=this;return st(t)&&0!==t.length?t.map((function(t){return n.hasLocalGroupMember(e,t.userID)?n.getLocalGroupMemberInfo(e,t.userID).updateMember(t):n.setLocalGroupMember(e,new Fr(t)),n.getLocalGroupMemberInfo(e,t.userID)})):[]}},{key:\"deleteLocalGroupMembers\",value:function(e,t){var n=this.groupMemberListMap.get(e);n&&t.forEach((function(e){n.delete(e)}))}},{key:\"getLocalGroupMemberInfo\",value:function(e,t){return this.groupMemberListMap.has(e)?this.groupMemberListMap.get(e).get(t):null}},{key:\"setLocalGroupMember\",value:function(e,t){if(this.groupMemberListMap.has(e))this.groupMemberListMap.get(e).set(t.userID,t);else{var n=(new Map).set(t.userID,t);this.groupMemberListMap.set(e,n)}}},{key:\"getLocalGroupMemberList\",value:function(e){return this.groupMemberListMap.get(e)}},{key:\"hasLocalGroupMember\",value:function(e,t){return this.groupMemberListMap.has(e)&&this.groupMemberListMap.get(e).has(t)}},{key:\"hasLocalGroupMemberMap\",value:function(e){return this.groupMemberListMap.has(e)}},{key:\"reset\",value:function(){this.groupMemberListMap.clear()}}]),s}(ro),xr=[\"topicID\",\"topicName\",\"avatar\",\"introduction\",\"notification\",\"unreadCount\",\"muteAllMembers\",\"customData\",\"groupAtInfoList\",\"nextMessageSeq\",\"selfInfo\"],Vr=function(e,t){return jt(e)?{lastTime:0,lastSequence:0,fromAccount:\"\",payload:null,type:\"\",messageForShow:\"\",nick:\"\",version:0,cloudCustomData:\"\",isRevoked:!1,revoker:null}:{lastTime:e.time||0,lastSequence:e.sequence||0,fromAccount:e.from||\"\",payload:e.payload||null,type:e.type||\"\",messageForShow:xt(e.type,e.payload,t),nick:e.nick||\"\",version:e.version||0,cloudCustomData:e.cloudCustomData||\"\",isRevoked:e.isRevoked||!1,revoker:e.revoker||null}},Br=function(){function e(t,n){o(this,e),this.topicID=\"\",this.topicName=\"\",this.avatar=\"\",this.introduction=\"\",this.notification=\"\",this.unreadCount=0,this.muteAllMembers=!1,this.customData=\"\",this.groupAtInfoList=[],this.nextMessageSeq=0,this.lastMessage=Vr(t.lastMessage,n),this.selfInfo={muteTime:0,readedSequence:0,messageRemindType:\"\",excludedUnreadSequenceList:void 0},this._initTopic(t)}return a(e,[{key:\"_initTopic\",value:function(e){for(var t in e)xr.indexOf(t)<0||(\"selfInfo\"===t?this.updateSelfInfo(e[t]):this[t]=\"muteAllMembers\"===t?1===e[t]:e[t])}},{key:\"updateUnreadCount\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.unreadCount=e}},{key:\"updateNextMessageSeq\",value:function(e){this.nextMessageSeq=e}},{key:\"updateLastMessage\",value:function(e){this.lastMessage=Vr(e)}},{key:\"updateGroupAtInfoList\",value:function(e){this.groupAtInfoList=JSON.parse(JSON.stringify(e))}},{key:\"updateTopic\",value:function(e){at(e.selfInfo)||this.updateSelfInfo(e.selfInfo),at(e.muteAllMembers)||(this.muteAllMembers=1===e.muteAllMembers),pt(this,e,[\"groupID\",\"lastMessageTime\",\"selfInfo\",\"muteAllMembers\",\"lastMsg\"])}},{key:\"updateSelfInfo\",value:function(e){return 0!==pt(this.selfInfo,e,[],[\"\"])}},{key:\"reduceUnreadCount\",value:function(){return this.unreadCount>=1&&(this.unreadCount-=1,!0)}},{key:\"isLastMessageRevoked\",value:function(e){return e.sequence===this.lastMessage.lastSequence}},{key:\"setLastMessageRevoked\",value:function(e){this.lastMessage.isRevoked=e}},{key:\"setLastMessageRevoker\",value:function(e){this.lastMessage.revoker=e}}]),e}(),Hr=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n=\"TopicModule\",t._topicMap=new Map,t._getTopicTimeMap=new Map,t.TOPIC_CACHE_TIME=300,t.TOPIC_LAST_ACTIVE_TIME=3600,t.getInnerEmitterInstance().on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"topic_cache_time\"),t=this.getCloudConfig(\"topic_last_active_time\");at(e)||(this.TOPIC_CACHE_TIME=Number(e)),at(t)||(this.TOPIC_LAST_ACTIVE_TIME=Number(t))}},{key:\"onTopicCreated\",value:function(e){var t=e.groupID;this.resetGetTopicTime(t),this.emitOuterEvent(E.TOPIC_CREATED,e)}},{key:\"onTopicDeleted\",value:function(e){var t=this,n=e.groupID,o=e.topicIDList;(void 0===o?[]:o).forEach((function(e){t._deleteLocalTopic(n,e)})),this.emitOuterEvent(E.TOPIC_DELETED,e)}},{key:\"onTopicMessageRemindTypeUpdated\",value:function(e){var t=e.groupID,n=e.topicID,o=e.messageRemindType,s=this.getLocalTopic(t,n);if(s){var a=s.updateSelfInfo({messageRemindType:o});a&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:s}),xe.d(\"\".concat(this._n,\".onTopicMessageRemindTypeUpdated topicID:\").concat(n)+\" messageRemindType:\".concat(o,\" isTopicUpdated:\").concat(a))}}},{key:\"onTopicProfileUpdated\",value:function(e){var t=e.groupID,n=e.topicID,o=this.getLocalTopic(t,n);o&&(o.updateTopic(e),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:o}))}},{key:\"onConversationProxy\",value:function(e){var t=e.topicID,n=e.unreadCount,o=e.groupAtInfoList,s=qt(t),a=this.getLocalTopic(s,t),r=!1;a&&(at(n)||a.unreadCount===n||(a.updateUnreadCount(n),r=!0),at(o)||(a.updateGroupAtInfoList(o),r=!0)),r&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:s,topic:a})}},{key:\"onMessageSent\",value:function(e){var t=e.groupID,n=e.topicID,o=e.lastMessage,s=this.getLocalTopic(t,n);s&&(s.nextMessageSeq+=1,s.updateLastMessage(o),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:t,topic:s}))}},{key:\"onMessageModified\",value:function(e){var t=e.to,n=e.time,o=e.sequence,s=e.elements,a=e.cloudCustomData,r=e.messageVersion,i=qt(t),u=this.getLocalTopic(i,t);if(u){var c=u.lastMessage;xe.d(\"\".concat(this._n,\".onMessageModified topicID:\").concat(t,\" lastMessage:\"),JSON.stringify(c),\"options:\",JSON.stringify(e)),c&&(null===c.payload||c.lastTime===n&&c.lastSequence===o&&c.version!==r)&&(c.type=s[0].type,c.payload=s[0].content,c.messageForShow=xt(c.type,c.payload,this.isIntl()),c.cloudCustomData=a,c.version=r,c.lastSequence=o,c.lastTime=n,this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:i,topic:u}))}}},{key:\"onMessageRevoked\",value:function(e){var t=this;if(0!==e.length){var n=null,o=null,s=!1;e.forEach((function(e){var a=e.to;o=qt(a),(n=t.getLocalTopic(o,a))&&(n.reduceUnreadCount()&&(s=!0),n.isLastMessageRevoked(e)&&(n.setLastMessageRevoked(!0),n.setLastMessageRevoker(e.revoker),s=!0))})),s&&this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:o,topic:n})}}},{key:\"isLastMessageRevoked\",value:function(e){var t=e.topicID,n=e.sequence,o=qt(t),s=this.getLocalTopic(o,t),a=!1;return s&&(a=s.isLastMessageRevoked({sequence:n})),a}},{key:\"getJoinedCommunityList\",value:function(){return this.getModule(Un).getGroupList({isGroupWithTopicOnly:!0}).then((function(e){var t=e.data.groupList;return Ka({groupList:void 0===t?[]:t})})).catch((function(e){return Ja(e)}))}},{key:\"createTopicInCommunity\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"createTopicInCommunity\"),s=e.topicID;if(!at(s)&&!Dt(s))return Ja({code:da.ILLEGAL_TOPIC_ID});if(e.topicName&&!1===this._filterProfanity(\"topicName\",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Ja({code:da.PROFANITY_FOUND});var a=new ka(\"createTopicInCommunity\");return this.request({protocolName:$s,requestData:t({},e)}).then((function(s){var r=s.data.topicID;return a.setMessage(\"topicID:\".concat(r)).setNetworkType(n.getNetworkType()).end(),xe.l(\"\".concat(o,\" ok\")),n._updateTopicMap([t(t({},e),{},{topicID:r})]),Ka({topicID:r})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];a.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"deleteTopicFromCommunity\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"deleteTopicFromCommunity\"),o=e.groupID,s=e.topicIDList,a=void 0===s?[]:s,r=new ka(\"deleteTopicFromCommunity\");return r.setMessage(\"groupID:\".concat(o,\" topicIDList:\").concat(a)),this.request({protocolName:ea,requestData:{groupID:o,topicIDList:a}}).then((function(e){var n=e.data.resultList,s=[],a=[];(void 0===n?[]:n).forEach((function(e){var t=e.topicID,n=e.errorCode,o=e.errorInfo;0===n?s.push({topicID:t}):a.push({topicID:t,code:n,message:o})}));var i=\"success count:\".concat(s.length,\", fail count:\").concat(a.length);return r.setMoreMessage(\"\".concat(i)).setNetworkType(t.getNetworkType()).end(),xe.l(\"\".concat(i)),s.forEach((function(e){t._deleteLocalTopic(o,e.topicID)})),Ka({successTopicList:s,failureTopicList:a})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"updateTopicProfile\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"updateTopicProfile\");if(xe.l(\"\".concat(o,\" options:\"),e),e.topicName&&!1===this._filterProfanity(\"topicName\",e))return Ja({code:da.PROFANITY_FOUND});if(e.introduction&&!1===this._filterProfanity(\"introduction\",e))return Ja({code:da.PROFANITY_FOUND});if(e.notification&&!1===this._filterProfanity(\"notification\",e))return Ja({code:da.PROFANITY_FOUND});var s=new ka(\"updateTopicProfile\");return s.setMessage(\"groupID:\".concat(e.groupID,\" topicID:\").concat(e.topicID)),at(e.muteAllMembers)||(e.muteAllMembers=!0===e.muteAllMembers?\"On\":\"Off\"),this.request({protocolName:ta,requestData:t({},e)}).then((function(){return s.setNetworkType(n.getNetworkType()).end(),xe.l(\"\".concat(o,\" ok\")),n._updateTopicMap([e]),Ka({topic:n.getLocalTopic(e.groupID,e.topicID)})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];s.setError(e,o,a).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"getTopicList\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"getTopicList\"),s=e.groupID,a=e.topicIDList,r=void 0===a?[]:a,i=0===r.length,u=new ka(\"getTopicList\");if(u.setMessage(\"groupID:\".concat(s)),this._getTopicTimeMap.has(s)){var c=this._getTopicTimeMap.get(s),l=c.isGetAll,p=c.time;if((l||!l&&!i)&&Date.now()-p<1e3*this.TOPIC_CACHE_TIME){var d=this._getLocalTopicList(s,r);if(i||d.length===r.length)return u.setNetworkType(this.getNetworkType()).setMoreMessage(\"from cache, topic count:\".concat(d.length)).end(),xe.l(\"\".concat(o,\" groupID:\").concat(s,\" from cache, topic count:\").concat(d.length)),za({successTopicList:d,failureTopicList:[]})}}return this.request({protocolName:na,requestData:{groupID:s,topicIDList:r}}).then((function(e){var a=e.data.topicInfoList,r=[],c=[],l=[];(void 0===a?[]:a).forEach((function(e){var n=e.topic,o=e.selfInfo,s=e.errorCode,a=e.errorInfo,i=n.topicID;0===s?(r.push(t(t({},n),{},{selfInfo:o})),c.push(i)):l.push({topicID:i,code:s,message:a})})),n._updateTopicMap(r),n._handleTopicAtInfo(r);var p=\"success count:\".concat(c.length,\", fail count:\").concat(l.length);u.setNetworkType(n.getNetworkType()).setMoreMessage(\"\".concat(p)).end(),xe.l(\"\".concat(o,\" groupID:\").concat(s,\" from remote, \").concat(p));var d=[];return jt(c)||(n._getTopicTimeMap.set(s,{time:Date.now(),isGetAll:i}),d=n._getLocalTopicList(s,c)),Ka({successTopicList:d,failureTopicList:l})})).catch((function(e){return n.probeNetwork(e).then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"hasLocalTopic\",value:function(e,t){return!!this._topicMap.has(e)&&this._topicMap.get(e).has(t)}},{key:\"getLocalTopic\",value:function(e,t){var n=null;return this._topicMap.has(e)&&(n=this._topicMap.get(e).get(t)),n}},{key:\"_getLocalTopicList\",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=this._topicMap.get(e),o=[];return n&&(o=m(n.values())),0===t.length?o:o.filter((function(e){return t.includes(e.topicID)}))}},{key:\"_deleteLocalTopic\",value:function(e,t){this._topicMap.has(e)&&(this._topicMap.get(e).delete(t),xe.l(\"\".concat(this._n,\"._deleteLocalTopic groupID:\").concat(e,\" topicID:\").concat(t)))}},{key:\"_updateTopicMap\",value:function(e){var t=this,n=[];(e.forEach((function(e){var o=e.groupID,s=e.topicID,a=null;t._topicMap.has(o)||t._topicMap.set(o,new Map),t._topicMap.get(o).has(s)?(a=t._topicMap.get(o).get(s)).updateTopic(e):(t._getTopicLastMessage(e),a=new Br(e,t.isIntl()),t._topicMap.get(o).set(s,a));var r=t._computeUnreadCount(a);a.updateUnreadCount(r),n.push({conversationID:\"\".concat(S.CONV_GROUP).concat(s),type:S.CONV_TOPIC,unreadCount:r})})),n.length>0)&&this.getModule(Fn).updateTopicConversation(n)}},{key:\"resetGetTopicTime\",value:function(e){var t=this;at(e)?m(this._getTopicTimeMap.keys()).forEach((function(e){t._getTopicTimeMap.set(e,0)})):this._getTopicTimeMap.set(e,0)}},{key:\"getTopicListOnReconnected\",value:function(){var e=this,t=m(this._topicMap.keys()),n=[];t.forEach((function(t){var o=[];e._getLocalTopicList(t).forEach((function(t){var n=t.lastMessage.lastTime,s=void 0===n?0:n;Date.now()-1e3*s<1e3*e.TOPIC_LAST_ACTIVE_TIME&&o.push(t.topicID)})),o.length>0&&n.push({groupID:t,topicIDList:o})})),xe.l(\"\".concat(this._n,\".getTopicListOnReconnected. active community count:\").concat(n.length)),this._relayGetTopicList(n)}},{key:\"_relayGetTopicList\",value:function(e){var t=this;if(0!==e.length){var n=e.shift(),o=n.topicIDList.length>5?\"topicIDList.length:\".concat(n.topicIDList.length):\"topicIDList:\".concat(n.topicIDList),s=new ka(\"relayGetTopicList\");s.setMessage(o),xe.l(\"\".concat(this._n,\"._relayGetTopicList. \").concat(o)),this.getTopicList(n).then((function(){s.setNetworkType(t.getNetworkType()).end(),t._relayGetTopicList(e)})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),o=t[0],a=t[1];s.setError(n,o,a).end()})),t._relayGetTopicList(e)}))}}},{key:\"_handleTopicAtInfo\",value:function(e){var n=this;0!==e.length&&e.forEach((function(e){var o=e.groupID,s=e.topicID,a=e.groupAtInfoList,r=[];at(a)||(a.forEach((function(e){r.push(t(t({},e),{},{groupID:o,topicID:s}))})),n.getModule(Fn).onNewGroupAtTips({dataList:r}))}))}},{key:\"_getTopicLastMessage\",value:function(e){if(!at(e.lastMsg)){var t={time:e.lastMsg.time,sequence:e.lastMsg.sequence,from:e.lastMsg.from,payload:e.lastMsg.elements[0]?e.lastMsg.elements[0].content:null,type:e.lastMsg.elements[0]?e.lastMsg.elements[0].type:\"\",nick:e.lastMsg.nick,version:e.lastMsg.messageVersion,cloudCustomData:e.lastMsg.cloudCustomData,isRevoked:2===e.lastMsg.isPlaceMessage,revoker:jt(e.lastMsg.revokerInfo)?null:e.lastMsg.revokerInfo.revoker};e.lastMessage=t}}},{key:\"deleteTopicListInCommunity\",value:function(e){var t=this,n=this._getLocalTopicList(e),o=this.getModule(Fn);n.forEach((function(n){var s=n.topicID;t._deleteLocalTopic(e,s),t._getTopicTimeMap.delete(e),o.deleteLocalConversation(\"\".concat(S.CONV_GROUP).concat(s))}))}},{key:\"_computeUnreadCount\",value:function(e){var t=e.selfInfo,n=t.excludedUnreadSequenceList,o=t.readedSequence,s=e.nextMessageSeq-e.selfInfo.readedSequence-1;if(st(n)){var a=0;n.forEach((function(t){t>=o&&t<=e.nextMessageSeq-1&&(a+=1)})),a>=1&&(s-=a)}return s<0?0:s}},{key:\"_filterProfanity\",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],z),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:\"updateLastMessage\",value:function(e,t){var n=qt(e),o=this.getLocalTopic(n,e);if(o){var s=t.sequence+1;o.updateNextMessageSeq(s),o.updateLastMessage(t),this.emitOuterEvent(E.TOPIC_UPDATED,{groupID:n,topic:o})}}},{key:\"getMessageExtensions\",value:function(e,t){xe.l(\"\".concat(this._n,\".getMessageExtensions startSequence:\").concat(t));var n=qt(e.to);return this.request({protocolName:Es,requestData:{groupID:n,topicID:e.to,messageSequence:e.sequence,startSequence:t}})}},{key:\"modifyMessageExtensions\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;xe.l(\"\".concat(this._n,\".modifyMessageExtensions operateType:\").concat(n));var o=qt(e.to);return this.request({protocolName:Ds,requestData:{groupID:o,topicID:e.to,messageSequence:e.sequence,extensionList:t,operateType:n}})}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._topicMap.clear(),this._getTopicTimeMap.clear(),this.TOPIC_CACHE_TIME=300,this.TOPIC_LAST_ACTIVE_TIME=3600}}]),s}(ro),Kr=function(){function e(t){o(this,e),this._userModule=t,this._n=\"ProfileHandler\",this.TAG=\"profile\",this.accountProfileMap=new Map,this.expirationTime=864e5}return a(e,[{key:\"setExpirationTime\",value:function(e){this.expirationTime=e}},{key:\"getUserProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"getUserProfile\"),o=e.userIDList;e.fromAccount=this._userModule.getMyAccount(),o.length>100&&(xe.w(\"\".concat(n,\" \").concat(Kt(100))),o.length=100);for(var s,a=[],r=[],i=0,u=o.length;i5?\"userIDList.length:\".concat(o.length):\"userIDList:\".concat(o)),this._userModule.request({protocolName:fo,requestData:e}).then((function(e){p.setNetworkType(t._userModule.getNetworkType()).end(),xe.i(\"\".concat(n,\" ok\"));var o=t._handleResponse(e).concat(r);return Ka(c?o[0]:o)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];p.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"getMyProfile\",value:function(){var e=this._userModule.getMyAccount(),t=\"\".concat(this._n,\".getMyProfile\");if(xe.l(\"\".concat(t,\" myAccount:\").concat(e)),this._fill(),this._contains(e)){var n=this._getProfileFromMap(e);return xe.d(\"\".concat(t,\" from cache, myProfile:\").concat(JSON.stringify(n))),za(n)}return this.getUserProfile({fromAccount:e,userIDList:[e],bFromGetMyProfile:!0})}},{key:\"_handleResponse\",value:function(e){var t=e.data.userProfileItem;if(!st(t))return[];for(var n=[],o=Date.now(),s=0,a=t.length;s-1)n.profileCustomField.push({key:t[o].tag,value:t[o].value});else switch(t[o].tag){case Be.NICK:n.nick=t[o].value;break;case Be.GENDER:n.gender=t[o].value;break;case Be.BIRTHDAY:n.birthday=t[o].value;break;case Be.LOCATION:n.location=t[o].value;break;case Be.SELFSIGNATURE:n.selfSignature=t[o].value;break;case Be.ALLOWTYPE:n.allowType=t[o].value;break;case Be.LANGUAGE:n.language=t[o].value;break;case Be.AVATAR:n.avatar=t[o].value;break;case Be.MESSAGESETTINGS:n.messageSettings=t[o].value;break;case Be.ADMINFORBIDTYPE:n.adminForbidType=t[o].value;break;case Be.LEVEL:n.level=t[o].value;break;case Be.ROLE:n.role=t[o].value;break;default:xe.w(\"\".concat(this._n,\"._getLatestProfileFromResponse unknown tag:\"),t[o].tag,t[o].value)}return n}},{key:\"updateMyProfile\",value:function(e){var t=this,n=\"\".concat(this._n,\".\").concat(\"updateMyProfile\");if(e.nick&&!1===this._userModule.filterProfanity(\"nick\",e))return Ja({code:da.PROFANITY_FOUND});if(e.selfSignature&&!1===this._userModule.filterProfanity(\"selfSignature\",e))return Ja({code:da.PROFANITY_FOUND});var o=new ka(\"updateMyProfile\");o.setMessage(JSON.stringify(e));var s=(new ur).validate(e);if(!s.valid)return o.setCode(da.UPDATE_PROFILE_INVALID_PARAM).setMoreMessage(\"info:\".concat(s.tips)).setNetworkType(this._userModule.getNetworkType()).end(),xe.e(\"\".concat(n,\" info:\").concat(s.tips)),Ja({code:da.UPDATE_PROFILE_INVALID_PARAM});var a=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(\"profileCustomField\"===r?e.profileCustomField.forEach((function(e){a.push({tag:e.key,value:e.value})})):a.push({tag:Be[r.toUpperCase()],value:e[r]}));if(0===a.length){var i=new Wa({code:da.UPDATE_PROFILE_NO_KEY});return o.setError(i,!0,this._userModule.getNetworkType()).end(),xe.e(\"\".concat(n,\" failed. error:\"),i),Ja(i)}var u=this._userModule.getMyAccount();return this._userModule.request({protocolName:vo,requestData:{fromAccount:u,profileItem:a}}).then((function(s){o.setNetworkType(t._userModule.getNetworkType()).end(),xe.i(\"\".concat(n,\" ok\"));var a=t._update(u,e),r=a.isProfileUpdated,i=a.latestProfile;return!0===r&&t._userModule.emitOuterEvent(E.PROFILE_UPDATED,[i]),za(i)})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"onProfileModified\",value:function(e){var t=e.dataList;if(!jt(t)){var n,o=t.length;xe.d(\"\".concat(this._n,\".onProfileModified count:\").concat(o,\" dataList:\"),e.dataList);for(var s=[],a=0;a0&&(this._userModule.emitInnerEvent(er,s),this._userModule.emitOuterEvent(E.PROFILE_UPDATED,s))}}},{key:\"_fill\",value:function(){if(0===this.accountProfileMap.size){for(var e=this._getCachedProfiles(),t=Date.now(),n=0,o=e.length;n0&&(n.lastUpdatedTime=s,o=!0)):(n=new ur(t),(this._userModule.isMyFriend(e)||e===this._userModule.getMyAccount())&&(n.lastUpdatedTime=s,o=!0,this.accountProfileMap.set(e,n)));return this._flush(e===this._userModule.getMyAccount()),xe.l(\"\".concat(this._n,\"._update account:\").concat(e,\" isProfileUpdated:\").concat(o)),{isProfileUpdated:o,latestProfile:n}}},{key:\"_flush\",value:function(e){var t=m(this.accountProfileMap.values()),n=this._userModule.getStorageModule();xe.d(\"\".concat(this._n,\"._flush length:\").concat(t.length,\" flushAtOnce:\").concat(e)),n.setItem(this.TAG,t,e)}},{key:\"_contains\",value:function(e){return this.accountProfileMap.has(e)}},{key:\"_getProfileFromMap\",value:function(e){return this.accountProfileMap.get(e)}},{key:\"_getCachedProfiles\",value:function(){var e=this._userModule.getStorageModule().getItem(this.TAG);return jt(e)?[]:e}},{key:\"onConversationsProfileUpdated\",value:function(e){for(var t,n,o,s=[],a=0,r=e.length;a0&&s.push(n)):s.push(t.userID));0!==s.length&&(xe.i(\"\".concat(this._n,\".onConversationsProfileUpdated toAccountList:\").concat(s)),this.getUserProfile({userIDList:s}))}},{key:\"getNickAndAvatarByUserID\",value:function(e){if(this._contains(e)){var t=this._getProfileFromMap(e);return{nick:t.nick,avatar:t.avatar}}return{nick:\"\",avatar:\"\"}}},{key:\"reset\",value:function(){this._flush(!0),this.accountProfileMap.clear()}}]),e}(),Wr=a((function e(t){o(this,e),jt||(this.userID=t.userID||\"\",this.timeStamp=t.timeStamp||0)})),Yr=function(){function e(t){o(this,e),this._userModule=t,this._n=\"BlacklistHandler\",this._blacklistMap=new Map,this.startIndex=0,this.maxLimited=100,this.currentSequence=0}return a(e,[{key:\"getLocalBlacklist\",value:function(){return m(this._blacklistMap.keys())}},{key:\"getBlacklist\",value:function(){var e=this,t=\"\".concat(this._n,\".getBlacklist\"),n={fromAccount:this._userModule.getMyAccount(),maxLimited:this.maxLimited,startIndex:0,lastSequence:this.currentSequence},o=new ka(\"getBlacklist\");return this._userModule.request({protocolName:mo,requestData:n}).then((function(n){var s=n.data,a=s.blackListItem,r=s.currentSequence,i=jt(a)?0:a.length;o.setNetworkType(e._userModule.getNetworkType()).setMessage(\"count:\".concat(i)).end(),xe.i(\"\".concat(t,\" ok\")),e.currentSequence=r,e._handleResponse(a,!0),e._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(e._blacklistMap.keys()))})).catch((function(n){return e._userModule.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];o.setError(n,s,a).end()})),xe.e(\"\".concat(t,\" failed. error:\"),n),Ja(n)}))}},{key:\"addBlacklist\",value:function(e){var t=this,n=new ka(\"addToBlacklist\"),o=\"\".concat(this._n,\".addBlacklist\"),s=this._userModule.getMyAccount();if(1===e.userIDList.length&&e.userIDList[0]===s){var a=da.CANNOT_ADD_SELF_TO_BLACKLIST,r=this._userModule.getErrorMessage(a);n.setCode(a).setMessage(r).setNetworkType(this._userModule.getNetworkType()).end();var i=new Wa({code:a});return xe.e(\"\".concat(o,\" failed. error:\"),i),Ja(i)}return e.userIDList.includes(s)&&(e.userIDList=e.userIDList.filter((function(e){return e!==s}))),e.fromAccount=this._userModule.getMyAccount(),e.toAccount=e.userIDList,this._userModule.request({protocolName:Mo,requestData:e}).then((function(s){return n.setNetworkType(t._userModule.getNetworkType()).setMessage(e.userIDList.length>5?\"userIDList.length:\".concat(e.userIDList.length):\"userIDList:\".concat(e.userIDList)).end(),xe.i(\"\".concat(o,\" ok\")),t._handleResponse(s.resultItem,!0),Ka(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var o=v(t,2),s=o[0],a=o[1];n.setError(e,s,a).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"_handleResponse\",value:function(e,t){if(!jt(e))for(var n,o,s,a=0,r=e.length;a5?\"userIDList.length:\".concat(e.userIDList.length):\"userIDList:\".concat(e.userIDList)).end(),xe.i(\"\".concat(n,\" ok\")),t._handleResponse(s.data.resultItem,!1),Ka(m(t._blacklistMap.keys()))})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"onAccountDeleted\",value:function(e){for(var t,n=[],o=0,s=e.length;o0&&(xe.l(\"\".concat(this._n,\".onAccountDeleted count:\").concat(n.length,\" userIDList:\"),n),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:\"onAccountAdded\",value:function(e){for(var t,n=[],o=0,s=e.length;o0&&(xe.l(\"\".concat(this._n,\".onAccountAdded count:\").concat(n.length,\" userIDList:\"),n),this._userModule.emitOuterEvent(E.BLACKLIST_UPDATED,m(this._blacklistMap.keys())))}},{key:\"reset\",value:function(){this._blacklistMap.clear(),this.startIndex=0,this.maxLimited=100,this.currentSequence=0}}]),e}(),jr=function(e){var t=String(e).replace(/[=]+$/,\"\"),n=\"\";if(t.length%4==1)return\"\";for(var o,s,a=0,r=0;s=t.charAt(r++);~s&&(o=a%4?64*o+s:s,a++%4)?n+=String.fromCharCode(255&o>>(-2*a&6)):0)s=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\".indexOf(s);try{return decodeURIComponent(escape(n))}catch(i){return\"\"}},zr=function(){function e(t){o(this,e),this._userModule=t,this._n=\"UserStatusHandler\",this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100,this._userModule.getInnerEmitterInstance().on($a,this._onCloudConfigUpdated,this)}return a(e,[{key:\"_onCloudConfigUpdated\",value:function(){var e=this._userModule.getCloudConfig(\"status_query_count\"),t=this._userModule.getCloudConfig(\"status_sub_count\"),n=this._userModule.getCloudConfig(\"status_unsub_count\");xe.l(\"\".concat(this._n,\"._onCloudConfigUpdated statusQueryCount:\").concat(e,\" statusSubscribeCount:\").concat(t)+\" statusUnsubscribeCount:\".concat(n)),at(e)||(this.MAX_QUERY_USER_COUNT=parseInt(e,10)),at(e)||(this.MAX_SUBSCRIBE_USER_COUNT=parseInt(t,10)),at(e)||(this.MAX_UNSUBSCRIBE_USER_COUNT=parseInt(n,10))}},{key:\"onUserStatusUpdated\",value:function(e){var t=e.dataList,n=this._userModule.getMyUserID(),o=this._userModule.getModule(qn),s=t.map((function(e){var t=e.to,s=e.statusType,a=e.customStatus,r=jr(a);return t===n&&o.setCustomStatus(r),{userID:t,statusType:s,customStatus:r}}));this._userModule.emitOuterEvent(E.USER_STATUS_UPDATED,s)}},{key:\"setSelfStatus\",value:function(e){var t=this,n=\"\".concat(this._n,\".setSelfStatus\");if(!1===this._userModule.filterProfanity(\"customStatus\",e))return Ja({code:da.PROFANITY_FOUND});var o=new ka(\"setSelfStatus\"),s=e.customStatus;return this._userModule.request({protocolName:oa,requestData:{customStatus:s}}).then((function(e){return o.setNetworkType(t._userModule.getNetworkType()).setMessage(\"customStatus:\".concat(s)).end(),xe.l(\"\".concat(n,\" ok. customStatus:\").concat(s)),t._userModule.getModule(qn).setCustomStatus(s),Ka({userID:t._userModule.getMyUserID(),statusType:1,customStatus:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),s=n[0],a=n[1];o.setError(e,s,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"getUserStatus\",value:function(e){var t=this,n=\"\".concat(this._n,\".getUserStatus\"),o=e.userIDList,s=void 0===o?[]:o,a=this._userModule.getMyUserID(),r=m(s),i=void 0,u=r.indexOf(a);if(u>-1){r.splice(u,1);var c=this._userModule.getModule(qn).getCustomStatus();i={userID:a,statusType:1,customStatus:c}}if(0===r.length)return za({successUserList:[i],failureUserList:[]});if(!this._userModule.canIUse(B.USER_STATUS))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});r.length>this.MAX_QUERY_USER_COUNT&&(xe.w(\"\".concat(n,\" \").concat(Kt(this.MAX_QUERY_USER_COUNT))),r=s.slice(0,this.MAX_QUERY_USER_COUNT));var l=new ka(\"getUserStatus\");return this._userModule.request({protocolName:sa,requestData:{userIDList:r}}).then((function(e){var o=e.data,a=o.successUserList,r=void 0===a?[]:a,u=o.failureUserList,c=void 0===u?[]:u,p=r.map((function(e){var t=e.userID,n=e.statusType,o=e.customStatus;return{userID:t,statusType:n,customStatus:jr(o)}})),d=c.map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:jt(n)?t:n,code:o,message:s}}));at(i)||p.unshift(i);var g=\"userID count:\".concat(s.length,\", success count:\").concat(p.length,\", fail count:\").concat(d.length);return l.setNetworkType(t._userModule.getNetworkType()).setMessage(\"\".concat(g)).end(),xe.l(\"\".concat(n,\" ok. \").concat(g,\".\")),Ka({successUserList:p,failureUserList:d})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],a=n[1];l.setMessage(\"userID count:\".concat(s.length)).setError(e,o,a).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"subscribeUserStatus\",value:function(e){var t=this;if(!this._userModule.canIUse(B.USER_STATUS))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".subscribeUserStatus\"),o=e.userIDList,s=void 0===o?[]:o,a=m(s);a.length>this.MAX_SUBSCRIBE_USER_COUNT&&(xe.w(\"\".concat(n,\" \").concat(Kt(this.MAX_SUBSCRIBE_USER_COUNT))),a=s.slice(0,this.MAX_SUBSCRIBE_USER_COUNT));var r=new ka(\"subscribeUserStatus\"),i=\"userID count:\".concat(s.length);return xe.l(\"\".concat(n,\" \").concat(i)),this._userModule.request({protocolName:aa,requestData:{userIDList:a}}).then((function(e){var o=e.data.failureUserList,s=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:jt(n)?t:n,code:o,message:s}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage(\"\".concat(i,\" fail count:\").concat(s.length)).end(),xe.l(\"\".concat(n,\" ok. fail count:\").concat(s.length,\".\")),Ka({failureUserList:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setMessage(\"\".concat(i)).setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"unsubscribeUserStatus\",value:function(e){var t=this;if(!this._userModule.canIUse(B.USER_STATUS))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".unsubscribeUserStatus\"),o=(e||{}).userIDList,s=void 0===o?[]:o,a=m(s);s.length>this.MAX_UNSUBSCRIBE_USER_COUNT&&(xe.w(\"\".concat(n,\" \").concat(Kt(this.MAX_UNSUBSCRIBE_USER_COUNT))),a=s.slice(0,this.MAX_UNSUBSCRIBE_USER_COUNT));var r=new ka(\"unsubscribeUserStatus\"),i=\"userID count:\".concat(s.length);xe.l(\"\".concat(n,\" \").concat(i));var u={userIDList:a};return 0===a.length&&(u.userIDList=void 0,u.unsubscribeAll=1),this._userModule.request({protocolName:ra,requestData:u}).then((function(e){var o=e.data.failureUserList,s=(void 0===o?[]:o).map((function(e){var t=e.userID,n=e.invalidUserID,o=e.errorCode,s=e.errorInfo;return{userID:jt(n)?t:n,code:o,message:s}}));return r.setNetworkType(t._userModule.getNetworkType()).setMessage(\"\".concat(i,\" fail count:\").concat(s.length)).end(),xe.l(\"\".concat(n,\" ok. fail count:\").concat(s.length,\".\")),Ka({failureUserList:s})})).catch((function(e){return t._userModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setMessage(\"\".concat(i)).setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"reset\",value:function(){this.MAX_QUERY_USER_COUNT=500,this.MAX_SUBSCRIBE_USER_COUNT=100,this.MAX_UNSUBSCRIBE_USER_COUNT=100}}]),e}(),Jr=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"UserModule\",s._profileHandler=new Kr(_(s)),s._blacklistHandler=new Yr(_(s)),s._userStatusHandler=new zr(_(s)),s.getInnerEmitterInstance().on(Za,s.onContextUpdated,_(s)),s}return a(n,[{key:\"onContextUpdated\",value:function(e){this._profileHandler.getMyProfile(),this._blacklistHandler.getBlacklist()}},{key:\"onProfileModified\",value:function(e){this._profileHandler.onProfileModified(e)}},{key:\"onRelationChainModified\",value:function(e){var t=e.dataList;if(!jt(t)){var n=[];t.forEach((function(e){e.blackListDelAccount&&n.push.apply(n,m(e.blackListDelAccount))})),n.length>0&&this._blacklistHandler.onAccountDeleted(n);var o=[];t.forEach((function(e){e.blackListAddAccount&&o.push.apply(o,m(e.blackListAddAccount))})),o.length>0&&this._blacklistHandler.onAccountAdded(o)}}},{key:\"onConversationsProfileUpdated\",value:function(e){this._profileHandler.onConversationsProfileUpdated(e)}},{key:\"getMyAccount\",value:function(){return this.getMyUserID()}},{key:\"getMyProfile\",value:function(){return this._profileHandler.getMyProfile()}},{key:\"getStorageModule\",value:function(){return this.getModule(xn)}},{key:\"filterProfanity\",value:function(e,t){var n=this.getModule(no);if(!n)return!0;var o=n.filterText(t[e],j),s=o.isAllowedToSend,a=o.modifiedText;return!0===s&&(t[e]=a,!0)}},{key:\"isMyFriend\",value:function(e){var t=this.getModule(Pn);return!!t&&t.isMyFriend(e)}},{key:\"getUserProfile\",value:function(e){return this._profileHandler.getUserProfile(e)}},{key:\"updateMyProfile\",value:function(e){return this._profileHandler.updateMyProfile(e)}},{key:\"getNickAndAvatarByUserID\",value:function(e){return this._profileHandler.getNickAndAvatarByUserID(e)}},{key:\"getLocalBlacklist\",value:function(){var e=this._blacklistHandler.getLocalBlacklist();return za(e)}},{key:\"addBlacklist\",value:function(e){return this._blacklistHandler.addBlacklist(e)}},{key:\"deleteBlacklist\",value:function(e){return this._blacklistHandler.deleteBlacklist(e)}},{key:\"onUserStatusUpdated\",value:function(e){this._userStatusHandler.onUserStatusUpdated(e)}},{key:\"setSelfStatus\",value:function(e){return this._userStatusHandler.setSelfStatus(e)}},{key:\"getUserStatus\",value:function(e){return this._userStatusHandler.getUserStatus(e)}},{key:\"subscribeUserStatus\",value:function(e){return this._userStatusHandler.subscribeUserStatus(e)}},{key:\"unsubscribeUserStatus\",value:function(e){return this._userStatusHandler.unsubscribeUserStatus(e)}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._profileHandler.reset(),this._blacklistHandler.reset(),this._userStatusHandler.reset()}}]),n}(ro),Xr=function(){function e(t,n){o(this,e),this._m=t,this._isLoggedIn=!1,this._SDKAppID=n.SDKAppID,this._userID=n.userID||\"\",this._userSig=n.userSig||\"\",this._version=\"2.27.5\",this._a2Key=\"\",this._tinyID=\"\",this._customStatus=\"\",this._contentType=\"json\",this._unlimitedAVChatRoom=n.unlimitedAVChatRoom,this._scene=n.scene||\"\",this._oversea=n.oversea,this._instanceID=n.instanceID,this._statusInstanceID=0,this._isDevMode=n.devMode,this._proxyServer=n.proxyServer,this._fileUploadProxy=n.fileUploadProxy,this._fileDownloadProxy=n.fileDownloadProxy}return a(e,[{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:\"isSingaporeSite\",value:function(){return this._SDKAppID>=2e7&&this._SDKAppID<3e7||this._SDKAppID>=172e7&&this._SDKAppID<173e7}},{key:\"isKoreaSite\",value:function(){return this._SDKAppID>=3e7&&this._SDKAppID<4e7||this._SDKAppID>=173e7&&this._SDKAppID<174e7}},{key:\"isGermanySite\",value:function(){return this._SDKAppID>=4e7&&this._SDKAppID<5e7||this._SDKAppID>=174e7&&this._SDKAppID<175e7}},{key:\"isIndiaSite\",value:function(){return this._SDKAppID>=5e7&&this._SDKAppID<6e7||this._SDKAppID>=175e7&&this._SDKAppID<176e7}},{key:\"isJapanSite\",value:function(){return this._SDKAppID>=6e7&&this._SDKAppID<7e7||this._SDKAppID>=176e7&&this._SDKAppID<177e7}},{key:\"isUSASite\",value:function(){return this._SDKAppID>=7e7&&this._SDKAppID<8e7||this._SDKAppID>=177e7&&this._SDKAppID<178e7}},{key:\"isIntl\",value:function(){return 0===(e=this._SDKAppID)||e>=2e7&&e<8e7||e>=172e7&&e<178e7;var e}},{key:\"isUnlimitedAVChatRoom\",value:function(){return this._unlimitedAVChatRoom}},{key:\"setUserID\",value:function(e){this._userID=e}},{key:\"getUserID\",value:function(){return this._userID}},{key:\"setUserSig\",value:function(e){this._userSig=e}},{key:\"getUserSig\",value:function(){return this._userSig}},{key:\"getSDKAppID\",value:function(){return this._SDKAppID}},{key:\"setTinyID\",value:function(e){this._tinyID=e,this._isLoggedIn=!0}},{key:\"getTinyID\",value:function(){return this._tinyID}},{key:\"setCustomStatus\",value:function(e){this._customStatus=e}},{key:\"getCustomStatus\",value:function(){return this._customStatus}},{key:\"getScene\",value:function(){return Le?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(e){this._statusInstanceID=e}},{key:\"getVersion\",value:function(){return this._version}},{key:\"getA2Key\",value:function(){return this._a2Key}},{key:\"setA2Key\",value:function(e){this._a2Key=e}},{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:\"_isTUIKit\",value:function(){var e=!1,t=!1,n=!1,o=!1,s=[];se&&(s=Object.keys(re)),ae&&(s=oe?Object.keys(uni):Object.keys(window));for(var a=0,r=s.length;a0){for(var c=0,l=u.length;c0&&void 0!==arguments[0]?arguments[0]:0;if(!this.isLoggedIn())return Ja({code:da.USER_NOT_LOGGED_IN});var n=new ka(\"logout\");n.setNetworkType(this.getNetworkType()).setMessage(\"identifier:\".concat(this.getMyUserID())).end(!0);var o=\"\".concat(this._n,\".logout\");return xe.i(\"\".concat(o,\" type:\").concat(t)),0===t&&this._m.setNotReadyReason(da.LOGGED_OUT),this.request({protocolName:uo,requestData:{type:t}}).then((function(){return e.resetReady(),za({})})).catch((function(t){return xe.e(\"\".concat(o,\" error:\"),t),e.resetReady(),za({})}))}},{key:\"_fetchCloudControlConfig\",value:function(){this.getModule(Xn).fetchConfig()}},{key:\"_getStatusInstanceID\",value:function(){return uni.getStorageSync(\"timUniAppInstanceID\")}},{key:\"_hello\",value:function(){var e=this;this._lastWsHelloTs=Date.now(),this.request({protocolName:co,requestData:{isWebUniapp:this._isWebUniapp}}).catch((function(t){xe.w(\"\".concat(e._n,\"._hello error:\"),t)}))}},{key:\"getLastWsHelloTs\",value:function(){return this._lastWsHelloTs}},{key:\"_checkLoginInfo\",value:function(e){var t=0;return jt(this.getModule(qn).getSDKAppID())?t=da.NO_SDKAPPID:jt(e.userID)?t=da.NO_IDENTIFIER:jt(e.userSig)&&(t=da.NO_USERSIG),{code:t}}},{key:\"_isReactUIKit\",value:function(){return ae&&void 0!==window.tencent_cloud_im_csig_react_uikit_23F_xa}},{key:\"onMultipleAccountKickedOut\",value:function(e){var t=this;new ka(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(\"type:\".concat(S.KICKED_OUT_MULT_ACCOUNT,\" newInstanceInfo:\").concat(JSON.stringify(e))).end(!0),xe.w(\"\".concat(this._n,\".onMultipleAccountKickedOut userID:\").concat(this.getMyUserID(),\" newInstanceInfo:\"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_ACCOUNT}),t._m.setNotReadyReason(da.KICKED_OUT_MULT_ACCOUNT),t._m.reset()}))}},{key:\"onMultipleDeviceKickedOut\",value:function(e){var t=this;new ka(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(\"type:\".concat(S.KICKED_OUT_MULT_DEVICE,\" newInstanceInfo:\").concat(JSON.stringify(e))).end(!0),xe.w(\"\".concat(this._n,\".onMultipleDeviceKickedOut userID:\").concat(this.getMyUserID(),\" newInstanceInfo:\"),e),this.logout(1).then((function(){t.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_MULT_DEVICE}),t._m.setNotReadyReason(da.KICKED_OUT_MULT_DEVICE),t._m.reset()}))}},{key:\"onUserSigExpired\",value:function(){new ka(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(S.KICKED_OUT_USERSIG_EXPIRED).end(!0),xe.w(\"\".concat(this._n,\".onUserSigExpired: userSig expired\")),0!==this.getModule(qn).getStatusInstanceID()&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_USERSIG_EXPIRED}),this._m.setNotReadyReason(da.KICKED_OUT_USERSIG_EXPIRED),this._m.reset())}},{key:\"onRestApiKickedOut\",value:function(e){(new ka(\"kickedOut\").setNetworkType(this.getNetworkType()).setMessage(\"type:\".concat(S.KICKED_OUT_REST_API,\" newInstanceInfo:\").concat(JSON.stringify(e))).end(!0),xe.w(\"\".concat(this._n,\".onRestApiKickedOut userID:\").concat(this.getMyUserID(),\" newInstanceInfo:\"),e),0!==this.getModule(qn).getStatusInstanceID())&&(this.emitOuterEvent(E.KICKED_OUT,{type:S.KICKED_OUT_REST_API}),this._m.setNotReadyReason(da.KICKED_OUT_REST_API),this._m.reset(),this.getModule(zn).onRestApiKickedOut())}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this.resetReady(),this._helloInterval=120,this._lastLoginTs=0,this._lastWsHelloTs=0,this._isWebUniapp=0}}]),n}(ro);function Zr(){return null}var $r=function(){function e(t){o(this,e),this._m=t,this._n=\"StorageModule\",this._storageQueue=new Map,this._errorTolerantHandle()}return a(e,[{key:\"_errorTolerantHandle\",value:function(){se||!at(window)&&this._canIUseCookies()||(this.getItem=Zr,this.setItem=Zr,this.removeItem=Zr,this.clear=Zr)}},{key:\"onCheckTimer\",value:function(e){if(e%20==0){if(0===this._storageQueue.size)return;this._doFlush()}}},{key:\"_doFlush\",value:function(){try{var e,t=D(this._storageQueue);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2),o=n[0],s=n[1];this._setStorageSync(this._getKey(o),s)}}catch(a){t.e(a)}finally{t.f()}this._storageQueue.clear()}catch(r){xe.w(\"\".concat(this._n,\"._doFlush error:\"),r)}}},{key:\"_getPrefix\",value:function(){var e=this._m.getModule(qn);return\"TIM_\".concat(e.getSDKAppID(),\"_\").concat(e.getUserID(),\"_\")}},{key:\"_getKey\",value:function(e){return\"\".concat(this._getPrefix()).concat(e)}},{key:\"getItem\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;return this.getStorageSync(n)}catch(o){return xe.w(\"\".concat(this._n,\".getItem error:\"),o),{}}}},{key:\"setItem\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];if(n){var s=o?this._getKey(e):e;this._setStorageSync(s,t)}else this._storageQueue.set(e,t)}},{key:\"clear\",value:function(){try{se?re.clearStorageSync():this._canIUseCookies()&&localStorage.clear()}catch(e){xe.w(\"\".concat(this._n,\".clear error:\"),e)}}},{key:\"removeItem\",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{var n=t?this._getKey(e):e;this._removeStorageSync(n)}catch(o){xe.w(\"\".concat(this._n,\".removeItem error:\"),o)}}},{key:\"getSize\",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:\"b\";try{var o={size:0,limitSize:5242880,unit:n};if(Object.defineProperty(o,\"leftSize\",{enumerable:!0,get:function(){return o.limitSize-o.size}}),se&&(o.limitSize=1024*re.getStorageInfoSync().limitSize),e)o.size=JSON.stringify(this.getItem(e)).length+this._getKey(e).length;else if(se){var s=re.getStorageInfoSync(),a=s.keys;a.forEach((function(e){o.size+=JSON.stringify(t.getStorageSync(e)).length+t._getKey(e).length}))}else if(this._canIUseCookies())for(var r in localStorage)localStorage.hasOwnProperty(r)&&(o.size+=localStorage.getItem(r).length+r.length);return this._convertUnit(o)}catch(i){xe.w(\"\".concat(this._n,\" error:\"),i)}}},{key:\"_convertUnit\",value:function(e){var t={},n=e.unit;for(var o in t.unit=n,e)\"number\"==typeof e[o]&&(\"kb\"===n.toLowerCase()?t[o]=Math.round(e[o]/1024):\"mb\"===n.toLowerCase()?t[o]=Math.round(e[o]/1024/1024):t[o]=e[o]);return t}},{key:\"_setStorageSync\",value:function(e,t){se?ee?my.setStorageSync({key:e,data:t}):re.setStorageSync(e,t):this._canIUseCookies()&&localStorage.setItem(e,JSON.stringify(t))}},{key:\"getStorageSync\",value:function(e){return se?ee?my.getStorageSync({key:e}).data:re.getStorageSync(e):this._canIUseCookies()?JSON.parse(localStorage.getItem(e)):{}}},{key:\"_removeStorageSync\",value:function(e){se?ee?my.removeStorageSync({key:e}):re.removeStorageSync(e):this._canIUseCookies()&&localStorage.removeItem(e)}},{key:\"_canIUseCookies\",value:function(){return navigator&&navigator.cookieEnabled&&localStorage}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._doFlush()}}]),e}(),ei=function(){function e(t){o(this,e),this._n=\"SSOLogBody\",this._report=[]}return a(e,[{key:\"pushIn\",value:function(e){xe.d(\"\".concat(this._n,\".pushIn\"),this._report.length,e),this._report.push(e)}},{key:\"backfill\",value:function(e){var t;st(e)&&0!==e.length&&(xe.d(\"\".concat(this._n,\".backfill\"),this._report.length,e.length),(t=this._report).unshift.apply(t,m(e)))}},{key:\"getLogsNumInMemory\",value:function(){return this._report.length}},{key:\"isEmpty\",value:function(){return 0===this._report.length}},{key:\"_reset\",value:function(){this._report.length=0,this._report=[]}},{key:\"getLogsInMemory\",value:function(){var e=this._report.slice();return this._reset(),e}}]),e}(),ti=function(e){var t=e.getModule(qn);return{SDKType:10,SDKAppID:t.getSDKAppID(),SDKVersion:t.getVersion(),tinyID:Number(t.getTinyID()),userID:t.getUserID(),platform:e.getPlatform(),instanceID:t.getInstanceID(),traceID:Ue()}},ni=function(e){i(s,e);var n=f(s);function s(e){var t;o(this,s),(t=n.call(this,e))._n=\"EventStatModule\",t.TAG=\"im-ssolog-event\",t._reportBody=new ei,t.MIN_THRESHOLD=20,t.MAX_THRESHOLD=100,t.WAITING_TIME=6e4,t.REPORT_LEVEL=[4,5,6],t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._lastReportTime=Date.now();var a=t.getInnerEmitterInstance();return a.on(Za,t._onLoginSuccess,_(t)),a.on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:\"reportAtOnce\",value:function(){xe.d(\"\".concat(this._n,\".reportAtOnce\")),this._report()}},{key:\"_onLoginSuccess\",value:function(){var e=this,t=this.getModule(xn),n=t.getItem(this.TAG,!1);!jt(n)&&it(n.forEach)&&(xe.l(\"\".concat(this._n,\"._onLoginSuccess get ssolog in storage, count:\").concat(n.length)),n.forEach((function(t){e._reportBody.pushIn(t)})),t.removeItem(this.TAG,!1))}},{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"evt_rpt_threshold\"),t=this.getCloudConfig(\"evt_rpt_waiting\"),n=this.getCloudConfig(\"evt_rpt_level\"),o=this.getCloudConfig(\"evt_rpt_sdkappid_bl\"),s=this.getCloudConfig(\"evt_rpt_tinyid_wl\");at(e)||(this.MIN_THRESHOLD=Number(e)),at(t)||(this.WAITING_TIME=Number(t)),at(n)||(this.REPORT_LEVEL=n.split(\",\").map((function(e){return Number(e)}))),at(o)||(this.REPORT_SDKAPPID_BLACKLIST=o.split(\",\").map((function(e){return Number(e)}))),at(s)||(this.REPORT_TINYID_WHITELIST=s.split(\",\"))}},{key:\"pushIn\",value:function(e){e instanceof ka&&(e.updateTimeStamp(),this._reportBody.pushIn(e),this._reportBody.getLogsNumInMemory()>=this.MIN_THRESHOLD&&this._report())}},{key:\"onCheckTimer\",value:function(){Date.now()e.MAX_THRESHOLD&&e._flushAtOnce()}))}else this._lastReportTime=Date.now()}}},{key:\"_flushAtOnce\",value:function(){var e=this.getModule(xn),t=e.getItem(this.TAG,!1),n=this._reportBody.getLogsInMemory(),o=\"\".concat(this._n,\"._flushAtOnce\");if(jt(t))xe.l(\"\".concat(o,\" count:\").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var s=n.concat(t);s.length>this.MAX_THRESHOLD&&(s=s.slice(0,this.MAX_THRESHOLD)),xe.l(\"\".concat(o,\" count:\").concat(s.length)),e.setItem(this.TAG,s,!0,!1)}}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._lastReportTime=0,this._report(),this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[]}}]),s}(ro),oi=\"none\",si=\"online\",ai=[da.OVER_FREQUENCY_LIMIT,da.OPEN_SERVICE_OVERLOAD_ERROR],ri=function(){function e(t){o(this,e),this._m=t,this._networkType=\"\",this._n=\"NetMonitorModule\",this.MAX_WAIT_TIME=3e3,this._mpNetworkStatusCallback=null,this._webOnlineCallback=null,this._webOfflineCallback=null}return a(e,[{key:\"start\",value:function(){var e=this;se?(re.getNetworkType({success:function(t){e._networkType=t.networkType||t.subtype||\"\",t.networkType===oi?xe.w(\"\".concat(e._n,\".start no network, please check!\")):xe.i(\"\".concat(e._n,\".start networkType:\").concat(t.networkType))}}),this._mpNetworkStatusCallback=this._onNetworkStatusChange.bind(this),re.onNetworkStatusChange(this._mpNetworkStatusCallback)):(this._networkType=si,this._webOnlineCallback=this._onWebOnline.bind(this),this._webOfflineCallback=this._onWebOffline.bind(this),window&&(window.addEventListener(\"online\",this._webOnlineCallback),window.addEventListener(\"offline\",this._webOfflineCallback)))}},{key:\"_onWebOnline\",value:function(){this._onNetworkStatusChange({isConnected:!0,networkType:si})}},{key:\"_onWebOffline\",value:function(){this._onNetworkStatusChange({isConnected:!1,networkType:oi})}},{key:\"_onNetworkStatusChange\",value:function(e){var t=e.isConnected,n=e.networkType,o=\"\".concat(this._n,\"._onNetworkStatusChange\"),s=!1;t?(xe.i(\"\".concat(o,\" previous:\").concat(this._networkType,\" current:\").concat(n)),this._networkType!==n&&(s=!0,this._m.getModule(zn).reConnect(!0))):this._networkType!==n&&(s=!0,xe.w(\"\".concat(o,\" no network, please check!\")),this._m.getModule(zn).offline());s&&(new ka(\"networkChange\").setMessage(\"isConnected:\".concat(t,\" previousNetworkType:\").concat(this._networkType,\" networkType:\").concat(n)).end(),this._networkType=n)}},{key:\"probe\",value:function(e){var t=this;if(!at(e)&&ai.includes(e.code))return Promise.resolve([!0,this._networkType]);var n=\"\".concat(this._n,\".probe\");return new Promise((function(e,o){se?re.getNetworkType({success:function(o){t._networkType=o.networkType,o.networkType===oi?(xe.w(\"\".concat(n,\" no network, please check!\")),e([!1,o.networkType])):(xe.i(\"\".concat(n,\" networkType:\").concat(o.networkType)),e([!0,o.networkType]))}}):t._networkType===oi?e([!1,oi]):e([!0,si])}))}},{key:\"getNetworkType\",value:function(){return this._networkType}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),se?null!==this._mpNetworkStatusCallback&&(re.offNetworkStatusChange&&(ne||Z?re.offNetworkStatusChange(this._mpNetworkStatusCallback):re.offNetworkStatusChange()),this._mpNetworkStatusCallback=null):window&&(null!==this._webOnlineCallback&&(window.removeEventListener(\"online\",this._webOnlineCallback),this._webOnlineCallback=null),null!==this._onWebOffline&&(window.removeEventListener(\"offline\",this._webOfflineCallback),this._webOfflineCallback=null))}}]),e}();var ii=function(e,t){return e(t={exports:{}},t.exports),t.exports}((function(e){var t=Object.prototype.hasOwnProperty,n=\"~\";function o(){}function s(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function a(e,t,o,a,r){if(\"function\"!=typeof o)throw new TypeError(\"The listener must be a function\");var i=new s(o,a||e,r),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],i]:e._events[u].push(i):(e._events[u]=i,e._eventsCount++),e}function r(e,t){0==--e._eventsCount?e._events=new o:delete e._events[t]}function i(){this._events=new o,this._eventsCount=0}Object.create&&(o.prototype=Object.create(null),(new o).__proto__||(n=!1)),i.prototype.eventNames=function(){var e,o,s=[];if(0===this._eventsCount)return s;for(o in e=this._events)t.call(e,o)&&s.push(n?o.slice(1):o);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},i.prototype.listeners=function(e){var t=n?n+e:e,o=this._events[t];if(!o)return[];if(o.fn)return[o.fn];for(var s=0,a=o.length,r=new Array(a);s=this.cosOptions.expiredTime-120&&this._getAuthorizationKey())}},{key:\"_getAuthorization\",value:function(e,t){t({TmpSecretId:this.cosOptions.secretId,TmpSecretKey:this.cosOptions.secretKey,XCosSecurityToken:this.cosOptions.sessionToken,ExpiredTime:this.cosOptions.expiredTime})}},{key:\"upload\",value:function(e){if(!0===e.getRelayFlag())return Promise.resolve();var t=this.getModule($n);switch(e.type){case S.MSG_IMAGE:return t.addTotalCount(Ma),this._uploadImage(e);case S.MSG_FILE:return t.addTotalCount(Ma),this._uploadFile(e);case S.MSG_AUDIO:return t.addTotalCount(Ma),this._uploadAudio(e);case S.MSG_VIDEO:return t.addTotalCount(Ma),this._uploadVideo(e);default:return Promise.resolve()}}},{key:\"_uploadImage\",value:function(e){var n=this,o=this.getModule(Rn),s=e.getElements()[0],a=o.getMessageOption(e.clientSequence);return this.doUploadImage({file:a.payload.file,to:a.to,onProgress:function(e){if(s.updatePercent(e),it(a.onProgress))try{a.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(o){var a,r,i=o.location,u=o.fileType,c=o.fileSize,l=o.width,p=o.height,d=o.smallImageUrl,g=o.smallImageWidth,_=o.smallImageHeight,h=o.largeImageUrl,f=o.largeImageWidth,v=o.largeImageHeight,m=n.isPrivateNetWork()?i:Mt(i);return s.updateImageFormat(u),d&&h?(a={url:d,width:g,height:_},r={url:h,width:f,height:v}):(a=Gt({originUrl:m,originWidth:l,originHeight:p,min:198}),r=Gt({originUrl:m,originWidth:l,originHeight:p,min:720})),s.updateImageInfoArray([{size:c,url:m,width:l,height:p},t({},r),t({},a)]),e}))}},{key:\"_uploadFile\",value:function(e){var t=this,n=this.getModule(Rn),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadFile({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),it(s.onProgress))try{s.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var s=n.location,a=t.isPrivateNetWork()?s:Mt(s);return o.updateFileUrl(a),e}))}},{key:\"_uploadAudio\",value:function(e){var t=this,n=this.getModule(Rn),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadAudio({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),it(s.onProgress))try{s.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var s=n.location,a=t.isPrivateNetWork()?s:Mt(s);return o.updateAudioUrl(a),e}))}},{key:\"_uploadVideo\",value:function(e){var t=this,n=this.getModule(Rn),o=e.getElements()[0],s=n.getMessageOption(e.clientSequence);return this.doUploadVideo({file:s.payload.file,to:s.to,onProgress:function(e){if(o.updatePercent(e),it(s.onProgress))try{s.onProgress(e)}catch(t){return Ja({code:da.MESSAGE_ONPROGRESS_FUNCTION_ERROR})}}}).then((function(n){var s=n.location,a=n.snapshotInfo,r=t.isPrivateNetWork()?s:Mt(s);return o.updateVideoUrl(r),jt(a)||o.updateSnapshotInfo(a),e}))}},{key:\"_checkSizeError\",value:function(e){return Ja({code:da[\"MESSAGE_\".concat(e,\"_SIZE_LIMIT\")],message:this.getErrorMessage(\"UploadSizeLimit\",e.toLowerCase(),\"\".concat(this.UPLOAD_SIZE_LIMIT[e]/1048576,\" MB\"))})}},{key:\"doUploadImage\",value:function(e){var t=this;if(!e.file)return Ja({code:da.MESSAGE_IMAGE_SELECT_FILE_FIRST});var n=this._checkImageType(e.file);if(!0!==n)return n;var o=this._checkImageSize(e.file);if(!0!==o)return o;var s=null;return this._setUploadFileType(sr),this.uploadByCOS(e).then((function(e){return s=e,t.isPrivateNetWork()?At(e.location):At(\"https://\".concat(e.location))})).then((function(e){return s.width=e.width,s.height=e.height,Promise.resolve(s)}))}},{key:\"_checkImageType\",value:function(e){var t=\"\";return t=se?e.url.slice(e.url.lastIndexOf(\".\")+1):e.files[0].name.slice(e.files[0].name.lastIndexOf(\".\")+1),nr.indexOf(t.toLowerCase())>=0||Ja({code:da.MESSAGE_IMAGE_TYPES_LIMIT})}},{key:\"_checkImageSize\",value:function(e){var t=0;return 0===(t=se?e.size:e.files[0].size)?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):tthis.UPLOAD_SIZE_LIMIT.FILE?this._checkSizeError(\"FILE\"):0===e.file.files[0].size?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):(this._setUploadFileType(ir),this.uploadByCOS(e)):Ja({code:da.MESSAGE_FILE_SELECT_FILE_FIRST})}},{key:\"doUploadVideo\",value:function(e){return e.file.videoFile.size>this.UPLOAD_SIZE_LIMIT.VIDEO?this._checkSizeError(\"VIDEO\"):0===e.file.videoFile.size?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):-1===or.indexOf(e.file.videoFile.type)?Ja({code:da.MESSAGE_VIDEO_TYPES_LIMIT}):(this._setUploadFileType(ar),se?this.handleVideoUpload({file:e.file.videoFile,onProgress:e.onProgress}):ae?this.handleVideoUpload(e):void 0)}},{key:\"handleVideoUpload\",value:function(e){var t=this;return new Promise((function(n,o){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){t.uploadByCOS(e).then((function(e){n(e)})).catch((function(){o(new Wa({code:da.MESSAGE_VIDEO_UPLOAD_FAIL}))}))}))}))}},{key:\"doUploadAudio\",value:function(e){return e.file?e.file.size>this.UPLOAD_SIZE_LIMIT.AUDIO?this._checkSizeError(\"AUDIO\"):0===e.file.size?Ja({code:da.MESSAGE_FILE_IS_EMPTY}):(this._setUploadFileType(rr),this.uploadByCOS(e)):Ja({code:da.MESSAGE_AUDIO_UPLOAD_FAIL})}},{key:\"uploadByCOS\",value:function(e){var t=this;if(!it(this._cosUploadMethod))return this.outputWarning(\"PluginUndetected\"),Ja({code:da.COS_UNDETECTED});if(this.timUploadPlugin)return this._uploadWithPreSigUrl(e);var n=new ka(\"upload\"),o=\"\".concat(this._n,\".uploadByCOS\"),s=Date.now(),a=this._getFile(e);return new Promise((function(r,i){var u=se?t._createCosOptionsWXMiniApp(e):t._createCosOptionsWeb(e),c=t;t._cosUploadMethod(u,(function(e,u){var l=Object.create(null);if(u){if(e||st(u.files)&&u.files[0].error){var p=new Wa({code:da.MESSAGE_FILE_UPLOAD_FAIL});return n.setError(p,!0,t.getNetworkType()).end(),xe.l(\"\".concat(o,\" failed. error:\"),u.files[0].error),403===u.files[0].error.statusCode&&(xe.w(\"\".concat(o,\" failed. cos AccessKeyId was invalid, regain auth key!\")),t._getAuthorizationKey()),void i(p)}l.fileName=a.name,l.fileSize=a.size,l.fileType=a.type.slice(a.type.indexOf(\"/\")+1).toLowerCase(),l.location=se?u.Location:u.files[0].data.Location;var d=Date.now()-s,g=c._formatFileSize(a.size),_=c._formatSpeed(1e3*a.size/d),h=\"size:\".concat(g,\" time:\").concat(d,\"ms speed:\").concat(_);xe.l(\"\".concat(o,\" success. name:\").concat(a.name,\" \").concat(h)),r(l);var f=t.getModule($n);return f.addCost(Ma,d),f.addFileSize(Ma,a.size),void n.setNetworkType(t.getNetworkType()).setMessage(h).end()}var v=new Wa({code:da.MESSAGE_FILE_UPLOAD_FAIL});n.setError(v,!0,c.getNetworkType()).end(),xe.w(\"\".concat(o,\" failed. error:\"),e),403===e.statusCode&&(xe.w(\"\".concat(o,\" failed. cos AccessKeyId was invalid, regain auth key!\")),t._getAuthorizationKey()),i(v)}))}))}},{key:\"_uploadWithPreSigUrl\",value:function(e){var t=this,n=\"\".concat(this._n,\"._uploadWithPreSigUrl\"),o=this._getFile(e);return this._createCosOptionsPreSigUrl(e).then((function(e){return new Promise((function(s,a){var r=new ka(\"upload\"),i=e.requestSnapshotUrl,u=void 0===i?void 0:i,c=g(e,ci),l=Date.now();t._cosUploadMethod(c,(function(e,i){if(e||403===i.statusCode)return r.setError(new Wa(e),!0,t.getNetworkType()).end(),xe.l(\"\".concat(n,\" failed, error:\"),e),void a(new Wa({code:da.MESSAGE_FILE_UPLOAD_FAIL}));var p=Object.create(null),d=i.data.location||\"\";t.isPrivateNetWork()||0!==d.indexOf(\"https://\")&&0!==d.indexOf(\"http://\")||(d=d.split(\"//\")[1]),p.fileName=o.name,p.fileSize=o.size,p.fileType=o.type.slice(o.type.indexOf(\"/\")+1).toLowerCase(),p.location=d;var g=Date.now()-l,_=t._formatFileSize(o.size),h=t._formatSpeed(1e3*o.size/g),f=\"size:\".concat(_,\",time:\").concat(g,\"ms,speed:\").concat(h,\" res:\").concat(JSON.stringify(i.data));xe.l(\"\".concat(n,\" success name:\").concat(o.name,\",\").concat(f)),r.setNetworkType(t.getNetworkType()).setMessage(f).end();var v=t.getModule($n);v.addCost(Ma,g),v.addFileSize(Ma,o.size);var m=[];if(c.thumbUrl&&c.largeUrl&&(m=[t._getSmallImageInfoByUrl(c.thumbUrl,p),t._getLargeImageInfoByUrl(c.largeUrl,p)]),u&&m.push(t._getSnapshotInfoByUrl(u,p)),m.length>0)return Promise.all(m).then((function(){s(p)}));s(p)}))}))}))}},{key:\"_getRawOrUploadProxyUrl\",value:function(e){var t=this.getModule(qn).getFileUploadProxy(),n=e;return t&&(n=e.replace(/^https:\\/\\/[^/]+/,t)),n}},{key:\"_getFile\",value:function(e){var t;return st(e.file.files)||(t=e.file.files,\"filelist\"===ct(t))?e.file.files[0]:e.file}},{key:\"_formatFileSize\",value:function(e){return e<1024?e+\"B\":e<1048576?Math.floor(e/1024)+\"KB\":Math.floor(e/1048576)+\"MB\"}},{key:\"_formatSpeed\",value:function(e){return e<=1048576?bt(e/1024,1)+\"KB/s\":bt(e/1048576,1)+\"MB/s\"}},{key:\"_createCosOptionsWeb\",value:function(e){var t=this._getFile(e),n=t.name,o=n.slice(n.lastIndexOf(\".\")),s=this._genFileName(\"\".concat(_t(999999)).concat(o));return{files:[{Bucket:\"\".concat(this.bucketName,\"-\").concat(this.appid),Region:this.region,Key:\"\".concat(this.directory,\"/\").concat(s),Body:t}],SliceSize:1048576,onProgress:function(t){if(\"function\"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){xe.w(\"onProgress callback error:\",n)}},onFileFinish:function(e,t,n){}}}},{key:\"_createCosOptionsWXMiniApp\",value:function(e){var t=this._getFile(e),n=this._genFileName(t.name),o=t.url;return{Bucket:\"\".concat(this.bucketName,\"-\").concat(this.appid),Region:this.region,Key:\"\".concat(this.directory,\"/\").concat(n),FilePath:o,onProgress:function(t){if(xe.l(JSON.stringify(t)),\"function\"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){xe.w(\"onProgress callback error:\",n)}}}}},{key:\"_createCosOptionsPreSigUrl\",value:function(e){var t=this,n=\"\",o=\"\",s=0,a=this._getFile(e);if(se)n=this._genFileName(a.name),o=a.url,s=1;else{var r=a.name,i=r.slice(r.lastIndexOf(\".\"));n=this._genFileName(\"\".concat(_t(999999)).concat(i)),o=a,s=0}return this._getCosPreSigUrl({fileType:this.uploadFileType,fileName:n,uploadMethod:s,duration:this.duration}).then((function(s){var a=s.uploadUrl,r=s.downloadUrl,i=s.requestSnapshotUrl,u=void 0===i?void 0:i,c=s.thumbUrl,l=s.largeUrl;return{url:t._getRawOrUploadProxyUrl(a),fileType:t.uploadFileType,fileName:n,resources:o,downloadUrl:r,requestSnapshotUrl:u,thumbUrl:c,largeUrl:l,onProgress:function(t){if(\"function\"==typeof e.onProgress)try{e.onProgress(t.percent)}catch(n){xe.w(\"onProgress callback error:\",n),xe.e(n)}}}}))}},{key:\"_genFileName\",value:function(e){return\"\".concat(Rt(),\"-\").concat(e)}},{key:\"_setUploadFileType\",value:function(e){this.uploadFileType=e}},{key:\"_getSnapshotInfoByUrl\",value:function(e,t){var n=this,o=new ka(\"getSnapshotInfo\");return this.request({protocolName:qs,requestData:{platform:this.getPlatform(),coverName:this._genFileName(_t(99999)),requestSnapshotUrl:e}}).then((function(e){var n=(e.data||{}).snapshotUrl;return o.setMessage(\"snapshotUrl:\".concat(n)).end(),jt(n)?{}:At(n).then((function(e){t.snapshotInfo={snapshotUrl:n,snapshotWidth:e.width,snapshotHeight:e.height}}))})).catch((function(e){return xe.w(\"\".concat(n._n,\"._getSnapshotInfoByUrl failed. error:\"),e),o.setCode(e.errorCode).setMessage(e.errorInfo).end(),{}}))}},{key:\"_getSmallImageInfoByUrl\",value:function(e,t){return At(e).then((function(n){t.smallImageUrl=e,t.smallImageWidth=n.width,t.smallImageHeight=n.height}))}},{key:\"_getLargeImageInfoByUrl\",value:function(e,t){return At(e).then((function(n){t.largeImageUrl=e,t.largeImageWidth=n.width,t.largeImageHeight=n.height}))}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\"))}}]),s}(ro),pi=[\"downloadKey\",\"pbDownloadKey\",\"messageList\"],di=function(){function e(t){o(this,e),this._n=\"MergerMessageHandler\",this._messageModule=t}return a(e,[{key:\"uploadMergerMessage\",value:function(e,t){var n=this,o=\"\".concat(this._n,\".\").concat(\"uploadMergerMessage\");xe.d(\"\".concat(o,\" message:\"),e,\"messageBytes:\".concat(t));var s=e.payload.messageList,a=s.length,r=new ka(\"uploadMergerMessage\");return this._messageModule.request({protocolName:Ys,requestData:{messageList:s}}).then((function(e){xe.d(\"\".concat(o,\" ok. response:\"),e.data);var s=e.data,i=s.pbDownloadKey,u=s.downloadKey,c={pbDownloadKey:i,downloadKey:u,messageNumber:a};return r.setNetworkType(n._messageModule.getNetworkType()).setMessage(\"\".concat(a,\"-\").concat(t,\"-\").concat(u)).end(),c})).catch((function(e){throw xe.w(\"\".concat(o,\" failed. error:\"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),e}))}},{key:\"downloadMergerMessage\",value:function(e){var n=this,o=\"\".concat(this._n,\".\").concat(\"downloadMergerMessage\");xe.d(\"\".concat(o,\" message:\"),e);var s=e.payload.downloadKey,a=this._messageModule.getFileDownloadProxy(),r=new ka(\"downloadMergerMessage\");return r.setMessage(\"downloadKey:\".concat(s)),this._messageModule.request({protocolName:js,requestData:{downloadKey:s}}).then((function(s){if(xe.d(\"\".concat(o,\" ok. response:\"),s.data),it(e.clearElement)){var i=e.payload;i.downloadKey,i.pbDownloadKey,i.messageList;var u=g(i,pi);e.clearElement(),e.setElement({type:e.type,content:t({messageList:s.data.messageList},u)},a)}else{var c=[];s.data.messageList.forEach((function(e){if(!jt(e)){var t=new xa(e,a);c.push(t)}})),e.payload.messageList=c,e.payload.downloadKey=\"\",e.payload.pbDownloadKey=\"\"}return r.setNetworkType(n._messageModule.getNetworkType()).end(),e})).catch((function(e){throw xe.w(\"\".concat(o,\" failed. key:\").concat(s,\" error:\"),e),n._messageModule.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];r.setError(e,o,s).end()})),e}))}},{key:\"createMergerMessagePack\",value:function(e,t,n){return e.conversationType===S.CONV_C2C?this._createC2CMergerMessagePack(e,t,n):this._createGroupMergerMessagePack(e,t,n)}},{key:\"_createC2CMergerMessagePack\",value:function(e,t,n){var o=null;t&&(t.offlinePushInfo&&(o=t.offlinePushInfo),!0===t.onlineUserOnly&&(o?o.disablePush=!0:o={disablePush:!0}));var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push(\"NoUnread\"),!0===i&&s.push(\"NoLastMsg\"),!0===u&&s.push(\"NoMsgCheck\")}var c=\"\";et(e.cloudCustomData)&&e.cloudCustomData.length>0&&(c=e.cloudCustomData);var l=n.pbDownloadKey,p=n.downloadKey,d=n.messageNumber,g=e.payload,_=g.title,h=g.abstractList,f=g.compatibleText,v=this._messageModule.getModule(Gn),m=v&&v.isOnlineMessage(e,t)?0:void 0;return{protocolName:_o,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),toAccount:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:p,title:_,abstractList:h,compatibleText:f,messageNumber:d}}],cloudCustomData:c,clientTime:e.clientTime,msgSeq:e.sequence,msgRandom:e.random,msgLifeTime:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||\"\",desc:o.description||\"\",ext:o.extension||\"\",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||\"\"}}:void 0,messageControlInfo:0!==m?s:void 0,isSupportExtension:!0===e.isSupportExtension?1:0}}}},{key:\"_createGroupMergerMessagePack\",value:function(e,t,n){var o=null;t&&t.offlinePushInfo&&(o=t.offlinePushInfo);var s=[];if(ot(t)&&ot(t.messageControlInfo)){var a=t.messageControlInfo,r=a.excludedFromUnreadCount,i=a.excludedFromLastMessage,u=a.excludedFromContentModeration;!0===r&&s.push(\"NoUnread\"),!0===i&&s.push(\"NoLastMsg\"),!0===u&&s.push(\"NoMsgCheck\")}var c=\"\";et(e.cloudCustomData)&&e.cloudCustomData.length>0&&(c=e.cloudCustomData);var l=n.pbDownloadKey,p=n.downloadKey,d=n.messageNumber,g=e.payload,_=g.title,h=g.abstractList,f=g.compatibleText,v=this._messageModule.getModule(Un),m=v&&v.isOnlineMessage(e,t)?1:0;return{protocolName:ho,tjgID:this._messageModule.generateTjgID(e),requestData:{fromAccount:this._messageModule.getMyUserID(),groupID:e.to,msgBody:[{msgType:e.type,msgContent:{pbDownloadKey:l,downloadKey:p,title:_,abstractList:h,compatibleText:f,messageNumber:d}}],random:e.random,priority:e.priority,clientSequence:e.clientSequence,groupAtInfo:void 0,cloudCustomData:c,onlineOnlyFlag:m,offlinePushInfo:o?{pushFlag:!0===o.disablePush?1:0,title:o.title||\"\",desc:o.description||\"\",ext:o.extension||\"\",apnsInfo:{badgeMode:!0===o.ignoreIOSBadge?1:0},androidInfo:{OPPOChannelID:o.androidOPPOChannelID||\"\"}}:void 0,clientTime:e.clientTime,needReadReceipt:!0!==e.needReadReceipt||v.isMessageFromOrToAVChatroom(e.to)?0:1,messageControlInfo:0===m?s:void 0,isSupportExtension:!0===e.isSupportExtension?1:0}}}}]),e}(),gi={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,MESSAGE_SEND_FAIL:2100,OVER_FREQUENCY_LIMIT:2996},_i=[da.MESSAGE_ONPROGRESS_FUNCTION_ERROR,da.MESSAGE_IMAGE_SELECT_FILE_FIRST,da.MESSAGE_IMAGE_TYPES_LIMIT,da.MESSAGE_FILE_IS_EMPTY,da.MESSAGE_IMAGE_SIZE_LIMIT,da.MESSAGE_FILE_SELECT_FILE_FIRST,da.MESSAGE_FILE_SIZE_LIMIT,da.MESSAGE_VIDEO_SIZE_LIMIT,da.MESSAGE_VIDEO_TYPES_LIMIT,da.MESSAGE_AUDIO_UPLOAD_FAIL,da.MESSAGE_AUDIO_SIZE_LIMIT,da.COS_UNDETECTED];function hi(e){var t=!1;return Object.values(gi).includes(e)&&(t=!0),(e>=120001&&e<=13e4||e>=10100&&e<=10200)&&(t=!0),t}var fi=function(e){i(s,e);var n=f(s);function s(e){var t;return o(this,s),(t=n.call(this,e))._n=\"MessageModule\",t._messageOptionsMap=new Map,t._mergerMessageHandler=new di(_(t)),t}return a(s,[{key:\"createTextMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=\"string\"==typeof e.payload?e.payload:e.payload.text,s=new La({text:o}),a=this._getNickAndAvatarByUserID(t);return n.setElement(s),n.setNickAndAvatar(a),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"createImageMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e);if(se){var o=e.payload.file;if(Ze(o))return void this.outputWarning(\"FileUnsupportedInMP\",\"createImageMessage\");var s=o.tempFiles[0].path||o.tempFiles[0].tempFilePath,a={url:s,name:s.slice(s.lastIndexOf(\"/\")+1),size:o.tempFiles&&o.tempFiles[0].size||1,type:s.slice(s.lastIndexOf(\".\")+1).toLowerCase()};e.payload.file=a}else if(ae)if(Ze(e.payload.file)){var r=e.payload.file;e.payload.file={files:[r]}}else if(ot(e.payload.file)&&\"undefined\"!=typeof uni){var i=e.payload.file.tempFiles[0];e.payload.file={files:[i]}}var u=new Aa({imageFormat:Ve.UNKNOWN,uuid:this._generateUUID(e.payload.file),file:e.payload.file}),c=this._getNickAndAvatarByUserID(t);return n.setElement(u),n.setNickAndAvatar(c),n.setNameCard(this._getNameCardByGroupID(n)),this._messageOptionsMap.set(n.clientSequence,e),n}},{key:\"createAudioMessage\",value:function(e){var t=e.payload.file;if(se){var n={url:t.tempFilePath,name:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(\"/\")+1),size:t.fileSize,second:parseInt(t.duration)/1e3,type:t.tempFilePath.slice(t.tempFilePath.lastIndexOf(\".\")+1).toLowerCase()};e.payload.file=n}var o=this.getMyUserID();e.currentUser=o,e.senderTinyID=this.getMyTinyID();var s=new Ha(e),a=new Na({second:Math.floor(t.duration/1e3),size:t.fileSize||t.size,url:t.tempFilePath,uuid:this._generateUUID(e.payload.file)}),r=this._getNickAndAvatarByUserID(o);return s.setElement(a),s.setNickAndAvatar(r),s.setNameCard(this._getNameCardByGroupID(s)),this._messageOptionsMap.set(s.clientSequence,e),s}},{key:\"createVideoMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID(),e.payload.file.thumbUrl=\"\",e.payload.file.thumbSize=0;var n={};if(se){if(ee)return void this.outputWarning(\"VideoUnsupportedInAlipay\");if(Ze(e.payload.file))return void this.outputWarning(\"FileUnsupportedInMP\",\"createVideoMessage\");var o=e.payload.file;st(o.tempFiles)&&(o=o.tempFiles[0]),n.url=o.tempFilePath,n.name=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(\"/\")+1),n.size=o.size||1,n.second=o.duration||0,n.type=o.tempFilePath.slice(o.tempFilePath.lastIndexOf(\".\")+1).toLowerCase()}else if(ae){if(Ze(e.payload.file)){var s=e.payload.file;e.payload.file.files=[s]}else if(ot(e.payload.file)&&\"undefined\"!=typeof uni){var a=e.payload.file.tempFile;e.payload.file.files=[a]}var r=e.payload.file;n.url=window.URL.createObjectURL(r.files[0]),n.name=r.files[0].name,n.size=r.files[0].size||1,n.second=r.files[0].duration||0,n.type=r.files[0].type.split(\"/\")[1]}e.payload.file.videoFile=n;var i=new Ha(e),u=new Fa({videoFormat:n.type,videoSecond:bt(n.second,0),videoSize:n.size,remoteVideoUrl:\"\",videoUrl:n.url,videoUUID:this._generateUUID(e.payload.file.videoFile),thumbUUID:this._generateUUID(e.payload.file.videoFile),thumbWidth:e.payload.file.width||200,thumbHeight:e.payload.file.height||200,thumbUrl:e.payload.file.thumbUrl,thumbSize:e.payload.file.thumbSize,thumbFormat:e.payload.file.thumbUrl.slice(e.payload.file.thumbUrl.lastIndexOf(\".\")+1).toLowerCase()}),c=this._getNickAndAvatarByUserID(t);return i.setElement(u),i.setNickAndAvatar(c),i.setNameCard(this._getNameCardByGroupID(i)),this._messageOptionsMap.set(i.clientSequence,e),i}},{key:\"createCustomMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=new wa({data:e.payload.data,description:e.payload.description,extension:e.payload.extension}),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"createFaceMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=new Ra(e.payload),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"createMergerMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=this._getNickAndAvatarByUserID(t),o=new Ha(e),s=new Va(e.payload);return o.setElement(s),o.setNickAndAvatar(n),o.setNameCard(this._getNameCardByGroupID(o)),o.setRelayFlag(!0),o}},{key:\"createForwardMessage\",value:function(e){var t=e.to,n=e.conversationType,o=e.priority,s=e.payload,a=e.needReadReceipt,r=e.receiverList,i=this.getMyUserID(),u=this._getNickAndAvatarByUserID(i);if(s.type===S.MSG_GRP_TIP)return Ja({code:da.MESSAGE_FORWARD_TYPE_INVALID});var c={to:t,conversationType:n,conversationID:\"\".concat(n).concat(t),priority:o,isPlaceMessage:0,status:Qt.UNSEND,currentUser:i,senderTinyID:this.getMyTinyID(),cloudCustomData:e.cloudCustomData||s.cloudCustomData||\"\",needReadReceipt:a,receiverList:r,isSupportExtension:e.isSupportExtension||!1},l=new Ha(c);return l.setElement(s.getElements()[0]),l.setNickAndAvatar(u),l.setNameCard(this._getNameCardByGroupID(s)),l.setRelayFlag(!0),l}},{key:\"downloadMergerMessage\",value:function(e){return this._mergerMessageHandler.downloadMergerMessage(e)}},{key:\"createFileMessage\",value:function(e){if(se){if(!X&&!Q&&!ne)return;var n=re.getSystemInfoSync().SDKVersion;if(X&&Ot(n,\"2.5.0\")<0)return void this.outputWarning(\"WXChooseMessageFile\");if(Q&&Ot(n,\"1.18.0\")<0)return void this.outputWarning(\"QQChooseMessageFile\")}if(ae||ne){if(Ze(e.payload.file)){var o=e.payload.file;e.payload.file={files:[o]}}else if(ot(e.payload.file)&&\"undefined\"!=typeof uni){var s=e.payload.file,a=s.tempFiles,r=s.files,i=null;st(a)?i=a[0]:st(r)&&(i=r[0]),e.payload.file={files:[i]}}}else if(X||Q){var u=e.payload.file.tempFiles,c=t(t({},u[0]),{},{url:u[0].path});e.payload.file={files:[c]}}var l=this.getMyUserID();e.currentUser=l,e.senderTinyID=this.getMyTinyID();var p=new Ha(e),d=new ba({uuid:this._generateUUID(e.payload.file),file:e.payload.file}),g=this._getNickAndAvatarByUserID(l);return p.setElement(d),p.setNickAndAvatar(g),p.setNameCard(this._getNameCardByGroupID(p)),this._messageOptionsMap.set(p.clientSequence,e),p}},{key:\"createLocationMessage\",value:function(e){var t=this.getMyUserID();e.currentUser=t,e.senderTinyID=this.getMyTinyID();var n=new Ha(e),o=new qa(e.payload),s=this._getNickAndAvatarByUserID(t);return n.setElement(o),n.setNickAndAvatar(s),n.setNameCard(this._getNameCardByGroupID(n)),n}},{key:\"_onCannotFindModule\",value:function(){return Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"sendMessageInstance\",value:function(e,t){var n=this;if(!1===this.getModule(no).filterMessage(e,t))return this._onSendMessageFailed(e,new Wa({code:da.PROFANITY_FOUND}));var o,s=null;switch(e.conversationType){case S.CONV_C2C:if(!(s=this.getModule(Gn)))return this._onCannotFindModule();break;case S.CONV_GROUP:if(!(s=this.getModule(Un)))return this._onCannotFindModule();if(Tt({groupID:e.to})){var a=s.getLocalGroupProfile(e.to);if(a&&a.isSupportTopic)return Ja({code:da.MESSAGE_SEND_GROUP_WITH_TOPIC_FAIL})}break;default:return Ja({code:da.MESSAGE_SEND_INVALID_CONVERSATION_TYPE})}var r=this.getModule(Kn),i=this.getModule(Un);return r.upload(e).then((function(){n._getSendMessageSpecifiedKey(e)===ma&&n.getModule($n).addSuccessCount(Ma);return i.guardForAVChatRoom(e).then((function(){if(!e.isSendable())return Ja({code:da.MESSAGE_FILE_URL_IS_EMPTY});n._addSendMessageTotalCount(e),o=Date.now();var a=function(e){var t=\"utf-8\";ae&&document&&(t=document.charset.toLowerCase());var n,o,s=0;if(o=e.length,\"utf-8\"===t||\"utf8\"===t)for(var a=0;a11264?n._mergerMessageHandler.uploadMergerMessage(e,a).then((function(o){var s=n._mergerMessageHandler.createMergerMessagePack(e,t,o);return n.request(s)})):(n.getModule(Fn).setMessageRandom(e),e.conversationType===S.CONV_C2C||e.conversationType===S.CONV_GROUP?s.sendMessage(e,t):void 0)})).then((function(a){var r=a.data,i=r.time,u=r.sequence,c=r.readReceiptCode;$e(c)&&0!==c&&(new ka(\"sendMessageWithReceipt\").setMessage(\"from:\".concat(e.from,\" to:\").concat(e.to,\" sequence:\").concat(u,\" readReceiptCode:\").concat(c)).end(),xe.w(\"\".concat(n._n,\".sendMessageInstance readReceiptCode:\").concat(c,\" message:\").concat(n.getErrorMessage(c))));n._addSendMessageSuccessCount(e,o),n._messageOptionsMap.delete(e.clientSequence);var l=n.getModule(Fn);e.status=Qt.SUCCESS,e.time=i;var p=!1;if(e.conversationType===S.CONV_GROUP)e.sequence=u;else if(e.conversationType===S.CONV_C2C){var d=l.getLatestMessageSentByMe(e.conversationID);if(d){var g=d.nick,_=d.avatar;g===e.nick&&_===e.avatar||(p=!0)}}if(p&&l.modifyMessageSentByMe({conversationID:e.conversationID,latestNick:e.nick,latestAvatar:e.avatar}),s.isOnlineMessage(e,t))e._onlineOnlyFlag=!0;else{l.appendToMessageList(e);var h=e;ot(t)&&ot(t.messageControlInfo)&&(!0===t.messageControlInfo.excludedFromLastMessage&&(e._isExcludedFromLastMessage=!0,h=\"\"),!0===t.messageControlInfo.excludedFromUnreadCount&&(e._isExcludedFromUnreadCount=!0));var f=e.conversationType;if(Dt(e.to))f=S.CONV_TOPIC,n.getModule(wn).onMessageSent({groupID:qt(e.to),topicID:e.to,lastMessage:h});l.onMessageSent({conversationOptionsList:[{conversationID:e.conversationID,unreadCount:0,type:f,subType:e.conversationSubType,lastMessage:h}]})}return e.getRelayFlag()||\"TIMImageElem\"!==e.type||Ut(e.payload.imageInfoArray),Ka({message:e})}))})).catch((function(t){return n._onSendMessageFailed(e,t)}))}},{key:\"_onSendMessageFailed\",value:function(e,t){e.status=Qt.FAIL,this.getModule(Fn).deleteMessageRandom(e),this._addSendMessageFailCountOnUser(e,t);var n=new ka(\"sendMessage\");return n.setMessage(\"tjg_id:\".concat(this.generateTjgID(e),\" type:\").concat(e.type,\" from:\").concat(e.from,\" to:\").concat(e.to)),this.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];n.setError(t,s,a).end()})),xe.e(\"\".concat(this._n,\"._onSendMessageFailed error:\"),t),Ja(new Wa({code:t&&t.code?t.code:da.MESSAGE_SEND_FAIL,message:t&&t.message?t.message:void 0,data:{message:e}}))}},{key:\"_getSendMessageSpecifiedKey\",value:function(e){if([S.MSG_IMAGE,S.MSG_AUDIO,S.MSG_VIDEO,S.MSG_FILE].includes(e.type))return ma;if(e.conversationType===S.CONV_C2C)return ha;if(e.conversationType===S.CONV_GROUP){var t=this.getModule(Un).getLocalGroupProfile(e.to);if(!t)return;var n=t.type;return Ct(n)?va:fa}}},{key:\"_addSendMessageTotalCount\",value:function(e){var t=this._getSendMessageSpecifiedKey(e);t&&this.getModule($n).addTotalCount(t)}},{key:\"_addSendMessageSuccessCount\",value:function(e,t){var n=Math.abs(Date.now()-t),o=this._getSendMessageSpecifiedKey(e);if(o){var s=this.getModule($n);s.addSuccessCount(o),s.addCost(o,n)}}},{key:\"_addSendMessageFailCountOnUser\",value:function(e,t){var n,o,s=t.code,a=void 0===s?-1:s,r=this.getModule($n),i=this._getSendMessageSpecifiedKey(e);i===ma&&(n=a,o=!1,_i.includes(n)&&(o=!0),o)?r.addFailedCountOfUserSide(Ma):hi(a)&&i&&r.addFailedCountOfUserSide(i)}},{key:\"resendMessage\",value:function(e){return e.isResend=!0,e.status=Qt.UNSEND,this.sendMessageInstance(e)}},{key:\"revokeMessage\",value:function(e){var t=this,n=null;if(e.conversationType===S.CONV_C2C?n=this.getModule(Gn):e.conversationType===S.CONV_GROUP&&(n=this.getModule(Un)),!n)return this._onCannotFindModule();var o=new ka(\"revokeMessage\");o.setMessage(\"tjg_id:\".concat(this.generateTjgID(e),\" type:\").concat(e.type,\" from:\").concat(e.from,\" to:\").concat(e.to));var s=\"\".concat(this._n,\".\").concat(\"revokeMessage\");return n.revokeMessage(e).then((function(n){var a=n.data.recallRetList;if(!jt(a)&&0!==a[0].retCode){var r=new Wa({code:a[0].retCode,data:{message:e}});return o.setCode(r.code).setMoreMessage(r.message).end(),Ja(r)}return xe.i(\"\".concat(s,\" ok. ID:\").concat(e.ID)),e.isRevoked=!0,o.end(),t.getModule(Fn).onMessageRevoked([e]),Ka({message:e})})).catch((function(n){t.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];o.setError(n,s,a).end()}));var a=new Wa({code:n&&n.code?n.code:da.MESSAGE_REVOKE_FAIL,message:n&&n.message?n.message:void 0,data:{message:e}});return xe.w(\"\".concat(s,\" failed. error:\"),n),Ja(a)}))}},{key:\"deleteMessage\",value:function(e){var t=this,n=null,o=e[0],s=o.conversationID,a=\"\",r=[],i=[];if(o.conversationType===S.CONV_C2C)n=this.getModule(Gn),a=s.replace(S.CONV_C2C,\"\"),e.forEach((function(e){e&&e.status===Qt.SUCCESS&&e.conversationID===s&&(e._onlineOnlyFlag||r.push(\"\".concat(e.sequence,\"_\").concat(e.random,\"_\").concat(e.time)),i.push(e))}));else if(o.conversationType===S.CONV_GROUP)n=this.getModule(Un),a=s.replace(S.CONV_GROUP,\"\"),e.forEach((function(e){e&&e.status===Qt.SUCCESS&&e.conversationID===s&&(e._onlineOnlyFlag||r.push(\"\".concat(e.sequence)),i.push(e))}));else if(o.conversationType===S.CONV_SYSTEM)return Ja({code:da.CANNOT_DELETE_GROUP_SYSTEM_NOTICE});if(!n)return this._onCannotFindModule();if(0===r.length)return this._onMessageDeleted(i);r.length>30&&(r=r.slice(0,30),i=i.slice(0,30));var u=new ka(\"deleteMessage\");u.setMessage(\"to:\".concat(a,\" count:\").concat(r.length));var c=\"\".concat(this._n,\".\").concat(\"deleteMessage\");return n.deleteMessage({to:a,keyList:r}).then((function(e){return u.end(),xe.i(\"\".concat(c,\" ok\")),t._onMessageDeleted(i)})).catch((function(e){t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.w(\"\".concat(c,\" failed. error:\"),e);var n=new Wa({code:e&&e.code?e.code:da.MESSAGE_DELETE_FAIL,message:e&&e.message?e.message:void 0});return Ja(n)}))}},{key:\"_onMessageDeleted\",value:function(e){return this.getModule(Fn).onMessageDeleted(e),za({messageList:e})}},{key:\"translateText\",value:function(e){var n=\"\".concat(this._n,\".\").concat(\"translateText\"),o=e.sourceTextList,s=e.sourceLanguage,a=e.targetLanguage,r=new ka(\"translateText\");return r.setMessage(\"sourceLanguage:\".concat(s,\" targetLanguage:\").concat(a)),this.request({protocolName:pa,requestData:{sourceTextList:o,source:s||\"auto\",target:a,from:this.getMyTinyID(),SDKAppID:this.getSDKAppID()}}).then((function(e){var o=e.data,s=o.error,a=o.requestID,i=o.translatedTextList;if(0===s.code)return r.end(),xe.i(\"\".concat(n,\" ok. requestID:\").concat(a)),Ka({translatedTextList:i});throw t(t({},s),{},{requestID:a})})).catch((function(e){return r.setCode(e.code).setMoreMessage(e.requestID).end(),xe.w(\"\".concat(n,\" failed. error:\"),e),Ja({code:da.TRANSLATE_TEXT_FAIL})}))}},{key:\"modifyRemoteMessage\",value:function(e){var t=this,n=null,o=e.conversationType,s=e.to;if(this.getModule(Un).isMessageFromOrToAVChatroom(s))return Ja({code:da.MESSAGE_MODIFY_DISABLED_IN_AVCHATROOM,data:{message:e}});if(!1===this.getModule(no).filterMessage(e))return Ja({code:da.PROFANITY_FOUND,data:{message:e}});o===S.CONV_C2C?n=this.getModule(Gn):o===S.CONV_GROUP&&(n=this.getModule(Un));var a=new ka(\"modifyMessage\");a.setMessage(\"to:\".concat(s));var r=\"\".concat(this._n,\".modifyRemoteMessage\");return n.modifyRemoteMessage(e).then((function(n){a.end(),xe.i(\"\".concat(r,\" ok\"));var o=t._onModifyRemoteMessageResp(e,n.data);return Ka({message:o})})).catch((function(n){if(a.setCode(n.code).setMoreMessage(n.message).end(),xe.w(\"\".concat(r,\" failed. error:\"),n),20027===n.code){var o=t._onModifyRemoteMessageResp(e,n.data);return Ja({code:da.MESSAGE_MODIFY_CONFLICT,data:{message:o}})}return Ja({code:n.code,message:n.message,data:{message:e}})}))}},{key:\"_onModifyRemoteMessageResp\",value:function(e,t){xe.d(\"\".concat(this._n,\"._onModifyRemoteMessageResp options:\"),t);var n=e.conversationType,o=e.from,s=e.to,a=e.random,r=e.sequence,i=e.time,u=t.elements,c=t.messageVersion,l=t.cloudCustomData,p=void 0===l?\"\":l;return this.getModule(Fn).onMessageModified({conversationType:n,from:o,to:s,time:i,random:a,sequence:r,elements:u,cloudCustomData:p,messageVersion:c})}},{key:\"_generateUUID\",value:function(e){var t=this.getModule(qn),n=\"\".concat(t.getSDKAppID(),\"-\").concat(t.getUserID(),\"-\").concat(function(){for(var e=\"\",t=32;t>0;--t)e+=ht[Math.floor(Math.random()*ft)];return e}()),o=e.name||e.value||e.url||e.tempFilePath,s=o&&o.slice(o.lastIndexOf(\".\")+1);return s&&(n=\"\".concat(n,\".\").concat(s)),n}},{key:\"getMessageOption\",value:function(e){return this._messageOptionsMap.get(e)}},{key:\"_getNickAndAvatarByUserID\",value:function(e){return this.getModule(On).getNickAndAvatarByUserID(e)}},{key:\"_getNameCardByGroupID\",value:function(e){if(e.conversationType===S.CONV_GROUP){var t=this.getModule(Un);if(t)return t.getMyNameCardByGroupID(e.to)}return\"\"}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._messageOptionsMap.clear()}}]),s}(ro),vi=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"MessageExtensionModule\",s.messageExtensionMap=new Map,s.globalSeqMap=new Map,s.getMessageExtensionsMap=new Map,s}return a(n,[{key:\"onMessageExtensionNotify\",value:function(e){var t=this,n=e.dataList,o=n.messageInfo,s=n.operateType,a=n.operateResultList,r=n.tinyID,i=n.globalSequence,u=o.clientTime,c=o.random,l=\"\".concat(r,\"-\").concat(u,\"-\").concat(c),p=[],d=[];xe.l(\"\".concat(this._n,\".onMessageExtensionNotify messageID:\").concat(l,\" operateType:\").concat(s,\" globalSequence:\").concat(i)),this._updateGlobalSequence(l,i);var g=!1,_=!1;a.forEach((function(e){var n=e.extensions,o=void 0===n?[]:n,a=e.clearSequence;if(1===s)g=!0,o.forEach((function(e){p.push({key:e.key,value:e.value})})),t._updateLocalExtension(l,o);else if(2===s)_=!0,o.forEach((function(e){d.push(e.key)})),t._updateLocalExtension(l,o);else if(3===s){if(_=!0,t._hasLocalExtension(l))t._getLocalExtension(l).forEach((function(e,t){e.seq<=a&&!jt(e.value)&&d.push(t)}));t._clearLocalExtension(l,a)}})),g&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_UPDATED,{messageID:l,extensions:p}),_&&this.emitOuterEvent(E.MESSAGE_EXTENSIONS_DELETED,{messageID:l,keyList:d})}},{key:\"setMessageExtensions\",value:function(e,t){var n=this;if(!this.canIUse(B.MSG_EXT))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var o=\"\".concat(this._n,\".\").concat(\"setMessageExtensions\"),s=e.ID,a=e.conversationID,r=e.sequence,i=e.time,u=m(t);t.length>20&&(u=t.slice(0,20),xe.w(\"\".concat(o,\". the length of extensions cannot exceed 20.\")));var c=\"conversationID:\".concat(a,\" messageID:\").concat(s,\" sequence:\").concat(r,\" time:\").concat(i,\" count:\").concat(u.length),l=new ka(\"setMessageExtensions\");return l.setMessage(c),xe.l(\"\".concat(o,\" \").concat(c)),this._modifyMessageExtensions(e,u).then((function(e){var t=e.resultList,n=e.successCount,s=e.failureCount,a=\"success count:\".concat(n,\" fail count:\").concat(s);return l.setMoreMessage(a).end(),xe.l(\"\".concat(o,\" ok. \").concat(a)),Ka({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];l.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"getMessageExtensions\",value:function(e){var t=this;if(!this.canIUse(B.MSG_EXT))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var n=\"\".concat(this._n,\".\").concat(\"getMessageExtensions\"),o=e.ID,s=e.conversationID,a=e.sequence,r=e.time,i=\"conversationID:\".concat(s,\" messageID:\").concat(o,\" sequence:\").concat(a,\" time:\").concat(r),u=new ka(\"getMessageExtensions\");u.setMessage(i),xe.l(\"\".concat(n,\" \").concat(i));var c=void 0;return this.getMessageExtensionsMap.has(o)&&(c=this._getGlobalSequence(o)),this._getMessageExtensions(e,c).then((function(e){return u.end(),xe.l(\"\".concat(n,\" ok. total count:\").concat(e.length)),at(c)&&e.length>0&&t.getMessageExtensionsMap.set(o,1),Ka({extensions:e})})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];u.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"deleteMessageExtensions\",value:function(e,t){var n=this;if(!this.canIUse(B.MSG_EXT))return Ja({code:da.CANNOT_USE_COMMERCIAL_ABILITY});var o=\"\".concat(this._n,\".\").concat(\"deleteMessageExtensions\"),s=[],a=3;jt(t)||(a=2,t.forEach((function(e){s.push({key:e,value:\"\",seq:0})})));var r=e.ID,i=e.conversationID,u=e.sequence,c=e.time,l=\"conversationID:\".concat(i,\" messageID:\").concat(r,\" sequence:\").concat(u,\" time:\").concat(c,\" operateType:\").concat(a),p=new ka(\"deleteMessageExtensions\");return p.setMessage(l),xe.l(\"\".concat(o,\" \").concat(l)),this._modifyMessageExtensions(e,s,a).then((function(e){var t=e.resultList,n=e.successCount,s=e.failureCount,r=\"\";return 2===a&&(r=\"success count:\".concat(n,\" fail count:\").concat(s)),p.setMoreMessage(\"\".concat(r)).end(),xe.l(\"\".concat(o,\" ok. \").concat(r)),Ka({extensions:t})})).catch((function(e){return n.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];p.setError(e,o,s).end()})),xe.e(\"\".concat(o,\" failed. error:\"),e),Ja(e)}))}},{key:\"_modifyMessageExtensions\",value:function(e,t){var n=this,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1,s=Dt(e.to)?S.CONV_TOPIC:e.conversationType,a=void 0;3!==o&&(a=this._getRequestExtensions(e,t));var r=null;switch(s){case S.CONV_C2C:r=this.getModule(Gn);break;case S.CONV_GROUP:r=this.getModule(Un);break;case S.CONV_TOPIC:r=this.getModule(wn);break;default:return Ja({code:da.CANNOT_FIND_MODULE})}return r.modifyMessageExtensions(e,a,o).then((function(t){var o=t.data,s=o.extensions,a=o.seq,r=[],i=0,u=0,c=[];return(s=jt(s)?[]:s).forEach((function(e){var t=e.errorCode,n=e.extension,o=n.key,s=n.value,a=n.seq;r.push({code:t,key:o,value:s}),0===t?i++:u++,c.push({key:o,value:s,seq:a})})),n._updateGlobalSequence(e.ID,a),c.length>0&&(n._updateLocalExtension(e.ID,c),c=null),{resultList:r,successCount:i,failureCount:u}})).catch((function(e){return Ja(e)}))}},{key:\"_getRequestExtensions\",value:function(e,t){var n=[];if(this._hasLocalExtension(e.ID)){var o=this._getLocalExtension(e.ID);return t.forEach((function(e){var t=e.key,s=e.value,a=0;o.has(t)&&(a=o.get(t).seq),n.push({key:t,value:s,seq:a})})),n}return t.forEach((function(e){var t=e.key,o=e.value;n.push({key:t,value:o,seq:0})})),n}},{key:\"_getMessageExtensions\",value:function(e,t){var n=this,o=\"\".concat(this._n,\"._getMessageExtensions\"),s=e.ID,a=e.to,r=null;switch(Dt(a)?S.CONV_TOPIC:e.conversationType){case S.CONV_C2C:r=this.getModule(Gn);break;case S.CONV_GROUP:r=this.getModule(Un);break;case S.CONV_TOPIC:r=this.getModule(wn);break;default:return Ja({code:da.CANNOT_FIND_MODULE})}return r.getMessageExtensions(e,t).then((function(t){var a=t.data,r=a.extensions,i=a.completeFlag,u=a.globalSequence,c=a.clearSequence;if(r=jt(r)?[]:r,xe.l(\"\".concat(o,\" ok. completeFlag:\").concat(i,\" globalSequence:\").concat(u,\" clearSequence:\").concat(c,\" count:\").concat(r.length)),n._updateLocalExtension(s,r),n._clearLocalExtension(s,c),n._updateGlobalSequence(s,u),1!==i){var l=r.slice(-1)[0].seq+1;return n._getMessageExtensions(e,l)}return n._getLocalExtensions(s)})).catch((function(e){return Ja(e)}))}},{key:\"_hasLocalExtension\",value:function(e){return this.messageExtensionMap.has(e)}},{key:\"_getLocalExtension\",value:function(e){return this.messageExtensionMap.get(e)}},{key:\"_updateLocalExtension\",value:function(e,t){this._hasLocalExtension(e)||this.messageExtensionMap.set(e,new Map);var n=this._getLocalExtension(e);t.forEach((function(e){var t=e.key,o=e.value,s=void 0===o?\"\":o,a=e.seq;n.set(t,{value:s,seq:a})}))}},{key:\"_clearLocalExtension\",value:function(e,t){if(!(t<=0)&&this._hasLocalExtension(e)){var n=this._getLocalExtension(e);n.forEach((function(e,o){e.seq<=t&&n.delete(o)}))}}},{key:\"_getLocalExtensions\",value:function(e){var t=[];this._hasLocalExtension(e)&&this._getLocalExtension(e).forEach((function(e,n){var o=e.value;jt(o)||t.push({key:n,value:o})}));return t}},{key:\"_getGlobalSequence\",value:function(e){return this.globalSeqMap.get(e)}},{key:\"_updateGlobalSequence\",value:function(e,t){this.globalSeqMap.set(e,t)}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this.messageExtensionMap.clear(),this.globalSeqMap.clear(),this.getMessageExtensionsMap.clear()}}]),n}(ro),mi=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"ComboMessageModule\",s}return a(n,[{key:\"sendMessage\",value:function(e){var t=this,n=this._constructMessageInstance(e);if(null===n)return Ja({code:da.MESSAGE_SEND_FAIL});this._addSendMessageTotalCount(n);var o=Date.now();return this.getModule(Fn).setMessageRandom(n),this._sendComboMessage(n,e).then((function(e){var s=e.data,a=s.time,r=s.sequence,i=s.readReceiptCode;$e(i)&&0!==i&&(new ka(\"sendMessageWithReceipt\").setMessage(\"from:\".concat(n.from,\" to:\").concat(n.to,\" sequence:\").concat(r,\" readReceiptCode:\").concat(i)).end(),xe.w(\"\".concat(t._n,\".sendMessage readReceiptCode:\").concat(i,\" message:\").concat(t.getErrorMessage(i))));t._addSendMessageSuccessCount(n,o);var u=t.getModule(Fn);n.status=Qt.SUCCESS,n.time=a,n.conversationType===S.CONV_GROUP&&(n.sequence=r),u.appendToMessageList(n);var c=n;return!0===n._isExcludedFromLastMessage&&(c=\"\"),u.onMessageSent({conversationOptionsList:[{conversationID:n.conversationID,unreadCount:0,type:n.conversationType,subType:n.conversationSubType,lastMessage:c}]}),Ka({message:n})})).catch((function(e){return t._onSendMessageFailed(n,e)}))}},{key:\"_sendComboMessage\",value:function(e,t){var n=this._m.getModule(jn),o=\"\";return e.conversationType===S.CONV_C2C&&(o=\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.SEND_MESSAGE)),e.conversationType===S.CONV_GROUP&&(o=\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.SEND_GROUP_MESSAGE)),n.sendComboMessage({servcmd:o,data:t})}},{key:\"_constructMessageInstance\",value:function(e){var t=\"\".concat(this._n,\"._constructMessageInstance\"),n=null;try{var o=this.getMyUserID(),s={};if(s.senderTinyID=this.getMyTinyID(),s.currentUser=o,s.from=e.From_Account||o,e.GroupId?(s.conversationID=\"\".concat(S.CONV_GROUP).concat(e.GroupId),s.conversationType=S.CONV_GROUP,s.to=e.GroupId):e.To_Account&&(s.conversationID=\"\".concat(S.CONV_C2C).concat(e.To_Account),s.conversationType=S.CONV_C2C,s.to=e.To_Account),s.time=e.MsgTimeStamp||0,s.random=e.Random||e.MsgRandom||0,s.priority=e.MsgPriority,et(e.CloudCustomData)&&e.CloudCustomData.length>0&&(s.cloudCustomData=e.CloudCustomData),st(e.SendMsgControl)&&(s.messageControlInfo={},e.SendMsgControl.includes(\"NoUnread\")&&(s.messageControlInfo.excludedFromUnreadCount=1),e.SendMsgControl.includes(\"NoLastMsg\")&&(s.messageControlInfo.excludedFromLastMessage=1)),s.conversationType===S.CONV_GROUP&&st(e.To_Account)&&e.To_Account.length>0){var a=e.To_Account;e.To_Account.length>50&&(a=e.To_Account.slice(0,50),xe.w(\"\".concat(t,\" To_Account must be less than or equal to 50.\"))),s.receiverList=m(a),e.To_Account=m(a)}1!==e.IsNeedReadReceipt&&1!==e.NeedReadReceipt||(s.needReadReceipt=!0),1===e.SupportMessageExtension&&(s.isSupportExtension=!0),(n=new Ha(s)).status=Qt.UNSEND,e.MsgClientTime=n.clientTime,n.conversationType===S.CONV_C2C&&(e.MsgSeq=n.sequence);for(var r,i=e.MsgBody.length,u=0;u100)return n--,t;if(st(t)){var s=t.map((function(t){return nt(t)?e(t,o):t}));return n--,s}if(nt(t)){var a=(r=t,i=function(e,t){if(!lt(t))return!1;if((s=t)!==Ci(s))for(var n=0;n65535)return Si(240|t>>>18,128|t>>>12&63,128|t>>>6&63,128|63&t)}else t=65533}else t<=57343&&(t=65533);return t<=2047?Si(192|t>>>6,128|63&t):Si(224|t>>>12,128|t>>>6&63,128|63&t)},Li=function(e){for(var t=void 0===e?\"\":(\"\"+e).replace(/[\\x80-\\uD7ff\\uDC00-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]?/g,ki),n=0|t.length,o=new Uint8Array(n),s=0;s0)for(var u=0;u=a&&(xe.l(\"\".concat(e._n,\"._checkPromiseMap request timeout, delete requestID:\").concat(n)),e._promiseMap.delete(n),o(new Wa({code:da.NETWORK_TIMEOUT})),e._channelModule.onRequestTimeout(n))}))}},{key:\"onOpen\",value:function(e){if(\"\"!==this._readyState){this._onOpenTs=Date.now();var t=e.id;this._socketID=t;var n=Date.now()-this._startTs;xe.l(\"\".concat(this._n,\"._onOpen cost \").concat(n,\" ms. socketID:\").concat(t)),new ka(\"wsOnOpen\").setMessage(n).setCostTime(n).setMoreMessage(\"socketID:\".concat(t)).end(),e.id===this._socketID&&(this._readyState=Pi,this._reConnectCount=0,this._resend(),!0===this._reConnectFlag&&(this._channelModule.onReconnected(),this._reConnectFlag=!1),this._channelModule.onOpen())}}},{key:\"onClose\",value:function(e){var t=new ka(\"wsOnClose\"),n=e.id,o=e.e,s=\"sourceSocketID:\".concat(n,\" currentSocketID:\").concat(this._socketID,\" code:\").concat(o.code,\" reason:\").concat(o.reason),a=0;0!==this._onOpenTs&&(a=Date.now()-this._onOpenTs),t.setMessage(a).setCostTime(a).setMoreMessage(s).setCode(o.code).end(),xe.l(\"\".concat(this._n,\"._onClose \").concat(s,\" onlineTime:\").concat(a)),n===this._socketID&&(this._readyState=wi,a<1e3?this._channelModule.onReconnectFailed():this._channelModule.onClose())}},{key:\"onError\",value:function(e){var t=e.id,n=e.e,o=\"sourceSocketID:\".concat(t,\" currentSocketID:\").concat(this._socketID);new ka(\"wsOnError\").setMessage(n.errMsg||dt(n)).setMoreMessage(o).setLevel(\"error\").end(),xe.w(\"\".concat(this._n,\"._onError\"),n,o),t===this._socketID&&(this._readyState=\"\",this._channelModule.onError())}},{key:\"onMessage\",value:function(e){var t;try{t=JSON.parse(e.data)}catch(c){new ka(\"jsonParseError\").setMessage(e.data).end()}if(t&&t.head){var n=this._getRequestIDFromHead(t.head),o=t.body;if(!this._isTRTCCommand(n)){var s=Pt(t.head);o=Ei(t.body,this._getResponseKeyMap(s))}if(xe.d(\"\".concat(this._n,\".onMessage ret:\").concat(JSON.stringify(o),\" requestID:\").concat(n,\" has:\").concat(this._promiseMap.has(n))),this._setNextPingTs(),this._promiseMap.has(n)){var a=this._promiseMap.get(n),r=a.resolve,i=a.reject,u=a.timestamp;return this._promiseMap.delete(n),this._calcRTT(u),void(o.errorCode&&0!==o.errorCode?(this._channelModule.onErrorCodeNotZero(o),i(new Wa({code:o.errorCode,message:o.errorInfo||\"\",data:n.includes(Lo)||n.includes(ms)?{elements:o.elements,messageVersion:o.messageVersion,cloudCustomData:o.cloudCustomData}:void 0}))):r(Ka(o)))}this._channelModule.onMessage({head:t.head,body:o})}}},{key:\"_isTRTCCommand\",value:function(e){for(var t=this._channelModule.getModule(oo).getCommandList(),n=!1,o=0;o0&&this._promiseMap.forEach((function(t,n){var o=t.uplinkData,s=t.resolve,a=t.reject;e._promiseMap.set(n,{resolve:s,reject:a,timestamp:Date.now(),uplinkData:o}),e._execute(n,o)})),this._simpleRequestMap.size>0){var t,n=D(this._simpleRequestMap);try{for(n.s();!(t=n.n()).done;){var o=v(t.value,2),s=o[0],a=o[1];this._execute(s,a)}}catch(r){n.e(r)}finally{n.f()}this._simpleRequestMap.clear()}}},{key:\"send\",value:function(e){var t=this;e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var n=g(e,Gi),o=this._getRequestIDFromHead(e.head),s=JSON.stringify(n);return new Promise((function(e,a){(t._promiseMap.set(o,{resolve:e,reject:a,timestamp:Date.now(),uplinkData:s}),xe.d(\"\".concat(t._n,\".send uplinkData:\").concat(JSON.stringify(n),\" requestID:\").concat(o,\" readyState:\").concat(t._readyState)),t._readyState!==Pi)?t._reConnect():(t._execute(o,s),t._channelModule.getModule($n).addRequestCount())}))}},{key:\"simplySend\",value:function(e){e.head.seq=this._getSequence(),e.head.reqtime=Math.floor(Date.now()/1e3),e.keyMap;var t=g(e,Ui),n=this._getRequestIDFromHead(e.head),o=JSON.stringify(t);this._readyState!==Pi?(this._simpleRequestMap.size0&&(clearInterval(this._timerForNotLoggedIn),this._timerForNotLoggedIn=-1),this._socketHandler.onCheckTimer(e)):this._socketHandler.onCheckTimer(1),this._checkNextPing())}},{key:\"onErrorCodeNotZero\",value:function(e){this.getModule(jn).onErrorCodeNotZero(e)}},{key:\"onMessage\",value:function(e){this.getModule(jn).onMessage(e)}},{key:\"send\",value:function(e){return this._socketHandler?this._previousState!==S.NET_STATE_CONNECTED&&e.head.servcmd.includes(xs)?(this.reConnect(),this._sendLogViaHTTP(e)):this._socketHandler.send(e):Promise.reject()}},{key:\"_sendLogViaHTTP\",value:function(e){var t=V.HOST.CURRENT.STAT;return new Promise((function(n,o){var s=\"\".concat(t,\"/v4/imopenstat/tim_web_report_v2?sdkappid=\").concat(e.head.sdkappid,\"&reqtime=\").concat(Date.now()),a=JSON.stringify(e.body),r=\"application/x-www-form-urlencoded;charset=UTF-8\";if(se)re.request({url:s,data:a,method:\"POST\",timeout:3e3,header:{\"content-type\":r},success:function(){n()},fail:function(){o(new Wa({code:da.NETWORK_ERROR}))}});else{var i=new XMLHttpRequest,u=setTimeout((function(){i.abort(),o(new Wa({code:da.NETWORK_TIMEOUT}))}),3e3);i.onreadystatechange=function(){4===i.readyState&&(clearTimeout(u),200===i.status||304===i.status?n():o(new Wa({code:da.NETWORK_ERROR})))},i.open(\"POST\",s,!0),i.setRequestHeader(\"Content-type\",r),i.send(a)}}))}},{key:\"simplySend\",value:function(e){return this._socketHandler?this._socketHandler.simplySend(e):Promise.reject()}},{key:\"onOpen\",value:function(){this._ping()}},{key:\"onClose\",value:function(){this._socketHandler&&(this._socketHandler.getReconnectFlag()&&this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED));this.reConnect()}},{key:\"onError\",value:function(){se&&!ne&&this.outputWarning(\"DomainNameInMP\"),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:\"getKeyMap\",value:function(e){return this.getModule(jn).getKeyMap(e)}},{key:\"_onAppHide\",value:function(){this._isAppShowing=!1}},{key:\"_onAppShow\",value:function(){this._isAppShowing=!0}},{key:\"onRequestTimeout\",value:function(e){}},{key:\"onReconnected\",value:function(){xe.l(\"\".concat(this._n,\".onReconnected\")),this._m.restartTimer(),this.getModule(jn).onReconnected(),this._emitNetStateChangeEvent(S.NET_STATE_CONNECTED)}},{key:\"onReconnectFailed\",value:function(){xe.l(\"\".concat(this._n,\".onReconnectFailed\")),this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:\"setIsWorkerEnabled\",value:function(e){this._socketHandler&&this._socketHandler.setIsWorkerEnabled(!1)}},{key:\"offline\",value:function(){this._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED)}},{key:\"reConnect\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=!1;this._socketHandler&&(t=this._socketHandler.getReconnectFlag());var n=\"forcedFlag:\".concat(e,\" fatalErrorFlag:\").concat(this._fatalErrorFlag,\" previousState:\").concat(this._previousState,\" reconnectFlag:\").concat(t);if(xe.l(\"\".concat(this._n,\".reConnect \").concat(n)),!this._fatalErrorFlag&&this._socketHandler){if(!0===e)this._socketHandler.forcedReconnect();else{if(this._previousState===S.NET_STATE_CONNECTING&&t)return;this._socketHandler.forcedReconnect()}this._emitNetStateChangeEvent(S.NET_STATE_CONNECTING)}}},{key:\"_emitNetStateChangeEvent\",value:function(e){this._previousState!==e&&(xe.l(\"\".concat(this._n,\"._emitNetStateChangeEvent from \").concat(this._previousState,\" to \").concat(e)),this._previousState=e,this.emitOuterEvent(E.NET_STATE_CHANGE,{state:e}))}},{key:\"_ping\",value:function(){var e=this;if(!0!==this._probing){this._probing=!0;var t=this.getModule(jn).getProtocolData({protocolName:Vs});this.send(t).then((function(){e._probing=!1})).catch((function(t){if(xe.w(\"\".concat(e._n,\"._ping failed. error:\"),t),e._probing=!1,t&&60002===t.code)return new ka(\"error\").setMessage(\"code:\".concat(t.code,\" message:\").concat(t.message)).setNetworkType(e.getModule(Bn).getNetworkType()).end(),e._fatalErrorFlag=!0,void e._emitNetStateChangeEvent(S.NET_STATE_DISCONNECTED);e.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];xe.l(\"\".concat(e._n,\"._ping failed. probe network, isAppShowing:\").concat(e._isAppShowing,\" online:\").concat(o,\" networkType:\").concat(s)),o?e.reConnect():e._emitNetStateChangeEvent(S.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),this._timerForNotLoggedIn>-1&&clearInterval(this._timerForNotLoggedIn)}},{key:\"onRestApiKickedOut\",value:function(){this._socketHandler&&(this._socketHandler.close(),this.reConnect(!0))}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._previousState=S.NET_STATE_CONNECTED,this._probing=!1,this._fatalErrorFlag=!1,this._timerForNotLoggedIn=setInterval(this.onCheckTimer.bind(this),1e3)}}]),n}(ro),xi=[\"a2\",\"tinyid\"],Vi=[\"a2\",\"tinyid\"],Bi=function(){function e(t){o(this,e),this._n=\"ProtocolHandler\",this._sessionModule=t,this._configMap=new Map,this._fillConfigMap()}return a(e,[{key:\"_fillConfigMap\",value:function(){this._configMap.clear();var e=this._sessionModule.genCommonHead(),n=this._sessionModule.genCosSpecifiedHead(),o=this._sessionModule.genSSOReportHead(),s=this._sessionModule.isIntl();this._configMap.set(io,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.LOGIN)}),body:{state:\"Online\",isWebUniapp:0,deviceBrand:0},keyMap:{request:{deviceBrand:\"InstType\"},response:{InstId:\"instanceID\",HelloInterval:\"helloInterval\"}}}}(e)),this._configMap.set(uo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.LOGOUT)}),body:{type:0},keyMap:{request:{type:\"wslogout_type\"}}}}(e)),this._configMap.set(co,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.HELLO)}),body:{isWebUniapp:0},keyMap:{response:{NewInstInfo:\"newInstanceInfo\"}}}}(e)),this._configMap.set(lo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.STAT_SERVICE,\".\").concat(V.CMD.KICK_OTHER)}),body:{}}}(e)),this._configMap.set(ws,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_COS_SIGN,\".\").concat(V.CMD.COS_SIGN)}),body:{cmd:\"open_im_cos_svc\",subCmd:\"get_cos_token\",duration:300,version:2},keyMap:{request:{userSig:\"usersig\",subCmd:\"sub_cmd\",cmd:\"cmd\",duration:\"duration\",version:\"version\"},response:{expired_time:\"expiredTime\",bucket_name:\"bucketName\",session_token:\"sessionToken\",tmp_secret_id:\"secretId\",tmp_secret_key:\"secretKey\"}}}}(n)),this._configMap.set(Fs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.CUSTOM_UPLOAD,\".\").concat(V.CMD.COS_PRE_SIG)}),body:{fileType:void 0,fileName:void 0,uploadMethod:0,duration:900},keyMap:{request:{userSig:\"usersig\",fileType:\"file_type\",fileName:\"file_name\",uploadMethod:\"upload_method\"},response:{expired_time:\"expiredTime\",request_id:\"requestId\",head_url:\"headUrl\",upload_url:\"uploadUrl\",download_url:\"downloadUrl\",ci_url:\"ciUrl\",snapshot_url:\"requestSnapshotUrl\"}}}}(n)),this._configMap.set(qs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.CUSTOM_UPLOAD,\".\").concat(V.CMD.VIDEO_COVER)}),body:{version:1,platform:void 0,coverName:void 0,requestSnapshotUrl:void 0},keyMap:{request:{version:\"version\",platform:\"platform\",coverName:\"cover_name\",requestSnapshotUrl:\"snapshot_url\"},response:{error_code:\"errorCode\",error_msg:\"errorInfo\",download_url:\"snapshotUrl\"}}}}(n)),this._configMap.set(Xs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_CONFIG_MANAGER,\".\").concat(V.CMD.FETCH_COMMERCIAL_CONFIG)}),body:{SDKAppID:0},keyMap:{request:{SDKAppID:\"uint32_sdkappid\"},response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_purchase_bits:\"purchaseBits\",uint32_expired_time:\"expiredTime\"}}}}(e)),this._configMap.set(Qs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_CONFIG_MANAGER,\".\").concat(V.CMD.PUSHED_COMMERCIAL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_purchase_bits:\"purchaseBits\",uint32_expired_time:\"expiredTime\"}}}}(e)),this._configMap.set(zs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_CONFIG_MANAGER,\".\").concat(V.CMD.FETCH_CLOUD_CONTROL_CONFIG)}),body:{SDKAppID:0,version:0},keyMap:{request:{SDKAppID:\"uint32_sdkappid\",version:\"uint64_version\"},response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_json_config:\"cloudControlConfig\",uint32_expired_time:\"expiredTime\",uint32_sdkappid:\"SDKAppID\",uint64_version:\"version\"}}}}(e)),this._configMap.set(Js,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_CONFIG_MANAGER,\".\").concat(V.CMD.PUSHED_CLOUD_CONTROL_CONFIG)}),body:{},keyMap:{response:{int32_error_code:\"errorCode\",str_error_message:\"errorMessage\",str_json_config:\"cloudControlConfig\",uint32_expired_time:\"expiredTime\",uint32_sdkappid:\"SDKAppID\",uint64_version:\"version\"}}}}(e)),this._configMap.set(Zs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OVERLOAD_PUSH,\".\").concat(V.CMD.OVERLOAD_NOTIFY)}),body:{},keyMap:{response:{OverLoadServCmd:\"overloadCommand\",DelaySecs:\"waitingTime\"}}}}(e)),this._configMap.set(po,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.GET_MESSAGES)}),body:{cookie:\"\",syncFlag:0,needAbstract:1,isOnlineSync:0,needSignaling:1},keyMap:{request:{fromAccount:\"From_Account\",toAccount:\"To_Account\",from:\"From_Account\",to:\"To_Account\",time:\"MsgTimeStamp\",sequence:\"MsgSeq\",random:\"MsgRandom\",elements:\"MsgBody\"},response:{MsgList:\"messageList\",SyncFlag:\"syncFlag\",To_Account:\"to\",From_Account:\"from\",ClientSeq:\"clientSequence\",MsgSeq:\"sequence\",NoticeSeq:\"noticeSequence\",NotifySeq:\"notifySequence\",MsgRandom:\"random\",MsgTimeStamp:\"time\",MsgContent:\"content\",ToGroupId:\"to\",MsgKey:\"messageKey\",GroupTips:\"groupTips\",MsgBody:\"elements\",MsgType:\"type\",C2CRemainingUnreadCount:\"C2CRemainingUnreadList\",C2CPairUnreadCount:\"C2CPairUnreadList\"}}}}(e)),s||(this._configMap.set(go,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.BIG_DATA_HALLWAY_AUTH_KEY)}),body:{}}}(e)),this._configMap.set(la,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_MSG_AUDIT_MGR,\".\").concat(V.CMD.GET_RPOFANITY_LIST)}),body:{version:0,deviceID:\"\",startIndex:void 0},keyMap:{request:{version:\"uint64_version\",deviceID:\"str_device_id\",startIndex:\"uint64_start_index\"},response:{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\"}}}}(e))),this._configMap.set(_o,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.SEND_MESSAGE)}),body:{fromAccount:\"\",toAccount:\"\",msgSeq:0,msgRandom:0,msgBody:[],cloudCustomData:void 0,nick:\"\",avatar:\"\",msgLifeTime:void 0,offlinePushInfo:{pushFlag:0,title:\"\",desc:\"\",ext:\"\",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:\"\"}},messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,isSupportExtension:0},keyMap:{request:{fromAccount:\"From_Account\",toAccount:\"To_Account\",msgTimeStamp:\"MsgTimeStamp\",msgSeq:\"MsgSeq\",msgRandom:\"MsgRandom\",msgBody:\"MsgBody\",count:\"MaxCnt\",lastMessageTime:\"LastMsgTime\",messageKey:\"MsgKey\",peerAccount:\"Peer_Account\",data:\"Data\",description:\"Desc\",extension:\"Ext\",type:\"MsgType\",content:\"MsgContent\",sizeType:\"Type\",uuid:\"UUID\",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\"}}}}(e)),this._configMap.set(ho,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.SEND_GROUP_MESSAGE)}),body:{fromAccount:\"\",groupID:\"\",random:0,clientSequence:0,priority:\"\",msgBody:[],cloudCustomData:void 0,onlineOnlyFlag:0,offlinePushInfo:{pushFlag:0,title:\"\",desc:\"\",ext:\"\",apnsInfo:{badgeMode:0,isVoipPush:void 0},androidInfo:{OPPOChannelID:\"\"}},groupAtInfo:[],messageControlInfo:void 0,clientTime:void 0,needReadReceipt:0,topicID:void 0,receiverList:void 0,isSupportExtension:0},keyMap:{request:{to:\"GroupId\",extension:\"Ext\",data:\"Data\",description:\"Desc\",random:\"Random\",sequence:\"ReqMsgSeq\",count:\"ReqMsgNumber\",type:\"MsgType\",priority:\"MsgPriority\",content:\"MsgContent\",elements:\"MsgBody\",sizeType:\"Type\",uuid:\"UUID\",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\"},response:{MsgTime:\"time\",MsgSeq:\"sequence\"}}}}(e)),this._configMap.set(Io,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.REVOKE_C2C_MESSAGE)}),body:{msgInfo:{fromAccount:\"\",toAccount:\"\",msgTimeStamp:0,msgSeq:0,msgRandom:0}},keyMap:{request:{msgInfo:\"MsgInfo\",msgTimeStamp:\"MsgTimeStamp\",msgSeq:\"MsgSeq\",msgRandom:\"MsgRandom\"}}}}(e)),this._configMap.set(ss,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.REVOKE_GROUP_MESSAGE)}),body:{groupID:\"\",msgSeqList:void 0,topicID:\"\"},keyMap:{request:{msgSeqList:\"MsgSeqList\",msgSeq:\"MsgSeq\"}}}}(e)),this._configMap.set(Eo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.GET_C2C_ROAM_MESSAGES)}),body:{peerAccount:\"\",count:15,lastMessageTime:0,messageKey:\"\",withRecalledMessage:1,direction:0},keyMap:{request:{messageKey:\"MsgKey\",peerAccount:\"Peer_Account\",count:\"MaxCnt\",lastMessageTime:\"LastMsgTime\",withRecalledMessage:\"WithRecalledMsg\",direction:\"GetDirection\"},response:{LastMsgTime:\"lastMessageTime\",IsNeedReadReceipt:\"needReadReceipt\",IsPeerRead:\"readReceiptSentByPeer\"}}}}(e)),this._configMap.set(Lo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.MODIFY_C2C_MESSAGE)}),body:{from:\"\",to:\"\",sequence:0,random:0,time:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:\"MsgSeq\",random:\"MsgRandom\",time:\"MsgTime\",version:\"MsgVersion\",type:\"MsgType\",content:\"MsgContent\"}}}}(e)),this._configMap.set(is,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_ROAM_MESSAGES)}),body:{withRecalledMsg:1,groupID:\"\",count:15,sequence:\"\",topicID:void 0},keyMap:{request:{sequence:\"ReqMsgSeq\",count:\"ReqMsgNumber\",withRecalledMessage:\"WithRecalledMsg\"},response:{Random:\"random\",MsgTime:\"time\",MsgSeq:\"sequence\",ReqMsgSeq:\"sequence\",RspMsgList:\"messageList\",IsPlaceMsg:\"isPlaceMessage\",IsSystemMsg:\"isSystemMessage\",ToGroupId:\"to\",EnumFrom_AccountType:\"fromAccountType\",EnumTo_AccountType:\"toAccountType\",GroupCode:\"groupCode\",MsgPriority:\"priority\",MsgBody:\"elements\",MsgType:\"type\",MsgContent:\"content\",IsFinished:\"complete\",Download_Flag:\"downloadFlag\",ClientSeq:\"clientSequence\",ThumbUUID:\"thumbUUID\",VideoUUID:\"videoUUID\",ToTopicId:\"topicID\",InvisibleMsgSeq:\"invisibleSequenceList\"}}}}(e)),this._configMap.set(Co,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.SET_C2C_MESSAGE_READ)}),body:{C2CMsgReaded:void 0},keyMap:{request:{lastMessageTime:\"LastedMsgTime\"}}}}(e)),this._configMap.set(To,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.SET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{userIDList:void 0,muteFlag:0},keyMap:{request:{userIDList:\"Peer_Account\",muteFlag:\"Mute_Notifications\"}}}}(e)),this._configMap.set(Do,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.GET_C2C_PEER_MUTE_NOTIFICATIONS)}),body:{updateSequence:0},keyMap:{response:{MuteNotificationsList:\"muteFlagList\"}}}}(e)),this._configMap.set(as,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.SET_GROUP_MESSAGE_READ)}),body:{groupID:void 0,messageReadSeq:void 0,topicID:void 0},keyMap:{request:{messageReadSeq:\"MsgReadedSeq\"}}}}(e)),this._configMap.set(rs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.SET_ALL_MESSAGE_READ)}),body:{readAllC2CMessage:0,groupMessageReadInfoList:[]},keyMap:{request:{readAllC2CMessage:\"C2CReadAllMsg\",groupMessageReadInfoList:\"GroupReadInfo\",messageSequence:\"MsgSeq\"},response:{C2CReadAllMsg:\"readAllC2CMessage\",GroupReadInfoArray:\"groupMessageReadInfoList\"}}}}(e)),this._configMap.set(ko,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.DELETE_C2C_MESSAGE)}),body:{fromAccount:\"\",to:\"\",keyList:void 0},keyMap:{request:{keyList:\"MsgKeyList\"}}}}(e)),this._configMap.set(vs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.DELETE_GROUP_MESSAGE)}),body:{groupID:\"\",deleter:\"\",keyList:void 0,topicID:void 0},keyMap:{request:{deleter:\"Deleter_Account\",keyList:\"Seqs\"}}}}(e)),this._configMap.set(pa,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_TRANSLATE,\".\").concat(V.CMD.TRANSLATE_TEXT)}),body:{sourceTextList:void 0,SDKAppID:0,from:0,source:\"\",target:\"\"},keyMap:{request:{sourceTextList:\"SourceText\",SDKAppID:\"SdkAppId\",from:\"FromAccount\"},response:{TargetText:\"translatedTextList\",RequestId:\"requestID\",CmdErrorCode:\"error\",ErrorCode:\"code\",ErrorInfo:\"message\"}}}}(e)),this._configMap.set(ms,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.MODIFY_GROUP_MESSAGE)}),body:{groupID:\"\",topicID:void 0,sequence:0,version:0,elements:void 0,cloudCustomData:void 0},keyMap:{request:{sequence:\"MsgSeq\",version:\"MsgVersion\",type:\"MsgType\",content:\"MsgContent\"}}}}(e)),this._configMap.set(us,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_READ_RECEIPT)}),body:{groupID:\"\",sequenceList:void 0},keyMap:{request:{sequence:\"MsgSeq\"}}}}(e)),this._configMap.set(ls,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.SEND_C2C_READ_RECEIPT)}),body:{peerAccount:\"\",messageInfoList:void 0},keyMap:{request:{peerAccount:\"Peer_Account\",messageInfoList:\"C2CMsgInfo\",fromAccount:\"From_Account\",toAccount:\"To_Account\",sequence:\"MsgSeq\",random:\"MsgRandom\",time:\"MsgTime\",clientTime:\"MsgClientTime\"}}}}(e)),this._configMap.set(cs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.SEND_READ_RECEIPT)}),body:{groupID:\"\",sequenceList:void 0},keyMap:{request:{sequenceList:\"MsgSeqList\",sequence:\"MsgSeq\"}}}}(e)),this._configMap.set(ps,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_READ_RECEIPT_DETAIL)}),body:{groupID:\"\",sequence:void 0,flag:0,cursor:0,count:0},keyMap:{request:{sequence:\"MsgSeq\",count:\"Num\"},response:{ReadList:\"readUserIDList\",Read_Account:\"userID\",UnreadList:\"unreadUserIDList\",Unread_Account:\"userID\",IsFinish:\"isCompleted\"}}}}(e)),this._configMap.set(Ao,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM_MSG_EXT,\".\").concat(V.CMD.MODIFY_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Ro,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM_MSG_EXT,\".\").concat(V.CMD.GET_C2C_MESSAGE_EXTENSIONS)}),body:{from:void 0,to:void 0,messageKey:void 0,startSequence:void 0}}}(e)),this._configMap.set(Ds,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM_MSG_EXT,\".\").concat(V.CMD.MODIFY_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,operateType:void 0,extensionList:void 0}}}(e)),this._configMap.set(Es,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM_MSG_EXT,\".\").concat(V.CMD.GET_GROUP_MESSAGE_EXTENSIONS)}),body:{groupID:void 0,topicID:void 0,messageSequence:void 0,startSequence:void 0}}}(e)),this._configMap.set(So,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.GET_PEER_READ_TIME)}),body:{userIDList:void 0},keyMap:{request:{userIDList:\"To_Account\"},response:{ReadTime:\"peerReadTimeList\"}}}}(e)),this._configMap.set(Oo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,count:0},keyMap:{request:{},response:{SessionItem:\"conversations\",ToAccount:\"groupID\",To_Account:\"userID\",UnreadMsgCount:\"unreadCount\",MsgGroupReadedSeq:\"messageReadSeq\",C2cPeerReadTime:\"c2cPeerReadTime\"}}}}(e)),this._configMap.set(No,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.PAGING_GET_CONVERSATION_LIST)}),body:{fromAccount:void 0,timeStamp:void 0,startIndex:void 0,pinnedTimeStamp:void 0,pinnedStartIndex:void 0,orderType:void 0,messageAssistFlag:4,assistFlag:15},keyMap:{request:{messageAssistFlag:\"MsgAssistFlags\",assistFlag:\"AssistFlags\",pinnedTimeStamp:\"TopTimeStamp\",pinnedStartIndex:\"TopStartIndex\"},response:{SessionItem:\"conversations\",ToAccount:\"groupID\",To_Account:\"userID\",UnreadMsgCount:\"unreadCount\",MsgGroupReadedSeq:\"messageReadSeq\",C2cPeerReadTime:\"c2cPeerReadTime\",LastMsgFlags:\"lastMessageFlag\",TopFlags:\"isPinned\",TopTimeStamp:\"pinnedTimeStamp\",TopStartIndex:\"pinnedStartIndex\",GroupId:\"convGroupID\"}}}}(e)),this._configMap.set(Go,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.DELETE_CONVERSATION)}),body:{fromAccount:\"\",conversationList:void 0,clearHistoryMessage:void 0},keyMap:{request:{toGroupID:\"ToGroupid\",clearHistoryMessage:\"ClearRamble\",conversationList:\"ContactItem\"},response:{ResultItem:\"resultList\",ToGroupid:\"groupID\",ResultCode:\"code\",ResultInfo:\"info\"}}}}(e)),this._configMap.set(Uo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.CLEAR_HISTORY_MESSAGE)}),body:{fromAccount:\"\",toAccount:void 0,type:1,toGroupID:void 0},keyMap:{request:{toGroupID:\"ToGroupid\"}}}}(e)),this._configMap.set(Po,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.PIN_CONVERSATION)}),body:{fromAccount:\"\",operationType:1,itemList:void 0},keyMap:{request:{itemList:\"RecentContactItem\"}}}}(e)),this._configMap.set(bo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.DELETE_GROUP_AT_TIPS)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:\"DelMsgList\",messageSeq:\"MsgSeq\",messageRandom:\"MsgRandom\"}}}}(e)),this._configMap.set(wo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.MARK_CONVERSATION)}),body:{fromAccount:\"\",itemList:void 0},keyMap:{request:{itemList:\"MarkItem\",operationType:\"OptType\",groupID:\"ToGroupId\"},response:{ToGroupId:\"groupID\",OptType:\"operationType\"}}}}(e)),this._configMap.set(Fo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.MARK_CONVERSATION)}),body:{fromAccount:\"\",itemList:void 0},keyMap:{request:{itemList:\"MarkItem\",operationType:\"OptType\",groupID:\"ToGroupId\"},response:{ToGroupId:\"groupID\",OptType:\"operationType\"}}}}(e)),this._configMap.set(qo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.CREATE_CONVERSATION_GROUP)}),body:{fromAccount:\"\",itemList:void 0},keyMap:{request:{itemList:\"GroupContactItem\",groupID:\"ToGroupId\"},response:{GroupId:\"convGroupID\",ToGroupId:\"groupID\",OptType:\"operationType\"}}}}(e)),this._configMap.set(xo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.DELETE_CONVERSATION_GROUP)}),body:{fromAccount:\"\",groupName:void 0},keyMap:{request:{},response:{GroupId:\"convGroupID\"}}}}(e)),this._configMap.set(Vo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:\"\",updateType:void 0,updateGroup:void 0},keyMap:{request:{oldName:\"OldGroupName\",newName:\"NewGroupName\",groupID:\"ToGroupId\",operationType:\"ContactOptType\",groupName:\"OldGroupName\",updateItem:\"ContactUpdateItem\"},response:{ContactOptType:\"operationType\",ToGroupId:\"groupID\",GroupId:\"convGroupID\"}}}}(e)),this._configMap.set(Bo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:\"\",updateType:void 0,updateGroup:{groupName:void 0,updateGroupType:void 0,updateItem:void 0}},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Ho,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.UPDATE_CONVERSATION_GROUP)}),body:{fromAccount:\"\",updateType:void 0,updateGroup:void 0},keyMap:{request:{},response:{}}}}(e)),this._configMap.set(Ko,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.RECENT_CONTACT,\".\").concat(V.CMD.GET_CONVERSATION_GROUP_LIST)}),body:{fromAccount:\"\",startTime:void 0,startIndex:void 0},keyMap:{request:{},response:{GroupId:\"convGroupID\",ToGroupId:\"groupID\",OptType:\"operationType\",CustomMark:\"customData\",ContactGroupId:\"convGroupIDList\"}}}}(e)),this._configMap.set(fo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.PROFILE,\".\").concat(V.CMD.PORTRAIT_GET)}),body:{fromAccount:\"\",userItem:[]},keyMap:{request:{toAccount:\"To_Account\",standardSequence:\"StandardSequence\",customSequence:\"CustomSequence\"}}}}(e)),this._configMap.set(vo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.PROFILE,\".\").concat(V.CMD.PORTRAIT_SET)}),body:{fromAccount:\"\",profileItem:[{tag:Be.NICK,value:\"\"},{tag:Be.GENDER,value:\"\"},{tag:Be.ALLOWTYPE,value:\"\"},{tag:Be.AVATAR,value:\"\"}]},keyMap:{request:{toAccount:\"To_Account\",standardSequence:\"StandardSequence\",customSequence:\"CustomSequence\"}}}}(e)),this._configMap.set(mo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.FRIEND,\".\").concat(V.CMD.GET_BLACKLIST)}),body:{fromAccount:\"\",startIndex:0,maxLimited:30,lastSequence:0},keyMap:{response:{CurruentSequence:\"currentSequence\"}}}}(e)),this._configMap.set(Mo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.FRIEND,\".\").concat(V.CMD.ADD_BLACKLIST)}),body:{fromAccount:\"\",toAccount:[]}}}(e)),this._configMap.set(yo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.FRIEND,\".\").concat(V.CMD.DELETE_BLACKLIST)}),body:{fromAccount:\"\",toAccount:[]}}}(e)),this._configMap.set(oa,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.SET_SELF_STATUS)}),body:{customStatus:\"\"},keyMap:{}}}(e)),this._configMap.set(sa,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.GET_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{UserStatusList:\"successUserList\",ErrorList:\"failureUserList\",To_Account:\"userID\",Invalid_Account:\"invalidUserID\",Status:\"statusType\"}}}}(e)),this._configMap.set(aa,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.SUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0},keyMap:{response:{ErrorList:\"failureUserList\",To_Account:\"userID\",Invalid_Account:\"invalidUserID\"}}}}(e)),this._configMap.set(ra,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.UNSUBSCRIBE_USER_STATUS)}),body:{userIDList:void 0,unsubscribeAll:void 0},keyMap:{response:{ErrorList:\"failureUserList\",To_Account:\"userID\",Invalid_Account:\"invalidUserID\"}}}}(e)),this._configMap.set(Wo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_JOINED_GROUPS)}),body:{memberAccount:\"\",limit:void 0,offset:void 0,groupType:void 0,responseFilter:{groupBaseInfoFilter:void 0,selfInfoFilter:void 0},isSupportTopic:0},keyMap:{request:{memberAccount:\"Member_Account\"},response:{GroupIdList:\"groups\",NoUnreadSeqList:\"excludedUnreadSequenceList\",MsgSeq:\"readedSequence\",LastRecallTime:\"_lastRevokedTime\"}}}}(e)),this._configMap.set(Yo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_INFO)}),body:{groupIDList:void 0,responseFilter:{groupBaseInfoFilter:[\"Type\",\"Name\",\"Introduction\",\"Notification\",\"FaceUrl\",\"Owner_Account\",\"CreateTime\",\"InfoSeq\",\"LastInfoTime\",\"LastMsgTime\",\"MemberNum\",\"MaxMemberNum\",\"ApplyJoinOption\",\"NextMsgSeq\",\"ShutUpAllMember\"],groupCustomFieldFilter:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0}},keyMap:{request:{groupIDList:\"GroupIdList\",groupCustomField:\"AppDefinedData\",memberCustomField:\"AppMemberDefinedData\",groupCustomFieldFilter:\"AppDefinedDataFilter_Group\",memberCustomFieldFilter:\"AppDefinedDataFilter_GroupMember\"},response:{GroupIdList:\"groups\",AppDefinedData:\"groupCustomField\",AppMemberDefinedData:\"memberCustomField\",AppDefinedDataFilter_Group:\"groupCustomFieldFilter\",AppDefinedDataFilter_GroupMember:\"memberCustomFieldFilter\",InfoSeq:\"infoSequence\",MemberList:\"members\",GroupInfo:\"groups\",ShutUpUntil:\"muteUntil\",ShutUpAllMember:\"muteAllMembers\"}}}}(e)),this._configMap.set(jo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.CREATE_GROUP)}),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:{request:{ownerID:\"Owner_Account\",userID:\"Member_Account\",avatar:\"FaceUrl\",maxMemberNum:\"MaxMemberCount\",joinOption:\"ApplyJoinOption\",groupCustomField:\"AppDefinedData\",memberCustomField:\"AppMemberDefinedData\",inviteOption:\"InviteJoinOption\"},response:{HugeGroupFlag:\"avChatRoomFlag\",OverJoinedGroupLimit_Account:\"overLimitUserIDList\"}}}}(e)),this._configMap.set(zo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.DESTROY_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set(Jo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.MODIFY_GROUP_INFO)}),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:{request:{groupCustomField:\"AppDefinedData\",muteAllMembers:\"ShutUpAllMember\",joinOption:\"ApplyJoinOption\",avatar:\"FaceUrl\",inviteOption:\"InviteJoinOption\"},response:{AppDefinedData:\"groupCustomField\",ShutUpAllMember:\"muteAllMembers\"}}}}(e)),this._configMap.set(Xo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1,historyMessageFlag:void 0},keyMap:{request:{applyMessage:\"ApplyMsg\",historyMessageFlag:\"HugeGroupHistoryMsgFlag\"},response:{HugeGroupFlag:\"avChatRoomFlag\",AVChatRoomKey:\"avChatRoomKey\",RspMsgList:\"messageList\",ToGroupId:\"to\"}}}}(e)),this._configMap.set(Qo,function(e){return e.a2,e.tinyid,{head:t(t({},g(e,xi)),{},{servcmd:\"\".concat(V.NAME.BIG_GROUP_NO_AUTH,\".\").concat(V.CMD.APPLY_JOIN_GROUP)}),body:{groupID:void 0,applyMessage:void 0,userDefinedField:void 0,webPushFlag:1},keyMap:{request:{applyMessage:\"ApplyMsg\"},response:{HugeGroupFlag:\"avChatRoomFlag\"}}}}(e)),this._configMap.set(Zo,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.QUIT_GROUP)}),body:{groupID:void 0}}}(e)),this._configMap.set($o,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.SEARCH_GROUP_BY_ID)}),body:{groupIDList:void 0,responseFilter:{groupBasePublicInfoFilter:[\"Type\",\"Name\",\"Introduction\",\"Notification\",\"FaceUrl\",\"CreateTime\",\"Owner_Account\",\"LastInfoTime\",\"LastMsgTime\",\"NextMsgSeq\",\"MemberNum\",\"MaxMemberNum\",\"ApplyJoinOption\",\"InviteJoinOption\"]}},keyMap:{response:{}}}}(e)),this._configMap.set(es,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.CHANGE_GROUP_OWNER)}),body:{groupID:void 0,newOwnerID:void 0},keyMap:{request:{newOwnerID:\"NewOwner_Account\"}}}}(e)),this._configMap.set(ts,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.HANDLE_APPLY_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{applicant:\"Applicant_Account\",handleAction:\"HandleMsg\",handleMessage:\"ApprovalMsg\",messageKey:\"MsgKey\"}}}}(e)),this._configMap.set(ns,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.HANDLE_INVITE_JOIN_GROUP)}),body:{groupID:void 0,applicant:void 0,invitee:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,userDefinedField:void 0},keyMap:{request:{applicant:\"Applicant_Account\",invitee:\"Invited_Account\",handleAction:\"HandleMsg\",handleMessage:\"ApprovalMsg\"}}}}(e)),this._configMap.set(os,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.HANDLE_GROUP_INVITATION)}),body:{groupID:void 0,inviter:void 0,handleAction:void 0,handleMessage:void 0,authentication:void 0,messageKey:void 0,userDefinedField:void 0},keyMap:{request:{inviter:\"Inviter_Account\",handleAction:\"HandleMsg\",handleMessage:\"ApprovalMsg\",messageKey:\"MsgKey\"}}}}(e)),this._configMap.set(ds,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_APPLICATION)}),body:{startTime:void 0,limit:void 0,handleAccount:void 0},keyMap:{request:{handleAccount:\"Handle_Account\"},response:{To_Account:\"userID\"}}}}(e)),this._configMap.set(gs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.DELETE_GROUP_SYSTEM_MESSAGE)}),body:{messageListToDelete:void 0},keyMap:{request:{messageListToDelete:\"DelMsgList\",messageSeq:\"MsgSeq\",messageRandom:\"MsgRandom\"}}}}(e)),this._configMap.set(_s,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.BIG_GROUP_LONG_POLLING,\".\").concat(V.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,startBroadcastSeq:void 0,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:\"USP\"},response:{ToGroupId:\"groupID\",RspBroadcastMsgList:\"broadcastMessageList\",IsSystemMsg:\"isSystemMessage\"}}}}(e)),this._configMap.set(hs,function(e){return e.a2,e.tinyid,{head:t(t({},g(e,Vi)),{},{servcmd:\"\".concat(V.NAME.BIG_GROUP_LONG_POLLING_NO_AUTH,\".\").concat(V.CMD.AVCHATROOM_LONG_POLL)}),body:{USP:1,startSeq:1,holdTime:90,key:void 0,simplifiedMessage:void 0},keyMap:{request:{USP:\"USP\"},response:{ToGroupId:\"groupID\",RspBroadcastMsgList:\"broadcastMessageList\",IsSystemMsg:\"isSystemMessage\"}}}}(e)),this._configMap.set(fs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_ONLINE_MEMBER_NUM)}),body:{groupID:void 0}}}(e)),this._configMap.set(Ms,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.SET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]},keyMap:{request:{key:\"key\",value:\"value\"}}}}(e)),this._configMap.set(ys,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.MODIFY_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]},keyMap:{request:{key:\"key\",value:\"value\"}}}}(e)),this._configMap.set(Is,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.DELETE_GROUP_ATTRIBUTES)}),body:{groupID:void 0,groupAttributeList:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]},keyMap:{request:{key:\"key\"}}}}(e)),this._configMap.set(Cs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.CLEAR_GROUP_ATTRIBUTES)}),body:{groupID:void 0,mainSequence:void 0,avChatRoomKey:void 0,attributeControl:[\"RaceConflict\"]}}}(e)),this._configMap.set(Ts,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_ATTR,\".\").concat(V.CMD.GET_GROUP_ATTRIBUTES)}),body:{groupID:void 0,avChatRoomKey:void 0,groupType:1},keyMap:{request:{avChatRoomKey:\"Key\",groupType:\"GroupType\"}}}}(e)),this._configMap.set(Ss,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_NOTIFY)}),body:{notifyType:1,groupID:\"\",beginTime:0,endTime:0,limit:20},keyMap:{request:{},response:{NextMsgTime:\"nextRevokedTime\",NotifyMsgList:\"notifyList\"}}}}(e)),this._configMap.set(ks,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.UPDATE_GROUP_COUNTER)}),body:{groupID:void 0,counterList:void 0,avChatRoomKey:void 0,mode:void 0},keyMap:{request:{counterList:\"GroupCounter\"}}}}(e)),this._configMap.set(Ls,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_COUNTER)}),body:{groupID:void 0,keyList:[],avChatRoomKey:void 0},keyMap:{request:{keyList:\"GroupCounterKeys\"}}}}(e)),this._configMap.set($s,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_COMMUNITY,\".\").concat(V.CMD.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:{request:{avatar:\"FaceUrl\"}}}}(e)),this._configMap.set(ea,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_COMMUNITY,\".\").concat(V.CMD.DELETE_TOPIC)}),body:{groupID:void 0,topicIDList:void 0},keyMap:{request:{topicIDList:\"TopicIdList\"},response:{DestroyResultItem:\"resultList\"}}}}(e)),this._configMap.set(ta,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_COMMUNITY,\".\").concat(V.CMD.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:{request:{avatar:\"FaceUrl\",muteAllMembers:\"ShutUpAllMember\"}}}}(e)),this._configMap.set(na,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_COMMUNITY,\".\").concat(V.CMD.GET_TOPIC_LIST)}),body:{groupID:void 0,topicIDList:void 0,MemberInfoFilter:[\"NoUnreadSeqList\"]},keyMap:{request:{topicIDList:\"TopicIdList\"},response:{TopicAndSelfInfo:\"topicInfoList\",TopicInfo:\"topic\",GroupID:\"groupID\",ShutUpTime:\"muteTime\",ShutUpAllFlag:\"muteAllMembers\",LastMsgTime:\"lastMessageTime\",MsgSeq:\"readedSequence\",LastMsgSeq:\"sequence\",NoUnreadSeqList:\"excludedUnreadSequenceList\"}}}}(e)),this._configMap.set(As,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_MEMBER_LIST)}),body:{groupID:void 0,limit:0,offset:void 0,next:void 0,memberRoleFilter:void 0,memberInfoFilter:[\"Role\",\"NameCard\",\"ShutUpUntil\",\"JoinTime\"],memberCustomFieldFilter:void 0},keyMap:{request:{memberCustomFieldFilter:\"AppDefinedDataFilter_GroupMember\"},response:{AppMemberDefinedData:\"memberCustomField\",AppDefinedDataFilter_GroupMember:\"memberCustomFieldFilter\",MemberList:\"members\",ShutUpUntil:\"muteUntil\"}}}}(e)),this._configMap.set(Rs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_AVCHATROOM,\".\").concat(V.CMD.GET_AVCHATROOM_MEMBER_LIST)}),body:{groupID:void 0,offset:void 0,filter:void 0},keyMap:{request:{offset:\"Timestamp\",filter:\"Mark\"},response:{NextTimestamp:\"offset\"}}}}(e)),this._configMap.set(Ns,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.GET_GROUP_MEMBER_INFO)}),body:{groupID:void 0,userIDList:void 0,memberInfoFilter:void 0,memberCustomFieldFilter:void 0},keyMap:{request:{userIDList:\"Member_List_Account\",memberCustomFieldFilter:\"AppDefinedDataFilter_GroupMember\"},response:{MemberList:\"members\",ShutUpUntil:\"muteUntil\",AppDefinedDataFilter_GroupMember:\"memberCustomFieldFilter\",AppMemberDefinedData:\"memberCustomField\"}}}}(e)),this._configMap.set(Os,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.ADD_GROUP_MEMBER)}),body:{groupID:void 0,silence:void 0,userIDList:void 0},keyMap:{request:{userID:\"Member_Account\",userIDList:\"MemberList\"},response:{MemberList:\"members\"}}}}(e)),this._configMap.set(Gs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.DELETE_GROUP_MEMBER)}),body:{groupID:void 0,userIDList:void 0,reason:void 0},keyMap:{request:{userIDList:\"MemberToDel_Account\"}}}}(e)),this._configMap.set(Us,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.BAN_AVCHATROOM_MEMBER)}),body:{groupID:void 0,userIDList:void 0,duration:void 0,reason:\"\"},keyMap:{request:{userIDList:\"Members_Account\",duration:\"Duration\",reason:\"Description\"}}}}(e)),this._configMap.set(Ps,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP,\".\").concat(V.CMD.MODIFY_GROUP_MEMBER_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:{request:{userID:\"Member_Account\",memberCustomField:\"AppMemberDefinedData\",muteTime:\"ShutUpTime\",messageRemindType:\"MsgFlag\"}}}}(e)),this._configMap.set(bs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.GROUP_AVCHATROOM,\".\").concat(V.CMD.MARK_AVCHATROOM_MEMBER_INFO)}),body:{groupID:void 0,operationType:1,memberList:[]},keyMap:{request:{operationType:\"CommandType\",memberList:\"MemberList\",markType:\"Marks\",userID:\"Member_Account\"},response:{CommandType:\"operationType\",Marks:\"markType\",Member_Account:\"userID\"}}}}(e)),this._configMap.set(xs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STAT,\".\").concat(V.CMD.TIM_WEB_REPORT_V2)}),body:{header:{},event:[],quality:[]},keyMap:{request:{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\"}}}}(o)),this._configMap.set(Vs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.HEARTBEAT,\".\").concat(V.CMD.ALIVE)}),body:{}}}(e)),this._configMap.set(Bs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_PUSH,\".\").concat(V.CMD.MESSAGE_PUSH)}),body:{},keyMap:{response:{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\"}}}}(e)),this._configMap.set(Hs,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_PUSH,\".\").concat(V.CMD.MULTI_MESSAGE_PUSH)}),body:{},keyMap:{response:{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\"}}}}(e)),this._configMap.set(Ks,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.OPEN_IM,\".\").concat(V.CMD.MESSAGE_PUSH_ACK)}),body:{sessionData:void 0},keyMap:{request:{sessionData:\"SessionData\"}}}}(e)),this._configMap.set(Ws,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.STATUS_FORCE_OFFLINE)}),body:{},keyMap:{response:{C2cNotifyMsgArray:\"C2CNotifyMessageArray\",NoticeSeq:\"noticeSequence\",KickoutMsgNotify:\"kickoutMsgNotify\",NewInstInfo:\"newInstanceInfo\"}}}}(e)),this._configMap.set(js,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_LONG_MESSAGE,\".\").concat(V.CMD.DOWNLOAD_MERGER_MESSAGE)}),body:{downloadKey:\"\"},keyMap:{response:{Data:\"data\",Desc:\"description\",Ext:\"extension\",Download_Flag:\"downloadFlag\",ThumbUUID:\"thumbUUID\",VideoUUID:\"videoUUID\"}}}}(e)),this._configMap.set(Ys,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_LONG_MESSAGE,\".\").concat(V.CMD.UPLOAD_MERGER_MESSAGE)}),body:{messageList:[]},keyMap:{request:{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\"}}}}(e)),this._configMap.set(ca,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.SET_TOKEN)}),body:{tokenID:\"\",pushMsg:0,sdkAppID:0,businessID:\"\",deviceBrand:\"\",deviceToken:\"\",isTpns:0,isWebUniapp:0},keyMap:{request:{tokenID:\"TokenID\",pushMsg:\"PushMsg\",sdkAppID:\"EnterVersion\",businessID:\"BusiID\",deviceBrand:\"InstType\",deviceToken:\"VarToken\",isTpns:\"IsTpns\"}}}}(e)),this._configMap.set(ua,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.STAT_FOREGROUND)}),body:{isWebUniapp:0}}}(e)),this._configMap.set(ia,function(e){return{head:t(t({},e),{},{servcmd:\"\".concat(V.NAME.IM_OPEN_STATUS,\".\").concat(V.CMD.STAT_BACKGROUND)}),body:{C2CUnread:0,GroupUnread:0,isWebUniapp:0},keyMap:{request:{c2cUnreadCount:\"C2cUnread\",groupUnreadCount:\"GrpUnread\"}}}}(e))}},{key:\"has\",value:function(e){return this._configMap.has(e)}},{key:\"get\",value:function(e){return this._configMap.get(e)}},{key:\"update\",value:function(){this._fillConfigMap()}},{key:\"getKeyMap\",value:function(e){return this.has(e)?this.get(e).keyMap||{}:(xe.w(\"\".concat(this._n,\".getKeyMap unknown protocolName:\").concat(e)),{})}},{key:\"getProtocolData\",value:function(e){var t=e.protocolName,n=e.requestData,o=this.get(t),s=null;if(n){var a=this._simpleDeepCopy(o),r=this._updateService(n,a),i=r.body,u=Object.create(null);for(var c in i)if(Object.prototype.hasOwnProperty.call(i,c)){if(u[c]=i[c],void 0===n[c])continue;u[c]=n[c]}r.body=u,s=this._getUplinkData(r)}else s=this._getUplinkData(o);return s}},{key:\"_getUplinkData\",value:function(e){var t=this._requestDataCleaner(e),n=Pt(t.head),o=Di(t.body,this._getRequestKeyMap(n));return t.body=o,t}},{key:\"_updateService\",value:function(e,t){var n=Pt(t.head);if(this._isFromGroupRequest(t)){var o=e.type,s=e.groupID,a=void 0===s?void 0:s,r=e.groupIDList,i=void 0===r?[]:r;at(a)&&(a=i[0]||\"\"),Tt({type:o,groupID:a})&&(t.head.servcmd=\"\".concat(V.NAME.GROUP_COMMUNITY,\".\").concat(n))}return t}},{key:\"_isFromGroupRequest\",value:function(e){return e.head.servcmd.includes(V.NAME.GROUP)||e.head.servcmd.includes(V.NAME.GROUP_ATTR)}},{key:\"_getRequestKeyMap\",value:function(e){var n=this.getKeyMap(e);return t(t({},Ii.request),n.request)}},{key:\"_requestDataCleaner\",value:function(e){var t=Array.isArray(e)?[]:Object.create(null);for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&<(o)&&null!==e[o]&&void 0!==e[o]&&(\"object\"!==n(e[o])?t[o]=e[o]:t[o]=this._requestDataCleaner.bind(this)(e[o]));return t}},{key:\"_simpleDeepCopy\",value:function(e){for(var t,n=Object.keys(e),o={},s=0,a=n.length;s1e3*s)return this._commandRequestInfoMap.set(t,{startTime:Date.now(),requestCount:1}),!1;i+=1,this._commandRequestInfoMap.set(t,{startTime:r,requestCount:i});var u=!1;return i>o&&(u=!0),u}},{key:\"_isServerOverload\",value:function(e){if(!this._serverOverloadInfoMap.has(e))return!1;var t=this._serverOverloadInfoMap.get(e),n=t.overloadTime,o=t.waitingTime,s=!1;return Date.now()-n<=1e3*o?s=!0:(this._serverOverloadInfoMap.delete(e),s=!1),s}},{key:\"onPushedServerOverload\",value:function(e){var t=e.overloadCommand,n=e.waitingTime;this._serverOverloadInfoMap.set(t,{overloadTime:Date.now(),waitingTime:n}),xe.w(\"\".concat(this._n,\".onPushedServerOverload waitingTime:\").concat(n,\"s\"))}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._updateCommandFrequencyLimitMap(Wi),this._commandRequestInfoMap.clear(),this._serverOverloadInfoMap.clear()}}]),s}(ro),ji=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"MessageLossDetectionModule\",s._maybeLostSequencesMap=new Map,s._firstRoundRet=[],s}return a(n,[{key:\"onMessageMaybeLost\",value:function(e,t,n){this._maybeLostSequencesMap.has(e)||this._maybeLostSequencesMap.set(e,[]);for(var o=this._maybeLostSequencesMap.get(e),s=0;s=this._expiredTime}},{key:\"fetchConfig\",value:function(){var e=this,t=this._canFetchConfig();if(xe.l(\"\".concat(this._n,\".fetchConfig canFetchConfig:\").concat(t)),t){var n=new ka(\"fetchCloudControlConfig\"),o=this.getModule(qn).getSDKAppID();this._isFetching=!0,this.request({protocolName:zs,requestData:{SDKAppID:o,version:this._version}}).then((function(t){e._isFetching=!1,n.setMessage(\"version:\".concat(e._version,\" newVersion:\").concat(t.data.version,\" config:\").concat(t.data.cloudControlConfig)).setNetworkType(e.getNetworkType()).end(),xe.l(\"\".concat(e._n,\".fetchConfig ok\")),e._parseCloudControlConfig(t.data)})).catch((function(t){e._isFetching=!1,e.probeNetwork().then((function(e){var o=v(e,2),s=o[0],a=o[1];n.setError(t,s,a).end()})),xe.l(\"\".concat(e._n,\".fetchConfig failed. error:\"),t),e._setExpiredTimeOnResponseError(12e4)}))}}},{key:\"onPushedCloudControlConfig\",value:function(e){xe.l(\"\".concat(this._n,\".onPushedCloudControlConfig\")),new ka(\"pushedCloudControlConfig\").setNetworkType(this.getNetworkType()).setMessage(\"newVersion:\".concat(e.version,\" config:\").concat(e.cloudControlConfig)).end(),this._parseCloudControlConfig(e)}},{key:\"onCheckTimer\",value:function(e){this._canFetchConfig()&&this.fetchConfig()}},{key:\"_parseCloudControlConfig\",value:function(e){var t=this,n=\"\".concat(this._n,\"._parseCloudControlConfig\"),o=e.errorCode,s=e.errorMessage,a=e.cloudControlConfig,r=e.version,i=e.expiredTime;if(0===o){if(this._version!==r){var u=null;try{u=JSON.parse(a)}catch(c){this.isPrivateNetWork()||xe.e(\"\".concat(n,\" JSON parse error. cloudControlConfig:\"),a)}u&&(this._cloudConfig.clear(),Object.keys(u).forEach((function(e){t._cloudConfig.set(e,u[e])})),this._version=r,this.emitInnerEvent($a))}this._expiredTime=Date.now()+1e3*i}else at(o)?(xe.l(\"\".concat(n,\" failed. Invalid message format:\"),e),this._setExpiredTimeOnResponseError(36e5)):(xe.e(\"\".concat(n,\" errorCode:\").concat(o,\" errorMessage:\").concat(s)),this._setExpiredTimeOnResponseError(12e4))}},{key:\"_setExpiredTimeOnResponseError\",value:function(e){this._expiredTime=Date.now()+e}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._cloudConfig.clear(),this._expiredTime=0,this._version=0,this._isFetching=!1}}]),n}(ro),Ji=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"RecoverMessageModule\",s.PULL_LIMIT_COUNT=15,s}return a(n,[{key:\"start\",value:function(){this._recoverGroupChat(),this._recoverC2CChat()}},{key:\"_recoverGroupChat\",value:function(){var e,t,n=this,o=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_GROUP&&e.groupProfile.type!==S.GRP_AVCHATROOM})),s=this.getModule(Fn),a=0,r=0,i=0;o.forEach((function(o){var u=o.conversationID,c=o.lastMessage;t=u.replace(S.CONV_GROUP,\"\"),e=s.getLocalLastMessage(u),c&&0!==c.lastSequence&&e?(r=c.lastSequence,a=e.sequence,i=r-a,a>0&&i>=1&&i<300?n._recoverGroupMessage({groupID:t,localLastMessageSequence:a,remoteLastMessageSequence:r}):n._getGroupNotify(t)):n._getGroupNotify(t)}))}},{key:\"_recoverC2CChat\",value:function(){var e,t=this,n=this._getLocalConversationList().filter((function(e){return e.type===S.CONV_C2C})),o=this.getModule(Fn),s=0,a=0,r=0,i=[Promise.resolve()];n.forEach((function(n){var u=n.conversationID,c=n.lastMessage;e=o.getLocalLastMessage(u),c&&0!==c.lastTime&&e&&(a=c.lastTime,s=e.time,r=a-s,s>0&&r>=1&&r<=600&&i.push(t._recoverC2CMessage({conversationID:u,localLastMessageTime:s,remoteLastMessageTime:a})))})),Promise.all(i).then((function(){xe.l(\"\".concat(t._n,\"._recoverC2CChat all promise fulfilled, start to sync unread messages\")),t.getModule(Yn).startSyncOnReconnected()}))}},{key:\"_getLocalConversationList\",value:function(){return this.getModule(Fn).getLocalConversationList()}},{key:\"_recoverGroupMessage\",value:function(e){var t=this,n=\"\".concat(this._n,\"._recoverGroupMessage\");xe.l(\"\".concat(n,\" options:\"),e);var o=e.groupID,s=e.localLastMessageSequence,a=e.remoteLastMessageSequence;this._getGroupRomaingMessage({groupID:o,sequence:s}).then((function(e){var s=e.data,r=s.complete,i=s.messageList;if(!at(i)){var u=i[0].sequence;xe.l(\"\".concat(n,\" pkgLastMessageSequence:\").concat(u,\" complete:\").concat(r)),u1&&i.sort((function(e,t){return e.sequence-t.sequence}));for(var l=0;l=0&&this._e2eDelayArray.push(t)}},{key:\"_calcAvg\",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),bt(n/t,1)}},{key:\"_calcCountWithLimit\",value:function(e){var t=e.e2eDelayArray,n=e.min,o=e.max;return t.filter((function(e){return n<=e&&e100&&(n=100),n}},{key:\"_checkE2EDelayException\",value:function(e,t){var n=e.filter((function(e){return e>t}));if(n.length>0){var o=n.length,s=Math.min.apply(Math,m(n)),a=Math.max.apply(Math,m(n)),r=this._calcAvg(n,o),i=bt(o/e.length*100,2);if(i>50)new ka(\"messageE2EDelayException\").setMessage(\"count:\".concat(o,\" min:\").concat(s,\" max:\").concat(a,\" avg:\").concat(r,\" percent:\").concat(i)).setLevel(\"warning\").end()}}},{key:\"getStatResult\",value:function(){var e=this._e2eDelayArray.length;if(0===e)return null;var t=m(this._e2eDelayArray),n=this._calcCountWithLimit({e2eDelayArray:t,min:0,max:1}),o=this._calcCountWithLimit({e2eDelayArray:t,min:1,max:3}),s=this._calcPercent(n,e),a=this._calcPercent(o,e),r=this._calcAvg(t,e);return this._checkE2EDelayException(t,3),t.length=0,this.reset(),{totalCount:e,countLessThan1Second:n,percentOfCountLessThan1Second:s,countLessThan3Second:o,percentOfCountLessThan3Second:a,avgDelay:r}}},{key:\"reset\",value:function(){this._e2eDelayArray.length=0}}]),e}(),Qi=function(){function e(){o(this,e),this._n=\"AvgRTT\",this._requestCount=0,this._rttArray=[]}return a(e,[{key:\"addRequestCount\",value:function(){this._requestCount+=1}},{key:\"addRTT\",value:function(e){this._rttArray.push(e)}},{key:\"_calcTotalCount\",value:function(){return this._requestCount}},{key:\"_calcRTTCount\",value:function(e){return e.length}},{key:\"_calcSuccessRateOfRequest\",value:function(e,t){if(0===t)return 0;var n=bt(e/t*100,2);return n>100&&(n=100),n}},{key:\"_calcAvg\",value:function(e,t){if(0===t)return 0;var n=0;return e.forEach((function(e){n+=e})),parseInt(n/t)}},{key:\"_calcMax\",value:function(){return Math.max.apply(Math,m(this._rttArray))}},{key:\"_calcMin\",value:function(){return Math.min.apply(Math,m(this._rttArray))}},{key:\"getStatResult\",value:function(){var e=this._calcTotalCount(),t=m(this._rttArray);if(0===e)return null;var n=this._calcRTTCount(t),o=this._calcSuccessRateOfRequest(n,e),s=this._calcAvg(t,n);return xe.l(\"\".concat(this._n,\".getStatResult max:\").concat(this._calcMax(),\" min:\").concat(this._calcMin(),\" avg:\").concat(s)),this.reset(),{totalCount:e,rttCount:n,successRateOfRequest:o,avgRTT:s}}},{key:\"reset\",value:function(){this._requestCount=0,this._rttArray.length=0}}]),e}(),Zi=function(){function e(){o(this,e),this._map=new Map}return a(e,[{key:\"initMap\",value:function(e){var t=this;e.forEach((function(e){t._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}))}},{key:\"addTotalCount\",value:function(e){return!(at(e)||!this._map.has(e))&&(this._map.get(e).totalCount+=1,!0)}},{key:\"addSuccessCount\",value:function(e){return!(at(e)||!this._map.has(e))&&(this._map.get(e).successCount+=1,!0)}},{key:\"addFailedCountOfUserSide\",value:function(e){return!(at(e)||!this._map.has(e))&&(this._map.get(e).failedCountOfUserSide+=1,!0)}},{key:\"addCost\",value:function(e,t){return!(at(e)||!this._map.has(e))&&(this._map.get(e).costArray.push(t),!0)}},{key:\"addFileSize\",value:function(e,t){return!(at(e)||!this._map.has(e))&&(this._map.get(e).fileSizeArray.push(t),!0)}},{key:\"_calcSuccessRateOfBusiness\",value:function(e){if(at(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=bt(t.successCount/t.totalCount*100,2);return n>100&&(n=100),n}},{key:\"_calcSuccessRateOfPlatform\",value:function(e){if(at(e)||!this._map.has(e))return-1;var t=this._map.get(e),n=this._calcSuccessCountOfPlatform(e)/t.totalCount*100;return(n=bt(n,2))>100&&(n=100),n}},{key:\"_calcTotalCount\",value:function(e){return at(e)||!this._map.has(e)?-1:this._map.get(e).totalCount}},{key:\"_calcSuccessCountOfBusiness\",value:function(e){return at(e)||!this._map.has(e)?-1:this._map.get(e).successCount}},{key:\"_calcSuccessCountOfPlatform\",value:function(e){if(at(e)||!this._map.has(e))return-1;var t=this._map.get(e);return t.successCount+t.failedCountOfUserSide}},{key:\"_calcAvg\",value:function(e){return at(e)||!this._map.has(e)?-1:e===Ma?this._calcAvgSpeed(e):this._calcAvgCost(e)}},{key:\"_calcAvgCost\",value:function(e){var t=this._map.get(e).costArray.length;if(0===t)return 0;var n=0;return this._map.get(e).costArray.forEach((function(e){n+=e})),parseInt(n/t)}},{key:\"_calcAvgSpeed\",value:function(e){var t=0,n=0;return this._map.get(e).costArray.forEach((function(e){t+=e})),this._map.get(e).fileSizeArray.forEach((function(e){n+=e})),parseInt(1e3*n/t)}},{key:\"getStatResult\",value:function(e){var t=this._calcTotalCount(e);if(0===t)return null;var n=this._calcSuccessCountOfBusiness(e),o=this._calcSuccessRateOfBusiness(e),s=this._calcSuccessCountOfPlatform(e),a=this._calcSuccessRateOfPlatform(e),r=this._calcAvg(e);return this.reset(e),{totalCount:t,successCountOfBusiness:n,successRateOfBusiness:o,successCountOfPlatform:s,successRateOfPlatform:a,avgValue:r}}},{key:\"reset\",value:function(e){at(e)?this._map.clear():this._map.set(e,{totalCount:0,successCount:0,failedCountOfUserSide:0,costArray:[],fileSizeArray:[]})}}]),e}(),$i=function(){function e(){o(this,e),this._lastMap=new Map,this._currentMap=new Map}return a(e,[{key:\"initMap\",value:function(e){var t=this;e.forEach((function(e){t._lastMap.set(e,new Map),t._currentMap.set(e,new Map)}))}},{key:\"addMessageSequence\",value:function(e){var t=e.key,n=e.message;if(at(t)||!this._lastMap.has(t)||!this._currentMap.has(t))return!1;var o=n.conversationID,s=n.sequence,a=o.replace(S.CONV_GROUP,\"\");if(0===this._lastMap.get(t).size)this._addCurrentMap(e);else if(this._lastMap.get(t).has(a)){var r=this._lastMap.get(t).get(a),i=r.length-1;s>r[0]&&s100&&(o=100),this._copyData(e),{totalCount:t,successCountOfMessageReceived:n,successRateOfMessageReceived:o}}},{key:\"reset\",value:function(){this._currentMap.clear(),this._lastMap.clear()}}]),e}(),eu=function(e){i(s,e);var n=f(s);function s(e){var t;o(this,s),(t=n.call(this,e))._n=\"QualityStatModule\",t.TAG=\"im-ssolog-quality-stat\",t.reportIndex=0,t.wholePeriod=!1,t._qualityItems=[ga,_a,ha,fa,va,ma,Ma,ya,Ia,Ca],t._messageSentItems=[ha,fa,va,ma,Ma],t._messageReceivedItems=[ya,Ia,Ca],t.REPORT_INTERVAL=120,t.REPORT_SDKAPPID_BLACKLIST=[],t.REPORT_TINYID_WHITELIST=[],t._statInfoArr=[],t._avgRTT=new Qi,t._avgE2EDelay=new Xi,t._rateMessageSent=new Zi,t._rateMessageReceived=new $i;var a=t.getInnerEmitterInstance();return a.on(Za,t._onLoginSuccess,_(t)),a.on($a,t._onCloudConfigUpdated,_(t)),t}return a(s,[{key:\"_onLoginSuccess\",value:function(){var e=this;this._rateMessageSent.initMap(this._messageSentItems),this._rateMessageReceived.initMap(this._messageReceivedItems);var t=this.getModule(xn),n=t.getItem(this.TAG,!1);!jt(n)&&it(n.forEach)&&(xe.l(\"\".concat(this._n,\"._onLoginSuccess get quality stat logs from local storage, count:\").concat(n.length)),n.forEach((function(t){e._statInfoArr.push(t)})),t.removeItem(this.TAG,!1))}},{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"q_rpt_interval\"),t=this.getCloudConfig(\"q_rpt_sdkappid_bl\"),n=this.getCloudConfig(\"q_rpt_tinyid_wl\");at(e)||(this.REPORT_INTERVAL=Number(e)),at(t)||(this.REPORT_SDKAPPID_BLACKLIST=t.split(\",\").map((function(e){return Number(e)}))),at(n)||(this.REPORT_TINYID_WHITELIST=n.split(\",\"))}},{key:\"onCheckTimer\",value:function(e){this.isLoggedIn()&&e%this.REPORT_INTERVAL==0&&(this.wholePeriod=!0,this._report())}},{key:\"addRequestCount\",value:function(){this._avgRTT.addRequestCount()}},{key:\"addRTT\",value:function(e){this._avgRTT.addRTT(e)}},{key:\"addMessageDelay\",value:function(e){this._avgE2EDelay.addMessageDelay(e)}},{key:\"addTotalCount\",value:function(e){this._rateMessageSent.addTotalCount(e)||xe.w(\"\".concat(this._n,\".addTotalCount invalid key:\"),e)}},{key:\"addSuccessCount\",value:function(e){this._rateMessageSent.addSuccessCount(e)||xe.w(\"\".concat(this._n,\".addSuccessCount invalid key:\"),e)}},{key:\"addFailedCountOfUserSide\",value:function(e){this._rateMessageSent.addFailedCountOfUserSide(e)||xe.w(\"\".concat(this._n,\".addFailedCountOfUserSide invalid key:\"),e)}},{key:\"addCost\",value:function(e,t){this._rateMessageSent.addCost(e,t)||xe.w(\"\".concat(this._n,\".addCost invalid key or cost:\"),e,t)}},{key:\"addFileSize\",value:function(e,t){this._rateMessageSent.addFileSize(e,t)||xe.w(\"\".concat(this._n,\".addFileSize invalid key or size:\"),e,t)}},{key:\"addMessageSequence\",value:function(e){this._rateMessageReceived.addMessageSequence(e)||xe.w(\"\".concat(this._n,\".addMessageSequence invalid key:\"),e.key)}},{key:\"_getQualityItem\",value:function(e){var n={},o=Ea[this.getNetworkType()];at(o)&&(o=8);var s={qualityType:Ta[e],timestamp:Ue(),networkType:o,extension:\"\"};switch(e){case ga:n=this._avgRTT.getStatResult();break;case _a:n=this._avgE2EDelay.getStatResult();break;case ha:case fa:case va:case ma:case Ma:n=this._rateMessageSent.getStatResult(e);break;case ya:case Ia:case Ca:n=this._rateMessageReceived.getStatResult(e)}return null===n?null:t(t({},s),n)}},{key:\"_report\",value:function(e){var t=this,n=[],o=null;at(e)?this._qualityItems.forEach((function(e){null!==(o=t._getQualityItem(e))&&(o.reportIndex=t.reportIndex,o.wholePeriod=t.wholePeriod,n.push(o))})):null!==(o=this._getQualityItem(e))&&(o.reportIndex=this.reportIndex,o.wholePeriod=this.wholePeriod,n.push(o)),xe.d(\"\".concat(this._n,\"._report\"),n),this._statInfoArr.length>0&&(n=n.concat(this._statInfoArr),this._statInfoArr=[]);var s=this.getModule(qn),a=s.getSDKAppID(),r=s.getTinyID();wt(this.REPORT_SDKAPPID_BLACKLIST,a)&&!Ft(this.REPORT_TINYID_WHITELIST,r)&&(n=[]),n.length>0&&this._doReport(n)}},{key:\"_doReport\",value:function(e){var n=this,o={header:ti(this),quality:e};this.request({protocolName:xs,requestData:t({},o)}).then((function(){n.reportIndex++,n.wholePeriod=!1})).catch((function(t){xe.w(\"\".concat(n._n,\"._doReport, online:\").concat(n.getNetworkType(),\" error:\"),t),n._statInfoArr=n._statInfoArr.concat(e),n._flushAtOnce()}))}},{key:\"_flushAtOnce\",value:function(){var e=this.getModule(xn),t=e.getItem(this.TAG,!1),n=this._statInfoArr,o=\"\".concat(this._n,\"._flushAtOnce\");if(jt(t))xe.l(\"\".concat(o,\" count:\").concat(n.length)),e.setItem(this.TAG,n,!0,!1);else{var s=n.concat(t);s.length>10&&(s=s.slice(0,10)),xe.l(\"\".concat(o,\" count:\").concat(s.length)),e.setItem(this.TAG,s,!0,!1)}this._statInfoArr=[]}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._report(),this.reportIndex=0,this.wholePeriod=!1,this.REPORT_SDKAPPID_BLACKLIST=[],this.REPORT_TINYID_WHITELIST=[],this._avgRTT.reset(),this._avgE2EDelay.reset(),this._rateMessageSent.reset(),this._rateMessageReceived.reset()}}]),s}(ro),tu=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"WorkerTimerModule\",s._isWorkerEnabled=!0,s._workerTimer=null,s._timerID=-1,s._init(),s.getInnerEmitterInstance().on($a,s._onCloudConfigUpdated,_(s)),s}return a(n,[{key:\"isWorkerEnabled\",value:function(){return this._isWorkerEnabled&&Se}},{key:\"startWorkerTimer\",value:function(){xe.l(\"\".concat(this._n,\".startWorkerTimer\")),this._workerTimer&&this._workerTimer.postMessage(\"start\")}},{key:\"stopWorkerTimer\",value:function(){xe.l(\"\".concat(this._n,\".stopWorkerTimer\")),this._workerTimer&&this._workerTimer.postMessage(\"stop\")}},{key:\"_init\",value:function(){if(Se){var e=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(e);var t=this;this._workerTimer.onmessage=function(e){e.data?(t._timerID=e.data,xe.l(\"\".concat(t._n,\"._init seed:\").concat(t._timerID))):t._m.onCheckTimer()}}}},{key:\"_onCloudConfigUpdated\",value:function(){var e=this.getCloudConfig(\"enable_worker\");xe.l(\"\".concat(this._n,\"._onCloudConfigUpdated enableWorker:\").concat(e)),at(e)||\"1\"===e?!this._isWorkerEnabled&&Se&&(this._isWorkerEnabled=!0,this.startWorkerTimer(),this._m.onWorkerTimerEnabled()):this._isWorkerEnabled&&Se&&(this._isWorkerEnabled=!1,this.stopWorkerTimer(),this._m.onWorkerTimerDisabled())}},{key:\"terminate\",value:function(){xe.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(){xe.l(\"\".concat(this._n,\".reset\"))}}]),n}(ro),nu=function(){function e(){o(this,e),this._n=\"PurchasedFeatureHandler\",this._purchasedFeatureMap=new Map}return a(e,[{key:\"isValidPurchaseBits\",value:function(e){return e&&\"string\"==typeof e&&e.length>=1&&e.length<=64&&/[01]{1,64}/.test(e)}},{key:\"parsePurchaseBits\",value:function(e){if(this.isValidPurchaseBits(e)){this._purchasedFeatureMap.clear();for(var t=null,n=e.length-1,o=0;n>=0;n--,o++)t=o<32?new L(0,Math.pow(2,o)).toString():new L(Math.pow(2,o-32),0).toString(),\"1\"===e[n]?this._purchasedFeatureMap.set(t,!0):this._purchasedFeatureMap.set(t,!1)}else xe.w(\"\".concat(this._n,\".parsePurchaseBits invalid purchasebits:\").concat(e))}},{key:\"hasPurchasedFeature\",value:function(e){return!!this._purchasedFeatureMap.get(e)}},{key:\"isFeatureEnabled\",value:function(e){for(var t=parseInt(e).toString(2),n=void 0,o=!0,s=t.length-1,a=0;s>=0;s--,a++)if(\"1\"===t.charAt(s)&&(n=a<32?new L(0,Math.pow(2,a)).toString():new L(Math.pow(2,a-32),0).toString(),!this._purchasedFeatureMap.get(n))){o=!1;break}return xe.l(\"\".concat(this._n,\".isFeatureEnabled decimalNumber:\").concat(e,\" binaryString:\").concat(t,\" ret:\").concat(o)),za({enabled:o})}},{key:\"clear\",value:function(){this._purchasedFeatureMap.clear()}}]),e}(),ou=function(){function e(t){o(this,e),this._m=t,this._n=\"CommercialConfigModule\",this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler=new nu}return a(e,[{key:\"_canFetch\",value:function(){return this._getModule(qn).isLoggedIn()?!this._isFetching&&Date.now()>=this._expiredTime:(this._expiredTime=Date.now()+2e3,!1)}},{key:\"onCheckTimer\",value:function(e){this._canFetch()&&this.fetchConfig()}},{key:\"fetchConfig\",value:function(){var e=this,t=this._canFetch(),n=\"\".concat(this._n,\".fetchConfig\");if(xe.l(\"\".concat(n,\" canFetch:\").concat(t)),t){var o=this._getModule(Bn),s=new ka(\"fetchCommercialConfig\");s.setNetworkType(o.getNetworkType());var a=this._getModule(qn).getSDKAppID(),r=this._getModule(jn);this._isFetching=!0,r.request({protocolName:Xs,requestData:{SDKAppID:a}}).then((function(t){s.setMessage(\"purchaseBits:\".concat(t.data.purchaseBits)).end(),xe.l(\"\".concat(n,\" ok.\")),e._parseConfig(t.data),e._isFetching=!1})).catch((function(t){o.probe().then((function(e){var n=v(e,2),o=n[0],a=n[1];s.setError(t,o,a).end()})),e._isFetching=!1}))}}},{key:\"onPushedConfig\",value:function(e){var t=\"\".concat(this._n,\".onPushedConfig data:\").concat(JSON.stringify(e));xe.l(\"\".concat(t)),new ka(\"pushedCommercialConfig\").setNetworkType(this._getModule(Bn).getNetworkType()).setMessage(\"purchaseBits:\".concat(e.purchaseBits)).end(),this._parseConfig(e)}},{key:\"_parseConfig\",value:function(e){var t=\"\".concat(this._n,\"._parseConfig\"),n=e.errorCode,o=e.errorMessage,s=e.purchaseBits,a=e.expiredTime;0===n?(this._purchasedFeatureHandler.parsePurchaseBits(s),this._expiredTime=Date.now()+1e3*a):at(n)?(xe.l(\"\".concat(t,\" failed. Invalid message format:\"),e),this._setExpiredTimeOnResponseError(36e5)):(xe.e(\"\".concat(t,\" errorCode:\").concat(n,\" errorMessage:\").concat(o)),this._setExpiredTimeOnResponseError(12e4))}},{key:\"_setExpiredTimeOnResponseError\",value:function(e){this._expiredTime=Date.now()+e}},{key:\"canIUse\",value:function(e){return this._purchasedFeatureHandler.hasPurchasedFeature(e)}},{key:\"isFeatureEnabled\",value:function(e){return this._purchasedFeatureHandler.isFeatureEnabled(e)}},{key:\"_getModule\",value:function(e){return this._m.getModule(e)}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),this._expiredTime=0,this._isFetching=!1,this._purchasedFeatureHandler.clear()}}]),e}(),su=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._m=e,s._n=\"OfflinePushModule\",s._offlinePushPlugin=void 0,s._androidPushConfig={huaweiPushBussinessId:\"\",xiaomiPushBussinessId:\"\",xiaomiPushAppId:\"\",xiaomiPushAppKey:\"\",meizuPushBussinessId:\"\",meizuPushAppId:\"\",meizuPushAppKey:\"\",vivoPushBussinessId:\"\",fcmPushBussinessId:\"\",oppoPushBussinessId:\"\",oppoPushAppKey:\"\",oppoPushAppSecret:\"\",honorPushBussinessId:\"\"},s._deviceToken=\"\",s._businessID=0,s._iosBusinessID=0,s._c2cUnreadCount=0,s._groupUnreadCount=0,s._isWebUniapp=0,s}return a(n,[{key:\"registerPlugin\",value:function(e){if(ne){this._offlinePushPlugin=e[\"tim-offline-push-plugin\"];var t=e.offlinePushConfig||{},n=t.huaweiBusinessID,o=t.xiaomiBusinessID,s=t.xiaomiAppID,a=t.xiaomiAppKey,r=t.meizuBusinessID,i=t.meizuAppID,u=t.meizuAppKey,c=t.vivoBusinessID,l=t.oppoBusinessID,p=t.oppoAppKey,d=t.oppoAppSecret,g=t.honorBusinessID,_=t.iosBusinessID;this._androidPushConfig.huaweiPushBussinessId=n,this._androidPushConfig.xiaomiPushBussinessId=o,this._androidPushConfig.xiaomiPushAppId=s,this._androidPushConfig.xiaomiPushAppKey=a,this._androidPushConfig.meizuPushBussinessId=r,this._androidPushConfig.meizuPushAppId=i,this._androidPushConfig.meizuPushAppKey=u,this._androidPushConfig.vivoPushBussinessId=c,this._androidPushConfig.oppoPushBussinessId=l,this._androidPushConfig.oppoPushAppKey=p,this._androidPushConfig.oppoPushAppSecret=d,this._androidPushConfig.honorPushBussinessId=g,new ka(\"registerPlugin\").setMessage(\"tim-offline-push-plugin\").setMoreMessage(\"isExist:\".concat(!at(this._offlinePushPlugin))).end(!0),xe.l(\"\".concat(this._n,\".\").concat(\"registerPlugin\",\" ok. offlinePushConfig:\").concat(JSON.stringify(e.offlinePushConfig))),this._iosBusinessID=_,this._setAppShowListener()}else this.outputWarning(\"OfflinePushInUniapp\")}},{key:\"init\",value:function(){this._isWebUniapp=this.getUniAppPlatform(),this._getDeviceToken()}},{key:\"_getDeviceToken\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_getDeviceToken\");if(it(this._offlinePushPlugin.getDeviceToken)){var n=\"androidPushConfig:\".concat(JSON.stringify(this._androidPushConfig),\", iosBusinessID:\").concat(this._iosBusinessID);xe.l(\"\".concat(t,\" start. \").concat(n)),new ka(\"_getDeviceToken\").setMessage(\"\".concat(n)).end(!0),this._offlinePushPlugin.getDeviceToken(this._androidPushConfig,(function(o){var s=new ka(\"getDeviceTokenRes\"),a=o.code,r=o.msg;if(0===a){var i=o.data,u=i.deviceToken,c=i.deviceBrand,l=i.deviceType,p=i.bussinessId;e._deviceToken=u,e._businessID=p||e._iosBusinessID,n=\"deviceToken:\".concat(u,\", deviceBrand:\").concat(c||l,\", businessID:\").concat(e._businessID),xe.l(\"\".concat(t,\" ok. \").concat(n)),s.setMessage(n).end(!0),e._setToken()}else s.setMessage(\"code:\".concat(a,\", msg:\").concat(r)).end(!0),xe.e(\"\".concat(t,\" failed. error:\"),o)}))}else xe.e(\"\".concat(t,\" getDeviceToken is not a function\"))}},{key:\"canIUseOfflinePush\",value:function(){return ne&&!at(this._offlinePushPlugin)}},{key:\"_setAppShowListener\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_setAppShowListener\");at(this._offlinePushPlugin)?xe.e(\"\".concat(t,\" offlinePushPlugin is undefined\")):it(this._offlinePushPlugin.setAppShowListener)?(new ka(\"_setAppShowListener\").end(!0),xe.l(\"\".concat(t,\" start\")),this._offlinePushPlugin.setAppShowListener((function(n){var o=(n||{}).appShow;new ka(\"setAppShowListenerRes\").setMessage(\"appShow:\".concat(o)).end(!0),xe.l(\"\".concat(t,\" ok. appShow:\").concat(o)),e._m.isReady()&&(0===o?(e._getConvUnreadCount(),e._onBackground()):1===o&&e._onForeground())}))):xe.e(\"\".concat(t,\" setAppShowListener is not a function\"))}},{key:\"getDeviceBrand\",value:function(){if(!at(this._offlinePushPlugin)&&it(this._offlinePushPlugin.getDeviceType)){var e=(this._offlinePushPlugin.getDeviceType()||{}).deviceType;return xe.l(\"\".concat(this._n,\".getDeviceBrand ok. deviceType:\").concat(e)),e}}},{key:\"_setToken\",value:function(){var e,t=this,n=\"\".concat(this._n,\"._setToken\"),o=this.getModule(qn),s=1,a=\"\",r=\"\";jt(this._deviceToken)&&(s=0);var i=this.getUniAppPlatform(),u=this.getDeviceBrand();i===R.IOS||i===R.IPAD||i===R.MAC?r=this._deviceToken:i===R.ANDROID&&(a=this._deviceToken);var c=new ka(\"offlinePushSetToken\");return e=\"deviceToken:\".concat(r||a,\", businessID:\").concat(this._businessID,\", \")+\"deviceBrand:\".concat(u,\", isWebUniapp:\").concat(this._isWebUniapp,\", pushMsg:\").concat(s,\", platform:\").concat(i),c.setMessage(\"\".concat(e)),xe.l(\"\".concat(n,\" \").concat(e)),this.request({protocolName:ca,requestData:{tokenID:a,pushMsg:s,sdkAppID:o.getSDKAppID(),businessID:parseInt(this._businessID),deviceBrand:u,deviceToken:r,isWebUniapp:this._isWebUniapp}}).then((function(e){return c.end(),xe.l(\"\".concat(n,\" ok\")),e})).catch((function(e){return t.probeNetwork().then((function(t){var n=v(t,2),o=n[0],s=n[1];c.setError(e,o,s).end()})),xe.e(\"\".concat(n,\" failed. error:\"),e),Ja(e)}))}},{key:\"_getConvUnreadCount\",value:function(){var e=this;this._c2cUnreadCount=0,this._groupUnreadCount=0,this.getModule(Fn).getLocalConversationList().forEach((function(t){t.type===S.CONV_C2C&&(e._c2cUnreadCount+=t.unreadCount),t.type===S.CONV_GROUP&&(e._groupUnreadCount+=t.unreadCount)}))}},{key:\"_onBackground\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_onBackground\"),n=new ka(\"_onBackground\");this.request({protocolName:ia,requestData:{c2cUnreadCount:this._c2cUnreadCount,groupUnreadCount:this._groupUnreadCount,isWebUniapp:this._isWebUniapp}}).then((function(o){return n.setMessage(\"c2cUnreadCount: \".concat(e._c2cUnreadCount,\", groupUnreadCount: \").concat(e._groupUnreadCount)).end(),xe.l(\"\".concat(t,\" ok\")),o})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];n.setError(o,s,a).end()})),xe.e(\"\".concat(t,\" failed. error:\"),o)}))}},{key:\"_onForeground\",value:function(){var e=this,t=\"\".concat(this._n,\".\").concat(\"_onForeground\"),n=new ka(\"_onForeground\");this.request({protocolName:ua,requestData:{isWebUniapp:this._isWebUniapp}}).then((function(e){return n.end(),xe.l(\"\".concat(t,\" ok\")),e})).catch((function(o){e.probeNetwork().then((function(e){var t=v(e,2),s=t[0],a=t[1];n.setError(o,s,a).end()})),xe.e(\"\".concat(t,\" failed. error:\"),o)}))}},{key:\"getUniAppPlatform\",value:function(){var e=uni.getSystemInfoSync().platform,t=this.getDeviceBrand();return\"ios\"===e?R.IOS:\"android\"===e?R.ANDROID:1002===t?R.IPAD:1001===t?R.MAC:void 0}},{key:\"reset\",value:function(){this._deviceToken=\"\",this._businessID=0,this._c2cUnreadCount=0,this._groupUnreadCount=0,this._isWebUniapp=0,xe.l(\"\".concat(this._n,\".reset\"))}}]),n}(ro),au=function(e){i(n,e);var t=f(n);function n(e){var s;return o(this,n),(s=t.call(this,e))._n=\"ProfanityFilterModule\",s._plugin=null,s._filterConfigMap=new Map,s._startIndex=0,s._version=0,s._canIUseLexicon=!1,s._isFetching=!1,s._expiredTime=0,s}return a(n,[{key:\"init\",value:function(){var e=this.getModule(Wn).getPlugin(\"tim-profanity-filter-plugin\");e?(this._plugin=new e({logger:xe,isArray:st,isMap:Qe,isDevMode:this.isDevMode()}),this._getLexicon()):this.outputWarning(\"ProfanityPluginNotFound\")}},{key:\"onCheckTimer\",value:function(){this._plugin&&this._canIUseLexicon&&this.isLoggedIn()&&!this._isFetching&&Date.now()>=this._expiredTime&&this._getLexicon()}},{key:\"filterMessage\",value:function(e,t){var n=!0;if(!this._plugin||!this._canIUseLexicon)return n;if(t&&t.messageControlInfo&&!0===t.messageControlInfo.excludedFromContentModeration)return n;var o=e.type,s=e.conversationType;if(o!==S.MSG_TEXT&&o!==S.MSG_CUSTOM)return n;var a,r=\"\".concat(this._n,\".filterMessage\");if(xe.l(\"\".concat(r)),o===S.MSG_TEXT){if(s===S.CONV_C2C?a=H:s===S.CONV_GROUP&&(a=W),!this._isConfigOn(a))return n;var i=this._plugin.filter(e.payload.text),u=i.type,c=i.modifiedText;1===u?n=!1:2===u&&(e.payload.text=c)}else if(o===S.MSG_CUSTOM){if(s===S.CONV_C2C?a=K:s===S.CONV_GROUP&&(a=Y),!this._isConfigOn(a))return n;var l=this._plugin.filter(e.payload.data),p=this._plugin.filter(e.payload.description),d=this._plugin.filter(e.payload.extension);1===l.type||1===p.type||1===d.type?n=!1:(2===l.type&&(e.payload.data=l.modifiedText),2===p.type&&(e.payload.description=p.modifiedText),2===d.type&&(e.payload.extension=d.modifiedText))}return xe.l(\"\".concat(r,\" done. isAllowedToSend:\").concat(n)),n}},{key:\"filterText\",value:function(e,t){var n=\"\".concat(this._n,\".filterText\"),o={isAllowedToSend:!0,modifiedText:e};if(!this._plugin||!this._canIUseLexicon)return o;if(!this._isConfigOn(t))return o;xe.l(\"\".concat(n));var s=this._plugin.filter(e),a=s.type,r=s.modifiedText;return 1===a?o.isAllowedToSend=!1:2===a&&(o.modifiedText=r),xe.l(\"\".concat(n,\" done. ret:\"),o),o}},{key:\"_getLexicon\",value:function(){var e=this,t=new ka(\"profanityFilter\"),n=\"\".concat(this._n,\"._getLexicon\");this._isFetching=!0,this.request({protocolName:la,requestData:{startIndex:this._startIndex,version:this._version}}).then((function(o){var s=o.data,a=s.errorInfo,r=s.filterConfig,i=s.lexicon,u=s.strToken,c=s.completeFlag,l=s.nextStartIndex,p=s.version,d=s.expiredTime,g=a.errorCode,_=a.errorMessage;return 0!==g?(e._isFetching=!1,xe.w(\"\".concat(n,\" failed. error:\"),a),void t.setCode(g).setMessage(_).end()):(e._onFilterConfig(r),e._getToken(u),1===c?(xe.l(\"\".concat(n,\" done. version:\").concat(p,\" expiredTime:\").concat(d)),e._version=p,e._canIUseLexicon=!0,e._isFetching=!1,e._expiredTime=Date.now()+1e3*d,void e._plugin.onLexiconCompleted(i)):(e._startIndex=l,e._plugin.onLexiconSliced(i),void e._getLexicon()))})).catch((function(o){e.probeNetwork().then((function(e){var n=v(e,2),s=n[0],a=n[1];t.setError(o,s,a).end()})),e._isFetching=!1,xe.l(\"\".concat(n,\" failed. error:\"),o)}))}},{key:\"_onFilterConfig\",value:function(e){var t=this;jt(e)||(this._filterConfigMap.clear(),Object.keys(e).forEach((function(n){t._filterConfigMap.set(n,e[n])})),xe.l(\"\".concat(this._n,\"._onFilterConfig. keys:\").concat(Array.from(this._filterConfigMap.keys()),\" values:\").concat(Array.from(this._filterConfigMap.values()))))}},{key:\"_isConfigOn\",value:function(e){return 1===this._filterConfigMap.get(e)}},{key:\"_getToken\",value:function(e){if(et(e)){var t=e.length,n=\"\";if(t%2==0)for(var o=0;o<=t-1;o+=2)n+=e[o+1],n+=e[o];else{for(var s=0;s=this.STORAGE_EXPIRES_TIME,s=!n||\"2.27.5\"!==n;return xe.l(\"\".concat(this._n,\"._needToUpdate isTimeout:\").concat(o,\" isDifferentVersion:\").concat(s)),o||s}},{key:\"_fetch\",value:function(){if(!this._m.getModule(qn).isPrivateNetWork()){var e=\"https://web.sdk.qcloud.com/im/download/error-message/0.0.1/tim-error-message.txt\",t=\"application/x-www-form-urlencoded;charset=UTF-8\",n=\"\".concat(this._n,\"._fetch ok in\"),o=this;if(se)re.request({url:e,method:\"GET\",timeout:3e3,header:{\"content-type\":t},dataType:\"text\",success:function(e){o._fillAndSave(e.data),xe.l(\"\".concat(n,\" mini program\"))},fail:function(){}});else{var s=new XMLHttpRequest,a=setTimeout((function(){s.abort()}),3e3);s.onreadystatechange=function(){4===s.readyState&&(clearTimeout(a),200!==s.status&&304!==s.status||(xe.l(\"\".concat(n,\" browser\")),o._fillAndSave(s.responseText)))},s.open(\"GET\",e,!0),s.setRequestHeader(\"Content-type\",t),s.send()}}}},{key:\"_fillAndSave\",value:function(e){this._fillMap(e),this._getStorageModule().setItem(this.TIM_ERROR_ASSISTANCE,JSON.stringify({message:e,localSavedTime:(new Date).getTime(),localSavedVersion:\"2.27.5\"}),!0,!1)}},{key:\"_getStorageModule\",value:function(){return this._m.getModule(xn)}},{key:\"_fillMap\",value:function(e){this._map.clear();for(var t,n,o,s=e.split(\";\\n\"),a=s.length,r=new RegExp(/'/g),i=0;i0&&(clearInterval(this._checkTimer),this._checkTimer=-1,this._checkCount=0)}},{key:\"_stopMainThreadSocket\",value:function(){xe.l(\"\".concat(this._n,\"._stopMainThreadSocket\"));var e=this._moduleMap.get(zn);e.setIsWorkerEnabled(!0),e.reConnect()}},{key:\"_startMainThreadSocket\",value:function(){xe.l(\"\".concat(this._n,\"._startMainThreadSocket\"));var e=this._moduleMap.get(zn);e.setIsWorkerEnabled(!1),e.reConnect()}},{key:\"onWorkerTimerEnabled\",value:function(){xe.l(\"\".concat(this._n,\".onWorkerTimerEnabled, disable main thread timer and socket\")),this._stopMainThreadTimer(),this._stopMainThreadSocket()}},{key:\"onWorkerTimerDisabled\",value:function(){xe.l(\"\".concat(this._n,\".onWorkerTimerDisabled, enable main thread timer and socket\")),this._startMainThreadTimer(),this._startMainThreadSocket()}},{key:\"onCheckTimer\",value:function(){this._checkCount+=1;var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.onCheckTimer&&n.onCheckTimer(this._checkCount)}}catch(o){t.e(o)}finally{t.f()}}},{key:\"_initReadyList\",value:function(){var e=this;this._readyList=[this._moduleMap.get(An),this._moduleMap.get(Fn)],this._readyList.forEach((function(t){t.ready((function(){return e._onModuleReady()}))}))}},{key:\"_onModuleReady\",value:function(){var e=!0;if(this._readyList.forEach((function(t){t.isReady()||(e=!1)})),e&&!this._isReady){this._isReady=!0,this._outerEmitter.emit(E.SDK_READY);var t=Date.now()-this._startLoginTs;xe.w(\"SDK is ready. cost \".concat(t,\" ms\")),this._startLoginTs=Date.now();var n=this._moduleMap.get(Bn).getNetworkType(),o=this._ssoLogForReady.getStartTs()+Ge;this._ssoLogForReady.setNetworkType(n).setMessage(t).start(o).end()}}},{key:\"login\",value:function(){0===this._startLoginTs&&(Pe(),this._startLoginTs=Date.now(),this._startTimer(),this._moduleMap.get(Bn).start(),this._ssoLogForReady=new ka(\"sdkReady\"),this._reason=da.LOGGING_IN)}},{key:\"onLoginFailed\",value:function(){this._startLoginTs=0}},{key:\"getOuterEmitterInstance\",value:function(){return null===this._outerEmitter&&(this._outerEmitter=new ii,ja(this._outerEmitter),this._outerEmitter._emit=this._outerEmitter.emit,this._outerEmitter.emit=function(e,t){var n=this;if(e===E.CONVERSATION_LIST_UPDATED||e===E.FRIEND_LIST_UPDATED||e===E.GROUP_LIST_UPDATED||e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED)if(this._eventThrottleMap.has(e)){var o=Date.now(),s=this._eventThrottleMap.get(e);o-s.last<=1e3?(s.timeoutID&&clearTimeout(s.timeoutID),s.timeoutID=setTimeout((function(){s.last=Date.now(),n._outerEmitter._emit.apply(n._outerEmitter,[e,{name:e,data:n._getEventData(e)}])}),1e3)):(s.last=o,this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]))}else this._eventThrottleMap.set(e,{last:Date.now(),timeoutID:-1}),this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:this._getEventData(e)}]);else this._outerEmitter._emit.apply(this._outerEmitter,[e,{name:e,data:arguments[1]}])}.bind(this)),this._outerEmitter}},{key:\"_getEventData\",value:function(e){return e===E.CONVERSATION_LIST_UPDATED?this._moduleMap.get(Fn).getLocalConversationList():e===E.FRIEND_LIST_UPDATED?this._moduleMap.get(Pn).getLocalFriendList(!1):e===E.GROUP_LIST_UPDATED?this._moduleMap.get(Un).getLocalGroupList():e===E.TOTAL_UNREAD_MESSAGE_COUNT_UPDATED?this._moduleMap.get(Fn).getTotalUnreadMessageCount():void 0}},{key:\"getInnerEmitterInstance\",value:function(){return null===this._innerEmitter&&(this._innerEmitter=new ii,this._innerEmitter._emit=this._innerEmitter.emit,this._innerEmitter.emit=function(e,t){var n;n=ot(arguments[1])&&arguments[1].data?[e,{name:arguments[0],data:arguments[1].data}]:[e,{name:arguments[0],data:arguments[1]}],this._innerEmitter._emit.apply(this._innerEmitter,n)}.bind(this)),this._innerEmitter}},{key:\"hasModule\",value:function(e){return this._moduleMap.has(e)}},{key:\"getModule\",value:function(e){return this._moduleMap.get(e)}},{key:\"isReady\",value:function(){return this._isReady}},{key:\"isIntl\",value:function(){return this.getModule(qn).isIntl()}},{key:\"getNotReadyReason\",value:function(){return this._reason}},{key:\"setNotReadyReason\",value:function(e){this._reason=e}},{key:\"getErrorMessage\",value:function(e,t,n){return this._moduleMap.get(ao).get({key:e,replacement1:t,replacement2:n,isIntl:this.isIntl()})}},{key:\"outputWarning\",value:function(e,t,n){var o=this.getErrorMessage(e,t,n);o&&xe.w(o)}},{key:\"onError\",value:function(e){var t=\"code:\".concat(e.code,\" message:\").concat(e.message);xe.w(\"Oops! \".concat(t)),new ka(\"error\").setMessage(t).setNetworkType(this.getModule(Bn).getNetworkType()).setLevel(\"error\").end(),this.getOuterEmitterInstance().emit(E.ERROR,e)}},{key:\"restartTimer\",value:function(){xe.l(\"\".concat(this._n,\".restartTimer\")),this.stopTimer(),this._startTimer(),this.getModule(Un).restartPolling()}},{key:\"getTimerID\",value:function(){var e=this._moduleMap.get(Qn);return e.isWorkerEnabled()?e.getTimerID():this._checkTimer}},{key:\"getPollingTimerID\",value:function(e){return this._moduleMap.get(Un).getPollingTimerID(e)}},{key:\"reset\",value:function(){xe.l(\"\".concat(this._n,\".reset\")),Pe();var e,t=D(this._moduleMap);try{for(t.s();!(e=t.n()).done;){var n=v(e.value,2)[1];n.reset&&n.reset()}}catch(r){t.e(r)}finally{t.f()}this._startLoginTs=0,this._initReadyList(),this._isReady=!1,this.stopTimer(),this._outerEmitter.emit(E.SDK_NOT_READY);var o,s=D(this._eventThrottleMap);try{for(s.s();!(o=s.n()).done;){var a=v(o.value,2)[1];a.timeoutID&&clearTimeout(a.timeoutID)}}catch(r){s.e(r)}finally{s.f()}this._eventThrottleMap.clear()}}]),e}(),cu=function(){function e(t){o(this,e),this._funcMap=new Map,this._m=t}return a(e,[{key:\"defense\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;if(\"string\"!=typeof e)return null;if(0===e.length)return null;if(\"function\"!=typeof t)return null;if(this._funcMap.has(e)&&this._funcMap.get(e).has(t))return this._funcMap.get(e).get(t);this._funcMap.has(e)||this._funcMap.set(e,new Map);var o=null;return this._funcMap.get(e).has(t)?o=this._funcMap.get(e).get(t):(o=this._pack(e,t,n),this._funcMap.get(e).set(t,o)),o}},{key:\"defenseOnce\",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;return\"function\"!=typeof t?null:this._pack(e,t,n)}},{key:\"find\",value:function(e,t){return\"string\"!=typeof e||0===e.length||\"function\"!=typeof t?null:this._funcMap.has(e)&&this._funcMap.get(e).has(t)?this._funcMap.get(e).get(t):(this._m.outputWarning(\"ListenerFnNotFound\",e),null)}},{key:\"delete\",value:function(e,t){return\"function\"==typeof t&&(!!this._funcMap.has(e)&&(!!this._funcMap.get(e).has(t)&&(this._funcMap.get(e).delete(t),0===this._funcMap.get(e).size&&this._funcMap.delete(e),!0)))}},{key:\"_pack\",value:function(e,t,n){var o=this;return function(){try{t.apply(n,Array.from(arguments))}catch(u){var s=Object.values(E).indexOf(e),a=\"CallbackError\";if(-1!==s){var r=Object.keys(E)[s];o._m.outputWarning(a,r,u)}var i=new ka(a);i.setMessage(\"eventName:\".concat(e)).setMoreMessage(u.message).end()}}}}]),e}(),lu=function(){function e(t){o(this,e);var n={SDKAppID:t.SDKAppID,unlimitedAVChatRoom:t.unlimitedAVChatRoom||!1,scene:t.scene||\"\",oversea:t.oversea||!1,instanceID:Rt(),devMode:t.devMode||!1,proxyServer:t.proxyServer||void 0,fileUploadProxy:t.fileUploadProxy||void 0,fileDownloadProxy:t.fileDownloadProxy||t.fileUploadProxy||void 0};this._m=new uu(n),this._safetyCallbackFactory=new cu(this._m)}return a(e,[{key:\"onError\",value:function(e){this._m.onError(e)}},{key:\"login\",value:function(e){return this._m.login(),this._getModule(An).login(e)}},{key:\"logout\",value:function(){var e=this;return this._getModule(An).logout().then((function(t){return e._m.reset(),t}))}},{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:\"getErrorMessage\",value:function(e,t,n){return this._m.getErrorMessage(e,t,n)}},{key:\"_getModule\",value:function(e){return this._m.getModule(e)}},{key:\"destroy\",value:function(){var e=this;return this.logout().finally((function(){e._m.stopTimer(),e._getModule(Qn).terminate(),e._getModule(zn).dealloc();var t=e._m.getOuterEmitterInstance(),n=e._getModule(qn);t.emit(E.SDK_DESTROY,{SDKAppID:n.getSDKAppID()})}))}},{key:\"on\",value:function(e,t,n){xe.d(\"on\",\"eventName:\".concat(e)),this._m.getOuterEmitterInstance().on(e,this._safetyCallbackFactory.defense(e,t,n),n)}},{key:\"once\",value:function(e,t,n){xe.d(\"once\",\"eventName:\".concat(e)),this._m.getOuterEmitterInstance().once(e,this._safetyCallbackFactory.defenseOnce(e,t,n),n||this)}},{key:\"off\",value:function(e,t,n,o){xe.d(\"off\",\"eventName:\".concat(e));var s=this._safetyCallbackFactory.find(e,t);null!==s&&(this._m.getOuterEmitterInstance().off(e,s,n,o),this._safetyCallbackFactory.delete(e,t))}},{key:\"registerPlugin\",value:function(e){at(e[\"tim-offline-push-plugin\"])?this._getModule(Wn).registerPlugin(e):this._getModule(to).registerPlugin(e)}},{key:\"setLogLevel\",value:function(e){if(e<=0){var t=this.getErrorMessage(\"TIM_ASCII_ART\");t&&console.log(t);var n=this.getErrorMessage(\"API_REFER\");if(n){Ht()?console.log(\"%c \".concat(\"IM SDK API ->\",\" %c\"),\"background:#ff9d00; padding:1px; border-radius:3px; color: #fff\",\"background:transparent\",n):console.log(\"IM SDK API ->\",n)}var o=this.getErrorMessage(\"DOCS_GUIDE\");o&&console.log(o)}xe.setLevel(e)}},{key:\"createTextMessage\",value:function(e){return this._getModule(Rn).createTextMessage(e)}},{key:\"createTextAtMessage\",value:function(e){return this._getModule(Rn).createTextMessage(e)}},{key:\"createImageMessage\",value:function(e){return this._getModule(Rn).createImageMessage(e)}},{key:\"createAudioMessage\",value:function(e){return this._getModule(Rn).createAudioMessage(e)}},{key:\"createVideoMessage\",value:function(e){return this._getModule(Rn).createVideoMessage(e)}},{key:\"createCustomMessage\",value:function(e){return this._getModule(Rn).createCustomMessage(e)}},{key:\"createFaceMessage\",value:function(e){return this._getModule(Rn).createFaceMessage(e)}},{key:\"createFileMessage\",value:function(e){return this._getModule(Rn).createFileMessage(e)}},{key:\"createLocationMessage\",value:function(e){return this._getModule(Rn).createLocationMessage(e)}},{key:\"createMergerMessage\",value:function(e){return this._getModule(Rn).createMergerMessage(e)}},{key:\"downloadMergerMessage\",value:function(e){return e.type!==S.MSG_MERGER?Ja({code:da.MESSAGE_MERGER_TYPE_INVALID}):jt(e.payload.downloadKey)?Ja({code:da.MESSAGE_MERGER_KEY_INVALID}):this._getModule(Rn).downloadMergerMessage(e).catch((function(e){return Ja({code:da.MESSAGE_MERGER_DOWNLOAD_FAIL})}))}},{key:\"createForwardMessage\",value:function(e){return this._getModule(Rn).createForwardMessage(e)}},{key:\"sendMessage\",value:function(e,t){return e instanceof Ha?this._getModule(Rn).sendMessageInstance(e,t):Ja({code:da.MESSAGE_SEND_NEED_MESSAGE_INSTANCE})}},{key:\"callExperimentalAPI\",value:function(e,t){return\"sendComboMessage\"===e?this._getModule(so).sendMessage(t):\"handleGroupInvitation\"===e?this._getModule(Un).handleGroupInvitation(t):\"isCommercialAbilityEnabled\"===e?this._getModule(eo).isFeatureEnabled(t):\"isIntl\"===e?this.isIntl():\"sendTRTCCustomData\"===e?this._getModule(oo).sendTRTCCustomData(t):\"getTimerID\"===e?this._m.getTimerID():\"getPollingTimerID\"===e?this._m.getPollingTimerID(t):Ja({code:da.INVALID_OPERATION})}},{key:\"revokeMessage\",value:function(e){return this._getModule(Rn).revokeMessage(e)}},{key:\"resendMessage\",value:function(e){return this._getModule(Rn).resendMessage(e)}},{key:\"deleteMessage\",value:function(e){return this._getModule(Rn).deleteMessage(e)}},{key:\"translateText\",value:function(e){return this._getModule(Rn).translateText(e)}},{key:\"setMessageExtensions\",value:function(e,t){return this._getModule(Nn).setMessageExtensions(e,t)}},{key:\"getMessageExtensions\",value:function(e){return this._getModule(Nn).getMessageExtensions(e)}},{key:\"deleteMessageExtensions\",value:function(e,t){return this._getModule(Nn).deleteMessageExtensions(e,t)}},{key:\"modifyMessage\",value:function(e){return this._getModule(Rn).modifyRemoteMessage(e)}},{key:\"getMessageList\",value:function(e){return this._getModule(Fn).getMessageList(e)}},{key:\"getMessageListHopping\",value:function(e){return this._getModule(Fn).getMessageListHopping(e)}},{key:\"sendMessageReadReceipt\",value:function(e){return this._getModule(Fn).sendReadReceipt(e)}},{key:\"getMessageReadReceiptList\",value:function(e){return this._getModule(Fn).getReadReceiptList(e)}},{key:\"getGroupMessageReadMemberList\",value:function(e){return this._getModule(Un).getReadReceiptDetail(e)}},{key:\"findMessage\",value:function(e){return this._getModule(Fn).findMessage(e)}},{key:\"setMessageRead\",value:function(e){return this._getModule(Fn).setMessageRead(e)}},{key:\"getConversationList\",value:function(e){return this._getModule(Fn).getConversationList(e)}},{key:\"getConversationProfile\",value:function(e){return this._getModule(Fn).getConversationProfile(e)}},{key:\"deleteConversation\",value:function(e){return this._getModule(Fn).deleteConversation(e)}},{key:\"clearHistoryMessage\",value:function(e){return this._getModule(Fn).clearHistoryMessage(e)}},{key:\"pinConversation\",value:function(e){return this._getModule(Fn).pinConversation(e)}},{key:\"setAllMessageRead\",value:function(e){return this._getModule(Fn).setAllMessageRead(e)}},{key:\"setMessageRemindType\",value:function(e){return this._getModule(Fn).setMessageRemindType(e)}},{key:\"getTotalUnreadMessageCount\",value:function(){return this._getModule(Fn).getTotalUnreadMessageCount()}},{key:\"setConversationCustomData\",value:function(e){return this._getModule(Fn).setConversationCustomData(e)}},{key:\"markConversation\",value:function(e){return this._getModule(Fn).markConversation(e)}},{key:\"getConversationGroupList\",value:function(){return this._getModule(Fn).getConversationGroupList()}},{key:\"createConversationGroup\",value:function(e){return this._getModule(Fn).createConversationGroup(e)}},{key:\"deleteConversationGroup\",value:function(e){return this._getModule(Fn).deleteConversationGroup(e)}},{key:\"renameConversationGroup\",value:function(e){return this._getModule(Fn).renameConversationGroup(e)}},{key:\"addConversationsToGroup\",value:function(e){return this._getModule(Fn).addConversationsToGroup(e)}},{key:\"deleteConversationsFromGroup\",value:function(e){return this._getModule(Fn).deleteConversationsFromGroup(e)}},{key:\"getMyProfile\",value:function(){return this._getModule(On).getMyProfile()}},{key:\"getUserProfile\",value:function(e){return this._getModule(On).getUserProfile(e)}},{key:\"updateMyProfile\",value:function(e){return this._getModule(On).updateMyProfile(e)}},{key:\"getBlacklist\",value:function(){return this._getModule(On).getLocalBlacklist()}},{key:\"addToBlacklist\",value:function(e){return this._getModule(On).addBlacklist(e)}},{key:\"removeFromBlacklist\",value:function(e){return this._getModule(On).deleteBlacklist(e)}},{key:\"setSelfStatus\",value:function(e){return this._getModule(On).setSelfStatus(e)}},{key:\"getUserStatus\",value:function(e){return this._getModule(On).getUserStatus(e)}},{key:\"subscribeUserStatus\",value:function(e){return this._getModule(On).subscribeUserStatus(e)}},{key:\"unsubscribeUserStatus\",value:function(e){return this._getModule(On).unsubscribeUserStatus(e)}},{key:\"getFriendList\",value:function(){var e=this._getModule(Pn);return e?e.getLocalFriendList():Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"addFriend\",value:function(e){var t=this._getModule(Pn);return t?t.addFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"deleteFriend\",value:function(e){var t=this._getModule(Pn);return t?t.deleteFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"checkFriend\",value:function(e){var t=this._getModule(Pn);return t?t.checkFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"getFriendProfile\",value:function(e){var t=this._getModule(Pn);return t?t.getFriendProfile(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"updateFriend\",value:function(e){var t=this._getModule(Pn);return t?t.updateFriend(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"getFriendApplicationList\",value:function(){var e=this._getModule(Pn);return e?e.getLocalFriendApplicationList():Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"acceptFriendApplication\",value:function(e){var t=this._getModule(Pn);return t?t.acceptFriendApplication(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"refuseFriendApplication\",value:function(e){var t=this._getModule(Pn);return t?t.refuseFriendApplication(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"deleteFriendApplication\",value:function(e){var t=this._getModule(Pn);return t?t.deleteFriendApplication(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"setFriendApplicationRead\",value:function(){var e=this._getModule(Pn);return e?e.setFriendApplicationRead():Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"getFriendGroupList\",value:function(){var e=this._getModule(Pn);return e?e.getLocalFriendGroupList():Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"createFriendGroup\",value:function(e){var t=this._getModule(Pn);return t?t.createFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"deleteFriendGroup\",value:function(e){var t=this._getModule(Pn);return t?t.deleteFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"addToFriendGroup\",value:function(e){var t=this._getModule(Pn);return t?t.addToFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"removeFromFriendGroup\",value:function(e){var t=this._getModule(Pn);return t?t.removeFromFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"renameFriendGroup\",value:function(e){var t=this._getModule(Pn);return t?t.renameFriendGroup(e):Ja({code:da.CANNOT_FIND_MODULE})}},{key:\"getGroupList\",value:function(e){return this._getModule(Un).getGroupList(e)}},{key:\"getGroupProfile\",value:function(e){return this._getModule(Un).getGroupProfile(e)}},{key:\"createGroup\",value:function(e){return this._getModule(Un).createGroup(e)}},{key:\"dismissGroup\",value:function(e){return this._getModule(Un).dismissGroup(e)}},{key:\"updateGroupProfile\",value:function(e){return this._getModule(Un).updateGroupProfile(e)}},{key:\"joinGroup\",value:function(e){return this._getModule(Un).joinGroup(e)}},{key:\"quitGroup\",value:function(e){return this._getModule(Un).quitGroup(e)}},{key:\"searchGroupByID\",value:function(e){return this._getModule(Un).searchGroupByID(e)}},{key:\"getGroupOnlineMemberCount\",value:function(e){return this._getModule(Un).getGroupOnlineMemberCount(e)}},{key:\"changeGroupOwner\",value:function(e){return this._getModule(Un).changeGroupOwner(e)}},{key:\"getGroupApplicationList\",value:function(){return this._getModule(Un).getGroupApplicationList()}},{key:\"handleGroupApplication\",value:function(e){return this._getModule(Un).handleGroupApplication(e)}},{key:\"initGroupAttributes\",value:function(e){return this._getModule(Un).initGroupAttributes(e)}},{key:\"setGroupAttributes\",value:function(e){return this._getModule(Un).setGroupAttributes(e)}},{key:\"deleteGroupAttributes\",value:function(e){return this._getModule(Un).deleteGroupAttributes(e)}},{key:\"getGroupAttributes\",value:function(e){return this._getModule(Un).getGroupAttributes(e)}},{key:\"setGroupCounters\",value:function(e){return this._getModule(Un).setGroupCounters(e)}},{key:\"increaseGroupCounter\",value:function(e){return this._getModule(Un).increaseGroupCounter(e)}},{key:\"decreaseGroupCounter\",value:function(e){return this._getModule(Un).decreaseGroupCounter(e)}},{key:\"getGroupCounters\",value:function(e){return this._getModule(Un).getGroupCounters(e)}},{key:\"getGroupMemberList\",value:function(e){return this._getModule(bn).getGroupMemberList(e)}},{key:\"getGroupMemberProfile\",value:function(e){return this._getModule(bn).getGroupMemberProfile(e)}},{key:\"addGroupMember\",value:function(e){return this._getModule(bn).addGroupMember(e)}},{key:\"deleteGroupMember\",value:function(e){return this._getModule(bn).deleteGroupMember(e)}},{key:\"setGroupMemberMuteTime\",value:function(e){return this._getModule(bn).setGroupMemberMuteTime(e)}},{key:\"setGroupMemberRole\",value:function(e){return this._getModule(bn).setGroupMemberRole(e)}},{key:\"setGroupMemberNameCard\",value:function(e){return this._getModule(bn).setGroupMemberNameCard(e)}},{key:\"setGroupMemberCustomField\",value:function(e){return this._getModule(bn).setGroupMemberCustomField(e)}},{key:\"markGroupMemberList\",value:function(e){return this._getModule(bn).markGroupMemberList(e)}},{key:\"getJoinedCommunityList\",value:function(){return this._getModule(wn).getJoinedCommunityList()}},{key:\"createTopicInCommunity\",value:function(e){return this._getModule(wn).createTopicInCommunity(e)}},{key:\"deleteTopicFromCommunity\",value:function(e){return this._getModule(wn).deleteTopicFromCommunity(e)}},{key:\"updateTopicProfile\",value:function(e){return this._getModule(wn).updateTopicProfile(e)}},{key:\"getTopicList\",value:function(e){return this._getModule(wn).getTopicList(e)}}]),e}(),pu={login:1,logout:1,destroy:1,on:1,off:1,ready:1,setLogLevel:1,joinGroup:1,quitGroup:1,registerPlugin:1,getGroupOnlineMemberCount:1};function du(e,t){if(e.isReady()||1===pu[t])return!0;var n=e.getNotReadyReason(),o={code:n,message:\"\".concat(e.getErrorMessage(n),\" | \").concat(t,\" | \").concat(e.getErrorMessage(da.SDK_IS_NOT_READY))};return e.onError(o),o}var gu={},_u={};return _u.create=function(e){var n=0,o=e.SDKAppID;if($e(o))n=o;else if(n=parseInt(o),isNaN(o))return xe.e(\"\".concat(\"TIM.create\",\" failed. Failed to parse the SDKAppID, please check the arguments\")),null;if(n&&gu[n])return gu[n];xe.l(\"\".concat(\"TIM.create\"));var s=new lu(t(t({},e),{},{SDKAppID:n}));s.on(E.SDK_DESTROY,(function(e){gu[e.data.SDKAppID]=null,delete gu[e.data.SDKAppID]}));var a=function(e){var t=Object.create(null);return Object.keys(Ln).forEach((function(n){if(e[n]){var o=new k;t[n]=function(){var t=Array.from(arguments);return o.use((function(t,o){var s=du(e,n);return!0===s?o():Ja(s)})).use((function(e,t){if(!0===zt(e,kn[n],n))return t()})).use((function(t,o){return e[n].apply(e,t)})),o.run(t)}}})),t}(s);return gu[n]=a,kn.hookGetAPITips(s.getErrorMessage.bind(s)),xe.l(\"\".concat(\"TIM.create\",\" ok\")),a},_u.TYPES=S,_u.EVENT=E,_u.VERSION=\"2.27.5\",xe.l(\"TIM.VERSION:\".concat(_u.VERSION)),_u}));\n"]} \ No newline at end of file diff --git a/miniprogram_npm/trtc-wx-sdk/index.js b/miniprogram_npm/trtc-wx-sdk/index.js new file mode 100644 index 0000000..cebf2c5 --- /dev/null +++ b/miniprogram_npm/trtc-wx-sdk/index.js @@ -0,0 +1,15 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242903, function(require, module, exports) { +!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).TRTC=t()}(this,(function(){function e(t){return(e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var r=0;r4294967296)?(h.error("roomID 超出取值范围 1 ~ 4294967295"),!1):e.strRoomID&&t.test(e.strRoomID)?(h.error("strRoomID 请勿使用中文字符"),!1):e.userID?e.userID&&t.test(e.userID)?(h.error("userID 请勿使用中文字符"),!1):!!e.userSig||(h.error("未设置 userSig"),!1):(h.error("未设置 userID"),!1):(h.error("未设置 sdkAppID"),!1)},v={LOCAL_JOIN:"LOCAL_JOIN",LOCAL_LEAVE:"LOCAL_LEAVE",KICKED_OUT:"KICKED_OUT",REMOTE_USER_JOIN:"REMOTE_USER_JOIN",REMOTE_USER_LEAVE:"REMOTE_USER_LEAVE",REMOTE_VIDEO_ADD:"REMOTE_VIDEO_ADD",REMOTE_VIDEO_REMOVE:"REMOTE_VIDEO_REMOVE",REMOTE_AUDIO_ADD:"REMOTE_AUDIO_ADD",REMOTE_AUDIO_REMOVE:"REMOTE_AUDIO_REMOVE",REMOTE_STATE_UPDATE:"REMOTE_STATE_UPDATE",LOCAL_NET_STATE_UPDATE:"LOCAL_NET_STATE_UPDATE",REMOTE_NET_STATE_UPDATE:"REMOTE_NET_STATE_UPDATE",LOCAL_AUDIO_VOLUME_UPDATE:"LOCAL_AUDIO_VOLUME_UPDATE",REMOTE_AUDIO_VOLUME_UPDATE:"REMOTE_AUDIO_VOLUME_UPDATE",VIDEO_FULLSCREEN_UPDATE:"VIDEO_FULLSCREEN_UPDATE",BGM_PLAY_START:"BGM_PLAY_START",BGM_PLAY_FAIL:"BGM_PLAY_FAIL",BGM_PLAY_PROGRESS:"BGM_PLAY_PROGRESS",BGM_PLAY_COMPLETE:"BGM_PLAY_COMPLETE",ERROR:"ERROR",IM_READY:"IM_READY",IM_MESSAGE_RECEIVED:"IM_MESSAGE_RECEIVED",IM_NOT_READY:"IM_NOT_READY",IM_KICKED_OUT:"IM_KICKED_OUT",IM_ERROR:"IM_ERROR"},f={url:"",mode:"RTC",autopush:!1,enableCamera:!1,enableMic:!1,enableAgc:!1,enableAns:!1,enableEarMonitor:!1,enableAutoFocus:!0,enableZoom:!1,minBitrate:600,maxBitrate:900,videoWidth:360,videoHeight:640,beautyLevel:0,whitenessLevel:0,videoOrientation:"vertical",videoAspect:"9:16",frontCamera:"front",enableRemoteMirror:!1,localMirror:"auto",enableBackgroundMute:!1,audioQuality:"high",audioVolumeType:"voicecall",audioReverbType:0,waitingImage:"",waitingImageHash:"",beautyStyle:"smooth",filter:"",netStatus:{}},d={src:"",mode:"RTC",autoplay:!0,muteAudio:!0,muteVideo:!0,orientation:"vertical",objectFit:"fillCrop",enableBackgroundMute:!1,minCache:1,maxCache:2,soundMode:"speaker",enableRecvMessage:!1,autoPauseIfNavigate:!0,autoPauseIfOpenNative:!0,isVisible:!0,_definitionType:"main",netStatus:{}};(new Date).getTime();function E(){var e=new Date;return e.setTime((new Date).getTime()+0),e.toLocaleString()}var A=function(e){var t=[];if(e&&e.TUIScene&&t.push(e.TUIScene),e&&"test"===e.env)return"default";if(wx&&wx.TUIScene&&t.push(wx.TUIScene),wx&&"function"==typeof getApp){var r=getApp().globalData;r&&r.TUIScene&&t.push(r.TUIScene)}return wx&&wx.getStorage({key:"TUIScene",success:function(e){t.push(e.data)}}),t[0]||"default"},I=new(function(){function e(){t(this,e),this.sdkAppId="",this.userId="",this.version="",this.common={}}return s(e,[{key:"setConfig",value:function(e){this.sdkAppId="".concat(e.sdkAppId),this.userId="".concat(e.userId),this.version="".concat(e.version),this.common.TUIScene=A(e)}},{key:"log",value:function(e){wx.request({url:"https://yun.tim.qq.com/v5/AVQualityReportSvc/C2S?sdkappid=1&cmdtype=jssdk_log",method:"POST",header:{"content-type":"application/json"},data:{timestamp:E(),sdkAppId:this.sdkAppId,userId:this.userId,version:this.version,log:JSON.stringify(n(n({},e),this.common))}})}}]),e}()),_="enterRoom",L="exitRoom",b="setPusherAttributes",T="setPlayerAttributes",D="init",O="error",k="connectServer",S="startPusher",P="openCamera",R="screenCap",M="pusherResolution",U="pusherCodeRate",C="collectionFirstFrame",x="encoderStart",w="enterRoomSuccess",V="exitRoomSuccess",B="kicked_out",G="renderFirstFrame",N="miniAppHang",j="closeSuspension",F="other",H="update",K="addUser",Y="remove_user",q="update_user_video",J="update_user_audio",W="pusherStart",Q="pusherStop",X="pusherPause",Z="pusherResume",z=function(){function r(e,s){t(this,r),this.context=wx.createLivePusherContext(s),this.pusherAttributes={},Object.assign(this.pusherAttributes,f,e)}return s(r,[{key:"setPusherAttributes",value:function(e){return Object.assign(this.pusherAttributes,e),this.pusherAttributes}},{key:"start",value:function(e){h.log("[apiLog][pusherStart]"),I.log({name:W,options:e}),this.context.start(e)}},{key:"stop",value:function(e){h.log("[apiLog][pusherStop]"),I.log({name:Q,options:e}),this.context.stop(e)}},{key:"pause",value:function(e){h.log("[apiLog] pusherPause()"),I.log({name:X,options:e}),this.context.pause(e)}},{key:"resume",value:function(e){h.log("[apiLog][pusherResume]"),I.log({name:Z,options:e}),this.context.resume(e)}},{key:"switchCamera",value:function(e){return h.log("[apiLog][switchCamera]"),this.pusherAttributes.frontCamera="front"===this.pusherAttributes.frontCamera?"back":"front",this.context.switchCamera(e),this.pusherAttributes}},{key:"sendMessage",value:function(e){h.log("[apiLog][sendMessage]",e.msg),this.context.sendMessage(e)}},{key:"snapshot",value:function(){var e=this;return h.log("[apiLog][pusherSnapshot]"),new Promise((function(t,r){e.context.snapshot({quality:"raw",complete:function(e){e.tempImagePath?(wx.saveImageToPhotosAlbum({filePath:e.tempImagePath,success:function(r){t(e)},fail:function(e){h.error("[error] pusher截图失败: ",e),r(new Error("截图失败"))}}),t(e)):(h.error("[error] snapShot 回调失败",e),r(new Error("截图失败")))}})}))}},{key:"toggleTorch",value:function(e){this.context.toggleTorch(e)}},{key:"startDumpAudio",value:function(e){this.context.startDumpAudio(e)}},{key:"stopDumpAudio",value:function(e){this.context.startDumpAudio(e)}},{key:"playBGM",value:function(e){h.log("[apiLog] playBGM() url: ",e.url),this.context.playBGM(e)}},{key:"pauseBGM",value:function(e){h.log("[apiLog] pauseBGM()"),this.context.pauseBGM(e)}},{key:"resumeBGM",value:function(e){h.log("[apiLog] resumeBGM()"),this.context.resumeBGM(e)}},{key:"stopBGM",value:function(e){h.log("[apiLog] stopBGM()"),this.context.stopBGM(e)}},{key:"setBGMVolume",value:function(t){h.log("[apiLog] setBGMVolume() volume:",t),t&&t.volume&&"object"===e(t.volume)&&t.volume.volume?this.context.setBGMVolume(t.volume):this.context.setBGMVolume(t)}},{key:"setMICVolume",value:function(t){h.log("[apiLog] setMICVolume() volume:",t),t&&t.volume&&"object"===e(t.volume)&&t.volume.volume?this.context.setMICVolume(t.volume):this.context.setMICVolume(t)}},{key:"startPreview",value:function(e){h.log("[apiLog] startPreview()"),this.context.startPreview(e)}},{key:"stopPreview",value:function(e){h.log("[apiLog] stopPreview()"),this.context.stopPreview(e)}},{key:"reset",value:function(){return console.log("Pusher reset",this.context),this.pusherConfig={},this.context&&(this.stop({success:function(){console.log("Pusher context.stop()")}}),this.context=null),this.pusherAttributes}}]),r}(),$=function e(r){t(this,e),Object.assign(this,{userID:"",streams:{}},r)},ee=function(){function e(r,s){t(this,e),this.ctx=s,this.playerAttributes=this.getInitPlayerAttributes(r)}return s(e,[{key:"play",value:function(e){this.getPlayerContext().play(e)}},{key:"stop",value:function(e){this.getPlayerContext().stop(e)}},{key:"mute",value:function(e){this.getPlayerContext().mute(e)}},{key:"pause",value:function(e){this.getPlayerContext().pause(e)}},{key:"resume",value:function(e){this.getPlayerContext().resume(e)}},{key:"requestFullScreen",value:function(e){var t=this;return new Promise((function(r,s){t.getPlayerContext().requestFullScreen({direction:e.direction,success:function(e){r(e)},fail:function(e){s(e)}})}))}},{key:"requestExitFullScreen",value:function(){var e=this;return new Promise((function(t,r){e.getPlayerContext().exitFullScreen({success:function(e){t(e)},fail:function(e){r(e)}})}))}},{key:"snapshot",value:function(e){var t=this;return h.log("[playerSnapshot]",e),new Promise((function(e,r){t.getPlayerContext().snapshot({quality:"raw",complete:function(t){t.tempImagePath?(wx.saveImageToPhotosAlbum({filePath:t.tempImagePath,success:function(r){h.log("save photo is success",r),e(t)},fail:function(e){h.error("save photo is fail",e),r(e)}}),e(t)):(h.error("snapShot 回调失败",t),r(new Error("截图失败")))}})}))}},{key:"setPlayerAttributes",value:function(e){this.playerAttributes=Object.assign({},this.playerAttributes,e)}},{key:"getPlayerContext",value:function(){return this.playerContext||(this.playerContext=wx.createLivePlayerContext(this.playerAttributes.id,this.ctx)),this.playerContext}},{key:"reset",value:function(){this.playerContext&&(this.playerContext.stop(),this.playerContext=void 0),this.playerAttributes=this.getInitPlayerAttributes()}},{key:"getInitPlayerAttributes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},d,{userID:"",streamType:"",streamID:"",id:"",hasVideo:!1,hasAudio:!1,volume:0,playerContext:void 0},e)}}]),e}(),te="UserController",re=function(){function e(r,s){t(this,e),this.ctx=s,this.userMap=new Map,this.userList=[],this.streamList=[],this.emitter=r}return s(e,[{key:"userEventHandler",value:function(e){var t=e.detail.code,r=e.detail.message,s={name:F,code:t,message:r,data:""};switch(t){case 0:h.log(r,t);break;case 1001:h.log("已经连接推流服务器",t),s.name=k;break;case 1002:h.log("已经与服务器握手完毕,开始推流",t),s.name=S;break;case 1003:h.log("打开摄像头成功",t),s.name=P;break;case 1004:h.log("录屏启动成功",t),s.name=R;break;case 1005:h.log("推流动态调整分辨率",t),s.name=M;break;case 1006:h.log("推流动态调整码率",t),s.name=U;break;case 1007:h.log("首帧画面采集完成",t),s.name=C;break;case 1008:h.log("编码器启动",t),s.name=x;break;case 1018:h.log("进房成功",t),s.name=w,s.data="event enterRoom success",this.emitter.emit(v.LOCAL_JOIN);break;case 1019:h.log("退出房间",t),r.indexOf("reason[0]")>-1?(s.name=V,s.data="event exitRoom success"):(s.name=B,s.data="event abnormal exitRoom",this.emitter.emit(v.KICKED_OUT));break;case 2003:h.log("渲染首帧视频",t),s.name=G;break;case-1301:h.error("打开摄像头失败: ",t),s.name=O,s.data="event start camera failed",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1302:s.name=O,s.data="event start microphone failed",h.error("打开麦克风失败: ",t),this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1303:h.error("视频编码失败: ",t),s.name=O,s.data="event video encode failed",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1304:h.error("音频编码失败: ",t),s.name=O,s.data="event audio encode failed",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1307:h.error("推流连接断开: ",t),s.name=O,s.data="event pusher stream failed",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-100018:h.error("进房失败: userSig 校验失败,请检查 userSig 是否填写正确",t,r),s.name=O,s.data="event userSig is error",this.emitter.emit(v.ERROR,{code:t,message:r});break;case 5e3:h.log("小程序被挂起: ",t),s.name=N,s.data="miniApp is hang";break;case 5001:h.log("小程序悬浮窗被关闭: ",t),s.name=j;break;case 1021:h.log("网络类型发生变化,需要重新进房",t);break;case 2007:h.log("本地视频播放loading: ",t);break;case 2004:h.log("本地视频播放开始: ",t);break;case 1031:case 1032:case 1033:case 1034:this._handleUserEvent(e)}I.log(s)}},{key:"_handleUserEvent",value:function(e){var t,r=e.detail.code,s=e.detail.message;if(!e.detail.message||"string"!=typeof s)return h.warn(te,"userEventHandler 数据格式错误"),!1;try{t=JSON.parse(e.detail.message)}catch(e){return h.warn(te,"userEventHandler 数据格式错误",e),!1}switch(this.emitter.emit(v.LOCAL_STATE_UPDATE,e),I.log({name:H,code:r,message:s,data:t}),r){case 1031:this.addUser(t);break;case 1032:this.removeUser(t);break;case 1033:this.updateUserVideo(t);break;case 1034:this.updateUserAudio(t)}}},{key:"addUser",value:function(e){var t=this;h.log("addUser",e);var r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=t.getUser(r);s||(s=new $({userID:r}),t.userList.push({userID:r})),t.userMap.set(r,s),t.emitter.emit(v.REMOTE_USER_JOIN,{userID:r,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:K,userID:r,userList:t.userList,playerList:t.getPlayerList()})}))}},{key:"removeUser",value:function(e){var t=this,r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=t.getUser(r);s&&s.streams&&(t._removeUserAndStream(r),s.streams.main&&s.streams.main.reset(),s.streams.aux&&s.streams.aux.reset(),t.emitter.emit(v.REMOTE_USER_LEAVE,{userID:r,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:Y,userID:r,userList:t.userList,playerList:t.getPlayerList()}),s=void 0,t.userMap.delete(r))}))}},{key:"updateUserVideo",value:function(e){var t=this;h.log(te,"updateUserVideo",e);var r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=e.streamtype,a="".concat(r,"_").concat(s),i=a,n=e.hasvideo,o=e.playurl,u=t.getUser(r);if(u){var l=u.streams[s];h.log(te,"updateUserVideo start",u,s,l),l?(l.setPlayerAttributes({hasVideo:n}),n||l.playerAttributes.hasAudio||t._removeStream(l)):(l=new ee({userID:r,streamID:a,hasVideo:n,src:o,streamType:s,id:i},t.ctx),u.streams[s]=l,t._addStream(l)),"aux"===s&&(n?(l.setPlayerAttributes({objectFit:"contain",muteAudio:!1}),t._addStream(l)):t._removeStream(l)),t.userList.find((function(e){if(e.userID===r)return e["has".concat(s.replace(/^\S/,(function(e){return e.toUpperCase()})),"Video")]=n,!0})),h.log(te,"updateUserVideo end",u,s,l);var c=n?v.REMOTE_VIDEO_ADD:v.REMOTE_VIDEO_REMOVE;t.emitter.emit(c,{player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:q,player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()})}}))}},{key:"updateUserAudio",value:function(e){var t=this,r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s="main",a="".concat(r,"_").concat(s),i=a,n=e.hasaudio,o=e.playurl,u=t.getUser(r);if(u){var l=u.streams.main;l?(l.setPlayerAttributes({hasAudio:n}),n||l.playerAttributes.hasVideo||t._removeStream(l)):(l=new ee({userID:r,streamID:a,hasAudio:n,src:o,streamType:s,id:i},t.ctx),u.streams.main=l,t._addStream(l)),t.userList.find((function(e){if(e.userID===r)return e["has".concat(s.replace(/^\S/,(function(e){return e.toUpperCase()})),"Audio")]=n,!0}));var c=n?v.REMOTE_AUDIO_ADD:v.REMOTE_AUDIO_REMOVE;t.emitter.emit(c,{player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:J,player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()})}}))}},{key:"getUser",value:function(e){return this.userMap.get(e)}},{key:"getStream",value:function(e){var t=e.userID,r=e.streamType,s=this.userMap.get(t);if(s)return s.streams[r]}},{key:"getUserList",value:function(){return this.userList}},{key:"getStreamList",value:function(){return this.streamList}},{key:"getPlayerList",value:function(){return this.getStreamList().map((function(e){return Object.assign({},e.playerAttributes)}))}},{key:"reset",value:function(){return this.streamList.forEach((function(e){e.reset()})),this.streamList=[],this.userList=[],this.userMap.clear(),{userList:this.userList,streamList:this.streamList}}},{key:"_removeUserAndStream",value:function(e){this.streamList=this.streamList.filter((function(t){return t.playerAttributes.userID!==e&&""!==t.playerAttributes.userID})),this.userList=this.userList.filter((function(t){return t.userID!==e}))}},{key:"_addStream",value:function(e){-1===this.streamList.findIndex((function(t){return t.playerAttributes.userID===e.playerAttributes.userID&&t.playerAttributes.streamType===e.playerAttributes.streamType}))&&this.streamList.push(e)}},{key:"_removeStream",value:function(e){this.streamList=this.streamList.filter((function(t){return t.playerAttributes.userID!==e.playerAttributes.userID||t.playerAttributes.streamType!==e.playerAttributes.streamType})),this.getUser(e.playerAttributes.userID).streams[e.playerAttributes.streamType]=void 0}}]),e}(),se=function(){function e(){t(this,e)}return s(e,[{key:"on",value:function(e,t,r){"function"==typeof t?(this._stores=this._stores||{},(this._stores[e]=this._stores[e]||[]).push({cb:t,ctx:r})):console.error("listener must be a function")}},{key:"emit",value:function(e){this._stores=this._stores||{};var t,r=this._stores[e];if(r){r=r.slice(0),(t=[].slice.call(arguments,1))[0]={eventCode:e,data:t[0]};for(var s=0,a=r.length;s4294967296)?(h.error(\"roomID 超出取值范围 1 ~ 4294967295\"),!1):e.strRoomID&&t.test(e.strRoomID)?(h.error(\"strRoomID 请勿使用中文字符\"),!1):e.userID?e.userID&&t.test(e.userID)?(h.error(\"userID 请勿使用中文字符\"),!1):!!e.userSig||(h.error(\"未设置 userSig\"),!1):(h.error(\"未设置 userID\"),!1):(h.error(\"未设置 sdkAppID\"),!1)},v={LOCAL_JOIN:\"LOCAL_JOIN\",LOCAL_LEAVE:\"LOCAL_LEAVE\",KICKED_OUT:\"KICKED_OUT\",REMOTE_USER_JOIN:\"REMOTE_USER_JOIN\",REMOTE_USER_LEAVE:\"REMOTE_USER_LEAVE\",REMOTE_VIDEO_ADD:\"REMOTE_VIDEO_ADD\",REMOTE_VIDEO_REMOVE:\"REMOTE_VIDEO_REMOVE\",REMOTE_AUDIO_ADD:\"REMOTE_AUDIO_ADD\",REMOTE_AUDIO_REMOVE:\"REMOTE_AUDIO_REMOVE\",REMOTE_STATE_UPDATE:\"REMOTE_STATE_UPDATE\",LOCAL_NET_STATE_UPDATE:\"LOCAL_NET_STATE_UPDATE\",REMOTE_NET_STATE_UPDATE:\"REMOTE_NET_STATE_UPDATE\",LOCAL_AUDIO_VOLUME_UPDATE:\"LOCAL_AUDIO_VOLUME_UPDATE\",REMOTE_AUDIO_VOLUME_UPDATE:\"REMOTE_AUDIO_VOLUME_UPDATE\",VIDEO_FULLSCREEN_UPDATE:\"VIDEO_FULLSCREEN_UPDATE\",BGM_PLAY_START:\"BGM_PLAY_START\",BGM_PLAY_FAIL:\"BGM_PLAY_FAIL\",BGM_PLAY_PROGRESS:\"BGM_PLAY_PROGRESS\",BGM_PLAY_COMPLETE:\"BGM_PLAY_COMPLETE\",ERROR:\"ERROR\",IM_READY:\"IM_READY\",IM_MESSAGE_RECEIVED:\"IM_MESSAGE_RECEIVED\",IM_NOT_READY:\"IM_NOT_READY\",IM_KICKED_OUT:\"IM_KICKED_OUT\",IM_ERROR:\"IM_ERROR\"},f={url:\"\",mode:\"RTC\",autopush:!1,enableCamera:!1,enableMic:!1,enableAgc:!1,enableAns:!1,enableEarMonitor:!1,enableAutoFocus:!0,enableZoom:!1,minBitrate:600,maxBitrate:900,videoWidth:360,videoHeight:640,beautyLevel:0,whitenessLevel:0,videoOrientation:\"vertical\",videoAspect:\"9:16\",frontCamera:\"front\",enableRemoteMirror:!1,localMirror:\"auto\",enableBackgroundMute:!1,audioQuality:\"high\",audioVolumeType:\"voicecall\",audioReverbType:0,waitingImage:\"\",waitingImageHash:\"\",beautyStyle:\"smooth\",filter:\"\",netStatus:{}},d={src:\"\",mode:\"RTC\",autoplay:!0,muteAudio:!0,muteVideo:!0,orientation:\"vertical\",objectFit:\"fillCrop\",enableBackgroundMute:!1,minCache:1,maxCache:2,soundMode:\"speaker\",enableRecvMessage:!1,autoPauseIfNavigate:!0,autoPauseIfOpenNative:!0,isVisible:!0,_definitionType:\"main\",netStatus:{}};(new Date).getTime();function E(){var e=new Date;return e.setTime((new Date).getTime()+0),e.toLocaleString()}var A=function(e){var t=[];if(e&&e.TUIScene&&t.push(e.TUIScene),e&&\"test\"===e.env)return\"default\";if(wx&&wx.TUIScene&&t.push(wx.TUIScene),wx&&\"function\"==typeof getApp){var r=getApp().globalData;r&&r.TUIScene&&t.push(r.TUIScene)}return wx&&wx.getStorage({key:\"TUIScene\",success:function(e){t.push(e.data)}}),t[0]||\"default\"},I=new(function(){function e(){t(this,e),this.sdkAppId=\"\",this.userId=\"\",this.version=\"\",this.common={}}return s(e,[{key:\"setConfig\",value:function(e){this.sdkAppId=\"\".concat(e.sdkAppId),this.userId=\"\".concat(e.userId),this.version=\"\".concat(e.version),this.common.TUIScene=A(e)}},{key:\"log\",value:function(e){wx.request({url:\"https://yun.tim.qq.com/v5/AVQualityReportSvc/C2S?sdkappid=1&cmdtype=jssdk_log\",method:\"POST\",header:{\"content-type\":\"application/json\"},data:{timestamp:E(),sdkAppId:this.sdkAppId,userId:this.userId,version:this.version,log:JSON.stringify(n(n({},e),this.common))}})}}]),e}()),_=\"enterRoom\",L=\"exitRoom\",b=\"setPusherAttributes\",T=\"setPlayerAttributes\",D=\"init\",O=\"error\",k=\"connectServer\",S=\"startPusher\",P=\"openCamera\",R=\"screenCap\",M=\"pusherResolution\",U=\"pusherCodeRate\",C=\"collectionFirstFrame\",x=\"encoderStart\",w=\"enterRoomSuccess\",V=\"exitRoomSuccess\",B=\"kicked_out\",G=\"renderFirstFrame\",N=\"miniAppHang\",j=\"closeSuspension\",F=\"other\",H=\"update\",K=\"addUser\",Y=\"remove_user\",q=\"update_user_video\",J=\"update_user_audio\",W=\"pusherStart\",Q=\"pusherStop\",X=\"pusherPause\",Z=\"pusherResume\",z=function(){function r(e,s){t(this,r),this.context=wx.createLivePusherContext(s),this.pusherAttributes={},Object.assign(this.pusherAttributes,f,e)}return s(r,[{key:\"setPusherAttributes\",value:function(e){return Object.assign(this.pusherAttributes,e),this.pusherAttributes}},{key:\"start\",value:function(e){h.log(\"[apiLog][pusherStart]\"),I.log({name:W,options:e}),this.context.start(e)}},{key:\"stop\",value:function(e){h.log(\"[apiLog][pusherStop]\"),I.log({name:Q,options:e}),this.context.stop(e)}},{key:\"pause\",value:function(e){h.log(\"[apiLog] pusherPause()\"),I.log({name:X,options:e}),this.context.pause(e)}},{key:\"resume\",value:function(e){h.log(\"[apiLog][pusherResume]\"),I.log({name:Z,options:e}),this.context.resume(e)}},{key:\"switchCamera\",value:function(e){return h.log(\"[apiLog][switchCamera]\"),this.pusherAttributes.frontCamera=\"front\"===this.pusherAttributes.frontCamera?\"back\":\"front\",this.context.switchCamera(e),this.pusherAttributes}},{key:\"sendMessage\",value:function(e){h.log(\"[apiLog][sendMessage]\",e.msg),this.context.sendMessage(e)}},{key:\"snapshot\",value:function(){var e=this;return h.log(\"[apiLog][pusherSnapshot]\"),new Promise((function(t,r){e.context.snapshot({quality:\"raw\",complete:function(e){e.tempImagePath?(wx.saveImageToPhotosAlbum({filePath:e.tempImagePath,success:function(r){t(e)},fail:function(e){h.error(\"[error] pusher截图失败: \",e),r(new Error(\"截图失败\"))}}),t(e)):(h.error(\"[error] snapShot 回调失败\",e),r(new Error(\"截图失败\")))}})}))}},{key:\"toggleTorch\",value:function(e){this.context.toggleTorch(e)}},{key:\"startDumpAudio\",value:function(e){this.context.startDumpAudio(e)}},{key:\"stopDumpAudio\",value:function(e){this.context.startDumpAudio(e)}},{key:\"playBGM\",value:function(e){h.log(\"[apiLog] playBGM() url: \",e.url),this.context.playBGM(e)}},{key:\"pauseBGM\",value:function(e){h.log(\"[apiLog] pauseBGM()\"),this.context.pauseBGM(e)}},{key:\"resumeBGM\",value:function(e){h.log(\"[apiLog] resumeBGM()\"),this.context.resumeBGM(e)}},{key:\"stopBGM\",value:function(e){h.log(\"[apiLog] stopBGM()\"),this.context.stopBGM(e)}},{key:\"setBGMVolume\",value:function(t){h.log(\"[apiLog] setBGMVolume() volume:\",t),t&&t.volume&&\"object\"===e(t.volume)&&t.volume.volume?this.context.setBGMVolume(t.volume):this.context.setBGMVolume(t)}},{key:\"setMICVolume\",value:function(t){h.log(\"[apiLog] setMICVolume() volume:\",t),t&&t.volume&&\"object\"===e(t.volume)&&t.volume.volume?this.context.setMICVolume(t.volume):this.context.setMICVolume(t)}},{key:\"startPreview\",value:function(e){h.log(\"[apiLog] startPreview()\"),this.context.startPreview(e)}},{key:\"stopPreview\",value:function(e){h.log(\"[apiLog] stopPreview()\"),this.context.stopPreview(e)}},{key:\"reset\",value:function(){return console.log(\"Pusher reset\",this.context),this.pusherConfig={},this.context&&(this.stop({success:function(){console.log(\"Pusher context.stop()\")}}),this.context=null),this.pusherAttributes}}]),r}(),$=function e(r){t(this,e),Object.assign(this,{userID:\"\",streams:{}},r)},ee=function(){function e(r,s){t(this,e),this.ctx=s,this.playerAttributes=this.getInitPlayerAttributes(r)}return s(e,[{key:\"play\",value:function(e){this.getPlayerContext().play(e)}},{key:\"stop\",value:function(e){this.getPlayerContext().stop(e)}},{key:\"mute\",value:function(e){this.getPlayerContext().mute(e)}},{key:\"pause\",value:function(e){this.getPlayerContext().pause(e)}},{key:\"resume\",value:function(e){this.getPlayerContext().resume(e)}},{key:\"requestFullScreen\",value:function(e){var t=this;return new Promise((function(r,s){t.getPlayerContext().requestFullScreen({direction:e.direction,success:function(e){r(e)},fail:function(e){s(e)}})}))}},{key:\"requestExitFullScreen\",value:function(){var e=this;return new Promise((function(t,r){e.getPlayerContext().exitFullScreen({success:function(e){t(e)},fail:function(e){r(e)}})}))}},{key:\"snapshot\",value:function(e){var t=this;return h.log(\"[playerSnapshot]\",e),new Promise((function(e,r){t.getPlayerContext().snapshot({quality:\"raw\",complete:function(t){t.tempImagePath?(wx.saveImageToPhotosAlbum({filePath:t.tempImagePath,success:function(r){h.log(\"save photo is success\",r),e(t)},fail:function(e){h.error(\"save photo is fail\",e),r(e)}}),e(t)):(h.error(\"snapShot 回调失败\",t),r(new Error(\"截图失败\")))}})}))}},{key:\"setPlayerAttributes\",value:function(e){this.playerAttributes=Object.assign({},this.playerAttributes,e)}},{key:\"getPlayerContext\",value:function(){return this.playerContext||(this.playerContext=wx.createLivePlayerContext(this.playerAttributes.id,this.ctx)),this.playerContext}},{key:\"reset\",value:function(){this.playerContext&&(this.playerContext.stop(),this.playerContext=void 0),this.playerAttributes=this.getInitPlayerAttributes()}},{key:\"getInitPlayerAttributes\",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Object.assign({},d,{userID:\"\",streamType:\"\",streamID:\"\",id:\"\",hasVideo:!1,hasAudio:!1,volume:0,playerContext:void 0},e)}}]),e}(),te=\"UserController\",re=function(){function e(r,s){t(this,e),this.ctx=s,this.userMap=new Map,this.userList=[],this.streamList=[],this.emitter=r}return s(e,[{key:\"userEventHandler\",value:function(e){var t=e.detail.code,r=e.detail.message,s={name:F,code:t,message:r,data:\"\"};switch(t){case 0:h.log(r,t);break;case 1001:h.log(\"已经连接推流服务器\",t),s.name=k;break;case 1002:h.log(\"已经与服务器握手完毕,开始推流\",t),s.name=S;break;case 1003:h.log(\"打开摄像头成功\",t),s.name=P;break;case 1004:h.log(\"录屏启动成功\",t),s.name=R;break;case 1005:h.log(\"推流动态调整分辨率\",t),s.name=M;break;case 1006:h.log(\"推流动态调整码率\",t),s.name=U;break;case 1007:h.log(\"首帧画面采集完成\",t),s.name=C;break;case 1008:h.log(\"编码器启动\",t),s.name=x;break;case 1018:h.log(\"进房成功\",t),s.name=w,s.data=\"event enterRoom success\",this.emitter.emit(v.LOCAL_JOIN);break;case 1019:h.log(\"退出房间\",t),r.indexOf(\"reason[0]\")>-1?(s.name=V,s.data=\"event exitRoom success\"):(s.name=B,s.data=\"event abnormal exitRoom\",this.emitter.emit(v.KICKED_OUT));break;case 2003:h.log(\"渲染首帧视频\",t),s.name=G;break;case-1301:h.error(\"打开摄像头失败: \",t),s.name=O,s.data=\"event start camera failed\",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1302:s.name=O,s.data=\"event start microphone failed\",h.error(\"打开麦克风失败: \",t),this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1303:h.error(\"视频编码失败: \",t),s.name=O,s.data=\"event video encode failed\",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1304:h.error(\"音频编码失败: \",t),s.name=O,s.data=\"event audio encode failed\",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-1307:h.error(\"推流连接断开: \",t),s.name=O,s.data=\"event pusher stream failed\",this.emitter.emit(v.ERROR,{code:t,message:r});break;case-100018:h.error(\"进房失败: userSig 校验失败,请检查 userSig 是否填写正确\",t,r),s.name=O,s.data=\"event userSig is error\",this.emitter.emit(v.ERROR,{code:t,message:r});break;case 5e3:h.log(\"小程序被挂起: \",t),s.name=N,s.data=\"miniApp is hang\";break;case 5001:h.log(\"小程序悬浮窗被关闭: \",t),s.name=j;break;case 1021:h.log(\"网络类型发生变化,需要重新进房\",t);break;case 2007:h.log(\"本地视频播放loading: \",t);break;case 2004:h.log(\"本地视频播放开始: \",t);break;case 1031:case 1032:case 1033:case 1034:this._handleUserEvent(e)}I.log(s)}},{key:\"_handleUserEvent\",value:function(e){var t,r=e.detail.code,s=e.detail.message;if(!e.detail.message||\"string\"!=typeof s)return h.warn(te,\"userEventHandler 数据格式错误\"),!1;try{t=JSON.parse(e.detail.message)}catch(e){return h.warn(te,\"userEventHandler 数据格式错误\",e),!1}switch(this.emitter.emit(v.LOCAL_STATE_UPDATE,e),I.log({name:H,code:r,message:s,data:t}),r){case 1031:this.addUser(t);break;case 1032:this.removeUser(t);break;case 1033:this.updateUserVideo(t);break;case 1034:this.updateUserAudio(t)}}},{key:\"addUser\",value:function(e){var t=this;h.log(\"addUser\",e);var r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=t.getUser(r);s||(s=new $({userID:r}),t.userList.push({userID:r})),t.userMap.set(r,s),t.emitter.emit(v.REMOTE_USER_JOIN,{userID:r,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:K,userID:r,userList:t.userList,playerList:t.getPlayerList()})}))}},{key:\"removeUser\",value:function(e){var t=this,r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=t.getUser(r);s&&s.streams&&(t._removeUserAndStream(r),s.streams.main&&s.streams.main.reset(),s.streams.aux&&s.streams.aux.reset(),t.emitter.emit(v.REMOTE_USER_LEAVE,{userID:r,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:Y,userID:r,userList:t.userList,playerList:t.getPlayerList()}),s=void 0,t.userMap.delete(r))}))}},{key:\"updateUserVideo\",value:function(e){var t=this;h.log(te,\"updateUserVideo\",e);var r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=e.streamtype,a=\"\".concat(r,\"_\").concat(s),i=a,n=e.hasvideo,o=e.playurl,u=t.getUser(r);if(u){var l=u.streams[s];h.log(te,\"updateUserVideo start\",u,s,l),l?(l.setPlayerAttributes({hasVideo:n}),n||l.playerAttributes.hasAudio||t._removeStream(l)):(l=new ee({userID:r,streamID:a,hasVideo:n,src:o,streamType:s,id:i},t.ctx),u.streams[s]=l,t._addStream(l)),\"aux\"===s&&(n?(l.setPlayerAttributes({objectFit:\"contain\",muteAudio:!1}),t._addStream(l)):t._removeStream(l)),t.userList.find((function(e){if(e.userID===r)return e[\"has\".concat(s.replace(/^\\S/,(function(e){return e.toUpperCase()})),\"Video\")]=n,!0})),h.log(te,\"updateUserVideo end\",u,s,l);var c=n?v.REMOTE_VIDEO_ADD:v.REMOTE_VIDEO_REMOVE;t.emitter.emit(c,{player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:q,player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()})}}))}},{key:\"updateUserAudio\",value:function(e){var t=this,r=e.userlist;Array.isArray(r)&&r.length>0&&r.forEach((function(e){var r=e.userid,s=\"main\",a=\"\".concat(r,\"_\").concat(s),i=a,n=e.hasaudio,o=e.playurl,u=t.getUser(r);if(u){var l=u.streams.main;l?(l.setPlayerAttributes({hasAudio:n}),n||l.playerAttributes.hasVideo||t._removeStream(l)):(l=new ee({userID:r,streamID:a,hasAudio:n,src:o,streamType:s,id:i},t.ctx),u.streams.main=l,t._addStream(l)),t.userList.find((function(e){if(e.userID===r)return e[\"has\".concat(s.replace(/^\\S/,(function(e){return e.toUpperCase()})),\"Audio\")]=n,!0}));var c=n?v.REMOTE_AUDIO_ADD:v.REMOTE_AUDIO_REMOVE;t.emitter.emit(c,{player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()}),I.log({name:J,player:l.playerAttributes,userList:t.userList,playerList:t.getPlayerList()})}}))}},{key:\"getUser\",value:function(e){return this.userMap.get(e)}},{key:\"getStream\",value:function(e){var t=e.userID,r=e.streamType,s=this.userMap.get(t);if(s)return s.streams[r]}},{key:\"getUserList\",value:function(){return this.userList}},{key:\"getStreamList\",value:function(){return this.streamList}},{key:\"getPlayerList\",value:function(){return this.getStreamList().map((function(e){return Object.assign({},e.playerAttributes)}))}},{key:\"reset\",value:function(){return this.streamList.forEach((function(e){e.reset()})),this.streamList=[],this.userList=[],this.userMap.clear(),{userList:this.userList,streamList:this.streamList}}},{key:\"_removeUserAndStream\",value:function(e){this.streamList=this.streamList.filter((function(t){return t.playerAttributes.userID!==e&&\"\"!==t.playerAttributes.userID})),this.userList=this.userList.filter((function(t){return t.userID!==e}))}},{key:\"_addStream\",value:function(e){-1===this.streamList.findIndex((function(t){return t.playerAttributes.userID===e.playerAttributes.userID&&t.playerAttributes.streamType===e.playerAttributes.streamType}))&&this.streamList.push(e)}},{key:\"_removeStream\",value:function(e){this.streamList=this.streamList.filter((function(t){return t.playerAttributes.userID!==e.playerAttributes.userID||t.playerAttributes.streamType!==e.playerAttributes.streamType})),this.getUser(e.playerAttributes.userID).streams[e.playerAttributes.streamType]=void 0}}]),e}(),se=function(){function e(){t(this,e)}return s(e,[{key:\"on\",value:function(e,t,r){\"function\"==typeof t?(this._stores=this._stores||{},(this._stores[e]=this._stores[e]||[]).push({cb:t,ctx:r})):console.error(\"listener must be a function\")}},{key:\"emit\",value:function(e){this._stores=this._stores||{};var t,r=this._stores[e];if(r){r=r.slice(0),(t=[].slice.call(arguments,1))[0]={eventCode:e,data:t[0]};for(var s=0,a=r.length;s4294967295?(D+=4294967295,Date.now()-D):t},utc:function(){return Math.round(Date.now()/1e3)}},b=function(t){return JSON.stringify(t,["message","code"])}},function(t,e,n){n.r(e);var i=n(3),o=n(0);let r=0;const s=new Map;function a(){const t=new Date;return"TSignaling "+t.toLocaleTimeString("en-US",{hour12:!1})+"."+function(t){let e;switch(t.toString().length){case 1:e="00"+t;break;case 2:e="0"+t;break;default:e=t}return e}(t.getMilliseconds())+":"}const u={_data:[],_length:0,_visible:!1,arguments2String(t){let e;if(1===t.length)e=a()+t[0];else{e=a();for(let n=0,i=t.length;n0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]t.weight>e.weight),this}_getCallbacks(t){return r(this)._callbacks[t]}_getCallbackIndex(t,e){return this._has(t)?this._getCallbacks(t).findIndex(t=>t.callback===e):null}_achieveMaxListener(t){return null!==r(this)._maxListeners&&r(this)._maxListeners<=this.listenersNumber(t)}_callbackIsExists(t,e,n){const i=this._getCallbackIndex(t,e),o=-1!==i?this._getCallbacks(t)[i]:void 0;return-1!==i&&o&&o.context===n}_has(t){return r(this)._events.has(t)}on(t,e,n=null,i=1){const o=r(this);if("function"!=typeof e)throw new TypeError(e+" is not a function");return this._has(t)?(this._achieveMaxListener(t)&&o._console.warn(`Max listeners (${o._maxListeners}) for event "${t}" is reached!`),this._callbackIsExists(...arguments)&&o._console.warn(`Event "${t}" already has the callback ${e}.`)):(o._events.add(t),o._callbacks[t]=[]),this._addCallback(...arguments),this}once(t,e,n=null,o=1){const r=(...o)=>(this.off(t,r),i.call(e,n,o));return this.on(t,r,n,o)}off(t,e=null){const n=r(this);let i;return this._has(t)&&(null===e?(n._events.delete(t),n._callbacks[t]=null):(i=this._getCallbackIndex(t,e),-1!==i&&(n._callbacks[t].splice(i,1),this.off(...arguments)))),this}emit(t,...e){return this._has(t)&&this._getCallbacks(t).forEach(t=>i.call(t.callback,t.context,e)),this}clear(){const t=r(this);return t._events.clear(),t._callbacks={},this}listenersNumber(t){return this._has(t)?this._getCallbacks(t).length:null}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n.r(e);var i=n(0);const o=Object.prototype.hasOwnProperty;e.default=function(t){if(null==t)return!0;if("boolean"==typeof t)return!1;if("number"==typeof t)return 0===t;if("string"==typeof t)return 0===t.length;if("function"==typeof t)return 0===t.length;if(Array.isArray(t))return 0===t.length;if(t instanceof Error)return""===t.message;if(Object(i.f)(t)){for(const e in t)if(o.call(t,e))return!1;return!0}return!!(Object(i.e)(t)||Object(i.g)(t)||Object(i.c)(t))&&0===t.size}},function(t,e,n){n.r(e);class i extends Error{constructor(t){super(),this.code=t.code,this.message=t.message,this.data=t.data||{}}}e.default=i},function(t,e,n){n.r(e);var i=n(1),o=n(4),r=n.n(o);e.default=class{constructor(){this._funcMap=new Map}defense(t,e,n){if("string"!=typeof t)return null;if(0===t.length)return null;if("function"!=typeof e)return null;if(this._funcMap.has(t)&&this._funcMap.get(t).has(e))return this._funcMap.get(t).get(e);this._funcMap.has(t)||this._funcMap.set(t,new Map);let i=null;return this._funcMap.get(t).has(e)?i=this._funcMap.get(t).get(e):(i=this._pack(t,e,n),this._funcMap.get(t).set(e,i)),i}defenseOnce(t,e,n){return"function"!=typeof e?null:this._pack(t,e,n)}find(t,e){return"string"!=typeof t||0===t.length||"function"!=typeof e?null:this._funcMap.has(t)?this._funcMap.get(t).has(e)?this._funcMap.get(t).get(e):(i.default.log(`SafetyCallback.find: 找不到 func —— ${t}/${""!==e.name?e.name:"[anonymous]"}`),null):(i.default.log(`SafetyCallback.find: 找不到 eventName-${t} 对应的 func`),null)}delete(t,e){return"function"==typeof e&&(!!this._funcMap.has(t)&&(!!this._funcMap.get(t).has(e)&&(this._funcMap.get(t).delete(e),0===this._funcMap.get(t).size&&this._funcMap.delete(t),!0)))}_pack(t,e,n){return function(){try{e.apply(n,Array.from(arguments))}catch(e){const n=Object.values(r.a).indexOf(t),o=Object.keys(r.a)[n];i.default.error(`接入侧事件 EVENT.${o} 对应的回调函数逻辑存在问题,请检查!`,e)}}}}},function(t,e,n){ +/** + * UUID.js - RFC-compliant UUID Generator for JavaScript + * + * @file + * @author LiosK + * @version v4.2.12 + * @license Apache License 2.0: Copyright (c) 2010-2022 LiosK + */ +var i;i=function(e){function i(){var t=o._getRandomInt;this.timestamp=0,this.tick=0,this.sequence=t(14),this.node=1099511627776*(1|t(8))+t(40)}function o(){}return o.generate=function(){var t=o._getRandomInt,e=o._hexAligner;return e(t(32),8)+"-"+e(t(16),4)+"-"+e(16384|t(12),4)+"-"+e(32768|t(14),4)+"-"+e(t(48),12)},o._getRandomInt=function(t){if(t<0||t>53)return NaN;var e=0|1073741824*Math.random();return t>30?e+1073741824*(0|Math.random()*(1<>>30-t},o._hexAligner=function(t,e){for(var n=t.toString(16),i=e-n.length,o="0";i>0;i>>>=1,o+=o)1&i&&(n=o+n);return n},o.overwrittenUUID=e,function(){var t=o._getRandomInt;o.useMathRandom=function(){o._getRandomInt=t};var e=null,i=t;"undefined"!=typeof window&&(e=window.crypto||window.msCrypto)?e.getRandomValues&&"undefined"!=typeof Uint32Array&&(i=function(t){if(t<0||t>53)return NaN;var n=new Uint32Array(t>32?2:1);return n=e.getRandomValues(n)||n,t>32?n[0]+4294967296*(n[1]>>>64-t):n[0]>>>32-t}):(e=n(14))&&e.randomBytes&&(i=function(t){if(t<0||t>53)return NaN;var n=e.randomBytes(t>32?8:4),i=n.readUInt32BE(0);return t>32?i+4294967296*(n.readUInt32BE(4)>>>64-t):i>>>32-t}),o._getRandomInt=i}(),o.FIELD_NAMES=["timeLow","timeMid","timeHiAndVersion","clockSeqHiAndReserved","clockSeqLow","node"],o.FIELD_SIZES=[32,16,16,8,8,48],o.genV4=function(){var t=o._getRandomInt;return(new o)._init(t(32),t(16),16384|t(12),128|t(6),t(8),t(48))},o.parse=function(t){var e;if(e=/^\s*(urn:uuid:|\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(\})?\s*$/i.exec(t)){var n=e[1]||"",i=e[8]||"";if(n+i===""||"{"===n&&"}"===i||"urn:uuid:"===n.toLowerCase()&&""===i)return(new o)._init(parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16),parseInt(e[5],16),parseInt(e[6],16),parseInt(e[7],16))}return null},o.prototype._init=function(){var t=o.FIELD_NAMES,e=o.FIELD_SIZES,n=o._binAligner,i=o._hexAligner;this.intFields=new Array(6),this.bitFields=new Array(6),this.hexFields=new Array(6);for(var r=0;r<6;r++){var s=parseInt(arguments[r]||0);this.intFields[r]=this.intFields[t[r]]=s,this.bitFields[r]=this.bitFields[t[r]]=n(s,e[r]),this.hexFields[r]=this.hexFields[t[r]]=i(s,e[r]>>>2)}return this.version=this.intFields.timeHiAndVersion>>>12&15,this.bitString=this.bitFields.join(""),this.hexNoDelim=this.hexFields.join(""),this.hexString=this.hexFields[0]+"-"+this.hexFields[1]+"-"+this.hexFields[2]+"-"+this.hexFields[3]+this.hexFields[4]+"-"+this.hexFields[5],this.urn="urn:uuid:"+this.hexString,this},o._binAligner=function(t,e){for(var n=t.toString(2),i=e-n.length,o="0";i>0;i>>>=1,o+=o)1&i&&(n=o+n);return n},o.prototype.toString=function(){return this.hexString},o.prototype.equals=function(t){if(!(t instanceof o))return!1;for(var e=0;e<6;e++)if(this.intFields[e]!==t.intFields[e])return!1;return!0},o.NIL=(new o)._init(0,0,0,0,0,0),o.genV1=function(){null==o._state&&o.resetState();var t=(new Date).getTime(),e=o._state;t!=e.timestamp?(t>>8|128,a=255&e.sequence;return(new o)._init(i,n.mid,r,s,a,e.node)},o.resetState=function(){o._state=new i},o._tsRatio=1/4,o._state=null,o._getTimeFieldValues=function(t){var e=t-Date.UTC(1582,9,15),n=e/4294967296*1e4&268435455;return{low:1e4*(268435455&e)%4294967296,mid:65535&n,hi:n>>>16,timestamp:e}},"object"==typeof t.exports&&(t.exports=o),o}(i)},function(t,e){},function(t){t.exports=JSON.parse('{"name":"tsignaling","version":"1.0.6","description":"腾讯云 Web 信令 SDK","main":"./src/index.ts","scripts":{"lint":"./node_modules/.bin/eslint ./src","fix":"./node_modules/.bin/eslint --fix ./src","ts2js":"tsc src/index.ts --outDir build/ts2js","doc":"npm run ts2js && npm run doc:clean && npm run doc:build","doc:build":"./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js","doc:clean":"node ./build/jsdoc/clean-doc.js","build:wx":"cross-env NODE_ENV=wx webpack --config webpack.prod.config.js","build:web":"node node_modules/cross-env/src/bin/cross-env.js NODE_ENV=web node_modules/webpack/bin/webpack.js --config webpack.prod.config.js","build:package":"node build/package-bundle.js","prerelease":"npm run changelog && npm run build:web && npm run build:wx && npm run build:package && node ./build/copy.js","start:wx":"cross-env NODE_ENV=wx webpack-dev-server --config webpack.config.js","start:web":"node node_modules/cross-env/src/bin/cross-env.js NODE_ENV=web node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js","build_withcopy":"npm run build:web && cp dist/npm/tsignaling-js.js ../TIM-demo-web/node_modules/tsignaling/tsignaling-js.js","build_withcopy:mp":"npm run build:wx && cp dist/npm/tsignaling-wx.js ../TIM-demo-mini/static/component/TRTCCalling/utils/tsignaling-wx.js","changelog":"cp CHANGELOG.md build/jsdoc/tutorials/CHANGELOG.md"},"husky":{"hooks":{"pre-commit":"npm run lint"}},"lint-staged":{"*.{.ts,.tsx}":["eslint","git add"]},"keywords":["腾讯云","即时通信","信令"],"author":"","license":"ISC","devDependencies":{"conventional-changelog-cli":"^2.1.1","cross-env":"^7.0.2","fs-extra":"^9.0.1","html-webpack-plugin":"^4.3.0","ts-loader":"^7.0.5","typescript":"^3.9.9","webpack":"^4.43.0","@types/node":"18.11.9","webpack-cli":"^3.3.11","webpack-dev-server":"^3.11.0"},"dependencies":{"@typescript-eslint/eslint-plugin":"^4.22.1","@typescript-eslint/parser":"^4.22.1","EventEmitter":"^1.0.0","docdash-blue":"1.1.9","eslint":"^5.16.0","eslint-config-google":"^0.13.0","eslint-plugin-classes":"^0.1.1","jsdoc":"^3.6.4","jsdoc-plugin-typescript":"^2.0.5","pretty":"^2.0.0","replace":"^1.2.0","uuidjs":"^4.2.5"}}')},function(t,e,n){var i,o=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{u(i.next(t))}catch(t){r(t)}}function a(t){try{u(i.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&u.lastMessage.lastTime&&1e3*u.lastMessage.lastTime>this.currentTime-this.expiredTime&&t.push(u);return[2,t]}}))}))},e}(l),f=function(t){function e(e){var n=t.call(this)||this;return n.tim=null,n.expiredTime=3e4,n.tim=e.tim,n}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){var e,n,i,o,r,a,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:e=[],n=0,s.label=1;case 1:return nd.currentTime-d.expiredTime}))),s.label=3;case 3:return n++,[3,1];case 4:return[2,e.flat().sort((function(t,e){return t.time-e.time}))]}}))}))},e}(l),_=function(t){function e(){return t.call(this)||this}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,t.filter((function(t){var e=!1;try{e=JSON.parse(t.payload.data).businessID===a.BusinessID.SIGNAL}catch(t){}return e}))]}))}))},e}(l),p=function(t){function e(){return t.call(this)||this}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){var e,n,i;return s(this,(function(o){return Array.isArray(t)?0===t.length?[2,[]]:(e=new Map,t.forEach((function(t,n){var i=JSON.parse(t.payload.data),o=i.inviteID,r=i.actionType;!e.has(o)||e.get(o).actionType!==a.ActionType.INVITE||r!==a.ActionType.CANCEL_INVITE&&r!==a.ActionType.ACCEPT_INVITE&&r!==a.ActionType.REJECT_INVITE&&r!==a.ActionType.INVITE_TIMEOUT?e.set(o,{index:n,actionType:r}):e.delete(o)})),n=[],e.forEach((function(t){t.actionType===a.ActionType.INVITE&&n.push(t.index)})),0===n.length?[2,[]]:(i=[],n.sort((function(t,e){return t-e})).forEach((function(e){i.push(t[e])})),[2,i])):[2,[]]}))}))},e}(l),I=function(){function t(t){this.tim=null;var e=t.tim;this.tim=e}return t.prototype.getHistoricalSignaling=function(){return r(this,void 0,void 0,(function(){var t;return s(this,(function(e){return(t=new c).register(new d({tim:this.tim})),t.register(new f({tim:this.tim})),t.register(new _),t.register(new p),[2,t.run()]}))}))},t}();e.default=I}]).default})); +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242904); +})() +//miniprogram-npm-outsideDeps=["tim-wx-sdk"] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/tsignaling-wx/index.js.map b/miniprogram_npm/tsignaling-wx/index.js.map new file mode 100644 index 0000000..ba1a89a --- /dev/null +++ b/miniprogram_npm/tsignaling-wx/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["tsignaling-wx.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["!function(t,e){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=e(require(\"tim-wx-sdk\")):\"function\"==typeof define&&define.amd?define([\"tim-wx-sdk\"],e):\"object\"==typeof exports?exports.TSignaling=e(require(\"tim-wx-sdk\")):t.TSignaling=e(t.TIM)}(window,(function(t){return function(t){var e={};function n(i){if(e[i])return e[i].exports;var o=e[i]={i:i,l:!1,exports:{}};return t[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(t,\"__esModule\",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&\"object\"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,\"default\",{enumerable:!0,value:t}),2&e&&\"string\"!=typeof t)for(var o in t)n.d(i,o,function(e){return t[e]}.bind(null,o));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,\"a\",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p=\"\",n(n.s=7)}([function(t,e,n){n.d(e,\"e\",(function(){return I})),n.d(e,\"g\",(function(){return h})),n.d(e,\"c\",(function(){return g})),n.d(e,\"f\",(function(){return v})),n.d(e,\"b\",(function(){return m})),n.d(e,\"d\",(function(){return T})),n.d(e,\"a\",(function(){return S})),n.d(e,\"h\",(function(){return b}));const i=\"undefined\"!=typeof window,o=(\"undefined\"!=typeof wx&&wx.getSystemInfoSync,i&&window.navigator&&window.navigator.userAgent||\"\"),r=/AppleWebKit\\/([\\d.]+)/i.exec(o),s=(r&&parseFloat(r.pop()),/iPad/i.test(o)),a=/iPhone/i.test(o)&&!s,u=/iPod/i.test(o),l=a||s||u,c=(function(){const t=o.match(/OS (\\d+)_/i);t&&t[1]&&t[1]}(),/Android/i.test(o)),d=function(){const t=o.match(/Android (\\d+)(?:\\.(\\d+))?(?:\\.(\\d+))*/i);if(!t)return null;const e=t[1]&&parseFloat(t[1]),n=t[2]&&parseFloat(t[2]);return e&&n?parseFloat(t[1]+\".\"+t[2]):e||null}(),f=(c&&/webkit/i.test(o),/Firefox/i.test(o),/Edge/i.test(o)),_=!f&&/Chrome/i.test(o),p=(function(){const t=o.match(/Chrome\\/(\\d+)/);t&&t[1]&&parseFloat(t[1])}(),/MSIE/.test(o),/MSIE\\s8\\.0/.test(o),function(){const t=/MSIE\\s(\\d+)\\.\\d/.exec(o);let e=t&&parseFloat(t[1]);!e&&/Trident\\/7.0/i.test(o)&&/rv:11.0/.test(o)&&(e=11)}(),/Safari/i.test(o),/TBS\\/\\d+/i.test(o));(function(){const t=o.match(/TBS\\/(\\d+)/i);if(t&&t[1])t[1]})(),!p&&/MQQBrowser\\/\\d+/i.test(o),!p&&/ QQBrowser\\/\\d+/i.test(o),/(micromessenger|webbrowser)/i.test(o),/Windows/i.test(o),/MAC OS X/i.test(o),/MicroMessenger/i.test(o);n(2),n(1);const I=function(t){return\"map\"===y(t)},h=function(t){return\"set\"===y(t)},g=function(t){return\"file\"===y(t)},v=function(t){if(\"object\"!=typeof t||null===t)return!1;const e=Object.getPrototypeOf(t);if(null===e)return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},E=function(t){return\"function\"==typeof Array.isArray?Array.isArray(t):\"array\"===y(t)},m=function(t){return E(t)||function(t){return null!==t&&\"object\"==typeof t}(t)},T=function(t){return t instanceof Error},y=function(t){return Object.prototype.toString.call(t).match(/^\\[object (.*)\\]$/)[1].toLowerCase()};let D=0;Date.now||(Date.now=function(){return(new Date).getTime()});const S={now:function(){0===D&&(D=Date.now()-1);const t=Date.now()-D;return t>4294967295?(D+=4294967295,Date.now()-D):t},utc:function(){return Math.round(Date.now()/1e3)}},b=function(t){return JSON.stringify(t,[\"message\",\"code\"])}},function(t,e,n){n.r(e);var i=n(3),o=n(0);let r=0;const s=new Map;function a(){const t=new Date;return\"TSignaling \"+t.toLocaleTimeString(\"en-US\",{hour12:!1})+\".\"+function(t){let e;switch(t.toString().length){case 1:e=\"00\"+t;break;case 2:e=\"0\"+t;break;default:e=t}return e}(t.getMilliseconds())+\":\"}const u={_data:[],_length:0,_visible:!1,arguments2String(t){let e;if(1===t.length)e=a()+t[0];else{e=a();for(let n=0,i=t.length;n0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0:o.length>0&&o.includes(this._userID))},t.prototype._startTimer=function(t,e){var n=this;void 0===e&&(e=!0);var i=t.timeout;if(d.default.log(\"TSignaling._startTimer timeout=\"+i+\" isInvitator=\"+e+\" timeoutStatus=\"+(0===i)),0!==i)var o=e?i+5:i,r=1,s=setInterval((function(){var i=n._hasLocalInviteInfo(t,e);d.default.log(\"TSignaling.setInterval hasInviteInfo=\"+i),r0||a||(i&&r||!i)&&(this._updateLocalInviteInfo(t),this._outerEmitter.emit(l.default.INVITATION_TIMEOUT,{inviteID:e,inviter:n,groupID:i,inviteeList:t.inviteeList,isSelfTimeout:!1}))},t.prototype._updateLocalInviteInfo=function(t){var e=t.inviteID,n=t.inviter,i=t.inviteeList,o=t.groupID;if(d.default.log(\"TSignaling._updateLocalInviteInfo inviteID=\"+e+\" inviter=\"+n+\" groupID=\"+o),o){if(this._inviteInfoMap.has(e)){var r=i[0],s=this._inviteInfoMap.get(e).inviteeList;s.includes(r)&&(s.splice(s.indexOf(r),1),d.default.log(\"TSignaling._updateLocalInviteInfo remove \"+r+\" from localInviteeList. \"+s.length+\" invitees left\")),0===s.length&&this._deleteInviteInfoByID(e)}}else this._deleteInviteInfoByID(e)},t.prototype._deleteInviteInfoByID=function(t){this._inviteInfoMap.has(t)&&(d.default.log(\"TSignaling._deleteInviteInfoByID remove \"+t+\" from inviteInfoMap.\"),this._inviteInfoMap.delete(t))},t.prototype._sendCustomMessage=function(t,e,n){var s,u,c,f;return o(this,void 0,void 0,(function(){var o,_,p,I,g,v;return r(this,(function(r){switch(r.label){case 0:return o=e.groupID,_=this._tim.createCustomMessage({to:t,conversationType:o?h.TYPES.CONV_GROUP:h.TYPES.CONV_C2C,priority:h.TYPES.MSG_PRIORITY_HIGH,payload:{data:JSON.stringify(e)}}),e.actionType!==a.ActionType.INVITE?[3,2]:(I={title:(p=n||{}).title||\"\",description:p.description||\"您有一个通话请求\",androidOPPOChannelID:p.androidOPPOChannelID||\"\",extension:this._handleOfflineInfo(e,p.extension||\"\")},d.default.log(\"TSignaling.offlinePushInfo \"+JSON.stringify(I)),[4,this._tim.sendMessage(_,i({offlinePushInfo:{title:I.title,description:I.description,androidOPPOChannelID:I.androidOPPOChannelID,extension:I.extension}},E))]);case 1:return g=r.sent(),(null===(s=null==g?void 0:g.data)||void 0===s?void 0:s.message)&&this._outerEmitter.emit(l.default.MESSAGE_SENT_BY_ME,null===(u=null==g?void 0:g.data)||void 0===u?void 0:u.message),[2,g];case 2:return[4,this._tim.sendMessage(_,E)];case 3:return v=r.sent(),(null===(c=null==v?void 0:v.data)||void 0===c?void 0:c.message)&&this._outerEmitter.emit(l.default.MESSAGE_SENT_BY_ME,null===(f=null==v?void 0:v.data)||void 0===f?void 0:f.message),[2,v]}}))}))},t.prototype._sendCustomMessageSync=function(t,e,n,i,s){return o(this,void 0,void 0,(function(){var o;return r(this,(function(r){switch(r.label){case 0:return[4,this._sendCustomMessage(t,e,s)];case 1:return 0===(o=r.sent()).code?(this._inviteInfoMap.set(e.inviteID,e),this._startTimer(e,!0),n()):i(o.code,o.message||\"\"),[2]}}))}))},t.prototype._handleOfflineInfo=function(t,e){var n=JSON.parse(t.data),i={action:t.actionType,call_type:n.call_type,room_id:n.room_id,call_id:t.inviteID,timeout:n.timeout,version:4,invited_list:t.inviteeList};t.groupID&&(i.group_id=t.groupID);var o={entity:{action:2,chatType:t.groupID?2:1,content:JSON.stringify(i),sendTime:parseInt(Date.now()/1e3+\"\"),sender:t.inviter,version:1},userData:e||\"\"},r=JSON.stringify(o);return d.default.log(\"TSignaling._handleOfflineInfo \"+r),r},t.EVENT=l.default,t.TYPES=c.default,t}();e.default=m},function(t,e,n){n.r(e),n.d(e,\"default\",(function(){return s}));const i=Function.prototype.apply,o=new WeakMap;function r(t){return o.has(t)||o.set(t,{}),o.get(t)}class s{constructor(t=null,e=console){const n=r(this);return n._events=new Set,n._callbacks={},n._console=e,n._maxListeners=null===t?null:parseInt(t,10),this}_addCallback(t,e,n,i){return this._getCallbacks(t).push({callback:e,context:n,weight:i}),this._getCallbacks(t).sort((t,e)=>t.weight>e.weight),this}_getCallbacks(t){return r(this)._callbacks[t]}_getCallbackIndex(t,e){return this._has(t)?this._getCallbacks(t).findIndex(t=>t.callback===e):null}_achieveMaxListener(t){return null!==r(this)._maxListeners&&r(this)._maxListeners<=this.listenersNumber(t)}_callbackIsExists(t,e,n){const i=this._getCallbackIndex(t,e),o=-1!==i?this._getCallbacks(t)[i]:void 0;return-1!==i&&o&&o.context===n}_has(t){return r(this)._events.has(t)}on(t,e,n=null,i=1){const o=r(this);if(\"function\"!=typeof e)throw new TypeError(e+\" is not a function\");return this._has(t)?(this._achieveMaxListener(t)&&o._console.warn(`Max listeners (${o._maxListeners}) for event \"${t}\" is reached!`),this._callbackIsExists(...arguments)&&o._console.warn(`Event \"${t}\" already has the callback ${e}.`)):(o._events.add(t),o._callbacks[t]=[]),this._addCallback(...arguments),this}once(t,e,n=null,o=1){const r=(...o)=>(this.off(t,r),i.call(e,n,o));return this.on(t,r,n,o)}off(t,e=null){const n=r(this);let i;return this._has(t)&&(null===e?(n._events.delete(t),n._callbacks[t]=null):(i=this._getCallbackIndex(t,e),-1!==i&&(n._callbacks[t].splice(i,1),this.off(...arguments)))),this}emit(t,...e){return this._has(t)&&this._getCallbacks(t).forEach(t=>i.call(t.callback,t.context,e)),this}clear(){const t=r(this);return t._events.clear(),t._callbacks={},this}listenersNumber(t){return this._has(t)?this._getCallbacks(t).length:null}}},function(t,e){var n;n=function(){return this}();try{n=n||new Function(\"return this\")()}catch(t){\"object\"==typeof window&&(n=window)}t.exports=n},function(t,e,n){n.r(e);var i=n(0);const o=Object.prototype.hasOwnProperty;e.default=function(t){if(null==t)return!0;if(\"boolean\"==typeof t)return!1;if(\"number\"==typeof t)return 0===t;if(\"string\"==typeof t)return 0===t.length;if(\"function\"==typeof t)return 0===t.length;if(Array.isArray(t))return 0===t.length;if(t instanceof Error)return\"\"===t.message;if(Object(i.f)(t)){for(const e in t)if(o.call(t,e))return!1;return!0}return!!(Object(i.e)(t)||Object(i.g)(t)||Object(i.c)(t))&&0===t.size}},function(t,e,n){n.r(e);class i extends Error{constructor(t){super(),this.code=t.code,this.message=t.message,this.data=t.data||{}}}e.default=i},function(t,e,n){n.r(e);var i=n(1),o=n(4),r=n.n(o);e.default=class{constructor(){this._funcMap=new Map}defense(t,e,n){if(\"string\"!=typeof t)return null;if(0===t.length)return null;if(\"function\"!=typeof e)return null;if(this._funcMap.has(t)&&this._funcMap.get(t).has(e))return this._funcMap.get(t).get(e);this._funcMap.has(t)||this._funcMap.set(t,new Map);let i=null;return this._funcMap.get(t).has(e)?i=this._funcMap.get(t).get(e):(i=this._pack(t,e,n),this._funcMap.get(t).set(e,i)),i}defenseOnce(t,e,n){return\"function\"!=typeof e?null:this._pack(t,e,n)}find(t,e){return\"string\"!=typeof t||0===t.length||\"function\"!=typeof e?null:this._funcMap.has(t)?this._funcMap.get(t).has(e)?this._funcMap.get(t).get(e):(i.default.log(`SafetyCallback.find: 找不到 func —— ${t}/${\"\"!==e.name?e.name:\"[anonymous]\"}`),null):(i.default.log(`SafetyCallback.find: 找不到 eventName-${t} 对应的 func`),null)}delete(t,e){return\"function\"==typeof e&&(!!this._funcMap.has(t)&&(!!this._funcMap.get(t).has(e)&&(this._funcMap.get(t).delete(e),0===this._funcMap.get(t).size&&this._funcMap.delete(t),!0)))}_pack(t,e,n){return function(){try{e.apply(n,Array.from(arguments))}catch(e){const n=Object.values(r.a).indexOf(t),o=Object.keys(r.a)[n];i.default.error(`接入侧事件 EVENT.${o} 对应的回调函数逻辑存在问题,请检查!`,e)}}}}},function(t,e,n){\n/**\n * UUID.js - RFC-compliant UUID Generator for JavaScript\n *\n * @file\n * @author LiosK\n * @version v4.2.12\n * @license Apache License 2.0: Copyright (c) 2010-2022 LiosK\n */\nvar i;i=function(e){function i(){var t=o._getRandomInt;this.timestamp=0,this.tick=0,this.sequence=t(14),this.node=1099511627776*(1|t(8))+t(40)}function o(){}return o.generate=function(){var t=o._getRandomInt,e=o._hexAligner;return e(t(32),8)+\"-\"+e(t(16),4)+\"-\"+e(16384|t(12),4)+\"-\"+e(32768|t(14),4)+\"-\"+e(t(48),12)},o._getRandomInt=function(t){if(t<0||t>53)return NaN;var e=0|1073741824*Math.random();return t>30?e+1073741824*(0|Math.random()*(1<>>30-t},o._hexAligner=function(t,e){for(var n=t.toString(16),i=e-n.length,o=\"0\";i>0;i>>>=1,o+=o)1&i&&(n=o+n);return n},o.overwrittenUUID=e,function(){var t=o._getRandomInt;o.useMathRandom=function(){o._getRandomInt=t};var e=null,i=t;\"undefined\"!=typeof window&&(e=window.crypto||window.msCrypto)?e.getRandomValues&&\"undefined\"!=typeof Uint32Array&&(i=function(t){if(t<0||t>53)return NaN;var n=new Uint32Array(t>32?2:1);return n=e.getRandomValues(n)||n,t>32?n[0]+4294967296*(n[1]>>>64-t):n[0]>>>32-t}):(e=n(14))&&e.randomBytes&&(i=function(t){if(t<0||t>53)return NaN;var n=e.randomBytes(t>32?8:4),i=n.readUInt32BE(0);return t>32?i+4294967296*(n.readUInt32BE(4)>>>64-t):i>>>32-t}),o._getRandomInt=i}(),o.FIELD_NAMES=[\"timeLow\",\"timeMid\",\"timeHiAndVersion\",\"clockSeqHiAndReserved\",\"clockSeqLow\",\"node\"],o.FIELD_SIZES=[32,16,16,8,8,48],o.genV4=function(){var t=o._getRandomInt;return(new o)._init(t(32),t(16),16384|t(12),128|t(6),t(8),t(48))},o.parse=function(t){var e;if(e=/^\\s*(urn:uuid:|\\{)?([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{2})([0-9a-f]{2})-([0-9a-f]{12})(\\})?\\s*$/i.exec(t)){var n=e[1]||\"\",i=e[8]||\"\";if(n+i===\"\"||\"{\"===n&&\"}\"===i||\"urn:uuid:\"===n.toLowerCase()&&\"\"===i)return(new o)._init(parseInt(e[2],16),parseInt(e[3],16),parseInt(e[4],16),parseInt(e[5],16),parseInt(e[6],16),parseInt(e[7],16))}return null},o.prototype._init=function(){var t=o.FIELD_NAMES,e=o.FIELD_SIZES,n=o._binAligner,i=o._hexAligner;this.intFields=new Array(6),this.bitFields=new Array(6),this.hexFields=new Array(6);for(var r=0;r<6;r++){var s=parseInt(arguments[r]||0);this.intFields[r]=this.intFields[t[r]]=s,this.bitFields[r]=this.bitFields[t[r]]=n(s,e[r]),this.hexFields[r]=this.hexFields[t[r]]=i(s,e[r]>>>2)}return this.version=this.intFields.timeHiAndVersion>>>12&15,this.bitString=this.bitFields.join(\"\"),this.hexNoDelim=this.hexFields.join(\"\"),this.hexString=this.hexFields[0]+\"-\"+this.hexFields[1]+\"-\"+this.hexFields[2]+\"-\"+this.hexFields[3]+this.hexFields[4]+\"-\"+this.hexFields[5],this.urn=\"urn:uuid:\"+this.hexString,this},o._binAligner=function(t,e){for(var n=t.toString(2),i=e-n.length,o=\"0\";i>0;i>>>=1,o+=o)1&i&&(n=o+n);return n},o.prototype.toString=function(){return this.hexString},o.prototype.equals=function(t){if(!(t instanceof o))return!1;for(var e=0;e<6;e++)if(this.intFields[e]!==t.intFields[e])return!1;return!0},o.NIL=(new o)._init(0,0,0,0,0,0),o.genV1=function(){null==o._state&&o.resetState();var t=(new Date).getTime(),e=o._state;t!=e.timestamp?(t>>8|128,a=255&e.sequence;return(new o)._init(i,n.mid,r,s,a,e.node)},o.resetState=function(){o._state=new i},o._tsRatio=1/4,o._state=null,o._getTimeFieldValues=function(t){var e=t-Date.UTC(1582,9,15),n=e/4294967296*1e4&268435455;return{low:1e4*(268435455&e)%4294967296,mid:65535&n,hi:n>>>16,timestamp:e}},\"object\"==typeof t.exports&&(t.exports=o),o}(i)},function(t,e){},function(t){t.exports=JSON.parse('{\"name\":\"tsignaling\",\"version\":\"1.0.6\",\"description\":\"腾讯云 Web 信令 SDK\",\"main\":\"./src/index.ts\",\"scripts\":{\"lint\":\"./node_modules/.bin/eslint ./src\",\"fix\":\"./node_modules/.bin/eslint --fix ./src\",\"ts2js\":\"tsc src/index.ts --outDir build/ts2js\",\"doc\":\"npm run ts2js && npm run doc:clean && npm run doc:build\",\"doc:build\":\"./node_modules/.bin/jsdoc -c build/jsdoc/jsdoc.json && node ./build/jsdoc/fix-doc.js\",\"doc:clean\":\"node ./build/jsdoc/clean-doc.js\",\"build:wx\":\"cross-env NODE_ENV=wx webpack --config webpack.prod.config.js\",\"build:web\":\"node node_modules/cross-env/src/bin/cross-env.js NODE_ENV=web node_modules/webpack/bin/webpack.js --config webpack.prod.config.js\",\"build:package\":\"node build/package-bundle.js\",\"prerelease\":\"npm run changelog && npm run build:web && npm run build:wx && npm run build:package && node ./build/copy.js\",\"start:wx\":\"cross-env NODE_ENV=wx webpack-dev-server --config webpack.config.js\",\"start:web\":\"node node_modules/cross-env/src/bin/cross-env.js NODE_ENV=web node_modules/webpack-dev-server/bin/webpack-dev-server.js --config webpack.dev.config.js\",\"build_withcopy\":\"npm run build:web && cp dist/npm/tsignaling-js.js ../TIM-demo-web/node_modules/tsignaling/tsignaling-js.js\",\"build_withcopy:mp\":\"npm run build:wx && cp dist/npm/tsignaling-wx.js ../TIM-demo-mini/static/component/TRTCCalling/utils/tsignaling-wx.js\",\"changelog\":\"cp CHANGELOG.md build/jsdoc/tutorials/CHANGELOG.md\"},\"husky\":{\"hooks\":{\"pre-commit\":\"npm run lint\"}},\"lint-staged\":{\"*.{.ts,.tsx}\":[\"eslint\",\"git add\"]},\"keywords\":[\"腾讯云\",\"即时通信\",\"信令\"],\"author\":\"\",\"license\":\"ISC\",\"devDependencies\":{\"conventional-changelog-cli\":\"^2.1.1\",\"cross-env\":\"^7.0.2\",\"fs-extra\":\"^9.0.1\",\"html-webpack-plugin\":\"^4.3.0\",\"ts-loader\":\"^7.0.5\",\"typescript\":\"^3.9.9\",\"webpack\":\"^4.43.0\",\"@types/node\":\"18.11.9\",\"webpack-cli\":\"^3.3.11\",\"webpack-dev-server\":\"^3.11.0\"},\"dependencies\":{\"@typescript-eslint/eslint-plugin\":\"^4.22.1\",\"@typescript-eslint/parser\":\"^4.22.1\",\"EventEmitter\":\"^1.0.0\",\"docdash-blue\":\"1.1.9\",\"eslint\":\"^5.16.0\",\"eslint-config-google\":\"^0.13.0\",\"eslint-plugin-classes\":\"^0.1.1\",\"jsdoc\":\"^3.6.4\",\"jsdoc-plugin-typescript\":\"^2.0.5\",\"pretty\":\"^2.0.0\",\"replace\":\"^1.2.0\",\"uuidjs\":\"^4.2.5\"}}')},function(t,e,n){var i,o=this&&this.__extends||(i=function(t,e){return(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),r=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))((function(o,r){function s(t){try{u(i.next(t))}catch(t){r(t)}}function a(t){try{u(i.throw(t))}catch(t){r(t)}}function u(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))},s=this&&this.__generator||function(t,e){var n,i,o,r,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},\"function\"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(n)throw new TypeError(\"Generator is already executing.\");for(;s;)try{if(n=1,i&&(o=2&r[0]?i.return:r[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,r[1])).done)return o;switch(i=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return s.label++,{value:r[1],done:!1};case 5:s.label++,i=r[1],r=[0];continue;case 7:r=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){s=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]0&&u.lastMessage.lastTime&&1e3*u.lastMessage.lastTime>this.currentTime-this.expiredTime&&t.push(u);return[2,t]}}))}))},e}(l),f=function(t){function e(e){var n=t.call(this)||this;return n.tim=null,n.expiredTime=3e4,n.tim=e.tim,n}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){var e,n,i,o,r,a,l,c,d=this;return s(this,(function(s){switch(s.label){case 0:e=[],n=0,s.label=1;case 1:return nd.currentTime-d.expiredTime}))),s.label=3;case 3:return n++,[3,1];case 4:return[2,e.flat().sort((function(t,e){return t.time-e.time}))]}}))}))},e}(l),_=function(t){function e(){return t.call(this)||this}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){return s(this,(function(e){return[2,t.filter((function(t){var e=!1;try{e=JSON.parse(t.payload.data).businessID===a.BusinessID.SIGNAL}catch(t){}return e}))]}))}))},e}(l),p=function(t){function e(){return t.call(this)||this}return o(e,t),e.prototype.doFilter=function(t){return r(this,void 0,void 0,(function(){var e,n,i;return s(this,(function(o){return Array.isArray(t)?0===t.length?[2,[]]:(e=new Map,t.forEach((function(t,n){var i=JSON.parse(t.payload.data),o=i.inviteID,r=i.actionType;!e.has(o)||e.get(o).actionType!==a.ActionType.INVITE||r!==a.ActionType.CANCEL_INVITE&&r!==a.ActionType.ACCEPT_INVITE&&r!==a.ActionType.REJECT_INVITE&&r!==a.ActionType.INVITE_TIMEOUT?e.set(o,{index:n,actionType:r}):e.delete(o)})),n=[],e.forEach((function(t){t.actionType===a.ActionType.INVITE&&n.push(t.index)})),0===n.length?[2,[]]:(i=[],n.sort((function(t,e){return t-e})).forEach((function(e){i.push(t[e])})),[2,i])):[2,[]]}))}))},e}(l),I=function(){function t(t){this.tim=null;var e=t.tim;this.tim=e}return t.prototype.getHistoricalSignaling=function(){return r(this,void 0,void 0,(function(){var t;return s(this,(function(e){return(t=new c).register(new d({tim:this.tim})),t.register(new f({tim:this.tim})),t.register(new _),t.register(new p),[2,t.run()]}))}))},t}();e.default=I}]).default}));"]} \ No newline at end of file diff --git a/miniprogram_npm/tuicall-engine-wx/index.js b/miniprogram_npm/tuicall-engine-wx/index.js new file mode 100644 index 0000000..86dccb5 --- /dev/null +++ b/miniprogram_npm/tuicall-engine-wx/index.js @@ -0,0 +1,22 @@ +module.exports = (function() { +var __MODS__ = {}; +var __DEFINE__ = function(modId, func, req) { var m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func: func, req: req, m: m }; }; +var __REQUIRE__ = function(modId, source) { if(!__MODS__[modId]) return require(source); if(!__MODS__[modId].status) { var m = __MODS__[modId].m; m._exports = m._tempexports; var desp = Object.getOwnPropertyDescriptor(m, "exports"); if (desp && desp.configurable) Object.defineProperty(m, "exports", { set: function (val) { if(typeof val === "object" && val !== m._exports) { m._exports.__proto__ = val.__proto__; Object.keys(val).forEach(function (k) { m._exports[k] = val[k]; }); } m._tempexports = val }, get: function () { return m._tempexports; } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports); } return __MODS__[modId].m.exports; }; +var __REQUIRE_WILDCARD__ = function(obj) { if(obj && obj.__esModule) { return obj; } else { var newObj = {}; if(obj != null) { for(var k in obj) { if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k]; } } newObj.default = obj; return newObj; } }; +var __REQUIRE_DEFAULT__ = function(obj) { return obj && obj.__esModule ? obj.default : obj; }; +__DEFINE__(1704768242906, function(require, module, exports) { +var __TEMP__ = require('tsignaling-wx');var t = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('trtc-wx-sdk');var e = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-wx-sdk');var n = __REQUIRE_DEFAULT__(__TEMP__);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e=0;--a){var o=this.tryEntries[a],s=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=r.call(o,"catchLoc"),l=r.call(o,"finallyLoc");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;L(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},e}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}function s(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){s(a,r,i,o,c,"next",t)}function c(t){s(a,r,i,o,c,"throw",t)}o(void 0)}))}}function l(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function E(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _(t){var e=g();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&("object"==typeof e||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return E(t)}(this,n)}}function T(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return C(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&K[0]<4?1:+(K[0]+K[1])),!z&&wt&&(!(K=wt.match(/Edge\/(\d+)/))||K[1]>=74)&&(K=wt.match(/Chrome\/(\d+)/))&&(z=+K[1]);var kt=z,At=kt,Nt=N,Ut=k.String,Pt=!!Object.getOwnPropertySymbols&&!Nt((function(){var t=Symbol("symbol detection");return!Ut(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Mt=Pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,jt=Ct,Vt=yt,Gt=bt,Ht=Object,Bt=Mt?function(t){return"symbol"==typeof t}:function(t){var e=jt("Symbol");return Vt(e)&&Gt(e.prototype,Ht(t))},Ft=String,Kt=function(t){try{return Ft(t)}catch(t){return"Object"}},zt=yt,Jt=Kt,Wt=TypeError,$t=function(t){if(zt(t))return t;throw new Wt(Jt(t)+" is not a function")},qt=$t,Yt=st,Xt=function(t,e){var n=t[e];return Yt(n)?void 0:qt(n)},Qt=V,Zt=yt,te=Et,ee=TypeError,ne={exports:{}},re=k,ie=Object.defineProperty,ae=function(t,e){try{ie(re,t,{value:e,configurable:!0,writable:!0})}catch(n){re[t]=e}return e},oe=ae,se="__core-js_shared__",ce=k[se]||oe(se,{}),le=ce;(ne.exports=function(t,e){return le[t]||(le[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.33.2",mode:"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE",source:"https://github.com/zloirock/core-js"});var ue=ut,he=Object,fe=function(t){return he(ue(t))},de=fe,pe=X({}.hasOwnProperty),ve=Object.hasOwn||function(t,e){return pe(de(t),e)},ge=X,ye=0,Ie=Math.random(),me=ge(1..toString),Ee=function(t){return"Symbol("+(void 0===t?"":t)+")_"+me(++ye+Ie,36)},_e=k,Te=ne.exports,Ce=ve,be=Ee,De=Pt,Re=Mt,we=_e.Symbol,Se=Te("wks"),xe=Re?we.for||we:we&&we.withoutSetter||be,Le=function(t){return Ce(Se,t)||(Se[t]=De&&Ce(we,t)?we[t]:xe("Symbol."+t)),Se[t]},Oe=V,ke=Et,Ae=Bt,Ne=Xt,Ue=function(t,e){var n,r;if("string"===e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;if(Zt(n=t.valueOf)&&!te(r=Qt(n,t)))return r;if("string"!==e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;throw new ee("Can't convert object to primitive value")},Pe=TypeError,Me=Le("toPrimitive"),je=function(t,e){if(!ke(t)||Ae(t))return t;var n,r=Ne(t,Me);if(r){if(void 0===e&&(e="default"),n=Oe(r,t,e),!ke(n)||Ae(n))return n;throw new Pe("Can't convert object to primitive value")}return void 0===e&&(e="number"),Ue(t,e)},Ve=je,Ge=Bt,He=function(t){var e=Ve(t,"string");return Ge(e)?e:e+""},Be=Et,Fe=k.document,Ke=Be(Fe)&&Be(Fe.createElement),ze=function(t){return Ke?Fe.createElement(t):{}},Je=ze,We=!U&&!N((function(){return 7!==Object.defineProperty(Je("div"),"a",{get:function(){return 7}}).a})),$e=U,qe=V,Ye=G,Xe=J,Qe=dt,Ze=He,tn=ve,en=We,nn=Object.getOwnPropertyDescriptor;A.f=$e?nn:function(t,e){if(t=Qe(t),e=Ze(e),en)try{return nn(t,e)}catch(t){}if(tn(t,e))return Xe(!qe(Ye.f,t,e),t[e])};var rn={},an=U&&N((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),on=Et,sn=String,cn=TypeError,ln=function(t){if(on(t))return t;throw new cn(sn(t)+" is not an object")},un=U,hn=We,fn=an,dn=ln,pn=He,vn=TypeError,gn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,In="enumerable",mn="configurable",En="writable";rn.f=un?fn?function(t,e,n){if(dn(t),e=pn(e),dn(n),"function"==typeof t&&"prototype"===e&&"value"in n&&En in n&&!n[En]){var r=yn(t,e);r&&r[En]&&(t[e]=n.value,n={configurable:mn in n?n[mn]:r[mn],enumerable:In in n?n[In]:r[In],writable:!1})}return gn(t,e,n)}:gn:function(t,e,n){if(dn(t),e=pn(e),dn(n),hn)try{return gn(t,e,n)}catch(t){}if("get"in n||"set"in n)throw new vn("Accessors not supported");return"value"in n&&(t[e]=n.value),t};var _n=rn,Tn=J,Cn=U?function(t,e,n){return _n.f(t,e,Tn(1,n))}:function(t,e,n){return t[e]=n,t},bn={exports:{}},Dn=U,Rn=ve,wn=Function.prototype,Sn=Dn&&Object.getOwnPropertyDescriptor,xn=Rn(wn,"name"),Ln={EXISTS:xn,PROPER:xn&&"something"===function(){}.name,CONFIGURABLE:xn&&(!Dn||Dn&&Sn(wn,"name").configurable)},On=yt,kn=ce,An=X(Function.toString);On(kn.inspectSource)||(kn.inspectSource=function(t){return An(t)});var Nn,Un,Pn,Mn=kn.inspectSource,jn=yt,Vn=k.WeakMap,Gn=jn(Vn)&&/native code/.test(String(Vn)),Hn=ne.exports,Bn=Ee,Fn=Hn("keys"),Kn=function(t){return Fn[t]||(Fn[t]=Bn(t))},zn={},Jn=Gn,Wn=k,$n=Et,qn=Cn,Yn=ve,Xn=ce,Qn=Kn,Zn=zn,tr="Object already initialized",er=Wn.TypeError,nr=Wn.WeakMap;if(Jn||Xn.state){var rr=Xn.state||(Xn.state=new nr);rr.get=rr.get,rr.has=rr.has,rr.set=rr.set,Nn=function(t,e){if(rr.has(t))throw new er(tr);return e.facade=t,rr.set(t,e),e},Un=function(t){return rr.get(t)||{}},Pn=function(t){return rr.has(t)}}else{var ir=Qn("state");Zn[ir]=!0,Nn=function(t,e){if(Yn(t,ir))throw new er(tr);return e.facade=t,qn(t,ir,e),e},Un=function(t){return Yn(t,ir)?t[ir]:{}},Pn=function(t){return Yn(t,ir)}}var ar={set:Nn,get:Un,has:Pn,enforce:function(t){return Pn(t)?Un(t):Nn(t,{})},getterFor:function(t){return function(e){var n;if(!$n(e)||(n=Un(e)).type!==t)throw new er("Incompatible receiver, "+t+" required");return n}}},or=X,sr=N,cr=yt,lr=ve,ur=U,hr=Ln.CONFIGURABLE,fr=Mn,dr=ar.enforce,pr=ar.get,vr=String,gr=Object.defineProperty,yr=or("".slice),Ir=or("".replace),mr=or([].join),Er=ur&&!sr((function(){return 8!==gr((function(){}),"length",{value:8}).length})),_r=String(String).split("String"),Tr=bn.exports=function(t,e,n){"Symbol("===yr(vr(e),0,7)&&(e="["+Ir(vr(e),/^Symbol\(([^)]*)\)/,"$1")+"]"),n&&n.getter&&(e="get "+e),n&&n.setter&&(e="set "+e),(!lr(t,"name")||hr&&t.name!==e)&&(ur?gr(t,"name",{value:e,configurable:!0}):t.name=e),Er&&n&&lr(n,"arity")&&t.length!==n.arity&&gr(t,"length",{value:n.arity});try{n&&lr(n,"constructor")&&n.constructor?ur&&gr(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=dr(t);return lr(r,"source")||(r.source=mr(_r,"string"==typeof e?e:"")),t};Function.prototype.toString=Tr((function(){return cr(this)&&pr(this).source||fr(this)}),"toString");var Cr=yt,br=rn,Dr=bn.exports,Rr=ae,wr=function(t,e,n,r){r||(r={});var i=r.enumerable,a=void 0!==r.name?r.name:e;if(Cr(n)&&Dr(n,a,r),r.global)i?t[e]=n:Rr(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=n:br.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Sr={},xr=Math.ceil,Lr=Math.floor,Or=Math.trunc||function(t){var e=+t;return(e>0?Lr:xr)(e)},kr=function(t){var e=+t;return e!=e||0===e?0:Or(e)},Ar=kr,Nr=Math.max,Ur=Math.min,Pr=function(t,e){var n=Ar(t);return n<0?Nr(n+e,0):Ur(n,e)},Mr=kr,jr=Math.min,Vr=function(t){return t>0?jr(Mr(t),9007199254740991):0},Gr=Vr,Hr=function(t){return Gr(t.length)},Br=dt,Fr=Pr,Kr=Hr,zr=function(t){return function(e,n,r){var i,a=Br(e),o=Kr(a),s=Fr(r,o);if(t&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}},Jr={includes:zr(!0),indexOf:zr(!1)},Wr=ve,$r=dt,qr=Jr.indexOf,Yr=zn,Xr=X([].push),Qr=function(t,e){var n,r=$r(t),i=0,a=[];for(n in r)!Wr(Yr,n)&&Wr(r,n)&&Xr(a,n);for(;e.length>i;)Wr(r,n=e[i++])&&(~qr(a,n)||Xr(a,n));return a},Zr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ti=Qr,ei=Zr.concat("length","prototype");Sr.f=Object.getOwnPropertyNames||function(t){return ti(t,ei)};var ni={};ni.f=Object.getOwnPropertySymbols;var ri=Ct,ii=Sr,ai=ni,oi=ln,si=X([].concat),ci=ri("Reflect","ownKeys")||function(t){var e=ii.f(oi(t)),n=ai.f;return n?si(e,n(t)):e},li=ve,ui=ci,hi=A,fi=rn,di=N,pi=yt,vi=/#|\.prototype\./,gi=function(t,e){var n=Ii[yi(t)];return n===Ei||n!==mi&&(pi(e)?di(e):!!e)},yi=gi.normalize=function(t){return String(t).replace(vi,".").toLowerCase()},Ii=gi.data={},mi=gi.NATIVE="N",Ei=gi.POLYFILL="P",_i=gi,Ti=k,Ci=A.f,bi=Cn,Di=wr,Ri=ae,wi=function(t,e,n){for(var r=ui(e),i=fi.f,a=hi.f,o=0;o9007199254740991)throw ki("Maximum allowed index exceeded");return t},Ni=He,Ui=rn,Pi=J,Mi=function(t,e,n){var r=Ni(e);r in t?Ui.f(t,r,Pi(0,n)):t[r]=n},ji={};ji[Le("toStringTag")]="z";var Vi="[object z]"===String(ji),Gi=Vi,Hi=yt,Bi=et,Fi=Le("toStringTag"),Ki=Object,zi="Arguments"===Bi(function(){return arguments}()),Ji=Gi?Bi:function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Ki(t),Fi))?n:zi?Bi(e):"Object"===(r=Bi(e))&&Hi(e.callee)?"Arguments":r},Wi=X,$i=N,qi=yt,Yi=Ji,Xi=Mn,Qi=function(){},Zi=[],ta=Ct("Reflect","construct"),ea=/^\s*(?:class|function)\b/,na=Wi(ea.exec),ra=!ea.test(Qi),ia=function(t){if(!qi(t))return!1;try{return ta(Qi,Zi,t),!0}catch(t){return!1}},aa=function(t){if(!qi(t))return!1;switch(Yi(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return ra||!!na(ea,Xi(t))}catch(t){return!0}};aa.sham=!0;var oa=!ta||$i((function(){var t;return ia(ia.call)||!ia(Object)||!ia((function(){t=!0}))||t}))?aa:ia,sa=Oi,ca=oa,la=Et,ua=Le("species"),ha=Array,fa=function(t){var e;return sa(t)&&(e=t.constructor,(ca(e)&&(e===ha||sa(e.prototype))||la(e)&&null===(e=e[ua]))&&(e=void 0)),void 0===e?ha:e},da=function(t,e){return new(fa(t))(0===e?0:e)},pa=N,va=kt,ga=Le("species"),ya=function(t){return va>=51||!pa((function(){var e=[];return(e.constructor={})[ga]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ia=xi,ma=N,Ea=Oi,_a=Et,Ta=fe,Ca=Hr,ba=Ai,Da=Mi,Ra=da,wa=ya,Sa=kt,xa=Le("isConcatSpreadable"),La=Sa>=51||!ma((function(){var t=[];return t[xa]=!1,t.concat()[0]!==t})),Oa=function(t){if(!_a(t))return!1;var e=t[xa];return void 0!==e?!!e:Ea(t)};Ia({target:"Array",proto:!0,arity:1,forced:!La||!wa("concat")},{concat:function(t){var e,n,r,i,a,o=Ta(this),s=Ra(o,0),c=0;for(e=-1,r=arguments.length;e1?arguments[1]:void 0;return Za?Qa(this,t,e)||0:Ya(this,t,e)}});var to=$t,eo=P,no=Ja(Ja.bind),ro=function(t,e){return to(t),void 0===e?t:eo?no(t,e):function(){return t.apply(e,arguments)}},io=ro,ao=ot,oo=fe,so=Hr,co=da,lo=X([].push),uo=function(t){var e=1===t,n=2===t,r=3===t,i=4===t,a=6===t,o=7===t,s=5===t||a;return function(c,l,u,h){for(var f,d,p=oo(c),v=ao(p),g=io(l,u),y=so(v),I=0,m=h||co,E=e?m(c,y):n||o?m(c,0):void 0;y>I;I++)if((s||I in v)&&(d=g(f=v[I],I,p),t))if(e)E[I]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return I;case 2:lo(E,f)}else switch(t){case 4:return!1;case 7:lo(E,f)}return a?-1:r||i?i:E}},ho={forEach:uo(0),map:uo(1),filter:uo(2),some:uo(3),every:uo(4),find:uo(5),findIndex:uo(6),filterReject:uo(7)},fo=ho.filter;xi({target:"Array",proto:!0,forced:!ya("filter")},{filter:function(t){return fo(this,t,arguments.length>1?arguments[1]:void 0)}});var po=Ji,vo=Vi?{}.toString:function(){return"[object "+po(this)+"]"};Vi||wr(Object.prototype,"toString",vo,{unsafe:!0});var go=ho.map;xi({target:"Array",proto:!0,forced:!ya("map")},{map:function(t){return go(this,t,arguments.length>1?arguments[1]:void 0)}});var yo=xi,Io=Date,mo=X(Io.prototype.getTime);yo({target:"Date",stat:!0},{now:function(){return mo(new Io)}});var Eo=U,_o=X,To=V,Co=N,bo=Ha,Do=ni,Ro=G,wo=fe,So=ot,xo=Object.assign,Lo=Object.defineProperty,Oo=_o([].concat),ko=!xo||Co((function(){if(Eo&&1!==xo({b:1},xo(Lo({},"a",{enumerable:!0,get:function(){Lo(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol("assign detection"),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach((function(t){e[t]=t})),7!==xo({},t)[n]||bo(xo({},e)).join("")!==r}))?function(t,e){for(var n=wo(t),r=arguments.length,i=1,a=Do.f,o=Ro.f;r>i;)for(var s,c=So(arguments[i++]),l=a?Oo(bo(c),a(c)):bo(c),u=l.length,h=0;u>h;)s=l[h++],Eo&&!To(o,c,s)||(n[s]=c[s]);return n}:xo,Ao=ko;xi({target:"Object",stat:!0,arity:2,forced:Object.assign!==Ao},{assign:Ao});var No,Uo,Po,Mo,jo="process"===et(k.process),Vo=X,Go=$t,Ho=yt,Bo=String,Fo=TypeError,Ko=function(t,e,n){try{return Vo(Go(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},zo=ln,Jo=function(t){if("object"==typeof t||Ho(t))return t;throw new Fo("Can't set "+Bo(t)+" as a prototype")},Wo=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Ko(Object.prototype,"__proto__","set"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return zo(n),Jo(r),e?t(n,r):n.__proto__=r,n}}():void 0),$o=rn.f,qo=ve,Yo=Le("toStringTag"),Xo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!qo(t,Yo)&&$o(t,Yo,{configurable:!0,value:e})},Qo=bn.exports,Zo=rn,ts=function(t,e,n){return n.get&&Qo(n.get,e,{getter:!0}),n.set&&Qo(n.set,e,{setter:!0}),Zo.f(t,e,n)},es=Ct,ns=ts,rs=U,is=Le("species"),as=function(t){var e=es(t);rs&&e&&!e[is]&&ns(e,is,{configurable:!0,get:function(){return this}})},os=bt,ss=TypeError,cs=function(t,e){if(os(e,t))return t;throw new ss("Incorrect invocation")},ls=oa,us=Kt,hs=TypeError,fs=ln,ds=function(t){if(ls(t))return t;throw new hs(us(t)+" is not a constructor")},ps=st,vs=Le("species"),gs=P,ys=Function.prototype,Is=ys.apply,ms=ys.call,Es="object"==typeof Reflect&&Reflect.apply||(gs?ms.bind(Is):function(){return ms.apply(Is,arguments)}),_s=Ct("document","documentElement"),Ts=X([].slice),Cs=TypeError,bs=function(t,e){if(ta;a++)if((s=y(t[a]))&&Iu(bu,s))return s;return new Cu(!1)}r=mu(t,i)}for(c=f?t.next:r.next;!(l=du(c,r)).done;){try{s=y(l.value)}catch(t){_u(r,"throw",t)}if("object"==typeof s&&s&&Iu(bu,s))return s}return new Cu(!1)},Ru=Le("iterator"),wu=!1;try{var Su=0,xu={next:function(){return{done:!!Su++}},return:function(){wu=!0}};xu[Ru]=function(){return this},Array.from(xu,(function(){throw 2}))}catch(t){}var Lu=function(t,e){try{if(!e&&!wu)return!1}catch(t){return!1}var n=!1;try{var r={};r[Ru]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ou=wc,ku=Fc.CONSTRUCTOR||!Lu((function(t){Ou.all(t).then(void 0,(function(){}))})),Au=V,Nu=$t,Uu=Kc,Pu=Rc,Mu=Du;xi({target:"Promise",stat:!0,forced:ku},{all:function(t){var e=this,n=Uu.f(e),r=n.resolve,i=n.reject,a=Pu((function(){var n=Nu(e.resolve),a=[],o=0,s=1;Mu(t,(function(t){var c=o++,l=!1;s++,Au(n,e,t).then((function(t){l||(l=!0,a[c]=t,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var ju=xi,Vu=Fc.CONSTRUCTOR,Gu=wc,Hu=Ct,Bu=yt,Fu=wr,Ku=Gu&&Gu.prototype;if(ju({target:"Promise",proto:!0,forced:Vu,real:!0},{catch:function(t){return this.then(void 0,t)}}),Bu(Gu)){var zu=Hu("Promise").prototype.catch;Ku.catch!==zu&&Fu(Ku,"catch",zu,{unsafe:!0})}var Ju=V,Wu=$t,$u=Kc,qu=Rc,Yu=Du;xi({target:"Promise",stat:!0,forced:ku},{race:function(t){var e=this,n=$u.f(e),r=n.reject,i=qu((function(){var i=Wu(e.resolve);Yu(t,(function(t){Ju(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Xu=V,Qu=Kc;xi({target:"Promise",stat:!0,forced:Fc.CONSTRUCTOR},{reject:function(t){var e=Qu.f(this);return Xu(e.reject,void 0,t),e.promise}});var Zu=ln,th=Et,eh=Kc,nh=xi,rh=Fc.CONSTRUCTOR,ih=function(t,e){if(Zu(t),th(e)&&e.constructor===t)return e;var n=eh.f(t);return(0,n.resolve)(e),n.promise};Ct("Promise"),nh({target:"Promise",stat:!0,forced:rh},{resolve:function(t){return ih(this,t)}});var ah="function"==typeof Bun&&Bun&&"string"==typeof Bun.version,oh=k,sh=Es,ch=yt,lh=ah,uh=Dt,hh=Ts,fh=bs,dh=oh.Function,ph=/MSIE .\./.test(uh)||lh&&function(){var t=oh.Bun.version.split(".");return t.length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2])}(),vh=function(t,e){var n=e?2:1;return ph?function(r,i){var a=fh(arguments.length,1)>n,o=ch(r)?r:dh(r),s=a?hh(arguments,n):[],c=a?function(){sh(o,this,s)}:o;return e?t(c,i):t(c)}:t},gh=xi,yh=k,Ih=vh(yh.setInterval,!0);gh({global:!0,bind:!0,forced:yh.setInterval!==Ih},{setInterval:Ih});var mh=xi,Eh=k,_h=vh(Eh.setTimeout,!0);mh({global:!0,bind:!0,forced:Eh.setTimeout!==_h},{setTimeout:_h});var Th=Ji,Ch=String,bh=function(t){if("Symbol"===Th(t))throw new TypeError("Cannot convert a Symbol value to a string");return Ch(t)},Dh=X,Rh=kr,wh=bh,Sh=ut,xh=Dh("".charAt),Lh=Dh("".charCodeAt),Oh=Dh("".slice),kh=function(t){return function(e,n){var r,i,a=wh(Sh(e)),o=Rh(n),s=a.length;return o<0||o>=s?t?"":void 0:(r=Lh(a,o))<55296||r>56319||o+1===s||(i=Lh(a,o+1))<56320||i>57343?t?xh(a,o):r:t?Oh(a,o,o+2):i-56320+(r-55296<<10)+65536}},Ah={codeAt:kh(!1),charAt:kh(!0)},Nh={},Uh=U,Ph=an,Mh=rn,jh=ln,Vh=dt,Gh=Ha;Nh.f=Uh&&!Ph?Object.defineProperties:function(t,e){jh(t);for(var n,r=Vh(e),i=Gh(e),a=i.length,o=0;a>o;)Mh.f(t,n=i[o++],r[n]);return t};var Hh,Bh=ln,Fh=Nh,Kh=Zr,zh=zn,Jh=_s,Wh=ze,$h="prototype",qh="script",Yh=Kn("IE_PROTO"),Xh=function(){},Qh=function(t){return"<"+qh+">"+t+""},Zh=function(t){t.write(Qh("")),t.close();var e=t.parentWindow.Object;return t=null,e},tf=function(){try{Hh=new ActiveXObject("htmlfile")}catch(t){}var t,e,n;tf="undefined"!=typeof document?document.domain&&Hh?Zh(Hh):(e=Wh("iframe"),n="java"+qh+":",e.style.display="none",Jh.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Qh("document.F=Object")),t.close(),t.F):Zh(Hh);for(var r=Kh.length;r--;)delete tf[$h][Kh[r]];return tf()};zh[Yh]=!0;var ef,nf,rf,af=Object.create||function(t,e){var n;return null!==t?(Xh[$h]=Bh(t),n=new Xh,Xh[$h]=null,n[Yh]=t):n=tf(),void 0===e?n:Fh.f(n,e)},of=!N((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),sf=ve,cf=yt,lf=fe,uf=of,hf=Kn("IE_PROTO"),ff=Object,df=ff.prototype,pf=uf?ff.getPrototypeOf:function(t){var e=lf(t);if(sf(e,hf))return e[hf];var n=e.constructor;return cf(n)&&e instanceof n?n.prototype:e instanceof ff?df:null},vf=N,gf=yt,yf=Et,If=pf,mf=wr,Ef=Le("iterator"),_f=!1;[].keys&&("next"in(rf=[].keys())?(nf=If(If(rf)))!==Object.prototype&&(ef=nf):_f=!0);var Tf=!yf(ef)||vf((function(){var t={};return ef[Ef].call(t)!==t}));Tf&&(ef={}),gf(ef[Ef])||mf(ef,Ef,(function(){return this}));var Cf={IteratorPrototype:ef,BUGGY_SAFARI_ITERATORS:_f},bf=Cf.IteratorPrototype,Df=af,Rf=J,wf=Xo,Sf=Kl,xf=function(){return this},Lf=xi,Of=V,kf=yt,Af=function(t,e,n,r){var i=e+" Iterator";return t.prototype=Df(bf,{next:Rf(+!r,n)}),wf(t,i,!1),Sf[i]=xf,t},Nf=pf,Uf=Wo,Pf=Xo,Mf=Cn,jf=wr,Vf=Kl,Gf=Ln.PROPER,Hf=Ln.CONFIGURABLE,Bf=Cf.IteratorPrototype,Ff=Cf.BUGGY_SAFARI_ITERATORS,Kf=Le("iterator"),zf="keys",Jf="values",Wf="entries",$f=function(){return this},qf=function(t,e,n,r,i,a,o){Af(n,e,r);var s,c,l,u=function(t){if(t===i&&v)return v;if(!Ff&&t&&t in d)return d[t];switch(t){case zf:case Jf:case Wf:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+" Iterator",f=!1,d=t.prototype,p=d[Kf]||d["@@iterator"]||i&&d[i],v=!Ff&&p||u(i),g="Array"===e&&d.entries||p;if(g&&(s=Nf(g.call(new t)))!==Object.prototype&&s.next&&(Nf(s)!==Bf&&(Uf?Uf(s,Bf):kf(s[Kf])||jf(s,Kf,$f)),Pf(s,h,!0)),Gf&&i===Jf&&p&&p.name!==Jf&&(Hf?Mf(d,"name",Jf):(f=!0,v=function(){return Of(p,this)})),i)if(c={values:u(Jf),keys:a?v:u(zf),entries:u(Wf)},o)for(l in c)(Ff||f||!(l in d))&&jf(d,l,c[l]);else Lf({target:e,proto:!0,forced:Ff||f},c);return d[Kf]!==v&&jf(d,Kf,v,{name:i}),Vf[e]=v,c},Yf=function(t,e){return{value:t,done:e}},Xf=Ah.charAt,Qf=bh,Zf=ar,td=qf,ed=Yf,nd="String Iterator",rd=Zf.set,id=Zf.getterFor(nd);td(String,"String",(function(t){rd(this,{type:nd,string:Qf(t),index:0})}),(function(){var t,e=id(this),n=e.string,r=e.index;return r>=n.length?ed(void 0,!0):(t=Xf(n,r),e.index+=t.length,ed(t,!1))}));var ad=Le,od=af,sd=rn.f,cd=ad("unscopables"),ld=Array.prototype;void 0===ld[cd]&&sd(ld,cd,{configurable:!0,value:od(null)});var ud=function(t){ld[cd][t]=!0},hd=dt,fd=ud,dd=Kl,pd=ar,vd=rn.f,gd=qf,yd=Yf,Id=U,md="Array Iterator",Ed=pd.set,_d=pd.getterFor(md),Td=gd(Array,"Array",(function(t,e){Ed(this,{type:md,target:hd(t),index:0,kind:e})}),(function(){var t=_d(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=void 0,yd(void 0,!0);switch(t.kind){case"keys":return yd(n,!1);case"values":return yd(e[n],!1)}return yd([n,e[n]],!1)}),"values"),Cd=dd.Arguments=dd.Array;if(fd("keys"),fd("values"),fd("entries"),Id&&"values"!==Cd.name)try{vd(Cd,"name",{value:"values"})}catch(t){}var bd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Dd=ze("span").classList,Rd=Dd&&Dd.constructor&&Dd.constructor.prototype,wd=Rd===Object.prototype?void 0:Rd,Sd=k,xd=bd,Ld=wd,Od=Td,kd=Cn,Ad=Le,Nd=Ad("iterator"),Ud=Ad("toStringTag"),Pd=Od.values,Md=function(t,e){if(t){if(t[Nd]!==Pd)try{kd(t,Nd,Pd)}catch(e){t[Nd]=Pd}if(t[Ud]||kd(t,Ud,e),xd[e])for(var n in Od)if(t[n]!==Od[n])try{kd(t,n,Od[n])}catch(e){t[n]=Od[n]}}};for(var jd in xd)Md(Sd[jd]&&Sd[jd].prototype,jd);Md(Ld,"DOMTokenList");var Vd=xi,Gd=Oi,Hd=oa,Bd=Et,Fd=Pr,Kd=Hr,zd=dt,Jd=Mi,Wd=Le,$d=Ts,qd=ya("slice"),Yd=Wd("species"),Xd=Array,Qd=Math.max;Vd({target:"Array",proto:!0,forced:!qd},{slice:function(t,e){var n,r,i,a=zd(this),o=Kd(a),s=Fd(t,o),c=Fd(void 0===e?o:e,o);if(Gd(a)&&(n=a.constructor,(Hd(n)&&(n===Xd||Gd(n.prototype))||Bd(n)&&null===(n=n[Yd]))&&(n=void 0),n===Xd||void 0===n))return $d(a,s,c);for(r=new(void 0===n?Xd:n)(Qd(c-s,0)),i=0;s1?arguments[1]:void 0)};xi({target:"Array",proto:!0,forced:[].forEach!==tp},{forEach:tp});var ep=k,np=bd,rp=wd,ip=tp,ap=Cn,op=function(t){if(t&&t.forEach!==ip)try{ap(t,"forEach",ip)}catch(e){t.forEach=ip}};for(var sp in np)np[sp]&&op(ep[sp]&&ep[sp].prototype);op(rp);var cp=ln,lp=hu,up=ro,hp=V,fp=fe,dp=function(t,e,n,r){try{return r?e(cp(n)[0],n[1]):e(n)}catch(e){lp(t,"throw",e)}},pp=$l,vp=oa,gp=Hr,yp=Mi,Ip=su,mp=tu,Ep=Array,_p=function(t){var e=fp(t),n=vp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=up(i,r>2?arguments[2]:void 0));var o,s,c,l,u,h,f=mp(e),d=0;if(!f||this===Ep&&pp(f))for(o=gp(e),s=n?new this(o):Ep(o);o>d;d++)h=a?i(e[d],d):e[d],yp(s,d,h);else for(u=(l=Ip(e,f)).next,s=n?new this:[];!(c=hp(u,l)).done;d++)h=a?dp(l,i,[c.value,d],!0):c.value,yp(s,d,h);return s.length=d,s};xi({target:"Array",stat:!0,forced:!Lu((function(t){Array.from(t)}))},{from:_p});var Tp={exports:{}},Cp={},bp=Pr,Dp=Hr,Rp=Mi,wp=Array,Sp=Math.max,xp=et,Lp=dt,Op=Sr.f,kp=function(t,e,n){for(var r=Dp(t),i=bp(e,r),a=bp(void 0===n?r:n,r),o=wp(Sp(a-i,0)),s=0;i1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),wv(a,n?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),Uv&&Rv(a,"size",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(t,e,n){var r=e+" Iterator",i=jv(e),a=jv(r);kv(t,e,(function(t,e){Mv(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?Av("keys"===e?n.key:"values"===e?n.value:[n.key,n.value],!1):(t.target=void 0,Av(void 0,!0))}),n?"entries":"values",!n,!0),Nv(e)}};Tv("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Vv);var Gv=U,Hv=Oi,Bv=TypeError,Fv=Object.getOwnPropertyDescriptor,Kv=Gv&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(Hv(t)&&!Fv(t,"length").writable)throw new Bv("Cannot set read only .length");return t.length=e}:function(t,e){return t.length=e},zv=Kt,Jv=TypeError,Wv=xi,$v=fe,qv=Pr,Yv=kr,Xv=Hr,Qv=Kv,Zv=Ai,tg=da,eg=Mi,ng=function(t,e){if(!delete t[e])throw new Jv("Cannot delete property "+zv(e)+" of "+zv(t))},rg=ya("splice"),ig=Math.max,ag=Math.min;Wv({target:"Array",proto:!0,forced:!rg},{splice:function(t,e){var n,r,i,a,o,s,c=$v(this),l=Xv(c),u=qv(t,l),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=l-u):(n=h-2,r=ag(ig(Yv(e),0),l-u)),Zv(l+n-r),i=tg(c,r),a=0;al-r+n;a--)ng(c,a-1)}else if(n>r)for(a=l-r;a>u;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:ng(c,s);for(a=0;a 标签),请使用真机调试或者扫码预览。",Og={RECORD:"scope.record",CAMERA:"scope.camera"},kg="https://buy.cloud.tencent.com/avc?addRavLicense=1",Ag="https://buy.tencentcloud.com/avc?addRavLicense=1",Ng=1,Ug=9,Pg=17,Mg=18,jg=21,Vg=15,Gg="\t\n\v\f\r                 \u2028\u2029\ufeff",Hg=ut,Bg=bh,Fg=Gg,Kg=X("".replace),zg=RegExp("^["+Fg+"]+"),Jg=RegExp("(^|[^"+Fg+"])["+Fg+"]+$"),Wg=function(t){return function(e){var n=Bg(Hg(e));return 1&t&&(n=Kg(n,zg,"")),2&t&&(n=Kg(n,Jg,"$1")),n}},$g={start:Wg(1),end:Wg(2),trim:Wg(3)},qg=k,Yg=N,Xg=X,Qg=bh,Zg=$g.trim,ty=Gg,ey=qg.parseInt,ny=qg.Symbol,ry=ny&&ny.iterator,iy=/^[+-]?0x/i,ay=Xg(iy.exec),oy=8!==ey(ty+"08")||22!==ey(ty+"0x16")||ry&&!Yg((function(){ey(Object(ry))}))?function(t,e){var n=Zg(Qg(t));return ey(n,e>>>0||(ay(iy,n)?16:10))}:ey;function sy(t){var e=new Date(t);return"".concat(e.getFullYear(),"-")+"".concat(e.getMonth()+1<10?"0".concat(e.getMonth()+1):e.getMonth()+1,"-")+cy(e.getDate()," ")+cy(e.getHours(),":")+cy(e.getMinutes(),":")+cy(e.getSeconds(),"")}function cy(t,e){return"".concat(t<10?"0".concat(t).concat(e):"".concat(t).concat(e))}xi({global:!0,forced:parseInt!==oy},{parseInt:oy});var ly={exports:{}};self;var uy=L(ly.exports=(()=>(()=>{var t={530:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=void 0;var r=n(928);e.formatClsLog=function(){return function(t,e){try{e({logs:null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else"time"===n&&(e[n]=new Date(t[n]).toISOString()),e[n]=t[n]+""})),{contents:e,time:t.time}})),source:""})}catch(t){console.debug(t)}}}},597:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatESLog=void 0;var r=n(928);e.formatESLog=function(t){var e=t.table;return function(t,n){try{var i=null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else e[n]="level"===n?t[n]+"":"time"===n?new Date(t[n]).toISOString():t[n]})),e}));n({table:e,report:i})}catch(t){console.debug(t)}}}},150:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.formatClsLog=e.formatESLog=void 0;var r=n(314);Object.defineProperty(e,"formatClsLog",{enumerable:!0,get:function(){return r.formatClsLog}});var i=n(597);Object.defineProperty(e,"formatESLog",{enumerable:!0,get:function(){return i.formatESLog}})},757:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createPipeline=void 0;var r=n(928);e.createPipeline=function(t){if(!t||!t.reduce||!t.length)throw new TypeError("createPipeline need at least one function param");return 1===t.length?function(e,n){t[0](e,n||r.noop)}:t.reduce((function(t,e){return function(n,i){return void 0===i&&(i=r.noop),t(n,(function(t){return null==e?void 0:e(t,i)}))}}))}},758:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.limitLengthPipe=e.MAX_LOG_LENGTH=void 0;var r=n(928);e.MAX_LOG_LENGTH=102400,e.limitLengthPipe=function(){return function(t,n){try{var i=(t=t||{}).logs,a=void 0===i?[]:i;t.logs=null==a?void 0:a.map((function(t){var n=e.MAX_LOG_LENGTH,i=t.contents;return Object.keys(i).forEach((function(t){var e=i[t];try{e&&e.length>n&&(i[t]=null==e?void 0:e.substring(0,n))}catch(a){console.debug("size of content > limitSize"),i[t]=(0,r.stringifyPlus)(e).substring(0,n)}})),t})),n(t)}catch(t){console.debug(t)}}}},23:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.createThrottlePipe=void 0,e.createThrottlePipe=function(t,e){var n,r=[];return function(i,a){if(Array.isArray(i)?r=r.concat(i):r.push(i),e&&r.length>=e||t.sendNow&&r.length>0)return a(r.splice(0,r.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout((function(){n=null,r.length>0&&a(r.splice(0,r.length))}),t.delay||1e3)}}},434:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,3];case 2:return n.sent(),[3,1];case 3:return s++,[4,new Promise((function(e,n){wx.request(r(r({},t),{success:function(t){e(t)},fail:function(t){n(t)}}))}))];case 4:return[2,n.sent()];case 5:return e=n.sent(),[2,Promise.reject(e)];case 6:return s--,(0,o.resolveFirstBlock)(),[7];case 7:return[2]}}))}))}},310:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,2];case 1:return i.sent(),[3,0];case 2:return s++,r=n.method,u=n.headers,f=void 0===u?{}:u,d=n.responseType,p=void 0===d?"json":d,r=(r||"get").toUpperCase(),Object.assign(f,{"Content-type":"application/json"}),(v=new window.XMLHttpRequest).responseType=p,v.timeout=1e4,v.onreadystatechange=function(){4===v.readyState&&(200===v.status?l({data:v.response}):h({code:v.status,msg:v.statusText}))},v.ontimeout=function(t){h({code:v.status,msg:v.statusText})},v.onloadend=function(){v&&(c((function(t){l(t)}),(function(t){h(t)}),{status:v.status,statusText:v.statusText}),v=null)},v.onabort=function(){v&&(h(new Error("Request aborted")),v=null)},v.onerror=function(){h(new Error("Network Error")),v=null},"GET"===r?t="url".concat(-1===t.indexOf("?")?"?":"&").concat(a.default.stringify(e)):"POST"===r&&(e=JSON.stringify(e)),v.open(r,t,!0),Object.keys(f).forEach((function(t){v.setRequestHeader(t,f[t])})),v.send("POST"===r?e:null),[2]}}))}))}))];case 1:return[2,h.sent()];case 2:throw l=h.sent(),new Error(l);case 3:return s--,(0,o.resolveFirstBlock)(),[7];case 4:return[2]}}))}))}},928:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.date2ISOString=e.stringifyPlus=e.noop=e.isBrowser=e.isMiniProgram=e.isPlainObject=e.appendParams=void 0,e.appendParams=function(t,n){void 0===n&&(n={});var r=[];return Object.keys(n).forEach((function(t){var i=n[t];if(void 0!==i){if((0,e.isPlainObject)(i))try{i=JSON.stringify(i)}catch(t){}r.push("".concat(t,"=").concat(encodeURIComponent(i)))}})),r.length?(t.indexOf("?")>-1?"".concat(t,"&"):"".concat(t,"?"))+r.join("&"):t},e.isPlainObject=function(t){if("object"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},e.isMiniProgram=function(){try{return!(!(null===wx||void 0===wx?void 0:wx.request)||!(null===wx||void 0===wx?void 0:wx.connectSocket))}catch(t){return!1}},e.isBrowser=function(){try{return!(0,e.isMiniProgram)()&&"undefined"!=typeof window&&void 0!==window.document}catch(t){return!1}},e.noop=function(){};var n=function(){var t=new WeakSet;return function(e,n){if(n instanceof Error)return"Error.message: ".concat(n.message," \n Error.stack: ").concat(n.stack);if("object"==typeof n&&null!==n){if(t.has(n))return"[Circular ".concat(e||"root","]");t.add(n)}return n}};e.stringifyPlus=function(t){if("string"==typeof t)return t;try{return t instanceof Error?(JSON.stringify(t,n())||"undefined").replace(/"/gim,""):JSON.stringify(t,n())||"undefined"}catch(t){return"error happen when aegis stringify: \n ".concat(t.message," \n ").concat(t.stack)}},e.date2ISOString=function(){var t,e=new Date,n=e.toISOString(),r=e.getTimezoneOffset()/60;return t=r<0?r>-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",t)}},580:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=n(928);e.default={stringify:function(t){return t?Object.keys(t).map((function(e){var n=t[e];if((0,r.isPlainObject)(n))n=JSON.stringify(n);else{if("string"!=typeof n&&"number"!=typeof n)return"";n=+n}return encodeURIComponent(e)+"="+encodeURIComponent(n)})).filter((function(t){return t.length>0})).join("&"):""}}},690:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.startBlocking=e.resolveFirstBlock=void 0;var n=[];e.startBlocking=function(){var t,e=new Promise((function(e){t=e}));return n.push({promise:e,resolve:t}),e},e.resolveFirstBlock=function(){n.length&&(n[0].resolve(),n.shift())}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,"__esModule",{value:!0});var e=n(530),i={debug:console.debug,info:console.info,warn:console.warn,error:console.error,updateGetReportData:function(t){console.debug(t)}},a=null;t.default=function(t){if(!a){var n=t||{},r=n.clsConfig,o=(n.esConfig,r.endpoint),s=r.topicId;if(!o||!s)return console.debug("endpoint and topicId must not be null"),i;a=new e.default(t)}return a}})(),r})())()),hy=U,fy=Ln.EXISTS,dy=X,py=ts,vy=Function.prototype,gy=dy(vy.toString),yy=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,Iy=dy(yy.exec);hy&&!fy&&py(vy,"name",{configurable:!0,get:function(){try{return Iy(yy,gy(this))[1]}catch(t){return""}}});var my={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:20003,ERROR_BLACKLIST:20007},Ey="未连接到网络",_y="You do not have TUICallKit package, please open the free experience in the console: https://console.intl.cloud.tencent.com/im/detail or purchase the official package: ${purchaseAddress}",Ty="The package you purchased does not support this ability. You can refer to here to purchase: ${purchaseAddress}",Cy="TIM SDK version is too old. Please upgrade version",by="init is not complete, this API needs to be used after init. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",Dy="The API is support use in the state of. Please go to: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",Ry={NO_NETWORK:"未连接到网络",FAILURE_SWITCH_TO_AUDIO:"切换语音通话失败",FAILURE_SWITCH_TO_VIDEO:"切换视频通话失败",ERROR_NULL:"成功",ERROR_PACKAGE_NOT_PURCHASED:"您的应用还未开通音视频通话(TUICallKit)能力,您可以去控制台申请免费体验: https://console.cloud.tencent.com/im/detail 或购买通话能力套餐包: ${purchaseAddress}",ERROR_PACKAGE_NOT_SUPPORTED:"您暂不支持使用该能力,请前往如下购买页购买开通: ${purchaseAddress}",ERROR_TIM_VERSION_OUTDATED:"TIM SDK 版本太旧,请升级版本",ERROR_PERMISSION_DENIED:"摄像头/麦克风权限被拒绝。解决方案请前往: https://cloud.tencent.com/document/product/647/78770",ERROR_GET_DEVICE_LIST_FAIL:"获取设备列表失败",ERROR_INIT_FAIL:"TUICallEngine init 未完成,需要在 init 完成后使用此 API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887",ERROR_REQUEST_REFUSED:"当前通话状态无法使用该API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42",ERROR_REQUEST_REPEATED:"当前方法正在执行中,请勿重复调用",ERROR_REQUEST_REPEATED_SWITCH:"与当前通话类型一致,请勿重复切换",ERROR_SCENE_NOT_SUPPORTED:"当前通话场景不支持该功能",ERROR_SIGNALING_SEND_FAIL:"信令发送失败",ERROR_INVALID_INVITEID:"inviteID 无效或邀请已处理。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f",ERROR_INVALID_SEND_FAIL:"消息发送方或接收方 UserID 无效或不存在。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb",ERROR_PARAM_INVALID:"参数错误"},wy=function(t){d(n,I(Error));var e=_(n);function n(t){var r,i=t.message,a=t.code,o=void 0===a?my.UNKNOWN:a;return l(this,n),r=e.call(this,"".concat(i).concat(function(t){for(var e=0,n=Object.keys(Ry);e")),r.code=o,r.name="TUICallEngineError",r.message_=i,r}return h(n,[{key:"getCode",value:function(){return this.code}}]),n}(),Sy=["inviteID","type"],xy=function(){function t(e){l(this,t),this.TSignaling=e.TSignaling,this._logger=uy()}var e,n,r,o,s,u,f;return h(t,[{key:"handleNewSignaling",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return this._logger.info("TSignaling.handleNewSignaling.start",{text:{data:{data:t,params:e,userData:n}},type:"api"}),i(i({userData:n||""},t),{},{version:4,businessID:"av_call",platform:"MiniApp",data:i({cmd:Tg[t.call_type],room_id:t.room_id,message:""},e)})}},{key:"extractCallingInfoFromMessage",value:function(t){if(!t||"TIMCustomElem"!==t.type)return"";var e=JSON.parse(t.payload.data);if(e.businessID!==pg)return"";switch(e.actionType){case lg:var n=JSON.parse(e.data);return n.call_end>0&&!e.groupID?n.call_end:0!==n.call_end&&n.room_id?"发起通话":"结束群聊";case ug:return"取消通话";case hg:return"已接听";case fg:return"拒绝通话";case dg:return"无应答";default:return""}}},{key:"handleError",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.code,n=void 0===e?"":e,r=t.message;if(n)throw new wy({message:void 0===r?"":r,code:n})}},{key:"_handleInviteData",value:function(t){var e=t.type,n=t.roomID,r=t.userIDList,i=t.hangup,a=t.switchMode,o=t.userData;if(i)return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:i.callEnd},{cmd:"hangup"}));if(a){var s={version:0,call_type:e,room_id:n},c={cmd:"switchToVideo"};return a===Cg&&(s.switch_to_audio_call="switch_to_audio_call",c.cmd="switchToAudio"),JSON.stringify(this.handleNewSignaling(s,c))}return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n},{userIDs:r},o))}},{key:"_handleInviteGroupData",value:function(t){var e=t.type,n=t.roomID,r=t.hangup,i=t.userData;return r?JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:r.call_end},{cmd:"hangup"},i)):JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n}))}},{key:"invite",value:(f=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.invite.start",{text:{data:{params:e}},type:"api"}),n=e.userID,r=e.offlinePushInfo,i=e.hangup,o=e.switchMode,t.prev=2,t.next=5,this.TSignaling.invite({userID:n,data:this._handleInviteData(e),timeout:i?0:30,offlinePushInfo:r});case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.invite.fail",{text:{data:{hangup:i,switchMode:o},error:t.t0},type:"api"}),!i){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,"hangup C2C"));case 13:if(!o){t.next=15;break}return t.abrupt("return",this.handleError(t.t0,o));case 15:return t.abrupt("return",this.handleError(t.t0,"invite"));case 16:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return f.apply(this,arguments)})},{key:"inviteGroup",value:(u=c(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.inviteGroup.start",{text:{data:{params:e}},type:"api"}),n=e.groupID,r=e.userIDList,i=e.offlinePushInfo,o=e.hangup,s=e.inCallUserIDs,c=void 0===s?[]:s,t.prev=2,t.next=5,this.TSignaling.inviteInGroup({groupID:n,inviteeList:r,timeout:o?0:30,data:this._handleInviteGroupData(e),offlinePushInfo:i,inCallUserIDs:c});case 5:return t.abrupt("return",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.inviteGroup.fail",{text:{data:{hangup:o},error:t.t0},type:"api"}),!o){t.next=13;break}return t.abrupt("return",this.handleError(t.t0,"hangup group"));case 13:return t.abrupt("return",this.handleError(t.t0,"inviteGroup"));case 14:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t){return u.apply(this,arguments)})},{key:"accept",value:(s=c(a().mark((function t(e,n){var r,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.accept.start",{text:{data:{params:e,supportParams:n}},type:"api"}),r=e.inviteID,o=e.type,s=m(e,Sy),t.prev=2,t.next=5,this.TSignaling.accept({inviteID:r,data:JSON.stringify(this.handleNewSignaling(i({version:0,call_type:o},s),n))});case 5:return t.abrupt("return",t.sent);case 8:return t.prev=8,t.t0=t.catch(2),this._logger.error("TSignaling.accept.fail",{text:{error:t.t0},type:"api"}),t.abrupt("return",this.handleError(t.t0,"accept"));case 12:case"end":return t.stop()}}),t,this,[[2,8]])}))),function(t,e){return s.apply(this,arguments)})},{key:"reject",value:(o=c(a().mark((function t(e){var n,r,i,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.reject.start",{text:{data:{params:e}},type:"api"}),n=e.inviteID,r=e.type,i=e.lineBusy,o={version:0,call_type:r},s=null,i?(o.line_busy=i,s=JSON.stringify(this.handleNewSignaling(o,{message:"lineBusy"}))):s=JSON.stringify(this.handleNewSignaling(o)),t.prev=5,t.next=8,this.TSignaling.reject({inviteID:n,data:s});case 8:return t.abrupt("return",t.sent);case 11:if(t.prev=11,t.t0=t.catch(5),this._logger.error("TSignaling.reject.fail",{text:{error:t.t0},type:"api"}),!i){t.next=16;break}return t.abrupt("return",this.handleError(t.t0,"line_busy"));case 16:return t.abrupt("return",this.handleError(t.t0,"reject"));case 17:case"end":return t.stop()}}),t,this,[[5,11]])}))),function(t){return o.apply(this,arguments)})},{key:"cancel",value:(r=c(a().mark((function t(e){var n,r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.cancel.start",{text:{data:{params:e}},type:"api"}),n=e.inviteID,r=e.callType,t.prev=2,t.next=5,this.TSignaling.cancel({inviteID:n,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:r}))});case 5:return i=t.sent,t.abrupt("return",i);case 9:return t.prev=9,t.t0=t.catch(2),this._logger.error("TSignaling.cancel.fail",{text:{error:t.t0},type:"api"}),t.abrupt("return",this.handleError(t.t0,"cancel"));case 13:case"end":return t.stop()}}),t,this,[[2,9]])}))),function(t){return r.apply(this,arguments)})},{key:"hangup",value:(n=c(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.hangup.start",{text:{data:{params:e}},type:"api"}),n=e.userIDList,r=e.callType,i=e.callEnd,o=void 0===i?0:i,s=e.isGroupCall,c=void 0!==s&&s,l=e.groupID,u=void 0===l?"":l,h={version:0,call_type:r,call_end:o},f={cmd:"hangup"},d=JSON.stringify(this.handleNewSignaling(h,f)),!c||!u){t.next=10;break}return t.next=8,this.TSignaling.inviteInGroup({inviteeList:n,groupID:u,data:d,timeout:0});case 8:t.next=12;break;case 10:return t.next=12,this.TSignaling.invite({userID:n[0],data:d,timeout:0});case 12:case"end":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:"switchCallMode",value:(e=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("TSignaling.switchCallMode.start",{text:{data:{params:e}},type:"api"}),n=e.userID,r=e.callType,i=e.roomID,o=e.mode,t.abrupt("return",this.invite({userID:n,type:r,roomID:i,switchMode:o}));case 3:case"end":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:"destroyed",value:function(){this._logger.info("TSignaling.destroyed.start",{type:"api"}),this.TSignaling=null}},{key:"setLogLevel",value:function(t){this.TSignaling.setLogLevel(t)}}]),t}(),Ly=function(){function t(e){l(this,t),this._emitter=e.emitter,this._logger=uy()}return h(t,[{key:"onError",value:function(t){this._logger.error("TUICallEvent.onError",{text:{error:t},type:"event"}),this._emitter.emit(sg.ERROR,t)}},{key:"onCallBegin",value:function(t){this._logger.info("TUICallEvent.onCallBegin",{text:{data:t},type:"event"}),this._emitter.emit(sg.ON_CALL_BEGIN,t)}},{key:"onCallEnd",value:function(t){this._logger.info("TUICallEvent.onCallEnd",{text:{data:t},type:"event"});var e=t.userID,n=t.callEnd,r=t.message,i=t.roomID,a=t.callMediaType,o=t.callRole,s=t.totalTime;this._emitter.emit(sg.CALL_END,{userID:e,callEnd:n,message:r,roomID:i,callMediaType:a,callRole:o,totalTime:s})}},{key:"onInvited",value:function(t){this._logger.info("TUICallEvent.onInvited",{text:{data:t},type:"event"}),this._emitter.emit(sg.INVITED,t),this._emitter.emit(sg.ON_CALL_RECEIVED,t)}},{key:"onLineBusy",value:function(t){this._logger.info("TUICallEvent.onLineBusy",{text:{data:t},type:"event"});var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(sg.LINE_BUSY,{inviteID:e,invitee:n,userID:r,reason:"line busy"})}},{key:"onReject",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(sg.REJECT,{inviteID:e,invitee:n,userID:r,reason:"reject"})}},{key:"onNoResp",value:function(t){this._logger.info("TUICallEvent.onNoResp",{text:{data:t},type:"event"});var e=t.groupID,n=void 0===e?"":e,r=t.inviteID,i=t.sponsor,a=t.timeoutUserList,o=t.userIDList;this._emitter.emit(sg.NO_RESP,{groupID:n,inviteID:r,sponsor:i,timeoutUserList:a,userIDList:o})}},{key:"onCancel",value:function(t){this._emitter.emit(sg.CALLING_CANCEL,t),this._emitter.emit(sg.ON_CALL_CANCELED,t)}},{key:"onTimeout",value:function(t){this._logger.info("TUICallEvent.onTimeout",{text:{data:t},type:"event"});var e=t.inviteID,n=t.groupID,r=t.sponsor,i=t.timeoutUserList;this._emitter.emit(sg.CALLING_TIMEOUT,{groupID:n,inviteID:e,sponsor:r,timeoutUserList:i})}},{key:"onUserAccept",value:function(t){this._logger.info("TUICallEvent.onUserAccept",{text:{data:t},type:"event"});var e=t.userID,n=t.userList;this._emitter.emit(sg.USER_ACCEPT,{userID:e,userList:n})}},{key:"onUserEnter",value:function(t){this._logger.info("TUICallEvent.onUserEnter",{text:{data:t},type:"event"});var e=t.userID,n=t.playerList;this._emitter.emit(sg.USER_ENTER,{userID:e,playerList:n})}},{key:"onUserLeave",value:function(t){this._logger.info("TUICallEvent.onUserLeave",{text:{data:t},type:"event"});var e=t.userID,n=t.playerList;this._emitter.emit(sg.USER_LEAVE,{userID:e,playerList:n})}},{key:"onUserUpdate",value:function(t){var e=t.pusher,n=t.playerList;this._emitter.emit(sg.USER_UPDATE,{pusher:e,playerList:n})}},{key:"onSdkReady",value:function(t){this._logger.info("TUICallEvent.onSdkReady",{text:{data:t},type:"event"}),this._emitter.emit(sg.SDK_READY,t)}},{key:"onKickedOut",value:function(t){this._logger.info("TUICallEvent.onKickedOut",{text:{data:t},type:"event"}),this._emitter.emit(sg.KICKED_OUT,t)}},{key:"onCallMode",value:function(t){this._logger.info("TUICallEvent.onCallMode",{text:{data:t},type:"event"}),this._emitter.emit(sg.CALL_MODE,t)}},{key:"onMessageSentByMe",value:function(t){this._logger.info("TUICallEvent.onMessageSentByMe",{text:{data:t},type:"event"}),this._emitter.emit(sg.MESSAGE_SENT_BY_ME,t)}},{key:"destroyed",value:function(){this._logger.info("TUICallEvent.destroyed",{type:"api"}),this._emitter=null}}]),t}(),Oy="1.5.8";Tv("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Vv);var ky=ln,Ay=function(){var t=ky(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e},Ny=V,Uy=ve,Py=bt,My=Ay,jy=RegExp.prototype,Vy=Ln.PROPER,Gy=wr,Hy=ln,By=bh,Fy=N,Ky=function(t){var e=t.flags;return void 0!==e||"flags"in jy||Uy(t,"flags")||!Py(jy,t)?e:Ny(My,t)},zy="toString",Jy=RegExp.prototype[zy],Wy=Fy((function(){return"/a/b"!==Jy.call({source:"a",flags:"b"})})),$y=Vy&&Jy.name!==zy;(Wy||$y)&&Gy(RegExp.prototype,zy,(function(){var t=Hy(this);return"/"+By(t.source)+"/"+By(Ky(t))}),{unsafe:!0});var qy,Yy,Xy=Gp;xi({target:"Object",stat:!0,forced:Object.isExtensible!==Xy},{isExtensible:Xy}),qy="undefined"!=typeof console?console:"undefined"!=typeof global&&global.console?global.console:"undefined"!=typeof window&&window.console?window.console:{};for(var Qy=function(){},Zy=["assert","clear","count","debug","dir","dirxml","error","group","groupCollapsed","groupEnd","info","log","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],tI=Zy.length-1;tI;)Yy=Zy[tI],console[Yy]||(qy[Yy]=Qy),tI-=1;Object.isExtensible(qy)&&(qy.methods=Zy);var eI,nI,rI=qy,iI=N,aI=k.RegExp,oI=iI((function(){var t=aI("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),sI=oI||iI((function(){return!aI("a","y").sticky})),cI={BROKEN_CARET:oI||iI((function(){var t=aI("^r","gy");return t.lastIndex=2,null!==t.exec("str")})),MISSED_STICKY:sI,UNSUPPORTED_Y:oI},lI=N,uI=k.RegExp,hI=lI((function(){var t=uI(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)})),fI=N,dI=k.RegExp,pI=fI((function(){var t=dI("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")})),vI=V,gI=X,yI=bh,II=Ay,mI=cI,EI=ne.exports,_I=af,TI=ar.get,CI=hI,bI=pI,DI=EI("native-string-replace",String.prototype.replace),RI=RegExp.prototype.exec,wI=RI,SI=gI("".charAt),xI=gI("".indexOf),LI=gI("".replace),OI=gI("".slice),kI=(nI=/b*/g,vI(RI,eI=/a/,"a"),vI(RI,nI,"a"),0!==eI.lastIndex||0!==nI.lastIndex),AI=mI.BROKEN_CARET,NI=void 0!==/()??/.exec("")[1];(kI||NI||AI||CI||bI)&&(wI=function(t){var e,n,r,i,a,o,s,c=this,l=TI(c),u=yI(t),h=l.raw;if(h)return h.lastIndex=c.lastIndex,e=vI(wI,h,u),c.lastIndex=h.lastIndex,e;var f=l.groups,d=AI&&c.sticky,p=vI(II,c),v=c.source,g=0,y=u;if(d&&(p=LI(p,"y",""),-1===xI(p,"g")&&(p+="g"),y=OI(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==SI(u,c.lastIndex-1))&&(v="(?: "+v+")",y=" "+y,g++),n=new RegExp("^(?:"+v+")",p)),NI&&(n=new RegExp("^"+v+"$(?!\\s)",p)),kI&&(r=c.lastIndex),i=vI(RI,d?n:c,y),d?i?(i.input=OI(i.input,g),i[0]=OI(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:kI&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),NI&&i&&i.length>1&&vI(DI,i[0],n,(function(){for(a=1;a2)if(l=wm(l),43===(e=Am(l,0))||45===e){if(88===(n=Am(l,2))||120===n)return NaN}else if(48===e){switch(Am(l,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+l}for(o=(a=km(l,2)).length,s=0;si)return NaN;return parseInt(a,r)}return+l},Um=gm(Sm,!xm(" 0o1")||!xm("0b1")||xm("+0x1")),Pm=function(t){var e,n=arguments.length<1?0:xm(function(t){var e=_m(t,"number");return"bigint"==typeof e?e:Nm(e)}(t));return mm(Lm,e=this)&&Tm((function(){Rm(e)}))?Im(Object(n),this,Pm):n};Pm.prototype=Lm,Um&&(Lm.constructor=Pm),hm({global:!0,constructor:!0,wrap:!0,forced:Um},{Number:Pm});Um&&function(t,e){for(var n,r=fm?Cm(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),i=0;r.length>i;i++)ym(e,n=r[i])&&!ym(t,n)&&Dm(t,n,bm(e,n))}(pm[Sm],xm);var Mm=kr,jm=bh,Vm=ut,Gm=RangeError,Hm=function(t){var e=jm(Vm(this)),n="",r=Mm(t);if(r<0||r===1/0)throw new Gm("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},Bm=X,Fm=Vr,Km=bh,zm=ut,Jm=Bm(Hm),Wm=Bm("".slice),$m=Math.ceil,qm=function(t){return function(e,n,r){var i,a,o=Km(zm(e)),s=Fm(n),c=o.length,l=void 0===r?" ":Km(r);return s<=c||""===l?o:((a=Jm(l,$m((i=s-c)/l.length))).length>i&&(a=Wm(a,0,i)),t?o+a:a+o)}},Ym=X,Xm=N,Qm={start:qm(!1),end:qm(!0)}.start,Zm=RangeError,tE=isFinite,eE=Math.abs,nE=Date.prototype,rE=nE.toISOString,iE=Ym(nE.getTime),aE=Ym(nE.getUTCDate),oE=Ym(nE.getUTCFullYear),sE=Ym(nE.getUTCHours),cE=Ym(nE.getUTCMilliseconds),lE=Ym(nE.getUTCMinutes),uE=Ym(nE.getUTCMonth),hE=Ym(nE.getUTCSeconds),fE=Xm((function(){return"0385-07-25T07:06:39.999Z"!==rE.call(new Date(-50000000000001))}))||!Xm((function(){rE.call(new Date(NaN))}))?function(){if(!tE(iE(this)))throw new Zm("Invalid time value");var t=this,e=oE(t),n=cE(t),r=e<0?"-":e>9999?"+":"";return r+Qm(eE(e),r?6:4,0)+"-"+Qm(uE(t)+1,2,0)+"-"+Qm(aE(t),2,0)+"T"+Qm(sE(t),2,0)+":"+Qm(lE(t),2,0)+":"+Qm(hE(t),2,0)+"."+Qm(n,3,0)+"Z"}:rE;xi({target:"Date",proto:!0,forced:Date.prototype.toISOString!==fE},{toISOString:fE});var dE=X,pE=fe,vE=Math.floor,gE=dE("".charAt),yE=dE("".replace),IE=dE("".slice),mE=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,EE=/\$([$&'`]|\d{1,2})/g,_E=Es,TE=V,CE=X,bE=KI,DE=N,RE=ln,wE=yt,SE=st,xE=kr,LE=Vr,OE=bh,kE=ut,AE=JI,NE=Xt,UE=function(t,e,n,r,i,a){var o=n+t.length,s=r.length,c=EE;return void 0!==i&&(i=pE(i),c=mE),yE(a,c,(function(a,c){var l;switch(gE(c,0)){case"$":return"$";case"&":return t;case"`":return IE(e,0,n);case"'":return IE(e,o);case"<":l=i[IE(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>s){var h=vE(u/10);return 0===h?a:h<=s?void 0===r[h-1]?gE(c,1):r[h-1]+gE(c,1):a}l=r[u-1]}return void 0===l?"":l}))},PE=ZI,ME=Le("replace"),jE=Math.max,VE=Math.min,GE=CE([].concat),HE=CE([].push),BE=CE("".indexOf),FE=CE("".slice),KE="$0"==="a".replace(/./,"$0"),zE=!!/./[ME]&&""===/./[ME]("a","$0");bE("replace",(function(t,e,n){var r=zE?"$":"$0";return[function(t,n){var r=kE(this),i=SE(t)?void 0:NE(t,ME);return i?TE(i,t,r,n):TE(e,OE(r),t,n)},function(t,i){var a=RE(this),o=OE(t);if("string"==typeof i&&-1===BE(i,r)&&-1===BE(i,"$<")){var s=n(e,a,o,i);if(s.done)return s.value}var c=wE(i);c||(i=OE(i));var l,u=a.global;u&&(l=a.unicode,a.lastIndex=0);for(var h,f=[];null!==(h=PE(a,o))&&(HE(f,h),u);){""===OE(h[0])&&(a.lastIndex=AE(o,LE(a.lastIndex),l))}for(var d,p="",v=0,g=0;g=v&&(p+=FE(o,v,m)+y,v=m+I.length)}return p+FE(o,v)}]}),!!DE((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}))||!KE||zE);var JE,WE=Et,$E=et,qE=Le("match"),YE=function(t){var e;return WE(t)&&(void 0!==(e=t[qE])?!!e:"RegExp"===$E(t))},XE=TypeError,QE=function(t){if(YE(t))throw new XE("The method doesn't accept regular expressions");return t},ZE=Le("match"),t_=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[ZE]=!1,"/./"[t](e)}catch(t){}}return!1},e_=xi,n_=Ja,r_=A.f,i_=Vr,a_=bh,o_=QE,s_=ut,c_=t_,l_=n_("".startsWith),u_=n_("".slice),h_=Math.min,f_=c_("startsWith");function d_(t,e){t=t.split("."),e=e.split(".");for(var n=Math.max(t.length,e.length);t.lengtha)return 1;if(i1?arguments[1]:void 0,e.length)),r=a_(t);return l_?l_(e,r,n):u_(e,n,n+r.length)===r}});var p_="TRTC-ROOM",v_=wx||qq;v_||console.error(p_,"不支持当前小程序环境");var g_,y_=v_.getSystemInfoSync(),I_=y_.safeArea;("iOS 13.3"===y_.system||"iPhoneX"===y_.model&&"iOS 13.3.1"===y_.system)&&console.log("use media audio volume type"),console.log(p_,"SystemInfo",y_),"undefined"!=typeof qq?g_=!0:"undefined"!=typeof wx&&(g_=d_(y_.version,"7.0.8")>=0||d_(y_.version,"2.4.0")>=0&&d_(y_.version,"6.0.0")<0&&d_(y_.SDKVersion,"2.10.0")>=0);var m_=g_,E_="undefined"!=typeof uni,__=/iOS/i.test(y_.system),T_=/Android/i.test(y_.system);/mac/i.test(y_.system);var C_=y_.version,b_=y_.SDKBuild?"".concat(y_.SDKVersion,"-").concat(y_.SDKBuild):y_.SDKVersion;y_.screenHeight,I_.bottom,console.log(p_,"APP_VERSION:",C_," LIB_VERSION:",b_," is new version:",m_);var D_=function(t){return"function"==typeof Array.isArray?Array.isArray(t):"array"===function(t){return Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase()}(t)},R_=function(t){return null!==t&&("number"==typeof t&&!isNaN(t-0)||"object"===o(t)&&t.constructor===Number)},w_=function(t){return"string"==typeof t},S_=function(t){return null!==t&&"object"===o(t)},x_=function(t){return void 0===t},L_=0;Date.now||(Date.now=function(){return(new Date).getTime()});var O_=function(){0===L_&&(L_=Date.now()-1);var t=Date.now()-L_;return t>4294967295?(L_+=4294967295,Date.now()-L_):t},k_=function(t){return t instanceof Error},A_=function(t){return JSON.stringify(t,["message","code"])};function N_(){var t="unknown";return __&&(t="ios"),T_&&(t="android"),t}function U_(t){return P_.apply(this,arguments)}function P_(){return(P_=c(a().mark((function t(e){var n,r,i,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt("return",!1);case 2:return n=e.microphone,r=void 0!==n&&n,i=e.camera,o=void 0!==i&&i,t.prev=3,t.next=6,wx.getSetting();case 6:if(s=t.sent,c=s.authSetting[Og.RECORD],l=s.authSetting[Og.CAMERA],!r||!o){t.next=11;break}return t.abrupt("return",c&&l);case 11:if(!r){t.next=13;break}return t.abrupt("return",c);case 13:if(!o){t.next=15;break}return t.abrupt("return",l);case 15:return t.abrupt("return",!1);case 18:return t.prev=18,t.t0=t.catch(3),t.abrupt("return",!1);case 21:case"end":return t.stop()}}),t,null,[[3,18]])})))).apply(this,arguments)}function M_(t){return t===Sg.AV_CALL}function j_(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function V_(t){var e=String(t);return e.startsWith("14")||e.startsWith("16")||e.startsWith("17")}function G_(t){var e=V_(t)?kg:Ag;return"".concat(e,"&position=").concat(t,"®ionId=").concat(function(t){return t>=2e7&&t<3e7||t>=172e7&&t<173e7?Ug:t>=3e7&&t<4e7||t>=173e7&&t<174e7?Mg:t>=4e7&&t<5e7||t>=174e7&&t<175e7?Pg:t>=5e7&&t<6e7||t>=175e7&&t<176e7?jg:t>=7e7&&t<8e7||t>=177e7&&t<178e7?Vg:Ng}(t))}var H_=0,B_=new Map;function F_(){var t=new Date;return"TUICallEngine ".concat(t.toLocaleTimeString("en-US",{hour12:!1}),".").concat(function(t){var e;switch(t.toString().length){case 1:e="00".concat(t);break;case 2:e="0".concat(t);break;default:e=t}return e}(t.getMilliseconds()),":")}var K_={_data:[],_length:0,_visible:!1,arguments2String:function(t){var e,n;if(1===t.length)e=F_()+t[0];else{e=F_();for(var r=0,i=t.length;r-10?"+0".concat(Math.abs(100*r)):"+".concat(Math.abs(100*r)):r>=10?"-".concat(100*r):"-0".concat(100*r),n.replace("Z",i)),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}},{key:"setEnd",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.endts=Date.now(),e?this._eventStatController.pushIn(this):setTimeout((function(){t._eventStatController.pushIn(t)}),0)}},{key:"setError",value:function(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(my.NO_NETWORK),this.setMessage(Ey)),this}},{key:"setCode",value:function(t){return"ECONNABORTED"===t&&(this.codeint=103),R_(t)?this.codeint=t:K_.warn("SSOLogData.setCode value not a number, please check!",t,o(t)),this}},{key:"setMessage",value:function(t){return w_(t)?(this.message=t,this):this}},{key:"setText",value:function(t){return R_(t)?this.text=t.toString():w_(t)&&(this.text=t),this}},{key:"setTalkTime",value:function(t){return this.talktime=t,this}},{key:"setMessageType",value:function(t){return this.msgType=t,this}},{key:"setCallType",value:function(t){return this.calltype=t,this}},{key:"setNetworkType",value:function(t){return x_(t)?K_.warn("SSOLogData.setNetworkType value is undefined, please check!"):this.networktype=t,this}}],[{key:"bindController",value:function(e){t.prototype._eventStatController=e}}]),t}(),J_="sdkConstruct",W_="quality_report",$_=function(){function t(){l(this,t),this._table="timweb-trtccalling",this._report=[]}return h(t,[{key:"pushIn",value:function(t){K_.debug("SSOLogBody.pushIn",this._report.length,t),this._report.push(t)}},{key:"backfill",value:function(t){var e;D_(t)&&0!==t.length&&(K_.debug("SSOLogBody.backfill",this._report.length,t.length),(e=this._report).unshift.apply(e,T(t)))}},{key:"getLogsNumInMemory",value:function(){return this._report.length}},{key:"isEmpty",value:function(){return 0===this._report.length}},{key:"_reset",value:function(){this._report.length=0,this._report=[]}},{key:"getTable",value:function(){return this._table}},{key:"getLogsInMemory",value:function(){var t=this._report.slice();return this._reset(),t}}]),t}(),q_={CURRENT:{COMMON:"https://webim.tim.qq.com"},PRODUCTION:{COMMON:"https://webim.tim.qq.com"}},Y_={IM_OPEN_STAT:"imopenstat"},X_={TIM_WEB_TRTCCALLING_REPORT:"tweb_trtccalling_report"},Q_={imopenstat:"v4"},Z_=function(){function t(){l(this,t),this.TAG="trtccalling-ssolog-event",this._reportBody=new $_,this._version=Oy,this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}return h(t,[{key:"reportAtOnce",value:function(){K_.debug("EventStatController.reportAtOnce"),this._report()}},{key:"pushIn",value:function(t){t instanceof z_&&(t.setCommonInfo({SDKAppID:Number(wx.getStorageSync("sdkAppId")),version:this._version,userID:wx.getStorageSync("userId")}),this._reportBody.pushIn(t),this._report())}},{key:"_resetLastReportTime",value:function(){this._lastReportTime=Date.now()}},{key:"_startReportTimer",value:function(){var t=this;this._timerID=setInterval((function(){Date.now()0&&(clearInterval(this._timerID),this._timerID=0)}},{key:"_report",value:function(){var t=this;if(!this._reportBody.isEmpty()){var e=Math.ceil(+new Date/1e3),n=wx.getStorageSync("sdkAppId"),r=this._reportBody.getLogsInMemory(),i={table:this._reportBody.getTable(),report:r},a=q_.CURRENT.COMMON,o=Q_.imopenstat,s=Y_.IM_OPEN_STAT,c=X_.TIM_WEB_TRTCCALLING_REPORT,l="".concat(a,"/").concat(o,"/").concat(s,"/").concat(c,"/?sdkappid=").concat(n,"&reqtime=").concat(e);wx.request({url:l,method:"POST",data:JSON.stringify(i),header:{"content-type":"application/json"},success:function(e){t._retryCount>0&&(K_.debug("EventStatController.report retry success"),t._retryCount=0)},fail:function(e){K_.warn("EventStatController.report, error:".concat(A_(e))),t._reportBody.backfill(r),t._reportBody.getLogsNumInMemory()>t.MAX_THRESHOLD||t._retryCount===t.MAX_RETRY_COUNT||0===t._timerID?t._retryCount=0:t._retryCount+=1}})}}},{key:"reset",value:function(){K_.log("EventStatController.reset"),this._stopReportTimer(),this._report()}}]),t}(),tT=Jr.includes,eT=ud;xi({target:"Array",proto:!0,forced:N((function(){return!Array(1).includes()}))},{includes:function(t){return tT(this,t,arguments.length>1?arguments[1]:void 0)}}),eT("includes");var nT=xi,rT=QE,iT=ut,aT=bh,oT=t_,sT=X("".indexOf);nT({target:"String",proto:!0,forced:!oT("includes")},{includes:function(t){return!!~sT(aT(iT(this)),aT(rT(t)),arguments.length>1?arguments[1]:void 0)}});var cT=X,lT=bv,uT=Tp.exports.getWeakData,hT=cs,fT=ln,dT=st,pT=Et,vT=Du,gT=ve,yT=ar.set,IT=ar.getterFor,mT=ho.find,ET=ho.findIndex,_T=cT([].splice),TT=0,CT=function(t){return t.frozen||(t.frozen=new bT)},bT=function(){this.entries=[]},DT=function(t,e){return mT(t.entries,(function(t){return t[0]===e}))};bT.prototype={get:function(t){var e=DT(this,t);if(e)return e[1]},has:function(t){return!!DT(this,t)},set:function(t,e){var n=DT(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=ET(this.entries,(function(e){return e[0]===t}));return~e&&_T(this.entries,e,1),!!~e}};var RT,wT={getConstructor:function(t,e,n,r){var i=t((function(t,i){hT(t,a),yT(t,{type:e,id:TT++,frozen:void 0}),dT(i)||vT(i,t[r],{that:t,AS_ENTRIES:n})})),a=i.prototype,o=IT(e),s=function(t,e,n){var r=o(t),i=uT(fT(e),!0);return!0===i?CT(r).set(e,n):i[r.id]=n,t};return lT(a,{delete:function(t){var e=o(this);if(!pT(t))return!1;var n=uT(t);return!0===n?CT(e).delete(t):n&&gT(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!pT(t))return!1;var n=uT(t);return!0===n?CT(e).has(t):n&&gT(n,e.id)}}),lT(a,n?{get:function(t){var e=o(this);if(pT(t)){var n=uT(t);return!0===n?CT(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return s(this,t,e)}}:{add:function(t){return s(this,t,!0)}}),i}},ST=Hp,xT=k,LT=X,OT=bv,kT=Tp.exports,AT=Tv,NT=wT,UT=Et,PT=ar.enforce,MT=N,jT=Gn,VT=Object,GT=Array.isArray,HT=VT.isExtensible,BT=VT.isFrozen,FT=VT.isSealed,KT=VT.freeze,zT=VT.seal,JT={},WT={},$T=!xT.ActiveXObject&&"ActiveXObject"in xT,qT=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},YT=AT("WeakMap",qT,NT),XT=YT.prototype,QT=LT(XT.set);if(jT)if($T){RT=NT.getConstructor(qT,"WeakMap",!0),kT.enable();var ZT=LT(XT.delete),tC=LT(XT.has),eC=LT(XT.get);OT(XT,{delete:function(t){if(UT(t)&&!HT(t)){var e=PT(this);return e.frozen||(e.frozen=new RT),ZT(this,t)||e.frozen.delete(t)}return ZT(this,t)},has:function(t){if(UT(t)&&!HT(t)){var e=PT(this);return e.frozen||(e.frozen=new RT),tC(this,t)||e.frozen.has(t)}return tC(this,t)},get:function(t){if(UT(t)&&!HT(t)){var e=PT(this);return e.frozen||(e.frozen=new RT),tC(this,t)?eC(this,t):e.frozen.get(t)}return eC(this,t)},set:function(t,e){if(UT(t)&&!HT(t)){var n=PT(this);n.frozen||(n.frozen=new RT),tC(this,t)?QT(this,t,e):n.frozen.set(t,e)}else QT(this,t,e);return this}})}else ST&&MT((function(){var t=KT([]);return QT(new YT,t,1),!BT(t)}))&&OT(XT,{set:function(t,e){var n;return GT(t)&&(BT(t)?n=JT:FT(t)&&(n=WT)),QT(this,t,e),n===JT&&KT(t),n===WT&&zT(t),this}});var nC={exports:{}}; +/*! + * validate.js 0.13.1 + * + * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp + * Validate.js may be freely distributed under the MIT license. + * For all details and documentation: + * http://validatejs.org/ + */(function(t,e,n){var r=function(t,e,n){n=i.extend({},i.options,n);var a=i.runValidations(t,e,n);if(a.some((function(t){return i.isPromise(t.error)})))throw new Error("Use validate.async if you want support for promises");return r.processValidationResults(a,n)},i=r;i.extend=function(t){return[].slice.call(arguments,1).forEach((function(e){for(var n in e)t[n]=e[n]})),t},i.extend(r,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var t=i.format("%{major}.%{minor}.%{patch}",i.version);return i.isEmpty(i.version.metadata)||(t+="+"+i.version.metadata),t}},Promise:"undefined"!=typeof Promise?Promise:null,EMPTY_STRING_REGEXP:/^\s*$/,runValidations:function(t,e,n){var r,a,o,s,c,l,u,h=[];for(r in(i.isDomElement(t)||i.isJqueryElement(t))&&(t=i.collectFormValues(t)),e)for(a in o=i.getDeepObjectValue(t,r),s=i.result(e[r],o,t,r,n,e)){if(!(c=i.validators[a]))throw u=i.format("Unknown validator %{name}",{name:a}),new Error(u);l=s[a],(l=i.result(l,o,t,r,n,e))&&h.push({attribute:r,value:o,validator:a,globalOptions:n,attributes:t,options:l,error:c.call(c,o,l,r,t,n)})}return h},processValidationResults:function(t,e){t=i.pruneEmptyErrors(t,e),t=i.expandMultipleErrors(t,e),t=i.convertErrorMessages(t,e);var n=e.format||"grouped";if("function"!=typeof i.formatters[n])throw new Error(i.format("Unknown format %{format}",e));return t=i.formatters[n](t),i.isEmpty(t)?void 0:t},async:function(t,e,n){var r=(n=i.extend({},i.async.options,n)).wrapErrors||function(t){return t};!1!==n.cleanAttributes&&(t=i.cleanAttributes(t,e));var a=i.runValidations(t,e,n);return new i.Promise((function(o,s){i.waitForResults(a).then((function(){var c=i.processValidationResults(a,n);c?s(new r(c,n,t,e)):o(t)}),(function(t){s(t)}))}))},single:function(t,e,n){return n=i.extend({},i.single.options,n,{format:"flat",fullMessages:!1}),i({single:t},{single:e},n)},waitForResults:function(t){return t.reduce((function(t,e){return i.isPromise(e.error)?t.then((function(){return e.error.then((function(t){e.error=t||null}))})):t}),new i.Promise((function(t){t()})))},result:function(t){var e=[].slice.call(arguments,1);return"function"==typeof t&&(t=t.apply(null,e)),t},isNumber:function(t){return"number"==typeof t&&!isNaN(t)},isFunction:function(t){return"function"==typeof t},isInteger:function(t){return i.isNumber(t)&&t%1==0},isBoolean:function(t){return"boolean"==typeof t},isObject:function(t){return t===Object(t)},isDate:function(t){return t instanceof Date},isDefined:function(t){return null!=t},isPromise:function(t){return!!t&&i.isFunction(t.then)},isJqueryElement:function(t){return t&&i.isString(t.jquery)},isDomElement:function(t){return!!t&&!(!t.querySelectorAll||!t.querySelector)&&(!(!i.isObject(document)||t!==document)||("object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName))},isEmpty:function(t){var e;if(!i.isDefined(t))return!0;if(i.isFunction(t))return!1;if(i.isString(t))return i.EMPTY_STRING_REGEXP.test(t);if(i.isArray(t))return 0===t.length;if(i.isDate(t))return!1;if(i.isObject(t)){for(e in t)return!1;return!0}return!1},format:i.extend((function(t,e){return i.isString(t)?t.replace(i.format.FORMAT_REGEXP,(function(t,n,r){return"%"===n?"%{"+r+"}":String(e[r])})):t}),{FORMAT_REGEXP:/(%?)%\{([^\}]+)\}/g}),prettify:function(t){return i.isNumber(t)?100*t%1==0?""+t:parseFloat(Math.round(100*t)/100).toFixed(2):i.isArray(t)?t.map((function(t){return i.prettify(t)})).join(", "):i.isObject(t)?i.isDefined(t.toString)?t.toString():JSON.stringify(t):(t=""+t).replace(/([^\s])\.([^\s])/g,"$1 $2").replace(/\\+/g,"").replace(/[_-]/g," ").replace(/([a-z])([A-Z])/g,(function(t,e,n){return e+" "+n.toLowerCase()})).toLowerCase()},stringifyValue:function(t,e){return(e&&e.prettify||i.prettify)(t)},isString:function(t){return"string"==typeof t},isArray:function(t){return"[object Array]"==={}.toString.call(t)},isHash:function(t){return i.isObject(t)&&!i.isArray(t)&&!i.isFunction(t)},contains:function(t,e){return!!i.isDefined(t)&&(i.isArray(t)?-1!==t.indexOf(e):e in t)},unique:function(t){return i.isArray(t)?t.filter((function(t,e,n){return n.indexOf(t)==e})):t},forEachKeyInKeypath:function(t,e,n){if(i.isString(e)){var r,a="",o=!1;for(r=0;ro&&(r=e.tooLong||this.tooLong||"is too long (maximum is %{count} characters)",c.push(i.format(r,{count:o}))),c.length>0?e.message||c:void 0):e.message||this.notValid||"has an incorrect length"}},numericality:function(t,e,n,r,a){if(i.isDefined(t)){var o,s,c=[],l={greaterThan:function(t,e){return t>e},greaterThanOrEqualTo:function(t,e){return t>=e},equalTo:function(t,e){return t===e},lessThan:function(t,e){return to&&(n=e.tooLate||e.message||this.tooLate||"must be no later than %{date}",n=i.format(n,{date:this.format(o,e),value:this.format(t,e)}),r.push(n)),r.length?i.unique(r):void 0)}}),{parse:null,format:null}),date:function(t,e){return e=i.extend({},e,{dateOnly:!0}),i.validators.datetime.call(i.validators.datetime,t,e)},format:function(t,e){(i.isString(e)||e instanceof RegExp)&&(e={pattern:e});var n,r=(e=i.extend({},this.options,e)).message||this.message||"is invalid",a=e.pattern;if(i.isDefined(t))return i.isString(t)?(i.isString(a)&&(a=new RegExp(e.pattern,e.flags)),(n=a.exec(t))&&n[0].length==t.length?void 0:r):r},inclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),!i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is not included in the list";return i.format(n,{value:t})}},exclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),i.contains(e.within,t))){var n=e.message||this.message||"^%{value} is restricted";return i.isString(e.within[t])&&(t=e.within[t]),i.format(n,{value:t})}},email:i.extend((function(t,e){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid email";if(i.isDefined(t))return i.isString(t)&&this.PATTERN.exec(t)?void 0:n}),{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])$/i}),equality:function(t,e,n,r,a){if(i.isDefined(t)){i.isString(e)&&(e={attribute:e});var o=(e=i.extend({},this.options,e)).message||this.message||"is not equal to %{attribute}";if(i.isEmpty(e.attribute)||!i.isString(e.attribute))throw new Error("The attribute must be a non empty string");var s=i.getDeepObjectValue(r,e.attribute),c=e.comparator||function(t,e){return t===e},l=e.prettify||a&&a.prettify||i.prettify;return c(t,s,e,n,r)?void 0:i.format(o,{attribute:l(e.attribute)})}},url:function(t,e){if(i.isDefined(t)){var n=(e=i.extend({},this.options,e)).message||this.message||"is not a valid url",r=e.schemes||this.schemes||["http","https"],a=e.allowLocal||this.allowLocal||!1,o=e.allowDataUrl||this.allowDataUrl||!1;if(!i.isString(t))return n;var s="^(?:(?:"+r.join("|")+")://)(?:\\S+(?::\\S*)?@)?(?:",c="(?:\\.(?:[a-z\\u00a1-\\uffff]{2,}))";return a?c+="?":s+="(?!(?:10|127)(?:\\.\\d{1,3}){3})(?!(?:169\\.254|192\\.168)(?:\\.\\d{1,3}){2})(?!172\\.(?:1[6-9]|2\\d|3[0-1])(?:\\.\\d{1,3}){2})",s+="(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]-*)*[a-z\\u00a1-\\uffff0-9]+)*"+c+")(?::\\d{2,5})?(?:[/?#]\\S*)?$",o&&(s="(?:"+s+")|(?:^data:(?:\\w+\\/[-+.\\w]+(?:;[\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\*'();\\/?:@&=+$,%]*$)"),new RegExp(s,"i").exec(t)?void 0:n}},type:i.extend((function(t,e,n,r,a){if(i.isString(e)&&(e={type:e}),i.isDefined(t)){var o,s=i.extend({},this.options,e),c=s.type;if(!i.isDefined(c))throw new Error("No type was specified");if(o=i.isFunction(c)?c:this.types[c],!i.isFunction(o))throw new Error("validate.validators.type.types."+c+" must be a function.");if(!o(t,s,n,r,a)){var l=e.message||this.messages[c]||this.message||s.message||(i.isFunction(c)?"must be of the correct type":"must be of type %{type}");return i.isFunction(l)&&(l=l(t,e,n,r,a)),i.format(l,{attribute:i.prettify(n),type:c})}}}),{types:{object:function(t){return i.isObject(t)&&!i.isArray(t)},array:i.isArray,integer:i.isInteger,number:i.isNumber,string:i.isString,date:i.isDate,boolean:i.isBoolean},messages:{}})},r.formatters={detailed:function(t){return t},flat:i.flattenErrorsToArray,grouped:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=i.flattenErrorsToArray(t[e]);return t},constraint:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=t[e].map((function(t){return t.validator})).sort();return t}},r.exposeModule(r,this,t,e,n)}).call(x,nC.exports,nC,null);var rC=nC.exports,iC="number",aC="string",oC="object",sC="function",cC="array",lC={createInstance:{sdkAppID:{presence:!0,type:iC},tim:{type:oC}},destroyInstance:{},init:{userID:{presence:!0,type:aC},userSig:{presence:!0,type:aC}},on:{eventCode:{presence:!0,type:aC},handler:{presence:!0,type:sC},context:{presence:!0,type:oC}},off:{eventCode:{presence:!0,type:aC},handler:{presence:!0,type:sC}},call:{userID:{presence:!0,type:aC},type:{presence:!0,type:iC},roomID:{presence:!1,type:iC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:wg}}},groupCall:{groupID:{presence:!0,type:aC},type:{presence:!0,type:iC},userIDList:{presence:!0,type:cC},roomID:{presence:!1,type:iC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:wg}}},joinInGroupCall:{groupID:{presence:!0,type:aC},type:{presence:!0,type:iC},roomID:{presence:!0,type:iC}},inviteUser:{userIDList:{presence:!0,type:cC}},accept:{},reject:{},hangup:{},switchCallMediaType:{type:{presence:!0,type:iC}},openCamera:{},closeCamera:{},switchCamera:{},openMicrophone:{},closeMicrophone:{},selectAudioPlaybackDevice:{type:{presence:!0,type:aC}},setSelfInfo:{nickName:{presence:!0,type:aC},avatar:{presence:!0,type:aC}}},uC={createInstance:"",destroyInstance:"",init:"",on:"",off:"",call:[cg.IDLE],groupCall:[cg.IDLE],accept:[cg.CALLING],reject:[cg.CALLING],hangup:[cg.CALLING,cg.CONNECTED],switchCallMediaType:[cg.CALLING,cg.CONNECTED],joinInGroupCall:[cg.IDLE],inviteUser:[cg.CALLING,cg.CONNECTED],openCamera:[cg.CALLING,cg.CONNECTED],closeCamera:[cg.CALLING,cg.CONNECTED],switchCamera:[cg.CALLING,cg.CONNECTED],openMicrophone:[cg.CALLING,cg.CONNECTED],closeMicrophone:[cg.CALLING,cg.CONNECTED],selectAudioPlaybackDevice:[cg.CALLING,cg.CONNECTED],setSelfInfo:""},hC={createInstance:!1,destroyInstance:!0,init:!1,off:!0,call:!0,groupCall:!0,joinInGroupCall:!0,inviteUser:!0,accept:!0,reject:!0,hangup:!0,switchCallMediaType:!0,openCamera:!0,closeCamera:!0,switchCamera:!0,openMicrophone:!0,closeMicrophone:!0,selectAudioPlaybackDevice:!0,setSelfInfo:!0},fC=function(t){d(n,I(Error));var e=_(n);function n(t,r,i){var a;return l(this,n),f(E(a=e.call(this,r)),"code",void 0),f(E(a),"message",void 0),f(E(a),"data",void 0),a.code=t,a.message=r,a.data=i,a}return h(n,null,[{key:"error",value:function(t,e,r){return r?new n(t,e,r):new n(t,e)}}]),n}();function dC(t){var e=V_(t)?"".concat(Ry.ERROR_PACKAGE_NOT_PURCHASED):"".concat(_y);return e=e.replace("${purchaseAddress}",G_(t))}rC.validators.type.types.function=function(t){return t instanceof Function};var pC=function(){function t(){l(this,t),f(this,"paramsMatchedRule",lC),f(this,"statusMatchedRule",uC),f(this,"requireInit",hC)}return h(t,[{key:"getParamsMatchedRule",value:function(t){return this.paramsMatchedRule[t]}},{key:"getStatusMatchedRule",value:function(t){return this.statusMatchedRule[t]}},{key:"getInitReadyRule",value:function(t){return this.requireInit[t]}}]),t}(),vC=function(){function t(){l(this,t),this._logger=uy()}return h(t,[{key:"notify",value:function(t,e,n,r){throw this._logger.error("check:".concat(t.api),{text:{data:t,error:{code:e,message:n}}}),fC.error(e,"[TUICallEngine:".concat(t.api,",").concat(e,"]").concat(n).concat(r))}}]),t}(),gC=h((function t(e){l(this,t),f(this,"api",""),f(this,"attributes",{}),f(this,"callStatus",""),f(this,"capabilityCode",void 0),f(this,"initReady",void 0),this.api=e.api,this.attributes=e.attributes,this.callStatus=e.callStatus,this.capabilityCode=e.capabilityCode,this.initReady=e.initReady,this.sdkAppID=e.sdkAppID})),yC=new WeakMap,IC=function(){function t(){l(this,t),S(this,yC,{writable:!0,value:void 0}),R(this,yC,[])}var e;return h(t,[{key:"addAlertHandler",value:function(t){D(this,yC).push(t)}},{key:"check",value:(e=c(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r1&&void 0!==o[1]?o[1]:{},!e.capabilityCode){t.next=21;break}return t.prev=2,t.next=5,n.tim.callExperimentalAPI("isCommercialAbilityEnabled",e.capabilityCode);case 5:!1===t.sent.data.enabled&&this.notification.notify(e,my.ERROR_PACKAGE_NOT_SUPPORTED,Ty,Ry.ERROR_PACKAGE_NOT_SUPPORTED),t.next=21;break;case 9:if(t.prev=9,t.t0=t.catch(2),wx.$TUICallEngine._callDataReport.setCodeAndMessage(my.ERROR_PACKAGE_NOT_SUPPORTED,JSON.stringify(t.t0)),wx.$TUICallEngine._callDataReport.uploadToKibana(),2905!==t.t0.code){t.next=17;break}this.notification.notify(e,my.ERROR_TIM_VERSION_OUTDATED,Cy,Ry.ERROR_TIM_VERSION_OUTDATED),t.next=21;break;case 17:throw r=null,i=0,e.capabilityCode===Rg.PRO?(r="".concat((a=e.sdkAppID,s=void 0,s=V_(a)?"".concat(Ry.ERROR_PACKAGE_NOT_SUPPORTED):"".concat(Ty),s=s.replace("${purchaseAddress}",G_(a)))," "),i=my.ERROR_PACKAGE_NOT_SUPPORTED):(r="".concat(dC(e.sdkAppID)," "),i=my.ERROR_PACKAGE_NOT_PURCHASED),new fC(i,r);case 21:case"end":return t.stop()}var a,s}),t,this,[[2,9]])}))),function(t){return e.apply(this,arguments)})}]),r}(),CC=function(t){d(n,mC);var e=_(n);function n(t,r){return l(this,n),e.call(this,t,r)}return h(n,[{key:"check",value:function(t,e){void 0!==t.initReady&&this.rule.getInitReadyRule(t.api)!==t.initReady&&this.notification.notify(t,my.ERROR_INIT_FAIL,by,Ry.ERROR_INIT_FAIL)}}]),n}(),bC=function(){function t(){l(this,t),f(this,"alertRule",void 0),f(this,"notification",void 0),f(this,"alert",void 0)}return h(t,[{key:"initializeBeans",value:function(){this.alertRule=new pC,this.notification=new vC,this.alert=new IC,this.alert.addAlertHandler(new EC(this.alertRule,this.notification)),this.alert.addAlertHandler(new CC(this.alertRule,this.notification)),this.alert.addAlertHandler(new TC(this.alertRule,this.notification)),this.alert.addAlertHandler(new _C(this.alertRule,this.notification))}},{key:"getAlert",value:function(){return this.alert}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new t,this.instance.initializeBeans()),this.instance}}]),t}();f(bC,"instance",void 0);var DC=X,RC=$t,wC=Et,SC=ve,xC=Ts,LC=P,OC=Function,kC=DC([].concat),AC=DC([].join),NC={},UC=LC?OC.bind:function(t){var e=RC(this),n=e.prototype,r=xC(arguments,1),i=function(){var n=kC(r,xC(arguments));return this instanceof i?function(t,e,n){if(!SC(NC,e)){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=void 0===e?"":e,r=t.sdkAppId,i=void 0===r?0:r,a=t.userID,o=void 0===a?"":a,s=N_(),c=E_?"uniminiprogram":"wxminiprogram";this._callData={version:n,platform:s,framework:c,sdkAppId:i,userID:o,roomID:0,inviteID:"",callRole:gg,callScene:"",callType:mg,inviteeList:[],result:Sg.UNKNOWN,totalTime:0,totalScore:0,code:0,message:"",abilityBit:!1,enterRoomTime:"",sendSignalingTime:"",callAcceptTime:"",exitRoomTime:"",callEndTime:"",network:0,audio:0,video:0}}},{key:"reset",value:function(){this.initializeCallData(),this._ssoLog=null}},{key:"clearCallDataAfterUpload",value:function(){var t=this.getCallData(),e=t.version,n=t.sdkAppId,r=t.userID;this.initializeCallData({version:e,sdkAppId:n,userID:r})}},{key:"uploadToKibana",value:function(){try{this._ssoLog.setText(this.packageCallDataToKibana()).setEnd(),this.clearCallDataAfterUpload()}catch(t){}}}]),t}(),VC=function(){function t(e,n){l(this,t),f(this,"_eventEmitter",void 0),f(this,"_callDataReport",void 0),this._eventEmitter=e.emitter,this._callDataReport=n,this.registerListener()}return h(t,[{key:"registerListener",value:function(){this._eventEmitter.on(sg.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(sg.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(sg.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(sg.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(sg.REJECT,this.onReject.bind(this))}},{key:"removeLister",value:function(){this._eventEmitter.off(sg.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.off(sg.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.off(sg.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.off(sg.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.off(sg.REJECT,this.onReject.bind(this))}},{key:"onCallEnd",value:function(t){var e=t.data.totalTime,n=void 0===e?0:e;this._callDataReport.setTotalTime(n),this._callDataReport.setCallEndTime((new Date).getTime()),this._callDataReport.setResult(Sg.NORMAL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:"onCallingCancel",value:function(){this._callDataReport.getResult()||this._callDataReport.setResult(Sg.CANCEL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:"onNoResponse",value:function(){this._callDataReport.setResult(Sg.TIMEOUT)}},{key:"onLineBusy",value:function(){this._callDataReport.setResult(Sg.BUSYLINE)}},{key:"onReject",value:function(){this._callDataReport.setResult(Sg.REJECT)}}]),t}();function GC(t){return HC.apply(this,arguments)}function HC(){return HC=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e===vg.AUDIO||e===vg.VIDEO){t.next=2;break}return t.abrupt("return");case 2:return t.abrupt("return",new Promise(function(){var t=c(a().mark((function t(n,r){var i,o,s,c,l,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={microphone:!0,camera:e===vg.VIDEO},t.next=3,U_(i);case 3:if((o=t.sent)||e!==vg.AUDIO){t.next=16;break}return t.prev=5,t.next=8,wx.authorize({scope:Og.RECORD});case 8:t.next=16;break;case 10:t.prev=10,t.t0=t.catch(5),s=xg.MIC_TITLE,c=xg.MIC_CONTENT,BC(s,c),r();case 16:if(o||e!==vg.VIDEO){t.next=30;break}return t.prev=17,t.next=20,wx.authorize({scope:Og.RECORD});case 20:return t.next=22,wx.authorize({scope:Og.CAMERA});case 22:t.next=30;break;case 24:t.prev=24,t.t1=t.catch(17),l=xg.CAMERA_TITLE,u=xg.CAMERA_CONTENT,BC(l,u),r();case 30:n();case 31:case"end":return t.stop()}}),t,null,[[5,10],[17,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 3:case"end":return t.stop()}}),t)}))),HC.apply(this,arguments)}function BC(t,e){wx.showModal({title:t,content:e,confirmText:xg.CONFIRM_TEXT,success:function(t){t.confirm&&wx.openSetting()}})}var FC=xi,KC=X,zC=kr,JC=um,WC=Hm,$C=N,qC=RangeError,YC=String,XC=Math.floor,QC=KC(WC),ZC=KC("".slice),tb=KC(1..toFixed),eb=function(t,e,n){return 0===e?n:e%2==1?eb(t,e-1,n*t):eb(t*t,e/2,n)},nb=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=XC(i/1e7)},rb=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=XC(r/e),r=r%e*1e7},ib=function(t){for(var e=6,n="";--e>=0;)if(""!==n||0===e||0!==t[e]){var r=YC(t[e]);n=""===n?r:n+QC("0",7-r.length)+r}return n};FC({target:"Number",proto:!0,forced:$C((function(){return"0.000"!==tb(8e-5,3)||"1"!==tb(.9,0)||"1.25"!==tb(1.255,2)||"1000000000000000128"!==tb(0xde0b6b3a7640080,0)}))||!$C((function(){tb({})}))},{toFixed:function(t){var e,n,r,i,a=JC(this),o=zC(t),s=[0,0,0,0,0,0],c="",l="0";if(o<0||o>20)throw new qC("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return YC(a);if(a<0&&(c="-",a=-a),a>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(a*eb(2,69,1))-69)<0?a*eb(2,-e,1):a/eb(2,e,1),n*=4503599627370496,(e=52-e)>0){for(nb(s,0,n),r=o;r>=7;)nb(s,1e7,0),r-=7;for(nb(s,eb(10,r,1),0),r=e-1;r>=23;)rb(s,1<<23),r-=23;rb(s,1<0?c+((i=l.length)<=o?"0."+QC("0",o-i)+l:ZC(l,0,i-o)+"."+ZC(l,i-o)):c+l}});var ab=function(){function t(){l(this,t)}return h(t,null,[{key:"generateTaskID",value:function(){return this.currentTaskID+=1}},{key:"run",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sg.TIMEOUT,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;n=i(i({},t===Sg.INTERVAL?{delay:2e3,count:0,backgroundTask:!0}:t===Sg.RAF?{fps:60,delay:16.6,count:0,backgroundTask:!0}:{delay:2e3,count:0,backgroundTask:!0}),n),S_(e)&&(n=i(i({},n),e)),o(t)===Sg.FUNCTION&&(e=t,t=Sg.TIMEOUT);var r=i({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,taskName:t,callback:e},n);return this.taskMap.set(r.taskID,r),this[t](r),r.taskID}},{key:"interval",value:function(t){var e=this;return t.intervalID=setInterval((function(){t.callback(),t.loopCount+=1,e.isBreakLoop(t)}),t.delay)}},{key:"timeout",value:function(t){var e=this;return t.timeoutID=setTimeout((function n(){if(t.callback(),t.loopCount+=1,!e.isBreakLoop(t))return t.timeoutID=setTimeout(n,t.delay)}),t.delay)}},{key:"raf",value:function(t){var e=this;t.delay=(1e3/t.fps).toFixed(2);var n,r=j_(),i=function i(){if(document.hidden&&t.backgroundTask){if(n=j_()-r,r=j_(),t.callback(),t.loopCount+=1,e.isBreakLoop(t))return;return t.timeoutID=setTimeout(i,t.delay-Math.floor(n%t.delay))}if((n=j_()-r)>=t.delay&&(r=j_()-Math.floor(n%t.delay),t.callback(),t.loopCount+=1),!e.isBreakLoop(t))return t.rafID=requestAnimationFrame(i)};if(t.rafID=requestAnimationFrame(i),t.backgroundTask){var a=function(){if(document.hidden){var e=j_()-r;e>=t.delay?i():t.timeoutID=setTimeout(i,t.delay-e)}};document.addEventListener("visibilitychange",a),t.onVisibilitychange=a,document.hidden&&a()}return t.taskID}},{key:"hasTask",value:function(t){return this.taskMap.has(t)}},{key:"clearTask",value:function(t){if(!this.taskMap.has(t))return!0;var e=this.taskMap.get(t),n=e.intervalID,r=e.timeoutID,i=e.onVisibilitychange;return n&&clearInterval(n),r&&clearTimeout(r),i&&document.removeEventListener("visibilitychange",i),this.taskMap.delete(t),!0}},{key:"isBreakLoop",value:function(t){return!this.taskMap.has(t.taskID)||0!==t.count&&t.loopCount>=t.count&&(this.clearTask(t.taskID),!0)}}]),t}();f(ab,"taskMap",new Map),f(ab,"currentTaskID",1);var ob={serviceCommand:"".concat(Sg.CALLKIT_RECORDS_SVR,".*")},sb="sendTRTCCustomData",cb=function(){function t(e){l(this,t),f(this,"_callRecordData",void 0),f(this,"_tim",void 0),f(this,"_heartbeat",void 0),f(this,"_lastHeartBeatTime",void 0),f(this,"_bodyStatus",void 0),this._tim=e.tim,this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=Sg.WAITING,this.initializeCallData(e)}var e,n,r,o;return h(t,[{key:"getCallRecordData",value:function(){return this._callRecordData}},{key:"initializeCallData",value:function(t){var e=t||{},n=e.version,r=void 0===n?"":n,i=e.userID,a=void 0===i?"":i,o={name:y_.platform,version:y_.version},s={version:1,command:Sg.EVENT_REPORT,sdk_version:r,seq:0,os_name:Sg.MINI_PROGRAM,os_version:o.version||"",device_name:o.name||"",framework:Sg.MINI_PROGRAM,call_type:"",media_type:"",client_ts:0,role:gg,user_id:a,room_id:"",call_id:""};this._callRecordData={head:s,body:{event_type:"",code:0,message:"",invitee_list:[]}}}},{key:"reset",value:function(){this.initializeCallData()}},{key:"_setCallType",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_type:t}))}},{key:"_setMediaType",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{media_type:PC(t)}))}},{key:"_setCallRole",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{role:t}))}},{key:"_setUserID",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{user_id:t}))}},{key:"_setRoomID",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{room_id:"".concat(t)}))}},{key:"_setInviteID",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_id:t}))}},{key:"_setEventType",value:function(t){t&&(this._callRecordData.body=i(i({},this._callRecordData.body),{},{event_type:t}))}},{key:"_setInviteeList",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._callRecordData.body=i(i({},this._callRecordData.body),{},{invitee_list:t})}},{key:"_setSeq",value:function(){var t=this.getCallRecordData().head.seq;this._callRecordData.head=i(i({},this._callRecordData.head),{},{seq:t+1})}},{key:"setBodyStatus",value:function(t){if(t){var e=Sg.WAITING;switch(t){case cg.CALLING:e=Sg.WAITING;break;case cg.CONNECTED:e=Sg.CALLING}this._bodyStatus=e}}},{key:"eventUpload",value:(o=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.userID,u=e.roomID,h=e.inviteID,f=e.inviteeList,d=void 0===f?[]:f,r){t.next=3;break}return t.abrupt("return");case 3:return this._callRecordData.head=i(i({},this._callRecordData.head),{},{command:Sg.EVENT_REPORT,client_ts:Math.floor(Date.now()/1e3)}),this._setCallType(o),this._setMediaType(s),this._setCallRole(c),this._setUserID(l),this._setRoomID(u),this._setInviteID(h),this._setEventType(r),this._setInviteeList(d),this._setSeq(),p=this.getCallRecordData(),v=p.head,g=p.body,y={head:i(i({},v),{},{role:MC(v.role)}),body:g},I=i(i({},ob),{},{data:JSON.stringify(y)}),t.next=18,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(sb,I);case 18:case"end":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:"eventUploadNotSave",value:(r=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.roomID,u=e.inviteID,this._setSeq(),h=this.getCallRecordData(),f=h.head,d=h.body,p={head:i(i({},f),{},{role:MC(c),call_id:u,call_type:o,media_type:PC(s),room_id:"".concat(l),client_ts:Math.floor(Date.now()/1e3)}),body:i(i({},d),{},{event_type:r})},v=i(i({},ob),{},{data:JSON.stringify(p)}),t.next=7,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(sb,v);case 7:case"end":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:"heartBeatUpload",value:(n=c(a().mark((function t(){var e,n,r,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._setSeq(),n=this._callRecordData.head,r={head:i(i({},n),{},{role:MC(n.role),clientTs:Date.now(),command:Sg.HEART_BEAT}),body:{status:this._bodyStatus}},o=i(i({},ob),{},{data:r}),t.next=6,null==this||null===(e=this._tim)||void 0===e?void 0:e.callExperimentalAPI(sb,o);case 6:case"end":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:"startHeartbeat",value:function(){-1===this._heartbeat&&(K_.info("start heart beat..."),this._heartbeat=ab.run(Sg.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))}},{key:"stopHeartbeat",value:function(){-1!==this._heartbeat&&(K_.info("stop heart beat"),ab.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=Sg.WAITING)}},{key:"doHeartbeat",value:(e=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.heartBeatUpload(),e=Date.now(),this._lastHeartBeatTime>0&&e-this._lastHeartBeatTime>1e4&&K_.warn("heartbeat took ".concat(e-this._lastHeartBeatTime)),this._lastHeartBeatTime=e;case 4:case"end":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),lb=function(){function t(e,n){l(this,t),f(this,"_eventEmitter",void 0),f(this,"_callRecordDataReport",void 0),f(this,"_isCallAccepted",void 0),this._eventEmitter=e,this._callRecordDataReport=n,this._isCallAccepted=!1,this.registerListener()}return h(t,[{key:"registerListener",value:function(){this._eventEmitter.on(sg.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(sg.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(sg.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(sg.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(sg.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(sg.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(sg.REJECT,this.onReject.bind(this))}},{key:"removeLister",value:function(){this._eventEmitter.off(sg.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(sg.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(sg.CALL_END,this.onCallEnd),this._eventEmitter.off(sg.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(sg.NO_RESP,this.onNoResponse),this._eventEmitter.off(sg.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(sg.REJECT,this.onReject)}},{key:"onCallReceived",value:function(){this._callRecordDataReport.startHeartbeat()}},{key:"onCallAccepted",value:function(){var t=this._callRecordDataReport.getCallRecordData().head;if((null==t?void 0:t.role)===Sg.INVITER){if(this._isCallAccepted&&t.call_type===Sg.GROUP)return;this._isCallAccepted=!0;var e={eventType:Sg.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(e),this._callRecordDataReport.setBodyStatus(cg.CONNECTED)}}},{key:"onCallEnd",value:function(){var t={eventType:Sg.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(t),this._callRecordDataReport.stopHeartbeat()}},{key:"onCallingCancel",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head,n=e.role===Sg.INVITER?Sg.CANCEL_CALL:Sg.CALL_CANCELED;this._isCallAccepted=!1;var r=(t.data||{}).reason;((void 0===r?"":r)===Sg.NORMAL||e.role===Sg.INVITER&&e.call_type===Sg.GROUP)&&this._callRecordDataReport.eventUpload({eventType:n}),this._callRecordDataReport.stopHeartbeat()}},{key:"onNoResponse",value:function(){this._uploadInC2C(Sg.TIMEOUT)}},{key:"onLineBusy",value:function(){this._uploadInC2C(Sg.BUSYLINE)}},{key:"onReject",value:function(){this._uploadInC2C(Sg.REJECT)}},{key:"_uploadInC2C",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head;if((null==e?void 0:e.call_type)===Sg.SINGLE){var n="";switch(t){case Sg.TIMEOUT:n=e.role===Sg.INVITER?Sg.CALL_MISSED:Sg.NOT_ANSWER_CALL;break;case Sg.REJECT:n=e.role===Sg.INVITER&&Sg.CALL_REJECTED;break;case Sg.BUSYLINE:n=e.role===Sg.INVITER?Sg.CALL_BUSY:Sg.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:n})}}}]),t}(),ub="TUICallEngine",hb=uy({clsConfig:{endpoint:"https://ap-nanjing.cls.tencentcs.com",topicId:"a1310e66-a3f5-4572-a1c3-7a327a27496d"}}),fb=function(){function r(i){l(this,r),f(this,"_initReady",!1),f(this,"_timExternal",!1),f(this,"_initialCallId",""),this.data={config:{sdkAppID:i.sdkAppID,userID:"",userSig:"",type:1}},this.initData(),this.EVENT=sg,this.MEDIA_TYPE=vg,this.CALL_TYPE=vg,this._emitter=new og,this.TRTC=new e(this,{TUIScene:"TUICallKit"});var a="TUICallKit";try{(wx&&wx._isTIMCallKit||wx&&wx.getStorageSync&&wx.getStorageSync("_isTIMCallKit")||getApp&&getApp()&&getApp().globalData&&getApp().globalData._isTIMCallKit)&&(a="TIMCallKit")}catch(t){console.error(t)}wx.TUIScene=a,this._callDataReport=new jC({version:Oy,sdkAppId:i.sdkAppID}),this._dataReportObserver=new VC({emitter:this._emitter},this._callDataReport),i.tim?(this.tim=i.tim,this._timExternal=!0):wx.$TIM?(this.tim=wx.$TIM,this._timExternal=!0):this.tim=n.create({SDKAppID:i.sdkAppID}),this._callRecordReport=new cb({version:Oy,tim:this.tim}),this._recordReportObserver=new lb(this._emitter,this._callRecordReport),wx.$TSignaling||(wx.$TSignaling=new t({SDKAppID:i.sdkAppID,tim:this.tim,isRejectNotifyAll:!0})),wx.getSystemInfoSync().platform===Sg.DEVTOOLS&&K_.warn("".concat(Lg)),wx.setStorageSync("sdkAppId",i.sdkAppID),this.TSignalingClient=new xy({TSignaling:wx.$TSignaling}),this.TRTCCallingDelegate=new Ly({emitter:this._emitter}),this._eventStatController=new Z_;var o=new z_(J_);z_.bindController(this._eventStatController),o.setText("version=".concat(Oy)).setEnd(),this._initLogger(i),K_.info("".concat(ub," SDK Version:").concat(Oy,", SDKAppID:").concat(i.sdkAppID))}var o,s,u,d,p,v,g,y,I,m,E,_,C,b,D,R,w,S,x,L,O,k,A,N,U,P,M,j,V,G,H,B,F,K,z,J,W;return h(r,[{key:"destroyInstance",value:function(){if(r.instance){this._callDataReport&&this._callDataReport.reset&&this._callDataReport.reset(),this._dataReportObserver&&this._dataReportObserver.reset&&this._dataReportObserver.removeLister(),this._callRecordReport&&this._callRecordReport.reset(),this._recordReportObserver&&this._recordReportObserver.removeLister(),r.instance.destroyed(),r.instance=null;try{wx.removeStorageSync("sdkAppId"),wx.removeStorageSync("userId")}catch(t){console.error(t)}}}},{key:"_initLogger",value:function(t){var e=this;wx.getSystemInfo({success:function(t){var e=t.brand,n=t.model,r=t.language,i=t.platform,a=t.version;hb.updateGetReportData((function(){return{useragent:{brand:e,model:n,language:r,platform:i,version:a}}}))}}),this._logger=hb,this._logger.updateGetReportData((function(){return{app:"TUICallEngine-mini",version:Oy,platform:Sg.MINI_PROGRAM,sdkappid:t.sdkAppID,time:+new Date,userid:e.getUserID(),callinfo:{roomid:e.getRoomID(),inviteid:e.getInitialCallId(),callrole:e.isInviter()?Sg.INVITER:Sg.INVITEE,groupid:e.getGroupID(),calltype:e.getCallType(),handledInviteeList:e.getHandledInviteeList(),unHandledInviteeList:e.getUnHandledInviteeList()},callkitversion:t.callkitVersion||Sg.UNKNOWN,framework:t.frameWork||Sg.UNKNOWN,isfromchat:t.chat?"true":"false"}}))}},{key:"setLogLevel",value:function(t){"number"!=typeof t||isNaN(t)?K_.error("".concat(ub,",setLogLevel parameter must be a number(0~4)")):(K_.setLevel(t),this.TSignalingClient.setLogLevel(t),this.TRTC.setLogLevel(t))}},{key:"initData",value:function(){var t={callStatus:cg.IDLE,soundMode:this.data.config.type===vg.AUDIO?Dg.EAR:Dg.SPEAKER,active:!1,invitation:{inviteID:"",inviter:"",type:"",roomID:""},startTalkTime:0,localUser:null,remoteUsers:[],remoteID:"",timer:null,chatTimeNum:0,chatTime:"00:00:00",screen:"pusher",pusher:{},playerList:[],isInviter:!0,unHandledInviteeList:[],handledInviteeList:[],_inviterInviteID:{},_audioVideoSwitchIdList:[],_acceptedUserObject:{},isGroupCall:!1,groupID:"",switchCallModeStatus:!0,enterRoomStatus:!1,devicePermission:!1};this.data=i(i({},this.data),t)}},{key:"handleNewInvitationReceived",value:(W=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.NEW_INVITATION_RECEIVED",{text:{data:i(i({},e),{},{currentCallStatus:o})},type:"event"}),o=this.getCallStatus(),K_.log("".concat(ub,".onNewInvitationReceived - params:"),e,"currentCallStatus:".concat(o)),s=e.data,c=s.inviter,l=s.inviteeList,u=s.data,h=s.inviteID,f=s.groupID,M_((d=JSON.parse(u)).businessID)){t.next=7;break}return t.abrupt("return");case 7:if(p=(null==d||null===(n=d.data)||void 0===n?void 0:n.initialCallId)||"",this.getUserID()!==c){t.next=10;break}return t.abrupt("return");case 10:if(g={inviter:c,inviteeList:l,inviteID:h,isGroupCall:v=!!f,inviteData:d,groupID:f,initialCallId:p,currentCallStatus:o,inCallUserIDs:(null==d?void 0:d.inCallUserIDs)||[]},"hangup"!==(null==d||null===(r=d.data)||void 0===r?void 0:r.cmd)){t.next=19;break}if(K_.log("".concat(ub,".hangup - params:"),c,d,this.getHandledInviteeList(),this.getUnHandledInviteeList(),o,v),o!==cg.IDLE){t.next=16;break}return t.abrupt("return");case 16:return t.next=18,this.handleHangupSignal(g);case 18:return t.abrupt("return");case 19:if(v||!this.judgeSwitchCallMode(d)){t.next=25;break}if(o===cg.IDLE||d.room_id!==this.data.invitation.roomID){t.next=24;break}return t.next=23,this.handleSwitchCallModeTSignaling(h,d);case 23:this.addAudioVideoSwitchIdList(h);case 24:return t.abrupt("return");case 25:if(o===cg.IDLE){t.next=30;break}return t.next=28,this.TSignalingClient.reject({inviteID:h,type:u.call_type,lineBusy:"line_busy"});case 28:return this.getCallRecordReport().eventUploadNotSave({inviteID:p||h,callRole:Sg.INVITEE,eventType:Sg.IGNORE_CALL,roomID:d.room_id,mediaType:d.call_type,callType:f?Sg.GROUP:Sg.SINGLE}),t.abrupt("return");case 30:this.handleInvitedSignal(g);case 31:case"end":return t.stop()}}),t,this)}))),function(t){return W.apply(this,arguments)})},{key:"handleHangupSignal",value:(J=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.inviter,r=e.currentCallStatus,o=e.inviteData,s=e.inviteeList,c=this.isGroupCall(),l=this.isInviter(),r!==cg.CALLING){t.next=11;break}if(u=this.getUnHandledInviteeList(),h=this.getHandledInviteeList(),-1!==u.indexOf(n)&&this.deleteUnHandledInviteeList([n]),-1!==h.indexOf(n)){t.next=9;break}return t.abrupt("return");case 9:t.next=15;break;case 11:if(this.deleteHandledInviteeList([n]),!(-1===(f=this.getHandledInviteeList()).indexOf(n)&&f.length>1)){t.next=15;break}return t.abrupt("return");case 15:if(d=this.generateCallEndData({totalTime:o.call_end||0}),c){t.next=22;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=20,this._resetTUICallEngine();case 20:case 31:t.next=46;break;case 22:if(this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),!l){t.next=33;break}if(1!==p.length||0!==v.length){t.next=31;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=31,this._resetTUICallEngine();case 33:if(r!==cg.CALLING){t.next=41;break}if(-1!==s.indexOf(this.getUserID())&&this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),0!==p.length||1!==v.length){t.next=41;break}return g=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},g),{},{reason:Sg.NORMAL})),t.next=41,this._resetTUICallEngine();case 41:if(r!==cg.CONNECTED){t.next=46;break}if(1!==p.length||0!==v.length){t.next=46;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=46,this._resetTUICallEngine();case 46:case"end":return t.stop()}}),t,this)}))),function(t){return J.apply(this,arguments)})},{key:"handleSwitchCallModeTSignaling",value:(z=c(a().mark((function t(e,n){var r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={inviteID:e,type:n.call_type},i={cmd:"switchToVideo"},n.call_type===vg.VIDEO&&(r.switch_to_audio_call="switch_to_audio_call",i.cmd="switchToAudio"),t.next=5,this.TSignalingClient.accept(r,i);case 5:o=t.sent,this.setSwitchCallModeStatus(!1),this.handleCallMode(n.call_type,o);case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return z.apply(this,arguments)})},{key:"judgeSwitchCallMode",value:function(t){return t.switch_to_audio_call&&"switch_to_audio_call"===t.switch_to_audio_call||t.data&&"switchToAudio"===t.data.cmd||t.data&&"switchToVideo"===t.data.cmd}},{key:"handleCallMode",value:function(t,e){K_.log("".concat(ub,".handleCallMode - type"),t);var n=t!==vg.VIDEO;this.setPusherAttributesHandler({enableCamera:n}),n?(this.data.config.type=vg.VIDEO,this.data.invitation.type=vg.VIDEO):(this.data.config.type=vg.AUDIO,this.data.invitation.type=vg.AUDIO),this.TRTCCallingDelegate.onCallMode({type:this.data.config.type,message:e.data.message}),this.setSwitchCallModeStatus(!0)}},{key:"handleInvitedSignal",value:(K=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.inviter,r=e.inviteeList,o=e.isGroupCall,s=e.groupID,c=e.inviteID,l=e.inviteData,u=e.inCallUserIDs,h=void 0===u?[]:u,f=e.initialCallId,d=void 0===f?"":f,this.data.remoteID=n,this.data.config.type=l.call_type,this.data.invitation.inviteID=c,this.data.invitation.inviter=n,this.data.invitation.type=l.call_type,this.data.invitation.roomID=l.room_id,this.data.isInviter=!1,this.data.isGroupCall=o,this.data.roomID=l.room_id,this.addHandledInviteeList([n]),this.addUnHandledInviteeList([].concat(T(r),T(h))),this.addAcceptedUserList(c,[n]),this.addInviterInviteId(c,[n].concat(T(r))),this.setInitialCallId(d),p=h.filter((function(t){return-1===r.indexOf(t)})),o&&(this.data.groupID=s),this.changeCallStatus(cg.CALLING),K_.log("".concat(ub," NEW_INVITATION_RECEIVED invitation: "),this.data.callStatus,this.data.invitation),v={sponsor:n,inviteeList:r,userIDList:[].concat(T(r),T(p)),isFromGroup:o,inviteID:c,groupID:s,inviteData:{version:l.version,callType:l.call_type,roomID:l.room_id},userData:l.userData,calleeIdList:r,callMediaType:l.call_type},this.setPusherAttributesHandler({enableCamera:this.data.config.type===vg.VIDEO}),g=i(i({},g=this.getCallDataReport().getCallData()),{},{userId:this.getUserID(),roomID:l.room_id,inviteID:c,callRole:Ig,callType:l.call_type,inviteeList:r}),y={eventType:Sg.RECEIVE_CALL,callType:s?Sg.GROUP:Sg.SINGLE,mediaType:l.call_type,callRole:Sg.INVITEE,userID:this.getUserID(),roomID:l.room_id,inviteID:d||c},this.getCallRecordReport().eventUpload(y),this.getCallDataReport().setCallData(g),I=this.generateEventData()||{},this.TRTCCallingDelegate.onInvited(i(i({},I),v)),t.next=30,U_({camera:!0});case 30:this.data.devicePermission=t.sent,this.data.devicePermission&&this.data.config.type===vg.VIDEO&&wx.createLivePusherContext().startPreview();case 32:case"end":return t.stop()}}),t,this)}))),function(t){return K.apply(this,arguments)})},{key:"addInviterInviteId",value:function(t,e){0!==e.length&&(0===(this.data._inviterInviteID[t]||[]).length?this.data._inviterInviteID[t]=e:this.data._inviterInviteID[t]=[].concat(T(this.data._inviterInviteID[t]),T(e)))}},{key:"handleInviteeAccepted",value:(F=c(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITEE_ACCEPTED",{text:{data:i(i({},e),{},{currentCallStatus:this.data.callStatus}),type:"event"}}),K_.log("".concat(ub," onInviteeAccepted - params:"),e),M_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=5;break}return t.abrupt("return");case 5:if(r=e.data.invitee,o=e.data.inviteID,-1!==this.getTotalInviterInviteIdList().indexOf(o)){t.next=9;break}return t.abrupt("return");case 9:if(this.data.callStatus!==cg.IDLE){t.next=11;break}return t.abrupt("return");case 11:if(this.isGroupCall()||!this.judgeSwitchCallMode(n)||this.data.switchCallModeStatus){t.next=14;break}return this.handleCallMode(this.data.invitation.type),t.abrupt("return");case 14:if(s=this.getCallStatus(),r!==this.getUserID()||s!==cg.CALLING){t.next=21;break}return c=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},c)),t.next=20,this._resetTUICallEngine();case 20:return t.abrupt("return");case 21:return this.isInviter()&&this.data.callStatus===cg.CALLING&&this.changeCallStatus(cg.CONNECTED),this.getCallDataReport().setCallAcceptTime((new Date).getTime()),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.addAcceptedUserList(o,[r]),t.next=28,this.getUserProfile(this.data.unHandledInviteeList.map((function(t){return{userID:t}})));case 28:l=t.sent,this.TRTCCallingDelegate.onUserAccept({userID:r,userList:l});case 30:case"end":return t.stop()}}),t,this)}))),function(t){return F.apply(this,arguments)})},{key:"handleInviteeRejected",value:(B=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITEE_REJECTED",{text:{data:e},type:"event"}),K_.log("".concat(ub," onInviteeRejected - params"),e),r=e.data.inviteID,M_(null==(o=JSON.parse(e.data.data))?void 0:o.businessID)){t.next=6;break}return t.abrupt("return");case 6:if(this.isGroupCall()||this.getSwitchCallModeStatus()||-1===this.getAudioVideoSwitchIdList().indexOf(r)){t.next=10;break}return K_.log("".concat(ub,".onInviteeRejected - Audio and video switching is not available")),this.setSwitchCallModeStatus(!0),t.abrupt("return");case 10:if(s=e.data.invitee,c=e.data.inviter,l=this.getUserID(),u=this.getCallStatus(),-1!==this.getInviterInviteIdList().indexOf(r)){t.next=19;break}if(!this.isInviter()||-1===this.getInviterInviteIdUserList().indexOf(s)){t.next=17;break}return t.abrupt("return");case 17:return this.deleteUnHandledInviteeList([s]),t.abrupt("return");case 19:if(u!==cg.IDLE){t.next=21;break}return t.abrupt("return");case 21:if(h=this.generateEventData(),l!==s||u!==cg.CALLING){t.next=27;break}return this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:s,userID:s},h)),t.next=26,this._resetTUICallEngine();case 26:return t.abrupt("return");case 27:if(f=this.isGroupCall(),d=this.isInviter(),this.deleteUnHandledInviteeList([s]),p=this.getUnHandledInviteeList(),v=this.getHandledInviteeList(),g=i({inviteID:this.data.invitation.inviteID,invitee:l,userID:l},h),y={inviteID:this.data.invitation.inviteID,invitee:s,userID:s},I=this.data.invitation,u!==cg.CONNECTED){t.next=38;break}if(-1===v.indexOf(s)){t.next=38;break}return t.abrupt("return");case 38:if(!("line_busy"===o.line_busy||""===o.line_busy||null!=o&&null!==(n=o.data)&&void 0!==n&&n.message&&"lineBusy"===o.data.message)){t.next=52;break}if(c===I.inviter&&this.TRTCCallingDelegate.onLineBusy({inviteID:this.data.invitation.inviteID,invitee:s,userID:s}),f){t.next=46;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.BUSYLINE})),t.next=44,this._resetTUICallEngine();case 44:t.next=50;break;case 46:if(0!==p.length||1!==v.length){t.next=50;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.BUSYLINE})),t.next=50,this._resetTUICallEngine();case 50:case 57:t.next=78;break;case 52:if(f){t.next=59;break}return this.TRTCCallingDelegate.onReject(y),this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.REJECT})),t.next=57,this._resetTUICallEngine();case 59:if(this.TRTCCallingDelegate.onReject(y),u!==cg.CALLING){t.next=72;break}if(!d){t.next=68;break}if(0!==p.length||1!==v.length){t.next=66;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.REJECT})),t.next=66,this._resetTUICallEngine();case 66:t.next=72;break;case 68:if(1!==p.length||0!==v.length){t.next=72;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.REJECT})),t.next=72,this._resetTUICallEngine();case 72:if(u!==cg.CONNECTED){t.next=78;break}if(0!==p.length||1!==v.length){t.next=78;break}return m=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(m),t.next=78,this._resetTUICallEngine();case 78:case"end":return t.stop()}}),t,this)}))),function(t){return B.apply(this,arguments)})},{key:"handleInvitationCancelled",value:(H=c(a().mark((function t(e){var n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITATION_CANCELLED",{text:{data:e,type:"event"}}),this.data.invitation.inviteID===e.data.inviteID){t.next=3;break}return t.abrupt("return");case 3:if(M_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=6;break}return t.abrupt("return");case 6:if(this.data.callStatus!==cg.IDLE){t.next=8;break}return t.abrupt("return");case 8:if(-1!==this.getInviterInviteIdList().indexOf(e.data.inviteID)){t.next=10;break}return t.abrupt("return");case 10:return K_.log(ub,"onInvitationCancelled","inviteID:".concat(e.data.inviteID," inviter:").concat(e.data.inviter," data:").concat(e.data.data)),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:e.data.inviter,userID:e.data.inviter},r),{},{reason:Sg.NORMAL})),t.next=15,this._resetTUICallEngine();case 15:case"end":return t.stop()}}),t,this)}))),function(t){return H.apply(this,arguments)})},{key:"handleInvitationTimeout",value:(G=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("TSignaling.INVITATION_TIMEOUT",{text:{data:e,type:"event"}}),r=e.data,o=r.inviter,s=r.inviteeList,c=void 0===s?[]:s,l=r.inviteID,u=this.getUserID(),h=this.isGroupCall(),f=this.isInviter(),d=this.getCallStatus(),this.deleteUnHandledInviteeList(c),K_.warn("".concat(ub,".onInvitationTimeout - params:"),e,"currentUserID:".concat(u," isInviter:").concat(f," isGroupCall:").concat(h," \n currentCallStatus:").concat(d," inviteID:").concat(null==this||null===(n=this._newInvitationData)||void 0===n?void 0:n.inviteID)),-1!==this.getInviterInviteIdList().indexOf(l)){t.next=10;break}return t.abrupt("return");case 10:if(d!==cg.IDLE){t.next=12;break}return t.abrupt("return");case 12:if(p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),g={groupID:this.data.groupID,inviteID:this.data.invitation.inviteID,sponsor:o,timeoutUserList:c,userIDList:c},y=this.generateEventData(),I=i(i({inviteID:this.data.invitation.inviteID,invitee:u,userID:u},y),{},{reason:Sg.TIMEOUT}),h){t.next=23;break}return f?(this.TRTCCallingDelegate.onNoResp(g),this.TRTCCallingDelegate.onCancel(I)):(this.TRTCCallingDelegate.onCancel(I),m=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},m),{},{eventType:Sg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}))),t.next=21,this._resetTUICallEngine();case 21:t.next=48;break;case 23:if(d!==cg.CALLING){t.next=41;break}if(!f){t.next=32;break}if(this.TRTCCallingDelegate.onNoResp(g),0!==v.length){t.next=30;break}return this.TRTCCallingDelegate.onCancel(I),t.next=30,this._resetTUICallEngine();case 30:t.next=41;break;case 32:if(-1!==c.indexOf(u)){t.next=36;break}this.TRTCCallingDelegate.onNoResp(g),t.next=39;break;case 36:return this.TRTCCallingDelegate.onCancel(I),t.next=39,this._resetTUICallEngine();case 39:E=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},E),{},{eventType:Sg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}));case 41:if(d!==cg.CONNECTED){t.next=48;break}if(this.TRTCCallingDelegate.onNoResp(g),1!==p.length||0!==v.length){t.next=48;break}return _=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(_),t.next=48,this._resetTUICallEngine();case 48:case"end":return t.stop()}}),t,this)}))),function(t){return G.apply(this,arguments)})},{key:"handleSDKReady",value:function(){var t=this;this._logger.info("ChatSdkEvent.SDK_READY",{text:{type:"event"}}),K_.log(ub,"TSignaling SDK ready"),this.TSignalingResolve(),this.TRTCCallingDelegate.onSdkReady({message:"SDK ready"}),this.tim.getMyProfile().then((function(e){t.data.localUser=e.data})).catch((function(t){K_.warn("getMyProfile error:",t)}))}},{key:"handleKickedOut",value:(V=c(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("ChatSdkEvent.KICKED_OUT",{text:{type:"event"}}),this.getCallStatus()!==cg.CONNECTED){t.next=6;break}return e=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(e),t.next=6,this._resetTUICallEngine();case 6:if(this.getCallStatus()!==cg.CALLING){t.next=14;break}return n=this.getUserID(),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:n,userID:n},r),{},{reason:Sg.BANNED})),t.next=12,this.cancel();case 12:return t.next=14,this._resetTUICallEngine();case 14:this._initReady=!1,this.TRTCCallingDelegate.onKickedOut({message:"kicked out"});case 16:case"end":return t.stop()}}),t,this)}))),function(){return V.apply(this,arguments)})},{key:"_addTSignalingEvent",value:function(){wx.$TSignaling.on(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived,this),wx.$TSignaling.on(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted,this),wx.$TSignaling.on(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected,this),wx.$TSignaling.on(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled,this),wx.$TSignaling.on(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout,this),wx.$TSignaling.on(t.EVENT.SDK_READY,this.handleSDKReady,this),wx.$TSignaling.on(t.EVENT.KICKED_OUT,this.handleKickedOut,this),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.on(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"_removeTSignalingEvent",value:function(){wx.$TSignaling.off(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived),wx.$TSignaling.off(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted),wx.$TSignaling.off(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected),wx.$TSignaling.off(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled),wx.$TSignaling.off(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout),wx.$TSignaling.off(t.EVENT.SDK_READY,this.handleSDKReady),wx.$TSignaling.off(t.EVENT.KICKED_OUT,this.handleKickedOut),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.off(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:"onLocalJoin",value:function(){var t=this.generateEventData();this.TRTCCallingDelegate.onCallBegin(t)}},{key:"onRemoteUserJoin",value:(j=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.data,r=n.userID,i=n.userList,o=n.playerList,K_.log(ub,"REMOTE_USER_JOIN",e,r),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.changeCallStatus(cg.CONNECTED),!(o.length>0)){t.next=11;break}return t.next=8,this.getUserProfile(o);case 8:t.t0=t.sent,t.next=12;break;case 11:t.t0=this.data.playerList;case 12:this.data.playerList=t.t0,this.data.startTalkTime||(this.data.startTalkTime=Date.now()),this.TRTCCallingDelegate.onUserEnter({userID:e.data.userID,playerList:this.data.playerList}),K_.log(ub,"REMOTE_USER_JOIN","playerList:",this.data.playerList,"userList:",i);case 16:case"end":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:"onRemoteUserLeave",value:(M=c(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.getCallStatus()!==cg.IDLE){t.next=2;break}return t.abrupt("return");case 2:if(n=e.data.userID,K_.log(ub,"REMOTE_USER_LEAVE",e,e.data.userID),this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),this.getCallDataReport().setExitRoomTime((new Date).getTime()),this.data.isGroupCall){t.next=17;break}return t.next=11,this.TSignalingClient.hangup({userIDList:[n],callType:this.data.config.type,callEnd:this.generateCallTotalTime()});case 11:return r=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(r),K_.log(ub,"REMOTE_USER_LEAVE","playerList:"),t.next=16,this._resetTUICallEngine();case 16:return t.abrupt("return");case 17:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=this.getUserID(),1!==i.length||i[0]!==s||0!==o.length){t.next=25;break}return c=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(c),t.next=25,this._resetTUICallEngine();case 25:case"end":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})},{key:"onLocalNetStateUpdate",value:function(t){var e=t.data.pusher.netStatus;K_.log(ub,"onLocalNetStateUpdate",e),this.data.pusher=t.data.pusher,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onRemoteNetStateUpdate",value:(P=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.data.playerList,K_.log(ub,"onRemoteNetStateUpdate",n),this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return P.apply(this,arguments)})},{key:"onError",value:function(t){K_.warn(ub,"onError",t),this.TRTCCallingDelegate.onError(t)}},{key:"onRemoteVideoAdd",value:function(t){K_.log("* room REMOTE_VIDEO_ADD",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!1})}},{key:"onRemoteVideoRemove",value:function(t){K_.log("* room REMOTE_VIDEO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"onRemoteAudioAdd",value:(U=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return K_.log("* room REMOTE_AUDIO_ADD",e),t.next=3,this.getUserProfile([e.data.player]);case 3:n=t.sent,this.setPlayerAttributesHandler(n[0],{muteAudio:!1});case 5:case"end":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:"onRemoteAudioRemove",value:function(t){K_.log("* room REMOTE_AUDIO_REMOVE",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"onRemoteAudioVolumeUpdate",value:(N=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:K_.log("* room REMOTE_AUDIO_VOLUME_UPDATE",e),n=e.data.playerList,this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case"end":return t.stop()}}),t,this)}))),function(t){return N.apply(this,arguments)})},{key:"onLocalAudioVolumeUpdate",value:function(t){var e=t.data.pusher;this.data.pusher=e,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"onMessageSentByMe",value:function(t){this.TRTCCallingDelegate.onMessageSentByMe(t)}},{key:"_addTRTCEvent",value:function(){this.TRTC.on(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.ERROR,this.onError,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate,this)}},{key:"_removeTRTCEvent",value:function(){this.TRTC.off(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave),this.TRTC.off(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.ERROR,this.onError),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate),this.TRTC.off(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate)}},{key:"initTRTC",value:function(){var t={beautyLevel:5};this._logger.info("".concat(ub,".initTRTC.start"),{type:"api",data:{pusherConfig:t}});var e=this.TRTC.createPusher(t);this.data.pusher=e.pusherAttributes}},{key:"enterRoom",value:function(t){var e=+new Date;this._logger.info("".concat(ub,".enterRoom.start"),{text:{data:t},type:"api"}),this._addTRTCEvent();var n=t.roomID,r=Object.assign(this.data.config,{roomID:n,enableMic:!0,autopush:!0,enableAgc:!0,enableAns:!0,enableCamera:t.callType===vg.VIDEO});this.data.enterRoomStatus=!0,this.data.pusher=this.TRTC.enterRoom(r);var a=+new Date;this._logger.info("".concat(ub,".enterRoom.success"),{text:{data:i(i({},t),{},{cost:a-e})},type:"api"}),wx.createLivePusherContext().startPreview(),this.getCurrentPusherInstance().start()}},{key:"exitRoom",value:(A=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".exitRoom.start"),{type:"api"}),t.next=3,this.getCurrentPusherInstance().stop();case 3:return t.next=5,this.TRTC.exitRoom();case 5:e=t.sent,this.data.pusher=e.pusher,this.data.playerList=e.playerList,this.data.unHandledInviteeList=[],this.data.enterRoomStatus=!1,this.initTRTC(),this._removeTRTCEvent();case 12:case"end":return t.stop()}}),t,this)}))),function(){return A.apply(this,arguments)})},{key:"setPusherAttributesHandler",value:function(t){this._logger.info("".concat(ub,".setPusherAttributesHandler.start"),{text:{data:t},type:"api"}),this.data.pusher=this.TRTC.setPusherAttributes(t),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:"setPlayerAttributesHandler",value:(k=c(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info("".concat(ub,".setPlayerAttributesHandler.start"),{text:{data:n},type:"api"}),r=this.TRTC.setPlayerAttributes(e.streamID,n),K_.warn("setPlayerAttributesHandler",r),this.data.playerList=r.length>0?this._updateUserProfile(this.data.playerList,r):this.data.playerList,this.data.playerList.length>0&&0===r.length&&(this.data.playerList[0].hasAudio=!1,this.data.playerList[0].hasVideo=!1),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 6:case"end":return t.stop()}}),t,this)}))),function(t,e){return k.apply(this,arguments)})},{key:"_mutePlayerAudio",value:function(t){this._logger.info("".concat(ub,"._mutePlayerAudio.start"),{text:{data:t},type:"api"});var e=t.currentTarget.dataset.value;e.hasAudio&&e.muteAudio?this.setPlayerAttributesHandler(e,{muteAudio:!1}):!e.hasAudio||e.muteAudio||this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:"_mutePlayerVideo",value:function(t){this._logger.info("".concat(ub,"._mutePlayerVideo.start"),{text:{data:t},type:"api"});var e=t.currentTarget.dataset.value;e.hasVideo&&e.muteVideo?this.setPlayerAttributesHandler(e,{muteVideo:!1}):!e.hasVideo||e.muteVideo||this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:"_pusherAudioHandler",value:function(){this._logger.info("".concat(ub,"._pusherAudioHandler.start"),{type:"api",text:{data:{enableMic:this.data.pusher.enableMic}}}),this.data.pusher.enableMic?(this.setPusherAttributesHandler({enableMic:!1}),this.getCurrentPusherInstance().setMICVolume({volume:0})):(this.setPusherAttributesHandler({enableMic:!0}),this.getCurrentPusherInstance().setMICVolume({volume:100}))}},{key:"_pusherVideoHandler",value:function(){this._logger.info("".concat(ub,"._pusherVideoHandler.start"),{type:"api",text:{data:{enableCamera:this.data.pusher.enableCamera}}}),this.data.pusher.enableCamera?this.setPusherAttributesHandler({enableCamera:!1}):this.setPusherAttributesHandler({enableCamera:!0})}},{key:"init",value:(O=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return bC.getInstance().getAlert().checkSync(new gC({api:"init",attributes:e})),t.next=3,this.login(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)}))),function(t){return O.apply(this,arguments)})},{key:"login",value:(L=c(a().mark((function t(e){var n=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".login.start"),{type:"api",text:i(i({},e),{},{userSig:""})}),this.data.config.userID=e.userID,this.data.config.userSig=e.userSig,t.abrupt("return",new Promise((function(t,r){wx.$TSignaling.login({userID:e.userID,userSig:e.userSig}).then((function(r){return K_.log(ub,"login","IM login success",r),wx.setStorageSync("userId","".concat(e.userID)),n._callDataReport.setUserID(e.userID),n._initReady=!0,n._resetTUICallEngine(),n._addTSignalingEvent(),n.initTRTC(),n.TSignalingResolve=t,r.data.repeatLogin&&t(null),null})).catch((function(t){n._logger.error("".concat(ub,".login.fail"),{type:"api",text:{error:t}}),K_.error("".concat(ub," init failed', error: ").concat(t)),r(t)}))})));case 4:case"end":return t.stop()}}),t,this)}))),function(t){return L.apply(this,arguments)})},{key:"logout",value:(x=c(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(ub,".logout.start"),{type:"api",text:{data:{userID:this.data.config.userID,initReady:this._initReady}}}),this._initReady){t.next=3;break}return t.abrupt("return");case 3:return e=this.data.config,n=e.userID,r=e.userSig,t.prev=4,t.next=7,wx.$TSignaling.logout({userID:n,userSig:r});case 7:K_.log(ub,"logout","IM logout success"),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(4),this._logger.error("".concat(ub,".logout.fail"),{type:"api",text:{error:t.t0}}),K_.error(ub,"logout","IM logout failure");case 14:case"end":return t.stop()}}),t,this,[[4,10]])}))),function(){return x.apply(this,arguments)})},{key:"on",value:function(t,e,n){bC.getInstance().getAlert().checkSync(new gC({api:"on",attributes:{eventCode:t,handler:e,context:n}})),this._emitter.on(t,e,n)}},{key:"off",value:function(t,e){bC.getInstance().getAlert().checkSync(new gC({api:"off",attributes:{eventCode:t,handler:e}})),this._emitter.off(t,e)}},{key:"call",value:(S=c(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".call.start"),{type:"api",text:{data:e}}),n=e.userID,r=e.type,t.next=4,bC.getInstance().getAlert().check(new gC({api:"call",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Rg.BASE,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,GC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(ub,".call.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 13:if(this.getUserID()!==n){t.next=17;break}throw this._logger.error("".concat(ub,".call.fail"),{text:{error:"Called id can not be yourself. userId:".concat(this.getUserID(),", inviteeId:").concat(n)},type:"api"}),K_.log("".concat(ub,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n)),new Error("".concat(ub,".call failed. Called id can't be yourself. userId:").concat(this.getUserID(),", inviteeId:").concat(n));case 17:return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(Sg.SINGLE_CALL),o={callType:Sg.SINGLE,mediaType:r,inviteeList:[n]},t.prev=20,s=e.roomID||Math.floor(2147483646*Math.random()+1),this.data.roomID=s,this.data.config.type=r,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=r,this.data.invitation.roomID=s,this.data.isInviter=!0,this.data.remoteID=n,this.changeCallStatus(cg.CALLING),t.next=32,this.TSignalingClient.invite(i(i({},e),{},{roomID:s}));case 32:if(c=t.sent,this.enterRoom({roomID:s,callType:r}),this._callDataReport.setEnterRoomTime((new Date).getTime()),l=i(i({},l=this._callDataReport.getCallData()),{},{userId:n,roomID:s,callRole:yg,callType:r,inviteeList:[n]}),this._callDataReport.setCallData(l),this._callDataReport.setSendSignalingTime((new Date).getTime()),K_.log("".concat(ub," call(userID: ").concat(n,", type: ").concat(r,") success, ").concat(c)),0!==c.code){t.next=51;break}this.data.invitation.inviteID=c.inviteID,this.addInviterInviteId(c.inviteID,[this.data.config.userID,n]),this.addUnHandledInviteeList([n]),this.addHandledInviteeList([this.getUserID()]),this._callDataReport.setInviteID(c.inviteID),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:Sg.START_CALL},o)),this._callRecordReport.startHeartbeat(),t.next=57;break;case 51:return this._callDataReport.setCodeAndMessage(c.code,c.message),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:Sg.CALL_FAILED},o)),this._logger.error("".concat(ub,".call.fail"),{text:{error:c},type:"api"}),t.next=57,this._resetTUICallEngine();case 57:return t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 60:return t.prev=60,t.t1=t.catch(20),t.t1.code===my.ERROR_BLACKLIST?(this.TRTCCallingDelegate.onError(my.ERROR_BLACKLIST,t.t1.message),this._callDataReport.setCodeAndMessage(my.ERROR_BLACKLIST,t.t1.message)):this._callDataReport.setCodeAndMessage(my.UNKNOWN,JSON.stringify(t.t1)),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:Sg.CALL_FAILED},o)),this._logger.error("".concat(ub,".call.fail"),{text:{error:t.t1},type:"api"}),K_.error("".concat(ub," call(userID:").concat(n,",type:").concat(r,") failed', error: ").concat(t.t1)),t.next=69,this._resetTUICallEngine();case 69:throw new Error(t.t1);case 70:case"end":return t.stop()}}),t,this,[[4,9],[20,60]])}))),function(t){return S.apply(this,arguments)})},{key:"groupCall",value:(w=c(a().mark((function t(e){var n,r,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".groupCall.start"),{type:"api",text:{data:e}}),n=e.type,r=e.userIDList,t.next=4,bC.getInstance().getAlert().check(new gC({api:"groupCall",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Rg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,GC(n);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(ub,".groupCall.fail"),{type:"api",text:{error:t.t0}}),t.abrupt("return");case 13:if(-1===r.indexOf(this.getUserID())){t.next=16;break}throw this._logger.error("".concat(ub,".groupCall.fail"),{type:"api",text:{error:"Called list can not contain yourself"}}),new Error("".concat(ub,".groupCall failed. Called list can't contain yourself. userID:").concat(this.getUserID(),", inviteeIDList:").concat(r));case 16:return this._callDataReport.setCallScene(Sg.GROUP_CALL),o=e.roomID||Math.floor(2147483646*Math.random()+1),this.enterRoom({roomID:o,callType:n}),s={callType:Sg.GROUP,mediaType:n,inviteeList:e.userIDList},this.data.config.type=e.type,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.changeCallStatus(cg.CALLING),t.prev=28,t.next=31,this.TSignalingClient.inviteGroup(i(i({},e),{},{roomID:o}));case 31:return c=t.sent,this.data.config.type=e.type,this.data.invitation.inviteID=c.inviteID,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.data.roomID=o,this.addUnHandledInviteeList(e.userIDList),this.addHandledInviteeList([this.getUserID()]),this.addInviterInviteId(c.inviteID,[this.data.config.userID].concat(T(e.userIDList))),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:Sg.START_CALL},s)),this._callRecordReport.startHeartbeat(),K_.log(ub,"groupCall OK",c),t.abrupt("return",{data:c.data,pusher:this.data.pusher});case 51:return t.prev=51,t.t1=t.catch(28),this._logger.error("".concat(ub,".groupCall.fail"),{type:"api",text:{error:t.t1}}),K_.error(ub,"groupCall failed",t.t1),this._callRecordUpload(i({eventType:Sg.CALL_FAILED},s)),t.next=58,this._resetTUICallEngine();case 58:throw new Error(t.t1);case 59:case"end":return t.stop()}}),t,this,[[4,9],[28,51]])}))),function(t){return w.apply(this,arguments)})},{key:"joinInGroupCall",value:(R=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".joinInGroupCall.start"),{text:{data:e},type:"api"}),n=e.roomID,r=e.type,i=e.groupID,t.next=4,bC.getInstance().getAlert().check(new gC({api:"joinInGroupCall",attributes:e,initReady:this._initReady,capabilityCode:Rg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,GC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error("".concat(ub,".joinInGroupCall.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 13:return t.prev=13,this.data.config.type=r,this.data.invitation.type=r,K_.log("".concat(ub,".joinInGroupCall roomID:").concat(n,",type:").concat(r,",userID:").concat(this.getUserID())),this.changeCallStatus(cg.CALLING),this.addHandledInviteeList([this.getUserID()]),this.data.groupID=i,this.data.roomID=n,this.data.isGroupCall=!0,this.data.isInviter=!1,this.enterRoom({roomID:n,callType:r}),this.changeCallStatus(cg.CONNECTED),this.getCallRecordReport().setBodyStatus(cg.CONNECTED),o={eventType:Sg.JOIN_IN_GROUP_CALL,callType:Sg.GROUP,mediaType:this._callType},this._callRecordUpload(o),this._callRecordReport.startHeartbeat(),t.abrupt("return",this.data.pusher);case 32:return t.prev=32,t.t1=t.catch(13),this._logger.error("".concat(ub,".joinInGroupCall.fail"),{text:{error:t.t1},type:"api"}),t.next=37,this._resetTUICallEngine();case 37:throw new Error("".concat(ub,".joinInGroupCall failed error: ").concat(t.t1));case 38:case"end":return t.stop()}}),t,this,[[4,9],[13,32]])}))),function(t){return R.apply(this,arguments)})},{key:"inviteUser",value:(D=c(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".inviteUser.start"),{text:{data:e},type:"api"}),t.next=3,bC.getInstance().getAlert().check(new gC({api:"inviteUser",attributes:e,initReady:this._initReady,capabilityCode:Rg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 3:if(n=e.userIDList,r=void 0===n?[]:n,this.isGroupCall()){t.next=8;break}throw this._logger.error("".concat(ub,".inviteUser.fail"),{text:{error:"".concat(ub,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)},type:"api"}),K_.error("".concat(ub,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType)),new Error("".concat(ub,".inviteUser - groupID:").concat(this.data.groupID,", roomID:").concat(this.data.roomID,", type:").concat(this.data.callType));case 8:if(this.isInviter()||this.data.callStatus===cg.CONNECTED){t.next=12;break}throw this._logger.error("".concat(ub,".inviteUser.fail"),{text:{error:"".concat(ub,".inviteUser - current status:").concat(this.data.callStatus," not support")},type:"api"}),K_.error("".concat(ub,".inviteUser - current status:").concat(this.data.callStatus," not support")),new Error("".concat(ub,".inviteUser - current status:").concat(this.data.callStatus," not support"));case 12:if(0!==r.length){t.next=16;break}throw this._logger.error("".concat(ub,".inviteUser.fail"),{text:{error:"userIDList is empty"},type:"api"}),K_.error("".concat(ub,".inviteUser - userIDList is empty")),new Error("".concat(ub,".inviteUser - userIDList is empty"));case 16:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=[].concat(T(i),T(o)),0!==(c=r.filter((function(t){return-1===s.indexOf(t)}))).length){t.next=24;break}return this._logger.error("".concat(ub,".inviteUser.fail"),{text:{data:{userIDList:r},error:"userIDList in call list"},type:"api"}),K_.error("".concat(ub,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))),t.abrupt("return",Promise.reject("".concat(ub,".inviteUser failed - userIDList in call list. userIDList:").concat(JSON.stringify(r))));case 24:return r=c,t.prev=25,l=this.data.handledInviteeList.filter((function(t){return t!==f.getUserID()})),t.next=29,this.TSignalingClient.inviteGroup({groupID:this.data.groupID,userIDList:r,type:this.data.invitation.type,roomID:this.data.roomID,timeout:this.data.callTimeout,inCallUserIDs:[].concat(T(this.data.unHandledInviteeList),T(l)),initialCallId:this.getInitialCallId()});case 29:if(u=t.sent,K_.log("inviteUser res",u),0!==u.code){t.next=38;break}return this.addUnHandledInviteeList(r),this.addInviterInviteId(u.inviteID,[this.data.config.userID].concat(T(r))),h={eventType:Sg.INVITE_USER,callType:Sg.GROUP,mediaType:this._callType,inviteeList:r},this._callRecordUpload(h),this._callRecordReport.startHeartbeat(),t.abrupt("return",u);case 38:t.next=44;break;case 40:throw t.prev=40,t.t0=t.catch(25),this._logger.error("".concat(ub,".inviteUser.fail"),{text:{error:t.t0},type:"api"}),new Error("".concat(ub,".inviteUser failed, userId:").concat(this.getUserID(),", inviteeIdList:").concat(r,", error: ").concat(t.t0));case 44:case"end":return t.stop()}}),t,this,[[25,40]])}))),function(t){return D.apply(this,arguments)})},{key:"accept",value:(b=c(a().mark((function t(){var e=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".accept.start"),{type:"api"}),t.next=3,bC.getInstance().getAlert().check(new gC({api:"accept",initReady:this._initReady,callStatus:this.data.callStatus,sdkAppID:this.data.config.sdkAppID}));case 3:return t.prev=3,t.next=6,GC(this.data.config.type);case 6:t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(3),this._logger.error("".concat(ub,".accept.fail"),{text:{error:t.t0},type:"api"}),t.abrupt("return");case 12:return t.abrupt("return",new Promise((function(t,n){if(K_.log(ub,"accept() inviteID: ",e.data.invitation.inviteID),e.data.config.type!==vg.VIDEO||e.data.isGroupCall)e.handleAccept(t,n);else if(e.data.devicePermission){wx.createLivePusherContext().stopPreview();var r=setTimeout(c(a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:clearTimeout(r),e.handleAccept(t,n);case 2:case"end":return i.stop()}}),i)}))),0)}else e.handleAccept(t,n)})));case 13:case"end":return t.stop()}}),t,this,[[3,8]])}))),function(){return b.apply(this,arguments)})},{key:"handleAccept",value:(C=c(a().mark((function t(e,n){var r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".handleAccept.start"),{type:"api"}),this._callDataReport.setEnterRoomTime((new Date).getTime()),this.enterRoom({roomID:this.data.invitation.roomID,callType:this.data.config.type}),r=this.data.invitation.inviteID,t.next=6,this.TSignalingClient.accept({inviteID:r,type:this.data.config.type});case 6:0===(i=t.sent).code?(K_.log(ub,"accept OK"),this.addHandledInviteeList([this.getUserID()]),this.deleteUnHandledInviteeList([this.getUserID()]),this.addAcceptedUserList(r,[this.getUserID()]),this._callRecordUpload({eventType:Sg.ACCEPT_CALL}),e({message:i.data.message,pusher:this.data.pusher}),this.changeCallStatus(cg.CONNECTED),this.getCallRecordReport().setBodyStatus(cg.CONNECTED)):(this.isGroupCall()&&(this._callDataReport.setCodeAndMessage(my.NOT_MEDIA_ACCESS,JSON.stringify(i.data.message)),this._callDataReport.uploadToKibana()),this._logger.error("".concat(ub,".accept.fail"),{text:{error:i},type:"api"}),K_.error(ub,"accept failed",i),n(i),this._resetTUICallEngine());case 8:case"end":return t.stop()}}),t,this)}))),function(t,e){return C.apply(this,arguments)})},{key:"reject",value:(_=c(a().mark((function t(){var e,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".reject.start"),{text:{data:{invitation:this.data.invitation,type:this.data.config.type}},type:"api"}),t.next=3,bC.getInstance().getAlert().checkSync(new gC({api:"reject",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(!this.data.invitation.inviteID){t.next=14;break}return t.next=6,this.TSignalingClient.reject({inviteID:this.data.invitation.inviteID,type:this.data.config.type});case 6:return e=t.sent,K_.log(ub,"reject OK",e),n=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},n),{},{reason:Sg.REJECT})),this._callRecordUpload({eventType:Sg.REJECT_CALL}),t.next=13,this._resetTUICallEngine();case 13:return t.abrupt("return",e);case 14:return this._logger.error("".concat(ub,".reject.fail"),{text:{error:"未收到邀请,无法拒绝"},type:"api"}),K_.warn("".concat(ub," 未收到邀请,无法拒绝")),t.abrupt("return","未收到邀请,无法拒绝");case 17:case"end":return t.stop()}}),t,this)}))),function(){return _.apply(this,arguments)})},{key:"hangup",value:(E=c(a().mark((function t(){var e,n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".hangup.start"),{text:{data:{isGroupCall:this.isGroupCall(),isInviter:this.isInviter(),currentUserID:this.getUserID(),totalTime:this.generateCallTotalTime(),callType:this.getCallType()}},type:"api"}),t.next=3,bC.getInstance().getAlert().checkSync(new gC({api:"hangup",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(K_.warn("".concat(ub,". - callStatus:").concat(this.data.callStatus," _inviterInviteID:").concat(JSON.stringify(this.data.invitation))),this.data.callStatus!==cg.IDLE){t.next=7;break}throw this._logger.error("".concat(ub,".hangup.fail"),{text:{data:{currentStatus:this.data.callStatus},error:"hangup failed. current status:"},type:"api"}),new Error("".concat(ub,".hangup failed. current status:").concat(this.data.callStatus));case 7:if(this.data.callStatus!==cg.CALLING||0!==this.getInviterInviteIdList().length){t.next=10;break}throw this._logger.error("".concat(ub,".hangup.fail"),{text:{error:"call/groupCall incomplete。please wait cancel"},type:"api"}),new Error("".concat(ub,".call/groupCall incomplete。please wait cancel"));case 10:if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserID(),o=this.generateCallTotalTime(),s=this.getCallType(),l=this.getInviterInviteIdList(),this.data.callStatus!==cg.CONNECTED){t.next=31;break}if(t.prev=17,0!==l.length){t.next=23;break}return u=this.generateCallEndData({callMediaType:s,totalTime:o}),this.TRTCCallingDelegate.onCallEnd(u),t.next=23,this._resetTUICallEngine();case 23:t.next=31;break;case 25:return t.prev=25,t.t0=t.catch(17),this._logger.error("".concat(ub,".hangup.fail"),{text:{error:t.t0},type:"api"}),t.next=30,this._resetTUICallEngine();case 30:throw new Error(t.t0);case 31:if(h=this.getHandledInviteeList(),f=this.getUnHandledInviteeList(),d=this.generateEventData(),t.prev=34,e){t.next=53;break}if(p=this.generateCallEndData(),!n){t.next=48;break}if(1!==f.length){t.next=45;break}return t.next=41,this.cancel();case 41:c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:Sg.NORMAL})),t.next=46;break;case 45:this.TRTCCallingDelegate.onCallEnd(p);case 46:t.next=49;break;case 48:this.TRTCCallingDelegate.onCallEnd(p);case 49:return t.next=51,this._resetTUICallEngine();case 51:t.next=82;break;case 53:if(v=this.getCallStatus(),g={callType:this.getCallType(),isGroupCall:this.isGroupCall(),groupID:this.data.groupID,userIDList:[].concat(T(h.filter((function(t){return t!==r}))),T(f)),callEnd:this.generateCallTotalTime()},!n){t.next=73;break}if(v!==cg.CALLING){t.next=63;break}return t.next=59,this.cancel(this.getInviterInviteIdList());case 59:return c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:Sg.NORMAL})),t.next=63,this._resetTUICallEngine();case 63:if(v!==cg.CONNECTED){t.next=71;break}y=a().mark((function t(){var e,n,i,o,s,u,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l[I],n=_.getInviterInviteIdUserList(e),!((i=_.getAcceptedUserList(e)).length>0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(T(o),T(s)).filter((function(t){return t!==r})),K_.warn("inviter emit hangup signal, notify userIDList:".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return K_.warn("inviter emit cancel signal, userIdList:".concat(n)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case"end":return t.stop()}}),t)})),I=0;case 66:if(!(I0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(T(o),T(s)).filter((function(t){return t!==r})),K_.warn("invitee emit hangup signal, notify userIDList:".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return K_.warn("invitee emit cancel signal, inviteID:".concat(e)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case"end":return t.stop()}}),t)})),E=0;case 75:if(!(E=3600?(r=parseInt(o/3600)<10?"0".concat(parseInt(o/3600)):parseInt(o/3600),i=parseInt(o%60/60)<10?"0".concat(parseInt(o%60/60)):parseInt(o%60/60),(a=o%3600<10?"0".concat(o%3600):o%3600)>60&&(i=parseInt(a/60)<10?"0".concat(parseInt(a/60)):parseInt(a/60),a=a%60<10?"0".concat(a%60):a%60),n="".concat(r,":").concat(i,":").concat(a)):o>=60&&o<3600?(i=parseInt(o/60)<10?"0".concat(parseInt(o/60)):parseInt(o/60),a=o%60<10?"0".concat(o%60):o%60,n="00:".concat(i,":").concat(a)):o<60&&(a=o<10?"0".concat(o):o,n="00:00:".concat(a)),n),e.data.chatTimeNum+=1,e.data.pusher.chatTime=e.data.chatTime,e.data.pusher.chatTimeNum=e.data.chatTimeNum,e.TRTCCallingDelegate.onUserUpdate({pusher:e.data.pusher,playerList:e.data.playerList})}),1e3);break;case cg.IDLE:clearInterval(this.data.timer),this.data.timer=null,this.data.chatTime="00:00:00",this.data.chatTimeNum=0}}},{key:"_resetTUICallEngine",value:(I=c(a().mark((function t(e,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(ub,"._resetTUICallEngine.start"),{text:{data:{callEnd:e,type:n}},type:"api"}),this.changeCallStatus(cg.IDLE),K_.log(ub," _resetTUICallEngine()",this.data.enterRoomStatus),!this.data.enterRoomStatus){t.next=6;break}return t.next=6,this.exitRoom(e,n);case 6:this.data.config.type=vg.AUDIO,this._initialCallId="",this.initData();case 9:case"end":return t.stop()}}),t,this)}))),function(t,e){return I.apply(this,arguments)})},{key:"startRemoteView",value:(y=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info("".concat(ub,".startRemoteView.start"),{text:{data:{userID:e}},type:"api"}),this.data.playerList.forEach((function(t){if(t.userID===e)return t.muteVideo=!1,void K_.log("".concat(ub,", startRemoteView(").concat(e,")"))}));case 2:case"end":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:"stopRemoteView",value:function(t){this._logger.info("".concat(ub,".stopRemoteView.start"),{text:{data:{userID:t}},type:"api"}),this.data.playerList.forEach((function(e){if(e.userID===t)return e.muteVideo=!0,void K_.log("".concat(ub,", stopRemoteView(").concat(t,")"))}))}},{key:"openCamera",value:function(){this._logger.info("".concat(ub,".openCamera.start"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"openCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera||this._pusherVideoHandler(),K_.log("".concat(ub,", openCamera() pusher: ").concat(this.data.pusher))}},{key:"closeCamera",value:function(){this._logger.info("".concat(ub,".closeCamera.start"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"closeCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera&&this._pusherVideoHandler(),K_.log("".concat(ub,", closeCamera() pusher: ").concat(this.data.pusher))}},{key:"switchCamera",value:function(){this._logger.info("".concat(ub,".switchCamera.start"),{text:{data:{frontCamera:this.data.pusher.frontCamera}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"switchCamera",callStatus:this.data.callStatus,initReady:this._initReady})),this.getCurrentPusherInstance().switchCamera(),K_.log("".concat(ub,", switchCamera(), frontCamera").concat(this.data.pusher.frontCamera))}},{key:"openMicrophone",value:function(){this._logger.info("".concat(ub,".openMicrophone.start"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"openMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic||this._pusherAudioHandler(),K_.log("".concat(ub,", openMicrophone() pusher: ").concat(this.data.pusher))}},{key:"closeMicrophone",value:function(){this._logger.info("".concat(ub,".closeMicrophone.start"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"closeMicrophone",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic&&this._pusherAudioHandler(),K_.log("".concat(ub,", closeMicrophone() pusher: ").concat(this.data.pusher))}},{key:"selectAudioPlaybackDevice",value:function(t){this._logger.info("".concat(ub,".selectAudioPlaybackDevice.start"),{text:{data:{type:t}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"selectAudioPlaybackDevice",callStatus:this.data.callStatus,attributes:{type:t},initReady:this._initReady}));var e=!1;switch(t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(e)}},{key:"setHandsFree",value:function(t){return this.data.soundMode=t?"speaker":"ear",K_.log("".concat(ub,", setHandsFree() result: ").concat(this.data.soundMode)),this.data.soundMode}},{key:"switchAudioCall",value:(g=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(ub,".switchAudioCall.start"),{type:"api"}),!this.isGroupCall()){t.next=5;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),K_.warn("".concat(ub,".switchToAudioCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.invitation.type!==vg.AUDIO){t.next=9;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"the call mode is audio call"},type:"api"}),K_.warn("".concat(ub," Now the call mode is audio call.")),t.abrupt("return");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),K_.warn("".concat(ub," audio and video call switching.")),t.abrupt("return");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Cg}));case 16:case"end":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:"switchCallMediaType",value:(v=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info("".concat(ub,".closeMicrophone.start"),{text:{data:{type:e}},type:"api"}),t.next=3,bC.getInstance().getAlert().check(new gC({api:"switchCallMediaType",attributes:{type:e},callStatus:this.data.callStatus,initReady:this._initReady,sdkAppID:this.data.config.sdkAppID}));case 3:if(!this.isGroupCall()){t.next=7;break}throw this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),K_.error("".concat(ub,".switchToAudioCall is not applicable to groupCall.")),new fC(my.ERROR_SCENE_NOT_SUPPORTED,"".concat(ub,".switchToAudioCall is not applicable to groupCall."));case 7:if(this.data.switchCallModeStatus){t.next=11;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),K_.warn("".concat(ub," audio and video call switching.")),t.abrupt("return");case 11:t.t0=e,t.next=t.t0===vg.AUDIO?14:t.t0===vg.VIDEO?17:20;break;case 14:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Cg}));case 17:throw this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"Audio switching Video is not supported yet"},type:"api"}),K_.warn("".concat(ub," Audio switching Video is not supported yet")),new Error("".concat(ub," Audio switching Video is not supported yet"));case 20:case"end":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:"setSwitchCallModeStatus",value:function(t){this.data.switchCallModeStatus=t}},{key:"switchVideoCall",value:(p=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(ub,".switchVideoCall.start"),{type:"api"}),!this.isGroupCall()){t.next=5;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"switchToAudioCall is not applicable to groupCall"},type:"api"}),K_.warn("".concat(ub,".switchToVideoCall is not applicable to groupCall.")),t.abrupt("return");case 5:if(this.data.invitation.type!==vg.VIDEO){t.next=9;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"Now the call mode is video call"},type:"api"}),K_.warn("".concat(ub," Now the call mode is video call.")),t.abrupt("return");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error("".concat(ub,".switchAudioCall.fail"),{text:{error:"audio and video call switching"},type:"api"}),K_.warn("".concat(ub," audio and video call switching.")),t.abrupt("return");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!0}),t.abrupt("return",this.TSignalingClient.switchCallMode({userID:this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:bg}));case 16:case"end":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})},{key:"setSoundMode",value:function(t){var e=!1,n=!1;switch(t||(n=!0,t=this.data.soundMode),t){case"speaker":e=!0;break;case"ear":e=!1}return this.setHandsFree(n?!e:e)}},{key:"_hangUp",value:function(){this.hangup()}},{key:"getCurrentPusherInstance",value:function(){return this.TRTC.getPusherInstance().context=wx.createLivePusherContext(),this.TRTC.getPusherInstance()}},{key:"_pusherStateChangeHandler",value:function(t){this.TRTC.pusherEventHandler(t)}},{key:"_playerStateChange",value:function(t){this._emitter.emit(sg.REMOTE_STATE_UPDATE,t)}},{key:"_playerAudioVolumeNotify",value:function(t){this.data.playerList.length>0&&this.TRTC.playerAudioVolumeNotify(t)}},{key:"_pusherAudioVolumeNotify",value:function(t){this.TRTC.pusherAudioVolumeNotify(t)}},{key:"_updateUserProfile",value:function(t,e){return 0===e.length||0===t.length?e:e.map((function(e){var n=e,r=t.filter((function(t){return t.userID===e.userID}));return n.avatar=r[0]&&r[0].avatar?r[0].avatar:"",n.nick=r[0]&&r[0].nick?r[0].nick:"",n}))}},{key:"_getUserProfile",value:function(t){var e=this;this.tim.getUserProfile({userIDList:t}).then((function(t){K_.log("getUserProfile success",t),K_.log(t.data),e.data.remoteUsers=t.data})).catch((function(t){K_.warn("getUserProfile error:",t)}))}},{key:"getUserProfile",value:(d=c(a().mark((function t(e){var n,r,i,o,s=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:"array",0!==e.length){t.next=3;break}return t.abrupt("return",[]);case 3:return r=e.map((function(t){return t.userID})),t.next=6,this.tim.getUserProfile({userIDList:r});case 6:i=t.sent,o=null,t.t0=n,t.next="array"===t.t0?11:"map"===t.t0?13:16;break;case 11:return o=e.map((function(t,e){return t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,t})),t.abrupt("break",16);case 13:return o={},e.forEach((function(t,e){t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,o[t.userID]=t})),t.abrupt("break",16);case 16:return t.abrupt("return",o);case 17:case"end":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:"setSelfInfo",value:function(t,e){return this._logger.info("".concat(ub,".setSelfInfo.start"),{text:{data:{nickName:t,avatar:e}},type:"api"}),bC.getInstance().getAlert().checkSync(new gC({api:"setSelfInfo",attributes:{nickName:t,avatar:e},initReady:this._initReady})),this.tim.updateMyProfile({nick:t,avatar:e})}},{key:"deviceCheck",value:(u=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",U_(e));case 1:case"end":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)})},{key:"_pusherNetStatus",value:function(t){this.TRTC.pusherNetStatusHandler(t)}},{key:"_playNetStatus",value:function(t){this.TRTC.playerNetStatus(t)}},{key:"_toggleViewSize",value:function(t){var e=t.currentTarget.dataset.screen;return K_.log("get screen",e,t),1===this.data.playerList.length&&e!==this.data.screen&&this.data.invitation.type===vg.VIDEO&&(this.data.screen=e),this.data.screen}},{key:"getTim",value:function(){return this.tim}},{key:"destroyed",value:(s=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(ub,".destroyed.start"),{type:"api"}),this.getCallStatus()===cg.IDLE){t.next=4;break}return t.next=4,this.handleExceptionExit();case 4:if(this._resetTUICallEngine(),this._removeTSignalingEvent(),this._removeTRTCEvent(),this._timExternal){t.next=10;break}return t.next=10,this.logout();case 10:this._initReady=!1;case 11:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"handleExceptionExit",value:(o=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info("".concat(ub,".handleExceptionExit.start"),{text:{data:{callStatus:this.getCallStatus()}},type:"api"}),t.prev=1,this.getCallStatus()!==cg.CALLING){t.next=10;break}if(!this.isInviter()){t.next=8;break}return t.next=6,this.hangup();case 6:t.next=10;break;case 8:return t.next=10,this.reject();case 10:if(this.getCallStatus()!==cg.CONNECTED){t.next=13;break}return t.next=13,this.hangup();case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),this._logger.error("".concat(ub,".handleExceptionExit.fail"),{text:{data:{error:t.t0}},type:"api"});case 18:case"end":return t.stop()}}),t,this,[[1,15]])}))),function(){return o.apply(this,arguments)})},{key:"_callRecordUpload",value:function(t){var e=i(i({},t),{},{callRole:this.isInviter()?Sg.INVITER:Sg.INVITEE,userID:this.getUserID(),roomID:this.getRoomID(),inviteID:this.getInitialCallId()});this._callRecordReport.eventUpload(e)}},{key:"generateCallEndData",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.roomId,n=t.callMediaType,r=t.callRole,i=t.totalTime,a=t.userId;return e=e||this.getRoomID(),n=n||this.getCallType(),r||(r=this.isInviter()?yg:Ig),{roomID:e,callMediaType:n,callRole:r,totalTime:i=x_(i)?this.generateCallTotalTime():i,userID:a=a||this.getUserID(),callEnd:i,message:t.message||""}}},{key:"generateEventData",value:function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomID(),callRole:this.isInviter()?Sg.INVITER:Sg.INVITEE,callMediaType:this.getCallType()}}},{key:"setInitialCallId",value:function(t){this._initialCallId=t}},{key:"getInitialCallId",value:function(){return this._initialCallId}},{key:"getConnectStartTime",value:function(){return this.data.startTalkTime}},{key:"generateCallTotalTime",value:function(){return 0===this.getConnectStartTime()?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)}}],[{key:"createInstance",value:function(t){return hb.updateEsConfig({url:"".concat("https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report","?sdkappid=").concat(null==t?void 0:t.sdkAppID),table:"timweb-trtccalling"}),bC.getInstance().getAlert().checkSync(new gC({api:"createInstance",attributes:t})),r.instance||(r.instance=new r(t)),r.instance.initData(),r.instance}}]),r}();f(fb,"instance",null),f(fb,"AUDIO_PLAYBACK_DEVICE",Dg),f(fb,"MEDIA_TYPE",vg),f(fb,"EVENT",sg),f(fb,"STATUS",cg);if (!exports.__esModule) Object.defineProperty(exports, "__esModule", { value: true });Object.defineProperty(exports, 'AUDIO_PLAYBACK_DEVICE', { enumerable: true, configurable: true, get: function() { return Dg; } });Object.defineProperty(exports, 'EVENT', { enumerable: true, configurable: true, get: function() { return sg; } });Object.defineProperty(exports, 'MEDIA_TYPE', { enumerable: true, configurable: true, get: function() { return vg; } });Object.defineProperty(exports, 'STATUS', { enumerable: true, configurable: true, get: function() { return cg; } });Object.defineProperty(exports, 'TUICallEngine', { enumerable: true, configurable: true, get: function() { return fb; } });Object.defineProperty(exports, 'default', { enumerable: true, configurable: true, get: function() { return fb; } }); + +}, function(modId) {var map = {}; return __REQUIRE__(map[modId], modId); }) +return __REQUIRE__(1704768242906); +})() +//miniprogram-npm-outsideDeps=["tsignaling-wx","trtc-wx-sdk","tim-wx-sdk"] +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/miniprogram_npm/tuicall-engine-wx/index.js.map b/miniprogram_npm/tuicall-engine-wx/index.js.map new file mode 100644 index 0000000..a6f572f --- /dev/null +++ b/miniprogram_npm/tuicall-engine-wx/index.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["tuicall-engine-wx.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["var __TEMP__ = require('tsignaling-wx');var t = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('trtc-wx-sdk');var e = __REQUIRE_DEFAULT__(__TEMP__);var __TEMP__ = require('tim-wx-sdk');var n = __REQUIRE_DEFAULT__(__TEMP__);function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function i(t){for(var e=1;e=0;--a){var o=this.tryEntries[a],s=o.completion;if(\"root\"===o.tryLoc)return i(\"end\");if(o.tryLoc<=this.prev){var c=r.call(o,\"catchLoc\"),l=r.call(o,\"finallyLoc\");if(c&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,\"finallyLoc\")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),L(n),y}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if(\"throw\"===r.type){var i=r.arg;L(n)}return i}}throw new Error(\"illegal catch attempt\")},delegateYield:function(e,n,r){return this.delegate={iterator:k(e),resultName:n,nextLoc:r},\"next\"===this.method&&(this.arg=t),y}},e}function o(t){return o=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&\"function\"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?\"symbol\":typeof t},o(t)}function s(t,e,n,r,i,a,o){try{var s=t[a](o),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function c(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function o(t){s(a,r,i,o,c,\"next\",t)}function c(t){s(a,r,i,o,c,\"throw\",t)}o(void 0)}))}}function l(t,e){if(!(t instanceof e))throw new TypeError(\"Cannot call a class as a function\")}function u(t,e){for(var n=0;n=0||(i[n]=t[n]);return i}(t,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function E(t){if(void 0===t)throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");return t}function _(t){var e=g();return function(){var n,r=p(t);if(e){var i=p(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return function(t,e){if(e&&(\"object\"==typeof e||\"function\"==typeof e))return e;if(void 0!==e)throw new TypeError(\"Derived constructors may only return object or undefined\");return E(t)}(this,n)}}function T(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if(\"undefined\"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t[\"@@iterator\"])return Array.from(t)}(t)||function(t,e){if(!t)return;if(\"string\"==typeof t)return C(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);\"Object\"===n&&t.constructor&&(n=t.constructor.name);if(\"Map\"===n||\"Set\"===n)return Array.from(t);if(\"Arguments\"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return C(t,e)}(t)||function(){throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\")}()}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n0&&K[0]<4?1:+(K[0]+K[1])),!z&&wt&&(!(K=wt.match(/Edge\\/(\\d+)/))||K[1]>=74)&&(K=wt.match(/Chrome\\/(\\d+)/))&&(z=+K[1]);var kt=z,At=kt,Nt=N,Ut=k.String,Pt=!!Object.getOwnPropertySymbols&&!Nt((function(){var t=Symbol(\"symbol detection\");return!Ut(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&At&&At<41})),Mt=Pt&&!Symbol.sham&&\"symbol\"==typeof Symbol.iterator,jt=Ct,Vt=yt,Gt=bt,Ht=Object,Bt=Mt?function(t){return\"symbol\"==typeof t}:function(t){var e=jt(\"Symbol\");return Vt(e)&&Gt(e.prototype,Ht(t))},Ft=String,Kt=function(t){try{return Ft(t)}catch(t){return\"Object\"}},zt=yt,Jt=Kt,Wt=TypeError,$t=function(t){if(zt(t))return t;throw new Wt(Jt(t)+\" is not a function\")},qt=$t,Yt=st,Xt=function(t,e){var n=t[e];return Yt(n)?void 0:qt(n)},Qt=V,Zt=yt,te=Et,ee=TypeError,ne={exports:{}},re=k,ie=Object.defineProperty,ae=function(t,e){try{ie(re,t,{value:e,configurable:!0,writable:!0})}catch(n){re[t]=e}return e},oe=ae,se=\"__core-js_shared__\",ce=k[se]||oe(se,{}),le=ce;(ne.exports=function(t,e){return le[t]||(le[t]=void 0!==e?e:{})})(\"versions\",[]).push({version:\"3.33.2\",mode:\"global\",copyright:\"© 2014-2023 Denis Pushkarev (zloirock.ru)\",license:\"https://github.com/zloirock/core-js/blob/v3.33.2/LICENSE\",source:\"https://github.com/zloirock/core-js\"});var ue=ut,he=Object,fe=function(t){return he(ue(t))},de=fe,pe=X({}.hasOwnProperty),ve=Object.hasOwn||function(t,e){return pe(de(t),e)},ge=X,ye=0,Ie=Math.random(),me=ge(1..toString),Ee=function(t){return\"Symbol(\"+(void 0===t?\"\":t)+\")_\"+me(++ye+Ie,36)},_e=k,Te=ne.exports,Ce=ve,be=Ee,De=Pt,Re=Mt,we=_e.Symbol,Se=Te(\"wks\"),xe=Re?we.for||we:we&&we.withoutSetter||be,Le=function(t){return Ce(Se,t)||(Se[t]=De&&Ce(we,t)?we[t]:xe(\"Symbol.\"+t)),Se[t]},Oe=V,ke=Et,Ae=Bt,Ne=Xt,Ue=function(t,e){var n,r;if(\"string\"===e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;if(Zt(n=t.valueOf)&&!te(r=Qt(n,t)))return r;if(\"string\"!==e&&Zt(n=t.toString)&&!te(r=Qt(n,t)))return r;throw new ee(\"Can't convert object to primitive value\")},Pe=TypeError,Me=Le(\"toPrimitive\"),je=function(t,e){if(!ke(t)||Ae(t))return t;var n,r=Ne(t,Me);if(r){if(void 0===e&&(e=\"default\"),n=Oe(r,t,e),!ke(n)||Ae(n))return n;throw new Pe(\"Can't convert object to primitive value\")}return void 0===e&&(e=\"number\"),Ue(t,e)},Ve=je,Ge=Bt,He=function(t){var e=Ve(t,\"string\");return Ge(e)?e:e+\"\"},Be=Et,Fe=k.document,Ke=Be(Fe)&&Be(Fe.createElement),ze=function(t){return Ke?Fe.createElement(t):{}},Je=ze,We=!U&&!N((function(){return 7!==Object.defineProperty(Je(\"div\"),\"a\",{get:function(){return 7}}).a})),$e=U,qe=V,Ye=G,Xe=J,Qe=dt,Ze=He,tn=ve,en=We,nn=Object.getOwnPropertyDescriptor;A.f=$e?nn:function(t,e){if(t=Qe(t),e=Ze(e),en)try{return nn(t,e)}catch(t){}if(tn(t,e))return Xe(!qe(Ye.f,t,e),t[e])};var rn={},an=U&&N((function(){return 42!==Object.defineProperty((function(){}),\"prototype\",{value:42,writable:!1}).prototype})),on=Et,sn=String,cn=TypeError,ln=function(t){if(on(t))return t;throw new cn(sn(t)+\" is not an object\")},un=U,hn=We,fn=an,dn=ln,pn=He,vn=TypeError,gn=Object.defineProperty,yn=Object.getOwnPropertyDescriptor,In=\"enumerable\",mn=\"configurable\",En=\"writable\";rn.f=un?fn?function(t,e,n){if(dn(t),e=pn(e),dn(n),\"function\"==typeof t&&\"prototype\"===e&&\"value\"in n&&En in n&&!n[En]){var r=yn(t,e);r&&r[En]&&(t[e]=n.value,n={configurable:mn in n?n[mn]:r[mn],enumerable:In in n?n[In]:r[In],writable:!1})}return gn(t,e,n)}:gn:function(t,e,n){if(dn(t),e=pn(e),dn(n),hn)try{return gn(t,e,n)}catch(t){}if(\"get\"in n||\"set\"in n)throw new vn(\"Accessors not supported\");return\"value\"in n&&(t[e]=n.value),t};var _n=rn,Tn=J,Cn=U?function(t,e,n){return _n.f(t,e,Tn(1,n))}:function(t,e,n){return t[e]=n,t},bn={exports:{}},Dn=U,Rn=ve,wn=Function.prototype,Sn=Dn&&Object.getOwnPropertyDescriptor,xn=Rn(wn,\"name\"),Ln={EXISTS:xn,PROPER:xn&&\"something\"===function(){}.name,CONFIGURABLE:xn&&(!Dn||Dn&&Sn(wn,\"name\").configurable)},On=yt,kn=ce,An=X(Function.toString);On(kn.inspectSource)||(kn.inspectSource=function(t){return An(t)});var Nn,Un,Pn,Mn=kn.inspectSource,jn=yt,Vn=k.WeakMap,Gn=jn(Vn)&&/native code/.test(String(Vn)),Hn=ne.exports,Bn=Ee,Fn=Hn(\"keys\"),Kn=function(t){return Fn[t]||(Fn[t]=Bn(t))},zn={},Jn=Gn,Wn=k,$n=Et,qn=Cn,Yn=ve,Xn=ce,Qn=Kn,Zn=zn,tr=\"Object already initialized\",er=Wn.TypeError,nr=Wn.WeakMap;if(Jn||Xn.state){var rr=Xn.state||(Xn.state=new nr);rr.get=rr.get,rr.has=rr.has,rr.set=rr.set,Nn=function(t,e){if(rr.has(t))throw new er(tr);return e.facade=t,rr.set(t,e),e},Un=function(t){return rr.get(t)||{}},Pn=function(t){return rr.has(t)}}else{var ir=Qn(\"state\");Zn[ir]=!0,Nn=function(t,e){if(Yn(t,ir))throw new er(tr);return e.facade=t,qn(t,ir,e),e},Un=function(t){return Yn(t,ir)?t[ir]:{}},Pn=function(t){return Yn(t,ir)}}var ar={set:Nn,get:Un,has:Pn,enforce:function(t){return Pn(t)?Un(t):Nn(t,{})},getterFor:function(t){return function(e){var n;if(!$n(e)||(n=Un(e)).type!==t)throw new er(\"Incompatible receiver, \"+t+\" required\");return n}}},or=X,sr=N,cr=yt,lr=ve,ur=U,hr=Ln.CONFIGURABLE,fr=Mn,dr=ar.enforce,pr=ar.get,vr=String,gr=Object.defineProperty,yr=or(\"\".slice),Ir=or(\"\".replace),mr=or([].join),Er=ur&&!sr((function(){return 8!==gr((function(){}),\"length\",{value:8}).length})),_r=String(String).split(\"String\"),Tr=bn.exports=function(t,e,n){\"Symbol(\"===yr(vr(e),0,7)&&(e=\"[\"+Ir(vr(e),/^Symbol\\(([^)]*)\\)/,\"$1\")+\"]\"),n&&n.getter&&(e=\"get \"+e),n&&n.setter&&(e=\"set \"+e),(!lr(t,\"name\")||hr&&t.name!==e)&&(ur?gr(t,\"name\",{value:e,configurable:!0}):t.name=e),Er&&n&&lr(n,\"arity\")&&t.length!==n.arity&&gr(t,\"length\",{value:n.arity});try{n&&lr(n,\"constructor\")&&n.constructor?ur&&gr(t,\"prototype\",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(t){}var r=dr(t);return lr(r,\"source\")||(r.source=mr(_r,\"string\"==typeof e?e:\"\")),t};Function.prototype.toString=Tr((function(){return cr(this)&&pr(this).source||fr(this)}),\"toString\");var Cr=yt,br=rn,Dr=bn.exports,Rr=ae,wr=function(t,e,n,r){r||(r={});var i=r.enumerable,a=void 0!==r.name?r.name:e;if(Cr(n)&&Dr(n,a,r),r.global)i?t[e]=n:Rr(e,n);else{try{r.unsafe?t[e]&&(i=!0):delete t[e]}catch(t){}i?t[e]=n:br.f(t,e,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return t},Sr={},xr=Math.ceil,Lr=Math.floor,Or=Math.trunc||function(t){var e=+t;return(e>0?Lr:xr)(e)},kr=function(t){var e=+t;return e!=e||0===e?0:Or(e)},Ar=kr,Nr=Math.max,Ur=Math.min,Pr=function(t,e){var n=Ar(t);return n<0?Nr(n+e,0):Ur(n,e)},Mr=kr,jr=Math.min,Vr=function(t){return t>0?jr(Mr(t),9007199254740991):0},Gr=Vr,Hr=function(t){return Gr(t.length)},Br=dt,Fr=Pr,Kr=Hr,zr=function(t){return function(e,n,r){var i,a=Br(e),o=Kr(a),s=Fr(r,o);if(t&&n!=n){for(;o>s;)if((i=a[s++])!=i)return!0}else for(;o>s;s++)if((t||s in a)&&a[s]===n)return t||s||0;return!t&&-1}},Jr={includes:zr(!0),indexOf:zr(!1)},Wr=ve,$r=dt,qr=Jr.indexOf,Yr=zn,Xr=X([].push),Qr=function(t,e){var n,r=$r(t),i=0,a=[];for(n in r)!Wr(Yr,n)&&Wr(r,n)&&Xr(a,n);for(;e.length>i;)Wr(r,n=e[i++])&&(~qr(a,n)||Xr(a,n));return a},Zr=[\"constructor\",\"hasOwnProperty\",\"isPrototypeOf\",\"propertyIsEnumerable\",\"toLocaleString\",\"toString\",\"valueOf\"],ti=Qr,ei=Zr.concat(\"length\",\"prototype\");Sr.f=Object.getOwnPropertyNames||function(t){return ti(t,ei)};var ni={};ni.f=Object.getOwnPropertySymbols;var ri=Ct,ii=Sr,ai=ni,oi=ln,si=X([].concat),ci=ri(\"Reflect\",\"ownKeys\")||function(t){var e=ii.f(oi(t)),n=ai.f;return n?si(e,n(t)):e},li=ve,ui=ci,hi=A,fi=rn,di=N,pi=yt,vi=/#|\\.prototype\\./,gi=function(t,e){var n=Ii[yi(t)];return n===Ei||n!==mi&&(pi(e)?di(e):!!e)},yi=gi.normalize=function(t){return String(t).replace(vi,\".\").toLowerCase()},Ii=gi.data={},mi=gi.NATIVE=\"N\",Ei=gi.POLYFILL=\"P\",_i=gi,Ti=k,Ci=A.f,bi=Cn,Di=wr,Ri=ae,wi=function(t,e,n){for(var r=ui(e),i=fi.f,a=hi.f,o=0;o9007199254740991)throw ki(\"Maximum allowed index exceeded\");return t},Ni=He,Ui=rn,Pi=J,Mi=function(t,e,n){var r=Ni(e);r in t?Ui.f(t,r,Pi(0,n)):t[r]=n},ji={};ji[Le(\"toStringTag\")]=\"z\";var Vi=\"[object z]\"===String(ji),Gi=Vi,Hi=yt,Bi=et,Fi=Le(\"toStringTag\"),Ki=Object,zi=\"Arguments\"===Bi(function(){return arguments}()),Ji=Gi?Bi:function(t){var e,n,r;return void 0===t?\"Undefined\":null===t?\"Null\":\"string\"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Ki(t),Fi))?n:zi?Bi(e):\"Object\"===(r=Bi(e))&&Hi(e.callee)?\"Arguments\":r},Wi=X,$i=N,qi=yt,Yi=Ji,Xi=Mn,Qi=function(){},Zi=[],ta=Ct(\"Reflect\",\"construct\"),ea=/^\\s*(?:class|function)\\b/,na=Wi(ea.exec),ra=!ea.test(Qi),ia=function(t){if(!qi(t))return!1;try{return ta(Qi,Zi,t),!0}catch(t){return!1}},aa=function(t){if(!qi(t))return!1;switch(Yi(t)){case\"AsyncFunction\":case\"GeneratorFunction\":case\"AsyncGeneratorFunction\":return!1}try{return ra||!!na(ea,Xi(t))}catch(t){return!0}};aa.sham=!0;var oa=!ta||$i((function(){var t;return ia(ia.call)||!ia(Object)||!ia((function(){t=!0}))||t}))?aa:ia,sa=Oi,ca=oa,la=Et,ua=Le(\"species\"),ha=Array,fa=function(t){var e;return sa(t)&&(e=t.constructor,(ca(e)&&(e===ha||sa(e.prototype))||la(e)&&null===(e=e[ua]))&&(e=void 0)),void 0===e?ha:e},da=function(t,e){return new(fa(t))(0===e?0:e)},pa=N,va=kt,ga=Le(\"species\"),ya=function(t){return va>=51||!pa((function(){var e=[];return(e.constructor={})[ga]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},Ia=xi,ma=N,Ea=Oi,_a=Et,Ta=fe,Ca=Hr,ba=Ai,Da=Mi,Ra=da,wa=ya,Sa=kt,xa=Le(\"isConcatSpreadable\"),La=Sa>=51||!ma((function(){var t=[];return t[xa]=!1,t.concat()[0]!==t})),Oa=function(t){if(!_a(t))return!1;var e=t[xa];return void 0!==e?!!e:Ea(t)};Ia({target:\"Array\",proto:!0,arity:1,forced:!La||!wa(\"concat\")},{concat:function(t){var e,n,r,i,a,o=Ta(this),s=Ra(o,0),c=0;for(e=-1,r=arguments.length;e1?arguments[1]:void 0;return Za?Qa(this,t,e)||0:Ya(this,t,e)}});var to=$t,eo=P,no=Ja(Ja.bind),ro=function(t,e){return to(t),void 0===e?t:eo?no(t,e):function(){return t.apply(e,arguments)}},io=ro,ao=ot,oo=fe,so=Hr,co=da,lo=X([].push),uo=function(t){var e=1===t,n=2===t,r=3===t,i=4===t,a=6===t,o=7===t,s=5===t||a;return function(c,l,u,h){for(var f,d,p=oo(c),v=ao(p),g=io(l,u),y=so(v),I=0,m=h||co,E=e?m(c,y):n||o?m(c,0):void 0;y>I;I++)if((s||I in v)&&(d=g(f=v[I],I,p),t))if(e)E[I]=d;else if(d)switch(t){case 3:return!0;case 5:return f;case 6:return I;case 2:lo(E,f)}else switch(t){case 4:return!1;case 7:lo(E,f)}return a?-1:r||i?i:E}},ho={forEach:uo(0),map:uo(1),filter:uo(2),some:uo(3),every:uo(4),find:uo(5),findIndex:uo(6),filterReject:uo(7)},fo=ho.filter;xi({target:\"Array\",proto:!0,forced:!ya(\"filter\")},{filter:function(t){return fo(this,t,arguments.length>1?arguments[1]:void 0)}});var po=Ji,vo=Vi?{}.toString:function(){return\"[object \"+po(this)+\"]\"};Vi||wr(Object.prototype,\"toString\",vo,{unsafe:!0});var go=ho.map;xi({target:\"Array\",proto:!0,forced:!ya(\"map\")},{map:function(t){return go(this,t,arguments.length>1?arguments[1]:void 0)}});var yo=xi,Io=Date,mo=X(Io.prototype.getTime);yo({target:\"Date\",stat:!0},{now:function(){return mo(new Io)}});var Eo=U,_o=X,To=V,Co=N,bo=Ha,Do=ni,Ro=G,wo=fe,So=ot,xo=Object.assign,Lo=Object.defineProperty,Oo=_o([].concat),ko=!xo||Co((function(){if(Eo&&1!==xo({b:1},xo(Lo({},\"a\",{enumerable:!0,get:function(){Lo(this,\"b\",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(\"assign detection\"),r=\"abcdefghijklmnopqrst\";return t[n]=7,r.split(\"\").forEach((function(t){e[t]=t})),7!==xo({},t)[n]||bo(xo({},e)).join(\"\")!==r}))?function(t,e){for(var n=wo(t),r=arguments.length,i=1,a=Do.f,o=Ro.f;r>i;)for(var s,c=So(arguments[i++]),l=a?Oo(bo(c),a(c)):bo(c),u=l.length,h=0;u>h;)s=l[h++],Eo&&!To(o,c,s)||(n[s]=c[s]);return n}:xo,Ao=ko;xi({target:\"Object\",stat:!0,arity:2,forced:Object.assign!==Ao},{assign:Ao});var No,Uo,Po,Mo,jo=\"process\"===et(k.process),Vo=X,Go=$t,Ho=yt,Bo=String,Fo=TypeError,Ko=function(t,e,n){try{return Vo(Go(Object.getOwnPropertyDescriptor(t,e)[n]))}catch(t){}},zo=ln,Jo=function(t){if(\"object\"==typeof t||Ho(t))return t;throw new Fo(\"Can't set \"+Bo(t)+\" as a prototype\")},Wo=Object.setPrototypeOf||(\"__proto__\"in{}?function(){var t,e=!1,n={};try{(t=Ko(Object.prototype,\"__proto__\",\"set\"))(n,[]),e=n instanceof Array}catch(t){}return function(n,r){return zo(n),Jo(r),e?t(n,r):n.__proto__=r,n}}():void 0),$o=rn.f,qo=ve,Yo=Le(\"toStringTag\"),Xo=function(t,e,n){t&&!n&&(t=t.prototype),t&&!qo(t,Yo)&&$o(t,Yo,{configurable:!0,value:e})},Qo=bn.exports,Zo=rn,ts=function(t,e,n){return n.get&&Qo(n.get,e,{getter:!0}),n.set&&Qo(n.set,e,{setter:!0}),Zo.f(t,e,n)},es=Ct,ns=ts,rs=U,is=Le(\"species\"),as=function(t){var e=es(t);rs&&e&&!e[is]&&ns(e,is,{configurable:!0,get:function(){return this}})},os=bt,ss=TypeError,cs=function(t,e){if(os(e,t))return t;throw new ss(\"Incorrect invocation\")},ls=oa,us=Kt,hs=TypeError,fs=ln,ds=function(t){if(ls(t))return t;throw new hs(us(t)+\" is not a constructor\")},ps=st,vs=Le(\"species\"),gs=P,ys=Function.prototype,Is=ys.apply,ms=ys.call,Es=\"object\"==typeof Reflect&&Reflect.apply||(gs?ms.bind(Is):function(){return ms.apply(Is,arguments)}),_s=Ct(\"document\",\"documentElement\"),Ts=X([].slice),Cs=TypeError,bs=function(t,e){if(ta;a++)if((s=y(t[a]))&&Iu(bu,s))return s;return new Cu(!1)}r=mu(t,i)}for(c=f?t.next:r.next;!(l=du(c,r)).done;){try{s=y(l.value)}catch(t){_u(r,\"throw\",t)}if(\"object\"==typeof s&&s&&Iu(bu,s))return s}return new Cu(!1)},Ru=Le(\"iterator\"),wu=!1;try{var Su=0,xu={next:function(){return{done:!!Su++}},return:function(){wu=!0}};xu[Ru]=function(){return this},Array.from(xu,(function(){throw 2}))}catch(t){}var Lu=function(t,e){try{if(!e&&!wu)return!1}catch(t){return!1}var n=!1;try{var r={};r[Ru]=function(){return{next:function(){return{done:n=!0}}}},t(r)}catch(t){}return n},Ou=wc,ku=Fc.CONSTRUCTOR||!Lu((function(t){Ou.all(t).then(void 0,(function(){}))})),Au=V,Nu=$t,Uu=Kc,Pu=Rc,Mu=Du;xi({target:\"Promise\",stat:!0,forced:ku},{all:function(t){var e=this,n=Uu.f(e),r=n.resolve,i=n.reject,a=Pu((function(){var n=Nu(e.resolve),a=[],o=0,s=1;Mu(t,(function(t){var c=o++,l=!1;s++,Au(n,e,t).then((function(t){l||(l=!0,a[c]=t,--s||r(a))}),i)})),--s||r(a)}));return a.error&&i(a.value),n.promise}});var ju=xi,Vu=Fc.CONSTRUCTOR,Gu=wc,Hu=Ct,Bu=yt,Fu=wr,Ku=Gu&&Gu.prototype;if(ju({target:\"Promise\",proto:!0,forced:Vu,real:!0},{catch:function(t){return this.then(void 0,t)}}),Bu(Gu)){var zu=Hu(\"Promise\").prototype.catch;Ku.catch!==zu&&Fu(Ku,\"catch\",zu,{unsafe:!0})}var Ju=V,Wu=$t,$u=Kc,qu=Rc,Yu=Du;xi({target:\"Promise\",stat:!0,forced:ku},{race:function(t){var e=this,n=$u.f(e),r=n.reject,i=qu((function(){var i=Wu(e.resolve);Yu(t,(function(t){Ju(i,e,t).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Xu=V,Qu=Kc;xi({target:\"Promise\",stat:!0,forced:Fc.CONSTRUCTOR},{reject:function(t){var e=Qu.f(this);return Xu(e.reject,void 0,t),e.promise}});var Zu=ln,th=Et,eh=Kc,nh=xi,rh=Fc.CONSTRUCTOR,ih=function(t,e){if(Zu(t),th(e)&&e.constructor===t)return e;var n=eh.f(t);return(0,n.resolve)(e),n.promise};Ct(\"Promise\"),nh({target:\"Promise\",stat:!0,forced:rh},{resolve:function(t){return ih(this,t)}});var ah=\"function\"==typeof Bun&&Bun&&\"string\"==typeof Bun.version,oh=k,sh=Es,ch=yt,lh=ah,uh=Dt,hh=Ts,fh=bs,dh=oh.Function,ph=/MSIE .\\./.test(uh)||lh&&function(){var t=oh.Bun.version.split(\".\");return t.length<3||\"0\"===t[0]&&(t[1]<3||\"3\"===t[1]&&\"0\"===t[2])}(),vh=function(t,e){var n=e?2:1;return ph?function(r,i){var a=fh(arguments.length,1)>n,o=ch(r)?r:dh(r),s=a?hh(arguments,n):[],c=a?function(){sh(o,this,s)}:o;return e?t(c,i):t(c)}:t},gh=xi,yh=k,Ih=vh(yh.setInterval,!0);gh({global:!0,bind:!0,forced:yh.setInterval!==Ih},{setInterval:Ih});var mh=xi,Eh=k,_h=vh(Eh.setTimeout,!0);mh({global:!0,bind:!0,forced:Eh.setTimeout!==_h},{setTimeout:_h});var Th=Ji,Ch=String,bh=function(t){if(\"Symbol\"===Th(t))throw new TypeError(\"Cannot convert a Symbol value to a string\");return Ch(t)},Dh=X,Rh=kr,wh=bh,Sh=ut,xh=Dh(\"\".charAt),Lh=Dh(\"\".charCodeAt),Oh=Dh(\"\".slice),kh=function(t){return function(e,n){var r,i,a=wh(Sh(e)),o=Rh(n),s=a.length;return o<0||o>=s?t?\"\":void 0:(r=Lh(a,o))<55296||r>56319||o+1===s||(i=Lh(a,o+1))<56320||i>57343?t?xh(a,o):r:t?Oh(a,o,o+2):i-56320+(r-55296<<10)+65536}},Ah={codeAt:kh(!1),charAt:kh(!0)},Nh={},Uh=U,Ph=an,Mh=rn,jh=ln,Vh=dt,Gh=Ha;Nh.f=Uh&&!Ph?Object.defineProperties:function(t,e){jh(t);for(var n,r=Vh(e),i=Gh(e),a=i.length,o=0;a>o;)Mh.f(t,n=i[o++],r[n]);return t};var Hh,Bh=ln,Fh=Nh,Kh=Zr,zh=zn,Jh=_s,Wh=ze,$h=\"prototype\",qh=\"script\",Yh=Kn(\"IE_PROTO\"),Xh=function(){},Qh=function(t){return\"<\"+qh+\">\"+t+\"\"},Zh=function(t){t.write(Qh(\"\")),t.close();var e=t.parentWindow.Object;return t=null,e},tf=function(){try{Hh=new ActiveXObject(\"htmlfile\")}catch(t){}var t,e,n;tf=\"undefined\"!=typeof document?document.domain&&Hh?Zh(Hh):(e=Wh(\"iframe\"),n=\"java\"+qh+\":\",e.style.display=\"none\",Jh.appendChild(e),e.src=String(n),(t=e.contentWindow.document).open(),t.write(Qh(\"document.F=Object\")),t.close(),t.F):Zh(Hh);for(var r=Kh.length;r--;)delete tf[$h][Kh[r]];return tf()};zh[Yh]=!0;var ef,nf,rf,af=Object.create||function(t,e){var n;return null!==t?(Xh[$h]=Bh(t),n=new Xh,Xh[$h]=null,n[Yh]=t):n=tf(),void 0===e?n:Fh.f(n,e)},of=!N((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),sf=ve,cf=yt,lf=fe,uf=of,hf=Kn(\"IE_PROTO\"),ff=Object,df=ff.prototype,pf=uf?ff.getPrototypeOf:function(t){var e=lf(t);if(sf(e,hf))return e[hf];var n=e.constructor;return cf(n)&&e instanceof n?n.prototype:e instanceof ff?df:null},vf=N,gf=yt,yf=Et,If=pf,mf=wr,Ef=Le(\"iterator\"),_f=!1;[].keys&&(\"next\"in(rf=[].keys())?(nf=If(If(rf)))!==Object.prototype&&(ef=nf):_f=!0);var Tf=!yf(ef)||vf((function(){var t={};return ef[Ef].call(t)!==t}));Tf&&(ef={}),gf(ef[Ef])||mf(ef,Ef,(function(){return this}));var Cf={IteratorPrototype:ef,BUGGY_SAFARI_ITERATORS:_f},bf=Cf.IteratorPrototype,Df=af,Rf=J,wf=Xo,Sf=Kl,xf=function(){return this},Lf=xi,Of=V,kf=yt,Af=function(t,e,n,r){var i=e+\" Iterator\";return t.prototype=Df(bf,{next:Rf(+!r,n)}),wf(t,i,!1),Sf[i]=xf,t},Nf=pf,Uf=Wo,Pf=Xo,Mf=Cn,jf=wr,Vf=Kl,Gf=Ln.PROPER,Hf=Ln.CONFIGURABLE,Bf=Cf.IteratorPrototype,Ff=Cf.BUGGY_SAFARI_ITERATORS,Kf=Le(\"iterator\"),zf=\"keys\",Jf=\"values\",Wf=\"entries\",$f=function(){return this},qf=function(t,e,n,r,i,a,o){Af(n,e,r);var s,c,l,u=function(t){if(t===i&&v)return v;if(!Ff&&t&&t in d)return d[t];switch(t){case zf:case Jf:case Wf:return function(){return new n(this,t)}}return function(){return new n(this)}},h=e+\" Iterator\",f=!1,d=t.prototype,p=d[Kf]||d[\"@@iterator\"]||i&&d[i],v=!Ff&&p||u(i),g=\"Array\"===e&&d.entries||p;if(g&&(s=Nf(g.call(new t)))!==Object.prototype&&s.next&&(Nf(s)!==Bf&&(Uf?Uf(s,Bf):kf(s[Kf])||jf(s,Kf,$f)),Pf(s,h,!0)),Gf&&i===Jf&&p&&p.name!==Jf&&(Hf?Mf(d,\"name\",Jf):(f=!0,v=function(){return Of(p,this)})),i)if(c={values:u(Jf),keys:a?v:u(zf),entries:u(Wf)},o)for(l in c)(Ff||f||!(l in d))&&jf(d,l,c[l]);else Lf({target:e,proto:!0,forced:Ff||f},c);return d[Kf]!==v&&jf(d,Kf,v,{name:i}),Vf[e]=v,c},Yf=function(t,e){return{value:t,done:e}},Xf=Ah.charAt,Qf=bh,Zf=ar,td=qf,ed=Yf,nd=\"String Iterator\",rd=Zf.set,id=Zf.getterFor(nd);td(String,\"String\",(function(t){rd(this,{type:nd,string:Qf(t),index:0})}),(function(){var t,e=id(this),n=e.string,r=e.index;return r>=n.length?ed(void 0,!0):(t=Xf(n,r),e.index+=t.length,ed(t,!1))}));var ad=Le,od=af,sd=rn.f,cd=ad(\"unscopables\"),ld=Array.prototype;void 0===ld[cd]&&sd(ld,cd,{configurable:!0,value:od(null)});var ud=function(t){ld[cd][t]=!0},hd=dt,fd=ud,dd=Kl,pd=ar,vd=rn.f,gd=qf,yd=Yf,Id=U,md=\"Array Iterator\",Ed=pd.set,_d=pd.getterFor(md),Td=gd(Array,\"Array\",(function(t,e){Ed(this,{type:md,target:hd(t),index:0,kind:e})}),(function(){var t=_d(this),e=t.target,n=t.index++;if(!e||n>=e.length)return t.target=void 0,yd(void 0,!0);switch(t.kind){case\"keys\":return yd(n,!1);case\"values\":return yd(e[n],!1)}return yd([n,e[n]],!1)}),\"values\"),Cd=dd.Arguments=dd.Array;if(fd(\"keys\"),fd(\"values\"),fd(\"entries\"),Id&&\"values\"!==Cd.name)try{vd(Cd,\"name\",{value:\"values\"})}catch(t){}var bd={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Dd=ze(\"span\").classList,Rd=Dd&&Dd.constructor&&Dd.constructor.prototype,wd=Rd===Object.prototype?void 0:Rd,Sd=k,xd=bd,Ld=wd,Od=Td,kd=Cn,Ad=Le,Nd=Ad(\"iterator\"),Ud=Ad(\"toStringTag\"),Pd=Od.values,Md=function(t,e){if(t){if(t[Nd]!==Pd)try{kd(t,Nd,Pd)}catch(e){t[Nd]=Pd}if(t[Ud]||kd(t,Ud,e),xd[e])for(var n in Od)if(t[n]!==Od[n])try{kd(t,n,Od[n])}catch(e){t[n]=Od[n]}}};for(var jd in xd)Md(Sd[jd]&&Sd[jd].prototype,jd);Md(Ld,\"DOMTokenList\");var Vd=xi,Gd=Oi,Hd=oa,Bd=Et,Fd=Pr,Kd=Hr,zd=dt,Jd=Mi,Wd=Le,$d=Ts,qd=ya(\"slice\"),Yd=Wd(\"species\"),Xd=Array,Qd=Math.max;Vd({target:\"Array\",proto:!0,forced:!qd},{slice:function(t,e){var n,r,i,a=zd(this),o=Kd(a),s=Fd(t,o),c=Fd(void 0===e?o:e,o);if(Gd(a)&&(n=a.constructor,(Hd(n)&&(n===Xd||Gd(n.prototype))||Bd(n)&&null===(n=n[Yd]))&&(n=void 0),n===Xd||void 0===n))return $d(a,s,c);for(r=new(void 0===n?Xd:n)(Qd(c-s,0)),i=0;s1?arguments[1]:void 0)};xi({target:\"Array\",proto:!0,forced:[].forEach!==tp},{forEach:tp});var ep=k,np=bd,rp=wd,ip=tp,ap=Cn,op=function(t){if(t&&t.forEach!==ip)try{ap(t,\"forEach\",ip)}catch(e){t.forEach=ip}};for(var sp in np)np[sp]&&op(ep[sp]&&ep[sp].prototype);op(rp);var cp=ln,lp=hu,up=ro,hp=V,fp=fe,dp=function(t,e,n,r){try{return r?e(cp(n)[0],n[1]):e(n)}catch(e){lp(t,\"throw\",e)}},pp=$l,vp=oa,gp=Hr,yp=Mi,Ip=su,mp=tu,Ep=Array,_p=function(t){var e=fp(t),n=vp(this),r=arguments.length,i=r>1?arguments[1]:void 0,a=void 0!==i;a&&(i=up(i,r>2?arguments[2]:void 0));var o,s,c,l,u,h,f=mp(e),d=0;if(!f||this===Ep&&pp(f))for(o=gp(e),s=n?new this(o):Ep(o);o>d;d++)h=a?i(e[d],d):e[d],yp(s,d,h);else for(u=(l=Ip(e,f)).next,s=n?new this:[];!(c=hp(u,l)).done;d++)h=a?dp(l,i,[c.value,d],!0):c.value,yp(s,d,h);return s.length=d,s};xi({target:\"Array\",stat:!0,forced:!Lu((function(t){Array.from(t)}))},{from:_p});var Tp={exports:{}},Cp={},bp=Pr,Dp=Hr,Rp=Mi,wp=Array,Sp=Math.max,xp=et,Lp=dt,Op=Sr.f,kp=function(t,e,n){for(var r=Dp(t),i=bp(e,r),a=bp(void 0===n?r:n,r),o=wp(Sp(a-i,0)),s=0;i1?arguments[1]:void 0);e=e?e.next:n.first;)for(r(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!c(this,t)}}),wv(a,n?{get:function(t){var e=c(this,t);return e&&e.value},set:function(t,e){return s(this,0===t?0:t,e)}}:{add:function(t){return s(this,t=0===t?0:t,t)}}),Uv&&Rv(a,\"size\",{configurable:!0,get:function(){return o(this).size}}),i},setStrong:function(t,e,n){var r=e+\" Iterator\",i=jv(e),a=jv(r);kv(t,e,(function(t,e){Mv(this,{type:r,target:t,state:i(t),kind:e,last:void 0})}),(function(){for(var t=a(this),e=t.kind,n=t.last;n&&n.removed;)n=n.previous;return t.target&&(t.last=n=n?n.next:t.state.first)?Av(\"keys\"===e?n.key:\"values\"===e?n.value:[n.key,n.value],!1):(t.target=void 0,Av(void 0,!0))}),n?\"entries\":\"values\",!n,!0),Nv(e)}};Tv(\"Set\",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Vv);var Gv=U,Hv=Oi,Bv=TypeError,Fv=Object.getOwnPropertyDescriptor,Kv=Gv&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],\"length\",{writable:!1}).length=1}catch(t){return t instanceof TypeError}}()?function(t,e){if(Hv(t)&&!Fv(t,\"length\").writable)throw new Bv(\"Cannot set read only .length\");return t.length=e}:function(t,e){return t.length=e},zv=Kt,Jv=TypeError,Wv=xi,$v=fe,qv=Pr,Yv=kr,Xv=Hr,Qv=Kv,Zv=Ai,tg=da,eg=Mi,ng=function(t,e){if(!delete t[e])throw new Jv(\"Cannot delete property \"+zv(e)+\" of \"+zv(t))},rg=ya(\"splice\"),ig=Math.max,ag=Math.min;Wv({target:\"Array\",proto:!0,forced:!rg},{splice:function(t,e){var n,r,i,a,o,s,c=$v(this),l=Xv(c),u=qv(t,l),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=l-u):(n=h-2,r=ag(ig(Yv(e),0),l-u)),Zv(l+n-r),i=tg(c,r),a=0;al-r+n;a--)ng(c,a-1)}else if(n>r)for(a=l-r;a>u;a--)s=a+n-1,(o=a+r-1)in c?c[s]=c[o]:ng(c,s);for(a=0;a 标签),请使用真机调试或者扫码预览。\",Og={RECORD:\"scope.record\",CAMERA:\"scope.camera\"},kg=\"https://buy.cloud.tencent.com/avc?addRavLicense=1\",Ag=\"https://buy.tencentcloud.com/avc?addRavLicense=1\",Ng=1,Ug=9,Pg=17,Mg=18,jg=21,Vg=15,Gg=\"\\t\\n\\v\\f\\r                 \\u2028\\u2029\\ufeff\",Hg=ut,Bg=bh,Fg=Gg,Kg=X(\"\".replace),zg=RegExp(\"^[\"+Fg+\"]+\"),Jg=RegExp(\"(^|[^\"+Fg+\"])[\"+Fg+\"]+$\"),Wg=function(t){return function(e){var n=Bg(Hg(e));return 1&t&&(n=Kg(n,zg,\"\")),2&t&&(n=Kg(n,Jg,\"$1\")),n}},$g={start:Wg(1),end:Wg(2),trim:Wg(3)},qg=k,Yg=N,Xg=X,Qg=bh,Zg=$g.trim,ty=Gg,ey=qg.parseInt,ny=qg.Symbol,ry=ny&&ny.iterator,iy=/^[+-]?0x/i,ay=Xg(iy.exec),oy=8!==ey(ty+\"08\")||22!==ey(ty+\"0x16\")||ry&&!Yg((function(){ey(Object(ry))}))?function(t,e){var n=Zg(Qg(t));return ey(n,e>>>0||(ay(iy,n)?16:10))}:ey;function sy(t){var e=new Date(t);return\"\".concat(e.getFullYear(),\"-\")+\"\".concat(e.getMonth()+1<10?\"0\".concat(e.getMonth()+1):e.getMonth()+1,\"-\")+cy(e.getDate(),\" \")+cy(e.getHours(),\":\")+cy(e.getMinutes(),\":\")+cy(e.getSeconds(),\"\")}function cy(t,e){return\"\".concat(t<10?\"0\".concat(t).concat(e):\"\".concat(t).concat(e))}xi({global:!0,forced:parseInt!==oy},{parseInt:oy});var ly={exports:{}};self;var uy=L(ly.exports=(()=>(()=>{var t={530:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]{Object.defineProperty(e,\"__esModule\",{value:!0}),e.formatClsLog=void 0;var r=n(928);e.formatClsLog=function(){return function(t,e){try{e({logs:null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else\"time\"===n&&(e[n]=new Date(t[n]).toISOString()),e[n]=t[n]+\"\"})),{contents:e,time:t.time}})),source:\"\"})}catch(t){console.debug(t)}}}},597:(t,e,n)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.formatESLog=void 0;var r=n(928);e.formatESLog=function(t){var e=t.table;return function(t,n){try{var i=null==t?void 0:t.map((function(t){var e={};return Object.keys(t).forEach((function(n){if((0,r.isPlainObject)(t[n]))try{e[n]=(0,r.stringifyPlus)(t[n])}catch(t){console.debug(t)}else e[n]=\"level\"===n?t[n]+\"\":\"time\"===n?new Date(t[n]).toISOString():t[n]})),e}));n({table:e,report:i})}catch(t){console.debug(t)}}}},150:(t,e,n)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.formatClsLog=e.formatESLog=void 0;var r=n(314);Object.defineProperty(e,\"formatClsLog\",{enumerable:!0,get:function(){return r.formatClsLog}});var i=n(597);Object.defineProperty(e,\"formatESLog\",{enumerable:!0,get:function(){return i.formatESLog}})},757:(t,e,n)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.createPipeline=void 0;var r=n(928);e.createPipeline=function(t){if(!t||!t.reduce||!t.length)throw new TypeError(\"createPipeline need at least one function param\");return 1===t.length?function(e,n){t[0](e,n||r.noop)}:t.reduce((function(t,e){return function(n,i){return void 0===i&&(i=r.noop),t(n,(function(t){return null==e?void 0:e(t,i)}))}}))}},758:(t,e,n)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.limitLengthPipe=e.MAX_LOG_LENGTH=void 0;var r=n(928);e.MAX_LOG_LENGTH=102400,e.limitLengthPipe=function(){return function(t,n){try{var i=(t=t||{}).logs,a=void 0===i?[]:i;t.logs=null==a?void 0:a.map((function(t){var n=e.MAX_LOG_LENGTH,i=t.contents;return Object.keys(i).forEach((function(t){var e=i[t];try{e&&e.length>n&&(i[t]=null==e?void 0:e.substring(0,n))}catch(a){console.debug(\"size of content > limitSize\"),i[t]=(0,r.stringifyPlus)(e).substring(0,n)}})),t})),n(t)}catch(t){console.debug(t)}}}},23:(t,e)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.createThrottlePipe=void 0,e.createThrottlePipe=function(t,e){var n,r=[];return function(i,a){if(Array.isArray(i)?r=r.concat(i):r.push(i),e&&r.length>=e||t.sendNow&&r.length>0)return a(r.splice(0,r.length)),void(n&&clearTimeout(n));n&&clearTimeout(n),n=setTimeout((function(){n=null,r.length>0&&a(r.splice(0,r.length))}),t.delay||1e3)}}},434:function(t,e,n){var r=this&&this.__assign||function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,3];case 2:return n.sent(),[3,1];case 3:return s++,[4,new Promise((function(e,n){wx.request(r(r({},t),{success:function(t){e(t)},fail:function(t){n(t)}}))}))];case 4:return[2,n.sent()];case 5:return e=n.sent(),[2,Promise.reject(e)];case 6:return s--,(0,o.resolveFirstBlock)(),[7];case 7:return[2]}}))}))}},310:function(t,e,n){var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,a){function o(t){try{c(r.next(t))}catch(t){a(t)}}function s(t){try{c(r.throw(t))}catch(t){a(t)}}function c(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(o,s)}c((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},\"function\"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError(\"Generator is already executing.\");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!((i=(i=o.trys).length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=2?[4,(0,o.startBlocking)()]:[3,2];case 1:return i.sent(),[3,0];case 2:return s++,r=n.method,u=n.headers,f=void 0===u?{}:u,d=n.responseType,p=void 0===d?\"json\":d,r=(r||\"get\").toUpperCase(),Object.assign(f,{\"Content-type\":\"application/json\"}),(v=new window.XMLHttpRequest).responseType=p,v.timeout=1e4,v.onreadystatechange=function(){4===v.readyState&&(200===v.status?l({data:v.response}):h({code:v.status,msg:v.statusText}))},v.ontimeout=function(t){h({code:v.status,msg:v.statusText})},v.onloadend=function(){v&&(c((function(t){l(t)}),(function(t){h(t)}),{status:v.status,statusText:v.statusText}),v=null)},v.onabort=function(){v&&(h(new Error(\"Request aborted\")),v=null)},v.onerror=function(){h(new Error(\"Network Error\")),v=null},\"GET\"===r?t=\"url\".concat(-1===t.indexOf(\"?\")?\"?\":\"&\").concat(a.default.stringify(e)):\"POST\"===r&&(e=JSON.stringify(e)),v.open(r,t,!0),Object.keys(f).forEach((function(t){v.setRequestHeader(t,f[t])})),v.send(\"POST\"===r?e:null),[2]}}))}))}))];case 1:return[2,h.sent()];case 2:throw l=h.sent(),new Error(l);case 3:return s--,(0,o.resolveFirstBlock)(),[7];case 4:return[2]}}))}))}},928:(t,e)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.date2ISOString=e.stringifyPlus=e.noop=e.isBrowser=e.isMiniProgram=e.isPlainObject=e.appendParams=void 0,e.appendParams=function(t,n){void 0===n&&(n={});var r=[];return Object.keys(n).forEach((function(t){var i=n[t];if(void 0!==i){if((0,e.isPlainObject)(i))try{i=JSON.stringify(i)}catch(t){}r.push(\"\".concat(t,\"=\").concat(encodeURIComponent(i)))}})),r.length?(t.indexOf(\"?\")>-1?\"\".concat(t,\"&\"):\"\".concat(t,\"?\"))+r.join(\"&\"):t},e.isPlainObject=function(t){if(\"object\"!=typeof t||null===t)return!1;var e=Object.getPrototypeOf(t);if(null===e)return!0;for(var n=e;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return e===n},e.isMiniProgram=function(){try{return!(!(null===wx||void 0===wx?void 0:wx.request)||!(null===wx||void 0===wx?void 0:wx.connectSocket))}catch(t){return!1}},e.isBrowser=function(){try{return!(0,e.isMiniProgram)()&&\"undefined\"!=typeof window&&void 0!==window.document}catch(t){return!1}},e.noop=function(){};var n=function(){var t=new WeakSet;return function(e,n){if(n instanceof Error)return\"Error.message: \".concat(n.message,\" \\n Error.stack: \").concat(n.stack);if(\"object\"==typeof n&&null!==n){if(t.has(n))return\"[Circular \".concat(e||\"root\",\"]\");t.add(n)}return n}};e.stringifyPlus=function(t){if(\"string\"==typeof t)return t;try{return t instanceof Error?(JSON.stringify(t,n())||\"undefined\").replace(/\"/gim,\"\"):JSON.stringify(t,n())||\"undefined\"}catch(t){return\"error happen when aegis stringify: \\n \".concat(t.message,\" \\n \").concat(t.stack)}},e.date2ISOString=function(){var t,e=new Date,n=e.toISOString(),r=e.getTimezoneOffset()/60;return t=r<0?r>-10?\"+0\".concat(Math.abs(100*r)):\"+\".concat(Math.abs(100*r)):r>=10?\"-\".concat(100*r):\"-0\".concat(100*r),n.replace(\"Z\",t)}},580:(t,e,n)=>{Object.defineProperty(e,\"__esModule\",{value:!0});var r=n(928);e.default={stringify:function(t){return t?Object.keys(t).map((function(e){var n=t[e];if((0,r.isPlainObject)(n))n=JSON.stringify(n);else{if(\"string\"!=typeof n&&\"number\"!=typeof n)return\"\";n=+n}return encodeURIComponent(e)+\"=\"+encodeURIComponent(n)})).filter((function(t){return t.length>0})).join(\"&\"):\"\"}}},690:(t,e)=>{Object.defineProperty(e,\"__esModule\",{value:!0}),e.startBlocking=e.resolveFirstBlock=void 0;var n=[];e.startBlocking=function(){var t,e=new Promise((function(e){t=e}));return n.push({promise:e,resolve:t}),e},e.resolveFirstBlock=function(){n.length&&(n[0].resolve(),n.shift())}}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var a=e[r]={exports:{}};return t[r].call(a.exports,a,a.exports,n),a.exports}var r={};return(()=>{var t=r;Object.defineProperty(t,\"__esModule\",{value:!0});var e=n(530),i={debug:console.debug,info:console.info,warn:console.warn,error:console.error,updateGetReportData:function(t){console.debug(t)}},a=null;t.default=function(t){if(!a){var n=t||{},r=n.clsConfig,o=(n.esConfig,r.endpoint),s=r.topicId;if(!o||!s)return console.debug(\"endpoint and topicId must not be null\"),i;a=new e.default(t)}return a}})(),r})())()),hy=U,fy=Ln.EXISTS,dy=X,py=ts,vy=Function.prototype,gy=dy(vy.toString),yy=/function\\b(?:\\s|\\/\\*[\\S\\s]*?\\*\\/|\\/\\/[^\\n\\r]*[\\n\\r]+)*([^\\s(/]*)/,Iy=dy(yy.exec);hy&&!fy&&py(vy,\"name\",{configurable:!0,get:function(){try{return Iy(yy,gy(this))[1]}catch(t){return\"\"}}});var my={UNKNOWN:65535,NO_NETWORK:2805,FAILURE_SWITCH_TO_AUDIO:60001,FAILURE_SWITCH_TO_VIDEO:60002,ERROR_PACKAGE_NOT_PURCHASED:-1001,ERROR_PACKAGE_NOT_SUPPORTED:-1002,ERROR_TIM_VERSION_OUTDATED:-1003,ERROR_PERMISSION_DENIED:-1101,ERROR_GET_DEVICE_LIST_FAIL:-1102,ERROR_INIT_FAIL:-1201,ERROR_PARAM_INVALID:-1202,ERROR_REQUEST_REFUSED:-1203,ERROR_REQUEST_REPEATED:-1204,ERROR_SCENE_NOT_SUPPORTED:-1205,ERROR_SIGNALING_SEND_FAIL:-1401,ERROR_INVALID_INVITEID:8010,ERROR_INVALID_SEND_FAIL:20003,ERROR_BLACKLIST:20007},Ey=\"未连接到网络\",_y=\"You do not have TUICallKit package, please open the free experience in the console: https://console.intl.cloud.tencent.com/im/detail or purchase the official package: ${purchaseAddress}\",Ty=\"The package you purchased does not support this ability. You can refer to here to purchase: ${purchaseAddress}\",Cy=\"TIM SDK version is too old. Please upgrade version\",by=\"init is not complete, this API needs to be used after init. To solve the problem, please go to: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887\",Dy=\"The API is support use in the state of. Please go to: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42\",Ry={NO_NETWORK:\"未连接到网络\",FAILURE_SWITCH_TO_AUDIO:\"切换语音通话失败\",FAILURE_SWITCH_TO_VIDEO:\"切换视频通话失败\",ERROR_NULL:\"成功\",ERROR_PACKAGE_NOT_PURCHASED:\"您的应用还未开通音视频通话(TUICallKit)能力,您可以去控制台申请免费体验: https://console.cloud.tencent.com/im/detail 或购买通话能力套餐包: ${purchaseAddress}\",ERROR_PACKAGE_NOT_SUPPORTED:\"您暂不支持使用该能力,请前往如下购买页购买开通: ${purchaseAddress}\",ERROR_TIM_VERSION_OUTDATED:\"TIM SDK 版本太旧,请升级版本\",ERROR_PERMISSION_DENIED:\"摄像头/麦克风权限被拒绝。解决方案请前往: https://cloud.tencent.com/document/product/647/78770\",ERROR_GET_DEVICE_LIST_FAIL:\"获取设备列表失败\",ERROR_INIT_FAIL:\"TUICallEngine init 未完成,需要在 init 完成后使用此 API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#3a61f42b-e06f-49af-88bf-362d40025887\",ERROR_REQUEST_REFUSED:\"当前通话状态无法使用该API。解决方案请前往: https://cloud.tencent.com/document/product/647/78769#5e65043d-e3dc-4bd3-8220-3ac7694dfa42\",ERROR_REQUEST_REPEATED:\"当前方法正在执行中,请勿重复调用\",ERROR_REQUEST_REPEATED_SWITCH:\"与当前通话类型一致,请勿重复切换\",ERROR_SCENE_NOT_SUPPORTED:\"当前通话场景不支持该功能\",ERROR_SIGNALING_SEND_FAIL:\"信令发送失败\",ERROR_INVALID_INVITEID:\"inviteID 无效或邀请已处理。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#e97ea97b-7812-42ed-89b7-2a3840ac0e3f\",ERROR_INVALID_SEND_FAIL:\"消息发送方或接收方 UserID 无效或不存在。解决方案请前往: https://cloud.tencent.com/document/product/647/84363#661be1b0-f649-4199-a343-958c3f4f4bbb\",ERROR_PARAM_INVALID:\"参数错误\"},wy=function(t){d(n,I(Error));var e=_(n);function n(t){var r,i=t.message,a=t.code,o=void 0===a?my.UNKNOWN:a;return l(this,n),r=e.call(this,\"\".concat(i).concat(function(t){for(var e=0,n=Object.keys(Ry);e\")),r.code=o,r.name=\"TUICallEngineError\",r.message_=i,r}return h(n,[{key:\"getCode\",value:function(){return this.code}}]),n}(),Sy=[\"inviteID\",\"type\"],xy=function(){function t(e){l(this,t),this.TSignaling=e.TSignaling,this._logger=uy()}var e,n,r,o,s,u,f;return h(t,[{key:\"handleNewSignaling\",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:\"\";return this._logger.info(\"TSignaling.handleNewSignaling.start\",{text:{data:{data:t,params:e,userData:n}},type:\"api\"}),i(i({userData:n||\"\"},t),{},{version:4,businessID:\"av_call\",platform:\"MiniApp\",data:i({cmd:Tg[t.call_type],room_id:t.room_id,message:\"\"},e)})}},{key:\"extractCallingInfoFromMessage\",value:function(t){if(!t||\"TIMCustomElem\"!==t.type)return\"\";var e=JSON.parse(t.payload.data);if(e.businessID!==pg)return\"\";switch(e.actionType){case lg:var n=JSON.parse(e.data);return n.call_end>0&&!e.groupID?n.call_end:0!==n.call_end&&n.room_id?\"发起通话\":\"结束群聊\";case ug:return\"取消通话\";case hg:return\"已接听\";case fg:return\"拒绝通话\";case dg:return\"无应答\";default:return\"\"}}},{key:\"handleError\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.code,n=void 0===e?\"\":e,r=t.message;if(n)throw new wy({message:void 0===r?\"\":r,code:n})}},{key:\"_handleInviteData\",value:function(t){var e=t.type,n=t.roomID,r=t.userIDList,i=t.hangup,a=t.switchMode,o=t.userData;if(i)return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:i.callEnd},{cmd:\"hangup\"}));if(a){var s={version:0,call_type:e,room_id:n},c={cmd:\"switchToVideo\"};return a===Cg&&(s.switch_to_audio_call=\"switch_to_audio_call\",c.cmd=\"switchToAudio\"),JSON.stringify(this.handleNewSignaling(s,c))}return JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n},{userIDs:r},o))}},{key:\"_handleInviteGroupData\",value:function(t){var e=t.type,n=t.roomID,r=t.hangup,i=t.userData;return r?JSON.stringify(this.handleNewSignaling({version:0,call_type:e,call_end:r.call_end},{cmd:\"hangup\"},i)):JSON.stringify(this.handleNewSignaling({version:0,call_type:e,room_id:n}))}},{key:\"invite\",value:(f=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"TSignaling.invite.start\",{text:{data:{params:e}},type:\"api\"}),n=e.userID,r=e.offlinePushInfo,i=e.hangup,o=e.switchMode,t.prev=2,t.next=5,this.TSignaling.invite({userID:n,data:this._handleInviteData(e),timeout:i?0:30,offlinePushInfo:r});case 5:return t.abrupt(\"return\",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error(\"TSignaling.invite.fail\",{text:{data:{hangup:i,switchMode:o},error:t.t0},type:\"api\"}),!i){t.next=13;break}return t.abrupt(\"return\",this.handleError(t.t0,\"hangup C2C\"));case 13:if(!o){t.next=15;break}return t.abrupt(\"return\",this.handleError(t.t0,o));case 15:return t.abrupt(\"return\",this.handleError(t.t0,\"invite\"));case 16:case\"end\":return t.stop()}}),t,this,[[2,8]])}))),function(t){return f.apply(this,arguments)})},{key:\"inviteGroup\",value:(u=c(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"TSignaling.inviteGroup.start\",{text:{data:{params:e}},type:\"api\"}),n=e.groupID,r=e.userIDList,i=e.offlinePushInfo,o=e.hangup,s=e.inCallUserIDs,c=void 0===s?[]:s,t.prev=2,t.next=5,this.TSignaling.inviteInGroup({groupID:n,inviteeList:r,timeout:o?0:30,data:this._handleInviteGroupData(e),offlinePushInfo:i,inCallUserIDs:c});case 5:return t.abrupt(\"return\",t.sent);case 8:if(t.prev=8,t.t0=t.catch(2),this._logger.error(\"TSignaling.inviteGroup.fail\",{text:{data:{hangup:o},error:t.t0},type:\"api\"}),!o){t.next=13;break}return t.abrupt(\"return\",this.handleError(t.t0,\"hangup group\"));case 13:return t.abrupt(\"return\",this.handleError(t.t0,\"inviteGroup\"));case 14:case\"end\":return t.stop()}}),t,this,[[2,8]])}))),function(t){return u.apply(this,arguments)})},{key:\"accept\",value:(s=c(a().mark((function t(e,n){var r,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"TSignaling.accept.start\",{text:{data:{params:e,supportParams:n}},type:\"api\"}),r=e.inviteID,o=e.type,s=m(e,Sy),t.prev=2,t.next=5,this.TSignaling.accept({inviteID:r,data:JSON.stringify(this.handleNewSignaling(i({version:0,call_type:o},s),n))});case 5:return t.abrupt(\"return\",t.sent);case 8:return t.prev=8,t.t0=t.catch(2),this._logger.error(\"TSignaling.accept.fail\",{text:{error:t.t0},type:\"api\"}),t.abrupt(\"return\",this.handleError(t.t0,\"accept\"));case 12:case\"end\":return t.stop()}}),t,this,[[2,8]])}))),function(t,e){return s.apply(this,arguments)})},{key:\"reject\",value:(o=c(a().mark((function t(e){var n,r,i,o,s;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"TSignaling.reject.start\",{text:{data:{params:e}},type:\"api\"}),n=e.inviteID,r=e.type,i=e.lineBusy,o={version:0,call_type:r},s=null,i?(o.line_busy=i,s=JSON.stringify(this.handleNewSignaling(o,{message:\"lineBusy\"}))):s=JSON.stringify(this.handleNewSignaling(o)),t.prev=5,t.next=8,this.TSignaling.reject({inviteID:n,data:s});case 8:return t.abrupt(\"return\",t.sent);case 11:if(t.prev=11,t.t0=t.catch(5),this._logger.error(\"TSignaling.reject.fail\",{text:{error:t.t0},type:\"api\"}),!i){t.next=16;break}return t.abrupt(\"return\",this.handleError(t.t0,\"line_busy\"));case 16:return t.abrupt(\"return\",this.handleError(t.t0,\"reject\"));case 17:case\"end\":return t.stop()}}),t,this,[[5,11]])}))),function(t){return o.apply(this,arguments)})},{key:\"cancel\",value:(r=c(a().mark((function t(e){var n,r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"TSignaling.cancel.start\",{text:{data:{params:e}},type:\"api\"}),n=e.inviteID,r=e.callType,t.prev=2,t.next=5,this.TSignaling.cancel({inviteID:n,data:JSON.stringify(this.handleNewSignaling({version:0,call_type:r}))});case 5:return i=t.sent,t.abrupt(\"return\",i);case 9:return t.prev=9,t.t0=t.catch(2),this._logger.error(\"TSignaling.cancel.fail\",{text:{error:t.t0},type:\"api\"}),t.abrupt(\"return\",this.handleError(t.t0,\"cancel\"));case 13:case\"end\":return t.stop()}}),t,this,[[2,9]])}))),function(t){return r.apply(this,arguments)})},{key:\"hangup\",value:(n=c(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"TSignaling.hangup.start\",{text:{data:{params:e}},type:\"api\"}),n=e.userIDList,r=e.callType,i=e.callEnd,o=void 0===i?0:i,s=e.isGroupCall,c=void 0!==s&&s,l=e.groupID,u=void 0===l?\"\":l,h={version:0,call_type:r,call_end:o},f={cmd:\"hangup\"},d=JSON.stringify(this.handleNewSignaling(h,f)),!c||!u){t.next=10;break}return t.next=8,this.TSignaling.inviteInGroup({inviteeList:n,groupID:u,data:d,timeout:0});case 8:t.next=12;break;case 10:return t.next=12,this.TSignaling.invite({userID:n[0],data:d,timeout:0});case 12:case\"end\":return t.stop()}}),t,this)}))),function(t){return n.apply(this,arguments)})},{key:\"switchCallMode\",value:(e=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"TSignaling.switchCallMode.start\",{text:{data:{params:e}},type:\"api\"}),n=e.userID,r=e.callType,i=e.roomID,o=e.mode,t.abrupt(\"return\",this.invite({userID:n,type:r,roomID:i,switchMode:o}));case 3:case\"end\":return t.stop()}}),t,this)}))),function(t){return e.apply(this,arguments)})},{key:\"destroyed\",value:function(){this._logger.info(\"TSignaling.destroyed.start\",{type:\"api\"}),this.TSignaling=null}},{key:\"setLogLevel\",value:function(t){this.TSignaling.setLogLevel(t)}}]),t}(),Ly=function(){function t(e){l(this,t),this._emitter=e.emitter,this._logger=uy()}return h(t,[{key:\"onError\",value:function(t){this._logger.error(\"TUICallEvent.onError\",{text:{error:t},type:\"event\"}),this._emitter.emit(sg.ERROR,t)}},{key:\"onCallBegin\",value:function(t){this._logger.info(\"TUICallEvent.onCallBegin\",{text:{data:t},type:\"event\"}),this._emitter.emit(sg.ON_CALL_BEGIN,t)}},{key:\"onCallEnd\",value:function(t){this._logger.info(\"TUICallEvent.onCallEnd\",{text:{data:t},type:\"event\"});var e=t.userID,n=t.callEnd,r=t.message,i=t.roomID,a=t.callMediaType,o=t.callRole,s=t.totalTime;this._emitter.emit(sg.CALL_END,{userID:e,callEnd:n,message:r,roomID:i,callMediaType:a,callRole:o,totalTime:s})}},{key:\"onInvited\",value:function(t){this._logger.info(\"TUICallEvent.onInvited\",{text:{data:t},type:\"event\"}),this._emitter.emit(sg.INVITED,t),this._emitter.emit(sg.ON_CALL_RECEIVED,t)}},{key:\"onLineBusy\",value:function(t){this._logger.info(\"TUICallEvent.onLineBusy\",{text:{data:t},type:\"event\"});var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(sg.LINE_BUSY,{inviteID:e,invitee:n,userID:r,reason:\"line busy\"})}},{key:\"onReject\",value:function(t){var e=t.inviteID,n=t.invitee,r=t.userID;this._emitter.emit(sg.REJECT,{inviteID:e,invitee:n,userID:r,reason:\"reject\"})}},{key:\"onNoResp\",value:function(t){this._logger.info(\"TUICallEvent.onNoResp\",{text:{data:t},type:\"event\"});var e=t.groupID,n=void 0===e?\"\":e,r=t.inviteID,i=t.sponsor,a=t.timeoutUserList,o=t.userIDList;this._emitter.emit(sg.NO_RESP,{groupID:n,inviteID:r,sponsor:i,timeoutUserList:a,userIDList:o})}},{key:\"onCancel\",value:function(t){this._emitter.emit(sg.CALLING_CANCEL,t),this._emitter.emit(sg.ON_CALL_CANCELED,t)}},{key:\"onTimeout\",value:function(t){this._logger.info(\"TUICallEvent.onTimeout\",{text:{data:t},type:\"event\"});var e=t.inviteID,n=t.groupID,r=t.sponsor,i=t.timeoutUserList;this._emitter.emit(sg.CALLING_TIMEOUT,{groupID:n,inviteID:e,sponsor:r,timeoutUserList:i})}},{key:\"onUserAccept\",value:function(t){this._logger.info(\"TUICallEvent.onUserAccept\",{text:{data:t},type:\"event\"});var e=t.userID,n=t.userList;this._emitter.emit(sg.USER_ACCEPT,{userID:e,userList:n})}},{key:\"onUserEnter\",value:function(t){this._logger.info(\"TUICallEvent.onUserEnter\",{text:{data:t},type:\"event\"});var e=t.userID,n=t.playerList;this._emitter.emit(sg.USER_ENTER,{userID:e,playerList:n})}},{key:\"onUserLeave\",value:function(t){this._logger.info(\"TUICallEvent.onUserLeave\",{text:{data:t},type:\"event\"});var e=t.userID,n=t.playerList;this._emitter.emit(sg.USER_LEAVE,{userID:e,playerList:n})}},{key:\"onUserUpdate\",value:function(t){var e=t.pusher,n=t.playerList;this._emitter.emit(sg.USER_UPDATE,{pusher:e,playerList:n})}},{key:\"onSdkReady\",value:function(t){this._logger.info(\"TUICallEvent.onSdkReady\",{text:{data:t},type:\"event\"}),this._emitter.emit(sg.SDK_READY,t)}},{key:\"onKickedOut\",value:function(t){this._logger.info(\"TUICallEvent.onKickedOut\",{text:{data:t},type:\"event\"}),this._emitter.emit(sg.KICKED_OUT,t)}},{key:\"onCallMode\",value:function(t){this._logger.info(\"TUICallEvent.onCallMode\",{text:{data:t},type:\"event\"}),this._emitter.emit(sg.CALL_MODE,t)}},{key:\"onMessageSentByMe\",value:function(t){this._logger.info(\"TUICallEvent.onMessageSentByMe\",{text:{data:t},type:\"event\"}),this._emitter.emit(sg.MESSAGE_SENT_BY_ME,t)}},{key:\"destroyed\",value:function(){this._logger.info(\"TUICallEvent.destroyed\",{type:\"api\"}),this._emitter=null}}]),t}(),Oy=\"1.5.8\";Tv(\"Map\",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),Vv);var ky=ln,Ay=function(){var t=ky(this),e=\"\";return t.hasIndices&&(e+=\"d\"),t.global&&(e+=\"g\"),t.ignoreCase&&(e+=\"i\"),t.multiline&&(e+=\"m\"),t.dotAll&&(e+=\"s\"),t.unicode&&(e+=\"u\"),t.unicodeSets&&(e+=\"v\"),t.sticky&&(e+=\"y\"),e},Ny=V,Uy=ve,Py=bt,My=Ay,jy=RegExp.prototype,Vy=Ln.PROPER,Gy=wr,Hy=ln,By=bh,Fy=N,Ky=function(t){var e=t.flags;return void 0!==e||\"flags\"in jy||Uy(t,\"flags\")||!Py(jy,t)?e:Ny(My,t)},zy=\"toString\",Jy=RegExp.prototype[zy],Wy=Fy((function(){return\"/a/b\"!==Jy.call({source:\"a\",flags:\"b\"})})),$y=Vy&&Jy.name!==zy;(Wy||$y)&&Gy(RegExp.prototype,zy,(function(){var t=Hy(this);return\"/\"+By(t.source)+\"/\"+By(Ky(t))}),{unsafe:!0});var qy,Yy,Xy=Gp;xi({target:\"Object\",stat:!0,forced:Object.isExtensible!==Xy},{isExtensible:Xy}),qy=\"undefined\"!=typeof console?console:\"undefined\"!=typeof global&&global.console?global.console:\"undefined\"!=typeof window&&window.console?window.console:{};for(var Qy=function(){},Zy=[\"assert\",\"clear\",\"count\",\"debug\",\"dir\",\"dirxml\",\"error\",\"group\",\"groupCollapsed\",\"groupEnd\",\"info\",\"log\",\"profile\",\"profileEnd\",\"table\",\"time\",\"timeEnd\",\"timeStamp\",\"trace\",\"warn\"],tI=Zy.length-1;tI;)Yy=Zy[tI],console[Yy]||(qy[Yy]=Qy),tI-=1;Object.isExtensible(qy)&&(qy.methods=Zy);var eI,nI,rI=qy,iI=N,aI=k.RegExp,oI=iI((function(){var t=aI(\"a\",\"y\");return t.lastIndex=2,null!==t.exec(\"abcd\")})),sI=oI||iI((function(){return!aI(\"a\",\"y\").sticky})),cI={BROKEN_CARET:oI||iI((function(){var t=aI(\"^r\",\"gy\");return t.lastIndex=2,null!==t.exec(\"str\")})),MISSED_STICKY:sI,UNSUPPORTED_Y:oI},lI=N,uI=k.RegExp,hI=lI((function(){var t=uI(\".\",\"s\");return!(t.dotAll&&t.test(\"\\n\")&&\"s\"===t.flags)})),fI=N,dI=k.RegExp,pI=fI((function(){var t=dI(\"(?b)\",\"g\");return\"b\"!==t.exec(\"b\").groups.a||\"bc\"!==\"b\".replace(t,\"$c\")})),vI=V,gI=X,yI=bh,II=Ay,mI=cI,EI=ne.exports,_I=af,TI=ar.get,CI=hI,bI=pI,DI=EI(\"native-string-replace\",String.prototype.replace),RI=RegExp.prototype.exec,wI=RI,SI=gI(\"\".charAt),xI=gI(\"\".indexOf),LI=gI(\"\".replace),OI=gI(\"\".slice),kI=(nI=/b*/g,vI(RI,eI=/a/,\"a\"),vI(RI,nI,\"a\"),0!==eI.lastIndex||0!==nI.lastIndex),AI=mI.BROKEN_CARET,NI=void 0!==/()??/.exec(\"\")[1];(kI||NI||AI||CI||bI)&&(wI=function(t){var e,n,r,i,a,o,s,c=this,l=TI(c),u=yI(t),h=l.raw;if(h)return h.lastIndex=c.lastIndex,e=vI(wI,h,u),c.lastIndex=h.lastIndex,e;var f=l.groups,d=AI&&c.sticky,p=vI(II,c),v=c.source,g=0,y=u;if(d&&(p=LI(p,\"y\",\"\"),-1===xI(p,\"g\")&&(p+=\"g\"),y=OI(u,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&\"\\n\"!==SI(u,c.lastIndex-1))&&(v=\"(?: \"+v+\")\",y=\" \"+y,g++),n=new RegExp(\"^(?:\"+v+\")\",p)),NI&&(n=new RegExp(\"^\"+v+\"$(?!\\\\s)\",p)),kI&&(r=c.lastIndex),i=vI(RI,d?n:c,y),d?i?(i.input=OI(i.input,g),i[0]=OI(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:kI&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),NI&&i&&i.length>1&&vI(DI,i[0],n,(function(){for(a=1;a2)if(l=wm(l),43===(e=Am(l,0))||45===e){if(88===(n=Am(l,2))||120===n)return NaN}else if(48===e){switch(Am(l,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+l}for(o=(a=km(l,2)).length,s=0;si)return NaN;return parseInt(a,r)}return+l},Um=gm(Sm,!xm(\" 0o1\")||!xm(\"0b1\")||xm(\"+0x1\")),Pm=function(t){var e,n=arguments.length<1?0:xm(function(t){var e=_m(t,\"number\");return\"bigint\"==typeof e?e:Nm(e)}(t));return mm(Lm,e=this)&&Tm((function(){Rm(e)}))?Im(Object(n),this,Pm):n};Pm.prototype=Lm,Um&&(Lm.constructor=Pm),hm({global:!0,constructor:!0,wrap:!0,forced:Um},{Number:Pm});Um&&function(t,e){for(var n,r=fm?Cm(e):\"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range\".split(\",\"),i=0;r.length>i;i++)ym(e,n=r[i])&&!ym(t,n)&&Dm(t,n,bm(e,n))}(pm[Sm],xm);var Mm=kr,jm=bh,Vm=ut,Gm=RangeError,Hm=function(t){var e=jm(Vm(this)),n=\"\",r=Mm(t);if(r<0||r===1/0)throw new Gm(\"Wrong number of repetitions\");for(;r>0;(r>>>=1)&&(e+=e))1&r&&(n+=e);return n},Bm=X,Fm=Vr,Km=bh,zm=ut,Jm=Bm(Hm),Wm=Bm(\"\".slice),$m=Math.ceil,qm=function(t){return function(e,n,r){var i,a,o=Km(zm(e)),s=Fm(n),c=o.length,l=void 0===r?\" \":Km(r);return s<=c||\"\"===l?o:((a=Jm(l,$m((i=s-c)/l.length))).length>i&&(a=Wm(a,0,i)),t?o+a:a+o)}},Ym=X,Xm=N,Qm={start:qm(!1),end:qm(!0)}.start,Zm=RangeError,tE=isFinite,eE=Math.abs,nE=Date.prototype,rE=nE.toISOString,iE=Ym(nE.getTime),aE=Ym(nE.getUTCDate),oE=Ym(nE.getUTCFullYear),sE=Ym(nE.getUTCHours),cE=Ym(nE.getUTCMilliseconds),lE=Ym(nE.getUTCMinutes),uE=Ym(nE.getUTCMonth),hE=Ym(nE.getUTCSeconds),fE=Xm((function(){return\"0385-07-25T07:06:39.999Z\"!==rE.call(new Date(-50000000000001))}))||!Xm((function(){rE.call(new Date(NaN))}))?function(){if(!tE(iE(this)))throw new Zm(\"Invalid time value\");var t=this,e=oE(t),n=cE(t),r=e<0?\"-\":e>9999?\"+\":\"\";return r+Qm(eE(e),r?6:4,0)+\"-\"+Qm(uE(t)+1,2,0)+\"-\"+Qm(aE(t),2,0)+\"T\"+Qm(sE(t),2,0)+\":\"+Qm(lE(t),2,0)+\":\"+Qm(hE(t),2,0)+\".\"+Qm(n,3,0)+\"Z\"}:rE;xi({target:\"Date\",proto:!0,forced:Date.prototype.toISOString!==fE},{toISOString:fE});var dE=X,pE=fe,vE=Math.floor,gE=dE(\"\".charAt),yE=dE(\"\".replace),IE=dE(\"\".slice),mE=/\\$([$&'`]|\\d{1,2}|<[^>]*>)/g,EE=/\\$([$&'`]|\\d{1,2})/g,_E=Es,TE=V,CE=X,bE=KI,DE=N,RE=ln,wE=yt,SE=st,xE=kr,LE=Vr,OE=bh,kE=ut,AE=JI,NE=Xt,UE=function(t,e,n,r,i,a){var o=n+t.length,s=r.length,c=EE;return void 0!==i&&(i=pE(i),c=mE),yE(a,c,(function(a,c){var l;switch(gE(c,0)){case\"$\":return\"$\";case\"&\":return t;case\"`\":return IE(e,0,n);case\"'\":return IE(e,o);case\"<\":l=i[IE(c,1,-1)];break;default:var u=+c;if(0===u)return a;if(u>s){var h=vE(u/10);return 0===h?a:h<=s?void 0===r[h-1]?gE(c,1):r[h-1]+gE(c,1):a}l=r[u-1]}return void 0===l?\"\":l}))},PE=ZI,ME=Le(\"replace\"),jE=Math.max,VE=Math.min,GE=CE([].concat),HE=CE([].push),BE=CE(\"\".indexOf),FE=CE(\"\".slice),KE=\"$0\"===\"a\".replace(/./,\"$0\"),zE=!!/./[ME]&&\"\"===/./[ME](\"a\",\"$0\");bE(\"replace\",(function(t,e,n){var r=zE?\"$\":\"$0\";return[function(t,n){var r=kE(this),i=SE(t)?void 0:NE(t,ME);return i?TE(i,t,r,n):TE(e,OE(r),t,n)},function(t,i){var a=RE(this),o=OE(t);if(\"string\"==typeof i&&-1===BE(i,r)&&-1===BE(i,\"$<\")){var s=n(e,a,o,i);if(s.done)return s.value}var c=wE(i);c||(i=OE(i));var l,u=a.global;u&&(l=a.unicode,a.lastIndex=0);for(var h,f=[];null!==(h=PE(a,o))&&(HE(f,h),u);){\"\"===OE(h[0])&&(a.lastIndex=AE(o,LE(a.lastIndex),l))}for(var d,p=\"\",v=0,g=0;g=v&&(p+=FE(o,v,m)+y,v=m+I.length)}return p+FE(o,v)}]}),!!DE((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:\"7\"},t},\"7\"!==\"\".replace(t,\"$\")}))||!KE||zE);var JE,WE=Et,$E=et,qE=Le(\"match\"),YE=function(t){var e;return WE(t)&&(void 0!==(e=t[qE])?!!e:\"RegExp\"===$E(t))},XE=TypeError,QE=function(t){if(YE(t))throw new XE(\"The method doesn't accept regular expressions\");return t},ZE=Le(\"match\"),t_=function(t){var e=/./;try{\"/./\"[t](e)}catch(n){try{return e[ZE]=!1,\"/./\"[t](e)}catch(t){}}return!1},e_=xi,n_=Ja,r_=A.f,i_=Vr,a_=bh,o_=QE,s_=ut,c_=t_,l_=n_(\"\".startsWith),u_=n_(\"\".slice),h_=Math.min,f_=c_(\"startsWith\");function d_(t,e){t=t.split(\".\"),e=e.split(\".\");for(var n=Math.max(t.length,e.length);t.lengtha)return 1;if(i1?arguments[1]:void 0,e.length)),r=a_(t);return l_?l_(e,r,n):u_(e,n,n+r.length)===r}});var p_=\"TRTC-ROOM\",v_=wx||qq;v_||console.error(p_,\"不支持当前小程序环境\");var g_,y_=v_.getSystemInfoSync(),I_=y_.safeArea;(\"iOS 13.3\"===y_.system||\"iPhoneX\"===y_.model&&\"iOS 13.3.1\"===y_.system)&&console.log(\"use media audio volume type\"),console.log(p_,\"SystemInfo\",y_),\"undefined\"!=typeof qq?g_=!0:\"undefined\"!=typeof wx&&(g_=d_(y_.version,\"7.0.8\")>=0||d_(y_.version,\"2.4.0\")>=0&&d_(y_.version,\"6.0.0\")<0&&d_(y_.SDKVersion,\"2.10.0\")>=0);var m_=g_,E_=\"undefined\"!=typeof uni,__=/iOS/i.test(y_.system),T_=/Android/i.test(y_.system);/mac/i.test(y_.system);var C_=y_.version,b_=y_.SDKBuild?\"\".concat(y_.SDKVersion,\"-\").concat(y_.SDKBuild):y_.SDKVersion;y_.screenHeight,I_.bottom,console.log(p_,\"APP_VERSION:\",C_,\" LIB_VERSION:\",b_,\" is new version:\",m_);var D_=function(t){return\"function\"==typeof Array.isArray?Array.isArray(t):\"array\"===function(t){return Object.prototype.toString.call(t).match(/^\\[object (.*)\\]$/)[1].toLowerCase()}(t)},R_=function(t){return null!==t&&(\"number\"==typeof t&&!isNaN(t-0)||\"object\"===o(t)&&t.constructor===Number)},w_=function(t){return\"string\"==typeof t},S_=function(t){return null!==t&&\"object\"===o(t)},x_=function(t){return void 0===t},L_=0;Date.now||(Date.now=function(){return(new Date).getTime()});var O_=function(){0===L_&&(L_=Date.now()-1);var t=Date.now()-L_;return t>4294967295?(L_+=4294967295,Date.now()-L_):t},k_=function(t){return t instanceof Error},A_=function(t){return JSON.stringify(t,[\"message\",\"code\"])};function N_(){var t=\"unknown\";return __&&(t=\"ios\"),T_&&(t=\"android\"),t}function U_(t){return P_.apply(this,arguments)}function P_(){return(P_=c(a().mark((function t(e){var n,r,i,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e){t.next=2;break}return t.abrupt(\"return\",!1);case 2:return n=e.microphone,r=void 0!==n&&n,i=e.camera,o=void 0!==i&&i,t.prev=3,t.next=6,wx.getSetting();case 6:if(s=t.sent,c=s.authSetting[Og.RECORD],l=s.authSetting[Og.CAMERA],!r||!o){t.next=11;break}return t.abrupt(\"return\",c&&l);case 11:if(!r){t.next=13;break}return t.abrupt(\"return\",c);case 13:if(!o){t.next=15;break}return t.abrupt(\"return\",l);case 15:return t.abrupt(\"return\",!1);case 18:return t.prev=18,t.t0=t.catch(3),t.abrupt(\"return\",!1);case 21:case\"end\":return t.stop()}}),t,null,[[3,18]])})))).apply(this,arguments)}function M_(t){return t===Sg.AV_CALL}function j_(){return performance&&performance.now?Math.floor(performance.now()):Date.now()}function V_(t){var e=String(t);return e.startsWith(\"14\")||e.startsWith(\"16\")||e.startsWith(\"17\")}function G_(t){var e=V_(t)?kg:Ag;return\"\".concat(e,\"&position=\").concat(t,\"®ionId=\").concat(function(t){return t>=2e7&&t<3e7||t>=172e7&&t<173e7?Ug:t>=3e7&&t<4e7||t>=173e7&&t<174e7?Mg:t>=4e7&&t<5e7||t>=174e7&&t<175e7?Pg:t>=5e7&&t<6e7||t>=175e7&&t<176e7?jg:t>=7e7&&t<8e7||t>=177e7&&t<178e7?Vg:Ng}(t))}var H_=0,B_=new Map;function F_(){var t=new Date;return\"TUICallEngine \".concat(t.toLocaleTimeString(\"en-US\",{hour12:!1}),\".\").concat(function(t){var e;switch(t.toString().length){case 1:e=\"00\".concat(t);break;case 2:e=\"0\".concat(t);break;default:e=t}return e}(t.getMilliseconds()),\":\")}var K_={_data:[],_length:0,_visible:!1,arguments2String:function(t){var e,n;if(1===t.length)e=F_()+t[0];else{e=F_();for(var r=0,i=t.length;r-10?\"+0\".concat(Math.abs(100*r)):\"+\".concat(Math.abs(100*r)):r>=10?\"-\".concat(100*r):\"-0\".concat(100*r),n.replace(\"Z\",i)),this.startts&&this.endts&&!this.timespan&&(this.timespan=Math.abs(this.endts-this.startts))}},{key:\"setEnd\",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.endts=Date.now(),e?this._eventStatController.pushIn(this):setTimeout((function(){t._eventStatController.pushIn(t)}),0)}},{key:\"setError\",value:function(t,e,n){return this.setNetworkType(n),e?(t.code&&this.setCode(t.code),t.message&&this.setMessage(t.message)):(this.setCode(my.NO_NETWORK),this.setMessage(Ey)),this}},{key:\"setCode\",value:function(t){return\"ECONNABORTED\"===t&&(this.codeint=103),R_(t)?this.codeint=t:K_.warn(\"SSOLogData.setCode value not a number, please check!\",t,o(t)),this}},{key:\"setMessage\",value:function(t){return w_(t)?(this.message=t,this):this}},{key:\"setText\",value:function(t){return R_(t)?this.text=t.toString():w_(t)&&(this.text=t),this}},{key:\"setTalkTime\",value:function(t){return this.talktime=t,this}},{key:\"setMessageType\",value:function(t){return this.msgType=t,this}},{key:\"setCallType\",value:function(t){return this.calltype=t,this}},{key:\"setNetworkType\",value:function(t){return x_(t)?K_.warn(\"SSOLogData.setNetworkType value is undefined, please check!\"):this.networktype=t,this}}],[{key:\"bindController\",value:function(e){t.prototype._eventStatController=e}}]),t}(),J_=\"sdkConstruct\",W_=\"quality_report\",$_=function(){function t(){l(this,t),this._table=\"timweb-trtccalling\",this._report=[]}return h(t,[{key:\"pushIn\",value:function(t){K_.debug(\"SSOLogBody.pushIn\",this._report.length,t),this._report.push(t)}},{key:\"backfill\",value:function(t){var e;D_(t)&&0!==t.length&&(K_.debug(\"SSOLogBody.backfill\",this._report.length,t.length),(e=this._report).unshift.apply(e,T(t)))}},{key:\"getLogsNumInMemory\",value:function(){return this._report.length}},{key:\"isEmpty\",value:function(){return 0===this._report.length}},{key:\"_reset\",value:function(){this._report.length=0,this._report=[]}},{key:\"getTable\",value:function(){return this._table}},{key:\"getLogsInMemory\",value:function(){var t=this._report.slice();return this._reset(),t}}]),t}(),q_={CURRENT:{COMMON:\"https://webim.tim.qq.com\"},PRODUCTION:{COMMON:\"https://webim.tim.qq.com\"}},Y_={IM_OPEN_STAT:\"imopenstat\"},X_={TIM_WEB_TRTCCALLING_REPORT:\"tweb_trtccalling_report\"},Q_={imopenstat:\"v4\"},Z_=function(){function t(){l(this,t),this.TAG=\"trtccalling-ssolog-event\",this._reportBody=new $_,this._version=Oy,this.MIN_THRESHOLD=20,this.MAX_THRESHOLD=100,this.WAITING_TIME=6e4,this.INTERVAL=2e4,this._timerID=0,this._resetLastReportTime(),this._startReportTimer(),this._retryCount=0,this.MAX_RETRY_COUNT=3}return h(t,[{key:\"reportAtOnce\",value:function(){K_.debug(\"EventStatController.reportAtOnce\"),this._report()}},{key:\"pushIn\",value:function(t){t instanceof z_&&(t.setCommonInfo({SDKAppID:Number(wx.getStorageSync(\"sdkAppId\")),version:this._version,userID:wx.getStorageSync(\"userId\")}),this._reportBody.pushIn(t),this._report())}},{key:\"_resetLastReportTime\",value:function(){this._lastReportTime=Date.now()}},{key:\"_startReportTimer\",value:function(){var t=this;this._timerID=setInterval((function(){Date.now()0&&(clearInterval(this._timerID),this._timerID=0)}},{key:\"_report\",value:function(){var t=this;if(!this._reportBody.isEmpty()){var e=Math.ceil(+new Date/1e3),n=wx.getStorageSync(\"sdkAppId\"),r=this._reportBody.getLogsInMemory(),i={table:this._reportBody.getTable(),report:r},a=q_.CURRENT.COMMON,o=Q_.imopenstat,s=Y_.IM_OPEN_STAT,c=X_.TIM_WEB_TRTCCALLING_REPORT,l=\"\".concat(a,\"/\").concat(o,\"/\").concat(s,\"/\").concat(c,\"/?sdkappid=\").concat(n,\"&reqtime=\").concat(e);wx.request({url:l,method:\"POST\",data:JSON.stringify(i),header:{\"content-type\":\"application/json\"},success:function(e){t._retryCount>0&&(K_.debug(\"EventStatController.report retry success\"),t._retryCount=0)},fail:function(e){K_.warn(\"EventStatController.report, error:\".concat(A_(e))),t._reportBody.backfill(r),t._reportBody.getLogsNumInMemory()>t.MAX_THRESHOLD||t._retryCount===t.MAX_RETRY_COUNT||0===t._timerID?t._retryCount=0:t._retryCount+=1}})}}},{key:\"reset\",value:function(){K_.log(\"EventStatController.reset\"),this._stopReportTimer(),this._report()}}]),t}(),tT=Jr.includes,eT=ud;xi({target:\"Array\",proto:!0,forced:N((function(){return!Array(1).includes()}))},{includes:function(t){return tT(this,t,arguments.length>1?arguments[1]:void 0)}}),eT(\"includes\");var nT=xi,rT=QE,iT=ut,aT=bh,oT=t_,sT=X(\"\".indexOf);nT({target:\"String\",proto:!0,forced:!oT(\"includes\")},{includes:function(t){return!!~sT(aT(iT(this)),aT(rT(t)),arguments.length>1?arguments[1]:void 0)}});var cT=X,lT=bv,uT=Tp.exports.getWeakData,hT=cs,fT=ln,dT=st,pT=Et,vT=Du,gT=ve,yT=ar.set,IT=ar.getterFor,mT=ho.find,ET=ho.findIndex,_T=cT([].splice),TT=0,CT=function(t){return t.frozen||(t.frozen=new bT)},bT=function(){this.entries=[]},DT=function(t,e){return mT(t.entries,(function(t){return t[0]===e}))};bT.prototype={get:function(t){var e=DT(this,t);if(e)return e[1]},has:function(t){return!!DT(this,t)},set:function(t,e){var n=DT(this,t);n?n[1]=e:this.entries.push([t,e])},delete:function(t){var e=ET(this.entries,(function(e){return e[0]===t}));return~e&&_T(this.entries,e,1),!!~e}};var RT,wT={getConstructor:function(t,e,n,r){var i=t((function(t,i){hT(t,a),yT(t,{type:e,id:TT++,frozen:void 0}),dT(i)||vT(i,t[r],{that:t,AS_ENTRIES:n})})),a=i.prototype,o=IT(e),s=function(t,e,n){var r=o(t),i=uT(fT(e),!0);return!0===i?CT(r).set(e,n):i[r.id]=n,t};return lT(a,{delete:function(t){var e=o(this);if(!pT(t))return!1;var n=uT(t);return!0===n?CT(e).delete(t):n&&gT(n,e.id)&&delete n[e.id]},has:function(t){var e=o(this);if(!pT(t))return!1;var n=uT(t);return!0===n?CT(e).has(t):n&&gT(n,e.id)}}),lT(a,n?{get:function(t){var e=o(this);if(pT(t)){var n=uT(t);return!0===n?CT(e).get(t):n?n[e.id]:void 0}},set:function(t,e){return s(this,t,e)}}:{add:function(t){return s(this,t,!0)}}),i}},ST=Hp,xT=k,LT=X,OT=bv,kT=Tp.exports,AT=Tv,NT=wT,UT=Et,PT=ar.enforce,MT=N,jT=Gn,VT=Object,GT=Array.isArray,HT=VT.isExtensible,BT=VT.isFrozen,FT=VT.isSealed,KT=VT.freeze,zT=VT.seal,JT={},WT={},$T=!xT.ActiveXObject&&\"ActiveXObject\"in xT,qT=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},YT=AT(\"WeakMap\",qT,NT),XT=YT.prototype,QT=LT(XT.set);if(jT)if($T){RT=NT.getConstructor(qT,\"WeakMap\",!0),kT.enable();var ZT=LT(XT.delete),tC=LT(XT.has),eC=LT(XT.get);OT(XT,{delete:function(t){if(UT(t)&&!HT(t)){var e=PT(this);return e.frozen||(e.frozen=new RT),ZT(this,t)||e.frozen.delete(t)}return ZT(this,t)},has:function(t){if(UT(t)&&!HT(t)){var e=PT(this);return e.frozen||(e.frozen=new RT),tC(this,t)||e.frozen.has(t)}return tC(this,t)},get:function(t){if(UT(t)&&!HT(t)){var e=PT(this);return e.frozen||(e.frozen=new RT),tC(this,t)?eC(this,t):e.frozen.get(t)}return eC(this,t)},set:function(t,e){if(UT(t)&&!HT(t)){var n=PT(this);n.frozen||(n.frozen=new RT),tC(this,t)?QT(this,t,e):n.frozen.set(t,e)}else QT(this,t,e);return this}})}else ST&&MT((function(){var t=KT([]);return QT(new YT,t,1),!BT(t)}))&&OT(XT,{set:function(t,e){var n;return GT(t)&&(BT(t)?n=JT:FT(t)&&(n=WT)),QT(this,t,e),n===JT&&KT(t),n===WT&&zT(t),this}});var nC={exports:{}};\n/*!\n * validate.js 0.13.1\n *\n * (c) 2013-2019 Nicklas Ansman, 2013 Wrapp\n * Validate.js may be freely distributed under the MIT license.\n * For all details and documentation:\n * http://validatejs.org/\n */(function(t,e,n){var r=function(t,e,n){n=i.extend({},i.options,n);var a=i.runValidations(t,e,n);if(a.some((function(t){return i.isPromise(t.error)})))throw new Error(\"Use validate.async if you want support for promises\");return r.processValidationResults(a,n)},i=r;i.extend=function(t){return[].slice.call(arguments,1).forEach((function(e){for(var n in e)t[n]=e[n]})),t},i.extend(r,{version:{major:0,minor:13,patch:1,metadata:null,toString:function(){var t=i.format(\"%{major}.%{minor}.%{patch}\",i.version);return i.isEmpty(i.version.metadata)||(t+=\"+\"+i.version.metadata),t}},Promise:\"undefined\"!=typeof Promise?Promise:null,EMPTY_STRING_REGEXP:/^\\s*$/,runValidations:function(t,e,n){var r,a,o,s,c,l,u,h=[];for(r in(i.isDomElement(t)||i.isJqueryElement(t))&&(t=i.collectFormValues(t)),e)for(a in o=i.getDeepObjectValue(t,r),s=i.result(e[r],o,t,r,n,e)){if(!(c=i.validators[a]))throw u=i.format(\"Unknown validator %{name}\",{name:a}),new Error(u);l=s[a],(l=i.result(l,o,t,r,n,e))&&h.push({attribute:r,value:o,validator:a,globalOptions:n,attributes:t,options:l,error:c.call(c,o,l,r,t,n)})}return h},processValidationResults:function(t,e){t=i.pruneEmptyErrors(t,e),t=i.expandMultipleErrors(t,e),t=i.convertErrorMessages(t,e);var n=e.format||\"grouped\";if(\"function\"!=typeof i.formatters[n])throw new Error(i.format(\"Unknown format %{format}\",e));return t=i.formatters[n](t),i.isEmpty(t)?void 0:t},async:function(t,e,n){var r=(n=i.extend({},i.async.options,n)).wrapErrors||function(t){return t};!1!==n.cleanAttributes&&(t=i.cleanAttributes(t,e));var a=i.runValidations(t,e,n);return new i.Promise((function(o,s){i.waitForResults(a).then((function(){var c=i.processValidationResults(a,n);c?s(new r(c,n,t,e)):o(t)}),(function(t){s(t)}))}))},single:function(t,e,n){return n=i.extend({},i.single.options,n,{format:\"flat\",fullMessages:!1}),i({single:t},{single:e},n)},waitForResults:function(t){return t.reduce((function(t,e){return i.isPromise(e.error)?t.then((function(){return e.error.then((function(t){e.error=t||null}))})):t}),new i.Promise((function(t){t()})))},result:function(t){var e=[].slice.call(arguments,1);return\"function\"==typeof t&&(t=t.apply(null,e)),t},isNumber:function(t){return\"number\"==typeof t&&!isNaN(t)},isFunction:function(t){return\"function\"==typeof t},isInteger:function(t){return i.isNumber(t)&&t%1==0},isBoolean:function(t){return\"boolean\"==typeof t},isObject:function(t){return t===Object(t)},isDate:function(t){return t instanceof Date},isDefined:function(t){return null!=t},isPromise:function(t){return!!t&&i.isFunction(t.then)},isJqueryElement:function(t){return t&&i.isString(t.jquery)},isDomElement:function(t){return!!t&&!(!t.querySelectorAll||!t.querySelector)&&(!(!i.isObject(document)||t!==document)||(\"object\"==typeof HTMLElement?t instanceof HTMLElement:t&&\"object\"==typeof t&&null!==t&&1===t.nodeType&&\"string\"==typeof t.nodeName))},isEmpty:function(t){var e;if(!i.isDefined(t))return!0;if(i.isFunction(t))return!1;if(i.isString(t))return i.EMPTY_STRING_REGEXP.test(t);if(i.isArray(t))return 0===t.length;if(i.isDate(t))return!1;if(i.isObject(t)){for(e in t)return!1;return!0}return!1},format:i.extend((function(t,e){return i.isString(t)?t.replace(i.format.FORMAT_REGEXP,(function(t,n,r){return\"%\"===n?\"%{\"+r+\"}\":String(e[r])})):t}),{FORMAT_REGEXP:/(%?)%\\{([^\\}]+)\\}/g}),prettify:function(t){return i.isNumber(t)?100*t%1==0?\"\"+t:parseFloat(Math.round(100*t)/100).toFixed(2):i.isArray(t)?t.map((function(t){return i.prettify(t)})).join(\", \"):i.isObject(t)?i.isDefined(t.toString)?t.toString():JSON.stringify(t):(t=\"\"+t).replace(/([^\\s])\\.([^\\s])/g,\"$1 $2\").replace(/\\\\+/g,\"\").replace(/[_-]/g,\" \").replace(/([a-z])([A-Z])/g,(function(t,e,n){return e+\" \"+n.toLowerCase()})).toLowerCase()},stringifyValue:function(t,e){return(e&&e.prettify||i.prettify)(t)},isString:function(t){return\"string\"==typeof t},isArray:function(t){return\"[object Array]\"==={}.toString.call(t)},isHash:function(t){return i.isObject(t)&&!i.isArray(t)&&!i.isFunction(t)},contains:function(t,e){return!!i.isDefined(t)&&(i.isArray(t)?-1!==t.indexOf(e):e in t)},unique:function(t){return i.isArray(t)?t.filter((function(t,e,n){return n.indexOf(t)==e})):t},forEachKeyInKeypath:function(t,e,n){if(i.isString(e)){var r,a=\"\",o=!1;for(r=0;ro&&(r=e.tooLong||this.tooLong||\"is too long (maximum is %{count} characters)\",c.push(i.format(r,{count:o}))),c.length>0?e.message||c:void 0):e.message||this.notValid||\"has an incorrect length\"}},numericality:function(t,e,n,r,a){if(i.isDefined(t)){var o,s,c=[],l={greaterThan:function(t,e){return t>e},greaterThanOrEqualTo:function(t,e){return t>=e},equalTo:function(t,e){return t===e},lessThan:function(t,e){return to&&(n=e.tooLate||e.message||this.tooLate||\"must be no later than %{date}\",n=i.format(n,{date:this.format(o,e),value:this.format(t,e)}),r.push(n)),r.length?i.unique(r):void 0)}}),{parse:null,format:null}),date:function(t,e){return e=i.extend({},e,{dateOnly:!0}),i.validators.datetime.call(i.validators.datetime,t,e)},format:function(t,e){(i.isString(e)||e instanceof RegExp)&&(e={pattern:e});var n,r=(e=i.extend({},this.options,e)).message||this.message||\"is invalid\",a=e.pattern;if(i.isDefined(t))return i.isString(t)?(i.isString(a)&&(a=new RegExp(e.pattern,e.flags)),(n=a.exec(t))&&n[0].length==t.length?void 0:r):r},inclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),!i.contains(e.within,t))){var n=e.message||this.message||\"^%{value} is not included in the list\";return i.format(n,{value:t})}},exclusion:function(t,e){if(i.isDefined(t)&&(i.isArray(e)&&(e={within:e}),e=i.extend({},this.options,e),i.contains(e.within,t))){var n=e.message||this.message||\"^%{value} is restricted\";return i.isString(e.within[t])&&(t=e.within[t]),i.format(n,{value:t})}},email:i.extend((function(t,e){var n=(e=i.extend({},this.options,e)).message||this.message||\"is not a valid email\";if(i.isDefined(t))return i.isString(t)&&this.PATTERN.exec(t)?void 0:n}),{PATTERN:/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])$/i}),equality:function(t,e,n,r,a){if(i.isDefined(t)){i.isString(e)&&(e={attribute:e});var o=(e=i.extend({},this.options,e)).message||this.message||\"is not equal to %{attribute}\";if(i.isEmpty(e.attribute)||!i.isString(e.attribute))throw new Error(\"The attribute must be a non empty string\");var s=i.getDeepObjectValue(r,e.attribute),c=e.comparator||function(t,e){return t===e},l=e.prettify||a&&a.prettify||i.prettify;return c(t,s,e,n,r)?void 0:i.format(o,{attribute:l(e.attribute)})}},url:function(t,e){if(i.isDefined(t)){var n=(e=i.extend({},this.options,e)).message||this.message||\"is not a valid url\",r=e.schemes||this.schemes||[\"http\",\"https\"],a=e.allowLocal||this.allowLocal||!1,o=e.allowDataUrl||this.allowDataUrl||!1;if(!i.isString(t))return n;var s=\"^(?:(?:\"+r.join(\"|\")+\")://)(?:\\\\S+(?::\\\\S*)?@)?(?:\",c=\"(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff]{2,}))\";return a?c+=\"?\":s+=\"(?!(?:10|127)(?:\\\\.\\\\d{1,3}){3})(?!(?:169\\\\.254|192\\\\.168)(?:\\\\.\\\\d{1,3}){2})(?!172\\\\.(?:1[6-9]|2\\\\d|3[0-1])(?:\\\\.\\\\d{1,3}){2})\",s+=\"(?:[1-9]\\\\d?|1\\\\d\\\\d|2[01]\\\\d|22[0-3])(?:\\\\.(?:1?\\\\d{1,2}|2[0-4]\\\\d|25[0-5])){2}(?:\\\\.(?:[1-9]\\\\d?|1\\\\d\\\\d|2[0-4]\\\\d|25[0-4]))|(?:(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)(?:\\\\.(?:[a-z\\\\u00a1-\\\\uffff0-9]-*)*[a-z\\\\u00a1-\\\\uffff0-9]+)*\"+c+\")(?::\\\\d{2,5})?(?:[/?#]\\\\S*)?$\",o&&(s=\"(?:\"+s+\")|(?:^data:(?:\\\\w+\\\\/[-+.\\\\w]+(?:;[\\\\w=]+)*)?(?:;base64)?,[A-Za-z0-9-_.!~\\\\*'();\\\\/?:@&=+$,%]*$)\"),new RegExp(s,\"i\").exec(t)?void 0:n}},type:i.extend((function(t,e,n,r,a){if(i.isString(e)&&(e={type:e}),i.isDefined(t)){var o,s=i.extend({},this.options,e),c=s.type;if(!i.isDefined(c))throw new Error(\"No type was specified\");if(o=i.isFunction(c)?c:this.types[c],!i.isFunction(o))throw new Error(\"validate.validators.type.types.\"+c+\" must be a function.\");if(!o(t,s,n,r,a)){var l=e.message||this.messages[c]||this.message||s.message||(i.isFunction(c)?\"must be of the correct type\":\"must be of type %{type}\");return i.isFunction(l)&&(l=l(t,e,n,r,a)),i.format(l,{attribute:i.prettify(n),type:c})}}}),{types:{object:function(t){return i.isObject(t)&&!i.isArray(t)},array:i.isArray,integer:i.isInteger,number:i.isNumber,string:i.isString,date:i.isDate,boolean:i.isBoolean},messages:{}})},r.formatters={detailed:function(t){return t},flat:i.flattenErrorsToArray,grouped:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=i.flattenErrorsToArray(t[e]);return t},constraint:function(t){var e;for(e in t=i.groupErrorsByAttribute(t))t[e]=t[e].map((function(t){return t.validator})).sort();return t}},r.exposeModule(r,this,t,e,n)}).call(x,nC.exports,nC,null);var rC=nC.exports,iC=\"number\",aC=\"string\",oC=\"object\",sC=\"function\",cC=\"array\",lC={createInstance:{sdkAppID:{presence:!0,type:iC},tim:{type:oC}},destroyInstance:{},init:{userID:{presence:!0,type:aC},userSig:{presence:!0,type:aC}},on:{eventCode:{presence:!0,type:aC},handler:{presence:!0,type:sC},context:{presence:!0,type:oC}},off:{eventCode:{presence:!0,type:aC},handler:{presence:!0,type:sC}},call:{userID:{presence:!0,type:aC},type:{presence:!0,type:iC},roomID:{presence:!1,type:iC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:wg}}},groupCall:{groupID:{presence:!0,type:aC},type:{presence:!0,type:iC},userIDList:{presence:!0,type:cC},roomID:{presence:!1,type:iC,numericality:{onlyInteger:!0,greaterThan:0,lessThanOrEqualTo:wg}}},joinInGroupCall:{groupID:{presence:!0,type:aC},type:{presence:!0,type:iC},roomID:{presence:!0,type:iC}},inviteUser:{userIDList:{presence:!0,type:cC}},accept:{},reject:{},hangup:{},switchCallMediaType:{type:{presence:!0,type:iC}},openCamera:{},closeCamera:{},switchCamera:{},openMicrophone:{},closeMicrophone:{},selectAudioPlaybackDevice:{type:{presence:!0,type:aC}},setSelfInfo:{nickName:{presence:!0,type:aC},avatar:{presence:!0,type:aC}}},uC={createInstance:\"\",destroyInstance:\"\",init:\"\",on:\"\",off:\"\",call:[cg.IDLE],groupCall:[cg.IDLE],accept:[cg.CALLING],reject:[cg.CALLING],hangup:[cg.CALLING,cg.CONNECTED],switchCallMediaType:[cg.CALLING,cg.CONNECTED],joinInGroupCall:[cg.IDLE],inviteUser:[cg.CALLING,cg.CONNECTED],openCamera:[cg.CALLING,cg.CONNECTED],closeCamera:[cg.CALLING,cg.CONNECTED],switchCamera:[cg.CALLING,cg.CONNECTED],openMicrophone:[cg.CALLING,cg.CONNECTED],closeMicrophone:[cg.CALLING,cg.CONNECTED],selectAudioPlaybackDevice:[cg.CALLING,cg.CONNECTED],setSelfInfo:\"\"},hC={createInstance:!1,destroyInstance:!0,init:!1,off:!0,call:!0,groupCall:!0,joinInGroupCall:!0,inviteUser:!0,accept:!0,reject:!0,hangup:!0,switchCallMediaType:!0,openCamera:!0,closeCamera:!0,switchCamera:!0,openMicrophone:!0,closeMicrophone:!0,selectAudioPlaybackDevice:!0,setSelfInfo:!0},fC=function(t){d(n,I(Error));var e=_(n);function n(t,r,i){var a;return l(this,n),f(E(a=e.call(this,r)),\"code\",void 0),f(E(a),\"message\",void 0),f(E(a),\"data\",void 0),a.code=t,a.message=r,a.data=i,a}return h(n,null,[{key:\"error\",value:function(t,e,r){return r?new n(t,e,r):new n(t,e)}}]),n}();function dC(t){var e=V_(t)?\"\".concat(Ry.ERROR_PACKAGE_NOT_PURCHASED):\"\".concat(_y);return e=e.replace(\"${purchaseAddress}\",G_(t))}rC.validators.type.types.function=function(t){return t instanceof Function};var pC=function(){function t(){l(this,t),f(this,\"paramsMatchedRule\",lC),f(this,\"statusMatchedRule\",uC),f(this,\"requireInit\",hC)}return h(t,[{key:\"getParamsMatchedRule\",value:function(t){return this.paramsMatchedRule[t]}},{key:\"getStatusMatchedRule\",value:function(t){return this.statusMatchedRule[t]}},{key:\"getInitReadyRule\",value:function(t){return this.requireInit[t]}}]),t}(),vC=function(){function t(){l(this,t),this._logger=uy()}return h(t,[{key:\"notify\",value:function(t,e,n,r){throw this._logger.error(\"check:\".concat(t.api),{text:{data:t,error:{code:e,message:n}}}),fC.error(e,\"[TUICallEngine:\".concat(t.api,\",\").concat(e,\"]\").concat(n).concat(r))}}]),t}(),gC=h((function t(e){l(this,t),f(this,\"api\",\"\"),f(this,\"attributes\",{}),f(this,\"callStatus\",\"\"),f(this,\"capabilityCode\",void 0),f(this,\"initReady\",void 0),this.api=e.api,this.attributes=e.attributes,this.callStatus=e.callStatus,this.capabilityCode=e.capabilityCode,this.initReady=e.initReady,this.sdkAppID=e.sdkAppID})),yC=new WeakMap,IC=function(){function t(){l(this,t),S(this,yC,{writable:!0,value:void 0}),R(this,yC,[])}var e;return h(t,[{key:\"addAlertHandler\",value:function(t){D(this,yC).push(t)}},{key:\"check\",value:(e=c(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r1&&void 0!==o[1]?o[1]:{},!e.capabilityCode){t.next=21;break}return t.prev=2,t.next=5,n.tim.callExperimentalAPI(\"isCommercialAbilityEnabled\",e.capabilityCode);case 5:!1===t.sent.data.enabled&&this.notification.notify(e,my.ERROR_PACKAGE_NOT_SUPPORTED,Ty,Ry.ERROR_PACKAGE_NOT_SUPPORTED),t.next=21;break;case 9:if(t.prev=9,t.t0=t.catch(2),wx.$TUICallEngine._callDataReport.setCodeAndMessage(my.ERROR_PACKAGE_NOT_SUPPORTED,JSON.stringify(t.t0)),wx.$TUICallEngine._callDataReport.uploadToKibana(),2905!==t.t0.code){t.next=17;break}this.notification.notify(e,my.ERROR_TIM_VERSION_OUTDATED,Cy,Ry.ERROR_TIM_VERSION_OUTDATED),t.next=21;break;case 17:throw r=null,i=0,e.capabilityCode===Rg.PRO?(r=\"\".concat((a=e.sdkAppID,s=void 0,s=V_(a)?\"\".concat(Ry.ERROR_PACKAGE_NOT_SUPPORTED):\"\".concat(Ty),s=s.replace(\"${purchaseAddress}\",G_(a))),\" \"),i=my.ERROR_PACKAGE_NOT_SUPPORTED):(r=\"\".concat(dC(e.sdkAppID),\" \"),i=my.ERROR_PACKAGE_NOT_PURCHASED),new fC(i,r);case 21:case\"end\":return t.stop()}var a,s}),t,this,[[2,9]])}))),function(t){return e.apply(this,arguments)})}]),r}(),CC=function(t){d(n,mC);var e=_(n);function n(t,r){return l(this,n),e.call(this,t,r)}return h(n,[{key:\"check\",value:function(t,e){void 0!==t.initReady&&this.rule.getInitReadyRule(t.api)!==t.initReady&&this.notification.notify(t,my.ERROR_INIT_FAIL,by,Ry.ERROR_INIT_FAIL)}}]),n}(),bC=function(){function t(){l(this,t),f(this,\"alertRule\",void 0),f(this,\"notification\",void 0),f(this,\"alert\",void 0)}return h(t,[{key:\"initializeBeans\",value:function(){this.alertRule=new pC,this.notification=new vC,this.alert=new IC,this.alert.addAlertHandler(new EC(this.alertRule,this.notification)),this.alert.addAlertHandler(new CC(this.alertRule,this.notification)),this.alert.addAlertHandler(new TC(this.alertRule,this.notification)),this.alert.addAlertHandler(new _C(this.alertRule,this.notification))}},{key:\"getAlert\",value:function(){return this.alert}}],[{key:\"getInstance\",value:function(){return this.instance||(this.instance=new t,this.instance.initializeBeans()),this.instance}}]),t}();f(bC,\"instance\",void 0);var DC=X,RC=$t,wC=Et,SC=ve,xC=Ts,LC=P,OC=Function,kC=DC([].concat),AC=DC([].join),NC={},UC=LC?OC.bind:function(t){var e=RC(this),n=e.prototype,r=xC(arguments,1),i=function(){var n=kC(r,xC(arguments));return this instanceof i?function(t,e,n){if(!SC(NC,e)){for(var r=[],i=0;i0&&void 0!==arguments[0]?arguments[0]:{},e=t.version,n=void 0===e?\"\":e,r=t.sdkAppId,i=void 0===r?0:r,a=t.userID,o=void 0===a?\"\":a,s=N_(),c=E_?\"uniminiprogram\":\"wxminiprogram\";this._callData={version:n,platform:s,framework:c,sdkAppId:i,userID:o,roomID:0,inviteID:\"\",callRole:gg,callScene:\"\",callType:mg,inviteeList:[],result:Sg.UNKNOWN,totalTime:0,totalScore:0,code:0,message:\"\",abilityBit:!1,enterRoomTime:\"\",sendSignalingTime:\"\",callAcceptTime:\"\",exitRoomTime:\"\",callEndTime:\"\",network:0,audio:0,video:0}}},{key:\"reset\",value:function(){this.initializeCallData(),this._ssoLog=null}},{key:\"clearCallDataAfterUpload\",value:function(){var t=this.getCallData(),e=t.version,n=t.sdkAppId,r=t.userID;this.initializeCallData({version:e,sdkAppId:n,userID:r})}},{key:\"uploadToKibana\",value:function(){try{this._ssoLog.setText(this.packageCallDataToKibana()).setEnd(),this.clearCallDataAfterUpload()}catch(t){}}}]),t}(),VC=function(){function t(e,n){l(this,t),f(this,\"_eventEmitter\",void 0),f(this,\"_callDataReport\",void 0),this._eventEmitter=e.emitter,this._callDataReport=n,this.registerListener()}return h(t,[{key:\"registerListener\",value:function(){this._eventEmitter.on(sg.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(sg.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(sg.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(sg.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(sg.REJECT,this.onReject.bind(this))}},{key:\"removeLister\",value:function(){this._eventEmitter.off(sg.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.off(sg.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.off(sg.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.off(sg.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.off(sg.REJECT,this.onReject.bind(this))}},{key:\"onCallEnd\",value:function(t){var e=t.data.totalTime,n=void 0===e?0:e;this._callDataReport.setTotalTime(n),this._callDataReport.setCallEndTime((new Date).getTime()),this._callDataReport.setResult(Sg.NORMAL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:\"onCallingCancel\",value:function(){this._callDataReport.getResult()||this._callDataReport.setResult(Sg.CANCEL),this._callDataReport.setCodeAndMessage(),this._callDataReport.uploadToKibana()}},{key:\"onNoResponse\",value:function(){this._callDataReport.setResult(Sg.TIMEOUT)}},{key:\"onLineBusy\",value:function(){this._callDataReport.setResult(Sg.BUSYLINE)}},{key:\"onReject\",value:function(){this._callDataReport.setResult(Sg.REJECT)}}]),t}();function GC(t){return HC.apply(this,arguments)}function HC(){return HC=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e===vg.AUDIO||e===vg.VIDEO){t.next=2;break}return t.abrupt(\"return\");case 2:return t.abrupt(\"return\",new Promise(function(){var t=c(a().mark((function t(n,r){var i,o,s,c,l,u;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i={microphone:!0,camera:e===vg.VIDEO},t.next=3,U_(i);case 3:if((o=t.sent)||e!==vg.AUDIO){t.next=16;break}return t.prev=5,t.next=8,wx.authorize({scope:Og.RECORD});case 8:t.next=16;break;case 10:t.prev=10,t.t0=t.catch(5),s=xg.MIC_TITLE,c=xg.MIC_CONTENT,BC(s,c),r();case 16:if(o||e!==vg.VIDEO){t.next=30;break}return t.prev=17,t.next=20,wx.authorize({scope:Og.RECORD});case 20:return t.next=22,wx.authorize({scope:Og.CAMERA});case 22:t.next=30;break;case 24:t.prev=24,t.t1=t.catch(17),l=xg.CAMERA_TITLE,u=xg.CAMERA_CONTENT,BC(l,u),r();case 30:n();case 31:case\"end\":return t.stop()}}),t,null,[[5,10],[17,24]])})));return function(e,n){return t.apply(this,arguments)}}()));case 3:case\"end\":return t.stop()}}),t)}))),HC.apply(this,arguments)}function BC(t,e){wx.showModal({title:t,content:e,confirmText:xg.CONFIRM_TEXT,success:function(t){t.confirm&&wx.openSetting()}})}var FC=xi,KC=X,zC=kr,JC=um,WC=Hm,$C=N,qC=RangeError,YC=String,XC=Math.floor,QC=KC(WC),ZC=KC(\"\".slice),tb=KC(1..toFixed),eb=function(t,e,n){return 0===e?n:e%2==1?eb(t,e-1,n*t):eb(t*t,e/2,n)},nb=function(t,e,n){for(var r=-1,i=n;++r<6;)i+=e*t[r],t[r]=i%1e7,i=XC(i/1e7)},rb=function(t,e){for(var n=6,r=0;--n>=0;)r+=t[n],t[n]=XC(r/e),r=r%e*1e7},ib=function(t){for(var e=6,n=\"\";--e>=0;)if(\"\"!==n||0===e||0!==t[e]){var r=YC(t[e]);n=\"\"===n?r:n+QC(\"0\",7-r.length)+r}return n};FC({target:\"Number\",proto:!0,forced:$C((function(){return\"0.000\"!==tb(8e-5,3)||\"1\"!==tb(.9,0)||\"1.25\"!==tb(1.255,2)||\"1000000000000000128\"!==tb(0xde0b6b3a7640080,0)}))||!$C((function(){tb({})}))},{toFixed:function(t){var e,n,r,i,a=JC(this),o=zC(t),s=[0,0,0,0,0,0],c=\"\",l=\"0\";if(o<0||o>20)throw new qC(\"Incorrect fraction digits\");if(a!=a)return\"NaN\";if(a<=-1e21||a>=1e21)return YC(a);if(a<0&&(c=\"-\",a=-a),a>1e-21)if(n=(e=function(t){for(var e=0,n=t;n>=4096;)e+=12,n/=4096;for(;n>=2;)e+=1,n/=2;return e}(a*eb(2,69,1))-69)<0?a*eb(2,-e,1):a/eb(2,e,1),n*=4503599627370496,(e=52-e)>0){for(nb(s,0,n),r=o;r>=7;)nb(s,1e7,0),r-=7;for(nb(s,eb(10,r,1),0),r=e-1;r>=23;)rb(s,1<<23),r-=23;rb(s,1<0?c+((i=l.length)<=o?\"0.\"+QC(\"0\",o-i)+l:ZC(l,0,i-o)+\".\"+ZC(l,i-o)):c+l}});var ab=function(){function t(){l(this,t)}return h(t,null,[{key:\"generateTaskID\",value:function(){return this.currentTaskID+=1}},{key:\"run\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Sg.TIMEOUT,e=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;n=i(i({},t===Sg.INTERVAL?{delay:2e3,count:0,backgroundTask:!0}:t===Sg.RAF?{fps:60,delay:16.6,count:0,backgroundTask:!0}:{delay:2e3,count:0,backgroundTask:!0}),n),S_(e)&&(n=i(i({},n),e)),o(t)===Sg.FUNCTION&&(e=t,t=Sg.TIMEOUT);var r=i({taskID:this.generateTaskID(),loopCount:0,intervalID:null,timeoutID:null,rafID:null,taskName:t,callback:e},n);return this.taskMap.set(r.taskID,r),this[t](r),r.taskID}},{key:\"interval\",value:function(t){var e=this;return t.intervalID=setInterval((function(){t.callback(),t.loopCount+=1,e.isBreakLoop(t)}),t.delay)}},{key:\"timeout\",value:function(t){var e=this;return t.timeoutID=setTimeout((function n(){if(t.callback(),t.loopCount+=1,!e.isBreakLoop(t))return t.timeoutID=setTimeout(n,t.delay)}),t.delay)}},{key:\"raf\",value:function(t){var e=this;t.delay=(1e3/t.fps).toFixed(2);var n,r=j_(),i=function i(){if(document.hidden&&t.backgroundTask){if(n=j_()-r,r=j_(),t.callback(),t.loopCount+=1,e.isBreakLoop(t))return;return t.timeoutID=setTimeout(i,t.delay-Math.floor(n%t.delay))}if((n=j_()-r)>=t.delay&&(r=j_()-Math.floor(n%t.delay),t.callback(),t.loopCount+=1),!e.isBreakLoop(t))return t.rafID=requestAnimationFrame(i)};if(t.rafID=requestAnimationFrame(i),t.backgroundTask){var a=function(){if(document.hidden){var e=j_()-r;e>=t.delay?i():t.timeoutID=setTimeout(i,t.delay-e)}};document.addEventListener(\"visibilitychange\",a),t.onVisibilitychange=a,document.hidden&&a()}return t.taskID}},{key:\"hasTask\",value:function(t){return this.taskMap.has(t)}},{key:\"clearTask\",value:function(t){if(!this.taskMap.has(t))return!0;var e=this.taskMap.get(t),n=e.intervalID,r=e.timeoutID,i=e.onVisibilitychange;return n&&clearInterval(n),r&&clearTimeout(r),i&&document.removeEventListener(\"visibilitychange\",i),this.taskMap.delete(t),!0}},{key:\"isBreakLoop\",value:function(t){return!this.taskMap.has(t.taskID)||0!==t.count&&t.loopCount>=t.count&&(this.clearTask(t.taskID),!0)}}]),t}();f(ab,\"taskMap\",new Map),f(ab,\"currentTaskID\",1);var ob={serviceCommand:\"\".concat(Sg.CALLKIT_RECORDS_SVR,\".*\")},sb=\"sendTRTCCustomData\",cb=function(){function t(e){l(this,t),f(this,\"_callRecordData\",void 0),f(this,\"_tim\",void 0),f(this,\"_heartbeat\",void 0),f(this,\"_lastHeartBeatTime\",void 0),f(this,\"_bodyStatus\",void 0),this._tim=e.tim,this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=Sg.WAITING,this.initializeCallData(e)}var e,n,r,o;return h(t,[{key:\"getCallRecordData\",value:function(){return this._callRecordData}},{key:\"initializeCallData\",value:function(t){var e=t||{},n=e.version,r=void 0===n?\"\":n,i=e.userID,a=void 0===i?\"\":i,o={name:y_.platform,version:y_.version},s={version:1,command:Sg.EVENT_REPORT,sdk_version:r,seq:0,os_name:Sg.MINI_PROGRAM,os_version:o.version||\"\",device_name:o.name||\"\",framework:Sg.MINI_PROGRAM,call_type:\"\",media_type:\"\",client_ts:0,role:gg,user_id:a,room_id:\"\",call_id:\"\"};this._callRecordData={head:s,body:{event_type:\"\",code:0,message:\"\",invitee_list:[]}}}},{key:\"reset\",value:function(){this.initializeCallData()}},{key:\"_setCallType\",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_type:t}))}},{key:\"_setMediaType\",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{media_type:PC(t)}))}},{key:\"_setCallRole\",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{role:t}))}},{key:\"_setUserID\",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{user_id:t}))}},{key:\"_setRoomID\",value:function(t){t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{room_id:\"\".concat(t)}))}},{key:\"_setInviteID\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:\"\";t&&(this._callRecordData.head=i(i({},this._callRecordData.head),{},{call_id:t}))}},{key:\"_setEventType\",value:function(t){t&&(this._callRecordData.body=i(i({},this._callRecordData.body),{},{event_type:t}))}},{key:\"_setInviteeList\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this._callRecordData.body=i(i({},this._callRecordData.body),{},{invitee_list:t})}},{key:\"_setSeq\",value:function(){var t=this.getCallRecordData().head.seq;this._callRecordData.head=i(i({},this._callRecordData.head),{},{seq:t+1})}},{key:\"setBodyStatus\",value:function(t){if(t){var e=Sg.WAITING;switch(t){case cg.CALLING:e=Sg.WAITING;break;case cg.CONNECTED:e=Sg.CALLING}this._bodyStatus=e}}},{key:\"eventUpload\",value:(o=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.userID,u=e.roomID,h=e.inviteID,f=e.inviteeList,d=void 0===f?[]:f,r){t.next=3;break}return t.abrupt(\"return\");case 3:return this._callRecordData.head=i(i({},this._callRecordData.head),{},{command:Sg.EVENT_REPORT,client_ts:Math.floor(Date.now()/1e3)}),this._setCallType(o),this._setMediaType(s),this._setCallRole(c),this._setUserID(l),this._setRoomID(u),this._setInviteID(h),this._setEventType(r),this._setInviteeList(d),this._setSeq(),p=this.getCallRecordData(),v=p.head,g=p.body,y={head:i(i({},v),{},{role:MC(v.role)}),body:g},I=i(i({},ob),{},{data:JSON.stringify(y)}),t.next=18,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(sb,I);case 18:case\"end\":return t.stop()}}),t,this)}))),function(t){return o.apply(this,arguments)})},{key:\"eventUploadNotSave\",value:(r=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.eventType,o=e.callType,s=e.mediaType,c=e.callRole,l=e.roomID,u=e.inviteID,this._setSeq(),h=this.getCallRecordData(),f=h.head,d=h.body,p={head:i(i({},f),{},{role:MC(c),call_id:u,call_type:o,media_type:PC(s),room_id:\"\".concat(l),client_ts:Math.floor(Date.now()/1e3)}),body:i(i({},d),{},{event_type:r})},v=i(i({},ob),{},{data:JSON.stringify(p)}),t.next=7,null==this||null===(n=this._tim)||void 0===n?void 0:n.callExperimentalAPI(sb,v);case 7:case\"end\":return t.stop()}}),t,this)}))),function(t){return r.apply(this,arguments)})},{key:\"heartBeatUpload\",value:(n=c(a().mark((function t(){var e,n,r,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._setSeq(),n=this._callRecordData.head,r={head:i(i({},n),{},{role:MC(n.role),clientTs:Date.now(),command:Sg.HEART_BEAT}),body:{status:this._bodyStatus}},o=i(i({},ob),{},{data:r}),t.next=6,null==this||null===(e=this._tim)||void 0===e?void 0:e.callExperimentalAPI(sb,o);case 6:case\"end\":return t.stop()}}),t,this)}))),function(){return n.apply(this,arguments)})},{key:\"startHeartbeat\",value:function(){-1===this._heartbeat&&(K_.info(\"start heart beat...\"),this._heartbeat=ab.run(Sg.TIMEOUT,this.doHeartbeat.bind(this),{delay:2e3,count:0,backgroundTask:!0}))}},{key:\"stopHeartbeat\",value:function(){-1!==this._heartbeat&&(K_.info(\"stop heart beat\"),ab.clearTask(this._heartbeat),this._heartbeat=-1,this._lastHeartBeatTime=-1,this._bodyStatus=Sg.WAITING)}},{key:\"doHeartbeat\",value:(e=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this.heartBeatUpload(),e=Date.now(),this._lastHeartBeatTime>0&&e-this._lastHeartBeatTime>1e4&&K_.warn(\"heartbeat took \".concat(e-this._lastHeartBeatTime)),this._lastHeartBeatTime=e;case 4:case\"end\":return t.stop()}}),t,this)}))),function(){return e.apply(this,arguments)})}]),t}(),lb=function(){function t(e,n){l(this,t),f(this,\"_eventEmitter\",void 0),f(this,\"_callRecordDataReport\",void 0),f(this,\"_isCallAccepted\",void 0),this._eventEmitter=e,this._callRecordDataReport=n,this._isCallAccepted=!1,this.registerListener()}return h(t,[{key:\"registerListener\",value:function(){this._eventEmitter.on(sg.ON_CALL_RECEIVED,this.onCallReceived.bind(this)),this._eventEmitter.on(sg.USER_ACCEPT,this.onCallAccepted.bind(this)),this._eventEmitter.on(sg.CALL_END,this.onCallEnd.bind(this)),this._eventEmitter.on(sg.CALLING_CANCEL,this.onCallingCancel.bind(this)),this._eventEmitter.on(sg.NO_RESP,this.onNoResponse.bind(this)),this._eventEmitter.on(sg.LINE_BUSY,this.onLineBusy.bind(this)),this._eventEmitter.on(sg.REJECT,this.onReject.bind(this))}},{key:\"removeLister\",value:function(){this._eventEmitter.off(sg.ON_CALL_RECEIVED,this.onCallReceived),this._eventEmitter.off(sg.USER_ACCEPT,this.onCallAccepted),this._eventEmitter.off(sg.CALL_END,this.onCallEnd),this._eventEmitter.off(sg.CALLING_CANCEL,this.onCallingCancel),this._eventEmitter.off(sg.NO_RESP,this.onNoResponse),this._eventEmitter.off(sg.LINE_BUSY,this.onLineBusy),this._eventEmitter.off(sg.REJECT,this.onReject)}},{key:\"onCallReceived\",value:function(){this._callRecordDataReport.startHeartbeat()}},{key:\"onCallAccepted\",value:function(){var t=this._callRecordDataReport.getCallRecordData().head;if((null==t?void 0:t.role)===Sg.INVITER){if(this._isCallAccepted&&t.call_type===Sg.GROUP)return;this._isCallAccepted=!0;var e={eventType:Sg.CALL_ACCEPTED};this._callRecordDataReport.eventUpload(e),this._callRecordDataReport.setBodyStatus(cg.CONNECTED)}}},{key:\"onCallEnd\",value:function(){var t={eventType:Sg.CALL_END};this._isCallAccepted=!1,this._callRecordDataReport.eventUpload(t),this._callRecordDataReport.stopHeartbeat()}},{key:\"onCallingCancel\",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head,n=e.role===Sg.INVITER?Sg.CANCEL_CALL:Sg.CALL_CANCELED;this._isCallAccepted=!1;var r=(t.data||{}).reason;((void 0===r?\"\":r)===Sg.NORMAL||e.role===Sg.INVITER&&e.call_type===Sg.GROUP)&&this._callRecordDataReport.eventUpload({eventType:n}),this._callRecordDataReport.stopHeartbeat()}},{key:\"onNoResponse\",value:function(){this._uploadInC2C(Sg.TIMEOUT)}},{key:\"onLineBusy\",value:function(){this._uploadInC2C(Sg.BUSYLINE)}},{key:\"onReject\",value:function(){this._uploadInC2C(Sg.REJECT)}},{key:\"_uploadInC2C\",value:function(t){var e=this._callRecordDataReport.getCallRecordData().head;if((null==e?void 0:e.call_type)===Sg.SINGLE){var n=\"\";switch(t){case Sg.TIMEOUT:n=e.role===Sg.INVITER?Sg.CALL_MISSED:Sg.NOT_ANSWER_CALL;break;case Sg.REJECT:n=e.role===Sg.INVITER&&Sg.CALL_REJECTED;break;case Sg.BUSYLINE:n=e.role===Sg.INVITER?Sg.CALL_BUSY:Sg.NOT_ANSWER_CALL;break;default:return}this._callRecordDataReport.eventUpload({eventType:n})}}}]),t}(),ub=\"TUICallEngine\",hb=uy({clsConfig:{endpoint:\"https://ap-nanjing.cls.tencentcs.com\",topicId:\"a1310e66-a3f5-4572-a1c3-7a327a27496d\"}}),fb=function(){function r(i){l(this,r),f(this,\"_initReady\",!1),f(this,\"_timExternal\",!1),f(this,\"_initialCallId\",\"\"),this.data={config:{sdkAppID:i.sdkAppID,userID:\"\",userSig:\"\",type:1}},this.initData(),this.EVENT=sg,this.MEDIA_TYPE=vg,this.CALL_TYPE=vg,this._emitter=new og,this.TRTC=new e(this,{TUIScene:\"TUICallKit\"});var a=\"TUICallKit\";try{(wx&&wx._isTIMCallKit||wx&&wx.getStorageSync&&wx.getStorageSync(\"_isTIMCallKit\")||getApp&&getApp()&&getApp().globalData&&getApp().globalData._isTIMCallKit)&&(a=\"TIMCallKit\")}catch(t){console.error(t)}wx.TUIScene=a,this._callDataReport=new jC({version:Oy,sdkAppId:i.sdkAppID}),this._dataReportObserver=new VC({emitter:this._emitter},this._callDataReport),i.tim?(this.tim=i.tim,this._timExternal=!0):wx.$TIM?(this.tim=wx.$TIM,this._timExternal=!0):this.tim=n.create({SDKAppID:i.sdkAppID}),this._callRecordReport=new cb({version:Oy,tim:this.tim}),this._recordReportObserver=new lb(this._emitter,this._callRecordReport),wx.$TSignaling||(wx.$TSignaling=new t({SDKAppID:i.sdkAppID,tim:this.tim,isRejectNotifyAll:!0})),wx.getSystemInfoSync().platform===Sg.DEVTOOLS&&K_.warn(\"\".concat(Lg)),wx.setStorageSync(\"sdkAppId\",i.sdkAppID),this.TSignalingClient=new xy({TSignaling:wx.$TSignaling}),this.TRTCCallingDelegate=new Ly({emitter:this._emitter}),this._eventStatController=new Z_;var o=new z_(J_);z_.bindController(this._eventStatController),o.setText(\"version=\".concat(Oy)).setEnd(),this._initLogger(i),K_.info(\"\".concat(ub,\" SDK Version:\").concat(Oy,\", SDKAppID:\").concat(i.sdkAppID))}var o,s,u,d,p,v,g,y,I,m,E,_,C,b,D,R,w,S,x,L,O,k,A,N,U,P,M,j,V,G,H,B,F,K,z,J,W;return h(r,[{key:\"destroyInstance\",value:function(){if(r.instance){this._callDataReport&&this._callDataReport.reset&&this._callDataReport.reset(),this._dataReportObserver&&this._dataReportObserver.reset&&this._dataReportObserver.removeLister(),this._callRecordReport&&this._callRecordReport.reset(),this._recordReportObserver&&this._recordReportObserver.removeLister(),r.instance.destroyed(),r.instance=null;try{wx.removeStorageSync(\"sdkAppId\"),wx.removeStorageSync(\"userId\")}catch(t){console.error(t)}}}},{key:\"_initLogger\",value:function(t){var e=this;wx.getSystemInfo({success:function(t){var e=t.brand,n=t.model,r=t.language,i=t.platform,a=t.version;hb.updateGetReportData((function(){return{useragent:{brand:e,model:n,language:r,platform:i,version:a}}}))}}),this._logger=hb,this._logger.updateGetReportData((function(){return{app:\"TUICallEngine-mini\",version:Oy,platform:Sg.MINI_PROGRAM,sdkappid:t.sdkAppID,time:+new Date,userid:e.getUserID(),callinfo:{roomid:e.getRoomID(),inviteid:e.getInitialCallId(),callrole:e.isInviter()?Sg.INVITER:Sg.INVITEE,groupid:e.getGroupID(),calltype:e.getCallType(),handledInviteeList:e.getHandledInviteeList(),unHandledInviteeList:e.getUnHandledInviteeList()},callkitversion:t.callkitVersion||Sg.UNKNOWN,framework:t.frameWork||Sg.UNKNOWN,isfromchat:t.chat?\"true\":\"false\"}}))}},{key:\"setLogLevel\",value:function(t){\"number\"!=typeof t||isNaN(t)?K_.error(\"\".concat(ub,\",setLogLevel parameter must be a number(0~4)\")):(K_.setLevel(t),this.TSignalingClient.setLogLevel(t),this.TRTC.setLogLevel(t))}},{key:\"initData\",value:function(){var t={callStatus:cg.IDLE,soundMode:this.data.config.type===vg.AUDIO?Dg.EAR:Dg.SPEAKER,active:!1,invitation:{inviteID:\"\",inviter:\"\",type:\"\",roomID:\"\"},startTalkTime:0,localUser:null,remoteUsers:[],remoteID:\"\",timer:null,chatTimeNum:0,chatTime:\"00:00:00\",screen:\"pusher\",pusher:{},playerList:[],isInviter:!0,unHandledInviteeList:[],handledInviteeList:[],_inviterInviteID:{},_audioVideoSwitchIdList:[],_acceptedUserObject:{},isGroupCall:!1,groupID:\"\",switchCallModeStatus:!0,enterRoomStatus:!1,devicePermission:!1};this.data=i(i({},this.data),t)}},{key:\"handleNewInvitationReceived\",value:(W=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"TSignaling.NEW_INVITATION_RECEIVED\",{text:{data:i(i({},e),{},{currentCallStatus:o})},type:\"event\"}),o=this.getCallStatus(),K_.log(\"\".concat(ub,\".onNewInvitationReceived - params:\"),e,\"currentCallStatus:\".concat(o)),s=e.data,c=s.inviter,l=s.inviteeList,u=s.data,h=s.inviteID,f=s.groupID,M_((d=JSON.parse(u)).businessID)){t.next=7;break}return t.abrupt(\"return\");case 7:if(p=(null==d||null===(n=d.data)||void 0===n?void 0:n.initialCallId)||\"\",this.getUserID()!==c){t.next=10;break}return t.abrupt(\"return\");case 10:if(g={inviter:c,inviteeList:l,inviteID:h,isGroupCall:v=!!f,inviteData:d,groupID:f,initialCallId:p,currentCallStatus:o,inCallUserIDs:(null==d?void 0:d.inCallUserIDs)||[]},\"hangup\"!==(null==d||null===(r=d.data)||void 0===r?void 0:r.cmd)){t.next=19;break}if(K_.log(\"\".concat(ub,\".hangup - params:\"),c,d,this.getHandledInviteeList(),this.getUnHandledInviteeList(),o,v),o!==cg.IDLE){t.next=16;break}return t.abrupt(\"return\");case 16:return t.next=18,this.handleHangupSignal(g);case 18:return t.abrupt(\"return\");case 19:if(v||!this.judgeSwitchCallMode(d)){t.next=25;break}if(o===cg.IDLE||d.room_id!==this.data.invitation.roomID){t.next=24;break}return t.next=23,this.handleSwitchCallModeTSignaling(h,d);case 23:this.addAudioVideoSwitchIdList(h);case 24:return t.abrupt(\"return\");case 25:if(o===cg.IDLE){t.next=30;break}return t.next=28,this.TSignalingClient.reject({inviteID:h,type:u.call_type,lineBusy:\"line_busy\"});case 28:return this.getCallRecordReport().eventUploadNotSave({inviteID:p||h,callRole:Sg.INVITEE,eventType:Sg.IGNORE_CALL,roomID:d.room_id,mediaType:d.call_type,callType:f?Sg.GROUP:Sg.SINGLE}),t.abrupt(\"return\");case 30:this.handleInvitedSignal(g);case 31:case\"end\":return t.stop()}}),t,this)}))),function(t){return W.apply(this,arguments)})},{key:\"handleHangupSignal\",value:(J=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.inviter,r=e.currentCallStatus,o=e.inviteData,s=e.inviteeList,c=this.isGroupCall(),l=this.isInviter(),r!==cg.CALLING){t.next=11;break}if(u=this.getUnHandledInviteeList(),h=this.getHandledInviteeList(),-1!==u.indexOf(n)&&this.deleteUnHandledInviteeList([n]),-1!==h.indexOf(n)){t.next=9;break}return t.abrupt(\"return\");case 9:t.next=15;break;case 11:if(this.deleteHandledInviteeList([n]),!(-1===(f=this.getHandledInviteeList()).indexOf(n)&&f.length>1)){t.next=15;break}return t.abrupt(\"return\");case 15:if(d=this.generateCallEndData({totalTime:o.call_end||0}),c){t.next=22;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=20,this._resetTUICallEngine();case 20:case 31:t.next=46;break;case 22:if(this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),!l){t.next=33;break}if(1!==p.length||0!==v.length){t.next=31;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=31,this._resetTUICallEngine();case 33:if(r!==cg.CALLING){t.next=41;break}if(-1!==s.indexOf(this.getUserID())&&this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),0!==p.length||1!==v.length){t.next=41;break}return g=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},g),{},{reason:Sg.NORMAL})),t.next=41,this._resetTUICallEngine();case 41:if(r!==cg.CONNECTED){t.next=46;break}if(1!==p.length||0!==v.length){t.next=46;break}return this.TRTCCallingDelegate.onCallEnd(d),t.next=46,this._resetTUICallEngine();case 46:case\"end\":return t.stop()}}),t,this)}))),function(t){return J.apply(this,arguments)})},{key:\"handleSwitchCallModeTSignaling\",value:(z=c(a().mark((function t(e,n){var r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r={inviteID:e,type:n.call_type},i={cmd:\"switchToVideo\"},n.call_type===vg.VIDEO&&(r.switch_to_audio_call=\"switch_to_audio_call\",i.cmd=\"switchToAudio\"),t.next=5,this.TSignalingClient.accept(r,i);case 5:o=t.sent,this.setSwitchCallModeStatus(!1),this.handleCallMode(n.call_type,o);case 8:case\"end\":return t.stop()}}),t,this)}))),function(t,e){return z.apply(this,arguments)})},{key:\"judgeSwitchCallMode\",value:function(t){return t.switch_to_audio_call&&\"switch_to_audio_call\"===t.switch_to_audio_call||t.data&&\"switchToAudio\"===t.data.cmd||t.data&&\"switchToVideo\"===t.data.cmd}},{key:\"handleCallMode\",value:function(t,e){K_.log(\"\".concat(ub,\".handleCallMode - type\"),t);var n=t!==vg.VIDEO;this.setPusherAttributesHandler({enableCamera:n}),n?(this.data.config.type=vg.VIDEO,this.data.invitation.type=vg.VIDEO):(this.data.config.type=vg.AUDIO,this.data.invitation.type=vg.AUDIO),this.TRTCCallingDelegate.onCallMode({type:this.data.config.type,message:e.data.message}),this.setSwitchCallModeStatus(!0)}},{key:\"handleInvitedSignal\",value:(K=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.inviter,r=e.inviteeList,o=e.isGroupCall,s=e.groupID,c=e.inviteID,l=e.inviteData,u=e.inCallUserIDs,h=void 0===u?[]:u,f=e.initialCallId,d=void 0===f?\"\":f,this.data.remoteID=n,this.data.config.type=l.call_type,this.data.invitation.inviteID=c,this.data.invitation.inviter=n,this.data.invitation.type=l.call_type,this.data.invitation.roomID=l.room_id,this.data.isInviter=!1,this.data.isGroupCall=o,this.data.roomID=l.room_id,this.addHandledInviteeList([n]),this.addUnHandledInviteeList([].concat(T(r),T(h))),this.addAcceptedUserList(c,[n]),this.addInviterInviteId(c,[n].concat(T(r))),this.setInitialCallId(d),p=h.filter((function(t){return-1===r.indexOf(t)})),o&&(this.data.groupID=s),this.changeCallStatus(cg.CALLING),K_.log(\"\".concat(ub,\" NEW_INVITATION_RECEIVED invitation: \"),this.data.callStatus,this.data.invitation),v={sponsor:n,inviteeList:r,userIDList:[].concat(T(r),T(p)),isFromGroup:o,inviteID:c,groupID:s,inviteData:{version:l.version,callType:l.call_type,roomID:l.room_id},userData:l.userData,calleeIdList:r,callMediaType:l.call_type},this.setPusherAttributesHandler({enableCamera:this.data.config.type===vg.VIDEO}),g=i(i({},g=this.getCallDataReport().getCallData()),{},{userId:this.getUserID(),roomID:l.room_id,inviteID:c,callRole:Ig,callType:l.call_type,inviteeList:r}),y={eventType:Sg.RECEIVE_CALL,callType:s?Sg.GROUP:Sg.SINGLE,mediaType:l.call_type,callRole:Sg.INVITEE,userID:this.getUserID(),roomID:l.room_id,inviteID:d||c},this.getCallRecordReport().eventUpload(y),this.getCallDataReport().setCallData(g),I=this.generateEventData()||{},this.TRTCCallingDelegate.onInvited(i(i({},I),v)),t.next=30,U_({camera:!0});case 30:this.data.devicePermission=t.sent,this.data.devicePermission&&this.data.config.type===vg.VIDEO&&wx.createLivePusherContext().startPreview();case 32:case\"end\":return t.stop()}}),t,this)}))),function(t){return K.apply(this,arguments)})},{key:\"addInviterInviteId\",value:function(t,e){0!==e.length&&(0===(this.data._inviterInviteID[t]||[]).length?this.data._inviterInviteID[t]=e:this.data._inviterInviteID[t]=[].concat(T(this.data._inviterInviteID[t]),T(e)))}},{key:\"handleInviteeAccepted\",value:(F=c(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"TSignaling.INVITEE_ACCEPTED\",{text:{data:i(i({},e),{},{currentCallStatus:this.data.callStatus}),type:\"event\"}}),K_.log(\"\".concat(ub,\" onInviteeAccepted - params:\"),e),M_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=5;break}return t.abrupt(\"return\");case 5:if(r=e.data.invitee,o=e.data.inviteID,-1!==this.getTotalInviterInviteIdList().indexOf(o)){t.next=9;break}return t.abrupt(\"return\");case 9:if(this.data.callStatus!==cg.IDLE){t.next=11;break}return t.abrupt(\"return\");case 11:if(this.isGroupCall()||!this.judgeSwitchCallMode(n)||this.data.switchCallModeStatus){t.next=14;break}return this.handleCallMode(this.data.invitation.type),t.abrupt(\"return\");case 14:if(s=this.getCallStatus(),r!==this.getUserID()||s!==cg.CALLING){t.next=21;break}return c=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},c)),t.next=20,this._resetTUICallEngine();case 20:return t.abrupt(\"return\");case 21:return this.isInviter()&&this.data.callStatus===cg.CALLING&&this.changeCallStatus(cg.CONNECTED),this.getCallDataReport().setCallAcceptTime((new Date).getTime()),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.addAcceptedUserList(o,[r]),t.next=28,this.getUserProfile(this.data.unHandledInviteeList.map((function(t){return{userID:t}})));case 28:l=t.sent,this.TRTCCallingDelegate.onUserAccept({userID:r,userList:l});case 30:case\"end\":return t.stop()}}),t,this)}))),function(t){return F.apply(this,arguments)})},{key:\"handleInviteeRejected\",value:(B=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"TSignaling.INVITEE_REJECTED\",{text:{data:e},type:\"event\"}),K_.log(\"\".concat(ub,\" onInviteeRejected - params\"),e),r=e.data.inviteID,M_(null==(o=JSON.parse(e.data.data))?void 0:o.businessID)){t.next=6;break}return t.abrupt(\"return\");case 6:if(this.isGroupCall()||this.getSwitchCallModeStatus()||-1===this.getAudioVideoSwitchIdList().indexOf(r)){t.next=10;break}return K_.log(\"\".concat(ub,\".onInviteeRejected - Audio and video switching is not available\")),this.setSwitchCallModeStatus(!0),t.abrupt(\"return\");case 10:if(s=e.data.invitee,c=e.data.inviter,l=this.getUserID(),u=this.getCallStatus(),-1!==this.getInviterInviteIdList().indexOf(r)){t.next=19;break}if(!this.isInviter()||-1===this.getInviterInviteIdUserList().indexOf(s)){t.next=17;break}return t.abrupt(\"return\");case 17:return this.deleteUnHandledInviteeList([s]),t.abrupt(\"return\");case 19:if(u!==cg.IDLE){t.next=21;break}return t.abrupt(\"return\");case 21:if(h=this.generateEventData(),l!==s||u!==cg.CALLING){t.next=27;break}return this.TRTCCallingDelegate.onCancel(i({inviteID:this.data.invitation.inviteID,invitee:s,userID:s},h)),t.next=26,this._resetTUICallEngine();case 26:return t.abrupt(\"return\");case 27:if(f=this.isGroupCall(),d=this.isInviter(),this.deleteUnHandledInviteeList([s]),p=this.getUnHandledInviteeList(),v=this.getHandledInviteeList(),g=i({inviteID:this.data.invitation.inviteID,invitee:l,userID:l},h),y={inviteID:this.data.invitation.inviteID,invitee:s,userID:s},I=this.data.invitation,u!==cg.CONNECTED){t.next=38;break}if(-1===v.indexOf(s)){t.next=38;break}return t.abrupt(\"return\");case 38:if(!(\"line_busy\"===o.line_busy||\"\"===o.line_busy||null!=o&&null!==(n=o.data)&&void 0!==n&&n.message&&\"lineBusy\"===o.data.message)){t.next=52;break}if(c===I.inviter&&this.TRTCCallingDelegate.onLineBusy({inviteID:this.data.invitation.inviteID,invitee:s,userID:s}),f){t.next=46;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.BUSYLINE})),t.next=44,this._resetTUICallEngine();case 44:t.next=50;break;case 46:if(0!==p.length||1!==v.length){t.next=50;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.BUSYLINE})),t.next=50,this._resetTUICallEngine();case 50:case 57:t.next=78;break;case 52:if(f){t.next=59;break}return this.TRTCCallingDelegate.onReject(y),this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.REJECT})),t.next=57,this._resetTUICallEngine();case 59:if(this.TRTCCallingDelegate.onReject(y),u!==cg.CALLING){t.next=72;break}if(!d){t.next=68;break}if(0!==p.length||1!==v.length){t.next=66;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.REJECT})),t.next=66,this._resetTUICallEngine();case 66:t.next=72;break;case 68:if(1!==p.length||0!==v.length){t.next=72;break}return this.TRTCCallingDelegate.onCancel(i(i({},g),{},{reason:Sg.REJECT})),t.next=72,this._resetTUICallEngine();case 72:if(u!==cg.CONNECTED){t.next=78;break}if(0!==p.length||1!==v.length){t.next=78;break}return m=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(m),t.next=78,this._resetTUICallEngine();case 78:case\"end\":return t.stop()}}),t,this)}))),function(t){return B.apply(this,arguments)})},{key:\"handleInvitationCancelled\",value:(H=c(a().mark((function t(e){var n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"TSignaling.INVITATION_CANCELLED\",{text:{data:e,type:\"event\"}}),this.data.invitation.inviteID===e.data.inviteID){t.next=3;break}return t.abrupt(\"return\");case 3:if(M_(null==(n=JSON.parse(e.data.data))?void 0:n.businessID)){t.next=6;break}return t.abrupt(\"return\");case 6:if(this.data.callStatus!==cg.IDLE){t.next=8;break}return t.abrupt(\"return\");case 8:if(-1!==this.getInviterInviteIdList().indexOf(e.data.inviteID)){t.next=10;break}return t.abrupt(\"return\");case 10:return K_.log(ub,\"onInvitationCancelled\",\"inviteID:\".concat(e.data.inviteID,\" inviter:\").concat(e.data.inviter,\" data:\").concat(e.data.data)),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:e.data.inviter,userID:e.data.inviter},r),{},{reason:Sg.NORMAL})),t.next=15,this._resetTUICallEngine();case 15:case\"end\":return t.stop()}}),t,this)}))),function(t){return H.apply(this,arguments)})},{key:\"handleInvitationTimeout\",value:(G=c(a().mark((function t(e){var n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"TSignaling.INVITATION_TIMEOUT\",{text:{data:e,type:\"event\"}}),r=e.data,o=r.inviter,s=r.inviteeList,c=void 0===s?[]:s,l=r.inviteID,u=this.getUserID(),h=this.isGroupCall(),f=this.isInviter(),d=this.getCallStatus(),this.deleteUnHandledInviteeList(c),K_.warn(\"\".concat(ub,\".onInvitationTimeout - params:\"),e,\"currentUserID:\".concat(u,\" isInviter:\").concat(f,\" isGroupCall:\").concat(h,\" \\n currentCallStatus:\").concat(d,\" inviteID:\").concat(null==this||null===(n=this._newInvitationData)||void 0===n?void 0:n.inviteID)),-1!==this.getInviterInviteIdList().indexOf(l)){t.next=10;break}return t.abrupt(\"return\");case 10:if(d!==cg.IDLE){t.next=12;break}return t.abrupt(\"return\");case 12:if(p=this.getHandledInviteeList(),v=this.getUnHandledInviteeList(),g={groupID:this.data.groupID,inviteID:this.data.invitation.inviteID,sponsor:o,timeoutUserList:c,userIDList:c},y=this.generateEventData(),I=i(i({inviteID:this.data.invitation.inviteID,invitee:u,userID:u},y),{},{reason:Sg.TIMEOUT}),h){t.next=23;break}return f?(this.TRTCCallingDelegate.onNoResp(g),this.TRTCCallingDelegate.onCancel(I)):(this.TRTCCallingDelegate.onCancel(I),m=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},m),{},{eventType:Sg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}))),t.next=21,this._resetTUICallEngine();case 21:t.next=48;break;case 23:if(d!==cg.CALLING){t.next=41;break}if(!f){t.next=32;break}if(this.TRTCCallingDelegate.onNoResp(g),0!==v.length){t.next=30;break}return this.TRTCCallingDelegate.onCancel(I),t.next=30,this._resetTUICallEngine();case 30:t.next=41;break;case 32:if(-1!==c.indexOf(u)){t.next=36;break}this.TRTCCallingDelegate.onNoResp(g),t.next=39;break;case 36:return this.TRTCCallingDelegate.onCancel(I),t.next=39,this._resetTUICallEngine();case 39:E=this.getCallRecordReport().getCallRecordData().head,this.getCallRecordReport().eventUpload(i(i({},E),{},{eventType:Sg.NOT_ANSWER_CALL,inviteID:this.getInitialCallId()}));case 41:if(d!==cg.CONNECTED){t.next=48;break}if(this.TRTCCallingDelegate.onNoResp(g),1!==p.length||0!==v.length){t.next=48;break}return _=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(_),t.next=48,this._resetTUICallEngine();case 48:case\"end\":return t.stop()}}),t,this)}))),function(t){return G.apply(this,arguments)})},{key:\"handleSDKReady\",value:function(){var t=this;this._logger.info(\"ChatSdkEvent.SDK_READY\",{text:{type:\"event\"}}),K_.log(ub,\"TSignaling SDK ready\"),this.TSignalingResolve(),this.TRTCCallingDelegate.onSdkReady({message:\"SDK ready\"}),this.tim.getMyProfile().then((function(e){t.data.localUser=e.data})).catch((function(t){K_.warn(\"getMyProfile error:\",t)}))}},{key:\"handleKickedOut\",value:(V=c(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"ChatSdkEvent.KICKED_OUT\",{text:{type:\"event\"}}),this.getCallStatus()!==cg.CONNECTED){t.next=6;break}return e=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(e),t.next=6,this._resetTUICallEngine();case 6:if(this.getCallStatus()!==cg.CALLING){t.next=14;break}return n=this.getUserID(),r=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:n,userID:n},r),{},{reason:Sg.BANNED})),t.next=12,this.cancel();case 12:return t.next=14,this._resetTUICallEngine();case 14:this._initReady=!1,this.TRTCCallingDelegate.onKickedOut({message:\"kicked out\"});case 16:case\"end\":return t.stop()}}),t,this)}))),function(){return V.apply(this,arguments)})},{key:\"_addTSignalingEvent\",value:function(){wx.$TSignaling.on(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived,this),wx.$TSignaling.on(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted,this),wx.$TSignaling.on(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected,this),wx.$TSignaling.on(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled,this),wx.$TSignaling.on(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout,this),wx.$TSignaling.on(t.EVENT.SDK_READY,this.handleSDKReady,this),wx.$TSignaling.on(t.EVENT.KICKED_OUT,this.handleKickedOut,this),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.on(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:\"_removeTSignalingEvent\",value:function(){wx.$TSignaling.off(t.EVENT.NEW_INVITATION_RECEIVED,this.handleNewInvitationReceived),wx.$TSignaling.off(t.EVENT.INVITEE_ACCEPTED,this.handleInviteeAccepted),wx.$TSignaling.off(t.EVENT.INVITEE_REJECTED,this.handleInviteeRejected),wx.$TSignaling.off(t.EVENT.INVITATION_CANCELLED,this.handleInvitationCancelled),wx.$TSignaling.off(t.EVENT.INVITATION_TIMEOUT,this.handleInvitationTimeout),wx.$TSignaling.off(t.EVENT.SDK_READY,this.handleSDKReady),wx.$TSignaling.off(t.EVENT.KICKED_OUT,this.handleKickedOut),t.EVENT.MESSAGE_SENT_BY_ME&&wx.$TSignaling.off(t.EVENT.MESSAGE_SENT_BY_ME,this.onMessageSentByMe,this)}},{key:\"onLocalJoin\",value:function(){var t=this.generateEventData();this.TRTCCallingDelegate.onCallBegin(t)}},{key:\"onRemoteUserJoin\",value:(j=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.data,r=n.userID,i=n.userList,o=n.playerList,K_.log(ub,\"REMOTE_USER_JOIN\",e,r),this.addHandledInviteeList([r]),this.deleteUnHandledInviteeList([r]),this.changeCallStatus(cg.CONNECTED),!(o.length>0)){t.next=11;break}return t.next=8,this.getUserProfile(o);case 8:t.t0=t.sent,t.next=12;break;case 11:t.t0=this.data.playerList;case 12:this.data.playerList=t.t0,this.data.startTalkTime||(this.data.startTalkTime=Date.now()),this.TRTCCallingDelegate.onUserEnter({userID:e.data.userID,playerList:this.data.playerList}),K_.log(ub,\"REMOTE_USER_JOIN\",\"playerList:\",this.data.playerList,\"userList:\",i);case 16:case\"end\":return t.stop()}}),t,this)}))),function(t){return j.apply(this,arguments)})},{key:\"onRemoteUserLeave\",value:(M=c(a().mark((function t(e){var n,r,i,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.getCallStatus()!==cg.IDLE){t.next=2;break}return t.abrupt(\"return\");case 2:if(n=e.data.userID,K_.log(ub,\"REMOTE_USER_LEAVE\",e,e.data.userID),this.deleteHandledInviteeList([n]),this.data.playerList=this.data.playerList.filter((function(t){return t.userID!==n})),this.TRTCCallingDelegate.onUserLeave({userID:n,playerList:this.data.playerList}),this.getCallDataReport().setExitRoomTime((new Date).getTime()),this.data.isGroupCall){t.next=17;break}return t.next=11,this.TSignalingClient.hangup({userIDList:[n],callType:this.data.config.type,callEnd:this.generateCallTotalTime()});case 11:return r=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(r),K_.log(ub,\"REMOTE_USER_LEAVE\",\"playerList:\"),t.next=16,this._resetTUICallEngine();case 16:return t.abrupt(\"return\");case 17:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=this.getUserID(),1!==i.length||i[0]!==s||0!==o.length){t.next=25;break}return c=this.generateCallEndData(),this.TRTCCallingDelegate.onCallEnd(c),t.next=25,this._resetTUICallEngine();case 25:case\"end\":return t.stop()}}),t,this)}))),function(t){return M.apply(this,arguments)})},{key:\"onLocalNetStateUpdate\",value:function(t){var e=t.data.pusher.netStatus;K_.log(ub,\"onLocalNetStateUpdate\",e),this.data.pusher=t.data.pusher,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:\"onRemoteNetStateUpdate\",value:(P=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=e.data.playerList,K_.log(ub,\"onRemoteNetStateUpdate\",n),this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return P.apply(this,arguments)})},{key:\"onError\",value:function(t){K_.warn(ub,\"onError\",t),this.TRTCCallingDelegate.onError(t)}},{key:\"onRemoteVideoAdd\",value:function(t){K_.log(\"* room REMOTE_VIDEO_ADD\",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!1})}},{key:\"onRemoteVideoRemove\",value:function(t){K_.log(\"* room REMOTE_VIDEO_REMOVE\",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:\"onRemoteAudioAdd\",value:(U=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return K_.log(\"* room REMOTE_AUDIO_ADD\",e),t.next=3,this.getUserProfile([e.data.player]);case 3:n=t.sent,this.setPlayerAttributesHandler(n[0],{muteAudio:!1});case 5:case\"end\":return t.stop()}}),t,this)}))),function(t){return U.apply(this,arguments)})},{key:\"onRemoteAudioRemove\",value:function(t){K_.log(\"* room REMOTE_AUDIO_REMOVE\",t);var e=t.data.player;this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:\"onRemoteAudioVolumeUpdate\",value:(N=c(a().mark((function t(e){var n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:K_.log(\"* room REMOTE_AUDIO_VOLUME_UPDATE\",e),n=e.data.playerList,this.data.playerList=this._updateUserProfile(this.data.playerList,n),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return N.apply(this,arguments)})},{key:\"onLocalAudioVolumeUpdate\",value:function(t){var e=t.data.pusher;this.data.pusher=e,this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:\"onMessageSentByMe\",value:function(t){this.TRTCCallingDelegate.onMessageSentByMe(t)}},{key:\"_addTRTCEvent\",value:function(){this.TRTC.on(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate,this),this.TRTC.on(this.TRTC.EVENT.ERROR,this.onError,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove,this),this.TRTC.on(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate,this),this.TRTC.on(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate,this)}},{key:\"_removeTRTCEvent\",value:function(){this.TRTC.off(this.TRTC.EVENT.LOCAL_JOIN,this.onLocalJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_JOIN,this.onRemoteUserJoin),this.TRTC.off(this.TRTC.EVENT.REMOTE_USER_LEAVE,this.onRemoteUserLeave),this.TRTC.off(this.TRTC.EVENT.LOCAL_NET_STATE_UPDATE,this.onLocalNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.REMOTE_NET_STATE_UPDATE,this.onRemoteNetStateUpdate),this.TRTC.off(this.TRTC.EVENT.ERROR,this.onError),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_ADD,this.onRemoteVideoAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_VIDEO_REMOVE,this.onRemoteVideoRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_ADD,this.onRemoteAudioAdd),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_REMOVE,this.onRemoteAudioRemove),this.TRTC.off(this.TRTC.EVENT.REMOTE_AUDIO_VOLUME_UPDATE,this.onRemoteAudioVolumeUpdate),this.TRTC.off(this.TRTC.EVENT.LOCAL_AUDIO_VOLUME_UPDATE,this.onLocalAudioVolumeUpdate)}},{key:\"initTRTC\",value:function(){var t={beautyLevel:5};this._logger.info(\"\".concat(ub,\".initTRTC.start\"),{type:\"api\",data:{pusherConfig:t}});var e=this.TRTC.createPusher(t);this.data.pusher=e.pusherAttributes}},{key:\"enterRoom\",value:function(t){var e=+new Date;this._logger.info(\"\".concat(ub,\".enterRoom.start\"),{text:{data:t},type:\"api\"}),this._addTRTCEvent();var n=t.roomID,r=Object.assign(this.data.config,{roomID:n,enableMic:!0,autopush:!0,enableAgc:!0,enableAns:!0,enableCamera:t.callType===vg.VIDEO});this.data.enterRoomStatus=!0,this.data.pusher=this.TRTC.enterRoom(r);var a=+new Date;this._logger.info(\"\".concat(ub,\".enterRoom.success\"),{text:{data:i(i({},t),{},{cost:a-e})},type:\"api\"}),wx.createLivePusherContext().startPreview(),this.getCurrentPusherInstance().start()}},{key:\"exitRoom\",value:(A=c(a().mark((function t(){var e;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".exitRoom.start\"),{type:\"api\"}),t.next=3,this.getCurrentPusherInstance().stop();case 3:return t.next=5,this.TRTC.exitRoom();case 5:e=t.sent,this.data.pusher=e.pusher,this.data.playerList=e.playerList,this.data.unHandledInviteeList=[],this.data.enterRoomStatus=!1,this.initTRTC(),this._removeTRTCEvent();case 12:case\"end\":return t.stop()}}),t,this)}))),function(){return A.apply(this,arguments)})},{key:\"setPusherAttributesHandler\",value:function(t){this._logger.info(\"\".concat(ub,\".setPusherAttributesHandler.start\"),{text:{data:t},type:\"api\"}),this.data.pusher=this.TRTC.setPusherAttributes(t),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList})}},{key:\"setPlayerAttributesHandler\",value:(k=c(a().mark((function t(e,n){var r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info(\"\".concat(ub,\".setPlayerAttributesHandler.start\"),{text:{data:n},type:\"api\"}),r=this.TRTC.setPlayerAttributes(e.streamID,n),K_.warn(\"setPlayerAttributesHandler\",r),this.data.playerList=r.length>0?this._updateUserProfile(this.data.playerList,r):this.data.playerList,this.data.playerList.length>0&&0===r.length&&(this.data.playerList[0].hasAudio=!1,this.data.playerList[0].hasVideo=!1),this.TRTCCallingDelegate.onUserUpdate({pusher:this.data.pusher,playerList:this.data.playerList});case 6:case\"end\":return t.stop()}}),t,this)}))),function(t,e){return k.apply(this,arguments)})},{key:\"_mutePlayerAudio\",value:function(t){this._logger.info(\"\".concat(ub,\"._mutePlayerAudio.start\"),{text:{data:t},type:\"api\"});var e=t.currentTarget.dataset.value;e.hasAudio&&e.muteAudio?this.setPlayerAttributesHandler(e,{muteAudio:!1}):!e.hasAudio||e.muteAudio||this.setPlayerAttributesHandler(e,{muteAudio:!0})}},{key:\"_mutePlayerVideo\",value:function(t){this._logger.info(\"\".concat(ub,\"._mutePlayerVideo.start\"),{text:{data:t},type:\"api\"});var e=t.currentTarget.dataset.value;e.hasVideo&&e.muteVideo?this.setPlayerAttributesHandler(e,{muteVideo:!1}):!e.hasVideo||e.muteVideo||this.setPlayerAttributesHandler(e,{muteVideo:!0})}},{key:\"_pusherAudioHandler\",value:function(){this._logger.info(\"\".concat(ub,\"._pusherAudioHandler.start\"),{type:\"api\",text:{data:{enableMic:this.data.pusher.enableMic}}}),this.data.pusher.enableMic?(this.setPusherAttributesHandler({enableMic:!1}),this.getCurrentPusherInstance().setMICVolume({volume:0})):(this.setPusherAttributesHandler({enableMic:!0}),this.getCurrentPusherInstance().setMICVolume({volume:100}))}},{key:\"_pusherVideoHandler\",value:function(){this._logger.info(\"\".concat(ub,\"._pusherVideoHandler.start\"),{type:\"api\",text:{data:{enableCamera:this.data.pusher.enableCamera}}}),this.data.pusher.enableCamera?this.setPusherAttributesHandler({enableCamera:!1}):this.setPusherAttributesHandler({enableCamera:!0})}},{key:\"init\",value:(O=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return bC.getInstance().getAlert().checkSync(new gC({api:\"init\",attributes:e})),t.next=3,this.login(e);case 3:return t.abrupt(\"return\",t.sent);case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return O.apply(this,arguments)})},{key:\"login\",value:(L=c(a().mark((function t(e){var n=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".login.start\"),{type:\"api\",text:i(i({},e),{},{userSig:\"\"})}),this.data.config.userID=e.userID,this.data.config.userSig=e.userSig,t.abrupt(\"return\",new Promise((function(t,r){wx.$TSignaling.login({userID:e.userID,userSig:e.userSig}).then((function(r){return K_.log(ub,\"login\",\"IM login success\",r),wx.setStorageSync(\"userId\",\"\".concat(e.userID)),n._callDataReport.setUserID(e.userID),n._initReady=!0,n._resetTUICallEngine(),n._addTSignalingEvent(),n.initTRTC(),n.TSignalingResolve=t,r.data.repeatLogin&&t(null),null})).catch((function(t){n._logger.error(\"\".concat(ub,\".login.fail\"),{type:\"api\",text:{error:t}}),K_.error(\"\".concat(ub,\" init failed', error: \").concat(t)),r(t)}))})));case 4:case\"end\":return t.stop()}}),t,this)}))),function(t){return L.apply(this,arguments)})},{key:\"logout\",value:(x=c(a().mark((function t(){var e,n,r;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"\".concat(ub,\".logout.start\"),{type:\"api\",text:{data:{userID:this.data.config.userID,initReady:this._initReady}}}),this._initReady){t.next=3;break}return t.abrupt(\"return\");case 3:return e=this.data.config,n=e.userID,r=e.userSig,t.prev=4,t.next=7,wx.$TSignaling.logout({userID:n,userSig:r});case 7:K_.log(ub,\"logout\",\"IM logout success\"),t.next=14;break;case 10:t.prev=10,t.t0=t.catch(4),this._logger.error(\"\".concat(ub,\".logout.fail\"),{type:\"api\",text:{error:t.t0}}),K_.error(ub,\"logout\",\"IM logout failure\");case 14:case\"end\":return t.stop()}}),t,this,[[4,10]])}))),function(){return x.apply(this,arguments)})},{key:\"on\",value:function(t,e,n){bC.getInstance().getAlert().checkSync(new gC({api:\"on\",attributes:{eventCode:t,handler:e,context:n}})),this._emitter.on(t,e,n)}},{key:\"off\",value:function(t,e){bC.getInstance().getAlert().checkSync(new gC({api:\"off\",attributes:{eventCode:t,handler:e}})),this._emitter.off(t,e)}},{key:\"call\",value:(S=c(a().mark((function t(e){var n,r,o,s,c,l;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".call.start\"),{type:\"api\",text:{data:e}}),n=e.userID,r=e.type,t.next=4,bC.getInstance().getAlert().check(new gC({api:\"call\",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Rg.BASE,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,GC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error(\"\".concat(ub,\".call.fail\"),{text:{error:t.t0},type:\"api\"}),t.abrupt(\"return\");case 13:if(this.getUserID()!==n){t.next=17;break}throw this._logger.error(\"\".concat(ub,\".call.fail\"),{text:{error:\"Called id can not be yourself. userId:\".concat(this.getUserID(),\", inviteeId:\").concat(n)},type:\"api\"}),K_.log(\"\".concat(ub,\".call failed. Called id can't be yourself. userId:\").concat(this.getUserID(),\", inviteeId:\").concat(n)),new Error(\"\".concat(ub,\".call failed. Called id can't be yourself. userId:\").concat(this.getUserID(),\", inviteeId:\").concat(n));case 17:return this._callDataReport.setAbilityBit(!0),this._callDataReport.setCallScene(Sg.SINGLE_CALL),o={callType:Sg.SINGLE,mediaType:r,inviteeList:[n]},t.prev=20,s=e.roomID||Math.floor(2147483646*Math.random()+1),this.data.roomID=s,this.data.config.type=r,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=r,this.data.invitation.roomID=s,this.data.isInviter=!0,this.data.remoteID=n,this.changeCallStatus(cg.CALLING),t.next=32,this.TSignalingClient.invite(i(i({},e),{},{roomID:s}));case 32:if(c=t.sent,this.enterRoom({roomID:s,callType:r}),this._callDataReport.setEnterRoomTime((new Date).getTime()),l=i(i({},l=this._callDataReport.getCallData()),{},{userId:n,roomID:s,callRole:yg,callType:r,inviteeList:[n]}),this._callDataReport.setCallData(l),this._callDataReport.setSendSignalingTime((new Date).getTime()),K_.log(\"\".concat(ub,\" call(userID: \").concat(n,\", type: \").concat(r,\") success, \").concat(c)),0!==c.code){t.next=51;break}this.data.invitation.inviteID=c.inviteID,this.addInviterInviteId(c.inviteID,[this.data.config.userID,n]),this.addUnHandledInviteeList([n]),this.addHandledInviteeList([this.getUserID()]),this._callDataReport.setInviteID(c.inviteID),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:Sg.START_CALL},o)),this._callRecordReport.startHeartbeat(),t.next=57;break;case 51:return this._callDataReport.setCodeAndMessage(c.code,c.message),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:Sg.CALL_FAILED},o)),this._logger.error(\"\".concat(ub,\".call.fail\"),{text:{error:c},type:\"api\"}),t.next=57,this._resetTUICallEngine();case 57:return t.abrupt(\"return\",{data:c.data,pusher:this.data.pusher});case 60:return t.prev=60,t.t1=t.catch(20),t.t1.code===my.ERROR_BLACKLIST?(this.TRTCCallingDelegate.onError(my.ERROR_BLACKLIST,t.t1.message),this._callDataReport.setCodeAndMessage(my.ERROR_BLACKLIST,t.t1.message)):this._callDataReport.setCodeAndMessage(my.UNKNOWN,JSON.stringify(t.t1)),this._callDataReport.uploadToKibana(),this._callRecordUpload(i({eventType:Sg.CALL_FAILED},o)),this._logger.error(\"\".concat(ub,\".call.fail\"),{text:{error:t.t1},type:\"api\"}),K_.error(\"\".concat(ub,\" call(userID:\").concat(n,\",type:\").concat(r,\") failed', error: \").concat(t.t1)),t.next=69,this._resetTUICallEngine();case 69:throw new Error(t.t1);case 70:case\"end\":return t.stop()}}),t,this,[[4,9],[20,60]])}))),function(t){return S.apply(this,arguments)})},{key:\"groupCall\",value:(w=c(a().mark((function t(e){var n,r,o,s,c;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".groupCall.start\"),{type:\"api\",text:{data:e}}),n=e.type,r=e.userIDList,t.next=4,bC.getInstance().getAlert().check(new gC({api:\"groupCall\",attributes:e,initReady:this._initReady,callStatus:this.data.callStatus,capabilityCode:Rg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,GC(n);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error(\"\".concat(ub,\".groupCall.fail\"),{type:\"api\",text:{error:t.t0}}),t.abrupt(\"return\");case 13:if(-1===r.indexOf(this.getUserID())){t.next=16;break}throw this._logger.error(\"\".concat(ub,\".groupCall.fail\"),{type:\"api\",text:{error:\"Called list can not contain yourself\"}}),new Error(\"\".concat(ub,\".groupCall failed. Called list can't contain yourself. userID:\").concat(this.getUserID(),\", inviteeIDList:\").concat(r));case 16:return this._callDataReport.setCallScene(Sg.GROUP_CALL),o=e.roomID||Math.floor(2147483646*Math.random()+1),this.enterRoom({roomID:o,callType:n}),s={callType:Sg.GROUP,mediaType:n,inviteeList:e.userIDList},this.data.config.type=e.type,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.changeCallStatus(cg.CALLING),t.prev=28,t.next=31,this.TSignalingClient.inviteGroup(i(i({},e),{},{roomID:o}));case 31:return c=t.sent,this.data.config.type=e.type,this.data.invitation.inviteID=c.inviteID,this.data.invitation.inviter=this.data.config.userID,this.data.invitation.type=n,this.data.invitation.roomID=o,this.data.isInviter=!0,this.data.isGroupCall=!0,this.data.groupID=e.groupID,this.data.roomID=o,this.addUnHandledInviteeList(e.userIDList),this.addHandledInviteeList([this.getUserID()]),this.addInviterInviteId(c.inviteID,[this.data.config.userID].concat(T(e.userIDList))),this.setInitialCallId(c.inviteID),this._callRecordUpload(i({eventType:Sg.START_CALL},s)),this._callRecordReport.startHeartbeat(),K_.log(ub,\"groupCall OK\",c),t.abrupt(\"return\",{data:c.data,pusher:this.data.pusher});case 51:return t.prev=51,t.t1=t.catch(28),this._logger.error(\"\".concat(ub,\".groupCall.fail\"),{type:\"api\",text:{error:t.t1}}),K_.error(ub,\"groupCall failed\",t.t1),this._callRecordUpload(i({eventType:Sg.CALL_FAILED},s)),t.next=58,this._resetTUICallEngine();case 58:throw new Error(t.t1);case 59:case\"end\":return t.stop()}}),t,this,[[4,9],[28,51]])}))),function(t){return w.apply(this,arguments)})},{key:\"joinInGroupCall\",value:(R=c(a().mark((function t(e){var n,r,i,o;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".joinInGroupCall.start\"),{text:{data:e},type:\"api\"}),n=e.roomID,r=e.type,i=e.groupID,t.next=4,bC.getInstance().getAlert().check(new gC({api:\"joinInGroupCall\",attributes:e,initReady:this._initReady,capabilityCode:Rg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 4:return t.prev=4,t.next=7,GC(r);case 7:t.next=13;break;case 9:return t.prev=9,t.t0=t.catch(4),this._logger.error(\"\".concat(ub,\".joinInGroupCall.fail\"),{text:{error:t.t0},type:\"api\"}),t.abrupt(\"return\");case 13:return t.prev=13,this.data.config.type=r,this.data.invitation.type=r,K_.log(\"\".concat(ub,\".joinInGroupCall roomID:\").concat(n,\",type:\").concat(r,\",userID:\").concat(this.getUserID())),this.changeCallStatus(cg.CALLING),this.addHandledInviteeList([this.getUserID()]),this.data.groupID=i,this.data.roomID=n,this.data.isGroupCall=!0,this.data.isInviter=!1,this.enterRoom({roomID:n,callType:r}),this.changeCallStatus(cg.CONNECTED),this.getCallRecordReport().setBodyStatus(cg.CONNECTED),o={eventType:Sg.JOIN_IN_GROUP_CALL,callType:Sg.GROUP,mediaType:this._callType},this._callRecordUpload(o),this._callRecordReport.startHeartbeat(),t.abrupt(\"return\",this.data.pusher);case 32:return t.prev=32,t.t1=t.catch(13),this._logger.error(\"\".concat(ub,\".joinInGroupCall.fail\"),{text:{error:t.t1},type:\"api\"}),t.next=37,this._resetTUICallEngine();case 37:throw new Error(\"\".concat(ub,\".joinInGroupCall failed error: \").concat(t.t1));case 38:case\"end\":return t.stop()}}),t,this,[[4,9],[13,32]])}))),function(t){return R.apply(this,arguments)})},{key:\"inviteUser\",value:(D=c(a().mark((function t(e){var n,r,i,o,s,c,l,u,h,f=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".inviteUser.start\"),{text:{data:e},type:\"api\"}),t.next=3,bC.getInstance().getAlert().check(new gC({api:\"inviteUser\",attributes:e,initReady:this._initReady,capabilityCode:Rg.PRO,sdkAppID:this.data.config.sdkAppID}),{tim:this.tim});case 3:if(n=e.userIDList,r=void 0===n?[]:n,this.isGroupCall()){t.next=8;break}throw this._logger.error(\"\".concat(ub,\".inviteUser.fail\"),{text:{error:\"\".concat(ub,\".inviteUser - groupID:\").concat(this.data.groupID,\", roomID:\").concat(this.data.roomID,\", type:\").concat(this.data.callType)},type:\"api\"}),K_.error(\"\".concat(ub,\".inviteUser - groupID:\").concat(this.data.groupID,\", roomID:\").concat(this.data.roomID,\", type:\").concat(this.data.callType)),new Error(\"\".concat(ub,\".inviteUser - groupID:\").concat(this.data.groupID,\", roomID:\").concat(this.data.roomID,\", type:\").concat(this.data.callType));case 8:if(this.isInviter()||this.data.callStatus===cg.CONNECTED){t.next=12;break}throw this._logger.error(\"\".concat(ub,\".inviteUser.fail\"),{text:{error:\"\".concat(ub,\".inviteUser - current status:\").concat(this.data.callStatus,\" not support\")},type:\"api\"}),K_.error(\"\".concat(ub,\".inviteUser - current status:\").concat(this.data.callStatus,\" not support\")),new Error(\"\".concat(ub,\".inviteUser - current status:\").concat(this.data.callStatus,\" not support\"));case 12:if(0!==r.length){t.next=16;break}throw this._logger.error(\"\".concat(ub,\".inviteUser.fail\"),{text:{error:\"userIDList is empty\"},type:\"api\"}),K_.error(\"\".concat(ub,\".inviteUser - userIDList is empty\")),new Error(\"\".concat(ub,\".inviteUser - userIDList is empty\"));case 16:if(i=this.getHandledInviteeList(),o=this.getUnHandledInviteeList(),s=[].concat(T(i),T(o)),0!==(c=r.filter((function(t){return-1===s.indexOf(t)}))).length){t.next=24;break}return this._logger.error(\"\".concat(ub,\".inviteUser.fail\"),{text:{data:{userIDList:r},error:\"userIDList in call list\"},type:\"api\"}),K_.error(\"\".concat(ub,\".inviteUser failed - userIDList in call list. userIDList:\").concat(JSON.stringify(r))),t.abrupt(\"return\",Promise.reject(\"\".concat(ub,\".inviteUser failed - userIDList in call list. userIDList:\").concat(JSON.stringify(r))));case 24:return r=c,t.prev=25,l=this.data.handledInviteeList.filter((function(t){return t!==f.getUserID()})),t.next=29,this.TSignalingClient.inviteGroup({groupID:this.data.groupID,userIDList:r,type:this.data.invitation.type,roomID:this.data.roomID,timeout:this.data.callTimeout,inCallUserIDs:[].concat(T(this.data.unHandledInviteeList),T(l)),initialCallId:this.getInitialCallId()});case 29:if(u=t.sent,K_.log(\"inviteUser res\",u),0!==u.code){t.next=38;break}return this.addUnHandledInviteeList(r),this.addInviterInviteId(u.inviteID,[this.data.config.userID].concat(T(r))),h={eventType:Sg.INVITE_USER,callType:Sg.GROUP,mediaType:this._callType,inviteeList:r},this._callRecordUpload(h),this._callRecordReport.startHeartbeat(),t.abrupt(\"return\",u);case 38:t.next=44;break;case 40:throw t.prev=40,t.t0=t.catch(25),this._logger.error(\"\".concat(ub,\".inviteUser.fail\"),{text:{error:t.t0},type:\"api\"}),new Error(\"\".concat(ub,\".inviteUser failed, userId:\").concat(this.getUserID(),\", inviteeIdList:\").concat(r,\", error: \").concat(t.t0));case 44:case\"end\":return t.stop()}}),t,this,[[25,40]])}))),function(t){return D.apply(this,arguments)})},{key:\"accept\",value:(b=c(a().mark((function t(){var e=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".accept.start\"),{type:\"api\"}),t.next=3,bC.getInstance().getAlert().check(new gC({api:\"accept\",initReady:this._initReady,callStatus:this.data.callStatus,sdkAppID:this.data.config.sdkAppID}));case 3:return t.prev=3,t.next=6,GC(this.data.config.type);case 6:t.next=12;break;case 8:return t.prev=8,t.t0=t.catch(3),this._logger.error(\"\".concat(ub,\".accept.fail\"),{text:{error:t.t0},type:\"api\"}),t.abrupt(\"return\");case 12:return t.abrupt(\"return\",new Promise((function(t,n){if(K_.log(ub,\"accept() inviteID: \",e.data.invitation.inviteID),e.data.config.type!==vg.VIDEO||e.data.isGroupCall)e.handleAccept(t,n);else if(e.data.devicePermission){wx.createLivePusherContext().stopPreview();var r=setTimeout(c(a().mark((function i(){return a().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:clearTimeout(r),e.handleAccept(t,n);case 2:case\"end\":return i.stop()}}),i)}))),0)}else e.handleAccept(t,n)})));case 13:case\"end\":return t.stop()}}),t,this,[[3,8]])}))),function(){return b.apply(this,arguments)})},{key:\"handleAccept\",value:(C=c(a().mark((function t(e,n){var r,i;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".handleAccept.start\"),{type:\"api\"}),this._callDataReport.setEnterRoomTime((new Date).getTime()),this.enterRoom({roomID:this.data.invitation.roomID,callType:this.data.config.type}),r=this.data.invitation.inviteID,t.next=6,this.TSignalingClient.accept({inviteID:r,type:this.data.config.type});case 6:0===(i=t.sent).code?(K_.log(ub,\"accept OK\"),this.addHandledInviteeList([this.getUserID()]),this.deleteUnHandledInviteeList([this.getUserID()]),this.addAcceptedUserList(r,[this.getUserID()]),this._callRecordUpload({eventType:Sg.ACCEPT_CALL}),e({message:i.data.message,pusher:this.data.pusher}),this.changeCallStatus(cg.CONNECTED),this.getCallRecordReport().setBodyStatus(cg.CONNECTED)):(this.isGroupCall()&&(this._callDataReport.setCodeAndMessage(my.NOT_MEDIA_ACCESS,JSON.stringify(i.data.message)),this._callDataReport.uploadToKibana()),this._logger.error(\"\".concat(ub,\".accept.fail\"),{text:{error:i},type:\"api\"}),K_.error(ub,\"accept failed\",i),n(i),this._resetTUICallEngine());case 8:case\"end\":return t.stop()}}),t,this)}))),function(t,e){return C.apply(this,arguments)})},{key:\"reject\",value:(_=c(a().mark((function t(){var e,n;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".reject.start\"),{text:{data:{invitation:this.data.invitation,type:this.data.config.type}},type:\"api\"}),t.next=3,bC.getInstance().getAlert().checkSync(new gC({api:\"reject\",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(!this.data.invitation.inviteID){t.next=14;break}return t.next=6,this.TSignalingClient.reject({inviteID:this.data.invitation.inviteID,type:this.data.config.type});case 6:return e=t.sent,K_.log(ub,\"reject OK\",e),n=this.generateEventData(),this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:this.getUserID(),userID:this.getUserID()},n),{},{reason:Sg.REJECT})),this._callRecordUpload({eventType:Sg.REJECT_CALL}),t.next=13,this._resetTUICallEngine();case 13:return t.abrupt(\"return\",e);case 14:return this._logger.error(\"\".concat(ub,\".reject.fail\"),{text:{error:\"未收到邀请,无法拒绝\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" 未收到邀请,无法拒绝\")),t.abrupt(\"return\",\"未收到邀请,无法拒绝\");case 17:case\"end\":return t.stop()}}),t,this)}))),function(){return _.apply(this,arguments)})},{key:\"hangup\",value:(E=c(a().mark((function t(){var e,n,r,o,s,c,l,u,h,f,d,p,v,g,y,I,m,E,_=this;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".hangup.start\"),{text:{data:{isGroupCall:this.isGroupCall(),isInviter:this.isInviter(),currentUserID:this.getUserID(),totalTime:this.generateCallTotalTime(),callType:this.getCallType()}},type:\"api\"}),t.next=3,bC.getInstance().getAlert().checkSync(new gC({api:\"hangup\",callStatus:this.data.callStatus,initReady:this._initReady}));case 3:if(K_.warn(\"\".concat(ub,\". - callStatus:\").concat(this.data.callStatus,\" _inviterInviteID:\").concat(JSON.stringify(this.data.invitation))),this.data.callStatus!==cg.IDLE){t.next=7;break}throw this._logger.error(\"\".concat(ub,\".hangup.fail\"),{text:{data:{currentStatus:this.data.callStatus},error:\"hangup failed. current status:\"},type:\"api\"}),new Error(\"\".concat(ub,\".hangup failed. current status:\").concat(this.data.callStatus));case 7:if(this.data.callStatus!==cg.CALLING||0!==this.getInviterInviteIdList().length){t.next=10;break}throw this._logger.error(\"\".concat(ub,\".hangup.fail\"),{text:{error:\"call/groupCall incomplete。please wait cancel\"},type:\"api\"}),new Error(\"\".concat(ub,\".call/groupCall incomplete。please wait cancel\"));case 10:if(e=this.isGroupCall(),n=this.isInviter(),r=this.getUserID(),o=this.generateCallTotalTime(),s=this.getCallType(),l=this.getInviterInviteIdList(),this.data.callStatus!==cg.CONNECTED){t.next=31;break}if(t.prev=17,0!==l.length){t.next=23;break}return u=this.generateCallEndData({callMediaType:s,totalTime:o}),this.TRTCCallingDelegate.onCallEnd(u),t.next=23,this._resetTUICallEngine();case 23:t.next=31;break;case 25:return t.prev=25,t.t0=t.catch(17),this._logger.error(\"\".concat(ub,\".hangup.fail\"),{text:{error:t.t0},type:\"api\"}),t.next=30,this._resetTUICallEngine();case 30:throw new Error(t.t0);case 31:if(h=this.getHandledInviteeList(),f=this.getUnHandledInviteeList(),d=this.generateEventData(),t.prev=34,e){t.next=53;break}if(p=this.generateCallEndData(),!n){t.next=48;break}if(1!==f.length){t.next=45;break}return t.next=41,this.cancel();case 41:c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:Sg.NORMAL})),t.next=46;break;case 45:this.TRTCCallingDelegate.onCallEnd(p);case 46:t.next=49;break;case 48:this.TRTCCallingDelegate.onCallEnd(p);case 49:return t.next=51,this._resetTUICallEngine();case 51:t.next=82;break;case 53:if(v=this.getCallStatus(),g={callType:this.getCallType(),isGroupCall:this.isGroupCall(),groupID:this.data.groupID,userIDList:[].concat(T(h.filter((function(t){return t!==r}))),T(f)),callEnd:this.generateCallTotalTime()},!n){t.next=73;break}if(v!==cg.CALLING){t.next=63;break}return t.next=59,this.cancel(this.getInviterInviteIdList());case 59:return c=t.sent,this.TRTCCallingDelegate.onCancel(i(i({inviteID:this.data.invitation.inviteID,invitee:r,userID:r},d),{},{reason:Sg.NORMAL})),t.next=63,this._resetTUICallEngine();case 63:if(v!==cg.CONNECTED){t.next=71;break}y=a().mark((function t(){var e,n,i,o,s,u,d;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(e=l[I],n=_.getInviterInviteIdUserList(e),!((i=_.getAcceptedUserList(e)).length>0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(T(o),T(s)).filter((function(t){return t!==r})),K_.warn(\"inviter emit hangup signal, notify userIDList:\".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return K_.warn(\"inviter emit cancel signal, userIdList:\".concat(n)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case\"end\":return t.stop()}}),t)})),I=0;case 66:if(!(I0)){t.next=22;break}if(o=i.filter((function(t){return-1!==h.indexOf(t)})),s=n.filter((function(t){return-1!==f.indexOf(t)})),g.userIDList=[].concat(T(o),T(s)).filter((function(t){return t!==r})),K_.warn(\"invitee emit hangup signal, notify userIDList:\".concat(JSON.stringify(g.userIDList))),0===g.userIDList.length){t.next=13;break}return t.next=10,_.TSignalingClient.hangup(g);case 10:c=t.sent,t.next=18;break;case 13:if(!(h.length>1)){t.next=18;break}return g.userIDList=h.filter((function(t){return t!==r})),t.next=17,_.TSignalingClient.hangup(g);case 17:c=t.sent;case 18:u=_.generateCallEndData(),_.TRTCCallingDelegate.onCallEnd(u),t.next=29;break;case 22:if(d=_.getUnHandledInviteeList(),!(n.filter((function(t){return-1!==d.indexOf(t)})).length>0)){t.next=29;break}return K_.warn(\"invitee emit cancel signal, inviteID:\".concat(e)),t.next=28,_.cancel([e]);case 28:c=t.sent;case 29:case\"end\":return t.stop()}}),t)})),E=0;case 75:if(!(E=3600?(r=parseInt(o/3600)<10?\"0\".concat(parseInt(o/3600)):parseInt(o/3600),i=parseInt(o%60/60)<10?\"0\".concat(parseInt(o%60/60)):parseInt(o%60/60),(a=o%3600<10?\"0\".concat(o%3600):o%3600)>60&&(i=parseInt(a/60)<10?\"0\".concat(parseInt(a/60)):parseInt(a/60),a=a%60<10?\"0\".concat(a%60):a%60),n=\"\".concat(r,\":\").concat(i,\":\").concat(a)):o>=60&&o<3600?(i=parseInt(o/60)<10?\"0\".concat(parseInt(o/60)):parseInt(o/60),a=o%60<10?\"0\".concat(o%60):o%60,n=\"00:\".concat(i,\":\").concat(a)):o<60&&(a=o<10?\"0\".concat(o):o,n=\"00:00:\".concat(a)),n),e.data.chatTimeNum+=1,e.data.pusher.chatTime=e.data.chatTime,e.data.pusher.chatTimeNum=e.data.chatTimeNum,e.TRTCCallingDelegate.onUserUpdate({pusher:e.data.pusher,playerList:e.data.playerList})}),1e3);break;case cg.IDLE:clearInterval(this.data.timer),this.data.timer=null,this.data.chatTime=\"00:00:00\",this.data.chatTimeNum=0}}},{key:\"_resetTUICallEngine\",value:(I=c(a().mark((function t(e,n){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"\".concat(ub,\"._resetTUICallEngine.start\"),{text:{data:{callEnd:e,type:n}},type:\"api\"}),this.changeCallStatus(cg.IDLE),K_.log(ub,\" _resetTUICallEngine()\",this.data.enterRoomStatus),!this.data.enterRoomStatus){t.next=6;break}return t.next=6,this.exitRoom(e,n);case 6:this.data.config.type=vg.AUDIO,this._initialCallId=\"\",this.initData();case 9:case\"end\":return t.stop()}}),t,this)}))),function(t,e){return I.apply(this,arguments)})},{key:\"startRemoteView\",value:(y=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:this._logger.info(\"\".concat(ub,\".startRemoteView.start\"),{text:{data:{userID:e}},type:\"api\"}),this.data.playerList.forEach((function(t){if(t.userID===e)return t.muteVideo=!1,void K_.log(\"\".concat(ub,\", startRemoteView(\").concat(e,\")\"))}));case 2:case\"end\":return t.stop()}}),t,this)}))),function(t){return y.apply(this,arguments)})},{key:\"stopRemoteView\",value:function(t){this._logger.info(\"\".concat(ub,\".stopRemoteView.start\"),{text:{data:{userID:t}},type:\"api\"}),this.data.playerList.forEach((function(e){if(e.userID===t)return e.muteVideo=!0,void K_.log(\"\".concat(ub,\", stopRemoteView(\").concat(t,\")\"))}))}},{key:\"openCamera\",value:function(){this._logger.info(\"\".concat(ub,\".openCamera.start\"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"openCamera\",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera||this._pusherVideoHandler(),K_.log(\"\".concat(ub,\", openCamera() pusher: \").concat(this.data.pusher))}},{key:\"closeCamera\",value:function(){this._logger.info(\"\".concat(ub,\".closeCamera.start\"),{text:{data:{enableCamera:this.data.pusher.enableCamera}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"closeCamera\",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableCamera&&this._pusherVideoHandler(),K_.log(\"\".concat(ub,\", closeCamera() pusher: \").concat(this.data.pusher))}},{key:\"switchCamera\",value:function(){this._logger.info(\"\".concat(ub,\".switchCamera.start\"),{text:{data:{frontCamera:this.data.pusher.frontCamera}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"switchCamera\",callStatus:this.data.callStatus,initReady:this._initReady})),this.getCurrentPusherInstance().switchCamera(),K_.log(\"\".concat(ub,\", switchCamera(), frontCamera\").concat(this.data.pusher.frontCamera))}},{key:\"openMicrophone\",value:function(){this._logger.info(\"\".concat(ub,\".openMicrophone.start\"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"openMicrophone\",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic||this._pusherAudioHandler(),K_.log(\"\".concat(ub,\", openMicrophone() pusher: \").concat(this.data.pusher))}},{key:\"closeMicrophone\",value:function(){this._logger.info(\"\".concat(ub,\".closeMicrophone.start\"),{text:{data:{enableMic:this.data.pusher.enableMic}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"closeMicrophone\",callStatus:this.data.callStatus,initReady:this._initReady})),this.data.pusher.enableMic&&this._pusherAudioHandler(),K_.log(\"\".concat(ub,\", closeMicrophone() pusher: \").concat(this.data.pusher))}},{key:\"selectAudioPlaybackDevice\",value:function(t){this._logger.info(\"\".concat(ub,\".selectAudioPlaybackDevice.start\"),{text:{data:{type:t}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"selectAudioPlaybackDevice\",callStatus:this.data.callStatus,attributes:{type:t},initReady:this._initReady}));var e=!1;switch(t){case\"speaker\":e=!0;break;case\"ear\":e=!1}return this.setHandsFree(e)}},{key:\"setHandsFree\",value:function(t){return this.data.soundMode=t?\"speaker\":\"ear\",K_.log(\"\".concat(ub,\", setHandsFree() result: \").concat(this.data.soundMode)),this.data.soundMode}},{key:\"switchAudioCall\",value:(g=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"\".concat(ub,\".switchAudioCall.start\"),{type:\"api\"}),!this.isGroupCall()){t.next=5;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"switchToAudioCall is not applicable to groupCall\"},type:\"api\"}),K_.warn(\"\".concat(ub,\".switchToAudioCall is not applicable to groupCall.\")),t.abrupt(\"return\");case 5:if(this.data.invitation.type!==vg.AUDIO){t.next=9;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"the call mode is audio call\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" Now the call mode is audio call.\")),t.abrupt(\"return\");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"audio and video call switching\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" audio and video call switching.\")),t.abrupt(\"return\");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt(\"return\",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Cg}));case 16:case\"end\":return t.stop()}}),t,this)}))),function(){return g.apply(this,arguments)})},{key:\"switchCallMediaType\",value:(v=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._logger.info(\"\".concat(ub,\".closeMicrophone.start\"),{text:{data:{type:e}},type:\"api\"}),t.next=3,bC.getInstance().getAlert().check(new gC({api:\"switchCallMediaType\",attributes:{type:e},callStatus:this.data.callStatus,initReady:this._initReady,sdkAppID:this.data.config.sdkAppID}));case 3:if(!this.isGroupCall()){t.next=7;break}throw this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"switchToAudioCall is not applicable to groupCall\"},type:\"api\"}),K_.error(\"\".concat(ub,\".switchToAudioCall is not applicable to groupCall.\")),new fC(my.ERROR_SCENE_NOT_SUPPORTED,\"\".concat(ub,\".switchToAudioCall is not applicable to groupCall.\"));case 7:if(this.data.switchCallModeStatus){t.next=11;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"audio and video call switching\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" audio and video call switching.\")),t.abrupt(\"return\");case 11:t.t0=e,t.next=t.t0===vg.AUDIO?14:t.t0===vg.VIDEO?17:20;break;case 14:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!1}),t.abrupt(\"return\",this.TSignalingClient.switchCallMode({userID:this.data.unHandledInviteeList[0]||this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:Cg}));case 17:throw this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"Audio switching Video is not supported yet\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" Audio switching Video is not supported yet\")),new Error(\"\".concat(ub,\" Audio switching Video is not supported yet\"));case 20:case\"end\":return t.stop()}}),t,this)}))),function(t){return v.apply(this,arguments)})},{key:\"setSwitchCallModeStatus\",value:function(t){this.data.switchCallModeStatus=t}},{key:\"switchVideoCall\",value:(p=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"\".concat(ub,\".switchVideoCall.start\"),{type:\"api\"}),!this.isGroupCall()){t.next=5;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"switchToAudioCall is not applicable to groupCall\"},type:\"api\"}),K_.warn(\"\".concat(ub,\".switchToVideoCall is not applicable to groupCall.\")),t.abrupt(\"return\");case 5:if(this.data.invitation.type!==vg.VIDEO){t.next=9;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"Now the call mode is video call\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" Now the call mode is video call.\")),t.abrupt(\"return\");case 9:if(this.data.switchCallModeStatus){t.next=13;break}return this._logger.error(\"\".concat(ub,\".switchAudioCall.fail\"),{text:{error:\"audio and video call switching\"},type:\"api\"}),K_.warn(\"\".concat(ub,\" audio and video call switching.\")),t.abrupt(\"return\");case 13:return this.setSwitchCallModeStatus(!1),this.setPusherAttributesHandler({enableCamera:!0}),t.abrupt(\"return\",this.TSignalingClient.switchCallMode({userID:this.data.playerList[0].userID,callType:this.data.invitation.type,roomID:this.data.invitation.roomID,mode:bg}));case 16:case\"end\":return t.stop()}}),t,this)}))),function(){return p.apply(this,arguments)})},{key:\"setSoundMode\",value:function(t){var e=!1,n=!1;switch(t||(n=!0,t=this.data.soundMode),t){case\"speaker\":e=!0;break;case\"ear\":e=!1}return this.setHandsFree(n?!e:e)}},{key:\"_hangUp\",value:function(){this.hangup()}},{key:\"getCurrentPusherInstance\",value:function(){return this.TRTC.getPusherInstance().context=wx.createLivePusherContext(),this.TRTC.getPusherInstance()}},{key:\"_pusherStateChangeHandler\",value:function(t){this.TRTC.pusherEventHandler(t)}},{key:\"_playerStateChange\",value:function(t){this._emitter.emit(sg.REMOTE_STATE_UPDATE,t)}},{key:\"_playerAudioVolumeNotify\",value:function(t){this.data.playerList.length>0&&this.TRTC.playerAudioVolumeNotify(t)}},{key:\"_pusherAudioVolumeNotify\",value:function(t){this.TRTC.pusherAudioVolumeNotify(t)}},{key:\"_updateUserProfile\",value:function(t,e){return 0===e.length||0===t.length?e:e.map((function(e){var n=e,r=t.filter((function(t){return t.userID===e.userID}));return n.avatar=r[0]&&r[0].avatar?r[0].avatar:\"\",n.nick=r[0]&&r[0].nick?r[0].nick:\"\",n}))}},{key:\"_getUserProfile\",value:function(t){var e=this;this.tim.getUserProfile({userIDList:t}).then((function(t){K_.log(\"getUserProfile success\",t),K_.log(t.data),e.data.remoteUsers=t.data})).catch((function(t){K_.warn(\"getUserProfile error:\",t)}))}},{key:\"getUserProfile\",value:(d=c(a().mark((function t(e){var n,r,i,o,s=arguments;return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=s.length>1&&void 0!==s[1]?s[1]:\"array\",0!==e.length){t.next=3;break}return t.abrupt(\"return\",[]);case 3:return r=e.map((function(t){return t.userID})),t.next=6,this.tim.getUserProfile({userIDList:r});case 6:i=t.sent,o=null,t.t0=n,t.next=\"array\"===t.t0?11:\"map\"===t.t0?13:16;break;case 11:return o=e.map((function(t,e){return t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,t})),t.abrupt(\"break\",16);case 13:return o={},e.forEach((function(t,e){t.avatar=i.data[e].avatar,t.nick=i.data[e].nick,o[t.userID]=t})),t.abrupt(\"break\",16);case 16:return t.abrupt(\"return\",o);case 17:case\"end\":return t.stop()}}),t,this)}))),function(t){return d.apply(this,arguments)})},{key:\"setSelfInfo\",value:function(t,e){return this._logger.info(\"\".concat(ub,\".setSelfInfo.start\"),{text:{data:{nickName:t,avatar:e}},type:\"api\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"setSelfInfo\",attributes:{nickName:t,avatar:e},initReady:this._initReady})),this.tim.updateMyProfile({nick:t,avatar:e})}},{key:\"deviceCheck\",value:(u=c(a().mark((function t(e){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt(\"return\",U_(e));case 1:case\"end\":return t.stop()}}),t)}))),function(t){return u.apply(this,arguments)})},{key:\"_pusherNetStatus\",value:function(t){this.TRTC.pusherNetStatusHandler(t)}},{key:\"_playNetStatus\",value:function(t){this.TRTC.playerNetStatus(t)}},{key:\"_toggleViewSize\",value:function(t){var e=t.currentTarget.dataset.screen;return K_.log(\"get screen\",e,t),1===this.data.playerList.length&&e!==this.data.screen&&this.data.invitation.type===vg.VIDEO&&(this.data.screen=e),this.data.screen}},{key:\"getTim\",value:function(){return this.tim}},{key:\"destroyed\",value:(s=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"\".concat(ub,\".destroyed.start\"),{type:\"api\"}),this.getCallStatus()===cg.IDLE){t.next=4;break}return t.next=4,this.handleExceptionExit();case 4:if(this._resetTUICallEngine(),this._removeTSignalingEvent(),this._removeTRTCEvent(),this._timExternal){t.next=10;break}return t.next=10,this.logout();case 10:this._initReady=!1;case 11:case\"end\":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:\"handleExceptionExit\",value:(o=c(a().mark((function t(){return a().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this._logger.info(\"\".concat(ub,\".handleExceptionExit.start\"),{text:{data:{callStatus:this.getCallStatus()}},type:\"api\"}),t.prev=1,this.getCallStatus()!==cg.CALLING){t.next=10;break}if(!this.isInviter()){t.next=8;break}return t.next=6,this.hangup();case 6:t.next=10;break;case 8:return t.next=10,this.reject();case 10:if(this.getCallStatus()!==cg.CONNECTED){t.next=13;break}return t.next=13,this.hangup();case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),this._logger.error(\"\".concat(ub,\".handleExceptionExit.fail\"),{text:{data:{error:t.t0}},type:\"api\"});case 18:case\"end\":return t.stop()}}),t,this,[[1,15]])}))),function(){return o.apply(this,arguments)})},{key:\"_callRecordUpload\",value:function(t){var e=i(i({},t),{},{callRole:this.isInviter()?Sg.INVITER:Sg.INVITEE,userID:this.getUserID(),roomID:this.getRoomID(),inviteID:this.getInitialCallId()});this._callRecordReport.eventUpload(e)}},{key:\"generateCallEndData\",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.roomId,n=t.callMediaType,r=t.callRole,i=t.totalTime,a=t.userId;return e=e||this.getRoomID(),n=n||this.getCallType(),r||(r=this.isInviter()?yg:Ig),{roomID:e,callMediaType:n,callRole:r,totalTime:i=x_(i)?this.generateCallTotalTime():i,userID:a=a||this.getUserID(),callEnd:i,message:t.message||\"\"}}},{key:\"generateEventData\",value:function(){return{callID:this.getInviterInviteIdList()[0],roomID:this.getRoomID(),callRole:this.isInviter()?Sg.INVITER:Sg.INVITEE,callMediaType:this.getCallType()}}},{key:\"setInitialCallId\",value:function(t){this._initialCallId=t}},{key:\"getInitialCallId\",value:function(){return this._initialCallId}},{key:\"getConnectStartTime\",value:function(){return this.data.startTalkTime}},{key:\"generateCallTotalTime\",value:function(){return 0===this.getConnectStartTime()?0:Math.round((Date.now()-this.getConnectStartTime())/1e3)}}],[{key:\"createInstance\",value:function(t){return hb.updateEsConfig({url:\"\".concat(\"https://webim.tim.qq.com/v4/imopenstat/tweb_trtccalling_report\",\"?sdkappid=\").concat(null==t?void 0:t.sdkAppID),table:\"timweb-trtccalling\"}),bC.getInstance().getAlert().checkSync(new gC({api:\"createInstance\",attributes:t})),r.instance||(r.instance=new r(t)),r.instance.initData(),r.instance}}]),r}();f(fb,\"instance\",null),f(fb,\"AUDIO_PLAYBACK_DEVICE\",Dg),f(fb,\"MEDIA_TYPE\",vg),f(fb,\"EVENT\",sg),f(fb,\"STATUS\",cg);if (!exports.__esModule) Object.defineProperty(exports, \"__esModule\", { value: true });Object.defineProperty(exports, 'AUDIO_PLAYBACK_DEVICE', { enumerable: true, configurable: true, get: function() { return Dg; } });Object.defineProperty(exports, 'EVENT', { enumerable: true, configurable: true, get: function() { return sg; } });Object.defineProperty(exports, 'MEDIA_TYPE', { enumerable: true, configurable: true, get: function() { return vg; } });Object.defineProperty(exports, 'STATUS', { enumerable: true, configurable: true, get: function() { return cg; } });Object.defineProperty(exports, 'TUICallEngine', { enumerable: true, configurable: true, get: function() { return fb; } });Object.defineProperty(exports, 'default', { enumerable: true, configurable: true, get: function() { return fb; } });\n"]} \ No newline at end of file diff --git a/package.json b/package.json index ab59cb7..2ef9ba6 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "description": "", "main": "app.js", "dependencies": { + "@tencentcloud/call-uikit-wechat": "^2.1.1", "@tencentcloud/chat-uikit-wechat": "^1.0.14", "@vant/area-data": "^1.4.0", "@vant/weapp": "^1.10.12", "dayjs": "^1.11.7" }, - "devDependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, diff --git a/pages/expertConsult/expertConsult.js b/pages/expertConsult/expertConsult.js index 909e588..b16882e 100644 --- a/pages/expertConsult/expertConsult.js +++ b/pages/expertConsult/expertConsult.js @@ -22,9 +22,10 @@ Page({ lock:false, is_online:0, sort_order:1, + inquiry_type:0, + inquiry_mode:0, navName:"专家问诊", scrollHeight:300, - is_search_welfare_reception:0, sickList:[], img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', option: [ @@ -213,7 +214,7 @@ Page({ this.getDoctorList() }, getDoctorList(){ - let {expertise_id,province_id, city_id,sort_order,keyword,page,pageNumber,is_search_welfare_reception,is_online}=this.data; + let {expertise_id,province_id, city_id,sort_order,keyword,page,pageNumber,is_online,inquiry_type,inquiry_mode}=this.data; doctorList({ expertise_id:expertise_id, province_id:province_id, @@ -221,7 +222,8 @@ Page({ sort_order: sort_order, is_first_online:is_online, keyword:keyword, - is_search_welfare_reception: is_search_welfare_reception, + inquiry_type, + inquiry_mode, page:page, per_page:pageNumber }).then((res)=>{ @@ -312,7 +314,7 @@ Page({ }); this.setData({ navName:"公益问诊", - is_search_welfare_reception:1 + inquiry_type:3 }) } this.getSickType(); diff --git a/pages/expertConsult/expertConsult.wxml b/pages/expertConsult/expertConsult.wxml index 65c3343..7c14e9b 100644 --- a/pages/expertConsult/expertConsult.wxml +++ b/pages/expertConsult/expertConsult.wxml @@ -39,7 +39,7 @@ - + @@ -59,13 +59,11 @@ 平均回复: {{moduleFilter.formatReply(item.avg_response_time)}}h暂无 - - 公益问诊:¥{{item.free_clinic_price}} - 专家问诊:¥{{item.price}} - - 立即咨询 + + 图文问诊:¥{{itemName.inquiry_price}}¥{{moduleFilter.formatPrice(item.doctor_inquiry_config)}} + {{itemName.inquiry_mode==1?'图文问诊':itemName.inquiry_mode==2?'视频问诊':'其他问诊'}}:¥{{itemName.inquiry_price}} + + diff --git a/pages/expertConsult/expertConsult.wxss b/pages/expertConsult/expertConsult.wxss index 77e9b43..d5c0482 100644 --- a/pages/expertConsult/expertConsult.wxss +++ b/pages/expertConsult/expertConsult.wxss @@ -144,7 +144,9 @@ overflow: hidden; } .price{ font-size: 28rpx; + } + .price text{ margin-left: 5rpx; font-size: 34rpx; @@ -264,4 +266,16 @@ font-size: 30rpx; } .viewcell .left{ position: relative; +} +.price .expert_prcie{ + text-decoration: line-through; + color:#999; +} +.price .expert_prcie .priceactive{ + color:#999; +} +.pricecell{ + display: flex; + align-items: center; + white-space: nowrap; } \ No newline at end of file diff --git a/pages/expertDetail/expertDetail.js b/pages/expertDetail/expertDetail.js index 2c04123..82725c0 100644 --- a/pages/expertDetail/expertDetail.js +++ b/pages/expertDetail/expertDetail.js @@ -2,6 +2,7 @@ const app = getApp() import { doctorDetail, + doctorService, isReceivepatient, commentList, fllowDoctor, @@ -16,6 +17,7 @@ Page({ img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', showDialog:false, avatar: '', + currentData:0, user_name: '', doctor_title: '', doctor_id: '', @@ -28,6 +30,9 @@ Page({ served_patients_num: 0, number_of_fans: 0, hospital: null, + canTuwen:false, + canVideo:false, + canDiffcult:false, brief_introduction:'', multi_point_status: 0, multi_point_enable:0, @@ -42,15 +47,19 @@ Page({ show: false, isHide: false, current_inquiry_config: null, + inquiry_type:'', + inquiry_mode:'', follow: false, id:'', + expertInquiry_price:'', recieveStatus:0, commentList: [], totalComment:0, isFinished:false, isReceivePatient:false //是否可接诊 }, - handleThrottle:throttle(function(){ + handleThrottle:throttle(function(e){ + let {type}=e.currentTarget.dataset; this.goSelectPatient() }), goSelectPatient() { @@ -75,12 +84,43 @@ Page({ this.handelfllowDoctor() } }, - notAsk(){ + notAsk(e){ + let {type}=e.currentTarget.dataset wx.showToast({ - title: '该医生暂不就诊', + title:type==0?'该医生暂不就诊':'该问诊暂未开通', icon:"none" }) }, + +bindchange(e){ + const that = this; + console.log(e); + that.setData({ + currentData: e.detail.current + }) +}, + switchTab(e){ + let {id}=e. currentTarget.dataset; + this.setData({ + currentData:Number(id) + }) + if(id==0){ + this.setData({ + inquiry_type:this.data.current_inquiry_config.inquiry_type, + inquiry_mode:this.data.current_inquiry_config.inquiry_mode + }) + }else if(id==1){ + this.setData({ + inquiry_type:1, + inquiry_mode:2 + }) + }else { + this.setData({ + inquiry_type:1, + inquiry_mode:6 + }) + } + }, confirm(event) { let {id}=this.data; if (event.detail) { @@ -90,16 +130,16 @@ Page({ } }, handleIsReceivepatient() { - let {doctor_id}=this.data; + let {doctor_id,inquiry_mode,inquiry_type}=this.data; isReceivepatient({ - inquiry_type: this.data.current_inquiry_config.inquiry_type, - inquiry_mode: 1, + inquiry_type: inquiry_type, + inquiry_mode: inquiry_mode, doctor_id: doctor_id }).then(data => { let recieveStatus=data.status; if (recieveStatus == 1) { app.method.navigateTo({ - url: '/pages/selectPatient/selectPatient?chat_id='+ this.data.user_id+"&doctor_id="+this.data.doctor_id+"&inquiry_type="+ this.data.current_inquiry_config.inquiry_type + url: '/pages/selectPatient/selectPatient?chat_id='+ this.data.user_id+"&doctor_id="+this.data.doctor_id+"&inquiry_type="+ inquiry_type+"&inquiry_mode="+inquiry_mode }) } else if (recieveStatus == 2) { this.setData({ @@ -174,7 +214,7 @@ Page({ let order_inquiry_count=0; let order_type=type; for (let i = 0; i < arr.length; i++) { - if(arr[i].inquiry_type==type){ + if(arr[i].inquiry_type==type && arr[i].inquiry_mode==1){ recieveStatus=arr[i].work_num_day-arr[i].order_inquiry_count; inquiry_mode=arr[i].inquiry_mode; inquiry_price=arr[i].inquiry_price; @@ -202,6 +242,8 @@ Page({ console.log('2222222222') console.log(recieveStatus) this.setData({ + inquiry_type:order_type, + inquiry_mode:inquiry_mode, current_inquiry_config: { inquiry_type:order_type, inquiry_mode:inquiry_mode, @@ -218,9 +260,24 @@ Page({ var a='3'; if(arr){ for (var i = 0; i < arr.length; ++i) { - if(arr[i].is_enable==1 && arr[i].inquiry_type==1){ - a='2' + if(arr[i].is_enable==1 && arr[i].inquiry_type==1 && arr[i].inquiry_mode==1){ + this.setData({ + expertInquiry_price: arr[i].inquiry_price + }) + a='2'; }; + if(arr[i].is_enable==1 && arr[i].inquiry_type==1 && arr[i].inquiry_mode==2){ + this.setData({ + canVideo:true, + videoPrice:arr[i].inquiry_price + }) + }; + if(arr[i].is_enable==1 && arr[i].inquiry_type==1 && arr[i].inquiry_mode==6){ + this.setData({ + canDiffcult:true, + yinanPrice:arr[i].inquiry_price + }) + } if(arr[i].is_enable==1 && arr[i].inquiry_type==3){ return '1' }; @@ -238,43 +295,34 @@ Page({ }) } }; - let doctor_inquiry_config = this.data.doctor_inquiry_config; - let inquiryType=this.formatInquiryStatus(doctor_inquiry_config); - console.log("inquiryType:"+inquiryType) - if(inquiryType==1){ - this.loopArr(doctor_inquiry_config,3); - }else if(inquiryType==2){ - this.loopArr(doctor_inquiry_config,1); - }else{ - this.setData({ - current_inquiry_config:null - }) - } - this.setData({ - isFinished:true - }) - // if(res.is_img_expert_reception==1 && res.is_img_welfare_reception==1){ - // this.loopArr(doctor_inquiry_config,3); - // // 1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药 - // this.setData({ - // isHide:true - // }) - // }else if(res.is_img_expert_reception==1 && res.is_img_welfare_reception==0){ - // this.loopArr(doctor_inquiry_config,1); - - // }else if(res.is_img_welfare_reception== 1 && res.is_img_expert_reception==0){ - // this.loopArr(doctor_inquiry_config,3); - // }else{ - // this.setData({ - // current_inquiry_config:null - // }) - // } - // this.setData({ - // isFinished:true - // }) + }) }, - + getService(id){ + doctorService(id).then(res=>{ + let doctor_inquiry_config = res; + let inquiryType=this.formatInquiryStatus(res); + console.log("inquiryType:"+inquiryType) + if(inquiryType==1){ + this.loopArr(doctor_inquiry_config,3); + this.setData({ + canTuwen:true + }) + }else if(inquiryType==2){ + this.loopArr(doctor_inquiry_config,1); + this.setData({ + canTuwen:true + }) + }else{ + this.setData({ + current_inquiry_config:null + }) + } + this.setData({ + isFinished:true + }) + }) + }, /** * 生命周期函数--监听页面加载 */ @@ -291,6 +339,7 @@ Page({ doctor_id:doctor_id }) this.getDeatil(doctor_id); + this.getService(doctor_id); this.getEvaluationList() }, diff --git a/pages/expertDetail/expertDetail.wxml b/pages/expertDetail/expertDetail.wxml index 03efd8d..2d1c110 100644 --- a/pages/expertDetail/expertDetail.wxml +++ b/pages/expertDetail/expertDetail.wxml @@ -9,7 +9,7 @@ - + @@ -67,7 +67,168 @@ - + + + 医生服务 + {{filter.formatYear(days)}}内服务过您 + + + + + + + + + 图文问诊 + ¥{{current_inquiry_config.inquiry_price}}/次 + ¥{{expertInquiry_price}}/次 + + + 图文问诊 + 暂未开通 + + + + + + + + + 视频问诊 + ¥{{videoPrice}}/次 + + + 视频问诊 + 暂未开通 + + + + + + + + + 疑难问诊 + ¥{{yinanPrice}}/次 + + + 疑难问诊 + 暂未开通 + + + + + + + + + + + + 通过文字、图片、语音进行咨询 + + + + 可通过文字、图片、语音等形式和医生进行沟通; + + + + 医生接诊后24小时内10个沟通回合; + + + + 医生未接诊,平台24小时内自动退款; + + + + 医生未回复,可联系平台客服协商进行退款。 + + + + + + + + + + + 通过视频面对面进行咨询 + + + + 医生接诊后,主动和就诊人预约视频时间; + + + + 若预约时间因故需要改变,可与医生图文协商时间; + + + + 视频交流服务时长一般为5-10分钟; + + + + 医生接诊后48小时内可以通过文字、图片、语音等形式和医生不限制沟通回合数; + + + + 医生未接诊,平台24小时内自动退款; + + + + 医生未回复或未进行视频,可联系平台客服协商进行退款; + + + + 如因您个人原因(忘记时间、迟到、中途断开未在进入视频等情况),咨询费用可能将无法退回,请准时接收医生视频请求; + + + + 视频不支持回放。 + + + + + + + + + + + 通过文字、图片、语音进行咨询 + + + + 【医生填写的服务内容】; + + + + 【医生填写的服务流程】; + + + + 可通过文字、图片、语音等形式和医生进行沟通; + + + + 医生接诊后【医生选择的服务周期】内【医生选择的服务次数】沟通回合; + + + + 医生未接诊,平台24小时内自动退款; + + + + 医生未回复或医生服务不满意,可联系平台客服协商进行退款。 + + + + + + + + + - - + --> 患者评价 ({{totalComment}}) @@ -143,7 +275,10 @@ {{item.content}} + + {{item.disease_class_name}} {{filter.formatDate(item.created_at)}} + - - + + + + diff --git a/pages/expertDetail/expertDetail.wxss b/pages/expertDetail/expertDetail.wxss index e36dbbd..383967d 100644 --- a/pages/expertDetail/expertDetail.wxss +++ b/pages/expertDetail/expertDetail.wxss @@ -437,7 +437,7 @@ background: #dedede; border-radius: 47rpx; display: flex; align-items: center; -color: #000000; +color: #fff; font-size: 36rpx; justify-content:center; @@ -513,4 +513,144 @@ justify-content:center; position: absolute; right:20rpx; top:30rpx; +} +.wz_tabbox{ + margin-top: 20rpx; +} +.tabs{ + margin-top: 16rpx; + display: flex; + justify-content: space-between; +} +.tabs .tab{ + width: 214rpx; + height: 300rpx; + position: relative; + box-shadow: 0rpx 8rpx 20rpx 2rpx rgba(0,0,0,0.04); +} +.tabbg{ + top:0rpx; +width: 100%; +z-index:0; +height: 314rpx; + position: absolute; +} +.typebox{ + margin-top: 158rpx; + position: relative; + + + z-index:1; + display: flex; + flex-direction: column; + align-items: center; +} +.typebox .name{ + color: #333333; + font-size: 32rpx; + font-weight: 500; + color: #333333; +} +.typebox .price{ + margin-top: 12rpx; + font-size: 28rpx; +font-weight: 400; +color: #EF4F20; +} +.jiaprice{ + margin-top: 10rpx; +font-size: 20rpx; +font-weight: 400; +color: #999999; +text-decoration: line-through; +} +.swiperbox{ + margin-top: 30rpx; +} +.swiper-item{ + border-radius: 20rpx; + + overflow: hidden; + position: relative; + background-color: #fff; +} +.swiper-item .title{ + margin-top: 10rpx; + font-size: 32rpx; +font-weight: 500; +color: rgba(0,0,0,0.85); +} +.tipbox{ + margin-top: 20rpx; +} +.tipbox .tipmsg{ + display: flex; + line-height: 44rpx; +} +.tipbox .tipmsg .circle{ + flex-shrink: 0; + margin-top: 17rpx; + margin-right: 10rpx; + width: 10rpx; +height: 10rpx; +background: #3BB5FE; +border-radius: 50%; +} +.tipbox .tipmsg .msg{ + font-size: 28rpx; +color: rgba(0,0,0,0.65); +} +.swiperbox .swiper-item:nth-child(1) .circle{ + background: #52C41A; +} +.swiperbox .swiper-item:last-child .circle{ + background: #FF9C00; +} +.tipbox.active .tipmsg .msg{ + color: rgba(0,0,0,0.35); +} +.swiperbox .tipbox.active .circle{ + background-color: rgba(0,0,0,0.35); +} +.itembg{ + height:100%; + width:100%; + position: absolute; + z-index:0; +} +.itembox{ + position: relative; + z-index:1; +} +.itembox{ + overflow: hidden; + padding: 30rpx; +} +/* .swiperbox .swiper-item:last-child{ + background-image: linear-gradient(270deg,#fff5e4,#fff); +} */ + +.typebox.disable .name,.typebox.disable .price{ + color: #999999; +} +.itembox.diable .title,.itembox.diable .msg{ + color: #999999; +} +.datebox{ + + display: flex; + justify-content: space-between; + align-items: flex-end; +} +.sick_name{ + margin-left: 20rpx; + font-size: 20rpx; +font-weight: 400; +display: flex; +border-radius: 20rpx; +height: 38rpx; +padding:0 15rpx; +border: 1rpx solid #3CC7C0; +align-items: center; +color: #3CC7C0; } \ No newline at end of file diff --git a/pages/index/index.js b/pages/index/index.js index 3a41aac..9bf001c 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -200,7 +200,7 @@ Page({ // } // }) app.method.navigateTo({ - url: '/pages/sugarDetail/sugarDetail', + url: '/sugarCheck/pages/sugarDetail/sugarDetail', }) }), goMall:throttle(function(){ diff --git a/pages/index/index.wxml b/pages/index/index.wxml index 24d081d..85cf2d6 100644 --- a/pages/index/index.wxml +++ b/pages/index/index.wxml @@ -151,7 +151,7 @@ - + @@ -162,9 +162,16 @@ {{item.doctor_title}}{{item.department_custom_name}} {{item.hospital_name}} 擅长:{{item.be_good_at}} - 公益问诊:¥{{item.free_clinic_price}} + + + 图文问诊:¥{{itemName.inquiry_price}}¥{{moduleFilter.formatPrice(item.doctor_inquiry_config)}} + {{itemName.inquiry_mode==1?'图文问诊':itemName.inquiry_mode==2?'视频问诊':'其他问诊'}}:¥{{itemName.inquiry_price}} + + + + diff --git a/pages/index/index.wxss b/pages/index/index.wxss index ad18350..717b14c 100644 --- a/pages/index/index.wxss +++ b/pages/index/index.wxss @@ -372,7 +372,6 @@ .price { margin-top: 28rpx; font-size: 28rpx; - margin-bottom: 45rpx; } .price text { @@ -557,3 +556,15 @@ justify-content: center; align-items: center; } +.price .expert_prcie{ + text-decoration: line-through; + color:#999; +} +.price .expert_prcie .priceactive{ + color:#999; +} +.pricecell{ + display: flex; + align-items: center; + white-space: nowrap; +} \ No newline at end of file diff --git a/pages/my/my.js b/pages/my/my.js index 445a573..051c5f0 100644 --- a/pages/my/my.js +++ b/pages/my/my.js @@ -70,7 +70,7 @@ Page({ }), goCheckOrder:throttle(function(){ app.method.navigateTo({ - url: '/pages/checkOrder/checkOrder', + url: '/sugarCheck/pages/checkOrder/checkOrder', }) }), goMyPrescript:throttle(function(){ diff --git a/pages/search/search.wxml b/pages/search/search.wxml index fdc20a9..01abc21 100644 --- a/pages/search/search.wxml +++ b/pages/search/search.wxml @@ -51,13 +51,18 @@ 平均回复: {{item.avg_response_time}} --> - + + 图文问诊:¥{{itemName.inquiry_price}}¥{{moduleFilter.formatPrice(item.doctor_inquiry_config)}} + {{itemName.inquiry_mode==1?'图文问诊':itemName.inquiry_mode==2?'视频问诊':'其他问诊'}}:¥{{itemName.inquiry_price}} + + + + diff --git a/pages/search/search.wxss b/pages/search/search.wxss index 668d995..5a4a0be 100644 --- a/pages/search/search.wxss +++ b/pages/search/search.wxss @@ -205,4 +205,16 @@ font-size: 30rpx; } .viewcell .left{ position: relative; +} +.price .expert_prcie{ + text-decoration: line-through; + color:#999; +} +.price .expert_prcie .priceactive{ + color:#999; +} +.pricecell{ + display: flex; + align-items: center; + white-space: nowrap; } \ No newline at end of file diff --git a/pages/selectPatient/selectPatient.js b/pages/selectPatient/selectPatient.js index 9ddeb59..8ee4b51 100644 --- a/pages/selectPatient/selectPatient.js +++ b/pages/selectPatient/selectPatient.js @@ -12,6 +12,7 @@ Page({ doctor_id:'', chat_id:'', inquiry_type:'', + inquiry_mode:'', show:false, sex:null, height:970, @@ -162,11 +163,11 @@ handleThrottleNext:throttle(function(){ }), goNext(){ let url=''; - let {doctor_id,currentFamilyId,chat_id,inquiry_type,sex}=this.data; + let {doctor_id,currentFamilyId,chat_id,inquiry_type,sex,inquiry_mode}=this.data; if(this.data.doctor_id){ - url='/pages/writeSick/writeSick?doctor_id='+doctor_id+"&family_id="+currentFamilyId+"&chat_id="+chat_id+"&inquiry_type="+inquiry_type+"&sex="+sex + url='/pages/writeSick/writeSick?doctor_id='+doctor_id+"&family_id="+currentFamilyId+"&chat_id="+chat_id+"&inquiry_type="+inquiry_type+"&sex="+sex+"&inquiry_mode="+inquiry_mode }else{ - url='/pages/writeSick/writeSick?family_id='+currentFamilyId+"&inquiry_type="+inquiry_type+"&sex="+sex + url='/pages/writeSick/writeSick?family_id='+currentFamilyId+"&inquiry_type="+inquiry_type+"&sex="+sex+"&inquiry_mode="+inquiry_mode } app.method.navigateTo({ url: url @@ -244,7 +245,8 @@ handleThrottleNext:throttle(function(){ } if(options.inquiry_type){ this.setData({ - inquiry_type:options.inquiry_type + inquiry_type:options.inquiry_type, + inquiry_mode:options.inquiry_mode }) } this.getFamily(); diff --git a/pages/writeSick/writeSick.js b/pages/writeSick/writeSick.js index 44054a3..3fff262 100644 --- a/pages/writeSick/writeSick.js +++ b/pages/writeSick/writeSick.js @@ -807,13 +807,14 @@ Page({ */ onLoad(options) { // 订单类型(1:专家问诊 2:快速问诊 3:公益问诊 4:问诊购药) + console.log(options.inquiry_mode) if (options.inquiry_type == 1 || options.inquiry_type == 3) { this.setData({ doctor_id: options.doctor_id, family_id: options.family_id, chat_id: options.chat_id, inquiry_type: options.inquiry_type, - inquiry_mode: 1, + inquiry_mode: options.inquiry_mode, sex: options.sex }) } else { diff --git a/project.config.json b/project.config.json index 04f9711..7a8843d 100644 --- a/project.config.json +++ b/project.config.json @@ -26,7 +26,7 @@ "packNpmRelationList": [ { "packageJsonPath": "./package.json", - "miniprogramNpmDistDir": "./miniprogram/" + "miniprogramNpmDistDir": "./" } ], "minifyWXSS": true, diff --git a/project.private.config.json b/project.private.config.json index 1a8fe30..05a1044 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -2,7 +2,8 @@ "projectname": "wxAppPatient", "setting": { "compileHotReLoad": true, - "urlCheck": false + "urlCheck": false, + "bigPackageSizeSupport": true }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "libVersion": "3.0.1" diff --git a/sugarCheck/pages/checkOrder/checkOrder.js b/sugarCheck/pages/checkOrder/checkOrder.js new file mode 100644 index 0000000..5417291 --- /dev/null +++ b/sugarCheck/pages/checkOrder/checkOrder.js @@ -0,0 +1,274 @@ +// pages/consultOrder/consultOrder.js +const app = getApp() +import {detectionList} from "../../../api/checkSugar" + import{family} from "../../../api/familyDoc" +Page({ + + /** + * 页面的初始数据 + */ + data: { + time: 0, + changeStatus:'', + changeId:'', + isLoading:true, + selectstatus:false, + selectfamily:false, + delId:'', + option1: [ + { text: '全部订单', value: 0 }, + { text: '待支付', value: 1 }, + { text: '待绑定', value: 2 }, + { text: '检测中', value: 3}, + { text: '检测完成', value: 4}, + {text:'已取消',value:5} + + ], + page:1, + isTriggered:false, + pageNumber:10, + option2: [], + detection_status: 0, + family_id:0, + orderList:[], + isLock:false, + img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', + fromType:'' + }, + handleRefresher(){ + this.setData({ + isLock:false, + page:1, + orderList:[] + }) + this.getDetectionList(); + }, + goBack(flag=true){ + + let {fromType}=this.data; + if(app.globalData.origion==1){ + wx.reLaunch({ + url: '/pages/index/index', + }) + }else if(app.globalData.origion==2){ + wx.reLaunch({ + url: '/pages/index/index', + }) + }else{ + if(fromType){ + wx.reLaunch({ + url: '/pages/my/my', + }) + }else{ + if(true){ + wx.navigateBack({ + delta: 1, + fail:function(){ + wx.reLaunch({ + url: '/pages/index/index', + }) + } + }) + } + + } + } + }, + lower(e) { + if(!this.data.isLock){ + this.setData({ + page: ++this.data.page + }) + this.getDetectionList() + } + }, + goExpertList(){ + app.method.navigateTo({ + url: '/sugarCheck/pages/checkOrderDetail/checkOrderDetail' //'/pages/expertConsult/expertConsult', + }) + }, + changeStatus({ detail }){ + this.setData({ + isLock:false, + page:1, + selectstatus:true, + detection_status:detail, + orderList:[] + }) + this.getDetectionList() + }, + changeFamily({ detail }){ + this.setData({ + family_id:detail, + isLock:false, + selectfamily:true, + page:1, + orderList:[] + }) + this.getDetectionList() + }, + getDetectionList(){ + let {detection_status,family_id,page,pageNumber}=this.data; + this.setData({ + isLoading:true + }) + detectionList({ + detection_status, + family_id, + page, + per_page:pageNumber + }).then(data=>{ + let result=data.data; + this.setData({ + isLoading:false + }) + if(result.length==0){ + this.setData({ + isLock:true, + isTriggered:false + }) + return false + }; + this.setData({ + orderList:this.data.orderList.concat(result), + isTriggered:false + }) + }) + }, + handelCancelOrder(id){ + cancelOrder(id).then(data=>{ + wx.showToast({ + title: '订单取消成功', + icon:"none" + }) + }) + }, + getfamily(){ + family().then(data=>{ + + let arr=[]; + data.forEach((item,index)=>{ + arr[index]={}; + let sex=""; + switch (item.sex){ + case '0':sex="未知"; + break; + case '1':sex="男"; + break; + case '2':sex="女"; + break; + } + let age=item.age; + arr[index].text=item.card_name+"("+sex+","+age+")"; + arr[index].value=item.family_id; + }) + arr=[{text:"全部成员",value:0}].concat(arr); + this.setData({ + option2:arr + }) + this.getDetectionList(); + }) + + }, + goDetail(event){ + let id=event.currentTarget.dataset.id; + app.method.navigateTo({ + url: '/sugarCheck/pages/checkOrderDetail/checkOrderDetail?order_detection_id='+id, + }) + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + if(options.fromType){ + this.setData({ + fromType:options.fromType + }) + }; + if(options.prevData){ + let json=JSON.parse(options.prevData); + this.setData({ + changeStatus:json.changeStatus, + changeId:json.changesId + }); + } + this.getfamily(); + + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.setData({ + img_host:app.hostConfig().imghost + }); + //刷新列表 + let {delId,orderList,changeStatus,changeId}=this.data; + if(delId){ + let list=orderList.filter((item)=>{ + return item.order_detection_id!=delId + }) + this.setData({ + orderList:list + }) + }else if(changeStatus && changeId){ + for (let i = 0; i < orderList.length; i++) { + const item =orderList[i]; + if(item.order_detection_id==changeId){ + let currentitem=`orderList[${i}].detection_status` + this.setData({ + [currentitem]:changeStatus + }) + break; + } + } + }else{ + // this.setData({ + // isLock:false, + // page:1, + // orderList:[] + // }) + // this.getDetectionList(); + // this.getfamily(); + } + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + // this.goBack(false) + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + +}) \ No newline at end of file diff --git a/sugarCheck/pages/checkOrder/checkOrder.json b/sugarCheck/pages/checkOrder/checkOrder.json new file mode 100644 index 0000000..e30fe4e --- /dev/null +++ b/sugarCheck/pages/checkOrder/checkOrder.json @@ -0,0 +1,11 @@ +{ + "usingComponents": { + "van-dropdown-menu": "@vant/weapp/dropdown-menu/index", + "van-dropdown-item": "@vant/weapp/dropdown-item/index", + "van-count-down": "@vant/weapp/count-down/index" + + }, + "navigationStyle":"custom", + "navigationBarTitleText":"肝胆相照互联网医院" + +} \ No newline at end of file diff --git a/sugarCheck/pages/checkOrder/checkOrder.wxml b/sugarCheck/pages/checkOrder/checkOrder.wxml new file mode 100644 index 0000000..8a33a73 --- /dev/null +++ b/sugarCheck/pages/checkOrder/checkOrder.wxml @@ -0,0 +1,107 @@ + + + + + + 检测订单 + + + + + + + + + + + + + 糖组检测 + + + 待支付 + + + + + 待绑定 + 检测中 + 已开具报告 + 已取消 + + 支付超时 + + + + + + + + + + {{item.user_doctor.user_name}} {{item.user_doctor.doctor_title}} + 平台分配医生中 + 接诊医生 + + {{item.user_doctor.hospital_name}} + + + + + + + + + + {{item.patient_name}}(未知{{item.patient_age}}岁) + + + + + + + 下单时间 + + {{item.created_at}} + + + 详情 + + + + + 下单时间 + + {{item.created_at}} + + + + 待付金额 + + ¥{{item.payment_amount_total}} + + + 详情 + + + + + + + + + + 暂无检测订单 + + + + \ No newline at end of file diff --git a/sugarCheck/pages/checkOrder/checkOrder.wxss b/sugarCheck/pages/checkOrder/checkOrder.wxss new file mode 100644 index 0000000..aff8359 --- /dev/null +++ b/sugarCheck/pages/checkOrder/checkOrder.wxss @@ -0,0 +1,332 @@ +/* pages/consultOrder/consultOrder.wxss */ +/**app.wxss**/ +.container { + padding-top: 135px; + padding-bottom: 10rpx; + /* top:280rpx; */ + /* position: absolute; */ + width:100%; + /* overflow-y: scroll; */ + background: #F2F2F2; + } + input{ + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + } + page{ + position: relative; + width:100%; + height:100%; + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', + sans-serif; + } + .page{ + width:100vw; + height:100vh; + background: #f2f2f2; + } + .contain{padding: 0 30rpx 0rpx;height: 100%;overflow: hidden;position: relative;} + ::-webkit-scrollbar { + display: none; + width: 0; + height: 0; + color: transparent; + } + .van-picker__confirm { + color:#3CC7C0!important; + font-size: 32rpx!important; + } + .van-picker__title{ + font-weight: 600!important; + color: rgba(0,0,0,0.9)!important; + font-size: 32rpx!important; + } + .van-picker__cancel{ + color: rgba(0,0,0,0.6)!important; + font-size: 32rpx!important; + } + .nonedata{ + width:100%; + color:#666; + min-height: 320rpx; + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; + } + .ui-navigatorbar { + position: fixed; + z-index:99; + top: 0; + width: 750rpx; + height: 172rpx; + background: #F2F2F2; + backdrop-filter: blur(20px); + } + + .ui-navigatorbar-back { + position: absolute; + padding-left:40rpx; + padding-right:40rpx; + width:30rpx; + height:60rpx; + left: 0rpx; + bottom: 20rpx; + } + + .ui-title { + position: absolute; + width: 350rpx; + height: 88rpx; + line-height: 56rpx; + font-size: 36rpx; + color: #000000; + bottom: 0; + left: 200rpx; + display: flex; + justify-content: center; + align-items: center; + } + .droptitle.active{ + color:#3CC7C0; + } + .slotmsg{ + -webkit-overflow-scrolling: touch; + font-size: 28rpx; + line-height:40rpx; + max-height:60vh; + overflow-y: auto; + padding:48rpx; + text-align: center; + } + .van-dropdown-item__title{ + width:100%!important; + flex:1; + text-align: center; + } + .van-dropdown-item__icon{ + z-index:2; + position: absolute!important; + + right:25rpx; + } + .van-cell__value{ + flex:none!important; + z-index:1; + } + .onlinebox .icon{ + top:60rpx; + left:50%; + position: absolute; + margin-left: -48rpx; + width:96rpx; + height:34rpx; + border-radius: 0; + } +.page { + display: flex; + flex-direction: column; +} + +.dropdown { + position: relative; + height:102rpx; + margin-top: 172rpx; +} + +.dropdown .bar { + position: absolute; + height: 40rpx; + width: 1rpx; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + background: #ccc; + opacity: 0.9; +} + +.van-dropdown-menu { + box-shadow: none !important; + border-bottom: 1rpx solid #E7E7E7; +} + +.btn { + position: absolute; + bottom: 20rpx; + left: 32rpx; + right: 32rpx; + display: flex; + height: 94rpx; + background: #3CC7C0; + border-radius: 47rpx; + justify-content: center; + align-items: center; + color: #fff; + background: #3CC7C0; + +} + +.nodata { + flex: 1; + display: flex; + + flex-direction: column; + align-items: center; +} + +.noorder { + margin-top: 150rpx; + width: 518rpx; + height: 325rpx; +} +.tips { + font-size: 28rpx; + font-weight: 400; + color: #666666; +} +.hasdata{ + flex: 1; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; + margin-top: 20rpx; +} +.datacell{ + background:#fff; + padding-bottom: 20rpx; + margin-bottom:10rpx; +} +.datacell:last-child{ + margin-bottom: 0; +} +.status{ + color: #333333; + font-size: 28rpx; +} +.titlebox .name{ + color: #000; + font-size: 32rpx; +} +.titlebox{ + padding:0 32rpx; + height: 112rpx; + border-bottom: 1rpx solid #E3E4E5; + display: flex; + justify-content: space-between; + align-items: center; +} +.waitpay{ + text-align: right; + color: #EF4F20 +} +.headicon{ + width:80rpx; + height:80rpx; + flex-shrink: 0; + border-radius: 50%; +} +.van-count-down { + margin-top: 5rpx; + color: #EF4F20!important; +} +.infobox{ + padding:20rpx 32rpx 0; + align-items: center; + display: flex; +} +.infobox .name{ + margin-left: 30rpx; + font-weight: 600; +} +.hospital{ + margin-left: 30rpx; + font-size: 28rpx; +font-weight: 400; +color: #333333; +} +.infobox .position{ + font-weight:normal; +} +.row{ + align-items: center; + padding:0 32rpx; + display: flex; + line-height: 52rpx +} +.row.first{ + margin-top: 15rpx; +} +.row .name{ + white-space: nowrap; + font-size: 28rpx; + color:#333; + font-weight: 600; + width:112rpx; + align-items: baseline; +} +.row.first .name{ + + display: flex; + justify-content: space-between; + +} +.row .dot{ + align-items: baseline; + height: 52rpx; + font-weight: 600; + display: flex; + +} +.row .desc{ + align-items: baseline; + font-size: 28rpx; + line-height: 52rpx; + color:#333; +} +.row .desc.red{ + color:rgba(239, 79, 32, 1); +} +.rowdesc{ + align-items: flex-start; +} +.namedesc{ + display: flex; + align-items: center; +} +.rowdesc .desc{ + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical +} +.row .price{ +color:#EF4F20; +font-weight: bold; +font-size:34rpx +} +.row.last{ + justify-content: space-between; +} +.row .left{ + display: flex; +} +.row .right{ + display: flex; +} +.righticon{ + width:24rpx; + height:48rpx; +} +.right .detail{ + margin-right: 10rpx; + color: #666666; +} +.agebar{ + display: inline-block; + width:2rpx; + background: #333; + height:26rpx; + margin: 0rpx 10rpx 0; +} \ No newline at end of file diff --git a/sugarCheck/pages/checkOrderDetail/checkOrderDetail.js b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.js new file mode 100644 index 0000000..6c78abe --- /dev/null +++ b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.js @@ -0,0 +1,643 @@ +// pages/medinceOrderDetail/medinceOrderDetail.js +const app = getApp() +import {detectionDetail,bindCheck,cancelCheckPay,delCheckOrder,cancelCheckOrder,checkInquiry} from "../../../api/checkSugar.js" +import {cancelPay} from "../../../api/consultOrder" +import {cancelOrder} from "../../../api/consultOrder" +import {fllowDoctor,notfllowDoctor} from "../../../api/consultExpert" +import {throttle} from "../../../utils/util" +import {getSign} from "../../../api/common" +import Dialog from '@vant/weapp/dialog/dialog'; +Page({ + + /** + * 页面的初始数据 + */ + data: { + time: 30 * 60 * 60 * 1000, + showCover:true, + isWait:true, + cancelBtn:false, + order:{}, + showError:false, + pay_money:0, + fileList:[], + checkSatus:1, + showCheckDialog:false, + checkmessage:'', + detection_bar_code:'', + detection_code:'', + order_detection_id:'', + showDialog:false, + message:'', + fromType:'', + user_doctor:{}, + order:{}, + patient_family_data:'', + img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static' + }, + onClickHide() { + this.setData({ showCover: false }); + wx.setStorageSync("showCover",true); + }, + closeError(){ + this.setData({ showError: false }); + }, + delImg(event) { + let id = event.currentTarget.dataset.id; + this.data.fileList.splice(id, 1); + this.setData({ + fileList: this.data.fileList + }) + }, + previewImage(event) { + let id = event.currentTarget.dataset.id; + let urls = this.data.fileList; + wx.previewImage({ + current: urls[id], // 当前显示图片的http链接 + urls: urls // 需要预览的图片http链接列表 + }) + }, + uploadFile(File) { + wx.showLoading({ + title: '图片上传中...', + mask: true + }) + let THIS = this; + getSign({ + user_type: 1, + scene: 4 + }).then((resdata) => { + let { + accessid, + dir, + policy, + signature, + host + } = resdata; + let index = File.lastIndexOf("/"); + let filename = File.substring(index + 1, File.length); + return new Promise((resolve, reject) => { + wx.uploadFile({ + url: host, // 仅为示例,非真实的接口地址 + filePath: File, + name: 'file', + formData: { + OSSAccessKeyId: accessid, + policy, + key: dir + filename, + signature + }, + success(res) { + if (res.statusCode === 204) { + let url = host + '/' + dir + filename; + THIS.setData({ + fileList: THIS.data.fileList.concat([url]) + }) + } + }, + fail: err => { + console.log(err); + } + }); + }) + }) + }, + upload() { + if(this.data.fileList.length>=3){ + wx.showToast({ + title: '检测管照片最多上传3张', + icon:"none" + }) + return false + }; + let THIS = this; + wx.chooseMedia({ + count: 3-this.data.fileList.length, + mediaType: ['image'], + sourceType: ['album', 'camera'], + success(res) { + var imgList = res.tempFiles; + var promiseFun = []; + for (let i = 0; i < imgList.length; i++) { + var file = imgList[i].tempFilePath; + promiseFun.push( + THIS.uploadFile(file) + ) + }; + Promise.all(promiseFun).then((res) => { + wx.showToast({ + title: '图片上传成功', + icon: "none" + }) + wx.hideLoading(); + }); + + } + }) + }, + + goBack(){ + let {fromType}=this.data; + if(app.globalData.origion==1){ + wx.reLaunch({ + url: '/pages/index/index', + }) + }else if(app.globalData.origion==2){ + wx.reLaunch({ + url: '/pages/index/index', + }) + }else{ + if(fromType){ + let url=decodeURIComponent(fromType); + let goUrl=''; + if(url.indexOf('?')!=-1){ + goUrl='/'+url+"&fromType="+url; + }else{ + goUrl='/'+url+"?fromType="+url; + } + //处理聊天收到消息不及时; + if(url.indexOf("TUIService/pages/index")!=-1){ + app.method.navigateTo({ + url:goUrl + }) + }else{ + wx.redirectTo({ + url: goUrl + }) + } + + }else{ + wx.navigateBack({ + delta: 1, + fail:function(){ + wx.reLaunch({ + url: '/pages/index/index', + }) + } + }) + } + } + + }, + bluript(event){ + const {value}=event.detail; + const reg=/^SDB[A-Z](?:2[3-9]|2[0-2])[SP](?:1688[6-9]|1689\d|169\d\d|1[7-9]\d\d\d|[2-9][0-9]{4}|99999)$/; + let detection_status=this.data.order.detection_status; + if(detection_status!=3){ + if(reg.test(value)){ + this.setData({ + showError:false + }) + }else{ + this.setData({ + showError:true + }) + } + } + + + }, + chnageIpt(event){ + const {value}=event.detail; + this.setData({ + detection_bar_code:value + }) + }, + handleCancelInquiryPay(){ + let {order_inquiry_id} = this.data; + cancelPay(order_inquiry_id).then(data=>{ + wx.showToast({ + title: '取消支付成功', + icon:'none' + }) + this.handleCheckInquiry(); + }) + }, + handelCancelInquiryOrder(){ + let id=this.data.order_inquiry_id; + cancelOrder(id).then(data=>{ + wx.showToast({ + title: '订单取消成功', + icon:"none" + }); + this.handleCheckInquiry(); + // this.goChat() + }) + }, + handleCheckInquiry:throttle(function(){ + let id=this.data.order.order_detection_id; + checkInquiry(id).then(data=>{ + console.log(data); + if(data.status==1){ + this.setData({ + order_inquiry_id:data.data, + }) + this.goChat(); + }else if(data.status==2){ + this.setData({ + showCheckDialog:true, + order_inquiry_id:data.data, + checkSatus:2, + checkmessage:'当前医生有您待支付的订单,点击“继续”将为您取消订单直接进入报告解读服务。' + }) + }else if(data.status==3){ + this.setData({ + checkSatus:3, + showCheckDialog:true, + order_inquiry_id:data.data, + checkmessage:'当前医生有您待接诊的订单,点击“继续”将为您取消订单直接进入报告解读服务。' + }) + }else if(data.status==4){ + this.setData({ + showCheckDialog:true, + checkSatus:4, + order_inquiry_id:data.data, + checkmessage:'当前医生有您接诊中的订单,点击“继续”将为您直接进入报告解读服务。' + }) + } + }) + },1000), + goReport:throttle(function(){ + wx.showLoading({ + mask:true, + title: '正在打开文件...', + }); + let url=this.data.order.detection_result_pdf; + const randfile = new Date().getTime() + '检测报告'; + const newPath = `${wx.env.USER_DATA_PATH}/${randfile}`; + wx.downloadFile({ + // 示例 url,并非真实存在 + url:url, + filePath: newPath, + success: function (res) { + //const filePath = res.tempFilePath + wx.openDocument({ + fileType:"pdf", + showMenu:true, + filePath: newPath, + success: function (res) { + wx.hideLoading() + console.log('打开文档成功') + }, + fail:function(error){ + wx.hideLoading() + wx.showToast({ + title:res, + icon:"none" + }) + } + }) + }, + fail:function(error){ + wx.showToast({ + title:error, + icon:"none" + }) + } + + }) + // app.method.navigateTo({ + // url:"/pages/linkPage/linkPage?url="+encodeURIComponent(url) + // }) + }), + handleBindCheck:throttle(function(){ + let id=this.data.order.order_detection_id; + let detection_status=this.data.order.detection_status; + if(detection_status==3){ + wx.showToast({ + title: '您已提交,请等待结果', + icon:"none" + }) + return false + } + const {detection_bar_code,fileList}=this.data; + const reg=/^SDB[A-Z](?:2[3-9]|2[0-2])[SP](?:1688[6-9]|1689\d|169\d\d|1[7-9]\d\d\d|[2-9][0-9]{4}|99999)$/; + if(!reg.test(detection_bar_code)){ + wx.showToast({ + title: '检测码格式不正确', + icon:"none" + }) + this.setData({ + showError:true + }) + return false + } + bindCheck(id,{ + detection_bar_code, + detection_pic:fileList + }).then(data=>{ + this.handleDetectionDetail(); + wx.showToast({ + title: '提交成功', + icon:"none" + }) + }) + }), + goChat:throttle(function(){ + let {user_id}=this.data.user_doctor; + let order_inquiry_id=this.data.order.order_inquiry_id; + let anther_order_inquiry_id=this.data.order_inquiry_id; + let id=''; + if(!order_inquiry_id && !anther_order_inquiry_id){ + wx.showToast({ + title: '服务器错误', + icon:'none' + }); + return false + }; + if(order_inquiry_id){ + id=order_inquiry_id + }else if(anther_order_inquiry_id){ + id=anther_order_inquiry_id + } + app.method.navigateTo({ + url: '/TUIService/pages/index?currentConversationID=' + user_id + "&order_inquiry_id=" + id+ "&inquiry_type=5" + }) + }), + orderMsg(){ + wx.requestSubscribeMessage({ + tmplIds: ['82rKSdbKkbFK_tHmIMnHyfyRJq9ujvmAsTjRHdxmCdE'], + success (res) { + Dialog.confirm({ + title: '温馨提示', + confirmButtonOpenType:'contact', + message: '立即联系客服', + }).then(() => { + // on confirm + }).catch(()=>{ + + }) + } + }) + }, + goSugar:throttle(function(){ + app.method.navigateTo({ + url: '/pages/sugarDetail/sugarDetail', + }) + }), + goExpert:throttle(function(){ + let id=this.data.user_doctor.doctor_id; + app.method.navigateTo({ + url: '/pages/expertDetail/expertDetail?doctor_id='+id, + }) + }), + handleDetectionDetail(flag=false){ + let id =this.data.order_detection_id; + detectionDetail(id).then(data=>{ + if(flag){ + let pages = getCurrentPages(); + let prevPage = pages[pages.length - 2]; //上一页 + prevPage.setData({ + changeStatus:data.detection_status, + changeId:id + }); + }; + let pay_money=(Number(data.amount_total)-Number(data.coupon_amount_total)).toFixed(2); + this.setData({ + order:data, + detection_bar_code:data.detection_bar_code, + user_doctor:data.user_doctor, + pay_money + }); + + + if(data.detection_pic && data.detection_pic.length>0){ + this.setData({ + fileList:data.detection_pic + }) + } + }) +}, +goScan:throttle(function(){ + let that=this; + wx.scanCode({ + onlyFromCamera: true, + scanType:['qrCode','barCode','datamatrix','pdf417'], + success (res) { + const reg=/^SDB[A-Z](?:2[3-9]|2[0-2])[SP](?:1688[6-9]|1689\d|169\d\d|1[7-9]\d\d\d|[2-9][0-9]{4}|99999)$/; + console.log(res.result); + if(reg.test(res.result)){ + that.setData({ + detection_bar_code:res.result, + showCode:true, + showError:false + }) + }else{ + that.setData({ + showDialog:true, + cancelBtn:false, + message:'无法识别,请手动输入检测码' + }) + } + + } + }) +}), +confirmCancelOrder(){ + this.setData({ + showDialog:true, + cancelBtn:true, + message:"是否确定要取消检测?" + }) +}, +confirmDelOrder(){ + this.setData({ + showDialog:true, + cancelBtn:true, + message:"您确定是要删除订单记录么?" + }) +}, +confirmCancelPay(){ + this.setData({ + showDialog:true, + cancelBtn:true, + message:"您确定取消支付么?" + }) + }, +confirm:throttle(function(event){ + if(event.detail && this.data.message=="您确定是要删除订单记录么?"){ + this.handelDelProduct(); + }else if(event.detail && this.data.message=="您确定取消支付么?"){ + this.handelCancelPayProduct(); + }else if(event.detail && this.data.message=="是否确定要取消检测?"){ + this.handelCancelCheckOrder(); + } +}), +//未支付2 //待接诊需要重新请求检测订单3 +confirmCheck:throttle(function(){ + if(this.data.checkSatus==2){ + this.handleCancelInquiryPay(); + }else if(this.data.checkSatus==3){ + this.handelCancelInquiryOrder(); + }else if(this.data.checkSatus==4){ + this.goChat(); + } +}), +handelCancelCheckOrder(flag=true){ + let id =this.data.order.order_detection_id; + cancelCheckOrder(id).then(data=>{ + wx.showToast({ + title: '取消成功', + icon:"none" + }) + if(!flag){ + this.goChat(); + } + this.handleDetectionDetail(); + }) +}, +handelCancelPayProduct(flag=true){ + let id =this.data.order.order_detection_id; + cancelCheckPay(id).then(data=>{ + wx.showToast({ + title: '取消支付成功', + icon:"none" + }) + if(!flag){ + this.handleCheckInquiry(); + } + this.handleDetectionDetail(); + }) +}, +copy(event){ + let text=event.target.dataset.text; + wx.setClipboardData({ + data:text + }) +}, +goPay:throttle(function(){ + let {order_detection_id,detection_no}=this.data.order; + app.method.navigateTo({ + url: '/pages/payOrder/payOrder?inquiry_no='+ detection_no +"&order_detection_id="+order_detection_id+"&order_type=3&fromType="+encodeURIComponent('/sugarCheck/pages/checkOrder/checkOrder') + }) +}), +handelDelProduct(){ + let id =this.data.order.order_detection_id; + delCheckOrder(id).then(data=>{ + let pages = getCurrentPages(); + //获取所需页面 + let prevPage = pages[pages.length - 2]; //上一页 + prevPage.setData({ + delId: id//需要传过去的数据 + }); + wx.navigateBack({ + delta: 1, + }) + wx.showToast({ + title: '订单删除成功', + icon:"none" + }); + + }) +}, +goPrescriptionDetail:throttle(function(event){ + let id=event.currentTarget.dataset.id; + app.method.navigateTo({ + url: '/pages/prescriptDetail/prescriptDetail?order_prescription_id='+id, + }) +}), +handelfllowDoctor(){ + let id=this.data.user_doctor.doctor_id + fllowDoctor(id).then(data=>{ + this.setData({ + "user_doctor.follow":true + }) + wx.showToast({ + title: '关注成功', + icon:"none" + }) + }) +}, +handenotfllowDoctor(){ + let id=this.data.user_doctor.doctor_id; + notfllowDoctor(id).then(data=>{ + this.setData({ + "user_doctor.follow":false + }) + wx.showToast({ + title: '已取消关注', + icon:"none" + }) + }) +}, +toggleFllow(){ + if(this.data.order.user_doctor.follow){ + this.handenotfllowDoctor() + }else{ + this.handelfllowDoctor() + } +}, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + const cover=wx.getStorageSync('showCover'); + if(cover){ + this.setData({ + showCover:false + }) + } + if(options.fromType){ + this.setData({ + fromType:options.fromType + }) + } + let order_detection_id=options.order_detection_id; + console.log(order_detection_id) + if(order_detection_id){ + this.setData({ + order_detection_id + }); + this.handleDetectionDetail(); + } + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.setData({ + img_host:app.hostConfig().imghost + }); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + +}) \ No newline at end of file diff --git a/sugarCheck/pages/checkOrderDetail/checkOrderDetail.json b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.json new file mode 100644 index 0000000..60d4be6 --- /dev/null +++ b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.json @@ -0,0 +1,12 @@ +{ + "usingComponents": { + "van-count-down": "@vant/weapp/count-down/index", + "dialog":"../../../components/dialog/dialog", + "van-dialog": "@vant/weapp/dialog/index", + "van-icon": "@vant/weapp/icon/index", + "van-overlay": "@vant/weapp/overlay/index" + }, + "navigationStyle":"custom", + "disableScroll":true, + "navigationBarTitleText": "肝胆相照互联网医院" +} \ No newline at end of file diff --git a/sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxml b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxml new file mode 100644 index 0000000..07e24b4 --- /dev/null +++ b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxml @@ -0,0 +1,258 @@ + + + + + 订单详情 + + + + + + + 就诊人信息 + + + {{order.patient_name}}(未知|{{order.patient_age}}岁) + + + + + + 绑定检测码 + + + + + + + 检测码有误,请重新输入 + + + + + + + + + + + + + + + + + 上传 + + + + + 预计检测完成时间 + {{order.detection_success_time}} + + + + + 订单信息 + + + + + 待支付 + + + + + 待绑定 + 检测中 + 检测完成 + 取消检测 + 支付超时 + + + + 订单编号 + + + + {{order.detection_no}} + + | + + 复制 + + + + + 下单时间 + + + {{order.created_at}} + + + + 问诊类型 + + 糖组检测 + + + + 订单金额 + + + ¥{{order.amount_total}} + + + + + + + ¥{{order.coupon_amount_total}} + + + + + 支付金额 + + + + ¥{{pay_money}} + + + + + + + + + 主动取消 + 客服取消 + 支付超时 + + + + + 退款进度 + + + + 无退款 + + + 申请退款 + + + 退款中 + + + 退款成功 + + + 拒绝退款 + + + 退款关闭 + + + + + + 联系客服 + + + 取消检测 + + + 删除订单 + + + + + + + + + + + + {{user_doctor.user_name}} + {{user_doctor.hospital_level_name}} + 可处方 + + + + + {{user_doctor.doctor_title}} + 主任中医师 + {{user_doctor.department_custom_name}} + + {{user_doctor.hospital_name}} + + + +   关注 + + + +   关注 + + + + + + + + + 联系客服 + + + + + + + + 取消支付 + + 立即支付 + + + + + + 提交 + + + 查看报告 + + 报告解读 + + + + + 重新检测 + + + + + + + + + + 知道了 + + + + + + \ No newline at end of file diff --git a/sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxss b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxss new file mode 100644 index 0000000..bf1b094 --- /dev/null +++ b/sugarCheck/pages/checkOrderDetail/checkOrderDetail.wxss @@ -0,0 +1,887 @@ +/* pages/medinceOrderDetail/medinceOrderDetail.wxss */ +/**app.wxss**/ +.container { + padding-top: 135px; + padding-bottom: 10rpx; + /* top:280rpx; */ + /* position: absolute; */ + width:100%; + /* overflow-y: scroll; */ + background: #F2F2F2; + } + input{ + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + } + page{ + position: relative; + width:100%; + height:100%; + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', + sans-serif; + } + .page{ + width:100vw; + height:100vh; + background: #f2f2f2; + } + .contain{padding: 0 30rpx 0rpx;height: 100%;overflow: hidden;position: relative;} + ::-webkit-scrollbar { + display: none; + width: 0; + height: 0; + color: transparent; + } + .van-picker__confirm { + color:#3CC7C0!important; + font-size: 32rpx!important; + } + .van-picker__title{ + font-weight: 600!important; + color: rgba(0,0,0,0.9)!important; + font-size: 32rpx!important; + } + .van-picker__cancel{ + color: rgba(0,0,0,0.6)!important; + font-size: 32rpx!important; + } + .nonedata{ + width:100%; + color:#666; + min-height: 320rpx; + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; + } + .ui-navigatorbar { + position: fixed; + z-index:99; + top: 0; + width: 750rpx; + height: 172rpx; + background: #F2F2F2; + backdrop-filter: blur(20px); + } + + .ui-navigatorbar-back { + position: absolute; + padding-left:40rpx; + padding-right:40rpx; + width:30rpx; + height:60rpx; + left: 0rpx; + bottom: 20rpx; + } + + .ui-title { + position: absolute; + width: 350rpx; + height: 88rpx; + line-height: 56rpx; + font-size: 36rpx; + color: #000000; + bottom: 0; + left: 200rpx; + display: flex; + justify-content: center; + align-items: center; + } + .droptitle.active{ + color:#3CC7C0; + } + .slotmsg{ + -webkit-overflow-scrolling: touch; + font-size: 28rpx; + line-height:40rpx; + max-height:60vh; + overflow-y: auto; + padding:48rpx; + text-align: center; + } + .van-dropdown-item__title{ + width:100%!important; + flex:1; + text-align: center; + } + .van-dropdown-item__icon{ + z-index:2; + position: absolute!important; + + right:25rpx; + } + .van-cell__value{ + flex:none!important; + z-index:1; + } + .onlinebox .icon{ + top:60rpx; + left:50%; + position: absolute; + margin-left: -48rpx; + width:96rpx; + height:34rpx; + border-radius: 0; + } +.page{ + position: relative; + display: flex; + flex-direction: column; + margin-bottom:0rpx; +} +.outwraper{ + flex:1; + overflow-y: scroll; + -webkit-overflow-scrolling: touch; + padding-bottom: 200rpx; +} +.outwraper.active{ + padding-bottom: 220rpx; +} +.add { + width: 100%; + display: flex; + justify-content: center; + align-items: center; + height: 120rpx; + background: #FFFFFF; + font-weight: 600; + color: #ED9C00; + font-size: 32rpx; +} +.addicon{ + width: 40rpx; + height:40rpx; + flex-shrink: 0; +} +.addressbox { + margin-top:172rpx; + align-items: center; + display: flex; + justify-content: space-between; + padding: 32rpx 32rpx; + background-color: #fff; +} + +.addressbox .left { + display: flex; + align-items: center; +} + +.addressbox .icon { + width: 40rpx; + flex-shrink: 0; + height: 47rpx; + +} + +.addressbox .info { + margin-left: 30rpx; +} + +.addressbox .ricon { + width: 24rpx; + height: 48rpx; +} + +.info .name { + font-size: 28rpx; + font-weight: 600; + color: #333333 +} + +.info .address { + margin-top: 10rpx; + color: #333333; + font-size: 28rpx; +} +.row { + align-items: center; + padding: 0 32rpx; + display: flex; + line-height: 52rpx +} + +.row.first { + margin-top: 34rpx; +} + +.rowbox .row .name { + white-space: nowrap; + font-size: 28rpx; + color: #333; + font-weight: 600; + display: flex; + width:114rpx; + align-items: baseline; + justify-content: space-between; +} +.row .dot{ + font-weight: 600; + display: flex; + align-items: baseline; +} +.row .desc { + align-items: baseline; + font-size: 28rpx; + color: #333; +} + +.rowdesc { + align-items: flex-start; +} + +.rowdesc .desc { + text-overflow: -o-ellipsis-lastline; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + line-clamp: 2; + -webkit-box-orient: vertical +} + +.row .price { + color: #EF4F20; + font-weight: bold; + font-size: 34rpx +} + +.row.last { + justify-content: space-between; +} + +.copy { + + height: 40rpx; + color: #000; + font-size: 24rpx; + display: flex; + margin-left: 20rpx; + align-items: center; + justify-content: center; + border-radius: 6rpx; +} +.row .left { + display: flex; +} + +.row .right { + display: flex; +} + +.titlebox .name { + color: #000; + font-size: 34rpx; +} +.rowbox{ + margin-top: 20rpx; + background-color: #fff; + padding-bottom: 30rpx; +} +.titlebox { + padding: 0 32rpx; + height: 112rpx; + border-bottom: 1rpx solid #E3E4E5; + display: flex; + justify-content: space-between; + align-items: center; +} +.titlebox .status{ + font-size: 28rpx +} +.waitpay { + text-align: right; + color: #EF4F20 +} + +.headicon { + width: 80rpx; + height: 80rpx; + border-radius: 50%; +} + +.van-count-down { + margin-top: 5rpx; + color: #EF4F20 !important; +} +.infobox { + margin-top: 20rpx; + background:#fff; + +} +.infobox .status{ + font-size: 28rpx; + font-weight: 400; + color: #333333; +} +.infobox .status.wait{ + color: #EF4F20; +} +.infobox .status.timeout{ + color: #EF4F20; +} +.infobox .title { + padding: 0 32rpx; + background-color: #fff; + font-size: 34rpx; + height: 112rpx; + align-items: center; + display: flex; + justify-content: space-between; + border-bottom: 1rpx solid #E3E4E5; +} + +.imgbox { + border-radius:8rpx; + border:1rpx solid #ccc; + width: 200rpx; + height: 200rpx; + display: flex; + align-items: center; + justify-content: center; + position: relative; +} + +.yaoimg { + width: 120rpx; + height: 128rpx; +} + +.imgbox .desc { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + position: absolute; + top: 50%; + font-size: 22rpx; + font-weight: 400; + color: #666666; + line-height: 30rpx; + transform: translateY(-50%); +} + +.imgbox .desc .tip { + text-align: center; +} + +.medincebox .cell { + padding: 30rpx 32rpx; + display: flex; + align-items: center; + border-bottom: 1rpx solid #E3E4E5; +} +.medincebox .cell:nth-last-child(2){ + border-bottom:none; +} +.rightinfo { + margin-left: 30rpx; + flex: 1; + + display: flex; + flex-direction: column; + justify-content: center; +} + +.medincebox .cell .name { + word-break: break-all; + font-size: 32rpx; + font-weight: bold; + color: #333; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-box-orient: vertical; + -webkit-line-clamp: 2; + overflow: hidden; +} +.row.beizhu{ + align-items: flex-start; +} +.rightinfo .own { + margin-top: 47rpx; + display: flex; + justify-content: space-between; + align-items: center; + font-size: 28rpx; + font-weight: 400; + color: #333333; +} +.btnbox{ + display: flex; + padding:0 32rpx; + font-size: 30rpx; + padding-bottom: 30rpx; + justify-content: flex-end; +} +.btnbox .btn{ + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20rpx; + height:58rpx; + background: #FFFFFF; + border-radius: 30rpx; + margin-left: 20px; + +} +.btnbox .orderDetail{ + background: #3CC7C0; + color:#fff; + border: 1rpx solid #3CC7C0; +} +.personinfo{ + margin-top: 20rpx; + background: #fff; +} +.personinfobox { + padding: 30rpx 32rpx 40rpx; + background: #fff; + margin-top: 20rpx; + margin-bottom:10rpx; +} +.personinfobox .title { + background-color: #fff; + font-size: 32rpx; + height: 112rpx; + align-items: center; + display: flex; + justify-content: space-between; + border-bottom: 1rpx solid #E3E4E5; +} +.personinfobox .namebox .head { + width: 80rpx; + height:80rpx; + border-radius: 50%; +} + +.personinfobox .namebox .guanzhu image { + width: 28rpx; + height: 26rpx; +} + + +.personinfobox .namewraper { + flex:1; + display: flex; + + justify-content: space-between; + flex-direction: column; + margin-left: 20rpx; +} +.personinfobox .type { + height: 32rpx; + display: flex; + margin-bottom: 6rpx; + line-height: 32rpx; + white-space: nowrap; + align-items: center; + margin-left: 18rpx; + padding: 0rpx 6rpx; + background: #ED9C00; + border-radius: 4rpx; + color: #FFFFFF; + font-size: 24rpx; +} + +.personinfobox .namebox .row { + display: flex; + padding:0; + align-items: flex-end; + +} + +.personinfobox .namebox { + display: flex; + align-items:stretch; + + justify-content: space-between; +} + +.personinfobox .namebox .name { + display: inline-block; + overflow: hidden; + max-width:400rpx; + text-overflow: ellipsis; + white-space: nowrap; + font-weight: 600; + color: #333333; + font-size: 34rpx; +} + +.personinfobox .position { + font-size: 30rpx; + white-space: normal; + word-break: break-all; +} +.doctor_title{ + margin-right: 10rpx; +} +.personinfobox .namebox .row{ + line-height: 40rpx; + align-items: flex-end; +} +.personinfobox .hospital { + margin-top: 12rpx; + color: #333333; + font-size: 28rpx; + white-space: normal; + word-break: break-all; +} + + +.personinfobox .namebox .position { + font-weight: normal; + white-space: nowrap; + margin-left: 15rpx; + font-size: 30rpx; +} +.personinfobox .goodjob { + color: #666666; + margin-top: 38rpx; + line-height: 42rpx; + margin-left: 100rpx; + font-size: 28rpx; + word-break: break-all; +} +.paybox{ + bottom:0px; + height: 186rpx; + background: #FFFFFF; + position: absolute; + display: flex; + z-index:1; + width:100%; +} +.submitbtn{ + width:100%; + margin:16px 32rpx 0; + height: 94rpx; +background: #3CC7C0; +border-radius: 47rpx; +display: flex; +justify-content: center; +align-items: center; +font-size: 36rpx; +color: #FFFFFF; +} +.submitbtn.active{ + color: #000000; + background: rgba(0,0,0,0.1); +} +.paybox .left{ + height: 94rpx; +border-radius: 47rpx; +font-size: 36rpx; +color: rgba(0,0,0,0.85); +border: 1rpx solid rgba(0,0,0,0.65); + margin-left: 32rpx; + flex:1; + font-size: 28rpx; +margin-top: 16rpx; + display: flex; + align-items: center; + justify-content: center; + +} +.orderrow{ + display: flex; + margin:10rpx 32rpx 0; + justify-content: flex-end; +} +.freetalk{ + position: absolute; + width:403rpx; + height:79rpx; + top: -53rpx; + left:25rpx; +} +.paybox .right{ + position: relative; + margin-right: 32rpx; + margin-top: 16rpx; + color: #FFFFFF; + display: flex; + margin-left: 24rpx; + align-items: center; + justify-content: center; + background: #3CC7C0; + height: 94rpx; + font-size: 36rpx; +color: #FFFFFF; + background: #3CC7C0; + border-radius: 47rpx; + flex:2; +} +.express{ +width: 158rpx; +height: 60rpx; +display: flex; +justify-content: center; +align-items: center; +background: #F8F8F8; +font-size: 26rpx; +font-weight: 400; +color: #353535; +border-radius: 6rpx; +border: 1rpx solid rgba(5,5,5,0.1); +} +.namenum{ + font-size: 28rpx; +font-weight: 400; +color: #333333; +} +.row.wuliu{ + margin-top: 20rpx; + align-items: flex-start; +} +.row.wuliu .desc{ + margin-left: 20rpx; +} +.desc .dizhi{ + font-size: 28rpx; +font-weight: 400; +color: #333333; +line-height: 28rpx; +} +.wuliucar{ + width:40rpx; + height:33rpx; + flex-shrink: 0; +} +.row.wuliu .date{ + font-size: 24rpx; +font-weight: 400; +color: #666666; +} +.guanzhu { + flex-shrink: 0; + display: flex; + white-space: nowrap; + color: #3CC7C0; + font-size: 30rpx; + font-weight: 600; + justify-content: center; + align-items: center; + font-size: 24rpx; + +} +.namebox .guanzhu image { + width: 35rpx; + height: 32rpx; +} +.patientbox{ + margin-top: 172rpx; + width:100%; + box-sizing: border-box; + padding:0 32rpx; + display: flex; + align-items: center; + justify-content: space-between; + height: 109rpx; +background: #FFFFFF; +} +.patient_name{ + font-size: 32rpx; +font-weight: 400; +color: rgba(0,0,0,0.85) +} +.patientbox .rightcon{ + font-size: 28rpx; + font-weight: 400; + color: rgba(0,0,0,0.65) +} +.namebox{ + display: flex; +} +.rowbox .row{ + justify-content: space-between; +} +.bar{ + margin-left: 30rpx; + color: rgba(0,0,0,0.45); + height: 40rpx; + margin-bottom: 5rpx; + display: flex; + align-items: center; +} +.rightbox{ + display: flex; + align-items: center; +} +.bindbox{ + overflow: hidden; + padding:0 32rpx 10rpx; + margin:20rpx 0rpx; + background: #FFFFFF; +} +.errorbox{ + margin-top: 10rpx; + display: flex; + height: 80rpx; +background: #FFF1F0; +border-radius: 8rpx; +padding:0 20rpx; + align-items: center; + justify-content: space-between; +} +.tiptitle{ + height: 80rpx; + align-items: center; + display: flex; + justify-content: space-between; + margin-top: 10rpx; +} +.tipleft{ + font-size: 32rpx; + color: rgba(0,0,0,0.85); +} +.tipright{ + color:#4096FF; + font-size: 28rpx; +} +.iptbox{ + margin-top: 24rpx; + width:100%; + height: 78rpx; +border-radius: 6rpx; +border: 2rpx solid #3CC7C0; +display: flex; +align-items: center; +} +.iptbox.active{ + border: 2rpx solid #FF4D4F; +} +.mybar{ + height:38rpx; + margin:0 30rpx; + width:2rpx; + background:#3CC7C0 ; +} +.ipt{ + margin-left: 20rpx; + flex:1; +} +.scan{ + margin-right: 20rpx; + width:40rpx; + height:40rpx; +} +.uploadbox{ + + margin:24rpx 0rpx 0; + display: flex; + flex-wrap: wrap ; +} +.uploadbox .close{ + z-index:9; + top:5rpx; + right:5rpx; + position: absolute; + width:30rpx; + height:30rpx; +} +.uploadbox .upload{ + position: relative; + object-fit: cover; + display: flex; + flex-direction: column; + margin: 5px 19rpx 5px 0; +} +.uploadbox .upload:nth-child(4n){ + margin-right: 0; +} +.van-icon-plus{ + color:#333; + font-size: 80rpx!important; +} +.upload{ + width: 148rpx; + height:148rpx; + display: flex; + justify-content:center ; + align-items: center; + background: #F2F2F2; + border-radius: 4rpx +} +.uploadbox view:first-child{ + margin-left: 0!important; +} +.upload .text{ + font-size: 28rpx; +} + +.errorleft{ + display: flex; + align-items: center; +} +.checkerror{ + margin-right: 10rpx; + width:40rpx; + height:40rpx; +} +.checkclose{ + width:32rpx; + height:32rpx; +} +.wrapper{ + width:100%; + display: flex; + align-items: center; + flex-direction: column; + justify-content: center; + margin:285rpx auto; +} +.timg1{ + width:694rpx; +} +.timg2{ + width:506rpx; +} +.button{ + display: flex; + align-items: center; + justify-content: center; + width: 224rpx; + font-size: 32rpx; +height: 83rpx; +font-weight: 500; +margin-top: 72rpx; +color: #FFFFFF; +border-radius: 47rpx; +border: 1rpx solid #FFFFFF; +} +.contactbox{ + width: 320rpx; + margin:20rpx auto 0rpx; +height: 72rpx; +border-radius: 39rpx; +border: 2rpx solid rgba(0,0,0,0.15); +align-items: center; +color: rgba(0,0,0,0.85); +font-size: 28rpx; +justify-content: center; + display: flex; +} +.kefu{ + width: 32rpx; + margin-right: 10rpx; + height: 32rpx; +} +.finish{ + margin-top: 20rpx; + display: flex; + justify-content: space-between; + margin-bottom: 20rpx; + align-items: center; +} +.finish .left{ + font-size: 32rpx; +font-weight: 400; +color: rgba(0,0,0,0.85); +} +.finish .right{ + font-size: 28rpx; +font-weight: 400; +color: rgba(0,0,0,0.45); +} \ No newline at end of file diff --git a/sugarCheck/pages/sugarDetail/sugarDetail.js b/sugarCheck/pages/sugarDetail/sugarDetail.js new file mode 100644 index 0000000..b7b8652 --- /dev/null +++ b/sugarCheck/pages/sugarDetail/sugarDetail.js @@ -0,0 +1,387 @@ +// pages/sugarDetail/sugarDetail.js +const app = getApp() +import {throttle} from "../../../utils/util" +import {family,addfamily} from "../../../api/familyDoc"; +import {getProject,hasCreate} from "../../../api/checkSugar" +Page({ + + /** + * 页面的初始数据 + */ + data: { + img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', + showdialog:false, + cancelBtn:false, + messageTitle:'', + opacity:0, + nation_id:'', + nation_name:'', + show:false, + projectImg:'', + detection_project_id:1, + idCard:'', + relation:'', + phoneNumber:'', + card_name:'', + realName:'', + showAdd:false, + currentName:'', + age:"", + currentFamilyId:'', + showPicker:false, + family:[], + columns: [{ + text: "本人", + value: 1 + }, + { + text: "父母", + value: 2 + }, + { + text: "爱人", + value: 3 + }, + { + text: "子女", + value: 4 + }, + { + text: "亲戚", + value: 5 + }, + { + text: "其他 ", + value: 6 + } +] + }, + onConfirmPicker(event) { + const {value} = event.detail; + this.setData({ + relationId: `${value.value}`, + relation: `${value.text}`, + showPicker: false + }); + }, + + openPicker() { + this.setData({ + showPicker: true + }) + }, + closePicker() { + this.setData({ + showPicker: false + }) + }, + addPatient(){ + this.setData({ + showAdd:true, + currentFamilyId:"", + sex:"" + }) + }, + onCloseAdd() { + this.setData({ + showAdd: false + }); + }, + onClose(){ + this.setData({ + show:false + }) + }, + showPatient(){ + this.setData({ + show:true + }) + }, + onConfirm(event) { + const { value} = event.detail; + this.setData({ + relationId: `${value.value}`, + relation:`${value.text}`, + showPicker:false + }); + }, + inputChange(e){ + this.setData({ + [e.target.dataset.id]: e.detail.value + }) + }, + handelGetProject(){ + let {detection_project_id}=this.data; + getProject( + detection_project_id + ).then(data=>{ + this.setData({ + projectImg:data.img_path + }) + }) + }, + cancelAlert(){ + this.setData({ + showdialog: false + }) + }, + confirm(event) { + if (event.detail) { + this.setData({ + showdialog: false + }) + } + if(this.data.messageTitle=="当前患者存在进行中检测订单"){ + let {order_detection_id}=this.data; + app.method.navigateTo({ + url: '/sugarCheck/pages/checkOrderDetail/checkOrderDetail?order_detection_id='+ order_detection_id, + }) + } + }, + handleHasCreate(){ + let {currentFamilyId,sex,currentName,detection_project_id,age,nation_id,nation_name}=this.data; + hasCreate({ + family_id:currentFamilyId, + detection_project_id:detection_project_id + }).then(data=>{ + if(data){ + this.setData({ + showdialog:true, + messageTitle:"当前患者存在进行中检测订单", + order_detection_id: data, + cancelBtn:true + }) + }else{ + let cur_nation_id=nation_id?nation_id:''; + let cur_nation_name=nation_name?nation_name:''; + app.method.navigateTo({ + url: '/sugarCheck/pages/sugarSickInfo/sugarSickInfo?family_id='+currentFamilyId+"&real_name="+currentName+"&detection_project_id="+detection_project_id+"&sex="+sex+"&age="+age+"&nation_id="+cur_nation_id+"&nation_name="+cur_nation_name + }) + } + }) + }, + + //获取身份证号信息 + getIdInfo(IdCard){ + var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/; + if(reg.test(IdCard)){ + let sex + if (parseInt(IdCard.substr(16, 1)) % 2 === 1) { + sex = '1' + } else { + sex = '2' + } + var ageDate = new Date() + var month = ageDate.getMonth() + 1 + var day = ageDate.getDate() + var age = ageDate.getFullYear() - IdCard.substring(6, 10) - 1 + if (IdCard.substring(10, 12) < month || (IdCard.substring(10, 12) === month && IdCard.substring(12, 14) <= day)) { + age++ + } + if (age <= 0) { + age = 1 + } + return { sex, age} + }else{ + return false; + } +}, + addFamily(){ + let {realName,idCard,phoneNumber,relationId}=this.data; + addfamily({ + card_name:realName, + type:1, + id_number:idCard, + mobile:phoneNumber, + is_default:0, + relation:relationId + }).then((data)=>{ + this.getFamily(); + this.setData({ + currentFamilyId:data.family_id, + realName:'', + idCard:'', + phoneNumber:'', + relationId:'', + showAdd:false, + relation:'', + show:true + }) + }) + }, + selectPatient(e){ + const {familyid,sex,card_name,age,nation,nation_name}=e.currentTarget.dataset; + this.setData({ + currentFamilyId:familyid, + sex:sex, + nation_name:nation_name, + age:age, + nation_id:nation, + currentName:card_name + }) + }, + getFamily(){ + family().then((data)=>{ + this.setData({ + family:this.transforpage(data) + }) + }) + }, + transforpage(arr) { + const pages = [] + let newArr=arr.concat([{ + type:"add" + }]) + newArr.forEach((item, index) => { + const page = Math.floor(index / 2) + if (!pages[page]) { + pages[page] = [] + } + pages[page].push(item) + }); + return pages + }, + goBack(){ + console.log("origion:"+app.globalData.origion) + if(app.globalData.origion==1){ + wx.reLaunch({ + url: '/pages/index/index', + }) + }else if(app.globalData.origion==2){ + wx.reLaunch({ + url: '/pages/index/index', + }) + }else{ + wx.navigateBack({ + delta: 1, + fail:function(){ + wx.reLaunch({ + url: '/pages/index/index', + }) + } + }) + } + + }, + handleThrottleSick:throttle(function(){ + + this.goSick() + }), + goSick(){ + + if (!/^([\u4e00-\u9fa5\·]{2,10})$/.test(this.data.realName)) { + wx.showToast({ + title: `姓名要求在2-10个汉字`, + icon: 'none', + }); + return false; + }; + if (!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(this.data.idCard)){ + wx.showToast({ + title: `请输入有效的身份证号`, + icon: 'none', + }); + return false; + }; + if(this.data.phoneNumber){ + if(!/^1[3456789]\d{9}$/.test(this.data.phoneNumber)){ + wx.showToast({ + title: `请输入有效的手机号码!`, + icon: 'none', + }); + return false; + } + }; + let idInfo=this.getIdInfo(this.data.idCard); + if(idInfo.age<6){ + wx.showToast({ + title: `六岁以下儿童不支持线上问诊`, + icon: 'none', + }); + return false; + } + + this.setData({ + sex:idInfo.sex, + age:idInfo.age, + nation_id:'', + nation_name:'', + currentName:this.data.realName + }) + this.addFamily(); + + }, + onPageScroll: function(e) { + let opacity=0; + if(e.scrollTop/(86*2)>=1){ + opacity=1 + }else{ + opacity=e.scrollTop/(86*2) + } + this.setData({ + opacity:opacity + }) + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + img_host:app.hostConfig().imghost + }); + this.handelGetProject(); + this.getFamily() + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + this.setData({ + img_host:app.hostConfig().imghost + }); + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + // onShareAppMessage() { + + // } +}) \ No newline at end of file diff --git a/sugarCheck/pages/sugarDetail/sugarDetail.json b/sugarCheck/pages/sugarDetail/sugarDetail.json new file mode 100644 index 0000000..8f2f31b --- /dev/null +++ b/sugarCheck/pages/sugarDetail/sugarDetail.json @@ -0,0 +1,8 @@ +{ + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "dialog":"../../../components/dialog/dialog", + "van-picker": "@vant/weapp/picker/index" + }, + "navigationStyle":"custom" +} \ No newline at end of file diff --git a/sugarCheck/pages/sugarDetail/sugarDetail.wxml b/sugarCheck/pages/sugarDetail/sugarDetail.wxml new file mode 100644 index 0000000..3fb96bd --- /dev/null +++ b/sugarCheck/pages/sugarDetail/sugarDetail.wxml @@ -0,0 +1,89 @@ + + + + 糖组检测 + + + + + + + + 填写信息 + + + + + + + 选择患者 + + + + + + {{item.card_name}} + 本人 + 父母 + 爱人 + 子女 + 亲戚 + 其他 + + + 性别未知 + + + {{item.age}}岁 + + + + + +新建患者 + + + + + + + + + + + 新建患者 + + 真实姓名* + + + + 身份证号* + + + + 联系电话 + + + + 患者关系 + + + + 温馨提示: + + 1、国家卫健委要求,就医行为必须实名登记,信息仅接诊医生可见,请谨慎填写患者信息。 + + 3、6岁以下儿童不支持线上问诊,请到线下就诊。 + + + + + 确定 + + + + + + + diff --git a/sugarCheck/pages/sugarDetail/sugarDetail.wxss b/sugarCheck/pages/sugarDetail/sugarDetail.wxss new file mode 100644 index 0000000..fa612cf --- /dev/null +++ b/sugarCheck/pages/sugarDetail/sugarDetail.wxss @@ -0,0 +1,383 @@ +/* pages/sugarDetail/sugarDetail.wxss */ +.dcimg{ + width:750rpx; +} +/**app.wxss**/ +.container { + padding-top: 135px; + padding-bottom: 10rpx; + /* top:280rpx; */ + /* position: absolute; */ + width:100%; + /* overflow-y: scroll; */ + background: #F2F2F2; + } + input{ + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + } + page{ + position: relative; + width:100%; + height:100%; + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', + sans-serif; + } + .page{ + width:100vw; + height:100vh; + background: #f2f2f2; + } + .contain{padding: 0 30rpx 0rpx;height: 100%;overflow: hidden;position: relative;} + ::-webkit-scrollbar { + display: none; + width: 0; + height: 0; + color: transparent; + } + .van-picker__confirm { + color:#3CC7C0!important; + font-size: 32rpx!important; + } + .van-picker__title{ + font-weight: 600!important; + color: rgba(0,0,0,0.9)!important; + font-size: 32rpx!important; + } + .van-picker__cancel{ + color: rgba(0,0,0,0.6)!important; + font-size: 32rpx!important; + } + .nonedata{ + width:100%; + color:#666; + min-height: 320rpx; + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; + } + .ui-navigatorbar { + position: fixed; + z-index:99; + top: 0; + width: 750rpx; + height: 172rpx; + background: #F2F2F2; + backdrop-filter: blur(20px); + } + + .ui-navigatorbar-back { + position: absolute; + padding-left:40rpx; + padding-right:40rpx; + width:30rpx; + height:60rpx; + left: 0rpx; + bottom: 20rpx; + } + + .ui-title { + position: absolute; + width: 350rpx; + height: 88rpx; + line-height: 56rpx; + font-size: 36rpx; + color: #000000; + bottom: 0; + left: 200rpx; + display: flex; + justify-content: center; + align-items: center; + } + .droptitle.active{ + color:#3CC7C0; + } + .slotmsg{ + -webkit-overflow-scrolling: touch; + font-size: 28rpx; + line-height:40rpx; + max-height:60vh; + overflow-y: auto; + padding:48rpx; + text-align: center; + } + .van-dropdown-item__title{ + width:100%!important; + flex:1; + text-align: center; + } + .van-dropdown-item__icon{ + z-index:2; + position: absolute!important; + + right:25rpx; + } + .van-cell__value{ + flex:none!important; + z-index:1; + } + .onlinebox .icon{ + top:60rpx; + left:50%; + position: absolute; + margin-left: -48rpx; + width:96rpx; + height:34rpx; + border-radius: 0; + } +.page{ + position: relative; + min-height: 100%; + height:auto; + padding-bottom: 450rpx; +} +.nextbox{ + position: fixed; + bottom:0rpx; + z-index:1; + height:482rpx; + width:750rpx; +} +.msgbtn{ + font-size: 36rpx; + display: flex; + align-items: center; + justify-content: center; + background-image: linear-gradient( + 180deg, + rgba(182, 245, 243, 1) 0, + rgba(111, 229, 225, 1) 18.201463%, + rgba(56, 187, 181, 1) 89.000166%, + rgba(60, 199, 192, 1) 100% + ); + border-radius: 47rpx; + height:94rpx; + width: 638rpx; + margin:0 auto; + color:#fff; +} +.msgbtnbox{ + width:100%; + position: absolute; + bottom:80rpx; +} +.ui-navigatorbar-back{ + width:24rpx; + height:40rpx; +} +.personbox { + border-radius: 10rpx; + background-color: #fff; + padding: 40rpx 20rpx 144rpx; + overflow-y: scroll; +} + +.personbox .row { + margin-top: 30rpx; + display: flex; + justify-content: space-between; + +} + +.personbox .row:first-child { + margin-top: 0; +} + +.personbox .row .cell { + position: relative; + width: 47%; + height: 120rpx; + display: flex; + flex-direction: column; + justify-content: center; + margin-left: 30rpx; + border-radius: 10rpx; + border: 1px solid #CCCCCC; +} + +.personbox .row .cell:first-child { + margin-left: 0rpx; +} + +.personbox .person { + display: flex; + margin: 0 25rpx; + align-items: center; +} + +.personbox .tag { + margin-left: 32rpx; + font-size: 24rpx; + display: flex; + align-items: center; + line-height: 24rpx; + justify-content: center; + color: #666666; + width: 80rpx; + height: 32rpx; + border-radius: 4rpx; + transform: rotateZ(360deg); + border: 1rpx solid #979797; +} + +.personbox .desc { + display: flex; + margin: 0 25rpx; + font-size: 28rpx; + color: #666; + margin-top: 3px; +} + +.personbox .name { + white-space: nowrap; + overflow: hidden; + max-width: 200rpx; + text-overflow: ellipsis; + font-size: 34rpx; + color: #333; +} + +.personbox .age { + + margin-left: 12rpx; +} + +.personbox .cell .gou { + position: absolute; + bottom: -1rpx; + right: 0rpx; + width: 66rpx; + height: 53.7rpx; +} + +.personbox .add { + justify-content: center; + align-items: center; + font-size: 34rpx; + color: #333; +} +.own .add.disabled{ + color: #999; +} +.titlepop{ + font-size: 34rpx; +font-weight: 400; +color: #333333; + padding:40rpx 0; + text-align: center; + width:100%; + border-bottom:1rpx solid #E7E7E7; +} + +.van-icon-cross { + color: #333; + font-size: 40rpx !important; +} + +.infobox { + margin-top: 40rpx; +} + + +.infobox .title { + border-bottom: 1rpx solid #E7E7E7; + text-align: center; + font-size: 34rpx; + padding-bottom: 35rpx; +} +.info { + border-bottom: 1rpx solid #E7E7E7; + display: flex; + align-items: center; + height: 112rpx; + color: #333333; +} + +.info .name { + white-space: nowrap; + width: 180rpx; + display: flex; + align-items: center; + margin-left: 52rpx; + color: #333333; + font-size: 34rpx; +} + +.info text { + margin-top: 20rpx; + color:#E34D59; + + display: flex; + align-items: center; +} +.info input { + margin-left: 15rpx; + margin-right: 52rpx; + flex: 1; +} +.input-placeholder { + color: #999999; + font-size: 28rpx; +} +.tip{ + padding:20rpx 20rpx; + margin:30rpx 52rpx 20rpx; + background: #FFF2F0; + border-radius: 12rpx; +} +.warntitle{ + color: #E34D59; + font-size: 28rpx; +} +.warn{ + margin-top: 20rpx; + font-size: 24rpx; + line-height: 36rpx; + color: #666666; +} +.next{ + display: flex; + align-items: center; + justify-content: center; + height: 94rpx; + font-size: 36rpx; + left: 30rpx; + right: 30rpx; + margin:0 52rpx; + border-radius: 47rpx; + color: #fff; + margin-bottom: 40rpx; + background: #3CC7C0; +} +.celladd{ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + height: 120rpx; +} +.btnbox .btn{ + border-radius: 47rpx; + border:none; + background: #3CC7C0!important; + margin:0 32rpx; + height: 94rpx; + display: flex; + justify-content: center; + align-items: center; + font-size: 36rpx; +color: #FFFFFF!important; +} +.btnbox .btn[disabled]{ +color: #000000!important; +background:rgba(0,0,0,0.1)!important; +} +.btnbox{ + position: fixed; + width:100%; + bottom:0rpx; + height: 134rpx; + background:#fff; + +} diff --git a/sugarCheck/pages/sugarSickInfo/sugarSickInfo.js b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.js new file mode 100644 index 0000000..fd1be7d --- /dev/null +++ b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.js @@ -0,0 +1,668 @@ +// pages/sugarSickInfo/sugarSickInfo.js +import {nation} from "../../../api/common" +import {getLocation,getDiseaseList,getDoctorList,createDetection,getPurposeList,getProject,getArea} from "../../../api/checkSugar" +import {getProvince,getCity,getCountry} from "../../../api/consultExpert" +import {throttle} from "../../../utils/util" +import Dialog from '@vant/weapp/dialog/dialog'; +import {client_type} from "../../../utils/isPc" +let wait_time=15; + +const beforeClose = (action) => + new Promise((resolve) => { + console.log(action,wait_time); + try { + if (action === 'confirm' && wait_time<=0) { + resolve(true); + }else if (action === 'cancel') { + resolve(true); + }else { + // 拦截取消操作 + resolve(false); + } + } catch (error) { + + } + }); +const app = getApp(); +let provinceArr=[{area_id:'', area_name: "全国"}]; +let cityArr=[]; +Page({ + + /** + * 页面的初始数据 + */ + data: { + showSick:false, + showNation:false, + showDoctor:false, + currentPatientName:'', + showNationSelect:false, + showCity:false, + confirmtext:"同意", + currentPosition:"全国", + detection_project_id:1, + sick_name:'', + real_name:'', + doctor_name:'', + nation_name:'', + nation_id:'', + purpose_id:'', + purpose_name:'', + confirmColor:"#bfbfbf", + nationcolumns:[], + sickList:[], + sex:"", + age:'', + showAgree:false, + messageAgree:'', + doctorList:[], + timer:null, + doctorResult:'', + select_doctor_id:'', + showdialog:false, + order_detection_id:'', + messageTitle:"", + cancelBtn:false, + columns: [{ + values: [], + className: 'column1', + }, + { + values: [], + className: 'column2', + defaultIndex: 1, + }, + { + values: [], + className: 'column3', + defaultIndex: 1, + } + ], + sickResult:[], + disease_ids:[], + area:{ + province_id:'', + city_id:'', + county_id:'' + }, + img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static' + }, + cancelAgree(){ + this.setData({ + showAgree: false + }) + }, + + confirmAgree(event){ + if (event.detail ) { + this.setData({ + showAgree: false + }) + } + }, + cancelAlert(){ + this.setData({ + showdialog: false + }) + }, + confirm(event) { + if (event.detail) { + this.setData({ + showdialog: false + }) + } + if(this.data.messageTitle=="当前患者存在进行中检测订单"){ + let {order_detection_id}=this.data; + app.method.navigateTo({ + url: '/pages/checkOrderDetail/checkOrderDetail?order_detection_id='+ order_detection_id, + }) + } + }, + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + this.setData({ + family_id:options.family_id, + real_name:options.real_name, + sex:options.sex, + age:options.age, + nation_id:options.nation_id, + nation_name:options.nation_name, + detection_project_id:options.detection_project_id + }) + // {{real_name}}({{sex==1?'男':'女'}} | {{age}}岁 {{showNationSelect?" | "+nation_name:''}}) + let sex=options.sex==1?'男':'女'; + if(options.nation_id){ + this.setData({ + currentPatientName:options.real_name+"("+sex+" | "+options.age+"岁 | "+options.nation_name+")", + showNationSelect:false + }) + }else{ + this.setData({ + currentPatientName:options.real_name+"("+sex+" | "+options.age+"岁"+")", + showNationSelect:true + }) + } + + this.handelGetProject(); + this.handleWxLocation(); + this.getNation(); + this.handlegetDiseaseList(); + this.handleGetPurposeList(); + }, + handleWxLocation(){ + let that=this; + try { + wx.getFuzzyLocation({ + type: 'gcj02', + success (res) { + if(res.errMsg=='getFuzzyLocation:ok'){ + const latitude = res.latitude; + const longitude = res.longitude; + that.handleGetLocation(longitude,latitude); + } + + }, + fail(err){ + console.log(err) + console.log("获取位置信息失败") + that.handleGetDoctorList(); + } + }) + } catch (error) { + + } + + }, + goAgree(){ + let {detection_project_id}=this.data; + app.method.navigateTo({ + url:'/pages/agreement/agreement?detection_project_id='+detection_project_id + }) + }, + handelGetProject(){ + let {detection_project_id}=this.data; + getProject( + detection_project_id + ).then(data=>{ + this.setData({ + nodes:data.informed_consent_form + }) + }) + }, + handleCreateDetection:throttle(function(){ + + let {nation_id,doctorResult,sickResult,real_name,purpose_id,showNationSelect,disease_ids,timer}=this.data; + let detection_disease_class_ids=''; + sickResult.forEach((item)=>{ + if(!detection_disease_class_ids){ + detection_disease_class_ids+=item + }else{ + detection_disease_class_ids+=","+item + } + }) + if(!real_name){ + wx.showToast({ + title:"请输入真实姓名", + icon:"none" + }); + return false + }; + if(!nation_id && showNationSelect){ + wx.showToast({ + title:"请选择民族", + icon:"none" + }); + return false + }; + if(disease_ids.length==0){ + wx.showToast({ + title:"请选择既往病史", + icon:"none" + }); + return false + }; + if(!purpose_id){ + wx.showToast({ + title:"请选择目的", + icon:"none" + }); + return false + }; + if(!doctorResult){ + wx.showToast({ + title:"请选择申请医生", + icon:"none" + }); + return false + }; + wait_time=15; + this.setData({ + confirmColor:wait_time==0?"#3CC7C0":"#bfbfbf" + }); + Dialog.confirm({ + title: '知情同意书', + width:'710rpx', + message: '弹窗内容', + selector:"#agreeDialog", + confirmButtonText :wait_time==0?"同意":"同意("+wait_time+"S)", + beforeClose:beforeClose, + }).then(() => { + this.goPay(); + // on confirm + }).catch(() => { + console.log("none") + // on cancel + }); + if(this.data.timer){ + clearInterval(this.data.timer); + }; + let timerSetInterval=setInterval(()=>{ + + if(wait_time<=1){ + clearInterval(timer); + wait_time=0; + this.setData({ + waitTime:0, + confirmColor:"#3CC7C0", + confirmtext:"同意", + }) + return false + } + wait_time--; + + this.setData({ + confirmtext:"同意("+wait_time+"S)", + }) + },1000) + this.setData({ + timer:timerSetInterval + }) + + }), + goPay:throttle(function(){ + let {family_id,nation_id,detection_project_id,doctorResult,sickResult,purpose_id}=this.data; + let detection_disease_class_ids=''; + sickResult.forEach((item)=>{ + if(!detection_disease_class_ids){ + detection_disease_class_ids+=item + }else{ + detection_disease_class_ids+=","+item + } + }) + createDetection({ + company_id:1, + patient_id:wx.getStorageSync('CLIENT_USER_ID'), + family_id, + doctor_id:doctorResult, + nation_id, + purpose_id, + detection_disease_class_ids, + detection_project_id, + client_type:client_type + }).then(data=>{ + if(data.status==1){ + app.method.navigateTo({ + url: '/pages/payOrder/payOrder?&inquiry_no=' + data.data.inquiry_no + "&order_detection_id="+ data.data.order_no+"&order_type=3&fromType="+encodeURIComponent('pages/checkOrder/checkOrder') + }) + }else if(data.status==2){ + this.setData({ + showdialog:true, + messageTitle:"当前患者存在进行中检测订单", + order_detection_id: data.data.order_no, + cancelBtn:true + }) + } + }) + }), + onChangeSick(event) { + console.log(event.detail) + let result=event.detail; + this.setData({ + sickResult:result , + }); + const {sickList}=this.data; + for (let i = 0; i < sickList.length; i++) { + let temp="sickList["+i+"].check"; + if(result.indexOf(sickList[i].id)!==-1){ + this.setData({ + [temp]:true + }) + }else{ + this.setData({ + [temp]:false + }) + } + } + //console.log(sickList); + + }, + onChangeDoctor(event) { + // console.log(event) + this.setData({ + doctorResult: event.detail, + }); + }, + showNation() { + this.setData({ + showNation: true + }) + +}, +onCancelNation() { + this.setData({ + showNation: false + }) +}, +onConfirmNation(event) { + const { + value + } = event.detail; + this.setData({ + "nation_name": `${value.nation_name}`, + "nation_id": `${value.nation_id}`, + showNation: false + }) +}, +openPurpose(){ + this.setData({ + showPurpose: true + }) +}, +onConfirmPurpose(event) { + const { + value + } = event.detail; + this.setData({ + "purpose_name": `${value.purpose_name}`, + "purpose_id": `${value.purpose_id}`, + showPurpose: false + }) +}, +onCancelPurpose(){ + this.setData({ + showPurpose: false + }) +}, +getNation(){ + nation().then(data=>{ + this.setData({ + nationcolumns:data + }) + }) +}, +handleGetArea(){ + getArea().then(data=>{ + console.log('获取地址') + console.log(data) + let position =''; + if(data.province || data.city || data.county){ + position=data.province+data.city+data.county + }else{ + position="全国" + } + this.setData({ + area:data, + currentPosition:position + }) + this.handleGetDoctorList(); + }) +}, +handleGetLocation(lon,lat){ + getLocation({ + lon, + lat + }).then(data=>{ + this.handleGetArea(); + + }) +}, +handleGetPurposeList(){ + getPurposeList().then(data=>{ + this.setData({ + purposecolumns:data + }) + }) +}, +handlegetDiseaseList(){ + getDiseaseList({ + detection_project_id:1 + }).then(data=>{ + //let arr=[]; + data.forEach(item=>{ + item.check=false; + }) + this.setData({ + sickList:data + }) + }) +}, +handleGetDoctorList(){ + const {area}=this.data; + const postData={ + company_id:1, + province_id:area.province_id, + city_id:area.city_id, + county_id:area.county_id + } + getDoctorList(postData).then(data=>{ + this.setData({ + doctorList:data + }) + }) +}, +toggleSick(event) { + + const { index } = event.currentTarget.dataset; + const checkbox = this.selectComponent(`.checkboxessick-${index}`); + checkbox.toggle(); + }, + onClickDcotor(event){ + const {name,userid,doctorname,hospital} = event.currentTarget.dataset; + console.log(userid,name) + this.setData({ + doctorResult: name, + doctor_name:doctorname+"("+hospital+")", + showDoctor:false + }); + }, + noop() {}, + onConfirmSick() { + let {sickResult,sickList}=this.data; + this.setData({ + showSick: false, + disease_ids:sickResult + }); + let sick_name=""; + sickList.forEach((item)=>{ + if(sickResult.indexOf(item.id)!=-1){ + if(!sick_name){ + sick_name+=item.name; + }else{ + sick_name+=" | "+item.name + } + } + }) + this.setData({ + sick_name + }) + }, + closeDoctor(){ + this.setData({ + showDoctor: false + }) + }, + openCity(){ + this.provinceList() + this.setData({ + showCity:true + }) + }, + openSick() { + this.setData({ + showSick: true + }) + }, + openDoctor(){ + this.setData({ + showDoctor:true + }) + }, + closeSick() { + this.setData({ + showSick: false + }) + }, + provinceList(){ + getProvince().then((res)=>{ + provinceArr= provinceArr.concat(res); + let province=[{area_id:'', area_name: "全国"}];// + for (let i = 0; i < res.length; i++) { + province.push(res[i]); + }; + this.setData({ + 'columns[0].values':province + }) + //this.cityList(province[0].area_id); + + }) + }, + cityList(area_id){ + getCity({ + area_id:area_id + }).then((res)=>{ + + cityArr=res; + let city=[]; + for (let i = 0; i < res.length; i++) { + city.push(res[i]); + }; + this.setData({ + 'columns[1].values':city, + // 'area.county_id':res[0].area_id + }) + this.countryList(res[0].area_id); + }) + }, + countryList(area_id){ + getCountry({ + area_id:area_id + }).then((res)=>{ + let area=[]; + for (let i = 0; i < res.length; i++) { + area.push(res[i]); + }; + this.setData({ + 'columns[2].values':area, + isLoding:false + }) + }) + }, + onConfirm(event) { + const {value} = event.detail; + let currentPosition='' + for (let index = 0; index < value.length; index++) { + if(!value[0].area_id){ + currentPosition="全国"; + this.setData({ + area:{ + province_id:'', + city_id:'', + county_id:'', + province:'', + city:'', + county:'' + } + }) + }else{ + currentPosition+=value[index].area_name; + if(index===0){ + this.setData({ + 'area.province_id':value[index].area_id + }) + }else if(index==1){ + this.setData({ + 'area.city_id':value[index].area_id, + }) + }else if(index==2){ + this.setData({ + 'area.county_id':value[index].area_id + }) + } + } + } + this.setData({ + currentPosition:currentPosition, + showCity: false + }); + console.log(this.data.area); + this.handleGetDoctorList(); + }, + onChangePicker(event) { + const { picker, value, index } = event.detail; + if(index===0){ + let currentIndex=picker.getIndexes()[0]; + if(provinceArr[currentIndex].area_id){ + this.cityList(provinceArr[currentIndex].area_id); + }else{ + this.setData({ + 'columns[1].values':[], + 'columns[2].values':[] + }) + } + } + }, + onCancel() { + this.setData({ + showCity: false + }) + }, + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + clearInterval(this.data.timer); + // this.setData({ + // sickResult:[], + // doctorResult:'' + // }) + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + clearInterval(this.timer); + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + +}) \ No newline at end of file diff --git a/sugarCheck/pages/sugarSickInfo/sugarSickInfo.json b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.json new file mode 100644 index 0000000..bf9332c --- /dev/null +++ b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.json @@ -0,0 +1,16 @@ +{ + "usingComponents": { + "van-popup": "@vant/weapp/popup/index", + "van-picker": "@vant/weapp/picker/index", + "nav":"../../../components/nav/nav", + "van-checkbox": "@vant/weapp/checkbox/index", + "van-cell": "@vant/weapp/cell/index", + "van-cell-group": "@vant/weapp/cell-group/index", + "van-checkbox-group": "@vant/weapp/checkbox-group/index", + "van-radio": "@vant/weapp/radio/index", + "van-radio-group": "@vant/weapp/radio-group/index", + "dialog":"../../../components/dialog/dialog", + "van-dialog": "@vant/weapp/dialog/index" + }, + "navigationStyle":"custom" +} \ No newline at end of file diff --git a/sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxml b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxml new file mode 100644 index 0000000..22de194 --- /dev/null +++ b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxml @@ -0,0 +1,127 @@ + + + + + + + 真实姓名* + + + + + + 民族* + + + + + + + 既往病史* + + + + + + + 目的* + + + + + + + 申请医生* + + + + + + + + + 根据国家互联网诊疗相关政策的要求,请您在使用服务前仔细阅读《风险告知与知情同意书》,肝胆相照互联网医院平台医生,仅为您提供健康咨询服务,咨询意见供您参考。继续操作表示您知悉并同意上述告诉内容。 + + + + + 立即支付 + + + + + + + 申请医生 + + + + {{currentPosition}} + + + + + + + + + + + + + + {{ item.user_name}} + + 主任中医师 + 主任医师 + 副主任医师 + 副主任中医师 + 主治医师 + 住院医师 + + {{item.hospital_name}} + + + + + + + 暂无医生数据! + + + + + + + 取消 + 既往病史(最多3项) + 确定 + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxss b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxss new file mode 100644 index 0000000..7cafe28 --- /dev/null +++ b/sugarCheck/pages/sugarSickInfo/sugarSickInfo.wxss @@ -0,0 +1,327 @@ +/* pages/sugarSickInfo/sugarSickInfo.wxss */ +/**app.wxss**/ +.container { + padding-top: 135px; + padding-bottom: 10rpx; + /* top:280rpx; */ + /* position: absolute; */ + width:100%; + /* overflow-y: scroll; */ + background: #F2F2F2; + } + input{ + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + } + page{ + position: relative; + width:100%; + height:100%; + font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Helvetica, + Segoe UI, Arial, Roboto, 'PingFang SC', 'miui', 'Hiragino Sans GB', 'Microsoft Yahei', + sans-serif; + } + .page{ + width:100vw; + height:100vh; + background: #f2f2f2; + } + .contain{padding: 0 30rpx 0rpx;height: 100%;overflow: hidden;position: relative;} + ::-webkit-scrollbar { + display: none; + width: 0; + height: 0; + color: transparent; + } + .van-picker__confirm { + color:#3CC7C0!important; + font-size: 32rpx!important; + } + .van-picker__title{ + font-weight: 600!important; + color: rgba(0,0,0,0.9)!important; + font-size: 32rpx!important; + } + .van-picker__cancel{ + color: rgba(0,0,0,0.6)!important; + font-size: 32rpx!important; + } + .nonedata{ + width:100%; + color:#666; + min-height: 320rpx; + font-size: 28rpx; + display: flex; + justify-content: center; + align-items: center; + } + .ui-navigatorbar { + position: fixed; + z-index:99; + top: 0; + width: 750rpx; + height: 172rpx; + background: #F2F2F2; + backdrop-filter: blur(20px); + } + + .ui-navigatorbar-back { + position: absolute; + padding-left:40rpx; + padding-right:40rpx; + width:30rpx; + height:60rpx; + left: 0rpx; + bottom: 20rpx; + } + + .ui-title { + position: absolute; + width: 350rpx; + height: 88rpx; + line-height: 56rpx; + font-size: 36rpx; + color: #000000; + bottom: 0; + left: 200rpx; + display: flex; + justify-content: center; + align-items: center; + } + .droptitle.active{ + color:#3CC7C0; + } + .slotmsg{ + -webkit-overflow-scrolling: touch; + font-size: 28rpx; + line-height:40rpx; + max-height:60vh; + overflow-y: auto; + padding:48rpx; + text-align: center; + } + .van-dropdown-item__title{ + width:100%!important; + flex:1; + text-align: center; + } + .van-dropdown-item__icon{ + z-index:2; + position: absolute!important; + + right:25rpx; + } + .van-cell__value{ + flex:none!important; + z-index:1; + } + .onlinebox .icon{ + top:60rpx; + left:50%; + position: absolute; + margin-left: -48rpx; + width:96rpx; + height:34rpx; + border-radius: 0; + } +.page{ + overflow: hidden; + display: flex; + flex-direction: column; +} + +.infobox{ + overflow-y: scroll; + flex:1; + -webkit-overflow-scrolling: touch; +} +.sickbox{ + + padding-top: 10rpx; + background-color: #fff; + margin: 196rpx 32rpx 0; + box-shadow: 0rpx 2rpx 16rpx 2rpx rgba(0,0,0,0.02); +border-radius: 12rpx + +} +.info { + + display: flex; + align-items: center; + height: 112rpx; + color: #333333; +} + +.info .name { + white-space: nowrap; + width: 180rpx; + display: flex; + align-items: center; + margin-left:32rpx; + color: #333333; + font-size: 34rpx; +} + +.info text { + margin-top: 20rpx; + color:#E34D59; + + display: flex; + align-items: center; +} +.info .iptbox{ + display: flex; + align-items: center; + margin-left: 15rpx; + margin-right: 32rpx; + flex: 1; + border-bottom: 1rpx solid #E7E7E7; +} +.info input { + height:112rpx; + position: relative; + z-index:1; + display: flex; + align-items: center; + + width:100%; + + +} +.agreecon{ + padding:20rpx 30rpx; + height:600rpx; + overflow: scroll; +} +.info:last-child .iptbox{ + border: none; +} +.input-placeholder { + color: #999999; + font-size: 28rpx; +} +.tips{ + padding:24rpx 20rpx; + margin:0rpx 32rpx 20rpx; + font-size: 24rpx; + color: rgba(0,0,0,0.45); + border-radius: 12rpx; +} +.warntitle{ + color: #E34D59; + font-size: 28rpx; +} +.warn{ + margin-top: 20rpx; + font-size: 24rpx; + line-height: 36rpx; + color: #666666; +} +.righticon { + width: 24rpx; + height: 48rpx; +} +.navigator{ + color: #3CC7C0 ; +} +.bottom{ + position: absolute; + bottom: 0; + width:100%; + height: 186rpx; +background: #FFFFFF; +} +.bottom .pay{ + display: flex; + justify-content: center; + align-items: center; + height: 94rpx; +background: #3CC7C0; +border-radius: 47rpx; +font-size: 36rpx; +font-weight: 400; +color: #FFFFFF; + margin:16rpx 32rpx 0; +} +.sickcon{ + height:100%; + display: flex; + flex-direction: column; +} +.titlebox{ + /* position: absolute; + top:0; */ + display: flex; + font-size: 32rpx; + margin:40rpx 32rpx; + justify-content: space-between; +} +.cancel{ + color: rgba(0,0,0,0.45); +} +.ok{ + color: #3CC7C0; +} +.title{ + font-weight: 500; +color: rgba(0,0,0,0.85); +} +.doctorlist{ + margin-top: 0rpx; + flex:1;overflow-y: scroll; + -webkit-overflow-scrolling: touch; +} +.site{ + margin:0 32rpx; + display: flex; + align-items: center; +} +.namebox{ + margin-left: 20rpx; +} +.rootclass{ + + background: rgba(60,199,192,0.08)!important; +} +.van-cell-text{ +font-size: 30rpx; +font-weight: 400; +font-family: PingFangSC-Regular, PingFang SC; +color: rgba(0,0,0,0.85) +} +.value-class{ + display: flex; + align-items: center; +} +.hospital{ + font-size: 24rpx; +font-weight: 400; +color: rgba(0,0,0,0.65) +} +.siteimg{ + margin-left: 8rpx; + width: 32rpx; + height:32rpx; +} +.celltitle{ + display: flex; + align-items: center; +} +.head{ + width: 80rpx; + height: 80rpx; + border-radius: 50%; +} +.van-hairline, .van-hairline--bottom, .van-hairline--left, .van-hairline--right, .van-hairline--surround, .van-hairline--top, .van-hairline--top-bottom { + position: static!important; +} +#agreeDialog .van-dialog__header { + padding-top:30rpx!important; + padding-bottom: 25rpx; + border-bottom: 1px solid rgba(0,0,0,0.1); +} +#agreeDialog .van-dialog__footer{ + border-top: 1px solid rgba(0,0,0,0.1); + } + #agreeDialog .van-dialog__button:first-child{ + border-right: 1px solid rgba(0,0,0,0.1); + } \ No newline at end of file diff --git a/utils/config.js b/utils/config.js index d2f6cc6..1ca52df 100644 --- a/utils/config.js +++ b/utils/config.js @@ -2,7 +2,7 @@ function hostConfig(){ const Hosts = { host_dev:'https://dev.hospital.applets.igandanyiyuan.com', - img_dev: 'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', //开发环境 + img_dev: 'https://img.applets.igandanyiyuan.com/applet/patient/static', //开发环境 agree_dev:'https://img.applets.igandanyiyuan.com', host_prod:'https://prod.hospital.applets.igandanyiyuan.com', img_prod: 'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static', //线上环境 diff --git a/utils/imLogin.js b/utils/imLogin.js index cc09acc..9b5e9dc 100644 --- a/utils/imLogin.js +++ b/utils/imLogin.js @@ -29,6 +29,13 @@ function imLogin(app){ userSig:data }).then(res=>{ console.log("登录成功"); +// wx.callManager.init({ +// sdkAppID: appglobal.globalData.config.SDKAPPID, // 请填入 sdkAppID +// userID: wx.getStorageSync('USER_ID'), // 请填入 userID +// userSig: data, // 请填入 userSig +// globalCallPagePath: "TUICallKit/pages/globalCall/globalCall", +// tim: wx.$TUIKit +// }); }).catch(function(imError) { console.warn('login error:', imError); // 登录失败的相关信息 });