143 lines
7.3 KiB
TypeScript
143 lines
7.3 KiB
TypeScript
/* Metro module 1949; source: modules/user_settings/LocaleStore.tsx; dependencies: [6, 7, 15, 17, 18, 5, 1950, 1348, 3767, 1244, 566, 694, 2] */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import Flux from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
import UserSettingsProtoStore from './UserSettingsProtoStore.tsx'; /* Metro dependency 1348 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as IndexNativeModule from '../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as IntlLoaderStoreModule from '../../intl/IntlLoaderStore.tsx'; /* Metro dependency 1950 */
|
|
|
|
function _fun21718(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#21718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:6, offset: 0x00ef7ff1, size: 435 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const OVERLAY_INITIALIZE_217262 = OVERLAY_INITIALIZE_21726;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let env0_11 = (IndexNativeModule).intl.currentLocale;
|
|
let env0_12 = (IndexNativeModule).systemLocale;
|
|
(function() {
|
|
return _getSystemLocale.apply(this, arguments);
|
|
})().then(function(a0) {
|
|
env0_12 = a0;
|
|
});
|
|
const Store = (Flux).Store;
|
|
_fun21729(Store).displayName = 'LocaleStore';
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{OVERLAY_INITIALIZE: OVERLAY_INITIALIZE_217262, CACHE_LOADED: OVERLAY_INITIALIZE_217262,
|
|
CONNECTION_OPEN: OVERLAY_INITIALIZE_217262, USER_SETTINGS_PROTO_UPDATE: OVERLAY_INITIALIZE_217262,
|
|
USER_SETTINGS_LOCALE_OVERRIDE: function({locale}) {
|
|
env0_11 = locale;
|
|
setAppLocale(locale);
|
|
}});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/user_settings/LocaleStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_21719() { // fn#21719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:191, offset: 0x00ef81a4, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_21719_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _getSystemLocale() { // fn#21722, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:384, offset: 0x00ef8202, size: 48 bytes, params: 1, frame: 14
|
|
return Module00005(_fun21724).apply(this, arguments);
|
|
function* _fun21724() { // fn#21724, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:439, offset: 0x00ef823b, size: 198 bytes, params: 1, frame: 16
|
|
var environment;
|
|
var getPreferredSystemLanguages;
|
|
var app;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = environment.__proto__.__proto__;
|
|
const binding = env2_1;
|
|
const value3 = undefined;
|
|
if (binding(env2_2[8]) == null) {
|
|
getPreferredSystemLanguages = value3;
|
|
} else {
|
|
app = env2_1(env2_2[8]).app;
|
|
getPreferredSystemLanguages = app == null ? value3 : app.getPreferredSystemLanguages;
|
|
}
|
|
if (getPreferredSystemLanguages != null) {
|
|
var preferredSystemLanguages = env2_1(env2_2[8]).app.getPreferredSystemLanguages();
|
|
yield preferredSystemLanguages.then(function(a0) {
|
|
return a0[0];
|
|
});
|
|
var value6 = undefined;
|
|
if (false) {
|
|
return value6;
|
|
}
|
|
if (value6 == null) {
|
|
return env2_0(env2_2[9]).systemLocale;
|
|
}
|
|
if (value6 !== '') {
|
|
return value6;
|
|
}
|
|
}
|
|
return env2_0(env2_2[9]).systemLocale;
|
|
}
|
|
|
|
}
|
|
|
|
function CACHE_LOADED_21726() { // fn#21726, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:751, offset: 0x00ef8301, size: 98 bytes, params: 1, frame: 14
|
|
const localization = UserSettingsProtoStore.settings.localization;
|
|
const r2 = localization == null || localization.locale == null ? undefined : localization.locale.value;
|
|
let r0 = r2 != null && r2 !== '' && r2 !== currentLocale;
|
|
if (r0) {
|
|
setAppLocale(r2);
|
|
r0 = true;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun21729(a0) { // fn#21729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:996, offset: 0x00ef8371, size: 114 bytes, params: 2, frame: 16
|
|
const LocaleStore2 = LocaleStore;
|
|
Inherits(LocaleStore2, a0);
|
|
return CreateClass(LocaleStore2, [{key: 'initialize', value: function() {
|
|
this.waitFor(UserSettingsProtoStore);
|
|
OVERLAY_INITIALIZE_21726();
|
|
setAppLocale(currentLocale);
|
|
}}, {key: 'locale', get: function() {
|
|
return currentLocale;
|
|
}}, {key: 'systemLocale', get: function() {
|
|
return systemLocale;
|
|
}}]);
|
|
function LocaleStore() { // fn#21730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:2076:1008, offset: 0x00ef83e3, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_3(this, LocaleStore);
|
|
const value3 = env1_6(LocaleStore);
|
|
return env1_5(this, _isNativeReflectConstruct_21719() ? global.Reflect.construct(value3, arguments,
|
|
env1_6(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun21718, 1949, [6, 7, 15, 17, 18, 5, 1950, 1348, 3767, 1244, 566, 694,
|
|
2]) /* metro module 1949, dependencies: [6, 7, 15, 17, 18, 5, 1950, 1348, 3767, 1244, 566, 694, 2] */;
|