@remotion/lambda-client 4.0.508 → 4.0.509

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -61010,7 +61010,7 @@ If this is not correct, provide an override value by setting a number
61010
61010
  to input.params.ContentLength in bytes.
61011
61011
  `);
61012
61012
  }
61013
- this.uploadedParts.sort((a, b) => a.PartNumber - b.PartNumber);
61013
+ this.uploadedParts.sort((a2, b2) => a2.PartNumber - b2.PartNumber);
61014
61014
  const uploadCompleteParams = {
61015
61015
  ...this.params,
61016
61016
  Body: undefined,
@@ -69857,6 +69857,498 @@ var import_client_sts = __toESM(require_dist_cjs81(), 1);
69857
69857
 
69858
69858
  // ../serverless-client/dist/esm/index.mjs
69859
69859
  var tty = __toESM(require("tty"));
69860
+ var NEWTON_ITERATIONS = 4;
69861
+ var NEWTON_MIN_SLOPE = 0.001;
69862
+ var SUBDIVISION_PRECISION = 0.0000001;
69863
+ var SUBDIVISION_MAX_ITERATIONS = 10;
69864
+ var kSplineTableSize = 11;
69865
+ var kSampleStepSize = 1 / (kSplineTableSize - 1);
69866
+ var float32ArraySupported = typeof Float32Array === "function";
69867
+ function a(aA1, aA2) {
69868
+ return 1 - 3 * aA2 + 3 * aA1;
69869
+ }
69870
+ function b(aA1, aA2) {
69871
+ return 3 * aA2 - 6 * aA1;
69872
+ }
69873
+ function c(aA1) {
69874
+ return 3 * aA1;
69875
+ }
69876
+ function calcBezier(aT, aA1, aA2) {
69877
+ return ((a(aA1, aA2) * aT + b(aA1, aA2)) * aT + c(aA1)) * aT;
69878
+ }
69879
+ function getSlope(aT, aA1, aA2) {
69880
+ return 3 * a(aA1, aA2) * aT * aT + 2 * b(aA1, aA2) * aT + c(aA1);
69881
+ }
69882
+ function binarySubdivide({
69883
+ aX,
69884
+ _aA,
69885
+ _aB,
69886
+ mX1,
69887
+ mX2
69888
+ }) {
69889
+ let currentX;
69890
+ let currentT;
69891
+ let i = 0;
69892
+ let aA = _aA;
69893
+ let aB = _aB;
69894
+ do {
69895
+ currentT = aA + (aB - aA) / 2;
69896
+ currentX = calcBezier(currentT, mX1, mX2) - aX;
69897
+ if (currentX > 0) {
69898
+ aB = currentT;
69899
+ } else {
69900
+ aA = currentT;
69901
+ }
69902
+ } while (Math.abs(currentX) > SUBDIVISION_PRECISION && ++i < SUBDIVISION_MAX_ITERATIONS);
69903
+ return currentT;
69904
+ }
69905
+ function newtonRaphsonIterate(aX, _aGuessT, mX1, mX2) {
69906
+ let aGuessT = _aGuessT;
69907
+ for (let i = 0;i < NEWTON_ITERATIONS; ++i) {
69908
+ const currentSlope = getSlope(aGuessT, mX1, mX2);
69909
+ if (currentSlope === 0) {
69910
+ return aGuessT;
69911
+ }
69912
+ const currentX = calcBezier(aGuessT, mX1, mX2) - aX;
69913
+ aGuessT -= currentX / currentSlope;
69914
+ }
69915
+ return aGuessT;
69916
+ }
69917
+ function bezier(mX1, mY1, mX2, mY2) {
69918
+ if (!(mX1 >= 0 && mX1 <= 1 && mX2 >= 0 && mX2 <= 1)) {
69919
+ throw new Error("bezier x values must be in [0, 1] range");
69920
+ }
69921
+ const sampleValues = float32ArraySupported ? new Float32Array(kSplineTableSize) : new Array(kSplineTableSize);
69922
+ if (mX1 !== mY1 || mX2 !== mY2) {
69923
+ for (let i = 0;i < kSplineTableSize; ++i) {
69924
+ sampleValues[i] = calcBezier(i * kSampleStepSize, mX1, mX2);
69925
+ }
69926
+ }
69927
+ function getTForX(aX) {
69928
+ let intervalStart = 0;
69929
+ let currentSample = 1;
69930
+ const lastSample = kSplineTableSize - 1;
69931
+ for (;currentSample !== lastSample && sampleValues[currentSample] <= aX; ++currentSample) {
69932
+ intervalStart += kSampleStepSize;
69933
+ }
69934
+ --currentSample;
69935
+ const dist = (aX - sampleValues[currentSample]) / (sampleValues[currentSample + 1] - sampleValues[currentSample]);
69936
+ const guessForT = intervalStart + dist * kSampleStepSize;
69937
+ const initialSlope = getSlope(guessForT, mX1, mX2);
69938
+ if (initialSlope >= NEWTON_MIN_SLOPE) {
69939
+ return newtonRaphsonIterate(aX, guessForT, mX1, mX2);
69940
+ }
69941
+ if (initialSlope === 0) {
69942
+ return guessForT;
69943
+ }
69944
+ return binarySubdivide({
69945
+ aX,
69946
+ _aA: intervalStart,
69947
+ _aB: intervalStart + kSampleStepSize,
69948
+ mX1,
69949
+ mX2
69950
+ });
69951
+ }
69952
+ return function(x) {
69953
+ const clampedX = Math.min(1, Math.max(0, x));
69954
+ if (mX1 === mY1 && mX2 === mY2) {
69955
+ return clampedX;
69956
+ }
69957
+ if (clampedX === 0) {
69958
+ return 0;
69959
+ }
69960
+ if (clampedX === 1) {
69961
+ return 1;
69962
+ }
69963
+ return calcBezier(getTForX(clampedX), mY1, mY2);
69964
+ };
69965
+ }
69966
+ var validateFrame = ({
69967
+ allowFloats,
69968
+ durationInFrames,
69969
+ frame
69970
+ }) => {
69971
+ if (typeof frame === "undefined") {
69972
+ throw new TypeError(`Argument missing for parameter "frame"`);
69973
+ }
69974
+ if (typeof frame !== "number") {
69975
+ throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
69976
+ }
69977
+ if (!Number.isFinite(frame)) {
69978
+ throw new RangeError(`Frame ${frame} is not finite`);
69979
+ }
69980
+ if (frame % 1 !== 0 && !allowFloats) {
69981
+ throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
69982
+ }
69983
+ if (frame < 0 && frame < -durationInFrames) {
69984
+ throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
69985
+ }
69986
+ if (frame > durationInFrames - 1) {
69987
+ throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
69988
+ }
69989
+ };
69990
+ function validateFps(fps, location, isGif) {
69991
+ if (typeof fps !== "number") {
69992
+ throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
69993
+ }
69994
+ if (!Number.isFinite(fps)) {
69995
+ throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
69996
+ }
69997
+ if (isNaN(fps)) {
69998
+ throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
69999
+ }
70000
+ if (fps <= 0) {
70001
+ throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
70002
+ }
70003
+ if (isGif && fps > 50) {
70004
+ throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
70005
+ }
70006
+ }
70007
+ var validateSpringDuration = (dur) => {
70008
+ if (typeof dur === "undefined") {
70009
+ return;
70010
+ }
70011
+ if (typeof dur !== "number") {
70012
+ throw new TypeError(`A "duration" of a spring must be a "number" but is "${typeof dur}"`);
70013
+ }
70014
+ if (Number.isNaN(dur)) {
70015
+ throw new TypeError('A "duration" of a spring is NaN, which it must not be');
70016
+ }
70017
+ if (!Number.isFinite(dur)) {
70018
+ throw new TypeError('A "duration" of a spring must be finite, but is ' + dur);
70019
+ }
70020
+ if (dur <= 0) {
70021
+ throw new TypeError('A "duration" of a spring must be positive, but is ' + dur);
70022
+ }
70023
+ };
70024
+ var defaultSpringConfig = {
70025
+ damping: 10,
70026
+ mass: 1,
70027
+ stiffness: 100,
70028
+ overshootClamping: false
70029
+ };
70030
+ var advanceCache = {};
70031
+ function advance({
70032
+ animation,
70033
+ now,
70034
+ config
70035
+ }) {
70036
+ const { toValue, lastTimestamp, current, velocity } = animation;
70037
+ const deltaTime = Math.min(now - lastTimestamp, 64);
70038
+ if (config.damping <= 0) {
70039
+ throw new Error("Spring damping must be greater than 0, otherwise the spring() animation will never end, causing an infinite loop.");
70040
+ }
70041
+ const c2 = config.damping;
70042
+ const m = config.mass;
70043
+ const k = config.stiffness;
70044
+ const cacheKey = [
70045
+ toValue,
70046
+ lastTimestamp,
70047
+ current,
70048
+ velocity,
70049
+ c2,
70050
+ m,
70051
+ k,
70052
+ now
70053
+ ].join("-");
70054
+ if (advanceCache[cacheKey]) {
70055
+ return advanceCache[cacheKey];
70056
+ }
70057
+ const v0 = -velocity;
70058
+ const x0 = toValue - current;
70059
+ const zeta = c2 / (2 * Math.sqrt(k * m));
70060
+ const omega0 = Math.sqrt(k / m);
70061
+ const omega1 = omega0 * Math.sqrt(1 - zeta ** 2);
70062
+ const t = deltaTime / 1000;
70063
+ const sin1 = Math.sin(omega1 * t);
70064
+ const cos1 = Math.cos(omega1 * t);
70065
+ const underDampedEnvelope = Math.exp(-zeta * omega0 * t);
70066
+ const underDampedFrag1 = underDampedEnvelope * (sin1 * ((v0 + zeta * omega0 * x0) / omega1) + x0 * cos1);
70067
+ const underDampedPosition = toValue - underDampedFrag1;
70068
+ const underDampedVelocity = zeta * omega0 * underDampedFrag1 - underDampedEnvelope * (cos1 * (v0 + zeta * omega0 * x0) - omega1 * x0 * sin1);
70069
+ const criticallyDampedEnvelope = Math.exp(-omega0 * t);
70070
+ const criticallyDampedPosition = toValue - criticallyDampedEnvelope * (x0 + (v0 + omega0 * x0) * t);
70071
+ const criticallyDampedVelocity = criticallyDampedEnvelope * (v0 * (t * omega0 - 1) + t * x0 * omega0 * omega0);
70072
+ const animationNode = {
70073
+ toValue,
70074
+ prevPosition: current,
70075
+ lastTimestamp: now,
70076
+ current: zeta < 1 ? underDampedPosition : criticallyDampedPosition,
70077
+ velocity: zeta < 1 ? underDampedVelocity : criticallyDampedVelocity
70078
+ };
70079
+ advanceCache[cacheKey] = animationNode;
70080
+ return animationNode;
70081
+ }
70082
+ var calculationCache = {};
70083
+ function springCalculation({
70084
+ frame,
70085
+ fps,
70086
+ config = {}
70087
+ }) {
70088
+ const from = 0;
70089
+ const to = 1;
70090
+ const cacheKey = [
70091
+ frame,
70092
+ fps,
70093
+ config.damping,
70094
+ config.mass,
70095
+ config.overshootClamping,
70096
+ config.stiffness
70097
+ ].join("-");
70098
+ if (calculationCache[cacheKey]) {
70099
+ return calculationCache[cacheKey];
70100
+ }
70101
+ let animation = {
70102
+ lastTimestamp: 0,
70103
+ current: from,
70104
+ toValue: to,
70105
+ velocity: 0,
70106
+ prevPosition: 0
70107
+ };
70108
+ const frameClamped = Math.max(0, frame);
70109
+ const unevenRest = frameClamped % 1;
70110
+ for (let f = 0;f <= Math.floor(frameClamped); f++) {
70111
+ if (f === Math.floor(frameClamped)) {
70112
+ f += unevenRest;
70113
+ }
70114
+ const time = f / fps * 1000;
70115
+ animation = advance({
70116
+ animation,
70117
+ now: time,
70118
+ config: {
70119
+ ...defaultSpringConfig,
70120
+ ...config
70121
+ }
70122
+ });
70123
+ }
70124
+ calculationCache[cacheKey] = animation;
70125
+ return animation;
70126
+ }
70127
+ var cache = new Map;
70128
+ function measureSpring({
70129
+ fps,
70130
+ config = {},
70131
+ threshold = 0.005
70132
+ }) {
70133
+ if (typeof threshold !== "number") {
70134
+ throw new TypeError(`threshold must be a number, got ${threshold} of type ${typeof threshold}`);
70135
+ }
70136
+ if (threshold === 0) {
70137
+ return Infinity;
70138
+ }
70139
+ if (threshold === 1) {
70140
+ return 0;
70141
+ }
70142
+ if (isNaN(threshold)) {
70143
+ throw new TypeError("Threshold is NaN");
70144
+ }
70145
+ if (!Number.isFinite(threshold)) {
70146
+ throw new TypeError("Threshold is not finite");
70147
+ }
70148
+ if (threshold < 0) {
70149
+ throw new TypeError("Threshold is below 0");
70150
+ }
70151
+ const cacheKey = [
70152
+ fps,
70153
+ config.damping,
70154
+ config.mass,
70155
+ config.overshootClamping,
70156
+ config.stiffness,
70157
+ threshold
70158
+ ].join("-");
70159
+ if (cache.has(cacheKey)) {
70160
+ return cache.get(cacheKey);
70161
+ }
70162
+ validateFps(fps, "to the measureSpring() function", false);
70163
+ let frame = 0;
70164
+ let finishedFrame = 0;
70165
+ const calc = () => {
70166
+ return springCalculation({
70167
+ fps,
70168
+ frame,
70169
+ config
70170
+ });
70171
+ };
70172
+ let animation = calc();
70173
+ const calcDifference = () => {
70174
+ return Math.abs(animation.current - animation.toValue);
70175
+ };
70176
+ let difference = calcDifference();
70177
+ while (difference >= threshold) {
70178
+ frame++;
70179
+ animation = calc();
70180
+ difference = calcDifference();
70181
+ }
70182
+ finishedFrame = frame;
70183
+ for (let i = 0;i < 20; i++) {
70184
+ frame++;
70185
+ animation = calc();
70186
+ difference = calcDifference();
70187
+ if (difference >= threshold) {
70188
+ i = 0;
70189
+ finishedFrame = frame + 1;
70190
+ }
70191
+ }
70192
+ cache.set(cacheKey, finishedFrame);
70193
+ return finishedFrame;
70194
+ }
70195
+ function spring({
70196
+ frame: passedFrame,
70197
+ fps,
70198
+ config = {},
70199
+ from = 0,
70200
+ to = 1,
70201
+ durationInFrames: passedDurationInFrames,
70202
+ durationRestThreshold,
70203
+ delay = 0,
70204
+ reverse = false
70205
+ }) {
70206
+ validateSpringDuration(passedDurationInFrames);
70207
+ validateFrame({
70208
+ frame: passedFrame,
70209
+ durationInFrames: Infinity,
70210
+ allowFloats: true
70211
+ });
70212
+ validateFps(fps, "to spring()", false);
70213
+ const needsToCalculateNaturalDuration = reverse || typeof passedDurationInFrames !== "undefined";
70214
+ const naturalDuration = needsToCalculateNaturalDuration ? measureSpring({
70215
+ fps,
70216
+ config,
70217
+ threshold: durationRestThreshold
70218
+ }) : undefined;
70219
+ const naturalDurationGetter = needsToCalculateNaturalDuration ? {
70220
+ get: () => naturalDuration
70221
+ } : {
70222
+ get: () => {
70223
+ throw new Error("did not calculate natural duration, this is an error with Remotion. Please report");
70224
+ }
70225
+ };
70226
+ const reverseProcessed = reverse ? (passedDurationInFrames ?? naturalDurationGetter.get()) - passedFrame : passedFrame;
70227
+ const delayProcessed = reverseProcessed + (reverse ? delay : -delay);
70228
+ const durationProcessed = passedDurationInFrames === undefined ? delayProcessed : delayProcessed / (passedDurationInFrames / naturalDurationGetter.get());
70229
+ if (passedDurationInFrames && delayProcessed > passedDurationInFrames) {
70230
+ return to;
70231
+ }
70232
+ const spr = springCalculation({
70233
+ fps,
70234
+ frame: durationProcessed,
70235
+ config
70236
+ });
70237
+ const inner = config.overshootClamping ? to >= from ? Math.min(spr.current, to) : Math.max(spr.current, to) : spr.current;
70238
+ const interpolated = from === 0 && to === 1 ? inner : interpolate(inner, [0, 1], [from, to]);
70239
+ return interpolated;
70240
+ }
70241
+ var clampUnit = (t) => Math.min(1, Math.max(0, t));
70242
+ var springEasingDurationInFrames = 30;
70243
+
70244
+ class Easing {
70245
+ static step0(n) {
70246
+ return n > 0 ? 1 : 0;
70247
+ }
70248
+ static step1(n) {
70249
+ return n >= 1 ? 1 : 0;
70250
+ }
70251
+ static linear(t) {
70252
+ return t;
70253
+ }
70254
+ static ease(t) {
70255
+ return Easing.bezier(0.42, 0, 1, 1)(t);
70256
+ }
70257
+ static quad(t) {
70258
+ return t * t;
70259
+ }
70260
+ static cubic(t) {
70261
+ return t * t * t;
70262
+ }
70263
+ static poly(n) {
70264
+ return (t) => t ** n;
70265
+ }
70266
+ static sin(t) {
70267
+ return 1 - Math.cos(t * Math.PI / 2);
70268
+ }
70269
+ static circle(t) {
70270
+ const u = clampUnit(t);
70271
+ return 1 - Math.sqrt(1 - u * u);
70272
+ }
70273
+ static exp(t) {
70274
+ return 2 ** (10 * (t - 1));
70275
+ }
70276
+ static elastic(bounciness = 1) {
70277
+ const p = bounciness * Math.PI;
70278
+ return (t) => 1 - Math.cos(t * Math.PI / 2) ** 3 * Math.cos(t * p);
70279
+ }
70280
+ static back(s = 1.70158) {
70281
+ return (t) => t * t * ((s + 1) * t - s);
70282
+ }
70283
+ static spring({
70284
+ allowTail = false,
70285
+ durationRestThreshold,
70286
+ ...config
70287
+ } = {}) {
70288
+ const easing = (t) => {
70289
+ if (t <= 0) {
70290
+ return 0;
70291
+ }
70292
+ if (!allowTail && t >= 1) {
70293
+ return 1;
70294
+ }
70295
+ if (allowTail) {
70296
+ return spring({
70297
+ fps: springEasingDurationInFrames,
70298
+ frame: t * measureSpring({
70299
+ fps: springEasingDurationInFrames,
70300
+ config,
70301
+ threshold: durationRestThreshold
70302
+ }),
70303
+ config
70304
+ });
70305
+ }
70306
+ return spring({
70307
+ fps: springEasingDurationInFrames,
70308
+ frame: t * springEasingDurationInFrames,
70309
+ config,
70310
+ durationInFrames: springEasingDurationInFrames,
70311
+ durationRestThreshold
70312
+ });
70313
+ };
70314
+ return Object.assign(easing, {
70315
+ remotionShouldExtendRight: allowTail
70316
+ });
70317
+ }
70318
+ static bounce(t) {
70319
+ const u = clampUnit(t);
70320
+ if (u < 1 / 2.75) {
70321
+ return 7.5625 * u * u;
70322
+ }
70323
+ if (u < 2 / 2.75) {
70324
+ const t2_ = u - 1.5 / 2.75;
70325
+ return 7.5625 * t2_ * t2_ + 0.75;
70326
+ }
70327
+ if (u < 2.5 / 2.75) {
70328
+ const t2_ = u - 2.25 / 2.75;
70329
+ return 7.5625 * t2_ * t2_ + 0.9375;
70330
+ }
70331
+ const t2 = u - 2.625 / 2.75;
70332
+ return 7.5625 * t2 * t2 + 0.984375;
70333
+ }
70334
+ static bezier(x1, y1, x2, y2) {
70335
+ return bezier(x1, y1, x2, y2);
70336
+ }
70337
+ static in(easing) {
70338
+ return easing;
70339
+ }
70340
+ static out(easing) {
70341
+ return (t) => 1 - easing(1 - t);
70342
+ }
70343
+ static inOut(easing) {
70344
+ return (t) => {
70345
+ if (t < 0.5) {
70346
+ return easing(t * 2) / 2;
70347
+ }
70348
+ return 1 - easing((1 - t) * 2) / 2;
70349
+ };
70350
+ }
70351
+ }
69860
70352
  var normalizeNumber = (value) => {
69861
70353
  return Math.round(value * 1e6) / 1e6;
69862
70354
  };
@@ -69927,10 +70419,13 @@ var transformOriginCenter = { value: 50, unit: "%" };
69927
70419
  var stringifyNumber = (value) => {
69928
70420
  return String(normalizeNumber(value));
69929
70421
  };
70422
+
70423
+ class UnsupportedStringInterpolationValueError extends TypeError {
70424
+ }
69930
70425
  var parseStringInterpolationComponent = (component, value) => {
69931
70426
  const match = cssNumberRegex.exec(component);
69932
70427
  if (match === null) {
69933
- throw new TypeError(`Cannot interpolate "${value}" because "${component}" is not a supported scale, translate, or rotate value`);
70428
+ throw new UnsupportedStringInterpolationValueError(`Cannot interpolate "${value}" because "${component}" is not a supported scale, translate, or rotate value`);
69934
70429
  }
69935
70430
  const unit = match[2] ?? null;
69936
70431
  const numberValue = Number(match[1]);
@@ -70397,6 +70892,52 @@ var interpolateString = ({
70397
70892
  axisRotation: hasAxisRotation
70398
70893
  });
70399
70894
  };
70895
+ var interpolateDiscreteString = ({
70896
+ input,
70897
+ inputRange,
70898
+ outputRange,
70899
+ options
70900
+ }) => {
70901
+ if (inputRange.length === 1) {
70902
+ return outputRange[0];
70903
+ }
70904
+ for (let segmentIndex = 0;segmentIndex < inputRange.length - 1; segmentIndex++) {
70905
+ if (resolveEasingForSegment({
70906
+ easing: options?.easing,
70907
+ segmentIndex
70908
+ }) !== Easing.step1) {
70909
+ throw new TypeError("Non-numeric strings can only be interpolated using Easing.step1");
70910
+ }
70911
+ }
70912
+ const posterizedInput = options?.posterize === undefined ? input : Math.floor(input / options.posterize) * options.posterize;
70913
+ const inputMin = inputRange[0];
70914
+ const inputMax = inputRange[inputRange.length - 1];
70915
+ let resolvedInput = posterizedInput;
70916
+ if (resolvedInput < inputMin) {
70917
+ if (options?.extrapolateLeft === "identity") {
70918
+ throw new TypeError('extrapolateLeft: "identity" is not supported for non-numeric strings');
70919
+ }
70920
+ if (options?.extrapolateLeft === "wrap") {
70921
+ const wrapRange = inputMax - inputMin;
70922
+ resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
70923
+ } else {
70924
+ return outputRange[0];
70925
+ }
70926
+ }
70927
+ if (resolvedInput > inputMax) {
70928
+ if (options?.extrapolateRight === "identity") {
70929
+ throw new TypeError('extrapolateRight: "identity" is not supported for non-numeric strings');
70930
+ }
70931
+ if (options?.extrapolateRight === "wrap") {
70932
+ const wrapRange = inputMax - inputMin;
70933
+ resolvedInput = ((resolvedInput - inputMin) % wrapRange + wrapRange) % wrapRange + inputMin;
70934
+ } else {
70935
+ return outputRange[outputRange.length - 1];
70936
+ }
70937
+ }
70938
+ const range = findRange(resolvedInput, inputRange);
70939
+ return resolvedInput >= inputRange[range + 1] ? outputRange[range + 1] : outputRange[range];
70940
+ };
70400
70941
  var validateTupleOutputRange = (outputRange) => {
70401
70942
  const dimensions = outputRange[0]?.length;
70402
70943
  if (dimensions === undefined) {
@@ -70511,7 +71052,30 @@ function interpolate(input, inputRange, outputRange, options) {
70511
71052
  if (!outputRange.every((output) => typeof output === "string" || typeof output === "number")) {
70512
71053
  throw new TypeError("outputRange must contain only numbers, or supported scale, translate, and rotate strings");
70513
71054
  }
70514
- return interpolateString({ input, inputRange, outputRange, options });
71055
+ try {
71056
+ return interpolateString({ input, inputRange, outputRange, options });
71057
+ } catch (error) {
71058
+ if (!outputRange.every((output) => typeof output === "string")) {
71059
+ throw error;
71060
+ }
71061
+ const hasNonNumericString = outputRange.some((output) => {
71062
+ try {
71063
+ parseStringInterpolationValue(output);
71064
+ return false;
71065
+ } catch (parseError) {
71066
+ return parseError instanceof UnsupportedStringInterpolationValueError;
71067
+ }
71068
+ });
71069
+ if (!hasNonNumericString) {
71070
+ throw error;
71071
+ }
71072
+ return interpolateDiscreteString({
71073
+ input,
71074
+ inputRange,
71075
+ outputRange,
71076
+ options
71077
+ });
71078
+ }
70515
71079
  }
70516
71080
  if (outputRange.every((output) => Array.isArray(output))) {
70517
71081
  return interpolateTuple({ input, inputRange, outputRange, options });
@@ -70522,8 +71086,8 @@ function interpolate(input, inputRange, outputRange, options) {
70522
71086
  checkInfiniteRange("outputRange", outputRange);
70523
71087
  return interpolateNumber({ input, inputRange, outputRange, options });
70524
71088
  }
70525
- function mulberry32(a) {
70526
- let t = a + 1831565813;
71089
+ function mulberry32(a2) {
71090
+ let t = a2 + 1831565813;
70527
71091
  t = Math.imul(t ^ t >>> 15, t | 1);
70528
71092
  t ^= t + Math.imul(t ^ t >>> 7, t | 61);
70529
71093
  return ((t ^ t >>> 14) >>> 0) / 4294967296;
@@ -71012,8 +71576,8 @@ function hslToRgb(h, s, l) {
71012
71576
  const p = 2 * l - q;
71013
71577
  const r = hue2rgb(p, q, h + 1 / 3);
71014
71578
  const g = hue2rgb(p, q, h);
71015
- const b = hue2rgb(p, q, h - 1 / 3);
71016
- return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;
71579
+ const b2 = hue2rgb(p, q, h - 1 / 3);
71580
+ return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b2 * 255) << 8;
71017
71581
  }
71018
71582
  function parse255(str) {
71019
71583
  const int = Number.parseInt(str, 10);
@@ -71077,25 +71641,25 @@ function parseModernAlpha(str) {
71077
71641
  }
71078
71642
  return Math.max(0, Math.min(1, Number.parseFloat(str)));
71079
71643
  }
71080
- function linearToSrgb(c) {
71081
- if (c <= 0.0031308)
71082
- return 12.92 * c;
71083
- return 1.055 * c ** (1 / 2.4) - 0.055;
71644
+ function linearToSrgb(c2) {
71645
+ if (c2 <= 0.0031308)
71646
+ return 12.92 * c2;
71647
+ return 1.055 * c2 ** (1 / 2.4) - 0.055;
71084
71648
  }
71085
71649
  function clamp01(v) {
71086
71650
  return Math.max(0, Math.min(1, v));
71087
71651
  }
71088
- function rgbFloatToInt(r, g, b, alpha) {
71652
+ function rgbFloatToInt(r, g, b2, alpha) {
71089
71653
  const ri = Math.round(clamp01(r) * 255);
71090
71654
  const gi = Math.round(clamp01(g) * 255);
71091
- const bi = Math.round(clamp01(b) * 255);
71655
+ const bi = Math.round(clamp01(b2) * 255);
71092
71656
  const ai = Math.round(clamp01(alpha) * 255);
71093
71657
  return (ri << 24 | gi << 16 | bi << 8 | ai) >>> 0;
71094
71658
  }
71095
- function oklabToSrgb(L, a, b) {
71096
- const l_ = L + 0.3963377774 * a + 0.2158037573 * b;
71097
- const m_ = L - 0.1055613458 * a - 0.0638541728 * b;
71098
- const s_ = L - 0.0894841775 * a - 1.291485548 * b;
71659
+ function oklabToSrgb(L, a2, b2) {
71660
+ const l_ = L + 0.3963377774 * a2 + 0.2158037573 * b2;
71661
+ const m_ = L - 0.1055613458 * a2 - 0.0638541728 * b2;
71662
+ const s_ = L - 0.0894841775 * a2 - 1.291485548 * b2;
71099
71663
  const l = l_ * l_ * l_;
71100
71664
  const m = m_ * m_ * m_;
71101
71665
  const s = s_ * s_ * s_;
@@ -71104,15 +71668,15 @@ function oklabToSrgb(L, a, b) {
71104
71668
  const bLin = -0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s;
71105
71669
  return [linearToSrgb(rLin), linearToSrgb(gLin), linearToSrgb(bLin)];
71106
71670
  }
71107
- function labToSrgb(L, a, b) {
71671
+ function labToSrgb(L, a2, b2) {
71108
71672
  const epsilon = 216 / 24389;
71109
71673
  const kappa = 24389 / 27;
71110
71674
  const Xn = 0.95047;
71111
71675
  const Yn = 1;
71112
71676
  const Zn = 1.08883;
71113
71677
  const fy = (L + 16) / 116;
71114
- const fx = a / 500 + fy;
71115
- const fz = fy - b / 200;
71678
+ const fx = a2 / 500 + fy;
71679
+ const fz = fy - b2 / 200;
71116
71680
  const fx3 = fx * fx * fx;
71117
71681
  const fz3 = fz * fz * fz;
71118
71682
  const xr = fx3 > epsilon ? fx3 : (116 * fx - 16) / kappa;
@@ -71344,27 +71908,27 @@ function normalizeColor(color) {
71344
71908
  const H = parseHueAngle(match[3]);
71345
71909
  const alpha = parseModernAlpha(match[4]);
71346
71910
  const hRad = H * Math.PI / 180;
71347
- const [r, g, b] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
71348
- return rgbFloatToInt(r, g, b, alpha);
71911
+ const [r, g, b2] = oklabToSrgb(L, C * Math.cos(hRad), C * Math.sin(hRad));
71912
+ return rgbFloatToInt(r, g, b2, alpha);
71349
71913
  }
71350
71914
  }
71351
71915
  if (matchers.oklab) {
71352
71916
  if (match = matchers.oklab.exec(color)) {
71353
71917
  const L = parseModernComponent(match[1], 1);
71354
- const a = parseModernComponent(match[2], 0.4);
71355
- const b = parseModernComponent(match[3], 0.4);
71918
+ const a2 = parseModernComponent(match[2], 0.4);
71919
+ const b2 = parseModernComponent(match[3], 0.4);
71356
71920
  const alpha = parseModernAlpha(match[4]);
71357
- const [r, g, bl] = oklabToSrgb(L, a, b);
71921
+ const [r, g, bl] = oklabToSrgb(L, a2, b2);
71358
71922
  return rgbFloatToInt(r, g, bl, alpha);
71359
71923
  }
71360
71924
  }
71361
71925
  if (matchers.lab) {
71362
71926
  if (match = matchers.lab.exec(color)) {
71363
71927
  const L = parseModernComponent(match[1], 100);
71364
- const a = parseModernComponent(match[2], 125);
71365
- const b = parseModernComponent(match[3], 125);
71928
+ const a2 = parseModernComponent(match[2], 125);
71929
+ const b2 = parseModernComponent(match[3], 125);
71366
71930
  const alpha = parseModernAlpha(match[4]);
71367
- const [r, g, bl] = labToSrgb(L, a, b);
71931
+ const [r, g, bl] = labToSrgb(L, a2, b2);
71368
71932
  return rgbFloatToInt(r, g, bl, alpha);
71369
71933
  }
71370
71934
  }
@@ -71443,30 +72007,6 @@ var serializeScaleValue = ([x, y, z]) => {
71443
72007
  return `${normalizedX} ${normalizedY} ${normalizedZ}`;
71444
72008
  };
71445
72009
  var ENABLE_V5_BREAKING_CHANGES = false;
71446
- var validateFrame = ({
71447
- allowFloats,
71448
- durationInFrames,
71449
- frame
71450
- }) => {
71451
- if (typeof frame === "undefined") {
71452
- throw new TypeError(`Argument missing for parameter "frame"`);
71453
- }
71454
- if (typeof frame !== "number") {
71455
- throw new TypeError(`Argument passed for "frame" is not a number: ${frame}`);
71456
- }
71457
- if (!Number.isFinite(frame)) {
71458
- throw new RangeError(`Frame ${frame} is not finite`);
71459
- }
71460
- if (frame % 1 !== 0 && !allowFloats) {
71461
- throw new RangeError(`Argument for frame must be an integer, but got ${frame}`);
71462
- }
71463
- if (frame < 0 && frame < -durationInFrames) {
71464
- throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the lowest frame that can be rendered is ${-durationInFrames}`);
71465
- }
71466
- if (frame > durationInFrames - 1) {
71467
- throw new RangeError(`Cannot use frame ${frame}: Duration of composition is ${durationInFrames}, therefore the highest frame that can be rendered is ${durationInFrames - 1}`);
71468
- }
71469
- };
71470
72010
  var validCodecs = [
71471
72011
  "h264",
71472
72012
  "h265",
@@ -71538,23 +72078,6 @@ function validateDurationInFrames(durationInFrames, options) {
71538
72078
  throw new TypeError(`The "durationInFrames" prop ${component} must be finite, but got ${durationInFrames}.`);
71539
72079
  }
71540
72080
  }
