105 lines
6.9 KiB
TypeScript
105 lines
6.9 KiB
TypeScript
/* Metro module 14656; source: modules/premium/powerups/hooks/useDeactivateWarningText.tsx; dependencies: [31, 4111, 1938, 1867, 566, 6736, 8188, 1244, 2256, 2] */
|
|
import GuildStore from '../../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import GuildRoleStore from '../../../../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */
|
|
import GuildMemberCountStore from '../../../../stores/GuildMemberCountStore.tsx'; /* Metro dependency 4111 */
|
|
import UseGuildRoleMemberCounts from '../../../guild_role_subscriptions/useGuildRoleMemberCounts.tsx'; /* Metro dependency 6736 */
|
|
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 FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as PowerupsModule from '../../../../external/discord_common/js/shared/shared-constants/Powerups.tsx'; /* Metro dependency 8188 */
|
|
|
|
function _fun110704(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:6, offset: 0x023833c1, size: 169 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/premium/powerups/hooks/useDeactivateWarningText.tsx');
|
|
exports.default = useDeactivateWarningText;
|
|
function useDeactivateWarningText(a0, a1) { // fn#110705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:239, offset: 0x0238346a, size: 252 bytes, params: 3, frame: 24
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
const memberCount = (FluxModule).useStateFromStores([GuildMemberCountStore],
|
|
_fun110706);
|
|
const value2 = (UseGuildRoleMemberCounts)(a0);
|
|
return value2.useMemo(_fun110710, [a1,
|
|
(FluxModule).useStateFromStores([GuildRoleStore], _fun110708, [a0, a1.skuId,
|
|
value2]), memberCount, (FluxModule).useStateFromStores([GuildStore],
|
|
_fun110707)]);
|
|
function _fun110706() { // fn#110706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:316, offset: 0x02383566, size: 27 bytes, params: 1, frame: 11
|
|
return GuildMemberCountStore.getMemberCount(env0_0);
|
|
}
|
|
|
|
function _fun110707() { // fn#110707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:389, offset: 0x02383581, size: 48 bytes, params: 1, frame: 12
|
|
const value = environment.__proto__;
|
|
return GuildStore.getGuild(env0_0)?.vanityURLCode != null;
|
|
}
|
|
|
|
function _fun110708() { // fn#110708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:499, offset: 0x023835b1, size: 108 bytes, params: 1, frame: 15
|
|
var r0;
|
|
var value;
|
|
const skuId = require.skuId;
|
|
const GUILD_POWERUP_ROLE_COLOR_SKU_ID = (PowerupsModule).GUILD_POWERUP_ROLE_COLOR_SKU_ID;
|
|
const value3 = 0;
|
|
if (skuId !== GUILD_POWERUP_ROLE_COLOR_SKU_ID) {
|
|
r0 = value3;
|
|
} else if (ReactModule == null) {
|
|
r0 = value3;
|
|
} else {
|
|
value = GuildRoleStore.getSortedRoles(env0_0);
|
|
value = value.reduce(_fun110709, value3);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function _fun110709(a0, a1) { // fn#110709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:592, offset: 0x0238361d, size: 70 bytes, params: 3, frame: 6
|
|
var r0;
|
|
var value3;
|
|
let value = a0;
|
|
if (a1.colorStrings?.secondaryColor == null) {
|
|
r0 = value;
|
|
} else {
|
|
value3 = environment.__proto__;
|
|
value += env1_3[a1.id] ?? 0;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun110710() { // fn#110710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14853:739, offset: 0x02383663, size: 688 bytes, params: 1, frame: 20
|
|
var r2;
|
|
const intl = (IndexNativeModule).intl;
|
|
var string;
|
|
var binding;
|
|
var defaultImport;
|
|
const skuId = require.skuId;
|
|
const GUILD_POWERUP_ROLE_COLOR_SKU_ID = (require(8188) /* metro dependency 8188: Powerups */).GUILD_POWERUP_ROLE_COLOR_SKU_ID;
|
|
if (GUILD_POWERUP_ROLE_COLOR_SKU_ID === skuId) {
|
|
r2 = env0_5 > 0 ? intl.formatToPlainString((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */)['4jSvr1'],
|
|
|
|
{perk: require.title,
|
|
memberCount: env0_5}) : intl.formatToPlainString((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).cavtEo,
|
|
|
|
{perk: require.title});
|
|
} else if ((require(8188) /* metro dependency 8188: Powerups */).VANITY_URL_POWERUP_SKU_ID === skuId) {
|
|
binding = env0_4;
|
|
string = intl.string;
|
|
defaultImport = importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */;
|
|
r2 = binding ? Reflect.apply(string, intl, [defaultImport.hN75yb]) : Reflect.apply(string, intl,
|
|
[defaultImport.Du91Rb]);
|
|
} else {
|
|
r2 = (require(8188) /* metro dependency 8188: Powerups */).GUILD_TAGS_BADGE_PACK_PETS_POWERUP_SKU_ID === skuId || (require(8188) /* metro dependency 8188: Powerups */).GUILD_TAGS_BADGE_PACK_FLEX_POWERUP_SKU_ID === skuId ? intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).Vf2ZcR) : intl.formatToPlainString((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */)['4jSvr1'],
|
|
|
|
{perk: require.title, memberCount: memberCount ?? 0});
|
|
}
|
|
return {warningText: r2,
|
|
vanityUrlWarning: env0_4 && require.skuId === (require(8188) /* metro dependency 8188: Powerups */).GUILD_POWERUP_LEVEL_3_SKU_ID ? intl.string((importDefault(2256) /* metro dependency 2256: GuildPowerupsMessages */).M4XL5n) : null};
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun110704, 14656, [31, 4111, 1938, 1867, 566, 6736, 8188, 1244, 2256,
|
|
2]) /* metro module 14656, dependencies: [31, 4111, 1938, 1867, 566, 6736, 8188, 1244, 2256, 2] */;
|