/* Metro module 9706; source: modules/self_mod/ChannelSafetyWarningsStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 672, 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 Durations from '../../utils/Durations.tsx'; /* Metro dependency 672 */ import ChannelStore from '../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ function _fun76269(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:6, offset: 0x01dc8f05, size: 557 bytes, params: 8, frame: 24 const CONNECTION_OPEN_762752 = CONNECTION_OPEN_76275; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const Millis = (Durations).Millis; const SECOND = Millis.SECOND; const env0_6 = 5 * SECOND; object = {STRANGER_DANGER: 1}; object[1] = 'STRANGER_DANGER'; object.INAPPROPRIATE_CONVERSATION_TIER_1 = 2; object[2] = 'INAPPROPRIATE_CONVERSATION_TIER_1'; object.INAPPROPRIATE_CONVERSATION_TIER_2 = 3; object[3] = 'INAPPROPRIATE_CONVERSATION_TIER_2'; object.LIKELY_ATO = 4; object[4] = 'LIKELY_ATO'; const object2 = {UPVOTE: 0}; object2[0] = 'UPVOTE'; object2.DOWNVOTE = 1; object2[1] = 'DOWNVOTE'; const env0_8 = []; const env0_9 = {}; const Set = global.Set; let set = new Set(); const Store = (Flux).Store; set = _fun76277(Store); set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CHANNEL_CREATE: function(a0) { processChannel_76273(a0.channel); }, CHANNEL_DELETE: CHANNEL_DELETE_76285, CHANNEL_UPDATES: function({channels}) { channels.forEach(_fun76287); }, CONNECTION_OPEN: CONNECTION_OPEN_762752, CONNECTION_OPEN_SUPPLEMENTAL: CONNECTION_OPEN_762752, CHANNEL_SAFETY_WARNING_FEEDBACK: CHANNEL_SAFETY_WARNING_FEEDBACK, CLEAR_CHANNEL_SAFETY_WARNINGS: CLEAR_CHANNEL_SAFETY_WARNINGS, DISMISS_CHANNEL_SAFETY_WARNINGS: DISMISS_CHANNEL_SAFETY_WARNINGS, ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP: ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP}); (FileImportTrackerModule).fileFinishedImporting('modules/self_mod/ChannelSafetyWarningsStore.tsx'); exports.default = set; exports.SafetyWarningTypes = object; exports.SafetyWarningFeedbackTypes = object2; function _isNativeReflectConstruct_76270() { // fn#76270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:158, offset: 0x01dc9132, 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_76270_isNativeReflectConstruct = function() { return !!result; })(); } function processChannel_76273(a0) { // fn#76273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:733, offset: 0x01dc9194, size: 150 bytes, params: 2, frame: 14 var binding; var id; var value2; const safetyWarnings = a0.safetyWarnings; if (safetyWarnings != null) { binding = env0_9; binding[a0.id] = safetyWarnings; value2 = safetyWarnings.some(_fun76274); binding = env0_10; if (value2) { binding.add(a0.id); } else { binding.delete(a0.id); } } if (safetyWarnings == null) { binding = env0_9; id = a0.id; if (binding[id] != null) { delete env0_9[a0.id]; } binding = env0_10; id = a0.id; binding.delete(id); } function _fun76274(a0) { // fn#76274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:811, offset: 0x01dc922a, size: 141 bytes, params: 2, frame: 14 var dismiss_timestamp; var Date; var value5; var date; var time; const type = a0.type; const value = environment.__proto__; const INAPPROPRIATE_CONVERSATION_TIER_1 = env1_7.INAPPROPRIATE_CONVERSATION_TIER_1; let r0 = (type === INAPPROPRIATE_CONVERSATION_TIER_1 || a0.type === env1_7.INAPPROPRIATE_CONVERSATION_TIER_2) && a0.dismiss_timestamp != null; if (r0) { dismiss_timestamp = a0.dismiss_timestamp; Date = global.Date; value5 = Object.create(Date.prototype, {constructor: {value: Date}}); date = new Date(); time = (date instanceof Object ? date : value5).getTime(); Date = global.Date; r0 = !(time > Date.now() - env1_6); } return r0; } } function CONNECTION_OPEN_76275() { // fn#76275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1172, offset: 0x01dc92b7, size: 64 bytes, params: 1, frame: 12 env0_9 = {}; const Object = global.Object; const values = Object.values; const channelStoreBinding = ChannelStore; const getMutablePrivateChannels = channelStoreBinding.getMutablePrivateChannels; Reflect.apply(values, Object, [Reflect.apply(getMutablePrivateChannels, channelStoreBinding, [])]).forEach(function(a0) { processChannel_76273(a0); }); } function _fun76277(a0) { // fn#76277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1294, offset: 0x01dc930a, size: 149 bytes, params: 2, frame: 16 const ChannelSafetyWarningsStore2 = ChannelSafetyWarningsStore; Inherits(ChannelSafetyWarningsStore2, a0); return CreateClass(ChannelSafetyWarningsStore2, [{key: 'initialize', value: function() { this.waitFor(ChannelStore); }}, {key: 'getChannelSafetyWarning', value: value_76280}, {key: 'getChannelSafetyWarnings', value: value_76282}, {key: 'hasShownInitialTooltipForChannel', value: value_76283}]); function ChannelSafetyWarningsStore() { // fn#76278, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1306, offset: 0x010a3f4a, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_0(this, ChannelSafetyWarningsStore); const value3 = env1_3(ChannelSafetyWarningsStore); return env1_2(this, _isNativeReflectConstruct_76270() ? global.Reflect.construct(value3, arguments, env1_3(this).constructor) : value3.apply(this, arguments)); } function value_76280(a0, a1) { // fn#76280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1720, offset: 0x01dc939f, size: 54 bytes, params: 3, frame: 12 var environment; const env0_0 = a1; const value = environment.__proto__; return env1_9[a0]?.find(function({id}) { return id === require; }); } function value_76282(a0) { // fn#76282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1831, offset: 0x016b63d0, size: 26 bytes, params: 2, frame: 3 return env1_9[a0] ?? env1_8; } function value_76283(a0) { // fn#76283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:1923, offset: 0x01087f80, size: 22 bytes, params: 2, frame: 11 return env1_10.has(a0); } } function CHANNEL_DELETE_76285({channel}) { // fn#76285, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2077, offset: 0x01dc93ed, size: 66 bytes, params: 2, frame: 12 if (env0_9[channel.id] != null) { delete env0_9[channel.id]; } env0_10.delete(channel.id); } function CHANNEL_UPDATES_76286({channels}) { // fn#76286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2187, offset: 0x01dc942f, size: 32 bytes, params: 2, frame: 11 channels.forEach(function(a0) { processChannel_76273(a0); }); function _fun76287(a0) { // fn#76287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2240, offset: 0x01dc92f7, size: 19 bytes, params: 2, frame: 11 processChannel_76273(a0); } } function CHANNEL_SAFETY_WARNING_FEEDBACK({channelId, warningId, feedbackType}) { // fn#76288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2385, offset: 0x01dc944f, size: 76 bytes, params: 2, frame: 13 const property = env0_9[channelId]; if (property != null) { env0_9[channelId] = property.map(function(a0) { var r0; var object; var value = a0; var id = value.id; if (id !== warningId) { r0 = value; } else { object = {}; copyDataProperties(object, value, id); object['feedback_type'] = feedbackType; r0 = object; } return r0; }); } } function CLEAR_CHANNEL_SAFETY_WARNINGS({channelId}) { // fn#76290, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2575, offset: 0x01dc94cf, size: 70 bytes, params: 2, frame: 13 const property = env0_9[channelId]; env0_10.delete(channelId); if (property != null) { env0_9[channelId] = property.map(function(a0) { var r2; var object = {}; copyDataProperties(object, a0, r2); object['dismiss_timestamp'] = undefined; return object; }); } } function DISMISS_CHANNEL_SAFETY_WARNINGS({channelId, warningIds}) { // fn#76292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2750, offset: 0x01dc952e, size: 112 bytes, params: 2, frame: 15 var Date; var value2; var date; var env0_1; const property = env0_9[channelId]; if (property != null) { Date = global.Date; value2 = Object.create(Date.prototype, {constructor: {value: Date}}); date = new Date(); env0_1 = (date instanceof Object ? date : value2).toISOString(); env0_9[channelId] = property.map(_fun76293); } function _fun76293(a0) { // fn#76293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2888, offset: 0x01dc959e, size: 61 bytes, params: 2, frame: 14 var r0; var object; const value = a0; const warningIdsBinding = warningIds; if (warningIdsBinding.includes(value.id)) { object = {}; copyDataProperties(object, value, warningIdsBinding); object['dismiss_timestamp'] = env0_1; r0 = object; } else { r0 = value; } return r0; } } function ACKNOWLEDGE_CHANNEL_SAFETY_WARNING_TOOLTIP({channelId}) { // fn#76294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9892:2984, offset: 0x01dc95db, size: 29 bytes, params: 2, frame: 11 env0_10.add(channelId); } } global.__d(_fun76269, 9706, [6, 7, 15, 17, 18, 1379, 672, 566, 694, 2]) /* metro module 9706, dependencies: [6, 7, 15, 17, 18, 1379, 672, 566, 694, 2] */;