71541
- function validateFps(fps, location, isGif) {
71542
- if (typeof fps !== "number") {
71543
- throw new Error(`"fps" must be a number, but you passed a value of type ${typeof fps} ${location}`);
71544
- }
71545
- if (!Number.isFinite(fps)) {
71546
- throw new Error(`"fps" must be a finite, but you passed ${fps} ${location}`);
71547
- }
71548
- if (isNaN(fps)) {
71549
- throw new Error(`"fps" must not be NaN, but got ${fps} ${location}`);
71550
- }
71551
- if (fps <= 0) {
71552
- throw new TypeError(`"fps" must be positive, but got ${fps} ${location}`);
71553
- }
71554
- if (isGif && fps > 50) {
71555
- throw new TypeError(`The FPS for a GIF cannot be higher than 50. Use the --every-nth-frame option to lower the FPS: https://remotion.dev/docs/render-as-gif`);
71556
- }
71557
- }
71558
72081
  var getExpectedMediaFrameUncorrected = ({
71559
72082
  frame,
71560
72083
  playbackRate,
@@ -71675,7 +72198,7 @@ var validateDownloadBehavior = (downloadBehavior) => {
71675
72198
  }
71676
72199
  }
71677
72200
  };
71678
- var VERSION = "4.0.508";
72201
+ var VERSION = "4.0.509";
71679
72202
  var isColorSupported = () => {
71680
72203
  const env = process.env || {};
71681
72204
  const isForceDisabled = "NO_COLOR" in env;
@@ -71844,17 +72367,17 @@ var Log = {
71844
72367
  return [
71845
72368
  options.indent ? INDENT_TOKEN : null,
71846
72369
  options.tag ? verboseTag(options.tag) : null
71847
- ].filter(truthy2).concat(args.map((a) => {
72370
+ ].filter(truthy2).concat(args.map((a2) => {
71848
72371
  if (logLevel === "warn") {
71849
- return chalk.yellow(a);
72372
+ return chalk.yellow(a2);
71850
72373
  }
71851
72374
  if (logLevel === "error") {
71852
- return chalk.red(a);
72375
+ return chalk.red(a2);
71853
72376
  }
71854
72377
  if (logLevel === "verbose" || logLevel === "trace") {
71855
- return chalk.gray(a);
72378
+ return chalk.gray(a2);
71856
72379
  }
71857
- return a;
72380
+ return a2;
71858
72381
  }));
71859
72382
  },
71860
72383
  trace: (options, ...args) => {
@@ -72142,7 +72665,7 @@ var calculateBillingDuration = ({
72142
72665
  functionsInvoked,
72143
72666
  elapsedTimeOfUnfinishedChunks
72144
72667
  }) => {
72145
- const completedChunksDuration = timings.map((p) => Math.max(0, p.rendered - p.start) + OVERHEAD_TIME_PER_LAMBDA).reduce((a, b) => a + b, 0);
72668
+ const completedChunksDuration = timings.map((p) => Math.max(0, p.rendered - p.start) + OVERHEAD_TIME_PER_LAMBDA).reduce((a2, b2) => a2 + b2, 0);
72146
72669
  const unfinished = Math.max(0, functionsInvoked - timings.length);
72147
72670
  return completedChunksDuration + unfinished * elapsedTimeOfUnfinishedChunks;
72148
72671
  };
@@ -72189,7 +72712,7 @@ var calculateChunkTimes = ({
72189
72712
  const parsedTimings = timings;
72190
72713
  const absoluteTime = getAbsoluteTime(parsedTimings);
72191
72714
  if (type === "combined-time-for-cost-calculation") {
72192
- const totalEncodingTimings = parsedTimings.map((p) => Math.max(0, p.rendered - p.start)).reduce((a, b) => a + b, 0);
72715
+ const totalEncodingTimings = parsedTimings.map((p) => Math.max(0, p.rendered - p.start)).reduce((a2, b2) => a2 + b2, 0);
72193
72716
  return totalEncodingTimings + absoluteTime;
72194
72717
  }
72195
72718
  if (type === "absolute-time") {
@@ -72219,7 +72742,7 @@ var internalGetOrCreateBucket = async (params) => {
72219
72742
  requestHandler: params.requestHandler
72220
72743
  });
72221
72744
  if (remotionBuckets.length > 1) {
72222
- throw new Error(`You have multiple buckets (${remotionBuckets.map((b) => b.name)}) in your S3 region (${params.region}) starting with "${params.providerSpecifics.getBucketPrefix()}". Please see https://remotion.dev/docs/lambda/multiple-buckets.`);
72745
+ throw new Error(`You have multiple buckets (${remotionBuckets.map((b2) => b2.name)}) in your S3 region (${params.region}) starting with "${params.providerSpecifics.getBucketPrefix()}". Please see https://remotion.dev/docs/lambda/multiple-buckets.`);
72223
72746
  }
72224
72747
  const { enableFolderExpiry, region } = params;
72225
72748
  if (remotionBuckets.length === 1) {
@@ -72308,7 +72831,7 @@ var getNeedsToUpload = ({
72308
72831
  }) => {
72309
72832
  const MARGIN = 5000 + MAX_WEBHOOK_CUSTOM_DATA_SIZE;
72310
72833
  const MAX_INLINE_PAYLOAD_SIZE = (type === "still" ? providerSpecifics.getMaxStillInlinePayloadSize() : providerSpecifics.getMaxNonInlinePayloadSizePerFunction()) - MARGIN;
72311
- const sizesAlreadyUsed = sizes.reduce((a, b) => a + b);
72834
+ const sizesAlreadyUsed = sizes.reduce((a2, b2) => a2 + b2);
72312
72835
  if (sizesAlreadyUsed > MAX_INLINE_PAYLOAD_SIZE) {
72313
72836
  console.warn(`Warning: The props are over ${Math.round(MAX_INLINE_PAYLOAD_SIZE / 1000)}KB (${Math.ceil(sizesAlreadyUsed / 1024)}KB) in size. Uploading them to ${providerSpecifics.serverStorageProductName()} to circumvent AWS Lambda payload size, which may lead to slowdown.`);
72314
72837
  return true;
@@ -73192,7 +73715,7 @@ var getOverallProgress = ({
73192
73715
  Boolean(invokedLambda),
73193
73716
  Boolean(visitedServeUrl),
73194
73717
  Boolean(gotComposition)
73195
- ].reduce((a, b) => Number(a) + Number(b), 0) / 3;
73718
+ ].reduce((a2, b2) => Number(a2) + Number(b2), 0) / 3;
73196
73719
  return evaluationProgress * weights.evaluating + encoding * weights.encoding + invoking * weights.invoking + frames * weights.frames + combining * weights.combining;
73197
73720
  };
73198
73721
  var MAX_MISSING_CHUNKS = 5;
@@ -73490,7 +74013,7 @@ var getProgress = async ({
73490
74013
  const allChunks = (overallProgress.chunks ?? []).length / chunkMultiplier === (renderMetadata.totalChunks ?? Infinity);
73491
74014
  const frameCount = NoReactAPIs.getFramesToRender(renderMetadata.frameRange, renderMetadata.everyNthFrame).length;
73492
74015
  const missingChunks = new Array(renderMetadata.totalChunks).fill(true).map((_, i) => i).filter((index) => {
73493
- return typeof (overallProgress.chunks ?? []).find((c) => c === index) === "undefined";
74016
+ return typeof (overallProgress.chunks ?? []).find((c2) => c2 === index) === "undefined";
73494
74017
  });
73495
74018
  const isBeyondTimeoutAndMissingChunks = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds + 20000 && missingChunks && missingChunks.length > 0;
73496
74019
  const isBeyondTimeoutAndHasStitchTimeout = Date.now() > renderMetadata.startedDate + timeoutInMilliseconds * 2 + 20000;
@@ -75316,11 +75839,11 @@ var getRemotionBuckets = async ({
75316
75839
  if (!Buckets) {
75317
75840
  return [];
75318
75841
  }
75319
- const remotionBuckets = Buckets.filter((b) => {
75842
+ const remotionBuckets = Buckets.filter((b2) => {
75320
75843
  if (forceBucketName) {
75321
- return b.Name === forceBucketName;
75844
+ return b2.Name === forceBucketName;
75322
75845
  }
75323
- return b.Name?.startsWith(REMOTION_BUCKET_PREFIX);
75846
+ return b2.Name?.startsWith(REMOTION_BUCKET_PREFIX);
75324
75847
  });
75325
75848
  const locations = await Promise.all(remotionBuckets.map(async (bucket) => {
75326
75849
  const { region: parsedRegion } = parseBucketName(bucket.Name);
@@ -75350,7 +75873,7 @@ var getRemotionBuckets = async ({
75350
75873
  name: bucket.Name,
75351
75874
  region: locations[i]
75352
75875
  };
75353
- }).filter((b) => b.region);
75876
+ }).filter((b2) => b2.region);
75354
75877
  return bucketsWithLocation.filter((bucket) => {
75355
75878
  return bucket.region === region;
75356
75879
  });
@@ -76109,8 +76632,8 @@ var internalDeleteRender = async (input) => {
76109
76632
  });
76110
76633
  let totalSize = 0;
76111
76634
  while (files.length > 0) {
76112
- totalSize += files.reduce((a, b) => {
76113
- return a + (b.Size ?? 0);
76635
+ totalSize += files.reduce((a2, b2) => {
76636
+ return a2 + (b2.Size ?? 0);
76114
76637
  }, 0);
76115
76638
  await cleanItems({
76116
76639
  list: files.map((f) => f.Key),