@pixerate/editor 0.250.0 → 0.251.0

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 (123) hide show
  1. package/dist/agent/index.cjs +40 -41
  2. package/dist/agent/index.js +9 -10
  3. package/dist/animation/index.cjs +6 -7
  4. package/dist/animation/index.js +5 -6
  5. package/dist/animation-editor/index.cjs +70 -70
  6. package/dist/animation-editor/index.js +12 -12
  7. package/dist/brushes/index.cjs +1406 -0
  8. package/dist/brushes/index.d.cts +12 -0
  9. package/dist/brushes/index.d.ts +12 -0
  10. package/dist/brushes/index.js +1406 -0
  11. package/dist/brushes/migrate.d.cts +17 -0
  12. package/dist/brushes/migrate.d.ts +17 -0
  13. package/dist/brushes/normalize.d.cts +15 -0
  14. package/dist/brushes/normalize.d.ts +15 -0
  15. package/dist/brushes/presets.d.cts +12 -0
  16. package/dist/brushes/presets.d.ts +12 -0
  17. package/dist/brushes/resolve.d.cts +56 -0
  18. package/dist/brushes/resolve.d.ts +56 -0
  19. package/dist/brushes/schema.d.cts +29 -0
  20. package/dist/brushes/schema.d.ts +29 -0
  21. package/dist/brushes/types.d.cts +323 -0
  22. package/dist/brushes/types.d.ts +323 -0
  23. package/dist/{brushstrokeRender-2FHFLSEG.js → brushstrokeRender-5PYSKZIJ.js} +8 -8
  24. package/dist/{brushstrokeRender-QGRXOKDA.cjs → brushstrokeRender-7FLLSQEC.cjs} +14 -14
  25. package/dist/canvas/index.cjs +57 -58
  26. package/dist/canvas/index.js +31 -32
  27. package/dist/chart/index.cjs +159 -160
  28. package/dist/chart/index.js +9 -10
  29. package/dist/{chunk-NOHJP5TK.js → chunk-2ZJ4DT3M.js} +1 -1
  30. package/dist/{chunk-XZNU4DUX.cjs → chunk-3NS5C7FB.cjs} +76 -76
  31. package/dist/{chunk-UTI5IITZ.cjs → chunk-4ZC5QJE2.cjs} +3 -3
  32. package/dist/{chunk-SMSGP2HQ.js → chunk-5JNA6LLY.js} +1 -1
  33. package/dist/{chunk-RD7RX52G.cjs → chunk-5UEFBM2M.cjs} +207 -18
  34. package/dist/{chunk-WA44NKPF.js → chunk-62Z5WLRA.js} +1 -1
  35. package/dist/{chunk-BVRRIW7F.js → chunk-6GRUVGKU.js} +3 -3
  36. package/dist/{chunk-QARCM66V.js → chunk-6ZZKRH7R.js} +3 -3
  37. package/dist/{chunk-BP6KSGVD.js → chunk-7272D3K2.js} +4 -6
  38. package/dist/{chunk-NTRAVM2I.js → chunk-7P6VF3FG.js} +2 -2
  39. package/dist/chunk-APX63ILU.js +173 -0
  40. package/dist/{chunk-W7L4HUT2.cjs → chunk-CJ6TBL2N.cjs} +16 -16
  41. package/dist/{chunk-7PT4RJL5.cjs → chunk-EUIDTZNQ.cjs} +111 -113
  42. package/dist/{chunk-CXXXAZ7H.js → chunk-F6R67I3A.js} +1 -1
  43. package/dist/{chunk-I7NJPHWV.cjs → chunk-FQPUF2W2.cjs} +35 -606
  44. package/dist/{chunk-D5KGAO4Z.js → chunk-GCVFEPJG.js} +2 -573
  45. package/dist/{chunk-LEQKZGQI.js → chunk-GOBOCZZI.js} +1 -1
  46. package/dist/{chunk-KDLBJ6QR.js → chunk-GYMMNCFT.js} +3 -3
  47. package/dist/{chunk-NUTMINJZ.cjs → chunk-H7ET2ISK.cjs} +52 -52
  48. package/dist/chunk-HS6QDWDF.cjs +1029 -0
  49. package/dist/{chunk-T7KQEMAE.cjs → chunk-HUAISCUX.cjs} +18 -18
  50. package/dist/{chunk-YGQVCQTG.js → chunk-ILP77UD6.js} +1 -1
  51. package/dist/{chunk-S6OT6CTS.cjs → chunk-IWEVV63O.cjs} +31 -33
  52. package/dist/{chunk-M2VKFE5L.cjs → chunk-JFHBXNR2.cjs} +88 -88
  53. package/dist/{chunk-WPUXGDH4.cjs → chunk-JPEHXIB5.cjs} +10 -10
  54. package/dist/chunk-JSDND7DF.cjs +173 -0
  55. package/dist/{chunk-36ZTV7WO.js → chunk-L6Y7TSQ4.js} +1 -1
  56. package/dist/{chunk-YW43M56C.cjs → chunk-LFMKWGFL.cjs} +1 -1
  57. package/dist/{chunk-V6DT2CDH.js → chunk-M2TPMYJE.js} +1 -1
  58. package/dist/{chunk-LJZRHVZV.cjs → chunk-M5GLQQWG.cjs} +2 -2
  59. package/dist/{chunk-JEGJP4OW.js → chunk-MHLU6GRJ.js} +196 -7
  60. package/dist/{chunk-KMPM5JM5.js → chunk-MONXNVZK.js} +4 -6
  61. package/dist/chunk-MTKY6K3Q.js +1029 -0
  62. package/dist/{chunk-MOW3JMNG.cjs → chunk-N76AMOKE.cjs} +42 -42
  63. package/dist/{chunk-75K3W4D6.cjs → chunk-NKGB64CW.cjs} +16 -16
  64. package/dist/{chunk-SGPIVHJB.js → chunk-P3K2JCJA.js} +3 -3
  65. package/dist/chunk-PXDIAYB6.cjs +594 -0
  66. package/dist/{chunk-3TWOCSCY.js → chunk-QC3OXRE4.js} +9 -9
  67. package/dist/{chunk-YM6ZBTXG.cjs → chunk-QLSGTCYT.cjs} +23 -23
  68. package/dist/{chunk-7YW7T5TJ.js → chunk-RHPSE2YR.js} +2 -2
  69. package/dist/{chunk-44BMJJVA.cjs → chunk-RUONPPMC.cjs} +8 -8
  70. package/dist/{chunk-ATK6ABN3.cjs → chunk-SABJMH6M.cjs} +145 -12
  71. package/dist/{chunk-XWOLPNBW.cjs → chunk-SOSBOS5T.cjs} +22 -22
  72. package/dist/{chunk-PPFJHTW5.cjs → chunk-TFF2GTGN.cjs} +22 -24
  73. package/dist/{chunk-X7WRL5ZZ.cjs → chunk-TLOGFIIV.cjs} +37 -37
  74. package/dist/chunk-TXFWZ5ZJ.js +594 -0
  75. package/dist/{chunk-GXAK6Q5J.js → chunk-UFEDHACQ.js} +2 -2
  76. package/dist/{chunk-GA4EU4P3.cjs → chunk-UXETV2NC.cjs} +4 -4
  77. package/dist/{chunk-N4DFDI73.js → chunk-WKMUBATU.js} +1 -1
  78. package/dist/{chunk-3R5P3DVY.cjs → chunk-WRZ6C4TU.cjs} +6 -6
  79. package/dist/{chunk-U4NUOKBT.js → chunk-WZOGDKCQ.js} +134 -1
  80. package/dist/{chunk-6ADHGQ73.js → chunk-YBAPT7NL.js} +2 -4
  81. package/dist/color/index.cjs +4 -6
  82. package/dist/color/index.js +7 -9
  83. package/dist/export/index.cjs +7 -8
  84. package/dist/export/index.js +6 -7
  85. package/dist/extensions/index.cjs +10 -11
  86. package/dist/extensions/index.js +9 -10
  87. package/dist/gradient/index.cjs +33 -34
  88. package/dist/gradient/index.js +4 -5
  89. package/dist/image-editor/index.cjs +845 -844
  90. package/dist/image-editor/index.js +39 -38
  91. package/dist/index.cjs +16 -17
  92. package/dist/index.js +10 -11
  93. package/dist/paint/index.cjs +6 -4
  94. package/dist/paint/index.js +21 -19
  95. package/dist/paint-editor/brushes.d.cts +1 -2
  96. package/dist/paint-editor/brushes.d.ts +1 -2
  97. package/dist/paint-editor/index.cjs +2193 -694
  98. package/dist/paint-editor/index.js +1575 -76
  99. package/dist/paint-editor/mark-settings.d.cts +104 -0
  100. package/dist/paint-editor/mark-settings.d.ts +104 -0
  101. package/dist/paint-editor/procedural.d.cts +2 -75
  102. package/dist/paint-editor/procedural.d.ts +2 -75
  103. package/dist/paint-editor/stickers.d.cts +1 -22
  104. package/dist/paint-editor/stickers.d.ts +1 -22
  105. package/dist/raster/index.cjs +2 -2
  106. package/dist/raster/index.js +9 -9
  107. package/dist/stickers/index.cjs +10 -10
  108. package/dist/stickers/index.js +9 -9
  109. package/dist/tokens/index.cjs +3 -4
  110. package/dist/tokens/index.js +2 -3
  111. package/dist/typography/index.cjs +7 -8
  112. package/dist/typography/index.js +2 -3
  113. package/dist/vector/index.cjs +974 -974
  114. package/dist/vector/index.js +12 -12
  115. package/dist/video-editor/index.cjs +6 -7
  116. package/dist/video-editor/index.js +5 -6
  117. package/package.json +11 -1
  118. package/dist/chunk-4JNWA3VT.cjs +0 -302
  119. package/dist/chunk-7AHBW2CQ.cjs +0 -200
  120. package/dist/chunk-F67XMVDI.js +0 -200
  121. package/dist/chunk-GT77U7QG.cjs +0 -2637
  122. package/dist/chunk-OTEPAQJX.js +0 -2637
  123. package/dist/chunk-WKH5ZAUA.js +0 -302
