93 lines
6.2 KiB
TypeScript
93 lines
6.2 KiB
TypeScript
/* Metro module 8579; source: modules/emoji_picker/analytics/trackOnEmojiPickerOpened.tsx; dependencies: [31, 6540, 1379, 1934, 661, 1881, 1346, 8537, 8538, 4863, 3801, 2] */
|
|
function _fun67859(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:6, offset: 0x01c35678, size: 252 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const closure = trackOnEmojiPickerOpened;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const env0_7 = (require(661) /* metro dependency 661: Constants */).AnalyticEvents;
|
|
const env0_8 = (require(1881) /* metro dependency 1881: EmojiConstants */).EmojiIntention;
|
|
const env0_9 = (require(1346) /* metro dependency 1346: ExpressionPickerConstants */).ExpressionPickerViewType;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/emoji_picker/analytics/trackOnEmojiPickerOpened.tsx');
|
|
exports.default = closure;
|
|
exports.useTrackOnEmojiPickerOpenedForReactions = useTrackOnEmojiPickerOpenedForReactions;
|
|
}
|
|
|
|
function trackOnEmojiPickerOpened({intention, containerWidth, rowSize, isBurstReaction, analyticsObject}) { // fn#67860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:221, offset: 0x01c35774, size: 948 bytes, params: 2, frame: 31
|
|
const getChannel = ChannelStore.getChannel;
|
|
const getChannelId = SelectedChannelStore.getChannelId;
|
|
const value2 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getChannelId, SelectedChannelStore, [])]);
|
|
const guildId = value2?.getGuildId();
|
|
let REACTION = EmojiIntention.REACTION;
|
|
const r11 = intention === REACTION ? EmojiStore.emojiReactionFrecencyWithoutFetchingLatest.frequently.slice() : EmojiStore.emojiFrecencyWithoutFetchingLatest.frequently.slice();
|
|
const r21 = value2 != null ? EmojiStore.getDisambiguatedEmojiContext(value2.getGuildId()).favoriteEmojisWithoutFetchingLatest : [];
|
|
REACTION = EmojiIntention.REACTION;
|
|
const value7 = r11.slice(0,
|
|
intention === REACTION ? EmojiStore.emojiReactionFrecencyWithoutFetchingLatest.numFrequentlyItems : EmojiStore.emojiFrecencyWithoutFetchingLatest.numFrequentlyItems);
|
|
const r13 = guildId != null ? EmojiStore.getGuildEmoji(guildId) : [];
|
|
const getDisambiguatedEmojiContext = EmojiStore.getDisambiguatedEmojiContext;
|
|
const customEmoji = Reflect.apply(getDisambiguatedEmojiContext, EmojiStore, [value2?.getGuildId()]).getCustomEmoji();
|
|
const {topEmojis,
|
|
newlyAddedEmojis} = (require(8537) /* metro dependency 8537: useTopAndNewlyAddedEmojis */).getTopAndNewlyAddedEmojis({guildId: value2?.getGuildId(),
|
|
pickerIntention: intention});
|
|
const {visibleTopEmojis,
|
|
visibleNewlyAddedEmojis} = (require(8538) /* metro dependency 8538: useEmojiHotrail */).getEmojiHotrail({topEmojis: topEmojis,
|
|
newlyAddedEmojis: newlyAddedEmojis, rowSize: rowSize});
|
|
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
|
|
const trackWithMetadata = defaultImport.trackWithMetadata;
|
|
REACTION = EmojiIntention.REACTION;
|
|
const r2 = intention === REACTION ? AnalyticEvents.REACTION_PICKER_OPENED : AnalyticEvents.EXPRESSION_PICKER_OPENED;
|
|
const object2 = {width: containerWidth};
|
|
const EMOJI = ExpressionPickerViewType.EMOJI;
|
|
object2.tab = EMOJI;
|
|
object2.badged = false;
|
|
object2.num_expressions_favorites = r21.length;
|
|
object2.num_animated_expressions_favorites = r21.filter(function(a0) {
|
|
return a0?.animated;
|
|
}).length;
|
|
object2.num_custom_expressions_favorites = r21.filter((importDefault(3801) /* metro dependency 3801: EmojiUtils */).isCustomEmoji).length;
|
|
object2.num_standard_expressions_favorites = r21.filter(function(a0) {
|
|
return a0.id == null;
|
|
}).length;
|
|
object2.num_expressions_frecent = value7.length;
|
|
object2.num_animated_expressions_frecent = value7.filter(function(a0) {
|
|
return a0?.animated;
|
|
}).length;
|
|
object2.num_custom_expressions_frecent = value7.filter((importDefault(3801) /* metro dependency 3801: EmojiUtils */).isCustomEmoji).length;
|
|
object2.num_standard_expressions_frecent = value7.filter(function(a0) {
|
|
return a0.id == null;
|
|
}).length;
|
|
object2.num_current_guild_expressions = r13.length;
|
|
object2.num_custom_expressions_total = customEmoji.size;
|
|
object2.num_expressions_top_server = visibleTopEmojis.length;
|
|
object2.num_animated_expressions_top_server = visibleTopEmojis.filter(function(a0) {
|
|
return a0.animated;
|
|
}).length;
|
|
object2.num_expressions_newly_added = visibleNewlyAddedEmojis.length;
|
|
object2.num_animated_expressions_newly_added = visibleNewlyAddedEmojis.filter(function(a0) {
|
|
return a0.animated;
|
|
}).length;
|
|
REACTION = EmojiIntention.REACTION;
|
|
copyDataProperties(object2, intention === REACTION && ({is_burst: isBurstReaction}), r21);
|
|
copyDataProperties(object2, analyticsObject != null && ({location_object: analyticsObject}), r21);
|
|
Reflect.apply(trackWithMetadata, defaultImport, [r2, object2]);
|
|
}
|
|
|
|
function useTrackOnEmojiPickerOpenedForReactions(a0) { // fn#67867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:2307, offset: 0x01c35b4e, size: 52 bytes, params: 2, frame: 13
|
|
const binding = env0_3;
|
|
const env0_0 = binding.useRef(a0);
|
|
binding.useEffect(_fun67868, []);
|
|
}
|
|
|
|
function _fun67868() { // fn#67868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8764:2390, offset: 0x01c35b82, size: 59 bytes, params: 1, frame: 12
|
|
const intention = env0_0.current.intention;
|
|
const REACTION = EmojiIntention.REACTION;
|
|
if (intention === REACTION) {
|
|
trackOnEmojiPickerOpened(env0_0.current);
|
|
}
|
|
}
|
|
|