/* Metro module 12565; source: modules/notifications/HabitualDNDStore.tsx; dependencies: [6, 7, 15, 17, 18, 6876, 661, 672, 3829, 694, 566, 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 Dispatcher from '../../Dispatcher.tsx'; /* Metro dependency 694 */ import SelfPresenceStore from '../../stores/SelfPresenceStore.tsx'; /* Metro dependency 6876 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ function _fun96223(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:6, offset: 0x021583f2, size: 366 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let env0_10 = []; const PersistedStore = (Flux).PersistedStore; let value = _fun96229(PersistedStore); value.displayName = 'HabitualDNDStore'; value.persistKey = 'habitualDND'; value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {POST_CONNECTION_OPEN: POST_CONNECTION_OPEN_96235, HABITUAL_DND_CLEAR: function() { env0_11 = !!hasBeenUsingDND(); env0_10 = []; }}); (FileImportTrackerModule).fileFinishedImporting('modules/notifications/HabitualDNDStore.tsx'); exports.default = value; function _isNativeReflectConstruct_96224() { // fn#96224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:180, offset: 0x02158560, 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_96224_isNativeReflectConstruct = function() { return !!result; })(); } function hasBeenUsingDND() { // fn#96227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:387, offset: 0x021585c2, size: 48 bytes, params: 1, frame: 12 return env0_10.length >= 4 && env0_10.some(function(a0) { return a0 < global.Date.now() - 3 * importDefault(dependencyMap[7]).Millis.DAY; }); } function _fun96229(a0) { // fn#96229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:487, offset: 0x0215863c, size: 151 bytes, params: 2, frame: 16 const HabitualDNDStore2 = HabitualDNDStore; Inherits(HabitualDNDStore2, a0); return CreateClass(HabitualDNDStore2, [{key: 'initialize', value: function(a0) { this.waitFor(SelfPresenceStore); if (a0 != null && global.Array.isArray(a0.sessionStartsWithDND)) { env1_10 = a0.sessionStartsWithDND; } }}, {key: 'showNagBar', value: value_96232}, {key: 'getState', value: value_96233}, {key: 'getTemp', value: function() { var object = {}; var StatusExpiresAtSetting = require(dependencyMap[8]).StatusExpiresAtSetting; object.x = StatusExpiresAtSetting.getSetting(); return object; }}]); function HabitualDNDStore() { // fn#96230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:499, offset: 0x0108afcb, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_3(this, HabitualDNDStore); const value3 = env1_6(HabitualDNDStore); return env1_5(this, _isNativeReflectConstruct_96224() ? global.Reflect.construct(value3, arguments, env1_6(this).constructor) : value3.apply(this, arguments)); } function value_96232() { // fn#96232, offset: 0x00ef8482, size: 9 bytes, params: 1, frame: 1 return env1_11; } function value_96233() { // fn#96233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:970, offset: 0x0215871d, size: 16 bytes, params: 1, frame: 2 return {sessionStartsWithDND: env1_10}; } } function POST_CONNECTION_OPEN_96235() { // fn#96235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:1232, offset: 0x0215875e, size: 223 bytes, params: 1, frame: 17 var binding; var push; var Date; const status = SelfPresenceStore.getStatus(); const DND = StatusTypes.DND; if (status !== DND) { env0_10 = []; } else if ((require(3829) /* metro dependency 3829: UserSettings */).StatusExpiresAtSetting.getSetting() === '0') { binding = env0_10; push = binding.push; Date = global.Date; Reflect.apply(push, binding, [Date.now()]); binding = env0_10; env0_10 = binding.filter(function(a0) { return a0 > global.Date.now() - 5 * importDefault(dependencyMap[7]).Millis.DAY; }); if (hasBeenUsingDND()) { global.setTimeout(_fun96237, 15 * (importDefault(672) /* metro dependency 672: Durations */).Millis.SECOND); } } else { env0_10 = []; } function _fun96237() { // fn#96237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12755:1432, offset: 0x02158887, size: 49 bytes, params: 1, frame: 13 const value = environment.__proto__; (Dispatcher).dispatch({type: 'HABITUAL_DND_CLEAR'}); } } } global.__d(_fun96223, 12565, [6, 7, 15, 17, 18, 6876, 661, 672, 3829, 694, 566, 2]) /* metro module 12565, dependencies: [6, 7, 15, 17, 18, 6876, 661, 672, 3829, 694, 566, 2] */;