microboard-temp 0.4.57 → 0.4.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -635,8 +635,8 @@ class BoardCommand {
635
635
  switch (operation.method) {
636
636
  case "bringToFront": {
637
637
  for (const id in operation.prevZIndex) {
638
- const item = this.board.items.getById(id);
639
- if (!item) {
638
+ const item2 = this.board.items.getById(id);
639
+ if (!item2) {
640
640
  delete operation.prevZIndex.id;
641
641
  }
642
642
  }
@@ -648,8 +648,8 @@ class BoardCommand {
648
648
  }
649
649
  case "sendToBack": {
650
650
  for (const id in operation.prevZIndex) {
651
- const item = this.board.items.getById(id);
652
- if (!item) {
651
+ const item2 = this.board.items.getById(id);
652
+ if (!item2) {
653
653
  delete operation.prevZIndex.id;
654
654
  }
655
655
  }
@@ -663,11 +663,11 @@ class BoardCommand {
663
663
  case "moveSecondBeforeFirst":
664
664
  case "moveToZIndex": {
665
665
  const items = this.board.items;
666
- const item = items.getById(operation.item);
667
- if (!item) {
666
+ const item2 = items.getById(operation.item);
667
+ if (!item2) {
668
668
  throw new Error("Get reverse board operation. Item not found");
669
669
  }
670
- const zIndex = this.board.getZIndex(item);
670
+ const zIndex = this.board.getZIndex(item2);
671
671
  return {
672
672
  class: "Board",
673
673
  method: "moveToZIndex",
@@ -677,8 +677,8 @@ class BoardCommand {
677
677
  }
678
678
  case "moveManyToZIndex": {
679
679
  for (const id in operation.item) {
680
- const item = this.board.items.getById(id);
681
- if (!item) {
680
+ const item2 = this.board.items.getById(id);
681
+ if (!item2) {
682
682
  delete operation.item.id;
683
683
  }
684
684
  }
@@ -695,15 +695,15 @@ class BoardCommand {
695
695
  const items = this.board.items;
696
696
  const reverse = [];
697
697
  for (const itemId of operation.item) {
698
- const item = items.getById(itemId);
699
- if (!item) {
698
+ const item2 = items.getById(itemId);
699
+ if (!item2) {
700
700
  throw new Error("Get reverse board operation. Item not found");
701
701
  }
702
702
  reverse.push({
703
703
  class: "Board",
704
704
  method: "add",
705
705
  item: itemId,
706
- data: item.serialize()
706
+ data: item2.serialize()
707
707
  });
708
708
  }
709
709
  return reverse;
@@ -726,32 +726,32 @@ class BoardCommand {
726
726
  const items = this.board.items;
727
727
  const reverse = [];
728
728
  for (const itemId of operation.item) {
729
- const item = items.getById(itemId);
730
- if (!item || item.itemType !== "Group") {
729
+ const item2 = items.getById(itemId);
730
+ if (!item2 || item2.itemType !== "Group") {
731
731
  throw new Error("Get reverse board operation. Item not found");
732
732
  }
733
733
  reverse.push({
734
734
  class: "Board",
735
735
  method: "addLockedGroup",
736
736
  item: itemId,
737
- data: item.serialize()
737
+ data: item2.serialize()
738
738
  });
739
739
  }
740
740
  return reverse;
741
741
  }
742
742
  case "duplicate":
743
743
  case "paste": {
744
- const item = [];
744
+ const item2 = [];
745
745
  const map = operation.itemsMap;
746
746
  for (const key in map) {
747
747
  if (map.hasOwnProperty(key)) {
748
- item.push(key);
748
+ item2.push(key);
749
749
  }
750
750
  }
751
751
  return {
752
752
  class: "Board",
753
753
  method: "remove",
754
- item
754
+ item: item2
755
755
  };
756
756
  }
757
757
  }
@@ -7069,11 +7069,11 @@ class SubjectOperation {
7069
7069
  }
7070
7070
 
7071
7071
  // src/Items/ItemsCommandUtils.ts
7072
- function mapItemsByOperation(item, getCallback) {
7073
- const items = Array.isArray(item) ? item : [item];
7074
- return items.map((item2) => {
7075
- const operation = getCallback(item2);
7076
- return { item: item2, operation };
7072
+ function mapItemsByOperation(item2, getCallback) {
7073
+ const items = Array.isArray(item2) ? item2 : [item2];
7074
+ return items.map((item3) => {
7075
+ const operation = getCallback(item3);
7076
+ return { item: item3, operation };
7077
7077
  });
7078
7078
  }
7079
7079
 
@@ -7098,8 +7098,8 @@ class TransformationCommand {
7098
7098
  }
7099
7099
  }
7100
7100
  revert() {
7101
- this.reverse.forEach(({ item, operation }) => {
7102
- item.apply(operation);
7101
+ this.reverse.forEach(({ item: item2, operation }) => {
7102
+ item2.apply(operation);
7103
7103
  });
7104
7104
  }
7105
7105
  getReverse() {
@@ -7841,8 +7841,8 @@ class Path {
7841
7841
  }
7842
7842
  getIntersectionPoints(segment) {
7843
7843
  let intersections = [];
7844
- for (const item of this.segments) {
7845
- intersections = intersections.concat(item.getIntersectionPoints(segment));
7844
+ for (const item2 of this.segments) {
7845
+ intersections = intersections.concat(item2.getIntersectionPoints(segment));
7846
7846
  }
7847
7847
  return intersections;
7848
7848
  }
@@ -7907,8 +7907,8 @@ class Path {
7907
7907
  }
7908
7908
  isOpenEnclosedOrCrossedBy(rectangle) {
7909
7909
  let is = false;
7910
- for (const item of this.segments) {
7911
- is = is || item.isEnclosedOrCrossedBy(rectangle);
7910
+ for (const item2 of this.segments) {
7911
+ is = is || item2.isEnclosedOrCrossedBy(rectangle);
7912
7912
  }
7913
7913
  return is;
7914
7914
  }
@@ -8321,8 +8321,8 @@ class ConnectorCommand {
8321
8321
  }
8322
8322
  }
8323
8323
  revert() {
8324
- for (const { item, operation } of this.reverse) {
8325
- item.apply(operation);
8324
+ for (const { item: item2, operation } of this.reverse) {
8325
+ item2.apply(operation);
8326
8326
  }
8327
8327
  }
8328
8328
  getReverse() {
@@ -8479,11 +8479,11 @@ class SessionStorage {
8479
8479
  }
8480
8480
  get(key) {
8481
8481
  const boardId = this.getBoardId() || "";
8482
- const item = _sessionStorage.getItem(boardId + "_" + key);
8483
- if (!item) {
8482
+ const item2 = _sessionStorage.getItem(boardId + "_" + key);
8483
+ if (!item2) {
8484
8484
  return;
8485
8485
  }
8486
- return JSON.parse(item);
8486
+ return JSON.parse(item2);
8487
8487
  }
8488
8488
  remove(key) {
8489
8489
  const boardId = this.getBoardId() || "";
@@ -9268,8 +9268,8 @@ class LinkToCommand {
9268
9268
  }
9269
9269
  }
9270
9270
  revert() {
9271
- this.reverse.forEach(({ item, operation }) => {
9272
- item.apply(operation);
9271
+ this.reverse.forEach(({ item: item2, operation }) => {
9272
+ item2.apply(operation);
9273
9273
  });
9274
9274
  }
9275
9275
  getReverse() {
@@ -10570,9 +10570,9 @@ function handleSplitListItem(editor) {
10570
10570
  Transforms3.insertNodes(editor, {
10571
10571
  type: listType,
10572
10572
  listLevel: listNode.listLevel || 0,
10573
- children: itemsAfter.map((item) => ({
10573
+ children: itemsAfter.map((item2) => ({
10574
10574
  type: "list_item",
10575
- children: item.children
10575
+ children: item2.children
10576
10576
  }))
10577
10577
  }, { at: newListPath });
10578
10578
  }
@@ -12549,10 +12549,10 @@ function initializeDocument(effects) {
12549
12549
  return start;
12550
12550
  function start(code) {
12551
12551
  if (continued < stack.length) {
12552
- const item = stack[continued];
12553
- self2.containerState = item[1];
12554
- ok(item[0].continuation, "expected `continuation` to be defined on container construct");
12555
- return effects.attempt(item[0].continuation, documentContinue, checkNewContainers)(code);
12552
+ const item2 = stack[continued];
12553
+ self2.containerState = item2[1];
12554
+ ok(item2[0].continuation, "expected `continuation` to be defined on container construct");
12555
+ return effects.attempt(item2[0].continuation, documentContinue, checkNewContainers)(code);
12556
12556
  }
12557
12557
  return checkNewContainers(code);
12558
12558
  }
@@ -13528,17 +13528,17 @@ class SpliceBuffer {
13528
13528
  this.setCursor(Number.POSITIVE_INFINITY);
13529
13529
  return this.left.pop();
13530
13530
  }
13531
- push(item) {
13531
+ push(item2) {
13532
13532
  this.setCursor(Number.POSITIVE_INFINITY);
13533
- this.left.push(item);
13533
+ this.left.push(item2);
13534
13534
  }
13535
13535
  pushMany(items) {
13536
13536
  this.setCursor(Number.POSITIVE_INFINITY);
13537
13537
  chunkedPush(this.left, items);
13538
13538
  }
13539
- unshift(item) {
13539
+ unshift(item2) {
13540
13540
  this.setCursor(0);
13541
- this.right.push(item);
13541
+ this.right.push(item2);
13542
13542
  }
13543
13543
  unshiftMany(items) {
13544
13544
  this.setCursor(0);
@@ -15569,8 +15569,8 @@ function initializeFactory(field) {
15569
15569
  if (list2) {
15570
15570
  ok(Array.isArray(list2), "expected `disable.null` to be populated");
15571
15571
  while (++index2 < list2.length) {
15572
- const item = list2[index2];
15573
- if (!item.previous || item.previous.call(self2, self2.previous)) {
15572
+ const item2 = list2[index2];
15573
+ if (!item2.previous || item2.previous.call(self2, self2.previous)) {
15574
15574
  return true;
15575
15575
  }
15576
15576
  }
@@ -16401,14 +16401,14 @@ function compiler(options) {
16401
16401
  length++;
16402
16402
  }
16403
16403
  if (event[1].type === types.listItemPrefix) {
16404
- const item = {
16404
+ const item2 = {
16405
16405
  type: "listItem",
16406
16406
  _spread: false,
16407
16407
  start: Object.assign({}, event[1].start),
16408
16408
  end: undefined
16409
16409
  };
16410
- listItem2 = item;
16411
- events.splice(index2, 0, ["enter", item, event[2]]);
16410
+ listItem2 = item2;
16411
+ events.splice(index2, 0, ["enter", item2, event[2]]);
16412
16412
  index2++;
16413
16413
  length++;
16414
16414
  firstBlankLineIndex = undefined;
@@ -17206,14 +17206,14 @@ class MarkdownProcessor {
17206
17206
  if (err || !file) {
17207
17207
  throw err;
17208
17208
  }
17209
- const nodes = file.result.map((item) => {
17209
+ const nodes = file.result.map((item2) => {
17210
17210
  setNodeStyles({
17211
- node: item,
17211
+ node: item2,
17212
17212
  editor: this.editor,
17213
17213
  horisontalAlignment: "left",
17214
- isPaddingTopNeeded: item.type !== "code_block"
17214
+ isPaddingTopNeeded: item2.type !== "code_block"
17215
17215
  });
17216
- return item;
17216
+ return item2;
17217
17217
  });
17218
17218
  if (isNewParagraphNeeded) {
17219
17219
  nodes.push(createParagraphNode("", this.editor));
@@ -18191,8 +18191,8 @@ class ShapeCommand {
18191
18191
  }
18192
18192
  }
18193
18193
  revert() {
18194
- for (const { item, operation } of this.reverse) {
18195
- item.apply(operation);
18194
+ for (const { item: item2, operation } of this.reverse) {
18195
+ item2.apply(operation);
18196
18196
  }
18197
18197
  }
18198
18198
  getReverse() {
@@ -18274,8 +18274,8 @@ class RichTextCommand {
18274
18274
  }
18275
18275
  }
18276
18276
  revert() {
18277
- for (const { item, operation } of this.reverse) {
18278
- const richText = this.board.items.getById(item);
18277
+ for (const { item: item2, operation } of this.reverse) {
18278
+ const richText = this.board.items.getById(item2);
18279
18279
  if (!richText) {
18280
18280
  continue;
18281
18281
  }
@@ -18294,12 +18294,12 @@ class RichTextCommand {
18294
18294
  case "setSelectionFontColor":
18295
18295
  case "setSelectionBlockType":
18296
18296
  const inverseOps = this.operation.ops.map((op) => Operation3.inverse(op)).reverse();
18297
- return items.map((item) => {
18297
+ return items.map((item2) => {
18298
18298
  const operation = {
18299
18299
  ...this.operation,
18300
18300
  ops: inverseOps
18301
18301
  };
18302
- return { item, operation };
18302
+ return { item: item2, operation };
18303
18303
  });
18304
18304
  case "setFontColor":
18305
18305
  return items.map((id) => ({
@@ -18391,13 +18391,13 @@ class RichTextGroupCommand {
18391
18391
  this.reverseOps = this.getReverse();
18392
18392
  }
18393
18393
  apply() {
18394
- for (const { item, operation } of this.forwardOps) {
18395
- item.applyCommand(operation);
18394
+ for (const { item: item2, operation } of this.forwardOps) {
18395
+ item2.applyCommand(operation);
18396
18396
  }
18397
18397
  }
18398
18398
  revert() {
18399
- for (const { item, operation } of this.reverseOps) {
18400
- item.applyCommand(operation);
18399
+ for (const { item: item2, operation } of this.reverseOps) {
18400
+ item2.applyCommand(operation);
18401
18401
  }
18402
18402
  }
18403
18403
  getForward() {
@@ -18512,8 +18512,8 @@ class DrawingCommand {
18512
18512
  item;
18513
18513
  operation;
18514
18514
  reverse;
18515
- constructor(item, operation) {
18516
- this.item = item;
18515
+ constructor(item2, operation) {
18516
+ this.item = item2;
18517
18517
  this.operation = operation;
18518
18518
  this.reverse = this.getReverse();
18519
18519
  }
@@ -18522,52 +18522,52 @@ class DrawingCommand {
18522
18522
  return this;
18523
18523
  }
18524
18524
  apply() {
18525
- for (const item of this.item) {
18526
- item.apply(this.operation);
18525
+ for (const item2 of this.item) {
18526
+ item2.apply(this.operation);
18527
18527
  }
18528
18528
  }
18529
18529
  revert() {
18530
- for (const { item, operation } of this.reverse) {
18531
- item.apply(operation);
18530
+ for (const { item: item2, operation } of this.reverse) {
18531
+ item2.apply(operation);
18532
18532
  }
18533
18533
  }
18534
18534
  getReverse() {
18535
18535
  const reverse = [];
18536
- for (const item of this.item) {
18537
- reverse.push({ item, operation: this.getReverseOperation(item) });
18536
+ for (const item2 of this.item) {
18537
+ reverse.push({ item: item2, operation: this.getReverseOperation(item2) });
18538
18538
  }
18539
18539
  return reverse;
18540
18540
  }
18541
- getReverseOperation(item) {
18541
+ getReverseOperation(item2) {
18542
18542
  switch (this.operation.method) {
18543
18543
  case "setStrokeColor":
18544
18544
  return {
18545
18545
  class: "Drawing",
18546
18546
  method: "setStrokeColor",
18547
- item: [item.getId()],
18548
- color: item.getStrokeColor()
18547
+ item: [item2.getId()],
18548
+ color: item2.getStrokeColor()
18549
18549
  };
18550
18550
  case "setStrokeWidth":
18551
18551
  return {
18552
18552
  class: "Drawing",
18553
18553
  method: "setStrokeWidth",
18554
- item: [item.getId()],
18554
+ item: [item2.getId()],
18555
18555
  width: this.operation.prevWidth,
18556
- prevWidth: item.getStrokeWidth()
18556
+ prevWidth: item2.getStrokeWidth()
18557
18557
  };
18558
18558
  case "setStrokeOpacity":
18559
18559
  return {
18560
18560
  class: "Drawing",
18561
18561
  method: "setStrokeOpacity",
18562
- item: [item.getId()],
18563
- opacity: item.getStrokeOpacity()
18562
+ item: [item2.getId()],
18563
+ opacity: item2.getStrokeOpacity()
18564
18564
  };
18565
18565
  case "setStrokeStyle":
18566
18566
  return {
18567
18567
  class: "Drawing",
18568
18568
  method: "setStrokeStyle",
18569
- item: [item.getId()],
18570
- style: item.getBorderStyle()
18569
+ item: [item2.getId()],
18570
+ style: item2.getBorderStyle()
18571
18571
  };
18572
18572
  }
18573
18573
  }
@@ -18589,8 +18589,8 @@ class StickerCommand {
18589
18589
  }
18590
18590
  }
18591
18591
  revert() {
18592
- for (const { item, operation } of this.reverse) {
18593
- item.apply(operation);
18592
+ for (const { item: item2, operation } of this.reverse) {
18593
+ item2.apply(operation);
18594
18594
  }
18595
18595
  }
18596
18596
  getReverse() {
@@ -18622,8 +18622,8 @@ class FrameCommand {
18622
18622
  }
18623
18623
  }
18624
18624
  revert() {
18625
- for (const { item, operation } of this.reverse) {
18626
- item.apply(operation);
18625
+ for (const { item: item2, operation } of this.reverse) {
18626
+ item2.apply(operation);
18627
18627
  }
18628
18628
  }
18629
18629
  getReverse() {
@@ -18664,6 +18664,22 @@ class FrameCommand {
18664
18664
  children: frame2.getChildrenIds()
18665
18665
  };
18666
18666
  });
18667
+ default:
18668
+ const op = this.operation;
18669
+ let newData = {};
18670
+ if (op.prevData) {
18671
+ newData = { ...op.prevData };
18672
+ } else {
18673
+ Object.keys(op.newData).forEach((key) => {
18674
+ if (item[key]) {
18675
+ newData[key] = item[key];
18676
+ }
18677
+ });
18678
+ }
18679
+ return {
18680
+ ...op,
18681
+ newData
18682
+ };
18667
18683
  }
18668
18684
  }
18669
18685
  }
@@ -18684,8 +18700,8 @@ class CommentCommand {
18684
18700
  }
18685
18701
  }
18686
18702
  revert() {
18687
- this.reverse.forEach(({ item, operation }) => {
18688
- item.apply(operation);
18703
+ this.reverse.forEach(({ item: item2, operation }) => {
18704
+ item2.apply(operation);
18689
18705
  });
18690
18706
  }
18691
18707
  getReverse() {
@@ -19147,8 +19163,8 @@ class GroupCommand {
19147
19163
  }
19148
19164
  }
19149
19165
  revert() {
19150
- for (const { item, operation } of this.reverse) {
19151
- item.apply(operation);
19166
+ for (const { item: item2, operation } of this.reverse) {
19167
+ item2.apply(operation);
19152
19168
  }
19153
19169
  }
19154
19170
  getReverse() {
@@ -19201,8 +19217,8 @@ class PlaceholderCommand {
19201
19217
  }
19202
19218
  }
19203
19219
  revert() {
19204
- for (const { item, operation } of this.reverse) {
19205
- item.apply(operation);
19220
+ for (const { item: item2, operation } of this.reverse) {
19221
+ item2.apply(operation);
19206
19222
  }
19207
19223
  }
19208
19224
  getReverse() {
@@ -19296,26 +19312,26 @@ class BaseCommand {
19296
19312
  return this;
19297
19313
  }
19298
19314
  apply() {
19299
- for (const item of this.items) {
19300
- item.apply(this.operation);
19315
+ for (const item2 of this.items) {
19316
+ item2.apply(this.operation);
19301
19317
  }
19302
19318
  }
19303
19319
  revert() {
19304
- for (const { item, operation } of this.reverse) {
19305
- item.apply(operation);
19320
+ for (const { item: item2, operation } of this.reverse) {
19321
+ item2.apply(operation);
19306
19322
  }
19307
19323
  }
19308
19324
  getReverse() {
19309
19325
  const items = this.items;
19310
- return mapItemsByOperation(items, (item) => {
19326
+ return mapItemsByOperation(items, (item2) => {
19311
19327
  const op = this.operation;
19312
19328
  let newData = {};
19313
19329
  if (op.prevData) {
19314
19330
  newData = { ...op.prevData };
19315
19331
  } else {
19316
19332
  Object.keys(op.newData).forEach((key) => {
19317
- if (item[key]) {
19318
- newData[key] = item[key];
19333
+ if (item2[key]) {
19334
+ newData[key] = item2[key];
19319
19335
  }
19320
19336
  });
19321
19337
  }
@@ -19343,37 +19359,37 @@ var itemCommandFactories = {
19343
19359
  LinkTo: createLinkToCommand
19344
19360
  };
19345
19361
  function createConnectorCommand(items, operation) {
19346
- return new ConnectorCommand(items.filter((item) => item.itemType === "Connector"), operation);
19362
+ return new ConnectorCommand(items.filter((item2) => item2.itemType === "Connector"), operation);
19347
19363
  }
19348
19364
  function createShapeCommand(items, operation) {
19349
- return new ShapeCommand(items.filter((item) => item.itemType === "Shape"), operation);
19365
+ return new ShapeCommand(items.filter((item2) => item2.itemType === "Shape"), operation);
19350
19366
  }
19351
19367
  function createDrawingCommand(items, operation) {
19352
- return new DrawingCommand(items.filter((item) => item.itemType === "Drawing"), operation);
19368
+ return new DrawingCommand(items.filter((item2) => item2.itemType === "Drawing"), operation);
19353
19369
  }
19354
19370
  function createCommentCommand(items, operation) {
19355
- return new CommentCommand(items.filter((item) => item.itemType === "Comment"), operation);
19371
+ return new CommentCommand(items.filter((item2) => item2.itemType === "Comment"), operation);
19356
19372
  }
19357
19373
  function createStickerCommand(items, operation) {
19358
- return new StickerCommand(items.filter((item) => item.itemType === "Sticker"), operation);
19374
+ return new StickerCommand(items.filter((item2) => item2.itemType === "Sticker"), operation);
19359
19375
  }
19360
19376
  function createFrameCommand(items, operation) {
19361
- return new FrameCommand(items.filter((item) => item.itemType === "Frame"), operation);
19377
+ return new FrameCommand(items.filter((item2) => item2.itemType === "Frame"), operation);
19362
19378
  }
19363
19379
  function createPlaceholderCommand(items, operation) {
19364
- return new PlaceholderCommand(items.filter((item) => item.itemType === "Placeholder"), operation);
19380
+ return new PlaceholderCommand(items.filter((item2) => item2.itemType === "Placeholder"), operation);
19365
19381
  }
19366
19382
  function createGroupCommand(items, operation) {
19367
- return new GroupCommand(items.filter((item) => item.itemType === "Group"), operation);
19383
+ return new GroupCommand(items.filter((item2) => item2.itemType === "Group"), operation);
19368
19384
  }
19369
19385
  function createImageCommand(items, operation) {
19370
- return new ImageCommand(items.filter((item) => item.itemType === "Image"), operation);
19386
+ return new ImageCommand(items.filter((item2) => item2.itemType === "Image"), operation);
19371
19387
  }
19372
19388
  function createVideoCommand(items, operation) {
19373
- return new VideoCommand(items.filter((item) => item.itemType === "Video"), operation);
19389
+ return new VideoCommand(items.filter((item2) => item2.itemType === "Video"), operation);
19374
19390
  }
19375
19391
  function createAudioCommand(items, operation) {
19376
- return new AudioCommand(items.filter((item) => item.itemType === "Audio"), operation);
19392
+ return new AudioCommand(items.filter((item2) => item2.itemType === "Audio"), operation);
19377
19393
  }
19378
19394
  function createRichTextCommand(items, operation, board) {
19379
19395
  if (!board) {
@@ -19381,8 +19397,8 @@ function createRichTextCommand(items, operation, board) {
19381
19397
  }
19382
19398
  if (operation.method === "groupEdit") {
19383
19399
  const texts = [];
19384
- for (const { item } of operation.itemsOps) {
19385
- const found = board.items.findById(item);
19400
+ for (const { item: item2 } of operation.itemsOps) {
19401
+ const found = board.items.findById(item2);
19386
19402
  const text3 = found?.getRichText();
19387
19403
  if (text3) {
19388
19404
  texts.push(text3);
@@ -19390,14 +19406,14 @@ function createRichTextCommand(items, operation, board) {
19390
19406
  }
19391
19407
  return new RichTextGroupCommand(texts, operation);
19392
19408
  } else {
19393
- return new RichTextCommand(board, items.map((item) => item.getId()), operation);
19409
+ return new RichTextCommand(board, items.map((item2) => item2.getId()), operation);
19394
19410
  }
19395
19411
  }
19396
19412
  function createTransformationCommand(items, operation) {
19397
- return new TransformationCommand(items.map((item) => item.transformation), operation);
19413
+ return new TransformationCommand(items.map((item2) => item2.transformation), operation);
19398
19414
  }
19399
19415
  function createLinkToCommand(items, operation) {
19400
- return new LinkToCommand(items.map((item) => item.linkTo), operation);
19416
+ return new LinkToCommand(items.map((item2) => item2.linkTo), operation);
19401
19417
  }
19402
19418
  function createCommand(board, operation) {
19403
19419
  try {
@@ -19415,13 +19431,13 @@ function createCommand(board, operation) {
19415
19431
  default: {
19416
19432
  const itemType = operation.class;
19417
19433
  const itemIdList = "item" in operation ? Array.isArray(operation.item) ? operation.item : [operation.item] : ("items" in operation) ? Object.keys(operation.items) : operation.itemsOps.map((itemOp) => itemOp.item);
19418
- const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item) => {
19419
- if (typeof item === "string") {
19420
- console.warn(`Item with ID ${item} not found for operation ${operation.class}.${operation.method}`);
19434
+ const items = itemIdList.map((itemId) => board.items.findById(itemId) ?? itemId).filter((item2) => {
19435
+ if (typeof item2 === "string") {
19436
+ console.warn(`Item with ID ${item2} not found for operation ${operation.class}.${operation.method}`);
19421
19437
  return false;
19422
19438
  }
19423
- if (operation.class !== "Transformation" && operation.class !== "RichText" && operation.class !== "LinkTo" && item.itemType !== operation.class) {
19424
- console.warn(`Item with ID ${item} is not of operation type: ${itemType}.`);
19439
+ if (operation.class !== "Transformation" && operation.class !== "RichText" && operation.class !== "LinkTo" && item2.itemType !== operation.class) {
19440
+ console.warn(`Item with ID ${item2} is not of operation type: ${itemType}.`);
19425
19441
  return false;
19426
19442
  }
19427
19443
  return true;
@@ -19722,20 +19738,20 @@ class RBush {
19722
19738
  }
19723
19739
  return this;
19724
19740
  }
19725
- insert(item) {
19726
- if (item)
19727
- this._insert(item, this.data.height - 1);
19741
+ insert(item2) {
19742
+ if (item2)
19743
+ this._insert(item2, this.data.height - 1);
19728
19744
  return this;
19729
19745
  }
19730
19746
  clear() {
19731
19747
  this.data = createNode([]);
19732
19748
  return this;
19733
19749
  }
19734
- remove(item, equalsFn) {
19735
- if (!item)
19750
+ remove(item2, equalsFn) {
19751
+ if (!item2)
19736
19752
  return this;
19737
19753
  let node2 = this.data;
19738
- const bbox = this.toBBox(item);
19754
+ const bbox = this.toBBox(item2);
19739
19755
  const path2 = [];
19740
19756
  const indexes = [];
19741
19757
  let i, parent, goingUp;
@@ -19747,7 +19763,7 @@ class RBush {
19747
19763
  goingUp = true;
19748
19764
  }
19749
19765
  if (node2.leaf) {
19750
- const index2 = findItem(item, node2.children, equalsFn);
19766
+ const index2 = findItem(item2, node2.children, equalsFn);
19751
19767
  if (index2 !== -1) {
19752
19768
  node2.children.splice(index2, 1);
19753
19769
  path2.push(node2);
@@ -19770,8 +19786,8 @@ class RBush {
19770
19786
  }
19771
19787
  return this;
19772
19788
  }
19773
- toBBox(item) {
19774
- return item;
19789
+ toBBox(item2) {
19790
+ return item2;
19775
19791
  }
19776
19792
  compareMinX(a, b) {
19777
19793
  return a.minX - b.minX;
@@ -19854,11 +19870,11 @@ class RBush {
19854
19870
  }
19855
19871
  return node2;
19856
19872
  }
19857
- _insert(item, level, isNode) {
19858
- const bbox = isNode ? item : this.toBBox(item);
19873
+ _insert(item2, level, isNode) {
19874
+ const bbox = isNode ? item2 : this.toBBox(item2);
19859
19875
  const insertPath = [];
19860
19876
  const node2 = this._chooseSubtree(bbox, this.data, level, insertPath);
19861
- node2.children.push(item);
19877
+ node2.children.push(item2);
19862
19878
  extend2(node2, bbox);
19863
19879
  while (level >= 0) {
19864
19880
  if (insertPath[level].children.length > this._maxEntries) {
@@ -19957,11 +19973,11 @@ class RBush {
19957
19973
  }
19958
19974
  }
19959
19975
  }
19960
- function findItem(item, items, equalsFn) {
19976
+ function findItem(item2, items, equalsFn) {
19961
19977
  if (!equalsFn)
19962
- return items.indexOf(item);
19978
+ return items.indexOf(item2);
19963
19979
  for (let i = 0;i < items.length; i++) {
19964
- if (equalsFn(item, items[i]))
19980
+ if (equalsFn(item2, items[i]))
19965
19981
  return i;
19966
19982
  }
19967
19983
  return -1;
@@ -20052,8 +20068,8 @@ class TinyQueue {
20052
20068
  this._down(i);
20053
20069
  }
20054
20070
  }
20055
- push(item) {
20056
- this.data.push(item);
20071
+ push(item2) {
20072
+ this.data.push(item2);
20057
20073
  this.length++;
20058
20074
  this._up(this.length - 1);
20059
20075
  }
@@ -20074,21 +20090,21 @@ class TinyQueue {
20074
20090
  }
20075
20091
  _up(pos) {
20076
20092
  const { data, compare } = this;
20077
- const item = data[pos];
20093
+ const item2 = data[pos];
20078
20094
  while (pos > 0) {
20079
20095
  const parent = pos - 1 >> 1;
20080
20096
  const current = data[parent];
20081
- if (compare(item, current) >= 0)
20097
+ if (compare(item2, current) >= 0)
20082
20098
  break;
20083
20099
  data[pos] = current;
20084
20100
  pos = parent;
20085
20101
  }
20086
- data[pos] = item;
20102
+ data[pos] = item2;
20087
20103
  }
20088
20104
  _down(pos) {
20089
20105
  const { data, compare } = this;
20090
20106
  const halfLength = this.length >> 1;
20091
- const item = data[pos];
20107
+ const item2 = data[pos];
20092
20108
  while (pos < halfLength) {
20093
20109
  let left = (pos << 1) + 1;
20094
20110
  let best = data[left];
@@ -20097,12 +20113,12 @@ class TinyQueue {
20097
20113
  left = right;
20098
20114
  best = data[right];
20099
20115
  }
20100
- if (compare(best, item) >= 0)
20116
+ if (compare(best, item2) >= 0)
20101
20117
  break;
20102
20118
  data[pos] = best;
20103
20119
  pos = left;
20104
20120
  }
20105
- data[pos] = item;
20121
+ data[pos] = item2;
20106
20122
  }
20107
20123
  }
20108
20124
  function defaultCompare2(a, b) {
@@ -20190,10 +20206,10 @@ class RTreeIndex {
20190
20206
  return container ? container.item : undefined;
20191
20207
  }
20192
20208
  remove(id) {
20193
- const item = this.map.get(id);
20194
- if (item) {
20209
+ const item2 = this.map.get(id);
20210
+ if (item2) {
20195
20211
  this.map.delete(id);
20196
- this.tree.remove(item);
20212
+ this.tree.remove(item2);
20197
20213
  }
20198
20214
  }
20199
20215
  list() {
@@ -20265,11 +20281,11 @@ class Container extends Mbr {
20265
20281
  item;
20266
20282
  layer;
20267
20283
  zIndex;
20268
- constructor(id, item, layer, zIndex) {
20269
- const rect = item.getMbrWithChildren();
20284
+ constructor(id, item2, layer, zIndex) {
20285
+ const rect = item2.getMbrWithChildren();
20270
20286
  super(rect.left, rect.top, rect.right, rect.bottom);
20271
20287
  this.id = id;
20272
- this.item = item;
20288
+ this.item = item2;
20273
20289
  this.layer = layer;
20274
20290
  this.zIndex = zIndex;
20275
20291
  }
@@ -20286,7 +20302,7 @@ class LayeredIndex {
20286
20302
  this.getZIndex = this.getZIndex.bind(this);
20287
20303
  this.layers.newOnTop();
20288
20304
  }
20289
- isT(item) {
20305
+ isT(item2) {
20290
20306
  return true;
20291
20307
  }
20292
20308
  findById(id) {
@@ -20350,8 +20366,8 @@ class LayeredIndex {
20350
20366
  }
20351
20367
  getContainersFromItems(items) {
20352
20368
  const containers = [];
20353
- for (const item of items) {
20354
- const container = this.map.get(item.getId());
20369
+ for (const item2 of items) {
20370
+ const container = this.map.get(item2.getId());
20355
20371
  if (container) {
20356
20372
  containers.push(container);
20357
20373
  }
@@ -20428,9 +20444,9 @@ class LayeredIndex {
20428
20444
  }
20429
20445
  }
20430
20446
  }
20431
- insert(item) {
20432
- const toInsert = new Container(item.getId(), item, 0, this.getZIndex(item));
20433
- const bounds = item.getMbrWithChildren();
20447
+ insert(item2) {
20448
+ const toInsert = new Container(item2.getId(), item2, 0, this.getZIndex(item2));
20449
+ const bounds = item2.getMbrWithChildren();
20434
20450
  const inBounds = this.getRectsEnclosedOrCrossedBy(bounds);
20435
20451
  if (inBounds.length === 0) {
20436
20452
  return this.insertContainer(toInsert);
@@ -20497,20 +20513,20 @@ class LayeredIndex {
20497
20513
  }
20498
20514
  }
20499
20515
  }
20500
- change(item) {
20501
- const id = item.getId();
20516
+ change(item2) {
20517
+ const id = item2.getId();
20502
20518
  const container = this.map.get(id);
20503
20519
  if (container) {
20504
20520
  const layer = this.layers.get(container.layer);
20505
20521
  if (layer) {
20506
20522
  layer.remove(id);
20507
20523
  this.map.delete(id);
20508
- this.insert(item);
20524
+ this.insert(item2);
20509
20525
  }
20510
20526
  }
20511
20527
  }
20512
- remove(item) {
20513
- const id = item.getId();
20528
+ remove(item2) {
20529
+ const id = item2.getId();
20514
20530
  const container = this.map.get(id);
20515
20531
  if (container) {
20516
20532
  const layer = this.layers.get(container.layer);
@@ -20536,13 +20552,13 @@ class LayeredIndex {
20536
20552
  return items;
20537
20553
  }
20538
20554
  batchInsert(items) {
20539
- for (const item of items) {
20540
- this.insert(item);
20555
+ for (const item2 of items) {
20556
+ this.insert(item2);
20541
20557
  }
20542
20558
  }
20543
20559
  batchChange(items) {
20544
- for (const item of items) {
20545
- this.change(item);
20560
+ for (const item2 of items) {
20561
+ this.change(item2);
20546
20562
  }
20547
20563
  }
20548
20564
  }
@@ -20551,8 +20567,8 @@ class LayeredIndex {
20551
20567
  class SpatialIndex {
20552
20568
  subject = new Subject;
20553
20569
  itemsArray = [];
20554
- itemsIndex = new LayeredIndex((item) => {
20555
- return this.itemsArray.indexOf(item);
20570
+ itemsIndex = new LayeredIndex((item2) => {
20571
+ return this.itemsArray.indexOf(item2);
20556
20572
  });
20557
20573
  Mbr = new Mbr;
20558
20574
  items;
@@ -20561,79 +20577,79 @@ class SpatialIndex {
20561
20577
  }
20562
20578
  clear() {
20563
20579
  this.itemsArray = [];
20564
- this.itemsIndex = new LayeredIndex((item) => {
20565
- return this.itemsArray.indexOf(item);
20580
+ this.itemsIndex = new LayeredIndex((item2) => {
20581
+ return this.itemsArray.indexOf(item2);
20566
20582
  });
20567
20583
  this.Mbr = new Mbr;
20568
20584
  }
20569
- insert(item) {
20570
- this.itemsArray.push(item);
20571
- this.itemsIndex.insert(item);
20585
+ insert(item2) {
20586
+ this.itemsArray.push(item2);
20587
+ this.itemsIndex.insert(item2);
20572
20588
  if (conf.isNode()) {
20573
20589
  return;
20574
20590
  }
20575
20591
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
20576
- this.Mbr = item.getMbr().copy();
20592
+ this.Mbr = item2.getMbr().copy();
20577
20593
  } else {
20578
- this.Mbr.combine([item.getMbr()]);
20594
+ this.Mbr.combine([item2.getMbr()]);
20579
20595
  }
20580
- item.subject.subscribe(this.change);
20596
+ item2.subject.subscribe(this.change);
20581
20597
  this.subject.publish(this.items);
20582
20598
  }
20583
- change = (item) => {
20584
- this.itemsIndex.change(item);
20599
+ change = (item2) => {
20600
+ this.itemsIndex.change(item2);
20585
20601
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
20586
- this.Mbr = item.getMbrWithChildren().copy();
20602
+ this.Mbr = item2.getMbrWithChildren().copy();
20587
20603
  } else {
20588
- this.Mbr.combine([item.getMbrWithChildren()]);
20604
+ this.Mbr.combine([item2.getMbrWithChildren()]);
20589
20605
  }
20590
20606
  this.subject.publish(this.items);
20591
20607
  };
20592
- remove(item) {
20593
- if ("index" in item && item.index) {
20594
- item.removeChildItems(item.index.list());
20608
+ remove(item2) {
20609
+ if ("index" in item2 && item2.index) {
20610
+ item2.removeChildItems(item2.index.list());
20595
20611
  }
20596
- this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
20597
- this.itemsIndex.remove(item);
20612
+ this.itemsArray.splice(this.itemsArray.indexOf(item2), 1);
20613
+ this.itemsIndex.remove(item2);
20598
20614
  this.Mbr = new Mbr;
20599
- this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbrWithChildren()]));
20615
+ this.itemsArray.forEach((item3) => this.Mbr.combine([item3.getMbrWithChildren()]));
20600
20616
  this.subject.publish(this.items);
20601
20617
  }
20602
20618
  copy() {
20603
- return this.getItemsWithIncludedChildren(this.itemsArray).map((item) => ({
20604
- ...item.serialize(true),
20605
- id: item.getId()
20619
+ return this.getItemsWithIncludedChildren(this.itemsArray).map((item2) => ({
20620
+ ...item2.serialize(true),
20621
+ id: item2.getId()
20606
20622
  }));
20607
20623
  }
20608
20624
  getItemsWithIncludedChildren(items) {
20609
- return items.flatMap((item) => {
20610
- if ("index" in item && item.index) {
20611
- return [item, ...item.index.list()];
20625
+ return items.flatMap((item2) => {
20626
+ if ("index" in item2 && item2.index) {
20627
+ return [item2, ...item2.index.list()];
20612
20628
  }
20613
- return item;
20629
+ return item2;
20614
20630
  });
20615
20631
  }
20616
- getItemChildren(item) {
20617
- if ("index" in item && item.index) {
20618
- return item.index.list();
20632
+ getItemChildren(item2) {
20633
+ if ("index" in item2 && item2.index) {
20634
+ return item2.index.list();
20619
20635
  }
20620
20636
  return [];
20621
20637
  }
20622
- getItemParent(item) {
20623
- if (item.parent === "Board") {
20638
+ getItemParent(item2) {
20639
+ if (item2.parent === "Board") {
20624
20640
  return;
20625
20641
  }
20626
- return this.getById(item.parent);
20642
+ return this.getById(item2.parent);
20627
20643
  }
20628
- moveToZIndex(item, zIndex) {
20629
- const index2 = this.itemsArray.indexOf(item);
20644
+ moveToZIndex(item2, zIndex) {
20645
+ const index2 = this.itemsArray.indexOf(item2);
20630
20646
  this.itemsArray.splice(index2, 1);
20631
- this.itemsArray.splice(zIndex, 0, item);
20632
- this.change(item);
20647
+ this.itemsArray.splice(zIndex, 0, item2);
20648
+ this.change(item2);
20633
20649
  this.subject.publish(this.items);
20634
20650
  }
20635
20651
  moveManyToZIndex(itemsRecord) {
20636
- const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item) => item !== undefined);
20652
+ const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item2) => item2 !== undefined);
20637
20653
  const zIndex = Object.values(itemsRecord);
20638
20654
  for (let i = 0;i < zIndex.length; i++) {
20639
20655
  const index2 = zIndex[i];
@@ -20641,39 +20657,39 @@ class SpatialIndex {
20641
20657
  }
20642
20658
  this.itemsArray.forEach(this.change.bind(this));
20643
20659
  }
20644
- sendToBack(item, shouldPublish = true) {
20645
- const index2 = this.itemsArray.indexOf(item);
20660
+ sendToBack(item2, shouldPublish = true) {
20661
+ const index2 = this.itemsArray.indexOf(item2);
20646
20662
  this.itemsArray.splice(index2, 1);
20647
- this.itemsArray.unshift(item);
20648
- this.itemsIndex.change(item);
20663
+ this.itemsArray.unshift(item2);
20664
+ this.itemsIndex.change(item2);
20649
20665
  if (shouldPublish) {
20650
20666
  this.subject.publish(this.items);
20651
20667
  }
20652
20668
  }
20653
20669
  sendManyToBack(items) {
20654
20670
  const newItems = [...items];
20655
- this.itemsArray.forEach((item) => {
20656
- if (!items.includes(item)) {
20657
- newItems.push(item);
20671
+ this.itemsArray.forEach((item2) => {
20672
+ if (!items.includes(item2)) {
20673
+ newItems.push(item2);
20658
20674
  }
20659
20675
  });
20660
20676
  this.itemsArray = newItems;
20661
20677
  this.itemsArray.forEach(this.change.bind(this));
20662
20678
  }
20663
- bringToFront(item, shouldPublish = true) {
20664
- const index2 = this.itemsArray.indexOf(item);
20679
+ bringToFront(item2, shouldPublish = true) {
20680
+ const index2 = this.itemsArray.indexOf(item2);
20665
20681
  this.itemsArray.splice(index2, 1);
20666
- this.itemsArray.push(item);
20667
- this.itemsIndex.change(item);
20682
+ this.itemsArray.push(item2);
20683
+ this.itemsIndex.change(item2);
20668
20684
  if (shouldPublish) {
20669
20685
  this.subject.publish(this.items);
20670
20686
  }
20671
20687
  }
20672
20688
  bringManyToFront(items) {
20673
20689
  const newItems = [];
20674
- this.itemsArray.forEach((item) => {
20675
- if (!items.includes(item)) {
20676
- newItems.push(item);
20690
+ this.itemsArray.forEach((item2) => {
20691
+ if (!items.includes(item2)) {
20692
+ newItems.push(item2);
20677
20693
  }
20678
20694
  });
20679
20695
  newItems.push(...items);
@@ -20699,9 +20715,9 @@ class SpatialIndex {
20699
20715
  this.subject.publish(this.items);
20700
20716
  }
20701
20717
  getById(id) {
20702
- const item = this.getItemsWithIncludedChildren(this.itemsArray).find((item2) => item2.getId() === id);
20703
- if (item) {
20704
- return item;
20718
+ const item2 = this.getItemsWithIncludedChildren(this.itemsArray).find((item3) => item3.getId() === id);
20719
+ if (item2) {
20720
+ return item2;
20705
20721
  }
20706
20722
  }
20707
20723
  findById(id) {
@@ -20711,10 +20727,10 @@ class SpatialIndex {
20711
20727
  const mbr = new Mbr(left, top, right, bottom);
20712
20728
  const items = this.itemsIndex.getEnclosed(mbr);
20713
20729
  const children = [];
20714
- const clearItems = items.filter((item) => {
20715
- if ("index" in item && item.index) {
20716
- children.push(...item.index.getEnclosed(left, top, right, bottom));
20717
- if (!item.getMbr().isEnclosedBy(mbr)) {
20730
+ const clearItems = items.filter((item2) => {
20731
+ if ("index" in item2 && item2.index) {
20732
+ children.push(...item2.index.getEnclosed(left, top, right, bottom));
20733
+ if (!item2.getMbr().isEnclosedBy(mbr)) {
20718
20734
  return false;
20719
20735
  }
20720
20736
  }
@@ -20726,10 +20742,10 @@ class SpatialIndex {
20726
20742
  const mbr = new Mbr(left, top, right, bottom);
20727
20743
  const items = this.itemsIndex.getEnclosedOrCrossedBy(mbr);
20728
20744
  const children = [];
20729
- const clearItems = items.filter((item) => {
20730
- if ("index" in item && item.index) {
20731
- children.push(...item.index.getEnclosedOrCrossed(left, top, right, bottom));
20732
- if (!item.getMbr().isEnclosedOrCrossedBy(mbr)) {
20745
+ const clearItems = items.filter((item2) => {
20746
+ if ("index" in item2 && item2.index) {
20747
+ children.push(...item2.index.getEnclosedOrCrossed(left, top, right, bottom));
20748
+ if (!item2.getMbr().isEnclosedOrCrossedBy(mbr)) {
20733
20749
  return false;
20734
20750
  }
20735
20751
  }
@@ -20740,10 +20756,10 @@ class SpatialIndex {
20740
20756
  getUnderPoint(point3, tolerance = 5) {
20741
20757
  const items = this.itemsIndex.getUnderPoint(point3, tolerance);
20742
20758
  const children = [];
20743
- const clearItems = items.filter((item) => {
20744
- if ("index" in item && item.index) {
20745
- children.push(...item.index.getUnderPoint(point3, tolerance));
20746
- if (!item.getMbr().isUnderPoint(point3)) {
20759
+ const clearItems = items.filter((item2) => {
20760
+ if ("index" in item2 && item2.index) {
20761
+ children.push(...item2.index.getUnderPoint(point3, tolerance));
20762
+ if (!item2.getMbr().isUnderPoint(point3)) {
20747
20763
  return false;
20748
20764
  }
20749
20765
  }
@@ -20755,10 +20771,10 @@ class SpatialIndex {
20755
20771
  const mbr = new Mbr(left, top, right, bottom);
20756
20772
  const items = this.itemsIndex.getRectsEnclosedOrCrossedBy(mbr);
20757
20773
  const children = [];
20758
- const clearItems = items.filter((item) => {
20759
- if ("index" in item && item.index) {
20760
- children.push(...item.index.getEnclosedOrCrossed(left, top, right, bottom));
20761
- if (!item.getMbr().isEnclosedOrCrossedBy(mbr)) {
20774
+ const clearItems = items.filter((item2) => {
20775
+ if ("index" in item2 && item2.index) {
20776
+ children.push(...item2.index.getEnclosedOrCrossed(left, top, right, bottom));
20777
+ if (!item2.getMbr().isEnclosedOrCrossedBy(mbr)) {
20762
20778
  return false;
20763
20779
  }
20764
20780
  }
@@ -20770,26 +20786,26 @@ class SpatialIndex {
20770
20786
  return this.getRectsEnclosedOrCrossed(left, top, right, bottom);
20771
20787
  }
20772
20788
  getComments() {
20773
- return this.itemsArray.filter((item) => item instanceof Comment);
20789
+ return this.itemsArray.filter((item2) => item2 instanceof Comment);
20774
20790
  }
20775
20791
  getMbr() {
20776
20792
  return this.Mbr;
20777
20793
  }
20778
20794
  getNearestTo(point3, maxItems, filter, maxDistance) {
20779
20795
  const allItems = this.getItemsWithIncludedChildren(this.itemsArray);
20780
- const filtered = allItems.filter((item) => filter(item));
20781
- const withDistance = filtered.map((item) => ({
20782
- item,
20783
- distance: point3.getDistance(item.getMbr().getCenter())
20796
+ const filtered = allItems.filter((item2) => filter(item2));
20797
+ const withDistance = filtered.map((item2) => ({
20798
+ item: item2,
20799
+ distance: point3.getDistance(item2.getMbr().getCenter())
20784
20800
  })).filter(({ distance }) => distance <= maxDistance);
20785
20801
  withDistance.sort((a, b) => a.distance - b.distance);
20786
- return withDistance.slice(0, maxItems).map(({ item }) => item);
20802
+ return withDistance.slice(0, maxItems).map(({ item: item2 }) => item2);
20787
20803
  }
20788
20804
  list() {
20789
20805
  return this.getItemsWithIncludedChildren(this.itemsArray).concat();
20790
20806
  }
20791
- getZIndex(item) {
20792
- const index2 = this.itemsArray.indexOf(item);
20807
+ getZIndex(item2) {
20808
+ const index2 = this.itemsArray.indexOf(item2);
20793
20809
  if (index2 === -1) {
20794
20810
  return this.getLastZIndex();
20795
20811
  }
@@ -20819,14 +20835,14 @@ class Items {
20819
20835
  this.pointer = pointer;
20820
20836
  this.subject = subject;
20821
20837
  }
20822
- update(item) {
20823
- this.index.change(item);
20838
+ update(item2) {
20839
+ this.index.change(item2);
20824
20840
  }
20825
20841
  listAll() {
20826
20842
  return this.index.list();
20827
20843
  }
20828
20844
  listGroupItems() {
20829
- return this.index.list().filter((item) => ("index" in item) && item.index);
20845
+ return this.index.list().filter((item2) => ("index" in item2) && item2.index);
20830
20846
  }
20831
20847
  getById(id) {
20832
20848
  return this.index.getById(id);
@@ -20841,7 +20857,7 @@ class Items {
20841
20857
  return this.index.getEnclosedOrCrossed(left, top, right, bottom);
20842
20858
  }
20843
20859
  getGroupItemsEnclosedOrCrossed(left, top, right, bottom) {
20844
- return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => item instanceof BaseItem && item.index);
20860
+ return this.index.getEnclosedOrCrossed(left, top, right, bottom).filter((item2) => item2 instanceof BaseItem && item2.index);
20845
20861
  }
20846
20862
  getUnderPoint(point3, tolerance = 5) {
20847
20863
  return this.index.getUnderPoint(point3, tolerance);
@@ -20869,28 +20885,28 @@ class Items {
20869
20885
  const unmodifiedSize = size;
20870
20886
  size = 16;
20871
20887
  const tolerated = this.index.getEnclosedOrCrossed(x - size, y - size, x + size, y + size);
20872
- const groups = tolerated.filter((item) => item.itemType === "Group");
20888
+ const groups = tolerated.filter((item2) => item2.itemType === "Group");
20873
20889
  if (groups.length > 0) {
20874
20890
  return groups;
20875
20891
  }
20876
- let enclosed = tolerated.some((item) => item instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
20892
+ let enclosed = tolerated.some((item2) => item2 instanceof Connector2) ? tolerated : this.index.getEnclosedOrCrossed(x, y, x, y);
20877
20893
  const underPointer = this.getUnderPoint(new Point(x, y), size);
20878
20894
  if (enclosed.length === 0) {
20879
20895
  enclosed = underPointer;
20880
20896
  }
20881
- if (underPointer.some((item) => item.itemType === "Drawing")) {
20897
+ if (underPointer.some((item2) => item2.itemType === "Drawing")) {
20882
20898
  enclosed = [...underPointer, ...enclosed];
20883
20899
  }
20884
- const { nearest } = enclosed.reduce((acc, item) => {
20885
- const area = item.getMbr().getHeight() * item.getMbr().getWidth();
20886
- if (item.itemType === "Drawing" && !item.isPointNearLine(this.pointer.point)) {
20900
+ const { nearest } = enclosed.reduce((acc, item2) => {
20901
+ const area = item2.getMbr().getHeight() * item2.getMbr().getWidth();
20902
+ if (item2.itemType === "Drawing" && !item2.isPointNearLine(this.pointer.point)) {
20887
20903
  return acc;
20888
20904
  }
20889
- const isItemTransparent = item instanceof Shape && item?.getBackgroundColor() === "none";
20890
- const itemZIndex = this.getZIndex(item);
20905
+ const isItemTransparent = item2 instanceof Shape && item2?.getBackgroundColor() === "none";
20906
+ const itemZIndex = this.getZIndex(item2);
20891
20907
  const accZIndex = this.getZIndex(acc.nearest);
20892
20908
  if (itemZIndex > accZIndex && (!isItemTransparent || area === acc.area) || area < acc.area) {
20893
- return { nearest: item, area };
20909
+ return { nearest: item2, area };
20894
20910
  }
20895
20911
  return acc;
20896
20912
  }, { nearest: undefined, area: Infinity });
@@ -20902,8 +20918,8 @@ class Items {
20902
20918
  getNearPointer(maxDistance = 100, maxItems = 10, filter = () => true) {
20903
20919
  return this.index.getNearestTo(this.pointer.point, maxItems, filter, maxDistance);
20904
20920
  }
20905
- getZIndex(item) {
20906
- return this.index.getZIndex(item);
20921
+ getZIndex(item2) {
20922
+ return this.index.getZIndex(item2);
20907
20923
  }
20908
20924
  getByZIndex(index2) {
20909
20925
  return this.index.getByZIndex(index2);
@@ -20912,11 +20928,11 @@ class Items {
20912
20928
  return this.index.getLastZIndex();
20913
20929
  }
20914
20930
  getLinkedConnectorsById(id) {
20915
- return this.listAll().filter((item) => {
20916
- if (!(item instanceof Connector2)) {
20931
+ return this.listAll().filter((item2) => {
20932
+ if (!(item2 instanceof Connector2)) {
20917
20933
  return false;
20918
20934
  }
20919
- const { startItem, endItem } = item.getConnectedItems();
20935
+ const { startItem, endItem } = item2.getConnectedItems();
20920
20936
  if (startItem?.getId() === id || endItem?.getId() === id) {
20921
20937
  return true;
20922
20938
  }
@@ -20927,11 +20943,11 @@ class Items {
20927
20943
  if (!startPointerItemId && !endPointerItemId) {
20928
20944
  return [];
20929
20945
  }
20930
- return this.listAll().filter((item) => {
20931
- if (!(item instanceof Connector2) || !item.isConnected()) {
20946
+ return this.listAll().filter((item2) => {
20947
+ if (!(item2 instanceof Connector2) || !item2.isConnected()) {
20932
20948
  return false;
20933
20949
  }
20934
- const { startItem, endItem } = item.getConnectedItems();
20950
+ const { startItem, endItem } = item2.getConnectedItems();
20935
20951
  if (startPointerItemId && endPointerItemId) {
20936
20952
  if (startPointerItemId && startItem && startItem.getId() === startPointerItemId && endPointerItemId && endItem && endItem.getId() === endPointerItemId) {
20937
20953
  return true;
@@ -20949,9 +20965,9 @@ class Items {
20949
20965
  }
20950
20966
  render(context) {
20951
20967
  const items = this.getItemsInView();
20952
- items.forEach((item) => {
20953
- if (item.parent === "Board") {
20954
- item.render(context);
20968
+ items.forEach((item2) => {
20969
+ if (item2.parent === "Board") {
20970
+ item2.render(context);
20955
20971
  }
20956
20972
  });
20957
20973
  }
@@ -20964,17 +20980,17 @@ class Items {
20964
20980
  return this.getHTML(documentFactory, items);
20965
20981
  }
20966
20982
  getHTML(documentFactory, items) {
20967
- const lowestCoordinates = items.map((item) => item.getMbr()).reduce((acc, mbr) => ({
20983
+ const lowestCoordinates = items.map((item2) => item2.getMbr()).reduce((acc, mbr) => ({
20968
20984
  left: Math.min(acc.left, mbr.left),
20969
20985
  top: Math.min(acc.top, mbr.top)
20970
20986
  }), { left: 0, top: 0 });
20971
20987
  const groups = [];
20972
20988
  const rest = [];
20973
- items.forEach((item) => {
20974
- if ("index" in item && item.index) {
20975
- groups.push(item);
20989
+ items.forEach((item2) => {
20990
+ if ("index" in item2 && item2.index) {
20991
+ groups.push(item2);
20976
20992
  } else {
20977
- rest.push(item);
20993
+ rest.push(item2);
20978
20994
  }
20979
20995
  });
20980
20996
  const childrenMap = new Map;
@@ -20984,34 +21000,34 @@ class Items {
20984
21000
  translateElementBy(html, -lowestCoordinates.left, -lowestCoordinates.top);
20985
21001
  return html;
20986
21002
  });
20987
- const restHTML = rest.map((item) => ("renderHTML" in item) && item.renderHTML(documentFactory)).filter((item) => !!item).map((item) => {
20988
- if (item.tagName.toLowerCase() === "connector-item") {
20989
- const startX = parseFloat(item.getAttribute("data-start-point-x") || "0");
20990
- const startY = parseFloat(item.getAttribute("data-start-point-y") || "0");
20991
- const endX = parseFloat(item.getAttribute("data-end-point-x") || "0");
20992
- const endY = parseFloat(item.getAttribute("data-end-point-y") || "0");
20993
- item.setAttribute("data-start-point-x", (startX - lowestCoordinates.left).toString());
20994
- item.setAttribute("data-start-point-y", (startY - lowestCoordinates.top).toString());
20995
- item.setAttribute("data-end-point-x", (endX - lowestCoordinates.left).toString());
20996
- item.setAttribute("data-end-point-y", (endY - lowestCoordinates.top).toString());
20997
- }
20998
- return translateElementBy(item, -lowestCoordinates.left, -lowestCoordinates.top);
20999
- });
21000
- for (const item of restHTML) {
21001
- const parentFrameId = childrenMap.get(item.id);
21003
+ const restHTML = rest.map((item2) => ("renderHTML" in item2) && item2.renderHTML(documentFactory)).filter((item2) => !!item2).map((item2) => {
21004
+ if (item2.tagName.toLowerCase() === "connector-item") {
21005
+ const startX = parseFloat(item2.getAttribute("data-start-point-x") || "0");
21006
+ const startY = parseFloat(item2.getAttribute("data-start-point-y") || "0");
21007
+ const endX = parseFloat(item2.getAttribute("data-end-point-x") || "0");
21008
+ const endY = parseFloat(item2.getAttribute("data-end-point-y") || "0");
21009
+ item2.setAttribute("data-start-point-x", (startX - lowestCoordinates.left).toString());
21010
+ item2.setAttribute("data-start-point-y", (startY - lowestCoordinates.top).toString());
21011
+ item2.setAttribute("data-end-point-x", (endX - lowestCoordinates.left).toString());
21012
+ item2.setAttribute("data-end-point-y", (endY - lowestCoordinates.top).toString());
21013
+ }
21014
+ return translateElementBy(item2, -lowestCoordinates.left, -lowestCoordinates.top);
21015
+ });
21016
+ for (const item2 of restHTML) {
21017
+ const parentFrameId = childrenMap.get(item2.id);
21002
21018
  const group = GroupsHTML.find((el) => parentFrameId !== undefined && el.id === parentFrameId);
21003
21019
  if (group) {
21004
- positionRelatively(item, group);
21005
- group.appendChild(item);
21020
+ positionRelatively(item2, group);
21021
+ group.appendChild(item2);
21006
21022
  }
21007
21023
  }
21008
21024
  let result = "";
21009
21025
  for (const group of GroupsHTML) {
21010
21026
  result += group.outerHTML;
21011
21027
  }
21012
- for (const item of restHTML) {
21013
- if (!childrenMap.get(item.id)) {
21014
- result += item.outerHTML;
21028
+ for (const item2 of restHTML) {
21029
+ if (!childrenMap.get(item2.id)) {
21030
+ result += item2.outerHTML;
21015
21031
  }
21016
21032
  }
21017
21033
  return result;
@@ -21031,52 +21047,52 @@ class SimpleSpatialIndex {
21031
21047
  this.itemsArray = [];
21032
21048
  this.Mbr = new Mbr;
21033
21049
  }
21034
- insert(item) {
21035
- this.itemsArray.push(item);
21050
+ insert(item2) {
21051
+ this.itemsArray.push(item2);
21036
21052
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
21037
- this.Mbr = item.getMbr().copy();
21053
+ this.Mbr = item2.getMbr().copy();
21038
21054
  } else {
21039
- this.Mbr.combine([item.getMbr()]);
21055
+ this.Mbr.combine([item2.getMbr()]);
21040
21056
  }
21041
- item.subject.subscribe(this.change);
21057
+ item2.subject.subscribe(this.change);
21042
21058
  this.subject.publish(this.items);
21043
21059
  }
21044
- change = (item) => {
21060
+ change = (item2) => {
21045
21061
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
21046
- this.Mbr = item.getMbr().copy();
21062
+ this.Mbr = item2.getMbr().copy();
21047
21063
  } else {
21048
- this.Mbr.combine([item.getMbr()]);
21064
+ this.Mbr.combine([item2.getMbr()]);
21049
21065
  }
21050
21066
  this.subject.publish(this.items);
21051
21067
  };
21052
- remove(item) {
21053
- if ("index" in item && item.index) {
21054
- item.removeChildItems(item.index.list());
21068
+ remove(item2) {
21069
+ if ("index" in item2 && item2.index) {
21070
+ item2.removeChildItems(item2.index.list());
21055
21071
  }
21056
- if (item.parent !== "Board") {
21057
- const parentFrame = this.items.getById(item.parent);
21058
- parentFrame?.removeChildItems(item);
21072
+ if (item2.parent !== "Board") {
21073
+ const parentFrame = this.items.getById(item2.parent);
21074
+ parentFrame?.removeChildItems(item2);
21059
21075
  }
21060
- this.itemsArray.splice(this.itemsArray.indexOf(item), 1);
21076
+ this.itemsArray.splice(this.itemsArray.indexOf(item2), 1);
21061
21077
  this.Mbr = new Mbr;
21062
- this.itemsArray.forEach((item2) => this.Mbr.combine([item2.getMbr()]));
21078
+ this.itemsArray.forEach((item3) => this.Mbr.combine([item3.getMbr()]));
21063
21079
  this.subject.publish(this.items);
21064
21080
  }
21065
21081
  copy() {
21066
- return this.itemsArray.map((item) => ({
21067
- ...item.serialize(true),
21068
- id: item.getId()
21082
+ return this.itemsArray.map((item2) => ({
21083
+ ...item2.serialize(true),
21084
+ id: item2.getId()
21069
21085
  }));
21070
21086
  }
21071
- moveToZIndex(item, zIndex) {
21072
- const index2 = this.itemsArray.indexOf(item);
21087
+ moveToZIndex(item2, zIndex) {
21088
+ const index2 = this.itemsArray.indexOf(item2);
21073
21089
  this.itemsArray.splice(index2, 1);
21074
- this.itemsArray.splice(zIndex, 0, item);
21075
- this.change(item);
21090
+ this.itemsArray.splice(zIndex, 0, item2);
21091
+ this.change(item2);
21076
21092
  this.subject.publish(this.items);
21077
21093
  }
21078
21094
  moveManyToZIndex(itemsRecord) {
21079
- const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item) => item !== undefined);
21095
+ const items = Object.keys(itemsRecord).map((id) => this.items.getById(id)).filter((item2) => item2 !== undefined);
21080
21096
  const zIndex = Object.values(itemsRecord);
21081
21097
  for (let i = 0;i < zIndex.length; i++) {
21082
21098
  const index2 = zIndex[i];
@@ -21084,37 +21100,37 @@ class SimpleSpatialIndex {
21084
21100
  }
21085
21101
  this.itemsArray.forEach(this.change.bind(this));
21086
21102
  }
21087
- sendToBack(item, shouldPublish = true) {
21088
- const index2 = this.itemsArray.indexOf(item);
21103
+ sendToBack(item2, shouldPublish = true) {
21104
+ const index2 = this.itemsArray.indexOf(item2);
21089
21105
  this.itemsArray.splice(index2, 1);
21090
- this.itemsArray.unshift(item);
21106
+ this.itemsArray.unshift(item2);
21091
21107
  if (shouldPublish) {
21092
21108
  this.subject.publish(this.items);
21093
21109
  }
21094
21110
  }
21095
21111
  sendManyToBack(items) {
21096
21112
  const newItems = [...items];
21097
- this.itemsArray.forEach((item) => {
21098
- if (!items.includes(item)) {
21099
- newItems.push(item);
21113
+ this.itemsArray.forEach((item2) => {
21114
+ if (!items.includes(item2)) {
21115
+ newItems.push(item2);
21100
21116
  }
21101
21117
  });
21102
21118
  this.itemsArray = newItems;
21103
21119
  this.itemsArray.forEach(this.change.bind(this));
21104
21120
  }
21105
- bringToFront(item, shouldPublish = true) {
21106
- const index2 = this.itemsArray.indexOf(item);
21121
+ bringToFront(item2, shouldPublish = true) {
21122
+ const index2 = this.itemsArray.indexOf(item2);
21107
21123
  this.itemsArray.splice(index2, 1);
21108
- this.itemsArray.push(item);
21124
+ this.itemsArray.push(item2);
21109
21125
  if (shouldPublish) {
21110
21126
  this.subject.publish(this.items);
21111
21127
  }
21112
21128
  }
21113
21129
  bringManyToFront(items) {
21114
21130
  const newItems = [];
21115
- this.itemsArray.forEach((item) => {
21116
- if (!items.includes(item)) {
21117
- newItems.push(item);
21131
+ this.itemsArray.forEach((item2) => {
21132
+ if (!items.includes(item2)) {
21133
+ newItems.push(item2);
21118
21134
  }
21119
21135
  });
21120
21136
  newItems.push(...items);
@@ -21140,9 +21156,9 @@ class SimpleSpatialIndex {
21140
21156
  this.subject.publish(this.items);
21141
21157
  }
21142
21158
  getById(id) {
21143
- const item = this.itemsArray.find((item2) => item2.getId() === id);
21144
- if (item) {
21145
- return item;
21159
+ const item2 = this.itemsArray.find((item3) => item3.getId() === id);
21160
+ if (item2) {
21161
+ return item2;
21146
21162
  }
21147
21163
  }
21148
21164
  findById(id) {
@@ -21151,9 +21167,9 @@ class SimpleSpatialIndex {
21151
21167
  getEnclosed(left, top, right, bottom) {
21152
21168
  const mbr = new Mbr(left, top, right, bottom);
21153
21169
  const items = [];
21154
- this.itemsArray.forEach((item) => {
21155
- if (item.isEnclosedBy(mbr)) {
21156
- items.push(item);
21170
+ this.itemsArray.forEach((item2) => {
21171
+ if (item2.isEnclosedBy(mbr)) {
21172
+ items.push(item2);
21157
21173
  }
21158
21174
  });
21159
21175
  return items;
@@ -21161,18 +21177,18 @@ class SimpleSpatialIndex {
21161
21177
  getEnclosedOrCrossed(left, top, right, bottom) {
21162
21178
  const mbr = new Mbr(left, top, right, bottom);
21163
21179
  const items = [];
21164
- this.itemsArray.forEach((item) => {
21165
- if (item.isEnclosedOrCrossedBy(mbr)) {
21166
- items.push(item);
21180
+ this.itemsArray.forEach((item2) => {
21181
+ if (item2.isEnclosedOrCrossedBy(mbr)) {
21182
+ items.push(item2);
21167
21183
  }
21168
21184
  });
21169
21185
  return items;
21170
21186
  }
21171
21187
  getUnderPoint(point3, tolerace = 5) {
21172
21188
  const items = [];
21173
- this.itemsArray.forEach((item) => {
21174
- if (item.isUnderPoint(point3, tolerace)) {
21175
- items.push(item);
21189
+ this.itemsArray.forEach((item2) => {
21190
+ if (item2.isUnderPoint(point3, tolerace)) {
21191
+ items.push(item2);
21176
21192
  }
21177
21193
  });
21178
21194
  return items;
@@ -21183,8 +21199,8 @@ class SimpleSpatialIndex {
21183
21199
  list() {
21184
21200
  return this.itemsArray.concat();
21185
21201
  }
21186
- getZIndex(item) {
21187
- return this.itemsArray.indexOf(item);
21202
+ getZIndex(item2) {
21203
+ return this.itemsArray.indexOf(item2);
21188
21204
  }
21189
21205
  getLastZIndex() {
21190
21206
  return this.itemsArray.length - 1;
@@ -21198,8 +21214,8 @@ class SimpleSpatialIndex {
21198
21214
  }
21199
21215
  }
21200
21216
  render(context) {
21201
- this.itemsArray.forEach((item) => {
21202
- item.render(context);
21217
+ this.itemsArray.forEach((item2) => {
21218
+ item2.render(context);
21203
21219
  });
21204
21220
  }
21205
21221
  }
@@ -21250,7 +21266,7 @@ class BaseItem extends Mbr {
21250
21266
  if (!this.index) {
21251
21267
  return null;
21252
21268
  }
21253
- return this.index.items.listAll().map((item) => item.getId());
21269
+ return this.index.items.listAll().map((item2) => item2.getId());
21254
21270
  }
21255
21271
  addChildItems(children) {
21256
21272
  if (!this.index) {
@@ -21288,17 +21304,17 @@ class BaseItem extends Mbr {
21288
21304
  this.addChildItems(itemsToAdd);
21289
21305
  this.removeChildItems(itemsToRemove);
21290
21306
  }
21291
- handleNesting(item, options) {
21292
- const isItem = "itemType" in item;
21293
- const itemMbr = isItem ? item.getMbr() : item;
21294
- if (item instanceof BaseItem && !item.canBeNested) {
21307
+ handleNesting(item2, options) {
21308
+ const isItem = "itemType" in item2;
21309
+ const itemMbr = isItem ? item2.getMbr() : item2;
21310
+ if (item2 instanceof BaseItem && !item2.canBeNested) {
21295
21311
  return false;
21296
21312
  }
21297
- if (options?.cancelIfChild && isItem && item.parent !== "Board") {
21313
+ if (options?.cancelIfChild && isItem && item2.parent !== "Board") {
21298
21314
  return false;
21299
21315
  }
21300
21316
  const mbr = this.getMbr().copy();
21301
- if (item.isEnclosedOrCrossedBy(mbr)) {
21317
+ if (item2.isEnclosedOrCrossedBy(mbr)) {
21302
21318
  if (mbr.isInside(itemMbr.getCenter())) {
21303
21319
  if (!options || !options.onlyForOut) {
21304
21320
  return true;
@@ -23595,8 +23611,8 @@ function isChild(value) {
23595
23611
  if (!Array.isArray(value2))
23596
23612
  return true;
23597
23613
  const list2 = value2;
23598
- for (const item of list2) {
23599
- if (typeof item !== "number" && typeof item !== "string") {
23614
+ for (const item2 of list2) {
23615
+ if (typeof item2 !== "number" && typeof item2 !== "string") {
23600
23616
  return true;
23601
23617
  }
23602
23618
  }
@@ -23635,8 +23651,8 @@ function addProperty(schema, properties, key, value) {
23635
23651
  }
23636
23652
  if (Array.isArray(result)) {
23637
23653
  const finalResult = [];
23638
- for (const item of result) {
23639
- finalResult.push(parsePrimitive(info, info.property, item));
23654
+ for (const item2 of result) {
23655
+ finalResult.push(parsePrimitive(info, info.property, item2));
23640
23656
  }
23641
23657
  result = finalResult;
23642
23658
  }
@@ -34703,8 +34719,8 @@ function list5(node2, parent, state, info) {
34703
34719
  if (checkRule(state) === bullet && firstListItem) {
34704
34720
  let index2 = -1;
34705
34721
  while (++index2 < node2.children.length) {
34706
- const item = node2.children[index2];
34707
- if (item && item.type === "listItem" && item.children && item.children[0] && item.children[0].type === "thematicBreak") {
34722
+ const item2 = node2.children[index2];
34723
+ if (item2 && item2.type === "listItem" && item2.children && item2.children[0] && item2.children[0].type === "thematicBreak") {
34708
34724
  useDifferentMarker = true;
34709
34725
  break;
34710
34726
  }
@@ -35364,12 +35380,12 @@ async function convertMarkdownToSlate(text5) {
35364
35380
  ...nodes.filter((node2) => node2.type !== "list_item")
35365
35381
  ];
35366
35382
  }
35367
- return nodes.map((item) => {
35383
+ return nodes.map((item2) => {
35368
35384
  setNodeStyles({
35369
- node: item,
35370
- isPaddingTopNeeded: item.type !== "code_block"
35385
+ node: item2,
35386
+ isPaddingTopNeeded: item2.type !== "code_block"
35371
35387
  });
35372
- return item;
35388
+ return item2;
35373
35389
  });
35374
35390
  }
35375
35391
  function detectListType(text5) {
@@ -35782,17 +35798,17 @@ class FloatingPoint extends Point {
35782
35798
  relativePoint;
35783
35799
  pointType = "Floating";
35784
35800
  edge;
35785
- constructor(item, relativePoint) {
35801
+ constructor(item2, relativePoint) {
35786
35802
  super();
35787
- this.item = item;
35803
+ this.item = item2;
35788
35804
  this.relativePoint = relativePoint;
35789
35805
  if (relativePoint.y <= 0) {
35790
35806
  this.edge = "top";
35791
- } else if (relativePoint.y >= item.getMbr().getHeight()) {
35807
+ } else if (relativePoint.y >= item2.getMbr().getHeight()) {
35792
35808
  this.edge = "bottom";
35793
35809
  } else if (relativePoint.x <= 0) {
35794
35810
  this.edge = "left";
35795
- } else if (relativePoint.x >= item.getMbr().getWidth()) {
35811
+ } else if (relativePoint.x >= item2.getMbr().getWidth()) {
35796
35812
  this.edge = "right";
35797
35813
  }
35798
35814
  this.recalculatePoint();
@@ -35823,17 +35839,17 @@ class FixedPoint extends Point {
35823
35839
  relativePoint;
35824
35840
  pointType = "Fixed";
35825
35841
  edge;
35826
- constructor(item, relativePoint) {
35842
+ constructor(item2, relativePoint) {
35827
35843
  super();
35828
- this.item = item;
35844
+ this.item = item2;
35829
35845
  this.relativePoint = relativePoint;
35830
35846
  if (relativePoint.y <= 0) {
35831
35847
  this.edge = "top";
35832
- } else if (relativePoint.y >= item.getMbr().getHeight()) {
35848
+ } else if (relativePoint.y >= item2.getMbr().getHeight()) {
35833
35849
  this.edge = "bottom";
35834
35850
  } else if (relativePoint.x <= 0) {
35835
35851
  this.edge = "left";
35836
- } else if (relativePoint.x >= item.getMbr().getWidth()) {
35852
+ } else if (relativePoint.x >= item2.getMbr().getWidth()) {
35837
35853
  this.edge = "right";
35838
35854
  }
35839
35855
  this.recalculatePoint();
@@ -35864,16 +35880,16 @@ class FixedConnectorPoint extends Point {
35864
35880
  tangent;
35865
35881
  segmentIndex;
35866
35882
  pointType = "FixedConnector";
35867
- constructor(item, tangent, segmentIndex) {
35883
+ constructor(item2, tangent, segmentIndex) {
35868
35884
  super();
35869
- this.item = item;
35885
+ this.item = item2;
35870
35886
  this.tangent = tangent;
35871
35887
  this.segmentIndex = segmentIndex;
35872
35888
  this.recalculatePoint();
35873
35889
  }
35874
35890
  recalculatePoint() {
35875
- const item = this.item;
35876
- const segments = item.getPaths().getSegments();
35891
+ const item2 = this.item;
35892
+ const segments = item2.getPaths().getSegments();
35877
35893
  const segment = segments.length > this.segmentIndex ? segments[this.segmentIndex] : segments[segments.length - 1];
35878
35894
  const point5 = segment.getPoint(this.tangent);
35879
35895
  this.x = point5.x;
@@ -35898,38 +35914,38 @@ function getControlPoint(data, findItem2) {
35898
35914
  if (data.pointType === "Board") {
35899
35915
  return new BoardPoint(Math.round(data.x), Math.round(data.y));
35900
35916
  } else {
35901
- const item = findItem2(data.itemId);
35902
- if (!item) {
35917
+ const item2 = findItem2(data.itemId);
35918
+ if (!item2) {
35903
35919
  console.warn(`getControlPoint(): item not found for ${data.itemId}`);
35904
35920
  return new BoardPoint(0, 0);
35905
35921
  }
35906
35922
  switch (data.pointType) {
35907
35923
  case "FixedConnector":
35908
- if (item instanceof Connector2) {
35909
- return new FixedConnectorPoint(item, data.tangent, data.segment);
35924
+ if (item2 instanceof Connector2) {
35925
+ return new FixedConnectorPoint(item2, data.tangent, data.segment);
35910
35926
  } else {
35911
35927
  throw new Error(`getControlPoint(): item must be a connector`);
35912
35928
  }
35913
35929
  case "Floating":
35914
- return new FloatingPoint(item, new Point(data.relativeX, data.relativeY));
35930
+ return new FloatingPoint(item2, new Point(data.relativeX, data.relativeY));
35915
35931
  case "Fixed":
35916
- return new FixedPoint(item, new Point(data.relativeX, data.relativeY));
35932
+ return new FixedPoint(item2, new Point(data.relativeX, data.relativeY));
35917
35933
  }
35918
35934
  }
35919
35935
  }
35920
- function toRelativePoint(point5, item) {
35921
- const matrix = item.transformation?.matrix || new Matrix2;
35936
+ function toRelativePoint(point5, item2) {
35937
+ const matrix = item2.transformation?.matrix || new Matrix2;
35922
35938
  const inverse = matrix.getInverse();
35923
35939
  point5 = point5.copy();
35924
35940
  point5.transform(inverse);
35925
35941
  return point5;
35926
35942
  }
35927
- function fromRelativePoint(relativePoint, item, edge) {
35928
- const matrix = item.transformation?.matrix.copy() || new Matrix2;
35943
+ function fromRelativePoint(relativePoint, item2, edge) {
35944
+ const matrix = item2.transformation?.matrix.copy() || new Matrix2;
35929
35945
  const point5 = relativePoint.copy();
35930
35946
  point5.transform(matrix);
35931
- if (item instanceof RichText || item instanceof AINode) {
35932
- const itemMbr = item.getMbr();
35947
+ if (item2 instanceof RichText || item2 instanceof AINode) {
35948
+ const itemMbr = item2.getMbr();
35933
35949
  const { x: centerX, y: centerY } = itemMbr.getCenter();
35934
35950
  switch (edge) {
35935
35951
  case "left":
@@ -35941,7 +35957,7 @@ function fromRelativePoint(relativePoint, item, edge) {
35941
35957
  case "bottom":
35942
35958
  return new Point(centerX, itemMbr.bottom);
35943
35959
  default:
35944
- return item.getMbr().getClosestEdgeCenterPoint(point5);
35960
+ return item2.getMbr().getClosestEdgeCenterPoint(point5);
35945
35961
  }
35946
35962
  }
35947
35963
  return point5;
@@ -37290,7 +37306,7 @@ class Connector2 extends BaseItem {
37290
37306
  return this;
37291
37307
  }
37292
37308
  getConnectorById(items, connectorId) {
37293
- return items.find((item) => item instanceof Connector2 && item.getId() === connectorId);
37309
+ return items.find((item2) => item2 instanceof Connector2 && item2.getId() === connectorId);
37294
37310
  }
37295
37311
  updateTitle() {
37296
37312
  const selection = this.board.selection;
@@ -39927,8 +39943,8 @@ async function exportBoardSnapshot({
39927
39943
  context.matrix.applyToContext(context.ctx);
39928
39944
  const { left, top, right, bottom } = selection;
39929
39945
  const inView = board.items.index.getRectsEnclosedOrCrossed(left, top, right, bottom);
39930
- for (const item of inView) {
39931
- item.render(context);
39946
+ for (const item2 of inView) {
39947
+ item2.render(context);
39932
39948
  }
39933
39949
  const blob = await offscreenCanvas.convertToBlob({ type: "image/png" });
39934
39950
  const dataUrl = await convertBlobToDataUrl(blob);
@@ -40126,7 +40142,7 @@ class Frame2 extends BaseItem {
40126
40142
  return this.id;
40127
40143
  }
40128
40144
  getChildrenIds() {
40129
- return this.index?.list().map((item) => item.getId()) || [];
40145
+ return this.index?.list().map((item2) => item2.getId()) || [];
40130
40146
  }
40131
40147
  updateMbr() {
40132
40148
  const rect = this.path.getMbr().copy();
@@ -40361,11 +40377,11 @@ class Frame2 extends BaseItem {
40361
40377
  }
40362
40378
  });
40363
40379
  const currMbr = this.getMbr();
40364
- this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item) => {
40365
- if (item.parent === "Board") {
40366
- if (this.handleNesting(item)) {
40367
- this.applyAddChildren([item.getId()]);
40368
- item.parent = this.getId();
40380
+ this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).forEach((item2) => {
40381
+ if (item2.parent === "Board") {
40382
+ if (this.handleNesting(item2)) {
40383
+ this.applyAddChildren([item2.getId()]);
40384
+ item2.parent = this.getId();
40369
40385
  }
40370
40386
  }
40371
40387
  });
@@ -42563,9 +42579,9 @@ class Group extends BaseItem {
42563
42579
  if (data.children) {
42564
42580
  data.children.forEach((childId) => {
42565
42581
  this.applyAddChild(childId);
42566
- const item = this.board.items.getById(childId);
42567
- if (item) {
42568
- item.parent = this.getId();
42582
+ const item2 = this.board.items.getById(childId);
42583
+ if (item2) {
42584
+ item2.parent = this.getId();
42569
42585
  }
42570
42586
  });
42571
42587
  }
@@ -42595,11 +42611,11 @@ class Group extends BaseItem {
42595
42611
  let right = Number.MIN_SAFE_INTEGER;
42596
42612
  let bottom = Number.MIN_SAFE_INTEGER;
42597
42613
  const mbrs = this.children.flatMap((childId) => {
42598
- const item = this.board.items.getById(childId);
42599
- if (!item) {
42614
+ const item2 = this.board.items.getById(childId);
42615
+ if (!item2) {
42600
42616
  return [];
42601
42617
  }
42602
- const mbr2 = item.getMbr();
42618
+ const mbr2 = item2.getMbr();
42603
42619
  if (!mbr2) {
42604
42620
  return [];
42605
42621
  }
@@ -42634,7 +42650,7 @@ class Group extends BaseItem {
42634
42650
  return this.children;
42635
42651
  }
42636
42652
  getChildren() {
42637
- return this.children.map((itemId) => this.board.items.getById(itemId)).filter((item) => item !== undefined);
42653
+ return this.children.map((itemId) => this.board.items.getById(itemId)).filter((item2) => item2 !== undefined);
42638
42654
  }
42639
42655
  updateMbr() {
42640
42656
  const rect = this.getMbr();
@@ -42647,9 +42663,9 @@ class Group extends BaseItem {
42647
42663
  setChildren(items) {
42648
42664
  items.forEach((itemId) => {
42649
42665
  this.addChild(itemId);
42650
- const item = this.board.items.getById(itemId);
42651
- if (item) {
42652
- item.parent = this.getId();
42666
+ const item2 = this.board.items.getById(itemId);
42667
+ if (item2) {
42668
+ item2.parent = this.getId();
42653
42669
  }
42654
42670
  });
42655
42671
  this.updateMbr();
@@ -42657,9 +42673,9 @@ class Group extends BaseItem {
42657
42673
  removeChildren() {
42658
42674
  this.children.forEach((itemId) => {
42659
42675
  this.removeChild(itemId);
42660
- const item = this.board.items.getById(itemId);
42661
- if (item) {
42662
- item.parent = this.parent;
42676
+ const item2 = this.board.items.getById(itemId);
42677
+ if (item2) {
42678
+ item2.parent = this.parent;
42663
42679
  }
42664
42680
  });
42665
42681
  this.updateMbr();
@@ -42992,16 +43008,16 @@ class Anchor extends Mbr {
42992
43008
  }
42993
43009
  }
42994
43010
  // src/Items/Connector/ConnectorSnap.ts
42995
- function getFixedPoint(item, point5) {
42996
- if (item instanceof Connector2) {
42997
- const nearestSegmentData = item.getPaths().getNearestEdgeAndPointTo(point5);
43011
+ function getFixedPoint(item2, point5) {
43012
+ if (item2 instanceof Connector2) {
43013
+ const nearestSegmentData = item2.getPaths().getNearestEdgeAndPointTo(point5);
42998
43014
  const segment = nearestSegmentData.segment;
42999
43015
  const index2 = nearestSegmentData.index;
43000
43016
  const tangent = segment.getParameter(point5);
43001
- return new FixedConnectorPoint(item, tangent, index2);
43017
+ return new FixedConnectorPoint(item2, tangent, index2);
43002
43018
  } else {
43003
- const relativePoint = toRelativePoint(point5, item);
43004
- return new FixedPoint(item, relativePoint);
43019
+ const relativePoint = toRelativePoint(point5, item2);
43020
+ return new FixedPoint(item2, relativePoint);
43005
43021
  }
43006
43022
  }
43007
43023
 
@@ -43054,20 +43070,20 @@ class ConnectorSnap {
43054
43070
  }
43055
43071
  this.setSnap();
43056
43072
  const pointer = this.board.pointer.point;
43057
- const { anchor, item, point: point5 } = this.snap;
43058
- if (!item) {
43073
+ const { anchor, item: item2, point: point5 } = this.snap;
43074
+ if (!item2) {
43059
43075
  const pointer2 = this.board.pointer.point;
43060
43076
  this.controlPoint = new BoardPoint(pointer2.x, pointer2.y);
43061
43077
  } else if (anchor) {
43062
- this.controlPoint = getFixedPoint(item, anchor.getCenter());
43078
+ this.controlPoint = getFixedPoint(item2, anchor.getCenter());
43063
43079
  } else if (point5) {
43064
- const nearest2 = item.getNearestEdgePointTo(pointer);
43065
- this.controlPoint = getFixedPoint(item, nearest2);
43080
+ const nearest2 = item2.getNearestEdgePointTo(pointer);
43081
+ this.controlPoint = getFixedPoint(item2, nearest2);
43066
43082
  } else {
43067
43083
  if (this.hover.isTimeoutElapsed) {
43068
- this.controlPoint = getFixedPoint(item, pointer);
43084
+ this.controlPoint = getFixedPoint(item2, pointer);
43069
43085
  } else {
43070
- this.controlPoint = getFixedPoint(item, pointer);
43086
+ this.controlPoint = getFixedPoint(item2, pointer);
43071
43087
  }
43072
43088
  }
43073
43089
  }
@@ -43128,23 +43144,23 @@ class ConnectorSnap {
43128
43144
  }
43129
43145
  return nearest;
43130
43146
  }
43131
- getClosestPointOnItem(item, position4) {
43132
- const nearestEdgePoint = item.getNearestEdgePointTo(position4);
43133
- return getFixedPoint(item, nearestEdgePoint);
43147
+ getClosestPointOnItem(item2, position4) {
43148
+ const nearestEdgePoint = item2.getNearestEdgePointTo(position4);
43149
+ return getFixedPoint(item2, nearestEdgePoint);
43134
43150
  }
43135
- isNearBorder(item) {
43136
- if (!item) {
43151
+ isNearBorder(item2) {
43152
+ if (!item2) {
43137
43153
  return false;
43138
43154
  }
43139
43155
  const pointer = this.board.pointer.point;
43140
- const point5 = item.getNearestEdgePointTo(pointer);
43156
+ const point5 = item2.getNearestEdgePointTo(pointer);
43141
43157
  const distance = pointer.getDistance(point5);
43142
43158
  return distance < this.distance.border / this.board.camera.getScale();
43143
43159
  }
43144
43160
  setSnap() {
43145
- const item = this.snap.item;
43146
- const path2 = item && "getPath" in item ? item?.getPath() : null;
43147
- if (!item || !path2) {
43161
+ const item2 = this.snap.item;
43162
+ const path2 = item2 && "getPath" in item2 ? item2?.getPath() : null;
43163
+ if (!item2 || !path2) {
43148
43164
  this.snap.path = null;
43149
43165
  this.snap.anchors = [];
43150
43166
  this.snap.anchor = null;
@@ -43155,11 +43171,11 @@ class ConnectorSnap {
43155
43171
  if (this.snap.item === this.hover.item && !this.hover.isTimeoutElapsed) {
43156
43172
  path2.setBackgroundColor(this.color.snapBackgroundHighlight);
43157
43173
  }
43158
- this.setAnchors(item);
43174
+ this.setAnchors(item2);
43159
43175
  }
43160
43176
  }
43161
- setAnchors(item) {
43162
- const points = item.getSnapAnchorPoints();
43177
+ setAnchors(item2) {
43178
+ const points = item2.getSnapAnchorPoints();
43163
43179
  if (!points) {
43164
43180
  return;
43165
43181
  }
@@ -43193,10 +43209,10 @@ class ConnectorSnap {
43193
43209
  }
43194
43210
  setPoint() {
43195
43211
  const pointer = this.board.pointer.point;
43196
- const { item, anchor } = this.snap;
43197
- if (item) {
43212
+ const { item: item2, anchor } = this.snap;
43213
+ if (item2) {
43198
43214
  if (!anchor) {
43199
- const point5 = item.getNearestEdgePointTo(pointer);
43215
+ const point5 = item2.getNearestEdgePointTo(pointer);
43200
43216
  if (point5.getDistance(pointer) < this.distance.border || !this.hover.isTimeoutElapsed) {
43201
43217
  this.snap.point = new Anchor(point5.x, point5.y, 5, this.color.pointBorder, this.color.pointBackground, 1);
43202
43218
  } else {
@@ -43569,12 +43585,12 @@ class NestingHighlighter extends Tool {
43569
43585
  this.toHighlight.push({ groupItem, children: array });
43570
43586
  }
43571
43587
  }
43572
- addSingleItem(item) {
43573
- this.toHighlight.push({ children: [item] });
43588
+ addSingleItem(item2) {
43589
+ this.toHighlight.push({ children: [item2] });
43574
43590
  }
43575
- remove(item) {
43591
+ remove(item2) {
43576
43592
  this.toHighlight.forEach((group) => {
43577
- group.children = group.children.filter((child) => child !== item);
43593
+ group.children = group.children.filter((child) => child !== item2);
43578
43594
  });
43579
43595
  this.toHighlight = this.toHighlight.filter((group) => group.children.length > 0);
43580
43596
  }
@@ -43641,7 +43657,7 @@ class AddFrame extends BoardTool {
43641
43657
  this.mbr.borderColor = "blue";
43642
43658
  this.nestingHighlighter.clear();
43643
43659
  const enclosedOrCrossed = this.board.items.getEnclosedOrCrossed(this.mbr.left, this.mbr.top, this.mbr.right, this.mbr.bottom);
43644
- const inside = enclosedOrCrossed.filter((item) => !(item instanceof Frame2) && item.parent === "Board" && this.mbr.isInside(item.getMbr().getCenter()));
43660
+ const inside = enclosedOrCrossed.filter((item2) => !(item2 instanceof Frame2) && item2.parent === "Board" && this.mbr.isInside(item2.getMbr().getCenter()));
43645
43661
  this.nestingHighlighter.add(this.frame, inside);
43646
43662
  this.initTransformation();
43647
43663
  this.board.tools.publish();
@@ -43662,7 +43678,7 @@ class AddFrame extends BoardTool {
43662
43678
  localStorage.setItem("lastFrameScale", JSON.stringify(this.frame.transformation.getScale()));
43663
43679
  }
43664
43680
  const currMbr = this.frame.getMbr();
43665
- const frameChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.frame.handleNesting(item));
43681
+ const frameChildren = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item2) => item2.parent === "Board").filter((item2) => this.frame.handleNesting(item2));
43666
43682
  this.applyAddChildren(frameChildren);
43667
43683
  if (this.shape !== "Custom") {
43668
43684
  this.applyCanChangeRatio(false);
@@ -43678,7 +43694,7 @@ class AddFrame extends BoardTool {
43678
43694
  return true;
43679
43695
  }
43680
43696
  addNextTo() {
43681
- const framesInView = this.board.items.getItemsInView().filter((item) => item instanceof Frame2);
43697
+ const framesInView = this.board.items.getItemsInView().filter((item2) => item2 instanceof Frame2);
43682
43698
  if (framesInView.length === 0) {
43683
43699
  if (this.shape === "Custom") {
43684
43700
  const { x, y } = this.frame.getLastFrameScale();
@@ -43716,7 +43732,7 @@ class AddFrame extends BoardTool {
43716
43732
  this.board.camera.viewRectangle(this.frame.getMbr());
43717
43733
  }
43718
43734
  const frameMbr = this.frame.getMbr();
43719
- this.board.items.getEnclosedOrCrossed(frameMbr.left, frameMbr.top, frameMbr.right, frameMbr.bottom).filter((item) => item.parent === "Board").filter((item) => this.frame.handleNesting(item)).forEach((item) => this.applyAddChildren([item]));
43735
+ this.board.items.getEnclosedOrCrossed(frameMbr.left, frameMbr.top, frameMbr.right, frameMbr.bottom).filter((item2) => item2.parent === "Board").filter((item2) => this.frame.handleNesting(item2)).forEach((item2) => this.applyAddChildren([item2]));
43720
43736
  const frame = this.board.add(this.frame);
43721
43737
  frame.text.editor.moveCursorToEndOfTheText();
43722
43738
  this.nestingHighlighter.clear();
@@ -44221,13 +44237,13 @@ class Eraser extends BoardTool {
44221
44237
  }
44222
44238
  removeUnderPointOrLine() {
44223
44239
  const segments = this.drawing.getLines();
44224
- const items = this.board.items.getUnderPointer(this.strokeWidth / 2).filter((item) => {
44225
- return item.itemType === "Drawing" && item.getLines().find((line) => {
44226
- return line.getDistance(this.board.pointer.point) <= item.strokeWidth / 2 + this.strokeWidth / 2;
44240
+ const items = this.board.items.getUnderPointer(this.strokeWidth / 2).filter((item2) => {
44241
+ return item2.itemType === "Drawing" && item2.getLines().find((line) => {
44242
+ return line.getDistance(this.board.pointer.point) <= item2.strokeWidth / 2 + this.strokeWidth / 2;
44227
44243
  });
44228
44244
  });
44229
- items.push(...this.board.items.getEnclosedOrCrossed(this.drawing.points[0].x, this.drawing.points[0].y, this.board.pointer.point.x, this.board.pointer.point.y).filter((item) => {
44230
- return item.itemType === "Drawing" && item.getLines().some((line) => {
44245
+ items.push(...this.board.items.getEnclosedOrCrossed(this.drawing.points[0].x, this.drawing.points[0].y, this.board.pointer.point.x, this.board.pointer.point.y).filter((item2) => {
44246
+ return item2.itemType === "Drawing" && item2.getLines().some((line) => {
44231
44247
  return segments.some((segment) => segment.hasIntersectionPoint(line));
44232
44248
  });
44233
44249
  }));
@@ -44679,20 +44695,20 @@ function createCanvasDrawer(board) {
44679
44695
  context.ctx.setTransform(board2.camera.getMatrix().scaleX, 0, 0, board2.camera.getMatrix().scaleY, 0, 0);
44680
44696
  context.matrix.applyToContext(context.ctx);
44681
44697
  const items = Object.keys(translation).map((id) => {
44682
- const item = board2.items.getById(id);
44683
- if (item) {
44684
- if (item.itemType !== "Frame") {
44685
- return item;
44698
+ const item2 = board2.items.getById(id);
44699
+ if (item2) {
44700
+ if (item2.itemType !== "Frame") {
44701
+ return item2;
44686
44702
  }
44687
- item.render(context);
44688
- return item;
44703
+ item2.render(context);
44704
+ return item2;
44689
44705
  }
44690
44706
  return;
44691
- }).filter((item) => !!item);
44692
- items.forEach((item) => {
44693
- if (item.itemType !== "Frame") {
44694
- item.render(context);
44695
- board2.selection.renderItemMbr(context, item, board2.camera.getMatrix().scaleX);
44707
+ }).filter((item2) => !!item2);
44708
+ items.forEach((item2) => {
44709
+ if (item2.itemType !== "Frame") {
44710
+ item2.render(context);
44711
+ board2.selection.renderItemMbr(context, item2, board2.camera.getMatrix().scaleX);
44696
44712
  }
44697
44713
  });
44698
44714
  return { canvas: container, items };
@@ -44753,10 +44769,10 @@ function createCanvasDrawer(board) {
44753
44769
  if (lastTranslationKeys) {
44754
44770
  board.selection.shouldPublish = false;
44755
44771
  lastTranslationKeys.forEach((id) => {
44756
- const item = board.items.getById(id);
44757
- if (item) {
44758
- item.transformationRenderBlock = undefined;
44759
- item.subject.publish(item);
44772
+ const item2 = board.items.getById(id);
44773
+ if (item2) {
44774
+ item2.transformationRenderBlock = undefined;
44775
+ item2.subject.publish(item2);
44760
44776
  }
44761
44777
  });
44762
44778
  lastTranslationKeys = undefined;
@@ -44788,9 +44804,9 @@ function createCanvasDrawer(board) {
44788
44804
  lastCreatedCanvas = cnvs;
44789
44805
  lastTranslationKeys = Object.keys(translation);
44790
44806
  lastTranslationKeys.forEach((id) => {
44791
- const item = board.items.getById(id);
44792
- if (item) {
44793
- item.transformationRenderBlock = true;
44807
+ const item2 = board.items.getById(id);
44808
+ if (item2) {
44809
+ item2.transformationRenderBlock = true;
44794
44810
  }
44795
44811
  });
44796
44812
  board.selection.transformationRenderBlock = true;
@@ -44800,14 +44816,14 @@ function createCanvasDrawer(board) {
44800
44816
  }
44801
44817
  function countSumMbr(translation) {
44802
44818
  return Object.keys(translation).reduce((mbr, id) => {
44803
- const item = board.items.getById(id);
44804
- if (item) {
44819
+ const item2 = board.items.getById(id);
44820
+ if (item2) {
44805
44821
  if (!mbr) {
44806
- mbr = item.getMbr();
44822
+ mbr = item2.getMbr();
44807
44823
  } else {
44808
- mbr.combine(item.getMbr());
44809
- if (item.itemType === "Frame") {
44810
- mbr.combine(item.getRichText().getMbr());
44824
+ mbr.combine(item2.getMbr());
44825
+ if (item2.itemType === "Frame") {
44826
+ mbr.combine(item2.getRichText().getMbr());
44811
44827
  }
44812
44828
  }
44813
44829
  }
@@ -44838,8 +44854,8 @@ function createCanvasDrawer(board) {
44838
44854
  }
44839
44855
  function highlightNesting() {
44840
44856
  const container = getLastCreatedCanvas();
44841
- const drawnItemsMap = drawnItems?.reduce((acc, item) => {
44842
- acc.set(item.getId(), { item, mbr: item.getMbr() });
44857
+ const drawnItemsMap = drawnItems?.reduce((acc, item2) => {
44858
+ acc.set(item2.getId(), { item: item2, mbr: item2.getMbr() });
44843
44859
  return acc;
44844
44860
  }, new Map);
44845
44861
  if (!container || !drawnItems) {
@@ -44874,11 +44890,11 @@ function createCanvasDrawer(board) {
44874
44890
  mbr.transform(currMatrix);
44875
44891
  });
44876
44892
  groups.forEach((group) => {
44877
- drawnItemsMap?.forEach(({ mbr, item }, key) => {
44878
- if ("canBeNested" in item && !item.canBeNested) {
44893
+ drawnItemsMap?.forEach(({ mbr, item: item2 }, key) => {
44894
+ if ("canBeNested" in item2 && !item2.canBeNested) {
44879
44895
  return;
44880
44896
  }
44881
- if (lastCreatedCanvas && (!drawnItemsMap.get(group.getId()) || item.parent !== group.getId()) && group.handleNesting(mbr)) {
44897
+ if (lastCreatedCanvas && (!drawnItemsMap.get(group.getId()) || item2.parent !== group.getId()) && group.handleNesting(mbr)) {
44882
44898
  const div = createBorderDivForItem(mbr, lastCreatedCanvas);
44883
44899
  removeHighlighted(key);
44884
44900
  highlightedDivs.set(key, div);
@@ -44939,10 +44955,10 @@ function createCanvasDrawer(board) {
44939
44955
  }
44940
44956
 
44941
44957
  // src/Selection/QuickAddButtons/quickAddHelpers.ts
44942
- function getControlPointData(item, index2, isRichText = false) {
44943
- const itemScale = isRichText ? { x: 1, y: 1 } : item.transformation.getScale();
44944
- const width2 = item.getPathMbr().getWidth();
44945
- let height3 = item.getPathMbr().getHeight();
44958
+ function getControlPointData(item2, index2, isRichText = false) {
44959
+ const itemScale = isRichText ? { x: 1, y: 1 } : item2.transformation.getScale();
44960
+ const width2 = item2.getPathMbr().getWidth();
44961
+ let height3 = item2.getPathMbr().getHeight();
44946
44962
  const adjMapScaled = {
44947
44963
  0: { x: 0, y: height3 / 2 / itemScale.y },
44948
44964
  1: {
@@ -44957,7 +44973,7 @@ function getControlPointData(item, index2, isRichText = false) {
44957
44973
  };
44958
44974
  return {
44959
44975
  pointType: "Fixed",
44960
- itemId: item.getId(),
44976
+ itemId: item2.getId(),
44961
44977
  relativeX: adjMapScaled[index2].x,
44962
44978
  relativeY: adjMapScaled[index2].y
44963
44979
  };
@@ -45092,10 +45108,10 @@ function getQuickAddButtons(selection, board) {
45092
45108
  let newHeight = height3;
45093
45109
  let itemData;
45094
45110
  if (selectedItem.itemType === "AINode" || selectedItem.itemType === "RichText") {
45095
- const item = selectedItem.itemType === "AINode" ? createAINode2(board, index2, selectedItem.getId()) : createRichText2(board);
45096
- newWidth = item.getMbr().getWidth();
45097
- newHeight = item.getMbr().getHeight();
45098
- itemData = item.serialize();
45111
+ const item2 = selectedItem.itemType === "AINode" ? createAINode2(board, index2, selectedItem.getId()) : createRichText2(board);
45112
+ newWidth = item2.getMbr().getWidth();
45113
+ newHeight = item2.getMbr().getHeight();
45114
+ itemData = item2.serialize();
45099
45115
  const { minX, minY, maxY, maxX } = offsets;
45100
45116
  offsetX = Math.min(offsetX, maxX);
45101
45117
  offsetX = Math.max(offsetX, minX);
@@ -45128,7 +45144,7 @@ function getQuickAddButtons(selection, board) {
45128
45144
  }
45129
45145
  const newMbr = new Mbr(newItemData.transformation?.translateX, newItemData.transformation?.translateY, (newItemData.transformation?.translateX || 0) + newWidth, (newItemData.transformation?.translateY || 0) + newHeight);
45130
45146
  let step = 1;
45131
- while (board.index.getItemsEnclosedOrCrossed(newMbr.left, newMbr.top, newMbr.right, newMbr.bottom).filter((item) => item.itemType !== "Connector").length > 0) {
45147
+ while (board.index.getItemsEnclosedOrCrossed(newMbr.left, newMbr.top, newMbr.right, newMbr.bottom).filter((item2) => item2.itemType !== "Connector").length > 0) {
45132
45148
  const xDirection = step % 2 === 0 ? -1 : 1;
45133
45149
  const yDirection = newItemData.itemType === "AINode" ? -1 : xDirection;
45134
45150
  newMbr.transform(new Matrix2(iterAdjustment[index2].x * xDirection * step, iterAdjustment[index2].y * yDirection * (newItemData.itemType === "AINode" ? 1 : step)));
@@ -45261,7 +45277,7 @@ function getQuickAddButtons(selection, board) {
45261
45277
  clear();
45262
45278
  return;
45263
45279
  }
45264
- const { positions, item } = position4;
45280
+ const { positions, item: item2 } = position4;
45265
45281
  const cameraMatrix = board.camera.getMatrix();
45266
45282
  const cameraMbr = board.camera.getMbr();
45267
45283
  const positionAdjustments = {
@@ -45289,7 +45305,7 @@ function getQuickAddButtons(selection, board) {
45289
45305
  };
45290
45306
  const button = document.createElement("button");
45291
45307
  button.classList.add("microboard-quickAddButton");
45292
- if (item.itemType === "AINode" && index2 === 2) {
45308
+ if (item2.itemType === "AINode" && index2 === 2) {
45293
45309
  button.classList.add("microboard-invisible");
45294
45310
  }
45295
45311
  button.classList.add(`microboard-${adjustment.rotate}`);
@@ -45305,7 +45321,7 @@ function getQuickAddButtons(selection, board) {
45305
45321
  clearTimeout(timeoutId);
45306
45322
  }
45307
45323
  if (button.isMouseDown) {
45308
- board.tools.addConnector(true, item, pos);
45324
+ board.tools.addConnector(true, item2, pos);
45309
45325
  } else {
45310
45326
  quickAddItems = undefined;
45311
45327
  selection.subject.publish(selection);
@@ -45412,11 +45428,11 @@ class AlignmentHelper {
45412
45428
  return baseThickness / (zoom / 100);
45413
45429
  }
45414
45430
  combineMBRs(items) {
45415
- return items.reduce((acc, item, i) => {
45431
+ return items.reduce((acc, item2, i) => {
45416
45432
  if (i === 0) {
45417
45433
  return acc;
45418
45434
  }
45419
- const itemMbr = item.getPathMbr();
45435
+ const itemMbr = item2.getPathMbr();
45420
45436
  return acc.combine(itemMbr);
45421
45437
  }, items[0].getMbr());
45422
45438
  }
@@ -45430,7 +45446,7 @@ class AlignmentHelper {
45430
45446
  const scale = this.board.camera.getScale();
45431
45447
  const dynamicAlignThreshold = Math.min(this.alignThreshold / scale, 8);
45432
45448
  const childrenIds = "index" in movingItem && movingItem.index ? movingItem.getChildrenIds() : [];
45433
- const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item) => !excludeItems.includes(item), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item) => Array.isArray(movingItem) ? !movingItem.includes(item) : true);
45449
+ const nearbyItems = this.canvasDrawer.getLastCreatedCanvas() ? this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (item2) => !excludeItems.includes(item2), Math.ceil(cameraWidth)) : this.spatialIndex.getNearestTo(movingMBR.getCenter(), 20, (otherItem) => otherItem !== movingMBR && otherItem.itemType !== "Connector" && otherItem.itemType !== "Drawing" && otherItem.isInView(camera) && !childrenIds.includes(otherItem.getId()), Math.ceil(cameraWidth)).filter((item2) => Array.isArray(movingItem) ? !movingItem.includes(item2) : true);
45434
45450
  const verticalAlignments = new Map;
45435
45451
  const horizontalAlignments = new Map;
45436
45452
  const addVerticalAlignment = (x, minY, maxY) => {
@@ -45451,11 +45467,11 @@ class AlignmentHelper {
45451
45467
  horizontalAlignments.set(y, { minX, maxX });
45452
45468
  }
45453
45469
  };
45454
- nearbyItems.forEach((item) => {
45455
- if (item === movingItem || item.itemType === "Comment") {
45470
+ nearbyItems.forEach((item2) => {
45471
+ if (item2 === movingItem || item2.itemType === "Comment") {
45456
45472
  return;
45457
45473
  }
45458
- const itemMbr = item.itemType === "Shape" ? item.getPath().getMbr() : item.getMbr();
45474
+ const itemMbr = item2.itemType === "Shape" ? item2.getPath().getMbr() : item2.getMbr();
45459
45475
  const centerXMoving = (movingMBR.left + movingMBR.right) / 2;
45460
45476
  const centerXItem = (itemMbr.left + itemMbr.right) / 2;
45461
45477
  const centerYMoving = (movingMBR.top + movingMBR.bottom) / 2;
@@ -45722,20 +45738,20 @@ class AlignmentHelper {
45722
45738
  }
45723
45739
  return false;
45724
45740
  }
45725
- translateItems(item, x, y, timeStamp) {
45741
+ translateItems(item2, x, y, timeStamp) {
45726
45742
  if (this.canvasDrawer.getLastCreatedCanvas()) {
45727
45743
  return;
45728
45744
  }
45729
- if (Array.isArray(item)) {
45745
+ if (Array.isArray(item2)) {
45730
45746
  const translation = this.board.selection.getManyItemsTranslation(x, y);
45731
45747
  this.board.selection.transformMany(translation, timeStamp);
45732
45748
  return;
45733
45749
  }
45734
- if (item.itemType === "Frame") {
45750
+ if (item2.itemType === "Frame") {
45735
45751
  const translation = this.board.selection.getManyItemsTranslation(x, y);
45736
45752
  this.board.selection.transformMany(translation, timeStamp);
45737
45753
  } else {
45738
- const id = item.getId();
45754
+ const id = item2.getId();
45739
45755
  const transformMap = {};
45740
45756
  transformMap[id] = {
45741
45757
  class: "Transformation",
@@ -45863,12 +45879,12 @@ class Select extends Tool {
45863
45879
  this.debounceUpd.setFalse();
45864
45880
  this.snapLines = { verticalLines: [], horizontalLines: [] };
45865
45881
  }
45866
- handleSnapping(item) {
45882
+ handleSnapping(item2) {
45867
45883
  if (this.board.keyboard.isShift) {
45868
45884
  return false;
45869
45885
  }
45870
- const increasedSnapThreshold = Array.isArray(item) ? 40 : 35;
45871
- this.isSnapped = this.alignmentHelper.snapToClosestLine(item, this.snapLines, this.beginTimeStamp, this.board.pointer.point);
45886
+ const increasedSnapThreshold = Array.isArray(item2) ? 40 : 35;
45887
+ this.isSnapped = this.alignmentHelper.snapToClosestLine(item2, this.snapLines, this.beginTimeStamp, this.board.pointer.point);
45872
45888
  if (this.isSnapped) {
45873
45889
  if (!this.snapCursorPos) {
45874
45890
  this.snapCursorPos = new Point(this.board.pointer.point.x, this.board.pointer.point.y);
@@ -45878,10 +45894,10 @@ class Select extends Tool {
45878
45894
  if ((cursorDiffX > increasedSnapThreshold || cursorDiffY > increasedSnapThreshold) && this.initialCursorPos) {
45879
45895
  this.isSnapped = false;
45880
45896
  this.snapCursorPos = null;
45881
- const itemCenter = Array.isArray(item) ? this.alignmentHelper.combineMBRs(item).getCenter() : item.getMbr().getCenter();
45897
+ const itemCenter = Array.isArray(item2) ? this.alignmentHelper.combineMBRs(item2).getCenter() : item2.getMbr().getCenter();
45882
45898
  const translateX = this.board.pointer.point.x - this.initialCursorPos.x - itemCenter.x;
45883
45899
  const translateY = this.board.pointer.point.y - this.initialCursorPos.y - itemCenter.y;
45884
- this.alignmentHelper.translateItems(item, translateX, translateY, this.beginTimeStamp);
45900
+ this.alignmentHelper.translateItems(item2, translateX, translateY, this.beginTimeStamp);
45885
45901
  }
45886
45902
  }
45887
45903
  return false;
@@ -45931,10 +45947,10 @@ class Select extends Tool {
45931
45947
  angleDiff = angleDiff < 0 ? angleDiff + 360 : angleDiff;
45932
45948
  return Math.min(angleDiff, 360 - angleDiff);
45933
45949
  }
45934
- handleShiftGuidelines(item, mousePosition) {
45935
- if (item) {
45950
+ handleShiftGuidelines(item2, mousePosition) {
45951
+ if (item2) {
45936
45952
  if (!this.originalCenter) {
45937
- this.originalCenter = Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().copy() : item.getMbr().getCenter().copy();
45953
+ this.originalCenter = Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().copy() : item2.getMbr().getCenter().copy();
45938
45954
  this.guidelines = this.alignmentHelper.generateGuidelines(this.originalCenter).lines;
45939
45955
  }
45940
45956
  this.mainLine = new Line(this.originalCenter, mousePosition);
@@ -45955,13 +45971,13 @@ class Select extends Tool {
45955
45971
  const newEndX = this.originalCenter.x + snapDirectionX * mainLineLength;
45956
45972
  const newEndY = this.originalCenter.y + snapDirectionY * mainLineLength;
45957
45973
  const threshold = Infinity;
45958
- const translateX = newEndX - (Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().x : item.getMbr().getCenter().x);
45959
- const translateY = newEndY - (Array.isArray(item) ? this.board.selection.getMbr()?.getCenter().y : item.getMbr().getCenter().y);
45960
- if (Array.isArray(item)) {
45974
+ const translateX = newEndX - (Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().x : item2.getMbr().getCenter().x);
45975
+ const translateY = newEndY - (Array.isArray(item2) ? this.board.selection.getMbr()?.getCenter().y : item2.getMbr().getCenter().y);
45976
+ if (Array.isArray(item2)) {
45961
45977
  const translation = this.board.selection.getManyItemsTranslation(translateX, translateY);
45962
45978
  this.board.selection.transformMany(translation, this.beginTimeStamp);
45963
45979
  } else {
45964
- item.transformation.translateBy(translateX, translateY, this.beginTimeStamp);
45980
+ item2.transformation.translateBy(translateX, translateY, this.beginTimeStamp);
45965
45981
  }
45966
45982
  }
45967
45983
  }
@@ -46004,7 +46020,7 @@ class Select extends Tool {
46004
46020
  return false;
46005
46021
  }
46006
46022
  this.isDownOnBoard = hover.length === 0;
46007
- this.isDrawingRectangle = hover.filter((item) => !(item instanceof Frame2)).length === 0 && hover.filter((item) => item instanceof Frame2).filter((frame) => frame.isTextUnderPoint(pointer.point)).length === 0;
46023
+ this.isDrawingRectangle = hover.filter((item2) => !(item2 instanceof Frame2)).length === 0 && hover.filter((item2) => item2 instanceof Frame2).filter((frame) => frame.isTextUnderPoint(pointer.point)).length === 0;
46008
46024
  if (this.isDrawingRectangle) {
46009
46025
  const { x, y } = pointer.point;
46010
46026
  this.line = new Line(new Point(x, y), new Point(x, y));
@@ -46024,7 +46040,7 @@ class Select extends Tool {
46024
46040
  });
46025
46041
  return false;
46026
46042
  }
46027
- const isHoverLocked = hover.every((item) => item.transformation.isLocked);
46043
+ const isHoverLocked = hover.every((item2) => item2.transformation.isLocked);
46028
46044
  if (isHoverLocked) {
46029
46045
  return false;
46030
46046
  }
@@ -46158,7 +46174,7 @@ class Select extends Tool {
46158
46174
  const translation = selection.getManyItemsTranslation(x, y);
46159
46175
  const translationKeys = Object.keys(translation);
46160
46176
  const commentsSet = new Set(this.board.items.getComments().map((comment2) => comment2.getId()));
46161
- if (translationKeys.filter((item) => !commentsSet.has(item)).length > 10) {
46177
+ if (translationKeys.filter((item2) => !commentsSet.has(item2)).length > 10) {
46162
46178
  const selectedMbr = this.board.selection.getMbr()?.copy();
46163
46179
  const sumMbr = this.canvasDrawer.countSumMbr(translation);
46164
46180
  if (sumMbr) {
@@ -46185,7 +46201,7 @@ class Select extends Tool {
46185
46201
  return false;
46186
46202
  }
46187
46203
  const draggingMbr = draggingItem.getMbr();
46188
- const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item) => item instanceof Frame2);
46204
+ const frames = this.board.items.getEnclosedOrCrossed(draggingMbr.left, draggingMbr.top, draggingMbr.right, draggingMbr.bottom).filter((item2) => item2 instanceof Frame2);
46189
46205
  frames.forEach((frame) => {
46190
46206
  if (frame.handleNesting(draggingItem)) {
46191
46207
  this.nestingHighlighter.add(frame, draggingItem);
@@ -46195,7 +46211,7 @@ class Select extends Tool {
46195
46211
  });
46196
46212
  }
46197
46213
  const hover = items.getUnderPointer();
46198
- this.isHoverUnselectedItem = hover.filter((item) => item.itemType === "Placeholder").length === 1;
46214
+ this.isHoverUnselectedItem = hover.filter((item2) => item2.itemType === "Placeholder").length === 1;
46199
46215
  if (this.isHoverUnselectedItem && !this.isDraggingUnselectedItem && selection.getContext() === "None") {
46200
46216
  selection.setContext("HoverUnderPointer");
46201
46217
  return false;
@@ -46239,15 +46255,15 @@ class Select extends Tool {
46239
46255
  }
46240
46256
  }
46241
46257
  updateFramesNesting(selectionMbr, selection) {
46242
- const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item) => item instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
46243
- const draggingFramesIds = selection.list().filter((item) => item instanceof Frame2).map((frame) => frame.getId());
46244
- selection.list().forEach((item) => {
46245
- if (!(item instanceof Frame2) && !draggingFramesIds.includes(item.parent)) {
46258
+ const frames = this.board.items.getEnclosedOrCrossed(selectionMbr.left, selectionMbr.top, selectionMbr.right, selectionMbr.bottom).filter((item2) => item2 instanceof Frame2).filter((frame) => !selection.items.list().includes(frame));
46259
+ const draggingFramesIds = selection.list().filter((item2) => item2 instanceof Frame2).map((frame) => frame.getId());
46260
+ selection.list().forEach((item2) => {
46261
+ if (!(item2 instanceof Frame2) && !draggingFramesIds.includes(item2.parent)) {
46246
46262
  frames.forEach((frame) => {
46247
- if (frame.handleNesting(item)) {
46248
- this.nestingHighlighter.add(frame, item);
46263
+ if (frame.handleNesting(item2)) {
46264
+ this.nestingHighlighter.add(frame, item2);
46249
46265
  } else {
46250
- this.nestingHighlighter.remove(item);
46266
+ this.nestingHighlighter.remove(item2);
46251
46267
  }
46252
46268
  });
46253
46269
  }
@@ -46339,7 +46355,7 @@ class Select extends Tool {
46339
46355
  const childrenIds = underPointer.getChildrenIds();
46340
46356
  console.log("UNDERPOINTER", underPointer);
46341
46357
  console.log("CHILDREN", childrenIds);
46342
- const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item) => childrenIds && childrenIds.includes(item.getId()));
46358
+ const itemsInFrame = this.board.items.getEnclosedOrCrossed(left, top, right, bottom).filter((item2) => childrenIds && childrenIds.includes(item2.getId()));
46343
46359
  this.board.selection.add(itemsInFrame);
46344
46360
  }
46345
46361
  this.board.selection.setContext("EditUnderPointer");
@@ -46579,8 +46595,8 @@ class ShapeTool extends CustomTool {
46579
46595
  resizeType = "leftBottom";
46580
46596
  bounds = new Mbr;
46581
46597
  isDown = false;
46582
- constructor(board, name, item, settings) {
46583
- super(board, name, item);
46598
+ constructor(board, name, item2, settings) {
46599
+ super(board, name, item2);
46584
46600
  this.settings = settings;
46585
46601
  this.setCursor();
46586
46602
  }
@@ -46663,8 +46679,8 @@ class ShapeTool extends CustomTool {
46663
46679
 
46664
46680
  class StickerTool extends CustomTool {
46665
46681
  settings;
46666
- constructor(board, name, item, settings) {
46667
- super(board, name, item);
46682
+ constructor(board, name, item2, settings) {
46683
+ super(board, name, item2);
46668
46684
  this.settings = settings;
46669
46685
  this.setCursor();
46670
46686
  }
@@ -46970,7 +46986,7 @@ class Tools extends ToolContext {
46970
46986
  this.subject.publish(this);
46971
46987
  }
46972
46988
  sortFrames() {
46973
- const frames = this.board.items.listAll().filter((item) => item instanceof Frame2);
46989
+ const frames = this.board.items.listAll().filter((item2) => item2 instanceof Frame2);
46974
46990
  const sortedFrames = frames.sort((fr1, fr2) => {
46975
46991
  const mbr1 = fr1.getMbr();
46976
46992
  const mbr2 = fr2.getMbr();
@@ -47196,24 +47212,24 @@ function validateGroupData(groupData) {
47196
47212
  }
47197
47213
  // src/Items/RegisterItem.ts
47198
47214
  function registerItem({
47199
- item,
47215
+ item: item2,
47200
47216
  defaultData: defaultData2,
47201
47217
  toolData
47202
47218
  }) {
47203
47219
  const { itemType } = defaultData2;
47204
- itemFactories[itemType] = createItemFactory(item, defaultData2);
47220
+ itemFactories[itemType] = createItemFactory(item2, defaultData2);
47205
47221
  itemValidators[itemType] = createItemValidator(defaultData2);
47206
47222
  if (toolData) {
47207
47223
  registeredTools[toolData.name] = toolData.tool;
47208
47224
  }
47209
47225
  itemCommandFactories[itemType] = createItemCommandFactory(itemType);
47210
47226
  }
47211
- function createItemFactory(item, defaultData2) {
47227
+ function createItemFactory(item2, defaultData2) {
47212
47228
  return function itemFactory(id, data, board) {
47213
47229
  if (data.itemType !== defaultData2.itemType) {
47214
47230
  throw new Error(`Invalid data for ${defaultData2.itemType}`);
47215
47231
  }
47216
- return new item(board, id, defaultData2).setId(id).deserialize(data);
47232
+ return new item2(board, id, defaultData2).setId(id).deserialize(data);
47217
47233
  };
47218
47234
  }
47219
47235
  function createItemValidator(defaultData2) {
@@ -47228,7 +47244,7 @@ function createItemValidator(defaultData2) {
47228
47244
  }
47229
47245
  function createItemCommandFactory(itemType) {
47230
47246
  return function itemCommandFactory(items, operation) {
47231
- return new BaseCommand(items.filter((item) => item.itemType === itemType), operation);
47247
+ return new BaseCommand(items.filter((item2) => item2.itemType === itemType), operation);
47232
47248
  };
47233
47249
  }
47234
47250
  // src/Items/Examples/Star/AddStar.ts
@@ -48253,8 +48269,8 @@ class Camera {
48253
48269
  this.observableItem = null;
48254
48270
  }
48255
48271
  }
48256
- subscribeToItem(item) {
48257
- this.observableItem = item;
48272
+ subscribeToItem(item2) {
48273
+ this.observableItem = item2;
48258
48274
  this.observableItem.subject.subscribe(this.observeItem);
48259
48275
  }
48260
48276
  observeItem = () => {
@@ -48480,7 +48496,7 @@ class Camera {
48480
48496
  }
48481
48497
  addToView(mbr, inView) {
48482
48498
  if (!mbr.isEnclosedBy(this.getMbr())) {
48483
- this.viewRectangle(inView.reduce((acc, item) => acc.combine(item.getMbr()), inView[0]?.getMbr() ?? new Mbr).combine(mbr));
48499
+ this.viewRectangle(inView.reduce((acc, item2) => acc.combine(item2.getMbr()), inView[0]?.getMbr() ?? new Mbr).combine(mbr));
48484
48500
  }
48485
48501
  }
48486
48502
  viewRectangle(mbr, offsetInPercent = 10, duration = 500) {
@@ -50089,8 +50105,8 @@ class Presence {
50089
50105
  <path fill-rule="evenodd" clip-rule="evenodd" d="M3.28421 4.30174C3.55182 4.02741 3.95268 3.93015 4.31625 4.05135L20.3163 9.38468C20.7064 9.51472 20.9771 9.8703 20.9987 10.2809C21.0202 10.6916 20.7882 11.0736 20.4138 11.2437L20.36 11.2682L20.2042 11.3396C20.069 11.4015 19.8742 11.4912 19.636 11.6017C19.1595 11.8227 18.5109 12.1262 17.8216 12.4571C16.4106 13.1344 14.9278 13.8797 14.3325 14.2765C14.3325 14.2765 14.3258 14.2809 14.308 14.2965C14.2906 14.3118 14.2673 14.3339 14.2382 14.3646C14.1791 14.4267 14.1072 14.5123 14.0231 14.6243C13.8542 14.8496 13.6622 15.1471 13.4541 15.5039C13.0384 16.2164 12.5946 17.1024 12.1833 17.98C11.7735 18.8541 11.4038 19.7031 11.136 20.3348C11.0023 20.6502 10.8944 20.9105 10.8201 21.0915C10.783 21.182 10.7543 21.2525 10.735 21.3002L10.7132 21.3542L10.7066 21.3707C10.5524 21.7561 10.1759 22.0069 9.76082 21.9999C9.34577 21.9928 8.97824 21.7301 8.83725 21.3397L3.05947 5.33967C2.92931 4.97922 3.0166 4.57607 3.28421 4.30174Z" fill="${color2}"/>
50090
50106
  </svg>`;
50091
50107
  }
50092
- renderItemMbr(context, item, color2, customScale) {
50093
- const mbr = item.getMbr();
50108
+ renderItemMbr(context, item2, color2, customScale) {
50109
+ const mbr = item2.getMbr();
50094
50110
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
50095
50111
  mbr.borderColor = color2;
50096
50112
  mbr.render(context);
@@ -50230,8 +50246,8 @@ class Presence {
50230
50246
  selectionMbr.strokeWidth = 1 / context.matrix.scaleX;
50231
50247
  selectionMbr.borderColor = selection.color;
50232
50248
  selectionMbr.render(context);
50233
- for (const item of selection.selection) {
50234
- this.renderItemMbr(context, item, selection.color);
50249
+ for (const item2 of selection.selection) {
50250
+ this.renderItemMbr(context, item2, selection.color);
50235
50251
  }
50236
50252
  }
50237
50253
  }
@@ -50264,14 +50280,14 @@ class SelectionItems {
50264
50280
  items = new Map;
50265
50281
  add(value) {
50266
50282
  if (Array.isArray(value)) {
50267
- value.forEach((item) => this.items.set(item.getId(), item));
50283
+ value.forEach((item2) => this.items.set(item2.getId(), item2));
50268
50284
  } else {
50269
50285
  this.items.set(value.getId(), value);
50270
50286
  }
50271
50287
  }
50272
50288
  remove(value) {
50273
50289
  if (Array.isArray(value)) {
50274
- value.forEach((item) => this.items.delete(item.getId()));
50290
+ value.forEach((item2) => this.items.delete(item2.getId()));
50275
50291
  } else {
50276
50292
  this.items.delete(value.getId());
50277
50293
  }
@@ -50301,8 +50317,8 @@ class SelectionItems {
50301
50317
  if (this.isEmpty()) {
50302
50318
  return false;
50303
50319
  }
50304
- for (const item of this.items.values()) {
50305
- if (item.itemType !== "RichText") {
50320
+ for (const item2 of this.items.values()) {
50321
+ if (item2.itemType !== "RichText") {
50306
50322
  return false;
50307
50323
  }
50308
50324
  }
@@ -50312,14 +50328,14 @@ class SelectionItems {
50312
50328
  if (this.isEmpty()) {
50313
50329
  return false;
50314
50330
  }
50315
- return Array.from(this.items).every(([, item]) => item.itemType === itemType);
50331
+ return Array.from(this.items).every(([, item2]) => item2.itemType === itemType);
50316
50332
  }
50317
50333
  isItemTypes(itemTypes) {
50318
50334
  if (this.isEmpty()) {
50319
50335
  return false;
50320
50336
  }
50321
- for (const item of this.items.values()) {
50322
- if (!itemTypes.includes(item.itemType)) {
50337
+ for (const item2 of this.items.values()) {
50338
+ if (!itemTypes.includes(item2.itemType)) {
50323
50339
  return false;
50324
50340
  }
50325
50341
  }
@@ -50327,16 +50343,16 @@ class SelectionItems {
50327
50343
  }
50328
50344
  getItemTypes() {
50329
50345
  const itemTypes = new Set;
50330
- this.items.forEach((item) => itemTypes.add(item.itemType));
50346
+ this.items.forEach((item2) => itemTypes.add(item2.itemType));
50331
50347
  return Array.from(itemTypes);
50332
50348
  }
50333
50349
  getItemsByItemTypes(itemTypes) {
50334
- return Array.from(this.items.values()).filter((item) => itemTypes.includes(item.itemType));
50350
+ return Array.from(this.items.values()).filter((item2) => itemTypes.includes(item2.itemType));
50335
50351
  }
50336
50352
  getIdsByItemTypes(itemTypes) {
50337
50353
  const ids = [];
50338
- this.items.forEach((item, id) => {
50339
- if (itemTypes.includes(item.itemType)) {
50354
+ this.items.forEach((item2, id) => {
50355
+ if (itemTypes.includes(item2.itemType)) {
50340
50356
  ids.push(id);
50341
50357
  }
50342
50358
  });
@@ -50346,7 +50362,7 @@ class SelectionItems {
50346
50362
  return this.isSingle() ? this.items.values().next().value || null : null;
50347
50363
  }
50348
50364
  listByIds(itemIdList) {
50349
- return itemIdList.map((id) => this.items.get(id)).filter((item) => item !== undefined);
50365
+ return itemIdList.map((id) => this.items.get(id)).filter((item2) => item2 !== undefined);
50350
50366
  }
50351
50367
  ids() {
50352
50368
  return Array.from(this.items.keys());
@@ -50357,7 +50373,7 @@ class SelectionItems {
50357
50373
  return;
50358
50374
  }
50359
50375
  const mbr = items[0].getMbr();
50360
- items.slice(1).forEach((item) => mbr.combine(item.getMbr()));
50376
+ items.slice(1).forEach((item2) => mbr.combine(item2.getMbr()));
50361
50377
  return mbr;
50362
50378
  }
50363
50379
  }
@@ -50562,33 +50578,33 @@ function handleMultipleItemsResize({
50562
50578
  const translation = {};
50563
50579
  const items = itemsToResize ? itemsToResize : board.selection.items.list();
50564
50580
  board.items.getComments().forEach((comment2) => {
50565
- if (items.some((item) => item.getId() === comment2.getItemToFollow())) {
50581
+ if (items.some((item2) => item2.getId() === comment2.getItemToFollow())) {
50566
50582
  items.push(comment2);
50567
50583
  }
50568
50584
  });
50569
- for (const item of items) {
50570
- let itemX = item.getMbr().left;
50571
- let itemY = item.getMbr().top;
50572
- if (item.itemType === "Drawing") {
50573
- itemX = item.transformation.matrix.translateX;
50574
- itemY = item.transformation.matrix.translateY;
50585
+ for (const item2 of items) {
50586
+ let itemX = item2.getMbr().left;
50587
+ let itemY = item2.getMbr().top;
50588
+ if (item2.itemType === "Drawing") {
50589
+ itemX = item2.transformation.matrix.translateX;
50590
+ itemY = item2.transformation.matrix.translateY;
50575
50591
  }
50576
50592
  const deltaX = itemX - initMbr.left;
50577
50593
  const translateX = deltaX * matrix.scaleX - deltaX + matrix.translateX;
50578
50594
  const deltaY = itemY - initMbr.top;
50579
50595
  const translateY = deltaY * matrix.scaleY - deltaY + matrix.translateY;
50580
- if (item instanceof RichText) {
50581
- translation[item.getId()] = getRichTextTranslation({
50582
- item,
50596
+ if (item2 instanceof RichText) {
50597
+ translation[item2.getId()] = getRichTextTranslation({
50598
+ item: item2,
50583
50599
  isWidth,
50584
50600
  isHeight,
50585
50601
  matrix,
50586
50602
  translateX,
50587
50603
  translateY
50588
50604
  });
50589
- } else if (item instanceof AINode) {
50590
- translation[item.getId()] = getAINodeTranslation({
50591
- item,
50605
+ } else if (item2 instanceof AINode) {
50606
+ translation[item2.getId()] = getAINodeTranslation({
50607
+ item: item2,
50592
50608
  isWidth,
50593
50609
  isHeight,
50594
50610
  matrix,
@@ -50596,8 +50612,8 @@ function handleMultipleItemsResize({
50596
50612
  translateY
50597
50613
  });
50598
50614
  } else {
50599
- translation[item.getId()] = getItemTranslation({
50600
- item,
50615
+ translation[item2.getId()] = getItemTranslation({
50616
+ item: item2,
50601
50617
  isWidth,
50602
50618
  isHeight,
50603
50619
  matrix,
@@ -50610,7 +50626,7 @@ function handleMultipleItemsResize({
50610
50626
  return translation;
50611
50627
  }
50612
50628
  function getRichTextTranslation({
50613
- item,
50629
+ item: item2,
50614
50630
  isWidth,
50615
50631
  isHeight,
50616
50632
  matrix,
@@ -50618,11 +50634,11 @@ function getRichTextTranslation({
50618
50634
  translateY
50619
50635
  }) {
50620
50636
  if (isWidth) {
50621
- item.editor.setMaxWidth(item.getWidth() / item.transformation.getScale().x * matrix.scaleX);
50637
+ item2.editor.setMaxWidth(item2.getWidth() / item2.transformation.getScale().x * matrix.scaleX);
50622
50638
  return {
50623
50639
  class: "Transformation",
50624
50640
  method: "scaleByTranslateBy",
50625
- item: [item.getId()],
50641
+ item: [item2.getId()],
50626
50642
  translate: { x: matrix.translateX, y: 0 },
50627
50643
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50628
50644
  };
@@ -50630,7 +50646,7 @@ function getRichTextTranslation({
50630
50646
  return {
50631
50647
  class: "Transformation",
50632
50648
  method: "scaleByTranslateBy",
50633
- item: [item.getId()],
50649
+ item: [item2.getId()],
50634
50650
  translate: { x: translateX, y: translateY },
50635
50651
  scale: { x: 1, y: 1 }
50636
50652
  };
@@ -50638,14 +50654,14 @@ function getRichTextTranslation({
50638
50654
  return {
50639
50655
  class: "Transformation",
50640
50656
  method: "scaleByTranslateBy",
50641
- item: [item.getId()],
50657
+ item: [item2.getId()],
50642
50658
  translate: { x: translateX, y: translateY },
50643
50659
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50644
50660
  };
50645
50661
  }
50646
50662
  }
50647
50663
  function getAINodeTranslation({
50648
- item,
50664
+ item: item2,
50649
50665
  isWidth,
50650
50666
  isHeight,
50651
50667
  matrix,
@@ -50653,11 +50669,11 @@ function getAINodeTranslation({
50653
50669
  translateY
50654
50670
  }) {
50655
50671
  if (isWidth) {
50656
- item.text.editor.setMaxWidth(item.text.getWidth() / item.transformation.getScale().x * matrix.scaleX);
50672
+ item2.text.editor.setMaxWidth(item2.text.getWidth() / item2.transformation.getScale().x * matrix.scaleX);
50657
50673
  return {
50658
50674
  class: "Transformation",
50659
50675
  method: "scaleByTranslateBy",
50660
- item: [item.getId()],
50676
+ item: [item2.getId()],
50661
50677
  translate: { x: matrix.translateX, y: 0 },
50662
50678
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50663
50679
  };
@@ -50665,7 +50681,7 @@ function getAINodeTranslation({
50665
50681
  return {
50666
50682
  class: "Transformation",
50667
50683
  method: "scaleByTranslateBy",
50668
- item: [item.getId()],
50684
+ item: [item2.getId()],
50669
50685
  translate: { x: translateX, y: translateY },
50670
50686
  scale: { x: 1, y: 1 }
50671
50687
  };
@@ -50673,14 +50689,14 @@ function getAINodeTranslation({
50673
50689
  return {
50674
50690
  class: "Transformation",
50675
50691
  method: "scaleByTranslateBy",
50676
- item: [item.getId()],
50692
+ item: [item2.getId()],
50677
50693
  translate: { x: translateX, y: translateY },
50678
50694
  scale: { x: matrix.scaleX, y: matrix.scaleX }
50679
50695
  };
50680
50696
  }
50681
50697
  }
50682
50698
  function getItemTranslation({
50683
- item,
50699
+ item: item2,
50684
50700
  isWidth,
50685
50701
  isHeight,
50686
50702
  matrix,
@@ -50688,22 +50704,22 @@ function getItemTranslation({
50688
50704
  translateY,
50689
50705
  isShiftPressed
50690
50706
  }) {
50691
- if (item instanceof Sticker && (isWidth || isHeight)) {
50707
+ if (item2 instanceof Sticker && (isWidth || isHeight)) {
50692
50708
  return {
50693
50709
  class: "Transformation",
50694
50710
  method: "scaleByTranslateBy",
50695
- item: [item.getId()],
50711
+ item: [item2.getId()],
50696
50712
  translate: { x: translateX, y: translateY },
50697
50713
  scale: { x: 1, y: 1 }
50698
50714
  };
50699
50715
  } else {
50700
- if (item instanceof Frame2 && item.getCanChangeRatio() && isShiftPressed && item.getFrameType() !== "Custom") {
50701
- item.setFrameType("Custom");
50716
+ if (item2 instanceof Frame2 && item2.getCanChangeRatio() && isShiftPressed && item2.getFrameType() !== "Custom") {
50717
+ item2.setFrameType("Custom");
50702
50718
  }
50703
50719
  return {
50704
50720
  class: "Transformation",
50705
50721
  method: "scaleByTranslateBy",
50706
- item: [item.getId()],
50722
+ item: [item2.getId()],
50707
50723
  translate: { x: translateX, y: translateY },
50708
50724
  scale: { x: matrix.scaleX, y: matrix.scaleY }
50709
50725
  };
@@ -50976,11 +50992,11 @@ function transformItems({
50976
50992
  setSnapCursorPos
50977
50993
  }) {
50978
50994
  const items = selection.items.list();
50979
- const includesProportionalItem = items.some((item) => item.itemType === "Sticker" || item.itemType === "RichText" || item.itemType === "AINode" || item.itemType === "Video" || item.itemType === "Audio");
50995
+ const includesProportionalItem = items.some((item2) => item2.itemType === "Sticker" || item2.itemType === "RichText" || item2.itemType === "AINode" || item2.itemType === "Video" || item2.itemType === "Audio");
50980
50996
  if (includesProportionalItem && (isWidth || isHeight)) {
50981
50997
  return null;
50982
50998
  }
50983
- const isIncludesFixedFrame = items.some((item) => item instanceof Frame2 && !item.getCanChangeRatio());
50999
+ const isIncludesFixedFrame = items.some((item2) => item2 instanceof Frame2 && !item2.getCanChangeRatio());
50984
51000
  const shouldBeProportionalResize = isIncludesFixedFrame || includesProportionalItem || isShiftPressed || !isWidth && !isHeight;
50985
51001
  const resize = shouldBeProportionalResize ? getProportionalResize(resizeType, board.pointer.point, mbr, oppositePoint) : getResize(resizeType, board.pointer.point, mbr, oppositePoint);
50986
51002
  if (canvasDrawer.getLastCreatedCanvas() && !debounceUpd.shouldUpd()) {
@@ -51058,23 +51074,23 @@ function updateFrameChildren({
51058
51074
  nestingHighlighter
51059
51075
  }) {
51060
51076
  const groups = board.items.getGroupItemsEnclosedOrCrossed(mbr.left, mbr.top, mbr.right, mbr.bottom);
51061
- board.selection.items.list().forEach((item) => {
51062
- if ("getChildrenIds" in item && item.getChildrenIds()) {
51063
- const currMbr = item.getMbr();
51077
+ board.selection.items.list().forEach((item2) => {
51078
+ if ("getChildrenIds" in item2 && item2.getChildrenIds()) {
51079
+ const currMbr = item2.getMbr();
51064
51080
  const itemsToCheck = board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom);
51065
51081
  itemsToCheck.forEach((currItem) => {
51066
- if (item.handleNesting(currItem) && (currItem.parent === "Board" || currItem.parent === item.getId())) {
51067
- nestingHighlighter.add(item, currItem);
51082
+ if (item2.handleNesting(currItem) && (currItem.parent === "Board" || currItem.parent === item2.getId())) {
51083
+ nestingHighlighter.add(item2, currItem);
51068
51084
  } else {
51069
51085
  nestingHighlighter.remove(currItem);
51070
51086
  }
51071
51087
  });
51072
51088
  } else {
51073
51089
  groups.forEach((group) => {
51074
- if (group.handleNesting(item)) {
51075
- nestingHighlighter.add(group, item);
51090
+ if (group.handleNesting(item2)) {
51091
+ nestingHighlighter.add(group, item2);
51076
51092
  } else {
51077
- nestingHighlighter.remove(item);
51093
+ nestingHighlighter.remove(item2);
51078
51094
  }
51079
51095
  });
51080
51096
  }
@@ -51142,9 +51158,9 @@ class Transformer extends Tool {
51142
51158
  const pointer = this.board.pointer;
51143
51159
  const camera = this.board.camera;
51144
51160
  const items = this.selection.items;
51145
- const item = items.getSingle();
51161
+ const item2 = items.getSingle();
51146
51162
  let resizeType;
51147
- if (item && (item.itemType === "RichText" || item.itemType === "Sticker")) {
51163
+ if (item2 && (item2.itemType === "RichText" || item2.itemType === "Sticker")) {
51148
51164
  resizeType = getTextResizeType(pointer.point, camera.getScale(), mbr);
51149
51165
  } else {
51150
51166
  resizeType = getResizeType(pointer.point, camera.getScale(), mbr);
@@ -51398,8 +51414,8 @@ class SelectionTransformer extends Tool {
51398
51414
  return;
51399
51415
  }
51400
51416
  if (this.selection.items.isSingle()) {
51401
- const item = this.selection.items.getSingle();
51402
- if (item?.itemType === "Connector") {
51417
+ const item2 = this.selection.items.getSingle();
51418
+ if (item2?.itemType === "Connector") {
51403
51419
  this.tool = this.connectorTransformerTool;
51404
51420
  return;
51405
51421
  } else {
@@ -51482,16 +51498,16 @@ class BoardSelection {
51482
51498
  this.quickAddButtons = getQuickAddButtons(this, board);
51483
51499
  }
51484
51500
  serialize() {
51485
- const selectedItems = this.items.list().map((item) => item.getId());
51501
+ const selectedItems = this.items.list().map((item2) => item2.getId());
51486
51502
  return JSON.stringify(selectedItems);
51487
51503
  }
51488
51504
  deserialize(serializedData) {
51489
51505
  const selectedItems = JSON.parse(serializedData);
51490
51506
  this.removeAll();
51491
51507
  selectedItems.forEach((itemId) => {
51492
- const item = this.board.items.getById(itemId);
51493
- if (item) {
51494
- this.items.add(item);
51508
+ const item2 = this.board.items.getById(itemId);
51509
+ if (item2) {
51510
+ this.items.add(item2);
51495
51511
  }
51496
51512
  });
51497
51513
  }
@@ -51569,19 +51585,19 @@ class BoardSelection {
51569
51585
  this.updateQueue.clear();
51570
51586
  safeRequestAnimationFrame(this.updateScheduledObservers);
51571
51587
  };
51572
- itemObserver = (item) => {
51588
+ itemObserver = (item2) => {
51573
51589
  if (!this.shouldPublish) {
51574
51590
  return;
51575
51591
  }
51576
51592
  this.subject.publish(this);
51577
- this.itemSubject.publish(item);
51593
+ this.itemSubject.publish(item2);
51578
51594
  };
51579
51595
  decoratedItemObserver = this.decorateObserverToScheduleUpdate(this.itemObserver);
51580
51596
  add(value) {
51581
51597
  this.items.add(value);
51582
51598
  if (Array.isArray(value)) {
51583
- for (const item of value) {
51584
- item.subject.subscribe(this.itemObserver);
51599
+ for (const item2 of value) {
51600
+ item2.subject.subscribe(this.itemObserver);
51585
51601
  }
51586
51602
  } else {
51587
51603
  value.subject.subscribe(this.itemObserver);
@@ -51590,15 +51606,15 @@ class BoardSelection {
51590
51606
  this.itemsSubject.publish([]);
51591
51607
  }
51592
51608
  addAll() {
51593
- const items = this.board.items.listAll().filter((item) => !item.transformation.isLocked);
51609
+ const items = this.board.items.listAll().filter((item2) => !item2.transformation.isLocked);
51594
51610
  this.add(items);
51595
51611
  this.setContext("SelectByRect");
51596
51612
  }
51597
51613
  remove(value) {
51598
51614
  this.items.remove(value);
51599
51615
  if (Array.isArray(value)) {
51600
- for (const item of value) {
51601
- item.subject.unsubscribe(this.itemObserver);
51616
+ for (const item2 of value) {
51617
+ item2.subject.unsubscribe(this.itemObserver);
51602
51618
  }
51603
51619
  } else {
51604
51620
  value.subject.unsubscribe(this.itemObserver);
@@ -51692,11 +51708,11 @@ class BoardSelection {
51692
51708
  if (!this.items.isSingle()) {
51693
51709
  return;
51694
51710
  }
51695
- const item = this.items.getSingle();
51696
- if (!item) {
51711
+ const item2 = this.items.getSingle();
51712
+ if (!item2) {
51697
51713
  return;
51698
51714
  }
51699
- const text5 = item.getRichText();
51715
+ const text5 = item2.getRichText();
51700
51716
  if (!text5) {
51701
51717
  return;
51702
51718
  }
@@ -51707,7 +51723,7 @@ class BoardSelection {
51707
51723
  if (shouldReplace || moveCursorToEnd) {
51708
51724
  text5.editor.moveCursorToEndOfTheText();
51709
51725
  }
51710
- this.setTextToEdit(item);
51726
+ this.setTextToEdit(item2);
51711
51727
  this.setContext("EditTextUnderPointer");
51712
51728
  if (shouldSelect) {
51713
51729
  text5.editor.selectWholeText();
@@ -51717,13 +51733,13 @@ class BoardSelection {
51717
51733
  editUnderPointer() {
51718
51734
  this.removeAll();
51719
51735
  const stack = this.board.items.getUnderPointer();
51720
- const item = stack.pop();
51721
- if (item) {
51722
- this.add(item);
51736
+ const item2 = stack.pop();
51737
+ if (item2) {
51738
+ this.add(item2);
51723
51739
  this.setTextToEdit(undefined);
51724
- const text5 = item.getRichText();
51740
+ const text5 = item2.getRichText();
51725
51741
  if (text5) {
51726
- this.setTextToEdit(item);
51742
+ this.setTextToEdit(item2);
51727
51743
  text5.editor.selectWholeText();
51728
51744
  this.board.items.subject.publish(this.board.items);
51729
51745
  }
@@ -51732,26 +51748,26 @@ class BoardSelection {
51732
51748
  this.setContext("None");
51733
51749
  }
51734
51750
  }
51735
- setTextToEdit(item) {
51751
+ setTextToEdit(item2) {
51736
51752
  if (this.textToEdit) {
51737
51753
  this.textToEdit.updateElement();
51738
51754
  this.textToEdit.enableRender();
51739
51755
  }
51740
- if (!(item && item.getRichText())) {
51756
+ if (!(item2 && item2.getRichText())) {
51741
51757
  this.textToEdit = undefined;
51742
51758
  return;
51743
51759
  }
51744
- const text5 = item.getRichText();
51760
+ const text5 = item2.getRichText();
51745
51761
  if (!text5) {
51746
51762
  return;
51747
51763
  }
51748
51764
  if (text5.isEmpty()) {
51749
- const textColor = tempStorage.getFontColor(item.itemType);
51750
- const textSize = tempStorage.getFontSize(item.itemType);
51751
- const highlightColor = tempStorage.getFontHighlight(item.itemType);
51752
- const styles = tempStorage.getFontStyles(item.itemType);
51753
- const horizontalAlignment = tempStorage.getHorizontalAlignment(item.itemType);
51754
- const verticalAlignment = tempStorage.getVerticalAlignment(item.itemType);
51765
+ const textColor = tempStorage.getFontColor(item2.itemType);
51766
+ const textSize = tempStorage.getFontSize(item2.itemType);
51767
+ const highlightColor = tempStorage.getFontHighlight(item2.itemType);
51768
+ const styles = tempStorage.getFontStyles(item2.itemType);
51769
+ const horizontalAlignment = tempStorage.getHorizontalAlignment(item2.itemType);
51770
+ const verticalAlignment = tempStorage.getVerticalAlignment(item2.itemType);
51755
51771
  if (textColor) {
51756
51772
  text5.setSelectionFontColor(textColor, "None");
51757
51773
  }
@@ -51759,7 +51775,7 @@ class BoardSelection {
51759
51775
  this.emit({
51760
51776
  class: "RichText",
51761
51777
  method: "setFontSize",
51762
- item: [item.getId()],
51778
+ item: [item2.getId()],
51763
51779
  fontSize: textSize,
51764
51780
  context: this.getContext()
51765
51781
  });
@@ -51771,10 +51787,10 @@ class BoardSelection {
51771
51787
  const stylesArr = styles;
51772
51788
  text5.setSelectionFontStyle(stylesArr, "None");
51773
51789
  }
51774
- if (horizontalAlignment && !(item instanceof Sticker)) {
51790
+ if (horizontalAlignment && !(item2 instanceof Sticker)) {
51775
51791
  text5.setSelectionHorisontalAlignment(horizontalAlignment);
51776
51792
  }
51777
- if (verticalAlignment && !(item instanceof Sticker)) {
51793
+ if (verticalAlignment && !(item2 instanceof Sticker)) {
51778
51794
  this.setVerticalAlignment(verticalAlignment);
51779
51795
  }
51780
51796
  }
@@ -51807,8 +51823,8 @@ class BoardSelection {
51807
51823
  }
51808
51824
  selectEnclosedOrCrossedBy(rect) {
51809
51825
  this.removeAll();
51810
- const enclosedFrames = this.board.items.getEnclosed(rect.left, rect.top, rect.right, rect.bottom).filter((item) => !item.transformation.isLocked);
51811
- const list6 = this.board.items.getEnclosedOrCrossed(rect.left, rect.top, rect.right, rect.bottom).filter((item) => (!(item instanceof Frame2) || enclosedFrames.includes(item)) && !item.transformation.isLocked);
51826
+ const enclosedFrames = this.board.items.getEnclosed(rect.left, rect.top, rect.right, rect.bottom).filter((item2) => !item2.transformation.isLocked);
51827
+ const list6 = this.board.items.getEnclosedOrCrossed(rect.left, rect.top, rect.right, rect.bottom).filter((item2) => (!(item2 instanceof Frame2) || enclosedFrames.includes(item2)) && !item2.transformation.isLocked);
51812
51828
  if (list6.length !== 0) {
51813
51829
  this.add(list6);
51814
51830
  this.setContext("SelectByRect");
@@ -51822,14 +51838,14 @@ class BoardSelection {
51822
51838
  canChangeText() {
51823
51839
  return Boolean(this.items.isSingle() && this.items.getSingle()?.getRichText());
51824
51840
  }
51825
- handleItemCopy(item, copiedItemsMap) {
51826
- const serializedData = item.serialize(true);
51827
- const zIndex = this.board.items.index.getZIndex(item);
51828
- if (item.itemType === "Comment") {
51841
+ handleItemCopy(item2, copiedItemsMap) {
51842
+ const serializedData = item2.serialize(true);
51843
+ const zIndex = this.board.items.index.getZIndex(item2);
51844
+ if (item2.itemType === "Comment") {
51829
51845
  return;
51830
51846
  }
51831
- if (item.itemType === "Connector" && serializedData.itemType === "Connector") {
51832
- const connector = item;
51847
+ if (item2.itemType === "Connector" && serializedData.itemType === "Connector") {
51848
+ const connector = item2;
51833
51849
  const startPoint = connector.getStartPoint();
51834
51850
  const endPoint = connector.getEndPoint();
51835
51851
  const startItemId = startPoint.pointType !== "Board" ? startPoint.item.getId() : null;
@@ -51845,19 +51861,19 @@ class BoardSelection {
51845
51861
  serializedData.endPoint = new BoardPoint(endPoint.x, endPoint.y).serialize();
51846
51862
  }
51847
51863
  }
51848
- const textItem = item.getRichText()?.getTextString();
51864
+ const textItem = item2.getRichText()?.getTextString();
51849
51865
  const copyText = conf.i18n.t("frame.copy");
51850
51866
  const isCopyTextExist = textItem?.includes(copyText);
51851
- const isChangeCopiedFrameText = item.itemType === "Frame" && serializedData.itemType === "Frame" && textItem !== "" && !isCopyTextExist;
51867
+ const isChangeCopiedFrameText = item2.itemType === "Frame" && serializedData.itemType === "Frame" && textItem !== "" && !isCopyTextExist;
51852
51868
  if (isChangeCopiedFrameText) {
51853
51869
  const copiedFrameText = copyText + (textItem || serializedData.text?.placeholderText);
51854
- item.getRichText()?.editor.clearText();
51855
- item.getRichText()?.editor.addText(copiedFrameText);
51856
- serializedData.text = item.getRichText()?.serialize();
51857
- item.getRichText()?.editor.clearText();
51858
- item.getRichText()?.editor.addText(textItem || "");
51870
+ item2.getRichText()?.editor.clearText();
51871
+ item2.getRichText()?.editor.addText(copiedFrameText);
51872
+ serializedData.text = item2.getRichText()?.serialize();
51873
+ item2.getRichText()?.editor.clearText();
51874
+ item2.getRichText()?.editor.addText(textItem || "");
51859
51875
  }
51860
- copiedItemsMap[item.getId()] = { ...serializedData, zIndex };
51876
+ copiedItemsMap[item2.getId()] = { ...serializedData, zIndex };
51861
51877
  }
51862
51878
  copy(skipImageBlobCopy) {
51863
51879
  const copiedItemsMap = {};
@@ -51866,12 +51882,12 @@ class BoardSelection {
51866
51882
  this.handleItemCopy(single, copiedItemsMap);
51867
51883
  return { imageElement: single.image, imageData: copiedItemsMap };
51868
51884
  }
51869
- this.list().forEach((item) => {
51870
- this.handleItemCopy(item, copiedItemsMap);
51885
+ this.list().forEach((item2) => {
51886
+ this.handleItemCopy(item2, copiedItemsMap);
51871
51887
  });
51872
- this.list().flatMap((item) => {
51873
- if (item instanceof Frame2) {
51874
- return item.getChildrenIds();
51888
+ this.list().flatMap((item2) => {
51889
+ if (item2 instanceof Frame2) {
51890
+ return item2.getChildrenIds();
51875
51891
  }
51876
51892
  return [];
51877
51893
  }).forEach((id) => {
@@ -51899,11 +51915,11 @@ class BoardSelection {
51899
51915
  let maxRichText = null;
51900
51916
  let minRichText = null;
51901
51917
  const itemType = items[0].itemType;
51902
- for (const item of items) {
51903
- if (item.itemType !== itemType) {
51918
+ for (const item2 of items) {
51919
+ if (item2.itemType !== itemType) {
51904
51920
  return null;
51905
51921
  }
51906
- const richText = item.getRichText();
51922
+ const richText = item2.getRichText();
51907
51923
  if (richText) {
51908
51924
  if (!maxRichText || richText.getFontSize() > maxRichText.getFontSize()) {
51909
51925
  maxRichText = richText;
@@ -52009,22 +52025,22 @@ class BoardSelection {
52009
52025
  }
52010
52026
  nestSelectedItems(unselectedItem, checkFrames = true) {
52011
52027
  const selected = this.board.selection.items.list();
52012
- if (unselectedItem && !selected.find((item) => item.getId() === unselectedItem.getId())) {
52028
+ if (unselectedItem && !selected.find((item2) => item2.getId() === unselectedItem.getId())) {
52013
52029
  selected.push(unselectedItem);
52014
52030
  }
52015
- const selectedMbr = selected.reduce((acc, item) => {
52031
+ const selectedMbr = selected.reduce((acc, item2) => {
52016
52032
  if (!acc) {
52017
- return item.getMbr();
52033
+ return item2.getMbr();
52018
52034
  }
52019
- return acc.combine(item.getMbr());
52035
+ return acc.combine(item2.getMbr());
52020
52036
  }, undefined);
52021
52037
  if (selectedMbr) {
52022
- const selectedMap = Object.fromEntries(selected.map((item) => [item.getId(), { item, nested: false }]));
52038
+ const selectedMap = Object.fromEntries(selected.map((item2) => [item2.getId(), { item: item2, nested: false }]));
52023
52039
  const enclosedGroups = this.board.items.getGroupItemsEnclosedOrCrossed(selectedMbr?.left, selectedMbr?.top, selectedMbr?.right, selectedMbr?.bottom);
52024
52040
  enclosedGroups.forEach((group) => {
52025
- selected.forEach((item) => {
52026
- if (group.handleNesting(item)) {
52027
- selectedMap[item.getId()].nested = group;
52041
+ selected.forEach((item2) => {
52042
+ if (group.handleNesting(item2)) {
52043
+ selectedMap[item2.getId()].nested = group;
52028
52044
  }
52029
52045
  });
52030
52046
  });
@@ -52048,11 +52064,11 @@ class BoardSelection {
52048
52064
  if (childrenIds && checkFrames) {
52049
52065
  const currGroup = val.item;
52050
52066
  const currMbr = currGroup.getMbr();
52051
- const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item) => !!item);
52052
- const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item) => item.parent === "Board" || item.parent === currGroup.getId());
52067
+ const children = childrenIds.map((childId) => this.board.items.getById(childId)).filter((item2) => !!item2);
52068
+ const underGroup = this.board.items.getEnclosedOrCrossed(currMbr.left, currMbr.top, currMbr.right, currMbr.bottom).filter((item2) => item2.parent === "Board" || item2.parent === currGroup.getId());
52053
52069
  const uniqueItems = new Set;
52054
- const toCheck = [...children, ...underGroup].filter((item) => {
52055
- const id = item.getId();
52070
+ const toCheck = [...children, ...underGroup].filter((item2) => {
52071
+ const id = item2.getId();
52056
52072
  if (uniqueItems.has(id)) {
52057
52073
  return false;
52058
52074
  }
@@ -52093,8 +52109,8 @@ class BoardSelection {
52093
52109
  addItemToTranslation(childId);
52094
52110
  }
52095
52111
  }
52096
- const createTranslationWithComments = (item) => {
52097
- const followedComments = this.board.items.getComments().filter((comment2) => comment2.getItemToFollow() === item.getId());
52112
+ const createTranslationWithComments = (item2) => {
52113
+ const followedComments = this.board.items.getComments().filter((comment2) => comment2.getItemToFollow() === item2.getId());
52098
52114
  for (const comment2 of followedComments) {
52099
52115
  translation[comment2.getId()] = {
52100
52116
  class: "Transformation",
@@ -52155,21 +52171,21 @@ class BoardSelection {
52155
52171
  newData: { borderColor }
52156
52172
  };
52157
52173
  const operations2 = {};
52158
- this.items.list().forEach((item) => {
52159
- if (!operations2[item.itemType]) {
52174
+ this.items.list().forEach((item2) => {
52175
+ if (!operations2[item2.itemType]) {
52160
52176
  const operationCopy = { ...operation };
52161
- if (item.itemType === "Connector") {
52177
+ if (item2.itemType === "Connector") {
52162
52178
  operationCopy.method = "setLineColor";
52163
52179
  operationCopy.lineColor = borderColor;
52164
- } else if (item.itemType === "Drawing") {
52180
+ } else if (item2.itemType === "Drawing") {
52165
52181
  operationCopy.method = "setStrokeColor";
52166
52182
  operationCopy.color = borderColor;
52167
52183
  } else {
52168
52184
  operationCopy.borderColor = borderColor;
52169
52185
  }
52170
- operations2[item.itemType] = { ...operationCopy, class: item.itemType, item: [item.getId()] };
52186
+ operations2[item2.itemType] = { ...operationCopy, class: item2.itemType, item: [item2.getId()] };
52171
52187
  } else {
52172
- operations2[item.itemType].item.push(item.getId());
52188
+ operations2[item2.itemType].item.push(item2.getId());
52173
52189
  }
52174
52190
  });
52175
52191
  Object.values(operations2).forEach((op) => {
@@ -52184,13 +52200,13 @@ class BoardSelection {
52184
52200
  newData: { borderWidth: width2 }
52185
52201
  };
52186
52202
  const operations2 = {};
52187
- this.items.list().forEach((item) => {
52188
- if (!operations2[item.itemType]) {
52203
+ this.items.list().forEach((item2) => {
52204
+ if (!operations2[item2.itemType]) {
52189
52205
  const operationCopy = { ...operation };
52190
- if (item.itemType === "Connector") {
52206
+ if (item2.itemType === "Connector") {
52191
52207
  operationCopy.method = "setLineWidth";
52192
52208
  operationCopy.lineWidth = width2;
52193
- } else if (item.itemType === "Drawing") {
52209
+ } else if (item2.itemType === "Drawing") {
52194
52210
  operationCopy.method = "setStrokeWidth";
52195
52211
  operationCopy.width = width2;
52196
52212
  operationCopy.prevWidth = this.getStrokeWidth();
@@ -52198,9 +52214,9 @@ class BoardSelection {
52198
52214
  operationCopy.borderWidth = width2;
52199
52215
  operationCopy.prevBorderWidth = this.getStrokeWidth();
52200
52216
  }
52201
- operations2[item.itemType] = { ...operationCopy, class: item.itemType, item: [item.getId()] };
52217
+ operations2[item2.itemType] = { ...operationCopy, class: item2.itemType, item: [item2.getId()] };
52202
52218
  } else {
52203
- operations2[item.itemType].item.push(item.getId());
52219
+ operations2[item2.itemType].item.push(item2.getId());
52204
52220
  }
52205
52221
  });
52206
52222
  Object.values(operations2).forEach((op) => {
@@ -52216,11 +52232,11 @@ class BoardSelection {
52216
52232
  newData: { backgroundColor }
52217
52233
  };
52218
52234
  const operations2 = {};
52219
- this.items.list().forEach((item) => {
52220
- if (!operations2[item.itemType]) {
52221
- operations2[item.itemType] = { ...operation, class: item.itemType, item: [item.getId()] };
52235
+ this.items.list().forEach((item2) => {
52236
+ if (!operations2[item2.itemType]) {
52237
+ operations2[item2.itemType] = { ...operation, class: item2.itemType, item: [item2.getId()] };
52222
52238
  } else {
52223
- operations2[item.itemType].item.push(item.getId());
52239
+ operations2[item2.itemType].item.push(item2.getId());
52224
52240
  }
52225
52241
  });
52226
52242
  Object.values(operations2).forEach((op) => {
@@ -52244,9 +52260,9 @@ class BoardSelection {
52244
52260
  }
52245
52261
  setFrameType(frameType) {
52246
52262
  const items = this.items.list();
52247
- items.forEach((item) => {
52248
- if (item instanceof Frame2) {
52249
- item.setFrameType(frameType);
52263
+ items.forEach((item2) => {
52264
+ if (item2 instanceof Frame2) {
52265
+ item2.setFrameType(frameType);
52250
52266
  }
52251
52267
  });
52252
52268
  }
@@ -52265,21 +52281,21 @@ class BoardSelection {
52265
52281
  setFontSize(size) {
52266
52282
  const fontSize = size === "auto" ? size : toFiniteNumber(size);
52267
52283
  const itemsOps = [];
52268
- for (const item of this.items.list()) {
52269
- const text5 = item.getRichText();
52284
+ for (const item2 of this.items.list()) {
52285
+ const text5 = item2.getRichText();
52270
52286
  if (!text5) {
52271
52287
  continue;
52272
52288
  }
52273
52289
  const ops = text5.setSelectionFontSize(fontSize, this.context);
52274
52290
  itemsOps.push({
52275
- item: item.getId(),
52291
+ item: item2.getId(),
52276
52292
  selection: text5.editor.getSelection(),
52277
52293
  ops
52278
52294
  });
52279
- if (item.itemType === "Sticker" && fontSize === "auto") {
52280
- tempStorage.remove(`fontSize_${item.itemType}`);
52281
- } else if (item.itemType !== "AINode") {
52282
- tempStorage.setFontSize(item.itemType, fontSize);
52295
+ if (item2.itemType === "Sticker" && fontSize === "auto") {
52296
+ tempStorage.remove(`fontSize_${item2.itemType}`);
52297
+ } else if (item2.itemType !== "AINode") {
52298
+ tempStorage.setFontSize(item2.itemType, fontSize);
52283
52299
  }
52284
52300
  }
52285
52301
  const emptyOps = itemsOps.filter((op) => !op.ops.length);
@@ -52302,8 +52318,8 @@ class BoardSelection {
52302
52318
  setFontStyle(fontStyle) {
52303
52319
  const isMultiple = !this.items.isSingle();
52304
52320
  const itemsOps = [];
52305
- for (const item of this.items.list()) {
52306
- const text5 = item.getRichText();
52321
+ for (const item2 of this.items.list()) {
52322
+ const text5 = item2.getRichText();
52307
52323
  if (!text5) {
52308
52324
  continue;
52309
52325
  }
@@ -52312,12 +52328,12 @@ class BoardSelection {
52312
52328
  }
52313
52329
  const ops = text5.setSelectionFontStyle(fontStyle, this.context);
52314
52330
  itemsOps.push({
52315
- item: item.getId(),
52331
+ item: item2.getId(),
52316
52332
  selection: text5.editor.getSelection(),
52317
52333
  ops
52318
52334
  });
52319
- if (item.itemType !== "AINode") {
52320
- tempStorage.setFontStyles(item.itemType, text5.getFontStyles());
52335
+ if (item2.itemType !== "AINode") {
52336
+ tempStorage.setFontStyles(item2.itemType, text5.getFontStyles());
52321
52337
  }
52322
52338
  }
52323
52339
  this.emitApplied({
@@ -52329,8 +52345,8 @@ class BoardSelection {
52329
52345
  setFontColor(fontColor) {
52330
52346
  const isMultiple = !this.items.isSingle();
52331
52347
  const itemsOps = [];
52332
- for (const item of this.items.list()) {
52333
- const text5 = item.getRichText();
52348
+ for (const item2 of this.items.list()) {
52349
+ const text5 = item2.getRichText();
52334
52350
  if (!text5) {
52335
52351
  continue;
52336
52352
  }
@@ -52339,11 +52355,11 @@ class BoardSelection {
52339
52355
  }
52340
52356
  const ops = text5.setSelectionFontColor(fontColor, this.context);
52341
52357
  itemsOps.push({
52342
- item: item.getId(),
52358
+ item: item2.getId(),
52343
52359
  selection: text5.editor.getSelection(),
52344
52360
  ops
52345
52361
  });
52346
- tempStorage.setFontColor(item.itemType, fontColor);
52362
+ tempStorage.setFontColor(item2.itemType, fontColor);
52347
52363
  }
52348
52364
  this.emitApplied({
52349
52365
  class: "RichText",
@@ -52372,8 +52388,8 @@ class BoardSelection {
52372
52388
  setFontHighlight(fontHighlight) {
52373
52389
  const isMultiple = !this.items.isSingle();
52374
52390
  const itemsOps = [];
52375
- for (const item of this.items.list()) {
52376
- const text5 = item.getRichText();
52391
+ for (const item2 of this.items.list()) {
52392
+ const text5 = item2.getRichText();
52377
52393
  if (!text5) {
52378
52394
  continue;
52379
52395
  }
@@ -52382,12 +52398,12 @@ class BoardSelection {
52382
52398
  }
52383
52399
  const ops = text5.setSelectionFontHighlight(fontHighlight, this.context);
52384
52400
  itemsOps.push({
52385
- item: item.getId(),
52401
+ item: item2.getId(),
52386
52402
  selection: text5.editor.getSelection(),
52387
52403
  ops
52388
52404
  });
52389
- if (item.itemType !== "AINode") {
52390
- tempStorage.setFontHighlight(item.itemType, fontHighlight);
52405
+ if (item2.itemType !== "AINode") {
52406
+ tempStorage.setFontHighlight(item2.itemType, fontHighlight);
52391
52407
  }
52392
52408
  }
52393
52409
  this.emitApplied({
@@ -52399,8 +52415,8 @@ class BoardSelection {
52399
52415
  setHorisontalAlignment(horisontalAlignment) {
52400
52416
  const isMultiple = !this.items.isSingle();
52401
52417
  const itemsOps = [];
52402
- for (const item of this.items.list()) {
52403
- const text5 = item.getRichText();
52418
+ for (const item2 of this.items.list()) {
52419
+ const text5 = item2.getRichText();
52404
52420
  if (!text5) {
52405
52421
  continue;
52406
52422
  }
@@ -52409,11 +52425,11 @@ class BoardSelection {
52409
52425
  }
52410
52426
  const ops = text5.setSelectionHorisontalAlignment(horisontalAlignment, this.context);
52411
52427
  itemsOps.push({
52412
- item: item.getId(),
52428
+ item: item2.getId(),
52413
52429
  selection: text5.editor.getSelection(),
52414
52430
  ops
52415
52431
  });
52416
- tempStorage.setHorizontalAlignment(item.itemType, horisontalAlignment);
52432
+ tempStorage.setHorizontalAlignment(item2.itemType, horisontalAlignment);
52417
52433
  }
52418
52434
  this.emitApplied({
52419
52435
  class: "RichText",
@@ -52429,23 +52445,23 @@ class BoardSelection {
52429
52445
  verticalAlignment
52430
52446
  });
52431
52447
  if (this.items.isSingle()) {
52432
- const item = this.items.getSingle();
52433
- if (!item) {
52448
+ const item2 = this.items.getSingle();
52449
+ if (!item2) {
52434
52450
  return;
52435
52451
  }
52436
- const text5 = item.getRichText();
52452
+ const text5 = item2.getRichText();
52437
52453
  if (!text5) {
52438
52454
  return;
52439
52455
  }
52440
- tempStorage.setVerticalAlignment(item.itemType, verticalAlignment);
52441
- if (item instanceof RichText) {
52442
- item.setEditorFocus(this.context);
52456
+ tempStorage.setVerticalAlignment(item2.itemType, verticalAlignment);
52457
+ if (item2 instanceof RichText) {
52458
+ item2.setEditorFocus(this.context);
52443
52459
  }
52444
52460
  text5.setEditorFocus(this.context);
52445
52461
  }
52446
52462
  }
52447
52463
  removeFromBoard() {
52448
- const isLocked = this.items.list().some((item) => item.transformation.isLocked);
52464
+ const isLocked = this.items.list().some((item2) => item2.transformation.isLocked);
52449
52465
  if (isLocked) {
52450
52466
  return;
52451
52467
  }
@@ -52468,7 +52484,7 @@ class BoardSelection {
52468
52484
  }
52469
52485
  getIsLockedSelection() {
52470
52486
  const items = this.list();
52471
- return items.some((item) => item.transformation.isLocked);
52487
+ return items.some((item2) => item2.transformation.isLocked);
52472
52488
  }
52473
52489
  isLocked() {
52474
52490
  return false;
@@ -52495,9 +52511,9 @@ class BoardSelection {
52495
52511
  }
52496
52512
  async duplicate() {
52497
52513
  const mediaIds = [];
52498
- this.items.list().forEach((item) => {
52499
- if ("getStorageId" in item) {
52500
- const storageId = item.getStorageId();
52514
+ this.items.list().forEach((item2) => {
52515
+ if ("getStorageId" in item2) {
52516
+ const storageId = item2.getStorageId();
52501
52517
  if (storageId) {
52502
52518
  mediaIds.push(storageId);
52503
52519
  }
@@ -52507,7 +52523,7 @@ class BoardSelection {
52507
52523
  if (!canDuplicate) {
52508
52524
  return;
52509
52525
  }
52510
- const filteredItemMap = Object.fromEntries(Object.entries(this.copy(true)).filter(([_, item]) => item.itemType !== "Group"));
52526
+ const filteredItemMap = Object.fromEntries(Object.entries(this.copy(true)).filter(([_, item2]) => item2.itemType !== "Group"));
52511
52527
  this.board.duplicate(filteredItemMap);
52512
52528
  this.setContext("EditUnderPointer");
52513
52529
  }
@@ -52541,10 +52557,10 @@ class BoardSelection {
52541
52557
  lastAssistantMessageId
52542
52558
  };
52543
52559
  }
52544
- renderItemMbr(context, item, customScale) {
52545
- const mbr = item.getMbr();
52560
+ renderItemMbr(context, item2, customScale) {
52561
+ const mbr = item2.getMbr();
52546
52562
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
52547
- const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
52563
+ const selectionColor = item2.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
52548
52564
  mbr.borderColor = selectionColor;
52549
52565
  mbr.render(context);
52550
52566
  }
@@ -52560,8 +52576,8 @@ class BoardSelection {
52560
52576
  }
52561
52577
  if (!this.transformationRenderBlock) {
52562
52578
  if (this.shouldRenderItemsMbr) {
52563
- for (const item of this.items.list()) {
52564
- this.renderItemMbr(context, item);
52579
+ for (const item2 of this.items.list()) {
52580
+ this.renderItemMbr(context, item2);
52565
52581
  }
52566
52582
  }
52567
52583
  this.tool.render(context);
@@ -52573,7 +52589,7 @@ class BoardSelection {
52573
52589
  if (single && single instanceof AINode) {
52574
52590
  const contextItemsIds = single.getContextItems();
52575
52591
  if (contextItemsIds.length) {
52576
- const newContextItems = this.board.items.listAll().filter((item) => contextItemsIds.includes(item.getId()));
52592
+ const newContextItems = this.board.items.listAll().filter((item2) => contextItemsIds.includes(item2.getId()));
52577
52593
  contextItems.push(...newContextItems);
52578
52594
  }
52579
52595
  }
@@ -52591,15 +52607,15 @@ class BoardSelection {
52591
52607
  }
52592
52608
  }
52593
52609
  }
52594
- contextItems.forEach((item) => {
52595
- if (item instanceof AINode) {
52596
- const path2 = item.getPath();
52610
+ contextItems.forEach((item2) => {
52611
+ if (item2 instanceof AINode) {
52612
+ const path2 = item2.getPath();
52597
52613
  path2.setBorderColor(CONTEXT_NODE_HIGHLIGHT_COLOR);
52598
52614
  path2.setBorderWidth(2);
52599
52615
  path2.setBackgroundColor("none");
52600
52616
  path2.render(context);
52601
52617
  } else {
52602
- const itemRect = item.getMbr();
52618
+ const itemRect = item2.getMbr();
52603
52619
  itemRect.borderColor = CONTEXT_NODE_HIGHLIGHT_COLOR;
52604
52620
  itemRect.strokeWidth = 2;
52605
52621
  itemRect.render(context);
@@ -53100,16 +53116,16 @@ class Board {
53100
53116
  applyBoardOperation(op) {
53101
53117
  switch (op.method) {
53102
53118
  case "moveToZIndex": {
53103
- const item = this.index.getById(op.item);
53104
- if (!item) {
53119
+ const item2 = this.index.getById(op.item);
53120
+ if (!item2) {
53105
53121
  return;
53106
53122
  }
53107
- return this.index.moveToZIndex(item, op.zIndex);
53123
+ return this.index.moveToZIndex(item2, op.zIndex);
53108
53124
  }
53109
53125
  case "moveManyToZIndex": {
53110
53126
  for (const id in op.item) {
53111
- const item = this.items.getById(id);
53112
- if (!item) {
53127
+ const item2 = this.items.getById(id);
53128
+ if (!item2) {
53113
53129
  delete op.item.id;
53114
53130
  }
53115
53131
  }
@@ -53131,11 +53147,11 @@ class Board {
53131
53147
  }
53132
53148
  return this.index.moveSecondAfterFirst(first, second);
53133
53149
  case "bringToFront": {
53134
- const items = op.item.map((item) => this.items.getById(item)).filter((item) => item !== undefined);
53150
+ const items = op.item.map((item2) => this.items.getById(item2)).filter((item2) => item2 !== undefined);
53135
53151
  return this.index.bringManyToFront(items);
53136
53152
  }
53137
53153
  case "sendToBack": {
53138
- const items = op.item.map((item) => this.items.getById(item)).filter((item) => item !== undefined);
53154
+ const items = op.item.map((item2) => this.items.getById(item2)).filter((item2) => item2 !== undefined);
53139
53155
  return this.index.sendManyToBack(items);
53140
53156
  }
53141
53157
  case "add":
@@ -53159,82 +53175,82 @@ class Board {
53159
53175
  applyAddItems(op) {
53160
53176
  if (Array.isArray(op.item)) {
53161
53177
  const data = op.data;
53162
- const items = op.item.map((item2) => {
53163
- const created = this.createItem(item2, data[item2]);
53178
+ const items = op.item.map((item3) => {
53179
+ const created = this.createItem(item3, data[item3]);
53164
53180
  this.index.insert(created);
53165
53181
  return created;
53166
53182
  });
53167
- items.forEach((item2) => {
53168
- if (item2 instanceof Connector2 && data[item2.getId()]) {
53169
- const connectorData = data[item2.getId()];
53170
- item2.applyStartPoint(connectorData.startPoint);
53171
- item2.applyEndPoint(connectorData.endPoint);
53183
+ items.forEach((item3) => {
53184
+ if (item3 instanceof Connector2 && data[item3.getId()]) {
53185
+ const connectorData = data[item3.getId()];
53186
+ item3.applyStartPoint(connectorData.startPoint);
53187
+ item3.applyEndPoint(connectorData.endPoint);
53172
53188
  }
53173
53189
  });
53174
53190
  return;
53175
53191
  }
53176
- const item = this.createItem(op.item, op.data);
53177
- return this.index.insert(item);
53192
+ const item2 = this.createItem(op.item, op.data);
53193
+ return this.index.insert(item2);
53178
53194
  }
53179
53195
  applyAddLockedGroupOperation(op) {
53180
- const item = this.createItem(op.item, op.data);
53181
- const groupChildrenIds = item.getChildrenIds();
53182
- this.index.insert(item);
53196
+ const item2 = this.createItem(op.item, op.data);
53197
+ const groupChildrenIds = item2.getChildrenIds();
53198
+ this.index.insert(item2);
53183
53199
  const lastChildrenId = this.index.getById(groupChildrenIds[groupChildrenIds.length - 1]);
53184
53200
  if (lastChildrenId) {
53185
53201
  const zIndex = this.index.getZIndex(lastChildrenId) + 1;
53186
- this.index.moveToZIndex(item, zIndex);
53202
+ this.index.moveToZIndex(item2, zIndex);
53187
53203
  }
53188
- item.getChildren().forEach((item2) => {
53189
- item2.transformation.isLocked = true;
53204
+ item2.getChildren().forEach((item3) => {
53205
+ item3.transformation.isLocked = true;
53190
53206
  });
53191
- item.transformation.isLocked = true;
53207
+ item2.transformation.isLocked = true;
53192
53208
  }
53193
53209
  applyRemoveOperation(op) {
53194
53210
  const removedItems = [];
53195
- this.findItemAndApply(op.item, (item) => {
53196
- this.index.remove(item);
53197
- this.selection.remove(item);
53198
- if (item instanceof Connector2) {
53199
- item.clearObservedItems();
53211
+ this.findItemAndApply(op.item, (item2) => {
53212
+ this.index.remove(item2);
53213
+ this.selection.remove(item2);
53214
+ if (item2 instanceof Connector2) {
53215
+ item2.clearObservedItems();
53200
53216
  }
53201
- removedItems.push(item);
53217
+ removedItems.push(item2);
53202
53218
  });
53203
53219
  }
53204
53220
  applyRemoveLockedGroupOperation(op) {
53205
- const item = this.index.getById(op.item[0]);
53206
- if (!item || !(item instanceof Group)) {
53221
+ const item2 = this.index.getById(op.item[0]);
53222
+ if (!item2 || !(item2 instanceof Group)) {
53207
53223
  return;
53208
53224
  }
53209
- item.getChildren().forEach((item2) => {
53210
- item2.transformation.isLocked = false;
53211
- item2.parent = "Board";
53225
+ item2.getChildren().forEach((item3) => {
53226
+ item3.transformation.isLocked = false;
53227
+ item3.parent = "Board";
53212
53228
  });
53213
- item.transformation.isLocked = false;
53229
+ item2.transformation.isLocked = false;
53214
53230
  const removedItems = [];
53215
- this.findItemAndApply(op.item, (item2) => {
53216
- this.index.remove(item2);
53217
- this.selection.remove(item2);
53218
- removedItems.push(item2);
53231
+ this.findItemAndApply(op.item, (item3) => {
53232
+ this.index.remove(item3);
53233
+ this.selection.remove(item3);
53234
+ removedItems.push(item3);
53219
53235
  });
53220
53236
  }
53221
53237
  applyItemOperation(op) {
53222
53238
  if ("item" in op) {
53223
- this.findItemAndApply(op.item, (item) => {
53224
- item.apply(op);
53239
+ this.findItemAndApply(op.item, (item2) => {
53240
+ item2.apply(op);
53225
53241
  });
53226
53242
  }
53227
53243
  }
53228
- findItemAndApply(item, apply) {
53229
- if (Array.isArray(item)) {
53230
- for (const itemId of item) {
53244
+ findItemAndApply(item2, apply) {
53245
+ if (Array.isArray(item2)) {
53246
+ for (const itemId of item2) {
53231
53247
  const found = this.items.findById(itemId);
53232
53248
  if (found) {
53233
53249
  apply(found);
53234
53250
  }
53235
53251
  }
53236
53252
  } else {
53237
- const found = this.items.findById(item);
53253
+ const found = this.items.findById(item2);
53238
53254
  if (found) {
53239
53255
  apply(found);
53240
53256
  }
@@ -53243,9 +53259,9 @@ class Board {
53243
53259
  handleNesting(items) {
53244
53260
  const arrayed = Array.isArray(items) ? items : [items];
53245
53261
  const groupsMap = new Map;
53246
- arrayed.forEach((item) => {
53247
- const itemCenter = item.getMbr().getCenter();
53248
- const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item)).reduce((acc, groupItem2) => {
53262
+ arrayed.forEach((item2) => {
53263
+ const itemCenter = item2.getMbr().getCenter();
53264
+ const groupItem = this.items.getGroupItemsInView().filter((groupItem2) => groupItem2.handleNesting(item2)).reduce((acc, groupItem2) => {
53249
53265
  if (!acc || groupItem2.getDistanceToPoint(itemCenter) > acc.getDistanceToPoint(itemCenter)) {
53250
53266
  acc = groupItem2;
53251
53267
  }
@@ -53255,7 +53271,7 @@ class Board {
53255
53271
  if (!groupsMap.has(groupItem)) {
53256
53272
  groupsMap.set(groupItem, []);
53257
53273
  }
53258
- groupsMap.get(groupItem)?.push(item);
53274
+ groupsMap.get(groupItem)?.push(item2);
53259
53275
  }
53260
53276
  });
53261
53277
  groupsMap.forEach((items2, group) => {
@@ -53276,13 +53292,13 @@ class Board {
53276
53292
  }
53277
53293
  return parser(el);
53278
53294
  }
53279
- add(item, timeStamp) {
53295
+ add(item2, timeStamp) {
53280
53296
  const id = this.getNewItemId();
53281
53297
  this.emit({
53282
53298
  class: "Board",
53283
53299
  method: "add",
53284
53300
  item: id,
53285
- data: item.serialize(),
53301
+ data: item2.serialize(),
53286
53302
  timeStamp
53287
53303
  });
53288
53304
  const newItem = this.items.getById(id);
@@ -53292,13 +53308,13 @@ class Board {
53292
53308
  this.handleNesting(newItem);
53293
53309
  return newItem;
53294
53310
  }
53295
- addLockedGroup(item) {
53311
+ addLockedGroup(item2) {
53296
53312
  const id = this.getNewItemId();
53297
53313
  this.emit({
53298
53314
  class: "Board",
53299
53315
  method: "addLockedGroup",
53300
53316
  item: id,
53301
- data: item.serialize()
53317
+ data: item2.serialize()
53302
53318
  });
53303
53319
  const newItem = this.items.getById(id);
53304
53320
  if (!newItem) {
@@ -53307,32 +53323,32 @@ class Board {
53307
53323
  this.handleNesting(newItem);
53308
53324
  return newItem;
53309
53325
  }
53310
- remove(item, withConnectors = true) {
53326
+ remove(item2, withConnectors = true) {
53311
53327
  let connectors = [];
53312
53328
  if (withConnectors) {
53313
- connectors = this.items.getLinkedConnectorsById(item.getId()).map((connector) => connector.getId());
53329
+ connectors = this.items.getLinkedConnectorsById(item2.getId()).map((connector) => connector.getId());
53314
53330
  }
53315
- if ("onRemove" in item) {
53316
- item.onRemove();
53331
+ if ("onRemove" in item2) {
53332
+ item2.onRemove();
53317
53333
  }
53318
53334
  this.emit({
53319
53335
  class: "Board",
53320
53336
  method: "remove",
53321
- item: [item.getId(), ...connectors]
53337
+ item: [item2.getId(), ...connectors]
53322
53338
  });
53323
53339
  }
53324
- removeLockedGroup(item) {
53340
+ removeLockedGroup(item2) {
53325
53341
  this.emit({
53326
53342
  class: "Board",
53327
53343
  method: "removeLockedGroup",
53328
- item: [item.getId()]
53344
+ item: [item2.getId()]
53329
53345
  });
53330
53346
  }
53331
53347
  getByZIndex(index2) {
53332
53348
  return this.index.getByZIndex(index2);
53333
53349
  }
53334
- getZIndex(item) {
53335
- return this.index.getZIndex(item);
53350
+ getZIndex(item2) {
53351
+ return this.index.getZIndex(item2);
53336
53352
  }
53337
53353
  getLastZIndex() {
53338
53354
  return this.index.getLastZIndex();
@@ -53344,11 +53360,11 @@ class Board {
53344
53360
  item: items
53345
53361
  });
53346
53362
  }
53347
- moveToZIndex(item, zIndex) {
53363
+ moveToZIndex(item2, zIndex) {
53348
53364
  this.emit({
53349
53365
  class: "Board",
53350
53366
  method: "moveToZIndex",
53351
- item: item.getId(),
53367
+ item: item2.getId(),
53352
53368
  zIndex
53353
53369
  });
53354
53370
  }
@@ -53376,8 +53392,8 @@ class Board {
53376
53392
  this.emit({
53377
53393
  class: "Board",
53378
53394
  method: "bringToFront",
53379
- item: items.map((item) => item.getId()),
53380
- prevZIndex: Object.fromEntries(boardItems.map((item) => [item.getId(), boardItems.indexOf(item)]))
53395
+ item: items.map((item2) => item2.getId()),
53396
+ prevZIndex: Object.fromEntries(boardItems.map((item2) => [item2.getId(), boardItems.indexOf(item2)]))
53381
53397
  });
53382
53398
  }
53383
53399
  sendToBack(items) {
@@ -53388,8 +53404,8 @@ class Board {
53388
53404
  this.emit({
53389
53405
  class: "Board",
53390
53406
  method: "sendToBack",
53391
- item: items.map((item) => item.getId()),
53392
- prevZIndex: Object.fromEntries(boardItems.map((item) => [item.getId(), boardItems.indexOf(item)]))
53407
+ item: items.map((item2) => item2.getId()),
53408
+ prevZIndex: Object.fromEntries(boardItems.map((item2) => [item2.getId(), boardItems.indexOf(item2)]))
53393
53409
  });
53394
53410
  }
53395
53411
  copy() {
@@ -53466,7 +53482,7 @@ class Board {
53466
53482
  return added;
53467
53483
  });
53468
53484
  addedFrame.addChildItems(addedChildren);
53469
- parsedData.data.children = addedChildren.map((item) => item.getId());
53485
+ parsedData.data.children = addedChildren.map((item2) => item2.getId());
53470
53486
  idsMap[parsedData.data.id] = addedFrame.getId();
53471
53487
  } else {
53472
53488
  const added = this.add(this.createItem(this.getNewItemId(), parsedData));
@@ -53507,15 +53523,15 @@ class Board {
53507
53523
  const createdConnectors = {};
53508
53524
  const createdFrames = {};
53509
53525
  const addItem = (itemData) => {
53510
- const item = this.createItem(itemData.id, itemData);
53511
- if (item instanceof Connector2) {
53512
- createdConnectors[itemData.id] = { item, itemData };
53526
+ const item2 = this.createItem(itemData.id, itemData);
53527
+ if (item2 instanceof Connector2) {
53528
+ createdConnectors[itemData.id] = { item: item2, itemData };
53513
53529
  }
53514
- if (item instanceof Frame2) {
53515
- createdFrames[item.getId()] = { item, itemData };
53530
+ if (item2 instanceof Frame2) {
53531
+ createdFrames[item2.getId()] = { item: item2, itemData };
53516
53532
  }
53517
- this.index.insert(item);
53518
- return item;
53533
+ this.index.insert(item2);
53534
+ return item2;
53519
53535
  };
53520
53536
  for (const itemData of items) {
53521
53537
  if ("childrenMap" in itemData) {
@@ -53526,13 +53542,13 @@ class Board {
53526
53542
  }
53527
53543
  }
53528
53544
  for (const key in createdConnectors) {
53529
- const { item, itemData } = createdConnectors[key];
53530
- item.applyStartPoint(itemData.startPoint);
53531
- item.applyEndPoint(itemData.endPoint);
53545
+ const { item: item2, itemData } = createdConnectors[key];
53546
+ item2.applyStartPoint(itemData.startPoint);
53547
+ item2.applyEndPoint(itemData.endPoint);
53532
53548
  }
53533
53549
  for (const key in createdFrames) {
53534
- const { item, itemData } = createdFrames[key];
53535
- item.applyAddChildren(itemData.children);
53550
+ const { item: item2, itemData } = createdFrames[key];
53551
+ item2.applyAddChildren(itemData.children);
53536
53552
  }
53537
53553
  }
53538
53554
  deserialize(snapshot) {
@@ -53542,33 +53558,33 @@ class Board {
53542
53558
  const createdFrames = {};
53543
53559
  if (Array.isArray(items)) {
53544
53560
  for (const itemData of items) {
53545
- const item = this.createItem(itemData.id, itemData);
53546
- if (item instanceof Connector2) {
53547
- createdConnectors[itemData.id] = { item, itemData };
53561
+ const item2 = this.createItem(itemData.id, itemData);
53562
+ if (item2 instanceof Connector2) {
53563
+ createdConnectors[itemData.id] = { item: item2, itemData };
53548
53564
  }
53549
- if (item instanceof Frame2) {
53550
- createdFrames[item.getId()] = { item, itemData };
53565
+ if (item2 instanceof Frame2) {
53566
+ createdFrames[item2.getId()] = { item: item2, itemData };
53551
53567
  }
53552
- this.index.insert(item);
53568
+ this.index.insert(item2);
53553
53569
  }
53554
53570
  } else {
53555
53571
  for (const key in items) {
53556
53572
  const itemData = items[key];
53557
- const item = this.createItem(key, itemData);
53558
- if (item instanceof Connector2) {
53559
- createdConnectors[key] = { item, itemData };
53573
+ const item2 = this.createItem(key, itemData);
53574
+ if (item2 instanceof Connector2) {
53575
+ createdConnectors[key] = { item: item2, itemData };
53560
53576
  }
53561
- this.index.insert(item);
53577
+ this.index.insert(item2);
53562
53578
  }
53563
53579
  }
53564
53580
  for (const key in createdConnectors) {
53565
- const { item, itemData } = createdConnectors[key];
53566
- item.applyStartPoint(itemData.startPoint);
53567
- item.applyEndPoint(itemData.endPoint);
53581
+ const { item: item2, itemData } = createdConnectors[key];
53582
+ item2.applyStartPoint(itemData.startPoint);
53583
+ item2.applyEndPoint(itemData.endPoint);
53568
53584
  }
53569
53585
  for (const key in createdFrames) {
53570
- const { item, itemData } = createdFrames[key];
53571
- item.applyAddChildren(itemData.children);
53586
+ const { item: item2, itemData } = createdFrames[key];
53587
+ item2.applyAddChildren(itemData.children);
53572
53588
  }
53573
53589
  this.events?.log.deserialize(events);
53574
53590
  }
@@ -53806,7 +53822,7 @@ class Board {
53806
53822
  itemsMap: newMap,
53807
53823
  select: select2
53808
53824
  });
53809
- const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
53825
+ const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item2) => typeof item2 !== "undefined");
53810
53826
  this.handleNesting(items);
53811
53827
  this.selection.removeAll();
53812
53828
  this.selection.add(items);
@@ -53814,8 +53830,8 @@ class Board {
53814
53830
  return;
53815
53831
  }
53816
53832
  removeVoidComments() {
53817
- const voidComments = this.items.listAll().filter((item) => {
53818
- return item instanceof Comment && !item.getThread().length;
53833
+ const voidComments = this.items.listAll().filter((item2) => {
53834
+ return item2 instanceof Comment && !item2.getThread().length;
53819
53835
  });
53820
53836
  if (voidComments) {
53821
53837
  for (const comment2 of voidComments) {
@@ -53889,7 +53905,7 @@ class Board {
53889
53905
  }
53890
53906
  const mbr = this.selection.getMbr();
53891
53907
  const selectedItems = this.selection.items.list();
53892
- const isSelectedItemsMinWidth = selectedItems.some((item) => item.getMbr().getWidth() === 0);
53908
+ const isSelectedItemsMinWidth = selectedItems.some((item2) => item2.getMbr().getWidth() === 0);
53893
53909
  const right = mbr ? mbr.right : 0;
53894
53910
  const top = mbr ? mbr.top : 0;
53895
53911
  const width2 = mbr ? mbr.getWidth() / 10 : 10;
@@ -53931,7 +53947,7 @@ class Board {
53931
53947
  method: "duplicate",
53932
53948
  itemsMap: newMap
53933
53949
  });
53934
- const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item) => typeof item !== "undefined");
53950
+ const items = Object.keys(newMap).map((id) => this.items.getById(id)).filter((item2) => typeof item2 !== "undefined");
53935
53951
  this.handleNesting(items);
53936
53952
  this.selection.removeAll();
53937
53953
  this.selection.add(items);
@@ -53952,9 +53968,9 @@ class Board {
53952
53968
  if (data.itemType === "Frame") {
53953
53969
  data.text.placeholderText = `Frame ${this.getMaxFrameSerial() + 1}`;
53954
53970
  }
53955
- const item = this.createItem(itemId, data);
53956
- this.index.insert(item);
53957
- items.push(item);
53971
+ const item2 = this.createItem(itemId, data);
53972
+ this.index.insert(item2);
53973
+ items.push(item2);
53958
53974
  };
53959
53975
  sortedItemsMap.map(([id, data]) => {
53960
53976
  if (data.itemType === "Connector") {
@@ -53969,8 +53985,8 @@ class Board {
53969
53985
  return;
53970
53986
  });
53971
53987
  }
53972
- isOnBoard(item) {
53973
- return this.items.findById(item.getId()) !== undefined;
53988
+ isOnBoard(item2) {
53989
+ return this.items.findById(item2.getId()) !== undefined;
53974
53990
  }
53975
53991
  getMaxFrameSerial() {
53976
53992
  const existingNames = this.items.listGroupItems().map((frame) => frame.getRichText()?.getTextString().length === 0 ? frame.getRichText()?.placeholderText || "" : frame.getRichText()?.getTextString() || "");
@@ -54016,7 +54032,7 @@ function areItemsTheSame(opA, opB) {
54016
54032
  const itemsB = Object.keys(opB.items);
54017
54033
  const setA = new Set(itemsA);
54018
54034
  const setB = new Set(itemsB);
54019
- const areArraysEqual = setA.size === setB.size && [...setA].every((item) => setB.has(item));
54035
+ const areArraysEqual = setA.size === setB.size && [...setA].every((item2) => setB.has(item2));
54020
54036
  return areArraysEqual;
54021
54037
  }
54022
54038
  if (!(Array.isArray(opA.item) && Array.isArray(opB.item))) {
@@ -55675,9 +55691,9 @@ function insertEventsFromOtherConnectionsIntoList(value, list6, board) {
55675
55691
  list6.applyUnconfirmed(filter);
55676
55692
  const hasAnyOverlap = (arr1, arr2) => {
55677
55693
  const lookup9 = new Set(arr1);
55678
- return arr2.some((item) => lookup9.has(item));
55694
+ return arr2.some((item2) => lookup9.has(item2));
55679
55695
  };
55680
- const currSelection = board.selection.list().map((item) => item.getId());
55696
+ const currSelection = board.selection.list().map((item2) => item2.getId());
55681
55697
  if (hasAnyOverlap(currSelection, createdItems) || hasAnyOverlap(currSelection, updatedText)) {
55682
55698
  board.selection.applyMemoizedCaretOrRange();
55683
55699
  }
@@ -55999,27 +56015,27 @@ function handleAiChatMassage(message, board) {
55999
56015
  }
56000
56016
  }
56001
56017
  function handleChatChunk(chunk, board) {
56002
- const item = board.items.getById(chunk.itemId);
56018
+ const item2 = board.items.getById(chunk.itemId);
56003
56019
  switch (chunk.type) {
56004
56020
  case "chunk":
56005
- if (!item || item.itemType !== "AINode") {
56021
+ if (!item2 || item2.itemType !== "AINode") {
56006
56022
  return;
56007
56023
  }
56008
- item.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
56024
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
56009
56025
  break;
56010
56026
  case "done":
56011
- if (!item || item.itemType !== "AINode") {
56027
+ if (!item2 || item2.itemType !== "AINode") {
56012
56028
  board.aiGeneratingOnItem = undefined;
56013
56029
  return;
56014
56030
  }
56015
- item.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56031
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56016
56032
  break;
56017
56033
  case "end":
56018
- if (!item || item.itemType !== "AINode") {
56034
+ if (!item2 || item2.itemType !== "AINode") {
56019
56035
  board.aiGeneratingOnItem = undefined;
56020
56036
  return;
56021
56037
  }
56022
- item.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56038
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
56023
56039
  break;
56024
56040
  case "error":
56025
56041
  default:
@@ -56036,7 +56052,7 @@ function handleChatChunk(chunk, board) {
56036
56052
  if (board.aiGeneratingOnItem && generatingItem) {
56037
56053
  board.selection.removeAll();
56038
56054
  board.selection.add(generatingItem);
56039
- const rt = item?.getRichText();
56055
+ const rt = item2?.getRichText();
56040
56056
  if (generatingItem.itemType === "AINode" && rt) {
56041
56057
  const editor = rt.editor;
56042
56058
  editor.markdownProcessor.setStopProcessingMarkDownCb(null);
@@ -56169,14 +56185,14 @@ function handleImageGenerate(response, board) {
56169
56185
  console.error("Image generation error:", response.message);
56170
56186
  if (response.isExternalApiError) {
56171
56187
  if (board.aiGeneratingOnItem) {
56172
- const item = board.items.getById(board.aiGeneratingOnItem);
56173
- if (item) {
56188
+ const item2 = board.items.getById(board.aiGeneratingOnItem);
56189
+ if (item2) {
56174
56190
  board.selection.removeAll();
56175
- board.selection.add(item);
56176
- const editor = item.getRichText()?.editor;
56191
+ board.selection.add(item2);
56192
+ const editor = item2.getRichText()?.editor;
56177
56193
  editor?.clearText();
56178
56194
  editor?.insertCopiedText(conf.i18n.t("AIInput.nodeErrorText"));
56179
- board.camera.zoomToFit(item.getMbr(), 20);
56195
+ board.camera.zoomToFit(item2.getMbr(), 20);
56180
56196
  }
56181
56197
  }
56182
56198
  } else {