This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,58 @@
// Metro module 5724 (f5725).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import RTCConnectionStore from "../../../stores/RTCConnectionStore";
import SnowflakeUtils from "../../../utils/SnowflakeUtils";
import { clickstreamExperimentEnabled } from "./ClickstreamExperiment";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { getClickstreamDrainEvent } from "./ClickstreamEvents";
let c3552_6, c3552_7, c3552_8, drainClickstream;
const isClickstreamEnabled = function isClickstreamEnabled(r3 = true) {
if (r3) {
const r12 = SnowflakeUtils.extractTimestamp(AuthenticationStore.getId());
if (r12 !== c3552_7) {
drainClickstream(false);
c3552_7 = r12;
}
c3552_8 = clickstreamExperimentEnabled();
}
return c3552_8;
};
drainClickstream = function drainClickstream(r4 = true) {
if (isClickstreamEnabled(r4)) {
for (const item of c3552_6) {
const r33 = _slicedToArray(item, 2);
const r8 = r33[0];
AnalyticsUtils.track(r8, getClickstreamDrainEvent(r8, r33[1]));
}
c3552_6.clear();
} else {
c3552_6.clear();
}
};
c3552_6 = new Map();
c3552_7 = -1;
c3552_8 = false;
export function trackClickstream(a0, a1) {
const r15 = SnowflakeUtils.extractTimestamp(AuthenticationStore.getId());
if (r15 !== c3552_7) {
drainClickstream(false);
c3552_7 = r15;
}
const r23 = clickstreamExperimentEnabled();
c3552_8 = r23;
if (r23) {
if (!c3552_6.has(a0)) {
c3552_6.set(a0, []);
}
const r32 = c3552_6.get(a0);
if (r32 != null) {
r32.push({
timestamp: new Date(),
rtc_state: RTCConnectionStore.getState(),
...a1
});
}
}
}
export { drainClickstream };
@@ -0,0 +1,40 @@
// Metro module 5726 (f5727).
import { AnalyticEvents } from "../../../Constants";
export function getClickstreamDrainEvent(a0, a1) {
let c15063_0 = new Date();
if (AnalyticEvents.GUILD_VIEWED_CLICKSTREAM === a0) {
return {
time_minus: a1.map((item) => c15063_0.getTime() - item.timestamp.getTime()),
rtc_states: a1.map((item) => item.rtc_state),
guild_ids: a1.map((item) => item.guild_id)
};
}
if (AnalyticEvents.FRIENDS_LIST_VIEWED_CLICKSTREAM === a0) {
return {
time_minus: a1.map((item) => c15063_0.getTime() - item.timestamp.getTime()),
rtc_states: a1.map((item) => item.rtc_state),
tab_opened: a1.map((item) => item.tab_opened),
num_friends: a1.map((item) => item.num_friends),
now_playing_visible: a1.map((item) => item.now_playing_visible),
now_playing_num_cards: a1.map((item) => item.now_playing_num_cards)
};
}
if (AnalyticEvents.CHANNEL_OPENED_CLICKSTREAM === a0) {
return {
time_minus: a1.map((item) => c15063_0.getTime() - item.timestamp.getTime()),
rtc_states: a1.map((item) => item.rtc_state),
channel_ids: a1.map((item) => item.channel_id),
channel_types: a1.map((item) => item.channel_type)
};
}
if (AnalyticEvents.CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM === a0) {
return {
time_minus: a1.map((item) => c15063_0.getTime() - item.timestamp.getTime()),
rtc_states: a1.map((item) => item.rtc_state),
load_duration_ms: a1.map((item) => item.load_duration_ms),
were_messages_cached: a1.map((item) => item.were_messages_cached),
is_first_load: a1.map((item) => item.is_first_load)
};
}
throw new Error(`getClickstreamDrainEvent: Unknown event: ${a0}`);
}
@@ -0,0 +1,19 @@
// Metro module 5725 (f5726).
import { createApexExperiment } from "../../experiments/apex/index";
const apexExperiment = createApexExperiment({
name: "2026-06-clickstream-analytics",
kind: "user",
defaultConfig: {
enabled: false
},
variations: {
1: {
enabled: true
}
}
});
export function clickstreamExperimentEnabled() {
return apexExperiment.getConfig({
location: "clickstream"
}).enabled;
}