@linker-design-plus/timeline-track 2.0.5 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -52,7 +52,7 @@ const Pe = {
52
52
  mode: "auto-first-added-video",
53
53
  width: 16,
54
54
  height: 9
55
- }, oh = [
55
+ }, lh = [
56
56
  {
57
57
  key: "default",
58
58
  label: "默认",
@@ -85,14 +85,14 @@ function Vn(a) {
85
85
  function vt(a) {
86
86
  return Vn(a) === "auto-first-added-video";
87
87
  }
88
- function Ve(a) {
88
+ function Ye(a) {
89
89
  return {
90
90
  mode: Vn(a == null ? void 0 : a.mode),
91
91
  width: typeof (a == null ? void 0 : a.width) == "number" && a.width > 0 ? a.width : Pe.width,
92
92
  height: typeof (a == null ? void 0 : a.height) == "number" && a.height > 0 ? a.height : Pe.height
93
93
  };
94
94
  }
95
- const lh = {
95
+ const hh = {
96
96
  DEFAULT: 1,
97
97
  // 默认层级
98
98
  ACTIVE: 2
@@ -108,7 +108,7 @@ const lh = {
108
108
  // 动画持续时间(毫秒)
109
109
  EASING: "easeOutCubic"
110
110
  // 缓动函数
111
- }, hh = {
111
+ }, ch = {
112
112
  DEFAULT_HEIGHT: 40,
113
113
  // 默认时间刻度高度
114
114
  MIN_HEIGHT: 20,
@@ -263,15 +263,15 @@ const Vs = Math.PI / 180;
263
263
  function Ys() {
264
264
  return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
265
265
  }
266
- const Ye = typeof global < "u" ? global : typeof window < "u" ? window : typeof WorkerGlobalScope < "u" ? self : {}, E = {
267
- _global: Ye,
266
+ const We = typeof global < "u" ? global : typeof window < "u" ? window : typeof WorkerGlobalScope < "u" ? self : {}, M = {
267
+ _global: We,
268
268
  version: "10.2.0",
269
269
  isBrowser: Ys(),
270
270
  isUnminified: /param/.test((function(a) {
271
271
  }).toString()),
272
272
  dblClickWindow: 400,
273
273
  getAngle(a) {
274
- return E.angleDeg ? a * Vs : a;
274
+ return M.angleDeg ? a * Vs : a;
275
275
  },
276
276
  enableTrace: !1,
277
277
  pointerEventsEnabled: !0,
@@ -295,24 +295,24 @@ const Ye = typeof global < "u" ? global : typeof window < "u" ? window : typeof
295
295
  showWarnings: !0,
296
296
  dragButtons: [0, 1],
297
297
  isDragging() {
298
- return E.DD.isDragging;
298
+ return M.DD.isDragging;
299
299
  },
300
300
  isTransforming() {
301
301
  var a, e;
302
- return (e = (a = E.Transformer) === null || a === void 0 ? void 0 : a.isTransforming()) !== null && e !== void 0 ? e : !1;
302
+ return (e = (a = M.Transformer) === null || a === void 0 ? void 0 : a.isTransforming()) !== null && e !== void 0 ? e : !1;
303
303
  },
304
304
  isDragReady() {
305
- return !!E.DD.node;
305
+ return !!M.DD.node;
306
306
  },
307
307
  releaseCanvasOnDestroy: !0,
308
- document: Ye.document,
308
+ document: We.document,
309
309
  _injectGlobal(a) {
310
- typeof Ye.Konva < "u" && console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."), Ye.Konva = a;
310
+ typeof We.Konva < "u" && console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."), We.Konva = a;
311
311
  }
312
312
  }, ne = (a) => {
313
- E[a.prototype.getClassName()] = a;
313
+ M[a.prototype.getClassName()] = a;
314
314
  };
315
- E._injectGlobal(E);
315
+ M._injectGlobal(M);
316
316
  const Ws = `Konva.js unsupported environment.
317
317
 
318
318
  Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
@@ -806,7 +806,7 @@ const ir = typeof requestAnimationFrame < "u" && requestAnimationFrame || functi
806
806
  return v.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."), v.radToDeg(a);
807
807
  },
808
808
  _getRotation(a) {
809
- return E.angleDeg ? v.radToDeg(a) : a;
809
+ return M.angleDeg ? v.radToDeg(a) : a;
810
810
  },
811
811
  _capitalize(a) {
812
812
  return a.charAt(0).toUpperCase() + a.slice(1);
@@ -818,7 +818,7 @@ const ir = typeof requestAnimationFrame < "u" && requestAnimationFrame || functi
818
818
  console.error(Vi + a);
819
819
  },
820
820
  warn(a) {
821
- E.showWarnings && console.warn(Qs + a);
821
+ M.showWarnings && console.warn(Qs + a);
822
822
  },
823
823
  each(a, e) {
824
824
  for (const t in a)
@@ -897,7 +897,7 @@ const ir = typeof requestAnimationFrame < "u" && requestAnimationFrame || functi
897
897
  return a.touches ? a.changedTouches[0].identifier : a.pointerId || 999;
898
898
  },
899
899
  releaseCanvas(...a) {
900
- E.releaseCanvasOnDestroy && a.forEach((e) => {
900
+ M.releaseCanvasOnDestroy && a.forEach((e) => {
901
901
  e.width = 0, e.height = 0;
902
902
  });
903
903
  },
@@ -1000,7 +1000,7 @@ function Xi() {
1000
1000
  }
1001
1001
  class Qt {
1002
1002
  constructor(e) {
1003
- this.canvas = e, E.enableTrace && (this.traceArr = [], this._enableTrace());
1003
+ this.canvas = e, M.enableTrace && (this.traceArr = [], this._enableTrace());
1004
1004
  }
1005
1005
  fillShape(e) {
1006
1006
  e.fillEnabled() && this._fill(e);
@@ -1316,14 +1316,14 @@ function fr() {
1316
1316
  return Rt;
1317
1317
  const a = v.createCanvasElement(), e = a.getContext("2d");
1318
1318
  return Rt = function() {
1319
- const t = E._global.devicePixelRatio || 1, i = e.webkitBackingStorePixelRatio || e.mozBackingStorePixelRatio || e.msBackingStorePixelRatio || e.oBackingStorePixelRatio || e.backingStorePixelRatio || 1;
1319
+ const t = M._global.devicePixelRatio || 1, i = e.webkitBackingStorePixelRatio || e.mozBackingStorePixelRatio || e.msBackingStorePixelRatio || e.oBackingStorePixelRatio || e.backingStorePixelRatio || 1;
1320
1320
  return t / i;
1321
1321
  }(), v.releaseCanvas(a), Rt;
1322
1322
  }
1323
1323
  class Ri {
1324
1324
  constructor(e) {
1325
1325
  this.pixelRatio = 1, this.width = 0, this.height = 0, this.isCache = !1;
1326
- const i = (e || {}).pixelRatio || E.pixelRatio || fr();
1326
+ const i = (e || {}).pixelRatio || M.pixelRatio || fr();
1327
1327
  this.pixelRatio = i, this._canvas = v.createCanvasElement(), this._canvas.style.padding = "0", this._canvas.style.margin = "0", this._canvas.style.border = "0", this._canvas.style.background = "transparent", this._canvas.style.position = "absolute", this._canvas.style.top = "0", this._canvas.style.left = "0";
1328
1328
  }
1329
1329
  getContext() {
@@ -1379,24 +1379,24 @@ class Di extends Ri {
1379
1379
  super(e), this.hitCanvas = !0, this.context = new pr(this), this.setSize(e.width, e.height);
1380
1380
  }
1381
1381
  }
1382
- const $ = {
1382
+ const q = {
1383
1383
  get isDragging() {
1384
1384
  let a = !1;
1385
- return $._dragElements.forEach((e) => {
1385
+ return q._dragElements.forEach((e) => {
1386
1386
  e.dragStatus === "dragging" && (a = !0);
1387
1387
  }), a;
1388
1388
  },
1389
1389
  justDragged: !1,
1390
1390
  get node() {
1391
1391
  let a;
1392
- return $._dragElements.forEach((e) => {
1392
+ return q._dragElements.forEach((e) => {
1393
1393
  a = e.node;
1394
1394
  }), a;
1395
1395
  },
1396
1396
  _dragElements: /* @__PURE__ */ new Map(),
1397
1397
  _drag(a) {
1398
1398
  const e = [];
1399
- $._dragElements.forEach((t, i) => {
1399
+ q._dragElements.forEach((t, i) => {
1400
1400
  const { node: n } = t, s = n.getStage();
1401
1401
  s.setPointersPositions(a), t.pointerId === void 0 && (t.pointerId = v._getFirstPointerId(a));
1402
1402
  const r = s._changedPointerPositions.find((o) => o.id === t.pointerId);
@@ -1418,28 +1418,28 @@ const $ = {
1418
1418
  },
1419
1419
  _endDragBefore(a) {
1420
1420
  const e = [];
1421
- $._dragElements.forEach((t) => {
1421
+ q._dragElements.forEach((t) => {
1422
1422
  const { node: i } = t, n = i.getStage();
1423
1423
  if (a && n.setPointersPositions(a), !n._changedPointerPositions.find((o) => o.id === t.pointerId))
1424
1424
  return;
1425
- (t.dragStatus === "dragging" || t.dragStatus === "stopped") && ($.justDragged = !0, E._mouseListenClick = !1, E._touchListenClick = !1, E._pointerListenClick = !1, t.dragStatus = "stopped");
1426
- const r = t.node.getLayer() || t.node instanceof E.Stage && t.node;
1425
+ (t.dragStatus === "dragging" || t.dragStatus === "stopped") && (q.justDragged = !0, M._mouseListenClick = !1, M._touchListenClick = !1, M._pointerListenClick = !1, t.dragStatus = "stopped");
1426
+ const r = t.node.getLayer() || t.node instanceof M.Stage && t.node;
1427
1427
  r && e.indexOf(r) === -1 && e.push(r);
1428
1428
  }), e.forEach((t) => {
1429
1429
  t.draw();
1430
1430
  });
1431
1431
  },
1432
1432
  _endDragAfter(a) {
1433
- $._dragElements.forEach((e, t) => {
1433
+ q._dragElements.forEach((e, t) => {
1434
1434
  e.dragStatus === "stopped" && e.node.fire("dragend", {
1435
1435
  type: "dragend",
1436
1436
  target: e.node,
1437
1437
  evt: a
1438
- }, !0), e.dragStatus !== "dragging" && $._dragElements.delete(t);
1438
+ }, !0), e.dragStatus !== "dragging" && q._dragElements.delete(t);
1439
1439
  });
1440
1440
  }
1441
1441
  };
1442
- E.isBrowser && (window.addEventListener("mouseup", $._endDragBefore, !0), window.addEventListener("touchend", $._endDragBefore, !0), window.addEventListener("touchcancel", $._endDragBefore, !0), window.addEventListener("mousemove", $._drag), window.addEventListener("touchmove", $._drag), window.addEventListener("mouseup", $._endDragAfter, !1), window.addEventListener("touchend", $._endDragAfter, !1), window.addEventListener("touchcancel", $._endDragAfter, !1));
1442
+ M.isBrowser && (window.addEventListener("mouseup", q._endDragBefore, !0), window.addEventListener("touchend", q._endDragBefore, !0), window.addEventListener("touchcancel", q._endDragBefore, !0), window.addEventListener("mousemove", q._drag), window.addEventListener("touchmove", q._drag), window.addEventListener("mouseup", q._endDragAfter, !1), window.addEventListener("touchend", q._endDragAfter, !1), window.addEventListener("touchcancel", q._endDragAfter, !1));
1443
1443
  function Oe(a) {
1444
1444
  return v._isString(a) ? '"' + a + '"' : Object.prototype.toString.call(a) === "[object Number]" || v._isBoolean(a) ? a : Object.prototype.toString.call(a);
1445
1445
  }
@@ -1447,39 +1447,39 @@ function Wn(a) {
1447
1447
  return a > 255 ? 255 : a < 0 ? 0 : Math.round(a);
1448
1448
  }
1449
1449
  function I() {
1450
- if (E.isUnminified)
1450
+ if (M.isUnminified)
1451
1451
  return function(a, e) {
1452
1452
  return v._isNumber(a) || v.warn(Oe(a) + ' is a not valid value for "' + e + '" attribute. The value should be a number.'), a;
1453
1453
  };
1454
1454
  }
1455
1455
  function ei(a) {
1456
- if (E.isUnminified)
1456
+ if (M.isUnminified)
1457
1457
  return function(e, t) {
1458
1458
  let i = v._isNumber(e), n = v._isArray(e) && e.length == a;
1459
1459
  return !i && !n && v.warn(Oe(e) + ' is a not valid value for "' + t + '" attribute. The value should be a number or Array<number>(' + a + ")"), e;
1460
1460
  };
1461
1461
  }
1462
1462
  function Oi() {
1463
- if (E.isUnminified)
1463
+ if (M.isUnminified)
1464
1464
  return function(a, e) {
1465
1465
  return v._isNumber(a) || a === "auto" || v.warn(Oe(a) + ' is a not valid value for "' + e + '" attribute. The value should be a number or "auto".'), a;
1466
1466
  };
1467
1467
  }
1468
- function Xe() {
1469
- if (E.isUnminified)
1468
+ function Ue() {
1469
+ if (M.isUnminified)
1470
1470
  return function(a, e) {
1471
1471
  return v._isString(a) || v.warn(Oe(a) + ' is a not valid value for "' + e + '" attribute. The value should be a string.'), a;
1472
1472
  };
1473
1473
  }
1474
1474
  function Xn() {
1475
- if (E.isUnminified)
1475
+ if (M.isUnminified)
1476
1476
  return function(a, e) {
1477
1477
  const t = v._isString(a), i = Object.prototype.toString.call(a) === "[object CanvasGradient]" || a && a.addColorStop;
1478
1478
  return t || i || v.warn(Oe(a) + ' is a not valid value for "' + e + '" attribute. The value should be a string or a native gradient.'), a;
1479
1479
  };
1480
1480
  }
1481
1481
  function mr() {
1482
- if (E.isUnminified)
1482
+ if (M.isUnminified)
1483
1483
  return function(a, e) {
1484
1484
  const t = Int8Array ? Object.getPrototypeOf(Int8Array) : null;
1485
1485
  return t && a instanceof t || (v._isArray(a) ? a.forEach(function(i) {
@@ -1488,13 +1488,13 @@ function mr() {
1488
1488
  };
1489
1489
  }
1490
1490
  function me() {
1491
- if (E.isUnminified)
1491
+ if (M.isUnminified)
1492
1492
  return function(a, e) {
1493
1493
  return a === !0 || a === !1 || v.warn(Oe(a) + ' is a not valid value for "' + e + '" attribute. The value should be a boolean.'), a;
1494
1494
  };
1495
1495
  }
1496
1496
  function yr(a) {
1497
- if (E.isUnminified)
1497
+ if (M.isUnminified)
1498
1498
  return function(e, t) {
1499
1499
  return e == null || v.isObject(e) || v.warn(Oe(e) + ' is a not valid value for "' + t + '" attribute. The value should be an object with properties ' + a), e;
1500
1500
  };
@@ -1581,7 +1581,7 @@ function Sr(a) {
1581
1581
  const s = parseFloat(n.replace("px", ""));
1582
1582
  return function(r) {
1583
1583
  this.blurRadius(s * 0.5);
1584
- const o = E.Filters;
1584
+ const o = M.Filters;
1585
1585
  o && o.Blur && o.Blur.call(this, r);
1586
1586
  };
1587
1587
  }
@@ -1589,7 +1589,7 @@ function Sr(a) {
1589
1589
  const s = n.includes("%") ? parseFloat(n) / 100 : parseFloat(n);
1590
1590
  return function(r) {
1591
1591
  this.brightness(s);
1592
- const o = E.Filters;
1592
+ const o = M.Filters;
1593
1593
  o && o.Brightness && o.Brightness.call(this, r);
1594
1594
  };
1595
1595
  }
@@ -1598,23 +1598,23 @@ function Sr(a) {
1598
1598
  return function(r) {
1599
1599
  const o = 100 * (Math.sqrt(s) - 1);
1600
1600
  this.contrast(o);
1601
- const l = E.Filters;
1601
+ const l = M.Filters;
1602
1602
  l && l.Contrast && l.Contrast.call(this, r);
1603
1603
  };
1604
1604
  }
1605
1605
  case "grayscale":
1606
1606
  return function(s) {
1607
- const r = E.Filters;
1607
+ const r = M.Filters;
1608
1608
  r && r.Grayscale && r.Grayscale.call(this, s);
1609
1609
  };
1610
1610
  case "sepia":
1611
1611
  return function(s) {
1612
- const r = E.Filters;
1612
+ const r = M.Filters;
1613
1613
  r && r.Sepia && r.Sepia.call(this, s);
1614
1614
  };
1615
1615
  case "invert":
1616
1616
  return function(s) {
1617
- const r = E.Filters;
1617
+ const r = M.Filters;
1618
1618
  r && r.Invert && r.Invert.call(this, s);
1619
1619
  };
1620
1620
  default:
@@ -1823,7 +1823,7 @@ class x {
1823
1823
  });
1824
1824
  }
1825
1825
  remove() {
1826
- return this.isDragging() && this.stopDrag(), $._dragElements.delete(this._id), this._remove(), this;
1826
+ return this.isDragging() && this.stopDrag(), q._dragElements.delete(this._id), this._remove(), this;
1827
1827
  }
1828
1828
  _clearCaches() {
1829
1829
  this._clearSelfAndDescendantCache(ke), this._clearSelfAndDescendantCache(Ut), this._clearSelfAndDescendantCache($i), this._clearSelfAndDescendantCache(ji), this._clearSelfAndDescendantCache(Si), this._clearSelfAndDescendantCache(yi);
@@ -1881,10 +1881,10 @@ class x {
1881
1881
  return this._isVisible(e) && this._isListening(e);
1882
1882
  const i = this.getLayer();
1883
1883
  let n = !1;
1884
- $._dragElements.forEach((r) => {
1884
+ q._dragElements.forEach((r) => {
1885
1885
  r.dragStatus === "dragging" && (r.node.nodeType === "Stage" || r.node.getLayer() === i) && (n = !0);
1886
1886
  });
1887
- const s = !t && !E.hitOnDragEnabled && (n || E.isTransforming());
1887
+ const s = !t && !M.hitOnDragEnabled && (n || M.isTransforming());
1888
1888
  return this.isListening() && this.isVisible() && !s;
1889
1889
  }
1890
1890
  show() {
@@ -2141,7 +2141,7 @@ class x {
2141
2141
  var e, t;
2142
2142
  const i = this._cache.get(Me) || new de();
2143
2143
  i.reset();
2144
- const n = this.x(), s = this.y(), r = E.getAngle(this.rotation()), o = (e = this.attrs.scaleX) !== null && e !== void 0 ? e : 1, l = (t = this.attrs.scaleY) !== null && t !== void 0 ? t : 1, h = this.attrs.skewX || 0, c = this.attrs.skewY || 0, d = this.attrs.offsetX || 0, u = this.attrs.offsetY || 0;
2144
+ const n = this.x(), s = this.y(), r = M.getAngle(this.rotation()), o = (e = this.attrs.scaleX) !== null && e !== void 0 ? e : 1, l = (t = this.attrs.scaleY) !== null && t !== void 0 ? t : 1, h = this.attrs.skewX || 0, c = this.attrs.skewY || 0, d = this.attrs.offsetX || 0, u = this.attrs.offsetY || 0;
2145
2145
  return (n !== 0 || s !== 0) && i.translate(n, s), r !== 0 && i.rotate(r), (h !== 0 || c !== 0) && i.skew(h, c), (o !== 1 || l !== 1) && i.scale(o, l), (d !== 0 || u !== 0) && i.translate(-1 * d, -1 * u), i.dirty = !1, i;
2146
2146
  }
2147
2147
  clone(e) {
@@ -2215,7 +2215,7 @@ class x {
2215
2215
  return this.nodeType;
2216
2216
  }
2217
2217
  getDragDistance() {
2218
- return this.attrs.dragDistance !== void 0 ? this.attrs.dragDistance : this.parent ? this.parent.getDragDistance() : E.dragDistance;
2218
+ return this.attrs.dragDistance !== void 0 ? this.attrs.dragDistance : this.parent ? this.parent.getDragDistance() : M.dragDistance;
2219
2219
  }
2220
2220
  _off(e, t, i) {
2221
2221
  let n = this.eventListeners[e], s, r, o;
@@ -2256,7 +2256,7 @@ class x {
2256
2256
  return v._isFunction(i) ? i.call(this, t) : this._setAttr(e, t), this;
2257
2257
  }
2258
2258
  _requestDraw() {
2259
- if (E.autoDrawEnabled) {
2259
+ if (M.autoDrawEnabled) {
2260
2260
  const e = this.getLayer() || this.getStage();
2261
2261
  e == null || e.batchDraw();
2262
2262
  }
@@ -2319,7 +2319,7 @@ class x {
2319
2319
  if (!i)
2320
2320
  return;
2321
2321
  const s = i._getPointerById(t) || i._changedPointerPositions[0] || n;
2322
- $._dragElements.set(this._id, {
2322
+ q._dragElements.set(this._id, {
2323
2323
  node: this,
2324
2324
  startPointerPos: s,
2325
2325
  offset: {
@@ -2331,8 +2331,8 @@ class x {
2331
2331
  });
2332
2332
  }
2333
2333
  startDrag(e, t = !0) {
2334
- $._dragElements.has(this._id) || this._createDragElement(e);
2335
- const i = $._dragElements.get(this._id);
2334
+ q._dragElements.has(this._id) || this._createDragElement(e);
2335
+ const i = q._dragElements.get(this._id);
2336
2336
  i.dragStatus = "dragging", this.fire("dragstart", {
2337
2337
  type: "dragstart",
2338
2338
  target: this,
@@ -2355,22 +2355,22 @@ class x {
2355
2355
  (!this._lastPos || this._lastPos.x !== n.x || this._lastPos.y !== n.y) && (this.setAbsolutePosition(n), this._requestDraw()), this._lastPos = n;
2356
2356
  }
2357
2357
  stopDrag(e) {
2358
- const t = $._dragElements.get(this._id);
2359
- t && (t.dragStatus = "stopped"), $._endDragBefore(e), $._endDragAfter(e);
2358
+ const t = q._dragElements.get(this._id);
2359
+ t && (t.dragStatus = "stopped"), q._endDragBefore(e), q._endDragAfter(e);
2360
2360
  }
2361
2361
  setDraggable(e) {
2362
2362
  this._setAttr("draggable", e), this._dragChange();
2363
2363
  }
2364
2364
  isDragging() {
2365
- const e = $._dragElements.get(this._id);
2365
+ const e = q._dragElements.get(this._id);
2366
2366
  return e ? e.dragStatus === "dragging" : !1;
2367
2367
  }
2368
2368
  _listenDrag() {
2369
2369
  this._dragCleanup(), this.on("mousedown.konva touchstart.konva", function(e) {
2370
- if (!(!(e.evt.button !== void 0) || E.dragButtons.indexOf(e.evt.button) >= 0) || this.isDragging())
2370
+ if (!(!(e.evt.button !== void 0) || M.dragButtons.indexOf(e.evt.button) >= 0) || this.isDragging())
2371
2371
  return;
2372
2372
  let n = !1;
2373
- $._dragElements.forEach((s) => {
2373
+ q._dragElements.forEach((s) => {
2374
2374
  this.isAncestorOf(s.node) && (n = !0);
2375
2375
  }), n || this._createDragElement(e);
2376
2376
  });
@@ -2381,8 +2381,8 @@ class x {
2381
2381
  else {
2382
2382
  if (this._dragCleanup(), !this.getStage())
2383
2383
  return;
2384
- const t = $._dragElements.get(this._id), i = t && t.dragStatus === "dragging", n = t && t.dragStatus === "ready";
2385
- i ? this.stopDrag() : n && $._dragElements.delete(this._id);
2384
+ const t = q._dragElements.get(this._id), i = t && t.dragStatus === "dragging", n = t && t.dragStatus === "ready";
2385
+ i ? this.stopDrag() : n && q._dragElements.delete(this._id);
2386
2386
  }
2387
2387
  }
2388
2388
  _dragCleanup() {
@@ -2405,8 +2405,8 @@ class x {
2405
2405
  }
2406
2406
  static _createNode(e, t) {
2407
2407
  let i = x.prototype.getClassName.call(e), n = e.children, s, r, o;
2408
- t && (e.attrs.container = t), E[i] || (v.warn('Can not find a node with class name "' + i + '". Fallback to "Shape".'), i = "Shape");
2409
- const l = E[i];
2408
+ t && (e.attrs.container = t), M[i] || (v.warn('Can not find a node with class name "' + i + '". Fallback to "Shape".'), i = "Shape");
2409
+ const l = M[i];
2410
2410
  if (s = new l(e.attrs), n)
2411
2411
  for (r = n.length, o = 0; o < r; o++)
2412
2412
  s.add(x._createNode(n[o]));
@@ -2433,39 +2433,39 @@ x.prototype.on.call(x.prototype, "listeningChange.konva", function() {
2433
2433
  x.prototype.on.call(x.prototype, "opacityChange.konva", function() {
2434
2434
  this._clearSelfAndDescendantCache(Ut);
2435
2435
  });
2436
- const J = m.addGetterSetter;
2437
- J(x, "zIndex");
2438
- J(x, "absolutePosition");
2439
- J(x, "position");
2440
- J(x, "x", 0, I());
2441
- J(x, "y", 0, I());
2442
- J(x, "globalCompositeOperation", "source-over", Xe());
2443
- J(x, "opacity", 1, I());
2444
- J(x, "name", "", Xe());
2445
- J(x, "id", "", Xe());
2446
- J(x, "rotation", 0, I());
2436
+ const Z = m.addGetterSetter;
2437
+ Z(x, "zIndex");
2438
+ Z(x, "absolutePosition");
2439
+ Z(x, "position");
2440
+ Z(x, "x", 0, I());
2441
+ Z(x, "y", 0, I());
2442
+ Z(x, "globalCompositeOperation", "source-over", Ue());
2443
+ Z(x, "opacity", 1, I());
2444
+ Z(x, "name", "", Ue());
2445
+ Z(x, "id", "", Ue());
2446
+ Z(x, "rotation", 0, I());
2447
2447
  m.addComponentsGetterSetter(x, "scale", ["x", "y"]);
2448
- J(x, "scaleX", 1, I());
2449
- J(x, "scaleY", 1, I());
2448
+ Z(x, "scaleX", 1, I());
2449
+ Z(x, "scaleY", 1, I());
2450
2450
  m.addComponentsGetterSetter(x, "skew", ["x", "y"]);
2451
- J(x, "skewX", 0, I());
2452
- J(x, "skewY", 0, I());
2451
+ Z(x, "skewX", 0, I());
2452
+ Z(x, "skewY", 0, I());
2453
2453
  m.addComponentsGetterSetter(x, "offset", ["x", "y"]);
2454
- J(x, "offsetX", 0, I());
2455
- J(x, "offsetY", 0, I());
2456
- J(x, "dragDistance", void 0, I());
2457
- J(x, "width", 0, I());
2458
- J(x, "height", 0, I());
2459
- J(x, "listening", !0, me());
2460
- J(x, "preventDefault", !0, me());
2461
- J(x, "filters", void 0, function(a) {
2454
+ Z(x, "offsetX", 0, I());
2455
+ Z(x, "offsetY", 0, I());
2456
+ Z(x, "dragDistance", void 0, I());
2457
+ Z(x, "width", 0, I());
2458
+ Z(x, "height", 0, I());
2459
+ Z(x, "listening", !0, me());
2460
+ Z(x, "preventDefault", !0, me());
2461
+ Z(x, "filters", void 0, function(a) {
2462
2462
  return this._filterUpToDate = !1, a;
2463
2463
  });
2464
- J(x, "visible", !0, me());
2465
- J(x, "transformsEnabled", "all", Xe());
2466
- J(x, "size");
2467
- J(x, "dragBoundFunc");
2468
- J(x, "draggable", !1, me());
2464
+ Z(x, "visible", !0, me());
2465
+ Z(x, "transformsEnabled", "all", Ue());
2466
+ Z(x, "size");
2467
+ Z(x, "dragBoundFunc");
2468
+ Z(x, "draggable", !1, me());
2469
2469
  m.backCompat(x, {
2470
2470
  rotateDeg: "rotate",
2471
2471
  setRotationDeg: "setRotation",
@@ -2669,7 +2669,7 @@ m.addGetterSetter(ue, "clipY", void 0, I());
2669
2669
  m.addGetterSetter(ue, "clipWidth", void 0, I());
2670
2670
  m.addGetterSetter(ue, "clipHeight", void 0, I());
2671
2671
  m.addGetterSetter(ue, "clipFunc");
2672
- const xt = /* @__PURE__ */ new Map(), Un = E._global.PointerEvent !== void 0;
2672
+ const xt = /* @__PURE__ */ new Map(), Un = M._global.PointerEvent !== void 0;
2673
2673
  function ni(a) {
2674
2674
  return xt.get(a);
2675
2675
  }
@@ -2748,10 +2748,10 @@ const Mr = "Stage", Lr = "string", Zi = "px", Rr = "mouseout", Kn = "mouseleave"
2748
2748
  pointerclick: "pointerclick",
2749
2749
  pointerdblclick: "pointerdblclick"
2750
2750
  }
2751
- }, yt = (a) => a.indexOf("pointer") >= 0 ? "pointer" : a.indexOf("touch") >= 0 ? "touch" : "mouse", je = (a) => {
2751
+ }, yt = (a) => a.indexOf("pointer") >= 0 ? "pointer" : a.indexOf("touch") >= 0 ? "touch" : "mouse", Ze = (a) => {
2752
2752
  const e = yt(a);
2753
2753
  if (e === "pointer")
2754
- return E.pointerEventsEnabled && si.pointer;
2754
+ return M.pointerEventsEnabled && si.pointer;
2755
2755
  if (e === "touch")
2756
2756
  return si.touch;
2757
2757
  if (e === "mouse")
@@ -2867,7 +2867,7 @@ class ti extends ue {
2867
2867
  }
2868
2868
  super.add(e);
2869
2869
  const i = this.children.length;
2870
- return i > Or && v.warn("The stage has " + i + " layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."), e.setSize({ width: this.width(), height: this.height() }), e.draw(), E.isBrowser && this.content.appendChild(e.canvas._canvas), this;
2870
+ return i > Or && v.warn("The stage has " + i + " layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."), e.setSize({ width: this.width(), height: this.height() }), e.draw(), M.isBrowser && this.content.appendChild(e.canvas._canvas), this;
2871
2871
  }
2872
2872
  getParent() {
2873
2873
  return null;
@@ -2888,7 +2888,7 @@ class ti extends ue {
2888
2888
  return this.children;
2889
2889
  }
2890
2890
  _bindContentEvents() {
2891
- E.isBrowser && Br.forEach(([e, t]) => {
2891
+ M.isBrowser && Br.forEach(([e, t]) => {
2892
2892
  this.content.addEventListener(e, (i) => {
2893
2893
  this[t](i);
2894
2894
  }, { passive: !1 });
@@ -2896,7 +2896,7 @@ class ti extends ue {
2896
2896
  }
2897
2897
  _pointerenter(e) {
2898
2898
  this.setPointersPositions(e);
2899
- const t = je(e.type);
2899
+ const t = Ze(e.type);
2900
2900
  t && this._fire(t.pointerenter, {
2901
2901
  evt: e,
2902
2902
  target: this,
@@ -2905,7 +2905,7 @@ class ti extends ue {
2905
2905
  }
2906
2906
  _pointerover(e) {
2907
2907
  this.setPointersPositions(e);
2908
- const t = je(e.type);
2908
+ const t = Ze(e.type);
2909
2909
  t && this._fire(t.pointerover, {
2910
2910
  evt: e,
2911
2911
  target: this,
@@ -2917,11 +2917,11 @@ class ti extends ue {
2917
2917
  return t && !t.getStage() && (t = null), t;
2918
2918
  }
2919
2919
  _pointerleave(e) {
2920
- const t = je(e.type), i = yt(e.type);
2920
+ const t = Ze(e.type), i = yt(e.type);
2921
2921
  if (!t)
2922
2922
  return;
2923
2923
  this.setPointersPositions(e);
2924
- const n = this._getTargetShape(i), s = !(E.isDragging() || E.isTransforming()) || E.hitOnDragEnabled;
2924
+ const n = this._getTargetShape(i), s = !(M.isDragging() || M.isTransforming()) || M.hitOnDragEnabled;
2925
2925
  n && s ? (n._fireAndBubble(t.pointerout, { evt: e }), n._fireAndBubble(t.pointerleave, { evt: e }), this._fire(t.pointerleave, {
2926
2926
  evt: e,
2927
2927
  target: this,
@@ -2937,18 +2937,18 @@ class ti extends ue {
2937
2937
  })), this.pointerPos = null, this._pointerPositions = [];
2938
2938
  }
2939
2939
  _pointerdown(e) {
2940
- const t = je(e.type), i = yt(e.type);
2940
+ const t = Ze(e.type), i = yt(e.type);
2941
2941
  if (!t)
2942
2942
  return;
2943
2943
  this.setPointersPositions(e);
2944
2944
  let n = !1;
2945
2945
  this._changedPointerPositions.forEach((s) => {
2946
2946
  const r = this.getIntersection(s);
2947
- if ($.justDragged = !1, E["_" + i + "ListenClick"] = !0, !r || !r.isListening()) {
2947
+ if (q.justDragged = !1, M["_" + i + "ListenClick"] = !0, !r || !r.isListening()) {
2948
2948
  this[i + "ClickStartShape"] = void 0;
2949
2949
  return;
2950
2950
  }
2951
- E.capturePointerEventsEnabled && r.setPointerCapture(s.id), this[i + "ClickStartShape"] = r, r._fireAndBubble(t.pointerdown, {
2951
+ M.capturePointerEventsEnabled && r.setPointerCapture(s.id), this[i + "ClickStartShape"] = r, r._fireAndBubble(t.pointerdown, {
2952
2952
  evt: e,
2953
2953
  pointerId: s.id
2954
2954
  }), n = !0;
@@ -2962,11 +2962,11 @@ class ti extends ue {
2962
2962
  });
2963
2963
  }
2964
2964
  _pointermove(e) {
2965
- const t = je(e.type), i = yt(e.type);
2965
+ const t = Ze(e.type), i = yt(e.type);
2966
2966
  if (!t)
2967
2967
  return;
2968
2968
  const n = e.type.indexOf("touch") >= 0 || e.pointerType === "touch";
2969
- if (E.isDragging() && $.node.preventDefault() && e.cancelable && n && e.preventDefault(), this.setPointersPositions(e), !(!(E.isDragging() || E.isTransforming()) || E.hitOnDragEnabled))
2969
+ if (M.isDragging() && q.node.preventDefault() && e.cancelable && n && e.preventDefault(), this.setPointersPositions(e), !(!(M.isDragging() || M.isTransforming()) || M.hitOnDragEnabled))
2970
2970
  return;
2971
2971
  const r = {};
2972
2972
  let o = !1;
@@ -2992,7 +2992,7 @@ class ti extends ue {
2992
2992
  });
2993
2993
  }
2994
2994
  _pointerup(e) {
2995
- const t = je(e.type), i = yt(e.type);
2995
+ const t = Ze(e.type), i = yt(e.type);
2996
2996
  if (!t)
2997
2997
  return;
2998
2998
  this.setPointersPositions(e);
@@ -3007,14 +3007,14 @@ class ti extends ue {
3007
3007
  }
3008
3008
  const c = l.id, d = { evt: e, pointerId: c };
3009
3009
  let u = !1;
3010
- E["_" + i + "InDblClickWindow"] ? (u = !0, clearTimeout(this[i + "DblTimeout"])) : $.justDragged || (E["_" + i + "InDblClickWindow"] = !0, clearTimeout(this[i + "DblTimeout"])), this[i + "DblTimeout"] = setTimeout(function() {
3011
- E["_" + i + "InDblClickWindow"] = !1;
3012
- }, E.dblClickWindow), h && h.isListening() ? (o = !0, this[i + "ClickEndShape"] = h, h._fireAndBubble(t.pointerup, { ...d }), E["_" + i + "ListenClick"] && n && n === h && (h._fireAndBubble(t.pointerclick, { ...d }), u && s && s === h && h._fireAndBubble(t.pointerdblclick, { ...d }))) : (this[i + "ClickEndShape"] = null, o || (this._fire(t.pointerup, {
3010
+ M["_" + i + "InDblClickWindow"] ? (u = !0, clearTimeout(this[i + "DblTimeout"])) : q.justDragged || (M["_" + i + "InDblClickWindow"] = !0, clearTimeout(this[i + "DblTimeout"])), this[i + "DblTimeout"] = setTimeout(function() {
3011
+ M["_" + i + "InDblClickWindow"] = !1;
3012
+ }, M.dblClickWindow), h && h.isListening() ? (o = !0, this[i + "ClickEndShape"] = h, h._fireAndBubble(t.pointerup, { ...d }), M["_" + i + "ListenClick"] && n && n === h && (h._fireAndBubble(t.pointerclick, { ...d }), u && s && s === h && h._fireAndBubble(t.pointerdblclick, { ...d }))) : (this[i + "ClickEndShape"] = null, o || (this._fire(t.pointerup, {
3013
3013
  evt: e,
3014
3014
  target: this,
3015
3015
  currentTarget: this,
3016
3016
  pointerId: this._changedPointerPositions[0].id
3017
- }), o = !0), E["_" + i + "ListenClick"] && this._fire(t.pointerclick, {
3017
+ }), o = !0), M["_" + i + "ListenClick"] && this._fire(t.pointerclick, {
3018
3018
  evt: e,
3019
3019
  target: this,
3020
3020
  currentTarget: this,
@@ -3030,7 +3030,7 @@ class ti extends ue {
3030
3030
  target: this,
3031
3031
  currentTarget: this,
3032
3032
  pointerId: this._changedPointerPositions[0].id
3033
- }), E["_" + i + "ListenClick"] = !1, e.cancelable && i !== "touch" && i !== "pointer" && e.preventDefault();
3033
+ }), M["_" + i + "ListenClick"] = !1, e.cancelable && i !== "touch" && i !== "pointer" && e.preventDefault();
3034
3034
  }
3035
3035
  _contextmenu(e) {
3036
3036
  this.setPointersPositions(e);
@@ -3107,7 +3107,7 @@ class ti extends ue {
3107
3107
  pixelRatio: 1,
3108
3108
  width: this.width(),
3109
3109
  height: this.height()
3110
- }), !E.isBrowser)
3110
+ }), !M.isBrowser)
3111
3111
  return;
3112
3112
  const e = this.container();
3113
3113
  if (!e)
@@ -3129,7 +3129,7 @@ class ti extends ue {
3129
3129
  ti.prototype.nodeType = Mr;
3130
3130
  ne(ti);
3131
3131
  m.addGetterSetter(ti, "container");
3132
- E.isBrowser && document.addEventListener("visibilitychange", () => {
3132
+ M.isBrowser && document.addEventListener("visibilitychange", () => {
3133
3133
  bt.forEach((a) => {
3134
3134
  a.batchDraw();
3135
3135
  });
@@ -3169,7 +3169,7 @@ function Xr() {
3169
3169
  function Ur() {
3170
3170
  this._clearCache(hs);
3171
3171
  }
3172
- class P extends x {
3172
+ class _ extends x {
3173
3173
  constructor(e) {
3174
3174
  super(e);
3175
3175
  let t, i = 0;
@@ -3206,7 +3206,7 @@ class P extends x {
3206
3206
  const t = ri().createPattern(this.fillPatternImage(), this.fillPatternRepeat() || "repeat");
3207
3207
  if (t && t.setTransform) {
3208
3208
  const i = new de();
3209
- i.translate(this.fillPatternX(), this.fillPatternY()), i.rotate(E.getAngle(this.fillPatternRotation())), i.scale(this.fillPatternScaleX(), this.fillPatternScaleY()), i.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());
3209
+ i.translate(this.fillPatternX(), this.fillPatternY()), i.rotate(M.getAngle(this.fillPatternRotation())), i.scale(this.fillPatternScaleX(), this.fillPatternScaleY()), i.translate(-1 * this.fillPatternOffsetX(), -1 * this.fillPatternOffsetY());
3210
3210
  const n = i.getMatrix(), s = typeof DOMMatrix > "u" ? {
3211
3211
  a: n[0],
3212
3212
  b: n[1],
@@ -3397,100 +3397,100 @@ class P extends x {
3397
3397
  Tt(e);
3398
3398
  }
3399
3399
  }
3400
- P.prototype._fillFunc = Hr;
3401
- P.prototype._strokeFunc = Nr;
3402
- P.prototype._fillFuncHit = zr;
3403
- P.prototype._strokeFuncHit = Fr;
3404
- P.prototype._centroid = !1;
3405
- P.prototype.nodeType = "Shape";
3406
- ne(P);
3407
- P.prototype.eventListeners = {};
3408
- P.prototype.on.call(P.prototype, "shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", Vr);
3409
- P.prototype.on.call(P.prototype, "shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", Yr);
3410
- P.prototype.on.call(P.prototype, "fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva", Wr);
3411
- P.prototype.on.call(P.prototype, "fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva", Xr);
3412
- P.prototype.on.call(P.prototype, "fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva", Ur);
3413
- m.addGetterSetter(P, "stroke", void 0, Xn());
3414
- m.addGetterSetter(P, "strokeWidth", 2, I());
3415
- m.addGetterSetter(P, "fillAfterStrokeEnabled", !1);
3416
- m.addGetterSetter(P, "hitStrokeWidth", "auto", Oi());
3417
- m.addGetterSetter(P, "strokeHitEnabled", !0, me());
3418
- m.addGetterSetter(P, "perfectDrawEnabled", !0, me());
3419
- m.addGetterSetter(P, "shadowForStrokeEnabled", !0, me());
3420
- m.addGetterSetter(P, "lineJoin");
3421
- m.addGetterSetter(P, "lineCap");
3422
- m.addGetterSetter(P, "miterLimit");
3423
- m.addGetterSetter(P, "sceneFunc");
3424
- m.addGetterSetter(P, "hitFunc");
3425
- m.addGetterSetter(P, "dash");
3426
- m.addGetterSetter(P, "dashOffset", 0, I());
3427
- m.addGetterSetter(P, "shadowColor", void 0, Xe());
3428
- m.addGetterSetter(P, "shadowBlur", 0, I());
3429
- m.addGetterSetter(P, "shadowOpacity", 1, I());
3430
- m.addComponentsGetterSetter(P, "shadowOffset", ["x", "y"]);
3431
- m.addGetterSetter(P, "shadowOffsetX", 0, I());
3432
- m.addGetterSetter(P, "shadowOffsetY", 0, I());
3433
- m.addGetterSetter(P, "fillPatternImage");
3434
- m.addGetterSetter(P, "fill", void 0, Xn());
3435
- m.addGetterSetter(P, "fillPatternX", 0, I());
3436
- m.addGetterSetter(P, "fillPatternY", 0, I());
3437
- m.addGetterSetter(P, "fillLinearGradientColorStops");
3438
- m.addGetterSetter(P, "strokeLinearGradientColorStops");
3439
- m.addGetterSetter(P, "fillRadialGradientStartRadius", 0);
3440
- m.addGetterSetter(P, "fillRadialGradientEndRadius", 0);
3441
- m.addGetterSetter(P, "fillRadialGradientColorStops");
3442
- m.addGetterSetter(P, "fillPatternRepeat", "repeat");
3443
- m.addGetterSetter(P, "fillEnabled", !0);
3444
- m.addGetterSetter(P, "strokeEnabled", !0);
3445
- m.addGetterSetter(P, "shadowEnabled", !0);
3446
- m.addGetterSetter(P, "dashEnabled", !0);
3447
- m.addGetterSetter(P, "strokeScaleEnabled", !0);
3448
- m.addGetterSetter(P, "fillPriority", "color");
3449
- m.addComponentsGetterSetter(P, "fillPatternOffset", ["x", "y"]);
3450
- m.addGetterSetter(P, "fillPatternOffsetX", 0, I());
3451
- m.addGetterSetter(P, "fillPatternOffsetY", 0, I());
3452
- m.addComponentsGetterSetter(P, "fillPatternScale", ["x", "y"]);
3453
- m.addGetterSetter(P, "fillPatternScaleX", 1, I());
3454
- m.addGetterSetter(P, "fillPatternScaleY", 1, I());
3455
- m.addComponentsGetterSetter(P, "fillLinearGradientStartPoint", [
3400
+ _.prototype._fillFunc = Hr;
3401
+ _.prototype._strokeFunc = Nr;
3402
+ _.prototype._fillFuncHit = zr;
3403
+ _.prototype._strokeFuncHit = Fr;
3404
+ _.prototype._centroid = !1;
3405
+ _.prototype.nodeType = "Shape";
3406
+ ne(_);
3407
+ _.prototype.eventListeners = {};
3408
+ _.prototype.on.call(_.prototype, "shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", Vr);
3409
+ _.prototype.on.call(_.prototype, "shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva", Yr);
3410
+ _.prototype.on.call(_.prototype, "fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva", Wr);
3411
+ _.prototype.on.call(_.prototype, "fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva", Xr);
3412
+ _.prototype.on.call(_.prototype, "fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva", Ur);
3413
+ m.addGetterSetter(_, "stroke", void 0, Xn());
3414
+ m.addGetterSetter(_, "strokeWidth", 2, I());
3415
+ m.addGetterSetter(_, "fillAfterStrokeEnabled", !1);
3416
+ m.addGetterSetter(_, "hitStrokeWidth", "auto", Oi());
3417
+ m.addGetterSetter(_, "strokeHitEnabled", !0, me());
3418
+ m.addGetterSetter(_, "perfectDrawEnabled", !0, me());
3419
+ m.addGetterSetter(_, "shadowForStrokeEnabled", !0, me());
3420
+ m.addGetterSetter(_, "lineJoin");
3421
+ m.addGetterSetter(_, "lineCap");
3422
+ m.addGetterSetter(_, "miterLimit");
3423
+ m.addGetterSetter(_, "sceneFunc");
3424
+ m.addGetterSetter(_, "hitFunc");
3425
+ m.addGetterSetter(_, "dash");
3426
+ m.addGetterSetter(_, "dashOffset", 0, I());
3427
+ m.addGetterSetter(_, "shadowColor", void 0, Ue());
3428
+ m.addGetterSetter(_, "shadowBlur", 0, I());
3429
+ m.addGetterSetter(_, "shadowOpacity", 1, I());
3430
+ m.addComponentsGetterSetter(_, "shadowOffset", ["x", "y"]);
3431
+ m.addGetterSetter(_, "shadowOffsetX", 0, I());
3432
+ m.addGetterSetter(_, "shadowOffsetY", 0, I());
3433
+ m.addGetterSetter(_, "fillPatternImage");
3434
+ m.addGetterSetter(_, "fill", void 0, Xn());
3435
+ m.addGetterSetter(_, "fillPatternX", 0, I());
3436
+ m.addGetterSetter(_, "fillPatternY", 0, I());
3437
+ m.addGetterSetter(_, "fillLinearGradientColorStops");
3438
+ m.addGetterSetter(_, "strokeLinearGradientColorStops");
3439
+ m.addGetterSetter(_, "fillRadialGradientStartRadius", 0);
3440
+ m.addGetterSetter(_, "fillRadialGradientEndRadius", 0);
3441
+ m.addGetterSetter(_, "fillRadialGradientColorStops");
3442
+ m.addGetterSetter(_, "fillPatternRepeat", "repeat");
3443
+ m.addGetterSetter(_, "fillEnabled", !0);
3444
+ m.addGetterSetter(_, "strokeEnabled", !0);
3445
+ m.addGetterSetter(_, "shadowEnabled", !0);
3446
+ m.addGetterSetter(_, "dashEnabled", !0);
3447
+ m.addGetterSetter(_, "strokeScaleEnabled", !0);
3448
+ m.addGetterSetter(_, "fillPriority", "color");
3449
+ m.addComponentsGetterSetter(_, "fillPatternOffset", ["x", "y"]);
3450
+ m.addGetterSetter(_, "fillPatternOffsetX", 0, I());
3451
+ m.addGetterSetter(_, "fillPatternOffsetY", 0, I());
3452
+ m.addComponentsGetterSetter(_, "fillPatternScale", ["x", "y"]);
3453
+ m.addGetterSetter(_, "fillPatternScaleX", 1, I());
3454
+ m.addGetterSetter(_, "fillPatternScaleY", 1, I());
3455
+ m.addComponentsGetterSetter(_, "fillLinearGradientStartPoint", [
3456
3456
  "x",
3457
3457
  "y"
3458
3458
  ]);
3459
- m.addComponentsGetterSetter(P, "strokeLinearGradientStartPoint", [
3459
+ m.addComponentsGetterSetter(_, "strokeLinearGradientStartPoint", [
3460
3460
  "x",
3461
3461
  "y"
3462
3462
  ]);
3463
- m.addGetterSetter(P, "fillLinearGradientStartPointX", 0);
3464
- m.addGetterSetter(P, "strokeLinearGradientStartPointX", 0);
3465
- m.addGetterSetter(P, "fillLinearGradientStartPointY", 0);
3466
- m.addGetterSetter(P, "strokeLinearGradientStartPointY", 0);
3467
- m.addComponentsGetterSetter(P, "fillLinearGradientEndPoint", [
3463
+ m.addGetterSetter(_, "fillLinearGradientStartPointX", 0);
3464
+ m.addGetterSetter(_, "strokeLinearGradientStartPointX", 0);
3465
+ m.addGetterSetter(_, "fillLinearGradientStartPointY", 0);
3466
+ m.addGetterSetter(_, "strokeLinearGradientStartPointY", 0);
3467
+ m.addComponentsGetterSetter(_, "fillLinearGradientEndPoint", [
3468
3468
  "x",
3469
3469
  "y"
3470
3470
  ]);
3471
- m.addComponentsGetterSetter(P, "strokeLinearGradientEndPoint", [
3471
+ m.addComponentsGetterSetter(_, "strokeLinearGradientEndPoint", [
3472
3472
  "x",
3473
3473
  "y"
3474
3474
  ]);
3475
- m.addGetterSetter(P, "fillLinearGradientEndPointX", 0);
3476
- m.addGetterSetter(P, "strokeLinearGradientEndPointX", 0);
3477
- m.addGetterSetter(P, "fillLinearGradientEndPointY", 0);
3478
- m.addGetterSetter(P, "strokeLinearGradientEndPointY", 0);
3479
- m.addComponentsGetterSetter(P, "fillRadialGradientStartPoint", [
3475
+ m.addGetterSetter(_, "fillLinearGradientEndPointX", 0);
3476
+ m.addGetterSetter(_, "strokeLinearGradientEndPointX", 0);
3477
+ m.addGetterSetter(_, "fillLinearGradientEndPointY", 0);
3478
+ m.addGetterSetter(_, "strokeLinearGradientEndPointY", 0);
3479
+ m.addComponentsGetterSetter(_, "fillRadialGradientStartPoint", [
3480
3480
  "x",
3481
3481
  "y"
3482
3482
  ]);
3483
- m.addGetterSetter(P, "fillRadialGradientStartPointX", 0);
3484
- m.addGetterSetter(P, "fillRadialGradientStartPointY", 0);
3485
- m.addComponentsGetterSetter(P, "fillRadialGradientEndPoint", [
3483
+ m.addGetterSetter(_, "fillRadialGradientStartPointX", 0);
3484
+ m.addGetterSetter(_, "fillRadialGradientStartPointY", 0);
3485
+ m.addComponentsGetterSetter(_, "fillRadialGradientEndPoint", [
3486
3486
  "x",
3487
3487
  "y"
3488
3488
  ]);
3489
- m.addGetterSetter(P, "fillRadialGradientEndPointX", 0);
3490
- m.addGetterSetter(P, "fillRadialGradientEndPointY", 0);
3491
- m.addGetterSetter(P, "fillPatternRotation", 0);
3492
- m.addGetterSetter(P, "fillRule", void 0, Xe());
3493
- m.backCompat(P, {
3489
+ m.addGetterSetter(_, "fillRadialGradientEndPointX", 0);
3490
+ m.addGetterSetter(_, "fillRadialGradientEndPointY", 0);
3491
+ m.addGetterSetter(_, "fillPatternRotation", 0);
3492
+ m.addGetterSetter(_, "fillRule", void 0, Ue());
3493
+ m.backCompat(_, {
3494
3494
  dashArray: "dash",
3495
3495
  getDashArray: "getDash",
3496
3496
  setDashArray: "getDash",
@@ -3508,7 +3508,7 @@ const $r = "beforeDraw", qr = "draw", cs = [
3508
3508
  { x: 1, y: 1 },
3509
3509
  { x: -1, y: 1 }
3510
3510
  ], Kr = cs.length;
3511
- class Ue extends ue {
3511
+ class $e extends ue {
3512
3512
  constructor(e) {
3513
3513
  super(e), this.canvas = new Re(), this.hitCanvas = new Di({
3514
3514
  pixelRatio: 1
@@ -3685,12 +3685,12 @@ class Ue extends ue {
3685
3685
  return v.releaseCanvas(this.getNativeCanvasElement(), this.getHitCanvas()._canvas), super.destroy();
3686
3686
  }
3687
3687
  }
3688
- Ue.prototype.nodeType = "Layer";
3689
- ne(Ue);
3690
- m.addGetterSetter(Ue, "imageSmoothingEnabled", !0);
3691
- m.addGetterSetter(Ue, "clearBeforeDraw", !0);
3692
- m.addGetterSetter(Ue, "hitGraphEnabled", !0, me());
3693
- class Gi extends Ue {
3688
+ $e.prototype.nodeType = "Layer";
3689
+ ne($e);
3690
+ m.addGetterSetter($e, "imageSmoothingEnabled", !0);
3691
+ m.addGetterSetter($e, "clearBeforeDraw", !0);
3692
+ m.addGetterSetter($e, "hitGraphEnabled", !0, me());
3693
+ class Gi extends $e {
3694
3694
  constructor(e) {
3695
3695
  super(e), this.listening(!1), v.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.');
3696
3696
  }
@@ -3706,8 +3706,8 @@ class st extends ue {
3706
3706
  st.prototype.nodeType = "Group";
3707
3707
  ne(st);
3708
3708
  const ai = function() {
3709
- return Ye.performance && Ye.performance.now ? function() {
3710
- return Ye.performance.now();
3709
+ return We.performance && We.performance.now ? function() {
3710
+ return We.performance.now();
3711
3711
  } : function() {
3712
3712
  return (/* @__PURE__ */ new Date()).getTime();
3713
3713
  };
@@ -3846,17 +3846,17 @@ class Qr {
3846
3846
  return (/* @__PURE__ */ new Date()).getTime();
3847
3847
  }
3848
3848
  }
3849
- class Q {
3849
+ class J {
3850
3850
  constructor(e) {
3851
3851
  const t = this, i = e.node, n = i._id, s = e.easing || kt.Linear, r = !!e.yoyo;
3852
3852
  let o, l;
3853
3853
  typeof e.duration > "u" ? o = 0.3 : e.duration === 0 ? o = 1e-3 : o = e.duration, this.node = i, this._id = Jr++;
3854
- const h = i.getLayer() || (i instanceof E.Stage ? i.getLayers() : null);
3854
+ const h = i.getLayer() || (i instanceof M.Stage ? i.getLayers() : null);
3855
3855
  h || v.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."), this.anim = new pe(function() {
3856
3856
  t.tween.onEnterFrame();
3857
3857
  }, h), this.tween = new Qr(l, function(c) {
3858
3858
  t._tweenFunc(c);
3859
- }, s, 0, 1, o * 1e3, r), this._addListeners(), Q.attrs[n] || (Q.attrs[n] = {}), Q.attrs[n][this._id] || (Q.attrs[n][this._id] = {}), Q.tweens[n] || (Q.tweens[n] = {});
3859
+ }, s, 0, 1, o * 1e3, r), this._addListeners(), J.attrs[n] || (J.attrs[n] = {}), J.attrs[n][this._id] || (J.attrs[n][this._id] = {}), J.tweens[n] || (J.tweens[n] = {});
3860
3860
  for (l in e)
3861
3861
  jr[l] === void 0 && this._addAttr(l, e[l]);
3862
3862
  this.reset(), this.onFinish = e.onFinish, this.onReset = e.onReset, this.onUpdate = e.onUpdate;
@@ -3864,8 +3864,8 @@ class Q {
3864
3864
  _addAttr(e, t) {
3865
3865
  const i = this.node, n = i._id;
3866
3866
  let s, r, o, l, h;
3867
- const c = Q.tweens[n][e];
3868
- c && delete Q.attrs[n][c][e];
3867
+ const c = J.tweens[n][e];
3868
+ c && delete J.attrs[n][c][e];
3869
3869
  let d = i.getAttr(e);
3870
3870
  if (v._isArray(t))
3871
3871
  if (s = [], r = Math.max(t.length, d.length), e === "points" && t.length !== d.length && (t.length > d.length ? (l = d, d = v._prepareArrayForTween(d, t, i.closed())) : (o = t, t = v._prepareArrayForTween(t, d, i.closed()))), e.indexOf("fill") === 0)
@@ -3890,16 +3890,16 @@ class Q {
3890
3890
  b: h.b - d.b,
3891
3891
  a: h.a - d.a
3892
3892
  }) : s = t - d;
3893
- Q.attrs[n][this._id][e] = {
3893
+ J.attrs[n][this._id][e] = {
3894
3894
  start: d,
3895
3895
  diff: s,
3896
3896
  end: t,
3897
3897
  trueEnd: o,
3898
3898
  trueStart: l
3899
- }, Q.tweens[n][e] = this._id;
3899
+ }, J.tweens[n][e] = this._id;
3900
3900
  }
3901
3901
  _tweenFunc(e) {
3902
- const t = this.node, i = Q.attrs[t._id][this._id];
3902
+ const t = this.node, i = J.attrs[t._id][this._id];
3903
3903
  let n, s, r, o, l, h, c, d;
3904
3904
  for (n in i) {
3905
3905
  if (s = i[n], r = s.start, o = s.diff, d = s.end, v._isArray(r))
@@ -3921,10 +3921,10 @@ class Q {
3921
3921
  }, this.tween.onPause = () => {
3922
3922
  this.anim.stop();
3923
3923
  }, this.tween.onFinish = () => {
3924
- const e = this.node, t = Q.attrs[e._id][this._id];
3924
+ const e = this.node, t = J.attrs[e._id][this._id];
3925
3925
  t.points && t.points.trueEnd && e.setAttr("points", t.points.trueEnd), this.onFinish && this.onFinish.call(this);
3926
3926
  }, this.tween.onReset = () => {
3927
- const e = this.node, t = Q.attrs[e._id][this._id];
3927
+ const e = this.node, t = J.attrs[e._id][this._id];
3928
3928
  t.points && t.points.trueStart && e.points(t.points.trueStart), this.onReset && this.onReset();
3929
3929
  }, this.tween.onUpdate = () => {
3930
3930
  this.onUpdate && this.onUpdate.call(this);
@@ -3949,20 +3949,20 @@ class Q {
3949
3949
  return this.tween.finish(), this;
3950
3950
  }
3951
3951
  destroy() {
3952
- const e = this.node._id, t = this._id, i = Q.tweens[e];
3952
+ const e = this.node._id, t = this._id, i = J.tweens[e];
3953
3953
  this.pause(), this.anim && this.anim.stop();
3954
3954
  for (const n in i)
3955
- delete Q.tweens[e][n];
3956
- delete Q.attrs[e][t], Q.tweens[e] && (Object.keys(Q.tweens[e]).length === 0 && delete Q.tweens[e], Object.keys(Q.attrs[e]).length === 0 && delete Q.attrs[e]);
3955
+ delete J.tweens[e][n];
3956
+ delete J.attrs[e][t], J.tweens[e] && (Object.keys(J.tweens[e]).length === 0 && delete J.tweens[e], Object.keys(J.attrs[e]).length === 0 && delete J.attrs[e]);
3957
3957
  }
3958
3958
  }
3959
- Q.attrs = {};
3960
- Q.tweens = {};
3959
+ J.attrs = {};
3960
+ J.tweens = {};
3961
3961
  x.prototype.to = function(a) {
3962
3962
  const e = a.onFinish;
3963
3963
  a.node = this, a.onFinish = function() {
3964
3964
  this.destroy(), e && e();
3965
- }, new Q(a).play();
3965
+ }, new J(a).play();
3966
3966
  };
3967
3967
  const kt = {
3968
3968
  BackEaseIn(a, e, t, i) {
@@ -4017,28 +4017,28 @@ const kt = {
4017
4017
  Linear(a, e, t, i) {
4018
4018
  return t * a / i + e;
4019
4019
  }
4020
- }, nn = v._assign(E, {
4020
+ }, nn = v._assign(M, {
4021
4021
  Util: v,
4022
4022
  Transform: de,
4023
4023
  Node: x,
4024
4024
  Container: ue,
4025
4025
  Stage: ti,
4026
4026
  stages: bt,
4027
- Layer: Ue,
4027
+ Layer: $e,
4028
4028
  FastLayer: Gi,
4029
4029
  Group: st,
4030
- DD: $,
4031
- Shape: P,
4030
+ DD: q,
4031
+ Shape: _,
4032
4032
  shapes: wt,
4033
4033
  Animation: pe,
4034
- Tween: Q,
4034
+ Tween: J,
4035
4035
  Easings: kt,
4036
4036
  Context: Qt,
4037
4037
  Canvas: Ri
4038
4038
  });
4039
- class xe extends P {
4039
+ class xe extends _ {
4040
4040
  _sceneFunc(e) {
4041
- const t = E.getAngle(this.angle()), i = this.clockwise();
4041
+ const t = M.getAngle(this.angle()), i = this.clockwise();
4042
4042
  e.beginPath(), e.arc(0, 0, this.outerRadius(), 0, t, i), e.arc(0, 0, this.innerRadius(), t, 0, !i), e.closePath(), e.fillStrokeShape(this);
4043
4043
  }
4044
4044
  getWidth() {
@@ -4054,7 +4054,7 @@ class xe extends P {
4054
4054
  this.outerRadius(e / 2);
4055
4055
  }
4056
4056
  getSelfRect() {
4057
- const e = this.innerRadius(), t = this.outerRadius(), i = this.clockwise(), n = E.getAngle(i ? 360 - this.angle() : this.angle()), s = Math.cos(Math.min(n, Math.PI)), r = 1, o = Math.sin(Math.min(Math.max(Math.PI, n), 3 * Math.PI / 2)), l = Math.sin(Math.min(n, Math.PI / 2)), h = s * (s > 0 ? e : t), c = r * t, d = o * (o > 0 ? e : t), u = l * (l > 0 ? t : e);
4057
+ const e = this.innerRadius(), t = this.outerRadius(), i = this.clockwise(), n = M.getAngle(i ? 360 - this.angle() : this.angle()), s = Math.cos(Math.min(n, Math.PI)), r = 1, o = Math.sin(Math.min(Math.max(Math.PI, n), 3 * Math.PI / 2)), l = Math.sin(Math.min(n, Math.PI / 2)), h = s * (s > 0 ? e : t), c = r * t, d = o * (o > 0 ? e : t), u = l * (l > 0 ? t : e);
4058
4058
  return {
4059
4059
  x: h,
4060
4060
  y: i ? -1 * u : d,
@@ -4108,7 +4108,7 @@ function ea(a) {
4108
4108
  return s * s * s * n[0] + 3 * s * s * i * n[1] + 3 * s * i * i * n[2] + i * i * i * n[3];
4109
4109
  }));
4110
4110
  }
4111
- class Ie extends P {
4111
+ class Ie extends _ {
4112
4112
  constructor(e) {
4113
4113
  super(e), this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva", function() {
4114
4114
  this._clearCache("tensionPoints");
@@ -4942,14 +4942,14 @@ const bi = (a, e, t) => {
4942
4942
  }
4943
4943
  return n;
4944
4944
  };
4945
- class ee extends P {
4945
+ class Q extends _ {
4946
4946
  constructor(e) {
4947
4947
  super(e), this.dataArray = [], this.pathLength = 0, this._readDataAttribute(), this.on("dataChange.konva", function() {
4948
4948
  this._readDataAttribute();
4949
4949
  });
4950
4950
  }
4951
4951
  _readDataAttribute() {
4952
- this.dataArray = ee.parsePathData(this.data()), this.pathLength = ee.getPathLength(this.dataArray);
4952
+ this.dataArray = Q.parsePathData(this.data()), this.pathLength = Q.getPathLength(this.dataArray);
4953
4953
  }
4954
4954
  _sceneFunc(e) {
4955
4955
  const t = this.dataArray;
@@ -4989,17 +4989,17 @@ class ee extends P {
4989
4989
  let u = Math.PI / 180;
4990
4990
  if (Math.abs(h - d) < u && (u = Math.abs(h - d)), c < 0)
4991
4991
  for (let f = h - u; f > d; f -= u) {
4992
- const p = ee.getPointOnEllipticalArc(l.points[0], l.points[1], l.points[2], l.points[3], f, 0);
4992
+ const p = Q.getPointOnEllipticalArc(l.points[0], l.points[1], l.points[2], l.points[3], f, 0);
4993
4993
  e.push(p.x, p.y);
4994
4994
  }
4995
4995
  else
4996
4996
  for (let f = h + u; f < d; f += u) {
4997
- const p = ee.getPointOnEllipticalArc(l.points[0], l.points[1], l.points[2], l.points[3], f, 0);
4997
+ const p = Q.getPointOnEllipticalArc(l.points[0], l.points[1], l.points[2], l.points[3], f, 0);
4998
4998
  e.push(p.x, p.y);
4999
4999
  }
5000
5000
  } else if (l.command === "C")
5001
5001
  for (let h = 0; h <= 1; h += 0.01) {
5002
- const c = ee.getPointOnCubicBezier(h, l.start.x, l.start.y, l.points[0], l.points[1], l.points[2], l.points[3], l.points[4], l.points[5]);
5002
+ const c = Q.getPointOnCubicBezier(h, l.start.x, l.start.y, l.points[0], l.points[1], l.points[2], l.points[3], l.points[4], l.points[5]);
5003
5003
  e.push(c.x, c.y);
5004
5004
  }
5005
5005
  else
@@ -5019,7 +5019,7 @@ class ee extends P {
5019
5019
  return this.pathLength;
5020
5020
  }
5021
5021
  getPointAtLength(e) {
5022
- return ee.getPointAtLengthOfDataArray(e, this.dataArray);
5022
+ return Q.getPointAtLengthOfDataArray(e, this.dataArray);
5023
5023
  }
5024
5024
  static getLineLength(e, t, i, n) {
5025
5025
  return Math.sqrt((i - e) * (i - e) + (n - t) * (n - t));
@@ -5052,15 +5052,15 @@ class ee extends P {
5052
5052
  const r = t[n], o = r.points;
5053
5053
  switch (r.command) {
5054
5054
  case "L":
5055
- return ee.getPointOnLine(e, r.start.x, r.start.y, o[0], o[1]);
5055
+ return Q.getPointOnLine(e, r.start.x, r.start.y, o[0], o[1]);
5056
5056
  case "C":
5057
- return ee.getPointOnCubicBezier(on(e, ee.getPathLength(t), (y) => rn([r.start.x, o[0], o[2], o[4]], [r.start.y, o[1], o[3], o[5]], y)), r.start.x, r.start.y, o[0], o[1], o[2], o[3], o[4], o[5]);
5057
+ return Q.getPointOnCubicBezier(on(e, Q.getPathLength(t), (y) => rn([r.start.x, o[0], o[2], o[4]], [r.start.y, o[1], o[3], o[5]], y)), r.start.x, r.start.y, o[0], o[1], o[2], o[3], o[4], o[5]);
5058
5058
  case "Q":
5059
- return ee.getPointOnQuadraticBezier(on(e, ee.getPathLength(t), (y) => an([r.start.x, o[0], o[2]], [r.start.y, o[1], o[3]], y)), r.start.x, r.start.y, o[0], o[1], o[2], o[3]);
5059
+ return Q.getPointOnQuadraticBezier(on(e, Q.getPathLength(t), (y) => an([r.start.x, o[0], o[2]], [r.start.y, o[1], o[3]], y)), r.start.x, r.start.y, o[0], o[1], o[2], o[3]);
5060
5060
  case "A":
5061
5061
  const l = o[0], h = o[1], c = o[2], d = o[3], u = o[5], f = o[6];
5062
5062
  let p = o[4];
5063
- return p += u * e / r.pathLength, ee.getPointOnEllipticalArc(l, h, c, d, p, f);
5063
+ return p += u * e / r.pathLength, Q.getPointOnEllipticalArc(l, h, c, d, p, f);
5064
5064
  }
5065
5065
  return null;
5066
5066
  }
@@ -5194,7 +5194,7 @@ class ee extends P {
5194
5194
  for (; p.length > 0 && !isNaN(p[0]); ) {
5195
5195
  let S = "", C = [];
5196
5196
  const T = o, b = l;
5197
- let w, k, _, O, A, M, D, z, B, Y;
5197
+ let w, A, P, D, k, E, O, z, B, W;
5198
5198
  switch (f) {
5199
5199
  case "l":
5200
5200
  o += p.shift(), l += p.shift(), S = "L", C.push(o, l);
@@ -5203,11 +5203,11 @@ class ee extends P {
5203
5203
  o = p.shift(), l = p.shift(), C.push(o, l);
5204
5204
  break;
5205
5205
  case "m":
5206
- const F = p.shift(), H = p.shift();
5207
- if (o += F, l += H, S = "M", s.length > 2 && s[s.length - 1].command === "z") {
5206
+ const F = p.shift(), G = p.shift();
5207
+ if (o += F, l += G, S = "M", s.length > 2 && s[s.length - 1].command === "z") {
5208
5208
  for (let R = s.length - 2; R >= 0; R--)
5209
5209
  if (s[R].command === "M") {
5210
- o = s[R].points[0] + F, l = s[R].points[1] + H;
5210
+ o = s[R].points[0] + F, l = s[R].points[1] + G;
5211
5211
  break;
5212
5212
  }
5213
5213
  }
@@ -5235,10 +5235,10 @@ class ee extends P {
5235
5235
  C.push(o + p.shift(), l + p.shift(), o + p.shift(), l + p.shift()), o += p.shift(), l += p.shift(), S = "C", C.push(o, l);
5236
5236
  break;
5237
5237
  case "S":
5238
- k = o, _ = l, w = s[s.length - 1], w.command === "C" && (k = o + (o - w.points[2]), _ = l + (l - w.points[3])), C.push(k, _, p.shift(), p.shift()), o = p.shift(), l = p.shift(), S = "C", C.push(o, l);
5238
+ A = o, P = l, w = s[s.length - 1], w.command === "C" && (A = o + (o - w.points[2]), P = l + (l - w.points[3])), C.push(A, P, p.shift(), p.shift()), o = p.shift(), l = p.shift(), S = "C", C.push(o, l);
5239
5239
  break;
5240
5240
  case "s":
5241
- k = o, _ = l, w = s[s.length - 1], w.command === "C" && (k = o + (o - w.points[2]), _ = l + (l - w.points[3])), C.push(k, _, o + p.shift(), l + p.shift()), o += p.shift(), l += p.shift(), S = "C", C.push(o, l);
5241
+ A = o, P = l, w = s[s.length - 1], w.command === "C" && (A = o + (o - w.points[2]), P = l + (l - w.points[3])), C.push(A, P, o + p.shift(), l + p.shift()), o += p.shift(), l += p.shift(), S = "C", C.push(o, l);
5242
5242
  break;
5243
5243
  case "Q":
5244
5244
  C.push(p.shift(), p.shift()), o = p.shift(), l = p.shift(), C.push(o, l);
@@ -5247,16 +5247,16 @@ class ee extends P {
5247
5247
  C.push(o + p.shift(), l + p.shift()), o += p.shift(), l += p.shift(), S = "Q", C.push(o, l);
5248
5248
  break;
5249
5249
  case "T":
5250
- k = o, _ = l, w = s[s.length - 1], w.command === "Q" && (k = o + (o - w.points[0]), _ = l + (l - w.points[1])), o = p.shift(), l = p.shift(), S = "Q", C.push(k, _, o, l);
5250
+ A = o, P = l, w = s[s.length - 1], w.command === "Q" && (A = o + (o - w.points[0]), P = l + (l - w.points[1])), o = p.shift(), l = p.shift(), S = "Q", C.push(A, P, o, l);
5251
5251
  break;
5252
5252
  case "t":
5253
- k = o, _ = l, w = s[s.length - 1], w.command === "Q" && (k = o + (o - w.points[0]), _ = l + (l - w.points[1])), o += p.shift(), l += p.shift(), S = "Q", C.push(k, _, o, l);
5253
+ A = o, P = l, w = s[s.length - 1], w.command === "Q" && (A = o + (o - w.points[0]), P = l + (l - w.points[1])), o += p.shift(), l += p.shift(), S = "Q", C.push(A, P, o, l);
5254
5254
  break;
5255
5255
  case "A":
5256
- O = p.shift(), A = p.shift(), M = p.shift(), D = p.shift(), z = p.shift(), B = o, Y = l, o = p.shift(), l = p.shift(), S = "A", C = this.convertEndpointToCenterParameterization(B, Y, o, l, D, z, O, A, M);
5256
+ D = p.shift(), k = p.shift(), E = p.shift(), O = p.shift(), z = p.shift(), B = o, W = l, o = p.shift(), l = p.shift(), S = "A", C = this.convertEndpointToCenterParameterization(B, W, o, l, O, z, D, k, E);
5257
5257
  break;
5258
5258
  case "a":
5259
- O = p.shift(), A = p.shift(), M = p.shift(), D = p.shift(), z = p.shift(), B = o, Y = l, o += p.shift(), l += p.shift(), S = "A", C = this.convertEndpointToCenterParameterization(B, Y, o, l, D, z, O, A, M);
5259
+ D = p.shift(), k = p.shift(), E = p.shift(), O = p.shift(), z = p.shift(), B = o, W = l, o += p.shift(), l += p.shift(), S = "A", C = this.convertEndpointToCenterParameterization(B, W, o, l, O, z, D, k, E);
5260
5260
  break;
5261
5261
  }
5262
5262
  s.push({
@@ -5280,7 +5280,7 @@ class ee extends P {
5280
5280
  }
5281
5281
  static calcLength(e, t, i, n) {
5282
5282
  let s, r, o, l;
5283
- const h = ee;
5283
+ const h = Q;
5284
5284
  switch (i) {
5285
5285
  case "L":
5286
5286
  return h.getLineLength(e, t, n[0], n[1]);
@@ -5307,22 +5307,22 @@ class ee extends P {
5307
5307
  f > 1 && (o *= Math.sqrt(f), l *= Math.sqrt(f));
5308
5308
  let p = Math.sqrt((o * o * (l * l) - o * o * (u * u) - l * l * (d * d)) / (o * o * (u * u) + l * l * (d * d)));
5309
5309
  s === r && (p *= -1), isNaN(p) && (p = 0);
5310
- const y = p * o * u / l, S = p * -l * d / o, C = (e + i) / 2 + Math.cos(c) * y - Math.sin(c) * S, T = (t + n) / 2 + Math.sin(c) * y + Math.cos(c) * S, b = function(D) {
5311
- return Math.sqrt(D[0] * D[0] + D[1] * D[1]);
5312
- }, w = function(D, z) {
5313
- return (D[0] * z[0] + D[1] * z[1]) / (b(D) * b(z));
5314
- }, k = function(D, z) {
5315
- return (D[0] * z[1] < D[1] * z[0] ? -1 : 1) * Math.acos(w(D, z));
5316
- }, _ = k([1, 0], [(d - y) / o, (u - S) / l]), O = [(d - y) / o, (u - S) / l], A = [(-1 * d - y) / o, (-1 * u - S) / l];
5317
- let M = k(O, A);
5318
- return w(O, A) <= -1 && (M = Math.PI), w(O, A) >= 1 && (M = 0), r === 0 && M > 0 && (M = M - 2 * Math.PI), r === 1 && M < 0 && (M = M + 2 * Math.PI), [C, T, o, l, _, M, c, r];
5310
+ const y = p * o * u / l, S = p * -l * d / o, C = (e + i) / 2 + Math.cos(c) * y - Math.sin(c) * S, T = (t + n) / 2 + Math.sin(c) * y + Math.cos(c) * S, b = function(O) {
5311
+ return Math.sqrt(O[0] * O[0] + O[1] * O[1]);
5312
+ }, w = function(O, z) {
5313
+ return (O[0] * z[0] + O[1] * z[1]) / (b(O) * b(z));
5314
+ }, A = function(O, z) {
5315
+ return (O[0] * z[1] < O[1] * z[0] ? -1 : 1) * Math.acos(w(O, z));
5316
+ }, P = A([1, 0], [(d - y) / o, (u - S) / l]), D = [(d - y) / o, (u - S) / l], k = [(-1 * d - y) / o, (-1 * u - S) / l];
5317
+ let E = A(D, k);
5318
+ return w(D, k) <= -1 && (E = Math.PI), w(D, k) >= 1 && (E = 0), r === 0 && E > 0 && (E = E - 2 * Math.PI), r === 1 && E < 0 && (E = E + 2 * Math.PI), [C, T, o, l, P, E, c, r];
5319
5319
  }
5320
5320
  }
5321
- ee.prototype.className = "Path";
5322
- ee.prototype._attrsAffectingSize = ["data"];
5323
- ne(ee);
5324
- m.addGetterSetter(ee, "data");
5325
- class $e extends Ie {
5321
+ Q.prototype.className = "Path";
5322
+ Q.prototype._attrsAffectingSize = ["data"];
5323
+ ne(Q);
5324
+ m.addGetterSetter(Q, "data");
5325
+ class qe extends Ie {
5326
5326
  _sceneFunc(e) {
5327
5327
  super._sceneFunc(e);
5328
5328
  const t = Math.PI * 2, i = this.points();
@@ -5339,7 +5339,7 @@ class $e extends Ie {
5339
5339
  n[n.length - 1],
5340
5340
  i[o - 2],
5341
5341
  i[o - 1]
5342
- ], f = ee.calcLength(n[n.length - 4], n[n.length - 3], "C", u), p = ee.getPointOnQuadraticBezier(Math.min(1, 1 - r / f), u[0], u[1], u[2], u[3], u[4], u[5]);
5342
+ ], f = Q.calcLength(n[n.length - 4], n[n.length - 3], "C", u), p = Q.getPointOnQuadraticBezier(Math.min(1, 1 - r / f), u[0], u[1], u[2], u[3], u[4], u[5]);
5343
5343
  l = i[o - 2] - p.x, h = i[o - 1] - p.y;
5344
5344
  } else
5345
5345
  l = i[o - 2] - i[o - 4], h = i[o - 1] - i[o - 3];
@@ -5360,13 +5360,13 @@ class $e extends Ie {
5360
5360
  };
5361
5361
  }
5362
5362
  }
5363
- $e.prototype.className = "Arrow";
5364
- ne($e);
5365
- m.addGetterSetter($e, "pointerLength", 10, I());
5366
- m.addGetterSetter($e, "pointerWidth", 10, I());
5367
- m.addGetterSetter($e, "pointerAtBeginning", !1);
5368
- m.addGetterSetter($e, "pointerAtEnding", !0);
5369
- class rt extends P {
5363
+ qe.prototype.className = "Arrow";
5364
+ ne(qe);
5365
+ m.addGetterSetter(qe, "pointerLength", 10, I());
5366
+ m.addGetterSetter(qe, "pointerWidth", 10, I());
5367
+ m.addGetterSetter(qe, "pointerAtBeginning", !1);
5368
+ m.addGetterSetter(qe, "pointerAtEnding", !0);
5369
+ class rt extends _ {
5370
5370
  _sceneFunc(e) {
5371
5371
  e.beginPath(), e.arc(0, 0, this.attrs.radius || 0, 0, Math.PI * 2, !1), e.closePath(), e.fillStrokeShape(this);
5372
5372
  }
@@ -5388,7 +5388,7 @@ rt.prototype.className = "Circle";
5388
5388
  rt.prototype._attrsAffectingSize = ["radius"];
5389
5389
  ne(rt);
5390
5390
  m.addGetterSetter(rt, "radius", 0, I());
5391
- class Be extends P {
5391
+ class Be extends _ {
5392
5392
  _sceneFunc(e) {
5393
5393
  const t = this.radiusX(), i = this.radiusY();
5394
5394
  e.beginPath(), e.save(), t !== i && e.scale(1, i / t), e.arc(0, 0, t, 0, Math.PI * 2, !1), e.restore(), e.closePath(), e.fillStrokeShape(this);
@@ -5413,7 +5413,7 @@ ne(Be);
5413
5413
  m.addComponentsGetterSetter(Be, "radius", ["x", "y"]);
5414
5414
  m.addGetterSetter(Be, "radiusX", 0, I());
5415
5415
  m.addGetterSetter(Be, "radiusY", 0, I());
5416
- let ye = class ds extends P {
5416
+ let ye = class ds extends _ {
5417
5417
  constructor(e) {
5418
5418
  super(e), this._loadListener = () => {
5419
5419
  this._requestDraw();
@@ -5556,7 +5556,7 @@ class Hi extends st {
5556
5556
  }
5557
5557
  Hi.prototype.className = "Label";
5558
5558
  ne(Hi);
5559
- class qe extends P {
5559
+ class Ke extends _ {
5560
5560
  _sceneFunc(e) {
5561
5561
  const t = this.width(), i = this.height(), n = this.pointerDirection(), s = this.pointerWidth(), r = this.pointerHeight(), o = this.cornerRadius();
5562
5562
  let l = 0, h = 0, c = 0, d = 0;
@@ -5572,13 +5572,13 @@ class qe extends P {
5572
5572
  };
5573
5573
  }
5574
5574
  }
5575
- qe.prototype.className = "Tag";
5576
- ne(qe);
5577
- m.addGetterSetter(qe, "pointerDirection", aa);
5578
- m.addGetterSetter(qe, "pointerWidth", 0, I());
5579
- m.addGetterSetter(qe, "pointerHeight", 0, I());
5580
- m.addGetterSetter(qe, "cornerRadius", 0, ei(4));
5581
- class It extends P {
5575
+ Ke.prototype.className = "Tag";
5576
+ ne(Ke);
5577
+ m.addGetterSetter(Ke, "pointerDirection", aa);
5578
+ m.addGetterSetter(Ke, "pointerWidth", 0, I());
5579
+ m.addGetterSetter(Ke, "pointerHeight", 0, I());
5580
+ m.addGetterSetter(Ke, "cornerRadius", 0, ei(4));
5581
+ class It extends _ {
5582
5582
  _sceneFunc(e) {
5583
5583
  const t = this.cornerRadius(), i = this.width(), n = this.height();
5584
5584
  e.beginPath(), t ? v.drawRoundedRectPath(e, i, n, t) : e.rect(0, 0, i, n), e.closePath(), e.fillStrokeShape(this);
@@ -5587,7 +5587,7 @@ class It extends P {
5587
5587
  It.prototype.className = "Rect";
5588
5588
  ne(It);
5589
5589
  m.addGetterSetter(It, "cornerRadius", 0, ei(4));
5590
- class Ge extends P {
5590
+ class Ge extends _ {
5591
5591
  _sceneFunc(e) {
5592
5592
  const t = this._getPoints(), i = this.radius(), n = this.sides(), s = this.cornerRadius();
5593
5593
  if (e.beginPath(), s)
@@ -5641,7 +5641,7 @@ m.addGetterSetter(Ge, "radius", 0, I());
5641
5641
  m.addGetterSetter(Ge, "sides", 0, I());
5642
5642
  m.addGetterSetter(Ge, "cornerRadius", 0, ei(4));
5643
5643
  const ln = Math.PI * 2;
5644
- class Ke extends P {
5644
+ class je extends _ {
5645
5645
  _sceneFunc(e) {
5646
5646
  e.beginPath(), e.arc(0, 0, this.innerRadius(), 0, ln, !1), e.moveTo(this.outerRadius(), 0), e.arc(0, 0, this.outerRadius(), ln, 0, !0), e.closePath(), e.fillStrokeShape(this);
5647
5647
  }
@@ -5658,13 +5658,13 @@ class Ke extends P {
5658
5658
  this.outerRadius(e / 2);
5659
5659
  }
5660
5660
  }
5661
- Ke.prototype.className = "Ring";
5662
- Ke.prototype._centroid = !0;
5663
- Ke.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
5664
- ne(Ke);
5665
- m.addGetterSetter(Ke, "innerRadius", 0, I());
5666
- m.addGetterSetter(Ke, "outerRadius", 0, I());
5667
- class be extends P {
5661
+ je.prototype.className = "Ring";
5662
+ je.prototype._centroid = !0;
5663
+ je.prototype._attrsAffectingSize = ["innerRadius", "outerRadius"];
5664
+ ne(je);
5665
+ m.addGetterSetter(je, "innerRadius", 0, I());
5666
+ m.addGetterSetter(je, "outerRadius", 0, I());
5667
+ class be extends _ {
5668
5668
  constructor(e) {
5669
5669
  super(e), this._updated = !0, this.anim = new pe(() => {
5670
5670
  const t = this._updated;
@@ -5734,7 +5734,7 @@ m.backCompat(be, {
5734
5734
  getIndex: "getFrameIndex",
5735
5735
  setIndex: "setFrameIndex"
5736
5736
  });
5737
- class He extends P {
5737
+ class He extends _ {
5738
5738
  _sceneFunc(e) {
5739
5739
  const t = this.innerRadius(), i = this.outerRadius(), n = this.numPoints();
5740
5740
  e.beginPath(), e.moveTo(0, 0 - i);
@@ -5773,7 +5773,7 @@ function Le(a) {
5773
5773
  return e;
5774
5774
  }, []);
5775
5775
  }
5776
- const Ze = "auto", la = "center", gs = "inherit", ct = "justify", ha = "Change.konva", ca = "2d", hn = "-", ps = "left", da = "text", ua = "Text", ga = "top", pa = "bottom", cn = "middle", fs = "normal", fa = "px ", Ht = " ", ma = "right", dn = "rtl", ya = "word", Sa = "char", un = "none", oi = "…", ms = [
5776
+ const Je = "auto", la = "center", gs = "inherit", ct = "justify", ha = "Change.konva", ca = "2d", hn = "-", ps = "left", da = "text", ua = "Text", ga = "top", pa = "bottom", cn = "middle", fs = "normal", fa = "px ", Ht = " ", ma = "right", dn = "rtl", ya = "word", Sa = "char", un = "none", oi = "…", ms = [
5777
5777
  "direction",
5778
5778
  "fontFamily",
5779
5779
  "fontSize",
@@ -5810,7 +5810,7 @@ function ba(a) {
5810
5810
  function wa(a) {
5811
5811
  return a = a || {}, !a.fillLinearGradientColorStops && !a.fillRadialGradientColorStops && !a.fillPatternImage && (a.fill = a.fill || "black"), a;
5812
5812
  }
5813
- class te extends P {
5813
+ class ee extends _ {
5814
5814
  constructor(e) {
5815
5815
  super(wa(e)), this._partialTextX = 0, this._partialTextY = 0;
5816
5816
  for (let t = 0; t < Ca; t++)
@@ -5822,61 +5822,61 @@ class te extends P {
5822
5822
  const n = this.textArr, s = n.length;
5823
5823
  if (!this.text())
5824
5824
  return;
5825
- let r = this.padding(), o = this.fontSize(), l = this.lineHeight() * o, h = this.verticalAlign(), c = this.direction(), d = 0, u = this.align(), f = this.getWidth(), p = this.letterSpacing(), y = this.charRenderFunc(), S = this.fill(), C = this.textDecoration(), T = this.underlineOffset(), b = C.indexOf("underline") !== -1, w = C.indexOf("line-through") !== -1, k;
5825
+ let r = this.padding(), o = this.fontSize(), l = this.lineHeight() * o, h = this.verticalAlign(), c = this.direction(), d = 0, u = this.align(), f = this.getWidth(), p = this.letterSpacing(), y = this.charRenderFunc(), S = this.fill(), C = this.textDecoration(), T = this.underlineOffset(), b = C.indexOf("underline") !== -1, w = C.indexOf("line-through") !== -1, A;
5826
5826
  c = c === gs ? e.direction : c;
5827
- let _ = l / 2, O = cn;
5828
- if (!E.legacyTextRendering) {
5829
- const A = this.measureSize("M");
5830
- O = "alphabetic";
5831
- const M = (t = A.fontBoundingBoxAscent) !== null && t !== void 0 ? t : A.actualBoundingBoxAscent, D = (i = A.fontBoundingBoxDescent) !== null && i !== void 0 ? i : A.actualBoundingBoxDescent;
5832
- _ = (M - D) / 2 + l / 2;
5833
- }
5834
- for (c === dn && e.setAttr("direction", c), e.setAttr("font", this._getContextFont()), e.setAttr("textBaseline", O), e.setAttr("textAlign", ps), h === cn ? d = (this.getHeight() - s * l - r * 2) / 2 : h === pa && (d = this.getHeight() - s * l - r * 2), e.translate(r, d + r), k = 0; k < s; k++) {
5835
- let A = 0, M = 0;
5836
- const D = n[k], z = D.text, B = D.width, Y = D.lastInParagraph;
5837
- if (e.save(), u === ma ? A += f - B - r * 2 : u === la && (A += (f - B - r * 2) / 2), b) {
5827
+ let P = l / 2, D = cn;
5828
+ if (!M.legacyTextRendering) {
5829
+ const k = this.measureSize("M");
5830
+ D = "alphabetic";
5831
+ const E = (t = k.fontBoundingBoxAscent) !== null && t !== void 0 ? t : k.actualBoundingBoxAscent, O = (i = k.fontBoundingBoxDescent) !== null && i !== void 0 ? i : k.actualBoundingBoxDescent;
5832
+ P = (E - O) / 2 + l / 2;
5833
+ }
5834
+ for (c === dn && e.setAttr("direction", c), e.setAttr("font", this._getContextFont()), e.setAttr("textBaseline", D), e.setAttr("textAlign", ps), h === cn ? d = (this.getHeight() - s * l - r * 2) / 2 : h === pa && (d = this.getHeight() - s * l - r * 2), e.translate(r, d + r), A = 0; A < s; A++) {
5835
+ let k = 0, E = 0;
5836
+ const O = n[A], z = O.text, B = O.width, W = O.lastInParagraph;
5837
+ if (e.save(), u === ma ? k += f - B - r * 2 : u === la && (k += (f - B - r * 2) / 2), b) {
5838
5838
  e.save(), e.beginPath();
5839
- const H = T ?? (E.legacyTextRendering ? Math.round(o / 2) : Math.round(o / 4)), R = A, K = _ + M + H;
5839
+ const G = T ?? (M.legacyTextRendering ? Math.round(o / 2) : Math.round(o / 4)), R = k, K = P + E + G;
5840
5840
  e.moveTo(R, K);
5841
- const G = u === ct && !Y ? f - r * 2 : B;
5842
- e.lineTo(R + Math.round(G), K), e.lineWidth = o / 15;
5843
- const U = this._getLinearGradient();
5844
- e.strokeStyle = U || S, e.stroke(), e.restore();
5841
+ const H = u === ct && !W ? f - r * 2 : B;
5842
+ e.lineTo(R + Math.round(H), K), e.lineWidth = o / 15;
5843
+ const $ = this._getLinearGradient();
5844
+ e.strokeStyle = $ || S, e.stroke(), e.restore();
5845
5845
  }
5846
- const F = A;
5846
+ const F = k;
5847
5847
  if (c !== dn && (p !== 0 || u === ct || y)) {
5848
- const H = z.split(" ").length - 1, R = Le(z);
5848
+ const G = z.split(" ").length - 1, R = Le(z);
5849
5849
  for (let K = 0; K < R.length; K++) {
5850
- const G = R[K];
5851
- if (G === " " && !Y && u === ct && (A += (f - r * 2 - B) / H), this._partialTextX = A, this._partialTextY = _ + M, this._partialText = G, y) {
5850
+ const H = R[K];
5851
+ if (H === " " && !W && u === ct && (k += (f - r * 2 - B) / G), this._partialTextX = k, this._partialTextY = P + E, this._partialText = H, y) {
5852
5852
  e.save();
5853
- const Z = n.slice(0, k).reduce((se, he) => se + Le(he.text).length, 0), q = K + Z;
5853
+ const te = n.slice(0, A).reduce((se, he) => se + Le(he.text).length, 0), Y = K + te;
5854
5854
  y({
5855
- char: G,
5856
- index: q,
5857
- x: A,
5858
- y: _ + M,
5859
- lineIndex: k,
5855
+ char: H,
5856
+ index: Y,
5857
+ x: k,
5858
+ y: P + E,
5859
+ lineIndex: A,
5860
5860
  column: K,
5861
- isLastInLine: Y,
5862
- width: this.measureSize(G).width,
5861
+ isLastInLine: W,
5862
+ width: this.measureSize(H).width,
5863
5863
  context: e
5864
5864
  });
5865
5865
  }
5866
- e.fillStrokeShape(this), y && e.restore(), A += this.measureSize(G).width + p;
5866
+ e.fillStrokeShape(this), y && e.restore(), k += this.measureSize(H).width + p;
5867
5867
  }
5868
5868
  } else
5869
- p !== 0 && e.setAttr("letterSpacing", `${p}px`), this._partialTextX = A, this._partialTextY = _ + M, this._partialText = z, e.fillStrokeShape(this);
5869
+ p !== 0 && e.setAttr("letterSpacing", `${p}px`), this._partialTextX = k, this._partialTextY = P + E, this._partialText = z, e.fillStrokeShape(this);
5870
5870
  if (w) {
5871
5871
  e.save(), e.beginPath();
5872
- const H = E.legacyTextRendering ? 0 : -Math.round(o / 4), R = F;
5873
- e.moveTo(R, _ + M + H);
5874
- const K = u === ct && !Y ? f - r * 2 : B;
5875
- e.lineTo(R + Math.round(K), _ + M + H), e.lineWidth = o / 15;
5876
- const G = this._getLinearGradient();
5877
- e.strokeStyle = G || S, e.stroke(), e.restore();
5872
+ const G = M.legacyTextRendering ? 0 : -Math.round(o / 4), R = F;
5873
+ e.moveTo(R, P + E + G);
5874
+ const K = u === ct && !W ? f - r * 2 : B;
5875
+ e.lineTo(R + Math.round(K), P + E + G), e.lineWidth = o / 15;
5876
+ const H = this._getLinearGradient();
5877
+ e.strokeStyle = H || S, e.stroke(), e.restore();
5878
5878
  }
5879
- e.restore(), s > 1 && (_ += l);
5879
+ e.restore(), s > 1 && (P += l);
5880
5880
  }
5881
5881
  }
5882
5882
  _hitFunc(e) {
@@ -5888,10 +5888,10 @@ class te extends P {
5888
5888
  return this._setAttr(da, t), this;
5889
5889
  }
5890
5890
  getWidth() {
5891
- return this.attrs.width === Ze || this.attrs.width === void 0 ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;
5891
+ return this.attrs.width === Je || this.attrs.width === void 0 ? this.getTextWidth() + this.padding() * 2 : this.attrs.width;
5892
5892
  }
5893
5893
  getHeight() {
5894
- return this.attrs.height === Ze || this.attrs.height === void 0 ? this.fontSize() * this.textArr.length * this.lineHeight() + this.padding() * 2 : this.attrs.height;
5894
+ return this.attrs.height === Je || this.attrs.height === void 0 ? this.fontSize() * this.textArr.length * this.lineHeight() + this.padding() * 2 : this.attrs.height;
5895
5895
  }
5896
5896
  getTextWidth() {
5897
5897
  return this.textWidth;
@@ -5938,54 +5938,54 @@ class te extends P {
5938
5938
  }
5939
5939
  _setTextData() {
5940
5940
  let e = this.text().split(`
5941
- `), t = +this.fontSize(), i = 0, n = this.lineHeight() * t, s = this.attrs.width, r = this.attrs.height, o = s !== Ze && s !== void 0, l = r !== Ze && r !== void 0, h = this.padding(), c = s - h * 2, d = r - h * 2, u = 0, f = this.wrap(), p = f !== un, y = f !== Sa && p, S = this.ellipsis();
5941
+ `), t = +this.fontSize(), i = 0, n = this.lineHeight() * t, s = this.attrs.width, r = this.attrs.height, o = s !== Je && s !== void 0, l = r !== Je && r !== void 0, h = this.padding(), c = s - h * 2, d = r - h * 2, u = 0, f = this.wrap(), p = f !== un, y = f !== Sa && p, S = this.ellipsis();
5942
5942
  this.textArr = [], li().font = this._getContextFont();
5943
5943
  const C = S ? this._getTextWidth(oi) : 0;
5944
5944
  for (let T = 0, b = e.length; T < b; ++T) {
5945
- let w = e[T], k = this._getTextWidth(w);
5946
- if (o && k > c)
5945
+ let w = e[T], A = this._getTextWidth(w);
5946
+ if (o && A > c)
5947
5947
  for (; w.length > 0; ) {
5948
- let _ = 0, O = Le(w).length, A = "", M = 0;
5949
- for (; _ < O; ) {
5950
- const D = _ + O >>> 1, z = Le(w), B = z.slice(0, D + 1).join(""), Y = this._getTextWidth(B);
5951
- (S && l && u + n > d ? Y + C : Y) <= c ? (_ = D + 1, A = B, M = Y) : O = D;
5948
+ let P = 0, D = Le(w).length, k = "", E = 0;
5949
+ for (; P < D; ) {
5950
+ const O = P + D >>> 1, z = Le(w), B = z.slice(0, O + 1).join(""), W = this._getTextWidth(B);
5951
+ (S && l && u + n > d ? W + C : W) <= c ? (P = O + 1, k = B, E = W) : D = O;
5952
5952
  }
5953
- if (A) {
5953
+ if (k) {
5954
5954
  if (y) {
5955
- const B = Le(w), Y = Le(A), F = B[Y.length], H = F === Ht || F === hn;
5955
+ const B = Le(w), W = Le(k), F = B[W.length], G = F === Ht || F === hn;
5956
5956
  let R;
5957
- if (H && M <= c)
5958
- R = Y.length;
5957
+ if (G && E <= c)
5958
+ R = W.length;
5959
5959
  else {
5960
- const K = Y.lastIndexOf(Ht), G = Y.lastIndexOf(hn);
5961
- R = Math.max(K, G) + 1;
5960
+ const K = W.lastIndexOf(Ht), H = W.lastIndexOf(hn);
5961
+ R = Math.max(K, H) + 1;
5962
5962
  }
5963
- R > 0 && (_ = R, A = B.slice(0, _).join(""), M = this._getTextWidth(A));
5963
+ R > 0 && (P = R, k = B.slice(0, P).join(""), E = this._getTextWidth(k));
5964
5964
  }
5965
- if (A = A.trimRight(), this._addTextLine(A), i = Math.max(i, M), u += n, this._shouldHandleEllipsis(u)) {
5965
+ if (k = k.trimRight(), this._addTextLine(k), i = Math.max(i, E), u += n, this._shouldHandleEllipsis(u)) {
5966
5966
  this._tryToAddEllipsisToLastLine();
5967
5967
  break;
5968
5968
  }
5969
- if (w = Le(w).slice(_).join("").trimLeft(), w.length > 0 && (k = this._getTextWidth(w), k <= c)) {
5970
- this._addTextLine(w), u += n, i = Math.max(i, k);
5969
+ if (w = Le(w).slice(P).join("").trimLeft(), w.length > 0 && (A = this._getTextWidth(w), A <= c)) {
5970
+ this._addTextLine(w), u += n, i = Math.max(i, A);
5971
5971
  break;
5972
5972
  }
5973
5973
  } else
5974
5974
  break;
5975
5975
  }
5976
5976
  else
5977
- this._addTextLine(w), u += n, i = Math.max(i, k), this._shouldHandleEllipsis(u) && T < b - 1 && this._tryToAddEllipsisToLastLine();
5977
+ this._addTextLine(w), u += n, i = Math.max(i, A), this._shouldHandleEllipsis(u) && T < b - 1 && this._tryToAddEllipsisToLastLine();
5978
5978
  if (this.textArr[this.textArr.length - 1] && (this.textArr[this.textArr.length - 1].lastInParagraph = !0), l && u + n > d)
5979
5979
  break;
5980
5980
  }
5981
5981
  this.textHeight = t, this.textWidth = i;
5982
5982
  }
5983
5983
  _shouldHandleEllipsis(e) {
5984
- const t = +this.fontSize(), i = this.lineHeight() * t, n = this.attrs.height, s = n !== Ze && n !== void 0, r = this.padding(), o = n - r * 2;
5984
+ const t = +this.fontSize(), i = this.lineHeight() * t, n = this.attrs.height, s = n !== Je && n !== void 0, r = this.padding(), o = n - r * 2;
5985
5985
  return !(this.wrap() !== un) || s && e + i > o;
5986
5986
  }
5987
5987
  _tryToAddEllipsisToLastLine() {
5988
- const e = this.attrs.width, t = e !== Ze && e !== void 0, i = this.padding(), n = e - i * 2, s = this.ellipsis(), r = this.textArr[this.textArr.length - 1];
5988
+ const e = this.attrs.width, t = e !== Je && e !== void 0, i = this.padding(), n = e - i * 2, s = this.ellipsis(), r = this.textArr[this.textArr.length - 1];
5989
5989
  !r || !s || (t && (this._getTextWidth(r.text + oi) < n || (r.text = r.text.slice(0, r.text.length - 3))), this.textArr.splice(this.textArr.length - 1, 1), this._addTextLine(r.text + oi));
5990
5990
  }
5991
5991
  getStrokeScaleEnabled() {
@@ -5996,10 +5996,10 @@ class te extends P {
5996
5996
  return e && t ? !0 : super._useBufferCanvas();
5997
5997
  }
5998
5998
  }
5999
- te.prototype._fillFunc = Ta;
6000
- te.prototype._strokeFunc = ba;
6001
- te.prototype.className = ua;
6002
- te.prototype._attrsAffectingSize = [
5999
+ ee.prototype._fillFunc = Ta;
6000
+ ee.prototype._strokeFunc = ba;
6001
+ ee.prototype.className = ua;
6002
+ ee.prototype._attrsAffectingSize = [
6003
6003
  "text",
6004
6004
  "fontSize",
6005
6005
  "padding",
@@ -6007,25 +6007,25 @@ te.prototype._attrsAffectingSize = [
6007
6007
  "lineHeight",
6008
6008
  "letterSpacing"
6009
6009
  ];
6010
- ne(te);
6011
- m.overWriteSetter(te, "width", Oi());
6012
- m.overWriteSetter(te, "height", Oi());
6013
- m.addGetterSetter(te, "direction", gs);
6014
- m.addGetterSetter(te, "fontFamily", "Arial");
6015
- m.addGetterSetter(te, "fontSize", 12, I());
6016
- m.addGetterSetter(te, "fontStyle", fs);
6017
- m.addGetterSetter(te, "fontVariant", fs);
6018
- m.addGetterSetter(te, "padding", 0, I());
6019
- m.addGetterSetter(te, "align", ps);
6020
- m.addGetterSetter(te, "verticalAlign", ga);
6021
- m.addGetterSetter(te, "lineHeight", 1, I());
6022
- m.addGetterSetter(te, "wrap", ya);
6023
- m.addGetterSetter(te, "ellipsis", !1, me());
6024
- m.addGetterSetter(te, "letterSpacing", 0, I());
6025
- m.addGetterSetter(te, "text", "", Xe());
6026
- m.addGetterSetter(te, "textDecoration", "");
6027
- m.addGetterSetter(te, "underlineOffset", void 0, I());
6028
- m.addGetterSetter(te, "charRenderFunc", void 0);
6010
+ ne(ee);
6011
+ m.overWriteSetter(ee, "width", Oi());
6012
+ m.overWriteSetter(ee, "height", Oi());
6013
+ m.addGetterSetter(ee, "direction", gs);
6014
+ m.addGetterSetter(ee, "fontFamily", "Arial");
6015
+ m.addGetterSetter(ee, "fontSize", 12, I());
6016
+ m.addGetterSetter(ee, "fontStyle", fs);
6017
+ m.addGetterSetter(ee, "fontVariant", fs);
6018
+ m.addGetterSetter(ee, "padding", 0, I());
6019
+ m.addGetterSetter(ee, "align", ps);
6020
+ m.addGetterSetter(ee, "verticalAlign", ga);
6021
+ m.addGetterSetter(ee, "lineHeight", 1, I());
6022
+ m.addGetterSetter(ee, "wrap", ya);
6023
+ m.addGetterSetter(ee, "ellipsis", !1, me());
6024
+ m.addGetterSetter(ee, "letterSpacing", 0, I());
6025
+ m.addGetterSetter(ee, "text", "", Ue());
6026
+ m.addGetterSetter(ee, "textDecoration", "");
6027
+ m.addGetterSetter(ee, "underlineOffset", void 0, I());
6028
+ m.addGetterSetter(ee, "charRenderFunc", void 0);
6029
6029
  const ka = "", ys = "normal";
6030
6030
  function Ss(a) {
6031
6031
  a.fillText(this.partialText, 0, 0);
@@ -6033,23 +6033,23 @@ function Ss(a) {
6033
6033
  function Cs(a) {
6034
6034
  a.strokeText(this.partialText, 0, 0);
6035
6035
  }
6036
- class re extends P {
6036
+ class re extends _ {
6037
6037
  constructor(e) {
6038
6038
  super(e), this.dummyCanvas = v.createCanvasElement(), this.dataArray = [], this._readDataAttribute(), this.on("dataChange.konva", function() {
6039
6039
  this._readDataAttribute(), this._setTextData();
6040
6040
  }), this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva", this._setTextData), this._setTextData();
6041
6041
  }
6042
6042
  _getTextPathLength() {
6043
- return ee.getPathLength(this.dataArray);
6043
+ return Q.getPathLength(this.dataArray);
6044
6044
  }
6045
6045
  _getPointAtLength(e) {
6046
6046
  if (!this.attrs.data)
6047
6047
  return null;
6048
6048
  const t = this.pathLength;
6049
- return e > t ? null : ee.getPointAtLengthOfDataArray(e, this.dataArray);
6049
+ return e > t ? null : Q.getPointAtLengthOfDataArray(e, this.dataArray);
6050
6050
  }
6051
6051
  _readDataAttribute() {
6052
- this.dataArray = ee.parsePathData(this.attrs.data), this.pathLength = this._getTextPathLength();
6052
+ this.dataArray = Q.parsePathData(this.attrs.data), this.pathLength = this._getTextPathLength();
6053
6053
  }
6054
6054
  _sceneFunc(e) {
6055
6055
  e.setAttr("font", this._getContextFont()), e.setAttr("textBaseline", this.textBaseline()), e.setAttr("textAlign", "left"), e.save();
@@ -6091,10 +6091,10 @@ class re extends P {
6091
6091
  return v.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."), this.textHeight;
6092
6092
  }
6093
6093
  setText(e) {
6094
- return te.prototype.setText.call(this, e);
6094
+ return ee.prototype.setText.call(this, e);
6095
6095
  }
6096
6096
  _getContextFont() {
6097
- return te.prototype._getContextFont.call(this);
6097
+ return ee.prototype._getContextFont.call(this);
6098
6098
  }
6099
6099
  _getTextSize(e) {
6100
6100
  const i = this.dummyCanvas.getContext("2d");
@@ -6133,7 +6133,7 @@ class re extends P {
6133
6133
  const y = this._getPointAtLength(c + p);
6134
6134
  if (!y)
6135
6135
  return;
6136
- const S = ee.getLineLength(u.x, u.y, y.x, y.y);
6136
+ const S = Q.getLineLength(u.x, u.y, y.x, y.y);
6137
6137
  let C = 0;
6138
6138
  if (o)
6139
6139
  try {
@@ -6142,7 +6142,7 @@ class re extends P {
6142
6142
  C = 0;
6143
6143
  }
6144
6144
  u.x += C, y.x += C, this.textWidth += C;
6145
- const T = ee.getPointOnLine(C + S / 2, u.x, u.y, y.x, y.y), b = Math.atan2(y.y - u.y, y.x - u.x);
6145
+ const T = Q.getPointOnLine(C + S / 2, u.x, u.y, y.x, y.y), b = Math.atan2(y.y - u.y, y.x - u.x);
6146
6146
  this.glyphInfo.push({
6147
6147
  transposeX: T.x,
6148
6148
  transposeY: T.y,
@@ -6238,7 +6238,7 @@ const vs = "tr-konva", Pa = [
6238
6238
  "bottom-left": -135,
6239
6239
  "bottom-center": 180,
6240
6240
  "bottom-right": 135
6241
- }, Ia = "ontouchstart" in E._global;
6241
+ }, Ia = "ontouchstart" in M._global;
6242
6242
  function Aa(a, e, t) {
6243
6243
  if (a === "rotater")
6244
6244
  return t;
@@ -6278,13 +6278,13 @@ function Ma(a, e) {
6278
6278
  function La(a, e, t) {
6279
6279
  let i = e;
6280
6280
  for (let n = 0; n < a.length; n++) {
6281
- const s = E.getAngle(a[n]), r = Math.abs(s - e) % (Math.PI * 2);
6281
+ const s = M.getAngle(a[n]), r = Math.abs(s - e) % (Math.PI * 2);
6282
6282
  Math.min(r, Math.PI * 2 - r) < t && (i = s);
6283
6283
  }
6284
6284
  return i;
6285
6285
  }
6286
6286
  let xi = 0;
6287
- class W extends st {
6287
+ class X extends st {
6288
6288
  constructor(e) {
6289
6289
  super(e), this._movingAnchorName = null, this._transforming = !1, this._createElements(), this._handleMouseMove = this._handleMouseMove.bind(this), this._handleMouseUp = this._handleMouseUp.bind(this), this.update = this.update.bind(this), this.on(Pa, this.update), this.getNode() && this.update();
6290
6290
  }
@@ -6355,14 +6355,14 @@ class W extends st {
6355
6355
  skipTransform: !0,
6356
6356
  skipShadow: !0,
6357
6357
  skipStroke: this.ignoreStroke()
6358
- }), s = e.getAbsoluteScale(i), r = e.getAbsolutePosition(i), o = n.x * s.x - e.offsetX() * s.x, l = n.y * s.y - e.offsetY() * s.y, h = (E.getAngle(e.getAbsoluteRotation()) + Math.PI * 2) % (Math.PI * 2), c = {
6358
+ }), s = e.getAbsoluteScale(i), r = e.getAbsolutePosition(i), o = n.x * s.x - e.offsetX() * s.x, l = n.y * s.y - e.offsetY() * s.y, h = (M.getAngle(e.getAbsoluteRotation()) + Math.PI * 2) % (Math.PI * 2), c = {
6359
6359
  x: r.x + o * Math.cos(h) + l * Math.sin(-h),
6360
6360
  y: r.y + l * Math.cos(h) + o * Math.sin(h),
6361
6361
  width: n.width * s.x,
6362
6362
  height: n.height * s.y,
6363
6363
  rotation: h
6364
6364
  };
6365
- return Ts(c, -E.getAngle(t), {
6365
+ return Ts(c, -M.getAngle(t), {
6366
6366
  x: 0,
6367
6367
  y: 0
6368
6368
  });
@@ -6394,7 +6394,7 @@ class W extends st {
6394
6394
  });
6395
6395
  });
6396
6396
  const i = new de();
6397
- i.rotate(-E.getAngle(this.rotation()));
6397
+ i.rotate(-M.getAngle(this.rotation()));
6398
6398
  let n = 1 / 0, s = 1 / 0, r = -1 / 0, o = -1 / 0;
6399
6399
  t.forEach(function(h) {
6400
6400
  const c = i.point(h);
@@ -6406,7 +6406,7 @@ class W extends st {
6406
6406
  y: l.y,
6407
6407
  width: r - n,
6408
6408
  height: o - s,
6409
- rotation: E.getAngle(this.rotation())
6409
+ rotation: M.getAngle(this.rotation())
6410
6410
  };
6411
6411
  }
6412
6412
  getX() {
@@ -6443,14 +6443,14 @@ class W extends st {
6443
6443
  }), t.on("dragend", (n) => {
6444
6444
  n.cancelBubble = !0;
6445
6445
  }), t.on("mouseenter", () => {
6446
- const n = E.getAngle(this.rotation()), s = this.rotateAnchorCursor(), r = Aa(e, n, s);
6446
+ const n = M.getAngle(this.rotation()), s = this.rotateAnchorCursor(), r = Aa(e, n, s);
6447
6447
  t.getStage().content && (t.getStage().content.style.cursor = r), this._cursorChange = !0;
6448
6448
  }), t.on("mouseout", () => {
6449
6449
  t.getStage().content && (t.getStage().content.style.cursor = ""), this._cursorChange = !1;
6450
6450
  }), this.add(t);
6451
6451
  }
6452
6452
  _createBack() {
6453
- const e = new P({
6453
+ const e = new _({
6454
6454
  name: "back",
6455
6455
  width: 0,
6456
6456
  height: 0,
@@ -6513,11 +6513,11 @@ class W extends st {
6513
6513
  if (this._movingAnchorName === "rotater") {
6514
6514
  const T = this._getNodeRect();
6515
6515
  t = s.x() - T.width / 2, i = -s.y() + T.height / 2;
6516
- const b = E.getAngle(this.rotateAnchorAngle());
6516
+ const b = M.getAngle(this.rotateAnchorAngle());
6517
6517
  let w = Math.atan2(-i, t) + Math.PI / 2 - b;
6518
6518
  T.height < 0 && (w -= Math.PI);
6519
- const _ = E.getAngle(this.rotation()) + w, O = E.getAngle(this.rotationSnapTolerance()), M = La(this.rotationSnaps(), _, O) - T.rotation, D = Ma(T, M);
6520
- this._fitNodesInto(D, e);
6519
+ const P = M.getAngle(this.rotation()) + w, D = M.getAngle(this.rotationSnapTolerance()), E = La(this.rotationSnaps(), P, D) - T.rotation, O = Ma(T, E);
6520
+ this._fitNodesInto(O, e);
6521
6521
  return;
6522
6522
  }
6523
6523
  const d = this.shiftBehavior();
@@ -6590,13 +6590,13 @@ class W extends st {
6590
6590
  } else
6591
6591
  console.error(new Error("Wrong position argument of selection resizer: " + this._movingAnchorName));
6592
6592
  if (f = this.centeredScaling() || e.altKey, f) {
6593
- const T = this.findOne(".top-left"), b = this.findOne(".bottom-right"), w = T.x(), k = T.y(), _ = this.getWidth() - b.x(), O = this.getHeight() - b.y();
6593
+ const T = this.findOne(".top-left"), b = this.findOne(".bottom-right"), w = T.x(), A = T.y(), P = this.getWidth() - b.x(), D = this.getHeight() - b.y();
6594
6594
  b.move({
6595
6595
  x: -w,
6596
- y: -k
6596
+ y: -A
6597
6597
  }), T.move({
6598
- x: _,
6599
- y: O
6598
+ x: P,
6599
+ y: D
6600
6600
  });
6601
6601
  }
6602
6602
  const y = this.findOne(".top-left").getAbsolutePosition();
@@ -6607,7 +6607,7 @@ class W extends st {
6607
6607
  y: i,
6608
6608
  width: S,
6609
6609
  height: C,
6610
- rotation: E.getAngle(this.rotation())
6610
+ rotation: M.getAngle(this.rotation())
6611
6611
  }, e);
6612
6612
  }
6613
6613
  _handleMouseUp(e) {
@@ -6638,7 +6638,7 @@ class W extends st {
6638
6638
  return;
6639
6639
  }
6640
6640
  const s = new de();
6641
- if (s.rotate(E.getAngle(this.rotation())), this._movingAnchorName && e.width < 0 && this._movingAnchorName.indexOf("left") >= 0) {
6641
+ if (s.rotate(M.getAngle(this.rotation())), this._movingAnchorName && e.width < 0 && this._movingAnchorName.indexOf("left") >= 0) {
6642
6642
  const u = s.point({
6643
6643
  x: -this.padding() * 2,
6644
6644
  y: 0
@@ -6698,8 +6698,8 @@ class W extends st {
6698
6698
  const t = this._getNodeRect();
6699
6699
  this.rotation(v._getRotation(t.rotation));
6700
6700
  const i = t.width, n = t.height, s = this.enabledAnchors(), r = this.resizeEnabled(), o = this.padding(), l = this.anchorSize(), h = this.find("._anchor");
6701
- h.forEach((_) => {
6702
- _.setAttrs({
6701
+ h.forEach((P) => {
6702
+ P.setAttrs({
6703
6703
  width: l,
6704
6704
  height: l,
6705
6705
  offsetX: l / 2,
@@ -6769,13 +6769,13 @@ class W extends st {
6769
6769
  stroke: this.borderStroke(),
6770
6770
  strokeWidth: this.borderStrokeWidth(),
6771
6771
  dash: this.borderDash(),
6772
- draggable: this.nodes().some((_) => _.draggable()),
6772
+ draggable: this.nodes().some((P) => P.draggable()),
6773
6773
  x: 0,
6774
6774
  y: 0
6775
6775
  });
6776
- const k = this.anchorStyleFunc();
6777
- k && h.forEach((_) => {
6778
- k(_);
6776
+ const A = this.anchorStyleFunc();
6777
+ A && h.forEach((P) => {
6778
+ A(P);
6779
6779
  }), (e = this.getLayer()) === null || e === void 0 || e.batchDraw();
6780
6780
  }
6781
6781
  isTransforming() {
@@ -6801,53 +6801,53 @@ class W extends st {
6801
6801
  return this.nodes().length > 0 ? super.getClientRect() : { x: 0, y: 0, width: 0, height: 0 };
6802
6802
  }
6803
6803
  }
6804
- W.isTransforming = () => xi > 0;
6804
+ X.isTransforming = () => xi > 0;
6805
6805
  function Ra(a) {
6806
6806
  return a instanceof Array || v.warn("enabledAnchors value should be an array"), a instanceof Array && a.forEach(function(e) {
6807
6807
  Zt.indexOf(e) === -1 && v.warn("Unknown anchor name: " + e + ". Available names are: " + Zt.join(", "));
6808
6808
  }), a || [];
6809
6809
  }
6810
- W.prototype.className = "Transformer";
6811
- ne(W);
6812
- m.addGetterSetter(W, "enabledAnchors", Zt, Ra);
6813
- m.addGetterSetter(W, "flipEnabled", !0, me());
6814
- m.addGetterSetter(W, "resizeEnabled", !0);
6815
- m.addGetterSetter(W, "anchorSize", 10, I());
6816
- m.addGetterSetter(W, "rotateEnabled", !0);
6817
- m.addGetterSetter(W, "rotateLineVisible", !0);
6818
- m.addGetterSetter(W, "rotationSnaps", []);
6819
- m.addGetterSetter(W, "rotateAnchorOffset", 50, I());
6820
- m.addGetterSetter(W, "rotateAnchorAngle", 0, I());
6821
- m.addGetterSetter(W, "rotateAnchorCursor", "crosshair");
6822
- m.addGetterSetter(W, "rotationSnapTolerance", 5, I());
6823
- m.addGetterSetter(W, "borderEnabled", !0);
6824
- m.addGetterSetter(W, "anchorStroke", "rgb(0, 161, 255)");
6825
- m.addGetterSetter(W, "anchorStrokeWidth", 1, I());
6826
- m.addGetterSetter(W, "anchorFill", "white");
6827
- m.addGetterSetter(W, "anchorCornerRadius", 0, I());
6828
- m.addGetterSetter(W, "borderStroke", "rgb(0, 161, 255)");
6829
- m.addGetterSetter(W, "borderStrokeWidth", 1, I());
6830
- m.addGetterSetter(W, "borderDash");
6831
- m.addGetterSetter(W, "keepRatio", !0);
6832
- m.addGetterSetter(W, "shiftBehavior", "default");
6833
- m.addGetterSetter(W, "centeredScaling", !1);
6834
- m.addGetterSetter(W, "ignoreStroke", !1);
6835
- m.addGetterSetter(W, "padding", 0, I());
6836
- m.addGetterSetter(W, "nodes");
6837
- m.addGetterSetter(W, "node");
6838
- m.addGetterSetter(W, "boundBoxFunc");
6839
- m.addGetterSetter(W, "anchorDragBoundFunc");
6840
- m.addGetterSetter(W, "anchorStyleFunc");
6841
- m.addGetterSetter(W, "shouldOverdrawWholeArea", !1);
6842
- m.addGetterSetter(W, "useSingleNodeRotation", !0);
6843
- m.backCompat(W, {
6810
+ X.prototype.className = "Transformer";
6811
+ ne(X);
6812
+ m.addGetterSetter(X, "enabledAnchors", Zt, Ra);
6813
+ m.addGetterSetter(X, "flipEnabled", !0, me());
6814
+ m.addGetterSetter(X, "resizeEnabled", !0);
6815
+ m.addGetterSetter(X, "anchorSize", 10, I());
6816
+ m.addGetterSetter(X, "rotateEnabled", !0);
6817
+ m.addGetterSetter(X, "rotateLineVisible", !0);
6818
+ m.addGetterSetter(X, "rotationSnaps", []);
6819
+ m.addGetterSetter(X, "rotateAnchorOffset", 50, I());
6820
+ m.addGetterSetter(X, "rotateAnchorAngle", 0, I());
6821
+ m.addGetterSetter(X, "rotateAnchorCursor", "crosshair");
6822
+ m.addGetterSetter(X, "rotationSnapTolerance", 5, I());
6823
+ m.addGetterSetter(X, "borderEnabled", !0);
6824
+ m.addGetterSetter(X, "anchorStroke", "rgb(0, 161, 255)");
6825
+ m.addGetterSetter(X, "anchorStrokeWidth", 1, I());
6826
+ m.addGetterSetter(X, "anchorFill", "white");
6827
+ m.addGetterSetter(X, "anchorCornerRadius", 0, I());
6828
+ m.addGetterSetter(X, "borderStroke", "rgb(0, 161, 255)");
6829
+ m.addGetterSetter(X, "borderStrokeWidth", 1, I());
6830
+ m.addGetterSetter(X, "borderDash");
6831
+ m.addGetterSetter(X, "keepRatio", !0);
6832
+ m.addGetterSetter(X, "shiftBehavior", "default");
6833
+ m.addGetterSetter(X, "centeredScaling", !1);
6834
+ m.addGetterSetter(X, "ignoreStroke", !1);
6835
+ m.addGetterSetter(X, "padding", 0, I());
6836
+ m.addGetterSetter(X, "nodes");
6837
+ m.addGetterSetter(X, "node");
6838
+ m.addGetterSetter(X, "boundBoxFunc");
6839
+ m.addGetterSetter(X, "anchorDragBoundFunc");
6840
+ m.addGetterSetter(X, "anchorStyleFunc");
6841
+ m.addGetterSetter(X, "shouldOverdrawWholeArea", !1);
6842
+ m.addGetterSetter(X, "useSingleNodeRotation", !0);
6843
+ m.backCompat(X, {
6844
6844
  lineEnabled: "borderEnabled",
6845
6845
  rotateHandlerOffset: "rotateAnchorOffset",
6846
6846
  enabledHandlers: "enabledAnchors"
6847
6847
  });
6848
- class Ae extends P {
6848
+ class Ae extends _ {
6849
6849
  _sceneFunc(e) {
6850
- e.beginPath(), e.arc(0, 0, this.radius(), 0, E.getAngle(this.angle()), this.clockwise()), e.lineTo(0, 0), e.closePath(), e.fillStrokeShape(this);
6850
+ e.beginPath(), e.arc(0, 0, this.radius(), 0, M.getAngle(this.angle()), this.clockwise()), e.lineTo(0, 0), e.closePath(), e.fillStrokeShape(this);
6851
6851
  }
6852
6852
  getWidth() {
6853
6853
  return this.radius() * 2;
@@ -7392,33 +7392,33 @@ const Da = [
7392
7392
  ];
7393
7393
  function Ba(a, e) {
7394
7394
  const t = a.data, i = a.width, n = a.height;
7395
- let s, r, o, l, h, c, d, u, f, p, y, S, C, T, b, w, k, _, O, A;
7396
- const M = e + e + 1, D = i - 1, z = n - 1, B = e + 1, Y = B * (B + 1) / 2, F = new pn(), H = Da[e], R = Oa[e];
7397
- let K = null, G = F, U = null, Z = null;
7398
- for (let q = 1; q < M; q++)
7399
- G = G.next = new pn(), q === B && (K = G);
7400
- G.next = F, o = r = 0;
7401
- for (let q = 0; q < n; q++) {
7402
- S = C = T = b = l = h = c = d = 0, u = B * (w = t[r]), f = B * (k = t[r + 1]), p = B * (_ = t[r + 2]), y = B * (O = t[r + 3]), l += Y * w, h += Y * k, c += Y * _, d += Y * O, G = F;
7395
+ let s, r, o, l, h, c, d, u, f, p, y, S, C, T, b, w, A, P, D, k;
7396
+ const E = e + e + 1, O = i - 1, z = n - 1, B = e + 1, W = B * (B + 1) / 2, F = new pn(), G = Da[e], R = Oa[e];
7397
+ let K = null, H = F, $ = null, te = null;
7398
+ for (let Y = 1; Y < E; Y++)
7399
+ H = H.next = new pn(), Y === B && (K = H);
7400
+ H.next = F, o = r = 0;
7401
+ for (let Y = 0; Y < n; Y++) {
7402
+ S = C = T = b = l = h = c = d = 0, u = B * (w = t[r]), f = B * (A = t[r + 1]), p = B * (P = t[r + 2]), y = B * (D = t[r + 3]), l += W * w, h += W * A, c += W * P, d += W * D, H = F;
7403
7403
  for (let se = 0; se < B; se++)
7404
- G.r = w, G.g = k, G.b = _, G.a = O, G = G.next;
7404
+ H.r = w, H.g = A, H.b = P, H.a = D, H = H.next;
7405
7405
  for (let se = 1; se < B; se++)
7406
- s = r + ((D < se ? D : se) << 2), l += (G.r = w = t[s]) * (A = B - se), h += (G.g = k = t[s + 1]) * A, c += (G.b = _ = t[s + 2]) * A, d += (G.a = O = t[s + 3]) * A, S += w, C += k, T += _, b += O, G = G.next;
7407
- U = F, Z = K;
7406
+ s = r + ((O < se ? O : se) << 2), l += (H.r = w = t[s]) * (k = B - se), h += (H.g = A = t[s + 1]) * k, c += (H.b = P = t[s + 2]) * k, d += (H.a = D = t[s + 3]) * k, S += w, C += A, T += P, b += D, H = H.next;
7407
+ $ = F, te = K;
7408
7408
  for (let se = 0; se < i; se++)
7409
- t[r + 3] = O = d * H >> R, O !== 0 ? (O = 255 / O, t[r] = (l * H >> R) * O, t[r + 1] = (h * H >> R) * O, t[r + 2] = (c * H >> R) * O) : t[r] = t[r + 1] = t[r + 2] = 0, l -= u, h -= f, c -= p, d -= y, u -= U.r, f -= U.g, p -= U.b, y -= U.a, s = o + ((s = se + e + 1) < D ? s : D) << 2, S += U.r = t[s], C += U.g = t[s + 1], T += U.b = t[s + 2], b += U.a = t[s + 3], l += S, h += C, c += T, d += b, U = U.next, u += w = Z.r, f += k = Z.g, p += _ = Z.b, y += O = Z.a, S -= w, C -= k, T -= _, b -= O, Z = Z.next, r += 4;
7409
+ t[r + 3] = D = d * G >> R, D !== 0 ? (D = 255 / D, t[r] = (l * G >> R) * D, t[r + 1] = (h * G >> R) * D, t[r + 2] = (c * G >> R) * D) : t[r] = t[r + 1] = t[r + 2] = 0, l -= u, h -= f, c -= p, d -= y, u -= $.r, f -= $.g, p -= $.b, y -= $.a, s = o + ((s = se + e + 1) < O ? s : O) << 2, S += $.r = t[s], C += $.g = t[s + 1], T += $.b = t[s + 2], b += $.a = t[s + 3], l += S, h += C, c += T, d += b, $ = $.next, u += w = te.r, f += A = te.g, p += P = te.b, y += D = te.a, S -= w, C -= A, T -= P, b -= D, te = te.next, r += 4;
7410
7410
  o += i;
7411
7411
  }
7412
- for (let q = 0; q < i; q++) {
7413
- C = T = b = S = h = c = d = l = 0, r = q << 2, u = B * (w = t[r]), f = B * (k = t[r + 1]), p = B * (_ = t[r + 2]), y = B * (O = t[r + 3]), l += Y * w, h += Y * k, c += Y * _, d += Y * O, G = F;
7412
+ for (let Y = 0; Y < i; Y++) {
7413
+ C = T = b = S = h = c = d = l = 0, r = Y << 2, u = B * (w = t[r]), f = B * (A = t[r + 1]), p = B * (P = t[r + 2]), y = B * (D = t[r + 3]), l += W * w, h += W * A, c += W * P, d += W * D, H = F;
7414
7414
  for (let he = 0; he < B; he++)
7415
- G.r = w, G.g = k, G.b = _, G.a = O, G = G.next;
7415
+ H.r = w, H.g = A, H.b = P, H.a = D, H = H.next;
7416
7416
  let se = i;
7417
7417
  for (let he = 1; he <= e; he++)
7418
- r = se + q << 2, l += (G.r = w = t[r]) * (A = B - he), h += (G.g = k = t[r + 1]) * A, c += (G.b = _ = t[r + 2]) * A, d += (G.a = O = t[r + 3]) * A, S += w, C += k, T += _, b += O, G = G.next, he < z && (se += i);
7419
- r = q, U = F, Z = K;
7418
+ r = se + Y << 2, l += (H.r = w = t[r]) * (k = B - he), h += (H.g = A = t[r + 1]) * k, c += (H.b = P = t[r + 2]) * k, d += (H.a = D = t[r + 3]) * k, S += w, C += A, T += P, b += D, H = H.next, he < z && (se += i);
7419
+ r = Y, $ = F, te = K;
7420
7420
  for (let he = 0; he < n; he++)
7421
- s = r << 2, t[s + 3] = O = d * H >> R, O > 0 ? (O = 255 / O, t[s] = (l * H >> R) * O, t[s + 1] = (h * H >> R) * O, t[s + 2] = (c * H >> R) * O) : t[s] = t[s + 1] = t[s + 2] = 0, l -= u, h -= f, c -= p, d -= y, u -= U.r, f -= U.g, p -= U.b, y -= U.a, s = q + ((s = he + B) < z ? s : z) * i << 2, l += S += U.r = t[s], h += C += U.g = t[s + 1], c += T += U.b = t[s + 2], d += b += U.a = t[s + 3], U = U.next, u += w = Z.r, f += k = Z.g, p += _ = Z.b, y += O = Z.a, S -= w, C -= k, T -= _, b -= O, Z = Z.next, r += i;
7421
+ s = r << 2, t[s + 3] = D = d * G >> R, D > 0 ? (D = 255 / D, t[s] = (l * G >> R) * D, t[s + 1] = (h * G >> R) * D, t[s + 2] = (c * G >> R) * D) : t[s] = t[s + 1] = t[s + 2] = 0, l -= u, h -= f, c -= p, d -= y, u -= $.r, f -= $.g, p -= $.b, y -= $.a, s = Y + ((s = he + B) < z ? s : z) * i << 2, l += S += $.r = t[s], h += C += $.g = t[s + 1], c += T += $.b = t[s + 2], d += b += $.a = t[s + 3], $ = $.next, u += w = te.r, f += A = te.g, p += P = te.b, y += D = te.a, S -= w, C -= A, T -= P, b -= D, te = te.next, r += i;
7422
7422
  }
7423
7423
  }
7424
7424
  const Ga = function(e) {
@@ -7454,29 +7454,29 @@ const Fa = function(a) {
7454
7454
  bottom: 90,
7455
7455
  "bottom-left": 45,
7456
7456
  left: 0
7457
- }[(r = (s = this.embossDirection) === null || s === void 0 ? void 0 : s.call(this)) !== null && r !== void 0 ? r : "top-left"]) !== null && o !== void 0 ? o : 315, C = !!((h = (l = this.embossBlend) === null || l === void 0 ? void 0 : l.call(this)) !== null && h !== void 0 && h), T = f * 10, b = p * 255, w = S * Math.PI / 180, k = Math.cos(w), _ = Math.sin(w), O = 128 / 1020 * T, A = new Uint8ClampedArray(c), M = new Float32Array(d * u);
7458
- for (let F = 0, H = 0; H < c.length; H += 4, F++)
7459
- M[F] = 0.2126 * A[H] + 0.7152 * A[H + 1] + 0.0722 * A[H + 2];
7460
- const D = [-1, 0, 1, -2, 0, 2, -1, 0, 1], z = [-1, -2, -1, 0, 0, 0, 1, 2, 1], B = [-d - 1, -d, -d + 1, -1, 0, 1, d - 1, d, d + 1], Y = (F) => F < 0 ? 0 : F > 255 ? 255 : F;
7457
+ }[(r = (s = this.embossDirection) === null || s === void 0 ? void 0 : s.call(this)) !== null && r !== void 0 ? r : "top-left"]) !== null && o !== void 0 ? o : 315, C = !!((h = (l = this.embossBlend) === null || l === void 0 ? void 0 : l.call(this)) !== null && h !== void 0 && h), T = f * 10, b = p * 255, w = S * Math.PI / 180, A = Math.cos(w), P = Math.sin(w), D = 128 / 1020 * T, k = new Uint8ClampedArray(c), E = new Float32Array(d * u);
7458
+ for (let F = 0, G = 0; G < c.length; G += 4, F++)
7459
+ E[F] = 0.2126 * k[G] + 0.7152 * k[G + 1] + 0.0722 * k[G + 2];
7460
+ const O = [-1, 0, 1, -2, 0, 2, -1, 0, 1], z = [-1, -2, -1, 0, 0, 0, 1, 2, 1], B = [-d - 1, -d, -d + 1, -1, 0, 1, d - 1, d, d + 1], W = (F) => F < 0 ? 0 : F > 255 ? 255 : F;
7461
7461
  for (let F = 1; F < u - 1; F++)
7462
- for (let H = 1; H < d - 1; H++) {
7463
- const R = F * d + H;
7464
- let K = 0, G = 0;
7465
- K += M[R + B[0]] * D[0], G += M[R + B[0]] * z[0], K += M[R + B[1]] * D[1], G += M[R + B[1]] * z[1], K += M[R + B[2]] * D[2], G += M[R + B[2]] * z[2], K += M[R + B[3]] * D[3], G += M[R + B[3]] * z[3], K += M[R + B[5]] * D[5], G += M[R + B[5]] * z[5], K += M[R + B[6]] * D[6], G += M[R + B[6]] * z[6], K += M[R + B[7]] * D[7], G += M[R + B[7]] * z[7], K += M[R + B[8]] * D[8], G += M[R + B[8]] * z[8];
7466
- const U = k * K + _ * G, Z = Y(b + U * O), q = R * 4;
7462
+ for (let G = 1; G < d - 1; G++) {
7463
+ const R = F * d + G;
7464
+ let K = 0, H = 0;
7465
+ K += E[R + B[0]] * O[0], H += E[R + B[0]] * z[0], K += E[R + B[1]] * O[1], H += E[R + B[1]] * z[1], K += E[R + B[2]] * O[2], H += E[R + B[2]] * z[2], K += E[R + B[3]] * O[3], H += E[R + B[3]] * z[3], K += E[R + B[5]] * O[5], H += E[R + B[5]] * z[5], K += E[R + B[6]] * O[6], H += E[R + B[6]] * z[6], K += E[R + B[7]] * O[7], H += E[R + B[7]] * z[7], K += E[R + B[8]] * O[8], H += E[R + B[8]] * z[8];
7466
+ const $ = A * K + P * H, te = W(b + $ * D), Y = R * 4;
7467
7467
  if (C) {
7468
- const se = Z - b;
7469
- c[q] = Y(A[q] + se), c[q + 1] = Y(A[q + 1] + se), c[q + 2] = Y(A[q + 2] + se), c[q + 3] = A[q + 3];
7468
+ const se = te - b;
7469
+ c[Y] = W(k[Y] + se), c[Y + 1] = W(k[Y + 1] + se), c[Y + 2] = W(k[Y + 2] + se), c[Y + 3] = k[Y + 3];
7470
7470
  } else
7471
- c[q] = c[q + 1] = c[q + 2] = Z, c[q + 3] = A[q + 3];
7471
+ c[Y] = c[Y + 1] = c[Y + 2] = te, c[Y + 3] = k[Y + 3];
7472
7472
  }
7473
7473
  for (let F = 0; F < d; F++) {
7474
- let H = F * 4, R = ((u - 1) * d + F) * 4;
7475
- c[H] = A[H], c[H + 1] = A[H + 1], c[H + 2] = A[H + 2], c[H + 3] = A[H + 3], c[R] = A[R], c[R + 1] = A[R + 1], c[R + 2] = A[R + 2], c[R + 3] = A[R + 3];
7474
+ let G = F * 4, R = ((u - 1) * d + F) * 4;
7475
+ c[G] = k[G], c[G + 1] = k[G + 1], c[G + 2] = k[G + 2], c[G + 3] = k[G + 3], c[R] = k[R], c[R + 1] = k[R + 1], c[R + 2] = k[R + 2], c[R + 3] = k[R + 3];
7476
7476
  }
7477
7477
  for (let F = 1; F < u - 1; F++) {
7478
- let H = F * d * 4, R = (F * d + (d - 1)) * 4;
7479
- c[H] = A[H], c[H + 1] = A[H + 1], c[H + 2] = A[H + 2], c[H + 3] = A[H + 3], c[R] = A[R], c[R + 1] = A[R + 1], c[R + 2] = A[R + 2], c[R + 3] = A[R + 3];
7478
+ let G = F * d * 4, R = (F * d + (d - 1)) * 4;
7479
+ c[G] = k[G], c[G + 1] = k[G + 1], c[G + 2] = k[G + 2], c[G + 3] = k[G + 3], c[R] = k[R], c[R + 1] = k[R + 1], c[R + 2] = k[R + 2], c[R + 3] = k[R + 3];
7480
7480
  }
7481
7481
  return a;
7482
7482
  };
@@ -7510,8 +7510,8 @@ const Va = function(a) {
7510
7510
  f = n + u * (n - b), p = i + u * (i - b);
7511
7511
  const w = (o + r) * 0.5;
7512
7512
  y = o + u * (o - w), S = r + u * (r - w);
7513
- const k = (c + h) * 0.5;
7514
- C = c + u * (c - k), T = h + u * (h - k);
7513
+ const A = (c + h) * 0.5;
7514
+ C = c + u * (c - A), T = h + u * (h - A);
7515
7515
  }
7516
7516
  for (let b = 0; b < t; b += 4)
7517
7517
  e[b + 0] = hi(e[b + 0], i, n, p, f), e[b + 1] = hi(e[b + 1], r, o, S, y), e[b + 2] = hi(e[b + 2], h, c, T, C);
@@ -7529,14 +7529,14 @@ m.addGetterSetter(x, "saturation", 0, I(), m.afterSetFilter);
7529
7529
  m.addGetterSetter(x, "luminance", 0, I(), m.afterSetFilter);
7530
7530
  const Wa = function(a) {
7531
7531
  const e = a.data, t = e.length, i = 1, n = Math.pow(2, this.saturation()), s = Math.abs(this.hue() + 360) % 360, r = this.luminance() * 127, o = i * n * Math.cos(s * Math.PI / 180), l = i * n * Math.sin(s * Math.PI / 180), h = 0.299 * i + 0.701 * o + 0.167 * l, c = 0.587 * i - 0.587 * o + 0.33 * l, d = 0.114 * i - 0.114 * o - 0.497 * l, u = 0.299 * i - 0.299 * o - 0.328 * l, f = 0.587 * i + 0.413 * o + 0.035 * l, p = 0.114 * i - 0.114 * o + 0.293 * l, y = 0.299 * i - 0.3 * o + 1.25 * l, S = 0.587 * i - 0.586 * o - 1.05 * l, C = 0.114 * i + 0.886 * o - 0.2 * l;
7532
- let T, b, w, k;
7533
- for (let _ = 0; _ < t; _ += 4)
7534
- T = e[_ + 0], b = e[_ + 1], w = e[_ + 2], k = e[_ + 3], e[_ + 0] = h * T + c * b + d * w + r, e[_ + 1] = u * T + f * b + p * w + r, e[_ + 2] = y * T + S * b + C * w + r, e[_ + 3] = k;
7532
+ let T, b, w, A;
7533
+ for (let P = 0; P < t; P += 4)
7534
+ T = e[P + 0], b = e[P + 1], w = e[P + 2], A = e[P + 3], e[P + 0] = h * T + c * b + d * w + r, e[P + 1] = u * T + f * b + p * w + r, e[P + 2] = y * T + S * b + C * w + r, e[P + 3] = A;
7535
7535
  }, Xa = function(a) {
7536
7536
  const e = a.data, t = e.length, i = Math.pow(2, this.value()), n = Math.pow(2, this.saturation()), s = Math.abs(this.hue() + 360) % 360, r = i * n * Math.cos(s * Math.PI / 180), o = i * n * Math.sin(s * Math.PI / 180), l = 0.299 * i + 0.701 * r + 0.167 * o, h = 0.587 * i - 0.587 * r + 0.33 * o, c = 0.114 * i - 0.114 * r - 0.497 * o, d = 0.299 * i - 0.299 * r - 0.328 * o, u = 0.587 * i + 0.413 * r + 0.035 * o, f = 0.114 * i - 0.114 * r + 0.293 * o, p = 0.299 * i - 0.3 * r + 1.25 * o, y = 0.587 * i - 0.586 * r - 1.05 * o, S = 0.114 * i + 0.886 * r - 0.2 * o;
7537
7537
  for (let C = 0; C < t; C += 4) {
7538
- const T = e[C + 0], b = e[C + 1], w = e[C + 2], k = e[C + 3];
7539
- e[C + 0] = l * T + h * b + c * w, e[C + 1] = d * T + u * b + f * w, e[C + 2] = p * T + y * b + S * w, e[C + 3] = k;
7538
+ const T = e[C + 0], b = e[C + 1], w = e[C + 2], A = e[C + 3];
7539
+ e[C + 0] = l * T + h * b + c * w, e[C + 1] = d * T + u * b + f * w, e[C + 2] = p * T + y * b + S * w, e[C + 3] = A;
7540
7540
  }
7541
7541
  };
7542
7542
  m.addGetterSetter(x, "hue", 0, I(), m.afterSetFilter);
@@ -7557,8 +7557,8 @@ const Ua = function(a) {
7557
7557
  for (let b = 0; b < f; b += 1) {
7558
7558
  c = Math.floor(o + h * b / f * T), d = Math.floor(l + h * b / f * C);
7559
7559
  let w = (d * s + c) * 4;
7560
- const k = i[w + 0], _ = i[w + 1], O = i[w + 2], A = i[w + 3];
7561
- w = (S + b * s) * 4, n[w + 0] = k, n[w + 1] = _, n[w + 2] = O, n[w + 3] = A;
7560
+ const A = i[w + 0], P = i[w + 1], D = i[w + 2], k = i[w + 3];
7561
+ w = (S + b * s) * 4, n[w + 0] = A, n[w + 1] = P, n[w + 2] = D, n[w + 3] = k;
7562
7562
  }
7563
7563
  }
7564
7564
  }, qa = function(a, e, t) {
@@ -7571,11 +7571,11 @@ const Ua = function(a) {
7571
7571
  for (c = 0; c < s; c += 1)
7572
7572
  for (d = 0; d < r; d += 1) {
7573
7573
  const T = c - o, b = d - l, w = Math.sqrt(T * T + b * b) * f / h;
7574
- let k = (Math.atan2(b, T) * 180 / Math.PI + 360 + y) % 360;
7575
- k = k * p / 360, S = Math.floor(k), C = Math.floor(w);
7576
- let _ = (C * s + S) * 4;
7577
- const O = i[_ + 0], A = i[_ + 1], M = i[_ + 2], D = i[_ + 3];
7578
- _ = (d * s + c) * 4, n[_ + 0] = O, n[_ + 1] = A, n[_ + 2] = M, n[_ + 3] = D;
7574
+ let A = (Math.atan2(b, T) * 180 / Math.PI + 360 + y) % 360;
7575
+ A = A * p / 360, S = Math.floor(A), C = Math.floor(w);
7576
+ let P = (C * s + S) * 4;
7577
+ const D = i[P + 0], k = i[P + 1], E = i[P + 2], O = i[P + 3];
7578
+ P = (d * s + c) * 4, n[P + 0] = D, n[P + 1] = k, n[P + 2] = E, n[P + 3] = O;
7579
7579
  }
7580
7580
  }, Ka = function(a) {
7581
7581
  const e = a.width, t = a.height;
@@ -7594,9 +7594,9 @@ const Ua = function(a) {
7594
7594
  for (; T <= 8; )
7595
7595
  T = T * 2, f -= 1;
7596
7596
  T = Math.ceil(T);
7597
- let b = T, w = 0, k = b, _ = 1;
7598
- for (y + T > e && (w = b, k = 0, _ = -1), n = 0; n < t; n += 1)
7599
- for (i = w; i !== k; i += _)
7597
+ let b = T, w = 0, A = b, P = 1;
7598
+ for (y + T > e && (w = b, A = 0, P = -1), n = 0; n < t; n += 1)
7599
+ for (i = w; i !== A; i += P)
7600
7600
  s = Math.round(i + y) % e, d = (e * n + s) * 4, o = C.data[d + 0], l = C.data[d + 1], h = C.data[d + 2], c = C.data[d + 3], u = (e * n + i) * 4, C.data[u + 0] = o, C.data[u + 1] = l, C.data[u + 2] = h, C.data[u + 3] = c;
7601
7601
  for (n = 0; n < t; n += 1)
7602
7602
  for (b = Math.floor(T), r = 0; r < f; r += 1) {
@@ -7804,24 +7804,24 @@ const lo = function(a) {
7804
7804
  t[n] = t[n] < e ? 0 : 255;
7805
7805
  };
7806
7806
  m.addGetterSetter(x, "threshold", 0.5, I(), m.afterSetFilter);
7807
- const X = nn.Util._assign(nn, {
7807
+ const U = nn.Util._assign(nn, {
7808
7808
  Arc: xe,
7809
- Arrow: $e,
7809
+ Arrow: qe,
7810
7810
  Circle: rt,
7811
7811
  Ellipse: Be,
7812
7812
  Image: ye,
7813
7813
  Label: Hi,
7814
- Tag: qe,
7814
+ Tag: Ke,
7815
7815
  Line: Ie,
7816
- Path: ee,
7816
+ Path: Q,
7817
7817
  Rect: It,
7818
7818
  RegularPolygon: Ge,
7819
- Ring: Ke,
7819
+ Ring: je,
7820
7820
  Sprite: be,
7821
7821
  Star: He,
7822
- Text: te,
7822
+ Text: ee,
7823
7823
  TextPath: re,
7824
- Transformer: W,
7824
+ Transformer: X,
7825
7825
  Wedge: Ae,
7826
7826
  Filters: {
7827
7827
  Blur: Ga,
@@ -8274,7 +8274,7 @@ class Ce {
8274
8274
  static renderSegments(e, t, i, n) {
8275
8275
  e.destroyChildren(), e.clip({ x: 0, y: 0, width: i, height: n });
8276
8276
  for (const { coverUrl: s, singleImageWidth: r, segmentStartX: o, segmentWidth: l } of t) {
8277
- const h = Math.max(r, 0.01), c = Math.max(1, Math.ceil(l / h)), d = Math.max(r, 0.01), u = this.getCachedImage(s), f = new X.Group({
8277
+ const h = Math.max(r, 0.01), c = Math.max(1, Math.ceil(l / h)), d = Math.max(r, 0.01), u = this.getCachedImage(s), f = new U.Group({
8278
8278
  x: o,
8279
8279
  y: 0,
8280
8280
  clip: {
@@ -8290,7 +8290,7 @@ class Ce {
8290
8290
  const y = p * d, S = l - y, C = i - o - y, T = Math.min(d, S, C);
8291
8291
  if (T <= 0)
8292
8292
  continue;
8293
- const b = new X.Image({
8293
+ const b = new U.Image({
8294
8294
  image: u,
8295
8295
  cornerRadius: 2,
8296
8296
  name: "cover-image"
@@ -8372,20 +8372,20 @@ class Ce {
8372
8372
  g(Ce, "MIN_IMAGE_DISPLAY_WIDTH", 24), g(Ce, "COVER_RENDER_VERSION_KEY", "_coverRenderVersion"), g(Ce, "MAX_CACHE_SIZE", 1e3), g(Ce, "DEFAULT_DIMENSIONS", { width: 160, height: 90 }), g(Ce, "keyframeDimensionsCache", {}), g(Ce, "keyframeDimensionsPromiseCache", {}), g(Ce, "imageCache", {});
8373
8373
  const oe = 3, Cn = 10, Po = 8, _o = 8, xo = 10, ci = 4, vn = 14, Ps = 10, Io = [4, 10, 14, 10, 4], Tn = [3, 7, 11, 15, 11, 7, 3], Ni = 28, Ao = 14, _s = 8, Eo = [4, 9, 14, 9, 4];
8374
8374
  function Te(a, e, t, i, n = "#ffffff", s = "#000000", r = 1) {
8375
- return new X.Rect({ x: a, y: e, width: t, height: i, fill: n, stroke: s, strokeWidth: r });
8375
+ return new U.Rect({ x: a, y: e, width: t, height: i, fill: n, stroke: s, strokeWidth: r });
8376
8376
  }
8377
8377
  function xs(a, e, t, i = 12, n = "Arial", s = "#000000", r = "left", o = "top") {
8378
- return new X.Text({ text: a, x: e, y: t, fontSize: i, fontFamily: n, fill: s, align: r, verticalAlign: o });
8378
+ return new U.Text({ text: a, x: e, y: t, fontSize: i, fontFamily: n, fill: s, align: r, verticalAlign: o });
8379
8379
  }
8380
8380
  function _e(a = 0, e = 0) {
8381
- return new X.Group({ x: a, y: e });
8381
+ return new U.Group({ x: a, y: e });
8382
8382
  }
8383
8383
  function zi(a, e, t, i) {
8384
8384
  if (i) {
8385
- a.add(new X.Rect({ x: 0, y: 0, width: e, height: t, name: "clip-resize-left", listening: !0 })), a.add(new X.Rect({ x: 0, y: 0, width: e, height: t, name: "clip-resize-right", listening: !0 }));
8385
+ a.add(new U.Rect({ x: 0, y: 0, width: e, height: t, name: "clip-resize-left", listening: !0 })), a.add(new U.Rect({ x: 0, y: 0, width: e, height: t, name: "clip-resize-right", listening: !0 }));
8386
8386
  return;
8387
8387
  }
8388
- a.add(new X.Rect({ x: 0, y: 0, width: oe, height: t, name: "clip-resize-left" })), a.add(new X.Rect({ x: e - oe, y: 0, width: oe, height: t, name: "clip-resize-right" }));
8388
+ a.add(new U.Rect({ x: 0, y: 0, width: oe, height: t, name: "clip-resize-left" })), a.add(new U.Rect({ x: e - oe, y: 0, width: oe, height: t, name: "clip-resize-right" }));
8389
8389
  }
8390
8390
  function Mo(a, e, t, i) {
8391
8391
  const n = a.findOne(".clip-resize-left"), s = a.findOne(".clip-resize-right");
@@ -8575,7 +8575,7 @@ function Ho(a, e, t, i, n, s, r = !1, o, l, h = "video", c = !1, d = !1) {
8575
8575
  Bo(a, u) || Es(a, u);
8576
8576
  }
8577
8577
  function No(a, e, t, i) {
8578
- return new X.Rect({
8578
+ return new U.Rect({
8579
8579
  x: a,
8580
8580
  y: e,
8581
8581
  width: t,
@@ -8587,7 +8587,7 @@ function No(a, e, t, i) {
8587
8587
  });
8588
8588
  }
8589
8589
  function Ei(a, e = "#000000", t = 1) {
8590
- return new X.Line({
8590
+ return new U.Line({
8591
8591
  points: a,
8592
8592
  stroke: e,
8593
8593
  strokeWidth: t,
@@ -8596,7 +8596,7 @@ function Ei(a, e = "#000000", t = 1) {
8596
8596
  });
8597
8597
  }
8598
8598
  function zo(a, e, t, i = 12, n = "Arial", s = "#000000", r = "left", o = "top") {
8599
- return new X.Text({
8599
+ return new U.Text({
8600
8600
  text: a,
8601
8601
  x: e,
8602
8602
  y: t,
@@ -8608,7 +8608,7 @@ function zo(a, e, t, i = 12, n = "Arial", s = "#000000", r = "left", o = "top")
8608
8608
  });
8609
8609
  }
8610
8610
  function Fo(a = 0, e = 0) {
8611
- return new X.Group({ x: a, y: e });
8611
+ return new U.Group({ x: a, y: e });
8612
8612
  }
8613
8613
  function Vo(a, e, t, i, n, s, r, o) {
8614
8614
  const l = o || i, h = r === "major" ? l * 0.6 : l * 0.3, c = Ei(
@@ -8642,7 +8642,7 @@ class ie {
8642
8642
  * 创建舞台
8643
8643
  */
8644
8644
  static createStage(e, t, i) {
8645
- return new X.Stage({
8645
+ return new U.Stage({
8646
8646
  container: e,
8647
8647
  width: t,
8648
8648
  height: i
@@ -8652,14 +8652,14 @@ class ie {
8652
8652
  * 创建图层
8653
8653
  */
8654
8654
  static createLayer(e) {
8655
- const t = new X.Layer();
8655
+ const t = new U.Layer();
8656
8656
  return t.name(e), t;
8657
8657
  }
8658
8658
  /**
8659
8659
  * 创建矩形
8660
8660
  */
8661
8661
  static createRect(e, t, i, n, s = "#ffffff", r = "#000000", o = 1) {
8662
- return new X.Rect({
8662
+ return new U.Rect({
8663
8663
  x: e,
8664
8664
  y: t,
8665
8665
  width: i,
@@ -8673,7 +8673,7 @@ class ie {
8673
8673
  * 创建文本
8674
8674
  */
8675
8675
  static createText(e, t, i, n = 12, s = "Arial", r = "#000000", o = "left", l = "top") {
8676
- return new X.Text({
8676
+ return new U.Text({
8677
8677
  text: e,
8678
8678
  x: t,
8679
8679
  y: i,
@@ -8688,7 +8688,7 @@ class ie {
8688
8688
  * 创建线条
8689
8689
  */
8690
8690
  static createLine(e, t = "#000000", i = 1) {
8691
- return new X.Line({
8691
+ return new U.Line({
8692
8692
  points: e,
8693
8693
  stroke: t,
8694
8694
  strokeWidth: i,
@@ -8700,7 +8700,7 @@ class ie {
8700
8700
  * 创建分组
8701
8701
  */
8702
8702
  static createGroup(e = 0, t = 0) {
8703
- return new X.Group({
8703
+ return new U.Group({
8704
8704
  x: e,
8705
8705
  y: t
8706
8706
  });
@@ -8709,11 +8709,11 @@ class ie {
8709
8709
  * 创建播放头
8710
8710
  */
8711
8711
  static createPlayhead(e, t, i) {
8712
- const n = new X.Group({ x: e, y: t }), s = this.createLine(
8712
+ const n = new U.Group({ x: e, y: t }), s = this.createLine(
8713
8713
  [0, 0, 0, i],
8714
8714
  "#FF0000",
8715
8715
  2
8716
- ), r = new X.RegularPolygon({
8716
+ ), r = new U.RegularPolygon({
8717
8717
  x: 0,
8718
8718
  y: -10,
8719
8719
  sides: 3,
@@ -8808,7 +8808,7 @@ function At(a) {
8808
8808
  function Et(a) {
8809
8809
  typeof window < "u" && (window.removeEventListener("mousemove", a.onPointerMove), window.removeEventListener("mouseup", a.onPointerEnd), window.removeEventListener("blur", a.onWindowBlur || a.onPointerEnd)), typeof document < "u" && document.removeEventListener("visibilitychange", a.onVisibilityChange);
8810
8810
  }
8811
- class ch {
8811
+ class dh {
8812
8812
  constructor(e, t, i, n, s, r) {
8813
8813
  g(this, "stage");
8814
8814
  g(this, "gridLayer");
@@ -9227,7 +9227,7 @@ function ui(a) {
9227
9227
  function Pt(a) {
9228
9228
  return (a == null ? void 0 : a.kind) === "draggingMove" || (a == null ? void 0 : a.kind) === "draggingResizeLeft" || (a == null ? void 0 : a.kind) === "draggingResizeRight";
9229
9229
  }
9230
- function Je(a) {
9230
+ function Fe(a) {
9231
9231
  return !a || a.kind === "idle" || a.kind === "boxSelecting" ? null : a.context;
9232
9232
  }
9233
9233
  function _t(a) {
@@ -9375,7 +9375,7 @@ function qo(a, e, t, i) {
9375
9375
  return Math.hypot(n, s) >= Math.max(0, e);
9376
9376
  }
9377
9377
  const Se = class Se {
9378
- constructor(e, t, i, n, s, r, o, l, h, c, d, u, f, p, y, S, C, T, b, w, k, _, O, A, M, D = Se.DEFAULT_DRAG_ACTIVATION_THRESHOLD, z = !1, B = Se.DEFAULT_CLIP_SNAP_THRESHOLD) {
9378
+ constructor(e, t, i, n, s, r, o, l, h, c, d, u, f, p, y, S, C, T, b, w, A, P, D, k, E, O = Se.DEFAULT_DRAG_ACTIVATION_THRESHOLD, z = !1, B = Se.DEFAULT_CLIP_SNAP_THRESHOLD) {
9379
9379
  g(this, "layer");
9380
9380
  g(this, "trackGroup");
9381
9381
  g(this, "dragOverlayLayer", null);
@@ -9440,7 +9440,7 @@ const Se = class Se {
9440
9440
  const e = this.resolveInteractionState();
9441
9441
  if (!Pt(e) || !this.onHorizontalDragAutoScroll)
9442
9442
  return;
9443
- const t = this.layer.getStage(), i = t == null ? void 0 : t.container(), n = Je(e);
9443
+ const t = this.layer.getStage(), i = t == null ? void 0 : t.container(), n = Fe(e);
9444
9444
  if (!i || !n) {
9445
9445
  this.stopEdgeAutoScroll();
9446
9446
  return;
@@ -9457,7 +9457,7 @@ const Se = class Se {
9457
9457
  }
9458
9458
  this.startEdgeAutoScroll();
9459
9459
  });
9460
- this.layer = e, this.config = t, this.theme = o, this.trackType = i, this.zoom = n, this.trackY = s, this.trackHeight = r, this.onClipUpdate = l, this.onClipAdd = h, this.onClipRemove = c, this.onClipSplit = d, this.onClipSelect = u, this.onTimeJump = f, this.onHorizontalDragAutoScroll = p, this.onClipOverlap = y, this.onClipCrossTrackPreview = S, this.onClipCrossTrack = C, this.onClearDropPreview = T, this.onClearSelection = b, this.onSnapGuideChange = w, this.onClipToggleSelection = k, this.onSetSingleSelection = _, this.getMultiDragClipIds = O, this.onMultiDragMove = A, this.onMultiDragInteractionEnd = M, this.dragActivationThreshold = Math.max(0, D), this.enableClipSnap = z, this.clipSnapThreshold = Math.max(0, B), this.trackGroup = ie.createGroup(0, s), this.layer.add(this.trackGroup), this.initClips(), this.initEventListeners(), this.render();
9460
+ this.layer = e, this.config = t, this.theme = o, this.trackType = i, this.zoom = n, this.trackY = s, this.trackHeight = r, this.onClipUpdate = l, this.onClipAdd = h, this.onClipRemove = c, this.onClipSplit = d, this.onClipSelect = u, this.onTimeJump = f, this.onHorizontalDragAutoScroll = p, this.onClipOverlap = y, this.onClipCrossTrackPreview = S, this.onClipCrossTrack = C, this.onClearDropPreview = T, this.onClearSelection = b, this.onSnapGuideChange = w, this.onClipToggleSelection = A, this.onSetSingleSelection = P, this.getMultiDragClipIds = D, this.onMultiDragMove = k, this.onMultiDragInteractionEnd = E, this.dragActivationThreshold = Math.max(0, O), this.enableClipSnap = z, this.clipSnapThreshold = Math.max(0, B), this.trackGroup = ie.createGroup(0, s), this.layer.add(this.trackGroup), this.initClips(), this.initEventListeners(), this.render();
9461
9461
  }
9462
9462
  get hasDragMoved() {
9463
9463
  return this.getLegacyInteractionSnapshot().hasDragMoved;
@@ -9732,15 +9732,14 @@ const Se = class Se {
9732
9732
  this.finishPointerInteraction("POINTER_UP");
9733
9733
  }
9734
9734
  finishPointerInteraction(e) {
9735
- const t = this.interactionState;
9735
+ const t = this.interactionState, i = this.resolveDraggedClipForInteraction(t);
9736
9736
  try {
9737
- if (!this.selectedClip)
9737
+ if (!i)
9738
9738
  return;
9739
- const i = this.selectedClip.getClip();
9740
- if (!i.isDragging)
9739
+ const n = i.getClip();
9740
+ if (!n.isDragging)
9741
9741
  return;
9742
- const n = i;
9743
- this.selectedClip.endDrag();
9742
+ i.endDrag();
9744
9743
  const s = Vt(t, {
9745
9744
  type: e
9746
9745
  });
@@ -9755,6 +9754,16 @@ const Se = class Se {
9755
9754
  });
9756
9755
  }
9757
9756
  }
9757
+ resolveDraggedClipForInteraction(e = this.interactionState) {
9758
+ const t = Fe(e);
9759
+ if (t != null && t.clipId) {
9760
+ const n = this.clips.find((s) => s.getClip().id === t.clipId) ?? null;
9761
+ if (n)
9762
+ return n;
9763
+ }
9764
+ const i = this.clips.find((n) => n.getClip().isDragging) ?? null;
9765
+ return i || this.selectedClip;
9766
+ }
9758
9767
  applyInteractionTransition(e) {
9759
9768
  var i, n;
9760
9769
  this.interactionState = e.state, this.syncLegacyInteractionMirror(e.state), e.effects.bindGlobalListeners && this.bindGlobalPointerListenersForDrag();
@@ -9765,7 +9774,7 @@ const Se = class Se {
9765
9774
  var r;
9766
9775
  if (ui(e))
9767
9776
  return e;
9768
- const t = this.getLegacyInteractionSnapshot(), i = (r = this.selectedClip) == null ? void 0 : r.getClip();
9777
+ const t = this.getLegacyInteractionSnapshot(), i = (r = this.resolveDraggedClipForInteraction(e)) == null ? void 0 : r.getClip();
9769
9778
  if (!(i != null && i.id) || !i.isDragging)
9770
9779
  return e;
9771
9780
  const n = t.activePointerOperation || (i.isResizingLeft ? "resize-left" : i.isResizingRight ? "resize-right" : "move"), s = {
@@ -9790,12 +9799,12 @@ const Se = class Se {
9790
9799
  };
9791
9800
  }
9792
9801
  syncLegacyInteractionMirror(e = this.interactionState) {
9793
- const t = this.getLegacyInteractionSnapshot(), i = Je(e);
9802
+ const t = this.getLegacyInteractionSnapshot(), i = Fe(e);
9794
9803
  t.hasDragMoved = Pt(e), t.activePointerOperation = _t(e), t.originalClipsState = (i == null ? void 0 : i.originalClipsState) ?? [], t.nonDraggedClips = (i == null ? void 0 : i.nonDraggedClips) ?? [], t.snapCandidateClips = (i == null ? void 0 : i.snapCandidateClips) ?? [], t.dragStartY = (i == null ? void 0 : i.pointerStartY) ?? 0, t.dragTargetTrackY = (i == null ? void 0 : i.dragTargetTrackY) ?? 0, t.crossTrackDragOffsetY = (i == null ? void 0 : i.crossTrackDragOffsetY) ?? 0, t.crossTrackDragStartX = (i == null ? void 0 : i.pointerStartX) ?? 0, t.dragStartScrollLeft = (i == null ? void 0 : i.dragStartScrollLeft) ?? 0, t.dragGestureStartClientX = (i == null ? void 0 : i.pointerStartClientX) ?? null, t.dragGestureStartClientY = (i == null ? void 0 : i.pointerStartClientY) ?? null, t.lastDragClientX = (i == null ? void 0 : i.lastPointerClientX) ?? null, t.lastDragClientY = (i == null ? void 0 : i.lastPointerClientY) ?? null;
9795
9804
  }
9796
9805
  handleClipMoveEnd(e, t) {
9797
9806
  var S, C, T;
9798
- const i = this.resolveInteractionState(t), n = this.getLegacyInteractionSnapshot(), s = Je(i) || {
9807
+ const i = this.resolveInteractionState(t), n = this.getLegacyInteractionSnapshot(), s = Fe(i) || {
9799
9808
  clipId: e.id,
9800
9809
  originalClipsState: n.originalClipsState.length > 0 ? n.originalClipsState : [e],
9801
9810
  nonDraggedClips: n.nonDraggedClips,
@@ -9814,63 +9823,63 @@ const Se = class Se {
9814
9823
  crossTrackOffsetY: s.crossTrackDragOffsetY,
9815
9824
  isFinal: !0
9816
9825
  })) {
9817
- for (const D of this.selectedClipIds) {
9818
- const z = (C = this.clipGroups) == null ? void 0 : C.get(D);
9826
+ for (const O of this.selectedClipIds) {
9827
+ const z = (C = this.clipGroups) == null ? void 0 : C.get(O);
9819
9828
  z == null || z.y(2);
9820
9829
  }
9821
9830
  this.multiDragOriginalPositions.clear();
9822
9831
  return;
9823
9832
  }
9824
- const k = [], _ = [];
9825
- for (const [M, D] of this.multiDragOriginalPositions) {
9826
- const z = this.clips.find((R) => R.getClip().id === M);
9833
+ const A = [], P = [];
9834
+ for (const [E, O] of this.multiDragOriginalPositions) {
9835
+ const z = this.clips.find((R) => R.getClip().id === E);
9827
9836
  if (!z) continue;
9828
- const B = Math.max(0, D.startTime + w), Y = {
9837
+ const B = Math.max(0, O.startTime + w), W = {
9829
9838
  ...z.getClip(),
9830
9839
  startTime: B,
9831
- endTime: B + D.duration,
9840
+ endTime: B + O.duration,
9832
9841
  isDragging: !1,
9833
9842
  isResizing: !1,
9834
9843
  isResizingLeft: !1,
9835
9844
  isResizingRight: !1,
9836
9845
  zIndex: 1,
9837
9846
  opacity: 1,
9838
- isSelected: this.selectedClipIds.has(M)
9847
+ isSelected: this.selectedClipIds.has(E)
9839
9848
  };
9840
- k.push(Y);
9841
- const F = s.originalClipsState.find((R) => R.id === M);
9842
- F && _.push(F);
9843
- const H = (T = this.clipGroups) == null ? void 0 : T.get(M);
9844
- H && H.y(2);
9849
+ A.push(W);
9850
+ const F = s.originalClipsState.find((R) => R.id === E);
9851
+ F && P.push(F);
9852
+ const G = (T = this.clipGroups) == null ? void 0 : T.get(E);
9853
+ G && G.y(2);
9845
9854
  }
9846
- const O = [];
9847
- for (const M of this.clips) {
9848
- const D = M.getClip(), z = k.find((B) => B.id === D.id);
9849
- z ? O.push(z) : O.push({
9850
- ...D,
9855
+ const D = [];
9856
+ for (const E of this.clips) {
9857
+ const O = E.getClip(), z = A.find((B) => B.id === O.id);
9858
+ z ? D.push(z) : D.push({
9859
+ ...O,
9851
9860
  isDragging: !1,
9852
9861
  isResizing: !1,
9853
9862
  isResizingLeft: !1,
9854
9863
  isResizingRight: !1
9855
9864
  });
9856
9865
  }
9857
- O.sort((M, D) => M.startTime - D.startTime), this.isVisualUpdate = !0;
9858
- for (const M of O)
9859
- this.clips.find((z) => z.getClip().id === M.id) && this.handleClipUpdate(M);
9866
+ D.sort((E, O) => E.startTime - O.startTime), this.isVisualUpdate = !0;
9867
+ for (const E of D)
9868
+ this.clips.find((z) => z.getClip().id === E.id) && this.handleClipUpdate(E);
9860
9869
  this.isVisualUpdate = !1;
9861
- const A = _.map((M) => {
9862
- const D = k.find((z) => z.id === M.id);
9863
- return D && (M.startTime !== D.startTime || M.duration !== D.duration) ? {
9864
- clipId: M.id,
9865
- previousState: M,
9866
- newState: D
9870
+ const k = P.map((E) => {
9871
+ const O = A.find((z) => z.id === E.id);
9872
+ return O && (E.startTime !== O.startTime || E.duration !== O.duration) ? {
9873
+ clipId: E.id,
9874
+ previousState: E,
9875
+ newState: O
9867
9876
  } : null;
9868
- }).filter((M) => M !== null);
9869
- A.length > 0 && this.onClipUpdate(e, _.find((M) => M.id === e.id), A), this.multiDragOriginalPositions.clear();
9877
+ }).filter((E) => E !== null);
9878
+ k.length > 0 && this.onClipUpdate(e, P.find((E) => E.id === e.id), k), this.multiDragOriginalPositions.clear();
9870
9879
  return;
9871
9880
  }
9872
9881
  if (o && this.onClipCrossTrack && this.config.id) {
9873
- const b = s.originalClipsState.find((k) => k.id === e.id) ?? null;
9882
+ const b = s.originalClipsState.find((A) => A.id === e.id) ?? null;
9874
9883
  if (this.onClipCrossTrack(e, b, s.dragTargetTrackY, this.config.id)) {
9875
9884
  this.multiDragOriginalPositions.clear();
9876
9885
  return;
@@ -10075,7 +10084,7 @@ const Se = class Se {
10075
10084
  const r = s.getClip();
10076
10085
  this.updateClipGroup(r), this.updateClipVisibility(r);
10077
10086
  });
10078
- const t = this.resolveInteractionState(), i = Je(t), n = Vt(t, { type: "SCROLL_LEFT_CHANGED" });
10087
+ const t = this.resolveInteractionState(), i = Fe(t), n = Vt(t, { type: "SCROLL_LEFT_CHANGED" });
10079
10088
  this.interactionState = n.state, this.syncLegacyInteractionMirror(n.state), n.effects.updatePreview && i && this.updateDraggedClipFromPointer(i.lastPointerClientX, i.lastPointerClientY, !1), this.layer.batchDraw();
10080
10089
  }
10081
10090
  updateClipVisibility(e) {
@@ -10267,7 +10276,7 @@ const Se = class Se {
10267
10276
  }
10268
10277
  setClipSnapEnabled(e) {
10269
10278
  this.enableClipSnap = e, e || this.updateSnapGuideLine(null);
10270
- const t = this.resolveInteractionState(), i = Je(t);
10279
+ const t = this.resolveInteractionState(), i = Fe(t);
10271
10280
  if (Pt(t) && i) {
10272
10281
  this.updateDraggedClipFromPointer(i.lastPointerClientX, i.lastPointerClientY, !1);
10273
10282
  return;
@@ -10278,74 +10287,74 @@ const Se = class Se {
10278
10287
  this.resolveSnapTargetClips = e;
10279
10288
  }
10280
10289
  updateDraggedClipFromPointer(e, t, i) {
10281
- var S, C, T, b, w;
10282
- const n = this.resolveInteractionState(), s = Je(n), r = _t(n), o = this.layer.getStage();
10283
- if (!o || !this.selectedClip || !s || !r) return;
10284
- const l = o.container();
10285
- if (!l) return;
10286
- const h = l.getBoundingClientRect(), c = e - h.left, d = t - h.top, u = r === "move", f = u && this.multiDragOriginalPositions.size > 0;
10287
- u && L.debugLazy("Track", () => "Cross-track drag detected", () => ({
10288
- targetTrackY: d,
10290
+ var C, T, b, w, A;
10291
+ const n = this.resolveInteractionState(), s = Fe(n), r = _t(n), o = this.layer.getStage(), l = this.resolveDraggedClipForInteraction(n);
10292
+ if (!o || !l || !s || !r) return;
10293
+ const h = o.container();
10294
+ if (!h) return;
10295
+ const c = h.getBoundingClientRect(), d = e - c.left, u = t - c.top, f = r === "move", p = f && this.multiDragOriginalPositions.size > 0;
10296
+ f && L.debugLazy("Track", () => "Cross-track drag detected", () => ({
10297
+ targetTrackY: u,
10289
10298
  currentTrackId: this.config.id,
10290
10299
  offsetY: s.crossTrackDragOffsetY
10291
10300
  }));
10292
- const p = this.selectedClip.getClip(), y = (S = this.clipGroups) == null ? void 0 : S.get(p.id);
10293
- if (y) {
10294
- const k = u && s.crossTrackDragOffsetY !== 0;
10295
- this.setClipDragOverlayActive(p.id, k);
10296
- const _ = s.originalClipsState.find((F) => F.id === p.id);
10297
- if (!_)
10301
+ const y = l.getClip(), S = (C = this.clipGroups) == null ? void 0 : C.get(y.id);
10302
+ if (S) {
10303
+ const P = f && s.crossTrackDragOffsetY !== 0;
10304
+ this.setClipDragOverlayActive(y.id, P);
10305
+ const D = s.originalClipsState.find((G) => G.id === y.id);
10306
+ if (!D)
10298
10307
  return;
10299
- const O = this.buildPreviewClip(p, _, c, s, r);
10300
- if (!O) {
10301
- this.hideDropPreview(), (C = this.onClearDropPreview) == null || C.call(this), this.updateSnapGuideLine(null);
10308
+ const k = this.buildPreviewClip(y, D, d, s, r);
10309
+ if (!k) {
10310
+ this.hideDropPreview(), (T = this.onClearDropPreview) == null || T.call(this), this.updateSnapGuideLine(null);
10302
10311
  return;
10303
10312
  }
10304
- const A = O.clip, M = A.startTime - _.startTime, D = this.applyPreviewClipState(A), z = ce(A.startTime, this.zoom, this.scrollLeft), B = ve(A.duration, this.zoom);
10305
- y.x(z), y.y(this.resolveClipRenderY(p.id, s.crossTrackDragOffsetY)), y.visible(z + B > 0 && z < this.layer.width()), D && (this.updateClipGroup(A), y.y(this.resolveClipRenderY(p.id, s.crossTrackDragOffsetY)));
10306
- let Y = !1;
10307
- if (f) {
10308
- this.onMultiDragMove && this.config.id && (Y = this.onMultiDragMove({
10309
- draggedClipId: p.id,
10310
- deltaTime: M,
10313
+ const E = k.clip, O = E.startTime - D.startTime, z = this.applyPreviewClipState(l, E), B = ce(E.startTime, this.zoom, this.scrollLeft), W = ve(E.duration, this.zoom);
10314
+ S.x(B), S.y(this.resolveClipRenderY(y.id, s.crossTrackDragOffsetY)), S.visible(B + W > 0 && B < this.layer.width()), z && (this.updateClipGroup(E), S.y(this.resolveClipRenderY(y.id, s.crossTrackDragOffsetY)));
10315
+ let F = !1;
10316
+ if (p) {
10317
+ this.onMultiDragMove && this.config.id && (F = this.onMultiDragMove({
10318
+ draggedClipId: y.id,
10319
+ deltaTime: O,
10311
10320
  targetTrackY: s.dragTargetTrackY,
10312
10321
  currentTrackId: this.config.id,
10313
10322
  crossTrackOffsetY: s.crossTrackDragOffsetY,
10314
10323
  isFinal: !1
10315
10324
  }) === !0);
10316
- for (const [F, H] of this.multiDragOriginalPositions) {
10317
- if (F === p.id) continue;
10318
- const R = this.clips.find((U) => U.getClip().id === F);
10319
- if (!R) continue;
10320
- const K = Math.max(0, H.startTime + M), G = (T = this.clipGroups) == null ? void 0 : T.get(F);
10321
- if (G) {
10322
- const U = ce(K, this.zoom, this.scrollLeft);
10323
- G.x(U), G.y(this.resolveClipRenderY(F, s.crossTrackDragOffsetY)), G.visible(
10324
- U + ve(H.duration, this.zoom) > 0 && U < this.layer.width()
10325
+ for (const [G, R] of this.multiDragOriginalPositions) {
10326
+ if (G === y.id) continue;
10327
+ const K = this.clips.find((te) => te.getClip().id === G);
10328
+ if (!K) continue;
10329
+ const H = Math.max(0, R.startTime + O), $ = (b = this.clipGroups) == null ? void 0 : b.get(G);
10330
+ if ($) {
10331
+ const te = ce(H, this.zoom, this.scrollLeft);
10332
+ $.x(te), $.y(this.resolveClipRenderY(G, s.crossTrackDragOffsetY)), $.visible(
10333
+ te + ve(R.duration, this.zoom) > 0 && te < this.layer.width()
10325
10334
  );
10326
- const Z = R.getClip();
10335
+ const Y = K.getClip();
10327
10336
  ie.updateClipGroup(
10328
- G,
10329
- ve(Z.duration, this.zoom),
10337
+ $,
10338
+ ve(Y.duration, this.zoom),
10330
10339
  this.trackHeight - 4,
10331
- Z.name,
10332
- Z.duration,
10340
+ Y.name,
10341
+ Y.duration,
10333
10342
  this.theme,
10334
10343
  !0,
10335
10344
  // 选中状态
10336
- Z.thumbnails,
10337
- Z.src,
10338
- Z.type,
10339
- !!Z.separatedAudioClipId,
10345
+ Y.thumbnails,
10346
+ Y.src,
10347
+ Y.type,
10348
+ !!Y.separatedAudioClipId,
10340
10349
  !0
10341
10350
  );
10342
10351
  }
10343
10352
  }
10344
10353
  }
10345
- u && this.onClipCrossTrackPreview && this.config.id && !Y ? this.onClipCrossTrackPreview(A, s.dragTargetTrackY, this.config.id) !== "self" && this.hideDropPreview() : Y ? this.hideDropPreview() : this.showDropPreview(A), this.updateSnapGuideLine(O.guideTime);
10354
+ f && this.onClipCrossTrackPreview && this.config.id && !F ? this.onClipCrossTrackPreview(E, s.dragTargetTrackY, this.config.id) !== "self" && this.hideDropPreview() : F ? this.hideDropPreview() : this.showDropPreview(E), this.updateSnapGuideLine(k.guideTime);
10346
10355
  } else
10347
- this.hideDropPreview(), (b = this.onClearDropPreview) == null || b.call(this), this.updateSnapGuideLine(null);
10348
- i && this.updateEdgeAutoScrollState(c, h.width), this.layer.batchDraw(), (w = this.dragOverlayLayer) == null || w.batchDraw();
10356
+ this.hideDropPreview(), (w = this.onClearDropPreview) == null || w.call(this), this.updateSnapGuideLine(null);
10357
+ i && this.updateEdgeAutoScrollState(d, c.width), this.layer.batchDraw(), (A = this.dragOverlayLayer) == null || A.batchDraw();
10349
10358
  }
10350
10359
  buildPreviewClip(e, t, i, n, s) {
10351
10360
  const r = i - n.pointerStartX + (this.scrollLeft - n.dragStartScrollLeft), o = N.pixelsToTime(r, this.zoom);
@@ -10504,8 +10513,8 @@ const Se = class Se {
10504
10513
  guideTime: l.guideTime
10505
10514
  };
10506
10515
  }
10507
- applyPreviewClipState(e) {
10508
- return this.selectedClip && typeof this.selectedClip.applyPreviewState == "function" ? (this.selectedClip.applyPreviewState(e), !0) : (this.isVisualUpdate = !0, this.handleClipUpdate(e), this.isVisualUpdate = !1, !1);
10516
+ applyPreviewClipState(e, t) {
10517
+ return e && typeof e.applyPreviewState == "function" ? (e.applyPreviewState(t), !0) : (this.isVisualUpdate = !0, this.handleClipUpdate(t), this.isVisualUpdate = !1, !1);
10509
10518
  }
10510
10519
  setClipDragOverlayActive(e, t) {
10511
10520
  var o, l;
@@ -10579,7 +10588,7 @@ const Se = class Se {
10579
10588
  };
10580
10589
  g(Se, "DEFAULT_DRAG_ACTIVATION_THRESHOLD", 4), g(Se, "DEFAULT_CLIP_SNAP_THRESHOLD", 8), g(Se, "AUTO_SCROLL_EDGE_THRESHOLD", 48), g(Se, "AUTO_SCROLL_MAX_SPEED", 18);
10581
10590
  let Mi = Se;
10582
- class dh {
10591
+ class uh {
10583
10592
  constructor(e, t, i, n, s, r) {
10584
10593
  g(this, "layer");
10585
10594
  g(this, "playheadGroup");
@@ -10595,7 +10604,7 @@ class dh {
10595
10604
  [0, 0, 0, n],
10596
10605
  this.theme.playhead,
10597
10606
  1
10598
- ), this.playheadGroup.add(this.playheadLine), this.playheadTriangle = new X.RegularPolygon({
10607
+ ), this.playheadGroup.add(this.playheadLine), this.playheadTriangle = new U.RegularPolygon({
10599
10608
  x: 0,
10600
10609
  y: 5,
10601
10610
  sides: 3,
@@ -12143,14 +12152,20 @@ function ae(a) {
12143
12152
  function wl(a) {
12144
12153
  return `${a.clip.id}:${Math.floor(a.mediaTime / yl)}`;
12145
12154
  }
12146
- function Fe(a) {
12155
+ function kl(a, e) {
12156
+ const t = a.indexOf("#"), i = t >= 0 ? a.slice(t) : "", n = t >= 0 ? a.slice(0, t) : a, s = n.indexOf("?"), r = s >= 0 ? n.slice(0, s) : n, o = s >= 0 ? n.slice(s + 1) : "", l = new URLSearchParams(o);
12157
+ l.set("trackid", e);
12158
+ const h = l.toString();
12159
+ return `${r}${h ? `?${h}` : ""}${i}`;
12160
+ }
12161
+ function Ve(a) {
12147
12162
  return typeof (a == null ? void 0 : a.then) == "function";
12148
12163
  }
12149
- function kl(a, e) {
12164
+ function Pl(a, e) {
12150
12165
  var t;
12151
12166
  return ((t = a.entry) == null ? void 0 : t.clip.id) === e;
12152
12167
  }
12153
- function Pl(a, e) {
12168
+ function _l(a, e) {
12154
12169
  const t = new Map(a.activeClips.map((s) => [s.trackId, s])), i = new Map(a.nextClips.map((s) => [s.trackId, s])), n = /* @__PURE__ */ new Map();
12155
12170
  return e.forEach((s) => {
12156
12171
  n.set(s.trackId, { kind: s.kind, order: s.order });
@@ -12185,7 +12200,7 @@ function Pl(a, e) {
12185
12200
  };
12186
12201
  }).sort((s, r) => s.order - r.order);
12187
12202
  }
12188
- class _l {
12203
+ class xl {
12189
12204
  constructor(e = {}, t = {}) {
12190
12205
  g(this, "container", null);
12191
12206
  g(this, "rootElement", null);
@@ -12314,7 +12329,7 @@ class _l {
12314
12329
  kind: o.current.kind,
12315
12330
  order: ((h = o.current.entry) == null ? void 0 : h.trackOrder) ?? ((c = o.preload.entry) == null ? void 0 : c.trackOrder) ?? 1e4 + l
12316
12331
  };
12317
- }), s = Pl(e, t).map((r) => this.applyTrackPlan(r)).filter((r) => Fe(r));
12332
+ }), s = _l(e, t).map((r) => this.applyTrackPlan(r)).filter((r) => Ve(r));
12318
12333
  if (this.isSyncProjecting = s.length > 0, this.refreshVisualLayout(), this.refreshRuntimeState(), s.length === 0) {
12319
12334
  this.refreshVisualLayout(), this.refreshRuntimeState();
12320
12335
  return;
@@ -12332,7 +12347,7 @@ class _l {
12332
12347
  });
12333
12348
  }
12334
12349
  applyAspectRatio(e) {
12335
- this.requestedAspectRatio = Ve(e), this.updateFrameLayout();
12350
+ this.requestedAspectRatio = Ye(e), this.updateFrameLayout();
12336
12351
  }
12337
12352
  getAspectRatio() {
12338
12353
  return vl(this.requestedAspectRatio, this.resolvedAutoAspectRatio);
@@ -12389,11 +12404,11 @@ class _l {
12389
12404
  ...ae(r.element)
12390
12405
  }), r.isLoading = !0, r.phase !== "recovering" && (r.phase = "binding"), this.refreshRuntimeState();
12391
12406
  }, h = (w) => {
12392
- var k;
12407
+ var A;
12393
12408
  this.logLoadTrace("info", `media.${w.type}`, this.buildSlotTraceData(r, ae(r.element))), L.debug("TimelinePreviewSession", "media event: ready", {
12394
12409
  trackId: r.trackId,
12395
12410
  role: r.role,
12396
- clipId: ((k = r.entry) == null ? void 0 : k.clip.id) ?? null,
12411
+ clipId: ((A = r.entry) == null ? void 0 : A.clip.id) ?? null,
12397
12412
  eventType: w.type,
12398
12413
  phase: r.phase,
12399
12414
  ...ae(r.element)
@@ -12451,7 +12466,7 @@ class _l {
12451
12466
  ...ae(r.element)
12452
12467
  }), r.isSeeking = !1, r.isBuffering = !1, r.entry && r.phase !== "failed" && (r.phase = r.isActive ? "active" : "primed"), this.refreshRuntimeState();
12453
12468
  }, p = (w) => {
12454
- var k;
12469
+ var A;
12455
12470
  this.logLoadTrace(w === "error" ? "error" : "warn", `media.${w}`, this.buildSlotTraceData(r, {
12456
12471
  error: r.element.error ? {
12457
12472
  code: r.element.error.code,
@@ -12461,7 +12476,7 @@ class _l {
12461
12476
  })), L.warn("TimelinePreviewSession", `media event: ${w}`, {
12462
12477
  trackId: r.trackId,
12463
12478
  role: r.role,
12464
- clipId: ((k = r.entry) == null ? void 0 : k.clip.id) ?? null,
12479
+ clipId: ((A = r.entry) == null ? void 0 : A.clip.id) ?? null,
12465
12480
  phase: r.phase,
12466
12481
  error: r.element.error ? {
12467
12482
  code: r.element.error.code,
@@ -12508,9 +12523,9 @@ class _l {
12508
12523
  }
12509
12524
  applyTrackPlan(e) {
12510
12525
  let t = this.getTrackSlots(e.trackId, e.kind);
12511
- e.current.entry && kl(t.preload, e.current.entry.clip.id) && (this.swapTrackSlots(e.trackId), t = this.getTrackSlots(e.trackId, e.kind));
12526
+ e.current.entry && Pl(t.preload, e.current.entry.clip.id) && (this.swapTrackSlots(e.trackId), t = this.getTrackSlots(e.trackId, e.kind));
12512
12527
  const i = this.applySlotTarget(t.current, e.current), n = this.applySlotTarget(t.preload, e.preload);
12513
- if (Fe(i) || Fe(n))
12528
+ if (Ve(i) || Ve(n))
12514
12529
  return Promise.all([
12515
12530
  Promise.resolve(i),
12516
12531
  Promise.resolve(n)
@@ -12527,7 +12542,7 @@ class _l {
12527
12542
  return;
12528
12543
  }
12529
12544
  const r = this.resolveDesiredSource(e, t.entry, i);
12530
- if (Fe(r))
12545
+ if (Ve(r))
12531
12546
  return r.then((o) => {
12532
12547
  if (!(!o || !this.isCurrentRequest(e, i, t.entry))) {
12533
12548
  if (e.desiredSource = o, this.configureAudioRouting(e, t.entry), this.slotNeedsRecovery(e, o))
@@ -12545,10 +12560,10 @@ class _l {
12545
12560
  resolveDesiredSource(e, t, i) {
12546
12561
  const n = this.dependencies.previewSourceResolver;
12547
12562
  if (!n)
12548
- return t.clip.src;
12563
+ return this.decorateSlotSourceUrl(e, t.clip.src);
12549
12564
  try {
12550
12565
  const s = n(t.clip);
12551
- if (Fe(s)) {
12566
+ if (Ve(s)) {
12552
12567
  e.resolveToken += 1;
12553
12568
  const r = e.resolveToken;
12554
12569
  return e.phase = "binding", e.isLoading = !0, this.logLoadTrace("info", "source.resolve.pending", this.buildSlotTraceData(e, {
@@ -12562,7 +12577,7 @@ class _l {
12562
12577
  resolvedUrl: o.url,
12563
12578
  mimeType: o.mimeType,
12564
12579
  mediaKind: o.kind
12565
- })), o.url) : (this.logLoadTrace("warn", "source.resolve.missing", this.buildSlotTraceData(e, {
12580
+ })), this.decorateSlotSourceUrl(e, o.url)) : (this.logLoadTrace("warn", "source.resolve.missing", this.buildSlotTraceData(e, {
12566
12581
  clipId: t.clip.id,
12567
12582
  source: t.clip.src
12568
12583
  })), this.failSlot(e, t, "未找到可用预览源"), null)).catch((o) => (this.logLoadTrace("error", "source.resolve.failed", this.buildSlotTraceData(e, {
@@ -12580,7 +12595,7 @@ class _l {
12580
12595
  resolvedUrl: s.url,
12581
12596
  mimeType: s.mimeType,
12582
12597
  mediaKind: s.kind
12583
- })), s.url) : (this.logLoadTrace("warn", "source.resolve.missing", this.buildSlotTraceData(e, {
12598
+ })), this.decorateSlotSourceUrl(e, s.url)) : (this.logLoadTrace("warn", "source.resolve.missing", this.buildSlotTraceData(e, {
12584
12599
  clipId: t.clip.id,
12585
12600
  source: t.clip.src
12586
12601
  })), this.failSlot(e, t, "未找到可用预览源"), null);
@@ -12595,6 +12610,9 @@ class _l {
12595
12610
  }), this.failSlot(e, t, "预览源解析失败"), null;
12596
12611
  }
12597
12612
  }
12613
+ decorateSlotSourceUrl(e, t) {
12614
+ return e.kind !== "video" || !t ? t : kl(t, e.trackId);
12615
+ }
12598
12616
  slotNeedsRecovery(e, t) {
12599
12617
  const i = it(e.element);
12600
12618
  return !!(e.forceRecover || !i || i !== t || (typeof e.element.networkState == "number" ? e.element.networkState : null) === fl);
@@ -12612,7 +12630,7 @@ class _l {
12612
12630
  if (!e.entry || !s || n !== void 0 && !this.isCurrentRequest(e, n, e.entry))
12613
12631
  return;
12614
12632
  const r = e.desiredSource ?? this.resolveDesiredSource(e, e.entry, e.applyToken);
12615
- if (Fe(r))
12633
+ if (Ve(r))
12616
12634
  return r.then((o) => {
12617
12635
  o && this.finishSlotRecovery(e, t, s, o, n);
12618
12636
  });
@@ -12782,7 +12800,7 @@ class _l {
12782
12800
  if (!i)
12783
12801
  return e.clip.src;
12784
12802
  const n = i(e.clip);
12785
- if (!Fe(n))
12803
+ if (!Ve(n))
12786
12804
  return (n == null ? void 0 : n.url) ?? null;
12787
12805
  this.isAspectRatioProbeLoading = !0, this.refreshRuntimeState();
12788
12806
  const s = await n;
@@ -12817,48 +12835,49 @@ class _l {
12817
12835
  e <= 0 || t <= 0 || (this.resolvedAutoAspectRatio = { width: e, height: t }, this.updateFrameLayout(), vt(this.requestedAspectRatio.mode) && ((n = (i = this.callbacks).onAspectRatioChange) == null || n.call(i, this.getAspectRatio())));
12818
12836
  }
12819
12837
  refreshRuntimeState() {
12820
- var u, f, p, y, S, C, T;
12838
+ var y, S, C, T, b, w, A;
12821
12839
  const e = [];
12822
- let t = this.isAspectRatioProbeLoading ? 1 : 0, i = !1, n = null, s = !1, r = !1, o = !1;
12823
- for (const { current: b, preload: w } of this.trackSlots.values())
12824
- for (const k of [b, w]) {
12825
- const _ = it(k.element) || null;
12840
+ let t = this.isAspectRatioProbeLoading ? 1 : 0, i = !1, n = null, s = !1, r = !1, o = !1, l = !1, h = !1, c = !1;
12841
+ for (const { current: P, preload: D } of this.trackSlots.values())
12842
+ for (const k of [P, D]) {
12843
+ const E = it(k.element) || null;
12826
12844
  e.push({
12827
12845
  trackId: k.trackId,
12828
12846
  role: k.role,
12829
12847
  kind: k.kind,
12830
- clipId: ((u = k.entry) == null ? void 0 : u.clip.id) ?? null,
12848
+ clipId: ((y = k.entry) == null ? void 0 : y.clip.id) ?? null,
12831
12849
  desiredSource: k.desiredSource,
12832
- actualSource: _,
12850
+ actualSource: E,
12833
12851
  phase: k.phase,
12834
12852
  retryCount: k.retryCount,
12835
12853
  errorMessage: k.errorMessage
12836
- }), k.phase !== "idle" && (s = !0), (k.isLoading || k.phase === "binding" || k.phase === "recovering") && (t += 1), k.isBuffering && (i = !0), k.phase === "failed" && !n && (n = k.errorMessage || "资源加载异常,请刷新重试", r = !0), k.isActive && k.entry && (k.isSeeking || k.phase !== "active" && k.phase !== "failed") && (o = !0);
12854
+ }), k.phase !== "idle" && (s = !0), k.entry && k.phase !== "idle" && k.phase !== "failed" && (o = !0), (k.isLoading || k.phase === "binding" || k.phase === "recovering") && (t += 1), k.isBuffering && (h = !0), k.phase === "failed" && (r = !0), k.phase === "failed" && !n && (n = k.errorMessage || "资源加载异常,请刷新重试"), k.isActive && k.entry && (k.isSeeking || k.phase !== "active" && k.phase !== "failed") && (l = !0), k.role === "current" && k.isActive && k.entry && k.phase === "active" && !k.isLoading && !k.isSeeking && !k.isBuffering && (c = !0);
12837
12855
  }
12838
- let l = "idle";
12839
- this.activeSyncRequestId !== void 0 && this.isSyncProjecting ? l = "awaiting-sync" : r ? l = "failed" : t > 0 || i || o ? l = "awaiting-media" : s && (l = "ready"), this.loadingCount !== t && (this.loadingCount = t, (p = (f = this.callbacks).onSourceLoadingChange) == null || p.call(f, t)), this.syncVisibleBufferingState(i);
12840
- const h = {
12856
+ i = h && !c;
12857
+ let d = "idle";
12858
+ this.activeSyncRequestId !== void 0 && this.isSyncProjecting ? d = "awaiting-sync" : r && !o ? d = "failed" : t > 0 || i || l ? d = "awaiting-media" : s && (d = "ready"), d !== "failed" && (n = null), this.loadingCount !== t && (this.loadingCount = t, (C = (S = this.callbacks).onSourceLoadingChange) == null || C.call(S, t)), this.syncVisibleBufferingState(i);
12859
+ const u = {
12841
12860
  ...this.activeSyncRequestId !== void 0 ? { syncRequestId: this.activeSyncRequestId } : {},
12842
- phase: l,
12861
+ phase: d,
12843
12862
  loadingCount: t,
12844
12863
  isBuffering: i,
12845
12864
  errorMessage: n,
12846
12865
  slots: e
12847
- }, c = this.lastRuntimeState, d = JSON.stringify(h);
12848
- d !== this.lastRuntimeSignature && (this.lastRuntimeSignature = d, this.lastRuntimeState = h, (c.phase !== h.phase || c.loadingCount !== h.loadingCount || c.isBuffering !== h.isBuffering || c.errorMessage !== h.errorMessage) && this.logLoadTrace(h.phase === "failed" ? "error" : "info", "runtime.state", {
12849
- previousPhase: c.phase,
12850
- phase: h.phase,
12851
- loadingCount: h.loadingCount,
12852
- isBuffering: h.isBuffering,
12853
- errorMessage: h.errorMessage,
12854
- slots: h.slots.map((b) => ({
12855
- trackId: b.trackId,
12856
- role: b.role,
12857
- clipId: b.clipId,
12858
- phase: b.phase,
12859
- retryCount: b.retryCount
12866
+ }, f = this.lastRuntimeState, p = JSON.stringify(u);
12867
+ p !== this.lastRuntimeSignature && (this.lastRuntimeSignature = p, this.lastRuntimeState = u, (f.phase !== u.phase || f.loadingCount !== u.loadingCount || f.isBuffering !== u.isBuffering || f.errorMessage !== u.errorMessage) && this.logLoadTrace(u.phase === "failed" ? "error" : "info", "runtime.state", {
12868
+ previousPhase: f.phase,
12869
+ phase: u.phase,
12870
+ loadingCount: u.loadingCount,
12871
+ isBuffering: u.isBuffering,
12872
+ errorMessage: u.errorMessage,
12873
+ slots: u.slots.map((P) => ({
12874
+ trackId: P.trackId,
12875
+ role: P.role,
12876
+ clipId: P.clipId,
12877
+ phase: P.phase,
12878
+ retryCount: P.retryCount
12860
12879
  }))
12861
- }), (S = (y = this.callbacks).onRuntimeStateChange) == null || S.call(y, h)), (l === "ready" || l === "failed") && h.syncRequestId !== void 0 && this.lastSettledSyncRequestId !== h.syncRequestId && (this.lastSettledSyncRequestId = h.syncRequestId, (T = (C = this.callbacks).onSyncProcessed) == null || T.call(C, h.syncRequestId)), this.refreshPendingOverlay();
12880
+ }), (b = (T = this.callbacks).onRuntimeStateChange) == null || b.call(T, u)), (d === "ready" || d === "failed") && u.syncRequestId !== void 0 && this.lastSettledSyncRequestId !== u.syncRequestId && (this.lastSettledSyncRequestId = u.syncRequestId, (A = (w = this.callbacks).onSyncProcessed) == null || A.call(w, u.syncRequestId)), this.refreshPendingOverlay();
12862
12881
  }
12863
12882
  syncVisibleBufferingState(e) {
12864
12883
  var t, i;
@@ -12965,7 +12984,7 @@ class _l {
12965
12984
  return ((t = this.transientVisualTransform) == null ? void 0 : t.clipId) === e.clip.id ? this.transientVisualTransform.transform : fe(e.clip.visualTransform);
12966
12985
  }
12967
12986
  }
12968
- class xl extends _l {
12987
+ class Il extends xl {
12969
12988
  constructor(e = {}) {
12970
12989
  super(e.callbacks, {
12971
12990
  previewSourceResolver: e.previewSourceResolver,
@@ -12978,11 +12997,11 @@ class xl extends _l {
12978
12997
  this.detach();
12979
12998
  }
12980
12999
  }
12981
- function Il(a) {
13000
+ function Al(a) {
12982
13001
  return "dom";
12983
13002
  }
12984
- const Al = 36e5, El = 3e5;
12985
- function Ml(a) {
13003
+ const El = 36e5, Ml = 3e5;
13004
+ function Ll(a) {
12986
13005
  return a.length === 0 ? 0 : a.reduce((e, t) => Math.max(e, t.startTime + t.duration), 0);
12987
13006
  }
12988
13007
  function Ln(a) {
@@ -12992,7 +13011,7 @@ function Ln(a) {
12992
13011
  return Math.max(0, t - e);
12993
13012
  }
12994
13013
  function Rn(a) {
12995
- return Math.max(a + El, Al);
13014
+ return Math.max(a + Ml, El);
12996
13015
  }
12997
13016
  class Dn {
12998
13017
  constructor(e = {}) {
@@ -13020,10 +13039,10 @@ class Dn {
13020
13039
  this.listeners.clear();
13021
13040
  }
13022
13041
  }
13023
- function Ll(a) {
13042
+ function Rl(a) {
13024
13043
  return [...a].sort((e, t) => e.order - t.order);
13025
13044
  }
13026
- function Rl(a) {
13045
+ function Dl(a) {
13027
13046
  return [...a].sort((e, t) => e.startTime - t.startTime);
13028
13047
  }
13029
13048
  function fi(a, e, t) {
@@ -13039,15 +13058,15 @@ function fi(a, e, t) {
13039
13058
  hasAudio: !0
13040
13059
  };
13041
13060
  }
13042
- class Dl {
13061
+ class Ol {
13043
13062
  resolveActiveClipsAtTime(e, t) {
13044
13063
  return this.resolvePlaybackPlan(e, t).activeClips;
13045
13064
  }
13046
13065
  resolvePlaybackPlan(e, t) {
13047
- const i = Ll(e), n = [], s = [];
13066
+ const i = Rl(e), n = [], s = [];
13048
13067
  let r = null;
13049
13068
  for (const o of i) {
13050
- const l = Rl(o.clips), h = l.find((d) => t >= d.startTime && t < d.endTime);
13069
+ const l = Dl(o.clips), h = l.find((d) => t >= d.startTime && t < d.endTime);
13051
13070
  if (h) {
13052
13071
  const d = h.startTimeAtSource + (t - h.startTime);
13053
13072
  n.push(fi(o, h, d));
@@ -13065,7 +13084,7 @@ class Dl {
13065
13084
  };
13066
13085
  }
13067
13086
  }
13068
- class Ol {
13087
+ class Bl {
13069
13088
  constructor(e) {
13070
13089
  g(this, "options");
13071
13090
  g(this, "_previewSession");
@@ -13151,8 +13170,8 @@ class Ol {
13151
13170
  };
13152
13171
  }
13153
13172
  }
13154
- const Bl = 8e3;
13155
- class Gl {
13173
+ const Gl = 8e3;
13174
+ class Hl {
13156
13175
  constructor(e) {
13157
13176
  g(this, "callbacks");
13158
13177
  g(this, "pendingTimeoutMs");
@@ -13161,7 +13180,7 @@ class Gl {
13161
13180
  g(this, "_previewAwaitingMedia", !1);
13162
13181
  g(this, "_pendingPreviewState", null);
13163
13182
  g(this, "_nextPendingPreviewSyncRequestId", 0);
13164
- this.callbacks = e.callbacks, this.pendingTimeoutMs = e.pendingTimeoutMs ?? Bl;
13183
+ this.callbacks = e.callbacks, this.pendingTimeoutMs = e.pendingTimeoutMs ?? Gl;
13165
13184
  }
13166
13185
  get previewSourceLoadingCount() {
13167
13186
  return this._previewSourceLoadingCount;
@@ -13195,7 +13214,7 @@ class Gl {
13195
13214
  }
13196
13215
  handleRuntimeStateChange(e) {
13197
13216
  const t = Math.max(0, e.loadingCount), i = this._previewBuffering !== e.isBuffering, n = this._previewSourceLoadingCount !== t;
13198
- this._previewAwaitingMedia = e.phase === "awaiting-media", this._previewBuffering = e.isBuffering, this._previewSourceLoadingCount = t, this._pendingPreviewState && e.syncRequestId === this._pendingPreviewState.syncRequestId && ((e.phase === "awaiting-media" || e.phase === "ready" || e.phase === "failed") && (this._pendingPreviewState.awaitingSync = !1), e.phase === "failed" ? this._pendingPreviewState.errorMessage = e.errorMessage || "资源加载异常,请刷新重试" : this._pendingPreviewState.errorMessage || (this._pendingPreviewState.errorMessage = null)), i && this.callbacks.emitBufferingStateChange(e.isBuffering), n && this.callbacks.emitSourceLoadingStateChange(), this.updatePendingPreviewState();
13217
+ this._previewAwaitingMedia = e.phase === "awaiting-media", this._previewBuffering = e.isBuffering, this._previewSourceLoadingCount = t, this._pendingPreviewState && e.syncRequestId === this._pendingPreviewState.syncRequestId && ((e.phase === "awaiting-media" || e.phase === "ready" || e.phase === "failed") && (this._pendingPreviewState.awaitingSync = !1), e.phase === "failed" ? this._pendingPreviewState.errorMessage = e.errorMessage || "资源加载异常,请刷新重试" : this._pendingPreviewState.errorMessage = null), i && this.callbacks.emitBufferingStateChange(e.isBuffering), n && this.callbacks.emitSourceLoadingStateChange(), this.updatePendingPreviewState();
13199
13218
  }
13200
13219
  markSyncProcessed(e) {
13201
13220
  this._pendingPreviewState && e === this._pendingPreviewState.syncRequestId && (this._pendingPreviewState.awaitingSync = !1), this.updatePendingPreviewState();
@@ -13264,7 +13283,7 @@ class Gl {
13264
13283
  (e = this._pendingPreviewState) != null && e.timeoutId && (clearTimeout(this._pendingPreviewState.timeoutId), this._pendingPreviewState.timeoutId = null);
13265
13284
  }
13266
13285
  }
13267
- function Hl(a) {
13286
+ function Nl(a) {
13268
13287
  var t;
13269
13288
  const e = a.getPrimarySelectedClip() || ((t = a.findFallbackSelectedClip) == null ? void 0 : t.call(a)) || null;
13270
13289
  return {
@@ -13272,7 +13291,7 @@ function Hl(a) {
13272
13291
  hasSelectedClip: !!e
13273
13292
  };
13274
13293
  }
13275
- function Nl(a) {
13294
+ function zl(a) {
13276
13295
  var i;
13277
13296
  const e = a.resolveSelectedClip(), t = ((i = e.clip) == null ? void 0 : i.id) || null;
13278
13297
  return t === a.lastSelectedClipId ? a.lastSelectedClipId : (a.emitSelectedClipChange(e), t);
@@ -13281,7 +13300,7 @@ function Rs(a, e) {
13281
13300
  var t, i, n, s;
13282
13301
  return ((i = (t = a.findById(e)) == null ? void 0 : t.getId) == null ? void 0 : i.call(t)) || ((s = (n = a.getLastTrack()) == null ? void 0 : n.getId) == null ? void 0 : s.call(n)) || e;
13283
13302
  }
13284
- function zl(a) {
13303
+ function Fl(a) {
13285
13304
  if (a.placement.status === "use_existing_track")
13286
13305
  return a.trackCollection.addClipToTrack(a.placement.trackId, a.clip);
13287
13306
  const e = a.createTrack(a.placement.trackType, a.placement.suggestedTrackName), t = Rs(a.trackCollection, e);
@@ -13290,14 +13309,14 @@ function zl(a) {
13290
13309
  function On(a, e, t) {
13291
13310
  return e.trackId ? a.removeClipFromTrack(e.trackId, t) : !1;
13292
13311
  }
13293
- function Fl(a) {
13312
+ function Vl(a) {
13294
13313
  return a.trackCollection.moveClipToTrack(
13295
13314
  a.command.clip,
13296
13315
  a.command.sourceTrackId,
13297
13316
  a.command.targetTrackId
13298
13317
  );
13299
13318
  }
13300
- function Vl(a) {
13319
+ function Yl(a) {
13301
13320
  const e = a.createTrack(a.trackType, a.trackName), t = Rs(a.trackCollection, e);
13302
13321
  return t ? a.trackCollection.moveClipToTrack(a.clip, a.currentTrackId, t) : !1;
13303
13322
  }
@@ -13305,11 +13324,11 @@ function Ee(a) {
13305
13324
  var e, t, i, n, s;
13306
13325
  (e = a.checkTrackDurationChange) == null || e.call(a), (t = a.updateCanPlayState) == null || t.call(a), (i = a.updateTrackInfoPanel) == null || i.call(a), (n = a.handleClipChange) == null || n.call(a), (s = a.cleanupEmptyTracks) == null || s.call(a);
13307
13326
  }
13308
- function Yl(a) {
13327
+ function Wl(a) {
13309
13328
  var e, t;
13310
13329
  a.notifySelectionChange(), (e = a.cleanupEmptyTracks) == null || e.call(a), a.updateTrackInfoPanel(), (t = a.batchDraw) == null || t.call(a), a.syncPreviewSession();
13311
13330
  }
13312
- class Wl {
13331
+ class Xl {
13313
13332
  constructor() {
13314
13333
  g(this, "panel", null);
13315
13334
  }
@@ -13409,7 +13428,7 @@ class Gn {
13409
13428
  );
13410
13429
  }
13411
13430
  }
13412
- class Xl {
13431
+ class Ul {
13413
13432
  constructor(e) {
13414
13433
  this.tracks = e;
13415
13434
  }
@@ -13546,7 +13565,7 @@ class Xl {
13546
13565
  return typeof e.getId == "function" ? e.getId() : typeof e.id == "string" ? e.id : null;
13547
13566
  }
13548
13567
  }
13549
- class Ul {
13568
+ class $l {
13550
13569
  constructor(e = []) {
13551
13570
  g(this, "tracks", []);
13552
13571
  g(this, "trackCounter", 0);
@@ -13638,24 +13657,24 @@ class Ul {
13638
13657
  return this.tracks.filter((t) => t.type === e).length;
13639
13658
  }
13640
13659
  }
13641
- function We(a) {
13660
+ function Xe(a) {
13642
13661
  return a === "video" ? De.VIDEO : De.AUDIO;
13643
13662
  }
13644
13663
  function ut(a, e, t) {
13645
13664
  let i = t;
13646
13665
  for (const n of a) {
13647
13666
  if (n.id === e) break;
13648
- i += We(n.type);
13667
+ i += Xe(n.type);
13649
13668
  }
13650
13669
  return i;
13651
13670
  }
13652
13671
  function Hn(a, e) {
13653
- return a.reduce((t, i) => t + We(i.type), e);
13672
+ return a.reduce((t, i) => t + Xe(i.type), e);
13654
13673
  }
13655
- function $l(a, e) {
13674
+ function ql(a, e) {
13656
13675
  let t = e;
13657
13676
  return a.map((i) => {
13658
- const n = We(i.type), s = {
13677
+ const n = Xe(i.type), s = {
13659
13678
  trackId: i.id,
13660
13679
  y: t,
13661
13680
  height: n
@@ -13664,7 +13683,7 @@ function $l(a, e) {
13664
13683
  });
13665
13684
  }
13666
13685
  const Ds = 200, Os = 8, Nn = "timeline-manager-managed-layout-styles";
13667
- function ql() {
13686
+ function Kl() {
13668
13687
  if (typeof document > "u" || document.getElementById(Nn))
13669
13688
  return;
13670
13689
  const a = document.createElement("style");
@@ -13696,8 +13715,8 @@ function ql() {
13696
13715
  }
13697
13716
  `, document.head.appendChild(a);
13698
13717
  }
13699
- function Kl(a, e) {
13700
- ql();
13718
+ function jl(a, e) {
13719
+ Kl();
13701
13720
  const t = e.leftPanelWidth ?? Ds, i = e.scrollbarSize ?? Os;
13702
13721
  a.innerHTML = "", a.classList.add("timeline-manager-root"), a.style.gridTemplateColumns = `${t}px minmax(0, 1fr)`, a.style.gridTemplateRows = `${e.timeScaleHeight}px minmax(0, 1fr)`, a.style.background = e.theme.background;
13703
13722
  const n = we("div");
@@ -13735,7 +13754,7 @@ function we(a) {
13735
13754
  function Xt(a, e) {
13736
13755
  a.style.position = "relative", a.style.minWidth = "0", a.style.minHeight = "0", a.style.maxWidth = "100%", a.style.boxSizing = "border-box", a.style.background = e.background, a.style.color = e.clipName;
13737
13756
  }
13738
- class jl {
13757
+ class Zl {
13739
13758
  constructor(e) {
13740
13759
  g(this, "currentTime");
13741
13760
  g(this, "playState");
@@ -13805,7 +13824,7 @@ class Bs {
13805
13824
  return this.selectedClipIds.size;
13806
13825
  }
13807
13826
  }
13808
- class Zl {
13827
+ class Jl {
13809
13828
  constructor(e) {
13810
13829
  g(this, "zoom");
13811
13830
  g(this, "duration");
@@ -13864,11 +13883,11 @@ class zn {
13864
13883
  g(this, "selectionStore");
13865
13884
  g(this, "playbackStore");
13866
13885
  g(this, "viewportStore");
13867
- this.selectionStore = new Bs(), this.playbackStore = new jl({
13886
+ this.selectionStore = new Bs(), this.playbackStore = new Zl({
13868
13887
  currentTime: e.currentTime,
13869
13888
  playState: e.playState,
13870
13889
  speed: e.speed
13871
- }), this.viewportStore = new Zl({
13890
+ }), this.viewportStore = new Jl({
13872
13891
  zoom: e.zoom,
13873
13892
  duration: e.duration,
13874
13893
  scrollLeft: e.scrollLeft,
@@ -13963,7 +13982,7 @@ class zn {
13963
13982
  this.viewportStore.setContentHeight(e);
13964
13983
  }
13965
13984
  }
13966
- class Jl {
13985
+ class Ql {
13967
13986
  constructor(e, t, i, n, s) {
13968
13987
  g(this, "stage");
13969
13988
  g(this, "layer");
@@ -14314,11 +14333,11 @@ class Fn {
14314
14333
  g(this, "handleStageMouseLeave", () => {
14315
14334
  this.isDragging || (this.container.style.cursor = "default");
14316
14335
  });
14317
- this.container = e.container, this.orientation = e.orientation, this.theme = e.theme, this.onScrollChange = e.onScrollChange, this.leadingInset = Math.max(0, e.leadingInset || 0), this.trailingInset = Math.max(0, e.trailingInset || 0), this.container.innerHTML = "", this.container.style.userSelect = "none", this.container.style.background = "transparent", this.stage = new X.Stage({
14336
+ this.container = e.container, this.orientation = e.orientation, this.theme = e.theme, this.onScrollChange = e.onScrollChange, this.leadingInset = Math.max(0, e.leadingInset || 0), this.trailingInset = Math.max(0, e.trailingInset || 0), this.container.innerHTML = "", this.container.style.userSelect = "none", this.container.style.background = "transparent", this.stage = new U.Stage({
14318
14337
  container: this.container,
14319
14338
  width: this.container.clientWidth,
14320
14339
  height: this.container.clientHeight
14321
- }), this.layer = new X.Layer(), this.layer.name("scrollbar-layer"), this.stage.add(this.layer), this.hitAreaRect = ie.createRect(0, 0, 0, 0, "rgba(0, 0, 0, 0.001)", "transparent", 0), this.hitAreaRect.name("scrollbar-hit-area"), this.thumbRect = ie.createRect(0, 0, 0, 0, this.theme.scrollbarThumb || "#444444", this.theme.scrollbarThumbBorder || this.theme.scrollbarBorder || "#555555", 1), this.thumbRect.name("scrollbar-thumb"), this.thumbRect.cornerRadius(999), this.layer.add(this.hitAreaRect), this.layer.add(this.thumbRect), this.stage.on("mousedown", this.handleStageMouseDown), this.stage.on("mouseup", this.handleStageMouseUp), this.stage.on("mouseenter", this.handleStageMouseEnter), this.stage.on("mousemove", this.handleStageMouseMove), this.stage.on("mouseleave", this.handleStageMouseLeave), this.render();
14340
+ }), this.layer = new U.Layer(), this.layer.name("scrollbar-layer"), this.stage.add(this.layer), this.hitAreaRect = ie.createRect(0, 0, 0, 0, "rgba(0, 0, 0, 0.001)", "transparent", 0), this.hitAreaRect.name("scrollbar-hit-area"), this.thumbRect = ie.createRect(0, 0, 0, 0, this.theme.scrollbarThumb || "#444444", this.theme.scrollbarThumbBorder || this.theme.scrollbarBorder || "#555555", 1), this.thumbRect.name("scrollbar-thumb"), this.thumbRect.cornerRadius(999), this.layer.add(this.hitAreaRect), this.layer.add(this.thumbRect), this.stage.on("mousedown", this.handleStageMouseDown), this.stage.on("mouseup", this.handleStageMouseUp), this.stage.on("mouseenter", this.handleStageMouseEnter), this.stage.on("mousemove", this.handleStageMouseMove), this.stage.on("mouseleave", this.handleStageMouseLeave), this.render();
14322
14341
  }
14323
14342
  setViewportMetrics(e, t) {
14324
14343
  this.viewportSize = Math.max(0, e), this.contentSize = Math.max(0, t), this.scrollOffset = this.clampScrollOffset(this.scrollOffset), this.render();
@@ -14405,7 +14424,7 @@ class Fn {
14405
14424
  return this.scrollOffset / i * n;
14406
14425
  }
14407
14426
  }
14408
- class Ql {
14427
+ class eh {
14409
14428
  constructor() {
14410
14429
  g(this, "entries", /* @__PURE__ */ new Map());
14411
14430
  }
@@ -14421,7 +14440,7 @@ class Ql {
14421
14440
  this.entries.clear();
14422
14441
  }
14423
14442
  }
14424
- class eh {
14443
+ class th {
14425
14444
  constructor() {
14426
14445
  g(this, "panel", null);
14427
14446
  g(this, "config", null);
@@ -14468,10 +14487,10 @@ class eh {
14468
14487
  };
14469
14488
  }
14470
14489
  }
14471
- const th = "2.0.5", ih = {
14472
- version: th
14473
- }, nh = 1, sh = 2, rh = 120;
14474
- class uh {
14490
+ const ih = "2.0.6", nh = {
14491
+ version: ih
14492
+ }, sh = 1, rh = 2, ah = 120;
14493
+ class gh {
14475
14494
  constructor(e = {}) {
14476
14495
  g(this, "timeline", null);
14477
14496
  g(this, "tracks", []);
@@ -14535,7 +14554,7 @@ class uh {
14535
14554
  g(this, "rootWheelListener", (e) => {
14536
14555
  this.handleUnifiedWheel(e);
14537
14556
  });
14538
- g(this, "mountManager", new Ql());
14557
+ g(this, "mountManager", new eh());
14539
14558
  g(this, "pendingDraftData", null);
14540
14559
  g(this, "selectionStore", new Bs());
14541
14560
  g(this, "multiDragSession", null);
@@ -14556,7 +14575,7 @@ class uh {
14556
14575
  thumbnailProvider: e.thumbnailProvider,
14557
14576
  previewBackend: e.previewBackend ?? "dom",
14558
14577
  previewSourceResolver: e.previewSourceResolver
14559
- }, L.setConfig(this.config.logConfig), L.debug("TimelineManager", "日志系统初始化完成", { logConfig: this.config.logConfig }), this.thumbnailProvider = e.thumbnailProvider || null, this.trackInfoPanelController = new Wl(), this.eventDispatcher = new Dn({
14578
+ }, L.setConfig(this.config.logConfig), L.debug("TimelineManager", "日志系统初始化完成", { logConfig: this.config.logConfig }), this.thumbnailProvider = e.thumbnailProvider || null, this.trackInfoPanelController = new Xl(), this.eventDispatcher = new Dn({
14560
14579
  can_play_change: () => ({ canPlay: this.canPlay }),
14561
14580
  selected_clip_change: () => this.resolveSelectedClipSnapshot(),
14562
14581
  source_loading_change: () => this.getSourceLoadingState(),
@@ -14581,7 +14600,7 @@ class uh {
14581
14600
  findTrackByClipId: this.findTrackByClipId.bind(this),
14582
14601
  getDefaultTrack: () => this.getDefaultTrackForHistory(),
14583
14602
  loadClipThumbnails: this.loadClipThumbnails.bind(this)
14584
- }), this.trackManager = new Ul(), this.timelineStore = new zn({
14603
+ }), this.trackManager = new $l(), this.timelineStore = new zn({
14585
14604
  currentTime: this.config.currentTime,
14586
14605
  playState: this.config.playState,
14587
14606
  speed: this.config.speed || 1,
@@ -14626,7 +14645,7 @@ class uh {
14626
14645
  return this.timelineCommands || (this.timelineCommands = new wn(this.getTimelineStore())), this.timelineCommands;
14627
14646
  }
14628
14647
  getTrackCollection() {
14629
- return new Xl(this.tracks);
14648
+ return new Ul(this.tracks);
14630
14649
  }
14631
14650
  getTimelinePresentationAdapter() {
14632
14651
  return this.timelinePresentationAdapter || (this.timelinePresentationAdapter = new Bn()), this.timelinePresentationAdapter;
@@ -14653,7 +14672,7 @@ class uh {
14653
14672
  })), this.timelineTrackBridge;
14654
14673
  }
14655
14674
  getTimelinePlaybackResolver() {
14656
- return this.timelinePlaybackResolver || (this.timelinePlaybackResolver = new Dl()), this.timelinePlaybackResolver;
14675
+ return this.timelinePlaybackResolver || (this.timelinePlaybackResolver = new Ol()), this.timelinePlaybackResolver;
14657
14676
  }
14658
14677
  get previewSession() {
14659
14678
  return this.getPreviewRuntimeController().previewSession;
@@ -14710,7 +14729,7 @@ class uh {
14710
14729
  this.getPreviewStateController().nextPendingPreviewSyncRequestId = e;
14711
14730
  }
14712
14731
  getPreviewStateController() {
14713
- return this.previewStateController || (this.previewStateController = new Gl({
14732
+ return this.previewStateController || (this.previewStateController = new Hl({
14714
14733
  callbacks: {
14715
14734
  applyPendingState: (e) => {
14716
14735
  var t, i;
@@ -14732,13 +14751,13 @@ class uh {
14732
14751
  })), this.previewStateController;
14733
14752
  }
14734
14753
  getPreviewRuntimeController() {
14735
- return this.previewRuntimeController || (this.previewRuntimeController = new Ol({
14754
+ return this.previewRuntimeController || (this.previewRuntimeController = new Bl({
14736
14755
  createBackendCallbacks: (e) => this.createPreviewBackendCallbacks(e),
14737
- createBackend: (e, t) => new xl({
14756
+ createBackend: (e, t) => new Il({
14738
14757
  callbacks: t,
14739
14758
  previewSourceResolver: this.config.previewSourceResolver
14740
14759
  }),
14741
- resolveConfiguredBackend: (e) => e || Il(this.config.previewBackend)
14760
+ resolveConfiguredBackend: (e) => e || Al(this.config.previewBackend)
14742
14761
  })), this.previewRuntimeController;
14743
14762
  }
14744
14763
  resolveConfiguredPreviewBackend() {
@@ -14759,7 +14778,7 @@ class uh {
14759
14778
  this.isActivePreviewCallbackToken(e) && this.getPreviewStateController().markSyncProcessed(t);
14760
14779
  },
14761
14780
  onAspectRatioChange: (t) => {
14762
- this.isActivePreviewCallbackToken(e) && (this.previewAspectRatio = Ve(t), this.emitEvent("preview_aspect_ratio_change", { aspectRatio: this.getPreviewAspectRatio() }));
14781
+ this.isActivePreviewCallbackToken(e) && (this.previewAspectRatio = Ye(t), this.emitEvent("preview_aspect_ratio_change", { aspectRatio: this.getPreviewAspectRatio() }));
14763
14782
  },
14764
14783
  onVisualTransformCommit: (t, i) => {
14765
14784
  this.isActivePreviewCallbackToken(e) && this.commitPreviewVisualTransform(t, i);
@@ -15004,7 +15023,7 @@ class uh {
15004
15023
  var n, s, r;
15005
15024
  if (!((n = this.previewSession) != null && n.hasPreview()))
15006
15025
  return;
15007
- const e = this.buildPlaybackPlan(), t = this.getAutoAspectRatioClip(), i = Ve(this.previewAspectRatio);
15026
+ const e = this.buildPlaybackPlan(), t = this.getAutoAspectRatioClip(), i = Ye(this.previewAspectRatio);
15008
15027
  this.previewAspectRatio = i, this.previewSession.applyAspectRatio(i), this.previewSession.sync({
15009
15028
  ...e,
15010
15029
  autoAspectRatioClip: t,
@@ -15042,7 +15061,7 @@ class uh {
15042
15061
  }
15043
15062
  handlePreviewBackendRuntimeError() {
15044
15063
  this.clearPendingPreviewState(), this.resetPreviewRuntimeState();
15045
- const e = this.getPreviewRuntimeController().fallbackToDom(Ve(this.previewAspectRatio));
15064
+ const e = this.getPreviewRuntimeController().fallbackToDom(Ye(this.previewAspectRatio));
15046
15065
  e.handled && (this.previewAspectRatio = e.aspectRatio, this.syncPreviewSession(), this.emitEvent("preview_aspect_ratio_change", { aspectRatio: this.getPreviewAspectRatio() }));
15047
15066
  }
15048
15067
  init(e) {
@@ -15051,22 +15070,22 @@ class uh {
15051
15070
  L.warn("TimelineManager", "TimelineManager has already been initialized");
15052
15071
  return;
15053
15072
  }
15054
- this.rootContainer = e, this.layout = Kl(e, {
15073
+ this.rootContainer = e, this.layout = jl(e, {
15055
15074
  theme: this.config.theme,
15056
15075
  timeScaleHeight: this.getTimeScaleHeight(),
15057
15076
  leftPanelWidth: Ds,
15058
15077
  scrollbarSize: Os
15059
- }), this.layout.bodyViewport.addEventListener("scroll", this.bodyViewportScrollListener), (n = (i = this.layout.bodyCanvasHost).addEventListener) == null || n.call(i, "click", this.bodyCanvasHostClickListener), (r = (s = this.rootContainer) == null ? void 0 : s.addEventListener) == null || r.call(s, "wheel", this.rootWheelListener, { passive: !1 }), this.headerStage = new X.Stage({
15078
+ }), this.layout.bodyViewport.addEventListener("scroll", this.bodyViewportScrollListener), (n = (i = this.layout.bodyCanvasHost).addEventListener) == null || n.call(i, "click", this.bodyCanvasHostClickListener), (r = (s = this.rootContainer) == null ? void 0 : s.addEventListener) == null || r.call(s, "wheel", this.rootWheelListener, { passive: !1 }), this.headerStage = new U.Stage({
15060
15079
  container: this.layout.headerCanvasHost,
15061
15080
  width: this.layout.headerViewport.clientWidth,
15062
15081
  height: this.getTimeScaleHeight()
15063
- }), this.headerLayer = new X.Layer({ name: "timelineHeaderLayer" }), this.headerStage.add(this.headerLayer), this.stage = new X.Stage({
15082
+ }), this.headerLayer = new U.Layer({ name: "timelineHeaderLayer" }), this.headerStage.add(this.headerLayer), this.stage = new U.Stage({
15064
15083
  container: this.layout.bodyCanvasHost,
15065
15084
  width: this.layout.bodyViewport.clientWidth,
15066
15085
  height: 0
15067
- }), this.backgroundLayer = new X.Layer({ name: "trackBackgroundLayer" }), this.trackLayer = new X.Layer({ name: "trackLayer" }), this.dragOverlayLayer = new X.Layer({ name: "trackDragOverlayLayer", listening: !1 }), this.snapGuideLayer = new X.Layer({ name: "trackSnapGuideLayer", listening: !1 }), this.selectionBoxLayer = new X.Layer({ name: "selectionBoxLayer", listening: !1 }), this.stage.add(this.backgroundLayer), this.stage.add(this.trackLayer), this.stage.add(this.dragOverlayLayer), this.stage.add(this.snapGuideLayer), this.stage.add(this.selectionBoxLayer);
15086
+ }), this.backgroundLayer = new U.Layer({ name: "trackBackgroundLayer" }), this.trackLayer = new U.Layer({ name: "trackLayer" }), this.dragOverlayLayer = new U.Layer({ name: "trackDragOverlayLayer", listening: !1 }), this.snapGuideLayer = new U.Layer({ name: "trackSnapGuideLayer", listening: !1 }), this.selectionBoxLayer = new U.Layer({ name: "selectionBoxLayer", listening: !1 }), this.stage.add(this.backgroundLayer), this.stage.add(this.trackLayer), this.stage.add(this.dragOverlayLayer), this.stage.add(this.snapGuideLayer), this.stage.add(this.selectionBoxLayer);
15068
15087
  const t = (l = (o = this.stage) == null ? void 0 : o.container) == null ? void 0 : l.call(o);
15069
- if (t && t.addEventListener("mousedown", this.handleStageMouseDown.bind(this)), this.timeline = new Jl(
15088
+ if (t && t.addEventListener("mousedown", this.handleStageMouseDown.bind(this)), this.timeline = new Ql(
15070
15089
  this.headerStage,
15071
15090
  this.headerLayer,
15072
15091
  this.config,
@@ -15116,7 +15135,7 @@ class uh {
15116
15135
  var c, d, u;
15117
15136
  if (!this.trackLayer)
15118
15137
  return L.error("TimelineManager", "Track layer not initialized"), "";
15119
- const s = this.trackManager.createTrack(e, t, i, n), r = s.id, o = We(e), l = this.calculateTrackY(r), h = this.getTimelineTrackBridge().createTrack({
15138
+ const s = this.trackManager.createTrack(e, t, i, n), r = s.id, o = Xe(e), l = this.calculateTrackY(r), h = this.getTimelineTrackBridge().createTrack({
15120
15139
  layer: this.trackLayer,
15121
15140
  config: { id: r, clips: [], role: s.role },
15122
15141
  trackType: e,
@@ -15173,7 +15192,7 @@ class uh {
15173
15192
  }
15174
15193
  updateAllTrackPositions() {
15175
15194
  var t, i;
15176
- const e = $l(this.trackManager.getTracks(), this.getTrackContentTopOffset());
15195
+ const e = ql(this.trackManager.getTracks(), this.getTrackContentTopOffset());
15177
15196
  for (const n of e) {
15178
15197
  const s = this.getTrackCollection().findById(n.trackId);
15179
15198
  s && ((t = s.setTrackY) == null || t.call(s, n.y), (i = s.setTrackHeight) == null || i.call(s, n.height));
@@ -15253,17 +15272,17 @@ class uh {
15253
15272
  const h = n.find((c) => c.id === i);
15254
15273
  if (h) {
15255
15274
  const c = ut(n, h.id, this.getTrackContentTopOffset());
15256
- return t === "before_track" ? c : c + We(h.type);
15275
+ return t === "before_track" ? c : c + Xe(h.type);
15257
15276
  }
15258
15277
  }
15259
15278
  if (t === "top_of_type_region" && r)
15260
15279
  return ut(n, r.id, this.getTrackContentTopOffset());
15261
15280
  if (t === "bottom_of_type_region" && o)
15262
- return ut(n, o.id, this.getTrackContentTopOffset()) + We(o.type);
15281
+ return ut(n, o.id, this.getTrackContentTopOffset()) + Xe(o.type);
15263
15282
  if (!s)
15264
15283
  return e === "video" ? this.getTrackContentTopOffset() : Hn(n, this.getTrackContentTopOffset());
15265
15284
  const l = ut(n, s.id, this.getTrackContentTopOffset());
15266
- return e === "video" ? l : l + We(s.type);
15285
+ return e === "video" ? l : l + Xe(s.type);
15267
15286
  }
15268
15287
  updateViewportLayout() {
15269
15288
  var o;
@@ -15279,7 +15298,7 @@ class uh {
15279
15298
  this.bodyBackgroundRect.width(e), this.bodyBackgroundRect.height(t), this.bodyBackgroundRect.fill(this.config.theme.background), this.bodyBackgroundRect.stroke(this.config.theme.border), i && this.backgroundLayer.batchDraw();
15280
15299
  return;
15281
15300
  }
15282
- const n = new X.Rect({
15301
+ const n = new U.Rect({
15283
15302
  x: 0,
15284
15303
  y: 0,
15285
15304
  width: e,
@@ -15366,9 +15385,9 @@ class uh {
15366
15385
  normalizeWheelDelta(e, t, i) {
15367
15386
  if (!Number.isFinite(e) || e === 0)
15368
15387
  return 0;
15369
- if (t === nh)
15388
+ if (t === sh)
15370
15389
  return e * 16;
15371
- if (t === sh) {
15390
+ if (t === rh) {
15372
15391
  const n = i === "x" ? this.getViewportWidth() : this.getViewportHeight();
15373
15392
  return e * (n || 1);
15374
15393
  }
@@ -15435,7 +15454,7 @@ class uh {
15435
15454
  return;
15436
15455
  this.previewBufferingSuspendTimeoutId = setTimeout(() => {
15437
15456
  this.previewBufferingSuspendTimeoutId = null, !(this.getPlayStateState() !== "playing" || !this.previewBuffering || this.previewPlaybackSuspendedByBuffering) && (this.previewPlaybackSuspendedByBuffering = !0, this.animationFrameId && (cancelAnimationFrame(this.animationFrameId), this.animationFrameId = null));
15438
- }, rh);
15457
+ }, ah);
15439
15458
  return;
15440
15459
  }
15441
15460
  if (this.clearPreviewBufferingSuspendTimeout(), !this.previewPlaybackSuspendedByBuffering)
@@ -15698,7 +15717,7 @@ class uh {
15698
15717
  return c.id;
15699
15718
  }
15700
15719
  }
15701
- const d = this.getTimelineCommands().planTrackPlacement(c, this.tracks), u = this.getTrackCollection(), f = zl({
15720
+ const d = this.getTimelineCommands().planTrackPlacement(c, this.tracks), u = this.getTrackCollection(), f = Fl({
15702
15721
  clip: c,
15703
15722
  placement: d,
15704
15723
  trackCollection: u,
@@ -15911,7 +15930,7 @@ class uh {
15911
15930
  * 获取插件版本号
15912
15931
  */
15913
15932
  getVersion() {
15914
- return ih.version;
15933
+ return nh.version;
15915
15934
  }
15916
15935
  undo() {
15917
15936
  return this.history.undo();
@@ -16041,7 +16060,7 @@ class uh {
16041
16060
  this.getEventDispatcher().emit(e, t);
16042
16061
  }
16043
16062
  emitSelectedClipChangeIfNeeded() {
16044
- this.lastSelectedClipId = Nl({
16063
+ this.lastSelectedClipId = zl({
16045
16064
  lastSelectedClipId: this.lastSelectedClipId,
16046
16065
  resolveSelectedClip: () => this.resolveSelectedClipSnapshot(),
16047
16066
  emitSelectedClipChange: (e) => this.emitEvent("selected_clip_change", e)
@@ -16064,7 +16083,7 @@ class uh {
16064
16083
  const i = this.getTrackCollection();
16065
16084
  if (!i.findById(t)) return;
16066
16085
  const n = e.type, s = this.trackManager.getTracksByType(n).length + 1, r = n === "video" ? `视频轨道 ${s}` : `音频轨道 ${s}`;
16067
- Vl({
16086
+ Yl({
16068
16087
  clip: e,
16069
16088
  currentTrackId: t,
16070
16089
  trackType: n,
@@ -16277,7 +16296,7 @@ class uh {
16277
16296
  }
16278
16297
  attachPreview(e) {
16279
16298
  const t = e instanceof HTMLElement ? { container: e } : e;
16280
- t.aspectRatio && (this.previewAspectRatio = Ve({
16299
+ t.aspectRatio && (this.previewAspectRatio = Ye({
16281
16300
  mode: t.aspectRatio.mode ?? (t.aspectRatio.width && t.aspectRatio.height ? "manual" : this.previewAspectRatio.mode),
16282
16301
  width: t.aspectRatio.width ?? this.previewAspectRatio.width,
16283
16302
  height: t.aspectRatio.height ?? this.previewAspectRatio.height
@@ -16287,7 +16306,7 @@ class uh {
16287
16306
  this.getPreviewRuntimeController().detachPreviewSession() && (this.clearPendingPreviewState(), this.resetPreviewRuntimeState(), L.debugLazy("TimelineManager", () => "TimelineManager detached from preview container"));
16288
16307
  }
16289
16308
  attachClipConfig(e) {
16290
- const t = new eh();
16309
+ const t = new th();
16291
16310
  t.init({
16292
16311
  container: e,
16293
16312
  theme: this.config.theme,
@@ -16312,11 +16331,11 @@ class uh {
16312
16331
  return this.getPreviewRuntimeController().hasAttachedPreview();
16313
16332
  }
16314
16333
  getPreviewAspectRatio() {
16315
- return Ve(this.previewAspectRatio);
16334
+ return Ye(this.previewAspectRatio);
16316
16335
  }
16317
16336
  setPreviewAspectRatio(e) {
16318
16337
  var t;
16319
- this.previewAspectRatio = Ve({
16338
+ this.previewAspectRatio = Ye({
16320
16339
  mode: "manual",
16321
16340
  width: Math.max(1, e.width),
16322
16341
  height: Math.max(1, e.height)
@@ -16498,7 +16517,7 @@ class uh {
16498
16517
  }), !1;
16499
16518
  if (s.status !== "ready")
16500
16519
  return !1;
16501
- const { sourceTrackId: r, targetTrackId: o } = s, l = i ? { ...i } : { ...s.clip }, h = n ? { ...n } : { ...s.clip }, c = this.cloneTrackSnapshot(r), d = this.cloneTrackSnapshot(o), u = Fl({
16520
+ const { sourceTrackId: r, targetTrackId: o } = s, l = i ? { ...i } : { ...s.clip }, h = n ? { ...n } : { ...s.clip }, c = this.cloneTrackSnapshot(r), d = this.cloneTrackSnapshot(o), u = Vl({
16502
16521
  command: {
16503
16522
  ...s,
16504
16523
  clip: h
@@ -16516,7 +16535,7 @@ class uh {
16516
16535
  targetTrackSnapshot: d,
16517
16536
  isExecutingHistoryAction: this.isExecutingHistoryAction,
16518
16537
  recordMoveClipBetweenTracks: this.getTimelineHistoryRecorder().recordMoveClipBetweenTracks.bind(this.getTimelineHistoryRecorder()),
16519
- applyEffects: () => Yl({
16538
+ applyEffects: () => Wl({
16520
16539
  notifySelectionChange: this.notifySelectionChange.bind(this),
16521
16540
  cleanupEmptyTracks: this.cleanupEmptyTracks.bind(this),
16522
16541
  updateTrackInfoPanel: this.updateTrackInfoPanel.bind(this),
@@ -16934,7 +16953,7 @@ class uh {
16934
16953
  var t;
16935
16954
  if (this.selectionBoxRect)
16936
16955
  return this.selectionBoxRect;
16937
- const e = new X.Rect({
16956
+ const e = new U.Rect({
16938
16957
  fill: "rgba(80, 130, 230, 0.15)",
16939
16958
  stroke: "#5082e6",
16940
16959
  strokeWidth: 1,
@@ -17090,7 +17109,7 @@ class uh {
17090
17109
  */
17091
17110
  checkTrackDurationChange() {
17092
17111
  var r;
17093
- const e = this.getClips(), t = this.lastTrackDuration, i = this.lastEffectiveTrackDuration, n = Ml(e), s = Ln(e);
17112
+ const e = this.getClips(), t = this.lastTrackDuration, i = this.lastEffectiveTrackDuration, n = Ll(e), s = Ln(e);
17094
17113
  if (n !== t) {
17095
17114
  this.lastTrackDuration = n;
17096
17115
  const o = Rn(n);
@@ -17102,7 +17121,7 @@ class uh {
17102
17121
  );
17103
17122
  }
17104
17123
  resolveSelectedClipSnapshot() {
17105
- return Hl({
17124
+ return Nl({
17106
17125
  getPrimarySelectedClip: () => {
17107
17126
  var e;
17108
17127
  return ((e = this.getPrimarySelectedClip) == null ? void 0 : e.call(this)) || null;
@@ -17138,31 +17157,31 @@ class uh {
17138
17157
  }
17139
17158
  }
17140
17159
  export {
17141
- lh as CLIP_LAYER,
17160
+ hh as CLIP_LAYER,
17142
17161
  di as Clip,
17143
17162
  Jo as ClipConfigPanel,
17144
17163
  Ns as DEFAULT_CLIP_VIEW_STATE,
17145
17164
  Pe as DEFAULT_PREVIEW_ASPECT_RATIO,
17146
17165
  kn as HistoryManager,
17147
17166
  jt as MIN_CLIP_LINE_WIDTH,
17148
- oh as PREVIEW_ASPECT_RATIO_PRESETS,
17149
- dh as Playhead,
17167
+ lh as PREVIEW_ASPECT_RATIO_PRESETS,
17168
+ uh as Playhead,
17150
17169
  le as TIMELINE_LEFT_PADDING,
17151
- hh as TIME_SCALE,
17170
+ ch as TIME_SCALE,
17152
17171
  De as TRACK_HEIGHT,
17153
17172
  N as TimeUtils,
17154
- ch as Timeline,
17155
- uh as TimelineManager,
17173
+ dh as Timeline,
17174
+ gh as TimelineManager,
17156
17175
  Mi as Track,
17157
17176
  Ko as TrackInfoPanel,
17158
- Ul as TrackManager,
17177
+ $l as TrackManager,
17159
17178
  zs as ZOOM_ANIMATION,
17160
17179
  ge as ZOOM_PRESETS,
17161
17180
  Fs as createClipViewState,
17162
17181
  Yn as createClipWithViewState,
17163
17182
  mi as defaultDarkTheme,
17164
17183
  vt as isAutoPreviewAspectRatioMode,
17165
- Ve as normalizePreviewAspectRatio,
17184
+ Ye as normalizePreviewAspectRatio,
17166
17185
  Vn as normalizePreviewAspectRatioMode,
17167
17186
  Kt as resolveTheme
17168
17187
  };