@remotion/promo-pages 4.0.498 → 4.0.500

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/team.js CHANGED
@@ -1559,7 +1559,7 @@ var getDefaultConfig = () => {
1559
1559
  var twMerge = /* @__PURE__ */ createTailwindMerge(getDefaultConfig);
1560
1560
 
1561
1561
  // ../design/dist/esm/index.mjs
1562
- import React33, { useEffect as useEffect21, useMemo as useMemo43, useState as useState23 } from "react";
1562
+ import React33, { useEffect as useEffect21, useMemo as useMemo44, useState as useState23 } from "react";
1563
1563
 
1564
1564
  // ../paths/dist/esm/index.mjs
1565
1565
  var cutLInstruction = ({
@@ -4395,8 +4395,9 @@ import {
4395
4395
  useRef as useRef9,
4396
4396
  useState as useState6
4397
4397
  } from "react";
4398
- import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo17, useRef as useRef8 } from "react";
4399
- import { useEffect as useEffect4, useMemo as useMemo16, useRef as useRef7 } from "react";
4398
+ import { useMemo as useMemo16 } from "react";
4399
+ import React16, { useCallback as useCallback7, useImperativeHandle, useMemo as useMemo18, useRef as useRef8 } from "react";
4400
+ import { useEffect as useEffect4, useMemo as useMemo17, useRef as useRef7 } from "react";
4400
4401
  import { jsx as jsx13 } from "react/jsx-runtime";
4401
4402
  import { jsx as jsx14 } from "react/jsx-runtime";
4402
4403
  import { useContext as useContext19, useLayoutEffect as useLayoutEffect4, useState as useState8 } from "react";
@@ -4405,18 +4406,18 @@ import {
4405
4406
  useCallback as useCallback8,
4406
4407
  useImperativeHandle as useImperativeHandle3,
4407
4408
  useLayoutEffect as useLayoutEffect3,
4408
- useMemo as useMemo18,
4409
+ useMemo as useMemo19,
4409
4410
  useRef as useRef10,
4410
4411
  useState as useState7
4411
4412
  } from "react";
4412
4413
  import { jsx as jsx15 } from "react/jsx-runtime";
4413
4414
  import { forwardRef as forwardRef7, useCallback as useCallback14, useContext as useContext31 } from "react";
4414
- import React17, { createContext as createContext18, useMemo as useMemo19 } from "react";
4415
+ import React17, { createContext as createContext18, useMemo as useMemo20 } from "react";
4415
4416
  import { jsx as jsx16 } from "react/jsx-runtime";
4416
4417
  import { useContext as useContext20 } from "react";
4417
4418
  import { createContext as createContext19, useEffect as useEffect6, useState as useState9 } from "react";
4418
4419
  import { jsx as jsx17 } from "react/jsx-runtime";
4419
- import { createContext as createContext20, useMemo as useMemo20, useReducer } from "react";
4420
+ import { createContext as createContext20, useMemo as useMemo21, useReducer } from "react";
4420
4421
  import { jsx as jsx18 } from "react/jsx-runtime";
4421
4422
  import { useCallback as useCallback13 } from "react";
4422
4423
  import React23, {
@@ -4424,7 +4425,7 @@ import React23, {
4424
4425
  useContext as useContext29,
4425
4426
  useEffect as useEffect14,
4426
4427
  useImperativeHandle as useImperativeHandle4,
4427
- useMemo as useMemo28,
4428
+ useMemo as useMemo29,
4428
4429
  useRef as useRef19,
4429
4430
  useState as useState14
4430
4431
  } from "react";
@@ -4435,14 +4436,14 @@ import React20, {
4435
4436
  useCallback as useCallback9,
4436
4437
  useContext as useContext21,
4437
4438
  useEffect as useEffect7,
4438
- useMemo as useMemo22,
4439
+ useMemo as useMemo23,
4439
4440
  useRef as useRef12,
4440
4441
  useState as useState10
4441
4442
  } from "react";
4442
- import { useMemo as useMemo21, useRef as useRef11 } from "react";
4443
+ import { useMemo as useMemo22, useRef as useRef11 } from "react";
4443
4444
  import { jsx as jsx19, jsxs as jsxs22 } from "react/jsx-runtime";
4444
4445
  import { useRef as useRef13 } from "react";
4445
- import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo23, useState as useState11 } from "react";
4446
+ import { useContext as useContext24, useEffect as useEffect8, useMemo as useMemo24, useState as useState11 } from "react";
4446
4447
  import { useContext as useContext23 } from "react";
4447
4448
  import {
4448
4449
  useCallback as useCallback12,
@@ -4451,14 +4452,14 @@ import {
4451
4452
  useLayoutEffect as useLayoutEffect7,
4452
4453
  useRef as useRef18
4453
4454
  } from "react";
4454
- import { useCallback as useCallback11, useMemo as useMemo26, useRef as useRef16 } from "react";
4455
- import { useContext as useContext26, useMemo as useMemo25 } from "react";
4455
+ import { useCallback as useCallback11, useMemo as useMemo27, useRef as useRef16 } from "react";
4456
+ import { useContext as useContext26, useMemo as useMemo26 } from "react";
4456
4457
  import React21, {
4457
4458
  useCallback as useCallback10,
4458
4459
  useContext as useContext25,
4459
4460
  useEffect as useEffect9,
4460
4461
  useLayoutEffect as useLayoutEffect6,
4461
- useMemo as useMemo24,
4462
+ useMemo as useMemo25,
4462
4463
  useRef as useRef15,
4463
4464
  useState as useState12
4464
4465
  } from "react";
@@ -4467,7 +4468,7 @@ import React22 from "react";
4467
4468
  import { useEffect as useEffect10, useState as useState13 } from "react";
4468
4469
  import { useEffect as useEffect11, useRef as useRef17 } from "react";
4469
4470
  import { useEffect as useEffect13 } from "react";
4470
- import { createContext as createContext22, useContext as useContext28, useMemo as useMemo27 } from "react";
4471
+ import { createContext as createContext22, useContext as useContext28, useMemo as useMemo28 } from "react";
4471
4472
  import { jsx as jsx21 } from "react/jsx-runtime";
4472
4473
  import {
4473
4474
  forwardRef as forwardRef6,
@@ -4475,7 +4476,7 @@ import {
4475
4476
  useEffect as useEffect15,
4476
4477
  useImperativeHandle as useImperativeHandle5,
4477
4478
  useLayoutEffect as useLayoutEffect8,
4478
- useMemo as useMemo29,
4479
+ useMemo as useMemo30,
4479
4480
  useRef as useRef20
4480
4481
  } from "react";
4481
4482
  import { jsx as jsx222 } from "react/jsx-runtime";
@@ -4485,7 +4486,7 @@ import {
4485
4486
  useCallback as useCallback15,
4486
4487
  useEffect as useEffect16,
4487
4488
  useImperativeHandle as useImperativeHandle6,
4488
- useMemo as useMemo30,
4489
+ useMemo as useMemo31,
4489
4490
  useRef as useRef21,
4490
4491
  useState as useState15
4491
4492
  } from "react";
@@ -4496,7 +4497,7 @@ import {
4496
4497
  useCallback as useCallback16,
4497
4498
  useContext as useContext32,
4498
4499
  useLayoutEffect as useLayoutEffect9,
4499
- useMemo as useMemo31,
4500
+ useMemo as useMemo32,
4500
4501
  useRef as useRef22
4501
4502
  } from "react";
4502
4503
  import { jsx as jsx25 } from "react/jsx-runtime";
@@ -4506,7 +4507,7 @@ import {
4506
4507
  useContext as useContext33,
4507
4508
  useImperativeHandle as useImperativeHandle7,
4508
4509
  useLayoutEffect as useLayoutEffect10,
4509
- useMemo as useMemo32,
4510
+ useMemo as useMemo33,
4510
4511
  useRef as useRef23,
4511
4512
  useState as useState16
4512
4513
  } from "react";
@@ -4528,14 +4529,14 @@ import React31 from "react";
4528
4529
  import {
4529
4530
  useCallback as useCallback21,
4530
4531
  useImperativeHandle as useImperativeHandle8,
4531
- useMemo as useMemo33,
4532
+ useMemo as useMemo34,
4532
4533
  useRef as useRef26,
4533
4534
  useState as useState19
4534
4535
  } from "react";
4535
4536
  import { jsx as jsx30 } from "react/jsx-runtime";
4536
4537
  import React32 from "react";
4537
- import { useMemo as useMemo35 } from "react";
4538
- import { createContext as createContext24, useContext as useContext35, useMemo as useMemo34 } from "react";
4538
+ import { useMemo as useMemo36 } from "react";
4539
+ import { createContext as createContext24, useContext as useContext35, useMemo as useMemo35 } from "react";
4539
4540
  import { jsx as jsx31 } from "react/jsx-runtime";
4540
4541
  import { jsx as jsx322 } from "react/jsx-runtime";
4541
4542
  import React34 from "react";
@@ -4547,7 +4548,7 @@ import {
4547
4548
  useContext as useContext37,
4548
4549
  useEffect as useEffect17,
4549
4550
  useLayoutEffect as useLayoutEffect12,
4550
- useMemo as useMemo36,
4551
+ useMemo as useMemo37,
4551
4552
  useState as useState20
4552
4553
  } from "react";
4553
4554
  import { jsx as jsx33 } from "react/jsx-runtime";
@@ -4557,18 +4558,18 @@ import React38, {
4557
4558
  useContext as useContext38,
4558
4559
  useEffect as useEffect19,
4559
4560
  useImperativeHandle as useImperativeHandle9,
4560
- useMemo as useMemo37,
4561
+ useMemo as useMemo38,
4561
4562
  useRef as useRef27,
4562
4563
  useState as useState21
4563
4564
  } from "react";
4564
4565
  import { useEffect as useEffect18 } from "react";
4565
4566
  import { jsx as jsx34 } from "react/jsx-runtime";
4566
4567
  import { jsx as jsx35 } from "react/jsx-runtime";
4567
- import React40, { useMemo as useMemo38 } from "react";
4568
+ import React40, { useMemo as useMemo39 } from "react";
4568
4569
  import { jsx as jsx36 } from "react/jsx-runtime";
4569
4570
  import React42, {
4570
4571
  forwardRef as forwardRef14,
4571
- useMemo as useMemo39
4572
+ useMemo as useMemo40
4572
4573
  } from "react";
4573
4574
  import React41 from "react";
4574
4575
  import { jsx as jsx37, jsxs as jsxs32, Fragment } from "react/jsx-runtime";
@@ -4580,7 +4581,7 @@ import {
4580
4581
  useEffect as useEffect20,
4581
4582
  useImperativeHandle as useImperativeHandle10,
4582
4583
  useLayoutEffect as useLayoutEffect13,
4583
- useMemo as useMemo40,
4584
+ useMemo as useMemo41,
4584
4585
  useRef as useRef28
4585
4586
  } from "react";
4586
4587
  import { jsx as jsx38 } from "react/jsx-runtime";
@@ -5760,7 +5761,7 @@ var getSingleChildComponent = (children) => {
5760
5761
  }
5761
5762
  return child.type;
5762
5763
  };
5763
- var VERSION = "4.0.498";
5764
+ var VERSION = "4.0.500";
5764
5765
  var checkMultipleRemotionVersions = () => {
5765
5766
  if (typeof globalThis === "undefined") {
5766
5767
  return;
@@ -5802,38 +5803,6 @@ __export2(exports_timeline_position_state, {
5802
5803
  getFrameForComposition: () => getFrameForComposition,
5803
5804
  clampFrameToCompositionRange: () => clampFrameToCompositionRange
5804
5805
  });
5805
- function mulberry32(a) {
5806
- let t = a + 1831565813;
5807
- t = Math.imul(t ^ t >>> 15, t | 1);
5808
- t ^= t + Math.imul(t ^ t >>> 7, t | 61);
5809
- return ((t ^ t >>> 14) >>> 0) / 4294967296;
5810
- }
5811
- function hashCode(str) {
5812
- let i = 0;
5813
- let chr = 0;
5814
- let hash = 0;
5815
- for (i = 0;i < str.length; i++) {
5816
- chr = str.charCodeAt(i);
5817
- hash = (hash << 5) - hash + chr;
5818
- hash |= 0;
5819
- }
5820
- return hash;
5821
- }
5822
- var random = (seed, dummy) => {
5823
- if (dummy !== undefined) {
5824
- throw new TypeError("random() takes only one argument");
5825
- }
5826
- if (seed === null) {
5827
- return Math.random();
5828
- }
5829
- if (typeof seed === "string") {
5830
- return mulberry32(hashCode(seed));
5831
- }
5832
- if (typeof seed === "number") {
5833
- return mulberry32(seed * 10000000000);
5834
- }
5835
- throw new Error("random() argument must be a number or a string");
5836
- };
5837
5806
  var SetTimelineContext = createContext13({
5838
5807
  setFrame: () => {
5839
5808
  throw new Error("default");
@@ -5850,7 +5819,6 @@ var TimelineContextProvider = ({ children, frameState }) => {
5850
5819
  const imperativePlaying = useRef3(false);
5851
5820
  const [playbackRate, setPlaybackRate] = useState2(1);
5852
5821
  const audioAndVideoTags = useRef3([]);
5853
- const [remotionRootId] = useState2(() => String(random(null)));
5854
5822
  const [_frame, setFrame] = useState2(() => getInitialFrameState());
5855
5823
  const frame = frameState ?? _frame;
5856
5824
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
@@ -5885,10 +5853,9 @@ var TimelineContextProvider = ({ children, frameState }) => {
5885
5853
  frame,
5886
5854
  playing,
5887
5855
  imperativePlaying,
5888
- rootId: remotionRootId,
5889
5856
  audioAndVideoTags
5890
5857
  };
5891
- }, [frame, playing, remotionRootId]);
5858
+ }, [frame, playing]);
5892
5859
  const playbackRateContextValue = useMemo8(() => {
5893
5860
  return {
5894
5861
  playbackRate,
@@ -6277,6 +6244,29 @@ var backgroundSchema = {
6277
6244
  description: "Color"
6278
6245
  }
6279
6246
  };
6247
+ var svgStrokeSchema = {
6248
+ stroke: {
6249
+ type: "color",
6250
+ default: "none",
6251
+ description: "Stroke"
6252
+ },
6253
+ strokeWidth: {
6254
+ type: "number",
6255
+ default: 1,
6256
+ description: "Stroke width",
6257
+ min: 0,
6258
+ step: 1,
6259
+ hiddenFromList: false
6260
+ }
6261
+ };
6262
+ var svgPaintSchema = {
6263
+ fill: {
6264
+ type: "color",
6265
+ default: undefined,
6266
+ description: "Fill"
6267
+ },
6268
+ ...svgStrokeSchema
6269
+ };
6280
6270
  var textContentSchema = {
6281
6271
  children: {
6282
6272
  type: "text-content",
@@ -6307,7 +6297,51 @@ var premountSchema = {
6307
6297
  var sequencePremountSchema = {
6308
6298
  ...premountSchema
6309
6299
  };
6300
+ var cropSchema = {
6301
+ cropLeft: {
6302
+ type: "number",
6303
+ default: 0,
6304
+ description: "Crop left",
6305
+ min: 0,
6306
+ max: 1,
6307
+ step: 0.01,
6308
+ hiddenFromList: false,
6309
+ keyframable: true
6310
+ },
6311
+ cropRight: {
6312
+ type: "number",
6313
+ default: 0,
6314
+ description: "Crop right",
6315
+ min: 0,
6316
+ max: 1,
6317
+ step: 0.01,
6318
+ hiddenFromList: false,
6319
+ keyframable: true
6320
+ },
6321
+ cropTop: {
6322
+ type: "number",
6323
+ default: 0,
6324
+ description: "Crop top",
6325
+ min: 0,
6326
+ max: 1,
6327
+ step: 0.01,
6328
+ hiddenFromList: false,
6329
+ keyframable: true
6330
+ },
6331
+ cropBottom: {
6332
+ type: "number",
6333
+ default: 0,
6334
+ description: "Crop bottom",
6335
+ min: 0,
6336
+ max: 1,
6337
+ step: 0.01,
6338
+ hiddenFromList: false,
6339
+ keyframable: true
6340
+ }
6341
+ };
6342
+ var sequenceCropSchema = cropSchema;
6310
6343
  var sequenceStyleSchema = {
6344
+ ...sequenceCropSchema,
6311
6345
  ...transformSchema,
6312
6346
  ...backgroundSchema,
6313
6347
  ...borderSchema,
@@ -6396,6 +6430,54 @@ var sequenceSchemaDefaultLayoutNone = {
6396
6430
  default: "none"
6397
6431
  }
6398
6432
  };
6433
+ var clampCrop = (value) => {
6434
+ return Math.min(1, Math.max(0, value ?? 0));
6435
+ };
6436
+ var resolveAxis = (start, end) => {
6437
+ const resolvedStart = clampCrop(start);
6438
+ const resolvedEnd = clampCrop(end);
6439
+ if (resolvedStart + resolvedEnd > 1) {
6440
+ return [0.5, 0.5];
6441
+ }
6442
+ return [resolvedStart, resolvedEnd];
6443
+ };
6444
+ var resolveSequenceCrop = ({
6445
+ cropLeft,
6446
+ cropRight,
6447
+ cropTop,
6448
+ cropBottom
6449
+ }) => {
6450
+ const [left, right] = resolveAxis(cropLeft, cropRight);
6451
+ const [top, bottom] = resolveAxis(cropTop, cropBottom);
6452
+ return { left, right, top, bottom };
6453
+ };
6454
+ var getSequenceCropClipPath = ({
6455
+ left,
6456
+ right,
6457
+ top,
6458
+ bottom,
6459
+ borderRadius
6460
+ }) => {
6461
+ if (left === 0 && right === 0 && top === 0 && bottom === 0) {
6462
+ return null;
6463
+ }
6464
+ const serializedBorderRadius = typeof borderRadius === "number" ? `${borderRadius}px` : borderRadius;
6465
+ const rounded = serializedBorderRadius ? ` round ${serializedBorderRadius}` : "";
6466
+ return `inset(${top * 100}% ${right * 100}% ${bottom * 100}% ${left * 100}%${rounded})`;
6467
+ };
6468
+ var validateSequenceCrop = (crop, componentName = "<Sequence />") => {
6469
+ for (const [name, value] of Object.entries(crop)) {
6470
+ if (value === undefined) {
6471
+ continue;
6472
+ }
6473
+ if (typeof value !== "number" || !Number.isFinite(value)) {
6474
+ throw new TypeError(`The "${name}" prop of ${componentName} must be a finite number, but got ${String(value)}.`);
6475
+ }
6476
+ if (value < 0 || value > 1) {
6477
+ throw new RangeError(`The "${name}" prop of ${componentName} must be between 0 and 1, but got ${value}.`);
6478
+ }
6479
+ }
6480
+ };
6399
6481
  var SequenceManager = React12.createContext({
6400
6482
  registerSequence: () => {
6401
6483
  throw new Error("SequenceManagerContext not initialized");
@@ -8815,7 +8897,7 @@ var withInteractivitySchema = ({
8815
8897
  const flatKeys = Object.keys(flatSchema);
8816
8898
  const Wrapped = forwardRef2((props, ref) => {
8817
8899
  const env = useRemotionEnvironment();
8818
- if (!env.isStudio || env.isReadOnlyStudio || env.isRendering) {
8900
+ if (!env.isStudio || env.isRendering) {
8819
8901
  return React14.createElement(Component, {
8820
8902
  ...props,
8821
8903
  controls: null,
@@ -8845,7 +8927,7 @@ var withInteractivitySchema = ({
8845
8927
  stackToOverrideMap[stack] = newOverrideId;
8846
8928
  return newOverrideId;
8847
8929
  });
8848
- const nodePath = nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
8930
+ const nodePath = env.isReadOnlyStudio ? null : nodePathMapping.overrideIdToNodePathMappings[overrideId] ?? null;
8849
8931
  const runtimeValues = flatKeys.map((key) => getRuntimeValueForSchemaKey({
8850
8932
  flatSchema,
8851
8933
  key,
@@ -8916,17 +8998,32 @@ var RegularSequenceRefForwardingFunction = ({
8916
8998
  _remotionInternalPostmountDisplay: postmountDisplay,
8917
8999
  _remotionInternalIsMedia: isMedia,
8918
9000
  outlineRef: passedRefForOutline,
9001
+ cropLeft,
9002
+ cropRight,
9003
+ cropTop,
9004
+ cropBottom,
8919
9005
  ...other
8920
9006
  }, ref) => {
8921
9007
  const { layout = "absolute-fill" } = other;
8922
9008
  const [id] = useState5(() => String(Math.random()));
8923
9009
  const parentSequence = useContext18(SequenceContext);
8924
- const { rootId } = useTimelineContext();
8925
9010
  const cumulatedFrom = parentSequence ? parentSequence.cumulatedFrom + parentSequence.relativeFrom : 0;
8926
9011
  const nonce = useNonce();
8927
9012
  if (layout !== "absolute-fill" && layout !== "none") {
8928
9013
  throw new TypeError(`The layout prop of <Sequence /> expects either "absolute-fill" or "none", but you passed: ${layout}`);
8929
9014
  }
9015
+ const cropProps = { cropLeft, cropRight, cropTop, cropBottom };
9016
+ const hasCropProp = Object.values(cropProps).some((value) => value !== undefined);
9017
+ if (layout === "none" && hasCropProp) {
9018
+ throw new TypeError('The cropLeft, cropRight, cropTop and cropBottom props of <Sequence /> are only supported with layout="absolute-fill".');
9019
+ }
9020
+ validateSequenceCrop(cropProps);
9021
+ const {
9022
+ left: resolvedCropLeft,
9023
+ right: resolvedCropRight,
9024
+ top: resolvedCropTop,
9025
+ bottom: resolvedCropBottom
9026
+ } = resolveSequenceCrop(cropProps);
8930
9027
  if (layout === "none" && typeof other.style !== "undefined") {
8931
9028
  throw new TypeError('If layout="none", you may not pass a style. Passed: ' + JSON.stringify(other.style));
8932
9029
  }
@@ -9052,7 +9149,6 @@ var RegularSequenceRefForwardingFunction = ({
9052
9149
  parent: parentSequence?.id ?? null,
9053
9150
  postmountDisplay: postmountDisplay ?? null,
9054
9151
  premountDisplay: premountDisplay ?? null,
9055
- rootId,
9056
9152
  showInTimeline,
9057
9153
  src: isMedia.src,
9058
9154
  getStack: () => stackRef.current,
@@ -9079,7 +9175,6 @@ var RegularSequenceRefForwardingFunction = ({
9079
9175
  playbackRate: isMedia.data.playbackRate,
9080
9176
  postmountDisplay: postmountDisplay ?? null,
9081
9177
  premountDisplay: premountDisplay ?? null,
9082
- rootId,
9083
9178
  showInTimeline,
9084
9179
  src: isMedia.data.src,
9085
9180
  getStack: () => stackRef.current,
@@ -9106,7 +9201,6 @@ var RegularSequenceRefForwardingFunction = ({
9106
9201
  documentationLink: resolvedDocumentationLink,
9107
9202
  parent: parentSequence?.id ?? null,
9108
9203
  type: "sequence",
9109
- rootId,
9110
9204
  showInTimeline,
9111
9205
  nonce: nonce.get(),
9112
9206
  loopDisplay,
@@ -9132,7 +9226,6 @@ var RegularSequenceRefForwardingFunction = ({
9132
9226
  unregisterSequence,
9133
9227
  parentSequence?.id,
9134
9228
  actualDurationInFrames,
9135
- rootId,
9136
9229
  from,
9137
9230
  trimBefore,
9138
9231
  registeredTrimBefore,
@@ -9161,6 +9254,13 @@ var RegularSequenceRefForwardingFunction = ({
9161
9254
  children: content
9162
9255
  });
9163
9256
  const styleIfThere = other.layout === "none" ? undefined : other.style;
9257
+ const cropClipPath = getSequenceCropClipPath({
9258
+ left: resolvedCropLeft,
9259
+ right: resolvedCropRight,
9260
+ top: resolvedCropTop,
9261
+ bottom: resolvedCropBottom,
9262
+ borderRadius: styleIfThere?.borderRadius
9263
+ });
9164
9264
  const sequenceRef = useCallback6((node) => {
9165
9265
  wrapperRefForOutline.current = node;
9166
9266
  if (typeof ref === "function") {
@@ -9174,9 +9274,12 @@ var RegularSequenceRefForwardingFunction = ({
9174
9274
  flexDirection: undefined,
9175
9275
  ...width ? { width } : {},
9176
9276
  ...height ? { height } : {},
9177
- ...styleIfThere ?? {}
9277
+ ...styleIfThere ?? {},
9278
+ ...cropClipPath ? {
9279
+ clipPath: cropClipPath
9280
+ } : {}
9178
9281
  };
9179
- }, [height, styleIfThere, width]);
9282
+ }, [cropClipPath, height, styleIfThere, width]);
9180
9283
  if (ref !== null && layout === "none") {
9181
9284
  throw new TypeError('It is not supported to pass both a `ref` and `layout="none"` to <Sequence />.');
9182
9285
  }
@@ -9275,6 +9378,26 @@ var SequenceWithoutFrom = withInteractivitySchema({
9275
9378
  schema: sequenceSchemaWithoutFrom,
9276
9379
  supportsEffects: false
9277
9380
  });
9381
+ var useCropStyle = ({
9382
+ cropLeft,
9383
+ cropRight,
9384
+ cropTop,
9385
+ cropBottom,
9386
+ style,
9387
+ componentName
9388
+ }) => {
9389
+ validateSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }, componentName);
9390
+ return useMemo16(() => {
9391
+ const cropClipPath = getSequenceCropClipPath({
9392
+ ...resolveSequenceCrop({ cropLeft, cropRight, cropTop, cropBottom }),
9393
+ borderRadius: style?.borderRadius
9394
+ });
9395
+ if (cropClipPath === null) {
9396
+ return style;
9397
+ }
9398
+ return { ...style, clipPath: cropClipPath };
9399
+ }, [cropBottom, cropLeft, cropRight, cropTop, style]);
9400
+ };
9278
9401
  var calculateImageFit = (fit, imageSize, canvasSize) => {
9279
9402
  switch (fit) {
9280
9403
  case "fill": {
@@ -9567,7 +9690,7 @@ var useEffectChainState = () => {
9567
9690
  }
9568
9691
  };
9569
9692
  }, []);
9570
- return useMemo16(() => ({
9693
+ return useMemo17(() => ({
9571
9694
  get: (width, height) => {
9572
9695
  if (!sizeRef.current || sizeRef.current.width !== width || sizeRef.current.height !== height) {
9573
9696
  if (chainStateRef.current) {
@@ -9583,7 +9706,7 @@ var useEffectChainState = () => {
9583
9706
  var CanvasRefForwardingFunction = ({ width, height, fit, className, style, effects, ...props }, ref) => {
9584
9707
  const canvasRef = useRef8(null);
9585
9708
  const chainState = useEffectChainState();
9586
- const sourceCanvas = useMemo17(() => {
9709
+ const sourceCanvas = useMemo18(() => {
9587
9710
  if (typeof document === "undefined") {
9588
9711
  return null;
9589
9712
  }
@@ -9845,6 +9968,7 @@ var animatedImageSchema = {
9845
9968
  keyframable: false
9846
9969
  },
9847
9970
  ...baseSchema,
9971
+ ...cropSchema,
9848
9972
  ...premountSchema,
9849
9973
  playbackRate: {
9850
9974
  type: "number",
@@ -10039,6 +10163,10 @@ var AnimatedImageInner = ({
10039
10163
  postmountFor,
10040
10164
  styleWhilePremounted,
10041
10165
  styleWhilePostmounted,
10166
+ cropLeft,
10167
+ cropRight,
10168
+ cropTop,
10169
+ cropBottom,
10042
10170
  requestInit,
10043
10171
  effects = [],
10044
10172
  controls,
@@ -10068,6 +10196,14 @@ var AnimatedImageInner = ({
10068
10196
  styleWhilePostmounted: styleWhilePostmounted ?? null,
10069
10197
  hideWhilePremounted: "display-none"
10070
10198
  });
10199
+ const croppedStyle = useCropStyle({
10200
+ cropLeft,
10201
+ cropRight,
10202
+ cropTop,
10203
+ cropBottom,
10204
+ style: premountingStyle,
10205
+ componentName: "<AnimatedImage />"
10206
+ });
10071
10207
  const canvasProps = getCanvasPropsFromSequenceProps(sequenceProps);
10072
10208
  const animatedImageProps = {
10073
10209
  src,
@@ -10079,7 +10215,7 @@ var AnimatedImageInner = ({
10079
10215
  loopBehavior,
10080
10216
  id,
10081
10217
  className,
10082
- style: premountingStyle ?? undefined,
10218
+ style: croppedStyle ?? undefined,
10083
10219
  requestInit,
10084
10220
  ...canvasProps
10085
10221
  };
@@ -10220,7 +10356,7 @@ var RenderAssetManagerProvider = ({ children, collectAssets }) => {
10220
10356
  };
10221
10357
  }
10222
10358
  }, []);
10223
- const contextValue = useMemo18(() => {
10359
+ const contextValue = useMemo19(() => {
10224
10360
  return {
10225
10361
  registerRenderAsset,
10226
10362
  unregisterRenderAsset,
@@ -10349,14 +10485,14 @@ var Loop = ({
10349
10485
  const iteration = Math.floor(currentFrame / durationInFrames);
10350
10486
  const start = iteration * durationInFrames;
10351
10487
  const from = Math.min(start, maxFrame);
10352
- const loopDisplay = useMemo19(() => {
10488
+ const loopDisplay = useMemo20(() => {
10353
10489
  return {
10354
10490
  numberOfTimes: Math.min(compDuration / durationInFrames, times),
10355
10491
  startOffset: -from,
10356
10492
  durationInFrames
10357
10493
  };
10358
10494
  }, [compDuration, durationInFrames, from, times]);
10359
- const loopContext = useMemo19(() => {
10495
+ const loopContext = useMemo20(() => {
10360
10496
  return {
10361
10497
  iteration: Math.floor(currentFrame / durationInFrames),
10362
10498
  durationInFrames
@@ -10728,7 +10864,7 @@ var DurationsContext = createContext20({
10728
10864
  });
10729
10865
  var DurationsContextProvider = ({ children }) => {
10730
10866
  const [durations, setDurations] = useReducer(durationReducer, {});
10731
- const value = useMemo20(() => {
10867
+ const value = useMemo21(() => {
10732
10868
  return {
10733
10869
  durations,
10734
10870
  setDurations
@@ -10755,6 +10891,38 @@ var getCrossOriginValue = ({
10755
10891
  }
10756
10892
  return;
10757
10893
  };
10894
+ function mulberry32(a2) {
10895
+ let t = a2 + 1831565813;
10896
+ t = Math.imul(t ^ t >>> 15, t | 1);
10897
+ t ^= t + Math.imul(t ^ t >>> 7, t | 61);
10898
+ return ((t ^ t >>> 14) >>> 0) / 4294967296;
10899
+ }
10900
+ function hashCode(str) {
10901
+ let i = 0;
10902
+ let chr = 0;
10903
+ let hash = 0;
10904
+ for (i = 0;i < str.length; i++) {
10905
+ chr = str.charCodeAt(i);
10906
+ hash = (hash << 5) - hash + chr;
10907
+ hash |= 0;
10908
+ }
10909
+ return hash;
10910
+ }
10911
+ var random = (seed, dummy) => {
10912
+ if (dummy !== undefined) {
10913
+ throw new TypeError("random() takes only one argument");
10914
+ }
10915
+ if (seed === null) {
10916
+ return Math.random();
10917
+ }
10918
+ if (typeof seed === "string") {
10919
+ return mulberry32(hashCode(seed));
10920
+ }
10921
+ if (typeof seed === "number") {
10922
+ return mulberry32(seed * 10000000000);
10923
+ }
10924
+ throw new Error("random() argument must be a number or a string");
10925
+ };
10758
10926
  var playAndHandleNotAllowedError = ({
10759
10927
  mediaRef,
10760
10928
  mediaType,
@@ -10871,7 +11039,7 @@ var useSingletonAudioContext = ({
10871
11039
  if (sampleRate !== initialSampleRate.current) {
10872
11040
  throw new Error(`Changing the AudioContext sample rate dynamically is not supported. The sample rate was initialized with ${initialSampleRate.current} Hz, but ${sampleRate} Hz was passed later.`);
10873
11041
  }
10874
- const context = useMemo21(() => {
11042
+ const context = useMemo22(() => {
10875
11043
  if (env.isRendering) {
10876
11044
  return null;
10877
11045
  }
@@ -11005,9 +11173,9 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
11005
11173
  });
11006
11174
  const audioContextIsPlayingEventually = useRef12(false);
11007
11175
  const isResuming = useRef12(null);
11008
- const audioSyncAnchor = useMemo22(() => ({ value: 0 }), []);
11176
+ const audioSyncAnchor = useMemo23(() => ({ value: 0 }), []);
11009
11177
  const audioSyncAnchorListeners = useRef12([]);
11010
- const audioSyncAnchorEmitter = useMemo22(() => {
11178
+ const audioSyncAnchorEmitter = useMemo23(() => {
11011
11179
  return {
11012
11180
  dispatch: (event) => {
11013
11181
  audioSyncAnchorListeners.current.forEach((l) => l(event));
@@ -11027,7 +11195,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
11027
11195
  const unscheduleAudioNode = useCallback9((node) => {
11028
11196
  nodesToResume.current.delete(node);
11029
11197
  }, []);
11030
- const scheduleAudioNode = useMemo22(() => {
11198
+ const scheduleAudioNode = useMemo23(() => {
11031
11199
  return ({
11032
11200
  node,
11033
11201
  mediaTimestamp,
@@ -11119,7 +11287,7 @@ var SharedAudioContextProvider = ({ children, audioLatencyHint, audioEnabled, pr
11119
11287
  audioContextIsPlayingEventually.current = false;
11120
11288
  return ctxAndGain.suspend();
11121
11289
  }, [ctxAndGain]);
11122
- const audioContextValue = useMemo22(() => {
11290
+ const audioContextValue = useMemo23(() => {
11123
11291
  return {
11124
11292
  audioContext: ctxAndGain?.audioContext ?? null,
11125
11293
  getAudioContextState: () => ctxAndGain?.getState() ?? null,
@@ -11301,7 +11469,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
11301
11469
  });
11302
11470
  resume?.();
11303
11471
  }, [logLevel, mountTime, refs, env.isPlayer, resume]);
11304
- const audioTagsValue = useMemo22(() => {
11472
+ const audioTagsValue = useMemo23(() => {
11305
11473
  return {
11306
11474
  registerAudio,
11307
11475
  unregisterAudio,
@@ -11316,7 +11484,7 @@ var SharedAudioTagsContextProvider = ({ children, numberOfAudioTags }) => {
11316
11484
  unregisterAudio,
11317
11485
  updateAudio
11318
11486
  ]);
11319
- const sharedAudioTagElements = useMemo22(() => {
11487
+ const sharedAudioTagElements = useMemo23(() => {
11320
11488
  return refs.map(({ id, ref }) => {
11321
11489
  return /* @__PURE__ */ jsx19("audio", {
11322
11490
  ref,
@@ -11684,7 +11852,7 @@ var useBasicMediaInTimeline = ({
11684
11852
  parentSequenceDurationInFrames: parentSequence?.durationInFrames ?? null,
11685
11853
  loop
11686
11854
  });
11687
- const volumes = useMemo23(() => {
11855
+ const volumes = useMemo24(() => {
11688
11856
  if (typeof volume === "number") {
11689
11857
  return volume;
11690
11858
  }
@@ -11703,15 +11871,13 @@ var useBasicMediaInTimeline = ({
11703
11871
  }, [initialVolume, mediaType, src, volume]);
11704
11872
  const doesVolumeChange = typeof volume === "function";
11705
11873
  const nonce = useNonce();
11706
- const { rootId } = useTimelineContext();
11707
11874
  const startMediaFrom = 0 - mediaStartsAt + (trimBefore ?? 0);
11708
- const memoizedResult = useMemo23(() => {
11875
+ const memoizedResult = useMemo24(() => {
11709
11876
  return {
11710
11877
  volumes,
11711
11878
  duration,
11712
11879
  doesVolumeChange,
11713
11880
  nonce,
11714
- rootId,
11715
11881
  finalDisplayName: displayName ?? getAssetDisplayName(src),
11716
11882
  startMediaFrom,
11717
11883
  src,
@@ -11722,7 +11888,6 @@ var useBasicMediaInTimeline = ({
11722
11888
  duration,
11723
11889
  doesVolumeChange,
11724
11890
  nonce,
11725
- rootId,
11726
11891
  displayName,
11727
11892
  src,
11728
11893
  startMediaFrom,
@@ -11751,7 +11916,7 @@ var useMediaInTimeline = ({
11751
11916
  const { registerSequence, unregisterSequence } = useContext24(SequenceManager);
11752
11917
  const { durationInFrames } = useVideoConfig();
11753
11918
  const mediaStartsAt = useMediaStartsAt();
11754
- const { volumes, duration, doesVolumeChange, nonce, rootId, finalDisplayName } = useBasicMediaInTimeline({
11919
+ const { volumes, duration, doesVolumeChange, nonce, finalDisplayName } = useBasicMediaInTimeline({
11755
11920
  volume,
11756
11921
  mediaVolume,
11757
11922
  mediaType,
@@ -11785,7 +11950,6 @@ var useMediaInTimeline = ({
11785
11950
  parent: parentSequence?.id ?? null,
11786
11951
  displayName: finalDisplayName,
11787
11952
  documentationLink,
11788
- rootId,
11789
11953
  volume: volumes,
11790
11954
  showInTimeline: true,
11791
11955
  nonce: nonce.get(),
@@ -11826,7 +11990,6 @@ var useMediaInTimeline = ({
11826
11990
  postmountDisplay,
11827
11991
  loopDisplay,
11828
11992
  documentationLink,
11829
- rootId,
11830
11993
  finalDisplayName,
11831
11994
  isStudio,
11832
11995
  refForOutline
@@ -11913,7 +12076,7 @@ var useBufferManager = (logLevel, mountTime) => {
11913
12076
  }
11914
12077
  }, [blocks]);
11915
12078
  }
11916
- return useMemo24(() => {
12079
+ return useMemo25(() => {
11917
12080
  return { addBlock, listenForBuffering, listenForResume, buffering };
11918
12081
  }, [addBlock, buffering, listenForBuffering, listenForResume]);
11919
12082
  };
@@ -11948,7 +12111,7 @@ var useBufferState = () => {
11948
12111
  const buffer = useContext26(BufferingContextReact);
11949
12112
  const logLevel = useLogLevel();
11950
12113
  const addBlock = buffer ? buffer.addBlock : null;
11951
- return useMemo25(() => ({
12114
+ return useMemo26(() => ({
11952
12115
  delayPlayback: () => {
11953
12116
  if (!addBlock) {
11954
12117
  throw new Error("Tried to enable the buffering state, but a Remotion context was not found. This API can only be called in a component that was passed to the Remotion Player or a <Composition>. Or you might have experienced a version mismatch - run `npx remotion versions` and ensure all packages have the same version. This error is thrown by the buffer state https://remotion.dev/docs/player/buffer-state");
@@ -12056,7 +12219,7 @@ var useBufferUntilFirstFrame = ({
12056
12219
  onVariableFpsVideoDetected,
12057
12220
  pauseWhenBuffering
12058
12221
  ]);
12059
- return useMemo26(() => {
12222
+ return useMemo27(() => {
12060
12223
  return {
12061
12224
  isBuffering: () => bufferingRef.current,
12062
12225
  bufferUntilFirstFrame
@@ -12727,14 +12890,14 @@ var SetMediaVolumeContext = createContext22({
12727
12890
  var useMediaVolumeState = () => {
12728
12891
  const { mediaVolume } = useContext28(MediaVolumeContext);
12729
12892
  const { setMediaVolume } = useContext28(SetMediaVolumeContext);
12730
- return useMemo27(() => {
12893
+ return useMemo28(() => {
12731
12894
  return [mediaVolume, setMediaVolume];
12732
12895
  }, [mediaVolume, setMediaVolume]);
12733
12896
  };
12734
12897
  var usePlayerMutedState = () => {
12735
12898
  const { playerMuted } = useContext28(MediaVolumeContext);
12736
12899
  const { setPlayerMuted } = useContext28(SetMediaVolumeContext);
12737
- return useMemo27(() => {
12900
+ return useMemo28(() => {
12738
12901
  return [playerMuted, setPlayerMuted];
12739
12902
  }, [playerMuted, setPlayerMuted]);
12740
12903
  };
@@ -12801,7 +12964,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12801
12964
  requestsVideoFrame: false,
12802
12965
  isClientSideRendering: false
12803
12966
  });
12804
- const propsToPass = useMemo28(() => {
12967
+ const propsToPass = useMemo29(() => {
12805
12968
  return {
12806
12969
  muted: muted || playerMuted || userPreferredVolume <= 0,
12807
12970
  src: preloadedSrc,
@@ -12818,7 +12981,7 @@ var AudioForDevelopmentForwardRefFunction = (props, ref) => {
12818
12981
  userPreferredVolume,
12819
12982
  crossOriginValue
12820
12983
  ]);
12821
- const id = useMemo28(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12984
+ const id = useMemo29(() => `audio-${random(src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}-muted:${props.muted}-loop:${props.loop}`, [
12822
12985
  src,
12823
12986
  sequenceContext?.relativeFrom,
12824
12987
  sequenceContext?.cumulatedFrom,
@@ -12951,7 +13114,7 @@ var AudioForRenderingRefForwardingFunction = (props, ref) => {
12951
13114
  const sequenceContext = useContext30(SequenceContext);
12952
13115
  const { registerRenderAsset, unregisterRenderAsset } = useContext30(RenderAssetManager);
12953
13116
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
12954
- const id = useMemo29(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
13117
+ const id = useMemo30(() => `audio-${random(props.src ?? "")}-${sequenceContext?.relativeFrom}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.durationInFrames}`, [
12955
13118
  props.src,
12956
13119
  sequenceContext?.relativeFrom,
12957
13120
  sequenceContext?.cumulatedFrom,
@@ -13225,7 +13388,8 @@ var solidSchema = {
13225
13388
  },
13226
13389
  ...transformSchema,
13227
13390
  ...backgroundSchema,
13228
- ...borderSchema
13391
+ ...borderSchema,
13392
+ ...cropSchema
13229
13393
  };
13230
13394
  var SolidInner = ({
13231
13395
  color,
@@ -13247,7 +13411,7 @@ var SolidInner = ({
13247
13411
  effects,
13248
13412
  overrideId: overrideId ?? null
13249
13413
  });
13250
- const sourceCanvas = useMemo30(() => {
13414
+ const sourceCanvas = useMemo31(() => {
13251
13415
  if (typeof document === "undefined") {
13252
13416
  return null;
13253
13417
  }
@@ -13315,7 +13479,7 @@ var SolidInner = ({
13315
13479
  cancelRender2,
13316
13480
  memoizedEffects
13317
13481
  ]);
13318
- const canvasStyle = useMemo30(() => {
13482
+ const canvasStyle = useMemo31(() => {
13319
13483
  return {
13320
13484
  width,
13321
13485
  height,
@@ -13346,6 +13510,10 @@ var SolidOuter = forwardRef8(({
13346
13510
  hidden,
13347
13511
  showInTimeline,
13348
13512
  pixelDensity,
13513
+ cropLeft,
13514
+ cropRight,
13515
+ cropTop,
13516
+ cropBottom,
13349
13517
  ...props2
13350
13518
  }, ref) => {
13351
13519
  const memoizedEffectDefinitions = useMemoizedEffectDefinitions(effects);
@@ -13353,6 +13521,14 @@ var SolidOuter = forwardRef8(({
13353
13521
  useImperativeHandle6(ref, () => {
13354
13522
  return actualRef.current;
13355
13523
  }, []);
13524
+ const croppedStyle = useCropStyle({
13525
+ cropLeft,
13526
+ cropRight,
13527
+ cropTop,
13528
+ cropBottom,
13529
+ style: style ?? null,
13530
+ componentName: "<Solid />"
13531
+ });
13356
13532
  return /* @__PURE__ */ jsx24(Sequence, {
13357
13533
  layout: "none",
13358
13534
  from,
@@ -13374,7 +13550,7 @@ var SolidOuter = forwardRef8(({
13374
13550
  height,
13375
13551
  width,
13376
13552
  className,
13377
- style,
13553
+ style: croppedStyle ?? undefined,
13378
13554
  effects,
13379
13555
  pixelDensity
13380
13556
  })
@@ -13403,6 +13579,17 @@ var isHtmlInCanvasSupported = () => {
13403
13579
  return cachedSupport;
13404
13580
  };
13405
13581
  var HTML_IN_CANVAS_UNSUPPORTED_MESSAGE = "HTML in Canvas is not supported. Two common causes: Chrome is older than version 148 (update Chrome), or the HTML-in-Canvas flag is disabled at chrome://flags/#canvas-draw-element (enable it and restart Chrome).";
13582
+ var MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS = 152;
13583
+ var getChromeMajorVersion = () => {
13584
+ if (typeof navigator === "undefined") {
13585
+ return null;
13586
+ }
13587
+ const match = navigator.userAgent.match(/\b(?:HeadlessChrome|Chrome)\/(\d+)/);
13588
+ if (!match) {
13589
+ return null;
13590
+ }
13591
+ return Number(match[1]);
13592
+ };
13406
13593
  function assertHtmlInCanvasDimensions(width, height) {
13407
13594
  if (typeof width !== "number" || typeof height !== "number") {
13408
13595
  throw new Error(`HtmlInCanvas: \`width\` and \`height\` must be numbers. Received width=${String(width)}, height=${String(height)}.`);
@@ -13466,6 +13653,10 @@ var HtmlInCanvasContent = forwardRef9(({
13466
13653
  }, ref) => {
13467
13654
  const ancestor = useContext32(HtmlInCanvasAncestorContext);
13468
13655
  assertHtmlInCanvasDimensions(width, height);
13656
+ const chromeMajorVersion = getChromeMajorVersion();
13657
+ if (ancestor && chromeMajorVersion !== null && chromeMajorVersion < MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS) {
13658
+ throw new Error(`Nested <HtmlInCanvas> components require Chrome ${MINIMUM_CHROME_VERSION_FOR_NESTED_HTML_IN_CANVAS} or newer, but the current browser is Chrome ${chromeMajorVersion}. Upgrade Chrome or avoid nesting components that use <HtmlInCanvas>, such as shapes with effects.`);
13659
+ }
13469
13660
  const resolvedPixelDensity = resolveHtmlInCanvasPixelDensity(pixelDensity);
13470
13661
  const canvasWidth = Math.ceil(width * resolvedPixelDensity);
13471
13662
  const canvasHeight = Math.ceil(height * resolvedPixelDensity);
@@ -13684,20 +13875,20 @@ var HtmlInCanvasContent = forwardRef9(({
13684
13875
  continueRender2(handle);
13685
13876
  };
13686
13877
  }, [width, height, continueRender2, delayRender2, canvasSizeKey]);
13687
- const innerStyle = useMemo31(() => {
13878
+ const innerStyle = useMemo32(() => {
13688
13879
  return {
13689
13880
  width,
13690
13881
  height
13691
13882
  };
13692
13883
  }, [width, height]);
13693
- const canvasStyle = useMemo31(() => {
13884
+ const canvasStyle = useMemo32(() => {
13694
13885
  return {
13695
13886
  width,
13696
13887
  height,
13697
13888
  ...style ?? {}
13698
13889
  };
13699
13890
  }, [height, style, width]);
13700
- const ancestorValue = useMemo31(() => {
13891
+ const ancestorValue = useMemo32(() => {
13701
13892
  return {
13702
13893
  requestParentPaint: () => {
13703
13894
  canvas2dRef.current?.requestPaint?.();
@@ -13730,6 +13921,10 @@ var HtmlInCanvasInner = forwardRef9(({
13730
13921
  pixelDensity,
13731
13922
  controls,
13732
13923
  style,
13924
+ cropLeft,
13925
+ cropRight,
13926
+ cropTop,
13927
+ cropBottom,
13733
13928
  durationInFrames,
13734
13929
  name,
13735
13930
  ...sequenceProps
@@ -13744,6 +13939,14 @@ var HtmlInCanvasInner = forwardRef9(({
13744
13939
  ref.current = node;
13745
13940
  }
13746
13941
  }, [ref]);
13942
+ const croppedStyle = useCropStyle({
13943
+ cropLeft,
13944
+ cropRight,
13945
+ cropTop,
13946
+ cropBottom,
13947
+ style: style ?? null,
13948
+ componentName: "<HtmlInCanvas />"
13949
+ });
13747
13950
  return /* @__PURE__ */ jsx25(Sequence, {
13748
13951
  durationInFrames,
13749
13952
  name: name ?? "<HtmlInCanvas>",
@@ -13762,7 +13965,7 @@ var HtmlInCanvasInner = forwardRef9(({
13762
13965
  onInit,
13763
13966
  pixelDensity,
13764
13967
  controls,
13765
- style,
13968
+ style: croppedStyle ?? undefined,
13766
13969
  children
13767
13970
  })
13768
13971
  });
@@ -13781,7 +13984,8 @@ var htmlInCanvasSchema = {
13781
13984
  },
13782
13985
  ...transformSchema,
13783
13986
  ...backgroundSchema,
13784
- ...borderSchema
13987
+ ...borderSchema,
13988
+ ...cropSchema
13785
13989
  };
13786
13990
  var HtmlInCanvasWrapped = withInteractivitySchema({
13787
13991
  Component: HtmlInCanvasInner,
@@ -13803,6 +14007,7 @@ function truncateSrcForLabel(src) {
13803
14007
  }
13804
14008
  var canvasImageSchema = {
13805
14009
  ...baseSchema,
14010
+ ...cropSchema,
13806
14011
  ...premountSchema,
13807
14012
  fit: {
13808
14013
  type: "enum",
@@ -13933,7 +14138,7 @@ var CanvasImageContent = forwardRef10(({
13933
14138
  continueRender2(pending.handle);
13934
14139
  pendingLoadDelayRef.current = null;
13935
14140
  }, [continueRender2]);
13936
- const sourceCanvas = useMemo32(() => {
14141
+ const sourceCanvas = useMemo33(() => {
13937
14142
  if (typeof document === "undefined") {
13938
14143
  return null;
13939
14144
  }
@@ -14147,9 +14352,14 @@ var CanvasImageInner = forwardRef10(({
14147
14352
  hidden,
14148
14353
  name,
14149
14354
  showInTimeline,
14355
+ cropLeft,
14356
+ cropRight,
14357
+ cropTop,
14358
+ cropBottom,
14150
14359
  stack,
14151
14360
  controls,
14152
14361
  _remotionInternalDocumentationLink,
14362
+ _remotionInternalCropComponentName,
14153
14363
  outlineRef,
14154
14364
  ...canvasProps
14155
14365
  }, ref) => {
@@ -14179,6 +14389,14 @@ var CanvasImageInner = forwardRef10(({
14179
14389
  styleWhilePostmounted: styleWhilePostmounted ?? null,
14180
14390
  hideWhilePremounted: "display-none"
14181
14391
  });
14392
+ const croppedStyle = useCropStyle({
14393
+ cropLeft,
14394
+ cropRight,
14395
+ cropTop,
14396
+ cropBottom,
14397
+ style: premountingStyle,
14398
+ componentName: _remotionInternalCropComponentName ?? "<CanvasImage />"
14399
+ });
14182
14400
  return /* @__PURE__ */ jsx26(Freeze, {
14183
14401
  frame: freezeFrame,
14184
14402
  active: isPremountingOrPostmounting,
@@ -14210,7 +14428,7 @@ var CanvasImageInner = forwardRef10(({
14210
14428
  effects,
14211
14429
  controls,
14212
14430
  className,
14213
- style: premountingStyle ?? undefined,
14431
+ style: croppedStyle ?? undefined,
14214
14432
  id,
14215
14433
  onError,
14216
14434
  pauseWhenLoading,
@@ -14441,6 +14659,10 @@ var NativeImgInner = ({
14441
14659
  style,
14442
14660
  styleWhilePremounted,
14443
14661
  styleWhilePostmounted,
14662
+ cropLeft,
14663
+ cropRight,
14664
+ cropTop,
14665
+ cropBottom,
14444
14666
  controls,
14445
14667
  outlineRef: refForOutline,
14446
14668
  ...props2
@@ -14466,6 +14688,14 @@ var NativeImgInner = ({
14466
14688
  styleWhilePostmounted: styleWhilePostmounted ?? null,
14467
14689
  hideWhilePremounted: "display-none"
14468
14690
  });
14691
+ const croppedStyle = useCropStyle({
14692
+ cropLeft,
14693
+ cropRight,
14694
+ cropTop,
14695
+ cropBottom,
14696
+ style: premountingStyle,
14697
+ componentName: "<Img />"
14698
+ });
14469
14699
  return /* @__PURE__ */ jsx28(Freeze, {
14470
14700
  frame: freezeFrame,
14471
14701
  active: isPremountingOrPostmounting,
@@ -14490,7 +14720,7 @@ var NativeImgInner = ({
14490
14720
  children: /* @__PURE__ */ jsx28(ImgContent, {
14491
14721
  src,
14492
14722
  refForOutline,
14493
- style: premountingStyle ?? undefined,
14723
+ style: croppedStyle ?? undefined,
14494
14724
  ...props2
14495
14725
  })
14496
14726
  })
@@ -14505,6 +14735,7 @@ var imgSchema = {
14505
14735
  keyframable: false
14506
14736
  },
14507
14737
  ...baseSchema,
14738
+ ...cropSchema,
14508
14739
  ...premountSchema,
14509
14740
  ...transformSchema,
14510
14741
  ...backgroundSchema,
@@ -14573,6 +14804,10 @@ var ImgInner = ({
14573
14804
  height,
14574
14805
  className,
14575
14806
  style,
14807
+ cropLeft,
14808
+ cropRight,
14809
+ cropTop,
14810
+ cropBottom,
14576
14811
  id,
14577
14812
  pauseWhenLoading,
14578
14813
  maxRetries,
@@ -14604,6 +14839,10 @@ var ImgInner = ({
14604
14839
  height,
14605
14840
  className,
14606
14841
  style,
14842
+ cropLeft,
14843
+ cropRight,
14844
+ cropTop,
14845
+ cropBottom,
14607
14846
  id,
14608
14847
  pauseWhenLoading: shouldPauseWhenLoading,
14609
14848
  maxRetries,
@@ -14633,6 +14872,10 @@ var ImgInner = ({
14633
14872
  effects,
14634
14873
  className,
14635
14874
  style,
14875
+ cropLeft,
14876
+ cropRight,
14877
+ cropTop,
14878
+ cropBottom,
14636
14879
  id,
14637
14880
  pauseWhenLoading: shouldPauseWhenLoading,
14638
14881
  maxRetries,
@@ -14651,6 +14894,7 @@ var ImgInner = ({
14651
14894
  showInTimeline,
14652
14895
  stack,
14653
14896
  _remotionInternalDocumentationLink: "https://www.remotion.dev/docs/img",
14897
+ _remotionInternalCropComponentName: "<Img />",
14654
14898
  controls,
14655
14899
  outlineRef: refForOutline,
14656
14900
  ...canvasProps
@@ -14699,9 +14943,22 @@ var interactiveTextElementSchema = {
14699
14943
  };
14700
14944
  var interactiveSvgTextElementSchema = {
14701
14945
  ...interactiveElementSchema,
14946
+ ...svgPaintSchema,
14702
14947
  ...textSchema,
14703
14948
  ...textContentSchema
14704
14949
  };
14950
+ var interactiveSvgElementSchema = {
14951
+ ...interactiveElementSchema,
14952
+ ...svgPaintSchema
14953
+ };
14954
+ var interactiveSvgStrokeElementSchema = {
14955
+ ...interactiveElementSchema,
14956
+ ...svgStrokeSchema
14957
+ };
14958
+ var interactiveSvgRootElementSchema = {
14959
+ ...interactiveBorderElementSchema,
14960
+ ...svgPaintSchema
14961
+ };
14705
14962
  var setRef = (ref, value) => {
14706
14963
  if (typeof ref === "function") {
14707
14964
  ref(value);
@@ -14769,8 +15026,11 @@ var makeInteractiveElement = (tag, displayName, schema) => {
14769
15026
  var makeInteractiveTextElement = (tag, displayName) => {
14770
15027
  return makeInteractiveElement(tag, displayName, interactiveTextElementSchema);
14771
15028
  };
14772
- var makeInteractiveNonTextElement = (tag, displayName) => {
14773
- return makeInteractiveElement(tag, displayName, interactiveElementSchema);
15029
+ var makeInteractiveSvgElement = (tag, displayName) => {
15030
+ return makeInteractiveElement(tag, displayName, interactiveSvgElementSchema);
15031
+ };
15032
+ var makeInteractiveSvgStrokeElement = (tag, displayName) => {
15033
+ return makeInteractiveElement(tag, displayName, interactiveSvgStrokeElementSchema);
14774
15034
  };
14775
15035
  var Interactive = {
14776
15036
  baseSchema,
@@ -14778,6 +15038,9 @@ var Interactive = {
14778
15038
  textSchema,
14779
15039
  backgroundSchema,
14780
15040
  borderSchema,
15041
+ cropSchema,
15042
+ svgPaintSchema,
15043
+ svgStrokeSchema,
14781
15044
  premountSchema,
14782
15045
  sequenceSchema,
14783
15046
  withSchema,
@@ -14786,13 +15049,13 @@ var Interactive = {
14786
15049
  Article: makeInteractiveTextElement("article", "<Interactive.Article>"),
14787
15050
  Aside: makeInteractiveTextElement("aside", "<Interactive.Aside>"),
14788
15051
  Button: makeInteractiveTextElement("button", "<Interactive.Button>"),
14789
- Circle: makeInteractiveNonTextElement("circle", "<Interactive.Circle>"),
15052
+ Circle: makeInteractiveSvgElement("circle", "<Interactive.Circle>"),
14790
15053
  Code: makeInteractiveTextElement("code", "<Interactive.Code>"),
14791
15054
  Div: makeInteractiveTextElement("div", "<Interactive.Div>"),
14792
- Ellipse: makeInteractiveNonTextElement("ellipse", "<Interactive.Ellipse>"),
15055
+ Ellipse: makeInteractiveSvgElement("ellipse", "<Interactive.Ellipse>"),
14793
15056
  Em: makeInteractiveTextElement("em", "<Interactive.Em>"),
14794
15057
  Footer: makeInteractiveTextElement("footer", "<Interactive.Footer>"),
14795
- G: makeInteractiveNonTextElement("g", "<Interactive.G>"),
15058
+ G: makeInteractiveSvgElement("g", "<Interactive.G>"),
14796
15059
  H1: makeInteractiveTextElement("h1", "<Interactive.H1>"),
14797
15060
  H2: makeInteractiveTextElement("h2", "<Interactive.H2>"),
14798
15061
  H3: makeInteractiveTextElement("h3", "<Interactive.H3>"),
@@ -14802,19 +15065,19 @@ var Interactive = {
14802
15065
  Header: makeInteractiveTextElement("header", "<Interactive.Header>"),
14803
15066
  Label: makeInteractiveTextElement("label", "<Interactive.Label>"),
14804
15067
  Li: makeInteractiveTextElement("li", "<Interactive.Li>"),
14805
- Line: makeInteractiveNonTextElement("line", "<Interactive.Line>"),
15068
+ Line: makeInteractiveSvgStrokeElement("line", "<Interactive.Line>"),
14806
15069
  Main: makeInteractiveTextElement("main", "<Interactive.Main>"),
14807
15070
  Nav: makeInteractiveTextElement("nav", "<Interactive.Nav>"),
14808
15071
  Ol: makeInteractiveTextElement("ol", "<Interactive.Ol>"),
14809
15072
  P: makeInteractiveTextElement("p", "<Interactive.P>"),
14810
- Path: makeInteractiveNonTextElement("path", "<Interactive.Path>"),
15073
+ Path: makeInteractiveSvgElement("path", "<Interactive.Path>"),
14811
15074
  Pre: makeInteractiveTextElement("pre", "<Interactive.Pre>"),
14812
- Rect: makeInteractiveNonTextElement("rect", "<Interactive.Rect>"),
15075
+ Rect: makeInteractiveSvgElement("rect", "<Interactive.Rect>"),
14813
15076
  Section: makeInteractiveTextElement("section", "<Interactive.Section>"),
14814
15077
  Small: makeInteractiveTextElement("small", "<Interactive.Small>"),
14815
15078
  Span: makeInteractiveTextElement("span", "<Interactive.Span>"),
14816
15079
  Strong: makeInteractiveTextElement("strong", "<Interactive.Strong>"),
14817
- Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveBorderElementSchema),
15080
+ Svg: makeInteractiveElement("svg", "<Interactive.Svg>", interactiveSvgRootElementSchema),
14818
15081
  Text: makeInteractiveElement("text", "<Interactive.Text>", interactiveSvgTextElementSchema),
14819
15082
  Ul: makeInteractiveTextElement("ul", "<Interactive.Ul>")
14820
15083
  };
@@ -14902,7 +15165,7 @@ var CompositionManagerProvider = ({
14902
15165
  getCompositions: () => currentcompositionsRef.current
14903
15166
  };
14904
15167
  }, []);
14905
- const compositionManagerSetters = useMemo33(() => {
15168
+ const compositionManagerSetters = useMemo34(() => {
14906
15169
  return {
14907
15170
  registerComposition,
14908
15171
  unregisterComposition,
@@ -14918,7 +15181,7 @@ var CompositionManagerProvider = ({
14918
15181
  unregisterFolder,
14919
15182
  onlyRenderComposition
14920
15183
  ]);
14921
- const compositionManagerContextValue = useMemo33(() => {
15184
+ const compositionManagerContextValue = useMemo34(() => {
14922
15185
  return {
14923
15186
  compositions,
14924
15187
  folders,
@@ -15040,7 +15303,7 @@ var MediaEnabledProvider = ({
15040
15303
  videoEnabled,
15041
15304
  audioEnabled
15042
15305
  }) => {
15043
- const value = useMemo34(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
15306
+ const value = useMemo35(() => ({ videoEnabled, audioEnabled }), [videoEnabled, audioEnabled]);
15044
15307
  return /* @__PURE__ */ jsx31(MediaEnabledContext.Provider, {
15045
15308
  value,
15046
15309
  children
@@ -15056,13 +15319,13 @@ var RemotionRootContexts = ({
15056
15319
  audioEnabled,
15057
15320
  frameState
15058
15321
  }) => {
15059
- const nonceContext = useMemo35(() => {
15322
+ const nonceContext = useMemo36(() => {
15060
15323
  let counter = 0;
15061
15324
  return {
15062
15325
  getNonce: () => counter++
15063
15326
  };
15064
15327
  }, []);
15065
- const logging = useMemo35(() => {
15328
+ const logging = useMemo36(() => {
15066
15329
  return { logLevel, mountTime: Date.now() };
15067
15330
  }, [logLevel]);
15068
15331
  return /* @__PURE__ */ jsx322(LogLevelContext.Provider, {
@@ -15369,7 +15632,7 @@ var OffthreadVideoForRendering = ({
15369
15632
  if (!src) {
15370
15633
  throw new TypeError("No `src` was passed to <OffthreadVideo>.");
15371
15634
  }
15372
- const id = useMemo36(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
15635
+ const id = useMemo37(() => `offthreadvideo-${random(src)}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
15373
15636
  src,
15374
15637
  sequenceContext?.cumulatedFrom,
15375
15638
  sequenceContext?.relativeFrom,
@@ -15424,14 +15687,14 @@ var OffthreadVideoForRendering = ({
15424
15687
  sequenceContext?.cumulatedNegativeFrom,
15425
15688
  audioStreamIndex
15426
15689
  ]);
15427
- const currentTime = useMemo36(() => {
15690
+ const currentTime = useMemo37(() => {
15428
15691
  return getExpectedMediaFrameUncorrected({
15429
15692
  frame,
15430
15693
  playbackRate: playbackRate || 1,
15431
15694
  startFrom: -mediaStartsAt
15432
15695
  }) / videoConfig.fps;
15433
15696
  }, [frame, mediaStartsAt, playbackRate, videoConfig.fps]);
15434
- const actualSrc = useMemo36(() => {
15697
+ const actualSrc = useMemo37(() => {
15435
15698
  return getOffthreadVideoSource({
15436
15699
  src,
15437
15700
  currentTime,
@@ -15519,7 +15782,7 @@ var OffthreadVideoForRendering = ({
15519
15782
  cancelRender("Failed to load image with src " + imageSrc);
15520
15783
  }
15521
15784
  }, [imageSrc, onError]);
15522
- const className = useMemo36(() => {
15785
+ const className = useMemo37(() => {
15523
15786
  return [OBJECTFIT_CONTAIN_CLASS_NAME, props2.className].filter(truthy).join(" ");
15524
15787
  }, [props2.className]);
15525
15788
  const onImageFrame = useCallback22((img) => {
@@ -15588,7 +15851,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
15588
15851
  throw new Error("SharedAudioContext not found");
15589
15852
  }
15590
15853
  const videoRef = useRef27(null);
15591
- const sharedSource = useMemo37(() => {
15854
+ const sharedSource = useMemo38(() => {
15592
15855
  if (!context.audioContext) {
15593
15856
  return null;
15594
15857
  }
@@ -15791,7 +16054,7 @@ var VideoForDevelopmentRefForwardingFunction = (props2, ref) => {
15791
16054
  current.preload = "auto";
15792
16055
  }
15793
16056
  }, []);
15794
- const actualStyle = useMemo37(() => {
16057
+ const actualStyle = useMemo38(() => {
15795
16058
  return {
15796
16059
  ...style
15797
16060
  };
@@ -15988,7 +16251,7 @@ function useRemotionContexts() {
15988
16251
  const visualModePropStatusesRefContext = React40.useContext(VisualModePropStatusesRefContext);
15989
16252
  const bufferManagerContext = React40.useContext(BufferingContextReact);
15990
16253
  const logLevelContext = React40.useContext(LogLevelContext);
15991
- return useMemo38(() => ({
16254
+ return useMemo39(() => ({
15992
16255
  compositionManagerCtx,
15993
16256
  timelineContext,
15994
16257
  setTimelineContext,
@@ -16097,6 +16360,7 @@ var Internals = {
16097
16360
  sequenceStyleSchema,
16098
16361
  sequenceVisualStyleSchema,
16099
16362
  sequencePremountSchema,
16363
+ sequenceCropSchema,
16100
16364
  textSchema,
16101
16365
  transformSchema,
16102
16366
  premountSchema,
@@ -16220,7 +16484,9 @@ var Internals = {
16220
16484
  hiddenField,
16221
16485
  durationInFramesField,
16222
16486
  freezeField,
16223
- fromField
16487
+ fromField,
16488
+ resolveSequenceCrop,
16489
+ useCropStyle
16224
16490
  };
16225
16491
  var flattenChildren = (children) => {
16226
16492
  const childrenArray = React41.Children.toArray(children);
@@ -16290,7 +16556,7 @@ var validateSeriesSequenceProps = ({
16290
16556
  return offset;
16291
16557
  };
16292
16558
  var SeriesInner = (props2) => {
16293
- const childrenValue = useMemo39(() => {
16559
+ const childrenValue = useMemo40(() => {
16294
16560
  const flattenedChildren = flattenChildren(props2.children);
16295
16561
  const renderChildren = (i, startFrame) => {
16296
16562
  if (i === flattenedChildren.length) {
@@ -16626,7 +16892,7 @@ var VideoForRenderingForwardFunction = ({
16626
16892
  const mountTime = useMountTime();
16627
16893
  const { delayRender: delayRender2, continueRender: continueRender2 } = useDelayRender();
16628
16894
  const { registerRenderAsset, unregisterRenderAsset } = useContext39(RenderAssetManager);
16629
- const id = useMemo40(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
16895
+ const id = useMemo41(() => `video-${random(props2.src ?? "")}-${sequenceContext?.cumulatedFrom}-${sequenceContext?.relativeFrom}-${sequenceContext?.durationInFrames}`, [
16630
16896
  props2.src,
16631
16897
  sequenceContext?.cumulatedFrom,
16632
16898
  sequenceContext?.relativeFrom,
@@ -16957,7 +17223,7 @@ addSequenceStackTraces(Composition);
16957
17223
  addSequenceStackTraces(Folder);
16958
17224
 
16959
17225
  // ../shapes/dist/esm/index.mjs
16960
- import React, { useCallback as useCallback26, useMemo as useMemo41, useRef as useRef29 } from "react";
17226
+ import React, { useCallback as useCallback26, useMemo as useMemo42, useRef as useRef29 } from "react";
16961
17227
  import { version } from "react-dom";
16962
17228
  import { jsx as jsx40, jsxs as jsxs4 } from "react/jsx-runtime";
16963
17229
  import { jsx as jsx210 } from "react/jsx-runtime";
@@ -17139,13 +17405,13 @@ var RenderSvg = ({
17139
17405
  stack,
17140
17406
  ...props
17141
17407
  }) => {
17142
- const actualStyle = useMemo41(() => {
17408
+ const actualStyle = useMemo42(() => {
17143
17409
  return {
17144
17410
  overflow: "visible",
17145
17411
  ...style ?? {}
17146
17412
  };
17147
17413
  }, [style]);
17148
- const actualPathStyle = useMemo41(() => {
17414
+ const actualPathStyle = useMemo42(() => {
17149
17415
  return {
17150
17416
  transformBox: "fill-box",
17151
17417
  ...pathStyle ?? {}
@@ -20126,7 +20392,7 @@ var useHoverTransforms = (ref, disabled) => {
20126
20392
  progress: 0,
20127
20393
  isActive: false
20128
20394
  });
20129
- const eventTarget = useMemo43(() => new EventTarget, []);
20395
+ const eventTarget = useMemo44(() => new EventTarget, []);
20130
20396
  useEffect21(() => {
20131
20397
  if (disabled) {
20132
20398
  eventTarget.dispatchEvent(new Event("disabled"));