/* Metro module 11138; source: modules/image_upload/native/AddImageDescriptionModal.tsx; dependencies: [57, 31, 27, 4645, 4644, 33, 4501, 697, 566, 1478, 1484, 5463, 10302, 9603, 1244, 7879, 11137, 7681, 9883, 2] */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */ import UploadAttachmentStore from '../../../stores/UploadAttachmentStore.tsx'; /* Metro dependency 4644 */ import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */ import UploadAttachmentActionCreators from '../../../actions/UploadAttachmentActionCreators.tsx'; /* Metro dependency 7879 */ import ModalStackNavigator from '../../main_tabs_v2/native/utils/ModalStackNavigator.tsx'; /* Metro dependency 9883 */ import UseSafeAreaAvoidingInputsNative from '../../safe_area/useSafeAreaAvoidingInputs.native.tsx'; /* Metro dependency 10302 */ import AddImageDescriptionModalActionCreators from './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 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 DraftStoreModule from '../../../stores/DraftStore.tsx'; /* Metro dependency 4645 */ import * as TextAreaNativeModule from '../../../design/components/TextInput/native/TextArea.native.tsx'; /* Metro dependency 7681 */ function _fun85186(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11324:6, offset: 0x01f666e1, size: 436 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.View; const env0_6 = value.Image; const env0_7 = value.ScrollView; value = require(33) /* metro dependency 33 */; const env0_10 = value.jsx; const env0_11 = value.jsxs; value = require(4501) /* metro dependency 4501: createStyles */; const createStyles = value.createStyles; object = {}; const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object.contentContainer = {backgroundColor: BACKGROUND_BASE_LOW}; const object3 = {alignItems: 'center'}; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; object.imageContainer = object3; const object4 = {'width': '100%', 'resizeMode': 'contain'}; object4.height = undefined; object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm; object.image = object4; const TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED; object.placeholderText = {color: TEXT_MUTED}; const env0_12 = Reflect.apply(createStyles, value, [object]); (FileImportTrackerModule).fileFinishedImporting('modules/image_upload/native/AddImageDescriptionModal.tsx'); exports.default = AddImageDescriptionModal; function AddDescription({source, channelId, id}) { // fn#85187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11324:516, offset: 0x01f66895, size: 929 bytes, params: 2, frame: 35 const env0_3 = undefined; let env0_4 = undefined; const styles = useStyles(); const upload = (require(566) /* metro dependency 566: flux */).useStateFromStores([UploadAttachmentStore], function() { return UploadAttachmentStore.getUpload(channelId, id, DraftType.ChannelMessage); }); const value3 = (UseWindowDimensionsNative)({ignoreKeyboard: true}); const width = source.width; const height = source.height; const r25 = width != null && height != null ? width === 0 || height === 0 ? 1 : width / height : 1; const binding = env0_4; const useState = binding.useState; const value8 = env0_3(Reflect.apply(useState, binding, [upload?.description ?? '']), 2); const property = value8[0]; const property2 = value8[1]; env0_4 = env0_4.useRef(property); const value9 = env0_4.useRef(null); const value10 = env0_4.useRef(null); const value11 = (UseNavigationNativeModule).useNavigation(); const insets = (UseSafeAreaInsetsKeyboardAwareNative)({includeKeyboardHeight: true}).insets; (UseSafeAreaAvoidingInputsNative)({insets: insets, inputs: [{ref: value9, offset: {type: 'toBottom'}}], scrollViewRef: value10}); env0_4.useEffect(_fun85189, [property]); env0_4.useEffect(_fun85190, [channelId, id, upload, value11]); const object3 = {}; let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object3.padding = PX_16; const bottom = insets.bottom; PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object3.paddingBottom = bottom + PX_16; const view = ( ); const TextArea = (TextAreaNativeModule).TextArea; const object4 = {ref: value9}; PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16; object4.containerStyle = {paddingTop: PX_16}; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; let string = intl.string; object4.label = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.eOB2eR]); string = intl.string; const RNH1jn = (require(1244) /* metro dependency 1244: indexNative */).t.RNH1jn; object4.placeholder = Reflect.apply(string, intl, [RNH1jn]); object4.value = property; object4.onChange = property2; object4.placeholderTextColor = styles.placeholderText.color; object4.maxLength = 1000; object4.autoFocus = true; return ( {view}