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

99 lines
5.2 KiB
TypeScript

/* Metro module 4045; source: modules/client_themes/native/MobileThemesUtils.tsx; dependencies: [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566, 2] */
import CustomThemeMobileStore from './CustomThemeMobileStore.tsx'; /* Metro dependency 1354 */
import MobileVisualRefreshExperiment from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
import SavedCustomThemeStore from '../SavedCustomThemeStore.tsx'; /* Metro dependency 4046 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as MobileVisualRefreshExperimentModule from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
import * as ClientThemesConstantsModule from '../ClientThemesConstants.tsx'; /* Metro dependency 3965 */
function _fun33363(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#33363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:6, offset: 0x0102d0e7, size: 250 bytes, params: 8, frame: 22
const env0_0 = require;
const getCustomThemesName = function() {
return require(dependencyMap[3]).intl.string(importDefault(dependencyMap[4]).yl1iMm);
};
const closure = function() {
var r0;
var object;
var value2 = CustomThemeMobileStore.getCustomThemeDisplaySettings();
if (value2 === undefined) {
r0 = null;
} else {
object = {};
object.type = require(dependencyMap[5]).ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
object.getName = getCustomThemesName;
object.theme = value2.baseTheme;
object.customThemeSettings = value2.customTheme;
r0 = object;
}
return r0;
};
const closure2 = function(a0) {
var r0;
var object;
var value2 = require(dependencyMap[6]).useCustomThemeDisplaySettings(a0);
if (value2 === undefined) {
r0 = null;
} else {
object = {};
object.type = require(dependencyMap[5]).ClientThemeType.CUSTOM_BACKGROUND_GRADIENT;
object.getName = getCustomThemesName;
object.theme = value2.baseTheme;
object.customThemeSettings = value2.customTheme;
r0 = object;
}
return r0;
};
const getMobileThemesArrayWithMaybeCustomTheme = function(a0, a1) {
var r5;
var r0;
var items;
var value3;
r5 = a1 ? REFRESH_STANDARD_BACKGROUND_THEMES : LEGACY_STANDARD_BACKGROUND_THEMES;
if (a0 != null) {
items = [];
value3 = arraySpread(items, r5, 0, r5);
items[value3] = a0;
arraySpread(items, BACKGROUND_GRADIENT_PRESETS_MOBILE, value3 + 1, r5);
r0 = items;
} else {
items = [];
arraySpread(items, BACKGROUND_GRADIENT_PRESETS_MOBILE, arraySpread(items, r5, 0, r5), r5);
r0 = items;
}
return r0;
};
const useSavedCustomTheme2 = useSavedCustomTheme;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/client_themes/native/MobileThemesUtils.tsx');
exports.getCustomBackgroundGradient = closure;
exports.useCustomBackgroundGradient = closure2;
exports.getAllMobileThemes = getAllMobileThemes;
exports.useAllMobileThemes = useAllMobileThemes;
exports.useSavedCustomTheme = useSavedCustomTheme2;
function useSavedCustomTheme() { // fn#33368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:953, offset: 0x0102d362, size: 69 bytes, params: 1, frame: 13
const savedCustomTheme = (require(566) /* metro dependency 566: flux */).useStateFromStores([SavedCustomThemeStore],
function() {
return SavedCustomThemeStore.getSavedCustomTheme();
});
const value = null;
return value != savedCustomTheme ? savedCustomTheme : value;
}
function getAllMobileThemes() { // fn#33370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1295, offset: 0x0102d3bc, size: 62 bytes, params: 1, frame: 15
const getMobileThemesArrayWithMaybeCustomThemeBinding = getMobileThemesArrayWithMaybeCustomTheme;
const customBackgroundGradient = getCustomBackgroundGradient();
return getMobileThemesArrayWithMaybeCustomThemeBinding(customBackgroundGradient,
MobileVisualRefreshExperimentModule.isMobileVisualRefreshEnabled('MobileThemesUtils'));
}
function useAllMobileThemes() { // fn#33371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4203:1484, offset: 0x0102d3fa, size: 65 bytes, params: 1, frame: 15
return getMobileThemesArrayWithMaybeCustomTheme(useCustomBackgroundGradient(useSavedCustomTheme()),
(MobileVisualRefreshExperiment)('MobileThemesUtils'));
}
}
global.__d(_fun33363, 4045, [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566,
2]) /* metro module 4045, dependencies: [4046, 1354, 3965, 1244, 2422, 3966, 4047, 1357, 566, 2] */;