decord/source/modules/app_analytics/clickstream/Clickstream.tsx

87 lines
2.8 KiB
TypeScript
Raw Normal View History

// Module ID: 7465
// Function ID: 7466
2026-07-29 08:29:29 +00:00
// Name: isClickstreamEnabled
// Dependencies: [32, 502, 4583, 11, 7466, 1242, 7467, 2]
2026-07-20 16:05:17 +00:00
// Exports: trackClickstream
// Module 7465 (isClickstreamEnabled)
2026-08-24 06:08:38 +00:00
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import expandEventPropertiesDefault from "expandEventProperties" /* 1242 */;
import clickstreamExperimentEnabled from "clickstreamExperimentEnabled" /* 7466 */;
import getClickstreamDrainEvent from "getClickstreamDrainEvent" /* 7467 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "fetchFingerprint" /* 502 */;
import closure_5 from "createRTCConnection" /* 4583 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function isClickstreamEnabled(flag) {
if (flag === undefined) {
flag = true;
}
if (flag) {
2026-08-24 06:08:38 +00:00
const extractTimestampResult = DISCORD_EPOCHDefault.extractTimestamp(store.getId());
2026-07-23 10:11:24 +00:00
if (extractTimestampResult !== c7) {
2026-07-20 16:05:17 +00:00
drainClickstream(false);
2026-07-23 10:11:24 +00:00
c7 = extractTimestampResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const obj = DISCORD_EPOCHDefault;
closure_8 = clickstreamExperimentEnabled.clickstreamExperimentEnabled();
const obj2 = clickstreamExperimentEnabled;
2026-07-20 16:05:17 +00:00
}
return closure_8;
}
function drainClickstream(flag) {
if (flag === undefined) {
flag = true;
}
if (isClickstreamEnabled(flag)) {
2026-07-29 08:29:29 +00:00
const tmp3 = obj[Symbol.iterator]();
while (tmp3 !== undefined) {
let tmp7 = callback;
let tmp8 = callback(tmp5, 2);
let first = tmp8[0];
let tmp10 = importDefault;
let tmp11 = dependencyMap;
2026-08-24 06:08:38 +00:00
let obj2 = expandEventPropertiesDefault;
2026-07-29 08:29:29 +00:00
let tmp12 = require;
2026-08-24 06:08:38 +00:00
let obj3 = getClickstreamDrainEvent;
2026-07-29 08:29:29 +00:00
let trackResult = obj2.track(first, obj3.getClickstreamDrainEvent(first, tmp8[1]));
continue;
2026-07-20 16:05:17 +00:00
}
map.clear();
} else {
2026-07-29 08:29:29 +00:00
obj.clear();
2026-07-20 16:05:17 +00:00
}
}
const map = new Map();
2026-07-23 10:11:24 +00:00
let c7 = -1;
let c8 = false;
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/app_analytics/clickstream/Clickstream.tsx");
2026-07-20 16:05:17 +00:00
export const trackClickstream = function trackClickstream(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM, arg1) {
2026-08-24 06:08:38 +00:00
let obj = DISCORD_EPOCHDefault;
2026-07-29 08:29:29 +00:00
const extractTimestampResult = obj.extractTimestamp(store.getId());
if (extractTimestampResult !== c7) {
drainClickstream(false);
c7 = extractTimestampResult;
}
2026-08-24 06:08:38 +00:00
const result = clickstreamExperimentEnabled.clickstreamExperimentEnabled();
c8 = result;
2026-07-29 08:29:29 +00:00
if (result) {
if (!map.has(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM)) {
const result1 = obj3.set(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM, []);
2026-07-20 16:05:17 +00:00
}
const value = obj3.get(CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM);
2026-07-29 08:29:29 +00:00
if (value != null) {
obj = { timestamp: null, rtc_state: null };
2026-07-20 16:05:17 +00:00
const _Date = Date;
const date = new Date();
2026-07-29 08:29:29 +00:00
obj[0] = date;
obj[1] = state.getState();
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg1);
value.push(obj);
}
}
};
export { drainClickstream };