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,8 @@
// Metro module 11617 (f11618).
import LocaleStore from "../../../user_settings/LocaleStore";
export default function entitlementExpirationDateToString(a0) {
return new Date(a0).toLocaleDateString(LocaleStore.locale, {
month: "2-digit",
day: "2-digit"
});
};
@@ -0,0 +1,13 @@
// Metro module 11590 (f11591).
import GuildPowerupsStore from "../GuildPowerupsStore";
import { PowerupActiveStatusType } from "../constants/GuildPowerupsConstants";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { GUILD_POWERUP_MAX_FILE_SIZE_250_MB_SKU_ID } from "../../../../_bundle/Module4080";
import usePowerupActiveStatus from "../hooks/usePowerupActiveStatus";
import { useFileUpload250MbPowerupRollbackEnabled } from "../experiments/FileUpload250MbPowerupExperiment";
export function useShouldShowFileUploadRollback(a0, a1) {
const stateFromStores = useStateFromStores([GuildPowerupsStore], () => GuildPowerupsStore.getStateForGuild(a0));
const r15 = stateFromStores == null ? void 0 : stateFromStores.allPowerups[GUILD_POWERUP_MAX_FILE_SIZE_250_MB_SKU_ID];
const powerupActiveStatus = usePowerupActiveStatus(a0, r15);
return useFileUpload250MbPowerupRollbackEnabled(a0, a1) && r15 != null && r15.storeRemovalDate != null && powerupActiveStatus.type === PowerupActiveStatusType.POWERUP_ACTIVATED;
}
@@ -0,0 +1,49 @@
// Metro module 11673 (f11674).
import SnowflakeUtils from "../../../../utils/SnowflakeUtils";
let c7985_2 = 259200000;
export const BOOST_EXPIRING_DISPLAY_WINDOW_DAYS = 3;
export const BOOST_EXPIRING_DISPLAY_WINDOW_MS = 259200000;
export function getBoostLifecycleInfo(a0, a1) {
let r15;
L9: {
L8: {
if (!a0.ended) {
if (a0.endsAt != null && a0.endsAt.getTime() <= a1) {
break L8;
}
if (a0.endsAt != null && a0.endsAt.getTime() - a1 <= c7985_2) {
r15 = {
phase: "expiring",
endsAt: a0.endsAt
};
break L9;
}
r15 = {
phase: "gave"
};
break L9;
}
}
r15 = {
phase: "expired"
};
}
return r15;
}
export function getBoostLifecycleTimestamp(a0, a1) {
const phase = a1.phase;
if (phase === "gave") {
return SnowflakeUtils.extractTimestamp(a0.id);
}
if (phase === "expiring") {
return a1.endsAt.getTime() - c7985_2;
}
if (phase === "expired") {
const endsAt = a0.endsAt;
let r14 = endsAt == null ? void 0 : endsAt.getTime();
if (r14 == null) {
r14 = SnowflakeUtils.extractTimestamp(a0.id);
}
return r14;
}
}
@@ -0,0 +1,22 @@
// Metro module 11678 (f11679).
import { intl } from "../../../../intl/index.native";
import GuildPowerups_messages from "../GuildPowerups.messages";
import { BOOST_EXPIRING_DISPLAY_WINDOW_MS } from "./getBoostLifecyclePhase";
export default function getBoostRowMessageText(a0) {
const phase = a0.phase;
if (phase === "gave") {
return intl.string(GuildPowerups_messages.plwH8d);
}
if (phase === "expiring") {
let endsAt = a0.boost.endsAt;
if (endsAt == null) {
endsAt = new Date(a0.sortKey + BOOST_EXPIRING_DISPLAY_WINDOW_MS);
}
return intl.formatToPlainString(GuildPowerups_messages.vct4l8, {
date: endsAt
});
}
if (phase === "expired") {
return intl.string(GuildPowerups_messages.hSXjlI);
}
};
@@ -0,0 +1,4 @@
// Metro module 11585 (f11586).
export function getExpiringGuildEntitlements(a0) {
return a0.filter((item) => item.ends_at != null).sort((a, b) => a.ends_at < b.ends_at ? -1 : 1);
}
@@ -0,0 +1,8 @@
// Metro module 11592 (f11593).
import LocaleStore from "../../../user_settings/LocaleStore";
export default function getGuildPowerupFormattedDateString(a0, r4 = {
month: "numeric",
day: "numeric"
}) {
return new Date(a0).toLocaleDateString(LocaleStore.locale, r4);
};
@@ -0,0 +1,19 @@
// Metro module 11645 (f11646).
import { BoostInfoType } from "../constants/GuildPowerupsConstants";
import { intl } from "../../../../intl/index.native";
import GuildPowerups_messages from "../GuildPowerups.messages";
export function getGuildPowerupsBoostInfoText(a0, a1) {
if (BoostInfoType.AVAILABLE === a1) {
return intl.formatToPlainString(GuildPowerups_messages.BdRXZA, {
boostCount: a0
});
}
if (BoostInfoType.SPENT === a1) {
return intl.formatToPlainString(GuildPowerups_messages.xvgIVG, {
boostCount: a0
});
}
if (BoostInfoType.TOTAL === a1) {
return intl.string(GuildPowerups_messages["/F7Z2y"]);
}
}
@@ -0,0 +1,21 @@
// Metro module 4098 (f4099).
export default function getPowerupEntitlementPrice(a0) {
const r6 = a0 == null ? void 0 : a0.tenant_metadata?.guild_monetization;
const r8 = a0 == null;
let r5 = void 0;
if (!r8) {
const sku = a0.sku;
r5 = sku == null ? void 0 : sku.tenant_metadata?.guild_monetization;
}
let r14 = r6 == null ? void 0 : r6.game_server?.boost_price;
if (r14 == null) {
r14 = r6 == null ? void 0 : r6.powerup?.boost_price;
}
if (r14 == null) {
r14 = r5 == null ? void 0 : r5.game_server?.boost_price;
}
if (r14 == null) {
r14 = r5 == null ? void 0 : r5.powerup?.boost_price;
}
return r14;
};
@@ -0,0 +1,16 @@
// Metro module 12641 (f12642).
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { GAME_SERVER_POWERUP_SKU_ID } from "../../game_server/GameServerConstants";
import { GUILD_POWERUP_GUILD_THEME_SKU_ID } from "../../../../_bundle/Module4080";
export default function orderMarketablePerksForDisplay(a0) {
const r10 = [...a0].reverse();
const r12 = r10.findIndex((item) => item.skuId === GUILD_POWERUP_GUILD_THEME_SKU_ID);
if (r12 > 0) {
r10.unshift(_slicedToArray(r10.splice(r12, 1), 1)[0]);
}
const r23 = r10.findIndex((item) => item.skuId === GAME_SERVER_POWERUP_SKU_ID);
if (r23 !== -1 && r23 !== r10.length - 1) {
r10.push(_slicedToArray(r10.splice(r23, 1), 1)[0]);
}
return r10;
};
@@ -0,0 +1,130 @@
// Metro module 11608 (f11609).
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useMemo } from "react";
import GuildPowerupsStore from "../GuildPowerupsStore";
import { GuildPowerupType, PERK_SKU_BADGES } from "../constants/GuildPowerupsConstants";
import { GUILD_POWERUP_GUILD_THEME_SKU_ID, GUILD_POWERUP_TAG_SKU_ID, GUILD_TAGS_BADGE_PACK_CREEPY_CRAWLIES_POWERUP_SKU_ID, GUILD_TAGS_BADGE_PACK_PETS_POWERUP_SKU_ID, GUILD_TAGS_BADGE_PACK_PLANT_POWERUP_SKU_ID, GUILD_TAGS_BADGE_PACK_FLEX_POWERUP_SKU_ID } from "../../../../_bundle/Module4080";
import { useStateFromStores } from "../../../../_bundle/Module589";
let c7924_7, c7924_8, buildPowerupListings, c7924_11;
const orderPowerupListings = function orderPowerupListings(a0) {
const r8 = a0.findIndex((item) => item.type === "singlePerk" && item.powerup.skuId === GUILD_POWERUP_GUILD_THEME_SKU_ID);
let r12 = a0;
if (!(r8 <= 0)) {
const r13 = [...a0];
r13.unshift(_slicedToArray(r13.splice(r8, 1), 1)[0]);
r12 = r13;
}
const r24 = r12.findIndex((item) => item.type === "singlePerk" && item.powerup.skuId === GUILD_POWERUP_TAG_SKU_ID);
const r28 = r12.findIndex((item) => {
let r0 = item.type === "multiPerk";
if (r0) {
let r1 = item.group === "guildTagsBadgePacks";
if (!r1) {
item.group;
r1 = false;
}
r0 = r1;
}
return r0;
});
const r30 = r12;
let r31 = r30;
if (r24 !== -1) {
r31 = r30;
if (r28 !== -1) {
const r33 = r24 + 1;
r31 = r30;
if (r28 !== r33) {
const r34 = [...r30];
const [r42] = r34.splice(r28, 1);
r34.splice(r34.findIndex((item) => item.type === "singlePerk" && item.powerup.skuId === GUILD_POWERUP_TAG_SKU_ID) + 1, 0, r42);
r31 = r34;
}
}
}
return r31;
};
buildPowerupListings = function buildPowerupListings(a0, a1, a2) {
let powerup;
const r2 = [];
let c19028_0 = r2;
let c19028_1 = a1.reduce((acc, item) => {
if (item.type !== GuildPowerupType.PERK) {
return acc;
}
const r9 = c7924_8[item.skuId];
if (r9 != null) {
if (acc[r9] == null) {
acc[r9] = [];
}
acc[r9].push(item);
}
return acc;
}, {});
const _loop = function _loop() {
if (powerup.type === GuildPowerupType.LEVEL) {
c19028_0.push({
type: "singleLevel",
powerup
});
return 0;
}
const group = c7924_8[powerup.skuId];
if (group != null) {
const powerups = c19028_1[group];
if (powerups !== void 0) {
let c27118_0 = c7924_7[group];
powerups.sort((a, b) => c27118_0.indexOf(a.skuId) - c27118_0.indexOf(b.skuId));
c19028_0.push({
type: "multiPerk",
group,
powerups
});
c19028_1[group] = void 0;
}
return 0;
}
c19028_0.push({
type: "singlePerk",
powerup,
badge: PERK_SKU_BADGES[powerup.skuId]
});
};
for (const item of a1) {
powerup = item;
_loop();
}
if (a2 ? a0 === GuildPowerupType.PERK : a2) {
r2.push({
type: "gameServer"
});
}
return orderPowerupListings(r2);
};
c7924_7 = {
guildTagsBadgePacks: [GUILD_TAGS_BADGE_PACK_CREEPY_CRAWLIES_POWERUP_SKU_ID, GUILD_TAGS_BADGE_PACK_PETS_POWERUP_SKU_ID, GUILD_TAGS_BADGE_PACK_PLANT_POWERUP_SKU_ID, GUILD_TAGS_BADGE_PACK_FLEX_POWERUP_SKU_ID]
};
c7924_8 = Object.entries(c7924_7).reduce((acc, a1) => {
const [r3, r15] = a1;
for (const item of r15) {
acc[item] = r3;
}
return acc;
}, {});
c7924_11 = [GuildPowerupType.LEVEL, GuildPowerupType.PERK];
export { c7924_7 as POWERUP_GROUP_TO_SKU_IDS };
export { buildPowerupListings };
export function useBuildGuildPowerupsSections(c19029_0, a1) {
const stateFromStores = useStateFromStores([GuildPowerupsStore], () => GuildPowerupsStore.getStateForGuild(c19029_0));
return useMemo(() => c7924_11.reduce((acc, item) => {
const r6 = stateFromStores == null ? void 0 : stateFromStores.powerupCatalog[item];
if (r6 == null) {
return acc;
}
acc.push({
type: item,
listings: buildPowerupListings(item, r6, a1)
});
return acc;
}, []), [stateFromStores?.powerupCatalog, a1]);
}
@@ -0,0 +1,129 @@
// Metro module 11582 (f11583).
import { DEFAULT_SOUND_SLOTS, DEFAULT_STICKER_SLOTS } from "../../PremiumConstants";
import { GuildPowerupType } from "../constants/GuildPowerupsConstants";
import { DEFAULT_EMOJI_SLOTS } from "../../../emojis/EmojiConstants";
export default function storeListingToGuildPowerup(a0, a1) {
let r98;
const category_type = a1.powerup_metadata?.category_type;
if (category_type != null) {
const powerup_metadata = a1.sku?.powerup_metadata;
if (powerup_metadata != null) {
const dependencies = a1.sku.dependent_sku_id != null ? [a1.sku.dependent_sku_id] : [];
let animatedImageUrl = a1.powerup_metadata?.animated_image_url;
if (animatedImageUrl == null) {
animatedImageUrl = powerup_metadata.animated_image_url;
}
let staticImageUrl = a1.powerup_metadata?.static_image_url;
if (staticImageUrl == null) {
staticImageUrl = powerup_metadata.static_image_url;
}
const r25 = {
title: a1.summary,
skuId: a1.sku.id,
cost: powerup_metadata.boost_price,
dependencies,
animatedImageUrl,
staticImageUrl,
storeRemovalDate: a1.powerup_metadata?.store_removal_date,
deactivationCooldownPeriodDays: a1.powerup_metadata?.deactivation_cooldown_period_days
};
if (GuildPowerupType.LEVEL === category_type) {
const guild_features = a1.sku.powerup_metadata?.guild_features;
if (guild_features == null) {
return void 0;
}
const r59 = DEFAULT_EMOJI_SLOTS + guild_features.additional_emoji_slots;
let r12 = DEFAULT_SOUND_SLOTS + guild_features.additional_sound_slots;
let r13 = DEFAULT_STICKER_SLOTS + guild_features.additional_sticker_slots;
const dependent_sku_id2 = a1.sku.dependent_sku_id;
let dependent_sku_id = dependent_sku_id2;
let r65 = r59;
let total_sticker_slots = r13;
let total_sound_slots = r12;
let total_emoji_slots = r65;
if (dependent_sku_id2 != null) {
do {
const r19 = a0.find((item) => dependent_sku_id === item.sku.id);
const r70 = r19 == null;
const r18 = r13;
const r17 = r12;
const r71 = r65;
let r72 = void 0;
if (!r70) {
const sku = r19.sku;
const r73 = sku == null;
r72 = void 0;
if (!r73) {
const powerup_metadata2 = sku.powerup_metadata;
r72 = powerup_metadata2 == null ? void 0 : powerup_metadata2.guild_features?.additional_emoji_slots;
}
}
if (r72 == null) {
r72 = 0;
}
const r78 = r71 + r72;
const r79 = r19 == null;
let r80 = void 0;
if (!r79) {
const sku2 = r19.sku;
const r82 = sku2 == null;
r80 = void 0;
if (!r82) {
const powerup_metadata3 = sku2.powerup_metadata;
r80 = powerup_metadata3 == null ? void 0 : powerup_metadata3.guild_features?.additional_sound_slots;
}
}
if (r80 == null) {
r80 = 0;
}
const r87 = r17 + r80;
const r88 = r19 == null;
let r89 = void 0;
if (!r88) {
const sku3 = r19.sku;
const r91 = sku3 == null;
r89 = void 0;
if (!r91) {
const powerup_metadata4 = sku3.powerup_metadata;
r89 = powerup_metadata4 == null ? void 0 : powerup_metadata4.guild_features?.additional_sticker_slots;
}
}
if (r89 == null) {
r89 = 0;
}
const r96 = r18 + r89;
r98 = r19 == null ? void 0 : r19.sku.dependent_sku_id;
dependent_sku_id = r98;
r13 = r96;
r12 = r87;
r65 = r78;
total_sticker_slots = r13;
total_sound_slots = r12;
total_emoji_slots = r65;
} while (r98 != null);
}
return {
type: GuildPowerupType.LEVEL,
features: {
...guild_features,
total_emoji_slots,
total_sound_slots,
total_sticker_slots
},
...r25
};
}
if (GuildPowerupType.PERK === category_type) {
let description = a1.description;
if (description == null) {
description = "";
}
return {
type: GuildPowerupType.PERK,
description,
...r25
};
}
}
}
};
@@ -0,0 +1,47 @@
// Metro module 11611 (f11612).
import { useMemo } from "react";
import { PowerupActiveStatusType } from "../constants/GuildPowerupsConstants";
import { intl, t } from "../../../../intl/index.native";
import GuildPowerups_messages from "../GuildPowerups.messages";
export function useCalculatePowerupCardStatus(a0, a1, a2) {
return useMemo(() => {
let r21;
const ends_at = a1.sourceEntitlement?.ends_at;
L18: {
if (ends_at != null) {
r21 = {
type: "expiring",
expiringAt: a1.sourceEntitlement.ends_at
};
} else {
if (a2) {
if (a0.storeRemovalDate != null) {
r21 = {
type: "removing",
removingAt: a0.storeRemovalDate
};
break L18;
}
}
if (a1.type === PowerupActiveStatusType.LEVEL_ACTIVATED) {
let perkName = a1.sourcePowerup?.title;
if (perkName == null) {
perkName = intl.string(t.BfF6ED);
}
r21 = {
type: "active",
statusText: intl.formatToPlainString(GuildPowerups_messages.WRRYUT, {
perkName
})
};
} else {
r21 = a1.type !== PowerupActiveStatusType.INACTIVE ? {
type: "active",
statusText: intl.string(GuildPowerups_messages.FFLkmx)
} : void 0;
}
}
}
return r21;
}, [a1, a2, a0]);
}