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

1344 lines
77 KiB
TypeScript

/* Metro module 11854; source: modules/autocompleter/native/AutocompleteWrapper.tsx; dependencies: [57, 31, 27, 7168, 6540, 4257, 6583, 661, 5066, 11018, 6625, 11086, 1881, 33, 11855, 4501, 477, 697, 1478, 5463, 5314, 566, 3860, 3829, 6748, 11085, 8530, 5065, 1909, 11017, 11857, 1583, 4863, 11859, 1357, 4559, 11860, 7882, 11752, 4017, 11861, 5068, 11868, 4573, 1244, 7331, 11869, 2] */
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseWindowDimensionsNative from '../../screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import GatewayConnectionStore from '../../gateway/GatewayConnectionStore.tsx'; /* Metro dependency 4257 */
import UseSafeAreaInsetsKeyboardAwareNative from '../../safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import EmojiStore from '../../emojis/EmojiStore.tsx'; /* Metro dependency 6540 */
import StickersStore from '../../stickers/StickersStore.tsx'; /* Metro dependency 6583 */
import ApplicationCommandStore from '../../application_commands/ApplicationCommandStore.tsx'; /* Metro dependency 7168 */
import UseAutocompleteAnimatedHeightStyles from './useAutocompleteAnimatedHeightStyles.tsx'; /* Metro dependency 11860 */
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 ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as MobileVisualRefreshExperimentModule from '../../themes/experiments/MobileVisualRefreshExperiment.tsx'; /* Metro dependency 1357 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
import * as ServerModule from '../../../flow/Server.tsx'; /* Metro dependency 1909 */
import * as UserSettingsModule from '../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */
import * as UseTokenModule from '../../../design/tokens/native/useToken.tsx'; /* Metro dependency 3860 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as UseIsScreenReaderEnabledNativeModule from '../../a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as ApplicationCommandConstantsModule from '../../application_commands/ApplicationCommandConstants.tsx'; /* Metro dependency 5066 */
import * as ApplicationCommandTypesModule from '../../application_commands/ApplicationCommandTypes.tsx'; /* Metro dependency 5068 */
import * as NavigatorConstantsNativeModule from '../../../design/components/Navigator/native/NavigatorConstants.native.tsx'; /* Metro dependency 5314 */
import * as ChannelAutocompleteConstantsModule from '../../channel_autocomplete/ChannelAutocompleteConstants.tsx'; /* Metro dependency 6625 */
import * as RedesignCompatNativeModule from '../../../design/components/RedesignCompat/native/RedesignCompat.native.tsx'; /* Metro dependency 6748 */
import * as ApplicationCommandsConstantsModule from '../../application_commands/native/ApplicationCommandsConstants.tsx'; /* Metro dependency 11018 */
import * as AutocompleteOptionsModule from './AutocompleteOptions.tsx'; /* Metro dependency 11085 */
import * as ChannelAutocompleteConstantsModule2 from '../../channel_text_area/native/ChannelAutocompleteConstants.tsx'; /* Metro dependency 11086 */
import * as AutocompleteModule from './Autocomplete.tsx'; /* Metro dependency 11855 */
import * as ChannelAutocompleteAnalyticsModule from '../../channel_text_area/native/ChannelAutocompleteAnalytics.tsx'; /* Metro dependency 11859 */
function _fun90825(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#90825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6, offset: 0x02047d5e, size: 657 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const StyleSheet = ReactNativeModule.StyleSheet;
const hairlineWidth = StyleSheet.hairlineWidth;
const AUTOCOMPLETE_STICKER_NODE_SIZE = (AutocompleteModule).AUTOCOMPLETE_STICKER_NODE_SIZE;
const env0_27 = 284 + AUTOCOMPLETE_STICKER_NODE_SIZE + 12 + hairlineWidth;
const env0_28 = (CreateStylesModule).createStyles(_fun90827);
object = {'resultCount': 0, 'stickerResults': null, 'nonStickerResults': null, 'hasStickerResults': false,
'hasNonStickerResults': false};
object.stickerResults = [];
object.nonStickerResults = [];
const value8 = value.forwardRef(_fun90830);
value8.displayName = 'AutocompleteWrapper';
value = value.memo(value8);
(FileImportTrackerModule).fileFinishedImporting('modules/autocompleter/native/AutocompleteWrapper.tsx');
exports.default = value;
function getAutocompletesHeight(a0, a1, a2, a3) { // fn#90826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:1691, offset: 0x02047fef, size: 79 bytes, params: 5, frame: 6
var r0;
let value = a3;
const value2 = 0;
if (value2 === a0) {
r0 = value2;
} else {
value = a0 * (a2 ? value : a1 === AutocompleteTypes.EMOJIS_AND_STICKERS ? AUTOCOMPLETE_EMOJI_ROW_HEIGHT : AUTOCOMPLETE_ROW_HEIGHT);
value += (a0 - 1) * hairlineWidth;
r0 = value;
}
return r0;
}
function _fun90827(a0, a1, a2, a3, a4) { // fn#90827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:663, offset: 0x0204803e, size: 405 bytes, params: 6, frame: 17
const object = {};
const value = 'relative';
object.autocompletePositionRelative = {position: value};
const object3 = {};
object3.position = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? value : 'absolute';
object3.marginHorizontal = a3;
object3.marginBottom = a4;
object.autocompleteWrapper = object3;
object.autocompleteWrapperAbsolute = {'left': 0, 'right': 0, 'bottom': 0};
const object4 = {};
let MOBILE_FLOATING_ACCESSORY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND;
object4.backgroundColor = MOBILE_FLOATING_ACCESSORY_BACKGROUND;
object4.borderRadius = a0;
object4.borderWidth = a1;
object4.borderTopWidth = a2;
let MOBILE_FLOATING_ACCESSORY_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BORDER;
object4.borderColor = MOBILE_FLOATING_ACCESSORY_BORDER;
object4.overflow = 'hidden';
object.autocompleteContainer = object4;
MOBILE_FLOATING_ACCESSORY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND;
object.autocomplete = {'flexGrow': 0, 'flexShrink': 1, backgroundColor: MOBILE_FLOATING_ACCESSORY_BACKGROUND};
MOBILE_FLOATING_ACCESSORY_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BORDER;
object.sectionDivider = {backgroundColor: MOBILE_FLOATING_ACCESSORY_BORDER, marginLeft: -16};
MOBILE_FLOATING_ACCESSORY_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BACKGROUND;
object.sectionTitle = {'height': 18, 'backgroundColor': null, 'paddingLeft': 12, 'marginVertical': 12,
'alignItems': 'center', backgroundColor: MOBILE_FLOATING_ACCESSORY_BACKGROUND};
const object8 = {};
const AUTOCOMPLETE_STICKER_NODE_MARGIN = (AutocompleteModule).AUTOCOMPLETE_STICKER_NODE_MARGIN;
object8.paddingLeft = 12 - AUTOCOMPLETE_STICKER_NODE_MARGIN;
object8.marginBottom = 12;
const AUTOCOMPLETE_STICKER_NODE_SIZE = (AutocompleteModule).AUTOCOMPLETE_STICKER_NODE_SIZE;
object8.height = AUTOCOMPLETE_STICKER_NODE_SIZE;
object8.flexShrink = 0;
object.stickersAutocompleteList = object8;
return object;
}
function isSlashAutocompleteType(a0) { // fn#90828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:1649, offset: 0x020481d3, size: 39 bytes, params: 2, frame: 4
const SLASHES = AutocompleteTypes.SLASHES;
return a0 === SLASHES || a0 === AutocompleteTypes.SLASHES_DISCOVERY;
}
function getStickersItemLayout(a0, a1) { // fn#90829, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:1819, offset: 0x020481fa, size: 119 bytes, params: 3, frame: 16
const object = {};
const AUTOCOMPLETE_STICKER_NODE_SIZE = (AutocompleteModule).AUTOCOMPLETE_STICKER_NODE_SIZE;
object.length = AUTOCOMPLETE_STICKER_NODE_SIZE;
const AUTOCOMPLETE_STICKER_NODE_MARGIN = (AutocompleteModule).AUTOCOMPLETE_STICKER_NODE_MARGIN;
object.offset = a1 * (AUTOCOMPLETE_STICKER_NODE_SIZE + AUTOCOMPLETE_STICKER_NODE_MARGIN) + (a1 - 1) * AUTOCOMPLETE_STICKER_NODE_MARGIN;
object.index = a1;
return object;
}
function _fun90830({analyticsLocations, channel, canMentionEveryone, keyboardType, onChangeAutoCompleteVisibility, commandsDisabled, chatInputRef, canOnlyUseTextCommands, screenIndex}, a1) { // fn#90830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:2148, offset: 0x02048271, size: 3292 bytes, params: 3, frame: 62
var r23;
var r34;
var r33;
var jsxRuntimeEnv0_24Binding;
var items3;
var value49;
var jsxRuntimeEnv0_24Binding2;
var jsxRuntimeEnv0_24Binding3;
const Text = (TextModule).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var items4;
var object;
var items5;
const keyboardType2 = keyboardType;
const onChangeAutoCompleteVisibility2 = onChangeAutoCompleteVisibility;
const {optionStates, activeOption, activeCommand,
activeSection} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ApplicationCommandStore],
function() {
var object = {};
var applicationCommandStoreBinding = ApplicationCommandStore;
var channelBinding = channel;
object.optionStates = applicationCommandStoreBinding.getOptionStates(channelBinding.id);
object.activeOption = applicationCommandStoreBinding.getActiveOption(channelBinding.id);
object.activeCommand = applicationCommandStoreBinding.getActiveCommand(channelBinding.id);
object.activeSection = applicationCommandStoreBinding.getActiveCommandSection(channelBinding.id);
return object;
});
let useToken = UseTokenModule.useToken;
const TABLE_ROW_HEIGHT = (Native).modules.mobile.TABLE_ROW_HEIGHT;
const value3 = Reflect.apply(useToken, UseTokenModule, [TABLE_ROW_HEIGHT]);
const IncludeStickersInAutocomplete = (UserSettingsModule).IncludeStickersInAutocomplete;
const setting = IncludeStickersInAutocomplete.getSetting();
let binding = onChangeAutoCompleteVisibility2;
let useState = binding.useState;
const value5 = Reflect.apply(useState, binding, [env0_31]);
const binding2 = keyboardType2;
const value6 = binding2(value5, 2);
var property = value6[0];
const resultCount = property.resultCount;
const stickerResults = property.stickerResults;
const nonStickerResults = property.nonStickerResults;
const hasStickerResults = property.hasStickerResults;
const hasNonStickerResults = property.hasNonStickerResults;
const env0_17 = value6[1];
const loadState = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], function() {
return EmojiStore.loadState;
});
const loadState2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([StickersStore], function() {
return StickersStore.loadState;
});
const useContext = binding.useContext;
const RedesignCompatContext = (RedesignCompatNativeModule).RedesignCompatContext;
const value8 = Reflect.apply(useContext, binding, [RedesignCompatContext]);
const value9 = binding.useMemo(_fun90834, [channel, setting]);
useState = binding.useState;
const value10 = '';
const value11 = binding2(Reflect.apply(useState, binding, [{'focused': false, 'text': '', 'selectionStart': 0,
'selectionEnd': 0}]), 2);
property = value11[0];
const focused = property.focused;
const text = property.text;
const selectionStart = property.selectionStart;
const selectionEnd = property.selectionEnd;
const env0_24 = value11[1];
useState = binding.useState;
const value12 = binding2(Reflect.apply(useState, binding, [0]), 2);
property = value12[0];
const env0_25 = value12[1];
binding.useEffect(function() {
var env0_0 = false;
GatewayConnectionStore.addConditionalChangeListener(_fun90836);
return _fun90837;
}, []);
binding.useImperativeHandle(a1, binding.useMemo(function() {
var env0_0 = -1;
return _fun90839;
}, []));
const {autocompleteType, query, queryOptions, autocompleteSelectionStart,
showOptionValuesPicker} = binding.useMemo(_fun90843, [selectionStart, selectionEnd, text, activeCommand,
optionStates, activeOption, canMentionEveryone, commandsDisabled, value9, loadState, loadState2]);
const value15 = binding.useCallback(_fun90846, [autocompleteType, query, queryOptions, value9]);
binding.useEffect(_fun90848, [autocompleteType, value15, value9]);
binding.useEffect(_fun90851, [value15]);
const value16 = binding.useCallback(function() {
var object = {};
object.numStickerResults = stickerResults.length;
object.numEmojiResults = nonStickerResults.filter(_fun90853).length;
return object;
}, [stickerResults, nonStickerResults]);
const value17 = binding.useMemo(_fun90854, [autocompleteType, focused, keyboardType, resultCount]);
const env0_34 = binding.useRef(false);
binding.useEffect(_fun90855, [autocompleteType, activeCommand]);
binding.useEffect(_fun90856, [onChangeAutoCompleteVisibility, activeCommand, value17, autocompleteType, channel,
value16]);
const value18 = (UseWindowDimensionsNative)({ignoreKeyboard: true});
const insets = (UseSafeAreaInsetsKeyboardAwareNative)({includeKeyboardHeight: true}).insets;
const value20 = value18.height - insets.top - insets.bottom;
const NAV_BAR_HEIGHT = (NavigatorConstantsNativeModule).NAV_BAR_HEIGHT;
const value22 = binding.useMemo(_fun90857, [autocompleteType, stickerResults.length,
value20 - NAV_BAR_HEIGHT - property]);
useState = binding.useState;
const value23 = binding2(Reflect.apply(useState, binding, [null]), 2);
property = value23[0];
const property2 = value23[1];
const value24 = binding.useMemo(_fun90858, [resultCount, autocompleteType, value17, hasStickerResults,
hasNonStickerResults, nonStickerResults.length, value22, property, value8, value3]);
const useMobileVisualRefreshConfig = MobileVisualRefreshExperimentModule.useMobileVisualRefreshConfig;
const chatInputFloating = Reflect.apply(useMobileVisualRefreshConfig, MobileVisualRefreshExperimentModule,
[{location: 'AutocompleteWrapper'}]).chatInputFloating;
const value25 = value24 > 0;
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_BORDER_RADIUS = (Native).modules.mobile.CHAT_INPUT_FLOATING_BORDER_RADIUS;
const value26 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_BORDER_RADIUS]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH = (Native).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH;
const value27 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH = (Native).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH;
const value28 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_ACCESSORY_TOP_BORDER_WIDTH]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL = (Native).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL;
const value29 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_HORIZONTAL]);
useToken = UseTokenModule.useToken;
const CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM = (Native).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM;
const value30 = Reflect.apply(useToken, UseTokenModule, [CHAT_INPUT_FLOATING_ACCESSORY_MARGIN_BOTTOM]);
const r36 = value25 || activeCommand != null && !commandsDisabled;
const r19 = value25 ? value27 : 0;
let r12 = value25 ? value28 : 0;
let r10 = r36 ? value29 : 0;
const styles = useStyles(value26, r19, r12, r10, r36 ? value30 : 0);
const value33 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
r10 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() || (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && (value33 || chatInputFloating);
binding = onChangeAutoCompleteVisibility2;
const value34 = binding.useMemo(_fun90859, [value33, chatInputFloating, styles.autocompletePositionRelative]);
const value35 = binding.useMemo(_fun90860, [value25, value30]);
const value36 = (UseAutocompleteAnimatedHeightStyles)(value24,
screenIndex);
const value37 = binding.useCallback(_fun90861, [analyticsLocations, channel, chatInputRef]);
const value38 = binding.useCallback(_fun90862, [chatInputRef, optionStates, channel]);
const value39 = binding.useCallback(_fun90863, [autocompleteSelectionStart, autocompleteType, value16, channel,
value37, showOptionValuesPicker]);
var [property, env0_47] = keyboardType2(binding.useState(null), 2);
const value42 = binding.useCallback(_fun90864, [autocompleteType, value39, property, channel, activeCommand]);
items6 = [styles.autocomplete];
items6[1] = {maxHeight: value22};
const items7 = [styles.autocompleteWrapper];
r10 = !r10 && styles.autocompleteWrapperAbsolute;
items7[1] = r10;
items7[2] = value34;
const View2 = (ReanimatedRexport).View;
const items2 = [styles.autocompleteContainer, value36];
const value44 = autocompleteType != null;
if (value44) {
jsxRuntimeEnv0_24Binding = jsxRuntimeEnv0_24;
r23 = autocompleteType === AutocompleteTypes.SLASHES_DISCOVERY && ((Component) => <Component channel={channel} onPressSlashItem={onPressSlashItem} onHeightChange={property2} canOnlyUseTextCommands={canOnlyUseTextCommands} />)(importDefault(11861) /* metro dependency 11861: ApplicationCommandDiscovery */);
items3 = [r23];
r23 = autocompleteType === AutocompleteTypes.SLASHES && ((Component) => <Component channel={channel} query={query ?? value10} onPressCommandItem={onPressCommandItem} style={items6} ItemSeparatorComponent={(require(11017) /* metro dependency 11017: AutocompleteUtils */).getItemSeparator} getItemLayout={(require(11017) /* metro dependency 11017: AutocompleteUtils */).getItemLayout} onCommandsChange={onCommandsChange} />)(importDefault(11868) /* metro dependency 11868: ApplicationCommandList */);
items3[1] = r23;
value49 = autocompleteType === AutocompleteTypes.EMOJIS_AND_STICKERS;
if (value49) {
jsxRuntimeEnv0_24Binding2 = jsxRuntimeEnv0_24;
if (hasStickerResults) {
jsxRuntimeEnv0_24Binding3 = jsxRuntimeEnv0_24;
items4 = [
<Text style={styles.sectionTitle} variant="text-sm/semibold">
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.uferGG,
{prefix: query})}
</Text>,
];
object = {};
copyDataProperties(object, items6, r12);
copyDataProperties(object, styles.stickersAutocompleteList, r12);
items4[1] = (
<FlatList
horizontal
style={object}
keyExtractor={function(a0) {
return a0.sticker.id;
}}
data={stickerResults}
renderItem={value42}
showsHorizontalScrollIndicator={false}
getItemLayout={getStickersItemLayout}
contentInset={{right: 12}}
/>
);
r34 = (
<>
{items4}
</>
);
} else {
r34 = hasStickerResults;
}
items5 = [r34];
r33 = hasStickerResults && hasNonStickerResults;
r33 = r33 && ((Component) => <Component style={styles.sectionDivider} />)(importDefault(7331) /* metro dependency 7331: FormDivider */);
items5[1] = r33;
items5[2] = hasNonStickerResults && <Text style={styles.sectionTitle} variant="text-sm/semibold">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.ksAVYt,
{prefix: value10 + EMOJI_SENTINEL + query})}</Text>;
r23 = (
<>
{items5}
</>
);
} else {
r23 = value49;
}
items3[2] = r23;
items3[3] = (
<FlatList
style={items6}
keyExtractor={keyExtractor_90878}
data={nonStickerResults}
renderItem={value42}
ItemSeparatorComponent={(require(11017) /* metro dependency 11017: AutocompleteUtils */).getItemSeparator}
getItemLayout={(require(11017) /* metro dependency 11017: AutocompleteUtils */).getItemLayout}
/>
);
r12 = (
<>
{items3}
</>
);
} else {
r12 = value44;
}
return (
<View style={styles.autocompletePositionRelative}>
<View style={items7}>
<View2 style={items2}>
{r12}
</View2>
{activeCommand != null && !commandsDisabled && <View style={value35}>{((Component) => <Component command={activeCommand} section={activeSection} guildId={channel.guild_id} onPressOption={value38} currentOption={activeOption} optionStates={optionStates} />)(importDefault(11869) /* metro dependency 11869: ApplicationCommandBar */)}</View>}
</View>
</View>
);
function _fun90834() { // fn#90834, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3051, offset: 0x02048fd3, size: 53 bytes, params: 1, frame: 15
const value = environment.__proto__;
return (AutocompleteOptionsModule).getAutocompleteOptions(channel, true,
ConstantsModule.AutoCompleteResultTypes);
}
function _fun90835() { // fn#90835, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3324, offset: 0x02049008, size: 42 bytes, params: 1, frame: 12
GatewayConnectionStore.addConditionalChangeListener(_fun90836);
return function() {
env0_0 = true;
};
function _fun90836() { // fn#90836, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3377, offset: 0x02049032, size: 85 bytes, params: 1, frame: 15
var r1;
var r0;
var moduleValue;
const binding = env0_0;
let value = !binding;
if (binding) {
r0 = value;
} else {
value = environment.__proto__.__proto__;
if (GatewayConnectionStore.isConnected()) {
moduleValue = require(8530) /* metro dependency 8530: EmojiActionCreators */;
moduleValue.initiateEmojiInteraction(EmojiInteractionPoint.AutocompleteWrapperShown);
r1 = false;
} else {
r1 = undefined;
}
r0 = r1;
}
return r0;
}
function _fun90837() { // fn#90837, offset: 0x00e70226, size: 13 bytes, params: 1, frame: 2
}
}
function _fun90838() { // fn#90838, offset: 0x02049087, size: 21 bytes, params: 1, frame: 2
return _fun90839;
function _fun90839() { // fn#90839, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3534, offset: 0x0204909c, size: 30 bytes, params: 1, frame: 2
return {setChatInputHeight: env1_25, setData: setData};
function setData({focused, text, selectionStart, selectionEnd}) { // fn#90840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3570, offset: 0x020490ba, size: 112 bytes, params: 2, frame: 14
if (env1_0 !== -1) {
global.clearTimeout(env1_0);
}
env1_0 = global.setTimeout(_fun90841, 16);
function _fun90841() { // fn#90841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3663, offset: 0x0204912a, size: 25 bytes, params: 1, frame: 11
var environment;
let value = environment.__proto__.__proto__.__proto__;
env3_24(function(a0) {
var value = a0;
return value.focused !== focused || value.text !== text || value.selectionStart !== selectionStart ? {focused: focused,
text: text, selectionStart: selectionStart,
selectionEnd: selectionEnd} : value.selectionEnd === selectionEnd ? value : {focused: focused, text: text,
selectionStart: selectionStart, selectionEnd: selectionEnd};
});
}
}
}
}
function _fun90843() { // fn#90843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:3859, offset: 0x020491aa, size: 1338 bytes, params: 1, frame: 42
var r32;
var environment;
var r3;
var r7;
var r8;
var r2;
var r13;
var r1;
var channelTypes;
var r5;
var r9;
var r11;
var r23;
var r25;
var r12;
var r22;
var r27;
var r14;
var r30;
var r15;
var r18;
var r10;
var length;
var value3;
var activeOptionBinding;
var object;
var canMentionEveryoneBinding;
var value4;
var moduleValue;
var getApplicationCommandOptionQueryOptions;
var value5;
var value6;
var optionStatesBinding;
var name;
var property;
var location;
var substring;
var value7;
var value8;
var choices;
var autocomplete;
var type;
var value9;
const ApplicationCommandOptionType = (ServerModule).ApplicationCommandOptionType;
var BOOLEAN;
var CHANNEL;
var ROLE;
var USER;
var MENTIONABLE;
var value10;
var MENTIONS;
var value11;
var CHANNELS;
var value12;
var value13;
var CHOICES;
var value14;
var value15;
var value16;
var value17;
var value18;
var value19;
var value20;
var test;
var value21;
var slice;
var value22;
var moduleValue2;
var getPrefix;
var moduleValue3;
var getQuery;
var value23;
var Object;
var keys;
var value24;
var find;
var value25;
var value26;
var SLASHES;
var getTextBeforeFirstOption;
var value27;
var text2;
var object2;
var value28;
var value29;
var value30;
var startsWith;
var value31;
var length2;
var value32;
var value33;
var entries;
var value34;
var forEach;
var object3;
var object4;
let value = environment;
const selectionStartBinding = selectionStart;
var env0_2;
let textBinding = text;
const value2 = null;
if (value2 != textBinding) {
textBinding = text;
length = textBinding.trim().length;
value3 = 0;
reducibleJoin54: while (true) {
if (value3 !== length) {
if (value2 != activeOption) {
value4 = environment.__proto__;
moduleValue = require(5065) /* metro dependency 5065: ApplicationCommandUtils */;
getApplicationCommandOptionQueryOptions = moduleValue.getApplicationCommandOptionQueryOptions;
value5 = Reflect.apply(getApplicationCommandOptionQueryOptions, moduleValue, [activeOption]);
r3 = value5;
} else {
canMentionEveryoneBinding = canMentionEveryone;
r3 = {'canMentionEveryone': null, 'canMentionHere': null, 'canMentionChannels': true,
'canMentionUsers': true,
'canMentionRoles': true, 'canMentionAnyGuildUser': false,
'canMentionNonMentionableRoles': false,
'canMentionOtherGlobals': true, canMentionEveryone: canMentionEveryoneBinding,
canMentionHere: canMentionEveryoneBinding};
}
activeOptionBinding = activeOption;
value6 = undefined;
reducibleJoin7: while (true) {
if (value2 != activeOptionBinding) {
optionStatesBinding = optionStates;
name = activeOption.name;
property = optionStatesBinding[name];
r7 = property;
break reducibleJoin7;
}
r7 = value6;
break reducibleJoin7;
}
if (value2 != activeCommand) {
reducibleJoin26: while (true) {
if (value2 != activeOption) {
if (value2 != r7) {
location = r7.location;
r8 = value2 != location ? location : value3;
length = r7.length;
r2 = value2 != length ? length : value3;
reducibleJoin14: while (true) {
if (selectionStart >= r8 + r2) {
textBinding = text;
substring = textBinding.substring;
value7 = r8 + r2;
value8 = Reflect.apply(substring, textBinding, [value7, selectionStart]);
r13 = value8;
break reducibleJoin14;
}
r13 = value6;
break reducibleJoin14;
}
var env0_1 = r13;
choices = activeOption.choices;
reducibleJoin25: while (true) {
reducibleJoin24: while (true) {
if (value2 != choices) {
break reducibleJoin24;
}
autocomplete = activeOption.autocomplete;
if (autocomplete) {
break reducibleJoin24;
}
type = activeOption.type;
value9 = environment.__proto__;
BOOLEAN = ApplicationCommandOptionType.BOOLEAN;
if (BOOLEAN === type) {
value13 = '';
env0_0 = value13;
CHOICES = AutocompleteTypes.CHOICES;
value14 = true;
r1 = value14;
channelTypes = value6;
r5 = BOOLEAN_CHOICES;
r9 = CHOICES;
r11 = value13;
break reducibleJoin25;
}
CHANNEL = ApplicationCommandOptionType.CHANNEL;
if (CHANNEL === type) {
env0_0 = CHANNEL_SENTINEL;
CHANNELS = AutocompleteTypes.CHANNELS;
channelTypes = activeOption.channelTypes;
value12 = true;
r1 = value12;
r5 = value6;
r9 = CHANNELS;
r11 = CHANNEL_SENTINEL;
break reducibleJoin25;
}
ROLE = ApplicationCommandOptionType.ROLE;
if (ROLE !== type) {
USER = ApplicationCommandOptionType.USER;
if (USER !== type) {
MENTIONABLE = ApplicationCommandOptionType.MENTIONABLE;
value10 = false;
if (MENTIONABLE !== type) {
r1 = value10;
channelTypes = value6;
r5 = value6;
r9 = value6;
r11 = value6;
break reducibleJoin25;
}
}
}
env0_0 = MENTION_SENTINEL;
MENTIONS = AutocompleteTypes.MENTIONS;
value11 = true;
r1 = value11;
channelTypes = value6;
r5 = value6;
r9 = MENTIONS;
r11 = MENTION_SENTINEL;
break reducibleJoin25;
}
value15 = '';
var env0_0 = value15;
value16 = environment.__proto__;
CHOICES = AutocompleteTypes.CHOICES;
choices = activeOption.choices;
value17 = true;
r1 = value17;
channelTypes = value6;
r5 = choices;
r9 = CHOICES;
r11 = value15;
break reducibleJoin25;
}
if (r1) {
value28 = value2 != r11;
reducibleJoin45: while (true) {
if (value28) {
value29 = r11 !== '';
r7 = value29;
break reducibleJoin45;
}
r7 = value28;
break reducibleJoin45;
}
reducibleJoin47: while (true) {
if (r7) {
value30 = value2 != r13;
r7 = value30;
break reducibleJoin47;
}
break reducibleJoin47;
}
reducibleJoin49: while (true) {
if (r7) {
startsWith = r13.startsWith;
value31 = Reflect.apply(startsWith, r13, [r11]);
r7 = value31;
break reducibleJoin49;
}
break reducibleJoin49;
}
reducibleJoin53: while (true) {
if (r7) {
length = r13.length;
length2 = r11.length;
value32 = '';
reducibleJoin52: while (true) {
if (length > length2) {
substring = r13.substring;
length = r11.length;
value33 = Reflect.apply(substring, r13, [length]);
r7 = value33;
break reducibleJoin52;
}
r7 = value32;
break reducibleJoin52;
}
env0_1 = r7;
r10 = r7;
break reducibleJoin53;
}
r10 = r13;
break reducibleJoin53;
}
Object = global.Object;
entries = Object.entries;
value34 = Reflect.apply(entries, Object, [optionStates]);
forEach = value34.forEach;
Reflect.apply(forEach, value34, [_fun90844]);
object3 = {query: r10, autocompleteType: r9, autocompleteSelectionStart: r8 + r2};
object4 = {};
object4.activeCommand = activeCommand;
object4.optionValues = {};
object4.isActiveApplicationCommand = r1;
object4.option = activeOption;
object4.choices = r5;
object4.channelTypes = channelTypes;
copyDataProperties(object4, r3, r32);
object3.queryOptions = object4;
object3.showOptionValuesPicker = r1;
return object3;
}
r23 = r13;
r25 = r9;
break reducibleJoin26;
}
r23 = value6;
r25 = value6;
break reducibleJoin26;
}
r23 = value6;
r25 = value6;
break reducibleJoin26;
}
} else {
r23 = value6;
r25 = value6;
}
reducibleJoin30: while (true) {
if (value2 != r7) {
location = r7.location;
r12 = value2 != location ? location : value3;
length = r7.length;
r7 = value2 != length ? length : value3;
value18 = r12 + r7;
r22 = value18;
break reducibleJoin30;
}
r22 = value2;
break reducibleJoin30;
}
value19 = environment.__proto__;
value20 = value2 != r22;
r27 = selectionStartBinding;
reducibleLoop31: while (true) {
test = WHITESPACE_RE.test;
value21 = Reflect.apply(test, WHITESPACE_RE, [text[r27 - 1]]);
r14 = value20 ? r22 : value3;
if (r27 !== r14) {
reducibleJoin34: while (true) {
if (value21) {
break reducibleJoin34;
}
r30 = r25;
value26 = typeof r27 === 'bigint' ? r27 - 1n : +r27 - 1;
env0_2 = value26;
r15 = value20 ? r22 : value3;
if (value26 >= r15) {
r25 = r30;
r27 = value26;
continue reducibleLoop31;
}
r12 = value26;
r14 = r30;
r18 = r23;
break reducibleLoop31;
}
}
textBinding = text;
slice = textBinding.slice;
value22 = Reflect.apply(slice, textBinding, [r27, selectionEnd]);
moduleValue2 = require(11017) /* metro dependency 11017: AutocompleteUtils */;
getPrefix = moduleValue2.getPrefix;
env0_0 = Reflect.apply(getPrefix, moduleValue2, [value22]);
moduleValue3 = require(11017) /* metro dependency 11017: AutocompleteUtils */;
getQuery = moduleValue3.getQuery;
value23 = Reflect.apply(getQuery, moduleValue3, [value22]);
env0_1 = value23;
if (value2 != value23) {
test = WHITESPACE_RE.test;
reducibleJoin36: while (true) {
if (Reflect.apply(test, WHITESPACE_RE, [value23])) {
r12 = r27;
r14 = r25;
r18 = value23;
break reducibleLoop31;
}
break reducibleJoin36;
}
}
Object = global.Object;
keys = Object.keys;
value24 = Reflect.apply(keys, Object, [ChannelAutocompleteConstantsModule.CHANNEL_SENTINEL]);
find = value24.find;
value25 = Reflect.apply(find, value24, [_fun90845]);
if (value2 != value25) {
r12 = r27;
r14 = value25;
r18 = value23;
r32 = value24;
break reducibleLoop31;
}
r23 = value23;
r30 = value25;
r32 = value24;
value26 = typeof r27 === 'bigint' ? r27 - 1n : +r27 - 1;
env0_2 = value26;
r15 = value20 ? r22 : value3;
if (value26 >= r15) {
r25 = r30;
r27 = value26;
continue reducibleLoop31;
}
r12 = value26;
r14 = r30;
r18 = r23;
break reducibleLoop31;
}
SLASHES = AutocompleteTypes.SLASHES;
reducibleJoin42: while (true) {
if (r14 !== SLASHES) {
r15 = r18;
break reducibleJoin42;
}
value = require(11857) /* metro dependency 11857: ChatInputCommandOptionParser */;
getTextBeforeFirstOption = value.getTextBeforeFirstOption;
value27 = '';
r7 = value2 != r18 ? r18 : value27;
text2 = Reflect.apply(getTextBeforeFirstOption, value, [r7]).text;
env0_1 = text2;
r15 = text2;
break reducibleJoin42;
}
object = {query: r15, autocompleteType: r14, autocompleteSelectionStart: r12};
object2 = {};
copyDataProperties(object2, r3, r32);
object.queryOptions = object2;
return object;
}
break reducibleJoin54;
}
}
return {'query': null, 'autocompleteType': null, 'autocompleteSelectionStart': null};
function _fun90844(a0) { // fn#90844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:4991, offset: 0x020496e4, size: 94 bytes, params: 2, frame: 8
var r1;
var r2;
var r4;
var item3;
var value3;
const iterator = a0[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const value = undefined;
const value2 = item2 === value;
const r3 = value2 ? value : item;
if (value2) {
r1 = value;
r2 = item2;
r4 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value3 = item3 === value;
if (value3) {
r1 = value;
r2 = item3;
r4 = value3;
} else {
r1 = item;
r2 = item3;
r4 = value3;
}
}
if (!r4) {
r2.return();
}
if (r1.optionValue != null) {
Module00057[r3] = r1.optionValue;
}
return value;
}
function _fun90845(a0) { // fn#90845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:5493, offset: 0x02049742, size: 134 bytes, params: 2, frame: 17
var r1;
const value = environment.__proto__;
const property = env1_19[a0];
const SLASHES = AutocompleteTypes.SLASHES;
let r0 = a0 !== SLASHES && a0 !== AutocompleteTypes.SLASHES_DISCOVERY;
r0 = !r0 ? activeCommand == null && !commandsDisabled : r0;
if (r0) {
r1 = env0_0 !== undefined && text !== undefined;
r1 = r1 && property.matches(env0_0, text, selectionStart);
r0 = r1;
}
return r0;
}
}
function _fun90846(a0) { // fn#90846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:5974, offset: 0x020497c8, size: 182 bytes, params: 2, frame: 17
var environment;
var binding;
var property;
var value2;
var items3;
var items2;
var object;
var length;
if (autocompleteType == null) {
binding = env0_17;
value = environment.__proto__;
binding(env1_31);
} else if (query != null) {
binding = ChannelAutocompleteConstantsModule.CHANNEL_SENTINEL;
property = binding[autocompleteType];
value2 = property.queryResults(query, queryOptions, a0);
items3 = [];
items2 = [];
value2.forEach(_fun90847);
binding = env0_17;
object = {};
length = value2.length;
object.resultCount = length;
object.stickerResults = items3;
object.nonStickerResults = items2;
length = items3.length;
object.hasStickerResults = length > 0;
length = items2.length;
object.hasNonStickerResults = length > 0;
binding(object);
} else {
binding = env0_17;
value = environment.__proto__;
binding(env1_31);
}
function _fun90847(a0) { // fn#90847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6057, offset: 0x0204987e, size: 65 bytes, params: 2, frame: 11
const type = a0.type;
const STICKER = AutoCompleteResultTypes.STICKER;
if (type === STICKER) {
env0_0.push(a0);
} else {
env0_1.push(a0);
}
}
}
function _fun90848() { // fn#90848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6269, offset: 0x020498bf, size: 153 bytes, params: 1, frame: 15
var environment;
var value;
const autocompleteTypeBinding = autocompleteType;
const value2 = null;
const r4 = value2 != autocompleteTypeBinding ? value2 == ChannelAutocompleteConstantsModule.CHANNEL_SENTINEL ? undefined : ChannelAutocompleteConstantsModule.CHANNEL_SENTINEL[autocompleteType].stores : value2;
if (value2 != r4) {
value = environment.__proto__;
new (require(566) /* metro dependency 566: flux */).BatchedStoreListener(r4,
_fun90849).attach('AutocompleteWrapper');
return _fun90850;
}
function _fun90849() { // fn#90849, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6380, offset: 0x02049958, size: 18 bytes, params: 1, frame: 11
return env1_31(false);
}
function _fun90850() { // fn#90850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6432, offset: 0x00d0ff6d, size: 19 bytes, params: 1, frame: 9
return env0_0.detach();
}
}
function _fun90851() { // fn#90851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6475, offset: 0x0204996a, size: 18 bytes, params: 1, frame: 11
env0_31(true);
}
function _fun90852() { // fn#90852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6517, offset: 0x0204997c, size: 54 bytes, params: 1, frame: 12
const nonStickerResultsBinding = nonStickerResults;
return {numStickerResults: stickerResults.length,
numEmojiResults: nonStickerResultsBinding.filter(function({type}) {
return type === AutoCompleteResultTypes.EMOJI;
}).length};
function _fun90853({type}) { // fn#90853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6576, offset: 0x020499b2, size: 27 bytes, params: 2, frame: 2
const EMOJI = AutoCompleteResultTypes.EMOJI;
return type === EMOJI;
}
}
function _fun90854() { // fn#90854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6629, offset: 0x020499cd, size: 103 bytes, params: 1, frame: 14
var r0;
var keyboardTypeBinding;
var value;
const focusedBinding = focused;
const r2 = focusedBinding ? resultCount === 0 && !isSlashAutocompleteType(autocompleteType) : !focusedBinding;
if (r2) {
r0 = !r2;
} else {
keyboardTypeBinding = keyboardType;
value = environment.__proto__;
value = keyboardTypeBinding === (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.SYSTEM;
r0 = value;
}
return r0;
}
function _fun90855() { // fn#90855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6755, offset: 0x02049a34, size: 148 bytes, params: 1, frame: 18
var value;
const current = env0_34.current;
const binding = env0_34;
const isSlashAutocompleteType2 = isSlashAutocompleteType(autocompleteType);
if (current) {
binding.current = isSlashAutocompleteType2 || activeCommand != null;
} else {
binding.current = isSlashAutocompleteType2 || activeCommand != null;
if (env0_34.current) {
value = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
value.trackWithMetadata(AnalyticEvents.APPLICATION_COMMAND_TOP_OF_FUNNEL, {location: 'slash_ui'});
}
}
}
function _fun90856() { // fn#90856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:6990, offset: 0x02049ac8, size: 102 bytes, params: 1, frame: 16
var value3;
var moduleValue;
const r1 = env0_33 || activeCommand != null;
if (onChangeAutoCompleteVisibility != null) {
onChangeAutoCompleteVisibility(r1);
}
if (r1) {
value3 = environment.__proto__;
moduleValue = require(11859) /* metro dependency 11859: ChannelAutocompleteAnalytics */;
moduleValue.iOSTrackAutocompleteOpen(autocompleteType, channel, env0_32());
}
}
function _fun90857() { // fn#90857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:7293, offset: 0x02049b2e, size: 79 bytes, params: 1, frame: 13
const r3 = stickerResults.length > 0 ? env1_27 : autocompleteType !== AutocompleteTypes.EMOJIS_AND_STICKERS ? 200 : 242;
const Math = global.Math;
return Math.min(env0_35, r3);
}
function _fun90858() { // fn#90858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:7459, offset: 0x02049b7d, size: 281 bytes, params: 1, frame: 20
var r4;
var r5;
var r3;
var autocompletesHeight;
const autocompleteTypeBinding = autocompleteType;
const EMOJIS_AND_STICKERS = AutocompleteTypes.EMOJIS_AND_STICKERS;
if (autocompleteTypeBinding === EMOJIS_AND_STICKERS) {
autocompletesHeight = getAutocompletesHeight(nonStickerResults.length, autocompleteType, ChannelAutocompleteConstantsModule.MENTION_SENTINEL, env0_10);
r5 = hasNonStickerResults ? autocompletesHeight + 42 : autocompletesHeight;
r3 = hasStickerResults ? r5 + (42 + (require(11855) /* metro dependency 11855: Autocomplete */).AUTOCOMPLETE_STICKER_NODE_SIZE + 12) : r5;
r5 = hasStickerResults && hasNonStickerResults;
r4 = r5 ? r3 + hairlineWidth : r3;
} else {
r4 = isSlashAutocompleteType(autocompleteType) ? env0_37 ?? 0 : autocompleteType != null ? getAutocompletesHeight(resultCount,
autocompleteType, ChannelAutocompleteConstantsModule.MENTION_SENTINEL, env0_10) : 0;
}
const Math = global.Math;
return Math.min(env0_33 ? r4 : 0, env0_36);
}
function _fun90859() { // fn#90859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:8508, offset: 0x02049c96, size: 71 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.isIOS();
return value && (env0_43 || chatInputFloating) ? styles.autocompletePositionRelative : null;
}
function _fun90860() { // fn#90860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:8632, offset: 0x02049cdd, size: 27 bytes, params: 1, frame: 3
return result ? {marginTop: env0_41} : undefined;
}
function _fun90861(a0, a1, a2) { // fn#90861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:8707, offset: 0x02049cf8, size: 284 bytes, params: 4, frame: 20
var value2;
var moduleValue;
var value4;
var current;
var applicationCommandManager;
var STICKER;
let type = a0.type;
const EMOJI_PREMIUM_UPSELL = AutoCompleteResultTypes.EMOJI_PREMIUM_UPSELL;
if (type !== EMOJI_PREMIUM_UPSELL) {
value2 = undefined;
moduleValue = require(11017) /* metro dependency 11017: AutocompleteUtils */;
value4 = moduleValue.getAutocompleteResultText(a0, channel);
current = chatInputRef.current;
applicationCommandManager = current.getApplicationCommandManager();
if (!(applicationCommandManager == null ? value2 : applicationCommandManager.setAutoCompleteResult(channel.id,
value4, a2, a0))) {
type = a0.type;
STICKER = AutoCompleteResultTypes.STICKER;
current = chatInputRef.current;
current.insertText(value4, a1, type !== STICKER);
type = a0.type;
STICKER = AutoCompleteResultTypes.STICKER;
if (type === STICKER) {
current = chatInputRef.current;
current.handleSelectSticker(a0.sticker);
}
}
} else {
(importDefault(7882) /* metro dependency 7882: PremiumUpsellUtils */).handleShowUpsellAlert({initialUpsellKey: UpsellTypes.EMOJI_AUTOCOMPLETE,
analyticsLocations: analyticsLocations});
}
}
function _fun90862(a0) { // fn#90862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9148, offset: 0x02049e14, size: 215 bytes, params: 2, frame: 18
var property;
var id;
var lastValidationResult;
var value;
const applicationCommandManager = chatInputRef.current.getApplicationCommandManager();
const type = a0.type;
const value4 = undefined;
const ApplicationCommandOptionType = (ServerModule).ApplicationCommandOptionType;
const ATTACHMENT = ApplicationCommandOptionType.ATTACHMENT;
if (type === ATTACHMENT) {
property = optionStates[a0.name];
id = channel.id;
lastValidationResult = property.lastValidationResult;
if (lastValidationResult == null) {
if (applicationCommandManager != null) {
applicationCommandManager.insertOrJumpCommandOption(a0);
}
} else if (lastValidationResult.success) {
value = require(11752) /* metro dependency 11752: ApplicationCommandUtils */;
value.openCommandAttachmentPreview(applicationCommandManager, id, a0.name);
} else if (applicationCommandManager != null) {
applicationCommandManager.insertOrJumpCommandOption(a0);
}
} else if (applicationCommandManager != null) {
applicationCommandManager.insertOrJumpCommandOption(a0,
applicationCommandManager == null ? value4 : applicationCommandManager.props.text.length);
}
return value4;
}
function _fun90863(a0) { // fn#90863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9538, offset: 0x02049eeb, size: 152 bytes, params: 2, frame: 22
let value = environment.__proto__;
const iOSTrackAutocompleteSelect = ChannelAutocompleteAnalyticsModule.iOSTrackAutocompleteSelect;
const autocompleteTypeBinding = autocompleteType;
const channelBinding = channel;
const object = {};
let type = a0.type;
object.selectionType = type;
type = a0.type;
const STICKER = AutoCompleteResultTypes.STICKER;
object.stickerId = type !== STICKER ? null : a0.sticker.id;
copyDataProperties(object, env0_32(), undefined);
Reflect.apply(iOSTrackAutocompleteSelect, ChannelAutocompleteAnalyticsModule, [autocompleteTypeBinding,
channelBinding, object]);
const binding = env0_44;
const autocompleteSelectionStartBinding = autocompleteSelectionStart;
value = 0;
binding(a0, value != autocompleteSelectionStartBinding ? autocompleteSelectionStart : value, showOptionValuesPicker);
}
function _fun90864({item}) { // fn#90864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9774, offset: 0x02049f83, size: 979 bytes, params: 2, frame: 22
var environment;
var binding;
var sticker;
var id;
var value3;
var Sticker;
const type = item.type;
const value = environment.__proto__;
const USER = AutoCompleteResultTypes.USER;
if (USER === type) {
const User = (importDefault(11855) /* metro dependency 11855: Autocomplete */).User;
return (
<User
{...item}
{...{['guildId']: channel.guild_id}}
{...{['onPress']: onPress_90865}}
/>
);
}
const GLOBAL = AutoCompleteResultTypes.GLOBAL;
if (GLOBAL === type) {
const Global = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Global;
return <Global {...item} {...{['onPress']: onPress_90866}} />;
}
const ROLE = AutoCompleteResultTypes.ROLE;
if (ROLE === type) {
const Role = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Role;
return (
<Role
{...item}
{...{['onPress']: onPress_90867}}
{...{['showDescription']: autocompleteType === AutocompleteTypes.MENTIONS && activeCommand == null}}
/>
);
}
const CHANNEL = AutoCompleteResultTypes.CHANNEL;
if (CHANNEL === type) {
const Channel = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Channel;
return <Channel {...item} {...{['onPress']: onPress_90868}} />;
}
const EMOJI = AutoCompleteResultTypes.EMOJI;
if (EMOJI === type) {
const Emoji = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Emoji;
return <Emoji {...item} {...{['onPress']: onPress_90869}} />;
}
const EMOJI_PREMIUM_UPSELL = AutoCompleteResultTypes.EMOJI_PREMIUM_UPSELL;
if (EMOJI_PREMIUM_UPSELL === type) {
const EmojiPremiumUpsell = (importDefault(11855) /* metro dependency 11855: Autocomplete */).EmojiPremiumUpsell;
return <EmojiPremiumUpsell {...item} {...{['onPress']: onPress_90870}} />;
}
const CHOICE = AutoCompleteResultTypes.CHOICE;
if (CHOICE === type) {
const Choice = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Choice;
return <Choice {...item} {...{['onPress']: onPress_90871}} />;
}
const CHOICE_LOADING = AutoCompleteResultTypes.CHOICE_LOADING;
if (CHOICE_LOADING === type) {
const ChoiceLoading = (importDefault(11855) /* metro dependency 11855: Autocomplete */).ChoiceLoading;
return <ChoiceLoading />;
}
const STICKER = AutoCompleteResultTypes.STICKER;
if (STICKER === type) {
binding = env0_46;
sticker = item.sticker;
id = sticker.id;
value3 = binding === id;
Sticker = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Sticker;
sticker = item.sticker;
id = sticker.id;
return (
<Sticker
{...item}
{...{['onPress']: onPress_90872}}
{...{['onLongPress']: onLongPress_90873}}
{...{['isInteracting']: value3}}
key={'' + id + '-' + value3}
/>
);
}
const LABEL = AutoCompleteResultTypes.LABEL;
if (LABEL === type) {
const Label = (importDefault(11855) /* metro dependency 11855: Autocomplete */).Label;
return <Label {...item} />;
}
return null;
function onPress_90865() { // fn#90865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9870, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90866() { // fn#90866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9935, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90867() { // fn#90867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:9996, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90868() { // fn#90868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10104, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90869() { // fn#90869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10167, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90870() { // fn#90870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10258, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90871() { // fn#90871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10323, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onPress_90872() { // fn#90872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10472, offset: 0x0204a356, size: 23 bytes, params: 1, frame: 11
return env1_45(item);
}
function onLongPress_90873() { // fn#90873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10494, offset: 0x0204a36d, size: 34 bytes, params: 1, frame: 11
return env1_47(item.sticker.id);
}
}
function onPressSlashItem(a0, a1, a2) { // fn#90874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:10916, offset: 0x0204a38f, size: 115 bytes, params: 4, frame: 15
const binding = env0_44;
const object = {command: a0, section: a1};
const SLASH = AutoCompleteResultTypes.SLASH;
object.type = SLASH;
object.visualSection = a2;
const ApplicationCommandTriggerLocations = (ApplicationCommandTypesModule).ApplicationCommandTriggerLocations;
const DISCOVERY = ApplicationCommandTriggerLocations.DISCOVERY;
object.location = DISCOVERY;
binding(object, autocompleteSelectionStart ?? 0);
}
function onPressCommandItem(a0, a1) { // fn#90875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:11182, offset: 0x0204a402, size: 116 bytes, params: 3, frame: 15
const binding = env0_44;
const object = {command: a0, section: a1};
const SLASH = AutoCompleteResultTypes.SLASH;
object.type = SLASH;
const ApplicationCommandTriggerLocations = (ApplicationCommandTypesModule).ApplicationCommandTriggerLocations;
const DISCOVERY = ApplicationCommandTriggerLocations.DISCOVERY;
object.location = DISCOVERY;
object.query = query;
binding(object, autocompleteSelectionStart ?? 0);
}
function onCommandsChange(a0) { // fn#90876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:11428, offset: 0x0204a476, size: 44 bytes, params: 2, frame: 18
env0_38(getAutocompletesHeight(a0, autocompleteType, ChannelAutocompleteConstantsModule.MENTION_SENTINEL, env0_10));
}
}
}
function keyExtractor_90878(a0, a1) { // fn#90878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12040:12095, offset: 0x01f59c49, size: 20 bytes, params: 3, frame: 11
const String = global.String;
return String(a1);
}
global.__d(_fun90825, 11854, [57, 31, 27, 7168, 6540, 4257, 6583, 661, 5066, 11018, 6625, 11086, 1881, 33, 11855,
4501, 477, 697, 1478, 5463, 5314, 566, 3860, 3829, 6748, 11085, 8530, 5065, 1909, 11017, 11857, 1583, 4863,
11859, 1357, 4559, 11860, 7882, 11752, 4017, 11861, 5068, 11868, 4573, 1244, 7331, 11869,
2]) /* metro module 11854, dependencies: [57, 31, 27, 7168, 6540, 4257, 6583, 661, 5066, 11018, 6625, 11086, 1881, 33, 11855, 4501, 477, 697, 1478, 5463, 5314, 566, 3860, 3829, 6748, 11085, 8530, 5065, 1909, 11017, 11857, 1583, 4863, 11859, 1357, 4559, 11860, 7882, 11752, 4017, 11861, 5068, 11868, 4573, 1244, 7331, 11869, 2] */;