@designcombo/state 0.1.29 → 0.1.30

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.es.js CHANGED
@@ -1,7 +1,7 @@
1
- var fi = Object.defineProperty;
2
- var pi = (t, r, n) => r in t ? fi(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
3
- var Mt = (t, r, n) => pi(t, typeof r != "symbol" ? r + "" : r, n);
4
- import { subject as $t, filter as Kt, DESIGN_PREFIX as di, ADD_PREFIX as hi, LAYER_PREFIX as yi, HISTORY_PREFIX as mi, ACTIVE_PREFIX as bi, EDIT_PREFIX as gi, DESIGN_LOAD as _i, DESIGN_RESIZE as vi, HISTORY_UNDO as Ii, HISTORY_REDO as Si, LAYER_DELETE as wi, LAYER_CLONE as ki, ADD_CAPTION as Ti, ADD_TEXT as Ei, ADD_IMAGE as Ai, ADD_AUDIO as Mi, ADD_VIDEO as Oi, ACTIVE_SPLIT as xi, ACTIVE_CLONE as Di, ACTIVE_PASTE as Pi, EDIT_OBJECT as Ci } from "@designcombo/events";
1
+ var pi = Object.defineProperty;
2
+ var hi = (t, r, n) => r in t ? pi(t, r, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[r] = n;
3
+ var Dt = (t, r, n) => hi(t, typeof r != "symbol" ? r + "" : r, n);
4
+ import { subject as Vt, filter as Xt, DESIGN_PREFIX as mi, ADD_PREFIX as yi, LAYER_PREFIX as bi, HISTORY_PREFIX as gi, ACTIVE_PREFIX as _i, EDIT_PREFIX as Ii, DESIGN_LOAD as vi, DESIGN_RESIZE as Si, HISTORY_UNDO as wi, HISTORY_REDO as ki, LAYER_DELETE as Ti, LAYER_CLONE as Ei, ADD_CAPTION as Mi, ADD_TEXT as Ai, ADD_TEMPLATE as Oi, ADD_IMAGE as xi, ADD_AUDIO as Di, ADD_VIDEO as Pi, ACTIVE_SPLIT as Ci, ACTIVE_CLONE as Ri, ACTIVE_PASTE as Fi, DELETE_TEMPLATE_ITEM as ji, EDIT_OBJECT as zi, EDIT_TEMPLATE_ITEM as Hi, CLOSE_EDIT_TEMPLATE as Ni } from "@designcombo/events";
5
5
  var sn = function(t, r) {
6
6
  return sn = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(n, i) {
7
7
  n.__proto__ = i;
@@ -9,7 +9,7 @@ var sn = function(t, r) {
9
9
  for (var s in i) Object.prototype.hasOwnProperty.call(i, s) && (n[s] = i[s]);
10
10
  }, sn(t, r);
11
11
  };
12
- function ge(t, r) {
12
+ function we(t, r) {
13
13
  if (typeof r != "function" && r !== null)
14
14
  throw new TypeError("Class extends value " + String(r) + " is not a constructor or null");
15
15
  sn(t, r);
@@ -31,16 +31,16 @@ function on(t) {
31
31
  function cn(t, r) {
32
32
  var n = typeof Symbol == "function" && t[Symbol.iterator];
33
33
  if (!n) return t;
34
- var i = n.call(t), s, c = [], f;
34
+ var i = n.call(t), s, c = [], h;
35
35
  try {
36
36
  for (; (r === void 0 || r-- > 0) && !(s = i.next()).done; ) c.push(s.value);
37
- } catch (h) {
38
- f = { error: h };
37
+ } catch (m) {
38
+ h = { error: m };
39
39
  } finally {
40
40
  try {
41
41
  s && !s.done && (n = i.return) && n.call(i);
42
42
  } finally {
43
- if (f) throw f.error;
43
+ if (h) throw h.error;
44
44
  }
45
45
  }
46
46
  return c;
@@ -50,7 +50,7 @@ function un(t, r, n) {
50
50
  (c || !(i in r)) && (c || (c = Array.prototype.slice.call(r, 0, i)), c[i] = r[i]);
51
51
  return t.concat(c || Array.prototype.slice.call(r));
52
52
  }
53
- function bt(t) {
53
+ function It(t) {
54
54
  return typeof t == "function";
55
55
  }
56
56
  function Yn(t) {
@@ -74,7 +74,7 @@ function ln(t, r) {
74
74
  0 <= n && t.splice(n, 1);
75
75
  }
76
76
  }
77
- var er = function() {
77
+ var ar = function() {
78
78
  function t(r) {
79
79
  this.initialTeardown = r, this.closed = !1, this._parentage = null, this._finalizers = null;
80
80
  }
@@ -82,49 +82,49 @@ var er = function() {
82
82
  var r, n, i, s, c;
83
83
  if (!this.closed) {
84
84
  this.closed = !0;
85
- var f = this._parentage;
86
- if (f)
87
- if (this._parentage = null, Array.isArray(f))
85
+ var h = this._parentage;
86
+ if (h)
87
+ if (this._parentage = null, Array.isArray(h))
88
88
  try {
89
- for (var h = on(f), x = h.next(); !x.done; x = h.next()) {
90
- var F = x.value;
89
+ for (var m = on(h), P = m.next(); !P.done; P = m.next()) {
90
+ var F = P.value;
91
91
  F.remove(this);
92
92
  }
93
- } catch (l) {
94
- r = { error: l };
93
+ } catch (p) {
94
+ r = { error: p };
95
95
  } finally {
96
96
  try {
97
- x && !x.done && (n = h.return) && n.call(h);
97
+ P && !P.done && (n = m.return) && n.call(m);
98
98
  } finally {
99
99
  if (r) throw r.error;
100
100
  }
101
101
  }
102
102
  else
103
- f.remove(this);
104
- var T = this.initialTeardown;
105
- if (bt(T))
103
+ h.remove(this);
104
+ var E = this.initialTeardown;
105
+ if (It(E))
106
106
  try {
107
- T();
108
- } catch (l) {
109
- c = l instanceof Qr ? l.errors : [l];
107
+ E();
108
+ } catch (p) {
109
+ c = p instanceof Qr ? p.errors : [p];
110
110
  }
111
- var H = this._finalizers;
112
- if (H) {
111
+ var N = this._finalizers;
112
+ if (N) {
113
113
  this._finalizers = null;
114
114
  try {
115
- for (var g = on(H), p = g.next(); !p.done; p = g.next()) {
116
- var y = p.value;
115
+ for (var b = on(N), d = b.next(); !d.done; d = b.next()) {
116
+ var f = d.value;
117
117
  try {
118
- En(y);
119
- } catch (l) {
120
- c = c ?? [], l instanceof Qr ? c = un(un([], cn(c)), cn(l.errors)) : c.push(l);
118
+ Dn(f);
119
+ } catch (p) {
120
+ c = c ?? [], p instanceof Qr ? c = un(un([], cn(c)), cn(p.errors)) : c.push(p);
121
121
  }
122
122
  }
123
- } catch (l) {
124
- i = { error: l };
123
+ } catch (p) {
124
+ i = { error: p };
125
125
  } finally {
126
126
  try {
127
- p && !p.done && (s = g.return) && s.call(g);
127
+ d && !d.done && (s = b.return) && s.call(b);
128
128
  } finally {
129
129
  if (i) throw i.error;
130
130
  }
@@ -137,7 +137,7 @@ var er = function() {
137
137
  var n;
138
138
  if (r && r !== this)
139
139
  if (this.closed)
140
- En(r);
140
+ Dn(r);
141
141
  else {
142
142
  if (r instanceof t) {
143
143
  if (r.closed || r._hasParent(this))
@@ -162,12 +162,12 @@ var er = function() {
162
162
  var r = new t();
163
163
  return r.closed = !0, r;
164
164
  }(), t;
165
- }(), Vn = er.EMPTY;
165
+ }(), Vn = ar.EMPTY;
166
166
  function Xn(t) {
167
- return t instanceof er || t && "closed" in t && bt(t.remove) && bt(t.add) && bt(t.unsubscribe);
167
+ return t instanceof ar || t && "closed" in t && It(t.remove) && It(t.add) && It(t.unsubscribe);
168
168
  }
169
- function En(t) {
170
- bt(t) ? t() : t.unsubscribe();
169
+ function Dn(t) {
170
+ It(t) ? t() : t.unsubscribe();
171
171
  }
172
172
  var qn = {
173
173
  onUnhandledError: null,
@@ -187,21 +187,21 @@ var qn = {
187
187
  },
188
188
  delegate: void 0
189
189
  };
190
- function ji(t) {
190
+ function Li(t) {
191
191
  Jn.setTimeout(function() {
192
192
  throw t;
193
193
  });
194
194
  }
195
- function An() {
195
+ function Pn() {
196
196
  }
197
- function Xe(t) {
197
+ function Qe(t) {
198
198
  t();
199
199
  }
200
200
  var Zn = function(t) {
201
- ge(r, t);
201
+ we(r, t);
202
202
  function r(n) {
203
203
  var i = t.call(this) || this;
204
- return i.isStopped = !1, n ? (i.destination = n, Xn(n) && n.add(i)) : i.destination = Ni, i;
204
+ return i.isStopped = !1, n ? (i.destination = n, Xn(n) && n.add(i)) : i.destination = Bi, i;
205
205
  }
206
206
  return r.create = function(n, i, s) {
207
207
  return new fn(n, i, s);
@@ -228,11 +228,11 @@ var Zn = function(t) {
228
228
  this.unsubscribe();
229
229
  }
230
230
  }, r;
231
- }(er), Ri = Function.prototype.bind;
231
+ }(ar), Ui = Function.prototype.bind;
232
232
  function tn(t, r) {
233
- return Ri.call(t, r);
233
+ return Ui.call(t, r);
234
234
  }
235
- var Fi = function() {
235
+ var Wi = function() {
236
236
  function t(r) {
237
237
  this.partialObserver = r;
238
238
  }
@@ -242,7 +242,7 @@ var Fi = function() {
242
242
  try {
243
243
  n.next(r);
244
244
  } catch (i) {
245
- Ve(i);
245
+ Ze(i);
246
246
  }
247
247
  }, t.prototype.error = function(r) {
248
248
  var n = this.partialObserver;
@@ -250,68 +250,68 @@ var Fi = function() {
250
250
  try {
251
251
  n.error(r);
252
252
  } catch (i) {
253
- Ve(i);
253
+ Ze(i);
254
254
  }
255
255
  else
256
- Ve(r);
256
+ Ze(r);
257
257
  }, t.prototype.complete = function() {
258
258
  var r = this.partialObserver;
259
259
  if (r.complete)
260
260
  try {
261
261
  r.complete();
262
262
  } catch (n) {
263
- Ve(n);
263
+ Ze(n);
264
264
  }
265
265
  }, t;
266
266
  }(), fn = function(t) {
267
- ge(r, t);
267
+ we(r, t);
268
268
  function r(n, i, s) {
269
- var c = t.call(this) || this, f;
270
- if (bt(n) || !n)
271
- f = {
269
+ var c = t.call(this) || this, h;
270
+ if (It(n) || !n)
271
+ h = {
272
272
  next: n ?? void 0,
273
273
  error: i ?? void 0,
274
274
  complete: s ?? void 0
275
275
  };
276
276
  else {
277
- var h;
278
- c && qn.useDeprecatedNextContext ? (h = Object.create(n), h.unsubscribe = function() {
277
+ var m;
278
+ c && qn.useDeprecatedNextContext ? (m = Object.create(n), m.unsubscribe = function() {
279
279
  return c.unsubscribe();
280
- }, f = {
281
- next: n.next && tn(n.next, h),
282
- error: n.error && tn(n.error, h),
283
- complete: n.complete && tn(n.complete, h)
284
- }) : f = n;
280
+ }, h = {
281
+ next: n.next && tn(n.next, m),
282
+ error: n.error && tn(n.error, m),
283
+ complete: n.complete && tn(n.complete, m)
284
+ }) : h = n;
285
285
  }
286
- return c.destination = new Fi(f), c;
286
+ return c.destination = new Wi(h), c;
287
287
  }
288
288
  return r;
289
289
  }(Zn);
290
- function Ve(t) {
291
- ji(t);
290
+ function Ze(t) {
291
+ Li(t);
292
292
  }
293
- function zi(t) {
293
+ function Gi(t) {
294
294
  throw t;
295
295
  }
296
- var Ni = {
296
+ var Bi = {
297
297
  closed: !0,
298
- next: An,
299
- error: zi,
300
- complete: An
301
- }, Hi = function() {
298
+ next: Pn,
299
+ error: Gi,
300
+ complete: Pn
301
+ }, $i = function() {
302
302
  return typeof Symbol == "function" && Symbol.observable || "@@observable";
303
303
  }();
304
- function Ui(t) {
304
+ function Ki(t) {
305
305
  return t;
306
306
  }
307
- function Li(t) {
308
- return t.length === 0 ? Ui : t.length === 1 ? t[0] : function(n) {
307
+ function Yi(t) {
308
+ return t.length === 0 ? Ki : t.length === 1 ? t[0] : function(n) {
309
309
  return t.reduce(function(i, s) {
310
310
  return s(i);
311
311
  }, n);
312
312
  };
313
313
  }
314
- var Mn = function() {
314
+ var Cn = function() {
315
315
  function t(r) {
316
316
  r && (this._subscribe = r);
317
317
  }
@@ -319,10 +319,10 @@ var Mn = function() {
319
319
  var n = new t();
320
320
  return n.source = this, n.operator = r, n;
321
321
  }, t.prototype.subscribe = function(r, n, i) {
322
- var s = this, c = Wi(r) ? r : new fn(r, n, i);
323
- return Xe(function() {
324
- var f = s, h = f.operator, x = f.source;
325
- c.add(h ? h.call(c, x) : x ? s._subscribe(c) : s._trySubscribe(c));
322
+ var s = this, c = Xi(r) ? r : new fn(r, n, i);
323
+ return Qe(function() {
324
+ var h = s, m = h.operator, P = h.source;
325
+ c.add(m ? m.call(c, P) : P ? s._subscribe(c) : s._trySubscribe(c));
326
326
  }), c;
327
327
  }, t.prototype._trySubscribe = function(r) {
328
328
  try {
@@ -332,37 +332,37 @@ var Mn = function() {
332
332
  }
333
333
  }, t.prototype.forEach = function(r, n) {
334
334
  var i = this;
335
- return n = On(n), new n(function(s, c) {
336
- var f = new fn({
337
- next: function(h) {
335
+ return n = Rn(n), new n(function(s, c) {
336
+ var h = new fn({
337
+ next: function(m) {
338
338
  try {
339
- r(h);
340
- } catch (x) {
341
- c(x), f.unsubscribe();
339
+ r(m);
340
+ } catch (P) {
341
+ c(P), h.unsubscribe();
342
342
  }
343
343
  },
344
344
  error: c,
345
345
  complete: s
346
346
  });
347
- i.subscribe(f);
347
+ i.subscribe(h);
348
348
  });
349
349
  }, t.prototype._subscribe = function(r) {
350
350
  var n;
351
351
  return (n = this.source) === null || n === void 0 ? void 0 : n.subscribe(r);
352
- }, t.prototype[Hi] = function() {
352
+ }, t.prototype[$i] = function() {
353
353
  return this;
354
354
  }, t.prototype.pipe = function() {
355
355
  for (var r = [], n = 0; n < arguments.length; n++)
356
356
  r[n] = arguments[n];
357
- return Li(r)(this);
357
+ return Yi(r)(this);
358
358
  }, t.prototype.toPromise = function(r) {
359
359
  var n = this;
360
- return r = On(r), new r(function(i, s) {
360
+ return r = Rn(r), new r(function(i, s) {
361
361
  var c;
362
- n.subscribe(function(f) {
363
- return c = f;
364
- }, function(f) {
365
- return s(f);
362
+ n.subscribe(function(h) {
363
+ return c = h;
364
+ }, function(h) {
365
+ return s(h);
366
366
  }, function() {
367
367
  return i(c);
368
368
  });
@@ -371,48 +371,48 @@ var Mn = function() {
371
371
  return new t(r);
372
372
  }, t;
373
373
  }();
374
- function On(t) {
374
+ function Rn(t) {
375
375
  var r;
376
376
  return (r = t ?? qn.Promise) !== null && r !== void 0 ? r : Promise;
377
377
  }
378
- function Gi(t) {
379
- return t && bt(t.next) && bt(t.error) && bt(t.complete);
378
+ function Vi(t) {
379
+ return t && It(t.next) && It(t.error) && It(t.complete);
380
380
  }
381
- function Wi(t) {
382
- return t && t instanceof Zn || Gi(t) && Xn(t);
381
+ function Xi(t) {
382
+ return t && t instanceof Zn || Vi(t) && Xn(t);
383
383
  }
384
- var Bi = Yn(function(t) {
384
+ var qi = Yn(function(t) {
385
385
  return function() {
386
386
  t(this), this.name = "ObjectUnsubscribedError", this.message = "object unsubscribed";
387
387
  };
388
388
  }), Qn = function(t) {
389
- ge(r, t);
389
+ we(r, t);
390
390
  function r() {
391
391
  var n = t.call(this) || this;
392
392
  return n.closed = !1, n.currentObservers = null, n.observers = [], n.isStopped = !1, n.hasError = !1, n.thrownError = null, n;
393
393
  }
394
394
  return r.prototype.lift = function(n) {
395
- var i = new xn(this, this);
395
+ var i = new Fn(this, this);
396
396
  return i.operator = n, i;
397
397
  }, r.prototype._throwIfClosed = function() {
398
398
  if (this.closed)
399
- throw new Bi();
399
+ throw new qi();
400
400
  }, r.prototype.next = function(n) {
401
401
  var i = this;
402
- Xe(function() {
402
+ Qe(function() {
403
403
  var s, c;
404
404
  if (i._throwIfClosed(), !i.isStopped) {
405
405
  i.currentObservers || (i.currentObservers = Array.from(i.observers));
406
406
  try {
407
- for (var f = on(i.currentObservers), h = f.next(); !h.done; h = f.next()) {
408
- var x = h.value;
409
- x.next(n);
407
+ for (var h = on(i.currentObservers), m = h.next(); !m.done; m = h.next()) {
408
+ var P = m.value;
409
+ P.next(n);
410
410
  }
411
411
  } catch (F) {
412
412
  s = { error: F };
413
413
  } finally {
414
414
  try {
415
- h && !h.done && (c = f.return) && c.call(f);
415
+ m && !m.done && (c = h.return) && c.call(h);
416
416
  } finally {
417
417
  if (s) throw s.error;
418
418
  }
@@ -421,7 +421,7 @@ var Bi = Yn(function(t) {
421
421
  });
422
422
  }, r.prototype.error = function(n) {
423
423
  var i = this;
424
- Xe(function() {
424
+ Qe(function() {
425
425
  if (i._throwIfClosed(), !i.isStopped) {
426
426
  i.hasError = i.isStopped = !0, i.thrownError = n;
427
427
  for (var s = i.observers; s.length; )
@@ -430,7 +430,7 @@ var Bi = Yn(function(t) {
430
430
  });
431
431
  }, r.prototype.complete = function() {
432
432
  var n = this;
433
- Xe(function() {
433
+ Qe(function() {
434
434
  if (n._throwIfClosed(), !n.isStopped) {
435
435
  n.isStopped = !0;
436
436
  for (var i = n.observers; i.length; )
@@ -451,21 +451,21 @@ var Bi = Yn(function(t) {
451
451
  }, r.prototype._subscribe = function(n) {
452
452
  return this._throwIfClosed(), this._checkFinalizedStatuses(n), this._innerSubscribe(n);
453
453
  }, r.prototype._innerSubscribe = function(n) {
454
- var i = this, s = this, c = s.hasError, f = s.isStopped, h = s.observers;
455
- return c || f ? Vn : (this.currentObservers = null, h.push(n), new er(function() {
456
- i.currentObservers = null, ln(h, n);
454
+ var i = this, s = this, c = s.hasError, h = s.isStopped, m = s.observers;
455
+ return c || h ? Vn : (this.currentObservers = null, m.push(n), new ar(function() {
456
+ i.currentObservers = null, ln(m, n);
457
457
  }));
458
458
  }, r.prototype._checkFinalizedStatuses = function(n) {
459
- var i = this, s = i.hasError, c = i.thrownError, f = i.isStopped;
460
- s ? n.error(c) : f && n.complete();
459
+ var i = this, s = i.hasError, c = i.thrownError, h = i.isStopped;
460
+ s ? n.error(c) : h && n.complete();
461
461
  }, r.prototype.asObservable = function() {
462
- var n = new Mn();
462
+ var n = new Cn();
463
463
  return n.source = this, n;
464
464
  }, r.create = function(n, i) {
465
- return new xn(n, i);
465
+ return new Fn(n, i);
466
466
  }, r;
467
- }(Mn), xn = function(t) {
468
- ge(r, t);
467
+ }(Cn), Fn = function(t) {
468
+ we(r, t);
469
469
  function r(n, i) {
470
470
  var s = t.call(this) || this;
471
471
  return s.destination = n, s.source = i, s;
@@ -483,8 +483,8 @@ var Bi = Yn(function(t) {
483
483
  var i, s;
484
484
  return (s = (i = this.source) === null || i === void 0 ? void 0 : i.subscribe(n)) !== null && s !== void 0 ? s : Vn;
485
485
  }, r;
486
- }(Qn), Dn = function(t) {
487
- ge(r, t);
486
+ }(Qn), jn = function(t) {
487
+ we(r, t);
488
488
  function r(n) {
489
489
  var i = t.call(this) || this;
490
490
  return i._value = n, i;
@@ -506,79 +506,79 @@ var Bi = Yn(function(t) {
506
506
  }, r.prototype.next = function(n) {
507
507
  t.prototype.next.call(this, this._value = n);
508
508
  }, r;
509
- }(Qn), it = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
510
- function gn(t) {
509
+ }(Qn), st = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
510
+ function wn(t) {
511
511
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
512
512
  }
513
- var Je = { exports: {} };
514
- Je.exports;
513
+ var er = { exports: {} };
514
+ er.exports;
515
515
  (function(t, r) {
516
- var n = 200, i = "__lodash_hash_undefined__", s = 1, c = 2, f = 9007199254740991, h = "[object Arguments]", x = "[object Array]", F = "[object AsyncFunction]", T = "[object Boolean]", H = "[object Date]", g = "[object Error]", p = "[object Function]", y = "[object GeneratorFunction]", l = "[object Map]", m = "[object Number]", S = "[object Null]", v = "[object Object]", b = "[object Promise]", d = "[object Proxy]", O = "[object RegExp]", E = "[object Set]", _ = "[object String]", D = "[object Symbol]", I = "[object Undefined]", P = "[object WeakMap]", k = "[object ArrayBuffer]", A = "[object DataView]", U = "[object Float32Array]", J = "[object Float64Array]", Se = "[object Int8Array]", ar = "[object Int16Array]", sr = "[object Int32Array]", or = "[object Uint8Array]", cr = "[object Uint8ClampedArray]", z = "[object Uint16Array]", ur = "[object Uint32Array]", lr = /[\\^$.*+?()[\]{}|]/g, at = /^\[object .+?Constructor\]$/, we = /^(?:0|[1-9]\d*)$/, N = {};
517
- N[U] = N[J] = N[Se] = N[ar] = N[sr] = N[or] = N[cr] = N[z] = N[ur] = !0, N[h] = N[x] = N[k] = N[T] = N[A] = N[H] = N[g] = N[p] = N[l] = N[m] = N[v] = N[O] = N[E] = N[_] = N[P] = !1;
518
- var ke = typeof it == "object" && it && it.Object === Object && it, fr = typeof self == "object" && self && self.Object === Object && self, st = ke || fr || Function("return this")(), Te = r && !r.nodeType && r, Ee = Te && !0 && t && !t.nodeType && t, Vt = Ee && Ee.exports === Te, Xt = Vt && ke.process, Ae = function() {
516
+ var n = 200, i = "__lodash_hash_undefined__", s = 1, c = 2, h = 9007199254740991, m = "[object Arguments]", P = "[object Array]", F = "[object AsyncFunction]", E = "[object Boolean]", N = "[object Date]", b = "[object Error]", d = "[object Function]", f = "[object GeneratorFunction]", p = "[object Map]", g = "[object Number]", S = "[object Null]", _ = "[object Object]", y = "[object Promise]", l = "[object Proxy]", x = "[object RegExp]", M = "[object Set]", I = "[object String]", C = "[object Symbol]", w = "[object Undefined]", D = "[object WeakMap]", k = "[object ArrayBuffer]", v = "[object DataView]", A = "[object Float32Array]", O = "[object Float64Array]", Z = "[object Int8Array]", V = "[object Int16Array]", ft = "[object Int32Array]", Jt = "[object Uint8Array]", Zt = "[object Uint8ClampedArray]", L = "[object Uint16Array]", ur = "[object Uint32Array]", lr = /[\\^$.*+?()[\]{}|]/g, ot = /^\[object .+?Constructor\]$/, Me = /^(?:0|[1-9]\d*)$/, U = {};
517
+ U[A] = U[O] = U[Z] = U[V] = U[ft] = U[Jt] = U[Zt] = U[L] = U[ur] = !0, U[m] = U[P] = U[k] = U[E] = U[v] = U[N] = U[b] = U[d] = U[p] = U[g] = U[_] = U[x] = U[M] = U[I] = U[D] = !1;
518
+ var Ae = typeof st == "object" && st && st.Object === Object && st, fr = typeof self == "object" && self && self.Object === Object && self, ct = Ae || fr || Function("return this")(), Oe = r && !r.nodeType && r, xe = Oe && !0 && t && !t.nodeType && t, Qt = xe && xe.exports === Oe, te = Qt && Ae.process, De = function() {
519
519
  try {
520
- return Xt && Xt.binding && Xt.binding("util");
520
+ return te && te.binding && te.binding("util");
521
521
  } catch {
522
522
  }
523
- }(), qt = Ae && Ae.isTypedArray;
524
- function Me(e, a) {
525
- for (var o = -1, u = e == null ? 0 : e.length, M = 0, w = []; ++o < u; ) {
526
- var j = e[o];
527
- a(j, o, e) && (w[M++] = j);
523
+ }(), ee = De && De.isTypedArray;
524
+ function Pe(e, a) {
525
+ for (var o = -1, u = e == null ? 0 : e.length, R = 0, T = []; ++o < u; ) {
526
+ var z = e[o];
527
+ a(z, o, e) && (T[R++] = z);
528
528
  }
529
- return w;
529
+ return T;
530
530
  }
531
- function Jt(e, a) {
532
- for (var o = -1, u = a.length, M = e.length; ++o < u; )
533
- e[M + o] = a[o];
531
+ function re(e, a) {
532
+ for (var o = -1, u = a.length, R = e.length; ++o < u; )
533
+ e[R + o] = a[o];
534
534
  return e;
535
535
  }
536
- function Oe(e, a) {
536
+ function Ce(e, a) {
537
537
  for (var o = -1, u = e == null ? 0 : e.length; ++o < u; )
538
538
  if (a(e[o], o, e))
539
539
  return !0;
540
540
  return !1;
541
541
  }
542
- function pr(e, a) {
542
+ function dr(e, a) {
543
543
  for (var o = -1, u = Array(e); ++o < e; )
544
544
  u[o] = a(o);
545
545
  return u;
546
546
  }
547
- function dr(e) {
547
+ function pr(e) {
548
548
  return function(a) {
549
549
  return e(a);
550
550
  };
551
551
  }
552
- function jt(e, a) {
552
+ function zt(e, a) {
553
553
  return e.has(a);
554
554
  }
555
- function Zt(e, a) {
555
+ function ne(e, a) {
556
556
  return e == null ? void 0 : e[a];
557
557
  }
558
- function xe(e) {
558
+ function Re(e) {
559
559
  var a = -1, o = Array(e.size);
560
- return e.forEach(function(u, M) {
561
- o[++a] = [M, u];
560
+ return e.forEach(function(u, R) {
561
+ o[++a] = [R, u];
562
562
  }), o;
563
563
  }
564
- function De(e, a) {
564
+ function Fe(e, a) {
565
565
  return function(o) {
566
566
  return e(a(o));
567
567
  };
568
568
  }
569
- function ut(e) {
569
+ function dt(e) {
570
570
  var a = -1, o = Array(e.size);
571
571
  return e.forEach(function(u) {
572
572
  o[++a] = u;
573
573
  }), o;
574
574
  }
575
- var Rt = Array.prototype, hr = Function.prototype, It = Object.prototype, Ft = st["__core-js_shared__"], Qt = hr.toString, rt = It.hasOwnProperty, Pe = function() {
576
- var e = /[^.]+$/.exec(Ft && Ft.keys && Ft.keys.IE_PROTO || "");
575
+ var Ht = Array.prototype, hr = Function.prototype, kt = Object.prototype, Nt = ct["__core-js_shared__"], ie = hr.toString, at = kt.hasOwnProperty, je = function() {
576
+ var e = /[^.]+$/.exec(Nt && Nt.keys && Nt.keys.IE_PROTO || "");
577
577
  return e ? "Symbol(src)_1." + e : "";
578
- }(), Ce = It.toString, yr = RegExp(
579
- "^" + Qt.call(rt).replace(lr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
580
- ), te = Vt ? st.Buffer : void 0, zt = st.Symbol, je = st.Uint8Array, Nt = It.propertyIsEnumerable, St = Rt.splice, ot = zt ? zt.toStringTag : void 0, Ht = Object.getOwnPropertySymbols, ee = te ? te.isBuffer : void 0, wt = De(Object.keys, Object), re = ht(st, "DataView"), kt = ht(st, "Map"), ne = ht(st, "Promise"), ie = ht(st, "Set"), ae = ht(st, "WeakMap"), gt = ht(Object, "create"), Re = q(re), dt = q(kt), mr = q(ne), br = q(ie), gr = q(ae), Fe = zt ? zt.prototype : void 0, se = Fe ? Fe.valueOf : void 0;
581
- function B(e) {
578
+ }(), ze = kt.toString, mr = RegExp(
579
+ "^" + ie.call(at).replace(lr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
580
+ ), ae = Qt ? ct.Buffer : void 0, Lt = ct.Symbol, He = ct.Uint8Array, Ut = kt.propertyIsEnumerable, Tt = Ht.splice, ut = Lt ? Lt.toStringTag : void 0, Wt = Object.getOwnPropertySymbols, se = ae ? ae.isBuffer : void 0, Et = Fe(Object.keys, Object), oe = bt(ct, "DataView"), Mt = bt(ct, "Map"), ce = bt(ct, "Promise"), ue = bt(ct, "Set"), le = bt(ct, "WeakMap"), vt = bt(Object, "create"), Ne = Q(oe), yt = Q(Mt), yr = Q(ce), br = Q(ue), gr = Q(le), Le = Lt ? Lt.prototype : void 0, fe = Le ? Le.valueOf : void 0;
581
+ function K(e) {
582
582
  var a = -1, o = e == null ? 0 : e.length;
583
583
  for (this.clear(); ++a < o; ) {
584
584
  var u = e[a];
@@ -586,30 +586,30 @@ Je.exports;
586
586
  }
587
587
  }
588
588
  function _r() {
589
- this.__data__ = gt ? gt(null) : {}, this.size = 0;
589
+ this.__data__ = vt ? vt(null) : {}, this.size = 0;
590
590
  }
591
- function vr(e) {
591
+ function Ir(e) {
592
592
  var a = this.has(e) && delete this.__data__[e];
593
593
  return this.size -= a ? 1 : 0, a;
594
594
  }
595
- function Ir(e) {
595
+ function vr(e) {
596
596
  var a = this.__data__;
597
- if (gt) {
597
+ if (vt) {
598
598
  var o = a[e];
599
599
  return o === i ? void 0 : o;
600
600
  }
601
- return rt.call(a, e) ? a[e] : void 0;
601
+ return at.call(a, e) ? a[e] : void 0;
602
602
  }
603
603
  function Sr(e) {
604
604
  var a = this.__data__;
605
- return gt ? a[e] !== void 0 : rt.call(a, e);
605
+ return vt ? a[e] !== void 0 : at.call(a, e);
606
606
  }
607
607
  function wr(e, a) {
608
608
  var o = this.__data__;
609
- return this.size += this.has(e) ? 0 : 1, o[e] = gt && a === void 0 ? i : a, this;
609
+ return this.size += this.has(e) ? 0 : 1, o[e] = vt && a === void 0 ? i : a, this;
610
610
  }
611
- B.prototype.clear = _r, B.prototype.delete = vr, B.prototype.get = Ir, B.prototype.has = Sr, B.prototype.set = wr;
612
- function K(e) {
611
+ K.prototype.clear = _r, K.prototype.delete = Ir, K.prototype.get = vr, K.prototype.has = Sr, K.prototype.set = wr;
612
+ function X(e) {
613
613
  var a = -1, o = e == null ? 0 : e.length;
614
614
  for (this.clear(); ++a < o; ) {
615
615
  var u = e[a];
@@ -620,25 +620,25 @@ Je.exports;
620
620
  this.__data__ = [], this.size = 0;
621
621
  }
622
622
  function Tr(e) {
623
- var a = this.__data__, o = Gt(a, e);
623
+ var a = this.__data__, o = $t(a, e);
624
624
  if (o < 0)
625
625
  return !1;
626
626
  var u = a.length - 1;
627
- return o == u ? a.pop() : St.call(a, o, 1), --this.size, !0;
627
+ return o == u ? a.pop() : Tt.call(a, o, 1), --this.size, !0;
628
628
  }
629
629
  function Er(e) {
630
- var a = this.__data__, o = Gt(a, e);
630
+ var a = this.__data__, o = $t(a, e);
631
631
  return o < 0 ? void 0 : a[o][1];
632
632
  }
633
- function Ar(e) {
634
- return Gt(this.__data__, e) > -1;
633
+ function Mr(e) {
634
+ return $t(this.__data__, e) > -1;
635
635
  }
636
- function Mr(e, a) {
637
- var o = this.__data__, u = Gt(o, e);
636
+ function Ar(e, a) {
637
+ var o = this.__data__, u = $t(o, e);
638
638
  return u < 0 ? (++this.size, o.push([e, a])) : o[u][1] = a, this;
639
639
  }
640
- K.prototype.clear = kr, K.prototype.delete = Tr, K.prototype.get = Er, K.prototype.has = Ar, K.prototype.set = Mr;
641
- function Z(e) {
640
+ X.prototype.clear = kr, X.prototype.delete = Tr, X.prototype.get = Er, X.prototype.has = Mr, X.prototype.set = Ar;
641
+ function tt(e) {
642
642
  var a = -1, o = e == null ? 0 : e.length;
643
643
  for (this.clear(); ++a < o; ) {
644
644
  var u = e[a];
@@ -647,295 +647,295 @@ Je.exports;
647
647
  }
648
648
  function Or() {
649
649
  this.size = 0, this.__data__ = {
650
- hash: new B(),
651
- map: new (kt || K)(),
652
- string: new B()
650
+ hash: new K(),
651
+ map: new (Mt || X)(),
652
+ string: new K()
653
653
  };
654
654
  }
655
655
  function xr(e) {
656
- var a = ct(this, e).delete(e);
656
+ var a = lt(this, e).delete(e);
657
657
  return this.size -= a ? 1 : 0, a;
658
658
  }
659
659
  function Dr(e) {
660
- return ct(this, e).get(e);
660
+ return lt(this, e).get(e);
661
661
  }
662
662
  function Pr(e) {
663
- return ct(this, e).has(e);
663
+ return lt(this, e).has(e);
664
664
  }
665
665
  function Cr(e, a) {
666
- var o = ct(this, e), u = o.size;
666
+ var o = lt(this, e), u = o.size;
667
667
  return o.set(e, a), this.size += o.size == u ? 0 : 1, this;
668
668
  }
669
- Z.prototype.clear = Or, Z.prototype.delete = xr, Z.prototype.get = Dr, Z.prototype.has = Pr, Z.prototype.set = Cr;
670
- function Ut(e) {
669
+ tt.prototype.clear = Or, tt.prototype.delete = xr, tt.prototype.get = Dr, tt.prototype.has = Pr, tt.prototype.set = Cr;
670
+ function Gt(e) {
671
671
  var a = -1, o = e == null ? 0 : e.length;
672
- for (this.__data__ = new Z(); ++a < o; )
672
+ for (this.__data__ = new tt(); ++a < o; )
673
673
  this.add(e[a]);
674
674
  }
675
- function ze(e) {
675
+ function Ue(e) {
676
676
  return this.__data__.set(e, i), this;
677
677
  }
678
- function Lt(e) {
678
+ function Bt(e) {
679
679
  return this.__data__.has(e);
680
680
  }
681
- Ut.prototype.add = Ut.prototype.push = ze, Ut.prototype.has = Lt;
682
- function lt(e) {
683
- var a = this.__data__ = new K(e);
681
+ Gt.prototype.add = Gt.prototype.push = Ue, Gt.prototype.has = Bt;
682
+ function pt(e) {
683
+ var a = this.__data__ = new X(e);
684
684
  this.size = a.size;
685
685
  }
686
- function oe() {
687
- this.__data__ = new K(), this.size = 0;
686
+ function de() {
687
+ this.__data__ = new X(), this.size = 0;
688
688
  }
689
- function jr(e) {
689
+ function Rr(e) {
690
690
  var a = this.__data__, o = a.delete(e);
691
691
  return this.size = a.size, o;
692
692
  }
693
- function Rr(e) {
693
+ function Fr(e) {
694
694
  return this.__data__.get(e);
695
695
  }
696
- function Fr(e) {
696
+ function jr(e) {
697
697
  return this.__data__.has(e);
698
698
  }
699
699
  function zr(e, a) {
700
700
  var o = this.__data__;
701
- if (o instanceof K) {
701
+ if (o instanceof X) {
702
702
  var u = o.__data__;
703
- if (!kt || u.length < n - 1)
703
+ if (!Mt || u.length < n - 1)
704
704
  return u.push([e, a]), this.size = ++o.size, this;
705
- o = this.__data__ = new Z(u);
705
+ o = this.__data__ = new tt(u);
706
706
  }
707
707
  return o.set(e, a), this.size = o.size, this;
708
708
  }
709
- lt.prototype.clear = oe, lt.prototype.delete = jr, lt.prototype.get = Rr, lt.prototype.has = Fr, lt.prototype.set = zr;
710
- function Nr(e, a) {
711
- var o = Wt(e), u = !o && Ge(e), M = !o && !u && Bt(e), w = !o && !u && !M && $e(e), j = o || u || M || w, C = j ? pr(e.length, String) : [], L = C.length;
712
- for (var R in e)
713
- rt.call(e, R) && !(j && // Safari 9 has enumerable `arguments.length` in strict mode.
714
- (R == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
715
- M && (R == "offset" || R == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
716
- w && (R == "buffer" || R == "byteLength" || R == "byteOffset") || // Skip index properties.
717
- Kr(R, L))) && C.push(R);
718
- return C;
719
- }
720
- function Gt(e, a) {
709
+ pt.prototype.clear = de, pt.prototype.delete = Rr, pt.prototype.get = Fr, pt.prototype.has = jr, pt.prototype.set = zr;
710
+ function Hr(e, a) {
711
+ var o = Kt(e), u = !o && Ke(e), R = !o && !u && Yt(e), T = !o && !u && !R && Xe(e), z = o || u || R || T, j = z ? dr(e.length, String) : [], W = j.length;
712
+ for (var H in e)
713
+ at.call(e, H) && !(z && // Safari 9 has enumerable `arguments.length` in strict mode.
714
+ (H == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
715
+ R && (H == "offset" || H == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
716
+ T && (H == "buffer" || H == "byteLength" || H == "byteOffset") || // Skip index properties.
717
+ Kr(H, W))) && j.push(H);
718
+ return j;
719
+ }
720
+ function $t(e, a) {
721
721
  for (var o = e.length; o--; )
722
- if (Le(e[o][0], a))
722
+ if ($e(e[o][0], a))
723
723
  return o;
724
724
  return -1;
725
725
  }
726
- function ce(e, a, o) {
726
+ function pe(e, a, o) {
727
727
  var u = a(e);
728
- return Wt(e) ? u : Jt(u, o(e));
728
+ return Kt(e) ? u : re(u, o(e));
729
729
  }
730
- function Tt(e) {
731
- return e == null ? e === void 0 ? I : S : ot && ot in Object(e) ? yt(e) : Ue(e);
730
+ function At(e) {
731
+ return e == null ? e === void 0 ? w : S : ut && ut in Object(e) ? gt(e) : Be(e);
732
732
  }
733
- function Ne(e) {
734
- return pt(e) && Tt(e) == h;
733
+ function We(e) {
734
+ return mt(e) && At(e) == m;
735
735
  }
736
- function He(e, a, o, u, M) {
737
- return e === a ? !0 : e == null || a == null || !pt(e) && !pt(a) ? e !== e && a !== a : Hr(e, a, o, u, He, M);
736
+ function Ge(e, a, o, u, R) {
737
+ return e === a ? !0 : e == null || a == null || !mt(e) && !mt(a) ? e !== e && a !== a : Nr(e, a, o, u, Ge, R);
738
738
  }
739
- function Hr(e, a, o, u, M, w) {
740
- var j = Wt(e), C = Wt(a), L = j ? x : ft(e), R = C ? x : ft(a);
741
- L = L == h ? v : L, R = R == h ? v : R;
742
- var Y = L == v, Q = R == v, G = L == R;
743
- if (G && Bt(e)) {
744
- if (!Bt(a))
739
+ function Nr(e, a, o, u, R, T) {
740
+ var z = Kt(e), j = Kt(a), W = z ? P : ht(e), H = j ? P : ht(a);
741
+ W = W == m ? _ : W, H = H == m ? _ : H;
742
+ var q = W == _, et = H == _, G = W == H;
743
+ if (G && Yt(e)) {
744
+ if (!Yt(a))
745
745
  return !1;
746
- j = !0, Y = !1;
746
+ z = !0, q = !1;
747
747
  }
748
- if (G && !Y)
749
- return w || (w = new lt()), j || $e(e) ? ue(e, a, o, u, M, w) : Wr(e, a, L, o, u, M, w);
748
+ if (G && !q)
749
+ return T || (T = new pt()), z || Xe(e) ? he(e, a, o, u, R, T) : Gr(e, a, W, o, u, R, T);
750
750
  if (!(o & s)) {
751
- var V = Y && rt.call(e, "__wrapped__"), $ = Q && rt.call(a, "__wrapped__");
752
- if (V || $) {
753
- var _t = V ? e.value() : e, mt = $ ? a.value() : a;
754
- return w || (w = new lt()), M(_t, mt, o, u, w);
751
+ var J = q && at.call(e, "__wrapped__"), Y = et && at.call(a, "__wrapped__");
752
+ if (J || Y) {
753
+ var St = J ? e.value() : e, _t = Y ? a.value() : a;
754
+ return T || (T = new pt()), R(St, _t, o, u, T);
755
755
  }
756
756
  }
757
- return G ? (w || (w = new lt()), Br(e, a, o, u, M, w)) : !1;
757
+ return G ? (T || (T = new pt()), Br(e, a, o, u, R, T)) : !1;
758
758
  }
759
- function Ur(e) {
760
- if (!Be(e) || Vr(e))
759
+ function Lr(e) {
760
+ if (!Ve(e) || Vr(e))
761
761
  return !1;
762
- var a = We(e) ? yr : at;
763
- return a.test(q(e));
762
+ var a = Ye(e) ? mr : ot;
763
+ return a.test(Q(e));
764
764
  }
765
- function Lr(e) {
766
- return pt(e) && fe(e.length) && !!N[Tt(e)];
765
+ function Ur(e) {
766
+ return mt(e) && ye(e.length) && !!U[At(e)];
767
767
  }
768
- function Gr(e) {
768
+ function Wr(e) {
769
769
  if (!Xr(e))
770
- return wt(e);
770
+ return Et(e);
771
771
  var a = [];
772
772
  for (var o in Object(e))
773
- rt.call(e, o) && o != "constructor" && a.push(o);
773
+ at.call(e, o) && o != "constructor" && a.push(o);
774
774
  return a;
775
775
  }
776
- function ue(e, a, o, u, M, w) {
777
- var j = o & s, C = e.length, L = a.length;
778
- if (C != L && !(j && L > C))
776
+ function he(e, a, o, u, R, T) {
777
+ var z = o & s, j = e.length, W = a.length;
778
+ if (j != W && !(z && W > j))
779
779
  return !1;
780
- var R = w.get(e);
781
- if (R && w.get(a))
782
- return R == a;
783
- var Y = -1, Q = !0, G = o & c ? new Ut() : void 0;
784
- for (w.set(e, a), w.set(a, e); ++Y < C; ) {
785
- var V = e[Y], $ = a[Y];
780
+ var H = T.get(e);
781
+ if (H && T.get(a))
782
+ return H == a;
783
+ var q = -1, et = !0, G = o & c ? new Gt() : void 0;
784
+ for (T.set(e, a), T.set(a, e); ++q < j; ) {
785
+ var J = e[q], Y = a[q];
786
786
  if (u)
787
- var _t = j ? u($, V, Y, a, e, w) : u(V, $, Y, e, a, w);
788
- if (_t !== void 0) {
789
- if (_t)
787
+ var St = z ? u(Y, J, q, a, e, T) : u(J, Y, q, e, a, T);
788
+ if (St !== void 0) {
789
+ if (St)
790
790
  continue;
791
- Q = !1;
791
+ et = !1;
792
792
  break;
793
793
  }
794
794
  if (G) {
795
- if (!Oe(a, function(mt, At) {
796
- if (!jt(G, At) && (V === mt || M(V, mt, o, u, w)))
797
- return G.push(At);
795
+ if (!Ce(a, function(_t, xt) {
796
+ if (!zt(G, xt) && (J === _t || R(J, _t, o, u, T)))
797
+ return G.push(xt);
798
798
  })) {
799
- Q = !1;
799
+ et = !1;
800
800
  break;
801
801
  }
802
- } else if (!(V === $ || M(V, $, o, u, w))) {
803
- Q = !1;
802
+ } else if (!(J === Y || R(J, Y, o, u, T))) {
803
+ et = !1;
804
804
  break;
805
805
  }
806
806
  }
807
- return w.delete(e), w.delete(a), Q;
807
+ return T.delete(e), T.delete(a), et;
808
808
  }
809
- function Wr(e, a, o, u, M, w, j) {
809
+ function Gr(e, a, o, u, R, T, z) {
810
810
  switch (o) {
811
- case A:
811
+ case v:
812
812
  if (e.byteLength != a.byteLength || e.byteOffset != a.byteOffset)
813
813
  return !1;
814
814
  e = e.buffer, a = a.buffer;
815
815
  case k:
816
- return !(e.byteLength != a.byteLength || !w(new je(e), new je(a)));
817
- case T:
818
- case H:
819
- case m:
820
- return Le(+e, +a);
816
+ return !(e.byteLength != a.byteLength || !T(new He(e), new He(a)));
817
+ case E:
818
+ case N:
821
819
  case g:
820
+ return $e(+e, +a);
821
+ case b:
822
822
  return e.name == a.name && e.message == a.message;
823
- case O:
824
- case _:
823
+ case x:
824
+ case I:
825
825
  return e == a + "";
826
- case l:
827
- var C = xe;
828
- case E:
829
- var L = u & s;
830
- if (C || (C = ut), e.size != a.size && !L)
826
+ case p:
827
+ var j = Re;
828
+ case M:
829
+ var W = u & s;
830
+ if (j || (j = dt), e.size != a.size && !W)
831
831
  return !1;
832
- var R = j.get(e);
833
- if (R)
834
- return R == a;
835
- u |= c, j.set(e, a);
836
- var Y = ue(C(e), C(a), u, M, w, j);
837
- return j.delete(e), Y;
838
- case D:
839
- if (se)
840
- return se.call(e) == se.call(a);
832
+ var H = z.get(e);
833
+ if (H)
834
+ return H == a;
835
+ u |= c, z.set(e, a);
836
+ var q = he(j(e), j(a), u, R, T, z);
837
+ return z.delete(e), q;
838
+ case C:
839
+ if (fe)
840
+ return fe.call(e) == fe.call(a);
841
841
  }
842
842
  return !1;
843
843
  }
844
- function Br(e, a, o, u, M, w) {
845
- var j = o & s, C = Et(e), L = C.length, R = Et(a), Y = R.length;
846
- if (L != Y && !j)
844
+ function Br(e, a, o, u, R, T) {
845
+ var z = o & s, j = Ot(e), W = j.length, H = Ot(a), q = H.length;
846
+ if (W != q && !z)
847
847
  return !1;
848
- for (var Q = L; Q--; ) {
849
- var G = C[Q];
850
- if (!(j ? G in a : rt.call(a, G)))
848
+ for (var et = W; et--; ) {
849
+ var G = j[et];
850
+ if (!(z ? G in a : at.call(a, G)))
851
851
  return !1;
852
852
  }
853
- var V = w.get(e);
854
- if (V && w.get(a))
855
- return V == a;
856
- var $ = !0;
857
- w.set(e, a), w.set(a, e);
858
- for (var _t = j; ++Q < L; ) {
859
- G = C[Q];
860
- var mt = e[G], At = a[G];
853
+ var J = T.get(e);
854
+ if (J && T.get(a))
855
+ return J == a;
856
+ var Y = !0;
857
+ T.set(e, a), T.set(a, e);
858
+ for (var St = z; ++et < W; ) {
859
+ G = j[et];
860
+ var _t = e[G], xt = a[G];
861
861
  if (u)
862
- var Tn = j ? u(At, mt, G, a, e, w) : u(mt, At, G, e, a, w);
863
- if (!(Tn === void 0 ? mt === At || M(mt, At, o, u, w) : Tn)) {
864
- $ = !1;
862
+ var xn = z ? u(xt, _t, G, a, e, T) : u(_t, xt, G, e, a, T);
863
+ if (!(xn === void 0 ? _t === xt || R(_t, xt, o, u, T) : xn)) {
864
+ Y = !1;
865
865
  break;
866
866
  }
867
- _t || (_t = G == "constructor");
867
+ St || (St = G == "constructor");
868
868
  }
869
- if ($ && !_t) {
870
- var Ke = e.constructor, Ye = a.constructor;
871
- Ke != Ye && "constructor" in e && "constructor" in a && !(typeof Ke == "function" && Ke instanceof Ke && typeof Ye == "function" && Ye instanceof Ye) && ($ = !1);
869
+ if (Y && !St) {
870
+ var qe = e.constructor, Je = a.constructor;
871
+ qe != Je && "constructor" in e && "constructor" in a && !(typeof qe == "function" && qe instanceof qe && typeof Je == "function" && Je instanceof Je) && (Y = !1);
872
872
  }
873
- return w.delete(e), w.delete(a), $;
873
+ return T.delete(e), T.delete(a), Y;
874
874
  }
875
- function Et(e) {
876
- return ce(e, pe, $r);
875
+ function Ot(e) {
876
+ return pe(e, be, $r);
877
877
  }
878
- function ct(e, a) {
878
+ function lt(e, a) {
879
879
  var o = e.__data__;
880
880
  return Yr(a) ? o[typeof a == "string" ? "string" : "hash"] : o.map;
881
881
  }
882
- function ht(e, a) {
883
- var o = Zt(e, a);
884
- return Ur(o) ? o : void 0;
882
+ function bt(e, a) {
883
+ var o = ne(e, a);
884
+ return Lr(o) ? o : void 0;
885
885
  }
886
- function yt(e) {
887
- var a = rt.call(e, ot), o = e[ot];
886
+ function gt(e) {
887
+ var a = at.call(e, ut), o = e[ut];
888
888
  try {
889
- e[ot] = void 0;
889
+ e[ut] = void 0;
890
890
  var u = !0;
891
891
  } catch {
892
892
  }
893
- var M = Ce.call(e);
894
- return u && (a ? e[ot] = o : delete e[ot]), M;
893
+ var R = ze.call(e);
894
+ return u && (a ? e[ut] = o : delete e[ut]), R;
895
895
  }
896
- var $r = Ht ? function(e) {
897
- return e == null ? [] : (e = Object(e), Me(Ht(e), function(a) {
898
- return Nt.call(e, a);
896
+ var $r = Wt ? function(e) {
897
+ return e == null ? [] : (e = Object(e), Pe(Wt(e), function(a) {
898
+ return Ut.call(e, a);
899
899
  }));
900
- } : Jr, ft = Tt;
901
- (re && ft(new re(new ArrayBuffer(1))) != A || kt && ft(new kt()) != l || ne && ft(ne.resolve()) != b || ie && ft(new ie()) != E || ae && ft(new ae()) != P) && (ft = function(e) {
902
- var a = Tt(e), o = a == v ? e.constructor : void 0, u = o ? q(o) : "";
900
+ } : Jr, ht = At;
901
+ (oe && ht(new oe(new ArrayBuffer(1))) != v || Mt && ht(new Mt()) != p || ce && ht(ce.resolve()) != y || ue && ht(new ue()) != M || le && ht(new le()) != D) && (ht = function(e) {
902
+ var a = At(e), o = a == _ ? e.constructor : void 0, u = o ? Q(o) : "";
903
903
  if (u)
904
904
  switch (u) {
905
- case Re:
906
- return A;
907
- case dt:
908
- return l;
909
- case mr:
910
- return b;
905
+ case Ne:
906
+ return v;
907
+ case yt:
908
+ return p;
909
+ case yr:
910
+ return y;
911
911
  case br:
912
- return E;
912
+ return M;
913
913
  case gr:
914
- return P;
914
+ return D;
915
915
  }
916
916
  return a;
917
917
  });
918
918
  function Kr(e, a) {
919
- return a = a ?? f, !!a && (typeof e == "number" || we.test(e)) && e > -1 && e % 1 == 0 && e < a;
919
+ return a = a ?? h, !!a && (typeof e == "number" || Me.test(e)) && e > -1 && e % 1 == 0 && e < a;
920
920
  }
921
921
  function Yr(e) {
922
922
  var a = typeof e;
923
923
  return a == "string" || a == "number" || a == "symbol" || a == "boolean" ? e !== "__proto__" : e === null;
924
924
  }
925
925
  function Vr(e) {
926
- return !!Pe && Pe in e;
926
+ return !!je && je in e;
927
927
  }
928
928
  function Xr(e) {
929
- var a = e && e.constructor, o = typeof a == "function" && a.prototype || It;
929
+ var a = e && e.constructor, o = typeof a == "function" && a.prototype || kt;
930
930
  return e === o;
931
931
  }
932
- function Ue(e) {
933
- return Ce.call(e);
932
+ function Be(e) {
933
+ return ze.call(e);
934
934
  }
935
- function q(e) {
935
+ function Q(e) {
936
936
  if (e != null) {
937
937
  try {
938
- return Qt.call(e);
938
+ return ie.call(e);
939
939
  } catch {
940
940
  }
941
941
  try {
@@ -945,40 +945,40 @@ Je.exports;
945
945
  }
946
946
  return "";
947
947
  }
948
- function Le(e, a) {
948
+ function $e(e, a) {
949
949
  return e === a || e !== e && a !== a;
950
950
  }
951
- var Ge = Ne(/* @__PURE__ */ function() {
951
+ var Ke = We(/* @__PURE__ */ function() {
952
952
  return arguments;
953
- }()) ? Ne : function(e) {
954
- return pt(e) && rt.call(e, "callee") && !Nt.call(e, "callee");
955
- }, Wt = Array.isArray;
956
- function le(e) {
957
- return e != null && fe(e.length) && !We(e);
953
+ }()) ? We : function(e) {
954
+ return mt(e) && at.call(e, "callee") && !Ut.call(e, "callee");
955
+ }, Kt = Array.isArray;
956
+ function me(e) {
957
+ return e != null && ye(e.length) && !Ye(e);
958
958
  }
959
- var Bt = ee || Zr;
959
+ var Yt = se || Zr;
960
960
  function qr(e, a) {
961
- return He(e, a);
961
+ return Ge(e, a);
962
962
  }
963
- function We(e) {
964
- if (!Be(e))
963
+ function Ye(e) {
964
+ if (!Ve(e))
965
965
  return !1;
966
- var a = Tt(e);
967
- return a == p || a == y || a == F || a == d;
966
+ var a = At(e);
967
+ return a == d || a == f || a == F || a == l;
968
968
  }
969
- function fe(e) {
970
- return typeof e == "number" && e > -1 && e % 1 == 0 && e <= f;
969
+ function ye(e) {
970
+ return typeof e == "number" && e > -1 && e % 1 == 0 && e <= h;
971
971
  }
972
- function Be(e) {
972
+ function Ve(e) {
973
973
  var a = typeof e;
974
974
  return e != null && (a == "object" || a == "function");
975
975
  }
976
- function pt(e) {
976
+ function mt(e) {
977
977
  return e != null && typeof e == "object";
978
978
  }
979
- var $e = qt ? dr(qt) : Lr;
980
- function pe(e) {
981
- return le(e) ? Nr(e) : Gr(e);
979
+ var Xe = ee ? pr(ee) : Ur;
980
+ function be(e) {
981
+ return me(e) ? Hr(e) : Wr(e);
982
982
  }
983
983
  function Jr() {
984
984
  return [];
@@ -987,45 +987,45 @@ Je.exports;
987
987
  return !1;
988
988
  }
989
989
  t.exports = qr;
990
- })(Je, Je.exports);
991
- var $i = Je.exports;
992
- const nt = /* @__PURE__ */ gn($i);
993
- var Ze = { exports: {} };
994
- Ze.exports;
990
+ })(er, er.exports);
991
+ var Ji = er.exports;
992
+ const rt = /* @__PURE__ */ wn(Ji);
993
+ var rr = { exports: {} };
994
+ rr.exports;
995
995
  (function(t, r) {
996
- var n = 200, i = "__lodash_hash_undefined__", s = 9007199254740991, c = "[object Arguments]", f = "[object Array]", h = "[object Boolean]", x = "[object Date]", F = "[object Error]", T = "[object Function]", H = "[object GeneratorFunction]", g = "[object Map]", p = "[object Number]", y = "[object Object]", l = "[object Promise]", m = "[object RegExp]", S = "[object Set]", v = "[object String]", b = "[object Symbol]", d = "[object WeakMap]", O = "[object ArrayBuffer]", E = "[object DataView]", _ = "[object Float32Array]", D = "[object Float64Array]", I = "[object Int8Array]", P = "[object Int16Array]", k = "[object Int32Array]", A = "[object Uint8Array]", U = "[object Uint8ClampedArray]", J = "[object Uint16Array]", Se = "[object Uint32Array]", ar = /[\\^$.*+?()[\]{}|]/g, sr = /\w*$/, or = /^\[object .+?Constructor\]$/, cr = /^(?:0|[1-9]\d*)$/, z = {};
997
- z[c] = z[f] = z[O] = z[E] = z[h] = z[x] = z[_] = z[D] = z[I] = z[P] = z[k] = z[g] = z[p] = z[y] = z[m] = z[S] = z[v] = z[b] = z[A] = z[U] = z[J] = z[Se] = !0, z[F] = z[T] = z[d] = !1;
998
- var ur = typeof it == "object" && it && it.Object === Object && it, lr = typeof self == "object" && self && self.Object === Object && self, at = ur || lr || Function("return this")(), we = r && !r.nodeType && r, N = we && !0 && t && !t.nodeType && t, ke = N && N.exports === we;
996
+ var n = 200, i = "__lodash_hash_undefined__", s = 9007199254740991, c = "[object Arguments]", h = "[object Array]", m = "[object Boolean]", P = "[object Date]", F = "[object Error]", E = "[object Function]", N = "[object GeneratorFunction]", b = "[object Map]", d = "[object Number]", f = "[object Object]", p = "[object Promise]", g = "[object RegExp]", S = "[object Set]", _ = "[object String]", y = "[object Symbol]", l = "[object WeakMap]", x = "[object ArrayBuffer]", M = "[object DataView]", I = "[object Float32Array]", C = "[object Float64Array]", w = "[object Int8Array]", D = "[object Int16Array]", k = "[object Int32Array]", v = "[object Uint8Array]", A = "[object Uint8ClampedArray]", O = "[object Uint16Array]", Z = "[object Uint32Array]", V = /[\\^$.*+?()[\]{}|]/g, ft = /\w*$/, Jt = /^\[object .+?Constructor\]$/, Zt = /^(?:0|[1-9]\d*)$/, L = {};
997
+ L[c] = L[h] = L[x] = L[M] = L[m] = L[P] = L[I] = L[C] = L[w] = L[D] = L[k] = L[b] = L[d] = L[f] = L[g] = L[S] = L[_] = L[y] = L[v] = L[A] = L[O] = L[Z] = !0, L[F] = L[E] = L[l] = !1;
998
+ var ur = typeof st == "object" && st && st.Object === Object && st, lr = typeof self == "object" && self && self.Object === Object && self, ot = ur || lr || Function("return this")(), Me = r && !r.nodeType && r, U = Me && !0 && t && !t.nodeType && t, Ae = U && U.exports === Me;
999
999
  function fr(e, a) {
1000
1000
  return e.set(a[0], a[1]), e;
1001
1001
  }
1002
- function st(e, a) {
1002
+ function ct(e, a) {
1003
1003
  return e.add(a), e;
1004
1004
  }
1005
- function Te(e, a) {
1005
+ function Oe(e, a) {
1006
1006
  for (var o = -1, u = e ? e.length : 0; ++o < u && a(e[o], o, e) !== !1; )
1007
1007
  ;
1008
1008
  return e;
1009
1009
  }
1010
- function Ee(e, a) {
1011
- for (var o = -1, u = a.length, M = e.length; ++o < u; )
1012
- e[M + o] = a[o];
1010
+ function xe(e, a) {
1011
+ for (var o = -1, u = a.length, R = e.length; ++o < u; )
1012
+ e[R + o] = a[o];
1013
1013
  return e;
1014
1014
  }
1015
- function Vt(e, a, o, u) {
1016
- for (var M = -1, w = e ? e.length : 0; ++M < w; )
1017
- o = a(o, e[M], M, e);
1015
+ function Qt(e, a, o, u) {
1016
+ for (var R = -1, T = e ? e.length : 0; ++R < T; )
1017
+ o = a(o, e[R], R, e);
1018
1018
  return o;
1019
1019
  }
1020
- function Xt(e, a) {
1020
+ function te(e, a) {
1021
1021
  for (var o = -1, u = Array(e); ++o < e; )
1022
1022
  u[o] = a(o);
1023
1023
  return u;
1024
1024
  }
1025
- function Ae(e, a) {
1025
+ function De(e, a) {
1026
1026
  return e == null ? void 0 : e[a];
1027
1027
  }
1028
- function qt(e) {
1028
+ function ee(e) {
1029
1029
  var a = !1;
1030
1030
  if (e != null && typeof e.toString != "function")
1031
1031
  try {
@@ -1034,60 +1034,60 @@ Ze.exports;
1034
1034
  }
1035
1035
  return a;
1036
1036
  }
1037
- function Me(e) {
1037
+ function Pe(e) {
1038
1038
  var a = -1, o = Array(e.size);
1039
- return e.forEach(function(u, M) {
1040
- o[++a] = [M, u];
1039
+ return e.forEach(function(u, R) {
1040
+ o[++a] = [R, u];
1041
1041
  }), o;
1042
1042
  }
1043
- function Jt(e, a) {
1043
+ function re(e, a) {
1044
1044
  return function(o) {
1045
1045
  return e(a(o));
1046
1046
  };
1047
1047
  }
1048
- function Oe(e) {
1048
+ function Ce(e) {
1049
1049
  var a = -1, o = Array(e.size);
1050
1050
  return e.forEach(function(u) {
1051
1051
  o[++a] = u;
1052
1052
  }), o;
1053
1053
  }
1054
- var pr = Array.prototype, dr = Function.prototype, jt = Object.prototype, Zt = at["__core-js_shared__"], xe = function() {
1055
- var e = /[^.]+$/.exec(Zt && Zt.keys && Zt.keys.IE_PROTO || "");
1054
+ var dr = Array.prototype, pr = Function.prototype, zt = Object.prototype, ne = ot["__core-js_shared__"], Re = function() {
1055
+ var e = /[^.]+$/.exec(ne && ne.keys && ne.keys.IE_PROTO || "");
1056
1056
  return e ? "Symbol(src)_1." + e : "";
1057
- }(), De = dr.toString, ut = jt.hasOwnProperty, Rt = jt.toString, hr = RegExp(
1058
- "^" + De.call(ut).replace(ar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1059
- ), It = ke ? at.Buffer : void 0, Ft = at.Symbol, Qt = at.Uint8Array, rt = Jt(Object.getPrototypeOf, Object), Pe = Object.create, Ce = jt.propertyIsEnumerable, yr = pr.splice, te = Object.getOwnPropertySymbols, zt = It ? It.isBuffer : void 0, je = Jt(Object.keys, Object), Nt = ct(at, "DataView"), St = ct(at, "Map"), ot = ct(at, "Promise"), Ht = ct(at, "Set"), ee = ct(at, "WeakMap"), wt = ct(Object, "create"), re = q(Nt), kt = q(St), ne = q(ot), ie = q(Ht), ae = q(ee), gt = Ft ? Ft.prototype : void 0, Re = gt ? gt.valueOf : void 0;
1060
- function dt(e) {
1057
+ }(), Fe = pr.toString, dt = zt.hasOwnProperty, Ht = zt.toString, hr = RegExp(
1058
+ "^" + Fe.call(dt).replace(V, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
1059
+ ), kt = Ae ? ot.Buffer : void 0, Nt = ot.Symbol, ie = ot.Uint8Array, at = re(Object.getPrototypeOf, Object), je = Object.create, ze = zt.propertyIsEnumerable, mr = dr.splice, ae = Object.getOwnPropertySymbols, Lt = kt ? kt.isBuffer : void 0, He = re(Object.keys, Object), Ut = lt(ot, "DataView"), Tt = lt(ot, "Map"), ut = lt(ot, "Promise"), Wt = lt(ot, "Set"), se = lt(ot, "WeakMap"), Et = lt(Object, "create"), oe = Q(Ut), Mt = Q(Tt), ce = Q(ut), ue = Q(Wt), le = Q(se), vt = Nt ? Nt.prototype : void 0, Ne = vt ? vt.valueOf : void 0;
1060
+ function yt(e) {
1061
1061
  var a = -1, o = e ? e.length : 0;
1062
1062
  for (this.clear(); ++a < o; ) {
1063
1063
  var u = e[a];
1064
1064
  this.set(u[0], u[1]);
1065
1065
  }
1066
1066
  }
1067
- function mr() {
1068
- this.__data__ = wt ? wt(null) : {};
1067
+ function yr() {
1068
+ this.__data__ = Et ? Et(null) : {};
1069
1069
  }
1070
1070
  function br(e) {
1071
1071
  return this.has(e) && delete this.__data__[e];
1072
1072
  }
1073
1073
  function gr(e) {
1074
1074
  var a = this.__data__;
1075
- if (wt) {
1075
+ if (Et) {
1076
1076
  var o = a[e];
1077
1077
  return o === i ? void 0 : o;
1078
1078
  }
1079
- return ut.call(a, e) ? a[e] : void 0;
1079
+ return dt.call(a, e) ? a[e] : void 0;
1080
1080
  }
1081
- function Fe(e) {
1081
+ function Le(e) {
1082
1082
  var a = this.__data__;
1083
- return wt ? a[e] !== void 0 : ut.call(a, e);
1083
+ return Et ? a[e] !== void 0 : dt.call(a, e);
1084
1084
  }
1085
- function se(e, a) {
1085
+ function fe(e, a) {
1086
1086
  var o = this.__data__;
1087
- return o[e] = wt && a === void 0 ? i : a, this;
1087
+ return o[e] = Et && a === void 0 ? i : a, this;
1088
1088
  }
1089
- dt.prototype.clear = mr, dt.prototype.delete = br, dt.prototype.get = gr, dt.prototype.has = Fe, dt.prototype.set = se;
1090
- function B(e) {
1089
+ yt.prototype.clear = yr, yt.prototype.delete = br, yt.prototype.get = gr, yt.prototype.has = Le, yt.prototype.set = fe;
1090
+ function K(e) {
1091
1091
  var a = -1, o = e ? e.length : 0;
1092
1092
  for (this.clear(); ++a < o; ) {
1093
1093
  var u = e[a];
@@ -1097,26 +1097,26 @@ Ze.exports;
1097
1097
  function _r() {
1098
1098
  this.__data__ = [];
1099
1099
  }
1100
- function vr(e) {
1101
- var a = this.__data__, o = Lt(a, e);
1100
+ function Ir(e) {
1101
+ var a = this.__data__, o = Bt(a, e);
1102
1102
  if (o < 0)
1103
1103
  return !1;
1104
1104
  var u = a.length - 1;
1105
- return o == u ? a.pop() : yr.call(a, o, 1), !0;
1105
+ return o == u ? a.pop() : mr.call(a, o, 1), !0;
1106
1106
  }
1107
- function Ir(e) {
1108
- var a = this.__data__, o = Lt(a, e);
1107
+ function vr(e) {
1108
+ var a = this.__data__, o = Bt(a, e);
1109
1109
  return o < 0 ? void 0 : a[o][1];
1110
1110
  }
1111
1111
  function Sr(e) {
1112
- return Lt(this.__data__, e) > -1;
1112
+ return Bt(this.__data__, e) > -1;
1113
1113
  }
1114
1114
  function wr(e, a) {
1115
- var o = this.__data__, u = Lt(o, e);
1115
+ var o = this.__data__, u = Bt(o, e);
1116
1116
  return u < 0 ? o.push([e, a]) : o[u][1] = a, this;
1117
1117
  }
1118
- B.prototype.clear = _r, B.prototype.delete = vr, B.prototype.get = Ir, B.prototype.has = Sr, B.prototype.set = wr;
1119
- function K(e) {
1118
+ K.prototype.clear = _r, K.prototype.delete = Ir, K.prototype.get = vr, K.prototype.has = Sr, K.prototype.set = wr;
1119
+ function X(e) {
1120
1120
  var a = -1, o = e ? e.length : 0;
1121
1121
  for (this.clear(); ++a < o; ) {
1122
1122
  var u = e[a];
@@ -1125,29 +1125,29 @@ Ze.exports;
1125
1125
  }
1126
1126
  function kr() {
1127
1127
  this.__data__ = {
1128
- hash: new dt(),
1129
- map: new (St || B)(),
1130
- string: new dt()
1128
+ hash: new yt(),
1129
+ map: new (Tt || K)(),
1130
+ string: new yt()
1131
1131
  };
1132
1132
  }
1133
1133
  function Tr(e) {
1134
- return Et(this, e).delete(e);
1134
+ return Ot(this, e).delete(e);
1135
1135
  }
1136
1136
  function Er(e) {
1137
- return Et(this, e).get(e);
1137
+ return Ot(this, e).get(e);
1138
1138
  }
1139
- function Ar(e) {
1140
- return Et(this, e).has(e);
1139
+ function Mr(e) {
1140
+ return Ot(this, e).has(e);
1141
1141
  }
1142
- function Mr(e, a) {
1143
- return Et(this, e).set(e, a), this;
1142
+ function Ar(e, a) {
1143
+ return Ot(this, e).set(e, a), this;
1144
1144
  }
1145
- K.prototype.clear = kr, K.prototype.delete = Tr, K.prototype.get = Er, K.prototype.has = Ar, K.prototype.set = Mr;
1146
- function Z(e) {
1147
- this.__data__ = new B(e);
1145
+ X.prototype.clear = kr, X.prototype.delete = Tr, X.prototype.get = Er, X.prototype.has = Mr, X.prototype.set = Ar;
1146
+ function tt(e) {
1147
+ this.__data__ = new K(e);
1148
1148
  }
1149
1149
  function Or() {
1150
- this.__data__ = new B();
1150
+ this.__data__ = new K();
1151
1151
  }
1152
1152
  function xr(e) {
1153
1153
  return this.__data__.delete(e);
@@ -1160,230 +1160,230 @@ Ze.exports;
1160
1160
  }
1161
1161
  function Cr(e, a) {
1162
1162
  var o = this.__data__;
1163
- if (o instanceof B) {
1163
+ if (o instanceof K) {
1164
1164
  var u = o.__data__;
1165
- if (!St || u.length < n - 1)
1165
+ if (!Tt || u.length < n - 1)
1166
1166
  return u.push([e, a]), this;
1167
- o = this.__data__ = new K(u);
1167
+ o = this.__data__ = new X(u);
1168
1168
  }
1169
1169
  return o.set(e, a), this;
1170
1170
  }
1171
- Z.prototype.clear = Or, Z.prototype.delete = xr, Z.prototype.get = Dr, Z.prototype.has = Pr, Z.prototype.set = Cr;
1172
- function Ut(e, a) {
1173
- var o = le(e) || Wt(e) ? Xt(e.length, String) : [], u = o.length, M = !!u;
1174
- for (var w in e)
1175
- ut.call(e, w) && !(M && (w == "length" || Yr(w, u))) && o.push(w);
1171
+ tt.prototype.clear = Or, tt.prototype.delete = xr, tt.prototype.get = Dr, tt.prototype.has = Pr, tt.prototype.set = Cr;
1172
+ function Gt(e, a) {
1173
+ var o = me(e) || Kt(e) ? te(e.length, String) : [], u = o.length, R = !!u;
1174
+ for (var T in e)
1175
+ dt.call(e, T) && !(R && (T == "length" || Yr(T, u))) && o.push(T);
1176
1176
  return o;
1177
1177
  }
1178
- function ze(e, a, o) {
1178
+ function Ue(e, a, o) {
1179
1179
  var u = e[a];
1180
- (!(ut.call(e, a) && Ge(u, o)) || o === void 0 && !(a in e)) && (e[a] = o);
1180
+ (!(dt.call(e, a) && Ke(u, o)) || o === void 0 && !(a in e)) && (e[a] = o);
1181
1181
  }
1182
- function Lt(e, a) {
1182
+ function Bt(e, a) {
1183
1183
  for (var o = e.length; o--; )
1184
- if (Ge(e[o][0], a))
1184
+ if (Ke(e[o][0], a))
1185
1185
  return o;
1186
1186
  return -1;
1187
1187
  }
1188
- function lt(e, a) {
1189
- return e && ue(a, pe(a), e);
1188
+ function pt(e, a) {
1189
+ return e && he(a, be(a), e);
1190
1190
  }
1191
- function oe(e, a, o, u, M, w, j) {
1192
- var C;
1193
- if (u && (C = w ? u(e, M, w, j) : u(e)), C !== void 0)
1194
- return C;
1195
- if (!pt(e))
1191
+ function de(e, a, o, u, R, T, z) {
1192
+ var j;
1193
+ if (u && (j = T ? u(e, R, T, z) : u(e)), j !== void 0)
1194
+ return j;
1195
+ if (!mt(e))
1196
1196
  return e;
1197
- var L = le(e);
1198
- if (L) {
1199
- if (C = $r(e), !a)
1200
- return Gr(e, C);
1197
+ var W = me(e);
1198
+ if (W) {
1199
+ if (j = $r(e), !a)
1200
+ return Wr(e, j);
1201
1201
  } else {
1202
- var R = yt(e), Y = R == T || R == H;
1203
- if (We(e))
1204
- return Gt(e, a);
1205
- if (R == y || R == c || Y && !w) {
1206
- if (qt(e))
1207
- return w ? e : {};
1208
- if (C = ft(Y ? {} : e), !a)
1209
- return Wr(e, lt(C, e));
1202
+ var H = gt(e), q = H == E || H == N;
1203
+ if (Ye(e))
1204
+ return $t(e, a);
1205
+ if (H == f || H == c || q && !T) {
1206
+ if (ee(e))
1207
+ return T ? e : {};
1208
+ if (j = ht(q ? {} : e), !a)
1209
+ return Gr(e, pt(j, e));
1210
1210
  } else {
1211
- if (!z[R])
1212
- return w ? e : {};
1213
- C = Kr(e, R, oe, a);
1211
+ if (!L[H])
1212
+ return T ? e : {};
1213
+ j = Kr(e, H, de, a);
1214
1214
  }
1215
1215
  }
1216
- j || (j = new Z());
1217
- var Q = j.get(e);
1218
- if (Q)
1219
- return Q;
1220
- if (j.set(e, C), !L)
1221
- var G = o ? Br(e) : pe(e);
1222
- return Te(G || e, function(V, $) {
1223
- G && ($ = V, V = e[$]), ze(C, $, oe(V, a, o, u, $, e, j));
1224
- }), C;
1216
+ z || (z = new tt());
1217
+ var et = z.get(e);
1218
+ if (et)
1219
+ return et;
1220
+ if (z.set(e, j), !W)
1221
+ var G = o ? Br(e) : be(e);
1222
+ return Oe(G || e, function(J, Y) {
1223
+ G && (Y = J, J = e[Y]), Ue(j, Y, de(J, a, o, u, Y, e, z));
1224
+ }), j;
1225
1225
  }
1226
- function jr(e) {
1227
- return pt(e) ? Pe(e) : {};
1226
+ function Rr(e) {
1227
+ return mt(e) ? je(e) : {};
1228
1228
  }
1229
- function Rr(e, a, o) {
1229
+ function Fr(e, a, o) {
1230
1230
  var u = a(e);
1231
- return le(e) ? u : Ee(u, o(e));
1231
+ return me(e) ? u : xe(u, o(e));
1232
1232
  }
1233
- function Fr(e) {
1234
- return Rt.call(e);
1233
+ function jr(e) {
1234
+ return Ht.call(e);
1235
1235
  }
1236
1236
  function zr(e) {
1237
- if (!pt(e) || Xr(e))
1237
+ if (!mt(e) || Xr(e))
1238
1238
  return !1;
1239
- var a = fe(e) || qt(e) ? hr : or;
1240
- return a.test(q(e));
1239
+ var a = ye(e) || ee(e) ? hr : Jt;
1240
+ return a.test(Q(e));
1241
1241
  }
1242
- function Nr(e) {
1243
- if (!Ue(e))
1244
- return je(e);
1242
+ function Hr(e) {
1243
+ if (!Be(e))
1244
+ return He(e);
1245
1245
  var a = [];
1246
1246
  for (var o in Object(e))
1247
- ut.call(e, o) && o != "constructor" && a.push(o);
1247
+ dt.call(e, o) && o != "constructor" && a.push(o);
1248
1248
  return a;
1249
1249
  }
1250
- function Gt(e, a) {
1250
+ function $t(e, a) {
1251
1251
  if (a)
1252
1252
  return e.slice();
1253
1253
  var o = new e.constructor(e.length);
1254
1254
  return e.copy(o), o;
1255
1255
  }
1256
- function ce(e) {
1256
+ function pe(e) {
1257
1257
  var a = new e.constructor(e.byteLength);
1258
- return new Qt(a).set(new Qt(e)), a;
1258
+ return new ie(a).set(new ie(e)), a;
1259
1259
  }
1260
- function Tt(e, a) {
1261
- var o = a ? ce(e.buffer) : e.buffer;
1260
+ function At(e, a) {
1261
+ var o = a ? pe(e.buffer) : e.buffer;
1262
1262
  return new e.constructor(o, e.byteOffset, e.byteLength);
1263
1263
  }
1264
- function Ne(e, a, o) {
1265
- var u = a ? o(Me(e), !0) : Me(e);
1266
- return Vt(u, fr, new e.constructor());
1264
+ function We(e, a, o) {
1265
+ var u = a ? o(Pe(e), !0) : Pe(e);
1266
+ return Qt(u, fr, new e.constructor());
1267
1267
  }
1268
- function He(e) {
1269
- var a = new e.constructor(e.source, sr.exec(e));
1268
+ function Ge(e) {
1269
+ var a = new e.constructor(e.source, ft.exec(e));
1270
1270
  return a.lastIndex = e.lastIndex, a;
1271
1271
  }
1272
- function Hr(e, a, o) {
1273
- var u = a ? o(Oe(e), !0) : Oe(e);
1274
- return Vt(u, st, new e.constructor());
1272
+ function Nr(e, a, o) {
1273
+ var u = a ? o(Ce(e), !0) : Ce(e);
1274
+ return Qt(u, ct, new e.constructor());
1275
1275
  }
1276
- function Ur(e) {
1277
- return Re ? Object(Re.call(e)) : {};
1276
+ function Lr(e) {
1277
+ return Ne ? Object(Ne.call(e)) : {};
1278
1278
  }
1279
- function Lr(e, a) {
1280
- var o = a ? ce(e.buffer) : e.buffer;
1279
+ function Ur(e, a) {
1280
+ var o = a ? pe(e.buffer) : e.buffer;
1281
1281
  return new e.constructor(o, e.byteOffset, e.length);
1282
1282
  }
1283
- function Gr(e, a) {
1283
+ function Wr(e, a) {
1284
1284
  var o = -1, u = e.length;
1285
1285
  for (a || (a = Array(u)); ++o < u; )
1286
1286
  a[o] = e[o];
1287
1287
  return a;
1288
1288
  }
1289
- function ue(e, a, o, u) {
1289
+ function he(e, a, o, u) {
1290
1290
  o || (o = {});
1291
- for (var M = -1, w = a.length; ++M < w; ) {
1292
- var j = a[M], C = void 0;
1293
- ze(o, j, C === void 0 ? e[j] : C);
1291
+ for (var R = -1, T = a.length; ++R < T; ) {
1292
+ var z = a[R], j = void 0;
1293
+ Ue(o, z, j === void 0 ? e[z] : j);
1294
1294
  }
1295
1295
  return o;
1296
1296
  }
1297
- function Wr(e, a) {
1298
- return ue(e, ht(e), a);
1297
+ function Gr(e, a) {
1298
+ return he(e, bt(e), a);
1299
1299
  }
1300
1300
  function Br(e) {
1301
- return Rr(e, pe, ht);
1301
+ return Fr(e, be, bt);
1302
1302
  }
1303
- function Et(e, a) {
1303
+ function Ot(e, a) {
1304
1304
  var o = e.__data__;
1305
1305
  return Vr(a) ? o[typeof a == "string" ? "string" : "hash"] : o.map;
1306
1306
  }
1307
- function ct(e, a) {
1308
- var o = Ae(e, a);
1307
+ function lt(e, a) {
1308
+ var o = De(e, a);
1309
1309
  return zr(o) ? o : void 0;
1310
1310
  }
1311
- var ht = te ? Jt(te, Object) : Jr, yt = Fr;
1312
- (Nt && yt(new Nt(new ArrayBuffer(1))) != E || St && yt(new St()) != g || ot && yt(ot.resolve()) != l || Ht && yt(new Ht()) != S || ee && yt(new ee()) != d) && (yt = function(e) {
1313
- var a = Rt.call(e), o = a == y ? e.constructor : void 0, u = o ? q(o) : void 0;
1311
+ var bt = ae ? re(ae, Object) : Jr, gt = jr;
1312
+ (Ut && gt(new Ut(new ArrayBuffer(1))) != M || Tt && gt(new Tt()) != b || ut && gt(ut.resolve()) != p || Wt && gt(new Wt()) != S || se && gt(new se()) != l) && (gt = function(e) {
1313
+ var a = Ht.call(e), o = a == f ? e.constructor : void 0, u = o ? Q(o) : void 0;
1314
1314
  if (u)
1315
1315
  switch (u) {
1316
- case re:
1317
- return E;
1318
- case kt:
1319
- return g;
1320
- case ne:
1321
- return l;
1322
- case ie:
1316
+ case oe:
1317
+ return M;
1318
+ case Mt:
1319
+ return b;
1320
+ case ce:
1321
+ return p;
1322
+ case ue:
1323
1323
  return S;
1324
- case ae:
1325
- return d;
1324
+ case le:
1325
+ return l;
1326
1326
  }
1327
1327
  return a;
1328
1328
  });
1329
1329
  function $r(e) {
1330
1330
  var a = e.length, o = e.constructor(a);
1331
- return a && typeof e[0] == "string" && ut.call(e, "index") && (o.index = e.index, o.input = e.input), o;
1331
+ return a && typeof e[0] == "string" && dt.call(e, "index") && (o.index = e.index, o.input = e.input), o;
1332
1332
  }
1333
- function ft(e) {
1334
- return typeof e.constructor == "function" && !Ue(e) ? jr(rt(e)) : {};
1333
+ function ht(e) {
1334
+ return typeof e.constructor == "function" && !Be(e) ? Rr(at(e)) : {};
1335
1335
  }
1336
1336
  function Kr(e, a, o, u) {
1337
- var M = e.constructor;
1337
+ var R = e.constructor;
1338
1338
  switch (a) {
1339
- case O:
1340
- return ce(e);
1341
- case h:
1342
1339
  case x:
1343
- return new M(+e);
1344
- case E:
1345
- return Tt(e, u);
1346
- case _:
1347
- case D:
1348
- case I:
1340
+ return pe(e);
1341
+ case m:
1349
1342
  case P:
1343
+ return new R(+e);
1344
+ case M:
1345
+ return At(e, u);
1346
+ case I:
1347
+ case C:
1348
+ case w:
1349
+ case D:
1350
1350
  case k:
1351
+ case v:
1351
1352
  case A:
1352
- case U:
1353
- case J:
1354
- case Se:
1355
- return Lr(e, u);
1353
+ case O:
1354
+ case Z:
1355
+ return Ur(e, u);
1356
+ case b:
1357
+ return We(e, u, o);
1358
+ case d:
1359
+ case _:
1360
+ return new R(e);
1356
1361
  case g:
1357
- return Ne(e, u, o);
1358
- case p:
1359
- case v:
1360
- return new M(e);
1361
- case m:
1362
- return He(e);
1362
+ return Ge(e);
1363
1363
  case S:
1364
- return Hr(e, u, o);
1365
- case b:
1366
- return Ur(e);
1364
+ return Nr(e, u, o);
1365
+ case y:
1366
+ return Lr(e);
1367
1367
  }
1368
1368
  }
1369
1369
  function Yr(e, a) {
1370
- return a = a ?? s, !!a && (typeof e == "number" || cr.test(e)) && e > -1 && e % 1 == 0 && e < a;
1370
+ return a = a ?? s, !!a && (typeof e == "number" || Zt.test(e)) && e > -1 && e % 1 == 0 && e < a;
1371
1371
  }
1372
1372
  function Vr(e) {
1373
1373
  var a = typeof e;
1374
1374
  return a == "string" || a == "number" || a == "symbol" || a == "boolean" ? e !== "__proto__" : e === null;
1375
1375
  }
1376
1376
  function Xr(e) {
1377
- return !!xe && xe in e;
1377
+ return !!Re && Re in e;
1378
1378
  }
1379
- function Ue(e) {
1380
- var a = e && e.constructor, o = typeof a == "function" && a.prototype || jt;
1379
+ function Be(e) {
1380
+ var a = e && e.constructor, o = typeof a == "function" && a.prototype || zt;
1381
1381
  return e === o;
1382
1382
  }
1383
- function q(e) {
1383
+ function Q(e) {
1384
1384
  if (e != null) {
1385
1385
  try {
1386
- return De.call(e);
1386
+ return Fe.call(e);
1387
1387
  } catch {
1388
1388
  }
1389
1389
  try {
@@ -1393,39 +1393,39 @@ Ze.exports;
1393
1393
  }
1394
1394
  return "";
1395
1395
  }
1396
- function Le(e) {
1397
- return oe(e, !0, !0);
1396
+ function $e(e) {
1397
+ return de(e, !0, !0);
1398
1398
  }
1399
- function Ge(e, a) {
1399
+ function Ke(e, a) {
1400
1400
  return e === a || e !== e && a !== a;
1401
1401
  }
1402
- function Wt(e) {
1403
- return qr(e) && ut.call(e, "callee") && (!Ce.call(e, "callee") || Rt.call(e) == c);
1402
+ function Kt(e) {
1403
+ return qr(e) && dt.call(e, "callee") && (!ze.call(e, "callee") || Ht.call(e) == c);
1404
1404
  }
1405
- var le = Array.isArray;
1406
- function Bt(e) {
1407
- return e != null && Be(e.length) && !fe(e);
1405
+ var me = Array.isArray;
1406
+ function Yt(e) {
1407
+ return e != null && Ve(e.length) && !ye(e);
1408
1408
  }
1409
1409
  function qr(e) {
1410
- return $e(e) && Bt(e);
1410
+ return Xe(e) && Yt(e);
1411
1411
  }
1412
- var We = zt || Zr;
1413
- function fe(e) {
1414
- var a = pt(e) ? Rt.call(e) : "";
1415
- return a == T || a == H;
1412
+ var Ye = Lt || Zr;
1413
+ function ye(e) {
1414
+ var a = mt(e) ? Ht.call(e) : "";
1415
+ return a == E || a == N;
1416
1416
  }
1417
- function Be(e) {
1417
+ function Ve(e) {
1418
1418
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= s;
1419
1419
  }
1420
- function pt(e) {
1420
+ function mt(e) {
1421
1421
  var a = typeof e;
1422
1422
  return !!e && (a == "object" || a == "function");
1423
1423
  }
1424
- function $e(e) {
1424
+ function Xe(e) {
1425
1425
  return !!e && typeof e == "object";
1426
1426
  }
1427
- function pe(e) {
1428
- return Bt(e) ? Ut(e) : Nr(e);
1427
+ function be(e) {
1428
+ return Yt(e) ? Gt(e) : Hr(e);
1429
1429
  }
1430
1430
  function Jr() {
1431
1431
  return [];
@@ -1433,10 +1433,10 @@ Ze.exports;
1433
1433
  function Zr() {
1434
1434
  return !1;
1435
1435
  }
1436
- t.exports = Le;
1437
- })(Ze, Ze.exports);
1438
- var Ki = Ze.exports;
1439
- const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1436
+ t.exports = $e;
1437
+ })(rr, rr.exports);
1438
+ var Zi = rr.exports;
1439
+ const B = /* @__PURE__ */ wn(Zi), ti = (t) => new Promise((r, n) => {
1440
1440
  const i = new Image();
1441
1441
  console.warn("update cdn config for cors?"), i.onload = () => {
1442
1442
  const s = i.width, c = i.height;
@@ -1444,7 +1444,7 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1444
1444
  }, i.onerror = (s) => {
1445
1445
  n(s);
1446
1446
  }, i.crossOrigin = "anonymous", i.src = t;
1447
- }), Vi = (t) => new Promise((r, n) => {
1447
+ }), Qi = (t) => new Promise((r, n) => {
1448
1448
  const i = new Audio();
1449
1449
  i.preload = "auto", i.addEventListener("loadedmetadata", () => {
1450
1450
  const s = i.duration * 1e3;
@@ -1452,22 +1452,22 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1452
1452
  }), i.addEventListener("error", (s) => {
1453
1453
  n(s);
1454
1454
  }), i.src = t, i.crossOrigin = "anonymous", i.load();
1455
- }), Xi = (t) => new Promise((r, n) => {
1455
+ }), ei = (t) => new Promise((r, n) => {
1456
1456
  const i = document.createElement("video");
1457
1457
  i.preload = "auto", i.addEventListener("loadedmetadata", () => {
1458
- const s = i.duration * 1e3, c = i.videoWidth, f = i.videoHeight;
1459
- r({ duration: s, width: c, height: f });
1458
+ const s = i.duration * 1e3, c = i.videoWidth, h = i.videoHeight;
1459
+ r({ duration: s, width: c, height: h });
1460
1460
  }), i.addEventListener("error", (s) => {
1461
1461
  n(s);
1462
1462
  }), i.src = t, i.load();
1463
- }), ti = (t, r) => {
1463
+ }), ri = (t, r) => {
1464
1464
  const n = document.createElement("div");
1465
1465
  Object.keys(r).forEach((s) => {
1466
1466
  s !== "height" && (n.style[s] = r[s]);
1467
1467
  }), document.body.appendChild(n), n.textContent = t, n.style.whiteSpace = "normal", n.style.position = "absolute", n.style.visibility = "hidden", n.style.display = "inline-block", n.style.width = r.width + "px", n.style.fontSize = r.fontSize + "px";
1468
1468
  const i = getComputedStyle(n).height;
1469
1469
  return document.body.removeChild(n), parseFloat(i);
1470
- }, _n = (t) => {
1470
+ }, kn = (t) => {
1471
1471
  const r = t.map((n) => new FontFace(n.fontFamily, `url(${n.url})`).load().catch((i) => i));
1472
1472
  return r.length === 0 ? Promise.resolve(!0) : new Promise((n, i) => {
1473
1473
  Promise.all(r).then((s) => {
@@ -1476,12 +1476,12 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1476
1476
  });
1477
1477
  }).catch((s) => i(s));
1478
1478
  });
1479
- }, rr = {
1479
+ }, sr = {
1480
1480
  color: "#000000",
1481
1481
  x: 0,
1482
1482
  y: 0,
1483
1483
  blur: 0
1484
- }, _e = (t, r) => {
1484
+ }, ke = (t, r) => {
1485
1485
  let n = r != null && r.trim ? r.trim.to - r.trim.from : (r == null ? void 0 : r.duration) || 5e3;
1486
1486
  const i = {
1487
1487
  from: 0,
@@ -1509,14 +1509,14 @@ const X = /* @__PURE__ */ gn(Ki), Yi = (t) => new Promise((r, n) => {
1509
1509
  ), i;
1510
1510
  }
1511
1511
  return t;
1512
- }, ei = (t, r) => t ? t.from && !t.to ? {
1512
+ }, ni = (t, r) => t ? t.from && !t.to ? {
1513
1513
  from: t.from,
1514
1514
  to: r.duration
1515
1515
  } : t : {
1516
1516
  from: 0,
1517
1517
  to: r.duration
1518
1518
  };
1519
- function nr(t, r) {
1519
+ function or(t, r) {
1520
1520
  const n = {
1521
1521
  x: t.size.width / 2,
1522
1522
  y: t.size.height / 2
@@ -1530,10 +1530,10 @@ function nr(t, r) {
1530
1530
  transform: `scale(${s})`
1531
1531
  };
1532
1532
  }
1533
- const Pn = async (t, r) => {
1534
- const n = t.details.src, i = await Xi(n), s = nr(r, {
1533
+ const dn = async (t, r) => {
1534
+ const n = t.details.src, i = await ei(n), s = or(r, {
1535
1535
  ...i
1536
- }), c = ei(t.trim, { duration: i.duration }), f = {
1536
+ }), c = ni(t.trim, { duration: i.duration }), h = {
1537
1537
  width: i.width,
1538
1538
  height: i.height,
1539
1539
  opacity: 100,
@@ -1546,7 +1546,7 @@ const Pn = async (t, r) => {
1546
1546
  // Default border width
1547
1547
  borderColor: t.details.borderColor || "#000000",
1548
1548
  // Default border color
1549
- boxShadow: t.details.boxShadow || rr,
1549
+ boxShadow: t.details.boxShadow || sr,
1550
1550
  top: t.details.top || s.top || "0px",
1551
1551
  // Default top
1552
1552
  left: t.details.left || s.left || "0px",
@@ -1557,28 +1557,31 @@ const Pn = async (t, r) => {
1557
1557
  brightness: t.details.brightness || 100,
1558
1558
  flipX: t.details.flipX || !1,
1559
1559
  flipY: t.details.flipY || !1,
1560
- rotate: t.details.rotate || "0deg"
1560
+ rotate: t.details.rotate || "0deg",
1561
+ visibility: t.details.visibility || "visible",
1562
+ mediaWidth: t.details.mediaWidth || i.width || 100,
1563
+ mediaHeight: t.details.mediaHeight || i.height || 100
1561
1564
  };
1562
1565
  return {
1563
1566
  ...t,
1564
1567
  trim: c,
1565
1568
  type: "video",
1566
1569
  name: "video",
1567
- details: f,
1570
+ details: h,
1568
1571
  playbackRate: t.playbackRate || 1,
1569
- display: _e(t.display, { duration: i.duration, trim: c }),
1572
+ display: ke(t.display, { duration: i.duration, trim: c }),
1570
1573
  duration: i.duration
1571
1574
  };
1572
- }, Cn = async (t) => {
1575
+ }, pn = async (t) => {
1573
1576
  console.log({ payload: t });
1574
- const r = t.id, n = t.details, i = await Vi(n.src);
1577
+ const r = t.id, n = t.details, i = await Qi(n.src);
1575
1578
  console.log({ audioData: i });
1576
- const s = i.duration, c = ei(t.trim, { duration: s });
1579
+ const s = i.duration, c = ni(t.trim, { duration: s });
1577
1580
  return {
1578
1581
  id: r,
1579
1582
  name: "",
1580
1583
  type: "audio",
1581
- display: _e(t.display, { duration: s, trim: c }),
1584
+ display: ke(t.display, { duration: s, trim: c }),
1582
1585
  trim: c,
1583
1586
  playbackRate: t.playbackRate || 1,
1584
1587
  details: {
@@ -1589,14 +1592,61 @@ const Pn = async (t, r) => {
1589
1592
  metadata: { ...t.metadata },
1590
1593
  duration: s
1591
1594
  };
1592
- }, jn = async (t, r) => {
1593
- console.log({ payload: t });
1594
- const n = t.details, i = await Yi(n.src), s = nr(r, i);
1595
+ }, ta = async (t, r) => {
1596
+ const n = t.trackItemsIds, i = t.size, s = Math.min(
1597
+ r.size.width / i.width,
1598
+ r.size.height / i.height
1599
+ ), c = t.rotate || 0, h = t.position, m = t.display, P = t.trim || t.display;
1600
+ let F = 1 / 0, E = 0;
1601
+ const N = n.map((d) => {
1602
+ const f = t.trackItemsMap[d], p = t.trackItemsDetails[d];
1603
+ if (f.display.from < F && (F = f.display.from), f.display.to > E && (E = f.display.to), f.type === "text")
1604
+ return yn(
1605
+ { ...f, details: p.details },
1606
+ { size: i }
1607
+ );
1608
+ if (f.type === "image")
1609
+ return hn(
1610
+ { ...f, details: p.details },
1611
+ { size: i }
1612
+ );
1613
+ if (f.type === "video")
1614
+ return dn(
1615
+ { ...f, details: p.details },
1616
+ { size: i }
1617
+ );
1618
+ if (f.type === "audio")
1619
+ return pn({
1620
+ ...f,
1621
+ details: p.details
1622
+ });
1623
+ if (f.type === "caption")
1624
+ return mn(
1625
+ { ...f, details: p.details },
1626
+ { size: i }
1627
+ );
1628
+ }), b = await Promise.all(N);
1629
+ return {
1630
+ id: t.id,
1631
+ details: b,
1632
+ size: i,
1633
+ position: {
1634
+ top: h.top || 0,
1635
+ left: h.left || 0
1636
+ },
1637
+ trim: P,
1638
+ scale: s,
1639
+ display: m || { from: F, to: E },
1640
+ rotate: c,
1641
+ activeEdit: !1
1642
+ };
1643
+ }, hn = async (t, r) => {
1644
+ const n = t.details, i = await ti(n.src), s = or(r, i);
1595
1645
  return {
1596
1646
  id: t.id,
1597
1647
  type: "image",
1598
1648
  name: "image",
1599
- display: _e(t.display),
1649
+ display: ke(t.display),
1600
1650
  playbackRate: t.playbackRate || 1,
1601
1651
  details: {
1602
1652
  src: n.src || "",
@@ -1613,7 +1663,7 @@ const Pn = async (t, r) => {
1613
1663
  // Default border
1614
1664
  borderRadius: n.borderRadius || 0,
1615
1665
  // Default border radius
1616
- boxShadow: n.boxShadow || rr,
1666
+ boxShadow: n.boxShadow || sr,
1617
1667
  // Default box shadow
1618
1668
  top: n.top || s.top || "0px",
1619
1669
  // Default top
@@ -1627,51 +1677,54 @@ const Pn = async (t, r) => {
1627
1677
  brightness: n.brightness || 100,
1628
1678
  flipX: n.flipX || !1,
1629
1679
  flipY: n.flipY || !1,
1630
- rotate: n.rotate || "0deg"
1680
+ rotate: n.rotate || "0deg",
1681
+ visibility: n.visibility || "visible",
1682
+ mediaWidth: n.mediaWidth || n.width || i.width || 100,
1683
+ mediaHeight: n.mediaHeight || n.height || i.height || 100
1631
1684
  },
1632
1685
  metadata: t.metadata || {}
1633
1686
  };
1634
- }, Rn = async (t, r) => {
1687
+ }, mn = async (t, r) => {
1635
1688
  const n = t;
1636
- n.details.fontUrl && await _n([
1689
+ n.details.fontUrl && await kn([
1637
1690
  {
1638
1691
  fontFamily: n.details.fontFamily,
1639
1692
  url: n.details.fontUrl
1640
1693
  }
1641
1694
  ]);
1642
- const i = n.id, s = n.details, c = ri(s), f = ti(n.details.text, c), h = nr(r, {
1695
+ const i = n.id, s = n.details, c = ii(s), h = ri(n.details.text, c), m = or(r, {
1643
1696
  width: c.width,
1644
- height: f
1697
+ height: h
1645
1698
  });
1646
1699
  return {
1647
1700
  id: i,
1648
1701
  name: "caption",
1649
1702
  type: "caption",
1650
- display: _e(n.display),
1703
+ display: ke(n.display),
1651
1704
  details: {
1652
1705
  ...c,
1653
1706
  text: s.text || "",
1654
1707
  // Default text content
1655
- height: f,
1708
+ height: h,
1656
1709
  // Default height
1657
1710
  fontUrl: s.fontUrl,
1658
- top: c.top || h.top,
1659
- left: c.left || h.left,
1711
+ top: c.top || m.top,
1712
+ left: c.left || m.left,
1660
1713
  borderWidth: s.borderWidth || 0,
1661
1714
  borderColor: s.borderColor || "#000000",
1662
- boxShadow: s.boxShadow || rr,
1715
+ boxShadow: s.boxShadow || sr,
1663
1716
  words: s.words || []
1664
1717
  },
1665
1718
  metadata: {}
1666
1719
  };
1667
- }, Fn = async (t, r) => {
1668
- t.details.fontUrl && await _n([
1720
+ }, yn = async (t, r) => {
1721
+ t.details.fontUrl && await kn([
1669
1722
  {
1670
1723
  fontFamily: t.details.fontFamily,
1671
1724
  url: t.details.fontUrl
1672
1725
  }
1673
1726
  ]);
1674
- const n = t.id, i = t.details, s = ri(i), c = ti(t.details.text, s), f = nr(r, {
1727
+ const n = t.id, i = t.details, s = ii(i), c = ri(t.details.text, s), h = or(r, {
1675
1728
  width: s.width,
1676
1729
  height: c
1677
1730
  });
@@ -1679,7 +1732,7 @@ const Pn = async (t, r) => {
1679
1732
  id: n,
1680
1733
  name: "text",
1681
1734
  type: "text",
1682
- display: _e(t.display),
1735
+ display: ke(t.display),
1683
1736
  details: {
1684
1737
  ...s,
1685
1738
  text: i.text || "",
@@ -1687,15 +1740,15 @@ const Pn = async (t, r) => {
1687
1740
  height: c,
1688
1741
  // Default height
1689
1742
  fontUrl: i.fontUrl,
1690
- top: s.top || f.top,
1691
- left: s.left || f.left,
1743
+ top: s.top || h.top,
1744
+ left: s.left || h.left,
1692
1745
  borderWidth: i.borderWidth || 0,
1693
1746
  borderColor: i.borderColor || "#000000",
1694
- boxShadow: i.boxShadow || rr
1747
+ boxShadow: i.boxShadow || sr
1695
1748
  },
1696
1749
  metadata: {}
1697
1750
  };
1698
- }, ri = (t) => ({
1751
+ }, ii = (t) => ({
1699
1752
  fontFamily: t.fontFamily || "Arial",
1700
1753
  // Default font family
1701
1754
  fontSize: t.fontSize || "16px",
@@ -1737,14 +1790,14 @@ const Pn = async (t, r) => {
1737
1790
  left: t.left,
1738
1791
  textTransform: t.textTransform || "none",
1739
1792
  transform: t.transform || "none"
1740
- }), qi = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1741
- let qe = (t = 21) => {
1793
+ }), ea = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
1794
+ let tr = (t = 21) => {
1742
1795
  let r = "", n = crypto.getRandomValues(new Uint8Array(t));
1743
1796
  for (; t--; )
1744
- r += qi[n[t] & 63];
1797
+ r += ea[n[t] & 63];
1745
1798
  return r;
1746
1799
  };
1747
- function Ji(t, r) {
1800
+ function ra(t, r) {
1748
1801
  return t.filter((i) => {
1749
1802
  if (r.forEach((s) => {
1750
1803
  i.items.includes(s) && (i.items = i.items.filter((c) => c !== s));
@@ -1754,165 +1807,177 @@ function Ji(t, r) {
1754
1807
  }
1755
1808
  function en(t = 16) {
1756
1809
  const r = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", n = r.charAt(Math.floor(Math.random() * r.length));
1757
- let i = qe(t - 1);
1810
+ let i = tr(t - 1);
1758
1811
  return i = i.replace(/[^a-zA-Z0-9]/g, "").slice(0, t - 1), n + i;
1759
1812
  }
1760
- const Yt = (t) => Object.keys(t).reduce((r, n) => {
1813
+ const qt = (t) => Object.keys(t).reduce((r, n) => {
1761
1814
  const { display: i, playbackRate: s } = t[n];
1762
1815
  return Math.max(r, i.to / (s || 1));
1763
- }, 0);
1764
- function Zi(t) {
1765
- const r = $t.pipe(
1766
- Kt(({ key: p }) => p.startsWith(di))
1767
- ), n = $t.pipe(
1768
- Kt(({ key: p }) => p.startsWith(hi))
1769
- ), i = $t.pipe(
1770
- Kt(({ key: p }) => p.startsWith(yi))
1771
- ), s = $t.pipe(
1772
- Kt(({ key: p }) => p.startsWith(mi))
1773
- ), c = $t.pipe(
1774
- Kt(({ key: p }) => p.startsWith(bi))
1775
- ), f = $t.pipe(
1776
- Kt(({ key: p }) => p.startsWith(gi))
1777
- ), h = r.subscribe(async (p) => {
1778
- var y, l;
1779
- if (p.key === _i) {
1780
- const m = (y = p.value) == null ? void 0 : y.payload, S = m.size, v = m.trackItemIds, b = m.trackItemsMap, d = m.trackItemDetailsMap;
1816
+ }, 0), na = (t, r, n, i, s) => {
1817
+ let c = !1;
1818
+ return t.forEach((h) => {
1819
+ const m = n[h], P = m.display.from, F = m.display.to;
1820
+ (i !== void 0 || s !== void 0) && (c = r.find((b, d) => {
1821
+ if (i !== void 0 && b.id === i) return b;
1822
+ if (s !== void 0 && d === s) return b;
1823
+ }).items.map((b) => n[b]).some((b) => {
1824
+ const d = b.display.from, f = b.display.to;
1825
+ return d <= P && f >= F;
1826
+ }));
1827
+ }), c;
1828
+ };
1829
+ function ia(t) {
1830
+ const r = Vt.pipe(
1831
+ Xt(({ key: d }) => d.startsWith(mi))
1832
+ ), n = Vt.pipe(
1833
+ Xt(({ key: d }) => d.startsWith(yi))
1834
+ ), i = Vt.pipe(
1835
+ Xt(({ key: d }) => d.startsWith(bi))
1836
+ ), s = Vt.pipe(
1837
+ Xt(({ key: d }) => d.startsWith(gi))
1838
+ ), c = Vt.pipe(
1839
+ Xt(({ key: d }) => d.startsWith(_i))
1840
+ ), h = Vt.pipe(
1841
+ Xt(({ key: d }) => d.startsWith(Ii))
1842
+ ), m = r.subscribe(async (d) => {
1843
+ var f, p;
1844
+ if (d.key === vi) {
1845
+ const g = (f = d.value) == null ? void 0 : f.payload, S = g.size, _ = g.trackItemIds, y = g.trackItemsMap, l = g.trackItemDetailsMap;
1781
1846
  console.warn("IMPROVE FONTS LOADING");
1782
- const O = v.map(async (_) => {
1783
- var D;
1847
+ const x = _.map(async (I) => {
1848
+ var C;
1784
1849
  try {
1785
- const I = d[_], P = b[_];
1786
- if (I.type === "image") {
1787
- const k = await jn(
1788
- { id: _, details: I.details, ...P },
1850
+ const w = l[I], D = y[I];
1851
+ if (w.type === "image") {
1852
+ const k = await hn(
1853
+ { id: I, details: w.details, ...D },
1789
1854
  {
1790
1855
  size: S
1791
1856
  }
1792
- ), { details: A, ...U } = k;
1793
- d[_] = { type: "image", details: A }, b[_] = U;
1794
- } else if (I.type === "video") {
1795
- const k = X(
1796
- (D = p.value) == null ? void 0 : D.payload.trackItemsMap[_]
1797
- ), A = await Pn(
1798
- { ...I, ...k, ...P },
1857
+ ), { details: v, ...A } = k;
1858
+ l[I] = { type: "image", details: v }, y[I] = A;
1859
+ } else if (w.type === "video") {
1860
+ const k = B(
1861
+ (C = d.value) == null ? void 0 : C.payload.trackItemsMap[I]
1862
+ ), v = await dn(
1863
+ { ...w, ...k, ...D },
1799
1864
  {
1800
1865
  size: S
1801
1866
  }
1802
- ), { details: U, ...J } = A;
1803
- d[_] = { type: "video", details: U }, b[_] = J;
1804
- } else if (I.type === "audio") {
1805
- const k = await Cn({
1806
- id: _,
1807
- details: I.details,
1808
- ...P
1809
- }), { details: A, ...U } = k;
1810
- d[_] = { type: "audio", details: A }, b[_] = U;
1811
- } else if (I.type === "caption") {
1812
- const k = await Rn(
1813
- { id: _, details: I.details, ...P },
1867
+ ), { details: A, ...O } = v;
1868
+ l[I] = { type: "video", details: A }, y[I] = O;
1869
+ } else if (w.type === "audio") {
1870
+ const k = await pn({
1871
+ id: I,
1872
+ details: w.details,
1873
+ ...D
1874
+ }), { details: v, ...A } = k;
1875
+ l[I] = { type: "audio", details: v }, y[I] = A;
1876
+ } else if (w.type === "caption") {
1877
+ const k = await mn(
1878
+ { id: I, details: w.details, ...D },
1814
1879
  {
1815
1880
  size: S
1816
1881
  }
1817
- ), { details: A, ...U } = k;
1818
- d[_] = { type: "caption", details: A }, b[_] = U;
1819
- } else if (I.type === "text") {
1820
- const k = await Fn(
1821
- { id: _, details: I.details, ...P },
1882
+ ), { details: v, ...A } = k;
1883
+ l[I] = { type: "caption", details: v }, y[I] = A;
1884
+ } else if (w.type === "text") {
1885
+ const k = await yn(
1886
+ { id: I, details: w.details, ...D },
1822
1887
  {
1823
1888
  size: S
1824
1889
  }
1825
- ), { details: A, ...U } = k;
1826
- d[_] = { type: "text", details: A }, b[_] = U;
1890
+ ), { details: v, ...A } = k;
1891
+ l[I] = { type: "text", details: v }, y[I] = A;
1827
1892
  }
1828
1893
  return !0;
1829
1894
  } catch {
1830
1895
  return !1;
1831
1896
  }
1832
1897
  });
1833
- await Promise.all(O);
1834
- const E = Yt(b);
1898
+ await Promise.all(x);
1899
+ const M = qt(y);
1835
1900
  t.updateState({
1836
- ...m,
1837
- trackItemsMap: b,
1838
- duration: E
1901
+ ...g,
1902
+ trackItemsMap: y,
1903
+ duration: M
1839
1904
  });
1840
1905
  }
1841
- if (p.key === vi) {
1842
- const m = (l = p.value) == null ? void 0 : l.payload;
1906
+ if (d.key === Si) {
1907
+ const g = (p = d.value) == null ? void 0 : p.payload;
1843
1908
  t.updateState({
1844
- size: m
1909
+ size: g
1845
1910
  });
1846
1911
  }
1847
- }), x = s.subscribe((p) => {
1848
- if (p.key === Ii) return t.undo();
1849
- if (p.key === Si) return t.redo();
1850
- }), F = i.subscribe((p) => {
1851
- var m, S, v, b;
1852
- const y = [], l = [];
1853
- if ((m = p.value) != null && m.payload.trackItemIds && (y.push((S = p.value) == null ? void 0 : S.payload.trackItemIds), t.updateState({ activeIds: y })), p.key === wi) {
1854
- const d = (v = p.value) == null ? void 0 : v.payload.trackItemIds, O = X(t.getState()), E = d && d.length ? d : O.activeIds, _ = O.trackItemIds, D = O.trackItemDetailsMap, I = _.filter(
1855
- (J) => !E.includes(J)
1856
- ), P = Object.fromEntries(
1857
- Object.entries(D).filter(
1858
- ([J]) => !E.includes(J)
1912
+ }), P = s.subscribe((d) => {
1913
+ if (d.key === wi) return t.undo();
1914
+ if (d.key === ki) return t.redo();
1915
+ }), F = i.subscribe((d) => {
1916
+ var g, S, _, y;
1917
+ const f = [], p = [];
1918
+ if ((g = d.value) != null && g.payload.trackItemIds && (f.push((S = d.value) == null ? void 0 : S.payload.trackItemIds), t.updateState({ activeIds: f })), d.key === Ti) {
1919
+ const l = (_ = d.value) == null ? void 0 : _.payload.trackItemIds, x = B(t.getState()), M = l && l.length ? l : x.activeIds, I = x.trackItemIds, C = x.trackItemDetailsMap, w = I.filter(
1920
+ (O) => !M.includes(O)
1921
+ ), D = Object.fromEntries(
1922
+ Object.entries(C).filter(
1923
+ ([O]) => !M.includes(O)
1859
1924
  )
1860
- ), k = Ji(
1861
- O.tracks,
1862
- E
1863
- ), A = Object.fromEntries(
1864
- Object.entries(O.trackItemsMap).filter(
1865
- ([J]) => !E.includes(J)
1925
+ ), k = ra(
1926
+ x.tracks,
1927
+ M
1928
+ ), v = Object.fromEntries(
1929
+ Object.entries(x.trackItemsMap).filter(
1930
+ ([O]) => !M.includes(O)
1866
1931
  )
1867
- ), U = Yt(A);
1932
+ ), A = qt(v);
1868
1933
  t.updateState(
1869
1934
  {
1870
- trackItemIds: I,
1871
- trackItemDetailsMap: P,
1935
+ trackItemIds: w,
1936
+ trackItemDetailsMap: D,
1872
1937
  activeIds: [],
1873
- trackItemsMap: A,
1938
+ trackItemsMap: v,
1874
1939
  tracks: k,
1875
- duration: U
1940
+ duration: A
1876
1941
  },
1877
1942
  { updateHistory: !0, kind: "remove" }
1878
1943
  );
1879
1944
  }
1880
- if (p.key === ki) {
1881
- const d = X(t.getState()), O = ((b = p.value) == null ? void 0 : b.payload.trackItemIds) || d.activeIds;
1882
- if (O.length === 0) return;
1883
- O.forEach((_) => {
1884
- const D = d.trackItemsMap[_], I = d.trackItemDetailsMap[_], P = en();
1885
- l.push(P), d.trackItemsMap = {
1886
- ...d.trackItemsMap,
1887
- [P]: { ...X(D), id: P }
1888
- }, d.trackItemDetailsMap = {
1889
- ...d.trackItemDetailsMap,
1890
- [P]: {
1891
- ...X(I)
1945
+ if (d.key === Ei) {
1946
+ const l = B(t.getState()), x = ((y = d.value) == null ? void 0 : y.payload.trackItemIds) || l.activeIds;
1947
+ if (x.length === 0) return;
1948
+ x.forEach((I) => {
1949
+ const C = l.trackItemsMap[I], w = l.trackItemDetailsMap[I], D = en();
1950
+ p.push(D), l.trackItemsMap = {
1951
+ ...l.trackItemsMap,
1952
+ [D]: { ...B(C), id: D }
1953
+ }, l.trackItemDetailsMap = {
1954
+ ...l.trackItemDetailsMap,
1955
+ [D]: {
1956
+ ...B(w)
1892
1957
  }
1893
- }, d.trackItemIds.push(P);
1958
+ }, l.trackItemIds.push(D);
1894
1959
  });
1895
- const E = [];
1896
- d.tracks.forEach((_) => {
1897
- const D = {
1898
- ..._,
1960
+ const M = [];
1961
+ l.tracks.forEach((I) => {
1962
+ const C = {
1963
+ ...I,
1899
1964
  items: [],
1900
- id: qe()
1965
+ id: tr()
1901
1966
  };
1902
- _.items.forEach((I) => {
1903
- if (O.includes(I)) {
1904
- const P = O.indexOf(I);
1905
- D.items.push(l[P]);
1967
+ I.items.forEach((w) => {
1968
+ if (x.includes(w)) {
1969
+ const D = x.indexOf(w);
1970
+ C.items.push(p[D]);
1906
1971
  }
1907
- }), E.push(D);
1908
- }), E.forEach((_) => {
1909
- _.items.length !== 0 && d.tracks.unshift(_);
1972
+ }), M.push(C);
1973
+ }), M.forEach((I) => {
1974
+ I.items.length !== 0 && l.tracks.unshift(I);
1910
1975
  }), t.updateState(
1911
1976
  {
1912
- trackItemDetailsMap: d.trackItemDetailsMap,
1913
- tracks: d.tracks,
1914
- trackItemIds: d.trackItemIds,
1915
- trackItemsMap: d.trackItemsMap
1977
+ trackItemDetailsMap: l.trackItemDetailsMap,
1978
+ tracks: l.tracks,
1979
+ trackItemIds: l.trackItemIds,
1980
+ trackItemsMap: l.trackItemsMap
1916
1981
  },
1917
1982
  {
1918
1983
  updateHistory: !0,
@@ -1920,119 +1985,138 @@ function Zi(t) {
1920
1985
  }
1921
1986
  );
1922
1987
  }
1923
- }), T = n.subscribe(async (p) => {
1924
- var v, b, d, O, E;
1925
- const y = X(t.getState());
1926
- let l = [], m = "text";
1927
- if (p.key === Ti) {
1928
- m = "caption";
1929
- const _ = (v = p.value) == null ? void 0 : v.payload, D = [];
1930
- for (const k of _) {
1931
- const A = Rn(k, {
1932
- size: y.size
1988
+ }), E = n.subscribe(async (d) => {
1989
+ var l, x, M, I, C, w, D, k;
1990
+ const f = B(t.getState());
1991
+ let p = [], g = "text";
1992
+ const S = (l = d.value) == null ? void 0 : l.options.trackId, _ = (x = d.value) == null ? void 0 : x.options.trackIndex;
1993
+ if (d.key === Mi) {
1994
+ g = "caption";
1995
+ const v = (M = d.value) == null ? void 0 : M.payload, A = [];
1996
+ for (const V of v) {
1997
+ const ft = mn(V, {
1998
+ size: f.size
1933
1999
  });
1934
- D.push(A);
2000
+ A.push(ft);
1935
2001
  }
1936
- const I = await Promise.all(D), P = [];
1937
- for (const k of I) {
1938
- const A = k.id;
1939
- P.push(A);
1940
- const { details: U, ...J } = k;
1941
- y.trackItemDetailsMap[A] = {
1942
- type: m,
1943
- details: U
1944
- }, y.trackItemsMap[A] = J, y.trackItemIds.push(A);
2002
+ const O = await Promise.all(A), Z = [];
2003
+ for (const V of O) {
2004
+ const ft = V.id;
2005
+ Z.push(ft);
2006
+ const { details: Jt, ...Zt } = V;
2007
+ f.trackItemDetailsMap[ft] = {
2008
+ type: g,
2009
+ details: Jt
2010
+ }, f.trackItemsMap[ft] = Zt, f.trackItemIds.push(ft);
1945
2011
  }
1946
- l = P;
2012
+ p = Z;
2013
+ }
2014
+ if (d.key === Ai) {
2015
+ g = "text";
2016
+ const v = await yn((I = d.value) == null ? void 0 : I.payload, {
2017
+ size: f.size
2018
+ }), { details: A, ...O } = v;
2019
+ f.trackItemDetailsMap[O.id] = {
2020
+ type: g,
2021
+ details: A
2022
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1947
2023
  }
1948
- if (p.key === Ei) {
1949
- m = "text";
1950
- const _ = await Fn((b = p.value) == null ? void 0 : b.payload, {
1951
- size: y.size
1952
- }), { details: D, ...I } = _;
1953
- y.trackItemDetailsMap[I.id] = {
1954
- type: m,
1955
- details: D
1956
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2024
+ if (d.key === Oi) {
2025
+ g = "template";
2026
+ const v = await ta((C = d.value) == null ? void 0 : C.payload, {
2027
+ size: f.size
2028
+ }), { details: A, ...O } = v;
2029
+ f.trackItemsMap[v.id] = {
2030
+ ...O,
2031
+ type: "template"
2032
+ }, f.trackItemIds.push(O.id), f.trackItemDetailsMap[O.id] = {
2033
+ type: "template",
2034
+ details: A
2035
+ }, p = [O.id];
1957
2036
  }
1958
- if (p.key === Ai) {
1959
- m = "image";
1960
- const _ = await jn((d = p.value) == null ? void 0 : d.payload, {
1961
- size: y.size
1962
- }), { details: D, ...I } = _;
1963
- y.trackItemDetailsMap[I.id] = {
1964
- type: m,
1965
- details: D
1966
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2037
+ if (d.key === xi) {
2038
+ g = "image";
2039
+ const v = await hn((w = d.value) == null ? void 0 : w.payload, {
2040
+ size: f.size
2041
+ }), { details: A, ...O } = v;
2042
+ f.trackItemDetailsMap[O.id] = {
2043
+ type: g,
2044
+ details: A
2045
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1967
2046
  }
1968
- if (p.key === Mi) {
1969
- m = "audio";
1970
- const _ = await Cn((O = p.value) == null ? void 0 : O.payload), { details: D, ...I } = _;
1971
- y.trackItemDetailsMap[I.id] = {
1972
- type: m,
1973
- details: D
1974
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2047
+ if (d.key === Di) {
2048
+ g = "audio";
2049
+ const v = await pn((D = d.value) == null ? void 0 : D.payload), { details: A, ...O } = v;
2050
+ f.trackItemDetailsMap[O.id] = {
2051
+ type: g,
2052
+ details: A
2053
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1975
2054
  }
1976
- if (p.key === Oi) {
1977
- m = "video";
1978
- const _ = await Pn((E = p.value) == null ? void 0 : E.payload, {
1979
- size: y.size
1980
- }), { details: D, ...I } = _;
1981
- y.trackItemDetailsMap[I.id] = {
1982
- type: m,
1983
- details: D
1984
- }, y.trackItemsMap[I.id] = I, y.trackItemIds.push(I.id), l = [I.id];
2055
+ if (d.key === Pi) {
2056
+ g = "video";
2057
+ const v = await dn((k = d.value) == null ? void 0 : k.payload, {
2058
+ size: f.size
2059
+ }), { details: A, ...O } = v;
2060
+ f.trackItemDetailsMap[O.id] = {
2061
+ type: g,
2062
+ details: A
2063
+ }, f.trackItemsMap[O.id] = O, f.trackItemIds.push(O.id), p = [O.id];
1985
2064
  }
1986
- y.tracks.unshift({
1987
- id: qe(),
2065
+ const y = na(
2066
+ p,
2067
+ f.tracks,
2068
+ f.trackItemsMap,
2069
+ S,
2070
+ _
2071
+ );
2072
+ S !== void 0 && !y ? f.tracks.map((A) => A.id).includes(S) && (f.tracks = f.tracks.map((A) => (A.id === S && A.items.push(...p), A))) : _ !== void 0 && !y ? f.tracks = f.tracks.map((v, A) => (A === _ && v.items.push(...p), v)) : f.tracks.unshift({
2073
+ id: tr(),
1988
2074
  accepts: ["text", "audio", "helper", "video", "image", "caption"],
1989
- type: m,
1990
- items: l,
2075
+ type: g,
2076
+ items: p,
1991
2077
  magnetic: !1,
1992
2078
  static: !1
1993
- });
1994
- const S = Yt(y.trackItemsMap);
1995
- t.updateState(
2079
+ }), f.duration = qt(f.trackItemsMap), t.updateState(
1996
2080
  {
1997
- trackItemIds: y.trackItemIds,
1998
- trackItemDetailsMap: y.trackItemDetailsMap,
1999
- trackItemsMap: y.trackItemsMap,
2000
- tracks: y.tracks,
2001
- duration: S
2081
+ trackItemIds: f.trackItemIds,
2082
+ trackItemDetailsMap: f.trackItemDetailsMap,
2083
+ trackItemsMap: f.trackItemsMap,
2084
+ tracks: f.tracks,
2085
+ duration: f.duration
2002
2086
  },
2003
2087
  {
2004
2088
  updateHistory: !0,
2005
2089
  kind: "add"
2006
2090
  }
2007
2091
  );
2008
- }), H = c.subscribe(async (p) => {
2009
- var y;
2010
- if (p.key === xi) {
2011
- const l = X(t.getState()), m = (y = p.value) == null ? void 0 : y.options.time;
2012
- if (l.activeIds.length === 1) {
2013
- const S = l.activeIds[0], v = l.trackItemsMap[S];
2014
- if (m >= v.display.to || m <= v.display.from)
2092
+ }), N = c.subscribe(async (d) => {
2093
+ var f;
2094
+ if (d.key === Ci) {
2095
+ const p = B(t.getState()), g = (f = d.value) == null ? void 0 : f.options.time;
2096
+ if (p.activeIds.length === 1) {
2097
+ const S = p.activeIds[0], _ = p.trackItemsMap[S];
2098
+ if (g >= _.display.to || g <= _.display.from)
2015
2099
  return;
2016
- const b = l.trackItemDetailsMap[S], d = en(), O = {
2017
- ...v,
2018
- id: d,
2100
+ const y = p.trackItemDetailsMap[S], l = en(), x = {
2101
+ ..._,
2102
+ id: l,
2019
2103
  display: {
2020
- from: m,
2021
- to: v.display.to
2104
+ from: g,
2105
+ to: _.display.to
2022
2106
  },
2023
2107
  trim: {
2024
- from: m,
2025
- to: v.display.to
2108
+ from: g,
2109
+ to: _.display.to
2026
2110
  }
2027
2111
  };
2028
- l.trackItemsMap[S].display.to = m, l.trackItemsMap[d] = O, l.trackItemIds.push(d), l.trackItemDetailsMap[d] = b, l.tracks.forEach((E) => {
2029
- E.items.includes(S) && E.items.push(d);
2112
+ p.trackItemsMap[S].display.to = g, p.trackItemsMap[l] = x, p.trackItemIds.push(l), p.trackItemDetailsMap[l] = y, p.tracks.forEach((M) => {
2113
+ M.items.includes(S) && M.items.push(l);
2030
2114
  }), t.updateState(
2031
2115
  {
2032
- trackItemDetailsMap: l.trackItemDetailsMap,
2033
- tracks: l.tracks,
2034
- trackItemIds: l.trackItemIds,
2035
- trackItemsMap: l.trackItemsMap
2116
+ trackItemDetailsMap: p.trackItemDetailsMap,
2117
+ tracks: p.tracks,
2118
+ trackItemIds: p.trackItemIds,
2119
+ trackItemsMap: p.trackItemsMap
2036
2120
  },
2037
2121
  {
2038
2122
  updateHistory: !0,
@@ -2042,54 +2126,54 @@ function Zi(t) {
2042
2126
  }
2043
2127
  return;
2044
2128
  }
2045
- if (p.key === Di) {
2046
- const l = X(t.getState());
2047
- if (l.activeIds.length) {
2048
- const m = l.activeIds, S = [], v = {
2049
- activeIds: m,
2129
+ if (d.key === Ri) {
2130
+ const p = B(t.getState());
2131
+ if (p.activeIds.length) {
2132
+ const g = p.activeIds, S = [], _ = {
2133
+ activeIds: g,
2050
2134
  trackItemDetailsMap: {},
2051
2135
  trackItemsMap: {},
2052
2136
  tracks: []
2053
2137
  };
2054
- m.forEach((d) => {
2055
- v.trackItemDetailsMap[d] = l.trackItemDetailsMap[d], v.trackItemsMap[d] = l.trackItemsMap[d], S.push(
2056
- l.tracks.find((O) => O.items.includes(d))
2138
+ g.forEach((l) => {
2139
+ _.trackItemDetailsMap[l] = p.trackItemDetailsMap[l], _.trackItemsMap[l] = p.trackItemsMap[l], S.push(
2140
+ p.tracks.find((x) => x.items.includes(l))
2057
2141
  );
2058
2142
  });
2059
- const b = /* @__PURE__ */ new Set();
2060
- S.filter((d) => b.has(d.id) ? !1 : (b.add(d), !0)), v.tracks = Array.from(b.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(v));
2143
+ const y = /* @__PURE__ */ new Set();
2144
+ S.filter((l) => y.has(l.id) ? !1 : (y.add(l), !0)), _.tracks = Array.from(y.keys()), localStorage.setItem("DesignComboTemp", JSON.stringify(_));
2061
2145
  }
2062
2146
  }
2063
- if (p.key === Pi) {
2064
- const l = localStorage.getItem("DesignComboTemp");
2065
- if (!l) return;
2066
- const m = X(t.getState()), S = JSON.parse(l), v = {}, b = S.trackItemsMap, d = S.trackItemDetailsMap, O = S.tracks, E = [], _ = S.activeIds.map(async (D) => {
2067
- const I = d[D];
2068
- (I.type === "caption" || I.type === "text") && I.details.fontUrl && await _n([
2147
+ if (d.key === Fi) {
2148
+ const p = localStorage.getItem("DesignComboTemp");
2149
+ if (!p) return;
2150
+ const g = B(t.getState()), S = JSON.parse(p), _ = {}, y = S.trackItemsMap, l = S.trackItemDetailsMap, x = S.tracks, M = [], I = S.activeIds.map(async (C) => {
2151
+ const w = l[C];
2152
+ (w.type === "caption" || w.type === "text") && w.details.fontUrl && await kn([
2069
2153
  {
2070
- fontFamily: I.details.fontFamily,
2071
- url: I.details.fontUrl
2154
+ fontFamily: w.details.fontFamily,
2155
+ url: w.details.fontUrl
2072
2156
  }
2073
2157
  ]);
2074
- const P = en();
2075
- return v[D] = P, m.trackItemsMap[P] = {
2076
- ...b[D],
2077
- id: P
2078
- }, m.trackItemDetailsMap[P] = I, m.trackItemIds.push(P), !0;
2158
+ const D = en();
2159
+ return _[C] = D, g.trackItemsMap[D] = {
2160
+ ...y[C],
2161
+ id: D
2162
+ }, g.trackItemDetailsMap[D] = w, g.trackItemIds.push(D), !0;
2079
2163
  });
2080
- await Promise.all(_), O.forEach((D) => {
2081
- const I = D.items.map((k) => v[k]), P = {
2082
- ...D,
2083
- items: I,
2084
- id: qe()
2164
+ await Promise.all(I), x.forEach((C) => {
2165
+ const w = C.items.map((k) => _[k]), D = {
2166
+ ...C,
2167
+ items: w,
2168
+ id: tr()
2085
2169
  };
2086
- E.push(P);
2087
- }), m.tracks = [...m.tracks, ...E], t.updateState(
2170
+ M.push(D);
2171
+ }), g.tracks = [...g.tracks, ...M], t.updateState(
2088
2172
  {
2089
- trackItemDetailsMap: m.trackItemDetailsMap,
2090
- tracks: m.tracks,
2091
- trackItemIds: m.trackItemIds,
2092
- trackItemsMap: m.trackItemsMap
2173
+ trackItemDetailsMap: g.trackItemDetailsMap,
2174
+ tracks: g.tracks,
2175
+ trackItemIds: g.trackItemIds,
2176
+ trackItemsMap: g.trackItemsMap
2093
2177
  },
2094
2178
  {
2095
2179
  updateHistory: !0,
@@ -2097,25 +2181,88 @@ function Zi(t) {
2097
2181
  }
2098
2182
  );
2099
2183
  }
2100
- }), g = f.subscribe((p) => {
2101
- var y, l;
2102
- if (p.key === Ci) {
2103
- const m = X(t.getState()), S = m.trackItemDetailsMap, v = m.trackItemsMap, b = Object.keys((y = p.value) == null ? void 0 : y.payload);
2104
- if (!b.length) return;
2105
- const d = (l = p.value) == null ? void 0 : l.payload;
2106
- b.forEach((E) => {
2107
- const _ = d[E];
2108
- _.details ? S[E].details = {
2109
- ...S[E].details,
2110
- ..._.details
2111
- } : _.playbackRate && (v[E].playbackRate = _.playbackRate);
2184
+ }), b = h.subscribe(async (d) => {
2185
+ var f, p, g, S;
2186
+ if (d.key === ji) {
2187
+ const _ = B(t.getState()), [y] = (f = d.value) == null ? void 0 : f.payload.trackItemIds, l = _.trackItemDetailsMap;
2188
+ _.trackItemIds.forEach((M) => {
2189
+ const I = l[M];
2190
+ if (I.type === "template" && I.details.map((w) => w.id).includes(y)) {
2191
+ const w = I.details.filter(
2192
+ (D) => D.id !== y
2193
+ );
2194
+ I.details = w;
2195
+ }
2196
+ }), t.updateState(
2197
+ {
2198
+ trackItemDetailsMap: { ...l }
2199
+ },
2200
+ {
2201
+ updateHistory: !0,
2202
+ kind: "update"
2203
+ }
2204
+ );
2205
+ }
2206
+ if (d.key === zi) {
2207
+ const _ = B(t.getState()), y = _.trackItemDetailsMap, l = _.trackItemsMap, x = Object.keys((p = d.value) == null ? void 0 : p.payload);
2208
+ if (!x.length) return;
2209
+ const M = (g = d.value) == null ? void 0 : g.payload;
2210
+ x.forEach((C) => {
2211
+ const w = M[C];
2212
+ w.details ? y[C].details = {
2213
+ ...y[C].details,
2214
+ ...w.details
2215
+ } : M[C].playbackRate ? l[C].playbackRate = M[C].playbackRate : y[C].type === "template" && (l[C] = {
2216
+ ...l[C],
2217
+ ...M[C]
2218
+ });
2112
2219
  });
2113
- const O = Yt(v);
2220
+ const I = qt(l);
2221
+ t.updateState(
2222
+ {
2223
+ trackItemDetailsMap: { ...y },
2224
+ trackItemsMap: { ...l },
2225
+ duration: I
2226
+ },
2227
+ {
2228
+ updateHistory: !0,
2229
+ kind: "update:details"
2230
+ }
2231
+ );
2232
+ }
2233
+ if (d.key === Hi) {
2234
+ const _ = (S = d.value) == null ? void 0 : S.payload, y = Object.keys(_)[0], l = Object.values(_)[0], x = B(t.getState());
2235
+ for (const M of x.trackItemIds)
2236
+ if (x.trackItemsMap[M].type === "template") {
2237
+ const I = x.trackItemDetailsMap[M];
2238
+ if (I.details.map((w) => w.id).includes(y)) {
2239
+ for (let w of I.details)
2240
+ if (w.id === y) {
2241
+ if (l.details) {
2242
+ if (l.type === "image" && l.details.src) {
2243
+ const k = await ti(l.details.src), v = w.details.width, A = w.details.height;
2244
+ let O = k.width, Z = k.height;
2245
+ const V = k.width / k.height;
2246
+ v / A > V ? (O = v, Z = v / V) : (Z = A, O = A * V), l.details.mediaWidth = O, l.details.mediaHeight = Z;
2247
+ }
2248
+ if (l.type === "video" && l.details.src) {
2249
+ const k = await ei(l.details.src), v = w.details.width, A = w.details.height;
2250
+ let O = k.width, Z = k.height;
2251
+ const V = k.width / k.height;
2252
+ v / A > V ? (O = v, Z = v / V) : (Z = A, O = A * V), l.details.mediaWidth = O, l.details.mediaHeight = Z;
2253
+ }
2254
+ const D = w.details;
2255
+ w.details = { ...D, ...l.details }, l.details = w.details;
2256
+ }
2257
+ w = { ...w, ...l }, x.trackItemDetailsMap[M].details = I.details.map((D) => D.id === y ? w : D);
2258
+ }
2259
+ }
2260
+ }
2114
2261
  t.updateState(
2115
2262
  {
2116
- trackItemDetailsMap: { ...S },
2117
- trackItemsMap: { ...v },
2118
- duration: O
2263
+ trackItemDetailsMap: {
2264
+ ...x.trackItemDetailsMap
2265
+ }
2119
2266
  },
2120
2267
  {
2121
2268
  updateHistory: !0,
@@ -2123,50 +2270,63 @@ function Zi(t) {
2123
2270
  }
2124
2271
  );
2125
2272
  }
2273
+ if (d.key === Ni) {
2274
+ const _ = B(t.getState());
2275
+ _.trackItemIds.forEach((y) => {
2276
+ const l = _.trackItemsMap[y];
2277
+ l.type === "template" && (l.activeEdit = !1, t.updateState({
2278
+ trackItemsMap: {
2279
+ ..._.trackItemsMap,
2280
+ [y]: l
2281
+ },
2282
+ activeIds: []
2283
+ }));
2284
+ });
2285
+ }
2126
2286
  });
2127
2287
  return {
2128
2288
  unsubscribe: () => {
2129
- T.unsubscribe(), H.unsubscribe(), g.unsubscribe(), x.unsubscribe(), F.unsubscribe(), h.unsubscribe();
2289
+ E.unsubscribe(), N.unsubscribe(), b.unsubscribe(), P.unsubscribe(), F.unsubscribe(), m.unsubscribe();
2130
2290
  }
2131
2291
  };
2132
2292
  }
2133
- const Qi = { Date: !0, RegExp: !0, String: !0, Number: !0 };
2134
- function ni(t, r, n = { cyclesFix: !0 }, i = []) {
2135
- var h, x;
2293
+ const aa = { Date: !0, RegExp: !0, String: !0, Number: !0 };
2294
+ function ai(t, r, n = { cyclesFix: !0 }, i = []) {
2295
+ var m, P;
2136
2296
  let s = [];
2137
2297
  const c = Array.isArray(t);
2138
2298
  for (const F in t) {
2139
- const T = t[F], H = c ? +F : F;
2299
+ const E = t[F], N = c ? +F : F;
2140
2300
  if (!(F in r)) {
2141
2301
  s.push({
2142
2302
  type: "REMOVE",
2143
- path: [H],
2303
+ path: [N],
2144
2304
  oldValue: t[F]
2145
2305
  });
2146
2306
  continue;
2147
2307
  }
2148
- const g = r[F], p = typeof T == "object" && typeof g == "object" && Array.isArray(T) === Array.isArray(g);
2149
- if (T && g && p && !Qi[(x = (h = Object.getPrototypeOf(T)) == null ? void 0 : h.constructor) == null ? void 0 : x.name] && (!n.cyclesFix || !i.includes(T))) {
2150
- const y = ni(T, g, n, n.cyclesFix ? i.concat([T]) : []);
2151
- s.push.apply(s, y.map((l) => (l.path.unshift(H), l)));
2152
- } else T !== g && // treat NaN values as equivalent
2153
- !(Number.isNaN(T) && Number.isNaN(g)) && !(p && (isNaN(T) ? T + "" == g + "" : +T == +g)) && s.push({
2154
- path: [H],
2308
+ const b = r[F], d = typeof E == "object" && typeof b == "object" && Array.isArray(E) === Array.isArray(b);
2309
+ if (E && b && d && !aa[(P = (m = Object.getPrototypeOf(E)) == null ? void 0 : m.constructor) == null ? void 0 : P.name] && (!n.cyclesFix || !i.includes(E))) {
2310
+ const f = ai(E, b, n, n.cyclesFix ? i.concat([E]) : []);
2311
+ s.push.apply(s, f.map((p) => (p.path.unshift(N), p)));
2312
+ } else E !== b && // treat NaN values as equivalent
2313
+ !(Number.isNaN(E) && Number.isNaN(b)) && !(d && (isNaN(E) ? E + "" == b + "" : +E == +b)) && s.push({
2314
+ path: [N],
2155
2315
  type: "CHANGE",
2156
- value: g,
2157
- oldValue: T
2316
+ value: b,
2317
+ oldValue: E
2158
2318
  });
2159
2319
  }
2160
- const f = Array.isArray(r);
2320
+ const h = Array.isArray(r);
2161
2321
  for (const F in r)
2162
2322
  F in t || s.push({
2163
2323
  type: "CREATE",
2164
- path: [f ? +F : F],
2324
+ path: [h ? +F : F],
2165
2325
  value: r[F]
2166
2326
  });
2167
2327
  return s;
2168
2328
  }
2169
- var vn = Symbol.for("immer-nothing"), de = Symbol.for("immer-draftable"), tt = Symbol.for("immer-state"), ii = process.env.NODE_ENV !== "production" ? [
2329
+ var Tn = Symbol.for("immer-nothing"), ge = Symbol.for("immer-draftable"), nt = Symbol.for("immer-state"), si = process.env.NODE_ENV !== "production" ? [
2170
2330
  // All error codes, starting by 0:
2171
2331
  function(t) {
2172
2332
  return `The plugin for '${t}' has not been loaded into Immer. To enable the plugin, import and call \`enable${t}()\` when initializing your application.`;
@@ -2197,117 +2357,117 @@ var vn = Symbol.for("immer-nothing"), de = Symbol.for("immer-draftable"), tt = S
2197
2357
  // Note: if more errors are added, the errorOffset in Patches.ts should be increased
2198
2358
  // See Patches.ts for additional errors
2199
2359
  ] : [];
2200
- function W(t, ...r) {
2360
+ function $(t, ...r) {
2201
2361
  if (process.env.NODE_ENV !== "production") {
2202
- const n = ii[t], i = typeof n == "function" ? n.apply(null, r) : n;
2362
+ const n = si[t], i = typeof n == "function" ? n.apply(null, r) : n;
2203
2363
  throw new Error(`[Immer] ${i}`);
2204
2364
  }
2205
2365
  throw new Error(
2206
2366
  `[Immer] minified error nr: ${t}. Full error at: https://bit.ly/3cXEKWf`
2207
2367
  );
2208
2368
  }
2209
- var xt = Object.getPrototypeOf;
2210
- function Dt(t) {
2211
- return !!t && !!t[tt];
2369
+ var Ct = Object.getPrototypeOf;
2370
+ function Rt(t) {
2371
+ return !!t && !!t[nt];
2212
2372
  }
2213
- function vt(t) {
2373
+ function wt(t) {
2214
2374
  var r;
2215
- return t ? ai(t) || Array.isArray(t) || !!t[de] || !!((r = t.constructor) != null && r[de]) || ve(t) || Ie(t) : !1;
2375
+ return t ? oi(t) || Array.isArray(t) || !!t[ge] || !!((r = t.constructor) != null && r[ge]) || Te(t) || Ee(t) : !1;
2216
2376
  }
2217
- var ta = Object.prototype.constructor.toString();
2218
- function ai(t) {
2377
+ var sa = Object.prototype.constructor.toString();
2378
+ function oi(t) {
2219
2379
  if (!t || typeof t != "object")
2220
2380
  return !1;
2221
- const r = xt(t);
2381
+ const r = Ct(t);
2222
2382
  if (r === null)
2223
2383
  return !0;
2224
2384
  const n = Object.hasOwnProperty.call(r, "constructor") && r.constructor;
2225
- return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === ta;
2385
+ return n === Object ? !0 : typeof n == "function" && Function.toString.call(n) === sa;
2226
2386
  }
2227
- function he(t, r) {
2228
- Pt(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
2387
+ function _e(t, r) {
2388
+ Ft(t) === 0 ? Reflect.ownKeys(t).forEach((n) => {
2229
2389
  r(n, t[n], t);
2230
2390
  }) : t.forEach((n, i) => r(i, n, t));
2231
2391
  }
2232
- function Pt(t) {
2233
- const r = t[tt];
2234
- return r ? r.type_ : Array.isArray(t) ? 1 : ve(t) ? 2 : Ie(t) ? 3 : 0;
2392
+ function Ft(t) {
2393
+ const r = t[nt];
2394
+ return r ? r.type_ : Array.isArray(t) ? 1 : Te(t) ? 2 : Ee(t) ? 3 : 0;
2235
2395
  }
2236
- function ye(t, r) {
2237
- return Pt(t) === 2 ? t.has(r) : Object.prototype.hasOwnProperty.call(t, r);
2396
+ function Ie(t, r) {
2397
+ return Ft(t) === 2 ? t.has(r) : Object.prototype.hasOwnProperty.call(t, r);
2238
2398
  }
2239
2399
  function rn(t, r) {
2240
- return Pt(t) === 2 ? t.get(r) : t[r];
2400
+ return Ft(t) === 2 ? t.get(r) : t[r];
2241
2401
  }
2242
- function si(t, r, n) {
2243
- const i = Pt(t);
2402
+ function ci(t, r, n) {
2403
+ const i = Ft(t);
2244
2404
  i === 2 ? t.set(r, n) : i === 3 ? t.add(n) : t[r] = n;
2245
2405
  }
2246
- function ea(t, r) {
2406
+ function oa(t, r) {
2247
2407
  return t === r ? t !== 0 || 1 / t === 1 / r : t !== t && r !== r;
2248
2408
  }
2249
- function ve(t) {
2409
+ function Te(t) {
2250
2410
  return t instanceof Map;
2251
2411
  }
2252
- function Ie(t) {
2412
+ function Ee(t) {
2253
2413
  return t instanceof Set;
2254
2414
  }
2255
- function Ot(t) {
2415
+ function Pt(t) {
2256
2416
  return t.copy_ || t.base_;
2257
2417
  }
2258
- function pn(t, r) {
2259
- if (ve(t))
2418
+ function bn(t, r) {
2419
+ if (Te(t))
2260
2420
  return new Map(t);
2261
- if (Ie(t))
2421
+ if (Ee(t))
2262
2422
  return new Set(t);
2263
2423
  if (Array.isArray(t))
2264
2424
  return Array.prototype.slice.call(t);
2265
- const n = ai(t);
2425
+ const n = oi(t);
2266
2426
  if (r === !0 || r === "class_only" && !n) {
2267
2427
  const i = Object.getOwnPropertyDescriptors(t);
2268
- delete i[tt];
2428
+ delete i[nt];
2269
2429
  let s = Reflect.ownKeys(i);
2270
2430
  for (let c = 0; c < s.length; c++) {
2271
- const f = s[c], h = i[f];
2272
- h.writable === !1 && (h.writable = !0, h.configurable = !0), (h.get || h.set) && (i[f] = {
2431
+ const h = s[c], m = i[h];
2432
+ m.writable === !1 && (m.writable = !0, m.configurable = !0), (m.get || m.set) && (i[h] = {
2273
2433
  configurable: !0,
2274
2434
  writable: !0,
2275
2435
  // could live with !!desc.set as well here...
2276
- enumerable: h.enumerable,
2277
- value: t[f]
2436
+ enumerable: m.enumerable,
2437
+ value: t[h]
2278
2438
  });
2279
2439
  }
2280
- return Object.create(xt(t), i);
2440
+ return Object.create(Ct(t), i);
2281
2441
  } else {
2282
- const i = xt(t);
2442
+ const i = Ct(t);
2283
2443
  if (i !== null && n)
2284
2444
  return { ...t };
2285
2445
  const s = Object.create(i);
2286
2446
  return Object.assign(s, t);
2287
2447
  }
2288
2448
  }
2289
- function In(t, r = !1) {
2290
- return ir(t) || Dt(t) || !vt(t) || (Pt(t) > 1 && (t.set = t.add = t.clear = t.delete = ra), Object.freeze(t), r && Object.entries(t).forEach(([n, i]) => In(i, !0))), t;
2449
+ function En(t, r = !1) {
2450
+ return cr(t) || Rt(t) || !wt(t) || (Ft(t) > 1 && (t.set = t.add = t.clear = t.delete = ca), Object.freeze(t), r && Object.entries(t).forEach(([n, i]) => En(i, !0))), t;
2291
2451
  }
2292
- function ra() {
2293
- W(2);
2452
+ function ca() {
2453
+ $(2);
2294
2454
  }
2295
- function ir(t) {
2455
+ function cr(t) {
2296
2456
  return Object.isFrozen(t);
2297
2457
  }
2298
- var dn = {};
2299
- function Ct(t) {
2300
- const r = dn[t];
2301
- return r || W(0, t), r;
2458
+ var gn = {};
2459
+ function jt(t) {
2460
+ const r = gn[t];
2461
+ return r || $(0, t), r;
2302
2462
  }
2303
- function na(t, r) {
2304
- dn[t] || (dn[t] = r);
2463
+ function ua(t, r) {
2464
+ gn[t] || (gn[t] = r);
2305
2465
  }
2306
- var me;
2307
- function oi() {
2308
- return me;
2466
+ var ve;
2467
+ function ui() {
2468
+ return ve;
2309
2469
  }
2310
- function ia(t, r) {
2470
+ function la(t, r) {
2311
2471
  return {
2312
2472
  drafts_: [],
2313
2473
  parent_: t,
@@ -2319,52 +2479,52 @@ function ia(t, r) {
2319
2479
  };
2320
2480
  }
2321
2481
  function zn(t, r) {
2322
- r && (Ct("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = r);
2482
+ r && (jt("Patches"), t.patches_ = [], t.inversePatches_ = [], t.patchListener_ = r);
2323
2483
  }
2324
- function hn(t) {
2325
- yn(t), t.drafts_.forEach(aa), t.drafts_ = null;
2484
+ function _n(t) {
2485
+ In(t), t.drafts_.forEach(fa), t.drafts_ = null;
2326
2486
  }
2327
- function yn(t) {
2328
- t === me && (me = t.parent_);
2487
+ function In(t) {
2488
+ t === ve && (ve = t.parent_);
2329
2489
  }
2330
- function Nn(t) {
2331
- return me = ia(me, t);
2490
+ function Hn(t) {
2491
+ return ve = la(ve, t);
2332
2492
  }
2333
- function aa(t) {
2334
- const r = t[tt];
2493
+ function fa(t) {
2494
+ const r = t[nt];
2335
2495
  r.type_ === 0 || r.type_ === 1 ? r.revoke_() : r.revoked_ = !0;
2336
2496
  }
2337
- function Hn(t, r) {
2497
+ function Nn(t, r) {
2338
2498
  r.unfinalizedDrafts_ = r.drafts_.length;
2339
2499
  const n = r.drafts_[0];
2340
- return t !== void 0 && t !== n ? (n[tt].modified_ && (hn(r), W(4)), vt(t) && (t = Qe(r, t), r.parent_ || tr(r, t)), r.patches_ && Ct("Patches").generateReplacementPatches_(
2341
- n[tt].base_,
2500
+ return t !== void 0 && t !== n ? (n[nt].modified_ && (_n(r), $(4)), wt(t) && (t = nr(r, t), r.parent_ || ir(r, t)), r.patches_ && jt("Patches").generateReplacementPatches_(
2501
+ n[nt].base_,
2342
2502
  t,
2343
2503
  r.patches_,
2344
2504
  r.inversePatches_
2345
- )) : t = Qe(r, n, []), hn(r), r.patches_ && r.patchListener_(r.patches_, r.inversePatches_), t !== vn ? t : void 0;
2505
+ )) : t = nr(r, n, []), _n(r), r.patches_ && r.patchListener_(r.patches_, r.inversePatches_), t !== Tn ? t : void 0;
2346
2506
  }
2347
- function Qe(t, r, n) {
2348
- if (ir(r))
2507
+ function nr(t, r, n) {
2508
+ if (cr(r))
2349
2509
  return r;
2350
- const i = r[tt];
2510
+ const i = r[nt];
2351
2511
  if (!i)
2352
- return he(
2512
+ return _e(
2353
2513
  r,
2354
- (s, c) => Un(t, i, r, s, c, n)
2514
+ (s, c) => Ln(t, i, r, s, c, n)
2355
2515
  ), r;
2356
2516
  if (i.scope_ !== t)
2357
2517
  return r;
2358
2518
  if (!i.modified_)
2359
- return tr(t, i.base_, !0), i.base_;
2519
+ return ir(t, i.base_, !0), i.base_;
2360
2520
  if (!i.finalized_) {
2361
2521
  i.finalized_ = !0, i.scope_.unfinalizedDrafts_--;
2362
2522
  const s = i.copy_;
2363
- let c = s, f = !1;
2364
- i.type_ === 3 && (c = new Set(s), s.clear(), f = !0), he(
2523
+ let c = s, h = !1;
2524
+ i.type_ === 3 && (c = new Set(s), s.clear(), h = !0), _e(
2365
2525
  c,
2366
- (h, x) => Un(t, i, s, h, x, n, f)
2367
- ), tr(t, s, !1), n && t.patches_ && Ct("Patches").generatePatches_(
2526
+ (m, P) => Ln(t, i, s, m, P, n, h)
2527
+ ), ir(t, s, !1), n && t.patches_ && jt("Patches").generatePatches_(
2368
2528
  i,
2369
2529
  n,
2370
2530
  t.patches_,
@@ -2373,29 +2533,29 @@ function Qe(t, r, n) {
2373
2533
  }
2374
2534
  return i.copy_;
2375
2535
  }
2376
- function Un(t, r, n, i, s, c, f) {
2377
- if (process.env.NODE_ENV !== "production" && s === n && W(5), Dt(s)) {
2378
- const h = c && r && r.type_ !== 3 && // Set objects are atomic since they have no keys.
2379
- !ye(r.assigned_, i) ? c.concat(i) : void 0, x = Qe(t, s, h);
2380
- if (si(n, i, x), Dt(x))
2536
+ function Ln(t, r, n, i, s, c, h) {
2537
+ if (process.env.NODE_ENV !== "production" && s === n && $(5), Rt(s)) {
2538
+ const m = c && r && r.type_ !== 3 && // Set objects are atomic since they have no keys.
2539
+ !Ie(r.assigned_, i) ? c.concat(i) : void 0, P = nr(t, s, m);
2540
+ if (ci(n, i, P), Rt(P))
2381
2541
  t.canAutoFreeze_ = !1;
2382
2542
  else
2383
2543
  return;
2384
- } else f && n.add(s);
2385
- if (vt(s) && !ir(s)) {
2544
+ } else h && n.add(s);
2545
+ if (wt(s) && !cr(s)) {
2386
2546
  if (!t.immer_.autoFreeze_ && t.unfinalizedDrafts_ < 1)
2387
2547
  return;
2388
- Qe(t, s), (!r || !r.scope_.parent_) && typeof i != "symbol" && Object.prototype.propertyIsEnumerable.call(n, i) && tr(t, s);
2548
+ nr(t, s), (!r || !r.scope_.parent_) && typeof i != "symbol" && Object.prototype.propertyIsEnumerable.call(n, i) && ir(t, s);
2389
2549
  }
2390
2550
  }
2391
- function tr(t, r, n = !1) {
2392
- !t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && In(r, n);
2551
+ function ir(t, r, n = !1) {
2552
+ !t.parent_ && t.immer_.autoFreeze_ && t.canAutoFreeze_ && En(r, n);
2393
2553
  }
2394
- function sa(t, r) {
2554
+ function da(t, r) {
2395
2555
  const n = Array.isArray(t), i = {
2396
2556
  type_: n ? 1 : 0,
2397
2557
  // Track which produce call this is associated with.
2398
- scope_: r ? r.scope_ : oi(),
2558
+ scope_: r ? r.scope_ : ui(),
2399
2559
  // True for both shallow and deep changes.
2400
2560
  modified_: !1,
2401
2561
  // Used during finalization.
@@ -2415,50 +2575,50 @@ function sa(t, r) {
2415
2575
  revoke_: null,
2416
2576
  isManual_: !1
2417
2577
  };
2418
- let s = i, c = Sn;
2419
- n && (s = [i], c = be);
2420
- const { revoke: f, proxy: h } = Proxy.revocable(s, c);
2421
- return i.draft_ = h, i.revoke_ = f, h;
2578
+ let s = i, c = Mn;
2579
+ n && (s = [i], c = Se);
2580
+ const { revoke: h, proxy: m } = Proxy.revocable(s, c);
2581
+ return i.draft_ = m, i.revoke_ = h, m;
2422
2582
  }
2423
- var Sn = {
2583
+ var Mn = {
2424
2584
  get(t, r) {
2425
- if (r === tt)
2585
+ if (r === nt)
2426
2586
  return t;
2427
- const n = Ot(t);
2428
- if (!ye(n, r))
2429
- return oa(t, n, r);
2587
+ const n = Pt(t);
2588
+ if (!Ie(n, r))
2589
+ return pa(t, n, r);
2430
2590
  const i = n[r];
2431
- return t.finalized_ || !vt(i) ? i : i === nn(t.base_, r) ? (an(t), t.copy_[r] = bn(i, t)) : i;
2591
+ return t.finalized_ || !wt(i) ? i : i === nn(t.base_, r) ? (an(t), t.copy_[r] = Sn(i, t)) : i;
2432
2592
  },
2433
2593
  has(t, r) {
2434
- return r in Ot(t);
2594
+ return r in Pt(t);
2435
2595
  },
2436
2596
  ownKeys(t) {
2437
- return Reflect.ownKeys(Ot(t));
2597
+ return Reflect.ownKeys(Pt(t));
2438
2598
  },
2439
2599
  set(t, r, n) {
2440
- const i = ci(Ot(t), r);
2600
+ const i = li(Pt(t), r);
2441
2601
  if (i != null && i.set)
2442
2602
  return i.set.call(t.draft_, n), !0;
2443
2603
  if (!t.modified_) {
2444
- const s = nn(Ot(t), r), c = s == null ? void 0 : s[tt];
2604
+ const s = nn(Pt(t), r), c = s == null ? void 0 : s[nt];
2445
2605
  if (c && c.base_ === n)
2446
2606
  return t.copy_[r] = n, t.assigned_[r] = !1, !0;
2447
- if (ea(n, s) && (n !== void 0 || ye(t.base_, r)))
2607
+ if (oa(n, s) && (n !== void 0 || Ie(t.base_, r)))
2448
2608
  return !0;
2449
- an(t), mn(t);
2609
+ an(t), vn(t);
2450
2610
  }
2451
2611
  return t.copy_[r] === n && // special case: handle new props with value 'undefined'
2452
2612
  (n !== void 0 || r in t.copy_) || // special case: NaN
2453
2613
  Number.isNaN(n) && Number.isNaN(t.copy_[r]) || (t.copy_[r] = n, t.assigned_[r] = !0), !0;
2454
2614
  },
2455
2615
  deleteProperty(t, r) {
2456
- return nn(t.base_, r) !== void 0 || r in t.base_ ? (t.assigned_[r] = !1, an(t), mn(t)) : delete t.assigned_[r], t.copy_ && delete t.copy_[r], !0;
2616
+ return nn(t.base_, r) !== void 0 || r in t.base_ ? (t.assigned_[r] = !1, an(t), vn(t)) : delete t.assigned_[r], t.copy_ && delete t.copy_[r], !0;
2457
2617
  },
2458
2618
  // Note: We never coerce `desc.value` into an Immer draft, because we can't make
2459
2619
  // the same guarantee in ES5 mode.
2460
2620
  getOwnPropertyDescriptor(t, r) {
2461
- const n = Ot(t), i = Reflect.getOwnPropertyDescriptor(n, r);
2621
+ const n = Pt(t), i = Reflect.getOwnPropertyDescriptor(n, r);
2462
2622
  return i && {
2463
2623
  writable: !0,
2464
2624
  configurable: t.type_ !== 1 || r !== "length",
@@ -2467,108 +2627,108 @@ var Sn = {
2467
2627
  };
2468
2628
  },
2469
2629
  defineProperty() {
2470
- W(11);
2630
+ $(11);
2471
2631
  },
2472
2632
  getPrototypeOf(t) {
2473
- return xt(t.base_);
2633
+ return Ct(t.base_);
2474
2634
  },
2475
2635
  setPrototypeOf() {
2476
- W(12);
2636
+ $(12);
2477
2637
  }
2478
- }, be = {};
2479
- he(Sn, (t, r) => {
2480
- be[t] = function() {
2638
+ }, Se = {};
2639
+ _e(Mn, (t, r) => {
2640
+ Se[t] = function() {
2481
2641
  return arguments[0] = arguments[0][0], r.apply(this, arguments);
2482
2642
  };
2483
2643
  });
2484
- be.deleteProperty = function(t, r) {
2485
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) && W(13), be.set.call(this, t, r, void 0);
2644
+ Se.deleteProperty = function(t, r) {
2645
+ return process.env.NODE_ENV !== "production" && isNaN(parseInt(r)) && $(13), Se.set.call(this, t, r, void 0);
2486
2646
  };
2487
- be.set = function(t, r, n) {
2488
- return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && W(14), Sn.set.call(this, t[0], r, n, t[0]);
2647
+ Se.set = function(t, r, n) {
2648
+ return process.env.NODE_ENV !== "production" && r !== "length" && isNaN(parseInt(r)) && $(14), Mn.set.call(this, t[0], r, n, t[0]);
2489
2649
  };
2490
2650
  function nn(t, r) {
2491
- const n = t[tt];
2492
- return (n ? Ot(n) : t)[r];
2651
+ const n = t[nt];
2652
+ return (n ? Pt(n) : t)[r];
2493
2653
  }
2494
- function oa(t, r, n) {
2654
+ function pa(t, r, n) {
2495
2655
  var s;
2496
- const i = ci(r, n);
2656
+ const i = li(r, n);
2497
2657
  return i ? "value" in i ? i.value : (
2498
2658
  // This is a very special case, if the prop is a getter defined by the
2499
2659
  // prototype, we should invoke it with the draft as context!
2500
2660
  (s = i.get) == null ? void 0 : s.call(t.draft_)
2501
2661
  ) : void 0;
2502
2662
  }
2503
- function ci(t, r) {
2663
+ function li(t, r) {
2504
2664
  if (!(r in t))
2505
2665
  return;
2506
- let n = xt(t);
2666
+ let n = Ct(t);
2507
2667
  for (; n; ) {
2508
2668
  const i = Object.getOwnPropertyDescriptor(n, r);
2509
2669
  if (i)
2510
2670
  return i;
2511
- n = xt(n);
2671
+ n = Ct(n);
2512
2672
  }
2513
2673
  }
2514
- function mn(t) {
2515
- t.modified_ || (t.modified_ = !0, t.parent_ && mn(t.parent_));
2674
+ function vn(t) {
2675
+ t.modified_ || (t.modified_ = !0, t.parent_ && vn(t.parent_));
2516
2676
  }
2517
2677
  function an(t) {
2518
- t.copy_ || (t.copy_ = pn(
2678
+ t.copy_ || (t.copy_ = bn(
2519
2679
  t.base_,
2520
2680
  t.scope_.immer_.useStrictShallowCopy_
2521
2681
  ));
2522
2682
  }
2523
- var ca = class {
2683
+ var ha = class {
2524
2684
  constructor(t) {
2525
2685
  this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.produce = (r, n, i) => {
2526
2686
  if (typeof r == "function" && typeof n != "function") {
2527
2687
  const c = n;
2528
2688
  n = r;
2529
- const f = this;
2530
- return function(x = c, ...F) {
2531
- return f.produce(x, (T) => n.call(this, T, ...F));
2689
+ const h = this;
2690
+ return function(P = c, ...F) {
2691
+ return h.produce(P, (E) => n.call(this, E, ...F));
2532
2692
  };
2533
2693
  }
2534
- typeof n != "function" && W(6), i !== void 0 && typeof i != "function" && W(7);
2694
+ typeof n != "function" && $(6), i !== void 0 && typeof i != "function" && $(7);
2535
2695
  let s;
2536
- if (vt(r)) {
2537
- const c = Nn(this), f = bn(r, void 0);
2538
- let h = !0;
2696
+ if (wt(r)) {
2697
+ const c = Hn(this), h = Sn(r, void 0);
2698
+ let m = !0;
2539
2699
  try {
2540
- s = n(f), h = !1;
2700
+ s = n(h), m = !1;
2541
2701
  } finally {
2542
- h ? hn(c) : yn(c);
2702
+ m ? _n(c) : In(c);
2543
2703
  }
2544
- return zn(c, i), Hn(s, c);
2704
+ return zn(c, i), Nn(s, c);
2545
2705
  } else if (!r || typeof r != "object") {
2546
- if (s = n(r), s === void 0 && (s = r), s === vn && (s = void 0), this.autoFreeze_ && In(s, !0), i) {
2547
- const c = [], f = [];
2548
- Ct("Patches").generateReplacementPatches_(r, s, c, f), i(c, f);
2706
+ if (s = n(r), s === void 0 && (s = r), s === Tn && (s = void 0), this.autoFreeze_ && En(s, !0), i) {
2707
+ const c = [], h = [];
2708
+ jt("Patches").generateReplacementPatches_(r, s, c, h), i(c, h);
2549
2709
  }
2550
2710
  return s;
2551
2711
  } else
2552
- W(1, r);
2712
+ $(1, r);
2553
2713
  }, this.produceWithPatches = (r, n) => {
2554
2714
  if (typeof r == "function")
2555
- return (f, ...h) => this.produceWithPatches(f, (x) => r(x, ...h));
2715
+ return (h, ...m) => this.produceWithPatches(h, (P) => r(P, ...m));
2556
2716
  let i, s;
2557
- return [this.produce(r, n, (f, h) => {
2558
- i = f, s = h;
2717
+ return [this.produce(r, n, (h, m) => {
2718
+ i = h, s = m;
2559
2719
  }), i, s];
2560
2720
  }, typeof (t == null ? void 0 : t.autoFreeze) == "boolean" && this.setAutoFreeze(t.autoFreeze), typeof (t == null ? void 0 : t.useStrictShallowCopy) == "boolean" && this.setUseStrictShallowCopy(t.useStrictShallowCopy);
2561
2721
  }
2562
2722
  createDraft(t) {
2563
- vt(t) || W(8), Dt(t) && (t = ua(t));
2564
- const r = Nn(this), n = bn(t, void 0);
2565
- return n[tt].isManual_ = !0, yn(r), n;
2723
+ wt(t) || $(8), Rt(t) && (t = ma(t));
2724
+ const r = Hn(this), n = Sn(t, void 0);
2725
+ return n[nt].isManual_ = !0, In(r), n;
2566
2726
  }
2567
2727
  finishDraft(t, r) {
2568
- const n = t && t[tt];
2569
- (!n || !n.isManual_) && W(9);
2728
+ const n = t && t[nt];
2729
+ (!n || !n.isManual_) && $(9);
2570
2730
  const { scope_: i } = n;
2571
- return zn(i, r), Hn(void 0, i);
2731
+ return zn(i, r), Nn(void 0, i);
2572
2732
  }
2573
2733
  /**
2574
2734
  * Pass true to automatically freeze all copies created by Immer.
@@ -2596,242 +2756,242 @@ var ca = class {
2596
2756
  }
2597
2757
  }
2598
2758
  n > -1 && (r = r.slice(n + 1));
2599
- const i = Ct("Patches").applyPatches_;
2600
- return Dt(t) ? i(t, r) : this.produce(
2759
+ const i = jt("Patches").applyPatches_;
2760
+ return Rt(t) ? i(t, r) : this.produce(
2601
2761
  t,
2602
2762
  (s) => i(s, r)
2603
2763
  );
2604
2764
  }
2605
2765
  };
2606
- function bn(t, r) {
2607
- const n = ve(t) ? Ct("MapSet").proxyMap_(t, r) : Ie(t) ? Ct("MapSet").proxySet_(t, r) : sa(t, r);
2608
- return (r ? r.scope_ : oi()).drafts_.push(n), n;
2766
+ function Sn(t, r) {
2767
+ const n = Te(t) ? jt("MapSet").proxyMap_(t, r) : Ee(t) ? jt("MapSet").proxySet_(t, r) : da(t, r);
2768
+ return (r ? r.scope_ : ui()).drafts_.push(n), n;
2609
2769
  }
2610
- function ua(t) {
2611
- return Dt(t) || W(10, t), ui(t);
2770
+ function ma(t) {
2771
+ return Rt(t) || $(10, t), fi(t);
2612
2772
  }
2613
- function ui(t) {
2614
- if (!vt(t) || ir(t))
2773
+ function fi(t) {
2774
+ if (!wt(t) || cr(t))
2615
2775
  return t;
2616
- const r = t[tt];
2776
+ const r = t[nt];
2617
2777
  let n;
2618
2778
  if (r) {
2619
2779
  if (!r.modified_)
2620
2780
  return r.base_;
2621
- r.finalized_ = !0, n = pn(t, r.scope_.immer_.useStrictShallowCopy_);
2781
+ r.finalized_ = !0, n = bn(t, r.scope_.immer_.useStrictShallowCopy_);
2622
2782
  } else
2623
- n = pn(t, !0);
2624
- return he(n, (i, s) => {
2625
- si(n, i, ui(s));
2783
+ n = bn(t, !0);
2784
+ return _e(n, (i, s) => {
2785
+ ci(n, i, fi(s));
2626
2786
  }), r && (r.finalized_ = !1), n;
2627
2787
  }
2628
- function Ln() {
2629
- process.env.NODE_ENV !== "production" && ii.push(
2788
+ function Un() {
2789
+ process.env.NODE_ENV !== "production" && si.push(
2630
2790
  'Sets cannot have "replace" patches.',
2631
- function(g) {
2632
- return "Unsupported patch operation: " + g;
2791
+ function(b) {
2792
+ return "Unsupported patch operation: " + b;
2633
2793
  },
2634
- function(g) {
2635
- return "Cannot apply patch, path doesn't resolve: " + g;
2794
+ function(b) {
2795
+ return "Cannot apply patch, path doesn't resolve: " + b;
2636
2796
  },
2637
2797
  "Patching reserved attributes like __proto__, prototype and constructor is not allowed"
2638
2798
  );
2639
2799
  const r = "replace", n = "add", i = "remove";
2640
- function s(g, p, y, l) {
2641
- switch (g.type_) {
2800
+ function s(b, d, f, p) {
2801
+ switch (b.type_) {
2642
2802
  case 0:
2643
2803
  case 2:
2644
- return f(
2645
- g,
2646
- p,
2647
- y,
2648
- l
2804
+ return h(
2805
+ b,
2806
+ d,
2807
+ f,
2808
+ p
2649
2809
  );
2650
2810
  case 1:
2651
- return c(g, p, y, l);
2811
+ return c(b, d, f, p);
2652
2812
  case 3:
2653
- return h(
2654
- g,
2655
- p,
2656
- y,
2657
- l
2813
+ return m(
2814
+ b,
2815
+ d,
2816
+ f,
2817
+ p
2658
2818
  );
2659
2819
  }
2660
2820
  }
2661
- function c(g, p, y, l) {
2662
- let { base_: m, assigned_: S } = g, v = g.copy_;
2663
- v.length < m.length && ([m, v] = [v, m], [y, l] = [l, y]);
2664
- for (let b = 0; b < m.length; b++)
2665
- if (S[b] && v[b] !== m[b]) {
2666
- const d = p.concat([b]);
2667
- y.push({
2821
+ function c(b, d, f, p) {
2822
+ let { base_: g, assigned_: S } = b, _ = b.copy_;
2823
+ _.length < g.length && ([g, _] = [_, g], [f, p] = [p, f]);
2824
+ for (let y = 0; y < g.length; y++)
2825
+ if (S[y] && _[y] !== g[y]) {
2826
+ const l = d.concat([y]);
2827
+ f.push({
2668
2828
  op: r,
2669
- path: d,
2829
+ path: l,
2670
2830
  // Need to maybe clone it, as it can in fact be the original value
2671
2831
  // due to the base/copy inversion at the start of this function
2672
- value: H(v[b])
2673
- }), l.push({
2832
+ value: N(_[y])
2833
+ }), p.push({
2674
2834
  op: r,
2675
- path: d,
2676
- value: H(m[b])
2835
+ path: l,
2836
+ value: N(g[y])
2677
2837
  });
2678
2838
  }
2679
- for (let b = m.length; b < v.length; b++) {
2680
- const d = p.concat([b]);
2681
- y.push({
2839
+ for (let y = g.length; y < _.length; y++) {
2840
+ const l = d.concat([y]);
2841
+ f.push({
2682
2842
  op: n,
2683
- path: d,
2843
+ path: l,
2684
2844
  // Need to maybe clone it, as it can in fact be the original value
2685
2845
  // due to the base/copy inversion at the start of this function
2686
- value: H(v[b])
2846
+ value: N(_[y])
2687
2847
  });
2688
2848
  }
2689
- for (let b = v.length - 1; m.length <= b; --b) {
2690
- const d = p.concat([b]);
2691
- l.push({
2849
+ for (let y = _.length - 1; g.length <= y; --y) {
2850
+ const l = d.concat([y]);
2851
+ p.push({
2692
2852
  op: i,
2693
- path: d
2853
+ path: l
2694
2854
  });
2695
2855
  }
2696
2856
  }
2697
- function f(g, p, y, l) {
2698
- const { base_: m, copy_: S } = g;
2699
- he(g.assigned_, (v, b) => {
2700
- const d = rn(m, v), O = rn(S, v), E = b ? ye(m, v) ? r : n : i;
2701
- if (d === O && E === r)
2857
+ function h(b, d, f, p) {
2858
+ const { base_: g, copy_: S } = b;
2859
+ _e(b.assigned_, (_, y) => {
2860
+ const l = rn(g, _), x = rn(S, _), M = y ? Ie(g, _) ? r : n : i;
2861
+ if (l === x && M === r)
2702
2862
  return;
2703
- const _ = p.concat(v);
2704
- y.push(E === i ? { op: E, path: _ } : { op: E, path: _, value: O }), l.push(
2705
- E === n ? { op: i, path: _ } : E === i ? { op: n, path: _, value: H(d) } : { op: r, path: _, value: H(d) }
2863
+ const I = d.concat(_);
2864
+ f.push(M === i ? { op: M, path: I } : { op: M, path: I, value: x }), p.push(
2865
+ M === n ? { op: i, path: I } : M === i ? { op: n, path: I, value: N(l) } : { op: r, path: I, value: N(l) }
2706
2866
  );
2707
2867
  });
2708
2868
  }
2709
- function h(g, p, y, l) {
2710
- let { base_: m, copy_: S } = g, v = 0;
2711
- m.forEach((b) => {
2712
- if (!S.has(b)) {
2713
- const d = p.concat([v]);
2714
- y.push({
2869
+ function m(b, d, f, p) {
2870
+ let { base_: g, copy_: S } = b, _ = 0;
2871
+ g.forEach((y) => {
2872
+ if (!S.has(y)) {
2873
+ const l = d.concat([_]);
2874
+ f.push({
2715
2875
  op: i,
2716
- path: d,
2717
- value: b
2718
- }), l.unshift({
2876
+ path: l,
2877
+ value: y
2878
+ }), p.unshift({
2719
2879
  op: n,
2720
- path: d,
2721
- value: b
2880
+ path: l,
2881
+ value: y
2722
2882
  });
2723
2883
  }
2724
- v++;
2725
- }), v = 0, S.forEach((b) => {
2726
- if (!m.has(b)) {
2727
- const d = p.concat([v]);
2728
- y.push({
2884
+ _++;
2885
+ }), _ = 0, S.forEach((y) => {
2886
+ if (!g.has(y)) {
2887
+ const l = d.concat([_]);
2888
+ f.push({
2729
2889
  op: n,
2730
- path: d,
2731
- value: b
2732
- }), l.unshift({
2890
+ path: l,
2891
+ value: y
2892
+ }), p.unshift({
2733
2893
  op: i,
2734
- path: d,
2735
- value: b
2894
+ path: l,
2895
+ value: y
2736
2896
  });
2737
2897
  }
2738
- v++;
2898
+ _++;
2739
2899
  });
2740
2900
  }
2741
- function x(g, p, y, l) {
2742
- y.push({
2901
+ function P(b, d, f, p) {
2902
+ f.push({
2743
2903
  op: r,
2744
2904
  path: [],
2745
- value: p === vn ? void 0 : p
2746
- }), l.push({
2905
+ value: d === Tn ? void 0 : d
2906
+ }), p.push({
2747
2907
  op: r,
2748
2908
  path: [],
2749
- value: g
2909
+ value: b
2750
2910
  });
2751
2911
  }
2752
- function F(g, p) {
2753
- return p.forEach((y) => {
2754
- const { path: l, op: m } = y;
2755
- let S = g;
2756
- for (let O = 0; O < l.length - 1; O++) {
2757
- const E = Pt(S);
2758
- let _ = l[O];
2759
- typeof _ != "string" && typeof _ != "number" && (_ = "" + _), (E === 0 || E === 1) && (_ === "__proto__" || _ === "constructor") && W(19), typeof S == "function" && _ === "prototype" && W(19), S = rn(S, _), typeof S != "object" && W(18, l.join("/"));
2912
+ function F(b, d) {
2913
+ return d.forEach((f) => {
2914
+ const { path: p, op: g } = f;
2915
+ let S = b;
2916
+ for (let x = 0; x < p.length - 1; x++) {
2917
+ const M = Ft(S);
2918
+ let I = p[x];
2919
+ typeof I != "string" && typeof I != "number" && (I = "" + I), (M === 0 || M === 1) && (I === "__proto__" || I === "constructor") && $(19), typeof S == "function" && I === "prototype" && $(19), S = rn(S, I), typeof S != "object" && $(18, p.join("/"));
2760
2920
  }
2761
- const v = Pt(S), b = T(y.value), d = l[l.length - 1];
2762
- switch (m) {
2921
+ const _ = Ft(S), y = E(f.value), l = p[p.length - 1];
2922
+ switch (g) {
2763
2923
  case r:
2764
- switch (v) {
2924
+ switch (_) {
2765
2925
  case 2:
2766
- return S.set(d, b);
2926
+ return S.set(l, y);
2767
2927
  case 3:
2768
- W(16);
2928
+ $(16);
2769
2929
  default:
2770
- return S[d] = b;
2930
+ return S[l] = y;
2771
2931
  }
2772
2932
  case n:
2773
- switch (v) {
2933
+ switch (_) {
2774
2934
  case 1:
2775
- return d === "-" ? S.push(b) : S.splice(d, 0, b);
2935
+ return l === "-" ? S.push(y) : S.splice(l, 0, y);
2776
2936
  case 2:
2777
- return S.set(d, b);
2937
+ return S.set(l, y);
2778
2938
  case 3:
2779
- return S.add(b);
2939
+ return S.add(y);
2780
2940
  default:
2781
- return S[d] = b;
2941
+ return S[l] = y;
2782
2942
  }
2783
2943
  case i:
2784
- switch (v) {
2944
+ switch (_) {
2785
2945
  case 1:
2786
- return S.splice(d, 1);
2946
+ return S.splice(l, 1);
2787
2947
  case 2:
2788
- return S.delete(d);
2948
+ return S.delete(l);
2789
2949
  case 3:
2790
- return S.delete(y.value);
2950
+ return S.delete(f.value);
2791
2951
  default:
2792
- return delete S[d];
2952
+ return delete S[l];
2793
2953
  }
2794
2954
  default:
2795
- W(17, m);
2955
+ $(17, g);
2796
2956
  }
2797
- }), g;
2798
- }
2799
- function T(g) {
2800
- if (!vt(g))
2801
- return g;
2802
- if (Array.isArray(g))
2803
- return g.map(T);
2804
- if (ve(g))
2957
+ }), b;
2958
+ }
2959
+ function E(b) {
2960
+ if (!wt(b))
2961
+ return b;
2962
+ if (Array.isArray(b))
2963
+ return b.map(E);
2964
+ if (Te(b))
2805
2965
  return new Map(
2806
- Array.from(g.entries()).map(([y, l]) => [y, T(l)])
2966
+ Array.from(b.entries()).map(([f, p]) => [f, E(p)])
2807
2967
  );
2808
- if (Ie(g))
2809
- return new Set(Array.from(g).map(T));
2810
- const p = Object.create(xt(g));
2811
- for (const y in g)
2812
- p[y] = T(g[y]);
2813
- return ye(g, de) && (p[de] = g[de]), p;
2968
+ if (Ee(b))
2969
+ return new Set(Array.from(b).map(E));
2970
+ const d = Object.create(Ct(b));
2971
+ for (const f in b)
2972
+ d[f] = E(b[f]);
2973
+ return Ie(b, ge) && (d[ge] = b[ge]), d;
2814
2974
  }
2815
- function H(g) {
2816
- return Dt(g) ? T(g) : g;
2975
+ function N(b) {
2976
+ return Rt(b) ? E(b) : b;
2817
2977
  }
2818
- na("Patches", {
2978
+ ua("Patches", {
2819
2979
  applyPatches_: F,
2820
2980
  generatePatches_: s,
2821
- generateReplacementPatches_: x
2981
+ generateReplacementPatches_: P
2822
2982
  });
2823
2983
  }
2824
- var et = new ca(), la = et.produce;
2825
- et.produceWithPatches.bind(
2826
- et
2984
+ var it = new ha(), ya = it.produce;
2985
+ it.produceWithPatches.bind(
2986
+ it
2827
2987
  );
2828
- et.setAutoFreeze.bind(et);
2829
- et.setUseStrictShallowCopy.bind(et);
2830
- var fa = et.applyPatches.bind(et);
2831
- et.createDraft.bind(et);
2832
- et.finishDraft.bind(et);
2833
- var pa = 1 / 0, da = 9007199254740991, ha = "[object Arguments]", ya = "[object Function]", ma = "[object GeneratorFunction]", ba = "[object Symbol]", ga = typeof it == "object" && it && it.Object === Object && it, _a = typeof self == "object" && self && self.Object === Object && self, va = ga || _a || Function("return this")();
2834
- function Ia(t, r, n) {
2988
+ it.setAutoFreeze.bind(it);
2989
+ it.setUseStrictShallowCopy.bind(it);
2990
+ var ba = it.applyPatches.bind(it);
2991
+ it.createDraft.bind(it);
2992
+ it.finishDraft.bind(it);
2993
+ var ga = 1 / 0, _a = 9007199254740991, Ia = "[object Arguments]", va = "[object Function]", Sa = "[object GeneratorFunction]", wa = "[object Symbol]", ka = typeof st == "object" && st && st.Object === Object && st, Ta = typeof self == "object" && self && self.Object === Object && self, Ea = ka || Ta || Function("return this")();
2994
+ function Ma(t, r, n) {
2835
2995
  switch (n.length) {
2836
2996
  case 0:
2837
2997
  return t.call(r);
@@ -2844,91 +3004,91 @@ function Ia(t, r, n) {
2844
3004
  }
2845
3005
  return t.apply(r, n);
2846
3006
  }
2847
- function Sa(t, r) {
3007
+ function Aa(t, r) {
2848
3008
  for (var n = -1, i = t ? t.length : 0, s = Array(i); ++n < i; )
2849
3009
  s[n] = r(t[n], n, t);
2850
3010
  return s;
2851
3011
  }
2852
- function wa(t, r) {
3012
+ function Oa(t, r) {
2853
3013
  for (var n = -1, i = r.length, s = t.length; ++n < i; )
2854
3014
  t[s + n] = r[n];
2855
3015
  return t;
2856
3016
  }
2857
- var wn = Object.prototype, ka = wn.hasOwnProperty, kn = wn.toString, Gn = va.Symbol, Ta = wn.propertyIsEnumerable, Wn = Gn ? Gn.isConcatSpreadable : void 0, Bn = Math.max;
2858
- function Ea(t, r, n, i, s) {
2859
- var c = -1, f = t.length;
2860
- for (n || (n = xa), s || (s = []); ++c < f; ) {
2861
- var h = t[c];
2862
- n(h) ? wa(s, h) : s[s.length] = h;
3017
+ var An = Object.prototype, xa = An.hasOwnProperty, On = An.toString, Wn = Ea.Symbol, Da = An.propertyIsEnumerable, Gn = Wn ? Wn.isConcatSpreadable : void 0, Bn = Math.max;
3018
+ function Pa(t, r, n, i, s) {
3019
+ var c = -1, h = t.length;
3020
+ for (n || (n = ja), s || (s = []); ++c < h; ) {
3021
+ var m = t[c];
3022
+ n(m) ? Oa(s, m) : s[s.length] = m;
2863
3023
  }
2864
3024
  return s;
2865
3025
  }
2866
- function Aa(t, r) {
2867
- return t = Object(t), Ma(t, r, function(n, i) {
3026
+ function Ca(t, r) {
3027
+ return t = Object(t), Ra(t, r, function(n, i) {
2868
3028
  return i in t;
2869
3029
  });
2870
3030
  }
2871
- function Ma(t, r, n) {
3031
+ function Ra(t, r, n) {
2872
3032
  for (var i = -1, s = r.length, c = {}; ++i < s; ) {
2873
- var f = r[i], h = t[f];
2874
- n(h, f) && (c[f] = h);
3033
+ var h = r[i], m = t[h];
3034
+ n(m, h) && (c[h] = m);
2875
3035
  }
2876
3036
  return c;
2877
3037
  }
2878
- function Oa(t, r) {
3038
+ function Fa(t, r) {
2879
3039
  return r = Bn(r === void 0 ? t.length - 1 : r, 0), function() {
2880
3040
  for (var n = arguments, i = -1, s = Bn(n.length - r, 0), c = Array(s); ++i < s; )
2881
3041
  c[i] = n[r + i];
2882
3042
  i = -1;
2883
- for (var f = Array(r + 1); ++i < r; )
2884
- f[i] = n[i];
2885
- return f[r] = c, Ia(t, this, f);
3043
+ for (var h = Array(r + 1); ++i < r; )
3044
+ h[i] = n[i];
3045
+ return h[r] = c, Ma(t, this, h);
2886
3046
  };
2887
3047
  }
2888
- function xa(t) {
2889
- return Ca(t) || Pa(t) || !!(Wn && t && t[Wn]);
3048
+ function ja(t) {
3049
+ return Na(t) || Ha(t) || !!(Gn && t && t[Gn]);
2890
3050
  }
2891
- function Da(t) {
2892
- if (typeof t == "string" || Ha(t))
3051
+ function za(t) {
3052
+ if (typeof t == "string" || $a(t))
2893
3053
  return t;
2894
3054
  var r = t + "";
2895
- return r == "0" && 1 / t == -pa ? "-0" : r;
3055
+ return r == "0" && 1 / t == -ga ? "-0" : r;
2896
3056
  }
2897
- function Pa(t) {
2898
- return Ra(t) && ka.call(t, "callee") && (!Ta.call(t, "callee") || kn.call(t) == ha);
3057
+ function Ha(t) {
3058
+ return Ua(t) && xa.call(t, "callee") && (!Da.call(t, "callee") || On.call(t) == Ia);
2899
3059
  }
2900
- var Ca = Array.isArray;
2901
- function ja(t) {
2902
- return t != null && za(t.length) && !Fa(t);
3060
+ var Na = Array.isArray;
3061
+ function La(t) {
3062
+ return t != null && Ga(t.length) && !Wa(t);
2903
3063
  }
2904
- function Ra(t) {
2905
- return li(t) && ja(t);
3064
+ function Ua(t) {
3065
+ return di(t) && La(t);
2906
3066
  }
2907
- function Fa(t) {
2908
- var r = Na(t) ? kn.call(t) : "";
2909
- return r == ya || r == ma;
3067
+ function Wa(t) {
3068
+ var r = Ba(t) ? On.call(t) : "";
3069
+ return r == va || r == Sa;
2910
3070
  }
2911
- function za(t) {
2912
- return typeof t == "number" && t > -1 && t % 1 == 0 && t <= da;
3071
+ function Ga(t) {
3072
+ return typeof t == "number" && t > -1 && t % 1 == 0 && t <= _a;
2913
3073
  }
2914
- function Na(t) {
3074
+ function Ba(t) {
2915
3075
  var r = typeof t;
2916
3076
  return !!t && (r == "object" || r == "function");
2917
3077
  }
2918
- function li(t) {
3078
+ function di(t) {
2919
3079
  return !!t && typeof t == "object";
2920
3080
  }
2921
- function Ha(t) {
2922
- return typeof t == "symbol" || li(t) && kn.call(t) == ba;
3081
+ function $a(t) {
3082
+ return typeof t == "symbol" || di(t) && On.call(t) == wa;
2923
3083
  }
2924
- var Ua = Oa(function(t, r) {
2925
- return t == null ? {} : Aa(t, Sa(Ea(r), Da));
2926
- }), La = Ua;
2927
- const $n = /* @__PURE__ */ gn(La), Ga = {
3084
+ var Ka = Fa(function(t, r) {
3085
+ return t == null ? {} : Ca(t, Aa(Pa(r), za));
3086
+ }), Ya = Ka;
3087
+ const $n = /* @__PURE__ */ wn(Ya), Va = {
2928
3088
  width: 1080,
2929
3089
  height: 1920
2930
- }, Wa = {
2931
- size: Ga,
3090
+ }, Xa = {
3091
+ size: Va,
2932
3092
  tracks: [],
2933
3093
  trackItemIds: [],
2934
3094
  trackItemsMap: {},
@@ -2951,22 +3111,22 @@ const $n = /* @__PURE__ */ gn(La), Ga = {
2951
3111
  "transitionsMap",
2952
3112
  "trackItemIds"
2953
3113
  ];
2954
- class Ka {
3114
+ class Za {
2955
3115
  constructor(r) {
2956
- Mt(this, "stateSubject");
2957
- Mt(this, "stateHistorySubject");
2958
- Mt(this, "prevState");
2959
- Mt(this, "undos", []);
2960
- Mt(this, "redos", []);
2961
- Mt(this, "listener");
2962
- const n = r || Wa;
2963
- this.stateSubject = new Dn(n), this.stateHistorySubject = new Dn({
3116
+ Dt(this, "stateSubject");
3117
+ Dt(this, "stateHistorySubject");
3118
+ Dt(this, "prevState");
3119
+ Dt(this, "undos", []);
3120
+ Dt(this, "redos", []);
3121
+ Dt(this, "listener");
3122
+ const n = r || Xa;
3123
+ this.stateSubject = new jn(n), this.stateHistorySubject = new jn({
2964
3124
  handleRedo: !1,
2965
3125
  handleUndo: !1
2966
3126
  }), this.prevState = n, this.initListeners();
2967
3127
  }
2968
3128
  initListeners() {
2969
- Zi(this);
3129
+ ia(this);
2970
3130
  }
2971
3131
  destroyListeners() {
2972
3132
  this.listener && this.listener.unsubscribe();
@@ -2975,7 +3135,7 @@ class Ka {
2975
3135
  this.destroyListeners();
2976
3136
  }
2977
3137
  updateHistory(r, n) {
2978
- const i = $n(r, Kn), s = $n(this.getState(), Kn), c = ni(s, i);
3138
+ const i = $n(r, Kn), s = $n(this.getState(), Kn), c = ai(s, i);
2979
3139
  c.length && (this.undos.push({ undos: c, type: n }), this.redos = []);
2980
3140
  }
2981
3141
  getStateHistory() {
@@ -2998,28 +3158,28 @@ class Ka {
2998
3158
  ...i,
2999
3159
  ...r
3000
3160
  };
3001
- nt(i, s) || (n.updateHistory && this.updateHistory(s, n.kind), this.prevState = i, this.stateSubject.next(s));
3161
+ rt(i, s) || (n.updateHistory && this.updateHistory(s, n.kind), this.prevState = i, this.stateSubject.next(s));
3002
3162
  }
3003
3163
  // emit changes for design size
3004
3164
  subscribeToSize(r) {
3005
3165
  return this.stateSubject.asObservable().subscribe((n) => {
3006
- nt(n.size, this.prevState.size) || r({ size: n.size });
3166
+ rt(n.size, this.prevState.size) || r({ size: n.size });
3007
3167
  });
3008
3168
  }
3009
3169
  // Selectively subscribe to scale changes
3010
3170
  subscribeToScale(r) {
3011
3171
  return this.stateSubject.asObservable().subscribe((n) => {
3012
- nt(n.scale, this.prevState.scale) || r({ scale: n.scale });
3172
+ rt(n.scale, this.prevState.scale) || r({ scale: n.scale });
3013
3173
  });
3014
3174
  }
3015
3175
  subscribeToUpdateTrackItem(r) {
3016
3176
  return this.stateSubject.asObservable().subscribe((n) => {
3017
- nt(n.trackItemsMap, this.prevState.trackItemsMap) || r({ trackItemsMap: n.trackItemsMap });
3177
+ rt(n.trackItemsMap, this.prevState.trackItemsMap) || r({ trackItemsMap: n.trackItemsMap });
3018
3178
  });
3019
3179
  }
3020
3180
  subscribeToUpdateItemDetails(r) {
3021
3181
  return this.stateSubject.asObservable().subscribe((n) => {
3022
- nt(n.trackItemDetailsMap, this.prevState.trackItemDetailsMap) || r({ trackItemDetailsMap: n.trackItemDetailsMap });
3182
+ rt(n.trackItemDetailsMap, this.prevState.trackItemDetailsMap) || r({ trackItemDetailsMap: n.trackItemDetailsMap });
3023
3183
  });
3024
3184
  }
3025
3185
  // Selectively subscribe to duration changes
@@ -3042,19 +3202,19 @@ class Ka {
3042
3202
  }
3043
3203
  subscribeToAddOrRemoveItems(r) {
3044
3204
  return this.stateSubject.asObservable().subscribe((n) => {
3045
- nt(n.trackItemIds, this.prevState.trackItemIds) || r({ trackItemIds: n.trackItemIds });
3205
+ rt(n.trackItemIds, this.prevState.trackItemIds) || r({ trackItemIds: n.trackItemIds });
3046
3206
  });
3047
3207
  }
3048
3208
  // Selectively subscribe to activeIds changes
3049
3209
  subscribeToActiveIds(r) {
3050
3210
  return this.stateSubject.asObservable().subscribe((n) => {
3051
- nt(n.activeIds, this.prevState.activeIds) || r({ activeIds: n.activeIds });
3211
+ rt(n.activeIds, this.prevState.activeIds) || r({ activeIds: n.activeIds });
3052
3212
  });
3053
3213
  }
3054
3214
  // Selectively subscribe to multiple track-related properties
3055
3215
  subscribeToTracks(r) {
3056
3216
  return this.stateSubject.asObservable().subscribe((n) => {
3057
- (!nt(n.tracks, this.prevState.tracks) || !nt(n.trackItemIds, this.prevState.trackItemIds) || !nt(n.trackItemsMap, this.prevState.trackItemsMap) || !nt(n.transitionIds, this.prevState.transitionIds) || !nt(n.transitionsMap, this.prevState.transitionsMap)) && r({
3217
+ (!rt(n.tracks, this.prevState.tracks) || !rt(n.trackItemIds, this.prevState.trackItemIds) || !rt(n.trackItemsMap, this.prevState.trackItemsMap) || !rt(n.transitionIds, this.prevState.transitionIds) || !rt(n.transitionsMap, this.prevState.transitionsMap) || !rt(n.trackItemDetailsMap, this.prevState.trackItemDetailsMap)) && r({
3058
3218
  tracks: n.tracks,
3059
3219
  trackItemIds: n.trackItemIds,
3060
3220
  trackItemsMap: n.trackItemsMap,
@@ -3067,141 +3227,141 @@ class Ka {
3067
3227
  undo() {
3068
3228
  const r = this.undos.pop(), n = r == null ? void 0 : r.undos, i = r == null ? void 0 : r.type;
3069
3229
  if (!n || !i) return;
3070
- Ln();
3230
+ Un();
3071
3231
  const {
3072
3232
  trackItemDetailsMap: s,
3073
3233
  trackItemIds: c,
3074
- tracks: f,
3075
- transitionIds: h,
3076
- transitionsMap: x,
3234
+ tracks: h,
3235
+ transitionIds: m,
3236
+ transitionsMap: P,
3077
3237
  trackItemsMap: F
3078
- } = this.getState(), T = X({
3238
+ } = this.getState(), E = B({
3079
3239
  trackItemDetailsMap: s,
3080
3240
  trackItemIds: c,
3081
- tracks: f,
3082
- transitionIds: h,
3083
- transitionsMap: x,
3241
+ tracks: h,
3242
+ transitionIds: m,
3243
+ transitionsMap: P,
3084
3244
  trackItemsMap: F
3085
- }), H = [], g = [], p = [], y = [], l = [], m = [];
3245
+ }), N = [], b = [], d = [], f = [], p = [], g = [];
3086
3246
  n.forEach((k) => {
3087
- let A;
3088
- const U = k.path.slice(1);
3089
- k.type === "CREATE" ? A = {
3090
- path: U,
3247
+ let v;
3248
+ const A = k.path.slice(1);
3249
+ k.type === "CREATE" ? v = {
3250
+ path: A,
3091
3251
  op: "remove",
3092
3252
  value: k.value
3093
- } : k.type === "CHANGE" ? A = {
3094
- path: U,
3253
+ } : k.type === "CHANGE" ? v = {
3254
+ path: A,
3095
3255
  op: "replace",
3096
3256
  value: k.oldValue
3097
- } : A = {
3098
- path: U,
3257
+ } : v = {
3258
+ path: A,
3099
3259
  op: "add",
3100
3260
  value: k.oldValue
3101
- }, k.path.includes("trackItemIds") ? p.push(A) : k.path.includes("transitionIds") ? g.push(A) : k.path.includes("trackItemsMap") ? l.push(A) : k.path.includes("transitionsMap") ? y.push(A) : k.path.includes("tracks") ? H.push(A) : k.path.includes("trackItemDetailsMap") && m.push(A);
3261
+ }, k.path.includes("trackItemIds") ? d.push(v) : k.path.includes("transitionIds") ? b.push(v) : k.path.includes("trackItemsMap") ? p.push(v) : k.path.includes("transitionsMap") ? f.push(v) : k.path.includes("tracks") ? N.push(v) : k.path.includes("trackItemDetailsMap") && g.push(v);
3102
3262
  });
3103
3263
  const S = this.applyPatch(
3104
- T.tracks,
3105
- H
3106
- ), v = this.applyPatch(
3107
- T.transitionIds,
3108
- g
3109
- ), b = this.applyPatch(
3110
- T.trackItemIds,
3264
+ E.tracks,
3265
+ N
3266
+ ), _ = this.applyPatch(
3267
+ E.transitionIds,
3268
+ b
3269
+ ), y = this.applyPatch(
3270
+ E.trackItemIds,
3271
+ d
3272
+ ), l = this.applyPatch(
3273
+ E.transitionsMap,
3274
+ f
3275
+ ), x = this.applyPatch(
3276
+ E.trackItemsMap,
3111
3277
  p
3112
- ), d = this.applyPatch(
3113
- T.transitionsMap,
3114
- y
3115
- ), O = this.applyPatch(
3116
- T.trackItemsMap,
3117
- l
3118
- ), E = this.applyPatch(
3119
- T.trackItemDetailsMap,
3120
- m
3121
- ), _ = X({
3278
+ ), M = this.applyPatch(
3279
+ E.trackItemDetailsMap,
3280
+ g
3281
+ ), I = B({
3122
3282
  tracks: S,
3123
- transitionIds: v,
3124
- trackItemIds: b,
3125
- transitionsMap: d,
3126
- trackItemsMap: O,
3127
- trackItemDetailsMap: E
3128
- }), D = X(this.getState()), I = { ...D, ..._ };
3129
- this.prevState = D, this.redos.push({ redos: n, type: i });
3130
- const P = Yt(I.trackItemsMap);
3131
- this.stateSubject.next({ ...I, duration: P }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
3283
+ transitionIds: _,
3284
+ trackItemIds: y,
3285
+ transitionsMap: l,
3286
+ trackItemsMap: x,
3287
+ trackItemDetailsMap: M
3288
+ }), C = B(this.getState()), w = { ...C, ...I };
3289
+ this.prevState = C, this.redos.push({ redos: n, type: i });
3290
+ const D = qt(w.trackItemsMap);
3291
+ this.stateSubject.next({ ...w, duration: D }), this.stateHistorySubject.next({ handleRedo: !1, handleUndo: !0 });
3132
3292
  }
3133
3293
  applyPatch(r, n) {
3134
- return n.reverse().reduce((i, s) => la(i, (c) => {
3135
- fa(c, [s]);
3294
+ return n.reverse().reduce((i, s) => ya(i, (c) => {
3295
+ ba(c, [s]);
3136
3296
  }), r);
3137
3297
  }
3138
3298
  redo() {
3139
3299
  const r = this.redos.pop(), n = r == null ? void 0 : r.redos, i = r == null ? void 0 : r.type;
3140
3300
  if (!n || !i) return;
3141
- Ln();
3301
+ Un();
3142
3302
  const {
3143
3303
  trackItemDetailsMap: s,
3144
3304
  trackItemIds: c,
3145
- tracks: f,
3146
- transitionIds: h,
3147
- transitionsMap: x,
3305
+ tracks: h,
3306
+ transitionIds: m,
3307
+ transitionsMap: P,
3148
3308
  trackItemsMap: F
3149
- } = this.getState(), T = X({
3309
+ } = this.getState(), E = B({
3150
3310
  trackItemDetailsMap: s,
3151
3311
  trackItemIds: c,
3152
- tracks: f,
3153
- transitionIds: h,
3154
- transitionsMap: x,
3312
+ tracks: h,
3313
+ transitionIds: m,
3314
+ transitionsMap: P,
3155
3315
  trackItemsMap: F
3156
- }), H = [], g = [], p = [], y = [], l = [], m = [];
3316
+ }), N = [], b = [], d = [], f = [], p = [], g = [];
3157
3317
  n.forEach((k) => {
3158
- let A;
3159
- const U = k.path.slice(1);
3160
- k.type === "CREATE" ? A = {
3161
- path: U,
3318
+ let v;
3319
+ const A = k.path.slice(1);
3320
+ k.type === "CREATE" ? v = {
3321
+ path: A,
3162
3322
  op: "add",
3163
3323
  value: k.value
3164
- } : k.type === "CHANGE" ? A = {
3165
- path: U,
3324
+ } : k.type === "CHANGE" ? v = {
3325
+ path: A,
3166
3326
  op: "replace",
3167
3327
  value: k.value
3168
- } : A = {
3169
- path: U,
3328
+ } : v = {
3329
+ path: A,
3170
3330
  op: "remove",
3171
3331
  value: k.oldValue
3172
- }, k.path.includes("trackItemIds") ? p.push(A) : k.path.includes("transitionIds") ? g.push(A) : k.path.includes("trackItemsMap") ? l.push(A) : k.path.includes("transitionsMap") ? y.push(A) : k.path.includes("trackItemDetailsMap") ? m.push(A) : H.push(A);
3332
+ }, k.path.includes("trackItemIds") ? d.push(v) : k.path.includes("transitionIds") ? b.push(v) : k.path.includes("trackItemsMap") ? p.push(v) : k.path.includes("transitionsMap") ? f.push(v) : k.path.includes("trackItemDetailsMap") ? g.push(v) : N.push(v);
3173
3333
  });
3174
3334
  const S = this.applyPatch(
3175
- T.tracks,
3176
- H
3177
- ), v = this.applyPatch(
3178
- T.transitionIds,
3179
- g
3180
- ), b = this.applyPatch(
3181
- T.trackItemIds,
3335
+ E.tracks,
3336
+ N
3337
+ ), _ = this.applyPatch(
3338
+ E.transitionIds,
3339
+ b
3340
+ ), y = this.applyPatch(
3341
+ E.trackItemIds,
3342
+ d
3343
+ ), l = this.applyPatch(
3344
+ E.transitionsMap,
3345
+ f
3346
+ ), x = this.applyPatch(
3347
+ E.trackItemsMap,
3182
3348
  p
3183
- ), d = this.applyPatch(
3184
- T.transitionsMap,
3185
- y
3186
- ), O = this.applyPatch(
3187
- T.trackItemsMap,
3188
- l
3189
- ), E = this.applyPatch(
3190
- T.trackItemDetailsMap,
3191
- m
3192
- ), _ = X({
3349
+ ), M = this.applyPatch(
3350
+ E.trackItemDetailsMap,
3351
+ g
3352
+ ), I = B({
3193
3353
  tracks: S,
3194
- transitionIds: v,
3195
- trackItemIds: b,
3196
- transitionsMap: d,
3197
- trackItemsMap: O,
3198
- trackItemDetailsMap: E
3199
- }), D = X(this.getState()), I = { ...D, ..._ };
3200
- this.prevState = D, this.undos.push({ undos: n, type: i });
3201
- const P = Yt(I.trackItemsMap);
3202
- this.stateSubject.next({ ...I, duration: P }), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3354
+ transitionIds: _,
3355
+ trackItemIds: y,
3356
+ transitionsMap: l,
3357
+ trackItemsMap: x,
3358
+ trackItemDetailsMap: M
3359
+ }), C = B(this.getState()), w = { ...C, ...I };
3360
+ this.prevState = C, this.undos.push({ undos: n, type: i });
3361
+ const D = qt(w.trackItemsMap);
3362
+ this.stateSubject.next({ ...w, duration: D }), this.stateHistorySubject.next({ handleRedo: !0, handleUndo: !1 });
3203
3363
  }
3204
3364
  }
3205
3365
  export {
3206
- Ka as default
3366
+ Za as default
3207
3367
  };