decord/source/modules/media_viewer/MediaViewerAnalyticsManager.tsx
2026-08-27 16:17:25 +00:00

121 lines
5.3 KiB
TypeScript

// Module ID: 8502
// Function ID: 8503
// Name: IncrementableMediaViewerActions
// Dependencies: [1391, 676, 644, 698, 2]
// Module 8502 (IncrementableMediaViewerActions)
import expandEventPropertiesDefault from "expandEventProperties" /* 698 */;
import closure_2 from "ensureGuildLoaded" /* 1391 */;
import ME from "ME" /* 676 */;
import keys from "keys" /* 644 */;
({ AnalyticEvents: c3, AnalyticsSections: c4 } = ME);
let obj = { VIEWER_SWIPE: "number_viewer_swipes", THUMBNAIL_SWIPE: "number_thumbnail_swipes", SELECTED_ITEM_CHANGE: "number_selected_item_changes", ZOOM_IN_BUTTON_PRESSED: "number_zoom_in_button_pressed", ZOOM_IN_IMAGE_PRESSED: "number_zoom_in_image_pressed", ZOOM_OUT_BUTTON_PRESSED: "number_zoom_out_button_pressed", ZOOM_OUT_IMAGE_PRESSED: "number_zoom_out_image_pressed", FORWARD_PRESSED: "number_forward_button_pressed", SAVE_MEDIA_PRESSED: "number_save_media_button_pressed", OPEN_LINK_PRESSED: "number_open_link_button_pressed", MORE_BUTTON_PRESSED: "number_more_button_pressed", COPY_IMAGE_PRESSED: "number_copy_image_more_menu_pressed", COPY_LINK_PRESSED: "number_copy_link_more_menu_pressed", CONTEXT_MENU_OPENED: "number_context_menu_opened" };
obj = { guildId: "disabled", channelId: "isArray", channelType: "isArray", numMediaItems: "Array", hasMediaOptions: "call", source: "<string:858849553>", incrementableActions: "<string:858993459>" };
const values = Object.values(obj);
obj[6] = Object.fromEntries(values.map((arg0) => {
const items = [arg0, 0];
return items;
}));
let closure_6 = keys.create(() => obj);
obj = {
markSessionStarted(channelId) {
channel = channel.getChannel(channelId.channelId);
obj = expandEventPropertiesDefault;
obj = { type: constants2.MEDIA_VIEWER, source: channelId.source, channel_id: channelId.channelId, channel_type: null, guild_id: null };
let type;
if (channel != null) {
type = channel.type;
}
obj[3] = type;
let guild_id;
if (channel != null) {
guild_id = channel.guild_id;
}
obj[4] = guild_id;
obj.track(constants.OPEN_MODAL, obj);
obj = {};
const merged = Object.assign(obj);
const merged1 = Object.assign(channelId);
obj.channelId = channelId.channelId;
let type1;
if (channel != null) {
type1 = channel.type;
}
obj.channelType = type1;
let guild_id1;
if (channel != null) {
guild_id1 = channel.guild_id;
}
obj.guildId = guild_id1;
store.setState(obj);
},
markSessionCompleted() {
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { source: state.source, guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType, number_media_items: state.numMediaItems, has_media_options: state.hasMediaOptions };
const merged = Object.assign(state.incrementableActions);
obj.track(constants.MEDIA_VIEWER_SESSION_COMPLETED, obj);
obj = {};
const merged1 = Object.assign(obj);
store.setState(obj);
},
markActionPerformed(SELECTED_ITEM_CHANGE) {
closure_0 = SELECTED_ITEM_CHANGE;
store.setState((incrementableActions) => {
obj = { incrementableActions: null };
obj = {};
const merged = Object.assign(incrementableActions.incrementableActions);
obj[closure_0] = incrementableActions.incrementableActions[closure_0] + 1;
obj[0] = obj;
return obj;
});
},
trackMediaViewerImageSaved(arg0) {
({ url, success } = arg0);
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { url, success, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_IMAGE_SAVED, obj);
},
trackMediaViewerImageCopied(arg0) {
({ url, success } = arg0);
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { url, success, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_IMAGE_COPIED, obj);
},
trackMediaViewerLinkCopied(arg0) {
({ href, success } = arg0);
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { href, success, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_LINK_COPIED, obj);
},
trackMediaViewerLinkOpened(href) {
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { href: href.href, channel_id: state.channelId };
obj.track(constants.MEDIA_VIEWER_LINK_OPENED, obj);
},
trackMediaViewerDownloadButtonTapped() {
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType };
obj.track(constants.MEDIA_VIEWER_DOWNLOAD_BUTTON_TAPPED, obj);
},
trackMediaViewerShareButtonTapped() {
const state = store.getState();
obj = expandEventPropertiesDefault;
obj = { guild_id: state.guildId, channel_id: state.channelId, channel_type: state.channelType };
obj.track(constants.MEDIA_VIEWER_SHARE_BUTTON_TAPPED, obj);
},
trackMessageEmbedsActionCompleted(arg0) {
({ platform, action, error } = arg0);
expandEventPropertiesDefault.track(constants.MESSAGE_EMBEDS_ACTION_COMPLETED, { platform, error, action });
}
};
const result = require("set").fileFinishedImporting("modules/media_viewer/MediaViewerAnalyticsManager.tsx");
export const IncrementableMediaViewerActions = obj;
export const MediaViewerAnalytics = obj;