/* Metro module 11094; source: modules/media_uploads/native/UploadPreviewActionSheet.tsx; dependencies: [57, 31, 27, 4645, 6276, 33, 4501, 697, 44, 4650, 1478, 1585, 4594, 4080, 4673, 11095, 3857, 7684, 4660, 11133, 11134, 6275, 6277, 4572, 4573, 477, 9543, 8509, 6231, 6238, 11135, 11137, 1244, 8950, 11139, 7879, 6697, 11141, 4578, 4071, 2] */
import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import ImagePicker from '../../image/native/ImagePicker.tsx'; /* Metro dependency 4673 */
import UploadAttachmentActionCreators from '../../../actions/UploadAttachmentActionCreators.tsx'; /* Metro dependency 7879 */
import UseCanSetThumbnail from '../../media_channel/useCanSetThumbnail.tsx'; /* Metro dependency 11133 */
import UseSetMediaPostThumbnail from '../../media_channel/native/useSetMediaPostThumbnail.tsx'; /* Metro dependency 11134 */
import AddImageDescriptionModalActionCreators from '../../image_upload/native/AddImageDescriptionModalActionCreators.tsx'; /* Metro dependency 11137 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
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 DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */
import * as UploadModule from '../../../lib/uploader/Upload.tsx'; /* Metro dependency 4650 */
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 BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as ActionSheetConstantsModule from '../../action_sheet/native/ActionSheetConstants.tsx'; /* Metro dependency 6276 */
import * as Module06277Module from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
import * as TableCheckboxRowNativeModule from '../../../design/components/TableRow/native/TableCheckboxRow.native.tsx'; /* Metro dependency 8950 */
function _fun84935(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84935, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11280:6, offset: 0x01f5d433, size: 442 bytes, params: 8, frame: 22
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.Image;
const env0_6 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_9 = value.jsx;
const env0_10 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
object.contentContainer = {padding: 16};
const object3 = {};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object3.backgroundColor = BACKGROUND_SURFACE_HIGH;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object3.padding = PX_8;
let md = (importDefault(697) /* metro dependency 697: native */).radii.md;
object3.borderRadius = md;
object3.width = '100%';
object.imageWrap = object3;
md = (importDefault(697) /* metro dependency 697: native */).radii.md;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object.imageContainer = {'overflow': 'hidden', 'alignSelf': 'center', borderRadius: md - PX_4};
const env0_11 = Reflect.apply(createStyles, value, [object]);
(FileImportTrackerModule).fileFinishedImporting('modules/media_uploads/native/UploadPreviewActionSheet.tsx');
exports.default = UploadPreviewActionSheet;
function UploadPreviewActionSheet({onAdd, onEdit, onRemove, channelId, onClose, disableAddDescription, disableSpoiler, upload}) { // fn#84936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11280:529, offset: 0x01f5d5ed, size: 2198 bytes, params: 2, frame: 47
var r4;
var r23;
var r21;
var r15;
var r10;
var value18;
var space;
var value19;
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
const TableRow = (TableRowNativeModule).TableRow;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items4;
const TableCheckboxRow = (TableCheckboxRowNativeModule).TableCheckboxRow;
const Button = (ButtonNativeModule).Button;
const channelId2 = channelId;
disableAddDescription = !(disableAddDescription === undefined) && disableAddDescription;
const styles = useStyles();
const id = upload.id;
const isVideo = upload.isVideo;
const isImage = upload.isImage;
const isThumbnail = upload.isThumbnail;
const r28 = isThumbnail !== undefined && isThumbnail;
const item = upload.item;
const spoiler = upload.spoiler;
const defaultImport = Module00044;
const platform = item.platform;
const UploadPlatform = (UploadModule).UploadPlatform;
const REACT_NATIVE = UploadPlatform.REACT_NATIVE;
defaultImport(platform === REACT_NATIVE, 'Upload must be a React Native upload item.');
const width = (UseWindowDimensionsNative)().width;
const bottom = (UseSafeAreaInsetsNative)().bottom;
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
return _fun84938;
});
const binding = onClose;
const value5 = binding.useMemo(_fun84939, [width, item, styles]);
const value6 = binding.useCallback(_fun84940, [onRemove, id]);
const value7 = binding.useCallback(_fun84941, [onAdd]);
const value8 = binding.useCallback(_fun84942, [onEdit, item]);
const value9 = binding.useMemo(_fun84945, [isVideo, item]);
const r20 = isImage && !disableAddDescription;
const r24 = !r28 && !disableSpoiler;
const value13 = (UseCanSetThumbnail)(channelId, upload);
const value14 = (UseSetMediaPostThumbnail)(channelId, upload);
const [property, env0_11] = channelId2(onClose.useState(undefined), 2);
if (property != null) {
value18 = property + bottom;
space = (importDefault(697) /* metro dependency 697: native */).space;
value19 = value18 + space.PX_32;
space = (importDefault(697) /* metro dependency 697: native */).space;
r4 = value19 + space.PX_16;
} else {
r4 = undefined;
}
const r22 = isImage && onEdit != null;
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const BottomSheetScrollView = (Module06277Module).BottomSheetScrollView;
const object3 = {};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object3.padding = PX_16;
object3.paddingBottom = bottom;
const Stack = (StackNativeModule).Stack;
const object4 = {spacing: 16, onLayout: onLayout_84946};
const Text = (TextModule).Text;
const items5 = [
{item.filename}
,
];
const items2 = [styles.imageContainer];
items2[1] = {width: value5.width, height: value5.height};
const items3 = [
PlatformUtilsModule.isIOS() && isVideo && item.uri.startsWith('file://')
? ((VideoComponent) => )((require(9543) /* metro dependency 9543: Video */).VideoComponent)
: (
),
];
items3[1] = value9 != null && value9 !== '' && ((Caption) =>
)((require(8509) /* metro dependency 8509: Caption */).Caption);
items5[1] = (
{items3}
);
if (r20) {
if (r20) {
r23 = (
)((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)}
onPress={onPress_84947}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])}
arrow
/>
);
} else {
r23 = null;
}
items4 = [r23];
if (r24) {
r23 = (
)((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)}
onPress={function() {
importDefault(dependencyMap[13]).hideActionSheet();
var defaultImport2 = importDefault(dependencyMap[35]);
var channelIdBinding = channelId;
var idBinding = id;
var ChannelMessage = DraftType.ChannelMessage;
defaultImport2.update(channelIdBinding, idBinding, ChannelMessage, {spoiler: !spoiler});
}}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])}
checked={spoiler}
/>
);
} else {
r23 = null;
}
items4[1] = r23;
if (value13) {
r21 = (
)((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)}
onPress={value14}
checked={r28}
/>
);
} else {
r21 = value13;
}
items4[2] = r21;
if (r22) {
r21 = (
)((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)}
onPress={value8}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)}
arrow
/>
);
} else {
r21 = null;
}
items4[3] = r21;
r15 = (
{items4}
);
} else if (r24) {
if (r20) {
r23 = (
)((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)}
onPress={onPress_84947}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])}
arrow
/>
);
} else {
r23 = null;
}
items4 = [r23];
if (r24) {
r23 = (
)((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)}
onPress={onPress_84948}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])}
checked={spoiler}
/>
);
} else {
r23 = null;
}
items4[1] = r23;
if (value13) {
r21 = (
)((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)}
onPress={value14}
checked={r28}
/>
);
} else {
r21 = value13;
}
items4[2] = r21;
if (r22) {
r21 = (
)((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)}
onPress={value8}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)}
arrow
/>
);
} else {
r21 = null;
}
items4[3] = r21;
r15 = (
{items4}
);
} else if (value13) {
if (r20) {
r23 = (
)((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)}
onPress={onPress_84947}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])}
arrow
/>
);
} else {
r23 = null;
}
items4 = [r23];
if (r24) {
r23 = (
)((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)}
onPress={onPress_84948}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])}
checked={spoiler}
/>
);
} else {
r23 = null;
}
items4[1] = r23;
if (value13) {
r21 = (
)((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)}
onPress={value14}
checked={r28}
/>
);
} else {
r21 = value13;
}
items4[2] = r21;
if (r22) {
r21 = (
)((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)}
onPress={value8}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)}
arrow
/>
);
} else {
r21 = null;
}
items4[3] = r21;
r15 = (
{items4}
);
} else if (r22) {
if (r20) {
r23 = (
)((require(11135) /* metro dependency 11135: ImageFileIcon */).ImageFileIcon)}
onPress={onPress_84947}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5S2AK+'])}
arrow
/>
);
} else {
r23 = null;
}
items4 = [r23];
if (r24) {
r23 = (
)((require(11139) /* metro dependency 11139: SpoilerIcon */).SpoilerIcon)}
onPress={onPress_84948}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gsI+xC'])}
checked={spoiler}
/>
);
} else {
r23 = null;
}
items4[1] = r23;
if (value13) {
r21 = (
)((require(6697) /* metro dependency 6697: ImageIcon */).ImageIcon)}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ews2pj)}
onPress={value14}
checked={r28}
/>
);
} else {
r21 = value13;
}
items4[2] = r21;
if (r22) {
r21 = (
)((require(11141) /* metro dependency 11141: PencilSparkleIcon */).PencilSparkleIcon)}
onPress={value8}
label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.b0y3DL)}
arrow
/>
);
} else {
r21 = null;
}
items4[3] = r21;
r15 = (
{items4}
);
} else {
r15 = null;
}
items5[2] = r15;
if (onRemove != null) {
r10 = (