@designcombo/state 0.1.8 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.es.js +386 -386
- package/dist/index.umd.js +1 -1
- package/package.json +5 -5
package/dist/index.es.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
var ai = Object.defineProperty;
|
2
2
|
var si = (t, r, n) => r in t ? ai(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
|
3
3
|
var Et = (t, r, n) => si(t, typeof r != "symbol" ? r + "" : r, n);
|
4
|
-
import { subject as Bt, filter as Wt, DESIGN_PREFIX as oi, ADD_PREFIX as ci, LAYER_PREFIX as ui, HISTORY_PREFIX as fi, ACTIVE_PREFIX as li, EDIT_PREFIX as pi, DESIGN_LOAD as di, HISTORY_UNDO as hi, HISTORY_REDO as yi,
|
4
|
+
import { subject as Bt, filter as Wt, DESIGN_PREFIX as oi, ADD_PREFIX as ci, LAYER_PREFIX as ui, HISTORY_PREFIX as fi, ACTIVE_PREFIX as li, EDIT_PREFIX as pi, DESIGN_LOAD as di, HISTORY_UNDO as hi, HISTORY_REDO as yi, LAYER_DELETE as mi, ADD_CAPTION as bi, ADD_TEXT as _i, ADD_IMAGE as gi, ADD_AUDIO as vi, ADD_VIDEO as Ii, ACTIVE_SPLIT as Si, ACTIVE_CLONE as wi, ACTIVE_PASTE as Ti, EDIT_OBJECT as Ai } from "@designcombo/events";
|
5
5
|
var en = function(t, r) {
|
6
6
|
return en = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, a) {
|
7
7
|
n.__proto__ = a;
|
@@ -101,21 +101,21 @@ var Ze = function() {
|
|
101
101
|
}
|
102
102
|
else
|
103
103
|
l.remove(this);
|
104
|
-
var
|
105
|
-
if (yt(
|
104
|
+
var w = this.initialTeardown;
|
105
|
+
if (yt(w))
|
106
106
|
try {
|
107
|
-
|
107
|
+
w();
|
108
108
|
} catch (f) {
|
109
109
|
c = f instanceof Xr ? f.errors : [f];
|
110
110
|
}
|
111
|
-
var
|
112
|
-
if (
|
111
|
+
var z = this._finalizers;
|
112
|
+
if (z) {
|
113
113
|
this._finalizers = null;
|
114
114
|
try {
|
115
|
-
for (var h = rn(
|
116
|
-
var
|
115
|
+
for (var h = rn(z), p = h.next(); !p.done; p = h.next()) {
|
116
|
+
var g = p.value;
|
117
117
|
try {
|
118
|
-
An(
|
118
|
+
An(g);
|
119
119
|
} catch (f) {
|
120
120
|
c = c ?? [], f instanceof Xr ? c = an(an([], nn(c)), nn(f.errors)) : c.push(f);
|
121
121
|
}
|
@@ -513,8 +513,8 @@ function mn(t) {
|
|
513
513
|
var Ye = { exports: {} };
|
514
514
|
Ye.exports;
|
515
515
|
(function(t, r) {
|
516
|
-
var n = 200, a = "__lodash_hash_undefined__", o = 1, c = 2, l = 9007199254740991, d = "[object Arguments]", E = "[object Array]", D = "[object AsyncFunction]",
|
517
|
-
j[_e] = j[ge] = j[ve] = j[er] = j[rr] = j[nr] = j[ir] = j[C] = j[ar] = !0, j[d] = j[E] = j[T] = j[
|
516
|
+
var n = 200, a = "__lodash_hash_undefined__", o = 1, c = 2, l = 9007199254740991, d = "[object Arguments]", E = "[object Array]", D = "[object AsyncFunction]", w = "[object Boolean]", z = "[object Date]", h = "[object Error]", p = "[object Function]", g = "[object GeneratorFunction]", f = "[object Map]", v = "[object Number]", b = "[object Null]", _ = "[object Object]", m = "[object Promise]", y = "[object Proxy]", F = "[object RegExp]", k = "[object Set]", M = "[object String]", N = "[object Symbol]", R = "[object Undefined]", S = "[object WeakMap]", T = "[object ArrayBuffer]", H = "[object DataView]", _e = "[object Float32Array]", ge = "[object Float64Array]", ve = "[object Int8Array]", er = "[object Int16Array]", rr = "[object Int32Array]", nr = "[object Uint8Array]", ir = "[object Uint8ClampedArray]", C = "[object Uint16Array]", ar = "[object Uint32Array]", sr = /[\\^$.*+?()[\]{}|]/g, rt = /^\[object .+?Constructor\]$/, Ie = /^(?:0|[1-9]\d*)$/, j = {};
|
517
|
+
j[_e] = j[ge] = j[ve] = j[er] = j[rr] = j[nr] = j[ir] = j[C] = j[ar] = !0, j[d] = j[E] = j[T] = j[w] = j[H] = j[z] = j[h] = j[p] = j[f] = j[v] = j[_] = j[F] = j[k] = j[M] = j[S] = !1;
|
518
518
|
var Se = typeof et == "object" && et && et.Object === Object && et, or = typeof self == "object" && self && self.Object === Object && self, nt = Se || or || Function("return this")(), we = r && !r.nodeType && r, Te = we && !0 && t && !t.nodeType && t, $t = Te && Te.exports === we, Kt = $t && Se.process, Ae = function() {
|
519
519
|
try {
|
520
520
|
return Kt && Kt.binding && Kt.binding("util");
|
@@ -523,8 +523,8 @@ Ye.exports;
|
|
523
523
|
}(), Vt = Ae && Ae.isTypedArray;
|
524
524
|
function Ee(e, i) {
|
525
525
|
for (var s = -1, u = e == null ? 0 : e.length, A = 0, I = []; ++s < u; ) {
|
526
|
-
var
|
527
|
-
i(
|
526
|
+
var x = e[s];
|
527
|
+
i(x, s, e) && (I[A++] = x);
|
528
528
|
}
|
529
529
|
return I;
|
530
530
|
}
|
@@ -620,21 +620,21 @@ Ye.exports;
|
|
620
620
|
this.__data__ = [], this.size = 0;
|
621
621
|
}
|
622
622
|
function Ir(e) {
|
623
|
-
var i = this.__data__, s =
|
623
|
+
var i = this.__data__, s = Lt(i, e);
|
624
624
|
if (s < 0)
|
625
625
|
return !1;
|
626
626
|
var u = i.length - 1;
|
627
627
|
return s == u ? i.pop() : vt.call(i, s, 1), --this.size, !0;
|
628
628
|
}
|
629
629
|
function Sr(e) {
|
630
|
-
var i = this.__data__, s =
|
630
|
+
var i = this.__data__, s = Lt(i, e);
|
631
631
|
return s < 0 ? void 0 : i[s][1];
|
632
632
|
}
|
633
633
|
function wr(e) {
|
634
|
-
return
|
634
|
+
return Lt(this.__data__, e) > -1;
|
635
635
|
}
|
636
636
|
function Tr(e, i) {
|
637
|
-
var s = this.__data__, u =
|
637
|
+
var s = this.__data__, u = Lt(s, e);
|
638
638
|
return u < 0 ? (++this.size, s.push([e, i])) : s[u][1] = i, this;
|
639
639
|
}
|
640
640
|
$.prototype.clear = vr, $.prototype.delete = Ir, $.prototype.get = Sr, $.prototype.has = wr, $.prototype.set = Tr;
|
@@ -708,16 +708,16 @@ Ye.exports;
|
|
708
708
|
}
|
709
709
|
ot.prototype.clear = ie, ot.prototype.delete = Mr, ot.prototype.get = Pr, ot.prototype.has = Dr, ot.prototype.set = Cr;
|
710
710
|
function jr(e, i) {
|
711
|
-
var s =
|
711
|
+
var s = Ut(e), u = !s && Le(e), A = !s && !u && Gt(e), I = !s && !u && !A && Be(e), x = s || u || A || I, O = x ? cr(e.length, String) : [], L = O.length;
|
712
712
|
for (var P in e)
|
713
|
-
Q.call(e, P) && !(
|
713
|
+
Q.call(e, P) && !(x && // Safari 9 has enumerable `arguments.length` in strict mode.
|
714
714
|
(P == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
715
715
|
A && (P == "offset" || P == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
716
716
|
I && (P == "buffer" || P == "byteLength" || P == "byteOffset") || // Skip index properties.
|
717
|
-
Gr(P,
|
718
|
-
return
|
717
|
+
Gr(P, L))) && O.push(P);
|
718
|
+
return O;
|
719
719
|
}
|
720
|
-
function
|
720
|
+
function Lt(e, i) {
|
721
721
|
for (var s = e.length; s--; )
|
722
722
|
if (He(e[s][0], i))
|
723
723
|
return s;
|
@@ -725,10 +725,10 @@ Ye.exports;
|
|
725
725
|
}
|
726
726
|
function ae(e, i, s) {
|
727
727
|
var u = i(e);
|
728
|
-
return
|
728
|
+
return Ut(e) ? u : Yt(u, s(e));
|
729
729
|
}
|
730
730
|
function wt(e) {
|
731
|
-
return e == null ? e === void 0 ?
|
731
|
+
return e == null ? e === void 0 ? R : b : it && it in Object(e) ? dt(e) : Ne(e);
|
732
732
|
}
|
733
733
|
function Re(e) {
|
734
734
|
return ut(e) && wt(e) == d;
|
@@ -737,16 +737,16 @@ Ye.exports;
|
|
737
737
|
return e === i ? !0 : e == null || i == null || !ut(e) && !ut(i) ? e !== e && i !== i : Fr(e, i, s, u, ze, A);
|
738
738
|
}
|
739
739
|
function Fr(e, i, s, u, A, I) {
|
740
|
-
var
|
741
|
-
|
742
|
-
var K =
|
743
|
-
if (
|
740
|
+
var x = Ut(e), O = Ut(i), L = x ? E : ct(e), P = O ? E : ct(i);
|
741
|
+
L = L == d ? _ : L, P = P == d ? _ : P;
|
742
|
+
var K = L == _, q = P == _, U = L == P;
|
743
|
+
if (U && Gt(e)) {
|
744
744
|
if (!Gt(i))
|
745
745
|
return !1;
|
746
|
-
|
746
|
+
x = !0, K = !1;
|
747
747
|
}
|
748
|
-
if (
|
749
|
-
return I || (I = new ot()),
|
748
|
+
if (U && !K)
|
749
|
+
return I || (I = new ot()), x || Be(e) ? se(e, i, s, u, A, I) : Hr(e, i, L, s, u, A, I);
|
750
750
|
if (!(s & o)) {
|
751
751
|
var V = K && Q.call(e, "__wrapped__"), W = q && Q.call(i, "__wrapped__");
|
752
752
|
if (V || W) {
|
@@ -754,12 +754,12 @@ Ye.exports;
|
|
754
754
|
return I || (I = new ot()), A(bt, ht, s, u, I);
|
755
755
|
}
|
756
756
|
}
|
757
|
-
return
|
757
|
+
return U ? (I || (I = new ot()), Lr(e, i, s, u, A, I)) : !1;
|
758
758
|
}
|
759
759
|
function Rr(e) {
|
760
760
|
if (!Ge(e) || Wr(e))
|
761
761
|
return !1;
|
762
|
-
var i =
|
762
|
+
var i = Ue(e) ? lr : rt;
|
763
763
|
return i.test(Y(e));
|
764
764
|
}
|
765
765
|
function zr(e) {
|
@@ -774,27 +774,27 @@ Ye.exports;
|
|
774
774
|
return i;
|
775
775
|
}
|
776
776
|
function se(e, i, s, u, A, I) {
|
777
|
-
var
|
778
|
-
if (
|
777
|
+
var x = s & o, O = e.length, L = i.length;
|
778
|
+
if (O != L && !(x && L > O))
|
779
779
|
return !1;
|
780
780
|
var P = I.get(e);
|
781
781
|
if (P && I.get(i))
|
782
782
|
return P == i;
|
783
|
-
var K = -1, q = !0,
|
784
|
-
for (I.set(e, i), I.set(i, e); ++K <
|
783
|
+
var K = -1, q = !0, U = s & c ? new Nt() : void 0;
|
784
|
+
for (I.set(e, i), I.set(i, e); ++K < O; ) {
|
785
785
|
var V = e[K], W = i[K];
|
786
786
|
if (u)
|
787
|
-
var bt =
|
787
|
+
var bt = x ? u(W, V, K, i, e, I) : u(V, W, K, e, i, I);
|
788
788
|
if (bt !== void 0) {
|
789
789
|
if (bt)
|
790
790
|
continue;
|
791
791
|
q = !1;
|
792
792
|
break;
|
793
793
|
}
|
794
|
-
if (
|
794
|
+
if (U) {
|
795
795
|
if (!ke(i, function(ht, At) {
|
796
|
-
if (!Dt(
|
797
|
-
return
|
796
|
+
if (!Dt(U, At) && (V === ht || A(V, ht, s, u, I)))
|
797
|
+
return U.push(At);
|
798
798
|
})) {
|
799
799
|
q = !1;
|
800
800
|
break;
|
@@ -806,7 +806,7 @@ Ye.exports;
|
|
806
806
|
}
|
807
807
|
return I.delete(e), I.delete(i), q;
|
808
808
|
}
|
809
|
-
function Hr(e, i, s, u, A, I,
|
809
|
+
function Hr(e, i, s, u, A, I, x) {
|
810
810
|
switch (s) {
|
811
811
|
case H:
|
812
812
|
if (e.byteLength != i.byteLength || e.byteOffset != i.byteOffset)
|
@@ -814,40 +814,40 @@ Ye.exports;
|
|
814
814
|
e = e.buffer, i = i.buffer;
|
815
815
|
case T:
|
816
816
|
return !(e.byteLength != i.byteLength || !I(new De(e), new De(i)));
|
817
|
-
case
|
818
|
-
case
|
819
|
-
case
|
817
|
+
case w:
|
818
|
+
case z:
|
819
|
+
case v:
|
820
820
|
return He(+e, +i);
|
821
821
|
case h:
|
822
822
|
return e.name == i.name && e.message == i.message;
|
823
823
|
case F:
|
824
|
-
case
|
824
|
+
case M:
|
825
825
|
return e == i + "";
|
826
826
|
case f:
|
827
|
-
var
|
827
|
+
var O = Oe;
|
828
828
|
case k:
|
829
|
-
var
|
830
|
-
if (
|
829
|
+
var L = u & o;
|
830
|
+
if (O || (O = st), e.size != i.size && !L)
|
831
831
|
return !1;
|
832
|
-
var P =
|
832
|
+
var P = x.get(e);
|
833
833
|
if (P)
|
834
834
|
return P == i;
|
835
|
-
u |= c,
|
836
|
-
var K = se(
|
837
|
-
return
|
835
|
+
u |= c, x.set(e, i);
|
836
|
+
var K = se(O(e), O(i), u, A, I, x);
|
837
|
+
return x.delete(e), K;
|
838
838
|
case N:
|
839
839
|
if (ne)
|
840
840
|
return ne.call(e) == ne.call(i);
|
841
841
|
}
|
842
842
|
return !1;
|
843
843
|
}
|
844
|
-
function
|
845
|
-
var
|
846
|
-
if (
|
844
|
+
function Lr(e, i, s, u, A, I) {
|
845
|
+
var x = s & o, O = Tt(e), L = O.length, P = Tt(i), K = P.length;
|
846
|
+
if (L != K && !x)
|
847
847
|
return !1;
|
848
|
-
for (var q =
|
849
|
-
var
|
850
|
-
if (!(
|
848
|
+
for (var q = L; q--; ) {
|
849
|
+
var U = O[q];
|
850
|
+
if (!(x ? U in i : Q.call(i, U)))
|
851
851
|
return !1;
|
852
852
|
}
|
853
853
|
var V = I.get(e);
|
@@ -855,16 +855,16 @@ Ye.exports;
|
|
855
855
|
return V == i;
|
856
856
|
var W = !0;
|
857
857
|
I.set(e, i), I.set(i, e);
|
858
|
-
for (var bt =
|
859
|
-
|
860
|
-
var ht = e[
|
858
|
+
for (var bt = x; ++q < L; ) {
|
859
|
+
U = O[q];
|
860
|
+
var ht = e[U], At = i[U];
|
861
861
|
if (u)
|
862
|
-
var Tn =
|
862
|
+
var Tn = x ? u(At, ht, U, i, e, I) : u(ht, At, U, e, i, I);
|
863
863
|
if (!(Tn === void 0 ? ht === At || A(ht, At, s, u, I) : Tn)) {
|
864
864
|
W = !1;
|
865
865
|
break;
|
866
866
|
}
|
867
|
-
bt || (bt =
|
867
|
+
bt || (bt = U == "constructor");
|
868
868
|
}
|
869
869
|
if (W && !bt) {
|
870
870
|
var We = e.constructor, $e = i.constructor;
|
@@ -873,7 +873,7 @@ Ye.exports;
|
|
873
873
|
return I.delete(e), I.delete(i), W;
|
874
874
|
}
|
875
875
|
function Tt(e) {
|
876
|
-
return ae(e, ue,
|
876
|
+
return ae(e, ue, Ur);
|
877
877
|
}
|
878
878
|
function at(e, i) {
|
879
879
|
var s = e.__data__;
|
@@ -893,13 +893,13 @@ Ye.exports;
|
|
893
893
|
var A = Pe.call(e);
|
894
894
|
return u && (i ? e[it] = s : delete e[it]), A;
|
895
895
|
}
|
896
|
-
var
|
896
|
+
var Ur = zt ? function(e) {
|
897
897
|
return e == null ? [] : (e = Object(e), Ee(zt(e), function(i) {
|
898
898
|
return Rt.call(e, i);
|
899
899
|
}));
|
900
900
|
} : Vr, ct = wt;
|
901
|
-
(Qt && ct(new Qt(new ArrayBuffer(1))) != H || St && ct(new St()) != f || te && ct(te.resolve()) !=
|
902
|
-
var i = wt(e), s = i ==
|
901
|
+
(Qt && ct(new Qt(new ArrayBuffer(1))) != H || St && ct(new St()) != f || te && ct(te.resolve()) != m || ee && ct(new ee()) != k || re && ct(new re()) != S) && (ct = function(e) {
|
902
|
+
var i = wt(e), s = i == _ ? e.constructor : void 0, u = s ? Y(s) : "";
|
903
903
|
if (u)
|
904
904
|
switch (u) {
|
905
905
|
case Ce:
|
@@ -907,11 +907,11 @@ Ye.exports;
|
|
907
907
|
case lt:
|
908
908
|
return f;
|
909
909
|
case pr:
|
910
|
-
return
|
910
|
+
return m;
|
911
911
|
case dr:
|
912
912
|
return k;
|
913
913
|
case hr:
|
914
|
-
return
|
914
|
+
return S;
|
915
915
|
}
|
916
916
|
return i;
|
917
917
|
});
|
@@ -948,23 +948,23 @@ Ye.exports;
|
|
948
948
|
function He(e, i) {
|
949
949
|
return e === i || e !== e && i !== i;
|
950
950
|
}
|
951
|
-
var
|
951
|
+
var Le = Re(/* @__PURE__ */ function() {
|
952
952
|
return arguments;
|
953
953
|
}()) ? Re : function(e) {
|
954
954
|
return ut(e) && Q.call(e, "callee") && !Rt.call(e, "callee");
|
955
|
-
},
|
955
|
+
}, Ut = Array.isArray;
|
956
956
|
function oe(e) {
|
957
|
-
return e != null && ce(e.length) && !
|
957
|
+
return e != null && ce(e.length) && !Ue(e);
|
958
958
|
}
|
959
959
|
var Gt = Zt || Yr;
|
960
960
|
function Kr(e, i) {
|
961
961
|
return ze(e, i);
|
962
962
|
}
|
963
|
-
function
|
963
|
+
function Ue(e) {
|
964
964
|
if (!Ge(e))
|
965
965
|
return !1;
|
966
966
|
var i = wt(e);
|
967
|
-
return i == p || i ==
|
967
|
+
return i == p || i == g || i == D || i == y;
|
968
968
|
}
|
969
969
|
function ce(e) {
|
970
970
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= l;
|
@@ -993,8 +993,8 @@ const ft = /* @__PURE__ */ mn(zi);
|
|
993
993
|
var Xe = { exports: {} };
|
994
994
|
Xe.exports;
|
995
995
|
(function(t, r) {
|
996
|
-
var n = 200, a = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", l = "[object Array]", d = "[object Boolean]", E = "[object Date]", D = "[object Error]",
|
997
|
-
C[c] = C[l] = C[F] = C[k] = C[d] = C[E] = C[
|
996
|
+
var n = 200, a = "__lodash_hash_undefined__", o = 9007199254740991, c = "[object Arguments]", l = "[object Array]", d = "[object Boolean]", E = "[object Date]", D = "[object Error]", w = "[object Function]", z = "[object GeneratorFunction]", h = "[object Map]", p = "[object Number]", g = "[object Object]", f = "[object Promise]", v = "[object RegExp]", b = "[object Set]", _ = "[object String]", m = "[object Symbol]", y = "[object WeakMap]", F = "[object ArrayBuffer]", k = "[object DataView]", M = "[object Float32Array]", N = "[object Float64Array]", R = "[object Int8Array]", S = "[object Int16Array]", T = "[object Int32Array]", H = "[object Uint8Array]", _e = "[object Uint8ClampedArray]", ge = "[object Uint16Array]", ve = "[object Uint32Array]", er = /[\\^$.*+?()[\]{}|]/g, rr = /\w*$/, nr = /^\[object .+?Constructor\]$/, ir = /^(?:0|[1-9]\d*)$/, C = {};
|
997
|
+
C[c] = C[l] = C[F] = C[k] = C[d] = C[E] = C[M] = C[N] = C[R] = C[S] = C[T] = C[h] = C[p] = C[g] = C[v] = C[b] = C[_] = C[m] = C[H] = C[_e] = C[ge] = C[ve] = !0, C[D] = C[w] = C[y] = !1;
|
998
998
|
var ar = typeof et == "object" && et && et.Object === Object && et, sr = typeof self == "object" && self && self.Object === Object && self, rt = ar || sr || Function("return this")(), Ie = r && !r.nodeType && r, j = Ie && !0 && t && !t.nodeType && t, Se = j && j.exports === Ie;
|
999
999
|
function or(e, i) {
|
1000
1000
|
return e.set(i[0], i[1]), e;
|
@@ -1170,58 +1170,58 @@ Xe.exports;
|
|
1170
1170
|
}
|
1171
1171
|
X.prototype.clear = Ar, X.prototype.delete = Er, X.prototype.get = kr, X.prototype.has = Or, X.prototype.set = xr;
|
1172
1172
|
function Nt(e, i) {
|
1173
|
-
var s = oe(e) ||
|
1173
|
+
var s = oe(e) || Ut(e) ? Kt(e.length, String) : [], u = s.length, A = !!u;
|
1174
1174
|
for (var I in e)
|
1175
1175
|
st.call(e, I) && !(A && (I == "length" || Br(I, u))) && s.push(I);
|
1176
1176
|
return s;
|
1177
1177
|
}
|
1178
1178
|
function Fe(e, i, s) {
|
1179
1179
|
var u = e[i];
|
1180
|
-
(!(st.call(e, i) &&
|
1180
|
+
(!(st.call(e, i) && Le(u, s)) || s === void 0 && !(i in e)) && (e[i] = s);
|
1181
1181
|
}
|
1182
1182
|
function Ht(e, i) {
|
1183
1183
|
for (var s = e.length; s--; )
|
1184
|
-
if (
|
1184
|
+
if (Le(e[s][0], i))
|
1185
1185
|
return s;
|
1186
1186
|
return -1;
|
1187
1187
|
}
|
1188
1188
|
function ot(e, i) {
|
1189
1189
|
return e && se(i, ue(i), e);
|
1190
1190
|
}
|
1191
|
-
function ie(e, i, s, u, A, I,
|
1192
|
-
var
|
1193
|
-
if (u && (
|
1194
|
-
return
|
1191
|
+
function ie(e, i, s, u, A, I, x) {
|
1192
|
+
var O;
|
1193
|
+
if (u && (O = I ? u(e, A, I, x) : u(e)), O !== void 0)
|
1194
|
+
return O;
|
1195
1195
|
if (!ut(e))
|
1196
1196
|
return e;
|
1197
|
-
var
|
1198
|
-
if (
|
1199
|
-
if (
|
1200
|
-
return Nr(e,
|
1197
|
+
var L = oe(e);
|
1198
|
+
if (L) {
|
1199
|
+
if (O = Ur(e), !i)
|
1200
|
+
return Nr(e, O);
|
1201
1201
|
} else {
|
1202
|
-
var P = dt(e), K = P ==
|
1203
|
-
if (
|
1204
|
-
return
|
1205
|
-
if (P ==
|
1202
|
+
var P = dt(e), K = P == w || P == z;
|
1203
|
+
if (Ue(e))
|
1204
|
+
return Lt(e, i);
|
1205
|
+
if (P == g || P == c || K && !I) {
|
1206
1206
|
if (Vt(e))
|
1207
1207
|
return I ? e : {};
|
1208
|
-
if (
|
1209
|
-
return Hr(e, ot(
|
1208
|
+
if (O = ct(K ? {} : e), !i)
|
1209
|
+
return Hr(e, ot(O, e));
|
1210
1210
|
} else {
|
1211
1211
|
if (!C[P])
|
1212
1212
|
return I ? e : {};
|
1213
|
-
|
1213
|
+
O = Gr(e, P, ie, i);
|
1214
1214
|
}
|
1215
1215
|
}
|
1216
|
-
|
1217
|
-
var q =
|
1216
|
+
x || (x = new X());
|
1217
|
+
var q = x.get(e);
|
1218
1218
|
if (q)
|
1219
1219
|
return q;
|
1220
|
-
if (
|
1221
|
-
var
|
1222
|
-
return we(
|
1223
|
-
|
1224
|
-
}),
|
1220
|
+
if (x.set(e, O), !L)
|
1221
|
+
var U = s ? Lr(e) : ue(e);
|
1222
|
+
return we(U || e, function(V, W) {
|
1223
|
+
U && (W = V, V = e[W]), Fe(O, W, ie(V, i, s, u, W, e, x));
|
1224
|
+
}), O;
|
1225
1225
|
}
|
1226
1226
|
function Mr(e) {
|
1227
1227
|
return ut(e) ? Me(e) : {};
|
@@ -1247,7 +1247,7 @@ Xe.exports;
|
|
1247
1247
|
st.call(e, s) && s != "constructor" && i.push(s);
|
1248
1248
|
return i;
|
1249
1249
|
}
|
1250
|
-
function
|
1250
|
+
function Lt(e, i) {
|
1251
1251
|
if (i)
|
1252
1252
|
return e.slice();
|
1253
1253
|
var s = new e.constructor(e.length);
|
@@ -1289,15 +1289,15 @@ Xe.exports;
|
|
1289
1289
|
function se(e, i, s, u) {
|
1290
1290
|
s || (s = {});
|
1291
1291
|
for (var A = -1, I = i.length; ++A < I; ) {
|
1292
|
-
var
|
1293
|
-
Fe(s,
|
1292
|
+
var x = i[A], O = void 0;
|
1293
|
+
Fe(s, x, O === void 0 ? e[x] : O);
|
1294
1294
|
}
|
1295
1295
|
return s;
|
1296
1296
|
}
|
1297
1297
|
function Hr(e, i) {
|
1298
1298
|
return se(e, pt(e), i);
|
1299
1299
|
}
|
1300
|
-
function
|
1300
|
+
function Lr(e) {
|
1301
1301
|
return Pr(e, ue, pt);
|
1302
1302
|
}
|
1303
1303
|
function Tt(e, i) {
|
@@ -1309,8 +1309,8 @@ Xe.exports;
|
|
1309
1309
|
return Cr(s) ? s : void 0;
|
1310
1310
|
}
|
1311
1311
|
var pt = Jt ? Yt(Jt, Object) : Vr, dt = Dr;
|
1312
|
-
(Rt && dt(new Rt(new ArrayBuffer(1))) != k || vt && dt(new vt()) != h || it && dt(it.resolve()) != f || zt && dt(new zt()) !=
|
1313
|
-
var i = Ct.call(e), s = i ==
|
1312
|
+
(Rt && dt(new Rt(new ArrayBuffer(1))) != k || vt && dt(new vt()) != h || it && dt(it.resolve()) != f || zt && dt(new zt()) != b || Zt && dt(new Zt()) != y) && (dt = function(e) {
|
1313
|
+
var i = Ct.call(e), s = i == g ? e.constructor : void 0, u = s ? Y(s) : void 0;
|
1314
1314
|
if (u)
|
1315
1315
|
switch (u) {
|
1316
1316
|
case Qt:
|
@@ -1320,13 +1320,13 @@ Xe.exports;
|
|
1320
1320
|
case te:
|
1321
1321
|
return f;
|
1322
1322
|
case ee:
|
1323
|
-
return
|
1323
|
+
return b;
|
1324
1324
|
case re:
|
1325
1325
|
return y;
|
1326
1326
|
}
|
1327
1327
|
return i;
|
1328
1328
|
});
|
1329
|
-
function
|
1329
|
+
function Ur(e) {
|
1330
1330
|
var i = e.length, s = e.constructor(i);
|
1331
1331
|
return i && typeof e[0] == "string" && st.call(e, "index") && (s.index = e.index, s.input = e.input), s;
|
1332
1332
|
}
|
@@ -1343,10 +1343,10 @@ Xe.exports;
|
|
1343
1343
|
return new A(+e);
|
1344
1344
|
case k:
|
1345
1345
|
return wt(e, u);
|
1346
|
-
case
|
1346
|
+
case M:
|
1347
1347
|
case N:
|
1348
|
-
case
|
1349
|
-
case
|
1348
|
+
case R:
|
1349
|
+
case S:
|
1350
1350
|
case T:
|
1351
1351
|
case H:
|
1352
1352
|
case _e:
|
@@ -1356,13 +1356,13 @@ Xe.exports;
|
|
1356
1356
|
case h:
|
1357
1357
|
return Re(e, u, s);
|
1358
1358
|
case p:
|
1359
|
-
case g:
|
1360
|
-
return new A(e);
|
1361
1359
|
case _:
|
1360
|
+
return new A(e);
|
1361
|
+
case v:
|
1362
1362
|
return ze(e);
|
1363
|
-
case m:
|
1364
|
-
return Fr(e, u, s);
|
1365
1363
|
case b:
|
1364
|
+
return Fr(e, u, s);
|
1365
|
+
case m:
|
1366
1366
|
return Rr(e);
|
1367
1367
|
}
|
1368
1368
|
}
|
@@ -1396,10 +1396,10 @@ Xe.exports;
|
|
1396
1396
|
function He(e) {
|
1397
1397
|
return ie(e, !0, !0);
|
1398
1398
|
}
|
1399
|
-
function
|
1399
|
+
function Le(e, i) {
|
1400
1400
|
return e === i || e !== e && i !== i;
|
1401
1401
|
}
|
1402
|
-
function
|
1402
|
+
function Ut(e) {
|
1403
1403
|
return Kr(e) && st.call(e, "callee") && (!Pe.call(e, "callee") || Ct.call(e) == c);
|
1404
1404
|
}
|
1405
1405
|
var oe = Array.isArray;
|
@@ -1409,10 +1409,10 @@ Xe.exports;
|
|
1409
1409
|
function Kr(e) {
|
1410
1410
|
return Be(e) && Gt(e);
|
1411
1411
|
}
|
1412
|
-
var
|
1412
|
+
var Ue = Ft || Yr;
|
1413
1413
|
function ce(e) {
|
1414
1414
|
var i = ut(e) ? Ct.call(e) : "";
|
1415
|
-
return i ==
|
1415
|
+
return i == w || i == z;
|
1416
1416
|
}
|
1417
1417
|
function Ge(e) {
|
1418
1418
|
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= o;
|
@@ -1453,7 +1453,7 @@ const tt = /* @__PURE__ */ mn(Ni), cn = (t) => {
|
|
1453
1453
|
}, a.onerror = (o) => {
|
1454
1454
|
n(o);
|
1455
1455
|
}, a.crossOrigin = "anonymous", a.src = t;
|
1456
|
-
}),
|
1456
|
+
}), Li = (t) => new Promise((r, n) => {
|
1457
1457
|
const a = new Audio();
|
1458
1458
|
a.preload = "auto", a.addEventListener("loadedmetadata", () => {
|
1459
1459
|
const o = a.duration * 1e3;
|
@@ -1461,7 +1461,7 @@ const tt = /* @__PURE__ */ mn(Ni), cn = (t) => {
|
|
1461
1461
|
}), a.addEventListener("error", (o) => {
|
1462
1462
|
n(o);
|
1463
1463
|
}), a.src = t, a.crossOrigin = "anonymous", a.load();
|
1464
|
-
}),
|
1464
|
+
}), Ui = (t) => new Promise((r, n) => {
|
1465
1465
|
const a = document.createElement("video");
|
1466
1466
|
a.preload = "auto", a.addEventListener("loadedmetadata", () => {
|
1467
1467
|
const o = a.duration * 1e3, c = a.videoWidth, l = a.videoHeight;
|
@@ -1482,7 +1482,8 @@ const tt = /* @__PURE__ */ mn(Ni), cn = (t) => {
|
|
1482
1482
|
y: 0,
|
1483
1483
|
blur: 0
|
1484
1484
|
}, Qe = (t, r) => {
|
1485
|
-
|
1485
|
+
let n = r != null && r.trim ? r.trim.to - r.trim.from : (r == null ? void 0 : r.duration) || 5e3;
|
1486
|
+
const a = {
|
1486
1487
|
from: 0,
|
1487
1488
|
to: n
|
1488
1489
|
};
|
@@ -1530,9 +1531,9 @@ function _n(t, r) {
|
|
1530
1531
|
};
|
1531
1532
|
}
|
1532
1533
|
const Bi = async (t, r) => {
|
1533
|
-
const n = t.details.src, a = await
|
1534
|
+
const n = t.details.src, a = await Ui(n), o = _n(r, {
|
1534
1535
|
...a
|
1535
|
-
}), c = {
|
1536
|
+
}), c = qn(t.trim, { duration: a.duration }), l = {
|
1536
1537
|
width: a.width,
|
1537
1538
|
height: a.height,
|
1538
1539
|
duration: a.duration,
|
@@ -1556,20 +1557,20 @@ const Bi = async (t, r) => {
|
|
1556
1557
|
};
|
1557
1558
|
return {
|
1558
1559
|
...t,
|
1559
|
-
trim:
|
1560
|
+
trim: c,
|
1560
1561
|
type: "video",
|
1561
1562
|
name: "video",
|
1562
|
-
details:
|
1563
|
-
display: Qe(t.display, { duration: a.duration })
|
1563
|
+
details: l,
|
1564
|
+
display: Qe(t.display, { duration: a.duration, trim: c })
|
1564
1565
|
};
|
1565
1566
|
}, Wi = async (t) => {
|
1566
|
-
const r = t.id, n = t.details, o = (await
|
1567
|
+
const r = t.id, n = t.details, o = (await Li(n.src)).duration, c = qn(t.trim, { duration: o });
|
1567
1568
|
return {
|
1568
1569
|
id: r,
|
1569
1570
|
name: "",
|
1570
1571
|
type: "audio",
|
1571
|
-
display: Qe(t.display, { duration: o }),
|
1572
|
-
trim:
|
1572
|
+
display: Qe(t.display, { duration: o, trim: c }),
|
1573
|
+
trim: c,
|
1573
1574
|
details: {
|
1574
1575
|
src: n.src,
|
1575
1576
|
duration: o,
|
@@ -1733,10 +1734,10 @@ function qi(t) {
|
|
1733
1734
|
), l = Bt.pipe(
|
1734
1735
|
Wt(({ key: p }) => p.startsWith(pi))
|
1735
1736
|
), d = r.subscribe(async (p) => {
|
1736
|
-
var
|
1737
|
+
var g;
|
1737
1738
|
if (p.key === di) {
|
1738
|
-
const f = (
|
1739
|
-
const y = m
|
1739
|
+
const f = (g = p.value) == null ? void 0 : g.payload, v = f.trackItemIds, b = f.trackItemDetailsMap, _ = v.map(async (m) => {
|
1740
|
+
const y = b[m];
|
1740
1741
|
return (y.type === "caption" || y.type === "text") && await cn([
|
1741
1742
|
{
|
1742
1743
|
fontFamily: y.details.fontFamily,
|
@@ -1744,7 +1745,7 @@ function qi(t) {
|
|
1744
1745
|
}
|
1745
1746
|
]), !0;
|
1746
1747
|
});
|
1747
|
-
await Promise.all(
|
1748
|
+
await Promise.all(_), t.updateState({
|
1748
1749
|
...f
|
1749
1750
|
});
|
1750
1751
|
}
|
@@ -1752,123 +1753,122 @@ function qi(t) {
|
|
1752
1753
|
if (p.key === hi) return t.undo();
|
1753
1754
|
if (p.key === yi) return t.redo();
|
1754
1755
|
}), D = a.subscribe((p) => {
|
1755
|
-
var f,
|
1756
|
-
const
|
1757
|
-
(f = p.value) != null && f.payload.trackItemIds &&
|
1758
|
-
|
1759
|
-
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
|
1764
|
-
|
1756
|
+
var f, v, b;
|
1757
|
+
const g = [];
|
1758
|
+
if ((f = p.value) != null && f.payload.trackItemIds && (g.push((v = p.value) == null ? void 0 : v.payload.trackItemIds), t.updateState({ activeIds: g })), p.key === mi) {
|
1759
|
+
const _ = (b = p.value) == null ? void 0 : b.payload.trackItemIds, m = tt(t.getState()), y = _ && _.length ? _ : m.activeIds, F = m.trackItemIds, k = m.trackItemDetailsMap, M = F.filter(
|
1760
|
+
(T) => !y.includes(T)
|
1761
|
+
), N = Object.fromEntries(
|
1762
|
+
Object.entries(k).filter(
|
1763
|
+
([T]) => !y.includes(T)
|
1764
|
+
)
|
1765
|
+
), R = Xi(
|
1766
|
+
m.tracks,
|
1767
|
+
y
|
1768
|
+
), S = Pn(m.trackItemsMap);
|
1769
|
+
t.updateState(
|
1770
|
+
{
|
1771
|
+
trackItemIds: M,
|
1772
|
+
trackItemDetailsMap: N,
|
1773
|
+
activeIds: [],
|
1774
|
+
tracks: R,
|
1775
|
+
duration: S
|
1776
|
+
},
|
1777
|
+
{ updateHistory: !0, kind: "remove" }
|
1778
|
+
);
|
1779
|
+
}
|
1780
|
+
}), w = n.subscribe(async (p) => {
|
1781
|
+
var m, y, F, k, M, N;
|
1782
|
+
const g = [], f = tt(t.getState()), v = ((m = p.value) == null ? void 0 : m.payload.id) ?? Jr();
|
1783
|
+
if (g.push(v), p.key === bi) {
|
1784
|
+
const S = ((y = p.value) == null ? void 0 : y.payload).map(async (H) => await Dn(H, f, "caption")), T = await Promise.all(S);
|
1785
|
+
g.splice(0, g.length), T.forEach((H) => {
|
1786
|
+
g.push(H), f.trackItemIds.push(H);
|
1765
1787
|
});
|
1766
1788
|
}
|
1767
|
-
if (p.key ===
|
1768
|
-
const
|
1789
|
+
if (p.key === _i) {
|
1790
|
+
const R = await Dn(
|
1769
1791
|
(F = p.value) == null ? void 0 : F.payload,
|
1770
1792
|
f,
|
1771
1793
|
"text"
|
1772
1794
|
);
|
1773
|
-
f.trackItemIds.push(
|
1795
|
+
f.trackItemIds.push(R);
|
1774
1796
|
}
|
1775
|
-
let
|
1776
|
-
if (p.key ===
|
1777
|
-
|
1778
|
-
const
|
1797
|
+
let b = "text";
|
1798
|
+
if (p.key === gi) {
|
1799
|
+
b = "image";
|
1800
|
+
const R = await $i((k = p.value) == null ? void 0 : k.payload, {
|
1779
1801
|
size: {
|
1780
1802
|
width: 1080,
|
1781
1803
|
height: 1920
|
1782
1804
|
}
|
1783
|
-
}), { details:
|
1805
|
+
}), { details: S, ...T } = R;
|
1784
1806
|
f.trackItemDetailsMap[T.id] = {
|
1785
|
-
type:
|
1786
|
-
details:
|
1807
|
+
type: b,
|
1808
|
+
details: S
|
1787
1809
|
}, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
|
1788
1810
|
}
|
1789
|
-
if (p.key ===
|
1790
|
-
|
1791
|
-
const
|
1811
|
+
if (p.key === vi) {
|
1812
|
+
b = "audio";
|
1813
|
+
const R = await Wi((M = p.value) == null ? void 0 : M.payload), { details: S, ...T } = R;
|
1792
1814
|
f.trackItemDetailsMap[T.id] = {
|
1793
|
-
type:
|
1794
|
-
details:
|
1815
|
+
type: b,
|
1816
|
+
details: S
|
1795
1817
|
}, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
|
1796
1818
|
}
|
1797
|
-
if (p.key ===
|
1798
|
-
|
1799
|
-
const
|
1819
|
+
if (p.key === Ii) {
|
1820
|
+
b = "video";
|
1821
|
+
const R = await Bi((N = p.value) == null ? void 0 : N.payload, {
|
1800
1822
|
size: {
|
1801
1823
|
width: 1080,
|
1802
1824
|
height: 1920
|
1803
1825
|
}
|
1804
|
-
}), { details:
|
1826
|
+
}), { details: S, ...T } = R;
|
1805
1827
|
f.trackItemDetailsMap[T.id] = {
|
1806
|
-
type:
|
1807
|
-
details:
|
1828
|
+
type: b,
|
1829
|
+
details: S
|
1808
1830
|
}, f.trackItemsMap[T.id] = T, f.trackItemIds.push(T.id);
|
1809
1831
|
}
|
1810
1832
|
f.tracks.unshift({
|
1811
1833
|
id: un(),
|
1812
1834
|
accepts: ["text", "audio", "helper", "video", "image", "caption"],
|
1813
|
-
type:
|
1814
|
-
items:
|
1835
|
+
type: b,
|
1836
|
+
items: g,
|
1815
1837
|
magnetic: !1,
|
1816
1838
|
static: !1
|
1817
1839
|
});
|
1818
|
-
const
|
1840
|
+
const _ = Pn(f.trackItemsMap);
|
1819
1841
|
t.updateState(
|
1820
1842
|
{
|
1821
1843
|
trackItemIds: f.trackItemIds,
|
1822
1844
|
trackItemDetailsMap: f.trackItemDetailsMap,
|
1823
1845
|
trackItemsMap: f.trackItemsMap,
|
1824
1846
|
tracks: f.tracks,
|
1825
|
-
duration:
|
1847
|
+
duration: _
|
1826
1848
|
},
|
1827
1849
|
{
|
1828
1850
|
updateHistory: !0,
|
1829
1851
|
kind: "add"
|
1830
1852
|
}
|
1831
1853
|
);
|
1832
|
-
}),
|
1833
|
-
var
|
1834
|
-
if (p.key === Ii) {
|
1835
|
-
const f = tt(t.getState()), _ = f.activeIds, m = f.trackItemIds, g = f.trackItemDetailsMap, b = m.filter(
|
1836
|
-
(O) => !_.includes(O)
|
1837
|
-
), y = Object.fromEntries(
|
1838
|
-
Object.entries(g).filter(
|
1839
|
-
([O]) => !_.includes(O)
|
1840
|
-
)
|
1841
|
-
), F = Xi(
|
1842
|
-
f.tracks,
|
1843
|
-
_
|
1844
|
-
), k = Pn(f.trackItemsMap);
|
1845
|
-
t.updateState(
|
1846
|
-
{
|
1847
|
-
trackItemIds: b,
|
1848
|
-
trackItemDetailsMap: y,
|
1849
|
-
activeIds: [],
|
1850
|
-
tracks: F,
|
1851
|
-
duration: k
|
1852
|
-
},
|
1853
|
-
{ updateHistory: !0, kind: "remove" }
|
1854
|
-
);
|
1855
|
-
}
|
1854
|
+
}), z = c.subscribe(async (p) => {
|
1855
|
+
var g;
|
1856
1856
|
if (p.key === Si) {
|
1857
|
-
const f = tt(t.getState()),
|
1857
|
+
const f = tt(t.getState()), v = (g = p.value) == null ? void 0 : g.options.time;
|
1858
1858
|
if (f.activeIds.length === 1) {
|
1859
|
-
const
|
1860
|
-
if (
|
1859
|
+
const b = f.activeIds[0], _ = f.trackItemsMap[b];
|
1860
|
+
if (v >= _.display.to || v <= _.display.from)
|
1861
1861
|
return;
|
1862
|
-
const
|
1863
|
-
...
|
1862
|
+
const m = f.trackItemDetailsMap[b], y = Jr(), F = {
|
1863
|
+
..._,
|
1864
1864
|
id: y,
|
1865
1865
|
display: {
|
1866
|
-
from:
|
1867
|
-
to:
|
1866
|
+
from: v,
|
1867
|
+
to: _.display.to
|
1868
1868
|
}
|
1869
1869
|
};
|
1870
|
-
f.trackItemsMap[
|
1871
|
-
k.items.includes(
|
1870
|
+
f.trackItemsMap[b].display.to = v, f.trackItemsMap[y] = F, f.trackItemIds.push(y), f.trackItemDetailsMap[y] = m, f.tracks.forEach((k) => {
|
1871
|
+
k.items.includes(b) && k.items.push(y);
|
1872
1872
|
}), t.updateState(
|
1873
1873
|
{
|
1874
1874
|
trackItemDetailsMap: f.trackItemDetailsMap,
|
@@ -1887,51 +1887,51 @@ function qi(t) {
|
|
1887
1887
|
if (p.key === wi) {
|
1888
1888
|
const f = tt(t.getState());
|
1889
1889
|
if (f.activeIds.length) {
|
1890
|
-
const
|
1891
|
-
activeIds:
|
1890
|
+
const v = f.activeIds, b = [], _ = {
|
1891
|
+
activeIds: v,
|
1892
1892
|
trackItemDetailsMap: {},
|
1893
1893
|
trackItemsMap: {},
|
1894
1894
|
tracks: []
|
1895
1895
|
};
|
1896
|
-
|
1897
|
-
|
1896
|
+
v.forEach((y) => {
|
1897
|
+
_.trackItemDetailsMap[y] = f.trackItemDetailsMap[y], _.trackItemsMap[y] = f.trackItemsMap[y], b.push(
|
1898
1898
|
f.tracks.find((F) => F.items.includes(y))
|
1899
1899
|
);
|
1900
1900
|
});
|
1901
|
-
const
|
1902
|
-
|
1901
|
+
const m = /* @__PURE__ */ new Set();
|
1902
|
+
b.filter((y) => m.has(y.id) ? !1 : (m.add(y), !0)), _.tracks = Array.from(m.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
|
1903
1903
|
}
|
1904
1904
|
}
|
1905
1905
|
if (p.key === Ti) {
|
1906
1906
|
const f = localStorage.getItem("DesignComboTemp");
|
1907
1907
|
if (!f) return;
|
1908
|
-
const
|
1909
|
-
const
|
1910
|
-
(
|
1908
|
+
const v = tt(t.getState()), b = JSON.parse(f), _ = {}, m = b.trackItemsMap, y = b.trackItemDetailsMap, F = b.tracks, k = [], M = b.activeIds.map(async (N) => {
|
1909
|
+
const R = y[N];
|
1910
|
+
(R.type === "caption" || R.type === "text") && await cn([
|
1911
1911
|
{
|
1912
|
-
fontFamily:
|
1913
|
-
url:
|
1912
|
+
fontFamily: R.details.fontFamily,
|
1913
|
+
url: R.details.fontUrl
|
1914
1914
|
}
|
1915
1915
|
]);
|
1916
|
-
const
|
1917
|
-
return
|
1918
|
-
...
|
1919
|
-
id:
|
1920
|
-
},
|
1916
|
+
const S = Jr();
|
1917
|
+
return _[N] = S, v.trackItemsMap[S] = {
|
1918
|
+
...m[N],
|
1919
|
+
id: S
|
1920
|
+
}, v.trackItemDetailsMap[S] = R, v.trackItemIds.push(S), !0;
|
1921
1921
|
});
|
1922
|
-
await Promise.all(
|
1923
|
-
const
|
1922
|
+
await Promise.all(M), F.forEach((N) => {
|
1923
|
+
const R = N.items.map((T) => _[T]), S = {
|
1924
1924
|
...N,
|
1925
|
-
items:
|
1925
|
+
items: R,
|
1926
1926
|
id: un()
|
1927
1927
|
};
|
1928
|
-
k.push(
|
1929
|
-
}),
|
1928
|
+
k.push(S);
|
1929
|
+
}), v.tracks = [...v.tracks, ...k], t.updateState(
|
1930
1930
|
{
|
1931
|
-
trackItemDetailsMap:
|
1932
|
-
tracks:
|
1933
|
-
trackItemIds:
|
1934
|
-
trackItemsMap:
|
1931
|
+
trackItemDetailsMap: v.trackItemDetailsMap,
|
1932
|
+
tracks: v.tracks,
|
1933
|
+
trackItemIds: v.trackItemIds,
|
1934
|
+
trackItemsMap: v.trackItemsMap
|
1935
1935
|
},
|
1936
1936
|
{
|
1937
1937
|
updateHistory: !0,
|
@@ -1940,19 +1940,19 @@ function qi(t) {
|
|
1940
1940
|
);
|
1941
1941
|
}
|
1942
1942
|
}), h = l.subscribe((p) => {
|
1943
|
-
var
|
1943
|
+
var g, f;
|
1944
1944
|
if (p.key === Ai) {
|
1945
|
-
const
|
1946
|
-
if (!
|
1947
|
-
const
|
1948
|
-
|
1949
|
-
|
1950
|
-
...
|
1951
|
-
...
|
1945
|
+
const v = t.getState(), b = tt(v.trackItemDetailsMap), _ = Object.keys((g = p.value) == null ? void 0 : g.payload);
|
1946
|
+
if (!_.length) return;
|
1947
|
+
const m = (f = p.value) == null ? void 0 : f.payload;
|
1948
|
+
_.forEach((y) => {
|
1949
|
+
b[y].details = {
|
1950
|
+
...b[y].details,
|
1951
|
+
...m[y].details
|
1952
1952
|
};
|
1953
1953
|
}), t.updateState(
|
1954
1954
|
{
|
1955
|
-
trackItemDetailsMap: { ...
|
1955
|
+
trackItemDetailsMap: { ...b }
|
1956
1956
|
},
|
1957
1957
|
{
|
1958
1958
|
updateHistory: !0,
|
@@ -1963,7 +1963,7 @@ function qi(t) {
|
|
1963
1963
|
});
|
1964
1964
|
return {
|
1965
1965
|
unsubscribe: () => {
|
1966
|
-
|
1966
|
+
w.unsubscribe(), z.unsubscribe(), h.unsubscribe(), E.unsubscribe(), D.unsubscribe(), d.unsubscribe();
|
1967
1967
|
}
|
1968
1968
|
};
|
1969
1969
|
}
|
@@ -1973,25 +1973,25 @@ function Jn(t, r, n = { cyclesFix: !0 }, a = []) {
|
|
1973
1973
|
let o = [];
|
1974
1974
|
const c = Array.isArray(t);
|
1975
1975
|
for (const D in t) {
|
1976
|
-
const
|
1976
|
+
const w = t[D], z = c ? +D : D;
|
1977
1977
|
if (!(D in r)) {
|
1978
1978
|
o.push({
|
1979
1979
|
type: "REMOVE",
|
1980
|
-
path: [
|
1980
|
+
path: [z],
|
1981
1981
|
oldValue: t[D]
|
1982
1982
|
});
|
1983
1983
|
continue;
|
1984
1984
|
}
|
1985
|
-
const h = r[D], p = typeof
|
1986
|
-
if (
|
1987
|
-
const
|
1988
|
-
o.push.apply(o,
|
1989
|
-
} else
|
1990
|
-
!(Number.isNaN(
|
1991
|
-
path: [
|
1985
|
+
const h = r[D], p = typeof w == "object" && typeof h == "object" && Array.isArray(w) === Array.isArray(h);
|
1986
|
+
if (w && h && p && !Ji[(E = (d = Object.getPrototypeOf(w)) == null ? void 0 : d.constructor) == null ? void 0 : E.name] && (!n.cyclesFix || !a.includes(w))) {
|
1987
|
+
const g = Jn(w, h, n, n.cyclesFix ? a.concat([w]) : []);
|
1988
|
+
o.push.apply(o, g.map((f) => (f.path.unshift(z), f)));
|
1989
|
+
} else w !== h && // treat NaN values as equivalent
|
1990
|
+
!(Number.isNaN(w) && Number.isNaN(h)) && !(p && (isNaN(w) ? w + "" == h + "" : +w == +h)) && o.push({
|
1991
|
+
path: [z],
|
1992
1992
|
type: "CHANGE",
|
1993
1993
|
value: h,
|
1994
|
-
oldValue:
|
1994
|
+
oldValue: w
|
1995
1995
|
});
|
1996
1996
|
}
|
1997
1997
|
const l = Array.isArray(r);
|
@@ -2365,7 +2365,7 @@ var sa = class {
|
|
2365
2365
|
n = r;
|
2366
2366
|
const l = this;
|
2367
2367
|
return function(E = c, ...D) {
|
2368
|
-
return l.produce(E, (
|
2368
|
+
return l.produce(E, (w) => n.call(this, w, ...D));
|
2369
2369
|
};
|
2370
2370
|
}
|
2371
2371
|
typeof n != "function" && G(6), a !== void 0 && typeof a != "function" && G(7);
|
@@ -2474,109 +2474,109 @@ function zn() {
|
|
2474
2474
|
"Patching reserved attributes like __proto__, prototype and constructor is not allowed"
|
2475
2475
|
);
|
2476
2476
|
const r = "replace", n = "add", a = "remove";
|
2477
|
-
function o(h, p,
|
2477
|
+
function o(h, p, g, f) {
|
2478
2478
|
switch (h.type_) {
|
2479
2479
|
case 0:
|
2480
2480
|
case 2:
|
2481
2481
|
return l(
|
2482
2482
|
h,
|
2483
2483
|
p,
|
2484
|
-
|
2484
|
+
g,
|
2485
2485
|
f
|
2486
2486
|
);
|
2487
2487
|
case 1:
|
2488
|
-
return c(h, p,
|
2488
|
+
return c(h, p, g, f);
|
2489
2489
|
case 3:
|
2490
2490
|
return d(
|
2491
2491
|
h,
|
2492
2492
|
p,
|
2493
|
-
|
2493
|
+
g,
|
2494
2494
|
f
|
2495
2495
|
);
|
2496
2496
|
}
|
2497
2497
|
}
|
2498
|
-
function c(h, p,
|
2499
|
-
let { base_:
|
2500
|
-
|
2501
|
-
for (let
|
2502
|
-
if (m
|
2503
|
-
const y = p.concat([
|
2504
|
-
|
2498
|
+
function c(h, p, g, f) {
|
2499
|
+
let { base_: v, assigned_: b } = h, _ = h.copy_;
|
2500
|
+
_.length < v.length && ([v, _] = [_, v], [g, f] = [f, g]);
|
2501
|
+
for (let m = 0; m < v.length; m++)
|
2502
|
+
if (b[m] && _[m] !== v[m]) {
|
2503
|
+
const y = p.concat([m]);
|
2504
|
+
g.push({
|
2505
2505
|
op: r,
|
2506
2506
|
path: y,
|
2507
2507
|
// Need to maybe clone it, as it can in fact be the original value
|
2508
2508
|
// due to the base/copy inversion at the start of this function
|
2509
|
-
value:
|
2509
|
+
value: z(_[m])
|
2510
2510
|
}), f.push({
|
2511
2511
|
op: r,
|
2512
2512
|
path: y,
|
2513
|
-
value:
|
2513
|
+
value: z(v[m])
|
2514
2514
|
});
|
2515
2515
|
}
|
2516
|
-
for (let
|
2517
|
-
const y = p.concat([
|
2518
|
-
|
2516
|
+
for (let m = v.length; m < _.length; m++) {
|
2517
|
+
const y = p.concat([m]);
|
2518
|
+
g.push({
|
2519
2519
|
op: n,
|
2520
2520
|
path: y,
|
2521
2521
|
// Need to maybe clone it, as it can in fact be the original value
|
2522
2522
|
// due to the base/copy inversion at the start of this function
|
2523
|
-
value:
|
2523
|
+
value: z(_[m])
|
2524
2524
|
});
|
2525
2525
|
}
|
2526
|
-
for (let
|
2527
|
-
const y = p.concat([
|
2526
|
+
for (let m = _.length - 1; v.length <= m; --m) {
|
2527
|
+
const y = p.concat([m]);
|
2528
2528
|
f.push({
|
2529
2529
|
op: a,
|
2530
2530
|
path: y
|
2531
2531
|
});
|
2532
2532
|
}
|
2533
2533
|
}
|
2534
|
-
function l(h, p,
|
2535
|
-
const { base_:
|
2536
|
-
le(h.assigned_, (
|
2537
|
-
const y = Zr(
|
2534
|
+
function l(h, p, g, f) {
|
2535
|
+
const { base_: v, copy_: b } = h;
|
2536
|
+
le(h.assigned_, (_, m) => {
|
2537
|
+
const y = Zr(v, _), F = Zr(b, _), k = m ? pe(v, _) ? r : n : a;
|
2538
2538
|
if (y === F && k === r)
|
2539
2539
|
return;
|
2540
|
-
const
|
2541
|
-
|
2542
|
-
k === n ? { op: a, path:
|
2540
|
+
const M = p.concat(_);
|
2541
|
+
g.push(k === a ? { op: k, path: M } : { op: k, path: M, value: F }), f.push(
|
2542
|
+
k === n ? { op: a, path: M } : k === a ? { op: n, path: M, value: z(y) } : { op: r, path: M, value: z(y) }
|
2543
2543
|
);
|
2544
2544
|
});
|
2545
2545
|
}
|
2546
|
-
function d(h, p,
|
2547
|
-
let { base_:
|
2548
|
-
|
2549
|
-
if (!
|
2550
|
-
const y = p.concat([
|
2551
|
-
|
2546
|
+
function d(h, p, g, f) {
|
2547
|
+
let { base_: v, copy_: b } = h, _ = 0;
|
2548
|
+
v.forEach((m) => {
|
2549
|
+
if (!b.has(m)) {
|
2550
|
+
const y = p.concat([_]);
|
2551
|
+
g.push({
|
2552
2552
|
op: a,
|
2553
2553
|
path: y,
|
2554
|
-
value:
|
2554
|
+
value: m
|
2555
2555
|
}), f.unshift({
|
2556
2556
|
op: n,
|
2557
2557
|
path: y,
|
2558
|
-
value:
|
2558
|
+
value: m
|
2559
2559
|
});
|
2560
2560
|
}
|
2561
|
-
|
2562
|
-
}),
|
2563
|
-
if (!
|
2564
|
-
const y = p.concat([
|
2565
|
-
|
2561
|
+
_++;
|
2562
|
+
}), _ = 0, b.forEach((m) => {
|
2563
|
+
if (!v.has(m)) {
|
2564
|
+
const y = p.concat([_]);
|
2565
|
+
g.push({
|
2566
2566
|
op: n,
|
2567
2567
|
path: y,
|
2568
|
-
value:
|
2568
|
+
value: m
|
2569
2569
|
}), f.unshift({
|
2570
2570
|
op: a,
|
2571
2571
|
path: y,
|
2572
|
-
value:
|
2572
|
+
value: m
|
2573
2573
|
});
|
2574
2574
|
}
|
2575
|
-
|
2575
|
+
_++;
|
2576
2576
|
});
|
2577
2577
|
}
|
2578
|
-
function E(h, p,
|
2579
|
-
|
2578
|
+
function E(h, p, g, f) {
|
2579
|
+
g.push({
|
2580
2580
|
op: r,
|
2581
2581
|
path: [],
|
2582
2582
|
value: p === gn ? void 0 : p
|
@@ -2587,70 +2587,70 @@ function zn() {
|
|
2587
2587
|
});
|
2588
2588
|
}
|
2589
2589
|
function D(h, p) {
|
2590
|
-
return p.forEach((
|
2591
|
-
const { path: f, op:
|
2592
|
-
let
|
2590
|
+
return p.forEach((g) => {
|
2591
|
+
const { path: f, op: v } = g;
|
2592
|
+
let b = h;
|
2593
2593
|
for (let F = 0; F < f.length - 1; F++) {
|
2594
|
-
const k = Mt(
|
2595
|
-
let
|
2596
|
-
typeof
|
2594
|
+
const k = Mt(b);
|
2595
|
+
let M = f[F];
|
2596
|
+
typeof M != "string" && typeof M != "number" && (M = "" + M), (k === 0 || k === 1) && (M === "__proto__" || M === "constructor") && G(19), typeof b == "function" && M === "prototype" && G(19), b = Zr(b, M), typeof b != "object" && G(18, f.join("/"));
|
2597
2597
|
}
|
2598
|
-
const
|
2599
|
-
switch (
|
2598
|
+
const _ = Mt(b), m = w(g.value), y = f[f.length - 1];
|
2599
|
+
switch (v) {
|
2600
2600
|
case r:
|
2601
|
-
switch (
|
2601
|
+
switch (_) {
|
2602
2602
|
case 2:
|
2603
|
-
return
|
2603
|
+
return b.set(y, m);
|
2604
2604
|
case 3:
|
2605
2605
|
G(16);
|
2606
2606
|
default:
|
2607
|
-
return
|
2607
|
+
return b[y] = m;
|
2608
2608
|
}
|
2609
2609
|
case n:
|
2610
|
-
switch (
|
2610
|
+
switch (_) {
|
2611
2611
|
case 1:
|
2612
|
-
return y === "-" ?
|
2612
|
+
return y === "-" ? b.push(m) : b.splice(y, 0, m);
|
2613
2613
|
case 2:
|
2614
|
-
return
|
2614
|
+
return b.set(y, m);
|
2615
2615
|
case 3:
|
2616
|
-
return
|
2616
|
+
return b.add(m);
|
2617
2617
|
default:
|
2618
|
-
return
|
2618
|
+
return b[y] = m;
|
2619
2619
|
}
|
2620
2620
|
case a:
|
2621
|
-
switch (
|
2621
|
+
switch (_) {
|
2622
2622
|
case 1:
|
2623
|
-
return
|
2623
|
+
return b.splice(y, 1);
|
2624
2624
|
case 2:
|
2625
|
-
return
|
2625
|
+
return b.delete(y);
|
2626
2626
|
case 3:
|
2627
|
-
return
|
2627
|
+
return b.delete(g.value);
|
2628
2628
|
default:
|
2629
|
-
return delete
|
2629
|
+
return delete b[y];
|
2630
2630
|
}
|
2631
2631
|
default:
|
2632
|
-
G(17,
|
2632
|
+
G(17, v);
|
2633
2633
|
}
|
2634
2634
|
}), h;
|
2635
2635
|
}
|
2636
|
-
function
|
2636
|
+
function w(h) {
|
2637
2637
|
if (!_t(h))
|
2638
2638
|
return h;
|
2639
2639
|
if (Array.isArray(h))
|
2640
|
-
return h.map(
|
2640
|
+
return h.map(w);
|
2641
2641
|
if (me(h))
|
2642
2642
|
return new Map(
|
2643
|
-
Array.from(h.entries()).map(([
|
2643
|
+
Array.from(h.entries()).map(([g, f]) => [g, w(f)])
|
2644
2644
|
);
|
2645
2645
|
if (be(h))
|
2646
|
-
return new Set(Array.from(h).map(
|
2646
|
+
return new Set(Array.from(h).map(w));
|
2647
2647
|
const p = Object.create(Ot(h));
|
2648
|
-
for (const
|
2649
|
-
p[
|
2648
|
+
for (const g in h)
|
2649
|
+
p[g] = w(h[g]);
|
2650
2650
|
return pe(h, fe) && (p[fe] = h[fe]), p;
|
2651
2651
|
}
|
2652
|
-
function
|
2653
|
-
return xt(h) ?
|
2652
|
+
function z(h) {
|
2653
|
+
return xt(h) ? w(h) : h;
|
2654
2654
|
}
|
2655
2655
|
ea("Patches", {
|
2656
2656
|
applyPatches_: D,
|
@@ -2691,7 +2691,7 @@ function Ia(t, r) {
|
|
2691
2691
|
t[o + n] = r[n];
|
2692
2692
|
return t;
|
2693
2693
|
}
|
2694
|
-
var Sn = Object.prototype, Sa = Sn.hasOwnProperty, wn = Sn.toString, Nn = _a.Symbol, wa = Sn.propertyIsEnumerable, Hn = Nn ? Nn.isConcatSpreadable : void 0,
|
2694
|
+
var Sn = Object.prototype, Sa = Sn.hasOwnProperty, wn = Sn.toString, Nn = _a.Symbol, wa = Sn.propertyIsEnumerable, Hn = Nn ? Nn.isConcatSpreadable : void 0, Ln = Math.max;
|
2695
2695
|
function Ta(t, r, n, a, o) {
|
2696
2696
|
var c = -1, l = t.length;
|
2697
2697
|
for (n || (n = Oa), o || (o = []); ++c < l; ) {
|
@@ -2713,8 +2713,8 @@ function Ea(t, r, n) {
|
|
2713
2713
|
return c;
|
2714
2714
|
}
|
2715
2715
|
function ka(t, r) {
|
2716
|
-
return r =
|
2717
|
-
for (var n = arguments, a = -1, o =
|
2716
|
+
return r = Ln(r === void 0 ? t.length - 1 : r, 0), function() {
|
2717
|
+
for (var n = arguments, a = -1, o = Ln(n.length - r, 0), c = Array(o); ++a < o; )
|
2718
2718
|
c[a] = n[r + a];
|
2719
2719
|
a = -1;
|
2720
2720
|
for (var l = Array(r + 1); ++a < r; )
|
@@ -2761,7 +2761,7 @@ function za(t) {
|
|
2761
2761
|
var Na = ka(function(t, r) {
|
2762
2762
|
return t == null ? {} : Aa(t, va(Ta(r), xa));
|
2763
2763
|
}), Ha = Na;
|
2764
|
-
const
|
2764
|
+
const Un = /* @__PURE__ */ mn(Ha), La = {
|
2765
2765
|
tracks: [],
|
2766
2766
|
trackItemIds: [],
|
2767
2767
|
trackItemsMap: {},
|
@@ -2791,7 +2791,7 @@ class Ba {
|
|
2791
2791
|
Et(this, "undos", []);
|
2792
2792
|
Et(this, "redos", []);
|
2793
2793
|
Et(this, "listener");
|
2794
|
-
const n = r ||
|
2794
|
+
const n = r || La;
|
2795
2795
|
this.stateSubject = new Mn(n), this.stateHistorySubject = new Mn({
|
2796
2796
|
handleRedo: !1,
|
2797
2797
|
handleUndo: !1
|
@@ -2807,7 +2807,7 @@ class Ba {
|
|
2807
2807
|
this.destroyListeners();
|
2808
2808
|
}
|
2809
2809
|
updateHistory(r, n) {
|
2810
|
-
const a =
|
2810
|
+
const a = Un(r, Gn), o = Un(this.getState(), Gn), c = Jn(o, a);
|
2811
2811
|
c.length && (this.undos.push({ undos: c, type: n }), this.redos = []);
|
2812
2812
|
}
|
2813
2813
|
getStateHistory() {
|
@@ -2896,58 +2896,58 @@ class Ba {
|
|
2896
2896
|
transitionIds: d,
|
2897
2897
|
transitionsMap: E,
|
2898
2898
|
trackItemsMap: D
|
2899
|
-
} = this.getState(),
|
2899
|
+
} = this.getState(), w = tt({
|
2900
2900
|
trackItemDetailsMap: o,
|
2901
2901
|
trackItemIds: c,
|
2902
2902
|
tracks: l,
|
2903
2903
|
transitionIds: d,
|
2904
2904
|
transitionsMap: E,
|
2905
2905
|
trackItemsMap: D
|
2906
|
-
}),
|
2907
|
-
n.forEach((
|
2906
|
+
}), z = [], h = [], p = [], g = [], f = [], v = [];
|
2907
|
+
n.forEach((S) => {
|
2908
2908
|
let T;
|
2909
|
-
const H =
|
2910
|
-
|
2909
|
+
const H = S.path.slice(1);
|
2910
|
+
S.type === "CREATE" ? T = {
|
2911
2911
|
path: H,
|
2912
2912
|
op: "remove",
|
2913
|
-
value:
|
2914
|
-
} :
|
2913
|
+
value: S.value
|
2914
|
+
} : S.type === "CHANGE" ? T = {
|
2915
2915
|
path: H,
|
2916
2916
|
op: "replace",
|
2917
|
-
value:
|
2917
|
+
value: S.oldValue
|
2918
2918
|
} : T = {
|
2919
2919
|
path: H,
|
2920
2920
|
op: "add",
|
2921
|
-
value:
|
2922
|
-
},
|
2921
|
+
value: S.oldValue
|
2922
|
+
}, S.path.includes("trackItemIds") ? p.push(T) : S.path.includes("transitionIds") ? h.push(T) : S.path.includes("trackItemsMap") ? f.push(T) : S.path.includes("transitionsMap") ? g.push(T) : S.path.includes("tracks") ? z.push(T) : S.path.includes("trackItemDetailsMap") && v.push(T);
|
2923
2923
|
});
|
2924
|
-
const
|
2925
|
-
|
2926
|
-
|
2927
|
-
),
|
2928
|
-
|
2924
|
+
const b = this.applyPatch(
|
2925
|
+
w.tracks,
|
2926
|
+
z
|
2927
|
+
), _ = this.applyPatch(
|
2928
|
+
w.transitionIds,
|
2929
2929
|
h
|
2930
|
-
),
|
2931
|
-
|
2930
|
+
), m = this.applyPatch(
|
2931
|
+
w.trackItemIds,
|
2932
2932
|
p
|
2933
2933
|
), y = this.applyPatch(
|
2934
|
-
|
2935
|
-
|
2934
|
+
w.transitionsMap,
|
2935
|
+
g
|
2936
2936
|
), F = this.applyPatch(
|
2937
|
-
|
2937
|
+
w.trackItemsMap,
|
2938
2938
|
f
|
2939
2939
|
), k = this.applyPatch(
|
2940
|
-
|
2941
|
-
|
2942
|
-
),
|
2943
|
-
tracks:
|
2944
|
-
transitionIds:
|
2945
|
-
trackItemIds:
|
2940
|
+
w.trackItemDetailsMap,
|
2941
|
+
v
|
2942
|
+
), M = tt({
|
2943
|
+
tracks: b,
|
2944
|
+
transitionIds: _,
|
2945
|
+
trackItemIds: m,
|
2946
2946
|
transitionsMap: y,
|
2947
2947
|
trackItemsMap: F,
|
2948
2948
|
trackItemDetailsMap: k
|
2949
|
-
}), N = tt(this.getState()),
|
2950
|
-
this.prevState = N, this.redos.push({ redos: n, type: a }), this.stateSubject.next(
|
2949
|
+
}), N = tt(this.getState()), R = { ...N, ...M };
|
2950
|
+
this.prevState = N, this.redos.push({ redos: n, type: a }), this.stateSubject.next(R), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
|
2951
2951
|
}
|
2952
2952
|
applyPatch(r, n) {
|
2953
2953
|
return n.reverse().reduce((a, o) => ca(a, (c) => {
|
@@ -2965,58 +2965,58 @@ class Ba {
|
|
2965
2965
|
transitionIds: d,
|
2966
2966
|
transitionsMap: E,
|
2967
2967
|
trackItemsMap: D
|
2968
|
-
} = this.getState(),
|
2968
|
+
} = this.getState(), w = tt({
|
2969
2969
|
trackItemDetailsMap: o,
|
2970
2970
|
trackItemIds: c,
|
2971
2971
|
tracks: l,
|
2972
2972
|
transitionIds: d,
|
2973
2973
|
transitionsMap: E,
|
2974
2974
|
trackItemsMap: D
|
2975
|
-
}),
|
2976
|
-
n.forEach((
|
2975
|
+
}), z = [], h = [], p = [], g = [], f = [], v = [];
|
2976
|
+
n.forEach((S) => {
|
2977
2977
|
let T;
|
2978
|
-
const H =
|
2979
|
-
|
2978
|
+
const H = S.path.slice(1);
|
2979
|
+
S.type === "CREATE" ? T = {
|
2980
2980
|
path: H,
|
2981
2981
|
op: "add",
|
2982
|
-
value:
|
2983
|
-
} :
|
2982
|
+
value: S.value
|
2983
|
+
} : S.type === "CHANGE" ? T = {
|
2984
2984
|
path: H,
|
2985
2985
|
op: "replace",
|
2986
|
-
value:
|
2986
|
+
value: S.value
|
2987
2987
|
} : T = {
|
2988
2988
|
path: H,
|
2989
2989
|
op: "remove",
|
2990
|
-
value:
|
2991
|
-
},
|
2990
|
+
value: S.oldValue
|
2991
|
+
}, S.path.includes("trackItemIds") ? p.push(T) : S.path.includes("transitionIds") ? h.push(T) : S.path.includes("trackItemsMap") ? f.push(T) : S.path.includes("transitionsMap") ? g.push(T) : S.path.includes("trackItemDetailsMap") ? v.push(T) : z.push(T);
|
2992
2992
|
});
|
2993
|
-
const
|
2994
|
-
|
2995
|
-
|
2996
|
-
),
|
2997
|
-
|
2993
|
+
const b = this.applyPatch(
|
2994
|
+
w.tracks,
|
2995
|
+
z
|
2996
|
+
), _ = this.applyPatch(
|
2997
|
+
w.transitionIds,
|
2998
2998
|
h
|
2999
|
-
),
|
3000
|
-
|
2999
|
+
), m = this.applyPatch(
|
3000
|
+
w.trackItemIds,
|
3001
3001
|
p
|
3002
3002
|
), y = this.applyPatch(
|
3003
|
-
|
3004
|
-
|
3003
|
+
w.transitionsMap,
|
3004
|
+
g
|
3005
3005
|
), F = this.applyPatch(
|
3006
|
-
|
3006
|
+
w.trackItemsMap,
|
3007
3007
|
f
|
3008
3008
|
), k = this.applyPatch(
|
3009
|
-
|
3010
|
-
|
3011
|
-
),
|
3012
|
-
tracks:
|
3013
|
-
transitionIds:
|
3014
|
-
trackItemIds:
|
3009
|
+
w.trackItemDetailsMap,
|
3010
|
+
v
|
3011
|
+
), M = tt({
|
3012
|
+
tracks: b,
|
3013
|
+
transitionIds: _,
|
3014
|
+
trackItemIds: m,
|
3015
3015
|
transitionsMap: y,
|
3016
3016
|
trackItemsMap: F,
|
3017
3017
|
trackItemDetailsMap: k
|
3018
|
-
}), N = tt(this.getState()),
|
3019
|
-
this.prevState = N, this.undos.push({ undos: n, type: a }), this.stateSubject.next(
|
3018
|
+
}), N = tt(this.getState()), R = { ...N, ...M };
|
3019
|
+
this.prevState = N, this.undos.push({ undos: n, type: a }), this.stateSubject.next(R), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
|
3020
3020
|
}
|
3021
3021
|
}
|
3022
3022
|
export {
|