decord/source/372_Animation.js

165 lines
5.6 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 372
// Function ID: 5521
// Name: Animation
2026-07-23 10:11:24 +00:00
// Dependencies: [65, 6, 7, 99, 100, 348, 373, 79]
2026-07-20 16:05:17 +00:00
// Module 372 (Animation)
2026-07-23 10:11:24 +00:00
import _toConsumableArray from "_toConsumableArray";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import javaScriptFlagGetter from "javaScriptFlagGetter";
import _classPrivateFieldBase from "_classPrivateFieldBase";
import importDefaultResult from "_classPrivateFieldKey";
let c7 = 1;
2026-07-20 16:05:17 +00:00
let closure_8 = importDefaultResult("nativeID");
let closure_9 = importDefaultResult("onEnd");
let closure_10 = importDefaultResult("useNativeDriver");
2026-07-23 10:11:24 +00:00
export default (() => {
2026-07-20 16:05:17 +00:00
class Animation {
constructor(arg0) {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_4(this, Animation);
definePropertyResult = Object.defineProperty(this, outer1_8, { writable: true, value: undefined });
definePropertyResult1 = Object.defineProperty(this, outer1_9, { writable: true, value: undefined });
definePropertyResult2 = Object.defineProperty(this, outer1_10, { writable: true, value: undefined });
tmp5 = outer1_6(this, outer1_10);
obj = Animation(outer1_2[5]);
tmp5[outer1_10] = obj.shouldUseNativeDriver(arg0);
2026-07-20 16:05:17 +00:00
this.__active = false;
isInteraction = arg0.isInteraction;
if (null == isInteraction) {
2026-07-23 10:11:24 +00:00
tmp6 = outer1_6;
tmp7 = outer1_10;
isInteraction = !outer1_6(self, outer1_10)[outer1_10];
2026-07-20 16:05:17 +00:00
}
self.__isInteraction = isInteraction;
({ isLooping: self.__isLooping, iterations } = arg0);
num = 1;
if (null != iterations) {
num = iterations;
}
self.__iterations = num;
return;
}
}
let obj = {
key: "start",
value: function start(arg0, arg1, arg2, arg3, __isNative) {
const self = this;
2026-07-23 10:11:24 +00:00
if (!outer1_6(this, outer1_10)[outer1_10]) {
2026-07-20 16:05:17 +00:00
if (true === __isNative.__isNative) {
const _Error = Error;
const error = new Error("Attempting to run JS driven animation on animated node that has been moved to \"native\" earlier by starting an animation with `useNativeDriver: true`");
throw error;
}
}
2026-07-23 10:11:24 +00:00
outer1_6(self, outer1_9)[outer1_9] = arg2;
2026-07-20 16:05:17 +00:00
self.__active = true;
}
};
2026-07-23 10:11:24 +00:00
let items = [obj, , , , , , ];
2026-07-20 16:05:17 +00:00
obj = {
key: "stop",
value: function stop() {
const self = this;
2026-07-23 10:11:24 +00:00
if (null != outer1_6(this, outer1_8)[outer1_8]) {
const tmp3 = outer1_6(self, outer1_8)[outer1_8];
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
const combined = "" + tmp3 + ":stopAnimation";
2026-07-23 10:11:24 +00:00
const API = Animation(outer1_2[5]).API;
2026-07-20 16:05:17 +00:00
const result = API.setWaitingForIdentifier(combined);
2026-07-23 10:11:24 +00:00
const API2 = Animation(outer1_2[5]).API;
2026-07-20 16:05:17 +00:00
API2.stopAnimation(tmp3);
2026-07-23 10:11:24 +00:00
const API3 = Animation(outer1_2[5]).API;
2026-07-20 16:05:17 +00:00
const result1 = API3.unsetWaitingForIdentifier(combined);
}
self.__active = false;
}
};
items[1] = obj;
obj = {
key: "__getNativeAnimationConfig",
value: function __getNativeAnimationConfig() {
const error = new Error("This animation type cannot be offloaded to native");
throw error;
}
};
items[2] = obj;
items[3] = {
key: "__findAnimatedPropsNodes",
2026-07-23 10:11:24 +00:00
value: function __findAnimatedPropsNodes(closure_0) {
2026-07-20 16:05:17 +00:00
const self = this;
const items = [];
2026-07-23 10:11:24 +00:00
if (closure_0 instanceof Animation(outer1_2[6])) {
items.push(closure_0);
2026-07-20 16:05:17 +00:00
return items;
} else {
2026-07-23 10:11:24 +00:00
const __getChildrenResult = closure_0.__getChildren();
2026-07-20 16:05:17 +00:00
for (const item10014 of __getChildrenResult) {
let tmp3 = items;
let push = items.push;
2026-07-23 10:11:24 +00:00
let tmp4 = outer1_3;
let applyResult = push.apply(items, outer1_3(self.__findAnimatedPropsNodes(item10014)));
continue;
2026-07-20 16:05:17 +00:00
}
return items;
}
}
};
items[4] = {
key: "__startAnimationIfNative",
2026-07-23 10:11:24 +00:00
value: function __startAnimationIfNative(closure_0) {
2026-07-20 16:05:17 +00:00
let self = this;
self = this;
2026-07-23 10:11:24 +00:00
if (outer1_6(this, outer1_10)[outer1_10]) {
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-23 10:11:24 +00:00
const combined = "" + outer1_7 + ":startAnimation";
outer1_7 = outer1_7 + 1;
const API = Animation(outer1_2[5]).API;
let result = API.setWaitingForIdentifier(combined);
let result1 = self.__getNativeAnimationConfig();
2026-07-20 16:05:17 +00:00
obj.__makeNative(result1.platformConfig);
2026-07-23 10:11:24 +00:00
const tmp14 = outer1_6(self, outer1_8);
tmp14[outer1_8] = Animation(outer1_2[5]).generateNewAnimationId();
const API2 = Animation(outer1_2[5]).API;
API2.startAnimatingNode(outer1_6(self, outer1_8)[outer1_8], obj.__getNativeTag(), result1, (value) => {
2026-07-20 16:05:17 +00:00
self.__notifyAnimationEnd(value);
value = value.value;
if (null != value) {
2026-07-23 10:11:24 +00:00
const result = closure_0.__onAnimatedValueUpdateReceived(value, tmp2);
2026-07-20 16:05:17 +00:00
if (obj2.cxxNativeAnimatedEnabled()) {
2026-07-23 10:11:24 +00:00
const obj = outer2_1(outer2_2[7]);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const result1 = self.__findAnimatedPropsNodes(closure_0);
2026-07-20 16:05:17 +00:00
const item = result1.forEach((update) => update.update());
2026-07-23 10:11:24 +00:00
obj2 = outer2_1(outer2_2[7]);
2026-07-20 16:05:17 +00:00
}
});
2026-07-23 10:11:24 +00:00
const API3 = Animation(outer1_2[5]).API;
2026-07-20 16:05:17 +00:00
const result2 = API3.unsetWaitingForIdentifier(combined);
return true;
} else {
return false;
}
}
};
items[5] = {
key: "__notifyAnimationEnd",
value: function __notifyAnimationEnd(value) {
2026-07-23 10:11:24 +00:00
const tmp = outer1_6(this, outer1_9)[outer1_9];
2026-07-20 16:05:17 +00:00
if (null != tmp) {
2026-07-23 10:11:24 +00:00
outer1_6(this, outer1_9)[outer1_9] = null;
2026-07-20 16:05:17 +00:00
tmp(value);
}
}
};
items[6] = {
key: "__getDebugID",
value: function __getDebugID() {
}
};
return callback(Animation, items);
2026-07-23 10:11:24 +00:00
})();