@@ -2,7 +2,6 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkRD7RX52Gcjs = require('./chunk-RD7RX52G.cjs');
6
5
 
7
6
 
8
7
 
@@ -11,8 +10,7 @@ var _chunkRD7RX52Gcjs = require('./chunk-RD7RX52G.cjs');
11
10
 
12
11
 
13
12
 
14
-
15
- var _chunk7AHBW2CQcjs = require('./chunk-7AHBW2CQ.cjs');
13
+ var _chunk5UEFBM2Mcjs = require('./chunk-5UEFBM2M.cjs');
16
14
 
17
15
  // src/color/gamut.ts
18
16
  var clamp01 = (v) => Math.min(1, Math.max(0, v));
@@ -20,12 +18,12 @@ function inSrgbGamut(c, epsilon = 1e-5) {
20
18
  return c.r >= -epsilon && c.r <= 1 + epsilon && c.g >= -epsilon && c.g <= 1 + epsilon && c.b >= -epsilon && c.b <= 1 + epsilon;
21
19
  }
22
20
  function deltaEOK(a, b) {
23
- const la = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, a);
24
- const lb = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, b);
21
+ const la = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, a);
22
+ const lb = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, b);
25
23
  return Math.hypot(la.l - lb.l, la.a - lb.a, la.b - lb.b);
