@kolkrabbi/design-editor 0.20.0 → 0.21.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.
@@ -0,0 +1,2263 @@
1
+ import { A as e, Ft as t, It as n, Qt as r, S as i, an as a, c as o, cn as s, ct as c, dn as l, dt as u, en as d, f, ft as p, in as m, j as h, l as g, ln as _, lt as v, m as y, mn as b, nn as x, on as S, rn as C, t as ee, ut as te, y as ne, zt as w } from "./rolls-Bg1XHuvJ.js";
2
+ import { r as T } from "./TreePicker-DLmMl0aU.js";
3
+ import { a as E, c as re, d as D, f as O, i as ie, l as ae, o as k, p as A, r as j, s as oe, t as se, u as ce } from "./labels-B5qkocWy.js";
4
+ import { Button as M, Dropdown as le, Input as ue, LabeledControl as N, MenuDropdownItem as de, PopoverPanel as fe, SegmentedToggle as pe, Slider as me, Textarea as he, TimelineDock as ge, ToggleCheckbox as _e, Tooltip as P, ViewToggle as ve, glyphSize as ye, usePopover as F } from "@kolkrabbi/kol-component";
5
+ import { Fragment as be, useEffect as xe, useMemo as Se, useRef as Ce, useState as I } from "react";
6
+ import { Fragment as we, jsx as L, jsxs as R } from "react/jsx-runtime";
7
+ import { Icon as z } from "@kolkrabbi/kol-icons";
8
+ //#region src/kinetic/animations.js
9
+ var B = {
10
+ dLen: 0,
11
+ dNormal: 0,
12
+ scale: 1,
13
+ dRot: 0,
14
+ opacity: 1,
15
+ vf: null
16
+ }, Te = {
17
+ none: () => B,
18
+ march: (e) => ({
19
+ ...B,
20
+ dLen: e.u * e.pathLen * Math.max(1, Math.round(e.m.cycles || 1))
21
+ }),
22
+ orbit: (e) => ({
23
+ ...B,
24
+ dLen: e.u * e.pathLen * Math.max(1, Math.round(e.m.cycles || 1))
25
+ }),
26
+ vfwave: (e) => {
27
+ let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u * s * t - e.i * (e.m.phase ?? .5));
28
+ return {
29
+ ...B,
30
+ vf: { [e.axisTag]: l(e.axisMin, e.axisMax, n) }
31
+ };
32
+ },
33
+ glyphwave: (e) => {
34
+ let t = Math.max(1, Math.round(e.m.cycles || 1)), n = Math.sin(e.u * s * t - e.i * (e.m.phase ?? .5));
35
+ return {
36
+ ...B,
37
+ dNormal: (e.m.amp ?? .3) * e.sizePx * n
38
+ };
39
+ },
40
+ cascade: (e) => {
41
+ let t = Math.max(1, Math.round(e.m.cycles || 1)), n = .5 + .5 * Math.sin(e.u * s * t - e.i * (e.m.phase ?? .6));
42
+ return {
43
+ ...B,
44
+ scale: l(.25, 1, n),
45
+ opacity: l(.15, 1, n)
46
+ };
47
+ },
48
+ sweep: (e) => {
49
+ let t = ke(e);
50
+ return {
51
+ ...B,
52
+ scale: l(.25, 1, t),
53
+ opacity: l(.12, 1, t)
54
+ };
55
+ },
56
+ sweepWeight: (e) => {
57
+ let t = ke(e);
58
+ return {
59
+ ...B,
60
+ vf: { [e.axisTag]: l(e.axisMin, e.axisMax, t) }
61
+ };
62
+ },
63
+ sweepShift: (e) => {
64
+ let t = ke(e);
65
+ return {
66
+ ...B,
67
+ dNormal: t * .6 * e.sizePx
68
+ };
69
+ }
70
+ }, Ee = (e) => e - Math.floor(e);
71
+ function De(e, t) {
72
+ if (t <= 0) return 0;
73
+ let n = Math.min(1, e / t);
74
+ return 1 - n * n * (3 - 2 * n);
75
+ }
76
+ function Oe(e, t, n, r, i, a) {
77
+ let o = Ee(r * i), c = Math.max(.02, a * .5), l = (e) => {
78
+ let t = Math.abs(Ee(e) - o);
79
+ return De(Math.min(t, 1 - t), c);
80
+ };
81
+ switch (e) {
82
+ case "y": return l(n);
83
+ case "diagonal": return l(.5 + (t - .5) * .7071 + (n - .5) * .7071);
84
+ case "radial": return l(Math.hypot(t - .5, n - .5) / .7071);
85
+ case "angular": return l(Math.atan2(n - .5, t - .5) / s + .5);
86
+ case "wave": {
87
+ let e = Math.max(1, Math.round(1 + (1 - a) * 6));
88
+ return .5 + .5 * Math.sin((t * e - r * i) * s);
89
+ }
90
+ default: return l(t);
91
+ }
92
+ }
93
+ var ke = (e) => Oe(e.m.field || "x", e.nx ?? .5, e.ny ?? .5, e.u, Math.max(1, Math.round(e.m.cycles || 1)), e.m.amp ?? .35);
94
+ function Ae(e, t) {
95
+ return (Te[e] || Te.none)(t);
96
+ }
97
+ //#endregion
98
+ //#region src/kinetic/features.js
99
+ var je = [
100
+ {
101
+ tag: "liga",
102
+ label: "Ligatures"
103
+ },
104
+ {
105
+ tag: "dlig",
106
+ label: "Discretionary ligatures"
107
+ },
108
+ {
109
+ tag: "smcp",
110
+ label: "Small caps"
111
+ },
112
+ {
113
+ tag: "case",
114
+ label: "Case-sensitive forms"
115
+ },
116
+ {
117
+ tag: "onum",
118
+ label: "Oldstyle figures"
119
+ },
120
+ {
121
+ tag: "tnum",
122
+ label: "Tabular figures"
123
+ },
124
+ {
125
+ tag: "frac",
126
+ label: "Fractions"
127
+ },
128
+ {
129
+ tag: "swsh",
130
+ label: "Swashes"
131
+ },
132
+ {
133
+ tag: "ss01",
134
+ label: "Stylistic set 1"
135
+ },
136
+ {
137
+ tag: "ss02",
138
+ label: "Stylistic set 2"
139
+ }
140
+ ];
141
+ function Me(e) {
142
+ if (!e) return "normal";
143
+ let t = [];
144
+ for (let [n, r] of Object.entries(e)) t.push(`"${n}" ${+!!r}`);
145
+ return t.length ? t.join(", ") : "normal";
146
+ }
147
+ //#endregion
148
+ //#region src/kinetic/KineticType.js
149
+ var Ne = "http://www.w3.org/2000/svg", V = (e) => e - Math.floor(e), H = (e) => document.createElementNS(Ne, e);
150
+ function Pe(e, t) {
151
+ return !e || !t || t === "none" ? e || "" : t === "upper" ? e.toUpperCase() : t === "lower" ? e.toLowerCase() : t === "title" ? e.replace(/\b\w/g, (e) => e.toUpperCase()) : e;
152
+ }
153
+ function Fe(e) {
154
+ if (!e) return {
155
+ bg: "#16202E",
156
+ instances: []
157
+ };
158
+ if (Array.isArray(e.instances)) return e;
159
+ let { bg: t, ...n } = e;
160
+ return {
161
+ bg: t || "#16202E",
162
+ instances: [{
163
+ id: "main",
164
+ ...n
165
+ }]
166
+ };
167
+ }
168
+ var Ie = class {
169
+ constructor(e) {
170
+ this.host = e, this.params = Fe(null), this.w = 0, this.h = 0, this._rt = /* @__PURE__ */ new Map(), this._instSig = "", this._needsRemeasure = !1;
171
+ let t = H("svg");
172
+ t.setAttribute("xmlns", Ne), t.style.display = "block", t.style.maxWidth = "100%", t.style.maxHeight = "100%", t.style.pointerEvents = "none", t.style.overflow = "hidden", this._clipApplied = !0, this.bg = H("rect"), this.layer = H("g"), this.measEl = H("text"), this.measEl.setAttribute("x", "0"), this.measEl.setAttribute("y", "0"), this.measEl.style.visibility = "hidden", t.append(this.bg, this.layer, this.measEl), e.appendChild(t), this.svg = t, e.__kolKineticEngine = this, typeof document < "u" && document.fonts && document.fonts.ready.then(() => {
173
+ this._needsRemeasure = !0;
174
+ }).catch(() => {});
175
+ }
176
+ resize(e, t) {
177
+ this.w = e, this.h = t, this.svg.setAttribute("width", e), this.svg.setAttribute("height", t), this.svg.setAttribute("viewBox", `0 0 ${e} ${t}`), this.bg.setAttribute("width", e), this.bg.setAttribute("height", t);
178
+ for (let e of this._rt.values()) e.cache = null;
179
+ }
180
+ setComposition(e) {
181
+ this.params = Fe(e);
182
+ }
183
+ renderAt(e) {
184
+ !this.w || !this.h || this._render(_(e));
185
+ }
186
+ getInstanceRect(e) {
187
+ let t = this._rt.get(e);
188
+ if (!t || !t.glyphG) return null;
189
+ let n;
190
+ try {
191
+ n = t.glyphG.getBBox();
192
+ } catch {
193
+ return null;
194
+ }
195
+ if (!n || !n.width || !n.height) return null;
196
+ let r = (this.params.instances || []).find((t) => t.id === e), i = (r?.offset?.x || 0) * this.w, a = (r?.offset?.y || 0) * this.h;
197
+ return {
198
+ x: n.x + i,
199
+ y: n.y + a,
200
+ w: n.width,
201
+ h: n.height
202
+ };
203
+ }
204
+ hitTest(e, t) {
205
+ let n = this.svg.getBoundingClientRect();
206
+ if (!n.width || !n.height) return null;
207
+ let r = (e - n.left) * (this.w / n.width), i = (t - n.top) * (this.h / n.height), a = this.params.instances || [];
208
+ for (let e = a.length - 1; e >= 0; e--) {
209
+ let t = this.getInstanceRect(a[e].id);
210
+ if (t && r >= t.x && r <= t.x + t.w && i >= t.y && i <= t.y + t.h) return a[e].id;
211
+ }
212
+ return null;
213
+ }
214
+ dispose() {
215
+ this.host && this.host.__kolKineticEngine === this && delete this.host.__kolKineticEngine, this.svg && this.svg.parentNode === this.host && this.host.removeChild(this.svg);
216
+ }
217
+ _syncInstances() {
218
+ let e = this.params.instances || [], t = e.map((e) => e.id).join("|");
219
+ if (t === this._instSig) return;
220
+ this._instSig = t;
221
+ let n = new Set(e.map((e) => e.id));
222
+ for (let [e, t] of this._rt) n.has(e) || (t.group.remove(), this._rt.delete(e));
223
+ for (let t of e) {
224
+ let e = this._rt.get(t.id);
225
+ if (!e) {
226
+ let n = H("g"), r = H("path");
227
+ r.setAttribute("fill", "none");
228
+ let i = H("g");
229
+ i.setAttribute("data-glyphs", t.id), n.append(r, i), e = {
230
+ group: n,
231
+ pathEl: r,
232
+ glyphG: i,
233
+ glyphEls: [],
234
+ cache: null,
235
+ glyphKey: "",
236
+ closed: !1
237
+ }, this._rt.set(t.id, e);
238
+ }
239
+ this.layer.appendChild(e.group);
240
+ }
241
+ }
242
+ _render(e) {
243
+ let t = this.params.clip !== !1;
244
+ if (t !== this._clipApplied && (this._clipApplied = t, this.svg.style.overflow = t ? "hidden" : "visible"), this._needsRemeasure) {
245
+ this._needsRemeasure = !1;
246
+ for (let e of this._rt.values()) e.cache = null;
247
+ }
248
+ this.bg.setAttribute("fill", this.params.bg || "#16202E"), this._syncInstances();
249
+ for (let t of this.params.instances || []) {
250
+ let n = this._rt.get(t.id);
251
+ n && this._renderInstance(t, n, e);
252
+ }
253
+ }
254
+ _ensureGlyphs(e, t, n, r) {
255
+ let i = `${t}|${n.family}|${r}`;
256
+ if (i !== e.glyphKey) {
257
+ e.glyphKey = i, e.glyphG.textContent = "", e.glyphEls = [];
258
+ for (let n = 0; n < r; n++) for (let n of t) {
259
+ let t = H("text");
260
+ t.setAttribute("text-anchor", "middle"), t.setAttribute("dominant-baseline", "central"), t.textContent = n, e.glyphG.appendChild(t), e.glyphEls.push(t);
261
+ }
262
+ }
263
+ }
264
+ _measure(e, t, n, r) {
265
+ let i = t.letterSpacing || 0, o = Me(t.opentype), s = `${r}|${n.family}|${t.fontSize}|${i}|${a(t.vf)}|${o}`;
266
+ if (e.cache && e.cache.key === s) return e.cache;
267
+ let c = this.measEl;
268
+ c.style.fontFamily = `'${n.family}'`, c.style.fontSize = `${t.fontSize}px`, c.style.letterSpacing = `${i}px`, c.style.fontVariationSettings = a(t.vf), c.style.fontFeatureSettings = o, c.textContent = r;
269
+ let l = r.length, u = Array(l), d = 0;
270
+ try {
271
+ d = c.getComputedTextLength();
272
+ let e = Array(l);
273
+ for (let t = 0; t < l; t++) e[t] = c.getStartPositionOfChar(t).x;
274
+ for (let t = 0; t < l; t++) u[t] = (e[t] + (t + 1 < l ? e[t + 1] : d)) / 2;
275
+ } catch {
276
+ d = t.fontSize * .6 * l;
277
+ for (let e = 0; e < l; e++) u[e] = (e + .5) * (d / Math.max(1, l));
278
+ }
279
+ return e.cache = {
280
+ key: s,
281
+ centers: u,
282
+ total: d
283
+ }, e.cache;
284
+ }
285
+ _renderInstance(e, t, n) {
286
+ let r = x(e.font), i = e.phase ? V(n + e.phase) : n, a = Pe(e.text || "", e.case), o = Math.max(1, Math.round(e.multiply || 1)), s = o > 1 && a ? Array(o).fill(a).join(" ") : a, c = e.path?.type || "line", l = (e.offset?.x || 0) * this.w, d = (e.offset?.y || 0) * this.h;
287
+ if (t.group.setAttribute("transform", `translate(${l.toFixed(2)} ${d.toFixed(2)})`), e.morph?.on && !O(c) && !A(c)) {
288
+ let n = r.url, a = e.morph.face2 ? x(e.morph.face2) : null, o = a ? a.url : n, l = p(n), d = p(o);
289
+ if (l && d) {
290
+ this._setKind(t, "morph"), this._renderMorph(e, t, i, l, d, r, s, c);
291
+ return;
292
+ }
293
+ l || u(n).catch(() => {}), !d && o !== n && u(o).catch(() => {});
294
+ }
295
+ if (this._setKind(t, "text"), D(c)) {
296
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
297
+ let n = Math.max(1, Math.round(e.path?.rows ?? 2)), a = Math.max(1, Math.round(e.path?.cols ?? 3));
298
+ if (this._ensureGlyphs(t, s, r, n * a), !s.length) return;
299
+ this._measure(t, e, r, s), this._placeArray(e, t, r, i, t.glyphEls, n, a);
300
+ return;
301
+ }
302
+ if (O(c) || A(c)) {
303
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
304
+ let n = Math.max(1, Math.round(e.path?.count ?? 12));
305
+ if (this._ensureGlyphs(t, s, r, n), !s.length) return;
306
+ this._measure(t, e, r, s), O(c) ? this._placeRadial(e, t, r, i, t.glyphEls, n) : this._placeRings(e, t, r, i, t.glyphEls, n);
307
+ return;
308
+ }
309
+ let f = ce(c, this.w, this.h, e.path || {});
310
+ t.closed = f.closed, t.pathEl.setAttribute("d", f.d), t.pathEl.setAttribute("stroke", e.showPath ? e.fill || "#888" : "none"), t.pathEl.setAttribute("stroke-width", +!!e.showPath), t.pathEl.style.opacity = e.showPath ? .25 : 0, this._ensureGlyphs(t, s, r, 1), s.length && (this._measure(t, e, r, s), this._placeOnPath(e, t, r, i, t.glyphEls));
311
+ }
312
+ _styleGlyph(e, t, n, r) {
313
+ e.style.fontFamily = `'${n.family}'`, e.style.fontSize = `${t.fontSize}px`, e.style.fontStyle = t.italic ? "italic" : "normal", e.style.fontVariationSettings = a(r.vf ? {
314
+ ...t.vf,
315
+ ...r.vf
316
+ } : t.vf), e.style.fontFeatureSettings = Me(t.opentype), e.setAttribute("fill", t.fill || "#e8e4dc"), e.setAttribute("opacity", r.opacity);
317
+ }
318
+ _anim(e, t, n) {
319
+ let r = e.motions && e.motions.length ? [e.motion, ...e.motions] : [e.motion], i = 0, a = 0, o = 0, s = 1, c = 1, l = null;
320
+ for (let e of r) {
321
+ if (!e || (e.mode || "none") === "none") continue;
322
+ let r = n.axes.find((t) => t.tag === (e.axis || n.axes[0] && n.axes[0].tag)), u = Ae(e.mode, {
323
+ ...t,
324
+ m: e,
325
+ axisTag: r ? r.tag : "wght",
326
+ axisMin: r ? r.min : 100,
327
+ axisMax: r ? r.max : 900
328
+ });
329
+ i += u.dLen, a += u.dNormal, o += u.dRot, s *= u.scale, c *= u.opacity, u.vf && (l = {
330
+ ...l || {},
331
+ ...u.vf
332
+ });
333
+ }
334
+ return {
335
+ dLen: i,
336
+ dNormal: a,
337
+ scale: s,
338
+ dRot: o,
339
+ opacity: c,
340
+ vf: l
341
+ };
342
+ }
343
+ _placeOnPath(e, t, n, r, i) {
344
+ let a = t.cache;
345
+ if (!a) return;
346
+ let o = t.pathEl.getTotalLength();
347
+ if (!o) return;
348
+ let { centers: s, total: c } = a, l = e.align || "center", u = l === "start" ? 0 : l === "end" ? o - c : (o - c) / 2, d = .75, f = t.closed, p = e.flow === "flow" && !f, m = (e) => f ? (e % o + o) % o : Math.max(0, Math.min(o, e)), h = (e) => {
349
+ if (p && (e < 0 || e > o)) {
350
+ let n = e < 0 ? 0 : o, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - d)), a = t.pathEl.getPointAtLength(Math.min(o, n + d)), s = a.x - i.x, c = a.y - i.y, l = Math.hypot(s, c) || 1;
351
+ s /= l, c /= l;
352
+ let u = e - n;
353
+ return {
354
+ x: r.x + s * u,
355
+ y: r.y + c * u
356
+ };
357
+ }
358
+ return t.pathEl.getPointAtLength(m(e));
359
+ }, g = Math.min(i.length, s.length), v = _(e.stagger || 0), y = Math.max(1, Math.round(e.multiply || 1)), b = (s.length + 2) / y;
360
+ for (let t = 0; t < g; t++) {
361
+ let a = u + s[t], c = h(a), l = v && y > 1 ? V(r + v * Math.floor(t / b) / y) : r, f = this._anim(e, {
362
+ i: t,
363
+ n: s.length,
364
+ u: l,
365
+ sizePx: e.fontSize,
366
+ pathLen: o,
367
+ nx: this.w ? c.x / this.w : .5,
368
+ ny: this.h ? c.y / this.h : .5
369
+ }, n), p = a + f.dLen, m = h(p), g = h(p - d), _ = h(p + d), x = Math.atan2(_.y - g.y, _.x - g.x) * 180 / Math.PI;
370
+ i[t].setAttribute("transform", `translate(${m.x.toFixed(2)} ${m.y.toFixed(2)}) rotate(${(x + f.dRot).toFixed(2)}) translate(0 ${(-f.dNormal).toFixed(2)}) scale(${f.scale.toFixed(3)})`), this._styleGlyph(i[t], e, n, f);
371
+ }
372
+ }
373
+ _placeArray(e, t, n, r, i, a, o) {
374
+ let s = t.cache;
375
+ if (!s) return;
376
+ let { centers: c, total: l } = s, u = c.length;
377
+ if (!u) return;
378
+ let d = Math.min(this.w, this.h) * .08, f = (this.w - 2 * d) / o, p = (this.h - 2 * d) / a, m = _(e.stagger || 0), h = a * o;
379
+ for (let t = 0; t < h; t++) {
380
+ let a = Math.floor(t / o), s = d + t % o * f + f / 2, g = d + a * p + p / 2, _ = s - l / 2, v = m ? V(r + m * t / h) : r;
381
+ for (let r = 0; r < u; r++) {
382
+ let a = i[t * u + r];
383
+ if (!a) continue;
384
+ let o = _ + c[r], s = this._anim(e, {
385
+ i: t * u + r,
386
+ n: h * u,
387
+ u: v,
388
+ sizePx: e.fontSize,
389
+ pathLen: 0,
390
+ nx: this.w ? o / this.w : .5,
391
+ ny: this.h ? g / this.h : .5
392
+ }, n), l = g - s.dNormal;
393
+ a.setAttribute("transform", `translate(${o.toFixed(2)} ${l.toFixed(2)}) rotate(${s.dRot.toFixed(2)}) scale(${s.scale.toFixed(3)})`), this._styleGlyph(a, e, n, s);
394
+ }
395
+ }
396
+ }
397
+ _placeRadial(e, t, n, r, i, a) {
398
+ let o = t.cache;
399
+ if (!o) return;
400
+ let { centers: c } = o, l = c.length;
401
+ if (!l) return;
402
+ let u = this.w / 2, d = this.h / 2, f = Math.min(this.w, this.h) * .5, p = f * Math.max(0, Math.min(.95, e.path?.inner ?? .12)), m = Math.round(e.path?.spin ?? 1), h = _(e.stagger || 0);
403
+ for (let t = 0; t < a; t++) {
404
+ let o = a > 1 ? t / (a - 1) : 0, g = m + (h ? Math.round(h * 2 * o) : 0), _ = t / a * s + r * s * g, v = h ? V(r + h * t / a) : r, y = Math.cos(_), b = Math.sin(_), x = _ * 180 / Math.PI;
405
+ for (let r = 0; r < l; r++) {
406
+ let o = t * l + r, s = i[o];
407
+ if (!s) continue;
408
+ let m = p + c[r], h = u + y * m, g = d + b * m, _ = this._anim(e, {
409
+ i: o,
410
+ n: a * l,
411
+ u: v,
412
+ sizePx: e.fontSize,
413
+ pathLen: f,
414
+ nx: this.w ? h / this.w : .5,
415
+ ny: this.h ? g / this.h : .5
416
+ }, n), S = m + _.dLen, C = u + y * S, ee = d + b * S;
417
+ s.setAttribute("transform", `translate(${C.toFixed(2)} ${ee.toFixed(2)}) rotate(${(x + _.dRot).toFixed(2)}) translate(0 ${(-_.dNormal).toFixed(2)}) scale(${_.scale.toFixed(3)})`), this._styleGlyph(s, e, n, _);
418
+ }
419
+ }
420
+ }
421
+ _placeRings(e, t, n, r, i, a) {
422
+ let o = t.cache;
423
+ if (!o) return;
424
+ let { centers: c, total: l } = o, u = c.length;
425
+ if (!u) return;
426
+ let d = this.w / 2, f = this.h / 2, p = Math.min(this.w, this.h) * .5 * Math.max(.1, Math.min(1, e.path?.radius ?? .92)), m = p * Math.max(.02, Math.min(.95, e.path?.inner ?? .14)), h = Math.round(e.path?.spin ?? 1), g = e.path?.twist ?? .5, v = e.path?.grow ?? .6, y = _(e.stagger || 0);
427
+ for (let t = 0; t < a; t++) {
428
+ let o = a > 1 ? t / (a - 1) : 0, _ = Math.max(1, m + o * (p - m)), b = h + (y ? Math.round(y * 2 * o) : 0), x = r * s * b + o * g * s, S = y ? V(r + y * t / a) : r, C = 1 + v * o;
429
+ for (let r = 0; r < u; r++) {
430
+ let o = t * u + r, p = i[o];
431
+ if (!p) continue;
432
+ let m = x + (c[r] - l / 2) / _, h = d + Math.cos(m) * _, g = f + Math.sin(m) * _, v = this._anim(e, {
433
+ i: o,
434
+ n: a * u,
435
+ u: S,
436
+ sizePx: e.fontSize,
437
+ pathLen: s * _,
438
+ nx: this.w ? h / this.w : .5,
439
+ ny: this.h ? g / this.h : .5
440
+ }, n), y = m + v.dLen / _, b = _ - v.dNormal, ee = d + Math.cos(y) * b, te = f + Math.sin(y) * b, ne = y * 180 / Math.PI + 90 + v.dRot;
441
+ p.setAttribute("transform", `translate(${ee.toFixed(2)} ${te.toFixed(2)}) rotate(${ne.toFixed(2)}) scale(${(v.scale * C).toFixed(3)})`), this._styleGlyph(p, e, n, v);
442
+ }
443
+ }
444
+ }
445
+ _setKind(e, t) {
446
+ e.kind !== t && (e.kind = t, e.glyphG.textContent = "", e.glyphEls = [], e.morphEls = [], e.glyphKey = "", e.morphKey = "", e.morphPoolKey = "", e.cache = null);
447
+ }
448
+ _renderMorph(e, t, n, r, i, a, o, s) {
449
+ let c = e.fontSize, l = a.axes || [], u = {};
450
+ for (let t of l) u[t.tag] = e.vf?.[t.tag] ?? t.def;
451
+ let d = !!e.morph.face2, f = {};
452
+ if (!d) for (let t of l) f[t.tag] = e.morph.vf2?.[t.tag] ?? t.max;
453
+ let p = c * .12 + (e.letterSpacing || 0), m = e.morph.mode || "morph", h = e.morph.blend ?? .5, g = e.morph.curve || "flat", _ = e.morph.cp1 || {
454
+ x: .33,
455
+ y: .33
456
+ }, v = e.morph.cp2 || {
457
+ x: .66,
458
+ y: .66
459
+ }, y = e.fill || "#e8e4dc", b = JSON.stringify([
460
+ o,
461
+ e.font,
462
+ e.morph.face2 || "",
463
+ c,
464
+ u,
465
+ f,
466
+ m,
467
+ h,
468
+ g,
469
+ _,
470
+ v,
471
+ e.letterSpacing || 0,
472
+ y
473
+ ]), x = b !== t.morphKey;
474
+ if (x) {
475
+ t.morphKey = b;
476
+ let e = te(r, i, o, c, {
477
+ mode: m,
478
+ blend: h,
479
+ curve: g,
480
+ cp1: _,
481
+ cp2: v,
482
+ coordsA: u,
483
+ coordsB: f,
484
+ axes: l,
485
+ gap: p
486
+ });
487
+ t.morphData = e;
488
+ let n = [], a = 0;
489
+ for (let t of e.glyphs) n.push(a + t.advance / 2), a += t.advance;
490
+ t.morphCenters = n, t.morphTotal = e.totalAdvance;
491
+ }
492
+ let S = t.morphData?.glyphs.length || 0;
493
+ if (!o.length || !S) {
494
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0;
495
+ return;
496
+ }
497
+ let C = D(s), ee = C ? Math.max(1, Math.round(e.path?.rows ?? 2)) : 1, ne = C ? Math.max(1, Math.round(e.path?.cols ?? 3)) : 1, w = C ? ee * ne : 1, T = this._ensureMorphPool(t, S, w, m);
498
+ if ((x || T) && this._refreshMorphPaths(t, w, m, y), C) {
499
+ t.pathEl.setAttribute("d", ""), t.pathEl.style.opacity = 0, this._placeMorphArray(e, t, a, n, ee, ne);
500
+ return;
501
+ }
502
+ let E = ce(s, this.w, this.h, e.path || {});
503
+ t.closed = E.closed, t.pathEl.setAttribute("d", E.d), t.pathEl.setAttribute("stroke", e.showPath ? e.fill || "#888" : "none"), t.pathEl.setAttribute("stroke-width", +!!e.showPath), t.pathEl.style.opacity = e.showPath ? .25 : 0, this._placeMorphOnPath(e, t, a, n);
504
+ }
505
+ _ensureMorphPool(e, t, n, r) {
506
+ let i = `${t}|${n}|${r}`;
507
+ if (i === e.morphPoolKey) return !1;
508
+ e.morphPoolKey = i, e.glyphG.textContent = "", e.morphEls = [];
509
+ let a = t * n;
510
+ for (let t = 0; t < a; t++) {
511
+ let t = H("g");
512
+ t.appendChild(H("path")), r === "fade" && t.appendChild(H("path")), e.glyphG.appendChild(t), e.morphEls.push(t);
513
+ }
514
+ return !0;
515
+ }
516
+ _refreshMorphPaths(e, t, n, r) {
517
+ let i = e.morphData?.glyphs || [], a = i.length;
518
+ if (a) for (let t = 0; t < e.morphEls.length; t++) {
519
+ let o = e.morphEls[t], s = i[t % a];
520
+ if (!s) continue;
521
+ let c = o.childNodes;
522
+ n === "fade" ? (this._setMorphPath(c[0], s.dA, s.bboxA, r, s.opA), this._setMorphPath(c[1], s.dB, s.bboxB, r, s.opB)) : this._setMorphPath(c[0], s.d, s.bbox, r, 1);
523
+ }
524
+ }
525
+ _setMorphPath(e, t, n, r, i) {
526
+ if (!e) return;
527
+ e.setAttribute("d", t || ""), e.setAttribute("fill", r), e.setAttribute("fill-rule", "evenodd"), e.setAttribute("opacity", i);
528
+ let a = (n.x1 + n.x2) / 2, o = (n.y1 + n.y2) / 2;
529
+ e.setAttribute("transform", `translate(${(-a).toFixed(2)} ${(-o).toFixed(2)})`);
530
+ }
531
+ _placeMorphOnPath(e, t, n, r, i = t.morphEls) {
532
+ let a = t.morphCenters, o = t.morphTotal;
533
+ if (!a || !i) return;
534
+ let s = t.pathEl.getTotalLength();
535
+ if (!s) return;
536
+ let c = e.align || "center", l = c === "start" ? 0 : c === "end" ? s - o : (s - o) / 2, u = .75, d = t.closed, f = e.flow === "flow" && !d, p = (e) => d ? (e % s + s) % s : Math.max(0, Math.min(s, e)), m = (e) => {
537
+ if (f && (e < 0 || e > s)) {
538
+ let n = e < 0 ? 0 : s, r = t.pathEl.getPointAtLength(n), i = t.pathEl.getPointAtLength(Math.max(0, n - u)), a = t.pathEl.getPointAtLength(Math.min(s, n + u)), o = a.x - i.x, c = a.y - i.y, l = Math.hypot(o, c) || 1;
539
+ o /= l, c /= l;
540
+ let d = e - n;
541
+ return {
542
+ x: r.x + o * d,
543
+ y: r.y + c * d
544
+ };
545
+ }
546
+ return t.pathEl.getPointAtLength(p(e));
547
+ }, h = e.italic ? " skewX(-12)" : "", g = Math.min(i.length, a.length), v = _(e.stagger || 0), y = Math.max(1, Math.round(e.multiply || 1)), b = (a.length + 2) / y;
548
+ for (let t = 0; t < g; t++) {
549
+ let o = l + a[t], c = m(o), d = v && y > 1 ? V(r + v * Math.floor(t / b) / y) : r, f = this._anim(e, {
550
+ i: t,
551
+ n: a.length,
552
+ u: d,
553
+ sizePx: e.fontSize,
554
+ pathLen: s,
555
+ nx: this.w ? c.x / this.w : .5,
556
+ ny: this.h ? c.y / this.h : .5
557
+ }, n), p = o + f.dLen, g = m(p), _ = m(p - u), x = m(p + u), S = Math.atan2(x.y - _.y, x.x - _.x) * 180 / Math.PI;
558
+ i[t].setAttribute("transform", `translate(${g.x.toFixed(2)} ${g.y.toFixed(2)}) rotate(${(S + f.dRot).toFixed(2)}) translate(0 ${(-f.dNormal).toFixed(2)}) scale(${f.scale.toFixed(3)})${h}`), i[t].setAttribute("opacity", f.opacity);
559
+ }
560
+ }
561
+ _placeMorphArray(e, t, n, r, i, a, o = t.morphEls) {
562
+ let s = t.morphCenters, c = t.morphTotal;
563
+ if (!s || !o) return;
564
+ let l = s.length;
565
+ if (!l) return;
566
+ let u = Math.min(this.w, this.h) * .08, d = (this.w - 2 * u) / a, f = (this.h - 2 * u) / i, p = e.italic ? " skewX(-12)" : "", m = _(e.stagger || 0), h = i * a;
567
+ for (let t = 0; t < h; t++) {
568
+ let i = Math.floor(t / a), g = u + t % a * d + d / 2, _ = u + i * f + f / 2, v = g - c / 2, y = m ? V(r + m * t / h) : r;
569
+ for (let r = 0; r < l; r++) {
570
+ let i = t * l + r, a = o[i];
571
+ if (!a) continue;
572
+ let c = v + s[r], u = this._anim(e, {
573
+ i,
574
+ n: h * l,
575
+ u: y,
576
+ sizePx: e.fontSize,
577
+ pathLen: 0,
578
+ nx: this.w ? c / this.w : .5,
579
+ ny: this.h ? _ / this.h : .5
580
+ }, n), d = _ - u.dNormal;
581
+ a.setAttribute("transform", `translate(${c.toFixed(2)} ${d.toFixed(2)}) rotate(${u.dRot.toFixed(2)}) scale(${u.scale.toFixed(3)})${p}`), a.setAttribute("opacity", u.opacity);
582
+ }
583
+ }
584
+ }
585
+ }, U = (e, t = 0) => e?.instances?.[t] ?? null, W = (e, t, n = 0) => ({
586
+ ...e,
587
+ instances: (e.instances ?? []).map((e, r) => r === n ? {
588
+ ...e,
589
+ ...t
590
+ } : e)
591
+ }), Le = (e, t) => ({
592
+ ...e,
593
+ instances: (e.instances ?? []).map((e, n, r) => ({
594
+ ...e,
595
+ ...t(e, n, r.length)
596
+ }))
597
+ }), G = (e, t, n = 0) => W(e, { path: {
598
+ ...U(e, n)?.path ?? {},
599
+ ...t
600
+ } }, n), K = (e, t, n = 0) => W(e, { motion: {
601
+ ...U(e, n)?.motion ?? {},
602
+ ...t
603
+ } }, n), q = (e, t = 0) => U(e, t)?.path?.type ?? "line", J = (e, t = 0) => U(e, t)?.motion?.mode ?? "none", Re = (e, t = 0) => ![
604
+ "radial",
605
+ "rings",
606
+ "array"
607
+ ].includes(q(e, t)), ze = [
608
+ {
609
+ value: "line",
610
+ label: "Line"
611
+ },
612
+ {
613
+ value: "arc",
614
+ label: "Arc"
615
+ },
616
+ {
617
+ value: "sine",
618
+ label: "Sine"
619
+ },
620
+ {
621
+ value: "zigzag",
622
+ label: "Zigzag"
623
+ },
624
+ {
625
+ value: "spiral",
626
+ label: "Spiral"
627
+ },
628
+ {
629
+ value: "circle",
630
+ label: "Circle"
631
+ },
632
+ {
633
+ value: "ellipse",
634
+ label: "Ellipse"
635
+ },
636
+ {
637
+ value: "custom",
638
+ label: "Custom"
639
+ },
640
+ {
641
+ value: "array",
642
+ label: "Array"
643
+ },
644
+ {
645
+ value: "radial",
646
+ label: "Radial"
647
+ },
648
+ {
649
+ value: "rings",
650
+ label: "Rings"
651
+ }
652
+ ], Y = (e, t = 0) => U(e, t)?.morph ?? {}, X = (e, t, n = 0) => W(e, { morph: {
653
+ ...U(e, n)?.morph ?? {},
654
+ ...t
655
+ } }, n), Be = (e, t, n, r = 0) => X(e, { vf2: {
656
+ ...Y(e, r).vf2 ?? {},
657
+ [t]: n
658
+ } }, r), Ve = (e, t = 0) => !["radial", "rings"].includes(q(e, t)), Z = (e, t = 0) => Ve(e, t) && !!Y(e, t).on, Q = (e, t = 0) => Y(e, t).mode ?? "morph", He = (e, t = 0) => Z(e, t) && ["morph", "fade"].includes(Q(e, t)), $ = (e, t, n = 0) => x(U(e, n)?.font).axes.find((e) => e.tag === t), Ue = (e, t, n, r = 0) => {
659
+ let i = $(e, t, r), a = i ? Math.min(i.max, Math.max(i.min, n)) : n;
660
+ return Be(e, t, Math.round(a), r);
661
+ }, We = (e, t, n, r = 0) => {
662
+ let i = $(e, t, r), a = i ? Math.min(i.max, Math.max(i.min, n)) : n;
663
+ return W(e, { vf: {
664
+ ...U(e, r)?.vf ?? {},
665
+ [t]: Math.round(a)
666
+ } }, r);
667
+ }, Ge = (e) => ({
668
+ key: `vf${e[0].toUpperCase()}${e.slice(1)}`,
669
+ label: r[e] || e,
670
+ tab: "style",
671
+ section: "Axes",
672
+ type: "range",
673
+ step: 1,
674
+ min: (t, n = 0) => $(t, e, n)?.min ?? 0,
675
+ max: (t, n = 0) => $(t, e, n)?.max ?? 1e3,
676
+ when: (t, n = 0) => !!$(t, e, n),
677
+ get: (t, n = 0) => U(t, n)?.vf?.[e] ?? $(t, e, n)?.def ?? 0,
678
+ set: (t, n, r = 0) => We(t, e, n, r)
679
+ }), Ke = (e, t = 0) => Z(e, t) && Q(e, t) === "morph" && (Y(e, t).curve ?? "flat") === "custom", qe = (e, t) => ({
680
+ key: `morphC${e}${t}`,
681
+ label: `P${e} ${t.toUpperCase()}`,
682
+ tab: "style",
683
+ section: "Morph",
684
+ type: "range",
685
+ min: 0,
686
+ max: 1,
687
+ step: .01,
688
+ noRandom: !0,
689
+ when: Ke,
690
+ get: (n, r = 0) => Y(n, r)[`cp${e}`]?.[t] ?? (e === 1 ? .33 : .66),
691
+ set: (n, r, i = 0) => X(n, { [`cp${e}`]: {
692
+ ...Y(n, i)[`cp${e}`] ?? {
693
+ x: e === 1 ? .33 : .66,
694
+ y: e === 1 ? .33 : .66
695
+ },
696
+ [t]: r
697
+ } }, i)
698
+ }), Je = [
699
+ {
700
+ key: "bg",
701
+ label: "Background",
702
+ tab: "style",
703
+ type: "color",
704
+ noRandom: !0,
705
+ get: (e) => e.bg,
706
+ set: (e, t) => ({
707
+ ...e,
708
+ bg: t
709
+ })
710
+ },
711
+ {
712
+ key: "fill",
713
+ label: "Fill",
714
+ tab: "style",
715
+ type: "color",
716
+ noRandom: !0,
717
+ get: (e, t = 0) => U(e, t)?.fill,
718
+ set: (e, t, n = 0) => W(e, { fill: t }, n)
719
+ },
720
+ {
721
+ key: "font",
722
+ label: "Font",
723
+ tab: "style",
724
+ type: "select",
725
+ options: d,
726
+ noRandom: !0,
727
+ get: (e, t = 0) => U(e, t)?.font,
728
+ set: (e, t, n = 0) => W(e, {
729
+ font: t,
730
+ vf: oe(t, U(e, n)?.vf)
731
+ }, n)
732
+ },
733
+ {
734
+ key: "italic",
735
+ label: "Italic",
736
+ tab: "style",
737
+ type: "select",
738
+ noRandom: !0,
739
+ options: [{
740
+ value: "off",
741
+ label: "Off"
742
+ }, {
743
+ value: "on",
744
+ label: "On"
745
+ }],
746
+ get: (e, t = 0) => U(e, t)?.italic ? "on" : "off",
747
+ set: (e, t, n = 0) => W(e, { italic: t === "on" }, n)
748
+ },
749
+ {
750
+ key: "case",
751
+ label: "Case",
752
+ tab: "style",
753
+ type: "select",
754
+ noRandom: !0,
755
+ options: [
756
+ {
757
+ value: "none",
758
+ label: "Aa"
759
+ },
760
+ {
761
+ value: "upper",
762
+ label: "AA"
763
+ },
764
+ {
765
+ value: "lower",
766
+ label: "aa"
767
+ },
768
+ {
769
+ value: "title",
770
+ label: "Tt"
771
+ }
772
+ ],
773
+ get: (e, t = 0) => U(e, t)?.case ?? "none",
774
+ set: (e, t, n = 0) => W(e, { case: t }, n)
775
+ },
776
+ {
777
+ key: "fontSize",
778
+ label: "Font size",
779
+ tab: "style",
780
+ type: "range",
781
+ min: 8,
782
+ max: 1200,
783
+ step: 1,
784
+ rMin: 36,
785
+ rMax: 150,
786
+ get: (e, t = 0) => U(e, t)?.fontSize ?? 26,
787
+ set: (e, t, n = 0) => W(e, { fontSize: Math.round(t) }, n)
788
+ },
789
+ {
790
+ key: "letterSpacing",
791
+ label: "Letter spacing",
792
+ tab: "style",
793
+ type: "range",
794
+ min: -10,
795
+ max: 400,
796
+ step: .5,
797
+ rMin: 0,
798
+ rMax: 12,
799
+ get: (e, t = 0) => U(e, t)?.letterSpacing ?? 0,
800
+ set: (e, t, n = 0) => W(e, { letterSpacing: t }, n)
801
+ },
802
+ {
803
+ key: "align",
804
+ label: "Align",
805
+ tab: "style",
806
+ type: "select",
807
+ noRandom: !0,
808
+ when: Re,
809
+ options: [
810
+ {
811
+ value: "start",
812
+ label: "Start"
813
+ },
814
+ {
815
+ value: "center",
816
+ label: "Center"
817
+ },
818
+ {
819
+ value: "end",
820
+ label: "End"
821
+ }
822
+ ],
823
+ get: (e, t = 0) => U(e, t)?.align ?? "center",
824
+ set: (e, t, n = 0) => W(e, { align: t }, n)
825
+ },
826
+ {
827
+ key: "multiply",
828
+ label: "Copies",
829
+ tab: "style",
830
+ type: "range",
831
+ min: 1,
832
+ max: 24,
833
+ step: 1,
834
+ noRandom: !0,
835
+ when: Re,
836
+ get: (e, t = 0) => U(e, t)?.multiply ?? 1,
837
+ set: (e, t, n = 0) => W(e, { multiply: Math.round(t) }, n)
838
+ },
839
+ Ge("wdth"),
840
+ Ge("wght"),
841
+ {
842
+ key: "arrangement",
843
+ label: "Arrangement",
844
+ tab: "style",
845
+ section: "Arrangement",
846
+ type: "select",
847
+ noRandom: !0,
848
+ options: ze,
849
+ get: q,
850
+ set: (e, t, n = 0) => G(e, { type: t }, n)
851
+ },
852
+ {
853
+ key: "spokes",
854
+ label: "Spokes",
855
+ tab: "style",
856
+ section: "Arrangement",
857
+ type: "range",
858
+ min: 2,
859
+ max: 32,
860
+ step: 1,
861
+ rMin: 6,
862
+ rMax: 28,
863
+ when: (e, t = 0) => q(e, t) === "radial",
864
+ get: (e, t = 0) => U(e, t)?.path?.count ?? 12,
865
+ set: (e, t, n = 0) => G(e, { count: Math.round(t) }, n)
866
+ },
867
+ {
868
+ key: "rings",
869
+ label: "Rings",
870
+ tab: "style",
871
+ section: "Arrangement",
872
+ type: "range",
873
+ min: 2,
874
+ max: 24,
875
+ step: 1,
876
+ rMin: 4,
877
+ rMax: 16,
878
+ when: (e, t = 0) => q(e, t) === "rings",
879
+ get: (e, t = 0) => U(e, t)?.path?.count ?? 12,
880
+ set: (e, t, n = 0) => G(e, { count: Math.round(t) }, n)
881
+ },
882
+ {
883
+ key: "inner",
884
+ label: "Inner radius",
885
+ tab: "style",
886
+ section: "Arrangement",
887
+ type: "range",
888
+ min: 0,
889
+ max: .9,
890
+ step: .01,
891
+ rMin: .04,
892
+ rMax: .4,
893
+ when: (e, t = 0) => q(e, t) === "radial" || q(e, t) === "rings",
894
+ get: (e, t = 0) => U(e, t)?.path?.inner ?? .12,
895
+ set: (e, t, n = 0) => G(e, { inner: t }, n)
896
+ },
897
+ {
898
+ key: "ringRadius",
899
+ label: "Radius",
900
+ tab: "style",
901
+ section: "Arrangement",
902
+ type: "range",
903
+ min: .1,
904
+ max: 1,
905
+ step: .01,
906
+ rMin: .6,
907
+ rMax: 1,
908
+ when: (e, t = 0) => q(e, t) === "rings",
909
+ get: (e, t = 0) => U(e, t)?.path?.radius ?? .92,
910
+ set: (e, t, n = 0) => G(e, { radius: t }, n)
911
+ },
912
+ {
913
+ key: "twist",
914
+ label: "Twist",
915
+ tab: "style",
916
+ section: "Arrangement",
917
+ type: "range",
918
+ min: 0,
919
+ max: 2,
920
+ step: .05,
921
+ rMin: 0,
922
+ rMax: 1.5,
923
+ when: (e, t = 0) => q(e, t) === "rings",
924
+ get: (e, t = 0) => U(e, t)?.path?.twist ?? .5,
925
+ set: (e, t, n = 0) => G(e, { twist: t }, n)
926
+ },
927
+ {
928
+ key: "grow",
929
+ label: "Grow",
930
+ tab: "style",
931
+ section: "Arrangement",
932
+ type: "range",
933
+ min: 0,
934
+ max: 2,
935
+ step: .05,
936
+ rMin: 0,
937
+ rMax: 1.5,
938
+ when: (e, t = 0) => q(e, t) === "rings",
939
+ get: (e, t = 0) => U(e, t)?.path?.grow ?? .6,
940
+ set: (e, t, n = 0) => G(e, { grow: t }, n)
941
+ },
942
+ {
943
+ key: "pathRadius",
944
+ label: "Radius",
945
+ tab: "style",
946
+ section: "Arrangement",
947
+ type: "range",
948
+ min: .2,
949
+ max: 1,
950
+ step: .01,
951
+ rMin: .5,
952
+ rMax: 1,
953
+ when: (e, t = 0) => [
954
+ "circle",
955
+ "ellipse",
956
+ "spiral"
957
+ ].includes(q(e, t)),
958
+ get: (e, t = 0) => U(e, t)?.path?.radius ?? .72,
959
+ set: (e, t, n = 0) => G(e, { radius: t }, n)
960
+ },
961
+ {
962
+ key: "turns",
963
+ label: "Turns",
964
+ tab: "style",
965
+ section: "Arrangement",
966
+ type: "range",
967
+ min: 1,
968
+ max: 6,
969
+ step: 1,
970
+ rMin: 2,
971
+ rMax: 5,
972
+ when: (e, t = 0) => q(e, t) === "spiral",
973
+ get: (e, t = 0) => U(e, t)?.path?.turns ?? 3,
974
+ set: (e, t, n = 0) => G(e, { turns: Math.round(t) }, n)
975
+ },
976
+ {
977
+ key: "amp",
978
+ label: "Amplitude",
979
+ tab: "style",
980
+ section: "Arrangement",
981
+ type: "range",
982
+ min: 0,
983
+ max: 1,
984
+ step: .05,
985
+ rMin: .2,
986
+ rMax: .7,
987
+ when: (e, t = 0) => [
988
+ "arc",
989
+ "sine",
990
+ "zigzag"
991
+ ].includes(q(e, t)),
992
+ get: (e, t = 0) => U(e, t)?.path?.amp ?? .4,
993
+ set: (e, t, n = 0) => G(e, { amp: t }, n)
994
+ },
995
+ {
996
+ key: "freq",
997
+ label: "Frequency",
998
+ tab: "style",
999
+ section: "Arrangement",
1000
+ type: "range",
1001
+ min: 1,
1002
+ max: 6,
1003
+ step: 1,
1004
+ rMin: 1,
1005
+ rMax: 4,
1006
+ when: (e, t = 0) => ["sine", "zigzag"].includes(q(e, t)),
1007
+ get: (e, t = 0) => U(e, t)?.path?.freq ?? 2,
1008
+ set: (e, t, n = 0) => G(e, { freq: Math.round(t) }, n)
1009
+ },
1010
+ {
1011
+ key: "rows",
1012
+ label: "Rows",
1013
+ tab: "style",
1014
+ section: "Arrangement",
1015
+ type: "range",
1016
+ min: 1,
1017
+ max: 6,
1018
+ step: 1,
1019
+ rMin: 2,
1020
+ rMax: 4,
1021
+ when: (e, t = 0) => q(e, t) === "array",
1022
+ get: (e, t = 0) => U(e, t)?.path?.rows ?? 2,
1023
+ set: (e, t, n = 0) => G(e, { rows: Math.round(t) }, n)
1024
+ },
1025
+ {
1026
+ key: "cols",
1027
+ label: "Columns",
1028
+ tab: "style",
1029
+ section: "Arrangement",
1030
+ type: "range",
1031
+ min: 1,
1032
+ max: 8,
1033
+ step: 1,
1034
+ rMin: 2,
1035
+ rMax: 6,
1036
+ when: (e, t = 0) => q(e, t) === "array",
1037
+ get: (e, t = 0) => U(e, t)?.path?.cols ?? 3,
1038
+ set: (e, t, n = 0) => G(e, { cols: Math.round(t) }, n)
1039
+ },
1040
+ {
1041
+ key: "flow",
1042
+ label: "Paragraph",
1043
+ tab: "style",
1044
+ section: "Arrangement",
1045
+ type: "select",
1046
+ noRandom: !0,
1047
+ when: Re,
1048
+ options: [{
1049
+ value: "flow",
1050
+ label: "Flow"
1051
+ }, {
1052
+ value: "contain",
1053
+ label: "Contain"
1054
+ }],
1055
+ get: (e, t = 0) => U(e, t)?.flow ?? "flow",
1056
+ set: (e, t, n = 0) => W(e, { flow: t }, n)
1057
+ },
1058
+ {
1059
+ key: "showPath",
1060
+ label: "Show path",
1061
+ tab: "style",
1062
+ section: "Arrangement",
1063
+ type: "select",
1064
+ noRandom: !0,
1065
+ when: Re,
1066
+ options: [{
1067
+ value: "off",
1068
+ label: "Off"
1069
+ }, {
1070
+ value: "on",
1071
+ label: "On"
1072
+ }],
1073
+ get: (e, t = 0) => U(e, t)?.showPath ? "on" : "off",
1074
+ set: (e, t, n = 0) => W(e, { showPath: t === "on" }, n)
1075
+ },
1076
+ {
1077
+ key: "offsetX",
1078
+ label: "X",
1079
+ tab: "style",
1080
+ section: "Position",
1081
+ type: "range",
1082
+ min: -1,
1083
+ max: 1,
1084
+ step: .01,
1085
+ noRandom: !0,
1086
+ get: (e, t = 0) => U(e, t)?.offset?.x ?? 0,
1087
+ set: (e, t, n = 0) => W(e, { offset: {
1088
+ ...U(e, n)?.offset ?? {},
1089
+ x: t
1090
+ } }, n)
1091
+ },
1092
+ {
1093
+ key: "offsetY",
1094
+ label: "Y",
1095
+ tab: "style",
1096
+ section: "Position",
1097
+ type: "range",
1098
+ min: -1,
1099
+ max: 1,
1100
+ step: .01,
1101
+ noRandom: !0,
1102
+ get: (e, t = 0) => U(e, t)?.offset?.y ?? 0,
1103
+ set: (e, t, n = 0) => W(e, { offset: {
1104
+ ...U(e, n)?.offset ?? {},
1105
+ y: t
1106
+ } }, n)
1107
+ },
1108
+ {
1109
+ key: "morphOn",
1110
+ label: "Morph outlines",
1111
+ tab: "style",
1112
+ section: "Morph",
1113
+ type: "select",
1114
+ noRandom: !0,
1115
+ when: Ve,
1116
+ options: [{
1117
+ value: "off",
1118
+ label: "Off"
1119
+ }, {
1120
+ value: "on",
1121
+ label: "On"
1122
+ }],
1123
+ get: (e, t = 0) => Y(e, t).on ? "on" : "off",
1124
+ set: (e, t, n = 0) => X(e, { on: t === "on" }, n)
1125
+ },
1126
+ {
1127
+ key: "morphMode",
1128
+ label: "Mode",
1129
+ tab: "style",
1130
+ section: "Morph",
1131
+ type: "select",
1132
+ when: Z,
1133
+ options: v,
1134
+ get: Q,
1135
+ set: (e, t, n = 0) => X(e, { mode: t }, n)
1136
+ },
1137
+ {
1138
+ key: "morphFace2",
1139
+ label: "Cut B face",
1140
+ tab: "style",
1141
+ section: "Morph",
1142
+ type: "select",
1143
+ noRandom: !0,
1144
+ when: He,
1145
+ options: (e, t = 0) => [{
1146
+ value: "",
1147
+ label: "Off"
1148
+ }, ...d.filter((n) => n.value !== U(e, t)?.font)],
1149
+ get: (e, t = 0) => Y(e, t).face2 ?? "",
1150
+ set: (e, t, n = 0) => X(e, { face2: t }, n)
1151
+ },
1152
+ {
1153
+ key: "morphVf2Wdth",
1154
+ label: "Cut B · Width",
1155
+ tab: "style",
1156
+ section: "Morph",
1157
+ type: "range",
1158
+ min: 64,
1159
+ max: 172,
1160
+ step: 1,
1161
+ when: (e, t = 0) => He(e, t) && !Y(e, t).face2 && !!$(e, "wdth", t),
1162
+ get: (e, t = 0) => Y(e, t).vf2?.wdth ?? $(e, "wdth", t)?.max ?? 172,
1163
+ set: (e, t, n = 0) => Ue(e, "wdth", t, n)
1164
+ },
1165
+ {
1166
+ key: "morphVf2Wght",
1167
+ label: "Cut B · Weight",
1168
+ tab: "style",
1169
+ section: "Morph",
1170
+ type: "range",
1171
+ min: 100,
1172
+ max: 900,
1173
+ step: 1,
1174
+ when: (e, t = 0) => He(e, t) && !Y(e, t).face2 && !!$(e, "wght", t),
1175
+ get: (e, t = 0) => Y(e, t).vf2?.wght ?? $(e, "wght", t)?.max ?? 900,
1176
+ set: (e, t, n = 0) => Ue(e, "wght", t, n)
1177
+ },
1178
+ {
1179
+ key: "morphCurve",
1180
+ label: "Curve",
1181
+ tab: "style",
1182
+ section: "Morph",
1183
+ type: "select",
1184
+ when: (e, t = 0) => Z(e, t) && Q(e, t) === "morph",
1185
+ options: c,
1186
+ get: (e, t = 0) => Y(e, t).curve ?? "flat",
1187
+ set: (e, t, n = 0) => X(e, { curve: t }, n)
1188
+ },
1189
+ qe(1, "x"),
1190
+ qe(1, "y"),
1191
+ qe(2, "x"),
1192
+ qe(2, "y"),
1193
+ {
1194
+ key: "morphBlend",
1195
+ label: "Blend",
1196
+ tab: "style",
1197
+ section: "Morph",
1198
+ type: "range",
1199
+ min: 0,
1200
+ max: 1,
1201
+ step: .01,
1202
+ when: (e, t = 0) => Z(e, t) && Q(e, t) !== "random",
1203
+ get: (e, t = 0) => Y(e, t).blend ?? .5,
1204
+ set: (e, t, n = 0) => X(e, { blend: t }, n)
1205
+ },
1206
+ {
1207
+ key: "morphSeed",
1208
+ label: "Seed",
1209
+ tab: "style",
1210
+ section: "Morph",
1211
+ type: "range",
1212
+ min: 0,
1213
+ max: 1,
1214
+ step: .01,
1215
+ when: (e, t = 0) => Z(e, t) && Q(e, t) === "random",
1216
+ get: (e, t = 0) => Y(e, t).blend ?? .5,
1217
+ set: (e, t, n = 0) => X(e, { blend: t }, n)
1218
+ },
1219
+ {
1220
+ key: "mode",
1221
+ label: "Motion",
1222
+ tab: "anim",
1223
+ type: "select",
1224
+ noRandom: !0,
1225
+ options: [
1226
+ {
1227
+ value: "none",
1228
+ label: "None"
1229
+ },
1230
+ {
1231
+ value: "march",
1232
+ label: "March"
1233
+ },
1234
+ {
1235
+ value: "orbit",
1236
+ label: "Orbit"
1237
+ },
1238
+ {
1239
+ value: "vfwave",
1240
+ label: "Axis wave"
1241
+ },
1242
+ {
1243
+ value: "glyphwave",
1244
+ label: "Glyph wave"
1245
+ },
1246
+ {
1247
+ value: "cascade",
1248
+ label: "Cascade"
1249
+ },
1250
+ {
1251
+ value: "sweep",
1252
+ label: "Sweep"
1253
+ },
1254
+ {
1255
+ value: "sweepWeight",
1256
+ label: "Sweep weight"
1257
+ },
1258
+ {
1259
+ value: "sweepShift",
1260
+ label: "Sweep shift"
1261
+ }
1262
+ ],
1263
+ get: J,
1264
+ set: (e, t, n = 0) => K(e, { mode: t }, n)
1265
+ },
1266
+ {
1267
+ key: "cycles",
1268
+ label: "Cycles",
1269
+ tab: "anim",
1270
+ type: "range",
1271
+ min: 1,
1272
+ max: 4,
1273
+ step: 1,
1274
+ rMin: 1,
1275
+ rMax: 3,
1276
+ when: (e, t = 0) => J(e, t) !== "none",
1277
+ get: (e, t = 0) => U(e, t)?.motion?.cycles ?? 1,
1278
+ set: (e, t, n = 0) => K(e, { cycles: Math.round(t) }, n)
1279
+ },
1280
+ {
1281
+ key: "motionAmp",
1282
+ label: "Amount",
1283
+ tab: "anim",
1284
+ type: "range",
1285
+ min: .05,
1286
+ max: 1,
1287
+ step: .05,
1288
+ rMin: .15,
1289
+ rMax: .6,
1290
+ when: (e, t = 0) => [
1291
+ "glyphwave",
1292
+ "sweep",
1293
+ "sweepWeight",
1294
+ "sweepShift"
1295
+ ].includes(J(e, t)),
1296
+ get: (e, t = 0) => U(e, t)?.motion?.amp ?? .3,
1297
+ set: (e, t, n = 0) => K(e, { amp: t }, n)
1298
+ },
1299
+ {
1300
+ key: "motionPhase",
1301
+ label: "Glyph phase",
1302
+ tab: "anim",
1303
+ type: "range",
1304
+ min: 0,
1305
+ max: 1.5,
1306
+ step: .05,
1307
+ rMin: .3,
1308
+ rMax: 1,
1309
+ when: (e, t = 0) => [
1310
+ "vfwave",
1311
+ "glyphwave",
1312
+ "cascade"
1313
+ ].includes(J(e, t)),
1314
+ get: (e, t = 0) => U(e, t)?.motion?.phase ?? .5,
1315
+ set: (e, t, n = 0) => K(e, { phase: t }, n)
1316
+ },
1317
+ {
1318
+ key: "axis",
1319
+ label: "Axis",
1320
+ tab: "anim",
1321
+ type: "select",
1322
+ when: (e, t = 0) => ["vfwave", "sweepWeight"].includes(J(e, t)) && x(U(e, t)?.font).axes.length > 1,
1323
+ options: (e, t = 0) => x(U(e, t)?.font).axes.map((e) => ({
1324
+ value: e.tag,
1325
+ label: r[e.tag] || e.tag
1326
+ })),
1327
+ get: (e, t = 0) => U(e, t)?.motion?.axis ?? "wght",
1328
+ set: (e, t, n = 0) => K(e, { axis: t }, n)
1329
+ },
1330
+ {
1331
+ key: "field",
1332
+ label: "Field",
1333
+ tab: "anim",
1334
+ type: "select",
1335
+ when: (e, t = 0) => [
1336
+ "sweep",
1337
+ "sweepWeight",
1338
+ "sweepShift"
1339
+ ].includes(J(e, t)),
1340
+ options: [
1341
+ {
1342
+ value: "x",
1343
+ label: "Horizontal"
1344
+ },
1345
+ {
1346
+ value: "y",
1347
+ label: "Vertical"
1348
+ },
1349
+ {
1350
+ value: "diagonal",
1351
+ label: "Diagonal"
1352
+ },
1353
+ {
1354
+ value: "radial",
1355
+ label: "Radial"
1356
+ },
1357
+ {
1358
+ value: "angular",
1359
+ label: "Angular"
1360
+ },
1361
+ {
1362
+ value: "wave",
1363
+ label: "Wave"
1364
+ }
1365
+ ],
1366
+ get: (e, t = 0) => U(e, t)?.motion?.field ?? "x",
1367
+ set: (e, t, n = 0) => K(e, { field: t }, n)
1368
+ },
1369
+ {
1370
+ key: "stagger",
1371
+ label: "Stagger",
1372
+ tab: "anim",
1373
+ type: "range",
1374
+ min: 0,
1375
+ max: 1,
1376
+ step: .01,
1377
+ get: (e) => U(e)?.stagger ?? 0,
1378
+ set: (e, t) => Le(e, (e, n, r) => ({
1379
+ stagger: t,
1380
+ phase: r > 1 ? n / r * t : 0
1381
+ }))
1382
+ },
1383
+ {
1384
+ key: "spin",
1385
+ label: "Spin",
1386
+ tab: "anim",
1387
+ type: "range",
1388
+ min: 0,
1389
+ max: 4,
1390
+ step: 1,
1391
+ rMin: 0,
1392
+ rMax: 3,
1393
+ when: (e, t = 0) => q(e, t) === "radial" || q(e, t) === "rings",
1394
+ get: (e, t = 0) => U(e, t)?.path?.spin ?? 1,
1395
+ set: (e, t, n = 0) => G(e, { spin: Math.round(t) }, n)
1396
+ }
1397
+ ], Ye = (e, t, n = 0) => typeof e.options == "function" ? e.options(t, n) : e.options ?? [], Xe = (e, t, n = 0) => ({
1398
+ min: typeof e.min == "function" ? e.min(t, n) : e.min,
1399
+ max: typeof e.max == "function" ? e.max(t, n) : e.max
1400
+ });
1401
+ function Ze(e, t = 0, n = Math.random) {
1402
+ let r = e;
1403
+ for (let e of Je) if (!(e.noRandom || e.type === "color") && !(e.when && !e.when(r, t))) {
1404
+ if (e.type === "range") {
1405
+ let i = Xe(e, r, t), a = e.rMin ?? i.min, o = e.rMax ?? i.max, s = e.step ?? 1, c = a + n() * (o - a);
1406
+ r = e.set(r, Math.min(o, Math.max(a, Number((Math.round(c / s) * s).toFixed(4)))), t);
1407
+ } else if (e.type === "select") {
1408
+ let i = Ye(e, r, t);
1409
+ i.length && (r = e.set(r, i[Math.floor(n() * i.length)].value, t));
1410
+ }
1411
+ }
1412
+ return r;
1413
+ }
1414
+ //#endregion
1415
+ //#region src/editor/compose/inspectors/KineticPanel.jsx
1416
+ var Qe = {
1417
+ key: "morphBlend",
1418
+ label: "Morph blend",
1419
+ type: "range",
1420
+ min: 0,
1421
+ max: 1,
1422
+ step: .01,
1423
+ default: .5
1424
+ }, $e = new Set([
1425
+ "mode",
1426
+ "cycles",
1427
+ "motionAmp",
1428
+ "motionPhase",
1429
+ "axis",
1430
+ "field"
1431
+ ]), et = {
1432
+ mode: "glyphwave",
1433
+ cycles: 1,
1434
+ phase: .5,
1435
+ amp: .3,
1436
+ axis: "wght",
1437
+ field: "x"
1438
+ }, tt = new Set([
1439
+ "align",
1440
+ "italic",
1441
+ "fill",
1442
+ "fontSize",
1443
+ "vfWght",
1444
+ "offsetX",
1445
+ "offsetY"
1446
+ ]), nt = {
1447
+ lineHeight: 0,
1448
+ display: "inline-flex",
1449
+ alignItems: "center",
1450
+ justifyContent: "center"
1451
+ }, rt = (e, t) => e ? String.fromCharCode(97 + t.indexOf(e) % 26) : null;
1452
+ function it({ layer: r, setProp: a, updateLayer: s, palette: c, renderAnimate: l, tab: u, tabStrip: d, picker: p = !0 }) {
1453
+ let m = i(), h = r.comp ?? {
1454
+ bg: "#0b0d12",
1455
+ instances: []
1456
+ }, _ = h.instances ?? [], [v, y] = I(0), b = Math.min(v, Math.max(0, _.length - 1)), x = (e) => {
1457
+ y(e), window.dispatchEvent(new CustomEvent("kol:kinetic-element", { detail: {
1458
+ id: r.id,
1459
+ index: e,
1460
+ from: "panel"
1461
+ } }));
1462
+ };
1463
+ xe(() => {
1464
+ let e = (e) => {
1465
+ e.detail?.id === r.id && e.detail.from === "canvas" && y(e.detail.index);
1466
+ };
1467
+ return window.addEventListener("kol:kinetic-element", e), () => window.removeEventListener("kol:kinetic-element", e);
1468
+ }, [r.id]);
1469
+ let [S, C] = I([]), te = (e) => C((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]), ne = (e) => {
1470
+ let t = _[e]?.group;
1471
+ return t ? _.reduce((e, n, r) => n.group === t ? [...e, r] : e, []) : [e];
1472
+ }, [w, T] = I(0), E = _[b]?.motions ?? [], D = Math.min(w, E.length), O = (e) => ({
1473
+ ...e,
1474
+ instances: (e.instances ?? []).map((e, t) => t === b ? {
1475
+ ...e,
1476
+ motion: { ...e.motions?.[D - 1] ?? {} }
1477
+ } : e)
1478
+ }), ie = (e) => $e.has(e.key) && D > 0 ? O(h) : h, ae = (e) => {
1479
+ e && (s(r.id, {
1480
+ presetId: e.id,
1481
+ presetLabel: e.label,
1482
+ comp: re(e)
1483
+ }), y(0), T(0));
1484
+ }, k = (e) => a("comp", e), A = (e) => s(r.id, { comp: {
1485
+ ...h,
1486
+ instances: e
1487
+ } }), j = (e, t) => k({
1488
+ ...h,
1489
+ instances: _.map((n, r) => r === e ? {
1490
+ ...n,
1491
+ ...t
1492
+ } : n)
1493
+ }), oe = () => {
1494
+ if (S.length < 2) return;
1495
+ let e = new Set(_.map((e) => e.group).filter(Boolean)), t = 1;
1496
+ for (; e.has(`g${t}`);) t++;
1497
+ A(_.map((e) => S.includes(e.id) ? {
1498
+ ...e,
1499
+ group: `g${t}`
1500
+ } : e)), C([]);
1501
+ }, se = () => {
1502
+ S.length && (A(_.map((e) => S.includes(e.id) ? {
1503
+ ...e,
1504
+ group: null
1505
+ } : e)), C([]));
1506
+ }, ce = (e, t) => {
1507
+ if ($e.has(e.key) && D > 0) {
1508
+ let n = e.set(O(h), t, b).instances?.[b]?.motion ?? {};
1509
+ j(b, { motions: E.map((e, t) => t === D - 1 ? n : e) });
1510
+ return;
1511
+ }
1512
+ let n = ne(b);
1513
+ if (n.length > 1 && tt.has(e.key)) {
1514
+ let r = h;
1515
+ if (e.key === "fontSize") {
1516
+ let i = Number(e.get(h, b)) || 1, a = t / i;
1517
+ for (let t of n) {
1518
+ let n = Number(e.get(h, t)) || i;
1519
+ r = e.set(r, Math.max(8, Math.min(1200, Math.round(n * a))), t);
1520
+ }
1521
+ } else if (e.key === "offsetX" || e.key === "offsetY") {
1522
+ let i = t - (Number(e.get(h, b)) || 0);
1523
+ for (let t of n) r = e.set(r, (Number(e.get(h, t)) || 0) + i, t);
1524
+ } else for (let i of n) r = e.set(r, t, i);
1525
+ k(r);
1526
+ return;
1527
+ }
1528
+ k(e.set(h, t, b));
1529
+ }, ue = o(r), de = () => {
1530
+ let e = ue.take();
1531
+ s(r.id, {
1532
+ comp: Ze(h, b, g(e >>> 0)),
1533
+ _rollSeed: e
1534
+ });
1535
+ }, fe = () => {
1536
+ let e = ue.take(), t = g(e >>> 0), n = h;
1537
+ _.forEach((e, r) => {
1538
+ n = Ze(n, r, t);
1539
+ }), s(r.id, {
1540
+ comp: n,
1541
+ _rollSeed: e
1542
+ });
1543
+ }, pe = (e, t) => {
1544
+ let i = n(e, t);
1545
+ s(r.id, {
1546
+ themeId: e,
1547
+ themeInvert: t,
1548
+ comp: {
1549
+ ...h,
1550
+ bg: i.bg,
1551
+ instances: _.map((e) => ({
1552
+ ...e,
1553
+ fill: i.fg
1554
+ }))
1555
+ }
1556
+ });
1557
+ }, me = (e) => k({
1558
+ ...h,
1559
+ instances: _.map((t) => ({
1560
+ ...t,
1561
+ fill: e
1562
+ }))
1563
+ }), ge = u === "labs-effect" ? "style" : u, _e = Je.filter((e) => e.tab === ge && (!e.when || e.when(ie(e), b))), ye = _.some((e) => e?.morph?.on), F = _[b];
1564
+ return /* @__PURE__ */ R(we, { children: [
1565
+ p && /* @__PURE__ */ L(at, {
1566
+ layer: r,
1567
+ onPreset: ae
1568
+ }),
1569
+ /* @__PURE__ */ R("div", {
1570
+ className: "flex flex-col gap-1",
1571
+ children: [
1572
+ /* @__PURE__ */ L("span", {
1573
+ className: "kol-helper-10 text-meta",
1574
+ children: "Elements"
1575
+ }),
1576
+ /* @__PURE__ */ L(ot, {
1577
+ insts: _,
1578
+ idx: b,
1579
+ onSelect: x,
1580
+ onWrite: A,
1581
+ marked: S,
1582
+ onMark: te,
1583
+ onGroup: oe,
1584
+ onUngroup: se
1585
+ }),
1586
+ /* @__PURE__ */ L(P, {
1587
+ label: "Edit elements on the canvas (click to select, drag to move, corners to scale)",
1588
+ children: /* @__PURE__ */ L(M, {
1589
+ "aria-label": "Edit elements on the canvas (click to select, drag to move, corners to scale)",
1590
+ tone: "primary",
1591
+ size: m,
1592
+ className: "w-full",
1593
+ onClick: () => window.dispatchEvent(new CustomEvent("kol:kinetic-edit", { detail: {
1594
+ id: r.id,
1595
+ index: b
1596
+ } })),
1597
+ children: "Edit on canvas"
1598
+ })
1599
+ })
1600
+ ]
1601
+ }),
1602
+ d,
1603
+ (u === "generate" || u === "labs-effect") && /* @__PURE__ */ R(we, { children: [
1604
+ /* @__PURE__ */ L(N, {
1605
+ label: "Text",
1606
+ children: /* @__PURE__ */ L(he, {
1607
+ variant: "filled",
1608
+ size: m,
1609
+ rows: 2,
1610
+ axis: "y",
1611
+ value: _[b]?.text ?? "",
1612
+ onChange: (e) => j(b, { text: e.target.value })
1613
+ })
1614
+ }),
1615
+ /* @__PURE__ */ R("div", {
1616
+ className: "grid grid-cols-2 gap-2",
1617
+ children: [/* @__PURE__ */ L(N, {
1618
+ label: "Theme",
1619
+ children: /* @__PURE__ */ L(le, {
1620
+ variant: "subtle",
1621
+ size: m,
1622
+ className: "w-full",
1623
+ options: t,
1624
+ value: r.themeId ?? "kol",
1625
+ onChange: (e) => pe(e, !!r.themeInvert)
1626
+ })
1627
+ }), /* @__PURE__ */ L(N, {
1628
+ label: "Invert",
1629
+ children: /* @__PURE__ */ L(ve, {
1630
+ options: [{
1631
+ value: "off",
1632
+ label: "Off"
1633
+ }, {
1634
+ value: "on",
1635
+ label: "On"
1636
+ }],
1637
+ viewMode: r.themeInvert ? "on" : "off",
1638
+ onViewChange: (e) => pe(r.themeId ?? "kol", e === "on")
1639
+ })
1640
+ })]
1641
+ }),
1642
+ /* @__PURE__ */ L(f, {
1643
+ label: "Text colour",
1644
+ value: _[0]?.fill,
1645
+ onChange: (t) => me(e(t, c) ?? t),
1646
+ palette: c
1647
+ }),
1648
+ /* @__PURE__ */ R("div", {
1649
+ className: "grid grid-cols-2 gap-2",
1650
+ children: [/* @__PURE__ */ L(M, {
1651
+ tone: "primary",
1652
+ size: m,
1653
+ onClick: de,
1654
+ children: "Randomise"
1655
+ }), /* @__PURE__ */ L(M, {
1656
+ tone: "primary",
1657
+ size: m,
1658
+ onClick: fe,
1659
+ children: "All elements"
1660
+ })]
1661
+ }),
1662
+ /* @__PURE__ */ L(ee, { seed: ue })
1663
+ ] }),
1664
+ u === "anim" && /* @__PURE__ */ L(ct, {
1665
+ motions: E,
1666
+ mIdx: D,
1667
+ onSelect: T,
1668
+ onAdd: () => {
1669
+ A(_.map((e, t) => t === b ? {
1670
+ ...e,
1671
+ motions: [...E, { ...et }]
1672
+ } : e)), T(E.length + 1);
1673
+ },
1674
+ onRemove: () => {
1675
+ D !== 0 && (A(_.map((e, t) => t === b ? {
1676
+ ...e,
1677
+ motions: E.filter((e, t) => t !== D - 1)
1678
+ } : e)), T(D - 1));
1679
+ }
1680
+ }),
1681
+ u !== "generate" && _e.map((e, t) => /* @__PURE__ */ R(be, { children: [
1682
+ e.key === "arrangement" && /* @__PURE__ */ R(we, { children: [/* @__PURE__ */ L("span", {
1683
+ className: "kol-helper-10 text-meta",
1684
+ children: "OpenType"
1685
+ }), /* @__PURE__ */ L(lt, {
1686
+ value: F?.opentype ?? {},
1687
+ onToggle: (e, t) => j(b, { opentype: {
1688
+ ...F?.opentype ?? {},
1689
+ [e]: t
1690
+ } })
1691
+ })] }),
1692
+ e.section && e.section !== _e[t - 1]?.section && /* @__PURE__ */ L("span", {
1693
+ className: "kol-helper-10 text-meta",
1694
+ children: e.section
1695
+ }),
1696
+ /* @__PURE__ */ L(st, {
1697
+ knob: e,
1698
+ comp: ie(e),
1699
+ idx: b,
1700
+ palette: c,
1701
+ onWrite: ce
1702
+ }),
1703
+ e.key === "showPath" && F?.path?.type === "custom" && /* @__PURE__ */ L(ut, {
1704
+ inst: F,
1705
+ layer: r,
1706
+ onPoints: (e) => j(b, { path: {
1707
+ ...F?.path ?? {},
1708
+ points: e
1709
+ } })
1710
+ })
1711
+ ] }, e.key)),
1712
+ u === "anim" && ye && /* @__PURE__ */ L(dt, {
1713
+ layer: r,
1714
+ setProp: a,
1715
+ insts: _,
1716
+ renderAnimate: l
1717
+ })
1718
+ ] });
1719
+ }
1720
+ function at({ layer: e, onPreset: t }) {
1721
+ return /* @__PURE__ */ L(T, {
1722
+ tree: ie,
1723
+ presets: j,
1724
+ current: j.find((t) => t.id === e.presetId) ?? j[0],
1725
+ onPick: t
1726
+ });
1727
+ }
1728
+ function ot({ insts: e, idx: t, onSelect: n, onWrite: r, marked: a, onMark: o, onGroup: s, onUngroup: c }) {
1729
+ let l = i(), u = () => {
1730
+ let t = e.length;
1731
+ for (; e.some((e) => e.id === `i${t}`);) t++;
1732
+ return `i${t}`;
1733
+ }, d = () => {
1734
+ let i = {
1735
+ id: u(),
1736
+ text: "Text"
1737
+ };
1738
+ e[t]?.fill && (i.fill = e[t].fill), r([...e, k(i, e.length)]), n(e.length);
1739
+ }, f = (t) => {
1740
+ let i = {
1741
+ ...structuredClone(e[t]),
1742
+ id: u()
1743
+ }, a = [...e];
1744
+ a.splice(t + 1, 0, i), r(a), n(t + 1);
1745
+ }, p = (t) => {
1746
+ e.length <= 1 || (r(e.filter((e, n) => n !== t)), n(Math.min(t, e.length - 2)));
1747
+ }, m = (i) => {
1748
+ let a = t + i;
1749
+ if (a < 0 || a >= e.length) return;
1750
+ let o = [...e], [s] = o.splice(t, 1);
1751
+ o.splice(a, 0, s), r(o), n(a);
1752
+ }, h = [...new Set(e.map((e) => e.group).filter(Boolean))];
1753
+ return /* @__PURE__ */ R(we, { children: [
1754
+ /* @__PURE__ */ L("div", {
1755
+ className: "flex flex-col gap-1",
1756
+ children: e.map((r, i) => {
1757
+ let s = rt(r.group, h);
1758
+ return /* @__PURE__ */ R("div", {
1759
+ onClick: () => n(i),
1760
+ className: `flex items-center gap-2 pl-2 pr-1 py-1 rounded cursor-pointer kol-helper-12 ${i === t ? "bg-[color-mix(in_srgb,var(--kol-accent-primary)_26%,transparent)] text-emphasis" : "text-body hover:bg-oq-04 hover:text-emphasis"}`,
1761
+ children: [
1762
+ /* @__PURE__ */ L("span", {
1763
+ onClick: (e) => e.stopPropagation(),
1764
+ className: "shrink-0",
1765
+ style: { lineHeight: 0 },
1766
+ children: /* @__PURE__ */ L(_e, {
1767
+ checked: a.includes(r.id),
1768
+ onChange: () => o(r.id)
1769
+ })
1770
+ }),
1771
+ /* @__PURE__ */ L("span", {
1772
+ className: "kol-helper-10 text-meta shrink-0",
1773
+ children: i + 1
1774
+ }),
1775
+ /* @__PURE__ */ L("span", {
1776
+ className: "truncate flex-1 min-w-0",
1777
+ children: r.text || "—"
1778
+ }),
1779
+ s && /* @__PURE__ */ R("span", {
1780
+ className: "shrink-0 kol-helper-10 text-meta",
1781
+ children: ["grp ", s]
1782
+ }),
1783
+ /* @__PURE__ */ L(P, {
1784
+ label: "Duplicate element",
1785
+ children: /* @__PURE__ */ L(M, {
1786
+ tone: "ghost",
1787
+ size: l,
1788
+ quiet: !0,
1789
+ iconOnly: "copy",
1790
+ iconSize: 12,
1791
+ "aria-label": "Duplicate element",
1792
+ onClick: (e) => {
1793
+ e.stopPropagation(), f(i);
1794
+ }
1795
+ })
1796
+ }),
1797
+ /* @__PURE__ */ L(P, {
1798
+ label: "Remove element",
1799
+ children: /* @__PURE__ */ L(M, {
1800
+ tone: "ghost",
1801
+ size: l,
1802
+ quiet: !0,
1803
+ iconOnly: "x",
1804
+ iconSize: 10,
1805
+ "aria-label": "Remove element",
1806
+ disabled: e.length <= 1,
1807
+ onClick: (e) => {
1808
+ e.stopPropagation(), p(i);
1809
+ }
1810
+ })
1811
+ })
1812
+ ]
1813
+ }, r.id ?? i);
1814
+ })
1815
+ }),
1816
+ /* @__PURE__ */ R("div", {
1817
+ className: "grid grid-cols-2 gap-1",
1818
+ children: [/* @__PURE__ */ L(M, {
1819
+ tone: "primary",
1820
+ size: l,
1821
+ disabled: a.length < 2,
1822
+ onClick: s,
1823
+ children: "Group"
1824
+ }), /* @__PURE__ */ L(M, {
1825
+ tone: "primary",
1826
+ size: l,
1827
+ disabled: !a.length,
1828
+ onClick: c,
1829
+ children: "Ungroup"
1830
+ })]
1831
+ }),
1832
+ /* @__PURE__ */ R("div", {
1833
+ className: "flex items-center gap-1",
1834
+ children: [
1835
+ /* @__PURE__ */ L(M, {
1836
+ tone: "primary",
1837
+ size: l,
1838
+ className: "flex-1",
1839
+ iconLeft: "plus",
1840
+ iconSize: 12,
1841
+ onClick: d,
1842
+ children: "Add element"
1843
+ }),
1844
+ /* @__PURE__ */ L(P, {
1845
+ label: "Move element up",
1846
+ children: /* @__PURE__ */ L(M, {
1847
+ tone: "ghost",
1848
+ size: l,
1849
+ quiet: !0,
1850
+ style: nt,
1851
+ "aria-label": "Move element up",
1852
+ disabled: t <= 0,
1853
+ onClick: () => m(-1),
1854
+ children: /* @__PURE__ */ L(z, {
1855
+ name: "chevron-down",
1856
+ size: 12,
1857
+ style: { transform: "rotate(180deg)" }
1858
+ })
1859
+ })
1860
+ }),
1861
+ /* @__PURE__ */ L(P, {
1862
+ label: "Move element down",
1863
+ children: /* @__PURE__ */ L(M, {
1864
+ tone: "ghost",
1865
+ size: l,
1866
+ quiet: !0,
1867
+ style: nt,
1868
+ "aria-label": "Move element down",
1869
+ disabled: t >= e.length - 1,
1870
+ onClick: () => m(1),
1871
+ children: /* @__PURE__ */ L(z, {
1872
+ name: "chevron-down",
1873
+ size: 12
1874
+ })
1875
+ })
1876
+ })
1877
+ ]
1878
+ })
1879
+ ] });
1880
+ }
1881
+ function st({ knob: t, comp: n, idx: r, palette: a, onWrite: o }) {
1882
+ let s = i(), c = t.get(n, r), l = (e) => o(t, e);
1883
+ if (t.type === "color") return /* @__PURE__ */ L(f, {
1884
+ label: t.label,
1885
+ value: c,
1886
+ onChange: (t) => l(e(t, a) ?? t),
1887
+ palette: a
1888
+ });
1889
+ if (t.type === "select") return /* @__PURE__ */ L(N, {
1890
+ label: t.label,
1891
+ children: /* @__PURE__ */ L(le, {
1892
+ variant: "subtle",
1893
+ size: s,
1894
+ className: "w-full",
1895
+ options: Ye(t, n, r),
1896
+ value: c,
1897
+ onChange: l
1898
+ })
1899
+ });
1900
+ let { min: u, max: d } = Xe(t, n, r);
1901
+ return /* @__PURE__ */ L(N, {
1902
+ label: t.label,
1903
+ children: /* @__PURE__ */ L(me, {
1904
+ min: u,
1905
+ max: d,
1906
+ step: t.step ?? 1,
1907
+ value: typeof c == "number" ? c : u,
1908
+ onChange: l
1909
+ })
1910
+ });
1911
+ }
1912
+ function ct({ motions: e, mIdx: t, onSelect: n, onAdd: r, onRemove: a }) {
1913
+ let o = i(), s = [{
1914
+ value: "0",
1915
+ label: "1"
1916
+ }, ...e.map((e, t) => ({
1917
+ value: String(t + 1),
1918
+ label: String(t + 2)
1919
+ }))];
1920
+ return /* @__PURE__ */ R("div", {
1921
+ className: "flex flex-col gap-1",
1922
+ children: [/* @__PURE__ */ L("span", {
1923
+ className: "kol-helper-10 text-meta",
1924
+ children: "Motion layers"
1925
+ }), /* @__PURE__ */ R("div", {
1926
+ className: "flex items-center gap-1",
1927
+ children: [
1928
+ /* @__PURE__ */ L("div", {
1929
+ className: "flex-1 min-w-0",
1930
+ children: /* @__PURE__ */ L(pe, {
1931
+ variant: "filled",
1932
+ value: String(t),
1933
+ onChange: (e) => n(Number(e)),
1934
+ options: s
1935
+ })
1936
+ }),
1937
+ /* @__PURE__ */ L(P, {
1938
+ label: "Add motion layer",
1939
+ children: /* @__PURE__ */ L(M, {
1940
+ tone: "ghost",
1941
+ size: o,
1942
+ quiet: !0,
1943
+ iconOnly: "plus",
1944
+ iconSize: 12,
1945
+ "aria-label": "Add motion layer",
1946
+ onClick: r
1947
+ })
1948
+ }),
1949
+ /* @__PURE__ */ L(P, {
1950
+ label: "Remove motion layer (the primary can only be set to None)",
1951
+ children: /* @__PURE__ */ L(M, {
1952
+ tone: "ghost",
1953
+ size: o,
1954
+ quiet: !0,
1955
+ iconOnly: "x",
1956
+ iconSize: 10,
1957
+ "aria-label": "Remove motion layer",
1958
+ disabled: t === 0,
1959
+ onClick: a
1960
+ })
1961
+ })
1962
+ ]
1963
+ })]
1964
+ });
1965
+ }
1966
+ function lt({ value: e = {}, onToggle: t }) {
1967
+ let [n, r] = I(!1), i = F({
1968
+ open: n,
1969
+ onOpenChange: r,
1970
+ placement: "bottom-start",
1971
+ offset: -1,
1972
+ flip: !1,
1973
+ matchReferenceWidth: !0,
1974
+ role: "listbox"
1975
+ }), a = je.filter((t) => e[t.tag]).length;
1976
+ return /* @__PURE__ */ R("div", {
1977
+ className: "relative w-full",
1978
+ children: [/* @__PURE__ */ R("button", {
1979
+ ref: i.refs.setReference,
1980
+ ...i.getReferenceProps(),
1981
+ type: "button",
1982
+ className: "w-full flex items-center justify-between kol-helper-12 rounded",
1983
+ style: {
1984
+ border: "1px solid transparent",
1985
+ borderRadius: n ? "4px 4px 0 0" : "4px",
1986
+ backgroundColor: "var(--kol-surface-secondary)",
1987
+ color: "var(--kol-surface-on-primary)",
1988
+ padding: "4px 12px",
1989
+ cursor: "pointer"
1990
+ },
1991
+ "aria-haspopup": "listbox",
1992
+ "aria-expanded": n,
1993
+ children: [/* @__PURE__ */ L("span", { children: a ? `${a} feature${a > 1 ? "s" : ""}` : "None" }), /* @__PURE__ */ L(z, {
1994
+ name: "chevron-down",
1995
+ size: 10,
1996
+ className: "ml-auto",
1997
+ style: {
1998
+ transform: n ? "rotate(180deg)" : "rotate(0deg)",
1999
+ transition: "transform 300ms"
2000
+ }
2001
+ })]
2002
+ }), /* @__PURE__ */ L(fe, {
2003
+ popover: i,
2004
+ panel: !1,
2005
+ focus: !1,
2006
+ style: {
2007
+ backgroundColor: "var(--kol-surface-secondary)",
2008
+ color: "var(--kol-surface-on-primary)",
2009
+ borderRadius: "0 0 4px 4px",
2010
+ zIndex: 200
2011
+ },
2012
+ children: /* @__PURE__ */ L("div", {
2013
+ className: "flex max-h-[300px] flex-col items-stretch overflow-y-auto",
2014
+ role: "listbox",
2015
+ children: je.map((n) => /* @__PURE__ */ L(de, {
2016
+ onClick: () => t(n.tag, !e[n.tag]),
2017
+ shortcut: e[n.tag] ? /* @__PURE__ */ L(z, {
2018
+ name: "check",
2019
+ size: 11
2020
+ }) : void 0,
2021
+ children: n.label
2022
+ }, n.tag))
2023
+ })
2024
+ })]
2025
+ });
2026
+ }
2027
+ function ut({ inst: e, layer: t, onPoints: n }) {
2028
+ let r = i(), a = Ce(null), o = Ce(null), s = e?.path?.points, c = Array.isArray(s) && s.length >= 2 ? s : ae, l = t.w > 0 && t.h > 0 ? t.w / t.h : 1, u = ce("custom", 100, 100, { points: c }).d, d = (e) => (t) => {
2029
+ t.preventDefault(), t.stopPropagation(), t.currentTarget.setPointerCapture(t.pointerId), o.current = { i: e };
2030
+ }, f = (e) => {
2031
+ let t = o.current, r = a.current;
2032
+ if (!t || !r) return;
2033
+ let i = r.getBoundingClientRect();
2034
+ if (!i.width || !i.height) return;
2035
+ let s = Math.max(0, Math.min(1, (e.clientX - i.left) / i.width)), l = Math.max(0, Math.min(1, (e.clientY - i.top) / i.height));
2036
+ n(c.map((e, n) => n === t.i ? [Number(s.toFixed(3)), Number(l.toFixed(3))] : e));
2037
+ }, p = (e) => {
2038
+ o.current = null;
2039
+ try {
2040
+ e.currentTarget.releasePointerCapture(e.pointerId);
2041
+ } catch {}
2042
+ };
2043
+ return /* @__PURE__ */ R("div", {
2044
+ className: "flex flex-col gap-2",
2045
+ children: [/* @__PURE__ */ R("div", {
2046
+ ref: a,
2047
+ className: "relative w-full rounded border border-oq-08 overflow-hidden",
2048
+ style: { aspectRatio: `${l}` },
2049
+ children: [/* @__PURE__ */ L("svg", {
2050
+ className: "absolute inset-0 w-full h-full",
2051
+ viewBox: "0 0 100 100",
2052
+ preserveAspectRatio: "none",
2053
+ children: /* @__PURE__ */ L("path", {
2054
+ d: u,
2055
+ fill: "none",
2056
+ stroke: "var(--kol-accent-primary)",
2057
+ strokeWidth: 1.5,
2058
+ vectorEffect: "non-scaling-stroke"
2059
+ })
2060
+ }), c.map((e, t) => /* @__PURE__ */ L("div", {
2061
+ onPointerDown: d(t),
2062
+ onPointerMove: f,
2063
+ onPointerUp: p,
2064
+ className: "absolute cursor-grab rounded-full",
2065
+ style: {
2066
+ left: `${e[0] * 100}%`,
2067
+ top: `${e[1] * 100}%`,
2068
+ width: 12,
2069
+ height: 12,
2070
+ marginLeft: -6,
2071
+ marginTop: -6,
2072
+ background: "var(--kol-accent-primary)",
2073
+ border: "2px solid white",
2074
+ boxShadow: "0 0 0 1px rgba(0,0,0,0.5)"
2075
+ }
2076
+ }, t))]
2077
+ }), /* @__PURE__ */ R("div", {
2078
+ className: "grid grid-cols-2 gap-2",
2079
+ children: [/* @__PURE__ */ L(M, {
2080
+ tone: "primary",
2081
+ size: r,
2082
+ onClick: () => n([...c, [.5, .5]]),
2083
+ children: "Add point"
2084
+ }), /* @__PURE__ */ L(M, {
2085
+ tone: "primary",
2086
+ size: r,
2087
+ disabled: c.length <= 2,
2088
+ onClick: () => n(c.slice(0, -1)),
2089
+ children: "Remove point"
2090
+ })]
2091
+ })]
2092
+ });
2093
+ }
2094
+ function dt({ layer: e, setProp: t, insts: n, renderAnimate: r }) {
2095
+ let i = Qe, a = e[i.key], o = y(a), s = n.find((e) => e?.morph?.on)?.morph?.blend ?? i.default, c = typeof a == "number" ? a : s, l = o ? /* @__PURE__ */ L("div", {
2096
+ className: "kol-helper-12 text-meta italic px-1",
2097
+ children: "animated"
2098
+ }) : /* @__PURE__ */ L(me, {
2099
+ min: i.min,
2100
+ max: i.max,
2101
+ step: i.step,
2102
+ value: c,
2103
+ onChange: (e) => t(i.key, e)
2104
+ });
2105
+ return /* @__PURE__ */ L(N, {
2106
+ label: i.label,
2107
+ children: /* @__PURE__ */ R("div", {
2108
+ className: "flex items-center gap-2",
2109
+ children: [/* @__PURE__ */ L("div", {
2110
+ className: "flex-1 min-w-0",
2111
+ children: l
2112
+ }), r(i)]
2113
+ })
2114
+ });
2115
+ }
2116
+ //#endregion
2117
+ //#region src/editor/params/TimelineDock.jsx
2118
+ function ft(e, t = []) {
2119
+ for (let n of e) {
2120
+ for (let e in n) {
2121
+ let r = n[e];
2122
+ y(r) && r.bind === "track" && t.push({
2123
+ id: `${n.id}:${e}`,
2124
+ layerId: n.id,
2125
+ key: e,
2126
+ label: `${se(n)} · ${e}`,
2127
+ keys: r.keys
2128
+ });
2129
+ }
2130
+ Array.isArray(n.children) && ft(n.children, t);
2131
+ }
2132
+ return t;
2133
+ }
2134
+ function pt() {
2135
+ let { layers: e, updateLayer: t } = h(), { t: n, seek: r } = w(), i = Se(() => ft(e), [e]);
2136
+ return /* @__PURE__ */ L(ge, {
2137
+ tracks: i,
2138
+ t: n,
2139
+ onSeek: r,
2140
+ onChange: (e, n) => {
2141
+ let r = i.find((t) => t.id === e);
2142
+ r && t(r.layerId, { [r.key]: {
2143
+ bind: "track",
2144
+ keys: n
2145
+ } });
2146
+ },
2147
+ easingOptions: ne
2148
+ });
2149
+ }
2150
+ //#endregion
2151
+ //#region src/editor/params/TransportBar.jsx
2152
+ function mt({ seconds: e, onCommit: t, size: n }) {
2153
+ let r = String(e), [i, a] = I(r), [o, s] = I(!1);
2154
+ return xe(() => {
2155
+ o || a(r);
2156
+ }, [r, o]), /* @__PURE__ */ L(P, {
2157
+ label: "Loop length",
2158
+ triggerClassName: "flex w-full",
2159
+ children: /* @__PURE__ */ L(ue, {
2160
+ type: "text",
2161
+ inputMode: "decimal",
2162
+ variant: "property",
2163
+ size: n,
2164
+ affordance: "Loop /",
2165
+ unit: "s",
2166
+ chars: 3,
2167
+ "aria-label": "Loop length in seconds",
2168
+ value: i,
2169
+ onFocus: (e) => {
2170
+ s(!0), e.target.select();
2171
+ },
2172
+ onChange: (e) => a(e.target.value),
2173
+ onBlur: () => {
2174
+ s(!1);
2175
+ let e = Number(i.trim());
2176
+ if (i.trim() === "" || !Number.isFinite(e)) {
2177
+ a(r);
2178
+ return;
2179
+ }
2180
+ t(e);
2181
+ },
2182
+ onKeyDown: (e) => {
2183
+ e.key === "Enter" && e.currentTarget.blur(), e.key === "Escape" && (a(r), s(!1), e.currentTarget.blur());
2184
+ },
2185
+ inputClassName: "text-center"
2186
+ })
2187
+ });
2188
+ }
2189
+ var ht = (e, t) => /* @__PURE__ */ L(z, {
2190
+ name: e,
2191
+ size: ye(t, !0)
2192
+ }), gt = {
2193
+ sm: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-sm)]",
2194
+ md: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-md)]",
2195
+ lg: "shrink-0 [&_.kol-seg-cell]:flex-none [&_.kol-seg-cell]:px-0 [&_.kol-seg-cell]:w-[var(--kol-ctl-lg)]"
2196
+ };
2197
+ function _t({ size: e = "sm" }) {
2198
+ let { playing: t, loopSeconds: n, play: r, pause: i, stop: a, rewind: o, setLoopSeconds: s } = w();
2199
+ return /* @__PURE__ */ R("div", {
2200
+ className: "flex items-center gap-2",
2201
+ children: [
2202
+ /* @__PURE__ */ L(pe, {
2203
+ size: e,
2204
+ ariaLabel: "Playback",
2205
+ value: t ? "play" : "pause",
2206
+ className: gt[e],
2207
+ onChange: (e) => e === "play" ? r() : i(),
2208
+ options: [{
2209
+ value: "play",
2210
+ ariaLabel: "Play",
2211
+ tooltip: "Play (Space)",
2212
+ label: ht("play", e)
2213
+ }, {
2214
+ value: "pause",
2215
+ ariaLabel: "Pause",
2216
+ tooltip: "Pause (Space)",
2217
+ label: ht("pause", e)
2218
+ }]
2219
+ }),
2220
+ /* @__PURE__ */ L("div", {
2221
+ className: "flex-1 min-w-0",
2222
+ children: /* @__PURE__ */ L(mt, {
2223
+ seconds: n,
2224
+ onCommit: s,
2225
+ size: e
2226
+ })
2227
+ }),
2228
+ /* @__PURE__ */ L(pe, {
2229
+ size: e,
2230
+ ariaLabel: "Reset",
2231
+ value: null,
2232
+ className: gt[e],
2233
+ onChange: (e) => e === "stop" ? a() : o(),
2234
+ options: [{
2235
+ value: "stop",
2236
+ ariaLabel: "Stop",
2237
+ label: ht("stop", e)
2238
+ }, {
2239
+ value: "rewind",
2240
+ ariaLabel: "Rewind",
2241
+ label: ht("rewind", e)
2242
+ }]
2243
+ })
2244
+ ]
2245
+ });
2246
+ }
2247
+ //#endregion
2248
+ //#region src/packs/motion.js
2249
+ var vt = {
2250
+ layerTypes: ["kinetic"],
2251
+ kineticPresetById: E,
2252
+ presetComp: re,
2253
+ KineticType: Ie,
2254
+ loadFonts: m,
2255
+ warmFontCss: S,
2256
+ kineticFontCss: C,
2257
+ KineticPanel: it,
2258
+ TimelineDock: pt,
2259
+ TransportBar: _t
2260
+ };
2261
+ b("motion", vt);
2262
+ //#endregion
2263
+ export { Ze as i, pt as n, it as r, vt as t };