This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,21 @@
// Metro module 11005 (f11006).
import { GiftIntentType } from "../../PremiumConstants";
import { AnalyticsLocations } from "../../../../Constants";
let c7414_2 = new Map([[AnalyticsLocations.FRIEND_ANNIVERSARIES_CHAT, GiftIntentType.FRIEND_ANNIVERSARY], [AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON, GiftIntentType.FRIEND_ANNIVERSARY], [AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK, GiftIntentType.FRIEND_ANNIVERSARY]]);
export function getPremiumGiftingIntentAnalyticsLocation(a0) {
return a0 === GiftIntentType.FRIEND_ANNIVERSARY ? {
chat: AnalyticsLocations.FRIEND_ANNIVERSARIES_CHAT,
actionButton: AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON,
actionButtonCoachmark: AnalyticsLocations.FRIEND_ANNIVERSARIES_ACTION_BUTTON_COACHMARK
} : {};
}
export function getGiftIntentTypeForLocation(a0) {
let r5 = c7414_2.get(a0);
if (r5 == null) {
r5 = null;
}
return r5;
}
export function parseGiftIntentType(a0) {
return typeof a0 === "number" ? a0 in GiftIntentType ? a0 !== GiftIntentType.UNSPECIFIED ? a0 : null : null : null;
}
@@ -0,0 +1,108 @@
// Metro module 9753 (f9754).
import { useMemo } from "react";
import { intl, t } from "../../../../intl/index.native";
import { WishlistItemSource } from "../../../wishlists/hooks/useWishlistHooks";
import { isGameItemSKU } from "../../../slayer_storefront/SlayerStorefrontUtils";
let $mk83244 = function() {
return (a0) => {
const sku = a0.sku;
return a0.source === WishlistItemSource.POPULAR && isGameItemSKU(sku);
};
};
let c6463_3 = {
FULL_WISHLIST: "FULL_WISHLIST",
MIXED: "MIXED",
SHOP_ONLY: "SHOP_ONLY",
SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY: "SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY"
};
const r30 = {
FULL_WISHLIST: {
title: intl.string(t["7lZ31J"]),
getSubtitle: (a0) => intl.formatToPlainString(t.BjEX38, {
username: a0
}),
showIcons: false
},
MIXED: {
title: intl.string(t.pWG4ze),
getSubtitle: (a0) => intl.formatToPlainString(t.dIDKgi, {
username: a0
}),
showIcons: true
},
SHOP_ONLY: {
title: intl.string(t.SK5rmi),
getSubtitle: (a0) => intl.formatToPlainString(t.wyMp1j, {
username: a0
}),
showIcons: false
},
SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY: {
title: intl.string(t.BCi1gT),
getSubtitle: (a0) => intl.formatToPlainString(t.BjEX38, {
username: a0
}),
showIcons: false
}
};
export { c6463_3 as BannerMode };
export { r30 as BANNER_CONFIG_MOBILE };
export function getBannerMode(a0) {
let FULL_WISHLIST;
L10: {
const { totalUnownedWishlistItemCount: totalUnownedWishlistItemCount2, wishlistInDmLength: wishlistInDmLength2, displayItems: displayItems2 } = a0;
if (totalUnownedWishlistItemCount2 >= wishlistInDmLength2) {
FULL_WISHLIST = c6463_3.FULL_WISHLIST;
} else if (totalUnownedWishlistItemCount2 > 0) {
FULL_WISHLIST = c6463_3.MIXED;
} else {
if (displayItems2.length > 0 && displayItems2.every($mk83244())) {
FULL_WISHLIST = c6463_3.SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY;
break L10;
}
FULL_WISHLIST = c6463_3.SHOP_ONLY;
}
}
return FULL_WISHLIST;
}
export function useWishlistBannerConfig({ totalUnownedWishlistItemCount, wishlistInDmLength, displayItems, recipientName }) {
const memo = useMemo(() => {
let FULL_WISHLIST;
L10: {
if (totalUnownedWishlistItemCount >= wishlistInDmLength) {
FULL_WISHLIST = c6463_3.FULL_WISHLIST;
} else if (totalUnownedWishlistItemCount > 0) {
FULL_WISHLIST = c6463_3.MIXED;
} else {
if (displayItems.length > 0 && displayItems.every($mk83244())) {
FULL_WISHLIST = c6463_3.SOCIAL_LAYER_STOREFRONT_RECOMMENDATIONS_ONLY;
break L10;
}
FULL_WISHLIST = c6463_3.SHOP_ONLY;
}
}
return FULL_WISHLIST;
}, [totalUnownedWishlistItemCount, wishlistInDmLength, displayItems]);
return useMemo(() => {
if (c6463_3.FULL_WISHLIST === memo) {
return {
title: intl.formatToPlainString(t["YcL/Vr"], {
username: recipientName
}),
showIcons: false
};
}
if (c6463_3.MIXED === memo) {
return {
title: intl.formatToPlainString(t.dIDKgi, {
username: recipientName
}),
showIcons: true
};
}
return {
title: intl.string(t.BCi1gT),
showIcons: false
};
}, [memo, recipientName]);
}
@@ -0,0 +1,93 @@
// Metro module 8807 (f8808).
import { useState, useRef, useEffect } from "react";
import PromotionsStore from "../../../promotions/PromotionsStore";
import { SubscriptionPlans } from "../../../PremiumConstants";
import { useStateFromStoresArray } from "../../../../../_bundle/Module589";
import { useFetchPurchases } from "../../../../collectibles/hooks/useFetchCollectiblesCategoriesAndPurchases";
import { GiftPromotionReminderExperiment } from "../../experiments/GiftPromotionReminderExperiment";
import { MarketingComponentType } from "../../../../../_bundle/Module6567";
import { UNSAFE_isSnowflakeBoundDismissibleContentDismissed } from "../../../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
export function useFetchClaimableGiftingPromotionRewardSkuIds() {
let purchases, hasPreviouslyFetched, fetchPurchasesError, ref;
const [state, setState] = useState();
const stateFromStoresArray = useStateFromStoresArray([PromotionsStore], () => PromotionsStore.getGiftPromotionRewardSkuIds());
const fetchPurchases = useFetchPurchases();
purchases = fetchPurchases.purchases;
hasPreviouslyFetched = fetchPurchases.hasPreviouslyFetched;
fetchPurchasesError = fetchPurchases.fetchPurchasesError;
ref = useRef(false);
useEffect(() => {
if (hasPreviouslyFetched && !ref.current && stateFromStoresArray.length > 0) {
setState(fetchPurchasesError == null ? stateFromStoresArray.filter((item) => purchases.get(item) == null) : []);
ref.current = true;
}
}, [stateFromStoresArray, purchases, hasPreviouslyFetched, fetchPurchasesError]);
return state;
}
export function getRewardAssetIdMap(a0) {
const map = new Map();
let c16793_0 = map;
a0.forEach((item) => c16793_0.set(item.skuId, item.assetId));
return map;
}
export function useShouldShowSelectFreeSkuStep(a0, a1, a2) {
const r12 = [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2].includes(a0?.id);
const r13 = a2 != null && a2.length >= 1;
return (a1 ? r12 : a1) && r13;
}
export function useShouldAutoSelectGiftingPromotionReward(a0, a1, a2) {
const r12 = [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2].includes(a0?.id);
return a2 != null && a2.length === 1 && r12 && a1;
}
export function useIsPlanEligibleForGiftingPromotion(a0) {
return [SubscriptionPlans.PREMIUM_YEAR_TIER_2, SubscriptionPlans.PREMIUM_MONTH_TIER_2].includes(a0?.id);
}
export function createGradientStyle(a0, a1) {
if (a0 != null) {
const r4 = a1 == null ? {} : a1;
const { reverse = false, colorStops, defaultAngle = 78.98 } = r4;
const r22 = Array.isArray(a0) ? a0 : a0.gradient;
const r25 = Array.isArray(a0) ? defaultAngle : a0.angle != null ? a0.angle : defaultAngle;
return {
background: `linear-gradient(${reverse ? (r25 + 180) % 360 : r25}deg, ${colorStops != null ? r22.map((item, index) => `${item} ${colorStops[index]}%`).join(", ") : r22.join(", ")})`
};
}
}
export function createBackgroundStyle(a0) {
if (a0 != null) {
return {
backgroundImage: `url(${a0})`,
backgroundSize: "cover",
backgroundPosition: "center",
backgroundRepeat: "no-repeat"
};
}
}
export function combinePromotionStyles(a0, a1) {
if (a0 != null && a1 != null) {
a0.backgroundImage = `${a0.backgroundImage}, ${a1.background}`;
a0.backgroundColor = "lightgray";
a0.backgroundRepeat = "no-repeat, no-repeat";
if (a0.backgroundSize == null) {
a0.backgroundSize = "auto 110%, auto";
}
if (a0.backgroundPosition == null) {
a0.backgroundPosition = "right 90% center, 0% 0%";
}
return a0;
}
return a0 == null ? a1 == null ? {} : a1 : a0;
}
export function shouldShowGiftPromotionReminderNotice() {
if (GiftPromotionReminderExperiment.getConfig({
location: "shouldShowGiftPromotionReminderNotice"
}).enabled) {
if (PromotionsStore.getMarketingComponentByType(MarketingComponentType.GIFT_REMINDER_NAGBAR) == null) {
return false;
}
const id = PromotionsStore.getGiftPromotion()?.id;
return id != null && (!!UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_DESKTOP_FIRST_TIME_COACHMARK, id).isDismissed && !UNSAFE_isSnowflakeBoundDismissibleContentDismissed(DismissibleContent.GIFTING_PROMOTION_REMINDER, id).isDismissed);
}
return false;
}