Files
2026-07-28 01:06:53 +03:00

371 lines
22 KiB
TypeScript

/* Metro module 13419; source: modules/parent_tools/native/FamilyCenterSettingsControls.tsx; dependencies: [31, 27, 5117, 661, 33, 4501, 697, 4573, 1244, 2224, 5080, 13420, 1962, 13422, 6238, 8170, 13406, 5188, 1484, 13423, 4572, 6231, 4578, 5177, 4603, 13348, 5118, 13424, 2] */
import ChannelActionCreators from '../../../actions/ChannelActionCreators.tsx'; /* Metro dependency 4603 */
import UseScheduleTimeControlsRowProps from '../hooks/useScheduleTimeControlsRowProps.tsx'; /* Metro dependency 13423 */
import UseUserIsTeenAgeGroup from '../hooks/useUserIsTeenAgeGroup.tsx'; /* Metro dependency 13424 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as StackNativeModule from '../../../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
import * as FamilyCenterConstantsModule from '../FamilyCenterConstants.tsx'; /* Metro dependency 5117 */
import * as LayerActionCreatorsModule from '../../../actions/LayerActionCreators.tsx'; /* Metro dependency 5177 */
import * as FamilyCenterV3ExperimentModule from '../FamilyCenterV3Experiment.tsx'; /* Metro dependency 5188 */
import * as TableRowGroupNativeModule from '../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
import * as TableRowNativeModule from '../../../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as UseUserLinksModule from '../hooks/useUserLinks.tsx'; /* Metro dependency 8170 */
import * as ParentalControlledUserSettingsModule from '../../user_settings/family_center/ParentalControlledUserSettings.tsx'; /* Metro dependency 13348 */
import * as UseSelectedTeenUserModule from '../hooks/useSelectedTeenUser.tsx'; /* Metro dependency 13406 */
import * as SpendingLimitDisplayModule from '../SpendingLimitDisplay.tsx'; /* Metro dependency 13422 */
function _fun102091(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#102091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:6, offset: 0x0222c2f9, size: 464 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = JsxRuntimeModule;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.teenControlsContainer = {gap: PX_16};
let PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.controlledSettingsHeader = {gap: PX_4};
PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.parentalControlsContainer = {gap: PX_4};
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.controlsGroup = {marginTop: PX_8};
const ICON_FEEDBACK_WARNING = (importDefault(697) /* metro dependency 697: native */).colors.ICON_FEEDBACK_WARNING;
object.subLabelWarning = {color: ICON_FEEDBACK_WARNING};
const TEXT_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL;
object.subLabelCritical = {color: TEXT_FEEDBACK_CRITICAL};
const env0_9 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/parent_tools/native/FamilyCenterSettingsControls.tsx');
exports.default = FamilyCenterSettingsControls;
function SpendingLimitRow({cap, teenId}) { // fn#102092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:575, offset: 0x0222c4c9, size: 221 bytes, params: 2, frame: 22
const styles = useStyles();
const {trailing,
subLabel} = getSpendingLimitRowProps((SpendingLimitDisplayModule).useSpendingLimitDisplayState(cap),
styles);
const value5 = teenId == null;
const TableRow = (TableRowNativeModule).TableRow;
const intl = (IndexNativeModule).intl;
return (
<TableRow
label={intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).gMeekL)}
trailing={trailing}
subLabel={subLabel}
onPress={value5 ? undefined : _fun102096}
arrow={!value5}
disabled={value5}
/>
);
function getSpendingLimitRowProps(a0, a1) { // fn#102093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:608, owner: SpendingLimitRow.getSpendingLimitRowProps, offset: 0x0222c5a6, size: 467 bytes, params: 3, frame: 23
var environment;
var object;
var value;
const intl = (IndexNativeModule).intl;
const getSpendingLimitRowPropsRenderTrailing2 = getSpendingLimitRowPropsRenderTrailing;
const renderSubLabel2 = renderSubLabel;
const kind = a0.kind;
if (kind === 'off') {
object = {};
value = environment.__proto__;
object.trailing = getSpendingLimitRowPropsRenderTrailing2(intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).YEnpaj));
return object;
}
if (kind === 'on') {
object = {};
object.trailing = getSpendingLimitRowPropsRenderTrailing2(a0.monthlyText);
return object;
}
if (kind === 'close-to-limit') {
object = {};
object.trailing = getSpendingLimitRowPropsRenderTrailing2(a0.monthlyText);
object.subLabel = renderSubLabel2(a0.remainingText, a1.subLabelWarning);
return object;
}
if (kind === 'spent') {
object = {};
object.trailing = getSpendingLimitRowPropsRenderTrailing2(a0.monthlyText);
value = environment.__proto__;
value = intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).Q2msVQ);
object.subLabel = renderSubLabel2(value, a1.subLabelCritical);
return object;
}
if (kind === 'blocked') {
object = {};
value = environment.__proto__;
object.trailing = getSpendingLimitRowPropsRenderTrailing2(intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).kGFuGn));
value = intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).FUu2b0);
object.subLabel = renderSubLabel2(value, a1.subLabelCritical);
return object;
}
function getSpendingLimitRowPropsRenderTrailing(a0) { // fn#102094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:666, owner: SpendingLimitRow.getSpendingLimitRowProps.renderTrailing, offset: 0x0222c779, size: 63 bytes, params: 2, frame: 14
const Text = (TextModule).Text;
return (
<Text variant="text-sm/normal" color="text-muted">
{a0}
</Text>
);
}
function renderSubLabel(a0, a1) { // fn#102095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:757, owner: SpendingLimitRow.getSpendingLimitRowProps.renderSubLabel, offset: 0x0222c7b8, size: 68 bytes, params: 3, frame: 14
const Text = (TextModule).Text;
return (
<Text variant="text-sm/normal" style={a1}>
{a0}
</Text>
);
}
}
function _fun102096() { // fn#102096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:1596, offset: 0x0222c7fc, size: 109 bytes, params: 1, frame: 18
const teenIdBinding = teenId;
let value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[10]);
const pushLazy = defaultImport.pushLazy;
value = require(dependencyMap[12]);
value = value(dependencyMap[11], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, {teenId: teenIdBinding}, undefined, {animation: 'slide_from_right'}]);
}
}
function FamilyCenterSettingsTeenControls() { // fn#102097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:1793, offset: 0x0222c869, size: 907 bytes, params: 1, frame: 36
var r5;
var TableRowGroup;
var items3;
var TableRow;
var object;
var length;
const value2 = undefined;
const styles = useStyles();
const value3 = (UseUserLinksModule).useActiveLinkUserIds();
const value4 = (UseSelectedTeenUserModule).useSelectedTeenUser();
const value5 = (FamilyCenterV3ExperimentModule).useIsFamilyCenterV3Enabled({location: 'FamilyCenterSettingsControls'});
const env0_1 = (UseNavigationNativeModule).useNavigation();
const r6 = (value4 == null || value4.restrictedSchedule == null ? value2 : value4.restrictedSchedule.rules) ?? [];
const value6 = (SpendingLimitDisplayModule).useSpendingLimitFromUserSettings();
const {subLabel,
trailing} = (UseScheduleTimeControlsRowProps)(r6);
const Stack = (StackNativeModule).Stack;
const Stack2 = (StackNativeModule).Stack;
const Text = (TextModule).Text;
const intl = (IndexNativeModule).intl;
const text = (
<Text variant="text-sm/semibold">
{intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).ahKIJO)}
</Text>
);
const format = intl.format;
const X9rW0j = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).X9rW0j;
const stack = (
<Stack2 style={styles.controlledSettingsHeader}>
{text}
<Text variant="text-sm/medium" color="text-muted">
{Reflect.apply(format, intl, [X9rW0j, {openSettingsHook: openSettingsHook}])}
</Text>
</Stack2>
);
if (value5) {
var viewBindingProps = {style: styles.controlsGroup};
TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
items3 = [
<SpendingLimitRow cap={value6} />,
];
TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
var tableRowProps = {label: intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['1Op+NP']),
subLabel: subLabel, trailing: trailing};
length = r6.length;
tableRowProps.onPress = length > 0 ? _fun102100 : value2;
length = r6.length;
tableRowProps.arrow = length > 0;
items3[1] = <TableRow {...tableRowProps} />;
r5 = (
<View {...viewBindingProps}>
<TableRowGroup hasIcons={false}>
{items3}
</TableRowGroup>
</View>
);
} else {
r5 = value5;
}
const Button = (ButtonNativeModule).Button;
return (
<Stack style={styles.teenControlsContainer}>
{stack}
{r5}
<Button
text={intl.formatToPlainString((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).w0JA3P,
{count: value3.length})}
onPress={onPress_102101}
shrink
grow={false}
variant="secondary"
size="sm"
/>
</Stack>
);
function handleOpenSettings() { // fn#102098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:2124, owner: FamilyCenterSettingsTeenControls.handleOpenSettings, offset: 0x0222cbf4, size: 35 bytes, params: 1, frame: 11
const binding = env0_1;
const navigate = binding.navigate;
const CONTENT_AND_SOCIAL = UserSettingsSections.CONTENT_AND_SOCIAL;
Reflect.apply(navigate, binding, [CONTENT_AND_SOCIAL]);
}
function openSettingsHook(a0, a1) { // fn#102099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:2541, owner: FamilyCenterSettingsTeenControls.openSettingsHook, offset: 0x0222cc17, size: 78 bytes, params: 3, frame: 15
const Text = (TextModule).Text;
return (
<Text
variant="text-sm/medium"
color="text-link"
onPress={handleOpenSettings}
key={a1}
>
{a0}
</Text>
);
}
function _fun102100() { // fn#102100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:2878, offset: 0x0222cc65, size: 53 bytes, params: 1, frame: 14
const binding = env0_1;
const navigate = binding.navigate;
const FAMILY_CENTER_PARENTAL_CONTROLS = UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS;
const SCREEN_TIME_CONTROLS = FamilyCenterSubPages.SCREEN_TIME_CONTROLS;
Reflect.apply(navigate, binding, [FAMILY_CENTER_PARENTAL_CONTROLS, {selectedSubPage: SCREEN_TIME_CONTROLS}]);
}
function FamilyCenterSettingsTeenControlsOnPress() { // fn#102101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3100, owner: FamilyCenterSettingsTeenControls.onPress, offset: 0x0222cc9a, size: 78 bytes, params: 1, frame: 13
const value = environment.__proto__;
(LayerActionCreatorsModule).popLayer();
(ChannelActionCreators).openPrivateChannel({recipientIds: env0_0});
}
}
function FamilyCenterSettingsParentalControls() { // fn#102102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3263, offset: 0x0222cce8, size: 1009 bytes, params: 1, frame: 38
const value2 = undefined;
const styles = useStyles();
const value3 = (UseSelectedTeenUserModule).useSelectedTeenUser();
const value4 = (UseSelectedTeenUserModule).useShouldLoadSettingsForSelectedTeenUser();
const value5 = (FamilyCenterV3ExperimentModule).useIsFamilyCenterV3Enabled({location: 'FamilyCenterSettingsControls'});
const env0_2 = (UseNavigationNativeModule).useNavigation();
const r1 = (value3 == null || value3.restrictedSchedule == null ? value2 : value3.restrictedSchedule.rules) ?? [];
const env0_3 = r1;
const ParentalControlledSpendingLimit = (ParentalControlledUserSettingsModule).ParentalControlledSpendingLimit;
const value6 = ParentalControlledSpendingLimit.useControlledSetting(value3 == null ? value2 : value3.id);
env0_3.useEffect(_fun102103, [value3 == null ? value2 : value3.id, value4]);
const {subLabel,
trailing} = (UseScheduleTimeControlsRowProps)(r1);
const Stack = (StackNativeModule).Stack;
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const items3 = [
<Text variant="text-sm/semibold">
{Reflect.apply(string, intl,
[(importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).ahKIJO])}
</Text>,
];
string = intl.string;
const Sv236e = (importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */).Sv236e;
items3[1] = (
<Text variant="text-sm/medium" color="text-muted">
{Reflect.apply(string, intl, [Sv236e])}
</Text>
);
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
const TableRow = (TableRowNativeModule).TableRow;
const items2 = [
<TableRow
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+o1pDZ'])}
onPress={function() {
return handleSettingsClick(FamilyCenterSubPages.CONTENT_AND_SOCIAL);
}}
arrow
/>,
];
string = intl.string;
const OAuOHD = (require(1244) /* metro dependency 1244: indexNative */).t.OAuOHD;
items2[1] = (
<TableRow
label={Reflect.apply(string, intl, [OAuOHD])}
onPress={function() {
return handleSettingsClick(FamilyCenterSubPages.DATA_AND_PRIVACY);
}}
arrow
/>
);
items2[2] = value5 && (value3 == null ? value2 : value3.id) != null && <SpendingLimitRow cap={value6} teenId={value3.id} />;
items2[3] = value5 && (value3 == null ? value2 : value3.id) != null && <TableRow label={intl.string((importDefault(2224) /* metro dependency 2224: FamilyCenterMessages */)['1Op+NP'])} subLabel={subLabel} trailing={trailing} onPress={onPress_102107} arrow />;
items3[2] = (
<View style={styles.controlsGroup}>
<TableRowGroup hasIcons={false}>
{items2}
</TableRowGroup>
</View>
);
return (
<Stack style={styles.parentalControlsContainer}>
{items3}
</Stack>
);
function _fun102103() { // fn#102103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3647, offset: 0x0222d0d9, size: 88 bytes, params: 1, frame: 13
var value4;
var defaultImport;
const value2 = undefined;
if ((env0_0 == null ? value2 : env0_0.id) != null && env0_1) {
value4 = environment.__proto__;
defaultImport = importDefault(5118) /* metro dependency 5118: FamilyCenterActionCreators */;
defaultImport.fetchTeenSettingsAndConsents(env0_0.id);
}
return value2;
}
function handleSettingsClick(a0) { // fn#102104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:3779, owner: FamilyCenterSettingsParentalControls.handleSettingsClick, offset: 0x0222d131, size: 46 bytes, params: 2, frame: 14
const binding = env0_2;
const navigate = binding.navigate;
const FAMILY_CENTER_PARENTAL_CONTROLS = UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS;
Reflect.apply(navigate, binding, [FAMILY_CENTER_PARENTAL_CONTROLS, {selectedSubPage: a0}]);
}
function FamilyCenterSettingsParentalControlsOnPress_102107() { // fn#102107, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:4701, owner: FamilyCenterSettingsParentalControls.onPress, offset: 0x0222d199, size: 104 bytes, params: 1, frame: 18
const binding = env0_2;
const navigate = binding.navigate;
const FAMILY_CENTER_PARENTAL_CONTROLS = UserSettingsSections.FAMILY_CENTER_PARENTAL_CONTROLS;
const SCREEN_TIME_CONTROLS = FamilyCenterSubPages.SCREEN_TIME_CONTROLS;
Reflect.apply(navigate, binding, [FAMILY_CENTER_PARENTAL_CONTROLS, {selectedSubPage: SCREEN_TIME_CONTROLS,
autoOpenCreate: env0_3.length === 0 && env0_0?.id != null}]);
}
}
function FamilyCenterSettingsControls() { // fn#102108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13609:4976, offset: 0x0222d201, size: 111 bytes, params: 1, frame: 17
const value2 = (UseUserIsTeenAgeGroup)();
const useActiveLinkUserIds = UseUserLinksModule.useActiveLinkUserIds;
return (
Reflect.apply(useActiveLinkUserIds, UseUserLinksModule, []).length === 0
? null
: (
<View>
{((Component) => <Component />)(value2 ? FamilyCenterSettingsTeenControls : FamilyCenterSettingsParentalControls)}
</View>
)
);
}
}
global.__d(_fun102091, 13419, [31, 27, 5117, 661, 33, 4501, 697, 4573, 1244, 2224, 5080, 13420, 1962, 13422, 6238,
8170, 13406, 5188, 1484, 13423, 4572, 6231, 4578, 5177, 4603, 13348, 5118, 13424,
2]) /* metro module 13419, dependencies: [31, 27, 5117, 661, 33, 4501, 697, 4573, 1244, 2224, 5080, 13420, 1962, 13422, 6238, 8170, 13406, 5188, 1484, 13423, 4572, 6231, 4578, 5177, 4603, 13348, 5118, 13424, 2] */;