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

128 lines
9.4 KiB
TypeScript

/* Metro module 11030; source: modules/expression_picker/native/ExpressionPicker.tsx; dependencies: [31, 27, 1346, 661, 1881, 33, 4501, 697, 11031, 8535, 8853, 1482, 1583, 4863, 8579, 11032, 4559, 9221, 11033, 11034, 11048, 2] */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseExpressionPickerTabData from './useExpressionPickerTabData.tsx'; /* Metro dependency 11031 */
import UseExpressionPickerInsets from './useExpressionPickerInsets.tsx'; /* Metro dependency 11032 */
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 ExpressionPickerConstantsModule from '../ExpressionPickerConstants.tsx'; /* Metro dependency 1346 */
import * as EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */
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 TopEmojisUtilsModule from '../../emojis/top_emojis/TopEmojisUtils.tsx'; /* Metro dependency 8535 */
import * as SegmentedControlStateNativeModule from '../../../design/components/SegmentedControl/native/SegmentedControlState.native.tsx'; /* Metro dependency 8853 */
import * as SegmentedControlNativeModule from '../../../design/components/SegmentedControl/native/SegmentedControl.native.tsx'; /* Metro dependency 9221 */
function _fun84451(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11216:6, offset: 0x01f4ab95, size: 386 bytes, params: 8, frame: 26
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const PADDING_HORIZONTAL = ExpressionPickerConstantsModule.PADDING_HORIZONTAL;
const createStyles = CreateStylesModule.createStyles;
const MOBILE_EXPRESSION_PICKER_BACKGROUND_DEFAULT = (Native).colors.MOBILE_EXPRESSION_PICKER_BACKGROUND_DEFAULT;
const env0_11 = Reflect.apply(createStyles, CreateStylesModule, [{expressionPickerContainer: {'flex': 1,
'overflow': 'hidden', 'backgroundColor': null, 'position': 'relative',
backgroundColor: MOBILE_EXPRESSION_PICKER_BACKGROUND_DEFAULT, paddingHorizontal: PADDING_HORIZONTAL},
expressionPickerContent: {flex: 1}, segmentedControl: {paddingTop: 2 * PADDING_HORIZONTAL,
paddingHorizontal: 0}, segmentedControlUnpadded: {paddingHorizontal: 0}}]);
value = value.memo(_fun84452);
(FileImportTrackerModule).fileFinishedImporting('modules/expression_picker/native/ExpressionPicker.tsx');
exports.default = value;
function _fun84452({bottomSheetRef, bottomSheetIndex, channel, expressionType, hideGifFavorites, onPressEmoji, onPressSticker, onPressGIF, onBackspace, visibleTabs = ExpressionPickerOrder, initialGifQuery, stickerFormats, height, inPortalKeyboard}) { // fn#84452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11216:624, offset: 0x01f4ad17, size: 914 bytes, params: 2, frame: 37
hideGifFavorites = !(hideGifFavorites === undefined) && hideGifFavorites;
var value;
const styles = useStyles();
const binding = undefined;
const env0_1 = binding.useRef(false);
const {expressionPickerSelectedIndex, expressionPickerViewType,
expressionPickerTabStrings} = (UseExpressionPickerTabData)({expressionType: expressionType,
expressionPickerTabs: visibleTabs});
binding.useEffect(_fun84454, [binding.useMemo(function() {
return channel.getGuildId();
}, [channel])]);
const useSegmentedControlState = SegmentedControlStateNativeModule.useSegmentedControlState;
object = {pageWidth: 0, defaultIndex: expressionPickerSelectedIndex, onSetActiveIndex: function(a0) {
var moduleValue = require(dependencyMap[11]);
var object = {type: require(dependencyMap[12]).KeyboardTypes.EXPRESSION};
object.context = ExpressionPickerOrder[a0];
moduleValue.setKeyboardType(object);
}};
object.items = expressionPickerTabStrings.map(function(a0) {
return {id: a0, label: a0, page: null};
});
const value4 = Reflect.apply(useSegmentedControlState, SegmentedControlStateNativeModule, [object]);
binding.useEffect(_fun84457, [expressionPickerViewType]);
const defaultImport2 = UseExpressionPickerInsets;
let EMOJI = ExpressionPickerViewType.EMOJI;
const value7 = defaultImport2({hasCategories: expressionPickerViewType === EMOJI || expressionPickerViewType === ExpressionPickerViewType.STICKER});
const useIsScreenReaderEnabled = UseIsScreenReaderEnabledNativeModule.useIsScreenReaderEnabled;
const r18 = Reflect.apply(useIsScreenReaderEnabled, UseIsScreenReaderEnabledNativeModule,
[]) ? {marginBottom: value7.safeAreaBottomKeyboardAware} : {};
const items2 = [styles.expressionPickerContainer];
items2[1] = height != null && ({height: height});
const r7 = inPortalKeyboard ? styles.segmentedControl : styles.segmentedControlUnpadded;
const SegmentedControl = (SegmentedControlNativeModule).SegmentedControl;
const view = (
<View style={r7}>
<SegmentedControl state={value4} />
</View>
);
const items3 = [styles.expressionPickerContent, r18];
EMOJI = ExpressionPickerViewType.EMOJI;
if (expressionPickerViewType === EMOJI) {
value = importDefault(11033) /* metro dependency 11033: EmojiPicker */;
value = ((Component) => <Component bottomSheetIndex={bottomSheetIndex} bottomSheetRef={bottomSheetRef} channel={channel} onPressEmoji={onPressEmoji} onBackspace={onBackspace} inPortalKeyboard={inPortalKeyboard} />)(value);
visibleTabs = value;
} else if (expressionPickerViewType === ExpressionPickerViewType.GIF) {
value = importDefault(11034) /* metro dependency 11034: GIFPicker */;
value = ((Component) => <Component bottomSheetRef={bottomSheetRef} channelId={channel.id} guildId={channel.guild_id} hideFavorites={hideGifFavorites} initialQuery={initialGifQuery} onPressGIF={onPressGIF} />)(value);
visibleTabs = value;
} else if (expressionPickerViewType !== ExpressionPickerViewType.STICKER) {
visibleTabs = null;
} else {
value = importDefault(11048) /* metro dependency 11048: StickerPicker */;
value = ((Component) => <Component bottomSheetRef={bottomSheetRef} bottomSheetIndex={bottomSheetIndex} channel={channel} onPressSticker={onPressSticker} stickerFormats={stickerFormats} inPortalKeyboard={inPortalKeyboard} />)(value);
visibleTabs = value;
}
return (
<View style={items2}>
{view}
<View style={items3}>
{visibleTabs}
</View>
</View>
);
function _fun84454() { // fn#84454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11216:1076, offset: 0x01f4b0bc, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__;
(TopEmojisUtilsModule).maybeFetchTopEmojisByGuild(env0_3);
}
function _fun84457() { // fn#84457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11216:1356, offset: 0x01f4b13c, size: 239 bytes, params: 1, frame: 16
var defaultImport;
var defaultImport3;
if (env0_1.current) {
defaultImport3 = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
defaultImport3.trackWithMetadata(AnalyticEvents.EXPRESSION_PICKER_TAB_CLICKED, {tab: expressionPickerViewType,
badged: false});
} else if (expressionPickerViewType === ExpressionPickerViewType.EMOJI) {
(importDefault(8579) /* metro dependency 8579: trackOnEmojiPickerOpened */)({intention: EmojiIntention.CHAT});
env0_1.current = true;
} else {
defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
defaultImport.trackWithMetadata(AnalyticEvents.EXPRESSION_PICKER_OPENED, {tab: expressionPickerViewType,
badged: false});
env0_1.current = true;
}
}
}
}
global.__d(_fun84451, 11030, [31, 27, 1346, 661, 1881, 33, 4501, 697, 11031, 8535, 8853, 1482, 1583, 4863, 8579,
11032, 4559, 9221, 11033, 11034, 11048,
2]) /* metro module 11030, dependencies: [31, 27, 1346, 661, 1881, 33, 4501, 697, 11031, 8535, 8853, 1482, 1583, 4863, 8579, 11032, 4559, 9221, 11033, 11034, 11048, 2] */;