26
24
  }
27
25
  function toSrgbGamut(c) {
28
- const lch = _chunk7AHBW2CQcjs.oklabToOklch.call(void 0, _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, c));
26
+ const lch = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c));
29
27
  if (lch.l >= 1) return { r: 1, g: 1, b: 1, a: c.a };
30
28
  if (lch.l <= 0) return { r: 0, g: 0, b: 0, a: c.a };
31
29
  if (inSrgbGamut(c)) {
@@ -38,7 +36,7 @@ function toSrgbGamut(c) {
38
36
  const EPS = 1e-4;
39
37
  for (let i = 0; i < 30; i++) {
40
38
  const mid = (low + high) / 2;
41
- const candidate = _chunk7AHBW2CQcjs.oklabToRgb.call(void 0, _chunk7AHBW2CQcjs.oklchToOklab.call(void 0, { l: lch.l, c: mid, h: lch.h, alpha: c.a }));
39
+ const candidate = _chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { l: lch.l, c: mid, h: lch.h, alpha: c.a }));
42
40
  const clipped = {
43
41
  r: clamp01(candidate.r),
44
42
  g: clamp01(candidate.g),
@@ -85,21 +83,21 @@ function formatColor(c, format) {
85
83
  return c.a < 1 ? `rgb(${r} ${g} ${b} / ${round2(c.a)})` : `rgb(${r} ${g} ${b})`;
86
84
  }
87
85
  case "hsl": {
88
- const hsl = _chunk7AHBW2CQcjs.rgbToHsl.call(void 0, toSrgbGamut(c));
86
+ const hsl = _chunk5UEFBM2Mcjs.rgbToHsl.call(void 0, toSrgbGamut(c));
89
87
  const h = (Math.round(hsl.h * 100) / 100).toString();
90
88
  const s = (Math.round(hsl.s * 1e4) / 100).toString();
91
89
  const l = (Math.round(hsl.l * 1e4) / 100).toString();
92
90
  return c.a < 1 ? `hsl(${h} ${s}% ${l}% / ${round2(c.a)})` : `hsl(${h} ${s}% ${l}%)`;
93
91
  }
94
92
  case "oklch": {
95
- const lch = _chunk7AHBW2CQcjs.oklabToOklch.call(void 0, _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, c));
93
+ const lch = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c));
96
94
  const l = (lch.l * 100).toFixed(2);
97
95
  const ch = lch.c.toFixed(4);
98
96
  const h = lch.h.toFixed(2);
99
97
  return c.a < 1 ? `oklch(${l}% ${ch} ${h} / ${round2(c.a)})` : `oklch(${l}% ${ch} ${h})`;
100
98
  }
101
99
  case "oklab": {
102
- const lab = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, c);
100
+ const lab = _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, c);
103
101
  const l = (lab.l * 100).toFixed(2);
104
102
  const a = lab.a.toFixed(4);
105
103
  const b = lab.b.toFixed(4);
