@kolkrabbi/design-editor 0.23.0 → 0.26.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 (34) hide show
  1. package/README.md +2 -2
  2. package/dist/BindDot-CMUtpJPX.js +84 -0
  3. package/dist/BufferGeometryUtils-Cc8LNd5v.js +150 -0
  4. package/dist/ColorModesWindow-CWhL6nfm.js +1493 -0
  5. package/dist/GLTFLoader-BFir8PCc.js +1361 -0
  6. package/dist/OBJLoader-BgqC_-Jn.js +287 -0
  7. package/dist/{OrbitControls-Cql8Rn2i.js → OrbitControls-DVpLgmKv.js} +2755 -2202
  8. package/dist/STLLoader-C6DGLf6r.js +83 -0
  9. package/dist/TreePicker-nMf17QGH.js +68 -0
  10. package/dist/core-CfGqY4VB.js +17504 -0
  11. package/dist/core.js +4 -3
  12. package/dist/design-editor.css +1 -1
  13. package/dist/design-editor.js +2114 -916
  14. package/dist/effects-DZEmfY7a.js +444 -0
  15. package/dist/effects.js +1 -1
  16. package/dist/generators-D1tFSZgG.js +2961 -0
  17. package/dist/generators.js +1 -1
  18. package/dist/{host-B4SRaN9h.js → host-CRsCCafL.js} +429 -370
  19. package/dist/{host-be1CWhN1.js → host-ZLJKCZ54.js} +137 -136
  20. package/dist/motion-BJ8xqUKI.js +3096 -0
  21. package/dist/motion.js +1 -1
  22. package/dist/previewScale-BMkeLc6w.js +26 -0
  23. package/dist/{rolls-Bg1XHuvJ.js → rolls-BGtqxVYq.js} +2621 -1522
  24. package/dist/{src-B5fQgAVE.js → src-BpTckTDZ.js} +1 -1
  25. package/dist/{labels-B5qkocWy.js → timelinePinned-BwYq1Msi.js} +321 -164
  26. package/dist/{useLayerEdit-ieOjHx6x.js → useLayerEdit-BFcZhiNX.js} +20992 -12580
  27. package/package.json +11 -9
  28. package/dist/RuleRow-BXkjpTyN.js +0 -650
  29. package/dist/TreePicker-DLmMl0aU.js +0 -68
  30. package/dist/core-CTI1YRJD.js +0 -12335
  31. package/dist/effectCategories-BcaQSD_V.js +0 -4216
  32. package/dist/effects-pCd8YTdQ.js +0 -469
  33. package/dist/generators-B8_StNAy.js +0 -2517
  34. package/dist/motion-DFnAar_2.js +0 -2263
@@ -1,26 +1,27 @@
1
- import { nn as e, tn as t } from "./rolls-Bg1XHuvJ.js";
1
+ import { Cn as e, N as t, wn as n } from "./rolls-BGtqxVYq.js";
2
+ import { useEffect as r, useState as i, useSyncExternalStore as a } from "react";
2
3
  //#region src/kinetic/paths.js
