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

65 lines
2.2 KiB
JavaScript

// Metro module 5318 (f5319).
import { checkGestureCallbacksForWorklets, ALLOWED_PROPS, extractGestureRelations } from "./convertToHandlerTag";
import { ghQueueMicrotask } from "./Module5297";
import Module5282 from "./Module5282";
import { filterConfig, scheduleFlushOperations } from "./transformIntoHandlerTags";
import { registerHandler } from "./Module5276";
export function updateHandlers(a0, a1, a2) {
a1.prepare();
const length = a2.length;
let r0 = 0;
if (0 < length) {
do {
const r15 = a0.attachedGestures[r0];
checkGestureCallbacksForWorklets(r15);
const handlerTag = a2[r0].handlerTag;
const handlerTag2 = r15.handlerTag;
const r1 = r0;
if (handlerTag !== handlerTag2) {
a2[r1].handlerTag = r15.handlerTag;
a2[r1].handlers.handlerTag = r15.handlerTag;
}
r0 = r1 + 1;
} while (r0 < a2.length);
}
const attachedGestures = a0.attachedGestures;
ghQueueMicrotask(() => {
let length3;
if (a0.isMounted && attachedGestures === a0.attachedGestures) {
const length = attachedGestures.length;
let r4 = length !== a2.length;
const length2 = a2.length;
let r0 = 0;
const r3 = 0 < length2;
let r6 = r4;
if (r3) {
do {
const r17 = attachedGestures[r0];
const gestureId = r17.handlers.gestureId;
let r33 = gestureId !== a2[r0].handlers.gestureId;
const r1 = r0;
let r34 = r4;
if (r33) {
r33 = a2[r1].shouldUseReanimated || r17.shouldUseReanimated;
}
if (r33) {
r34 = true;
}
r17.config = a2[r1].config;
r17.handlers = a2[r1].handlers;
Module5282.updateGestureHandler(r17.handlerTag, filterConfig(r17.config, ALLOWED_PROPS, extractGestureRelations(r17)));
registerHandler(r17.handlerTag, r17, r17.config.testId);
r0 = r1 + 1;
length3 = a2.length;
r4 = r34;
r6 = r4;
} while (r0 < length3);
}
if (a0.animatedHandlers && r6) {
a0.animatedHandlers.value = attachedGestures.filter((attachedGesture) => attachedGesture.shouldUseReanimated).map((item) => item.handlers);
}
scheduleFlushOperations();
}
});
}