/* Metro module 8811; source: design/components/ContextMenu/native/ContextMenu.native.tsx; dependencies: [31, 33, 4020, 477, 4017, 1478, 8812, 4584, 8813, 4570, 8814, 4002, 1244, 8815, 5321, 4081, 4559, 2] */ import UseWindowDimensionsNative from '../../../../modules/screen/useWindowDimensions.native.tsx'; /* Metro dependency 1478 */ import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ 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 '../../../../modules/reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */ import * as HapticUtilsNativeModule from '../../../../modules/haptics/HapticUtils.native.tsx'; /* Metro dependency 4081 */ import * as SetAccessibilityFocusAndroidModule from '../../../../modules/a11y/native/setAccessibilityFocus.android.tsx'; /* Metro dependency 4570 */ import * as UseFontScaleModule from '../../../../modules/screen/native/useFontScale.tsx'; /* Metro dependency 4584 */ import * as Module05321Module from '../../../../by-id/module-05321.js'; /* Metro dependency 5321 */ import * as ContextMenuStateNativeModule from './ContextMenuState.native.tsx'; /* Metro dependency 8812 */ import * as ContextMenuConstantsNativeModule from './ContextMenuConstants.native.tsx'; /* Metro dependency 8813 */ function _fun68866(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6, offset: 0x01c5fc5f, size: 347 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = JsxRuntimeModule; const env0_4 = value.Fragment; const env0_5 = value.jsx; value = require(4020) /* metro dependency 4020: FabricUtils */; value = value.isFabric(); if (value) { value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isIOS(); } object = {code: "function ContextMenuNativeTsx1(){const{_isFabricIOS,buttonTagSV,measureInWindowForFWO,measure,buttonRef,title,itemCount,dividerIndexes,approximateItemHeight,CONTEXT_MENU_DIVIDER_HEIGHT,CONTEXT_MENU_OFFSET,screenHeight,CONTEXT_MENU_EDGE_OFFSET,screenWidth,CONTEXT_MENU_MIN_WIDTH,menuAlign,runOnJS,showMenu}=this.__closure;let pageX;let pageY;let width;let height;if(_isFabricIOS){const tag=buttonTagSV.get();if(tag===-1)return;const m=measureInWindowForFWO(tag);if(m==null)return;pageX=m.x;pageY=m.y;width=m.width;height=m.height;}else{const m=measure(buttonRef);if(m==null)return;pageX=m.pageX;pageY=m.pageY;width=m.width;height=m.height;}const rowCount=title!=null?itemCount+1:itemCount;const dividerCount=(title!=null?1:0)+dividerIndexes.length;const menuHeight=approximateItemHeight.get()*rowCount+CONTEXT_MENU_DIVIDER_HEIGHT*dividerCount;const positionBelowOffset=pageY+height+CONTEXT_MENU_OFFSET;const positionAboveOffset=screenHeight-pageY+CONTEXT_MENU_OFFSET;const availableSpaceBelow=screenHeight-positionBelowOffset-CONTEXT_MENU_EDGE_OFFSET;const availableSpaceAbove=pageY-CONTEXT_MENU_EDGE_OFFSET;const wouldOverflowBelow=availableSpaceBelowavailableSpaceAbove){positionY='below';}else{positionY='above';}}else if(wouldOverflowBelow){positionY='above';}else{positionY='below';}y=(positionY==='above'?positionAboveOffset:positionBelowOffset)+(offset!==null&&offset!==void 0?offset:0);return{y:y,positionY:positionY};}function autoPositionHorizontal(){'worklet';const distanceFromLeftEdge=pageX-CONTEXT_MENU_EDGE_OFFSET;const distanceFromRightEdge=screenWidth-CONTEXT_MENU_EDGE_OFFSET-(pageX+CONTEXT_MENU_MIN_WIDTH);let positionX='left';let x=pageX;if(distanceFromLeftEdge>distanceFromRightEdge){positionX='right';x=minimumRightPosition;}return{x:x,positionX:positionX};}if(menuAlign==='auto'){const{y:y,positionY:positionY}=autoPositionVertical();const{x:x,positionX:positionX}=autoPositionHorizontal();runOnJS(showMenu)(x,y,positionX,positionY,menuHeight,width);}else if(menuAlign==='above'||menuAlign==='below'){const positionY=menuAlign;const y=positionY==='above'?positionAboveOffset:positionBelowOffset;const{x:x,positionX:positionX}=autoPositionHorizontal();runOnJS(showMenu)(x,y,positionX,positionY,menuHeight,width);}else{const positionX=menuAlign==='left'?'right':'left';const x=positionX==='left'?pageX+width+CONTEXT_MENU_OFFSET:minimumRightPosition+width+CONTEXT_MENU_OFFSET;const{y:y,positionY:positionY}=autoPositionVertical(-1*(CONTEXT_MENU_OFFSET+height));runOnJS(showMenu)(x,y,positionX,positionY,menuHeight,width);}}"}; object = {code: "function autoPositionVertical_ContextMenuNativeTsx2(offset){const{pageY,height,CONTEXT_MENU_OFFSET,wouldOverflowBelow,wouldOverflowAbove,availableSpaceBelow,availableSpaceAbove,positionAboveOffset,positionBelowOffset}=this.__closure;let positionY='below';let y=pageY+height+CONTEXT_MENU_OFFSET;if(wouldOverflowBelow===wouldOverflowAbove){if(availableSpaceBelow>availableSpaceAbove){positionY='below';}else{positionY='above';}}else if(wouldOverflowBelow){positionY='above';}else{positionY='below';}y=(positionY==='above'?positionAboveOffset:positionBelowOffset)+(offset!==null&&offset!==void 0?offset:0);return{y:y,positionY:positionY};}"}; object = {code: "function autoPositionHorizontal_ContextMenuNativeTsx3(){const{pageX,CONTEXT_MENU_EDGE_OFFSET,screenWidth,CONTEXT_MENU_MIN_WIDTH,minimumRightPosition}=this.__closure;const distanceFromLeftEdge=pageX-CONTEXT_MENU_EDGE_OFFSET;const distanceFromRightEdge=screenWidth-CONTEXT_MENU_EDGE_OFFSET-(pageX+CONTEXT_MENU_MIN_WIDTH);let positionX='left';let x=pageX;if(distanceFromLeftEdge>distanceFromRightEdge){positionX='right';x=minimumRightPosition;}return{x:x,positionX:positionX};}"}; object = {code: 'function onPanGestureEnd_ContextMenuNativeTsx4(){const{state,runOnJS,requestClose}=this.__closure;const{activeIndex:activeIndex}=state;const isDismiss=activeIndex.get()===-1;runOnJS(requestClose)(isDismiss);}'}; object = {code: 'function ContextMenuNativeTsx5(e){const{updateContextMenuState,state}=this.__closure;updateContextMenuState(e.absoluteX,e.absoluteY,state);}'}; object = {code: 'function ContextMenuNativeTsx6(){const{runOnJS,triggerHapticFeedback,HapticFeedbackTypes,measureButtonAndShowMenu}=this.__closure;runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);measureButtonAndShowMenu();}'}; object = {code: 'function ContextMenuNativeTsx7(){const{measureButtonAndShowMenu}=this.__closure;measureButtonAndShowMenu();}'}; object = {code: 'function ContextMenuNativeTsx8(e){const{updateContextMenuState,state}=this.__closure;updateContextMenuState(e.absoluteX,e.absoluteY,state);}'}; object = {code: 'function ContextMenuNativeTsx9(){const{runOnJS,triggerHapticFeedback,HapticFeedbackTypes,measureButtonAndShowMenu}=this.__closure;runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);measureButtonAndShowMenu();}'}; (FileImportTrackerModule).fileFinishedImporting('design/components/ContextMenu/native/ContextMenu.native.tsx'); exports.ContextMenu = ContextMenu; function ContextMenu({children, items, triggerOnLongPress, triggerOnTap, disableGesture, align, title, onOpen, onClose, keyboardShouldPersistTaps, returnRef, enabled, buttonRef}) { // fn#68867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5427, offset: 0x01c5fdba, size: 1467 bytes, params: 2, frame: 45 triggerOnLongPress = !(triggerOnLongPress === undefined) && triggerOnLongPress; triggerOnTap = !(triggerOnTap === undefined) && triggerOnTap; disableGesture = !(disableGesture === undefined) && disableGesture; align = align === undefined ? 'auto' : align; const align2 = align; const onClose2 = onClose; const keyboardShouldPersistTaps2 = keyboardShouldPersistTaps; enabled = enabled === undefined || enabled; const r11 = buttonRef ?? (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef(); const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */; let useSharedValue = reanimatedRexportModule.useSharedValue; const value9 = Reflect.apply(useSharedValue, reanimatedRexportModule, [-1]); let binding = align2; binding.useEffect(function() { return buttonRef.observe(_fun68869); }, [r11, value9]); const {items, dividerIndexes} = binding.useMemo(function() { var r2; var itemsBinding = items; var Array = global.Array; var isArray = Array.isArray(itemsBinding[0]); itemsBinding = items; r2 = isArray ? itemsBinding.flat() : itemsBinding; var env0_0 = r2; if (isArray) { items.forEach(_fun68871); } return {items: r2, dividerIndexes: []}; }, [itemsBinding]); const length = itemsBinding.length; const {width, height} = (UseWindowDimensionsNative)({ignoreKeyboard: (PlatformUtilsModule).isAndroid()}); const value12 = (ContextMenuStateNativeModule).useContextMenuState(); const activeIndex = value12.activeIndex; const value13 = (UseFontScaleModule).useFontScale(); const r7 = returnRef !== undefined ? returnRef : r11; const value14 = (ContextMenuStateNativeModule).useActiveContextMenu(); const moduleValue7 = reanimatedRexportModule; useSharedValue = moduleValue7.useSharedValue; const Math = global.Math; const max = Math.max; const CONTEXT_MENU_ITEM_BASE_HEIGHT = (ContextMenuConstantsNativeModule).CONTEXT_MENU_ITEM_BASE_HEIGHT; const CONTEXT_MENU_ITEM_PADDING = (ContextMenuConstantsNativeModule).CONTEXT_MENU_ITEM_PADDING; const value17 = Reflect.apply(useSharedValue, moduleValue7, [Reflect.apply(max, Math, [(CONTEXT_MENU_ITEM_BASE_HEIGHT - 2 * CONTEXT_MENU_ITEM_PADDING) * value13 + 2 * CONTEXT_MENU_ITEM_PADDING, CONTEXT_MENU_ITEM_BASE_HEIGHT])]); binding = align2; const env0_21 = binding.useRef(itemsBinding); binding.useLayoutEffect(_fun68872, [itemsBinding]); binding.useLayoutEffect(_fun68873, [value14, value12]); let useCallback = binding.useCallback; const value18 = Reflect.apply(useCallback, binding, [_fun68874, [activeIndex, onClose]]); const value20 = binding.useCallback(_fun68876, [onOpen, value12, itemsBinding, title, keyboardShouldPersistTaps, value18, binding.useCallback(_fun68875, [r7]), dividerIndexes]); useCallback = binding.useCallback; const ContextMenuV2 = ContextMenuV; object = {_isFabricIOS: onClose2, buttonTagSV: value9}; object.measureInWindowForFWO = (require(8815) /* metro dependency 8815: FWOMeasureUtils */).measureInWindowForFWO; object.measure = reanimatedRexportModule.measure; object.buttonRef = r11; object.title = title; object.itemCount = length; object.dividerIndexes = dividerIndexes; object.approximateItemHeight = value17; const CONTEXT_MENU_DIVIDER_HEIGHT = (ContextMenuConstantsNativeModule).CONTEXT_MENU_DIVIDER_HEIGHT; object.CONTEXT_MENU_DIVIDER_HEIGHT = CONTEXT_MENU_DIVIDER_HEIGHT; const CONTEXT_MENU_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_OFFSET; object.CONTEXT_MENU_OFFSET = CONTEXT_MENU_OFFSET; object.screenHeight = height; const CONTEXT_MENU_EDGE_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_EDGE_OFFSET; object.CONTEXT_MENU_EDGE_OFFSET = CONTEXT_MENU_EDGE_OFFSET; object.screenWidth = width; const CONTEXT_MENU_MIN_WIDTH = (ContextMenuConstantsNativeModule).CONTEXT_MENU_MIN_WIDTH; object.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH; object.menuAlign = align; object.runOnJS = reanimatedRexportModule.runOnJS; object.showMenu = value20; ContextMenuV2.__closure = object; ContextMenuV2.__workletHash = 6408542373252; ContextMenuV2.__initData = keyboardShouldPersistTaps2; const value21 = Reflect.apply(useCallback, binding, [ContextMenuV2, [r11, value9, value17, title, length, height, align, value20, width, dividerIndexes]]); const value22 = binding.useMemo(_fun68882, [triggerOnLongPress, triggerOnTap, value18, enabled, value12, value21]); const value23 = binding.useMemo(function() { return items.map(_fun68891); }, [itemsBinding]); const value24 = binding.useCallback(_fun68892, [itemsBinding]); const value25 = binding.useCallback(_fun68894, [value21]); const value26 = binding.useCallback(_fun68895, [value21]); object = {ref: r11, onPress: value25}; object.onLongPress = triggerOnLongPress && disableGesture ? value26 : undefined; object.accessibilityActions = value23; object.onAccessibilityAction = value24; if (disableGesture) { return ( <> {children(object)} ); } else { const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector; return ( {children(object)} ); } function _fun68868() { // fn#68868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5730, offset: 0x01c60375, size: 29 bytes, params: 1, frame: 11 return buttonRef.observe(_fun68869); function _fun68869(a0) { // fn#68869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5745, offset: 0x01c60392, size: 30 bytes, params: 2, frame: 11 var value; if (a0 != null) { value = environment.__proto__; env1_11.set(a0); } } } function _fun68870() { // fn#68870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5795, offset: 0x01c603b0, size: 105 bytes, params: 1, frame: 14 let itemsBinding = items; const Array = global.Array; const isArray2 = Array.isArray(itemsBinding[0]); itemsBinding = items; const r2 = isArray2 ? itemsBinding.flat() : itemsBinding; if (isArray2) { items.forEach(_fun68871); } return {items: r2, dividerIndexes: []}; function _fun68871(a0, a1) { // fn#68871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:5908, offset: 0x01c60419, size: 52 bytes, params: 3, frame: 14 var binding; var push; var binding2; if (a1 > 0) { binding = env0_1; push = binding.push; binding2 = env0_0; Reflect.apply(push, binding, [binding2.indexOf(a0[0])]); } } } function _fun68872() { // fn#68872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6440, offset: 0x01c6044d, size: 21 bytes, params: 1, frame: 2 env0_21.current = items; } function _fun68873() { // fn#68873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6483, offset: 0x01c60462, size: 57 bytes, params: 1, frame: 12 var value2; if (env0_19 == null) { value2 = environment.__proto__; (require(8812) /* metro dependency 8812: ContextMenuStateNative */).resetContextMenuState(env0_17); } } function _fun68874(a0) { // fn#68874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6562, offset: 0x01c6049b, size: 113 bytes, params: 2, frame: 13 var property; if (onClose != null) { onClose(a0); } (ContextMenuStateNativeModule).hideContextMenu(); const value3 = activeIndex.get(); if (value3 !== -1) { property = env0_21.current[value3]; if (property != null) { property.action(); } } } function _fun68875() { // fn#68875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6693, offset: 0x01c6050c, size: 51 bytes, params: 1, frame: 13 const value = environment.__proto__; (SetAccessibilityFocusAndroidModule).setAccessibilityFocus({ref: returnRef}); } function _fun68876(a0, a1, a2, a3, a4, a5) { // fn#68876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:6761, offset: 0x01c6053f, size: 303 bytes, params: 7, frame: 16 var AccessibilityAnnouncer; var announce; var intl; if (onOpen != null) { onOpen(); } const object = {}; object.key = (require(8814) /* metro dependency 8814: UID */).uid(); object.x = a0; object.y = a1; object.positionX = a2; object.positionY = a3; object.height = a4; object.width = a5; object.state = env0_17; object.items = items; object.title = title; object.keyboardShouldPersistTaps = keyboardShouldPersistTaps; object.requestClose = env0_22; object.onClose = env0_23; object.dividerIndexes = dividerIndexes; (ContextMenuStateNativeModule).showContextMenu(object); if (PlatformUtilsModule.isAndroid()) { AccessibilityAnnouncer = (require(4002) /* metro dependency 4002: shared */).AccessibilityAnnouncer; announce = AccessibilityAnnouncer.announce; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; Reflect.apply(announce, AccessibilityAnnouncer, [intl.string((require(1244) /* metro dependency 1244: indexNative */).t.ZqK0uI)]); } } function ContextMenuV() { // fn#68877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:7131, owner: ContextMenu.V, offset: 0x01c6066e, size: 924 bytes, params: 1, frame: 31 var environment; var width2; var r11; var r13; var r15; var r14; var r12; var value5; var value6; var x; var y; var width4; var height3; var value25; var positionY; var value31; var positionX; var value32; var value33; let value = environment.__proto__; if (env1_6) { value5 = env0_11.get(); if (value5 === -1) { return undefined; } value6 = (require(8815) /* metro dependency 8815: FWOMeasureUtils */).measureInWindowForFWO(value5); if (value6 == null) { return undefined; } x = value6.x; y = value6.y; width4 = value6.width; height3 = value6.height; width2 = width4; r11 = height3; r13 = x; r15 = y; } else { var moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */; var value3 = moduleValue.measure(buttonRef); if (value3 == null) { return undefined; } var pageX = value3.pageX; var pageY = value3.pageY; var width3 = value3.width; var height2 = value3.height; width2 = width3; r11 = height2; r13 = pageX; r15 = pageY; } const r4 = title != null ? length + 1 : length; const value11 = (title != null ? 1 : 0) + dividerIndexes.length; const binding = env0_20; const get = binding.get; const value12 = Reflect.apply(get, binding, []) * r4; const CONTEXT_MENU_DIVIDER_HEIGHT = (ContextMenuConstantsNativeModule).CONTEXT_MENU_DIVIDER_HEIGHT; const value13 = value12 + CONTEXT_MENU_DIVIDER_HEIGHT * value11; const value14 = r15 + r11; const CONTEXT_MENU_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_OFFSET; const value15 = value14 + CONTEXT_MENU_OFFSET; const value17 = height - r15 + CONTEXT_MENU_OFFSET; const value18 = height - value15; const CONTEXT_MENU_EDGE_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_EDGE_OFFSET; const value19 = value18 - CONTEXT_MENU_EDGE_OFFSET; const value20 = r15 - CONTEXT_MENU_EDGE_OFFSET; const result = value19 < value13; const result_2 = value20 < value13; const Math = global.Math; const value22 = Math.max(width - r13 - width2, CONTEXT_MENU_EDGE_OFFSET); const value23 = _fun68878(); const value24 = _fun68880(); let alignBinding = align; if (alignBinding === 'auto') { value32 = value23(); y = value32.y; positionY = value32.positionY; value33 = value24(); x = value33.x; positionX = value33.positionX; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(x, y, positionX, positionY, value13, width2); } else { alignBinding = align; if (alignBinding === 'above') { alignBinding = align; r12 = alignBinding !== 'above' ? value15 : value17; value31 = value24(); x = value31.x; positionX = value31.positionX; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(x, r12, positionX, alignBinding, value13, width2); } else { alignBinding = align; if (alignBinding === 'below') { alignBinding = align; r12 = alignBinding !== 'above' ? value15 : value17; value31 = value24(); x = value31.x; positionX = value31.positionX; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(x, r12, positionX, alignBinding, value13, width2); } else { alignBinding = align; value25 = 'left'; r15 = value25 !== alignBinding ? value25 : 'right'; r14 = value25 === r15 ? r13 + width2 + CONTEXT_MENU_OFFSET : value22 + width2 + CONTEXT_MENU_OFFSET; value = value23(-1 * (CONTEXT_MENU_OFFSET + r11)); y = value.y; positionY = value.positionY; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnJS(env0_24)(r14, y, r15, positionY, value13, width2); } } } function _fun68878() { // fn#68878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:7675, offset: 0x01c60a0a, size: 167 bytes, params: 1, frame: 15 const autoPositionVertical2 = autoPositionVertical; const object = {}; object.pageY = env0_1; object.height = height; const CONTEXT_MENU_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_OFFSET; object.CONTEXT_MENU_OFFSET = CONTEXT_MENU_OFFSET; object.wouldOverflowBelow = result; object.wouldOverflowAbove = result_2; object.availableSpaceBelow = env0_5; object.availableSpaceAbove = env0_6; object.positionAboveOffset = env0_4; object.positionBelowOffset = ReactModule; autoPositionVertical2.__closure = object; autoPositionVertical2.__workletHash = 15309589830995; autoPositionVertical2.__initData = env2_8; return autoPositionVertical2; function autoPositionVertical(a0) { // fn#68879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:7711, offset: 0x01c60ab1, size: 141 bytes, params: 2, frame: 14 const value = a0; (ContextMenuConstantsNativeModule).CONTEXT_MENU_OFFSET; const r1 = result === result_2 ? env1_5 > env1_6 ? 'below' : 'above' : result ? 'above' : 'below'; return {y: (r1 === 'above' ? env1_4 : env1_3) + (value ?? 0), positionY: r1}; } } function _fun68880() { // fn#68880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:8210, offset: 0x01c60b3e, size: 136 bytes, params: 1, frame: 17 const autoPositionHorizontal2 = autoPositionHorizontal; const object = {}; object.pageX = env0_0; const CONTEXT_MENU_EDGE_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_EDGE_OFFSET; object.CONTEXT_MENU_EDGE_OFFSET = CONTEXT_MENU_EDGE_OFFSET; object.screenWidth = width; const CONTEXT_MENU_MIN_WIDTH = (ContextMenuConstantsNativeModule).CONTEXT_MENU_MIN_WIDTH; object.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH; object.minimumRightPosition = env0_9; autoPositionHorizontal2.__closure = object; autoPositionHorizontal2.__workletHash = 14761866330436; autoPositionHorizontal2.__initData = env2_9; return autoPositionHorizontal2; function autoPositionHorizontal() { // fn#68881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:8248, offset: 0x01c60bc6, size: 128 bytes, params: 1, frame: 16 var r1; var r2; const value = environment.__proto__; let binding = env1_0; const CONTEXT_MENU_EDGE_OFFSET = (ContextMenuConstantsNativeModule).CONTEXT_MENU_EDGE_OFFSET; const value3 = binding - CONTEXT_MENU_EDGE_OFFSET; const value5 = width - CONTEXT_MENU_EDGE_OFFSET; binding = env1_0; const CONTEXT_MENU_MIN_WIDTH = (ContextMenuConstantsNativeModule).CONTEXT_MENU_MIN_WIDTH; const value6 = value5 - (binding + CONTEXT_MENU_MIN_WIDTH); binding = env1_0; if (value3 > value6) { binding = env1_9; r1 = 'right'; r2 = binding; } else { r1 = 'left'; r2 = binding; } return {x: r2, positionX: r1}; } } } function _fun68882() { // fn#68882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:9749, offset: 0x01c60c46, size: 745 bytes, params: 1, frame: 23 var r0; const Gesture = (Module05321Module).Gesture; var value4; var enabledBinding; var value5; var onBegin; var closure; const runOnJS = (ReanimatedRexportModule).runOnJS; const triggerHapticFeedback = (HapticUtilsNativeModule).triggerHapticFeedback; const HapticFeedbackTypes = (HapticUtilsNativeModule).HapticFeedbackTypes; var value6; var onUpdate; const updateContextMenuState = (ContextMenuStateNativeModule).updateContextMenuState; var onStart; var value8; var enabled4; var value9; var shouldCancelWhenOutside2; let value = _fun68883(); if (triggerOnLongPress) { value8 = Gesture.Pan(); enabled4 = value8.enabled; enabledBinding = enabled; value9 = Reflect.apply(enabled4, value8, [enabledBinding]); onUpdate = value9.onUpdate; closure = i_68885; closure.__closure = {updateContextMenuState: updateContextMenuState, state: env0_17}; closure.__workletHash = 2460213213323; closure.__initData = env1_11; value = Reflect.apply(onUpdate, value9, [closure]).onEnd(value); shouldCancelWhenOutside2 = Gesture.LongPress().enabled(enabledBinding).shouldCancelWhenOutside(false); onStart = shouldCancelWhenOutside2.onStart; closure = n_68886; closure.__closure = {runOnJS: runOnJS, triggerHapticFeedback: triggerHapticFeedback, HapticFeedbackTypes: HapticFeedbackTypes, measureButtonAndShowMenu: env0_25}; closure.__workletHash = 12352363869337; closure.__initData = env1_12; return Gesture.Simultaneous(Reflect.apply(onStart, shouldCancelWhenOutside2, [closure]), value); } if (triggerOnTap) { value = Gesture.Tap(); value = value.enabled(enabled); onStart = value.onStart; closure = o_68887; closure.__closure = {measureButtonAndShowMenu: env0_25}; closure.__workletHash = 13410382812897; closure.__initData = env1_13; value = Reflect.apply(onStart, value, [closure]); r0 = value; } else { value4 = Gesture.Pan(); value5 = value4.enabled(enabled); onBegin = value5.onBegin; closure = t_68888; closure.__closure = {runOnJS: runOnJS, triggerHapticFeedback: triggerHapticFeedback, HapticFeedbackTypes: HapticFeedbackTypes, measureButtonAndShowMenu: env0_25}; closure.__workletHash = 12845174582902; closure.__initData = env1_15; value6 = Reflect.apply(onBegin, value5, [closure]); onUpdate = value6.onUpdate; closure = e_68889; closure.__closure = {updateContextMenuState: updateContextMenuState, state: env0_17}; closure.__workletHash = 17473642675622; closure.__initData = env1_14; value = Reflect.apply(onUpdate, value6, [closure]).onEnd(value); r0 = value; } return r0; function _fun68883() { // fn#68883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:9770, offset: 0x01c60f2f, size: 99 bytes, params: 1, frame: 15 const onPanGestureEnd2 = onPanGestureEnd; const object = {}; object.state = env1_17; object.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS; object.requestClose = env1_22; onPanGestureEnd2.__closure = object; onPanGestureEnd2.__workletHash = 12851223476540; onPanGestureEnd2.__initData = env2_10; return onPanGestureEnd2; function onPanGestureEnd() { // fn#68884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:9801, offset: 0x01c60f92, size: 78 bytes, params: 1, frame: 13 const value = environment.__proto__.__proto__; (ReanimatedRexportModule).runOnJS(env2_22)(env2_17.activeIndex.get() === -1); } } function i_68885({absoluteX, absoluteY}) { // fn#68885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:10098, offset: 0x01c60fe0, size: 62 bytes, params: 2, frame: 16 const value = environment.__proto__.__proto__; (ContextMenuStateNativeModule).updateContextMenuState(absoluteX, absoluteY, env1_17); } function n_68886() { // fn#68886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:10385, offset: 0x01c6101e, size: 92 bytes, params: 1, frame: 15 let value = environment.__proto__.__proto__; value = Reflect.apply((require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS, value, [(require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback]); const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes; const IMPACT_MEDIUM = HapticFeedbackTypes.IMPACT_MEDIUM; value(IMPACT_MEDIUM); value = environment.__proto__; env1_25(); } function o_68887() { // fn#68887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:10805, offset: 0x013bbec0, size: 15 bytes, params: 1, frame: 9 env1_25(); } function t_68888() { // fn#68888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:10955, offset: 0x01c6101e, size: 92 bytes, params: 1, frame: 15 let value = environment.__proto__.__proto__; value = Reflect.apply((require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS, value, [(require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback]); const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes; const IMPACT_MEDIUM = HapticFeedbackTypes.IMPACT_MEDIUM; value(IMPACT_MEDIUM); value = environment.__proto__; env1_25(); } function e_68889({absoluteX, absoluteY}) { // fn#68889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11291, offset: 0x01c60fe0, size: 62 bytes, params: 2, frame: 16 const value = environment.__proto__.__proto__; (ContextMenuStateNativeModule).updateContextMenuState(absoluteX, absoluteY, env1_17); } } function _fun68890() { // fn#68890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11526, offset: 0x01c6107a, size: 28 bytes, params: 1, frame: 11 return items.map(function(a0) { return {name: a0.label, label: a0.label}; }); } function _fun68892(a0) { // fn#68892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11596, offset: 0x01c610af, size: 68 bytes, params: 2, frame: 12 const env0_0 = a0; const value = items.find(_fun68893); if (!(value == null || value.action == null)) { value.action(); } function _fun68893({label}) { // fn#68893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11623, offset: 0x01c610f3, size: 33 bytes, params: 2, frame: 2 return label === env0_0.nativeEvent.actionName; } } function _fun68894() { // fn#68894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11716, offset: 0x01c61114, size: 115 bytes, params: 1, frame: 14 let value = environment.__proto__; if ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() && (require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */).getIsScreenReaderEnabled()) { value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnUI(env0_25)(); } } function _fun68895() { // fn#68895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11825, offset: 0x01c61187, size: 49 bytes, params: 1, frame: 12 let value = environment.__proto__; value = require(4017) /* metro dependency 4017: ReanimatedRexport */; value.runOnUI(env0_25)(); } } } function _fun68891(a0) { // fn#68891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8996:11537, offset: 0x01c61096, size: 25 bytes, params: 2, frame: 3 return {name: a0.label, label: a0.label}; } global.__d(_fun68866, 8811, [31, 33, 4020, 477, 4017, 1478, 8812, 4584, 8813, 4570, 8814, 4002, 1244, 8815, 5321, 4081, 4559, 2]) /* metro module 8811, dependencies: [31, 33, 4020, 477, 4017, 1478, 8812, 4584, 8813, 4570, 8814, 4002, 1244, 8815, 5321, 4081, 4559, 2] */;