3
- var n = Math.PI * 2, r = (e) => Math.round(e * 100) / 100;
4
- function i(e) {
5
- return e.map((e, t) => `${t === 0 ? "M" : "L"} ${r(e[0])} ${r(e[1])}`).join(" ");
4
+ var o = Math.PI * 2, s = (e) => Math.round(e * 100) / 100;
5
+ function c(e) {
6
+ return e.map((e, t) => `${t === 0 ? "M" : "L"} ${s(e[0])} ${s(e[1])}`).join(" ");
6
7
  }
7
- var a = [
8
+ var l = [
8
9
  [.12, .55],
9
10
  [.37, .32],
10
11
  [.63, .68],
11
12
  [.88, .45]
12
13
  ];
13
- function o(e, t, n) {
14
- let i = e.map(([e, r]) => [e * t, r * n]);
15
- if (i.length < 2) return `M ${r(t / 2)} ${r(n / 2)} L ${r(t / 2 + 1)} ${r(n / 2)}`;
16
- let a = `M ${r(i[0][0])} ${r(i[0][1])}`;
17
- for (let e = 0; e < i.length - 1; e++) {
18
- let t = i[e - 1] || i[e], n = i[e], o = i[e + 1], s = i[e + 2] || i[e + 1], c = n[0] + (o[0] - t[0]) / 6, l = n[1] + (o[1] - t[1]) / 6, u = o[0] - (s[0] - n[0]) / 6, d = o[1] - (s[1] - n[1]) / 6;
19
- a += ` C ${r(c)} ${r(l)} ${r(u)} ${r(d)} ${r(o[0])} ${r(o[1])}`;
14
+ function u(e, t, n) {
15
+ let r = e.map(([e, r]) => [e * t, r * n]);
16
+ if (r.length < 2) return `M ${s(t / 2)} ${s(n / 2)} L ${s(t / 2 + 1)} ${s(n / 2)}`;
17
+ let i = `M ${s(r[0][0])} ${s(r[0][1])}`;
18
+ for (let e = 0; e < r.length - 1; e++) {
19
+ let t = r[e - 1] || r[e], n = r[e], a = r[e + 1], o = r[e + 2] || r[e + 1], c = n[0] + (a[0] - t[0]) / 6, l = n[1] + (a[1] - t[1]) / 6, u = a[0] - (o[0] - n[0]) / 6, d = a[1] - (o[1] - n[1]) / 6;
20
+ i += ` C ${s(c)} ${s(l)} ${s(u)} ${s(d)} ${s(a[0])} ${s(a[1])}`;
20
21
  }
21
- return a;
22
+ return i;
22
23
  }
23
- var s = (e) => e === "array", c = (e) => e === "radial", l = (e) => e === "rings", u = {
24
+ var d = (e) => e === "array", f = (e) => e === "radial", p = (e) => e === "rings", m = {
24
25
  amp: .4,
25
26
  freq: 2,
26
27
  turns: 3,
@@ -33,27 +34,27 @@ var s = (e) => e === "array", c = (e) => e === "radial", l = (e) => e === "rings
33
34
  twist: .5,
34
35
  grow: .6
35
36
  };
36
- function d(e, t, s, c = {}) {
37
- let l = t / 2, d = s / 2, f = Math.min(t, s) * .12, p = c.amp ?? u.amp, m = Math.max(1, Math.round(c.freq ?? u.freq)), h = Math.max(1, Math.round(c.turns ?? u.turns)), g = c.radius ?? u.radius;
37
+ function h(e, t, n, r = {}) {
38
+ let i = t / 2, a = n / 2, d = Math.min(t, n) * .12, f = r.amp ?? m.amp, p = Math.max(1, Math.round(r.freq ?? m.freq)), h = Math.max(1, Math.round(r.turns ?? m.turns)), g = r.radius ?? m.radius;
38
39
  switch (e) {
39
40
  case "arc": {
40
- let e = s * .62, n = e - p * s * .7;
41
+ let e = n * .62, r = e - f * n * .7;
41
42
  return {
42
- d: `M ${r(f)} ${r(e)} Q ${r(l)} ${r(n)} ${r(t - f)} ${r(e)}`,
43
+ d: `M ${s(d)} ${s(e)} Q ${s(i)} ${s(r)} ${s(t - d)} ${s(e)}`,
43
44
  closed: !1
44
45
  };
45
46
  }
46
47
  case "circle": {
47
- let e = Math.min(t, s) * .5 * g;
48
+ let e = Math.min(t, n) * .5 * g;
48
49
  return {
49
- d: `M ${r(l - e)} ${r(d)} A ${r(e)} ${r(e)} 0 1 1 ${r(l + e)} ${r(d)} A ${r(e)} ${r(e)} 0 1 1 ${r(l - e)} ${r(d)} Z`,
50
+ d: `M ${s(i - e)} ${s(a)} A ${s(e)} ${s(e)} 0 1 1 ${s(i + e)} ${s(a)} A ${s(e)} ${s(e)} 0 1 1 ${s(i - e)} ${s(a)} Z`,
50
51
  closed: !0
51
52
  };
52
53
  }
53
54
  case "ellipse": {
54
- let e = (t * .5 - f) * g, n = (s * .5 - f) * g;
55
+ let e = (t * .5 - d) * g, r = (n * .5 - d) * g;
55
56
  return {
56
- d: `M ${r(l - e)} ${r(d)} A ${r(e)} ${r(n)} 0 1 1 ${r(l + e)} ${r(d)} A ${r(e)} ${r(n)} 0 1 1 ${r(l - e)} ${r(d)} Z`,
57
+ d: `M ${s(i - e)} ${s(a)} A ${s(e)} ${s(r)} 0 1 1 ${s(i + e)} ${s(a)} A ${s(e)} ${s(r)} 0 1 1 ${s(i - e)} ${s(a)} Z`,
57
58
  closed: !0
58
59
  };
59
60
  }
@@ -61,43 +62,43 @@ function d(e, t, s, c = {}) {
61
62
  let e = [];
62
63
  for (let r = 0; r <= 120; r++) {
63
64
  let i = r / 120;
64
- e.push([f + i * (t - 2 * f), d + p * s * .32 * Math.sin(i * m * n)]);
65
+ e.push([d + i * (t - 2 * d), a + f * n * .32 * Math.sin(i * p * o)]);
65
66
  }
66
67
  return {
67
- d: i(e),
68
+ d: c(e),
68
69
  closed: !1
69
70
  };
70
71
  }
71
72
  case "spiral": {
72
- let e = Math.min(t, s) * .45 * g, r = [];
73
+ let e = Math.min(t, n) * .45 * g, r = [];
73
74
  for (let t = 0; t <= 420; t++) {
74
- let i = t / 420, a = i * h * n, o = i * e;
75
- r.push([l + Math.cos(a) * o, d + Math.sin(a) * o]);
75
+ let n = t / 420, s = n * h * o, c = n * e;
76
+ r.push([i + Math.cos(s) * c, a + Math.sin(s) * c]);
76
77
  }
77
78
  return {
78
- d: i(r),
79
+ d: c(r),
79
80
  closed: !1
80
81
  };
81
82
  }
82
83
  case "zigzag": {
83
- let e = m * 2, n = [];
84
- for (let r = 0; r <= e; r++) {
85
- let i = r / e;
86
- n.push([f + i * (t - 2 * f), d + (r % 2 == 0 ? -1 : 1) * p * s * .28]);
84
+ let e = p * 2, r = [];
85
+ for (let i = 0; i <= e; i++) {
86
+ let o = i / e;
87
+ r.push([d + o * (t - 2 * d), a + (i % 2 == 0 ? -1 : 1) * f * n * .28]);
87
88
  }
88
89
  return {
89
- d: i(n),
90
+ d: c(r),
90
91
  closed: !1
91
92
  };
92
93
  }
93
94
  case "custom": return {
94
- d: o(Array.isArray(c.points) && c.points.length >= 2 ? c.points : a, t, s),
95
+ d: u(Array.isArray(r.points) && r.points.length >= 2 ? r.points : l, t, n),
95
96
  closed: !1
96
97
  };
97
98
  default: {
98
- let e = d + (c.offset || 0) * s;
99
+ let e = a + (r.offset || 0) * n;
99
100
  return {
100
- d: `M ${r(f)} ${r(e)} L ${r(t - f)} ${r(e)}`,
101
+ d: `M ${s(d)} ${s(e)} L ${s(t - d)} ${s(e)}`,
101
102
  closed: !1
102
103
  };
103
104
  }
@@ -105,7 +106,7 @@ function d(e, t, s, c = {}) {
105
106
  }
106
107
  //#endregion
107
108
  //#region src/kinetic/presets.js
108
- var f = "#0b0d12", p = "#e8e4dc", m = {
109
+ var g = "#0b0d12", _ = "#e8e4dc", v = {
109
110
  text: "Kinetic",
110
111
  font: "gullhamrar",
111
112
  fontSize: 120,
@@ -128,7 +129,7 @@ var f = "#0b0d12", p = "#e8e4dc", m = {
128
129
  showPath: !1,
129
130
  path: {
130
131
  type: "line",
131
- ...u
132
+ ...m
132
133
  },
133
134
  motion: {
134
135
  mode: "none",
@@ -156,60 +157,60 @@ var f = "#0b0d12", p = "#e8e4dc", m = {
156
157
  }
157
158
  }
158
159
  };
159
- function h(n, r = {}) {
160
- let i = e(n), a = t(i);
160
+ function y(t, r = {}) {
161
+ let i = n(t), a = e(i);
161
162
  for (let e of i.axes) r[e.tag] != null && (a[e.tag] = r[e.tag]);
162
163
  return a;
163
164
  }
164
- function g(e = {}, t = 0) {
165
+ function b(e = {}, t = 0) {
165
166
  let n = {
166
167
  id: e.id || `i${t}`,
167
- ...m,
168
+ ...v,
168
169
  ...e,
169
170
  path: {
170
- ...m.path,
171
+ ...v.path,
171
172
  ...e.path || {}
172
173
  },
173
174
  motion: {
174
- ...m.motion,
175
+ ...v.motion,
175
176
  ...e.motion || {}
176
177
  },
177
178
  motions: Array.isArray(e.motions) ? e.motions.map((e) => ({
178
- ...m.motion,
179
+ ...v.motion,
179
180
  ...e
180
181
  })) : [],
181
182
  offset: {
182
- ...m.offset,
183
+ ...v.offset,
183
184
  ...e.offset || {}
184
185
  },
185
186
  opentype: { ...e.opentype || {} },
186
187
  morph: {
187
- ...m.morph,
188
+ ...v.morph,
188
189
  ...e.morph || {},
189
190
  vf2: { ...e.morph?.vf2 || {} }
190
191
  }
191
192
  };
192
- return n.vf = h(n.font, e.vf), n;
193
+ return n.vf = y(n.font, e.vf), n;
193
194
  }
194
- var _ = (e) => ({
195
- bg: f,
196
- instances: [g({
195
+ var x = (e) => ({
196
+ bg: g,
197
+ instances: [b({
197
198
  font: "rot",
198
- fill: p,
199
+ fill: _,
199
200
  ...e
200
201
  }, 0)]
201
- }), v = "#16202E", y = (...e) => ({
202
- bg: v,
203
- instances: e.map((e, t) => g(e, t))
204
- }), b = (e, ...t) => ({
202
+ }), S = "#16202E", C = (...e) => ({
203
+ bg: S,
204
+ instances: e.map((e, t) => b(e, t))
205
+ }), w = (e, ...t) => ({
205
206
  bg: e,
206
- instances: t.map((e, t) => g(e, t))
207
- }), x = [
207
+ instances: t.map((e, t) => b(e, t))
208
+ }), T = [
208
209
  {
209
210
  id: "sunburst",
210
211
  label: "Sunburst",
211
212
  sub: "Radial",
212
- comp: _({
213
+ comp: x({
213
214
  text: "Without a soul, is it a place?",
214
215
  fontSize: 26,
215
216
  vf: {
@@ -228,7 +229,7 @@ var _ = (e) => ({
228
229
  id: "dense-burst",
229
230
  label: "Dense burst",
230
231
  sub: "Radial",
231
- comp: _({
232
+ comp: x({
232
233
  text: "is it a place",
233
234
  fontSize: 30,
234
235
  vf: {
@@ -247,7 +248,7 @@ var _ = (e) => ({
247
248
  id: "double-twirl",
248
249
  label: "Double twirl",
249
250
  sub: "Radial",
250
- comp: _({
251
+ comp: x({
251
252
  text: "turning and turning",
252
253
  fontSize: 24,
253
254
  font: "malromur",
@@ -264,7 +265,7 @@ var _ = (e) => ({
264
265
  id: "pulse-burst",
265
266
  label: "Pulse burst",
266
267
  sub: "Radial",
267
- comp: _({
268
+ comp: x({
268
269
  text: "breathe in, breathe out",
269
270
  fontSize: 26,
270
271
  font: "gullhamrar",
@@ -286,7 +287,7 @@ var _ = (e) => ({
286
287
  id: "vortex",
287
288
  label: "Vortex",
288
289
  sub: "Rings",
289
- comp: _({
290
+ comp: x({
290
291
  text: "Does a community make a place? ",
291
292
  fontSize: 24,
292
293
  vf: {
@@ -308,7 +309,7 @@ var _ = (e) => ({
308
309
  id: "galaxy",
309
310
  label: "Galaxy",
310
311
  sub: "Rings",
311
- comp: _({
312
+ comp: x({
312
313
  text: "spiralling inward forever ",
313
314
  fontSize: 22,
314
315
  font: "malromur",
@@ -328,7 +329,7 @@ var _ = (e) => ({
328
329
  id: "wide-rings",
329
330
  label: "Wide rings",
330
331
  sub: "Rings",
331
- comp: _({
332
+ comp: x({
332
333
  text: "around and around ",
333
334
  fontSize: 28,
334
335
  font: "gullhamrar",
@@ -348,7 +349,7 @@ var _ = (e) => ({
348
349
  id: "orbit",
349
350
  label: "Orbit",
350
351
  sub: "Path",
351
- comp: _({
352
+ comp: x({
352
353
  text: "KOLKRABBI · REYKJAVIK · ",
353
354
  fontSize: 40,
354
355
  font: "malromur",
@@ -367,7 +368,7 @@ var _ = (e) => ({
367
368
  id: "spiral",
368
369
  label: "Spiral",
369
370
  sub: "Path",
370
- comp: _({
371
+ comp: x({
371
372
  text: "into the spiral we go ",
372
373
  fontSize: 30,
373
374
  vf: {
@@ -389,7 +390,7 @@ var _ = (e) => ({
389
390
  id: "template",
390
391
  label: "Template",
391
392
  sub: "Path",
392
- comp: _({
393
+ comp: x({
393
394
  text: "Type here",
394
395
  fontSize: 160,
395
396
  vf: {
@@ -402,7 +403,7 @@ var _ = (e) => ({
402
403
  id: "big-statement",
403
404
  label: "Flood",
404
405
  sub: "Scenes",
405
- comp: y({
406
+ comp: C({
406
407
  text: "BIG",
407
408
  font: "rot",
408
409
  fontSize: 220,
@@ -423,7 +424,7 @@ var _ = (e) => ({
423
424
  id: "ring-and-word",
424
425
  label: "Ring",
425
426
  sub: "Scenes",
426
- comp: y({
427
+ comp: C({
427
428
  id: "a",
428
429
  text: "KOLKRABBI · REYKJAVIK · ",
429
430
  font: "malromur",
@@ -452,7 +453,7 @@ var _ = (e) => ({
452
453
  id: "custom-s",
453
454
  label: "Flow",
454
455
  sub: "Scenes",
455
- comp: y({
456
+ comp: C({
456
457
  text: "freeform",
457
458
  fontSize: 96,
458
459
  vf: { wght: 600 },
@@ -464,7 +465,7 @@ var _ = (e) => ({
464
465
  id: "malromur-wave",
465
466
  label: "Morph",
466
467
  sub: "Scenes",
467
- comp: y({
468
+ comp: C({
468
469
  text: "Malromur",
469
470
  font: "malromur",
470
471
  fontSize: 132,
@@ -481,7 +482,7 @@ var _ = (e) => ({
481
482
  id: "flag",
482
483
  label: "Wave",
483
484
  sub: "Scenes",
484
- comp: y({
485
+ comp: C({
485
486
  text: "flag",
486
487
  font: "rot",
487
488
  fontSize: 168,
@@ -501,7 +502,7 @@ var _ = (e) => ({
501
502
  id: "sweep-grid",
502
503
  label: "Reveal",
503
504
  sub: "Scenes",
504
- comp: y({
505
+ comp: C({
505
506
  text: "KOL",
506
507
  font: "rot",
507
508
  fontSize: 56,
@@ -527,7 +528,7 @@ var _ = (e) => ({
527
528
  id: "baseline",
528
529
  label: "Baseline",
529
530
  sub: "Elements",
530
- comp: y({
531
+ comp: C({
531
532
  text: "Typography",
532
533
  fontSize: 120,
533
534
  vf: { wght: 500 }
@@ -537,7 +538,7 @@ var _ = (e) => ({
537
538
  id: "arc-kinetic",
538
539
  label: "Arcs",
539
540
  sub: "Elements",
540
- comp: y({
541
+ comp: C({
541
542
  text: "Kinetic",
542
543
  fontSize: 130,
543
544
  vf: { wght: 600 },
@@ -551,7 +552,7 @@ var _ = (e) => ({
551
552
  id: "ellipse-loop",
552
553
  label: "Loops",
553
554
  sub: "Elements",
554
- comp: y({
555
+ comp: C({
555
556
  text: "REYKJAVIK",
556
557
  font: "rot",
557
558
  fontSize: 78,
@@ -570,7 +571,7 @@ var _ = (e) => ({
570
571
  id: "zigzag",
571
572
  label: "Angular",
572
573
  sub: "Elements",
573
- comp: y({
574
+ comp: C({
574
575
  text: "ZIGZAG",
575
576
  font: "malromur",
576
577
  fontSize: 92,
@@ -586,7 +587,7 @@ var _ = (e) => ({
586
587
  id: "array-grid",
587
588
  label: "Grid",
588
589
  sub: "Elements",
589
- comp: y({
590
+ comp: C({
590
591
  text: "KOL",
591
592
  fontSize: 64,
592
593
  vf: { wght: 600 },
@@ -601,7 +602,7 @@ var _ = (e) => ({
601
602
  id: "weight-pulse",
602
603
  label: "Weight",
603
604
  sub: "Elements",
604
- comp: y({
605
+ comp: C({
605
606
  text: "WEIGHT",
606
607
  fontSize: 150,
607
608
  vf: { wght: 300 },
@@ -617,7 +618,7 @@ var _ = (e) => ({
617
618
  id: "rot-width",
618
619
  label: "Width",
619
620
  sub: "Elements",
620
- comp: y({
621
+ comp: C({
621
622
  text: "WIDTH",
622
623
  font: "rot",
623
624
  fontSize: 150,
@@ -637,7 +638,7 @@ var _ = (e) => ({
637
638
  id: "cascade",
638
639
  label: "Cascade",
639
640
  sub: "Elements",
640
- comp: y({
641
+ comp: C({
641
642
  text: "CASCADE",
642
643
  fontSize: 130,
643
644
  vf: { wght: 600 },
@@ -652,7 +653,7 @@ var _ = (e) => ({
652
653
  id: "baseline-mono",
653
654
  label: "Mono line",
654
655
  sub: "Lines",
655
- comp: y({
656
+ comp: C({
656
657
  text: "monospace",
657
658
  font: "rot",
658
659
  fontSize: 110,
@@ -667,7 +668,7 @@ var _ = (e) => ({
667
668
  id: "baseline-light",
668
669
  label: "On paper",
669
670
  sub: "Lines",
670
- comp: b("#f4f1ea", {
671
+ comp: w("#f4f1ea", {
671
672
  text: "Reykjavik",
672
673
  font: "malromur",
673
674
  fontSize: 130,
@@ -679,7 +680,7 @@ var _ = (e) => ({
679
680
  id: "sine-flow",
680
681
  label: "Sine flow",
681
682
  sub: "Curves",
682
- comp: y({
683
+ comp: C({
683
684
  text: "wave along",
684
685
  font: "rot",
685
686
  fontSize: 96,
@@ -702,7 +703,7 @@ var _ = (e) => ({
702
703
  id: "spiral-in",
703
704
  label: "Spiral",
704
705
  sub: "Curves",
705
- comp: y({
706
+ comp: C({
706
707
  text: "spiral",
707
708
  fontSize: 88,
708
709
  vf: { wght: 700 },
@@ -716,7 +717,7 @@ var _ = (e) => ({
716
717
  id: "arc-march",
717
718
  label: "Arc march",
718
719
  sub: "Curves",
719
- comp: y({
720
+ comp: C({
720
721
  text: "on the arc",
721
722
  font: "rot",
722
723
  fontSize: 96,
@@ -735,7 +736,7 @@ var _ = (e) => ({
735
736
  id: "arc-up",
736
737
  label: "High arc",
737
738
  sub: "Curves",
738
- comp: y({
739
+ comp: C({
739
740
  text: "over the top",
740
741
  font: "malromur",
741
742
  fontSize: 92,
@@ -750,7 +751,7 @@ var _ = (e) => ({
750
751
  id: "arc-wide",
751
752
  label: "Wide arc",
752
753
  sub: "Curves",
753
- comp: y({
754
+ comp: C({
754
755
  text: "WIDEARC",
755
756
  font: "rot",
756
757
  fontSize: 96,
@@ -768,7 +769,7 @@ var _ = (e) => ({
768
769
  id: "sine-fast",
769
770
  label: "Fast wave",
770
771
  sub: "Curves",
771
- comp: y({
772
+ comp: C({
772
773
  text: "up and down",
773
774
  fontSize: 90,
774
775
  vf: { wght: 600 },
@@ -787,7 +788,7 @@ var _ = (e) => ({
787
788
  id: "sine-tall",
788
789
  label: "Tall wave",
789
790
  sub: "Curves",
790
- comp: y({
791
+ comp: C({
791
792
  text: "rolling",
792
793
  font: "rot",
793
794
  fontSize: 100,
@@ -806,7 +807,7 @@ var _ = (e) => ({
806
807
  id: "spiral-march",
807
808
  label: "Spiral march",
808
809
  sub: "Curves",
809
- comp: y({
810
+ comp: C({
810
811
  text: "into the spiral",
811
812
  font: "rot",
812
813
  fontSize: 72,
@@ -828,7 +829,7 @@ var _ = (e) => ({
828
829
  id: "circle-orbit",
829
830
  label: "Circle",
830
831
  sub: "Closed",
831
- comp: y({
832
+ comp: C({
832
833
  text: "KOLKRABBI",
833
834
  font: "malromur",
834
835
  fontSize: 80,
@@ -847,7 +848,7 @@ var _ = (e) => ({
847
848
  id: "circle-big",
848
849
  label: "Big circle",
849
850
  sub: "Closed",
850
- comp: y({
851
+ comp: C({
851
852
  text: "AROUND WE GO",
852
853
  fontSize: 76,
853
854
  vf: { wght: 600 },
@@ -862,7 +863,7 @@ var _ = (e) => ({
862
863
  id: "circle-mono",
863
864
  label: "Mono circle",
864
865
  sub: "Closed",
865
- comp: y({
866
+ comp: C({
866
867
  text: "LOOP/LOOP/",
867
868
  font: "rot",
868
869
  fontSize: 72,
@@ -882,7 +883,7 @@ var _ = (e) => ({
882
883
  id: "ellipse-wide",
883
884
  label: "Wide ellipse",
884
885
  sub: "Closed",
885
- comp: y({
886
+ comp: C({
886
887
  text: "ELLIPTICAL",
887
888
  font: "malromur",
888
889
  fontSize: 74,
@@ -898,7 +899,7 @@ var _ = (e) => ({
898
899
  id: "zigzag-fine",
899
900
  label: "Fine zigzag",
900
901
  sub: "Angular",
901
- comp: y({
902
+ comp: C({
902
903
  text: "sawtooth",
903
904
  font: "rot",
904
905
  fontSize: 80,
@@ -917,7 +918,7 @@ var _ = (e) => ({
917
918
  id: "custom-march",
918
919
  label: "Custom march",
919
920
  sub: "Custom",
920
- comp: y({
921
+ comp: C({
921
922
  text: "follow me",
922
923
  font: "rot",
923
924
  fontSize: 90,
@@ -933,7 +934,7 @@ var _ = (e) => ({
933
934
  id: "ordspor-pulse",
934
935
  label: "Ordspor",
935
936
  sub: "Weight",
936
- comp: y({
937
+ comp: C({
937
938
  text: "Ordspor",
938
939
  font: "rot",
939
940
  fontSize: 132,
@@ -953,7 +954,7 @@ var _ = (e) => ({
953
954
  id: "rot-weight",
954
955
  label: "Rot weight",
955
956
  sub: "Weight",
956
- comp: y({
957
+ comp: C({
957
958
  text: "ROT",
958
959
  font: "rot",
959
960
  fontSize: 200,
@@ -973,7 +974,7 @@ var _ = (e) => ({
973
974
  id: "weight-slow",
974
975
  label: "Slow weight",
975
976
  sub: "Weight",
976
- comp: y({
977
+ comp: C({
977
978
  text: "breathe",
978
979
  fontSize: 150,
979
980
  vf: { wght: 300 },
@@ -989,7 +990,7 @@ var _ = (e) => ({
989
990
  id: "weight-fast",
990
991
  label: "Fast weight",
991
992
  sub: "Weight",
992
- comp: y({
993
+ comp: C({
993
994
  text: "PULSE",
994
995
  fontSize: 160,
995
996
  vf: { wght: 300 },
@@ -1005,7 +1006,7 @@ var _ = (e) => ({
1005
1006
  id: "malromur-heavy",
1006
1007
  label: "Heavy swing",
1007
1008
  sub: "Weight",
1008
- comp: b("#f4f1ea", {
1009
+ comp: w("#f4f1ea", {
1009
1010
  text: "Malromur",
1010
1011
  font: "malromur",
1011
1012
  fontSize: 130,
@@ -1023,7 +1024,7 @@ var _ = (e) => ({
1023
1024
  id: "ordspor-wave2",
1024
1025
  label: "Ordspor ×2",
1025
1026
  sub: "Weight",
1026
- comp: y({
1027
+ comp: C({
1027
1028
  text: "twice",
1028
1029
  font: "rot",
1029
1030
  fontSize: 150,
@@ -1043,7 +1044,7 @@ var _ = (e) => ({
1043
1044
  id: "rot-weight2",
1044
1045
  label: "Rot weight ×2",
1045
1046
  sub: "Weight",
1046
- comp: y({
1047
+ comp: C({
1047
1048
  text: "ROT",
1048
1049
  font: "rot",
1049
1050
  fontSize: 200,
@@ -1063,7 +1064,7 @@ var _ = (e) => ({
1063
1064
  id: "malromur-bigwave",
1064
1065
  label: "Big wave",
1065
1066
  sub: "Weight",
1066
- comp: y({
1067
+ comp: C({
1067
1068
  text: "WEIGHT",
1068
1069
  font: "malromur",
1069
1070
  fontSize: 150,
@@ -1081,7 +1082,7 @@ var _ = (e) => ({
1081
1082
  id: "ordspor-accent",
1082
1083
  label: "Ordspor accent",
1083
1084
  sub: "Weight",
1084
- comp: y({
1085
+ comp: C({
1085
1086
  text: "Ordspor",
1086
1087
  font: "rot",
1087
1088
  fontSize: 140,
@@ -1102,7 +1103,7 @@ var _ = (e) => ({
1102
1103
  id: "rot-dual",
1103
1104
  label: "Variable",
1104
1105
  sub: "Width",
1105
- comp: y({
1106
+ comp: C({
1106
1107
  text: "variable",
1107
1108
  font: "rot",
1108
1109
  fontSize: 124,
@@ -1122,7 +1123,7 @@ var _ = (e) => ({
1122
1123
  id: "rot-width-fast",
1123
1124
  label: "Width ×2",
1124
1125
  sub: "Width",
1125
- comp: y({
1126
+ comp: C({
1126
1127
  text: "STRETCH",
1127
1128
  font: "rot",
1128
1129
  fontSize: 130,
@@ -1142,7 +1143,7 @@ var _ = (e) => ({
1142
1143
  id: "rot-width-slow",
1143
1144
  label: "Width slow",
1144
1145
  sub: "Width",
1145
- comp: y({
1146
+ comp: C({
1146
1147
  text: "expand",
1147
1148
  font: "rot",
1148
1149
  fontSize: 130,
@@ -1162,7 +1163,7 @@ var _ = (e) => ({
1162
1163
  id: "morph-mtl",
1163
1164
  label: "Made to last",
1164
1165
  sub: "Morph",
1165
- comp: y({
1166
+ comp: C({
1166
1167
  text: "Made to last",
1167
1168
  font: "rot",
1168
1169
  fontSize: 150,
@@ -1186,7 +1187,7 @@ var _ = (e) => ({
1186
1187
  id: "morph-wave",
1187
1188
  label: "Morph wave",
1188
1189
  sub: "Morph",
1189
- comp: y({
1190
+ comp: C({
1190
1191
  text: "MORPH",
1191
1192
  font: "rot",
1192
1193
  fontSize: 200,
@@ -1210,7 +1211,7 @@ var _ = (e) => ({
1210
1211
  id: "morph-ease",
1211
1212
  label: "Heavy → light",
1212
1213
  sub: "Morph",
1213
- comp: y({
1214
+ comp: C({
1214
1215
  text: "gradient",
1215
1216
  font: "rot",
1216
1217
  fontSize: 150,
@@ -1234,7 +1235,7 @@ var _ = (e) => ({
1234
1235
  id: "morph-random",
1235
1236
  label: "Ransom note",
1236
1237
  sub: "Morph",
1237
- comp: y({
1238
+ comp: C({
1238
1239
  text: "CHAOS",
1239
1240
  font: "rot",
1240
1241
  fontSize: 170,
@@ -1253,7 +1254,7 @@ var _ = (e) => ({
1253
1254
  id: "morph-fade",
1254
1255
  label: "Fade A↔B",
1255
1256
  sub: "Morph",
1256
- comp: y({
1257
+ comp: C({
1257
1258
  text: "between",
1258
1259
  font: "gullhamrar",
1259
1260
  fontSize: 150,
@@ -1270,7 +1271,7 @@ var _ = (e) => ({
1270
1271
  id: "morph-cross",
1271
1272
  label: "Cross-face",
1272
1273
  sub: "Morph",
1273
- comp: y({
1274
+ comp: C({
1274
1275
  text: "hybrid",
1275
1276
  font: "rot",
1276
1277
  fontSize: 150,
@@ -1290,7 +1291,7 @@ var _ = (e) => ({
1290
1291
  id: "arc-weight",
1291
1292
  label: "Morph on arc",
1292
1293
  sub: "On path",
1293
- comp: y({
1294
+ comp: C({
1294
1295
  text: "morph",
1295
1296
  fontSize: 120,
1296
1297
  path: {
@@ -1309,7 +1310,7 @@ var _ = (e) => ({
1309
1310
  id: "sine-weight",
1310
1311
  label: "Wave + weight",
1311
1312
  sub: "On path",
1312
- comp: y({
1313
+ comp: C({
1313
1314
  text: "modulated",
1314
1315
  fontSize: 92,
1315
1316
  vf: { wght: 400 },
@@ -1330,7 +1331,7 @@ var _ = (e) => ({
1330
1331
  id: "circle-weight",
1331
1332
  label: "Ring + weight",
1332
1333
  sub: "On path",
1333
- comp: y({
1334
+ comp: C({
1334
1335
  text: "ROTATING",
1335
1336
  font: "malromur",
1336
1337
  fontSize: 78,
@@ -1351,7 +1352,7 @@ var _ = (e) => ({
1351
1352
  id: "arc-width",
1352
1353
  label: "Arc + width",
1353
1354
  sub: "On path",
1354
- comp: y({
1355
+ comp: C({
1355
1356
  text: "arcwidth",
1356
1357
  font: "rot",
1357
1358
  fontSize: 96,
@@ -1375,7 +1376,7 @@ var _ = (e) => ({
1375
1376
  id: "pop",
1376
1377
  label: "Pop",
1377
1378
  sub: "Reveal",
1378
- comp: y({
1379
+ comp: C({
1379
1380
  text: "POP POP",
1380
1381
  fontSize: 130,
1381
1382
  vf: { wght: 800 },
@@ -1390,7 +1391,7 @@ var _ = (e) => ({
1390
1391
  id: "arc-cascade",
1391
1392
  label: "Curve cascade",
1392
1393
  sub: "Reveal",
1393
- comp: y({
1394
+ comp: C({
1394
1395
  text: "on a curve",
1395
1396
  font: "rot",
1396
1397
  fontSize: 100,
@@ -1413,7 +1414,7 @@ var _ = (e) => ({
1413
1414
  id: "cascade-slow",
1414
1415
  label: "Slow cascade",
1415
1416
  sub: "Reveal",
1416
- comp: y({
1417
+ comp: C({
1417
1418
  text: "unfold",
1418
1419
  fontSize: 130,
1419
1420
  vf: { wght: 600 },
@@ -1428,7 +1429,7 @@ var _ = (e) => ({
1428
1429
  id: "cascade-fast",
1429
1430
  label: "Fast cascade",
1430
1431
  sub: "Reveal",
1431
- comp: y({
1432
+ comp: C({
1432
1433
  text: "flicker",
1433
1434
  fontSize: 130,
1434
1435
  vf: { wght: 700 },
@@ -1443,7 +1444,7 @@ var _ = (e) => ({
1443
1444
  id: "typewriter",
1444
1445
  label: "Typewriter",
1445
1446
  sub: "Reveal",
1446
- comp: y({
1447
+ comp: C({
1447
1448
  text: "type_type_",
1448
1449
  font: "rot",
1449
1450
  fontSize: 100,
@@ -1463,7 +1464,7 @@ var _ = (e) => ({
1463
1464
  id: "spiral-cascade",
1464
1465
  label: "Spiral reveal",
1465
1466
  sub: "Reveal",
1466
- comp: y({
1467
+ comp: C({
1467
1468
  text: "spiral down",
1468
1469
  fontSize: 74,
1469
1470
  vf: { wght: 600 },
@@ -1482,7 +1483,7 @@ var _ = (e) => ({
1482
1483
  id: "circle-cascade",
1483
1484
  label: "Ring reveal",
1484
1485
  sub: "Reveal",
1485
- comp: y({
1486
+ comp: C({
1486
1487
  text: "AROUND",
1487
1488
  font: "malromur",
1488
1489
  fontSize: 86,
@@ -1502,7 +1503,7 @@ var _ = (e) => ({
1502
1503
  id: "pop-mono",
1503
1504
  label: "Mono pop",
1504
1505
  sub: "Reveal",
1505
- comp: y({
1506
+ comp: C({
1506
1507
  text: "POP.POP.",
1507
1508
  font: "rot",
1508
1509
  fontSize: 110,
@@ -1522,7 +1523,7 @@ var _ = (e) => ({
1522
1523
  id: "glyph-wave",
1523
1524
  label: "Ripple",
1524
1525
  sub: "Wave",
1525
- comp: y({
1526
+ comp: C({
1526
1527
  text: "ripple",
1527
1528
  font: "malromur",
1528
1529
  fontSize: 140,
@@ -1539,7 +1540,7 @@ var _ = (e) => ({
1539
1540
  id: "sine-ripple",
1540
1541
  label: "Sine ripple",
1541
1542
  sub: "Wave",
1542
- comp: y({
1543
+ comp: C({
1543
1544
  text: "wavewave",
1544
1545
  font: "rot",
1545
1546
  fontSize: 108,
@@ -1562,7 +1563,7 @@ var _ = (e) => ({
1562
1563
  id: "glyph-big",
1563
1564
  label: "Big ripple",
1564
1565
  sub: "Wave",
1565
- comp: y({
1566
+ comp: C({
1566
1567
  text: "WAVES",
1567
1568
  fontSize: 150,
1568
1569
  vf: { wght: 700 },
@@ -1578,7 +1579,7 @@ var _ = (e) => ({
1578
1579
  id: "glyph-fast",
1579
1580
  label: "Fast ripple",
1580
1581
  sub: "Wave",
1581
- comp: y({
1582
+ comp: C({
1582
1583
  text: "shiver",
1583
1584
  font: "malromur",
1584
1585
  fontSize: 140,
@@ -1595,7 +1596,7 @@ var _ = (e) => ({
1595
1596
  id: "arc-glyphwave",
1596
1597
  label: "Arc ripple",
1597
1598
  sub: "Wave",
1598
- comp: y({
1599
+ comp: C({
1599
1600
  text: "on a curve",
1600
1601
  font: "rot",
1601
1602
  fontSize: 96,
@@ -1617,7 +1618,7 @@ var _ = (e) => ({
1617
1618
  id: "rot-flag-fast",
1618
1619
  label: "Rot flag",
1619
1620
  sub: "Wave",
1620
- comp: y({
1621
+ comp: C({
1621
1622
  text: "flutter",
1622
1623
  font: "rot",
1623
1624
  fontSize: 150,
@@ -1637,7 +1638,7 @@ var _ = (e) => ({
1637
1638
  id: "sine-ripple2",
1638
1639
  label: "Sine flutter",
1639
1640
  sub: "Wave",
1640
- comp: y({
1641
+ comp: C({
1641
1642
  text: "flowflow",
1642
1643
  font: "rot",
1643
1644
  fontSize: 100,
@@ -1661,7 +1662,7 @@ var _ = (e) => ({
1661
1662
  id: "sweep-x",
1662
1663
  label: "Sweep X",
1663
1664
  sub: "Sweep",
1664
- comp: y({
1665
+ comp: C({
1665
1666
  text: "SWEEP",
1666
1667
  fontSize: 150,
1667
1668
  vf: { wght: 700 },
@@ -1677,7 +1678,7 @@ var _ = (e) => ({
1677
1678
  id: "sweep-y",
1678
1679
  label: "Sweep Y",
1679
1680
  sub: "Sweep",
1680
- comp: y({
1681
+ comp: C({
1681
1682
  text: "descend",
1682
1683
  font: "rot",
1683
1684
  fontSize: 130,
@@ -1697,7 +1698,7 @@ var _ = (e) => ({
1697
1698
  id: "sweep-radial",
1698
1699
  label: "Radial pulse",
1699
1700
  sub: "Sweep",
1700
- comp: y({
1701
+ comp: C({
1701
1702
  text: "PULSE",
1702
1703
  font: "malromur",
1703
1704
  fontSize: 140,
@@ -1714,7 +1715,7 @@ var _ = (e) => ({
1714
1715
  id: "sweep-weight",
1715
1716
  label: "Sweep weight",
1716
1717
  sub: "Sweep",
1717
- comp: y({
1718
+ comp: C({
1718
1719
  text: "WEIGHT",
1719
1720
  fontSize: 150,
1720
1721
  vf: { wght: 300 },
@@ -1730,7 +1731,7 @@ var _ = (e) => ({
1730
1731
  id: "sweep-shift",
1731
1732
  label: "Sweep shift",
1732
1733
  sub: "Sweep",
1733
- comp: y({
1734
+ comp: C({
1734
1735
  text: "shiver",
1735
1736
  font: "rot",
1736
1737
  fontSize: 130,
@@ -1750,7 +1751,7 @@ var _ = (e) => ({
1750
1751
  id: "orbit-spin",
1751
1752
  label: "Orbit",
1752
1753
  sub: "Orbit",
1753
- comp: y({
1754
+ comp: C({
1754
1755
  text: "ORBIT",
1755
1756
  font: "malromur",
1756
1757
  fontSize: 88,
@@ -1769,7 +1770,7 @@ var _ = (e) => ({
1769
1770
  id: "orbit-fast",
1770
1771
  label: "Fast orbit",
1771
1772
  sub: "Orbit",
1772
- comp: y({
1773
+ comp: C({
1773
1774
  text: "spinning",
1774
1775
  fontSize: 84,
1775
1776
  vf: { wght: 600 },
@@ -1787,7 +1788,7 @@ var _ = (e) => ({
1787
1788
  id: "ellipse-orbit",
1788
1789
  label: "Ellipse orbit",
1789
1790
  sub: "Orbit",
1790
- comp: y({
1791
+ comp: C({
1791
1792
  text: "ORBITAL",
1792
1793
  font: "rot",
1793
1794
  fontSize: 78,
@@ -1809,7 +1810,7 @@ var _ = (e) => ({
1809
1810
  id: "array-pulse",
1810
1811
  label: "Grid pulse",
1811
1812
  sub: "Array",
1812
- comp: y({
1813
+ comp: C({
1813
1814
  text: "NODE",
1814
1815
  font: "rot",
1815
1816
  fontSize: 44,
@@ -1834,7 +1835,7 @@ var _ = (e) => ({
1834
1835
  id: "array-wave",
1835
1836
  label: "Grid wave",
1836
1837
  sub: "Array",
1837
- comp: y({
1838
+ comp: C({
1838
1839
  text: "echo",
1839
1840
  font: "rot",
1840
1841
  fontSize: 52,
@@ -1859,7 +1860,7 @@ var _ = (e) => ({
1859
1860
  id: "array-weight",
1860
1861
  label: "Grid weight",
1861
1862
  sub: "Array",
1862
- comp: y({
1863
+ comp: C({
1863
1864
  text: "OK",
1864
1865
  font: "rot",
1865
1866
  fontSize: 88,
@@ -1884,7 +1885,7 @@ var _ = (e) => ({
1884
1885
  id: "stacked",
1885
1886
  label: "Stacked",
1886
1887
  sub: "Composite",
1887
- comp: y({
1888
+ comp: C({
1888
1889
  id: "a",
1889
1890
  text: "KINETIC",
1890
1891
  font: "gullhamrar",
@@ -1921,7 +1922,7 @@ var _ = (e) => ({
1921
1922
  id: "grid-and-ring",
1922
1923
  label: "Grid + ring",
1923
1924
  sub: "Composite",
1924
- comp: b("#0a0b14", {
1925
+ comp: w("#0a0b14", {
1925
1926
  id: "a",
1926
1927
  text: "echo",
1927
1928
  font: "rot",
@@ -1956,17 +1957,17 @@ var _ = (e) => ({
1956
1957
  }
1957
1958
  })
1958
1959
  }
1959
- ], S = (e) => x.find((t) => t.id === e) || x[0], C = [
1960
+ ], E = (e) => T.find((t) => t.id === e) || T[0], D = [
1960
1961
  "Radial",
1961
1962
  "Rings",
1962
1963
  "Path"
1963
- ], w = [{
1964
+ ], O = [{
1964
1965
  label: "Type",
1965
- subs: C
1966
+ subs: D
1966
1967
  }, {
1967
1968
  label: "Kinetic",
1968
- subs: [...new Set(x.map((e) => e.sub))].filter((e) => !C.includes(e))
1969
- }], T = (e) => structuredClone(e.comp), E = {
1969
+ subs: [...new Set(T.map((e) => e.sub))].filter((e) => !D.includes(e))
1970
+ }], k = (e) => structuredClone(e.comp), A = {
1970
1971
  background: "Background",
1971
1972
  pattern: "Pattern",
1972
1973
  photo: "Photo",
@@ -1974,15 +1975,16 @@ var _ = (e) => ({
1974
1975
  text: "Text",
1975
1976
  group: "Group",
1976
1977
  bool: "Boolean",
1978
+ path: "Path",
1977
1979
  loop: "Loop",
1978
1980
  kinetic: "Kinetic type",
1979
1981
  misc: "Misc"
1980
- }, D = {
1982
+ }, j = {
1981
1983
  unite: "Unite",
1982
1984
  subtract: "Subtract",
1983
1985
  intersect: "Intersect",
1984
1986
  exclude: "Exclude"
1985
- }, O = {
1987
+ }, M = {
1986
1988
  logo: "Logo",
1987
1989
  rect: "Rectangle",
1988
1990
  ellipse: "Ellipse",
@@ -1992,16 +1994,171 @@ var _ = (e) => ({
1992
1994
  star: "Star",
1993
1995
  flatten: "Flatten"
1994
1996
  };
1995
- function k(e) {
1996
- if (e.type === "shape") return `Shape · ${O[e.kind ?? "logo"] ?? "Shape"}`;
1997
- if (e.type === "bool") {
1998
- let t = D[e.op];
1999
- return t ? `Boolean · ${t}` : E.bool;
1997
+ function N(e) {
1998
+ return e.isMask ? `${N({
1999
+ ...e,
2000
+ isMask: !1
2001
+ })} (mask)` : e.name ? e.name : e.type === "text" ? e.text || A.text : e.type === "shape" ? M[e.kind ?? "logo"] ?? A.shape : e.type === "bool" ? j[e.op] ?? A.bool : e.type === "loop" || e.type === "misc" ? e.presetLabel || A[e.type] : e.type === "kinetic" ? e.presetLabel || A.kinetic : A[e.type] ?? e.type;
2002
+ }
2003
+ //#endregion
2004
+ //#region src/editor/morph/buildMorph.js
2005
+ var P = [
2006
+ {
2007
+ value: "loop",
2008
+ label: "Loop"
2009
+ },
2010
+ {
2011
+ value: "pingpong",
2012
+ label: "Ping-pong"
2013
+ },
2014
+ {
2015
+ value: "once",
2016
+ label: "Once"
2017
+ }
2018
+ ], F = t.filter((e) => e.value !== "hold"), ee = new Set([
2019
+ "range",
2020
+ "int",
2021
+ "color"
2022
+ ]), te = [
2023
+ "loopGroup",
2024
+ "presetId",
2025
+ "presetLabel"
2026
+ ], ne = (e, t) => e === t || JSON.stringify(e) === JSON.stringify(t);
2027
+ function I(e, t, n) {
2028
+ let r = t === "loop" ? [...e, e[0]] : t === "pingpong" ? [...e, ...e.slice(0, -1).reverse()] : e, i = r.length - 1;
2029
+ return r.map((e, t) => ({
2030
+ t: i ? t / i : 0,
2031
+ v: e,
2032
+ easing: n
2033
+ }));
2034
+ }
2035
+ function L(e, t) {
2036
+ return (Array.isArray(e?.layers) ? e.layers : []).find((e) => e && e.type === "loop" && e.loopId === t) ?? null;
2037
+ }
2038
+ function R({ snapshots: e, schema: t, curve: n = "in-out", cycle: r = "loop", stepSeeds: i = !1 }) {
2039
+ if (!Array.isArray(e) || e.length < 2) throw Error("buildMorph: two or more snapshots");
2040
+ if (!P.some((e) => e.value === r)) throw Error(`buildMorph: unknown cycle ${r}`);
2041
+ let a = e[0], o = {};
2042
+ for (let e of te) a[e] !== void 0 && (o[e] = a[e]);
2043
+ let s = [], c = [], l = [];
2044
+ for (let a of t) {
2045
+ let t = e.map((e) => e[a.key] === void 0 ? a.default : e[a.key]);
2046
+ if (t.every((e) => ne(e, t[0]))) {
2047
+ t[0] !== void 0 && (o[a.key] = t[0]);
2048
+ continue;
2049
+ }
2050
+ if (a.key === "seed" && !i) {
2051
+ o[a.key] = t[0], l.push(a);
2052
+ continue;
2053
+ }
2054
+ let u = a.key === "seed" || !ee.has(a.type);
2055
+ o[a.key] = {
2056
+ bind: "track",
2057
+ keys: I(t, r, u ? "hold" : n)
2058
+ }, (u ? c : s).push(a);
2000
2059
  }
2001
- return e.type === "loop" && e.presetLabel ? `Loop · ${e.presetLabel}` : e.type === "misc" && e.presetLabel ? `Misc · ${e.presetLabel}` : e.type === "kinetic" && e.presetLabel ? `Kinetic · ${e.presetLabel}` : E[e.type] ?? e.type;
2060
+ return {
2061
+ patch: o,
2062
+ tweened: s,
2063
+ stepped: c,
2064
+ held: l
2065
+ };
2066
+ }
2067
+ //#endregion
2068
+ //#region src/editor/morph/morphStore.js
2069
+ var z = {
2070
+ active: !1,
2071
+ mode: "shape",
2072
+ resolution: 0,
2073
+ editRequest: null,
2074
+ loopId: null,
2075
+ steps: [],
2076
+ curve: "in-out",
2077
+ cycle: "loop",
2078
+ syncLoop: !1,
2079
+ seconds: 4,
2080
+ editing: null,
2081
+ fileId: null,
2082
+ fileName: null,
2083
+ picker: null,
2084
+ presetId: null
2085
+ }, B = { ...z }, V = /* @__PURE__ */ new Set(), H = () => V.forEach((e) => e()), U = (e) => (V.add(e), () => V.delete(e)), W = () => B, G = () => a(U, W, W);
2086
+ function K(e) {
2087
+ B = {
2088
+ ...B,
2089
+ ...e
2090
+ }, H();
2091
+ }
2092
+ function q(e = {}) {
2093
+ B = {
2094
+ ...z,
2095
+ ...e
2096
+ }, H();
2097
+ }
2098
+ function J(e) {
2099
+ B = {
2100
+ ...B,
2101
+ active: !0,
2102
+ loopId: B.loopId ?? e.loopId,
2103
+ steps: [...B.steps, e]
2104
+ }, H();
2105
+ }
2106
+ function Y(e, t) {
2107
+ let n = B.steps[e];
2108
+ if (!n) return;
2109
+ let r = B.steps.slice();
2110
+ r[e] = {
2111
+ ...n,
2112
+ params: { ...t }
2113
+ }, B = {
2114
+ ...B,
2115
+ steps: r
2116
+ }, H();
2117
+ }
2118
+ function X(e) {
2119
+ let t = B.steps.filter((t, n) => n !== e);
2120
+ B = {
2121
+ ...B,
2122
+ steps: t,
2123
+ loopId: t.length ? B.loopId : null,
2124
+ editing: B.editing === e ? null : B.editing
2125
+ }, H();
2126
+ }
2127
+ function re(e, t) {
2128
+ let n = B.steps.length;
2129
+ if (e === t || e < 0 || e >= n || t < 0 || t >= n) return;
2130
+ let r = B.steps.slice(), [i] = r.splice(e, 1);
2131
+ r.splice(t, 0, i);
2132
+ let a = B.editing, o = a == null ? a : a === e ? t : e < a && a <= t ? a - 1 : t <= a && a < e ? a + 1 : a;
2133
+ B = {
2134
+ ...B,
2135
+ steps: r,
2136
+ editing: o
2137
+ }, H();
2138
+ }
2139
+ function ie(e, t) {
2140
+ let n = {};
2141
+ for (let r of t) n[r.key] = e?.[r.key] === void 0 ? r.default : e[r.key];
2142
+ return n;
2143
+ }
2144
+ var ae = (e, t) => e.source?.label || `Step ${t + 1}`, Z = "kol-editor-timeline-pinned", Q = !1;
2145
+ try {
2146
+ Q = localStorage.getItem(Z) === "1";
2147
+ } catch {}
2148
+ var $ = /* @__PURE__ */ new Set();
2149
+ function oe() {
2150
+ Q = !Q;
2151
+ try {
2152
+ localStorage.setItem(Z, Q ? "1" : "0");
2153
+ } catch {}
2154
+ $.forEach((e) => e(Q));
2002
2155
  }
2003
- function A(e) {
2004
- return e.name ? e.name : e.type === "text" ? e.text || E.text : e.type === "shape" ? O[e.kind ?? "logo"] ?? E.shape : e.type === "bool" ? D[e.op] ?? E.bool : e.type === "loop" || e.type === "misc" ? e.presetLabel || E[e.type] : e.type === "kinetic" ? e.presetLabel || E.kinetic : E[e.type] ?? e.type;
2156
+ function se() {
2157
+ let [e, t] = i(Q);
2158
+ return r(() => {
2159
+ let e = (e) => t(e);
2160
+ return $.add(e), () => $.delete(e);
2161
+ }, []), e;
2005
2162
  }
2006
2163
  //#endregion
2007
- export { S as a, T as c, s as d, c as f, w as i, a as l, A as n, g as o, l as p, x as r, h as s, k as t, d as u };
2164
+ export { p as A, b as C, h as D, l as E, d as O, E as S, k as T, L as _, ie as a, T as b, q as c, Y as d, G as f, I as g, R as h, W as i, f as k, K as l, P as m, se as n, X as o, F as p, J as r, re as s, oe as t, ae as u, j as v, y as w, O as x, N as y };