@sendbird/uikit-react 3.0.1 → 3.0.2-beta.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.
- package/App.js +32 -32
- package/CHANGELOG.md +16 -0
- package/Channel/components/ChannelHeader.js +17 -17
- package/Channel/components/ChannelUI.js +29 -25
- package/Channel/components/ChannelUI.js.map +1 -1
- package/Channel/components/FileViewer.js +16 -16
- package/Channel/components/FrozenNotification.js +5 -5
- package/Channel/components/Message.js +21 -21
- package/Channel/components/MessageInput.js +18 -18
- package/Channel/components/MessageList.js +28 -24
- package/Channel/components/MessageList.js.map +1 -1
- package/Channel/components/RemoveMessageModal.js +19 -19
- package/Channel/components/SuggestedMentionList.js +17 -17
- package/Channel/components/TypingIndicator.js +16 -16
- package/Channel/components/UnreadCount.js +5 -5
- package/Channel/context.js +15 -15
- package/Channel.js +24 -24
- package/ChannelList/components/AddChannel.js +14 -14
- package/ChannelList/components/ChannelListHeader.js +7 -7
- package/ChannelList/components/ChannelListUI.js +54 -35
- package/ChannelList/components/ChannelListUI.js.map +1 -1
- package/ChannelList/components/ChannelPreview.js +21 -21
- package/ChannelList/components/ChannelPreviewAction.js +16 -16
- package/ChannelList/context.js +10 -10
- package/ChannelList.js +28 -28
- package/{ChannelListProvider-471abb8f.js → ChannelListProvider-945445c9.js} +43 -29
- package/ChannelListProvider-945445c9.js.map +1 -0
- package/{ChannelProvider-01a680e0.js → ChannelProvider-21d4378a.js} +21 -15
- package/ChannelProvider-21d4378a.js.map +1 -0
- package/ChannelSettings/components/ChannelProfile.js +13 -13
- package/ChannelSettings/components/ChannelSettingsUI.js +18 -18
- package/ChannelSettings/components/EditDetailsModal.js +13 -13
- package/ChannelSettings/components/LeaveChannel.js +10 -10
- package/ChannelSettings/components/ModerationPanel.js +15 -15
- package/ChannelSettings/components/UserListItem.js +12 -12
- package/ChannelSettings/components/UserPanel.js +14 -14
- package/ChannelSettings/context.js +3 -3
- package/ChannelSettings.js +18 -18
- package/CreateChannel/components/CreateChannelUI.js +14 -14
- package/CreateChannel/components/InviteUsers.js +24 -21
- package/CreateChannel/components/InviteUsers.js.map +1 -1
- package/CreateChannel/components/SelectChannelType.js +10 -10
- package/CreateChannel/context.js +4 -4
- package/CreateChannel.js +14 -14
- package/{CreateChannelProvider-efa959ed.js → CreateChannelProvider-53259d87.js} +1 -1
- package/{CreateChannelProvider-efa959ed.js.map → CreateChannelProvider-53259d87.js.map} +1 -1
- package/EditUserProfile/components/EditUserProfileUI.js +13 -13
- package/EditUserProfile.js +13 -13
- package/{LocalizationContext-7f115178.js → LocalizationContext-08cebf79.js} +3 -3
- package/{LocalizationContext-7f115178.js.map → LocalizationContext-08cebf79.js.map} +1 -1
- package/{MemberList-9863866e.js → MemberList-29cf5f98.js} +12 -9
- package/MemberList-29cf5f98.js.map +1 -0
- package/MessageSearch/components/MessageSearchUI.js +11 -11
- package/MessageSearch/context.js +2 -2
- package/MessageSearch.js +11 -11
- package/OpenChannel/components/FrozenChannelNotification.js +5 -5
- package/OpenChannel/components/OpenChannelHeader.js +14 -14
- package/OpenChannel/components/OpenChannelInput.js +18 -18
- package/OpenChannel/components/OpenChannelMessage.js +23 -23
- package/OpenChannel/components/OpenChannelMessageList.js +25 -25
- package/OpenChannel/components/OpenChannelUI.js +25 -25
- package/OpenChannel/context.js +11 -11
- package/OpenChannel.js +25 -25
- package/{OpenChannelProvider-d11382d9.js → OpenChannelProvider-404556c2.js} +9 -9
- package/{OpenChannelProvider-d11382d9.js.map → OpenChannelProvider-404556c2.js.map} +1 -1
- package/OpenChannelSettings/components/EditDetailsModal.js +13 -13
- package/OpenChannelSettings/components/OpenChannelProfile.js +13 -13
- package/OpenChannelSettings/components/OpenChannelSettingsUI.js +17 -17
- package/OpenChannelSettings/components/OperatorUI.js +16 -16
- package/OpenChannelSettings/components/ParticipantUI.js +14 -14
- package/OpenChannelSettings/context.js +2 -2
- package/OpenChannelSettings.js +17 -17
- package/SendbirdProvider.js +58 -40
- package/SendbirdProvider.js.map +1 -1
- package/{UserProfileContext-eccdbd50.js → UserProfileContext-97bec8f7.js} +1 -1
- package/{UserProfileContext-eccdbd50.js.map → UserProfileContext-97bec8f7.js.map} +1 -1
- package/__bundle-7dfccc8c-ff995ba0.js +4396 -0
- package/__bundle-7dfccc8c-ff995ba0.js.map +1 -0
- package/{_rollupPluginBabelHelpers-2a8797d8.js → _rollupPluginBabelHelpers-9a08c8bf.js} +1 -1
- package/{_rollupPluginBabelHelpers-2a8797d8.js.map → _rollupPluginBabelHelpers-9a08c8bf.js.map} +1 -1
- package/{actionTypes-a992088f.js → actionTypes-eea40cdf.js} +1 -1
- package/{actionTypes-a992088f.js.map → actionTypes-eea40cdf.js.map} +1 -1
- package/cjs/App.js +32 -32
- package/cjs/Channel/components/ChannelHeader.js +17 -17
- package/cjs/Channel/components/ChannelUI.js +29 -25
- package/cjs/Channel/components/ChannelUI.js.map +1 -1
- package/cjs/Channel/components/FileViewer.js +16 -16
- package/cjs/Channel/components/FrozenNotification.js +5 -5
- package/cjs/Channel/components/Message.js +21 -21
- package/cjs/Channel/components/MessageInput.js +18 -18
- package/cjs/Channel/components/MessageList.js +28 -24
- package/cjs/Channel/components/MessageList.js.map +1 -1
- package/cjs/Channel/components/RemoveMessageModal.js +19 -19
- package/cjs/Channel/components/SuggestedMentionList.js +17 -17
- package/cjs/Channel/components/TypingIndicator.js +16 -16
- package/cjs/Channel/components/UnreadCount.js +5 -5
- package/cjs/Channel/context.js +15 -15
- package/cjs/Channel.js +24 -24
- package/cjs/ChannelList/components/AddChannel.js +14 -14
- package/cjs/ChannelList/components/ChannelListHeader.js +7 -7
- package/cjs/ChannelList/components/ChannelListUI.js +53 -34
- package/cjs/ChannelList/components/ChannelListUI.js.map +1 -1
- package/cjs/ChannelList/components/ChannelPreview.js +21 -21
- package/cjs/ChannelList/components/ChannelPreviewAction.js +16 -16
- package/cjs/ChannelList/context.js +10 -10
- package/cjs/ChannelList.js +28 -28
- package/cjs/{ChannelListProvider-8632f526.js → ChannelListProvider-0639f230.js} +43 -29
- package/cjs/ChannelListProvider-0639f230.js.map +1 -0
- package/cjs/{ChannelProvider-5e683eb1.js → ChannelProvider-33719788.js} +21 -15
- package/cjs/ChannelProvider-33719788.js.map +1 -0
- package/cjs/ChannelSettings/components/ChannelProfile.js +13 -13
- package/cjs/ChannelSettings/components/ChannelSettingsUI.js +18 -18
- package/cjs/ChannelSettings/components/EditDetailsModal.js +13 -13
- package/cjs/ChannelSettings/components/LeaveChannel.js +10 -10
- package/cjs/ChannelSettings/components/ModerationPanel.js +15 -15
- package/cjs/ChannelSettings/components/UserListItem.js +12 -12
- package/cjs/ChannelSettings/components/UserPanel.js +14 -14
- package/cjs/ChannelSettings/context.js +3 -3
- package/cjs/ChannelSettings.js +18 -18
- package/cjs/CreateChannel/components/CreateChannelUI.js +14 -14
- package/cjs/CreateChannel/components/InviteUsers.js +24 -21
- package/cjs/CreateChannel/components/InviteUsers.js.map +1 -1
- package/cjs/CreateChannel/components/SelectChannelType.js +10 -10
- package/cjs/CreateChannel/context.js +4 -4
- package/cjs/CreateChannel.js +14 -14
- package/cjs/{CreateChannelProvider-7f6cf793.js → CreateChannelProvider-87272710.js} +1 -1
- package/cjs/{CreateChannelProvider-7f6cf793.js.map → CreateChannelProvider-87272710.js.map} +1 -1
- package/cjs/EditUserProfile/components/EditUserProfileUI.js +13 -13
- package/cjs/EditUserProfile.js +13 -13
- package/cjs/{LocalizationContext-0537da22.js → LocalizationContext-6465626c.js} +3 -3
- package/cjs/{LocalizationContext-0537da22.js.map → LocalizationContext-6465626c.js.map} +1 -1
- package/cjs/{MemberList-4efb8994.js → MemberList-ee6eb19f.js} +12 -9
- package/cjs/MemberList-ee6eb19f.js.map +1 -0
- package/cjs/MessageSearch/components/MessageSearchUI.js +11 -11
- package/cjs/MessageSearch/context.js +2 -2
- package/cjs/MessageSearch.js +11 -11
- package/cjs/OpenChannel/components/FrozenChannelNotification.js +5 -5
- package/cjs/OpenChannel/components/OpenChannelHeader.js +14 -14
- package/cjs/OpenChannel/components/OpenChannelInput.js +18 -18
- package/cjs/OpenChannel/components/OpenChannelMessage.js +23 -23
- package/cjs/OpenChannel/components/OpenChannelMessageList.js +25 -25
- package/cjs/OpenChannel/components/OpenChannelUI.js +25 -25
- package/cjs/OpenChannel/context.js +11 -11
- package/cjs/OpenChannel.js +25 -25
- package/cjs/{OpenChannelProvider-7969a8c0.js → OpenChannelProvider-3683d099.js} +9 -9
- package/cjs/{OpenChannelProvider-7969a8c0.js.map → OpenChannelProvider-3683d099.js.map} +1 -1
- package/cjs/OpenChannelSettings/components/EditDetailsModal.js +13 -13
- package/cjs/OpenChannelSettings/components/OpenChannelProfile.js +13 -13
- package/cjs/OpenChannelSettings/components/OpenChannelSettingsUI.js +17 -17
- package/cjs/OpenChannelSettings/components/OperatorUI.js +16 -16
- package/cjs/OpenChannelSettings/components/ParticipantUI.js +14 -14
- package/cjs/OpenChannelSettings/context.js +2 -2
- package/cjs/OpenChannelSettings.js +17 -17
- package/cjs/SendbirdProvider.js +58 -40
- package/cjs/SendbirdProvider.js.map +1 -1
- package/cjs/{UserProfileContext-e13859c2.js → UserProfileContext-df8199ec.js} +1 -1
- package/cjs/{UserProfileContext-e13859c2.js.map → UserProfileContext-df8199ec.js.map} +1 -1
- package/cjs/__bundle-7dfccc8c-5e21874b.js +4523 -0
- package/cjs/__bundle-7dfccc8c-5e21874b.js.map +1 -0
- package/cjs/{_rollupPluginBabelHelpers-116d792d.js → _rollupPluginBabelHelpers-720b1baf.js} +1 -1
- package/cjs/{_rollupPluginBabelHelpers-116d792d.js.map → _rollupPluginBabelHelpers-720b1baf.js.map} +1 -1
- package/cjs/{actionTypes-ce9861e1.js → actionTypes-ed5cc34a.js} +1 -1
- package/cjs/{actionTypes-ce9861e1.js.map → actionTypes-ed5cc34a.js.map} +1 -1
- package/cjs/{color-76e3ed0d.js → color-63291cc4.js} +1 -1
- package/cjs/{color-76e3ed0d.js.map → color-63291cc4.js.map} +1 -1
- package/cjs/{compareIds-d11fdea7.js → compareIds-b63abf00.js} +1 -1
- package/cjs/{compareIds-d11fdea7.js.map → compareIds-b63abf00.js.map} +1 -1
- package/cjs/{const-a6cfa3dc.js → const-766cd123.js} +1 -1
- package/cjs/{const-a6cfa3dc.js.map → const-766cd123.js.map} +1 -1
- package/cjs/{const-2da24989.js → const-ff74be91.js} +1 -1
- package/cjs/{const-2da24989.js.map → const-ff74be91.js.map} +1 -1
- package/cjs/{context-7d13e92d.js → context-f090cc51.js} +2 -2
- package/cjs/{context-7d13e92d.js.map → context-f090cc51.js.map} +1 -1
- package/cjs/{groupChannel-3f4aaa32.js → groupChannel-c1f53052.js} +2 -2
- package/cjs/{groupChannel-3f4aaa32.js.map → groupChannel-c1f53052.js.map} +1 -1
- package/cjs/{index-2596c9f9.js → index-0b461031.js} +2 -2
- package/cjs/{index-2596c9f9.js.map → index-0b461031.js.map} +1 -1
- package/cjs/{index-8e975b91.js → index-11031c1a.js} +3 -3
- package/cjs/{index-8e975b91.js.map → index-11031c1a.js.map} +1 -1
- package/cjs/{index-62b2f3b4.js → index-6d39a929.js} +2 -2
- package/cjs/{index-62b2f3b4.js.map → index-6d39a929.js.map} +1 -1
- package/cjs/{index-0207af7d.js → index-7ca86e7a.js} +4 -4
- package/cjs/{index-0207af7d.js.map → index-7ca86e7a.js.map} +1 -1
- package/cjs/{index-691debed.js → index-8cd26508.js} +1 -1
- package/cjs/{index-691debed.js.map → index-8cd26508.js.map} +1 -1
- package/cjs/{index-86f7e77d.js → index-b28dfe02.js} +3 -3
- package/cjs/{index-86f7e77d.js.map → index-b28dfe02.js.map} +1 -1
- package/cjs/{index-41b5e18c.js → index-c142357a.js} +1 -1
- package/cjs/{index-41b5e18c.js.map → index-c142357a.js.map} +1 -1
- package/cjs/{index-2be8b3df.js → index-cb538ec6.js} +2 -2
- package/cjs/{index-2be8b3df.js.map → index-cb538ec6.js.map} +1 -1
- package/cjs/{index-eb6344e9.js → index-dd1efb51.js} +6 -6
- package/cjs/{index-eb6344e9.js.map → index-dd1efb51.js.map} +1 -1
- package/cjs/{index-a6cd696f.js → index-f2004893.js} +4 -4
- package/cjs/{index-a6cd696f.js.map → index-f2004893.js.map} +1 -1
- package/cjs/index.js +35 -35
- package/cjs/openChannel-44cc2f8f.js +5251 -0
- package/cjs/openChannel-44cc2f8f.js.map +1 -0
- package/cjs/{openChannelUtils-cede8a88.js → openChannelUtils-6101651d.js} +1 -1
- package/cjs/{openChannelUtils-cede8a88.js.map → openChannelUtils-6101651d.js.map} +1 -1
- package/cjs/sendbirdSelectors.js +2 -2
- package/cjs/{stringSet-2b4edf07.js → stringSet-8cf3905e.js} +1 -1
- package/cjs/{stringSet-2b4edf07.js.map → stringSet-8cf3905e.js.map} +1 -1
- package/cjs/{topics-b910c620.js → topics-db086d13.js} +1 -1
- package/cjs/{topics-b910c620.js.map → topics-db086d13.js.map} +1 -1
- package/cjs/{tslib.es6-9a5d5697.js → tslib.es6-22430723.js} +1 -1
- package/cjs/{tslib.es6-9a5d5697.js.map → tslib.es6-22430723.js.map} +1 -1
- package/cjs/ui/Accordion.js +4 -4
- package/cjs/ui/AccordionGroup.js +2 -2
- package/cjs/ui/AdminMessage.js +3 -3
- package/cjs/ui/Avatar.js +3 -3
- package/cjs/ui/Badge.js +5 -5
- package/cjs/ui/Button.js +4 -4
- package/cjs/ui/ChannelAvatar.js +4 -4
- package/cjs/ui/ChannelPreview.js +12 -12
- package/cjs/ui/ChatHeader.js +8 -8
- package/cjs/ui/Checkbox.js +1 -1
- package/cjs/ui/ConnectionStatus.js +5 -5
- package/cjs/ui/ContextMenu.js +5 -5
- package/cjs/ui/DateSeparator.js +4 -4
- package/cjs/ui/Dropdown.js +3 -3
- package/cjs/ui/EmojiReactions.js +7 -7
- package/cjs/ui/FileMessageItemBody.js +6 -6
- package/cjs/ui/FileViewer.js +7 -7
- package/cjs/ui/Icon.js +1 -1
- package/cjs/ui/IconButton.js +1 -1
- package/cjs/ui/ImageRenderer.js +1 -1
- package/cjs/ui/Input.js +3 -3
- package/cjs/ui/Label.js +3 -3
- package/cjs/ui/LinkLabel.js +3 -3
- package/cjs/ui/Loader.js +1 -1
- package/cjs/ui/MentionLabel.js +14 -13
- package/cjs/ui/MentionLabel.js.map +1 -1
- package/cjs/ui/MessageContent.js +14 -14
- package/cjs/ui/MessageInput.js +10 -10
- package/cjs/ui/MessageItemMenu.js +7 -7
- package/cjs/ui/MessageItemReactionMenu.js +5 -5
- package/cjs/ui/MessageSearchFileItem.js +10 -10
- package/cjs/ui/MessageSearchItem.js +10 -10
- package/cjs/ui/MessageStatus.js +8 -8
- package/cjs/ui/Modal.js +8 -8
- package/cjs/ui/MutedAvatarOverlay.js +1 -1
- package/cjs/ui/OGMessageItemBody.js +11 -11
- package/cjs/ui/OpenChannelAdminMessage.js +4 -4
- package/cjs/ui/OpenChannelAvatar.js +7 -7
- package/cjs/ui/OpenchannelConversationHeader.js +7 -7
- package/cjs/ui/OpenchannelFileMessage.js +15 -15
- package/cjs/ui/OpenchannelOGMessage.js +15 -15
- package/cjs/ui/OpenchannelThumbnailMessage.js +14 -14
- package/cjs/ui/OpenchannelUserMessage.js +15 -15
- package/cjs/ui/PlaceHolder.js +6 -6
- package/cjs/ui/QuoteMessage.js +7 -7
- package/cjs/ui/QuoteMessageInput.js +7 -7
- package/cjs/ui/ReactionBadge.js +3 -3
- package/cjs/ui/ReactionButton.js +1 -1
- package/cjs/ui/SortByRow.js +1 -1
- package/cjs/ui/TextButton.js +2 -2
- package/cjs/ui/TextMessageItemBody.js +11 -11
- package/cjs/ui/ThumbnailMessageItemBody.js +3 -3
- package/cjs/ui/Tooltip.js +3 -3
- package/cjs/ui/TooltipWrapper.js +1 -1
- package/cjs/ui/UnknownMessageItemBody.js +7 -7
- package/cjs/ui/UserListItem.js +12 -12
- package/cjs/ui/UserProfile.js +10 -10
- package/cjs/ui/Word.js +11 -11
- package/cjs/useSendbirdStateContext.js +1 -1
- package/cjs/{utils-15274d9b.js → utils-65925965.js} +1 -1
- package/cjs/{utils-15274d9b.js.map → utils-65925965.js.map} +1 -1
- package/cjs/{utils-4fadd220.js → utils-bbccbba3.js} +1 -1
- package/cjs/{utils-4fadd220.js.map → utils-bbccbba3.js.map} +1 -1
- package/cjs/{utils-b6bcd345.js → utils-f5e0083d.js} +1 -1
- package/cjs/{utils-b6bcd345.js.map → utils-f5e0083d.js.map} +1 -1
- package/cjs/{uuid-de92c01b.js → uuid-88159451.js} +1 -1
- package/cjs/{uuid-de92c01b.js.map → uuid-88159451.js.map} +1 -1
- package/cjs/withSendbird.js +1 -1
- package/{color-1727a3fb.js → color-aef1bef8.js} +1 -1
- package/{color-1727a3fb.js.map → color-aef1bef8.js.map} +1 -1
- package/{compareIds-ccf594a3.js → compareIds-3f1a5a5a.js} +1 -1
- package/{compareIds-ccf594a3.js.map → compareIds-3f1a5a5a.js.map} +1 -1
- package/{const-4674ec61.js → const-a6734af7.js} +1 -1
- package/{const-4674ec61.js.map → const-a6734af7.js.map} +1 -1
- package/{const-d3d5e7fc.js → const-b1f038b0.js} +1 -1
- package/{const-d3d5e7fc.js.map → const-b1f038b0.js.map} +1 -1
- package/{context-5db053f0.js → context-d04e2502.js} +2 -2
- package/{context-5db053f0.js.map → context-d04e2502.js.map} +1 -1
- package/{groupChannel-9bc7ca19.js → groupChannel-10e918af.js} +2 -2
- package/{groupChannel-9bc7ca19.js.map → groupChannel-10e918af.js.map} +1 -1
- package/{index-eeac3879.js → index-0d4dcc94.js} +3 -3
- package/{index-eeac3879.js.map → index-0d4dcc94.js.map} +1 -1
- package/{index-4e2ac873.js → index-13e3837f.js} +2 -2
- package/{index-4e2ac873.js.map → index-13e3837f.js.map} +1 -1
- package/{index-04458193.js → index-41a3e405.js} +4 -4
- package/{index-04458193.js.map → index-41a3e405.js.map} +1 -1
- package/{index-9570e69e.js → index-623fd405.js} +1 -1
- package/{index-9570e69e.js.map → index-623fd405.js.map} +1 -1
- package/{index-b188a276.js → index-73193bfa.js} +6 -6
- package/{index-b188a276.js.map → index-73193bfa.js.map} +1 -1
- package/{index-201c73a9.js → index-8528dcd1.js} +1 -1
- package/{index-201c73a9.js.map → index-8528dcd1.js.map} +1 -1
- package/{index-a355e1d8.js → index-afd61eff.js} +2 -2
- package/{index-a355e1d8.js.map → index-afd61eff.js.map} +1 -1
- package/{index-64b4e22e.js → index-cc9419b6.js} +4 -4
- package/{index-64b4e22e.js.map → index-cc9419b6.js.map} +1 -1
- package/{index-33a103e9.js → index-cdd2789a.js} +3 -3
- package/{index-33a103e9.js.map → index-cdd2789a.js.map} +1 -1
- package/{index-e15303b6.js → index-f222d022.js} +2 -2
- package/{index-e15303b6.js.map → index-f222d022.js.map} +1 -1
- package/index.js +35 -35
- package/openChannel-b0ad7380.js +5246 -0
- package/openChannel-b0ad7380.js.map +1 -0
- package/{openChannelUtils-0ffa52be.js → openChannelUtils-3ababdd1.js} +1 -1
- package/{openChannelUtils-0ffa52be.js.map → openChannelUtils-3ababdd1.js.map} +1 -1
- package/package-lock.json +1 -1
- package/package.json +2 -1
- package/sendbirdSelectors.js +2 -2
- package/{stringSet-a6858154.js → stringSet-efeb1ad3.js} +1 -1
- package/{stringSet-a6858154.js.map → stringSet-efeb1ad3.js.map} +1 -1
- package/{topics-58103dff.js → topics-7181983e.js} +1 -1
- package/{topics-58103dff.js.map → topics-7181983e.js.map} +1 -1
- package/{tslib.es6-28c0bd97.js → tslib.es6-91aa0158.js} +1 -1
- package/{tslib.es6-28c0bd97.js.map → tslib.es6-91aa0158.js.map} +1 -1
- package/ui/Accordion.js +4 -4
- package/ui/AccordionGroup.js +2 -2
- package/ui/AdminMessage.js +3 -3
- package/ui/Avatar.js +3 -3
- package/ui/Badge.js +5 -5
- package/ui/Button.js +4 -4
- package/ui/ChannelAvatar.js +4 -4
- package/ui/ChannelPreview.js +12 -12
- package/ui/ChatHeader.js +8 -8
- package/ui/Checkbox.js +1 -1
- package/ui/ConnectionStatus.js +5 -5
- package/ui/ContextMenu.js +5 -5
- package/ui/DateSeparator.js +4 -4
- package/ui/Dropdown.js +3 -3
- package/ui/EmojiReactions.js +7 -7
- package/ui/FileMessageItemBody.js +6 -6
- package/ui/FileViewer.js +7 -7
- package/ui/Icon.js +1 -1
- package/ui/IconButton.js +1 -1
- package/ui/ImageRenderer.js +1 -1
- package/ui/Input.js +3 -3
- package/ui/Label.js +3 -3
- package/ui/LinkLabel.js +3 -3
- package/ui/Loader.js +1 -1
- package/ui/MentionLabel.js +14 -13
- package/ui/MentionLabel.js.map +1 -1
- package/ui/MessageContent.js +14 -14
- package/ui/MessageInput.js +10 -10
- package/ui/MessageItemMenu.js +7 -7
- package/ui/MessageItemReactionMenu.js +5 -5
- package/ui/MessageSearchFileItem.js +10 -10
- package/ui/MessageSearchItem.js +10 -10
- package/ui/MessageStatus.js +8 -8
- package/ui/Modal.js +8 -8
- package/ui/MutedAvatarOverlay.js +1 -1
- package/ui/OGMessageItemBody.js +11 -11
- package/ui/OpenChannelAdminMessage.js +4 -4
- package/ui/OpenChannelAvatar.js +7 -7
- package/ui/OpenchannelConversationHeader.js +7 -7
- package/ui/OpenchannelFileMessage.js +15 -15
- package/ui/OpenchannelOGMessage.js +15 -15
- package/ui/OpenchannelThumbnailMessage.js +14 -14
- package/ui/OpenchannelUserMessage.js +15 -15
- package/ui/PlaceHolder.js +6 -6
- package/ui/QuoteMessage.js +7 -7
- package/ui/QuoteMessageInput.js +7 -7
- package/ui/ReactionBadge.js +3 -3
- package/ui/ReactionButton.js +1 -1
- package/ui/SortByRow.js +1 -1
- package/ui/TextButton.js +2 -2
- package/ui/TextMessageItemBody.js +11 -11
- package/ui/ThumbnailMessageItemBody.js +3 -3
- package/ui/Tooltip.js +3 -3
- package/ui/TooltipWrapper.js +1 -1
- package/ui/UnknownMessageItemBody.js +7 -7
- package/ui/UserListItem.js +12 -12
- package/ui/UserProfile.js +10 -10
- package/ui/Word.js +11 -11
- package/useSendbirdStateContext.js +1 -1
- package/{utils-5477ddbc.js → utils-0db9b91e.js} +1 -1
- package/{utils-5477ddbc.js.map → utils-0db9b91e.js.map} +1 -1
- package/{utils-e2f16b69.js → utils-6ed4fbb8.js} +1 -1
- package/{utils-e2f16b69.js.map → utils-6ed4fbb8.js.map} +1 -1
- package/{utils-5fe76946.js → utils-7b9c4aab.js} +1 -1
- package/{utils-5fe76946.js.map → utils-7b9c4aab.js.map} +1 -1
- package/{uuid-38ace415.js → uuid-902e6498.js} +1 -1
- package/{uuid-38ace415.js.map → uuid-902e6498.js.map} +1 -1
- package/withSendbird.js +1 -1
- package/ChannelListProvider-471abb8f.js.map +0 -1
- package/ChannelProvider-01a680e0.js.map +0 -1
- package/MemberList-9863866e.js.map +0 -1
- package/__bundle-7dfccc8c-62bd23b5.js +0 -24
- package/__bundle-7dfccc8c-62bd23b5.js.map +0 -1
- package/cjs/ChannelListProvider-8632f526.js.map +0 -1
- package/cjs/ChannelProvider-5e683eb1.js.map +0 -1
- package/cjs/MemberList-4efb8994.js.map +0 -1
- package/cjs/__bundle-7dfccc8c-d812ccd2.js +0 -151
- package/cjs/__bundle-7dfccc8c-d812ccd2.js.map +0 -1
- package/cjs/openChannel-7272b85b.js +0 -13
- package/cjs/openChannel-7272b85b.js.map +0 -1
- package/openChannel-a5d4b5d4.js +0 -8
- package/openChannel-a5d4b5d4.js.map +0 -1
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var __bundle7dfccc8c = require('./__bundle-7dfccc8c-d812ccd2.js');
|
|
4
|
-
|
|
5
|
-
var Re={profileImage:null,profileUrl:null,nickname:null},Le=function(){this.onSessionExpired=__bundle7dfccc8c.Y,this.onSessionTokenRequired=function(e){return e(null)},this.onSessionError=__bundle7dfccc8c.Y,this.onSessionRefreshed=__bundle7dfccc8c.Y,this.onSessionClosed=__bundle7dfccc8c.Y;},Pe=function(){this.onConnected=__bundle7dfccc8c.Y,this.onReconnectStarted=__bundle7dfccc8c.Y,this.onReconnectSucceeded=__bundle7dfccc8c.Y,this.onReconnectFailed=__bundle7dfccc8c.Y,this.onDisconnected=__bundle7dfccc8c.Y;},Ae=function(){this.onFriendsDiscovered=__bundle7dfccc8c.Y,this.onTotalUnreadMessageCountUpdated=__bundle7dfccc8c.Y;};!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.Le);var De=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._pauseDelayTimer=null,t._currentState="visible",t}return __bundle7dfccc8c.t(t,e),Object.defineProperty(t.prototype,"isAvailable",{get:function(){return "undefined"!=typeof window&&!!window.addEventListener},enumerable:!1,configurable:!0}),t.prototype._toggleState=function(){var e=this;"hidden"!==document.visibilityState?"hidden"===this._currentState&&(this._pauseDelayTimer&&(clearTimeout(this._pauseDelayTimer),this._pauseDelayTimer=null),this.dispatch("resume")):"hidden"!==this._currentState&&(this._pauseDelayTimer=setTimeout((function(){e._pauseDelayTimer=null,e.dispatch("pause");}),3e4)),this._currentState=document.visibilityState;},t.prototype.start=function(){this.isAvailable&&window.addEventListener("visibilitychange",this._toggleState.bind(this),{capture:!0});},t.prototype.stop=function(){this.isAvailable&&window.removeEventListener("visibilitychange",this._toggleState.bind(this),{capture:!0});},t}(__bundle7dfccc8c.M),Me=function(){function e(e){var t=e.logger,n=e.connectionDelegate,r=void 0===n?null:n;this.logger=t,r&&(this.connectionDelegate=r),this._onlineWorker=this._onlineWorker.bind(this),this._offlineWorker=this._offlineWorker.bind(this);}return Object.defineProperty(e.prototype,"isAvailable",{get:function(){return "undefined"!=typeof window&&window.addEventListener&&"ononline"in window&&"onoffline"in window&&"undefined"!=typeof navigator&&void 0!==navigator.onLine},enumerable:!1,configurable:!0}),e.prototype._onlineWorker=function(){this.connectionDelegate.reconnect();},e.prototype._offlineWorker=function(){this.connectionDelegate.disconnect();},e.prototype.start=function(){this.isAvailable&&(window.addEventListener("online",this._onlineWorker),window.addEventListener("offline",this._offlineWorker));},e.prototype.stop=function(){this.isAvailable&&(window.removeEventListener("online",this._onlineWorker,!1),window.removeEventListener("offline",this._offlineWorker,!1));},e.prototype.isOnline=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this.isAvailable?[2,navigator.onLine]:[2,new Promise((function(e,t){fetch("https://www.google.com",{method:__bundle7dfccc8c.d.GET}).then((function(){return e(!0)})).catch((function(){return e(!1)}));}))]}))}))},e}(),Ue=function(e){function t(t){var n=t.userId,r=t.nickname,i=void 0===r?null:r,s=t.profileUrl,o=void 0===s?null:s,a=t.profileImage,u=void 0===a?null:a,c=t.preferredLanguages,l=void 0===c?null:c,h=e.call(this)||this;return h.method=__bundle7dfccc8c.d.PUT,h.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n)),h.params=__bundle7dfccc8c.U({nickname:i,profile_url:o,profile_file:u,preferred_languages:l}),h}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),qe=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=null,r.user=new __bundle7dfccc8c.ct(t,__bundle7dfccc8c.n({},n)),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Be=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.POST,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/apns"),i.params={apns_device_token:r,always_push:!0},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.type=n.type?__bundle7dfccc8c.z[n.type.toLowerCase()]:__bundle7dfccc8c.z.UNKNOWN,r.user=new __bundle7dfccc8c.ct(t,n.user),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var Fe=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.POST,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/gcm"),i.params={gcm_reg_token:r,always_push:!0},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.type=n.type?__bundle7dfccc8c.z[n.type.toLowerCase()]:__bundle7dfccc8c.z.UNKNOWN,r.user=new __bundle7dfccc8c.ct(t,n.user),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var Ke=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.DELETE,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/apns/").concat(encodeURIComponent(r)),i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new __bundle7dfccc8c.ct(t,n.user),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var je=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.DELETE,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/gcm/").concat(encodeURIComponent(r)),i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.token=n.token,r.user=new __bundle7dfccc8c.ct(t,n.user),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var He=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.DELETE,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/apns"),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?__bundle7dfccc8c.z[n.type.toLowerCase()]:__bundle7dfccc8c.z.UNKNOWN,r.user=new __bundle7dfccc8c.ct(t,n.user),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var Ve=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.DELETE,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/gcm"),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.type=n.type?__bundle7dfccc8c.z[n.type.toLowerCase()]:__bundle7dfccc8c.z.UNKNOWN,r.user=new __bundle7dfccc8c.ct(t,n.user),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var We=function(e){function t(t){var n=t.userId,r=t.type,i=t.token,s=t.ts,o=e.call(this)||this;return o.method=__bundle7dfccc8c.d.GET,o.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/").concat(encodeURIComponent(r),"/device_tokens"),o.params={created_ts:s,token:i},o}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),ze=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.pushTokens={type:n.type?__bundle7dfccc8c.z[n.type.toLowerCase()]:__bundle7dfccc8c.z.UNKNOWN,deviceTokens:n.device_tokens,hasMore:n.has_more,token:n.token},r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Qe=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Ge=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Ye=function(e){function t(t){var n=t.userId,r=t.willAutoAccept,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.PUT,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/channel_invitation_preference"),i.params={auto_accept:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Je=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.autoAccept=n.auto_accept,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Xe=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push_preference"),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Ze=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),$e=function(e){function t(t){var n=t.userId,r=t.doNotDisturbOn,i=t.startHour,s=t.startMin,o=t.endHour,a=t.endMin,u=t.timezone,c=e.call(this)||this;return c.method=__bundle7dfccc8c.d.PUT,c.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push_preference"),c.params={do_not_disturb:r,start_hour:i,start_min:s,end_hour:o,end_min:a,timezone:u},c}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),et=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.preference={doNotDisturbOn:n.do_not_disturb,startHour:n.start_hour,startMin:n.start_min,endHour:n.end_hour,endMin:n.end_min,timezone:n.timezone},r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),tt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push_preference"),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),nt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),rt=function(e){function t(t){var n=t.userId,r=t.snoozeOn,i=t.startTs,s=t.endTs,o=e.call(this)||this;return o.method=__bundle7dfccc8c.d.PUT,o.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push_preference"),o.params={snooze_enabled:r,snooze_start_ts:i,snooze_end_ts:s},o}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),it=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.snoozePeriod={isSnoozeOn:n.snooze_enabled},"number"==typeof n.snooze_start_ts&&(r.snoozePeriod.startTs=n.snooze_start_ts),"number"==typeof n.snooze_end_ts&&(r.snoozePeriod.endTs=n.snooze_end_ts),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),st=function(e){function t(t){var n=t.userId,r=t.blockedUserId,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.POST,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/block"),i.params={target_id:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.user=new __bundle7dfccc8c.ct(t,n),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var ot=function(e){function t(t){var n=t.userId,r=t.unblockedUserId,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.DELETE,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/block/").concat(encodeURIComponent(r)),i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var at=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/template"),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),ut=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),ct=function(e){function t(t){var n=t.userId,r=t.templateName,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.PUT,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/push/template"),i.params={name:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),lt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.name=n.name,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),ht=function(e){function t(t){var n=t.userId,r=t.token,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.GET,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/friends/changelogs"),i.params={token:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),dt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.changelogs={addedUsers:n.added.map((function(e){return new __bundle7dfccc8c.ct(t,e)})),updatedUsers:n.updated.map((function(e){return new __bundle7dfccc8c.ct(t,e)})),deletedUserIds:n.deleted,hasMore:n.has_more,token:n.next},r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),ft=function(e){function t(t){var n=t.userId,r=t.discoveries,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.PUT,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discoveries:r.map((function(e){return {friend_discovery_key:e.friendDiscoveryKey,friend_name:e.friendName}}))},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),pt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.friendDiscoveryRequestId=n.friend_discovery_request_id,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),vt=function(e){function t(t){var n=t.userId,r=t.discoveryKeys,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.DELETE,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/friend_discoveries"),i.params={friend_discovery_keys:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var _t=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.POST,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),mt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new __bundle7dfccc8c.ct(t,e)})),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),yt=function(e){function t(t){var n=t.userId,r=t.userIds,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.DELETE,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/friends"),i.params={user_ids:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var bt=function(e){function t(t){var n=t.userId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ue,"/").concat(n,"/allow_friend_discovery"),r.params={},r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),gt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.allowFriendDiscovery=n.allow_friend_discovery,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),It=function(e){function t(t){var n=t.userId,r=t.allowFriendDiscovery,i=e.call(this)||this;return i.method=__bundle7dfccc8c.d.PUT,i.path="".concat(__bundle7dfccc8c.Ue,"/").concat(n,"/allow_friend_discovery"),i.params={allow_friend_discovery:r},i}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(){return null!==e&&e.apply(this,arguments)||this}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var wt,Et=function(e){this.key=null,this.url=null,this.key=e.key,this.url=e.url;},kt=function(e){var t,n,r;this.id=0,this.name=null,this.url=null,this.emojis=[],this.id=null!==(t=e.id)&&void 0!==t?t:0,this.name=null!==(n=e.name)&&void 0!==n?n:"",this.url=null!==(r=e.url)&&void 0!==r?r:"",this.emojis=e.emojis?e.emojis.map((function(e){return new Et(e)})):[];},Nt=function(e){this.emojiHash=null,this.emojiCategories=[],this.emojiHash=e.emoji_hash||"",this.emojiCategories=e.emoji_categories?e.emoji_categories.map((function(e){return new kt(e)})):[];},Ot=function(e){function t(){var t=e.call(this)||this;return t.method=__bundle7dfccc8c.d.GET,t.path=__bundle7dfccc8c.ze,t}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),St=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiContainer=new Nt(n),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Tt=function(e){function t(t){var n=t.categoryId,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.ze,"/").concat(n),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),xt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emojiCategory=new kt(n),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Ct=function(e){function t(t){var n=t.key,r=e.call(this)||this;return r.method=__bundle7dfccc8c.d.GET,r.path="".concat(__bundle7dfccc8c.Ke,"/").concat(n),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Rt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.emoji=new Et(n),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Lt=function(e){function t(t){var n=t.limit,r=t.token,i=t.userIdsFilter,s=t.metaDataKeyFilter,o=t.metaDataValuesFilter,a=t.nicknameStartsWithFilter,u=e.call(this)||this;return u.method=__bundle7dfccc8c.d.GET,u.path=__bundle7dfccc8c.Ue,u.params=__bundle7dfccc8c.U({limit:n,token:r,user_ids:i,metadatakey:s,metadatavalues_in:o,nickname_startswith:a}),u}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Pt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new __bundle7dfccc8c.ct(t,e)})),r.next=n.next,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),At=function(e){function n(t,n){var r,i,s,o=this;return (o=e.call(this,t,n)||this).userIdsFilter=null,o.metaDataKeyFilter=null,o.metaDataValuesFilter=null,o.nicknameStartsWithFilter=null,o.userIdsFilter=null!==(r=n.userIdsFilter)&&void 0!==r?r:null,o.metaDataKeyFilter=null!==(i=n.metaDataKeyFilter)&&void 0!==i?i:null,o.metaDataValuesFilter=null!==(s=n.metaDataValuesFilter)&&void 0!==s?s:null,o.nicknameStartsWithFilter=n.nicknameStartsWithFilter||null,o}return __bundle7dfccc8c.t(n,e),n.prototype._validate=function(){return e.prototype._validate.call(this)&&__bundle7dfccc8c.E("string",this.userIdsFilter,!0)&&__bundle7dfccc8c.y("string",this.metaDataKeyFilter,!0)&&__bundle7dfccc8c.E("string",this.metaDataValuesFilter,!0)&&__bundle7dfccc8c.y("string",this.metaDataKeyFilter,!0)},n.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=__bundle7dfccc8c.St.of(this._iid).requestQueue,t=new Lt(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{token:this._token})),[4,e.send(t)]):[3,2]:[3,5];case 1:return n=o.sent(),r=n.as(Pt),i=r.users,s=r.next,this._token=s,this._hasNext=!!s,this._isLoading=!1,[2,i];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},n}(__bundle7dfccc8c.bn),Dt=function(e){function t(t){var n=t.userId,r=t.limit,i=t.token,s=t.userIdsFilter,o=e.call(this)||this;return o.method=__bundle7dfccc8c.d.GET,o.path="".concat(__bundle7dfccc8c.Ue,"/").concat(n,"/block"),o.params=__bundle7dfccc8c.U({limit:r,token:i,user_ids:s}),o}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Mt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.users=n.users.map((function(e){return new __bundle7dfccc8c.ct(t,e)})),r.next=n.next,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Ut=function(e){function t(t,n){var r,i=this;return (i=e.call(this,t,n)||this).userIdsFilter=null,i.userIdsFilter=null!==(r=n.userIdsFilter)&&void 0!==r?r:null,i}return __bundle7dfccc8c.t(t,e),t.prototype._validate=function(){return e.prototype._validate.call(this)&&__bundle7dfccc8c.E("string",this.userIdsFilter,!0)},t.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Dt(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{userId:t.userId,token:this._token})),[4,n.send(r)]):[3,2]:[3,5];case 1:return i=u.sent(),s=i.as(Mt),o=s.users,a=s.next,this._token=a,this._hasNext=!!a,this._isLoading=!1,[2,o];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},t}(__bundle7dfccc8c.bn),qt=function(e){function t(t){var n=t.userId,r=t.limit,i=t.token,s=e.call(this)||this;return s.method=__bundle7dfccc8c.d.GET,s.path="".concat(__bundle7dfccc8c.Ue,"/").concat(encodeURIComponent(n),"/friends"),s.params={limit:r,token:i},s}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Bt=function(e){function t(t,n){var r=e.call(this,t,n)||this;return r.hasMore=n.has_more,r.users=n.users.map((function(e){return new __bundle7dfccc8c.ct(t,e)})),r.next=n.next,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Ft=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __bundle7dfccc8c.t(t,e),t.prototype._validate=function(){return e.prototype._validate.call(this)},t.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new qt(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{userId:t.userId,token:this._token})),[4,n.send(r)]):[3,2]:[3,5];case 1:return i=c.sent(),s=i.as(Bt),o=s.users,a=s.hasMore,u=s.next,this._token=u,this._hasNext=a,this._isLoading=!1,[2,o];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},t}(__bundle7dfccc8c.bn),Kt={},jt=function(){function e(e){var t=e.dbname,n=e.itemSizeLimit,r=void 0===n?1048576:n,i=e.cacheLimit,s=void 0===i?256:i,o=e.blockHashBase,a=void 0===o?2:o,u=e.blockHashMultiplier,c=void 0===u?10:u,l=e.blockHashConstant,h=void 0===l?11:l,d=e.transactionApplyDelay,f=void 0===d?200:d,p=e.disableLogger,v=void 0!==p&&p;return Kt[t]||(this.itemSizeLimit=r,this.cacheLimit=s,this.blockHashBase=a,this.blockHashMultiplier=c,this.blockHashConstant=h,this.transactionApplyDelay=f,this.disableLogger=v,Kt[t]=this),Kt[t]}return e.get=function(e){return Kt[e]},e}();!function(e){e[e.UNKNOWN_ERROR=6e7]="UNKNOWN_ERROR",e[e.STORE_NOT_DEFINED=61001e3]="STORE_NOT_DEFINED",e[e.STORE_NOT_AVAILABLE=61001001]="STORE_NOT_AVAILABLE",e[e.STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING=61001002]="STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING",e[e.STORE_IS_FULL=61001003]="STORE_IS_FULL",e[e.STORE_INVALID_KEY_TYPE=61002e3]="STORE_INVALID_KEY_TYPE",e[e.STORE_BROKEN_INTEGRITY=61002001]="STORE_BROKEN_INTEGRITY",e[e.STORE_BROKEN_BLOB=61002002]="STORE_BROKEN_BLOB",e[e.STORE_ENCRYPTION_INVALID=61002003]="STORE_ENCRYPTION_INVALID",e[e.STORE_ITEM_SIZE_LIMIT_EXCEEDED=61017e3]="STORE_ITEM_SIZE_LIMIT_EXCEEDED",e[e.STORE_READ_FAILED=61017001]="STORE_READ_FAILED",e[e.STORE_WRITE_FAILED=61017002]="STORE_WRITE_FAILED",e[e.DATABASE_SCHEMA_NOT_ON_UPGRADE=62002e3]="DATABASE_SCHEMA_NOT_ON_UPGRADE",e[e.COLLECTION_NOT_READY=63001e3]="COLLECTION_NOT_READY",e[e.COLLECTION_KEY_NOT_MATCH=63002e3]="COLLECTION_KEY_NOT_MATCH",e[e.COLLECTION_QUERY_NOT_VALID=63002001]="COLLECTION_QUERY_NOT_VALID",e[e.COLLECTION_KEY_NOT_FOUND=63004e3]="COLLECTION_KEY_NOT_FOUND",e[e.COLLECTION_KEY_NOT_GIVEN=63004001]="COLLECTION_KEY_NOT_GIVEN",e[e.COLLECTION_INSERT_DUPLICATE=63009e3]="COLLECTION_INSERT_DUPLICATE",e[e.COLLECTION_WRITE_FAILED=63017e3]="COLLECTION_WRITE_FAILED",e[e.COLLECTION_ITEM_SIZE_LIMIT_EXCEEDED=63017001]="COLLECTION_ITEM_SIZE_LIMIT_EXCEEDED",e[e.INDEX_TABLE_IS_REQUIRED=65001e3]="INDEX_TABLE_IS_REQUIRED",e[e.INDEX_TYPE_NOT_MATCH=65002e3]="INDEX_TYPE_NOT_MATCH",e[e.COMPARE_TYPE_NOT_MATCH=69002001]="COMPARE_TYPE_NOT_MATCH",e[e.CIRCULAR_REFERENCE_FOUND=69002002]="CIRCULAR_REFERENCE_FOUND";}(wt||(wt={}));var Ht,Vt=function(e){function t(n){var r=n.code,i=void 0===r?wt.UNKNOWN_ERROR:r,s=n.message,o=void 0===s?"Unknown error occurred.":s,a=e.call(this,o)||this;return a.code=i,Object.setPrototypeOf(a,t.prototype),a}return __bundle7dfccc8c.t(t,e),Object.defineProperty(t,"storeNotDefined",{get:function(){return new t({code:wt.STORE_NOT_DEFINED,message:"Store is not defined. Specify the store on NestDB()"})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeNotAvailable",{get:function(){return new t({code:wt.STORE_NOT_AVAILABLE,message:"Store is not available. Check your environment settings."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeNotAvailableInPrivateBrowsing",{get:function(){return new t({code:wt.STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING,message:"Store is not available because it is in private browsing."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeIsFull",{get:function(){return new t({code:wt.STORE_IS_FULL,message:"Store is full."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeKeyTypeIsInvalid",{get:function(){return new t({code:wt.STORE_INVALID_KEY_TYPE,message:"Store key should be string type."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeBrokenIntegrity",{get:function(){return new t({code:wt.STORE_BROKEN_INTEGRITY,message:"Data should be in a store but it does not. Integrity is broken."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeBrokenBlob",{get:function(){return new t({code:wt.STORE_BROKEN_BLOB,message:"Data should be in a store but it does not. Blob data is broken."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeEncryptionInvalid",{get:function(){return new t({code:wt.STORE_ENCRYPTION_INVALID,message:"Encryption algorithm has changed. All the store should reset."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeItemSizeExceeded",{get:function(){return new t({code:wt.STORE_ITEM_SIZE_LIMIT_EXCEEDED,message:"The size of the item exceeds the limit that the store allows."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeReadFailed",{get:function(){return new t({code:wt.STORE_READ_FAILED,message:"Failed to read from store."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"storeWriteFailed",{get:function(){return new t({code:wt.STORE_WRITE_FAILED,message:"Failed to write to store."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"databaseSchemaNotOnUpgrade",{get:function(){return new t({code:wt.DATABASE_SCHEMA_NOT_ON_UPGRADE,message:"Committing schema is not allowed when upgrade is not running."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionNotReady",{get:function(){return new t({code:wt.COLLECTION_NOT_READY,message:"Collection is not ready due to an error during initialization."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionKeyNotMatch",{get:function(){return new t({code:wt.COLLECTION_KEY_NOT_MATCH,message:"keyName of collection could not change."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionQueryNotValid",{get:function(){return new t({code:wt.COLLECTION_QUERY_NOT_VALID,message:"Query parameter is not a valid format."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionInsertDuplicate",{get:function(){return new t({code:wt.COLLECTION_INSERT_DUPLICATE,message:"The key already exists."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionKeyNotFound",{get:function(){return new t({code:wt.COLLECTION_KEY_NOT_FOUND,message:"The key is not found."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionKeyNotGiven",{get:function(){return new t({code:wt.COLLECTION_KEY_NOT_GIVEN,message:"The item should contain [keyName] property."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionWriteFailed",{get:function(){return new t({code:wt.COLLECTION_WRITE_FAILED,message:"Failed to write an item."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"collectionItemSizeExceeded",{get:function(){return new t({code:wt.COLLECTION_ITEM_SIZE_LIMIT_EXCEEDED,message:"The size of the item exceeds the limit that a collection allows."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"indexTableIsRequired",{get:function(){return new t({code:wt.INDEX_TABLE_IS_REQUIRED,message:"Index table is required."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"indexTypesNotMatch",{get:function(){return new t({code:wt.INDEX_TYPE_NOT_MATCH,message:"Indexed column should have primitive type."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"compareTypesNotMatch",{get:function(){return new t({code:wt.COMPARE_TYPE_NOT_MATCH,message:"Values to compare have different types."})},enumerable:!1,configurable:!0}),Object.defineProperty(t,"circularReferenceFound",{get:function(){return new t({code:wt.CIRCULAR_REFERENCE_FOUND,message:"Cannot handle circular referenced object."})},enumerable:!1,configurable:!0}),t}(Error);!function(e){e.INIT="init",e.READY="ready",e.CLOSED="closed";}(Ht||(Ht={}));var Wt,zt=function(e,t){if(void 0===t&&(t=new WeakMap),"object"==typeof e&&null!==e){if(t.has(e))throw Vt.circularReferenceFound;t.set(e,!0);var n=null;if(Array.isArray(e))n=e.map((function(e){return zt(e,t)}));else if(e instanceof RegExp)n=e;else if(e instanceof Date)n=e;else for(var r in n={},e)n[r]=zt(e[r],t);return t.delete(e),n}return e},Qt=function(e,t){if(null==t)return 1;if(null==e)return -1;if(typeof e!=typeof t)throw Vt.compareTypesNotMatch;var n=0;switch(typeof e){case"boolean":case"number":n=e-t;break;case"string":n=e.localeCompare(t);}return n},Gt=function(e,t){for(var n=0,r=0;r<e.length;r++)n=e.charCodeAt(r)+(n<<6)+(n<<16)-n;return (n>>>0)%t},Yt=function(e){return new Promise((function(t){setTimeout((function(){return t()}),e);}))},Jt=function(e,t){if(!t)return !1;if("function"!=typeof e){for(var n in e){if(["/and","&&"].includes(n)){if(e[n].some((function(e){return !Jt(e,t)})))return !1}else if(["/or","||"].includes(n)){if(e[n].every((function(e){return !Jt(e,t)})))return !1}else if("/where"===n){if(!(0, e[n])(t))return !1}else {var r=n;if("object"==typeof e[r]){var i=e[r];for(var s in i)switch(s){case"/eq":case"=":if((o=t[r])!==(a=i[s]))return !1;break;case"/neq":case"!=":if((o=t[r])===(a=i[s]))return !1;break;case"/gt":case">":var o=t[r],a=i[s];if(!(Qt(o,a)>0))return !1;break;case"/gte":case">=":o=t[r],a=i[s];if(!(Qt(o,a)>=0))return !1;break;case"/lt":case"<":o=t[r],a=i[s];if(!(Qt(o,a)<0))return !1;break;case"/lte":case"<=":o=t[r],a=i[s];if(!(Qt(o,a)<=0))return !1;break;case"/in":o=t[r];if(!(a=i[s]).includes(o))return !1;break;case"/nin":o=t[r];if((a=i[s]).includes(o))return !1;break;case"/contain":o=t[r],a=i[s];if(!o.includes(a))return !1;break;case"/regex":o=t[r];if(!(a=i[s]).test(o))return !1;break;case"/where":o=t[r];if(!(0, i[s])(o))return !1}}else if("function"==typeof e[r]){if(!e[r](t[r]))return !1}else if(e[r]!==t[r])return !1}}return !0}return e(t)},Xt=function(){},Zt=function(){return Promise.resolve()},$t=function(e){return e},en$1=function(e,t){t(null);};!function(e){e[e.FORWARD=0]="FORWARD",e[e.BACKWARD=1]="BACKWARD";}(Wt||(Wt={}));var tn$1,nn,rn$1,sn$1=function(){function e(e){var t=e.initialPrevValue,n=void 0===t?null:t,r=e.initialNextValue,i=void 0===r?null:r,s=e.iterator,o=e.map,a=void 0===o?$t:o,u=e.backward,c=void 0===u?Zt:u,l=e.forward,h=void 0===l?Zt:l,d=e.complete,f=void 0===d?Xt:d;this._prevValue=n,this._nextValue=i,this._error=null,this._map=a,this._backward=c,this._forward=h,this._iterator=s,this._complete=f;}return Object.defineProperty(e.prototype,"prevValue",{get:function(){return this._map(this._prevValue)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"nextValue",{get:function(){return this._map(this._nextValue)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"error",{get:function(){return this._error},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasPrevious",{get:function(){return !!this._prevValue},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasNext",{get:function(){return !!this._nextValue},enumerable:!1,configurable:!0}),e.prototype.prev=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:if(!this.hasPrevious)return [3,6];r.label=1;case 1:return r.trys.push([1,3,,4]),e=this._prevValue,t=this,[4,this._backward()];case 2:return t._prevValue=r.sent()||null,this._nextValue=e,[3,4];case 3:return n=r.sent(),this._error=n,[3,4];case 4:return [4,this._iterator(this)];case 5:return [2,r.sent()];case 6:this._complete(),r.label=7;case 7:return [2]}}))}))},e.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:if(!this.hasNext)return [3,6];r.label=1;case 1:return r.trys.push([1,3,,4]),e=this._nextValue,t=this,[4,this._forward()];case 2:return t._nextValue=r.sent()||null,this._prevValue=e,[3,4];case 3:return n=r.sent(),this._error=n,[3,4];case 4:return [4,this._iterator(this)];case 5:return [2,r.sent()];case 6:this._complete(),r.label=7;case 7:return [2]}}))}))},e.prototype.stop=function(){this._prevValue=null,this._nextValue=null,this._complete();},e}(),on$1=function(){function e(e){var t=e.condition,n=void 0===t?{}:t,r=e.backward,i=void 0!==r&&r,s=e.blockManager,o=e.indexer;this.condition=n,this.backward=i,this._blockManager=s,this._indexer=o;}return e.prototype.findOptimizedStartPosition=function(){var e=this,t=["=","/eq",">",">=","/gt","/gte"],n=["=","/eq","<","<=","/lt","/lte"];if(this.backward){var r=this._indexer.origin.length-1;if("function"!=typeof this.condition)for(var i in this._indexer.fields){var s=this._indexer.fields[i],o=1;if("-"===s[0]&&(s=s.slice(1),o=-1),this.condition[s])if("object"==typeof this.condition[s]){var a=o>0?n:t;for(var u in this.condition[s])if(a.includes(u))for(var c=r;c>=0;c--)if(o*Qt(this._indexer.origin[c].columnValues[i],this.condition[s][u])<=0){r=c;break}}else for(c=r;c>=0;c--)if(o*Qt(this._indexer.origin[c].columnValues[i],this.condition[s])<=0){r=c;break}}return Math.min(r+1,this._indexer.origin.length-1)}var l=0;if("function"!=typeof this.condition)for(var h=function(r){var i=d._indexer.fields[r],s=1;if("-"===i[0]&&(i=i.slice(1),s=-1),d.condition[i])if("object"==typeof d.condition[i])Object.keys(d.condition[i]).forEach((function(o){if((s>0?t:n).includes(o))for(var a=l;a<e._indexer.origin.length;a++)if(s*Qt(e._indexer.origin[a].columnValues[r],e.condition[i][o])>=0){l=a;break}}));else for(var o=l;o<d._indexer.origin.length;o++)if(s*Qt(d._indexer.origin[o].columnValues[r],d.condition[i])>=0){l=o;break}},d=this,i=0;i<this._indexer.fields.length;i++)h(i);return Math.max(l-1,0)},e.prototype.each=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,c=this;return __bundle7dfccc8c.i(this,(function(l){switch(l.label){case 0:if(t=this.findOptimizedStartPosition(),n=0,this.backward&&this._indexer.origin[t]&&(n=this._indexer.origin[t].keys.length-1),r=function(){if(c._indexer.origin[t]){if(!c._indexer.origin[t].keys[++n]){if(!c._indexer.origin[++t])return !1;n=0;}return !0}return !1},i=function(){if(c._indexer.origin[t]){if(!c._indexer.origin[t].keys[--n]){if(!c._indexer.origin[--t])return !1;n=c._indexer.origin[t].keys.length-1;}return !0}return !1},s=null,!this._indexer.origin[t])return [3,4];o=this.backward?i:r,l.label=1;case 1:return [4,this._blockManager.getFromBlock(this._indexer.origin[t].keys[n])];case 2:if(a=l.sent(),Jt(this.condition,a))return s=a,[3,4];l.label=3;case 3:if(o())return [3,1];l.label=4;case 4:return [4,new Promise((function(o){var a=new sn$1({initialNextValue:zt(s),iterator:e,forward:function(){return __bundle7dfccc8c.r(c,void 0,void 0,(function(){var e,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:e=this.backward?i:r,o.label=1;case 1:return e()?[4,this._blockManager.getFromBlock(this._indexer.origin[t].keys[n])]:[3,3];case 2:return s=o.sent(),Jt(this.condition,s)?[2,zt(s)]:[3,1];case 3:return [2,null]}}))}))},backward:function(){return __bundle7dfccc8c.r(c,void 0,void 0,(function(){var e,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:e=this.backward?r:i,o.label=1;case 1:return e()?[4,this._blockManager.getFromBlock(this._indexer.origin[t].keys[n])]:[3,3];case 2:return s=o.sent(),Jt(this.condition,s)?[2,zt(s)]:[3,1];case 3:return [2,null]}}))}))},complete:o});e(a);}))];case 5:return [2,l.sent()]}}))}))},e}(),an$1=function(){function e(e){var t=e.condition,n=void 0===t?{}:t,r=e.backward,i=void 0!==r&&r,s=e.mutex,o=e.blockManager,a=e.indexer;this._mutex=s,this._iterator=new on$1({condition:n,backward:i,blockManager:o,indexer:a});}return e.prototype.fetch=function(e){return void 0===e&&(e={}),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s=this;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:if(t=Math.max(e.offset||0,0),0===(n="number"==typeof e.limit?e.limit:Number.MAX_SAFE_INTEGER))return [2,[]];if(n<0)throw Vt.collectionQueryNotValid;o.label=1;case 1:return o.trys.push([1,4,,5]),r=[],[4,this._mutex.lock()];case 2:return o.sent(),[4,this._iterator.each((function(e){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(i){return e.error?e.stop():e.hasNext?0===t?(r.push(e.nextValue),0<n&&n<=r.length?e.stop():e.next()):(t--,e.next()):e.stop(),[2]}))}))}))];case 3:return o.sent(),this._mutex.unlock(),[2,r];case 4:throw i=o.sent(),this._mutex.unlock(),i;case 5:return [2]}}))}))},e.prototype.count=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n=this;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return r.trys.push([0,3,,4]),e=0,[4,this._mutex.lock()];case 1:return r.sent(),[4,this._iterator.each((function(t){return __bundle7dfccc8c.r(n,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return t.error?t.stop():t.hasNext?(e++,t.next()):t.stop(),[2]}))}))}))];case 2:return r.sent(),this._mutex.unlock(),[2,e];case 3:throw t=r.sent(),this._mutex.unlock(),t;case 4:return [2]}}))}))},e}(),un$1=function(e){return "".concat("nest","@").concat(e)},cn$1=function(e,t){return "".concat(un$1(e),"/").concat(t)},ln$1=function(e,t){return "".concat(cn$1(e,t),".metadata")},hn$1=function(e,t){return "".concat(cn$1(e,t),"/block.")},dn$1=function(e,t){return "".concat(cn$1(e,t),"/blob.")},fn$1=function(e,t,n,r){return void 0===r&&(r=0),"".concat(dn$1(e,t)).concat(n,".").concat(r)},pn$1=function(){function e(e){var t=e.dbname,n=e.collectionName,r=e.store;this.dbname=t,this.collectionName=n,this._store=r;}return e.prototype._makeShards=function(e,t){var n=Math.max(this._store.itemSizeLimit-1024,0);if(n>0){for(var r=Math.ceil(e.data.length/n),i="".concat(r,".").concat(e.type,".").concat(t),s=[],o=0;o<e.data.length;o+=n){var a=e.data.slice(o,o+n);s.push(a);}return {blobId:i,shards:s}}return {blobId:null,shards:null}},e.prototype._encode=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,new Promise((function(t){var n=new FileReader;n.onload=function(){t({data:n.result,type:e.type});},n.readAsDataURL(e);}))];case 1:return [2,t.sent()]}}))}))},e.prototype._decode=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return "undefined"==typeof fetch?[3,3]:[4,fetch(e.data)];case 1:return [4,a.sent().blob()];case 2:return [2,a.sent()];case 3:for(t=[],n=atob(e.data.split(",")[1]),r=0;r<n.length;r+=512){for(i=n.slice(r,r+512),s=new Array(i.length),o=0;o<i.length;o++)s[o]=i.charCodeAt(o);t.push(new Uint8Array(s));}return [2,new Blob(t,{type:e.type})]}}))}))},e.prototype.get=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:if(t=[],n=__bundle7dfccc8c.o(e.split("."),2),r=n[0],i=n[1],!((s=parseInt(r))>0))return [3,6];o=0,c.label=1;case 1:return o<s?(a=fn$1(this.dbname,this.collectionName,e,o),[4,this._store.get(a)]):[3,4];case 2:if(!(u=c.sent())||!u.d)throw Vt.storeBrokenBlob;t.push(u.d),c.label=3;case 3:return o++,[3,1];case 4:return [4,this._decode({data:t.join(""),type:i})];case 5:return [2,c.sent()];case 6:return [2,null]}}))}))},e.prototype.save=function(e,t){return void 0===t&&(t="".concat(Date.now())),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return n=[],[4,this._encode(e)];case 1:if(r=c.sent(),i=this._makeShards(r,t),s=i.blobId,o=i.shards,!s)return [3,3];for(a=0;a<o.length;a++)u=fn$1(this.dbname,this.collectionName,s,a),n.push({key:u,value:{d:o[a]},generation:1});return [4,this._store.setMany(n)];case 2:if(c.sent().some((function(e){return e instanceof Error})))throw Vt.storeWriteFailed;return [2,s];case 3:return [2,null]}}))}))},e.prototype.remove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:if(t=[],n=__bundle7dfccc8c.o(e.split("."),1),r=n[0],!((i=parseInt(r))>0))return [3,2];for(s=0;s<i;s++)t.push(fn$1(this.dbname,this.collectionName,e,s));return [4,this._store.removeMany(t)];case 1:o.sent(),o.label=2;case 2:return [2]}}))}))},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return e=dn$1(this.dbname,this.collectionName),t=[],[4,this._store.getAllKeys()];case 1:n=u.sent();try{for(r=__bundle7dfccc8c.s(n),i=r.next();!i.done;i=r.next())(s=i.value).startsWith(e)&&t.push(s);}catch(e){o={error:e};}finally{try{i&&!i.done&&(a=r.return)&&a.call(r);}finally{if(o)throw o.error}}return [4,this._store.removeMany(n)];case 2:return u.sent(),[2]}}))}))},e}();!function(e){e[e.COMMIT=0]="COMMIT",e[e.WRITE=1]="WRITE",e[e.ERROR=2]="ERROR";}(tn$1||(tn$1={})),function(e){e.PENDING="pending",e.PERSISTENT="persistent",e.VOLATILE="volatile";}(nn||(nn={})),function(e){e[e.NO_CACHE=0]="NO_CACHE",e[e.DEFAULT=1]="DEFAULT",e[e.PERSISTENT=2]="PERSISTENT";}(rn$1||(rn$1={}));var vn$1=[nn.PENDING,nn.VOLATILE],_n$1={},mn$1=function(){function e(e){var t=e.dbname,n=e.limit,r=void 0===n?256:n;return _n$1[t]||(this.dbname=t,this._items=[],this._limit=r,_n$1[t]=this),_n$1[t]}return e.get=function(e){return _n$1[e]},Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!1,configurable:!0}),e.prototype.find=function(e,t,n){return void 0===n&&(n=rn$1.DEFAULT),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return (r=this.get(t))?[3,2]:[4,e.get(t)];case 1:return (i=s.sent())&&(r={key:t,value:i,generation:1,state:n===rn$1.PERSISTENT?nn.PERSISTENT:nn.VOLATILE},this.put(r)),[3,3];case 2:n===rn$1.PERSISTENT&&(r.state=nn.PERSISTENT),s.label=3;case 3:return [2,r]}}))}))},e.prototype.get=function(e,t){void 0===t&&(t=rn$1.DEFAULT);var n=this._items.map((function(e){return e.key})).indexOf(e);if(n>-1){var r=this._items[n];return t===rn$1.PERSISTENT&&(r.state=nn.PERSISTENT),t!==rn$1.NO_CACHE&&this.put(r),r}return null},e.prototype.put=function(e){var t,n;if(this._limit>0){var r=this._items.map((function(e){return e.key})).indexOf(e.key);if(r>-1)vn$1.includes(this._items[r].state)&&vn$1.includes(e.state)?(this._items.splice(r,1),this._items.push(e)):(this._items[r].state=e.state,this._items[r].generation=e.generation,this._items[r].value=e.value);else {this._items.push(e);var i=this._items.filter((function(e){return e.state===nn.VOLATILE})),s=i.length-this._limit;if(s>0){var o=[];try{for(var a=__bundle7dfccc8c.s(this._items),u=a.next();!u.done;u=a.next()){var c=u.value;c.state===nn.VOLATILE&&s>0?s--:o.push(c);}}catch(e){t={error:e};}finally{try{u&&!u.done&&(n=a.return)&&n.call(a);}finally{if(t)throw t.error}}this._items=o;}}}},e.prototype.remove=function(e){var t=this._items.map((function(e){return e.key})).indexOf(e);t>-1&&this._items.splice(t,1);},e.prototype.clearByCondition=function(e){this._items=this._items.filter((function(t){return !e(t)}));},e.prototype.clear=function(e){void 0===e&&(e=!1),this._items=e?[]:this._items.filter((function(e){return e.state!==nn.VOLATILE}));},e}(),yn$1=function(){function e(e){var t=e.dbname,n=e.collectionName,r=e.store;this._metadata=null,this._requests=[],this._onCommit=new Map,this._onWrite=new Map,this._onError=new Map,this.dbname=t,this.collectionName=n,this.metadataKey=function(e,t){return "".concat(cn$1(e,t),"/trans.metadata")}(t,n),this.recordsetKey=function(e,t){return "".concat(cn$1(e,t),"/trans.recordset")}(t,n),this._store=r;}return Object.defineProperty(e.prototype,"generation",{get:function(){return this._metadata?this._metadata.generation:0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"requestCount",{get:function(){return this._requests.length},enumerable:!1,configurable:!0}),e.prototype._getReducedRecordset=function(e){return void 0===e&&(e=[]),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._store.get(this.recordsetKey)];case 1:return (t=n.sent()||[]).push.apply(t,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(e),!1)),[2,this._reduceRecordSet(t)]}}))}))},e.prototype._reduceRecordSet=function(e){for(var t=[],n={},r=e.length-1;r>=0;r--){for(var i=e[r],s=[],o=i.requests.length-1;o>=0;o--){var a=i.requests[o],u=a.data;n[u.key]||(s.unshift(a),n[u.key]=!0);}s.length>0&&(i.requests=s,t.unshift(i));}return t},e.prototype._applyRecord=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o,a,u,c,l;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:n=mn$1.get(this.dbname),r=t.generation,i=t.requests,s=null,h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._store.setMany(i.map((function(e){return __bundle7dfccc8c.n(__bundle7dfccc8c.n({},e.data),{generation:r})})))];case 2:for(o=h.sent(),a=0;a<i.length;a++)o[a]instanceof Error&&(s||(s=o[a]),u=i[a].data,n.put(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},u),{generation:r,state:nn.PERSISTENT})));return [3,4];case 3:return c=h.sent(),s=c,[3,4];case 4:return s?[3,6]:(l=e.filter((function(e){return e.generation!==r})),[4,this._store.set({key:this.recordsetKey,value:l,generation:r})]);case 5:return h.sent(),this._onWrite.forEach((function(e){e(i.map((function(e){return e.data})));})),[3,7];case 6:this._onError.forEach((function(e){return e(s)})),h.label=7;case 7:return [2]}}))}))},e.prototype.init=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return e=this,[4,this._store.get(this.metadataKey)];case 1:return e._metadata=u.sent()||{generation:1},[4,this._getReducedRecordset()];case 2:t=u.sent(),u.label=3;case 3:u.trys.push([3,8,9,10]),n=__bundle7dfccc8c.s(t),r=n.next(),u.label=4;case 4:return r.done?[3,7]:(i=r.value,[4,this._applyRecord(t,i)]);case 5:u.sent(),u.label=6;case 6:return r=n.next(),[3,4];case 7:return [3,10];case 8:return s=u.sent(),o={error:s},[3,10];case 9:try{r&&!r.done&&(a=n.return)&&a.call(n);}finally{if(o)throw o.error}return [7];case 10:return [2]}}))}))},e.prototype.on=function(e,t,n){switch(e){case tn$1.COMMIT:this._onCommit.set(t,n);break;case tn$1.WRITE:this._onWrite.set(t,n);break;case tn$1.ERROR:this._onError.set(t,n);}},e.prototype.requestWrite=function(e,t){void 0===t&&(t=null),this._requests.push({data:e,options:t}),mn$1.get(this.dbname).put(__bundle7dfccc8c.n({state:nn.PENDING,generation:this.generation},e));},e.prototype.requestMultipleWrite=function(e,t){var n,r;void 0===t&&(t=null);var i=mn$1.get(this.dbname);try{for(var s=__bundle7dfccc8c.s(e),o=s.next();!o.done;o=s.next()){var a=o.value;this._requests.push({data:a,options:t}),i.put(__bundle7dfccc8c.n({state:nn.PENDING,generation:this.generation},a));}}catch(e){n={error:e};}finally{try{o&&!o.done&&(r=s.return)&&r.call(s);}finally{if(n)throw n.error}}},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return mn$1.get(this.dbname).clearByCondition((function(e){return e.state===nn.PENDING})),this._requests=[],[2]}))}))},e.prototype.commit=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a,u,c,l,d,f=this;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:if(!((e=this._requests).length>0))return [3,4];for(t=[],n={},a=e.length-1;a>=0;a--)r=e[a],c=r.data,n[c.key]||(n[c.key]=!0,t.unshift(r));return i={generation:this.generation,requests:t},[4,this._getReducedRecordset([i])];case 1:return s=h.sent(),[4,this._store.set({key:this.recordsetKey,value:s,generation:this.generation})];case 2:return h.sent(),this._metadata.generation++,[4,this._store.set({key:this.metadataKey,value:this._metadata,generation:1})];case 3:for(h.sent(),o=mn$1.get(this.dbname),a=0;a<t.length;a++)u=t[a],c=u.data,l=u.options,o.put(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},c),{generation:i.generation,state:l&&l.persistent?nn.PERSISTENT:nn.VOLATILE}));this._requests=[],this._onCommit.forEach((function(t){t(e.map((function(e){return e.data})));})),d=jt.get(this.dbname),setTimeout((function(){try{f._applyRecord(s,i);}catch(e){f._onError.forEach((function(t){return t(e)}));}}),d.transactionApplyDelay),h.label=4;case 4:return [2]}}))}))},e}(),bn=function(){function e(e){var t=e.blockId,n=e.keyName,r=e.items,i=void 0===r?[]:r,s=e.limit;this.blockId=t,this.keyName=n,this.limit=s,this._items=__bundle7dfccc8c.a([],__bundle7dfccc8c.o(i),!1);}return e.createFromCacheItem=function(t){return t?new e(t.value):null},Object.defineProperty(e.prototype,"isEmpty",{get:function(){return 0===this._items.length},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"items",{get:function(){return this._items},enumerable:!1,configurable:!0}),e.prototype.serialize=function(){return {blockId:this.blockId,keyName:this.keyName,limit:this.limit,items:this._items}},e.prototype.getItemByKey=function(e){var t=this;return this._items.find((function(n){var r=n[t.keyName];return e===r}))},e.prototype.has=function(e){var t=this;return this._items.map((function(e){return e[t.keyName]})).includes(e)},e.prototype.add=function(e){var t=this,n=this._items.map((function(e){return e[t.keyName]})).indexOf(e[this.keyName]);return n<0?this._items.length<this.limit&&(this._items.push(e),!0):(this._items[n]=e,!0)},e.prototype.remove=function(e){for(var t in this._items)if(this._items[t][this.keyName]===e)return this._items.splice(parseInt(t),1),!0;return !1},e.prototype.clear=function(){this._items=[];},e}(),gn$1=function(){function e(e){var t=e.dbname,n=e.collectionName,r=e.metadata,i=e.hashFunction,s=void 0===i?Gt:i,o=e.transaction,a=e.store;this.dbname=t,this.collectionName=n,this.hashFunction=s,this.metadata=r,this._transaction=o,this._store=a;}return Object.defineProperty(e.prototype,"keyName",{get:function(){return this.metadata.keyName},enumerable:!1,configurable:!0}),e.prototype.createBlockId=function(e,t){return void 0===t&&(t=this.metadata.blockLevel),n=this.dbname,r=this.collectionName,i=t,s="".concat(function(e,t,n){var r=n.base*Math.pow(n.multiplier,t)+n.constant;return (n.hashFunction||Gt)(e,r)}(e,t,{hashFunction:this.hashFunction,base:this.metadata.blockHashBase,multiplier:this.metadata.blockHashMultiplier,constant:this.metadata.blockHashConstant})),"".concat(hn$1(n,r)).concat(i,".").concat(s);var n,r,i,s;},e.prototype._findBlock=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:t=mn$1.get(this.dbname),n=this.metadata.blockLevel,o.label=1;case 1:return n>0?(r=this.createBlockId(e,n),[4,t.find(this._store,r)]):[3,4];case 2:if((i=o.sent())&&(s=bn.createFromCacheItem(i),s.getItemByKey(e)))return [2,s];o.label=3;case 3:return n--,[3,1];case 4:return [2,null]}}))}))},e.prototype.getFromBlock=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._findBlock(e)];case 1:return [2,(t=n.sent())?t.getItemByKey(e):null]}}))}))},e.prototype.putToBlock=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return n=jt.get(this.dbname),r=this.createBlockId(e),i=Math.floor(this._store.itemSizeLimit/n.itemSizeLimit),[4,mn$1.get(this.dbname).find(this._store,r)];case 1:return s=a.sent(),(o=s?bn.createFromCacheItem(s):new bn({blockId:r,keyName:this.keyName,items:[],limit:i})).add(t)?(this._transaction.requestWrite({key:o.blockId,value:o.serialize()}),[2,!0]):[2,!1]}}))}))},e.prototype.removeFromBlock=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._findBlock(e)];case 1:return (t=n.sent())&&t.remove(e)?(this._transaction.requestWrite({key:t.blockId,value:t.serialize()}),[2,!0]):[2,!1]}}))}))},e.prototype.clearAllBlocks=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return e=hn$1(this.dbname,this.collectionName),[4,this._store.getAllKeys()];case 1:return t=c.sent(),n=t.filter((function(t){return t.startsWith(e)})),[4,this._store.removeMany(n)];case 2:c.sent(),r=mn$1.get(this.dbname);try{for(i=__bundle7dfccc8c.s(n),s=i.next();!s.done;s=i.next())o=s.value,r.remove(o);}catch(e){a={error:e};}finally{try{s&&!s.done&&(u=i.return)&&u.call(i);}finally{if(a)throw a.error}}return [2]}}))}))},e}(),In=function(){function e(e){var t=e.dbname,n=e.collectionName,r=e.keyName,i=e.fields,s=e.transaction,o=e.store,a=this;this._origin=[],this._table=[],this.dbname=t,this.collectionName=n,this.keyName=r,this.fields=i,this.indexerKey=function(e,t,n){return "".concat(cn$1(e,t),"/index.").concat(n)}(this.dbname,this.collectionName,this.fields.join(">")),this._transaction=s,this._store=o,this._transaction.on(tn$1.COMMIT,this.indexerKey,(function(){return a.commit()})),this._transaction.on(tn$1.ERROR,this.indexerKey,(function(){return a.abort()}));}return e.createKey=function(e){return e.join(">")},e.parseKey=function(e){return e.split(">")},e.prototype._addItem=function(e){var t=e[this.keyName],n=this.getColumnValues(e),r=__bundle7dfccc8c.o(this.indexOf(n),2),i=r[0];return r[1]?!this._table[i].keys.includes(t)&&(this._table[i].keys.push(t),!0):(this._table.splice(i,0,{columnValues:n,keys:[t]}),!0)},e.prototype._removeItem=function(e){var t=e[this.keyName],n=this.getColumnValues(e),r=__bundle7dfccc8c.o(this.indexOf(n),2),i=r[0];if(r[1]){var s=this._table[i].keys.indexOf(t);if(s>-1)return this._table[i].keys.splice(s,1),0===this._table[i].keys.length&&this._table.splice(i,1),!0}return !1},Object.defineProperty(e.prototype,"origin",{get:function(){return this._origin},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"table",{get:function(){return this._table},enumerable:!1,configurable:!0}),e.prototype.getColumnValues=function(e){var t,n,r,i,s=[];try{for(var o=__bundle7dfccc8c.s(this.fields),a=o.next();!a.done;a=o.next()){var u=a.value;if("-"===u[0]&&(u=u.slice(1)),r=e[u],i=void 0,i=typeof r,null!==r&&"undefined"!==i&&"boolean"!==i&&"number"!==i&&"string"!==i)throw Vt.indexTypesNotMatch;s.push(e[u]);}}catch(e){t={error:e};}finally{try{a&&!a.done&&(n=o.return)&&n.call(o);}finally{if(t)throw t.error}}return s},e.prototype.diff=function(e,t){for(var n in this.fields){var r="-"===this.fields[n][0]?-1:1,i=Qt(e[n],t[n]);if(0!==i)return r*i}return 0},e.prototype.indexOf=function(e){if(this._table.length>0){for(var t=0,n=this._table.length-1;t<=n;){var r=Math.floor((t+n)/2),i=this.diff(e,this._table[r].columnValues);if(i>0)t=r+1;else {if(!(i<0))return [r,!0];n=r-1;}}return [t,!1]}return [0,!1]},e.prototype.ensure=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i,s,o,a,u,c,l,d,f,p,v,_,m;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:return [4,(e=mn$1.get(this.dbname)).find(this._store,this.indexerKey,rn$1.PERSISTENT)];case 1:return (t=h.sent())?[3,11]:(n=hn$1(this.dbname,this.collectionName),[4,this._store.getAllKeys()]);case 2:r=h.sent(),h.label=3;case 3:h.trys.push([3,8,9,10]),i=__bundle7dfccc8c.s(r),s=i.next(),h.label=4;case 4:return s.done?[3,7]:(o=s.value).startsWith(n)?[4,e.find(this._store,o,rn$1.NO_CACHE)]:[3,6];case 5:a=h.sent(),u=bn.createFromCacheItem(a);try{for(_=void 0,c=__bundle7dfccc8c.s(u.items),l=c.next();!l.done;l=c.next())d=l.value,this._addItem(d);}catch(e){_={error:e};}finally{try{l&&!l.done&&(m=c.return)&&m.call(c);}finally{if(_)throw _.error}}h.label=6;case 6:return s=i.next(),[3,4];case 7:return [3,10];case 8:return f=h.sent(),p={error:f},[3,10];case 9:try{s&&!s.done&&(v=i.return)&&v.call(i);}finally{if(p)throw p.error}return [7];case 10:return this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[3,12];case 11:this._origin=t.value,this._table=zt(this._origin),h.label=12;case 12:return [2]}}))}))},e.prototype.drop=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return mn$1.get(this.dbname).remove(this.indexerKey),[4,this._store.remove(this.indexerKey)];case 1:return e.sent(),[2]}}))}))},e.prototype.addItem=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return this._addItem(e)&&this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[2]}))}))},e.prototype.removeItem=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return this._removeItem(e)&&this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[2]}))}))},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._table=[],this._transaction.requestWrite({key:this.indexerKey,value:this._table},{persistent:!0}),[2]}))}))},e.prototype.commit=function(){this._origin=this._table,this._table=zt(this._origin);},e.prototype.abort=function(){this._table=zt(this._origin);},e}(),wn$1="undefined"!=typeof document&&"undefined"!=typeof navigator;wn$1&&navigator.userAgent&&navigator.userAgent.includes("Chrome/")&&navigator.userAgent.includes("Chromium/");var En$1=wn$1&&navigator.userAgent&&navigator.userAgent.includes("Firefox/")&&!navigator.userAgent.includes("Seamonkey/");wn$1&&navigator.userAgent&&navigator.userAgent.includes("Safari/")&&!navigator.userAgent.includes("Chrome/")&&navigator.userAgent.includes("Chromium/"),wn$1&&navigator.userAgent&&(navigator.userAgent.includes("OPR/")||navigator.userAgent.includes("Opera/")),wn$1&&navigator.userAgent&&navigator.userAgent.includes("Trident/7.0");var kn,Nn$1,On=wn$1&&navigator.userAgent&&navigator.userAgent.includes("Edge/"),Sn=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)}))};!function(e){e[e.PROCESSING=0]="PROCESSING",e[e.DONE=1]="DONE";}(kn||(kn={})),function(e){e.NEWNODE="newnode",e.REMOVENODE="removenode",e.CLAIM_HOST="claimhost",e.SYNC_HOST="synchost",e.REQUEST_LOCK="requestlock",e.ACQUIRE_LOCK="acquirelock",e.RELEASE_LOCK="releaselock";}(Nn$1||(Nn$1={}));var Tn$1,xn={},Cn$1=function(){function e(e,t){void 0===t&&(t={});var n=this;return this._state=kn.PROCESSING,this._hostId=null,this._queue=[],this._currentItem=null,this._activationTimeout=null,this._activationQueue=[],xn[e]&&!t.forceCreate||(this.nodeId=Sn(),this.key=e,wn$1&&(t.startAsInvisible?this.registerNode():"visible"===document.visibilityState?this.claimHost():this.registerNode(),document.addEventListener("visibilitychange",(function(){"visible"===document.visibilityState&&n.claimHost();})),window.addEventListener("message",(function(e){var t,r,i=e.data,s=i.nodeId,o=i.requestId,a=i.key,u=i.op,c=i.data;if(s!==n.nodeId&&a===n.key)switch(u){case Nn$1.NEWNODE:n._sendSync();break;case Nn$1.CLAIM_HOST:n._sendSync(),n._hostId=s;break;case Nn$1.SYNC_HOST:if(!n.isInSync){n._activationTimeout&&clearTimeout(n._activationTimeout);var l=c,h=l.currentItemRequestId,d=l.queue,f=function(e){var t=n._queue.findIndex((function(t){return t.requestId===e.requestId}));t<0&&n._requestLock({nodeId:e.nodeId,requestId:e.requestId,key:n.key,op:Nn$1.REQUEST_LOCK,ts:e.ts});};try{for(var p=__bundle7dfccc8c.s(d),v=p.next();!v.done;v=p.next()){f(v.value);}}catch(e){t={error:e};}finally{try{v&&!v.done&&(r=p.return)&&r.call(p);}finally{if(t)throw t.error}}n._currentItem=n._queue.find((function(e){return e.requestId===h})),n._completeSync();}break;case Nn$1.REMOVENODE:n._queue=n._queue.filter((function(e){return e.nodeId!==i.nodeId})),n._currentItem&&n._currentItem.nodeId===i.nodeId&&(n._currentItem=null,n._acquire(n._queue[0]));break;case Nn$1.REQUEST_LOCK:n._requestLock(i);break;case Nn$1.ACQUIRE_LOCK:var _=n._queue.find((function(e){return e.requestId===o}));n._acquire(_);break;case Nn$1.RELEASE_LOCK:n._release(o);}})),window.addEventListener("beforeunload",(function(){n._send(Nn$1.REMOVENODE);}))),xn[e]=this),xn[e]}return Object.defineProperty(e.prototype,"locked",{get:function(){return !!this._currentItem},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isHost",{get:function(){return this._hostId===this.nodeId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isInSync",{get:function(){return this._state==kn.DONE},enumerable:!1,configurable:!0}),e.prototype._send=function(e,t){var n,r;void 0===t&&(t={});var i={nodeId:this.nodeId,requestId:null!==(n=null==t?void 0:t.requestId)&&void 0!==n?n:Sn(),key:this.key,op:e,data:null!==(r=t.data)&&void 0!==r?r:null,ts:Date.now()};return wn$1&&window.postMessage(i,"*"),i},e.prototype._acquire=function(e){void 0===e&&(e=null),e?(this._currentItem=e,this._currentItem.onAcquired(e.requestId)):this._currentItem=null;},e.prototype._release=function(e){if(this._currentItem&&this._currentItem.requestId===e){var t=this._currentItem;this._currentItem=null,t.nodeId===this.nodeId&&this._send(Nn$1.RELEASE_LOCK,{requestId:t.requestId});var n=this._queue.findIndex((function(t){return t.requestId===e}));n>-1&&this._queue.splice(n,1),t.onReleased(e);}},e.prototype._requestLock=function(e){var t=this;return new Promise((function(n){var r={nodeId:e.nodeId,requestId:e.requestId,ts:e.ts,onAcquired:function(e){t.isHost&&t._send(Nn$1.ACQUIRE_LOCK,{requestId:e}),n();},onReleased:function(){t._acquire(t._queue[0]);}},i=!1;for(var s in t._queue)if(t._queue[s].ts>r.ts){t._queue.splice(parseInt(s),0,r),i=!0;break}i||t._queue.push(r),t._currentItem||t._acquire(t._queue[0]);}))},e.prototype._sendSync=function(){var e;this.isHost&&this._send(Nn$1.SYNC_HOST,{data:{currentItemRequestId:null===(e=this._currentItem)||void 0===e?void 0:e.requestId,queue:this._queue.map((function(e){return {nodeId:e.nodeId,requestId:e.requestId,ts:e.ts}}))}});},e.prototype._waitUntilSyncCompleted=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e=this;return __bundle7dfccc8c.i(this,(function(t){return this.isHost&&!this.isInSync?[2,new Promise((function(t){e._activationQueue.push(t);}))]:[2]}))}))},e.prototype._waitSync=function(){var e=this;this.isInSync||(this._activationTimeout=setTimeout((function(){e._completeSync();}),8));},e.prototype._completeSync=function(){this.isInSync||(this._state=kn.DONE,this._activationQueue.forEach((function(e){return e()})),this._activationQueue=[]);},e.prototype.registerNode=function(){this._send(Nn$1.NEWNODE),this._waitSync();},e.prototype.claimHost=function(){this._hostId=this.nodeId,this._send(Nn$1.CLAIM_HOST),this._waitSync();},e.prototype.lock=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._waitUntilSyncCompleted()];case 1:return t.sent(),e=this._send(Nn$1.REQUEST_LOCK),[4,this._requestLock(e)];case 2:return t.sent(),[2]}}))}))},e.prototype.unlock=function(){var e;this._release(null===(e=this._currentItem)||void 0===e?void 0:e.requestId);},e}(),Rn=function(){function e(e){var t=e.dbname,n=e.collectionName,r=e.keyName,i=e.keyHash,s=e.indexes,o=e.store,a=this;this._state=Ht.INIT,this._metadata=null,this._indexers=[],this.dbname=t,this.name=n,this.keyName=r,this.indexes=__bundle7dfccc8c.a([[r]],__bundle7dfccc8c.o(s.filter((function(e){return In.createKey(e)!==a.keyName}))),!1),this._keyHash=i,this._store=o,this._mutex=new Cn$1(function(e,t){return "".concat(cn$1(e,t),".lock")}(t,n)),this._blobContainer=new pn$1({dbname:t,collectionName:n,store:o}),this._transaction=new yn$1({dbname:t,collectionName:n,store:o});}return e.metadataOf=function(e,t,n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return r=ln$1(e,t),[4,n.get(r)];case 1:return [2,i.sent()]}}))}))},Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isReady",{get:function(){return this._state===Ht.READY},enumerable:!1,configurable:!0}),e.prototype.init=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u,c,l,d,f,p,v,_=this;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:return [4,this._mutex.lock()];case 1:h.sent(),h.label=2;case 2:return h.trys.push([2,9,,10]),t=jt.get(this.dbname),[4,e.metadataOf(this.dbname,this.name,this._store)];case 3:return n=h.sent(),this._metadata=n||{keyName:this.keyName,blockLevel:1,blockHashBase:t.blockHashBase,blockHashMultiplier:t.blockHashMultiplier,blockHashConstant:t.blockHashConstant,indexes:this.indexes},[4,this._transaction.init()];case 4:h.sent(),this._blockManager=new gn$1({dbname:this.dbname,collectionName:this.name,hashFunction:this._keyHash,metadata:this._metadata,transaction:this._transaction,store:this._store}),r=__bundle7dfccc8c.a([],__bundle7dfccc8c.o(this.indexes),!1),i=[],s=r.map((function(e){return In.createKey(e)})),o=n?n.indexes.map((function(e){return In.createKey(e)})):[];try{for(a=__bundle7dfccc8c.s(o),u=a.next();!u.done;u=a.next())c=u.value,s.includes(c)||i.push(In.parseKey(c));}catch(e){p={error:e};}finally{try{u&&!u.done&&(v=a.return)&&v.call(a);}finally{if(p)throw p.error}}return (l=[]).push.apply(l,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(r.map((function(e){var t=new In({dbname:_.dbname,collectionName:_.name,keyName:_.keyName,fields:e,transaction:_._transaction,store:_._store});return _._indexers.push(t),t.ensure()}))),!1)),l.push.apply(l,__bundle7dfccc8c.a([],__bundle7dfccc8c.o(i.map((function(e){return new In({dbname:_.dbname,collectionName:_.name,keyName:_.keyName,fields:e,transaction:_._transaction,store:_._store}).drop()}))),!1)),[4,Promise.all(l)];case 5:return h.sent(),[4,this._transaction.commit()];case 6:return h.sent(),s.sort().join(",")===o.sort().join(",")?[3,8]:(d=ln$1(this.dbname,this.name),this._metadata.indexes=r,[4,this._store.set({key:d,value:this._metadata,generation:1})]);case 7:h.sent(),h.label=8;case 8:return this._state=Ht.READY,this._mutex.unlock(),[3,10];case 9:throw f=h.sent(),this._mutex.unlock(),f;case 10:return [2]}}))}))},e.prototype.close=function(){this._state=Ht.CLOSED;},e.prototype._hasPropertyOfKeyName=function(e){var t=e[this.keyName];return "string"==typeof t&&!!t},e.prototype._getIndexerBy=function(e){var t,n;void 0===e&&(e=null),e||(e=[this.keyName]);var r=In.createKey(e);try{for(var i=__bundle7dfccc8c.s(this._indexers),s=i.next();!s.done;s=i.next()){var o=s.value;if(r===In.createKey(o.fields))return o}}catch(e){t={error:e};}finally{try{s&&!s.done&&(n=i.return)&&n.call(i);}finally{if(t)throw t.error}}return null},e.prototype._upgradeBlockLevel=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return e=ln$1(this.dbname,this.name),this._metadata.blockLevel++,[4,this._store.set({key:e,value:this._metadata,generation:1})];case 1:return t.sent(),[2]}}))}))},e.prototype._requestInsert=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return t=e[this.keyName],[4,this._blockManager.getFromBlock(t)];case 1:return a.sent()?[3,13]:[4,this._blockManager.putToBlock(t,e)];case 2:return a.sent()?[3,5]:[4,this._upgradeBlockLevel()];case 3:return a.sent(),[4,this._blockManager.putToBlock(t,e)];case 4:a.sent(),a.label=5;case 5:a.trys.push([5,10,11,12]),n=__bundle7dfccc8c.s(this._indexers),r=n.next(),a.label=6;case 6:return r.done?[3,9]:[4,r.value.addItem(e)];case 7:a.sent(),a.label=8;case 8:return r=n.next(),[3,6];case 9:return [3,12];case 10:return i=a.sent(),s={error:i},[3,12];case 11:try{r&&!r.done&&(o=n.return)&&o.call(n);}finally{if(s)throw s.error}return [7];case 12:return [3,14];case 13:throw Vt.collectionInsertDuplicate;case 14:return [2]}}))}))},e.prototype._requestUpsert=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u,c,l,d,f,p;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:return t=e[this.keyName],[4,this._blockManager.getFromBlock(t)];case 1:return (n=h.sent())?[3,13]:[4,this._blockManager.putToBlock(t,e)];case 2:return h.sent()?[3,5]:[4,this._upgradeBlockLevel()];case 3:return h.sent(),[4,this._blockManager.putToBlock(t,e)];case 4:h.sent(),h.label=5;case 5:h.trys.push([5,10,11,12]),r=__bundle7dfccc8c.s(this._indexers),i=r.next(),h.label=6;case 6:return i.done?[3,9]:[4,(u=i.value).addItem(e)];case 7:h.sent(),h.label=8;case 8:return i=r.next(),[3,6];case 9:return [3,12];case 10:return s=h.sent(),l={error:s},[3,12];case 11:try{i&&!i.done&&(d=r.return)&&d.call(r);}finally{if(l)throw l.error}return [7];case 12:return [3,23];case 13:return [4,this._blockManager.putToBlock(t,e)];case 14:h.sent(),h.label=15;case 15:h.trys.push([15,21,22,23]),o=__bundle7dfccc8c.s(this._indexers),a=o.next(),h.label=16;case 16:return a.done?[3,20]:0===(u=a.value).diff(u.getColumnValues(n),u.getColumnValues(e))?[3,19]:[4,u.removeItem(n)];case 17:return h.sent(),[4,u.addItem(e)];case 18:h.sent(),h.label=19;case 19:return a=o.next(),[3,16];case 20:return [3,23];case 21:return c=h.sent(),f={error:c},[3,23];case 22:try{a&&!a.done&&(p=o.return)&&p.call(o);}finally{if(f)throw f.error}return [7];case 23:return [2]}}))}))},e.prototype._requestUpdate=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return t=e[this.keyName],[4,this._blockManager.getFromBlock(t)];case 1:return (n=c.sent())?[4,this._blockManager.putToBlock(t,e)]:[3,11];case 2:c.sent(),c.label=3;case 3:c.trys.push([3,9,10,11]),r=__bundle7dfccc8c.s(this._indexers),i=r.next(),c.label=4;case 4:return i.done?[3,8]:0===(s=i.value).diff(s.getColumnValues(n),s.getColumnValues(e))?[3,7]:[4,s.removeItem(n)];case 5:return c.sent(),[4,s.addItem(e)];case 6:c.sent(),c.label=7;case 7:return i=r.next(),[3,4];case 8:return [3,11];case 9:return o=c.sent(),a={error:o},[3,11];case 10:try{i&&!i.done&&(u=r.return)&&u.call(r);}finally{if(a)throw a.error}return [7];case 11:return [2]}}))}))},e.prototype._requestRemove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return [4,this._blockManager.getFromBlock(e)];case 1:return (t=a.sent())?[4,this._blockManager.removeFromBlock(e)]:[3,10];case 2:a.sent(),a.label=3;case 3:a.trys.push([3,8,9,10]),n=__bundle7dfccc8c.s(this._indexers),r=n.next(),a.label=4;case 4:return r.done?[3,7]:[4,r.value.removeItem(t)];case 5:a.sent(),a.label=6;case 6:return r=n.next(),[3,4];case 7:return [3,10];case 8:return i=a.sent(),s={error:i},[3,10];case 9:try{r&&!r.done&&(o=n.return)&&o.call(n);}finally{if(s)throw s.error}return [7];case 10:return [2]}}))}))},e.prototype._requestClear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return [4,this._blockManager.clearAllBlocks()];case 1:s.sent(),s.label=2;case 2:s.trys.push([2,7,8,9]),e=__bundle7dfccc8c.s(this._indexers),t=e.next(),s.label=3;case 3:return t.done?[3,6]:[4,t.value.clear()];case 4:s.sent(),s.label=5;case 5:return t=e.next(),[3,3];case 6:return [3,9];case 7:return n=s.sent(),r={error:n},[3,9];case 8:try{t&&!t.done&&(i=e.return)&&i.call(e);}finally{if(r)throw r.error}return [7];case 9:return [2]}}))}))},e.prototype.getByKey=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,6];case 1:r.sent(),r.label=2;case 2:return r.trys.push([2,4,,5]),[4,this._blockManager.getFromBlock(e)];case 3:return t=r.sent(),this._mutex.unlock(),[2,zt(t)];case 4:throw n=r.sent(),this._mutex.unlock(),n;case 5:return [3,7];case 6:throw Vt.collectionNotReady;case 7:return [2]}}))}))},e.prototype.query=function(e){return void 0===e&&(e={}),this.isReady?new an$1({condition:e.where,mutex:this._mutex,blockManager:this._blockManager,indexer:this._getIndexerBy(e.index),backward:!!e.backward}):null},e.prototype.insertOne=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:n.sent(),n.label=2;case 2:if(n.trys.push([2,5,,7]),!this._hasPropertyOfKeyName(e))throw Vt.collectionKeyNotGiven;return [4,this._requestInsert(zt(e))];case 3:return n.sent(),[4,this._transaction.commit()];case 4:return n.sent(),this._mutex.unlock(),[2,e];case 5:return t=n.sent(),[4,this._transaction.clear()];case 6:throw n.sent(),this._mutex.unlock(),t;case 7:return [3,9];case 8:throw Vt.collectionNotReady;case 9:return [2]}}))}))},e.prototype.insertMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u=this;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,15];case 1:c.sent(),c.label=2;case 2:if(c.trys.push([2,12,,14]),e.some((function(e){return !u._hasPropertyOfKeyName(e)})))throw Vt.collectionKeyNotGiven;c.label=3;case 3:c.trys.push([3,8,9,10]),t=__bundle7dfccc8c.s(e),n=t.next(),c.label=4;case 4:return n.done?[3,7]:(r=n.value,[4,this._requestInsert(zt(r))]);case 5:c.sent(),c.label=6;case 6:return n=t.next(),[3,4];case 7:return [3,10];case 8:return i=c.sent(),o={error:i},[3,10];case 9:try{n&&!n.done&&(a=t.return)&&a.call(t);}finally{if(o)throw o.error}return [7];case 10:return [4,this._transaction.commit()];case 11:return c.sent(),this._mutex.unlock(),[2,e];case 12:return s=c.sent(),[4,this._transaction.clear()];case 13:throw c.sent(),this._mutex.unlock(),s;case 14:return [3,16];case 15:throw Vt.collectionNotReady;case 16:return [2]}}))}))},e.prototype.upsertOne=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:n.sent(),n.label=2;case 2:if(n.trys.push([2,5,,7]),!this._hasPropertyOfKeyName(e))throw Vt.collectionKeyNotGiven;return [4,this._requestUpsert(zt(e))];case 3:return n.sent(),[4,this._transaction.commit()];case 4:return n.sent(),this._mutex.unlock(),[2,e];case 5:return t=n.sent(),[4,this._transaction.clear()];case 6:throw n.sent(),this._mutex.unlock(),t;case 7:return [3,9];case 8:throw Vt.collectionNotReady;case 9:return [2]}}))}))},e.prototype.upsertMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u=this;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,15];case 1:c.sent(),c.label=2;case 2:if(c.trys.push([2,12,,14]),e.some((function(e){return !u._hasPropertyOfKeyName(e)})))throw Vt.collectionKeyNotGiven;c.label=3;case 3:c.trys.push([3,8,9,10]),t=__bundle7dfccc8c.s(e),n=t.next(),c.label=4;case 4:return n.done?[3,7]:(r=n.value,[4,this._requestUpsert(zt(r))]);case 5:c.sent(),c.label=6;case 6:return n=t.next(),[3,4];case 7:return [3,10];case 8:return i=c.sent(),o={error:i},[3,10];case 9:try{n&&!n.done&&(a=t.return)&&a.call(t);}finally{if(o)throw o.error}return [7];case 10:return [4,this._transaction.commit()];case 11:return c.sent(),this._mutex.unlock(),[2,e];case 12:return s=c.sent(),[4,this._transaction.clear()];case 13:throw c.sent(),this._mutex.unlock(),s;case 14:return [3,16];case 15:throw Vt.collectionNotReady;case 16:return [2]}}))}))},e.prototype.update=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:n.sent(),n.label=2;case 2:if(n.trys.push([2,5,,7]),!this._hasPropertyOfKeyName(e))throw Vt.collectionKeyNotGiven;return [4,this._requestUpdate(zt(e))];case 3:return n.sent(),[4,this._transaction.commit()];case 4:return n.sent(),this._mutex.unlock(),[2,e];case 5:return t=n.sent(),[4,this._transaction.clear()];case 6:throw n.sent(),this._mutex.unlock(),t;case 7:return [3,9];case 8:throw Vt.collectionNotReady;case 9:return [2]}}))}))},e.prototype.updateIf=function(e,t){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o,a,c,l,d,f,p,v,_,m,y=this;return __bundle7dfccc8c.i(this,(function(b){switch(b.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,16];case 1:b.sent(),b.label=2;case 2:return b.trys.push([2,13,,15]),n=e.where,r=void 0===n?{}:n,i=e.index,s=void 0===i?null:i,o=e.backward,a=void 0!==o&&o,c=[],[4,new on$1({condition:r,blockManager:this._blockManager,backward:a,indexer:this._getIndexerBy(s)}).each((function(e){return __bundle7dfccc8c.r(y,void 0,void 0,(function(){var n,i;return __bundle7dfccc8c.i(this,(function(s){if(e.error)throw e.stop(),e.error;if(e.hasNext){if(n=e.nextValue,Jt(r,n)&&t.set){if("function"!=typeof t.set)for(i in t.set)n[i]=t.set[i];else t.set(n);c.push(n);}e.next();}else e.stop();return [2]}))}))}))];case 3:b.sent(),b.label=4;case 4:b.trys.push([4,9,10,11]),l=__bundle7dfccc8c.s(c),d=l.next(),b.label=5;case 5:return d.done?[3,8]:(f=d.value,[4,this._requestUpdate(zt(f))]);case 6:b.sent(),b.label=7;case 7:return d=l.next(),[3,5];case 8:return [3,11];case 9:return p=b.sent(),_={error:p},[3,11];case 10:try{d&&!d.done&&(m=l.return)&&m.call(l);}finally{if(_)throw _.error}return [7];case 11:return [4,this._transaction.commit()];case 12:return b.sent(),this._mutex.unlock(),[2,c];case 13:return v=b.sent(),[4,this._transaction.clear()];case 14:throw b.sent(),this._mutex.unlock(),v;case 15:return [3,17];case 16:throw this._transaction.clear(),Vt.collectionNotReady;case 17:return [2]}}))}))},e.prototype.remove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,5,,7]),[4,this._requestRemove(e)];case 3:return n.sent(),[4,this._transaction.commit()];case 4:return n.sent(),this._mutex.unlock(),[3,7];case 5:return t=n.sent(),[4,this._transaction.clear()];case 6:throw n.sent(),this._mutex.unlock(),t;case 7:return [3,9];case 8:throw Vt.collectionNotReady;case 9:return [2]}}))}))},e.prototype.removeIf=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,c,l,d,f,p,v,_,m=this;return __bundle7dfccc8c.i(this,(function(y){switch(y.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,15];case 1:y.sent(),y.label=2;case 2:return y.trys.push([2,13,,14]),t=e.where,n=void 0===t?{}:t,r=e.index,i=void 0===r?null:r,s=e.backward,o=void 0!==s&&s,a=[],[4,new on$1({condition:n,blockManager:this._blockManager,backward:o,indexer:this._getIndexerBy(i)}).each((function(e){return __bundle7dfccc8c.r(m,void 0,void 0,(function(){var t,r;return __bundle7dfccc8c.i(this,(function(i){if(e.error)throw e.stop(),e.error;return e.hasNext?(t=e.nextValue,Jt(n,t)&&(r=t[this.keyName],a.push(r)),e.next()):e.stop(),[2]}))}))}))];case 3:y.sent(),y.label=4;case 4:y.trys.push([4,9,10,11]),c=__bundle7dfccc8c.s(a),l=c.next(),y.label=5;case 5:return l.done?[3,8]:(d=l.value,[4,this._requestRemove(d)]);case 6:y.sent(),y.label=7;case 7:return l=c.next(),[3,5];case 8:return [3,11];case 9:return f=y.sent(),v={error:f},[3,11];case 10:try{l&&!l.done&&(_=c.return)&&_.call(c);}finally{if(v)throw v.error}return [7];case 11:return [4,this._transaction.commit()];case 12:return y.sent(),this._mutex.unlock(),[2,a];case 13:throw p=y.sent(),this._mutex.unlock(),p;case 14:return [3,16];case 15:throw this._transaction.clear(),Vt.collectionNotReady;case 16:return [2]}}))}))},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return this.isReady?[4,this._mutex.lock()]:[3,8];case 1:t.sent(),t.label=2;case 2:return t.trys.push([2,5,,7]),[4,this._requestClear()];case 3:return t.sent(),[4,this._transaction.commit()];case 4:return t.sent(),this._mutex.unlock(),[3,7];case 5:return e=t.sent(),[4,this._transaction.clear()];case 6:throw t.sent(),this._mutex.unlock(),e;case 7:return [3,9];case 8:throw Vt.collectionNotReady;case 9:return [2]}}))}))},e.prototype.getBlob=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._blobContainer.get(e)];case 1:return [2,t.sent()]}}))}))},e.prototype.saveBlob=function(e,t){return void 0===t&&(t=null),__bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._blobContainer.save(e,t)];case 1:return [2,n.sent()]}}))}))},e.prototype.removeBlob=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._blobContainer.remove(e)];case 1:return t.sent(),[2]}}))}))},e.prototype.removeAllBlobs=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,this._blobContainer.clear()];case 1:return e.sent(),[2]}}))}))},e}(),Ln={},Pn=function(){function e(e){void 0===e&&(e={});var t=e.itemSizeLimit,n=void 0===t?4194304:t,r=e.delay,i=void 0===r?1:r,s=e.encryption,o=void 0===s?__bundle7dfccc8c.A:s;this._encryption=o,this.itemSizeLimit=n,this.delay=i,this.observer={};}return Object.defineProperty(e.prototype,"rawData",{get:function(){return Ln[this.dbname]},set:function(e){Ln[this.dbname]=e;},enumerable:!1,configurable:!0}),e.prototype.observe=function(e,t,n){var r=this;this.observer[e]={},t.forEach((function(t){return r.observer[e][t]=n}));},e.prototype.init=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:this.dbname=e,Ln[this.dbname]={},n.label=1;case 1:return n.trys.push([1,,3,5]),[4,this.get(__bundle7dfccc8c.N.key)];case 2:if((t=n.sent())&&JSON.stringify(t)!==JSON.stringify(__bundle7dfccc8c.N.value))throw Vt.storeEncryptionInvalid;return [3,5];case 3:return [4,this.set(__bundle7dfccc8c.N)];case 4:return n.sent(),[7];case 5:return [2]}}))}))},e.prototype.getAllKeys=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,Object.keys(Ln[this.dbname]).filter((function(e){return e!==__bundle7dfccc8c.N.key}))]}))}))},e.prototype.get=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,Yt(this.delay)];case 1:if(r.sent(),t=this.observer[e],n=t&&t.get?t.get(e):null)throw n;return [2,Ln[this.dbname][e]?this._encryption.decrypt(Ln[this.dbname][e]):null]}}))}))},e.prototype.set=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return [4,Yt(this.delay)];case 1:if(a.sent(),t=e.key,n=e.value,r=this.observer[t],i=r&&r.set?r.set(t):null)throw i;if(s=this._encryption.encrypt(n),o=JSON.stringify(s),t===__bundle7dfccc8c.N.key||o.length<this.itemSizeLimit)return Ln[this.dbname][t]=s,[2,Ln[this.dbname][t]];throw Vt.storeItemSizeExceeded}}))}))},e.prototype.setMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n=this;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,Yt(this.delay)];case 1:return r.sent(),t=[],e.forEach((function(e){var r=e.key,i=e.value,s=n.observer[r];if(s&&s.set?s.set(r):null)t.push(Vt.collectionWriteFailed);else {var o=n._encryption.encrypt(i),a=JSON.stringify(o);r===__bundle7dfccc8c.N.key||a.length<n.itemSizeLimit?(Ln[n.dbname][r]=o,t.push(i)):t.push(Vt.storeItemSizeExceeded);}})),[2,t]}}))}))},e.prototype.remove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,Yt(this.delay)];case 1:if(r.sent(),t=this.observer[e],n=t&&t.remove?t.remove(e):null)throw n;return Ln[this.dbname][e]&&delete Ln[this.dbname][e],[2,e]}}))}))},e.prototype.removeMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return [4,Yt(this.delay)];case 1:u.sent();try{for(t=__bundle7dfccc8c.s(e),n=t.next();!n.done;n=t.next()){if(r=n.value,i=this.observer[r],s=i&&i.remove?i.remove(r):null)throw s;Ln[this.dbname][r]&&delete Ln[this.dbname][r];}}catch(e){o={error:e};}finally{try{n&&!n.done&&(a=t.return)&&a.call(t);}finally{if(o)throw o.error}}return [2,e]}}))}))},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,Yt(this.delay)];case 1:return e.sent(),Ln[this.dbname]={},[2]}}))}))},e}(),An=function(){function e(e){void 0===e&&(e={}),this.itemSizeLimit=104857600;var t=e.encryption,n=void 0===t?__bundle7dfccc8c.A:t;this._window="undefined"!=typeof window?window:null,this._indexedDB=this._window?this._window.indexedDB||this._window.mozIndexedDB||this._window.webkitIndexedDB||this._window.msIndexedDB:null,this._encryption=n;}return e.prototype.init=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r=this;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return this.dbname=e,[4,new Promise((function(e,t){if(r._window&&wn$1)if(En$1){var n=r._indexedDB.open("_testMozilla");n.onerror=function(){return t(Vt.storeNotAvailableInPrivateBrowsing)},n.onsuccess=function(){return e()};}else On?r._window.indexedDB||!r._window.PointerEvent&&!r._window.MSPointerEvent||t(Vt.storeNotAvailableInPrivateBrowsing):e();else t(Vt.storeNotAvailable);}))];case 1:return i.sent(),t=this,[4,new Promise((function(t,n){var i=r._indexedDB.open(e);i.addEventListener("upgradeneeded",(function(e){e.target.result.createObjectStore("NestDBStore",{keyPath:"key"});})),i.addEventListener("success",(function(e){return t(e.target.result)})),i.addEventListener("error",(function(e){return n(e.target.error)}));}))];case 2:t._database=i.sent(),i.label=3;case 3:return i.trys.push([3,,5,7]),[4,this.get(__bundle7dfccc8c.N.key)];case 4:if((n=i.sent())&&JSON.stringify(n)!==JSON.stringify(__bundle7dfccc8c.N.value))throw Vt.storeEncryptionInvalid;return [3,7];case 5:return [4,this.set(__bundle7dfccc8c.N)];case 6:return i.sent(),[7];case 7:return [2]}}))}))},e.prototype.getAllKeys=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e=this;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,new Promise((function(t,n){var r=e._database.transaction("NestDBStore","readonly").objectStore("NestDBStore").getAllKeys();r.addEventListener("success",(function(e){t(e.target.result.filter((function(e){return e!==__bundle7dfccc8c.N.key})));})),r.addEventListener("error",(function(e){return n(e.target.error)}));}))];case 1:return [2,t.sent()]}}))}))},e.prototype.get=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t=this;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,new Promise((function(n,r){var i=t._database.transaction("NestDBStore","readonly").objectStore("NestDBStore").get(e);i.addEventListener("success",(function(e){return n(e.target.result?t._encryption.decrypt(e.target.result.value):null)})),i.addEventListener("error",(function(e){return r(e.target.error)}));}))];case 1:return [2,n.sent()]}}))}))},e.prototype.set=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r=this;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=e.key,n=e.value,[4,new Promise((function(e,i){var s=r._database.transaction("NestDBStore","readwrite").objectStore("NestDBStore").put({key:t,value:r._encryption.encrypt(n)});s.addEventListener("success",(function(t){e(t.target.result);})),s.addEventListener("error",(function(e){return i(e.target.error)}));}))];case 1:return i.sent(),[2,n]}}))}))},e.prototype.setMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r=this;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=[],n=this._database.transaction("NestDBStore","readwrite").objectStore("NestDBStore"),e.forEach((function(e){var i=e.key,s=e.value;t.push(new Promise((function(e){var t=n.put({key:i,value:r._encryption.encrypt(s)});t.addEventListener("success",(function(t){e(t.target.result);})),t.addEventListener("error",(function(){e(Vt.collectionWriteFailed);}));})));})),[4,Promise.all(t)];case 1:return i.sent(),[2,e.map((function(e){return e.value}))]}}))}))},e.prototype.remove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t=this;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,new Promise((function(n,r){var i=t._database.transaction("NestDBStore","readwrite").objectStore("NestDBStore").delete(e);i.addEventListener("success",(function(){return n(e)})),i.addEventListener("error",(function(e){return r(e.target.error)}));}))];case 1:return [2,n.sent()]}}))}))},e.prototype.removeMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return t=this._database.transaction("NestDBStore","readwrite").objectStore("NestDBStore"),[4,Promise.all(e.map((function(e){return new Promise((function(n,r){var i=t.delete(e);i.addEventListener("success",(function(){return n(e)})),i.addEventListener("error",(function(e){return r(e.target.error)}));}))})))];case 1:return [2,n.sent()]}}))}))},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e=this;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,new Promise((function(t,n){var r=e._database.transaction("NestDBStore","readwrite").objectStore("NestDBStore").clear();r.addEventListener("success",(function(){return t()})),r.addEventListener("error",(function(e){return n(e.target.error)}));}))];case 1:return [2,t.sent()]}}))}))},e}(),Dn=function(){function e(e){var t=e.AsyncStorage,n=e.encryption,r=void 0===n?__bundle7dfccc8c.A:n;this.itemSizeLimit=6291456,this._asyncStorage=t,this._encryption=r;}return e.prototype._isBelonging=function(e){return e.startsWith("".concat(this.dbname,"/"))},e.prototype._getActualKey=function(e){return "".concat(this.dbname,"/").concat(e)},e.prototype.init=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:this.dbname=e,n.label=1;case 1:return n.trys.push([1,,3,5]),[4,this.get(__bundle7dfccc8c.N.key)];case 2:if((t=n.sent())&&JSON.stringify(t)!==JSON.stringify(__bundle7dfccc8c.N.value))throw Vt.storeEncryptionInvalid;return [3,5];case 3:return [4,this.set(__bundle7dfccc8c.N)];case 4:return n.sent(),[7];case 5:return [2]}}))}))},e.prototype.getAllKeys=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n=this;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return e=this._getActualKey(__bundle7dfccc8c.N.key),[4,this._asyncStorage.getAllKeys()];case 1:return t=r.sent(),[2,t.filter((function(t){return n._isBelonging(t)&&t!==e})).map((function(e){return e.substring("".concat(n.dbname,"/").length)}))]}}))}))},e.prototype.get=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._asyncStorage.getItem(this._getActualKey(e))];case 1:return [2,(t=n.sent())?this._encryption.decrypt(JSON.parse(t)):null]}}))}))},e.prototype.set=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=e.key,n=e.value,r=JSON.stringify(this._encryption.encrypt(n)),t===__bundle7dfccc8c.N.key||r.length<this.itemSizeLimit?[4,this._asyncStorage.setItem(this._getActualKey(t),r)]:[3,2];case 1:return i.sent(),[2,JSON.parse(r)];case 2:throw Vt.storeItemSizeExceeded}}))}))},e.prototype.setMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u,c,l;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:t=[],n=[];try{for(r=__bundle7dfccc8c.s(e),i=r.next();!i.done;i=r.next()){s=i.value;try{o=s.key,a=s.value,u=JSON.stringify(this._encryption.encrypt(a)),o===__bundle7dfccc8c.N.key||u.length<this.itemSizeLimit?(n.push([this._getActualKey(o),u]),t.push(a)):t.push(Vt.storeItemSizeExceeded);}catch(e){t.push(Vt.collectionWriteFailed);}}}catch(e){c={error:e};}finally{try{i&&!i.done&&(l=r.return)&&l.call(r);}finally{if(c)throw c.error}}h.label=1;case 1:return h.trys.push([1,3,,4]),[4,this._asyncStorage.multiSet(n)];case 2:return h.sent(),[3,4];case 3:return h.sent(),[2,new Array(t.length).fill(Vt.collectionWriteFailed)];case 4:return [2,t]}}))}))},e.prototype.remove=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this._asyncStorage.removeItem(this._getActualKey(e))];case 1:return t.sent(),[2,e]}}))}))},e.prototype.removeMany=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t=this;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,this._asyncStorage.multiRemove(e.map((function(e){return t._getActualKey(e)})))];case 1:return n.sent(),[2,e]}}))}))},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return [4,this.getAllKeys()];case 1:return e=t.sent(),[4,this.removeMany(e)];case 2:return t.sent(),[4,this.remove(__bundle7dfccc8c.N.key)];case 3:return t.sent(),[2]}}))}))},e}(),Mn=!0,Un$1=function(){function e(){}return e.off=function(){Mn=!1;},e.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Mn&&console.log.apply(console,__bundle7dfccc8c.a(["".concat("[NESTDB]","[LOG]")],__bundle7dfccc8c.o(e),!1));},e.warning=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Mn&&console.warn.apply(console,__bundle7dfccc8c.a(["".concat("[NESTDB]","[WARNING]")],__bundle7dfccc8c.o(e),!1));},e.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];Mn&&console.error.apply(console,__bundle7dfccc8c.a(["".concat("[NESTDB]","[ERROR]")],__bundle7dfccc8c.o(e),!1));},e}();!function(e){e.INIT="INIT",e.OPENING="OPENING",e.OPENED="OPENED",e.CLOSED="CLOSED";}(Tn$1||(Tn$1={}));var qn=function(){function e(e){var t=e.name,n=e.version,r=e.store,i=e.config;this.name=t,this._version=n,this._state=Tn$1.INIT,this._config=i||new jt({dbname:t}),this._store=r,this._event={success:Xt,error:Xt,upgrade:en$1},this._collections=new Map,this._globalMutex=new Cn$1("".concat(this.name,".lock")),this._config.disableLogger&&Un$1.off(),new mn$1({dbname:t,limit:this._config.cacheLimit});}return Object.defineProperty(e.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),e.prototype.commitSchema=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t=this;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this._state!==Tn$1.OPENING?[3,2]:[4,Promise.all(e.map((function(e){return __bundle7dfccc8c.r(t,void 0,void 0,(function(){var t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return t=e.collectionName,n=e.keyName,r=e.index,i=void 0===r?[]:r,this._collections.has(t)||this._collections.set(t,new Rn({dbname:this.name,collectionName:t,keyName:n,keyHash:e.keyHash||null,indexes:i,store:this._store})),[4,this._collections.get(t).init()];case 1:return s.sent(),[2]}}))}))})))];case 1:return n.sent(),[3,3];case 2:throw Vt.databaseSchemaNotOnUpgrade;case 3:return [2]}}))}))},e.prototype.open=function(){var e;return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s=this;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return [4,this._globalMutex.lock()];case 1:if(o.sent(),this._state===Tn$1.OPENED)return [3,15];this._state=Tn$1.OPENING,o.label=2;case 2:return o.trys.push([2,5,,15]),[4,this._store.init(this.name)];case 3:return o.sent(),a=this.name,t="".concat(un$1(a),".metadata"),n={version:0,collectionNames:[]},[4,this._store.get(t)];case 4:return r=null!==(e=o.sent())&&void 0!==e?e:n,[2,new Promise((function(e,n){var i=function(e){r.version<s._version?s._event.upgrade(r.version,(function(n){return __bundle7dfccc8c.r(s,void 0,void 0,(function(){var i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:if(n)return [3,5];r.version++,r.collectionNames=Array.from(this._collections.keys()),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this._store.set({key:t,value:r,generation:this._version})];case 2:return s.sent(),e({continued:!0}),[3,4];case 3:return i=s.sent(),e({continued:!1,err:i}),[3,4];case 4:return [3,6];case 5:e({continued:!1,err:n}),s.label=6;case 6:return [2]}}))}))})):e({continued:!1});},o=function(t){var a=t.continued,c=void 0!==a&&a,l=t.err,d=void 0===l?null:l;if(c)setTimeout((function(){return i(o)}),10);else if(d)Un$1.error(d.message),s._globalMutex.unlock(),s._event.error(d),n(d);else {var f=[];r.collectionNames.forEach((function(e){s._collections.has(e)||f.push(__bundle7dfccc8c.r(s,void 0,void 0,(function(){var t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,Rn.metadataOf(this.name,e,this._store)];case 1:return (t=r.sent())?(n=new Rn({dbname:this.name,collectionName:e,keyName:t.keyName,indexes:t.indexes,store:this._store}),this._collections.set(e,n),[4,n.init()]):[3,3];case 2:r.sent(),r.label=3;case 3:return [2]}}))})));})),Promise.all(f).then((function(){s._state=Tn$1.OPENED,s._globalMutex.unlock(),s._event.success(),e();})).catch((function(e){Un$1.error(e.message),s._globalMutex.unlock(),s._event.error(e),n(e);}));}};i(o);}))];case 5:switch(i=o.sent(),i.code){case wt.STORE_NOT_AVAILABLE_IN_PRIVATE_BROWSING:return [3,6];case wt.STORE_NOT_AVAILABLE:return [3,8];case wt.STORE_ENCRYPTION_INVALID:return [3,10]}return [3,13];case 6:return Un$1.warning("Access to the local storage is not allowed in private browsing. Switched to MemoryStore automatically."),this._store=new Pn({}),this._globalMutex.unlock(),this._event.error(i),[4,this.open()];case 7:return o.sent(),[3,14];case 8:return Un$1.warning("IndexedDB is not available in this environment. Switched to MemoryStore automatically. Consider using other store to save data persistently (e.g. AsyncStorage)."),this._store=new Pn({}),this._globalMutex.unlock(),this._event.error(i),[4,this.open()];case 9:return o.sent(),[3,14];case 10:return Un$1.warning("Encryption algorithm has changed. Stored data would be cleared."),[4,this._store.clear()];case 11:return o.sent(),this._globalMutex.unlock(),this._event.error(i),[4,this.open()];case 12:return o.sent(),[3,14];case 13:throw Un$1.error(i.message),this._globalMutex.unlock(),this._event.error(i),i;case 14:return [3,15];case 15:return [2]}var a;}))}))},e.prototype.close=function(){this._collections.forEach((function(e){return e.close()})),this._state=Tn$1.CLOSED;},e.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,Promise.all(Array.from(this._collections.values()).map((function(e){return e.clear()})))];case 1:return e.sent(),[2]}}))}))},e.prototype.reset=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t=this;return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return this.close(),(e=mn$1.get(this.name))&&e.clearByCondition((function(e){return e.key.startsWith(un$1(t.name))})),[4,this._store.clear()];case 1:return n.sent(),[2]}}))}))},e.prototype.on=function(e,t){this._event[e]=t;},e.prototype.off=function(e){if("function"==typeof this._event[e])if("upgrade"===e)this._event[e]=en$1;else this._event[e]=Xt;},e.prototype.collection=function(e){return this._collections.get(e)||null},e}(),Bn=null,Fn=function(){function n(e,t,n){var r=this;this._fcmPushToken=null,this._apnsPushToken=null,this._iid=e,this.options=t;var i=__bundle7dfccc8c.St.of(e),s=i.sdkState,o=i.cacheContext,a=i.dispatcher,c=i.sessionManager,l=i.requestQueue,d=i.logger,f=i.userEventHandlers;this._onlineDetector=new Me({logger:d,connectionDelegate:{reconnect:function(){var t=__bundle7dfccc8c.St.of(e),n=t.sdkState,r=t.connectionManager;"foreground"===n.appState&&r.resetAndReconnect();},disconnect:function(){__bundle7dfccc8c.St.of(e).connectionManager.disconnect();}}}),new __bundle7dfccc8c.pe(e,{localCacheEnabled:o.localCacheEnabled,dispatcher:a,sdkState:s,logger:d}),n.forEach((function(t){t.init(e,{sdkState:s,cacheContext:o,dispatcher:a,sessionManager:c,requestQueue:l,logger:d,onlineDetector:r._onlineDetector}),r[t.name]=t;})),this._appStateChangeDetector=new De,this._appStateChangeDetector.on("resume",(function(){d.debug("the page resumes from freeze"),r.setForegroundState();})).on("pause",(function(){d.debug("the page freezes"),r.setBackgroundState();})),a.on((function(t){if(t instanceof __bundle7dfccc8c.B){if("USEV"===t.code){var n=t.as(__bundle7dfccc8c.be).event;if(n.category===__bundle7dfccc8c.te.FRIEND_DISCOVERED){var i=__bundle7dfccc8c.me.getDataAsFriendDiscoveredEvent(e,n).friendDiscoveries;__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,f.forEach((function(e){e.onFriendsDiscovered(i);}))]}))}))}));}}}else if(t instanceof __bundle7dfccc8c.$){var a=__bundle7dfccc8c.St.of(r._iid).subscribedUnreadMessageCount,c=!1,l=t.ts;if("number"==typeof l&&l>a.ts){if(a.all!==t.all&&(c=!0),a.all=t.all>=0?t.all:0,t.customTypes)for(var d in t.customTypes)a.customTypes[d]!==t.customTypes[d]&&(c=!0),a.customTypes[d]=t.customTypes[d];c=c&&a.ts>0,a.ts=l;}c&&__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,f.forEach((function(e){e.onTotalUnreadMessageCountUpdated(a.all,a.customTypes);}))]}))}))}));}else t instanceof __bundle7dfccc8c.lt&&o.localCacheEnabled&&o.preference.set(r._getUserProfileCacheKey(s.userId),__bundle7dfccc8c.dt.payloadify(t.userProfile));}));}return n.init=function(e){var t=e.appId,r=e.appVersion,i=void 0===r?null:r,s=e.modules,o=void 0===s?[]:s,a=e.options,u=void 0===a?new __bundle7dfccc8c.b:a,c=e.debugMode,l=void 0!==c&&c,h=e.customApiHost,d=e.customWebSocketHost,f=e.newInstance,p=void 0!==f&&f,v=e.logLevel,_=e.localCacheEnabled,m=void 0!==_&&_,y=e.localCacheEncryption,b=e.useAsyncStorageStore,g=void 0===b?null:b;if(!Bn||p){var I="su-".concat(__bundle7dfccc8c.R()),w=null!=y?y:{encrypt:function(e){return e},decrypt:function(e){return e}},E=new Pn({encryption:w});l||(E=g?new Dn({AsyncStorage:g,encryption:w}):new An({encryption:w})),new __bundle7dfccc8c.St(I,{appId:t,appVersion:i,options:u,apiHost:null!=h?h:"https://api-".concat(t,".sendbird.com"),websocketHost:null!=d?d:"wss://ws-".concat(t,".sendbird.com"),store:E,encryption:w,logLevel:v,localCacheEnabled:m,debugMode:l});var k=new n(I,u,__bundle7dfccc8c.a(__bundle7dfccc8c.a([],__bundle7dfccc8c.o(o),!1),[new __bundle7dfccc8c.Dn],!1));return Bn||(Bn=k),k}return Bn},Object.defineProperty(n,"instance",{get:function(){return Bn},enumerable:!1,configurable:!0}),Object.defineProperty(n,"version",{get:function(){return __bundle7dfccc8c.c},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"appId",{get:function(){return __bundle7dfccc8c.St.of(this._iid).sdkState.appId},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"appInfo",{get:function(){return __bundle7dfccc8c.St.of(this._iid).appInfo},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"appVersion",{get:function(){var e;return null!==(e=__bundle7dfccc8c.St.of(this._iid).sdkState.appVersion)&&void 0!==e?e:""},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"debugMode",{get:function(){return __bundle7dfccc8c.St.of(this._iid).debugMode},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"logLevel",{get:function(){return __bundle7dfccc8c.St.of(this._iid).logger.level},set:function(e){__bundle7dfccc8c.St.of(this._iid).logger.level=e;},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isCacheEnabled",{get:function(){return __bundle7dfccc8c.St.of(this._iid).cacheContext.localCacheEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"ekey",{get:function(){return __bundle7dfccc8c.Me(this._iid)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentUser",{get:function(){var e;return null!==(e=__bundle7dfccc8c.St.of(this._iid).sessionManager.currentUser)&&void 0!==e?e:null},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"connectionState",{get:function(){var e=__bundle7dfccc8c.St.of(this._iid).connectionManager;return e.isConnected?__bundle7dfccc8c.j.OPEN:e.isConnecting?__bundle7dfccc8c.j.CONNECTING:__bundle7dfccc8c.j.CLOSED},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"lastConnectedAt",{get:function(){var e=__bundle7dfccc8c.St.of(this._iid),t=e.connectedAt;return e.connectionManager.isConnected?t:0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"fcmPushToken",{get:function(){return this._fcmPushToken},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"apnsPushToken",{get:function(){return this._apnsPushToken},enumerable:!1,configurable:!0}),n.prototype._getPreferenceCacheKey=function(e){return "sendbird@".concat(this.appId,"/").concat(e,".pref")},n.prototype._getUserProfileCacheKey=function(e){return "sendbird@".concat(this.appId,"/").concat(e,".profile")},n.prototype.getMemoryStoreForDebugging=function(){var e=__bundle7dfccc8c.St.of(this._iid),t=e.debugMode,n=e.cacheContext;if(t)return n.store instanceof Pn?n.store:null;throw __bundle7dfccc8c.p.debugModeRequired},n.prototype.addExtension=function(e,t){var n=__bundle7dfccc8c.St.of(this._iid).sdkState;["sb_uikit","sb_syncmanager"].indexOf(e)>-1&&(n.extensions[e]=t);},n.prototype.initializeCache=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.cacheContext,i=t.connectionManager,s=t.dispatcher,n.userId&&n.userId===e?[3,6]:[4,i.logout()];case 1:return c.sent(),n.userId=e,r.localCacheEnabled?(o="sendbird@".concat(n.appId,"/").concat(e,".db"),r.nestdb&&r.nestdb.state!==Tn$1.CLOSED&&r.nestdb.name===o?[3,3]:((a=r.nestdb=new qn({name:"sendbird@".concat(n.appId,"/").concat(e,".db"),version:1,store:r.store})).on("upgrade",function(e){return function(t,n){0===t?e.commitSchema([{collectionName:__bundle7dfccc8c.W,keyName:__bundle7dfccc8c.V,index:[__bundle7dfccc8c.$$1(__bundle7dfccc8c.K.LATEST_LAST_MESSAGE),__bundle7dfccc8c.$$1(__bundle7dfccc8c.K.CHRONOLOGICAL),__bundle7dfccc8c.$$1(__bundle7dfccc8c.K.CHANNEL_NAME_ALPHABETICAL)]},{collectionName:__bundle7dfccc8c.J,keyName:__bundle7dfccc8c.X,index:[__bundle7dfccc8c.se(__bundle7dfccc8c.Z.CHANNEL_LATEST),__bundle7dfccc8c.se(__bundle7dfccc8c.Z.NEWEST_CHILD_MESSAGE)]},{collectionName:__bundle7dfccc8c.ce,keyName:__bundle7dfccc8c.oe,index:[__bundle7dfccc8c.se(__bundle7dfccc8c.Z.CHANNEL_LATEST),__bundle7dfccc8c.se(__bundle7dfccc8c.Z.NEWEST_CHILD_MESSAGE)]},{collectionName:"Poll",keyName:"pollId"}]).then((function(){return n()})).catch((function(e){return n(e)})):n();}}(a)),[4,a.open()])):[3,6];case 2:c.sent(),s.dispatch(new __bundle7dfccc8c.ve(this._iid,{userId:e})),c.label=3;case 3:return [4,r.preference.init(this._getPreferenceCacheKey(e))];case 4:return c.sent(),[4,r.preference.get(this._getUserProfileCacheKey(e))];case 5:(u=c.sent())&&new __bundle7dfccc8c.dt(this._iid,u).apply(),c.label=6;case 6:return [2]}}))}))},n.prototype.clearCachedData=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return (e=__bundle7dfccc8c.St.of(this._iid).cacheContext).localCacheEnabled?(e.nestdb&&e.nestdb.clear(),[4,e.preference.clear()]):[3,2];case 1:t.sent(),t.label=2;case 2:return [2]}}))}))},n.prototype.clearCachedMessages=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r=this;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.he.of(this._iid),n=__bundle7dfccc8c.ue$1.of(this._iid),t&&n?[4,Promise.all(e.map((function(e){return __bundle7dfccc8c.r(r,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return [4,t.removeMessagesOfChannel(e)];case 1:return r.sent(),[4,n.removeMessagesOfChannel(e)];case 2:return r.sent(),[2]}}))}))})))]:[3,2];case 1:i.sent(),i.label=2;case 2:return [2]}}))}))},n.prototype.connect=function(e,t){return void 0===t&&(t=null),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.cacheContext,s=n.connectionManager,o=n.statLogCollector,c.label=1;case 1:return c.trys.push([1,3,,4]),[4,this.initializeCache(e)];case 2:return c.sent(),[3,4];case 3:return c.sent(),a=__bundle7dfccc8c.St.of(this._iid).logger,i.localCacheEnabled=!1,a.warn("Cache initialization failed - cache is not available."),[3,4];case 4:return [4,o.init("sendbird@".concat(r.appId,"/").concat(e,".statlog"))];case 5:return c.sent(),[4,s.connect(t)];case 6:return c.sent(),this._appStateChangeDetector.start(),r.appState="foreground",[4,null==(u=__bundle7dfccc8c.pe.of(this._iid))?void 0:u.processNonAutoResendRegisteredPendingMessages()];case 7:return c.sent(),this._onlineDetector.start(),[2,this.currentUser]}}))}))},n.prototype.reconnect=function(){var e=__bundle7dfccc8c.St.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.sessionManager.auth.hasSession;return r&&t.resetAndReconnect().then((function(){n.appState="foreground";})).catch((function(){})),r},n.prototype.disconnect=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.connectionManager,n=e.cacheContext,r=e.requestQueue,this._appStateChangeDetector.stop(),this._onlineDetector.stop(),r.cancelAll(),[4,t.logout()];case 1:return i.sent(),n.localCacheEnabled?[4,this.clearCachedData()]:[3,3];case 2:i.sent(),i.label=3;case 3:return [2]}}))}))},n.prototype.setBackgroundState=function(){var e=__bundle7dfccc8c.St.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.logger;"foreground"===n.appState&&(n.appState="background",r.debug("going background state"),t.background());},n.prototype.setForegroundState=function(){var e=__bundle7dfccc8c.St.of(this._iid),t=e.connectionManager,n=e.sdkState,r=e.logger;"background"===n.appState&&(n.appState="foreground",r.debug("going foreground state"),t.resetAndReconnect());},n.prototype.setSessionHandler=function(e){__bundle7dfccc8c.at(e instanceof Le).throw(__bundle7dfccc8c.p.invalidParameters),__bundle7dfccc8c.St.of(this._iid).sessionManager.handler=e;},n.prototype.addUserEventHandler=function(e,n){__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)&&n instanceof Ae).throw(__bundle7dfccc8c.p.invalidParameters),__bundle7dfccc8c.St.of(this._iid).userEventHandlers.set(e,n);},n.prototype.removeUserEventHandler=function(e){__bundle7dfccc8c.St.of(this._iid).userEventHandlers.delete(e);},n.prototype.removeAllUserEventHandler=function(){__bundle7dfccc8c.St.of(this._iid).userEventHandlers.clear();},n.prototype.addConnectionHandler=function(e,n){__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)&&n instanceof Pe).throw(__bundle7dfccc8c.p.invalidParameters),__bundle7dfccc8c.St.of(this._iid).connectionHandlers.set(e,n);},n.prototype.removeConnectionHandler=function(e){__bundle7dfccc8c.St.of(this._iid).connectionHandlers.delete(e);},n.prototype.removeAllConnectionHandler=function(){__bundle7dfccc8c.St.of(this._iid).connectionHandlers.clear();},n.prototype.createApplicationUserListQuery=function(e){return void 0===e&&(e={}),new At(this._iid,e)},n.prototype.createBlockedUserListQuery=function(e){return void 0===e&&(e={}),new Ut(this._iid,e)},n.prototype.createFriendListQuery=function(e){return void 0===e&&(e={}),new Ft(this._iid,e)},n.prototype.createMessageSearchQuery=function(e){return new __bundle7dfccc8c.Cn(this._iid,e)},n.prototype.buildUserFromSerializedData=function(e){var t=__bundle7dfccc8c.ot(e);return new __bundle7dfccc8c.ct(this._iid,__bundle7dfccc8c.ct.payloadify(t))},n.prototype.updateCurrentUserInfo=function(n){return void 0===n&&(n={}),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var r,i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return n=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},Re),n),__bundle7dfccc8c.at(function(n){return __bundle7dfccc8c.S(n.profileImage,!0)&&__bundle7dfccc8c.y("string",n.profileUrl,!0)&&__bundle7dfccc8c.y("string",n.nickname,!0)}(n)).throw(__bundle7dfccc8c.p.invalidParameters),this.currentUser?(r=__bundle7dfccc8c.St.of(this._iid),i=r.sdkState,s=r.requestQueue,o=new Ue(__bundle7dfccc8c.n({userId:i.userId},n)),[4,s.send(o)]):[3,2];case 1:return a=c.sent(),u=a.as(qe).user,this.currentUser&&(n.nickname&&(this.currentUser.nickname=u.nickname),(n.profileUrl||n.profileImage)&&(this.currentUser.plainProfileUrl=u.profileUrl)),[2,u];case 2:throw __bundle7dfccc8c.p.connectionRequired}}))}))},n.prototype.updateCurrentUserInfoWithPreferredLanguages=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),this.currentUser?(t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new Ue({userId:n.userId,preferredLanguages:e}),[4,r.send(i)]):[3,2];case 1:return s=a.sent(),o=s.as(qe).user,this.currentUser&&(this.currentUser.preferredLanguages=o.preferredLanguages),[2,o];case 2:throw __bundle7dfccc8c.p.connectionRequired}}))}))},n.prototype.registerFCMPushTokenForCurrentUser=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:if(__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),!this.currentUser)return [3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new Fe({userId:r.userId,token:e}),[4,i.send(s)];case 2:return o.sent(),this._fcmPushToken="",[2,__bundle7dfccc8c.B$1.SUCCESS];case 3:return o.sent(),[2,__bundle7dfccc8c.B$1.ERROR];case 4:return [3,6];case 5:return this._fcmPushToken=e,[2,__bundle7dfccc8c.B$1.PENDING];case 6:return [2]}}))}))},n.prototype.unregisterFCMPushTokenForCurrentUser=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:if(__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),!this.currentUser)return [3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new je({userId:r.userId,token:e}),[4,i.send(s)];case 2:return o.sent(),this._fcmPushToken="",[2,__bundle7dfccc8c.B$1.SUCCESS];case 3:return o.sent(),[2,__bundle7dfccc8c.B$1.ERROR];case 4:return [3,6];case 5:return this._fcmPushToken=e,[2,__bundle7dfccc8c.B$1.PENDING];case 6:return [2]}}))}))},n.prototype.unregisterFCMPushTokenAllForCurrentUser=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return this.currentUser?(e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Ve({userId:t.userId}),[4,n.send(r)]):[3,2];case 1:i.sent(),i.label=2;case 2:return [2]}}))}))},n.prototype.registerAPNSPushTokenForCurrentUser=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:if(__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),!this.currentUser)return [3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new Be({userId:r.userId,token:e}),[4,i.send(s)];case 2:return o.sent(),this._fcmPushToken="",[2,__bundle7dfccc8c.B$1.SUCCESS];case 3:return o.sent(),[2,__bundle7dfccc8c.B$1.ERROR];case 4:return [3,6];case 5:return this._fcmPushToken=e,[2,__bundle7dfccc8c.B$1.PENDING];case 6:return [2]}}))}))},n.prototype.unregisterAPNSPushTokenForCurrentUser=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:if(__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),!this.currentUser)return [3,5];o.label=1;case 1:return o.trys.push([1,3,,4]),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new Ke({userId:r.userId,token:e}),[4,i.send(s)];case 2:return o.sent(),this._fcmPushToken="",[2,__bundle7dfccc8c.B$1.SUCCESS];case 3:return o.sent(),[2,__bundle7dfccc8c.B$1.ERROR];case 4:return [3,6];case 5:return this._fcmPushToken=e,[2,__bundle7dfccc8c.B$1.PENDING];case 6:return [2]}}))}))},n.prototype.unregisterAPNSPushTokenAllForCurrentUser=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return this.currentUser?(e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new He({userId:t.userId}),[4,n.send(r)]):[3,2];case 1:i.sent(),i.label=2;case 2:return [2]}}))}))},n.prototype.getChannelInvitationPreference=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Qe({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,{autoAccept:i.as(Ge).autoAccept}]}}))}))},n.prototype.setChannelInvitationPreference=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("boolean",e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new Ye({userId:r.userId,willAutoAccept:e}),[4,i.send(s)];case 1:return o=a.sent(),[2,{autoAccept:o.as(Je).autoAccept}]}}))}))},n.prototype.getDoNotDisturb=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new Xe({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,i.as(Ze).preference]}}))}))},n.prototype.setDoNotDisturb=function(e,n,r,i,s,o){return void 0===n&&(n=0),void 0===r&&(r=0),void 0===i&&(i=0),void 0===s&&(s=0),void 0===o&&(o=""),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var a,u,c,l,d;return __bundle7dfccc8c.i(this,(function(h){switch(h.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("boolean",e)&&__bundle7dfccc8c.y("number",n)&&__bundle7dfccc8c.y("number",r)&&__bundle7dfccc8c.y("number",i)&&__bundle7dfccc8c.y("number",s)&&__bundle7dfccc8c.y("string",o)).throw(__bundle7dfccc8c.p.invalidParameters),a=__bundle7dfccc8c.St.of(this._iid),u=a.sdkState,c=a.requestQueue,l=new $e({userId:u.userId,doNotDisturbOn:e,startHour:n,startMin:r,endHour:i,endMin:s,timezone:o}),[4,c.send(l)];case 1:return d=h.sent(),[2,d.as(et).preference]}}))}))},n.prototype.getSnoozePeriod=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new tt({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,i.as(nt).snoozePeriod]}}))}))},n.prototype.setSnoozePeriod=function(e,n,r){return void 0===n&&(n=0),void 0===r&&(r=0),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var i,s,o,a,u;return __bundle7dfccc8c.i(this,(function(c){switch(c.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("boolean",e)&&__bundle7dfccc8c.y("number",n)&&__bundle7dfccc8c.y("number",r)).throw(__bundle7dfccc8c.p.invalidParameters),i=__bundle7dfccc8c.St.of(this._iid),s=i.sdkState,o=i.requestQueue,a=new rt({userId:s.userId,snoozeOn:e,startTs:n,endTs:r}),[4,o.send(a)];case 1:return u=c.sent(),[2,u.as(it).snoozePeriod]}}))}))},n.prototype.getMyPushTokensByToken=function(e,n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var r,i,s,o,a;return __bundle7dfccc8c.i(this,(function(u){switch(u.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)&&__bundle7dfccc8c.m(__bundle7dfccc8c.z,n)).throw(__bundle7dfccc8c.p.invalidParameters),r=__bundle7dfccc8c.St.of(this._iid),i=r.sdkState,s=r.requestQueue,o=new We({userId:i.userId,type:n,token:e}),[4,s.send(o)];case 1:return a=u.sent(),[2,a.as(ze).pushTokens]}}))}))},n.prototype.getPushTriggerOption=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new __bundle7dfccc8c._e({userId:t.userId}),[4,n.send(r)];case 1:return [2,i.sent().as(__bundle7dfccc8c.Ee).pushTriggerOption]}}))}))},n.prototype.setPushTriggerOption=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.m(__bundle7dfccc8c.H,e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new __bundle7dfccc8c.Ae({userId:n.userId,pushTriggerOption:e}),[4,r.send(i)];case 1:return [2,s.sent().as(__bundle7dfccc8c.ye).pushTriggerOption]}}))}))},n.prototype.getPushTemplate=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new at({userId:t.userId}),[4,n.send(r)];case 1:return [2,i.sent().as(ut).name]}}))}))},n.prototype.setPushTemplate=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.m(__bundle7dfccc8c.q$1,e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new ct({userId:n.userId,templateName:e}),[4,r.send(i)];case 1:return [2,s.sent().as(lt).name]}}))}))},n.prototype.blockUser=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(e instanceof __bundle7dfccc8c.ct||__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new st({userId:r.userId,blockedUserId:e instanceof __bundle7dfccc8c.ct?e.userId:e}),[4,i.send(s)];case 1:return o.sent(),[2]}}))}))},n.prototype.blockUserWithUserId=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return [2,this.blockUser(e)]}))}))},n.prototype.unblockUser=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(e instanceof __bundle7dfccc8c.ct||__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new ot({userId:r.userId,unblockedUserId:e instanceof __bundle7dfccc8c.ct?e.userId:e}),[4,i.send(s)];case 1:return o.sent(),[2]}}))}))},n.prototype.unblockUserWithUserId=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return [2,this.unblockUser(e)]}))}))},n.prototype.getFriendChangeLogsByToken=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s,o;return __bundle7dfccc8c.i(this,(function(a){switch(a.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new ht({userId:r.userId,token:e}),[4,i.send(s)];case 1:return o=a.sent(),[2,o.as(dt).changelogs]}}))}))},n.prototype.getAllowFriendDiscovery=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid),t=e.sdkState,n=e.requestQueue,r=new bt({userId:t.userId}),[4,n.send(r)];case 1:return i=s.sent(),[2,i.as(gt).allowFriendDiscovery]}}))}))},n.prototype.setAllowFriendDiscovery=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("boolean",e)).throw(__bundle7dfccc8c.p.invalidParameters),n=__bundle7dfccc8c.St.of(this._iid),r=n.sdkState,i=n.requestQueue,s=new It({userId:r.userId,allowFriendDiscovery:e}),[4,i.send(s)];case 1:return o.sent(),[2,e]}}))}))},n.prototype.uploadFriendDiscoveries=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new ft({userId:n.userId,discoveries:e}),[4,r.send(i)];case 1:return s=o.sent(),[2,s.as(pt).friendDiscoveryRequestId]}}))}))},n.prototype.deleteFriendDiscovery=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return [2,this.deleteFriendDiscoveries([e])]}))}))},n.prototype.deleteFriendDiscoveries=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new vt({userId:n.userId,discoveryKeys:e}),[4,r.send(i)];case 1:return s.sent(),[2]}}))}))},n.prototype.addFriends=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i,s;return __bundle7dfccc8c.i(this,(function(o){switch(o.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new _t({userId:n.userId,userIds:e}),[4,r.send(i)];case 1:return s=o.sent(),[2,s.as(mt).users]}}))}))},n.prototype.deleteFriend=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(t){return [2,this.deleteFriends([e])]}))}))},n.prototype.deleteFriends=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r,i;return __bundle7dfccc8c.i(this,(function(s){switch(s.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.E("string",e)).throw(__bundle7dfccc8c.p.invalidParameters),t=__bundle7dfccc8c.St.of(this._iid),n=t.sdkState,r=t.requestQueue,i=new yt({userId:n.userId,userIds:e}),[4,r.send(i)];case 1:return s.sent(),[2]}}))}))},n.prototype.getAllEmoji=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,t,n;return __bundle7dfccc8c.i(this,(function(r){switch(r.label){case 0:return e=__bundle7dfccc8c.St.of(this._iid).requestQueue,t=new Ot,[4,e.send(t)];case 1:return n=r.sent(),[2,n.as(St).emojiContainer]}}))}))},n.prototype.getEmojiCategory=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=__bundle7dfccc8c.St.of(this._iid).requestQueue,n=new Tt({categoryId:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(xt).emojiCategory]}}))}))},n.prototype.getEmoji=function(e){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var t,n,r;return __bundle7dfccc8c.i(this,(function(i){switch(i.label){case 0:return t=__bundle7dfccc8c.St.of(this._iid).requestQueue,n=new Ct({key:e}),[4,t.send(n)];case 1:return r=i.sent(),[2,r.as(Rt).emoji]}}))}))},n}();
|
|
6
|
-
|
|
7
|
-
var en=function(r){function a(){var n=null!==r&&r.apply(this,arguments)||this;return n._channels=new Map,n._enteredChannelUrls=[],n}return __bundle7dfccc8c.t(a,r),Object.defineProperty(a.prototype,"enteredChannels",{get:function(){var n=this;return this._enteredChannelUrls.map((function(e){return n._channels.get(e)})).filter((function(n){return null!==n}))},enumerable:!1,configurable:!0}),a.prototype.isEnteredChannel=function(n){return this._enteredChannelUrls.includes(n)},a.prototype.enter=function(n){this._enteredChannelUrls.indexOf(n)<0&&this._enteredChannelUrls.push(n);},a.prototype.exit=function(n){var e=this._enteredChannelUrls.indexOf(n);e>=0&&this._enteredChannelUrls.splice(e,1);},a.prototype.exitAll=function(){this._enteredChannelUrls=[];},a.prototype.get=function(n){var r;return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,null!==(r=this._channels.get(n))&&void 0!==r?r:null]}))}))},a.prototype.upsert=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e=this;return __bundle7dfccc8c.i(this,(function(t){return n.forEach((function(n){if(e._channels.has(n.url)){var t=e._channels.get(n.url);Object.assign(t,n);}else e._channels.set(n.url,n);})),[2]}))}))},a.prototype.remove=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return this._channels.delete(n),this.exit(n),[2]}))}))},a.prototype.clear=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._channels.clear(),this._enteredChannelUrls=[],[2]}))}))},a}(__bundle7dfccc8c.Le),tn={channelUrl:null,name:null,coverUrlOrImage:null,data:null,customType:null,operatorUserIds:null},rn=function(e){function t(n){var t=n.channelUrl,r=n.isInternalCall,a=e.call(this)||this;return a.method=__bundle7dfccc8c.d.GET,a.path="".concat(r?__bundle7dfccc8c.Ge:__bundle7dfccc8c.xe,"/").concat(encodeURIComponent(t)),a}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),an=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.channel=null,r.channel=new gn(n,t),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),sn=function(e){function t(n){var t=this,r=n.channelUrl,a=n.coverUrlOrImage,u=n.name,l=n.data,h=n.customType,p=n.operatorUserIds;return (t=e.call(this)||this).method=__bundle7dfccc8c.d.POST,t.path=__bundle7dfccc8c.xe,t.params=__bundle7dfccc8c.U({channel_url:r,cover_url:__bundle7dfccc8c.y("string",a)?a:null,cover_file:__bundle7dfccc8c.S(a)?a:null,name:u,data:l,custom_type:h,operators:p}),t}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.channel=new gn(n,t),r}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var on=function(e){function t(n){var t=n.channelUrl;return e.call(this,{code:"ENTR",payload:{channel_url:t},ackRequired:!0})||this}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.H$1),un=function(e){function t(n,t,r){var a,i,s=this;return s=e.call(this,n,"ENTR",r)||this,r.data&&(s.participantCount=null!==(a=r.data.participant_count)&&void 0!==a?a:0,s.user=new __bundle7dfccc8c.ct(n,r.data),s.ts=null!==(i=r.data.edge_ts)&&void 0!==i?i:0),s}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.B),cn=function(e){function t(n){var t=n.channelUrl;return e.call(this,{code:"EXIT",payload:{channel_url:t},ackRequired:!0})||this}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.H$1),ln=function(e){function t(n,t,r){var a,i,s=this;return s=e.call(this,n,"EXIT",r)||this,r.data&&(s.participantCount=null!==(a=r.data.participant_count)&&void 0!==a?a:0,s.user=new __bundle7dfccc8c.ct(n,r.data),s.ts=null!==(i=r.data.edge_ts)&&void 0!==i?i:0),s}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.B),hn={},dn=function(){function n(n,e){var t=e.sdkState,r=e.dispatcher,a=e.requestQueue,i=this;this._sdkState=t,this._requestQueue=a,this._dispatcher=r,this._openChannelCache=new en(n),this._openChannelHandlers=new Map,this._dispatcher.on((function(n){var e,t;if(n instanceof __bundle7dfccc8c.B)i._handleEvent(n);else if(n instanceof __bundle7dfccc8c.de&&n.stateType===__bundle7dfccc8c.J$1.CONNECTED){var r=i._openChannelCache.enteredChannels;try{for(var a=__bundle7dfccc8c.s(r),s=a.next();!s.done;s=a.next()){s.value.enter();}}catch(n){e={error:n};}finally{try{s&&!s.done&&(t=a.return)&&t.call(a);}finally{if(e)throw e.error}}}})),hn[n]=this;}return n.of=function(n){return hn[n]},n.prototype.buildOpenChannelFromSerializedData=function(n){var e=__bundle7dfccc8c.ot(n);return new gn(e._iid,gn.payloadify(e))},n.prototype.getChannelFromCache=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,this._openChannelCache.get(n)];case 1:return [2,e.sent()]}}))}))},n.prototype.upsertChannelsToCache=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){switch(e.label){case 0:return [4,this._openChannelCache.upsert(n)];case 1:return e.sent(),[2]}}))}))},n.prototype.removeChannelsFromCache=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,r,a,i,s,o;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:t.trys.push([0,5,6,7]),e=__bundle7dfccc8c.s(n),r=e.next(),t.label=1;case 1:return r.done?[3,4]:(a=r.value,[4,this._openChannelCache.remove(a)]);case 2:t.sent(),t.label=3;case 3:return r=e.next(),[3,1];case 4:return [3,7];case 5:return i=t.sent(),s={error:i},[3,7];case 6:try{r&&!r.done&&(o=e.return)&&o.call(e);}finally{if(s)throw s.error}return [7];case 7:return [2]}}))}))},n.prototype.setEnteredToCache=function(n){this._openChannelCache.enter(n.url);},n.prototype.setExitedToCache=function(n){this._openChannelCache.exit(n.url);},n.prototype._handleEvent=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var r,a,i,s,o,u,c,l,h,d,p,f,C,v,_,m,T,N,H,I,M,b,O,D,x,A,B,nn,en,tn,rn,an,sn,on,cn,hn,dn,pn,fn,Cn,vn,_n,yn,mn,gn,Un,En,wn,Tn,Nn,Hn,In,Mn,bn,On,Dn,xn,An,Pn,Ln=this;return __bundle7dfccc8c.i(this,(function(Rn){switch(Rn.label){case 0:switch(Rn.trys.push([0,51,,52]),n.code){case"MESG":case"FILE":case"ADMM":case"BRDM":return [3,1];case"MEDI":case"FEDI":case"AEDI":return [3,4];case"DELM":return [3,7];case"MRCT":return [3,10];case"MTHD":return [3,13];case"MCNT":return [3,16];case"SYEV":return [3,27]}return [3,50];case 1:return s=null,"MESG"===n.code?s=n.as(__bundle7dfccc8c.gt):"FILE"===n.code?s=n.as(__bundle7dfccc8c.Jt):"ADMM"!==n.code&&"BRDM"!=n.code||(s=n.as(__bundle7dfccc8c.A$1)),s?(r=s.message,a=s.isMentioned,r.channelType!==__bundle7dfccc8c.ne.OPEN?[3,3]:[4,this.getChannel(r.channelUrl,!0)]):[3,3];case 2:i=Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){var n,e,s,o,u;return __bundle7dfccc8c.i(this,(function(t){try{for(n=__bundle7dfccc8c.s(this._openChannelHandlers.values()),e=n.next();!e.done;e=n.next())s=e.value,this._openChannelCache.isEnteredChannel(i.url)&&s.onMessageReceived(i,r),a&&s.onMentionReceived(i,r);}catch(n){o={error:n};}finally{try{e&&!e.done&&(u=n.return)&&u.call(n);}finally{if(o)throw o.error}}return [2]}))}))})),Rn.label=3;case 3:return [3,50];case 4:return s=null,"MEDI"===n.code?s=n.as(__bundle7dfccc8c.Tt$1):"FEDI"===n.code?s=n.as(__bundle7dfccc8c.It):"AEDI"===n.code&&(s=n.as(__bundle7dfccc8c.c$1)),s?(o=s.message).channelType!==__bundle7dfccc8c.ne.OPEN?[3,6]:[4,this.getChannel(o.channelUrl,!0)]:[3,6];case 5:u=Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){var n,e,r,a,i;return __bundle7dfccc8c.i(this,(function(t){try{for(n=__bundle7dfccc8c.s(this._openChannelHandlers.values()),e=n.next();!e.done;e=n.next())r=e.value,this._openChannelCache.isEnteredChannel(u.url)&&r.onMessageUpdated(u,o);}catch(n){a={error:n};}finally{try{e&&!e.done&&(i=n.return)&&i.call(n);}finally{if(a)throw a.error}}return [2]}))}))})),Rn.label=6;case 6:return [3,50];case 7:return c=n.as(__bundle7dfccc8c.wt),M=c.channelUrl,p=c.channelType,l=c.messageId,p!==__bundle7dfccc8c.ne.OPEN?[3,9]:[4,this.getChannel(M,!0)];case 8:h=Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){var n,e,r,a,i;return __bundle7dfccc8c.i(this,(function(t){try{for(n=__bundle7dfccc8c.s(this._openChannelHandlers.values()),e=n.next();!e.done;e=n.next())r=e.value,this._openChannelCache.isEnteredChannel(h.url)&&r.onMessageDeleted(h,l);}catch(n){a={error:n};}finally{try{e&&!e.done&&(i=n.return)&&i.call(n);}finally{if(a)throw a.error}}return [2]}))}))})),Rn.label=9;case 9:return [3,50];case 10:return d=n.as(__bundle7dfccc8c.H$2),M=d.channelUrl,p=d.channelType,f=d.event,p!==__bundle7dfccc8c.ne.OPEN?[3,12]:[4,this.getChannel(M,!0)];case 11:C=Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){var n,e,r,a;return __bundle7dfccc8c.i(this,(function(t){try{for(n=__bundle7dfccc8c.s(this._openChannelHandlers.values()),e=n.next();!e.done;e=n.next())e.value.onReactionUpdated(C,f);}catch(n){r={error:n};}finally{try{e&&!e.done&&(a=n.return)&&a.call(n);}finally{if(r)throw r.error}}return [2]}))}))})),Rn.label=12;case 12:return [3,50];case 13:return (v=n.as(__bundle7dfccc8c.T).event).channelType!==__bundle7dfccc8c.ne.OPEN?[3,15]:[4,this.getChannel(v.channelUrl,!0)];case 14:_=Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){var n,e,r,a;return __bundle7dfccc8c.i(this,(function(t){try{for(n=__bundle7dfccc8c.s(this._openChannelHandlers.values()),e=n.next();!e.done;e=n.next())e.value.onThreadInfoUpdated(_,v);}catch(n){r={error:n};}finally{try{e&&!e.done&&(a=n.return)&&a.call(n);}finally{if(r)throw r.error}}return [2]}))}))})),Rn.label=15;case 15:return [3,50];case 16:m=n.as(__bundle7dfccc8c.h$1).openChannelMemberCounts,T=[],Rn.label=17;case 17:Rn.trys.push([17,22,23,24]),N=__bundle7dfccc8c.s(m),H=N.next(),Rn.label=18;case 18:return H.done?[3,21]:(I=H.value,M=I.channelUrl,an=I.participantCount,b=I.updatedAt,[4,this.getChannelFromCache(M)]);case 19:(O=Rn.sent())&&O._updateParticipantCount(an,b)&&T.push(O),Rn.label=20;case 20:return H=N.next(),[3,18];case 21:return [3,24];case 22:return D=Rn.sent(),An={error:D},[3,24];case 23:try{H&&!H.done&&(Pn=N.return)&&Pn.call(N);}finally{if(An)throw An.error}return [7];case 24:return T.length>0?[4,this.upsertChannelsToCache(T)]:[3,26];case 25:Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){var n,e,r,a;return __bundle7dfccc8c.i(this,(function(t){try{for(n=__bundle7dfccc8c.s(this._openChannelHandlers.values()),e=n.next();!e.done;e=n.next())e.value.onChannelMemberCountChanged(T);}catch(n){r={error:n};}finally{try{e&&!e.done&&(a=n.return)&&a.call(n);}finally{if(r)throw r.error}}return [2]}))}))})),Rn.label=26;case 26:return [3,50];case 27:if(!(x=n.as(__bundle7dfccc8c.C).event).isOpenChannelEvent)return [3,49];switch(x.category){case __bundle7dfccc8c._.CHANNEL_ENTER:return [3,28];case __bundle7dfccc8c._.CHANNEL_EXIT:return [3,30];case __bundle7dfccc8c._.CHANNEL_OPERATOR_UPDATE:return [3,32];case __bundle7dfccc8c._.USER_CHANNEL_MUTE:case __bundle7dfccc8c._.USER_CHANNEL_UNMUTE:return [3,34];case __bundle7dfccc8c._.USER_CHANNEL_BAN:case __bundle7dfccc8c._.USER_CHANNEL_UNBAN:return [3,36];case __bundle7dfccc8c._.CHANNEL_FREEZE:case __bundle7dfccc8c._.CHANNEL_UNFREEZE:return [3,38];case __bundle7dfccc8c._.CHANNEL_DELETED:return [3,40];case __bundle7dfccc8c._.CHANNEL_PROP_CHANGED:return [3,43];case __bundle7dfccc8c._.CHANNEL_META_DATA_CHANGED:return [3,45];case __bundle7dfccc8c._.CHANNEL_META_COUNTERS_CHANGED:return [3,47]}return [3,49];case 28:return [4,this.getChannel(x.channelUrl,!0)];case 29:return A=Rn.sent(),B=n.as(un),an=B.participantCount,nn=B.user,en=A._updateParticipantCount(an,x.ts),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){n.onUserEntered(A,nn),en&&n.onChannelParticipantCountChanged(A);})),[2]}))}))})),[3,49];case 30:return [4,this.getChannel(x.channelUrl,!0)];case 31:return tn=Rn.sent(),rn=n.as(ln),an=rn.participantCount,sn=rn.user,on=tn._updateParticipantCount(an,x.ts),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){n.onUserExited(tn,sn),on&&n.onChannelParticipantCountChanged(tn);})),[2]}))}))})),[3,49];case 32:return [4,this.getChannel(x.channelUrl,!0)];case 33:return cn=Rn.sent(),hn=n.as(__bundle7dfccc8c.d$1).operators,cn.operators=hn,this.upsertChannelsToCache([cn]),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){n.onOperatorUpdated(cn,hn);})),[2]}))}))})),[3,49];case 34:return [4,this.getChannel(x.channelUrl,!0)];case 35:return dn=Rn.sent(),pn=x.category===__bundle7dfccc8c._.USER_CHANNEL_MUTE,fn=n.as(pn?__bundle7dfccc8c.at$1:__bundle7dfccc8c.ot$1).user,__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){pn?n.onUserMuted(dn,fn):n.onUserUnmuted(dn,fn);})),[2]}))}))})),[3,49];case 36:return [4,this.getChannel(x.channelUrl,!0)];case 37:return Cn=Rn.sent(),vn=x.category===__bundle7dfccc8c._.USER_CHANNEL_BAN,_n=n.as(vn?__bundle7dfccc8c.ct$1:__bundle7dfccc8c.dt$1).user,__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){vn?n.onUserBanned(Cn,_n):n.onUserUnbanned(Cn,_n);})),[2]}))}))})),[3,49];case 38:return [4,this.getChannel(x.channelUrl,!0)];case 39:return yn=Rn.sent(),mn=n.as(__bundle7dfccc8c.pt).freeze,yn.isFrozen=mn,this.upsertChannelsToCache([yn]),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){mn?n.onChannelFrozen(yn):n.onChannelUnfrozen(yn);})),[2]}))}))})),[3,49];case 40:return [4,this.getChannel(x.channelUrl,!0)];case 41:return gn=Rn.sent(),[4,this.removeChannelsFromCache([gn.url])];case 42:return Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){n.onChannelDeleted(gn.url,gn.channelType);})),[2]}))}))})),[3,49];case 43:return [4,this.getChannelWithoutCache(x.channelUrl,!0)];case 44:return Un=Rn.sent(),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){n.onChannelChanged(Un);})),[2]}))}))})),[3,49];case 45:return [4,this.getChannel(x.channelUrl,!0)];case 46:return En=Rn.sent(),wn=n.as(__bundle7dfccc8c.je),Tn=wn.created,Nn=wn.updated,Hn=wn.deleted,Tn&&En._upsertCachedMetaData(Tn,x.ts),Nn&&En._upsertCachedMetaData(Nn,x.ts),Hn&&En._removeFromCachedMetaData(Hn,x.ts),__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){Tn&&n.onMetaDataCreated(En,Tn),Nn&&n.onMetaDataUpdated(En,Nn),Hn&&n.onMetaDataDeleted(En,Hn);})),[2]}))}))})),[3,49];case 47:return [4,this.getChannel(x.channelUrl,!0)];case 48:return In=Rn.sent(),Mn=n.as(__bundle7dfccc8c.tt),bn=Mn.created,On=Mn.updated,Dn=Mn.deleted,__bundle7dfccc8c.Ie((function(){return __bundle7dfccc8c.r(Ln,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){return this._openChannelHandlers.forEach((function(n){bn&&n.onMetaCounterCreated(In,bn),On&&n.onMetaCounterUpdated(In,On),Dn&&n.onMetaCounterDeleted(In,Dn);})),[2]}))}))})),[3,49];case 49:return [3,50];case 50:return [3,52];case 51:if(xn=Rn.sent(),__bundle7dfccc8c.h(xn))throw xn;return [3,52];case 52:return [2]}}))}))},n.prototype.addHandler=function(n,e){this._openChannelHandlers.set(n,e);},n.prototype.removeHandler=function(n){this._openChannelHandlers.delete(n);},n.prototype.clearHandler=function(){this._openChannelHandlers.clear();},n.prototype.getChannel=function(n,r){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:__bundle7dfccc8c.at(__bundle7dfccc8c.y("string",n)).throw(__bundle7dfccc8c.p.invalidParameters),t.label=1;case 1:return t.trys.push([1,3,,4]),[4,this.getChannelFromCache(n)];case 2:return (e=t.sent())?[2,e]:[3,4];case 3:return t.sent(),[3,4];case 4:return [4,this.getChannelWithoutCache(n)];case 5:return [2,t.sent()]}}))}))},n.prototype.getChannelWithoutCache=function(n,r){return void 0===r&&(r=!1),__bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,a,s;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return __bundle7dfccc8c.at(__bundle7dfccc8c.y("string",n)).throw(__bundle7dfccc8c.p.invalidParameters),e=new rn({channelUrl:n,isInternalCall:r}),[4,this._requestQueue.send(e)];case 1:return a=t.sent(),s=a.as(an).channel,[4,this.upsertChannelsToCache([s])];case 2:return t.sent(),[2,s]}}))}))},n.prototype.createChannel=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,r,o;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return n=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},tn),n),__bundle7dfccc8c.at(function(n){return __bundle7dfccc8c.E("string",n.operatorUserIds,!0)&&(__bundle7dfccc8c.y("string",n.coverUrlOrImage)||__bundle7dfccc8c.S(n.coverUrlOrImage)||null===n.coverUrlOrImage)&&__bundle7dfccc8c.y("string",n.name,!0)&&__bundle7dfccc8c.y("string",n.data,!0)&&__bundle7dfccc8c.y("string",n.customType,!0)&&(__bundle7dfccc8c.y("string",n.channelUrl)&&/^\w+$/.test(n.channelUrl)||null===n.channelUrl)}(n)).throw(__bundle7dfccc8c.p.invalidParameters),e=new sn(n),[4,this._requestQueue.send(e)];case 1:return r=t.sent(),o=r.as(an).channel,this.upsertChannelsToCache([o]),[2,o]}}))}))},n}(),pn={name:null,coverUrlOrImage:null,data:null,customType:null,operatorUserIds:null},fn=function(e){function t(n){var t=this,r=n.channelUrl,a=n.token,i=n.limit;return (t=e.call(this)||this).method=__bundle7dfccc8c.d.GET,t.path="".concat(__bundle7dfccc8c.xe,"/").concat(encodeURIComponent(r),"/participants"),t.params={token:a,limit:i},t}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),Cn=function(e){function t(n,t){var r=e.call(this,n,t)||this;r.token=null,r.participants=[];var a=t.next,i=t.participants;return r.token=a,r.participants=i.map((function(e){return new __bundle7dfccc8c.ct(n,e)})),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),vn=function(r){function a(n,e,t){return r.call(this,n,e,__bundle7dfccc8c.ne.OPEN,t)||this}return __bundle7dfccc8c.t(a,r),a.prototype._validate=function(){return r.prototype._validate.call(this)},a.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,e,r,a,i,s;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return this._validate()?this._isLoading?[3,3]:this._hasNext?(this._isLoading=!0,n=__bundle7dfccc8c.St.of(this._iid).requestQueue,e=new fn(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{token:this._token})),[4,n.send(e)]):[3,2]:[3,5];case 1:return r=t.sent(),a=r.as(Cn),i=a.participants,s=a.token,this._token=s,this._hasNext=!!s,this._isLoading=!1,[2,i];case 2:return [2,[]];case 3:throw __bundle7dfccc8c.p.queryInProgress;case 4:return [3,6];case 5:throw __bundle7dfccc8c.p.invalidParameters;case 6:return [2]}}))}))},a}(__bundle7dfccc8c.On),_n=function(e){function t(n){var t=this,r=n.channelUrl,a=n.coverUrlOrImage,u=n.name,l=n.data,h=n.customType,p=n.operatorUserIds;return (t=e.call(this)||this).method=__bundle7dfccc8c.d.PUT,t.path="".concat(__bundle7dfccc8c.xe,"/").concat(encodeURIComponent(r)),t.params=__bundle7dfccc8c.U({cover_url:__bundle7dfccc8c.y("string",a)?a:null,cover_file:__bundle7dfccc8c.S(a)?a:null,name:u,data:l,custom_type:h,operators:p}),t}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),yn=function(e){function t(n,t){var r=e.call(this,n,t)||this;return r.channel=new gn(n,t),r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),mn=function(e){function t(n){var t=this,r=n.channelUrl;return (t=e.call(this)||this).method=__bundle7dfccc8c.d.DELETE,t.path="".concat(__bundle7dfccc8c.xe,"/").concat(encodeURIComponent(r)),t}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q);!function(e){function t(n,t){return e.call(this,n,t)||this}__bundle7dfccc8c.t(t,e);}(__bundle7dfccc8c.F);var gn=function(r){function o(n,e){var t,a=this;return (a=r.call(this,n,e)||this)._lastParticipantCountUpdated=0,a.participantCount=0,a.operators=[],a.channelType=__bundle7dfccc8c.ne.OPEN,a.participantCount=null!==(t=e.participant_count)&&void 0!==t?t:0,a.operators=Array.isArray(e.operators)?e.operators.map((function(e){return new __bundle7dfccc8c.ct(n,e)})):[],a}return __bundle7dfccc8c.t(o,r),o.payloadify=function(n){return n?__bundle7dfccc8c.U(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},__bundle7dfccc8c.kt.payloadify(n)),{participant_count:n.participantCount,operators:n.operators.map((function(n){return __bundle7dfccc8c.ct.payloadify(n)}))})):null},o.prototype.serialize=function(){return __bundle7dfccc8c.st(this)},o.prototype.isOperator=function(n){return n instanceof __bundle7dfccc8c.ct?this.isOperator(n.userId):this.operators.some((function(e){return e.userId===n}))},o.prototype._updateParticipantCount=function(n,e){return e>this._lastParticipantCountUpdated&&(this.participantCount=n,this._lastParticipantCountUpdated=e,!0)},o.prototype.createParticipantListQuery=function(n){return new vn(this._iid,this.url,n)},o.prototype.refresh=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(n){switch(n.label){case 0:return [4,dn.of(this._iid).getChannelWithoutCache(this.url)];case 1:return [2,n.sent()]}}))}))},o.prototype.enter=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,e,r,a,i,s;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return n=__bundle7dfccc8c.St.of(this._iid).requestQueue,e=new on({channelUrl:this.url}),[4,n.send(e)];case 1:return r=t.sent(),a=r.as(un),i=a.participantCount,s=a.ts,this._updateParticipantCount(i,s),dn.of(this._iid).setEnteredToCache(this),[2]}}))}))},o.prototype.exit=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,e,r,a,i,s;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return n=__bundle7dfccc8c.St.of(this._iid).requestQueue,e=new cn({channelUrl:this.url}),[4,n.send(e)];case 1:return r=t.sent(),a=r.as(ln),i=a.participantCount,s=a.ts,this._updateParticipantCount(i,s),dn.of(this._iid).setExitedToCache(this),__bundle7dfccc8c.En.of(this._iid).fileMessageQueue.cancel(this),[2]}}))}))},o.prototype.updateChannel=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e,r,o,u;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return n=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},pn),n),__bundle7dfccc8c.at(function(n){return __bundle7dfccc8c.E("string",n.operatorUserIds,!0)&&(__bundle7dfccc8c.y("string",n.coverUrlOrImage)||__bundle7dfccc8c.S(n.coverUrlOrImage)||null===n.coverUrlOrImage)&&__bundle7dfccc8c.y("string",n.name,!0)&&__bundle7dfccc8c.y("string",n.data,!0)&&__bundle7dfccc8c.y("string",n.customType,!0)}(n)).throw(__bundle7dfccc8c.p.invalidParameters),e=__bundle7dfccc8c.St.of(this._iid).requestQueue,r=new _n(__bundle7dfccc8c.n({channelUrl:this.url},n)),[4,e.send(r)];case 1:return o=t.sent(),u=o.as(yn).channel,[4,dn.of(this._iid).upsertChannelsToCache([u])];case 2:return t.sent(),[2,u]}}))}))},o.prototype.updateChannelWithOperatorUserIds=function(n,r,a,i,s){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){return e=__bundle7dfccc8c.n(__bundle7dfccc8c.n({},pn),{name:n,coverUrlOrImage:r,data:a,operatorUserIds:i,customType:s}),[2,this.updateChannel(e)]}))}))},o.prototype.delete=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,e;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return n=__bundle7dfccc8c.St.of(this._iid).requestQueue,e=new mn({channelUrl:this.url}),[4,n.send(e)];case 1:return t.sent(),[4,dn.of(this._iid).removeChannelsFromCache([this.url])];case 2:return t.sent(),[2]}}))}))},o}(__bundle7dfccc8c.kt),Un=function(e){function t(n){void 0===n&&(n={});var t=e.call(this)||this;return Object.keys(n).forEach((function(e){t.hasOwnProperty(e)&&(t[e]=n[e]);})),t}return __bundle7dfccc8c.t(t,e),t}(function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.onUserEntered=__bundle7dfccc8c.Y,n.onUserExited=__bundle7dfccc8c.Y,n.onChannelParticipantCountChanged=__bundle7dfccc8c.Y,n}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.U$1)),En=function(e){function t(n){var t=this,r=n.token,a=n.limit,i=n.nameKeyword,s=n.urlKeyword,u=n.customTypes,l=n.includeFrozen,h=n.includeMetaData;return (t=e.call(this)||this).method=__bundle7dfccc8c.d.GET,t.path=__bundle7dfccc8c.xe,t.params=__bundle7dfccc8c.U({token:r,limit:a,name_contains:i,url_contains:s,custom_types:u,show_frozen:l,show_metadata:h}),t}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.q),wn=function(e){function t(n,t){var r=e.call(this,n,t)||this;r.token=null,r.channels=[],r.ts=null;var a=t.next,i=t.channels,s=t.ts;return r.token=a,i&&i.length>0&&(r.channels=i.map((function(e){return new gn(n,e)}))),r.ts="number"==typeof s?s:null,r}return __bundle7dfccc8c.t(t,e),t}(__bundle7dfccc8c.F),Tn=function(r){function s(n,e){var t,a,i,s,o,u=this;return (u=r.call(this,n,e)||this).includeFrozen=!0,u.includeMetaData=!0,u.nameKeyword=null,u.urlKeyword=null,u.customTypes=null,u.includeFrozen=null===(t=e.includeFrozen)||void 0===t||t,u.includeMetaData=null===(a=e.includeMetaData)||void 0===a||a,u.nameKeyword=null!==(i=e.nameKeyword)&&void 0!==i?i:null,u.urlKeyword=null!==(s=e.urlKeyword)&&void 0!==s?s:null,u.customTypes=null!==(o=e.customTypes)&&void 0!==o?o:null,u}return __bundle7dfccc8c.t(s,r),s.prototype._validate=function(){return r.prototype._validate.call(this)&&__bundle7dfccc8c.y("boolean",this.includeFrozen)&&__bundle7dfccc8c.y("boolean",this.includeMetaData)&&__bundle7dfccc8c.y("string",this.nameKeyword,!0)&&__bundle7dfccc8c.y("string",this.urlKeyword,!0)&&__bundle7dfccc8c.E("string",this.customTypes,!0)},s.prototype.next=function(){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var n,e,r,a,i,s;return __bundle7dfccc8c.i(this,(function(t){switch(t.label){case 0:return this._validate()?this._isLoading?[3,4]:this._hasNext?(this._isLoading=!0,n=__bundle7dfccc8c.St.of(this._iid).requestQueue,e=new En(__bundle7dfccc8c.n(__bundle7dfccc8c.n({},this),{token:this._token})),[4,n.send(e)]):[3,3]:[3,6];case 1:return r=t.sent(),a=r.as(wn),i=a.channels,s=a.token,this._token=s,this._hasNext=!!s,[4,dn.of(this._iid).upsertChannelsToCache(i)];case 2:return t.sent(),this._isLoading=!1,[2,i];case 3:return [2,[]];case 4:throw __bundle7dfccc8c.p.queryInProgress;case 5:return [3,7];case 6:throw __bundle7dfccc8c.p.invalidParameters;case 7:return [2]}}))}))},s}(__bundle7dfccc8c.bn),Nn=function(r){function a(){var n=null!==r&&r.apply(this,arguments)||this;return n.name="openChannel",n}return __bundle7dfccc8c.t(a,r),a.prototype.init=function(n,e){var t=e.sdkState,a=e.dispatcher,i=e.sessionManager,s=e.requestQueue,o=e.logger,u=e.onlineDetector,c=e.cacheContext;r.prototype.init.call(this,n,{sdkState:t,dispatcher:a,sessionManager:i,requestQueue:s,logger:o,onlineDetector:u,cacheContext:c}),this._manager=new dn(n,{sdkState:t,dispatcher:a,requestQueue:s});},a.prototype.createOpenChannelListQuery=function(n){return void 0===n&&(n={}),new Tn(this._iid,n)},a.prototype.addOpenChannelHandler=function(n,e){this._manager.addHandler(n,e);},a.prototype.removeOpenChannelHandler=function(n){this._manager.removeHandler(n);},a.prototype.removeAllOpenChannelHandlers=function(){this._manager.clearHandler();},a.prototype.buildOpenChannelFromSerializedData=function(n){return this._manager.buildOpenChannelFromSerializedData(n)},a.prototype.getChannel=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,this._manager.getChannel(n)]}))}))},a.prototype.getChannelWithoutCache=function(n){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,this._manager.getChannelWithoutCache(n)]}))}))},a.prototype.createChannel=function(n){return void 0===n&&(n={}),__bundle7dfccc8c.r(this,void 0,void 0,(function(){return __bundle7dfccc8c.i(this,(function(e){return [2,this._manager.createChannel(n)]}))}))},a.prototype.createChannelWithOperatorUserIds=function(n,r,a,i,s){return __bundle7dfccc8c.r(this,void 0,void 0,(function(){var e;return __bundle7dfccc8c.i(this,(function(t){return (e=__bundle7dfccc8c.n({},tn)).name=n,e.coverUrlOrImage=r,e.data=a,e.operatorUserIds=i,e.customType=s,[2,this._manager.createChannel(e)]}))}))},a}(__bundle7dfccc8c.Tt);
|
|
8
|
-
|
|
9
|
-
exports.Fn = Fn;
|
|
10
|
-
exports.Nn = Nn;
|
|
11
|
-
exports.Pe = Pe;
|
|
12
|
-
exports.Un = Un;
|
|
13
|
-
//# sourceMappingURL=openChannel-7272b85b.js.map
|