@@ -107,36 +105,36 @@ function formatColor(c, format) {
107
105
  }
108
106
  case "p3": {
109
107
  const linSrgb = {
110
- r: _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.r),
111
- g: _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.g),
112
- b: _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.b),
108
+ r: _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c.r),
109
+ g: _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c.g),
110
+ b: _chunk5UEFBM2Mcjs.srgbToLinear.call(void 0, c.b),
113
111
  a: c.a
114
112
  };
115
- const linP3 = _chunk7AHBW2CQcjs.linearSrgbToDisplayP3.call(void 0, linSrgb);
116
- const r = _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linP3.r).toFixed(4);
117
- const g = _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linP3.g).toFixed(4);
118
- const b = _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linP3.b).toFixed(4);
113
+ const linP3 = _chunk5UEFBM2Mcjs.linearSrgbToDisplayP3.call(void 0, linSrgb);
114
+ const r = _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, linP3.r).toFixed(4);
115
+ const g = _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, linP3.g).toFixed(4);
116
+ const b = _chunk5UEFBM2Mcjs.linearToSrgb.call(void 0, linP3.b).toFixed(4);
119
117
  return c.a < 1 ? `color(display-p3 ${r} ${g} ${b} / ${round2(c.a)})` : `color(display-p3 ${r} ${g} ${b})`;
120
118
  }
121
119
  }
122
120
  }
123
121
  function normalizeColor(input) {
124
- const parsed = _chunkRD7RX52Gcjs.parseColor.call(void 0, input);
122
+ const parsed = _chunk5UEFBM2Mcjs.parseColor.call(void 0, input);
125
123
  return parsed ? formatHex(parsed) : null;
126
124
  }
127
125
 
128
126
  // src/color/suggest.ts
129
127
  function suggestAccessibleForeground(foreground, background, options = {}) {
130
128
  const large = _nullishCoalesce(options.large, () => ( false));
131
- const lch = _chunk7AHBW2CQcjs.oklabToOklch.call(void 0, _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, foreground));
132
- const asHex = (l) => _chunkRD7RX52Gcjs.parseColor.call(void 0, formatHex(toSrgbGamut(_chunk7AHBW2CQcjs.oklabToRgb.call(void 0, _chunk7AHBW2CQcjs.oklchToOklab.call(void 0, { ...lch, l })))));
129
+ const lch = _chunk5UEFBM2Mcjs.oklabToOklch.call(void 0, _chunk5UEFBM2Mcjs.rgbToOklab.call(void 0, foreground));
130
+ const asHex = (l) => _chunk5UEFBM2Mcjs.parseColor.call(void 0, formatHex(toSrgbGamut(_chunk5UEFBM2Mcjs.oklabToRgb.call(void 0, _chunk5UEFBM2Mcjs.oklchToOklab.call(void 0, { ...lch, l })))));
133
131
  for (let d = 0.01; d <= 1; d += 0.01) {
134
132
  const downCand = asHex(Math.max(0, lch.l - d));
135
133
  const upCand = asHex(Math.min(1, lch.l + d));
136
- const downRatio = _chunkRD7RX52Gcjs.contrastRatio.call(void 0, downCand, background);
137
- const upRatio = _chunkRD7RX52Gcjs.contrastRatio.call(void 0, upCand, background);
138
- const downPass = _chunkRD7RX52Gcjs.contrastLevel.call(void 0, downRatio, { large }) !== "fail";
139
- const upPass = _chunkRD7RX52Gcjs.contrastLevel.call(void 0, upRatio, { large }) !== "fail";
134
+ const downRatio = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, downCand, background);
135
+ const upRatio = _chunk5UEFBM2Mcjs.contrastRatio.call(void 0, upCand, background);
136
+ const downPass = _chunk5UEFBM2Mcjs.contrastLevel.call(void 0, downRatio, { large }) !== "fail";
137
+ const upPass = _chunk5UEFBM2Mcjs.contrastLevel.call(void 0, upRatio, { large }) !== "fail";
140
138
  if (downPass && upPass) return formatHex(downRatio >= upRatio ? downCand : upCand);
141
139
  if (downPass) return formatHex(downCand);
142
140
  if (upPass) return formatHex(upCand);
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- var _chunkWPUXGDH4cjs = require('./chunk-WPUXGDH4.cjs');
21
+ var _chunkJPEHXIB5cjs = require('./chunk-JPEHXIB5.cjs');
22
22
 
23
23
 
24
24
 
@@ -29,7 +29,7 @@ var _chunkGF2RBSDMcjs = require('./chunk-GF2RBSDM.cjs');
29
29
  var _chunkDWJJI6RTcjs = require('./chunk-DWJJI6RT.cjs');
30
30
 
31
31
 
32
- var _chunkUTI5IITZcjs = require('./chunk-UTI5IITZ.cjs');
32
+ var _chunk4ZC5QJE2cjs = require('./chunk-4ZC5QJE2.cjs');
33
33
 
