/* Metro module 15680; source: modules/self_mod/ChannelSafetyWarningsManager.tsx; dependencies: [7, 6, 15, 17, 18, 1379, 1934, 9702, 9730, 15681, 4860, 2] */ function _fun120310(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15888:6, offset: 0x0252792c, size: 280 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_2 = importDefault(7) /* metro dependency 7 */; const env0_3 = importDefault(6) /* metro dependency 6 */; const env0_4 = importDefault(15) /* metro dependency 15 */; const env0_5 = importDefault(17) /* metro dependency 17 */; const env0_6 = importDefault(18) /* metro dependency 18 */; const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */; let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */; value = _fun120317(value); value = new value(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/self_mod/ChannelSafetyWarningsManager.tsx'); exports.default = value; } function _isNativeReflectConstruct_120311() { // fn#120311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15888:168, offset: 0x02527a44, 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_120311_isNativeReflectConstruct = function() { return !!result; })(); } function handleChannelSelect_120314({channelId}) { // fn#120314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15888:361, offset: 0x02527aa6, size: 262 bytes, params: 2, frame: 16 var r0; var moduleValue2; var channel; var inappropriateConversationTakeoverForChannel; var value4; var showTakeoverModal; if (channelId != null) { var value; var moduleValue = require(9702) /* metro dependency 9702: SelfModInappropriateConversationExperiment */; var isEligibleForInappropriateConversationWarning = moduleValue.isEligibleForInappropriateConversationWarning; var object2 = {location: 'channel_select'}; if (Reflect.apply(isEligibleForInappropriateConversationWarning, moduleValue, [object2])) { moduleValue2 = require(9730) /* metro dependency 9730: InappropriateConversationUtils */; if (moduleValue2.getSafetyAlertsSettingOrDefault()) { channel = ChannelStore.getChannel(channelId); if (channel == null) { return false; } if (channel.isDM()) { inappropriateConversationTakeoverForChannel = (require(9730) /* metro dependency 9730: InappropriateConversationUtils */).getInappropriateConversationTakeoverForChannel(channelId); value4 = inappropriateConversationTakeoverForChannel != null; if (value4) { value = require(15681) /* metro dependency 15681: showTakeoverModalNative */; showTakeoverModal = value.showTakeoverModal; object2 = {}; object2.warningId = inappropriateConversationTakeoverForChannel.id; object2.warningType = inappropriateConversationTakeoverForChannel.type; object2.senderId = channel.getRecipientId(); object2.channelId = channelId; Reflect.apply(showTakeoverModal, value, [object2]); value = true; r0 = value; } else { r0 = value4; } return r0; } return false; } return false; } } return false; } function handleChannelUpdates_120315({channels}) { // fn#120315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15888:817, offset: 0x02527bac, size: 305 bytes, params: 2, frame: 16 var r2; var r0; var moduleValue2; var value3; var moduleValue3; var getInappropriateConversationTakeoverForChannel; var id; var value4; var showTakeoverModal; var value; const selfModInappropriateConversationExperimentModule = require(9702) /* metro dependency 9702: SelfModInappropriateConversationExperiment */; const isEligibleForInappropriateConversationWarning = selfModInappropriateConversationExperimentModule.isEligibleForInappropriateConversationWarning; let object2 = {location: 'channel_updates'}; if (Reflect.apply(isEligibleForInappropriateConversationWarning, selfModInappropriateConversationExperimentModule, [object2])) { moduleValue2 = require(9730) /* metro dependency 9730: InappropriateConversationUtils */; if (moduleValue2.getSafetyAlertsSettingOrDefault()) { if (SelectedChannelStore.getCurrentlySelectedChannelId() == null) { return false; } value3 = channels.find(_fun120316); if (value3 == null) { return false; } moduleValue3 = require(9730) /* metro dependency 9730: InappropriateConversationUtils */; getInappropriateConversationTakeoverForChannel = moduleValue3.getInappropriateConversationTakeoverForChannel; id = value3.id; value4 = Reflect.apply(getInappropriateConversationTakeoverForChannel, moduleValue3, [id]); r2 = value4 == null || !value3.isDM(); if (r2) { r0 = !r2; } else { value = require(15681) /* metro dependency 15681: showTakeoverModalNative */; showTakeoverModal = value.showTakeoverModal; object2 = {}; id = value4.id; object2.warningId = id; object2.warningType = value4.type; object2.senderId = value3.getRecipientId(); id = value3.id; object2.channelId = id; Reflect.apply(showTakeoverModal, value, [object2]); value = true; r0 = value; } return r0; } } return false; } function _fun120317(a0) { // fn#120317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15888:1338, offset: 0x02527cdd, size: 42 bytes, params: 2, frame: 14 const closure = ChannelSafetyWarningsManager; env0_6(closure, a0); return env0_2(closure); } function ChannelSafetyWarningsManager(a0) { // fn#120318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15888:1350, offset: 0x02527d07, size: 152 bytes, params: 2, frame: 20 var r0; var Reflect; let value = copyRestArgs(0, undefined); let binding = env1_3; binding(this, ChannelSafetyWarningsManager); const items = []; arraySpread(items, value, 0, items); value = env1_5(ChannelSafetyWarningsManager); binding = env1_4; if (_isNativeReflectConstruct_120311()) { Reflect = global.Reflect; value = Reflect.construct(value, items, env1_5(this).constructor); r0 = value; } else { value = value.apply(this, items); r0 = value; } value = binding(this, r0); value.actions = {CHANNEL_SELECT: handleChannelSelect_120314, CHANNEL_UPDATES: handleChannelUpdates_120315}; return value; }