205 lines
13 KiB
TypeScript
205 lines
13 KiB
TypeScript
/* Metro module 10907; source: stores/NotificationSettingsStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 477, 566, 694, 2] */
|
|
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 * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
|
|
|
|
function _fun83546(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:6, offset: 0x01f1e4fb, size: 545 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const NOTIFICATIONS_SET_DESKTOP_TYPE2 = NOTIFICATIONS_SET_DESKTOP_TYPE;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ConstantsModule;
|
|
const DesktopNotificationTypes = value.DesktopNotificationTypes;
|
|
const env0_8 = value.NotificationPermissionTypes;
|
|
const TTSNotificationTypes = value.TTSNotificationTypes;
|
|
object = {'desktopType': null, 'disableAllSounds': false, 'disabledSounds': null, 'ttsType': null,
|
|
'disableUnreadBadge': false, 'taskbarFlash': true, 'notifyMessagesInSelectedChannel': false,
|
|
'screenDowntimeReminder': true};
|
|
object.desktopType = (require(477) /* metro dependency 477: PlatformUtils */).isPlatformEmbedded ? DesktopNotificationTypes.ALL : DesktopNotificationTypes.NEVER;
|
|
object.disabledSounds = [];
|
|
const NEVER = TTSNotificationTypes.NEVER;
|
|
object.ttsType = NEVER;
|
|
const DeviceSettingsStore = (Flux).DeviceSettingsStore;
|
|
value = _fun83551(DeviceSettingsStore);
|
|
value.displayName = 'NotificationSettingsStore';
|
|
value.persistKey = 'notifications';
|
|
value.migrations = [_fun83564];
|
|
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
|
|
{NOTIFICATIONS_SET_DESKTOP_TYPE: NOTIFICATIONS_SET_DESKTOP_TYPE2,
|
|
NOTIFICATIONS_SET_TTS_TYPE: NOTIFICATIONS_SET_TTS_TYPE,
|
|
NOTIFICATIONS_SET_DISABLED_SOUNDS: NOTIFICATIONS_SET_DISABLED_SOUNDS,
|
|
NOTIFICATIONS_TOGGLE_ALL_DISABLED: NOTIFICATIONS_TOGGLE_ALL_DISABLED,
|
|
NOTIFICATIONS_SET_PERMISSION_STATE: function({enabled}) {
|
|
if (enabled === NotificationPermissionTypes.BLOCKED) {
|
|
NOTIFICATIONS_SET_DESKTOP_TYPE({desktopType: DesktopNotificationTypes.NEVER});
|
|
} else if (enabled === NotificationPermissionTypes.ENABLED) {
|
|
NOTIFICATIONS_SET_DESKTOP_TYPE({desktopType: DesktopNotificationTypes.ALL});
|
|
}
|
|
}, NOTIFICATIONS_SET_DISABLE_UNREAD_BADGE: NOTIFICATIONS_SET_DISABLE_UNREAD_BADGE,
|
|
NOTIFICATIONS_SET_TASKBAR_FLASH: NOTIFICATIONS_SET_TASKBAR_FLASH,
|
|
NOTIFICATIONS_SET_NOTIFY_MESSAGES_IN_SELECTED_CHANNEL: NOTIFICATIONS_SET_NOTIFY_MESSAGES_IN_SELECTED_CHANNEL,
|
|
NOTIFICATIONS_SET_SCREEN_DOWNTIME_REMINDER: NOTIFICATIONS_SET_SCREEN_DOWNTIME_REMINDER});
|
|
(FileImportTrackerModule).fileFinishedImporting('stores/NotificationSettingsStore.tsx');
|
|
exports.default = value;
|
|
function _isNativeReflectConstruct_83547() { // fn#83547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:244, offset: 0x01f1e71c, 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_83547_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_DESKTOP_TYPE({desktopType}) { // fn#83550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:655, offset: 0x01f1e77e, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.desktopType = desktopType;
|
|
}
|
|
|
|
function _fun83551(a0) { // fn#83551, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:724, offset: 0x01f1e798, size: 334 bytes, params: 2, frame: 16
|
|
const NotificationSettingsStore2 = NotificationSettingsStore;
|
|
Inherits(NotificationSettingsStore2, a0);
|
|
return CreateClass(NotificationSettingsStore2, [{key: 'initialize', value: value_83553}, {key: 'getUserAgnosticState',
|
|
value: value_83554}, {key: 'getDesktopType', value: value_83555}, {key: 'getTTSType', value: value_83556},
|
|
{key: 'getDisabledSounds', value: value_83557}, {key: 'getDisableAllSounds', value: value_83558},
|
|
{key: 'getDisableUnreadBadge', value: value_83559}, {key: 'getNotifyMessagesInSelectedChannel',
|
|
value: value_83560}, {key: 'taskbarFlash', get: get_83561}, {key: 'screenDowntimeReminder', get: get_83562},
|
|
{key: 'isSoundDisabled', value: value_83563}]);
|
|
function NotificationSettingsStore() { // fn#83552, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:736, offset: 0x00de700a, size: 113 bytes, params: 1, frame: 20
|
|
const value = environment.__proto__;
|
|
env1_2(this, NotificationSettingsStore);
|
|
const value3 = env1_5(NotificationSettingsStore);
|
|
return env1_4(this, _isNativeReflectConstruct_83547() ? global.Reflect.construct(value3, arguments,
|
|
env1_5(this).constructor) : value3.apply(this, arguments));
|
|
}
|
|
|
|
function value_83553(a0) { // fn#83553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1079, offset: 0x01f1e8e6, size: 34 bytes, params: 2, frame: 12
|
|
const object = {};
|
|
copyDataProperties(object, a0, copyDataProperties(object, env1_10, undefined));
|
|
}
|
|
|
|
function value_83554() { // fn#83554, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1
|
|
return env1_11;
|
|
}
|
|
|
|
function value_83555() { // fn#83555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1191, offset: 0x01f1e908, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.desktopType;
|
|
}
|
|
|
|
function value_83556() { // fn#83556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1249, offset: 0x01f1e917, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.ttsType;
|
|
}
|
|
|
|
function value_83557() { // fn#83557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1310, offset: 0x01f1e926, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.disabledSounds;
|
|
}
|
|
|
|
function value_83558() { // fn#83558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1380, offset: 0x01f1e935, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.disableAllSounds;
|
|
}
|
|
|
|
function value_83559() { // fn#83559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1454, offset: 0x01f1e944, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.disableUnreadBadge;
|
|
}
|
|
|
|
function value_83560() { // fn#83560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1543, offset: 0x01f1e953, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.notifyMessagesInSelectedChannel;
|
|
}
|
|
|
|
function get_83561() { // fn#83561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1621, offset: 0x01f1e962, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.taskbarFlash;
|
|
}
|
|
|
|
function get_83562() { // fn#83562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1690, offset: 0x01f1e971, size: 15 bytes, params: 1, frame: 1
|
|
return env1_11.screenDowntimeReminder;
|
|
}
|
|
|
|
function value_83563(a0) { // fn#83563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1764, offset: 0x01f1e980, size: 52 bytes, params: 2, frame: 12
|
|
var r0;
|
|
let value = environment.__proto__;
|
|
const disableAllSounds = env1_11.disableAllSounds;
|
|
if (disableAllSounds) {
|
|
r0 = disableAllSounds;
|
|
} else {
|
|
value = env1_11.disabledSounds.indexOf(a0);
|
|
value = value !== -1;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun83564(a0) { // fn#83564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:1955, offset: 0x01f1e9b4, size: 173 bytes, params: 2, frame: 14
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object.disabledSounds = object.disabledSounds || [];
|
|
let disableUnreadBadge = object.disableUnreadBadge;
|
|
disableUnreadBadge = !!disableUnreadBadge && disableUnreadBadge;
|
|
object.disableUnreadBadge = disableUnreadBadge;
|
|
object.taskbarFlash = object.taskbarFlash == null || object.taskbarFlash;
|
|
object.ttsType = object.ttsType || TTSNotificationTypes.NEVER;
|
|
if (object.desktopType == null) {
|
|
object.desktopType = (require(477) /* metro dependency 477: PlatformUtils */).isPlatformEmbedded ? DesktopNotificationTypes.ALL : DesktopNotificationTypes.NEVER;
|
|
}
|
|
return object;
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_TTS_TYPE({ttsType}) { // fn#83565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:2326, offset: 0x01f1ea61, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.ttsType = ttsType;
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_DISABLED_SOUNDS({sounds}) { // fn#83566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:2412, offset: 0x01f1ea7b, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.disabledSounds = sounds;
|
|
}
|
|
|
|
function NOTIFICATIONS_TOGGLE_ALL_DISABLED() { // fn#83567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:2511, offset: 0x01f1ea95, size: 26 bytes, params: 1, frame: 2
|
|
const binding = env0_11;
|
|
binding.disableAllSounds = !binding.disableAllSounds;
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_DISABLE_UNREAD_BADGE({disableUnreadBadge}) { // fn#83569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:2822, offset: 0x01f1eb14, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.disableUnreadBadge = disableUnreadBadge;
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_TASKBAR_FLASH({taskbarFlash}) { // fn#83570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:2939, offset: 0x01f1eb2e, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.taskbarFlash = taskbarFlash;
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_NOTIFY_MESSAGES_IN_SELECTED_CHANNEL({notify}) { // fn#83571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:3060, offset: 0x01f1eb48, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.notifyMessagesInSelectedChannel = notify;
|
|
}
|
|
|
|
function NOTIFICATIONS_SET_SCREEN_DOWNTIME_REMINDER({screenDowntimeReminder}) { // fn#83572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11093:3202, offset: 0x01f1eb62, size: 26 bytes, params: 2, frame: 2
|
|
env0_11.screenDowntimeReminder = screenDowntimeReminder;
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun83546, 10907, [6, 7, 15, 17, 18, 661, 477, 566, 694,
|
|
2]) /* metro module 10907, dependencies: [6, 7, 15, 17, 18, 661, 477, 566, 694, 2] */;
|