748 lines
51 KiB
JavaScript
748 lines
51 KiB
JavaScript
/* Metro module 6306; source: unknown; dependencies: [27, 6278, 6285, 1610, 6307, 6308] */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as moduleValue22 from './module-01610.js'; /* Metro dependency 1610 */
|
|
import * as Module06278Module from './module-06278.js'; /* Metro dependency 6278 */
|
|
import * as UseBottomSheetInternalModule from './module-06285-useBottomSheetInternal.js'; /* Metro dependency 6285 */
|
|
|
|
function _fun49706(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#49706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:6, offset: 0x012054ef, size: 262 bytes, params: 8, frame: 18
|
|
let env0_0 = require;
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Keyboard = ReactNativeModule.Keyboard;
|
|
object = {'initialPosition': 0, 'initialKeyboardState': null, 'isScrollablePositionLocked': false};
|
|
const KEYBOARD_STATE = (Module06278Module).KEYBOARD_STATE;
|
|
const UNDETERMINED = KEYBOARD_STATE.UNDETERMINED;
|
|
object.initialKeyboardState = UNDETERMINED;
|
|
const env0_4 = Keyboard.dismiss;
|
|
const closure = function(a0) {
|
|
var env0_0 = a0;
|
|
var Object = global.Object;
|
|
Object.keys(a0).map(_fun49708);
|
|
};
|
|
closure.__closure = {};
|
|
closure.__workletHash = 16627033127293;
|
|
closure.__initData = {code: 'function pnpm_useGestureEventsHandlersDefaultTsx1(context){Object.keys(context).map(function(key){context[key]=undefined;});}'};
|
|
object = {code: 'function handleOnStart_Pnpm_useGestureEventsHandlersDefaultTsx2(__,_){const{stopAnimation,animatedKeyboardState,enableBlurKeyboardOnGesture,KEYBOARD_STATE,runOnJS,dismissKeyboard,context,animatedPosition,animatedScrollableContentOffsetY}=this.__closure;stopAnimation();let initialKeyboardState=animatedKeyboardState.value;if(enableBlurKeyboardOnGesture&&initialKeyboardState===KEYBOARD_STATE.SHOWN){initialKeyboardState=KEYBOARD_STATE.HIDDEN;runOnJS(dismissKeyboard)();}context.value={...context.value,initialPosition:animatedPosition.value,initialKeyboardState:animatedKeyboardState.value};if(animatedScrollableContentOffsetY.value>0){context.value={...context.value,isScrollablePositionLocked:true};}}'};
|
|
object = {code: 'function handleOnChange_Pnpm_useGestureEventsHandlersDefaultTsx3(source,{translationY:translationY}){const{animatedHighestSnapPoint,isInTemporaryPosition,context,KEYBOARD_STATE,enablePanDownToClose,animatedContainerHeight,animatedSnapPoints,GESTURE_SOURCE,isScrollableRefreshable,animatedPosition,animatedScrollableContentOffsetY,clamp,enableOverDrag,animatedScrollableType,SCROLLABLE_TYPE,overDragResistanceFactor}=this.__closure;let highestSnapPoint=animatedHighestSnapPoint.value;if(isInTemporaryPosition.value&&context.value.initialKeyboardState===KEYBOARD_STATE.SHOWN){highestSnapPoint=context.value.initialPosition;}if(isInTemporaryPosition.value&&context.value.initialPosition<highestSnapPoint){highestSnapPoint=context.value.initialPosition;}const lowestSnapPoint=enablePanDownToClose?animatedContainerHeight.value:animatedSnapPoints.value[0];if(source===GESTURE_SOURCE.CONTENT&&isScrollableRefreshable.value&&animatedPosition.value===highestSnapPoint){return;}const negativeScrollableContentOffset=context.value.initialPosition===highestSnapPoint&&source===GESTURE_SOURCE.CONTENT||!context.value.isScrollablePositionLocked?animatedScrollableContentOffsetY.value*-1:0;const draggedPosition=context.value.initialPosition+translationY;const accumulatedDraggedPosition=draggedPosition+negativeScrollableContentOffset;const clampedPosition=clamp(accumulatedDraggedPosition,highestSnapPoint,lowestSnapPoint);if(context.value.isScrollablePositionLocked&&source===GESTURE_SOURCE.CONTENT&&animatedPosition.value===highestSnapPoint){context.value={...context.value,isScrollablePositionLocked:false};}if(enableOverDrag){if((source===GESTURE_SOURCE.HANDLE||animatedScrollableType.value===SCROLLABLE_TYPE.VIEW)&&draggedPosition<highestSnapPoint){const resistedPosition=highestSnapPoint-Math.sqrt(1+(highestSnapPoint-draggedPosition))*overDragResistanceFactor;animatedPosition.value=resistedPosition;return;}if(source===GESTURE_SOURCE.HANDLE&&draggedPosition>lowestSnapPoint){const resistedPosition=lowestSnapPoint+Math.sqrt(1+(draggedPosition-lowestSnapPoint))*overDragResistanceFactor;animatedPosition.value=resistedPosition;return;}if(source===GESTURE_SOURCE.CONTENT&&draggedPosition+negativeScrollableContentOffset>lowestSnapPoint){const resistedPosition=lowestSnapPoint+Math.sqrt(1+(draggedPosition+negativeScrollableContentOffset-lowestSnapPoint))*overDragResistanceFactor;animatedPosition.value=resistedPosition;return;}}animatedPosition.value=clampedPosition;}'};
|
|
object = {code: "function handleOnEnd_Pnpm_useGestureEventsHandlersDefaultTsx4(source,{translationY:translationY,absoluteY:absoluteY,velocityY:velocityY}){const{animatedHighestSnapPoint,animatedPosition,GESTURE_SOURCE,isScrollableRefreshable,isInTemporaryPosition,context,animateToPosition,ANIMATION_SOURCE,animatedScrollableType,SCROLLABLE_TYPE,KEYBOARD_STATE,Platform,WINDOW_HEIGHT,animatedKeyboardHeight,runOnJS,dismissKeyboard,animatedSnapPoints,enablePanDownToClose,animatedClosedPosition,snapPoint,animatedScrollableContentOffsetY}=this.__closure;const highestSnapPoint=animatedHighestSnapPoint.value;const isSheetAtHighestSnapPoint=animatedPosition.value===highestSnapPoint;if(source===GESTURE_SOURCE.CONTENT&&isScrollableRefreshable.value&&isSheetAtHighestSnapPoint){return;}if(isInTemporaryPosition.value&&context.value.initialPosition>=animatedPosition.value){if(context.value.initialPosition>animatedPosition.value){animateToPosition(context.value.initialPosition,ANIMATION_SOURCE.GESTURE,velocityY/2);}return;}const isScrollable=animatedScrollableType.value!==SCROLLABLE_TYPE.UNDETERMINED&&animatedScrollableType.value!==SCROLLABLE_TYPE.VIEW;if(context.value.initialKeyboardState===KEYBOARD_STATE.SHOWN&&animatedPosition.value>context.value.initialPosition){if(!(Platform.OS==='ios'&&isScrollable&&absoluteY>WINDOW_HEIGHT-animatedKeyboardHeight.value)){runOnJS(dismissKeyboard)();}}if(isInTemporaryPosition.value){isInTemporaryPosition.value=false;}const snapPoints=animatedSnapPoints.value.slice();if(enablePanDownToClose){snapPoints.unshift(animatedClosedPosition.value);}const destinationPoint=snapPoint(translationY+context.value.initialPosition,velocityY,snapPoints);if(destinationPoint===animatedPosition.value){return;}const wasGestureHandledByScrollView=source===GESTURE_SOURCE.CONTENT&&animatedScrollableContentOffsetY.value>0;if(wasGestureHandledByScrollView&&isSheetAtHighestSnapPoint){return;}animateToPosition(destinationPoint,ANIMATION_SOURCE.GESTURE,velocityY/2);}"};
|
|
object = {code: 'function handleOnFinalize_Pnpm_useGestureEventsHandlersDefaultTsx5(){const{resetContext,context}=this.__closure;resetContext(context);}'};
|
|
exports.useGestureEventsHandlersDefault = useGestureEventsHandlersDefault;
|
|
function pnpm_useGestureEventsHandlersDefaultTsx1(a0) { // fn#49707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:398, offset: 0x012055f5, size: 46 bytes, params: 2, frame: 12
|
|
const env0_0 = a0;
|
|
const Object = global.Object;
|
|
Object.keys(a0).map(_fun49708);
|
|
function _fun49708(a0) { // fn#49708, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:471, offset: 0x01205623, size: 18 bytes, params: 2, frame: 3
|
|
env0_0[a0] = undefined;
|
|
}
|
|
|
|
}
|
|
|
|
function useGestureEventsHandlersDefault() { // fn#49709, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:5918, offset: 0x01205635, size: 531 bytes, params: 1, frame: 37
|
|
const value2 = (UseBottomSheetInternalModule).useBottomSheetInternal();
|
|
const animatedPosition = value2.animatedPosition;
|
|
const animatedSnapPoints = value2.animatedSnapPoints;
|
|
const animatedKeyboardState = value2.animatedKeyboardState;
|
|
const animatedKeyboardHeight = value2.animatedKeyboardHeight;
|
|
const animatedKeyboardHeight2 = animatedKeyboardHeight;
|
|
const animatedContainerHeight = value2.animatedContainerHeight;
|
|
const animatedScrollableType = value2.animatedScrollableType;
|
|
const animatedHighestSnapPoint = value2.animatedHighestSnapPoint;
|
|
const animatedClosedPosition = value2.animatedClosedPosition;
|
|
const animatedScrollableContentOffsetY = value2.animatedScrollableContentOffsetY;
|
|
const enableOverDrag = value2.enableOverDrag;
|
|
const enablePanDownToClose = value2.enablePanDownToClose;
|
|
const overDragResistanceFactor = value2.overDragResistanceFactor;
|
|
const isInTemporaryPosition = value2.isInTemporaryPosition;
|
|
const isScrollableRefreshable = value2.isScrollableRefreshable;
|
|
const enableBlurKeyboardOnGesture = value2.enableBlurKeyboardOnGesture;
|
|
const animateToPosition = value2.animateToPosition;
|
|
const stopAnimation = value2.stopAnimation;
|
|
const useSharedValue = moduleValue22.useSharedValue;
|
|
const Object = global.Object;
|
|
const value = Reflect.apply(useSharedValue, moduleValue22, [Object.assign({}, animatedKeyboardHeight2)]);
|
|
const object = {};
|
|
object.handleOnStart = moduleValue22.useWorkletCallback(_fun49710(), [stopAnimation, enableBlurKeyboardOnGesture,
|
|
animatedPosition, animatedKeyboardState, animatedScrollableContentOffsetY]);
|
|
object.handleOnChange = moduleValue22.useWorkletCallback(_fun49712(), [enableOverDrag, enablePanDownToClose,
|
|
overDragResistanceFactor, isInTemporaryPosition, isScrollableRefreshable, animatedHighestSnapPoint,
|
|
animatedContainerHeight, animatedSnapPoints, animatedPosition, animatedScrollableType,
|
|
animatedScrollableContentOffsetY]);
|
|
object.handleOnEnd = moduleValue22.useWorkletCallback(_fun49714(), [enablePanDownToClose, isInTemporaryPosition,
|
|
isScrollableRefreshable, animatedClosedPosition, animatedHighestSnapPoint, animatedKeyboardHeight,
|
|
animatedPosition, animatedScrollableType, animatedSnapPoints, animatedScrollableContentOffsetY,
|
|
animateToPosition]);
|
|
object.handleOnFinalize = moduleValue22.useWorkletCallback(_fun49716(), [value]);
|
|
return object;
|
|
function _fun49710() { // fn#49710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:6538, offset: 0x01205848, size: 165 bytes, params: 1, frame: 16
|
|
const handleOnStart2 = handleOnStart;
|
|
const object = {};
|
|
object.stopAnimation = stopAnimation;
|
|
object.animatedKeyboardState = animatedKeyboardState;
|
|
object.enableBlurKeyboardOnGesture = enableBlurKeyboardOnGesture;
|
|
const KEYBOARD_STATE = (Module06278Module).KEYBOARD_STATE;
|
|
object.KEYBOARD_STATE = KEYBOARD_STATE;
|
|
object.runOnJS = (require(1610) /* metro dependency 1610 */).runOnJS;
|
|
object.dismissKeyboard = dismiss;
|
|
object.context = env0_17;
|
|
object.animatedPosition = animatedPosition;
|
|
object.animatedScrollableContentOffsetY = animatedScrollableContentOffsetY;
|
|
handleOnStart2.__closure = object;
|
|
handleOnStart2.__workletHash = 9400766587341;
|
|
handleOnStart2.__initData = env1_6;
|
|
return handleOnStart2;
|
|
function handleOnStart(a0, a1) { // fn#49711, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:6555, offset: 0x012058ed, size: 264 bytes, params: 3, frame: 19
|
|
const KEYBOARD_STATE = (Module06278Module).KEYBOARD_STATE;
|
|
var value5;
|
|
var moduleValue;
|
|
const value = environment.__proto__;
|
|
stopAnimation();
|
|
if (enableBlurKeyboardOnGesture && animatedKeyboardState.value === KEYBOARD_STATE.SHOWN) {
|
|
value5 = environment.__proto__.__proto__;
|
|
KEYBOARD_STATE.HIDDEN;
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
let binding = env1_17;
|
|
let Object = global.Object;
|
|
binding.value = Object.assign({}, binding.value, {initialPosition: animatedPosition.value,
|
|
initialKeyboardState: animatedKeyboardState.value});
|
|
if (animatedScrollableContentOffsetY.value > 0) {
|
|
binding = env1_17;
|
|
Object = global.Object;
|
|
binding.value = Object.assign({}, binding.value, {isScrollablePositionLocked: true});
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun49712() { // fn#49712, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:7202, offset: 0x012059f5, size: 252 bytes, params: 1, frame: 17
|
|
const handleOnChange_497132 = handleOnChange_49713;
|
|
const object = {};
|
|
object.animatedHighestSnapPoint = animatedHighestSnapPoint;
|
|
object.isInTemporaryPosition = isInTemporaryPosition;
|
|
object.context = env0_17;
|
|
const KEYBOARD_STATE = (Module06278Module).KEYBOARD_STATE;
|
|
object.KEYBOARD_STATE = KEYBOARD_STATE;
|
|
object.enablePanDownToClose = enablePanDownToClose;
|
|
object.animatedContainerHeight = animatedContainerHeight;
|
|
object.animatedSnapPoints = animatedSnapPoints;
|
|
const GESTURE_SOURCE = (Module06278Module).GESTURE_SOURCE;
|
|
object.GESTURE_SOURCE = GESTURE_SOURCE;
|
|
object.isScrollableRefreshable = isScrollableRefreshable;
|
|
object.animatedPosition = animatedPosition;
|
|
object.animatedScrollableContentOffsetY = animatedScrollableContentOffsetY;
|
|
object.clamp = (require(6307) /* metro dependency 6307 */).clamp;
|
|
object.enableOverDrag = enableOverDrag;
|
|
object.animatedScrollableType = animatedScrollableType;
|
|
const SCROLLABLE_TYPE = (Module06278Module).SCROLLABLE_TYPE;
|
|
object.SCROLLABLE_TYPE = SCROLLABLE_TYPE;
|
|
object.overDragResistanceFactor = overDragResistanceFactor;
|
|
handleOnChange_497132.__closure = object;
|
|
handleOnChange_497132.__workletHash = 6221237616078;
|
|
handleOnChange_497132.__initData = env1_7;
|
|
return handleOnChange_497132;
|
|
function handleOnChange_49713(a0, {translationY}) { // fn#49713, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:7219, offset: 0x01205af1, size: 865 bytes, params: 3, frame: 26
|
|
var r2;
|
|
var r3;
|
|
var r10;
|
|
var initialPosition;
|
|
var binding;
|
|
var value23;
|
|
var value25;
|
|
var Object;
|
|
var HANDLE;
|
|
const SCROLLABLE_TYPE = (require(6278) /* metro dependency 6278 */).SCROLLABLE_TYPE;
|
|
r2 = isInTemporaryPosition.value && env1_17.value.initialPosition < (isInTemporaryPosition.value && env1_17.value.initialKeyboardState === (require(6278) /* metro dependency 6278 */).KEYBOARD_STATE.SHOWN ? env1_17.value.initialPosition : animatedHighestSnapPoint.value) ? env1_17.value.initialPosition : r2;
|
|
const r4 = enablePanDownToClose ? animatedContainerHeight.value : animatedSnapPoints.value[0];
|
|
const GESTURE_SOURCE = (require(6278) /* metro dependency 6278 */).GESTURE_SOURCE;
|
|
const CONTENT = GESTURE_SOURCE.CONTENT;
|
|
if (a0 !== CONTENT) {
|
|
initialPosition = env1_17.value.initialPosition;
|
|
r3 = initialPosition !== r2 ? env1_17.value.isScrollablePositionLocked ? 0 : -1 * animatedScrollableContentOffsetY.value : a0 === GESTURE_SOURCE.CONTENT ? -1 * animatedScrollableContentOffsetY.value : env1_17.value.isScrollablePositionLocked ? 0 : -1 * animatedScrollableContentOffsetY.value;
|
|
binding = env1_17;
|
|
initialPosition = binding.value.initialPosition;
|
|
value23 = initialPosition + translationY;
|
|
value25 = (require(6307) /* metro dependency 6307 */).clamp(value23 + r3, r2, r4);
|
|
r10 = binding.value.isScrollablePositionLocked && a0 === GESTURE_SOURCE.CONTENT;
|
|
r10 = r10 && animatedPosition.value === r2;
|
|
if (r10) {
|
|
binding = env1_17;
|
|
Object = global.Object;
|
|
binding.value = Object.assign({}, binding.value, {isScrollablePositionLocked: false});
|
|
}
|
|
if (enableOverDrag) {
|
|
HANDLE = GESTURE_SOURCE.HANDLE;
|
|
if (a0 === HANDLE) {
|
|
if (value23 < r2) {
|
|
animatedPosition.value = r2 - global.Math.sqrt(r2 - value23 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.VIEW) {
|
|
if (a0 !== GESTURE_SOURCE.HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 < r2) {
|
|
animatedPosition.value = r2 - global.Math.sqrt(r2 - value23 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
HANDLE = GESTURE_SOURCE.HANDLE;
|
|
if (a0 !== HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
} else {
|
|
if (isScrollableRefreshable.value) {
|
|
if (animatedPosition.value === r2) {
|
|
return undefined;
|
|
}
|
|
initialPosition = env1_17.value.initialPosition;
|
|
r3 = initialPosition !== r2 ? env1_17.value.isScrollablePositionLocked ? 0 : -1 * animatedScrollableContentOffsetY.value : a0 === GESTURE_SOURCE.CONTENT ? -1 * animatedScrollableContentOffsetY.value : env1_17.value.isScrollablePositionLocked ? 0 : -1 * animatedScrollableContentOffsetY.value;
|
|
binding = env1_17;
|
|
initialPosition = binding.value.initialPosition;
|
|
value23 = initialPosition + translationY;
|
|
value25 = (require(6307) /* metro dependency 6307 */).clamp(value23 + r3, r2, r4);
|
|
r10 = binding.value.isScrollablePositionLocked && a0 === GESTURE_SOURCE.CONTENT;
|
|
r10 = r10 && animatedPosition.value === r2;
|
|
if (r10) {
|
|
binding = env1_17;
|
|
Object = global.Object;
|
|
binding.value = Object.assign({}, binding.value, {isScrollablePositionLocked: false});
|
|
}
|
|
if (enableOverDrag) {
|
|
HANDLE = GESTURE_SOURCE.HANDLE;
|
|
if (a0 === HANDLE) {
|
|
if (value23 < r2) {
|
|
animatedPosition.value = r2 - global.Math.sqrt(r2 - value23 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.VIEW) {
|
|
if (a0 !== GESTURE_SOURCE.HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 < r2) {
|
|
animatedPosition.value = r2 - global.Math.sqrt(r2 - value23 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
HANDLE = GESTURE_SOURCE.HANDLE;
|
|
if (a0 !== HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
initialPosition = env1_17.value.initialPosition;
|
|
r3 = initialPosition !== r2 ? env1_17.value.isScrollablePositionLocked ? 0 : -1 * animatedScrollableContentOffsetY.value : a0 === GESTURE_SOURCE.CONTENT ? -1 * animatedScrollableContentOffsetY.value : env1_17.value.isScrollablePositionLocked ? 0 : -1 * animatedScrollableContentOffsetY.value;
|
|
binding = env1_17;
|
|
initialPosition = binding.value.initialPosition;
|
|
value23 = initialPosition + translationY;
|
|
value25 = (require(6307) /* metro dependency 6307 */).clamp(value23 + r3, r2, r4);
|
|
r10 = binding.value.isScrollablePositionLocked && a0 === GESTURE_SOURCE.CONTENT;
|
|
r10 = r10 && animatedPosition.value === r2;
|
|
if (r10) {
|
|
binding = env1_17;
|
|
Object = global.Object;
|
|
binding.value = Object.assign({}, binding.value, {isScrollablePositionLocked: false});
|
|
}
|
|
if (enableOverDrag) {
|
|
HANDLE = GESTURE_SOURCE.HANDLE;
|
|
if (a0 === HANDLE) {
|
|
if (value23 < r2) {
|
|
animatedPosition.value = r2 - global.Math.sqrt(r2 - value23 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.VIEW) {
|
|
if (a0 !== GESTURE_SOURCE.HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 < r2) {
|
|
animatedPosition.value = r2 - global.Math.sqrt(r2 - value23 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
HANDLE = GESTURE_SOURCE.HANDLE;
|
|
if (a0 !== HANDLE) {
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
if (a0 !== GESTURE_SOURCE.CONTENT) {
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
if (value23 + r3 > r4) {
|
|
animatedPosition.value = r4 + global.Math.sqrt(value23 + r3 - r4 + 1) * overDragResistanceFactor;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
return undefined;
|
|
}
|
|
animatedPosition.value = value25;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun49714() { // fn#49714, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:8756, offset: 0x01205e52, size: 331 bytes, params: 1, frame: 17
|
|
const handleOnEnd2 = handleOnEnd;
|
|
const object = {};
|
|
object.animatedHighestSnapPoint = animatedHighestSnapPoint;
|
|
object.animatedPosition = animatedPosition;
|
|
const GESTURE_SOURCE = (Module06278Module).GESTURE_SOURCE;
|
|
object.GESTURE_SOURCE = GESTURE_SOURCE;
|
|
object.isScrollableRefreshable = isScrollableRefreshable;
|
|
object.isInTemporaryPosition = isInTemporaryPosition;
|
|
object.context = env0_17;
|
|
object.animateToPosition = animateToPosition;
|
|
const ANIMATION_SOURCE = (Module06278Module).ANIMATION_SOURCE;
|
|
object.ANIMATION_SOURCE = ANIMATION_SOURCE;
|
|
object.animatedScrollableType = animatedScrollableType;
|
|
const SCROLLABLE_TYPE = (Module06278Module).SCROLLABLE_TYPE;
|
|
object.SCROLLABLE_TYPE = SCROLLABLE_TYPE;
|
|
const KEYBOARD_STATE = (Module06278Module).KEYBOARD_STATE;
|
|
object.KEYBOARD_STATE = KEYBOARD_STATE;
|
|
object.Platform = Platform;
|
|
const WINDOW_HEIGHT = (Module06278Module).WINDOW_HEIGHT;
|
|
object.WINDOW_HEIGHT = WINDOW_HEIGHT;
|
|
object.animatedKeyboardHeight = animatedKeyboardHeight;
|
|
object.runOnJS = (require(1610) /* metro dependency 1610 */).runOnJS;
|
|
object.dismissKeyboard = dismiss;
|
|
object.animatedSnapPoints = animatedSnapPoints;
|
|
object.enablePanDownToClose = enablePanDownToClose;
|
|
object.animatedClosedPosition = animatedClosedPosition;
|
|
object.snapPoint = (require(6308) /* metro dependency 6308 */).snapPoint;
|
|
object.animatedScrollableContentOffsetY = animatedScrollableContentOffsetY;
|
|
handleOnEnd2.__closure = object;
|
|
handleOnEnd2.__workletHash = 8667894097210;
|
|
handleOnEnd2.__initData = env1_8;
|
|
return handleOnEnd2;
|
|
function handleOnEnd(a0, a1) { // fn#49715, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:8773, offset: 0x01205f9d, size: 692 bytes, params: 3, frame: 22
|
|
var r3;
|
|
const SCROLLABLE_TYPE = (Module06278Module).SCROLLABLE_TYPE;
|
|
const KEYBOARD_STATE = (Module06278Module).KEYBOARD_STATE;
|
|
var moduleValue;
|
|
var value18;
|
|
var moduleValue2;
|
|
var value21;
|
|
const ANIMATION_SOURCE = (Module06278Module).ANIMATION_SOURCE;
|
|
const translationY = a1.translationY;
|
|
a1.absoluteY;
|
|
const velocityY = a1.velocityY;
|
|
const value = environment.__proto__;
|
|
const value4 = animatedPosition.value === animatedHighestSnapPoint.value;
|
|
const GESTURE_SOURCE = (Module06278Module).GESTURE_SOURCE;
|
|
const CONTENT = GESTURE_SOURCE.CONTENT;
|
|
if (a0 !== CONTENT) {
|
|
if (isInTemporaryPosition.value) {
|
|
if (env1_17.value.initialPosition >= animatedPosition.value) {
|
|
if (env1_17.value.initialPosition > animatedPosition.value) {
|
|
animateToPosition(env1_17.value.initialPosition, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
} else {
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.UNDETERMINED) {
|
|
animatedScrollableType.value;
|
|
SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
r3 = env1_17.value.initialKeyboardState === KEYBOARD_STATE.SHOWN && animatedPosition.value > env1_17.value.initialPosition;
|
|
if (r3) {
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
isInTemporaryPosition.value = false;
|
|
}
|
|
value18 = animatedSnapPoints.value.slice();
|
|
if (enablePanDownToClose) {
|
|
value18.unshift(animatedClosedPosition.value);
|
|
}
|
|
moduleValue2 = require(6308) /* metro dependency 6308 */;
|
|
value21 = moduleValue2.snapPoint(translationY + env1_17.value.initialPosition, velocityY, value18);
|
|
if (value21 !== animatedPosition.value) {
|
|
r3 = a0 === GESTURE_SOURCE.CONTENT && animatedScrollableContentOffsetY.value > 0;
|
|
r3 = r3 && value4;
|
|
if (!r3) {
|
|
animateToPosition(value21, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.UNDETERMINED) {
|
|
animatedScrollableType.value;
|
|
SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
r3 = env1_17.value.initialKeyboardState === KEYBOARD_STATE.SHOWN && animatedPosition.value > env1_17.value.initialPosition;
|
|
if (r3) {
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
isInTemporaryPosition.value = false;
|
|
}
|
|
value18 = animatedSnapPoints.value.slice();
|
|
if (enablePanDownToClose) {
|
|
value18.unshift(animatedClosedPosition.value);
|
|
}
|
|
moduleValue2 = require(6308) /* metro dependency 6308 */;
|
|
value21 = moduleValue2.snapPoint(translationY + env1_17.value.initialPosition, velocityY, value18);
|
|
if (value21 !== animatedPosition.value) {
|
|
r3 = a0 === GESTURE_SOURCE.CONTENT && animatedScrollableContentOffsetY.value > 0;
|
|
r3 = r3 && value4;
|
|
if (!r3) {
|
|
animateToPosition(value21, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
} else if (isScrollableRefreshable.value) {
|
|
if (!value4) {
|
|
if (isInTemporaryPosition.value) {
|
|
if (env1_17.value.initialPosition >= animatedPosition.value) {
|
|
if (env1_17.value.initialPosition > animatedPosition.value) {
|
|
animateToPosition(env1_17.value.initialPosition, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
} else {
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.UNDETERMINED) {
|
|
animatedScrollableType.value;
|
|
SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
r3 = env1_17.value.initialKeyboardState === KEYBOARD_STATE.SHOWN && animatedPosition.value > env1_17.value.initialPosition;
|
|
if (r3) {
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
isInTemporaryPosition.value = false;
|
|
}
|
|
value18 = animatedSnapPoints.value.slice();
|
|
if (enablePanDownToClose) {
|
|
value18.unshift(animatedClosedPosition.value);
|
|
}
|
|
moduleValue2 = require(6308) /* metro dependency 6308 */;
|
|
value21 = moduleValue2.snapPoint(translationY + env1_17.value.initialPosition, velocityY, value18);
|
|
if (value21 !== animatedPosition.value) {
|
|
r3 = a0 === GESTURE_SOURCE.CONTENT && animatedScrollableContentOffsetY.value > 0;
|
|
r3 = r3 && value4;
|
|
if (!r3) {
|
|
animateToPosition(value21, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.UNDETERMINED) {
|
|
animatedScrollableType.value;
|
|
SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
r3 = env1_17.value.initialKeyboardState === KEYBOARD_STATE.SHOWN && animatedPosition.value > env1_17.value.initialPosition;
|
|
if (r3) {
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
isInTemporaryPosition.value = false;
|
|
}
|
|
value18 = animatedSnapPoints.value.slice();
|
|
if (enablePanDownToClose) {
|
|
value18.unshift(animatedClosedPosition.value);
|
|
}
|
|
moduleValue2 = require(6308) /* metro dependency 6308 */;
|
|
value21 = moduleValue2.snapPoint(translationY + env1_17.value.initialPosition, velocityY, value18);
|
|
if (value21 !== animatedPosition.value) {
|
|
r3 = a0 === GESTURE_SOURCE.CONTENT && animatedScrollableContentOffsetY.value > 0;
|
|
r3 = r3 && value4;
|
|
if (!r3) {
|
|
animateToPosition(value21, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} else if (isInTemporaryPosition.value) {
|
|
if (env1_17.value.initialPosition >= animatedPosition.value) {
|
|
if (env1_17.value.initialPosition > animatedPosition.value) {
|
|
animateToPosition(env1_17.value.initialPosition, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
} else {
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.UNDETERMINED) {
|
|
animatedScrollableType.value;
|
|
SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
r3 = env1_17.value.initialKeyboardState === KEYBOARD_STATE.SHOWN && animatedPosition.value > env1_17.value.initialPosition;
|
|
if (r3) {
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
isInTemporaryPosition.value = false;
|
|
}
|
|
value18 = animatedSnapPoints.value.slice();
|
|
if (enablePanDownToClose) {
|
|
value18.unshift(animatedClosedPosition.value);
|
|
}
|
|
moduleValue2 = require(6308) /* metro dependency 6308 */;
|
|
value21 = moduleValue2.snapPoint(translationY + env1_17.value.initialPosition, velocityY, value18);
|
|
if (value21 !== animatedPosition.value) {
|
|
r3 = a0 === GESTURE_SOURCE.CONTENT && animatedScrollableContentOffsetY.value > 0;
|
|
r3 = r3 && value4;
|
|
if (!r3) {
|
|
animateToPosition(value21, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
if (animatedScrollableType.value !== SCROLLABLE_TYPE.UNDETERMINED) {
|
|
animatedScrollableType.value;
|
|
SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
r3 = env1_17.value.initialKeyboardState === KEYBOARD_STATE.SHOWN && animatedPosition.value > env1_17.value.initialPosition;
|
|
if (r3) {
|
|
moduleValue = require(1610) /* metro dependency 1610 */;
|
|
moduleValue.runOnJS(dismiss)();
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
isInTemporaryPosition.value = false;
|
|
}
|
|
value18 = animatedSnapPoints.value.slice();
|
|
if (enablePanDownToClose) {
|
|
value18.unshift(animatedClosedPosition.value);
|
|
}
|
|
moduleValue2 = require(6308) /* metro dependency 6308 */;
|
|
value21 = moduleValue2.snapPoint(translationY + env1_17.value.initialPosition, velocityY, value18);
|
|
if (value21 !== animatedPosition.value) {
|
|
r3 = a0 === GESTURE_SOURCE.CONTENT && animatedScrollableContentOffsetY.value > 0;
|
|
r3 = r3 && value4;
|
|
if (!r3) {
|
|
animateToPosition(value21, ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun49716() { // fn#49716, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:10198, offset: 0x01206251, size: 68 bytes, params: 1, frame: 4
|
|
const handleOnFinalize2 = handleOnFinalize;
|
|
handleOnFinalize2.__closure = {resetContext: pnpm_useGestureEventsHandlersDefaultTsx1, context: env0_17};
|
|
handleOnFinalize2.__workletHash = 8824211868683;
|
|
handleOnFinalize2.__initData = env1_9;
|
|
return handleOnFinalize2;
|
|
function handleOnFinalize() { // fn#49717, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6484:10215, offset: 0x01206295, size: 23 bytes, params: 1, frame: 11
|
|
pnpm_useGestureEventsHandlersDefaultTsx1(env1_17);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun49706, 6306, [27, 6278, 6285, 1610, 6307,
|
|
6308]) /* metro module 6306, dependencies: [27, 6278, 6285, 1610, 6307, 6308] */;
|