155 lines
7.8 KiB
TypeScript
155 lines
7.8 KiB
TypeScript
/* Metro module 15726; source: modules/holidays/HolidayEventsManager.tsx; dependencies: [6, 7, 15, 17, 18, 1220, 10757, 10758, 15727, 15730, 15731, 15732, 10759, 4860, 2] */
|
|
function _fun120771(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:6, offset: 0x02535317, size: 284 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(6) /* metro dependency 6 */;
|
|
const env0_4 = importDefault(7) /* metro dependency 7 */;
|
|
const env0_5 = importDefault(15) /* metro dependency 15 */;
|
|
const env0_6 = importDefault(17) /* metro dependency 17 */;
|
|
const env0_7 = importDefault(18) /* metro dependency 18 */;
|
|
const apexExperimentStore = importDefault(1220) /* metro dependency 1220: ApexExperimentStore */;
|
|
const soundpackStore = importDefault(10757) /* metro dependency 10757: SoundpackStore */;
|
|
const env0_10 = (require(10758) /* metro dependency 10758: Constants */).Soundpacks;
|
|
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
|
|
value = _fun120775(value);
|
|
value = new value();
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/holidays/HolidayEventsManager.tsx');
|
|
exports.default = value;
|
|
}
|
|
|
|
function _isNativeReflectConstruct_120772() { // fn#120772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:189, offset: 0x02535433, size: 98 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_120772_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun120775(a0) { // fn#120775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:392, offset: 0x02535495, size: 99 bytes, params: 2, frame: 16
|
|
const closure = HolidayEventsManager;
|
|
env0_7(closure, a0);
|
|
return env0_4(closure, [{key: 'updateSoundpack', value: value_120779}, {key: 'updateRingtone',
|
|
value: value_120780}]);
|
|
}
|
|
|
|
function HolidayEventsManager(a0) { // fn#120776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:404, offset: 0x025354f8, size: 220 bytes, params: 2, frame: 21
|
|
var r0;
|
|
var Reflect;
|
|
let value = copyRestArgs(0, undefined);
|
|
let binding = env1_3;
|
|
binding(this, HolidayEventsManager);
|
|
const items = [];
|
|
arraySpread(items, value, 0, items);
|
|
value = env1_6(HolidayEventsManager);
|
|
binding = env1_5;
|
|
if (_isNativeReflectConstruct_120772()) {
|
|
Reflect = global.Reflect;
|
|
value = Reflect.construct(value, items, env1_6(this).constructor);
|
|
r0 = value;
|
|
} else {
|
|
value = value.apply(this, items);
|
|
r0 = value;
|
|
}
|
|
value = binding(this, r0);
|
|
const Map = global.Map;
|
|
const value4 = Object.create(Map.prototype, {constructor: {value: Map}});
|
|
const map = new Map();
|
|
value.stores = (map instanceof Object ? map : value4).set(ApexExperimentStore, _fun120777);
|
|
value.actions = {NOTIFICATIONS_SET_DISABLED_SOUNDS: value.updateRingtone};
|
|
value.handleExperimentUpdated = handleExperimentUpdated;
|
|
return value;
|
|
}
|
|
|
|
function value_120779() { // fn#120779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:958, offset: 0x0253562b, size: 297 bytes, params: 1, frame: 20
|
|
var r1;
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
const soundpack = SoundpackStore.getSoundpack();
|
|
const lastSoundpackExperimentId = SoundpackStore.getLastSoundpackExperimentId();
|
|
const value4 = undefined;
|
|
const experiment = (importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).experiment;
|
|
const name = experiment == null ? value4 : experiment.definition.name;
|
|
const isEligible2 = (importDefault(15730) /* metro dependency 15730: HolidayEventsUtils */).isEligible();
|
|
if (isEligible2) {
|
|
r1 = isEligible2 && (importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).soundpack != null;
|
|
r1 = r1 && name !== lastSoundpackExperimentId;
|
|
r1 = r1 && soundpack !== (importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).soundpack;
|
|
if (r1) {
|
|
moduleValue2 = require(15731) /* metro dependency 15731: SoundpackActions */;
|
|
moduleValue2.setSoundpack((importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).soundpack,
|
|
|
|
name);
|
|
}
|
|
} else if (lastSoundpackExperimentId != null) {
|
|
moduleValue = require(15731) /* metro dependency 15731: SoundpackActions */;
|
|
moduleValue.setSoundpack(Soundpacks.CLASSIC, null);
|
|
} else if (soundpack === Soundpacks.CLASSIC) {
|
|
r1 = isEligible2 && (importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).soundpack != null;
|
|
r1 = r1 && name !== lastSoundpackExperimentId;
|
|
r1 = r1 && soundpack !== (importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).soundpack;
|
|
if (r1) {
|
|
moduleValue2 = require(15731) /* metro dependency 15731: SoundpackActions */;
|
|
moduleValue2.setSoundpack((importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).soundpack,
|
|
|
|
name);
|
|
}
|
|
} else {
|
|
moduleValue = require(15731) /* metro dependency 15731: SoundpackActions */;
|
|
moduleValue.setSoundpack(Soundpacks.CLASSIC, null);
|
|
}
|
|
return value4;
|
|
}
|
|
|
|
function value_120780() { // fn#120780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:1303, offset: 0x02535754, size: 187 bytes, params: 1, frame: 15
|
|
var value2;
|
|
let value = environment.__proto__;
|
|
const defaultImport = importDefault(15730) /* metro dependency 15730: HolidayEventsUtils */;
|
|
if (defaultImport.isEligible()) {
|
|
value2 = (importDefault(10759) /* metro dependency 10759: getSoundsForPack */)(SoundpackStore.getSoundpack());
|
|
if (value2.call_ringing != null) {
|
|
value = require(15732) /* metro dependency 15732: setIncomingRingtoneAndroid */;
|
|
value.setIncomingRingtone('call_ringing', value2.call_ringing + '.mp3');
|
|
}
|
|
} else {
|
|
(require(15732) /* metro dependency 15732: setIncomingRingtoneAndroid */).setIncomingRingtone('call_ringing',
|
|
'call_ringing.mp3');
|
|
}
|
|
}
|
|
|
|
function _fun120777() { // fn#120777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:676, offset: 0x025355d4, size: 19 bytes, params: 1, frame: 9
|
|
return env0_0.handleExperimentUpdated();
|
|
}
|
|
|
|
function handleExperimentUpdated() { // fn#120778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15934:799, owner: HolidayEventsManager.handleExperimentUpdated, offset: 0x025355e7, size: 68 bytes, params: 1, frame: 11
|
|
var binding;
|
|
if (!(importDefault(15727) /* metro dependency 15727: HolidayEventsConfig */).isDesktopOnly) {
|
|
binding = env0_0;
|
|
binding.updateSoundpack();
|
|
binding.updateRingtone();
|
|
}
|
|
}
|
|
|