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,88 @@
// Metro module 13856 (f13857).
import { ExplicitContentFilterTypes } from "../privacy_and_safety/DMSafetyConstants";
import { AllFriendSourceFlags } from "../../../Constants";
import { defineParentalControlledSetting } from "./ParentalControlledUserSettingsDefinitions";
import { explicitContentFromProto, explicitContentToProto, goreContentFromProto, goreContentToProto } from "../UserSettings";
import shallowEqual from "../../../_bundle/shallowEqual";
import { UInt32Value, BoolValue } from "../../../_bundle/Module1337";
import { SpendingLimitSettings, SpendingLimit } from "../../../_bundle/Module1306";
import { spendingLimitEqual } from "../../parent_tools/SpendingLimitUtils";
const r11 = defineParentalControlledSetting("textAndImages", "explicitContentSettings", explicitContentFromProto, explicitContentToProto, {
comparator: shallowEqual
});
const r10 = defineParentalControlledSetting("textAndImages", "explicitContentFilter", (a0) => {
let r2 = a0?.value;
if (r2 == null) {
r2 = ExplicitContentFilterTypes.NON_FRIENDS;
}
return r2;
}, (a0) => UInt32Value.create({
value: a0
}));
const r66 = defineParentalControlledSetting("textAndImages", "goreContentSettings", goreContentFromProto, goreContentToProto, {
comparator: shallowEqual
});
const r75 = defineParentalControlledSetting("privacy", "defaultMessageRequestRestricted", (a0) => a0?.value, (a0) => BoolValue.create({
value: a0
}));
const r84 = defineParentalControlledSetting("privacy", "defaultGuildsRestricted", (a0) => a0 == null ? false : a0, (a0) => a0);
const r93 = defineParentalControlledSetting("privacy", "defaultGuildsRestrictedV2", (a0) => a0?.value, (a0) => BoolValue.create({
value: a0
}));
const r101 = defineParentalControlledSetting("privacy", "friendSourceFlags", (a0) => {
let r2 = a0?.value;
if (r2 == null) {
r2 = AllFriendSourceFlags;
}
return r2;
}, (a0) => UInt32Value.create({
value: a0
}));
const r109 = defineParentalControlledSetting("privacy", "dropsOptedOut", (a0) => {
let r2 = a0?.value;
if (r2 == null) {
r2 = false;
}
return r2;
}, (a0) => BoolValue.create({
value: a0
}));
const r117 = defineParentalControlledSetting("privacy", "quests3PDataOptedOut", (a0) => {
let r2 = a0?.value;
if (r2 == null) {
r2 = false;
}
return r2;
}, (a0) => BoolValue.create({
value: a0
}));
const r130 = defineParentalControlledSetting("safetySettings", "spendingLimitSettings", (a0) => {
const oneTimePurchaseLimit = a0?.oneTimePurchaseLimit;
return oneTimePurchaseLimit == null ? null : {
amount: Number(oneTimePurchaseLimit.amount),
currency: oneTimePurchaseLimit.currency
};
}, (a0) => {
if (a0 == null) {
return SpendingLimitSettings.create({});
}
const { amount, currency } = a0;
return SpendingLimitSettings.create({
oneTimePurchaseLimit: SpendingLimit.create({
amount: String(amount),
currency
})
});
}, {
comparator: spendingLimitEqual
});
export { r11 as ParentalControlledExplicitContent };
export { r10 as ParentalControlledLegacyExplicitContent };
export { r66 as ParentalControlledGoreContent };
export { r75 as ParentalControlledDefaultMessageRequestRestricted };
export { r84 as ParentalControlledDefaultGuildsRestricted };
export { r93 as ParentalControlledDefaultGuildsRestrictedV2 };
export { r101 as ParentalControlledFriendSourceFlags };
export { r109 as ParentalControlledDropsOptedOut };
export { r117 as ParentalControlledQuests3PDataOptedOut };
export { r130 as ParentalControlledSpendingLimit };
@@ -0,0 +1,81 @@
// Metro module 13857 (f13858).
import FamilyCenterControlledSettingsStore from "../../parent_tools/FamilyCenterControlledSettingsStore";
import FamilyCenterActionCreators from "../../parent_tools/FamilyCenterActionCreators";
import { useStateFromStores } from "../../../_bundle/Module589";
export function defineParentalControlledSetting(c20760_0, c20760_1, c20760_2, c20760_3, r7 = {}) {
let c20760_4, getControlledSetting2, c20760_6;
let comparator = r7.comparator;
if (comparator === void 0) {
comparator = (a0, a1) => a0 === a1;
}
c20760_4 = comparator;
getControlledSetting2 = (a0) => {
const settings = FamilyCenterControlledSettingsStore.getSettings(a0);
const r2 = settings == null;
let r10 = void 0;
if (!r2) {
const r12 = settings[c20760_0];
r10 = r12 == null ? void 0 : r12[c20760_1];
}
return c20760_2(r10);
};
c20760_6 = (a0, a1) => {};
return {
getControlledSetting: getControlledSetting2,
updateControlledSetting: function(a0, a1) {
let r5 = a1;
if (typeof a1 === "function") {
const settings = FamilyCenterControlledSettingsStore.getSettings(a0);
const r2 = settings == null;
let r12 = void 0;
if (!r2) {
const r14 = settings[c20760_0];
r12 = r14 == null ? void 0 : r14[c20760_1];
}
r5 = a1(c20760_2(r12));
}
let c27581_0 = r5;
return a0 == null ? Promise.resolve() : FamilyCenterActionCreators.updateTeenSettings(a0, c20760_0, (a0) => {
a0[c20760_1] = c20760_3(c27581_0, a0[c20760_1]);
});
},
useControlledSetting: (a0) => {
return useStateFromStores([FamilyCenterControlledSettingsStore], () => {
const settings = FamilyCenterControlledSettingsStore.getSettings(a0);
const r2 = settings == null;
let r11 = void 0;
if (!r2) {
const r13 = settings[c20760_0];
r11 = r13 == null ? void 0 : r13[c20760_1];
}
return c20760_2(r11);
}, [a0], c20760_4);
}
};
}
export function wrapParentalControlledSettingWithExperimentDefaults({ baseSetting, isEligible, useIsEligible, eligibleDefault, ineligibleDefault, onUseDefault }) {
return {
getControlledSetting: (a0) => {
let r5 = baseSetting.getControlledSetting(a0);
if (r5 == null) {
if (onUseDefault != null) {
onUseDefault();
}
r5 = isEligible() ? eligibleDefault() : ineligibleDefault;
}
return r5;
},
useControlledSetting: (a0) => {
let r6 = baseSetting.useControlledSetting(a0);
const isEligible2 = useIsEligible();
if (r6 == null) {
if (onUseDefault != null) {
onUseDefault();
}
r6 = isEligible2 ? eligibleDefault() : ineligibleDefault;
}
return r6;
},
updateControlledSetting: (a0, a1) => baseSetting.updateControlledSetting(a0, a1)
};
}
@@ -0,0 +1,16 @@
// Metro module 13847 (f13848).
import { SafetySettingsNoticeType } from "../../../safety_common/Constants";
import { useActiveLinkUserIds } from "../../../parent_tools/hooks/useUserLinks";
import SafetySettingsNotice from "../../../safety_common/native/SafetySettingsNotice";
import FamilyCenter_messages from "../../../parent_tools/FamilyCenter.messages";
import { popLayer } from "../../../../actions/LayerActionCreators";
import ChannelActionCreators from "../../../../actions/ChannelActionCreators";
export default function FamilyCenterSettingsParentalControlsNotice() {
const activeLinkUserIds = useActiveLinkUserIds();
return <SafetySettingsNotice label={FamilyCenter_messages.i284fU} noticeType={SafetySettingsNoticeType.CONTENT_AND_SOCIAL_PARENTAL_CONTROLS_NOTICE} labelHook={function labelHook() {
popLayer();
ChannelActionCreators.openPrivateChannel({
recipientIds: activeLinkUserIds
});
}} count={activeLinkUserIds.length} />;
};
@@ -0,0 +1,19 @@
// Metro module 14683 (f14684).
import { useMemo } from "react";
import { MobileSetting } from "../../core/native/SettingsConstants";
import { intl, t } from "../../../../intl/index.native";
import { createList } from "../../../settings/native/renderer/SettingBuilders";
import SettingLayout from "../../../settings/native/renderer/SettingLayout";
export default function UserSettingsSensitiveContentFilters() {
return <SettingLayout node={useMemo(() => createList({
sections: [{
label: intl.string(t.GYpoAq),
settings: [MobileSetting.PARENTAL_CONTROLS_EXPLICIT_MEDIA_FILTERS_FRIENDS_DMS, MobileSetting.PARENTAL_CONTROLS_EXPLICIT_MEDIA_FILTERS_NON_FRIENDS_DMS],
subLabel: intl.string(t.Wnojv1)
}, {
label: intl.string(t["16/3Bi"]),
settings: [MobileSetting.PARENTAL_CONTROLS_GORE_MEDIA_FILTERS_FRIENDS_DMS, MobileSetting.PARENTAL_CONTROLS_GORE_MEDIA_FILTERS_NON_FRIENDS_DMS],
subLabel: intl.string(t.XgH9eh)
}]
}), [])} />;
};
@@ -0,0 +1,144 @@
// Metro module 13900 (f13901).
import { useState, useCallback, useRef, useEffect } from "react";
import { ActivityIndicator, View } from "react-native";
import FamilyCenterStore from "../../../parent_tools/FamilyCenterStore";
import UserStore from "../../../../stores/UserStore";
import { AnalyticEvents } from "../../../../Constants";
import { AgeGateSource } from "../../../age_gate/AgeGateConstants";
import { ContentDismissActionType } from "../../../dismissible_content/DismissibleContentConstants";
import { FamilyCenterPageLocationAnalyticsIds, FamilyCenterSubPageAnalyticsIds, FamilyCenterSubPages } from "../../../parent_tools/FamilyCenterConstants";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../../app_analytics/AnalyticsLocation";
import { useAcceptedRequestsCount } from "../../../parent_tools/hooks/useUserLinks";
import useUserAgeGroup from "../../../parent_tools/hooks/useUserAgeGroup";
import useSelectedTab from "../../../parent_tools/hooks/useSelectedTab";
import { useSelectedTeenId } from "../../../parent_tools/hooks/useSelectedTeen";
import { useStateFromStoresObject } from "../../../../_bundle/defaultAreStatesEqual";
import { useSegmentedControlState } from "../../../../design/components/SegmentedControl/native/SegmentedControlState.native";
import { intl } from "../../../../intl/index.native";
import FamilyCenter_messages from "../../../parent_tools/FamilyCenter.messages";
import FamilyCenterActivityPage from "../../../parent_tools/native/FamilyCenterActivityPage";
import FamilyCenterRequestsPage from "../../../parent_tools/native/FamilyCenterRequestsPage";
import FamilyCenterActionCreators from "../../../parent_tools/FamilyCenterActionCreators";
import AnalyticsUtils from "../../../../utils/AnalyticsUtils";
import MonitoringAgent from "../../../monitoring/MonitoringAgent";
import { MetricEvents } from "../../../../_bundle/Module5872";
import useMountEffect from "../../../../hooks/useMountEffect";
import { UNSAFE_markDismissibleContentAsDismissed } from "../../../dismissible_content/DismissibleContentUnsafeUtils";
import { DismissibleContent } from "../../../../_bundle/Module1358";
import { openAgeGateModal } from "../../../age_gate/AgeGateModalActionCreators";
import { SegmentedControl } from "../../../../design/components/SegmentedControl/native/SegmentedControl.native";
import { SegmentedControlPages } from "../../../../design/components/SegmentedControl/native/SegmentedControlPages.native";
let c9696_17, useStyles, FamilyCenter;
const FamilyCenterLoading = function FamilyCenterLoading() {
return <Stack justify="center" align="center" style={useStyles().loadingContainer}>
<ActivityIndicator />
</Stack>;
};
FamilyCenter = function FamilyCenter() {
let r117;
let familyCenterInitialized, isLoading, c20775_2, current, ref;
const styles = useStyles();
const analyticsLocations = useAnalyticsLocations(AnalyticsLocation.FAMILY_CENTER).analyticsLocations;
const acceptedRequestsCount = useAcceptedRequestsCount();
const userAgeGroup = useUserAgeGroup();
const selectedTab = useSelectedTab().selectedTab;
const selectedTeenId = useSelectedTeenId();
const stateFromStoresObject = useStateFromStoresObject([FamilyCenterStore], () => ({
familyCenterInitialized: FamilyCenterStore.getIsInitialized(),
isLoading: FamilyCenterStore.isLoading()
}));
familyCenterInitialized = stateFromStoresObject.familyCenterInitialized;
isLoading = stateFromStoresObject.isLoading;
const currentUser = UserStore.getCurrentUser();
const r2 = userAgeGroup != null;
c20775_2 = r2;
const [pageWidth, setState] = useState(0);
const callback = useCallback((a0) => {
setState(a0.nativeEvent.layout.width);
}, []);
const segmentedControlState = useSegmentedControlState({
items: [{
label: intl.string(FamilyCenter_messages.bdBmqy),
id: FamilyCenterSubPages.ACTIVITY,
page: <FamilyCenterActivityPage />
}, {
label: intl.string(FamilyCenter_messages["gVWG+6"]),
id: FamilyCenterSubPages.REQUESTS,
page: <FamilyCenterRequestsPage />
}],
onPageChange: (a0) => FamilyCenterActionCreators.selectTab(c9696_17[a0]),
pageWidth,
defaultIndex: c9696_17.indexOf(selectedTab)
});
current = {
ageGroup: userAgeGroup,
numOfAcceptedRequests: acceptedRequestsCount,
selectedTab,
selectedTeenId
};
ref = useRef(current);
useEffect(() => {
ref.current = current;
});
useEffect(() => {
if (familyCenterInitialized && c20775_2) {
const current2 = ref.current;
AnalyticsUtils.track(AnalyticEvents.FAMILY_CENTER_VIEWED, {
is_considered_adult: current2.ageGroup === "adult",
num_of_accepted_links: current2.numOfAcceptedRequests,
selected_teen_id: current2.selectedTeenId,
initial_page: FamilyCenterSubPageAnalyticsIds[current2.selectedTab],
source: FamilyCenterPageLocationAnalyticsIds.SETTINGS
});
MonitoringAgent.increment({
name: MetricEvents.FAMILY_CENTER_VIEW
});
}
}, [familyCenterInitialized, r2]);
useMountEffect(() => {
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.FAMILY_CENTER_NEW_BADGE, {
dismissAction: ContentDismissActionType.AUTO,
forceTrack: true
});
if (isLoading ? !isLoading : FamilyCenterStore.canRefetch()) {
FamilyCenterActionCreators.initialPageLoad();
}
});
if (familyCenterInitialized && (currentUser != null && !r2)) {
openAgeGateModal(AgeGateSource.FAMILY_CENTER);
r117 = null;
} else {
r117 = <AnalyticsLocationProvider value={analyticsLocations}>
<View style={styles.container} onLayout={callback}>
<View style={styles.segmentedControlContainer}>
<SegmentedControl state={segmentedControlState} />
</View>
<View style={styles.container}>
{isLoading ? <FamilyCenterLoading /> : <SegmentedControlPages state={segmentedControlState} />}
</View>
</View>
</AnalyticsLocationProvider>;
}
return r117;
};
c9696_17 = [FamilyCenterSubPages.ACTIVITY, FamilyCenterSubPages.REQUESTS];
useStyles = createStyles({
container: {
display: "flex",
flex: 1
},
segmentedControlContainer: {
paddingTop: Module712.space.PX_16,
paddingHorizontal: Module712.space.PX_16
},
loadingContainer: {
minHeight: "100%"
}
});
export default function FamilyCenterContainer() {
return <FamilyCenter />;
};
@@ -0,0 +1,139 @@
// Metro module 13960 (f13961).
import { useState, useCallback, useRef, useEffect, useLayoutEffect } from "react";
import { ScrollView, View } from "react-native";
import { UserSettingsSections } from "../../../../Constants";
import { FamilyCenterSubPages } from "../../../parent_tools/FamilyCenterConstants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStackNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import useAnalyticsLocations, { AnalyticsLocationProvider } from "../../../app_analytics/useAnalyticsLocations";
import AnalyticsLocation from "../../../app_analytics/AnalyticsLocation";
import { useSettingNavigationRoute } from "../../core/native/useSettingNavigationRoute";
import { useIsFamilyCenterV3Enabled } from "../../../parent_tools/FamilyCenterV3Experiment";
import { useSelectedTeenUser } from "../../../parent_tools/hooks/useSelectedTeenUser";
import useUserIsTeenAgeGroup from "../../../parent_tools/hooks/useUserIsTeenAgeGroup";
import { intl, t } from "../../../../intl/index.native";
import FamilyCenter_messages from "../../../parent_tools/FamilyCenter.messages";
import { HeaderTextButton } from "../../../main_tabs_v2/native/shared_components/HeaderShared";
import FamilyCenterParentalControlsContentAndSocial from "../../../parent_tools/native/FamilyCenterParentalControlsContentAndSocial";
import FamilyCenterParentalControlsDataAndPrivacy from "../../../parent_tools/native/FamilyCenterParentalControlsDataAndPrivacy";
import { useSegmentedControlState } from "../../../../design/components/SegmentedControl/native/SegmentedControlState.native";
import FamilyCenterActionCreators from "../../../parent_tools/FamilyCenterActionCreators";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import FamilyCenterParentalControlsScreenTime from "../../../parent_tools/native/FamilyCenterParentalControlsScreenTime";
import { SegmentedControl } from "../../../../design/components/SegmentedControl/native/SegmentedControl.native";
import { SegmentedControlPages } from "../../../../design/components/SegmentedControl/native/SegmentedControlPages.native";
const useStyles = createStyles({
container: {
display: "flex",
flex: 1
},
segmentedControlContainer: {
paddingTop: Module712.space.PX_16,
paddingHorizontal: Module712.space.PX_16
},
content: {
paddingBottom: Module712.space.PX_16
}
});
export default function FamilyCenterParentalControlsSettings() {
let props;
let ref, c20813_8;
const styles = useStyles();
const stackNavigation = useStackNavigation();
const analyticsLocations = useAnalyticsLocations(AnalyticsLocation.FAMILY_CENTER).analyticsLocations;
const [pageWidth, setState] = useState(0);
const settingNavigationRoute = useSettingNavigationRoute();
let r7 = settingNavigationRoute.params?.selectedSubPage;
if (r7 == null) {
r7 = FamilyCenterSubPages.CONTENT_AND_SOCIAL;
}
const CONTENT_AND_SOCIAL = r7;
const r49 = settingNavigationRoute.params?.autoOpenCreate === true;
let c20813_3 = r49;
let r53 = useIsFamilyCenterV3Enabled({
location: "FamilyCenterParentalControlsSettings"
});
const isFamilyCenterV3Enabled = r53;
const id = useSelectedTeenUser()?.id;
const userIsTeenAgeGroup = useUserIsTeenAgeGroup();
let c20813_6 = userIsTeenAgeGroup;
const callback = useCallback((a0) => {
setState(a0.nativeEvent.layout.width);
}, []);
ref = useRef(false);
useEffect(() => {
if (c20813_3 && id != null && !ref.current) {
ref.current = true;
stackNavigation.setParams({
autoOpenCreate: false
});
stackNavigation.navigate(UserSettingsSections.FAMILY_CENTER_SCHEDULE_DOWNTIME, {
teenId: id
});
}
}, [r49, id, stackNavigation]);
useLayoutEffect(() => {
if (isFamilyCenterV3Enabled && (CONTENT_AND_SOCIAL === FamilyCenterSubPages.SCREEN_TIME_CONTROLS && id != null)) {
stackNavigation.setOptions({
title: intl.string(FamilyCenter_messages["1Op+NP"]),
headerRight: c20813_6 ? void 0 : (a0) => <HeaderTextButton {...a0} onPress={() => stackNavigation.navigate(UserSettingsSections.FAMILY_CENTER_SCHEDULE_DOWNTIME, {
teenId: id
})} label={intl.string(t.OYkgVk)} />
});
} else {
stackNavigation.setOptions({
title: void 0,
headerRight: void 0
});
}
}, [stackNavigation, CONTENT_AND_SOCIAL, isFamilyCenterV3Enabled, id, userIsTeenAgeGroup]);
if (isFamilyCenterV3Enabled) {
r53 = CONTENT_AND_SOCIAL === FamilyCenterSubPages.SCREEN_TIME_CONTROLS;
}
const items = [{
label: intl.string(t["+o1pDZ"]),
id: FamilyCenterSubPages.CONTENT_AND_SOCIAL,
page: <FamilyCenterParentalControlsContentAndSocial />
}, {
label: intl.string(t.OAuOHD),
id: FamilyCenterSubPages.DATA_AND_PRIVACY,
page: <FamilyCenterParentalControlsDataAndPrivacy />
}];
c20813_8 = items;
const segmentedControlState = useSegmentedControlState({
items,
onPageChange: (a0) => {
FamilyCenterActionCreators.selectTab(c20813_8[a0].id);
},
pageWidth,
defaultIndex: Math.max(items.findIndex((item) => item.id === CONTENT_AND_SOCIAL), 0)
});
const r124 = {
value: analyticsLocations,
children: null
};
if (r53) {
r124.children = <ScrollView style={styles.container}>
<SafeAreaPaddingView bottom style={styles.content}>
<FamilyCenterParentalControlsScreenTime readOnly={userIsTeenAgeGroup} />
</SafeAreaPaddingView>
</ScrollView>;
props = r124;
} else {
r124.children = <View style={styles.container} onLayout={callback}>
<View style={styles.segmentedControlContainer}>
<SegmentedControl state={segmentedControlState} />
</View>
<View style={styles.container}>
<ScrollView>
<SafeAreaPaddingView bottom style={styles.content}>
<SegmentedControlPages state={segmentedControlState} />
</SafeAreaPaddingView>
</ScrollView>
</View>
</View>;
props = r124;
}
return <AnalyticsLocationProvider {...props} />;
};