@remotion/promo-pages 4.0.490 → 4.0.491

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.
@@ -35,7 +35,7 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
35
35
  // ../design/dist/esm/index.mjs
36
36
  import * as React23 from "react";
37
37
  import * as React3 from "react";
38
- import { Fragment as Fragment2, jsx as jsx43 } from "react/jsx-runtime";
38
+ import { Fragment as Fragment22, jsx as jsx43 } from "react/jsx-runtime";
39
39
  import React52, { useCallback as useCallback27, useRef as useRef210, useState as useState22 } from "react";
40
40
 
41
41
  // ../../node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
@@ -4383,13 +4383,12 @@ import { jsx as jsx34 } from "react/jsx-runtime";
4383
4383
  import { jsx as jsx35 } from "react/jsx-runtime";
4384
4384
  import React39, { useMemo as useMemo37 } from "react";
4385
4385
  import { jsx as jsx36 } from "react/jsx-runtime";
4386
- import {
4387
- Children,
4386
+ import React41, {
4388
4387
  forwardRef as forwardRef14,
4389
4388
  useMemo as useMemo38
4390
4389
  } from "react";
4391
4390
  import React40 from "react";
4392
- import { jsx as jsx37 } from "react/jsx-runtime";
4391
+ import { jsx as jsx37, jsxs as jsxs3, Fragment } from "react/jsx-runtime";
4393
4392
  import React42 from "react";
4394
4393
  import { forwardRef as forwardRef16, useCallback as useCallback25, useContext as useContext39 } from "react";
4395
4394
  import {
@@ -5565,7 +5564,7 @@ var getComponentsToAddStacksTo = () => componentsToAddStacksTo;
5565
5564
  var addSequenceStackTraces = (component) => {
5566
5565
  componentsToAddStacksTo.push(component);
5567
5566
  };
5568
- var VERSION = "4.0.490";
5567
+ var VERSION = "4.0.491";
5569
5568
  var checkMultipleRemotionVersions = () => {
5570
5569
  if (typeof globalThis === "undefined") {
5571
5570
  return;
@@ -6178,7 +6177,7 @@ var SequenceManagerRefContext = React11.createContext({
6178
6177
  current: []
6179
6178
  });
6180
6179
  var makeSequencePropsSubscriptionKey = (key) => {
6181
- return `${key.nodePath.join(".")}.${key.sequenceKeys.join(".")}.${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
6180
+ return `${key.absolutePath}\x00${key.nodePath.join(".")}\x00${key.sequenceKeys.join(".")}\x00${key.effectKeys.map((keys) => keys.join(".")).join(".")}`;
6182
6181
  };
6183
6182
  var VisualModePropStatusesContext = React11.createContext({
6184
6183
  propStatuses: {}
@@ -8791,6 +8790,7 @@ var RegularSequenceRefForwardingFunction = ({
8791
8790
  src: isMedia.data.src,
8792
8791
  getStack: () => stackRef.current,
8793
8792
  startMediaFrom: startMediaFrom ?? isMedia.data.startMediaFrom,
8793
+ mediaFrameAtSequenceZero,
8794
8794
  volume: isMedia.data.volumes,
8795
8795
  refForOutline: refForOutline ?? null,
8796
8796
  isInsideSeries,
@@ -8854,6 +8854,7 @@ var RegularSequenceRefForwardingFunction = ({
8854
8854
  isInsideSeries,
8855
8855
  registeredFrozenFrame,
8856
8856
  startMediaFrom,
8857
+ mediaFrameAtSequenceZero,
8857
8858
  frozenMediaFrame
8858
8859
  ]);
8859
8860
  const endThreshold = Math.ceil(cumulatedFrom + from + durationInFrames - 1);
@@ -10804,7 +10805,9 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10804
10805
  return;
10805
10806
  }
10806
10807
  if (data === undefined) {
10807
- current.src = EMPTY_AUDIO;
10808
+ if (current.src !== EMPTY_AUDIO) {
10809
+ current.src = EMPTY_AUDIO;
10810
+ }
10808
10811
  return;
10809
10812
  }
10810
10813
  if (!data) {
@@ -10873,7 +10876,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10873
10876
  if (prevA.id === id) {
10874
10877
  const isTheSame = compareProps(aud, prevA.props) && prevA.premounting === premounting && prevA.postmounting === postmounting;
10875
10878
  if (isTheSame) {
10876
- return prevA;
10879
+ return prevA.audioMounted === audioMounted ? prevA : { ...prevA, audioMounted };
10877
10880
  }
10878
10881
  changed = true;
10879
10882
  return {
@@ -10885,7 +10888,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10885
10888
  audioMounted
10886
10889
  };
10887
10890
  }
10888
- return prevA;
10891
+ return prevA.audioMounted === audioMounted ? prevA : { ...prevA, audioMounted };
10889
10892
  });
10890
10893
  if (changed) {
10891
10894
  rerenderAudios();
@@ -10924,16 +10927,19 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
10924
10927
  unregisterAudio,
10925
10928
  updateAudio
10926
10929
  ]);
10930
+ const sharedAudioTagElements = useMemo21(() => {
10931
+ return refs.map(({ id, ref }) => {
10932
+ return /* @__PURE__ */ jsx19("audio", {
10933
+ ref,
10934
+ preload: "metadata",
10935
+ src: EMPTY_AUDIO
10936
+ }, id);
10937
+ });
10938
+ }, [refs]);
10927
10939
  return /* @__PURE__ */ jsxs2(SharedAudioTagsContext.Provider, {
10928
10940
  value: audioTagsValue,
10929
10941
  children: [
10930
- refs.map(({ id, ref }) => {
10931
- return /* @__PURE__ */ jsx19("audio", {
10932
- ref,
10933
- preload: "metadata",
10934
- src: EMPTY_AUDIO
10935
- }, id);
10936
- }),
10942
+ sharedAudioTagElements,
10937
10943
  children
10938
10944
  ]
10939
10945
  });
@@ -11394,6 +11400,7 @@ var useMediaInTimeline = ({
11394
11400
  showInTimeline: true,
11395
11401
  nonce: nonce.get(),
11396
11402
  startMediaFrom: 0 - startsAt,
11403
+ mediaFrameAtSequenceZero: null,
11397
11404
  doesVolumeChange,
11398
11405
  loopDisplay,
11399
11406
  playbackRate,
@@ -13027,16 +13034,16 @@ var isMissingPaintRecordError = (error2) => {
13027
13034
  return error2 instanceof DOMException && error2.name === "InvalidStateError";
13028
13035
  };
13029
13036
  var missingPaintRecordMessage = "HtmlInCanvas: Expected the element to be inside the viewport during rendering, but Chrome had no cached paint record for it.";
13030
- var resizeOffscreenCanvas = ({
13031
- offscreen,
13037
+ var resizePaintTarget = ({
13038
+ target,
13032
13039
  width,
13033
13040
  height
13034
13041
  }) => {
13035
- if (offscreen.width !== width) {
13036
- offscreen.width = width;
13042
+ if (target.width !== width) {
13043
+ target.width = width;
13037
13044
  }
13038
- if (offscreen.height !== height) {
13039
- offscreen.height = height;
13045
+ if (target.height !== height) {
13046
+ target.height = height;
13040
13047
  }
13041
13048
  };
13042
13049
  var defaultOnPaint = ({
@@ -13052,7 +13059,7 @@ var defaultOnPaint = ({
13052
13059
  const transform = ctx.drawElementImage(elementImage, 0, 0);
13053
13060
  element.style.transform = transform.toString();
13054
13061
  };
13055
- var HtmlInCanvasAncestorContext = createContext23(false);
13062
+ var HtmlInCanvasAncestorContext = createContext23(null);
13056
13063
  var HtmlInCanvasContent = forwardRef9(({
13057
13064
  width,
13058
13065
  height,
@@ -13064,20 +13071,22 @@ var HtmlInCanvasContent = forwardRef9(({
13064
13071
  controls,
13065
13072
  style
13066
13073
  }, ref) => {
13067
- const isInsideAncestorHtmlInCanvas = useContext31(HtmlInCanvasAncestorContext);
13074
+ const ancestor = useContext31(HtmlInCanvasAncestorContext);
13068
13075
  assertHtmlInCanvasDimensions(width, height);
13069
13076
  const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
13070
13077
  const canvasWidth = Math.ceil(width * resolvedPixelDensity);
13071
13078
  const canvasHeight = Math.ceil(height * resolvedPixelDensity);
13072
13079
  const { continueRender: continueRender2, cancelRender: cancelRender2 } = useDelayRender();
13073
- const { isRendering } = useRemotionEnvironment();
13080
+ const { isClientSideRendering, isRendering } = useRemotionEnvironment();
13081
+ const canRetryMissingPaintRecord = !isRendering || isClientSideRendering;
13082
+ const usesDirectLayoutCanvas = onPaint === undefined && onInit === undefined;
13074
13083
  if (!isHtmlInCanvasSupported()) {
13075
13084
  cancelRender2(new Error(HTML_IN_CANVAS_UNSUPPORTED_MESSAGE));
13076
13085
  }
13077
13086
  const canvas2dRef = useRef22(null);
13078
- const offscreenRef = useRef22(null);
13087
+ const paintTargetRef = useRef22(null);
13079
13088
  const divRef = useRef22(null);
13080
- const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}`;
13089
+ const canvasSizeKey = `${width}x${height}@${resolvedPixelDensity}-${usesDirectLayoutCanvas ? "direct" : "offscreen"}`;
13081
13090
  const setLayoutCanvasRef = useCallback16((node) => {
13082
13091
  canvas2dRef.current = node;
13083
13092
  if (typeof ref === "function") {
@@ -13100,17 +13109,19 @@ var HtmlInCanvasContent = forwardRef9(({
13100
13109
  const initializedRef = useRef22(false);
13101
13110
  const onInitCleanupRef = useRef22(null);
13102
13111
  const unmountedRef = useRef22(false);
13112
+ const ancestorRef = useRef22(ancestor);
13113
+ ancestorRef.current = ancestor;
13103
13114
  const onPaintCb = useCallback16(async () => {
13104
13115
  const element = divRef.current;
13105
13116
  if (!element) {
13106
13117
  throw new Error("Canvas or scene element not found");
13107
13118
  }
13108
- const offscreen = offscreenRef.current;
13109
- if (!offscreen) {
13110
- throw new Error("HtmlInCanvas: offscreen canvas not ready (transferControlToOffscreen failed or canvas is remounting)");
13119
+ const paintTarget = paintTargetRef.current;
13120
+ if (!paintTarget) {
13121
+ throw new Error("HtmlInCanvas: paint target is not ready because the canvas is remounting");
13111
13122
  }
13112
- resizeOffscreenCanvas({
13113
- offscreen,
13123
+ resizePaintTarget({
13124
+ target: paintTarget,
13114
13125
  width: canvasWidth,
13115
13126
  height: canvasHeight
13116
13127
  });
@@ -13121,22 +13132,30 @@ var HtmlInCanvasContent = forwardRef9(({
13121
13132
  }
13122
13133
  const handle = delayRender("onPaint");
13123
13134
  if (!initializedRef.current) {
13124
- let initImage = null;
13125
- try {
13126
- initImage = placeholderCanvas.captureElementImage(element);
13127
- } catch (error2) {
13128
- if (isMissingPaintRecordError(error2) && !isRendering) {} else if (isMissingPaintRecordError(error2)) {
13129
- throw new Error(missingPaintRecordMessage);
13130
- } else {
13135
+ const currentOnInit = onInitRef.current;
13136
+ if (!currentOnInit) {
13137
+ initializedRef.current = true;
13138
+ } else {
13139
+ let initImage;
13140
+ try {
13141
+ initImage = placeholderCanvas.captureElementImage(element);
13142
+ } catch (error2) {
13143
+ if (isMissingPaintRecordError(error2) && canRetryMissingPaintRecord) {
13144
+ continueRender2(handle);
13145
+ return;
13146
+ }
13147
+ if (isMissingPaintRecordError(error2)) {
13148
+ throw new Error(missingPaintRecordMessage);
13149
+ }
13131
13150
  throw error2;
13132
13151
  }
13133
- }
13134
- if (initImage) {
13135
13152
  initializedRef.current = true;
13136
- const currentOnInit = onInitRef.current;
13137
- if (currentOnInit) {
13153
+ try {
13154
+ if (paintTarget instanceof HTMLCanvasElement) {
13155
+ throw new Error("HtmlInCanvas: onInit requires an OffscreenCanvas paint target");
13156
+ }
13138
13157
  const cleanup = await currentOnInit({
13139
- canvas: offscreen,
13158
+ canvas: paintTarget,
13140
13159
  element,
13141
13160
  elementImage: initImage,
13142
13161
  pixelDensity: resolvedPixelDensity
@@ -13149,15 +13168,16 @@ var HtmlInCanvasContent = forwardRef9(({
13149
13168
  } else {
13150
13169
  onInitCleanupRef.current = cleanup;
13151
13170
  }
13171
+ } finally {
13172
+ initImage.close();
13152
13173
  }
13153
13174
  }
13154
13175
  }
13155
- const handler = onPaintRef.current ?? defaultOnPaint;
13156
13176
  let elImage;
13157
13177
  try {
13158
13178
  elImage = placeholderCanvas.captureElementImage(element);
13159
13179
  } catch (error2) {
13160
- if (isMissingPaintRecordError(error2) && !isRendering) {
13180
+ if (isMissingPaintRecordError(error2) && canRetryMissingPaintRecord) {
13161
13181
  continueRender2(handle);
13162
13182
  return;
13163
13183
  }
@@ -13166,20 +13186,41 @@ var HtmlInCanvasContent = forwardRef9(({
13166
13186
  }
13167
13187
  throw error2;
13168
13188
  }
13169
- await handler({
13170
- canvas: offscreen,
13171
- element,
13172
- elementImage: elImage,
13173
- pixelDensity: resolvedPixelDensity
13174
- });
13175
- await runEffectChain({
13176
- state: chainState.get(canvasWidth, canvasHeight),
13177
- source: offscreen,
13178
- effects: effectsRef.current,
13179
- output: offscreen,
13180
- width: canvasWidth,
13181
- height: canvasHeight
13182
- });
13189
+ try {
13190
+ const currentOnPaint = onPaintRef.current;
13191
+ if (currentOnPaint) {
13192
+ if (paintTarget instanceof HTMLCanvasElement) {
13193
+ throw new Error("HtmlInCanvas: onPaint requires an OffscreenCanvas paint target");
13194
+ }
13195
+ const paintResult = currentOnPaint({
13196
+ canvas: paintTarget,
13197
+ element,
13198
+ elementImage: elImage,
13199
+ pixelDensity: resolvedPixelDensity
13200
+ });
13201
+ if (paintResult) {
13202
+ await paintResult;
13203
+ }
13204
+ } else {
13205
+ defaultOnPaint({
13206
+ canvas: paintTarget,
13207
+ element,
13208
+ elementImage: elImage,
13209
+ pixelDensity: resolvedPixelDensity
13210
+ });
13211
+ }
13212
+ await runEffectChain({
13213
+ state: chainState.get(canvasWidth, canvasHeight),
13214
+ source: paintTarget,
13215
+ effects: effectsRef.current,
13216
+ output: paintTarget,
13217
+ width: canvasWidth,
13218
+ height: canvasHeight
13219
+ });
13220
+ } finally {
13221
+ elImage.close();
13222
+ }
13223
+ ancestorRef.current?.requestParentPaint();
13183
13224
  continueRender2(handle);
13184
13225
  } catch (error2) {
13185
13226
  cancelRender2(error2);
@@ -13191,7 +13232,7 @@ var HtmlInCanvasContent = forwardRef9(({
13191
13232
  continueRender2,
13192
13233
  cancelRender2,
13193
13234
  resolvedPixelDensity,
13194
- isRendering
13235
+ canRetryMissingPaintRecord
13195
13236
  ]);
13196
13237
  useLayoutEffect9(() => {
13197
13238
  const placeholder = canvas2dRef.current;
@@ -13199,10 +13240,10 @@ var HtmlInCanvasContent = forwardRef9(({
13199
13240
  throw new Error("Canvas not found");
13200
13241
  }
13201
13242
  placeholder.layoutSubtree = true;
13202
- const offscreen = placeholder.transferControlToOffscreen();
13203
- offscreenRef.current = offscreen;
13204
- resizeOffscreenCanvas({
13205
- offscreen,
13243
+ const paintTarget = usesDirectLayoutCanvas ? placeholder : placeholder.transferControlToOffscreen();
13244
+ paintTargetRef.current = paintTarget;
13245
+ resizePaintTarget({
13246
+ target: paintTarget,
13206
13247
  width: canvasWidth,
13207
13248
  height: canvasHeight
13208
13249
  });
@@ -13211,13 +13252,19 @@ var HtmlInCanvasContent = forwardRef9(({
13211
13252
  placeholder.addEventListener("paint", onPaintCb);
13212
13253
  return () => {
13213
13254
  placeholder.removeEventListener("paint", onPaintCb);
13214
- offscreenRef.current = null;
13255
+ paintTargetRef.current = null;
13215
13256
  initializedRef.current = false;
13216
13257
  unmountedRef.current = true;
13217
13258
  onInitCleanupRef.current?.();
13218
13259
  onInitCleanupRef.current = null;
13219
13260
  };
13220
- }, [onPaintCb, cancelRender2, canvasWidth, canvasHeight]);
13261
+ }, [
13262
+ onPaintCb,
13263
+ cancelRender2,
13264
+ canvasWidth,
13265
+ canvasHeight,
13266
+ usesDirectLayoutCanvas
13267
+ ]);
13221
13268
  const onPaintChangedRef = useRef22(false);
13222
13269
  useLayoutEffect9(() => {
13223
13270
  if (!onPaintChangedRef.current) {
@@ -13256,11 +13303,15 @@ var HtmlInCanvasContent = forwardRef9(({
13256
13303
  ...style ?? {}
13257
13304
  };
13258
13305
  }, [height, style, width]);
13259
- if (isInsideAncestorHtmlInCanvas) {
13260
- throw new Error("<HtmlInCanvas> effects cannot be nested together. Chrome will only display the outer effect. Consider merging the effects into one if you can.");
13261
- }
13306
+ const ancestorValue = useMemo30(() => {
13307
+ return {
13308
+ requestParentPaint: () => {
13309
+ canvas2dRef.current?.requestPaint?.();
13310
+ }
13311
+ };
13312
+ }, []);
13262
13313
  return /* @__PURE__ */ jsx25(HtmlInCanvasAncestorContext.Provider, {
13263
- value: true,
13314
+ value: ancestorValue,
13264
13315
  children: /* @__PURE__ */ jsx25("canvas", {
13265
13316
  ref: setLayoutCanvasRef,
13266
13317
  width: canvasWidth,
@@ -15630,66 +15681,130 @@ var flattenChildren = (children) => {
15630
15681
  return flatChildren;
15631
15682
  }, []);
15632
15683
  };
15633
- var SeriesSequenceRefForwardingFunction = ({ children }, _ref) => {
15684
+ var seriesSequenceSchema = {
15685
+ durationInFrames: Interactive.baseSchema.durationInFrames,
15686
+ name: Interactive.sequenceSchema.name,
15687
+ hidden: Interactive.sequenceSchema.hidden,
15688
+ showInTimeline: Interactive.sequenceSchema.showInTimeline,
15689
+ freeze: Interactive.baseSchema.freeze,
15690
+ layout: Interactive.sequenceSchema.layout
15691
+ };
15692
+ var SeriesSequenceInner = forwardRef14(({
15693
+ offset = 0,
15694
+ className = "",
15695
+ stack = null,
15696
+ _remotionInternalRender = null,
15697
+ ...props2
15698
+ }, ref) => {
15634
15699
  useRequireToBeInsideSeries();
15700
+ if (_remotionInternalRender) {
15701
+ return _remotionInternalRender({ ...props2, offset, className: className || undefined, stack }, ref);
15702
+ }
15635
15703
  return /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
15636
- children
15704
+ children: props2.children
15637
15705
  });
15638
- };
15639
- var SeriesSequence = forwardRef14(SeriesSequenceRefForwardingFunction);
15706
+ });
15707
+ var SeriesSequence = Interactive.withSchema({
15708
+ Component: SeriesSequenceInner,
15709
+ componentName: "<Series.Sequence>",
15710
+ componentIdentity: "dev.remotion.remotion.Series.Sequence",
15711
+ schema: seriesSequenceSchema,
15712
+ supportsEffects: false
15713
+ });
15640
15714
  var SequenceWithoutSchemaWithRef = SequenceWithoutSchema;
15715
+ var validateSeriesSequenceProps = ({
15716
+ durationInFrames,
15717
+ offset: offsetProp,
15718
+ index,
15719
+ childrenLength
15720
+ }) => {
15721
+ const debugInfo = `index = ${index}, duration = ${durationInFrames}`;
15722
+ if (index !== childrenLength - 1 || durationInFrames !== Infinity) {
15723
+ validateDurationInFrames(durationInFrames, {
15724
+ component: `of a <Series.Sequence /> component`,
15725
+ allowFloats: true
15726
+ });
15727
+ }
15728
+ const offset = offsetProp ?? 0;
15729
+ if (Number.isNaN(offset)) {
15730
+ throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
15731
+ }
15732
+ if (!Number.isFinite(offset)) {
15733
+ throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
15734
+ }
15735
+ if (offset % 1 !== 0) {
15736
+ throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
15737
+ }
15738
+ return offset;
15739
+ };
15641
15740
  var SeriesInner = (props2) => {
15642
15741
  const childrenValue = useMemo38(() => {
15643
- let startFrame = 0;
15644
15742
  const flattenedChildren = flattenChildren(props2.children);
15645
- return Children.map(flattenedChildren, (child, i) => {
15743
+ const renderChildren = (i, startFrame) => {
15744
+ if (i === flattenedChildren.length) {
15745
+ return null;
15746
+ }
15747
+ const child = flattenedChildren[i];
15646
15748
  const castedChild = child;
15647
15749
  if (typeof castedChild === "string") {
15648
15750
  if (castedChild.trim() === "") {
15649
- return null;
15751
+ return renderChildren(i + 1, startFrame);
15650
15752
  }
15651
15753
  throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but you passed a string "${castedChild}"`);
15652
15754
  }
15653
15755
  if (castedChild.type !== SeriesSequence) {
15654
15756
  throw new TypeError(`The <Series /> component only accepts a list of <Series.Sequence /> components as its children, but got ${castedChild} instead`);
15655
15757
  }
15656
- const debugInfo = `index = ${i}, duration = ${castedChild.props.durationInFrames}`;
15657
- const durationInFramesProp = castedChild.props.durationInFrames;
15658
- const {
15659
- durationInFrames,
15660
- children: _children,
15661
- from,
15662
- name,
15663
- ...passedProps
15664
- } = castedChild.props;
15665
- if (i !== flattenedChildren.length - 1 || durationInFramesProp !== Infinity) {
15666
- validateDurationInFrames(durationInFramesProp, {
15667
- component: `of a <Series.Sequence /> component`,
15668
- allowFloats: true
15669
- });
15670
- }
15671
- const offset = castedChild.props.offset ?? 0;
15672
- if (Number.isNaN(offset)) {
15673
- throw new TypeError(`The "offset" property of a <Series.Sequence /> must not be NaN, but got NaN (${debugInfo}).`);
15674
- }
15675
- if (!Number.isFinite(offset)) {
15676
- throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
15677
- }
15678
- if (offset % 1 !== 0) {
15679
- throw new TypeError(`The "offset" property of a <Series.Sequence /> must be finite, but got ${offset} (${debugInfo}).`);
15680
- }
15681
- const currentStartFrame = startFrame + offset;
15682
- startFrame += durationInFramesProp + offset;
15683
- return /* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
15684
- ref: castedChild.ref,
15685
- name: name || "<Series.Sequence>",
15686
- _remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
15687
- from: currentStartFrame,
15688
- durationInFrames: durationInFramesProp,
15689
- ...passedProps,
15690
- children: child
15758
+ const castedElement = castedChild;
15759
+ validateSeriesSequenceProps({
15760
+ durationInFrames: castedElement.props.durationInFrames,
15761
+ offset: castedElement.props.offset,
15762
+ index: i,
15763
+ childrenLength: flattenedChildren.length
15691
15764
  });
15692
- });
15765
+ return React41.cloneElement(castedElement, {
15766
+ _remotionInternalRender: (resolvedProps, ref) => {
15767
+ const durationInFramesProp = resolvedProps.durationInFrames;
15768
+ const {
15769
+ durationInFrames: _durationInFrames,
15770
+ children: sequenceChildren,
15771
+ offset: offsetProp,
15772
+ controls,
15773
+ stack,
15774
+ from: _from,
15775
+ name,
15776
+ ...passedProps
15777
+ } = resolvedProps;
15778
+ const offset = validateSeriesSequenceProps({
15779
+ durationInFrames: durationInFramesProp,
15780
+ offset: offsetProp,
15781
+ index: i,
15782
+ childrenLength: flattenedChildren.length
15783
+ });
15784
+ const currentStartFrame = startFrame + offset;
15785
+ const nextStartFrame = startFrame + durationInFramesProp + offset;
15786
+ return /* @__PURE__ */ jsxs3(Fragment, {
15787
+ children: [
15788
+ /* @__PURE__ */ jsx37(SequenceWithoutSchemaWithRef, {
15789
+ ref,
15790
+ name: name || "<Series.Sequence>",
15791
+ _remotionInternalDocumentationLink: name ? undefined : "https://www.remotion.dev/docs/series",
15792
+ _remotionInternalStack: stack ?? undefined,
15793
+ controls: controls ?? undefined,
15794
+ from: currentStartFrame,
15795
+ durationInFrames: durationInFramesProp,
15796
+ ...passedProps,
15797
+ children: /* @__PURE__ */ jsx37(IsNotInsideSeriesProvider, {
15798
+ children: sequenceChildren
15799
+ })
15800
+ }),
15801
+ renderChildren(i + 1, nextStartFrame)
15802
+ ]
15803
+ });
15804
+ }
15805
+ });
15806
+ };
15807
+ return renderChildren(0, 0);
15693
15808
  }, [props2.children]);
15694
15809
  return /* @__PURE__ */ jsx37(IsInsideSeriesContainer, {
15695
15810
  children: /* @__PURE__ */ jsx37(Sequence, {
@@ -16290,7 +16405,7 @@ addSequenceStackTraces(Folder);
16290
16405
  // ../shapes/dist/esm/index.mjs
16291
16406
  import React, { useCallback as useCallback26, useMemo as useMemo40, useRef as useRef29 } from "react";
16292
16407
  import { version } from "react-dom";
16293
- import { jsx as jsx40, jsxs as jsxs3 } from "react/jsx-runtime";
16408
+ import { jsx as jsx40, jsxs as jsxs4 } from "react/jsx-runtime";
16294
16409
  import { jsx as jsx210 } from "react/jsx-runtime";
16295
16410
  import { jsx as jsx310 } from "react/jsx-runtime";
16296
16411
  import { jsx as jsx42 } from "react/jsx-runtime";
@@ -16492,7 +16607,7 @@ var RenderSvg = ({
16492
16607
  const memoizedEffectDefinitions = Internals.useMemoizedEffectDefinitions(effects);
16493
16608
  const videoConfig = Internals.useUnsafeVideoConfig();
16494
16609
  const reactSupportsTransformOrigin = doesReactSupportTransformOriginProperty(version);
16495
- const svg = /* @__PURE__ */ jsxs3("svg", {
16610
+ const svg = /* @__PURE__ */ jsxs4("svg", {
16496
16611
  ref: effects.length === 0 || !videoConfig ? setSvgRef : undefined,
16497
16612
  width,
16498
16613
  height,
@@ -16518,7 +16633,7 @@ var RenderSvg = ({
16518
16633
  }
16519
16634
  const prevX = prevInstruction.x;
16520
16635
  const prevY = prevInstruction.y;
16521
- return /* @__PURE__ */ jsxs3(React.Fragment, {
16636
+ return /* @__PURE__ */ jsxs4(React.Fragment, {
16522
16637
  children: [
16523
16638
  /* @__PURE__ */ jsx40("path", {
16524
16639
  d: `M ${prevX} ${prevY} ${i.cp1x} ${i.cp1y}`,
@@ -19200,7 +19315,7 @@ var extrudeAndTransformElement = (options) => {
19200
19315
 
19201
19316
  // ../design/dist/esm/index.mjs
19202
19317
  import { jsx as jsx212, Fragment as Fragment3 } from "react/jsx-runtime";
19203
- import { jsx as jsx312, jsxs as jsxs5 } from "react/jsx-runtime";
19318
+ import { jsx as jsx312, jsxs as jsxs6 } from "react/jsx-runtime";
19204
19319
  import { useEffect as useEffect22, useMemo as useMemo210, useRef as useRef31 } from "react";
19205
19320
  import { jsx as jsx44 } from "react/jsx-runtime";
19206
19321
  import { jsx as jsx53, jsxs as jsxs22 } from "react/jsx-runtime";
@@ -19259,11 +19374,11 @@ import * as React302 from "react";
19259
19374
  import * as React342 from "react";
19260
19375
  import * as React332 from "react";
19261
19376
  import * as React322 from "react";
19262
- import { Fragment as Fragment8, jsx as jsx242, jsxs as jsxs4 } from "react/jsx-runtime";
19377
+ import { Fragment as Fragment8, jsx as jsx242, jsxs as jsxs42 } from "react/jsx-runtime";
19263
19378
  import { forwardRef as forwardRef142, createElement as createElement7 } from "react";
19264
19379
  import { forwardRef as forwardRef132, createElement as createElement6 } from "react";
19265
19380
  import * as React372 from "react";
19266
- import { jsx as jsx252, jsxs as jsxs52 } from "react/jsx-runtime";
19381
+ import { jsx as jsx252, jsxs as jsxs5 } from "react/jsx-runtime";
19267
19382
  import { jsx as jsx262 } from "react/jsx-runtime";
19268
19383
  import * as React49 from "react";
19269
19384
  import * as React38 from "react";
@@ -19271,12 +19386,12 @@ import { jsx as jsx272 } from "react/jsx-runtime";
19271
19386
  import * as React47 from "react";
19272
19387
  import React402 from "react";
19273
19388
  import * as React392 from "react";
19274
- import { Fragment as Fragment22, jsx as jsx282 } from "react/jsx-runtime";
19389
+ import { Fragment as Fragment222, jsx as jsx282 } from "react/jsx-runtime";
19275
19390
  import { jsx as jsx292 } from "react/jsx-runtime";
19276
19391
  import React210 from "react";
19277
19392
  import { jsx as jsx2102 } from "react/jsx-runtime";
19278
19393
  import * as React422 from "react";
19279
- import * as React41 from "react";
19394
+ import * as React412 from "react";
19280
19395
  import * as React43 from "react";
19281
19396
  import * as ReactDOM5 from "react-dom";
19282
19397
  import { jsx as jsx302 } from "react/jsx-runtime";
@@ -19386,7 +19501,7 @@ function createSlotClone(ownerName) {
19386
19501
  var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
19387
19502
  function createSlottable(ownerName) {
19388
19503
  const Slottable2 = ({ children }) => {
19389
- return /* @__PURE__ */ jsx43(Fragment2, { children });
19504
+ return /* @__PURE__ */ jsx43(Fragment22, { children });
19390
19505
  };
19391
19506
  Slottable2.displayName = `${ownerName}.Slottable`;
19392
19507
  Slottable2.__radixId = SLOTTABLE_IDENTIFIER;
@@ -19683,7 +19798,7 @@ var Outer = ({
19683
19798
  description: "rect",
19684
19799
  transformations: centerOriented
19685
19800
  });
19686
- return /* @__PURE__ */ jsxs5("div", {
19801
+ return /* @__PURE__ */ jsxs6("div", {
19687
19802
  className: "relative",
19688
19803
  style: { width, height },
19689
19804
  children: [
@@ -23731,7 +23846,7 @@ var Select = (props) => {
23731
23846
  const isFormControl = trigger ? Boolean(trigger.closest("form")) : true;
23732
23847
  const [nativeOptionsSet, setNativeOptionsSet] = React36.useState(/* @__PURE__ */ new Set);
23733
23848
  const nativeSelectKey = Array.from(nativeOptionsSet).map((option) => option.props.value).join(";");
23734
- return /* @__PURE__ */ jsx242(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs4(SelectProvider, {
23849
+ return /* @__PURE__ */ jsx242(Root22, { ...popperScope, children: /* @__PURE__ */ jsxs42(SelectProvider, {
23735
23850
  required,
23736
23851
  scope: __scopeSelect,
23737
23852
  trigger,
@@ -23763,7 +23878,7 @@ var Select = (props) => {
23763
23878
  }, []),
23764
23879
  children
23765
23880
  }) }),
23766
- isFormControl ? /* @__PURE__ */ jsxs4(BubbleSelect, {
23881
+ isFormControl ? /* @__PURE__ */ jsxs42(BubbleSelect, {
23767
23882
  "aria-hidden": true,
23768
23883
  required,
23769
23884
  tabIndex: -1,
@@ -24271,7 +24386,7 @@ var SelectViewport = React36.forwardRef((props, forwardedRef) => {
24271
24386
  const viewportContext = useSelectViewportContext(VIEWPORT_NAME, __scopeSelect);
24272
24387
  const composedRefs = useComposedRefs2(forwardedRef, contentContext.onViewportChange);
24273
24388
  const prevScrollTopRef = React36.useRef(0);
24274
- return /* @__PURE__ */ jsxs4(Fragment8, { children: [
24389
+ return /* @__PURE__ */ jsxs42(Fragment8, { children: [
24275
24390
  /* @__PURE__ */ jsx242("style", {
24276
24391
  dangerouslySetInnerHTML: {
24277
24392
  __html: `[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`
@@ -24428,7 +24543,7 @@ var SelectItemText = React36.forwardRef((props, forwardedRef) => {
24428
24543
  onNativeOptionAdd(nativeOption);
24429
24544
  return () => onNativeOptionRemove(nativeOption);
24430
24545
  }, [onNativeOptionAdd, onNativeOptionRemove, nativeOption]);
24431
- return /* @__PURE__ */ jsxs4(Fragment8, { children: [
24546
+ return /* @__PURE__ */ jsxs42(Fragment8, { children: [
24432
24547
  /* @__PURE__ */ jsx242(Primitive.span, { id: itemContext.textId, ...itemTextProps, ref: composedRefs }),
24433
24548
  itemContext.isSelected && context.valueNode && !context.valueNodeHasChildren ? ReactDOM4.createPortal(itemTextProps.children, context.valueNode) : null
24434
24549
  ] });
@@ -24687,7 +24802,7 @@ var ChevronDown = createLucideIcon("ChevronDown", [
24687
24802
  var ChevronUp = createLucideIcon("ChevronUp", [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]);
24688
24803
  var Select2 = Root222;
24689
24804
  var SelectValue2 = Value;
24690
- var SelectTrigger2 = React372.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs52(Trigger, {
24805
+ var SelectTrigger2 = React372.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Trigger, {
24691
24806
  ref,
24692
24807
  className: cn("flex h-10 w-full items-center justify-between rounded-md border-black border-2 border-b-4 bg-card-bg px-3 py-5 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 font-brand", className),
24693
24808
  ...props,
@@ -24721,7 +24836,7 @@ var SelectScrollDownButton2 = React372.forwardRef(({ className, ...props }, ref)
24721
24836
  }));
24722
24837
  SelectScrollDownButton2.displayName = ScrollDownButton.displayName;
24723
24838
  var SelectContent2 = React372.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx252(Portal2, {
24724
- children: /* @__PURE__ */ jsxs52(Content2, {
24839
+ children: /* @__PURE__ */ jsxs5(Content2, {
24725
24840
  ref,
24726
24841
  className: cn(" border-2 border-black relative z-50 max-h-96 min-w-32 overflow-hidden rounded-md font-brand bg-card-bg text-text shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", className),
24727
24842
  position,
@@ -24743,7 +24858,7 @@ var SelectLabel2 = React372.forwardRef(({ className, ...props }, ref) => /* @__P
24743
24858
  ...props
24744
24859
  }));
24745
24860
  SelectLabel2.displayName = Label.displayName;
24746
- var SelectItem2 = React372.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs52(Item, {
24861
+ var SelectItem2 = React372.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs5(Item, {
24747
24862
  ref,
24748
24863
  className: cn("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-hidden focus:bg-slate-200 dark:focus:bg-white/10 data-disabled:pointer-events-none data-disabled:opacity-50 font-brand", className),
24749
24864
  ...props,
@@ -25285,7 +25400,7 @@ function toSafeIndex(array, index2) {
25285
25400
  function toSafeInteger(number) {
25286
25401
  return number !== number || number === 0 ? 0 : Math.trunc(number);
25287
25402
  }
25288
- var useLayoutEffect222 = globalThis?.document ? React41.useLayoutEffect : () => {};
25403
+ var useLayoutEffect222 = globalThis?.document ? React412.useLayoutEffect : () => {};
25289
25404
  var useReactId2 = React422[" useId ".trim().toString()] || (() => {
25290
25405
  return;
25291
25406
  });
@@ -26011,7 +26126,7 @@ var useHeartAnimation = () => {
26011
26126
  };
26012
26127
 
26013
26128
  // src/components/prompts/CardLikeButton.tsx
26014
- import { jsx as jsx45, jsxs as jsxs6 } from "react/jsx-runtime";
26129
+ import { jsx as jsx45, jsxs as jsxs7 } from "react/jsx-runtime";
26015
26130
  var CardLikeButton = ({ submissionId, initialLikeCount }) => {
26016
26131
  const [liked, setLiked] = useState41(false);
26017
26132
  const [likeCount, setLikeCount] = useState41(initialLikeCount);
@@ -26046,7 +26161,7 @@ var CardLikeButton = ({ submissionId, initialLikeCount }) => {
26046
26161
  } catch {}
26047
26162
  }
26048
26163
  }, [liked, submissionId, animate]);
26049
- return /* @__PURE__ */ jsxs6("button", {
26164
+ return /* @__PURE__ */ jsxs7("button", {
26050
26165
  onClick,
26051
26166
  className: "flex items-center bg-transparent border-none cursor-pointer p-0",
26052
26167
  type: "button",
@@ -26084,7 +26199,7 @@ var Page = ({ children, className, onDrop, onDragOver }) => {
26084
26199
  };
26085
26200
 
26086
26201
  // src/components/prompts/PromptsGallery.tsx
26087
- import { jsx as jsx47, jsxs as jsxs7 } from "react/jsx-runtime";
26202
+ import { jsx as jsx47, jsxs as jsxs8 } from "react/jsx-runtime";
26088
26203
  var PromptSubmissionCard = ({ promptSubmission }) => {
26089
26204
  const [hovered, setHovered] = useState42(false);
26090
26205
  const [inView, setInView] = useState42(false);
@@ -26108,7 +26223,7 @@ var PromptSubmissionCard = ({ promptSubmission }) => {
26108
26223
  className: "block no-underline hover:no-underline",
26109
26224
  onMouseEnter: () => setHovered(true),
26110
26225
  onMouseLeave: () => setHovered(false),
26111
- children: /* @__PURE__ */ jsxs7(Card, {
26226
+ children: /* @__PURE__ */ jsxs8(Card, {
26112
26227
  className: "overflow-hidden hover:shadow-md transition-shadow",
26113
26228
  children: [
26114
26229
  /* @__PURE__ */ jsx47("div", {
@@ -26119,17 +26234,17 @@ var PromptSubmissionCard = ({ promptSubmission }) => {
26119
26234
  alt: promptSubmission.title
26120
26235
  })
26121
26236
  }),
26122
- /* @__PURE__ */ jsxs7("div", {
26237
+ /* @__PURE__ */ jsxs8("div", {
26123
26238
  className: "p-4",
26124
26239
  children: [
26125
26240
  /* @__PURE__ */ jsx47("h3", {
26126
26241
  className: "font-brand font-bold text-lg truncate",
26127
26242
  children: promptSubmission.title
26128
26243
  }),
26129
- /* @__PURE__ */ jsxs7("div", {
26244
+ /* @__PURE__ */ jsxs8("div", {
26130
26245
  className: "flex items-center justify-between mt-1",
26131
26246
  children: [
26132
- /* @__PURE__ */ jsxs7("div", {
26247
+ /* @__PURE__ */ jsxs8("div", {
26133
26248
  className: "flex items-center gap-2",
26134
26249
  children: [
26135
26250
  avatarUrl && /* @__PURE__ */ jsx47("img", {
@@ -26183,7 +26298,7 @@ var Pagination = ({ currentPage, totalPages }) => {
26183
26298
  }
26184
26299
  return pages;
26185
26300
  };
26186
- return /* @__PURE__ */ jsxs7("div", {
26301
+ return /* @__PURE__ */ jsxs8("div", {
26187
26302
  className: "flex items-center justify-center gap-4 mt-12 font-brand text-sm",
26188
26303
  children: [
26189
26304
  currentPage > 1 ? /* @__PURE__ */ jsx47("a", {
@@ -26220,17 +26335,17 @@ var Pagination = ({ currentPage, totalPages }) => {
26220
26335
  var PromptsGalleryPage = ({ promptSubmissions, currentPage, totalPages }) => {
26221
26336
  return /* @__PURE__ */ jsx47(Page, {
26222
26337
  className: "flex-col",
26223
- children: /* @__PURE__ */ jsxs7("div", {
26338
+ children: /* @__PURE__ */ jsxs8("div", {
26224
26339
  className: "m-auto max-w-[1200px] w-full px-4 py-12",
26225
26340
  children: [
26226
- /* @__PURE__ */ jsxs7("div", {
26341
+ /* @__PURE__ */ jsxs8("div", {
26227
26342
  className: "mb-8",
26228
26343
  children: [
26229
26344
  /* @__PURE__ */ jsx47("h1", {
26230
26345
  className: "text-3xl font-brand font-black",
26231
26346
  children: "Prompt Showcase"
26232
26347
  }),
26233
- /* @__PURE__ */ jsxs7("p", {
26348
+ /* @__PURE__ */ jsxs8("p", {
26234
26349
  className: "font-brand text-muted-foreground mt-4 max-w-[700px]",
26235
26350
  children: [
26236
26351
  "See what the community has built using",
@@ -26248,7 +26363,7 @@ var PromptsGalleryPage = ({ promptSubmissions, currentPage, totalPages }) => {
26248
26363
  }),
26249
26364
  /* @__PURE__ */ jsx47("div", {
26250
26365
  className: "flex items-center gap-2",
26251
- children: /* @__PURE__ */ jsxs7(Button, {
26366
+ children: /* @__PURE__ */ jsxs8(Button, {
26252
26367
  href: "/docs/ai/coding-agents",
26253
26368
  className: "font-brand rounded-full bg-[#D97757] flex items-center text-white",
26254
26369
  children: [