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,7 @@
// Metro module 7855 (f7856).
import MobileFriendAnniversaryExperiment from "./native/MobileFriendAnniversaryExperiment";
export function getFriendAnniversaryGateConfig(a0) {
return {
enabled: MobileFriendAnniversaryExperiment.getConfig(a0).enabled
};
}
@@ -0,0 +1,50 @@
// Metro module 6299 (f6300).
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c4014_0 = {
giftOptionsReceiptMap: {}
};
class GiftPromotionStore extends Module589.PersistedStore {
static displayName = "GiftPromotionStore";
static persistKey = "GiftPromotionStore";
static migrations = [(a0) => {
let r1 = a0;
if (a0 != null) {
let giftOptionsReceiptMap = a0.giftOptionsReceiptMap;
if (giftOptionsReceiptMap == null) {
giftOptionsReceiptMap = null;
}
r1 = {
giftOptionsReceiptMap
};
}
return r1;
}];
initialize(a0) {
if (a0 != null) {
c4014_0.giftOptionsReceiptMap = {
...a0.giftOptionsReceiptMap
};
}
}
getState() {
return c4014_0;
}
getGiftOptionsForKey(a0) {
return c4014_0.giftOptionsReceiptMap[a0];
}
}
const giftPromotionStore = new GiftPromotionStore(Dispatcher, {
LOGOUT: function handleLogout() {
c4014_0 = {
giftOptionsReceiptMap: {}
};
},
GIFT_PROMOTION_GIFT_OPTIONS_CACHE_ACTION: function handleCacheGiftOptions(a0) {
c4014_0.giftOptionsReceiptMap[a0.key] = a0.giftOptions;
},
GIFT_PROMOTION_GIFT_OPTIONS_CLEAR_CACHE_ACTION: function handleClearCachedGiftOptions(a0) {
delete c4014_0.giftOptionsReceiptMap[a0.key];
}
});
export default giftPromotionStore;
@@ -0,0 +1,132 @@
// Metro module 2319 (f2320).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2288 from "../../../_bundle/Module2288";
import * as _Module2289 from "../../../_bundle/Module2289";
import * as _Module2290 from "../../../_bundle/Module2290";
import * as _Module2291 from "../../../_bundle/Module2291";
import * as _Module2292 from "../../../_bundle/Module2292";
import * as _Module2293 from "../../../_bundle/Module2293";
import * as _Module2294 from "../../../_bundle/Module2294";
import * as _Module2295 from "../../../_bundle/Module2295";
import * as _Module2296 from "../../../_bundle/Module2296";
import * as _Module2297 from "../../../_bundle/Module2297";
import * as _Module2298 from "../../../_bundle/Module2298";
import * as _Module2299 from "../../../_bundle/Module2299";
import * as _Module2300 from "../../../_bundle/Module2300";
import * as _Module2301 from "../../../_bundle/Module2301";
import * as _Module2302 from "../../../_bundle/Module2302";
import * as _Module2303 from "../../../_bundle/Module2303";
import * as _Module2304 from "../../../_bundle/Module2304";
import * as _Module2305 from "../../../_bundle/Module2305";
import * as _Module2306 from "../../../_bundle/Module2306";
import * as _Module2307 from "../../../_bundle/Module2307";
import * as _Module2308 from "../../../_bundle/Module2308";
import * as _Module2309 from "../../../_bundle/Module2309";
import * as _Module2310 from "../../../_bundle/Module2310";
import * as _Module2311 from "../../../_bundle/Module2311";
import * as _Module2312 from "../../../_bundle/Module2312";
import * as _Module2313 from "../../../_bundle/Module2313";
import * as _Module2314 from "../../../_bundle/Module2314";
import * as _Module2315 from "../../../_bundle/Module2315";
import * as _Module2316 from "../../../_bundle/Module2316";
import * as _Module2317 from "../../../_bundle/Module2317";
import * as _Module2320 from "../../../_bundle/Module2320";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2288).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2289).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2290).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2291).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2292).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2293).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2294).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2295).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2296).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2297).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2298).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2299).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2300).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2301).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2302).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2303).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2304).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2305).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2306).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2307).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2308).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2309).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2310).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2311).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2312).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2313).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2314).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2315).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2316).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2317).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2320).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,50 @@
// Metro module 9825 (f9826).
import { getSingleRequirementThreshold } from "../../badges/BadgeDirectoryStore";
function $mk83410($env) {
return (a0, a1) => {
let r3 = a0;
const r5 = $env.$parent[0];
const r6 = r5(a1);
const r7 = $env[0];
let r9 = a0;
if (!(r7 >= r6)) {
if (!(a0 != null && !(r6 < r5(a0)))) {
r3 = a1;
}
r9 = r3;
}
return r9;
};
}
let env6520 = {};
export function getTierForProgress(a0, c17510_0) {
return a0.reduce((acc, item) => {
let r3 = acc;
const singleRequirementThreshold = getSingleRequirementThreshold(item);
let r9 = acc;
if (!(c17510_0 < singleRequirementThreshold)) {
if (!(acc != null && !(singleRequirementThreshold > getSingleRequirementThreshold(acc)))) {
r3 = item;
}
r9 = r3;
}
return r9;
}, null);
}
export function getNextTierForProgress(a0, a1) {
let env17509;
const r1 = env17509 = {
$parent: env6520
};
env17509[0] = a1;
return a0.reduce($mk83410(r1), null);
}
export function getRemainingGiftsToNextTier(a0, a1) {
let env17511;
const r2 = env17511 = {
$parent: env6520
};
env17511[0] = a1;
const r7 = a0.reduce($mk83410(r2), null);
return r7 == null ? null : (0, getSingleRequirementThreshold)(r7) - a1;
}
@@ -0,0 +1,12 @@
// Metro module 2321 (f2322).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2322 from "../../../_bundle/Module2322";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
"en-US": () => loadJsonAsset(_Module2322).then((result) => ({
default: result
}))
}, "en-US");
const r21 = makeMessagesProxy(loader);
export default r21;
export { loader as messagesLoader };
@@ -0,0 +1,60 @@
// Metro module 12604 (f12605).
import { getSingleRequirementThreshold } from "../../badges/BadgeDirectoryStore";
import UserStore from "../../../stores/UserStore";
import { GiftingBadgeExperiment } from "./experiments/GiftingBadgeExperiment";
import { GiftingBadgeDesktopExperiment } from "./experiments/GiftingBadgeDesktopExperiment";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useIsDismissibleContentDismissed_UNSAFE } from "../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../_bundle/Module1358";
export function getGiftingBadgeProgressPercent(a0, a1, a2) {
const singleRequirementThreshold = getSingleRequirementThreshold(a1);
const singleRequirementThreshold2 = getSingleRequirementThreshold(a2);
return Math.min(Math.max(a2 != null ? singleRequirementThreshold2 > 0 ? a0 / singleRequirementThreshold2 * 100 : 100 : singleRequirementThreshold > 0 ? Math.min(singleRequirementThreshold, a0) / singleRequirementThreshold * 100 : 100, 0), 100);
}
export function useIsGiftingBadgesDesktopEnabled(a0) {
const enabled = GiftingBadgeExperiment.useConfig({
location: a0
}).enabled;
return GiftingBadgeDesktopExperiment.useConfig({
location: `${a0}${enabled ? "" : "-DISABLED"}`
}).enabled && enabled;
}
export function getIsGiftingBadgesDesktopEnabled(a0) {
return !!GiftingBadgeExperiment.getConfig({
location: a0
}).enabled && GiftingBadgeDesktopExperiment.getConfig({
location: a0
}).enabled;
}
export function useIsEligibleToShowGiftingBadgeCoachmark({ platform: platform2, location: location2 }) {
const enabled = GiftingBadgeExperiment.useConfig({
location: location2
}).enabled;
const r1 = platform2 === "web";
let enabled2 = GiftingBadgeDesktopExperiment.useConfig({
location: `${location2}${r1 ? "" : "-DISABLED"}`
}).enabled;
let r29 = enabled;
if (r1) {
if (enabled2) {
enabled2 = enabled;
}
r29 = enabled2;
}
const stateFromStores = useStateFromStores([UserStore], () => {
const currentUser = UserStore.getCurrentUser();
let r6 = currentUser == null ? void 0 : currentUser.hasHadPremium();
if (r6 == null) {
r6 = false;
}
return r6;
});
const isDismissibleContentDismissed_UNSAFE = useIsDismissibleContentDismissed_UNSAFE(DismissibleContent.NEW_GIFTING_BADGES_COACHMARK);
if (r29) {
r29 = stateFromStores;
}
if (r29) {
r29 = !isDismissibleContentDismissed_UNSAFE;
}
return r29;
}
@@ -0,0 +1,132 @@
// Metro module 2287 (f2288).
import { loadJsonAsset } from "../../asset_json/native/AssetJsonUtils";
import * as _Module2288 from "../../../_bundle/Module2288";
import * as _Module2289 from "../../../_bundle/Module2289";
import * as _Module2290 from "../../../_bundle/Module2290";
import * as _Module2291 from "../../../_bundle/Module2291";
import * as _Module2292 from "../../../_bundle/Module2292";
import * as _Module2293 from "../../../_bundle/Module2293";
import * as _Module2294 from "../../../_bundle/Module2294";
import * as _Module2295 from "../../../_bundle/Module2295";
import * as _Module2296 from "../../../_bundle/Module2296";
import * as _Module2297 from "../../../_bundle/Module2297";
import * as _Module2298 from "../../../_bundle/Module2298";
import * as _Module2299 from "../../../_bundle/Module2299";
import * as _Module2300 from "../../../_bundle/Module2300";
import * as _Module2301 from "../../../_bundle/Module2301";
import * as _Module2302 from "../../../_bundle/Module2302";
import * as _Module2303 from "../../../_bundle/Module2303";
import * as _Module2304 from "../../../_bundle/Module2304";
import * as _Module2305 from "../../../_bundle/Module2305";
import * as _Module2306 from "../../../_bundle/Module2306";
import * as _Module2307 from "../../../_bundle/Module2307";
import * as _Module2308 from "../../../_bundle/Module2308";
import * as _Module2309 from "../../../_bundle/Module2309";
import * as _Module2310 from "../../../_bundle/Module2310";
import * as _Module2311 from "../../../_bundle/Module2311";
import * as _Module2312 from "../../../_bundle/Module2312";
import * as _Module2313 from "../../../_bundle/Module2313";
import * as _Module2314 from "../../../_bundle/Module2314";
import * as _Module2315 from "../../../_bundle/Module2315";
import * as _Module2316 from "../../../_bundle/Module2316";
import * as _Module2317 from "../../../_bundle/Module2317";
import * as _Module2318 from "../../../_bundle/Module2318";
import { createLoader, makeMessagesProxy } from "../../../_bundle/Module1274";
const loader = createLoader({
bg: () => loadJsonAsset(_Module2288).then((result) => ({
default: result
})),
cs: () => loadJsonAsset(_Module2289).then((result) => ({
default: result
})),
da: () => loadJsonAsset(_Module2290).then((result) => ({
default: result
})),
de: () => loadJsonAsset(_Module2291).then((result) => ({
default: result
})),
el: () => loadJsonAsset(_Module2292).then((result) => ({
default: result
})),
"en-GB": () => loadJsonAsset(_Module2293).then((result) => ({
default: result
})),
"es-419": () => loadJsonAsset(_Module2294).then((result) => ({
default: result
})),
"es-ES": () => loadJsonAsset(_Module2295).then((result) => ({
default: result
})),
fi: () => loadJsonAsset(_Module2296).then((result) => ({
default: result
})),
fr: () => loadJsonAsset(_Module2297).then((result) => ({
default: result
})),
hi: () => loadJsonAsset(_Module2298).then((result) => ({
default: result
})),
hr: () => loadJsonAsset(_Module2299).then((result) => ({
default: result
})),
hu: () => loadJsonAsset(_Module2300).then((result) => ({
default: result
})),
it: () => loadJsonAsset(_Module2301).then((result) => ({
default: result
})),
ja: () => loadJsonAsset(_Module2302).then((result) => ({
default: result
})),
ko: () => loadJsonAsset(_Module2303).then((result) => ({
default: result
})),
lt: () => loadJsonAsset(_Module2304).then((result) => ({
default: result
})),
nl: () => loadJsonAsset(_Module2305).then((result) => ({
default: result
})),
no: () => loadJsonAsset(_Module2306).then((result) => ({
default: result
})),
pl: () => loadJsonAsset(_Module2307).then((result) => ({
default: result
})),
"pt-BR": () => loadJsonAsset(_Module2308).then((result) => ({
default: result
})),
ro: () => loadJsonAsset(_Module2309).then((result) => ({
default: result
})),
ru: () => loadJsonAsset(_Module2310).then((result) => ({
default: result
})),
"sv-SE": () => loadJsonAsset(_Module2311).then((result) => ({
default: result
})),
th: () => loadJsonAsset(_Module2312).then((result) => ({
default: result
})),
tr: () => loadJsonAsset(_Module2313).then((result) => ({
default: result
})),
uk: () => loadJsonAsset(_Module2314).then((result) => ({
default: result
})),
vi: () => loadJsonAsset(_Module2315).then((result) => ({
default: result
})),
"zh-CN": () => loadJsonAsset(_Module2316).then((result) => ({
default: result
})),
"zh-TW": () => loadJsonAsset(_Module2317).then((result) => ({
default: result
})),
"en-US": () => loadJsonAsset(_Module2318).then((result) => ({
default: result
}))
}, "en-US");
const r51 = makeMessagesProxy(loader);
export default r51;
export { loader as messagesLoader };
@@ -0,0 +1,17 @@
// Metro module 11891 (f11892).
import { PremiumGiftStyles } from "../PremiumConstants";
import PremiumGifting_messages from "./PremiumGifting.messages";
const r14 = {};
r14[PremiumGiftStyles.SNOWGLOBE] = PremiumGifting_messages.M6cPwB;
r14[PremiumGiftStyles.BOX] = PremiumGifting_messages.B9XqQk;
r14[PremiumGiftStyles.CUP] = PremiumGifting_messages["6dCq/u"];
r14[PremiumGiftStyles.STANDARD_BOX] = PremiumGifting_messages.GzPel1;
r14[PremiumGiftStyles.CAKE] = PremiumGifting_messages.AJ4iir;
r14[PremiumGiftStyles.CHEST] = PremiumGifting_messages.P5keo3;
r14[PremiumGiftStyles.COFFEE] = PremiumGifting_messages.w84vET;
r14[PremiumGiftStyles.SEASONAL_STANDARD_BOX] = PremiumGifting_messages["vd1fu/"];
r14[PremiumGiftStyles.SEASONAL_CAKE] = PremiumGifting_messages.aubYGR;
r14[PremiumGiftStyles.SEASONAL_CHEST] = PremiumGifting_messages.vjxYqU;
r14[PremiumGiftStyles.SEASONAL_COFFEE] = PremiumGifting_messages.bHuJLa;
r14[PremiumGiftStyles.NITROWEEN_STANDARD] = PremiumGifting_messages["+HMF8k"];
export { r14 as GIFT_STYLE_DESCRIPTIONS };
@@ -0,0 +1,127 @@
// Metro module 6179 (f6180).
import UserAffinitiesV2Store from "../../user_affinities/UserAffinitiesV2Store";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import MessageStore from "../../../stores/MessageStore";
import { GiftIntentType } from "../PremiumConstants";
import { AnalyticEvents, Endpoints } from "../../../Constants";
import { HTTP } from "../../../_bundle/sendRequest";
import Dispatcher from "../../../Dispatcher";
import SentryUtils_native from "../../../utils/SentryUtils.native";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { isFriendshipAnniversaryBackendPersistenceEnabled } from "../experiments/FriendshipAnniversaryBackendPersistenceExperiment";
let $mk77956 = function() {
return (a0) => {
SentryUtils_native.captureException(a0, {
tags: {
feature: "gift_intent"
}
});
};
};
export function fetchAndReconcileGiftIntentDismissals(settingsTimestampMs) {
const id = AuthenticationStore.getId();
return HTTP.get({
url: Endpoints.GIFT_INTENT_DISMISSALS,
oldFormErrors: true,
rejectWithError: true
}).then((result) => {
if (AuthenticationStore.getId() === id) {
let dismissals = result.body.dismissals;
if (dismissals == null) {
dismissals = [];
}
Dispatcher.dispatch({
type: "GIFT_INTENT_DISMISSALS_FETCH_SUCCESS",
dismissals: dismissals.map((dismissal) => ({
targetId: dismissal.target_id,
dismissedAtMs: Number(dismissal.dismissed_at_ms)
})),
settingsTimestampMs
});
} else {
Dispatcher.dispatch({
type: "GIFT_INTENT_DISMISSALS_FETCH_FAILURE"
});
}
}, (a0) => {
SentryUtils_native.captureException(a0, {
tags: {
feature: "gift_intent"
}
});
Dispatcher.dispatch({
type: "GIFT_INTENT_DISMISSALS_FETCH_FAILURE"
});
});
}
export function logFriendsListGiftIntentsShown() {
Dispatcher.dispatch({
type: "FRIENDS_LIST_GIFT_INTENTS_SHOWN"
});
}
export function logMessageGiftIntentShown(a0, gift_intent_type = GiftIntentType.FRIEND_ANNIVERSARY) {
Dispatcher.dispatch({
type: "MESSAGE_GIFT_INTENT_SHOWN",
recipientUserId: a0
});
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_DISMISSED, {
gift_intent_type,
dismiss_type: "shown",
affinity: UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability
});
if (isFriendshipAnniversaryBackendPersistenceEnabled("dismissGiftIntent") && gift_intent_type !== GiftIntentType.UNSPECIFIED) {
HTTP.post({
url: Endpoints.GIFT_INTENTS_DISMISS,
body: {
intent_type: gift_intent_type,
target_id: a0
},
oldFormErrors: true,
rejectWithError: true
}).catch($mk77956());
}
}
export function logGiftIntentMessageDismissed(a0, a1) {
const giftingPrompt = MessageStore.getMessage(a0, a1)?.giftingPrompt;
if (giftingPrompt != null) {
const { giftIntentType, recipientUserId } = giftingPrompt;
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_DISMISSED, {
gift_intent_type: giftIntentType,
dismiss_type: "explicit",
affinity: UserAffinitiesV2Store.getUserAffinity(recipientUserId)?.dmProbability
});
if (isFriendshipAnniversaryBackendPersistenceEnabled("dismissGiftIntent") && giftIntentType !== GiftIntentType.UNSPECIFIED) {
HTTP.post({
url: Endpoints.GIFT_INTENTS_DISMISS,
body: {
intent_type: giftIntentType,
target_id: recipientUserId
},
oldFormErrors: true,
rejectWithError: true
}).catch($mk77956());
}
}
}
export function logGiftIntentFlowPurchasedGift(a0, gift_intent_type = GiftIntentType.FRIEND_ANNIVERSARY) {
Dispatcher.dispatch({
type: "GIFT_INTENT_FLOW_PURCHASED_GIFT",
recipientUserId: a0
});
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_DISMISSED, {
gift_intent_type,
dismiss_type: "gift_sent",
affinity: UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability
});
if (isFriendshipAnniversaryBackendPersistenceEnabled("dismissGiftIntent") && gift_intent_type !== GiftIntentType.UNSPECIFIED) {
HTTP.post({
url: Endpoints.GIFT_INTENTS_DISMISS,
body: {
intent_type: gift_intent_type,
target_id: a0
},
oldFormErrors: true,
rejectWithError: true
}).catch($mk77956());
}
}
@@ -0,0 +1,374 @@
// Metro module 7853 (f7854).
import ExperimentStore from "../../experiments/ExperimentStore";
import ApexExperimentStore from "../../experiments/apex/ApexExperimentStore";
import UserAffinitiesV2Store from "../../user_affinities/UserAffinitiesV2Store";
import UserSettingsProtoStore from "../../user_settings/UserSettingsProtoStore";
import ConsentStore from "../../../stores/ConsentStore";
import RelationshipStore from "../../../stores/RelationshipStore";
import { Consents } from "../../../Constants";
import { categorizeFriendAnniversariesByAffinity, isFriendAnniversary, pruneTimestampMap, yearsSince } from "./shared/FriendAnniversaryUtils";
import { EnableFriendAnniversaryNotifications } from "../../user_settings/UserSettings";
import { getFriendAnniversaryGateConfig } from "./FriendAnniversaryGate.native";
import Module12 from "../../../_bundle/Module12";
import Module589 from "../../../_bundle/Module589";
import Dispatcher from "../../../Dispatcher";
let c4958_10, c4958_11, highestAffinity, highAffinity, c4958_14, c4958_15, c4958_16, date, categorizeTopAffinityFriendAnniversaries, updateFriendAnniversaries, resetFriendAnniversaries, generateFriendAnniversaries, $mk79328 = function() {
return (a0) => UserAffinitiesV2Store.getUserAffinity(a0)?.dmProbability;
};
const getCurrentTime = function getCurrentTime() {
let r4 = date;
if (r4 == null) {
r4 = Date.now();
}
return r4;
};
categorizeTopAffinityFriendAnniversaries = function categorizeTopAffinityFriendAnniversaries() {
const r0 = void 0 === void 0 ? false : void 0;
const r11 = categorizeFriendAnniversariesByAffinity(c4958_11, $mk79328(), r0);
const { highestAffinity: highestAffinity2, highAffinity: highAffinity2 } = r11;
highestAffinity = highestAffinity2;
highAffinity = highAffinity2;
};
updateFriendAnniversaries = function updateFriendAnniversaries() {
let r26;
if (c4958_15 == null) {
resetFriendAnniversaries();
if (ConsentStore.hasConsented(Consents.PERSONALIZATION) && EnableFriendAnniversaryNotifications.getSetting()) {
let r47 = RelationshipStore.getFriendIDs()[Symbol.iterator]();
const next = r47.next;
while (true) {
const r14 = r47 === void 0 ? void 0 : (r26 = next.call(r47)).done ? r47 = void 0 : r26.value;
if (r47 === void 0) {
if (c4958_11.length === 0) {
break;
}
if (getFriendAnniversaryGateConfig({
location: "PremiumGiftingIntentStore updateFriendAnniversaries"
}).enabled) {
c4958_11.sort((a, b) => UserAffinitiesV2Store.compareByDmProbability(a, b));
categorizeTopAffinityFriendAnniversaries();
break;
}
resetFriendAnniversaries();
break;
}
try {
const since = RelationshipStore.getSince(r14);
const userAffinity = UserAffinitiesV2Store.getUserAffinity(r14);
if (RelationshipStore.isFriend(r14) && userAffinity != null && userAffinity.dmProbability > 0 && since != null) {
const date2 = new Date(since);
if (isFriendAnniversary(date2)) {
c4958_11.push(r14);
c4958_14[r14] = {
friendsSince: date2
};
}
}
} catch (r80) {
if (r47 !== void 0 && typeof r47.return === "function") {
try {
r47.return();
} catch {}
}
throw r80;
}
}
}
} else {
generateFriendAnniversaries(c4958_15);
}
};
resetFriendAnniversaries = function resetFriendAnniversaries() {
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
};
generateFriendAnniversaries = function generateFriendAnniversaries(total) {
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
if (getFriendAnniversaryGateConfig({
location: "PremiumGiftingIntentStore generateFriendAnniversaries"
}).enabled && EnableFriendAnniversaryNotifications.getSetting()) {
let c16042_0;
c4958_15 = total;
const r40 = RelationshipStore.getFriendIDs().filter((item) => !RelationshipStore.isIgnored(item));
c16042_0 = new Set(r40);
const r57 = c4958_16 != null && (c4958_16.length === total && c4958_16.every((item) => c16042_0.has(item))) ? c4958_16 : Module12.sampleSize(r40, total);
c4958_16 = r57;
r57.forEach((item) => {
const since = RelationshipStore.getSince(item);
if (since != null) {
const date2 = new Date(since);
c4958_11.push(item);
c4958_14[item] = {
friendsSince: date2
};
}
});
c4958_11.sort((a, b) => UserAffinitiesV2Store.compareByDmProbability(a, b));
const r69 = categorizeFriendAnniversariesByAffinity(c4958_11, $mk79328(), true);
const { highestAffinity: highestAffinity2, highAffinity: highAffinity2 } = r69;
highestAffinity = highestAffinity2;
highAffinity = highAffinity2;
}
};
c4958_10 = {
messageGiftIntentLastShownMap: {},
lastShownFriendsListGiftIntents: [],
friendsTabBadgeLastDismissedTime: null,
lastKnownGiftIntentDismissedAtMs: 0
};
c4958_11 = [];
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
c4958_15 = null;
c4958_16 = null;
date = null;
class PremiumGiftingIntentStore extends Module589.PersistedStore {
static displayName = "PremiumGiftingIntentStore";
static persistKey = "PremiumGiftingIntentStore";
static migrations = [(a0) => {
let r1 = a0;
if (a0 != null) {
let friendsTabBadgeLastDismissedTime = a0.friendsTabBadgeLastDismissedTime;
if (friendsTabBadgeLastDismissedTime == null) {
friendsTabBadgeLastDismissedTime = null;
}
let lastShownFriendsListGiftIntents = a0.lastShownFriendsListGiftIntents;
if (lastShownFriendsListGiftIntents == null) {
lastShownFriendsListGiftIntents = [];
}
r1 = {
friendsTabBadgeLastDismissedTime,
lastShownFriendsListGiftIntents,
messageGiftIntentLastShownMap: {}
};
}
return r1;
}, (a0) => {
let r1 = a0;
if (a0 != null) {
let lastShownFriendsListGiftIntents = a0.lastShownFriendsListGiftIntents;
if (lastShownFriendsListGiftIntents == null) {
lastShownFriendsListGiftIntents = [];
}
let messageGiftIntentLastShownMap = a0.messageGiftIntentLastShownMap;
if (messageGiftIntentLastShownMap == null) {
messageGiftIntentLastShownMap = {};
}
r1 = {
friendsTabBadgeLastDismissedTime: null,
lastShownFriendsListGiftIntents,
messageGiftIntentLastShownMap,
giftUnreadNotificationLastDismissedTimes: []
};
}
return r1;
}, (a0) => {
let r1 = a0;
if (a0 != null) {
let lastShownFriendsListGiftIntents = a0.lastShownFriendsListGiftIntents;
if (lastShownFriendsListGiftIntents == null) {
lastShownFriendsListGiftIntents = [];
}
let messageGiftIntentLastShownMap = a0.messageGiftIntentLastShownMap;
if (messageGiftIntentLastShownMap == null) {
messageGiftIntentLastShownMap = {};
}
let giftUnreadNotificationLastDismissedTimes = a0.giftUnreadNotificationLastDismissedTimes;
if (giftUnreadNotificationLastDismissedTimes == null) {
giftUnreadNotificationLastDismissedTimes = [];
}
r1 = {
friendsTabBadgeLastDismissedTime: null,
lastShownFriendsListGiftIntents,
messageGiftIntentLastShownMap,
giftUnreadNotificationLastDismissedTimes,
profilePopoutGiftIntentsDismissMap: {}
};
}
return r1;
}, (a0) => {
let r2 = a0;
if (a0 != null) {
let lastKnownGiftIntentDismissedAtMs = a0.lastKnownGiftIntentDismissedAtMs;
if (lastKnownGiftIntentDismissedAtMs == null) {
lastKnownGiftIntentDismissedAtMs = 0;
}
r2 = {
...a0,
lastKnownGiftIntentDismissedAtMs
};
}
return r2;
}, (a0) => {
if (a0 != null) {
delete a0["profilePopoutGiftIntentsDismissMap"];
}
return a0;
}, (a0) => {
if (a0 == null) {
return a0;
}
const r2 = {
...a0
};
delete r2["giftUnreadNotificationLastDismissedTimes"];
return r2;
}];
initialize(a0) {
c4958_10 = {
messageGiftIntentLastShownMap: {},
lastShownFriendsListGiftIntents: [],
friendsTabBadgeLastDismissedTime: null,
lastKnownGiftIntentDismissedAtMs: 0
};
if (a0 != null) {
c4958_10.friendsTabBadgeLastDismissedTime = a0.friendsTabBadgeLastDismissedTime;
c4958_10.lastShownFriendsListGiftIntents = Array.from(a0.lastShownFriendsListGiftIntents);
c4958_10.messageGiftIntentLastShownMap = {
...a0.messageGiftIntentLastShownMap
};
const r23 = c4958_10;
let lastKnownGiftIntentDismissedAtMs = a0.lastKnownGiftIntentDismissedAtMs;
if (lastKnownGiftIntentDismissedAtMs == null) {
lastKnownGiftIntentDismissedAtMs = 0;
}
r23.lastKnownGiftIntentDismissedAtMs = lastKnownGiftIntentDismissedAtMs;
}
this.syncWith([RelationshipStore, UserAffinitiesV2Store, ConsentStore, ExperimentStore, ApexExperimentStore, UserSettingsProtoStore], updateFriendAnniversaries);
const r36 = c4958_10;
const messageGiftIntentLastShownMap = c4958_10.messageGiftIntentLastShownMap;
let r44 = date;
if (r44 == null) {
r44 = Date.now();
}
r36.messageGiftIntentLastShownMap = pruneTimestampMap(messageGiftIntentLastShownMap, r44, 1209600000);
}
getState() {
return c4958_10;
}
getFriendAnniversaries() {
return c4958_11;
}
canShowFriendsTabBadge() {
return Array.from(highAffinity).some((item) => !c4958_10.lastShownFriendsListGiftIntents.includes(item));
}
getFriendAnniversaryYears(a0) {
const r5 = c4958_14[a0];
return r5 == null ? 0 : yearsSince(r5.friendsSince);
}
isGiftIntentMessageInCooldown(a0) {
return c4958_10.messageGiftIntentLastShownMap[a0] != null;
}
getDevToolTotalFriendAnniversaries() {
return c4958_15;
}
getDevToolCurrentDate() {
return date;
}
getHighestAffinityFriendAnniversaries() {
return Array.from(highestAffinity);
}
getHighAffinityFriendAnniversaries() {
return Array.from(highAffinity);
}
getMessageGiftIntentLastShownMap() {
return c4958_10.messageGiftIntentLastShownMap;
}
getLastKnownGiftIntentDismissedAtMs() {
return c4958_10.lastKnownGiftIntentDismissedAtMs;
}
}
const premiumGiftingIntentStore = new PremiumGiftingIntentStore(Dispatcher, {
CONNECTION_OPEN: function handleConnectionOpen() {
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
},
LOGOUT: function handleLogout() {
c4958_10 = {
messageGiftIntentLastShownMap: {},
lastShownFriendsListGiftIntents: [],
friendsTabBadgeLastDismissedTime: null,
lastKnownGiftIntentDismissedAtMs: 0
};
c4958_11.length = 0;
highestAffinity = new Set();
highAffinity = new Set();
c4958_14 = {};
},
MESSAGE_GIFT_INTENT_SHOWN: function handleMessageGiftIntentShown({ recipientUserId }) {
if (c4958_10.messageGiftIntentLastShownMap[recipientUserId] == null) {
const messageGiftIntentLastShownMap = c4958_10.messageGiftIntentLastShownMap;
let r11 = date;
if (r11 == null) {
r11 = Date.now();
}
messageGiftIntentLastShownMap[recipientUserId] = r11;
}
},
FRIENDS_LIST_GIFT_INTENTS_SHOWN: function handleFriendsListGiftIntentsShown() {
c4958_10.lastShownFriendsListGiftIntents = Array.from(c4958_11);
},
GIFT_INTENT_FLOW_PURCHASED_GIFT: function handleGiftIntentFlowPurchasedGift({ recipientUserId }) {
if (c4958_10.messageGiftIntentLastShownMap[recipientUserId] == null) {
const messageGiftIntentLastShownMap = c4958_10.messageGiftIntentLastShownMap;
let r11 = date;
if (r11 == null) {
r11 = Date.now();
}
messageGiftIntentLastShownMap[recipientUserId] = r11;
}
},
GIFT_INTENT_DISMISSALS_FETCH_SUCCESS: function handleGiftIntentDismissalsFetchSuccess({ dismissals, settingsTimestampMs }) {
const r8 = {
...c4958_10.messageGiftIntentLastShownMap
};
for (const item of dismissals) {
const { targetId, dismissedAtMs } = item;
const r36 = r8[targetId];
r8[targetId] = r36 == null ? dismissedAtMs : Math.max(r36, dismissedAtMs);
}
c4958_10.messageGiftIntentLastShownMap = pruneTimestampMap(r8, getCurrentTime(), 1296000000);
c4958_10.lastKnownGiftIntentDismissedAtMs = settingsTimestampMs;
},
DEV_TOOLS_FRIENDS_LIST_GIFT_INTENTS_SHOWN_RESET: function handleDevToolResetFriendsListGiftIntentsShown() {
c4958_10.lastShownFriendsListGiftIntents = [];
},
DEV_TOOLS_GIFT_MESSAGE_COOLDOWN_RESET: function handleDevToolResetGiftMessageCooldown() {
c4958_10.messageGiftIntentLastShownMap = {};
},
DEV_TOOLS_SET_FRIEND_ANNIVERSARY_COUNT: function handleDevToolSetFriendAnniversaryCount({ total }) {
if (total == null) {
c4958_15 = null;
c4958_16 = null;
updateFriendAnniversaries();
return void 0;
}
generateFriendAnniversaries(total);
},
DEV_TOOLS_RESAMPLE_FRIEND_ANNIVERSARIES: function handleDevToolResampleFriendAnniversaries() {
let r1 = c4958_15 != null;
if (r1) {
c4958_16 = null;
generateFriendAnniversaries(c4958_15);
r1 = true;
}
return r1;
},
DEV_TOOLS_SET_CURRENT_DATE: function handleDevToolSetCurrentDate(a0) {
date = a0.date;
},
DEV_TOOLS_RESET_CURRENT_DATE: function handleDevToolResetCurrentDate() {
date = null;
}
});
export default premiumGiftingIntentStore;
export const FRIENDS_LIST_ANNIVERSARY_DISPLAY_LIMIT = 5;
export const FRIENDS_TAB_BADGE_COOLDOWN_MS = 604800000;
@@ -0,0 +1,16 @@
// Metro module 8808 (f8809).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-gift-promotion-reminder",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export { apexExperiment as GiftPromotionReminderExperiment };
@@ -0,0 +1,16 @@
// Metro module 12605 (f12606).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-gifting-badge-desktop",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export { apexExperiment as GiftingBadgeDesktopExperiment };
@@ -0,0 +1,16 @@
// Metro module 8771 (f8772).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-04-gifting-badge",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
export { apexExperiment as GiftingBadgeExperiment };
@@ -0,0 +1,29 @@
// Metro module 8805 (f8806).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-nitro-gifting-price-copy-tweaks",
kind: "user",
defaultConfig: {
showGiftPrice: true,
useNewCopy: false,
monthlyDefaultSelected: false
},
variations: {
1: {
showGiftPrice: false,
useNewCopy: false,
monthlyDefaultSelected: false
},
2: {
showGiftPrice: true,
useNewCopy: true,
monthlyDefaultSelected: false
},
3: {
showGiftPrice: true,
useNewCopy: true,
monthlyDefaultSelected: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,5 @@
// Metro module 8776 (f8777).
import { PremiumGiftStyles } from "../../PremiumConstants";
export function useGiftStyles() {
return [PremiumGiftStyles.STANDARD_BOX];
}
@@ -0,0 +1,4 @@
// Metro module 9786 (f9787).
export default function useGiftingPromotionConfig() {
return null;
};
@@ -0,0 +1,6 @@
// Metro module 9781 (f9782).
export function useGiftingPromotionDefaultSelectionV2(a0, a1) {
if (a0 != null && a0.length !== 0) {
return a1 != null && a0.includes(a1) ? a1 : a0[0];
}
}
@@ -0,0 +1,144 @@
// Metro module 11006 (f11007).
import { useRef, useState, useCallback } from "react";
import { View } from "react-native";
import ChannelStore from "../../../../stores/ChannelStore";
import { AnalyticEvents } from "../../../../Constants";
import { MessageSendLocation } from "../../../messages/MessageConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import MessageActionCreators from "../../../../actions/MessageActionCreators";
import MessageParser from "../../../messages/MessageParser";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import AnalyticsLocation from "../../../app_analytics/AnalyticsLocation";
import useSafeAreaInsetsKeyboardAware_native from "../../../safe_area/useSafeAreaInsetsKeyboardAware.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { TextArea } from "../../../../design/components/TextInput/native/TextArea.native";
import { intl, t } from "../../../../intl/index.native";
import { getGiftIntentCustomMessagePlaceholder } from "./GiftIntentMessagePlaceholder";
import GIFPicker from "../../../gif_picker/native/GIFPicker";
import { Button } from "../../../../design/components/Button/native/Button.native";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import useInitialValue from "../../../../hooks/useInitialValue";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
let useStyles, GiftIntentGifModalBody, c7415_15;
let _sendGiftIntentGif = function _sendGiftIntentGif() {
const r8 = async (c26903_0) => {
let c26903_2;
c26903_2 = void 0;
let c30330_0 = c26903_0.channel;
let c30330_1 = c26903_0.giftIntentType;
let c30330_2 = c26903_0.text;
let c30330_3 = c26903_0.gif;
await void 0;
let c30330_4 = c30330_2.trim().length > 0;
if (c30330_4) {
await MessageActionCreators.sendMessage(c30330_0.id, MessageParser.parse(c30330_0, c30330_2), true, {
location: MessageSendLocation.GIFTING
});
}
await MessageActionCreators.sendMessage(c30330_0.id, MessageParser.parse(c30330_0, c30330_3.url), true, {
location: MessageSendLocation.GIFTING
});
AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_MESSAGE_SENT, {
gift_intent_type: c30330_1,
is_custom_message: c30330_4,
location_stack: [AnalyticsLocation.PREMIUM_GIFT_INTENT_CARD]
});
};
_sendGiftIntentGif = r8;
return r8.apply(this, arguments);
};
GiftIntentGifModalBody = function GiftIntentGifModalBody(props) {
let ref, state, setState;
const { channelId, giftIntentType, onClose } = props;
ref = void 0;
state = void 0;
setState = void 0;
const styles = useStyles();
const insets = useSafeAreaInsetsKeyboardAware_native().insets;
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId));
ref = useRef(null);
[state, setState] = useState(null);
const ref2 = useRef(null);
const callback2 = useCallback((c26904_0) => {
setState((prevState) => {
const src = prevState?.src;
return src !== c26904_0.src ? c26904_0 : null;
});
}, []);
const callback3 = useCallback(() => {
if (stateFromStores != null && state != null && state.url.length !== 0) {
const current = ref.current;
let text = current == null ? void 0 : current.getText();
if (text == null) {
text = "";
}
(function sendGiftIntentGif() {
return _sendGiftIntentGif.apply(this, arguments);
})({
channel: stateFromStores,
giftIntentType,
text,
gif: state
});
onClose();
}
}, [stateFromStores, giftIntentType, state, onClose]);
const r74 = [<View style={styles.messageContainer}>
<TextArea ref={ref} accessibilityLabel={intl.string(t.ZV02cV)} placeholder={getGiftIntentCustomMessagePlaceholder()} />
</View>, , ,];
let guildId = stateFromStores?.guild_id;
if (guildId == null) {
guildId = void 0;
}
r74[1] = <View style={styles.pickerContainer}>
<GIFPicker bottomSheetRef={ref2} channelId={channelId} guildId={guildId} initialQuery={intl.string(t.jrtJi4)} inActionSheet={false} contentHorizontalPadding={Module712.space.PX_16} selectedGifSrc={state?.src} keyboardDismissMode="on-drag" onPressGIF={callback2} />
</View>;
r74[2] = <View style={styles.footer}>
<Button grow variant="primary" text={intl.string(t.TXNS7S)} onPress={callback3} disabled={state == null} />
<Button grow variant="secondary" text={intl.string(t["ETE/oC"])} onPress={onClose} />
</View>;
return <View style={[styles.container, {
paddingBottom: insets.bottom
}]}>{r74}</View>;
};
useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
messageContainer: {
paddingHorizontal: Module712.space.PX_16,
paddingBottom: Module712.space.PX_8
},
pickerContainer: {
flex: 1
},
footer: {
gap: Module712.space.PX_8,
paddingHorizontal: Module712.space.PX_16,
paddingTop: Module712.space.PX_8
}
});
c7415_15 = {
GIFT_INTENT_GIF: "GIFT_INTENT_GIF"
};
export default function GiftIntentGifModal(props) {
const { channelId: channelId2, giftIntentType: giftIntentType2, onDismiss } = props;
const callback = useCallback(() => {
ModalActionCreators.pop();
if (onDismiss != null) {
onDismiss();
}
}, [onDismiss]);
return <Navigator initialRouteName={c7415_15.GIFT_INTENT_GIF} screens={useInitialValue(() => {
const r1 = {};
r1[c7415_15.GIFT_INTENT_GIF] = {
title: intl.string(t.PQRuGc),
headerLeft: getHeaderCloseButton(callback),
render: () => <GiftIntentGifModalBody channelId={channelId2} giftIntentType={giftIntentType2} onClose={callback} />
};
return r1;
})} />;
};
@@ -0,0 +1,5 @@
// Metro module 11007 (f11008).
import { intl, t } from "../../../../intl/index.native";
export function getGiftIntentCustomMessagePlaceholder() {
return intl.string(t.OrwKgi);
}
@@ -0,0 +1,107 @@
// Metro module 9705 (f9706).
import { useEffect } from "react";
import { View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import BadgeDirectoryStore, { getSingleRequirementThreshold } from "../../../badges/BadgeDirectoryStore";
import { AnalyticEvents } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { BadgeId } from "../../../../_bundle/Module8106";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl } from "../../../../intl/index.native";
import GiftingBadge_messages from "../GiftingBadge.messages";
import GiftingBadgeIcon from "./views/GiftingBadgeIcon";
const useStyles = createStyles({
container: {
alignItems: "center",
paddingTop: Module712.space.PX_16,
paddingHorizontal: Module712.space.PX_16
},
headerContainer: {
paddingHorizontal: Module712.space.PX_8
},
title: {
textAlign: "center",
marginBottom: Module712.space.PX_8
},
description: {
textAlign: "center",
marginBottom: Module712.space.PX_16
},
tierCards: {
flexDirection: "row",
flexWrap: "wrap",
rowGap: Module712.space.PX_8
},
tierCard: {
width: "33.33%",
alignItems: "center",
padding: Module712.space.PX_8
},
iconWrapper: {
paddingVertical: Module712.space.PX_8
}
});
export default function GiftingBadgeInfoActionSheet() {
let stateFromStores;
const styles = useStyles();
const bottom = useSafeAreaInsets_native().bottom;
const stateFromStores2 = useStateFromStores([BadgeDirectoryStore], () => BadgeDirectoryStore.getBadgeById(BadgeId.GIFTING));
stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
useEffect(() => {
AnalyticsUtils.track(AnalyticEvents.GIFTING_BADGE_INFO_ACTION_SHEET_OPENED);
}, []);
const r80 = [<View style={styles.headerContainer}>
<Text style={styles.title} variant="heading-xl/semibold" color="text-strong" accessibilityRole="header">
{intl.string(GiftingBadge_messages["0MB2C6"])}
</Text>
<Text style={styles.description} variant="text-md/medium" color="text-default">
{intl.string(GiftingBadge_messages.k9sNVH)}
</Text>
</View>, ,];
const r2 = stateFromStores2 == null;
let r83 = void 0;
if (!r2) {
const tiers = stateFromStores2.tiers;
r83 = tiers == null ? void 0 : tiers.map((tier) => {
let icon;
if (stateFromStores) {
let complex_icon_static_url = tier.complex_icon_static_url;
if (complex_icon_static_url == null) {
complex_icon_static_url = tier.simple_icon_url;
}
icon = complex_icon_static_url;
} else {
icon = tier.complex_icon_animated_url;
if (icon == null) {
icon = tier.complex_icon_static_url;
}
if (icon == null) {
icon = tier.simple_icon_url;
}
}
const singleRequirementThreshold = getSingleRequirementThreshold(tier);
return <View key={tier.key} style={styles.tierCard}>
{icon != null && <View style={styles.iconWrapper}>
<GiftingBadgeIcon icon={icon} size={58} />
</View>}
<Text variant="text-lg/semibold" color="text-strong">{tier.name}</Text>
{singleRequirementThreshold != null && <Text variant="text-md/normal" color="text-subtle">
{intl.formatToPlainString(GiftingBadge_messages.qvx9E4, {
count: singleRequirementThreshold
})}
</Text>}
</View>;
});
}
r80[1] = <View style={styles.tierCards}>{r83}</View>;
return <BottomSheet scrollable={false} startExpanded>
<View style={[styles.container, {
paddingBottom: bottom + Module712.space.PX_16
}]}>{r80}</View>
</BottomSheet>;
};
@@ -0,0 +1,15 @@
// Metro module 7856 (f7857).
import { createApexExperiment } from "../../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-mobile-friendship-anniversary",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export default apexExperiment;
@@ -0,0 +1,76 @@
// Metro module 16300 (f16301).
import UserAffinitiesV2Store from "../../../user_affinities/UserAffinitiesV2Store";
import ChannelStore from "../../../../stores/ChannelStore";
import MessageStore from "../../../../stores/MessageStore";
import SelectedChannelStore from "../../../../stores/SelectedChannelStore";
import PremiumGiftingIntentStore from "../PremiumGiftingIntentStore";
import { GiftIntentSecondaryAction, GiftIntentType } from "../../PremiumConstants";
import GiftIntentReconcilingManager from "../shared/GiftIntentReconcilingManager";
import { ChannelTypes } from "../../../../_bundle/Module692";
import { EnableFriendAnniversaryNotifications } from "../../../user_settings/UserSettings";
import { logMessageGiftIntentShown } from "../PremiumGiftingIntentActionCreators";
import { trackImpression } from "../../../app_analytics/useTrackImpression";
import { ImpressionNames, ImpressionTypes } from "../../../../_bundle/Module503";
import { DelayedCall } from "../../../../_bundle/Timeout";
import MobileFriendAnniversaryExperiment from "./MobileFriendAnniversaryExperiment";
import { fetchUserAffinitiesV2 } from "../../../user_affinities/UserAffinitiesActionCreators";
class MobileGiftIntentCardManager extends GiftIntentReconcilingManager {
isChannelEligible(a0) {
return a0.type === ChannelTypes.DM;
}
maybeSendCard(a0, a1) {
if (EnableFriendAnniversaryNotifications.getSetting() && !PremiumGiftingIntentStore.isGiftIntentMessageInCooldown(a1) && a0 === SelectedChannelStore.getChannelId()) {
if (MessageStore.isReady(a0)) {
if (this.trySendGiftingPromptSystemMessage(a0, GiftIntentType.FRIEND_ANNIVERSARY, a1, GiftIntentSecondaryAction.SEND_MESSAGE, "maybeSendCard")) {
logMessageGiftIntentShown(a1);
trackImpression({
name: ImpressionNames.GIFT_INTENT_UNREAD_NOTIFICATION,
type: ImpressionTypes.VIEW,
properties: {
gift_intent_type: GiftIntentType.FRIEND_ANNIVERSARY,
dm_affinity: UserAffinitiesV2Store.getUserAffinity(a1)?.dmProbability,
channel_id: a0
}
});
}
} else {
MessageStore.whenReady(a0, () => {
const channelId = SelectedChannelStore.getChannelId();
if (channelId === a0) {
this.maybeSendCard(a0, a1);
}
});
}
}
}
sendCardInSelectedChannelIfEligible(a0) {
let c22957_0, c22957_2;
const channel = ChannelStore.getChannel(a0);
if (channel != null && this.isChannelEligible(channel)) {
c22957_2 = new Set(channel.recipients);
const r24 = PremiumGiftingIntentStore.getFriendAnniversaries().find((item) => c22957_2.has(item));
c22957_0 = r24;
if (r24 != null) {
new DelayedCall(1000, () => {
this.maybeSendCard(channel.id, c22957_0);
}).delay();
}
}
}
maybeFetchUserAffinities() {
if (MobileFriendAnniversaryExperiment.getConfig({
location: "MobileGiftIntentCardManager"
}).enabled) {
fetchUserAffinitiesV2();
}
}
onChannelSelect(a0) {
this.sendCardInSelectedChannelIfEligible(a0.channelId);
}
sendGiftingPromptSystemMessagesIfEligible() {
this.maybeFetchUserAffinities();
this.sendCardInSelectedChannelIfEligible(SelectedChannelStore.getChannelId());
}
}
const mobileGiftIntentCardManager = new MobileGiftIntentCardManager();
export default mobileGiftIntentCardManager;
@@ -0,0 +1,9 @@
// Metro module 9710 (f9711).
import { PremiumTypes } from "../../../PremiumConstants";
import { useNativeGiftContext } from "../../../../payments/native/NativeGiftContext";
export default function useShouldShowGiftingPromotionDeco(a0) {
const nativeGiftContext = useNativeGiftContext();
const { claimableRewards, premiumType } = nativeGiftContext;
const r2 = a0 != null ? a0 === PremiumTypes.TIER_2 : premiumType === PremiumTypes.TIER_2;
return claimableRewards != null && claimableRewards.length > 0 && r2;
};
@@ -0,0 +1,5 @@
// Metro module 9704 (f9705).
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
export default function openGiftingBadgeInfoActionSheet() {
ActionSheetActionCreators.openLazy(import("./GiftingBadgeInfoActionSheet"), "GiftingBadgeInfoActionSheet");
};
@@ -0,0 +1,11 @@
// Metro module 9706 (f9707).
import { Image as Image2 } from "react-native";
export default function GiftingBadgeIcon(props) {
const { icon, size } = props;
return <Image2 source={{
uri: icon
}} style={[{
width: size,
height: size
}, props.style]} />;
};
@@ -0,0 +1,60 @@
// Metro module 9827 (f9828).
import { View } from "react-native";
import { getSingleRequirementThreshold } from "../../../../badges/BadgeDirectoryStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
const useStyles = createStyles({
container: {
gap: Module712.space.PX_4,
width: "100%"
},
barRow: {
flexDirection: "row",
alignItems: "center",
gap: Module712.space.PX_8
},
progressBarTrack: {
flex: 1,
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
overflow: "hidden"
},
progressBarFill: {
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_BRAND
},
labels: {
flexDirection: "row",
justifyContent: "flex-end"
}
});
export default function GiftingBadgeLevelUpProgress(props) {
const { progress, currentTier, newTier, style } = props;
const styles = useStyles();
const singleRequirementThreshold = getSingleRequirementThreshold(newTier);
return <View style={[styles.container, style]}>
<View style={styles.barRow}>
{currentTier?.simple_icon_url != null && <GiftingBadgeIcon icon={currentTier.simple_icon_url} size={24} />}
<View style={styles.progressBarTrack}>
<View style={[styles.progressBarFill, {
width: `${singleRequirementThreshold > 0 ? Math.min(Math.max(progress / singleRequirementThreshold * 100, 0), 100) : 100}%`
}]} />
</View>
{newTier.simple_icon_url != null && <GiftingBadgeIcon icon={newTier.simple_icon_url} size={24} />}
</View>
<View style={styles.labels}>
<Text variant="text-xs/normal" color="text-muted">
{intl.format(GiftingBadge_messages.iIpfQe, {
count: progress,
threshold: singleRequirementThreshold
})}
</Text>
</View>
</View>;
};
@@ -0,0 +1,69 @@
// Metro module 9826 (f9827).
import { View } from "react-native";
import { getSingleRequirementThreshold } from "../../../../badges/BadgeDirectoryStore";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
let useStyles;
const GiftingBadgeProgressBar = function GiftingBadgeProgressBar(props) {
const percent = props.percent;
const styles = useStyles();
return <View style={styles.progressBarTrack}>
<View style={[styles.progressBarFill, {
width: `${Math.min(Math.max(percent, 0), 100)}%`
}]} />
</View>;
};
useStyles = createStyles({
container: {
flexDirection: "row",
alignItems: "center",
padding: Module712.space.PX_16
},
content: {
flex: 1,
paddingHorizontal: Module712.space.PX_8,
gap: Module712.space.PX_4
},
progressBarTrack: {
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_MOD_NORMAL,
overflow: "hidden"
},
progressBarFill: {
height: 6,
borderRadius: Module712.radii.round,
backgroundColor: Module712.colors.BACKGROUND_BRAND
},
labels: {
flexDirection: "row",
justifyContent: "flex-end",
alignItems: "center",
minHeight: Module712.space.PX_16
}
});
export default function GiftingBadgeProgress(props) {
const { progress, currentTier, nextTier, iconSize = 24, title } = props;
const styles = useStyles();
const singleRequirementThreshold = getSingleRequirementThreshold(nextTier);
return <View style={styles.container}>
{currentTier?.simple_icon_url != null && <GiftingBadgeIcon icon={currentTier.simple_icon_url} size={iconSize} />}
<View style={styles.content}>
{title != null && <Text variant="text-md/semibold">{title}</Text>}
<GiftingBadgeProgressBar percent={nextTier != null && singleRequirementThreshold > 0 ? Math.min(Math.max(progress / singleRequirementThreshold * 100, 0), 100) : 100} />
<View style={styles.labels}>
{nextTier != null && <Text variant="text-xs/normal" color="text-muted">
{intl.format(GiftingBadge_messages.iIpfQe, {
count: progress,
threshold: singleRequirementThreshold
})}
</Text>}
</View>
</View>
{nextTier?.simple_icon_url != null && <GiftingBadgeIcon icon={nextTier.simple_icon_url} size={iconSize} />}
</View>;
};
@@ -0,0 +1,56 @@
// Metro module 9713 (f9714).
import { View } from "react-native";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import useAnalyticsLocations from "../../../../app_analytics/useAnalyticsLocations";
import useTrackImpression from "../../../../app_analytics/useTrackImpression";
import { ImpressionNames, ImpressionTypes } from "../../../../../_bundle/Module503";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
const useStyles = createStyles({
container: {
flexDirection: "row",
alignItems: "center",
padding: Module712.space.PX_8,
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
borderRadius: Module712.radii.sm,
borderWidth: 1,
borderStyle: "solid",
borderColor: Module712.colors.BORDER_MUTED,
...Module712.shadows.SHADOW_LOW
},
iconContainer: {
alignItems: "center",
justifyContent: "center",
padding: Module712.space.PX_8,
marginInlineEnd: Module712.space.PX_8
}
});
export default function GiftingBadgeProgressBanner(props) {
const { giftsToNextTier, nextTierName, nextTierIcon, analyticsLocation } = props;
const styles = useStyles();
useTrackImpression({
name: ImpressionNames.GIFTING_BADGE_PROGRESS_BANNER,
type: ImpressionTypes.VIEW,
properties: {
gifts_to_next_tier: giftsToNextTier,
next_tier: nextTierName,
location_stack: useAnalyticsLocations.apply(void 0, [...analyticsLocation != null ? [analyticsLocation] : []]).analyticsLocations
}
}, {
trackOnInitialLoad: true
});
return <View style={styles.container}>
<View style={styles.iconContainer}>
{nextTierIcon != null && <GiftingBadgeIcon icon={nextTierIcon} size={24} />}
</View>
<Text variant="text-md/semibold">
{intl.formatToPlainString(GiftingBadge_messages["0+xfd9"], {
giftsRemaining: giftsToNextTier,
nextTier: nextTierName
})}
</Text>
</View>;
};
@@ -0,0 +1,137 @@
// Metro module 15766 (f15767).
import { useCallback } from "react";
import { Image as Image2, View } from "react-native";
import BadgeDirectoryStore from "../../../../badges/BadgeDirectoryStore";
import { ContentDismissActionType } from "../../../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../_bundle/Module712";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { getRootNavigationRef } from "../../../../main_tabs_v2/RootNavigationRef.native";
import { BottomSheet } from "../../../../../design/components/Sheet/native/BottomSheet.native";
import GiftingBadgeIcon from "./GiftingBadgeIcon";
import { Text } from "../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../intl/index.native";
import GiftingBadge_messages from "../../GiftingBadge.messages";
import { Button } from "../../../../../design/components/Button/native/Button.native";
import { openGiftModal } from "../../../native/utils/openGiftModal";
import AnalyticsLocation from "../../../../app_analytics/AnalyticsLocation";
import Module15767 from "../../../../../_bundle/Module15767";
import { GiftIcon } from "../../../../../design/components/Icon/native/redesign/generated/GiftIcon";
import { useStateFromStoresObject } from "../../../../../_bundle/Module589";
import { BadgeId } from "../../../../../_bundle/Module8106";
let useStyles, NewBadgeCoachmark;
const HasBadgeCoachmark = function HasBadgeCoachmark(props) {
const { markAsDismissed, currentTier } = props;
let giftCount = props.giftCount;
const styles = useStyles();
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
markAsDismissed(ContentDismissActionType.TAKE_ACTION);
const rootNavigationRef = getRootNavigationRef();
if (rootNavigationRef != null) {
rootNavigationRef.navigate("you");
}
}, [markAsDismissed]);
const callback2 = useCallback(() => {
markAsDismissed(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed]);
const r44 = [<View style={styles.graphicContainer}>
{currentTier.simple_icon_url != null && <GiftingBadgeIcon icon={currentTier.simple_icon_url} size={120} />}
</View>, , ,];
const r57 = GiftingBadge_messages["a+jfuy"];
let name = currentTier.name;
if (name == null) {
name = "";
}
const r61 = [<Text style={styles.text} variant="heading-xl/bold" color="text-strong">
{intl.format(r57, {
tierName: name
})}
</Text>, ,];
if (giftCount == null) {
giftCount = 0;
}
r61[1] = <Text style={styles.text} variant="text-sm/medium" color="text-default">
{intl.formatToPlainString(GiftingBadge_messages.QxRA6w, {
giftCount
})}
</Text>;
r44[1] = <View style={styles.textContainer}>{r61}</View>;
r44[2] = <View style={styles.footer}>
<Button grow text={intl.string(t.RzWDqY)} onPress={callback} />
</View>;
return <BottomSheet startExpanded onDismiss={callback2}>
<View style={styles.container}>{r44}</View>
</BottomSheet>;
};
NewBadgeCoachmark = function NewBadgeCoachmark(props) {
const markAsDismissed2 = props.markAsDismissed;
const styles = useStyles();
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
markAsDismissed2(ContentDismissActionType.TAKE_ACTION);
openGiftModal({
analyticsLocations: [AnalyticsLocation.GIFTING_BADGE_COACHMARK]
});
}, [markAsDismissed2]);
return <BottomSheet startExpanded onDismiss={useCallback(() => {
markAsDismissed2(ContentDismissActionType.USER_DISMISS);
}, [markAsDismissed2])}>
<View style={styles.container}>
<View style={styles.graphicContainer}>
<Image2 source={{
uri: Module15767
}} style={styles.newBadgeImage} />
</View>
<View style={styles.textContainer}>
<Text style={styles.text} variant="heading-xl/bold" color="mobile-text-heading-primary">
{intl.string(GiftingBadge_messages.Q2RQka)}
</Text>
<Text style={styles.text} variant="text-sm/medium" color="text-muted">
{intl.string(GiftingBadge_messages["3EQnkg"])}
</Text>
</View>
<View style={styles.footer}>
<Button grow text={intl.string(GiftingBadge_messages.DZnomS)} icon={<GiftIcon size="sm" color={Module712.colors.CONTROL_PRIMARY_TEXT_DEFAULT} />} onPress={callback} />
</View>
</View>
</BottomSheet>;
};
useStyles = createStyles({
container: {
alignItems: "center",
paddingHorizontal: 20,
paddingBottom: 20,
gap: Module712.space.PX_24
},
graphicContainer: {
height: 188,
width: 335,
alignItems: "center",
justifyContent: "center",
padding: Module712.space.PX_16
},
newBadgeImage: {
width: "100%",
height: "100%",
objectFit: "contain"
},
textContainer: {
gap: Module712.space.PX_8
},
text: {
textAlign: "center"
},
footer: {
width: "100%"
}
});
export default function GiftingBadgesCoachmarkActionSheet(props) {
const markAsDismissed3 = props.markAsDismissed;
const stateFromStoresObject = useStateFromStoresObject([BadgeDirectoryStore], () => ({
currentTier: BadgeDirectoryStore.getCurrentTier(BadgeId.GIFTING),
giftCount: BadgeDirectoryStore.getSingleRequirementProgress(BadgeId.GIFTING)?.current
}));
const { currentTier, giftCount } = stateFromStoresObject;
return currentTier != null ? <HasBadgeCoachmark markAsDismissed={markAsDismissed3} currentTier={currentTier} giftCount={giftCount} /> : <NewBadgeCoachmark markAsDismissed={markAsDismissed3} />;
};
@@ -0,0 +1,10 @@
// Metro module 9784 (f9785).
import AccessibilityStore from "../../../../a11y/AccessibilityStore";
import UserStore from "../../../../../stores/UserStore";
import { useStateFromStores } from "../../../../../_bundle/Module589";
import { Avatar } from "../../../../../design/void/native";
export default function GiftingRewardPreviewAvatar(props) {
return <Avatar user={useStateFromStores([UserStore], () => UserStore.getCurrentUser())} guildId={void 0} avatarDecoration={props.asset != null ? {
asset: props.asset
} : void 0} animate={!useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion)} {...props} />;
};
@@ -0,0 +1,78 @@
// Metro module 15756 (f15757).
import { useCallback } from "react";
import { View } from "react-native";
import AccessibilityStore from "../../../../../a11y/AccessibilityStore";
import { AnalyticsObjects, AnalyticsPages, AnalyticsSections } from "../../../../../../Constants";
import { ContentDismissActionType } from "../../../../../dismissible_content/DismissibleContentConstants";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../../../_bundle/Module589";
import { useThemeAndReducedMotionAwareAssetUrl } from "../../../../promotions/MarketingComponentHooks";
import useAnalyticsLocations from "../../../../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../../../../app_analytics/AnalyticsLocation";
import ActionSheetActionCreators from "../../../../../action_sheet/native/ActionSheetActionCreators";
import { openGiftModal } from "../../../../native/utils/openGiftModal";
import { BottomSheet } from "../../../../../../design/components/Sheet/native/BottomSheet.native";
import { isAndroid } from "../../../../../../utils/PlatformUtils";
import Module6208 from "../../../../../../_bundle/Module6208";
import FastImage from "../../../../../../components_native/common/FastImage";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { Button } from "../../../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../../../intl/index.native";
const useStyles = createStyles({
container: {
alignItems: "center",
padding: Module712.space.PX_16
},
textContainer: {
gap: Module712.space.PX_8,
paddingHorizontal: Module712.space.PX_16,
paddingVertical: Module712.space.PX_24
},
text: {
textAlign: "center"
},
imageShared: {
height: 188,
width: 335,
borderRadius: Module712.radii.sm
},
imageWrapperAndroid: {
overflow: "hidden"
}
});
export default function GiftingPromotionCoachmarkActionSheet(props) {
let analyticsLocations;
const { coachmarkComponent, markAsDismissed } = props;
analyticsLocations = void 0;
const styles = useStyles();
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const themeAndReducedMotionAwareAssetUrl = useThemeAndReducedMotionAwareAssetUrl(coachmarkComponent?.asset);
analyticsLocations = useAnalyticsLocations(AnalyticsLocation.GIFTING_PROMOTION_COACHMARK).analyticsLocations;
const callback = useCallback(() => {
ActionSheetActionCreators.hideActionSheet();
markAsDismissed(ContentDismissActionType.TAKE_ACTION);
openGiftModal({
analyticsLocation: {
page: AnalyticsPages.PREMUIM_UPSELL_GIFTING_PROMOTION,
section: AnalyticsSections.FOOTER,
object: AnalyticsObjects.BUTTON_CTA
},
analyticsLocations
});
}, [analyticsLocations, markAsDismissed]);
return coachmarkComponent == null ? null : <BottomSheet startExpanded onDismiss={() => markAsDismissed(ContentDismissActionType.USER_DISMISS)}>
<View style={styles.container}>
{themeAndReducedMotionAwareAssetUrl != null && (isAndroid() && !stateFromStores ? <View style={[styles.imageShared, styles.imageWrapperAndroid]}>
<Module6208 url={themeAndReducedMotionAwareAssetUrl} style={styles.imageShared} />
</View> : <FastImage source={{
uri: themeAndReducedMotionAwareAssetUrl
}} style={styles.imageShared} />)}
<View style={styles.textContainer}>
<Text style={styles.text} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{coachmarkComponent.header}</Text>
<Text style={styles.text} variant="text-md/normal" color="text-default">{coachmarkComponent.body}</Text>
</View>
<Button grow text={intl.string(t.RzWDqY)} onPress={callback} />
</View>
</BottomSheet>;
};
@@ -0,0 +1,116 @@
// Metro module 9779 (f9780).
import * as Module19 from "react";
import { useMemo } from "react";
import { View } from "react-native";
import { isAvatarDecorationRecord } from "../../../../../collectibles/records/AvatarDecorationRecord";
import { isNameplateRecord } from "../../../../../collectibles/records/NameplateRecord";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import { useCurrentUser } from "../../../../../collectibles/hooks/useCurrentUser";
import { useRadioA11yNative } from "../../../../../../_bundle/Module3907";
import { useFetchCollectiblesProduct } from "../../../../../collectibles/hooks/useFetchCollectiblesProduct";
import { PressableOpacity } from "../../../../../../design/void/Pressables/native/Pressables";
import NameplateCardPreview from "../../../../../collectibles/nameplates/native/NameplateCardPreview";
import AvatarDecorationSampleV2 from "../../../../../collectibles/native/AvatarDecorationSampleV2";
import { CheckmarkLargeBoldIcon } from "../../../../../../design/components/Icon/native/redesign/generated/CheckmarkLargeBoldIcon";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../../intl/index.native";
let useStyles2;
const useStyles = createStyles({
card: {
height: 178,
width: 150,
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
borderWidth: 1,
borderRadius: Module712.radii.sm,
overflow: "hidden",
borderColor: Module712.colors.BORDER_SUBTLE,
margin: Module712.space.PX_4
},
overlayContainer: {
position: "absolute",
top: 10,
zIndex: 2,
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "75%"
},
selected: {
borderColor: Module712.colors.BACKGROUND_BRAND
},
claimed: {
opacity: 0.4
},
checkmark: {
position: "absolute",
opacity: 1,
fontWeight: "bold"
},
checkmarkContainer: {
position: "absolute",
top: 10,
zIndex: 3,
display: "flex",
justifyContent: "center",
alignItems: "center",
width: "100%",
height: "75%"
},
textContainer: {
position: "absolute",
bottom: 20,
left: 0,
right: 0,
paddingHorizontal: Module712.space.PX_16,
alignItems: "flex-start"
}
});
let Component = Module19.memo(function({ rewardSkuId, claimed, onSelect, isSelected }) {
const styles = useStyles();
const currentUser = useCurrentUser();
const radioA11yNative = useRadioA11yNative({
selected: isSelected
});
const { accessibilityRole, accessibilityState } = radioA11yNative;
const product = useFetchCollectiblesProduct(rewardSkuId).product;
const memo = useMemo(() => isSelected ? currentUser.getAvatarSource(null, true, 100) : void 0, [isSelected, currentUser]);
if (product == null) {
return null;
}
const item = product.items[0];
const style = [styles.card, isSelected ? styles.selected : isSelected];
return <PressableOpacity style={style} onPress={() => onSelect(rewardSkuId)} activeOpacity={0.8} disabled={claimed} accessibilityRole={accessibilityRole} accessibilityState={accessibilityState}>
<View style={[styles.overlayContainer, claimed ? styles.claimed : claimed]}>
{isNameplateRecord(item) ? <NameplateCardPreview item={item} animate={isSelected} /> : isAvatarDecorationRecord(item) ? <AvatarDecorationSampleV2 item={item} size={100} animate={isSelected} avatarSource={memo} /> : void 0}
</View>
{claimed && <View style={styles.checkmarkContainer}>
<CheckmarkLargeBoldIcon size="lg" style={styles.checkmark} />
</View>}
<View style={styles.textContainer}>
<Text variant="heading-sm/bold" color="mobile-text-heading-primary" lineClamp={1} accessibilityRole="header">{product.name}</Text>
<Text variant="text-xs/semibold" color="mobile-text-heading-primary" lineClamp={1}>
{claimed ? intl.string(t["6cfuDj"]) : intl.string(t.QQsaCc)}
</Text>
</View>
</PressableOpacity>;
});
useStyles2 = createStyles({
grid: {
flexDirection: "row",
flexWrap: "wrap",
justifyContent: "center"
}
});
export default function GiftingSKUCardsGrid(props) {
const { rewardsToDisplay, claimableRewards, onSelect: onSelect2, highlightedSkuId } = props;
return <View style={useStyles2().grid}>
{rewardsToDisplay.map((item) => {
return <Component key={item} rewardSkuId={item} claimed={!claimableRewards.some((claimableReward) => claimableReward === item)} isSelected={highlightedSkuId === item} onSelect={onSelect2} />;
})}
</View>;
};
@@ -0,0 +1,88 @@
// Metro module 9778 (f9779).
import { useState, useCallback, useMemo, useEffect } from "react";
import { ScrollView, View } from "react-native";
import { createStyles } from "../../../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../../../_bundle/Module712";
import useSafeAreaInsets_native from "../../../../../safe_area/useSafeAreaInsets.native";
import { Text } from "../../../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../../../intl/index.native";
import GiftingSKUCardsGrid from "./GiftingSKUCardsGrid";
import { Button } from "../../../../../../design/components/Button/native/Button.native";
const useStyles = createStyles({
container: {
flex: 1,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW
},
scroll: {
flex: 1
},
contentContainer: {
display: "flex",
flexDirection: "column",
padding: Module712.space.PX_24
},
header: {
textAlign: "center",
padding: Module712.space.PX_8
},
subtitle: {
textAlign: "center"
},
buttonContainer: {
marginHorizontal: Module712.space.PX_16,
marginBottom: Module712.space.PX_24
},
headerContainer: {
marginBottom: Module712.space.PX_24
}
});
export default function GiftingSKUSelectScreen(props) {
let memo;
const { defaultHighlightedReward, allRewards, claimableRewards, onSelect } = props;
memo = void 0;
const styles = useStyles();
const bottom = useSafeAreaInsets_native().bottom;
const [state, setState] = useState(defaultHighlightedReward);
const [state2, setState2] = useState(false);
const callback = useCallback(() => {
const r5 = claimableRewards.find((claimableReward) => claimableReward === state);
if (r5 != null) {
onSelect(r5);
}
}, [onSelect, state, claimableRewards]);
const callback2 = useCallback((a0) => {
setState(a0);
setState2(true);
}, []);
memo = useMemo(() => state != null && claimableRewards.some((claimableReward) => claimableReward === state), [state, claimableRewards]);
useEffect(() => {
L11: {
if (claimableRewards.length === 0) {
setState(void 0);
} else {
if (memo && claimableRewards.some((claimableReward) => claimableReward === state)) {
break L11;
}
setState((state2 ? !state2 : defaultHighlightedReward != null) && claimableRewards.some((claimableReward) => claimableReward === defaultHighlightedReward) ? defaultHighlightedReward : void 0);
}
}
}, [state, claimableRewards, state2, defaultHighlightedReward, memo]);
return <View style={styles.container}>
<ScrollView style={styles.scroll} contentContainerStyle={styles.contentContainer}>
<View style={styles.headerContainer}>
<Text style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary" accessibilityRole="header">
{intl.string(t["+ByEeM"])}
</Text>
<Text style={styles.subtitle} variant="text-md/medium" color="text-default">
{intl.string(t.vPeaOS)}
</Text>
</View>
<GiftingSKUCardsGrid rewardsToDisplay={allRewards} claimableRewards={claimableRewards} onSelect={callback2} highlightedSkuId={state} />
</ScrollView>
<View style={[styles.buttonContainer, {
paddingBottom: bottom
}]}>
<Button text={intl.string(t["3d0Nmb"])} onPress={callback} disabled={state == null || !memo} />
</View>
</View>;
};
@@ -0,0 +1,59 @@
// Metro module 7854 (f7855).
import { setYear, isSameDay, differenceInDays, differenceInMonths } from "../../../../_bundle/Module3414";
export const FRIEND_ANNIVERSARY_ELIGIBILITY_WINDOW_DAYS = 7;
export function isFriendAnniversary(a0) {
const date = new Date();
const fullYear = date.getFullYear();
for (const item of [-1, 0, 1]) {
const r36 = setYear(a0, fullYear + item);
if (isSameDay(r36, a0)) {
continue;
}
if (!(Math.abs(differenceInDays(date, r36)) <= 7)) {
continue;
}
return true;
}
return false;
}
export function yearsSince(a0) {
return Math.round(differenceInMonths(new Date(), a0) / 12);
}
export function categorizeFriendAnniversariesByAffinity(a0, a1, a2) {
const set = new Set();
let c16043_0 = set;
const set2 = new Set();
let c16043_1 = set2;
if (a2) {
a0.slice(0, Math.ceil(a0.length / 2)).forEach((item) => {
c16043_0.add(item);
});
a0.forEach((item) => {
c16043_1.add(item);
});
} else {
for (const item of a0) {
const r39 = a1(item);
if (r39 != null && r39 > 0.7) {
set.add(item);
}
if (r39 != null && r39 > 0.5) {
set2.add(item);
}
}
}
return {
highestAffinity: set,
highAffinity: set2
};
}
export function pruneTimestampMap(a0, a1, a2) {
const r2 = {};
for (const key in a0) {
const r9 = a0[key];
if (a1 - r9 <= a2) {
r2[key] = r9;
}
}
return r2;
}
@@ -0,0 +1,141 @@
// Metro module 16301 (f16302).
import EphemeralMessageStore from "../../../messages/EphemeralMessageStore";
import UserSettingsProtoStore from "../../../user_settings/UserSettingsProtoStore";
import ChannelStore from "../../../../stores/ChannelStore";
import PremiumGiftingIntentStore from "../PremiumGiftingIntentStore";
import { MessageTypes } from "../../../../Constants";
import Durations from "../../../../utils/Durations";
import AutomaticLifecycleManager from "../../../../lib/AutomaticLifecycleManager";
import Backoff from "../../../../_bundle/Backoff";
import { FriendshipAnniversaryBackendPersistenceExperiment } from "../../experiments/FriendshipAnniversaryBackendPersistenceExperiment";
import { fetchAndReconcileGiftIntentDismissals } from "../PremiumGiftingIntentActionCreators";
import Dispatcher from "../../../../Dispatcher";
import MessageActionCreators from "../../../../actions/MessageActionCreators";
let c11720_8 = 10 * Durations.Millis.SECOND;
let c11720_9 = 5 * Durations.Millis.MINUTE;
class GiftIntentReconcilingManager extends AutomaticLifecycleManager {
actions = {
POST_CONNECTION_OPEN: () => this.onPostConnectionOpen(),
CHANNEL_SELECT: (a0) => this.onChannelSelect(a0),
GIFT_INTENT_DISMISSALS_FETCH_SUCCESS: (a0) => this.onReconcileSuccess(a0),
GIFT_INTENT_DISMISSALS_FETCH_FAILURE: () => this.onReconcileSettled(false),
LOGOUT: () => this.onLogout()
};
stores = new Map([[PremiumGiftingIntentStore, () => this.onPremiumGiftingIntentStoreChange()]]);
reconcileBackoff = new Backoff(c11720_8, c11720_9);
isReconciling = false;
heldGiftingPromptSystemMessage = false;
lastReconciledDismissalAtMs = new Map();
retryReconcileServerDismissals = () => {
if (this.isReconcileEligible("retryReconcileServerDismissals")) {
this.attemptReconcileFetch();
}
};
onPostConnectionOpen() {
this.lastReconciledDismissalAtMs.clear();
this.sendGiftingPromptSystemMessagesIfEligible();
}
onPremiumGiftingIntentStoreChange() {
this.maybeReconcileServerDismissals();
this.maybeRetryHeldGiftingPromptSystemMessage();
}
maybeReconcileServerDismissals() {
if (this.isReconcileEligible("maybeReconcileServerDismissals") && !this.reconcileBackoff.pending) {
this.attemptReconcileFetch();
}
}
isReconcileEligible(a0) {
return PremiumGiftingIntentStore.getFriendAnniversaries().length !== 0 && FriendshipAnniversaryBackendPersistenceExperiment.getConfig({
location: a0
}).enabled;
}
getServerDismissalTimestampMs() {
const r4 = Number;
let r9 = UserSettingsProtoStore.settings.userContent?.lastGiftIntentDismissedAtMs;
if (r9 == null) {
r9 = "0";
}
return r4(r9);
}
attemptReconcileFetch() {
const serverDismissalTimestampMs = this.getServerDismissalTimestampMs();
if (!(PremiumGiftingIntentStore.getLastKnownGiftIntentDismissedAtMs() >= serverDismissalTimestampMs || this.isReconciling)) {
this.isReconciling = true;
fetchAndReconcileGiftIntentDismissals(serverDismissalTimestampMs);
}
}
onReconcileSuccess(a0) {
this.onReconcileSettled(true);
this.removeRemotelyDismissedGiftIntentCards(a0.dismissals);
}
onReconcileSettled(a0) {
this.isReconciling = false;
const reconcileBackoff = this.reconcileBackoff;
if (a0) {
reconcileBackoff.succeed();
} else {
reconcileBackoff.fail(this.retryReconcileServerDismissals);
}
}
removeRemotelyDismissedGiftIntentCards(a0) {
for (const item of a0) {
const { targetId, dismissedAtMs } = item;
const r39 = this.lastReconciledDismissalAtMs.get(targetId);
const lastReconciledDismissalAtMs = this.lastReconciledDismissalAtMs;
const r19 = Math;
let r17 = r39;
if (r17 == null) {
r17 = 0;
}
lastReconciledDismissalAtMs.set(targetId, r19.max(r17, dismissedAtMs));
if (r39 != null && !(dismissedAtMs <= r39)) {
const dMFromUserId = ChannelStore.getDMFromUserId(targetId);
const channelId = dMFromUserId;
if (dMFromUserId != null) {
for (const item2 of EphemeralMessageStore.getMessages(channelId)) {
if (item2.type === MessageTypes.GIFTING_PROMPT && item2.giftingPrompt?.recipientUserId === targetId) {
Dispatcher.dispatch({
type: "MESSAGE_DELETE",
id: item2.id,
channelId
});
}
}
}
}
}
}
onLogout() {
this.reconcileBackoff.cancel();
this.isReconciling = false;
this.heldGiftingPromptSystemMessage = false;
this.lastReconciledDismissalAtMs.clear();
}
maybeRetryHeldGiftingPromptSystemMessage() {
if (this.heldGiftingPromptSystemMessage && !(PremiumGiftingIntentStore.getLastKnownGiftIntentDismissedAtMs() < this.getServerDismissalTimestampMs())) {
this.heldGiftingPromptSystemMessage = false;
this.sendGiftingPromptSystemMessagesIfEligible();
}
}
shouldHoldGiftingPromptSystemMessageForServerReconcile(a0) {
return !!FriendshipAnniversaryBackendPersistenceExperiment.getConfig({
location: a0
}).enabled && PremiumGiftingIntentStore.getLastKnownGiftIntentDismissedAtMs() < this.getServerDismissalTimestampMs();
}
trySendGiftingPromptSystemMessage(a0, a1, a2, a3, a4) {
let r18;
if (this.shouldHoldGiftingPromptSystemMessageForServerReconcile(a4)) {
this.heldGiftingPromptSystemMessage = true;
r18 = false;
} else {
MessageActionCreators.sendGiftingPromptSystemMessage(a0, {
giftIntentType: a1,
recipientUserId: a2,
giftIntentSecondaryAction: a3
});
r18 = true;
}
return r18;
}
}
export default GiftIntentReconcilingManager;
@@ -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;
}