@pixerate/editor 0.162.0 → 0.162.1

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.
Files changed (29) hide show
  1. package/dist/animation-editor/index.cjs +57 -57
  2. package/dist/animation-editor/index.js +3 -3
  3. package/dist/{brushstrokeRender-Q4LI22QV.js → brushstrokeRender-7LXCU7PD.js} +2 -2
  4. package/dist/{brushstrokeRender-5WANQIG4.cjs → brushstrokeRender-VO4ZTWVA.cjs} +5 -5
  5. package/dist/canvas/index.cjs +8 -8
  6. package/dist/canvas/index.js +1 -1
  7. package/dist/{chunk-LQLZHP6F.js → chunk-36OKQDCF.js} +7 -4
  8. package/dist/{chunk-GWV4T5NZ.js → chunk-3VLOOO3G.js} +1 -1
  9. package/dist/{chunk-3GJH2MGH.cjs → chunk-5AARIS3R.cjs} +35 -35
  10. package/dist/{chunk-236TKNUR.cjs → chunk-JCXMJUQO.cjs} +2 -2
  11. package/dist/{chunk-32MMQYCQ.cjs → chunk-PA3IMPPS.cjs} +81 -81
  12. package/dist/{chunk-KGTF55R3.js → chunk-QY4KUDMY.js} +1 -1
  13. package/dist/{chunk-2TKHLX6H.js → chunk-SET6KJOP.js} +1 -1
  14. package/dist/{chunk-GNK7SESQ.cjs → chunk-V7GWZIZK.cjs} +7 -4
  15. package/dist/{chunk-EYVVIZJ3.cjs → chunk-WTW7QRTS.cjs} +1 -1
  16. package/dist/{chunk-JGKCC5OF.cjs → chunk-YQ5C5BVK.cjs} +10 -9
  17. package/dist/{chunk-A5UCR2TO.js → chunk-YXKLVD56.js} +10 -9
  18. package/dist/{chunk-45XXVHVG.js → chunk-ZZGPYNS2.js} +1 -1
  19. package/dist/image-editor/index.cjs +638 -638
  20. package/dist/image-editor/index.js +4 -4
  21. package/dist/paint/index.cjs +2 -2
  22. package/dist/paint/index.js +1 -1
  23. package/dist/paint-editor/index.cjs +129 -129
  24. package/dist/paint-editor/index.js +5 -5
  25. package/dist/vector/index.cjs +948 -948
  26. package/dist/vector/index.js +3 -3
  27. package/package.json +3 -3
  28. package/skills/pixerate-chart/SKILL.md +92 -9
  29. package/skills/pixerate-paint-editor/SKILL.md +0 -2
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class;
2
2
 
3
- var _chunk3GJH2MGHcjs = require('../chunk-3GJH2MGH.cjs');
3
+ var _chunk5AARIS3Rcjs = require('../chunk-5AARIS3R.cjs');
4
4
 
5
5
 
6
6
 
@@ -31,8 +31,8 @@ var _chunkEBDZWIOPcjs = require('../chunk-EBDZWIOP.cjs');
31
31
 
32
32
 
33
33
 
34
- var _chunk236TKNURcjs = require('../chunk-236TKNUR.cjs');
35
- require('../chunk-JGKCC5OF.cjs');
34
+ var _chunkJCXMJUQOcjs = require('../chunk-JCXMJUQO.cjs');
35
+ require('../chunk-YQ5C5BVK.cjs');
36
36
  require('../chunk-CVFAAZXE.cjs');
37
37
 
38
38
 
