Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
266 lines
12 KiB
TypeScript
266 lines
12 KiB
TypeScript
// Module ID: 12613
|
|
// Function ID: 12614
|
|
// Name: GuildPowerupsBottomSheet
|
|
// Dependencies: [17, 4599, 4497, 4498, 21, 4607, 576, 12594, 12591, 12614, 12615, 504, 12616, 4317, 12618, 4603, 12619, 12621, 12622, 4562, 1114, 2428, 12608, 12628, 4500, 9159, 12629, 12630, 12634, 12639, 12640, 5027, 12638, 7224, 2]
|
|
// Exports: default
|
|
|
|
// Module 12613 (GuildPowerupsBottomSheet)
|
|
import _mod17 from "module_17" /* 17 */;
|
|
import initialize from "initialize" /* 504 */;
|
|
import nativeDefault from "native" /* 576 */;
|
|
import util from "util" /* 1114 */;
|
|
import _modDef2428 from "module_2428" /* 2428 */;
|
|
import GameServerConstants from "GameServerConstants" /* 4498 */;
|
|
import Powerups from "Powerups" /* 4500 */;
|
|
import Text_Text from "Text/Text" /* 4603 */;
|
|
import components_Button_Button from "components/Button/Button" /* 5027 */;
|
|
import Sheet_BottomSheet from "Sheet/BottomSheet" /* 7224 */;
|
|
import useGuildPowerupRollbackEnabledDefault from "useGuildPowerupRollbackEnabled" /* 12591 */;
|
|
import usePowerupActiveStatusDefault from "usePowerupActiveStatus" /* 12594 */;
|
|
import useHasAllocateBoostPermissionDefault from "useHasAllocateBoostPermission" /* 12608 */;
|
|
import useCalculatePowerupCardStatus from "useCalculatePowerupCardStatus" /* 12614 */;
|
|
import useGetGuildPowerupBannerImageDefault from "useGetGuildPowerupBannerImage" /* 12615 */;
|
|
import GuildPowerupsCardFooter from "GuildPowerupsCardFooter" /* 12619 */;
|
|
import useGuildPowerupLevelPerksDefault from "useGuildPowerupLevelPerks" /* 12621 */;
|
|
import GuildBoostingMarketingUtils from "GuildBoostingMarketingUtils" /* 12622 */;
|
|
import useGuildPowerupCardFooterConfigDefault from "useGuildPowerupCardFooterConfig" /* 12628 */;
|
|
import useCanGuildPowerupBeToggledDefault from "useCanGuildPowerupBeToggled" /* 12629 */;
|
|
import useGuildPowerupOnActivateDefault from "useGuildPowerupOnActivate" /* 12630 */;
|
|
import GuildPowerupAnalytics from "GuildPowerupAnalytics" /* 12638 */;
|
|
import AccessibilityStore from "AccessibilityStore" /* 4599 */;
|
|
import GuildPowerupsConstants from "GuildPowerupsConstants" /* 4497 */;
|
|
import jsxProd from "jsxProd" /* 21 */;
|
|
import createStyles from "createStyles" /* 4607 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
function GuildPowerupsBottomSheetHeader(arg0) {
|
|
({ guildId, powerup } = arg0);
|
|
const tmp = closure_11();
|
|
const tmp4 = usePowerupActiveStatusDefault(guildId, powerup);
|
|
const tmp5 = useGuildPowerupRollbackEnabledDefault(guildId, powerup, "GuildPowerupsBottomSheet");
|
|
const calculatePowerupCardStatus = useCalculatePowerupCardStatus.useCalculatePowerupCardStatus(powerup, tmp4, tmp5);
|
|
let str = useGetGuildPowerupBannerImageDefault(powerup, true);
|
|
if (str == null) {
|
|
str = "";
|
|
}
|
|
const items = [AccessibilityStore];
|
|
let str2;
|
|
const stateFromStores = initialize.useStateFromStores(items, () => useReducedMotion.useReducedMotion);
|
|
if (powerup.skuId === closure_7) {
|
|
str2 = "+";
|
|
}
|
|
if (powerup.type === constants.LEVEL) {
|
|
const obj2 = { style: tmp.gemContainer };
|
|
let tmp15 = React6(tmp2(12616), obj2);
|
|
let tmp14 = React6;
|
|
} else if (tmp10 === closure_7) {
|
|
const obj3 = { style: tmp.image, children: null };
|
|
const obj4 = { stateMachine: "SM_Auto", dataBinding: null };
|
|
const obj5 = { reducedMotion: stateFromStores };
|
|
obj4.dataBinding = obj5;
|
|
obj3.children = React6(tmp6(4317).GameServerHostingRive, obj4);
|
|
tmp15 = React6(tmp12, obj3);
|
|
tmp14 = React6;
|
|
} else {
|
|
const obj6 = { imageUrl: str, style: tmp.image, isAnimated: true };
|
|
tmp14 = React6;
|
|
tmp15 = React6(tmp2(12618), obj6);
|
|
}
|
|
const obj7 = { children: null };
|
|
const items1 = [tmp15, ];
|
|
const obj8 = { style: tmp.headerContainer, children: null };
|
|
const items2 = [tmp14(Text_Text.Text, { variant: "heading-xl/bold", accessibilityRole: "header", children: powerup.title }), tmp14(GuildPowerupsCardFooter.GuildPowerupsCardFooter, { cost: powerup.cost, costDecorator: str2, status: calculatePowerupCardStatus, style: tmp.statusContainer })];
|
|
obj8.children = items2;
|
|
items1[1] = React7(View, obj8);
|
|
obj7.children = items1;
|
|
return React7(View, obj7);
|
|
}
|
|
function GuildPowerupsBottomSheetLevelBody(powerup) {
|
|
const tmp = closure_11();
|
|
closure_0 = tmp;
|
|
const arr = useGuildPowerupLevelPerksDefault(powerup.powerup);
|
|
return closure_8(View, {
|
|
style: tmp.levelContainer,
|
|
children: useGuildPowerupLevelPerksDefault(powerup.powerup).map((children, index) => {
|
|
const obj2 = { style: closure_0.perkContainer, children: null };
|
|
const iconForPerk = GuildBoostingMarketingUtils.getIconForPerk(children.perkIcon);
|
|
const items = [React6(Text_Text.Text, { style: closure_0.perkText, variant: "text-md/medium", children: children.description }), React6(iconForPerk, { style: closure_0.perkIcon })];
|
|
obj2.children = items;
|
|
return React7(View, obj2, "perk-" + index + "-" + children.perkIcon);
|
|
})
|
|
});
|
|
}
|
|
function GuildPowerupsBottomSheetBody(powerup) {
|
|
powerup = powerup.powerup;
|
|
const tmp = closure_11();
|
|
const type = powerup.type;
|
|
if (constants.PERK === type) {
|
|
const obj2 = { style: tmp.description, variant: "text-md/medium", children: powerup.description };
|
|
const items = [React6(Text_Text.Text, obj2), ];
|
|
let tmp5Result = null != powerup.deactivationCooldownPeriodDays;
|
|
if (tmp5Result) {
|
|
tmp5Result = powerup.deactivationCooldownPeriodDays > 0;
|
|
}
|
|
if (tmp5Result) {
|
|
const obj3 = { style: tmp.cooldownInfo, children: null };
|
|
const obj4 = { size: "xs", color: nativeDefault.colors.TEXT_MUTED };
|
|
const items1 = [tmp7(tmp8(4562).CircleInformationIcon, obj4), ];
|
|
const obj5 = { variant: "text-sm/medium", color: "text-muted", children: null };
|
|
const intl = tmp8(1114).intl;
|
|
const obj6 = { cooldownDays: powerup.deactivationCooldownPeriodDays };
|
|
obj5.children = intl.formatToPlainString(_modDef2428.GMhQcE, obj6);
|
|
items1[1] = tmp7(tmp8(4603).Text, obj5);
|
|
obj3.children = items1;
|
|
tmp5Result = tmp5(View, obj3);
|
|
}
|
|
const obj7 = { children: null };
|
|
items[1] = tmp5Result;
|
|
obj7.children = items;
|
|
return React7(closure_1_10, obj7);
|
|
} else if (tmp2.LEVEL === type) {
|
|
const obj = { powerup };
|
|
return React6(GuildPowerupsBottomSheetLevelBody, obj);
|
|
}
|
|
}
|
|
function GuildPowerupsBottomSheetFooter(arg0) {
|
|
({ guildId, powerup } = arg0);
|
|
isPowerupActive = undefined;
|
|
c1 = undefined;
|
|
closure_2 = undefined;
|
|
const tmp = closure_11();
|
|
const tmp4 = useHasAllocateBoostPermissionDefault(guildId);
|
|
({ showToggleButton, showConfigureButton, isPowerupActive } = useGuildPowerupCardFooterConfigDefault(guildId, powerup));
|
|
if (showConfigureButton) {
|
|
let result = powerup.skuId !== Powerups.GUILD_POWERUP_TAG_SKU_ID;
|
|
if (!result) {
|
|
result = tmp6(9159).canUseMobileServerTagSettings(guildId);
|
|
const tmp6Result = tmp6(9159);
|
|
}
|
|
showConfigureButton = result;
|
|
tmp6 = require;
|
|
}
|
|
const tmp5 = useGuildPowerupCardFooterConfigDefault(guildId, powerup);
|
|
({ disabled, reason } = useCanGuildPowerupBeToggledDefault(guildId, powerup, isPowerupActive));
|
|
const tmp8 = useCanGuildPowerupBeToggledDefault(guildId, powerup, isPowerupActive);
|
|
({ onActivate: c1, isLoading } = useGuildPowerupOnActivateDefault(guildId, powerup));
|
|
closure_2 = tmp2(12634)(guildId, powerup);
|
|
if (tmp4) {
|
|
let tmp14 = !showConfigureButton;
|
|
const hasItem = set.has(powerup.skuId);
|
|
if (!showConfigureButton) {
|
|
tmp14 = isPowerupActive;
|
|
}
|
|
if (tmp14) {
|
|
tmp14 = powerup.type === constants.PERK;
|
|
}
|
|
if (tmp14) {
|
|
tmp14 = hasItem;
|
|
}
|
|
if (!tmp14) {
|
|
tmp14 = powerup.skuId === closure_7;
|
|
}
|
|
const obj = { style: tmp.footerContainer, children: null };
|
|
if (tmp14) {
|
|
const obj2 = { style: tmp.description, variant: "text-md/bold", children: null };
|
|
const intl = util.intl;
|
|
obj2.children = intl.string(tmp2(2428)["jo5++h"]);
|
|
tmp14 = React6(Text_Text.Text, obj2);
|
|
}
|
|
const items = [tmp14, , , ];
|
|
let tmp21 = disabled;
|
|
if (disabled) {
|
|
tmp21 = null != reason;
|
|
}
|
|
if (tmp21) {
|
|
const obj3 = { text: reason };
|
|
tmp21 = React6(tmp2(12640), obj3);
|
|
}
|
|
items[1] = tmp21;
|
|
if (showConfigureButton) {
|
|
const obj4 = { variant: "primary", text: null, onPress: null };
|
|
const intl2 = util.intl;
|
|
obj4.text = intl2.string(tmp2(2428).g5Ds69);
|
|
obj4.onPress = tmp10;
|
|
showConfigureButton = React6(components_Button_Button.Button, obj4);
|
|
}
|
|
items[2] = showConfigureButton;
|
|
if (showToggleButton) {
|
|
showToggleButton = powerup.skuId !== closure_7;
|
|
}
|
|
if (!showToggleButton) {
|
|
items[3] = showToggleButton;
|
|
obj.children = items;
|
|
return tmp17(tmp18, obj);
|
|
} else {
|
|
let str = "primary";
|
|
if (isPowerupActive) {
|
|
str = "secondary";
|
|
}
|
|
const obj5 = { variant: str, text: null, loading: null, disabled: null, onPress: null };
|
|
const intl3 = util.intl;
|
|
const string = intl3.string;
|
|
let TZsu1U = tmp2(2428);
|
|
if (isPowerupActive) {
|
|
TZsu1U = TZsu1U.TZsu1U;
|
|
let stringResult = string(TZsu1U);
|
|
} else {
|
|
stringResult = string(TZsu1U.gSxlHf);
|
|
}
|
|
obj5.text = stringResult;
|
|
obj5.loading = isLoading;
|
|
obj5.disabled = disabled;
|
|
obj5.onPress = function onPress() {
|
|
if (isPowerupActive) {
|
|
if (closure_2 != null) {
|
|
tmp4();
|
|
}
|
|
} else if (c1 != null) {
|
|
tmp();
|
|
}
|
|
};
|
|
React6(components_Button_Button.Button, obj5);
|
|
}
|
|
tmp17 = React7;
|
|
tmp18 = View;
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|
|
const View = _mod17.View;
|
|
({ GuildPowerupType: hasOwnProperty, GUILD_POWERUP_CONFIGURABLE_SKUS_DESKTOP: metroRequire } = GuildPowerupsConstants);
|
|
let closure_7 = GameServerConstants.GAME_SERVER_POWERUP_SKU_ID;
|
|
({ jsx: closure_8, jsxs: closure_9, Fragment: c10 } = jsxProd);
|
|
let obj = { container: { padding: nativeDefault.space.PX_16, gap: nativeDefault.space.PX_16 }, headerContainer: null, statusContainer: null, levelContainer: null, perkContainer: null, perkIcon: null, perkText: null, footerContainer: null, image: null, description: null, cooldownInfo: null, gemContainer: null };
|
|
let obj2 = { padding: nativeDefault.space.PX_16, gap: nativeDefault.space.PX_16 };
|
|
obj.headerContainer = { marginTop: nativeDefault.space.PX_24, alignItems: "center" };
|
|
let obj3 = { marginTop: nativeDefault.space.PX_24, alignItems: "center" };
|
|
obj.statusContainer = { justifyContent: "center", gap: nativeDefault.space.PX_8 };
|
|
let obj4 = { justifyContent: "center", gap: nativeDefault.space.PX_8 };
|
|
obj.levelContainer = { flexDirection: "column", gap: nativeDefault.space.PX_8, marginTop: nativeDefault.space.PX_16 };
|
|
obj.perkContainer = { flexDirection: "row", alignItems: "center", justifyContent: "space-between" };
|
|
obj.perkIcon = { width: 20, height: 20 };
|
|
let obj5 = { flexDirection: "column", gap: nativeDefault.space.PX_8, marginTop: nativeDefault.space.PX_16 };
|
|
obj.perkText = { marginStart: nativeDefault.space.PX_8 };
|
|
let obj6 = { marginStart: nativeDefault.space.PX_8 };
|
|
obj.footerContainer = { gap: nativeDefault.space.PX_12, marginTop: nativeDefault.space.PX_8 };
|
|
obj.image = { width: "100%", height: 160 };
|
|
let obj7 = { gap: nativeDefault.space.PX_12, marginTop: nativeDefault.space.PX_8 };
|
|
obj.description = { marginHorizontal: nativeDefault.space.PX_24, textAlign: "center" };
|
|
let obj8 = { marginHorizontal: nativeDefault.space.PX_24, textAlign: "center" };
|
|
obj.cooldownInfo = { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: nativeDefault.space.PX_4, marginTop: nativeDefault.space.PX_8 };
|
|
const obj9 = { flexDirection: "row", alignItems: "center", justifyContent: "center", gap: nativeDefault.space.PX_4, marginTop: nativeDefault.space.PX_8 };
|
|
obj.gemContainer = { marginTop: nativeDefault.space.PX_16 };
|
|
let closure_11 = createStyles.createStyles(obj);
|
|
let result = size.fileFinishedImporting("modules/premium/powerups/native/GuildPowerupsBottomSheet.tsx");
|
|
|
|
export default function GuildPowerupsBottomSheet(arg0) {
|
|
({ guildId, powerup } = arg0);
|
|
const tmp = closure_11();
|
|
const logPowerupModalOpened = GuildPowerupAnalytics.useLogPowerupModalOpened(guildId, powerup, GuildPowerupAnalytics.ModalType.DETAIL);
|
|
const obj2 = { startExpanded: true, children: null };
|
|
const obj3 = { style: tmp.container, children: null };
|
|
const items = [React6(GuildPowerupsBottomSheetHeader, { guildId, powerup }), React6(GuildPowerupsBottomSheetBody, { guildId, powerup }), React6(GuildPowerupsBottomSheetFooter, { guildId, powerup })];
|
|
obj3.children = items;
|
|
obj2.children = React7(View, obj3);
|
|
return React6(Sheet_BottomSheet.BottomSheet, obj2);
|
|
};
|