34
34
  // src/vector/blend.ts
35
35
  var lerpN = (a, b, t) => a + (b - a) * t;
@@ -37,7 +37,7 @@ var lerpP = (a, b, t) => [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
37
37
  var toP = (v) => [v.x, v.y];
38
38
  var mapP = (m, p) => [m[0] * p[0] + m[2] * p[1] + m[4], m[1] * p[0] + m[3] * p[1] + m[5]];
39
39
  var curvesOf = (c) => Math.max(0, (c.pts.length - 1) / 3) | 0;
40
- function subpathToMorphContour(sp, m = _chunkWPUXGDH4cjs.IDENTITY_MATRIX) {
40
+ function subpathToMorphContour(sp, m = _chunkJPEHXIB5cjs.IDENTITY_MATRIX) {
41
41
  const n = sp.anchors.length;
42
42
  if (!n) return null;
43
43
  const first = mapP(m, toP(sp.anchors[0]));
@@ -67,8 +67,8 @@ function isStraight(p0, p1, p2, p3) {
67
67
  const u2 = along(p2);
68
68
  return off(p1) < tol && off(p2) < tol && u1 >= -1e-9 && u1 <= 1 + 1e-9 && u2 >= -1e-9 && u2 <= 1 + 1e-9;
69
69
  }
70
- function morphContourToSubpath(c, m = _chunkWPUXGDH4cjs.IDENTITY_MATRIX, closed = c.closed) {
71
- const pts = _chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, m) ? c.pts : c.pts.map((p) => mapP(m, p));
70
+ function morphContourToSubpath(c, m = _chunkJPEHXIB5cjs.IDENTITY_MATRIX, closed = c.closed) {
71
+ const pts = _chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, m) ? c.pts : c.pts.map((p) => mapP(m, p));
72
72
  const curves = curvesOf(c);
73
73
  const dropLast = closed && c.closed && curves > 0;
74
74
  const count = dropLast ? curves : curves + 1;
@@ -84,7 +84,7 @@ function morphContourToSubpath(c, m = _chunkWPUXGDH4cjs.IDENTITY_MATRIX, closed
84
84
  anchors[(k + 1) % count].in = { x: p2[0], y: p2[1] };
85
85
  }
86
86
  for (const a of anchors) {
87
- const type = _chunkWPUXGDH4cjs.inferAnchorType.call(void 0, a);
87
+ const type = _chunkJPEHXIB5cjs.inferAnchorType.call(void 0, a);
88
88
  if (type !== "corner") a.type = type;
89
89
  }
90
90
  const isClosed = closed && curves > 0;
@@ -267,7 +267,7 @@ function bestStart(fixed, free, useShapeContext) {
267
267
  return best;
268
268
  }
269
269
  function placeIn(c, from, to) {
270
- const b = _chunkWPUXGDH4cjs.unionBounds.call(void 0, [boundsOfPoints(c.pts)]);
270
+ const b = _chunkJPEHXIB5cjs.unionBounds.call(void 0, [boundsOfPoints(c.pts)]);
271
271
  const p = b ? [b.x + b.width / 2, b.y + b.height / 2] : c.pts[0];
272
272
  if (!from || !to) return p;
273
273
  const fx = from.width > 0 ? (p[0] - from.x) / from.width : 0.5;
@@ -452,11 +452,11 @@ function interpolateRigidMatrix(a, b, t) {
452
452
  function interpolateVectorColor(a, b, t) {
453
453
  if (t <= 0) return a;
454
454
  if (t >= 1) return b;
455
- return _nullishCoalesce(_chunkUTI5IITZcjs.mixColorsOklab.call(void 0, a, b, t), () => ( (t < 0.5 ? a : b)));
455
+ return _nullishCoalesce(_chunk4ZC5QJE2cjs.mixColorsOklab.call(void 0, a, b, t), () => ( (t < 0.5 ? a : b)));
456
456
  }
457
457
  function resampleGradientStops(g, offsets) {
458
458
  return offsets.map((offset) => {
459
- const s = _chunkWPUXGDH4cjs.sampleVectorGradient.call(void 0, g, offset);
459
+ const s = _chunkJPEHXIB5cjs.sampleVectorGradient.call(void 0, g, offset);
460
460
  return s.opacity < 1 ? { offset, color: s.color, opacity: Math.round(s.opacity * 1e4) / 1e4 } : { offset, color: s.color };
461
461
  });
462
462
  }
@@ -467,11 +467,11 @@ function lerpAngle(a, b, t) {
467
467
  var lerpPoint = (a, b, t) => ({ x: lerpN(a.x, b.x, t), y: lerpN(a.y, b.y, t) });
468
468
  var sameColourModel = (a, b) => (_nullishCoalesce(a.interpolation, () => ( "srgb"))) === (_nullishCoalesce(b.interpolation, () => ( "srgb"))) && (_nullishCoalesce(a.smoothness, () => ( 0))) === (_nullishCoalesce(b.smoothness, () => ( 0)));
469
469
  function lerpStops(a, b, t) {
470
- let stopsA = _chunkWPUXGDH4cjs.sortedVectorGradientStops.call(void 0, a);
471
- let stopsB = _chunkWPUXGDH4cjs.sortedVectorGradientStops.call(void 0, b);
470
+ let stopsA = _chunkJPEHXIB5cjs.sortedVectorGradientStops.call(void 0, a);
471
+ let stopsB = _chunkJPEHXIB5cjs.sortedVectorGradientStops.call(void 0, b);
472
472
  const resampled = stopsA.length !== stopsB.length || !sameColourModel(a, b);
473
473
  if (resampled) {
474
- const offs = [..._chunkWPUXGDH4cjs.expandVectorGradientStops.call(void 0, a), ..._chunkWPUXGDH4cjs.expandVectorGradientStops.call(void 0, b), ...stopsA, ...stopsB].map((s) => s.offset).filter(Number.isFinite).sort((x, y) => x - y);
474
+ const offs = [..._chunkJPEHXIB5cjs.expandVectorGradientStops.call(void 0, a), ..._chunkJPEHXIB5cjs.expandVectorGradientStops.call(void 0, b), ...stopsA, ...stopsB].map((s) => s.offset).filter(Number.isFinite).sort((x, y) => x - y);
475
475
  const common = offs.filter((o, i) => i === 0 || o - offs[i - 1] > 1e-4);
476
476
  stopsA = resampleGradientStops(a, common);
477
477
  stopsB = resampleGradientStops(b, common);
@@ -498,8 +498,8 @@ function lerpGradient(a, b, t) {
498
498
  }
499
499
  if (near.spread && near.spread !== "pad") out.spread = near.spread;
500
500
  if (near.strokeMode && near.strokeMode !== "within") out.strokeMode = near.strokeMode;
501
- const ea = _chunkWPUXGDH4cjs.hasExplicitGradientGeometry.call(void 0, a);
502
- const eb = _chunkWPUXGDH4cjs.hasExplicitGradientGeometry.call(void 0, b);
501
+ const ea = _chunkJPEHXIB5cjs.hasExplicitGradientGeometry.call(void 0, a);
502
+ const eb = _chunkJPEHXIB5cjs.hasExplicitGradientGeometry.call(void 0, b);
503
503
  if (!ea && !eb) {
504
504
  if (a.angle !== void 0 || b.angle !== void 0 || a.type === "linear" || a.type === "reflected") {
505
505
  const fallback = a.type === "linear" || a.type === "reflected" ? 180 : 90;
@@ -512,10 +512,10 @@ function lerpGradient(a, b, t) {
512
512
  }
513
513
  return out;
514
514
  }
515
- const pa = _chunkWPUXGDH4cjs.vectorGradientPoints.call(void 0, a);
516
- const pb = _chunkWPUXGDH4cjs.vectorGradientPoints.call(void 0, b);
515
+ const pa = _chunkJPEHXIB5cjs.vectorGradientPoints.call(void 0, a);
516
+ const pb = _chunkJPEHXIB5cjs.vectorGradientPoints.call(void 0, b);
517
517
  if (pa.units !== pb.units) {
518
- const src = _chunkWPUXGDH4cjs.explicitVectorGradient.call(void 0, near);
518
+ const src = _chunkJPEHXIB5cjs.explicitVectorGradient.call(void 0, near);
519
519
  return { ...src, stops: out.stops, ...out.interpolation ? { interpolation: out.interpolation } : {}, ...out.smoothness ? { smoothness: out.smoothness } : {} };
520
520
  }
521
521
  out.start = lerpPoint(pa.start, pb.start, t);
@@ -535,14 +535,14 @@ function solidLike(color, like) {
535
535
  function interpolateVectorPaint(a, b, t) {
536
536
  if (t <= 0) return a;
537
537
  if (t >= 1) return b;
538
- const pa = _chunkWPUXGDH4cjs.hasPaint.call(void 0, a);
539
- const pb = _chunkWPUXGDH4cjs.hasPaint.call(void 0, b);
538
+ const pa = _chunkJPEHXIB5cjs.hasPaint.call(void 0, a);
539
+ const pb = _chunkJPEHXIB5cjs.hasPaint.call(void 0, b);
540
540
  if (!pa && !pb) return t < 0.5 ? a : b;
541
541
  if (typeof a === "string" && pa && typeof b === "string" && pb) return interpolateVectorColor(a, b, t);
542
542
  if (!pa && typeof b === "string") return interpolateVectorColor("transparent", b, t);
543
543
  if (!pb && typeof a === "string") return interpolateVectorColor(a, "transparent", t);
544
- const ga = pa && _chunkWPUXGDH4cjs.isVectorGradient.call(void 0, a) ? a : null;
545
- const gb = pb && _chunkWPUXGDH4cjs.isVectorGradient.call(void 0, b) ? b : null;
544
+ const ga = pa && _chunkJPEHXIB5cjs.isVectorGradient.call(void 0, a) ? a : null;
545
+ const gb = pb && _chunkJPEHXIB5cjs.isVectorGradient.call(void 0, b) ? b : null;
546
546
  if (ga && gb) return _nullishCoalesce(lerpGradient(ga, gb, t), () => ( (t < 0.5 ? a : b)));
547
547
  if (gb) return _nullishCoalesce(lerpGradient(solidLike(pa ? a : null, gb), gb, t), () => ( b));
548
548
  if (ga) return _nullishCoalesce(lerpGradient(ga, solidLike(pb ? b : null, ga), t), () => ( a));
@@ -553,8 +553,8 @@ function interpolateWidthProfiles(a, b, t) {
553
553
  const at = [..._nullishCoalesce(a, () => ( [])), ..._nullishCoalesce(b, () => ( [])), { t: 0 }, { t: 1 }].map((p) => p.t).sort((x, y) => x - y);
554
554
  const ts = at.filter((v, i) => i === 0 || v - at[i - 1] > 1e-6);
555
555
  return ts.map((pos) => {
556
- const x = _chunkWPUXGDH4cjs.widthProfileAt.call(void 0, a, pos);
557
- const y = _chunkWPUXGDH4cjs.widthProfileAt.call(void 0, b, pos);
556
+ const x = _chunkJPEHXIB5cjs.widthProfileAt.call(void 0, a, pos);
557
+ const y = _chunkJPEHXIB5cjs.widthProfileAt.call(void 0, b, pos);
558
558
  return { t: pos, left: lerpN(x.left, y.left, t), right: lerpN(x.right, y.right, t) };
559
559
  });
560
560
  }
@@ -597,7 +597,7 @@ function reversedStyle(s) {
597
597
  out.endArrow = s.startArrow;
598
598
  out.startArrowScale = s.endArrowScale;
599
599
  out.endArrowScale = s.startArrowScale;
600
- if (_optionalChain([s, 'access', _6 => _6.strokeWidthProfile, 'optionalAccess', _7 => _7.length])) out.strokeWidthProfile = _chunkWPUXGDH4cjs.reverseWidthProfile.call(void 0, s.strokeWidthProfile);
600
+ if (_optionalChain([s, 'access', _6 => _6.strokeWidthProfile, 'optionalAccess', _7 => _7.length])) out.strokeWidthProfile = _chunkJPEHXIB5cjs.reverseWidthProfile.call(void 0, s.strokeWidthProfile);
601
601
  for (const k of ["startArrow", "endArrow", "startArrowScale", "endArrowScale"]) if (out[k] === void 0) delete out[k];
602
602
  return out;
603
603
  }
@@ -623,19 +623,19 @@ function styleOf(n) {
623
623
  return out;
624
624
  }
625
625
  function contoursOf(node, m) {
626
- return _chunkWPUXGDH4cjs.expandVectorCorners.call(void 0, node.subpaths).map((sp) => subpathToMorphContour(sp, m)).filter((c) => !!c);
626
+ return _chunkJPEHXIB5cjs.expandVectorCorners.call(void 0, node.subpaths).map((sp) => subpathToMorphContour(sp, m)).filter((c) => !!c);
627
627
  }
628
- function preparePathMorph(a, b, options, ma = _chunkWPUXGDH4cjs.nodeMatrix.call(void 0, a), mb = _chunkWPUXGDH4cjs.nodeMatrix.call(void 0, b)) {
628
+ function preparePathMorph(a, b, options, ma = _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, a), mb = _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, b)) {
629
629
  const corr = correspondMorphContours(contoursOf(a, ma), contoursOf(b, mb), options);
630
630
  const sim = procrustes(corr.a, corr.b);
631
631
  const styleA = styleOf(a);
632
632
  const styleB = corr.reversed ? reversedStyle(styleOf(b)) : styleOf(b);
633
- const rigid = !_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, ma) || !_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, mb);
633
+ const rigid = !_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, ma) || !_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, mb);
634
634
  const id = _nullishCoalesce(options.id, () => ( a.id));
635
635
  return (t) => {
636
636
  const contours = interpolateMorphContours(corr.a, corr.b, t, { linear: options.linear, rigidity: options.rigidity, similarity: sim });
637
- const m = rigid ? interpolateRigidMatrix(ma, mb, t) : _chunkWPUXGDH4cjs.IDENTITY_MATRIX;
638
- const back = rigid ? _chunkWPUXGDH4cjs.invertMatrix.call(void 0, m) : _chunkWPUXGDH4cjs.IDENTITY_MATRIX;
637
+ const m = rigid ? interpolateRigidMatrix(ma, mb, t) : _chunkJPEHXIB5cjs.IDENTITY_MATRIX;
638
+ const back = rigid ? _chunkJPEHXIB5cjs.invertMatrix.call(void 0, m) : _chunkJPEHXIB5cjs.IDENTITY_MATRIX;
639
639
  const subpaths = contours.map((c, k) => {
640
640
  const closed = t <= 0 ? corr.a[k].closed : t >= 1 ? corr.b[k].closed : corr.a[k].closed && corr.b[k].closed;
641
641
  return morphContourToSubpath({ closed: corr.a[k].closed && corr.b[k].closed, pts: c.pts }, back, closed);
@@ -643,14 +643,14 @@ function preparePathMorph(a, b, options, ma = _chunkWPUXGDH4cjs.nodeMatrix.call(
643
643
  const node = { id, type: "path", subpaths, ...interpolateVectorStyle(styleA, styleB, t) };
644
644
  const opacity = lerpN(_nullishCoalesce(a.opacity, () => ( 1)), _nullishCoalesce(b.opacity, () => ( 1)), t);
645
645
  if (opacity < 1) node.opacity = opacity;
646
- if (rigid && !_chunkWPUXGDH4cjs.isIdentityMatrix.call(void 0, m)) node.transform = m;
646
+ if (rigid && !_chunkJPEHXIB5cjs.isIdentityMatrix.call(void 0, m)) node.transform = m;
647
647
  return node;
648
648
  };
649
649
  }
650
- function flattenPaths(node, parent = _chunkWPUXGDH4cjs.IDENTITY_MATRIX) {
651
- const m = _chunkWPUXGDH4cjs.multiplyMatrices.call(void 0, _chunkWPUXGDH4cjs.nodeMatrix.call(void 0, node), parent);
650
+ function flattenPaths(node, parent = _chunkJPEHXIB5cjs.IDENTITY_MATRIX) {
651
+ const m = _chunkJPEHXIB5cjs.multiplyMatrices.call(void 0, _chunkJPEHXIB5cjs.nodeMatrix.call(void 0, node), parent);
652
652
  if (node.type === "path") return [{ path: node, m, opacity: 1 }];
653
- if (node.type === "text" || node.type === "instance") return flattenPaths(_chunkWPUXGDH4cjs.expandVectorAppearance.call(void 0, node), parent);
653
+ if (node.type === "text" || node.type === "instance") return flattenPaths(_chunkJPEHXIB5cjs.expandVectorAppearance.call(void 0, node), parent);
654
654
  const o = _nullishCoalesce(node.opacity, () => ( 1));
655
655
  return node.children.filter((c) => c.visible !== false).flatMap((c) => flattenPaths(c, m)).map((e) => ({ ...e, opacity: e.opacity * o }));
656
656
  }
@@ -672,8 +672,8 @@ function createVectorMorph(a, b, options = {}) {
672
672
  }
673
673
  const pa = flattenPaths(a);
674
674
  const pb = flattenPaths(b);
675
- const ba = _chunkWPUXGDH4cjs.unionBounds.call(void 0, pa.map((e) => placedBounds(e.path, e.m)));
676
- const bb = _chunkWPUXGDH4cjs.unionBounds.call(void 0, pb.map((e) => placedBounds(e.path, e.m)));
675
+ const ba = _chunkJPEHXIB5cjs.unionBounds.call(void 0, pa.map((e) => placedBounds(e.path, e.m)));
676
+ const bb = _chunkJPEHXIB5cjs.unionBounds.call(void 0, pb.map((e) => placedBounds(e.path, e.m)));
677
677
  const id = _nullishCoalesce(options.id, () => ( a.id));
678
678
  const parts = [];
679
679
  const opacities = [];
@@ -685,10 +685,10 @@ function createVectorMorph(a, b, options = {}) {
685
685
  parts.push(preparePathMorph(x.path, y.path, sub, x.m, y.m));
686
686
  opacities.push([x.opacity, y.opacity]);
687
687
  } else if (x) {
688
- parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub, x.m, _chunkWPUXGDH4cjs.IDENTITY_MATRIX));
688
+ parts.push(preparePathMorph(x.path, collapsedPath(x.path, x.m, ba, bb), sub, x.m, _chunkJPEHXIB5cjs.IDENTITY_MATRIX));
689
689
  opacities.push([x.opacity, x.opacity]);
690
690
  } else if (y) {
691
- parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub, _chunkWPUXGDH4cjs.IDENTITY_MATRIX, y.m));
691
+ parts.push(preparePathMorph(collapsedPath(y.path, y.m, bb, ba), y.path, sub, _chunkJPEHXIB5cjs.IDENTITY_MATRIX, y.m));
692
692
  opacities.push([y.opacity, y.opacity]);
693
693
  }
694
694
  }