@sendbird/uikit-react 3.2.0-rc.1 → 3.2.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 (508) hide show
  1. package/App.js +34 -32
  2. package/App.js.map +1 -1
  3. package/CHANGELOG.md +8 -2
  4. package/Channel/components/ChannelHeader.js +19 -17
  5. package/Channel/components/ChannelHeader.js.map +1 -1
  6. package/Channel/components/ChannelUI.js +25 -23
  7. package/Channel/components/ChannelUI.js.map +1 -1
  8. package/Channel/components/FileViewer.js +18 -16
  9. package/Channel/components/FileViewer.js.map +1 -1
  10. package/Channel/components/FrozenNotification.js +4 -4
  11. package/Channel/components/Message.js +22 -20
  12. package/Channel/components/Message.js.map +1 -1
  13. package/Channel/components/MessageInput.js +19 -17
  14. package/Channel/components/MessageInput.js.map +1 -1
  15. package/Channel/components/MessageList.js +24 -22
  16. package/Channel/components/MessageList.js.map +1 -1
  17. package/Channel/components/RemoveMessageModal.js +19 -17
  18. package/Channel/components/RemoveMessageModal.js.map +1 -1
  19. package/Channel/components/SuggestedMentionList.js +19 -17
  20. package/Channel/components/SuggestedMentionList.js.map +1 -1
  21. package/Channel/components/TypingIndicator.js +19 -17
  22. package/Channel/components/TypingIndicator.js.map +1 -1
  23. package/Channel/components/UnreadCount.js +4 -4
  24. package/Channel/context.js +17 -15
  25. package/Channel/context.js.map +1 -1
  26. package/Channel.js +25 -23
  27. package/Channel.js.map +1 -1
  28. package/ChannelList/components/AddChannel.js +13 -13
  29. package/ChannelList/components/ChannelListHeader.js +7 -7
  30. package/ChannelList/components/ChannelListUI.js +29 -27
  31. package/ChannelList/components/ChannelListUI.js.map +1 -1
  32. package/ChannelList/components/ChannelPreview.js +23 -21
  33. package/ChannelList/components/ChannelPreview.js.map +1 -1
  34. package/ChannelList/components/ChannelPreviewAction.js +17 -15
  35. package/ChannelList/components/ChannelPreviewAction.js.map +1 -1
  36. package/ChannelList/context.js +12 -10
  37. package/ChannelList/context.js.map +1 -1
  38. package/ChannelList.js +29 -27
  39. package/ChannelList.js.map +1 -1
  40. package/{ChannelListProvider-368bd7f1.js → ChannelListProvider-b5833a69.js} +11 -11
  41. package/{ChannelListProvider-368bd7f1.js.map → ChannelListProvider-b5833a69.js.map} +1 -1
  42. package/{ChannelProvider-59559ed8.js → ChannelProvider-675be930.js} +12 -12
  43. package/{ChannelProvider-59559ed8.js.map → ChannelProvider-675be930.js.map} +1 -1
  44. package/ChannelSettings/components/ChannelProfile.js +11 -11
  45. package/ChannelSettings/components/ChannelSettingsUI.js +21 -19
  46. package/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
  47. package/ChannelSettings/components/EditDetailsModal.js +11 -11
  48. package/ChannelSettings/components/LeaveChannel.js +10 -10
  49. package/ChannelSettings/components/ModerationPanel.js +19 -17
  50. package/ChannelSettings/components/ModerationPanel.js.map +1 -1
  51. package/ChannelSettings/components/UserListItem.js +11 -11
  52. package/ChannelSettings/components/UserPanel.js +13 -13
  53. package/ChannelSettings/context.js +3 -3
  54. package/ChannelSettings.js +21 -19
  55. package/ChannelSettings.js.map +1 -1
  56. package/CreateChannel/components/CreateChannelUI.js +13 -13
  57. package/CreateChannel/components/InviteUsers.js +13 -13
  58. package/CreateChannel/components/SelectChannelType.js +10 -10
  59. package/CreateChannel/context.js +4 -4
  60. package/CreateChannel.js +13 -13
  61. package/{CreateChannelProvider-9c2113ca.js → CreateChannelProvider-05b11547.js} +1 -1
  62. package/{CreateChannelProvider-9c2113ca.js.map → CreateChannelProvider-05b11547.js.map} +1 -1
  63. package/CreateOpenChannel/components/CreateOpenChannelUI.js +9 -9
  64. package/CreateOpenChannel/context.js +1 -1
  65. package/CreateOpenChannel.js +9 -9
  66. package/EditUserProfile/components/EditUserProfileUI.js +12 -12
  67. package/EditUserProfile.js +12 -12
  68. package/{LocalizationContext-10829cf3.js → LocalizationContext-fd0d32ab.js} +3 -3
  69. package/{LocalizationContext-10829cf3.js.map → LocalizationContext-fd0d32ab.js.map} +1 -1
  70. package/{MemberList-e049f915.js → MemberList-78a423a0.js} +5 -5
  71. package/{MemberList-e049f915.js.map → MemberList-78a423a0.js.map} +1 -1
  72. package/MessageSearch/components/MessageSearchUI.js +11 -11
  73. package/MessageSearch/context.js +2 -2
  74. package/MessageSearch.js +11 -11
  75. package/OpenChannel/components/FrozenChannelNotification.js +4 -4
  76. package/OpenChannel/components/OpenChannelHeader.js +17 -15
  77. package/OpenChannel/components/OpenChannelHeader.js.map +1 -1
  78. package/OpenChannel/components/OpenChannelInput.js +20 -18
  79. package/OpenChannel/components/OpenChannelInput.js.map +1 -1
  80. package/OpenChannel/components/OpenChannelMessage.js +25 -23
  81. package/OpenChannel/components/OpenChannelMessage.js.map +1 -1
  82. package/OpenChannel/components/OpenChannelMessageList.js +27 -25
  83. package/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
  84. package/OpenChannel/components/OpenChannelUI.js +27 -25
  85. package/OpenChannel/components/OpenChannelUI.js.map +1 -1
  86. package/OpenChannel/context.js +14 -12
  87. package/OpenChannel/context.js.map +1 -1
  88. package/OpenChannel.js +27 -25
  89. package/OpenChannel.js.map +1 -1
  90. package/OpenChannelList/components/OpenChannelListUI.js +12 -12
  91. package/OpenChannelList/components/OpenChannelPreview.js +4 -4
  92. package/OpenChannelList/context.js +4 -4
  93. package/OpenChannelList.js +12 -12
  94. package/{OpenChannelListProvider-95ce73b1.js → OpenChannelListProvider-6f9126d0.js} +3 -3
  95. package/{OpenChannelListProvider-95ce73b1.js.map → OpenChannelListProvider-6f9126d0.js.map} +1 -1
  96. package/{OpenChannelProvider-b360d5fe.js → OpenChannelProvider-e39971da.js} +11 -10
  97. package/{OpenChannelProvider-b360d5fe.js.map → OpenChannelProvider-e39971da.js.map} +1 -1
  98. package/OpenChannelSettings/components/EditDetailsModal.js +15 -14
  99. package/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
  100. package/OpenChannelSettings/components/OpenChannelProfile.js +15 -14
  101. package/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
  102. package/OpenChannelSettings/components/OpenChannelSettingsUI.js +20 -19
  103. package/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
  104. package/OpenChannelSettings/components/OperatorUI.js +19 -18
  105. package/OpenChannelSettings/components/OperatorUI.js.map +1 -1
  106. package/OpenChannelSettings/components/ParticipantUI.js +17 -16
  107. package/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
  108. package/OpenChannelSettings/context.js +6 -5
  109. package/OpenChannelSettings/context.js.map +1 -1
  110. package/OpenChannelSettings.js +20 -19
  111. package/OpenChannelSettings.js.map +1 -1
  112. package/SendbirdProvider.js +18 -16
  113. package/SendbirdProvider.js.map +1 -1
  114. package/{UserProfileContext-beacab28.js → UserProfileContext-d36099b1.js} +1 -1
  115. package/{UserProfileContext-beacab28.js.map → UserProfileContext-d36099b1.js.map} +1 -1
  116. package/__bundle-0dad34cd-10d4f218.js +6 -0
  117. package/__bundle-0dad34cd-10d4f218.js.map +1 -0
  118. package/__bundle-57e0c5af-4e9165b5.js +6 -0
  119. package/__bundle-57e0c5af-4e9165b5.js.map +1 -0
  120. package/__bundle-bd072f34-1aaac363.js +6 -0
  121. package/__bundle-bd072f34-1aaac363.js.map +1 -0
  122. package/{_rollupPluginBabelHelpers-22c28a74.js → _rollupPluginBabelHelpers-f6b9b32e.js} +1 -1
  123. package/_rollupPluginBabelHelpers-f6b9b32e.js.map +1 -0
  124. package/{actionTypes-fd0f0a6c.js → actionTypes-6b501c5e.js} +1 -1
  125. package/{actionTypes-fd0f0a6c.js.map → actionTypes-6b501c5e.js.map} +1 -1
  126. package/cjs/App.js +34 -32
  127. package/cjs/App.js.map +1 -1
  128. package/cjs/Channel/components/ChannelHeader.js +19 -17
  129. package/cjs/Channel/components/ChannelHeader.js.map +1 -1
  130. package/cjs/Channel/components/ChannelUI.js +25 -23
  131. package/cjs/Channel/components/ChannelUI.js.map +1 -1
  132. package/cjs/Channel/components/FileViewer.js +18 -16
  133. package/cjs/Channel/components/FileViewer.js.map +1 -1
  134. package/cjs/Channel/components/FrozenNotification.js +4 -4
  135. package/cjs/Channel/components/Message.js +22 -20
  136. package/cjs/Channel/components/Message.js.map +1 -1
  137. package/cjs/Channel/components/MessageInput.js +19 -17
  138. package/cjs/Channel/components/MessageInput.js.map +1 -1
  139. package/cjs/Channel/components/MessageList.js +24 -22
  140. package/cjs/Channel/components/MessageList.js.map +1 -1
  141. package/cjs/Channel/components/RemoveMessageModal.js +19 -17
  142. package/cjs/Channel/components/RemoveMessageModal.js.map +1 -1
  143. package/cjs/Channel/components/SuggestedMentionList.js +19 -17
  144. package/cjs/Channel/components/SuggestedMentionList.js.map +1 -1
  145. package/cjs/Channel/components/TypingIndicator.js +19 -17
  146. package/cjs/Channel/components/TypingIndicator.js.map +1 -1
  147. package/cjs/Channel/components/UnreadCount.js +4 -4
  148. package/cjs/Channel/context.js +17 -15
  149. package/cjs/Channel/context.js.map +1 -1
  150. package/cjs/Channel.js +25 -23
  151. package/cjs/Channel.js.map +1 -1
  152. package/cjs/ChannelList/components/AddChannel.js +13 -13
  153. package/cjs/ChannelList/components/ChannelListHeader.js +7 -7
  154. package/cjs/ChannelList/components/ChannelListUI.js +29 -27
  155. package/cjs/ChannelList/components/ChannelListUI.js.map +1 -1
  156. package/cjs/ChannelList/components/ChannelPreview.js +23 -21
  157. package/cjs/ChannelList/components/ChannelPreview.js.map +1 -1
  158. package/cjs/ChannelList/components/ChannelPreviewAction.js +17 -15
  159. package/cjs/ChannelList/components/ChannelPreviewAction.js.map +1 -1
  160. package/cjs/ChannelList/context.js +12 -10
  161. package/cjs/ChannelList/context.js.map +1 -1
  162. package/cjs/ChannelList.js +29 -27
  163. package/cjs/ChannelList.js.map +1 -1
  164. package/cjs/{ChannelListProvider-dba82f83.js → ChannelListProvider-ae097fa5.js} +11 -11
  165. package/cjs/{ChannelListProvider-dba82f83.js.map → ChannelListProvider-ae097fa5.js.map} +1 -1
  166. package/cjs/{ChannelProvider-dd81a327.js → ChannelProvider-dbb1d52e.js} +16 -16
  167. package/cjs/{ChannelProvider-dd81a327.js.map → ChannelProvider-dbb1d52e.js.map} +1 -1
  168. package/cjs/ChannelSettings/components/ChannelProfile.js +11 -11
  169. package/cjs/ChannelSettings/components/ChannelSettingsUI.js +21 -19
  170. package/cjs/ChannelSettings/components/ChannelSettingsUI.js.map +1 -1
  171. package/cjs/ChannelSettings/components/EditDetailsModal.js +11 -11
  172. package/cjs/ChannelSettings/components/LeaveChannel.js +10 -10
  173. package/cjs/ChannelSettings/components/ModerationPanel.js +19 -17
  174. package/cjs/ChannelSettings/components/ModerationPanel.js.map +1 -1
  175. package/cjs/ChannelSettings/components/UserListItem.js +11 -11
  176. package/cjs/ChannelSettings/components/UserPanel.js +13 -13
  177. package/cjs/ChannelSettings/context.js +3 -3
  178. package/cjs/ChannelSettings.js +21 -19
  179. package/cjs/ChannelSettings.js.map +1 -1
  180. package/cjs/CreateChannel/components/CreateChannelUI.js +13 -13
  181. package/cjs/CreateChannel/components/InviteUsers.js +13 -13
  182. package/cjs/CreateChannel/components/SelectChannelType.js +10 -10
  183. package/cjs/CreateChannel/context.js +4 -4
  184. package/cjs/CreateChannel.js +13 -13
  185. package/cjs/{CreateChannelProvider-771bf00b.js → CreateChannelProvider-f8905c40.js} +1 -1
  186. package/cjs/{CreateChannelProvider-771bf00b.js.map → CreateChannelProvider-f8905c40.js.map} +1 -1
  187. package/cjs/CreateOpenChannel/components/CreateOpenChannelUI.js +9 -9
  188. package/cjs/CreateOpenChannel/context.js +1 -1
  189. package/cjs/CreateOpenChannel.js +9 -9
  190. package/cjs/EditUserProfile/components/EditUserProfileUI.js +12 -12
  191. package/cjs/EditUserProfile.js +12 -12
  192. package/cjs/{LocalizationContext-b051aa28.js → LocalizationContext-1f00818c.js} +3 -3
  193. package/cjs/{LocalizationContext-b051aa28.js.map → LocalizationContext-1f00818c.js.map} +1 -1
  194. package/cjs/{MemberList-6c0cdd90.js → MemberList-e2e283fe.js} +5 -5
  195. package/cjs/{MemberList-6c0cdd90.js.map → MemberList-e2e283fe.js.map} +1 -1
  196. package/cjs/MessageSearch/components/MessageSearchUI.js +11 -11
  197. package/cjs/MessageSearch/context.js +2 -2
  198. package/cjs/MessageSearch.js +11 -11
  199. package/cjs/OpenChannel/components/FrozenChannelNotification.js +4 -4
  200. package/cjs/OpenChannel/components/OpenChannelHeader.js +17 -15
  201. package/cjs/OpenChannel/components/OpenChannelHeader.js.map +1 -1
  202. package/cjs/OpenChannel/components/OpenChannelInput.js +20 -18
  203. package/cjs/OpenChannel/components/OpenChannelInput.js.map +1 -1
  204. package/cjs/OpenChannel/components/OpenChannelMessage.js +25 -23
  205. package/cjs/OpenChannel/components/OpenChannelMessage.js.map +1 -1
  206. package/cjs/OpenChannel/components/OpenChannelMessageList.js +27 -25
  207. package/cjs/OpenChannel/components/OpenChannelMessageList.js.map +1 -1
  208. package/cjs/OpenChannel/components/OpenChannelUI.js +27 -25
  209. package/cjs/OpenChannel/components/OpenChannelUI.js.map +1 -1
  210. package/cjs/OpenChannel/context.js +14 -12
  211. package/cjs/OpenChannel/context.js.map +1 -1
  212. package/cjs/OpenChannel.js +27 -25
  213. package/cjs/OpenChannel.js.map +1 -1
  214. package/cjs/OpenChannelList/components/OpenChannelListUI.js +12 -12
  215. package/cjs/OpenChannelList/components/OpenChannelPreview.js +4 -4
  216. package/cjs/OpenChannelList/context.js +4 -4
  217. package/cjs/OpenChannelList.js +12 -12
  218. package/cjs/{OpenChannelListProvider-3eed20f7.js → OpenChannelListProvider-e311c2a1.js} +3 -3
  219. package/cjs/{OpenChannelListProvider-3eed20f7.js.map → OpenChannelListProvider-e311c2a1.js.map} +1 -1
  220. package/cjs/{OpenChannelProvider-e4f3a05c.js → OpenChannelProvider-dd8403ee.js} +11 -10
  221. package/cjs/{OpenChannelProvider-e4f3a05c.js.map → OpenChannelProvider-dd8403ee.js.map} +1 -1
  222. package/cjs/OpenChannelSettings/components/EditDetailsModal.js +15 -14
  223. package/cjs/OpenChannelSettings/components/EditDetailsModal.js.map +1 -1
  224. package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +15 -14
  225. package/cjs/OpenChannelSettings/components/OpenChannelProfile.js.map +1 -1
  226. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +20 -19
  227. package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js.map +1 -1
  228. package/cjs/OpenChannelSettings/components/OperatorUI.js +19 -18
  229. package/cjs/OpenChannelSettings/components/OperatorUI.js.map +1 -1
  230. package/cjs/OpenChannelSettings/components/ParticipantUI.js +17 -16
  231. package/cjs/OpenChannelSettings/components/ParticipantUI.js.map +1 -1
  232. package/cjs/OpenChannelSettings/context.js +6 -5
  233. package/cjs/OpenChannelSettings/context.js.map +1 -1
  234. package/cjs/OpenChannelSettings.js +20 -19
  235. package/cjs/OpenChannelSettings.js.map +1 -1
  236. package/cjs/SendbirdProvider.js +18 -17
  237. package/cjs/SendbirdProvider.js.map +1 -1
  238. package/cjs/{UserProfileContext-fa684629.js → UserProfileContext-3a4f0132.js} +1 -1
  239. package/cjs/{UserProfileContext-fa684629.js.map → UserProfileContext-3a4f0132.js.map} +1 -1
  240. package/cjs/__bundle-0dad34cd-bd827f82.js +33 -0
  241. package/cjs/__bundle-0dad34cd-bd827f82.js.map +1 -0
  242. package/cjs/__bundle-57e0c5af-b8304f7a.js +113 -0
  243. package/cjs/__bundle-57e0c5af-b8304f7a.js.map +1 -0
  244. package/cjs/__bundle-bd072f34-578ccb1e.js +15 -0
  245. package/cjs/__bundle-bd072f34-578ccb1e.js.map +1 -0
  246. package/cjs/{_rollupPluginBabelHelpers-c7da8657.js → _rollupPluginBabelHelpers-6917423d.js} +1 -1
  247. package/cjs/_rollupPluginBabelHelpers-6917423d.js.map +1 -0
  248. package/cjs/{actionTypes-1bc31680.js → actionTypes-341644d7.js} +1 -1
  249. package/cjs/{actionTypes-1bc31680.js.map → actionTypes-341644d7.js.map} +1 -1
  250. package/cjs/{color-8c864d64.js → color-0a6e19c1.js} +1 -1
  251. package/cjs/{color-8c864d64.js.map → color-0a6e19c1.js.map} +1 -1
  252. package/cjs/{compareIds-a7236494.js → compareIds-8d064912.js} +1 -1
  253. package/cjs/{compareIds-a7236494.js.map → compareIds-8d064912.js.map} +1 -1
  254. package/cjs/{const-de0fa0d4.js → const-67a2a885.js} +1 -1
  255. package/cjs/{const-de0fa0d4.js.map → const-67a2a885.js.map} +1 -1
  256. package/cjs/{const-baa5e08a.js → const-bf239fc5.js} +1 -1
  257. package/cjs/{const-baa5e08a.js.map → const-bf239fc5.js.map} +1 -1
  258. package/cjs/{context-867cfd7f.js → context-738129e2.js} +2 -2
  259. package/cjs/{context-867cfd7f.js.map → context-738129e2.js.map} +1 -1
  260. package/cjs/dist/index.css +55 -55
  261. package/cjs/dist/index.css.map +1 -1
  262. package/cjs/groupChannel-05c7f9f8.js +11 -0
  263. package/cjs/groupChannel-05c7f9f8.js.map +1 -0
  264. package/cjs/handlers/ConnectionHandler.js +4 -2
  265. package/cjs/handlers/ConnectionHandler.js.map +1 -1
  266. package/cjs/handlers/GroupChannelHandler.js +5 -3
  267. package/cjs/handlers/GroupChannelHandler.js.map +1 -1
  268. package/cjs/handlers/OpenChannelHandler.js +3 -2
  269. package/cjs/handlers/OpenChannelHandler.js.map +1 -1
  270. package/cjs/handlers/SessionHandler.js +4 -2
  271. package/cjs/handlers/SessionHandler.js.map +1 -1
  272. package/cjs/handlers/UserEventHandler.js +4 -2
  273. package/cjs/handlers/UserEventHandler.js.map +1 -1
  274. package/cjs/{index-907bf834.js → index-177380fc.js} +2 -2
  275. package/cjs/{index-907bf834.js.map → index-177380fc.js.map} +1 -1
  276. package/cjs/{index-78d342b2.js → index-1ac7777f.js} +4 -4
  277. package/cjs/{index-78d342b2.js.map → index-1ac7777f.js.map} +1 -1
  278. package/cjs/{index-6d02996a.js → index-32123d95.js} +2 -2
  279. package/cjs/{index-6d02996a.js.map → index-32123d95.js.map} +1 -1
  280. package/cjs/{index-76deed83.js → index-4f32f285.js} +8 -8
  281. package/cjs/{index-76deed83.js.map → index-4f32f285.js.map} +1 -1
  282. package/cjs/{index-d31051df.js → index-8c25d6aa.js} +1 -1
  283. package/cjs/{index-d31051df.js.map → index-8c25d6aa.js.map} +1 -1
  284. package/cjs/{index-62c9ad2d.js → index-8d7a94e3.js} +6 -6
  285. package/cjs/index-8d7a94e3.js.map +1 -0
  286. package/cjs/{index-b478bf3b.js → index-92bda0ce.js} +4 -4
  287. package/cjs/{index-b478bf3b.js.map → index-92bda0ce.js.map} +1 -1
  288. package/cjs/{index-c4369117.js → index-a11fb495.js} +2 -2
  289. package/cjs/{index-c4369117.js.map → index-a11fb495.js.map} +1 -1
  290. package/cjs/{index-511e268c.js → index-a18115d7.js} +5 -5
  291. package/cjs/{index-511e268c.js.map → index-a18115d7.js.map} +1 -1
  292. package/cjs/{index-53015903.js → index-d82f6dd1.js} +1 -1
  293. package/cjs/{index-53015903.js.map → index-d82f6dd1.js.map} +1 -1
  294. package/cjs/index.js +38 -36
  295. package/cjs/index.js.map +1 -1
  296. package/cjs/openChannel-c5952dd7.js +10 -0
  297. package/cjs/openChannel-c5952dd7.js.map +1 -0
  298. package/cjs/{openChannelUtils-fc2ec8df.js → openChannelUtils-f286fd78.js} +1 -1
  299. package/cjs/{openChannelUtils-fc2ec8df.js.map → openChannelUtils-f286fd78.js.map} +1 -1
  300. package/cjs/sendbird-5edd0213.js +12 -0
  301. package/cjs/sendbird-5edd0213.js.map +1 -0
  302. package/cjs/sendbirdSelectors.js +2 -2
  303. package/cjs/{stringSet-9d251780.js → stringSet-410775ff.js} +1 -1
  304. package/cjs/{stringSet-9d251780.js.map → stringSet-410775ff.js.map} +1 -1
  305. package/cjs/{topics-ac8d2b51.js → topics-9747398e.js} +1 -1
  306. package/cjs/{topics-ac8d2b51.js.map → topics-9747398e.js.map} +1 -1
  307. package/cjs/{tslib.es6-9b1c82d5.js → tslib.es6-7d75f2e2.js} +1 -1
  308. package/cjs/{tslib.es6-9b1c82d5.js.map → tslib.es6-7d75f2e2.js.map} +1 -1
  309. package/cjs/ui/Accordion.js +3 -3
  310. package/cjs/ui/AccordionGroup.js +2 -2
  311. package/cjs/ui/AdminMessage.js +3 -3
  312. package/cjs/ui/Avatar.js +2 -2
  313. package/cjs/ui/Badge.js +5 -5
  314. package/cjs/ui/Button.js +3 -3
  315. package/cjs/ui/ChannelAvatar.js +3 -3
  316. package/cjs/ui/ConnectionStatus.js +4 -4
  317. package/cjs/ui/ContextMenu.js +5 -5
  318. package/cjs/ui/DateSeparator.js +4 -4
  319. package/cjs/ui/EmojiReactions.js +7 -7
  320. package/cjs/ui/FileMessageItemBody.js +5 -5
  321. package/cjs/ui/FileViewer.js +8 -8
  322. package/cjs/ui/IconButton.js +1 -1
  323. package/cjs/ui/ImageRenderer.js +1 -1
  324. package/cjs/ui/Input.js +2 -2
  325. package/cjs/ui/Label.js +2 -2
  326. package/cjs/ui/LinkLabel.js +7 -5
  327. package/cjs/ui/LinkLabel.js.map +1 -1
  328. package/cjs/ui/Loader.js +1 -1
  329. package/cjs/ui/MentionLabel.js +10 -10
  330. package/cjs/ui/MessageContent.js +13 -13
  331. package/cjs/ui/MessageInput.js +9 -9
  332. package/cjs/ui/MessageItemMenu.js +7 -7
  333. package/cjs/ui/MessageItemReactionMenu.js +5 -5
  334. package/cjs/ui/MessageSearchFileItem.js +9 -9
  335. package/cjs/ui/MessageSearchItem.js +9 -9
  336. package/cjs/ui/MessageStatus.js +7 -7
  337. package/cjs/ui/Modal.js +6 -6
  338. package/cjs/ui/OGMessageItemBody.js +10 -10
  339. package/cjs/ui/OpenChannelAdminMessage.js +3 -3
  340. package/cjs/ui/OpenChannelAvatar.js +6 -6
  341. package/cjs/ui/OpenchannelConversationHeader.js +6 -6
  342. package/cjs/ui/OpenchannelFileMessage.js +14 -14
  343. package/cjs/ui/OpenchannelOGMessage.js +14 -14
  344. package/cjs/ui/OpenchannelThumbnailMessage.js +13 -13
  345. package/cjs/ui/OpenchannelUserMessage.js +14 -14
  346. package/cjs/ui/PlaceHolder.js +6 -6
  347. package/cjs/ui/QuoteMessage.js +6 -6
  348. package/cjs/ui/QuoteMessageInput.js +6 -6
  349. package/cjs/ui/ReactionBadge.js +3 -3
  350. package/cjs/ui/ReactionButton.js +1 -1
  351. package/cjs/ui/SortByRow.js +2 -2
  352. package/cjs/ui/TextButton.js +2 -2
  353. package/cjs/ui/TextMessageItemBody.js +10 -10
  354. package/cjs/ui/ThumbnailMessageItemBody.js +2 -2
  355. package/cjs/ui/Tooltip.js +3 -3
  356. package/cjs/ui/TooltipWrapper.js +1 -1
  357. package/cjs/ui/UnknownMessageItemBody.js +6 -6
  358. package/cjs/ui/UserListItem.js +11 -11
  359. package/cjs/ui/UserProfile.js +9 -9
  360. package/cjs/ui/Word.js +10 -10
  361. package/cjs/useSendbirdStateContext.js +1 -1
  362. package/cjs/{utils-8c634fd2.js → utils-01db6d26.js} +1 -1
  363. package/cjs/{utils-8c634fd2.js.map → utils-01db6d26.js.map} +1 -1
  364. package/cjs/{utils-655acd99.js → utils-291d272a.js} +1 -1
  365. package/cjs/{utils-655acd99.js.map → utils-291d272a.js.map} +1 -1
  366. package/cjs/{utils-8e6fef1c.js → utils-37a47883.js} +1 -1
  367. package/cjs/{utils-8e6fef1c.js.map → utils-37a47883.js.map} +1 -1
  368. package/cjs/{uuid-c32d01d6.js → uuid-c813a8a1.js} +1 -1
  369. package/cjs/{uuid-c32d01d6.js.map → uuid-c813a8a1.js.map} +1 -1
  370. package/cjs/withSendbird.js +1 -1
  371. package/{color-fff21001.js → color-b897a03c.js} +1 -1
  372. package/{color-fff21001.js.map → color-b897a03c.js.map} +1 -1
  373. package/{compareIds-332d261c.js → compareIds-4bd391cb.js} +1 -1
  374. package/{compareIds-332d261c.js.map → compareIds-4bd391cb.js.map} +1 -1
  375. package/{const-03293011.js → const-b4823468.js} +1 -1
  376. package/{const-03293011.js.map → const-b4823468.js.map} +1 -1
  377. package/{const-78e336dd.js → const-e71ab906.js} +1 -1
  378. package/{const-78e336dd.js.map → const-e71ab906.js.map} +1 -1
  379. package/{context-44e184de.js → context-fd21f142.js} +2 -2
  380. package/{context-44e184de.js.map → context-fd21f142.js.map} +1 -1
  381. package/dist/index.css +55 -55
  382. package/dist/index.css.map +1 -1
  383. package/groupChannel-a10aea7a.js +8 -0
  384. package/groupChannel-a10aea7a.js.map +1 -0
  385. package/handlers/ConnectionHandler.js +4 -2
  386. package/handlers/ConnectionHandler.js.map +1 -1
  387. package/handlers/GroupChannelHandler.js +5 -3
  388. package/handlers/GroupChannelHandler.js.map +1 -1
  389. package/handlers/OpenChannelHandler.js +4 -3
  390. package/handlers/OpenChannelHandler.js.map +1 -1
  391. package/handlers/SessionHandler.js +4 -2
  392. package/handlers/SessionHandler.js.map +1 -1
  393. package/handlers/UserEventHandler.js +4 -2
  394. package/handlers/UserEventHandler.js.map +1 -1
  395. package/{index-49d3a217.js → index-73516d8c.js} +8 -8
  396. package/{index-49d3a217.js.map → index-73516d8c.js.map} +1 -1
  397. package/{index-5e788130.js → index-8b78f6b4.js} +1 -1
  398. package/{index-5e788130.js.map → index-8b78f6b4.js.map} +1 -1
  399. package/{index-3ddec9e9.js → index-94381d3a.js} +2 -2
  400. package/{index-3ddec9e9.js.map → index-94381d3a.js.map} +1 -1
  401. package/{index-00b281a3.js → index-952ab825.js} +4 -4
  402. package/{index-00b281a3.js.map → index-952ab825.js.map} +1 -1
  403. package/{index-ed8e5d48.js → index-96a98383.js} +4 -4
  404. package/{index-ed8e5d48.js.map → index-96a98383.js.map} +1 -1
  405. package/{index-8bd6c997.js → index-c022bfde.js} +2 -2
  406. package/{index-8bd6c997.js.map → index-c022bfde.js.map} +1 -1
  407. package/{index-940576d8.js → index-ce08211b.js} +1 -1
  408. package/{index-940576d8.js.map → index-ce08211b.js.map} +1 -1
  409. package/{index-7b043ab9.js → index-dfa71ceb.js} +6 -6
  410. package/index-dfa71ceb.js.map +1 -0
  411. package/{index-e5aab3b4.js → index-e6424a4d.js} +5 -5
  412. package/{index-e5aab3b4.js.map → index-e6424a4d.js.map} +1 -1
  413. package/{index-46beca69.js → index-f6fd2b53.js} +2 -2
  414. package/{index-46beca69.js.map → index-f6fd2b53.js.map} +1 -1
  415. package/index.d.ts +1 -1
  416. package/index.js +38 -36
  417. package/index.js.map +1 -1
  418. package/{openChannel-2aef0cd5.js → openChannel-80b84235.js} +4 -3
  419. package/openChannel-80b84235.js.map +1 -0
  420. package/{openChannelUtils-d27d1e28.js → openChannelUtils-19317cb9.js} +1 -1
  421. package/{openChannelUtils-d27d1e28.js.map → openChannelUtils-19317cb9.js.map} +1 -1
  422. package/package.json +2 -3
  423. package/sendbird-7e3109ab.js +7 -0
  424. package/sendbird-7e3109ab.js.map +1 -0
  425. package/sendbirdSelectors.js +2 -2
  426. package/{stringSet-804c49f3.js → stringSet-eb4a64cb.js} +1 -1
  427. package/{stringSet-804c49f3.js.map → stringSet-eb4a64cb.js.map} +1 -1
  428. package/{topics-24c0f724.js → topics-307251cc.js} +1 -1
  429. package/{topics-24c0f724.js.map → topics-307251cc.js.map} +1 -1
  430. package/{tslib.es6-4faaa58d.js → tslib.es6-46e4c379.js} +1 -1
  431. package/{tslib.es6-4faaa58d.js.map → tslib.es6-46e4c379.js.map} +1 -1
  432. package/ui/Accordion.js +3 -3
  433. package/ui/AccordionGroup.js +2 -2
  434. package/ui/AdminMessage.js +3 -3
  435. package/ui/Avatar.js +2 -2
  436. package/ui/Badge.js +5 -5
  437. package/ui/Button.js +3 -3
  438. package/ui/ChannelAvatar.js +3 -3
  439. package/ui/ConnectionStatus.js +4 -4
  440. package/ui/ContextMenu.js +5 -5
  441. package/ui/DateSeparator.js +4 -4
  442. package/ui/EmojiReactions.js +7 -7
  443. package/ui/FileMessageItemBody.js +5 -5
  444. package/ui/FileViewer.js +8 -8
  445. package/ui/IconButton.js +1 -1
  446. package/ui/ImageRenderer.js +1 -1
  447. package/ui/Input.js +2 -2
  448. package/ui/Label.js +2 -2
  449. package/ui/LinkLabel.js +7 -5
  450. package/ui/LinkLabel.js.map +1 -1
  451. package/ui/Loader.js +1 -1
  452. package/ui/MentionLabel.js +10 -10
  453. package/ui/MessageContent.js +13 -13
  454. package/ui/MessageInput.js +9 -9
  455. package/ui/MessageItemMenu.js +7 -7
  456. package/ui/MessageItemReactionMenu.js +5 -5
  457. package/ui/MessageSearchFileItem.js +9 -9
  458. package/ui/MessageSearchItem.js +9 -9
  459. package/ui/MessageStatus.js +7 -7
  460. package/ui/Modal.js +6 -6
  461. package/ui/OGMessageItemBody.js +10 -10
  462. package/ui/OpenChannelAdminMessage.js +3 -3
  463. package/ui/OpenChannelAvatar.js +6 -6
  464. package/ui/OpenchannelConversationHeader.js +6 -6
  465. package/ui/OpenchannelFileMessage.js +14 -14
  466. package/ui/OpenchannelOGMessage.js +14 -14
  467. package/ui/OpenchannelThumbnailMessage.js +13 -13
  468. package/ui/OpenchannelUserMessage.js +14 -14
  469. package/ui/PlaceHolder.js +6 -6
  470. package/ui/QuoteMessage.js +6 -6
  471. package/ui/QuoteMessageInput.js +6 -6
  472. package/ui/ReactionBadge.js +3 -3
  473. package/ui/ReactionButton.js +1 -1
  474. package/ui/SortByRow.js +2 -2
  475. package/ui/TextButton.js +2 -2
  476. package/ui/TextMessageItemBody.js +10 -10
  477. package/ui/ThumbnailMessageItemBody.js +2 -2
  478. package/ui/Tooltip.js +3 -3
  479. package/ui/TooltipWrapper.js +1 -1
  480. package/ui/UnknownMessageItemBody.js +6 -6
  481. package/ui/UserListItem.js +11 -11
  482. package/ui/UserProfile.js +9 -9
  483. package/ui/Word.js +10 -10
  484. package/useSendbirdStateContext.js +1 -1
  485. package/{utils-47a3394f.js → utils-c0d5a2eb.js} +1 -1
  486. package/{utils-47a3394f.js.map → utils-c0d5a2eb.js.map} +1 -1
  487. package/{utils-28acb86e.js → utils-c9a90631.js} +1 -1
  488. package/{utils-28acb86e.js.map → utils-c9a90631.js.map} +1 -1
  489. package/{utils-32938255.js → utils-ea8d6707.js} +1 -1
  490. package/{utils-32938255.js.map → utils-ea8d6707.js.map} +1 -1
  491. package/{uuid-4521c466.js → uuid-e8248f01.js} +1 -1
  492. package/{uuid-4521c466.js.map → uuid-e8248f01.js.map} +1 -1
  493. package/withSendbird.js +1 -1
  494. package/__bundle-c41dd401-d4ab6c10.js +0 -22
  495. package/__bundle-c41dd401-d4ab6c10.js.map +0 -1
  496. package/_rollupPluginBabelHelpers-22c28a74.js.map +0 -1
  497. package/cjs/__bundle-c41dd401-1f364afe.js +0 -120
  498. package/cjs/__bundle-c41dd401-1f364afe.js.map +0 -1
  499. package/cjs/_rollupPluginBabelHelpers-c7da8657.js.map +0 -1
  500. package/cjs/groupChannel-95ba4a71.js +0 -11
  501. package/cjs/groupChannel-95ba4a71.js.map +0 -1
  502. package/cjs/index-62c9ad2d.js.map +0 -1
  503. package/cjs/openChannel-4789903c.js +0 -9
  504. package/cjs/openChannel-4789903c.js.map +0 -1
  505. package/groupChannel-3301a732.js +0 -8
  506. package/groupChannel-3301a732.js.map +0 -1
  507. package/index-7b043ab9.js.map +0 -1
  508. package/openChannel-2aef0cd5.js.map +0 -1
