518 lines
25 KiB
React
518 lines
25 KiB
React
/* Metro module 5323; source: unknown; dependencies: [27, 5324, 5326, 5327, 5329] */
|
|
function _fun47111(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#47111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5501:6, offset: 0x011b8f9b, size: 176 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const isStateChangeEvent = function(a0) {
|
|
return a0.oldState != null;
|
|
};
|
|
const closure = onGestureHandlerEvent;
|
|
const closure2 = stopListening;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_2 = (require(27) /* metro dependency 27 */).DeviceEventEmitter;
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const env0_6 = [];
|
|
exports.onGestureHandlerEvent = closure;
|
|
exports.startListening = function() {
|
|
stopListening();
|
|
var onGestureHandlerEventBinding = onGestureHandlerEvent;
|
|
env0_3 = DeviceEventEmitter.addListener('onGestureHandlerEvent', onGestureHandlerEventBinding);
|
|
env0_4 = DeviceEventEmitter.addListener('onGestureHandlerStateChange', onGestureHandlerEventBinding);
|
|
};
|
|
exports.stopListening = closure2;
|
|
}
|
|
|
|
function onGestureHandlerEvent(a0) { // fn#47113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5501:209, offset: 0x011b905c, size: 1540 bytes, params: 2, frame: 21
|
|
var r4;
|
|
var object2;
|
|
var eventType;
|
|
var handlers;
|
|
var binding;
|
|
var has;
|
|
var set;
|
|
var GestureStateManager;
|
|
var get;
|
|
var value4;
|
|
const TouchEventType = (require(5329) /* metro dependency 5329 */).TouchEventType;
|
|
const State = (require(5326) /* metro dependency 5326 */).State;
|
|
const value2 = undefined;
|
|
const moduleValue = require(5324) /* metro dependency 5324 */;
|
|
const findHandler = moduleValue.findHandler;
|
|
let handlerTag = a0.handlerTag;
|
|
const handler = Reflect.apply(findHandler, moduleValue, [handlerTag]);
|
|
if (handler) {
|
|
if (isStateChangeEvent(a0)) {
|
|
if (a0.oldState !== State.UNDETERMINED) {
|
|
if (a0.oldState === State.BEGAN) {
|
|
if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else if (a0.oldState !== State.UNDETERMINED) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else if (a0.state === State.BEGAN) {
|
|
if (handler.handlers.onBegin != null) {
|
|
handler.handlers.onBegin(a0);
|
|
}
|
|
} else if (a0.oldState === State.BEGAN) {
|
|
if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else if (a0.oldState !== State.UNDETERMINED) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else {
|
|
eventType = a0.eventType;
|
|
if (eventType != null) {
|
|
binding = env0_5;
|
|
has = binding.has;
|
|
handlerTag = a0.handlerTag;
|
|
if (!Reflect.apply(has, binding, [handlerTag])) {
|
|
binding = env0_5;
|
|
set = binding.set;
|
|
handlerTag = a0.handlerTag;
|
|
GestureStateManager = (require(5327) /* metro dependency 5327 */).GestureStateManager;
|
|
Reflect.apply(set, binding, [handlerTag, GestureStateManager.create(a0.handlerTag)]);
|
|
}
|
|
binding = env0_5;
|
|
get = binding.get;
|
|
handlerTag = a0.handlerTag;
|
|
value4 = Reflect.apply(get, binding, [handlerTag]);
|
|
eventType = a0.eventType;
|
|
if (TouchEventType.TOUCHES_DOWN === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesDown == null)) {
|
|
handlers.onTouchesDown(a0, value4);
|
|
}
|
|
} else if (TouchEventType.TOUCHES_MOVE === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesMove == null)) {
|
|
handlers.onTouchesMove(a0, value4);
|
|
}
|
|
} else if (TouchEventType.TOUCHES_UP === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesUp == null)) {
|
|
handlers.onTouchesUp(a0, value4);
|
|
}
|
|
} else if (TouchEventType.TOUCHES_CANCELLED === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesCancelled == null)) {
|
|
handlers.onTouchesCancelled(a0, value4);
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onUpdate != null) {
|
|
handler.handlers.onUpdate(a0);
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onChange && handler.handlers.changeEventCalculator) {
|
|
handlers = handler.handlers;
|
|
if (handlers.onChange != null) {
|
|
handlers = handler.handlers;
|
|
handlers.onChange(handler.handlers.changeEventCalculator == null ? value2 : handler.handlers.changeEventCalculator(a0,
|
|
|
|
|
|
|
|
|
|
|
|
env0_6[handler.handlers.handlerTag]));
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
var moduleValue2 = moduleValue;
|
|
var oldGestureHandler = moduleValue2.findOldGestureHandler(a0.handlerTag);
|
|
if (oldGestureHandler) {
|
|
object2 = {nativeEvent: a0};
|
|
if (isStateChangeEvent(a0)) {
|
|
oldGestureHandler.onGestureStateChange(object2);
|
|
} else {
|
|
oldGestureHandler.onGestureEvent(object2);
|
|
}
|
|
return value2;
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function stopListening() { // fn#47114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5501:2250, offset: 0x011b9660, size: 61 bytes, params: 1, frame: 10
|
|
if (env0_3) {
|
|
env0_3.remove();
|
|
}
|
|
if (env0_4) {
|
|
env0_4.remove();
|
|
}
|
|
}
|
|
|