@cliquify.me/state 3.1.15 → 3.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -112,7 +112,7 @@ var kr = function() {
112
112
  if (E) {
113
113
  this._finalizers = null;
114
114
  try {
115
- for (var y = yn(E), T = y.next(); !T.done; T = y.next()) {
115
+ for (var m = yn(E), T = m.next(); !T.done; T = m.next()) {
116
116
  var C = T.value;
117
117
  try {
118
118
  $n(C);
@@ -124,7 +124,7 @@ var kr = function() {
124
124
  s = { error: u };
125
125
  } finally {
126
126
  try {
127
- T && !T.done && (a = y.return) && a.call(y);
127
+ T && !T.done && (a = m.return) && a.call(m);
128
128
  } finally {
129
129
  if (s) throw s.error;
130
130
  }
@@ -492,8 +492,8 @@ function xn(t) {
492
492
  var gr = { exports: {} };
493
493
  gr.exports;
494
494
  (function(t, e) {
495
- var r = 200, s = "__lodash_hash_undefined__", a = 1, c = 2, d = 9007199254740991, f = "[object Arguments]", b = "[object Array]", _ = "[object AsyncFunction]", M = "[object Boolean]", E = "[object Date]", y = "[object Error]", T = "[object Function]", C = "[object GeneratorFunction]", u = "[object Map]", l = "[object Number]", S = "[object Null]", w = "[object Object]", k = "[object Promise]", h = "[object Proxy]", m = "[object RegExp]", v = "[object Set]", I = "[object String]", D = "[object Symbol]", g = "[object Undefined]", O = "[object WeakMap]", x = "[object ArrayBuffer]", j = "[object DataView]", L = "[object Float32Array]", R = "[object Float64Array]", F = "[object Int8Array]", V = "[object Int16Array]", kt = "[object Int32Array]", Dt = "[object Uint8Array]", Ot = "[object Uint8ClampedArray]", U = "[object Uint16Array]", zt = "[object Uint32Array]", wt = /[\\^$.*+?()[\]{}|]/g, at = /^\[object .+?Constructor\]$/, Ft = /^(?:0|[1-9]\d*)$/, A = {};
496
- A[L] = A[R] = A[F] = A[V] = A[kt] = A[Dt] = A[Ot] = A[U] = A[zt] = !0, A[f] = A[b] = A[x] = A[M] = A[j] = A[E] = A[y] = A[T] = A[u] = A[l] = A[w] = A[m] = A[v] = A[I] = A[O] = !1;
495
+ var r = 200, s = "__lodash_hash_undefined__", a = 1, c = 2, d = 9007199254740991, f = "[object Arguments]", b = "[object Array]", _ = "[object AsyncFunction]", M = "[object Boolean]", E = "[object Date]", m = "[object Error]", T = "[object Function]", C = "[object GeneratorFunction]", u = "[object Map]", l = "[object Number]", S = "[object Null]", w = "[object Object]", k = "[object Promise]", h = "[object Proxy]", y = "[object RegExp]", v = "[object Set]", I = "[object String]", x = "[object Symbol]", g = "[object Undefined]", O = "[object WeakMap]", D = "[object ArrayBuffer]", j = "[object DataView]", L = "[object Float32Array]", R = "[object Float64Array]", F = "[object Int8Array]", V = "[object Int16Array]", kt = "[object Int32Array]", Dt = "[object Uint8Array]", Ot = "[object Uint8ClampedArray]", U = "[object Uint16Array]", zt = "[object Uint32Array]", wt = /[\\^$.*+?()[\]{}|]/g, at = /^\[object .+?Constructor\]$/, Ft = /^(?:0|[1-9]\d*)$/, A = {};
496
+ A[L] = A[R] = A[F] = A[V] = A[kt] = A[Dt] = A[Ot] = A[U] = A[zt] = !0, A[f] = A[b] = A[D] = A[M] = A[j] = A[E] = A[m] = A[T] = A[u] = A[l] = A[w] = A[y] = A[v] = A[I] = A[O] = !1;
497
497
  var et = typeof St == "object" && St && St.Object === Object && St, Mt = typeof self == "object" && self && self.Object === Object && self, ot = et || Mt || Function("return this")(), $t = e && !e.nodeType && e, Et = $t && !0 && t && !t.nodeType && t, Gt = Et && Et.exports === $t, Yt = Gt && et.process, ee = function() {
498
498
  try {
499
499
  return Yt && Yt.binding && Yt.binding("util");
@@ -791,15 +791,15 @@ gr.exports;
791
791
  if (n.byteLength != i.byteLength || n.byteOffset != i.byteOffset)
792
792
  return !1;
793
793
  n = n.buffer, i = i.buffer;
794
- case x:
794
+ case D:
795
795
  return !(n.byteLength != i.byteLength || !P(new Vt(n), new Vt(i)));
796
796
  case M:
797
797
  case E:
798
798
  case l:
799
799
  return cr(+n, +i);
800
- case y:
801
- return n.name == i.name && n.message == i.message;
802
800
  case m:
801
+ return n.name == i.name && n.message == i.message;
802
+ case y:
803
803
  case I:
804
804
  return n == i + "";
805
805
  case u:
@@ -814,7 +814,7 @@ gr.exports;
814
814
  p |= c, G.set(n, i);
815
815
  var dt = Ue(W(n), W(i), p, N, P, G);
816
816
  return G.delete(n), dt;
817
- case D:
817
+ case x:
818
818
  if (je)
819
819
  return je.call(n) == je.call(i);
820
820
  }
@@ -972,8 +972,8 @@ const Q = /* @__PURE__ */ xn(Ws), Aa = "add", Gs = "track", Ys = "trackItems", x
972
972
  var Ir = { exports: {} };
973
973
  Ir.exports;
974
974
  (function(t, e) {
975
- var r = 200, s = "__lodash_hash_undefined__", a = 9007199254740991, c = "[object Arguments]", d = "[object Array]", f = "[object Boolean]", b = "[object Date]", _ = "[object Error]", M = "[object Function]", E = "[object GeneratorFunction]", y = "[object Map]", T = "[object Number]", C = "[object Object]", u = "[object Promise]", l = "[object RegExp]", S = "[object Set]", w = "[object String]", k = "[object Symbol]", h = "[object WeakMap]", m = "[object ArrayBuffer]", v = "[object DataView]", I = "[object Float32Array]", D = "[object Float64Array]", g = "[object Int8Array]", O = "[object Int16Array]", x = "[object Int32Array]", j = "[object Uint8Array]", L = "[object Uint8ClampedArray]", R = "[object Uint16Array]", F = "[object Uint32Array]", V = /[\\^$.*+?()[\]{}|]/g, kt = /\w*$/, Dt = /^\[object .+?Constructor\]$/, Ot = /^(?:0|[1-9]\d*)$/, U = {};
976
- U[c] = U[d] = U[m] = U[v] = U[f] = U[b] = U[I] = U[D] = U[g] = U[O] = U[x] = U[y] = U[T] = U[C] = U[l] = U[S] = U[w] = U[k] = U[j] = U[L] = U[R] = U[F] = !0, U[_] = U[M] = U[h] = !1;
975
+ var r = 200, s = "__lodash_hash_undefined__", a = 9007199254740991, c = "[object Arguments]", d = "[object Array]", f = "[object Boolean]", b = "[object Date]", _ = "[object Error]", M = "[object Function]", E = "[object GeneratorFunction]", m = "[object Map]", T = "[object Number]", C = "[object Object]", u = "[object Promise]", l = "[object RegExp]", S = "[object Set]", w = "[object String]", k = "[object Symbol]", h = "[object WeakMap]", y = "[object ArrayBuffer]", v = "[object DataView]", I = "[object Float32Array]", x = "[object Float64Array]", g = "[object Int8Array]", O = "[object Int16Array]", D = "[object Int32Array]", j = "[object Uint8Array]", L = "[object Uint8ClampedArray]", R = "[object Uint16Array]", F = "[object Uint32Array]", V = /[\\^$.*+?()[\]{}|]/g, kt = /\w*$/, Dt = /^\[object .+?Constructor\]$/, Ot = /^(?:0|[1-9]\d*)$/, U = {};
976
+ U[c] = U[d] = U[y] = U[v] = U[f] = U[b] = U[I] = U[x] = U[g] = U[O] = U[D] = U[m] = U[T] = U[C] = U[l] = U[S] = U[w] = U[k] = U[j] = U[L] = U[R] = U[F] = !0, U[_] = U[M] = U[h] = !1;
977
977
  var zt = typeof St == "object" && St && St.Object === Object && St, wt = typeof self == "object" && self && self.Object === Object && self, at = zt || wt || Function("return this")(), Ft = e && !e.nodeType && e, A = Ft && !0 && t && !t.nodeType && t, et = A && A.exports === Ft;
978
978
  function Mt(n, i) {
979
979
  return n.set(i[0], i[1]), n;
@@ -1288,14 +1288,14 @@ Ir.exports;
1288
1288
  return Xr(o) ? o : void 0;
1289
1289
  }
1290
1290
  var Ht = Y ? Xt(Y, Object) : cn, Lt = Br;
1291
- (qt && Lt(new qt(new ArrayBuffer(1))) != v || Tt && Lt(new Tt()) != y || At && Lt(At.resolve()) != u || we && Lt(new we()) != S || Re && Lt(new Re()) != h) && (Lt = function(n) {
1291
+ (qt && Lt(new qt(new ArrayBuffer(1))) != v || Tt && Lt(new Tt()) != m || At && Lt(At.resolve()) != u || we && Lt(new we()) != S || Re && Lt(new Re()) != h) && (Lt = function(n) {
1292
1292
  var i = rt.call(n), o = i == C ? n.constructor : void 0, p = o ? yt(o) : void 0;
1293
1293
  if (p)
1294
1294
  switch (p) {
1295
1295
  case ze:
1296
1296
  return v;
1297
1297
  case ae:
1298
- return y;
1298
+ return m;
1299
1299
  case Fe:
1300
1300
  return u;
1301
1301
  case $e:
@@ -1315,7 +1315,7 @@ Ir.exports;
1315
1315
  function rn(n, i, o, p) {
1316
1316
  var N = n.constructor;
1317
1317
  switch (i) {
1318
- case m:
1318
+ case y:
1319
1319
  return Le(n);
1320
1320
  case f:
1321
1321
  case b:
@@ -1323,16 +1323,16 @@ Ir.exports;
1323
1323
  case v:
1324
1324
  return oe(n, p);
1325
1325
  case I:
1326
- case D:
1326
+ case x:
1327
1327
  case g:
1328
1328
  case O:
1329
- case x:
1329
+ case D:
1330
1330
  case j:
1331
1331
  case L:
1332
1332
  case R:
1333
1333
  case F:
1334
1334
  return Jr(n, p);
1335
- case y:
1335
+ case m:
1336
1336
  return ir(n, p, o);
1337
1337
  case T:
1338
1338
  case w:
@@ -1546,35 +1546,35 @@ function ki(t, e, r = 300, s = 300) {
1546
1546
  const w = l.replace(/\.(st[\w-]+)/g, `.${e}-$1`).replace(/url\(#(.*?)\)/g, `url(#${e}-$1)`);
1547
1547
  u.textContent = w;
1548
1548
  const k = Array.from(d.querySelectorAll("*")), h = /* @__PURE__ */ new Set();
1549
- k.forEach((m) => {
1550
- if (dn(m)) return;
1551
- ["fill", "stroke", "stop-color"].forEach((D) => {
1552
- const g = m.getAttribute(D);
1549
+ k.forEach((y) => {
1550
+ if (dn(y)) return;
1551
+ ["fill", "stroke", "stop-color"].forEach((x) => {
1552
+ const g = y.getAttribute(x);
1553
1553
  g && !["none", "transparent"].includes(g) && h.add(it(g));
1554
1554
  });
1555
- const v = m.getAttribute("style");
1555
+ const v = y.getAttribute("style");
1556
1556
  if (v) {
1557
- const D = /fill\s*:\s*([^;]+);?/.exec(v), g = /stroke\s*:\s*([^;]+);?/.exec(v), O = /stop-color\s*:\s*([^;]+);?/.exec(v);
1558
- if (D) {
1559
- const x = D[1].trim();
1560
- x && !["none", "transparent"].includes(x) && Be(it(x)) && h.add(it(x));
1557
+ const x = /fill\s*:\s*([^;]+);?/.exec(v), g = /stroke\s*:\s*([^;]+);?/.exec(v), O = /stop-color\s*:\s*([^;]+);?/.exec(v);
1558
+ if (x) {
1559
+ const D = x[1].trim();
1560
+ D && !["none", "transparent"].includes(D) && Be(it(D)) && h.add(it(D));
1561
1561
  }
1562
1562
  if (g) {
1563
- const x = g[1].trim();
1564
- x && !["none", "transparent"].includes(x) && Be(it(x)) && h.add(it(x));
1563
+ const D = g[1].trim();
1564
+ D && !["none", "transparent"].includes(D) && Be(it(D)) && h.add(it(D));
1565
1565
  }
1566
1566
  if (O) {
1567
- const x = O[1].trim();
1568
- x && !["none", "transparent"].includes(x) && Be(it(x)) && h.add(it(x));
1567
+ const D = O[1].trim();
1568
+ D && !["none", "transparent"].includes(D) && Be(it(D)) && h.add(it(D));
1569
1569
  }
1570
1570
  }
1571
- const I = m.getAttribute("class");
1572
- I && I.split(" ").forEach((D) => {
1573
- const g = _[D];
1571
+ const I = y.getAttribute("class");
1572
+ I && I.split(" ").forEach((x) => {
1573
+ const g = _[x];
1574
1574
  g != null && g.fill && !["none", "transparent"].includes(g.fill) && h.add(it(g.fill)), g != null && g.stroke && !["none", "transparent"].includes(g.stroke) && h.add(it(g.stroke));
1575
1575
  });
1576
- }), Array.from(h).forEach((m) => {
1577
- Be(m) && a.push(m);
1576
+ }), Array.from(h).forEach((y) => {
1577
+ Be(y) && a.push(y);
1578
1578
  });
1579
1579
  });
1580
1580
  const M = Array.from(d.querySelectorAll("*")), E = /* @__PURE__ */ new Set();
@@ -1596,16 +1596,16 @@ function ki(t, e, r = 300, s = 300) {
1596
1596
  if (S) {
1597
1597
  const w = /fill\s*:\s*([^;]+);?/.exec(S), k = /stroke\s*:\s*([^;]+);?/.exec(S), h = /stop-color\s*:\s*([^;]+);?/.exec(S);
1598
1598
  if (w) {
1599
- const m = w[1].trim();
1600
- m && !["none", "transparent"].includes(m) && E.add(it(m));
1599
+ const y = w[1].trim();
1600
+ y && !["none", "transparent"].includes(y) && E.add(it(y));
1601
1601
  }
1602
1602
  if (k) {
1603
- const m = k[1].trim();
1604
- m && !["none", "transparent"].includes(m) && E.add(it(m));
1603
+ const y = k[1].trim();
1604
+ y && !["none", "transparent"].includes(y) && E.add(it(y));
1605
1605
  }
1606
1606
  if (h) {
1607
- const m = h[1].trim();
1608
- m && !["none", "transparent"].includes(m) && E.add(it(m));
1607
+ const y = h[1].trim();
1608
+ y && !["none", "transparent"].includes(y) && E.add(it(y));
1609
1609
  }
1610
1610
  }
1611
1611
  }), E.forEach(
@@ -1762,8 +1762,8 @@ const hs = async (t, e) => {
1762
1762
  e.size.height / s.height
1763
1763
  ), c = ((E = t.details) == null ? void 0 : E.rotate) || 0, d = te(e, s), f = t.display;
1764
1764
  let b = 1 / 0, _ = 0;
1765
- r.forEach((y) => {
1766
- const T = t.trackItemsMap[y];
1765
+ r.forEach((m) => {
1766
+ const T = t.trackItemsMap[m];
1767
1767
  T.display.from < b && (b = T.display.from), T.display.to > _ && (_ = T.display.to);
1768
1768
  });
1769
1769
  const M = t.trim || t.display || { from: b, to: _ };
@@ -1792,8 +1792,8 @@ const hs = async (t, e) => {
1792
1792
  ), c = ((M = t.details) == null ? void 0 : M.rotate) || 0, d = te(e, s), f = t.display;
1793
1793
  let b = 1 / 0, _ = 0;
1794
1794
  return r.forEach((E) => {
1795
- const y = t.trackItemsMap[E];
1796
- y.display.from < b && (b = y.display.from), y.display.to > _ && (_ = y.display.to);
1795
+ const m = t.trackItemsMap[E];
1796
+ m.display.from < b && (b = m.display.from), m.display.to > _ && (_ = m.display.to);
1797
1797
  }), {
1798
1798
  id: t.id,
1799
1799
  type: "composition",
@@ -1815,7 +1815,7 @@ const hs = async (t, e) => {
1815
1815
  t.id,
1816
1816
  parseFloat(r.width || c.width),
1817
1817
  parseFloat(r.height || c.height)
1818
- ), E = t.details.colorMap || Object.fromEntries(M.map((y) => [y, y]));
1818
+ ), E = t.details.colorMap || Object.fromEntries(M.map((m) => [m, m]));
1819
1819
  return {
1820
1820
  id: t.id,
1821
1821
  name: "illustration",
@@ -2114,8 +2114,8 @@ const xi = (t, e, r, s, a) => {
2114
2114
  for (const b of d) {
2115
2115
  const _ = b.display.from, M = b.display.to;
2116
2116
  for (const E of f) {
2117
- const y = E.display.from;
2118
- if (!(E.display.to <= _ || y >= M))
2117
+ const m = E.display.from;
2118
+ if (!(E.display.to <= _ || m >= M))
2119
2119
  return {
2120
2120
  trackId: void 0,
2121
2121
  trackIndex: e.indexOf(c)
@@ -2152,16 +2152,16 @@ const xi = (t, e, r, s, a) => {
2152
2152
  const { trackItemIds: e, transitionsMap: r, trackItemsMap: s } = t, a = /* @__PURE__ */ new Map();
2153
2153
  Object.values(r).forEach((_) => {
2154
2154
  var T, C;
2155
- const { fromId: M, toId: E, kind: y } = _;
2156
- y !== "none" && (a.has(M) || a.set(M, []), a.has(E) || a.set(E, []), (T = a.get(M)) == null || T.push(_), (C = a.get(E)) == null || C.push(_));
2155
+ const { fromId: M, toId: E, kind: m } = _;
2156
+ m !== "none" && (a.has(M) || a.set(M, []), a.has(E) || a.set(E, []), (T = a.get(M)) == null || T.push(_), (C = a.get(E)) == null || C.push(_));
2157
2157
  });
2158
2158
  const c = [], d = /* @__PURE__ */ new Set(), f = (_) => {
2159
2159
  const M = [];
2160
2160
  let E = _;
2161
2161
  for (; E && !d.has(E); ) {
2162
2162
  d.add(E);
2163
- const y = s[E];
2164
- M.push(y);
2163
+ const m = s[E];
2164
+ M.push(m);
2165
2165
  const T = Object.values(r).find(
2166
2166
  (C) => C.fromId === E && C.kind !== "none"
2167
2167
  // Filter here
@@ -2196,8 +2196,8 @@ function Xn(t, e, r) {
2196
2196
  let b = 0;
2197
2197
  d.forEach((_) => {
2198
2198
  const M = [];
2199
- for (const y of f)
2200
- if (y.find((T) => T.id === _)) {
2199
+ for (const m of f)
2200
+ if (m.find((T) => T.id === _)) {
2201
2201
  const T = f.findIndex(
2202
2202
  (C) => C.find((u) => u.id === _)
2203
2203
  );
@@ -2208,16 +2208,16 @@ function Xn(t, e, r) {
2208
2208
  }
2209
2209
  }
2210
2210
  let E = 0;
2211
- if (M.forEach((y) => {
2212
- y.forEach((T) => {
2211
+ if (M.forEach((m) => {
2212
+ m.forEach((T) => {
2213
2213
  T.type === "transition" && (E += T.duration);
2214
2214
  });
2215
2215
  }), e[_]) {
2216
- const y = e[_].display.to - e[_].display.from;
2216
+ const m = e[_].display.to - e[_].display.from;
2217
2217
  e[_].display = {
2218
2218
  from: b - E,
2219
- to: b + y - E
2220
- }, b += y;
2219
+ to: b + m - E
2220
+ }, b += m;
2221
2221
  }
2222
2222
  });
2223
2223
  });
@@ -2238,9 +2238,9 @@ function Ci(t) {
2238
2238
  var _;
2239
2239
  const b = f.items.map((M) => s[M]).sort((M, E) => M.display.from - E.display.from);
2240
2240
  for (let M = 0; M < b.length - 1; M++) {
2241
- const E = b[M], y = b[M + 1];
2242
- if (Math.abs(E.display.to - y.display.from) <= 1) {
2243
- const T = `${E.id}-${y.id}`;
2241
+ const E = b[M], m = b[M + 1];
2242
+ if (Math.abs(E.display.to - m.display.from) <= 1) {
2243
+ const T = `${E.id}-${m.id}`;
2244
2244
  if ((_ = e.transitionIds) == null ? void 0 : _.includes(T))
2245
2245
  c[T] = e.transitionsMap[T];
2246
2246
  else {
@@ -2248,7 +2248,7 @@ function Ci(t) {
2248
2248
  id: T,
2249
2249
  duration: 1500,
2250
2250
  fromId: E.id,
2251
- toId: y.id,
2251
+ toId: m.id,
2252
2252
  kind: "none",
2253
2253
  trackId: f.id,
2254
2254
  type: "transition"
@@ -2307,19 +2307,22 @@ function Ri(t) {
2307
2307
  }
2308
2308
  ]);
2309
2309
  } else if (h[v].type === "illustration") {
2310
- const I = k[v], D = h[v].details, g = await Gn(I, {
2311
- size: { width: D.width, height: D.height }
2312
- }), O = Wn(
2310
+ const I = k[v], x = h[v].details, g = await Gn(
2311
+ { ...I, details: x },
2312
+ {
2313
+ size: { width: x.width, height: x.height }
2314
+ }
2315
+ ), O = Wn(
2313
2316
  g.details.svgString,
2314
- D.colorMap
2317
+ x.colorMap
2315
2318
  );
2316
2319
  g.details.svgString = O, h[v].details = g.details, k[v] = g;
2317
2320
  }
2318
- const m = he(k);
2321
+ const y = he(k);
2319
2322
  t.updateState(
2320
2323
  {
2321
2324
  ...w,
2322
- duration: m
2325
+ duration: y
2323
2326
  },
2324
2327
  {
2325
2328
  kind: "design:load",
@@ -2357,7 +2360,7 @@ function Ri(t) {
2357
2360
  );
2358
2361
  }
2359
2362
  }), E = s.subscribe(async (u) => {
2360
- var S, w, k, h, m;
2363
+ var S, w, k, h, y;
2361
2364
  const l = [];
2362
2365
  if ((S = u.value) != null && S.payload.trackItemIds && (l.push((w = u.value) == null ? void 0 : w.payload.trackItemIds), t.updateState(
2363
2366
  { activeIds: l },
@@ -2366,14 +2369,14 @@ function Ri(t) {
2366
2369
  updateHistory: !1
2367
2370
  }
2368
2371
  )), u.key === fi) {
2369
- const v = (k = u.value) == null ? void 0 : k.payload.trackItemIds, I = K(t.getState()), D = v && v.length ? v : I.activeIds, g = D.map((A) => I.trackItemsMap[A]).filter((A) => !!A).map((A) => A.id), O = I.transitionIds.filter(
2372
+ const v = (k = u.value) == null ? void 0 : k.payload.trackItemIds, I = K(t.getState()), x = v && v.length ? v : I.activeIds, g = x.map((A) => I.trackItemsMap[A]).filter((A) => !!A).map((A) => A.id), O = I.transitionIds.filter(
2370
2373
  (A) => {
2371
2374
  const et = I.transitionsMap[A];
2372
2375
  return g.includes(et.fromId) || g.includes(et.toId);
2373
2376
  }
2374
2377
  );
2375
2378
  g.push(...O);
2376
- const x = {}, j = I.trackItemIds, L = I.transitionIds, R = I.trackItemDetailsMap, F = K(I.tracks), V = K(I.structure);
2379
+ const D = {}, j = I.trackItemIds, L = I.transitionIds, R = I.trackItemDetailsMap, F = K(I.tracks), V = K(I.structure);
2377
2380
  g.forEach((A) => {
2378
2381
  var Mt;
2379
2382
  const et = I.trackItemsMap[A] || I.transitionsMap[A];
@@ -2396,10 +2399,10 @@ function Ri(t) {
2396
2399
  (A) => !g.includes(A)
2397
2400
  );
2398
2401
  L.forEach((A) => {
2399
- D.includes(A) && D.length === 1 && (x[A] = K(I.transitionsMap[A]));
2402
+ x.includes(A) && x.length === 1 && (D[A] = K(I.transitionsMap[A]));
2400
2403
  });
2401
2404
  const Dt = L.filter(
2402
- (A) => !g.includes(A) && !D.includes(A)
2405
+ (A) => !g.includes(A) && !x.includes(A)
2403
2406
  ), Ot = Object.fromEntries(
2404
2407
  Object.entries(R).filter(
2405
2408
  ([A]) => !g.includes(A)
@@ -2410,7 +2413,7 @@ function Ri(t) {
2410
2413
  )
2411
2414
  );
2412
2415
  Object.keys(U).forEach((A) => {
2413
- D.includes(A) && (U[A].kind = "none");
2416
+ x.includes(A) && (U[A].kind = "none");
2414
2417
  });
2415
2418
  const zt = Ai(
2416
2419
  I.tracks,
@@ -2426,9 +2429,9 @@ function Ri(t) {
2426
2429
  I.transitionsMap
2427
2430
  );
2428
2431
  const Ft = he(wt);
2429
- Object.keys(x).forEach((A) => {
2432
+ Object.keys(D).forEach((A) => {
2430
2433
  Pi(
2431
- x[A],
2434
+ D[A],
2432
2435
  zt,
2433
2436
  wt
2434
2437
  );
@@ -2448,12 +2451,12 @@ function Ri(t) {
2448
2451
  );
2449
2452
  }
2450
2453
  if (u.key === di) {
2451
- const v = K(t.getState()), I = {}, D = ((h = u.value) == null ? void 0 : h.payload.trackItemIds) || v.activeIds;
2452
- if (D.length === 0) return;
2453
- D.forEach((O) => {
2454
- const x = v.trackItemsMap[O], j = v.trackItemDetailsMap[O], L = De();
2454
+ const v = K(t.getState()), I = {}, x = ((h = u.value) == null ? void 0 : h.payload.trackItemIds) || v.activeIds;
2455
+ if (x.length === 0) return;
2456
+ x.forEach((O) => {
2457
+ const D = v.trackItemsMap[O], j = v.trackItemDetailsMap[O], L = De();
2455
2458
  v.trackItemsMap[L] = {
2456
- ...K(x),
2459
+ ...K(D),
2457
2460
  id: L
2458
2461
  }, v.trackItemDetailsMap[L] = {
2459
2462
  ...K(j)
@@ -2484,25 +2487,25 @@ function Ri(t) {
2484
2487
  );
2485
2488
  }
2486
2489
  if (u.key === pi) {
2487
- const v = (m = u.value) == null ? void 0 : m.payload, I = Object.keys(v)[0], D = Object.values(v)[0], g = K(t.getState()), O = g.trackItemDetailsMap[I], x = K(g.trackItemsMap[I]), j = O.details;
2488
- if (!D.details.src) return;
2490
+ const v = (y = u.value) == null ? void 0 : y.payload, I = Object.keys(v)[0], x = Object.values(v)[0], g = K(t.getState()), O = g.trackItemDetailsMap[I], D = K(g.trackItemsMap[I]), j = O.details;
2491
+ if (!x.details.src) return;
2489
2492
  if (O.type === "image") {
2490
- const L = await Oe(D.details.src), { crop: R, newHeight: F, newWidth: V } = Yn(
2493
+ const L = await Oe(x.details.src), { crop: R, newHeight: F, newWidth: V } = Yn(
2491
2494
  O,
2492
2495
  L
2493
2496
  );
2494
- D.details.crop = R, D.details.height = F, D.details.width = V;
2497
+ x.details.crop = R, x.details.height = F, x.details.width = V;
2495
2498
  } else if (O.type === "video") {
2496
- const L = await _n(D.details.src), R = g.trackItemsMap[I], { display: F, duration: V, trim: kt } = Bn(R, L), { crop: Dt, newHeight: Ot, newWidth: U } = Yn(
2499
+ const L = await _n(x.details.src), R = g.trackItemsMap[I], { display: F, duration: V, trim: kt } = Bn(R, L), { crop: Dt, newHeight: Ot, newWidth: U } = Yn(
2497
2500
  O,
2498
2501
  L
2499
2502
  );
2500
- D.details.crop = Dt, D.details.height = Ot, D.details.width = U, x.display = F, x.duration = V, x.trim = kt;
2503
+ x.details.crop = Dt, x.details.height = Ot, x.details.width = U, D.display = F, D.duration = V, D.trim = kt;
2501
2504
  } else if (O.type === "audio") {
2502
- const L = await ls(D.details.src), R = g.trackItemsMap[I], { display: F, duration: V, trim: kt } = Bn(R, L);
2503
- x.display = F, x.duration = V, x.trim = kt;
2505
+ const L = await ls(x.details.src), R = g.trackItemsMap[I], { display: F, duration: V, trim: kt } = Bn(R, L);
2506
+ D.display = F, D.duration = V, D.trim = kt;
2504
2507
  }
2505
- O.details = { ...j, ...D.details }, g.trackItemDetailsMap[I] = { ...O }, g.trackItemsMap[I] = { ...x }, t.updateState(
2508
+ O.details = { ...j, ...x.details }, g.trackItemDetailsMap[I] = { ...O }, g.trackItemsMap[I] = { ...D }, t.updateState(
2506
2509
  {
2507
2510
  trackItemDetailsMap: g.trackItemDetailsMap,
2508
2511
  trackItemsMap: g.trackItemsMap
@@ -2513,10 +2516,10 @@ function Ri(t) {
2513
2516
  }
2514
2517
  );
2515
2518
  }
2516
- }), y = r.subscribe(async (u) => {
2517
- var g, O, x, j, L, R, F, V, kt, Dt, Ot, U, zt, wt, at, Ft, A, et, Mt, ot, $t, Et, Gt, Yt, ee, Bt, re, Xt, ne, _e, ke, Nt, Kt;
2518
- const l = K(t.getState()), S = ((O = (g = u.value) == null ? void 0 : g.options) == null ? void 0 : O.isSelected) || !1, w = (j = (x = u.value) == null ? void 0 : x.options) == null ? void 0 : j.scaleMode, k = (R = (L = u.value) == null ? void 0 : L.options) == null ? void 0 : R.isNewTrack;
2519
- let h = [], m = "text";
2519
+ }), m = r.subscribe(async (u) => {
2520
+ var g, O, D, j, L, R, F, V, kt, Dt, Ot, U, zt, wt, at, Ft, A, et, Mt, ot, $t, Et, Gt, Yt, ee, Bt, re, Xt, ne, _e, ke, Nt, Kt;
2521
+ const l = K(t.getState()), S = ((O = (g = u.value) == null ? void 0 : g.options) == null ? void 0 : O.isSelected) || !1, w = (j = (D = u.value) == null ? void 0 : D.options) == null ? void 0 : j.scaleMode, k = (R = (L = u.value) == null ? void 0 : L.options) == null ? void 0 : R.isNewTrack;
2522
+ let h = [], y = "text";
2520
2523
  const v = (V = (F = u.value) == null ? void 0 : F.options) == null ? void 0 : V.trackId;
2521
2524
  let I = (Dt = (kt = u.value) == null ? void 0 : kt.options) == null ? void 0 : Dt.trackIndex;
2522
2525
  if (u.key === ei) {
@@ -2621,7 +2624,7 @@ function Ri(t) {
2621
2624
  return;
2622
2625
  }
2623
2626
  if (u.key === ri) {
2624
- m = "caption";
2627
+ y = "caption";
2625
2628
  const $ = (at = u.value) == null ? void 0 : at.payload, H = [];
2626
2629
  for (const ct of $) {
2627
2630
  const B = Is(ct, {
@@ -2635,24 +2638,24 @@ function Ri(t) {
2635
2638
  rt.push(B);
2636
2639
  const { details: ut, ...q } = ct;
2637
2640
  l.trackItemDetailsMap[B] = {
2638
- type: m,
2641
+ type: y,
2639
2642
  details: ut
2640
2643
  }, l.trackItemsMap[B] = q, l.trackItemIds.push(B);
2641
2644
  }
2642
2645
  h = rt;
2643
2646
  }
2644
2647
  if (u.key === Vs) {
2645
- m = "text";
2648
+ y = "text";
2646
2649
  const $ = await bs((Ft = u.value) == null ? void 0 : Ft.payload, {
2647
2650
  size: l.size
2648
2651
  }), { details: H, ...z } = $;
2649
2652
  l.trackItemDetailsMap[z.id] = {
2650
- type: m,
2653
+ type: y,
2651
2654
  details: H
2652
2655
  }, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
2653
2656
  }
2654
2657
  if (u.key === ni) {
2655
- m = "template";
2658
+ y = "template";
2656
2659
  const $ = (A = u.value) == null ? void 0 : A.payload.trackItemsMap, H = (et = u.value) == null ? void 0 : et.payload.trackItemDetailsMap, z = (Mt = u.value) == null ? void 0 : Mt.payload.transitionsMap, rt = ((ot = u.value) == null ? void 0 : ot.payload.transitionIds) || [], ct = ($t = u.value) == null ? void 0 : $t.payload.trackItemIds, B = ((Et = u.value) == null ? void 0 : Et.payload.tracks) || [], { details: ut, ...q } = await ys((Gt = u.value) == null ? void 0 : Gt.payload, {
2657
2660
  size: l.size
2658
2661
  }), ht = {
@@ -2662,7 +2665,7 @@ function Ri(t) {
2662
2665
  tracks: B
2663
2666
  };
2664
2667
  l.trackItemDetailsMap[q.id] = {
2665
- type: m,
2668
+ type: y,
2666
2669
  details: ut
2667
2670
  }, l.trackItemsMap[q.id] = q, l.trackItemIds.push(q.id), h = [q.id], l.trackItemsMap = {
2668
2671
  ...l.trackItemsMap,
@@ -2683,58 +2686,58 @@ function Ri(t) {
2683
2686
  }, l.structure = [...l.structure, ht];
2684
2687
  }
2685
2688
  if (u.key === Qs) {
2686
- m = "illustration";
2689
+ y = "illustration";
2687
2690
  const $ = await Gn((Yt = u.value) == null ? void 0 : Yt.payload, {
2688
2691
  size: l.size
2689
2692
  }), { details: H, ...z } = $;
2690
2693
  l.trackItemDetailsMap[z.id] = {
2691
- type: m,
2694
+ type: y,
2692
2695
  details: H
2693
2696
  }, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
2694
2697
  }
2695
2698
  if (u.key === ti) {
2696
- m = "shape";
2699
+ y = "shape";
2697
2700
  const $ = await wi((ee = u.value) == null ? void 0 : ee.payload, {
2698
2701
  size: l.size
2699
2702
  }), { details: H, ...z } = $;
2700
2703
  l.trackItemDetailsMap[z.id] = {
2701
- type: m,
2704
+ type: y,
2702
2705
  details: H
2703
2706
  }, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
2704
2707
  }
2705
2708
  if (u.key === Zs) {
2706
- m = "image";
2709
+ y = "image";
2707
2710
  const $ = await gs((Bt = u.value) == null ? void 0 : Bt.payload, {
2708
2711
  size: l.size,
2709
2712
  scaleMode: w
2710
2713
  }), { details: H, ...z } = $;
2711
2714
  l.trackItemDetailsMap[z.id] = {
2712
- type: m,
2715
+ type: y,
2713
2716
  details: H
2714
2717
  }, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
2715
2718
  }
2716
2719
  if (u.key === Js) {
2717
- m = "audio";
2720
+ y = "audio";
2718
2721
  const $ = await ms((re = u.value) == null ? void 0 : re.payload), { details: H, ...z } = $;
2719
2722
  l.trackItemDetailsMap[z.id] = {
2720
- type: m,
2723
+ type: y,
2721
2724
  details: H
2722
2725
  }, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
2723
2726
  }
2724
2727
  if (u.key === qs) {
2725
- m = "video";
2728
+ y = "video";
2726
2729
  const $ = await hs((Xt = u.value) == null ? void 0 : Xt.payload, {
2727
2730
  size: l.size,
2728
2731
  scaleMode: w
2729
2732
  }), { details: H, ...z } = $;
2730
2733
  l.trackItemDetailsMap[z.id] = {
2731
- type: m,
2734
+ type: y,
2732
2735
  details: H,
2733
2736
  metadata: z.metadata
2734
2737
  }, l.trackItemsMap[z.id] = z, l.trackItemIds.push(z.id), h = [z.id];
2735
2738
  }
2736
2739
  if (u.key === ii) {
2737
- m = "composition";
2740
+ y = "composition";
2738
2741
  const $ = (ne = u.value) == null ? void 0 : ne.payload.trackItemsMap, H = (_e = u.value) == null ? void 0 : _e.payload.trackItemDetailsMap, z = (ke = u.value) == null ? void 0 : ke.payload.trackItemIds, rt = ((Nt = u.value) == null ? void 0 : Nt.payload.tracks) || [], { details: ct, ...B } = await Si(
2739
2742
  (Kt = u.value) == null ? void 0 : Kt.payload,
2740
2743
  {
@@ -2747,7 +2750,7 @@ function Ri(t) {
2747
2750
  tracks: rt
2748
2751
  };
2749
2752
  l.trackItemDetailsMap[B.id] = {
2750
- type: m,
2753
+ type: y,
2751
2754
  details: ct
2752
2755
  }, l.trackItemsMap[B.id] = B, l.trackItemIds.push(B.id), h = [B.id], l.trackItemsMap = {
2753
2756
  ...l.trackItemsMap,
@@ -2759,12 +2762,12 @@ function Ri(t) {
2759
2762
  ...l.trackItemDetailsMap,
2760
2763
  ...H,
2761
2764
  [B.id]: {
2762
- type: m,
2765
+ type: y,
2763
2766
  details: ct
2764
2767
  }
2765
2768
  }, l.structure = [...l.structure, ut];
2766
2769
  }
2767
- const D = xi(
2770
+ const x = xi(
2768
2771
  h,
2769
2772
  l.tracks,
2770
2773
  l.trackItemsMap,
@@ -2773,9 +2776,9 @@ function Ri(t) {
2773
2776
  );
2774
2777
  if (k) {
2775
2778
  const $ = Xe();
2776
- D.trackId = $;
2779
+ x.trackId = $;
2777
2780
  const H = {
2778
- id: D.trackId,
2781
+ id: x.trackId,
2779
2782
  accepts: [
2780
2783
  "text",
2781
2784
  "audio",
@@ -2785,18 +2788,18 @@ function Ri(t) {
2785
2788
  "caption",
2786
2789
  "template"
2787
2790
  ],
2788
- type: m,
2791
+ type: y,
2789
2792
  items: h,
2790
2793
  magnetic: !1,
2791
2794
  static: !1
2792
2795
  };
2793
- l.tracks.splice(D.trackIndex, 0, H);
2794
- } else if (D.trackId) {
2796
+ l.tracks.splice(x.trackIndex, 0, H);
2797
+ } else if (x.trackId) {
2795
2798
  const $ = l.tracks.find(
2796
- (H) => H.id === D.trackId
2799
+ (H) => H.id === x.trackId
2797
2800
  );
2798
2801
  $ && $.items.push(...h);
2799
- } else if (D.trackIndex !== void 0) {
2802
+ } else if (x.trackIndex !== void 0) {
2800
2803
  const $ = {
2801
2804
  id: Xe(),
2802
2805
  accepts: [
@@ -2808,12 +2811,12 @@ function Ri(t) {
2808
2811
  "caption",
2809
2812
  "template"
2810
2813
  ],
2811
- type: m,
2814
+ type: y,
2812
2815
  items: h,
2813
2816
  magnetic: !1,
2814
2817
  static: !1
2815
2818
  };
2816
- l.tracks.splice(D.trackIndex, 0, $);
2819
+ l.tracks.splice(x.trackIndex, 0, $);
2817
2820
  } else
2818
2821
  l.tracks.unshift({
2819
2822
  id: Xe(),
@@ -2826,7 +2829,7 @@ function Ri(t) {
2826
2829
  "caption",
2827
2830
  "template"
2828
2831
  ],
2829
- type: m,
2832
+ type: y,
2830
2833
  items: h,
2831
2834
  magnetic: !1,
2832
2835
  static: !1
@@ -2855,13 +2858,13 @@ function Ri(t) {
2855
2858
  const k = S.activeIds[0], h = K(S.trackItemsMap[k]);
2856
2859
  if (w >= h.display.to || w <= h.display.from)
2857
2860
  return;
2858
- const m = K(S.trackItemDetailsMap[k]), v = De(), I = K({
2861
+ const y = K(S.trackItemDetailsMap[k]), v = De(), I = K({
2859
2862
  ...h,
2860
2863
  display: {
2861
2864
  from: h.display.from,
2862
2865
  to: w
2863
2866
  }
2864
- }), D = K({
2867
+ }), x = K({
2865
2868
  ...h,
2866
2869
  id: v,
2867
2870
  display: {
@@ -2874,12 +2877,12 @@ function Ri(t) {
2874
2877
  I.trim = {
2875
2878
  from: h.trim.from,
2876
2879
  to: h.trim.from + g
2877
- }, D.trim = {
2880
+ }, x.trim = {
2878
2881
  from: h.trim.from + g,
2879
2882
  to: h.trim.to
2880
2883
  };
2881
2884
  }
2882
- S.trackItemsMap[k] = I, S.trackItemsMap[v] = D, S.trackItemIds.push(v), S.trackItemDetailsMap[v] = m, S.tracks.forEach((g) => {
2885
+ S.trackItemsMap[k] = I, S.trackItemsMap[v] = x, S.trackItemIds.push(v), S.trackItemDetailsMap[v] = y, S.tracks.forEach((g) => {
2883
2886
  g.items.includes(k) && g.items.push(v);
2884
2887
  }), t.updateState(
2885
2888
  {
@@ -2910,37 +2913,37 @@ function Ri(t) {
2910
2913
  S.tracks.find((I) => I.items.includes(v))
2911
2914
  );
2912
2915
  });
2913
- const m = /* @__PURE__ */ new Set();
2914
- k.filter((v) => m.has(v.id) ? !1 : (m.add(v), !0)), h.tracks = Array.from(m.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(h));
2916
+ const y = /* @__PURE__ */ new Set();
2917
+ k.filter((v) => y.has(v.id) ? !1 : (y.add(v), !0)), h.tracks = Array.from(y.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(h));
2915
2918
  }
2916
2919
  }
2917
2920
  if (u.key === ci) {
2918
2921
  const S = localStorage.getItem("DesignComboTemp");
2919
2922
  if (!S) return;
2920
- const w = K(t.getState()), k = JSON.parse(S), h = {}, m = k.trackItemsMap, v = k.trackItemDetailsMap, I = k.tracks, D = [], g = k.activeIds.map(async (O) => {
2921
- const x = v[O];
2922
- (x.type === "caption" || x.type === "text") && x.details.fontUrl && await br([
2923
+ const w = K(t.getState()), k = JSON.parse(S), h = {}, y = k.trackItemsMap, v = k.trackItemDetailsMap, I = k.tracks, x = [], g = k.activeIds.map(async (O) => {
2924
+ const D = v[O];
2925
+ (D.type === "caption" || D.type === "text") && D.details.fontUrl && await br([
2923
2926
  {
2924
- fontFamily: x.details.fontFamily,
2925
- url: x.details.fontUrl
2927
+ fontFamily: D.details.fontFamily,
2928
+ url: D.details.fontUrl
2926
2929
  }
2927
2930
  ]);
2928
2931
  const j = De();
2929
2932
  return h[O] = j, w.trackItemsMap[j] = {
2930
- ...m[O],
2933
+ ...y[O],
2931
2934
  id: j
2932
- }, w.trackItemDetailsMap[j] = x, w.trackItemIds.push(j), !0;
2935
+ }, w.trackItemDetailsMap[j] = D, w.trackItemIds.push(j), !0;
2933
2936
  });
2934
2937
  await Promise.all(g), I.forEach((O) => {
2935
- const x = O.items.map((L) => h[L]), j = {
2938
+ const D = O.items.map((L) => h[L]), j = {
2936
2939
  ...O,
2937
2940
  magnetic: !1,
2938
2941
  static: !1,
2939
- items: x,
2942
+ items: D,
2940
2943
  id: Xe()
2941
2944
  };
2942
- D.push(j);
2943
- }), w.tracks = [...D, ...w.tracks], t.updateState(
2945
+ x.push(j);
2946
+ }), w.tracks = [...x, ...w.tracks], t.updateState(
2944
2947
  {
2945
2948
  trackItemDetailsMap: w.trackItemDetailsMap,
2946
2949
  tracks: w.tracks,
@@ -2956,7 +2959,7 @@ function Ri(t) {
2956
2959
  }), C = d.subscribe(async (u) => {
2957
2960
  var l, S, w;
2958
2961
  if (u.key === ai) {
2959
- const k = K(t.getState()), h = k.trackItemDetailsMap, m = k.trackItemsMap, v = Object.keys((l = u.value) == null ? void 0 : l.payload);
2962
+ const k = K(t.getState()), h = k.trackItemDetailsMap, y = k.trackItemsMap, v = Object.keys((l = u.value) == null ? void 0 : l.payload);
2960
2963
  if (!v.length) return;
2961
2964
  const I = (S = u.value) == null ? void 0 : S.payload;
2962
2965
  v.forEach((g) => {
@@ -2966,32 +2969,31 @@ function Ri(t) {
2966
2969
  ...h[g].details,
2967
2970
  ...O.details
2968
2971
  }, O.details.colorMap) {
2969
- const x = m[g].details.initialSvgString, j = Wn(
2970
- x,
2972
+ const D = h[g].details.initialSvgString, j = Wn(
2973
+ D,
2971
2974
  O.details.colorMap
2972
2975
  );
2973
2976
  h[g].details.svgString = j;
2974
2977
  }
2975
- } else I[g].playbackRate && (m[g].playbackRate = I[g].playbackRate);
2976
- I[g].metadata && (m[g].metadata ? m[g].metadata = {
2977
- ...m[g].metadata,
2978
+ } else I[g].playbackRate && (y[g].playbackRate = I[g].playbackRate);
2979
+ I[g].metadata && (y[g].metadata ? y[g].metadata = {
2980
+ ...y[g].metadata,
2978
2981
  ...I[g].metadata
2979
- } : m[g].metadata = I[g].metadata), I[g].display && (m[g].display = I[g].display);
2982
+ } : y[g].metadata = I[g].metadata), I[g].display && (y[g].display = I[g].display);
2980
2983
  });
2981
2984
  for (const g of v) {
2982
- m[g].details.width = 500;
2983
2985
  const O = I[g];
2984
- if (m[g].type === "shape" && O.details.src) {
2985
- const x = await Oe(O.details.src);
2986
- h[g].details.width = x.width, h[g].details.height = x.height;
2986
+ if (y[g].type === "shape" && O.details.src) {
2987
+ const D = await Oe(O.details.src);
2988
+ h[g].details.width = D.width, h[g].details.height = D.height;
2987
2989
  }
2988
2990
  }
2989
- const D = he(m);
2991
+ const x = he(y);
2990
2992
  t.updateState(
2991
2993
  {
2992
2994
  trackItemDetailsMap: { ...h },
2993
- trackItemsMap: { ...m },
2994
- duration: D
2995
+ trackItemsMap: { ...y },
2996
+ duration: x
2995
2997
  },
2996
2998
  {
2997
2999
  updateHistory: !0,
@@ -3000,36 +3002,36 @@ function Ri(t) {
3000
3002
  );
3001
3003
  }
3002
3004
  if (u.key === oi) {
3003
- const k = (w = u.value) == null ? void 0 : w.payload, h = Object.keys(k)[0], m = Object.values(k)[0], v = K(t.getState()), I = v.trackItemDetailsMap[h], D = I.details;
3004
- if (m.details) {
3005
- if (m.type === "image" && m.details.src) {
3006
- const O = await Oe(m.details.src), x = I.details.width || 0, j = I.details.height || 0;
3005
+ const k = (w = u.value) == null ? void 0 : w.payload, h = Object.keys(k)[0], y = Object.values(k)[0], v = K(t.getState()), I = v.trackItemDetailsMap[h], x = I.details;
3006
+ if (y.details) {
3007
+ if (y.type === "image" && y.details.src) {
3008
+ const O = await Oe(y.details.src), D = I.details.width || 0, j = I.details.height || 0;
3007
3009
  let L = O.width, R = O.height;
3008
3010
  const F = O.width / O.height;
3009
- x / j > F ? (L = x, R = x / F) : (R = j, L = j * F), D.crop = {
3011
+ D / j > F ? (L = D, R = D / F) : (R = j, L = j * F), x.crop = {
3010
3012
  x: 0,
3011
3013
  y: 0,
3012
- height: D.height,
3013
- width: D.width
3014
- }, m.details.width = L, m.details.height = R;
3014
+ height: x.height,
3015
+ width: x.width
3016
+ }, y.details.width = L, y.details.height = R;
3015
3017
  }
3016
- if (m.type === "video" && m.details.src) {
3017
- const O = await _n(m.details.src), x = I.details.width || 0, j = I.details.height || 0;
3018
+ if (y.type === "video" && y.details.src) {
3019
+ const O = await _n(y.details.src), D = I.details.width || 0, j = I.details.height || 0;
3018
3020
  let L = O.width, R = O.height;
3019
3021
  const F = O.width / O.height;
3020
- x / j > F ? (L = x, R = x / F) : (R = j, L = j * F), D.crop = {
3022
+ D / j > F ? (L = D, R = D / F) : (R = j, L = j * F), x.crop = {
3021
3023
  x: 0,
3022
3024
  y: 0,
3023
- height: D.height,
3024
- width: D.width
3025
- }, m.details.width = L, m.details.height = R;
3025
+ height: x.height,
3026
+ width: x.width
3027
+ }, y.details.width = L, y.details.height = R;
3026
3028
  }
3027
- I.details = { ...D, ...m.details }, m.details = I.details;
3029
+ I.details = { ...x, ...y.details }, y.details = I.details;
3028
3030
  }
3029
- const g = { ...I, ...m };
3031
+ const g = { ...I, ...y };
3030
3032
  v.trackItemDetailsMap[h] = g, v.trackItemsMap[h] = {
3031
3033
  ...v.trackItemsMap[h],
3032
- type: m.type
3034
+ type: y.type
3033
3035
  }, t.updateState(
3034
3036
  {
3035
3037
  trackItemDetailsMap: {
@@ -3048,7 +3050,7 @@ function Ri(t) {
3048
3050
  });
3049
3051
  return {
3050
3052
  unsubscribe: () => {
3051
- y.unsubscribe(), T.unsubscribe(), C.unsubscribe(), _.unsubscribe(), E.unsubscribe(), b.unsubscribe(), M.unsubscribe();
3053
+ m.unsubscribe(), T.unsubscribe(), C.unsubscribe(), _.unsubscribe(), E.unsubscribe(), b.unsubscribe(), M.unsubscribe();
3052
3054
  }
3053
3055
  };
3054
3056
  }
@@ -3067,12 +3069,12 @@ function _s(t, e, r = { cyclesFix: !0 }, s = []) {
3067
3069
  });
3068
3070
  continue;
3069
3071
  }
3070
- const y = e[_], T = typeof M == "object" && typeof y == "object" && Array.isArray(M) === Array.isArray(y);
3071
- M && y && T && !zi[(b = (f = Object.getPrototypeOf(M)) == null ? void 0 : f.constructor) == null ? void 0 : b.name] && (!r.cyclesFix || !s.includes(M)) ? a.push.apply(a, _s(M, y, r, r.cyclesFix ? s.concat([M]) : []).map((C) => (C.path.unshift(E), C))) : M !== y && // treat NaN values as equivalent
3072
- !(Number.isNaN(M) && Number.isNaN(y)) && !(T && (isNaN(M) ? M + "" == y + "" : +M == +y)) && a.push({
3072
+ const m = e[_], T = typeof M == "object" && typeof m == "object" && Array.isArray(M) === Array.isArray(m);
3073
+ M && m && T && !zi[(b = (f = Object.getPrototypeOf(M)) == null ? void 0 : f.constructor) == null ? void 0 : b.name] && (!r.cyclesFix || !s.includes(M)) ? a.push.apply(a, _s(M, m, r, r.cyclesFix ? s.concat([M]) : []).map((C) => (C.path.unshift(E), C))) : M !== m && // treat NaN values as equivalent
3074
+ !(Number.isNaN(M) && Number.isNaN(m)) && !(T && (isNaN(M) ? M + "" == m + "" : +M == +m)) && a.push({
3073
3075
  path: [E],
3074
3076
  type: "CHANGE",
3075
- value: y,
3077
+ value: m,
3076
3078
  oldValue: M
3077
3079
  });
3078
3080
  }
@@ -3547,38 +3549,38 @@ function Ts(t) {
3547
3549
  function Zn() {
3548
3550
  process.env.NODE_ENV !== "production" && ks.push(
3549
3551
  'Sets cannot have "replace" patches.',
3550
- function(y) {
3551
- return "Unsupported patch operation: " + y;
3552
+ function(m) {
3553
+ return "Unsupported patch operation: " + m;
3552
3554
  },
3553
- function(y) {
3554
- return "Cannot apply patch, path doesn't resolve: " + y;
3555
+ function(m) {
3556
+ return "Cannot apply patch, path doesn't resolve: " + m;
3555
3557
  },
3556
3558
  "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
3557
3559
  );
3558
3560
  const e = "replace", r = "add", s = "remove";
3559
- function a(y, T, C, u) {
3560
- switch (y.type_) {
3561
+ function a(m, T, C, u) {
3562
+ switch (m.type_) {
3561
3563
  case 0:
3562
3564
  case 2:
3563
3565
  return d(
3564
- y,
3566
+ m,
3565
3567
  T,
3566
3568
  C,
3567
3569
  u
3568
3570
  );
3569
3571
  case 1:
3570
- return c(y, T, C, u);
3572
+ return c(m, T, C, u);
3571
3573
  case 3:
3572
3574
  return f(
3573
- y,
3575
+ m,
3574
3576
  T,
3575
3577
  C,
3576
3578
  u
3577
3579
  );
3578
3580
  }
3579
3581
  }
3580
- function c(y, T, C, u) {
3581
- let { base_: l, assigned_: S } = y, w = y.copy_;
3582
+ function c(m, T, C, u) {
3583
+ let { base_: l, assigned_: S } = m, w = m.copy_;
3582
3584
  w.length < l.length && ([l, w] = [w, l], [C, u] = [u, C]);
3583
3585
  for (let k = 0; k < l.length; k++)
3584
3586
  if (S[k] && w[k] !== l[k]) {
@@ -3613,20 +3615,20 @@ function Zn() {
3613
3615
  });
3614
3616
  }
3615
3617
  }
3616
- function d(y, T, C, u) {
3617
- const { base_: l, copy_: S } = y;
3618
- Ve(y.assigned_, (w, k) => {
3619
- const h = fn(l, w), m = fn(S, w), v = k ? qe(l, w) ? e : r : s;
3620
- if (h === m && v === e)
3618
+ function d(m, T, C, u) {
3619
+ const { base_: l, copy_: S } = m;
3620
+ Ve(m.assigned_, (w, k) => {
3621
+ const h = fn(l, w), y = fn(S, w), v = k ? qe(l, w) ? e : r : s;
3622
+ if (h === y && v === e)
3621
3623
  return;
3622
3624
  const I = T.concat(w);
3623
- C.push(v === s ? { op: v, path: I } : { op: v, path: I, value: m }), u.push(
3625
+ C.push(v === s ? { op: v, path: I } : { op: v, path: I, value: y }), u.push(
3624
3626
  v === r ? { op: s, path: I } : v === s ? { op: r, path: I, value: E(h) } : { op: e, path: I, value: E(h) }
3625
3627
  );
3626
3628
  });
3627
3629
  }
3628
- function f(y, T, C, u) {
3629
- let { base_: l, copy_: S } = y, w = 0;
3630
+ function f(m, T, C, u) {
3631
+ let { base_: l, copy_: S } = m, w = 0;
3630
3632
  l.forEach((k) => {
3631
3633
  if (!S.has(k)) {
3632
3634
  const h = T.concat([w]);
@@ -3657,7 +3659,7 @@ function Zn() {
3657
3659
  w++;
3658
3660
  });
3659
3661
  }
3660
- function b(y, T, C, u) {
3662
+ function b(m, T, C, u) {
3661
3663
  C.push({
3662
3664
  op: e,
3663
3665
  path: [],
@@ -3665,16 +3667,16 @@ function Zn() {
3665
3667
  }), u.push({
3666
3668
  op: e,
3667
3669
  path: [],
3668
- value: y
3670
+ value: m
3669
3671
  });
3670
3672
  }
3671
- function _(y, T) {
3673
+ function _(m, T) {
3672
3674
  return T.forEach((C) => {
3673
3675
  const { path: u, op: l } = C;
3674
- let S = y;
3675
- for (let m = 0; m < u.length - 1; m++) {
3676
+ let S = m;
3677
+ for (let y = 0; y < u.length - 1; y++) {
3676
3678
  const v = ge(S);
3677
- let I = u[m];
3679
+ let I = u[y];
3678
3680
  typeof I != "string" && typeof I != "number" && (I = "" + I), (v === 0 || v === 1) && (I === "__proto__" || I === "constructor") && tt(19), typeof S == "function" && I === "prototype" && tt(19), S = fn(S, I), typeof S != "object" && tt(18, u.join("/"));
3679
3681
  }
3680
3682
  const w = ge(S), k = M(C.value), h = u[u.length - 1];
@@ -3713,26 +3715,26 @@ function Zn() {
3713
3715
  default:
3714
3716
  tt(17, l);
3715
3717
  }
3716
- }), y;
3717
- }
3718
- function M(y) {
3719
- if (!Qt(y))
3720
- return y;
3721
- if (Array.isArray(y))
3722
- return y.map(M);
3723
- if (tr(y))
3718
+ }), m;
3719
+ }
3720
+ function M(m) {
3721
+ if (!Qt(m))
3722
+ return m;
3723
+ if (Array.isArray(m))
3724
+ return m.map(M);
3725
+ if (tr(m))
3724
3726
  return new Map(
3725
- Array.from(y.entries()).map(([C, u]) => [C, M(u)])
3727
+ Array.from(m.entries()).map(([C, u]) => [C, M(u)])
3726
3728
  );
3727
- if (er(y))
3728
- return new Set(Array.from(y).map(M));
3729
- const T = Object.create(me(y));
3730
- for (const C in y)
3731
- T[C] = M(y[C]);
3732
- return qe(y, Ke) && (T[Ke] = y[Ke]), T;
3729
+ if (er(m))
3730
+ return new Set(Array.from(m).map(M));
3731
+ const T = Object.create(me(m));
3732
+ for (const C in m)
3733
+ T[C] = M(m[C]);
3734
+ return qe(m, Ke) && (T[Ke] = m[Ke]), T;
3733
3735
  }
3734
- function E(y) {
3735
- return ye(y) ? M(y) : y;
3736
+ function E(m) {
3737
+ return ye(m) ? M(m) : m;
3736
3738
  }
3737
3739
  ji("Patches", {
3738
3740
  applyPatches_: _,
@@ -4059,7 +4061,7 @@ class eo {
4059
4061
  transitionsMap: b,
4060
4062
  trackItemsMap: _,
4061
4063
  structure: M
4062
- }), y = [], T = [], C = [], u = [], l = [], S = [], w = [];
4064
+ }), m = [], T = [], C = [], u = [], l = [], S = [], w = [];
4063
4065
  r.forEach((R) => {
4064
4066
  let F;
4065
4067
  const V = R.path.slice(1);
@@ -4075,15 +4077,15 @@ class eo {
4075
4077
  path: V,
4076
4078
  op: "add",
4077
4079
  value: R.oldValue
4078
- }, R.path.includes("trackItemIds") ? C.push(F) : R.path.includes("transitionIds") ? T.push(F) : R.path.includes("trackItemsMap") ? l.push(F) : R.path.includes("transitionsMap") ? u.push(F) : R.path.includes("tracks") ? y.push(F) : R.path.includes("trackItemDetailsMap") ? S.push(F) : R.path.includes("structure") && w.push(F);
4080
+ }, R.path.includes("trackItemIds") ? C.push(F) : R.path.includes("transitionIds") ? T.push(F) : R.path.includes("trackItemsMap") ? l.push(F) : R.path.includes("transitionsMap") ? u.push(F) : R.path.includes("tracks") ? m.push(F) : R.path.includes("trackItemDetailsMap") ? S.push(F) : R.path.includes("structure") && w.push(F);
4079
4081
  });
4080
4082
  const k = this.applyPatch(
4081
4083
  E.tracks,
4082
- y
4084
+ m
4083
4085
  ), h = this.applyPatch(
4084
4086
  E.transitionIds,
4085
4087
  T
4086
- ), m = this.applyPatch(
4088
+ ), y = this.applyPatch(
4087
4089
  E.trackItemIds,
4088
4090
  C
4089
4091
  ), v = this.applyPatch(
@@ -4092,7 +4094,7 @@ class eo {
4092
4094
  ), I = this.applyPatch(
4093
4095
  E.trackItemsMap,
4094
4096
  l
4095
- ), D = this.applyPatch(
4097
+ ), x = this.applyPatch(
4096
4098
  E.trackItemDetailsMap,
4097
4099
  S
4098
4100
  ), g = this.applyPatch(
@@ -4101,13 +4103,13 @@ class eo {
4101
4103
  ), O = K({
4102
4104
  tracks: k,
4103
4105
  transitionIds: h,
4104
- trackItemIds: m,
4106
+ trackItemIds: y,
4105
4107
  transitionsMap: v,
4106
4108
  trackItemsMap: I,
4107
- trackItemDetailsMap: D,
4109
+ trackItemDetailsMap: x,
4108
4110
  structure: g
4109
- }), x = K(this.getState()), j = { ...x, ...O };
4110
- this.prevState = x, this.redos.push({ redos: r, type: s });
4111
+ }), D = K(this.getState()), j = { ...D, ...O };
4112
+ this.prevState = D, this.redos.push({ redos: r, type: s });
4111
4113
  const L = he(j.trackItemsMap);
4112
4114
  this.stateSubject.next({ ...j, duration: L }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 }), this.updateState(j, { updateHistory: !1 });
4113
4115
  }
@@ -4136,7 +4138,7 @@ class eo {
4136
4138
  transitionsMap: b,
4137
4139
  trackItemsMap: _,
4138
4140
  structure: M
4139
- }), y = [], T = [], C = [], u = [], l = [], S = [], w = [];
4141
+ }), m = [], T = [], C = [], u = [], l = [], S = [], w = [];
4140
4142
  r.forEach((R) => {
4141
4143
  let F;
4142
4144
  const V = R.path.slice(1);
@@ -4152,15 +4154,15 @@ class eo {
4152
4154
  path: V,
4153
4155
  op: "remove",
4154
4156
  value: R.oldValue
4155
- }, R.path.includes("trackItemIds") ? C.push(F) : R.path.includes("transitionIds") ? T.push(F) : R.path.includes("trackItemsMap") ? l.push(F) : R.path.includes("transitionsMap") ? u.push(F) : R.path.includes("trackItemDetailsMap") ? S.push(F) : R.path.includes("structure") ? w.push(F) : y.push(F);
4157
+ }, R.path.includes("trackItemIds") ? C.push(F) : R.path.includes("transitionIds") ? T.push(F) : R.path.includes("trackItemsMap") ? l.push(F) : R.path.includes("transitionsMap") ? u.push(F) : R.path.includes("trackItemDetailsMap") ? S.push(F) : R.path.includes("structure") ? w.push(F) : m.push(F);
4156
4158
  });
4157
4159
  const k = this.applyPatch(
4158
4160
  E.tracks,
4159
- y
4161
+ m
4160
4162
  ), h = this.applyPatch(
4161
4163
  E.transitionIds,
4162
4164
  T
4163
- ), m = this.applyPatch(
4165
+ ), y = this.applyPatch(
4164
4166
  E.trackItemIds,
4165
4167
  C
4166
4168
  ), v = this.applyPatch(
@@ -4169,7 +4171,7 @@ class eo {
4169
4171
  ), I = this.applyPatch(
4170
4172
  E.trackItemsMap,
4171
4173
  l
4172
- ), D = this.applyPatch(
4174
+ ), x = this.applyPatch(
4173
4175
  E.trackItemDetailsMap,
4174
4176
  S
4175
4177
  ), g = this.applyPatch(
@@ -4178,13 +4180,13 @@ class eo {
4178
4180
  ), O = K({
4179
4181
  tracks: k,
4180
4182
  transitionIds: h,
4181
- trackItemIds: m,
4183
+ trackItemIds: y,
4182
4184
  transitionsMap: v,
4183
4185
  trackItemsMap: I,
4184
- trackItemDetailsMap: D,
4186
+ trackItemDetailsMap: x,
4185
4187
  structure: g
4186
- }), x = K(this.getState()), j = { ...x, ...O };
4187
- this.prevState = x, this.undos.push({ undos: r, type: s });
4188
+ }), D = K(this.getState()), j = { ...D, ...O };
4189
+ this.prevState = D, this.undos.push({ undos: r, type: s });
4188
4190
  const L = he(j.trackItemsMap);
4189
4191
  this.stateSubject.next({ ...j, duration: L }), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 }), this.updateState(j, { updateHistory: !1 });
4190
4192
  }