@@ -596,7 +596,7 @@ function smoothMotionTimes(points, start, duration, pacing = "even") {
596
596
  function motionTextLayout(nodes, id) {
597
597
  const group = _optionalChain([nodes, 'access', _5 => _5.get, 'call', _6 => _6(id), 'optionalAccess', _7 => _7.node]);
598
598
  if (!group || group.type !== "group") return null;
599
- const letters = _chunk236TKNURcjs.collectPathNodes.call(void 0, group).map((p) => ({ id: p.id, b: _optionalChain([nodes, 'access', _8 => _8.get, 'call', _9 => _9(p.id), 'optionalAccess', _10 => _10.bounds]) })).filter((l) => !!l.b && l.b.width + l.b.height > 0);
599
+ const letters = _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, group).map((p) => ({ id: p.id, b: _optionalChain([nodes, 'access', _8 => _8.get, 'call', _9 => _9(p.id), 'optionalAccess', _10 => _10.bounds]) })).filter((l) => !!l.b && l.b.width + l.b.height > 0);
600
600
  if (!letters.length) return null;
601
601
  const lines = [];
602
602
  for (const l of [...letters].sort((a, c) => a.b.y + a.b.height / 2 - (c.b.y + c.b.height / 2))) {
@@ -681,21 +681,21 @@ function indexMotionNodes(nodes) {
681
681
  const out = /* @__PURE__ */ new Map();
682
682
  const walk = (list, parentWorld, ancestors) => {
683
683
  for (const node of list) {
684
- const local = _chunk236TKNURcjs.vectorNodeBounds.call(void 0, node);
685
- const bounds = _chunk236TKNURcjs.vectorNodeBounds.call(void 0, node, parentWorld);
684
+ const local = _chunkJCXMJUQOcjs.vectorNodeBounds.call(void 0, node);
685
+ const bounds = _chunkJCXMJUQOcjs.vectorNodeBounds.call(void 0, node, parentWorld);
686
686
  const center = local ? { x: local.x + local.width / 2, y: local.y + local.height / 2 } : { x: 0, y: 0 };
687
687
  if (!out.has(node.id)) out.set(node.id, { node, ancestors, parentWorld, center, bounds, box: local });
688
- if (node.type === "group") walk(node.children, _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
688
+ if (node.type === "group") walk(node.children, _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.nodeMatrix.call(void 0, node), parentWorld), [...ancestors, node.id]);
689
689
  }
690
690
  };
691
- walk(nodes, _chunk236TKNURcjs.IDENTITY_MATRIX, []);
691
+ walk(nodes, _chunkJCXMJUQOcjs.IDENTITY_MATRIX, []);
692
692
  indexCache.set(nodes, out);
693
693
  return out;
694
694
  }
695
695
  var solid = (paint) => typeof paint === "string" && paint !== "none" ? paint : void 0;
696
696
  function firstPaint(node, key) {
697
697
  if (node.type === "path") return solid(node[key]);
698
- for (const p of _chunk236TKNURcjs.collectPathNodes.call(void 0, node)) {
698
+ for (const p of _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node)) {
699
699
  const s = solid(p[key]);
700
700
  if (s) return s;
701
701
  }
@@ -703,7 +703,7 @@ function firstPaint(node, key) {
703
703
  }
704
704
  function strokeReach(node) {
705
705
  let reach = 0;
706
- for (const p of node.type === "path" ? [node] : _chunk236TKNURcjs.collectPathNodes.call(void 0, node)) {
706
+ for (const p of node.type === "path" ? [node] : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node)) {
707
707
  if (p.stroke == null || p.stroke === "none") continue;
708
708
  const width = _nullishCoalesce(p.strokeWidth, () => ( 1));
709
709
  reach = Math.max(reach, p.strokeAlign === "outside" ? width : p.strokeAlign === "inside" ? 0 : width / 2);
@@ -773,7 +773,7 @@ function motionRestValue(entry, property, artwork) {
773
773
  case "stroke":
774
774
  return _nullishCoalesce((node && firstPaint(node, property)), () => ( "transparent"));
775
775
  case "strokeWidth": {
776
- const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunk236TKNURcjs.collectPathNodes.call(void 0, node)[0] : void 0;
776
+ const path = _optionalChain([node, 'optionalAccess', _13 => _13.type]) === "path" ? node : node ? _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node)[0] : void 0;
777
777
  return _nullishCoalesce(_optionalChain([path, 'optionalAccess', _14 => _14.strokeWidth]), () => ( 1));
778
778
  }
779
779
  case "shape":
@@ -884,12 +884,12 @@ function resolveMotionCamera(camera, scene) {
884
884
  const r = camera;
885
885
  return { x: r.x, y: r.y, width: r.width, height: r.height };
886
886
  }
887
- function motionPathLength(node, parentWorld = _chunk236TKNURcjs.IDENTITY_MATRIX) {
887
+ function motionPathLength(node, parentWorld = _chunkJCXMJUQOcjs.IDENTITY_MATRIX) {
888
888
  let longest = 0;
889
- const paths = node.type === "path" ? [node] : _chunk236TKNURcjs.collectPathNodes.call(void 0, node);
889
+ const paths = node.type === "path" ? [node] : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node);
890
890
  for (const p of paths) {
891
891
  try {
892
- longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
892
+ longest = Math.max(longest, _chunkGF2RBSDMcjs.bezierPathLength.call(void 0, _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, p, parentWorld, { effects: false })));
893
893
  } catch (e2) {
894
894
  }
895
895
  }
@@ -1142,12 +1142,12 @@ function compileMotionScene(scene) {
1142
1142
  const order2 = _nullishCoalesce(o.order, () => ( "together"));
1143
1143
  const pace = _nullishCoalesce(o.pace, () => ( "time"));
1144
1144
  if (order2 === "together" && pace === "time") return null;
1145
- const paths = entry.node.type === "path" ? [entry.node] : _chunk236TKNURcjs.collectPathNodes.call(void 0, entry.node);
1145
+ const paths = entry.node.type === "path" ? [entry.node] : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, entry.node);
1146
1146
  let list = paths.map((p) => {
1147
1147
  const at = nodes.get(p.id);
1148
1148
  let first = { x: 0, y: 0 };
1149
1149
  try {
1150
- const m = _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunk236TKNURcjs.IDENTITY_MATRIX)), { effects: false })[0];
1150
+ const m = _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, p, _nullishCoalesce(_optionalChain([at, 'optionalAccess', _41 => _41.parentWorld]), () => ( _chunkJCXMJUQOcjs.IDENTITY_MATRIX)), { effects: false })[0];
1151
1151
  if (m && m.type === "M") first = { x: m.x, y: m.y };
1152
1152
  } catch (e3) {
1153
1153
  }
@@ -1259,17 +1259,17 @@ function compileMotionScene(scene) {
1259
1259
  let dx = _nullishCoalesce(_optionalChain([command3, 'access', _44 => _44.by, 'optionalAccess', _45 => _45.x]), () => ( 0));
1260
1260
  let dy = _nullishCoalesce(_optionalChain([command3, 'access', _46 => _46.by, 'optionalAccess', _47 => _47.y]), () => ( 0));
1261
1261
  if (command3.to) {
1262
- const inv = _chunk236TKNURcjs.invertMatrix.call(void 0, entry.parentWorld);
1263
- const target = _chunk236TKNURcjs.applyMatrix.call(void 0, inv, command3.to);
1262
+ const inv = _chunkJCXMJUQOcjs.invertMatrix.call(void 0, entry.parentWorld);
1263
+ const target = _chunkJCXMJUQOcjs.applyMatrix.call(void 0, inv, command3.to);
1264
1264
  dx = target.x - (entry.center.x + num2("x"));
1265
1265
  dy = target.y - (entry.center.y + num2("y"));
1266
1266
  }
1267
1267
  if (_optionalChain([command3, 'access', _48 => _48.via, 'optionalAccess', _49 => _49.length])) {
1268
- const inv = _chunk236TKNURcjs.invertMatrix.call(void 0, entry.parentWorld);
1268
+ const inv = _chunkJCXMJUQOcjs.invertMatrix.call(void 0, entry.parentWorld);
1269
1269
  const x0 = num2("x");
1270
1270
  const y0 = num2("y");
1271
1271
  const add = command3.blend === "add";
1272
- const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunk236TKNURcjs.applyMatrix.call(void 0, inv, p)).map((p) => ({ x: p.x - entry.center.x - x0, y: p.y - entry.center.y - y0 })), { x: dx, y: dy }];
1272
+ const offsets = [{ x: 0, y: 0 }, ...command3.via.map((p) => _chunkJCXMJUQOcjs.applyMatrix.call(void 0, inv, p)).map((p) => ({ x: p.x - entry.center.x - x0, y: p.y - entry.center.y - y0 })), { x: dx, y: dy }];
1273
1273
  const times = _optionalChain([command3, 'access', _50 => _50.times, 'optionalAccess', _51 => _51.length]) === command3.via.length ? [start, ...command3.times.map((f) => start + f * (end - start)), end] : smoothMotionTimes(offsets, start, end - start, _nullishCoalesce(command3.pacing, () => ( "even")));
1274
1274
  for (const axis of ["x", "y"]) {
1275
1275
  const base = add ? 0 : axis === "x" ? x0 : y0;
@@ -1412,13 +1412,13 @@ function morphBetween(a, b) {
1412
1412
  let inner = morphCache.get(a);
1413
1413
  if (!inner) morphCache.set(a, inner = /* @__PURE__ */ new WeakMap());
1414
1414
  let morph = inner.get(b);
1415
- if (!morph) inner.set(b, morph = _chunk3GJH2MGHcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
1415
+ if (!morph) inner.set(b, morph = _chunk5AARIS3Rcjs.createVectorMorph.call(void 0, a, b, { id: a.id }));
1416
1416
  return morph;
1417
1417
  }
1418
1418
  function shapeIn(entry, shape) {
1419
1419
  if (shape === entry) return entry.node;
1420
- const m = _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunk236TKNURcjs.invertMatrix.call(void 0, entry.parentWorld));
1421
- return { ...shape.node, ..._chunk236TKNURcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
1420
+ const m = _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.nodeMatrix.call(void 0, shape.node), shape.parentWorld), _chunkJCXMJUQOcjs.invertMatrix.call(void 0, entry.parentWorld));
1421
+ return { ...shape.node, ..._chunkJCXMJUQOcjs.isIdentityMatrix.call(void 0, m) ? { transform: void 0 } : { transform: m } };
1422
1422
  }
1423
1423
  function shapeAt(entry, timeline, nodes, time) {
1424
1424
  const track = timeline.tracks.get(motionTrackKey(entry.node.id, "shape"));
@@ -1438,7 +1438,7 @@ function shapeAt(entry, timeline, nodes, time) {
1438
1438
  function motionFollowRoute(entry, path) {
1439
1439
  if (!path || path.node.type !== "path") return null;
1440
1440
  try {
1441
- return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunk236TKNURcjs.invertMatrix.call(void 0, entry.parentWorld));
1441
+ return _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, path.node, path.parentWorld, { effects: false }), _chunkJCXMJUQOcjs.invertMatrix.call(void 0, entry.parentWorld));
1442
1442
  } catch (e4) {
1443
1443
  return null;
1444
1444
  }
@@ -1472,9 +1472,9 @@ function motionNodeOffset(entry, timeline, time, nodes = indexMotionNodes([entry
1472
1472
  const scaleX = read("scaleX", 1);
1473
1473
  const scaleY = read("scaleY", 1);
1474
1474
  const c = entry.center;
1475
- let matrix = _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunk236TKNURcjs.rotateMatrix.call(void 0, rotation, c)), _chunk236TKNURcjs.translateMatrix.call(void 0, dx, dy));
1475
+ let matrix = _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.scaleMatrix.call(void 0, scaleX, scaleY, c), _chunkJCXMJUQOcjs.rotateMatrix.call(void 0, rotation, c)), _chunkJCXMJUQOcjs.translateMatrix.call(void 0, dx, dy));
1476
1476
  const along = follow ? followAt(entry, timeline, nodes, time) : null;
1477
- if (along) matrix = _chunk236TKNURcjs.multiplyMatrices.call(void 0, matrix, _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunk236TKNURcjs.rotateMatrix.call(void 0, along.angle)), _chunk236TKNURcjs.translateMatrix.call(void 0, along.x, along.y)));
1477
+ if (along) matrix = _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, matrix, _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.translateMatrix.call(void 0, -c.x, -c.y), _chunkJCXMJUQOcjs.rotateMatrix.call(void 0, along.angle)), _chunkJCXMJUQOcjs.translateMatrix.call(void 0, along.x, along.y)));
1478
1478
  return { matrix, dx, dy, rotation, scaleX, scaleY, follow: along };