@@ -1,22 +0,0 @@
1
- /*! *****************************************************************************
2
- Copyright (c) Microsoft Corporation.
3
-
4
- Permission to use, copy, modify, and/or distribute this software for any
5
- purpose with or without fee is hereby granted.
6
-
7
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
8
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
9
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
10
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
11
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
12
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
13
- PERFORMANCE OF THIS SOFTWARE.
14
- ***************************************************************************** */
15
- var e=function(t,n){return e=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,n)};function t(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t;}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r);}var n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},n.apply(this,arguments)};function r(e,t,n,r){return new(n||(n=Promise))((function(i,s){function o(e){try{u(r.next(e));}catch(e){s(e);}}function a(e){try{u(r.throw(e));}catch(e){s(e);}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t);}))).then(o,a);}u((r=r.apply(e,t||[])).next());}))}function i(e,t){var n,r,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;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=o.trys,(i=i.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]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o);}catch(e){s=[6,e],r=0;}finally{n=i=0;}if(5&s[0])throw s[1];return {value:s[0]?s[1]:void 0,done:!0}}([s,a])}}}function s(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return {next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,s=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(r=s.next()).done;)o.push(r.value);}catch(e){i={error:e};}finally{try{r&&!r.done&&(n=s.return)&&n.call(s);}finally{if(i)throw i.error}}return o}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,s=t.length;i<s;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var u,l$1=function(){function e(){}return Object.defineProperty(e,"OS_VERSION",{get:function(){return "undefined"!=typeof navigator&&navigator.userAgent?navigator.userAgent.replace(/,/g,"."):"noAgent"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SDK_VERSION",{get:function(){return "4.0.12"},enumerable:!1,configurable:!0}),Object.defineProperty(e,"SDK_MAJOR_VERSION",{get:function(){return e.SDK_VERSION.split(".")[0]},enumerable:!1,configurable:!0}),Object.defineProperty(e,"DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL",{get:function(){return 100},enumerable:!1,configurable:!0}),Object.defineProperty(e,"INTERNAL_CALL",{get:function(){return "ic"},enumerable:!1,configurable:!0}),e}();!function(e){e[e.INVALID_TOKEN=400111]="INVALID_TOKEN",e[e.SESSION_KEY_EXPIRED=400302]="SESSION_KEY_EXPIRED",e[e.SESSION_TOKEN_EXPIRED=400309]="SESSION_TOKEN_EXPIRED",e[e.INTERNAL_SERVER_ERROR=500901]="INTERNAL_SERVER_ERROR",e[e.RATE_LIMIT_EXCEEDED=500910]="RATE_LIMIT_EXCEEDED",e[e.UNKNOWN_SERVER_ERROR=900200]="UNKNOWN_SERVER_ERROR",e[e.DEBUG_MODE_REQUIRED=7e5]="DEBUG_MODE_REQUIRED",e[e.LOST_INSTANCE=700100]="LOST_INSTANCE",e[e.CONNECTION_RENEW=700102]="CONNECTION_RENEW",e[e.INVALID_CONNECTION_STATE_TRANSITION=700200]="INVALID_CONNECTION_STATE_TRANSITION",e[e.INVALID_INITIALIZATION=800100]="INVALID_INITIALIZATION",e[e.CONNECTION_REQUIRED=800101]="CONNECTION_REQUIRED",e[e.CONNECTION_CANCELED=800102]="CONNECTION_CANCELED",e[e.INVALID_PARAMETER=800110]="INVALID_PARAMETER",e[e.NETWORK_ERROR=800120]="NETWORK_ERROR",e[e.NETWORK_ROUTING_ERROR=800121]="NETWORK_ROUTING_ERROR",e[e.MALFORMED_DATA=800130]="MALFORMED_DATA",e[e.MALFORMED_ERROR_DATA=800140]="MALFORMED_ERROR_DATA",e[e.WRONG_CHANNEL_TYPE=800150]="WRONG_CHANNEL_TYPE",e[e.MARK_AS_READ_RATE_LIMIT_EXCEEDED=800160]="MARK_AS_READ_RATE_LIMIT_EXCEEDED",e[e.QUERY_IN_PROGRESS=800170]="QUERY_IN_PROGRESS",e[e.ACK_TIMEOUT=800180]="ACK_TIMEOUT",e[e.LOGIN_TIMEOUT=800190]="LOGIN_TIMEOUT",e[e.WEBSOCKET_CONNECTION_CLOSED=800200]="WEBSOCKET_CONNECTION_CLOSED",e[e.WEBSOCKET_CONNECTION_FAILED=800210]="WEBSOCKET_CONNECTION_FAILED",e[e.REQUEST_FAILED=800220]="REQUEST_FAILED",e[e.FILE_UPLOAD_CANCEL_FAILED=800230]="FILE_UPLOAD_CANCEL_FAILED",e[e.REQUEST_CANCELED=800240]="REQUEST_CANCELED",e[e.REQUEST_DUPLICATED=800250]="REQUEST_DUPLICATED",e[e.FILE_SIZE_LIMIT_EXCEEDED=800260]="FILE_SIZE_LIMIT_EXCEEDED",e[e.SESSION_TOKEN_REQUEST_FAILED=800500]="SESSION_TOKEN_REQUEST_FAILED",e[e.SESSION_TOKEN_REFRESHED=800501]="SESSION_TOKEN_REFRESHED",e[e.SESSION_TOKEN_REFRESH_FAILED=800502]="SESSION_TOKEN_REFRESH_FAILED";}(u||(u={}));var d$1,h$1=function(e){return !(e instanceof p&&!e.shouldThrowOutside)},p=function(e){function n(t){var r=t.code,i=void 0===r?0:r,s=t.message,o=e.call(this,s)||this;return o.shouldThrowOutside=!1,o.name="SendbirdError",o.code=i,Object.setPrototypeOf(o,n.prototype),o}return t(n,e),Object.defineProperty(n.prototype,"isInvalidTokenError",{get:function(){return this.code===u.INVALID_TOKEN},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionTokenExpiredError",{get:function(){return this.code===u.SESSION_TOKEN_EXPIRED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSessionKeyExpiredError",{get:function(){return this.code===u.SESSION_KEY_EXPIRED},enumerable:!1,configurable:!0}),Object.defineProperty(n,"debugModeRequired",{get:function(){return new n({code:u.DEBUG_MODE_REQUIRED,message:"Cannot run this operation in production mode."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"lostInstance",{get:function(){return new n({code:u.LOST_INSTANCE,message:"Instance ID is missing. It should belong to an instance."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionRenew",{get:function(){return new n({code:u.CONNECTION_RENEW,message:"Connection restarts."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"invalidConnectionStateTransition",{get:function(){return new n({code:u.INVALID_CONNECTION_STATE_TRANSITION,message:"Invalid connection state transition."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionRequired",{get:function(){return new n({code:u.CONNECTION_REQUIRED,message:"Connection is required."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionCanceled",{get:function(){return new n({code:u.CONNECTION_CANCELED,message:"Connection is canceled."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"invalidParameters",{get:function(){return new n({code:u.INVALID_PARAMETER,message:"Invalid parameters."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"networkError",{get:function(){return new n({code:u.NETWORK_ERROR,message:"There was a network error."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"markAsReadAllRateLimitExceeded",{get:function(){return new n({code:u.MARK_AS_READ_RATE_LIMIT_EXCEEDED,message:"markAsRead rate limit exceeded."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"queryInProgress",{get:function(){return new n({code:u.QUERY_IN_PROGRESS,message:"Query in progress."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"noAckTimeout",{get:function(){return new n({code:u.ACK_TIMEOUT,message:"Command received no ack."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"loginTimeout",{get:function(){return new n({code:u.LOGIN_TIMEOUT,message:"Connection timeout."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"connectionClosed",{get:function(){return new n({code:u.WEBSOCKET_CONNECTION_CLOSED,message:"Connection is closed. Please reconnect."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"requestFailed",{get:function(){return new n({code:u.REQUEST_FAILED,message:"Request failed."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"fileUploadCanceled",{get:function(){return new n({code:u.FILE_UPLOAD_CANCEL_FAILED,message:"File upload has been canceled."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"requestCanceled",{get:function(){return new n({code:u.REQUEST_CANCELED,message:"Request has been canceled."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sessionTokenRefreshFailed",{get:function(){return new n({code:u.SESSION_TOKEN_REFRESH_FAILED,message:"Failed to refresh the session key."})},enumerable:!1,configurable:!0}),Object.defineProperty(n,"sessionTokenRequestFailed",{get:function(){return new n({code:u.SESSION_TOKEN_REQUEST_FAILED,message:"Failed to get the session token."})},enumerable:!1,configurable:!0}),n.prototype.throwOutside=function(){throw this.shouldThrowOutside=!0,this},n}(Error),f=[u.CONNECTION_REQUIRED,u.NETWORK_ERROR,u.ACK_TIMEOUT,u.WEBSOCKET_CONNECTION_CLOSED,u.WEBSOCKET_CONNECTION_FAILED,u.FILE_UPLOAD_CANCEL_FAILED,u.REQUEST_CANCELED,u.INTERNAL_SERVER_ERROR,u.RATE_LIMIT_EXCEEDED,u.UNKNOWN_SERVER_ERROR],_$1=[u.WEBSOCKET_CONNECTION_CLOSED,u.WEBSOCKET_CONNECTION_FAILED,u.CONNECTION_REQUIRED],g=function(e,t){if(e!==t){var r=n({},e),i=n({},t);return (!r.hasOwnProperty("messageId")||!i.hasOwnProperty("messageId")||r.messageId===i.messageId)&&((!r.hasOwnProperty("reqId")||!i.hasOwnProperty("reqId")||r.reqId===i.reqId)&&(r.hasOwnProperty("messageId")&&delete r.messageId,r.hasOwnProperty("reqId")&&delete r.reqId,i.hasOwnProperty("messageId")&&delete i.messageId,i.hasOwnProperty("reqId")&&delete i.reqId,JSON.stringify(r)===JSON.stringify(i)))}return !0},y=function(e,t,n){return void 0===n&&(n=!1),!(!n||null!=t)||("string"!=typeof e?"object"==typeof e?m(e,t):v(e,t):typeof t===e)},m=function(e,t,n){return void 0===n&&(n=!1),!(!n||null!=t)||Object.values(e).includes(t)},v=function(e,t){return t instanceof e},E=function(e,t,n){return void 0===n&&(n=!1),!(!n||null!=t)||Array.isArray(t)&&t.every((function(t){return y(e,t)}))},I=function(e){return e>0&&_$1.indexOf(e)>=0},S=function(e,t){if(void 0===t&&(t=!1),t&&null===e)return !0;var n=y("object",e)&&null!==e&&e.hasOwnProperty("name")&&"string"==typeof e.name&&e.hasOwnProperty("uri")&&"string"==typeof e.uri&&e.hasOwnProperty("type")&&"string"==typeof e.type;if(!n){if("undefined"!=typeof Blob)return e instanceof Blob;if("undefined"!=typeof File)return e instanceof File}return n},T$1=function(e,t){if(e===t)return !0;if(null==e||null==t)return !1;if(e.length!==t.length)return !1;for(var n=a([],o(e),!1).sort(),r=a([],o(t),!1).sort(),i=0;i<n.length;++i)if(n[i]!==r[i])return !1;return !0},b=function(){function e(e){var t=void 0===e?{}:e,n=t.useMemberInfoInMessage,r=void 0===n||n,i=t.typingIndicatorInvalidateTime,s=void 0===i?1e4:i,o=t.typingIndicatorThrottle,a=void 0===o?1e3:o,u=t.websocketResponseTimeout,c=void 0===u?1e4:u;this._useMemberInfoInMessage=!0,this._typingIndicatorInvalidateTime=1e4,this._typingIndicatorThrottle=1e3,this._websocketResponseTimeout=1e4,this._useMemberInfoInMessage=r,this._typingIndicatorInvalidateTime=s,this._typingIndicatorThrottle=a,this._websocketResponseTimeout=c;}return Object.defineProperty(e.prototype,"useMemberInfoInMessage",{get:function(){return this._useMemberInfoInMessage},set:function(e){y("boolean",e)&&(this._useMemberInfoInMessage=e);},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typingIndicatorInvalidateTime",{get:function(){return this._typingIndicatorInvalidateTime},set:function(e){y("number",e)&&(this._typingIndicatorInvalidateTime=e);},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"typingIndicatorThrottle",{get:function(){return this._typingIndicatorThrottle},set:function(e){y("number",e)&&e>=1e3&&e<=9e3&&(this._typingIndicatorThrottle=e);},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"websocketResponseTimeout",{get:function(){return this._websocketResponseTimeout},set:function(e){y("number",e)&&e>=5e3&&e<=3e4&&(this._websocketResponseTimeout=e);},enumerable:!1,configurable:!0}),e}(),A$1={encrypt:function(e){return e},decrypt:function(e){return e}},C$1=function(){function e(e){var t=e.store;this._preference=new Map,this._store=t;}return e.prototype._savePreferenceKeys=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this._store.set({key:this._keysAddress,value:a([],o(this._preference.keys()),!1),generation:1})];case 1:return e.sent(),[2]}}))}))},e.prototype.init=function(e){var t;return r(this,void 0,void 0,(function(){var n,r,o,a,u,c,l,d;return i(this,(function(i){switch(i.label){case 0:return this._keysAddress=e,[4,this._store.get(e)];case 1:n=null!==(t=i.sent())&&void 0!==t?t:[],i.label=2;case 2:i.trys.push([2,7,8,9]),r=s(n),o=r.next(),i.label=3;case 3:return o.done?[3,6]:(a=o.value,[4,this._store.get(a)]);case 4:(u=i.sent())&&this._preference.set(a,u),i.label=5;case 5:return o=r.next(),[3,3];case 6:return [3,9];case 7:return c=i.sent(),l={error:c},[3,9];case 8:try{o&&!o.done&&(d=r.return)&&d.call(r);}finally{if(l)throw l.error}return [7];case 9:return [2]}}))}))},e.prototype.get=function(e){var t;return r(this,void 0,void 0,(function(){return i(this,(function(n){return [2,null!==(t=this._preference.get(e))&&void 0!==t?t:null]}))}))},e.prototype.set=function(e,t){return r(this,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:return n=!this._preference.has(e),[4,this._store.set({key:e,value:t,generation:1})];case 1:return r.sent(),this._preference.set(e,t),n?[4,this._savePreferenceKeys()]:[3,3];case 2:r.sent(),r.label=3;case 3:return [2]}}))}))},e.prototype.remove=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,this._store.remove(e)];case 1:return t.sent(),this._preference.delete(e),[4,this._savePreferenceKeys()];case 2:return t.sent(),[2]}}))}))},e.prototype.clear=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this._store.removeMany(a([],o(this._preference.keys()),!1))];case 1:return e.sent(),this._preference.clear(),[4,this._savePreferenceKeys()];case 2:return e.sent(),[2]}}))}))},e}(),O=function(e){var t=e.encryption,n=void 0===t?null:t,r=e.store,i=void 0===r?null:r,s=e.localCacheEnabled,o=void 0===s||s;this.nestdb=null,this.store=i,this.preference=new C$1({store:i}),this.encryption=null!=n?n:A$1,this.localCacheEnabled=o;},w=function(){function e(){this.sessionKey=null,this.authToken=null;}return Object.defineProperty(e.prototype,"hasSession",{get:function(){return !!this.sessionKey},enumerable:!1,configurable:!0}),e.prototype.clear=function(){this.authToken=null,this.sessionKey=null;},e}(),R=function(){var e=(new Date).getTime();return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(t){var n=(e+16*Math.random())%16|0;return e=Math.floor(e/16),("x"===t?n:3&n|8).toString(16)}))},D=function(){function e(e){var t=e.container;this._container={},this._container=t,this.key=R();}return e.prototype._register=function(e,t,n){return e in this._container||(this._container[e]=new Map),this._container[e].set(this.key,{occurence:t,handler:n}),this},e.prototype.on=function(e,t){return this._register(e,-1,t)},e.prototype.once=function(e,t){return this._register(e,1,t)},e.prototype.close=function(){for(var e in this._container)this._container[e].delete(this.key);},e}(),M=function(){function e(){this._container={};}return e.prototype.on=function(e,t){return new D({container:this._container}).on(e,t)},e.prototype.once=function(e,t){return new D({container:this._container}).once(e,t)},e.prototype.dispatch=function(e,t){var n,r,i=this._container[e];if(i){var o=[];try{for(var a=s(i.keys()),u=a.next();!u.done;u=a.next()){var c=u.value,l=i.get(c);l.handler(t),l.occurence>0&&(l.occurence--,0===l.occurence&&o.push(c));}}catch(e){n={error:e};}finally{try{u&&!u.done&&(r=a.return)&&r.call(a);}finally{if(n)throw n.error}}o.forEach((function(e){return i.delete(e)}));}},e}(),k=function(){function e(){this._dispatcher=new M;}return e.prototype.on=function(e){return this._dispatcher.on("event",e)},e.prototype.once=function(e){return this._dispatcher.once("event",e)},e.prototype.dispatch=function(e){this._dispatcher.dispatch("event",e);},e}(),L=function(){},U$1=function(e){var t={};return e&&Object.keys(e).forEach((function(n){void 0!==e[n]&&NaN!==e[n]&&null!==e[n]&&(t[n]=e[n]);})),t};!function(e){e.GET="GET",e.POST="POST",e.PUT="PUT",e.DELETE="DELETE";}(d$1||(d$1={}));var P,q=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.params={},t.requireAuth=!0,t.headers={},t.requestId=R(),t}return t(n,e),n.prototype.stringifyParams=function(e){return "object"!=typeof e||Array.isArray(e)?String(e):e?JSON.stringify(e):""},n.prototype.encodeParams=function(e){var t=this;return null==e||""===e?encodeURIComponent(""):Array.isArray(e)?e.map((function(e){return t.encodeParams(e)})).join(","):"object"==typeof e?encodeURIComponent(JSON.stringify(e)):encodeURIComponent(String(e))},Object.defineProperty(n.prototype,"query",{get:function(){var e=this,t=U$1(this.params);return "?".concat(Object.keys(t).map((function(n){return "".concat(encodeURIComponent(n),"=").concat(e.encodeParams(t[n]))})).join("&"))},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"payload",{get:function(){var e=this,t=U$1(this.params);if(Object.keys(t).some((function(e){return S(t[e])}))){var n=new FormData;return Object.keys(t).forEach((function(r){var i,s=t[r];if(S(s)){var o=s;n.append(r,o,null!==(i=o.name)&&void 0!==i?i:"filename");}else n.append(r,e.stringifyParams(s));})),n}return JSON.stringify(t)},enumerable:!1,configurable:!0}),n}(L),x=function(e){function r(t,n){var r=e.call(this)||this;return r._iid=t,r._payload=n,r}return t(r,e),Object.defineProperty(r.prototype,"payload",{get:function(){return n({},this._payload)},enumerable:!1,configurable:!0}),r.prototype.as=function(e){return new e(this._iid,this.payload)},r}(L),F=function(e){function n(t){var n=e.call(this)||this;return n.requestId=t,n}return t(n,e),n}(L),G=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n}(L),Q=function(e){function n(t){var n=e.call(this)||this;return n.statLog=t,n}return t(n,e),n}(L);!function(e){e.WEBSOCKET_CONNECT="ws:connect",e.API_RESULT="api:result";}(P||(P={}));var j,K=function(){function e(e){var t=e.type,n=e.data,r=e.ts,i=void 0===r?Date.now():r;this.type=t,this.createdAt=i,this.data=n;}return e.payloadify=function(e){return U$1({stat_type:e.type,ts:e.createdAt,data:U$1(e.data)})},e}(),z=function(){return "undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"==navigator.product},V=function(){function e(e,t){var n=t.auth,r=t.sdkState,i=t.dispatcher,s=t.logger,o=this;this._abortControl=new Map,this._iid=e,this._auth=n,this._sdkState=r,this._dispatcher=i,this._dispatcher.on((function(e){e instanceof F&&o.cancel(e.requestId);})),this._logger=s;}return Object.defineProperty(e.prototype,"_userAgentWithExtension",{get:function(){var e=this._sdkState.extensions,t=z()?"reactnative":"JS",n=e.sb_syncmanager?"s".concat(e.sb_syncmanager):"",r=e.sb_uikit?"u".concat(e.sb_uikit):"",i=e["device-os-platform"]?"o".concat(e["device-os-platform"]):"";return "".concat(t,"/c").concat(l$1.SDK_VERSION,"/").concat(n,"/").concat(r,"/").concat(i)},enumerable:!1,configurable:!0}),e.prototype._createHeader=function(e,t){void 0===t&&(t=null);var r=this._sdkState,i=r.appId,s=r.appVersion,o=n(n({},e.headers),{SendBird:"JS,".concat(l$1.OS_VERSION,",").concat(l$1.SDK_VERSION,",").concat(i).concat(s?",".concat(s):""),"SB-User-Agent":encodeURIComponent(this._userAgentWithExtension),"Request-Sent-Timestamp":Date.now().toString()});return t||(o["Content-Type"]="application/json; charset=utf-8"),e.requireAuth&&this._auth.hasSession&&(o["Session-Key"]=this._auth.sessionKey),this._auth&&this._auth.authToken&&(o["App-Id"]=i,o["Access-Token"]=this._auth.authToken),o},e.prototype._statLogApiResult=function(e,t,n){this._dispatcher.dispatch(new Q(new K({type:P.API_RESULT,data:{endpoint:e.path,method:e.method,success:!n,latency:Date.now()-t,error_code:null==n?void 0:n.code,error_description:null==n?void 0:n.message}})));},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a,u,c,l,h,f,_,g,y,m;return i(this,(function(i){switch(i.label){case 0:t=e.path,n=e.method,r=![d$1.GET,d$1.DELETE].includes(n),s=this._sdkState.api,o="".concat(s.host).concat(t).concat(r?"":e.query),a=r?e.payload:null,u=this._createHeader(e,a instanceof FormData?a:null),c=new AbortController,l=c.signal,this._abortControl.set(e.requestId,c),h=Date.now(),i.label=1;case 1:return i.trys.push([1,4,,5]),[4,fetch(o,{method:n,body:a,headers:u,signal:l})];case 2:return [4,(f=i.sent()).json()];case 3:if(_=i.sent(),f.ok||f.redirected)return this._logger.debug("receive api response",e.requestId),this._statLogApiResult(e,h,null),[2,new x(this._iid,_)];throw _?(g=new p(_),!e.requireAuth&&g.isSessionKeyExpiredError&&this._dispatcher.dispatch(new G),this._statLogApiResult(e,h,g),g):(g=p.requestFailed,this._statLogApiResult(e,h,g),g);case 4:throw y=i.sent(),this._statLogApiResult(e,h,y),y instanceof p?(this._logger.debug("fail api request",y),y):"AbortError"===y.name?p.requestCanceled:(m=p.networkError,this._logger.debug("fail api request",m),m);case 5:return [2]}}))}))},e.prototype.cancel=function(e){this._abortControl.has(e)&&(this._abortControl.get(e).abort(),this._abortControl.delete(e));},e.prototype.cancelAll=function(){var e,t;try{for(var n=s(this._abortControl.values()),r=n.next();!r.done;r=n.next()){r.value.abort();}}catch(t){e={error:t};}finally{try{r&&!r.done&&(t=n.return)&&t.call(n);}finally{if(e)throw e.error}}this._abortControl.clear();},e}(),B=function(e){function n(t,n,r,i){void 0===i&&(i="");var s,o=this;return (o=e.call(this)||this)._iid=t,o.code=n,o.payload=r,o.requestId=r?null!==(s=r.req_id)&&void 0!==s?s:i:"",o}return t(n,e),n.createFromRawMessage=function(e,t){var r=t.substring(0,4),i=null;try{i=JSON.parse(t.substring(4));}catch(e){r="NOOP";}finally{return new n(e,r,i)}},n.prototype.convertToMessage=function(){return "".concat(this.code).concat(JSON.stringify(this.payload),"\n")},n.prototype.as=function(e){return new e(this._iid,this.code,this.payload)},n}(L),H$1=function(e){function n(t){var n,r=t.code,i=t.ackRequired,s=t.payload,o=void 0===s?null:s,a=this;return (a=e.call(this)||this).code=r,a.payload=o,a.requestId=null!==(n=a.payload.req_id)&&void 0!==n?n:R(),a.ackRequired=i,a.payload.req_id=a.requestId,a}return t(n,e),n.prototype.convertToMessage=function(){return "".concat(this.code).concat(JSON.stringify(this.payload),"\n")},n}(L),W=function(e){function n(){return e.call(this,{code:"PING",payload:{id:Date.now(),active:1},ackRequired:!1})||this}return t(n,e),n}(H$1),X=function(){function e(e){var t=e.pingDelegate,n=e.sdkState,r=e.logger;this._pingTimer=null,this._pingTimeoutTimer=null,this.pingDelegate=t,this.sdkState=n,this._logger=r;}return Object.defineProperty(e.prototype,"isWaiting",{get:function(){return !!this._pingTimeoutTimer},enumerable:!1,configurable:!0}),e.prototype.ping=function(){var e,t=this,n=new W;try{var r=null!==(e=this.sdkState.websocket.pongTimeout)&&void 0!==e?e:5e3;this._pingTimeoutTimer=setTimeout((function(){t._logger.debug("pinger.ping() timeout"),t.pingDelegate.error(null);}),r),this.pingDelegate.send(n),this._logger.debug("pinger.ping()");}catch(e){this._logger.debug("pinger.ping() error",e),this._pingTimeoutTimer&&(clearTimeout(this._pingTimeoutTimer),this._pingTimeoutTimer=null),this.pingDelegate.error(null);}return n},e.prototype.pong=function(){this._logger.debug("pinger.pong()"),this._pingTimeoutTimer&&(clearTimeout(this._pingTimeoutTimer),this._pingTimeoutTimer=null);},e.prototype.refreshTimer=function(){var e,t=this;this._logger.debug("pinger.refreshTimer()");var n=null!==(e=this.sdkState.websocket.pingInterval)&&void 0!==e?e:15e3;this.stop(),this._pingTimer=setInterval((function(){t.ping();}),n);},e.prototype.start=function(){this._logger.debug("pinger.start()"),this.refreshTimer(),this.ping();},e.prototype.stop=function(){this._logger.debug("pinger.stop()"),this._pingTimer&&(clearInterval(this._pingTimer),this._pingTimer=null),this._pingTimeoutTimer&&(clearTimeout(this._pingTimeoutTimer),this._pingTimeoutTimer=null);},e}(),Y=function(){};!function(e){e.CONNECTING="CONNECTING",e.OPEN="OPEN",e.CLOSED="CLOSED";}(j||(j={}));var J,Z=function(e){function n(t,n){var r=n.sdkState,i=n.dispatcher,s=n.logger,o=e.call(this)||this;return o._pinger=null,o.lastActive=0,o._iid=t,o._sdkState=r,o._dispatcher=i,o._logger=s,o._sdkState.websocket.pingerDisabled||(o._pinger=new X({pingDelegate:{send:function(e){return o.send(e)},error:function(e){return o.error(e)}},sdkState:o._sdkState,logger:s})),o}return t(n,e),Object.defineProperty(n.prototype,"connectionState",{get:function(){if(this._ws)switch(this._ws.readyState){case 0:return j.CONNECTING;case 1:return j.OPEN}return j.CLOSED},enumerable:!1,configurable:!0}),n.prototype.connect=function(e){var t=this;this._ws=new WebSocket(e),this._ws.onopen=function(){t._logger.debug("websocket open"),t.dispatch("open");},this._ws.onmessage=function(e){e.data.split("\n").forEach((function(e){if(e&&y("string",e)){var n=B.createFromRawMessage(t._iid,e);t._logger.debug("receive websocket event",n),"LOGI"===n.code?(n.payload&&!n.payload.error&&t._pinger&&t._pinger.start(),t.dispatch("message",n)):"PONG"===n.code?t._pinger&&t._pinger.pong():"EXPR"===n.code?n.payload&&n.payload.expires_in>=0&&t._dispatcher.dispatch(new G):"NOOP"===n.code||t.dispatch("message",n);}}));},this._ws.onerror=function(){t._logger.debug("websocket error"),t._pinger&&t._pinger.stop(),t.dispatch("error",p.networkError);},this._ws.onclose=function(){t._logger.debug("websocket close"),t._pinger&&t._pinger.stop(),t.dispatch("close");},this.lastActive=Date.now();},n.prototype.disconnect=function(){var e=this;this._logger.debug("websocket disconnect"),this._pinger&&this._pinger.stop(),this._ws&&(this._ws.onopen=Y,this._ws.onmessage=Y,this._ws.onerror=Y,this._ws.onclose=function(){e.dispatch("close");},this._ws.close(),this._ws=null);},n.prototype.send=function(e){if(!this._ws)throw p.connectionClosed;"PING"!==e.code?this._pinger&&this._pinger.refreshTimer():this._logger.debug("send ping",e),this._ws.send(e.convertToMessage());},n.prototype.error=function(e){this._logger.debug("websocket error",e),this._pinger&&this._pinger.stop(),this.dispatch("error",e);},n}(M),$=function(e){function n(t){var n=t.all,r=t.custom_types,i=t.ts,s=e.call(this)||this;return s.all=n,s.customTypes=r,s.ts=i,s}return t(n,e),n}(L),ee=function(){var e=this;this.promise=new Promise((function(t,n){e.resolve=t,e.reject=n;}));},te=function(){function e(e,t){var n=t.auth,r=t.sdkState,i=t.dispatcher,s=t.logger,o=this;this._ackStateMap=new Map,this._sdkState=r,this._dispatcher=i,this._logger=s,this.apiClient=new V(e,{auth:n,sdkState:r,dispatcher:i,logger:s}),this.websocketClient=new Z(e,{sdkState:r,dispatcher:i,logger:s}),this.websocketClient.on("message",(function(e){if(e.payload.unread_cnt&&o._dispatcher.dispatch(new $(e.payload.unread_cnt)),e.requestId){if(o._ackStateMap.has(e.requestId)){var t=o._ackStateMap.get(e.requestId);"EROR"!==e.code?t.resolve(e):t.reject(new p({code:e.payload.code,message:e.payload.message}));}}else o._dispatcher.dispatch(e);})).on("close",(function(){o._ackStateMap.forEach((function(e){e.reject(p.connectionClosed);})),o._ackStateMap.clear();}));}return e.prototype._sendApiRequest=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,this.apiClient.send(e)];case 1:return [2,t.sent()]}}))}))},e.prototype._sendWebsocketRequest=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s=this;return i(this,(function(i){if(t=new ee,e.ackRequired){n=null,r=function(r,i){void 0===r&&(r=null),void 0===i&&(i=null),s._ackStateMap.has(e.requestId)&&(s._ackStateMap.delete(e.requestId),n&&(clearTimeout(n),n=null),r?(s._logger.debug("fail websocket request",r),t.reject(r)):(s._logger.debug("receive websocket ack",e.requestId),t.resolve(i)));};try{n=setTimeout((function(){return r(p.noAckTimeout)}),this._sdkState.websocket.responseTimeout),this._ackStateMap.set(e.requestId,{resolve:function(e){return r(null,e)},reject:function(e){return r(e)}}),this.websocketClient.send(e);}catch(e){r(e);}}else try{this.websocketClient.send(e),t.resolve(null);}catch(e){t.reject(e);}return [2,t.promise]}))}))},e.prototype.send=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return e instanceof q?[4,this._sendApiRequest(e)]:[3,2];case 1:case 3:return [2,t.sent()];case 2:return e instanceof H$1?[4,this._sendWebsocketRequest(e)]:[3,4];case 4:throw p.invalidParameters}}))}))},e.prototype.cancel=function(e){this.apiClient.cancel(e);},e.prototype.cancelAll=function(){this.apiClient.cancelAll();},e}();!function(e){e[e.NONE=0]="NONE",e[e.INITIALIZED=1]="INITIALIZED",e[e.CONNECTING=2]="CONNECTING",e[e.CONNECTED=3]="CONNECTED",e[e.RECONNECTING=4]="RECONNECTING",e[e.DISCONNECTED=5]="DISCONNECTED",e[e.LOGOUT=6]="LOGOUT";}(J||(J={}));var ne,re,ie,se,oe,ae,ue$1,ce$1,le$1,de$1=function(e){function n(t){var n=t.stateType,r=e.call(this)||this;return r.stateType=n,r}return t(n,e),n}(L),he$1=function(){function e(e,t){var n=t.auth,s=t.sdkState,o=t.dispatcher,a=t.logger,u=this;this._currentConnectionStateType=J.INITIALIZED,this._lazyCallQueue=[],this.commandRouter=new te(e,{auth:n,sdkState:s,dispatcher:o,logger:a}),this._auth=n,this._logger=a,this._dispatcher=o,this._dispatcher.on((function(e){if(e instanceof de$1){var t=e.stateType;switch(u._currentConnectionStateType=t,t){case J.CONNECTED:var n=u._lazyCallQueue;u._lazyCallQueue=[],n.forEach((function(e){return r(u,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:t=e.command,n=e.deferred,r=e.timeout,clearTimeout(r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.send(t)];case 2:return s=i.sent(),n.resolve(s),[3,4];case 3:return o=i.sent(),n.reject(o),[3,4];case 4:return [2]}}))}))}));break;case J.INITIALIZED:case J.DISCONNECTED:case J.LOGOUT:n=u._lazyCallQueue;u._lazyCallQueue=[],n.forEach((function(e){return r(u,void 0,void 0,(function(){var t,n;return i(this,(function(r){return t=e.deferred,n=e.timeout,clearTimeout(n),this._auth&&this._auth.hasSession?t.reject(p.connectionClosed):t.reject(p.connectionRequired),[2]}))}))}));}}}));}return Object.defineProperty(e.prototype,"isReady",{get:function(){return this._currentConnectionStateType===J.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLazyCallActivated",{get:function(){return this._currentConnectionStateType===J.CONNECTING||this._currentConnectionStateType===J.RECONNECTING},enumerable:!1,configurable:!0}),e.prototype.send=function(e){return r(this,void 0,void 0,(function(){var t,n,r=this;return i(this,(function(i){switch(i.label){case 0:return e instanceof H$1?this.isReady?(this._logger.debug("send websocket request",e),[4,this.commandRouter.send(e)]):[3,2]:[3,4];case 1:case 5:return [2,i.sent()];case 2:if(this.isLazyCallActivated)return this._logger.debug("wait websocket request",e),t=new ee,this._lazyCallQueue.push({command:e,deferred:t,timeout:setTimeout((function(){return r.timeout(e.requestId)}),1e4)}),[2,t.promise];throw this._logger.debug("fail websocket request"),p.connectionRequired;case 3:return [3,7];case 4:return e instanceof q?this._auth.hasSession?(this._logger.debug("send api request",e),[4,this.commandRouter.send(e)]):[3,6]:[3,7];case 6:if(this.isLazyCallActivated)return this._logger.debug("wait api request",e),t=new ee,this._lazyCallQueue.push({command:e,deferred:t,timeout:setTimeout((function(){return r.timeout(e.requestId)}),1e4)}),[2,t.promise];throw n=p.connectionRequired,this._logger.debug("fail api request",n),n;case 7:return [2]}}))}))},e.prototype.forceSend=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._logger.debug("send forced request",e),[4,this.commandRouter.send(e)];case 1:return [2,t.sent()]}}))}))},e.prototype.timeout=function(e){this._logger.debug("timeout request",e);var t=this._lazyCallQueue.findIndex((function(t){return t.command.requestId===e}));t>-1&&(this._lazyCallQueue[t].deferred.reject(p.connectionRequired),this._lazyCallQueue.splice(t,1));},e.prototype.cancel=function(e){this._logger.debug("cancel api request",e),this.commandRouter.cancel(e);},e.prototype.cancelAll=function(){this._logger.debug("cancel all api requests"),this.commandRouter.cancelAll();},e}(),pe$1="/".concat("v3","/users"),fe$1="/".concat("v3","/storage/file"),_e$1="/".concat("v3","/group_channels"),ge$1="/".concat("v3","/sdk/group_channels"),ye$1="/".concat("v3","/open_channels"),me$1="/".concat("v3","/sdk/open_channels"),ve$1="/".concat("v3","/search"),Ee$1="/".concat("v3","/report"),Te$1="/".concat("v3","/scheduled_messages"),be$1="/".concat("v3","/sdk/statistics"),Ne$1=function(e){function n(t){var n=t.userId,r=t.authToken,i=t.expiringSession,s=void 0===i||i,o=e.call(this)||this;return o.path="".concat(pe$1,"/").concat(n,"/session_key"),o.method=d$1.POST,o.params={token:r,expiring_session:!!s},o.requireAuth=!1,o}return t(n,e),n}(q),Ae$1=function(e){function n(t){var n=t.authToken,r=t.expiringSession,i=void 0===r||r;return e.call(this,{code:"LOGI",payload:{token:n,expiring_session:i?1:0},ackRequired:!0})||this}return t(n,e),n}(H$1),Ce$1=function(e){function n(t,n){var r=e.call(this,t,n)||this,i=n.key;return r.key=i,r}return t(n,e),n}(x),Oe$1=function(e){function n(t,n,r){var i=e.call(this,t,"LOGI",r)||this;return i.error=null,i.newKey=r.new_key,i.error=r.error?new p(r.error):null,i}return t(n,e),n}(B),we$1=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return t(n,e),n}(L),Re$1=function(e){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){return [2,new Promise((function(t){return setTimeout(t,e)}))]}))}))},De$1=function(){function e(){}return e.prototype.calcTimeout=function(){return 0},e}(),Me$1=function(e,t,n){return void 0===n&&(n=new De$1),r(void 0,void 0,void 0,(function(){var r,s,o,a,u,c;return i(this,(function(i){switch(i.label){case 0:r=0,s=null,o=function(e){return void 0===e&&(e=null),s=null!=e?e:new Error("Halted")},a=function(){r=0;},i.label=1;case 1:if(!(-1===t||r<t))return [3,9];i.label=2;case 2:return i.trys.push([2,4,,8]),[4,e(o,a)];case 3:if(u=i.sent(),s)throw s;return [2,u];case 4:if(c=i.sent(),s)return [3,6];if(++r===t)throw c;return [4,Re$1(n.calcTimeout(r))];case 5:return i.sent(),[3,7];case 6:throw s;case 7:return [3,8];case 8:return [3,1];case 9:return [2]}}))}))},ke$1=function(e){return r(void 0,void 0,void 0,(function(){var t;return i(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,e()];case 1:return n.sent(),[3,3];case 2:if(!((t=n.sent())instanceof p))throw t;return t.throwOutside(),[3,3];case 3:return [2]}}))}))},Le$1=function(e){return r(void 0,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,e()];case 1:case 2:return t.sent(),[3,3];case 3:return [2]}}))}))},Ue$1=function(e){function n(t){var n=t.auth,r=t.sdkState,i=t.dispatcher,s=t.requestQueue,o=t.logger,a=e.call(this)||this;return a._currentConnectionStateType=J.INITIALIZED,a._isRefreshingAuthToken=!1,a._isRefreshingSessionKey=!1,a.auth=n,a._sdkState=r,a._dispatcher=i,a._requestQueue=s,a._logger=o,a._dispatcher.on((function(e){if(e instanceof de$1){var t=e.stateType;a._currentConnectionStateType=t;}else e instanceof G&&a.handler&&(a._logger.debug("session expired"),a.handler.onSessionExpired(),a.refresh());})),a}return t(n,e),n.prototype.createRefreshWebsocketCommand=function(e){return new Ae$1({authToken:e,expiringSession:!0})},n.prototype._refreshSessionKeyByWebSocket=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return t=this.createRefreshWebsocketCommand(e),[4,this._requestQueue.forceSend(t)];case 1:if(n=i.sent(),r=n.as(Oe$1),s=r.newKey,o=r.error)throw o;return this.auth.sessionKey=null!=s?s:this.auth.sessionKey,[2]}}))}))},n.prototype._refreshSessionKeyByApi=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(s){switch(s.label){case 0:return t=new Ne$1({userId:this._sdkState.userId,authToken:e,expiringSession:!0}),[4,Me$1((function(e){return r(n,void 0,void 0,(function(){var n,r,s;return i(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this._requestQueue.forceSend(t)];case 1:return n=i.sent(),r=n.as(Ce$1).key,this.auth.sessionKey=r,[3,3];case 2:if(s=i.sent(),!this._isSessionRelatedError(s))throw s;return e(s),[3,3];case 3:return [2]}}))}))}),3)];case 1:return s.sent(),[2]}}))}))},n.prototype._refreshSessionKey=function(e,t){return void 0===t&&(t=!0),r(this,void 0,void 0,(function(){var n,r,s,o;return i(this,(function(i){switch(i.label){case 0:if(this._currentConnectionStateType!==J.CONNECTED)return [3,9];i.label=1;case 1:return i.trys.push([1,3,,9]),[4,this._refreshSessionKeyByWebSocket(e)];case 2:return i.sent(),this.complete(),[2];case 3:return n=i.sent(),this._isSessionRelatedError(n)?t?(r=this.auth,[4,this._receiveNewAuthToken()]):[3,8]:[3,8];case 4:return r.authToken=i.sent(),this.auth.authToken?[4,this._refreshSessionKey(this.auth.authToken,!1)]:[3,6];case 5:return i.sent(),this.complete(),[3,7];case 6:this.close(),i.label=7;case 7:return [2];case 8:return [3,9];case 9:return i.trys.push([9,11,,20]),[4,this._refreshSessionKeyByApi(e)];case 10:return i.sent(),this.complete(),[3,20];case 11:return s=i.sent(),this._isSessionRelatedError(s)?t?(o=this.auth,[4,this._receiveNewAuthToken()]):[3,16]:[3,18];case 12:return o.authToken=i.sent(),this.auth.authToken?[4,this._refreshSessionKeyByApi(this.auth.authToken)]:[3,14];case 13:return i.sent(),this.complete(),[3,15];case 14:this.close(),i.label=15;case 15:return [3,17];case 16:throw s;case 17:return [3,19];case 18:throw s;case 19:return [3,20];case 20:return [2]}}))}))},n.prototype._receiveNewAuthToken=function(){var e=this,t=new ee;return ke$1((function(){return r(e,void 0,void 0,(function(){var e=this;return i(this,(function(n){return this._isRefreshingAuthToken=!0,this.auth.clear(),this.handler.onSessionTokenRequired((function(n){e._isRefreshingAuthToken=!1,e.dispatch("refresh-authtoken"),t.resolve(n);}),(function(n){e._isRefreshingAuthToken=!1,t.reject(n);})),[2]}))}))})),t.promise},n.prototype._isSessionRelatedError=function(e){return e instanceof p&&(e.isSessionKeyExpiredError||e.isSessionTokenExpiredError)},Object.defineProperty(n.prototype,"isSessionKeyRefreshing",{get:function(){return this._isRefreshingSessionKey},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRefreshingAuthToken",{get:function(){return this._isRefreshingAuthToken},enumerable:!1,configurable:!0}),n.prototype.complete=function(){var e=this;this.dispatch("refresh"),ke$1((function(){return r(e,void 0,void 0,(function(){return i(this,(function(e){return this._logger.debug("session refreshed"),this.handler.onSessionRefreshed(),[2]}))}))}));},n.prototype.error=function(e){var t=this;ke$1((function(){return r(t,void 0,void 0,(function(){return i(this,(function(t){return this.handler.onSessionError(e),[2]}))}))}));},n.prototype.close=function(){var e=this;this.dispatch("close"),ke$1((function(){return r(e,void 0,void 0,(function(){return i(this,(function(e){return this._logger.debug("session closed"),this.handler.onSessionClosed(),[2]}))}))}));},n.prototype.refresh=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:if(!this.handler)return [3,7];if(this._isRefreshingSessionKey)return [3,7];if(this._isRefreshingSessionKey=!0,this.auth.authToken)return [3,4];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this._receiveNewAuthToken()];case 2:return (e=n.sent())?(this._logger.debug("session refreshing.."),this.auth.authToken=e,[3,4]):(this.close(),this._isRefreshingSessionKey=!1,[2]);case 3:throw n.sent(),t=p.sessionTokenRequestFailed,this._dispatcher.dispatch(new we$1),this.error(t),this._isRefreshingSessionKey=!1,t;case 4:return n.trys.push([4,6,,7]),[4,this._refreshSessionKey(this.auth.authToken)];case 5:return n.sent(),this._isRefreshingSessionKey=!1,[3,7];case 6:throw n.sent(),t=p.sessionTokenRefreshFailed,this._dispatcher.dispatch(new we$1),this.error(t),this._isRefreshingSessionKey=!1,t;case 7:return [2]}}))}))},n}(M),Pe$1=function(){function e(){this.type=J.NONE,this.name="none";}return e.prototype.run=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(e){return [2]}))}))},e.prototype.onConnect=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(e){return [2]}))}))},e.prototype.onReconnect=function(e,t){return t.resetReconnectCount,r(this,void 0,void 0,(function(){return i(this,(function(e){return [2]}))}))},e.prototype.onDisconnect=function(e,t){return t.error,t.autoReconnect,r(this,void 0,void 0,(function(){return i(this,(function(e){return [2]}))}))},e.prototype.onLogout=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(e){return [2]}))}))},e}(),qe$1=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=J.LOGOUT,t.name="logout",t}return t(n,e),n.prototype.run=function(e){return r(this,void 0,void 0,(function(){var t,n=this;return i(this,(function(s){switch(s.label){case 0:return t=e.sdkState.userId,e.logout(),ke$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(n){return e.connectionHandlers.forEach((function(e){e.onDisconnected(t);})),[2]}))}))})),[4,e.changeState(new je$1)];case 1:return s.sent(),[2]}}))}))},n}(Pe$1),xe$1=function(e){function n(t){var n=t.autoReconnect,r=e.call(this)||this;return r.type=J.DISCONNECTED,r.name="disconnected",r._autoReconnect=!1,r._autoReconnect=n,r}return t(n,e),n.prototype.run=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return e.disconnect(),this._autoReconnect?[4,e.changeState(new Fe$1)]:[3,2];case 1:t.sent(),t.label=2;case 2:return [2]}}))}))},n.prototype.onConnect=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return e.disconnect(),[4,e.changeState(new Qe$1({authToken:t}))];case 1:return n.sent(),[2]}}))}))},n.prototype.onReconnect=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,e.changeState(new Fe$1)];case 1:return t.sent(),[2]}}))}))},n.prototype.onLogout=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,e.changeState(new qe$1)];case 1:return t.sent(),[2]}}))}))},n}(Pe$1),Fe$1=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=J.RECONNECTING,t.name="reconnecting",t._haltConnect=null,t._resetConnect=null,t._callbacks=[],t}return t(n,e),n.prototype.flushCallbacks=function(e){void 0===e&&(e=null),this._callbacks.forEach((function(t){return t(e)}));},n.prototype.run=function(e){return r(this,void 0,void 0,(function(){var t,n,s,o,a,c=this;return i(this,(function(l){switch(l.label){case 0:t=new ee,this._callbacks.push((function(e){return e?t.reject(e):t.resolve()})),ke$1((function(){return r(c,void 0,void 0,(function(){return i(this,(function(t){return e.connectionHandlers.forEach((function(e){e.onReconnectStarted();})),[2]}))}))})),l.label=1;case 1:return l.trys.push([1,4,,9]),n=e.sdkState.websocket,s=n.reconnectMaxRetry,o=n.reconnectRetryStrategy,[4,Me$1((function(t,n){return r(c,void 0,void 0,(function(){var r;return i(this,(function(i){switch(i.label){case 0:this._haltConnect=t,this._resetConnect=n,i.label=1;case 1:return i.trys.push([1,3,,4]),[4,e.connect()];case 2:return i.sent(),[3,4];case 3:if((r=i.sent())instanceof p&&r.code===u.CONNECTION_CANCELED)return t(r),[2];throw r;case 4:return [2]}}))}))}),s,o)];case 2:return l.sent(),[4,e.changeState(new Ge$1)];case 3:return l.sent(),ke$1((function(){return r(c,void 0,void 0,(function(){return i(this,(function(t){return e.connectionHandlers.forEach((function(e){e.onReconnectSucceeded();})),this.flushCallbacks(null),[2]}))}))})),[3,9];case 4:return a=l.sent(),h$1(a)?[3,7]:a instanceof p?a.code===u.CONNECTION_CANCELED?[3,6]:[4,e.changeState(new xe$1({autoReconnect:!1}))]:[3,6];case 5:l.sent(),l.label=6;case 6:return ke$1((function(){return r(c,void 0,void 0,(function(){return i(this,(function(t){return e.connectionHandlers.forEach((function(e){e.onReconnectFailed();})),this.flushCallbacks(a),[2]}))}))})),[3,8];case 7:throw a;case 8:return [3,9];case 9:return [2,t.promise]}}))}))},n.prototype.onConnect=function(e,t){return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=new ee,this._resetConnect&&this._resetConnect(),e.cancelConnectForRetry(),this._callbacks.push((function(e){return e?t.reject(e):t.resolve()})),[2,t.promise]}))}))},n.prototype.onReconnect=function(e,t){var n=t.resetReconnectCount,s=void 0!==n&&n;return r(this,void 0,void 0,(function(){var t;return i(this,(function(n){return t=new ee,this._resetConnect&&s&&this._resetConnect(),e.cancelConnectForRetry(),this._callbacks.push((function(e){return e?t.reject(e):t.resolve()})),[2,t.promise]}))}))},n.prototype.onDisconnect=function(e,t){var n=t.error,s=void 0===n?null:n,o=t.autoReconnect,a=void 0===o||o;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._haltConnect&&this._haltConnect(null!=s?s:p.connectionCanceled),[4,e.changeState(new xe$1({autoReconnect:a}))];case 1:return t.sent(),[2]}}))}))},n.prototype.onLogout=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._haltConnect&&this._haltConnect(p.connectionCanceled),[4,e.changeState(new qe$1)];case 1:return t.sent(),[2]}}))}))},n}(Pe$1),Ge$1=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=J.CONNECTED,t.name="connected",t}return t(n,e),n.prototype.onReconnect=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return e.disconnect(),[4,e.changeState(new Fe$1)];case 1:return t.sent(),[2]}}))}))},n.prototype.onDisconnect=function(e,t){var n=t.autoReconnect;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,e.changeState(new xe$1({autoReconnect:n}))];case 1:return t.sent(),[2]}}))}))},n.prototype.onLogout=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,e.changeState(new qe$1)];case 1:return t.sent(),[2]}}))}))},n}(Pe$1),Qe$1=function(e){function n(t){var n=t.authToken,r=e.call(this)||this;return r.type=J.CONNECTING,r.name="connecting",r._authToken="",r._haltConnect=null,r._callbacks=[],r._authToken=n,r}return t(n,e),n.prototype.flushCallbacks=function(e){void 0===e&&(e=null),this._callbacks.forEach((function(t){return t(e)}));},n.prototype.run=function(e){return r(this,void 0,void 0,(function(){var t,n,s=this;return i(this,(function(o){switch(o.label){case 0:t=new ee,this._callbacks.push((function(e){return e?t.reject(e):t.resolve()})),o.label=1;case 1:return o.trys.push([1,4,,9]),[4,Me$1((function(t){return r(s,void 0,void 0,(function(){var n;return i(this,(function(r){switch(r.label){case 0:this._haltConnect=t,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.connect(this._authToken)];case 2:return r.sent(),[3,4];case 3:if((n=r.sent())instanceof p&&n.code===u.CONNECTION_CANCELED)return t(n),[2];throw n;case 4:return [2]}}))}))}),e.sdkState.websocket.connectMaxRetry)];case 2:return o.sent(),[4,e.changeState(new Ge$1)];case 3:return o.sent(),ke$1((function(){return r(s,void 0,void 0,(function(){return i(this,(function(t){return e.connectionHandlers.forEach((function(t){t.onConnected(e.sdkState.userId);})),this.flushCallbacks(null),[2]}))}))})),[3,9];case 4:return n=o.sent(),h$1(n)?[3,7]:(e.disconnect(),n instanceof p?n.code===u.CONNECTION_CANCELED?[3,6]:[4,e.changeState(new je$1)]:[3,6]);case 5:o.sent(),o.label=6;case 6:return ke$1((function(){return r(s,void 0,void 0,(function(){return i(this,(function(e){return this.flushCallbacks(n),[2]}))}))})),[3,8];case 7:throw n;case 8:return [3,9];case 9:return [2,t.promise]}}))}))},n.prototype.onConnect=function(e){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){return e=new ee,this._callbacks.push((function(t){return t?e.reject(t):e.resolve()})),[2,e.promise]}))}))},n.prototype.onDisconnect=function(e,t){var n=t.error,s=void 0===n?null:n;return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._haltConnect&&this._haltConnect(null!=s?s:p.connectionCanceled),[4,e.changeState(new qe$1)];case 1:return t.sent(),[2]}}))}))},n.prototype.onLogout=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._haltConnect&&this._haltConnect(p.connectionCanceled),[4,e.changeState(new qe$1)];case 1:return t.sent(),[2]}}))}))},n}(Pe$1),je$1=function(e){function n(){var t=null!==e&&e.apply(this,arguments)||this;return t.type=J.INITIALIZED,t.name="initialized",t}return t(n,e),n.prototype.onConnect=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){switch(n.label){case 0:return [4,e.changeState(new Qe$1({authToken:t}))];case 1:return n.sent(),[2]}}))}))},n}(Pe$1),Ke$1=new Map,ze$1=function(e,t){var n;return void 0===t&&(t=null),null!==t&&Ke$1.set(e,t),null!==(n=Ke$1.get(e))&&void 0!==n?n:""},Ve$1=function(e){void 0===e&&(e={}),this.emojiHash=e.emoji_hash||"",this.uploadSizeLimit=e.file_upload_size_limit?1048576*e.file_upload_size_limit:Number.MAX_VALUE,this.useReaction=!!e.use_reaction,this.applicationAttributes=e.application_attributes||[],this.premiumFeatureList=e.premium_feature_list||[];},Be$1=function(){function e(e){this._iid="",this._iid=e;}return e.payloadify=function(e){return e?{}:null},e}(),He$1=function(e){function n(t){var n=t.userId,r=t.metadata,i=e.call(this)||this;return i.method=d$1.POST,i.path="".concat(pe$1,"/").concat(n,"/metadata"),i.params={metadata:r},i}return t(n,e),n}(q);!function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.metadata=n,r}t(n,e);}(x),function(e){e.BASE="base",e.GROUP="group",e.OPEN="open";}(ne||(ne={})),function(e){e.OPERATOR="operator",e.NONE="none";}(re||(re={})),function(e){e.BASE="base",e.USER="user",e.FILE="file",e.ADMIN="admin";}(ie||(ie={})),function(e){e.ALL="",e.USER="MESG",e.FILE="FILE",e.ADMIN="ADMM";}(se||(se={})),function(e){e.USER="MESG",e.FILE="FILE",e.ADMIN="ADMM";}(oe||(oe={})),function(e){e.USERS="users",e.CHANNEL="channel";}(ae||(ae={})),function(e){e.ALL="all",e.NONE="none",e.ONLY_REPLY_TO_CHANNEL="only_reply_to_channel";}(ue$1||(ue$1={})),function(e){e.DEFAULT="default",e.SUPPRESS="suppress";}(ce$1||(ce$1={})),function(e){e.PENDING="pending",e.SCHEDULED="scheduled",e.SUCCEEDED="succeeded",e.FAILED="failed",e.CANCELED="canceled";}(le$1||(le$1={}));var We$1=function(e){switch(e){case ne.GROUP:return _e$1;case ne.OPEN:return ye$1;default:return null}},Xe$1=function(e){switch(e){case ne.GROUP:return "".concat(Ee$1,"/group_channels");case ne.OPEN:return "".concat(Ee$1,"/open_channels");default:return null}},Ye$1=function(e,t,n){var r,i;switch(e){case ae.CHANNEL:return !0;case ae.USERS:if(t)try{for(var o=s(t),a=o.next();!a.done;a=o.next()){if(a.value===n)return !0}}catch(e){r={error:e};}finally{try{a&&!a.done&&(i=o.return)&&i.call(o);}finally{if(r)throw r.error}}}return !1},Je$1=function(e,t,n){var r=Ye$1(e.mentionType,e.mentionedUserIds,n),i=Ye$1(t.mentionType,t.mentionedUserIds,n);return !r&&i?1:r&&!i?-1:0},Ze$1=function(e){function n(t){var n=this,r=t.channelUrl,i=t.channelType,s=t.metadata;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={metadata:s,include_ts:!0},n}return t(n,e),n}(q),$e$1=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.metaData=null!=n?n:{},r}return t(n,e),n}(x),et$1=function(e){function n(t){var n=t.userId,r=t.metadata,i=t.upsert,s=e.call(this)||this;return s.method=d$1.PUT,s.path="".concat(pe$1,"/").concat(n,"/metadata"),s.params={metadata:r,upsert:i},s}return t(n,e),n}(q),tt$1=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.metadata=n,r}return t(n,e),n}(x),nt$1=function(e){function n(t){var n=t.userId,r=t.metadataKey,i=e.call(this)||this;return i.method=d$1.DELETE,i.path="".concat(pe$1,"/").concat(n,"/metadata/").concat(r),i}return t(n,e),n}(q);!function(e){function n(){return null!==e&&e.apply(this,arguments)||this}t(n,e);}(x);var rt$1=function(e){function n(t){var n=t.userId,r=e.call(this)||this;return r.method=d$1.DELETE,r.path="".concat(pe$1,"/").concat(n,"/metadata"),r}return t(n,e),n}(q);!function(e){function n(){return null!==e&&e.apply(this,arguments)||this}t(n,e);}(x);var it$1,st$1=function(e,t){void 0===t&&(t=null);var n=JSON.parse(JSON.stringify(e));return n._iid&&delete n._iid,t&&t(n),n},ot$1=function(e,t){void 0===t&&(t=null);var n=JSON.parse(JSON.stringify(e));return t&&t(n),n},at$1=function(e){return {do:function(t){e||t();},throw:function(t){if(!e)throw t}}};!function(e){e.ONLINE="online",e.OFFLINE="offline",e.NON_AVAILABLE="nonavailable";}(it$1||(it$1={}));var ut$1,ct$1=function(e){function s(t,n){var r,i,s,u,c,l,d,h,p,f,_,g,v=this;return (v=e.call(this,t)||this).userId=null!==(i=null!==(r=n.guest_id)&&void 0!==r?r:n.user_id)&&void 0!==i?i:"",v.nickname=null!==(u=null!==(s=n.nickname)&&void 0!==s?s:n.name)&&void 0!==u?u:"",v.plainProfileUrl=null!==(l=null!==(c=n.profile_url)&&void 0!==c?c:n.image)&&void 0!==l?l:"",v.requireAuth=null!==(d=n.require_auth_for_profile_image)&&void 0!==d&&d,v.metaData=null!==(h=n.metadata)&&void 0!==h?h:{},v.connectionStatus=it$1.NON_AVAILABLE,m(it$1,n.is_online)?v.connectionStatus=n.is_online:y("boolean",n.is_online)&&(v.connectionStatus=n.is_online?it$1.ONLINE:it$1.OFFLINE),v.isActive=null===(p=n.is_active)||void 0===p||p,v.lastSeenAt=null!==(f=n.last_seen_at)&&void 0!==f?f:null,v.preferredLanguages=n.preferred_languages?a([],o(n.preferred_languages),!1):null,v.friendDiscoveryKey=null!==(_=n.friend_discovery_key)&&void 0!==_?_:null,v.friendName=null!==(g=n.friend_name)&&void 0!==g?g:null,v}return t(s,e),s.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{user_id:t.userId,nickname:t.nickname,profile_url:t.plainProfileUrl,require_auth_for_profile_image:t.requireAuth,metadata:t.metaData,is_online:t.connectionStatus,is_active:t.isActive,last_seen_at:t.lastSeenAt,preferred_languages:t.preferredLanguages,friend_discovery_key:t.friendDiscoveryKey,friend_name:t.friendName})):null},Object.defineProperty(s.prototype,"profileUrl",{get:function(){return this.requireAuth?"".concat(this.plainProfileUrl,"?auth=").concat(ze$1(this._iid)):this.plainProfileUrl},enumerable:!1,configurable:!0}),s.prototype.serialize=function(){return st$1(this)},s.prototype._isValidMetaData=function(e){return !Array.isArray(e)&&Object.keys(e).length>0&&Object.keys(e).map((function(t){return e[t]})).every((function(e){return y("string",e)}))},s.prototype._applyMetaData=function(e,t){var n=this;void 0===t&&(t=!1),Object.keys(e).forEach((function(r){t?delete n.metaData[r]:n.metaData[r]=e[r];}));},s.prototype.createMetaData=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a;return i(this,(function(i){switch(i.label){case 0:return at$1(this._isValidMetaData(e)).throw(p.invalidParameters),t=St$1.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new He$1({userId:n.userId,metadata:e}),[4,r.send(s)];case 1:return o=i.sent(),a=o.as($e$1).metaData,this._applyMetaData(a),[2,this.metaData]}}))}))},s.prototype.updateMetaData=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,s,o,a,u;return i(this,(function(i){switch(i.label){case 0:return at$1(this._isValidMetaData(e)).throw(p.invalidParameters),n=St$1.of(this._iid),r=n.sdkState,s=n.requestQueue,o=new et$1({userId:r.userId,metadata:e,upsert:t}),[4,s.send(o)];case 1:return a=i.sent(),u=a.as(tt$1).metadata,this._applyMetaData(u),[2,this.metaData]}}))}))},s.prototype.deleteMetaData=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid),n=t.sdkState,r=t.requestQueue,s=new nt$1({userId:n.userId,metadataKey:e}),[4,r.send(s)];case 1:return i.sent(),this._applyMetaData(((o={})[e]=!0,o),!0),[2,this.metaData]}}))}))},s.prototype.deleteAllMetaData=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=St$1.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new rt$1({userId:t.userId}),[4,n.send(r)];case 1:return i.sent(),this.metaData={},[2]}}))}))},s}(Be$1),lt$1=function(e){function n(t){var n=t.userProfile,r=e.call(this)||this;return r.userProfile=n,r}return t(n,e),n}(L),dt$1=function(){function e(e,t){var n,r,i,s,o,a,u,c,l,d,h,p,f,_;this._iid=e,this.appInfo=new Ve$1(t),this.user=new ct$1(e,t),this.connectedAt=1e3*(null!==(n=t.login_ts)&&void 0!==n?n:0),this.firstConnectedAt=0,this.pingInterval=null!==(r=t.ping_interval)&&void 0!==r?r:15e3,this.pongTimeout=null!==(i=t.pong_timeout)&&void 0!==i?i:5e3,this.reconnectInterval=null!==(o=null===(s=t.reconnect)||void 0===s?void 0:s.interval)&&void 0!==o?o:3e3,this.reconnectMaxInterval=null!==(u=null===(a=t.reconnect)||void 0===a?void 0:a.max_interval)&&void 0!==u?u:6e4,this.reconnectRetryCount=null!==(l=null===(c=t.reconnect)||void 0===c?void 0:c.retry_cnt)&&void 0!==l?l:5,this.reconnectIntervalMultiple=null!==(h=null===(d=t.reconnect)||void 0===d?void 0:d.mul)&&void 0!==h?h:2,this.maxUnreadCountOnSuperGroup=null!==(p=t.max_unread_cnt_on_super_group)&&void 0!==p?p:100,this.profileImageEncryption=!!t.profile_image_encryption,this.concurrentCallLimit=null!==(f=t.concurrent_call_limit)&&void 0!==f?f:5,this.backOffDelay=null!==(_=t.back_off_delay)&&void 0!==_?_:100;}return e.payloadify=function(e){return n(n({},ct$1.payloadify(e.user)),{emoji_hash:e.appInfo.emojiHash,file_upload_size_limit:e.appInfo.uploadSizeLimit,application_attributes:e.appInfo.applicationAttributes,premium_feature_list:e.appInfo.premiumFeatureList,login_ts:e.connectedAt/1e3,ping_interval:e.pingInterval,pong_timeout:e.pongTimeout,reconnect:{interval:e.reconnectInterval,max_interval:e.reconnectMaxInterval,retry_cnt:e.reconnectRetryCount,mul:e.reconnectIntervalMultiple},max_unread_cnt_on_super_group:e.maxUnreadCountOnSuperGroup,profile_image_encryption:e.profileImageEncryption,concurrent_call_limit:e.concurrentCallLimit,back_off_delay:e.backOffDelay})},e.prototype.apply=function(){var e=this.reconnectInterval,t=this.reconnectMaxInterval,n=this.reconnectIntervalMultiple,r=St$1.of(this._iid);r.sdkState.websocket.pingInterval=1e3*this.pingInterval,r.sdkState.websocket.pongTimeout=1e3*this.pongTimeout,r.sdkState.websocket.reconnectMaxRetry=this.reconnectRetryCount,r.sdkState.websocket.reconnectRetryStrategy={calcTimeout:function(r){return r>0?1e3*Math.min(e*Math.pow(n,r-1),t):10}},r.appInfo=this.appInfo,r.sessionManager.currentUser=this.user,r.connectedAt=this.connectedAt,this.firstConnectedAt||(r.firstConnectedAt=this.connectedAt),r.maxSuperGroupChannelUnreadCount=this.maxUnreadCountOnSuperGroup,r.concurrentCallLimit=this.concurrentCallLimit,r.backOffDelay=this.backOffDelay,r.dispatcher.dispatch(new lt$1({userProfile:this}));},e}(),ht$1=function(e){function r(t,n,r){var i,s=this;return (s=e.call(this,t,n,r)||this).error=null,s.userProfile=new dt$1(t,r),s.key=r.key,s.ekey=null!==(i=r.ekey)&&void 0!==i?i:"",s.error=r.error?new p(r):null,s}return t(r,e),r.asError=function(e){return new r(null,"LOGI",n({user_id:null,error:!0},e))},r.prototype.applyTo=function(e){if(this.error)throw this.error;var t=St$1.of(e);if(!t)throw p.lostInstance;t.sessionManager.auth.sessionKey=this.key,ze$1(e,this.ekey),this.userProfile.apply();},r}(B),pt$1=function(e){function n(t){var n=e.call(this)||this;return n.enabled=t,n}return t(n,e),n}(L),ft$1=function(e){function n(t,n){var r=n.sdkState,i=n.cacheContext,s=n.connectionHandlers,o=n.sessionManager,a=n.websocketClient,u=n.dispatcher,c=n.logger,l=n.entryState,d=void 0===l?new je$1:l,h=e.call(this)||this;return h._currentState=null,h._loginTimer=null,h._connectingAt=0,h._connectionRequestQueue=[],h._iid=t,h.sdkState=r,h.cacheContext=i,h.connectionHandlers=s,h._sessionManager=o,h._websocketClient=a,h._dispatcher=u,h._logger=c,h._currentState=d,h._websocketClient.on("message",(function(e){if("LOGI"===e.code){h._loginTimer&&(clearTimeout(h._loginTimer),h._loginTimer=null);var t=e.as(ht$1);if(t.error)(t.error.isSessionKeyExpiredError||t.error.isSessionTokenExpiredError)&&h._dispatcher.dispatch(new G),h._connectionRequestQueue.forEach((function(e){return e.reject(t.error)})),h._statLogConnection(t.error);else {t.applyTo(h._iid),h._connectionRequestQueue.forEach((function(e){return e.resolve()}));var n=t.userProfile;h._enableStatLog(n.appInfo.applicationAttributes.includes("allow_sdk_request_log_publish")),h._statLogConnection(null);}h._connectionRequestQueue=[];}})).on("close",(function(){h._connectionRequestQueue.length>0&&(h._connectionRequestQueue.forEach((function(e){return e.reject(p.networkError)})),h._connectionRequestQueue=[],h._statLogConnection(p.networkError));})),h}return t(n,e),Object.defineProperty(n.prototype,"currentState",{get:function(){return this._currentState},enumerable:!1,configurable:!0}),n.prototype.changeState=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this._currentState=e,this._dispatcher.dispatch(new de$1({stateType:e.type})),this._logger.debug("connection state changes to ".concat(e.name)),[4,this._currentState.run(this)];case 1:return t.sent(),[2]}}))}))},n.prototype._url=function(e){void 0===e&&(e="");var t=this.sdkState,n=t.appId,r=t.appVersion,i=t.userId,s=t.extensions,o=this.cacheContext.localCacheEnabled,a=this._sessionManager.auth,u=s.sb_syncmanager?"s".concat(s.sb_syncmanager):"",c=s.sb_uikit?"u".concat(s.sb_uikit):"",d="JS/c".concat(l$1.SDK_VERSION,"/").concat(u,"/").concat(c);return "".concat(this.sdkState.websocket.host,"/?p=JS&pv=").concat(encodeURIComponent(l$1.OS_VERSION),"&sv=").concat(encodeURIComponent(l$1.SDK_VERSION),"&ai=").concat(n).concat(r?"&av=".concat(r):"").concat(a.hasSession?"&key=".concat(encodeURIComponent(a.sessionKey)):"&user_id=".concat(encodeURIComponent(i),"&access_token=").concat(encodeURIComponent(e)),"&active=1&SB-User-Agent=").concat(d,"&Request-Sent-Timestamp=").concat(Date.now().toString(),"&include_extra_data=").concat(encodeURIComponent(String(["premium_feature_list","file_upload_size_limit","application_attributes","emoji_hash"]))).concat(this._sessionManager.handler?"&expiring_session=1":"","&use_local_cache=").concat(o?1:0)},n.prototype._enableStatLog=function(e){this._dispatcher.dispatch(new pt$1(e));},n.prototype._statLogConnection=function(e){this._dispatcher.dispatch(new Q(new K({type:P.WEBSOCKET_CONNECT,data:{host_url:this.sdkState.websocket.host,success:!e,latency:Date.now()-this._connectingAt,error_code:null==e?void 0:e.code,error_description:null==e?void 0:e.message}})));},n.prototype.connect=function(e){return void 0===e&&(e=""),r(this,void 0,void 0,(function(){var t,n,r=this;return i(this,(function(i){return t=this._url(e),n=new ee,this._connectionRequestQueue.push(n),1===this._connectionRequestQueue.length&&(this._connectingAt=Date.now(),this._loginTimer=setTimeout((function(){r._loginTimer=null,r._dispatcher.dispatch(ht$1.asError(p.loginTimeout));}),this.sdkState.websocket.responseTimeout),this._websocketClient.connect(t)),[2,n.promise]}))}))},n.prototype.cancelConnectForRetry=function(){this._dispatcher.dispatch(ht$1.asError(p.connectionRenew));},n.prototype.disconnect=function(){this._websocketClient.disconnect();},n.prototype.logout=function(){this.sdkState.userId=null,this._sessionManager.currentUser=null,this._sessionManager.auth.clear(),this.disconnect();},n}(M),_t$1=function(){function e(e,t){var n=t.sdkState,r=t.cacheContext,i=t.connectionHandlers,s=t.sessionManager,o=t.websocketClient,a=t.dispatcher,u=t.logger,c=t.disableAutoReconnect,l=void 0!==c&&c,d=this;this._context=null,this._logger=u,this._context=new ft$1(e,{sdkState:n,cacheContext:r,connectionHandlers:i,sessionManager:s,websocketClient:o,dispatcher:a,logger:u}),l||(s.on("refresh-authtoken",(function(){d.isConnected||(d._logger.debug("try reconnect by session token refresh"),d.reconnect());})).on("refresh",(function(){d.isConnecting||d.isConnected||(d._logger.debug("try reconnect by session key refresh"),d.reconnect());})),o.on("close",(function(){"foreground"===n.appState&&setTimeout((function(){s.isRefreshingAuthToken||(d._logger.debug("try reconnect by websocket connection closed"),d.reconnect());}),100);})));}return Object.defineProperty(e.prototype,"isConnected",{get:function(){return this._context.currentState.type===J.CONNECTED},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isConnecting",{get:function(){var e=this._context.currentState;return e.type===J.CONNECTING||e.type===J.RECONNECTING},enumerable:!1,configurable:!0}),e.prototype.connect=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,this._context.currentState.onConnect(this._context,e)];case 1:return t.sent(),[2]}}))}))},e.prototype.reconnect=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this._context.currentState.onReconnect(this._context,{})];case 1:return e.sent(),[2]}}))}))},e.prototype.resetAndReconnect=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this._context.currentState.onReconnect(this._context,{resetReconnectCount:!0})];case 1:return e.sent(),[2]}}))}))},e.prototype.background=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this._context.currentState.onDisconnect(this._context,{autoReconnect:!1})];case 1:return e.sent(),[2]}}))}))},e.prototype.disconnect=function(e){return void 0===e&&(e=null),r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return [4,this._context.currentState.onDisconnect(this._context,{error:e,autoReconnect:!0})];case 1:return t.sent(),[2]}}))}))},e.prototype.logout=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return [4,this._context.currentState.onLogout(this._context)];case 1:return e.sent(),[2]}}))}))},e}(),gt$1=function(e){function n(t){var n=t.deviceId,r=t.statLogs,i=e.call(this)||this;return i.method=d$1.POST,i.path="".concat(be$1),i.params={device_id:n,log_entries:r.map((function(e){return K.payloadify(e)}))},i}return t(n,e),n}(q);!function(e){e[e.PENDING=0]="PENDING",e[e.ENABLED=1]="ENABLED",e[e.DISABLED=2]="DISABLED";}(ut$1||(ut$1={}));var yt$1,mt$1=function(){function e(e){var t=e.cacheContext,n=e.requestQueue,r=e.dispatcher,i=e.baseLimit,s=void 0===i?100:i,o=e.maxLimit,a=void 0===o?1e3:o,u=e.minLimit,c=void 0===u?10:u;this.queue=[],this.enabledstate=ut$1.PENDING,this.isFlushing=!1,this.generation=1,this.lastFlushedAt=0,this.deviceId=R(),this.cacheContext=t,this.requestQueue=n,this.dispatcher=r,this.baseLimit=s,this.limit=s,this.maxLimit=a,this.minLimit=c;}return Object.defineProperty(e.prototype,"isEnabled",{get:function(){return this.enabledstate===ut$1.ENABLED},enumerable:!1,configurable:!0}),e.prototype._save=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.cacheContext.localCacheEnabled?[4,this.cacheContext.preference.set(this.key,{deviceId:this.deviceId,statLogs:this.queue.map((function(e){return K.payloadify(e)})),generation:this.generation++,lastFlushedAt:this.lastFlushedAt})]:[3,2];case 1:e.sent(),e.label=2;case 2:return [2]}}))}))},e.prototype._flush=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:if(!this.isEnabled)return [3,7];if(this.isFlushing)return [3,7];this.isFlushing=!0,n.label=1;case 1:return n.trys.push([1,5,6,7]),(e=this.queue.slice(0,Math.min(this.limit,this.maxLimit))).length>0?(t=new gt$1({deviceId:this.deviceId,statLogs:e}),[4,this.requestQueue.send(t)]):[3,4];case 2:return n.sent(),this.queue=this.queue.slice(e.length),[4,this._save()];case 3:n.sent(),n.label=4;case 4:return this.limit=this.baseLimit,this.lastFlushedAt=Date.now(),[3,7];case 5:return n.sent(),this.limit=this.limit+20,[3,7];case 6:return this.isFlushing=!1,[7];case 7:return [2]}}))}))},e.prototype.init=function(e){return r(this,void 0,void 0,(function(){var t,n,r=this;return i(this,(function(i){switch(i.label){case 0:return this.key=e,this.cacheContext.localCacheEnabled?[4,this.cacheContext.preference.get(this.key)]:[3,4];case 1:return (t=i.sent())?(this.deviceId=t.deviceId,this.queue=t.statLogs.map((function(e){return new K({type:e.stat_type,ts:e.ts,data:e.data})})),this.generation=t.generation,this.lastFlushedAt=t.lastFlushedAt,Date.now()-this.lastFlushedAt>=108e5&&this.queue.length>=this.minLimit?(n=Math.min(Math.floor(18e4*Math.random()),100),[4,Re$1(n)]):[3,4]):[3,4];case 2:return i.sent(),[4,this._flush()];case 3:i.sent(),i.label=4;case 4:return this.dispatcher.on((function(e){if(e instanceof Q){var t=e.statLog;r.put(t);}else e instanceof pt$1&&(r.enabledstate=e.enabled?ut$1.ENABLED:ut$1.DISABLED,r.isEnabled?r.queue.length>=r.limit&&r._flush():r.clear());})),[2]}}))}))},e.prototype.put=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){switch(t.label){case 0:return this.enabledstate===ut$1.DISABLED?[3,3]:(this.queue.push(e),[4,this._save()]);case 1:return t.sent(),this.queue.length>=this.limit?[4,this._flush()]:[3,3];case 2:t.sent(),t.label=3;case 3:return [2]}}))}))},e.prototype.clear=function(){return r(this,void 0,void 0,(function(){return i(this,(function(e){switch(e.label){case 0:return this.queue=[],this.generation=1,[4,this._save()];case 1:return e.sent(),[2]}}))}))},e}();!function(e){e[e.NONE=0]="NONE",e[e.VERBOSE=1]="VERBOSE",e[e.DEBUG=2]="DEBUG",e[e.INFO=3]="INFO",e[e.WARN=4]="WARN",e[e.ERROR=5]="ERROR";}(yt$1||(yt$1={}));var vt$1,Et$1=function(){function e(){this.level=yt$1.WARN;}return e.prototype.verbose=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.level<=yt$1.VERBOSE&&console.log.apply(console,a(["[verbose]"],o(e),!1));},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.level<=yt$1.DEBUG&&console.log.apply(console,a(["[debug]"],o(e),!1));},e.prototype.info=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.level<=yt$1.INFO&&console.log.apply(console,a(["[info]"],o(e),!1));},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.level<=yt$1.WARN&&console.warn.apply(console,a(["[warn]"],o(e),!1));},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.level<=yt$1.ERROR&&console.error.apply(console,a(["[error]"],o(e),!1));},e}(),It$1={},St$1=function(){function e(e,t){var n,r,i,s,o,a,u,c;if(this.connectedAt=0,this.firstConnectedAt=0,this.connectionHandlers=new Map,this.userEventHandlers=new Map,!It$1[e]){It$1[e]=this;var d=null!==(n=t.options)&&void 0!==n?n:new b,h=this.sdkState={appId:t.appId,appVersion:null!==(r=t.appVersion)&&void 0!==r?r:"",appState:"foreground",userId:null,extensions:{},api:{host:null!==(i=t.apiHost)&&void 0!==i?i:"https://api-".concat(t.appId,".sendbird.com")},websocket:{host:null!==(s=t.websocketHost)&&void 0!==s?s:"wss://ws-".concat(t.appId,".sendbird.com"),pingerDisabled:!!t.noPingpong,pingInterval:null,pongTimeout:null,connectMaxRetry:2,reconnectMaxRetry:-1,reconnectRetryStrategy:new De$1,responseTimeout:d.websocketResponseTimeout}};this.appInfo=null,this.subscribedUnreadMessageCount={all:0,customTypes:{},ts:0};var p=this.logger=new Et$1;this.logger.level=null!==(o=t.logLevel)&&void 0!==o?o:yt$1.WARN,this.connectedAt=0,this.firstConnectedAt=0,this.connectionHandlers=new Map,this.userEventHandlers=new Map,this.cacheContext=new O({encryption:t.encryption,store:t.store,localCacheEnabled:null!==(a=t.localCacheEnabled)&&void 0!==a&&a}),this.debugMode=null!==(u=t.debugMode)&&void 0!==u&&u,this.maxSuperGroupChannelUnreadCount=l$1.DEFAULT_MAX_UNREAD_COUNT_OF_SUPER_GROUP_CHANNEL,this.useMemberInfoInMessage=d.useMemberInfoInMessage,this.typingIndicatorInvalidateTime=d.typingIndicatorInvalidateTime,this.typingIndicatorThrottle=d.typingIndicatorThrottle,this.concurrentCallLimit=null,this.backOffDelay=null;var f=this.dispatcher=new k,_=new w;this.requestQueue=new he$1(e,{auth:_,sdkState:h,dispatcher:f,logger:p}),this.sessionManager=new Ue$1({auth:_,sdkState:h,dispatcher:f,requestQueue:this.requestQueue,logger:p}),this.connectionManager=new _t$1(e,{sdkState:h,cacheContext:this.cacheContext,connectionHandlers:this.connectionHandlers,dispatcher:f,sessionManager:this.sessionManager,websocketClient:this.requestQueue.commandRouter.websocketClient,disableAutoReconnect:null!==(c=t.disableAutoReconnect)&&void 0!==c&&c,logger:p}),this.statLogCollector=new mt$1({cacheContext:this.cacheContext,requestQueue:this.requestQueue,dispatcher:f});}return It$1[e]}return e.of=function(e){if(It$1[e])return It$1[e];throw p.lostInstance},e}(),Tt$1=function(){function e(){}return e.prototype.init=function(e,t){var n=t.sdkState,r=t.dispatcher,i=t.sessionManager,s=t.requestQueue,o=t.logger;t.onlineDetector;var a=t.cacheContext,u=void 0===a?null:a;this._iid=e,this._cacheContext=u,this._sdkState=n,this._dispatcher=r,this._sessionManager=i,this._requestQueue=s,this._logger=o;},e}(),bt$1=function(e){function n(t){var n=e.call(this)||this;if(n.method=d$1.POST,n.path="".concat(fe$1),n.params=U$1({file:t.file,channel_url:t.channelUrl}),t.thumbnailSizes)for(var r=0;r<t.thumbnailSizes.length;r++){var i=t.thumbnailSizes[r],s=i.maxWidth,o=i.maxHeight;n.params["thumbnail".concat(r+1)]="".concat(s,",").concat(o);}return n.requestId=t.requestId,n}return t(n,e),n}(q),Nt$1=function(e){function n(t,n){var r,i,s,o=this;return (o=e.call(this,t,n)||this).url=n.url,o.fileSize=null!==(r=n.file_size)&&void 0!==r?r:0,o.thumbnailSizes=null!==(i=n.thumbnails)&&void 0!==i?i:[],o.requireAuth=null!==(s=n.require_auth)&&void 0!==s&&s,o}return t(n,e),n}(x),At$1=function(e){function r(t,n){var r,i,s,o=this;return (o=e.call(this,t)||this).replyCount=0,o.mostRepliedUsers=null,o.lastRepliedAt=0,o.updatedAt=0,o.replyCount=null!==(r=n.reply_count)&&void 0!==r?r:0,o.mostRepliedUsers=n.hasOwnProperty("most_replies")&&E("object",n.most_replies)?n.most_replies.map((function(e){return new ct$1(o._iid,e)})):[],o.lastRepliedAt=null!==(i=n.last_replied_at)&&void 0!==i?i:0,o.updatedAt=null!==(s=n.updated_at)&&void 0!==s?s:0,o}return t(r,e),r.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{reply_count:t.replyCount,most_replies:Array.isArray(t.mostRepliedUsers)?t.mostRepliedUsers.map((function(e){return ct$1.payloadify(e)})):[],last_replied_at:t.lastRepliedAt,updated_at:t.updatedAt})):null},r}(Be$1);!function(e){e.ADD="add",e.DELETE="delete";}(vt$1||(vt$1={}));var Ct$1,Ot$1,wt$1=function(e){this.messageId=0,this.userId=null,this.key=null,this.operation=null,this.updatedAt=0;var t=y("string",e.msg_id)?parseInt(e.msg_id):e.msg_id,n=e.user_id,r=e.operation?e.operation.toLowerCase():null,i=e.reaction,s=e.updated_at;t&&y("string",n)&&y("string",r)&&m(vt$1,r)&&y("string",i)&&i&&y("number",s)&&(this.messageId=t,this.userId=n,this.key=i,this.operation=r,this.updatedAt=s);},Rt$1=function(){function e(e){var t,n,r,i=e.key,u=null!==(r=a([],o(e.user_ids),!1))&&void 0!==r?r:[],c=e.updated_at;y("string",i)&&i&&E("string",u)&&u.length>0&&y("number",c)&&(this.key=i,this.userIds=u,this.updatedAt=c);var l={};try{for(var d=s(this.userIds),h=d.next();!h.done;h=d.next()){l[h.value]=this.updatedAt;}}catch(e){t={error:e};}finally{try{h&&!h.done&&(n=d.return)&&n.call(d);}finally{if(t)throw t.error}}this._version=l;}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this.userIds.length},enumerable:!1,configurable:!0}),e.payloadify=function(e){return e?U$1({key:e.key,user_ids:e.userIds,updated_at:e.updatedAt}):null},e.prototype.applyEvent=function(e){if(e.key===this.key&&this.updatedAt<=e.updatedAt){if(!this._version[e.userId]||this._version[e.userId]<=e.updatedAt){var t=this.userIds.indexOf(e.userId);switch(e.operation){case vt$1.ADD:t<0&&this.userIds.push(e.userId);break;case vt$1.DELETE:t>=0&&this.userIds.splice(t,1);}this._version[e.userId]=e.updatedAt;}this.updatedAt=Math.max(this.updatedAt,e.updatedAt);}},e}(),Dt$1=function(){function e(e){this.key=e.key,this.value=E("string",e.value)?a([],o(e.value),!1):[];}return e.payloadify=function(e){var t;return e?U$1({key:e.key,value:null!==(t=e.value)&&void 0!==t?t:[]}):null},e}(),Mt$1=function(){function e(e){this.url=null,this.secureUrl=null,this.type=null,this.width=0,this.height=0,this.alt=null,this.url=e.url,e.hasOwnProperty("secure_url")&&(this.secureUrl=e.secure_url),e.hasOwnProperty("type")&&(this.type=e.type),e.hasOwnProperty("width")&&(this.width=e.width),e.hasOwnProperty("height")&&(this.height=e.height),e.hasOwnProperty("alt")&&(this.alt=e.alt);}return e.payloadify=function(e){var t,n;return e?U$1({url:e.url,secure_url:e.secureUrl,type:e.type,width:null!==(t=e.width)&&void 0!==t?t:0,height:null!==(n=e.height)&&void 0!==n?n:0,alt:e.alt}):null},e}(),kt$1=function(){function e(e){this.title=null,this.url=null,this.description=null,this.defaultImage=null,e.hasOwnProperty("og:title")&&(this.title=e["og:title"]),e.hasOwnProperty("og:url")&&(this.url=e["og:url"]),e.hasOwnProperty("og:description")&&(this.description=e["og:description"]),e.hasOwnProperty("og:image")&&(this.defaultImage=new Mt$1(e["og:image"]));}return e.payloadify=function(e){return e?U$1({"og:title":e.title,"og:url":e.url,"og:description":e.description,"og:image":e.defaultImage?Mt$1.payloadify(e.defaultImage):null}):null},e}(),Lt=function(){function e(e){var t,n;this.name=null,this.volume=0,this.name=null!==(t=e.name)&&void 0!==t?t:"default",this.volume=null!==(n=e.volume)&&void 0!==n?n:1;}return e.payloadify=function(e){return e?U$1({name:e.name,volume:e.volume}):null},e}();!function(e){e.PENDING="pending",e.SENT="sent",e.FAILED="failed",e.CANCELED="canceled";}(Ct$1||(Ct$1={})),function(e){e.PENDING="pending",e.IN_QUEUE="in_queue",e.SENT="sent",e.FAILED="failed",e.CANCELED="canceled",e.REMOVED="removed";}(Ot$1||(Ot$1={}));var Ut$1,Pt$1=function(e){switch(e){case ie.BASE:return "";case ie.USER:return "MESG";case ie.FILE:return "FILE";case ie.ADMIN:return "ADMM"}},qt$1=function(e){function r(t,n){var r,i,s,o,a,u,c,l,d,h,p,f,_,g=this;(g=e.call(this,t)||this).channelUrl=null,g.channelType=ne.BASE,g.messageId=0,g.parentMessageId=null,g.parentMessage=null,g.silent=!1,g.isOperatorMessage=!1,g.messageType=ie.BASE,g.data=null,g.customType=null,g.mentionType=null,g.mentionedUsers=[],g.mentionedUserIds=[],g.mentionedMessageTemplate=null,g.threadInfo=null,g.reactions=[],g.metaArrays=[],g.ogMetaData=null,g.appleCriticalAlertOptions=null,g.createdAt=0,g.updatedAt=0,g.scheduledInfo=null,g._scheduledStatus=null,g.messageId=null!==(i=null!==(r=n.msg_id)&&void 0!==r?r:n.message_id)&&void 0!==i?i:0,g.channelUrl=n.channel_url,g.channelType=m(ne,n.channel_type)?n.channel_type:ne.GROUP,n.channel&&(n.channel.channel_url&&(g.channelUrl=n.channel.channel_url),n.channel.channel_type&&(g.channelType=n.channel.channel_type)),g.parentMessageId=null!==(s="string"==typeof n.parent_message_id?parseInt(n.parent_message_id):n.parent_message_id)&&void 0!==s?s:0,g.data=null!==(o=n.data)&&void 0!==o?o:"",g.customType=null!==(a=n.custom_type)&&void 0!==a?a:"",g.mentionType=m(ae,n.mention_type)?n.mention_type:null;var y=n.mentioned_users;g.mentionedUsers=y?y.map((function(e){return new ct$1(g._iid,e)})):null;var v=n.mentioned_user_ids;g.mentionedUserIds=null!=v?v:null,g.mentionedMessageTemplate=null!==(u=n.mentioned_message_template)&&void 0!==u?u:"",g.threadInfo=n.thread_info?new At$1(g._iid,n.thread_info):null,g.reactions=n.reactions?n.reactions.map((function(e){return new Rt$1(e)})):[];for(var E=null!==(c=n.metaarray)&&void 0!==c?c:{},I=null!==(l=n.metaarray_key_order)&&void 0!==l?l:Object.keys(E).sort((function(e,t){return e.localeCompare(t)})),S=0;S<I.length;S++){var T=I[S];g.metaArrays.push(new Dt$1({key:T,value:E[T]||[]}));}return n.sorted_metaarray&&(g.metaArrays=n.sorted_metaarray.map((function(e){return new Dt$1(e)}))),g.ogMetaData=n.og_tag?new kt$1(n.og_tag):null,g.silent=null!==(d=n.silent)&&void 0!==d&&d,g.isOperatorMessage=null!==(h=n.is_op_msg)&&void 0!==h&&h,g.appleCriticalAlertOptions=n.apple_critical_alert_options?new Lt(n.apple_critical_alert_options):null,g.createdAt=null!==(f=null!==(p=n.created_at)&&void 0!==p?p:n.ts)&&void 0!==f?f:0,g.updatedAt=null!==(_=n.updated_at)&&void 0!==_?_:0,"number"==typeof n.scheduled_message_id&&"number"==typeof n.scheduled_at&&n.scheduled_status&&(g.scheduledInfo={scheduledMessageId:n.scheduled_message_id,scheduledAt:n.scheduled_at},g._scheduledStatus=n.scheduled_status),g}return t(r,e),r.payloadify=function(t){var r,i,s,o;return t?U$1(n(n({},e.payloadify.call(this,t)),{channel_url:t.channelUrl,channel_type:t.channelType,message_id:t.messageId,type:Pt$1(t.messageType),parent_message_id:t.parentMessageId,data:t.data,custom_type:t.customType,mention_type:t.mentionType,mentioned_user_ids:t.mentionedUserIds,mentioned_users:null===(r=t.mentionedUsers)||void 0===r?void 0:r.map((function(e){return ct$1.payloadify(e)})),mentioned_message_template:t.mentionedMessageTemplate,thread_info:t.threadInfo?At$1.payloadify(t.threadInfo):null,reactions:t.reactions.map((function(e){return Rt$1.payloadify(e)})),sorted_metaarray:null===(i=t.metaArrays)||void 0===i?void 0:i.map((function(e){return Dt$1.payloadify(e)})),og_tag:kt$1.payloadify(t.ogMetaData),silent:t.silent,is_op_msg:t.isOperatorMessage,apple_critical_alert_options:Lt.payloadify(t.appleCriticalAlertOptions),created_at:t.createdAt,updated_at:t.updatedAt,scheduled_message_id:null===(s=t.scheduledInfo)||void 0===s?void 0:s.scheduledMessageId,scheduled_at:null===(o=t.scheduledInfo)||void 0===o?void 0:o.scheduledAt,scheduled_status:t._scheduledStatus})):null},r.prototype.isIdentical=function(e){return this.messageId===e.messageId},r.prototype.isEqual=function(e){return g(this,e)},r.prototype.isUserMessage=function(){return this.messageType===ie.USER},r.prototype.isFileMessage=function(){return this.messageType===ie.FILE},r.prototype.isAdminMessage=function(){return this.messageType===ie.ADMIN},r.prototype.serialize=function(){return st$1(this)},r.prototype.getMetaArraysByKeys=function(e){return this.metaArrays.filter((function(t){return e.includes(t.key)}))},r.prototype.applyThreadInfoUpdateEvent=function(e){return this.parentMessageId===e.targetMessageId&&(this.threadInfo=e.threadInfo),!1},r.prototype.applyReactionEvent=function(e){if(this.messageId===e.messageId){for(var t=!1,n=0;n<this.reactions.length;n++)if(this.reactions[n].key===e.key){this.reactions[n].applyEvent(e),this.reactions[n].isEmpty&&this.reactions.splice(n,1),t=!0;break}t||"add"!==e.operation||this.reactions.push(new Rt$1(Rt$1.payloadify({key:e.key,userIds:[e.userId],updatedAt:e.updatedAt})));}},r.prototype.applyParentMessage=function(e){if(this.parentMessageId===e.messageId){var t=this.parentMessage.updatedAt;if(e.updatedAt>=t)return this.parentMessage=e,!0}return !1},r}(Be$1),xt=function(e){function r(t,n){var r=e.call(this,t,n)||this;return r.role=null,r.isBlockedByMe=!1,r.role=m(re,n.role)?n.role:re.NONE,n.hasOwnProperty("is_blocked_by_me")&&(r.isBlockedByMe=n.is_blocked_by_me),r}return t(r,e),r.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{role:t.role,is_blocked_by_me:t.isBlockedByMe})):null},r}(ct$1),Ft$1=function(e){function r(t,n){var r,i,s,o,a=this;if((a=e.call(this,t,n)||this).sender=null,a.reqId="",a.replyToChannel=!1,a.sendingStatus=null,a.errorCode=0,a.sender=n.user?new xt(a._iid,n.user):n.sender_id,a.reqId=null!==(i=null!==(r=n.req_id)&&void 0!==r?r:n.request_id)&&void 0!==i?i:"",a.replyToChannel=null!==(s=n.is_reply_to_channel)&&void 0!==s&&s,n.request_state&&m(le$1,n.request_state)&&(a.sendingStatus=n.request_state),!a.sendingStatus)if(a.messageId>0)a.sendingStatus=le$1.SUCCEEDED;else if(a.scheduledInfo)switch(a._scheduledStatus=n.scheduled_status,n.scheduled_status){case Ot$1.SENT:case Ot$1.IN_QUEUE:a.sendingStatus=le$1.SUCCEEDED;break;case Ot$1.PENDING:a.sendingStatus=le$1.SCHEDULED;break;case Ot$1.FAILED:case Ot$1.REMOVED:a.sendingStatus=le$1.FAILED;break;case Ot$1.CANCELED:a.sendingStatus=le$1.CANCELED;}else a.sendingStatus=le$1.PENDING;return a.errorCode=null!==(o=n.error_code)&&void 0!==o?o:0,a}return t(r,e),r.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{user:xt.payloadify(t.sender),req_id:t.reqId,is_reply_to_channel:t.replyToChannel,request_state:t.sendingStatus,error_code:t.errorCode})):null},Object.defineProperty(r.prototype,"isResendable",{get:function(){return this.sendingStatus===le$1.FAILED&&((e=this.errorCode)>0&&f.indexOf(e)>=0);var e;},enumerable:!1,configurable:!0}),r.prototype.isIdentical=function(e){return this.messageId>0&&e.messageId>0?this.messageId===e.messageId:this.reqId===e.reqId},r}(qt$1),Gt=function(){function e(e){var t,n;this.url=null,this.width=0,this.height=0,this.realWidth=0,this.realHeight=0,this.url=e.url,this.width=e.width,this.height=e.height,this.realWidth=null!==(t=e.real_width)&&void 0!==t?t:e.width,this.realHeight=null!==(n=e.real_height)&&void 0!==n?n:e.height;}return e.payloadify=function(e){return e?U$1({url:"",width:e.maxWidth,height:e.maxHeight,real_width:0,real_height:0}):null},Object.defineProperty(e.prototype,"plainUrl",{get:function(){return this.url.split("?auth=")[0]},enumerable:!1,configurable:!0}),e}(),Qt={prevResultSize:0,nextResultSize:0,isInclusive:!1,reverse:!1,messageTypeFilter:se.ALL,customTypesFilter:null,senderUserIdsFilter:null,includeReactions:!1,includeMetaArray:!1,includeParentMessageInfo:!1},jt=function(e){return y("number",e.prevResultSize)&&y("number",e.nextResultSize)&&y("boolean",e.isInclusive)&&y("boolean",e.reverse)&&y("string",e.messageTypeFilter)&&m(se,e.messageTypeFilter)&&E("string",e.customTypesFilter,!0)&&E("string",e.senderUserIdsFilter,!0)&&y("boolean",e.includeMetaArray)&&y("boolean",e.includeReactions)&&y("boolean",e.includeParentMessageInfo)},Kt=function(e){function s(t,r){var i,s,o,a,u=this;if((u=e.call(this,t,r)||this).message=null,u.translations={},u.message=null!==(i=r.message)&&void 0!==i?i:"",u.messageType=ie.ADMIN,u.translations=null!==(s=r.translations)&&void 0!==s?s:{},r.parent_message_info){var c=r.parent_message_info,l=n(n({},c),{message_id:u.parentMessageId,channel_url:u.channelUrl,channel_type:u.channelType,file:c.file,url:null===(o=c.file)||void 0===o?void 0:o.url,require_auth:null===(a=c.file)||void 0===a?void 0:a.require_auth});u.parentMessage=Ht(t,l);}return u}return t(s,e),s.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{message:t.message,translations:t.translations,parent_message_info:Bt(t.parentMessage)})):null},s.prototype.getThreadedMessagesByTimestamp=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return t=n(n({},Qt),t),at$1(this.messageId>0&&y("number",e)&&jt(t)).throw(p.invalidParameters),[4,En.of(this._iid).getThreadedMessagesByTimestamp(this,e,t)];case 1:return [2,r.sent()]}}))}))},s}(qt$1),zt=function(){function e(e){var t,n;this.type=null,this.vendor=null,this.detail={},this.type=null!==(t=e.type)&&void 0!==t?t:"",this.vendor=null!==(n=e.vendor)&&void 0!==n?n:"",e.hasOwnProperty("detail")&&y("object",e.detail)&&!Array.isArray(e.detail)&&(this.detail=e.detail);}return e.payloadify=function(e){return e?U$1({type:e.type,vendor:e.vendor,detail:e.detail}):null},e}(),Vt=function(e){function o(t,r){var i,o,a,u,c,l,d,h=this;if((h=e.call(this,t,r)||this).message="",h.messageParams=null,h.translations={},h.translationTargetLanguages=[],h.messageSurvivalSeconds=-1,h.plugins=[],h.message=r.message,h.messageType=ie.USER,h.translations=null!==(a=r.translations)&&void 0!==a?a:{},h.translationTargetLanguages=null!==(u=r.target_langs)&&void 0!==u?u:[],h.translations==={}&&h.translationTargetLanguages.length>0)try{for(var p=s(h.translationTargetLanguages),f=p.next();!f.done;f=p.next()){var _=f.value;h.translations[_]="";}}catch(e){i={error:e};}finally{try{f&&!f.done&&(o=p.return)&&o.call(p);}finally{if(i)throw i.error}}if(h.messageSurvivalSeconds=null!==(c=r.message_survival_seconds)&&void 0!==c?c:-1,h.plugins=r.plugins?r.plugins.map((function(e){return new zt(e)})):[],r.parent_message_info){var g=r.parent_message_info,y=n(n({},g),{created_at:g.ts,message_id:h.parentMessageId,channel_url:h.channelUrl,channel_type:h.channelType,file:g.file,url:null===(l=g.file)||void 0===l?void 0:l.url,require_auth:null===(d=g.file)||void 0===d?void 0:d.require_auth});h.parentMessage=Ht(t,U$1(y));}return h}return t(o,e),o.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{message:t.message,translations:t.translations,message_survival_seconds:t.messageSurvivalSeconds,plugins:t.plugins.map((function(e){return zt.payloadify(e)})),parent_message_info:Bt(t.parentMessage)})):null},o.prototype.getThreadedMessagesByTimestamp=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return t=n(n({},Qt),t),at$1(this.messageId>0&&y("number",e)&&jt(t)).throw(p.invalidParameters),[4,En.of(this._iid).getThreadedMessagesByTimestamp(this,e,t)];case 1:return [2,r.sent()]}}))}))},o}(Ft$1),Bt=function(e){if(e)switch(e.messageType){case ie.USER:return Vt.payloadify(e);case ie.FILE:return Wt.payloadify(e);case ie.ADMIN:return Kt.payloadify(e)}return null},Ht=function(e,t){switch(t.type){case"MESG":return new Vt(e,t);case"FILE":return new Wt(e,t);case"ADMM":case"BRDM":return new Kt(e,t)}return null},Wt=function(e){function s(t,r){var i,s,o,a,u,c,l,d,h,p,f,_,g,y,m,v=this;(v=e.call(this,t,r)||this).messageParams=null,v.plainUrl="",v.requireAuth=!1,v.name=null,v.size=0,v.type=null,v.thumbnails=[],v.messageSurvivalSeconds=-1,v.messageType=ie.FILE;var E=null!==(i=r.file)&&void 0!==i?i:null;if(v.plainUrl=(null!==(o=null!==(s=null==E?void 0:E.url)&&void 0!==s?s:r.url)&&void 0!==o?o:"").split("?auth=")[0],v.name=null!==(u=null!==(a=null==E?void 0:E.name)&&void 0!==a?a:r.name)&&void 0!==u?u:"File",v.size=null!==(l=null!==(c=null==E?void 0:E.size)&&void 0!==c?c:r.size)&&void 0!==l?l:0,v.data=null!==(h=null!==(d=null==E?void 0:E.data)&&void 0!==d?d:r.custom)&&void 0!==h?h:"",v.type=E?null!==(p=E.type)&&void 0!==p?p:"":null!==(f=r.type)&&void 0!==f?f:"",v.requireAuth=null!==(_=r.require_auth)&&void 0!==_&&_,v.thumbnails=r.thumbnails?r.thumbnails.map((function(e){return new Gt(n(n({},e),{url:"".concat(e.url.split("?auth=")[0]).concat(v.requireAuth?"?auth=".concat(ze$1(v._iid)):"")}))})):[],v.messageSurvivalSeconds=null!==(g=r.message_survival_seconds)&&void 0!==g?g:-1,r.parent_message_info){var I=r.parent_message_info,S=n(n({},I),{message_id:v.parentMessageId,channel_url:v.channelUrl,channel_type:v.channelType,file:I.file,url:null===(y=I.file)||void 0===y?void 0:y.url,require_auth:null===(m=I.file)||void 0===m?void 0:m.require_auth});v.parentMessage=Ht(t,S);}return v}return t(s,e),s.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),{url:t.plainUrl,require_auth:t.requireAuth,file:{name:t.name,size:t.size,type:t.type,data:t.data},thumbnails:t.thumbnails.map((function(e){return {url:e.url,width:e.width,height:e.height,real_width:e.realWidth,real_height:e.realHeight}})),message_survival_seconds:t.messageSurvivalSeconds,parent_message_info:Bt(t.parentMessage)})):null},Object.defineProperty(s.prototype,"url",{get:function(){return this.requireAuth?"".concat(this.plainUrl,"?auth=").concat(ze$1(this._iid)):this.plainUrl},enumerable:!1,configurable:!0}),s.prototype.getThreadedMessagesByTimestamp=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return t=n(n({},Qt),t),at$1(this.messageId>0&&y("number",e)&&jt(t)).throw(p.invalidParameters),[4,En.of(this._iid).getThreadedMessagesByTimestamp(this,e,t)];case 1:return [2,r.sent()]}}))}))},s}(Ft$1),Xt=function(e){function n(t){var n,r,i,s=[];return t.mentionType===ae.USERS&&(t.mentionedUserIds?s=t.mentionedUserIds:t.mentionedUsers&&(s=t.mentionedUsers.map((function(e){return e.userId})))),e.call(this,{code:"FILE",ackRequired:!0,payload:U$1({channel_url:t.channelUrl,url:t.url,name:null!==(n=t.fileName)&&void 0!==n?n:"",type:null!==(r=t.mimeType)&&void 0!==r?r:"",size:null!==(i=t.fileSize)&&void 0!==i?i:0,custom:t.data,custom_type:t.customType,thumbnails:t.thumbnailSizes,require_auth:t.requireAuth,metaarray:t.metaArrays,mention_type:t.mentionType,mentioned_user_ids:s,push_option:t.pushNotificationDeliveryOption&&t.pushNotificationDeliveryOption!==ce$1.DEFAULT?t.pushNotificationDeliveryOption:void 0,apple_critical_alert_options:t.appleCriticalAlertOptions,silent:t.silent,reply_to_channel:t.isReplyToChannel,parent_message_id:t.parentMessageId>0?t.parentMessageId:null,req_id:t.reqId})})||this}return t(n,e),n}(H$1),Yt=function(e){function n(t){var n,r=this;r=e.call(this)||this;var i=[];return t.mentionType===ae.USERS&&(t.mentionedUserIds?i=t.mentionedUserIds:t.mentionedUsers&&(i=t.mentionedUsers.map((function(e){return e.userId})))),r.method=d$1.POST,r.path="".concat(We$1(t.channelType),"/").concat(encodeURIComponent(t.channelUrl),"/messages"),r.params=U$1({message_type:ie.FILE,user_id:t.userId,url:t.fileUrl,mention_type:t.mentionType,mentioned_user_ids:i,file_name:t.fileName,file_size:t.fileSize,file_type:t.mimeType,data:t.data,custom_type:t.customType,thumbnails:t.thumbnailSizes.map((function(e){return Gt.payloadify(e)})),require_auth:t.requireAuth,sorted_metaarray:null===(n=t.metaArrays)||void 0===n?void 0:n.map((function(e){return Dt$1.payloadify(e)})),push_option:t.pushNotificationDeliveryOption,parent_message_id:t.parentMessageId>0?t.parentMessageId:null,apple_critical_alert_options:Lt.payloadify(t.appleCriticalAlertOptions),reply_to_channel:t.isReplyToChannel,req_id:t.reqId}),r}return t(n,e),n}(q),Jt=function(e){function n(t,n,r){var i,s,o,a=this;(a=e.call(this,t,"FILE",r)||this).message=new Wt(t,r);var u=St$1.of(t).sdkState;return a.isMentioned=Ye$1(a.message.mentionType,null!==(i=a.message.mentionedUserIds)&&void 0!==i?i:null===(s=a.message.mentionedUsers)||void 0===s?void 0:s.map((function(e){return e.userId})),u.userId),a.forceUpdateLastMessage=null!==(o=r.force_update_last_message)&&void 0!==o&&o,a}return t(n,e),n}(B),Zt=function(e){function n(t,n){var r,i,s=this;(s=e.call(this,t,n)||this).message=new Wt(t,n);var o=St$1.of(t).sdkState;return s.isMentioned=Ye$1(s.message.mentionType,null!==(r=s.message.mentionedUserIds)&&void 0!==r?r:s.message.mentionedUsers.map((function(e){return e.userId})),o.userId),s.forceUpdateLastMessage=null!==(i=n.force_update_last_message)&&void 0!==i&&i,s}return t(n,e),n}(x);!function(e){e[e.PENDING=0]="PENDING",e[e.UPLOADING=1]="UPLOADING",e[e.UPLOADED=2]="UPLOADED",e[e.SENDING=3]="SENDING",e[e.FAILED=4]="FAILED";}(Ut$1||(Ut$1={}));var $t,en=function(){function e(e,t){var n=t.sdkState,r=t.dispatcher,i=t.requestQueue,s=t.onlineDetector,o=t.cacheContext,a=this;this._queueMap=new Map,this._connectionState=null,this._onlineDetector=null,this._iid=e,this._sdkState=n,this._requestQueue=i,this._cacheContext=o,this._dispatcher=r,this._dispatcher.on((function(e){e instanceof de$1&&(a._connectionState=e.stateType);})),this._onlineDetector=s;}return Object.defineProperty(e.prototype,"_shouldSendThroughWebSocket",{get:function(){return this._connectionState===J.CONNECTED||this._connectionState===J.CONNECTING||this._connectionState===J.RECONNECTING},enumerable:!1,configurable:!0}),e.prototype._sendFileMessage=function(e,t){return r(this,void 0,void 0,(function(){var r,s;return i(this,(function(i){switch(i.label){case 0:return this._shouldSendThroughWebSocket?(r=new Xt(n(n({channelUrl:e.url,channelType:e.channelType,url:t.params.fileUrl,requireAuth:t.requireAuth},t.params),{reqId:t.requestId})),[4,this._requestQueue.send(r)]):[3,2];case 1:return s=i.sent(),[2,s.as(Jt).message];case 2:return r=new Yt(n(n({channelUrl:e.url,channelType:e.channelType,url:t.params.fileUrl,userId:this._sdkState.userId,requireAuth:t.requireAuth},t.params),{reqId:t.requestId})),[4,this._requestQueue.send(r)];case 3:return s=i.sent(),[2,s.as(Zt).message]}}))}))},e.prototype._resolveMessageQueue=function(e){return r(this,void 0,void 0,(function(){var t,n,r,o,a,c,l,d,h,f,_,g;return i(this,(function(i){switch(i.label){case 0:if(!(t=this._queueMap.get(e.url)))return [3,21];if(t.isResolving)return [3,20];t.isResolving=!0,n=[],r=!0,i.label=1;case 1:i.trys.push([1,15,16,17]),o=s(t.messageQueue),a=o.next(),i.label=2;case 2:if(a.done)return [3,14];switch(c=a.value,c.state){case Ut$1.PENDING:case Ut$1.UPLOADING:return [3,3];case Ut$1.UPLOADED:return [3,4];case Ut$1.FAILED:return [3,12]}return [3,13];case 3:return r=!1,n.push(c),[3,13];case 4:if(!r)return [3,10];i.label=5;case 5:return i.trys.push([5,8,,9]),c.state=Ut$1.SENDING,[4,this._sendFileMessage(e,c)];case 6:return l=i.sent(),c.deferred.resolve(l),[4,Re$1(100)];case 7:return i.sent(),[3,9];case 8:return d=i.sent(),c.deferred.reject(d),[3,9];case 9:return [3,11];case 10:n.push(c),i.label=11;case 11:return [3,13];case 12:return c.deferred.reject(c.error.code===u.REQUEST_CANCELED?p.fileUploadCanceled:c.error),[3,13];case 13:return a=o.next(),[3,2];case 14:return [3,17];case 15:return h=i.sent(),_={error:h},[3,17];case 16:try{a&&!a.done&&(g=o.return)&&g.call(o);}finally{if(_)throw _.error}return [7];case 17:return f=t.isResolveRequestPending,t.messageQueue=n,t.isResolving=!1,t.isResolveRequestPending=!1,f?[4,this._resolveMessageQueue(e)]:[3,19];case 18:i.sent(),i.label=19;case 19:return [3,21];case 20:t.isResolveRequestPending=!0,i.label=21;case 21:return [2]}}))}))},e.prototype._uploadNextPendingItem=function(e){return r(this,void 0,void 0,(function(){var t,n,r,s,o,a,c,l,d,h,f,_,g,y;return i(this,(function(i){switch(i.label){case 0:return t=this._queueMap.get(e.url),(n=t.messageQueue.find((function(e){return e.state===Ut$1.PENDING})))?S(n.params.file)?t.uploadQueue.length<6?(n.state=Ut$1.UPLOADING,t.uploadQueue.push(n),[4,this._onlineDetector.isOnline()]):[3,10]:[3,11]:[3,13];case 1:if(!i.sent())return [3,8];i.label=2;case 2:return i.trys.push([2,4,5,7]),r=new bt$1({file:n.params.file,channelUrl:e.url,thumbnailSizes:n.params.thumbnailSizes,requestId:n.requestId}),[4,this._requestQueue.send(r)];case 3:return s=i.sent(),o=s.as(Nt$1),a=o.url,c=o.fileSize,l=void 0===c?n.params.fileSize:c,d=o.thumbnailSizes,h=void 0===d?n.params.thumbnailSizes:d,f=o.requireAuth,_=void 0!==f&&f,n.params.fileUrl=a,n.params.fileSize=l,n.params.thumbnailSizes=h,n.params.requireAuth=_,n.requireAuth=_,n.state=Ut$1.UPLOADED,[3,7];case 4:return (g=i.sent()).code===u.REQUEST_FAILED?n.error=new p({code:u.NETWORK_ERROR,message:"Failed to upload a file."}):n.error=g,n.state=Ut$1.FAILED,[3,7];case 5:return (y=t.uploadQueue.findIndex((function(e){return e.requestId===n.requestId})))>=0&&(t.uploadQueue.splice(y,1),this._uploadNextPendingItem(e)),[4,this._resolveMessageQueue(e)];case 6:return i.sent(),[7];case 7:return [3,10];case 8:return n.state=Ut$1.FAILED,n.error=p.connectionRequired,(y=t.uploadQueue.findIndex((function(e){return e.requestId===n.requestId})))>=0&&(t.uploadQueue.splice(y,1),this._uploadNextPendingItem(e)),[4,this._resolveMessageQueue(e)];case 9:i.sent(),i.label=10;case 10:return [3,13];case 11:return n.params.thumbnailSizes=[],n.state=Ut$1.UPLOADED,[4,this._resolveMessageQueue(e)];case 12:i.sent(),i.label=13;case 13:return [2]}}))}))},e.prototype.request=function(e,t,n){var s,o,a;return r(this,void 0,void 0,(function(){var r;return i(this,(function(i){return r=new ee,S(n.file)&&(n.fileName=null!==(s=n.fileName)&&void 0!==s?s:n.file.name,n.mimeType=null!==(o=n.mimeType)&&void 0!==o?o:n.file.type,n.fileSize=null!==(a=n.fileSize)&&void 0!==a?a:n.file.size),this._queueMap.has(e.url)||this._queueMap.set(e.url,{messageQueue:[],uploadQueue:[],isResolving:!1,isResolveRequestPending:!1}),this._queueMap.get(e.url).messageQueue.push({requestId:t,params:n,state:Ut$1.PENDING,deferred:r,requireAuth:n.requireAuth}),this._uploadNextPendingItem(e),[2,r.promise]}))}))},e.prototype.cancel=function(e,t){var n,r;void 0===t&&(t=null);var i=this._queueMap.get(e.url);if(i){var u=t?[i.messageQueue.find((function(e){return e.requestId===t}))]:a([],o(i.messageQueue),!1);try{for(var c=s(u),l=c.next();!l.done;l=c.next()){var d=l.value;if(d)switch(d.state){case Ut$1.PENDING:d.state=Ut$1.FAILED,d.error=p.requestCanceled,this._resolveMessageQueue(e);break;case Ut$1.UPLOADING:this._requestQueue.cancel(d.requestId);}}}catch(e){n={error:e};}finally{try{l&&!l.done&&(r=c.return)&&r.call(c);}finally{if(n)throw n.error}}}},e}(),tn={prevResultSize:0,nextResultSize:0,isInclusive:!1,reverse:!1,messageTypeFilter:se.ALL,customTypesFilter:null,senderUserIdsFilter:null,replyType:ue$1.NONE,includeReactions:!1,includeMetaArray:!1,includeParentMessageInfo:!1,includeThreadInfo:!1,showSubchannelMessagesOnly:!1},nn=function(e){return y("number",e.prevResultSize)&&y("number",e.nextResultSize)&&y("boolean",e.isInclusive)&&y("boolean",e.reverse)&&y("string",e.messageTypeFilter)&&m(se,e.messageTypeFilter)&&E("string",e.customTypesFilter,!0)&&E("string",e.senderUserIdsFilter,!0)&&m(ue$1,e.replyType)&&y("boolean",e.includeMetaArray)&&y("boolean",e.includeReactions)&&y("boolean",e.includeParentMessageInfo)&&y("boolean",e.includeThreadInfo)&&y("boolean",e.showSubchannelMessagesOnly)},rn={replyType:ue$1.NONE,includeReactions:!1,includeThreadInfo:!1,includeMetaArray:!1,includeParentMessageInfo:!1,includePollDetails:!1},sn=function(e){return m(ue$1,e.replyType)&&y("boolean",e.includeReactions)&&y("boolean",e.includeMetaArray)&&y("boolean",e.includeParentMessageInfo)&&y("boolean",e.includeThreadInfo)&&y("boolean",e.includePollDetails)};!function(e){e.UNKNOWN="UNKNOWN",e.EVENT_MESSAGE_SENT_SUCCESS="EVENT_MESSAGE_SENT_SUCCESS",e.EVENT_MESSAGE_SENT_FAILED="EVENT_MESSAGE_SENT_FAILED",e.EVENT_MESSAGE_SENT_PENDING="EVENT_MESSAGE_SENT_PENDING",e.EVENT_MESSAGE_RECEIVED="EVENT_MESSAGE_RECEIVED",e.EVENT_MESSAGE_UPDATED="EVENT_MESSAGE_UPDATED",e.EVENT_MESSAGE_DELETED="EVENT_MESSAGE_DELETED",e.EVENT_MESSAGE_READ="EVENT_MESSAGE_READ",e.EVENT_MESSAGE_DELIVERED="EVENT_MESSAGE_DELIVERED",e.EVENT_MESSAGE_REACTION_UPDATED="EVENT_MESSAGE_REACTION_UPDATED",e.EVENT_MESSAGE_THREADINFO_UPDATED="EVENT_MESSAGE_THREADINFO_UPDATED",e.EVENT_MESSAGE_OFFSET_UPDATED="EVENT_MESSAGE_OFFSET_UPDATED",e.REQUEST_MESSAGE="REQUEST_MESSAGE",e.REQUEST_RESEND_MESSAGE="REQUEST_RESEND_MESSAGE",e.REQUEST_THREADED_MESSAGE="REQUEST_THREADED_MESSAGE",e.REQUEST_MESSAGE_CHANGELOGS="REQUEST_MESSAGE_CHANGELOGS",e.SYNC_MESSAGE_FILL="SYNC_MESSAGE_FILL",e.SYNC_MESSAGE_BACKGROUND="SYNC_MESSAGE_BACKGROUND",e.SYNC_MESSAGE_CHANGELOGS="SYNC_MESSAGE_CHANGELOGS",e.LOCAL_MESSAGE_PENDING_CREATED="LOCAL_MESSAGE_PENDING_CREATED",e.LOCAL_MESSAGE_FAILED="LOCAL_MESSAGE_FAILED",e.LOCAL_MESSAGE_CANCELED="LOCAL_MESSAGE_CANCELED",e.LOCAL_MESSAGE_RESEND_STARTED="LOCAL_MESSAGE_RESEND_STARTED";}($t||($t={}));var on,an=function(e){return e.startsWith("EVENT_")||e===$t.SYNC_MESSAGE_FILL||e===$t.SYNC_MESSAGE_CHANGELOGS},un=function(e){function n(t){var n=t.messages,r=t.source,i=e.call(this)||this;return i.messages=n,i.source=r,i}return t(n,e),n}(L),cn=function(e){function n(t){var n=t.messageIds,r=t.source,i=e.call(this)||this;return i.messageIds=n,i.source=r,i}return t(n,e),n}(L),ln=function(e){function n(t){var n=t.reqId,r=t.source,i=e.call(this)||this;return i.reqId=n,i.source=r,i}return t(n,e),n}(L),dn=function(e){function n(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,s=t.includeMetaArray,o=t.includeReactions,a=t.includeThreadInfo,u=t.includeParentMessageInfo,c=t.includePollDetails,l=e.call(this)||this;return l.method=d$1.GET,l.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i)),l.params={is_sdk:!0,with_sorted_meta_array:s,include_reactions:o,include_thread_info:a,include_parent_message_info:u,include_poll_details:c},l}return t(n,e),n}(q),hn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.message=r?Ht(t,n({},r)):null,i}return t(r,e),r}(x),pn=function(e){function n(t){var n=t.channelType,r=t.channelUrl,i=t.timestamp,s=void 0===i?null:i,o=t.token,a=void 0===o?null:o,u=t.prevResultSize,c=t.nextResultSize,l=t.isInclusive,h=t.reverse,p=t.messageTypeFilter,f=t.customTypesFilter,_=t.senderUserIdsFilter,g=t.replyType,y=t.includeMetaArray,m=t.includeReactions,v=t.parentMessageId,E=t.includeThreadInfo,I=t.includeParentMessageInfo,S=t.showSubchannelMessagesOnly,T=t.includePollDetails,b=e.call(this)||this;return b.method=d$1.GET,b.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages"),b.params=U$1({is_sdk:!0,prev_limit:u,next_limit:c,include:l,reverse:h,message_ts:s,message_id:a,message_type:null!=p?p:null,custom_types:f,sender_ids:_,include_reply_type:g,with_sorted_meta_array:y,include_reactions:m,parent_message_id:v,include_thread_info:E,include_parent_message_info:I,show_subchannel_message_only:S,include_poll_details:T}),b}return t(n,e),n}(q),fn=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.messages=n.messages.map((function(e){return Ht(t,e)})),r}return t(n,e),n}(x),_n=function(e){function n(t){var n=t.channelType,r=t.channelUrl,i=t.timestamp,s=t.token,o=t.replyType,a=t.includeMetaArray,u=t.includeReactions,c=t.includeThreadInfo,l=t.includeParentMessageInfo,h=t.includePollDetails,p=e.call(this)||this;return p.method=d$1.GET,p.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/changelogs"),p.params={change_ts:i,token:s,with_sorted_meta_array:a,include_reactions:u,include_thread_info:c,include_reply_type:o,include_parent_message_info:l,include_poll_details:h},p}return t(n,e),n}(q),gn=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.updatedMessages=n.updated.map((function(e){return Ht(t,e)})),r.deletedMessagesInfo=n.deleted.map((function(e){return {messageId:e.message_id,deletedAt:e.deleted_at}})),r.hasMore=n.has_more,r.nextToken=n.next,r}return t(n,e),n}(x),yn=function(e){function n(t){var n=t.channelUrl,r=t.scheduledMessageId,i=e.call(this)||this;return i.method=d$1.GET,i.path="".concat(_e$1,"/").concat(encodeURIComponent(n),"/scheduled_messages/").concat(encodeURIComponent(r)),i.params={},i}return t(n,e),n}(q),mn=function(e){function r(t,r){var i=e.call(this,t,r)||this;return i.message=r?Ht(t,n({},r)):null,i}return t(r,e),r}(x),vn={},En=function(){function e(e,t){var n=t.sdkState,r=t.dispatcher,i=t.requestQueue,s=t.onlineDetector,o=t.cacheContext;this._iid=e,this._sdkState=n,this._requestQueue=i,this._dispatcher=r,this._onlineDetector=s,this._cacheContext=o,this.fileMessageQueue=new en(e,{sdkState:n,dispatcher:r,requestQueue:i,onlineDetector:s,cacheContext:o}),vn[e]=this;}return e.of=function(e){return vn[e]},e.prototype.buildMessageFromSerializedData=function(e){var t=ot$1(e);switch(t.messageType){case ie.USER:return new Vt(this._iid,Vt.payloadify(t));case ie.FILE:return new Wt(this._iid,Wt.payloadify(t));case ie.ADMIN:return new Kt(this._iid,Kt.payloadify(t))}return null},e.prototype.buildUserMessageCreateParamsFromSerializedData=function(e,t){return U$1({data:t.data,customType:t.customType,mentionType:t.mentionType,mentionedUserIds:t.mentionedUserIds,mentionedUsers:t.mentionedUsers,mentionedMessageTemplate:t.mentionedMessageTemplate,metaArrays:t.metaArrays,parentMessageId:t.parentMessageId,isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption,appleCriticalAlertOptions:t.appleCriticalAlertOptions,reqId:t.reqId,message:t.message,translationTargetLanguages:Object.keys(t.translations)})},e.prototype.buildFileMessageCreateParamsFromSerializedData=function(e,t){return U$1({data:t.data,customType:t.customType,mentionType:t.mentionType,mentionedUserIds:t.mentionedUserIds,mentionedUsers:t.mentionedUsers,mentionedMessageTemplate:t.mentionedMessageTemplate,metaArrays:t.metaArrays,parentMessageId:t.parentMessageId,isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption,appleCriticalAlertOptions:t.appleCriticalAlertOptions,reqId:t.reqId,file:e.file,fileKey:e.fileKey,fileUrl:t.url,fileName:t.name,fileSize:t.size,mimeType:t.type,thumbnailSizes:t.thumbnails.map((function(e){return {maxWidth:e.width,maxHeight:e.height}})),fileType:e.fileType,requireAuth:t.requireAuth})},e.prototype.buildScheduledUserMessageCreateParamsFromSerializedData=function(e,t){return n(n({},this.buildUserMessageCreateParamsFromSerializedData(e,t)),{scheduledAt:e.scheduledAt})},e.prototype.buildScheduledFileMessageCreateParamsFromSerializedData=function(e,t){return n(n({},this.buildFileMessageCreateParamsFromSerializedData(e,t)),{scheduledAt:e.scheduledAt})},e.prototype.buildSenderFromSerializedData=function(e){var t=ot$1(e);return new xt(this._iid,xt.payloadify(t))},e.prototype.getMessage=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return t=new dn(e),[4,this._requestQueue.send(t)];case 1:return n=r.sent(),[2,n.as(hn).message]}}))}))},e.prototype.getScheduledMessage=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return t=new yn(e),[4,this._requestQueue.send(t)];case 1:return n=r.sent(),[2,n.as(mn).message]}}))}))},e.prototype.getMessagesByMessageId=function(e,t,s,o,a){return void 0===a&&(a=$t.REQUEST_MESSAGE),r(this,void 0,void 0,(function(){var r,u,c;return i(this,(function(i){switch(i.label){case 0:return r=new pn(n(n({channelType:t,channelUrl:e,token:String(s)},tn),o)),[4,this._requestQueue.send(r)];case 1:return u=i.sent(),c=u.as(fn).messages,this._dispatcher.dispatch(new un({messages:c,source:a})),[2,c]}}))}))},e.prototype.getMessagesByTimestamp=function(e,t,s,o,a){return void 0===a&&(a=$t.REQUEST_MESSAGE),r(this,void 0,void 0,(function(){var r,u,c;return i(this,(function(i){switch(i.label){case 0:return r=new pn(n(n({channelType:t,channelUrl:e,timestamp:s},tn),o)),[4,this._requestQueue.send(r)];case 1:return u=i.sent(),c=u.as(fn).messages,this._dispatcher.dispatch(new un({messages:c,source:a})),[2,c]}}))}))},e.prototype.getThreadedMessagesByTimestamp=function(e,t,s,o){return void 0===o&&(o=$t.REQUEST_THREADED_MESSAGE),r(this,void 0,void 0,(function(){var r,a,u,c;return i(this,(function(i){switch(i.label){case 0:return r=new pn(n(n(n({channelUrl:e.channelUrl,channelType:e.channelType,timestamp:t},Qt),s),{replyType:ue$1.ALL,parentMessageId:e.messageId,includeThreadInfo:!0})),[4,this._requestQueue.send(r)];case 1:return a=i.sent(),u=a.as(fn).messages,(c=u.slice(1)).forEach((function(t){t.parentMessage=e;})),this._dispatcher.dispatch(new un({messages:c,source:o})),[2,{parentMessage:u[0],threadedMessages:c}]}}))}))},e.prototype.getMessageChangelogs=function(e,t,s,o,a){return void 0===a&&(a=$t.REQUEST_MESSAGE_CHANGELOGS),r(this,void 0,void 0,(function(){var r,u,c,l,d,h,p,f;return i(this,(function(i){switch(i.label){case 0:return r=new _n(U$1(n(n({channelType:t,channelUrl:e,timestamp:"number"==typeof s?s:null,token:"string"==typeof s?s:null},rn),o))),[4,this._requestQueue.send(r)];case 1:return u=i.sent(),c=u.as(gn),l=c.updatedMessages,d=c.deletedMessagesInfo,h=c.hasMore,p=c.nextToken,f=d.map((function(e){return e.messageId})),l.length>0&&this._dispatcher.dispatch(new un({messages:l,source:a})),f.length>0&&this._dispatcher.dispatch(new cn({messageIds:f,source:a})),[2,{updatedMessages:l,deletedMessageIds:f,hasMore:h,token:p}]}}))}))},e}(),In=function(){function e(){this._onPending=Y,this._onFailed=Y,this._onSucceeded=Y;}return e.prototype._trigger=function(e,t){switch(t.sendingStatus){case le$1.PENDING:this._onPending(t);break;case le$1.FAILED:case le$1.CANCELED:this._onFailed(e,t.scheduledInfo?null:t);break;case le$1.SCHEDULED:case le$1.SUCCEEDED:this._onSucceeded(t);}},e.prototype.onPending=function(e){return this._onPending=e,this},e.prototype.onFailed=function(e){return this._onFailed=e,this},e.prototype.onSucceeded=function(e){return this._onSucceeded=e,this},e}(),Sn=function(e){function n(t,n){var r=e.call(this,t)||this;r.threadInfo=null,r.targetMessageId=0,r.channelUrl=null,r.channelType=null;var i=n.thread_info,s=n.root_message_id,o=n.channel_url,a=n.channel_type;return i&&y("object",i)&&y("number",s)&&y("string",o)&&y("string",a)&&(r.threadInfo=new At$1(t,i),r.targetMessageId=s,r.channelUrl=o,r.channelType=a),r}return t(n,e),n}(Be$1),Tn={channelUrl:null,channelType:null,messageId:0,includeReactions:!1,includeMetaArray:!1,includeParentMessageInfo:!1,includeThreadInfo:!1,includePollDetails:!1},bn=function(){function e(e,t){var n;this._iid=null,this.limit=20,this._isLoading=!1,this._hasNext=!0,this._token="",this._iid=e,this.limit=null!==(n=t.limit)&&void 0!==n?n:20;}return Object.defineProperty(e.prototype,"hasNext",{get:function(){return this._hasNext},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isLoading",{get:function(){return this._isLoading},enumerable:!1,configurable:!0}),e.prototype._validate=function(){return y("number",this.limit)&&this.limit>0},e}(),Nn=function(e){function n(t){var n=t.channelCustomType,r=t.keyword,i=t.limit,s=t.reverse,o=t.exactMatch,a=t.channelUrl,u=t.order,c=t.messageTimestampFrom,l=t.messageTimestampTo,h=t.advancedQuery,p=t.targetFields,f=t.nextToken,_=e.call(this)||this;return _.method=d$1.GET,_.path="".concat(ve$1,"/messages"),_.params={custom_type:n,query:r,limit:i,reverse:s,exact_match:o,channel_url:a,message_ts_from:c,message_ts_to:l,sort_field:u,advanced_query:h,target_fields:p,after:f},_}return t(n,e),n}(q),An=function(e){function n(t,n){var r=e.call(this,t,n)||this;return r.messages=n.results.map((function(e){return Ht(t,e)})),r.hasNext=n.has_next,r.nextToken=n.end_cursor,r.totalCount=n.total_count,r}return t(n,e),n}(x);!function(e){e.SCORE="score",e.TIMESTAMP="ts";}(on||(on={}));(function(e){function s(t,n){var r,i,s,o,a,u,c,l,d,h=this;return (h=e.call(this,t,n)||this).keyword="",h.reverse=!1,h.exactMatch=!1,h.channelUrl="",h.channelCustomType="",h.messageTimestampFrom=null,h.messageTimestampTo=null,h.order=on.SCORE,h.advancedQuery=!1,h.targetFields=null,h._nextToken="",h.totalCount=-1,h.keyword=n.keyword,h.reverse=null!==(r=n.reverse)&&void 0!==r&&r,h.exactMatch=null!==(i=n.exactMatch)&&void 0!==i&&i,h.channelUrl=null!==(s=n.channelUrl)&&void 0!==s?s:"",h.channelCustomType=null!==(o=n.channelCustomType)&&void 0!==o?o:"",h.messageTimestampFrom=null!==(a=n.messageTimestampFrom)&&void 0!==a?a:null,h.messageTimestampTo=null!==(u=n.messageTimestampTo)&&void 0!==u?u:null,h.order=null!==(c=n.order)&&void 0!==c?c:on.SCORE,h.advancedQuery=null!==(l=n.advancedQuery)&&void 0!==l&&l,h.targetFields=null!==(d=n.targetFields)&&void 0!==d?d:null,h}return t(s,e),s.prototype._validate=function(){return e.prototype._validate.call(this)&&y("string",this.keyword)&&this.keyword.length>0&&y("boolean",this.reverse)&&y("boolean",this.exactMatch)&&y("string",this.channelUrl)&&y("string",this.channelCustomType)&&(y("number",this.messageTimestampFrom)||null===this.messageTimestampFrom)&&(y("number",this.messageTimestampTo)||null===this.messageTimestampTo)&&m(on,this.order)&&y("boolean",this.advancedQuery)&&E("string",this.targetFields,!0)},s.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,r,s,o,a,u,c;return i(this,(function(i){switch(i.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=St$1.of(this._iid).requestQueue,t=new Nn(n(n({},this),{nextToken:this._nextToken?this._nextToken:null})),[4,e.send(t)]):[3,2]:[3,5];case 1:return r=i.sent(),s=r.as(An),o=s.messages,a=s.hasNext,u=s.nextToken,c=s.totalCount,this._nextToken=u,this._hasNext=a,this._isLoading=!1,this.totalCount=c,[2,o];case 2:return [2,[]];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},s})(bn);var On=function(e){function n(t,n,r,i){var s=e.call(this,t,i)||this;return s.channelUrl=n,s.channelType=r,s}return t(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&y("string",this.channelUrl)&&m(ne,this.channelType)},n}(bn),wn=function(e){function n(t,n,r,i){var s,o,a,u,c,l,d,h,p,f,_=this;return (_=e.call(this,t,n,r,i)||this).reverse=!1,_.messageTypeFilter=se.ALL,_.customTypesFilter=null,_.senderUserIdsFilter=null,_.replyType=ue$1.NONE,_.includeMetaArray=!1,_.includeReactions=!1,_.includeParentMessageInfo=!1,_.includeThreadInfo=!1,_.showSubchannelMessagesOnly=!1,_._edge=Number.MAX_SAFE_INTEGER,_.reverse=null!==(s=i.reverse)&&void 0!==s&&s,_.messageTypeFilter=null!==(o=i.messageTypeFilter)&&void 0!==o?o:se.ALL,_.customTypesFilter=null!==(a=i.customTypesFilter)&&void 0!==a?a:null,_.senderUserIdsFilter=null!==(u=i.senderUserIdsFilter)&&void 0!==u?u:null,_.replyType=null!==(c=i.replyType)&&void 0!==c?c:ue$1.NONE,_.includeMetaArray=null!==(l=i.includeMetaArray)&&void 0!==l&&l,_.includeReactions=null!==(d=i.includeReactions)&&void 0!==d&&d,_.includeParentMessageInfo=null!==(h=i.includeParentMessageInfo)&&void 0!==h&&h,_.includeThreadInfo=null!==(p=i.includeThreadInfo)&&void 0!==p&&p,_.showSubchannelMessagesOnly=null!==(f=i.showSubchannelMessagesOnly)&&void 0!==f&&f,_}return t(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&y("boolean",this.reverse)&&m(se,this.messageTypeFilter)&&m(ue$1,this.replyType)&&E("string",this.customTypesFilter,!0)&&E("string",this.senderUserIdsFilter,!0)&&y("boolean",this.includeMetaArray)&&y("boolean",this.includeReactions)&&y("boolean",this.includeParentMessageInfo)&&y("boolean",this.includeThreadInfo)&&y("boolean",this.showSubchannelMessagesOnly)},n.prototype.load=function(){return r(this,void 0,void 0,(function(){var e;return i(this,(function(t){switch(t.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,[4,En.of(this._iid).getMessagesByTimestamp(this.channelUrl,this.channelType,this._edge,{prevResultSize:this.limit,nextResultSize:0,isInclusive:!1,reverse:this.reverse,messageTypeFilter:this.messageTypeFilter,customTypesFilter:this.customTypesFilter,replyType:this.replyType,senderUserIdsFilter:this.senderUserIdsFilter,includeReactions:this.includeReactions,includeMetaArray:this.includeMetaArray,includeParentMessageInfo:this.includeParentMessageInfo,includeThreadInfo:this.includeThreadInfo,showSubchannelMessagesOnly:this.showSubchannelMessagesOnly})]):[3,2]:[3,5];case 1:return e=t.sent(),this._edge=Math.min.apply(Math,a([Number.MAX_SAFE_INTEGER],o(e.map((function(e){return e.createdAt}))),!1)),this._hasNext=e.length>=this.limit,this._isLoading=!1,[2,e];case 2:return [2,[]];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},n}(On),Rn={channelUrl:null,scheduledMessageId:0};(function(e){function s(){var t=null!==e&&e.apply(this,arguments)||this;return t.name="message",t}return t(s,e),s.prototype.init=function(t,n){var r=n.sdkState,i=n.dispatcher,s=n.sessionManager,o=n.requestQueue,a=n.logger,u=n.onlineDetector,c=n.cacheContext;e.prototype.init.call(this,t,{sdkState:r,dispatcher:i,sessionManager:s,requestQueue:o,logger:a,onlineDetector:u,cacheContext:c}),this._manager=new En(t,{sdkState:r,dispatcher:i,requestQueue:o,onlineDetector:u,cacheContext:c});},s.prototype.buildMessageFromSerializedData=function(e){return this._manager.buildMessageFromSerializedData(e)},s.prototype.buildSenderFromSerializedData=function(e){return this._manager.buildSenderFromSerializedData(e)},s.prototype.getMessage=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return e=n(n({},Tn),e),at$1(function(e){return y("string",e.channelUrl)&&y("string",e.channelType)&&m(ne,e.channelType)&&y("number",e.messageId)&&y("boolean",e.includeMetaArray)&&y("boolean",e.includeParentMessageInfo)&&y("boolean",e.includeThreadInfo)&&y("boolean",e.includePollDetails)}(e)).throw(p.invalidParameters),[2,this._manager.getMessage(e)]}))}))},s.prototype.getScheduledMessage=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return e=n(n({},Rn),e),at$1(function(e){return y("string",e.channelUrl)&&y("number",e.scheduledMessageId)}(e)).throw(p.invalidParameters),[2,this._manager.getScheduledMessage(e)]}))}))},s})(Tt$1);
16
-
17
- var ue,ce={data:null,customType:null,mentionType:ae.USERS,mentionedUserIds:null,mentionedUsers:null,mentionedMessageTemplate:null,metaArrays:null,parentMessageId:null,isReplyToChannel:!1,pushNotificationDeliveryOption:null,appleCriticalAlertOptions:null},le=function(u){return y("string",u.data,!0)&&y("string",u.customType,!0)&&m(ae,u.mentionType)&&E("string",u.mentionedUserIds,!0)&&E(ct$1,u.mentionedUsers,!0)&&y("string",u.mentionedMessageTemplate,!0)&&E(Dt$1,u.metaArrays,!0)&&y("number",u.parentMessageId,!0)&&y("boolean",u.isReplyToChannel)&&m(ce$1,u.pushNotificationDeliveryOption,!0)&&y(Lt,u.appleCriticalAlertOptions,!0)},de=function(e){return e?{isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption}:null},he=n(n({},ce),{message:null,translationTargetLanguages:null}),pe=function(e){return le(e)&&y("string",e.message)&&E("string",e.translationTargetLanguages,!0)};!function(e){e.FILE="file",e.BLOB="blob",e.BLOB_LIKE_OBJECT="blobLikeObject",e.URL="url";}(ue||(ue={}));var fe,me=function(e){return "undefined"!=typeof window&&"Blob"in window&&"undefined"!=typeof Blob&&e instanceof Blob},ye=function(e){return e===ue.BLOB||e===ue.FILE},ve=function(e){return e?{file:e.file,fileKey:e.fileKey,fileType:e.fileType,isReplyToChannel:e.isReplyToChannel,pushNotificationDeliveryOption:e.pushNotificationDeliveryOption}:null},ge=n(n({},ce),{file:null,fileKey:null,fileUrl:null,fileName:null,fileType:null,fileSize:null,mimeType:null,thumbnailSizes:null,requireAuth:!1}),_e=function(e){return le(e)&&(S(e.file)||y("string",e.fileUrl))&&y("string",e.fileName,!0)&&y("string",e.mimeType,!0)&&y("number",e.fileSize,!0)&&(null===e.thumbnailSizes||Array.isArray(e.thumbnailSizes)&&e.thumbnailSizes.every((function(e){return y("object",e)&&e.maxWidth>0&&e.maxHeight>0})))};!function(e){e.MUTED="muted",e.BANNED="banned";}(fe||(fe={}));var Te,Ue=function(){function e(e){var t,r,i;this.restrictionType=null,this.description=null,this.endAt=-1,m(fe,e.restriction_type)&&(this.restrictionType=e.restriction_type),this.description=null!==(t=e.description)&&void 0!==t?t:null,this.endAt=null!==(i=null!==(r=e.end_at)&&void 0!==r?r:e.muted_end_at)&&void 0!==i?i:-1;}return e.payloadify=function(e){return e?U$1({restriction_type:e.restrictionType,description:e.description,end_at:e.endAt}):null},e}(),Ie=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.restrictionInfo=null,r.restrictionInfo=new Ue(n),r}return t(t$1,e),t$1.payloadify=function(t){return t?U$1(n(n({},e.payloadify.call(this,t)),Ue.payloadify(t.restrictionInfo))):null},t$1}(ct$1),we={data:null,customType:null,mentionType:ae.USERS,mentionedUserIds:null,mentionedUsers:null,mentionedMessageTemplate:null,metaArrays:null,pushNotificationDeliveryOption:null,appleCriticalAlertOptions:null},Me=function(u){return y("string",u.data,!0)&&y("string",u.customType,!0)&&m(ae,u.mentionType)&&E("string",u.mentionedUserIds,!0)&&E(ct$1,u.mentionedUsers,!0)&&y("string",u.mentionedMessageTemplate,!0)&&E(Dt$1,u.metaArrays,!0)&&m(ce$1,u.pushNotificationDeliveryOption,!0)&&y(Lt,u.appleCriticalAlertOptions,!0)},Ee=n(n({},we),{message:null,translationTargetLanguages:null}),Se=function(e){return Me(e)&&y("string",e.message,!0)&&E("string",e.translationTargetLanguages,!0)},be=n({},we),Ce=function(e){function t$1(t){var n=t.channelUrl,r=t.channelType,i=t.token,a=t.limit,s=e.call(this)||this;return s.method=d$1.GET,s.path="".concat(We$1(r),"/").concat(encodeURIComponent(n),"/operators"),s.params={token:i,limit:a},s}return t(t$1,e),t$1}(q),Ae=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.operators=n.operators.map((function(e){return new ct$1(t,e)})),r.token=n.next,r}return t(t$1,e),t$1}(x),Pe=function(e){function t$1(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(t$1,e),t$1.prototype._validate=function(){return e.prototype._validate.call(this)},t$1.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,n$1,r,i$1,a,s;return i(this,(function(o){switch(o.label){case 0:return this._validate()?this._isLoading?[3,3]:(e=[],this._hasNext?(this._isLoading=!0,t=St$1.of(this._iid).requestQueue,n$1=new Ce(n(n({},this),{channelUrl:this.channelUrl,token:this._token})),[4,t.send(n$1)]):[3,2]):[3,5];case 1:return r=o.sent(),i$1=r.as(Ae),a=i$1.operators,s=i$1.token,this._token=s,this._hasNext=!!s,this._isLoading=!1,[2,a];case 2:return [2,e];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},t$1}(On),De=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.limit,s=t.token;return (n=e.call(this)||this).method=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute"),n.params={limit:a,token:s},n}return t(t$1,e),t$1}(q),Re=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.token=null,r.mutedUsers=[];var i=n.next,a=n.muted_list;return r.token=i,a&&a.length>0&&(r.mutedUsers=a.map((function(e){return new Ie(t,e)}))),r}return t(t$1,e),t$1}(x),qe=function(e){function t$1(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(t$1,e),t$1.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,n$1,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=St$1.of(this._iid).requestQueue,t=new De(n(n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n$1=s.sent(),r=n$1.as(Re),i$1=r.mutedUsers,a=r.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,i$1];case 2:return [2,[]];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},t$1}(On),Oe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.limit,s=t.token;return (n=e.call(this)||this).method=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban"),n.params=U$1({limit:a,token:s}),n}return t(t$1,e),t$1}(q),ke=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.token=null,r.bannedUsers=[];var i=n.next,a=n.banned_list;return r.token=i,a&&a.length>0&&(r.bannedUsers=a.map((function(e){return new Ie(t,e.user)}))),r}return t(t$1,e),t$1}(x),Ne=function(e){function t$1(t,n,r,i){return e.call(this,t,n,r,i)||this}return t(t$1,e),t$1.prototype._validate=function(){return e.prototype._validate.call(this)},t$1.prototype.next=function(){return r(this,void 0,void 0,(function(){var e,t,n$1,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=St$1.of(this._iid).requestQueue,t=new Oe(n(n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n$1=s.sent(),r=n$1.as(ke),i$1=r.bannedUsers,a=r.token,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,i$1];case 2:return [2,[]];case 3:throw p.queryInProgress;case 4:return [3,6];case 5:throw p.invalidParameters;case 6:return [2]}}))}))},t$1}(On);!function(e){e.SPAM="spam",e.HARASSING="harassing",e.SUSPICIOUS="suspicious",e.INAPPROPRIATE="inappropriate";}(Te||(Te={}));var Fe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.operatorUserIds;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/operators"),n.params={operator_ids:a},n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var Le=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.operatorUserIds;return (n=e.call(this)||this).method=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/operators"),n.params={operator_ids:a},n}return t(t$1,e),t$1}(q);!function(e){function t$1(t,n){return e.call(this,t,n)||this}t(t$1,e);}(x);var Qe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId;return (n=e.call(this)||this).method=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute/").concat(a),n}return t(t$1,e),t$1}(q),ze=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.isMuted=!1,r.startAt=null,r.endAt=null,r.remainingDuration=null,r.description=null;var i=n.is_muted,a=n.start_at,s=n.end_at,o=n.remaining_duration,u=n.description;return r.isMuted=i,r.startAt=a,r.endAt=s,r.remainingDuration=o,r.description=u,r}return t(t$1,e),t$1}(x),xe=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.keys;return (n=e.call(this)||this).method=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={keys:a,include_ts:!0},n}return t(t$1,e),t$1}(q),Ge=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.metadata,a=n.ts;return r.metadata=i,r.ts=null!=a?a:null,r}return t(t$1,e),t$1}(x),Be=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.metadata,s=t.upsert;return (n=e.call(this)||this).method=d$1.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={metadata:a,include_ts:!0,upsert:null!=s&&s},n}return t(t$1,e),t$1}(q),je=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.metadata,a=n.ts;return r.metadata=i,r.ts=null!=a?a:null,r}return t(t$1,e),t$1}(x),Ve=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.created=null,i.updated=null,i.deleted=null,r.data&&(i.created=r.data.created,i.updated=r.data.updated,i.deleted=r.data.deleted),i}return t(t$1,e),t$1}(B),We=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.key;return (n=e.call(this)||this).method=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata/").concat(a),n.params={include_ts:!0},n}return t(t$1,e),t$1}(q),Ke=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.ts;return r.ts=null!=i?i:null,r}return t(t$1,e),t$1}(x),Ye=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType;return (n=e.call(this)||this).method=d$1.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metadata"),n.params={include_ts:!0},n}return t(t$1,e),t$1}(q),He=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;r.ts=null;var i=n.ts;return r.ts=null!=i?i:null,r}return t(t$1,e),t$1}(x),Je=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.keys;return (n=e.call(this)||this).method=d$1.GET,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={keys:a},n}return t(t$1,e),t$1}(q),Xe=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.metaCounter=n,r}return t(t$1,e),t$1}(x),Ze=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.metaCounter;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={metacounter:a},n}return t(t$1,e),t$1}(q),$e=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.metaCounter=n,r}return t(t$1,e),t$1}(x),et=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.metaCounter,s=t.upsert,o=void 0!==s&&s,u=t.mode,c=void 0===u?"set":u;return (n=e.call(this)||this).method=d$1.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params={metacounter:a,upsert:o,mode:c},n}return t(t$1,e),t$1}(q),tt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.metaCounter=n,r}return t(t$1,e),t$1}(x),nt=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.created=null,i.updated=null,i.deleted=null,r.data&&(i.created=r.data.created,i.updated=r.data.updated,i.deleted=r.data.deleted),i}return t(t$1,e),t$1}(B),rt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.key;return (n=e.call(this)||this).method=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter/").concat(a),n.params=null,n}return t(t$1,e),t$1}(q);!function(e){function t$1(t,n){return e.call(this,t,n)||this}t(t$1,e);}(x);var it=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType;return (n=e.call(this)||this).method=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/metacounter"),n.params=null,n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var at=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId,s=t.seconds,o=t.description;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute"),n.params={user_id:a,seconds:s,description:o},n}return t(t$1,e),t$1}(q);!function(e){function t$1(t,n){return e.call(this,t,n)||this}t(t$1,e);}(x);var st=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.user=new Ie(t,r.data),i}return t(t$1,e),t$1}(B),ot=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId;return (n=e.call(this)||this).method=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/mute/").concat(encodeURIComponent(a)),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var ut=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.user=new Ie(t,r.data),i}return t(t$1,e),t$1}(B),ct=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId,s=t.seconds,o=t.description;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban"),n.params=U$1({user_id:a,seconds:s,description:o}),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var lt=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.memberCount=null,i.joinedMemberCount=null,i.user=new Ie(t,r.data),r.data.member_count&&(i.memberCount=r.data.member_count),r.data.joined_member_count&&(i.joinedMemberCount=r.data.joined_member_count),i}return t(t$1,e),t$1}(B),dt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.userId;return (n=e.call(this)||this).method=d$1.DELETE,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/ban/").concat(encodeURIComponent(a)),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var ht=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.user=new Ie(t,r.data),i}return t(t$1,e),t$1}(B),pt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.freezing;return (n=e.call(this)||this).method=d$1.PUT,n.path="".concat(We$1(i),"/").concat(encodeURIComponent(r),"/freeze"),n.params={freeze:a},n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var ft=function(e){function t$1(t,n,r){var i=e.call(this,t,"SYEV",r)||this;return i.freeze=r.data.freeze,i}return t(t$1,e),t$1}(B),mt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.category,s=t.userId,o=t.description;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(Xe$1(i),"/").concat(encodeURIComponent(r)),n.params={report_category:a,reporting_user_id:s,report_description:o},n}return t(t$1,e),t$1}(q),yt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.category,s=t.userId,o=t.offendingUserId,u=t.description;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(Ee$1,"/users/").concat(o),n.params={channel_url:r,channel_type:i===ne.OPEN?"open_channels":"group_channels",report_category:a,reporting_user_id:s,report_description:u},n}return t(t$1,e),t$1}(q),vt=function(e){function t$1(t){var n=this,r=t.channelUrl,i=t.channelType,a=t.category,s=t.userId,o=t.offendingUserId,u=t.messageId,c=t.description;return (n=e.call(this)||this).method=d$1.POST,n.path="".concat(Xe$1(i),"/").concat(encodeURIComponent(r),"/messages/").concat(u),n.params={report_category:a,reporting_user_id:s,report_description:c,offending_user_id:o},n}return t(t$1,e),t$1}(q),gt=function(t$1){function n(n){var r=[];return n.mentionType===ae.USERS&&(n.mentionedUserIds?r=n.mentionedUserIds:n.mentionedUsers&&(r=n.mentionedUsers.map((function(e){return e.userId})))),t$1.call(this,{code:"MESG",ackRequired:!0,payload:U$1({channel_url:n.channelUrl,message:n.message,data:n.data,custom_type:n.customType,metaarray:n.metaArrays,mention_type:n.mentionType,mentioned_user_ids:r,mentioned_message_template:n.mentionedMessageTemplate,target_langs:n.translationTargetLanguages,push_option:n.pushNotificationDeliveryOption&&n.pushNotificationDeliveryOption!==ce$1.DEFAULT?n.pushNotificationDeliveryOption:void 0,apple_critical_alert_options:n.appleCriticalAlertOptions,silent:n.silent,reply_to_channel:n.isReplyToChannel,parent_message_id:n.parentMessageId>0?n.parentMessageId:null,req_id:n.reqId})})||this}return t(n,t$1),n}(H$1),_t=function(e){function t$1(t,n,r){var i,a,s,o=this;(o=e.call(this,t,"MESG",r)||this).message=new Vt(t,r);var u=St$1.of(t).sdkState;return o.isMentioned=Ye$1(o.message.mentionType,null!==(i=o.message.mentionedUserIds)&&void 0!==i?i:null===(a=o.message.mentionedUsers)||void 0===a?void 0:a.map((function(e){return e.userId})),u.userId),o.forceUpdateLastMessage=null!==(s=r.force_update_last_message)&&void 0!==s&&s,o}return t(t$1,e),t$1}(B),Tt=function(t$1){function n(n){var r=[];return n.mentionType===ae.USERS&&(n.mentionedUserIds?r=n.mentionedUserIds:n.mentionedUsers&&(r=n.mentionedUsers.map((function(e){return e.userId})))),t$1.call(this,{code:"MEDI",ackRequired:!0,payload:U$1({channel_url:n.channelUrl,msg_id:n.messageId,message:n.message,data:n.data,custom_type:n.customType,metaarray:n.metaArrayParams,mention_type:n.mentionType,mentioned_user_ids:r,mentioned_message_template:n.mentionedMessageTemplate,apple_critical_alert_options:n.appleCriticalAlertOptions})})||this}return t(n,t$1),n}(H$1),Ut=function(e){function t$1(t,n,r){var i,a,s,o,u,c,l=this;(l=e.call(this,t,"MEDI",r)||this).message=new Vt(t,r);var d=St$1.of(t).sdkState;return l.mentionCountChange=Je$1({mentionType:null!==(a=null===(i=r.old_values)||void 0===i?void 0:i.mention_type)&&void 0!==a?a:null,mentionedUserIds:null!==(o=null===(s=r.old_values)||void 0===s?void 0:s.mentioned_user_ids)&&void 0!==o?o:[]},{mentionType:l.message.mentionType,mentionedUserIds:null!==(u=l.message.mentionedUserIds)&&void 0!==u?u:null===(c=l.message.mentionedUsers)||void 0===c?void 0:c.map((function(e){return e.userId}))},d.userId),l}return t(t$1,e),t$1}(B),It=function(t$1){function n(n){var r=[];return n.mentionType===ae.USERS&&(n.mentionedUserIds?r=n.mentionedUserIds:n.mentionedUsers&&(r=n.mentionedUsers.map((function(e){return e.userId})))),t$1.call(this,{code:"FEDI",ackRequired:!0,payload:U$1({channel_url:n.channelUrl,msg_id:n.messageId,data:n.data,custom_type:n.customType,metaarray:n.metaArrayParams,mention_type:n.mentionType,mentioned_user_ids:r,apple_critical_alert_options:n.appleCriticalAlertOptions})})||this}return t(n,t$1),n}(H$1),wt=function(e){function t$1(t,n,r){var i,a,s,o,u,c,l=this;(l=e.call(this,t,"FEDI",r)||this).message=new Wt(t,r);var d=St$1.of(t).sdkState;return l.mentionCountChange=Je$1({mentionType:null!==(a=null===(i=r.old_values)||void 0===i?void 0:i.mention_type)&&void 0!==a?a:null,mentionedUserIds:null!==(o=null===(s=r.old_values)||void 0===s?void 0:s.mentioned_user_ids)&&void 0!==o?o:[]},{mentionType:l.message.mentionType,mentionedUserIds:null!==(u=l.message.mentionedUserIds)&&void 0!==u?u:null===(c=l.message.mentionedUsers)||void 0===c?void 0:c.map((function(e){return e.userId}))},d.userId),l}return t(t$1,e),t$1}(B),Mt=function(e){function t$1(t){var n=e.call(this)||this;return n.method=d$1.DELETE,n.path="".concat(We$1(t.channelType),"/").concat(t.channelUrl,"/messages/").concat(t.messageId),n}return t(t$1,e),t$1}(q);!function(e){function t$1(){return null!==e&&e.apply(this,arguments)||this}t(t$1,e);}(x);var Et=function(e){function t$1(t,n,r){var i=e.call(this,t,"DELM",r)||this;return i.channelUrl=r.channel_url,i.channelType=r.channel_type,i.messageId=Number(r.msg_id),i}return t(t$1,e),t$1}(B),St=function(e){function t$1(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,a=t.reactionKey,s=e.call(this)||this;return s.method=d$1.POST,s.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(i,"/reactions"),s.params={reaction:a},s}return t(t$1,e),t$1}(q),bt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.reactionEvent=new wt$1(n),r}return t(t$1,e),t$1}(x),Ct=function(e){function t$1(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,a=t.reactionKey,s=e.call(this)||this;return s.method=d$1.DELETE,s.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(i,"/reactions"),s.params={reaction:a},s}return t(t$1,e),t$1}(q),At=function(e){function t$1(t,n$1){var r=e.call(this,t,n$1)||this;return r.reactionEvent=new wt$1(n({},n$1)),r}return t(t$1,e),t$1}(x),Pt=function(e){function t$1(t){var n=t.channelType,r=t.channelUrl,i=t.messageId,a=t.translationTargetLanguages,s=e.call(this)||this;return s.method=d$1.POST,s.path="".concat(We$1(n),"/").concat(encodeURIComponent(r),"/messages/").concat(encodeURIComponent(i),"/translation"),s.params={target_langs:a},s}return t(t$1,e),t$1}(q),Dt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.message=new Vt(t,n),r}return t(t$1,e),t$1}(x),Rt=function(t$1){function n(n){var r,i=this;i=t$1.call(this)||this;var s=[];n.mentionType===ae.USERS&&(n.mentionedUserIds?s=n.mentionedUserIds:n.mentionedUsers&&(s=n.mentionedUsers.map((function(e){return e.userId}))));var u=n.channelType,c=n.channelUrl;return i.method=d$1.POST,i.path="".concat(We$1(u),"/").concat(encodeURIComponent(c),"/scheduled_messages"),i.params={req_id:n.reqId,scheduled_at:n.scheduledAt,message_type:oe.USER,message:n.message,custom_type:n.customType,data:n.data,mention_type:n.mentionType,mentioned_user_ids:s,sorted_metaarray:null===(r=n.metaArrays)||void 0===r?void 0:r.map((function(e){return Dt$1.payloadify(e)})),apple_critical_alert_options:Lt.payloadify(n.appleCriticalAlertOptions),target_langs:n.translationTargetLanguages,push_option:n.pushNotificationDeliveryOption},i}return t(n,t$1),n}(q),qt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.message=new Vt(t,n),r}return t(t$1,e),t$1}(x),Ot=function(t$1){function n(n){var r,i=this;i=t$1.call(this)||this;var s=[];n.mentionType===ae.USERS&&(n.mentionedUserIds?s=n.mentionedUserIds:n.mentionedUsers&&(s=n.mentionedUsers.map((function(e){return e.userId}))));var u=n.channelType,c=n.channelUrl;return i.method=d$1.POST,i.path="".concat(We$1(u),"/").concat(encodeURIComponent(c),"/scheduled_messages"),i.params={req_id:n.reqId,scheduled_at:n.scheduledAt,message_type:oe.FILE,url:n.fileUrl,file_name:n.fileName,file_size:n.fileSize,file_type:n.mimeType,thumbnails:n.thumbnailSizes?n.thumbnailSizes.map((function(e){return Gt.payloadify(e)})):[],custom_type:n.customType,data:n.data,require_auth:n.requireAuth,mention_type:n.mentionType,mentioned_user_ids:s,sorted_metaarray:null===(r=n.metaArrays)||void 0===r?void 0:r.map((function(e){return Dt$1.payloadify(e)})),apple_critical_alert_options:Lt.payloadify(n.appleCriticalAlertOptions),push_option:n.pushNotificationDeliveryOption},i}return t(n,t$1),n}(q),kt=function(e){function t$1(t,n){var r=e.call(this,t,n)||this;return r.message=new Wt(t,n),r}return t(t$1,e),t$1}(x),Nt=2,Ft=function(e){function l(n,r){var a,s,o,u,c=this;return (c=e.call(this,n)||this).url="",c.channelType=ne.BASE,c.name="",c.coverUrl="",c.customType="",c.data="",c.isFrozen=!1,c.isEphemeral=!1,c.creator=null,c.createdAt=0,c.url=r.channel_url,c.name=null!==(a=r.name)&&void 0!==a?a:"",c.coverUrl=null!==(s=r.cover_url)&&void 0!==s?s:"",c.customType=null!==(o=r.custom_type)&&void 0!==o?o:"",c.data=null!==(u=r.data)&&void 0!==u?u:"",c.isFrozen=!!y("boolean",r.freeze)&&r.freeze,c.isEphemeral=!!y("boolean",r.is_ephemeral)&&r.is_ephemeral,c.creator=r.created_by?new ct$1(c._iid,r.created_by):null,c.createdAt=1e3*r.created_at,c._cachedMetaData=new Map,r.metadata&&r.ts&&Object.keys(r.metadata).forEach((function(e){c._cachedMetaData.set(e,{value:r.metadata[e],isRemoved:!1,updatedAt:r.ts});})),c}return t(l,e),l.payloadify=function(t){return U$1(n(n({},e.payloadify.call(this,t)),{channel_url:t.url,name:t.name,cover_url:t.coverUrl,custom_type:t.customType,data:t.data,freeze:t.isFrozen,is_ephemeral:t.isEphemeral,created_by:ct$1.payloadify(t.creator),created_at:t.createdAt/1e3}))},l.prototype.isGroupChannel=function(){return this.channelType===ne.GROUP},l.prototype.isOpenChannel=function(){return this.channelType===ne.OPEN},Object.defineProperty(l.prototype,"cachedMetaData",{get:function(){var e={};return this._cachedMetaData.forEach((function(t,n){t.isRemoved||(e[n]=t.value);})),e},enumerable:!1,configurable:!0}),l.prototype._upsertCachedMetaData=function(e,t){var n=this;Object.keys(e).forEach((function(r){var i=n._cachedMetaData.get(r);(!i||i.updatedAt<=t)&&n._cachedMetaData.set(r,{value:e[r],isRemoved:!1,updatedAt:t});}));},l.prototype._removeFromCachedMetaData=function(e,t){var n=this;e.forEach((function(e){var r=n._cachedMetaData.get(e);r&&r.updatedAt<t&&(r.isRemoved=!1,r.updatedAt=t);}));},l.prototype._generateRequestId=function(){return "rq-".concat(R())},l.prototype.isIdentical=function(e){return e&&this.url===e.url},l.prototype.isEqual=function(e){return g(this,e)},l.prototype.createOperatorListQuery=function(e){return void 0===e&&(e={}),new Pe(this._iid,this.url,this.channelType,e)},l.prototype.createMutedUserListQuery=function(e){return void 0===e&&(e={}),new qe(this._iid,this.url,this.channelType,e)},l.prototype.createBannedUserListQuery=function(e){return void 0===e&&(e={}),new Ne(this._iid,this.url,this.channelType,e)},l.prototype.createPreviousMessageListQuery=function(e){return void 0===e&&(e={}),new wn(this._iid,this.url,this.channelType,e)},l.prototype.addOperators=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(i){switch(i.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new Fe({channelUrl:this.url,channelType:this.channelType,operatorUserIds:e}),[4,t.send(n)];case 1:return i.sent(),[2]}}))}))},l.prototype.removeOperators=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(i){switch(i.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new Le({channelUrl:this.url,channelType:this.channelType,operatorUserIds:e}),[4,t.send(n)];case 1:return i.sent(),[2]}}))}))},l.prototype.getMyMutedInfo=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a,s,o,u,c,l;return i(this,(function(d){switch(d.label){case 0:return e=St$1.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Qe({channelUrl:this.url,channelType:this.channelType,userId:t.userId}),[4,n.send(r)];case 1:return i$1=d.sent(),a=i$1.as(ze),s=a.isMuted,o=a.startAt,u=a.endAt,c=a.remainingDuration,l=a.description,[2,{isMuted:s,startAt:o,endAt:u,remainingDuration:c,description:l}]}}))}))},l.prototype.getMetaData=function(e){return r(this,void 0,void 0,(function(){var t,n,i$1,a,s,o;return i(this,(function(u){switch(u.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new xe({channelUrl:this.url,channelType:this.channelType,keys:e}),[4,t.send(n)];case 1:return i$1=u.sent(),a=i$1.as(Ge),s=a.metadata,o=a.ts,this._upsertCachedMetaData(s,o),[2,s]}}))}))},l.prototype.getAllMetaData=function(){return r(this,void 0,void 0,(function(){var e,t,n,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new xe({channelUrl:this.url,channelType:this.channelType,keys:[]}),[4,e.send(t)];case 1:return n=s.sent(),r=n.as(Ge),i$1=r.metadata,a=r.ts,this._upsertCachedMetaData(i$1,a),[2,i$1]}}))}))},l.prototype.createMetaData=function(e){return r(this,void 0,void 0,(function(){var t,n,r,i$1;return i(this,(function(a){switch(a.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new Ze$1({channelUrl:this.url,channelType:this.channelType,metadata:e}),[4,t.send(n)];case 1:return r=a.sent(),i$1=r.as($e$1).metaData,this._upsertCachedMetaData(i$1,0),[2,i$1]}}))}))},l.prototype.updateMetaData=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,i$1,a,s,o;return i(this,(function(u){switch(u.label){case 0:return n=St$1.of(this._iid).requestQueue,r=new Be({channelUrl:this.url,channelType:this.channelType,metadata:e,upsert:t}),[4,n.send(r)];case 1:return i$1=u.sent(),a=i$1.as(je),s=a.metadata,o=a.ts,this._upsertCachedMetaData(s,o),[2,s]}}))}))},l.prototype.deleteMetaData=function(e){return r(this,void 0,void 0,(function(){var n,r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new We({channelUrl:this.url,channelType:this.channelType,key:e}),[4,n.send(r)];case 1:return i$1=s.sent(),a=i$1.as(Ke).ts,this._removeFromCachedMetaData([e],a),[2]}}))}))},l.prototype.deleteAllMetaData=function(){return r(this,void 0,void 0,(function(){var e,t,n,r;return i(this,(function(i){switch(i.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new Ye({channelUrl:this.url,channelType:this.channelType}),[4,e.send(t)];case 1:return n=i.sent(),r=n.as(He).ts,this._removeFromCachedMetaData(a([],o(this._cachedMetaData.keys()),!1),r),[2]}}))}))},l.prototype.getMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,i$1;return i(this,(function(a){switch(a.label){case 0:return at$1(E("string",e)).throw(p.invalidParameters),t=St$1.of(this._iid).requestQueue,n=new Je({channelUrl:this.url,channelType:this.channelType,keys:e}),[4,t.send(n)];case 1:return i$1=a.sent(),[2,i$1.as(Xe).metaCounter]}}))}))},l.prototype.getAllMetaCounters=function(){return r(this,void 0,void 0,(function(){var e,t,n;return i(this,(function(r){switch(r.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new Je({channelUrl:this.url,channelType:this.channelType,keys:[]}),[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(Xe).metaCounter]}}))}))},l.prototype.createMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new Ze({channelUrl:this.url,channelType:this.channelType,metaCounter:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as($e).metaCounter]}}))}))},l.prototype.updateMetaCounters=function(e,t){return void 0===t&&(t=!1),r(this,void 0,void 0,(function(){var n,r,i$1;return i(this,(function(a){switch(a.label){case 0:return n=St$1.of(this._iid).requestQueue,r=new et({channelUrl:this.url,channelType:this.channelType,metaCounter:e,upsert:t}),[4,n.send(r)];case 1:return i$1=a.sent(),[2,i$1.as(tt).metaCounter]}}))}))},l.prototype.increaseMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new et({channelUrl:this.url,channelType:this.channelType,metaCounter:e,upsert:!1,mode:"increase"}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(tt).metaCounter]}}))}))},l.prototype.decreaseMetaCounters=function(e){return r(this,void 0,void 0,(function(){var t,n,r;return i(this,(function(i){switch(i.label){case 0:return t=St$1.of(this._iid).requestQueue,n=new et({channelUrl:this.url,channelType:this.channelType,metaCounter:e,upsert:!1,mode:"decrease"}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(tt).metaCounter]}}))}))},l.prototype.deleteMetaCounter=function(e){return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new rt({channelUrl:this.url,channelType:this.channelType,key:e}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},l.prototype.deleteAllMetaCounters=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new it({channelUrl:this.url,channelType:this.channelType}),[4,e.send(t)];case 1:return n.sent(),[2]}}))}))},l.prototype.muteUser=function(e,t,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){return [2,this.muteUserWithUserId(e.userId,t,n)]}))}))},l.prototype.muteUserWithUserId=function(e,n,r$1){return r(this,void 0,void 0,(function(){var i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(y("string",e)&&y("number",n,!0)&&y("string",r$1,!0)).throw(p.invalidParameters),i$1=St$1.of(this._iid).requestQueue,a=new at({channelUrl:this.url,channelType:this.channelType,userId:e,seconds:n,description:r$1}),[4,i$1.send(a)];case 1:return s.sent(),[2]}}))}))},l.prototype.unmuteUser=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return [2,this.unmuteUserWithUserId(e.userId)]}))}))},l.prototype.unmuteUserWithUserId=function(e){return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new ot({channelUrl:this.url,channelType:this.channelType,userId:e}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},l.prototype.banUser=function(e,t,n){return r(this,void 0,void 0,(function(){return i(this,(function(r){return [2,this.banUserWithUserId(e.userId,t,n)]}))}))},l.prototype.banUserWithUserId=function(e,n,r$1){return r(this,void 0,void 0,(function(){var i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(y("string",e)&&y("number",n,!0)&&y("string",r$1,!0)).throw(p.invalidParameters),i$1=St$1.of(this._iid).requestQueue,a=new ct({channelUrl:this.url,channelType:this.channelType,userId:e,seconds:n,description:r$1}),[4,i$1.send(a)];case 1:return s.sent(),[2]}}))}))},l.prototype.unbanUser=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return [2,this.unbanUserWithUserId(e.userId)]}))}))},l.prototype.unbanUserWithUserId=function(e){return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){switch(i.label){case 0:return at$1(y("string",e)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,r=new dt({channelUrl:this.url,channelType:this.channelType,userId:e}),[4,n.send(r)];case 1:return i.sent(),[2]}}))}))},l.prototype.freeze=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new pt({channelUrl:this.url,channelType:this.channelType,freezing:!0}),[4,e.send(t)];case 1:return n.sent(),this.isFrozen=!0,[2]}}))}))},l.prototype.unfreeze=function(){return r(this,void 0,void 0,(function(){var e,t;return i(this,(function(n){switch(n.label){case 0:return e=St$1.of(this._iid).requestQueue,t=new pt({channelUrl:this.url,channelType:this.channelType,freezing:!1}),[4,e.send(t)];case 1:return n.sent(),this.isFrozen=!1,[2]}}))}))},l.prototype.getMessagesByMessageId=function(e,n$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},tn),n$1),at$1(y("number",e)&&nn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessagesByMessageId(this.url,this.channelType,e,n$1)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessagesByTimestamp=function(e,n$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},tn),n$1),at$1(y("number",e)&&nn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessagesByTimestamp(this.url,this.channelType,e,n$1)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessageChangeLogsSinceTimestamp=function(e,n$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},rn),n$1),at$1(y("number",e)&&sn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessageChangelogs(this.url,this.channelType,e,n$1)];case 1:return [2,r.sent()]}}))}))},l.prototype.getMessageChangeLogsSinceToken=function(e,n$1){return r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return n$1=n(n({},rn),n$1),at$1(y("string",e)&&sn(n$1)).throw(p.invalidParameters),[4,En.of(this._iid).getMessageChangelogs(this.url,this.channelType,e,n$1)];case 1:return [2,r.sent()]}}))}))},l.prototype._createPendingSendableMessagePayload=function(e,t,n){var r=St$1.of(this._iid).sessionManager;return U$1({channel_url:this.url,channel_type:this.channelType,msg_id:0,parent_message_id:e.parentMessageId,data:e.data,custom_type:e.customType,mention_type:e.mentionType,sorted_metaarray:e.metaArrays?e.metaArrays.map((function(e){return Dt$1.payloadify(e)})):null,apple_critical_alert_options:e.appleCriticalAlertOptions?Lt.payloadify(e.appleCriticalAlertOptions):null,created_at:n,user:xt.payloadify(r.currentUser),req_id:t,request_state:le$1.PENDING,mentioned_user_ids:e.mentionedUserIds,mentioned_users:e.mentionedUsers})},l.prototype._createPendingUserMessage=function(e,t,n$1){var r,i,a={};if(e.translationTargetLanguages)try{for(var s$1=s(e.translationTargetLanguages),o=s$1.next();!o.done;o=s$1.next()){a[o.value]="";}}catch(e){r={error:e};}finally{try{o&&!o.done&&(i=s$1.return)&&i.call(s$1);}finally{if(r)throw r.error}}var l=U$1(n(n({},this._createPendingSendableMessagePayload(e,t,n$1)),{type:ie.USER,message:e.message,translations:a})),d=new Vt(this._iid,l);return d.messageParams=e,d},l.prototype._createPendingScheduledUserMessage=function(e,t,n){var r=this._createPendingUserMessage(e,t,n);return r.scheduledInfo={scheduledMessageId:0,scheduledAt:e.scheduledAt,scheduledMessageParams:e},r},l.prototype._createPendingFileMessage=function(e,t,n$1){var r=U$1(n(n({},this._createPendingSendableMessagePayload(e,t,n$1)),{type:ie.FILE,url:e.fileUrl,file:{name:e.fileName,size:e.fileSize,type:e.mimeType,data:e.data},thumbnails:e.thumbnailSizes?e.thumbnailSizes.map((function(e){return {url:"",width:e.maxWidth,height:e.maxHeight}})):[]})),i=new Wt(this._iid,r);return i.messageParams=e,i},l.prototype._createPendingScheduledFileMessage=function(e,t,n){var r=this._createPendingFileMessage(e,t,n);return r.scheduledInfo={scheduledMessageId:0,scheduledAt:e.scheduledAt,scheduledMessageParams:e},r},l.prototype._markMessageAsFailed=function(e,t,n){void 0===n&&(n=!1),e.errorCode=t.code,t.code===u.REQUEST_CANCELED?e.sendingStatus=le$1.CANCELED:n||(e.sendingStatus=le$1.FAILED);},l.prototype.sendUserMessage=function(e){return e=n(n({},he),e),at$1(pe(e)).throw(p.invalidParameters),this._sendUserMessage(e)},l.prototype._sendUserMessage=function(e,t){var n$1=this;void 0===t&&(t=null);var r$1=St$1.of(this._iid),i$1=r$1.dispatcher,a=r$1.requestQueue,s=t,o=Date.now(),c=new In;if(!s){s=this._generateRequestId();var l=St$1.of(this._iid).dispatcher;Re$1(2).then((function(){var t=n$1._createPendingUserMessage(e,s,o);l.dispatch(new un({messages:[t],source:$t.EVENT_MESSAGE_SENT_PENDING})),ke$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,c._trigger(null,t)]}))}))}));}));}var d=new gt(n({channelUrl:this.url,channelType:this.channelType,reqId:s},e));return a.send(d).then((function(e){var t=e.as(_t).message;i$1.dispatch(new un({messages:[t],source:$t.EVENT_MESSAGE_SENT_SUCCESS})),ke$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,c._trigger(null,t)]}))}))}));})).catch((function(t){if(h$1(t))throw t;Re$1(2).then((function(){var r$1=n$1._createPendingUserMessage(e,s,o),a=St$1.of(n$1._iid).cacheContext.localCacheEnabled&&I(t.code);n$1._markMessageAsFailed(r$1,t,a),i$1.dispatch(new un({messages:[r$1],source:r$1.sendingStatus===le$1.PENDING?$t.REQUEST_RESEND_MESSAGE:$t.EVENT_MESSAGE_SENT_FAILED})),ke$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,c._trigger(t,r$1)]}))}))}));}));})),c},l.prototype._autoResendUserMessage=function(e){return at$1(e instanceof Vt).throw(p.invalidParameters),this._sendUserMessage(e.messageParams,e.reqId)},l.prototype.resendUserMessage=function(e){var t;return r(this,void 0,void 0,(function(){var n,r;return i(this,(function(i){var a;return at$1(e instanceof Vt&&!e.scheduledInfo).throw(p.invalidParameters),n=new ee,r=null!==(t=e.messageParams)&&void 0!==t?t:U$1({data:(a=e).data,customType:a.customType,mentionType:a.mentionType,mentionedUsers:a.mentionedUsers,mentionedUserIds:a.mentionedUserIds,mentionedMessageTemplate:a.mentionedMessageTemplate,metaArrays:a.metaArrays,parentMessageId:a.parentMessageId,appleCriticalAlertOptions:a.appleCriticalAlertOptions,message:a.message,translationTargetLanguages:Object.keys(a.translations)}),this._sendUserMessage(r,e.reqId).onFailed((function(e){return n.reject(e)})).onSucceeded((function(e){return n.resolve(e)})),[2,n.promise]}))}))},l.prototype.updateUserMessage=function(e,n$1){return r(this,void 0,void 0,(function(){var r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return n$1=n(n({},Ee),n$1),at$1(y("number",e)&&Se(n$1)).throw(p.invalidParameters),r=St$1.of(this._iid).requestQueue,i$1=new Tt(n({channelType:this.channelType,channelUrl:this.url,messageId:e},n$1)),[4,r.send(i$1)];case 1:return a=s.sent(),[2,a.as(Ut).message]}}))}))},l.prototype.copyUserMessage=function(e,t){var n$1,r$1,i$1;return r(this,void 0,void 0,(function(){var a,o;return i(this,(function(c){return at$1(e instanceof l&&t instanceof Vt&&t.sendingStatus===le$1.SUCCEEDED&&e.url===t.channelUrl&&!t.scheduledInfo).throw(p.invalidParameters),a=new ee,o=null!==(n$1=t.messageParams)&&void 0!==n$1?n$1:n(n({},t),{mentionType:t.mentionType,mentionedUserIds:null!==(r$1=t.mentionedUserIds)&&void 0!==r$1?r$1:null===(i$1=t.mentionedUsers)||void 0===i$1?void 0:i$1.map((function(e){return e.userId})),translationTargetLanguages:Object.keys(t.translations),pushNotificationDeliveryOption:ce$1.DEFAULT,parentMessageId:null,isReplyToChannel:!1}),e._sendUserMessage(o).onSucceeded((function(e){return a.resolve(e)})).onFailed((function(e){return a.reject(e)})),[2,a.promise]}))}))},l.prototype.translateUserMessage=function(e,t){return r(this,void 0,void 0,(function(){var n,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(e instanceof Vt&&e.messageId>0&&E("string",t)).throw(p.invalidParameters),n=St$1.of(this._iid).requestQueue,i$1=new Pt({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId,translationTargetLanguages:t}),[4,n.send(i$1)];case 1:return a=s.sent(),[2,a.as(Dt).message]}}))}))},l.prototype._createScheduledUserMessage=function(e,t){var n$1=this,r$1=St$1.of(this._iid).requestQueue,i$1=Date.now(),a=this._generateRequestId();Re$1(2).then((function(){var r$1=n$1._createPendingScheduledUserMessage(e,a,i$1);ke$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,r$1)]}))}))}));}));var s=new Rt(n({reqId:a,channelType:this.channelType,channelUrl:this.url},e));r$1.send(s).then((function(e){var r$1=e.as(qt).message;ke$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,r$1)]}))}))}));})).catch((function(r$1){if(h$1(r$1))throw r$1;Re$1(2).then((function(){var s=n$1._createPendingScheduledUserMessage(e,a,i$1);n$1._markMessageAsFailed(s,r$1),ke$1((function(){return r(n$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(r$1,s)]}))}))}));}));}));},l.prototype.sendFileMessage=function(e){return e=n(n({},ge),e),at$1(_e(e)).throw(p.invalidParameters),this._sendFileMessage(e)},l.prototype._sendFileMessage=function(e,t){var n=this;void 0===t&&(t=null);var r$1=St$1.of(this._iid).dispatcher,i$1=En.of(this._iid).fileMessageQueue,a=t,s=Date.now(),o=new In;return a||(a=this._generateRequestId(),Re$1(2).then((function(){var t=n._createPendingFileMessage(e,a,s);r$1.dispatch(new un({messages:[t],source:$t.EVENT_MESSAGE_SENT_PENDING})),ke$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){return [2,o._trigger(null,t)]}))}))}));}))),i$1.request(this,a,e).then((function(e){r$1.dispatch(new un({messages:[e],source:$t.EVENT_MESSAGE_SENT_SUCCESS})),ke$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(t){return [2,o._trigger(null,e)]}))}))}));})).catch((function(t){if(h$1(t))throw t;Re$1(2).then((function(){var i$1=n._createPendingFileMessage(e,a,s),u=St$1.of(n._iid).cacheContext.localCacheEnabled&&I(t.code);n._markMessageAsFailed(i$1,t,u),r$1.dispatch(new un({messages:[i$1],source:i$1.sendingStatus===le$1.PENDING?$t.REQUEST_RESEND_MESSAGE:$t.EVENT_MESSAGE_SENT_FAILED})),ke$1((function(){return r(n,void 0,void 0,(function(){return i(this,(function(e){return [2,o._trigger(t,i$1)]}))}))}));}));})),o},l.prototype._autoResendFileMessage=function(e){at$1(e instanceof Wt).throw(p.invalidParameters);var t=St$1.of(this._iid).logger;return t.debug("autoResendFileMessage pending",e),this._sendFileMessage(e.messageParams,e.reqId).onFailed((function(e){t.debug("autoResendFileMessage failed",e);})).onSucceeded((function(e){t.debug("autoResendFileMessage success",e);}))},l.prototype._createScheduledFileMessage=function(e,t,n$1,r$1){var i$1=this,a=St$1.of(this._iid).requestQueue,s=new Ot(n(n({reqId:n$1,channelType:this.channelType,channelUrl:this.url},e),{fileUrl:e.fileUrl,requireAuth:e.requireAuth}));a.send(s).then((function(e){var n=e.as(kt).message;ke$1((function(){return r(i$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(null,n)]}))}))}));})).catch((function(a){if(h$1(a))throw a;Re$1(2).then((function(){var s=i$1._createPendingScheduledFileMessage(e,n$1,r$1);i$1._markMessageAsFailed(s,a),ke$1((function(){return r(i$1,void 0,void 0,(function(){return i(this,(function(e){return [2,t._trigger(a,s)]}))}))}));}));}));},l.prototype.sendFileMessages=function(e){var t,n$1;at$1(e.every((function(e){return _e(n(n({},ge),e))}))).throw(p.invalidParameters);var r=new In;try{for(var i=s(e),a=i.next();!a.done;a=i.next()){var s$1=a.value;this.sendFileMessage(s$1).onPending((function(e){return r._trigger(null,e)})).onFailed((function(e,t){return r._trigger(e,t)})).onSucceeded((function(e){return r._trigger(null,e)}));}}catch(e){t={error:e};}finally{try{a&&!a.done&&(n$1=i.return)&&n$1.call(i);}finally{if(t)throw t.error}}return r},l.prototype.resendFileMessage=function(e,t){var n;return r(this,void 0,void 0,(function(){var r,i$1;return i(this,(function(a){return at$1(e instanceof Wt&&t instanceof Blob&&!e.scheduledInfo).throw(p.invalidParameters),r=new ee,i$1=null!==(n=e.messageParams)&&void 0!==n?n:function(e,t){return void 0===t&&(t=null),U$1({data:e.data,customType:e.customType,mentionType:e.mentionType,mentionedUsers:e.mentionedUsers,mentionedUserIds:e.mentionedUserIds,metaArrays:e.metaArrays,parentMessageId:e.parentMessageId,appleCriticalAlertOptions:e.appleCriticalAlertOptions,file:t,fileUrl:e.url,fileName:e.name,fileSize:e.size,mimeType:e.type,thumbnailSizes:e.thumbnails.map((function(e){return {maxWidth:e.width,maxHeight:e.height}}))})}(e,t),this._sendFileMessage(i$1,e.reqId).onFailed((function(e){return r.reject(e)})).onSucceeded((function(e){return r.resolve(e)})),[2,r.promise]}))}))},l.prototype.updateFileMessage=function(e,n$1){return r(this,void 0,void 0,(function(){var r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return n$1=n(n({},be),n$1),at$1(y("number",e)&&function(e){return Me(e)}(n$1)).throw(p.invalidParameters),r=St$1.of(this._iid).requestQueue,i$1=new It(n({channelType:this.channelType,channelUrl:this.url,messageId:e},n$1)),[4,r.send(i$1)];case 1:return a=s.sent(),[2,a.as(wt).message]}}))}))},l.prototype.cancelUploadingFileMessage=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(n){return at$1(y("string",e)).throw(p.invalidParameters),En.of(this._iid).fileMessageQueue.cancel(this,e),[2,!0]}))}))},l.prototype.copyFileMessage=function(e,t){var n$1,r$1;return r(this,void 0,void 0,(function(){var i$1,a;return i(this,(function(o){return at$1(e instanceof l&&t instanceof Wt&&t.sendingStatus===le$1.SUCCEEDED&&e.url===t.channelUrl&&!t.scheduledInfo).throw(p.invalidParameters),i$1=new ee,a=n(n({},t),{fileUrl:t.url,fileName:t.name,fileSize:t.size,mimeType:t.type,mentionType:t.mentionType,mentionedUserIds:null!==(n$1=t.mentionedUserIds)&&void 0!==n$1?n$1:null===(r$1=t.mentionedUsers)||void 0===r$1?void 0:r$1.map((function(e){return e.userId})),pushNotificationDeliveryOption:ce$1.DEFAULT,parentMessageId:null,isReplyToChannel:!1,thumbnailSizes:t.thumbnails.map((function(e){return {maxWidth:e.width,maxHeight:e.height}})),requireAuth:t.requireAuth}),e._sendFileMessage(a).onSucceeded((function(e){return i$1.resolve(e)})).onFailed((function(e){return i$1.reject(e)})),[2,i$1.promise]}))}))},l.prototype.deleteMessage=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return at$1(e instanceof Ft$1).throw(p.invalidParameters),e.messageId>0?(t=St$1.of(this._iid).requestQueue,n=new Mt({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId}),[4,t.send(n)]):[3,2];case 1:r.sent(),r.label=2;case 2:return [2]}}))}))},l.prototype.addReaction=function(e,n){return r(this,void 0,void 0,(function(){var r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(e instanceof qt$1&&e.messageId>0&&y("string",n)).throw(p.invalidParameters),r=St$1.of(this._iid).requestQueue,i$1=new St({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId,reactionKey:n}),[4,r.send(i$1)];case 1:return a=s.sent(),[2,a.as(bt).reactionEvent]}}))}))},l.prototype.deleteReaction=function(e,n){return r(this,void 0,void 0,(function(){var r,i$1,a;return i(this,(function(s){switch(s.label){case 0:return at$1(e instanceof qt$1&&e.messageId>0&&y("string",n)).throw(p.invalidParameters),r=St$1.of(this._iid).requestQueue,i$1=new Ct({channelType:this.channelType,channelUrl:this.url,messageId:e.messageId,reactionKey:n}),[4,r.send(i$1)];case 1:return a=s.sent(),[2,a.as(At).reactionEvent]}}))}))},l.prototype._updateMessageMetaArray=function(e,t,n,r$1){return r(this,void 0,void 0,(function(){var i$1,a,s,o,u,c;return i(this,(function(l){switch(l.label){case 0:return i$1=St$1.of(this._iid),a=i$1.dispatcher,s=i$1.requestQueue,o=new Tt({channelType:this.channelType,channelUrl:this.url,messageId:e,metaArrayParams:{array:t,mode:n,upsert:r$1}}),[4,s.send(o)];case 1:return u=l.sent(),c=u.as(Ut).message,a.dispatch(new un({messages:[c],source:$t.EVENT_MESSAGE_UPDATED})),[2,c]}}))}))},l.prototype.createMessageMetaArrayKeys=function(e,t){return r(this,void 0,void 0,(function(){var n;return i(this,(function(i){return at$1(e instanceof Ft$1&&e.messageId>0&&E("string",t)).throw(p.invalidParameters),n=t.map((function(e){return new Dt$1({key:e})})),[2,this._updateMessageMetaArray(e.messageId,n,"add",!0)]}))}))},l.prototype.deleteMessageMetaArrayKeys=function(e,t){return r(this,void 0,void 0,(function(){var n;return i(this,(function(i){return at$1(e instanceof Ft$1&&e.messageId>0&&E("string",t)).throw(p.invalidParameters),n=t.map((function(e){return new Dt$1({key:e})})),[2,this._updateMessageMetaArray(e.messageId,n,"remove",!0)]}))}))},l.prototype.addMessageMetaArrayValues=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return at$1(e instanceof Ft$1&&e.messageId>0&&t.every((function(e){return e instanceof Dt$1}))).throw(p.invalidParameters),[2,this._updateMessageMetaArray(e.messageId,t,"add",!0)]}))}))},l.prototype.removeMessageMetaArrayValues=function(e,t){return r(this,void 0,void 0,(function(){return i(this,(function(n){return at$1(e instanceof Ft$1&&e.messageId>0&&t.every((function(e){return e instanceof Dt$1}))).throw(p.invalidParameters),[2,this._updateMessageMetaArray(e.messageId,t,"remove",!0)]}))}))},l.prototype.report=function(e,r$1){return r(this,void 0,void 0,(function(){var i$1,a,s,o;return i(this,(function(u){switch(u.label){case 0:return at$1(m(Te,e)&&y("string",r$1)).throw(p.invalidParameters),i$1=St$1.of(this._iid),a=i$1.sdkState,s=i$1.requestQueue,o=new mt({channelUrl:this.url,channelType:this.channelType,userId:a.userId,category:e,description:r$1}),[4,s.send(o)];case 1:return u.sent(),[2]}}))}))},l.prototype.reportUser=function(e,r$1,a){return r(this,void 0,void 0,(function(){var s,o,u,c;return i(this,(function(l){switch(l.label){case 0:return at$1(e instanceof ct$1&&m(Te,r$1)&&y("string",a)).throw(p.invalidParameters),s=St$1.of(this._iid),o=s.sdkState,u=s.requestQueue,c=new yt({channelUrl:this.url,channelType:this.channelType,userId:o.userId,offendingUserId:e.userId,category:r$1,description:a}),[4,u.send(c)];case 1:return l.sent(),[2]}}))}))},l.prototype.reportMessage=function(e,r$1,i$1){return r(this,void 0,void 0,(function(){var a,s,o,u;return i(this,(function(c){switch(c.label){case 0:return at$1(e instanceof Ft$1&&m(Te,r$1)&&y("string",i$1)).throw(p.invalidParameters),a=St$1.of(this._iid),s=a.sdkState,o=a.requestQueue,u=new vt({channelUrl:this.url,channelType:this.channelType,userId:s.userId,offendingUserId:e.sender.userId,messageId:e.messageId,category:r$1,description:i$1}),[4,o.send(u)];case 1:return c.sent(),[2]}}))}))},l}(Be$1);
18
-
19
- var _;!function(e){e[e.NONE=0]="NONE",e[e.CHANNEL_ENTER=10102]="CHANNEL_ENTER",e[e.CHANNEL_EXIT=10103]="CHANNEL_EXIT",e[e.USER_CHANNEL_MUTE=10201]="USER_CHANNEL_MUTE",e[e.USER_CHANNEL_UNMUTE=10200]="USER_CHANNEL_UNMUTE",e[e.USER_CHANNEL_BAN=10601]="USER_CHANNEL_BAN",e[e.USER_CHANNEL_UNBAN=10600]="USER_CHANNEL_UNBAN",e[e.CHANNEL_FREEZE=10701]="CHANNEL_FREEZE",e[e.CHANNEL_UNFREEZE=10700]="CHANNEL_UNFREEZE",e[e.TYPING_START=10900]="TYPING_START",e[e.TYPING_END=10901]="TYPING_END",e[e.CHANNEL_JOIN=1e4]="CHANNEL_JOIN",e[e.CHANNEL_LEAVE=10001]="CHANNEL_LEAVE",e[e.CHANNEL_OPERATOR_UPDATE=10002]="CHANNEL_OPERATOR_UPDATE",e[e.CHANNEL_INVITE=10020]="CHANNEL_INVITE",e[e.CHANNEL_ACCEPT_INVITE=10021]="CHANNEL_ACCEPT_INVITE",e[e.CHANNEL_DECLINE_INVITE=10022]="CHANNEL_DECLINE_INVITE",e[e.CHANNEL_PROP_CHANGED=11e3]="CHANNEL_PROP_CHANGED",e[e.CHANNEL_DELETED=12e3]="CHANNEL_DELETED",e[e.CHANNEL_META_DATA_CHANGED=11100]="CHANNEL_META_DATA_CHANGED",e[e.CHANNEL_META_COUNTERS_CHANGED=11200]="CHANNEL_META_COUNTERS_CHANGED",e[e.CHANNEL_HIDE=13e3]="CHANNEL_HIDE",e[e.CHANNEL_UNHIDE=13001]="CHANNEL_UNHIDE";}(_||(_={}));var l=function(){function n(e){this.channelUrl=e.channel_url,this.channelType=e.channel_type,this.category=e.cat,this.data=e.data,this.ts=e.ts;}return Object.defineProperty(n.prototype,"isGroupChannelEvent",{get:function(){return this.channelType===ne.GROUP},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isOpenChannelEvent",{get:function(){return this.channelType===ne.OPEN},enumerable:!1,configurable:!0}),n}(),C=function(e){function t$1(n,t,a){var s=e.call(this,n,"SYEV",a)||this;return s.event=new l(a),s}return t(t$1,e),t$1}(B),d=function(e){function t$1(n,t,s){var N=e.call(this,n,t,s)||this,o=s.data.operators,E=void 0===o?[]:o;return N.operators=E.map((function(e){return new ct$1(N._iid,e)})),N}return t(t$1,e),t$1}(C),h=function(e){function t$1(n,t,a){var s=e.call(this,n,"MCNT",a)||this;return s.groupChannelMemberCounts=a.group_channels.map((function(e){return {channelUrl:e.channel_url,memberCount:e.member_count,joinedMemberCount:e.joined_member_count,updatedAt:e.ts}})),s.openChannelMemberCounts=a.open_channels.map((function(e){return {channelUrl:e.channel_url,participantCount:e.participant_count,updatedAt:e.ts}})),s}return t(t$1,e),t$1}(B),A=function(e){function t$1(n,t,a){var E,i,r,u=this;(u=e.call(this,n,"ADMM",a)||this).message=new Kt(n,a);var _=St$1.of(n).sdkState;return u.isMentioned=Ye$1(u.message.mentionType,null!==(E=u.message.mentionedUserIds)&&void 0!==E?E:null===(i=u.message.mentionedUsers)||void 0===i?void 0:i.map((function(e){return e.userId})),_.userId),u.forceUpdateLastMessage=null!==(r=a.force_update_last_message)&&void 0!==r&&r,u}return t(t$1,e),t$1}(B),c=function(e){function t$1(n,t,a){var o,i,r,u,_,l,C=this;(C=e.call(this,n,"AEDI",a)||this).message=new Kt(n,a);var d=St$1.of(n).sdkState;return C.mentionCountChange=Je$1({mentionType:null!==(i=null===(o=a.old_values)||void 0===o?void 0:o.mention_type)&&void 0!==i?i:null,mentionedUserIds:null!==(u=null===(r=a.old_values)||void 0===r?void 0:r.mentioned_user_ids)&&void 0!==u?u:[]},{mentionType:C.message.mentionType,mentionedUserIds:null!==(_=C.message.mentionedUserIds)&&void 0!==_?_:null===(l=C.message.mentionedUsers)||void 0===l?void 0:l.map((function(e){return e.userId}))},d.userId),C}return t(t$1,e),t$1}(B),T=function(e){function t$1(n,t,a){var s=e.call(this,n,"MRCT",a)||this;return s.channelUrl=a.channel_url,s.channelType=a.channel_type,s.event=new wt$1(a),s}return t(t$1,e),t$1}(B),H=function(e){function t$1(n,t,a){var s=e.call(this,n,"MTHD",a)||this;return s.event=new Sn(n,a),s}return t(t$1,e),t$1}(B),U=function(){this.onUserMuted=Y,this.onUserUnmuted=Y,this.onUserBanned=Y,this.onUserUnbanned=Y,this.onChannelChanged=Y,this.onChannelDeleted=Y,this.onChannelFrozen=Y,this.onChannelUnfrozen=Y,this.onOperatorUpdated=Y,this.onChannelMemberCountChanged=Y,this.onMetaDataCreated=Y,this.onMetaDataUpdated=Y,this.onMetaDataDeleted=Y,this.onMetaCounterCreated=Y,this.onMetaCounterUpdated=Y,this.onMetaCounterDeleted=Y,this.onMessageReceived=Y,this.onMessageUpdated=Y,this.onMessageDeleted=Y,this.onMentionReceived=Y,this.onReactionUpdated=Y,this.onThreadInfoUpdated=Y;};
20
-
21
- export { p as $, st as A, Be$1 as B, ut as C, d as D, E, Ft as F, C as G, H$1 as H, h as I, J, H as K, T as L, Et as M, Ut as N, On as O, wt as P, c as Q, _t as R, S, Tt$1 as T, U$1 as U, Ve as V, Jt as W, A as X, Y, at$1 as Z, _, ye$1 as a, St$1 as a0, En as a1, he as a2, ce as a3, Vt as a4, de as a5, Wt as a6, ve as a7, pe as a8, le as a9, pe$1 as aA, ge$1 as aB, _e$1 as aC, Te$1 as aD, Ot$1 as aE, M as aF, We$1 as aG, Ht as aH, ae as aI, oe as aJ, Gt as aK, Dt$1 as aL, Lt as aM, In as aN, Le$1 as aO, ln as aP, cn as aQ, Me$1 as aR, qt as aS, Se as aT, Nt as aU, Me as aV, Nt$1 as aW, bt$1 as aX, L as aa, le$1 as ab, I as ac, se as ad, ie as ae, Ft$1 as af, ye as ag, ue as ah, me as ai, u as aj, un as ak, $t as al, Ie as am, T$1 as an, a as ao, o as ap, m as aq, z as ar, R as as, an as at, we as au, Ee as av, Bt as aw, Re$1 as ax, Ct$1 as ay, re as az, bn as b, ct$1 as c, d$1 as d, B as e, ne as f, U as g, de$1 as h, i, s as j, h$1 as k, nt as l, me$1 as m, n, ot$1 as o, ke$1 as p, q, r, st$1 as s, t, ue$1 as u, ft as v, lt as w, x, y, ht as z };
22
- //# sourceMappingURL=__bundle-c41dd401-d4ab6c10.js.map