Initial commit
This commit is contained in:
commit
af3b49f756
16065 files changed
+2938410
No files matched your search
@@ -0,0 +1,16 @@
|
||||
/* Metro module 10434; source: modules/wishlists/hooks/useWishlistApplicationIds.native.tsx; dependencies: [31, 661, 2] */
|
||||
function _fun80767(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10620:6, offset: 0x01e88a86, size: 128 bytes, params: 8, frame: 18
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_0 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_1 = (require(661) /* metro dependency 661: Constants */).COLLECTIBLES_APPLICATION_ID;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/wishlists/hooks/useWishlistApplicationIds.native.tsx');
|
||||
exports.useWishlistApplicationIds = useWishlistApplicationIds;
|
||||
}
|
||||
|
||||
function useWishlistApplicationIds() { // fn#80768, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10620:266, offset: 0x01e88b06, size: 33 bytes, params: 1, frame: 13
|
||||
return env0_0.useMemo(function() {
|
||||
return [COLLECTIBLES_APPLICATION_ID];
|
||||
}, []);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
/* Metro module 10049; source: modules/wishlists/hooks/useWishlistGiftableItems.native.tsx; dependencies: [31, 661, 2] */
|
||||
function _fun78591(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10235:6, offset: 0x01e2d018, size: 197 bytes, params: 8, frame: 19
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_0 = importAll(31) /* metro dependency 31 */;
|
||||
const SKUProductLines = (require(661) /* metro dependency 661: Constants */).SKUProductLines;
|
||||
const Set = global.Set;
|
||||
const COLLECTIBLES = SKUProductLines.COLLECTIBLES;
|
||||
const PREMIUM = SKUProductLines.PREMIUM;
|
||||
const SOCIAL_LAYER_GAME_ITEM = SKUProductLines.SOCIAL_LAYER_GAME_ITEM;
|
||||
const set = new Set([COLLECTIBLES, PREMIUM, SOCIAL_LAYER_GAME_ITEM]);
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/wishlists/hooks/useWishlistGiftableItems.native.tsx');
|
||||
exports.GIFTABLE_PRODUCT_LINES = set;
|
||||
exports.useWishlistGiftableItems = function(a0) {
|
||||
return a0.useMemo(_fun78593, [a0]);
|
||||
};
|
||||
}
|
||||
|
||||
function useWishlistGiftableItems(a0) { // fn#78592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10235:342, offset: 0x01e2d0dd, size: 44 bytes, params: 2, frame: 14
|
||||
return a0.useMemo(_fun78593, [a0]);
|
||||
}
|
||||
|
||||
function _fun78593() { // fn#78593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10235:397, offset: 0x01e2d109, size: 57 bytes, params: 1, frame: 13
|
||||
let r0 = env0_0 == null ? undefined : env0_0.items.filter(_fun78594);
|
||||
r0 = r0 ?? [];
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun78594(a0) { // fn#78594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10235:455, offset: 0x01e2d142, size: 40 bytes, params: 2, frame: 12
|
||||
const value = environment.__proto__.__proto__;
|
||||
const binding = env2_1;
|
||||
return binding.has(a0.skuProductLine) && !a0.isOwned;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,460 @@
|
||||
/* Metro module 10034; source: modules/wishlists/hooks/useWishlistHooks.tsx; dependencies: [57, 31, 5189, 1226, 1878, 10035, 10036, 566, 10039, 22, 10040, 8491, 10044, 10049, 2] */
|
||||
function _fun78356(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:6, offset: 0x01e274d7, size: 427 bytes, params: 8, frame: 22
|
||||
let env0_0 = require;
|
||||
const _arrayLikeToArray_78359 = function(a0, a1) {
|
||||
var r0;
|
||||
var r1;
|
||||
var r2;
|
||||
var value3;
|
||||
var length;
|
||||
var value5;
|
||||
var value = undefined;
|
||||
var value2 = value == null;
|
||||
reducibleJoin2: while (true) {
|
||||
if (value2) {
|
||||
r0 = value2;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
value3 = value > a0.length;
|
||||
r0 = value3;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
reducibleJoin4: while (true) {
|
||||
if (r0) {
|
||||
length = a0.length;
|
||||
r1 = length;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
r1 = value;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
value = (0, global.Array)(r1);
|
||||
var value4 = 0;
|
||||
if (value4 < r1) {
|
||||
r2 = value4;
|
||||
reducibleLoop5: while (true) {
|
||||
value[r2] = a0[r2];
|
||||
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
||||
if (value5 < r1) {
|
||||
r2 = value5;
|
||||
continue reducibleLoop5;
|
||||
}
|
||||
break reducibleLoop5;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
const getUserWishlistKey = function(a0, a1) {
|
||||
return a1 != null ? '' + a0 + ':' + a1 : '' + a0 + ':default';
|
||||
};
|
||||
const closure = useFetchWishlist;
|
||||
const closure2 = useFetchWishlistAndProfileInfoForUser;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
||||
const env0_4 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_5 = (require(31) /* metro dependency 31 */).useEffect;
|
||||
const userProfileStore = importDefault(5189) /* metro dependency 5189: UserProfileStore */;
|
||||
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
||||
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
||||
const wishlistStore = importDefault(10035) /* metro dependency 10035: WishlistStore */;
|
||||
const env0_10 = (require(10036) /* metro dependency 10036: WishlistRecord */).getWishlistSkuIds;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/wishlists/hooks/useWishlistHooks.tsx');
|
||||
exports.WISHLIST_IN_DM_LENGTH = 5;
|
||||
exports.WISHLIST_IN_DM_LENGTH_MOBILE = 6;
|
||||
exports.WISHLIST_TOOLTIP_DELAY_MS = 350;
|
||||
exports.WishlistItemSource = {WISHLIST: 'wishlist', POPULAR: 'popular'};
|
||||
exports.WishlistFetchSource = {USER_PROFILE: 'user_profile'};
|
||||
exports.useFetchWishlists = useFetchWishlists;
|
||||
exports.useFetchWishlist = closure;
|
||||
exports.useIsSkuInWishlist = function(a0, a1) {
|
||||
var env0_0 = a0;
|
||||
var env0_1 = a1;
|
||||
return require(dependencyMap[7]).useStateFromStores([WishlistStore], _fun78383);
|
||||
};
|
||||
exports.useShouldShowWishlistInDMGifting = useShouldShowWishlistInDMGifting;
|
||||
exports.useCurrentUserWishlist = function() {
|
||||
return useFetchWishlistAndProfileInfoForUser(require(dependencyMap[7]).useStateFromStores([AuthenticationStore],
|
||||
_fun78389));
|
||||
};
|
||||
exports.useFetchWishlistAndProfileInfoForUser = closure2;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelperLoose_78357(a0, a1) { // fn#78357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:211, offset: 0x01e27682, size: 372 bytes, params: 3, frame: 20
|
||||
var r6;
|
||||
var r9;
|
||||
var r5;
|
||||
var value3;
|
||||
var regexp;
|
||||
const env0_0 = a0;
|
||||
const Symbol = global.Symbol;
|
||||
let value = typeof Symbol !== 'undefined';
|
||||
let r1 = value && a0[global.Symbol.iterator];
|
||||
r1 = !r1 ? a0['@@iterator'] : r1;
|
||||
if (r1) {
|
||||
value = r1.call(a0);
|
||||
return value.next.bind(value);
|
||||
}
|
||||
const Array = global.Array;
|
||||
if (Array.isArray(a0)) {
|
||||
if (r1) {
|
||||
}
|
||||
return _fun78358;
|
||||
}
|
||||
value = undefined;
|
||||
if (a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
value = _arrayLikeToArray_78359(a0, value);
|
||||
r5 = value;
|
||||
} else {
|
||||
value3 = ({}).toString.call(a0).slice(8, -1);
|
||||
r6 = value3 === 'Object' && a0.constructor;
|
||||
r9 = r6 ? a0.constructor.name : value3;
|
||||
if (r9 === 'Map') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Set') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Arguments') {
|
||||
value = _arrayLikeToArray_78359(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
||||
if (regexp.test(r9)) {
|
||||
value = _arrayLikeToArray_78359(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
}
|
||||
r5 = r6;
|
||||
}
|
||||
} else {
|
||||
r5 = value;
|
||||
}
|
||||
if (r5) {
|
||||
if (r5) {
|
||||
}
|
||||
return _fun78358;
|
||||
}
|
||||
const TypeError = global.TypeError;
|
||||
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
||||
}
|
||||
|
||||
function useFetchWishlist({wishlistId, userId, source = env0_11.USER_PROFILE}) { // fn#78361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:1328, offset: 0x01e2783f, size: 374 bytes, params: 2, frame: 25
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
|
||||
const value3 = undefined(Reflect.apply(useStateFromStoresArray, fluxModule, [[WishlistStore], _fun78362]), 4);
|
||||
const property = value3[0];
|
||||
const property2 = value3[1];
|
||||
const property3 = value3[2];
|
||||
const env0_4 = property3;
|
||||
const property4 = value3[3];
|
||||
(require(10040) /* metro dependency 10040: useGetOrFetchStorefrontPrices */).useGetOrFetchStorefrontPricesForSkuIds({skuIds: env0_4.useMemo(_fun78363,
|
||||
[property])});
|
||||
const moduleValue3 = fluxModule;
|
||||
const useStateFromStores = moduleValue3.useStateFromStores;
|
||||
useEffect(_fun78365, [wishlistId, source, property, Reflect.apply(useStateFromStores, moduleValue3,
|
||||
[[UserProfileStore], _fun78364]), property4, property3]);
|
||||
return {wishlist: property, isFetching: property2 === 'fetching',
|
||||
wasFetched: property2 === 'success' || property2 === 'error', error: property3};
|
||||
}
|
||||
|
||||
function useFetchWishlistAndProfileInfoForUser(a0) { // fn#78366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2055, offset: 0x01e27b51, size: 220 bytes, params: 2, frame: 21
|
||||
var object2;
|
||||
const env0_0 = a0;
|
||||
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun78367);
|
||||
const {userProfile,
|
||||
wishlistId} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([UserProfileStore],
|
||||
_fun78368, [a0]);
|
||||
env0_4.useEffect(_fun78369, [user, a0, userProfile]);
|
||||
object2 = {};
|
||||
copyDataProperties(object2, useFetchWishlist({wishlistId: wishlistId, userId: a0}), undefined);
|
||||
object2['wishlistId'] = wishlistId;
|
||||
object2['userProfile'] = userProfile;
|
||||
return object2;
|
||||
}
|
||||
|
||||
function useFetchWishlists({wishlistIdsAndUsers, source = env0_11.USER_PROFILE}) { // fn#78370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2771, offset: 0x01e27cf2, size: 345 bytes, params: 2, frame: 25
|
||||
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([WishlistStore], function() {
|
||||
return wishlistIdsAndUsers.map(_fun78372);
|
||||
}, [wishlistIdsAndUsers]);
|
||||
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([WishlistStore], function() {
|
||||
return wishlistIdsAndUsers.some(_fun78374);
|
||||
}, [wishlistIdsAndUsers]);
|
||||
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([WishlistStore], function() {
|
||||
return wishlistIdsAndUsers.map(_fun78376);
|
||||
}, [wishlistIdsAndUsers]);
|
||||
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([UserProfileStore],
|
||||
function() {
|
||||
return wishlistIdsAndUsers.map(_fun78378);
|
||||
});
|
||||
const binding = env0_4;
|
||||
const useMemo = binding.useMemo;
|
||||
useEffect(_fun78381, [wishlistIdsAndUsers, source, Reflect.apply(useMemo, binding, [function() {
|
||||
wishlistIdsAndUsers.forEach(_fun78380);
|
||||
return {};
|
||||
}, [wishlistIdsAndUsers, value5]])]);
|
||||
return {wishlists: value2, isFetching: value3, errors: value4};
|
||||
}
|
||||
|
||||
function useIsSkuInWishlist(a0, a1) { // fn#78382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3873, offset: 0x01e280ea, size: 73 bytes, params: 3, frame: 14
|
||||
const env0_0 = a0;
|
||||
const env0_1 = a1;
|
||||
return (require(566) /* metro dependency 566: flux */).useStateFromStores([WishlistStore], _fun78383);
|
||||
}
|
||||
|
||||
function useShouldShowWishlistInDMGifting({isGift, giftRecipient, isSocialLayerStorefrontEnabled}) { // fn#78384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:4014, offset: 0x01e28162, size: 348 bytes, params: 2, frame: 22
|
||||
let value = undefined;
|
||||
isSocialLayerStorefrontEnabled = isSocialLayerStorefrontEnabled === value || isSocialLayerStorefrontEnabled;
|
||||
value.useEffect(_fun78385, [giftRecipient == null ? value : giftRecipient.id]);
|
||||
const value5 = (importDefault(10044) /* metro dependency 10044: useDisplayProfileSocialLayerStorefrontApplicationIds */)({userId: giftRecipient == null ? value : giftRecipient.id});
|
||||
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserProfileStore], _fun78386);
|
||||
const wishlist = useFetchWishlist({wishlistId: value6 != null && isGift && giftRecipient != null ? value6 : null,
|
||||
userId: giftRecipient == null ? value : giftRecipient.id}).wishlist;
|
||||
value = require(10049) /* metro dependency 10049: useWishlistGiftableItemsNative */;
|
||||
value = value.useWishlistGiftableItems(wishlist);
|
||||
return value.useMemo(_fun78387, [isGift, giftRecipient, value, value5, isSocialLayerStorefrontEnabled]);
|
||||
}
|
||||
|
||||
function useCurrentUserWishlist() { // fn#78388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:4597, offset: 0x01e28392, size: 68 bytes, params: 1, frame: 15
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
const useStateFromStores = fluxModule.useStateFromStores;
|
||||
return useFetchWishlistAndProfileInfoForUser(Reflect.apply(useStateFromStores, fluxModule, [[AuthenticationStore],
|
||||
function() {
|
||||
return AuthenticationStore.getId();
|
||||
}]));
|
||||
}
|
||||
|
||||
function _fun78362() { // fn#78362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:1447, offset: 0x01e279b5, size: 127 bytes, params: 1, frame: 13
|
||||
return wishlistId == null ? [null, 'success', undefined, undefined] : [WishlistStore.getWishlist(wishlistId),
|
||||
WishlistStore.getStatus(wishlistId), WishlistStore.getError(wishlistId), WishlistStore.getUpdatedAt(wishlistId)];
|
||||
}
|
||||
|
||||
function _fun78363() { // fn#78363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:1608, offset: 0x01e27a34, size: 70 bytes, params: 1, frame: 13
|
||||
var r0;
|
||||
var value2;
|
||||
var moduleValue;
|
||||
if (env0_3 == null) {
|
||||
r0 = [];
|
||||
} else {
|
||||
value2 = environment.__proto__;
|
||||
moduleValue = require(22) /* metro dependency 22 */;
|
||||
r0 = moduleValue.uniq(getWishlistSkuIds(env0_3));
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun78364() { // fn#78364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:1749, offset: 0x01e27a7a, size: 69 bytes, params: 1, frame: 14
|
||||
var value2;
|
||||
if (wishlistId != null) {
|
||||
if (userId != null) {
|
||||
value2 = environment.__proto__;
|
||||
return UserProfileStore.getWishlistSettings(userId, wishlistId)?.updated_at;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _fun78365() { // fn#78365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:1857, offset: 0x01e27abf, size: 146 bytes, params: 1, frame: 16
|
||||
var value8;
|
||||
var defaultImport;
|
||||
let r1 = wishlistId == null || WishlistStore.isFetching(wishlistId);
|
||||
r1 = !r1 ? env0_4 != null : r1;
|
||||
if (!r1) {
|
||||
if (env0_3 == null || env0_6 != null && env0_5 !== env0_6) {
|
||||
value8 = environment.__proto__;
|
||||
defaultImport = importDefault(10039) /* metro dependency 10039: WishlistActionCreators */;
|
||||
defaultImport.fetchWishlist(wishlistId, env0_6, env0_2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _fun78368() { // fn#78368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2204, offset: 0x01e27c2d, size: 89 bytes, params: 1, frame: 15
|
||||
const object2 = {};
|
||||
const value2 = null;
|
||||
object2.userProfile = value2 != env0_0 ? UserProfileStore.getUserProfile(env0_0) : value2;
|
||||
object2.wishlistId = value2 != env0_0 ? UserProfileStore.getFirstWishlistId(env0_0) : value2;
|
||||
return object2;
|
||||
}
|
||||
|
||||
function _fun78369() { // fn#78369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2362, offset: 0x01e27c86, size: 108 bytes, params: 1, frame: 16
|
||||
var userBinding;
|
||||
var value6;
|
||||
var defaultImport;
|
||||
if (env0_0 != null && userProfile == null && user != null && userProfile == null) {
|
||||
value6 = environment.__proto__;
|
||||
defaultImport = importDefault(8491) /* metro dependency 8491: maybeFetchUserProfile */;
|
||||
userBinding = user;
|
||||
defaultImport(userBinding.id, userBinding.getAvatarURL(null, 80));
|
||||
}
|
||||
}
|
||||
|
||||
function _fun78371() { // fn#78371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2891, offset: 0x01e27e4b, size: 28 bytes, params: 1, frame: 11
|
||||
return wishlistIdsAndUsers.map(_fun78372);
|
||||
}
|
||||
|
||||
function _fun78373() { // fn#78373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2993, offset: 0x01e27e8d, size: 29 bytes, params: 1, frame: 11
|
||||
return wishlistIdsAndUsers.some(_fun78374);
|
||||
}
|
||||
|
||||
function _fun78375() { // fn#78375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3096, offset: 0x01e27ed0, size: 28 bytes, params: 1, frame: 11
|
||||
return wishlistIdsAndUsers.map(_fun78376);
|
||||
}
|
||||
|
||||
function _fun78377() { // fn#78377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3202, offset: 0x01e27f14, size: 28 bytes, params: 1, frame: 11
|
||||
return wishlistIdsAndUsers.map(_fun78378);
|
||||
}
|
||||
|
||||
function _fun78379() { // fn#78379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3344, offset: 0x01e27f70, size: 34 bytes, params: 1, frame: 12
|
||||
wishlistIdsAndUsers.forEach(_fun78380);
|
||||
return {};
|
||||
}
|
||||
|
||||
function _fun78381() { // fn#78381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3477, offset: 0x01e27fd9, size: 273 bytes, params: 1, frame: 27
|
||||
var r4;
|
||||
var r14;
|
||||
var r13;
|
||||
var value5;
|
||||
var wishlistId;
|
||||
var userId;
|
||||
var isFetching;
|
||||
var getError;
|
||||
var wishlist;
|
||||
var updatedAt;
|
||||
var binding;
|
||||
var property;
|
||||
var value8;
|
||||
var value9;
|
||||
var value10;
|
||||
var defaultImport;
|
||||
var value11;
|
||||
const value3 = _createForOfIteratorHelperLoose_78357(wishlistIdsAndUsers);
|
||||
const value4 = value3();
|
||||
let done = value4.done;
|
||||
if (!done) {
|
||||
r4 = value4;
|
||||
while (true) {
|
||||
value5 = r4.value;
|
||||
wishlistId = value5.wishlistId;
|
||||
userId = value5.userId;
|
||||
if (wishlistId != null) {
|
||||
isFetching = WishlistStore.isFetching;
|
||||
if (Reflect.apply(isFetching, WishlistStore, [wishlistId])) {
|
||||
break;
|
||||
}
|
||||
getError = WishlistStore.getError;
|
||||
if (Reflect.apply(getError, WishlistStore, [wishlistId]) != null) {
|
||||
break;
|
||||
}
|
||||
wishlist = WishlistStore.getWishlist(wishlistId);
|
||||
updatedAt = WishlistStore.getUpdatedAt(wishlistId);
|
||||
binding = env0_3;
|
||||
property = binding[getUserWishlistKey(userId, wishlistId)];
|
||||
value8 = wishlist == null;
|
||||
if (value8) {
|
||||
r13 = value8;
|
||||
continue;
|
||||
}
|
||||
value9 = property != null;
|
||||
if (!value9) {
|
||||
r14 = value9;
|
||||
continue;
|
||||
}
|
||||
value10 = updatedAt !== property;
|
||||
r14 = value10;
|
||||
r13 = r14;
|
||||
if (r13) {
|
||||
defaultImport = importDefault(10039) /* metro dependency 10039: WishlistActionCreators */;
|
||||
defaultImport.fetchWishlist(wishlistId, property, env0_1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
value11 = value3();
|
||||
done = value11.done;
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
r4 = value11;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function _fun78383() { // fn#78383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3946, offset: 0x01e28133, size: 47 bytes, params: 1, frame: 14
|
||||
return env0_0 != null && WishlistStore.hasSkuId(env0_0, require);
|
||||
}
|
||||
|
||||
function _fun78385() { // fn#78385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:4133, offset: 0x01e282be, size: 72 bytes, params: 1, frame: 13
|
||||
var value3;
|
||||
const giftRecipientBinding = giftRecipient;
|
||||
const value2 = undefined;
|
||||
if ((giftRecipientBinding == null ? value2 : giftRecipient.id) != null) {
|
||||
value3 = environment.__proto__;
|
||||
(importDefault(8491) /* metro dependency 8491: maybeFetchUserProfile */)(giftRecipient.id);
|
||||
}
|
||||
return value2;
|
||||
}
|
||||
|
||||
function _fun78386() { // fn#78386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:4287, offset: 0x01e28306, size: 65 bytes, params: 1, frame: 12
|
||||
const giftRecipientBinding = giftRecipient;
|
||||
const value2 = null;
|
||||
return value2 == (value2 == giftRecipientBinding ? undefined : giftRecipient.id) ? value2 : UserProfileStore.getFirstWishlistId(giftRecipient.id);
|
||||
}
|
||||
|
||||
function _fun78387() { // fn#78387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:4507, offset: 0x01e28347, size: 75 bytes, params: 1, frame: 6
|
||||
return isGift === true && giftRecipient != null && (env0_4.length > 0 || isSocialLayerStorefrontEnabled && env0_3.length > 0);
|
||||
}
|
||||
|
||||
function _fun78372({wishlistId}) { // fn#78372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:2902, offset: 0x01e27e67, size: 38 bytes, params: 2, frame: 12
|
||||
var r0;
|
||||
let value = null;
|
||||
if (value != wishlistId) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = WishlistStore.getWishlist(wishlistId);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun78374({wishlistId}) { // fn#78374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3005, offset: 0x01e27eaa, size: 38 bytes, params: 2, frame: 12
|
||||
var r0;
|
||||
let value = wishlistId != null;
|
||||
if (value) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = WishlistStore.isFetching(wishlistId);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun78376({wishlistId}) { // fn#78376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3107, offset: 0x01e27eec, size: 40 bytes, params: 2, frame: 12
|
||||
var r0;
|
||||
let value = undefined;
|
||||
if (wishlistId != null) {
|
||||
value = environment.__proto__.__proto__;
|
||||
value = WishlistStore.getError(wishlistId);
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun78378({wishlistId, userId}) { // fn#78378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3213, offset: 0x01e27f30, size: 64 bytes, params: 2, frame: 16
|
||||
return wishlistId != null ? UserProfileStore.getWishlistSettings(userId, wishlistId)?.updated_at : undefined;
|
||||
}
|
||||
|
||||
function _fun78380({userId, wishlistId}, a1) { // fn#78380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10220:3376, offset: 0x01e27f92, size: 71 bytes, params: 3, frame: 16
|
||||
var binding;
|
||||
var value3;
|
||||
if (!(a1 >= env1_2.length)) {
|
||||
binding = env0_0;
|
||||
value3 = environment.__proto__.__proto__;
|
||||
binding[getUserWishlistKey(userId, wishlistId)] = env1_2[a1];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,587 @@
|
||||
/* Metro module 10432; source: modules/wishlists/hooks/useWishlistRecommendations.tsx; dependencies: [57, 31, 5189, 1226, 10433, 6830, 672, 566, 10034, 1360, 10039, 22, 10040, 8491, 10434, 10435, 2] */
|
||||
function _fun80709(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:6, offset: 0x01e87389, size: 399 bytes, params: 8, frame: 19
|
||||
var object2;
|
||||
const env0_0 = require;
|
||||
const _arrayLikeToArray_80712 = function(a0, a1) {
|
||||
var r0;
|
||||
var r1;
|
||||
var r2;
|
||||
var value3;
|
||||
var length;
|
||||
var value5;
|
||||
var value = undefined;
|
||||
var value2 = value == null;
|
||||
reducibleJoin2: while (true) {
|
||||
if (value2) {
|
||||
r0 = value2;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
value3 = value > a0.length;
|
||||
r0 = value3;
|
||||
break reducibleJoin2;
|
||||
}
|
||||
reducibleJoin4: while (true) {
|
||||
if (r0) {
|
||||
length = a0.length;
|
||||
r1 = length;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
r1 = value;
|
||||
break reducibleJoin4;
|
||||
}
|
||||
value = (0, global.Array)(r1);
|
||||
var value4 = 0;
|
||||
if (value4 < r1) {
|
||||
r2 = value4;
|
||||
reducibleLoop5: while (true) {
|
||||
value[r2] = a0[r2];
|
||||
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
||||
if (value5 < r1) {
|
||||
r2 = value5;
|
||||
continue reducibleLoop5;
|
||||
}
|
||||
break reducibleLoop5;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
};
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
||||
const env0_4 = importAll(31) /* metro dependency 31 */;
|
||||
const userProfileStore = importDefault(5189) /* metro dependency 5189: UserProfileStore */;
|
||||
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
|
||||
const wishlistRecommendationsStore = importDefault(10433) /* metro dependency 10433: WishlistRecommendationsStore */;
|
||||
let value = importDefault(6830) /* metro dependency 6830: WishlistRecommendationRecord */;
|
||||
const env0_8 = (require(6830) /* metro dependency 6830: WishlistRecommendationRecord */).WishlistRecommendationReason;
|
||||
const Millis = (importDefault(672) /* metro dependency 672: Durations */).Millis;
|
||||
const MINUTE = Millis.MINUTE;
|
||||
const env0_9 = 30 * MINUTE;
|
||||
object2 = {'state': 'success', 'data': null, 'fetchedAt': 0};
|
||||
value = new value({skus: [], skus_to_user_and_reason: {}, applications: []});
|
||||
object2.data = value;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/wishlists/hooks/useWishlistRecommendations.tsx');
|
||||
exports.useWishlistRecommendationsForSingleUser = useWishlistRecommendationsForSingleUser;
|
||||
exports.useRecommendationsForApplicationIds = useRecommendationsForApplicationIds;
|
||||
exports.useRecommendationsForSingleUser = useRecommendationsForSingleUser;
|
||||
}
|
||||
|
||||
function _createForOfIteratorHelperLoose_80710(a0, a1) { // fn#80710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:201, offset: 0x01e87518, size: 372 bytes, params: 3, frame: 20
|
||||
var r6;
|
||||
var r9;
|
||||
var r5;
|
||||
var value3;
|
||||
var regexp;
|
||||
const env0_0 = a0;
|
||||
const Symbol = global.Symbol;
|
||||
let value = typeof Symbol !== 'undefined';
|
||||
let r1 = value && a0[global.Symbol.iterator];
|
||||
r1 = !r1 ? a0['@@iterator'] : r1;
|
||||
if (r1) {
|
||||
value = r1.call(a0);
|
||||
return value.next.bind(value);
|
||||
}
|
||||
const Array = global.Array;
|
||||
if (Array.isArray(a0)) {
|
||||
if (r1) {
|
||||
}
|
||||
return _fun80711;
|
||||
}
|
||||
value = undefined;
|
||||
if (a0) {
|
||||
if (typeof a0 === 'string') {
|
||||
value = _arrayLikeToArray_80712(a0, value);
|
||||
r5 = value;
|
||||
} else {
|
||||
value3 = ({}).toString.call(a0).slice(8, -1);
|
||||
r6 = value3 === 'Object' && a0.constructor;
|
||||
r9 = r6 ? a0.constructor.name : value3;
|
||||
if (r9 === 'Map') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Set') {
|
||||
r6 = global.Array.from(a0);
|
||||
} else if (r9 === 'Arguments') {
|
||||
value = _arrayLikeToArray_80712(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
||||
if (regexp.test(r9)) {
|
||||
value = _arrayLikeToArray_80712(a0, value);
|
||||
r6 = value;
|
||||
} else {
|
||||
r6 = value;
|
||||
}
|
||||
}
|
||||
r5 = r6;
|
||||
}
|
||||
} else {
|
||||
r5 = value;
|
||||
}
|
||||
if (r5) {
|
||||
if (r5) {
|
||||
}
|
||||
return _fun80711;
|
||||
}
|
||||
const TypeError = global.TypeError;
|
||||
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
||||
}
|
||||
|
||||
function useWishlistRecommendationsWithWishlists({userIdsAndWishlistIds, numItems, applicationIds, source, filterByApplicationIds}) { // fn#80713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:1239, offset: 0x01e8768c, size: 518 bytes, params: 2, frame: 22
|
||||
const value = undefined;
|
||||
const r1 = source !== value ? source : (require(10034) /* metro dependency 10034: useWishlistHooks */).WishlistFetchSource.USER_PROFILE;
|
||||
filterByApplicationIds = !(filterByApplicationIds === value) && filterByApplicationIds;
|
||||
let env0_4 = value;
|
||||
const binding = env0_4;
|
||||
const useMemo = binding.useMemo;
|
||||
const value5 = useFetchWishlistRecommendations({userIds: Reflect.apply(useMemo, binding, [function() {
|
||||
return userIdsAndWishlistIds.map(_fun80718);
|
||||
}, [userIdsAndWishlistIds]]), numItems: numItems, applicationIds: applicationIds});
|
||||
const value6 = useSortedWishlistUnownedSkus({userIdsAndWishlistIds: userIdsAndWishlistIds, source: r1,
|
||||
applicationIdsFilter: filterByApplicationIds ? applicationIds : value});
|
||||
const sortedWishlistSkus = value6.sortedWishlistSkus;
|
||||
const wishlistSkuIdToSku = value6.wishlistSkuIdToSku;
|
||||
const wishlistSkusToUserAndReasonMap = value6.wishlistSkusToUserAndReasonMap;
|
||||
env0_4 = wishlistSkusToUserAndReasonMap;
|
||||
const wishlistsAreFetching = value6.wishlistsAreFetching;
|
||||
const wishlistErrors = value6.wishlistErrors;
|
||||
const {filteredRecommendations, skusToUserAndReasonRecommendations} = env0_4.useMemo(_fun80729, [value5,
|
||||
wishlistSkuIdToSku]);
|
||||
const {combinedSkus, combinedSkusToUserAndReason} = env0_4.useMemo(_fun80731, [sortedWishlistSkus,
|
||||
filteredRecommendations, wishlistSkusToUserAndReasonMap, skusToUserAndReasonRecommendations]);
|
||||
const value9 = env0_4.useMemo(_fun80732, [wishlistsAreFetching, value5, wishlistErrors]);
|
||||
(require(10040) /* metro dependency 10040: useGetOrFetchStorefrontPrices */).useGetOrFetchStorefrontPricesForSkuIds({skuIds: env0_4.useMemo(_fun80733,
|
||||
[filteredRecommendations, combinedSkus])});
|
||||
return {recommendations: filteredRecommendations, wishlistAndRecommendations: combinedSkus,
|
||||
skusToUserAndReason: combinedSkusToUserAndReason, status: value9};
|
||||
}
|
||||
|
||||
function useMemoizedUserIdAndWishlistId(a0) { // fn#80736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:4334, offset: 0x01e880ab, size: 153 bytes, params: 2, frame: 16
|
||||
const env0_0 = a0;
|
||||
let binding = env0_4;
|
||||
binding.useEffect(_fun80737, [a0]);
|
||||
const fluxModule = require(566) /* metro dependency 566: flux */;
|
||||
const useStateFromStoresObject = fluxModule.useStateFromStoresObject;
|
||||
const defaultWishlistId = Reflect.apply(useStateFromStoresObject, fluxModule, [[UserProfileStore],
|
||||
_fun80738]).defaultWishlistId;
|
||||
binding = env0_4;
|
||||
const useMemo = binding.useMemo;
|
||||
return {userIdsAndWishlistIds: Reflect.apply(useMemo, binding, [_fun80739, [a0, defaultWishlistId]]),
|
||||
defaultWishlistId: defaultWishlistId};
|
||||
}
|
||||
|
||||
function useWishlistRecommendationsForSingleUser({userId, numItems, source}) { // fn#80740, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:4761, offset: 0x01e881ad, size: 246 bytes, params: 2, frame: 19
|
||||
const r4 = source !== undefined ? source : (require(10034) /* metro dependency 10034: useWishlistHooks */).WishlistFetchSource.USER_PROFILE;
|
||||
const {userIdsAndWishlistIds, defaultWishlistId} = useMemoizedUserIdAndWishlistId(userId);
|
||||
const object2 = {userIdsAndWishlistIds: userIdsAndWishlistIds};
|
||||
object2.applicationIds = (require(10434) /* metro dependency 10434: useWishlistApplicationIdsNative */).useWishlistApplicationIds(userId);
|
||||
object2.numItems = numItems;
|
||||
object2.source = r4;
|
||||
value = useWishlistRecommendationsWithWishlists(object2);
|
||||
const wishlistAndRecommendations = value.wishlistAndRecommendations;
|
||||
const skusToUserAndReason = value.skusToUserAndReason;
|
||||
const status = value.status;
|
||||
const useWishlistSkuFilter = (require(10435) /* metro dependency 10435: useWishlistSkuFilterNative */).useWishlistSkuFilter;
|
||||
value = Reflect.apply(useWishlistSkuFilter, value, [{wishlistAndRecommendations: wishlistAndRecommendations,
|
||||
skusToUserAndReason: skusToUserAndReason, userId: userId, numItems: numItems}]);
|
||||
return {wishlistAndRecommendations: value.slicedWishlistAndRecommendations,
|
||||
skusToUserAndReason: skusToUserAndReason, status: status, defaultWishlistId: defaultWishlistId,
|
||||
totalUnownedWishlistItemCount: value.totalUnownedWishlistItemCount};
|
||||
}
|
||||
|
||||
function useRecommendationsForApplicationIds({applicationIds, userIds, numItems, source}) { // fn#80741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5515, offset: 0x01e882a3, size: 236 bytes, params: 2, frame: 21
|
||||
const r5 = source !== undefined ? source : (require(10034) /* metro dependency 10034: useWishlistHooks */).WishlistFetchSource.USER_PROFILE;
|
||||
const object2 = {};
|
||||
let binding = env0_4;
|
||||
let useMemo = binding.useMemo;
|
||||
object2.userIdsAndWishlistIds = useMemoizedUserIdsAndWishlistIds(Reflect.apply(useMemo, binding, [_fun80749,
|
||||
[userIds]]));
|
||||
object2.applicationIds = applicationIds;
|
||||
object2.numItems = numItems;
|
||||
object2.source = r5;
|
||||
object2.filterByApplicationIds = true;
|
||||
const {wishlistAndRecommendations, skusToUserAndReason, status} = useWishlistRecommendationsWithWishlists(object2);
|
||||
binding = env0_4;
|
||||
useMemo = binding.useMemo;
|
||||
return {recommendations: Reflect.apply(useMemo, binding, [function() {
|
||||
return wishlistAndRecommendations.slice(0, numItems);
|
||||
}, [wishlistAndRecommendations, numItems]]), skusToUserAndReason: skusToUserAndReason, status: status};
|
||||
}
|
||||
|
||||
function useRecommendationsForSingleUser({userId, numItems, source}) { // fn#80751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:6323, offset: 0x01e88512, size: 222 bytes, params: 2, frame: 20
|
||||
const r5 = source !== undefined ? source : (require(10034) /* metro dependency 10034: useWishlistHooks */).WishlistFetchSource.USER_PROFILE;
|
||||
const object2 = {};
|
||||
const userIdsAndWishlistIds = useMemoizedUserIdAndWishlistId(userId).userIdsAndWishlistIds;
|
||||
object2.userIdsAndWishlistIds = userIdsAndWishlistIds;
|
||||
object2.applicationIds = (require(10434) /* metro dependency 10434: useWishlistApplicationIdsNative */).useWishlistApplicationIds(userId);
|
||||
object2.numItems = numItems;
|
||||
object2.source = r5;
|
||||
const {recommendations, skusToUserAndReason, status} = useWishlistRecommendationsWithWishlists(object2);
|
||||
const binding = env0_4;
|
||||
const useMemo = binding.useMemo;
|
||||
return {recommendations: Reflect.apply(useMemo, binding, [function() {
|
||||
return recommendations.slice(0, numItems);
|
||||
}, [recommendations, numItems]]), skusToUserAndReason: skusToUserAndReason, status: status};
|
||||
}
|
||||
|
||||
function useFetchWishlistRecommendations({userIds, numItems, applicationIds}) { // fn#80714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:1428, owner: useWishlistRecommendationsWithWishlists.useFetchWishlistRecommendations, offset: 0x01e87892, size: 154 bytes, params: 2, frame: 19
|
||||
const recommendations = (require(566) /* metro dependency 566: flux */).useStateFromStores([WishlistRecommendationsStore],
|
||||
function() {
|
||||
return WishlistRecommendationsStore.getRecommendations(userIds, applicationIds);
|
||||
});
|
||||
env1_4.useEffect(_fun80716, [userIds, applicationIds, numItems]);
|
||||
return userIds.length === 0 ? env1_10 : applicationIds.length !== 0 ? recommendations : env1_10;
|
||||
}
|
||||
|
||||
function _fun80717() { // fn#80717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:1912, offset: 0x01e87a2e, size: 28 bytes, params: 1, frame: 11
|
||||
return userIdsAndWishlistIds.map(function(a0) {
|
||||
return a0.userId;
|
||||
});
|
||||
}
|
||||
|
||||
function useSortedWishlistUnownedSkus({userIdsAndWishlistIds, source, applicationIdsFilter}) { // fn#80719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:1979, owner: useWishlistRecommendationsWithWishlists.useSortedWishlistUnownedSkus, offset: 0x01e87a4a, size: 284 bytes, params: 2, frame: 21
|
||||
const id = (require(566) /* metro dependency 566: flux */).useStateFromStores([AuthenticationStore], function() {
|
||||
return AuthenticationStore.getId();
|
||||
});
|
||||
const {wishlists, isFetching,
|
||||
errors} = (require(10034) /* metro dependency 10034: useWishlistHooks */).useFetchWishlists({wishlistIdsAndUsers: userIdsAndWishlistIds,
|
||||
source: source});
|
||||
let binding = env1_4;
|
||||
let useMemo = binding.useMemo;
|
||||
const value3 = Reflect.apply(useMemo, binding, [_fun80721, [wishlists, applicationIdsFilter]]);
|
||||
const value4 = env1_4.useMemo(_fun80722, [wishlists, applicationIdsFilter]);
|
||||
binding = env1_4;
|
||||
useMemo = binding.useMemo;
|
||||
return {sortedWishlistSkus: Reflect.apply(useMemo, binding, [_fun80726, [id, value4, value3]]),
|
||||
wishlistSkuIdToSku: value4, wishlistSkusToUserAndReasonMap: value3, wishlistsAreFetching: isFetching,
|
||||
wishlistErrors: errors};
|
||||
}
|
||||
|
||||
function _fun80729() { // fn#80729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:3392, offset: 0x01e87e7b, size: 116 bytes, params: 1, frame: 13
|
||||
var r0;
|
||||
var object2;
|
||||
var data;
|
||||
if (env0_1 == null) {
|
||||
r0 = {filteredRecommendations: [], skusToUserAndReasonRecommendations: {}};
|
||||
} else if (env0_1.state !== 'success') {
|
||||
r0 = {filteredRecommendations: [], skusToUserAndReasonRecommendations: {}};
|
||||
} else {
|
||||
object2 = {};
|
||||
data = env0_1.data;
|
||||
object2.filteredRecommendations = data.skus.filter(function({id}) {
|
||||
return !(id in wishlistSkuIdToSku);
|
||||
});
|
||||
data = env0_1.data;
|
||||
object2.skusToUserAndReasonRecommendations = data.skusToUserAndReason;
|
||||
r0 = object2;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun80731() { // fn#80731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:3706, offset: 0x01e87f07, size: 169 bytes, params: 1, frame: 23
|
||||
var r12;
|
||||
var r2;
|
||||
var property;
|
||||
var value5;
|
||||
var property2;
|
||||
var object3;
|
||||
var value6;
|
||||
var value7;
|
||||
const object4 = {};
|
||||
copyDataProperties(object4, skusToUserAndReasonRecommendations, undefined);
|
||||
const Object = global.Object;
|
||||
const value2 = Object.entries(wishlistSkusToUserAndReasonMap);
|
||||
let length = value2.length;
|
||||
const value3 = 0;
|
||||
if (value3 < length) {
|
||||
for (r2 = value3; true; r2 = value7) {
|
||||
property = value2[r2];
|
||||
value5 = env1_3(property, 2);
|
||||
property = value5[value3];
|
||||
property2 = value5[1];
|
||||
object3 = {};
|
||||
value6 = copyDataProperties(object3, object4[property], undefined);
|
||||
copyDataProperties(object3, property2, undefined);
|
||||
object4[property] = object3;
|
||||
value7 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
||||
length = value2.length;
|
||||
if (!(value7 < length)) {
|
||||
r12 = value6;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
const sortedWishlistSkusBinding = sortedWishlistSkus;
|
||||
const items2 = [];
|
||||
arraySpread(items2, filteredRecommendations, arraySpread(items2, sortedWishlistSkusBinding, value3, r12), r12);
|
||||
return {combinedSkus: items2, combinedSkusToUserAndReason: object4};
|
||||
}
|
||||
|
||||
function _fun80732() { // fn#80732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:3960, offset: 0x01e87fb0, size: 146 bytes, params: 1, frame: 15
|
||||
const isNotNullish = (require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish;
|
||||
const wishlistsAreFetchingBinding = wishlistsAreFetching;
|
||||
const value2 = 'loading';
|
||||
return wishlistsAreFetchingBinding || env0_1 == null ? value2 : env0_1 == null ? wishlistErrors.filter(isNotNullish).length > 0 ? 'error' : env0_1.state !== 'error' ? 'success' : 'error' : value2 === env0_1.state ? value2 : wishlistErrors.filter(isNotNullish).length > 0 ? 'error' : env0_1.state !== 'error' ? 'success' : 'error';
|
||||
}
|
||||
|
||||
function _fun80733() { // fn#80733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:4116, offset: 0x01e88042, size: 105 bytes, params: 1, frame: 17
|
||||
var environment;
|
||||
let value = environment.__proto__;
|
||||
value = require(22) /* metro dependency 22 */;
|
||||
const uniq = value.uniq;
|
||||
const filteredRecommendationsBinding = filteredRecommendations;
|
||||
const value3 = filteredRecommendationsBinding.map(function(a0) {
|
||||
return a0.id;
|
||||
});
|
||||
const items2 = [];
|
||||
const value4 = arraySpread(items2, value3, 0, filteredRecommendationsBinding);
|
||||
const combinedSkusBinding = combinedSkus;
|
||||
arraySpread(items2, combinedSkusBinding.map(function(a0) {
|
||||
return a0.id;
|
||||
}), value4, combinedSkusBinding);
|
||||
return Reflect.apply(uniq, value, [items2]);
|
||||
}
|
||||
|
||||
function _fun80738() { // fn#80738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:4459, offset: 0x01e8816b, size: 34 bytes, params: 1, frame: 12
|
||||
const object2 = {};
|
||||
object2.defaultWishlistId = UserProfileStore.getFirstWishlistId(env0_0);
|
||||
return object2;
|
||||
}
|
||||
|
||||
function _fun80739() { // fn#80739, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:4569, offset: 0x01e8818d, size: 32 bytes, params: 1, frame: 3
|
||||
return [{userId: env0_0, wishlistId: defaultWishlistId}];
|
||||
}
|
||||
|
||||
function useMemoizedUserIdsAndWishlistIds(a0) { // fn#80742, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5721, owner: useRecommendationsForApplicationIds.useMemoizedUserIdsAndWishlistIds, offset: 0x01e8838f, size: 135 bytes, params: 2, frame: 16
|
||||
const env0_0 = a0;
|
||||
env1_4.useEffect(_fun80743, [a0]);
|
||||
return env1_4.useMemo(_fun80747, [a0,
|
||||
(require(566) /* metro dependency 566: flux */).useStateFromStoresArray([UserProfileStore], _fun80745)]);
|
||||
}
|
||||
|
||||
function _fun80749() { // fn#80749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:6026, offset: 0x01e884d0, size: 40 bytes, params: 1, frame: 14
|
||||
return userIds?.slice(0, 5);
|
||||
}
|
||||
|
||||
function _fun80716() { // fn#80716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:1601, offset: 0x01e8794c, size: 226 bytes, params: 1, frame: 16
|
||||
var r2;
|
||||
var defaultImport;
|
||||
if (userIds.length !== 0) {
|
||||
if (applicationIds.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
var recommendations = WishlistRecommendationsStore.getRecommendations(userIds, applicationIds);
|
||||
if (recommendations == null) {
|
||||
defaultImport = importDefault(10039) /* metro dependency 10039: WishlistActionCreators */;
|
||||
defaultImport.fetchWishlistRecommendations(applicationIds, userIds, numItems);
|
||||
return undefined;
|
||||
}
|
||||
var state = recommendations.state;
|
||||
if (state === 'loading') {
|
||||
return undefined;
|
||||
}
|
||||
var fetchedAt = recommendations.fetchedAt;
|
||||
var Date = global.Date;
|
||||
var value5 = fetchedAt < Date.now() - env2_9;
|
||||
state = recommendations.state;
|
||||
r2 = state === 'success' && recommendations.data.skus.length >= numItems;
|
||||
if (value5) {
|
||||
defaultImport = importDefault(10039) /* metro dependency 10039: WishlistActionCreators */;
|
||||
defaultImport.fetchWishlistRecommendations(applicationIds, userIds, numItems);
|
||||
return undefined;
|
||||
}
|
||||
if (r2) {
|
||||
return undefined;
|
||||
}
|
||||
defaultImport = importDefault(10039) /* metro dependency 10039: WishlistActionCreators */;
|
||||
defaultImport.fetchWishlistRecommendations(applicationIds, userIds, numItems);
|
||||
}
|
||||
}
|
||||
|
||||
function _fun80721() { // fn#80721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:2247, offset: 0x01e87b79, size: 296 bytes, params: 1, frame: 26
|
||||
var r16;
|
||||
var r3;
|
||||
var r9;
|
||||
var r1;
|
||||
var r13;
|
||||
var r14;
|
||||
var value5;
|
||||
var items2;
|
||||
var value6;
|
||||
var value7;
|
||||
var value8;
|
||||
var sku;
|
||||
var value9;
|
||||
var isOwned;
|
||||
var applicationIdsFilterBinding;
|
||||
var value10;
|
||||
var includes;
|
||||
var applicationId;
|
||||
var value11;
|
||||
var skuId;
|
||||
var object3;
|
||||
var skuId2;
|
||||
var skuId3;
|
||||
var property;
|
||||
var userId;
|
||||
var WISHLIST;
|
||||
var value12;
|
||||
var value13;
|
||||
const object4 = {};
|
||||
let _createForOfIteratorHelperLoose_80710Binding = _createForOfIteratorHelperLoose_80710;
|
||||
const wishlistsBinding = wishlists;
|
||||
const value3 = _createForOfIteratorHelperLoose_80710Binding(wishlistsBinding.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish));
|
||||
const value4 = value3();
|
||||
let done = value4.done;
|
||||
if (!done) {
|
||||
r3 = value4;
|
||||
while (true) {
|
||||
value5 = r3.value;
|
||||
_createForOfIteratorHelperLoose_80710Binding = _createForOfIteratorHelperLoose_80710;
|
||||
items2 = value5.items;
|
||||
value6 = _createForOfIteratorHelperLoose_80710Binding(items2);
|
||||
value7 = value6();
|
||||
done = value7.done;
|
||||
if (!done) {
|
||||
r9 = value7;
|
||||
while (true) {
|
||||
value8 = r9.value;
|
||||
sku = value8.sku;
|
||||
value9 = sku == null;
|
||||
if (value9) {
|
||||
r1 = value9;
|
||||
} else {
|
||||
isOwned = value8.isOwned;
|
||||
r1 = isOwned;
|
||||
}
|
||||
if (r1) {
|
||||
continue;
|
||||
}
|
||||
value10 = applicationIdsFilter != null;
|
||||
if (!value10) {
|
||||
r13 = value10;
|
||||
continue;
|
||||
}
|
||||
applicationIdsFilterBinding = applicationIdsFilter;
|
||||
includes = applicationIdsFilterBinding.includes;
|
||||
sku = value8.sku;
|
||||
applicationId = sku.applicationId;
|
||||
value11 = !Reflect.apply(includes, applicationIdsFilterBinding, [applicationId]);
|
||||
r13 = value11;
|
||||
r16 = applicationIdsFilterBinding;
|
||||
r1 = r13;
|
||||
if (r1) {
|
||||
continue;
|
||||
}
|
||||
skuId = value8.skuId;
|
||||
object3 = {};
|
||||
skuId2 = value8.skuId;
|
||||
if (object4[skuId2] != null) {
|
||||
skuId3 = value8.skuId;
|
||||
property = object4[skuId3];
|
||||
r14 = property;
|
||||
} else {
|
||||
r14 = {};
|
||||
}
|
||||
copyDataProperties(object3, r14, r16);
|
||||
userId = value5.userId;
|
||||
WISHLIST = WishlistRecommendationReason.WISHLIST;
|
||||
object3[userId] = WISHLIST;
|
||||
object4[skuId] = object3;
|
||||
value12 = value6();
|
||||
done = value12.done;
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
r9 = value12;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
value13 = value3();
|
||||
done = value13.done;
|
||||
if (done) {
|
||||
break;
|
||||
}
|
||||
r3 = value13;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return object4;
|
||||
}
|
||||
|
||||
function _fun80722() { // fn#80722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:2611, offset: 0x01e87ca1, size: 123 bytes, params: 1, frame: 16
|
||||
var environment;
|
||||
const Object = global.Object;
|
||||
const fromEntries = Object.fromEntries;
|
||||
const wishlistsBinding = wishlists;
|
||||
const filter = wishlistsBinding.filter;
|
||||
let value = environment.__proto__.__proto__;
|
||||
value = Reflect.apply(filter, wishlistsBinding,
|
||||
[(require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish]);
|
||||
value = value.flatMap(function(a0) {
|
||||
return a0.items;
|
||||
});
|
||||
value = value.filter(function(a0) {
|
||||
return a0 != null && a0.sku != null && !a0.isOwned && (applicationIdsFilter == null || applicationIdsFilter.includes(a0.sku.applicationId));
|
||||
});
|
||||
return Reflect.apply(fromEntries, Object, [value.map(function(a0) {
|
||||
return [a0.skuId, a0.sku];
|
||||
})]);
|
||||
}
|
||||
|
||||
function _fun80726() { // fn#80726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:2850, offset: 0x01e87d89, size: 64 bytes, params: 1, frame: 12
|
||||
const Object = global.Object;
|
||||
let value = Object.keys(env0_4);
|
||||
value = value.sort(_fun80727);
|
||||
return value.map(_fun80728);
|
||||
}
|
||||
|
||||
function _fun80743() { // fn#80743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5779, offset: 0x01e88416, size: 30 bytes, params: 1, frame: 11
|
||||
env0_0.forEach(_fun80744);
|
||||
}
|
||||
|
||||
function _fun80745() { // fn#80745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5865, offset: 0x01e88457, size: 28 bytes, params: 1, frame: 11
|
||||
return env0_0.map(_fun80746);
|
||||
}
|
||||
|
||||
function _fun80747() { // fn#80747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5957, offset: 0x01e88496, size: 28 bytes, params: 1, frame: 11
|
||||
return env0_0.map(_fun80748);
|
||||
}
|
||||
|
||||
function _fun80727(a0, a1) { // fn#80727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:2875, offset: 0x01e87dc9, size: 162 bytes, params: 3, frame: 15
|
||||
let value = environment.__proto__;
|
||||
const r3 = env1_3[a1] ?? ({});
|
||||
const r5 = env1_3[a0] ?? ({});
|
||||
let Object = global.Object;
|
||||
const length = Object.keys(r3).length;
|
||||
Object = global.Object;
|
||||
const value2 = length - Object.keys(r5).length;
|
||||
if (value2 !== 0) {
|
||||
return value2;
|
||||
}
|
||||
let Boolean = global.Boolean;
|
||||
const idBinding = id;
|
||||
value = Boolean(r3[idBinding]);
|
||||
Boolean = global.Boolean;
|
||||
const value3 = Boolean(r5[idBinding]);
|
||||
let Number = global.Number;
|
||||
const value4 = Number(value3);
|
||||
Number = global.Number;
|
||||
return value4 - Number(value);
|
||||
}
|
||||
|
||||
function _fun80744(a0) { // fn#80744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5795, offset: 0x01e88434, size: 35 bytes, params: 2, frame: 11
|
||||
const value = environment.__proto__.__proto__.__proto__;
|
||||
(importDefault(8491) /* metro dependency 8491: maybeFetchUserProfile */)(a0);
|
||||
}
|
||||
|
||||
function _fun80746(a0) { // fn#80746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5876, offset: 0x01e88473, size: 35 bytes, params: 2, frame: 11
|
||||
let value = environment.__proto__.__proto__.__proto__;
|
||||
value = UserProfileStore.getFirstWishlistId(a0);
|
||||
const value2 = null;
|
||||
return value2 != value ? value : value2;
|
||||
}
|
||||
|
||||
function _fun80748(a0, a1) { // fn#80748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10618:5968, offset: 0x01e884b2, size: 30 bytes, params: 3, frame: 3
|
||||
return {userId: a0, wishlistId: env1_1[a1]};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,90 @@
|
||||
/* Metro module 10435; source: modules/wishlists/hooks/useWishlistSkuFilter.native.tsx; dependencies: [31, 6830, 661, 8354, 10049, 6833, 2] */
|
||||
function _fun80770(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:6, offset: 0x01e88b38, size: 158 bytes, params: 8, frame: 18
|
||||
const env0_0 = require;
|
||||
const Object = global.Object;
|
||||
Object.defineProperty(exports, '__esModule', {value: true});
|
||||
const env0_2 = importAll(31) /* metro dependency 31 */;
|
||||
const env0_3 = (require(6830) /* metro dependency 6830: WishlistRecommendationRecord */).WishlistRecommendationReason;
|
||||
const env0_4 = (require(661) /* metro dependency 661: Constants */).SKUProductLines;
|
||||
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/wishlists/hooks/useWishlistSkuFilter.native.tsx');
|
||||
exports.useWishlistSkuFilter = useWishlistSkuFilter;
|
||||
}
|
||||
|
||||
function useWishlistSkuFilter({wishlistAndRecommendations, skusToUserAndReason, userId, numItems}) { // fn#80771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:283, offset: 0x01e88bd6, size: 212 bytes, params: 2, frame: 19
|
||||
var object2;
|
||||
const env0_2 = userId;
|
||||
const value2 = (require(8354) /* metro dependency 8354: SocialLayerStorefrontMobilePurchasingExperiment */).useIsEligibleForSocialLayerStorefrontMobilePurchasing({location: 'use_wishlist_sku_filter'});
|
||||
const binding = env0_2;
|
||||
const value = binding.useMemo(function() {
|
||||
return wishlistAndRecommendations.filter(_fun80773);
|
||||
}, [wishlistAndRecommendations, value2]);
|
||||
object2 = {};
|
||||
object2.totalUnownedWishlistItemCount = binding.useMemo(_fun80774, [value, userId, skusToUserAndReason]);
|
||||
object2.slicedWishlistAndRecommendations = binding.useMemo(_fun80776, [value, numItems]);
|
||||
return object2;
|
||||
}
|
||||
|
||||
function _fun80772() { // fn#80772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:506, offset: 0x01e88caa, size: 28 bytes, params: 1, frame: 11
|
||||
return wishlistAndRecommendations.filter(_fun80773);
|
||||
}
|
||||
|
||||
function _fun80774() { // fn#80774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:727, offset: 0x01e88d49, size: 33 bytes, params: 1, frame: 11
|
||||
const binding = env0_5;
|
||||
return binding.filter(_fun80775).length;
|
||||
}
|
||||
|
||||
function _fun80776() { // fn#80776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:846, offset: 0x01e88dae, size: 26 bytes, params: 1, frame: 13
|
||||
const binding = env0_5;
|
||||
return binding.slice(0, numItems);
|
||||
}
|
||||
|
||||
function _fun80773(a0) { // fn#80773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:520, offset: 0x01e88cc6, size: 131 bytes, params: 2, frame: 16
|
||||
var r2;
|
||||
var r1;
|
||||
var r0;
|
||||
var value4;
|
||||
var value5;
|
||||
var binding;
|
||||
let value = environment.__proto__.__proto__;
|
||||
const GIFTABLE_PRODUCT_LINES = (require(10049) /* metro dependency 10049: useWishlistGiftableItemsNative */).GIFTABLE_PRODUCT_LINES;
|
||||
const value2 = GIFTABLE_PRODUCT_LINES.has(a0.productLine);
|
||||
if (value2) {
|
||||
value4 = a0.productLine !== SKUProductLines.SOCIAL_LAYER_GAME_ITEM;
|
||||
if (value4) {
|
||||
r1 = value4;
|
||||
} else {
|
||||
value5 = environment.__proto__;
|
||||
binding = env1_4;
|
||||
if (binding) {
|
||||
value = require(6833) /* metro dependency 6833: StorefrontUtils */;
|
||||
value = value.isSlayerSkuAvailableOnThisPlatform(a0);
|
||||
r2 = value;
|
||||
} else {
|
||||
r2 = binding;
|
||||
}
|
||||
r1 = r2;
|
||||
}
|
||||
r0 = r1;
|
||||
} else {
|
||||
r0 = !!value2;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
function _fun80775(a0) { // fn#80775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10621:741, offset: 0x01e88d6a, size: 68 bytes, params: 2, frame: 4
|
||||
var r0;
|
||||
var property;
|
||||
let value = environment.__proto__;
|
||||
const value2 = skusToUserAndReason[a0.id] != null;
|
||||
if (value2) {
|
||||
property = skusToUserAndReason[a0.id];
|
||||
property = property[userId];
|
||||
value = environment.__proto__.__proto__;
|
||||
value = property === WishlistRecommendationReason.WISHLIST;
|
||||
r0 = value;
|
||||
} else {
|
||||
r0 = value2;
|
||||
}
|
||||
return r0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user