@anu3ev/fabric-image-editor 0.4.0 → 0.4.2

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.
Files changed (2) hide show
  1. package/dist/main.js +497 -437
  2. package/package.json +1 -1
package/dist/main.js CHANGED
@@ -1,22 +1,22 @@
1
- var De = Object.defineProperty, Oe = Object.defineProperties;
2
- var Te = Object.getOwnPropertyDescriptors;
3
- var pt = Object.getOwnPropertySymbols;
4
- var ge = Object.prototype.hasOwnProperty, fe = Object.prototype.propertyIsEnumerable;
5
- var ue = (h, t, e) => t in h ? De(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, E = (h, t) => {
1
+ var Re = Object.defineProperty, Ue = Object.defineProperties;
2
+ var ze = Object.getOwnPropertyDescriptors;
3
+ var bt = Object.getOwnPropertySymbols;
4
+ var ve = Object.prototype.hasOwnProperty, je = Object.prototype.propertyIsEnumerable;
5
+ var be = (h, t, e) => t in h ? Re(h, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : h[t] = e, D = (h, t) => {
6
6
  for (var e in t || (t = {}))
7
- ge.call(t, e) && ue(h, e, t[e]);
8
- if (pt)
9
- for (var e of pt(t))
10
- fe.call(t, e) && ue(h, e, t[e]);
7
+ ve.call(t, e) && be(h, e, t[e]);
8
+ if (bt)
9
+ for (var e of bt(t))
10
+ je.call(t, e) && be(h, e, t[e]);
11
11
  return h;
12
- }, me = (h, t) => Oe(h, Te(t));
13
- var X = (h, t) => {
12
+ }, Ie = (h, t) => Ue(h, ze(t));
13
+ var K = (h, t) => {
14
14
  var e = {};
15
15
  for (var s in h)
16
- ge.call(h, s) && t.indexOf(s) < 0 && (e[s] = h[s]);
17
- if (h != null && pt)
18
- for (var s of pt(h))
19
- t.indexOf(s) < 0 && fe.call(h, s) && (e[s] = h[s]);
16
+ ve.call(h, s) && t.indexOf(s) < 0 && (e[s] = h[s]);
17
+ if (h != null && bt)
18
+ for (var s of bt(h))
19
+ t.indexOf(s) < 0 && je.call(h, s) && (e[s] = h[s]);
20
20
  return e;
21
21
  };
22
22
  var C = (h, t, e) => new Promise((s, n) => {
@@ -35,15 +35,15 @@ var C = (h, t, e) => new Promise((s, n) => {
35
35
  }, i = (r) => r.done ? s(r.value) : Promise.resolve(r.value).then(o, a);
36
36
  i((e = e.apply(h, t)).next());
37
37
  });
38
- import { ActiveSelection as D, Textbox as gt, util as mt, controlsUtils as pe, InteractiveFabricObject as Me, loadSVGFromURL as Ne, FabricImage as ht, Point as bt, Gradient as ye, Rect as Le, Circle as xe, Triangle as ke, Group as $, Canvas as _e, Pattern as Be } from "fabric";
39
- import { create as Re } from "jsondiffpatch";
40
- import Ue from "diff-match-patch";
41
- var ze = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", x = function() {
38
+ import { ActiveSelection as T, Textbox as mt, util as Mt, controlsUtils as Ae, InteractiveFabricObject as Se, loadSVGFromURL as Ye, FabricImage as gt, Point as It, Gradient as Ce, Rect as Fe, Circle as He, Triangle as We, Group as Q, Canvas as Ze, Pattern as Pe } from "fabric";
39
+ import { create as Ve } from "jsondiffpatch";
40
+ import Ge from "diff-match-patch";
41
+ var Xe = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict", x = function() {
42
42
  for (var t = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 21, e = "", s = crypto.getRandomValues(new Uint8Array(t |= 0)); t--; )
43
- e += ze[s[t] & 63];
43
+ e += Xe[s[t] & 63];
44
44
  return e;
45
45
  };
46
- class ft {
46
+ class pt {
47
47
  /**
48
48
  * Конструктор принимает редактор и опции.
49
49
  * @param params
@@ -61,7 +61,7 @@ class ft {
61
61
  * @param params.options.adaptCanvasToContainerOnResize — адаптировать канвас к размерам контейнера при изменении размеров окна
62
62
  */
63
63
  constructor({ editor: t, options: e = {} }) {
64
- this.isDragging = !1, this.lastMouseX = 0, this.lastMouseY = 0, this.isUndoRedoKeyPressed = !1, this.isSpacePressed = !1, this.savedSelection = [], this.canvasDragging = !1, this.mouseWheelZooming = !1, this.bringToFrontOnSelection = !1, this.resetObjectFitByDoubleClick = !1, this.copyObjectsByHotkey = !1, this.pasteImageFromClipboard = !1, this.undoRedoByHotKeys = !1, this.selectAllByHotkey = !1, this.deleteObjectsByHotkey = !1, this.adaptCanvasToContainerOnResize = !1, this.editor = t, this.canvas = t.canvas, this.options = e, this.handleContainerResizeBound = ft.debounce(this.handleContainerResize.bind(this), 500), this.handleCopyEventBound = this.handleCopyEvent.bind(this), this.handlePasteEventBound = this.handlePasteEvent.bind(this), this.handleUndoRedoEventBound = this.handleUndoRedoEvent.bind(this), this.handleUndoRedoKeyUpBound = this.handleUndoRedoKeyUp.bind(this), this.handleSelectAllEventBound = this.handleSelectAllEvent.bind(this), this.handleDeleteObjectsEventBound = this.handleDeleteObjectsEvent.bind(this), this.handleSpaceKeyDownBound = this.handleSpaceKeyDown.bind(this), this.handleSpaceKeyUpBound = this.handleSpaceKeyUp.bind(this), this.handleObjectModifiedHistoryBound = ft.debounce(this.handleObjectModifiedHistory.bind(this), 300), this.handleObjectRotatingHistoryBound = ft.debounce(this.handleObjectRotatingHistory.bind(this), 300), this.handleObjectAddedHistoryBound = this.handleObjectAddedHistory.bind(this), this.handleObjectRemovedHistoryBound = this.handleObjectRemovedHistory.bind(this), this.handleOverlayUpdateBound = this.handleOverlayUpdate.bind(this), this.handleBackgroundUpdateBound = this.handleBackgroundUpdate.bind(this), this.handleCanvasDragStartBound = this.handleCanvasDragStart.bind(this), this.handleCanvasDraggingBound = this.handleCanvasDragging.bind(this), this.handleCanvasDragEndBound = this.handleCanvasDragEnd.bind(this), this.handleMouseWheelZoomBound = this.handleMouseWheelZoom.bind(this), this.handleBringToFrontBound = this.handleBringToFront.bind(this), this.handleResetObjectFitBound = this.handleResetObjectFit.bind(this), this.handleLockedSelectionBound = this._filterLockedSelection.bind(this), this.init();
64
+ this.isDragging = !1, this.lastMouseX = 0, this.lastMouseY = 0, this.isUndoRedoKeyPressed = !1, this.isSpacePressed = !1, this.savedSelection = [], this.canvasDragging = !1, this.mouseWheelZooming = !1, this.bringToFrontOnSelection = !1, this.resetObjectFitByDoubleClick = !1, this.copyObjectsByHotkey = !1, this.pasteImageFromClipboard = !1, this.undoRedoByHotKeys = !1, this.selectAllByHotkey = !1, this.deleteObjectsByHotkey = !1, this.adaptCanvasToContainerOnResize = !1, this.editor = t, this.canvas = t.canvas, this.options = e, this.handleContainerResizeBound = pt.debounce(this.handleContainerResize.bind(this), 500), this.handleCopyEventBound = this.handleCopyEvent.bind(this), this.handlePasteEventBound = this.handlePasteEvent.bind(this), this.handleUndoRedoEventBound = this.handleUndoRedoEvent.bind(this), this.handleUndoRedoKeyUpBound = this.handleUndoRedoKeyUp.bind(this), this.handleSelectAllEventBound = this.handleSelectAllEvent.bind(this), this.handleDeleteObjectsEventBound = this.handleDeleteObjectsEvent.bind(this), this.handleSpaceKeyDownBound = this.handleSpaceKeyDown.bind(this), this.handleSpaceKeyUpBound = this.handleSpaceKeyUp.bind(this), this.handleObjectModifiedHistoryBound = pt.debounce(this.handleObjectModifiedHistory.bind(this), 300), this.handleObjectRotatingHistoryBound = pt.debounce(this.handleObjectRotatingHistory.bind(this), 300), this.handleObjectAddedHistoryBound = this.handleObjectAddedHistory.bind(this), this.handleObjectRemovedHistoryBound = this.handleObjectRemovedHistory.bind(this), this.handleOverlayUpdateBound = this.handleOverlayUpdate.bind(this), this.handleBackgroundUpdateBound = this.handleBackgroundUpdate.bind(this), this.handleCanvasDragStartBound = this.handleCanvasDragStart.bind(this), this.handleCanvasDraggingBound = this.handleCanvasDragging.bind(this), this.handleCanvasDragEndBound = this.handleCanvasDragEnd.bind(this), this.handleMouseWheelZoomBound = this.handleMouseWheelZoom.bind(this), this.handleBringToFrontBound = this.handleBringToFront.bind(this), this.handleResetObjectFitBound = this.handleResetObjectFit.bind(this), this.handleLockedSelectionBound = this._filterLockedSelection.bind(this), this.init();
65
65
  }
66
66
  /**
67
67
  * Инициализация всех обработчиков согласно опциям.
@@ -98,7 +98,7 @@ class ft {
98
98
  if (n.length === 1)
99
99
  this.canvas.setActiveObject(n[0]);
100
100
  else {
101
- const a = new D(n, {
101
+ const a = new T(n, {
102
102
  canvas: this.canvas
103
103
  });
104
104
  this.canvas.setActiveObject(a);
@@ -106,7 +106,7 @@ class ft {
106
106
  this.canvas.requestRenderAll();
107
107
  return;
108
108
  }
109
- const o = new D(t, {
109
+ const o = new T(t, {
110
110
  canvas: this.canvas
111
111
  });
112
112
  this.editor.objectLockManager.lockObject({
@@ -220,7 +220,7 @@ class ft {
220
220
  if (n || o) return;
221
221
  this.isSpacePressed = !0, t.preventDefault();
222
222
  const a = e.getActiveObject() || null;
223
- a instanceof D ? this.savedSelection = a.getObjects().slice() : a && (this.savedSelection = [a]), e.discardActiveObject(), e.set({
223
+ a instanceof T ? this.savedSelection = a.getObjects().slice() : a && (this.savedSelection = [a]), e.discardActiveObject(), e.set({
224
224
  selection: !1,
225
225
  defaultCursor: "grab"
226
226
  }), e.setCursor("grab"), s.canvasManager.getObjects().forEach((i) => {
@@ -259,7 +259,7 @@ class ft {
259
259
  e.setActiveObject(t[0]);
260
260
  return;
261
261
  }
262
- const n = t.filter((a) => s.canvasManager.getObjects().includes(a)), o = new D(n, { canvas: e });
262
+ const n = t.filter((a) => s.canvasManager.getObjects().includes(a)), o = new T(n, { canvas: e });
263
263
  e.setActiveObject(o);
264
264
  }
265
265
  // --- Обработчики для событий canvas (Fabric) ---
@@ -330,7 +330,7 @@ class ft {
330
330
  */
331
331
  handleResetObjectFit(t) {
332
332
  const e = t == null ? void 0 : t.target;
333
- !e || e instanceof gt || this.editor.transformManager.resetObject({ object: e });
333
+ !e || e instanceof mt || this.editor.transformManager.resetObject({ object: e });
334
334
  }
335
335
  /**
336
336
  * Проверяет, должно ли событие клавиатуры быть проигнорировано
@@ -391,7 +391,7 @@ class ft {
391
391
  };
392
392
  }
393
393
  }
394
- class Ye {
394
+ class Ke {
395
395
  /**
396
396
  * Класс для динамической загрузки внешних модулей.
397
397
  */
@@ -409,7 +409,7 @@ class Ye {
409
409
  return this.loaders[t] ? (this.cache.has(t) || this.cache.set(t, this.loaders[t]()), this.cache.get(t)) : Promise.reject(new Error(`Unknown module "${t}"`));
410
410
  }
411
411
  }
412
- function Fe(h) {
412
+ function $e(h) {
413
413
  return new Worker(
414
414
  "" + new URL("assets/worker-CN39s7P7.js", import.meta.url).href,
415
415
  {
@@ -417,13 +417,13 @@ function Fe(h) {
417
417
  }
418
418
  );
419
419
  }
420
- class He {
420
+ class Qe {
421
421
  /**
422
422
  * @param scriptUrl — URL скрипта воркера.
423
423
  * По-умолчанию использует DefaultWorker из соседнего файла
424
424
  */
425
425
  constructor(t) {
426
- t ? this.worker = new Worker(t, { type: "module" }) : this.worker = new Fe(), this._callbacks = /* @__PURE__ */ new Map(), this.worker.onmessage = this._handleMessage.bind(this);
426
+ t ? this.worker = new Worker(t, { type: "module" }) : this.worker = new $e(), this._callbacks = /* @__PURE__ */ new Map(), this.worker.onmessage = this._handleMessage.bind(this);
427
427
  }
428
428
  /**
429
429
  * Обработчик сообщений от воркера
@@ -463,50 +463,50 @@ class He {
463
463
  this.worker.terminate();
464
464
  }
465
465
  }
466
- const F = 12, Ze = 2, Dt = 8, Ot = 20, We = 100, Tt = 20, Nt = 8, Pe = 100, vt = 32, xt = 1, Ve = "#2B2D33", kt = "#3D8BF4", _t = "#FFFFFF";
467
- function Mt(h, t, e, s, n) {
468
- const o = F, a = Ze;
469
- h.save(), h.translate(t, e), h.rotate(mt.degreesToRadians(n.angle)), h.fillStyle = _t, h.strokeStyle = kt, h.lineWidth = xt, h.beginPath(), h.roundRect(-o / 2, -o / 2, o, o, a), h.fill(), h.stroke(), h.restore();
466
+ const F = 12, Je = 2, Tt = 8, Nt = 20, qe = 100, Lt = 20, kt = 8, ts = 100, At = 32, _t = 1, es = "#2B2D33", Bt = "#3D8BF4", Rt = "#FFFFFF";
467
+ function vt(h, t, e, s, n) {
468
+ const o = F, a = Je;
469
+ h.save(), h.translate(t, e), h.rotate(Mt.degreesToRadians(n.angle)), h.fillStyle = Rt, h.strokeStyle = Bt, h.lineWidth = _t, h.beginPath(), h.roundRect(-o / 2, -o / 2, o, o, a), h.fill(), h.stroke(), h.restore();
470
470
  }
471
- function be(h, t, e, s, n) {
472
- const o = Dt, a = Ot, i = We;
473
- h.save(), h.translate(t, e), h.rotate(mt.degreesToRadians(n.angle)), h.fillStyle = _t, h.strokeStyle = kt, h.lineWidth = xt, h.beginPath(), h.roundRect(-o / 2, -a / 2, o, a, i), h.fill(), h.stroke(), h.restore();
471
+ function we(h, t, e, s, n) {
472
+ const o = Tt, a = Nt, i = qe;
473
+ h.save(), h.translate(t, e), h.rotate(Mt.degreesToRadians(n.angle)), h.fillStyle = Rt, h.strokeStyle = Bt, h.lineWidth = _t, h.beginPath(), h.roundRect(-o / 2, -a / 2, o, a, i), h.fill(), h.stroke(), h.restore();
474
474
  }
475
- function ve(h, t, e, s, n) {
476
- const o = Tt, a = Nt, i = Pe;
477
- h.save(), h.translate(t, e), h.rotate(mt.degreesToRadians(n.angle)), h.fillStyle = _t, h.strokeStyle = kt, h.lineWidth = xt, h.beginPath(), h.roundRect(-o / 2, -a / 2, o, a, i), h.fill(), h.stroke(), h.restore();
475
+ function Ee(h, t, e, s, n) {
476
+ const o = Lt, a = kt, i = ts;
477
+ h.save(), h.translate(t, e), h.rotate(Mt.degreesToRadians(n.angle)), h.fillStyle = Rt, h.strokeStyle = Bt, h.lineWidth = _t, h.beginPath(), h.roundRect(-o / 2, -a / 2, o, a, i), h.fill(), h.stroke(), h.restore();
478
478
  }
479
- const Ge = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", we = new Image();
480
- we.src = Ge;
481
- function Xe(h, t, e, s, n) {
482
- const a = vt / 2;
483
- h.save(), h.translate(t, e), h.rotate(mt.degreesToRadians(n.angle)), h.fillStyle = Ve, h.beginPath(), h.arc(0, 0, a, 0, 2 * Math.PI), h.fill(), h.drawImage(we, -a / 2, -a / 2, a, a), h.restore();
479
+ const ss = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTE4Ljc1IDQuMzc1djMuNzVhLjYyNS42MjUgMCAwIDEtLjYyNS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDEgMC0xLjI1aDIuMTRsLTIuMDc3LTEuOTAzLS4wMi0uMDE5YTYuMjUgNi4yNSAwIDEgMC0uMTMgOC45NjcuNjI2LjYyNiAwIDAgMSAuODYuOTA5QTcuNDU2IDcuNDU2IDAgMCAxIDEwIDE3LjVoLS4xMDNhNy41IDcuNSAwIDEgMSA1LjM5Ni0xMi44MTJMMTcuNSA2LjcwM1Y0LjM3NWEuNjI1LjYyNSAwIDAgMSAxLjI1IDBaIi8+PC9zdmc+", ke = new Image();
480
+ ke.src = ss;
481
+ function ns(h, t, e, s, n) {
482
+ const a = At / 2;
483
+ h.save(), h.translate(t, e), h.rotate(Mt.degreesToRadians(n.angle)), h.fillStyle = es, h.beginPath(), h.arc(0, 0, a, 0, 2 * Math.PI), h.fill(), h.drawImage(ke, -a / 2, -a / 2, a, a), h.restore();
484
484
  }
485
- const Ke = {
485
+ const os = {
486
486
  // Угловые точки
487
487
  tl: {
488
- render: Mt,
488
+ render: vt,
489
489
  sizeX: F,
490
490
  sizeY: F,
491
491
  offsetX: 0,
492
492
  offsetY: 0
493
493
  },
494
494
  tr: {
495
- render: Mt,
495
+ render: vt,
496
496
  sizeX: F,
497
497
  sizeY: F,
498
498
  offsetX: 0,
499
499
  offsetY: 0
500
500
  },
501
501
  bl: {
502
- render: Mt,
502
+ render: vt,
503
503
  sizeX: F,
504
504
  sizeY: F,
505
505
  offsetX: 0,
506
506
  offsetY: 0
507
507
  },
508
508
  br: {
509
- render: Mt,
509
+ render: vt,
510
510
  sizeX: F,
511
511
  sizeY: F,
512
512
  offsetX: 0,
@@ -514,46 +514,54 @@ const Ke = {
514
514
  },
515
515
  // Середина вертикалей
516
516
  ml: {
517
- render: be,
518
- sizeX: Dt,
519
- sizeY: Ot,
517
+ render: we,
518
+ sizeX: Tt,
519
+ sizeY: Nt,
520
520
  offsetX: 0,
521
521
  offsetY: 0
522
522
  },
523
523
  mr: {
524
- render: be,
525
- sizeX: Dt,
526
- sizeY: Ot,
524
+ render: we,
525
+ sizeX: Tt,
526
+ sizeY: Nt,
527
527
  offsetX: 0,
528
528
  offsetY: 0
529
529
  },
530
530
  // Середина горизонталей
531
531
  mt: {
532
- render: ve,
533
- sizeX: Tt,
534
- sizeY: Nt,
532
+ render: Ee,
533
+ sizeX: Lt,
534
+ sizeY: kt,
535
535
  offsetX: 0,
536
536
  offsetY: 0
537
537
  },
538
538
  mb: {
539
- render: ve,
540
- sizeX: Tt,
541
- sizeY: Nt,
539
+ render: Ee,
540
+ sizeX: Lt,
541
+ sizeY: kt,
542
542
  offsetX: 0,
543
543
  offsetY: 0
544
544
  },
545
545
  // Специальный «rotate» контрол
546
546
  mtr: {
547
- render: Xe,
548
- sizeX: vt,
549
- sizeY: vt,
547
+ render: ns,
548
+ sizeX: At,
549
+ sizeY: At,
550
550
  offsetX: 0,
551
- offsetY: -vt
551
+ offsetY: -At
552
552
  }
553
553
  };
554
- class jt {
554
+ class J {
555
+ static wrapWidthControl(t) {
556
+ if (!(t != null && t.actionHandler)) return;
557
+ const e = t.actionHandler;
558
+ t.actionHandler = (s, n, o, a) => {
559
+ const i = n == null ? void 0 : n.target;
560
+ return !i || i.locked || i.lockScalingX ? !1 : e(s, n, o, a);
561
+ };
562
+ }
555
563
  static applyControlOverrides(t) {
556
- Object.entries(Ke).forEach(([e, s]) => {
564
+ Object.entries(os).forEach(([e, s]) => {
557
565
  const n = t[e];
558
566
  n && (Object.assign(n, s), e === "mtr" && (n.cursorStyle = "grab", n.mouseDownHandler = (o, a, i, r) => {
559
567
  var d;
@@ -563,13 +571,13 @@ class jt {
563
571
  });
564
572
  }
565
573
  static apply() {
566
- const t = pe.createObjectDefaultControls();
567
- jt.applyControlOverrides(t), Me.ownDefaults.controls = t;
568
- const e = pe.createTextboxDefaultControls();
569
- jt.applyControlOverrides(e), e.mt && (e.mt.visible = !1), e.mb && (e.mb.visible = !1), gt.ownDefaults.controls = e, Me.ownDefaults.snapAngle = 1;
574
+ const t = Ae.createObjectDefaultControls();
575
+ J.applyControlOverrides(t), Se.ownDefaults.controls = t;
576
+ const e = Ae.createTextboxDefaultControls();
577
+ J.applyControlOverrides(e), e.mt && (e.mt.visible = !1), e.mb && (e.mb.visible = !1), J.wrapWidthControl(e.ml), J.wrapWidthControl(e.mr), mt.ownDefaults.controls = e, Se.ownDefaults.snapAngle = 1;
570
578
  }
571
579
  }
572
- const j = class j {
580
+ const A = class A {
573
581
  constructor(t = []) {
574
582
  this.fonts = t;
575
583
  }
@@ -583,7 +591,7 @@ const j = class j {
583
591
  if (!t.length) return;
584
592
  const e = typeof document != "undefined" ? document : void 0;
585
593
  if (!e) return;
586
- const s = t.map((o) => j.loadFont(o, e));
594
+ const s = t.map((o) => A.loadFont(o, e));
587
595
  yield Promise.allSettled(s);
588
596
  });
589
597
  }
@@ -592,21 +600,21 @@ const j = class j {
592
600
  var c, d;
593
601
  const s = typeof FontFace != "undefined", n = (c = t.family) == null ? void 0 : c.trim(), o = (d = t.source) == null ? void 0 : d.trim();
594
602
  if (!n || !o) return;
595
- const a = j.normalizeFontSource(o), i = j.getDescriptorSnapshot(t.descriptors), r = j.getFontRegistrationKey(n, a, i);
596
- if (!j.registeredFontKeys.has(r)) {
597
- if (j.isFontFaceAlreadyApplied(e, n, i)) {
598
- j.registeredFontKeys.add(r);
603
+ const a = A.normalizeFontSource(o), i = A.getDescriptorSnapshot(t.descriptors), r = A.getFontRegistrationKey(n, a, i);
604
+ if (!A.registeredFontKeys.has(r)) {
605
+ if (A.isFontFaceAlreadyApplied(e, n, i)) {
606
+ A.registeredFontKeys.add(r);
599
607
  return;
600
608
  }
601
609
  if (s && e.fonts && typeof e.fonts.add == "function")
602
610
  try {
603
611
  const u = yield new FontFace(n, a, t.descriptors).load();
604
- e.fonts.add(u), j.registeredFontKeys.add(r);
612
+ e.fonts.add(u), A.registeredFontKeys.add(r);
605
613
  return;
606
614
  } catch (l) {
607
615
  console.warn(`Не удалось загрузить шрифт "${n}" через FontFace API`, l);
608
616
  }
609
- j.injectFontFace({
617
+ A.injectFontFace({
610
618
  font: t,
611
619
  source: a,
612
620
  doc: e,
@@ -626,15 +634,15 @@ const j = class j {
626
634
  if (!a) return;
627
635
  const i = s.createElement("style");
628
636
  i.setAttribute("data-editor-font", a), i.setAttribute("data-editor-font-key", n);
629
- const r = j.descriptorsToCss(o), c = [
637
+ const r = A.descriptorsToCss(o), c = [
630
638
  "@font-face {",
631
- ` font-family: ${j.formatFontFamilyForCss(a)};`,
639
+ ` font-family: ${A.formatFontFamilyForCss(a)};`,
632
640
  ` src: ${e};`,
633
641
  ...r.map((l) => ` ${l}`),
634
642
  "}"
635
643
  ];
636
644
  i.textContent = c.join(`
637
- `), s.head.appendChild(i), j.registeredFontKeys.add(n);
645
+ `), s.head.appendChild(i), A.registeredFontKeys.add(n);
638
646
  }
639
647
  static normalizeFontSource(t) {
640
648
  const e = t.trim();
@@ -657,15 +665,15 @@ const j = class j {
657
665
  return t ? t.trim().replace(/^['"]+|['"]+$/g, "").toLowerCase() : "";
658
666
  }
659
667
  static getDescriptorSnapshot(t) {
660
- const e = j.descriptorDefaults;
668
+ const e = A.descriptorDefaults;
661
669
  return {
662
- style: j.normalizeDescriptorValue(t == null ? void 0 : t.style, e.style),
663
- weight: j.normalizeDescriptorValue(t == null ? void 0 : t.weight, e.weight),
664
- stretch: j.normalizeDescriptorValue(t == null ? void 0 : t.stretch, e.stretch),
665
- unicodeRange: j.normalizeDescriptorValue(t == null ? void 0 : t.unicodeRange, e.unicodeRange),
666
- variant: j.normalizeDescriptorValue(t == null ? void 0 : t.variant, e.variant),
667
- featureSettings: j.normalizeDescriptorValue(t == null ? void 0 : t.featureSettings, e.featureSettings),
668
- display: j.normalizeDescriptorValue(t == null ? void 0 : t.display, e.display)
670
+ style: A.normalizeDescriptorValue(t == null ? void 0 : t.style, e.style),
671
+ weight: A.normalizeDescriptorValue(t == null ? void 0 : t.weight, e.weight),
672
+ stretch: A.normalizeDescriptorValue(t == null ? void 0 : t.stretch, e.stretch),
673
+ unicodeRange: A.normalizeDescriptorValue(t == null ? void 0 : t.unicodeRange, e.unicodeRange),
674
+ variant: A.normalizeDescriptorValue(t == null ? void 0 : t.variant, e.variant),
675
+ featureSettings: A.normalizeDescriptorValue(t == null ? void 0 : t.featureSettings, e.featureSettings),
676
+ display: A.normalizeDescriptorValue(t == null ? void 0 : t.display, e.display)
669
677
  };
670
678
  }
671
679
  static areDescriptorSnapshotsEqual(t, e) {
@@ -673,7 +681,7 @@ const j = class j {
673
681
  }
674
682
  static getFontRegistrationKey(t, e, s) {
675
683
  return [
676
- j.normalizeFamilyName(t),
684
+ A.normalizeFamilyName(t),
677
685
  e,
678
686
  s.style,
679
687
  s.weight,
@@ -687,12 +695,12 @@ const j = class j {
687
695
  static isFontFaceAlreadyApplied(t, e, s) {
688
696
  const n = t.fonts;
689
697
  if (!n || typeof n.forEach != "function") return !1;
690
- const o = j.normalizeFamilyName(e);
698
+ const o = A.normalizeFamilyName(e);
691
699
  let a = !1;
692
700
  try {
693
701
  n.forEach((i) => {
694
- if (a || j.normalizeFamilyName(i.family) !== o) return;
695
- const c = j.getDescriptorSnapshot({
702
+ if (a || A.normalizeFamilyName(i.family) !== o) return;
703
+ const c = A.getDescriptorSnapshot({
696
704
  style: i.style,
697
705
  weight: i.weight,
698
706
  stretch: i.stretch,
@@ -701,7 +709,7 @@ const j = class j {
701
709
  featureSettings: i.featureSettings,
702
710
  display: i.display
703
711
  });
704
- j.areDescriptorSnapshotsEqual(s, c) && (a = !0);
712
+ A.areDescriptorSnapshotsEqual(s, c) && (a = !0);
705
713
  });
706
714
  } catch (i) {
707
715
  return console.warn("Не удалось проверить, загружен ли шрифт ранее через FontFaceSet", i), !1;
@@ -728,7 +736,7 @@ const j = class j {
728
736
  });
729
737
  }
730
738
  };
731
- j.registeredFontKeys = /* @__PURE__ */ new Set(), j.descriptorDefaults = {
739
+ A.registeredFontKeys = /* @__PURE__ */ new Set(), A.descriptorDefaults = {
732
740
  style: "normal",
733
741
  weight: "normal",
734
742
  stretch: "normal",
@@ -737,8 +745,8 @@ j.registeredFontKeys = /* @__PURE__ */ new Set(), j.descriptorDefaults = {
737
745
  featureSettings: "normal",
738
746
  display: "auto"
739
747
  };
740
- let Lt = j;
741
- const $e = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI2ZmZiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi44NzUgMi41YS42MjUuNjI1IDAgMCAwL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hLjYyNS42MjUgMCAwIDAgMCAxLjI1aC42MjV2MTEuMjVBMS4yNSAxLjI1IDAgMCAwIDUgMTcuNWgxMGExLjI1IDEuMjUgMCAwIDAgMS4yNS0xLjI1VjVoLjYyNWEuNjI1LjYyNSAwIDAgMCAwLTEuMjVIMTMuNzV2LS42MjVhMS44NzUgMS44NzUgMCAwIDAtMS44NzUtMS44NzVoLTMuNzVabTQuMzc1IDIuNXYtLjYyNWEuNjI1LjYyNSAwIDAgMC0uNjI1LS42MjVoLTMuNzVhLjYyNS42MjUgMCAwIDAtLjYyNS42MjV2LjYyNWg1Wk01IDE2LjI1VjVoMTB2MTEuMjVINVpNOC4xMjUgNy41Yy4zNDUgMCAuNjI1LjI4LjYyNS42MjV2NWEuNjI1LjYyNSAwIDEgMS0xLjI1IDB2LTVjMC0uMzQ1LjI4LS42MjUuNjI1LS42MjVabTQuMzc1IDUuNjI1di01YS42MjUuNjI1IDAgMCAwLTEuMjUgMHY1YS42MjUuNjI1IDAgMSAwIDEuMjUgMFoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==", ft = {
742
750
  style: {
743
751
  position: "absolute",
744
752
  display: "none",
@@ -805,14 +813,14 @@ const $e = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
805
813
  ],
806
814
  offsetTop: 50,
807
815
  icons: {
808
- copyPaste: $e,
809
- delete: ns,
810
- lock: Qe,
811
- unlock: Je,
812
- bringToFront: es,
813
- sendToBack: ss,
814
- bringForward: qe,
815
- sendBackwards: ts
816
+ copyPaste: as,
817
+ delete: us,
818
+ lock: is,
819
+ unlock: rs,
820
+ bringToFront: ls,
821
+ sendToBack: hs,
822
+ bringForward: cs,
823
+ sendBackwards: ds
816
824
  },
817
825
  handlers: {
818
826
  copyPaste: (h) => C(null, null, function* () {
@@ -841,18 +849,18 @@ const $e = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMj
841
849
  }
842
850
  }
843
851
  };
844
- class os {
852
+ class gs {
845
853
  constructor({ editor: t }) {
846
854
  this.currentTarget = null, this.currentLocked = !1, this.isTransforming = !1, this.editor = t, this.canvas = t.canvas, this.options = t.options, this._initToolbar();
847
855
  }
848
856
  _initToolbar() {
849
857
  if (!this.options.showToolbar) return;
850
858
  const t = this.options.toolbar || {};
851
- this.config = me(E(E({}, ut), t), {
852
- style: E(E({}, ut.style), t.style || {}),
853
- btnStyle: E(E({}, ut.btnStyle), t.btnStyle || {}),
854
- icons: E(E({}, ut.icons), t.icons || {}),
855
- handlers: E(E({}, ut.handlers), t.handlers || {})
859
+ this.config = Ie(D(D({}, ft), t), {
860
+ style: D(D({}, ft.style), t.style || {}),
861
+ btnStyle: D(D({}, ft.btnStyle), t.btnStyle || {}),
862
+ icons: D(D({}, ft.icons), t.icons || {}),
863
+ handlers: D(D({}, ft.handlers), t.handlers || {})
856
864
  }), this.currentTarget = null, this.currentLocked = !1, this.isTransforming = !1, this._onMouseDown = this._handleMouseDown.bind(this), this._onObjectMoving = this._startTransform.bind(this), this._onObjectScaling = this._startTransform.bind(this), this._onObjectRotating = this._startTransform.bind(this), this._onMouseUp = this._endTransform.bind(this), this._onObjectModified = this._endTransform.bind(this), this._onSelectionChange = this._updateToolbar.bind(this), this._onSelectionClear = () => {
857
865
  this.el.style.display = "none";
858
866
  }, this._createDOM(), this._bindEvents();
@@ -957,7 +965,7 @@ class os {
957
965
  this.el.removeEventListener("mouseover", this._onBtnOver), this.el.removeEventListener("mouseout", this._onBtnOut), this.canvas.off("mouse:down", this._onMouseDown), this.canvas.off("object:moving", this._onObjectMoving), this.canvas.off("object:scaling", this._onObjectScaling), this.canvas.off("object:rotating", this._onObjectRotating), this.canvas.off("mouse:up", this._onMouseUp), this.canvas.off("object:modified", this._onObjectModified), this.canvas.off("selection:created", this._onSelectionChange), this.canvas.off("selection:updated", this._onSelectionChange), this.canvas.off("after:render", this._onSelectionChange), this.canvas.off("selection:cleared", this._onSelectionClear), this.el.remove();
958
966
  }
959
967
  }
960
- const as = {
968
+ const fs = {
961
969
  position: "absolute",
962
970
  display: "none",
963
971
  background: "#2B2D33",
@@ -971,8 +979,8 @@ const as = {
971
979
  "pointer-events": "none",
972
980
  "white-space": "nowrap",
973
981
  "box-shadow": "0 2px 8px rgba(0, 0, 0, 0.2)"
974
- }, je = 16, Ie = 16, is = "fabric-editor-angle-indicator";
975
- class Bt {
982
+ }, De = 16, Oe = 16, ms = "fabric-editor-angle-indicator";
983
+ class Ut {
976
984
  constructor({ editor: t }) {
977
985
  this.isActive = !1, this.currentAngle = 0, this.editor = t, this.canvas = t.canvas, this.options = t.options, this._createDOM(), this._bindEvents();
978
986
  }
@@ -980,7 +988,7 @@ class Bt {
980
988
  * Создание DOM-элемента индикатора
981
989
  */
982
990
  _createDOM() {
983
- this.el = document.createElement("div"), this.el.className = is, Object.entries(as).forEach(([t, e]) => {
991
+ this.el = document.createElement("div"), this.el.className = ms, Object.entries(fs).forEach(([t, e]) => {
984
992
  this.el.style.setProperty(t, e);
985
993
  }), this.canvas.wrapperEl.appendChild(this.el);
986
994
  }
@@ -1000,7 +1008,7 @@ class Bt {
1000
1008
  return;
1001
1009
  }
1002
1010
  const s = e.angle || 0;
1003
- this.currentAngle = Bt._normalizeAngle(s), this.el.textContent = `${this.currentAngle}°`, this._positionIndicator(t.e), this.isActive || this._showIndicator();
1011
+ this.currentAngle = Ut._normalizeAngle(s), this.el.textContent = `${this.currentAngle}°`, this._positionIndicator(t.e), this.isActive || this._showIndicator();
1004
1012
  }
1005
1013
  /**
1006
1014
  * Обработчик отпускания кнопки мыши
@@ -1031,9 +1039,9 @@ class Bt {
1031
1039
  */
1032
1040
  _positionIndicator(t) {
1033
1041
  const e = this.canvas.wrapperEl.getBoundingClientRect();
1034
- let s = t.clientX - e.left + je, n = t.clientY - e.top + Ie;
1042
+ let s = t.clientX - e.left + De, n = t.clientY - e.top + Oe;
1035
1043
  const o = this.el.getBoundingClientRect(), a = o.width, i = o.height;
1036
- s + a > e.width && (s = t.clientX - e.left - a - je), n + i > e.height && (n = t.clientY - e.top - i - Ie), this.el.style.left = `${s}px`, this.el.style.top = `${n}px`;
1044
+ s + a > e.width && (s = t.clientX - e.left - a - De), n + i > e.height && (n = t.clientY - e.top - i - Oe), this.el.style.left = `${s}px`, this.el.style.top = `${n}px`;
1037
1045
  }
1038
1046
  /**
1039
1047
  * Показать индикатор
@@ -1064,7 +1072,7 @@ class Bt {
1064
1072
  this.canvas && (this.canvas.off("object:rotating", this._onObjectRotating), this.canvas.off("mouse:up", this._onMouseUp), this.canvas.off("object:modified", this._onObjectModified), this.canvas.off("selection:cleared", this._onSelectionCleared)), (t = this.el) != null && t.parentNode && this.el.parentNode.removeChild(this.el), this.el = null, this.editor = null, this.canvas = null, this.options = null;
1065
1073
  }
1066
1074
  }
1067
- const rs = [
1075
+ const ps = [
1068
1076
  "selectable",
1069
1077
  "evented",
1070
1078
  "id",
@@ -1085,7 +1093,7 @@ const rs = [
1085
1093
  "textCaseRaw",
1086
1094
  "uppercase"
1087
1095
  ];
1088
- class It {
1096
+ class St {
1089
1097
  constructor({ editor: t }) {
1090
1098
  this.editor = t, this.canvas = t.canvas, this._historySuspendCount = 0, this.baseState = null, this.patches = [], this.currentIndex = 0, this.maxHistoryLength = t.options.maxHistoryLength, this.totalChangesCount = 0, this.baseStateChangesCount = 0, this._createDiffPatcher();
1091
1099
  }
@@ -1097,7 +1105,7 @@ class It {
1097
1105
  return this.patches[this.currentIndex - 1] || null;
1098
1106
  }
1099
1107
  _createDiffPatcher() {
1100
- this.diffPatcher = Re({
1108
+ this.diffPatcher = Ve({
1101
1109
  objectHash(t) {
1102
1110
  const e = t, s = t;
1103
1111
  return [
@@ -1133,7 +1141,7 @@ class It {
1133
1141
  includeValueOnMove: !1
1134
1142
  },
1135
1143
  textDiff: {
1136
- diffMatchPatch: Ue,
1144
+ diffMatchPatch: Ge,
1137
1145
  minLength: 60
1138
1146
  }
1139
1147
  });
@@ -1174,7 +1182,7 @@ class It {
1174
1182
  saveState() {
1175
1183
  if (console.log("saveState"), this.skipHistory) return;
1176
1184
  console.time("saveState");
1177
- const t = this.canvas.toDatalessObject([...rs]);
1185
+ const t = this.canvas.toDatalessObject([...ps]);
1178
1186
  if (console.timeEnd("saveState"), !this.baseState) {
1179
1187
  this.baseState = t, this.patches = [], this.currentIndex = 0, console.log("Базовое состояние сохранено.");
1180
1188
  return;
@@ -1221,8 +1229,8 @@ class It {
1221
1229
  if (!t) return;
1222
1230
  console.log("loadStateFromFullState fullState", t);
1223
1231
  const { canvas: e, canvasManager: s, interactionBlocker: n, backgroundManager: o } = this.editor, { width: a, height: i } = e;
1224
- n.overlayMask = null, It._serializeCustomData(t), yield e.loadFromJSON(t, (l, u) => {
1225
- It._deserializeCustomData(l, u);
1232
+ n.overlayMask = null, St._serializeCustomData(t), yield e.loadFromJSON(t, (l, u) => {
1233
+ St._deserializeCustomData(l, u);
1226
1234
  });
1227
1235
  const r = e.getObjects().find((l) => l.id === "montage-area");
1228
1236
  r && (this.editor.montageArea = r, (a !== e.getWidth() || i !== e.getHeight()) && s.updateCanvas());
@@ -1314,7 +1322,7 @@ class It {
1314
1322
  });
1315
1323
  }
1316
1324
  }
1317
- const cs = 0.1, ds = 2, Ae = 0.1, ls = 90, J = 16, q = 16, P = 4096, V = 4096, Ce = "application/image-editor:", yt = ["format", "uppercase", "textCaseRaw"], hs = 50;
1325
+ const Ms = 0.1, ys = 2, Te = 0.1, bs = 90, tt = 16, et = 16, V = 4096, G = 4096, Ne = "application/image-editor:", jt = ["format", "uppercase", "textCaseRaw"], vs = 50;
1318
1326
  class H {
1319
1327
  constructor({ editor: t }) {
1320
1328
  this.editor = t, this.options = t.options, this._createdBlobUrls = [], this.acceptContentTypes = this.editor.options.acceptContentTypes, this.acceptFormats = this.getAllowedFormatsFromContentTypes();
@@ -1342,7 +1350,7 @@ class H {
1342
1350
  withoutSelection: i = !1
1343
1351
  } = t;
1344
1352
  if (!e) return null;
1345
- const { canvas: r, montageArea: c, transformManager: d, historyManager: l, errorManager: u } = this.editor, g = yield this.getContentType(e), f = H.getFormatFromContentType(g), { acceptContentTypes: m, acceptFormats: b } = this;
1353
+ const { canvas: r, montageArea: c, transformManager: d, historyManager: l, errorManager: u } = this.editor, g = yield this.getContentType(e), f = H.getFormatFromContentType(g), { acceptContentTypes: m, acceptFormats: j } = this;
1346
1354
  if (!this.isAllowedContentType(g)) {
1347
1355
  const p = `Неверный contentType для изображения: ${g}. Ожидается один из: ${this.acceptContentTypes.join(", ")}.`;
1348
1356
  return u.emitError({
@@ -1355,7 +1363,7 @@ class H {
1355
1363
  format: f,
1356
1364
  contentType: g,
1357
1365
  acceptContentTypes: m,
1358
- acceptFormats: b,
1366
+ acceptFormats: j,
1359
1367
  fromClipboard: o,
1360
1368
  isBackground: a,
1361
1369
  withoutSelection: i
@@ -1368,8 +1376,8 @@ class H {
1368
1376
  if (e instanceof File)
1369
1377
  p = URL.createObjectURL(e);
1370
1378
  else if (typeof e == "string") {
1371
- const A = yield (yield fetch(e, { mode: "cors" })).blob();
1372
- p = URL.createObjectURL(A);
1379
+ const y = yield (yield fetch(e, { mode: "cors" })).blob();
1380
+ p = URL.createObjectURL(y);
1373
1381
  } else
1374
1382
  return u.emitError({
1375
1383
  origin: "ImageManager",
@@ -1381,37 +1389,37 @@ class H {
1381
1389
  format: f,
1382
1390
  contentType: g,
1383
1391
  acceptContentTypes: m,
1384
- acceptFormats: b,
1392
+ acceptFormats: j,
1385
1393
  fromClipboard: o,
1386
1394
  isBackground: a,
1387
1395
  withoutSelection: i
1388
1396
  }
1389
1397
  }), null;
1390
1398
  if (this._createdBlobUrls.push(p), f === "svg") {
1391
- const y = yield Ne(p);
1392
- M = mt.groupSVGElements(y.objects, y.options);
1399
+ const b = yield Ye(p);
1400
+ M = Mt.groupSVGElements(b.objects, b.options);
1393
1401
  } else
1394
- M = yield ht.fromURL(p, { crossOrigin: "anonymous" });
1395
- const { width: S, height: O } = M;
1396
- if (M instanceof ht) {
1397
- const y = M.getElement();
1398
- let A = "";
1399
- if (y instanceof HTMLImageElement ? A = y.src : y instanceof HTMLCanvasElement && (A = y.toDataURL()), O > V || S > P) {
1400
- const N = yield this.resizeImageToBoundaries(A, "max"), I = URL.createObjectURL(N);
1401
- this._createdBlobUrls.push(I), M = yield ht.fromURL(I, { crossOrigin: "anonymous" });
1402
- } else if (O < q || S < J) {
1403
- const N = yield this.resizeImageToBoundaries(A, "min"), I = URL.createObjectURL(N);
1404
- this._createdBlobUrls.push(I), M = yield ht.fromURL(I, { crossOrigin: "anonymous" });
1402
+ M = yield gt.fromURL(p, { crossOrigin: "anonymous" });
1403
+ const { width: w, height: L } = M;
1404
+ if (M instanceof gt) {
1405
+ const b = M.getElement();
1406
+ let y = "";
1407
+ if (b instanceof HTMLImageElement ? y = b.src : b instanceof HTMLCanvasElement && (y = b.toDataURL()), L > G || w > V) {
1408
+ const S = yield this.resizeImageToBoundaries(y, "max"), v = URL.createObjectURL(S);
1409
+ this._createdBlobUrls.push(v), M = yield gt.fromURL(v, { crossOrigin: "anonymous" });
1410
+ } else if (L < et || w < tt) {
1411
+ const S = yield this.resizeImageToBoundaries(y, "min"), v = URL.createObjectURL(S);
1412
+ this._createdBlobUrls.push(v), M = yield gt.fromURL(v, { crossOrigin: "anonymous" });
1405
1413
  }
1406
1414
  }
1407
1415
  if (M.set("id", `${M.type}-${x()}`), M.set("format", f), s === "scale-montage")
1408
1416
  this.editor.canvasManager.scaleMontageAreaToImage({ object: M, withoutSave: !0 });
1409
1417
  else {
1410
- const { width: y, height: A } = c, N = this.calculateScaleFactor({ imageObject: M, scaleType: s });
1411
- s === "image-contain" && N < 1 ? d.fitObject({ object: M, type: "contain", withoutSave: !0 }) : s === "image-cover" && (S > y || O > A) && d.fitObject({ object: M, type: "cover", withoutSave: !0 });
1418
+ const { width: b, height: y } = c, S = this.calculateScaleFactor({ imageObject: M, scaleType: s });
1419
+ s === "image-contain" && S < 1 ? d.fitObject({ object: M, type: "contain", withoutSave: !0 }) : s === "image-cover" && (w > b || L > y) && d.fitObject({ object: M, type: "cover", withoutSave: !0 });
1412
1420
  }
1413
1421
  r.add(M), r.centerObject(M), i || r.setActiveObject(M), r.renderAll(), l.resumeHistory(), n || l.saveState();
1414
- const T = {
1422
+ const k = {
1415
1423
  image: M,
1416
1424
  format: f,
1417
1425
  contentType: g,
@@ -1422,7 +1430,7 @@ class H {
1422
1430
  isBackground: a,
1423
1431
  withoutSelection: i
1424
1432
  };
1425
- return r.fire("editor:image-imported", T), T;
1433
+ return r.fire("editor:image-imported", k), k;
1426
1434
  } catch (p) {
1427
1435
  return u.emitError({
1428
1436
  origin: "ImageManager",
@@ -1453,15 +1461,15 @@ class H {
1453
1461
  */
1454
1462
  resizeImageToBoundaries(t, e = "max") {
1455
1463
  return C(this, null, function* () {
1456
- let s = `Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ${P}x${V}`;
1457
- e === "min" && (s = `Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ${J}x${q}`);
1464
+ let s = `Размер изображения больше максимального размера канваса, поэтому оно будет уменьшено до максимальных размеров c сохранением пропорций: ${V}x${G}`;
1465
+ e === "min" && (s = `Размер изображения меньше минимального размера канваса, поэтому оно будет увеличено до минимальных размеров c сохранением пропорций: ${tt}x${et}`);
1458
1466
  const n = {
1459
1467
  dataURL: t,
1460
1468
  sizeType: e,
1461
- maxWidth: P,
1462
- maxHeight: V,
1463
- minWidth: J,
1464
- minHeight: q
1469
+ maxWidth: V,
1470
+ maxHeight: G,
1471
+ minWidth: tt,
1472
+ minHeight: et
1465
1473
  };
1466
1474
  return this.editor.errorManager.emitWarning({
1467
1475
  origin: "ImageManager",
@@ -1494,20 +1502,20 @@ class H {
1494
1502
  try {
1495
1503
  const d = s === "application/pdf", l = d ? "image/jpg" : s, u = H.getFormatFromContentType(l);
1496
1504
  i.setCoords();
1497
- const { left: g, top: f, width: m, height: b } = i.getBoundingRect(), p = yield a.clone(["id", "format", "locked"]);
1505
+ const { left: g, top: f, width: m, height: j } = i.getBoundingRect(), p = yield a.clone(["id", "format", "locked"]);
1498
1506
  p.enableRetinaScaling = !1, ["image/jpg", "image/jpeg"].includes(l) && (p.backgroundColor = "#ffffff");
1499
- const M = p.getObjects().find((v) => v.id === i.id);
1507
+ const M = p.getObjects().find((I) => I.id === i.id);
1500
1508
  if (M && (M.visible = !1), c != null && c.isBlocked) {
1501
- const v = p.getObjects().find((w) => w.id === c.overlayMask.id);
1502
- v && (v.visible = !1);
1509
+ const I = p.getObjects().find((E) => E.id === c.overlayMask.id);
1510
+ I && (I.visible = !1);
1503
1511
  }
1504
- p.viewportTransform = [1, 0, 0, 1, -g, -f], p.setDimensions({ width: m, height: b }, { backstoreOnly: !0 }), p.renderAll();
1505
- const S = p.getObjects().filter((v) => v.format).every((v) => v.format === "svg");
1506
- if (u === "svg" && S) {
1507
- const v = p.toSVG();
1512
+ p.viewportTransform = [1, 0, 0, 1, -g, -f], p.setDimensions({ width: m, height: j }, { backstoreOnly: !0 }), p.renderAll();
1513
+ const w = p.getObjects().filter((I) => I.format).every((I) => I.format === "svg");
1514
+ if (u === "svg" && w) {
1515
+ const I = p.toSVG();
1508
1516
  p.dispose();
1509
- const L = {
1510
- image: H._exportSVGStringAsFile(v, {
1517
+ const N = {
1518
+ image: H._exportSVGStringAsFile(I, {
1511
1519
  exportAsBase64: n,
1512
1520
  exportAsBlob: o,
1513
1521
  fileName: e
@@ -1516,66 +1524,66 @@ class H {
1516
1524
  contentType: "image/svg+xml",
1517
1525
  fileName: e.replace(/\.[^/.]+$/, ".svg")
1518
1526
  };
1519
- return a.fire("editor:canvas-exported", L), L;
1527
+ return a.fire("editor:canvas-exported", N), N;
1520
1528
  }
1521
- const O = yield new Promise((v, w) => {
1522
- p.getElement().toBlob((L) => {
1523
- L ? v(L) : w(new Error("Failed to create Blob from canvas"));
1529
+ const L = yield new Promise((I, E) => {
1530
+ p.getElement().toBlob((N) => {
1531
+ N ? I(N) : E(new Error("Failed to create Blob from canvas"));
1524
1532
  });
1525
1533
  });
1526
1534
  if (p.dispose(), o) {
1527
- const v = {
1528
- image: O,
1535
+ const I = {
1536
+ image: L,
1529
1537
  format: u,
1530
1538
  contentType: l,
1531
1539
  fileName: e
1532
1540
  };
1533
- return a.fire("editor:canvas-exported", v), v;
1541
+ return a.fire("editor:canvas-exported", I), I;
1534
1542
  }
1535
- const T = yield createImageBitmap(O), y = yield r.post(
1543
+ const k = yield createImageBitmap(L), b = yield r.post(
1536
1544
  "toDataURL",
1537
- { format: u, quality: 1, bitmap: T },
1538
- [T]
1545
+ { format: u, quality: 1, bitmap: k },
1546
+ [k]
1539
1547
  );
1540
1548
  if (d) {
1541
- const w = m * 0.264583, L = b * 0.264583, _ = (yield this.editor.moduleLoader.loadModule("jspdf")).jsPDF, Y = new _({
1542
- orientation: w > L ? "landscape" : "portrait",
1549
+ const E = m * 0.264583, N = j * 0.264583, B = (yield this.editor.moduleLoader.loadModule("jspdf")).jsPDF, U = new B({
1550
+ orientation: E > N ? "landscape" : "portrait",
1543
1551
  unit: "mm",
1544
- format: [w, L]
1552
+ format: [E, N]
1545
1553
  });
1546
- if (Y.addImage(String(y), "JPG", 0, 0, w, L), n) {
1547
- const W = {
1548
- image: Y.output("datauristring"),
1554
+ if (U.addImage(String(b), "JPG", 0, 0, E, N), n) {
1555
+ const Z = {
1556
+ image: U.output("datauristring"),
1549
1557
  format: "pdf",
1550
1558
  contentType: "application/pdf",
1551
1559
  fileName: e
1552
1560
  };
1553
- return a.fire("editor:canvas-exported", W), W;
1561
+ return a.fire("editor:canvas-exported", Z), Z;
1554
1562
  }
1555
- const B = Y.output("blob"), Z = {
1556
- image: new File([B], e, { type: "application/pdf" }),
1563
+ const W = U.output("blob"), P = {
1564
+ image: new File([W], e, { type: "application/pdf" }),
1557
1565
  format: "pdf",
1558
1566
  contentType: "application/pdf",
1559
1567
  fileName: e
1560
1568
  };
1561
- return a.fire("editor:canvas-exported", Z), Z;
1569
+ return a.fire("editor:canvas-exported", P), P;
1562
1570
  }
1563
1571
  if (n) {
1564
- const v = {
1565
- image: y,
1572
+ const I = {
1573
+ image: b,
1566
1574
  format: u,
1567
1575
  contentType: l,
1568
1576
  fileName: e
1569
1577
  };
1570
- return a.fire("editor:canvas-exported", v), v;
1578
+ return a.fire("editor:canvas-exported", I), I;
1571
1579
  }
1572
- const A = u === "svg" && !S ? e.replace(/\.[^/.]+$/, ".png") : e, I = {
1573
- image: new File([O], A, { type: l }),
1580
+ const y = u === "svg" && !w ? e.replace(/\.[^/.]+$/, ".png") : e, v = {
1581
+ image: new File([L], y, { type: l }),
1574
1582
  format: u,
1575
1583
  contentType: l,
1576
- fileName: A
1584
+ fileName: y
1577
1585
  };
1578
- return a.fire("editor:canvas-exported", I), I;
1586
+ return a.fire("editor:canvas-exported", v), v;
1579
1587
  } catch (d) {
1580
1588
  return this.editor.errorManager.emitError({
1581
1589
  origin: "ImageManager",
@@ -1618,21 +1626,21 @@ class H {
1618
1626
  try {
1619
1627
  const d = H.getFormatFromContentType(n);
1620
1628
  if (d === "svg") {
1621
- const m = c.toSVG(), b = H._exportSVGStringAsFile(m, {
1629
+ const m = c.toSVG(), j = H._exportSVGStringAsFile(m, {
1622
1630
  exportAsBase64: o,
1623
1631
  exportAsBlob: a,
1624
1632
  fileName: s
1625
1633
  }), p = {
1626
1634
  object: c,
1627
- image: b,
1635
+ image: j,
1628
1636
  format: d,
1629
1637
  contentType: "image/svg+xml",
1630
1638
  fileName: s.replace(/\.[^/.]+$/, ".svg")
1631
1639
  };
1632
1640
  return i.fire("editor:object-exported", p), p;
1633
1641
  }
1634
- if (o && c instanceof ht) {
1635
- const m = yield createImageBitmap(c.getElement()), b = yield r.post(
1642
+ if (o && c instanceof gt) {
1643
+ const m = yield createImageBitmap(c.getElement()), j = yield r.post(
1636
1644
  "toDataURL",
1637
1645
  {
1638
1646
  format: d,
@@ -1642,7 +1650,7 @@ class H {
1642
1650
  [m]
1643
1651
  ), p = {
1644
1652
  object: c,
1645
- image: b,
1653
+ image: j,
1646
1654
  format: d,
1647
1655
  contentType: n,
1648
1656
  fileName: s
@@ -1651,9 +1659,9 @@ class H {
1651
1659
  }
1652
1660
  const l = c.toCanvasElement({
1653
1661
  enableRetinaScaling: !1
1654
- }), u = yield new Promise((m, b) => {
1662
+ }), u = yield new Promise((m, j) => {
1655
1663
  l.toBlob((p) => {
1656
- p ? m(p) : b(new Error("Failed to create Blob from canvas"));
1664
+ p ? m(p) : j(new Error("Failed to create Blob from canvas"));
1657
1665
  });
1658
1666
  });
1659
1667
  if (a) {
@@ -1802,11 +1810,11 @@ class H {
1802
1810
  return e ? e[1] : "";
1803
1811
  }
1804
1812
  }
1805
- const K = (h, t, e) => Math.max(Math.min(h, e), t), Se = (h, t) => h * t, us = (h, t) => new bt(h / 2, t / 2);
1806
- function gs(h) {
1813
+ const $ = (h, t, e) => Math.max(Math.min(h, e), t), Le = (h, t) => h * t, js = (h, t) => new It(h / 2, t / 2);
1814
+ function Is(h) {
1807
1815
  return ((h == null ? void 0 : h.type) === "image" || (h == null ? void 0 : h.format) === "svg") && typeof (h == null ? void 0 : h.width) == "number" && typeof (h == null ? void 0 : h.height) == "number";
1808
1816
  }
1809
- class fs {
1817
+ class As {
1810
1818
  /**
1811
1819
  * @param options
1812
1820
  * @param options.editor – экземпляр редактора
@@ -1837,10 +1845,10 @@ class fs {
1837
1845
  canvas: o,
1838
1846
  montageArea: a,
1839
1847
  options: { canvasBackstoreWidth: i }
1840
- } = this.editor, { width: r, height: c } = a, d = K(Number(t), J, P);
1848
+ } = this.editor, { width: r, height: c } = a, d = $(Number(t), tt, V);
1841
1849
  if (!i || i === "auto" || n ? this.adaptCanvasToContainer() : i ? this.setCanvasBackstoreWidth(Number(i)) : this.setCanvasBackstoreWidth(d), a.set({ width: d }), (f = o.clipPath) == null || f.set({ width: d }), e) {
1842
- const m = d / r, b = Se(c, m);
1843
- this.setResolutionHeight(b);
1850
+ const m = d / r, j = Le(c, m);
1851
+ this.setResolutionHeight(j);
1844
1852
  return;
1845
1853
  }
1846
1854
  const { left: l, top: u } = this.getObjectDefaultCoords(a), g = o.getZoom();
@@ -1867,10 +1875,10 @@ class fs {
1867
1875
  canvas: o,
1868
1876
  montageArea: a,
1869
1877
  options: { canvasBackstoreHeight: i }
1870
- } = this.editor, { width: r, height: c } = a, d = K(Number(t), q, V);
1878
+ } = this.editor, { width: r, height: c } = a, d = $(Number(t), et, G);
1871
1879
  if (!i || i === "auto" || n ? this.adaptCanvasToContainer() : i ? this.setCanvasBackstoreHeight(Number(i)) : this.setCanvasBackstoreHeight(d), a.set({ height: d }), (f = o.clipPath) == null || f.set({ height: d }), e) {
1872
- const m = d / c, b = Se(r, m);
1873
- this.setResolutionWidth(b);
1880
+ const m = d / c, j = Le(r, m);
1881
+ this.setResolutionWidth(j);
1874
1882
  return;
1875
1883
  }
1876
1884
  const { left: l, top: u } = this.getObjectDefaultCoords(a), g = o.getZoom();
@@ -1887,7 +1895,7 @@ class fs {
1887
1895
  */
1888
1896
  centerMontageArea() {
1889
1897
  var r;
1890
- const { canvas: t, montageArea: e } = this.editor, s = t.getWidth(), n = t.getHeight(), o = t.getZoom(), a = us(s, n);
1898
+ const { canvas: t, montageArea: e } = this.editor, s = t.getWidth(), n = t.getHeight(), o = t.getZoom(), a = js(s, n);
1891
1899
  e.set({
1892
1900
  left: s / 2,
1893
1901
  top: n / 2
@@ -1920,7 +1928,7 @@ class fs {
1920
1928
  */
1921
1929
  setCanvasBackstoreWidth(t) {
1922
1930
  if (!t || typeof t != "number") return;
1923
- const e = K(t, J, P);
1931
+ const e = $(t, tt, V);
1924
1932
  this.editor.canvas.setDimensions({ width: e }, { backstoreOnly: !0 });
1925
1933
  }
1926
1934
  /**
@@ -1929,7 +1937,7 @@ class fs {
1929
1937
  */
1930
1938
  setCanvasBackstoreHeight(t) {
1931
1939
  if (!t || typeof t != "number") return;
1932
- const e = K(t, q, V);
1940
+ const e = $(t, et, G);
1933
1941
  this.editor.canvas.setDimensions({ height: e }, { backstoreOnly: !0 });
1934
1942
  }
1935
1943
  /**
@@ -1938,7 +1946,7 @@ class fs {
1938
1946
  * с учётом минимальных и максимальных значений.
1939
1947
  */
1940
1948
  adaptCanvasToContainer() {
1941
- const { canvas: t } = this.editor, e = this.getEditorContainer(), s = e.clientWidth, n = e.clientHeight, o = K(s, J, P), a = K(n, q, V);
1949
+ const { canvas: t } = this.editor, e = this.getEditorContainer(), s = e.clientWidth, n = e.clientHeight, o = $(s, tt, V), a = $(n, et, G);
1942
1950
  t.setDimensions({ width: o, height: a }, { backstoreOnly: !0 });
1943
1951
  }
1944
1952
  /**
@@ -1972,7 +1980,7 @@ class fs {
1972
1980
  if (d.length === 1)
1973
1981
  t.setActiveObject(d[0]);
1974
1982
  else {
1975
- const l = new D(d, {
1983
+ const l = new T(d, {
1976
1984
  canvas: t
1977
1985
  });
1978
1986
  t.setActiveObject(l);
@@ -2138,14 +2146,14 @@ class fs {
2138
2146
  montageAreaHeight: r
2139
2147
  }
2140
2148
  } = this.editor, c = t || n.getActiveObject();
2141
- if (!gs(c)) return;
2149
+ if (!Is(c)) return;
2142
2150
  const { width: d, height: l } = c;
2143
- let u = Math.min(d, P), g = Math.min(l, V);
2151
+ let u = Math.min(d, V), g = Math.min(l, G);
2144
2152
  if (e) {
2145
2153
  const {
2146
2154
  width: f,
2147
2155
  height: m
2148
- } = o, b = d / f, p = l / m, M = Math.max(b, p);
2156
+ } = o, j = d / f, p = l / m, M = Math.max(j, p);
2149
2157
  u = f * M, g = m * M;
2150
2158
  }
2151
2159
  this.setResolutionWidth(u, { withoutSave: !0 }), this.setResolutionHeight(g, { withoutSave: !0 }), this.editor.backgroundManager.backgroundObject && this.editor.backgroundManager.refresh(), (d > i || l > r) && this.editor.zoomManager.calculateAndApplyDefaultZoom(), a.resetObject({ object: c, withoutSave: !0 }), n.centerObject(c), n.renderAll(), s || this.editor.historyManager.saveState(), n.fire("editor:montage-area-scaled-to-image", {
@@ -2198,7 +2206,7 @@ class fs {
2198
2206
  );
2199
2207
  }
2200
2208
  }
2201
- class ms {
2209
+ class Ss {
2202
2210
  constructor({ editor: t }) {
2203
2211
  this.editor = t, this.options = t.options;
2204
2212
  }
@@ -2209,7 +2217,7 @@ class ms {
2209
2217
  * @param options.withoutSave - Не сохранять состояние
2210
2218
  * @fires editor:object-rotated
2211
2219
  */
2212
- rotate(t = ls, { withoutSave: e } = {}) {
2220
+ rotate(t = bs, { withoutSave: e } = {}) {
2213
2221
  const { canvas: s, historyManager: n } = this.editor, o = s.getActiveObject();
2214
2222
  if (!o) return;
2215
2223
  const a = o.angle + t;
@@ -2259,7 +2267,7 @@ class ms {
2259
2267
  withoutSave: s
2260
2268
  } = {}) {
2261
2269
  const { canvas: n, historyManager: o } = this.editor, a = t || n.getActiveObject();
2262
- a && (a instanceof D ? a.getObjects().forEach((i) => {
2270
+ a && (a instanceof T ? a.getObjects().forEach((i) => {
2263
2271
  i.set("opacity", e);
2264
2272
  }) : a.set("opacity", e), n.renderAll(), s || o.saveState(), n.fire("editor:object-opacity-changed", {
2265
2273
  object: a,
@@ -2286,12 +2294,12 @@ class ms {
2286
2294
  } = {}) {
2287
2295
  const { canvas: o, historyManager: a } = this.editor, i = t || o.getActiveObject();
2288
2296
  if (i) {
2289
- if (i instanceof D && !n) {
2297
+ if (i instanceof T && !n) {
2290
2298
  const r = i.getObjects();
2291
2299
  o.discardActiveObject(), r.forEach((d) => {
2292
2300
  this._fitSingleObject(d, e);
2293
2301
  });
2294
- const c = new D(r, { canvas: o });
2302
+ const c = new T(r, { canvas: o });
2295
2303
  o.setActiveObject(c);
2296
2304
  } else
2297
2305
  this._fitSingleObject(i, e);
@@ -2310,11 +2318,11 @@ class ms {
2310
2318
  * @private
2311
2319
  */
2312
2320
  _fitSingleObject(t, e) {
2313
- const { canvas: s, montageArea: n } = this.editor, { width: o, height: a, scaleX: i = 1, scaleY: r = 1, angle: c = 0 } = t, d = o * Math.abs(i), l = a * Math.abs(r), u = c * Math.PI / 180, g = Math.abs(Math.cos(u)), f = Math.abs(Math.sin(u)), m = d * g + l * f, b = d * f + l * g, p = n.width, M = n.height;
2314
- let S;
2315
- e === "contain" ? S = Math.min(p / m, M / b) : S = Math.max(p / m, M / b), t.set({
2316
- scaleX: i * S,
2317
- scaleY: r * S
2321
+ const { canvas: s, montageArea: n } = this.editor, { width: o, height: a, scaleX: i = 1, scaleY: r = 1, angle: c = 0 } = t, d = o * Math.abs(i), l = a * Math.abs(r), u = c * Math.PI / 180, g = Math.abs(Math.cos(u)), f = Math.abs(Math.sin(u)), m = d * g + l * f, j = d * f + l * g, p = n.width, M = n.height;
2322
+ let w;
2323
+ e === "contain" ? w = Math.min(p / m, M / j) : w = Math.max(p / m, M / j), t.set({
2324
+ scaleX: i * w,
2325
+ scaleY: r * w
2318
2326
  }), s.centerObject(t);
2319
2327
  }
2320
2328
  /**
@@ -2364,9 +2372,9 @@ class ms {
2364
2372
  });
2365
2373
  }
2366
2374
  }
2367
- class ps {
2375
+ class Cs {
2368
2376
  constructor({ editor: t }) {
2369
- this.editor = t, this.options = t.options, this.minZoom = this.options.minZoom || cs, this.maxZoom = this.options.maxZoom || ds, this.defaultZoom = this.options.defaultScale;
2377
+ this.editor = t, this.options = t.options, this.minZoom = this.options.minZoom || Ms, this.maxZoom = this.options.maxZoom || ys, this.defaultZoom = this.options.defaultScale;
2370
2378
  }
2371
2379
  /**
2372
2380
  * Вспомогательный метод для вычисления размеров масштабированной монтажной области
@@ -2388,10 +2396,10 @@ class ps {
2388
2396
  * @private
2389
2397
  */
2390
2398
  _getClampedPointerCoordinates(t) {
2391
- const { canvas: e, montageArea: s } = this.editor, n = e.getPointer(t, !0), o = e.viewportTransform, a = e.getZoom(), i = s.left - s.width / 2, r = s.left + s.width / 2, c = s.top - s.height / 2, d = s.top + s.height / 2, l = i * a + o[4], u = r * a + o[4], g = c * a + o[5], f = d * a + o[5], m = Math.max(l, Math.min(u, n.x)), b = Math.max(g, Math.min(f, n.y));
2399
+ const { canvas: e, montageArea: s } = this.editor, n = e.getPointer(t, !0), o = e.viewportTransform, a = e.getZoom(), i = s.left - s.width / 2, r = s.left + s.width / 2, c = s.top - s.height / 2, d = s.top + s.height / 2, l = i * a + o[4], u = r * a + o[4], g = c * a + o[5], f = d * a + o[5], m = Math.max(l, Math.min(u, n.x)), j = Math.max(g, Math.min(f, n.y));
2392
2400
  return {
2393
2401
  x: m,
2394
- y: b
2402
+ y: j
2395
2403
  };
2396
2404
  }
2397
2405
  /**
@@ -2423,10 +2431,10 @@ class ps {
2423
2431
  * @private
2424
2432
  */
2425
2433
  _calculateEmptySpaceRatio(t) {
2426
- const { canvas: e, montageArea: s } = this.editor, n = e.viewportTransform, o = e.getWidth(), a = e.getHeight(), i = s.left - s.width / 2, r = s.left + s.width / 2, c = s.top - s.height / 2, d = s.top + s.height / 2, l = -n[4] / t, u = (-n[4] + o) / t, g = -n[5] / t, f = (-n[5] + a) / t, m = l < i, b = u > r, p = g < c, M = f > d;
2427
- if (!(m || b || p || M)) return 0;
2428
- const O = Math.max(0, i - l), T = Math.max(0, u - r), y = Math.max(0, c - g), A = Math.max(0, f - d), N = Math.max(O, T), I = Math.max(y, A), v = N / o, w = I / a;
2429
- return Math.max(v, w);
2434
+ const { canvas: e, montageArea: s } = this.editor, n = e.viewportTransform, o = e.getWidth(), a = e.getHeight(), i = s.left - s.width / 2, r = s.left + s.width / 2, c = s.top - s.height / 2, d = s.top + s.height / 2, l = -n[4] / t, u = (-n[4] + o) / t, g = -n[5] / t, f = (-n[5] + a) / t, m = l < i, j = u > r, p = g < c, M = f > d;
2435
+ if (!(m || j || p || M)) return 0;
2436
+ const L = Math.max(0, i - l), k = Math.max(0, u - r), b = Math.max(0, c - g), y = Math.max(0, f - d), S = Math.max(L, k), v = Math.max(b, y), I = S / o, E = v / a;
2437
+ return Math.max(I, E);
2430
2438
  }
2431
2439
  /**
2432
2440
  * Вычисляет плавный шаг перемещения viewport к центру с ускорением
@@ -2442,8 +2450,8 @@ class ps {
2442
2450
  const { canvas: a, montageArea: i } = this.editor, r = a.viewportTransform, c = a.getWidth(), d = a.getHeight(), l = t.x - r[4], u = t.y - r[5], g = Math.abs(n), f = e - s;
2443
2451
  if (Math.abs(f) / g <= 0.1)
2444
2452
  return { x: l, y: u };
2445
- const b = c / 2, p = d / 2, M = i.left, S = i.top, O = b - M * s, T = p - S * s, y = (O - r[4]) / (e - s), A = (T - r[5]) / (e - s), N = y * g, I = A * g, v = N * o, w = I * o, L = Math.abs(v) > Math.abs(l) ? l : v, _ = Math.abs(w) > Math.abs(u) ? u : w;
2446
- return { x: L, y: _ };
2453
+ const j = c / 2, p = d / 2, M = i.left, w = i.top, L = j - M * s, k = p - w * s, b = (L - r[4]) / (e - s), y = (k - r[5]) / (e - s), S = b * g, v = y * g, I = S * o, E = v * o, N = Math.abs(I) > Math.abs(l) ? l : I, B = Math.abs(E) > Math.abs(u) ? u : E;
2454
+ return { x: N, y: B };
2447
2455
  }
2448
2456
  /**
2449
2457
  * Применяет плавное центрирование viewport при приближении к defaultZoom.
@@ -2455,7 +2463,7 @@ class ps {
2455
2463
  * @returns true если центрирование было применено
2456
2464
  * @private
2457
2465
  */
2458
- _applyViewportCentering(t, e = !1, s = Ae) {
2466
+ _applyViewportCentering(t, e = !1, s = Te) {
2459
2467
  const { canvas: n } = this.editor, o = this._getScaledMontageDimensions(t), a = n.getWidth(), i = n.getHeight(), r = o.width > a || o.height > i, c = this._calculateFitZoom(), d = t - c;
2460
2468
  if (!(!r || d) && !e)
2461
2469
  return !1;
@@ -2530,10 +2538,10 @@ class ps {
2530
2538
  * @param options.pointY - Координата Y точки зума
2531
2539
  * @fires editor:zoom-changed
2532
2540
  */
2533
- zoom(t = Ae, e = {}) {
2541
+ zoom(t = Te, e = {}) {
2534
2542
  var g, f;
2535
2543
  if (!t) return;
2536
- const { minZoom: s, maxZoom: n } = this, { canvas: o } = this.editor, a = t < 0, i = o.getZoom(), r = o.getCenterPoint(), c = (g = e.pointX) != null ? g : r.x, d = (f = e.pointY) != null ? f : r.y, l = new bt(c, d);
2544
+ const { minZoom: s, maxZoom: n } = this, { canvas: o } = this.editor, a = t < 0, i = o.getZoom(), r = o.getCenterPoint(), c = (g = e.pointX) != null ? g : r.x, d = (f = e.pointY) != null ? f : r.y, l = new It(c, d);
2537
2545
  this.editor.montageArea.setCoords(), this.editor.canvas.requestRenderAll();
2538
2546
  let u = Number((i + Number(t)).toFixed(3));
2539
2547
  u > n && (u = n), u < s && (u = s), o.zoomToPoint(l, u), this.editor.panConstraintManager.updateBounds(), this._applyViewportCentering(u, a, t), o.fire("editor:zoom-changed", {
@@ -2548,7 +2556,7 @@ class ps {
2548
2556
  * @fires editor:zoom-changed
2549
2557
  */
2550
2558
  setZoom(t = this.defaultZoom) {
2551
- const { minZoom: e, maxZoom: s } = this, { canvas: n } = this.editor, o = new bt(n.getCenterPoint());
2559
+ const { minZoom: e, maxZoom: s } = this, { canvas: n } = this.editor, o = new It(n.getCenterPoint());
2552
2560
  let a = t;
2553
2561
  t > s && (a = s), t < e && (a = e), n.zoomToPoint(o, a), n.fire("editor:zoom-changed", {
2554
2562
  currentZoom: n.getZoom(),
@@ -2561,14 +2569,14 @@ class ps {
2561
2569
  * @fires editor:zoom-changed
2562
2570
  */
2563
2571
  resetZoom() {
2564
- const { canvas: t } = this.editor, e = new bt(t.getCenterPoint());
2572
+ const { canvas: t } = this.editor, e = new It(t.getCenterPoint());
2565
2573
  t.zoomToPoint(e, this.defaultZoom), this.editor.canvas.fire("editor:zoom-changed", {
2566
2574
  currentZoom: t.getZoom(),
2567
2575
  point: e
2568
2576
  }), this.editor.panConstraintManager.updateBounds();
2569
2577
  }
2570
2578
  }
2571
- class Ms {
2579
+ class ws {
2572
2580
  constructor({ editor: t }) {
2573
2581
  this.editor = t, this.isBlocked = !1, this.overlayMask = null, this._createOverlay();
2574
2582
  }
@@ -2625,7 +2633,7 @@ class Ms {
2625
2633
  }), t.upperCanvasEl.style.pointerEvents = "", t.lowerCanvasEl.style.pointerEvents = "", this.overlayMask.visible = !1, t.requestRenderAll(), t.fire("editor:enabled"), s.resumeHistory();
2626
2634
  }
2627
2635
  }
2628
- class Q {
2636
+ class q {
2629
2637
  constructor({ editor: t }) {
2630
2638
  this.editor = t, this.backgroundObject = null;
2631
2639
  }
@@ -2680,8 +2688,8 @@ class Q {
2680
2688
  try {
2681
2689
  const { historyManager: o } = this.editor, { backgroundObject: a } = this;
2682
2690
  if (o.suspendHistory(), a && a.backgroundType === "gradient") {
2683
- const i = Q._createFabricGradient(t);
2684
- if (Q._isGradientEqual(a.fill, i)) {
2691
+ const i = q._createFabricGradient(t);
2692
+ if (q._isGradientEqual(a.fill, i)) {
2685
2693
  o.resumeHistory();
2686
2694
  return;
2687
2695
  }
@@ -2853,7 +2861,7 @@ class Q {
2853
2861
  backgroundType: "gradient",
2854
2862
  backgroundId: `background-${x()}`
2855
2863
  }, { withoutSelection: !0 }), this.refresh();
2856
- const e = Q._createFabricGradient(t);
2864
+ const e = q._createFabricGradient(t);
2857
2865
  this.backgroundObject.set("fill", e), this.editor.canvas.requestRenderAll();
2858
2866
  }
2859
2867
  /**
@@ -2905,8 +2913,8 @@ class Q {
2905
2913
  { offset: o / 100, color: s }
2906
2914
  ];
2907
2915
  if (t.type === "linear") {
2908
- const l = t.angle * Math.PI / 180, u = Q._angleToCoords(l);
2909
- return new ye({
2916
+ const l = t.angle * Math.PI / 180, u = q._angleToCoords(l);
2917
+ return new Ce({
2910
2918
  type: "linear",
2911
2919
  gradientUnits: "percentage",
2912
2920
  coords: u,
@@ -2925,7 +2933,7 @@ class Q {
2925
2933
  r1: 0,
2926
2934
  r2: c / 100
2927
2935
  };
2928
- return new ye({
2936
+ return new Ce({
2929
2937
  type: "radial",
2930
2938
  gradientUnits: "percentage",
2931
2939
  coords: d,
@@ -2960,7 +2968,7 @@ class Q {
2960
2968
  }) ? !1 : t.type === "linear" && e.type === "linear" ? Math.abs(t.coords.x1 - e.coords.x1) < 1e-4 && Math.abs(t.coords.y1 - e.coords.y1) < 1e-4 && Math.abs(t.coords.x2 - e.coords.x2) < 1e-4 && Math.abs(t.coords.y2 - e.coords.y2) < 1e-4 : t.type === "radial" && e.type === "radial" ? Math.abs(t.coords.x1 - e.coords.x1) < 1e-4 && Math.abs(t.coords.y1 - e.coords.y1) < 1e-4 && Math.abs(t.coords.x2 - e.coords.x2) < 1e-4 && Math.abs(t.coords.y2 - e.coords.y2) < 1e-4 && Math.abs(t.coords.r1 - e.coords.r1) < 1e-4 && Math.abs(t.coords.r2 - e.coords.r2) < 1e-4 : !1;
2961
2969
  }
2962
2970
  }
2963
- class At {
2971
+ class Ct {
2964
2972
  constructor({ editor: t }) {
2965
2973
  this.editor = t;
2966
2974
  }
@@ -2975,7 +2983,7 @@ class At {
2975
2983
  const { canvas: s, historyManager: n } = this.editor;
2976
2984
  n.suspendHistory();
2977
2985
  const o = t || s.getActiveObject();
2978
- o && (o instanceof D ? o.getObjects().forEach((a) => {
2986
+ o && (o instanceof T ? o.getObjects().forEach((a) => {
2979
2987
  s.bringObjectToFront(a);
2980
2988
  }) : s.bringObjectToFront(o), s.renderAll(), n.resumeHistory(), e || n.saveState(), s.fire("editor:object-bring-to-front", {
2981
2989
  object: o,
@@ -2993,7 +3001,7 @@ class At {
2993
3001
  const { canvas: s, historyManager: n } = this.editor;
2994
3002
  n.suspendHistory();
2995
3003
  const o = t || s.getActiveObject();
2996
- o && (o instanceof D ? At._moveSelectionForward(s, o) : s.bringObjectForward(o), s.renderAll(), n.resumeHistory(), e || n.saveState(), s.fire("editor:object-bring-forward", {
3004
+ o && (o instanceof T ? Ct._moveSelectionForward(s, o) : s.bringObjectForward(o), s.renderAll(), n.resumeHistory(), e || n.saveState(), s.fire("editor:object-bring-forward", {
2997
3005
  object: o,
2998
3006
  withoutSave: e
2999
3007
  }));
@@ -3016,7 +3024,7 @@ class At {
3016
3024
  o.suspendHistory();
3017
3025
  const r = t || s.getActiveObject();
3018
3026
  if (r) {
3019
- if (r instanceof D) {
3027
+ if (r instanceof T) {
3020
3028
  const c = r.getObjects();
3021
3029
  for (let d = c.length - 1; d >= 0; d -= 1)
3022
3030
  s.sendObjectToBack(c[d]);
@@ -3044,7 +3052,7 @@ class At {
3044
3052
  } = this.editor;
3045
3053
  o.suspendHistory();
3046
3054
  const r = t || s.getActiveObject();
3047
- r && (r instanceof D ? At._moveSelectionBackwards(s, r) : s.sendObjectBackwards(r), i && s.sendObjectToBack(i), s.sendObjectToBack(n), a && s.sendObjectToBack(a), s.renderAll(), o.resumeHistory(), e || o.saveState(), s.fire("editor:object-send-backwards", {
3055
+ r && (r instanceof T ? Ct._moveSelectionBackwards(s, r) : s.sendObjectBackwards(r), i && s.sendObjectToBack(i), s.sendObjectToBack(n), a && s.sendObjectToBack(a), s.renderAll(), o.resumeHistory(), e || o.saveState(), s.fire("editor:object-send-backwards", {
3048
3056
  object: r,
3049
3057
  withoutSave: e
3050
3058
  }));
@@ -3088,7 +3096,7 @@ class At {
3088
3096
  });
3089
3097
  }
3090
3098
  }
3091
- class ys {
3099
+ class Es {
3092
3100
  /**
3093
3101
  * Менеджер фигур для редактора.
3094
3102
  * @param options - Опции и настройки менеджера фигур.
@@ -3120,7 +3128,7 @@ class ys {
3120
3128
  width: n = 100,
3121
3129
  height: o = 100,
3122
3130
  fill: a = "blue"
3123
- } = l, i = X(l, [
3131
+ } = l, i = K(l, [
3124
3132
  "id",
3125
3133
  "left",
3126
3134
  "top",
@@ -3128,7 +3136,7 @@ class ys {
3128
3136
  "height",
3129
3137
  "fill"
3130
3138
  ]);
3131
- const { canvas: u } = this.editor, g = new Le(E({
3139
+ const { canvas: u } = this.editor, g = new Fe(D({
3132
3140
  id: t,
3133
3141
  left: e,
3134
3142
  top: s,
@@ -3161,14 +3169,14 @@ class ys {
3161
3169
  top: s,
3162
3170
  radius: n = 50,
3163
3171
  fill: o = "green"
3164
- } = d, a = X(d, [
3172
+ } = d, a = K(d, [
3165
3173
  "id",
3166
3174
  "left",
3167
3175
  "top",
3168
3176
  "radius",
3169
3177
  "fill"
3170
3178
  ]);
3171
- const { canvas: l } = this.editor, u = new xe(E({
3179
+ const { canvas: l } = this.editor, u = new He(D({
3172
3180
  id: t,
3173
3181
  left: e,
3174
3182
  top: s,
@@ -3202,7 +3210,7 @@ class ys {
3202
3210
  width: n = 100,
3203
3211
  height: o = 100,
3204
3212
  fill: a = "yellow"
3205
- } = l, i = X(l, [
3213
+ } = l, i = K(l, [
3206
3214
  "id",
3207
3215
  "left",
3208
3216
  "top",
@@ -3210,7 +3218,7 @@ class ys {
3210
3218
  "height",
3211
3219
  "fill"
3212
3220
  ]);
3213
- const { canvas: u } = this.editor, g = new ke(E({
3221
+ const { canvas: u } = this.editor, g = new We(D({
3214
3222
  id: t,
3215
3223
  left: e,
3216
3224
  top: s,
@@ -3221,7 +3229,7 @@ class ys {
3221
3229
  return !e && !s && u.centerObject(g), c || (u.add(g), r || u.setActiveObject(g), u.renderAll()), g;
3222
3230
  }
3223
3231
  }
3224
- class bs {
3232
+ class Ds {
3225
3233
  /**
3226
3234
  * @param options
3227
3235
  * @param options.editor - экземпляр редактора с доступом к canvas
@@ -3252,7 +3260,7 @@ class bs {
3252
3260
  return C(this, null, function* () {
3253
3261
  const { canvas: e, errorManager: s } = this.editor;
3254
3262
  try {
3255
- const n = yield t.clone(yt);
3263
+ const n = yield t.clone(jt);
3256
3264
  this.clipboard = n, e.fire("editor:object-copied", { object: n });
3257
3265
  } catch (n) {
3258
3266
  s.emitError({
@@ -3279,7 +3287,7 @@ class bs {
3279
3287
  message: "navigator.clipboard не поддерживается в этом браузере или отсутствует HTTPS-соединение."
3280
3288
  }), !1;
3281
3289
  try {
3282
- const s = t.toObject(yt), n = JSON.stringify(s);
3290
+ const s = t.toObject(jt), n = JSON.stringify(s);
3283
3291
  return t.type === "image" ? this._copyImageToClipboard(t, n) : this._copyTextToClipboard(n);
3284
3292
  } catch (s) {
3285
3293
  return e.emitError({
@@ -3320,7 +3328,7 @@ class bs {
3320
3328
  _copyTextToClipboard(t) {
3321
3329
  return C(this, null, function* () {
3322
3330
  try {
3323
- const e = `${Ce}${t}`;
3331
+ const e = `${Ne}${t}`;
3324
3332
  return yield navigator.clipboard.writeText(e), console.info("Text copied to clipboard successfully"), !0;
3325
3333
  } catch (e) {
3326
3334
  const { errorManager: s } = this.editor;
@@ -3340,7 +3348,7 @@ class bs {
3340
3348
  */
3341
3349
  _addClonedObjectToCanvas(t) {
3342
3350
  const { canvas: e, historyManager: s } = this.editor;
3343
- if (e.discardActiveObject(), t instanceof D) {
3351
+ if (e.discardActiveObject(), t instanceof T) {
3344
3352
  s.suspendHistory(), t.canvas = e, t.forEachObject((n) => {
3345
3353
  e.add(n);
3346
3354
  }), e.setActiveObject(t), e.requestRenderAll(), s.resumeHistory(), s.saveState();
@@ -3373,8 +3381,8 @@ class bs {
3373
3381
  const { canvas: e } = this.editor, s = t || e.getActiveObject();
3374
3382
  if (!s || s.locked) return !1;
3375
3383
  try {
3376
- const n = yield s.clone(yt);
3377
- return n instanceof D && n.forEachObject((o) => {
3384
+ const n = yield s.clone(jt);
3385
+ return n instanceof T && n.forEachObject((o) => {
3378
3386
  o.set({
3379
3387
  id: `${o.type}-${x()}`,
3380
3388
  evented: !0
@@ -3411,7 +3419,7 @@ class bs {
3411
3419
  return;
3412
3420
  }
3413
3421
  const s = t.getData("text/plain");
3414
- if (s && s.startsWith(Ce)) {
3422
+ if (s && s.startsWith(Ne)) {
3415
3423
  this.paste();
3416
3424
  return;
3417
3425
  }
@@ -3459,8 +3467,8 @@ class bs {
3459
3467
  const { canvas: t } = this.editor;
3460
3468
  if (!this.clipboard) return !1;
3461
3469
  try {
3462
- const e = yield this.clipboard.clone(yt);
3463
- return t.discardActiveObject(), e instanceof D && e.forEachObject((s) => {
3470
+ const e = yield this.clipboard.clone(jt);
3471
+ return t.discardActiveObject(), e instanceof T && e.forEachObject((s) => {
3464
3472
  s.set({
3465
3473
  id: `${s.type}-${x()}`,
3466
3474
  evented: !0
@@ -3484,7 +3492,7 @@ class bs {
3484
3492
  });
3485
3493
  }
3486
3494
  }
3487
- class Ct {
3495
+ class wt {
3488
3496
  constructor({ editor: t }) {
3489
3497
  this.editor = t;
3490
3498
  }
@@ -3507,9 +3515,10 @@ class Ct {
3507
3515
  lockScalingY: !0,
3508
3516
  lockSkewingX: !0,
3509
3517
  lockSkewingY: !0,
3518
+ editable: !1,
3510
3519
  locked: !0
3511
3520
  };
3512
- a.set(i), !e && Ct._isGroupOrSelection(a) && a.getObjects().forEach((c) => {
3521
+ a.set(i), !e && wt._isGroupOrSelection(a) && a.getObjects().forEach((c) => {
3513
3522
  c.set(i);
3514
3523
  }), n.renderAll(), s || o.saveState(), n.fire("editor:object-locked", {
3515
3524
  object: a,
@@ -3535,9 +3544,10 @@ class Ct {
3535
3544
  lockScalingY: !1,
3536
3545
  lockSkewingX: !1,
3537
3546
  lockSkewingY: !1,
3547
+ editable: !0,
3538
3548
  locked: !1
3539
3549
  };
3540
- o.set(a), Ct._isGroupOrSelection(o) && o.getObjects().forEach((i) => {
3550
+ o.set(a), wt._isGroupOrSelection(o) && o.getObjects().forEach((i) => {
3541
3551
  i.set(a);
3542
3552
  }), s.renderAll(), e || n.saveState(), s.fire("editor:object-unlocked", {
3543
3553
  object: o,
@@ -3545,10 +3555,10 @@ class Ct {
3545
3555
  });
3546
3556
  }
3547
3557
  static _isGroupOrSelection(t) {
3548
- return t instanceof D || t instanceof $;
3558
+ return t instanceof T || t instanceof Q;
3549
3559
  }
3550
3560
  }
3551
- class vs {
3561
+ class Os {
3552
3562
  constructor({ editor: t }) {
3553
3563
  this.editor = t;
3554
3564
  }
@@ -3560,7 +3570,7 @@ class vs {
3560
3570
  if (Array.isArray(t))
3561
3571
  return t.length > 0 ? t : null;
3562
3572
  const e = t || this.editor.canvas.getActiveObject();
3563
- return !e || !(e instanceof D) ? null : e.getObjects();
3573
+ return !e || !(e instanceof T) ? null : e.getObjects();
3564
3574
  }
3565
3575
  /**
3566
3576
  * Получить группы для разгруппировки
@@ -3568,20 +3578,20 @@ class vs {
3568
3578
  */
3569
3579
  _getGroupsToUngroup(t) {
3570
3580
  if (Array.isArray(t)) {
3571
- const s = t.filter((n) => n instanceof $);
3581
+ const s = t.filter((n) => n instanceof Q);
3572
3582
  return s.length > 0 ? s : null;
3573
3583
  }
3574
- if (t instanceof D) {
3575
- const s = t.getObjects().filter((n) => n instanceof $);
3584
+ if (t instanceof T) {
3585
+ const s = t.getObjects().filter((n) => n instanceof Q);
3576
3586
  return s.length > 0 ? s : null;
3577
3587
  }
3578
3588
  const e = t || this.editor.canvas.getActiveObject();
3579
3589
  if (!e) return null;
3580
- if (e instanceof D) {
3581
- const s = e.getObjects().filter((n) => n instanceof $);
3590
+ if (e instanceof T) {
3591
+ const s = e.getObjects().filter((n) => n instanceof Q);
3582
3592
  return s.length > 0 ? s : null;
3583
3593
  }
3584
- return e instanceof $ ? [e] : null;
3594
+ return e instanceof Q ? [e] : null;
3585
3595
  }
3586
3596
  /**
3587
3597
  * Группировка объектов
@@ -3598,7 +3608,7 @@ class vs {
3598
3608
  if (!o) return null;
3599
3609
  try {
3600
3610
  n.suspendHistory();
3601
- const a = new $(o, {
3611
+ const a = new Q(o, {
3602
3612
  id: `group-${x()}`
3603
3613
  });
3604
3614
  o.forEach((r) => s.remove(r)), s.add(a), s.setActiveObject(a), s.requestRenderAll();
@@ -3634,7 +3644,7 @@ class vs {
3634
3644
  s.add(l), a.push(l);
3635
3645
  });
3636
3646
  });
3637
- const i = new D(a, {
3647
+ const i = new T(a, {
3638
3648
  canvas: s
3639
3649
  });
3640
3650
  s.setActiveObject(i), s.requestRenderAll();
@@ -3649,7 +3659,7 @@ class vs {
3649
3659
  }
3650
3660
  }
3651
3661
  }
3652
- class js {
3662
+ class Ts {
3653
3663
  constructor({ editor: t }) {
3654
3664
  this.editor = t;
3655
3665
  }
@@ -3660,11 +3670,11 @@ class js {
3660
3670
  selectAll() {
3661
3671
  const { canvas: t, canvasManager: e, objectLockManager: s } = this.editor;
3662
3672
  t.discardActiveObject();
3663
- const n = e.getObjects(), o = n.some((i) => i.locked), a = n.length > 1 ? new D(e.getObjects(), { canvas: t }) : n[0];
3673
+ const n = e.getObjects(), o = n.some((i) => i.locked), a = n.length > 1 ? new T(e.getObjects(), { canvas: t }) : n[0];
3664
3674
  o && s.lockObject({ object: a, skipInnerObjects: !0, withoutSave: !0 }), t.setActiveObject(a), t.requestRenderAll(), t.fire("editor:all-objects-selected", { selected: a });
3665
3675
  }
3666
3676
  }
3667
- class Rt {
3677
+ class zt {
3668
3678
  constructor({ editor: t }) {
3669
3679
  this.editor = t;
3670
3680
  }
@@ -3711,7 +3721,7 @@ class Rt {
3711
3721
  s || o.suspendHistory();
3712
3722
  const r = [];
3713
3723
  if (i.forEach((d) => {
3714
- if (Rt._isUngroupableGroup(d)) {
3724
+ if (zt._isUngroupableGroup(d)) {
3715
3725
  const l = this._handleGroupDeletion(d);
3716
3726
  r.push(...l);
3717
3727
  return;
@@ -3726,7 +3736,7 @@ class Rt {
3726
3736
  return n.fire("editor:objects-deleted", c), c;
3727
3737
  }
3728
3738
  }
3729
- const Is = {
3739
+ const Ns = {
3730
3740
  IMAGE_MANAGER: {
3731
3741
  /**
3732
3742
  * Некорректный Content-Type изображения
@@ -3825,7 +3835,7 @@ const Is = {
3825
3835
  INVALID_GRADIENT_FORMAT: "INVALID_GRADIENT_FORMAT"
3826
3836
  }
3827
3837
  };
3828
- class St {
3838
+ class Et {
3829
3839
  constructor({ editor: t }) {
3830
3840
  this._buffer = [], this.editor = t;
3831
3841
  }
@@ -3852,7 +3862,7 @@ class St {
3852
3862
  * @fires editor:error
3853
3863
  */
3854
3864
  emitError({ origin: t = "ImageEditor", method: e = "Unknown Method", code: s, data: n, message: o }) {
3855
- if (!St.isValidErrorCode(s)) {
3865
+ if (!Et.isValidErrorCode(s)) {
3856
3866
  console.warn("Неизвестный код ошибки: ", { code: s, origin: t, method: e });
3857
3867
  return;
3858
3868
  }
@@ -3866,7 +3876,7 @@ class St {
3866
3876
  message: a,
3867
3877
  data: n
3868
3878
  };
3869
- this._buffer.push(E({
3879
+ this._buffer.push(D({
3870
3880
  type: "editor:error"
3871
3881
  }, i)), this.editor.canvas.fire("editor:error", i);
3872
3882
  }
@@ -3881,7 +3891,7 @@ class St {
3881
3891
  * @fires editor:warning
3882
3892
  */
3883
3893
  emitWarning({ origin: t = "ImageEditor", method: e = "Unknown Method", code: s, message: n, data: o }) {
3884
- if (!St.isValidErrorCode(s)) {
3894
+ if (!Et.isValidErrorCode(s)) {
3885
3895
  console.warn("Неизвестный код предупреждения: ", { code: s, origin: t, method: e });
3886
3896
  return;
3887
3897
  }
@@ -3894,7 +3904,7 @@ class St {
3894
3904
  message: a,
3895
3905
  data: o
3896
3906
  };
3897
- this._buffer.push(E({
3907
+ this._buffer.push(D({
3898
3908
  type: "editor:warning"
3899
3909
  }, i)), this.editor.canvas.fire("editor:warning", i);
3900
3910
  }
@@ -3904,10 +3914,10 @@ class St {
3904
3914
  * @returns true, если код допустим, иначе false
3905
3915
  */
3906
3916
  static isValidErrorCode(t) {
3907
- return t ? Object.values(Is).some((e) => Object.values(e).includes(t)) : !1;
3917
+ return t ? Object.values(Ns).some((e) => Object.values(e).includes(t)) : !1;
3908
3918
  }
3909
3919
  }
3910
- class As {
3920
+ class Ls {
3911
3921
  constructor({ editor: t }) {
3912
3922
  this.currentBounds = null, this.editor = t;
3913
3923
  }
@@ -3992,8 +4002,8 @@ class As {
3992
4002
  this.currentBounds = this.calculatePanBounds();
3993
4003
  }
3994
4004
  }
3995
- const Et = 0.01;
3996
- class k {
4005
+ const Ot = 0.01;
4006
+ class O {
3997
4007
  constructor({ editor: t }) {
3998
4008
  var e;
3999
4009
  this._handleTextEditingEntered = () => {
@@ -4001,10 +4011,10 @@ class k {
4001
4011
  }, this._handleTextChanged = (s) => {
4002
4012
  var r, c;
4003
4013
  const { target: n } = s;
4004
- if (!k._isTextbox(n)) return;
4014
+ if (!O._isTextbox(n)) return;
4005
4015
  const o = (r = n.text) != null ? r : "", a = !!n.uppercase, i = (c = n.textCaseRaw) != null ? c : "";
4006
4016
  if (a) {
4007
- const d = k._toUpperCase(o);
4017
+ const d = O._toUpperCase(o);
4008
4018
  d !== o && (n.set({ text: d }), this.canvas.requestRenderAll());
4009
4019
  const l = i.length, u = o.length;
4010
4020
  if (u > l) {
@@ -4016,7 +4026,7 @@ class k {
4016
4026
  }, this._handleTextEditingExited = (s) => {
4017
4027
  var i, r;
4018
4028
  const { target: n } = s;
4019
- if (!k._isTextbox(n)) return;
4029
+ if (!O._isTextbox(n)) return;
4020
4030
  const o = (i = n.text) != null ? i : "";
4021
4031
  if (!!n.uppercase) {
4022
4032
  const c = (r = n.textCaseRaw) != null ? r : o.toLocaleLowerCase();
@@ -4028,33 +4038,35 @@ class k {
4028
4038
  lockMovementY: !1
4029
4039
  }), setTimeout(() => {
4030
4040
  this.isTextEditingActive = !1, this.editor.historyManager.saveState();
4031
- }, hs);
4041
+ }, vs);
4032
4042
  }, this._handleObjectScaling = (s) => {
4033
- var Z, G, W, tt, et, st, nt, ot, at, it, rt, ct, dt, lt;
4043
+ var P, X, Z, st, nt, ot, at, it, rt, ct, dt, lt, ht, ut;
4034
4044
  const { target: n, transform: o } = s;
4035
- if (!k._isTextbox(n) || !o) return;
4036
- const a = this._ensureScalingState(n), { baseWidth: i, baseLeft: r, baseFontSize: c } = a, d = typeof ((Z = o.original) == null ? void 0 : Z.width) == "number" ? o.original.width : void 0, l = typeof ((G = o.original) == null ? void 0 : G.left) == "number" ? o.original.left : void 0, u = d != null ? d : i, g = l != null ? l : r, f = (W = o.corner) != null ? W : "", m = (tt = o.action) != null ? tt : "", b = ["ml", "mr"].includes(f) || m === "scaleX", p = ["mt", "mb"].includes(f) || m === "scaleY", M = ["tl", "tr", "bl", "br"].includes(f) || m === "scale";
4037
- if (!b && !p && !M) return;
4038
- const S = Math.abs((st = (et = n.scaleX) != null ? et : o.scaleX) != null ? st : 1) || 1, O = Math.abs((ot = (nt = n.scaleY) != null ? nt : o.scaleY) != null ? ot : 1) || 1, T = Math.max(1, u * S), y = Math.max(1, c * O), A = (it = (at = o.originX) != null ? at : n.originX) != null ? it : "left", N = g + u, I = g + u / 2, v = (rt = n.width) != null ? rt : u, w = Math.abs(T - v) > Et, L = Math.abs(y - ((ct = n.fontSize) != null ? ct : c)) > Et;
4039
- if (!w && !L) {
4045
+ if (!O._isTextbox(n) || !o) return;
4046
+ n.isScaling = !0;
4047
+ const a = this._ensureScalingState(n), { baseWidth: i, baseLeft: r, baseFontSize: c } = a, d = typeof ((P = o.original) == null ? void 0 : P.width) == "number" ? o.original.width : void 0, l = typeof ((X = o.original) == null ? void 0 : X.left) == "number" ? o.original.left : void 0, u = d != null ? d : i, g = l != null ? l : r, f = (Z = o.corner) != null ? Z : "", m = (st = o.action) != null ? st : "", j = ["ml", "mr"].includes(f) || m === "scaleX", p = ["mt", "mb"].includes(f) || m === "scaleY", M = ["tl", "tr", "bl", "br"].includes(f) || m === "scale";
4048
+ if (!j && !p && !M) return;
4049
+ const w = Math.abs((ot = (nt = n.scaleX) != null ? nt : o.scaleX) != null ? ot : 1) || 1, L = Math.abs((it = (at = n.scaleY) != null ? at : o.scaleY) != null ? it : 1) || 1, k = Math.max(1, u * w), b = Math.max(1, c * L), y = (ct = (rt = o.originX) != null ? rt : n.originX) != null ? ct : "left", S = g + u, v = g + u / 2, I = (dt = n.width) != null ? dt : u, E = Math.abs(k - I) > Ot, N = Math.abs(b - ((lt = n.fontSize) != null ? lt : c)) > Ot;
4050
+ if (!E && !N) {
4040
4051
  n.set({ scaleX: 1, scaleY: 1 }), o.scaleX = 1, o.scaleY = 1;
4041
4052
  return;
4042
4053
  }
4043
4054
  n.set({
4044
- width: T,
4045
- fontSize: M || p ? y : c,
4055
+ width: k,
4056
+ fontSize: M || p ? b : c,
4046
4057
  scaleX: 1,
4047
4058
  scaleY: 1
4048
4059
  });
4049
- const _ = (dt = n.width) != null ? dt : T, Y = Math.abs(_ - v) > Et;
4050
- let B = g;
4051
- Y && (b || M) && (A === "right" ? B = N - _ : A === "center" && (B = I - _ / 2)), n.set({ left: B }), a.baseLeft = B, o.scaleX = 1, o.scaleY = 1;
4060
+ const B = (ht = n.width) != null ? ht : k, U = Math.abs(B - I) > Ot;
4061
+ let W = g;
4062
+ U && (j || M) && (y === "right" ? W = S - B : y === "center" && (W = v - B / 2)), n.set({ left: W }), a.baseLeft = W, o.scaleX = 1, o.scaleY = 1;
4052
4063
  const { original: R } = o;
4053
- R && (R.scaleX = 1, R.scaleY = 1, R.width = _, R.height = n.height, R.left = B), n.setCoords(), this.canvas.requestRenderAll(), a.baseWidth = _, a.baseFontSize = (lt = n.fontSize) != null ? lt : y, a.hasWidthChange = Y || L;
4064
+ R && (R.scaleX = 1, R.scaleY = 1, R.width = B, R.height = n.height, R.left = W), n.setCoords(), this.canvas.requestRenderAll(), a.baseWidth = B, a.baseFontSize = (ut = n.fontSize) != null ? ut : b, a.hasWidthChange = U || N;
4054
4065
  }, this._handleObjectModified = (s) => {
4055
4066
  var r, c, d;
4056
4067
  const { target: n } = s;
4057
- if (!k._isTextbox(n)) return;
4068
+ if (!O._isTextbox(n)) return;
4069
+ n.isScaling = !1;
4058
4070
  const o = this.scalingState.get(n);
4059
4071
  if (this.scalingState.delete(n), !(o != null && o.hasWidthChange)) return;
4060
4072
  const a = (r = n.width) != null ? r : n.calcTextWidth(), i = (d = (c = n.fontSize) != null ? c : o == null ? void 0 : o.baseFontSize) != null ? d : 16;
@@ -4066,8 +4078,8 @@ class k {
4066
4078
  * @param options — настройки текста
4067
4079
  * @param flags — флаги поведения
4068
4080
  */
4069
- addText(S = {}, { withoutSelection: b = !1, withoutSave: p = !1, withoutAdding: M = !1 } = {}) {
4070
- var O = S, {
4081
+ addText(w = {}, { withoutSelection: j = !1, withoutSave: p = !1, withoutAdding: M = !1 } = {}) {
4082
+ var L = w, {
4071
4083
  id: t = `text-${x()}`,
4072
4084
  text: e = "Новый текст",
4073
4085
  fontFamily: s,
@@ -4082,7 +4094,7 @@ class k {
4082
4094
  strokeColor: u,
4083
4095
  strokeWidth: g = 0,
4084
4096
  opacity: f = 1
4085
- } = O, m = X(O, [
4097
+ } = L, m = K(L, [
4086
4098
  "id",
4087
4099
  "text",
4088
4100
  "fontFamily",
@@ -4098,15 +4110,15 @@ class k {
4098
4110
  "strokeWidth",
4099
4111
  "opacity"
4100
4112
  ]);
4101
- var w;
4102
- const { historyManager: T } = this.editor;
4103
- T.suspendHistory();
4104
- const y = s != null ? s : this._getDefaultFontFamily(), A = k._resolveStrokeWidth(g), N = k._resolveStrokeColor(
4113
+ var E;
4114
+ const { historyManager: k } = this.editor;
4115
+ k.suspendHistory();
4116
+ const b = s != null ? s : this._getDefaultFontFamily(), y = O._resolveStrokeWidth(g), S = O._resolveStrokeColor(
4105
4117
  u,
4106
- A
4107
- ), I = new gt(e, E({
4118
+ y
4119
+ ), v = new mt(e, D({
4108
4120
  id: t,
4109
- fontFamily: y,
4121
+ fontFamily: b,
4110
4122
  fontSize: n,
4111
4123
  fontWeight: o ? "bold" : "normal",
4112
4124
  fontStyle: a ? "italic" : "normal",
@@ -4115,20 +4127,20 @@ class k {
4115
4127
  linethrough: c,
4116
4128
  textAlign: d,
4117
4129
  fill: l,
4118
- stroke: N,
4119
- strokeWidth: A,
4130
+ stroke: S,
4131
+ strokeWidth: y,
4120
4132
  strokeUniform: !0,
4121
4133
  opacity: f
4122
4134
  }, m));
4123
- if (I.textCaseRaw = (w = I.text) != null ? w : "", r) {
4124
- const L = k._toUpperCase(I.textCaseRaw);
4125
- L !== I.text && I.set({ text: L });
4135
+ if (v.textCaseRaw = (E = v.text) != null ? E : "", r) {
4136
+ const N = O._toUpperCase(v.textCaseRaw);
4137
+ N !== v.text && v.set({ text: N });
4126
4138
  }
4127
- m.left === void 0 && m.top === void 0 && this.canvas.centerObject(I), M || this.canvas.add(I), b || this.canvas.setActiveObject(I), this.canvas.requestRenderAll(), T.resumeHistory(), p || T.saveState();
4128
- const v = E({
4139
+ m.left === void 0 && m.top === void 0 && this.canvas.centerObject(v), M || this.canvas.add(v), j || this.canvas.setActiveObject(v), this.canvas.requestRenderAll(), k.resumeHistory(), p || k.saveState();
4140
+ const I = D({
4129
4141
  id: t,
4130
4142
  text: e,
4131
- fontFamily: y,
4143
+ fontFamily: b,
4132
4144
  fontSize: n,
4133
4145
  bold: o,
4134
4146
  italic: a,
@@ -4137,19 +4149,19 @@ class k {
4137
4149
  strikethrough: c,
4138
4150
  align: d,
4139
4151
  color: l,
4140
- strokeColor: N,
4141
- strokeWidth: A,
4152
+ strokeColor: S,
4153
+ strokeWidth: y,
4142
4154
  opacity: f
4143
4155
  }, m);
4144
4156
  return this.canvas.fire("editor:text-added", {
4145
- textbox: I,
4146
- options: v,
4157
+ textbox: v,
4158
+ options: I,
4147
4159
  flags: {
4148
- withoutSelection: !!b,
4160
+ withoutSelection: !!j,
4149
4161
  withoutSave: !!p,
4150
4162
  withoutAdding: !!M
4151
4163
  }
4152
- }), I;
4164
+ }), v;
4153
4165
  }
4154
4166
  /**
4155
4167
  * Обновляет текстовый объект.
@@ -4160,35 +4172,35 @@ class k {
4160
4172
  * @param options.skipRender — не вызывать перерисовку канваса
4161
4173
  */
4162
4174
  updateText({ target: t, style: e = {}, withoutSave: s, skipRender: n } = {}) {
4163
- var Y, B, R, Z, G, W, tt, et, st, nt, ot, at, it, rt, ct, dt, lt, zt, Yt, Ht, Zt, Wt, Pt, Vt, Gt, Xt, Kt, $t, Qt, Jt, qt, te, ee, se, ne, oe, ae, ie, re, ce, de, le;
4175
+ var X, Z, st, nt, ot, at, it, rt, ct, dt, lt, ht, ut, Ft, Ht, Wt, Zt, Pt, Vt, Xt, Kt, $t, Qt, Jt, qt, te, ee, se, ne, oe, ae, ie, re, ce, de, le, he, ue, ge, fe, me, pe, Me, ye;
4164
4176
  const o = this._resolveTextObject(t);
4165
4177
  if (!o) return null;
4166
4178
  const { historyManager: a } = this.editor;
4167
4179
  a.suspendHistory();
4168
4180
  const i = {
4169
4181
  id: o.id,
4170
- text: (Y = o.text) != null ? Y : void 0,
4171
- textCaseRaw: (B = o.textCaseRaw) != null ? B : void 0,
4182
+ text: (X = o.text) != null ? X : void 0,
4183
+ textCaseRaw: (Z = o.textCaseRaw) != null ? Z : void 0,
4172
4184
  uppercase: !!o.uppercase,
4173
- fontFamily: (R = o.fontFamily) != null ? R : void 0,
4174
- fontSize: (Z = o.fontSize) != null ? Z : void 0,
4175
- fontWeight: (G = o.fontWeight) != null ? G : void 0,
4176
- fontStyle: (W = o.fontStyle) != null ? W : void 0,
4177
- underline: (tt = o.underline) != null ? tt : void 0,
4178
- linethrough: (et = o.linethrough) != null ? et : void 0,
4185
+ fontFamily: (st = o.fontFamily) != null ? st : void 0,
4186
+ fontSize: (nt = o.fontSize) != null ? nt : void 0,
4187
+ fontWeight: (ot = o.fontWeight) != null ? ot : void 0,
4188
+ fontStyle: (at = o.fontStyle) != null ? at : void 0,
4189
+ underline: (it = o.underline) != null ? it : void 0,
4190
+ linethrough: (rt = o.linethrough) != null ? rt : void 0,
4179
4191
  textAlign: o.textAlign,
4180
- fill: (st = o.fill) != null ? st : void 0,
4181
- stroke: (nt = o.stroke) != null ? nt : void 0,
4182
- strokeWidth: (ot = o.strokeWidth) != null ? ot : void 0,
4183
- opacity: (at = o.opacity) != null ? at : void 0,
4184
- left: (it = o.left) != null ? it : void 0,
4185
- top: (rt = o.top) != null ? rt : void 0,
4186
- width: (ct = o.width) != null ? ct : void 0,
4187
- height: (dt = o.height) != null ? dt : void 0,
4188
- angle: (lt = o.angle) != null ? lt : void 0,
4189
- scaleX: (zt = o.scaleX) != null ? zt : void 0,
4190
- scaleY: (Yt = o.scaleY) != null ? Yt : void 0
4191
- }, Ft = e, {
4192
+ fill: (ct = o.fill) != null ? ct : void 0,
4193
+ stroke: (dt = o.stroke) != null ? dt : void 0,
4194
+ strokeWidth: (lt = o.strokeWidth) != null ? lt : void 0,
4195
+ opacity: (ht = o.opacity) != null ? ht : void 0,
4196
+ left: (ut = o.left) != null ? ut : void 0,
4197
+ top: (Ft = o.top) != null ? Ft : void 0,
4198
+ width: (Ht = o.width) != null ? Ht : void 0,
4199
+ height: (Wt = o.height) != null ? Wt : void 0,
4200
+ angle: (Zt = o.angle) != null ? Zt : void 0,
4201
+ scaleX: (Pt = o.scaleX) != null ? Pt : void 0,
4202
+ scaleY: (Vt = o.scaleY) != null ? Vt : void 0
4203
+ }, Gt = e, {
4192
4204
  text: r,
4193
4205
  fontFamily: c,
4194
4206
  fontSize: d,
@@ -4197,12 +4209,12 @@ class k {
4197
4209
  underline: g,
4198
4210
  uppercase: f,
4199
4211
  strikethrough: m,
4200
- align: b,
4212
+ align: j,
4201
4213
  color: p,
4202
4214
  strokeColor: M,
4203
- strokeWidth: S,
4204
- opacity: O
4205
- } = Ft, T = X(Ft, [
4215
+ strokeWidth: w,
4216
+ opacity: L
4217
+ } = Gt, k = K(Gt, [
4206
4218
  "text",
4207
4219
  "fontFamily",
4208
4220
  "fontSize",
@@ -4216,41 +4228,57 @@ class k {
4216
4228
  "strokeColor",
4217
4229
  "strokeWidth",
4218
4230
  "opacity"
4219
- ]), y = E({}, T);
4220
- if (c !== void 0 && (y.fontFamily = c), d !== void 0 && (y.fontSize = d), l !== void 0 && (y.fontWeight = l ? "bold" : "normal"), u !== void 0 && (y.fontStyle = u ? "italic" : "normal"), g !== void 0 && (y.underline = g), m !== void 0 && (y.linethrough = m), b !== void 0 && (y.textAlign = b), p !== void 0 && (y.fill = p), M !== void 0 || S !== void 0) {
4221
- const wt = (Ht = S != null ? S : o.strokeWidth) != null ? Ht : 0, he = k._resolveStrokeWidth(wt), Ee = (Zt = M != null ? M : o.stroke) != null ? Zt : void 0;
4222
- y.stroke = k._resolveStrokeColor(Ee, he), y.strokeWidth = he;
4231
+ ]), b = D({}, k), y = O._getSelectionRange(o), S = {}, v = {};
4232
+ if (c !== void 0 && (y ? S.fontFamily = c : (b.fontFamily = c, v.fontFamily = c)), d !== void 0 && (y ? S.fontSize = d : (b.fontSize = d, v.fontSize = d)), l !== void 0) {
4233
+ const _ = l ? "bold" : "normal";
4234
+ y ? S.fontWeight = _ : (b.fontWeight = _, v.fontWeight = _);
4235
+ }
4236
+ if (u !== void 0) {
4237
+ const _ = u ? "italic" : "normal";
4238
+ y ? S.fontStyle = _ : (b.fontStyle = _, v.fontStyle = _);
4223
4239
  }
4224
- O !== void 0 && (y.opacity = O);
4225
- const A = (Pt = o.textCaseRaw) != null ? Pt : (Wt = o.text) != null ? Wt : "", N = !!o.uppercase, I = r !== void 0, v = I ? r != null ? r : "" : A, w = f != null ? f : N;
4226
- if (I || w !== N) {
4227
- const wt = w ? k._toUpperCase(v) : v;
4228
- y.text = wt, o.textCaseRaw = v;
4229
- } else o.textCaseRaw === void 0 && (o.textCaseRaw = A);
4230
- o.uppercase = w, o.set(y), o.setCoords(), n || this.canvas.requestRenderAll(), a.resumeHistory(), s || a.saveState();
4231
- const _ = {
4240
+ if (g !== void 0 && (y ? S.underline = g : (b.underline = g, v.underline = g)), m !== void 0 && (y ? S.linethrough = m : (b.linethrough = m, v.linethrough = m)), j !== void 0 && (b.textAlign = j), p !== void 0 && (y ? S.fill = p : (b.fill = p, v.fill = p)), M !== void 0 || w !== void 0) {
4241
+ const _ = y ? O._getSelectionStyleValue(o, y, "strokeWidth") : void 0, xe = y ? O._getSelectionStyleValue(o, y, "stroke") : void 0, _e = (Kt = (Xt = w != null ? w : _) != null ? Xt : o.strokeWidth) != null ? Kt : 0, yt = O._resolveStrokeWidth(_e), Be = (Qt = ($t = M != null ? M : xe) != null ? $t : o.stroke) != null ? Qt : void 0, Dt = O._resolveStrokeColor(Be, yt);
4242
+ y ? (S.stroke = Dt, S.strokeWidth = yt) : (b.stroke = Dt, b.strokeWidth = yt, v.stroke = Dt, v.strokeWidth = yt);
4243
+ }
4244
+ L !== void 0 && (b.opacity = L);
4245
+ const I = (qt = o.textCaseRaw) != null ? qt : (Jt = o.text) != null ? Jt : "", E = !!o.uppercase, N = r !== void 0, B = N ? r != null ? r : "" : I, U = f != null ? f : E;
4246
+ if (N || U !== E) {
4247
+ const _ = U ? O._toUpperCase(B) : B;
4248
+ b.text = _, o.textCaseRaw = B;
4249
+ } else o.textCaseRaw === void 0 && (o.textCaseRaw = I);
4250
+ o.uppercase = U, o.set(b);
4251
+ let R = !1;
4252
+ if (y)
4253
+ R = O._applyStylesToRange(o, S, y);
4254
+ else if (Object.keys(v).length) {
4255
+ const _ = O._getFullTextRange(o);
4256
+ _ && (R = O._applyStylesToRange(o, v, _));
4257
+ }
4258
+ R && (o.dirty = !0), o.setCoords(), n || this.canvas.requestRenderAll(), a.resumeHistory(), s || a.saveState();
4259
+ const P = {
4232
4260
  id: o.id,
4233
- text: (Vt = o.text) != null ? Vt : void 0,
4234
- textCaseRaw: (Gt = o.textCaseRaw) != null ? Gt : void 0,
4261
+ text: (te = o.text) != null ? te : void 0,
4262
+ textCaseRaw: (ee = o.textCaseRaw) != null ? ee : void 0,
4235
4263
  uppercase: !!o.uppercase,
4236
- fontFamily: (Xt = o.fontFamily) != null ? Xt : void 0,
4237
- fontSize: (Kt = o.fontSize) != null ? Kt : void 0,
4238
- fontWeight: ($t = o.fontWeight) != null ? $t : void 0,
4239
- fontStyle: (Qt = o.fontStyle) != null ? Qt : void 0,
4240
- underline: (Jt = o.underline) != null ? Jt : void 0,
4241
- linethrough: (qt = o.linethrough) != null ? qt : void 0,
4264
+ fontFamily: (se = o.fontFamily) != null ? se : void 0,
4265
+ fontSize: (ne = o.fontSize) != null ? ne : void 0,
4266
+ fontWeight: (oe = o.fontWeight) != null ? oe : void 0,
4267
+ fontStyle: (ae = o.fontStyle) != null ? ae : void 0,
4268
+ underline: (ie = o.underline) != null ? ie : void 0,
4269
+ linethrough: (re = o.linethrough) != null ? re : void 0,
4242
4270
  textAlign: o.textAlign,
4243
- fill: (te = o.fill) != null ? te : void 0,
4244
- stroke: (ee = o.stroke) != null ? ee : void 0,
4245
- strokeWidth: (se = o.strokeWidth) != null ? se : void 0,
4246
- opacity: (ne = o.opacity) != null ? ne : void 0,
4247
- left: (oe = o.left) != null ? oe : void 0,
4248
- top: (ae = o.top) != null ? ae : void 0,
4249
- width: (ie = o.width) != null ? ie : void 0,
4250
- height: (re = o.height) != null ? re : void 0,
4251
- angle: (ce = o.angle) != null ? ce : void 0,
4252
- scaleX: (de = o.scaleX) != null ? de : void 0,
4253
- scaleY: (le = o.scaleY) != null ? le : void 0
4271
+ fill: (ce = o.fill) != null ? ce : void 0,
4272
+ stroke: (de = o.stroke) != null ? de : void 0,
4273
+ strokeWidth: (le = o.strokeWidth) != null ? le : void 0,
4274
+ opacity: (he = o.opacity) != null ? he : void 0,
4275
+ left: (ue = o.left) != null ? ue : void 0,
4276
+ top: (ge = o.top) != null ? ge : void 0,
4277
+ width: (fe = o.width) != null ? fe : void 0,
4278
+ height: (me = o.height) != null ? me : void 0,
4279
+ angle: (pe = o.angle) != null ? pe : void 0,
4280
+ scaleX: (Me = o.scaleX) != null ? Me : void 0,
4281
+ scaleY: (ye = o.scaleY) != null ? ye : void 0
4254
4282
  };
4255
4283
  return this.canvas.fire("editor:text-updated", {
4256
4284
  textbox: o,
@@ -4260,9 +4288,11 @@ class k {
4260
4288
  withoutSave: !!s,
4261
4289
  skipRender: !!n
4262
4290
  },
4263
- updates: y,
4291
+ updates: b,
4264
4292
  before: i,
4265
- after: _
4293
+ after: P,
4294
+ selectionRange: y != null ? y : void 0,
4295
+ selectionStyles: y && Object.keys(S).length ? S : void 0
4266
4296
  }), o;
4267
4297
  }
4268
4298
  /**
@@ -4275,19 +4305,19 @@ class k {
4275
4305
  * Возвращает активный текст или ищет по id.
4276
4306
  */
4277
4307
  _resolveTextObject(t) {
4278
- if (t instanceof gt) return t;
4308
+ if (t instanceof mt) return t;
4279
4309
  if (!t) {
4280
4310
  const e = this.canvas.getActiveObject();
4281
- return k._isTextbox(e) ? e : null;
4311
+ return O._isTextbox(e) ? e : null;
4282
4312
  }
4283
4313
  if (typeof t == "string") {
4284
- const e = this.canvas.getObjects().find((s) => k._isTextbox(s) && s.id === t);
4314
+ const e = this.canvas.getObjects().find((s) => O._isTextbox(s) && s.id === t);
4285
4315
  return e != null ? e : null;
4286
4316
  }
4287
4317
  return null;
4288
4318
  }
4289
4319
  static _isTextbox(t) {
4290
- return !!t && t instanceof gt;
4320
+ return !!t && t instanceof mt;
4291
4321
  }
4292
4322
  _bindEvents() {
4293
4323
  this.canvas.on("object:scaling", this._handleObjectScaling), this.canvas.on("object:modified", this._handleObjectModified), this.canvas.on("text:editing:entered", this._handleTextEditingEntered), this.canvas.on("text:editing:exited", this._handleTextEditingExited), this.canvas.on("text:changed", this._handleTextChanged);
@@ -4306,6 +4336,36 @@ class k {
4306
4336
  }
4307
4337
  return e;
4308
4338
  }
4339
+ static _getSelectionRange(t) {
4340
+ var n, o;
4341
+ if (!t.isEditing) return null;
4342
+ const e = (n = t.selectionStart) != null ? n : 0, s = (o = t.selectionEnd) != null ? o : e;
4343
+ return e === s ? null : {
4344
+ start: Math.min(e, s),
4345
+ end: Math.max(e, s)
4346
+ };
4347
+ }
4348
+ static _getFullTextRange(t) {
4349
+ var s, n;
4350
+ const e = (n = (s = t.text) == null ? void 0 : s.length) != null ? n : 0;
4351
+ return e <= 0 ? null : { start: 0, end: e };
4352
+ }
4353
+ static _applyStylesToRange(t, e, s) {
4354
+ if (!e || !Object.keys(e).length) return !1;
4355
+ const { start: n, end: o } = s;
4356
+ return o <= n ? !1 : (t.setSelectionStyles(e, n, o), !0);
4357
+ }
4358
+ static _getSelectionStyleValue(t, e, s) {
4359
+ var o;
4360
+ if (!e) return;
4361
+ const n = t.getSelectionStyles(
4362
+ e.start,
4363
+ e.end,
4364
+ !0
4365
+ );
4366
+ if (n.length)
4367
+ return (o = n[0]) == null ? void 0 : o[s];
4368
+ }
4309
4369
  static _resolveStrokeColor(t, e) {
4310
4370
  if (!(e <= 0))
4311
4371
  return t != null ? t : "#000000";
@@ -4321,7 +4381,7 @@ class k {
4321
4381
  return (e = (t = this.fonts[0]) == null ? void 0 : t.family) != null ? e : "Arial";
4322
4382
  }
4323
4383
  }
4324
- class Ut {
4384
+ class Yt {
4325
4385
  /**
4326
4386
  * Конструктор класса ImageEditor.
4327
4387
  * @param canvasId - идентификатор канваса, в котором будет создан редактор
@@ -4351,7 +4411,7 @@ class Ut {
4351
4411
  showRotationAngle: d,
4352
4412
  _onReadyCallback: l
4353
4413
  } = this.options;
4354
- if (jt.apply(), this.canvas = new _e(this.containerId, this.options), this.moduleLoader = new Ye(), this.workerManager = new He(), this.errorManager = new St({ editor: this }), this.historyManager = new It({ editor: this }), this.toolbar = new os({ editor: this }), this.transformManager = new ms({ editor: this }), this.zoomManager = new ps({ editor: this }), this.canvasManager = new fs({ editor: this }), this.imageManager = new H({ editor: this }), this.layerManager = new At({ editor: this }), this.shapeManager = new ys({ editor: this }), this.interactionBlocker = new Ms({ editor: this }), this.backgroundManager = new Q({ editor: this }), this.clipboardManager = new bs({ editor: this }), this.objectLockManager = new Ct({ editor: this }), this.groupingManager = new vs({ editor: this }), this.selectionManager = new js({ editor: this }), this.deletionManager = new Rt({ editor: this }), this.panConstraintManager = new As({ editor: this }), this.fontManager = new Lt((u = this.options.fonts) != null ? u : []), this.textManager = new k({ editor: this }), d && (this.angleIndicator = new Bt({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new ft({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(t), this.canvasManager.setEditorContainerHeight(e), this.canvasManager.setCanvasWrapperWidth(s), this.canvasManager.setCanvasWrapperHeight(n), this.canvasManager.setCanvasCSSWidth(o), this.canvasManager.setCanvasCSSHeight(a), this.canvasManager.updateCanvas(), this.zoomManager.calculateAndApplyDefaultZoom(), yield this.fontManager.loadFonts(), i != null && i.source) {
4414
+ if (J.apply(), this.canvas = new Ze(this.containerId, this.options), this.moduleLoader = new Ke(), this.workerManager = new Qe(), this.errorManager = new Et({ editor: this }), this.historyManager = new St({ editor: this }), this.toolbar = new gs({ editor: this }), this.transformManager = new Ss({ editor: this }), this.zoomManager = new Cs({ editor: this }), this.canvasManager = new As({ editor: this }), this.imageManager = new H({ editor: this }), this.layerManager = new Ct({ editor: this }), this.shapeManager = new Es({ editor: this }), this.interactionBlocker = new ws({ editor: this }), this.backgroundManager = new q({ editor: this }), this.clipboardManager = new Ds({ editor: this }), this.objectLockManager = new wt({ editor: this }), this.groupingManager = new Os({ editor: this }), this.selectionManager = new Ts({ editor: this }), this.deletionManager = new zt({ editor: this }), this.panConstraintManager = new Ls({ editor: this }), this.fontManager = new xt((u = this.options.fonts) != null ? u : []), this.textManager = new O({ editor: this }), d && (this.angleIndicator = new Ut({ editor: this })), this._createMontageArea(), this._createClippingArea(), this.listeners = new pt({ editor: this, options: this.options }), this.canvasManager.setEditorContainerWidth(t), this.canvasManager.setEditorContainerHeight(e), this.canvasManager.setCanvasWrapperWidth(s), this.canvasManager.setCanvasWrapperHeight(n), this.canvasManager.setCanvasCSSWidth(o), this.canvasManager.setCanvasCSSHeight(a), this.canvasManager.updateCanvas(), this.zoomManager.calculateAndApplyDefaultZoom(), yield this.fontManager.loadFonts(), i != null && i.source) {
4355
4415
  const {
4356
4416
  source: g,
4357
4417
  scale: f = `image-${c}`,
@@ -4373,7 +4433,7 @@ class Ut {
4373
4433
  this.montageArea = this.shapeManager.addRectangle({
4374
4434
  width: t,
4375
4435
  height: e,
4376
- fill: Ut._createMosaicPattern(),
4436
+ fill: Yt._createMosaicPattern(),
4377
4437
  stroke: null,
4378
4438
  strokeWidth: 0,
4379
4439
  selectable: !1,
@@ -4424,13 +4484,13 @@ class Ut {
4424
4484
  const t = document.createElement("canvas");
4425
4485
  t.width = 20, t.height = 20;
4426
4486
  const e = t.getContext("2d");
4427
- return e.fillStyle = "#ddd", e.fillRect(0, 0, 40, 40), e.fillStyle = "#ccc", e.fillRect(0, 0, 10, 10), e.fillRect(10, 10, 10, 10), new Be({
4487
+ return e.fillStyle = "#ddd", e.fillRect(0, 0, 40, 40), e.fillStyle = "#ccc", e.fillRect(0, 0, 10, 10), e.fillRect(10, 10, 10, 10), new Pe({
4428
4488
  source: t,
4429
4489
  repeat: "repeat"
4430
4490
  });
4431
4491
  }
4432
4492
  }
4433
- const U = [
4493
+ const z = [
4434
4494
  "U+0000-00FF",
4435
4495
  "U+0131",
4436
4496
  "U+0152-0153",
@@ -4450,13 +4510,13 @@ const U = [
4450
4510
  "U+2215",
4451
4511
  "U+FEFF",
4452
4512
  "U+FFFD"
4453
- ].join(", "), z = [
4513
+ ].join(", "), Y = [
4454
4514
  "U+0301",
4455
4515
  "U+0400-045F",
4456
4516
  "U+0490-0491",
4457
4517
  "U+04B0-04B1",
4458
4518
  "U+2116"
4459
- ].join(", "), Cs = [
4519
+ ].join(", "), ks = [
4460
4520
  {
4461
4521
  family: "Arial",
4462
4522
  source: 'local("Arial"), local("Liberation Sans"), local("DejaVu Sans")',
@@ -4473,7 +4533,7 @@ const U = [
4473
4533
  style: "normal",
4474
4534
  weight: "400",
4475
4535
  display: "swap",
4476
- unicodeRange: z
4536
+ unicodeRange: Y
4477
4537
  }
4478
4538
  },
4479
4539
  {
@@ -4483,7 +4543,7 @@ const U = [
4483
4543
  style: "normal",
4484
4544
  weight: "400",
4485
4545
  display: "swap",
4486
- unicodeRange: U
4546
+ unicodeRange: z
4487
4547
  }
4488
4548
  },
4489
4549
  {
@@ -4493,7 +4553,7 @@ const U = [
4493
4553
  style: "normal",
4494
4554
  weight: "700",
4495
4555
  display: "swap",
4496
- unicodeRange: z
4556
+ unicodeRange: Y
4497
4557
  }
4498
4558
  },
4499
4559
  {
@@ -4503,7 +4563,7 @@ const U = [
4503
4563
  style: "normal",
4504
4564
  weight: "700",
4505
4565
  display: "swap",
4506
- unicodeRange: U
4566
+ unicodeRange: z
4507
4567
  }
4508
4568
  },
4509
4569
  {
@@ -4513,7 +4573,7 @@ const U = [
4513
4573
  style: "normal",
4514
4574
  weight: "200 700",
4515
4575
  display: "swap",
4516
- unicodeRange: z
4576
+ unicodeRange: Y
4517
4577
  }
4518
4578
  },
4519
4579
  {
@@ -4523,7 +4583,7 @@ const U = [
4523
4583
  style: "normal",
4524
4584
  weight: "200 700",
4525
4585
  display: "swap",
4526
- unicodeRange: U
4586
+ unicodeRange: z
4527
4587
  }
4528
4588
  },
4529
4589
  {
@@ -4533,7 +4593,7 @@ const U = [
4533
4593
  style: "normal",
4534
4594
  weight: "300 900",
4535
4595
  display: "swap",
4536
- unicodeRange: z
4596
+ unicodeRange: Y
4537
4597
  }
4538
4598
  },
4539
4599
  {
@@ -4543,7 +4603,7 @@ const U = [
4543
4603
  style: "normal",
4544
4604
  weight: "300 900",
4545
4605
  display: "swap",
4546
- unicodeRange: U
4606
+ unicodeRange: z
4547
4607
  }
4548
4608
  },
4549
4609
  {
@@ -4553,7 +4613,7 @@ const U = [
4553
4613
  style: "normal",
4554
4614
  weight: "400 700",
4555
4615
  display: "swap",
4556
- unicodeRange: z
4616
+ unicodeRange: Y
4557
4617
  }
4558
4618
  },
4559
4619
  {
@@ -4563,7 +4623,7 @@ const U = [
4563
4623
  style: "normal",
4564
4624
  weight: "400 700",
4565
4625
  display: "swap",
4566
- unicodeRange: U
4626
+ unicodeRange: z
4567
4627
  }
4568
4628
  },
4569
4629
  {
@@ -4573,7 +4633,7 @@ const U = [
4573
4633
  style: "normal",
4574
4634
  weight: "300 700",
4575
4635
  display: "swap",
4576
- unicodeRange: z
4636
+ unicodeRange: Y
4577
4637
  }
4578
4638
  },
4579
4639
  {
@@ -4583,7 +4643,7 @@ const U = [
4583
4643
  style: "normal",
4584
4644
  weight: "300 700",
4585
4645
  display: "swap",
4586
- unicodeRange: U
4646
+ unicodeRange: z
4587
4647
  }
4588
4648
  },
4589
4649
  {
@@ -4593,7 +4653,7 @@ const U = [
4593
4653
  style: "normal",
4594
4654
  weight: "300 700",
4595
4655
  display: "swap",
4596
- unicodeRange: z
4656
+ unicodeRange: Y
4597
4657
  }
4598
4658
  },
4599
4659
  {
@@ -4603,7 +4663,7 @@ const U = [
4603
4663
  style: "normal",
4604
4664
  weight: "300 700",
4605
4665
  display: "swap",
4606
- unicodeRange: U
4666
+ unicodeRange: z
4607
4667
  }
4608
4668
  },
4609
4669
  {
@@ -4613,7 +4673,7 @@ const U = [
4613
4673
  style: "normal",
4614
4674
  weight: "400",
4615
4675
  display: "swap",
4616
- unicodeRange: z
4676
+ unicodeRange: Y
4617
4677
  }
4618
4678
  },
4619
4679
  {
@@ -4623,7 +4683,7 @@ const U = [
4623
4683
  style: "normal",
4624
4684
  weight: "400",
4625
4685
  display: "swap",
4626
- unicodeRange: U
4686
+ unicodeRange: z
4627
4687
  }
4628
4688
  },
4629
4689
  {
@@ -4633,7 +4693,7 @@ const U = [
4633
4693
  style: "normal",
4634
4694
  weight: "400 700",
4635
4695
  display: "swap",
4636
- unicodeRange: z
4696
+ unicodeRange: Y
4637
4697
  }
4638
4698
  },
4639
4699
  {
@@ -4643,7 +4703,7 @@ const U = [
4643
4703
  style: "normal",
4644
4704
  weight: "400 700",
4645
4705
  display: "swap",
4646
- unicodeRange: U
4706
+ unicodeRange: z
4647
4707
  }
4648
4708
  },
4649
4709
  {
@@ -4653,7 +4713,7 @@ const U = [
4653
4713
  style: "normal",
4654
4714
  weight: "100 900",
4655
4715
  display: "swap",
4656
- unicodeRange: z
4716
+ unicodeRange: Y
4657
4717
  }
4658
4718
  },
4659
4719
  {
@@ -4663,10 +4723,10 @@ const U = [
4663
4723
  style: "normal",
4664
4724
  weight: "100 900",
4665
4725
  display: "swap",
4666
- unicodeRange: U
4726
+ unicodeRange: z
4667
4727
  }
4668
4728
  }
4669
- ], Ss = {
4729
+ ], xs = {
4670
4730
  /**
4671
4731
  * Опции редактора
4672
4732
  */
@@ -4758,20 +4818,20 @@ const U = [
4758
4818
  /**
4759
4819
  * Список шрифтов, которые будут доступны в редакторе по умолчанию.
4760
4820
  */
4761
- fonts: Cs
4821
+ fonts: ks
4762
4822
  };
4763
- function Ts(h, t = {}) {
4764
- const e = E(E({}, Ss), t), s = document.getElementById(h);
4823
+ function zs(h, t = {}) {
4824
+ const e = D(D({}, xs), t), s = document.getElementById(h);
4765
4825
  if (!s)
4766
4826
  return Promise.reject(new Error(`Контейнер с ID "${h}" не найден.`));
4767
4827
  const n = document.createElement("canvas");
4768
4828
  return n.id = `${h}-canvas`, s.appendChild(n), e.editorContainer = s, new Promise((o) => {
4769
4829
  e._onReadyCallback = o;
4770
- const a = new Ut(n.id, e);
4830
+ const a = new Yt(n.id, e);
4771
4831
  window[h] = a;
4772
4832
  });
4773
4833
  }
4774
4834
  export {
4775
- Ts as default
4835
+ zs as default
4776
4836
  };
4777
4837
  //# sourceMappingURL=main.js.map