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

230 lines
13 KiB
TypeScript

/* Metro module 10944; source: modules/notifications/settings/native/NotificationSettingsPresets.tsx; dependencies: [31, 27, 33, 1244, 4867, 4073, 10945, 10629, 4501, 697, 8853, 4573, 4578, 9221, 10947, 10941, 2] */
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 CircleCheckIconModule from '../../../../design/components/Icon/native/redesign/generated/CircleCheckIcon.tsx'; /* Metro dependency 4073 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as NotificationSettingsPresetUtilsModule from '../utils/notificationSettingsPresetUtils.tsx'; /* Metro dependency 4867 */
import * as SegmentedControlStateNativeModule from '../../../../design/components/SegmentedControl/native/SegmentedControlState.native.tsx'; /* Metro dependency 8853 */
import * as BellSlashIconModule from '../../../../design/components/Icon/native/redesign/generated/BellSlashIcon.tsx'; /* Metro dependency 10629 */
import * as NotficationSettingsChannelFlagUtilsModule from '../utils/notficationSettingsChannelFlagUtils.tsx'; /* Metro dependency 10941 */
import * as MagicWandIconModule from '../../../../design/components/Icon/native/redesign/generated/MagicWandIcon.tsx'; /* Metro dependency 10945 */
import * as NotificationSettingsGuildFlagUtilsModule from '../utils/notificationSettingsGuildFlagUtils.tsx'; /* Metro dependency 10947 */
function _fun83905(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#83905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:6, offset: 0x01f2db7a, size: 294 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = JsxRuntimeModule;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object2 = {'padding': 16, 'minHeight': 82, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center',
'justifyContent': 'center'};
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg + 8;
const REDESIGN_INPUT_CONTROL_ACTIVE_BG = (importDefault(697) /* metro dependency 697: native */).colors.REDESIGN_INPUT_CONTROL_ACTIVE_BG;
object2.backgroundColor = REDESIGN_INPUT_CONTROL_ACTIVE_BG;
const env0_6 = Reflect.apply(createStyles, value, [{customContainer: object2}]);
(FileImportTrackerModule).fileFinishedImporting('modules/notifications/settings/native/NotificationSettingsPresets.tsx');
exports.NotificationSettingsGuildPresets = NotificationSettingsGuildPresets;
exports.NotificationSettingsChannelPresets = NotificationSettingsChannelPresets;
function NotificationSettingsPresets(a0) { // fn#83906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:391, offset: 0x01f2dca0, size: 1086 bytes, params: 2, frame: 29
var r0;
const Text = (TextModule).Text;
var items2;
var items3;
var Button;
const env0_0 = a0;
const value2 = undefined;
const styles = useStyles();
let preset = a0.preset;
const Presets = (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets;
let ALL_MESSAGES = Presets.ALL_MESSAGES;
const value3 = 0;
const r8 = preset === ALL_MESSAGES ? value3 : a0.preset === (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets.MENTIONS ? 1 : a0.preset !== (require(4867) /* metro dependency 4867: notificationSettingsPresetUtils */).Presets.NOTHING ? value2 : 2;
const useSegmentedControlState = SegmentedControlStateNativeModule.useSegmentedControlState;
const object = {pageWidth: value3, onSetActiveIndex: onSetActiveIndex_83907};
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.label = Reflect.apply(string, intl, [t.hZrr6k]);
ALL_MESSAGES = Presets.ALL_MESSAGES;
object2.id = ALL_MESSAGES;
const CircleCheckIcon = (CircleCheckIconModule).CircleCheckIcon;
object2.icon = <CircleCheckIcon />;
object2.page = null;
const items4 = [object2];
const object3 = {};
object3.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.y59NJm);
const MENTIONS = Presets.MENTIONS;
object3.id = MENTIONS;
const MagicWandIcon = (MagicWandIconModule).MagicWandIcon;
object3.icon = <MagicWandIcon />;
object3.page = null;
items4[1] = object3;
const object4 = {};
object4.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['pGn/bJ']);
const NOTHING = Presets.NOTHING;
object4.id = NOTHING;
const BellSlashIcon = (BellSlashIconModule).BellSlashIcon;
object4.icon = <BellSlashIcon />;
object4.page = null;
items4[2] = object4;
object.items = items4;
object.defaultIndex = r8;
const value6 = Reflect.apply(useSegmentedControlState, SegmentedControlStateNativeModule, [object]);
value6.useEffect(_fun83908, [r8, value6]);
preset = a0.preset;
const CUSTOM = Presets.CUSTOM;
if (preset === CUSTOM) {
var viewBindingProps = {style: styles.customContainer};
string = intl.string;
items2 = [
<Text variant="text-sm/semibold">
{Reflect.apply(string, intl, [t['32yow9']])}
</Text>,
];
string = intl.string;
items2[1] = (
<Text variant="text-xs/medium">
{Reflect.apply(string, intl, [t.l3doVX])}
</Text>
);
items3 = [
<View style={{'flex': 1, 'marginRight': 8}}>
{items2}
</View>,
];
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
items3[1] = (
<Button
variant="secondary"
text={Reflect.apply(string, intl, [t['ztO+l+']])}
onPress={onPress_83909}
/>
);
r0 = (
<View {...viewBindingProps}>
{items3}
</View>
);
} else {
const SegmentedControl = (require(9221) /* metro dependency 9221: SegmentedControlNative */).SegmentedControl;
r0 = <SegmentedControl variant="experimental_Large" state={value6} />;
}
return r0;
function NotificationSettingsPresetsOnSetActiveIndex(a0) { // fn#83907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:633, owner: NotificationSettingsPresets.onSetActiveIndex, offset: 0x01f2e0de, size: 372 bytes, params: 2, frame: 14
var r0;
var preset;
const Presets = (NotificationSettingsPresetUtilsModule).Presets;
var binding;
var updatePreset;
let value = a0 === 0;
if (value) {
preset = env0_0.preset;
value = environment.__proto__;
value = preset !== Presets.ALL_MESSAGES;
r0 = value;
} else {
r0 = value;
}
if (r0) {
binding = env0_0;
updatePreset = binding.updatePreset;
value = environment.__proto__;
Reflect.apply(updatePreset, binding, [Presets.ALL_MESSAGES]);
}
value = a0 === 1;
if (value) {
preset = env0_0.preset;
value = environment.__proto__;
value = preset !== Presets.MENTIONS;
r0 = value;
} else {
r0 = value;
}
if (r0) {
binding = env0_0;
updatePreset = binding.updatePreset;
value = environment.__proto__;
Reflect.apply(updatePreset, binding, [Presets.MENTIONS]);
}
value = a0 === 2;
if (value) {
preset = env0_0.preset;
value = environment.__proto__;
value = preset !== Presets.NOTHING;
r0 = value;
} else {
r0 = value;
}
if (r0) {
binding = env0_0;
updatePreset = binding.updatePreset;
value = environment.__proto__;
Reflect.apply(updatePreset, binding, [Presets.NOTHING]);
}
}
function _fun83908() { // fn#83908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:1303, offset: 0x01f2e252, size: 53 bytes, params: 1, frame: 12
if (!(env0_1 == null || env0_1 >= 3)) {
ReactModule.setActiveIndex(env0_1);
}
}
function NotificationSettingsPresetsOnPress() { // fn#83909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:1752, owner: NotificationSettingsPresets.onPress, offset: 0x01f2e287, size: 57 bytes, params: 1, frame: 13
const binding = env0_0;
const updatePreset = binding.updatePreset;
const Presets = (NotificationSettingsPresetUtilsModule).Presets;
const MENTIONS = Presets.MENTIONS;
Reflect.apply(updatePreset, binding, [MENTIONS]);
}
}
function NotificationSettingsGuildPresets(a0) { // fn#83910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2011, offset: 0x01f2e2c0, size: 91 bytes, params: 2, frame: 17
const env0_0 = a0;
const useGuildPresetSettings = NotificationSettingsGuildFlagUtilsModule.useGuildPresetSettings;
return (
<NotificationSettingsPresets
preset={Reflect.apply(useGuildPresetSettings, NotificationSettingsGuildFlagUtilsModule, [a0.guildId]).preset}
updatePreset={updatePreset}
/>
);
function NotificationSettingsGuildPresetsUpdatePreset(a0) { // fn#83911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2164, owner: NotificationSettingsGuildPresets.updatePreset, offset: 0x01f2e31b, size: 54 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = require(10947) /* metro dependency 10947: notificationSettingsGuildFlagUtils */;
return value.updateGuildPreset(env0_0.guildId, a0);
}
}
function NotificationSettingsChannelPresets(a0) { // fn#83912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2247, offset: 0x01f2e351, size: 91 bytes, params: 2, frame: 17
const env0_0 = a0;
const useChannelPresetSettings = NotficationSettingsChannelFlagUtilsModule.useChannelPresetSettings;
return (
<NotificationSettingsPresets
preset={Reflect.apply(useChannelPresetSettings, NotficationSettingsChannelFlagUtilsModule, [a0.channel]).preset}
updatePreset={updatePreset}
/>
);
function NotificationSettingsChannelPresetsUpdatePreset(a0) { // fn#83913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11130:2404, owner: NotificationSettingsChannelPresets.updatePreset, offset: 0x01f2e3ac, size: 70 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(10941) /* metro dependency 10941: notficationSettingsChannelFlagUtils */;
const updateChannelPreset = value.updateChannelPreset;
const binding = env0_0;
return Reflect.apply(updateChannelPreset, value, [binding.channel.guild_id, binding.channel.id, a0]);
}
}
}
global.__d(_fun83905, 10944, [31, 27, 33, 1244, 4867, 4073, 10945, 10629, 4501, 697, 8853, 4573, 4578, 9221, 10947,
10941,
2]) /* metro module 10944, dependencies: [31, 27, 33, 1244, 4867, 4073, 10945, 10629, 4501, 697, 8853, 4573, 4578, 9221, 10947, 10941, 2] */;