/* Metro module 6823; source: modules/premium/GuildCapUpsellHooks.tsx; dependencies: [1867, 1878, 661, 566, 6824, 3802, 2] */ import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import UserStore from '../../stores/UserStore.tsx'; /* Metro dependency 1878 */ import PremiumUtils from '../../utils/PremiumUtils.tsx'; /* Metro dependency 3802 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as HotspotModule from '../hotspot/index.tsx'; /* Metro dependency 6824 */ function _fun53635(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:6, offset: 0x0135204c, size: 195 bytes, params: 8, frame: 20 const env0_0 = require; const hasIncreasedGuildCap2 = hasIncreasedGuildCap; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/premium/GuildCapUpsellHooks.tsx'); exports.useShouldShowInlineGuildCapUpsell = useShouldShowInlineGuildCapUpsell; exports.hideInlineGuildCapUpsell = hideInlineGuildCapUpsell; exports.hasIncreasedGuildCap = hasIncreasedGuildCap2; exports.isAtGuildCapAndNonPremium = isAtGuildCapAndNonPremium; function hasIncreasedGuildCap(a0) { // fn#53636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:142, offset: 0x0135210f, size: 71 bytes, params: 2, frame: 12 var r0; let value = undefined; const canUseIncreasedGuildCap2 = (PremiumUtils).canUseIncreasedGuildCap(a0); if (canUseIncreasedGuildCap2) { r0 = canUseIncreasedGuildCap2; } else { value = (a0 == null ? value : a0.isStaff()) === true; r0 = value; } return r0; } function useShouldShowInlineGuildCapUpsell() { // fn#53637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:361, offset: 0x01352156, size: 158 bytes, params: 1, frame: 20 let useStateFromStores = FluxModule.useStateFromStores; const value2 = Reflect.apply(useStateFromStores, FluxModule, [[GuildStore], _fun53638]); useStateFromStores = FluxModule.useStateFromStores; let HotspotStore = (HotspotModule).HotspotStore; return value2 && Reflect.apply(useStateFromStores, FluxModule, [[HotspotStore], function() { var HotspotStore = require(dependencyMap[4]).HotspotStore; return HotspotStore.hasHotspot(require(dependencyMap[4]).HotspotLocations.GUILD_CAP_INLINE_UPSELL); }]) && FluxModule.useStateFromStoresObject([UserStore], function() { return !importDefault(dependencyMap[5]).isPremium(UserStore.getCurrentUser()); }); function _fun53638() { // fn#53638, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:444, offset: 0x013521f4, size: 26 bytes, params: 1, frame: 9 const value = environment.__proto__; return GuildStore.getGuildCount() >= 95; } } function hideInlineGuildCapUpsell() { // fn#53641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:741, offset: 0x01352285, size: 59 bytes, params: 1, frame: 14 const hideHotspot = HotspotModule.hideHotspot; const HotspotLocations = (HotspotModule).HotspotLocations; const GUILD_CAP_INLINE_UPSELL = HotspotLocations.GUILD_CAP_INLINE_UPSELL; Reflect.apply(hideHotspot, HotspotModule, [GUILD_CAP_INLINE_UPSELL]); } function isAtGuildCapAndNonPremium() { // fn#53642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7001:920, offset: 0x013522c0, size: 57 bytes, params: 1, frame: 12 var r0; var hasIncreasedGuildCapBinding; var value; const value3 = GuildStore.getGuildCount() >= MAX_USER_GUILDS; if (value3) { hasIncreasedGuildCapBinding = hasIncreasedGuildCap; value = UserStore.getCurrentUser(); value = !hasIncreasedGuildCapBinding(value); r0 = value; } else { r0 = value3; } return r0; } } global.__d(_fun53635, 6823, [1867, 1878, 661, 566, 6824, 3802, 2]) /* metro module 6823, dependencies: [1867, 1878, 661, 566, 6824, 3802, 2] */;