Files
2026-07-28 01:06:53 +03:00

71 lines
4.5 KiB
TypeScript

/* Metro module 8063; source: modules/applications/utils/ApplicationInstallUtils.tsx; dependencies: [7861, 5066, 8042, 2] */
import ApplicationCommandIndexStore from '../../application_commands/ApplicationCommandIndexStore.tsx'; /* Metro dependency 7861 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ApplicationCommandConstantsModule from '../../application_commands/ApplicationCommandConstants.tsx'; /* Metro dependency 5066 */
function _fun64013(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#64013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:6, offset: 0x01b993f5, size: 160 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = function({customInstallUrl, installParams, integrationTypesConfig}) {
var r0;
var r1;
var value = customInstallUrl != null;
r0 = value || installParams != null;
if (!r0) {
value = integrationTypesConfig != null;
if (value) {
value = global.Object.values(integrationTypesConfig);
value = value.some(_fun64015);
r1 = value;
} else {
r1 = value;
}
r0 = r1;
}
return r0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/applications/utils/ApplicationInstallUtils.tsx');
exports.canInstallApplication = closure;
exports.isAppUserInstallable = isAppUserInstallable;
exports.shouldInstallApplicationOnDemand = shouldInstallApplicationOnDemand;
function canInstallApplication({customInstallUrl, installParams, integrationTypesConfig}) { // fn#64014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:133, offset: 0x01b99495, size: 85 bytes, params: 2, frame: 13
var r1;
let value = customInstallUrl != null;
let r0 = value || installParams != null;
if (!r0) {
value = integrationTypesConfig != null;
if (value) {
value = global.Object.values(integrationTypesConfig);
value = value.some(function(a0) {
var value = undefined;
return (a0 == null ? value : a0.oauth2_install_params) != null || (a0 == null ? value : a0.oauth2InstallParams) != null;
});
r1 = value;
} else {
r1 = value;
}
r0 = r1;
}
return r0;
}
function isAppUserInstallable({customInstallUrl, installParams, integrationTypesConfig}) { // fn#64016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:539, offset: 0x01b9951a, size: 102 bytes, params: 2, frame: 14
return canInstallApplication({customInstallUrl: customInstallUrl, installParams: installParams,
integrationTypesConfig: integrationTypesConfig}) && integrationTypesConfig != null && (require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType.USER_INSTALL in integrationTypesConfig;
}
function shouldInstallApplicationOnDemand({applicationId, channel, commandIntegrationTypes}) { // fn#64017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:823, offset: 0x01b99580, size: 188 bytes, params: 2, frame: 17
return !(commandIntegrationTypes != null && !commandIntegrationTypes.includes((require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType.USER_INSTALL)) && (!(applicationId === BuiltInSectionId.BUILT_IN) && (!ApplicationCommandIndexStore.hasUserStateApplication(applicationId) && (channel == null || !ApplicationCommandIndexStore.hasContextStateApplication({applicationId: applicationId,
channelId: channel.id, guildId: channel.guild_id}))));
}
}
function _fun64015(a0) { // fn#64015, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8241:284, offset: 0x01b994ea, size: 48 bytes, params: 2, frame: 5
const value = undefined;
return (a0 == null ? value : a0.oauth2_install_params) != null || (a0 == null ? value : a0.oauth2InstallParams) != null;
}
global.__d(_fun64013, 8063, [7861, 5066, 8042, 2]) /* metro module 8063, dependencies: [7861, 5066, 8042, 2] */;