Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

@@ -0,0 +1,557 @@
/* 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] */
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});
const env0_3 = importAll(31) /* metro dependency 31 */;
let value = require(33) /* metro dependency 33 */;
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=availableSpaceBelow<menuHeight;const wouldOverflowAbove=availableSpaceAbove<menuHeight;const minimumRightPosition=Math.max(screenWidth-pageX-width,CONTEXT_MENU_EDGE_OFFSET);function autoPositionVertical(offset){'worklet';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};}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();}'};
(require(2) /* metro dependency 2 */).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
var object2;
triggerOnLongPress = !(triggerOnLongPress === undefined) && triggerOnLongPress;
triggerOnTap = !(triggerOnTap === undefined) && triggerOnTap;
disableGesture = !(disableGesture === undefined) && disableGesture;
align = align === undefined ? 'auto' : align;
const env0_3 = align;
const env0_6 = onClose;
const env0_7 = 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 = env0_3;
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} = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: (require(477) /* metro dependency 477: PlatformUtils */).isAndroid()});
const value12 = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).useContextMenuState();
const activeIndex = value12.activeIndex;
const value13 = (require(4584) /* metro dependency 4584: useFontScale */).useFontScale();
const r7 = returnRef !== undefined ? returnRef : r11;
const value14 = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).useActiveContextMenu();
const moduleValue7 = reanimatedRexportModule;
useSharedValue = moduleValue7.useSharedValue;
const Math = global.Math;
const max = Math.max;
const CONTEXT_MENU_ITEM_BASE_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_ITEM_BASE_HEIGHT;
const CONTEXT_MENU_ITEM_PADDING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).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 = env0_3;
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 closure = ContextMenuV;
object2 = {_isFabricIOS: env0_6, buttonTagSV: value9};
object2.measureInWindowForFWO = (require(8815) /* metro dependency 8815: FWOMeasureUtils */).measureInWindowForFWO;
object2.measure = reanimatedRexportModule.measure;
object2.buttonRef = r11;
object2.title = title;
object2.itemCount = length;
object2.dividerIndexes = dividerIndexes;
object2.approximateItemHeight = value17;
const CONTEXT_MENU_DIVIDER_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_DIVIDER_HEIGHT;
object2.CONTEXT_MENU_DIVIDER_HEIGHT = CONTEXT_MENU_DIVIDER_HEIGHT;
const CONTEXT_MENU_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_OFFSET;
object2.CONTEXT_MENU_OFFSET = CONTEXT_MENU_OFFSET;
object2.screenHeight = height;
const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET;
object2.CONTEXT_MENU_EDGE_OFFSET = CONTEXT_MENU_EDGE_OFFSET;
object2.screenWidth = width;
const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH;
object2.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH;
object2.menuAlign = align;
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.showMenu = value20;
closure.__closure = object2;
closure.__workletHash = 6408542373252;
closure.__initData = env0_7;
const value21 = Reflect.apply(useCallback, binding, [closure, [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]);
object2 = {ref: r11, onPress: value25};
object2.onLongPress = triggerOnLongPress && disableGesture ? value26 : undefined;
object2.accessibilityActions = value23;
object2.onAccessibilityAction = value24;
if (disableGesture) {
return (
<>
{children(object2)}
</>
);
} else {
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
return (
<GestureDetector gesture={value22}>
{children(object2)}
</GestureDetector>
);
}
}
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 _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 _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);
}
(require(8812) /* metro dependency 8812: ContextMenuStateNative */).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__;
(require(4570) /* metro dependency 4570: setAccessibilityFocusAndroid */).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 object2 = {};
object2.key = (require(8814) /* metro dependency 8814: UID */).uid();
object2.x = a0;
object2.y = a1;
object2.positionX = a2;
object2.positionY = a3;
object2.height = a4;
object2.width = a5;
object2.state = env0_17;
object2.items = items;
object2.title = title;
object2.keyboardShouldPersistTaps = keyboardShouldPersistTaps;
object2.requestClose = env0_22;
object2.onClose = env0_23;
object2.dividerIndexes = dividerIndexes;
(require(8812) /* metro dependency 8812: ContextMenuStateNative */).showContextMenu(object2);
const value = require(477) /* metro dependency 477: PlatformUtils */;
if (value.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 = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_DIVIDER_HEIGHT;
const value13 = value12 + CONTEXT_MENU_DIVIDER_HEIGHT * value11;
const value14 = r15 + r11;
const CONTEXT_MENU_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).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 = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).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 _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 = (require(5321) /* metro dependency 5321 */).Gesture;
var value4;
var enabledBinding;
var value5;
var onBegin;
var closure;
const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
const triggerHapticFeedback = (require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback;
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
var value6;
var onUpdate;
const updateContextMenuState = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).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 _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 _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 _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 _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 _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 closure = autoPositionVertical;
const object2 = {};
object2.pageY = env0_1;
object2.height = height;
const CONTEXT_MENU_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_OFFSET;
object2.CONTEXT_MENU_OFFSET = CONTEXT_MENU_OFFSET;
object2.wouldOverflowBelow = result;
object2.wouldOverflowAbove = result_2;
object2.availableSpaceBelow = env0_5;
object2.availableSpaceAbove = env0_6;
object2.positionAboveOffset = env0_4;
object2.positionBelowOffset = env0_3;
closure.__closure = object2;
closure.__workletHash = 15309589830995;
closure.__initData = env2_8;
return closure;
}
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 closure = autoPositionHorizontal;
const object2 = {};
object2.pageX = env0_0;
const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET;
object2.CONTEXT_MENU_EDGE_OFFSET = CONTEXT_MENU_EDGE_OFFSET;
object2.screenWidth = width;
const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH;
object2.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH;
object2.minimumRightPosition = env0_9;
closure.__closure = object2;
closure.__workletHash = 14761866330436;
closure.__initData = env2_9;
return closure;
}
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 closure = onPanGestureEnd;
const object2 = {};
object2.state = env1_17;
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.requestClose = env1_22;
closure.__closure = object2;
closure.__workletHash = 12851223476540;
closure.__initData = env2_10;
return closure;
}
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__;
(require(8812) /* metro dependency 8812: ContextMenuStateNative */).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 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;
(require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).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 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 = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).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 = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).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 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__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(env2_22)(env2_17.activeIndex.get() === -1);
}
@@ -0,0 +1,16 @@
/* Metro module 8813; source: design/components/ContextMenu/native/ContextMenuConstants.native.tsx; dependencies: [2] */
function _fun68910(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8998:6, offset: 0x01c61657, size: 159 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/ContextMenu/native/ContextMenuConstants.native.tsx');
exports.CONTEXT_MENU_ITEM_PADDING = 12;
exports.CONTEXT_MENU_ITEM_BASE_HEIGHT = 42;
exports.CONTEXT_MENU_DIVIDER_HEIGHT = 4;
exports.CONTEXT_MENU_EDGE_OFFSET = 12;
exports.CONTEXT_MENU_MIN_WIDTH = 220;
exports.CONTEXT_MENU_OFFSET = 10;
exports.CONTEXT_MENU_MIN_SCALE = 0.5;
exports.CONTEXT_MENU_SPRING = {'mass': 0.3, 'damping': 20, 'stiffness': 200, 'overshootClamping': true,
'restDisplacementThreshold': 0.001};
}
@@ -0,0 +1,86 @@
/* Metro module 12799; source: design/components/ContextMenu/native/ContextMenuContainer.native.tsx; dependencies: [31, 27, 33, 4501, 12800, 8812, 1599, 4509, 4555, 4508, 2] */
function _fun97632(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12989:6, offset: 0x0218b024, size: 284 bytes, params: 8, frame: 22
const env0_0 = require;
const getItemKey_97633 = function(a0) {
return a0.key;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const StyleSheet = value.StyleSheet;
const env0_4 = value.View;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object = {};
copyDataProperties(object, StyleSheet.absoluteFillObject, undefined);
object['zIndex'] = 99999;
const env0_6 = Reflect.apply(createStyles, value, [{overlayView: object,
wrapperView: StyleSheet.absoluteFillObject}]);
const env0_7 = [];
const EMPTY_CALLBACK = function() {
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/ContextMenu/native/ContextMenuContainer.native.tsx');
exports.ContextMenuContainer = ContextMenuContainer;
}
function renderItem_97635(a0, a1, a2, a3) { // fn#97635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12989:342, offset: 0x0218b140, size: 73 bytes, params: 5, frame: 15
const ContextMenuPopout = (require(12800) /* metro dependency 12800: ContextMenuPopoutNative */).ContextMenuPopout;
return (
<ContextMenuPopout
menu={a1}
transitionState={a2}
cleanUp={a3}
key={a0}
/>
);
}
function ContextMenuContainer() { // fn#97636, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12989:547, offset: 0x0218b189, size: 269 bytes, params: 1, frame: 19
const value2 = undefined;
const styles = useStyles();
const value3 = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).useActiveContextMenu();
const r5 = value3 != null ? [value3] : env0_7;
const r1 = (value3 == null ? value2 : value3.requestClose) ?? EMPTY_CALLBACK;
const binding = env0_3;
binding.useEffect(function() {
var KeyboardEvents = require(dependencyMap[6]).KeyboardEvents;
var env0_0 = KeyboardEvents.addListener('keyboardDidHide', require(dependencyMap[5]).hideContextMenu);
return _fun97638;
}, []);
const value5 = binding.useCallback(_fun97640, [binding.useCallback(_fun97639, [r1]), styles.overlayView,
styles.wrapperView]);
const TransitionGroup = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionGroup;
return (
<TransitionGroup
wrapChildren={value5}
items={r5}
renderItem={renderItem_97635}
getItemKey={getItemKey_97633}
/>
);
}
function _fun97637() { // fn#97637, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12989:712, offset: 0x0218b296, size: 82 bytes, params: 1, frame: 16
const KeyboardEvents = (require(1599) /* metro dependency 1599 */).KeyboardEvents;
const env0_0 = KeyboardEvents.addListener('keyboardDidHide',
(require(8812) /* metro dependency 8812: ContextMenuStateNative */).hideContextMenu);
return _fun97638;
}
function _fun97640(a0, a1) { // fn#97640, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12989:886, offset: 0x0218b2e8, size: 171 bytes, params: 3, frame: 20
const OverlayView = importDefault(4509) /* metro dependency 4509: OverlayView */;
const r7 = a1.length !== 0 ? 'auto' : 'none';
const Dialog = (require(4555) /* metro dependency 4555: DialogNative */).Dialog;
return (
<OverlayView style={styles.overlayView}>
<View pointerEvents={r7} style={styles.wrapperView}>
<Dialog onDismiss={env0_2}>
{a0}
</Dialog>
</View>
</OverlayView>
);
}
@@ -0,0 +1,176 @@
/* Metro module 12798; source: design/components/ContextMenu/native/ContextMenuItem.native.tsx; dependencies: [31, 27, 33, 4017, 4501, 8813, 697, 1357, 8812, 4577, 4581, 4580, 4573, 2] */
function _fun97623(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12988:6, offset: 0x0218a63a, size: 277 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const Pressable = (require(27) /* metro dependency 27 */).Pressable;
const value = require(33) /* metro dependency 33 */;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
const env0_6 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(Pressable);
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun97624);
object = {code: 'function ContextMenuItemNativeTsx1(){const{pan}=this.__closure;return pan.get();}'};
object = {code: 'function ContextMenuItemNativeTsx2(_current,previous){const{measure,ref,index,INDEX_BOUNDS_OFFSET,itemMeasurements,INDEX_BOUNDS_PAGE_X_OFFSET,INDEX_BOUNDS_PAGE_Y_OFFSET,INDEX_BOUNDS_WIDTH_OFFSET,INDEX_BOUNDS_HEIGHT_OFFSET}=this.__closure;if(previous==null||_current===previous)return;const measurements=measure(ref);if(measurements!=null){const{pageX:pageX,pageY:pageY,width:width,height:height}=measurements;const offset=index*INDEX_BOUNDS_OFFSET;itemMeasurements.get()[offset+INDEX_BOUNDS_PAGE_X_OFFSET]=pageX;itemMeasurements.get()[offset+INDEX_BOUNDS_PAGE_Y_OFFSET]=pageY;itemMeasurements.get()[offset+INDEX_BOUNDS_WIDTH_OFFSET]=width;itemMeasurements.get()[offset+INDEX_BOUNDS_HEIGHT_OFFSET]=height;}}'};
object = {code: "function ContextMenuItemNativeTsx3(){const{activeIndex,index,pressed,withSpring,backgroundColor,SUBTLE_SPRING}=this.__closure;const isActive=activeIndex.get()===index||pressed.get()===1;return{backgroundColor:withSpring(isActive?backgroundColor:'transparent',SUBTLE_SPRING,'animate-always')};}"};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/ContextMenu/native/ContextMenuItem.native.tsx');
exports.ContextMenuItem = ContextMenuItem;
}
function _fun97624(a0) { // fn#97624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12988:214, offset: 0x0218a74f, size: 406 bytes, params: 2, frame: 17
const object3 = {};
const object6 = {'padding': null, 'minHeight': null, 'flexDirection': 'row', 'justifyContent': 'space-between',
'alignItems': 'center', 'gap': 8};
const CONTEXT_MENU_ITEM_PADDING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_ITEM_PADDING;
object6.padding = CONTEXT_MENU_ITEM_PADDING;
const CONTEXT_MENU_ITEM_BASE_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_ITEM_BASE_HEIGHT;
object6.minHeight = CONTEXT_MENU_ITEM_BASE_HEIGHT;
object3.container = object6;
object3.containerRefresh = {justifyContent: 'flex-start'};
const object7 = {};
object7.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object7.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.roundedTop = object7;
const object8 = {};
object8.borderBottomLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object8.borderBottomRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object3.roundedBottom = object8;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object3.border = {borderBottomWidth: 1, borderBottomColor: BORDER_SUBTLE};
const BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
object3.pressed = {backgroundColor: BACKGROUND_MOD_SUBTLE};
object3.icon = {'width': 20, 'height': 20,
tintColor: a0 === 'destructive' ? (importDefault(697) /* metro dependency 697: native */).colors.TEXT_FEEDBACK_CRITICAL : (importDefault(697) /* metro dependency 697: native */).colors.TEXT_STRONG};
object3.label = {flexShrink: 1};
object3.trailingIndicator = {marginLeft: 'auto'};
return object3;
}
function ContextMenuItem({label, IconComponent, trailingIndicator, iconSource, start, end, lastInSection, index, state, onPress, variant, accessibilityRole}) { // fn#97625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12988:2183, offset: 0x0218a8e5, size: 1239 bytes, params: 2, frame: 39
var object2;
variant = variant === undefined ? 'default' : variant;
accessibilityRole = accessibilityRole === undefined ? 'button' : accessibilityRole;
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const styles = useStyles(variant);
const value3 = (importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('ContextMenuItem');
const pan = state.pan;
const itemMeasurements = state.itemMeasurements;
const env0_3 = itemMeasurements;
const activeIndex = state.activeIndex;
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
let closure = function() {
return pan.get();
};
closure.__closure = {pan: pan};
closure.__workletHash = 11852115418144;
closure.__initData = env0_8;
const closure2 = ContextMenuItemP;
object2 = {measure: reanimatedRexportModule.measure, ref: value2, index: index};
const INDEX_BOUNDS_OFFSET = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_OFFSET;
object2.INDEX_BOUNDS_OFFSET = INDEX_BOUNDS_OFFSET;
object2.itemMeasurements = itemMeasurements;
const INDEX_BOUNDS_PAGE_X_OFFSET = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_PAGE_X_OFFSET;
object2.INDEX_BOUNDS_PAGE_X_OFFSET = INDEX_BOUNDS_PAGE_X_OFFSET;
const INDEX_BOUNDS_PAGE_Y_OFFSET = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_PAGE_Y_OFFSET;
object2.INDEX_BOUNDS_PAGE_Y_OFFSET = INDEX_BOUNDS_PAGE_Y_OFFSET;
const INDEX_BOUNDS_WIDTH_OFFSET = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_WIDTH_OFFSET;
object2.INDEX_BOUNDS_WIDTH_OFFSET = INDEX_BOUNDS_WIDTH_OFFSET;
const INDEX_BOUNDS_HEIGHT_OFFSET = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_HEIGHT_OFFSET;
object2.INDEX_BOUNDS_HEIGHT_OFFSET = INDEX_BOUNDS_HEIGHT_OFFSET;
closure2.__closure = object2;
closure2.__workletHash = 9571959267234;
closure2.__initData = env0_9;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
const backgroundColor = styles.pressed.backgroundColor;
const env0_6 = backgroundColor;
const moduleValue4 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue4.useAnimatedStyle;
closure = ContextMenuItemR;
object2 = {activeIndex: activeIndex, index: index, pressed: value4};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.backgroundColor = backgroundColor;
const SUBTLE_SPRING = (require(4581) /* metro dependency 4581: springPresets */).SUBTLE_SPRING;
object2.SUBTLE_SPRING = SUBTLE_SPRING;
closure.__closure = object2;
closure.__workletHash = 624481847983;
closure.__initData = env0_10;
const value5 = Reflect.apply(useAnimatedStyle, moduleValue4, [closure]);
const r14 = IconComponent != null ? <IconComponent size="sm" color={styles.icon.tintColor} /> : iconSource != null ? ((Component) => <Component source={iconSource} style={styles.icon} />)(importDefault(4580) /* metro dependency 4580: Icon */) : null;
const r9 = trailingIndicator != null ? ((Component) => <Component size="sm" color={styles.icon.tintColor} />)(trailingIndicator) : null;
let binding = env0_3;
const value10 = binding.useCallback(_fun97629, [index, itemMeasurements]);
const value11 = binding.useCallback(function() {
activeIndex.set(index);
}, [activeIndex, index]);
const value12 = binding.useCallback(function() {
activeIndex.set(-1);
}, [activeIndex]);
binding = env0_6;
const items3 = [styles.container];
items3[1] = value3 && styles.containerRefresh;
items3[2] = !end && !lastInSection && styles.border;
items3[3] = start && styles.roundedTop;
items3[4] = end && styles.roundedBottom;
items3[5] = value5;
const items2 = [value3 && ((View) => <View>{r14}</View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View)];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <Text animated variant="text-md/medium" style={styles.label} color={variant !== 'destructive' ? 'text-strong' : 'text-feedback-critical'}>{label}</Text>;
items2[2] = !value3 && ((View) => <View>{r14}</View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
items2[3] = r9 != null && ((View) => <View style={styles.trailingIndicator}>{r9}</View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
return ((Component) => <Component ref={value2} style={items3} onLayout={value10} onPressIn={value11} onPressOut={value12} onPress={onPress} accessibilityRole={accessibilityRole}>{items2}</Component>)(binding);
}
function ContextMenuItemP(a0, a1) { // fn#97627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12988:2632, owner: ContextMenuItem.p, offset: 0x0218adbc, size: 276 bytes, params: 3, frame: 20
var value;
var value3;
var pageX;
var pageY;
var width;
var height;
if (a1 != null) {
if (a0 !== a1) {
value = environment.__proto__;
value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).measure(env0_1);
if (value3 != null) {
pageX = value3.pageX;
pageY = value3.pageY;
width = value3.width;
height = value3.height;
value = index * (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_OFFSET;
itemMeasurements.get()[value + (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_PAGE_X_OFFSET] = pageX;
itemMeasurements.get()[value + (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_PAGE_Y_OFFSET] = pageY;
itemMeasurements.get()[value + (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_WIDTH_OFFSET] = width;
itemMeasurements.get()[value + (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_HEIGHT_OFFSET] = height;
}
}
}
}
function ContextMenuItemR() { // fn#97628, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12988:3451, owner: ContextMenuItem.R, offset: 0x0218aed0, size: 135 bytes, params: 1, frame: 18
const r7 = activeIndex.get() === index || env0_5.get() === 1;
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const backgroundColor2 = r7 ? backgroundColor : 'transparent';
const SUBTLE_SPRING = (require(4581) /* metro dependency 4581: springPresets */).SUBTLE_SPRING;
return {backgroundColor: Reflect.apply(withSpring, springModule, [backgroundColor2, SUBTLE_SPRING,
'animate-always'])};
}
function _fun97629({nativeEvent}) { // fn#97629, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12988:3945, offset: 0x0218af57, size: 153 bytes, params: 2, frame: 18
var indexBinding;
var value2;
var value3;
const {height, width} = nativeEvent.layout;
if (height !== 0) {
if (width !== 0) {
indexBinding = index;
value2 = environment.__proto__;
value3 = indexBinding * (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_OFFSET;
itemMeasurements.get()[value3 + (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_HEIGHT_OFFSET] = height;
itemMeasurements.get()[value3 + (require(8812) /* metro dependency 8812: ContextMenuStateNative */).INDEX_BOUNDS_WIDTH_OFFSET] = width;
}
}
}
@@ -0,0 +1,393 @@
/* Metro module 12800; source: design/components/ContextMenu/native/ContextMenuPopout.native.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 8813, 4017, 4508, 5463, 1478, 477, 4577, 8812, 5321, 4573, 12798, 4559, 4562, 1244, 2] */
function _fun97641(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97641, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:6, offset: 0x0218b393, size: 659 bytes, params: 8, frame: 25
var object3;
let env0_0 = require;
const renderMenuItems = function(a0) {
var items = a0.items;
var env0_0 = items;
var env0_1 = a0.title;
var env0_2 = a0.state;
var env0_3 = a0.onPress;
var env0_4 = a0.dividerIndexes;
return items.map(_fun97644);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let env0_3 = importDefault(57) /* metro dependency 57 */;
let env0_4 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.View;
const StyleSheet = value.StyleSheet;
value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.Fragment;
const env0_8 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
let createStyles = value.createStyles;
object3 = {};
const object5 = {'position': 'absolute', 'backgroundColor': null, 'borderWidth': 1};
const BACKGROUND_SURFACE_HIGHEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGHEST;
object5.backgroundColor = BACKGROUND_SURFACE_HIGHEST;
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object5.borderColor = BORDER_SUBTLE;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH;
object5.minWidth = CONTEXT_MENU_MIN_WIDTH;
const SHADOW_HIGH = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_HIGH;
copyDataProperties(object5, SHADOW_HIGH, undefined);
object3.container = object5;
const CONTEXT_MENU_ITEM_PADDING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_ITEM_PADDING;
object3.titleContainer = {padding: CONTEXT_MENU_ITEM_PADDING};
const object7 = {};
const CONTEXT_MENU_DIVIDER_HEIGHT = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_DIVIDER_HEIGHT;
object7.borderBottomWidth = CONTEXT_MENU_DIVIDER_HEIGHT;
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object7.borderBottomColor = BORDER_SUBTLE;
object3.divider = object7;
const env0_9 = Reflect.apply(createStyles, value, [object3]);
object3 = {code: "function ContextMenuPopoutNativeTsx1(){const{maxHeight,height,CONTEXT_MENU_MIN_WIDTH,positionY,positionX,CONTEXT_MENU_MIN_SCALE,withSpring,interpolate,visible,CONTEXT_MENU_SPRING,transitionState,TransitionStates,runOnJS,cleanUp,onClose}=this.__closure;const visibleHeight=Math.min(maxHeight,height);const halfHeight=visibleHeight/2;const halfWidth=CONTEXT_MENU_MIN_WIDTH/2;const translateYDirection=positionY==='below'?-1:1;const translateXDirection=positionX==='left'?-1:1;const translateY=translateYDirection*halfHeight+CONTEXT_MENU_MIN_SCALE*-translateYDirection*halfHeight;const translateX=translateXDirection*halfWidth+CONTEXT_MENU_MIN_SCALE*-translateXDirection*halfWidth;return{opacity:withSpring(interpolate(visible.get(),[0,1],[0,1]),CONTEXT_MENU_SPRING,'respect-motion-settings',function(finished){if(finished&&transitionState===TransitionStates.YEETED){runOnJS(cleanUp)();runOnJS(onClose)();}}),transform:[{translateX:withSpring(interpolate(visible.get(),[0,1],[translateX,0]),CONTEXT_MENU_SPRING)},{translateY:withSpring(interpolate(visible.get(),[0,1],[translateY,0]),CONTEXT_MENU_SPRING)},{scale:withSpring(interpolate(visible.get(),[0,1],[CONTEXT_MENU_MIN_SCALE,1]),CONTEXT_MENU_SPRING)}]};}"};
object3 = {code: 'function ContextMenuPopoutNativeTsx2(finished){const{transitionState,TransitionStates,runOnJS,cleanUp,onClose}=this.__closure;if(finished&&transitionState===TransitionStates.YEETED){runOnJS(cleanUp)();runOnJS(onClose)();}}'};
object3 = {code: 'function update_ContextMenuPopoutNativeTsx3(e){const{updateContextMenuState,state}=this.__closure;updateContextMenuState(e.absoluteX,e.absoluteY,state);}'};
object3 = {code: 'function ContextMenuPopoutNativeTsx4(){const{state,runOnJS,requestClose}=this.__closure;const{activeIndex:activeIndex}=state;const isDismiss=activeIndex.get()===-1;runOnJS(requestClose)(isDismiss);}'};
value = require(4501) /* metro dependency 4501: createStyles */;
createStyles = value.createStyles;
object3 = {};
const CONTEXT_MENU_BACKDROP_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.CONTEXT_MENU_BACKDROP_BACKGROUND;
object3.backdrop = {backgroundColor: CONTEXT_MENU_BACKDROP_BACKGROUND};
const object8 = {};
copyDataProperties(object8, StyleSheet.absoluteFillObject, undefined);
object8['height'] = 'auto';
object3.accessibleDismiss = object8;
const env0_14 = Reflect.apply(createStyles, value, [object3]);
object3 = {code: 'function ContextMenuPopoutNativeTsx5(){const{withSpring,visible,CONTEXT_MENU_SPRING}=this.__closure;return{opacity:withSpring(visible.get(),CONTEXT_MENU_SPRING)};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/ContextMenu/native/ContextMenuPopout.native.tsx');
exports.ContextMenuPopout = ContextMenuPopout;
}
function ContextMenuDivider() { // fn#97642, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:2461, offset: 0x0218b626, size: 41 bytes, params: 1, frame: 14
const styles = useStyles();
return <View style={styles.divider} />;
}
function renderMenuItems({items, title, state, onPress, dividerIndexes}) { // fn#97643, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:2531, offset: 0x0218b64f, size: 71 bytes, params: 2, frame: 12
return items.map(_fun97644);
}
function ContextMenuBackdrop({onPress, visible}) { // fn#97646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:3467, offset: 0x0218b84f, size: 334 bytes, params: 2, frame: 21
const styles = useStyles();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = ContextMenuBackdropN;
const object2 = {};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.visible = visible;
const CONTEXT_MENU_SPRING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_SPRING;
object2.CONTEXT_MENU_SPRING = CONTEXT_MENU_SPRING;
closure.__closure = object2;
closure.__workletHash = 6862317967896;
closure.__initData = env0_15;
const value2 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const Backdrop = (require(4562) /* metro dependency 4562: BackdropNative */).Backdrop;
const items2 = [styles.backdrop, value2];
const isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
return (
<Backdrop
blur="none"
style={items2}
accessibleDismissStyle={styles.accessibleDismiss}
onDismiss={onPress}
accessibilityLabel={isAndroid2 ? Reflect.apply(string, intl, [t.hPBScv]) : Reflect.apply(string, intl,
[t.xs0juG])}
/>
);
}
function ContextMenuPopout({menu, transitionState, cleanUp}) { // fn#97648, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:4157, offset: 0x0218b9eb, size: 1316 bytes, params: 2, frame: 39
const x = menu.x;
const positionX = menu.positionX;
const positionY = menu.positionY;
const env0_3 = positionY;
const height = menu.height;
const env0_4 = height;
const items2 = menu.items;
const state = menu.state;
const requestClose = menu.requestClose;
const onClose = menu.onClose;
const title = menu.title;
const keyboardShouldPersistTaps = menu.keyboardShouldPersistTaps;
const r11 = keyboardShouldPersistTaps === undefined ? 'handled' : keyboardShouldPersistTaps;
const dividerIndexes = menu.dividerIndexes;
const y = menu.y;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useSharedValue = reanimatedRexportModule.useSharedValue;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const MOUNTED = TransitionStates.MOUNTED;
const value4 = Reflect.apply(useSharedValue, reanimatedRexportModule, [transitionState !== MOUNTED ? 0 : 1]);
let binding = env0_4;
binding.useEffect(_fun97649, [transitionState, value4]);
const styles = useStyles();
const {top,
bottom} = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets;
const value5 = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: (require(477) /* metro dependency 477: PlatformUtils */).isAndroid()});
const width = value5.width;
const height2 = value5.height;
const value6 = positionY === 'below';
const value7 = height2 - y;
const r1 = value6 ? value7 - bottom - (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET : value7 - top - (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET;
const value13 = env0_3(env0_4.useState(height >= r1), 2);
const property = value13[0];
const env0_10 = property;
const env0_11 = value13[1];
object = {};
object[value6 ? 'top' : 'bottom'] = y;
object[positionX] = x;
object['maxHeight'] = r1;
const CONTEXT_MENU_EDGE_OFFSET = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_EDGE_OFFSET;
object['maxWidth'] = width - CONTEXT_MENU_EDGE_OFFSET - x;
const moduleValue3 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue3.useAnimatedStyle;
const closure = ContextMenuPopoutW;
const object3 = {maxHeight: r1, height: height};
const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH;
object3.CONTEXT_MENU_MIN_WIDTH = CONTEXT_MENU_MIN_WIDTH;
object3.positionY = positionY;
object3.positionX = positionX;
const CONTEXT_MENU_MIN_SCALE = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_SCALE;
object3.CONTEXT_MENU_MIN_SCALE = CONTEXT_MENU_MIN_SCALE;
object3.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object3.interpolate = reanimatedRexportModule.interpolate;
object3.visible = value4;
const CONTEXT_MENU_SPRING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_SPRING;
object3.CONTEXT_MENU_SPRING = CONTEXT_MENU_SPRING;
object3.transitionState = transitionState;
object3.TransitionStates = TransitionStates;
object3.runOnJS = reanimatedRexportModule.runOnJS;
object3.cleanUp = cleanUp;
object3.onClose = onClose;
closure.__closure = object3;
closure.__workletHash = 16778623591634;
closure.__initData = env0_10;
const value16 = Reflect.apply(useAnimatedStyle, moduleValue3, [closure]);
binding = env0_4;
const value17 = binding.useMemo(_fun97652, [state, requestClose, property]);
const value18 = binding.useCallback(_fun97656, [r1]);
const value19 = binding.useCallback(function() {
requestClose(true);
}, [requestClose]);
const value20 = binding.useCallback(function() {
requestClose(false);
}, [requestClose]);
const jsxRuntimeEnv0_7Binding = jsxRuntimeEnv0_7;
const contextMenuBackdrop = <ContextMenuBackdrop onPress={value19} visible={value4} />;
const GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
const ScrollView = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).ScrollView;
const items7 = [styles.container, object, value16];
object = [title != null ? <><View style={styles.titleContainer}>{((Text) => <Text variant="text-md/bold" color="mobile-text-heading-primary" accessibilityRole="header">{title}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)}</View><ContextMenuDivider /></> : null];
object[1] = renderMenuItems({items: items2, title: title, state: state, onPress: value20,
dividerIndexes: dividerIndexes});
return (
<>
{contextMenuBackdrop}
<GestureDetector gesture={value17}>
<ScrollView
onLayout={value18}
bounces={false}
style={items7}
keyboardShouldPersistTaps={r11}
accessibilityRole="list"
>
{object}
</ScrollView>
</GestureDetector>
</>
);
}
function _fun97644({label, action, iconSource, IconComponent, trailingIndicator, variant, accessibilityRole}, a1) { // fn#97644, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:2624, offset: 0x0218b696, size: 332 bytes, params: 3, frame: 29
var r0;
const value2 = items.length - 1;
const ContextMenuItem = (require(12798) /* metro dependency 12798: ContextMenuItemNative */).ContextMenuItem;
const r16 = a1 === 0 && title == null;
const dividerIndexesBinding = dividerIndexes;
let value = <ContextMenuItem index={a1} label={label} start={r16} end={a1 === value2} lastInSection={dividerIndexesBinding.includes(a1 + 1)} iconSource={iconSource} IconComponent={IconComponent} trailingIndicator={trailingIndicator} state={state} onPress={onPress_97645} variant={variant} accessibilityRole={accessibilityRole} key={'' + label + '-' + a1} />;
if (dividerIndexesBinding.includes(a1)) {
value = <><ContextMenuDivider key={'divider-' + a1} />{value}</>;
r0 = value;
} else {
r0 = value;
}
return r0;
}
function ContextMenuBackdropN() { // fn#97647, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:3562, owner: ContextMenuBackdrop.n, offset: 0x0218b99d, size: 78 bytes, params: 1, frame: 17
let value = environment.__proto__;
value = require(4577) /* metro dependency 4577: spring */;
const withSpring = value.withSpring;
const value3 = visible.get();
const CONTEXT_MENU_SPRING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_SPRING;
return {opacity: Reflect.apply(withSpring, value, [value3, CONTEXT_MENU_SPRING])};
}
function _fun97649() { // fn#97649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:4490, offset: 0x0218bf0f, size: 85 bytes, params: 1, frame: 13
const transitionStateBinding = transitionState;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const YEETED = TransitionStates.YEETED;
if (transitionStateBinding === YEETED) {
env0_8.set(0);
} else {
env0_8.set(1);
}
}
function ContextMenuPopoutW() { // fn#97650, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:4969, owner: ContextMenuPopout.w, offset: 0x0218bf64, size: 755 bytes, params: 1, frame: 32
const Math = global.Math;
const min = Math.min;
const value3 = Reflect.apply(min, Math, [env0_9, height]) / 2;
const CONTEXT_MENU_MIN_WIDTH = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_WIDTH;
const value5 = CONTEXT_MENU_MIN_WIDTH / 2;
const positionYBinding = positionY;
const value6 = 1;
const r19 = positionYBinding !== 'below' ? value6 : -1;
const r6 = positionX !== 'left' ? value6 : -1;
const object3 = {};
const springModule = require(4577) /* metro dependency 4577: spring */;
let withSpring = springModule.withSpring;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let interpolate = reanimatedRexportModule.interpolate;
const value10 = Reflect.apply(interpolate, reanimatedRexportModule, [env0_8.get(), [0, 1], [0, 1]]);
const CONTEXT_MENU_SPRING = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_SPRING;
const closure = wT;
const object4 = {};
object4.transitionState = transitionState;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
object4.TransitionStates = TransitionStates;
object4.runOnJS = reanimatedRexportModule.runOnJS;
object4.cleanUp = cleanUp;
object4.onClose = onClose;
closure.__closure = object4;
closure.__workletHash = 4025068986009;
closure.__initData = env1_11;
object3.opacity = Reflect.apply(withSpring, springModule, [value10, CONTEXT_MENU_SPRING, 'respect-motion-settings',
closure]);
const moduleValue3 = springModule;
withSpring = moduleValue3.withSpring;
const moduleValue4 = reanimatedRexportModule;
interpolate = moduleValue4.interpolate;
const value11 = env0_8.get();
const CONTEXT_MENU_MIN_SCALE = (require(8813) /* metro dependency 8813: ContextMenuConstantsNative */).CONTEXT_MENU_MIN_SCALE;
const items3 = [{translateX: Reflect.apply(withSpring, moduleValue3, [Reflect.apply(interpolate, moduleValue4,
[value11, [0, 1], [r6 * value5 + CONTEXT_MENU_MIN_SCALE * -r6 * value5, 0]]), CONTEXT_MENU_SPRING])}];
const moduleValue5 = springModule;
withSpring = moduleValue5.withSpring;
const moduleValue6 = reanimatedRexportModule;
items3[1] = {translateY: Reflect.apply(withSpring, moduleValue5, [moduleValue6.interpolate(env0_8.get(), [0, 1],
[r19 * value3 + CONTEXT_MENU_MIN_SCALE * -r19 * value3, 0]), CONTEXT_MENU_SPRING])};
const moduleValue7 = springModule;
withSpring = moduleValue7.withSpring;
const moduleValue8 = reanimatedRexportModule;
interpolate = moduleValue8.interpolate;
let value = env0_8.get();
value = Reflect.apply(interpolate, moduleValue8, [value, [0, 1], [CONTEXT_MENU_MIN_SCALE, value6]]);
items3[2] = {scale: Reflect.apply(withSpring, moduleValue7, [value, CONTEXT_MENU_SPRING])};
object3.transform = items3;
return object3;
}
function _fun97652() { // fn#97652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:6349, offset: 0x0218c2dd, size: 188 bytes, params: 1, frame: 18
let value = _fun97653();
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
value = Gesture.Pan().enabled(!env0_10).onStart(value).onUpdate(value);
const onEnd = value.onEnd;
const closure = t_97655;
const object2 = {};
object2.state = state;
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.requestClose = requestClose;
closure.__closure = object2;
closure.__workletHash = 14495067009140;
closure.__initData = env1_13;
return Reflect.apply(onEnd, value, [closure]);
}
function _fun97656({nativeEvent}) { // fn#97656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:6887, offset: 0x0218c481, size: 78 bytes, params: 2, frame: 14
const binding = env0_11;
let Math = global.Math;
const value2 = Math.round(nativeEvent.layout.height);
Math = global.Math;
binding(value2 >= Math.round(env0_9));
}
function onPress_97645(a0) { // fn#97645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:2917, offset: 0x0218b7e2, size: 109 bytes, params: 2, frame: 13
var r1;
let value = environment.__proto__.__proto__;
const isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
if (isAndroid2) {
value = require(4559) /* metro dependency 4559: useIsScreenReaderEnabledNative */;
value = value.getIsScreenReaderEnabled();
r1 = value;
} else {
r1 = isAndroid2;
}
if (r1) {
action();
}
value = environment.__proto__;
if (onPress != null) {
onPress(a0);
}
}
function wT(a0) { // fn#97651, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:5209, owner: ContextMenuPopout.w.t, offset: 0x0218c257, size: 134 bytes, params: 2, frame: 16
var r0;
var transitionStateBinding;
var runOnJS;
var value2;
let value = a0;
if (value) {
value = environment.__proto__;
transitionStateBinding = transitionState;
value = environment.__proto__.__proto__;
value = transitionStateBinding === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED;
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
value2 = environment.__proto__;
Reflect.apply(runOnJS, value, [cleanUp])();
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
Reflect.apply(runOnJS, value, [onClose])();
}
}
function _fun97653() { // fn#97653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:6362, offset: 0x0218c399, size: 92 bytes, params: 1, frame: 14
const closure = update_97654;
const object2 = {};
object2.updateContextMenuState = (require(8812) /* metro dependency 8812: ContextMenuStateNative */).updateContextMenuState;
object2.state = state;
closure.__closure = object2;
closure.__workletHash = 4218299258082;
closure.__initData = env2_12;
return closure;
}
function t_97655() { // fn#97655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:6685, offset: 0x0218c433, size: 78 bytes, params: 1, frame: 13
const value = environment.__proto__;
const value2 = state.activeIndex.get();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
reanimatedRexportModule.runOnJS(requestClose)(value2 === -1);
}
function update_97654({absoluteX, absoluteY}) { // fn#97654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12990:6384, offset: 0x0218c3f5, size: 62 bytes, params: 2, frame: 16
let value = environment.__proto__.__proto__.__proto__;
value = require(8812) /* metro dependency 8812: ContextMenuStateNative */;
value.updateContextMenuState(absoluteX, absoluteY, state);
}
@@ -0,0 +1,151 @@
/* Metro module 8812; source: design/components/ContextMenu/native/ContextMenuState.native.tsx; dependencies: [31, 629, 690, 4017, 4081, 2] */
function _fun68896(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:6, offset: 0x01c611b8, size: 277 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
let value = require(629) /* metro dependency 629 */;
value = value.create(function() {
return {menu: null};
});
object = {code: 'function updateContextMenuState_ContextMenuStateNativeTsx1(absoluteX,absoluteY,state){const{INDEX_BOUNDS_WIDTH_OFFSET,INDEX_BOUNDS_HEIGHT_OFFSET,INDEX_BOUNDS_PAGE_Y_OFFSET,INDEX_BOUNDS_PAGE_X_OFFSET,INDEX_BOUNDS_OFFSET,runOnJS,triggerHapticFeedback,HapticFeedbackTypes}=this.__closure;const{pan:pan,itemMeasurements:itemMeasurements,activeIndex:activeIndex}=state;pan.set(absoluteY);const bounds=itemMeasurements.get();let offset=0;while(offset<bounds.length){const width=bounds[offset+INDEX_BOUNDS_WIDTH_OFFSET];const height=bounds[offset+INDEX_BOUNDS_HEIGHT_OFFSET];const pageY=bounds[offset+INDEX_BOUNDS_PAGE_Y_OFFSET];const pageX=bounds[offset+INDEX_BOUNDS_PAGE_X_OFFSET];const lowerY=pageY;const upperY=pageY+height;const lowerX=pageX;const upperX=pageX+width;if(absoluteY>=lowerY&&absoluteY<=upperY&&absoluteX>=lowerX&&absoluteX<=upperX){const index=offset/INDEX_BOUNDS_OFFSET;if(activeIndex.get()!==index){activeIndex.set(index);runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_LIGHT);}return;}offset+=INDEX_BOUNDS_OFFSET;}activeIndex.set(-1);}'};
const value2 = _fun68898();
(require(2) /* metro dependency 2 */).fileFinishedImporting('design/components/ContextMenu/native/ContextMenuState.native.tsx');
exports.INDEX_BOUNDS_OFFSET = 4;
exports.INDEX_BOUNDS_PAGE_X_OFFSET = 0;
exports.INDEX_BOUNDS_PAGE_Y_OFFSET = 1;
exports.INDEX_BOUNDS_WIDTH_OFFSET = 2;
exports.INDEX_BOUNDS_HEIGHT_OFFSET = 3;
exports.ContextMenuStore = value;
exports.showContextMenu = showContextMenu;
exports.hideContextMenu = hideContextMenu;
exports.useActiveContextMenu = useActiveContextMenu;
exports.updateContextMenuState = value2;
exports.useContextMenuState = useContextMenuState;
exports.resetContextMenuState = function({activeIndex, pan, itemMeasurements}) {
activeIndex.set(-1);
pan.set(-1);
if (itemMeasurements.get().length > 0) {
itemMeasurements.set([]);
}
};
}
function _fun68898() { // fn#68898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:1226, offset: 0x01c612d8, size: 134 bytes, params: 1, frame: 16
const closure = updateContextMenuState;
const object2 = {'INDEX_BOUNDS_WIDTH_OFFSET': 2, 'INDEX_BOUNDS_HEIGHT_OFFSET': 3, 'INDEX_BOUNDS_PAGE_Y_OFFSET': 1,
'INDEX_BOUNDS_PAGE_X_OFFSET': 0, 'INDEX_BOUNDS_OFFSET': 4};
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.triggerHapticFeedback = (require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback;
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
object2.HapticFeedbackTypes = HapticFeedbackTypes;
closure.__closure = object2;
closure.__workletHash = 10158111154044;
closure.__initData = env0_4;
return closure;
}
function showContextMenu(a0) { // fn#68900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2296, offset: 0x01c6146f, size: 54 bytes, params: 2, frame: 12
const env0_0 = a0;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun68901);
}
function hideContextMenu() { // fn#68902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2392, offset: 0x01c614c7, size: 47 bytes, params: 1, frame: 12
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun68903);
}
function useActiveContextMenu() { // fn#68905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2517, offset: 0x01c61530, size: 25 bytes, params: 1, frame: 11
return env0_3(function(a0) {
return a0.menu;
});
}
function useContextMenuState() { // fn#68907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2621, offset: 0x01c61554, size: 140 bytes, params: 1, frame: 20
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
const value3 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue([]);
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(-1);
return value4.useMemo(_fun68908, [value2, value3, value4]);
}
function updateContextMenuState(a0, a1, {pan, itemMeasurements, activeIndex}) { // fn#68899, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:1264, offset: 0x01c6135e, size: 273 bytes, params: 4, frame: 24
var r3;
var property;
var property2;
var property3;
var property4;
var value3;
var runOnJS;
var triggerHapticFeedback;
var HapticFeedbackTypes;
var IMPACT_LIGHT;
pan.set(a1);
let value = itemMeasurements.get();
let length = value.length;
if (0 < length) {
r3 = 0;
reducibleLoop1: while (true) {
property = value[r3 + 2];
property2 = value[r3 + 3];
property3 = value[r3 + 1];
property4 = value[r3 + 0];
if (a1 >= property3) {
reducibleJoin5: while (true) {
if (a1 <= property3 + property2) {
if (a0 >= property4) {
if (a0 <= property4 + property) {
break reducibleLoop1;
}
break reducibleJoin5;
}
break reducibleJoin5;
}
break reducibleJoin5;
}
}
value3 = r3 + 4;
length = value.length;
if (!(value3 < length)) {
activeIndex.set(-1);
return undefined;
}
r3 = value3;
continue reducibleLoop1;
}
value = r3 / 4;
reducibleJoin9: while (true) {
if (activeIndex.get() !== value) {
activeIndex.set(value);
value = environment.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
triggerHapticFeedback = (require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback;
value = Reflect.apply(runOnJS, value, [triggerHapticFeedback]);
HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
IMPACT_LIGHT = HapticFeedbackTypes.IMPACT_LIGHT;
value(IMPACT_LIGHT);
break reducibleJoin9;
}
break reducibleJoin9;
}
} else {
activeIndex.set(-1);
}
}
function _fun68901() { // fn#68901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2346, offset: 0x01c614a5, size: 34 bytes, params: 1, frame: 12
return env1_3.setState({menu: env0_0});
}
function _fun68903() { // fn#68903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2441, offset: 0x01c614f6, size: 31 bytes, params: 1, frame: 11
var environment;
let value = environment.__proto__;
env1_3.setState(function(a0) {
var value = a0;
return value.menu == null ? value : {menu: null};
});
}
function _fun68908() { // fn#68908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8997:2761, offset: 0x01c615e0, size: 34 bytes, params: 1, frame: 3
return {pan: env0_0, itemMeasurements: env0_1, activeIndex: env0_2};
}