@designcombo/state 0.1.21 → 0.1.23

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -112,7 +112,7 @@ var tr = function() {
112
112
  if (H) {
113
113
  this._finalizers = null;
114
114
  try {
115
- for (var b = an(H), p = b.next(); !p.done; p = b.next()) {
115
+ for (var m = an(H), p = m.next(); !p.done; p = m.next()) {
116
116
  var h = p.value;
117
117
  try {
118
118
  kn(h);
@@ -124,7 +124,7 @@ var tr = function() {
124
124
  i = { error: l };
125
125
  } finally {
126
126
  try {
127
- p && !p.done && (s = b.return) && s.call(b);
127
+ p && !p.done && (s = m.return) && s.call(m);
128
128
  } finally {
129
129
  if (i) throw i.error;
130
130
  }
@@ -513,8 +513,8 @@ function bn(t) {
513
513
  var qe = { exports: {} };
514
514
  qe.exports;
515
515
  (function(t, r) {
516
- var n = 200, i = "__lodash_hash_undefined__", s = 1, c = 2, f = 9007199254740991, d = "[object Arguments]", x = "[object Array]", F = "[object AsyncFunction]", k = "[object Boolean]", H = "[object Date]", b = "[object Error]", p = "[object Function]", h = "[object GeneratorFunction]", l = "[object Map]", g = "[object Number]", v = "[object Null]", _ = "[object Object]", y = "[object Promise]", m = "[object Proxy]", j = "[object RegExp]", E = "[object Set]", I = "[object String]", P = "[object Symbol]", S = "[object Undefined]", T = "[object WeakMap]", A = "[object ArrayBuffer]", M = "[object DataView]", $ = "[object Float32Array]", bt = "[object Float64Array]", Ie = "[object Int8Array]", ir = "[object Int16Array]", ar = "[object Int32Array]", sr = "[object Uint8Array]", or = "[object Uint8ClampedArray]", z = "[object Uint16Array]", cr = "[object Uint32Array]", ur = /[\\^$.*+?()[\]{}|]/g, it = /^\[object .+?Constructor\]$/, Se = /^(?:0|[1-9]\d*)$/, N = {};
517
- N[$] = N[bt] = N[Ie] = N[ir] = N[ar] = N[sr] = N[or] = N[z] = N[cr] = !0, N[d] = N[x] = N[A] = N[k] = N[M] = N[H] = N[b] = N[p] = N[l] = N[g] = N[_] = N[j] = N[E] = N[I] = N[T] = !1;
516
+ var n = 200, i = "__lodash_hash_undefined__", s = 1, c = 2, f = 9007199254740991, d = "[object Arguments]", x = "[object Array]", F = "[object AsyncFunction]", k = "[object Boolean]", H = "[object Date]", m = "[object Error]", p = "[object Function]", h = "[object GeneratorFunction]", l = "[object Map]", b = "[object Number]", v = "[object Null]", _ = "[object Object]", y = "[object Promise]", g = "[object Proxy]", j = "[object RegExp]", O = "[object Set]", I = "[object String]", P = "[object Symbol]", S = "[object Undefined]", T = "[object WeakMap]", E = "[object ArrayBuffer]", M = "[object DataView]", $ = "[object Float32Array]", bt = "[object Float64Array]", Ie = "[object Int8Array]", ir = "[object Int16Array]", ar = "[object Int32Array]", sr = "[object Uint8Array]", or = "[object Uint8ClampedArray]", z = "[object Uint16Array]", cr = "[object Uint32Array]", ur = /[\\^$.*+?()[\]{}|]/g, it = /^\[object .+?Constructor\]$/, Se = /^(?:0|[1-9]\d*)$/, N = {};
517
+ N[$] = N[bt] = N[Ie] = N[ir] = N[ar] = N[sr] = N[or] = N[z] = N[cr] = !0, N[d] = N[x] = N[E] = N[k] = N[M] = N[H] = N[m] = N[p] = N[l] = N[b] = N[_] = N[j] = N[O] = N[I] = N[T] = !1;
518
518
  var we = typeof nt == "object" && nt && nt.Object === Object && nt, lr = typeof self == "object" && self && self.Object === Object && self, at = we || lr || Function("return this")(), Te = r && !r.nodeType && r, ke = Te && !0 && t && !t.nodeType && t, Yt = ke && ke.exports === Te, Vt = Yt && we.process, Ee = function() {
519
519
  try {
520
520
  return Vt && Vt.binding && Vt.binding("util");
@@ -522,15 +522,15 @@ qe.exports;
522
522
  }
523
523
  }(), Xt = Ee && Ee.isTypedArray;
524
524
  function Ae(e, a) {
525
- for (var o = -1, u = e == null ? 0 : e.length, O = 0, w = []; ++o < u; ) {
525
+ for (var o = -1, u = e == null ? 0 : e.length, A = 0, w = []; ++o < u; ) {
526
526
  var C = e[o];
527
- a(C, o, e) && (w[O++] = C);
527
+ a(C, o, e) && (w[A++] = C);
528
528
  }
529
529
  return w;
530
530
  }
531
531
  function qt(e, a) {
532
- for (var o = -1, u = a.length, O = e.length; ++o < u; )
533
- e[O + o] = a[o];
532
+ for (var o = -1, u = a.length, A = e.length; ++o < u; )
533
+ e[A + o] = a[o];
534
534
  return e;
535
535
  }
536
536
  function Oe(e, a) {
@@ -557,8 +557,8 @@ qe.exports;
557
557
  }
558
558
  function xe(e) {
559
559
  var a = -1, o = Array(e.size);
560
- return e.forEach(function(u, O) {
561
- o[++a] = [O, u];
560
+ return e.forEach(function(u, A) {
561
+ o[++a] = [A, u];
562
562
  }), o;
563
563
  }
564
564
  function Me(e, a) {
@@ -708,11 +708,11 @@ qe.exports;
708
708
  }
709
709
  ut.prototype.clear = se, ut.prototype.delete = Cr, ut.prototype.get = jr, ut.prototype.has = Rr, ut.prototype.set = Fr;
710
710
  function zr(e, a) {
711
- var o = Wt(e), u = !o && Le(e), O = !o && !u && Bt(e), w = !o && !u && !O && Be(e), C = o || u || O || w, D = C ? fr(e.length, String) : [], U = D.length;
711
+ var o = Wt(e), u = !o && Le(e), A = !o && !u && Bt(e), w = !o && !u && !A && Be(e), C = o || u || A || w, D = C ? fr(e.length, String) : [], U = D.length;
712
712
  for (var R in e)
713
713
  et.call(e, R) && !(C && // Safari 9 has enumerable `arguments.length` in strict mode.
714
714
  (R == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
715
- O && (R == "offset" || R == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
715
+ A && (R == "offset" || R == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
716
716
  w && (R == "buffer" || R == "byteLength" || R == "byteOffset") || // Skip index properties.
717
717
  $r(R, U))) && D.push(R);
718
718
  return D;
@@ -733,10 +733,10 @@ qe.exports;
733
733
  function ze(e) {
734
734
  return ft(e) && kt(e) == d;
735
735
  }
736
- function Ne(e, a, o, u, O) {
737
- return e === a ? !0 : e == null || a == null || !ft(e) && !ft(a) ? e !== e && a !== a : Nr(e, a, o, u, Ne, O);
736
+ function Ne(e, a, o, u, A) {
737
+ return e === a ? !0 : e == null || a == null || !ft(e) && !ft(a) ? e !== e && a !== a : Nr(e, a, o, u, Ne, A);
738
738
  }
739
- function Nr(e, a, o, u, O, w) {
739
+ function Nr(e, a, o, u, A, w) {
740
740
  var C = Wt(e), D = Wt(a), U = C ? x : lt(e), R = D ? x : lt(a);
741
741
  U = U == d ? _ : U, R = R == d ? _ : R;
742
742
  var Y = U == _, J = R == _, L = U == R;
@@ -746,15 +746,15 @@ qe.exports;
746
746
  C = !0, Y = !1;
747
747
  }
748
748
  if (L && !Y)
749
- return w || (w = new ut()), C || Be(e) ? ce(e, a, o, u, O, w) : Gr(e, a, U, o, u, O, w);
749
+ return w || (w = new ut()), C || Be(e) ? ce(e, a, o, u, A, w) : Gr(e, a, U, o, u, A, w);
750
750
  if (!(o & s)) {
751
751
  var V = Y && et.call(e, "__wrapped__"), B = J && et.call(a, "__wrapped__");
752
752
  if (V || B) {
753
753
  var _t = V ? e.value() : e, yt = B ? a.value() : a;
754
- return w || (w = new ut()), O(_t, yt, o, u, w);
754
+ return w || (w = new ut()), A(_t, yt, o, u, w);
755
755
  }
756
756
  }
757
- return L ? (w || (w = new ut()), Wr(e, a, o, u, O, w)) : !1;
757
+ return L ? (w || (w = new ut()), Wr(e, a, o, u, A, w)) : !1;
758
758
  }
759
759
  function Hr(e) {
760
760
  if (!We(e) || Yr(e))
@@ -773,7 +773,7 @@ qe.exports;
773
773
  et.call(e, o) && o != "constructor" && a.push(o);
774
774
  return a;
775
775
  }
776
- function ce(e, a, o, u, O, w) {
776
+ function ce(e, a, o, u, A, w) {
777
777
  var C = o & s, D = e.length, U = a.length;
778
778
  if (D != U && !(C && U > D))
779
779
  return !1;
@@ -793,39 +793,39 @@ qe.exports;
793
793
  }
794
794
  if (L) {
795
795
  if (!Oe(a, function(yt, At) {
796
- if (!jt(L, At) && (V === yt || O(V, yt, o, u, w)))
796
+ if (!jt(L, At) && (V === yt || A(V, yt, o, u, w)))
797
797
  return L.push(At);
798
798
  })) {
799
799
  J = !1;
800
800
  break;
801
801
  }
802
- } else if (!(V === B || O(V, B, o, u, w))) {
802
+ } else if (!(V === B || A(V, B, o, u, w))) {
803
803
  J = !1;
804
804
  break;
805
805
  }
806
806
  }
807
807
  return w.delete(e), w.delete(a), J;
808
808
  }
809
- function Gr(e, a, o, u, O, w, C) {
809
+ function Gr(e, a, o, u, A, w, C) {
810
810
  switch (o) {
811
811
  case M:
812
812
  if (e.byteLength != a.byteLength || e.byteOffset != a.byteOffset)
813
813
  return !1;
814
814
  e = e.buffer, a = a.buffer;
815
- case A:
815
+ case E:
816
816
  return !(e.byteLength != a.byteLength || !w(new Ce(e), new Ce(a)));
817
817
  case k:
818
818
  case H:
819
- case g:
820
- return Ue(+e, +a);
821
819
  case b:
820
+ return Ue(+e, +a);
821
+ case m:
822
822
  return e.name == a.name && e.message == a.message;
823
823
  case j:
824
824
  case I:
825
825
  return e == a + "";
826
826
  case l:
827
827
  var D = xe;
828
- case E:
828
+ case O:
829
829
  var U = u & s;
830
830
  if (D || (D = ct), e.size != a.size && !U)
831
831
  return !1;
@@ -833,7 +833,7 @@ qe.exports;
833
833
  if (R)
834
834
  return R == a;
835
835
  u |= c, C.set(e, a);
836
- var Y = ce(D(e), D(a), u, O, w, C);
836
+ var Y = ce(D(e), D(a), u, A, w, C);
837
837
  return C.delete(e), Y;
838
838
  case P:
839
839
  if (ae)
@@ -841,7 +841,7 @@ qe.exports;
841
841
  }
842
842
  return !1;
843
843
  }
844
- function Wr(e, a, o, u, O, w) {
844
+ function Wr(e, a, o, u, A, w) {
845
845
  var C = o & s, D = Et(e), U = D.length, R = Et(a), Y = R.length;
846
846
  if (U != Y && !C)
847
847
  return !1;
@@ -860,7 +860,7 @@ qe.exports;
860
860
  var yt = e[L], At = a[L];
861
861
  if (u)
862
862
  var Tn = C ? u(At, yt, L, a, e, w) : u(yt, At, L, e, a, w);
863
- if (!(Tn === void 0 ? yt === At || O(yt, At, o, u, w) : Tn)) {
863
+ if (!(Tn === void 0 ? yt === At || A(yt, At, o, u, w) : Tn)) {
864
864
  B = !1;
865
865
  break;
866
866
  }
@@ -890,15 +890,15 @@ qe.exports;
890
890
  var u = !0;
891
891
  } catch {
892
892
  }
893
- var O = De.call(e);
894
- return u && (a ? e[st] = o : delete e[st]), O;
893
+ var A = De.call(e);
894
+ return u && (a ? e[st] = o : delete e[st]), A;
895
895
  }
896
896
  var Br = Ht ? function(e) {
897
897
  return e == null ? [] : (e = Object(e), Ae(Ht(e), function(a) {
898
898
  return Nt.call(e, a);
899
899
  }));
900
900
  } : qr, lt = kt;
901
- (ee && lt(new ee(new ArrayBuffer(1))) != M || Tt && lt(new Tt()) != l || re && lt(re.resolve()) != y || ne && lt(new ne()) != E || ie && lt(new ie()) != T) && (lt = function(e) {
901
+ (ee && lt(new ee(new ArrayBuffer(1))) != M || Tt && lt(new Tt()) != l || re && lt(re.resolve()) != y || ne && lt(new ne()) != O || ie && lt(new ie()) != T) && (lt = function(e) {
902
902
  var a = kt(e), o = a == _ ? e.constructor : void 0, u = o ? X(o) : "";
903
903
  if (u)
904
904
  switch (u) {
@@ -909,7 +909,7 @@ qe.exports;
909
909
  case yr:
910
910
  return y;
911
911
  case mr:
912
- return E;
912
+ return O;
913
913
  case br:
914
914
  return T;
915
915
  }
@@ -964,7 +964,7 @@ qe.exports;
964
964
  if (!We(e))
965
965
  return !1;
966
966
  var a = kt(e);
967
- return a == p || a == h || a == F || a == m;
967
+ return a == p || a == h || a == F || a == g;
968
968
  }
969
969
  function le(e) {
970
970
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= f;
@@ -993,8 +993,8 @@ const rt = /* @__PURE__ */ bn(Bi);
993
993
  var Je = { exports: {} };
994
994
  Je.exports;
995
995
  (function(t, r) {
996
- var n = 200, i = "__lodash_hash_undefined__", s = 9007199254740991, c = "[object Arguments]", f = "[object Array]", d = "[object Boolean]", x = "[object Date]", F = "[object Error]", k = "[object Function]", H = "[object GeneratorFunction]", b = "[object Map]", p = "[object Number]", h = "[object Object]", l = "[object Promise]", g = "[object RegExp]", v = "[object Set]", _ = "[object String]", y = "[object Symbol]", m = "[object WeakMap]", j = "[object ArrayBuffer]", E = "[object DataView]", I = "[object Float32Array]", P = "[object Float64Array]", S = "[object Int8Array]", T = "[object Int16Array]", A = "[object Int32Array]", M = "[object Uint8Array]", $ = "[object Uint8ClampedArray]", bt = "[object Uint16Array]", Ie = "[object Uint32Array]", ir = /[\\^$.*+?()[\]{}|]/g, ar = /\w*$/, sr = /^\[object .+?Constructor\]$/, or = /^(?:0|[1-9]\d*)$/, z = {};
997
- z[c] = z[f] = z[j] = z[E] = z[d] = z[x] = z[I] = z[P] = z[S] = z[T] = z[A] = z[b] = z[p] = z[h] = z[g] = z[v] = z[_] = z[y] = z[M] = z[$] = z[bt] = z[Ie] = !0, z[F] = z[k] = z[m] = !1;
996
+ var n = 200, i = "__lodash_hash_undefined__", s = 9007199254740991, c = "[object Arguments]", f = "[object Array]", d = "[object Boolean]", x = "[object Date]", F = "[object Error]", k = "[object Function]", H = "[object GeneratorFunction]", m = "[object Map]", p = "[object Number]", h = "[object Object]", l = "[object Promise]", b = "[object RegExp]", v = "[object Set]", _ = "[object String]", y = "[object Symbol]", g = "[object WeakMap]", j = "[object ArrayBuffer]", O = "[object DataView]", I = "[object Float32Array]", P = "[object Float64Array]", S = "[object Int8Array]", T = "[object Int16Array]", E = "[object Int32Array]", M = "[object Uint8Array]", $ = "[object Uint8ClampedArray]", bt = "[object Uint16Array]", Ie = "[object Uint32Array]", ir = /[\\^$.*+?()[\]{}|]/g, ar = /\w*$/, sr = /^\[object .+?Constructor\]$/, or = /^(?:0|[1-9]\d*)$/, z = {};
997
+ z[c] = z[f] = z[j] = z[O] = z[d] = z[x] = z[I] = z[P] = z[S] = z[T] = z[E] = z[m] = z[p] = z[h] = z[b] = z[v] = z[_] = z[y] = z[M] = z[$] = z[bt] = z[Ie] = !0, z[F] = z[k] = z[g] = !1;
998
998
  var cr = typeof nt == "object" && nt && nt.Object === Object && nt, ur = typeof self == "object" && self && self.Object === Object && self, it = cr || ur || Function("return this")(), Se = r && !r.nodeType && r, N = Se && !0 && t && !t.nodeType && t, we = N && N.exports === Se;
999
999
  function lr(e, a) {
1000
1000
  return e.set(a[0], a[1]), e;
@@ -1008,13 +1008,13 @@ Je.exports;
1008
1008
  return e;
1009
1009
  }
1010
1010
  function ke(e, a) {
1011
- for (var o = -1, u = a.length, O = e.length; ++o < u; )
1012
- e[O + o] = a[o];
1011
+ for (var o = -1, u = a.length, A = e.length; ++o < u; )
1012
+ e[A + o] = a[o];
1013
1013
  return e;
1014
1014
  }
1015
1015
  function Yt(e, a, o, u) {
1016
- for (var O = -1, w = e ? e.length : 0; ++O < w; )
1017
- o = a(o, e[O], O, e);
1016
+ for (var A = -1, w = e ? e.length : 0; ++A < w; )
1017
+ o = a(o, e[A], A, e);
1018
1018
  return o;
1019
1019
  }
1020
1020
  function Vt(e, a) {
@@ -1036,8 +1036,8 @@ Je.exports;
1036
1036
  }
1037
1037
  function Ae(e) {
1038
1038
  var a = -1, o = Array(e.size);
1039
- return e.forEach(function(u, O) {
1040
- o[++a] = [O, u];
1039
+ return e.forEach(function(u, A) {
1040
+ o[++a] = [A, u];
1041
1041
  }), o;
1042
1042
  }
1043
1043
  function qt(e, a) {
@@ -1170,9 +1170,9 @@ Je.exports;
1170
1170
  }
1171
1171
  q.prototype.clear = Or, q.prototype.delete = xr, q.prototype.get = Mr, q.prototype.has = Pr, q.prototype.set = Dr;
1172
1172
  function Ut(e, a) {
1173
- var o = ue(e) || Wt(e) ? Vt(e.length, String) : [], u = o.length, O = !!u;
1173
+ var o = ue(e) || Wt(e) ? Vt(e.length, String) : [], u = o.length, A = !!u;
1174
1174
  for (var w in e)
1175
- ct.call(e, w) && !(O && (w == "length" || Kr(w, u))) && o.push(w);
1175
+ ct.call(e, w) && !(A && (w == "length" || Kr(w, u))) && o.push(w);
1176
1176
  return o;
1177
1177
  }
1178
1178
  function Fe(e, a, o) {
@@ -1188,9 +1188,9 @@ Je.exports;
1188
1188
  function ut(e, a) {
1189
1189
  return e && ce(a, fe(a), e);
1190
1190
  }
1191
- function se(e, a, o, u, O, w, C) {
1191
+ function se(e, a, o, u, A, w, C) {
1192
1192
  var D;
1193
- if (u && (D = w ? u(e, O, w, C) : u(e)), D !== void 0)
1193
+ if (u && (D = w ? u(e, A, w, C) : u(e)), D !== void 0)
1194
1194
  return D;
1195
1195
  if (!ft(e))
1196
1196
  return e;
@@ -1288,8 +1288,8 @@ Je.exports;
1288
1288
  }
1289
1289
  function ce(e, a, o, u) {
1290
1290
  o || (o = {});
1291
- for (var O = -1, w = a.length; ++O < w; ) {
1292
- var C = a[O], D = void 0;
1291
+ for (var A = -1, w = a.length; ++A < w; ) {
1292
+ var C = a[A], D = void 0;
1293
1293
  Fe(o, C, D === void 0 ? e[C] : D);
1294
1294
  }
1295
1295
  return o;
@@ -1309,20 +1309,20 @@ Je.exports;
1309
1309
  return Fr(o) ? o : void 0;
1310
1310
  }
1311
1311
  var dt = Qt ? qt(Qt, Object) : qr, ht = Rr;
1312
- (Nt && ht(new Nt(new ArrayBuffer(1))) != E || St && ht(new St()) != b || st && ht(st.resolve()) != l || Ht && ht(new Ht()) != v || te && ht(new te()) != m) && (ht = function(e) {
1312
+ (Nt && ht(new Nt(new ArrayBuffer(1))) != O || St && ht(new St()) != m || st && ht(st.resolve()) != l || Ht && ht(new Ht()) != v || te && ht(new te()) != g) && (ht = function(e) {
1313
1313
  var a = Rt.call(e), o = a == h ? e.constructor : void 0, u = o ? X(o) : void 0;
1314
1314
  if (u)
1315
1315
  switch (u) {
1316
1316
  case ee:
1317
- return E;
1317
+ return O;
1318
1318
  case Tt:
1319
- return b;
1319
+ return m;
1320
1320
  case re:
1321
1321
  return l;
1322
1322
  case ne:
1323
1323
  return v;
1324
1324
  case ie:
1325
- return m;
1325
+ return g;
1326
1326
  }
1327
1327
  return a;
1328
1328
  });
@@ -1334,31 +1334,31 @@ Je.exports;
1334
1334
  return typeof e.constructor == "function" && !He(e) ? Cr(et(e)) : {};
1335
1335
  }
1336
1336
  function $r(e, a, o, u) {
1337
- var O = e.constructor;
1337
+ var A = e.constructor;
1338
1338
  switch (a) {
1339
1339
  case j:
1340
1340
  return oe(e);
1341
1341
  case d:
1342
1342
  case x:
1343
- return new O(+e);
1344
- case E:
1343
+ return new A(+e);
1344
+ case O:
1345
1345
  return kt(e, u);
1346
1346
  case I:
1347
1347
  case P:
1348
1348
  case S:
1349
1349
  case T:
1350
- case A:
1350
+ case E:
1351
1351
  case M:
1352
1352
  case $:
1353
1353
  case bt:
1354
1354
  case Ie:
1355
1355
  return Ur(e, u);
1356
- case b:
1356
+ case m:
1357
1357
  return ze(e, u, o);
1358
1358
  case p:
1359
1359
  case _:
1360
- return new O(e);
1361
- case g:
1360
+ return new A(e);
1361
+ case b:
1362
1362
  return Ne(e);
1363
1363
  case v:
1364
1364
  return Nr(e, u, o);
@@ -1741,10 +1741,12 @@ let ln = (t = 21) => {
1741
1741
  return r;
1742
1742
  };
1743
1743
  function qi(t, r) {
1744
- return t.filter((i) => ({
1745
- ...i,
1746
- items: i.items.filter((s) => !r.includes(s))
1747
- })).filter((i) => !i.items.length);
1744
+ return t.filter((i) => {
1745
+ if (r.forEach((s) => {
1746
+ i.items.includes(s) && (i.items = i.items.filter((c) => c !== s));
1747
+ }), i.items.length !== 0)
1748
+ return i;
1749
+ });
1748
1750
  }
1749
1751
  function Fn(t = 16) {
1750
1752
  const r = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n = r.charAt(Math.floor(Math.random() * r.length));
@@ -1771,25 +1773,25 @@ function Ji(t) {
1771
1773
  ), d = r.subscribe(async (p) => {
1772
1774
  var h, l;
1773
1775
  if (p.key === _i) {
1774
- const g = Z(t.getState()), v = (h = p.value) == null ? void 0 : h.payload, _ = v.trackItemIds, y = v.trackItemsMap, m = v.trackItemDetailsMap;
1776
+ const b = Z(t.getState()), v = (h = p.value) == null ? void 0 : h.payload, _ = v.trackItemIds, y = v.trackItemsMap, g = v.trackItemDetailsMap;
1775
1777
  console.warn("IMPROVE FONTS LOADING");
1776
1778
  const j = _.map(async (I) => {
1777
1779
  var P;
1778
1780
  try {
1779
- const S = m[I], T = y[I];
1781
+ const S = g[I], T = y[I];
1780
1782
  if (S.type === "image") {
1781
- const A = await Cn(
1783
+ const E = await Cn(
1782
1784
  { id: I, details: S.details, ...T },
1783
1785
  {
1784
- size: g.size
1786
+ size: b.size
1785
1787
  }
1786
- ), { details: M, ...$ } = A;
1787
- m[I] = { type: "image", details: M }, y[I] = $;
1788
+ ), { details: M, ...$ } = E;
1789
+ g[I] = { type: "image", details: M }, y[I] = $;
1788
1790
  } else if (S.type === "video") {
1789
- const A = Z(
1791
+ const E = Z(
1790
1792
  (P = p.value) == null ? void 0 : P.payload.trackItemsMap[I]
1791
1793
  ), M = await Pn(
1792
- { ...S, ...A, ...T },
1794
+ { ...S, ...E, ...T },
1793
1795
  {
1794
1796
  size: {
1795
1797
  width: 1080,
@@ -1797,16 +1799,16 @@ function Ji(t) {
1797
1799
  }
1798
1800
  }
1799
1801
  ), { details: $, ...bt } = M;
1800
- m[I] = { type: "video", details: $ }, y[I] = bt;
1802
+ g[I] = { type: "video", details: $ }, y[I] = bt;
1801
1803
  } else if (S.type === "audio") {
1802
- const A = await Dn({
1804
+ const E = await Dn({
1803
1805
  id: I,
1804
1806
  details: S.details,
1805
1807
  ...T
1806
- }), { details: M, ...$ } = A;
1807
- m[I] = { type: "audio", details: M }, y[I] = $;
1808
+ }), { details: M, ...$ } = E;
1809
+ g[I] = { type: "audio", details: M }, y[I] = $;
1808
1810
  } else if (S.type === "caption") {
1809
- const A = await jn(
1811
+ const E = await jn(
1810
1812
  { id: I, details: S.details, ...T },
1811
1813
  {
1812
1814
  size: {
@@ -1814,10 +1816,10 @@ function Ji(t) {
1814
1816
  height: 1920
1815
1817
  }
1816
1818
  }
1817
- ), { details: M, ...$ } = A;
1818
- m[I] = { type: "caption", details: M }, y[I] = $;
1819
+ ), { details: M, ...$ } = E;
1820
+ g[I] = { type: "caption", details: M }, y[I] = $;
1819
1821
  } else if (S.type === "text") {
1820
- const A = await Rn(
1822
+ const E = await Rn(
1821
1823
  { id: I, details: S.details, ...T },
1822
1824
  {
1823
1825
  size: {
@@ -1825,8 +1827,8 @@ function Ji(t) {
1825
1827
  height: 1920
1826
1828
  }
1827
1829
  }
1828
- ), { details: M, ...$ } = A;
1829
- m[I] = { type: "text", details: M }, y[I] = $;
1830
+ ), { details: M, ...$ } = E;
1831
+ g[I] = { type: "text", details: M }, y[I] = $;
1830
1832
  }
1831
1833
  return !0;
1832
1834
  } catch {
@@ -1834,40 +1836,40 @@ function Ji(t) {
1834
1836
  }
1835
1837
  });
1836
1838
  await Promise.all(j);
1837
- const E = Ve(y);
1839
+ const O = Ve(y);
1838
1840
  t.updateState({
1839
1841
  ...v,
1840
1842
  trackItemsMap: y,
1841
- duration: E
1843
+ duration: O
1842
1844
  });
1843
1845
  }
1844
1846
  if (p.key === vi) {
1845
- const g = (l = p.value) == null ? void 0 : l.payload;
1847
+ const b = (l = p.value) == null ? void 0 : l.payload;
1846
1848
  t.updateState({
1847
- size: g
1849
+ size: b
1848
1850
  });
1849
1851
  }
1850
1852
  }), x = s.subscribe((p) => {
1851
1853
  if (p.key === Ii) return t.undo();
1852
1854
  if (p.key === Si) return t.redo();
1853
1855
  }), F = i.subscribe((p) => {
1854
- var l, g, v;
1856
+ var l, b, v;
1855
1857
  const h = [];
1856
- if ((l = p.value) != null && l.payload.trackItemIds && (h.push((g = p.value) == null ? void 0 : g.payload.trackItemIds), t.updateState({ activeIds: h })), p.key === wi) {
1857
- const _ = (v = p.value) == null ? void 0 : v.payload.trackItemIds, y = Z(t.getState()), m = _ && _.length ? _ : y.activeIds, j = y.trackItemIds, E = y.trackItemDetailsMap, I = j.filter(
1858
- (M) => !m.includes(M)
1858
+ if ((l = p.value) != null && l.payload.trackItemIds && (h.push((b = p.value) == null ? void 0 : b.payload.trackItemIds), t.updateState({ activeIds: h })), p.key === wi) {
1859
+ const _ = (v = p.value) == null ? void 0 : v.payload.trackItemIds, y = Z(t.getState()), g = _ && _.length ? _ : y.activeIds, j = y.trackItemIds, O = y.trackItemDetailsMap, I = j.filter(
1860
+ (M) => !g.includes(M)
1859
1861
  ), P = Object.fromEntries(
1860
- Object.entries(E).filter(
1861
- ([M]) => !m.includes(M)
1862
+ Object.entries(O).filter(
1863
+ ([M]) => !g.includes(M)
1862
1864
  )
1863
1865
  ), S = qi(
1864
1866
  y.tracks,
1865
- m
1867
+ g
1866
1868
  ), T = Object.fromEntries(
1867
1869
  Object.entries(y.trackItemsMap).filter(
1868
- ([M]) => !m.includes(M)
1870
+ ([M]) => !g.includes(M)
1869
1871
  )
1870
- ), A = Ve(y.trackItemsMap);
1872
+ ), E = Ve(y.trackItemsMap);
1871
1873
  t.updateState(
1872
1874
  {
1873
1875
  trackItemIds: I,
@@ -1875,81 +1877,81 @@ function Ji(t) {
1875
1877
  activeIds: [],
1876
1878
  trackItemsMap: T,
1877
1879
  tracks: S,
1878
- duration: A
1880
+ duration: E
1879
1881
  },
1880
1882
  { updateHistory: !0, kind: "remove" }
1881
1883
  );
1882
1884
  }
1883
1885
  }), k = n.subscribe(async (p) => {
1884
- var _, y, m, j, E;
1886
+ var _, y, g, j, O;
1885
1887
  const h = Z(t.getState());
1886
- let l = [], g = "text";
1888
+ let l = [], b = "text";
1887
1889
  if (p.key === Ti) {
1888
- g = "caption";
1890
+ b = "caption";
1889
1891
  const I = (_ = p.value) == null ? void 0 : _.payload, P = [];
1890
- for (const A of I) {
1891
- const M = jn(A, {
1892
+ for (const E of I) {
1893
+ const M = jn(E, {
1892
1894
  size: h.size
1893
1895
  });
1894
1896
  P.push(M);
1895
1897
  }
1896
1898
  const S = await Promise.all(P), T = [];
1897
- for (const A of S) {
1898
- const M = A.id;
1899
+ for (const E of S) {
1900
+ const M = E.id;
1899
1901
  T.push(M);
1900
- const { details: $, ...bt } = A;
1902
+ const { details: $, ...bt } = E;
1901
1903
  h.trackItemDetailsMap[M] = {
1902
- type: g,
1904
+ type: b,
1903
1905
  details: $
1904
1906
  }, h.trackItemsMap[M] = bt, h.trackItemIds.push(M);
1905
1907
  }
1906
1908
  l = T;
1907
1909
  }
1908
1910
  if (p.key === ki) {
1909
- g = "text";
1911
+ b = "text";
1910
1912
  const I = await Rn((y = p.value) == null ? void 0 : y.payload, {
1911
1913
  size: h.size
1912
1914
  }), { details: P, ...S } = I;
1913
1915
  h.trackItemDetailsMap[S.id] = {
1914
- type: g,
1916
+ type: b,
1915
1917
  details: P
1916
1918
  }, h.trackItemsMap[S.id] = S, h.trackItemIds.push(S.id), l = [S.id];
1917
1919
  }
1918
1920
  if (p.key === Ei) {
1919
- g = "image";
1920
- const I = await Cn((m = p.value) == null ? void 0 : m.payload, {
1921
+ b = "image";
1922
+ const I = await Cn((g = p.value) == null ? void 0 : g.payload, {
1921
1923
  size: {
1922
1924
  width: 1080,
1923
1925
  height: 1920
1924
1926
  }
1925
1927
  }), { details: P, ...S } = I;
1926
1928
  h.trackItemDetailsMap[S.id] = {
1927
- type: g,
1929
+ type: b,
1928
1930
  details: P
1929
1931
  }, h.trackItemsMap[S.id] = S, h.trackItemIds.push(S.id), l = [S.id];
1930
1932
  }
1931
1933
  if (p.key === Ai) {
1932
- g = "audio";
1934
+ b = "audio";
1933
1935
  const I = await Dn((j = p.value) == null ? void 0 : j.payload), { details: P, ...S } = I;
1934
1936
  h.trackItemDetailsMap[S.id] = {
1935
- type: g,
1937
+ type: b,
1936
1938
  details: P
1937
1939
  }, h.trackItemsMap[S.id] = S, h.trackItemIds.push(S.id), l = [S.id];
1938
1940
  }
1939
1941
  if (p.key === Oi) {
1940
- g = "video";
1941
- const I = await Pn((E = p.value) == null ? void 0 : E.payload, {
1942
+ b = "video";
1943
+ const I = await Pn((O = p.value) == null ? void 0 : O.payload, {
1942
1944
  size: h.size
1943
1945
  }), { details: P, ...S } = I;
1944
1946
  h.trackItemDetailsMap[S.id] = {
1945
- type: g,
1947
+ type: b,
1946
1948
  details: P
1947
1949
  }, h.trackItemsMap[S.id] = S, h.trackItemIds.push(S.id), l = [S.id];
1948
1950
  }
1949
1951
  h.tracks.unshift({
1950
1952
  id: ln(),
1951
1953
  accepts: ["text", "audio", "helper", "video", "image", "caption"],
1952
- type: g,
1954
+ type: b,
1953
1955
  items: l,
1954
1956
  magnetic: !1,
1955
1957
  static: !1
@@ -1971,25 +1973,25 @@ function Ji(t) {
1971
1973
  }), H = c.subscribe(async (p) => {
1972
1974
  var h;
1973
1975
  if (p.key === xi) {
1974
- const l = Z(t.getState()), g = (h = p.value) == null ? void 0 : h.options.time;
1976
+ const l = Z(t.getState()), b = (h = p.value) == null ? void 0 : h.options.time;
1975
1977
  if (l.activeIds.length === 1) {
1976
1978
  const v = l.activeIds[0], _ = l.trackItemsMap[v];
1977
- if (g >= _.display.to || g <= _.display.from)
1979
+ if (b >= _.display.to || b <= _.display.from)
1978
1980
  return;
1979
- const y = l.trackItemDetailsMap[v], m = Fn(), j = {
1981
+ const y = l.trackItemDetailsMap[v], g = Fn(), j = {
1980
1982
  ..._,
1981
- id: m,
1983
+ id: g,
1982
1984
  display: {
1983
- from: g,
1985
+ from: b,
1984
1986
  to: _.display.to
1985
1987
  },
1986
1988
  trim: {
1987
- from: g,
1989
+ from: b,
1988
1990
  to: _.display.to
1989
1991
  }
1990
1992
  };
1991
- l.trackItemsMap[v].display.to = g, l.trackItemsMap[m] = j, l.trackItemIds.push(m), l.trackItemDetailsMap[m] = y, l.tracks.forEach((E) => {
1992
- E.items.includes(v) && E.items.push(m);
1993
+ l.trackItemsMap[v].display.to = b, l.trackItemsMap[g] = j, l.trackItemIds.push(g), l.trackItemDetailsMap[g] = y, l.tracks.forEach((O) => {
1994
+ O.items.includes(v) && O.items.push(g);
1993
1995
  }), t.updateState(
1994
1996
  {
1995
1997
  trackItemDetailsMap: l.trackItemDetailsMap,
@@ -2008,26 +2010,26 @@ function Ji(t) {
2008
2010
  if (p.key === Mi) {
2009
2011
  const l = Z(t.getState());
2010
2012
  if (l.activeIds.length) {
2011
- const g = l.activeIds, v = [], _ = {
2012
- activeIds: g,
2013
+ const b = l.activeIds, v = [], _ = {
2014
+ activeIds: b,
2013
2015
  trackItemDetailsMap: {},
2014
2016
  trackItemsMap: {},
2015
2017
  tracks: []
2016
2018
  };
2017
- g.forEach((m) => {
2018
- _.trackItemDetailsMap[m] = l.trackItemDetailsMap[m], _.trackItemsMap[m] = l.trackItemsMap[m], v.push(
2019
- l.tracks.find((j) => j.items.includes(m))
2019
+ b.forEach((g) => {
2020
+ _.trackItemDetailsMap[g] = l.trackItemDetailsMap[g], _.trackItemsMap[g] = l.trackItemsMap[g], v.push(
2021
+ l.tracks.find((j) => j.items.includes(g))
2020
2022
  );
2021
2023
  });
2022
2024
  const y = /* @__PURE__ */ new Set();
2023
- v.filter((m) => y.has(m.id) ? !1 : (y.add(m), !0)), _.tracks = Array.from(y.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
2025
+ v.filter((g) => y.has(g.id) ? !1 : (y.add(g), !0)), _.tracks = Array.from(y.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
2024
2026
  }
2025
2027
  }
2026
2028
  if (p.key === Pi) {
2027
2029
  const l = localStorage.getItem("DesignComboTemp");
2028
2030
  if (!l) return;
2029
- const g = Z(t.getState()), v = JSON.parse(l), _ = {}, y = v.trackItemsMap, m = v.trackItemDetailsMap, j = v.tracks, E = [], I = v.activeIds.map(async (P) => {
2030
- const S = m[P];
2031
+ const b = Z(t.getState()), v = JSON.parse(l), _ = {}, y = v.trackItemsMap, g = v.trackItemDetailsMap, j = v.tracks, O = [], I = v.activeIds.map(async (P) => {
2032
+ const S = g[P];
2031
2033
  (S.type === "caption" || S.type === "text") && S.details.fontUrl && await gn([
2032
2034
  {
2033
2035
  fontFamily: S.details.fontFamily,
@@ -2035,24 +2037,24 @@ function Ji(t) {
2035
2037
  }
2036
2038
  ]);
2037
2039
  const T = Fn();
2038
- return _[P] = T, g.trackItemsMap[T] = {
2040
+ return _[P] = T, b.trackItemsMap[T] = {
2039
2041
  ...y[P],
2040
2042
  id: T
2041
- }, g.trackItemDetailsMap[T] = S, g.trackItemIds.push(T), !0;
2043
+ }, b.trackItemDetailsMap[T] = S, b.trackItemIds.push(T), !0;
2042
2044
  });
2043
2045
  await Promise.all(I), j.forEach((P) => {
2044
- const S = P.items.map((A) => _[A]), T = {
2046
+ const S = P.items.map((E) => _[E]), T = {
2045
2047
  ...P,
2046
2048
  items: S,
2047
2049
  id: ln()
2048
2050
  };
2049
- E.push(T);
2050
- }), g.tracks = [...g.tracks, ...E], t.updateState(
2051
+ O.push(T);
2052
+ }), b.tracks = [...b.tracks, ...O], t.updateState(
2051
2053
  {
2052
- trackItemDetailsMap: g.trackItemDetailsMap,
2053
- tracks: g.tracks,
2054
- trackItemIds: g.trackItemIds,
2055
- trackItemsMap: g.trackItemsMap
2054
+ trackItemDetailsMap: b.trackItemDetailsMap,
2055
+ tracks: b.tracks,
2056
+ trackItemIds: b.trackItemIds,
2057
+ trackItemsMap: b.trackItemsMap
2056
2058
  },
2057
2059
  {
2058
2060
  updateHistory: !0,
@@ -2060,17 +2062,18 @@ function Ji(t) {
2060
2062
  }
2061
2063
  );
2062
2064
  }
2063
- }), b = f.subscribe((p) => {
2065
+ }), m = f.subscribe((p) => {
2064
2066
  var h, l;
2065
2067
  if (p.key === Di) {
2066
- const g = Z(t.getState()), v = g.trackItemDetailsMap, _ = g.trackItemsMap, y = Object.keys((h = p.value) == null ? void 0 : h.payload);
2068
+ const b = Z(t.getState()), v = b.trackItemDetailsMap, _ = b.trackItemsMap, y = Object.keys((h = p.value) == null ? void 0 : h.payload);
2067
2069
  if (!y.length) return;
2068
- const m = (l = p.value) == null ? void 0 : l.payload;
2069
- y.forEach((E) => {
2070
- m[E].details ? v[E].details = {
2071
- ...v[E].details,
2072
- ...m[E].details
2073
- } : m[E].playbackRate && (_[E].playbackRate = m[E].playbackRate);
2070
+ const g = (l = p.value) == null ? void 0 : l.payload;
2071
+ y.forEach((O) => {
2072
+ const I = g[O];
2073
+ I.details ? v[O].details = {
2074
+ ...v[O].details,
2075
+ ...I.details
2076
+ } : I.playbackRate && (_[O].playbackRate = I.playbackRate);
2074
2077
  });
2075
2078
  const j = Ve(_);
2076
2079
  t.updateState(
@@ -2088,7 +2091,7 @@ function Ji(t) {
2088
2091
  });
2089
2092
  return {
2090
2093
  unsubscribe: () => {
2091
- k.unsubscribe(), H.unsubscribe(), b.unsubscribe(), x.unsubscribe(), F.unsubscribe(), d.unsubscribe();
2094
+ k.unsubscribe(), H.unsubscribe(), m.unsubscribe(), x.unsubscribe(), F.unsubscribe(), d.unsubscribe();
2092
2095
  }
2093
2096
  };
2094
2097
  }
@@ -2107,15 +2110,15 @@ function ni(t, r, n = { cyclesFix: !0 }, i = []) {
2107
2110
  });
2108
2111
  continue;
2109
2112
  }
2110
- const b = r[F], p = typeof k == "object" && typeof b == "object" && Array.isArray(k) === Array.isArray(b);
2111
- if (k && b && p && !Zi[(x = (d = Object.getPrototypeOf(k)) == null ? void 0 : d.constructor) == null ? void 0 : x.name] && (!n.cyclesFix || !i.includes(k))) {
2112
- const h = ni(k, b, n, n.cyclesFix ? i.concat([k]) : []);
2113
+ const m = r[F], p = typeof k == "object" && typeof m == "object" && Array.isArray(k) === Array.isArray(m);
2114
+ if (k && m && p && !Zi[(x = (d = Object.getPrototypeOf(k)) == null ? void 0 : d.constructor) == null ? void 0 : x.name] && (!n.cyclesFix || !i.includes(k))) {
2115
+ const h = ni(k, m, n, n.cyclesFix ? i.concat([k]) : []);
2113
2116
  s.push.apply(s, h.map((l) => (l.path.unshift(H), l)));
2114
- } else k !== b && // treat NaN values as equivalent
2115
- !(Number.isNaN(k) && Number.isNaN(b)) && !(p && (isNaN(k) ? k + "" == b + "" : +k == +b)) && s.push({
2117
+ } else k !== m && // treat NaN values as equivalent
2118
+ !(Number.isNaN(k) && Number.isNaN(m)) && !(p && (isNaN(k) ? k + "" == m + "" : +k == +m)) && s.push({
2116
2119
  path: [H],
2117
2120
  type: "CHANGE",
2118
- value: b,
2121
+ value: m,
2119
2122
  oldValue: k
2120
2123
  });
2121
2124
  }
@@ -2590,117 +2593,117 @@ function ui(t) {
2590
2593
  function Ln() {
2591
2594
  process.env.NODE_ENV !== "production" && ii.push(
2592
2595
  'Sets cannot have "replace" patches.',
2593
- function(b) {
2594
- return "Unsupported patch operation: " + b;
2596
+ function(m) {
2597
+ return "Unsupported patch operation: " + m;
2595
2598
  },
2596
- function(b) {
2597
- return "Cannot apply patch, path doesn't resolve: " + b;
2599
+ function(m) {
2600
+ return "Cannot apply patch, path doesn't resolve: " + m;
2598
2601
  },
2599
2602
  "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
2600
2603
  );
2601
2604
  const r = "replace", n = "add", i = "remove";
2602
- function s(b, p, h, l) {
2603
- switch (b.type_) {
2605
+ function s(m, p, h, l) {
2606
+ switch (m.type_) {
2604
2607
  case 0:
2605
2608
  case 2:
2606
2609
  return f(
2607
- b,
2610
+ m,
2608
2611
  p,
2609
2612
  h,
2610
2613
  l
2611
2614
  );
2612
2615
  case 1:
2613
- return c(b, p, h, l);
2616
+ return c(m, p, h, l);
2614
2617
  case 3:
2615
2618
  return d(
2616
- b,
2619
+ m,
2617
2620
  p,
2618
2621
  h,
2619
2622
  l
2620
2623
  );
2621
2624
  }
2622
2625
  }
2623
- function c(b, p, h, l) {
2624
- let { base_: g, assigned_: v } = b, _ = b.copy_;
2625
- _.length < g.length && ([g, _] = [_, g], [h, l] = [l, h]);
2626
- for (let y = 0; y < g.length; y++)
2627
- if (v[y] && _[y] !== g[y]) {
2628
- const m = p.concat([y]);
2626
+ function c(m, p, h, l) {
2627
+ let { base_: b, assigned_: v } = m, _ = m.copy_;
2628
+ _.length < b.length && ([b, _] = [_, b], [h, l] = [l, h]);
2629
+ for (let y = 0; y < b.length; y++)
2630
+ if (v[y] && _[y] !== b[y]) {
2631
+ const g = p.concat([y]);
2629
2632
  h.push({
2630
2633
  op: r,
2631
- path: m,
2634
+ path: g,
2632
2635
  // Need to maybe clone it, as it can in fact be the original value
2633
2636
  // due to the base/copy inversion at the start of this function
2634
2637
  value: H(_[y])
2635
2638
  }), l.push({
2636
2639
  op: r,
2637
- path: m,
2638
- value: H(g[y])
2640
+ path: g,
2641
+ value: H(b[y])
2639
2642
  });
2640
2643
  }
2641
- for (let y = g.length; y < _.length; y++) {
2642
- const m = p.concat([y]);
2644
+ for (let y = b.length; y < _.length; y++) {
2645
+ const g = p.concat([y]);
2643
2646
  h.push({
2644
2647
  op: n,
2645
- path: m,
2648
+ path: g,
2646
2649
  // Need to maybe clone it, as it can in fact be the original value
2647
2650
  // due to the base/copy inversion at the start of this function
2648
2651
  value: H(_[y])
2649
2652
  });
2650
2653
  }
2651
- for (let y = _.length - 1; g.length <= y; --y) {
2652
- const m = p.concat([y]);
2654
+ for (let y = _.length - 1; b.length <= y; --y) {
2655
+ const g = p.concat([y]);
2653
2656
  l.push({
2654
2657
  op: i,
2655
- path: m
2658
+ path: g
2656
2659
  });
2657
2660
  }
2658
2661
  }
2659
- function f(b, p, h, l) {
2660
- const { base_: g, copy_: v } = b;
2661
- de(b.assigned_, (_, y) => {
2662
- const m = tn(g, _), j = tn(v, _), E = y ? he(g, _) ? r : n : i;
2663
- if (m === j && E === r)
2662
+ function f(m, p, h, l) {
2663
+ const { base_: b, copy_: v } = m;
2664
+ de(m.assigned_, (_, y) => {
2665
+ const g = tn(b, _), j = tn(v, _), O = y ? he(b, _) ? r : n : i;
2666
+ if (g === j && O === r)
2664
2667
  return;
2665
2668
  const I = p.concat(_);
2666
- h.push(E === i ? { op: E, path: I } : { op: E, path: I, value: j }), l.push(
2667
- E === n ? { op: i, path: I } : E === i ? { op: n, path: I, value: H(m) } : { op: r, path: I, value: H(m) }
2669
+ h.push(O === i ? { op: O, path: I } : { op: O, path: I, value: j }), l.push(
2670
+ O === n ? { op: i, path: I } : O === i ? { op: n, path: I, value: H(g) } : { op: r, path: I, value: H(g) }
2668
2671
  );
2669
2672
  });
2670
2673
  }
2671
- function d(b, p, h, l) {
2672
- let { base_: g, copy_: v } = b, _ = 0;
2673
- g.forEach((y) => {
2674
+ function d(m, p, h, l) {
2675
+ let { base_: b, copy_: v } = m, _ = 0;
2676
+ b.forEach((y) => {
2674
2677
  if (!v.has(y)) {
2675
- const m = p.concat([_]);
2678
+ const g = p.concat([_]);
2676
2679
  h.push({
2677
2680
  op: i,
2678
- path: m,
2681
+ path: g,
2679
2682
  value: y
2680
2683
  }), l.unshift({
2681
2684
  op: n,
2682
- path: m,
2685
+ path: g,
2683
2686
  value: y
2684
2687
  });
2685
2688
  }
2686
2689
  _++;
2687
2690
  }), _ = 0, v.forEach((y) => {
2688
- if (!g.has(y)) {
2689
- const m = p.concat([_]);
2691
+ if (!b.has(y)) {
2692
+ const g = p.concat([_]);
2690
2693
  h.push({
2691
2694
  op: n,
2692
- path: m,
2695
+ path: g,
2693
2696
  value: y
2694
2697
  }), l.unshift({
2695
2698
  op: i,
2696
- path: m,
2699
+ path: g,
2697
2700
  value: y
2698
2701
  });
2699
2702
  }
2700
2703
  _++;
2701
2704
  });
2702
2705
  }
2703
- function x(b, p, h, l) {
2706
+ function x(m, p, h, l) {
2704
2707
  h.push({
2705
2708
  op: r,
2706
2709
  path: [],
@@ -2708,74 +2711,74 @@ function Ln() {
2708
2711
  }), l.push({
2709
2712
  op: r,
2710
2713
  path: [],
2711
- value: b
2714
+ value: m
2712
2715
  });
2713
2716
  }
2714
- function F(b, p) {
2717
+ function F(m, p) {
2715
2718
  return p.forEach((h) => {
2716
- const { path: l, op: g } = h;
2717
- let v = b;
2719
+ const { path: l, op: b } = h;
2720
+ let v = m;
2718
2721
  for (let j = 0; j < l.length - 1; j++) {
2719
- const E = Dt(v);
2722
+ const O = Dt(v);
2720
2723
  let I = l[j];
2721
- typeof I != "string" && typeof I != "number" && (I = "" + I), (E === 0 || E === 1) && (I === "__proto__" || I === "constructor") && G(19), typeof v == "function" && I === "prototype" && G(19), v = tn(v, I), typeof v != "object" && G(18, l.join("/"));
2724
+ typeof I != "string" && typeof I != "number" && (I = "" + I), (O === 0 || O === 1) && (I === "__proto__" || I === "constructor") && G(19), typeof v == "function" && I === "prototype" && G(19), v = tn(v, I), typeof v != "object" && G(18, l.join("/"));
2722
2725
  }
2723
- const _ = Dt(v), y = k(h.value), m = l[l.length - 1];
2724
- switch (g) {
2726
+ const _ = Dt(v), y = k(h.value), g = l[l.length - 1];
2727
+ switch (b) {
2725
2728
  case r:
2726
2729
  switch (_) {
2727
2730
  case 2:
2728
- return v.set(m, y);
2731
+ return v.set(g, y);
2729
2732
  case 3:
2730
2733
  G(16);
2731
2734
  default:
2732
- return v[m] = y;
2735
+ return v[g] = y;
2733
2736
  }
2734
2737
  case n:
2735
2738
  switch (_) {
2736
2739
  case 1:
2737
- return m === "-" ? v.push(y) : v.splice(m, 0, y);
2740
+ return g === "-" ? v.push(y) : v.splice(g, 0, y);
2738
2741
  case 2:
2739
- return v.set(m, y);
2742
+ return v.set(g, y);
2740
2743
  case 3:
2741
2744
  return v.add(y);
2742
2745
  default:
2743
- return v[m] = y;
2746
+ return v[g] = y;
2744
2747
  }
2745
2748
  case i:
2746
2749
  switch (_) {
2747
2750
  case 1:
2748
- return v.splice(m, 1);
2751
+ return v.splice(g, 1);
2749
2752
  case 2:
2750
- return v.delete(m);
2753
+ return v.delete(g);
2751
2754
  case 3:
2752
2755
  return v.delete(h.value);
2753
2756
  default:
2754
- return delete v[m];
2757
+ return delete v[g];
2755
2758
  }
2756
2759
  default:
2757
- G(17, g);
2760
+ G(17, b);
2758
2761
  }
2759
- }), b;
2760
- }
2761
- function k(b) {
2762
- if (!vt(b))
2763
- return b;
2764
- if (Array.isArray(b))
2765
- return b.map(k);
2766
- if (_e(b))
2762
+ }), m;
2763
+ }
2764
+ function k(m) {
2765
+ if (!vt(m))
2766
+ return m;
2767
+ if (Array.isArray(m))
2768
+ return m.map(k);
2769
+ if (_e(m))
2767
2770
  return new Map(
2768
- Array.from(b.entries()).map(([h, l]) => [h, k(l)])
2771
+ Array.from(m.entries()).map(([h, l]) => [h, k(l)])
2769
2772
  );
2770
- if (ve(b))
2771
- return new Set(Array.from(b).map(k));
2772
- const p = Object.create(Mt(b));
2773
- for (const h in b)
2774
- p[h] = k(b[h]);
2775
- return he(b, pe) && (p[pe] = b[pe]), p;
2773
+ if (ve(m))
2774
+ return new Set(Array.from(m).map(k));
2775
+ const p = Object.create(Mt(m));
2776
+ for (const h in m)
2777
+ p[h] = k(m[h]);
2778
+ return he(m, pe) && (p[pe] = m[pe]), p;
2776
2779
  }
2777
- function H(b) {
2778
- return Pt(b) ? k(b) : b;
2780
+ function H(m) {
2781
+ return Pt(m) ? k(m) : m;
2779
2782
  }
2780
2783
  ra("Patches", {
2781
2784
  applyPatches_: F,
@@ -3043,49 +3046,49 @@ class $a {
3043
3046
  transitionIds: d,
3044
3047
  transitionsMap: x,
3045
3048
  trackItemsMap: F
3046
- }), H = [], b = [], p = [], h = [], l = [], g = [];
3049
+ }), H = [], m = [], p = [], h = [], l = [], b = [];
3047
3050
  n.forEach((T) => {
3048
- let A;
3051
+ let E;
3049
3052
  const M = T.path.slice(1);
3050
- T.type === "CREATE" ? A = {
3053
+ T.type === "CREATE" ? E = {
3051
3054
  path: M,
3052
3055
  op: "remove",
3053
3056
  value: T.value
3054
- } : T.type === "CHANGE" ? A = {
3057
+ } : T.type === "CHANGE" ? E = {
3055
3058
  path: M,
3056
3059
  op: "replace",
3057
3060
  value: T.oldValue
3058
- } : A = {
3061
+ } : E = {
3059
3062
  path: M,
3060
3063
  op: "add",
3061
3064
  value: T.oldValue
3062
- }, T.path.includes("trackItemIds") ? p.push(A) : T.path.includes("transitionIds") ? b.push(A) : T.path.includes("trackItemsMap") ? l.push(A) : T.path.includes("transitionsMap") ? h.push(A) : T.path.includes("tracks") ? H.push(A) : T.path.includes("trackItemDetailsMap") && g.push(A);
3065
+ }, T.path.includes("trackItemIds") ? p.push(E) : T.path.includes("transitionIds") ? m.push(E) : T.path.includes("trackItemsMap") ? l.push(E) : T.path.includes("transitionsMap") ? h.push(E) : T.path.includes("tracks") ? H.push(E) : T.path.includes("trackItemDetailsMap") && b.push(E);
3063
3066
  });
3064
3067
  const v = this.applyPatch(
3065
3068
  k.tracks,
3066
3069
  H
3067
3070
  ), _ = this.applyPatch(
3068
3071
  k.transitionIds,
3069
- b
3072
+ m
3070
3073
  ), y = this.applyPatch(
3071
3074
  k.trackItemIds,
3072
3075
  p
3073
- ), m = this.applyPatch(
3076
+ ), g = this.applyPatch(
3074
3077
  k.transitionsMap,
3075
3078
  h
3076
3079
  ), j = this.applyPatch(
3077
3080
  k.trackItemsMap,
3078
3081
  l
3079
- ), E = this.applyPatch(
3082
+ ), O = this.applyPatch(
3080
3083
  k.trackItemDetailsMap,
3081
- g
3084
+ b
3082
3085
  ), I = Z({
3083
3086
  tracks: v,
3084
3087
  transitionIds: _,
3085
3088
  trackItemIds: y,
3086
- transitionsMap: m,
3089
+ transitionsMap: g,
3087
3090
  trackItemsMap: j,
3088
- trackItemDetailsMap: E
3091
+ trackItemDetailsMap: O
3089
3092
  }), P = Z(this.getState()), S = { ...P, ...I };
3090
3093
  this.prevState = P, this.redos.push({ redos: n, type: i }), this.stateSubject.next(S), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
3091
3094
  }
@@ -3112,49 +3115,49 @@ class $a {
3112
3115
  transitionIds: d,
3113
3116
  transitionsMap: x,
3114
3117
  trackItemsMap: F
3115
- }), H = [], b = [], p = [], h = [], l = [], g = [];
3118
+ }), H = [], m = [], p = [], h = [], l = [], b = [];
3116
3119
  n.forEach((T) => {
3117
- let A;
3120
+ let E;
3118
3121
  const M = T.path.slice(1);
3119
- T.type === "CREATE" ? A = {
3122
+ T.type === "CREATE" ? E = {
3120
3123
  path: M,
3121
3124
  op: "add",
3122
3125
  value: T.value
3123
- } : T.type === "CHANGE" ? A = {
3126
+ } : T.type === "CHANGE" ? E = {
3124
3127
  path: M,
3125
3128
  op: "replace",
3126
3129
  value: T.value
3127
- } : A = {
3130
+ } : E = {
3128
3131
  path: M,
3129
3132
  op: "remove",
3130
3133
  value: T.oldValue
3131
- }, T.path.includes("trackItemIds") ? p.push(A) : T.path.includes("transitionIds") ? b.push(A) : T.path.includes("trackItemsMap") ? l.push(A) : T.path.includes("transitionsMap") ? h.push(A) : T.path.includes("trackItemDetailsMap") ? g.push(A) : H.push(A);
3134
+ }, T.path.includes("trackItemIds") ? p.push(E) : T.path.includes("transitionIds") ? m.push(E) : T.path.includes("trackItemsMap") ? l.push(E) : T.path.includes("transitionsMap") ? h.push(E) : T.path.includes("trackItemDetailsMap") ? b.push(E) : H.push(E);
3132
3135
  });
3133
3136
  const v = this.applyPatch(
3134
3137
  k.tracks,
3135
3138
  H
3136
3139
  ), _ = this.applyPatch(
3137
3140
  k.transitionIds,
3138
- b
3141
+ m
3139
3142
  ), y = this.applyPatch(
3140
3143
  k.trackItemIds,
3141
3144
  p
3142
- ), m = this.applyPatch(
3145
+ ), g = this.applyPatch(
3143
3146
  k.transitionsMap,
3144
3147
  h
3145
3148
  ), j = this.applyPatch(
3146
3149
  k.trackItemsMap,
3147
3150
  l
3148
- ), E = this.applyPatch(
3151
+ ), O = this.applyPatch(
3149
3152
  k.trackItemDetailsMap,
3150
- g
3153
+ b
3151
3154
  ), I = Z({
3152
3155
  tracks: v,
3153
3156
  transitionIds: _,
3154
3157
  trackItemIds: y,
3155
- transitionsMap: m,
3158
+ transitionsMap: g,
3156
3159
  trackItemsMap: j,
3157
- trackItemDetailsMap: E
3160
+ trackItemDetailsMap: O
3158
3161
  }), P = Z(this.getState()), S = { ...P, ...I };
3159
3162
  this.prevState = P, this.undos.push({ undos: n, type: i }), this.stateSubject.next(S), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3160
3163
  }