/* Metro module 9838; source: modules/reactions/native/MessageReactions.tsx; dependencies: [31, 4814, 33, 566, 6771, 6789, 9839, 2] */ import MessageStore from '../../../stores/MessageStore.tsx'; /* Metro dependency 4814 */ import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */ import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as UseAnalyticsLocationsModule from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */ function _fun77076(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10024:6, offset: 0x01deff6e, size: 166 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_6 = []; (FileImportTrackerModule).fileFinishedImporting('modules/reactions/native/MessageReactions.tsx'); exports.default = _default_77077; function _default_77077(a0) { // fn#77077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10024:150, offset: 0x01df0014, size: 379 bytes, params: 2, frame: 26 var r4; const channelId = a0.channelId; const messageId = a0.messageId; const emoji = a0.emoji; const reactions = a0.reactions; let isSelectedBurst = a0.isSelectedBurst; isSelectedBurst = !(isSelectedBurst === undefined) && isSelectedBurst; const object = {'channelId': 0, 'messageId': 0, 'emoji': 0, 'reactions': 0, 'isSelectedBurst': 0}; silentSetPrototypeOf(object, null, undefined); let value = copyDataProperties({}, a0, object, undefined); const defaultImport = UseAnalyticsLocations; const MESSAGE_REACTIONS = (AnalyticsLocation).MESSAGE_REACTIONS; const analyticsLocations = defaultImport(MESSAGE_REACTIONS).analyticsLocations; const value3 = useMessageReactions(channelId, messageId); const r14 = reactions == null ? value3 : reactions.length > 0 ? reactions : value3; const items2 = []; r14.forEach(_fun77082); items2.sort(function(a0, a1) { return (a1.burst_count > 0 ? a1.burst_count : a1.count) - (a0.burst_count > 0 ? a0.burst_count : a0.count); }); const AnalyticsLocationProvider = (UseAnalyticsLocationsModule).AnalyticsLocationProvider; if (items2.length > 0) { const MessageReactionsContent = (require(9839) /* metro dependency 9839: MessageReactionsContent */).MessageReactionsContent; value = ( ); r4 = value; } else { const MessageReactionsEmpty = (require(9839) /* metro dependency 9839: MessageReactionsContent */).MessageReactionsEmpty; r4 = ; } return ( {r4} ); function useMessageReactions(a0, a1) { // fn#77078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10024:288, owner: _default_77077.useMessageReactions, offset: 0x01df018f, size: 120 bytes, params: 3, frame: 18 const env0_0 = a0; const env0_1 = a1; return env1_3.useMemo(_fun77080, [(FluxModule).useStateFromStores([MessageStore], _fun77079, [a0, a1])]); function _fun77079() { // fn#77079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10024:360, offset: 0x01df0207, size: 50 bytes, params: 1, frame: 14 const message = MessageStore.getMessage(env0_0, require); return message != null ? message.reactions : env2_6; } function _fun77080() { // fn#77080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10024:445, offset: 0x01df0239, size: 28 bytes, params: 1, frame: 11 return env0_2.filter(function({count_details}) { return count_details?.vote == null; }); } } function _fun77082(a0) { // fn#77082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10024:588, offset: 0x01df0275, size: 132 bytes, params: 2, frame: 16 var binding; var push; var object; if (a0.burst_count > 0) { if (a0.count > 0) { binding = env0_0; push = binding.push; object = {}; copyDataProperties(object, a0, undefined); object['count'] = 0; Reflect.apply(push, binding, [object]); binding = env0_0; push = binding.push; object = {}; copyDataProperties(object, a0, 'count'); object['burst_count'] = 0; Reflect.apply(push, binding, [object]); } else { binding = env0_0; push = binding.push; object = {}; copyDataProperties(object, a0, undefined); Reflect.apply(push, binding, [object]); } } else { binding = env0_0; push = binding.push; object = {}; copyDataProperties(object, a0, undefined); Reflect.apply(push, binding, [object]); } } } } global.__d(_fun77076, 9838, [31, 4814, 33, 566, 6771, 6789, 9839, 2]) /* metro module 9838, dependencies: [31, 4814, 33, 566, 6771, 6789, 9839, 2] */;