decord/source/modules/premium/powerups/hooks/useGuildPowerupsNotifications.tsx

651 lines
26 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11709
// Function ID: 11710
2026-07-29 08:29:29 +00:00
// Name: maybeGetPerkPurchaseablePopoutDCF
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 4286, 1910, 11710, 4265, 4266, 676, 1388, 4270, 11712, 11713, 4269, 11714, 1370, 1377, 4289, 4285, 11715, 1379, 647, 11711, 11719, 4308, 4307, 11721, 11722, 11723, 11724, 11726, 11727, 11728, 11706, 2]
2026-07-29 08:29:29 +00:00
// Exports: default, maybeGetGameServerHostingGuildEligiblePopoutDCF, maybeGetLevelUnlockedPopoutDCF, useAutoDismissGuildPowerupsNotifications
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 11709 (maybeGetPerkPurchaseablePopoutDCF)
import useGuildAppliedBoostCountDefault from "useGuildAppliedBoostCount" /* 4285 */;
import useGuildPowerupRollbackNotificationConfigDefault from "useGuildPowerupRollbackNotificationConfig" /* 11715 */;
import useGuildPowerupNewPerkMarketingVersionDefault from "useGuildPowerupNewPerkMarketingVersion" /* 11721 */;
import itemsDefault from "items" /* 11722 */;
import useCanPurchaseBoostsDefault from "useCanPurchaseBoosts" /* 11723 */;
import useFeaturedExpiringPowerupDefault from "useFeaturedExpiringPowerup" /* 11724 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import closure_5 from "handleGameServerInstanceCreated" /* 4286 */;
import closure_6 from "createGuildRecordFromRust" /* 1910 */;
import closure_7 from "getState" /* 11710 */;
import closure_8 from "calculateAppliedBoosts" /* 4265 */;
import BoostedGuildTiers from "BoostedGuildTiers" /* 4266 */;
import ME from "ME" /* 676 */;
import { ContentDismissActionType } from "ContentDismissActionType" /* 1388 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
function maybeGetPerkPurchaseablePopoutDCF(closure_1) {
const _require = closure_1;
closure_1 = arg1;
2026-08-24 06:08:38 +00:00
dependencyMap = arg2;
closure_3 = arg3;
2026-07-29 08:29:29 +00:00
guild = guild.getGuild(closure_1);
2026-07-20 16:05:17 +00:00
let premiumTier;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
premiumTier = guild.premiumTier;
}
2026-07-29 08:29:29 +00:00
if (premiumTier == null) {
2026-07-20 16:05:17 +00:00
premiumTier = constants.NONE;
}
const arr = Array.from(closure_12.values());
const found = Array.from(closure_12.values()).flatMap((arr) => {
if (arr.length > 0) {
if (!arr.some((arg0) => {
2026-07-29 08:29:29 +00:00
if (null != closure_1.unlockedPowerups[arg0]) {
2026-07-20 16:05:17 +00:00
return true;
} else {
let tmp3 = null != tmp2;
if (tmp3) {
2026-08-24 06:08:38 +00:00
tmp3 = closure_4 >= tmp2;
2026-07-20 16:05:17 +00:00
}
return tmp3;
}
})) {
const mapped = arr.map((arg0) => {
2026-08-24 06:08:38 +00:00
if (arg0 === closure_1_0(closure_1_2[12]).GUILD_POWERUP_GUILD_THEME_SKU_ID) {
if (!closure_3) {
2026-07-20 16:05:17 +00:00
return null;
}
}
2026-07-29 08:29:29 +00:00
let tmp6 = null;
if (null != closure_1.allPowerups[arg0]) {
tmp6 = null;
if (closure_2 >= tmp5.cost) {
const dependencies = tmp5.dependencies;
let tmp8 = null;
if (dependencies.every((arg0) => null != unlockedPowerups.unlockedPowerups[arg0])) {
2026-07-20 16:05:17 +00:00
let tmp10 = null;
2026-07-29 08:29:29 +00:00
if (!tmpResult.isGuildPowerupRollbackEnabled(closure_0, tmp5, "maybeGetPerkPurchaseablePopoutDCF")) {
tmp10 = tmp5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp8 = tmp10;
2026-08-24 06:08:38 +00:00
tmpResult = closure_1_0(closure_1_2[13]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp6 = tmp8;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
});
}
return [];
}
2026-08-11 06:20:06 +00:00
}).filter(_require(1370).isNotNullish);
2026-07-20 16:05:17 +00:00
if (0 !== found.length) {
if (1 === found.length) {
2026-08-24 06:08:38 +00:00
let tmp4Result = tmp4(11712);
2026-08-11 06:20:06 +00:00
if (!tmp4Result.isContentDismissed(tmp4(1377).DismissibleGuildContent.GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK, closure_1)) {
2026-07-29 08:29:29 +00:00
let obj = { type: null, powerups: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp4(11713).GuildPowerupNotificationPopoutType.PERKS_PURCHASABLE;
2026-07-29 08:29:29 +00:00
obj[1] = found;
obj[2] = function markAsDismissed(AUTO_DISMISS) {
2026-08-24 06:08:38 +00:00
const result = callback(11712).markContentAsDismissed(callback(1377).DismissibleGuildContent.GUILD_POWERUP_SINGLE_SKU_PURCHASE_COACHMARK, callback, true, AUTO_DISMISS);
2026-07-20 16:05:17 +00:00
};
}
return obj;
}
2026-07-29 08:29:29 +00:00
let tmp6;
2026-07-20 16:05:17 +00:00
if (found.length > 1) {
2026-08-24 06:08:38 +00:00
tmp4Result = tmp4(11712);
2026-08-11 06:20:06 +00:00
if (!tmp4Result.isContentDismissed(tmp4(1377).DismissibleGuildContent.GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK, closure_1)) {
2026-07-29 08:29:29 +00:00
obj = { type: null, powerups: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp4(11713).GuildPowerupNotificationPopoutType.PERKS_PURCHASABLE;
2026-07-29 08:29:29 +00:00
obj[1] = found;
obj[2] = function markAsDismissed(AUTO_DISMISS) {
2026-08-24 06:08:38 +00:00
const result = callback(11712).markContentAsDismissed(callback(1377).DismissibleGuildContent.GUILD_POWERUP_CHOICE_SKU_PURCHASE_COACHMARK, callback, true, AUTO_DISMISS);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
tmp6 = obj;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = tmp6;
2026-07-20 16:05:17 +00:00
}
}
function useGuildPowerupsNotificationIndicator(arg0, arg1, lastBoostCount) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
importDefault = arg1;
dependencyMap = lastBoostCount;
const available = useGuildAppliedBoostCountDefault(arg0).available;
const tmp2 = useGuildPowerupRollbackNotificationConfigDefault(arg0, "useGuildPowerupsNotificationIndicator");
2026-07-20 16:05:17 +00:00
let dismissibleContent = null;
2026-07-29 08:29:29 +00:00
if (null != tmp2) {
dismissibleContent = tmp2.dismissibleContent;
2026-07-20 16:05:17 +00:00
}
2026-08-11 06:20:06 +00:00
const tmp5 = null != tmp2 && !_require(1379).useIsSingleUseGuildDismissibleContentDismissed(dismissibleContent, arg0);
2026-07-29 08:29:29 +00:00
const React = tmp5;
2026-08-11 06:20:06 +00:00
let obj = _require(1379);
2026-07-29 08:29:29 +00:00
const tmp3 = _require;
2026-07-30 10:14:41 +00:00
let items = [stateFromStores];
stateFromStores = _require(647).useStateFromStores(items, () => stateFromStores.getStateForGuild(closure_0));
2026-07-20 16:05:17 +00:00
const items1 = [available, , , , , ];
lastBoostCount = undefined;
2026-07-29 08:29:29 +00:00
if (lastBoostCount != null) {
2026-07-20 16:05:17 +00:00
lastBoostCount = lastBoostCount.lastBoostCount;
}
items1[1] = lastBoostCount;
let prop;
2026-07-29 08:29:29 +00:00
if (lastBoostCount != null) {
2026-07-20 16:05:17 +00:00
prop = lastBoostCount.lastSeenWarningNotification;
}
items1[2] = prop;
items1[3] = arg1;
2026-07-29 08:29:29 +00:00
items1[4] = tmp5;
2026-07-20 16:05:17 +00:00
let entitlements;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
entitlements = stateFromStores.entitlements;
}
items1[5] = entitlements;
2026-07-23 10:11:24 +00:00
return React.useMemo(() => {
2026-07-29 08:29:29 +00:00
if (null == closure_1) {
2026-08-12 06:57:52 +00:00
return { indicator: "ct", showUnread: true };
2026-07-20 16:05:17 +00:00
} else {
const _Object = Object;
const items = [];
2026-07-29 08:29:29 +00:00
let arraySpreadResult = HermesBuiltin.arraySpread(Object.values(tmp.unlockedPowerups), 0);
2026-07-20 16:05:17 +00:00
let entitlements;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
entitlements = stateFromStores.entitlements;
}
2026-07-29 08:29:29 +00:00
if (entitlements == null) {
2026-07-20 16:05:17 +00:00
entitlements = {};
}
arraySpreadResult = HermesBuiltin.arraySpread(Object.values(entitlements), arraySpreadResult);
2026-07-23 10:11:24 +00:00
const expiringGuildEntitlements = callback(lastBoostCount[21]).getExpiringGuildEntitlements(items);
2026-07-20 16:05:17 +00:00
let prop;
2026-07-29 08:29:29 +00:00
if (lastBoostCount != null) {
prop = tmp5.lastSeenWarningNotification;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (prop == null) {
2026-07-20 16:05:17 +00:00
const _Date = Date;
prop = Date.now();
}
let ends_at;
2026-07-29 08:29:29 +00:00
if (expiringGuildEntitlements[expiringGuildEntitlements.length - 1] != null) {
ends_at = tmp7.ends_at;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const date = new Date(ends_at);
let num2;
const time = date.getTime();
if (lastBoostCount != null) {
num2 = tmp5.lastBoostCount;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num2 == null) {
num2 = 0;
2026-07-20 16:05:17 +00:00
}
const diff = available - num2;
2026-07-29 08:29:29 +00:00
if (!tmp14) {
2026-08-24 06:08:38 +00:00
if (!closure_4) {
2026-07-29 08:29:29 +00:00
if (tmp15 !== num2) {
2026-07-20 16:05:17 +00:00
if (diff > 0) {
2026-07-29 08:29:29 +00:00
let obj = { indicator: null, showUnread: true };
obj = { type: null, count: null };
obj[0] = tmp18(tmp19[11]).GuildPowerupNotificationIndicatorType.UNREAD;
obj[1] = diff;
obj[0] = obj;
2026-08-24 06:08:38 +00:00
obj1 = obj;
2026-07-20 16:05:17 +00:00
}
}
2026-08-12 06:57:52 +00:00
obj1 = { indicator: "ct", showUnread: true };
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return obj1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj2 = { indicator: null, showUnread: true };
const obj3 = { type: null };
obj3[0] = callback(lastBoostCount[11]).GuildPowerupNotificationIndicatorType.WARNING;
obj2[0] = obj3;
obj1 = obj2;
const obj8 = callback(lastBoostCount[21]);
tmp14 = expiringGuildEntitlements.length > 0 && prop < time;
2026-07-20 16:05:17 +00:00
}
}, items1);
}
2026-07-29 08:29:29 +00:00
function useGuildPowerupsChannelListPopout(c0) {
const _require = c0;
2026-08-24 06:08:38 +00:00
importDefault = arg1;
let tmp4 = callback(_require(11719).usePerksCoachmarkDCF(null != arg1), 2);
dependencyMap = tmp5;
2026-08-11 06:20:06 +00:00
const tmp6 = tmp4[0] === _require(1377).DismissibleContent.GUILD_POWERUP_PERKS_COACHMARK;
2026-07-29 08:29:29 +00:00
callback = tmp6;
2026-08-24 06:08:38 +00:00
const available = useGuildAppliedBoostCountDefault(c0).available;
let obj = _require(11719);
2026-07-30 10:14:41 +00:00
const items = [stateFromStores1];
const stateFromStores = _require(647).useStateFromStores(items, () => {
const guild = stateFromStores1.getGuild(closure_0);
2026-07-29 08:29:29 +00:00
let flag;
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
2026-08-24 06:08:38 +00:00
flag = features.has(constants2.GAME_SERVERS);
2026-07-29 08:29:29 +00:00
}
if (flag == null) {
flag = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return flag;
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
let obj2 = _require(647);
2026-07-30 10:14:41 +00:00
const items1 = [stateFromStores];
stateFromStores1 = _require(647).useStateFromStores(items1, () => stateFromStores.getLowestGameCostForGuild(closure_0));
2026-07-29 08:29:29 +00:00
let obj3 = _require(647);
2026-08-24 06:08:38 +00:00
let serverThemeEnabled = _require(4308).useServerThemeEnabled(c0, "useGuildPowerupsChannelListPopout");
let obj4 = _require(4308);
2026-07-20 16:05:17 +00:00
if (serverThemeEnabled) {
serverThemeEnabled = obj5.useServerThemeUserEnabled("useGuildPowerupsChannelListPopout");
}
2026-08-24 06:08:38 +00:00
let tmp11 = useGuildPowerupNewPerkMarketingVersionDefault(c0, arg1);
closure_8 = tmp11;
let tmpResult = tmp(11719);
2026-07-29 08:29:29 +00:00
let tmp12 = null != arg1;
if (tmp12) {
tmp12 = !tmp6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp3Result = tmp3(tmpResult.useNewPerkAvailableCoachmarkDCF(tmp12, tmp11), 2);
2026-08-24 06:08:38 +00:00
closure_9 = tmp14;
2026-08-11 06:20:06 +00:00
const tmp15 = tmp3Result[0] === _require(1377).DismissibleContent.GUILD_POWERUP_NEW_PERK_AVAILABLE_COACHMARK;
2026-08-24 06:08:38 +00:00
closure_10 = tmp15;
let tmp16 = itemsDefault(c0);
closure_11 = tmp16;
obj5 = _require(4307);
tmpResult = tmp(11719);
2026-07-29 08:29:29 +00:00
let tmp18 = null != arg1;
if (tmp18) {
tmp18 = !tmp6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp18) {
tmp18 = !tmp15;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp18) {
tmp18 = null != tmp16;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp18) {
tmp18 = tmp17;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp3Result = tmp3(tmpResult.useBoostToUnlockCoachmarkDCF(tmp18, c0), 2);
2026-08-24 06:08:38 +00:00
closure_12 = tmp20;
2026-08-11 06:20:06 +00:00
let tmp21 = tmp3Result[0] === _require(1377).DismissibleContent.BOOST_TO_UNLOCK_COACHMARK;
2026-08-24 06:08:38 +00:00
closure_13 = tmp21;
const tmp22 = useFeaturedExpiringPowerupDefault(c0);
closure_14 = tmp22;
tmp17 = useCanPurchaseBoostsDefault();
2026-07-29 08:29:29 +00:00
let tmp23 = null != arg1;
if (tmp23) {
tmp23 = !tmp6;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp23) {
tmp23 = !tmp15;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp23) {
tmp23 = !tmp21;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp23) {
tmp23 = null != tmp22;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp3Result1 = callback(_require(11719).useExpiringPowerupCoachmarkDCF(tmp23, c0), 2);
closure_15 = tmp25;
2026-08-11 06:20:06 +00:00
let tmp26 = tmp3Result1[0] === _require(1377).DismissibleContent.EXPIRING_POWERUP_COACHMARK;
2026-08-24 06:08:38 +00:00
closure_16 = tmp26;
const tmpResult1 = _require(11719);
const gameServerEnabled = _require(4289).getGameServerEnabled(c0, "useGuildPowerupsChannelListPopout");
const tmpResult2 = _require(4289);
const isNewGamesCoachmarkEnabled = _require(11726).useIsNewGamesCoachmarkEnabled("useGuildPowerupsChannelListPopout");
const tmpResult3 = _require(11726);
2026-07-29 08:29:29 +00:00
let tmp29 = null != arg1;
if (tmp29) {
tmp29 = gameServerEnabled;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp29) {
tmp29 = isNewGamesCoachmarkEnabled;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp3Result2 = callback(_require(11719).useNewGamesCoachmarkDC(tmp29), 2);
closure_17 = tmp31;
2026-08-11 06:20:06 +00:00
const tmp32 = tmp3Result2[0] === _require(1377).DismissibleContent.GAME_SERVER_NEW_GAMES_COACHMARK;
2026-08-24 06:08:38 +00:00
closure_18 = tmp32;
const tmpResult4 = _require(11719);
const isGameServerPricingEnabled = _require(11727).useIsGameServerPricingEnabled(c0, "useGuildPowerupsChannelListPopout");
const tmpResult5 = _require(11727);
2026-07-29 08:29:29 +00:00
let tmp34 = null != arg1;
if (tmp34) {
tmp34 = !stateFromStores;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp34) {
tmp34 = gameServerEnabled;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp34) {
tmp34 = isGameServerPricingEnabled;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp3Result3 = callback(_require(11719).useGameServerPricingCoachmarkDCF(tmp34), 2);
closure_19 = tmp36;
2026-08-11 06:20:06 +00:00
const tmp37 = tmp3Result3[0] === _require(1377).DismissibleContent.GAME_SERVER_PRICING_CHANGE_COACHMARK;
2026-08-24 06:08:38 +00:00
closure_20 = tmp37;
2026-07-29 08:29:29 +00:00
const items2 = [c0, arg1, tmp6, tmp15, tmp32, tmp37, tmp21, tmp26, available, stateFromStores, stateFromStores1, serverThemeEnabled];
2026-07-23 10:11:24 +00:00
const memo = available.useMemo(() => {
if (null != closure_1) {
2026-08-24 06:08:38 +00:00
if (!closure_3) {
if (!table2) {
2026-07-23 10:11:24 +00:00
if (!closure_18) {
2026-07-29 08:29:29 +00:00
if (!closure_20) {
2026-07-23 10:11:24 +00:00
if (!closure_13) {
if (!closure_16) {
2026-07-29 08:29:29 +00:00
closure_1 = tmp;
2026-08-24 06:08:38 +00:00
const ReverseOrderedTiers = c0(4270).ReverseOrderedTiers;
2026-07-29 08:29:29 +00:00
const found = ReverseOrderedTiers.find((arg0) => {
let tmp2;
2026-08-24 06:08:38 +00:00
if (null != closure_1_9[arg0]) {
tmp2 = unlockedPowerups.unlockedPowerups[tmp];
2026-07-29 08:29:29 +00:00
}
let tmp4 = null != tmp2;
if (tmp4) {
2026-08-24 06:08:38 +00:00
tmp4 = tmp2.user_id !== closure_1_11;
2026-07-29 08:29:29 +00:00
}
return tmp4;
});
let tmp11;
if (null != found) {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp13;
if (null != table2[found]) {
let tmp8Result = tmp8(11712);
2026-07-29 08:29:29 +00:00
if (!tmp8Result.isContentDismissed(tmp13, tmp7)) {
let tmp16;
2026-08-24 06:08:38 +00:00
if (null != table[found]) {
2026-07-29 08:29:29 +00:00
tmp16 = tmp.allPowerups[tmp15];
}
if (null != tmp16) {
let obj = { type: null, powerup: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp8(11713).GuildPowerupNotificationPopoutType.LEVEL_REACHED;
2026-07-29 08:29:29 +00:00
obj[1] = tmp16;
obj[2] = function markAsDismissed(AUTO_DISMISS) {
2026-08-24 06:08:38 +00:00
const result = callback(11712).markContentAsDismissed(dependencyMap, callback, true, AUTO_DISMISS);
2026-07-29 08:29:29 +00:00
};
tmp11 = obj;
}
}
}
}
if (null != tmp11) {
return tmp11;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
const tmp26 = callback(tmp7, tmp, available, serverThemeEnabled);
2026-07-29 08:29:29 +00:00
if (null != tmp26) {
return tmp26;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
c0 = tmp7;
2026-08-24 06:08:38 +00:00
tmp8Result = tmp8(4289);
2026-07-29 08:29:29 +00:00
let tmp17;
if (tmp8Result.getGameServerEnabled(tmp7, "maybeGetGameServerHostingGuildEligiblePopoutDCF")) {
if (!stateFromStores) {
if (null != tmp28) {
if (tmp21 >= tmp28) {
2026-08-24 06:08:38 +00:00
if (!tmp8Result1.isContentDismissed(tmp8(1377).DismissibleGuildContent.GAME_SERVER_HOSTING_GUILD_ELIGIBLE_COACHMARK, tmp7)) {
2026-07-29 08:29:29 +00:00
obj = { type: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp8(11713).GuildPowerupNotificationPopoutType.GAME_SERVER_HOSTING_GUILD_ELIGIBLE;
2026-07-29 08:29:29 +00:00
obj[1] = function markAsDismissed(AUTO_DISMISS) {
2026-08-24 06:08:38 +00:00
const result = callback(11712).markContentAsDismissed(callback(1377).DismissibleGuildContent.GAME_SERVER_HOSTING_GUILD_ELIGIBLE_COACHMARK, callback, true, AUTO_DISMISS);
2026-07-29 08:29:29 +00:00
};
tmp17 = obj;
}
2026-08-24 06:08:38 +00:00
tmp8Result1 = tmp8(11712);
2026-07-29 08:29:29 +00:00
}
}
}
}
let tmp18;
if (null != tmp17) {
tmp18 = tmp17;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp18;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp21 = available;
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
}
}, items2);
2026-08-24 06:08:38 +00:00
const tmpResult6 = _require(11719);
const tmp3Result4 = callback(_require(11719).useGuildPowerupNotificationDCF(null != memo), 2);
2026-07-29 08:29:29 +00:00
const first = tmp3Result4[0];
2026-08-24 06:08:38 +00:00
closure_23 = tmp41;
2026-07-29 08:29:29 +00:00
const items3 = [arg1, tmp6, tmp4[1], memo, first, tmp3Result4[1], tmp15, tmp3Result[1], tmp11, tmp21, tmp16, tmp3Result[1], tmp26, tmp22, tmp3Result1[1], tmp32, tmp3Result2[1], tmp37, tmp3Result3[1]];
2026-07-23 10:11:24 +00:00
return available.useMemo(() => {
2026-07-29 08:29:29 +00:00
if (null != closure_1) {
2026-08-24 06:08:38 +00:00
if (closure_3) {
2026-07-29 08:29:29 +00:00
let obj = { type: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = c0(11713).GuildPowerupNotificationPopoutType.PERKS_AVAILABLE;
obj[1] = dependencyMap;
2026-07-20 16:05:17 +00:00
return obj;
2026-07-23 10:11:24 +00:00
} else if (closure_10) {
2026-08-24 06:08:38 +00:00
if (closure_8 === constants.GAME_SERVER_HOSTING) {
2026-07-29 08:29:29 +00:00
obj = { type: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = c0(11713).GuildPowerupNotificationPopoutType.GAME_SERVER_HOSTING_AVAILABLE;
2026-07-29 08:29:29 +00:00
obj[1] = closure_9;
2026-07-20 16:05:17 +00:00
return obj;
} else {
2026-08-24 06:08:38 +00:00
c0 = table3[tmp30];
2026-07-20 16:05:17 +00:00
const _Object = Object;
2026-07-29 08:29:29 +00:00
const values = Object.values(tmp.allPowerups);
2026-07-20 16:05:17 +00:00
const found = values.filter((skuId) => set.has(skuId.skuId));
if (0 !== found.length) {
2026-08-24 06:08:38 +00:00
obj1 = { powerups: null, type: null, markAsDismissed: null };
2026-07-29 08:29:29 +00:00
obj1[0] = found;
2026-08-24 06:08:38 +00:00
obj1[1] = c0(11713).GuildPowerupNotificationPopoutType.NEW_PERK_AVAILABLE;
2026-07-29 08:29:29 +00:00
obj1[2] = closure_9;
2026-07-20 16:05:17 +00:00
return obj1;
}
}
} else {
2026-08-24 06:08:38 +00:00
if (constants) {
2026-07-23 10:11:24 +00:00
if (null != closure_11) {
2026-07-29 08:29:29 +00:00
const obj2 = { type: null, powerup: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj2[0] = c0(11713).GuildPowerupNotificationPopoutType.BOOST_TO_UNLOCK;
2026-07-29 08:29:29 +00:00
obj2[1] = tmp5;
obj2[2] = closure_12;
let tmp13 = obj2;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp13;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (closure_16) {
2026-08-24 06:08:38 +00:00
if (null != table3) {
2026-07-29 08:29:29 +00:00
const obj3 = { type: null, featuredExpiringPowerup: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj3[0] = c0(11713).GuildPowerupNotificationPopoutType.EXPIRING_PERK;
2026-07-29 08:29:29 +00:00
obj3[1] = tmp7;
obj3[2] = closure_15;
tmp13 = obj3;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
if (closure_18) {
2026-07-29 08:29:29 +00:00
const obj4 = { type: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj4[0] = c0(11713).GuildPowerupNotificationPopoutType.GAME_SERVER_NEW_GAMES;
2026-07-29 08:29:29 +00:00
obj4[1] = closure_17;
tmp13 = obj4;
2026-07-23 10:11:24 +00:00
} else if (closure_20) {
2026-07-29 08:29:29 +00:00
const obj5 = { type: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj5[0] = c0(11713).GuildPowerupNotificationPopoutType.GAME_SERVER_PRICING_CHANGE;
2026-07-29 08:29:29 +00:00
obj5[1] = closure_19;
tmp13 = obj5;
2026-08-24 06:08:38 +00:00
} else if (first === c0(1377).DismissibleContent.GUILD_POWERUP_NOTIFICATION) {
2026-07-20 16:05:17 +00:00
if (null != memo) {
obj = {};
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp14);
obj.markAsDismissed = function markAsDismissed(arg0) {
callback(arg0);
closure_21.markAsDismissed(arg0);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
tmp13 = obj;
2026-07-20 16:05:17 +00:00
}
}
}
}
}, items3);
}
2026-07-29 08:29:29 +00:00
({ BOOSTING_TIER_TO_LEVEL_SKU_ID: c9, BOOSTING_TIER_TO_LEVEL_UNLOCKED_DC: c10, GUILD_POWERUP_MIGRATION_USER_ID: unpackModuleId, GUILD_POWERUP_NEW_PERK_GROUPS: closure_12, GuildPowerupNewPerkMarketingVersion: map1, NEW_PERK_MARKETING_VERSION_TO_POWERUP_SKU_ID_SET: closure_14, POWERUPS_INCLUDED_IN_LEVEL: closure_15 } = BoostedGuildTiers);
({ BoostedGuildTiers: closure_16, GuildFeatures: closure_17 } = ME);
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/premium/powerups/hooks/useGuildPowerupsNotifications.tsx");
2026-07-29 08:29:29 +00:00
export default function useGuildPowerupsNotifications(arg0) {
const _require = arg0;
let obj = _require(647);
2026-08-24 06:08:38 +00:00
const items = [closure_7];
2026-07-29 08:29:29 +00:00
const items1 = [arg0];
2026-08-24 06:08:38 +00:00
const stateFromStores = obj.useStateFromStores(items, () => closure_1_7.getNotificationStateForGuild(closure_0), items1);
const items2 = [closure_8];
const stateFromStores1 = _require(647).useStateFromStores(items2, () => closure_1_8.getStateForGuild(closure_0));
2026-07-29 08:29:29 +00:00
const obj2 = _require(647);
2026-07-20 16:05:17 +00:00
const tmp3 = useGuildPowerupsNotificationIndicator;
2026-07-29 08:29:29 +00:00
const tmp4 = stateFromStores1;
({ indicator, showUnread } = useGuildPowerupsNotificationIndicator(arg0, stateFromStores1, stateFromStores));
const tmp6Result = useGuildPowerupsChannelListPopout(arg0, stateFromStores1);
2026-07-20 16:05:17 +00:00
if (null !== stateFromStores1) {
2026-07-29 08:29:29 +00:00
obj = { indicator: null, showUnread: null, popout: null };
obj[0] = indicator;
obj[1] = showUnread;
obj[2] = tmp6Result;
2026-07-20 16:05:17 +00:00
return obj;
}
2026-07-29 08:29:29 +00:00
};
export const maybeGetLevelUnlockedPopoutDCF = function maybeGetLevelUnlockedPopoutDCF(closure_1) {
const _require = closure_1;
closure_1 = arg1;
2026-08-24 06:08:38 +00:00
const ReverseOrderedTiers = _require(4270).ReverseOrderedTiers;
2026-07-29 08:29:29 +00:00
const found = ReverseOrderedTiers.find((arg0) => {
let tmp2;
2026-08-24 06:08:38 +00:00
if (null != closure_1_9[arg0]) {
tmp2 = unlockedPowerups.unlockedPowerups[tmp];
2026-07-29 08:29:29 +00:00
}
let tmp4 = null != tmp2;
if (tmp4) {
2026-08-24 06:08:38 +00:00
tmp4 = tmp2.user_id !== closure_1_11;
2026-07-29 08:29:29 +00:00
}
return tmp4;
});
if (null != found) {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp8;
2026-07-29 08:29:29 +00:00
if (null != table2[found]) {
if (!tmpResult.isContentDismissed(tmp8, closure_1)) {
let tmp6;
if (null != table[found]) {
tmp6 = arg1.allPowerups[tmp5];
}
if (null != tmp6) {
const obj = { type: null, powerup: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp(11713).GuildPowerupNotificationPopoutType.LEVEL_REACHED;
2026-07-29 08:29:29 +00:00
obj[1] = tmp6;
obj[2] = function markAsDismissed(AUTO_DISMISS) {
2026-08-24 06:08:38 +00:00
const result = callback(11712).markContentAsDismissed(dependencyMap, callback, true, AUTO_DISMISS);
2026-07-29 08:29:29 +00:00
};
return obj;
}
}
2026-08-24 06:08:38 +00:00
tmpResult = tmp(11712);
2026-07-29 08:29:29 +00:00
}
}
};
2026-07-20 16:05:17 +00:00
export { maybeGetPerkPurchaseablePopoutDCF };
2026-07-29 08:29:29 +00:00
export const maybeGetGameServerHostingGuildEligiblePopoutDCF = function maybeGetGameServerHostingGuildEligiblePopoutDCF(c0) {
const _require = c0;
2026-08-24 06:08:38 +00:00
let obj = _require(4289);
2026-07-29 08:29:29 +00:00
if (obj.getGameServerEnabled(c0, "maybeGetGameServerHostingGuildEligiblePopoutDCF")) {
if (!arg1) {
if (null != arg3) {
if (arg2 >= arg3) {
2026-08-11 06:20:06 +00:00
if (!tmpResult.isContentDismissed(tmp(1377).DismissibleGuildContent.GAME_SERVER_HOSTING_GUILD_ELIGIBLE_COACHMARK, c0)) {
2026-07-29 08:29:29 +00:00
obj = { type: null, markAsDismissed: null };
2026-08-24 06:08:38 +00:00
obj[0] = tmp(11713).GuildPowerupNotificationPopoutType.GAME_SERVER_HOSTING_GUILD_ELIGIBLE;
2026-07-29 08:29:29 +00:00
obj[1] = function markAsDismissed(AUTO_DISMISS) {
2026-08-24 06:08:38 +00:00
const result = callback(11712).markContentAsDismissed(callback(1377).DismissibleGuildContent.GAME_SERVER_HOSTING_GUILD_ELIGIBLE_COACHMARK, callback, true, AUTO_DISMISS);
2026-07-29 08:29:29 +00:00
};
return obj;
}
2026-08-24 06:08:38 +00:00
tmpResult = tmp(11712);
2026-07-29 08:29:29 +00:00
}
}
}
}
};
2026-07-20 16:05:17 +00:00
export { useGuildPowerupsNotificationIndicator };
export { useGuildPowerupsChannelListPopout };
export const useAutoDismissGuildPowerupsNotifications = function useAutoDismissGuildPowerupsNotifications(guildId) {
2026-07-29 08:29:29 +00:00
let _require = guildId;
2026-08-24 06:08:38 +00:00
obj = _require(obj[20]);
let items = [closure_8];
const stateFromStores = obj.useStateFromStores(items, () => closure_1_8.getStateForGuild(closure_0));
2026-07-29 08:29:29 +00:00
_require = guildId;
2026-08-24 06:08:38 +00:00
const items1 = [closure_7];
2026-07-29 08:29:29 +00:00
const items2 = [guildId];
2026-08-24 06:08:38 +00:00
const stateFromStores1 = _require(obj[20]).useStateFromStores(items1, () => closure_1_7.getNotificationStateForGuild(closure_0), items2);
const obj2 = _require(obj[20]);
2026-07-29 08:29:29 +00:00
const tmp = _require;
2026-08-24 06:08:38 +00:00
const tmp2 = obj;
const items3 = [closure_8];
const stateFromStores2 = _require(obj[20]).useStateFromStores(items3, () => closure_1_8.getStateForGuild(closure_0));
const obj3 = _require(obj[20]);
2026-07-29 08:29:29 +00:00
const tmp6 = useGuildPowerupsNotificationIndicator;
const tmp7 = stateFromStores2;
({ indicator, showUnread } = useGuildPowerupsNotificationIndicator(guildId, stateFromStores2, stateFromStores1));
const tmp9Result = useGuildPowerupsChannelListPopout(guildId, stateFromStores2);
let tmp12;
if (null !== stateFromStores2) {
obj = { indicator: null, showUnread: null, popout: null };
obj[0] = indicator;
obj[1] = showUnread;
obj[2] = tmp9Result;
tmp12 = obj;
}
2026-08-24 06:08:38 +00:00
obj = tmp12;
2026-07-29 08:29:29 +00:00
const tmp10 = stateFromStores2;
const tmp6Result = useGuildPowerupsNotificationIndicator(guildId, stateFromStores2, stateFromStores1);
const tmp9 = useGuildPowerupsChannelListPopout;
2026-08-24 06:08:38 +00:00
const autoDismissGuildPowerupsNewBadge = tmp(tmp2[31]).useAutoDismissGuildPowerupsNewBadge(guildId);
2026-07-29 08:29:29 +00:00
const items4 = [guildId];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
obj = guildId(obj[32]);
const result = obj.guildPowerupsAckNotification(guildId);
2026-07-29 08:29:29 +00:00
}, items4);
const items5 = [tmp12];
2026-07-20 16:05:17 +00:00
const effect1 = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
const items = [guildId(obj[11]).GuildPowerupNotificationPopoutType.BOOST_TO_UNLOCK, guildId(obj[11]).GuildPowerupNotificationPopoutType.EXPIRING_PERK];
2026-07-29 08:29:29 +00:00
const set = new Set(items);
2026-07-20 16:05:17 +00:00
let type;
2026-08-24 06:08:38 +00:00
if (obj != null) {
2026-07-29 08:29:29 +00:00
const popout = tmp.popout;
if (popout != null) {
2026-07-20 16:05:17 +00:00
type = popout.type;
}
}
let hasItem = null != type;
if (hasItem) {
2026-07-29 08:29:29 +00:00
hasItem = set.has(tmp.popout.type);
2026-07-20 16:05:17 +00:00
}
if (!hasItem) {
2026-07-29 08:29:29 +00:00
if (tmp != null) {
const popout2 = tmp.popout;
if (popout2 != null) {
2026-08-24 06:08:38 +00:00
popout2.markAsDismissed(closure_1_18.AUTO_DISMISS);
2026-07-29 08:29:29 +00:00
}
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}, items5);
const items6 = [guildId, stateFromStores];
2026-07-20 16:05:17 +00:00
const effect2 = React.useEffect(() => {
if (null != stateFromStores) {
2026-08-24 06:08:38 +00:00
const ReverseOrderedTiers = guildId(obj[9]).ReverseOrderedTiers;
2026-07-20 16:05:17 +00:00
const item = ReverseOrderedTiers.forEach((arg0) => {
2026-08-24 06:08:38 +00:00
if (null != closure_1_9[arg0]) {
2026-07-29 08:29:29 +00:00
if (null != unlockedPowerups.unlockedPowerups[tmp]) {
2026-08-24 06:08:38 +00:00
if (null != closure_1_10[arg0]) {
obj = closure_1_0(closure_1_2[10]);
const result = obj.markContentAsDismissed(tmp4, closure_0, false, closure_1_18.AUTO_DISMISS);
2026-07-20 16:05:17 +00:00
}
}
}
});
}
2026-07-29 08:29:29 +00:00
}, items6);
2026-07-20 16:05:17 +00:00
};