This commit is contained in:
janisslsm committed 2026-07-28 01:06:53 +03:00
1 parent af3b49f756
commit 1781d25a15
22448 files changed
+2731829 -2650550

No files matched your search

@@ -1,14 +1,19 @@
/* Metro module 7674; source: modules/premium/gifting/utils/promotions/GiftingPromotionUtils.tsx; dependencies: [57, 31, 7261, 1880, 566, 7675, 7676, 7583, 3968, 1365, 2] */
import Module00057 from '../../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import PromotionsStore from '../../../promotions/PromotionsStore.tsx'; /* Metro dependency 7261 */
import * as FileImportTrackerModule from '../../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as Dismissible_contentModule from '../../../../../external/discord_common/js/packages/protos/discord_protos/discord_users/v1/dismissible_content.tsx'; /* Metro dependency 1365 */
import * as PremiumConstantsModule from '../../../PremiumConstants.tsx'; /* Metro dependency 1880 */
import * as UseFetchCollectiblesCategoriesAndPurchasesModule from '../../../../collectibles/hooks/useFetchCollectiblesCategoriesAndPurchases.tsx'; /* Metro dependency 7675 */
import * as GiftPromotionReminderExperimentModule from '../../experiments/GiftPromotionReminderExperiment.tsx'; /* Metro dependency 7676 */
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 useIsPlanEligibleForGiftingPromotion2 = 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');
(FileImportTrackerModule).fileFinishedImporting('modules/premium/gifting/utils/promotions/GiftingPromotionUtils.tsx');
exports.useFetchClaimableGiftingPromotionRewardSkuIds = useFetchClaimableGiftingPromotionRewardSkuIds;
exports.getRewardAssetIdMap = function(a0) {
var Map = global.Map;
@@ -23,7 +28,7 @@ function _fun61309(global, require, importDefault, importAll, module, exports, d
exports.useShouldAutoSelectGiftingPromotionReward = function(a0, a1, a2) {
return a2 != null && a2.length === 1 && useIsPlanEligibleForGiftingPromotion(a0) && a1;
};
exports.useIsPlanEligibleForGiftingPromotion = closure;
exports.useIsPlanEligibleForGiftingPromotion = useIsPlanEligibleForGiftingPromotion2;
exports.createGradientStyle = createGradientStyle;
exports.createBackgroundStyle = function(a0) {
if (a0 != null) {
@@ -33,76 +38,143 @@ function _fun61309(global, require, importDefault, importAll, module, exports, d
};
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 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 [property, env0_0] = Module00057(ReactModule.useState(), 2);
const value = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([PromotionsStore],
function() {
return PromotionsStore.getGiftPromotionRewardSkuIds();
});
const {purchases, hasPreviouslyFetched,
fetchPurchasesError} = (UseFetchCollectiblesCategoriesAndPurchasesModule).useFetchPurchases();
const env0_5 = ReactModule.useRef(false);
ReactModule.useEffect(_fun61313, [value, purchases, hasPreviouslyFetched, fetchPurchasesError]);
return property;
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 _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;
}
}
}
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 _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 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 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 promotionsStoreBinding;
var giftPromotion;
var value5;
var moduleValue;
const DismissibleContent = (Dismissible_contentModule).DismissibleContent;
var isDismissed;
var value;
const value2 = undefined;
const GiftPromotionReminderExperiment = (GiftPromotionReminderExperimentModule).GiftPromotionReminderExperiment;
const getConfig = GiftPromotionReminderExperiment.getConfig;
if (Reflect.apply(getConfig, GiftPromotionReminderExperiment,
[{location: 'shouldShowGiftPromotionReminderNotice'}]).enabled) {
promotionsStoreBinding = PromotionsStore;
if (promotionsStoreBinding.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 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
@@ -125,69 +197,5 @@ function combinePromotionStyles(a0, a1) { // fn#61322, source: /ci/build/discord
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;
}
global.__d(_fun61309, 7674, [57, 31, 7261, 1880, 566, 7675, 7676, 7583, 3968, 1365,
2]) /* metro module 7674, dependencies: [57, 31, 7261, 1880, 566, 7675, 7676, 7583, 3968, 1365, 2] */;