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,156 @@
// Metro module 10358 (f10359).
import * as _Module17 from "react-native";
import DeveloperOptionsStore from "../../../stores/DeveloperOptionsStore";
import { NativePermissionStatus } from "../../native_permissions/NativePermissionConstants";
import * as _PlatformUtils from "../../../utils/PlatformUtils";
import InAppNotificationActionCreators from "../../../actions/native/InAppNotificationActionCreators";
import { v4 } from "../../../_bundle/Module514";
import AutomaticLifecycleManager from "../../../lib/AutomaticLifecycleManager";
import BugReporterExperiment from "../BugReporterExperiment";
function $mk115660($env) {
return () => {
InAppNotificationActionCreators.clearNotification();
};
}
function $mk115661($env) {
return function addScreenshotEvent() {
const r2 = $env;
if (r2[3] == null) {
r2[3] = c6932_8.addListener("screenshotTaken", showNotification);
}
};
}
let c6932_8, c6932_10;
let env6932 = {};
const showNotification = function showNotification(a0) {
let env17897 = {
$parent: env6932
};
env17897[0] = function _getAndroidScreenshot() {
const r9 = async () => {
let image;
let c30213_0;
let c31529_0;
L15: {
L14: {
c31529_0 = void 0;
const photos = await _Module17.NativeModules.CameraRollUtils.getPhotos({
first: 1,
assetType: "photos"
});
c30213_0 = photos;
if (photos == null) {
c30213_0 = {};
}
c31529_0 = c30213_0.edges;
if (c31529_0 == null) {
break L15;
}
if (c31529_0.length > 0) {
image = c31529_0[0].node.image;
break L14;
}
break L15;
}
return image;
}
};
env17897[0] = r9;
return r9.apply(this, arguments);
};
env17897[1] = a0?.uri;
setTimeout(async () => {
let r25;
let c26666_0, c26666_1;
L19: {
L15: {
let env30214;
const r10 = env17897;
c26666_1 = r10;
const r9 = env30214 = {
$parent: r10
};
c26666_0 = r9;
env30214[0] = void 0;
const uri = env17897[1];
if (uri != null) {
r25 = {
uri
};
} else {
const isIOS = _PlatformUtils.isIOS();
r25 = void 0;
if (!isIOS) {
env30214[0] = await (function getAndroidScreenshot() {
return env17897[0].apply(this, arguments);
})();
InAppNotificationActionCreators.enqueueNotification({
type: "BUG_REPORTER",
duration: 5000,
key: v4(),
image: env30214[0],
imageUri: env30214[0]?.uri,
onDismiss: $mk115660(env17897.$parent),
inAppNotificationId: v4()
});
break L15;
}
}
env30214[0] = r25;
InAppNotificationActionCreators.enqueueNotification({
type: "BUG_REPORTER",
duration: 5000,
key: v4(),
image: env30214[0],
imageUri: env30214[0]?.uri,
onDismiss: $mk115660(env17897.$parent),
inAppNotificationId: v4()
});
break L19;
}
return void 0;
}
}, 1200);
};
const { NativeModules: NativeModules2, NativeEventEmitter } = _Module17;
c6932_8 = new NativeEventEmitter(NativeModules2.ScreenshotHelper);
class BugReportManager extends AutomaticLifecycleManager {
constructor() {
super(...arguments);
}
_initialize() {
this.initBugReporter();
}
_terminate() {
const r3 = env6932[3];
if (r3 != null) {
r3.remove();
}
env6932[3] = void 0;
}
async initBugReporter() {
let env30215;
const r25 = env6932;
let c26667_1 = r25;
const r11 = env30215 = {
$parent: r25
};
let c26667_0 = r11;
env30215[0] = void 0;
env30215[1] = void 0;
env30215[2] = void 0;
env30215[3] = void 0;
env30215[0] = await _Module17.NativeModules.NativePermissionManager.hasPhotoAuthorization() === NativePermissionStatus.AUTHORIZED;
env30215[1] = DeveloperOptionsStore.isBugReporterEnabled;
env30215[2] = BugReporterExperiment.getConfig({
location: "native-BugReportManager"
}).hasBugReporterAccess;
env30215[3] = _PlatformUtils.isIOS() || env30215[0];
if (env30215[2] && env30215[1] && env30215[3]) {
$mk115661(env6932)();
}
}
}
c6932_10 = BugReportManager;
const r43 = new BugReportManager();
export default r43;
@@ -0,0 +1,133 @@
// Metro module 10346 (f10347).
import Logger from "../../debug/Logger";
import { v4 } from "../../../_bundle/Module514";
import { getFileInfo } from "../../../utils/native/UploadUtils";
import SentryUtils_native from "../../../utils/SentryUtils.native";
let c6922_4;
const uriScheme = function uriScheme(a0) {
if (a0 == null) {
return "none";
}
const r4 = a0.match(/^([a-z][a-z0-9+.-]*):/i);
return r4 != null ? r4[1].toLowerCase() : "unknown";
};
c6922_4 = new Logger("BugReportUtils.tsx");
export async function getAttachments(c26658_0) {
let r33, r51, r96;
let c26658_1, c26658_2, c26658_5;
let c26658_6 = 0;
let c30209_1, c30209_2, c30209_3, c30209_4, c30209_5, c30209_0, c30209_6;
L17: {
try {
c30209_1 = void 0;
c30209_2 = void 0;
c30209_3 = void 0;
c30209_4 = void 0;
c30209_5 = void 0;
c30209_0 = [];
c26658_2 = c26658_0;
const r45 = c26658_0[Symbol.iterator]();
c26658_2 = r45.next;
c26658_1 = r45;
const r47 = c26658_2;
let r48 = c26658_1;
const r49 = r48 === void 0 ? void 0 : (r33 = r47.call(r48)).done ? r48 = void 0 : r33.value;
c26658_1 = r48;
if (r48 === void 0) {
r51 = c30209_0;
break L17;
}
c30209_1 = r49;
c26658_6 = 2;
c30209_2 = v4();
let r70 = await getFileInfo(c30209_1);
while (true) {
c30209_3 = r70;
c30209_0.push({
file: c30209_3,
name: c30209_2,
filename: c30209_3.name
});
c26658_6 = 0;
const r92 = c26658_2;
let r93 = c26658_1;
const r94 = r93 === void 0 ? void 0 : (r33 = r92.call(r93)).done ? r93 = void 0 : r33.value;
c26658_1 = r93;
if (r93 === void 0) {
r96 = c30209_0;
break;
}
c30209_1 = r94;
c26658_6 = 2;
c30209_2 = v4();
r70 = await getFileInfo(c30209_1);
}
} catch ($e) {
const r41 = $e;
let r8 = r41;
c26658_5 = r41;
let r42 = c26658_6;
if (r42 !== 0) {
while (true) {
if (r42 !== 1) {
try {
const r135 = c26658_5;
c26658_6 = 1;
c30209_6 = r135;
c30209_4 = uriScheme("uri" in c30209_1.item ? c30209_1.item.uri : void 0);
c6922_4.error("Failed to resolve bug report attachment", {
scheme: c30209_4,
filename: c30209_1.filename,
mimeType: c30209_1.mimeType,
isImage: c30209_1.isImage,
error: c30209_6
});
c30209_5 = c30209_6 instanceof Error ? c30209_6 : new Error(String(c30209_6));
SentryUtils_native.captureException(c30209_5, {
tags: {
feature: "bug_reporter",
attachment_uri_scheme: c30209_4
}
});
c26658_6 = 0;
const r181 = c26658_1;
if (r181 !== void 0 && typeof r181.return === "function") {
r181.return();
}
} catch (r132) {
r8 = r132;
c26658_5 = r132;
r42 = c26658_6;
if (r42 === 0) {
break;
}
continue;
}
return void 0;
}
try {
const r187 = c26658_5;
c26658_6 = 0;
const r189 = c26658_1;
if (r189 !== void 0 && typeof r189.return === "function") {
try {
r189.return();
} catch {}
}
throw r187;
} catch (r186) {
r8 = r186;
c26658_5 = r186;
r42 = c26658_6;
if (r42 === 0) {
break;
}
}
}
}
throw r8;
}
return r96;
}
return r51;
}
@@ -0,0 +1,59 @@
// Metro module 10343 (f10344).
import { useMemo } from "react";
import { Image as Image2, View } from "react-native";
import BugReportStore from "../BugReportStore";
import { UserSettingsSections } from "../../../Constants";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import Module712 from "../../../_bundle/Module712";
import { NotificationPressable } from "../../in_app_notifications/native/Notification";
import { SystemMessageText } from "../../in_app_notifications/native/MessagePreviewText";
import { trackDismissed } from "../../in_app_notifications/native/InAppNotificationUtils";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import InAppNotificationActionCreators from "../../../actions/native/InAppNotificationActionCreators";
import { openUserSettings } from "../../user_settings/core/native/openUserSettings";
const useStyles = createStyles({
preview: {
height: 64,
width: 32,
borderRadius: Module712.radii.sm
},
rightAccessoryContainer: {
marginLeft: Module712.space.PX_12
}
});
export function BugReporterNotification(props) {
const notification = props.notification;
const styles = useStyles();
const imageUri = notification.imageUri;
return <NotificationPressable header={useMemo(() => ({
type: "simple",
text: "Bug Catcher Clyde"
}), [])} rightAccessory={<View style={styles.rightAccessoryContainer}>
<Image2 source={{
uri: imageUri
}} style={styles.preview} />
</View>} onPress={function onPress() {
if (!BugReportStore.getField("isReportOpen")) {
trackDismissed({
type: notification.type,
dismissReason: "notification_clicked",
inAppNotificationId: notification.inAppNotificationId
});
ModalActionCreators.popAll();
InAppNotificationActionCreators.clearNotification();
BugReportStore.setState({
isReportOpen: true
});
ModalActionCreators.pushLazy(import("./components/BugReporterModal"), {
screenshotUri: notification.imageUri,
screenshot: notification.image
});
}
}} onSettingsPress={function onSettingsPress() {
openUserSettings({
screen: UserSettingsSections.OVERVIEW
});
}} notification={notification}>
<SystemMessageText text="Bzzz! Found a bug? Tap to submit." />
</NotificationPressable>;
}
@@ -0,0 +1,111 @@
// Metro module 10357 (f10358).
import * as Module19 from "react";
import { useState, useMemo, useCallback } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { Text } from "../../../../design/components/Text/native/Text";
import { getFeatureId } from "../../BugReportUtils";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { FormRadio } from "../../../../design/components/Forms/native/FormRadio.native";
import useSafeAreaInsetsKeyboardAware_native from "../../../safe_area/useSafeAreaInsetsKeyboardAware.native";
import Module12 from "../../../../_bundle/Module12";
import fuzzysearch from "../../../../_bundle/fuzzysearch";
import useScaledRowHeight from "../../../main_tabs_v2/native/shared_components/user_list/useScaledRowHeight";
import useScaledSectionHeight from "../../../main_tabs_v2/native/shared_components/user_list/useScaledSectionHeight";
import { BottomSheet } from "../../../../design/components/Sheet/native/BottomSheet.native";
import { BottomSheetTitleHeader } from "../../../../design/components/Sheet/native/BottomSheetTitleHeader.native";
import { intl, t } from "../../../../intl/index.native";
import { SearchField } from "../../../../design/components/TextField/native/SearchField.native";
import FastestList_android from "../../../fastest_list/FastestList.android";
let Component;
const useStyles = createStyles({
list: {
paddingHorizontal: Module712.space.PX_12
},
searchBar: {
paddingHorizontal: Module712.space.PX_12
},
sectionHeader: {
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
justifyContent: "center"
}
});
let Component2 = Module19.memo(function({ title, height: height2 }) {
return <View style={[useStyles().sectionHeader, {
height: height2
}]}>
<Text variant="text-sm/bold" color="text-muted">{title}</Text>
</View>;
});
Component = Module19.memo(function(a0) {
const { item, feature: feature2, setFeature } = a0;
return <TableRow start={a0.start} end={a0.end} label={item.name} onPress={() => {
setFeature(item);
ActionSheetActionCreators.hideActionSheet();
}} trailing={<FormRadio selected={getFeatureId(item) === getFeatureId(feature2)} />} />;
});
export default function BugReporterFeatureActionSheet(props) {
let items, height;
const { features, feature, setFeature: setFeature2 } = props;
items = void 0;
height = void 0;
const styles = useStyles();
const [state, onChange] = useState("");
const insets = useSafeAreaInsetsKeyboardAware_native().insets;
const memo = useMemo(() => {
const r17 = Object.entries(Module12.groupBy(features.filter((feature) => {
let r14 = feature.asana_inbox_id != null;
if (r14) {
let r18 = Module12.isEmpty(state);
if (!r18) {
const r10 = state.toLowerCase();
const name = feature.name;
let r21 = name == null ? void 0 : name.toLowerCase();
if (r21 == null) {
r21 = "";
}
r18 = fuzzysearch(r10, r21);
}
if (!r18) {
const r25 = state.toLowerCase();
const squad = feature.squad;
let r28 = squad == null ? void 0 : squad.toLowerCase();
if (r28 == null) {
r28 = "";
}
r18 = fuzzysearch(r25, r28);
}
r14 = r18;
}
return r14;
}), (a0) => a0.squad));
const sections = r17.map((item) => {
const [, r13] = item;
return r13.length;
});
return {
items: r17.map((item) => {
const [title, data] = item;
return {
title,
data
};
}),
sections
};
}, [features, state]);
items = memo.items;
const sections = memo.sections;
const scaledRowHeight = useScaledRowHeight();
height = useScaledSectionHeight();
const callback = useCallback((a0, a1) => <Component item={items[a0].data[a1]} feature={feature} setFeature={setFeature2} start={a1 === 0} end={a1 === items[a0].data.length - 1} />, [items, setFeature2, feature]);
const callback2 = useCallback((a0) => <Component2 title={items[a0].title} height={height} />, [height, items]);
return <BottomSheet scrollable startExpanded header={<BottomSheetTitleHeader title={intl.string(t["77VVd8"])} />}>
<View style={styles.searchBar}>
<SearchField size="md" onChange={onChange} />
</View>
<FastestList_android style={styles.list} inActionSheet sections={sections} itemSize={scaledRowHeight} estimatedListSize="windowSize" renderItem={callback} renderSectionHeader={callback2} sectionHeaderSize={height} insetEnd={Module712.space.PX_16 + insets.bottom} />
</BottomSheet>;
};
@@ -0,0 +1,685 @@
// Metro module 10345 (f10346).
import _asyncToGenerator from "../../../../_bundle/_asyncToGenerator";
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useState, useRef, useCallback, useEffect, useMemo } from "react";
import { ScrollView, View } from "react-native";
import UserStore from "../../../../stores/UserStore";
import BugReportStore from "../../BugReportStore";
import { jsx } from "react/jsx-runtime";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import Module689 from "../../../../_bundle/Module689";
import Durations from "../../../../utils/Durations";
import ModalActionCreators from "../../../../actions/ModalActionCreators";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { intl, t } from "../../../../intl/index.native";
import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native";
import Upload, { UploadPlatform } from "../../../../lib/uploader/Upload";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import Module7699 from "../../../../_bundle/Module7699";
import { getAttachments } from "../BugReportUtils";
import Backoff from "../../../../_bundle/Backoff";
import { submitReport, fetchBugReportConfig, getPriorities } from "../../BugReportUtils";
import Module10356 from "../../../../_bundle/Module10356";
import { HeaderActionButton } from "../../../../design/components/Navigator/native/HeaderActionButton.native";
import { TableRadioRow } from "../../../../design/components/TableRow/native/TableRadioRow.native";
import FastImage from "../../../../components_native/common/FastImage";
import { getEmojiURL } from "../../../../utils/AvatarUtils";
import ImagePicker from "../../../image/native/ImagePicker";
import { Stack } from "../../../../design/components/Stack/native/Stack.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { Card } from "../../../../design/components/Card/native/Card.native";
import AttachmentPreview from "../../../media/native/AttachmentPreview";
import { PressableOpacity } from "../../../../design/void/Pressables/native/Pressables";
import { Icon } from "../../../../design/void/native";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { TextInput } from "../../../../design/components/TextInput/native/TextInput.native";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
import ActionSheetActionCreators from "../../../action_sheet/native/ActionSheetActionCreators";
import { TableRadioGroup } from "../../../../design/components/TableRow/native/TableRadioGroup.native";
import { TextArea } from "../../../../design/components/TextInput/native/TextArea.native";
import { setDeveloperOptionSettings } from "../../../../actions/DeveloperOptionsActionCreators";
import BugReportManager from "../BugReportManager";
import Sticker from "../../../stickers/native/Sticker";
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
import { HermesBuiltin, $createGenerator } from "../../../../_hermes/prelude";
function $mk118159($env) {
return (a0) => [...a0, $env[3]];
}
function $mk118832($env) {
return () => {
(0, $env[14])(true);
};
}
function $mk118833($env) {
return function submitReportWithNotifications(a0, a1, a2) {
return $env[3].apply(this, arguments);
};
}
function $mk119116($env) {
return (a0) => {
$env[3].fail(a0);
};
}
let BugCreateScreen, c6921_13, useStyles, c6921_15, c6921_16, c6921_17, c6921_18;
let env6921 = {};
const handleClose = function handleClose() {
BugReportStore.setState({
isReportOpen: false
});
ModalActionCreators.pop();
};
BugCreateScreen = function BugCreateScreen(props) {
let env17891 = {
$parent: env6921
};
const screenshotUri2 = props.screenshotUri;
env17891[0] = screenshotUri2;
const screenshot2 = props.screenshot;
env17891[1] = screenshot2;
env17891[2] = void 0;
env17891[3] = void 0;
env17891[4] = void 0;
env17891[5] = void 0;
env17891[6] = void 0;
env17891[7] = void 0;
env17891[8] = void 0;
env17891[9] = void 0;
env17891[10] = void 0;
env17891[11] = void 0;
env17891[12] = void 0;
env17891[13] = void 0;
env17891[14] = void 0;
env17891[15] = void 0;
env17891[16] = void 0;
env17891[17] = void 0;
env17891[18] = void 0;
env17891[19] = void 0;
env17891[20] = void 0;
env17891[21] = void 0;
env17891[22] = void 0;
env17891[23] = void 0;
env17891[24] = void 0;
env17891[25] = function _handleAttachmentSelect() {
const r9 = async () => {
let env31525;
let c30208_1 = env17891;
const r9 = env31525 = {};
let c30208_0 = r9;
env31525[0] = void 0;
env31525[1] = void 0;
env31525[2] = void 0;
env31525[3] = void 0;
env31525[0] = await ImagePicker.launchImageLibraryAsync({
mediaType: "any",
includeBase64: false,
selectionLimit: 1
});
if (env31525[0] != null) {
env31525[1] = env31525[0].assets[0];
const r11 = env17891[23];
const r58 = env17891[7];
r11.current = r58.length;
env31525[2] = {
...env31525[1],
uri: env31525[1].uri,
originalUri: env31525[1].uri,
platform: UploadPlatform.REACT_NATIVE,
filename: env31525[1].fileName
};
env31525[3] = new Upload(env31525[2]);
r11.current = r58.length;
(0, env17891[8])($mk118159(c30208_0));
}
};
env17891[25] = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
env17891[2] = styles;
const r39 = _slicedToArray(useState(""), 2);
const r15 = r39[0];
env17891[3] = r15;
const onChange4 = r39[1];
const r42 = _slicedToArray(useState(""), 2);
const r25 = r42[0];
env17891[4] = r25;
const onChange2 = r42[1];
const r45 = _slicedToArray(useState(null), 2);
let defaultValue = r45[0];
env17891[5] = defaultValue;
const onChange3 = r45[1];
const r48 = _slicedToArray(useState(""), 2);
const r13 = r48[0];
env17891[6] = r13;
const onChange = r48[1];
const r52 = _slicedToArray(useState([]), 2);
const r32 = r52[0];
env17891[7] = r32;
env17891[8] = r52[1];
env17891[9] = useRef(false);
const r58 = _slicedToArray(useState(false), 2);
const r9 = r58[0];
env17891[10] = r9;
env17891[11] = r58[1];
const callback = useCallback((a0) => {
env17891[9].current = a0;
(0, env17891[11])(a0);
}, []);
env17891[12] = callback;
const r65 = _slicedToArray(useState(false), 2);
const r12 = r65[0];
env17891[13] = r12;
env17891[14] = r65[1];
const r69 = _slicedToArray(useState(false), 2);
const r70 = r69[0];
env17891[15] = r70;
env17891[16] = r69[1];
const r74 = _slicedToArray(useState(null), 2);
const r26 = r74[0];
env17891[17] = r26;
env17891[18] = r74[1];
const r78 = _slicedToArray(useState(null), 2);
const r27 = r78[0];
env17891[19] = r27;
env17891[20] = r78[1];
const navigation = useNavigation();
env17891[21] = navigation;
const ref = useRef(null);
env17891[22] = ref;
env17891[23] = useRef(0);
let r91 = useStateFromStores([UserStore], () => {
const currentUser = UserStore.getCurrentUser();
return (currentUser == null ? void 0 : currentUser.isStaff()) || (currentUser == null ? void 0 : currentUser.isStaffPersonal());
});
env17891[24] = r91;
useEffect(() => {
env17891[21].setOptions({
title: intl.string(t.mCCdwi),
headerLeft: getHeaderCloseButton(handleClose)
});
}, [navigation]);
useEffect(() => {
const uri = env17891[0];
if (uri != null) {
let c26654_0 = new Upload({
...env17891[1],
uri,
originalUri: uri,
platform: UploadPlatform.REACT_NATIVE
});
(0, env17891[8])((a0) => [...a0, c26654_0]);
}
}, [screenshotUri2, screenshot2]);
useEffect(() => {
let _handleSubmit2;
const handleSubmit2 = function handleSubmit() {
return _handleSubmit2.apply(this, arguments);
};
_handleSubmit2 = function _handleSubmit() {
const r9 = async () => {
let c31526_0, c31526_1, c31526_2;
let c31526_3 = 0;
const r11 = void 0;
const r10 = env17891;
L22: {
L19: {
try {
let env32001;
c31526_1 = r11;
const r18 = env32001 = {
$parent: r10
};
c31526_0 = r18;
env32001[0] = void 0;
env32001[1] = void 0;
env32001[2] = void 0;
env32001[3] = function _submitReportWithNotifications() {
const r9 = _asyncToGenerator(function(c32170_0, c32170_1, c32170_2) {
let c32170_3, c32170_4;
let c32170_5 = 0;
let c32170_6 = 0;
return $createGenerator(function(a0, a1, a2) {
let promise, value, value2;
const r0 = c32170_6;
if (r0 === 2) {
c32170_6 = 3;
HermesBuiltin.throwTypeError("Generator functions may not be called on executing generators");
throw new Error("unreachable");
}
if (r0 === 3) {
if (a0 === 1) {
throw a1;
}
if (a0 === 2) {
return {
value: a1,
done: true
};
}
return {
value: void 0,
done: true
};
}
L35: {
L33: {
L31: {
L22: {
L19: {
L9: {
try {
L32: {
c32170_6 = 2;
const r22 = c32170_5;
if (r22 === 0) {
if (a0 === 1) {
c32170_6 = 3;
throw a1;
}
if (a0 === 2) {
c32170_6 = 3;
break L35;
}
let env32187;
c32170_4 = env32001;
const r53 = env32187 = {};
c32170_3 = r53;
env32187[0] = c32170_0;
env32187[1] = c32170_1;
env32187[2] = c32170_2;
env32187[3] = void 0;
env32187[4] = void 0;
env32187[5] = void 0;
env32187[6] = void 0;
env32187[3] = new Backoff(c6921_17, c6921_18, true);
env32187[4] = false;
env32187[5] = 0;
if (env32187[5] < 20) {
break L32;
}
} else if (r22 === 1) {
if (a0 === 1) {
c32170_6 = 3;
throw a1;
}
if (a0 === 2) {
c32170_6 = 3;
break L22;
}
env32187[6] = a1;
if (env32187[6]?.ok) {
env32187[4] = true;
} else {
const r36 = c32170_4.$parent[15];
const r37 = c32170_3;
if (r36) {
promise = new Promise($mk119116(r37));
c32170_5 = 2;
c32170_6 = 1;
break L19;
}
env32187[4] = false;
}
} else {
if (a0 === 1) {
c32170_6 = 3;
throw a1;
}
if (a0 === 2) {
c32170_6 = 3;
break L9;
}
env32187[5] = env32187[5] + 1;
if (env32187[5] < 20) {
break L32;
}
}
const r70 = env32187[4];
if (r70) {
env32187[3].succeed();
ToastActionCreators.open({
key: "BUG_REPORT_BUG_SUBMITTED",
icon: Module10356,
content: intl.string(t.jB8yOL),
toastDurationMs: c6921_16
});
value = true;
} else {
ToastActionCreators.open({
key: "BUG_REPORT_FAILED_TO_SUBMIT",
icon: Module7699,
content: intl.string(t["4t1o0u"])
});
value = false;
}
c32170_6 = 3;
break L31;
}
value2 = submitReport(env32187[0], env32187[1], env32187[2]);
c32170_5 = 1;
c32170_6 = 1;
break L33;
} catch (r146) {
c32170_6 = 3;
throw r146;
}
}
return {
value: a1,
done: true
};
}
return {
value: promise,
done: false
};
}
return {
value: a1,
done: true
};
}
return {
value,
done: true
};
}
return {
value: value2,
done: false
};
}
return {
value: a1,
done: true
};
});
});
env32001[3] = r9;
return r9.apply(this, arguments);
};
if (env17891[9].current) {
if (!env17891[13]) {
break L22;
}
ToastActionCreators.open({
key: "BUG_REPORT_SUBMITTING_BUG",
icon: Module7699,
content: intl.string(t.Uuqbcm),
toastDurationMs: c6921_16
});
(0, env17891[16])(true);
handleClose();
break L22;
}
(0, env17891[12])(true);
if (env17891[5] == null) {
ToastActionCreators.open({
key: "BUG_REPORT_FAILED_TO_SUBMIT",
icon: Module7699,
content: intl.string(t["4t1o0u"])
});
(0, env17891[12])(false);
break L19;
}
env32001[0] = await getAttachments(env17891[7]);
(0, env17891[14])(false);
const r100 = setTimeout;
env32001[1] = r100($mk118832(env17891), c6921_15);
const r106 = c31526_0;
c31526_3 = 1;
const r110 = {
name: env17891[3],
priority: env17891[5],
description: env17891[4],
feature: env17891[19],
url: env17891[6]
};
const r115 = env32001[0];
env32001[2] = await $mk118833(r106)(r110, {
overridePlatformInformation: false
}, r115);
if (env32001[2]) {
(0, env17891[16])(true);
(0, handleClose)();
}
c31526_3 = 0;
(0, env17891[12])(false);
(0, env17891[14])(false);
clearTimeout(env32001[1]);
} catch ($e) {
const r35 = $e;
let r7 = r35;
c31526_2 = r35;
if (c31526_3 !== 0) {
while (true) {
try {
const r197 = c31526_2;
c31526_3 = 0;
(0, env17891[12])(false);
(0, env17891[14])(false);
clearTimeout(env32001[1]);
throw r197;
} catch (r193) {
r7 = r193;
c31526_2 = r193;
if (c31526_3 === 0) {
break;
}
}
}
}
throw r7;
}
return void 0;
}
return void 0;
}
};
_handleSubmit2 = r9;
return r9.apply(this, arguments);
};
env17891[21].setOptions({
headerRight: () => {
const r8 = env17891[13];
const text = r8 ? intl.string(t["tUu8V+"]) : env17891[10] ? intl.string(t.ZiWcJ0) : intl.string(t.geKm7t);
const r35 = env17891[3];
return <HeaderActionButton text={text} textStyle={{
maxWidth: null
}} onPress={handleSubmit2} disabled={r35 == null || r35 === "" || env17891[5] == null || env17891[4] == null || env17891[4] === "" || env17891[10] && !r8} />;
}
});
}, [r25, r27, r15, navigation, defaultValue, r13, r32, r9, r12, r70, callback]);
useEffect(() => {
let _fetchConfig2 = function _fetchConfig() {
const r9 = async () => {
let c31527_1;
c31527_1 = void 0;
const bugReportConfig = await fetchBugReportConfig();
const r42 = c31527_1;
let c32002_0 = bugReportConfig;
(0, r42.$parent[18])(c32002_0);
};
_fetchConfig2 = r9;
return r9.apply(this, arguments);
};
if (env17891[24]) {
(function fetchConfig() {
return _fetchConfig2.apply(this, arguments);
})();
}
}, [r91]);
useEffect(() => {
if (env17891[7].length > env17891[23].current) {
const current = env17891[22].current;
if (current != null) {
current.scrollToEnd();
}
}
}, [r32]);
const r166 = [<Stack spacing={8}>
<Text variant="text-sm/semibold" color="text-subtle">
{intl.string(t.tM969v)}
</Text>
<Card>
<ScrollView horizontal ref={ref} contentContainerStyle={styles.attachmentCarousel}>
{r32.map((a0) => {
const r9 = env17891[2];
const r22 = [<AttachmentPreview uri={a0.item.uri} isImage={a0.isImage} isVideo={a0.isVideo} height={280} width={134} />, ,];
let c26657_0 = a0;
r22[1] = <PressableOpacity onPress={() => {
(0, env17891[8])((a0) => a0.filter((item) => item !== c26657_0));
}} style={r9.closeContainer}>
<Icon source={Module7699} size={Icon.Sizes.REFRESH_SMALL_16} color={Module712.unsafe_rawColors.WHITE} />
</PressableOpacity>;
return <View key={a0.id} style={r9.attachmentContainer}>{r22}</View>;
})}
</ScrollView>
<Button text={intl.string(t.HVxmOD)} onPress={function handleAttachmentSelect() {
return env17891[25].apply(this, arguments);
}} />
</Card>
</Stack>, <TextInput label={intl.string(t.OZRgjw)} placeholder={intl.string(t["6mpW05"])} onChange={onChange4} isClearable autoCapitalize="sentences" />, , , , , ,];
if (r91) {
r91 = <TableRowGroup title={intl.string(t["77VVd8"])} hasIcons={false}>
<TableRow disabled={r26 == null} onPress={() => {
const r13 = import("./BugReporterFeatureActionSheet");
const r14 = env17891[17];
return ActionSheetActionCreators.openLazy(r13, "BugReporterFeatureActionSheet", {
features: r14 != null ? r14.features : [],
feature: env17891[19],
setFeature: env17891[20]
});
}} label={r27 != null ? r27.name : intl.string(t["77VVd8"])} arrow />
</TableRowGroup>;
}
r166[2] = r91;
const props2 = {
title: intl.string(t.xMXLda),
defaultValue: null,
onChange: null,
hasIcons: true,
children: null
};
if (defaultValue == null) {
defaultValue = -1;
}
props2.defaultValue = defaultValue;
props2.onChange = onChange3;
props2.children = getPriorities().map(({ title, description, emoji, value }) => <TableRadioRow key={value} value={value} label={title} subLabel={description} icon={<FastImage style={env17891[2].priorityIcon} source={{
uri: getEmojiURL({
id: emoji,
animated: true,
size: 48
})
}} resizeMode="contain" />} />);
r166[3] = <TableRadioGroup {...props2} />;
r166[4] = <TextArea label={intl.string(t["1SplH2"])} placeholder={intl.string(t.CQmAZd)} onChange={onChange2} autoCorrect autoCapitalize="sentences" />;
r166[5] = <TextInput label={intl.string(t["7p5pqh"])} placeholder={intl.string(t.HewMzo)} onChange={onChange} isClearable />;
r166[6] = <View style={styles.offButton}>
<Button text={intl.string(t["636e+U"])} size="sm" variant="secondary" onPress={() => {
setDeveloperOptionSettings({
bugReporterEnabled: false
});
BugReportManager.terminate(true);
BugReportStore.setState({
isReportOpen: false
});
ModalActionCreators.pop();
ToastActionCreators.open({
key: "BUG_REPORT_HAS_BEEN_TURNED_OFF_TEXT",
icon: Module10356,
content: intl.string(t["J3/feu"])
});
}} />
</View>;
return <>
<ScrollView>
<Stack spacing={24} style={styles.container}>{r166}</Stack>
</ScrollView>
{r9 ? jsx(function Submitting() {
const styles = useStyles();
return <View style={styles.submittingOverlay}>
<Sticker sticker={c6921_13} animated size={148} />
<Text style={styles.submittingText} variant="heading-md/medium">
{intl.string(t.Uuqbcm)}
</Text>
</View>;
}, {}) : null}
</>;
};
c6921_13 = Object.freeze({
id: "749049128012742676",
format_type: 3,
name: "Wumpus zipping by on a monowheel"
});
useStyles = createStyles({
container: {
padding: 16
},
attachmentCarousel: {
justifyContent: "center",
minWidth: "100%"
},
attachmentContainer: {
marginHorizontal: 4,
marginBottom: 16
},
closeContainer: {
position: "absolute",
top: 6,
right: 10,
height: 20,
width: 20,
borderRadius: Module712.radii.round,
alignItems: "center",
justifyContent: "center",
backgroundColor: Module689(Module712.unsafe_rawColors.BLACK).alpha(0.5).css()
},
priorityIcon: {
width: 24,
height: 24
},
offButton: {
marginBottom: 24
},
submittingOverlay: {
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_SCRIM,
bottom: 0,
flex: 1,
justifyContent: "center",
position: "absolute",
top: 0,
width: "100%"
},
submittingText: {
marginTop: 8
}
});
c6921_15 = 5 * Durations.Millis.SECOND;
c6921_16 = 10 * Durations.Millis.SECOND;
c6921_17 = 5 * Durations.Millis.SECOND;
c6921_18 = 1 * Durations.Millis.MINUTE;
export default function BugReportModal({ screenshotUri, screenshot }) {
return (0, jsx)(Navigator, {
screens: useMemo(() => {
const initialParams = {
screenshotUri,
screenshot
};
return {
BUG_REPORT_CREATE: {
title: intl.string(t.mCCdwi),
initialParams,
render: (a0) => <BugCreateScreen {...a0} />
}
};
}, [screenshotUri, screenshot]),
initialRouteName: "BUG_REPORT_CREATE"
});
};
export { BugCreateScreen };