289 lines
17 KiB
TypeScript
289 lines
17 KiB
TypeScript
/* Metro module 11445; source: modules/guild_antiraid/native/GuildIncidentActionsActionSheet.tsx; dependencies: [31, 10906, 11446, 8276, 661, 33, 4501, 6805, 6758, 1244, 6807, 632, 8275, 4080, 1305, 6238, 6231, 6808, 9149, 8129, 6261, 4578, 11447, 683, 11448, 2] */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import GuildIncidentsStore from '../GuildIncidentsStore.tsx'; /* Metro dependency 10906 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as ActionSheetActionCreatorsModule from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
|
|
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as TableRowGroupNativeModule from '../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
|
|
import * as ButtonGroupNativeModule from '../../../design/components/ButtonGroup/native/ButtonGroup.native.tsx'; /* Metro dependency 6261 */
|
|
import * as BottomSheetTitleHeaderNativeModule from '../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
|
|
import * as ActionSheetNativeModule from '../../../design/components/Sheet/native/ActionSheet.native.tsx'; /* Metro dependency 6805 */
|
|
import * as ActionSheetRowNativeModule from '../../../design/components/Sheet/native/ActionSheetRow.native.tsx'; /* Metro dependency 6807 */
|
|
import * as TableSwitchRowNativeModule from '../../../design/components/TableRow/native/TableSwitchRow.native.tsx'; /* Metro dependency 6808 */
|
|
import * as GuildAntiRaidUtilsModule from '../GuildAntiRaidUtils.tsx'; /* Metro dependency 8275 */
|
|
import * as GuildAntiRaidConstantsModule from '../GuildAntiRaidConstants.tsx'; /* Metro dependency 8276 */
|
|
import * as GuildIncidentsActionSheetStoreModule from './GuildIncidentsActionSheetStore.tsx'; /* Metro dependency 11446 */
|
|
import * as GuildAntiRaidActionCreatorsModule from '../GuildAntiRaidActionCreators.tsx'; /* Metro dependency 11447 */
|
|
|
|
function _fun87602(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:6, offset: 0x01fc5006, size: 354 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = GuildIncidentsActionSheetStoreModule;
|
|
const env0_5 = value.resetGuildIncidentsActionSheetStore;
|
|
const env0_6 = value.setInitialTime;
|
|
const env0_7 = value.setPauseDms;
|
|
const env0_8 = value.setPauseInvites;
|
|
const env0_9 = value.setTime;
|
|
const env0_10 = value.useGuildIncidentsActionSheetStore;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_12 = value.AnalyticEvents;
|
|
const env0_13 = value.GuildFeatures;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value.jsx;
|
|
const env0_15 = value.jsxs;
|
|
const env0_16 = (CreateStylesModule).createStyles({beta: {marginLeft: -12}});
|
|
const GuildIncidentActionsActionSheet2 = GuildIncidentActionsActionSheet;
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_antiraid/native/GuildIncidentActionsActionSheet.tsx');
|
|
exports.default = GuildIncidentActionsActionSheet2;
|
|
function DurationSelectionActionSheet({onClose}) { // fn#87603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:446, offset: 0x01fc5168, size: 225 bytes, params: 2, frame: 23
|
|
const timeframes = getTimeframes();
|
|
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
|
|
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
|
|
const intl = (IndexNativeModule).intl;
|
|
const bottomSheetTitleHeader = (
|
|
<BottomSheetTitleHeader title={intl.string((IndexNativeModule).t.vKYZzc)} />
|
|
);
|
|
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
|
|
const Group = ActionSheetRow.Group;
|
|
return (
|
|
<ActionSheet>
|
|
{bottomSheetTitleHeader}
|
|
<Group hasIcons={false}>
|
|
{timeframes.map(_fun87604)}
|
|
</Group>
|
|
</ActionSheet>
|
|
);
|
|
function _fun87604(a0) { // fn#87604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:653, offset: 0x01fc5249, size: 80 bytes, params: 2, frame: 17
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__;
|
|
const ActionSheetRow = (ActionSheetRowNativeModule).ActionSheetRow;
|
|
return (
|
|
<ActionSheetRow
|
|
label={a0.label}
|
|
onPress={onPress_87605}
|
|
key={a0.value}
|
|
/>
|
|
);
|
|
function onPress_87605() { // fn#87605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:705, offset: 0x01fc5299, size: 39 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
setTime(env0_0.value);
|
|
value = environment.__proto__;
|
|
onClose();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function GuildIncidentActionsActionSheet({guild, analyticsData}) { // fn#87606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:776, offset: 0x01fc52c0, size: 1608 bytes, params: 2, frame: 39
|
|
const styles = useStyles();
|
|
const value3 = useGuildIncidentsActionSheetStore();
|
|
const time = value3.time;
|
|
const pauseInvites = value3.pauseInvites;
|
|
const pauseInvites2 = pauseInvites;
|
|
const pauseDms = value3.pauseDms;
|
|
const hasTimeChanges = value3.hasTimeChanges;
|
|
const guildIncident = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([GuildIncidentsStore],
|
|
function() {
|
|
return GuildIncidentsStore.getGuildIncident(guild.id);
|
|
});
|
|
const hasInvitesDisabled2 = (GuildAntiRaidUtilsModule).hasInvitesDisabled(guildIncident);
|
|
const hasDMsDisabled2 = (GuildAntiRaidUtilsModule).hasDMsDisabled(guildIncident);
|
|
const value4 = (GuildAntiRaidUtilsModule).initialLockdownDurationHours(guildIncident);
|
|
let r12 = guild == null ? undefined : guild.features.has(GuildFeatures.INVITES_DISABLED);
|
|
const binding = pauseInvites2;
|
|
binding.useEffect(_fun87608, [hasDMsDisabled2, hasInvitesDisabled2]);
|
|
binding.useEffect(_fun87609, [value4]);
|
|
const value6 = binding.useMemo(_fun87610, [time]);
|
|
const closure = function() {
|
|
importDefault(dependencyMap[13]).hideActionSheet('GuildIncidentActionsActionSheet');
|
|
resetGuildIncidentsActionSheetStore();
|
|
};
|
|
const ActionSheet = (ActionSheetNativeModule).ActionSheet;
|
|
object = {startExpanded: true};
|
|
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const oCYAc7 = (require(1244) /* metro dependency 1244: indexNative */).t.oCYAc7;
|
|
const BetaTag = (NativeModule).BetaTag;
|
|
const BetaSizes = (NativeModule).BetaSizes;
|
|
const SMALL = BetaSizes.SMALL;
|
|
object.header = (
|
|
<BottomSheetTitleHeader
|
|
title={Reflect.apply(string, intl, [oCYAc7])}
|
|
leading={<BetaTag size={SMALL} style={styles.beta} />}
|
|
/>
|
|
);
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const TableRow2 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const TrailingText = TableRow2.TrailingText;
|
|
const items2 = [
|
|
<TableRow
|
|
trailing={<TrailingText text={value6 ?? ''} />}
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vKYZzc)}
|
|
arrow
|
|
onPress={onPress_87614}
|
|
start
|
|
end
|
|
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vKYZzc)}
|
|
accessibilityHint={value6}
|
|
/>,
|
|
];
|
|
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
|
|
const TableSwitchRow = (TableSwitchRowNativeModule).TableSwitchRow;
|
|
string = intl.string;
|
|
const Uwsjn6 = (require(1244) /* metro dependency 1244: indexNative */).t.Uwsjn6;
|
|
const tableSwitchRow = (
|
|
<TableSwitchRow
|
|
label={Reflect.apply(string, intl, [Uwsjn6])}
|
|
subLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.qPJkZh)}
|
|
value={pauseInvites || r12}
|
|
onValueChange={function() {
|
|
setPauseInvites(!pauseInvites);
|
|
}}
|
|
disabled={r12}
|
|
/>
|
|
);
|
|
if (r12) {
|
|
r12 = (
|
|
<TableRow
|
|
icon={((Icon) => <Icon source={importDefault(9149) /* metro dependency 9149 */} IconComponent={(require(8129) /* metro dependency 8129: WarningIcon */).WarningIcon} variant="secondary" />)((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)}
|
|
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9GPbsV'])}
|
|
/>
|
|
);
|
|
}
|
|
items2[1] = (
|
|
<TableRowGroup hasIcons>
|
|
{tableSwitchRow}
|
|
{r12}
|
|
</TableRowGroup>
|
|
);
|
|
const tableSwitchRowProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['wrDmA/'])};
|
|
string = intl.string;
|
|
const UQbJW7 = (require(1244) /* metro dependency 1244: indexNative */).t.UQbJW7;
|
|
tableSwitchRowProps.subLabel = Reflect.apply(string, intl, [UQbJW7]);
|
|
tableSwitchRowProps.value = pauseDms;
|
|
tableSwitchRowProps.onValueChange = function() {
|
|
setPauseDms(!pauseDms);
|
|
};
|
|
tableSwitchRowProps.start = true;
|
|
tableSwitchRowProps.end = true;
|
|
items2[2] = <TableSwitchRow {...tableSwitchRowProps} />;
|
|
const ButtonGroup = (ButtonGroupNativeModule).ButtonGroup;
|
|
const Button = (ButtonNativeModule).Button;
|
|
const buttonProps = {onPress: onPress_87617,
|
|
text: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+']), variant: 'primary',
|
|
size: 'md'};
|
|
let r15 = pauseInvites !== hasInvitesDisabled2 || pauseDms !== hasDMsDisabled2;
|
|
r15 = !r15 ? hasTimeChanges : r15;
|
|
buttonProps.disabled = !r15;
|
|
items2[3] = (
|
|
<ButtonGroup>
|
|
<Button {...buttonProps} />
|
|
<Button
|
|
onPress={closure}
|
|
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])}
|
|
variant="secondary"
|
|
size="md"
|
|
/>
|
|
</ButtonGroup>
|
|
);
|
|
return (
|
|
<ActionSheet {...object}>
|
|
{items2}
|
|
</ActionSheet>
|
|
);
|
|
function _fun87608() { // fn#87608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1116, offset: 0x01fc5928, size: 36 bytes, params: 1, frame: 13
|
|
setPauseInvites(env0_5);
|
|
setPauseDms(env0_6);
|
|
}
|
|
|
|
function _fun87609() { // fn#87609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1153, offset: 0x01fc594c, size: 48 bytes, params: 1, frame: 11
|
|
const getState = useGuildIncidentsActionSheetStore.getState;
|
|
if (!Reflect.apply(getState, useGuildIncidentsActionSheetStore, []).hasTimeChanges) {
|
|
setInitialTime(env0_7);
|
|
}
|
|
}
|
|
|
|
function _fun87610() { // fn#87610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1216, offset: 0x01fc597c, size: 49 bytes, params: 1, frame: 12
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const getTimeframesBinding = getTimeframes;
|
|
value = undefined;
|
|
const value3 = getTimeframesBinding().find(function({value}) {
|
|
return value === time;
|
|
});
|
|
return value3 == null ? value : value3.label;
|
|
}
|
|
|
|
function onDurationSelectorClose() { // fn#87612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1317, owner: GuildIncidentActionsActionSheet.onDurationSelectorClose, offset: 0x01fc59c2, size: 90 bytes, params: 1, frame: 18
|
|
const showActionSheet = ActionSheetActionCreatorsModule.showActionSheet;
|
|
const object = {};
|
|
object.content = <GuildIncidentActionsActionSheet guild={guild} analyticsData={analyticsData} />;
|
|
object.key = 'GuildIncidentActionsActionSheet';
|
|
Reflect.apply(showActionSheet, ActionSheetActionCreatorsModule, [object]);
|
|
}
|
|
|
|
function GuildIncidentActionsActionSheetOnPress_87614() { // fn#87614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1902, owner: GuildIncidentActionsActionSheet.onPress, offset: 0x01fc5a50, size: 82 bytes, params: 1, frame: 17
|
|
const showActionSheet = ActionSheetActionCreatorsModule.showActionSheet;
|
|
const object = {};
|
|
object.content = <DurationSelectionActionSheet onClose={onDurationSelectorClose} />;
|
|
object.key = 'DurationSelectionActionSheet';
|
|
Reflect.apply(showActionSheet, ActionSheetActionCreatorsModule, [object]);
|
|
}
|
|
|
|
function GuildIncidentActionsActionSheetOnPress_87617() { // fn#87617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:2770, owner: GuildIncidentActionsActionSheet.onPress, offset: 0x01fc5ad6, size: 355 bytes, params: 1, frame: 27
|
|
var moduleValue4;
|
|
var showActionSheet;
|
|
const value = environment.__proto__;
|
|
const setGuildIncidentActions = GuildAntiRaidActionCreatorsModule.setGuildIncidentActions;
|
|
const guildBinding = guild;
|
|
const id = guildBinding.id;
|
|
const pauseInvitesBinding = pauseInvites;
|
|
const pauseDmsBinding = pauseDms;
|
|
const timeBinding = time;
|
|
Reflect.apply(setGuildIncidentActions, GuildAntiRaidActionCreatorsModule, [id, pauseInvitesBinding, pauseDmsBinding,
|
|
timeBinding]);
|
|
onPress_87613();
|
|
const {source, alertType, messageId} = analyticsData;
|
|
const defaultImport = AnalyticsUtils;
|
|
const track = defaultImport.track;
|
|
const GUILD_RAID_INTERVENTION_STATE_CHANGE = AnalyticEvents.GUILD_RAID_INTERVENTION_STATE_CHANGE;
|
|
let object = {};
|
|
object.guild_id = guildBinding.id;
|
|
object.source = source;
|
|
object.raid_alert_id = messageId;
|
|
object.raid_alert_type = alertType;
|
|
object.intervention_type_enabled = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).getEnabledInterventions(pauseInvitesBinding,
|
|
pauseDmsBinding);
|
|
object.intervention_type_disabled = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).getDisabledInterventions(pauseInvitesBinding,
|
|
pauseDmsBinding);
|
|
object.duration = 60 * timeBinding;
|
|
Reflect.apply(track, defaultImport, [GUILD_RAID_INTERVENTION_STATE_CHANGE, object]);
|
|
let r1 = !env0_5 && !env0_6;
|
|
r1 = !r1 ? pauseInvites : r1;
|
|
r1 = !r1 ? pauseDms : r1;
|
|
if (!r1) {
|
|
moduleValue4 = require(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
showActionSheet = moduleValue4.showActionSheet;
|
|
object = {};
|
|
object.content = ((Component) => <Component guildId={guild.id} />)(importDefault(11448) /* metro dependency 11448: GuildRaidLockdownFeedbackActionSheet */);
|
|
object.key = 'GuildRaidLockdownFeedbackActionSheet';
|
|
Reflect.apply(showActionSheet, moduleValue4, [object]);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun87602, 11445, [31, 10906, 11446, 8276, 661, 33, 4501, 6805, 6758, 1244, 6807, 632, 8275, 4080, 1305,
|
|
6238, 6231, 6808, 9149, 8129, 6261, 4578, 11447, 683, 11448,
|
|
2]) /* metro module 11445, dependencies: [31, 10906, 11446, 8276, 661, 33, 4501, 6805, 6758, 1244, 6807, 632, 8275, 4080, 1305, 6238, 6231, 6808, 9149, 8129, 6261, 4578, 11447, 683, 11448, 2] */;
|