decord/alpha/source/modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx

128 lines
6.4 KiB
TypeScript
Raw Normal View History

2026-10-12 06:59:38 +00:00
// Module ID: 15100
// Function ID: 15101
// Name: FamilyCenterControlledSettingsUtils
2026-10-12 06:59:38 +00:00
// Dependencies: [1209, 15097, 7000, 6997, 2]
2026-07-29 08:29:29 +00:00
// Exports: isSetAndNotDefault, resolveExplicitContentSettingWithDefaultsForTeen, updateExplicitContentSetting, updateGoreContentSetting
2026-07-20 16:05:17 +00:00
2026-10-12 06:59:38 +00:00
// Module 15100 (FamilyCenterControlledSettingsUtils)
2026-10-08 09:57:35 +00:00
import preloaded_user_settings from "preloaded_user_settings" /* 1209 */;
2026-10-12 06:59:38 +00:00
import SensitiveMediaExplicitRedactionSettingsUtils from "SensitiveMediaExplicitRedactionSettingsUtils" /* 6997 */;
import SensitiveMediaGoreRedactionSettingsUtils from "SensitiveMediaGoreRedactionSettingsUtils" /* 7000 */;
import ParentalControlledUserSettings from "ParentalControlledUserSettings" /* 15097 */;
import size from "module_2" /* 2 */;
2026-08-24 06:08:38 +00:00
2026-07-20 16:05:17 +00:00
function getGoreContentSettingOrDefault(arg0) {
2026-10-03 08:58:59 +00:00
let goreContentFriendDm;
let goreContentNonFriendDm;
const ParentalControlledGoreContent = ParentalControlledUserSettings.ParentalControlledGoreContent;
2026-07-20 16:05:17 +00:00
let controlledSetting = ParentalControlledGoreContent.getControlledSetting(arg0);
2026-07-29 08:29:29 +00:00
if (controlledSetting == null) {
2026-07-20 16:05:17 +00:00
controlledSetting = {};
}
({ goreContentNonFriendDm, goreContentFriendDm } = controlledSetting);
2026-10-03 08:58:59 +00:00
const tmp3 = null != goreContentNonFriendDm && goreContentNonFriendDm !== preloaded_user_settings.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
2026-07-29 08:29:29 +00:00
if (!tmp3) {
2026-10-03 08:58:59 +00:00
const tmpResult = SensitiveMediaGoreRedactionSettingsUtils;
goreContentNonFriendDm = tmpResult.resolveGoreSettingWithDefaultsForTeen({ isDm: true });
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const obj = { goreContentNonFriendDm, goreContentFriendDm, goreContentGuilds: preloaded_user_settings.ExplicitContentRedaction.BLUR };
const tmp4 = null != goreContentFriendDm && goreContentFriendDm !== preloaded_user_settings.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
2026-07-29 08:29:29 +00:00
if (!tmp4) {
2026-10-03 08:58:59 +00:00
const tmpResult2 = SensitiveMediaGoreRedactionSettingsUtils;
goreContentFriendDm = tmpResult2.resolveGoreSettingWithDefaultsForTeen({ isDm: true, isFriend: true });
2026-07-20 16:05:17 +00:00
}
return obj;
}
2026-07-29 08:29:29 +00:00
function getExplicitContentSettingOrDefault(teenId) {
2026-10-03 08:58:59 +00:00
let isFriend;
let prop;
let prop1;
let setting;
const ParentalControlledExplicitContent = ParentalControlledUserSettings.ParentalControlledExplicitContent;
2026-07-29 08:29:29 +00:00
const controlledSetting = ParentalControlledExplicitContent.getControlledSetting(teenId);
2026-10-03 08:58:59 +00:00
const obj = { teenId, setting: prop };
prop = undefined;
2026-07-29 08:29:29 +00:00
if (controlledSetting != null) {
prop = controlledSetting.explicitContentNonFriendDm;
}
({ setting, isFriend, teenId } = obj);
2026-07-20 16:05:17 +00:00
if (isFriend === undefined) {
isFriend = false;
}
2026-10-03 08:58:59 +00:00
const tmp5 = null != setting && setting !== preloaded_user_settings.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
if (!tmp5) {
let tmp8;
2026-10-12 06:59:38 +00:00
const ParentalControlledLegacyExplicitContent = tmp(15097).ParentalControlledLegacyExplicitContent;
2026-10-03 08:58:59 +00:00
const controlledSetting1 = ParentalControlledLegacyExplicitContent.getControlledSetting(teenId);
const tmpResult = SensitiveMediaExplicitRedactionSettingsUtils;
2026-07-20 16:05:17 +00:00
if (isFriend) {
2026-10-03 08:58:59 +00:00
tmp8 = tmpResult.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting1];
} else {
tmp8 = tmpResult.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_NON_FRIEND_DM[controlledSetting1];
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
setting = tmp8;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const obj2 = { explicitContentNonFriendDm: setting, explicitContentFriendDm: prop1, explicitContentGuilds: preloaded_user_settings.ExplicitContentRedaction.BLUR };
prop1 = undefined;
if (controlledSetting != null) {
prop1 = controlledSetting.explicitContentFriendDm;
}
const tmp10 = null != prop1 && prop1 !== preloaded_user_settings.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
if (!tmp10) {
2026-10-12 06:59:38 +00:00
const ParentalControlledLegacyExplicitContent2 = tmp(15097).ParentalControlledLegacyExplicitContent;
2026-10-03 08:58:59 +00:00
const controlledSetting2 = ParentalControlledLegacyExplicitContent2.getControlledSetting(teenId);
2026-10-12 06:59:38 +00:00
prop1 = tmp(6997).TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting2];
2026-10-03 08:58:59 +00:00
}
return obj2;
2026-07-20 16:05:17 +00:00
}
let result = size.fileFinishedImporting("modules/parent_tools/FamilyCenterControlledSettingsUtils.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const isSetAndNotDefault = function isSetAndNotDefault(goreContentFriendDm) {
2026-10-03 08:58:59 +00:00
const tmp = null != goreContentFriendDm && goreContentFriendDm !== preloaded_user_settings.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
2026-07-29 08:29:29 +00:00
return tmp;
};
2026-07-20 16:05:17 +00:00
export { getGoreContentSettingOrDefault };
export const updateGoreContentSetting = function updateGoreContentSetting(selectedTeenId, arg1) {
2026-10-03 08:58:59 +00:00
const tmp = getGoreContentSettingOrDefault(selectedTeenId);
const ParentalControlledGoreContent = ParentalControlledUserSettings.ParentalControlledGoreContent;
2026-10-03 08:58:59 +00:00
const updateControlledSetting = ParentalControlledGoreContent.updateControlledSetting;
const obj = {};
const merged = Object.assign(tmp);
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(arg1);
2026-10-03 08:58:59 +00:00
const result = updateControlledSetting(selectedTeenId, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const resolveExplicitContentSettingWithDefaultsForTeen = function resolveExplicitContentSettingWithDefaultsForTeen(teenId) {
2026-10-03 08:58:59 +00:00
let isFriend;
let setting;
2026-07-29 08:29:29 +00:00
({ setting, isFriend } = teenId);
2026-10-03 08:58:59 +00:00
teenId = teenId.teenId;
2026-07-29 08:29:29 +00:00
if (isFriend === undefined) {
isFriend = false;
}
2026-10-03 08:58:59 +00:00
const tmp = null != setting && setting !== preloaded_user_settings.ExplicitContentRedaction.UNSET_EXPLICIT_CONTENT_REDACTION;
2026-07-29 08:29:29 +00:00
if (tmp) {
return setting;
} else {
2026-10-03 08:58:59 +00:00
let tmp8;
const ParentalControlledLegacyExplicitContent = ParentalControlledUserSettings.ParentalControlledLegacyExplicitContent;
2026-10-03 08:58:59 +00:00
const controlledSetting = ParentalControlledLegacyExplicitContent.getControlledSetting(teenId);
const tmp7 = SensitiveMediaExplicitRedactionSettingsUtils;
2026-07-29 08:29:29 +00:00
if (isFriend) {
2026-10-03 08:58:59 +00:00
tmp8 = tmp7.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_FRIEND_DM[controlledSetting];
2026-07-29 08:29:29 +00:00
} else {
tmp8 = tmp7.TEEN_EXPLICIT_CONTENT_FILTER_TO_EXPLICIT_CONTENT_REDACTION_NON_FRIEND_DM[controlledSetting];
}
return tmp8;
}
};
2026-07-20 16:05:17 +00:00
export { getExplicitContentSettingOrDefault };
export const updateExplicitContentSetting = function updateExplicitContentSetting(selectedTeenId, arg1) {
2026-10-03 08:58:59 +00:00
const tmp = getExplicitContentSettingOrDefault(selectedTeenId);
const ParentalControlledExplicitContent = ParentalControlledUserSettings.ParentalControlledExplicitContent;
2026-10-03 08:58:59 +00:00
const updateControlledSetting = ParentalControlledExplicitContent.updateControlledSetting;
const obj = {};
const merged = Object.assign(tmp);
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(arg1);
2026-10-03 08:58:59 +00:00
const result = updateControlledSetting(selectedTeenId, obj);
2026-07-20 16:05:17 +00:00
};