decord/source/__polyfill/01xxx/module_1716.js
github-actions e510164e6b chore: update source for alpha 346.2
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
2026-09-10 05:38:07 +00:00

94 lines
5.9 KiB
JavaScript

// Module ID: 1716
// Function ID: 1717
// Dependencies: [1676]
// Exports: withRepeat
// Module 1716
const require = fn;
const dependencyMap = arg6;
let closure_2 = { code: "function pnpm_repeatTs2(){const{_nextAnimation,numberOfReps,reverse,callback,getReduceMotionForAnimation,reduceMotion}=this.__closure;const nextAnimation=typeof _nextAnimation==='function'?_nextAnimation():_nextAnimation;function repeat(animation,now){const finished=nextAnimation.onFrame(nextAnimation,now);animation.current=nextAnimation.current;if(finished){animation.reps+=1;if(nextAnimation.callback){nextAnimation.callback(true,animation.current);}if(animation.reduceMotion||numberOfReps>0&&animation.reps>=numberOfReps){return true;}const startValue=reverse?nextAnimation.current:animation.startValue;if(reverse){nextAnimation.toValue=animation.startValue;animation.startValue=startValue;}nextAnimation.onStart(nextAnimation,startValue,now,nextAnimation.previousAnimation);return false;}return false;}const repCallback=function(finished){if(callback){callback(finished);}if(!finished&&nextAnimation.callback){nextAnimation.callback(false);}};function onStart(animation,value,now,previousAnimation){animation.startValue=value;animation.reps=0;if(nextAnimation.reduceMotion===undefined){nextAnimation.reduceMotion=animation.reduceMotion;}if(animation.reduceMotion&&reverse&&(numberOfReps<=0||numberOfReps%2===0)){animation.current=animation.startValue;animation.onFrame=function(){return true;};}else{nextAnimation.onStart(nextAnimation,value,now,previousAnimation);}}return{isHigherOrder:true,onFrame:repeat,onStart:onStart,reps:0,current:nextAnimation.current,callback:repCallback,startValue:0,reduceMotion:getReduceMotionForAnimation(reduceMotion)};}" };
fn = function n(_nextAnimation, arg1, arg2, callback, reduceMotion) {
_require = _nextAnimation;
let num = arg1;
if (arg1 === undefined) {
num = 2;
}
let flag = arg2;
if (arg2 === undefined) {
flag = false;
}
closure_3 = callback;
closure_4 = reduceMotion;
const fn = function l() {
let tmpResult = _nextAnimation;
if (typeof _nextAnimation === "function") {
tmpResult = tmp();
}
_nextAnimation = tmpResult;
const obj = {
isHigherOrder: true,
onFrame: function repeat(reps, arg1) {
reps.current = closure_0.current;
if (closure_0.onFrame(closure_0, arg1)) {
reps.reps = reps.reps + 1;
if (obj.callback) {
obj.callback(true, reps.current);
}
if (!reps.reduceMotion) {
const tmp3 = flag ? obj.current : reps.startValue;
if (flag) {
obj.toValue = reps.startValue;
reps.startValue = tmp3;
}
obj.onStart(obj, tmp3, arg1, obj.previousAnimation);
return false;
}
return true;
} else {
return false;
}
},
onStart(reduceMotion, startValue, arg2, arg3) {
reduceMotion.startValue = startValue;
reduceMotion.reps = 0;
if (undefined === closure_0.reduceMotion) {
obj.reduceMotion = reduceMotion.reduceMotion;
}
if (reduceMotion.reduceMotion) {
if (flag) {
reduceMotion.current = reduceMotion.startValue;
reduceMotion.onFrame = () => true;
}
}
closure_0.onStart(closure_0, startValue, arg2, arg3);
},
reps: 0,
current: tmpResult.current,
callback(arg0) {
if (closure_3) {
tmp(arg0);
}
callback = !arg0;
if (!arg0) {
callback = closure_0.callback;
}
if (callback) {
closure_0.callback(false);
}
},
startValue: 0,
reduceMotion: _nextAnimation(num[0]).getReduceMotionForAnimation(closure_4)
};
return obj;
};
let obj = require("module_1676");
fn.__closure = { _nextAnimation, numberOfReps: num, reverse: flag, callback, getReduceMotionForAnimation: require("module_1676").getReduceMotionForAnimation, reduceMotion };
fn.__workletHash = 11413099333511;
fn.__initData = flag;
return obj.defineAnimation(_nextAnimation, fn);
};
fn.__closure = { defineAnimation: fn(1676).defineAnimation, getReduceMotionForAnimation: fn(1676).getReduceMotionForAnimation };
fn.__workletHash = 13638828150427;
fn.__initData = { code: "function pnpm_repeatTs1(_nextAnimation,numberOfReps=2,reverse=false,callback,reduceMotion){const{defineAnimation,getReduceMotionForAnimation}=this.__closure;return defineAnimation(_nextAnimation,function(){'worklet';const nextAnimation=typeof _nextAnimation==='function'?_nextAnimation():_nextAnimation;function repeat(animation,now){const finished=nextAnimation.onFrame(nextAnimation,now);animation.current=nextAnimation.current;if(finished){animation.reps+=1;if(nextAnimation.callback){nextAnimation.callback(true,animation.current);}if(animation.reduceMotion||numberOfReps>0&&animation.reps>=numberOfReps){return true;}const startValue=reverse?nextAnimation.current:animation.startValue;if(reverse){nextAnimation.toValue=animation.startValue;animation.startValue=startValue;}nextAnimation.onStart(nextAnimation,startValue,now,nextAnimation.previousAnimation);return false;}return false;}const repCallback=function(finished){if(callback){callback(finished);}if(!finished&&nextAnimation.callback){nextAnimation.callback(false);}};function onStart(animation,value,now,previousAnimation){animation.startValue=value;animation.reps=0;if(nextAnimation.reduceMotion===undefined){nextAnimation.reduceMotion=animation.reduceMotion;}if(animation.reduceMotion&&reverse&&(numberOfReps<=0||numberOfReps%2===0)){animation.current=animation.startValue;animation.onFrame=function(){return true;};}else{nextAnimation.onStart(nextAnimation,value,now,previousAnimation);}}return{isHigherOrder:true,onFrame:repeat,onStart:onStart,reps:0,current:nextAnimation.current,callback:repCallback,startValue:0,reduceMotion:getReduceMotionForAnimation(reduceMotion)};});}" };
export const withRepeat = fn;