Files
discord-decomp/sources/modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx
T
2026-07-28 01:06:53 +03:00

79 lines
4.7 KiB
TypeScript

/* Metro module 14636; source: modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx; dependencies: [31, 8259, 1244, 2256, 2] */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as GuildPowerupsConstantsModule from '../constants/GuildPowerupsConstants.tsx'; /* Metro dependency 8259 */
function _fun110618(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14833:6, offset: 0x0237fc9a, size: 143 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/premium/powerups/utils/useCalculatePowerupCardStatus.tsx');
exports.useCalculatePowerupCardStatus = useCalculatePowerupCardStatus;
function useCalculatePowerupCardStatus(a0, a1, a2) { // fn#110619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14833:270, offset: 0x0237fd29, size: 66 bytes, params: 4, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
return ReactModule.useMemo(_fun110620, [a1, a2, a0]);
function _fun110620() { // fn#110620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14833:334, offset: 0x0237fd6b, size: 431 bytes, params: 1, frame: 23
var r0;
var type;
var value3;
var object;
const intl = (IndexNativeModule).intl;
var formatToPlainString;
var WRRYUT;
var sourcePowerup;
const intl2 = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
const sourceEntitlement = require.sourceEntitlement;
const value2 = undefined;
if ((sourceEntitlement == null ? value2 : sourceEntitlement.ends_at) != null) {
r0 = {type: 'expiring', expiringAt: require.sourceEntitlement.ends_at};
} else if (importDefault) {
if (env0_0.storeRemovalDate != null) {
r0 = {type: 'removing', removingAt: env0_0.storeRemovalDate};
} else {
type = require.type;
value3 = environment.__proto__;
if (type === PowerupActiveStatusType.LEVEL_ACTIVATED) {
formatToPlainString = intl.formatToPlainString;
WRRYUT = (importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).WRRYUT;
sourcePowerup = require.sourcePowerup;
r0 = {type: 'active', statusText: Reflect.apply(formatToPlainString, intl, [WRRYUT,
{perkName: (sourcePowerup == null ? value2 : sourcePowerup.title) ?? intl2.string(t.BfF6ED)}])};
} else if (require.type === PowerupActiveStatusType.INACTIVE) {
r0 = value2;
} else {
object = {type: 'active'};
object.statusText = intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).FFLkmx);
r0 = object;
}
}
} else {
type = require.type;
value3 = environment.__proto__;
if (type === PowerupActiveStatusType.LEVEL_ACTIVATED) {
formatToPlainString = intl.formatToPlainString;
WRRYUT = (importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).WRRYUT;
sourcePowerup = require.sourcePowerup;
r0 = {type: 'active', statusText: Reflect.apply(formatToPlainString, intl, [WRRYUT,
{perkName: (sourcePowerup == null ? value2 : sourcePowerup.title) ?? intl2.string(t.BfF6ED)}])};
} else if (require.type === PowerupActiveStatusType.INACTIVE) {
r0 = value2;
} else {
object = {type: 'active'};
object.statusText = intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).FFLkmx);
r0 = object;
}
}
return r0;
}
}
}
global.__d(_fun110618, 14636, [31, 8259, 1244, 2256,
2]) /* metro module 14636, dependencies: [31, 8259, 1244, 2256, 2] */;