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

82 lines
3 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 11561
// Function ID: 89941
2026-07-20 16:05:17 +00:00
// Name: useCanGuildPowerupBeToggled
2026-07-27 11:26:19 +00:00
// Dependencies: [31, 4018, 4019, 566, 11528, 1212, 2231, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-27 11:26:19 +00:00
// Module 11561 (useCanGuildPowerupBeToggled)
2026-07-23 10:11:24 +00:00
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { PowerupActiveStatusType } from "BoostedGuildTiers";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
const result = require("BoostedGuildTiers").fileFinishedImporting("modules/premium/powerups/hooks/useCanGuildPowerupBeToggled.tsx");
2026-07-20 16:05:17 +00:00
export default function useCanGuildPowerupBeToggled(arg0, arg1, arg2) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-20 16:05:17 +00:00
const importDefault = arg1;
const dependencyMap = arg2;
2026-07-23 10:11:24 +00:00
const items = [_isNativeReflectConstruct];
const stateFromStores = _require(566).useStateFromStores(items, () => tmp2.getStateForGuild(closure_0));
2026-07-27 11:26:19 +00:00
const tmp2 = importDefault(11528)(arg0, arg1);
2026-07-23 10:11:24 +00:00
_isNativeReflectConstruct = tmp2;
2026-07-20 16:05:17 +00:00
const items1 = [stateFromStores, , , , ];
({ skuId: arr2[1], dependencies: arr2[2] } = arg1);
items1[3] = arg2;
items1[4] = tmp2.type;
2026-07-23 10:11:24 +00:00
return stateFromStores.useMemo(() => {
2026-07-20 16:05:17 +00:00
let allPowerups;
let unlockedPowerups;
if (null == stateFromStores) {
let obj = { disabled: true, reason: undefined };
return obj;
} else {
2026-07-23 10:11:24 +00:00
if (tmp2.type !== outer1_5.LEVEL_ACTIVATED) {
if (tmp2.type !== outer1_5.TIER_OVERRIDE_ACTIVATED) {
2026-07-20 16:05:17 +00:00
({ allPowerups, unlockedPowerups } = stateFromStores);
2026-07-23 10:11:24 +00:00
if (dependencyMap) {
2026-07-20 16:05:17 +00:00
const _Object = Object;
const values = Object.values(unlockedPowerups);
const found = values.find((sku) => {
sku = sku.sku;
let dependent_sku_id;
if (null != sku) {
dependent_sku_id = sku.dependent_sku_id;
}
2026-07-23 10:11:24 +00:00
return dependent_sku_id === outer1_1.skuId;
2026-07-20 16:05:17 +00:00
});
let sku_id;
if (null != found) {
sku_id = found.sku_id;
}
let found1 = sku_id;
} else {
2026-07-23 10:11:24 +00:00
const dependencies = lib.dependencies;
2026-07-20 16:05:17 +00:00
found1 = dependencies.find((arg0) => null == unlockedPowerups[arg0]);
}
obj = { disabled: null != found1 };
let formatToPlainStringResult;
if (null != found1) {
if (null != allPowerups[found1]) {
2026-07-23 10:11:24 +00:00
const intl = callback(1212).intl;
2026-07-25 08:10:48 +00:00
const tmp12 = lib(2231);
2026-07-20 16:05:17 +00:00
obj = {};
let title;
if (null != allPowerups[found1]) {
title = tmp14.title;
}
obj.perk = title;
2026-07-23 10:11:24 +00:00
formatToPlainStringResult = intl.formatToPlainString(dependencyMap ? tmp12.vCEBiS : tmp12["1B8AZr"], obj);
const tmp13 = dependencyMap ? tmp12.vCEBiS : tmp12["1B8AZr"];
2026-07-20 16:05:17 +00:00
}
}
obj.reason = formatToPlainStringResult;
return obj;
}
}
const obj1 = { disabled: true, reason: undefined };
return obj1;
}
}, items1);
};