1479
1479
  }
1480
1480
  function motionNodeClips(id, timeline, time) {
@@ -1541,7 +1541,7 @@ function motionFrameAt(scene, time, options = {}) {
1541
1541
  const start = Math.min(1, Math.max(0, typeof drawStart === "number" ? drawStart : 0));
1542
1542
  const end = Math.min(1, Math.max(0, typeof drawEnd === "number" ? drawEnd : 1));
1543
1543
  if (start > 0 || end < 1) {
1544
- const trim = _chunk236TKNURcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
1544
+ const trim = _chunkJCXMJUQOcjs.createVectorEffect.call(void 0, "trim", MOTION_DRAW_EFFECT_ID, { start: tidy(start * 100), end: tidy(end * 100) });
1545
1545
  p = { ...p, effects: [trim, ...(_nullishCoalesce(p.effects, () => ( []))).filter((e) => e.id !== MOTION_DRAW_EFFECT_ID)] };
1546
1546
  }
1547
1547
  }
@@ -1555,8 +1555,8 @@ function motionFrameAt(scene, time, options = {}) {
1555
1555
  if (o >= 1) delete out.opacity;
1556
1556
  }
1557
1557
  const offset = options.offsets === false ? null : motionNodeOffset(entry, timeline, time, nodes);
1558
- if (offset && !_chunk236TKNURcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
1559
- const m = _chunk236TKNURcjs.multiplyMatrices.call(void 0, _chunk236TKNURcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
1558
+ if (offset && !_chunkJCXMJUQOcjs.isIdentityMatrix.call(void 0, offset.matrix)) {
1559
+ const m = _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _chunkJCXMJUQOcjs.nodeMatrix.call(void 0, out), offset.matrix).map(tidy);
1560
1560
  out = { ...out, transform: m };
1561
1561
  }
1562
1562
  return out;
@@ -1576,7 +1576,7 @@ function motionFrameToSvg(scene, time, options = {}) {
1576
1576
  const wrap = { ...options.wrap };
1577
1577
  for (const [id, clips] of Object.entries(frame.clips))
1578
1578
  wrap[id] = [..._nullishCoalesce(wrap[id], () => ( [])), ...clips.map((clip, i) => ({ clip: { id: `${prefix}reveal-${id}-${i}`, shape: clip.shape, attrs: motionClipAttrs(clip) } }))];
1579
- return withViewBox(_chunk236TKNURcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
1579
+ return withViewBox(_chunkJCXMJUQOcjs.vectorDocumentToSvg.call(void 0, frame.document, { ...options, wrap }), frame.camera);
1580
1580
  }
1581
1581
  function withViewBox(svg, box) {
1582
1582
  const f = (n) => String(Math.round(n * 1e3) / 1e3);
@@ -1759,8 +1759,8 @@ function visibleAt(timeline, id, time, node) {
1759
1759
  if (Array.isArray(rect) && (rect[2] <= 1e-4 || rect[3] <= 1e-4)) return false;
1760
1760
  const circle = clip("clipCircle");
1761
1761
  if (Array.isArray(circle) && circle[2] <= 1e-4) return false;
1762
- const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunk236TKNURcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
1763
- const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunk236TKNURcjs.collectPathNodes.call(void 0, node).length === 0 || _chunk236TKNURcjs.collectPathNodes.call(void 0, node).some((p) => {
1762
+ const hasFill = node.type === "path" ? !!node.fill && node.fill !== "none" : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node).some((p) => p.fill && p.fill !== "none");
1763
+ const drawn = num2("drawEnd", 1) > 0.01 && (node.type === "path" || _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node).length === 0 || _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node).some((p) => {
1764
1764
  const v = trackValue(timeline.tracks.get(motionTrackKey(p.id, "drawEnd")), time);
1765
1765
  return typeof v !== "number" || v > 0.01;
1766
1766
  }));
@@ -1846,7 +1846,7 @@ function checkMotionScene(scene) {
1846
1846
  }
1847
1847
  for (const id of targets) {
1848
1848
  const node = nodes.get(id).node;
1849
- const paths = node.type === "path" ? [node] : _chunk236TKNURcjs.collectPathNodes.call(void 0, node);
1849
+ const paths = node.type === "path" ? [node] : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node);
1850
1850
  if (paths.some((p) => p[key] !== void 0 && p[key] !== null && typeof p[key] !== "string"))
1851
1851
  issues.push(_chunkEBDZWIOPcjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient ${key}; it switches to ${color} at the end instead of blending.`, { ...where, ids: [id] }));
1852
1852
  }
@@ -1859,7 +1859,7 @@ function checkMotionScene(scene) {
1859
1859
  else
1860
1860
  for (const id of targets) {
1861
1861
  const node = nodes.get(id).node;
1862
- const paths = node.type === "path" ? [node] : _chunk236TKNURcjs.collectPathNodes.call(void 0, node);
1862
+ const paths = node.type === "path" ? [node] : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node);
1863
1863
  if (paths.some((p) => typeof p[key] !== "string"))
1864
1864
  issues.push(_chunkEBDZWIOPcjs.motionIssue.call(void 0, "paint-not-color", `"${id}" has a gradient or no ${key}, so a colour pulse cannot tint it; give it a solid ${key} or pulse the ${key === "fill" ? "stroke" : "fill"}.`, { ...where, ids: [id] }));
1865
1865
  }
@@ -2304,7 +2304,7 @@ function motionNodePose(scene, id, time) {
2304
2304
  if (!entry) throw new Error(`There is no element ${_chunkEBDZWIOPcjs.namedWithSuggestion.call(void 0, id, [...indexMotionNodes(scene.artwork.nodes).keys()])} in the artwork.`);
2305
2305
  const timeline = compileMotionScene(scene);
2306
2306
  const drawn = indexMotionNodes(motionFrameAt(scene, time).document.nodes).get(id);
2307
- const centre = _chunk236TKNURcjs.applyMatrix.call(void 0, entry.parentWorld, { x: entry.center.x + motionPropertyValue(timeline, id, "x", time), y: entry.center.y + motionPropertyValue(timeline, id, "y", time) });
2307
+ const centre = _chunkJCXMJUQOcjs.applyMatrix.call(void 0, entry.parentWorld, { x: entry.center.x + motionPropertyValue(timeline, id, "x", time), y: entry.center.y + motionPropertyValue(timeline, id, "y", time) });
2308
2308
  const paint = (property) => _nullishCoalesce(trackValue(timeline.tracks.get(motionTrackKey(id, property)), time), () => ( motionRestValue(entry, property, scene.artwork)));
2309
2309
  const fill = paint("fill");
2310
2310
  const stroke = paint("stroke");
@@ -2651,7 +2651,7 @@ function toFlairSvgMotion(scene, options = {}) {
2651
2651
  raw: (t) => transformAt(t, true)
2652
2652
  });
2653
2653
  }
2654
- const paths = node.type === "path" ? [node] : _chunk236TKNURcjs.collectPathNodes.call(void 0, node);
2654
+ const paths = node.type === "path" ? [node] : _chunkJCXMJUQOcjs.collectPathNodes.call(void 0, node);
2655
2655
  for (const path of paths) {
2656
2656
  if (pathsSeen.has(path.id)) continue;
2657
2657
  pathsSeen.add(path.id);
@@ -2673,7 +2673,7 @@ function toFlairSvgMotion(scene, options = {}) {
2673
2673
  if (shapeSegments.length) {
2674
2674
  if (node.type !== "path") notes.push(`"${id}" is a group: its morph or effect animation is not exported (Flair tweens one path's "d").`);
2675
2675
  else {
2676
- const inverse = _chunk236TKNURcjs.invertMatrix.call(void 0, _chunk236TKNURcjs.nodeMatrix.call(void 0, node));
2676
+ const inverse = _chunkJCXMJUQOcjs.invertMatrix.call(void 0, _chunkJCXMJUQOcjs.nodeMatrix.call(void 0, node));
2677
2677
  channels.push({
2678
2678
  id,
2679
2679
  kind: "attr",
@@ -2682,9 +2682,9 @@ function toFlairSvgMotion(scene, options = {}) {
2682
2682
  exact: () => false,
2683
2683
  value: (t) => {
2684
2684
  const frame = motionFrameAt(scene, t, { draw: false, offsets: false });
2685
- const now = _chunk236TKNURcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _114 => _114(frame.document.nodes), 'access', _115 => _115.get, 'call', _116 => _116(id), 'optionalAccess', _117 => _117.node]));
2685
+ const now = _chunkJCXMJUQOcjs.expandVectorAppearance.call(void 0, _optionalChain([indexMotionNodes, 'call', _114 => _114(frame.document.nodes), 'access', _115 => _115.get, 'call', _116 => _116(id), 'optionalAccess', _117 => _117.node]));
2686
2686
  if (!now || now.type !== "path") return "";
2687
- const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, now, _chunk236TKNURcjs.IDENTITY_MATRIX, { effects: false }), inverse);
2687
+ const bezier = _chunkGF2RBSDMcjs.transformBezierPath.call(void 0, _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, now, _chunkJCXMJUQOcjs.IDENTITY_MATRIX, { effects: false }), inverse);
2688
2688
  return _chunkGF2RBSDMcjs.bezierPathToSvg.call(void 0, bezier, { precision: Math.min(precision, 2) });
2689
2689
  }
2690
2690
  });
@@ -2791,7 +2791,7 @@ function toFlairSvgMotion(scene, options = {}) {
2791
2791
  }
2792
2792
  if (scene.motionBlur) notes.push("Motion blur is drawn on the stage only; Flair plays the scene sharp.");
2793
2793
  if (trigger && (_nullishCoalesce(scene.loop, () => ( "none"))) !== "none") notes.push(`The scene plays on ${trigger}, so its loop does not apply in Flair.`);
2794
- let svg = _chunk236TKNURcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunk236TKNURcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
2794
+ let svg = _chunkJCXMJUQOcjs.vectorDocumentToSvg.call(void 0, { ...scene.artwork, nodes: _chunkJCXMJUQOcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) }, { pretty: false, precision, wrap });
2795
2795
  if (routes.length) svg = svg.replace(/^(<svg[^>]*>)/, `$1<defs>${routes.join("")}</defs>`);
2796
2796
  let motion = { svg, animate };
2797
2797
  if (_optionalChain([scene, 'access', _120 => _120.controls, 'optionalAccess', _121 => _121.length])) {
@@ -2875,14 +2875,14 @@ function easingOf(ease, fallback) {
2875
2875
  return fallback;
2876
2876
  }
2877
2877
  function poseOf(value, entry) {
2878
- const t = _chunk236TKNURcjs.parseSvgTransform.call(void 0, String(value));
2879
- const o = _chunk236TKNURcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunk236TKNURcjs.invertMatrix.call(void 0, _chunk236TKNURcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
2878
+ const t = _chunkJCXMJUQOcjs.parseSvgTransform.call(void 0, String(value));
2879
+ const o = _chunkJCXMJUQOcjs.multiplyMatrices.call(void 0, _nullishCoalesce(_chunkJCXMJUQOcjs.invertMatrix.call(void 0, _chunkJCXMJUQOcjs.nodeMatrix.call(void 0, entry.node)), () => ( [1, 0, 0, 1, 0, 0])), t);
2880
2880
  const sx = Math.hypot(o[0], o[1]);
2881
2881
  if (!(sx > 1e-9)) return null;
2882
2882
  const sy = (o[0] * o[3] - o[1] * o[2]) / sx;
2883
2883
  if (Math.abs(o[2] + o[1] / sx * sy) > 1e-6 || Math.abs(o[3] - o[0] / sx * sy) > 1e-6) return null;
2884
2884
  const c = entry.center;
2885
- const moved = _chunk236TKNURcjs.applyMatrix.call(void 0, o, c);
2885
+ const moved = _chunkJCXMJUQOcjs.applyMatrix.call(void 0, o, c);
2886
2886
  return { dx: moved.x - c.x, dy: moved.y - c.y, rotation: Math.atan2(o[1], o[0]) * 180 / Math.PI, sx, sy };
2887
2887
  }
2888
2888
  var near = (a, b, eps = 1e-6) => Math.abs(a - b) < eps;
@@ -2967,7 +2967,7 @@ function fromFlairSvgMotion(input, options = {}) {
2967
2967
  const notes = [];
2968
2968
  if (!input || typeof input.svg !== "string") throw new Error('Give a Flair SvgMotion: { svg: "<svg \u2026>", animate: [ \u2026 ] }.');
2969
2969
  const { motion, controls } = resolvePlaceholders(input, notes);
2970
- const artwork = _chunk236TKNURcjs.parseVectorSvg.call(void 0, motion.svg);
2970
+ const artwork = _chunkJCXMJUQOcjs.parseVectorSvg.call(void 0, motion.svg);
2971
2971
  const nodes = indexMotionNodes(artwork.nodes);
2972
2972
  const byStep = /* @__PURE__ */ new Map();
2973
2973
  for (const anim of _nullishCoalesce(motion.animate, () => ( []))) {
@@ -3214,9 +3214,9 @@ function toLottie(scene, options = {}) {
3214
3214
  const items = [];
3215
3215
  const shapeSegments = [...timeline.tracks.entries()].filter(([k]) => k.startsWith(`${path.id}\0`) && (k.endsWith("\0shape") || k.includes("\0effect:"))).flatMap(([, v]) => v);
3216
3216
  const geometryAt = (t) => {
3217
- if (!shapeSegments.length) return _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, path);
3217
+ if (!shapeSegments.length) return _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, path);
3218
3218
  const now = _optionalChain([indexMotionNodes, 'call', _130 => _130(motionFrameAt(scene, t, { draw: false, offsets: false }).document.nodes), 'access', _131 => _131.get, 'call', _132 => _132(path.id), 'optionalAccess', _133 => _133.node]);
3219
- return now && now.type === "path" ? _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, _chunk236TKNURcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunk236TKNURcjs.vectorPathWorldBezier.call(void 0, path);
3219
+ return now && now.type === "path" ? _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, _chunkJCXMJUQOcjs.expandVectorAppearances.call(void 0, [now])[0]) : _chunkJCXMJUQOcjs.vectorPathWorldBezier.call(void 0, path);
3220
3220
  };
3221
3221
  const rest = lottieContours(_chunkGF2RBSDMcjs.toBezierPath.call(void 0, geometryAt(0)), round3);
3222
3222
  rest.forEach((contour, n) => {
@@ -3289,13 +3289,13 @@ function toLottie(scene, options = {}) {
3289
3289
  const innerTr = STATIC_TR();
3290
3290
  if (node.type === "path") inner = [...pathShapes(node)];
3291
3291
  else if (node.type === "text" || node.type === "instance") {
3292
- const drawn = _chunk236TKNURcjs.expandVectorAppearance.call(void 0, node);
3292
+ const drawn = _chunkJCXMJUQOcjs.expandVectorAppearance.call(void 0, node);
3293
3293
  inner = drawn.type === "path" ? [...pathShapes(drawn)] : drawn.children.filter((c) => c.type === "path").reverse().flatMap((c) => [...pathShapes(c)]);
3294
- notes.push(`"${node.id}": text is exported as its outlines${_chunk236TKNURcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
3294
+ notes.push(`"${node.id}": text is exported as its outlines${_chunkJCXMJUQOcjs.vectorTextHasOutlines.call(void 0, ) ? "" : " (glyph boxes: set an outline text shaper for real glyphs)"}.`);
3295
3295
  } else {
3296
3296
  inner = shown(node.children).reverse().map(nodeGroup);
3297
- const m = _chunk236TKNURcjs.nodeMatrix.call(void 0, node);
3298
- if (m !== _chunk236TKNURcjs.IDENTITY_MATRIX) {
3297
+ const m = _chunkJCXMJUQOcjs.nodeMatrix.call(void 0, node);
3298
+ if (m !== _chunkJCXMJUQOcjs.IDENTITY_MATRIX) {
3299
3299
  const parts = staticParts(m);
3300
3300
  if (!parts) notes.push(`"${node.id}": its transform skews, which is not exported; it is drawn without the skew.`);
3301
3301
  else {
@@ -3308,7 +3308,7 @@ function toLottie(scene, options = {}) {
3308
3308
  const body = { ty: "gr", nm: `${node.id} (own)`, it: [...inner, innerTr] };
3309
3309
  return { ty: "gr", nm: _nullishCoalesce(node.name, () => ( node.id)), it: [body, poseTransform(entry)] };
3310
3310
  };
3311
- const artwork = { ...scene.artwork, nodes: _chunk236TKNURcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
3311
+ const artwork = { ...scene.artwork, nodes: _chunkJCXMJUQOcjs.expandVectorAppearances.call(void 0, scene.artwork.nodes) };
3312
3312
  const content = shown(artwork.nodes).reverse().map(nodeGroup);
3313
3313
  if (artwork.background && rgba(artwork.background))
3314
3314
  content.push({ ty: "gr", nm: "Background", it: [{ ty: "rc", nm: "Background", p: { a: 0, k: [artwork.width / 2, artwork.height / 2] }, s: { a: 0, k: [artwork.width, artwork.height] }, r: { a: 0, k: 0 } }, { ty: "fl", c: { a: 0, k: rgba(artwork.background).map(round3) }, o: { a: 0, k: 100 }, r: 1 }, STATIC_TR()] });
@@ -3407,11 +3407,11 @@ function preset(prst, w, h) {
3407
3407
  const poly = (pts) => [{ closed: true, anchors: pts.map(([x, y]) => ({ x, y })) }];
3408
3408
  switch (prst) {
3409
3409
  case "rect":
3410
- return [_chunk236TKNURcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
3410
+ return [_chunkJCXMJUQOcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
3411
3411
  case "roundRect":
3412
- return [_chunk236TKNURcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
3412
+ return [_chunkJCXMJUQOcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h }, Math.min(w, h) * 0.16667)];
3413
3413
  case "ellipse":
3414
- return [_chunk236TKNURcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
3414
+ return [_chunkJCXMJUQOcjs.ellipseSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
3415
3415
  case "triangle":
3416
3416
  return poly([[w / 2, 0], [w, h], [0, h]]);
3417
3417
  case "rtTriangle":
@@ -3519,7 +3519,7 @@ function shapes(ctx, tree, map) {
3519
3519
  let subpaths = cust ? custom(cust, w, h) : prst ? preset(prst, w, h) : null;
3520
3520
  if (!subpaths) {
3521
3521
  if (prst) ctx.notes.push(`"${name}" is a ${prst}, drawn as its bounding rectangle.`);
3522
- subpaths = [_chunk236TKNURcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
3522
+ subpaths = [_chunkJCXMJUQOcjs.rectSubpath.call(void 0, { x: 0, y: 0, width: w, height: h })];
3523
3523
  }
3524
3524
  const style = kid(el, "style");
3525
3525
  const fill = kid(spPr, "noFill") ? null : _nullishCoalesce(colour(ctx, kid(spPr, "solidFill")), () => ( (el.localName === "cxnSp" ? null : colour(ctx, kid(style, "fillRef")))));
@@ -3757,7 +3757,7 @@ function nextMotionEffectInstance(scene) {
3757
3757
  walk(scene.artwork.nodes);
3758
3758
  for (let i = 1; ; i++) if (!used.has(`fx${i}`)) return `fx${i}`;
3759
3759
  }
3760
- var motionArtworkSvg = (artwork) => _chunk236TKNURcjs.vectorDocumentToSvg.call(void 0, artwork);
3760
+ var motionArtworkSvg = (artwork) => _chunkJCXMJUQOcjs.vectorDocumentToSvg.call(void 0, artwork);
3761
3761
  var tag = (commands, source) => commands.map((c) => c.type === "wait" ? c : { ...c, source });
3762
3762
  function motionCommandsFromEffect(artwork, motion, source) {
3763
3763
  const imported = fromFlairSvgMotion({ svg: motionArtworkSvg(artwork), animate: [..._nullishCoalesce(motion.animate, () => ( []))] });
@@ -5084,7 +5084,7 @@ function createAnimationEditorToolProvider(controller, options = {}) {
5084
5084
  handler: ({ svg }) => {
5085
5085
  let artwork;
5086
5086
  try {
5087
- artwork = _chunk236TKNURcjs.parseVectorSvg.call(void 0, svg);
5087
+ artwork = _chunkJCXMJUQOcjs.parseVectorSvg.call(void 0, svg);
5088
5088
  } catch (error) {
5089
5089
  throw new Error(`The SVG could not be read: ${error.message}. Nothing was changed.`);
5090
5090
  }
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  createVectorMorph
3
- } from "../chunk-KGTF55R3.js";
3
+ } from "../chunk-QY4KUDMY.js";
4
4
  import {
5
5
  MOTION_ISSUE_CODES,
6
6
  motionIssue,
@@ -31,8 +31,8 @@ import {
31
31
  vectorNodeBounds,
32
32
  vectorPathWorldBezier,
33
33
  vectorTextHasOutlines
34
- } from "../chunk-2TKHLX6H.js";
35
- import "../chunk-A5UCR2TO.js";
34
+ } from "../chunk-SET6KJOP.js";
35
+ import "../chunk-YXKLVD56.js";
36
36
  import "../chunk-M6DNZNVY.js";
37
37
  import {
38
38
  bezierPathLength,
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  pathDataToPolyline
3
- } from "./chunk-45XXVHVG.js";
3
+ } from "./chunk-ZZGPYNS2.js";
4
4
  import {
5
5
  parseCssColor
6
6
  } from "./chunk-3CI7FRMK.js";
7
7
  import {
8
8
  BUILTIN_BRUSHES
9
- } from "./chunk-A5UCR2TO.js";
9
+ } from "./chunk-YXKLVD56.js";
10
10
  import {
11
11
  formatNumber,
12
12
  getShapeSvg,
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
2
 
3
- var _chunkEYVVIZJ3cjs = require('./chunk-EYVVIZJ3.cjs');
3
+ var _chunkWTW7QRTScjs = require('./chunk-WTW7QRTS.cjs');
4
4
 
5
5
 
6
6
  var _chunkA2IS7EHEcjs = require('./chunk-A2IS7EHE.cjs');
7
7
 
8
8
 
9
- var _chunkJGKCC5OFcjs = require('./chunk-JGKCC5OF.cjs');
9
+ var _chunkYQ5C5BVKcjs = require('./chunk-YQ5C5BVK.cjs');
10
10
 
11
11
 
12
12
 
@@ -23,14 +23,14 @@ require('./chunk-CWM3CUUX.cjs');
23
23
  require('./chunk-XFM3OCHU.cjs');
24
24
 
25
25
  // src/canvas/brushstrokeRender.ts
26
- var DRY = _chunkJGKCC5OFcjs.BUILTIN_BRUSHES.filter((b) => _chunkEBDCRTZIcjs.isBrushstrokeBrush.call(void 0, b));
26
+ var DRY = _chunkYQ5C5BVKcjs.BUILTIN_BRUSHES.filter((b) => _chunkEBDCRTZIcjs.isBrushstrokeBrush.call(void 0, b));
27
27
  function listCanvasBrushes() {
28
28
  return DRY.map((b) => ({ id: b.id, name: b.name, category: b.category, size: b.tip.size }));
29
29
  }
30
30
  function resolveCanvasBrush(brush, width) {
31
31
  const given = width !== void 0 && Number.isFinite(width) ? Math.max(1, width) : void 0;
32
32
  if (typeof brush === "string") {
33
- const preset = _chunkJGKCC5OFcjs.BUILTIN_BRUSHES.find((b) => b.id === brush);
33
+ const preset = _chunkYQ5C5BVKcjs.BUILTIN_BRUSHES.find((b) => b.id === brush);
34
34
  const ids = DRY.map((b) => b.id).join(", ");
35
35
  if (!preset) throw new Error(`Unknown brush '${brush}'. Use one of the dry paint presets (${ids}) or tip settings ({ hardness, spacing, flow, \u2026 }).`);
36
36
  if (!_chunkEBDCRTZIcjs.isBrushstrokeBrush.call(void 0, preset)) {
@@ -72,7 +72,7 @@ function renderShapeBrushstrokeNow(shape, scale, place = {}) {
72
72
  const textured = typeof seed === "number" && Number.isFinite(seed);
73
73
  const size = _nullishCoalesce(shape.brush.size, () => ( (textured ? void 0 : _nullishCoalesce(shape.strokeWidth, () => ( 3)))));
74
74
  const brush = resolveCanvasBrush(shape.brush.brush, size);
75
- const points = _chunkEYVVIZJ3cjs.pathDataToPolyline.call(void 0, shape.d);
75
+ const points = _chunkWTW7QRTScjs.pathDataToPolyline.call(void 0, shape.d);
76
76
  if (!points.length) return null;
77
77
  const { pressure, tiltX, tiltY } = shape.brush;
78
78
  const input = {