Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,28 @@
/* Metro module 11432; source: modules/premium/gifting/utils/PremiumGiftingIntentUtils.tsx; dependencies: [1880, 661, 2] */
function _fun87496(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11618:6, offset: 0x01fc0dab, size: 228 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = (require(1880) /* metro dependency 1880: PremiumConstants */).GiftIntentType;
const AnalyticsLocations = (require(661) /* metro dependency 661: Constants */).AnalyticsLocations;
const Set = global.Set;
const FRIEND_ANNIVERSARIES_CHAT = AnalyticsLocations.FRIEND_ANNIVERSARIES_CHAT;
const FRIEND_ANNIVERSARIES_ACTION_BUTTON = AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON;
const FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK = AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK;
const set = new Set([FRIEND_ANNIVERSARIES_CHAT, FRIEND_ANNIVERSARIES_ACTION_BUTTON,
FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/gifting/utils/PremiumGiftingIntentUtils.tsx');
exports.getPremiumGiftingIntentAnalyticsLocation = function(a0) {
return a0 === GiftIntentType.FRIEND_ANNIVERSARY ? {chat: AnalyticsLocations.FRIEND_ANNIVERSARIES_CHAT,
actionButton: AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON,
actionButtonCoachmark: AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK} : {};
};
exports.isGiftingIntentLocation = isGiftingIntentLocation;
exports.parseGiftIntentType = function(a0) {
return a0 !== GiftIntentType.FRIEND_ANNIVERSARY ? null : GiftIntentType.FRIEND_ANNIVERSARY;
};
}
function isGiftingIntentLocation(a0) { // fn#87498, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11618:680, offset: 0x00d715d9, size: 22 bytes, params: 2, frame: 11
return env0_2.has(a0);
}
@@ -0,0 +1,99 @@
/* Metro module 10436; source: modules/premium/gifting/utils/WishlistBannerUtils.tsx; dependencies: [31, 1244, 10034, 6829, 2] */
function _fun80777(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#80777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10622:6, offset: 0x01e88dc8, size: 507 bytes, params: 8, frame: 25
const env0_0 = require;
const closure = getBannerMode;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(31) /* metro dependency 31 */).useMemo;
const object = {};
let intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object.FULL_WISHLIST = {title: Reflect.apply(string, intl, [t['7lZ31J']]), getSubtitle: function(a0) {
var intl = require(dependencyMap[1]).intl;
var BjEX38 = require(dependencyMap[1]).t.BjEX38;
return intl.formatToPlainString(BjEX38, {username: a0});
}, showIcons: false};
object.MIXED = {title: intl.string(t.pWG4ze), getSubtitle: function(a0) {
return require(dependencyMap[1]).intl.formatToPlainString(require(dependencyMap[1]).t.dIDKgi, {username: a0});
}, showIcons: true};
string = intl.string;
const SK5rmi = t.SK5rmi;
object.SHOP_ONLY = {title: Reflect.apply(string, intl, [SK5rmi]), getSubtitle: function(a0) {
return require(dependencyMap[1]).intl.formatToPlainString(require(dependencyMap[1]).t.wyMp1j, {username: a0});
}, showIcons: false};
string = intl.string;
const BCi1gT = t.BCi1gT;
object.SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY = {title: Reflect.apply(string, intl, [BCi1gT]),
getSubtitle: function(a0) {
var intl = require(dependencyMap[1]).intl;
var BjEX38 = require(dependencyMap[1]).t.BjEX38;
return intl.formatToPlainString(BjEX38, {username: a0});
}, showIcons: false};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/gifting/utils/WishlistBannerUtils.tsx');
exports.BannerMode = {FULL_WISHLIST: 'FULL_WISHLIST', MIXED: 'MIXED', SHOP_ONLY: 'SHOP_ONLY',
SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY: 'SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY'};
exports.BANNER_CONFIG_MOBILE = object;
exports.getBannerModeFromDisplayItems = getBannerModeFromDisplayItems;
exports.getBannerMode = closure;
exports.useWishlistBannerConfig = useWishlistBannerConfig;
}
function getBannerMode({totalUnownedWishlistItemCount, wishlistInDmLength, displayItems}) { // fn#80778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10622:942, offset: 0x01e88fc3, size: 123 bytes, params: 2, frame: 11
return totalUnownedWishlistItemCount >= wishlistInDmLength ? env0_3.FULL_WISHLIST : totalUnownedWishlistItemCount > 0 ? env0_3.MIXED : displayItems.length > 0 && displayItems.every(_fun80779) ? env0_3.SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY : env0_3.SHOP_ONLY;
}
function getBannerModeFromDisplayItems({totalUnownedWishlistItemCount, wishlistInDmLength, displayItems}) { // fn#80784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10622:1402, offset: 0x01e89176, size: 90 bytes, params: 2, frame: 14
const getBannerModeBinding = getBannerMode;
const object2 = {totalUnownedWishlistItemCount: totalUnownedWishlistItemCount,
wishlistInDmLength: wishlistInDmLength};
object2.displayItems = displayItems.filter(function(a0) {
return a0.item.sku != null;
}).map(function({item, source}) {
return {sku: item.sku, source: source};
});
return getBannerModeBinding(object2);
}
function useWishlistBannerConfig({totalUnownedWishlistItemCount, wishlistInDmLength, displayItems, recipientName}) { // fn#80787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10622:1742, offset: 0x01e89206, size: 114 bytes, params: 2, frame: 16
let items2 = [totalUnownedWishlistItemCount, wishlistInDmLength, displayItems];
items2 = [useMemo(function() {
return getBannerMode({totalUnownedWishlistItemCount: totalUnownedWishlistItemCount,
wishlistInDmLength: wishlistInDmLength, displayItems: displayItems});
}, items2), recipientName];
return useMemo(_fun80789, items2);
}
function _fun80779({sku, source}) { // fn#80779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10622:1097, offset: 0x01e8903e, size: 91 bytes, params: 2, frame: 14
var r0;
let value = environment.__proto__;
const WishlistItemSource = (require(10034) /* metro dependency 10034: useWishlistHooks */).WishlistItemSource;
const POPULAR = WishlistItemSource.POPULAR;
const value2 = source === POPULAR;
if (value2) {
value = require(6829) /* metro dependency 6829: SlayerStorefrontUtils */;
value = value.isGameItemSKU(sku);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function _fun80789() { // fn#80789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10622:1980, offset: 0x01e892a8, size: 283 bytes, params: 1, frame: 18
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const binding = env0_4;
const FULL_WISHLIST = env1_3.FULL_WISHLIST;
if (FULL_WISHLIST === binding) {
return {title: intl.formatToPlainString(t['YcL/Vr'], {username: recipientName}), showIcons: false};
}
const MIXED = env1_3.MIXED;
if (MIXED === binding) {
return {title: intl.formatToPlainString(t.dIDKgi, {username: recipientName}), showIcons: true};
}
const string = intl.string;
const BCi1gT = t.BCi1gT;
return {title: Reflect.apply(string, intl, [BCi1gT]), showIcons: false};
}
@@ -0,0 +1,193 @@
/* Metro module 7674; source: modules/premium/gifting/utils/promotions/GiftingPromotionUtils.tsx; dependencies: [57, 31, 7261, 1880, 566, 7675, 7676, 7583, 3968, 1365, 2] */
function _fun61309(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#61309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:6, offset: 0x01b3aef3, size: 277 bytes, params: 8, frame: 20
let env0_0 = require;
const closure = useIsPlanEligibleForGiftingPromotion;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
const promotionsStore = importDefault(7261) /* metro dependency 7261: PromotionsStore */;
const env0_5 = (require(1880) /* metro dependency 1880: PremiumConstants */).SubscriptionPlans;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/premium/gifting/utils/promotions/GiftingPromotionUtils.tsx');
exports.useFetchClaimableGiftingPromotionRewardSkuIds = useFetchClaimableGiftingPromotionRewardSkuIds;
exports.getRewardAssetIdMap = function(a0) {
var Map = global.Map;
var value2 = new Map();
var env0_0 = value2;
a0.forEach(_fun61316);
return value2;
};
exports.useShouldShowSelectFreeSkuStep = function(a0, a1, a2) {
return a1 && useIsPlanEligibleForGiftingPromotion(a0) && (a2 != null && a2.length >= 1);
};
exports.useShouldAutoSelectGiftingPromotionReward = function(a0, a1, a2) {
return a2 != null && a2.length === 1 && useIsPlanEligibleForGiftingPromotion(a0) && a1;
};
exports.useIsPlanEligibleForGiftingPromotion = closure;
exports.createGradientStyle = createGradientStyle;
exports.createBackgroundStyle = function(a0) {
if (a0 != null) {
return {'backgroundImage': null, 'backgroundSize': 'cover', 'backgroundPosition': 'center',
'backgroundRepeat': 'no-repeat', backgroundImage: 'url(' + a0 + ')'};
}
};
exports.combinePromotionStyles = combinePromotionStyles;
exports.shouldShowGiftPromotionReminderNotice = shouldShowGiftPromotionReminderNotice;
}
function useIsPlanEligibleForGiftingPromotion(a0) { // fn#61310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:154, offset: 0x01b3b008, size: 66 bytes, params: 2, frame: 13
const PREMIUM_YEAR_TIER_2 = SubscriptionPlans.PREMIUM_YEAR_TIER_2;
const items2 = [PREMIUM_YEAR_TIER_2];
const PREMIUM_MONTH_TIER_2 = SubscriptionPlans.PREMIUM_MONTH_TIER_2;
items2[1] = PREMIUM_MONTH_TIER_2;
return items2.includes(a0?.id);
}
function useFetchClaimableGiftingPromotionRewardSkuIds() { // fn#61311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:435, offset: 0x01b3b04a, size: 209 bytes, params: 1, frame: 19
const binding = env0_3;
const [property, env0_0] = env0_2(binding.useState(), 2);
const value = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore],
function() {
return PromotionsStore.getGiftPromotionRewardSkuIds();
});
const {purchases, hasPreviouslyFetched,
fetchPurchasesError} = (require(7675) /* metro dependency 7675: useFetchCollectiblesCategoriesAndPurchases */).useFetchPurchases();
const env0_5 = binding.useRef(false);
binding.useEffect(_fun61313, [value, purchases, hasPreviouslyFetched, fetchPurchasesError]);
return property;
}
function getRewardAssetIdMap(a0) { // fn#61315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:879, offset: 0x01b3b1af, size: 54 bytes, params: 2, frame: 12
const Map = global.Map;
const map = new Map();
a0.forEach(_fun61316);
return map;
}
function createGradientStyle(a0, a1) { // fn#61319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:1423, offset: 0x01b3b27b, size: 272 bytes, params: 3, frame: 21
var r1;
var r0;
var r9;
var r4;
var r7;
var r6;
var r5;
var reverse;
var colorStops;
var defaultAngle;
var Array;
var isArray;
let value = a0;
if (value != null) {
r1 = a1 ?? ({});
reverse = r1.reverse;
r0 = reverse !== undefined && reverse;
colorStops = r1.colorStops;
defaultAngle = r1.defaultAngle;
r9 = defaultAngle === undefined ? 78.98 : defaultAngle;
Array = global.Array;
isArray = Array.isArray;
r4 = Reflect.apply(isArray, Array, [value]) ? value : value.gradient;
Array = global.Array;
isArray = Array.isArray;
r7 = Reflect.apply(isArray, Array, [value]) || value.angle == null ? r9 : value.angle;
r6 = r0 ? (r7 + 180) % 360 : r7;
if (colorStops != null) {
value = r4.map(function(a0, a1) {
return '' + a0 + ' ' + colorStops[a1] + '%';
});
value = value.join(', ');
r5 = value;
} else {
r5 = r4.join(', ');
}
return {background: 'linear-gradient(' + r6 + 'deg, ' + r5 + ')'};
}
}
function combinePromotionStyles(a0, a1) { // fn#61322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:1992, offset: 0x01b3b3ff, size: 153 bytes, params: 3, frame: 17
const value = a0;
const value2 = a1;
if (value != null) {
if (value2 != null) {
value.backgroundImage = '' + value.backgroundImage + ', ' + value2.background;
value.backgroundColor = 'lightgray';
value.backgroundRepeat = 'no-repeat, no-repeat';
if (value.backgroundSize == null) {
value.backgroundSize = 'auto 110%, auto';
}
if (value.backgroundPosition == null) {
value.backgroundPosition = 'right 90% center, 0% 0%';
}
return value;
}
}
return value ?? (value2 ?? ({}));
}
function shouldShowGiftPromotionReminderNotice() { // fn#61323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:2410, offset: 0x01b3b498, size: 299 bytes, params: 1, frame: 19
var id;
var r1;
var r0;
var giftPromotion;
var value5;
var moduleValue;
const DismissibleContent = (require(1365) /* metro dependency 1365: dismissible_content */).DismissibleContent;
var isDismissed;
var value;
const value2 = undefined;
const GiftPromotionReminderExperiment = (require(7676) /* metro dependency 7676: GiftPromotionReminderExperiment */).GiftPromotionReminderExperiment;
const getConfig = GiftPromotionReminderExperiment.getConfig;
if (Reflect.apply(getConfig, GiftPromotionReminderExperiment,
[{location: 'shouldShowGiftPromotionReminderNotice'}]).enabled) {
if (PromotionsStore.getMarketingComponentByType((require(7583) /* metro dependency 7583: MarketingComponentType */).MarketingComponentType.GIFT_REMINDER_NAGBAR) == null) {
return false;
}
giftPromotion = PromotionsStore.getGiftPromotion();
id = giftPromotion == null ? value2 : giftPromotion.id;
value5 = id != null;
if (value5) {
moduleValue = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
isDismissed = moduleValue.UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_DESKTOP_FIRST_TIME_COACHMARK,
id).isDismissed;
if (isDismissed) {
value = require(3968) /* metro dependency 3968: DismissibleContentUnsafeUtils */;
value = !value.UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_REMINDER,
id).isDismissed;
r1 = value;
} else {
r1 = !!isDismissed;
}
r0 = r1;
} else {
r0 = value5;
}
return r0;
}
return false;
}
function _fun61313() { // fn#61313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:740, offset: 0x01b3b12e, size: 101 bytes, params: 1, frame: 13
if (hasPreviouslyFetched) {
if (!env0_5.current) {
if (env0_1.length > 0) {
env0_0(fetchPurchasesError == null ? env0_1.filter(_fun61314) : []);
env0_5.current = true;
}
}
}
}
function _fun61316({skuId, assetId}) { // fn#61316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:943, offset: 0x01b3b1e5, size: 34 bytes, params: 2, frame: 13
return env0_0.set(skuId, assetId);
}
function _fun61314(a0) { // fn#61314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7852:799, offset: 0x01b3b193, size: 28 bytes, params: 2, frame: 11
const value = environment.__proto__;
return purchases.get(a0) == null;
}