fcr-ui-scene-mobile 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/lib/assets/ground_glass_bg.png +0 -0
  2. package/lib/base.d.ts +11 -0
  3. package/lib/base.js +39 -0
  4. package/lib/common/device-store.d.ts +86 -0
  5. package/lib/common/device-store.js +642 -0
  6. package/lib/common/device-stream-store.d.ts +26 -0
  7. package/lib/common/device-stream-store.js +298 -0
  8. package/lib/common/event-store.d.ts +124 -0
  9. package/lib/common/event-store.js +249 -0
  10. package/lib/common/global-context.d.ts +11 -0
  11. package/lib/common/global-context.js +9 -0
  12. package/lib/common/member-list-data-source.d.ts +28 -0
  13. package/lib/common/member-list-data-source.js +305 -0
  14. package/lib/common/participant-store.d.ts +195 -0
  15. package/lib/common/participant-store.js +1577 -0
  16. package/lib/common/security-store.d.ts +119 -0
  17. package/lib/common/security-store.js +948 -0
  18. package/lib/common/setting-store.d.ts +181 -0
  19. package/lib/common/setting-store.js +797 -0
  20. package/lib/common/type.d.ts +73 -0
  21. package/lib/common/type.js +22 -0
  22. package/lib/config/default-config.d.ts +32 -0
  23. package/lib/config/default-config.js +39 -0
  24. package/lib/config/setting-config.d.ts +16 -0
  25. package/lib/config/setting-config.js +17 -0
  26. package/lib/creator.d.ts +10 -0
  27. package/lib/creator.js +49 -0
  28. package/lib/global.d.ts +8 -0
  29. package/lib/hooks/meeting-time.d.ts +15 -0
  30. package/lib/hooks/meeting-time.js +92 -0
  31. package/lib/hooks/useIsNodePresent.d.ts +4 -0
  32. package/lib/hooks/useIsNodePresent.js +53 -0
  33. package/lib/hooks/useOnRefMount.d.ts +2 -0
  34. package/lib/hooks/useOnRefMount.js +27 -0
  35. package/lib/index.d.ts +6 -0
  36. package/lib/index.js +50 -0
  37. package/lib/mobile-global.css +28 -0
  38. package/lib/modules/action-bar/bottom-icons.d.ts +17 -0
  39. package/lib/modules/action-bar/bottom-icons.js +160 -0
  40. package/lib/modules/action-bar/context.d.ts +2 -0
  41. package/lib/modules/action-bar/context.js +9 -0
  42. package/lib/modules/action-bar/index.css +33 -0
  43. package/lib/modules/action-bar/index.d.ts +27 -0
  44. package/lib/modules/action-bar/index.js +46 -0
  45. package/lib/modules/action-bar/member-list-popup/attendee/index.css +130 -0
  46. package/lib/modules/action-bar/member-list-popup/attendee/index.d.ts +19 -0
  47. package/lib/modules/action-bar/member-list-popup/attendee/index.js +252 -0
  48. package/lib/modules/action-bar/member-list-popup/attendee/list.d.ts +1 -0
  49. package/lib/modules/action-bar/member-list-popup/attendee/list.js +82 -0
  50. package/lib/modules/action-bar/member-list-popup/index.css +35 -0
  51. package/lib/modules/action-bar/member-list-popup/index.d.ts +7 -0
  52. package/lib/modules/action-bar/member-list-popup/index.js +40 -0
  53. package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.css +0 -0
  54. package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.d.ts +12 -0
  55. package/lib/modules/action-bar/member-list-popup/participant-more-actions/index.js +58 -0
  56. package/lib/modules/action-bar/more-popup/index.css +71 -0
  57. package/lib/modules/action-bar/more-popup/index.d.ts +2 -0
  58. package/lib/modules/action-bar/more-popup/index.js +126 -0
  59. package/lib/modules/action-bar/store.d.ts +196 -0
  60. package/lib/modules/action-bar/store.js +1425 -0
  61. package/lib/modules/action-bar/type.d.ts +6 -0
  62. package/lib/modules/action-bar/type.js +13 -0
  63. package/lib/modules/action-bar/view.d.ts +2 -0
  64. package/lib/modules/action-bar/view.js +75 -0
  65. package/lib/modules/audio-stream/ index.d.ts +19 -0
  66. package/lib/modules/audio-stream/ index.js +109 -0
  67. package/lib/modules/audio-stream/index.d.ts +25 -0
  68. package/lib/modules/audio-stream/index.js +135 -0
  69. package/lib/modules/chat/chat-bar/index.css +97 -0
  70. package/lib/modules/chat/chat-bar/index.d.ts +12 -0
  71. package/lib/modules/chat/chat-bar/index.js +129 -0
  72. package/lib/modules/chat/chat-notification/index.css +71 -0
  73. package/lib/modules/chat/chat-notification/index.d.ts +3 -0
  74. package/lib/modules/chat/chat-notification/index.js +75 -0
  75. package/lib/modules/chat/chat-select/index.css +183 -0
  76. package/lib/modules/chat/chat-select/index.d.ts +12 -0
  77. package/lib/modules/chat/chat-select/index.js +223 -0
  78. package/lib/modules/chat/contex.d.ts +2 -0
  79. package/lib/modules/chat/contex.js +9 -0
  80. package/lib/modules/chat/demo-wrapper.d.ts +1 -0
  81. package/lib/modules/chat/demo-wrapper.js +42 -0
  82. package/lib/modules/chat/index.css +108 -0
  83. package/lib/modules/chat/index.d.ts +28 -0
  84. package/lib/modules/chat/index.dev.d.ts +1 -0
  85. package/lib/modules/chat/index.dev.js +58 -0
  86. package/lib/modules/chat/index.js +208 -0
  87. package/lib/modules/chat/message-list.d.ts +22 -0
  88. package/lib/modules/chat/message-list.js +617 -0
  89. package/lib/modules/chat/mock.d.ts +2 -0
  90. package/lib/modules/chat/mock.js +283 -0
  91. package/lib/modules/chat/store.d.ts +183 -0
  92. package/lib/modules/chat/store.js +1101 -0
  93. package/lib/modules/chat/util.d.ts +6 -0
  94. package/lib/modules/chat/util.js +69 -0
  95. package/lib/modules/chat/view.d.ts +11 -0
  96. package/lib/modules/chat/view.js +414 -0
  97. package/lib/modules/layout/bottom-drawer/index.css +34 -0
  98. package/lib/modules/layout/bottom-drawer/index.d.ts +3 -0
  99. package/lib/modules/layout/bottom-drawer/index.js +129 -0
  100. package/lib/modules/layout/components/Layout.d.ts +1 -0
  101. package/lib/modules/layout/components/Layout.js +98 -0
  102. package/lib/modules/layout/components/equip-request-popup/index.css +30 -0
  103. package/lib/modules/layout/components/equip-request-popup/index.d.ts +3 -0
  104. package/lib/modules/layout/components/equip-request-popup/index.js +78 -0
  105. package/lib/modules/layout/components/index.css +78 -0
  106. package/lib/modules/layout/components/index.d.ts +2 -0
  107. package/lib/modules/layout/components/index.js +25 -0
  108. package/lib/modules/layout/context.d.ts +2 -0
  109. package/lib/modules/layout/context.js +9 -0
  110. package/lib/modules/layout/drawer-header/index.css +27 -0
  111. package/lib/modules/layout/drawer-header/index.d.ts +10 -0
  112. package/lib/modules/layout/drawer-header/index.js +54 -0
  113. package/lib/modules/layout/index.css +22 -0
  114. package/lib/modules/layout/index.d.ts +8 -0
  115. package/lib/modules/layout/index.js +47 -0
  116. package/lib/modules/layout/store.d.ts +59 -0
  117. package/lib/modules/layout/store.js +379 -0
  118. package/lib/modules/layout/type.d.ts +65 -0
  119. package/lib/modules/layout/type.js +52 -0
  120. package/lib/modules/layout/view.d.ts +2 -0
  121. package/lib/modules/layout/view.js +10 -0
  122. package/lib/modules/member-layout/context.d.ts +2 -0
  123. package/lib/modules/member-layout/context.js +9 -0
  124. package/lib/modules/member-layout/data.d.ts +2 -0
  125. package/lib/modules/member-layout/data.js +304 -0
  126. package/lib/modules/member-layout/grid/index.css +98 -0
  127. package/lib/modules/member-layout/grid/index.d.ts +21 -0
  128. package/lib/modules/member-layout/grid/index.js +316 -0
  129. package/lib/modules/member-layout/index.css +88 -0
  130. package/lib/modules/member-layout/index.d.ts +8 -0
  131. package/lib/modules/member-layout/index.js +45 -0
  132. package/lib/modules/member-layout/share-toast/index.css +30 -0
  133. package/lib/modules/member-layout/share-toast/index.d.ts +5 -0
  134. package/lib/modules/member-layout/share-toast/index.js +43 -0
  135. package/lib/modules/member-layout/speaker/index.css +30 -0
  136. package/lib/modules/member-layout/speaker/index.d.ts +9 -0
  137. package/lib/modules/member-layout/speaker/index.js +28 -0
  138. package/lib/modules/member-layout/store.d.ts +70 -0
  139. package/lib/modules/member-layout/store.js +479 -0
  140. package/lib/modules/member-layout/user/index.css +121 -0
  141. package/lib/modules/member-layout/user/index.d.ts +34 -0
  142. package/lib/modules/member-layout/user/index.js +355 -0
  143. package/lib/modules/member-layout/user/types.d.ts +16 -0
  144. package/lib/modules/member-layout/user/types.js +6 -0
  145. package/lib/modules/member-layout/view.d.ts +2 -0
  146. package/lib/modules/member-layout/view.js +225 -0
  147. package/lib/modules/state-bar/context.d.ts +2 -0
  148. package/lib/modules/state-bar/context.js +9 -0
  149. package/lib/modules/state-bar/index.css +79 -0
  150. package/lib/modules/state-bar/index.d.ts +17 -0
  151. package/lib/modules/state-bar/index.js +55 -0
  152. package/lib/modules/state-bar/leaving-room/index.css +14 -0
  153. package/lib/modules/state-bar/leaving-room/index.d.ts +7 -0
  154. package/lib/modules/state-bar/leaving-room/index.js +38 -0
  155. package/lib/modules/state-bar/meeting-detail/index.css +72 -0
  156. package/lib/modules/state-bar/meeting-detail/index.d.ts +2 -0
  157. package/lib/modules/state-bar/meeting-detail/index.js +59 -0
  158. package/lib/modules/state-bar/meeting-detail/meeting-info/copy.d.ts +4 -0
  159. package/lib/modules/state-bar/meeting-detail/meeting-info/copy.js +81 -0
  160. package/lib/modules/state-bar/meeting-detail/meeting-info/index.css +92 -0
  161. package/lib/modules/state-bar/meeting-detail/meeting-info/index.d.ts +2 -0
  162. package/lib/modules/state-bar/meeting-detail/meeting-info/index.js +188 -0
  163. package/lib/modules/state-bar/meeting-detail/net-quality/index.css +27 -0
  164. package/lib/modules/state-bar/meeting-detail/net-quality/index.d.ts +2 -0
  165. package/lib/modules/state-bar/meeting-detail/net-quality/index.js +87 -0
  166. package/lib/modules/state-bar/store.d.ts +76 -0
  167. package/lib/modules/state-bar/store.js +561 -0
  168. package/lib/modules/state-bar/view.d.ts +7 -0
  169. package/lib/modules/state-bar/view.js +215 -0
  170. package/lib/modules/whiteboard/app.d.ts +2 -0
  171. package/lib/modules/whiteboard/app.js +41 -0
  172. package/lib/modules/whiteboard/components/control-bar/index.css +53 -0
  173. package/lib/modules/whiteboard/components/control-bar/index.d.ts +2 -0
  174. package/lib/modules/whiteboard/components/control-bar/index.js +156 -0
  175. package/lib/modules/whiteboard/components/control-bar/store.d.ts +35 -0
  176. package/lib/modules/whiteboard/components/control-bar/store.js +288 -0
  177. package/lib/modules/whiteboard/components/loading/index.css +76 -0
  178. package/lib/modules/whiteboard/components/loading/index.d.ts +2 -0
  179. package/lib/modules/whiteboard/components/loading/index.js +68 -0
  180. package/lib/modules/whiteboard/components/loading/loading.png +0 -0
  181. package/lib/modules/whiteboard/components/multi-window/index.css +65 -0
  182. package/lib/modules/whiteboard/components/multi-window/index.d.ts +5 -0
  183. package/lib/modules/whiteboard/components/multi-window/index.js +39 -0
  184. package/lib/modules/whiteboard/components/pagination/index.css +228 -0
  185. package/lib/modules/whiteboard/components/pagination/index.d.ts +15 -0
  186. package/lib/modules/whiteboard/components/pagination/index.js +163 -0
  187. package/lib/modules/whiteboard/components/pagination/store.d.ts +18 -0
  188. package/lib/modules/whiteboard/components/pagination/store.js +17 -0
  189. package/lib/modules/whiteboard/components/progress/index.d.ts +5 -0
  190. package/lib/modules/whiteboard/components/progress/index.js +43 -0
  191. package/lib/modules/whiteboard/components/progress/style.css +52 -0
  192. package/lib/modules/whiteboard/components/scene-pagination.d.ts +1 -0
  193. package/lib/modules/whiteboard/components/scene-pagination.js +30 -0
  194. package/lib/modules/whiteboard/components/switch-theme/index.css +98 -0
  195. package/lib/modules/whiteboard/components/switch-theme/index.d.ts +3 -0
  196. package/lib/modules/whiteboard/components/switch-theme/index.js +89 -0
  197. package/lib/modules/whiteboard/components/switch-theme/item.d.ts +9 -0
  198. package/lib/modules/whiteboard/components/switch-theme/item.js +53 -0
  199. package/lib/modules/whiteboard/components/switch-theme/libs.d.ts +4 -0
  200. package/lib/modules/whiteboard/components/switch-theme/libs.js +29 -0
  201. package/lib/modules/whiteboard/components/toolbar/ style.css +588 -0
  202. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.d.ts +5 -0
  203. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/color.js +38 -0
  204. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.d.ts +1 -0
  205. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/panel.js +107 -0
  206. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.d.ts +1 -0
  207. package/lib/modules/whiteboard/components/toolbar/components/color-picker/components/picker.js +59 -0
  208. package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.d.ts +2 -0
  209. package/lib/modules/whiteboard/components/toolbar/components/color-picker/index.js +44 -0
  210. package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.d.ts +4 -0
  211. package/lib/modules/whiteboard/components/toolbar/components/eraser-picker.js +89 -0
  212. package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.d.ts +1 -0
  213. package/lib/modules/whiteboard/components/toolbar/components/extra-tool-picker.js +63 -0
  214. package/lib/modules/whiteboard/components/toolbar/components/history.d.ts +2 -0
  215. package/lib/modules/whiteboard/components/toolbar/components/history.js +46 -0
  216. package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.d.ts +2 -0
  217. package/lib/modules/whiteboard/components/toolbar/components/icons/fold-icon.js +39 -0
  218. package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.d.ts +1 -0
  219. package/lib/modules/whiteboard/components/toolbar/components/icons/move-icon.js +66 -0
  220. package/lib/modules/whiteboard/components/toolbar/components/move-handle.d.ts +5 -0
  221. package/lib/modules/whiteboard/components/toolbar/components/move-handle.js +134 -0
  222. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.d.ts +4 -0
  223. package/lib/modules/whiteboard/components/toolbar/components/pen-picker.js +106 -0
  224. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.d.ts +4 -0
  225. package/lib/modules/whiteboard/components/toolbar/components/shape-picker.js +168 -0
  226. package/lib/modules/whiteboard/components/toolbar/hooks/index.d.ts +14 -0
  227. package/lib/modules/whiteboard/components/toolbar/hooks/index.js +211 -0
  228. package/lib/modules/whiteboard/components/toolbar/index.d.ts +2 -0
  229. package/lib/modules/whiteboard/components/toolbar/index.js +183 -0
  230. package/lib/modules/whiteboard/components/toolbar/store.d.ts +51 -0
  231. package/lib/modules/whiteboard/components/toolbar/store.js +248 -0
  232. package/lib/modules/whiteboard/context.d.ts +69 -0
  233. package/lib/modules/whiteboard/context.js +36 -0
  234. package/lib/modules/whiteboard/index.d.ts +119 -0
  235. package/lib/modules/whiteboard/index.js +1134 -0
  236. package/lib/modules/whiteboard/style.css +143 -0
  237. package/lib/modules/whiteboard/type.d.ts +94 -0
  238. package/lib/modules/whiteboard/type.js +89 -0
  239. package/lib/modules/whiteboard/utils.d.ts +12 -0
  240. package/lib/modules/whiteboard/utils.js +36 -0
  241. package/lib/plugins/css-preset-plugin.d.ts +1 -0
  242. package/lib/plugins/css-preset-plugin.js +29 -0
  243. package/lib/plugins/module-dev-plugin.d.ts +12 -0
  244. package/lib/plugins/module-dev-plugin.js +183 -0
  245. package/lib/plugins/multi-lang-plugin.d.ts +1 -0
  246. package/lib/plugins/multi-lang-plugin.js +19 -0
  247. package/lib/plugins/rtm-plugin.d.ts +1 -0
  248. package/lib/plugins/rtm-plugin.js +5 -0
  249. package/lib/plugins/web-rtc-plugin.d.ts +1 -0
  250. package/lib/plugins/web-rtc-plugin.js +5 -0
  251. package/lib/translations/enUS.d.ts +1855 -0
  252. package/lib/translations/enUS.js +1895 -0
  253. package/lib/translations/zhCN.d.ts +1852 -0
  254. package/lib/translations/zhCN.js +1892 -0
  255. package/lib/type.d.ts +121 -0
  256. package/lib/type.js +46 -0
  257. package/lib/ui-manager.d.ts +32 -0
  258. package/lib/ui-manager.js +426 -0
  259. package/lib/ui-scene.d.ts +14 -0
  260. package/lib/ui-scene.js +141 -0
  261. package/lib/utilities/board-context.d.ts +4 -0
  262. package/lib/utilities/board-context.js +12 -0
  263. package/lib/utilities/constant.d.ts +286 -0
  264. package/lib/utilities/constant.js +271 -0
  265. package/lib/utilities/copyText.d.ts +2 -0
  266. package/lib/utilities/copyText.js +43 -0
  267. package/lib/utilities/extract.d.ts +5 -0
  268. package/lib/utilities/extract.js +117 -0
  269. package/lib/utilities/hooks.d.ts +14 -0
  270. package/lib/utilities/hooks.js +101 -0
  271. package/lib/utilities/mute-action.d.ts +4 -0
  272. package/lib/utilities/mute-action.js +48 -0
  273. package/lib/utilities/parameters.d.ts +7 -0
  274. package/lib/utilities/parameters.js +20 -0
  275. package/lib/utilities/regex.d.ts +1 -0
  276. package/lib/utilities/regex.js +14 -0
  277. package/lib/utilities/tools.d.ts +27 -0
  278. package/lib/utilities/tools.js +169 -0
  279. package/lib/utilities/useNamespace.d.ts +15 -0
  280. package/lib/utilities/useNamespace.js +66 -0
  281. package/package.json +63 -0
