Files
discord-decomp/_bundle/Module474.js
T
2026-11-01 12:12:55 +02:00

155 lines
6.4 KiB
JavaScript

// Metro module 474 (f475).
import * as _Module475 from "./Module475";
const currentCentroidXOfTouchesChangedAfter = _Module475.default.currentCentroidXOfTouchesChangedAfter;
const currentCentroidYOfTouchesChangedAfter = _Module475.default.currentCentroidYOfTouchesChangedAfter;
const previousCentroidXOfTouchesChangedAfter = _Module475.default.previousCentroidXOfTouchesChangedAfter;
const previousCentroidYOfTouchesChangedAfter = _Module475.default.previousCentroidYOfTouchesChangedAfter;
const currentCentroidX = _Module475.default.currentCentroidX;
const currentCentroidY = _Module475.default.currentCentroidY;
let c470_6 = {
_initializeGestureState: (a0) => {
a0.moveX = 0;
a0.moveY = 0;
a0.x0 = 0;
a0.y0 = 0;
a0.dx = 0;
a0.dy = 0;
a0.vx = 0;
a0.vy = 0;
a0.numberActiveTouches = 0;
a0._accountsForMovesUpTo = 0;
},
_updateGestureStateOnMove: (a0, a1) => {
a0.numberActiveTouches = a1.numberActiveTouches;
a0.moveX = currentCentroidXOfTouchesChangedAfter(a1, a0._accountsForMovesUpTo);
a0.moveY = currentCentroidYOfTouchesChangedAfter(a1, a0._accountsForMovesUpTo);
const _accountsForMovesUpTo = a0._accountsForMovesUpTo;
const r13 = previousCentroidXOfTouchesChangedAfter(a1, _accountsForMovesUpTo);
const r14 = currentCentroidXOfTouchesChangedAfter(a1, _accountsForMovesUpTo);
const r16 = previousCentroidYOfTouchesChangedAfter(a1, _accountsForMovesUpTo);
const r17 = currentCentroidYOfTouchesChangedAfter(a1, _accountsForMovesUpTo);
const dx = a0.dx + (r14 - r13);
const dy = a0.dy + (r17 - r16);
const r26 = a1.mostRecentTimeStamp - a0._accountsForMovesUpTo;
a0.vx = (dx - a0.dx) / r26;
a0.vy = (dy - a0.dy) / r26;
a0.dx = dx;
a0.dy = dy;
a0._accountsForMovesUpTo = a1.mostRecentTimeStamp;
},
create: (c12340_0) => {
let c12340_1 = {
stateID: Math.random(),
moveX: 0,
moveY: 0,
x0: 0,
y0: 0,
dx: 0,
dy: 0,
vx: 0,
vy: 0,
numberActiveTouches: 0,
_accountsForMovesUpTo: 0
};
return {
panHandlers: {
onStartShouldSetResponder: (a0) => c12340_0.onStartShouldSetPanResponder != null && c12340_0.onStartShouldSetPanResponder(a0, c12340_1),
onMoveShouldSetResponder: (a0) => c12340_0.onMoveShouldSetPanResponder != null && c12340_0.onMoveShouldSetPanResponder(a0, c12340_1),
onStartShouldSetResponderCapture: (a0) => {
if (a0.nativeEvent.touches.length === 1) {
c470_6._initializeGestureState(c12340_1);
}
c12340_1.numberActiveTouches = a0.touchHistory.numberActiveTouches;
return c12340_0.onStartShouldSetPanResponderCapture != null && c12340_0.onStartShouldSetPanResponderCapture(a0, c12340_1);
},
onMoveShouldSetResponderCapture: (a0) => {
const touchHistory = a0.touchHistory;
let r8 = c12340_1._accountsForMovesUpTo !== touchHistory.mostRecentTimeStamp;
if (r8) {
c470_6._updateGestureStateOnMove(c12340_1, touchHistory);
r8 = !!c12340_0.onMoveShouldSetPanResponderCapture && c12340_0.onMoveShouldSetPanResponderCapture(a0, c12340_1);
}
return r8;
},
onResponderGrant: (a0) => {
c12340_1.x0 = currentCentroidX(a0.touchHistory);
c12340_1.y0 = currentCentroidY(a0.touchHistory);
c12340_1.dx = 0;
c12340_1.dy = 0;
if (c12340_0.onPanResponderGrant) {
c12340_0.onPanResponderGrant(a0, c12340_1);
}
return c12340_0.onShouldBlockNativeResponder == null || c12340_0.onShouldBlockNativeResponder(a0, c12340_1);
},
onResponderReject: (a0) => {
const onPanResponderReject = c12340_0.onPanResponderReject;
if (onPanResponderReject != null) {
const call = onPanResponderReject.call;
if (call === Function.prototype.call) {
onPanResponderReject(a0, c12340_1);
} else {
call.call(onPanResponderReject, void 0, a0, c12340_1);
}
}
},
onResponderRelease: (a0) => {
const onPanResponderRelease = c12340_0.onPanResponderRelease;
if (onPanResponderRelease != null) {
const call = onPanResponderRelease.call;
if (call === Function.prototype.call) {
onPanResponderRelease(a0, c12340_1);
} else {
call.call(onPanResponderRelease, void 0, a0, c12340_1);
}
}
c470_6._initializeGestureState(c12340_1);
},
onResponderStart: (a0) => {
const touchHistory = a0.touchHistory;
c12340_1.numberActiveTouches = touchHistory.numberActiveTouches;
if (c12340_0.onPanResponderStart) {
c12340_0.onPanResponderStart(a0, c12340_1);
}
},
onResponderMove: (a0) => {
const touchHistory = a0.touchHistory;
if (c12340_1._accountsForMovesUpTo !== touchHistory.mostRecentTimeStamp) {
c470_6._updateGestureStateOnMove(c12340_1, touchHistory);
if (c12340_0.onPanResponderMove) {
c12340_0.onPanResponderMove(a0, c12340_1);
}
}
},
onResponderEnd: (a0) => {
const touchHistory = a0.touchHistory;
c12340_1.numberActiveTouches = touchHistory.numberActiveTouches;
const onPanResponderEnd = c12340_0.onPanResponderEnd;
if (onPanResponderEnd != null) {
const call = onPanResponderEnd.call;
if (call === Function.prototype.call) {
onPanResponderEnd(a0, c12340_1);
} else {
call.call(onPanResponderEnd, void 0, a0, c12340_1);
}
}
},
onResponderTerminate: (a0) => {
const onPanResponderTerminate = c12340_0.onPanResponderTerminate;
if (onPanResponderTerminate != null) {
const call = onPanResponderTerminate.call;
if (call === Function.prototype.call) {
onPanResponderTerminate(a0, c12340_1);
} else {
call.call(onPanResponderTerminate, void 0, a0, c12340_1);
}
}
c470_6._initializeGestureState(c12340_1);
},
onResponderTerminationRequest: (a0) => c12340_0.onPanResponderTerminationRequest == null || c12340_0.onPanResponderTerminationRequest(a0, c12340_1)
},
getInteractionHandle: () => null
};
}
};
export default c470_6;