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

381 lines
24 KiB
TypeScript

/* Metro module 11620; source: modules/keyboard/native/PortalKeyboardBottomSheet.tsx; dependencies: [57, 31, 27, 10738, 33, 477, 4501, 697, 8554, 4559, 11621, 4508, 6514, 566, 6277, 4081, 10915, 4017, 1848, 4594, 1585, 1478, 4027, 4556, 8575, 5462, 2] */
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 ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import defaultImport4 from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
import NativeMenuStore from '../../native_menu/native/NativeMenuStore.tsx'; /* Metro dependency 10738 */
import UseCustomKeyboardBottomSheetConfig from '../../action_sheet/native/useCustomKeyboardBottomSheetConfig.tsx'; /* Metro dependency 11621 */
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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
import * as Module04027Module from '../../../by-id/module-04027.js'; /* Metro dependency 4027 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TransitionGroupModule from '../../../design/components/TransitionGroup/TransitionGroup.tsx'; /* Metro dependency 4508 */
import * as AccessibilityViewNativeModule from '../../../design/components/AccessibilityView/AccessibilityView.native.tsx'; /* Metro dependency 4556 */
import * as UseIsScreenReaderEnabledNativeModule from '../../a11y/native/useIsScreenReaderEnabled.native.tsx'; /* Metro dependency 4559 */
import * as NavScrimAndroidModule from '../../../design/components/Navigator/native/NavScrim.android.tsx'; /* Metro dependency 5462 */
import * as Module06277Module from '../../../by-id/module-06277.js'; /* Metro dependency 6277 */
import * as BottomSheetHandleModule from '../../../design/components/Sheet/native/BottomSheetHandle.tsx'; /* Metro dependency 6514 */
import * as NativeModule from '../../../design/components/experimental/native.tsx'; /* Metro dependency 8554 */
function _fun89063(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#89063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:6, offset: 0x01ffd372, size: 630 bytes, params: 8, frame: 24
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
ReactNativeModule.Platform;
const env0_9 = (PlatformUtilsModule).isIOS();
const createStyles = CreateStylesModule.createStyles;
object = {container: {'position': 'absolute', 'top': 0, 'left': 0}};
let MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
object.background = {backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND, overflow: 'hidden'};
const object3 = {};
object3.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.none;
object3.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.none;
object3.width = '100%';
const ACTION_SHEET_DRAG_HANDLE_HEIGHT = (NativeModule).ACTION_SHEET_DRAG_HANDLE_HEIGHT;
object3.height = ACTION_SHEET_DRAG_HANDLE_HEIGHT;
object3.marginBottom = -ACTION_SHEET_DRAG_HANDLE_HEIGHT;
object.headerContainer = object3;
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.headerContainerScreenReaderEnabled = {marginBottom: -PX_8};
MOBILE_KEYBOARD_PANEL_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_KEYBOARD_PANEL_BACKGROUND;
object.roundingView = {'overflow': 'hidden', 'display': 'flex', backgroundColor: MOBILE_KEYBOARD_PANEL_BACKGROUND};
const env0_10 = Reflect.apply(createStyles, CreateStylesModule, [object]);
object = {code: 'function PortalKeyboardBottomSheetTsx1(){const{animatedIndex}=this.__closure;return animatedIndex.get()>0.975;}'};
object = {code: 'function PortalKeyboardBottomSheetTsx2(){const{isFullyExpanded}=this.__closure;return isFullyExpanded.get();}'};
object = {code: 'function PortalKeyboardBottomSheetTsx3(isFullyExpanded,isFullExpandedPrevious){const{forceMaxHeight,runOnJS,dismissGlobalKeyboard}=this.__closure;if(isFullExpandedPrevious==null){return;}if(!isFullyExpanded&&!forceMaxHeight){runOnJS(dismissGlobalKeyboard)();}}'};
object = {code: "function PortalKeyboardBottomSheetTsx4(){const{interpolate,animatedIndex}=this.__closure;return{borderTopLeftRadius:interpolate(animatedIndex.get(),[0,1],[0,15],'clamp'),borderTopRightRadius:interpolate(animatedIndex.get(),[0,1],[0,15],'clamp')};}"};
object = {code: 'function PortalKeyboardBottomSheetTsx5(){const{animatedIndex}=this.__closure;return Math.max(animatedIndex.get(),0)>0;}'};
object = {code: 'function PortalKeyboardBottomSheetTsx6(result,previous){const{runOnJS,setAccessibilityViewIsModal}=this.__closure;if(result===previous)return;runOnJS(setAccessibilityViewIsModal)(result);}'};
value = value.forwardRef(PortalKeyboardBottomSheet);
(FileImportTrackerModule).fileFinishedImporting('modules/keyboard/native/PortalKeyboardBottomSheet.tsx');
exports.default = value;
function PortalKeyboardBottomSheetHeader({style, handleCollapse}) { // fn#89064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:762, offset: 0x01ffd5e8, size: 158 bytes, params: 2, frame: 20
const styles = useStyles();
const value3 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
const items2 = [styles.headerContainer];
items2[1] = value3 ? styles.headerContainerScreenReaderEnabled : undefined;
items2[2] = style;
const ActionSheetDragHandle = (NativeModule).ActionSheetDragHandle;
return (
<View style={items2}>
<ActionSheetDragHandle onPress={handleCollapse} />
</View>
);
}
function PortalKeyboardBottomSheet({animatedIndex, animatedPosition, chatInputRef, children, isAppsKeyboard, animationConfigs, onClose, transitionState, backdropComponent, headerStyle, disableHeaderRoundingAnimation, roundingViewStyle, onAnimate, rendersHandle, width, forceMaxHeight, enablePanDownToClose, renderExpressionFooter}, a1) { // fn#89065, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:2150, offset: 0x01ffd686, size: 1749 bytes, params: 3, frame: 51
var object4;
isAppsKeyboard = !(isAppsKeyboard === undefined) && isAppsKeyboard;
const onClose2 = onClose;
const headerStyle2 = headerStyle;
rendersHandle = rendersHandle === undefined || rendersHandle;
forceMaxHeight = !(forceMaxHeight === undefined) && forceMaxHeight;
enablePanDownToClose = !(enablePanDownToClose === undefined) && enablePanDownToClose;
renderExpressionFooter = !(renderExpressionFooter === undefined) && renderExpressionFooter;
const env0_11 = undefined;
const env0_12 = undefined;
const styles = useStyles();
let binding = headerStyle2;
const value8 = binding.useRef(null);
const value9 = (UseCustomKeyboardBottomSheetConfig)({forceMaxHeight: forceMaxHeight,
enablePanDownToClose: enablePanDownToClose});
const TransitionStates = (TransitionGroupModule).TransitionStates;
const YEETED = TransitionStates.YEETED;
const value10 = transitionState === YEETED;
const env0_9 = value10;
(BottomSheetHandleModule).useBottomSheetImperativeHandle(a1, value8);
binding.useLayoutEffect(_fun89066, [value8, value10]);
const value11 = (require(566) /* metro dependency 566: flux */).useStateFromStores([NativeMenuStore], function() {
return NativeMenuStore.isOpen();
});
const r7 = renderExpressionFooter && !value10;
const value13 = (UseIsScreenReaderEnabledNativeModule).useIsScreenReaderEnabled();
binding = headerStyle2;
const value14 = binding.useCallback(_fun89068, [chatInputRef, value10, onAnimate, onClose, isAppsKeyboard]);
const useDerivedValue = ReanimatedRexportModule.useDerivedValue;
let closure = PortalKeyboardBottomSheetJ;
closure.__closure = {animatedIndex: animatedIndex};
closure.__workletHash = 2001839633402;
closure.__initData = env0_11;
const value15 = Reflect.apply(useDerivedValue, ReanimatedRexportModule, [closure]);
let useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = PortalKeyboardBottomSheetJ_89070;
closure.__closure = {isFullyExpanded: value15};
closure.__workletHash = 9531298805666;
closure.__initData = env0_12;
const PortalKeyboardBottomSheetY2 = PortalKeyboardBottomSheetY;
object4 = {forceMaxHeight: forceMaxHeight};
object4.runOnJS = ReanimatedRexportModule.runOnJS;
object4.dismissGlobalKeyboard = (require(1848) /* metro dependency 1848: KeyboardManagerUtils */).dismissGlobalKeyboard;
PortalKeyboardBottomSheetY2.__closure = object4;
PortalKeyboardBottomSheetY2.__workletHash = 14649856286006;
PortalKeyboardBottomSheetY2.__initData = env0_13;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, PortalKeyboardBottomSheetY2]);
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(function() {
return _fun89073;
});
const value16 = binding.useCallback(_fun89074, []);
const value17 = binding.useCallback(_fun89075, [headerStyle, value8, rendersHandle, value15, value13]);
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
closure = PortalKeyboardBottomSheetW;
closure.__closure = {interpolate: ReanimatedRexportModule.interpolate, animatedIndex: animatedIndex};
closure.__workletHash = 13716272266662;
closure.__initData = env0_14;
const value18 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [closure]);
const {left, right} = (UseSafeAreaInsetsNative)();
const value20 = (UseWindowDimensionsNative)({ignoreKeyboard: true});
const height = value20.height;
const width2 = value20.width;
const value21 = binding.useCallback(_fun89078, []);
const [property, property2] = onClose2(binding.useState(false), 2);
useAnimatedReaction = ReanimatedRexportModule.useAnimatedReaction;
closure = PortalKeyboardBottomSheet$;
closure.__closure = {animatedIndex: animatedIndex};
closure.__workletHash = 8952872079740;
closure.__initData = env0_15;
const PortalKeyboardBottomSheetZ2 = PortalKeyboardBottomSheetZ;
PortalKeyboardBottomSheetZ2.__closure = {runOnJS: ReanimatedRexportModule.runOnJS,
setAccessibilityViewIsModal: property2};
PortalKeyboardBottomSheetZ2.__workletHash = 16051387075966;
PortalKeyboardBottomSheetZ2.__initData = env0_16;
Reflect.apply(useAnimatedReaction, ReanimatedRexportModule, [closure, PortalKeyboardBottomSheetZ2]);
const r26 = value13 || value10;
const View = (ReanimatedRexport).View;
const r4 = value11 ? 'no-hide-descendants' : undefined;
const items2 = [styles.container];
items2[1] = {marginLeft: left, marginRight: right};
const Math = global.Math;
items2[2] = {width: Math.min(width ?? global.Number.MAX_SAFE_INTEGER, width2 - left - right), height: height};
const object = {ref: value8, animatedIndex: animatedIndex, animatedPosition: animatedPosition,
animationConfigs: animationConfigs, onClose: onClose, onAnimate: value14};
const value26 = !r26;
object.enableContentPanningGesture = value26;
object.enableHandlePanningGesture = value26;
object.handleComponent = value17;
object.renderFooter = PlatformUtilsModule.isAndroid() && r7 ? value21 : undefined;
object.backgroundStyle = styles.background;
object.backdropComponent = backdropComponent ?? value16;
object.activeOffsetY = [-10, 10];
const ACTION_SHEET_DRAG_HANDLE_HEIGHT = rendersHandle ? (require(8554) /* metro dependency 8554: native */).ACTION_SHEET_DRAG_HANDLE_HEIGHT : 0;
object.handleHeight = ACTION_SHEET_DRAG_HANDLE_HEIGHT;
copyDataProperties(object, value9, require);
const AccessibilityViewAnimated = (AccessibilityViewNativeModule).AccessibilityViewAnimated;
const defaultImport42 = ((Component) => <Component {...object}><AccessibilityViewAnimated nativeID="portal-keyboard-sheet" style={[styles.roundingView,
!disableHeaderRoundingAnimation && value18,
roundingViewStyle]} onAccessibilityEscape={onAccessibilityEscape_89081} accessibilityViewIsModal={property}>{children}</AccessibilityViewAnimated></Component>)(defaultImport4);
const r6 = env0_9 && r7 && ((Component) => <Component animatedSheetIndex={animatedIndex} />)(importDefault(8575) /* metro dependency 8575: PortalKeyboardFooterIOSIos */);
const NavScrim = (NavScrimAndroidModule).NavScrim;
return (
<View
importantForAccessibility={r4}
style={items2}
pointerEvents="box-none"
>
{defaultImport42}
{r6}
<NavScrim />
</View>
);
function _fun89066() { // fn#89066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:2702, offset: 0x01ffdd5b, size: 39 bytes, params: 1, frame: 9
var current;
if (env0_9) {
current = JsxRuntimeModule.jsxs.current;
if (current != null) {
current.forceClose();
}
}
}
function _fun89068(a0, a1, a2) { // fn#89068, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:2887, offset: 0x01ffdd95, size: 296 bytes, params: 4, frame: 17
var value2;
var moduleValue;
var current;
const ANIMATION_SOURCE = (Module06277Module).ANIMATION_SOURCE;
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
var value;
if (env0_9) {
if (a1 !== -1) {
if (onClose != null) {
onClose();
}
} else if (a0 !== a1) {
if (a1 !== -1) {
if (onAnimate != null) {
onAnimate(a0, a1, a2);
}
if (a0 === 0) {
value = environment.__proto__;
if (a2 !== ANIMATION_SOURCE.KEYBOARD) {
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
}
} else if (a0 === 1) {
if (a1 === 0) {
value2 = environment.__proto__;
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
if (!moduleValue.isChannelFocused()) {
if (isAppsKeyboard) {
current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
}
}
}
}
}
}
} else if (a0 !== a1) {
if (a1 !== -1) {
if (onAnimate != null) {
onAnimate(a0, a1, a2);
}
if (a0 === 0) {
value = environment.__proto__;
if (a2 !== ANIMATION_SOURCE.KEYBOARD) {
value = require(4081) /* metro dependency 4081: HapticUtilsNative */;
value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT);
}
} else if (a0 === 1) {
if (a1 === 0) {
value2 = environment.__proto__;
moduleValue = require(10915) /* metro dependency 10915: isChannelFocusedNative */;
if (!moduleValue.isChannelFocused()) {
if (isAppsKeyboard) {
current = chatInputRef.current;
if (current != null) {
current.closeCustomKeyboard();
}
}
}
}
}
}
}
}
function PortalKeyboardBottomSheetJ() { // fn#89069, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3241, owner: PortalKeyboardBottomSheet.J, offset: 0x01ffdebd, size: 32 bytes, params: 1, frame: 9
return animatedIndex.get() > 0.975;
}
function PortalKeyboardBottomSheetJ_89070() { // fn#89070, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3384, owner: PortalKeyboardBottomSheet.j, offset: 0x01ffdedd, size: 18 bytes, params: 1, frame: 9
return env0_11.get();
}
function PortalKeyboardBottomSheetY(a0, a1) { // fn#89071, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3479, owner: PortalKeyboardBottomSheet.Y, offset: 0x01ffdeef, size: 86 bytes, params: 3, frame: 14
let value = a0;
if (a1 != null) {
if (!(value || forceMaxHeight)) {
value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS((require(1848) /* metro dependency 1848: KeyboardManagerUtils */).dismissGlobalKeyboard)();
}
}
}
function _fun89072() { // fn#89072, offset: 0x01ffdf45, size: 11 bytes, params: 1, frame: 1
return function() {
if (onClose != null) {
onClose();
}
};
function _fun89073() { // fn#89073, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3733, offset: 0x01ffdf50, size: 27 bytes, params: 1, frame: 10
if (onClose != null) {
onClose();
}
}
}
function _fun89074(a0) { // fn#89074, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3782, offset: 0x01ffdf6b, size: 68 bytes, params: 2, frame: 15
const BottomSheetBackdrop = (Module06277Module).BottomSheetBackdrop;
return <BottomSheetBackdrop {...a0} {...{['pressBehavior']: 'collapse'}} />;
}
function _fun89075() { // fn#89075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3872, offset: 0x01ffdfaf, size: 69 bytes, params: 1, frame: 15
return (
rendersHandle === false
? null
: (
<PortalKeyboardBottomSheetHeader
style={headerStyle}
handleCollapse={handleCollapse_89076}
isFullyExpanded={env0_11}
/>
)
);
function handleCollapse_89076() { // fn#89076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:3946, offset: 0x01ffdff4, size: 62 bytes, params: 1, frame: 11
let current = env1_8.current;
if (current != null) {
current.collapse();
}
if (env1_10) {
current = env1_8.current;
if (current != null) {
current.forceClose();
}
}
}
}
function PortalKeyboardBottomSheetW() { // fn#89077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4104, owner: PortalKeyboardBottomSheet.W, offset: 0x01ffe032, size: 146 bytes, params: 1, frame: 23
const object = {};
let value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const interpolate = value.interpolate;
const animatedIndexBinding = animatedIndex;
object.borderTopLeftRadius = Reflect.apply(interpolate, value, [animatedIndexBinding.get(), [0, 1], [0, 15],
'clamp']);
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
object.borderTopRightRadius = value.interpolate(animatedIndexBinding.get(), [0, 1], [0, 15], 'clamp');
return object;
}
function _fun89078(a0) { // fn#89078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4479, offset: 0x01ffe0c4, size: 104 bytes, params: 2, frame: 17
const value = environment.__proto__;
const BottomSheetFooter = (Module06277Module).BottomSheetFooter;
const bottomSheetFooterProps = {...a0};
const PortalHost = (Module04027Module).PortalHost;
return (
<BottomSheetFooter {...bottomSheetFooterProps}>
<PortalHost name="expression-footer" />
</BottomSheetFooter>
);
}
function PortalKeyboardBottomSheet$() { // fn#89079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4663, owner: PortalKeyboardBottomSheet.$, offset: 0x01ffe12c, size: 43 bytes, params: 1, frame: 13
const Math = global.Math;
return Math.max(animatedIndex.get(), 0) > 0;
}
function PortalKeyboardBottomSheetZ(a0, a1) { // fn#89080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:4770, owner: PortalKeyboardBottomSheet.Z, offset: 0x01ffe157, size: 61 bytes, params: 3, frame: 13
var value;
if (a0 !== a1) {
value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env0_12)(a0);
}
}
function PortalKeyboardBottomSheetOnAccessibilityEscape() { // fn#89081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11806:5685, owner: PortalKeyboardBottomSheet.onAccessibilityEscape, offset: 0x01ffe194, size: 32 bytes, params: 1, frame: 9
const current = JsxRuntimeModule.jsxs.current;
if (current != null) {
current.collapse();
}
}
}
}
global.__d(_fun89063, 11620, [57, 31, 27, 10738, 33, 477, 4501, 697, 8554, 4559, 11621, 4508, 6514, 566, 6277, 4081,
10915, 4017, 1848, 4594, 1585, 1478, 4027, 4556, 8575, 5462,
2]) /* metro module 11620, dependencies: [57, 31, 27, 10738, 33, 477, 4501, 697, 8554, 4559, 11621, 4508, 6514, 566, 6277, 4081, 10915, 4017, 1848, 4594, 1585, 1478, 4027, 4556, 8575, 5462, 2] */;