@@ -0,0 +1,948 @@
1
+ "use strict";
2
+
3
+ require("core-js/modules/es.symbol.js");
4
+ require("core-js/modules/es.symbol.description.js");
5
+ require("core-js/modules/es.symbol.to-primitive.js");
6
+ require("core-js/modules/es.error.cause.js");
7
+ require("core-js/modules/es.error.to-string.js");
8
+ require("core-js/modules/es.array.every.js");
9
+ require("core-js/modules/es.array.is-array.js");
10
+ require("core-js/modules/es.date.to-primitive.js");
11
+ require("core-js/modules/es.function.name.js");
12
+ require("core-js/modules/es.map.js");
13
+ require("core-js/modules/es.number.constructor.js");
14
+ require("core-js/modules/es.object.create.js");
15
+ require("core-js/modules/es.object.define-property.js");
16
+ require("core-js/modules/es.object.get-own-property-descriptor.js");
17
+ require("core-js/modules/esnext.async-iterator.every.js");
18
+ require("core-js/modules/esnext.function.metadata.js");
19
+ require("core-js/modules/esnext.iterator.every.js");
20
+ require("core-js/modules/esnext.map.delete-all.js");
21
+ require("core-js/modules/esnext.map.emplace.js");
22
+ require("core-js/modules/esnext.map.every.js");
23
+ require("core-js/modules/esnext.map.filter.js");
24
+ require("core-js/modules/esnext.map.find.js");
25
+ require("core-js/modules/esnext.map.find-key.js");
26
+ require("core-js/modules/esnext.map.includes.js");
27
+ require("core-js/modules/esnext.map.key-of.js");
28
+ require("core-js/modules/esnext.map.map-keys.js");
29
+ require("core-js/modules/esnext.map.map-values.js");
30
+ require("core-js/modules/esnext.map.merge.js");
31
+ require("core-js/modules/esnext.map.reduce.js");
32
+ require("core-js/modules/esnext.map.some.js");
33
+ require("core-js/modules/esnext.map.update.js");
34
+ require("core-js/modules/esnext.symbol.metadata.js");
35
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
36
+ var _typeof = require("@babel/runtime/helpers/typeof");
37
+ Object.defineProperty(exports, "__esModule", {
38
+ value: true
39
+ });
40
+ exports.FcrSecurityStore = void 0;
41
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
42
+ require("core-js/modules/es.array.concat.js");
43
+ require("core-js/modules/es.array.find.js");
44
+ require("core-js/modules/es.array.for-each.js");
45
+ require("core-js/modules/es.array.includes.js");
46
+ require("core-js/modules/es.array.iterator.js");
47
+ require("core-js/modules/es.array.push.js");
48
+ require("core-js/modules/es.array.some.js");
49
+ require("core-js/modules/es.function.bind.js");
50
+ require("core-js/modules/es.object.keys.js");
51
+ require("core-js/modules/es.object.to-string.js");
52
+ require("core-js/modules/es.string.includes.js");
53
+ require("core-js/modules/es.string.iterator.js");
54
+ require("core-js/modules/es.weak-map.js");
55
+ require("core-js/modules/esnext.async-iterator.find.js");
56
+ require("core-js/modules/esnext.async-iterator.for-each.js");
57
+ require("core-js/modules/esnext.async-iterator.some.js");
58
+ require("core-js/modules/esnext.iterator.constructor.js");
59
+ require("core-js/modules/esnext.iterator.find.js");
60
+ require("core-js/modules/esnext.iterator.for-each.js");
61
+ require("core-js/modules/esnext.iterator.some.js");
62
+ require("core-js/modules/esnext.weak-map.delete-all.js");
63
+ require("core-js/modules/esnext.weak-map.emplace.js");
64
+ require("core-js/modules/web.dom-collections.for-each.js");
65
+ require("core-js/modules/web.dom-collections.iterator.js");
66
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
67
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
68
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
69
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
70
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
71
+ var _fcrCore = require("fcr-core");
72
+ var _type = require("fcr-core/lib/type");
73
+ var _decorator = require("agora-foundation/lib/decorator");
74
+ var _mobx = require("mobx");
75
+ var _mobxUtils = require("mobx-utils");
76
+ var _constant = require("../utilities/constant");
77
+ var _lodash = require("lodash");
78
+ var _user = require("fcr-core/lib/utilities/user");
79
+ var _toast = require("agora-ui-foundation/lib/components/toast");
80
+ var _enums = require("fcr-core/lib/room-control/whiteboard-control/enums");
81
+ var _logger = require("agora-foundation/lib/logger");
82
+ var _type2 = require("agora-ui-foundation/lib/components/icon/type");
83
+ var _i18n = require("agora-ui-foundation/lib/i18n");
84
+ var _type3 = require("fcr-core/lib/room-control/privilege-control/type");
85
+ var _FcrSecurityStore;
86
+ var _initProto, _init_securityInfos, _init_permissionInfos, _init_privilegeOperator, _init_boardOwnerUser, _setSecurityInfoDecs, _setPermissionInfosDecs, _handlePermissionUpdatedDecs, _handleSecurityUpdatedDecs, _ref;
87
+ function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
88
+ function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
89
+ function _classPrivateFieldSet(s, a, r) { return s.set(_assertClassBrand(s, a), r), r; }
90
+ function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
91
+ function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
92
+ function _applyDecs(e, t, r, n, o, a) { function i(e, t, r) { return function (n, o) { return r && r(n), e[t].call(n, o); }; } function c(e, t) { for (var r = 0; r < e.length; r++) e[r].call(t); return t; } function s(e, t, r, n) { if ("function" != typeof e && (n || void 0 !== e)) throw new TypeError(t + " must " + (r || "be") + " a function" + (n ? "" : " or undefined")); return e; } function applyDec(e, t, r, n, o, a, c, u, l, f, p, d, h) { function m(e) { if (!h(e)) throw new TypeError("Attempted to access private element on non-instance"); } var y, v = t[0], g = t[3], b = !u; if (!b) { r || Array.isArray(v) || (v = [v]); var w = {}, S = [], A = 3 === o ? "get" : 4 === o || d ? "set" : "value"; f ? (p || d ? w = { get: _setFunctionName(function () { return g(this); }, n, "get"), set: function set(e) { t[4](this, e); } } : w[A] = g, p || _setFunctionName(w[A], n, 2 === o ? "" : A)) : p || (w = Object.getOwnPropertyDescriptor(e, n)); } for (var P = e, j = v.length - 1; j >= 0; j -= r ? 2 : 1) { var D = v[j], E = r ? v[j - 1] : void 0, I = {}, O = { kind: ["field", "accessor", "method", "getter", "setter", "class"][o], name: n, metadata: a, addInitializer: function (e, t) { if (e.v) throw Error("attempted to call addInitializer after decoration was finished"); s(t, "An initializer", "be", !0), c.push(t); }.bind(null, I) }; try { if (b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y);else { var k, F; O["static"] = l, O["private"] = f, f ? 2 === o ? k = function k(e) { return m(e), w.value; } : (o < 4 && (k = i(w, "get", m)), 3 !== o && (F = i(w, "set", m))) : (k = function k(e) { return e[n]; }, (o < 2 || 4 === o) && (F = function F(e, t) { e[n] = t; })); var N = O.access = { has: f ? h.bind() : function (e) { return n in e; } }; if (k && (N.get = k), F && (N.set = F), P = D.call(E, d ? { get: w.get, set: w.set } : w[A], O), d) { if ("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y), (y = s(P.set, "accessor.set")) && (w.set = y), (y = s(P.init, "accessor.init")) && S.push(y);else if (void 0 !== P) throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0"); } else s(P, (p ? "field" : "method") + " decorators", "return") && (p ? S.push(P) : w[A] = P); } } finally { I.v = !0; } } return (p || d) && u.push(function (e, t) { for (var r = S.length - 1; r >= 0; r--) t = S[r].call(e, t); return t; }), p || b || (f ? d ? u.push(i(w, "get"), i(w, "set")) : u.push(2 === o ? w[A] : i.call.bind(w[A])) : Object.defineProperty(e, n, w)), P; } function u(e, t) { return Object.defineProperty(e, Symbol.metadata || Symbol["for"]("Symbol.metadata"), { configurable: !0, enumerable: !0, value: t }); } if (arguments.length >= 6) var l = a[Symbol.metadata || Symbol["for"]("Symbol.metadata")]; var f = Object.create(null == l ? null : l), p = function (e, t, r, n) { var o, a, i = [], s = function s(t) { return _checkInRHS(t) === e; }, u = new Map(); function l(e) { e && i.push(c.bind(null, e)); } for (var f = 0; f < t.length; f++) { var p = t[f]; if (Array.isArray(p)) { var d = p[1], h = p[2], m = p.length > 3, y = 16 & d, v = !!(8 & d), g = 0 == (d &= 7), b = h + "/" + v; if (!g && !m) { var w = u.get(b); if (!0 === w || 3 === w && 4 !== d || 4 === w && 3 !== d) throw Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + h); u.set(b, !(d > 2) || d); } applyDec(v ? e : e.prototype, p, y, m ? "#" + h : _toPropertyKey(h), d, n, v ? a = a || [] : o = o || [], i, v, m, g, 1 === d, v && m ? s : r); } } return l(o), l(a), i; }(e, t, o, f); return r.length || u(e, f), { e: p, get c() { var t = []; return r.length && [u(applyDec(e, [r], n, e.name, 5, f, t), f), c.bind(null, t, e)]; } }; }
93
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
94
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
95
+ function _setFunctionName(e, t, n) { "symbol" == _typeof(t) && (t = (t = t.description) ? "[" + t + "]" : ""); try { Object.defineProperty(e, "name", { configurable: !0, value: n ? n + " " + t : t }); } catch (e) {} return e; }
96
+ function _checkInRHS(e) { if (Object(e) !== e) throw TypeError("right-hand side of 'in' should be an object, got " + (null !== e ? _typeof(e) : "null")); return e; }
97
+ var _A = /*#__PURE__*/new WeakMap();
98
+ var _B = /*#__PURE__*/new WeakMap();
99
+ var _C = /*#__PURE__*/new WeakMap();
100
+ var _D = /*#__PURE__*/new WeakMap();
101
+ _ref = (_setSecurityInfoDecs = [_mobx.action, _mobx.action.bound], _setPermissionInfosDecs = [_mobx.action, _mobx.action.bound], _handlePermissionUpdatedDecs = [_mobx.action, _mobx.action.bound], _handleSecurityUpdatedDecs = [_mobx.action, _mobx.action.bound], "logger");
102
+ var FcrSecurityStore = exports.FcrSecurityStore = /*#__PURE__*/function () {
103
+ function FcrSecurityStore(_privilegeControl, _userControl, _streamControl, _uiEventStore) {
104
+ var _this = this;
105
+ (0, _classCallCheck2["default"])(this, FcrSecurityStore);
106
+ (0, _defineProperty2["default"])(this, _ref, (_initProto(this), (0, _logger.getLogger)()));
107
+ (0, _defineProperty2["default"])(this, "_disposers", []);
108
+ _classPrivateFieldInitSpec(this, _A, _init_securityInfos(this, []));
109
+ _classPrivateFieldInitSpec(this, _B, _init_permissionInfos(this));
110
+ _classPrivateFieldInitSpec(this, _C, _init_privilegeOperator(this));
111
+ _classPrivateFieldInitSpec(this, _D, _init_boardOwnerUser(this));
112
+ (0, _defineProperty2["default"])(this, "allowChangeSelfName", (0, _mobxUtils.computedFn)(function () {
113
+ var info = _this.securityInfos.find(function (_ref2) {
114
+ var info = _ref2.info;
115
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.ChangeName;
116
+ });
117
+ return !!(info !== null && info !== void 0 && info.enable);
118
+ }));
119
+ (0, _defineProperty2["default"])(this, "allowChat", (0, _mobxUtils.computedFn)(function () {
120
+ var info = _this.securityInfos.find(function (_ref3) {
121
+ var info = _ref3.info;
122
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.SendChat;
123
+ });
124
+ return !!(info !== null && info !== void 0 && info.enable);
125
+ }));
126
+ (0, _defineProperty2["default"])(this, "getWaterMarkContent", function () {
127
+ return _this._userControl.getWaterMarkContent() || 'Watermark';
128
+ });
129
+ (0, _defineProperty2["default"])(this, "convertSendChatPayload", function (payload) {
130
+ return {
131
+ "public": !!payload["public"],
132
+ "private": {
133
+ host: !!payload["private"].host,
134
+ cohost: !!payload["private"].cohost,
135
+ participant: !!payload["private"].participant
136
+ }
137
+ };
138
+ });
139
+ // 允许发送公聊和私聊
140
+ (0, _defineProperty2["default"])(this, "allowedAllChat", (0, _mobxUtils.computedFn)(function () {
141
+ var info = _this.securityInfos.find(function (_ref4) {
142
+ var info = _ref4.info;
143
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.SendChat;
144
+ });
145
+ var payload = info && info.info && _this.convertSendChatPayload(info.info.payload);
146
+ return !!(info !== null && info !== void 0 && info.enable) && payload && payload["public"] && payload["private"].host && payload["private"].cohost && payload["private"].participant;
147
+ }));
148
+ // 允许发送公聊,禁止发送私聊
149
+ (0, _defineProperty2["default"])(this, "allowedPublicChatAndDisallowedPrivateChat", (0, _mobxUtils.computedFn)(function () {
150
+ var info = _this.securityInfos.find(function (_ref5) {
151
+ var info = _ref5.info;
152
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.SendChat;
153
+ });
154
+ var payload = info && info.info && _this.convertSendChatPayload(info.info.payload);
155
+ return !!(info !== null && info !== void 0 && info.enable) && payload && payload["public"] && payload["private"].host && !payload["private"].cohost && !payload["private"].participant;
156
+ }));
157
+ // 禁止发送公聊,只能私聊给主持人和联席主持人
158
+ (0, _defineProperty2["default"])(this, "disallowedPublicChatAndDisallowedPrivateChatToParticipant", (0, _mobxUtils.computedFn)(function () {
159
+ var info = _this.securityInfos.find(function (_ref6) {
160
+ var info = _ref6.info;
161
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.SendChat;
162
+ });
163
+ var payload = info && info.info && _this.convertSendChatPayload(info.info.payload);
164
+ return !!(info !== null && info !== void 0 && info.enable) && payload && !payload["public"] && payload["private"].host && payload["private"].cohost && !payload["private"].participant;
165
+ }));
166
+ // 禁止发送所有聊天
167
+ (0, _defineProperty2["default"])(this, "disallowedAllChat", (0, _mobxUtils.computedFn)(function () {
168
+ var info = _this.securityInfos.find(function (_ref7) {
169
+ var info = _ref7.info;
170
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.SendChat;
171
+ });
172
+ var payload = info && info.info && _this.convertSendChatPayload(info.info.payload);
173
+ return !(info !== null && info !== void 0 && info.enable) || payload && !payload["public"] && !payload["private"].host && !payload["private"].cohost && !payload["private"].participant;
174
+ }));
175
+ (0, _defineProperty2["default"])(this, "allowJoinWithMuteAudio", (0, _mobxUtils.computedFn)(function () {
176
+ var info = _this.securityInfos.find(function (_ref8) {
177
+ var info = _ref8.info;
178
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.JoinWithMuteAudio;
179
+ });
180
+ return !!(info !== null && info !== void 0 && info.enable);
181
+ }));
182
+ (0, _defineProperty2["default"])(this, "allowShareScreen", (0, _mobxUtils.computedFn)(function () {
183
+ var info = _this.securityInfos.find(function (_ref9) {
184
+ var info = _ref9.info;
185
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.ShareScreen;
186
+ });
187
+ return !!(info !== null && info !== void 0 && info.enable);
188
+ }));
189
+ (0, _defineProperty2["default"])(this, "allowScreenShareAndBoard", (0, _mobxUtils.computedFn)(function () {
190
+ var _info$info;
191
+ var info = _this.securityInfos.find(function (_ref10) {
192
+ var info = _ref10.info;
193
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.Sharing;
194
+ });
195
+ var shareState = info === null || info === void 0 || (_info$info = info.info) === null || _info$info === void 0 ? void 0 : _info$info.payload;
196
+ var screenShareState = shareState.screen === _enums.FcrSharePermissionState.ON;
197
+ return screenShareState;
198
+ }));
199
+ (0, _defineProperty2["default"])(this, "allowBoardWrite", (0, _mobxUtils.computedFn)(function () {
200
+ var _info$info2, _shareState$board;
201
+ var info = _this.securityInfos.find(function (_ref11) {
202
+ var info = _ref11.info;
203
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.Sharing;
204
+ });
205
+ var shareState = info === null || info === void 0 || (_info$info2 = info.info) === null || _info$info2 === void 0 ? void 0 : _info$info2.payload;
206
+ var boardWriteState = ((_shareState$board = shareState.board) === null || _shareState$board === void 0 ? void 0 : _shareState$board.write) === _enums.FcrSharePermissionState.ON;
207
+ return boardWriteState;
208
+ }));
209
+ (0, _defineProperty2["default"])(this, "allowUnmuteSelfVideo", (0, _mobxUtils.computedFn)(function () {
210
+ var info = _this.securityInfos.find(function (_ref12) {
211
+ var info = _ref12.info;
212
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.StartVideo;
213
+ });
214
+ return !!(info !== null && info !== void 0 && info.enable);
215
+ }));
216
+ (0, _defineProperty2["default"])(this, "allowUnmuteSelfAudio", (0, _mobxUtils.computedFn)(function () {
217
+ var info = _this.securityInfos.find(function (_ref13) {
218
+ var info = _ref13.info;
219
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.StartAudio;
220
+ });
221
+ return !!(info !== null && info !== void 0 && info.enable);
222
+ }));
223
+ (0, _defineProperty2["default"])(this, "isLockRoomEnabled", (0, _mobxUtils.computedFn)(function () {
224
+ var info = _this.securityInfos.find(function (_ref14) {
225
+ var info = _ref14.info;
226
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.LockedRoom;
227
+ });
228
+ return !!(info !== null && info !== void 0 && info.enable);
229
+ }));
230
+ (0, _defineProperty2["default"])(this, "isWaitingRoomEnabled", (0, _mobxUtils.computedFn)(function () {
231
+ var info = _this.securityInfos.find(function (_ref15) {
232
+ var info = _ref15.info;
233
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.WaitingRoom;
234
+ });
235
+ return !!(info !== null && info !== void 0 && info.enable);
236
+ }));
237
+ (0, _defineProperty2["default"])(this, "isWaterMarkEnabled", (0, _mobxUtils.computedFn)(function () {
238
+ var info = _this.securityInfos.find(function (_ref16) {
239
+ var info = _ref16.info;
240
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.WaterMark;
241
+ });
242
+ return !!(info !== null && info !== void 0 && info.enable);
243
+ }));
244
+ (0, _defineProperty2["default"])(this, "hasWaitingRoomPermission", function () {
245
+ var role = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _type3.FcrPrivilegeUserRole.PARTICIPANT;
246
+ return _this._hasPermission(_type3.FcrPermissionAction.WaitingRoomOpen, role);
247
+ });
248
+ (0, _defineProperty2["default"])(this, "hasMutePermission", function (targetRole) {
249
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamMuteAudio, targetRole);
250
+ });
251
+ (0, _defineProperty2["default"])(this, "hasUnmutePermission", function (targetRole) {
252
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamStartAudio, targetRole);
253
+ });
254
+ (0, _defineProperty2["default"])(this, "hasRequestStartAudioPermission", function (targetRole) {
255
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamRequestStartAudio, targetRole);
256
+ });
257
+ (0, _defineProperty2["default"])(this, "hasRequestStartVideoPermission", function (targetRole) {
258
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamRequestStartVideo, targetRole);
259
+ });
260
+ (0, _defineProperty2["default"])(this, "hasStartVideoPermission", function (targetRole) {
261
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamStartVideo, targetRole);
262
+ });
263
+ (0, _defineProperty2["default"])(this, "hasStopVideoPermission", function (targetRole) {
264
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamStopVideo, targetRole);
265
+ });
266
+ (0, _defineProperty2["default"])(this, "hasSelfMutePermission", function () {
267
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamMuteAudio, _type3.FcrPrivilegeUserRole.SELF);
268
+ });
269
+ (0, _defineProperty2["default"])(this, "hasAllMutePermission", function () {
270
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamMuteAudio, _type3.FcrPrivilegeUserRole.PARTICIPANT);
271
+ });
272
+ (0, _defineProperty2["default"])(this, "hasSelfUnmutePermission", function () {
273
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamStartAudio, _type3.FcrPrivilegeUserRole.SELF);
274
+ });
275
+ (0, _defineProperty2["default"])(this, "hasAllUnmutePermission", function () {
276
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamStartAudio, _type3.FcrPrivilegeUserRole.PARTICIPANT);
277
+ });
278
+ (0, _defineProperty2["default"])(this, "hasRevokeHostPermission", function () {
279
+ return _this._hasPermission(_type3.FcrPermissionAction.UserRevokeRole, _type3.FcrPrivilegeUserRole.HOST);
280
+ });
281
+ (0, _defineProperty2["default"])(this, "hasKickOutPermission", function (targetRole) {
282
+ return _this._hasPermission(_type3.FcrPermissionAction.UserKickOut, targetRole);
283
+ });
284
+ (0, _defineProperty2["default"])(this, "hasStartScreenSharePermission", function () {
285
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamStartScreenShare, _type3.FcrPrivilegeUserRole.SELF);
286
+ });
287
+ (0, _defineProperty2["default"])(this, "hasChatSendPublicPermission", function () {
288
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatSendPublic, _type3.FcrPrivilegeUserRole.SELF);
289
+ });
290
+ (0, _defineProperty2["default"])(this, "hasChatSendPublicPermissionByTargetRole", function (targetRole) {
291
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatSendPublic, targetRole);
292
+ });
293
+ // 是否有权限发送私信息
294
+ (0, _defineProperty2["default"])(this, "hasPermissionToSendPrivateMessage", function (targetRole) {
295
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatSendPrivate, targetRole);
296
+ });
297
+ // 是否有“控制发送所有人消息”的权限
298
+ (0, _defineProperty2["default"])(this, "hasPermissionToControlAllowSendAll", function () {
299
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatAllowSendPublic, _type3.FcrPrivilegeUserRole.PARTICIPANT);
300
+ });
301
+ // 是否有“控制禁止发送所有人消息”的权限
302
+ (0, _defineProperty2["default"])(this, "hasPermissionToControlDisallowSendAll", function () {
303
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatDisallowSendPublic, _type3.FcrPrivilegeUserRole.SELF);
304
+ });
305
+ // 是否有“控制发送私信”的权限
306
+ (0, _defineProperty2["default"])(this, "hasPermissionToControlAllowSendPrivate", function () {
307
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatAllowSendPrivate, _type3.FcrPrivilegeUserRole.SELF);
308
+ });
309
+ // 是否有“控制禁止发送私信”的权限
310
+ (0, _defineProperty2["default"])(this, "hasPermissionToControlDisallowSendPrivate", function () {
311
+ return _this._hasPermission(_type3.FcrPermissionAction.ChatDisallowSendPrivate, _type3.FcrPrivilegeUserRole.SELF);
312
+ });
313
+ (0, _defineProperty2["default"])(this, "hasStartCloudRecordingPermission", function () {
314
+ return _this._hasPermission(_type3.FcrPermissionAction.RecordStartCloudRecording, _type3.FcrPrivilegeUserRole.SELF);
315
+ });
316
+ (0, _defineProperty2["default"])(this, "hasStartLiveStreamingPermission", function () {
317
+ return _this._hasPermission(_type3.FcrPermissionAction.LiveStart, _type3.FcrPrivilegeUserRole.SELF);
318
+ });
319
+ (0, _defineProperty2["default"])(this, "hasStopLiveStreamingPermission", function () {
320
+ return _this._hasPermission(_type3.FcrPermissionAction.LiveStop, _type3.FcrPrivilegeUserRole.SELF);
321
+ });
322
+ (0, _defineProperty2["default"])(this, "hasGetLiveStreamingLinkPermission", function () {
323
+ return _this._hasPermission(_type3.FcrPermissionAction.LiveGetLink, _type3.FcrPrivilegeUserRole.SELF);
324
+ });
325
+ (0, _defineProperty2["default"])(this, "hasEnableStartAudioPermission", function () {
326
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamEnableStartAudio, _type3.FcrPrivilegeUserRole.PARTICIPANT);
327
+ });
328
+ (0, _defineProperty2["default"])(this, "hasEnableChangeNamePermission", function () {
329
+ return _this._hasPermission(_type3.FcrPermissionAction.UserEnableChangeName, _type3.FcrPrivilegeUserRole.PARTICIPANT);
330
+ });
331
+ (0, _defineProperty2["default"])(this, "hasEnableStartVideoPermission", function () {
332
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamEnableStartVideo, _type3.FcrPrivilegeUserRole.PARTICIPANT);
333
+ });
334
+ (0, _defineProperty2["default"])(this, "hasEnableJoinWithAudioPermission", function () {
335
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamEnableJoinWithAudio, _type3.FcrPrivilegeUserRole.PARTICIPANT);
336
+ });
337
+ (0, _defineProperty2["default"])(this, "hasEnableStartScreenSharePermission", function () {
338
+ return _this._hasPermission(_type3.FcrPermissionAction.StreamEnableStartScreenShare, _type3.FcrPrivilegeUserRole.PARTICIPANT);
339
+ });
340
+ (0, _defineProperty2["default"])(this, "hasLockRoomPermission", function () {
341
+ return _this._hasPermission(_type3.FcrPermissionAction.RoomLock, _type3.FcrPrivilegeUserRole.PARTICIPANT);
342
+ });
343
+ (0, _defineProperty2["default"])(this, "hasWatermarkEnablePermission", function () {
344
+ return _this._hasPermission(_type3.FcrPermissionAction.RoomEnableWatermark, _type3.FcrPrivilegeUserRole.PARTICIPANT);
345
+ });
346
+ (0, _defineProperty2["default"])(this, "hasWatermarkDisablePermission", function () {
347
+ return _this._hasPermission(_type3.FcrPermissionAction.RoomDisableWatermark, _type3.FcrPrivilegeUserRole.PARTICIPANT);
348
+ });
349
+ (0, _defineProperty2["default"])(this, "isMulti", (0, _mobxUtils.computedFn)(function () {
350
+ var _info$info3;
351
+ var info = _this.securityInfos.find(function (_ref17) {
352
+ var info = _ref17.info;
353
+ return (info === null || info === void 0 ? void 0 : info.action) === _type3.FcrSecurityAction.WaterMark;
354
+ });
355
+ return (info === null || info === void 0 || (_info$info3 = info.info) === null || _info$info3 === void 0 ? void 0 : _info$info3.payload.lineType) === _type.FcrLineType.MULTI_ROW;
356
+ }));
357
+ //全体静音
358
+ (0, _defineProperty2["default"])(this, "muteAll", function () {
359
+ _this._streamControl.updatePublishPrivilegeOfStreams({
360
+ audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOPRIVILEGE,
361
+ videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
362
+ }, {
363
+ targetRoleType: [_type.FcrUserRole.PARTICIPANT],
364
+ targetRoleTypeIsInclude: true
365
+ });
366
+ });
367
+ //要求所有人解除静音
368
+ (0, _defineProperty2["default"])(this, "unmuteAll", function () {
369
+ _this._streamControl.updatePublishPrivilegeOfStreams({
370
+ audioPrivilege: _fcrCore.FcrStreamPrivilegeOperation.HAS_PRIVILEGE,
371
+ videoPrivilege: _fcrCore.FcrStreamPrivilegeOperation.NOOPERATION
372
+ }, {
373
+ targetRoleType: [_type.FcrUserRole.PARTICIPANT],
374
+ targetRoleTypeIsInclude: true
375
+ });
376
+ });
377
+ (0, _defineProperty2["default"])(this, "setLockRoomEnabled", function (enable) {
378
+ _this._privilegeControl.enableLockedRoom(enable, [_type3.FcrPrivilegeUserRole.HOST, _type3.FcrPrivilegeUserRole.PARTICIPANT]);
379
+ });
380
+ (0, _defineProperty2["default"])(this, "setWaitingRoomEnabled", function () {
381
+ // this._privilegeControl.enableWaitingRoom(true);
382
+ });
383
+ (0, _defineProperty2["default"])(this, "setAllowChangeSelfName", function () {
384
+ // this._privilegeControl.allowChangeName(true, [FcrPrivilegeUserRole.PARTICIPANT]);
385
+ });
386
+ //设置是否允许聊天
387
+ (0, _defineProperty2["default"])(this, "setAllowChat", function (enable) {
388
+ var payload = {
389
+ "public": enable,
390
+ "private": {
391
+ host: enable,
392
+ cohost: enable,
393
+ participant: enable
394
+ }
395
+ };
396
+ _this._privilegeControl.allowSendChat(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT], payload);
397
+ });
398
+ (0, _defineProperty2["default"])(this, "setAllowChatWithPayload", function (enable, payload) {
399
+ _this._privilegeControl.allowSendChat(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT], payload);
400
+ });
401
+ //设置成允许公聊但不允许私聊
402
+ (0, _defineProperty2["default"])(this, "setAllowedPublicChatAndDisallowedPrivateChat", function () {
403
+ _this.setAllowChatWithPayload(true, {
404
+ "public": true,
405
+ "private": {
406
+ host: true,
407
+ cohost: false,
408
+ participant: false
409
+ }
410
+ });
411
+ });
412
+ //设置成不允许公聊,只允许私聊给主持人和联席主持人
413
+ (0, _defineProperty2["default"])(this, "setDisallowedPublicChatAndDisallowedPrivateChatToParticipant", function () {
414
+ _this.setAllowChatWithPayload(true, {
415
+ "public": false,
416
+ "private": {
417
+ host: true,
418
+ cohost: true,
419
+ participant: false
420
+ }
421
+ });
422
+ });
423
+ //所有人加入会议时静音
424
+ (0, _defineProperty2["default"])(this, "setAllowJoinWithMuteAudio", function (enable) {
425
+ _this._privilegeControl.allowJoinWithMutedAudio(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT, _type3.FcrPrivilegeUserRole.COHOST]);
426
+ });
427
+ //允许屏幕共享
428
+ (0, _defineProperty2["default"])(this, "setAllowShareScreen", function (state) {
429
+ _this._privilegeControl.allowShare(state, [_type3.FcrPrivilegeUserRole.PARTICIPANT]);
430
+ });
431
+ //允许开启视频
432
+ (0, _defineProperty2["default"])(this, "setAllowUnmuteSelfVideo", function (enable) {
433
+ _this._privilegeControl.allowStartVideo(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT]);
434
+ });
435
+ //允许自我解除静音
436
+ (0, _defineProperty2["default"])(this, "setAllowUnmuteSelfAudio", function (enable) {
437
+ _this._privilegeControl.allowStartAudio(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT]);
438
+ });
439
+ (0, _defineProperty2["default"])(this, "_hasPermission", (0, _mobxUtils.computedFn)(function (action, targetRole) {
440
+ var _this$permissionInfos;
441
+ var convertedRole = targetRole === _type3.FcrPrivilegeUserRole.SELF ? [_this.localUser.userRole, _type3.FcrPrivilegeUserRole.SELF] : [targetRole];
442
+ var info = (_this$permissionInfos = _this.permissionInfos) === null || _this$permissionInfos === void 0 ? void 0 : _this$permissionInfos.find(function (_ref18) {
443
+ var _info$targetRoles;
444
+ var info = _ref18.info;
445
+ return (info === null || info === void 0 ? void 0 : info.action) === action && ((info === null || info === void 0 || (_info$targetRoles = info.targetRoles) === null || _info$targetRoles === void 0 ? void 0 : _info$targetRoles.length) === 0 || convertedRole.some(function (role) {
446
+ var _info$targetRoles2;
447
+ return info === null || info === void 0 || (_info$targetRoles2 = info.targetRoles) === null || _info$targetRoles2 === void 0 ? void 0 : _info$targetRoles2.includes(role);
448
+ }));
449
+ });
450
+ return !!(info !== null && info !== void 0 && info.enable);
451
+ }));
452
+ (0, _defineProperty2["default"])(this, "_hasPermissionWithParams", (0, _mobxUtils.computedFn)(function (action, targetRole, params) {
453
+ var _this$permissionInfos2;
454
+ var convertedRole = targetRole === _type3.FcrPrivilegeUserRole.SELF ? [_this.localUser.userRole, _type3.FcrPrivilegeUserRole.SELF] : [targetRole];
455
+ var matchParams = function matchParams(_params) {
456
+ return (0, _lodash.every)(Object.keys(params), function (key) {
457
+ return _params && _params[key] && _params[key].includes(params[key]);
458
+ });
459
+ };
460
+ var info = (_this$permissionInfos2 = _this.permissionInfos) === null || _this$permissionInfos2 === void 0 ? void 0 : _this$permissionInfos2.find(function (_ref19) {
461
+ var _info$targetRoles3, _info$params;
462
+ var info = _ref19.info;
463
+ return (info === null || info === void 0 ? void 0 : info.action) === action && ((info === null || info === void 0 || (_info$targetRoles3 = info.targetRoles) === null || _info$targetRoles3 === void 0 ? void 0 : _info$targetRoles3.length) === 0 || convertedRole.some(function (role) {
464
+ var _info$targetRoles4;
465
+ return info === null || info === void 0 || (_info$targetRoles4 = info.targetRoles) === null || _info$targetRoles4 === void 0 ? void 0 : _info$targetRoles4.includes(role);
466
+ })) && matchParams((_info$params = info.params) !== null && _info$params !== void 0 ? _info$params : {});
467
+ });
468
+ return !!(info !== null && info !== void 0 && info.enable);
469
+ }));
470
+ this._privilegeControl = _privilegeControl;
471
+ this._userControl = _userControl;
472
+ this._streamControl = _streamControl;
473
+ this._uiEventStore = _uiEventStore;
474
+ this._setSecurityInfo();
475
+ this._setPermissionInfos();
476
+ this._privilegeControl.addObserver({
477
+ onLocalUserPermissionInfoAdded: this._handlePermissionUpdated.bind(this),
478
+ onLocalUserPermissionInfoDeleted: this._handlePermissionUpdated.bind(this),
479
+ onSecurityInfoUpdated: this._handleSecurityUpdated.bind(this)
480
+ });
481
+
482
+ //@ts-ignore
483
+ window.securityStore = this;
484
+ }
485
+ return (0, _createClass2["default"])(FcrSecurityStore, [{
486
+ key: "securityInfos",
487
+ get: function get() {
488
+ return _classPrivateFieldGet(_A, this);
489
+ },
490
+ set: function set(v) {
491
+ _classPrivateFieldSet(_A, this, v);
492
+ }
493
+ }, {
494
+ key: "permissionInfos",
495
+ get: function get() {
496
+ return _classPrivateFieldGet(_B, this);
497
+ },
498
+ set: function set(v) {
499
+ _classPrivateFieldSet(_B, this, v);
500
+ }
501
+ }, {
502
+ key: "privilegeOperator",
503
+ get: function get() {
504
+ return _classPrivateFieldGet(_C, this);
505
+ },
506
+ set: function set(v) {
507
+ _classPrivateFieldSet(_C, this, v);
508
+ }
509
+ }, {
510
+ key: "boardOwnerUser",
511
+ get: function get() {
512
+ return _classPrivateFieldGet(_D, this);
513
+ },
514
+ set: function set(v) {
515
+ _classPrivateFieldSet(_D, this, v);
516
+ }
517
+ }, {
518
+ key: "release",
519
+ value: function release() {
520
+ this._removeReactions();
521
+ }
522
+ }, {
523
+ key: "_setSecurityInfo",
524
+ value: function _setSecurityInfo() {
525
+ this.securityInfos = this._privilegeControl.getAllSecurityInfo();
526
+ }
527
+ }, {
528
+ key: "_setPermissionInfos",
529
+ value: function _setPermissionInfos() {
530
+ this.permissionInfos = this._privilegeControl.getAllLocalUserPermissionInfo();
531
+ }
532
+ }, {
533
+ key: "localUser",
534
+ get: function get() {
535
+ return this._userControl.getLocalUser();
536
+ }
537
+ }, {
538
+ key: "hasCallMergePermission",
539
+ value: function hasCallMergePermission() {
540
+ return this._hasPermission(_type3.FcrPermissionAction.CallMerge, _type3.FcrPrivilegeUserRole.PARTICIPANT);
541
+ }
542
+ }, {
543
+ key: "hasCallSplitPermission",
544
+ value: function hasCallSplitPermission() {
545
+ return this._hasPermission(_type3.FcrPermissionAction.CallSplit, _type3.FcrPrivilegeUserRole.PARTICIPANT);
546
+ }
547
+ }, {
548
+ key: "hasSetRolePermission",
549
+ value:
550
+ // 是否有设置角色的权限
551
+ function hasSetRolePermission(targetRole, setToRole) {
552
+ return this._hasPermissionWithParams(_type3.FcrPermissionAction.UserSetRole, targetRole, {
553
+ role: (0, _user.convertFcrPrivilegeRoleToStringPrivilegeRole)(setToRole)
554
+ });
555
+ }
556
+ }, {
557
+ key: "hasEndRoomPermission",
558
+ value: function hasEndRoomPermission() {
559
+ return this._hasPermission(_type3.FcrPermissionAction.RoomEnd, _type3.FcrPrivilegeUserRole.PARTICIPANT);
560
+ }
561
+ }, {
562
+ key: "hasAssignHostBeforeLeavingPermission",
563
+ value: function hasAssignHostBeforeLeavingPermission(role) {
564
+ return this._hasPermissionWithParams(_type3.FcrPermissionAction.UserSetRole, _type3.FcrPrivilegeUserRole.PARTICIPANT, {
565
+ role: (0, _user.convertFcrPrivilegeRoleToStringPrivilegeRole)(role)
566
+ });
567
+ }
568
+ }, {
569
+ key: "hasStartBoardPermission",
570
+ value: function hasStartBoardPermission() {
571
+ return this._hasPermission(_type3.FcrPermissionAction.BoardStart, _type3.FcrPrivilegeUserRole.SELF);
572
+ }
573
+ }, {
574
+ key: "hasCloseBoardPermission",
575
+ value: function hasCloseBoardPermission() {
576
+ return this._hasPermission(_type3.FcrPermissionAction.BoardClose, _type3.FcrPrivilegeUserRole.SELF);
577
+ }
578
+ }, {
579
+ key: "hasWriteBoardPermission",
580
+ value: function hasWriteBoardPermission() {
581
+ return this._hasPermission(_type3.FcrPermissionAction.BoardWrite, _type3.FcrPrivilegeUserRole.SELF);
582
+ }
583
+ }, {
584
+ key: "hasAllowStartBoardPermission",
585
+ value: function hasAllowStartBoardPermission() {
586
+ return this._hasPermission(_type3.FcrPermissionAction.BoardAllowStart, _type3.FcrPrivilegeUserRole.SELF);
587
+ }
588
+ }, {
589
+ key: "hasDisallowStartBoardPermission",
590
+ value: function hasDisallowStartBoardPermission() {
591
+ return this._hasPermission(_type3.FcrPermissionAction.BoardDisallowStart, _type3.FcrPrivilegeUserRole.SELF);
592
+ }
593
+ }, {
594
+ key: "hasAllowWriteBoardPermission",
595
+ value: function hasAllowWriteBoardPermission() {
596
+ return this._hasPermission(_type3.FcrPermissionAction.BoardAllowWrite, _type3.FcrPrivilegeUserRole.SELF);
597
+ }
598
+ }, {
599
+ key: "hasDisallowWriteBoardPermission",
600
+ value: function hasDisallowWriteBoardPermission() {
601
+ return this._hasPermission(_type3.FcrPermissionAction.BoardDisallowWrite, _type3.FcrPrivilegeUserRole.SELF);
602
+ }
603
+ }, {
604
+ key: "hasAllowScreenShareAndBoardPermission",
605
+ value: function hasAllowScreenShareAndBoardPermission() {
606
+ var _this$_privilegeContr;
607
+ return (_this$_privilegeContr = this._privilegeControl.getSecurityInfo(_type3.FcrSecurityAction.Sharing)) === null || _this$_privilegeContr === void 0 ? void 0 : _this$_privilegeContr.enable;
608
+ }
609
+ }, {
610
+ key: "hasAllowWaterMarkPermission",
611
+ value: function hasAllowWaterMarkPermission() {
612
+ var _this$_privilegeContr2;
613
+ return (_this$_privilegeContr2 = this._privilegeControl.getSecurityInfo(_type3.FcrSecurityAction.WaterMark)) === null || _this$_privilegeContr2 === void 0 ? void 0 : _this$_privilegeContr2.enable;
614
+ }
615
+ }, {
616
+ key: "getAllowedOperations",
617
+ value: function getAllowedOperations(targetUserRole, _isSelf) {
618
+ var operations = [];
619
+ // if (this.hasRequestStartVideoPermission(targetUserRole)) {
620
+ // //请求开启摄像头权限
621
+ // operations.push('request_start_video');
622
+ // }
623
+ // if (this.hasStartVideoPermission(isSelf ? FcrPrivilegeUserRole.SELF : targetUserRole)) {
624
+ // //开启摄像头权限
625
+ // operations.push('start_video');
626
+ // }
627
+ // if (this.hasStopVideoPermission(isSelf ? FcrPrivilegeUserRole.SELF : targetUserRole)) {
628
+ // //关闭摄像头权限
629
+ // operations.push('stop_video');
630
+ // }
631
+ if (this.hasPermissionToSendPrivateMessage(targetUserRole)) {
632
+ //私聊权限
633
+ operations.push('private_chat');
634
+ }
635
+ // operations.push('pin');
636
+ // if (this.hasSetRolePermission(targetUserRole, FcrPrivilegeUserRole.HOST)) {
637
+ // //设为主持人权限
638
+ // operations.push('set_as_host');
639
+ // }
640
+ // if (this.hasSetRolePermission(targetUserRole, FcrPrivilegeUserRole.COHOST)) {
641
+ // //设为联席主持人权限
642
+ // operations.push('set_as_co_host');
643
+ // }
644
+ // if (this.hasSetRolePermission(targetUserRole, FcrPrivilegeUserRole.PARTICIPANT)) {
645
+ // //撤销联席主持人权限
646
+ // operations.push('revoke_co_host');
647
+ // }
648
+ // if (this.hasCallMergePermission()) {
649
+ // //与视频合并权限
650
+ // operations.push('merge_video');
651
+ // }
652
+ // if (this.hasKickOutPermission(targetUserRole)) {
653
+ // //移除房间权限
654
+ // operations.push('kick_out');
655
+ // }
656
+ // if (this.hasWaitingRoomPermission(targetUserRole)) {
657
+ // operations.push('put_into_waiting_room');
658
+ // }
659
+ return operations;
660
+ }
661
+ }, {
662
+ key: "allowShare",
663
+ value: function () {
664
+ var _allowShare = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(state) {
665
+ var enable;
666
+ return _regenerator["default"].wrap(function _callee$(_context) {
667
+ while (1) switch (_context.prev = _context.next) {
668
+ case 0:
669
+ enable = state === _enums.FcrSharePermissionState.ON;
670
+ _context.next = 3;
671
+ return this._privilegeControl.allowShare(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT]);
672
+ case 3:
673
+ return _context.abrupt("return", _context.sent);
674
+ case 4:
675
+ case "end":
676
+ return _context.stop();
677
+ }
678
+ }, _callee, this);
679
+ }));
680
+ function allowShare(_x) {
681
+ return _allowShare.apply(this, arguments);
682
+ }
683
+ return allowShare;
684
+ }()
685
+ }, {
686
+ key: "setAllowWriteBoard",
687
+ value: function () {
688
+ var _setAllowWriteBoard = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(state) {
689
+ var enable;
690
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
691
+ while (1) switch (_context2.prev = _context2.next) {
692
+ case 0:
693
+ this.logger.info('setAllowWriteBoard', state);
694
+ enable = state === _enums.FcrSharePermissionState.ON;
695
+ _context2.next = 4;
696
+ return this._privilegeControl.allowWriteBoard(enable, [_type3.FcrPrivilegeUserRole.PARTICIPANT]);
697
+ case 4:
698
+ return _context2.abrupt("return", _context2.sent);
699
+ case 5:
700
+ case "end":
701
+ return _context2.stop();
702
+ }
703
+ }, _callee2, this);
704
+ }));
705
+ function setAllowWriteBoard(_x2) {
706
+ return _setAllowWriteBoard.apply(this, arguments);
707
+ }
708
+ return setAllowWriteBoard;
709
+ }()
710
+ }, {
711
+ key: "_handlePermissionUpdated",
712
+ value: function _handlePermissionUpdated() {
713
+ this.permissionInfos = this._privilegeControl.getAllLocalUserPermissionInfo();
714
+ }
715
+ }, {
716
+ key: "_handleSecurityUpdated",
717
+ value: function _handleSecurityUpdated(_roomId, event) {
718
+ var _event$operatorUser,
719
+ _event$operatorUser2,
720
+ _this$privilegeOperat,
721
+ _securityInfo$info,
722
+ _securityInfo$info2,
723
+ _securityInfo$info3,
724
+ _securityInfo$info4,
725
+ _securityInfo$info5,
726
+ _securityInfo$info6,
727
+ _this2 = this,
728
+ _event$securityInfo$i,
729
+ _event$securityInfo$i2;
730
+ this._setSecurityInfo();
731
+ this.privilegeOperator = event.operatorUser;
732
+ var securityInfo = event.securityInfo;
733
+ var enable = securityInfo.enable;
734
+ var operator = this.localUser.userId === ((_event$operatorUser = event.operatorUser) === null || _event$operatorUser === void 0 ? void 0 : _event$operatorUser.userId) ? (0, _i18n.transI18n)('fmt_settings_labels_you') : (((_event$operatorUser2 = event.operatorUser) === null || _event$operatorUser2 === void 0 ? void 0 : _event$operatorUser2.userRole) === _type.FcrUserRole.HOST ? (0, _i18n.transI18n)('fmt_role_host') : (0, _i18n.transI18n)('fmt_role_cohost')) + " ".concat((_this$privilegeOperat = this.privilegeOperator) === null || _this$privilegeOperat === void 0 ? void 0 : _this$privilegeOperat.userName, " ");
735
+ if (((_securityInfo$info = securityInfo.info) === null || _securityInfo$info === void 0 ? void 0 : _securityInfo$info.action) === _type3.FcrSecurityAction.JoinWithMuteAudio) {
736
+ if (enable) {
737
+ this._uiEventStore.showToast({
738
+ type: 'info',
739
+ message: (0, _i18n.transI18n)('fmt_settings_tips_muteallwhilejoin', {
740
+ reason1: operator
741
+ })
742
+ });
743
+ }
744
+ } else if (((_securityInfo$info2 = securityInfo.info) === null || _securityInfo$info2 === void 0 ? void 0 : _securityInfo$info2.action) === _type3.FcrSecurityAction.StartAudio) {
745
+ var toastMessage = enable ? (0, _i18n.transI18n)('fmt_settings_tips_allowedselfunmuting', {
746
+ reason1: operator
747
+ }) : (0, _i18n.transI18n)('fmt_settings_tips_disabledselfunmuting', {
748
+ reason1: operator
749
+ });
750
+ this._uiEventStore.showToast({
751
+ type: 'info',
752
+ message: toastMessage
753
+ });
754
+ } else if (((_securityInfo$info3 = securityInfo.info) === null || _securityInfo$info3 === void 0 ? void 0 : _securityInfo$info3.action) === _type3.FcrSecurityAction.StartVideo) {
755
+ var _toastMessage = enable ? (0, _i18n.transI18n)('fmt_settings_tips_videoenabled', {
756
+ reason1: operator
757
+ }) : (0, _i18n.transI18n)('fmt_settings_tips_disabledvideo', {
758
+ reason1: operator
759
+ });
760
+ this._uiEventStore.showToast({
761
+ type: 'info',
762
+ message: _toastMessage
763
+ });
764
+ } else if (((_securityInfo$info4 = securityInfo.info) === null || _securityInfo$info4 === void 0 ? void 0 : _securityInfo$info4.action) === _type3.FcrSecurityAction.ShareScreen) {
765
+ var _toastMessage2 = enable ? (0, _i18n.transI18n)('fmt_settings_tips_allowedScreensharing', {
766
+ reason1: operator
767
+ }) : (0, _i18n.transI18n)('fmt_settings_tips_disabledScreensharing', {
768
+ reason1: operator
769
+ });
770
+ this._uiEventStore.showToast({
771
+ type: 'info',
772
+ message: _toastMessage2
773
+ });
774
+ } else if (((_securityInfo$info5 = securityInfo.info) === null || _securityInfo$info5 === void 0 ? void 0 : _securityInfo$info5.action) === _type3.FcrSecurityAction.SendChat) {
775
+ var _toastMessage3 = enable ? (0, _i18n.transI18n)('fmt_settings_tips_allowedchat', {
776
+ reason1: operator
777
+ }) : (0, _i18n.transI18n)('fmt_settings_tips_banedchat', {
778
+ reason1: operator
779
+ });
780
+ this._uiEventStore.showToast({
781
+ type: 'info',
782
+ message: _toastMessage3
783
+ });
784
+ } else if (((_securityInfo$info6 = securityInfo.info) === null || _securityInfo$info6 === void 0 ? void 0 : _securityInfo$info6.action) === _type3.FcrSecurityAction.Sharing && !enable) {
785
+ var _this$boardOwnerUser, _this$boardOwnerUser2;
786
+ if (!this.boardOwnerUser) return;
787
+ var isHost = [_type.FcrUserRole.HOST, _type.FcrUserRole.COHOST].includes((_this$boardOwnerUser = this.boardOwnerUser) === null || _this$boardOwnerUser === void 0 ? void 0 : _this$boardOwnerUser.userRole);
788
+ if (!isHost) {
789
+ this._uiEventStore.sendEvent(_constant.UIAction.CLOSE_WHITEBOARD);
790
+ } else {
791
+ return;
792
+ }
793
+ if (((_this$boardOwnerUser2 = this.boardOwnerUser) === null || _this$boardOwnerUser2 === void 0 ? void 0 : _this$boardOwnerUser2.userId) !== this.localUser.userId) {
794
+ this._uiEventStore.showToast({
795
+ type: 'info',
796
+ message: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_alreadyopend')
797
+ });
798
+ } else {
799
+ var dialogKey = this._uiEventStore.openConfirmDialog({
800
+ title: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_tips_stoppedboard'),
801
+ content: (0, _i18n.transI18n)('fmt_settings_tips_sharingprohibited', {
802
+ reason1: operator
803
+ }),
804
+ icon: _type2.FcrIconType.FCR_SCREENSHARING,
805
+ okText: (0, _i18n.transI18n)('fmt_screenshare_whiteboard_button_gotit'),
806
+ showCancel: false,
807
+ onOk: function onOk() {
808
+ _this2._uiEventStore.closeDialog(dialogKey);
809
+ },
810
+ onCancel: function onCancel() {
811
+ _this2._uiEventStore.closeDialog(dialogKey);
812
+ }
813
+ });
814
+ }
815
+ } else if (((_event$securityInfo$i = event.securityInfo.info) === null || _event$securityInfo$i === void 0 ? void 0 : _event$securityInfo$i.action) === _type3.FcrSecurityAction.WaitingRoom) {
816
+ var _event$operatorUser3, _event$operatorUser4;
817
+ var isSelf = this.localUser.userId === ((_event$operatorUser3 = event.operatorUser) === null || _event$operatorUser3 === void 0 ? void 0 : _event$operatorUser3.userId);
818
+ var userName = (_event$operatorUser4 = event.operatorUser) === null || _event$operatorUser4 === void 0 ? void 0 : _event$operatorUser4.userName;
819
+ if (!isSelf) {
820
+ if (enable) {
821
+ this._uiEventStore.showToast({
822
+ type: 'normal',
823
+ message: "".concat(userName).concat((0, _i18n.transI18n)('fmt_waitingroom_setting_tips_enable'))
824
+ });
825
+ } else {
826
+ this._uiEventStore.showToast({
827
+ type: 'normal',
828
+ message: "".concat(userName).concat((0, _i18n.transI18n)('fmt_waitingroom_mobile_setting_label_disable'))
829
+ });
830
+ }
831
+ }
832
+ } else if (((_event$securityInfo$i2 = event.securityInfo.info) === null || _event$securityInfo$i2 === void 0 ? void 0 : _event$securityInfo$i2.action) == _type3.FcrSecurityAction.WaterMark) {
833
+ var _event$securityInfo$i3;
834
+ var _enable = event.securityInfo.enable;
835
+ if (this._prevWaterMarkEnable !== _enable) {
836
+ var _event$operatorUser5;
837
+ var toastText = '';
838
+ var roleValue = (_event$operatorUser5 = event.operatorUser) === null || _event$operatorUser5 === void 0 ? void 0 : _event$operatorUser5.userRole;
839
+ var canTriggerToast = roleValue === _type.FcrUserRole.HOST || roleValue === _type.FcrUserRole.COHOST;
840
+ if (canTriggerToast) {
841
+ if (_enable) {
842
+ if (roleValue === _type.FcrUserRole.HOST) {
843
+ toastText = (0, _i18n.transI18n)('fmt_security_setting_popup_toast_facilitator_watermark');
844
+ } else if (roleValue === _type.FcrUserRole.COHOST) {
845
+ toastText = (0, _i18n.transI18n)('fmt_security_setting_popup_toast_co_facilitator_watermark');
846
+ }
847
+ } else {
848
+ toastText = (0, _i18n.transI18n)('fmt_security_setting_popup_toast_turn_off_watermark');
849
+ }
850
+ this._prevWaterMarkEnable = _enable;
851
+ if (toastText) {
852
+ this._uiEventStore.showToast({
853
+ type: 'normal',
854
+ message: toastText
855
+ });
856
+ }
857
+ }
858
+ }
859
+ this._uiEventStore.sendEvent(_constant.UIAction.WATERMARK_INFO_UPDATE, {
860
+ enable: _enable,
861
+ lineType: (_event$securityInfo$i3 = event.securityInfo.info) === null || _event$securityInfo$i3 === void 0 ? void 0 : _event$securityInfo$i3.payload.lineType
862
+ });
863
+ }
864
+ }
865
+ }, {
866
+ key: "permitPrivateChat",
867
+ value: function permitPrivateChat(userId) {
868
+ var _this$_userControl$ge;
869
+ var localUserRole = (_this$_userControl$ge = this._userControl.getLocalUser()) === null || _this$_userControl$ge === void 0 ? void 0 : _this$_userControl$ge.userRole;
870
+ // 参会者才需要权限控制
871
+ if (localUserRole === _type.FcrUserRole.PARTICIPANT) {
872
+ var _this$_userControl$ge2;
873
+ var toastObj = {
874
+ id: 'private-toast',
875
+ toastProps: {
876
+ type: 'error',
877
+ content: (0, _i18n.transI18n)('fmt_settings_tips_Blockallchat'),
878
+ size: 'small'
879
+ },
880
+ customRootClass: 'participants-container'
881
+ };
882
+ var needToast = false;
883
+ // 禁止所有聊天
884
+ if (!this.allowChat() || this.disallowedAllChat()) {
885
+ needToast = true;
886
+ }
887
+ var targetUserRole = (_this$_userControl$ge2 = this._userControl.getUser(userId)) === null || _this$_userControl$ge2 === void 0 ? void 0 : _this$_userControl$ge2.userRole;
888
+
889
+ // 公聊但允许私聊主持人和联席主持人
890
+ if (this.allowedPublicChatAndDisallowedPrivateChat() && targetUserRole === _type.FcrUserRole.PARTICIPANT) {
891
+ toastObj.toastProps.content = (0, _i18n.transI18n)('fmt_settings_tips_groupchatonly');
892
+ needToast = true;
893
+ }
894
+
895
+ // 仅允许私聊主持人和联席主持人
896
+ if (this.disallowedPublicChatAndDisallowedPrivateChatToParticipant() && targetUserRole === _type.FcrUserRole.PARTICIPANT) {
897
+ toastObj.toastProps.content = (0, _i18n.transI18n)('fmt_settings_tips_hostchatonly');
898
+ needToast = true;
899
+ }
900
+ if (needToast) {
901
+ _toast.FcrToastApi.open(toastObj);
902
+ return false;
903
+ }
904
+ return true;
905
+ }
906
+ return true;
907
+ }
908
+ }, {
909
+ key: "_removeReactions",
910
+ value: function _removeReactions() {
911
+ this._disposers.forEach(function (d) {
912
+ return d();
913
+ });
914
+ this._disposers = [];
915
+ }
916
+ }, {
917
+ key: "setAllowWaterMark",
918
+ value: function () {
919
+ var _setAllowWaterMark = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(state, lineType) {
920
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
921
+ while (1) switch (_context3.prev = _context3.next) {
922
+ case 0:
923
+ _context3.next = 2;
924
+ return this._privilegeControl.allowWatermark(state, [_type3.FcrPrivilegeUserRole.PARTICIPANT], lineType);
925
+ case 2:
926
+ return _context3.abrupt("return", _context3.sent);
927
+ case 3:
928
+ case "end":
929
+ return _context3.stop();
930
+ }
931
+ }, _callee3, this);
932
+ }));
933
+ function setAllowWaterMark(_x3, _x4) {
934
+ return _setAllowWaterMark.apply(this, arguments);
935
+ }
936
+ return setAllowWaterMark;
937
+ }()
938
+ }]);
939
+ }();
940
+ _FcrSecurityStore = FcrSecurityStore;
941
+ var _applyDecs$e = _applyDecs(_FcrSecurityStore, [[_mobx.observable, 1, "securityInfos"], [_mobx.observable, 1, "permissionInfos"], [_mobx.observable, 1, "privilegeOperator"], [_mobx.observable, 1, "boardOwnerUser"], [_setSecurityInfoDecs, 18, "_setSecurityInfo"], [_setPermissionInfosDecs, 18, "_setPermissionInfos"], [_handlePermissionUpdatedDecs, 18, "_handlePermissionUpdated"], [_handleSecurityUpdatedDecs, 18, "_handleSecurityUpdated"], [_decorator.bound, 2, "_removeReactions"], [_decorator.bound, 2, "setAllowWaterMark"]], []).e;
942
+ var _applyDecs$e2 = (0, _slicedToArray2["default"])(_applyDecs$e, 5);
943
+ _init_securityInfos = _applyDecs$e2[0];
944
+ _init_permissionInfos = _applyDecs$e2[1];
945
+ _init_privilegeOperator = _applyDecs$e2[2];
946
+ _init_boardOwnerUser = _applyDecs$e2[3];
947
+ _initProto = _applyDecs$e2[4];
948
+ _applyDecs$e;