From 09c9a6ca2bde47a64f41fea665e5d5c2e4d764b8 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Mon, 16 Sep 2019 16:12:43 -0400 Subject: [PATCH] add User type and allow lbryinc types to be used by apps --- .eslintrc.json | 1 + dist/bundle.es.js | 548 +++--- dist/bundle.js | 1697 +++++++++-------- .../redux.js => dist/flow-typed/Redux.js | 1 - .../flow-typed/Subscription.js | 46 +- dist/flow-typed/User.js | 23 + flow-typed/Redux.js | 5 + flow-typed/Subscription.js | 137 ++ flow-typed/User.js | 23 + package.json | 2 + rollup.config.js | 27 +- src/index.js | 3 + src/redux/actions/subscriptions.js | 45 +- src/redux/middleware/sync.js | 58 + src/redux/reducers/subscriptions.js | 14 - webpack.config.js | 3 + yarn.lock | 226 ++- 17 files changed, 1748 insertions(+), 1111 deletions(-) rename src/types/redux.js => dist/flow-typed/Redux.js (72%) rename src/types/subscription.js => dist/flow-typed/Subscription.js (67%) create mode 100644 dist/flow-typed/User.js create mode 100644 flow-typed/Redux.js create mode 100644 flow-typed/Subscription.js create mode 100644 flow-typed/User.js create mode 100644 src/redux/middleware/sync.js diff --git a/.eslintrc.json b/.eslintrc.json index a6129f0..71fe382 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -25,6 +25,7 @@ "import/no-commonjs": "warn", "import/no-amd": "warn", "import/prefer-default-export": "ignore", + "flowtype/generic-spacing": 0, "func-names": ["warn", "as-needed"], "no-plusplus": 0 } diff --git a/dist/bundle.es.js b/dist/bundle.es.js index 9345bad..aeed713 100644 --- a/dist/bundle.es.js +++ b/dist/bundle.es.js @@ -86,9 +86,7 @@ const SET_SYNC_COMPLETED = 'SET_SYNC_COMPLETED'; const SET_DEFAULT_ACCOUNT = 'SET_DEFAULT_ACCOUNT'; const SYNC_APPLY_STARTED = 'SYNC_APPLY_STARTED'; const SYNC_APPLY_COMPLETED = 'SYNC_APPLY_COMPLETED'; -const SYNC_APPLY_FAILED = 'SYNC_APPLY_FAILED'; // User - -const USER_SETTINGS_POPULATE = 'USER_SETTINGS_POPULATE'; +const SYNC_APPLY_FAILED = 'SYNC_APPLY_FAILED'; var action_types = /*#__PURE__*/Object.freeze({ GENERATE_AUTH_TOKEN_FAILURE: GENERATE_AUTH_TOKEN_FAILURE, @@ -161,8 +159,7 @@ var action_types = /*#__PURE__*/Object.freeze({ SET_DEFAULT_ACCOUNT: SET_DEFAULT_ACCOUNT, SYNC_APPLY_STARTED: SYNC_APPLY_STARTED, SYNC_APPLY_COMPLETED: SYNC_APPLY_COMPLETED, - SYNC_APPLY_FAILED: SYNC_APPLY_FAILED, - USER_SETTINGS_POPULATE: USER_SETTINGS_POPULATE + SYNC_APPLY_FAILED: SYNC_APPLY_FAILED }); const Lbryio = { @@ -638,6 +635,273 @@ var subscriptions = handleActions({ }) }, defaultState); +function swapKeyAndValue(dict) { + const ret = {}; // eslint-disable-next-line no-restricted-syntax + + for (const key in dict) { + if (dict.hasOwnProperty(key)) { + ret[dict[key]] = key; + } + } + + return ret; +} + +const selectState = state => state.subscriptions || {}; // Returns the list of channel uris a user is subscribed to + + +const selectSubscriptions = reselect.createSelector(selectState, state => state.subscriptions); // Fetching list of users subscriptions + +const selectIsFetchingSubscriptions = reselect.createSelector(selectState, state => state.loading); // The current view mode on the subscriptions page + +const selectViewMode = reselect.createSelector(selectState, state => state.viewMode); // Suggested subscriptions from internal apis + +const selectSuggested = reselect.createSelector(selectState, state => state.suggested); +const selectIsFetchingSuggested = reselect.createSelector(selectState, state => state.loadingSuggested); +const selectSuggestedChannels = reselect.createSelector(selectSubscriptions, selectSuggested, (userSubscriptions, suggested) => { + if (!suggested) { + return null; + } // Swap the key/value because we will use the uri for everything, this just makes it easier + // suggested is returned from the api with the form: + // { + // featured: { "Channel label": uri, ... }, + // top_subscribed: { "@channel": uri, ... } + // top_bid: { "@channel": uri, ... } + // } + // To properly compare the suggested subscriptions from our current subscribed channels + // We only care about the uri, not the label + // We also only care about top_subscribed and featured + // top_bid could just be porn or a channel with no content + + + const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]); + const featuredSuggestions = swapKeyAndValue(suggested[SUGGESTED_FEATURED]); // Make sure there are no duplicates + // If a uri isn't already in the suggested object, add it + + const suggestedChannels = { ...topSubscribedSuggestions + }; + Object.keys(featuredSuggestions).forEach(uri => { + if (!suggestedChannels[uri]) { + const channelLabel = featuredSuggestions[uri]; + suggestedChannels[uri] = channelLabel; + } + }); + userSubscriptions.forEach(({ + uri + }) => { + // Note to passer bys: + // Maybe we should just remove the `lbry://` prefix from subscription uris + // Most places don't store them like that + const subscribedUri = uri.slice('lbry://'.length); + + if (suggestedChannels[subscribedUri]) { + delete suggestedChannels[subscribedUri]; + } + }); + return Object.keys(suggestedChannels).map(uri => ({ + uri, + label: suggestedChannels[uri] + })).slice(0, 5); +}); +const selectFirstRunCompleted = reselect.createSelector(selectState, state => state.firstRunCompleted); +const selectShowSuggestedSubs = reselect.createSelector(selectState, state => state.showSuggestedSubs); // Fetching any claims that are a part of a users subscriptions + +const selectSubscriptionsBeingFetched = reselect.createSelector(selectSubscriptions, lbryRedux.selectAllFetchingChannelClaims, (subscriptions, fetchingChannelClaims) => { + const fetchingSubscriptionMap = {}; + subscriptions.forEach(sub => { + const isFetching = fetchingChannelClaims && fetchingChannelClaims[sub.uri]; + + if (isFetching) { + fetchingSubscriptionMap[sub.uri] = true; + } + }); + return fetchingSubscriptionMap; +}); +const selectUnreadByChannel = reselect.createSelector(selectState, state => state.unread); // Returns the current total of unread subscriptions + +const selectUnreadAmount = reselect.createSelector(selectUnreadByChannel, unreadByChannel => { + const unreadChannels = Object.keys(unreadByChannel); + let badges = 0; + + if (!unreadChannels.length) { + return badges; + } + + unreadChannels.forEach(channel => { + badges += unreadByChannel[channel].uris.length; + }); + return badges; +}); // Returns the uris with channels as an array with the channel with the newest content first +// If you just want the `unread` state, use selectUnread + +const selectUnreadSubscriptions = reselect.createSelector(selectUnreadAmount, selectUnreadByChannel, lbryRedux.selectClaimsByUri, (unreadAmount, unreadByChannel, claimsByUri) => { + // determine which channel has the newest content + const unreadList = []; + + if (!unreadAmount) { + return unreadList; + } + + const channelUriList = Object.keys(unreadByChannel); // There is only one channel with unread notifications + + if (unreadAmount === 1) { + channelUriList.forEach(channel => { + const unreadChannel = { + channel, + uris: unreadByChannel[channel].uris + }; + unreadList.push(unreadChannel); + }); + return unreadList; + } + + channelUriList.sort((channel1, channel2) => { + const latestUriFromChannel1 = unreadByChannel[channel1].uris[0]; + const latestClaimFromChannel1 = claimsByUri[latestUriFromChannel1] || {}; + const latestUriFromChannel2 = unreadByChannel[channel2].uris[0]; + const latestClaimFromChannel2 = claimsByUri[latestUriFromChannel2] || {}; + const latestHeightFromChannel1 = latestClaimFromChannel1.height || 0; + const latestHeightFromChannel2 = latestClaimFromChannel2.height || 0; + + if (latestHeightFromChannel1 !== latestHeightFromChannel2) { + return latestHeightFromChannel2 - latestHeightFromChannel1; + } + + return 0; + }).forEach(channel => { + const unreadSubscription = unreadByChannel[channel]; + const unreadChannel = { + channel, + uris: unreadSubscription.uris + }; + unreadList.push(unreadChannel); + }); + return unreadList; +}); // Returns all unread subscriptions for a uri passed in + +const makeSelectUnreadByChannel = uri => reselect.createSelector(selectUnreadByChannel, unread => unread[uri]); // Returns the first page of claims for every channel a user is subscribed to + +const selectSubscriptionClaims = reselect.createSelector(lbryRedux.selectAllClaimsByChannel, lbryRedux.selectClaimsById, selectSubscriptions, selectUnreadByChannel, (channelIds, allClaims, savedSubscriptions, unreadByChannel) => { + // no claims loaded yet + if (!Object.keys(channelIds).length) { + return []; + } + + let fetchedSubscriptions = []; + savedSubscriptions.forEach(subscription => { + let channelClaims = []; // if subscribed channel has content + + if (channelIds[subscription.uri] && channelIds[subscription.uri]['1']) { + // This will need to be more robust, we will want to be able to load more than the first page + // Strip out any ids that will be shown as notifications + const pageOneChannelIds = channelIds[subscription.uri]['1']; // we have the channel ids and the corresponding claims + // loop over the list of ids and grab the claim + + pageOneChannelIds.forEach(id => { + const grabbedClaim = allClaims[id]; + + if (unreadByChannel[subscription.uri] && unreadByChannel[subscription.uri].uris.some(uri => uri.includes(id))) { + grabbedClaim.isNew = true; + } + + channelClaims = channelClaims.concat([grabbedClaim]); + }); + } + + fetchedSubscriptions = fetchedSubscriptions.concat(channelClaims); + }); + return fetchedSubscriptions; +}); // Returns true if a user is subscribed to the channel associated with the uri passed in +// Accepts content or channel uris + +const makeSelectIsSubscribed = uri => reselect.createSelector(selectSubscriptions, lbryRedux.makeSelectChannelForClaimUri(uri, true), (subscriptions, channelUri) => { + if (channelUri) { + return subscriptions.some(sub => sub.uri === channelUri); + } // If we couldn't get a channel uri from the claim uri, the uri passed in might be a channel already + + + const { + isChannel + } = lbryRedux.parseURI(uri); + + if (isChannel) { + const uriWithPrefix = uri.startsWith('lbry://') ? uri : `lbry://${uri}`; + return subscriptions.some(sub => sub.uri === uriWithPrefix); + } + + return false; +}); +const makeSelectIsNew = uri => reselect.createSelector(makeSelectIsSubscribed(uri), lbryRedux.makeSelectChannelForClaimUri(uri), selectUnreadByChannel, (isSubscribed, channel, unreadByChannel) => { + if (!isSubscribed) { + return false; + } + + const unreadForChannel = unreadByChannel[`lbry://${channel}`]; + + if (unreadForChannel) { + return unreadForChannel.uris.includes(uri); + } + + return false; // If they are subscribed, check to see if this uri is in the list of unreads +}); +const selectEnabledChannelNotifications = reselect.createSelector(selectState, state => state.enabledChannelNotifications); + +const persistShape = { + version: '0', + shared: {} +}; +function userStateSyncMiddleware() { + return ({ + getState + }) => next => action => { + if (action.type === CHANNEL_SUBSCRIBE || action.type === CHANNEL_UNSUBSCRIBE || action.type === lbryRedux.ACTIONS.TOGGLE_TAG_FOLLOW) { + const newShape = { ...persistShape + }; + const state = getState(); + const subscriptions = selectSubscriptions(state).map(({ + uri + }) => uri); + const tags = lbryRedux.selectFollowedTags(state); + newShape.shared.subscriptions = subscriptions; + newShape.shared.tags = tags; + const { + uri + } = action.data; + + if (action.type === CHANNEL_SUBSCRIBE) { + const newSubscriptions = subscriptions.slice(); + newSubscriptions.push(uri); + newShape.shared.subscriptions = newSubscriptions; + } else if (action.type === CHANNEL_UNSUBSCRIBE) { + let newSubscriptions = subscriptions.slice(); + newSubscriptions = newSubscriptions.filter(subscribedUri => subscribedUri !== uri); + newShape.shared.subscriptions = newSubscriptions; + } else { + const toggledTag = action.data.name; + const followedTags = lbryRedux.selectFollowedTags(state).map(({ + name + }) => name); + const isFollowing = lbryRedux.makeSelectIsFollowingTag(toggledTag)(state); + let newTags = followedTags.slice(); + + if (isFollowing) { + newTags = newTags.filter(followedTag => followedTag.name !== toggledTag); + } else { + newTags.push(toggledTag); + } + + newShape.shared.tags = newTags; + } + + Lbryio.call('user_settings', 'set', { + settings: newShape + }); + } + + return next(action); + }; +} + function doGenerateAuthToken(installationId) { return dispatch => { dispatch({ @@ -668,25 +932,25 @@ function doGenerateAuthToken(installationId) { }; } -const selectState = state => state.rewards || {}; +const selectState$1 = state => state.rewards || {}; -const selectUnclaimedRewardsByType = reselect.createSelector(selectState, state => state.unclaimedRewardsByType); -const selectClaimedRewardsById = reselect.createSelector(selectState, state => state.claimedRewardsById); +const selectUnclaimedRewardsByType = reselect.createSelector(selectState$1, state => state.unclaimedRewardsByType); +const selectClaimedRewardsById = reselect.createSelector(selectState$1, state => state.claimedRewardsById); const selectClaimedRewards = reselect.createSelector(selectClaimedRewardsById, byId => Object.values(byId) || []); const selectClaimedRewardsByTransactionId = reselect.createSelector(selectClaimedRewards, rewards => rewards.reduce((mapParam, reward) => { const map = mapParam; map[reward.transaction_id] = reward; return map; }, {})); -const selectUnclaimedRewards = reselect.createSelector(selectState, state => state.unclaimedRewards); -const selectFetchingRewards = reselect.createSelector(selectState, state => !!state.fetching); +const selectUnclaimedRewards = reselect.createSelector(selectState$1, state => state.unclaimedRewards); +const selectFetchingRewards = reselect.createSelector(selectState$1, state => !!state.fetching); const selectUnclaimedRewardValue = reselect.createSelector(selectUnclaimedRewards, rewards => rewards.reduce((sum, reward) => sum + reward.reward_amount, 0)); -const selectClaimsPendingByType = reselect.createSelector(selectState, state => state.claimPendingByType); +const selectClaimsPendingByType = reselect.createSelector(selectState$1, state => state.claimPendingByType); const selectIsClaimRewardPending = (state, props) => selectClaimsPendingByType(state, props)[props.reward_type]; const makeSelectIsRewardClaimPending = () => reselect.createSelector(selectIsClaimRewardPending, isClaiming => isClaiming); -const selectClaimErrorsByType = reselect.createSelector(selectState, state => state.claimErrorsByType); +const selectClaimErrorsByType = reselect.createSelector(selectState$1, state => state.claimErrorsByType); const selectClaimRewardError = (state, props) => selectClaimErrorsByType(state, props)[props.reward_type]; @@ -696,39 +960,39 @@ const selectRewardByType = (state, rewardType) => selectUnclaimedRewards(state). const makeSelectRewardByType = () => reselect.createSelector(selectRewardByType, reward => reward); const makeSelectRewardAmountByType = () => reselect.createSelector(selectRewardByType, reward => reward ? reward.reward_amount : 0); -const selectRewardContentClaimIds = reselect.createSelector(selectState, state => state.rewardedContentClaimIds); +const selectRewardContentClaimIds = reselect.createSelector(selectState$1, state => state.rewardedContentClaimIds); const selectReferralReward = reselect.createSelector(selectUnclaimedRewards, unclaimedRewards => unclaimedRewards.filter(reward => reward.reward_type === rewards.TYPE_REFERRAL)[0]); -const selectState$1 = state => state.user || {}; -const selectAuthenticationIsPending = reselect.createSelector(selectState$1, state => state.authenticationIsPending); -const selectUserIsPending = reselect.createSelector(selectState$1, state => state.userIsPending); -const selectUser = reselect.createSelector(selectState$1, state => state.user); +const selectState$2 = state => state.user || {}; +const selectAuthenticationIsPending = reselect.createSelector(selectState$2, state => state.authenticationIsPending); +const selectUserIsPending = reselect.createSelector(selectState$2, state => state.userIsPending); +const selectUser = reselect.createSelector(selectState$2, state => state.user); const selectUserEmail = reselect.createSelector(selectUser, user => user ? user.primary_email : null); const selectUserPhone = reselect.createSelector(selectUser, user => user ? user.phone_number : null); const selectUserCountryCode = reselect.createSelector(selectUser, user => user ? user.country_code : null); -const selectEmailToVerify = reselect.createSelector(selectState$1, selectUserEmail, (state, userEmail) => state.emailToVerify || userEmail); -const selectPhoneToVerify = reselect.createSelector(selectState$1, selectUserPhone, (state, userPhone) => state.phoneToVerify || userPhone); +const selectEmailToVerify = reselect.createSelector(selectState$2, selectUserEmail, (state, userEmail) => state.emailToVerify || userEmail); +const selectPhoneToVerify = reselect.createSelector(selectState$2, selectUserPhone, (state, userPhone) => state.phoneToVerify || userPhone); const selectUserIsRewardApproved = reselect.createSelector(selectUser, user => user && user.is_reward_approved); -const selectEmailNewIsPending = reselect.createSelector(selectState$1, state => state.emailNewIsPending); -const selectEmailNewErrorMessage = reselect.createSelector(selectState$1, state => state.emailNewErrorMessage); -const selectPhoneNewErrorMessage = reselect.createSelector(selectState$1, state => state.phoneNewErrorMessage); -const selectEmailVerifyIsPending = reselect.createSelector(selectState$1, state => state.emailVerifyIsPending); -const selectEmailVerifyErrorMessage = reselect.createSelector(selectState$1, state => state.emailVerifyErrorMessage); -const selectPhoneNewIsPending = reselect.createSelector(selectState$1, state => state.phoneNewIsPending); -const selectPhoneVerifyIsPending = reselect.createSelector(selectState$1, state => state.phoneVerifyIsPending); -const selectPhoneVerifyErrorMessage = reselect.createSelector(selectState$1, state => state.phoneVerifyErrorMessage); -const selectIdentityVerifyIsPending = reselect.createSelector(selectState$1, state => state.identityVerifyIsPending); -const selectIdentityVerifyErrorMessage = reselect.createSelector(selectState$1, state => state.identityVerifyErrorMessage); +const selectEmailNewIsPending = reselect.createSelector(selectState$2, state => state.emailNewIsPending); +const selectEmailNewErrorMessage = reselect.createSelector(selectState$2, state => state.emailNewErrorMessage); +const selectPhoneNewErrorMessage = reselect.createSelector(selectState$2, state => state.phoneNewErrorMessage); +const selectEmailVerifyIsPending = reselect.createSelector(selectState$2, state => state.emailVerifyIsPending); +const selectEmailVerifyErrorMessage = reselect.createSelector(selectState$2, state => state.emailVerifyErrorMessage); +const selectPhoneNewIsPending = reselect.createSelector(selectState$2, state => state.phoneNewIsPending); +const selectPhoneVerifyIsPending = reselect.createSelector(selectState$2, state => state.phoneVerifyIsPending); +const selectPhoneVerifyErrorMessage = reselect.createSelector(selectState$2, state => state.phoneVerifyErrorMessage); +const selectIdentityVerifyIsPending = reselect.createSelector(selectState$2, state => state.identityVerifyIsPending); +const selectIdentityVerifyErrorMessage = reselect.createSelector(selectState$2, state => state.identityVerifyErrorMessage); const selectUserVerifiedEmail = reselect.createSelector(selectUser, user => user && user.has_verified_email); const selectUserIsVerificationCandidate = reselect.createSelector(selectUser, user => user && (!user.has_verified_email || !user.is_identity_verified)); -const selectAccessToken = reselect.createSelector(selectState$1, state => state.accessToken); -const selectUserInviteStatusIsPending = reselect.createSelector(selectState$1, state => state.inviteStatusIsPending); -const selectUserInvitesRemaining = reselect.createSelector(selectState$1, state => state.invitesRemaining); -const selectUserInvitees = reselect.createSelector(selectState$1, state => state.invitees); +const selectAccessToken = reselect.createSelector(selectState$2, state => state.accessToken); +const selectUserInviteStatusIsPending = reselect.createSelector(selectState$2, state => state.inviteStatusIsPending); +const selectUserInvitesRemaining = reselect.createSelector(selectState$2, state => state.invitesRemaining); +const selectUserInvitees = reselect.createSelector(selectState$2, state => state.invitees); const selectUserInviteStatusFailed = reselect.createSelector(selectUserInvitesRemaining, () => selectUserInvitesRemaining === null); -const selectUserInviteNewIsPending = reselect.createSelector(selectState$1, state => state.inviteNewIsPending); -const selectUserInviteNewErrorMessage = reselect.createSelector(selectState$1, state => state.inviteNewErrorMessage); -const selectUserInviteReferralLink = reselect.createSelector(selectState$1, state => state.referralLink); +const selectUserInviteNewIsPending = reselect.createSelector(selectState$2, state => state.inviteNewIsPending); +const selectUserInviteNewErrorMessage = reselect.createSelector(selectState$2, state => state.inviteNewErrorMessage); +const selectUserInviteReferralLink = reselect.createSelector(selectState$2, state => state.referralLink); function doFetchInviteStatus() { return dispatch => { @@ -1263,217 +1527,6 @@ function doFetchRewardedContent() { const PAGE_SIZE = 20; -function swapKeyAndValue(dict) { - const ret = {}; // eslint-disable-next-line no-restricted-syntax - - for (const key in dict) { - if (dict.hasOwnProperty(key)) { - ret[dict[key]] = key; - } - } - - return ret; -} - -const selectState$2 = state => state.subscriptions || {}; // Returns the list of channel uris a user is subscribed to - - -const selectSubscriptions = reselect.createSelector(selectState$2, state => state.subscriptions); // Fetching list of users subscriptions - -const selectIsFetchingSubscriptions = reselect.createSelector(selectState$2, state => state.loading); // The current view mode on the subscriptions page - -const selectViewMode = reselect.createSelector(selectState$2, state => state.viewMode); // Suggested subscriptions from internal apis - -const selectSuggested = reselect.createSelector(selectState$2, state => state.suggested); -const selectIsFetchingSuggested = reselect.createSelector(selectState$2, state => state.loadingSuggested); -const selectSuggestedChannels = reselect.createSelector(selectSubscriptions, selectSuggested, (userSubscriptions, suggested) => { - if (!suggested) { - return null; - } // Swap the key/value because we will use the uri for everything, this just makes it easier - // suggested is returned from the api with the form: - // { - // featured: { "Channel label": uri, ... }, - // top_subscribed: { "@channel": uri, ... } - // top_bid: { "@channel": uri, ... } - // } - // To properly compare the suggested subscriptions from our current subscribed channels - // We only care about the uri, not the label - // We also only care about top_subscribed and featured - // top_bid could just be porn or a channel with no content - - - const topSubscribedSuggestions = swapKeyAndValue(suggested[SUGGESTED_TOP_SUBSCRIBED]); - const featuredSuggestions = swapKeyAndValue(suggested[SUGGESTED_FEATURED]); // Make sure there are no duplicates - // If a uri isn't already in the suggested object, add it - - const suggestedChannels = { ...topSubscribedSuggestions - }; - Object.keys(featuredSuggestions).forEach(uri => { - if (!suggestedChannels[uri]) { - const channelLabel = featuredSuggestions[uri]; - suggestedChannels[uri] = channelLabel; - } - }); - userSubscriptions.forEach(({ - uri - }) => { - // Note to passer bys: - // Maybe we should just remove the `lbry://` prefix from subscription uris - // Most places don't store them like that - const subscribedUri = uri.slice('lbry://'.length); - - if (suggestedChannels[subscribedUri]) { - delete suggestedChannels[subscribedUri]; - } - }); - return Object.keys(suggestedChannels).map(uri => ({ - uri, - label: suggestedChannels[uri] - })).slice(0, 5); -}); -const selectFirstRunCompleted = reselect.createSelector(selectState$2, state => state.firstRunCompleted); -const selectShowSuggestedSubs = reselect.createSelector(selectState$2, state => state.showSuggestedSubs); // Fetching any claims that are a part of a users subscriptions - -const selectSubscriptionsBeingFetched = reselect.createSelector(selectSubscriptions, lbryRedux.selectAllFetchingChannelClaims, (subscriptions, fetchingChannelClaims) => { - const fetchingSubscriptionMap = {}; - subscriptions.forEach(sub => { - const isFetching = fetchingChannelClaims && fetchingChannelClaims[sub.uri]; - - if (isFetching) { - fetchingSubscriptionMap[sub.uri] = true; - } - }); - return fetchingSubscriptionMap; -}); -const selectUnreadByChannel = reselect.createSelector(selectState$2, state => state.unread); // Returns the current total of unread subscriptions - -const selectUnreadAmount = reselect.createSelector(selectUnreadByChannel, unreadByChannel => { - const unreadChannels = Object.keys(unreadByChannel); - let badges = 0; - - if (!unreadChannels.length) { - return badges; - } - - unreadChannels.forEach(channel => { - badges += unreadByChannel[channel].uris.length; - }); - return badges; -}); // Returns the uris with channels as an array with the channel with the newest content first -// If you just want the `unread` state, use selectUnread - -const selectUnreadSubscriptions = reselect.createSelector(selectUnreadAmount, selectUnreadByChannel, lbryRedux.selectClaimsByUri, (unreadAmount, unreadByChannel, claimsByUri) => { - // determine which channel has the newest content - const unreadList = []; - - if (!unreadAmount) { - return unreadList; - } - - const channelUriList = Object.keys(unreadByChannel); // There is only one channel with unread notifications - - if (unreadAmount === 1) { - channelUriList.forEach(channel => { - const unreadChannel = { - channel, - uris: unreadByChannel[channel].uris - }; - unreadList.push(unreadChannel); - }); - return unreadList; - } - - channelUriList.sort((channel1, channel2) => { - const latestUriFromChannel1 = unreadByChannel[channel1].uris[0]; - const latestClaimFromChannel1 = claimsByUri[latestUriFromChannel1] || {}; - const latestUriFromChannel2 = unreadByChannel[channel2].uris[0]; - const latestClaimFromChannel2 = claimsByUri[latestUriFromChannel2] || {}; - const latestHeightFromChannel1 = latestClaimFromChannel1.height || 0; - const latestHeightFromChannel2 = latestClaimFromChannel2.height || 0; - - if (latestHeightFromChannel1 !== latestHeightFromChannel2) { - return latestHeightFromChannel2 - latestHeightFromChannel1; - } - - return 0; - }).forEach(channel => { - const unreadSubscription = unreadByChannel[channel]; - const unreadChannel = { - channel, - uris: unreadSubscription.uris - }; - unreadList.push(unreadChannel); - }); - return unreadList; -}); // Returns all unread subscriptions for a uri passed in - -const makeSelectUnreadByChannel = uri => reselect.createSelector(selectUnreadByChannel, unread => unread[uri]); // Returns the first page of claims for every channel a user is subscribed to - -const selectSubscriptionClaims = reselect.createSelector(lbryRedux.selectAllClaimsByChannel, lbryRedux.selectClaimsById, selectSubscriptions, selectUnreadByChannel, (channelIds, allClaims, savedSubscriptions, unreadByChannel) => { - // no claims loaded yet - if (!Object.keys(channelIds).length) { - return []; - } - - let fetchedSubscriptions = []; - savedSubscriptions.forEach(subscription => { - let channelClaims = []; // if subscribed channel has content - - if (channelIds[subscription.uri] && channelIds[subscription.uri]['1']) { - // This will need to be more robust, we will want to be able to load more than the first page - // Strip out any ids that will be shown as notifications - const pageOneChannelIds = channelIds[subscription.uri]['1']; // we have the channel ids and the corresponding claims - // loop over the list of ids and grab the claim - - pageOneChannelIds.forEach(id => { - const grabbedClaim = allClaims[id]; - - if (unreadByChannel[subscription.uri] && unreadByChannel[subscription.uri].uris.some(uri => uri.includes(id))) { - grabbedClaim.isNew = true; - } - - channelClaims = channelClaims.concat([grabbedClaim]); - }); - } - - fetchedSubscriptions = fetchedSubscriptions.concat(channelClaims); - }); - return fetchedSubscriptions; -}); // Returns true if a user is subscribed to the channel associated with the uri passed in -// Accepts content or channel uris - -const makeSelectIsSubscribed = uri => reselect.createSelector(selectSubscriptions, lbryRedux.makeSelectChannelForClaimUri(uri, true), (subscriptions, channelUri) => { - if (channelUri) { - return subscriptions.some(sub => sub.uri === channelUri); - } // If we couldn't get a channel uri from the claim uri, the uri passed in might be a channel already - - - const { - isChannel - } = lbryRedux.parseURI(uri); - - if (isChannel) { - const uriWithPrefix = uri.startsWith('lbry://') ? uri : `lbry://${uri}`; - return subscriptions.some(sub => sub.uri === uriWithPrefix); - } - - return false; -}); -const makeSelectIsNew = uri => reselect.createSelector(makeSelectIsSubscribed(uri), lbryRedux.makeSelectChannelForClaimUri(uri), selectUnreadByChannel, (isSubscribed, channel, unreadByChannel) => { - if (!isSubscribed) { - return false; - } - - const unreadForChannel = unreadByChannel[`lbry://${channel}`]; - - if (unreadForChannel) { - return unreadForChannel.uris.includes(uri); - } - - return false; // If they are subscribed, check to see if this uri is in the list of unreads -}); -const selectEnabledChannelNotifications = reselect.createSelector(selectState$2, state => state.enabledChannelNotifications); - // const CHECK_SUBSCRIPTIONS_INTERVAL = 15 * 60 * 1000; const doSetViewMode = viewMode => dispatch => dispatch({ @@ -2998,3 +3051,4 @@ exports.statsReducer = statsReducer; exports.subscriptionsReducer = subscriptions; exports.syncReducer = syncReducer; exports.userReducer = userReducer; +exports.userStateSyncMiddleware = userStateSyncMiddleware; diff --git a/dist/bundle.js b/dist/bundle.js index bbd0069..446c6e0 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -111,320 +111,327 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var redux_reducers_subscriptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8); /* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "subscriptionsReducer", function() { return redux_reducers_subscriptions__WEBPACK_IMPORTED_MODULE_3__["default"]; }); -/* harmony import */ var redux_actions_auth__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return redux_actions_auth__WEBPACK_IMPORTED_MODULE_4__["doGenerateAuthToken"]; }); +/* harmony import */ var redux_middleware_sync__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(11); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userStateSyncMiddleware", function() { return redux_middleware_sync__WEBPACK_IMPORTED_MODULE_4__["userStateSyncMiddleware"]; }); -/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(12); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRewardList", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_5__["doRewardList"]; }); +/* harmony import */ var redux_actions_auth__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(15); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return redux_actions_auth__WEBPACK_IMPORTED_MODULE_5__["doGenerateAuthToken"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardType", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_5__["doClaimRewardType"]; }); +/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(16); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRewardList", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doRewardList"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_5__["doClaimEligiblePurchaseRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardType", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doClaimRewardType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_5__["doClaimRewardClearError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doClaimEligiblePurchaseRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_5__["doFetchRewardedContent"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doClaimRewardClearError"]; }); -/* harmony import */ var redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(17); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doChannelSubscribe"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return redux_actions_rewards__WEBPACK_IMPORTED_MODULE_6__["doFetchRewardedContent"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelUnsubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doChannelUnsubscribe"]; }); +/* harmony import */ var redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(20); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelSubscribe"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionEnableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doChannelSubscriptionEnableNotifications"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelUnsubscribe", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelUnsubscribe"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionDisableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doChannelSubscriptionDisableNotifications"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionEnableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelSubscriptionEnableNotifications"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doCheckSubscription"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionDisableNotifications", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doChannelSubscriptionDisableNotifications"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doCheckSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCheckSubscription"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptionsInit", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doCheckSubscriptionsInit"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCheckSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCompleteFirstRun", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doCompleteFirstRun"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSubscriptionsInit", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCheckSubscriptionsInit"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchMySubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doFetchMySubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCompleteFirstRun", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doCompleteFirstRun"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRecommendedSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doFetchRecommendedSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchMySubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doFetchMySubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doRemoveUnreadSubscription"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchRecommendedSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doFetchRecommendedSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doRemoveUnreadSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscription", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doRemoveUnreadSubscription"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetViewMode", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doSetViewMode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doRemoveUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doRemoveUnreadSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doShowSuggestedSubs", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doShowSuggestedSubs"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetViewMode", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doSetViewMode"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUpdateUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["doUpdateUnreadSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doShowSuggestedSubs", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doShowSuggestedSubs"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSubscriptionLatest", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_6__["setSubscriptionLatest"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUpdateUnreadSubscriptions", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["doUpdateUnreadSubscriptions"]; }); -/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(16); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchInviteStatus", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doFetchInviteStatus"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "setSubscriptionLatest", function() { return redux_actions_subscriptions__WEBPACK_IMPORTED_MODULE_7__["setSubscriptionLatest"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doInstallNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doInstallNew"]; }); +/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(19); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchInviteStatus", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doFetchInviteStatus"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doAuthenticate", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doAuthenticate"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doInstallNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doInstallNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserFetch", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserFetch"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doAuthenticate", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doAuthenticate"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserEmailNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserFetch", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserFetch"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserCheckEmailVerified", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserCheckEmailVerified"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailToVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserEmailToVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserCheckEmailVerified", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserCheckEmailVerified"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserEmailVerifyFailure"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailToVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailToVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserEmailVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailVerifyFailure"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserPhoneNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserEmailVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserEmailVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneReset", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserPhoneReset"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserPhoneVerifyFailure"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneReset", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneReset"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserPhoneVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerifyFailure", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneVerifyFailure"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchAccessToken", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doFetchAccessToken"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserPhoneVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserPhoneVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserResendVerificationEmail", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserResendVerificationEmail"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchAccessToken", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doFetchAccessToken"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserIdentityVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserIdentityVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserResendVerificationEmail", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserResendVerificationEmail"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserInviteNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_7__["doUserInviteNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserIdentityVerify", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserIdentityVerify"]; }); -/* harmony import */ var redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(21); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchCostInfoForUri", function() { return redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_8__["doFetchCostInfoForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doUserInviteNew", function() { return redux_actions_user__WEBPACK_IMPORTED_MODULE_8__["doUserInviteNew"]; }); -/* harmony import */ var redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doBlackListedOutpointsSubscribe", function() { return redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_9__["doBlackListedOutpointsSubscribe"]; }); +/* harmony import */ var redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(22); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchCostInfoForUri", function() { return redux_actions_cost_info__WEBPACK_IMPORTED_MODULE_9__["doFetchCostInfoForUri"]; }); -/* harmony import */ var redux_actions_filtered__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFilteredOutpointsSubscribe", function() { return redux_actions_filtered__WEBPACK_IMPORTED_MODULE_10__["doFilteredOutpointsSubscribe"]; }); +/* harmony import */ var redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(23); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doBlackListedOutpointsSubscribe", function() { return redux_actions_blacklist__WEBPACK_IMPORTED_MODULE_10__["doBlackListedOutpointsSubscribe"]; }); -/* harmony import */ var redux_actions_homepage__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchFeaturedUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_11__["doFetchFeaturedUris"]; }); +/* harmony import */ var redux_actions_filtered__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(24); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFilteredOutpointsSubscribe", function() { return redux_actions_filtered__WEBPACK_IMPORTED_MODULE_11__["doFilteredOutpointsSubscribe"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchTrendingUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_11__["doFetchTrendingUris"]; }); +/* harmony import */ var redux_actions_homepage__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(25); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchFeaturedUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_12__["doFetchFeaturedUris"]; }); -/* harmony import */ var redux_actions_stats__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(25); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchViewCount", function() { return redux_actions_stats__WEBPACK_IMPORTED_MODULE_12__["doFetchViewCount"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchTrendingUris", function() { return redux_actions_homepage__WEBPACK_IMPORTED_MODULE_12__["doFetchTrendingUris"]; }); -/* harmony import */ var redux_actions_sync__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(26); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_13__["doCheckSync"]; }); +/* harmony import */ var redux_actions_stats__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(26); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doFetchViewCount", function() { return redux_actions_stats__WEBPACK_IMPORTED_MODULE_13__["doFetchViewCount"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_13__["doGetSync"]; }); +/* harmony import */ var redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(27); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doCheckSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doCheckSync"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_13__["doSetSync"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doGetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doGetSync"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetDefaultAccount", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_13__["doSetDefaultAccount"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetSync", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doSetSync"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_13__["doSyncApply"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSetDefaultAccount", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doSetDefaultAccount"]; }); -/* harmony import */ var redux_reducers_auth__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(27); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "authReducer", function() { return redux_reducers_auth__WEBPACK_IMPORTED_MODULE_14__["authReducer"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "doSyncApply", function() { return redux_actions_sync__WEBPACK_IMPORTED_MODULE_14__["doSyncApply"]; }); -/* harmony import */ var redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rewardsReducer", function() { return redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_15__["rewardsReducer"]; }); +/* harmony import */ var redux_reducers_auth__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(28); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "authReducer", function() { return redux_reducers_auth__WEBPACK_IMPORTED_MODULE_15__["authReducer"]; }); -/* harmony import */ var redux_reducers_user__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userReducer", function() { return redux_reducers_user__WEBPACK_IMPORTED_MODULE_16__["userReducer"]; }); +/* harmony import */ var redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(29); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "rewardsReducer", function() { return redux_reducers_rewards__WEBPACK_IMPORTED_MODULE_16__["rewardsReducer"]; }); -/* harmony import */ var redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(30); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "costInfoReducer", function() { return redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_17__["costInfoReducer"]; }); +/* harmony import */ var redux_reducers_user__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(30); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "userReducer", function() { return redux_reducers_user__WEBPACK_IMPORTED_MODULE_17__["userReducer"]; }); -/* harmony import */ var redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(31); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blacklistReducer", function() { return redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_18__["blacklistReducer"]; }); +/* harmony import */ var redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(31); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "costInfoReducer", function() { return redux_reducers_cost_info__WEBPACK_IMPORTED_MODULE_18__["costInfoReducer"]; }); -/* harmony import */ var redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(32); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filteredReducer", function() { return redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_19__["filteredReducer"]; }); +/* harmony import */ var redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(32); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "blacklistReducer", function() { return redux_reducers_blacklist__WEBPACK_IMPORTED_MODULE_19__["blacklistReducer"]; }); -/* harmony import */ var redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(33); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "homepageReducer", function() { return redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_20__["homepageReducer"]; }); +/* harmony import */ var redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(33); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "filteredReducer", function() { return redux_reducers_filtered__WEBPACK_IMPORTED_MODULE_20__["filteredReducer"]; }); -/* harmony import */ var redux_reducers_stats__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(34); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "statsReducer", function() { return redux_reducers_stats__WEBPACK_IMPORTED_MODULE_21__["statsReducer"]; }); +/* harmony import */ var redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(34); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "homepageReducer", function() { return redux_reducers_homepage__WEBPACK_IMPORTED_MODULE_21__["homepageReducer"]; }); -/* harmony import */ var redux_reducers_sync__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(35); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "syncReducer", function() { return redux_reducers_sync__WEBPACK_IMPORTED_MODULE_22__["syncReducer"]; }); +/* harmony import */ var redux_reducers_stats__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(35); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "statsReducer", function() { return redux_reducers_stats__WEBPACK_IMPORTED_MODULE_22__["statsReducer"]; }); -/* harmony import */ var redux_selectors_auth__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(36); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthToken", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_23__["selectAuthToken"]; }); +/* harmony import */ var redux_reducers_sync__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(36); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "syncReducer", function() { return redux_reducers_sync__WEBPACK_IMPORTED_MODULE_23__["syncReducer"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsAuthenticating", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_23__["selectIsAuthenticating"]; }); +/* harmony import */ var redux_selectors_auth__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(37); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthToken", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_24__["selectAuthToken"]; }); -/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(13); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectClaimRewardError", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["makeSelectClaimRewardError"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsAuthenticating", function() { return redux_selectors_auth__WEBPACK_IMPORTED_MODULE_24__["selectIsAuthenticating"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsRewardClaimPending", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["makeSelectIsRewardClaimPending"]; }); +/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(17); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectClaimRewardError", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectClaimRewardError"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["makeSelectRewardAmountByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsRewardClaimPending", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectIsRewardClaimPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["makeSelectRewardByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectRewardAmountByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectUnclaimedRewardsByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["makeSelectRewardByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsById", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectClaimedRewardsById"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectUnclaimedRewardsByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectClaimedRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsById", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimedRewardsById"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsByTransactionId", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectClaimedRewardsByTransactionId"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimedRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectUnclaimedRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsByTransactionId", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimedRewardsByTransactionId"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectFetchingRewards"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectUnclaimedRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardValue", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectUnclaimedRewardValue"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingRewards", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectFetchingRewards"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimsPendingByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectClaimsPendingByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardValue", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectUnclaimedRewardValue"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimErrorsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectClaimErrorsByType"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimsPendingByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimsPendingByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectRewardContentClaimIds"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectClaimErrorsByType", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectClaimErrorsByType"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_24__["selectReferralReward"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectRewardContentClaimIds"]; }); -/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(19); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["makeSelectIsNew"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_25__["selectReferralReward"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["makeSelectIsSubscribed"]; }); +/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(12); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["makeSelectIsNew"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["makeSelectUnreadByChannel"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["makeSelectIsSubscribed"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectEnabledChannelNotifications"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["makeSelectUnreadByChannel"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectEnabledChannelNotifications"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectIsFetchingSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectViewMode", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectViewMode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectIsFetchingSubscriptions"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectSuggested"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectViewMode", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectViewMode"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectIsFetchingSuggested"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSuggested"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggestedChannels", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectSuggestedChannels"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSuggested", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectIsFetchingSuggested"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFirstRunCompleted", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectFirstRunCompleted"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSuggestedChannels", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSuggestedChannels"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectShowSuggestedSubs", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectShowSuggestedSubs"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFirstRunCompleted", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectFirstRunCompleted"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionsBeingFetched", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectSubscriptionsBeingFetched"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectShowSuggestedSubs", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectShowSuggestedSubs"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectUnreadByChannel"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionsBeingFetched", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSubscriptionsBeingFetched"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadAmount", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectUnreadAmount"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadByChannel", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectUnreadByChannel"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectUnreadSubscriptions"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadAmount", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectUnreadAmount"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionClaims", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_25__["selectSubscriptionClaims"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUnreadSubscriptions", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectUnreadSubscriptions"]; }); -/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(15); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthenticationIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectAuthenticationIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionClaims", function() { return redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_26__["selectSubscriptionClaims"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserIsPending"]; }); +/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(18); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAuthenticationIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectAuthenticationIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUser", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUser"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserEmail"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUser", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUser"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserPhone", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserPhone"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserEmail"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserCountryCode", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserCountryCode"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserPhone", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserPhone"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectEmailToVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserCountryCode", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserCountryCode"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectPhoneToVerify"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailToVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsRewardApproved", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserIsRewardApproved"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneToVerify", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneToVerify"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectEmailNewIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsRewardApproved", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserIsRewardApproved"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectEmailNewErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailNewIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectPhoneNewErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailNewErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectPhoneNewIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneNewErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectEmailVerifyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneNewIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectEmailVerifyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailVerifyIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectPhoneVerifyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectEmailVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectEmailVerifyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectPhoneVerifyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneVerifyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectIdentityVerifyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectPhoneVerifyIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectIdentityVerifyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectIdentityVerifyIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsVerificationCandidate", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserIsVerificationCandidate"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectIdentityVerifyErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAccessToken", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectAccessToken"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserIsVerificationCandidate", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserIsVerificationCandidate"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInviteStatusIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAccessToken", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectAccessToken"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitesRemaining", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInvitesRemaining"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteStatusIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitees", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInvitees"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitesRemaining", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInvitesRemaining"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusFailed", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInviteStatusFailed"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInvitees", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInvitees"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInviteNewIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusFailed", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteStatusFailed"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInviteNewErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewIsPending", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteNewIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteReferralLink", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_26__["selectUserInviteReferralLink"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewErrorMessage", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteNewErrorMessage"]; }); -/* harmony import */ var redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(37); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_27__["makeSelectFetchingCostInfoForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteReferralLink", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserInviteReferralLink"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_27__["makeSelectCostInfoForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectUserVerifiedEmail", function() { return redux_selectors_user__WEBPACK_IMPORTED_MODULE_27__["selectUserVerifiedEmail"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAllCostInfoByUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_27__["selectAllCostInfoByUri"]; }); +/* harmony import */ var redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(38); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["makeSelectFetchingCostInfoForUri"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingCostInfo", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_27__["selectFetchingCostInfo"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectCostInfoForUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["makeSelectCostInfoForUri"]; }); -/* harmony import */ var redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(38); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectBlackListedOutpoints", function() { return redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_28__["selectBlackListedOutpoints"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectAllCostInfoByUri", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["selectAllCostInfoByUri"]; }); -/* harmony import */ var redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(39); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFilteredOutpoints", function() { return redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_29__["selectFilteredOutpoints"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingCostInfo", function() { return redux_selectors_cost_info__WEBPACK_IMPORTED_MODULE_28__["selectFetchingCostInfo"]; }); -/* harmony import */ var redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(40); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_30__["selectFeaturedUris"]; }); +/* harmony import */ var redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(39); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectBlackListedOutpoints", function() { return redux_selectors_blacklist__WEBPACK_IMPORTED_MODULE_29__["selectBlackListedOutpoints"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_30__["selectFetchingFeaturedUris"]; }); +/* harmony import */ var redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(40); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFilteredOutpoints", function() { return redux_selectors_filtered__WEBPACK_IMPORTED_MODULE_30__["selectFilteredOutpoints"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_30__["selectTrendingUris"]; }); +/* harmony import */ var redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(41); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectFeaturedUris"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_30__["selectFetchingTrendingUris"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingFeaturedUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectFetchingFeaturedUris"]; }); -/* harmony import */ var redux_selectors_stats__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(41); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectViewCountForUri", function() { return redux_selectors_stats__WEBPACK_IMPORTED_MODULE_31__["makeSelectViewCountForUri"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectTrendingUris"]; }); -/* harmony import */ var redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(42); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHasSyncedWallet", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectHasSyncedWallet"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectFetchingTrendingUris", function() { return redux_selectors_homepage__WEBPACK_IMPORTED_MODULE_31__["selectFetchingTrendingUris"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncData", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectSyncData"]; }); +/* harmony import */ var redux_selectors_stats__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(42); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "makeSelectViewCountForUri", function() { return redux_selectors_stats__WEBPACK_IMPORTED_MODULE_32__["makeSelectViewCountForUri"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncHash", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectSyncHash"]; }); +/* harmony import */ var redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(43); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHasSyncedWallet", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectHasSyncedWallet"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectSetSyncErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncData", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncData"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectGetSyncIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncHash", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncHash"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectSetSyncIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSetSyncErrorMessage"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectSyncApplyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectGetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectGetSyncIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHashChanged", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectHashChanged"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSetSyncIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSetSyncIsPending"]; }); -/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_32__["selectSyncApplyErrorMessage"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyIsPending", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncApplyIsPending"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectHashChanged", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectHashChanged"]; }); +/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyErrorMessage", function() { return redux_selectors_sync__WEBPACK_IMPORTED_MODULE_33__["selectSyncApplyErrorMessage"]; }); + + + // middleware + // constants // Lbryio and rewards @@ -632,6 +639,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(4); /* harmony import */ var querystring__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(querystring__WEBPACK_IMPORTED_MODULE_2__); +function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } + function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } @@ -693,6 +702,13 @@ Lbryio.call = function (resource, action) { auth_token: token }, params); + Object.keys(fullParams).forEach(function (key) { + var value = fullParams[key]; + + if (_typeof(value) === 'object') { + fullParams[key] = JSON.stringify(value); + } + }); var qs = querystring__WEBPACK_IMPORTED_MODULE_2___default.a.stringify(fullParams); var url = "".concat(Lbryio.CONNECTION_STRING).concat(resource, "/").concat(action, "?").concat(qs); var options = { @@ -1079,7 +1095,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope var rewards = {}; rewards.TYPE_NEW_DEVELOPER = 'new_developer'; rewards.TYPE_NEW_USER = 'new_user'; -rewards.TYPE_CONFIRM_EMAIL = 'verified_email'; +rewards.TYPE_CONFIRM_EMAIL = 'email_provided'; rewards.TYPE_FIRST_CHANNEL = 'new_channel'; rewards.TYPE_FIRST_STREAM = 'first_stream'; rewards.TYPE_MANY_DOWNLOADS = 'many_downloads'; @@ -1391,38 +1407,81 @@ var handleActions = function handleActions(actionMap, defaultState) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return doGenerateAuthToken; }); -/* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "userStateSyncMiddleware", function() { return userStateSyncMiddleware; }); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); +/* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1); +/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(12); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function doGenerateAuthToken(installationId) { - return function (dispatch) { - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_STARTED"] - }); - lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('user', 'new', { - auth_token: '', - language: 'en', - app_id: installationId - }, 'post').then(function (response) { - if (!response.auth_token) { - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_FAILURE"] - }); - } else { - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_SUCCESS"], - data: { - authToken: response.auth_token + + + +var persistShape = { + version: '0', + shared: {} +}; +function userStateSyncMiddleware() { + return function (_ref) { + var getState = _ref.getState; + return function (next) { + return function (action) { + if (action.type === constants_action_types__WEBPACK_IMPORTED_MODULE_2__["CHANNEL_SUBSCRIBE"] || action.type === constants_action_types__WEBPACK_IMPORTED_MODULE_2__["CHANNEL_UNSUBSCRIBE"] || action.type === lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].TOGGLE_TAG_FOLLOW) { + var newShape = _objectSpread({}, persistShape); + + var state = getState(); + var subscriptions = Object(redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_3__["selectSubscriptions"])(state).map(function (_ref2) { + var uri = _ref2.uri; + return uri; + }); + var tags = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_0__["selectFollowedTags"])(state); + newShape.shared.subscriptions = subscriptions; + newShape.shared.tags = tags; + var uri = action.data.uri; + + if (action.type === constants_action_types__WEBPACK_IMPORTED_MODULE_2__["CHANNEL_SUBSCRIBE"]) { + var newSubscriptions = subscriptions.slice(); + newSubscriptions.push(uri); + newShape.shared.subscriptions = newSubscriptions; + } else if (action.type === constants_action_types__WEBPACK_IMPORTED_MODULE_2__["CHANNEL_UNSUBSCRIBE"]) { + var _newSubscriptions = subscriptions.slice(); + + _newSubscriptions = _newSubscriptions.filter(function (subscribedUri) { + return subscribedUri !== uri; + }); + newShape.shared.subscriptions = _newSubscriptions; + } else { + var toggledTag = action.data.name; + var followedTags = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_0__["selectFollowedTags"])(state).map(function (_ref3) { + var name = _ref3.name; + return name; + }); + var isFollowing = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_0__["makeSelectIsFollowingTag"])(toggledTag)(state); + var newTags = followedTags.slice(); + + if (isFollowing) { + newTags = newTags.filter(function (followedTag) { + return followedTag.name !== toggledTag; + }); + } else { + newTags.push(toggledTag); + } + + newShape.shared.tags = newTags; } - }); - } - })["catch"](function () { - dispatch({ - type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_FAILURE"] - }); - }); + + lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('user_settings', 'set', { + settings: newShape + }); + } + + return next(action); + }; + }; }; } @@ -1432,293 +1491,273 @@ function doGenerateAuthToken(installationId) { "use strict"; __webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doRewardList", function() { return doRewardList; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardType", function() { return doClaimRewardType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return doClaimEligiblePurchaseRewards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return doClaimRewardClearError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return doFetchRewardedContent; }); -/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(13); -/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(15); -/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(16); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptions", function() { return selectSubscriptions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSubscriptions", function() { return selectIsFetchingSubscriptions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectViewMode", function() { return selectViewMode; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSuggested", function() { return selectSuggested; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSuggested", function() { return selectIsFetchingSuggested; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSuggestedChannels", function() { return selectSuggestedChannels; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFirstRunCompleted", function() { return selectFirstRunCompleted; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectShowSuggestedSubs", function() { return selectShowSuggestedSubs; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionsBeingFetched", function() { return selectSubscriptionsBeingFetched; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnreadByChannel", function() { return selectUnreadByChannel; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnreadAmount", function() { return selectUnreadAmount; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnreadSubscriptions", function() { return selectUnreadSubscriptions; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectUnreadByChannel", function() { return makeSelectUnreadByChannel; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionClaims", function() { return selectSubscriptionClaims; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return makeSelectIsSubscribed; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return makeSelectIsNew; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return selectEnabledChannelNotifications; }); +/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_2__); +/* harmony import */ var util_swap_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(14); +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } + +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } + // Returns the entire subscriptions state + +var selectState = function selectState(state) { + return state.subscriptions || {}; +}; // Returns the list of channel uris a user is subscribed to -function doRewardList() { - return function (dispatch) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARDS_STARTED - }); - lbryio__WEBPACK_IMPORTED_MODULE_0__["default"].call('reward', 'list', { - multiple_rewards_per_type: true - }).then(function (userRewards) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARDS_COMPLETED, - data: { - userRewards: userRewards - } - }); - })["catch"](function () { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARDS_COMPLETED, - data: { - userRewards: [] - } - }); - }); - }; -} -function doClaimRewardType(rewardType) { - var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; - return function (dispatch, getState) { - var state = getState(); - var userIsRewardApproved = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectUserIsRewardApproved"])(state); - var unclaimedRewards = Object(redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__["selectUnclaimedRewards"])(state); - var reward = rewardType === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE ? { - reward_type: rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE - } : unclaimedRewards.find(function (ur) { - return ur.reward_type === rewardType; +var selectSubscriptions = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.subscriptions; +}); // Fetching list of users subscriptions + +var selectIsFetchingSubscriptions = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.loading; +}); // The current view mode on the subscriptions page + +var selectViewMode = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.viewMode; +}); // Suggested subscriptions from internal apis + +var selectSuggested = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.suggested; +}); +var selectIsFetchingSuggested = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.loadingSuggested; +}); +var selectSuggestedChannels = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectSubscriptions, selectSuggested, function (userSubscriptions, suggested) { + if (!suggested) { + return null; + } // Swap the key/value because we will use the uri for everything, this just makes it easier + // suggested is returned from the api with the form: + // { + // featured: { "Channel label": uri, ... }, + // top_subscribed: { "@channel": uri, ... } + // top_bid: { "@channel": uri, ... } + // } + // To properly compare the suggested subscriptions from our current subscribed channels + // We only care about the uri, not the label + // We also only care about top_subscribed and featured + // top_bid could just be porn or a channel with no content + + + var topSubscribedSuggestions = Object(util_swap_json__WEBPACK_IMPORTED_MODULE_3__["swapKeyAndValue"])(suggested[constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__["SUGGESTED_TOP_SUBSCRIBED"]]); + var featuredSuggestions = Object(util_swap_json__WEBPACK_IMPORTED_MODULE_3__["swapKeyAndValue"])(suggested[constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__["SUGGESTED_FEATURED"]]); // Make sure there are no duplicates + // If a uri isn't already in the suggested object, add it + + var suggestedChannels = _objectSpread({}, topSubscribedSuggestions); + + Object.keys(featuredSuggestions).forEach(function (uri) { + if (!suggestedChannels[uri]) { + var channelLabel = featuredSuggestions[uri]; + suggestedChannels[uri] = channelLabel; + } + }); + userSubscriptions.forEach(function (_ref) { + var uri = _ref.uri; + // Note to passer bys: + // Maybe we should just remove the `lbry://` prefix from subscription uris + // Most places don't store them like that + var subscribedUri = uri.slice('lbry://'.length); + + if (suggestedChannels[subscribedUri]) { + delete suggestedChannels[subscribedUri]; + } + }); + return Object.keys(suggestedChannels).map(function (uri) { + return { + uri: uri, + label: suggestedChannels[uri] + }; + }).slice(0, 5); +}); +var selectFirstRunCompleted = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.firstRunCompleted; +}); +var selectShowSuggestedSubs = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.showSuggestedSubs; +}); // Fetching any claims that are a part of a users subscriptions + +var selectSubscriptionsBeingFetched = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectSubscriptions, lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectAllFetchingChannelClaims"], function (subscriptions, fetchingChannelClaims) { + var fetchingSubscriptionMap = {}; + subscriptions.forEach(function (sub) { + var isFetching = fetchingChannelClaims && fetchingChannelClaims[sub.uri]; + + if (isFetching) { + fetchingSubscriptionMap[sub.uri] = true; + } + }); + return fetchingSubscriptionMap; +}); +var selectUnreadByChannel = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.unread; +}); // Returns the current total of unread subscriptions + +var selectUnreadAmount = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectUnreadByChannel, function (unreadByChannel) { + var unreadChannels = Object.keys(unreadByChannel); + var badges = 0; + + if (!unreadChannels.length) { + return badges; + } + + unreadChannels.forEach(function (channel) { + badges += unreadByChannel[channel].uris.length; + }); + return badges; +}); // Returns the uris with channels as an array with the channel with the newest content first +// If you just want the `unread` state, use selectUnread + +var selectUnreadSubscriptions = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectUnreadAmount, selectUnreadByChannel, lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectClaimsByUri"], function (unreadAmount, unreadByChannel, claimsByUri) { + // determine which channel has the newest content + var unreadList = []; + + if (!unreadAmount) { + return unreadList; + } + + var channelUriList = Object.keys(unreadByChannel); // There is only one channel with unread notifications + + if (unreadAmount === 1) { + channelUriList.forEach(function (channel) { + var unreadChannel = { + channel: channel, + uris: unreadByChannel[channel].uris + }; + unreadList.push(unreadChannel); }); + return unreadList; + } - if (rewardType !== rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE) { - if (!reward || reward.transaction_id) { - // already claimed or doesn't exist, do nothing - return; - } + channelUriList.sort(function (channel1, channel2) { + var latestUriFromChannel1 = unreadByChannel[channel1].uris[0]; + var latestClaimFromChannel1 = claimsByUri[latestUriFromChannel1] || {}; + var latestUriFromChannel2 = unreadByChannel[channel2].uris[0]; + var latestClaimFromChannel2 = claimsByUri[latestUriFromChannel2] || {}; + var latestHeightFromChannel1 = latestClaimFromChannel1.height || 0; + var latestHeightFromChannel2 = latestClaimFromChannel2.height || 0; + + if (latestHeightFromChannel1 !== latestHeightFromChannel2) { + return latestHeightFromChannel2 - latestHeightFromChannel1; } - if (!userIsRewardApproved && rewardType !== rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_CONFIRM_EMAIL) { - if (!options || !options.failSilently && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.rewardApprovalRequested) { - rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.rewardApprovalRequested(); - } - - return; - } // Set `claim_code` so the api knows which reward to give if there are multiple of the same type - - - var params = options.params || {}; - params.claim_code = reward.claim_code; - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_STARTED, - data: { - reward: reward - } - }); - - var success = function success(successReward) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, - data: { - reward: successReward - } - }); - - if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) { - rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess(); - } else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) { - dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])()); - } - - dispatch(doRewardList()); + return 0; + }).forEach(function (channel) { + var unreadSubscription = unreadByChannel[channel]; + var unreadChannel = { + channel: channel, + uris: unreadSubscription.uris }; + unreadList.push(unreadChannel); + }); + return unreadList; +}); // Returns all unread subscriptions for a uri passed in - var failure = function failure(error) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_FAILURE, - data: { - reward: reward, - error: !options || !options.failSilently ? error : undefined +var makeSelectUnreadByChannel = function makeSelectUnreadByChannel(uri) { + return Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectUnreadByChannel, function (unread) { + return unread[uri]; + }); +}; // Returns the first page of claims for every channel a user is subscribed to + +var selectSubscriptionClaims = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectAllClaimsByChannel"], lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectClaimsById"], selectSubscriptions, selectUnreadByChannel, function (channelIds, allClaims, savedSubscriptions, unreadByChannel) { + // no claims loaded yet + if (!Object.keys(channelIds).length) { + return []; + } + + var fetchedSubscriptions = []; + savedSubscriptions.forEach(function (subscription) { + var channelClaims = []; // if subscribed channel has content + + if (channelIds[subscription.uri] && channelIds[subscription.uri]['1']) { + // This will need to be more robust, we will want to be able to load more than the first page + // Strip out any ids that will be shown as notifications + var pageOneChannelIds = channelIds[subscription.uri]['1']; // we have the channel ids and the corresponding claims + // loop over the list of ids and grab the claim + + pageOneChannelIds.forEach(function (id) { + var grabbedClaim = allClaims[id]; + + if (unreadByChannel[subscription.uri] && unreadByChannel[subscription.uri].uris.some(function (uri) { + return uri.includes(id); + })) { + grabbedClaim.isNew = true; } + + channelClaims = channelClaims.concat([grabbedClaim]); }); - - if (options.notifyError) { - dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doToast"])({ - message: error.message, - isError: true - })); - } - }; - - rewards__WEBPACK_IMPORTED_MODULE_5__["default"].claimReward(rewardType, params).then(success, failure); - }; -} -function doClaimEligiblePurchaseRewards() { - return function (dispatch, getState) { - var state = getState(); - var unclaimedRewards = Object(redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__["selectUnclaimedRewards"])(state); - var userIsRewardApproved = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectUserIsRewardApproved"])(state); - - if (!userIsRewardApproved || !lbryio__WEBPACK_IMPORTED_MODULE_0__["default"].enabled) { - return; } - if (unclaimedRewards.find(function (ur) { - return ur.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_FIRST_STREAM; - })) { - dispatch(doClaimRewardType(rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_FIRST_STREAM)); - } else { - [rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_MANY_DOWNLOADS, rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_FEATURED_DOWNLOAD, rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_DAILY_VIEW].forEach(function (type) { - dispatch(doClaimRewardType(type, { - failSilently: true - })); + fetchedSubscriptions = fetchedSubscriptions.concat(channelClaims); + }); + return fetchedSubscriptions; +}); // Returns true if a user is subscribed to the channel associated with the uri passed in +// Accepts content or channel uris + +var makeSelectIsSubscribed = function makeSelectIsSubscribed(uri) { + return Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectSubscriptions, Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["makeSelectChannelForClaimUri"])(uri, true), function (subscriptions, channelUri) { + if (channelUri) { + return subscriptions.some(function (sub) { + return sub.uri === channelUri; + }); + } // If we couldn't get a channel uri from the claim uri, the uri passed in might be a channel already + + + var _parseURI = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["parseURI"])(uri), + isChannel = _parseURI.isChannel; + + if (isChannel) { + var uriWithPrefix = uri.startsWith('lbry://') ? uri : "lbry://".concat(uri); + return subscriptions.some(function (sub) { + return sub.uri === uriWithPrefix; }); } - }; -} -function doClaimRewardClearError(reward) { - return function (dispatch) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_CLEAR_ERROR, - data: { - reward: reward - } - }); - }; -} -function doFetchRewardedContent() { - return function (dispatch) { - var success = function success(nameToClaimId) { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARD_CONTENT_COMPLETED, - data: { - claimIds: Object.values(nameToClaimId), - success: true - } - }); - }; - var failure = function failure() { - dispatch({ - type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARD_CONTENT_COMPLETED, - data: { - claimIds: [], - success: false - } - }); - }; + return false; + }); +}; +var makeSelectIsNew = function makeSelectIsNew(uri) { + return Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(makeSelectIsSubscribed(uri), Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["makeSelectChannelForClaimUri"])(uri), selectUnreadByChannel, function (isSubscribed, channel, unreadByChannel) { + if (!isSubscribed) { + return false; + } - lbryio__WEBPACK_IMPORTED_MODULE_0__["default"].call('reward', 'list_featured').then(success, failure); - }; -} + var unreadForChannel = unreadByChannel["lbry://".concat(channel)]; + + if (unreadForChannel) { + return unreadForChannel.uris.includes(uri); + } + + return false; // If they are subscribed, check to see if this uri is in the list of unreads + }); +}; +var selectEnabledChannelNotifications = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { + return state.enabledChannelNotifications; +}); /***/ }), /* 13 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardsByType", function() { return selectUnclaimedRewardsByType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsById", function() { return selectClaimedRewardsById; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewards", function() { return selectClaimedRewards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsByTransactionId", function() { return selectClaimedRewardsByTransactionId; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewards", function() { return selectUnclaimedRewards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingRewards", function() { return selectFetchingRewards; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardValue", function() { return selectUnclaimedRewardValue; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimsPendingByType", function() { return selectClaimsPendingByType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsRewardClaimPending", function() { return makeSelectIsRewardClaimPending; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimErrorsByType", function() { return selectClaimErrorsByType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectClaimRewardError", function() { return makeSelectClaimRewardError; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardByType", function() { return makeSelectRewardByType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return makeSelectRewardAmountByType; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return selectRewardContentClaimIds; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return selectReferralReward; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); - - - -var selectState = function selectState(state) { - return state.rewards || {}; -}; - -var selectUnclaimedRewardsByType = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.unclaimedRewardsByType; -}); -var selectClaimedRewardsById = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.claimedRewardsById; -}); -var selectClaimedRewards = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectClaimedRewardsById, function (byId) { - return Object.values(byId) || []; -}); -var selectClaimedRewardsByTransactionId = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectClaimedRewards, function (rewards) { - return rewards.reduce(function (mapParam, reward) { - var map = mapParam; - map[reward.transaction_id] = reward; - return map; - }, {}); -}); -var selectUnclaimedRewards = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.unclaimedRewards; -}); -var selectFetchingRewards = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return !!state.fetching; -}); -var selectUnclaimedRewardValue = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectUnclaimedRewards, function (rewards) { - return rewards.reduce(function (sum, reward) { - return sum + reward.reward_amount; - }, 0); -}); -var selectClaimsPendingByType = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.claimPendingByType; -}); - -var selectIsClaimRewardPending = function selectIsClaimRewardPending(state, props) { - return selectClaimsPendingByType(state, props)[props.reward_type]; -}; - -var makeSelectIsRewardClaimPending = function makeSelectIsRewardClaimPending() { - return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectIsClaimRewardPending, function (isClaiming) { - return isClaiming; - }); -}; -var selectClaimErrorsByType = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.claimErrorsByType; -}); - -var selectClaimRewardError = function selectClaimRewardError(state, props) { - return selectClaimErrorsByType(state, props)[props.reward_type]; -}; - -var makeSelectClaimRewardError = function makeSelectClaimRewardError() { - return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectClaimRewardError, function (errorMessage) { - return errorMessage; - }); -}; - -var selectRewardByType = function selectRewardByType(state, rewardType) { - return selectUnclaimedRewards(state).find(function (reward) { - return reward.reward_type === rewardType; - }); -}; - -var makeSelectRewardByType = function makeSelectRewardByType() { - return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectRewardByType, function (reward) { - return reward; - }); -}; -var makeSelectRewardAmountByType = function makeSelectRewardAmountByType() { - return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectRewardByType, function (reward) { - return reward ? reward.reward_amount : 0; - }); -}; -var selectRewardContentClaimIds = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { - return state.rewardedContentClaimIds; -}); -var selectReferralReward = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectUnclaimedRewards, function (unclaimedRewards) { - return unclaimedRewards.filter(function (reward) { - return reward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_1__["default"].TYPE_REFERRAL; - })[0]; -}); - -/***/ }), -/* 14 */ /***/ (function(module, exports, __webpack_require__) { "use strict"; @@ -1848,10 +1887,369 @@ function createStructuredSelector(selectors) { }); } +/***/ }), +/* 14 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "swapKeyAndValue", function() { return swapKeyAndValue; }); +function swapKeyAndValue(dict) { + var ret = {}; // eslint-disable-next-line no-restricted-syntax + + for (var key in dict) { + if (dict.hasOwnProperty(key)) { + ret[dict[key]] = key; + } + } + + return ret; +} + /***/ }), /* 15 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doGenerateAuthToken", function() { return doGenerateAuthToken; }); +/* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2); + + +function doGenerateAuthToken(installationId) { + return function (dispatch) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_STARTED"] + }); + lbryio__WEBPACK_IMPORTED_MODULE_1__["default"].call('user', 'new', { + auth_token: '', + language: 'en', + app_id: installationId + }, 'post').then(function (response) { + if (!response.auth_token) { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_FAILURE"] + }); + } else { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_SUCCESS"], + data: { + authToken: response.auth_token + } + }); + } + })["catch"](function () { + dispatch({ + type: constants_action_types__WEBPACK_IMPORTED_MODULE_0__["GENERATE_AUTH_TOKEN_FAILURE"] + }); + }); + }; +} + +/***/ }), +/* 16 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doRewardList", function() { return doRewardList; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardType", function() { return doClaimRewardType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimEligiblePurchaseRewards", function() { return doClaimEligiblePurchaseRewards; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doClaimRewardClearError", function() { return doClaimRewardClearError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doFetchRewardedContent", function() { return doFetchRewardedContent; }); +/* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); +/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); +/* harmony import */ var redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(17); +/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(18); +/* harmony import */ var redux_actions_user__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(19); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(7); + + + + + + +function doRewardList() { + return function (dispatch) { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARDS_STARTED + }); + lbryio__WEBPACK_IMPORTED_MODULE_0__["default"].call('reward', 'list', { + multiple_rewards_per_type: true + }).then(function (userRewards) { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARDS_COMPLETED, + data: { + userRewards: userRewards + } + }); + })["catch"](function () { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARDS_COMPLETED, + data: { + userRewards: [] + } + }); + }); + }; +} +function doClaimRewardType(rewardType) { + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + return function (dispatch, getState) { + var state = getState(); + var userIsRewardApproved = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectUserIsRewardApproved"])(state); + var unclaimedRewards = Object(redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__["selectUnclaimedRewards"])(state); + var reward = rewardType === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE ? { + reward_type: rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE + } : unclaimedRewards.find(function (ur) { + return ur.reward_type === rewardType; + }); // Try to claim the email reward right away, even if we haven't called reward_list yet + + if (rewardType !== rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE || rewardType !== rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_CONFIRM_EMAIL) { + if (!reward || reward.transaction_id) { + // already claimed or doesn't exist, do nothing + return; + } + } + + if (!userIsRewardApproved && rewardType !== rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_CONFIRM_EMAIL && rewardType !== rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REWARD_CODE) { + if (!options || !options.failSilently && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.rewardApprovalRequested) { + rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.rewardApprovalRequested(); + } + + return; + } // Set `claim_code` so the api knows which reward to give if there are multiple of the same type + + + var params = options.params || {}; + params.claim_code = reward.claim_code; + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_STARTED, + data: { + reward: reward + } + }); + + var success = function success(successReward) { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_SUCCESS, + data: { + reward: successReward + } + }); + + if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_NEW_USER && rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess) { + rewards__WEBPACK_IMPORTED_MODULE_5__["default"].callbacks.claimFirstRewardSuccess(); + } else if (successReward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_REFERRAL) { + dispatch(Object(redux_actions_user__WEBPACK_IMPORTED_MODULE_4__["doFetchInviteStatus"])()); + } + + dispatch(doRewardList()); + + if (options.callback) { + options.callback(); + } + }; + + var failure = function failure(error) { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_FAILURE, + data: { + reward: reward, + error: !options || !options.failSilently ? error : undefined + } + }); + + if (options.notifyError) { + dispatch(Object(lbry_redux__WEBPACK_IMPORTED_MODULE_1__["doToast"])({ + message: error.message, + isError: true + })); + } + + if (options.callback) { + options.callback(error); + } + }; + + rewards__WEBPACK_IMPORTED_MODULE_5__["default"].claimReward(rewardType, params).then(success, failure); + }; +} +function doClaimEligiblePurchaseRewards() { + return function (dispatch, getState) { + var state = getState(); + var unclaimedRewards = Object(redux_selectors_rewards__WEBPACK_IMPORTED_MODULE_2__["selectUnclaimedRewards"])(state); + var userIsRewardApproved = Object(redux_selectors_user__WEBPACK_IMPORTED_MODULE_3__["selectUserIsRewardApproved"])(state); + + if (!userIsRewardApproved || !lbryio__WEBPACK_IMPORTED_MODULE_0__["default"].enabled) { + return; + } + + if (unclaimedRewards.find(function (ur) { + return ur.reward_type === rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_FIRST_STREAM; + })) { + dispatch(doClaimRewardType(rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_FIRST_STREAM)); + } else { + [rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_MANY_DOWNLOADS, rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_FEATURED_DOWNLOAD, rewards__WEBPACK_IMPORTED_MODULE_5__["default"].TYPE_DAILY_VIEW].forEach(function (type) { + dispatch(doClaimRewardType(type, { + failSilently: true + })); + }); + } + }; +} +function doClaimRewardClearError(reward) { + return function (dispatch) { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].CLAIM_REWARD_CLEAR_ERROR, + data: { + reward: reward + } + }); + }; +} +function doFetchRewardedContent() { + return function (dispatch) { + var success = function success(nameToClaimId) { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARD_CONTENT_COMPLETED, + data: { + claimIds: Object.values(nameToClaimId), + success: true + } + }); + }; + + var failure = function failure() { + dispatch({ + type: lbry_redux__WEBPACK_IMPORTED_MODULE_1__["ACTIONS"].FETCH_REWARD_CONTENT_COMPLETED, + data: { + claimIds: [], + success: false + } + }); + }; + + lbryio__WEBPACK_IMPORTED_MODULE_0__["default"].call('reward', 'list_featured').then(success, failure); + }; +} + +/***/ }), +/* 17 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +__webpack_require__.r(__webpack_exports__); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardsByType", function() { return selectUnclaimedRewardsByType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsById", function() { return selectClaimedRewardsById; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewards", function() { return selectClaimedRewards; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimedRewardsByTransactionId", function() { return selectClaimedRewardsByTransactionId; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewards", function() { return selectUnclaimedRewards; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingRewards", function() { return selectFetchingRewards; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnclaimedRewardValue", function() { return selectUnclaimedRewardValue; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimsPendingByType", function() { return selectClaimsPendingByType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsRewardClaimPending", function() { return makeSelectIsRewardClaimPending; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectClaimErrorsByType", function() { return selectClaimErrorsByType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectClaimRewardError", function() { return makeSelectClaimRewardError; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardByType", function() { return makeSelectRewardByType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectRewardAmountByType", function() { return makeSelectRewardAmountByType; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectRewardContentClaimIds", function() { return selectRewardContentClaimIds; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectReferralReward", function() { return selectReferralReward; }); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); +/* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7); + + + +var selectState = function selectState(state) { + return state.rewards || {}; +}; + +var selectUnclaimedRewardsByType = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.unclaimedRewardsByType; +}); +var selectClaimedRewardsById = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.claimedRewardsById; +}); +var selectClaimedRewards = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectClaimedRewardsById, function (byId) { + return Object.values(byId) || []; +}); +var selectClaimedRewardsByTransactionId = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectClaimedRewards, function (rewards) { + return rewards.reduce(function (mapParam, reward) { + var map = mapParam; + map[reward.transaction_id] = reward; + return map; + }, {}); +}); +var selectUnclaimedRewards = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.unclaimedRewards; +}); +var selectFetchingRewards = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return !!state.fetching; +}); +var selectUnclaimedRewardValue = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectUnclaimedRewards, function (rewards) { + return rewards.reduce(function (sum, reward) { + return sum + reward.reward_amount; + }, 0); +}); +var selectClaimsPendingByType = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.claimPendingByType; +}); + +var selectIsClaimRewardPending = function selectIsClaimRewardPending(state, props) { + return selectClaimsPendingByType(state, props)[props.reward_type]; +}; + +var makeSelectIsRewardClaimPending = function makeSelectIsRewardClaimPending() { + return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectIsClaimRewardPending, function (isClaiming) { + return isClaiming; + }); +}; +var selectClaimErrorsByType = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.claimErrorsByType; +}); + +var selectClaimRewardError = function selectClaimRewardError(state, props) { + return selectClaimErrorsByType(state, props)[props.reward_type]; +}; + +var makeSelectClaimRewardError = function makeSelectClaimRewardError() { + return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectClaimRewardError, function (errorMessage) { + return errorMessage; + }); +}; + +var selectRewardByType = function selectRewardByType(state, rewardType) { + return selectUnclaimedRewards(state).find(function (reward) { + return reward.reward_type === rewardType; + }); +}; + +var makeSelectRewardByType = function makeSelectRewardByType() { + return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectRewardByType, function (reward) { + return reward; + }); +}; +var makeSelectRewardAmountByType = function makeSelectRewardAmountByType() { + return Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectRewardByType, function (reward) { + return reward ? reward.reward_amount : 0; + }); +}; +var selectRewardContentClaimIds = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { + return state.rewardedContentClaimIds; +}); +var selectReferralReward = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectUnclaimedRewards, function (unclaimedRewards) { + return unclaimedRewards.filter(function (reward) { + return reward.reward_type === rewards__WEBPACK_IMPORTED_MODULE_1__["default"].TYPE_REFERRAL; + })[0]; +}); + +/***/ }), +/* 18 */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectState", function() { return selectState; }); @@ -1874,6 +2272,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectPhoneVerifyErrorMessage", function() { return selectPhoneVerifyErrorMessage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyIsPending", function() { return selectIdentityVerifyIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIdentityVerifyErrorMessage", function() { return selectIdentityVerifyErrorMessage; }); +/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserVerifiedEmail", function() { return selectUserVerifiedEmail; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserIsVerificationCandidate", function() { return selectUserIsVerificationCandidate; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectAccessToken", function() { return selectAccessToken; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteStatusIsPending", function() { return selectUserInviteStatusIsPending; }); @@ -1883,7 +2282,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewIsPending", function() { return selectUserInviteNewIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteNewErrorMessage", function() { return selectUserInviteNewErrorMessage; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUserInviteReferralLink", function() { return selectUserInviteReferralLink; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -1946,6 +2345,9 @@ var selectIdentityVerifyIsPending = Object(reselect__WEBPACK_IMPORTED_MODULE_0__ var selectIdentityVerifyErrorMessage = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectState, function (state) { return state.identityVerifyErrorMessage; }); +var selectUserVerifiedEmail = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectUser, function (user) { + return user && user.has_verified_email; +}); var selectUserIsVerificationCandidate = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["createSelector"])(selectUser, function (user) { return user && (!user.has_verified_email || !user.is_identity_verified); }); @@ -1975,7 +2377,7 @@ var selectUserInviteReferralLink = Object(reselect__WEBPACK_IMPORTED_MODULE_0__[ }); /***/ }), -/* 16 */ +/* 19 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -1999,8 +2401,8 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doUserInviteNew", function() { return doUserInviteNew; }); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(3); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_0__); -/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); -/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(15); +/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var redux_selectors_user__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(18); /* harmony import */ var rewards__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7); /* harmony import */ var lbryio__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2); function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); } @@ -2400,7 +2802,7 @@ function doUserInviteNew(email) { } /***/ }), -/* 17 */ +/* 20 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2421,9 +2823,9 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doShowSuggestedSubs", function() { return doShowSuggestedSubs; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionEnableNotifications", function() { return doChannelSubscriptionEnableNotifications; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "doChannelSubscriptionDisableNotifications", function() { return doChannelSubscriptionDisableNotifications; }); -/* harmony import */ var constants_claim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(18); -/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(12); -/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(19); +/* harmony import */ var constants_claim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(21); +/* harmony import */ var redux_actions_rewards__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(16); +/* harmony import */ var redux_selectors_subscriptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(12); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_3__); /* harmony import */ var constants_action_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1); @@ -2852,7 +3254,7 @@ var doChannelSubscriptionDisableNotifications = function doChannelSubscriptionDi }; /***/ }), -/* 18 */ +/* 21 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -2867,297 +3269,7 @@ var CHANNEL_NEW = 'new'; var PAGE_SIZE = 20; /***/ }), -/* 19 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptions", function() { return selectSubscriptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSubscriptions", function() { return selectIsFetchingSubscriptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectViewMode", function() { return selectViewMode; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSuggested", function() { return selectSuggested; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIsFetchingSuggested", function() { return selectIsFetchingSuggested; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSuggestedChannels", function() { return selectSuggestedChannels; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFirstRunCompleted", function() { return selectFirstRunCompleted; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectShowSuggestedSubs", function() { return selectShowSuggestedSubs; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionsBeingFetched", function() { return selectSubscriptionsBeingFetched; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnreadByChannel", function() { return selectUnreadByChannel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnreadAmount", function() { return selectUnreadAmount; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectUnreadSubscriptions", function() { return selectUnreadSubscriptions; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectUnreadByChannel", function() { return makeSelectUnreadByChannel; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSubscriptionClaims", function() { return selectSubscriptionClaims; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsSubscribed", function() { return makeSelectIsSubscribed; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectIsNew", function() { return makeSelectIsNew; }); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectEnabledChannelNotifications", function() { return selectEnabledChannelNotifications; }); -/* harmony import */ var constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(14); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_1__); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3); -/* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_2__); -/* harmony import */ var util_swap_json__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(20); -function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } - -function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } - - - - - // Returns the entire subscriptions state - -var selectState = function selectState(state) { - return state.subscriptions || {}; -}; // Returns the list of channel uris a user is subscribed to - - -var selectSubscriptions = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.subscriptions; -}); // Fetching list of users subscriptions - -var selectIsFetchingSubscriptions = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.loading; -}); // The current view mode on the subscriptions page - -var selectViewMode = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.viewMode; -}); // Suggested subscriptions from internal apis - -var selectSuggested = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.suggested; -}); -var selectIsFetchingSuggested = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.loadingSuggested; -}); -var selectSuggestedChannels = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectSubscriptions, selectSuggested, function (userSubscriptions, suggested) { - if (!suggested) { - return null; - } // Swap the key/value because we will use the uri for everything, this just makes it easier - // suggested is returned from the api with the form: - // { - // featured: { "Channel label": uri, ... }, - // top_subscribed: { "@channel": uri, ... } - // top_bid: { "@channel": uri, ... } - // } - // To properly compare the suggested subscriptions from our current subscribed channels - // We only care about the uri, not the label - // We also only care about top_subscribed and featured - // top_bid could just be porn or a channel with no content - - - var topSubscribedSuggestions = Object(util_swap_json__WEBPACK_IMPORTED_MODULE_3__["swapKeyAndValue"])(suggested[constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__["SUGGESTED_TOP_SUBSCRIBED"]]); - var featuredSuggestions = Object(util_swap_json__WEBPACK_IMPORTED_MODULE_3__["swapKeyAndValue"])(suggested[constants_subscriptions__WEBPACK_IMPORTED_MODULE_0__["SUGGESTED_FEATURED"]]); // Make sure there are no duplicates - // If a uri isn't already in the suggested object, add it - - var suggestedChannels = _objectSpread({}, topSubscribedSuggestions); - - Object.keys(featuredSuggestions).forEach(function (uri) { - if (!suggestedChannels[uri]) { - var channelLabel = featuredSuggestions[uri]; - suggestedChannels[uri] = channelLabel; - } - }); - userSubscriptions.forEach(function (_ref) { - var uri = _ref.uri; - // Note to passer bys: - // Maybe we should just remove the `lbry://` prefix from subscription uris - // Most places don't store them like that - var subscribedUri = uri.slice('lbry://'.length); - - if (suggestedChannels[subscribedUri]) { - delete suggestedChannels[subscribedUri]; - } - }); - return Object.keys(suggestedChannels).map(function (uri) { - return { - uri: uri, - label: suggestedChannels[uri] - }; - }).slice(0, 5); -}); -var selectFirstRunCompleted = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.firstRunCompleted; -}); -var selectShowSuggestedSubs = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.showSuggestedSubs; -}); // Fetching any claims that are a part of a users subscriptions - -var selectSubscriptionsBeingFetched = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectSubscriptions, lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectAllFetchingChannelClaims"], function (subscriptions, fetchingChannelClaims) { - var fetchingSubscriptionMap = {}; - subscriptions.forEach(function (sub) { - var isFetching = fetchingChannelClaims && fetchingChannelClaims[sub.uri]; - - if (isFetching) { - fetchingSubscriptionMap[sub.uri] = true; - } - }); - return fetchingSubscriptionMap; -}); -var selectUnreadByChannel = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.unread; -}); // Returns the current total of unread subscriptions - -var selectUnreadAmount = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectUnreadByChannel, function (unreadByChannel) { - var unreadChannels = Object.keys(unreadByChannel); - var badges = 0; - - if (!unreadChannels.length) { - return badges; - } - - unreadChannels.forEach(function (channel) { - badges += unreadByChannel[channel].uris.length; - }); - return badges; -}); // Returns the uris with channels as an array with the channel with the newest content first -// If you just want the `unread` state, use selectUnread - -var selectUnreadSubscriptions = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectUnreadAmount, selectUnreadByChannel, lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectClaimsByUri"], function (unreadAmount, unreadByChannel, claimsByUri) { - // determine which channel has the newest content - var unreadList = []; - - if (!unreadAmount) { - return unreadList; - } - - var channelUriList = Object.keys(unreadByChannel); // There is only one channel with unread notifications - - if (unreadAmount === 1) { - channelUriList.forEach(function (channel) { - var unreadChannel = { - channel: channel, - uris: unreadByChannel[channel].uris - }; - unreadList.push(unreadChannel); - }); - return unreadList; - } - - channelUriList.sort(function (channel1, channel2) { - var latestUriFromChannel1 = unreadByChannel[channel1].uris[0]; - var latestClaimFromChannel1 = claimsByUri[latestUriFromChannel1] || {}; - var latestUriFromChannel2 = unreadByChannel[channel2].uris[0]; - var latestClaimFromChannel2 = claimsByUri[latestUriFromChannel2] || {}; - var latestHeightFromChannel1 = latestClaimFromChannel1.height || 0; - var latestHeightFromChannel2 = latestClaimFromChannel2.height || 0; - - if (latestHeightFromChannel1 !== latestHeightFromChannel2) { - return latestHeightFromChannel2 - latestHeightFromChannel1; - } - - return 0; - }).forEach(function (channel) { - var unreadSubscription = unreadByChannel[channel]; - var unreadChannel = { - channel: channel, - uris: unreadSubscription.uris - }; - unreadList.push(unreadChannel); - }); - return unreadList; -}); // Returns all unread subscriptions for a uri passed in - -var makeSelectUnreadByChannel = function makeSelectUnreadByChannel(uri) { - return Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectUnreadByChannel, function (unread) { - return unread[uri]; - }); -}; // Returns the first page of claims for every channel a user is subscribed to - -var selectSubscriptionClaims = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectAllClaimsByChannel"], lbry_redux__WEBPACK_IMPORTED_MODULE_2__["selectClaimsById"], selectSubscriptions, selectUnreadByChannel, function (channelIds, allClaims, savedSubscriptions, unreadByChannel) { - // no claims loaded yet - if (!Object.keys(channelIds).length) { - return []; - } - - var fetchedSubscriptions = []; - savedSubscriptions.forEach(function (subscription) { - var channelClaims = []; // if subscribed channel has content - - if (channelIds[subscription.uri] && channelIds[subscription.uri]['1']) { - // This will need to be more robust, we will want to be able to load more than the first page - // Strip out any ids that will be shown as notifications - var pageOneChannelIds = channelIds[subscription.uri]['1']; // we have the channel ids and the corresponding claims - // loop over the list of ids and grab the claim - - pageOneChannelIds.forEach(function (id) { - var grabbedClaim = allClaims[id]; - - if (unreadByChannel[subscription.uri] && unreadByChannel[subscription.uri].uris.some(function (uri) { - return uri.includes(id); - })) { - grabbedClaim.isNew = true; - } - - channelClaims = channelClaims.concat([grabbedClaim]); - }); - } - - fetchedSubscriptions = fetchedSubscriptions.concat(channelClaims); - }); - return fetchedSubscriptions; -}); // Returns true if a user is subscribed to the channel associated with the uri passed in -// Accepts content or channel uris - -var makeSelectIsSubscribed = function makeSelectIsSubscribed(uri) { - return Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectSubscriptions, Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["makeSelectChannelForClaimUri"])(uri, true), function (subscriptions, channelUri) { - if (channelUri) { - return subscriptions.some(function (sub) { - return sub.uri === channelUri; - }); - } // If we couldn't get a channel uri from the claim uri, the uri passed in might be a channel already - - - var _parseURI = Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["parseURI"])(uri), - isChannel = _parseURI.isChannel; - - if (isChannel) { - var uriWithPrefix = uri.startsWith('lbry://') ? uri : "lbry://".concat(uri); - return subscriptions.some(function (sub) { - return sub.uri === uriWithPrefix; - }); - } - - return false; - }); -}; -var makeSelectIsNew = function makeSelectIsNew(uri) { - return Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(makeSelectIsSubscribed(uri), Object(lbry_redux__WEBPACK_IMPORTED_MODULE_2__["makeSelectChannelForClaimUri"])(uri), selectUnreadByChannel, function (isSubscribed, channel, unreadByChannel) { - if (!isSubscribed) { - return false; - } - - var unreadForChannel = unreadByChannel["lbry://".concat(channel)]; - - if (unreadForChannel) { - return unreadForChannel.uris.includes(uri); - } - - return false; // If they are subscribed, check to see if this uri is in the list of unreads - }); -}; -var selectEnabledChannelNotifications = Object(reselect__WEBPACK_IMPORTED_MODULE_1__["createSelector"])(selectState, function (state) { - return state.enabledChannelNotifications; -}); - -/***/ }), -/* 20 */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -__webpack_require__.r(__webpack_exports__); -/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "swapKeyAndValue", function() { return swapKeyAndValue; }); -function swapKeyAndValue(dict) { - var ret = {}; // eslint-disable-next-line no-restricted-syntax - - for (var key in dict) { - if (dict.hasOwnProperty(key)) { - ret[dict[key]] = key; - } - } - - return ret; -} - -/***/ }), -/* 21 */ +/* 22 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3212,7 +3324,7 @@ function doFetchCostInfoForUri(uri) { } /***/ }), -/* 22 */ +/* 23 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3285,7 +3397,7 @@ function doBlackListedOutpointsSubscribe() { } /***/ }), -/* 23 */ +/* 24 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3355,7 +3467,7 @@ function doFilteredOutpointsSubscribe() { } /***/ }), -/* 24 */ +/* 25 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3451,7 +3563,7 @@ function doFetchTrendingUris() { } /***/ }), -/* 25 */ +/* 26 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3487,7 +3599,7 @@ var doFetchViewCount = function doFetchViewCount(claimId) { }; /***/ }), -/* 26 */ +/* 27 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3708,7 +3820,7 @@ function doCheckSync() { } /***/ }), -/* 27 */ +/* 28 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3750,7 +3862,7 @@ function authReducer() { } /***/ }), -/* 28 */ +/* 29 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3881,7 +3993,7 @@ function rewardsReducer() { } /***/ }), -/* 29 */ +/* 30 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -3938,7 +4050,8 @@ reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_STARTED] reducers[lbry_redux__WEBPACK_IMPORTED_MODULE_0__["ACTIONS"].USER_FETCH_SUCCESS] = function (state, action) { return Object.assign({}, state, { userIsPending: false, - user: action.data.user + user: action.data.user, + emailToVerify: action.data.user.has_verified_email ? null : state.emailToVerify }); }; @@ -4144,7 +4257,7 @@ function userReducer() { } /***/ }), -/* 30 */ +/* 31 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4186,7 +4299,7 @@ var costInfoReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_0__["hand }), _handleActions), defaultState); /***/ }), -/* 31 */ +/* 32 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4232,7 +4345,7 @@ var blacklistReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_1__["han }), _handleActions), defaultState); /***/ }), -/* 32 */ +/* 33 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4271,7 +4384,7 @@ var filteredReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_1__["hand }), _handleActions), defaultState); /***/ }), -/* 33 */ +/* 34 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4324,7 +4437,7 @@ var homepageReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_0__["hand }), _handleActions), defaultState); /***/ }), -/* 34 */ +/* 35 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4367,7 +4480,7 @@ var statsReducer = Object(util_redux_utils__WEBPACK_IMPORTED_MODULE_0__["handleA }), _handleActions), defaultState); /***/ }), -/* 35 */ +/* 36 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4458,14 +4571,14 @@ function syncReducer() { } /***/ }), -/* 36 */ +/* 37 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectAuthToken", function() { return selectAuthToken; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectIsAuthenticating", function() { return selectIsAuthenticating; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); @@ -4481,7 +4594,7 @@ var selectIsAuthenticating = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["creat }); /***/ }), -/* 37 */ +/* 38 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4491,7 +4604,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectCostInfoForUri", function() { return makeSelectCostInfoForUri; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingCostInfo", function() { return selectFetchingCostInfo; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectFetchingCostInfoForUri", function() { return makeSelectFetchingCostInfoForUri; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -4515,14 +4628,14 @@ var makeSelectFetchingCostInfoForUri = function makeSelectFetchingCostInfoForUri }; /***/ }), -/* 38 */ +/* 39 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectState", function() { return selectState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectBlackListedOutpoints", function() { return selectBlackListedOutpoints; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -4533,14 +4646,14 @@ var selectBlackListedOutpoints = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["c }); /***/ }), -/* 39 */ +/* 40 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectState", function() { return selectState; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFilteredOutpoints", function() { return selectFilteredOutpoints; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); var selectState = function selectState(state) { @@ -4551,7 +4664,7 @@ var selectFilteredOutpoints = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["crea }); /***/ }), -/* 40 */ +/* 41 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4560,7 +4673,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingFeaturedUris", function() { return selectFetchingFeaturedUris; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectTrendingUris", function() { return selectTrendingUris; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectFetchingTrendingUris", function() { return selectFetchingTrendingUris; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); @@ -4582,14 +4695,14 @@ var selectFetchingTrendingUris = Object(reselect__WEBPACK_IMPORTED_MODULE_0__["c }); /***/ }), -/* 41 */ +/* 42 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectViewCount", function() { return selectViewCount; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "makeSelectViewCountForUri", function() { return makeSelectViewCountForUri; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3); /* harmony import */ var lbry_redux__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lbry_redux__WEBPACK_IMPORTED_MODULE_1__); @@ -4610,7 +4723,7 @@ var makeSelectViewCountForUri = function makeSelectViewCountForUri(uri) { }; /***/ }), -/* 42 */ +/* 43 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; @@ -4624,7 +4737,7 @@ __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectHashChanged", function() { return selectHashChanged; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyIsPending", function() { return selectSyncApplyIsPending; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "selectSyncApplyErrorMessage", function() { return selectSyncApplyErrorMessage; }); -/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(14); +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(13); /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reselect__WEBPACK_IMPORTED_MODULE_0__); diff --git a/src/types/redux.js b/dist/flow-typed/Redux.js similarity index 72% rename from src/types/redux.js rename to dist/flow-typed/Redux.js index 64611a4..e781d4f 100644 --- a/src/types/redux.js +++ b/dist/flow-typed/Redux.js @@ -3,4 +3,3 @@ // eslint-disable-next-line no-use-before-define export type Dispatch = (action: T | Promise | Array | ThunkAction) => any; // Need to refer to ThunkAction export type GetState = () => any; -export type ThunkAction = (dispatch: Dispatch, getState: GetState) => any; diff --git a/src/types/subscription.js b/dist/flow-typed/Subscription.js similarity index 67% rename from src/types/subscription.js rename to dist/flow-typed/Subscription.js index d73ac7f..59db9fb 100644 --- a/src/types/subscription.js +++ b/dist/flow-typed/Subscription.js @@ -1,5 +1,5 @@ // @flow -import type { Dispatch as ReduxDispatch } from 'types/redux'; +import type { Dispatch } from 'flow-typed/Redux'; import * as ACTIONS from 'constants/action_types'; import { DOWNLOADED, @@ -12,7 +12,7 @@ import { SUGGESTED_FEATURED, } from 'constants/subscriptions'; -export type Subscription = { +declare type Subscription = { channelName: string, // @CryptoCandor, uri: string, // lbry://@CryptoCandor#9152f3b054f692076a6882d1b58a30e8781cc8e6 latest?: string, // substratum#b0ab143243020e7831fd070d9f871e1fda948620 @@ -21,26 +21,26 @@ export type Subscription = { // Tracking for new content // i.e. If a subscription has a DOWNLOADING type, we will trigger an OS notification // to tell users there is new content from their subscriptions -export type SubscriptionNotificationType = DOWNLOADED | DOWNLOADING | NOTIFY_ONLY; +declare type SubscriptionNotificationType = DOWNLOADED | DOWNLOADING | NOTIFY_ONLY; -export type UnreadSubscription = { +declare type UnreadSubscription = { type: SubscriptionNotificationType, uris: Array, }; -export type UnreadSubscriptions = { +declare type UnreadSubscriptions = { [string]: UnreadSubscription, }; -export type ViewMode = VIEW_LATEST_FIRST | VIEW_ALL; +declare type ViewMode = VIEW_LATEST_FIRST | VIEW_ALL; -export type SuggestedType = SUGGESTED_TOP_BID | SUGGESTED_TOP_SUBSCRIBED | SUGGESTED_FEATURED; +declare type SuggestedType = SUGGESTED_TOP_BID | SUGGESTED_TOP_SUBSCRIBED | SUGGESTED_FEATURED; -export type SuggestedSubscriptions = { +declare type SuggestedSubscriptions = { [SuggestedType]: string, }; -export type SubscriptionState = { +declare type SubscriptionState = { enabledChannelNotifications: Array, subscriptions: Array, unread: UnreadSubscriptions, @@ -55,27 +55,27 @@ export type SubscriptionState = { // // Action types // -export type DoChannelSubscriptionEnableNotifications = { +declare type DoChannelSubscriptionEnableNotifications = { type: ACTIONS.CHANNEL_SUBSCRIPTION_ENABLE_NOTIFICATIONS, data: string, }; -export type DoChannelSubscriptionDisableNotifications = { +declare type DoChannelSubscriptionDisableNotifications = { type: ACTIONS.CHANNEL_SUBSCRIPTION_DISABLE_NOTIFICATIONS, data: string, }; -export type DoChannelSubscribe = { +declare type DoChannelSubscribe = { type: ACTIONS.CHANNEL_SUBSCRIBE, data: Subscription, }; -export type DoChannelUnsubscribe = { +declare type DoChannelUnsubscribe = { type: ACTIONS.CHANNEL_UNSUBSCRIBE, data: Subscription, }; -export type DoUpdateSubscriptionUnreads = { +declare type DoUpdateSubscriptionUnreads = { type: ACTIONS.UPDATE_SUBSCRIPTION_UNREADS, data: { channel: string, @@ -84,7 +84,7 @@ export type DoUpdateSubscriptionUnreads = { }, }; -export type DoRemoveSubscriptionUnreads = { +declare type DoRemoveSubscriptionUnreads = { type: ACTIONS.REMOVE_SUBSCRIPTION_UNREADS, data: { channel: string, @@ -92,7 +92,7 @@ export type DoRemoveSubscriptionUnreads = { }, }; -export type SetSubscriptionLatest = { +declare type SetSubscriptionLatest = { type: ACTIONS.SET_SUBSCRIPTION_LATEST, data: { subscription: Subscription, @@ -100,30 +100,30 @@ export type SetSubscriptionLatest = { }, }; -export type CheckSubscriptionStarted = { +declare type CheckSubscriptionStarted = { type: ACTIONS.CHECK_SUBSCRIPTION_STARTED, }; -export type CheckSubscriptionCompleted = { +declare type CheckSubscriptionCompleted = { type: ACTIONS.CHECK_SUBSCRIPTION_COMPLETED, }; -export type FetchedSubscriptionsSucess = { +declare type FetchedSubscriptionsSucess = { type: ACTIONS.FETCH_SUBSCRIPTIONS_SUCCESS, data: Array, }; -export type SetViewMode = { +declare type SetViewMode = { type: ACTIONS.SET_VIEW_MODE, data: ViewMode, }; -export type GetSuggestedSubscriptionsSuccess = { +declare type GetSuggestedSubscriptionsSuccess = { type: ACTIONS.GET_SUGGESTED_SUBSCRIPTIONS_START, data: SuggestedSubscriptions, }; -export type Action = +declare type SubscriptionAction = | DoChannelSubscribe | DoChannelUnsubscribe | DoUpdateSubscriptionUnreads @@ -134,4 +134,4 @@ export type Action = | SetViewMode | Function; -export type Dispatch = ReduxDispatch; +declare type SubscriptionDispatch = Dispatch; diff --git a/dist/flow-typed/User.js b/dist/flow-typed/User.js new file mode 100644 index 0000000..991b1a5 --- /dev/null +++ b/dist/flow-typed/User.js @@ -0,0 +1,23 @@ +// @flow + +declare type User = { + created_at: string, + family_name: ?string, + given_name: ?string, + groups: Array, + has_verified_email: boolean, + id: number, + invite_reward_claimed: boolean, + invited_at: ?number, + invited_by_id: number, + invites_remaining: number, + is_email_enabled: boolean, + is_identity_verified: boolean, + is_reward_approved: boolean, + language: string, + manual_approval_user_id: ?number, + primary_email: string, + reward_status_change_trigger: string, + updated_at: string, + youtube_channels: ?Array, +}; diff --git a/flow-typed/Redux.js b/flow-typed/Redux.js new file mode 100644 index 0000000..e781d4f --- /dev/null +++ b/flow-typed/Redux.js @@ -0,0 +1,5 @@ +// @flow + +// eslint-disable-next-line no-use-before-define +export type Dispatch = (action: T | Promise | Array | ThunkAction) => any; // Need to refer to ThunkAction +export type GetState = () => any; diff --git a/flow-typed/Subscription.js b/flow-typed/Subscription.js new file mode 100644 index 0000000..59db9fb --- /dev/null +++ b/flow-typed/Subscription.js @@ -0,0 +1,137 @@ +// @flow +import type { Dispatch } from 'flow-typed/Redux'; +import * as ACTIONS from 'constants/action_types'; +import { + DOWNLOADED, + DOWNLOADING, + NOTIFY_ONLY, + VIEW_ALL, + VIEW_LATEST_FIRST, + SUGGESTED_TOP_BID, + SUGGESTED_TOP_SUBSCRIBED, + SUGGESTED_FEATURED, +} from 'constants/subscriptions'; + +declare type Subscription = { + channelName: string, // @CryptoCandor, + uri: string, // lbry://@CryptoCandor#9152f3b054f692076a6882d1b58a30e8781cc8e6 + latest?: string, // substratum#b0ab143243020e7831fd070d9f871e1fda948620 +}; + +// Tracking for new content +// i.e. If a subscription has a DOWNLOADING type, we will trigger an OS notification +// to tell users there is new content from their subscriptions +declare type SubscriptionNotificationType = DOWNLOADED | DOWNLOADING | NOTIFY_ONLY; + +declare type UnreadSubscription = { + type: SubscriptionNotificationType, + uris: Array, +}; + +declare type UnreadSubscriptions = { + [string]: UnreadSubscription, +}; + +declare type ViewMode = VIEW_LATEST_FIRST | VIEW_ALL; + +declare type SuggestedType = SUGGESTED_TOP_BID | SUGGESTED_TOP_SUBSCRIBED | SUGGESTED_FEATURED; + +declare type SuggestedSubscriptions = { + [SuggestedType]: string, +}; + +declare type SubscriptionState = { + enabledChannelNotifications: Array, + subscriptions: Array, + unread: UnreadSubscriptions, + loading: boolean, + viewMode: ViewMode, + suggested: SuggestedSubscriptions, + loadingSuggested: boolean, + firstRunCompleted: boolean, + showSuggestedSubs: boolean, +}; + +// +// Action types +// +declare type DoChannelSubscriptionEnableNotifications = { + type: ACTIONS.CHANNEL_SUBSCRIPTION_ENABLE_NOTIFICATIONS, + data: string, +}; + +declare type DoChannelSubscriptionDisableNotifications = { + type: ACTIONS.CHANNEL_SUBSCRIPTION_DISABLE_NOTIFICATIONS, + data: string, +}; + +declare type DoChannelSubscribe = { + type: ACTIONS.CHANNEL_SUBSCRIBE, + data: Subscription, +}; + +declare type DoChannelUnsubscribe = { + type: ACTIONS.CHANNEL_UNSUBSCRIBE, + data: Subscription, +}; + +declare type DoUpdateSubscriptionUnreads = { + type: ACTIONS.UPDATE_SUBSCRIPTION_UNREADS, + data: { + channel: string, + uris: Array, + type?: SubscriptionNotificationType, + }, +}; + +declare type DoRemoveSubscriptionUnreads = { + type: ACTIONS.REMOVE_SUBSCRIPTION_UNREADS, + data: { + channel: string, + uris: Array, + }, +}; + +declare type SetSubscriptionLatest = { + type: ACTIONS.SET_SUBSCRIPTION_LATEST, + data: { + subscription: Subscription, + uri: string, + }, +}; + +declare type CheckSubscriptionStarted = { + type: ACTIONS.CHECK_SUBSCRIPTION_STARTED, +}; + +declare type CheckSubscriptionCompleted = { + type: ACTIONS.CHECK_SUBSCRIPTION_COMPLETED, +}; + +declare type FetchedSubscriptionsSucess = { + type: ACTIONS.FETCH_SUBSCRIPTIONS_SUCCESS, + data: Array, +}; + +declare type SetViewMode = { + type: ACTIONS.SET_VIEW_MODE, + data: ViewMode, +}; + +declare type GetSuggestedSubscriptionsSuccess = { + type: ACTIONS.GET_SUGGESTED_SUBSCRIPTIONS_START, + data: SuggestedSubscriptions, +}; + +declare type SubscriptionAction = + | DoChannelSubscribe + | DoChannelUnsubscribe + | DoUpdateSubscriptionUnreads + | DoRemoveSubscriptionUnreads + | SetSubscriptionLatest + | CheckSubscriptionStarted + | CheckSubscriptionCompleted + | SetViewMode + | Function; + +declare type SubscriptionDispatch = Dispatch; diff --git a/flow-typed/User.js b/flow-typed/User.js new file mode 100644 index 0000000..991b1a5 --- /dev/null +++ b/flow-typed/User.js @@ -0,0 +1,23 @@ +// @flow + +declare type User = { + created_at: string, + family_name: ?string, + given_name: ?string, + groups: Array, + has_verified_email: boolean, + id: number, + invite_reward_claimed: boolean, + invited_at: ?number, + invited_by_id: number, + invites_remaining: number, + is_email_enabled: boolean, + is_identity_verified: boolean, + is_reward_approved: boolean, + language: string, + manual_approval_user_id: ?number, + primary_email: string, + reward_status_change_trigger: string, + updated_at: string, + youtube_channels: ?Array, +}; diff --git a/package.json b/package.json index c21eee7..5f07900 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,9 @@ "lint-staged": "^7.0.4", "prettier": "^1.4.2", "rollup": "^1.8.0", + "rollup-plugin-alias": "^2.0.0", "rollup-plugin-babel": "^4.3.2", + "rollup-plugin-copy": "^3.1.0", "rollup-plugin-flow": "^1.1.1", "rollup-plugin-includepaths": "^0.2.3", "webpack": "^4.5.0", diff --git a/rollup.config.js b/rollup.config.js index ae1895d..9cf411f 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -1,27 +1,38 @@ import babel from 'rollup-plugin-babel'; import flow from 'rollup-plugin-flow'; import includePaths from 'rollup-plugin-includepaths'; +import copy from 'rollup-plugin-copy'; +import alias from 'rollup-plugin-alias'; let includePathOptions = { - include: {}, - paths: ['src'], - external: [], - extensions: ['.js'] + include: {}, + paths: ['src'], + external: [], + extensions: ['.js'], }; export default { input: 'src/index.js', output: { file: 'dist/bundle.es.js', - format: 'cjs' + format: 'cjs', }, plugins: [ + alias({ + entries: [ + { + find: 'flow-typed', + replacement: './flow-typed', + }, + ], + }), flow({ all: true }), includePaths(includePathOptions), babel({ babelrc: false, - presets: [], + presets: [], }), + copy({ targets: [{ src: './flow-typed', dest: 'dist' }] }), ], - external: ['lbry-redux'] -} + external: ['lbry-redux'], +}; diff --git a/src/index.js b/src/index.js index 23aaa28..5d68853 100644 --- a/src/index.js +++ b/src/index.js @@ -3,6 +3,9 @@ import Lbryio from 'lbryio'; import rewards from 'rewards'; import subscriptionsReducer from 'redux/reducers/subscriptions'; +// middleware +export { userStateSyncMiddleware } from 'redux/middleware/sync'; + // constants export { LBRYINC_ACTIONS }; diff --git a/src/redux/actions/subscriptions.js b/src/redux/actions/subscriptions.js index 67847a3..de462b3 100644 --- a/src/redux/actions/subscriptions.js +++ b/src/redux/actions/subscriptions.js @@ -1,13 +1,5 @@ // @flow -import type { GetState } from 'types/redux'; -import type { - Dispatch as ReduxDispatch, - SubscriptionState, - Subscription, - SubscriptionNotificationType, - ViewMode, - UnreadSubscription, -} from 'types/subscription'; +import type { SubscriptionDispatch } from 'flow-typed/Subscription'; import { PAGE_SIZE } from 'constants/claim'; import { doClaimRewardType } from 'redux/actions/rewards'; import { selectSubscriptions, selectUnreadByChannel } from 'redux/selectors/subscriptions'; @@ -20,14 +12,14 @@ import rewards from 'rewards'; const CHECK_SUBSCRIPTIONS_INTERVAL = 15 * 60 * 1000; const SUBSCRIPTION_DOWNLOAD_LIMIT = 1; -export const doSetViewMode = (viewMode: ViewMode) => (dispatch: ReduxDispatch) => +export const doSetViewMode = (viewMode: ViewMode) => (dispatch: SubscriptionDispatch) => dispatch({ type: ACTIONS.SET_VIEW_MODE, data: viewMode, }); export const setSubscriptionLatest = (subscription: Subscription, uri: string) => ( - dispatch: ReduxDispatch + dispatch: SubscriptionDispatch ) => dispatch({ type: ACTIONS.SET_SUBSCRIPTION_LATEST, @@ -42,7 +34,7 @@ export const doUpdateUnreadSubscriptions = ( channelUri: string, uris: ?Array, type: ?SubscriptionNotificationType -) => (dispatch: ReduxDispatch, getState: GetState) => { +) => (dispatch: SubscriptionDispatch, getState: GetState) => { const state = getState(); const unreadByChannel = selectUnreadByChannel(state); const currentUnreadForChannel: UnreadSubscription = unreadByChannel[channelUri]; @@ -84,7 +76,7 @@ export const doUpdateUnreadSubscriptions = ( // Remove multiple files (or all) from a channels unread subscriptions export const doRemoveUnreadSubscriptions = (channelUri: ?string, readUris: ?Array) => ( - dispatch: ReduxDispatch, + dispatch: SubscriptionDispatch, getState: GetState ) => { const state = getState(); @@ -133,13 +125,13 @@ export const doRemoveUnreadSubscriptions = (channelUri: ?string, readUris: ?Arra // Remove a single file from a channels unread subscriptions export const doRemoveUnreadSubscription = (channelUri: string, readUri: string) => ( - dispatch: ReduxDispatch + dispatch: SubscriptionDispatch ) => { dispatch(doRemoveUnreadSubscriptions(channelUri, [readUri])); }; export const doCheckSubscription = (subscriptionUri: string, shouldNotify?: boolean) => ( - dispatch: ReduxDispatch, + dispatch: SubscriptionDispatch, getState: GetState ) => { // no dispatching FETCH_CHANNEL_CLAIMS_STARTED; causes loading issues on @@ -238,7 +230,7 @@ export const doCheckSubscription = (subscriptionUri: string, shouldNotify?: bool }; export const doChannelSubscribe = (subscription: Subscription) => ( - dispatch: ReduxDispatch, + dispatch: SubscriptionDispatch, getState: GetState ) => { const { @@ -275,7 +267,7 @@ export const doChannelSubscribe = (subscription: Subscription) => ( }; export const doChannelUnsubscribe = (subscription: Subscription) => ( - dispatch: ReduxDispatch, + dispatch: SubscriptionDispatch, getState: GetState ) => { const { @@ -296,7 +288,7 @@ export const doChannelUnsubscribe = (subscription: Subscription) => ( } }; -export const doCheckSubscriptions = () => (dispatch: ReduxDispatch, getState: GetState) => { +export const doCheckSubscriptions = () => (dispatch: SubscriptionDispatch, getState: GetState) => { const state = getState(); const subscriptions = selectSubscriptions(state); @@ -305,7 +297,10 @@ export const doCheckSubscriptions = () => (dispatch: ReduxDispatch, getState: Ge }); }; -export const doFetchMySubscriptions = () => (dispatch: ReduxDispatch, getState: GetState) => { +export const doFetchMySubscriptions = () => ( + dispatch: SubscriptionDispatch, + getState: GetState +) => { const state: { subscriptions: SubscriptionState, settings: any } = getState(); const { subscriptions: reduxSubscriptions } = state.subscriptions; @@ -386,7 +381,7 @@ export const doFetchMySubscriptions = () => (dispatch: ReduxDispatch, getState: }); }; -export const doCheckSubscriptionsInit = () => (dispatch: ReduxDispatch) => { +export const doCheckSubscriptionsInit = () => (dispatch: SubscriptionDispatch) => { // doCheckSubscriptionsInit is called by doDaemonReady // setTimeout below is a hack to ensure redux is hydrated when subscriptions are checked // this will be replaced with which reqiures a package upgrade @@ -402,7 +397,7 @@ export const doCheckSubscriptionsInit = () => (dispatch: ReduxDispatch) => { setInterval(() => dispatch(doCheckSubscriptions()), CHECK_SUBSCRIPTIONS_INTERVAL); }; -export const doFetchRecommendedSubscriptions = () => (dispatch: ReduxDispatch) => { +export const doFetchRecommendedSubscriptions = () => (dispatch: SubscriptionDispatch) => { dispatch({ type: ACTIONS.GET_SUGGESTED_SUBSCRIPTIONS_START, }); @@ -422,18 +417,18 @@ export const doFetchRecommendedSubscriptions = () => (dispatch: ReduxDispatch) = ); }; -export const doCompleteFirstRun = () => (dispatch: ReduxDispatch) => +export const doCompleteFirstRun = () => (dispatch: SubscriptionDispatch) => dispatch({ type: ACTIONS.SUBSCRIPTION_FIRST_RUN_COMPLETED, }); -export const doShowSuggestedSubs = () => (dispatch: ReduxDispatch) => +export const doShowSuggestedSubs = () => (dispatch: SubscriptionDispatch) => dispatch({ type: ACTIONS.VIEW_SUGGESTED_SUBSCRIPTIONS, }); export const doChannelSubscriptionEnableNotifications = (channelName: string) => ( - dispatch: ReduxDispatch + dispatch: SubscriptionDispatch ) => dispatch({ type: ACTIONS.CHANNEL_SUBSCRIPTION_ENABLE_NOTIFICATIONS, @@ -441,7 +436,7 @@ export const doChannelSubscriptionEnableNotifications = (channelName: string) => }); export const doChannelSubscriptionDisableNotifications = (channelName: string) => ( - dispatch: ReduxDispatch + dispatch: SubscriptionDispatch ) => dispatch({ type: ACTIONS.CHANNEL_SUBSCRIPTION_DISABLE_NOTIFICATIONS, diff --git a/src/redux/middleware/sync.js b/src/redux/middleware/sync.js new file mode 100644 index 0000000..9d4d5d2 --- /dev/null +++ b/src/redux/middleware/sync.js @@ -0,0 +1,58 @@ +import { + ACTIONS as LBRY_REDUX_ACTIONS, + makeSelectIsFollowingTag, + selectFollowedTags, +} from 'lbry-redux'; +import Lbryio from 'lbryio'; +import * as ACTIONS from 'constants/action_types'; +import { selectSubscriptions } from 'redux/selectors/subscriptions'; + +const persistShape = { + version: '0', + shared: {}, +}; + +export function userStateSyncMiddleware() { + return ({ getState }) => next => action => { + if ( + action.type === ACTIONS.CHANNEL_SUBSCRIBE || + action.type === ACTIONS.CHANNEL_UNSUBSCRIBE || + action.type === LBRY_REDUX_ACTIONS.TOGGLE_TAG_FOLLOW + ) { + const newShape = { ...persistShape }; + const state = getState(); + const subscriptions = selectSubscriptions(state).map(({ uri }) => uri); + const tags = selectFollowedTags(state); + newShape.shared.subscriptions = subscriptions; + newShape.shared.tags = tags; + + const { uri } = action.data; + + if (action.type === ACTIONS.CHANNEL_SUBSCRIBE) { + const newSubscriptions = subscriptions.slice(); + newSubscriptions.push(uri); + newShape.shared.subscriptions = newSubscriptions; + } else if (action.type === ACTIONS.CHANNEL_UNSUBSCRIBE) { + let newSubscriptions = subscriptions.slice(); + newSubscriptions = newSubscriptions.filter(subscribedUri => subscribedUri !== uri); + newShape.shared.subscriptions = newSubscriptions; + } else { + const toggledTag = action.data.name; + const followedTags = selectFollowedTags(state).map(({ name }) => name); + const isFollowing = makeSelectIsFollowingTag(toggledTag)(state); + let newTags = followedTags.slice(); + + if (isFollowing) { + newTags = newTags.filter(followedTag => followedTag.name !== toggledTag); + } else { + newTags.push(toggledTag); + } + + newShape.shared.tags = newTags; + } + + Lbryio.call('user_settings', 'set', { settings: newShape }); + } + return next(action); + }; +} diff --git a/src/redux/reducers/subscriptions.js b/src/redux/reducers/subscriptions.js index cb93f14..b58f6a0 100644 --- a/src/redux/reducers/subscriptions.js +++ b/src/redux/reducers/subscriptions.js @@ -2,20 +2,6 @@ import * as ACTIONS from 'constants/action_types'; import { VIEW_ALL } from 'constants/subscriptions'; import { handleActions } from 'util/redux-utils'; -import type { - SubscriptionState, - Subscription, - DoChannelSubscribe, - DoChannelUnsubscribe, - DoChannelSubscriptionEnableNotifications, - DoChannelSubscriptionDisableNotifications, - SetSubscriptionLatest, - DoUpdateSubscriptionUnreads, - DoRemoveSubscriptionUnreads, - FetchedSubscriptionsSucess, - SetViewMode, - GetSuggestedSubscriptionsSuccess, -} from 'types/subscription'; const defaultState: SubscriptionState = { enabledChannelNotifications: [], diff --git a/webpack.config.js b/webpack.config.js index 375d3b8..7f21009 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -20,6 +20,9 @@ module.exports = { }, resolve: { modules: [path.resolve(__dirname, 'src'), 'node_modules'], + alias: { + 'flow-typed': path.resolve(__dirname, './flow-typed'), + }, }, externals: 'lbry-redux', }; diff --git a/yarn.lock b/yarn.lock index 4313ae3..e9b97cf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -642,6 +642,27 @@ lodash "^4.17.11" to-fast-properties "^2.0.0" +"@nodelib/fs.scandir@2.1.2": + version "2.1.2" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.2.tgz#1f981cd5b83e85cfdeb386fc693d4baab392fa54" + integrity sha512-wrIBsjA5pl13f0RN4Zx4FNWmU71lv03meGKnqRUoCyan17s4V3WL92f3w3AIuWbNnpcrQyFBU5qMavJoB8d27w== + dependencies: + "@nodelib/fs.stat" "2.0.2" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.2", "@nodelib/fs.stat@^2.0.1": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.2.tgz#2762aea8fe78ea256860182dcb52d61ee4b8fda6" + integrity sha512-z8+wGWV2dgUhLqrtRYa03yDx4HWMvXKi1z8g3m2JyxAx8F7xk74asqPk5LAETjqDSGLFML/6CDl0+yFunSYicw== + +"@nodelib/fs.walk@^1.2.1": + version "1.2.3" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.3.tgz#a555dc256acaf00c62b0db29529028dd4d4cb141" + integrity sha512-l6t8xEhfK9Sa4YO5mIRdau7XSOADfmh3jCr0evNHdY+HNkW6xuQhgMH7D73VV6WpZOagrW0UludvMTiifiwTfA== + dependencies: + "@nodelib/fs.scandir" "2.1.2" + fastq "^1.6.0" + "@samverschueren/stream-to-observable@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@samverschueren/stream-to-observable/-/stream-to-observable-0.3.0.tgz#ecdf48d532c58ea477acfcab80348424f8d0662f" @@ -652,6 +673,37 @@ version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" +"@types/events@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/events/-/events-3.0.0.tgz#2862f3f58a9a7f7c3e78d79f130dd4d71c25c2a7" + integrity sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g== + +"@types/fs-extra@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.0.0.tgz#d3e2c313ca29f95059f198dd60d1f774642d4b25" + integrity sha512-bCtL5v9zdbQW86yexOlXWTEGvLNqWxMFyi7gQA7Gcthbezr2cPSOb8SkESVKA937QD5cIwOFLDFt0MQoXOEr9Q== + dependencies: + "@types/node" "*" + +"@types/glob@^7.1.1": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.1.tgz#aa59a1c6e3fbc421e07ccd31a944c30eba521575" + integrity sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w== + dependencies: + "@types/events" "*" + "@types/minimatch" "*" + "@types/node" "*" + +"@types/minimatch@*": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + +"@types/node@*": + version "12.7.5" + resolved "https://registry.yarnpkg.com/@types/node/-/node-12.7.5.tgz#e19436e7f8e9b4601005d73673b6dc4784ffcc2f" + integrity sha512-9fq4jZVhPNW8r+UYKnxF1e2HkDWOWKM5bC2/7c9wPV835I0aOrVbS/Hw/pWPk2uKrNXQqg9Z959Kz+IYDd5p3w== + "@types/node@^11.11.6": version "11.13.0" resolved "https://registry.yarnpkg.com/@types/node/-/node-11.13.0.tgz#b0df8d6ef9b5001b2be3a94d909ce3c29a80f9e1" @@ -974,6 +1026,11 @@ array-union@^1.0.1: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -1154,6 +1211,13 @@ braces@^2.3.1, braces@^2.3.2: split-string "^3.0.2" to-regex "^3.0.1" +braces@^3.0.1: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + brorand@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" @@ -1477,6 +1541,11 @@ color-name@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689" +colorette@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.1.0.tgz#1f943e5a357fac10b4e0f5aaef3b14cdc1af6ec7" + integrity sha512-6S062WDQUXi6hOfkO/sBPVwE5ASXY4G2+b4atvhJfSsuUUhIaUKlkjLe9692Ipyt5/a+IPF5aVTu3V5gvXq5cg== + colors@^1.1.2: version "1.3.0" resolved "https://registry.yarnpkg.com/colors/-/colors-1.3.0.tgz#5f20c9fef6945cb1134260aab33bfbdc8295e04e" @@ -1790,6 +1859,13 @@ diffie-hellman@^5.0.0: miller-rabin "^4.0.0" randombytes "^2.0.0" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + doctrine@1.5.0: version "1.5.0" resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa" @@ -2201,6 +2277,18 @@ fast-diff@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" +fast-glob@^3.0.3: + version "3.0.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.0.4.tgz#d484a41005cb6faeb399b951fd1bd70ddaebb602" + integrity sha512-wkIbV6qg37xTJwqSsdnIphL1e+LaGz4AIQqr00mIubMaEhv1/HEmJ0uuCGZRNRUkZZmOB5mJKO0ZUTVq+SxMQg== + dependencies: + "@nodelib/fs.stat" "^2.0.1" + "@nodelib/fs.walk" "^1.2.1" + glob-parent "^5.0.0" + is-glob "^4.0.1" + merge2 "^1.2.3" + micromatch "^4.0.2" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -2209,6 +2297,13 @@ fast-levenshtein@~2.0.4: version "2.0.6" resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" +fastq@^1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.6.0.tgz#4ec8a38f4ac25f21492673adb7eae9cfef47d1c2" + integrity sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA== + dependencies: + reusify "^1.0.0" + figgy-pudding@^3.5.1: version "3.5.1" resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" @@ -2243,6 +2338,13 @@ fill-range@^4.0.0: repeat-string "^1.6.1" to-regex-range "^2.1.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + find-babel-config@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-babel-config/-/find-babel-config-1.1.0.tgz#acc01043a6749fec34429be6b64f542ebb5d6355" @@ -2370,6 +2472,15 @@ fs-extra@^5.0.0: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-8.1.0.tgz#49d43c45a88cd9677668cb7be1b46efdb8d2e1c0" + integrity sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g== + dependencies: + graceful-fs "^4.2.0" + jsonfile "^4.0.0" + universalify "^0.1.0" + fs-minipass@^1.2.5: version "1.2.6" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.6.tgz#2c5cc30ded81282bfe8a0d7c7c1853ddeb102c07" @@ -2476,6 +2587,13 @@ glob-parent@^3.1.0: is-glob "^3.1.0" path-dirname "^1.0.0" +glob-parent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.0.0.tgz#1dc99f0f39b006d3e92c2c284068382f0c20e954" + integrity sha512-Z2RwiujPRGluePM6j699ktJYxmPpJKCfpGA13jz2hmFZC7gKetzrWvg5KN3+OsIFmydGyZ1AVwERCq1w/ZZwRg== + dependencies: + is-glob "^4.0.1" + glob@^7.0.3, glob@^7.1.2: version "7.1.2" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" @@ -2538,6 +2656,20 @@ globals@^11.0.1, globals@^11.1.0: version "11.7.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.7.0.tgz#a583faa43055b1aca771914bf68258e2fc125673" +globby@10.0.1: + version "10.0.1" + resolved "https://registry.yarnpkg.com/globby/-/globby-10.0.1.tgz#4782c34cb75dd683351335c5829cc3420e606b22" + integrity sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A== + dependencies: + "@types/glob" "^7.1.1" + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.0.3" + glob "^7.1.3" + ignore "^5.1.1" + merge2 "^1.2.3" + slash "^3.0.0" + globby@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/globby/-/globby-5.0.0.tgz#ebd84667ca0dbb330b99bcfc68eac2bc54370e0d" @@ -2568,7 +2700,7 @@ got@^7.1.0: url-parse-lax "^1.0.0" url-to-options "^1.0.1" -graceful-fs@^4.1.11, graceful-fs@^4.1.15: +graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.2.tgz#6f0952605d0140c1cfdb138ed005775b92d67b02" integrity sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q== @@ -2717,6 +2849,11 @@ ignore@^3.3.3: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" +ignore@^5.1.1: + version "5.1.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.4.tgz#84b7b3dbe64552b6ef0eca99f6743dbec6d97adf" + integrity sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A== + import-local@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/import-local/-/import-local-2.0.0.tgz#55070be38a5993cf18ef6db7e961f5bee5c5a09d" @@ -2945,12 +3082,24 @@ is-glob@^4.0.0: dependencies: is-extglob "^2.1.1" +is-glob@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc" + integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg== + dependencies: + is-extglob "^2.1.1" + is-number@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" dependencies: kind-of "^3.0.2" +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + is-obj@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" @@ -2992,6 +3141,13 @@ is-plain-object@^2.0.1, is-plain-object@^2.0.3, is-plain-object@^2.0.4: dependencies: isobject "^3.0.1" +is-plain-object@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-3.0.0.tgz#47bfc5da1b5d50d64110806c199359482e75a928" + integrity sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg== + dependencies: + isobject "^4.0.0" + is-promise@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.1.0.tgz#79a2a9ece7f096e80f36d2b2f3bc16c1ff4bf3fa" @@ -3072,6 +3228,11 @@ isobject@^3.0.0, isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= +isobject@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/isobject/-/isobject-4.0.0.tgz#3f1c9155e73b192022a80819bacd0343711697b0" + integrity sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA== + isurl@^1.0.0-alpha5: version "1.0.0" resolved "https://registry.yarnpkg.com/isurl/-/isurl-1.0.0.tgz#b27f4f49f3cdaa3ea44a0a5b7f3462e6edc39d67" @@ -3468,6 +3629,11 @@ memory-fs@^0.4.0, memory-fs@^0.4.1: errno "^0.1.3" readable-stream "^2.0.1" +merge2@^1.2.3: + version "1.3.0" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.3.0.tgz#5b366ee83b2f1582c48f87e47cf1a9352103ca81" + integrity sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw== + micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: version "3.1.10" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23" @@ -3486,6 +3652,14 @@ micromatch@^3.0.4, micromatch@^3.1.10, micromatch@^3.1.4, micromatch@^3.1.8: snapdragon "^0.8.1" to-regex "^3.0.2" +micromatch@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.2.tgz#4fcb0999bf9fbc2fcbdd212f6d629b9a56c39259" + integrity sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q== + dependencies: + braces "^3.0.1" + picomatch "^2.0.5" + miller-rabin@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/miller-rabin/-/miller-rabin-4.0.1.tgz#f080351c865b0dc562a8462966daa53543c78a4d" @@ -4073,6 +4247,11 @@ path-type@^2.0.0: dependencies: pify "^2.0.0" +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + pbkdf2@^3.0.3: version "3.0.16" resolved "https://registry.yarnpkg.com/pbkdf2/-/pbkdf2-3.0.16.tgz#7404208ec6b01b62d85bf83853a8064f8d9c2a5c" @@ -4083,6 +4262,11 @@ pbkdf2@^3.0.3: safe-buffer "^5.0.1" sha.js "^2.4.8" +picomatch@^2.0.5: + version "2.0.7" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.0.7.tgz#514169d8c7cd0bdbeecc8a2609e34a7163de69f6" + integrity sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA== + pify@^2.0.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" @@ -4496,6 +4680,11 @@ ret@~0.1.10: version "0.1.15" resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc" +reusify@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + rimraf@2, rimraf@^2.2.8, rimraf@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" @@ -4516,6 +4705,13 @@ ripemd160@^2.0.0, ripemd160@^2.0.1: hash-base "^3.0.0" inherits "^2.0.1" +rollup-plugin-alias@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-alias/-/rollup-plugin-alias-2.0.0.tgz#eea77466a8a8a063007c8edb2e9d7a3d06cbb889" + integrity sha512-JVwxV9nwzjc0q7JmrV9jvZlJ8FykNd5r7RmYps8i/7v+vcmmVpeMvXrljhCboYErf4VZ2z9FEj+fP7eJlEGfug== + dependencies: + slash "^3.0.0" + rollup-plugin-babel@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-4.3.2.tgz#8c0e1bd7aa9826e90769cf76895007098ffd1413" @@ -4523,6 +4719,17 @@ rollup-plugin-babel@^4.3.2: "@babel/helper-module-imports" "^7.0.0" rollup-pluginutils "^2.3.0" +rollup-plugin-copy@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/rollup-plugin-copy/-/rollup-plugin-copy-3.1.0.tgz#435589857f4e346ea63fc137d99dcc1b25f51c3b" + integrity sha512-oVw3ljRV5jv7Yw/6eCEHntVs9Mc+NFglc0iU0J8ei76gldYmtBQ0M/j6WAkZUFVRSrhgfCrEakUllnN87V2f4w== + dependencies: + "@types/fs-extra" "^8.0.0" + colorette "^1.1.0" + fs-extra "^8.1.0" + globby "10.0.1" + is-plain-object "^3.0.0" + rollup-plugin-flow@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/rollup-plugin-flow/-/rollup-plugin-flow-1.1.1.tgz#6ce568f1dd559666b77ab76b4bae251407528db6" @@ -4562,6 +4769,11 @@ run-async@^2.2.0: dependencies: is-promise "^2.1.0" +run-parallel@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.1.9.tgz#c9dd3a7cf9f4b2c4b6244e173a6ed866e61dd679" + integrity sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q== + run-queue@^1.0.0, run-queue@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47" @@ -4682,6 +4894,11 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + slice-ansi@0.0.4: version "0.0.4" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-0.0.4.tgz#edbf8903f66f7ce2f8eafd6ceed65e264c831b35" @@ -5064,6 +5281,13 @@ to-regex-range@^2.1.0: is-number "^3.0.0" repeat-string "^1.6.1" +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + to-regex@^3.0.1, to-regex@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"