decord/source/modules/sentry/SentryExperimentFeatureFlagManager.tsx

210 lines
6.2 KiB
TypeScript
Raw Normal View History

// Module ID: 17974
// Function ID: 17975
// Name: SentryExperimentFeatureFlagManager
// Dependencies: [4523, 1236, 4428, 1232, 7192, 2]
2026-07-23 10:11:24 +00:00
// Module 17974 (SentryExperimentFeatureFlagManager)
import SentryUtilsDefault from "SentryUtils" /* 1232 */;
import ExperimentStore from "ExperimentStore" /* 4523 */;
import ApexExperimentStore from "ApexExperimentStore" /* 1236 */;
import SelectedGuildStore from "SelectedGuildStore" /* 4428 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7192 */;
2026-07-20 16:05:17 +00:00
function isLikelyControl(registeredExperiments, variantId2) {
if (null == registeredExperiments) {
2026-07-20 16:05:17 +00:00
return true;
} else {
let tmp3 = null == tmp2;
if (!tmp3) {
const _JSON = JSON;
const _JSON2 = JSON;
const json = JSON.stringify(tmp2);
tmp3 = json === JSON.stringify(registeredExperiments.defaultConfig);
2026-07-20 16:05:17 +00:00
}
return tmp3;
}
}
function flushFlags(items, set) {
const sorted = items.sort();
2026-07-29 08:29:29 +00:00
const iter = items[Symbol.iterator]();
const nextResult = iter.next();
while (iter !== undefined) {
let tmp3 = nextResult;
let obj = SentryUtilsDefault;
2026-07-29 08:29:29 +00:00
let addFeatureFlagResult = obj.addFeatureFlag(nextResult, true);
if (set != null) {
let addResult = set.add(tmp3);
}
continue;
2026-07-20 16:05:17 +00:00
}
}
function syncAllExperimentFlags() {
2026-07-29 08:29:29 +00:00
(function resetGuildFlags() {
while (tmp2 !== undefined) {
let obj = SentryUtilsDefault;
2026-07-29 08:29:29 +00:00
let addFeatureFlagResult = obj.addFeatureFlag(tmp3, false);
continue;
}
set.clear();
2026-07-29 08:29:29 +00:00
})();
2026-07-20 16:05:17 +00:00
const items = [];
const items1 = [];
const items2 = [];
const items3 = [];
const guildId = SelectedGuildStore.getGuildId();
const allExperimentAssignments = ExperimentStore.getAllExperimentAssignments();
2026-07-29 08:29:29 +00:00
for (const key10027 in allExperimentAssignments) {
let tmp40 = allExperimentAssignments[key10027];
let tmp4 = null == tmp40;
if (!tmp4) {
tmp4 = tmp40 <= 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp4) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-29 08:29:29 +00:00
if (key10027.includes(":")) {
2026-07-20 16:05:17 +00:00
let startsWithResult = null != guildId;
if (startsWithResult) {
let _HermesInternal2 = HermesInternal;
2026-07-29 08:29:29 +00:00
startsWithResult = key10027.startsWith("" + guildId + ":");
2026-07-20 16:05:17 +00:00
}
if (!startsWithResult) {
continue;
} else {
let _HermesInternal3 = HermesInternal;
2026-07-29 08:29:29 +00:00
let arr = items1.push("" + key10027.split(":")[1] + ":" + tmp40);
2026-07-23 10:11:24 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
continue;
} else {
let _HermesInternal = HermesInternal;
let arr2 = items.push("" + key10027 + ":" + tmp40);
2026-07-23 10:11:24 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
continue;
}
continue;
}
let registeredExperiments = ApexExperimentStore.getRegisteredExperiments();
2026-07-29 08:29:29 +00:00
const tmp9 = (function getHashToName() {
const registeredExperiments = ApexExperimentStore.getRegisteredExperiments();
2026-07-29 08:29:29 +00:00
const obj = {};
for (const key10006 in registeredExperiments) {
obj[ApexExperimentStore.getHash(key10006)] = key10006;
2026-07-29 08:29:29 +00:00
continue;
}
return obj;
})();
const evaluatedExperiments = ApexExperimentStore.getState().evaluatedExperiments;
2026-07-29 08:29:29 +00:00
const items4 = ["user", "installation"];
for (const item10060 of items4) {
let tmp10 = item10060;
let tmp11;
if (evaluatedExperiments != null) {
tmp11 = evaluatedExperiments[tmp10];
}
for (const key10068 in tmp11) {
let tmp43 = evaluatedExperiments[tmp10];
let obj;
if (tmp43 != null) {
obj = tmp43[tmp41];
}
if (obj == null) {
obj = {};
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let assignments = obj.assignments;
let tmp15 = assignments;
2026-07-20 16:05:17 +00:00
let keys = Object.keys();
2026-07-29 08:29:29 +00:00
if (keys === undefined) {
continue;
} else {
let tmp18 = keys[tmp43];
while (tmp18 !== undefined) {
let tmp46 = tmp9[tmp18];
let tmp47 = tmp46;
if (null == tmp46) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-29 08:29:29 +00:00
let variantId = tmp15[tmp45].variantId;
let tmp21 = variantId;
if (null == variantId) {
continue;
} else {
let _HermesInternal4 = HermesInternal;
let combined = "" + tmp47 + ":" + tmp21;
let arr6 = items3;
if (isLikelyControl(registeredExperiments[tmp47], tmp21)) {
arr6 = items2;
2026-07-20 16:05:17 +00:00
}
let arr3 = arr6.push(combined);
2026-07-20 16:05:17 +00:00
continue;
}
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
continue;
}
}
2026-07-29 08:29:29 +00:00
continue;
}
continue;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const items5 = [];
const items6 = [];
2026-07-20 16:05:17 +00:00
if (null != guildId) {
2026-07-29 08:29:29 +00:00
let tmp28 = evaluatedExperiments == null;
let tmp29;
if (!tmp28) {
2026-07-20 16:05:17 +00:00
const guild = evaluatedExperiments.guild;
2026-07-29 08:29:29 +00:00
tmp28 = guild == null;
if (!tmp28) {
tmp29 = guild[guildId];
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (null != tmp29) {
for (const key10101 in tmp29.assignments) {
let tmp49 = tmp9[key10101];
if (null == tmp49) {
2026-07-20 16:05:17 +00:00
continue;
} else {
2026-07-29 08:29:29 +00:00
let variantId2 = tmp29.assignments[key10101].variantId;
2026-07-20 16:05:17 +00:00
if (null == variantId2) {
continue;
} else {
let _HermesInternal5 = HermesInternal;
2026-07-29 08:29:29 +00:00
let combined1 = "" + tmp49 + ":" + variantId2;
let arr9 = items6;
if (isLikelyControl(registeredExperiments[tmp49], variantId2)) {
arr9 = items5;
2026-07-20 16:05:17 +00:00
}
let arr4 = arr9.push(combined1);
2026-07-23 10:11:24 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
continue;
}
continue;
}
}
}
flushFlags(items);
flushFlags(items1, set);
flushFlags(items2);
flushFlags(items5, set);
2026-07-29 08:29:29 +00:00
flushFlags(items3);
flushFlags(items6, set);
2026-07-20 16:05:17 +00:00
}
const set = new Set();
const prototype = function SentryExperimentFeatureFlagManager() {
2026-07-29 08:29:29 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
const result = new Map().set(ExperimentStore, syncAllExperimentFlags);
const result1 = result.set(ApexExperimentStore, syncAllExperimentFlags);
applyArgumentsResult.stores = result1.set(SelectedGuildStore, syncAllExperimentFlags);
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
}.prototype;
class prototype extends tmp3 {
}
const prototype1 = new prototype();
const size = fn(2);
let result = size.fileFinishedImporting("modules/sentry/SentryExperimentFeatureFlagManager.tsx");
2026-07-20 16:05:17 +00:00
export default prototype1;