decord/source/1667_InnerKeyframe.js

226 lines
11 KiB
JavaScript
Raw Normal View History

2026-07-20 16:05:17 +00:00
// Module ID: 1667
2026-07-25 08:10:48 +00:00
// Function ID: 18512
2026-07-20 16:05:17 +00:00
// Name: InnerKeyframe
2026-07-23 10:11:24 +00:00
// Dependencies: [77, 65, 6, 7, 1607, 1654, 1634, 1593, 1622]
2026-07-20 16:05:17 +00:00
// Module 1667 (InnerKeyframe)
2026-07-23 10:11:24 +00:00
import _defineProperty from "_defineProperty";
import _toConsumableArray from "_toConsumableArray";
import linear from "linear";
import processStack from "processStack";
const require = arg1;
2026-07-20 16:05:17 +00:00
let closure_6 = { code: "function pnpm_KeyframeTs1(){const{keyframes,delayFunction,delay,withTiming,Easing,withSequence,initialValues,makeKeyframeKey,callback}=this.__closure;const animations={};const addAnimation=function(key){const keyframePoints=keyframes[key];if(keyframePoints.length===0){return;}const animation=delayFunction(delay,keyframePoints.length===1?withTiming(keyframePoints[0].value,{duration:keyframePoints[0].duration,easing:keyframePoints[0].easing?keyframePoints[0].easing:Easing.linear}):withSequence(...keyframePoints.map(function(keyframePoint){return withTiming(keyframePoint.value,{duration:keyframePoint.duration,easing:keyframePoint.easing?keyframePoint.easing:Easing.linear});})));if(key.includes('transform')){if(!('transform'in animations)){animations.transform=[];}animations.transform.push({[key.split(':')[1]]:animation});}else{animations[key]=animation;}};Object.keys(initialValues).forEach(function(key){if(key.includes('transform')){initialValues[key].forEach(function(transformProp,index){Object.keys(transformProp).forEach(function(transformPropKey){addAnimation(makeKeyframeKey(index,transformPropKey));});});}else{addAnimation(key);}});return{animations:animations,initialValues:initialValues,callback:callback};}" };
let closure_7 = { code: "function pnpm_KeyframeTs2(delay,animation){const{withDelay,reduceMotion}=this.__closure;return withDelay(delay,animation,reduceMotion);}" };
let closure_8 = { code: "function pnpm_KeyframeTs3(_,animation){const{getReduceMotionFromConfig,reduceMotion}=this.__closure;animation.reduceMotion=getReduceMotionFromConfig(reduceMotion);return animation;}" };
let closure_9 = { code: "function makeKeyframeKey_Pnpm_KeyframeTs4(index,transformProp){return index+\"_transform:\"+transformProp;}" };
2026-07-23 10:11:24 +00:00
let closure_10 = (() => {
2026-07-20 16:05:17 +00:00
function makeKeyframeKey(arg0, arg1) {
return "" + arg0 + "_transform:" + arg1;
}
makeKeyframeKey.__closure = {};
makeKeyframeKey.__workletHash = 11090453666227;
makeKeyframeKey.__initData = closure_9;
return makeKeyframeKey;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
export const Keyframe = (() => {
2026-07-20 16:05:17 +00:00
class InnerKeyframe {
constructor(arg0) {
2026-07-23 10:11:24 +00:00
self = this;
tmp = outer1_4(this, self);
this.reduceMotionV = InnerKeyframe(outer1_1[4]).ReduceMotion.System;
2026-07-20 16:05:17 +00:00
this.build = () => {
2026-07-23 10:11:24 +00:00
delayV = delayV.delayV;
const delayFunction = delayV.getDelayFunction();
const parseDefinitionsResult = delayV.parseDefinitions();
2026-07-20 16:05:17 +00:00
const keyframes = parseDefinitionsResult.keyframes;
const initialValues = parseDefinitionsResult.initialValues;
2026-07-23 10:11:24 +00:00
const callbackV = delayV.callbackV;
if (!delayV.parsedAnimation) {
2026-07-20 16:05:17 +00:00
/* worklet (recovered source) */ function pnpm_KeyframeTs1(){const{keyframes,delayFunction,delay,withTiming,Easing,withSequence,initialValues,makeKeyframeKey,callback}=this.__closure;const animations={};const addAnimation=function(key){const keyframePoints=keyframes[key];if(keyframePoints.length===0){return;}const animation=delayFunction(delay,keyframePoints.length===1?withTiming(keyframePoints[0].value,{duration:keyframePoints[0].duration,easing:keyframePoints[0].easing?keyframePoints[0].easing:Easing.linear}):withSequence(...keyframePoints.map(function(keyframePoint){return withTiming(keyframePoint.value,{duration:keyframePoint.duration,easing:keyframePoint.easing?keyframePoint.easing:Easing.linear});})));if(key.includes('transform')){if(!('transform'in animations)){animations.transform=[];}animations.transform.push({[key.split(':')[1]]:animation});}else{animations[key]=animation;}};Object.keys(initialValues).forEach(function(key){if(key.includes('transform')){initialValues[key].forEach(function(transformProp,index){Object.keys(transformProp).forEach(function(transformPropKey){addAnimation(makeKeyframeKey(index,transformPropKey));});});}else{addAnimation(key);}});return{animations:animations,initialValues:initialValues,callback:callback};}
2026-07-23 10:11:24 +00:00
let obj = { keyframes, delayFunction, delay: delayV, withTiming: InnerKeyframe(outer2_1[5]).withTiming, Easing: InnerKeyframe(outer2_1[6]).Easing, withSequence: InnerKeyframe(outer2_1[5]).withSequence, initialValues, makeKeyframeKey: outer2_10, callback: callbackV };
2026-07-20 16:05:17 +00:00
pnpm_KeyframeTs1.__closure = obj;
pnpm_KeyframeTs1.__workletHash = 2209924843920;
2026-07-23 10:11:24 +00:00
pnpm_KeyframeTs1.__initData = outer2_6;
delayV.parsedAnimation = pnpm_KeyframeTs1;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
return delayV.parsedAnimation;
2026-07-20 16:05:17 +00:00
};
this.definitions = arg0;
return;
}
}
let obj = {
key: "parseDefinitions",
value: function parseDefinitions() {
2026-07-23 10:11:24 +00:00
let self = this;
self = this;
2026-07-20 16:05:17 +00:00
let obj = {};
if (this.definitions.from) {
if (self.definitions[0]) {
2026-07-23 10:11:24 +00:00
const ReanimatedError3 = InnerKeyframe(outer1_1[7]).ReanimatedError;
2026-07-20 16:05:17 +00:00
const prototype3 = ReanimatedError3.prototype;
const reanimatedError3 = new ReanimatedError3("You cannot provide both keyframe 0 and 'from' as they both specified initial values.");
throw reanimatedError3;
} else {
self.definitions[0] = self.definitions.from;
const definitions = self.definitions;
2026-07-23 10:11:24 +00:00
delete tmp.from;
2026-07-20 16:05:17 +00:00
}
}
if (self.definitions.to) {
if (self.definitions[100]) {
2026-07-23 10:11:24 +00:00
const ReanimatedError2 = InnerKeyframe(outer1_1[7]).ReanimatedError;
2026-07-20 16:05:17 +00:00
const prototype2 = ReanimatedError2.prototype;
const reanimatedError2 = new ReanimatedError2("You cannot provide both keyframe 100 and 'to' as they both specified values at the end of the animation.");
throw reanimatedError2;
} else {
self.definitions[100] = self.definitions.to;
const definitions2 = self.definitions;
2026-07-23 10:11:24 +00:00
delete tmp.to;
2026-07-20 16:05:17 +00:00
}
}
if (self.definitions[0]) {
const first = self.definitions[0];
2026-07-23 10:11:24 +00:00
let _Object = Object;
let keys = Object.keys(first);
let item = keys.forEach((arg0) => {
2026-07-20 16:05:17 +00:00
if ("transform" === arg0) {
const _Array = Array;
if (Array.isArray(first.transform)) {
const transform = first.transform;
2026-07-23 10:11:24 +00:00
let item = transform.forEach((arg0, arg1) => {
let closure_0 = arg1;
2026-07-20 16:05:17 +00:00
const keys = Object.keys(arg0);
const item = keys.forEach((arg0) => {
2026-07-23 10:11:24 +00:00
outer2_1[outer4_10(closure_0, arg0)] = [];
2026-07-20 16:05:17 +00:00
});
});
}
} else {
obj[arg0] = [];
}
});
let num4 = 500;
if (self.durationV) {
num4 = self.durationV;
}
2026-07-23 10:11:24 +00:00
let _Array = Array;
2026-07-20 16:05:17 +00:00
const _Object2 = Object;
const _Number = Number;
const mapped = Array.from(Object.keys(self.definitions)).map(Number);
function getAnimationDuration(arg0, arg1) {
const result = arg1 / 100 * num4;
return result - obj[arg0].reduce((arg0, duration) => arg0 + duration.duration, 0);
}
const found = mapped.filter((arg0) => 0 !== arg0);
const sorted = found.sort((arg0, arg1) => arg0 - arg1);
const item1 = sorted.forEach((arg0) => {
2026-07-23 10:11:24 +00:00
const _self = arg0;
2026-07-20 16:05:17 +00:00
if (arg0 >= 0) {
if (arg0 <= 100) {
2026-07-23 10:11:24 +00:00
const easing = tmp3.easing;
delete tmp.easing;
2026-07-20 16:05:17 +00:00
function addKeyPointWith(key, value) {
2026-07-23 10:11:24 +00:00
let obj = { key, value, currentKeyPoint: closure_0, easing };
if (obj.key in tmp3) {
let arr = tmp3[key];
obj = { duration: outer1_4(key, tmp2), value: tmp, easing: tmp3 };
2026-07-20 16:05:17 +00:00
arr = arr.push(obj);
} else {
2026-07-23 10:11:24 +00:00
const ReanimatedError = InnerKeyframe(outer3_1[7]).ReanimatedError;
2026-07-20 16:05:17 +00:00
const prototype = ReanimatedError.prototype;
const reanimatedError = new ReanimatedError("Keyframe can contain only that set of properties that were provide with initial values (keyframe 0 or 'from')");
throw reanimatedError;
}
}
const _Object = Object;
2026-07-23 10:11:24 +00:00
let keys = Object.keys(tmp3);
let item = keys.forEach((key) => {
2026-07-20 16:05:17 +00:00
if ("transform" === key) {
const _Array = Array;
2026-07-23 10:11:24 +00:00
if (Array.isArray(tmp3.transform)) {
const transform = tmp3.transform;
let item = transform.forEach((arg0, arg1) => {
let closure_0 = arg0;
let closure_1 = arg1;
2026-07-20 16:05:17 +00:00
const keys = Object.keys(arg0);
const item = keys.forEach(() => { ... });
});
}
} else {
2026-07-23 10:11:24 +00:00
tmp3 = addKeyPointWith(key, tmp3[key]);
2026-07-20 16:05:17 +00:00
}
});
}
}
2026-07-23 10:11:24 +00:00
let reanimatedError = new InnerKeyframe(outer2_1[7]).ReanimatedError("Keyframe should be in between range 0 - 100.");
2026-07-20 16:05:17 +00:00
throw reanimatedError;
});
obj = { initialValues: first };
obj.keyframes = obj;
return obj;
} else {
2026-07-23 10:11:24 +00:00
let ReanimatedError = InnerKeyframe(outer1_1[7]).ReanimatedError;
let prototype = ReanimatedError.prototype;
let reanimatedError = new ReanimatedError("Please provide 0 or 'from' keyframe with initial state of your object.");
2026-07-20 16:05:17 +00:00
throw reanimatedError;
}
}
};
const items = [obj, , , , , ];
obj = {
key: "duration",
value: function duration(durationV) {
this.durationV = durationV;
return this;
}
};
items[1] = obj;
obj = {
key: "delay",
value: function delay(delayV) {
this.delayV = delayV;
return this;
}
};
items[2] = obj;
items[3] = {
key: "withCallback",
value: function withCallback(callbackV) {
this.callbackV = callbackV;
return this;
}
};
items[4] = {
key: "reduceMotion",
value: function reduceMotion(reduceMotionV) {
this.reduceMotionV = reduceMotionV;
return this;
}
};
items[5] = {
key: "getDelayFunction",
value: function getDelayFunction() {
const reduceMotionV = this.reduceMotionV;
if (this.delayV) {
/* worklet (recovered source) */ function pnpm_KeyframeTs2(delay,animation){const{withDelay,reduceMotion}=this.__closure;return withDelay(delay,animation,reduceMotion);}
2026-07-23 10:11:24 +00:00
let obj = { withDelay: InnerKeyframe(outer1_1[5]).withDelay, reduceMotion: reduceMotionV };
2026-07-20 16:05:17 +00:00
pnpm_KeyframeTs2.__closure = obj;
pnpm_KeyframeTs2.__workletHash = 6884672498893;
2026-07-23 10:11:24 +00:00
pnpm_KeyframeTs2.__initData = outer1_7;
2026-07-20 16:05:17 +00:00
let pnpm_KeyframeTs3 = pnpm_KeyframeTs2;
} else {
pnpm_KeyframeTs3 = /* worklet (recovered source) */ function pnpm_KeyframeTs3(_,animation){const{getReduceMotionFromConfig,reduceMotion}=this.__closure;animation.reduceMotion=getReduceMotionFromConfig(reduceMotion);return animation;};
2026-07-23 10:11:24 +00:00
obj = { getReduceMotionFromConfig: InnerKeyframe(outer1_1[8]).getReduceMotionFromConfig, reduceMotion: reduceMotionV };
2026-07-20 16:05:17 +00:00
pnpm_KeyframeTs3.__closure = obj;
pnpm_KeyframeTs3.__workletHash = 14632587413843;
2026-07-23 10:11:24 +00:00
pnpm_KeyframeTs3.__initData = outer1_8;
2026-07-20 16:05:17 +00:00
}
return pnpm_KeyframeTs3;
}
};
return callback(InnerKeyframe, items);
2026-07-23 10:11:24 +00:00
})();