microboard-temp 0.1.21 → 0.1.23

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.
@@ -7993,7 +7993,7 @@ var Browser = /* @__PURE__ */ function() {
7993
7993
  }();
7994
7994
  Browser.type = "languageDetector";
7995
7995
 
7996
- // src/api/initI18N.ts
7996
+ // src/api/initDefaultI18N.ts
7997
7997
  var defaultNS = "default";
7998
7998
  var resources = {
7999
7999
  en: {
@@ -8003,22 +8003,22 @@ var resources = {
8003
8003
  default: {}
8004
8004
  }
8005
8005
  };
8006
- function initI18N(isNode = false) {
8006
+ function initDefaultI18N() {
8007
8007
  instance.use(Browser).init({
8008
- debug: conf2.debug,
8008
+ debug: conf.debug,
8009
8009
  detection: {
8010
8010
  order: ["navigator"]
8011
8011
  },
8012
8012
  supportedLngs: ["en", "ru"],
8013
8013
  defaultNS,
8014
8014
  resources,
8015
- fallbackLng: conf2.FALLBACK_LNG,
8015
+ fallbackLng: conf.FALLBACK_LNG,
8016
8016
  interpolation: {
8017
8017
  escapeValue: false
8018
8018
  }
8019
8019
  });
8020
- conf2.i18n = instance;
8021
- conf2.planNames = {
8020
+ conf.i18n = instance;
8021
+ conf.planNames = {
8022
8022
  basic: instance.t("userPlan.plans.basic.name"),
8023
8023
  plus: instance.t("userPlan.plans.plus.name")
8024
8024
  };
@@ -8033,7 +8033,7 @@ var ExportQuality;
8033
8033
  ExportQuality2[ExportQuality2["STANDARD"] = 2] = "STANDARD";
8034
8034
  ExportQuality2[ExportQuality2["LOW"] = 3] = "LOW";
8035
8035
  })(ExportQuality ||= {});
8036
- var conf2 = {
8036
+ var conf = {
8037
8037
  connection: undefined,
8038
8038
  path2DFactory: typeof Path2D !== "undefined" ? BrowserPath2D : MockPath2D,
8039
8039
  documentFactory: typeof document !== "undefined" ? new BrowserDocumentFactory : new MockDocumentFactory,
@@ -8360,7 +8360,7 @@ var conf2 = {
8360
8360
  FALLBACK_LNG: "en",
8361
8361
  cursorsMap
8362
8362
  };
8363
- initI18N();
8363
+ initDefaultI18N();
8364
8364
 
8365
8365
  // src/Items/Transformation/Matrix.ts
8366
8366
  class Matrix2 {
@@ -9081,7 +9081,7 @@ class DrawingContext {
9081
9081
  this.setCamera(camera);
9082
9082
  }
9083
9083
  dpi() {
9084
- return conf2.getDPI();
9084
+ return conf.getDPI();
9085
9085
  }
9086
9086
  setCamera(camera) {
9087
9087
  this.camera = camera;
@@ -9091,7 +9091,7 @@ class DrawingContext {
9091
9091
  }
9092
9092
  clear() {
9093
9093
  this.ctx.setTransform(1 * this.dpi(), 0, 0, 1 * this.dpi(), 0, 0);
9094
- this.ctx.clearRect(0, 0, conf2.getDocumentWidth(), conf2.getDocumentHeight());
9094
+ this.ctx.clearRect(0, 0, conf.getDocumentWidth(), conf.getDocumentHeight());
9095
9095
  this.matrix.applyToContext(this.ctx);
9096
9096
  }
9097
9097
  clearCursor() {
@@ -9099,7 +9099,7 @@ class DrawingContext {
9099
9099
  return;
9100
9100
  }
9101
9101
  this.cursorCtx.setTransform(1 * this.dpi(), 0, 0, 1 * this.dpi(), 0, 0);
9102
- this.cursorCtx.clearRect(0, 0, conf2.getDocumentWidth(), conf2.getDocumentHeight());
9102
+ this.cursorCtx.clearRect(0, 0, conf.getDocumentWidth(), conf.getDocumentHeight());
9103
9103
  this.matrix.applyToContext(this.cursorCtx);
9104
9104
  }
9105
9105
  applyChanges() {
@@ -9202,7 +9202,7 @@ class Path {
9202
9202
  this.width = this.getMbr().getWidth();
9203
9203
  this.height = this.getMbr().getHeight();
9204
9204
  this.maxDimension = Math.max(mbr.getWidth(), mbr.getHeight());
9205
- this.path2d = new conf2.path2DFactory;
9205
+ this.path2d = new conf.path2DFactory;
9206
9206
  this.updateCache();
9207
9207
  }
9208
9208
  getBackgroundColor() {
@@ -9279,7 +9279,7 @@ class Path {
9279
9279
  this.y = top - this.paddingTop;
9280
9280
  this.width = right - left + this.paddingLeft + this.paddingRight;
9281
9281
  this.height = bottom - top + this.paddingTop + this.paddingBottom;
9282
- const path2d = new conf2.path2DFactory;
9282
+ const path2d = new conf.path2DFactory;
9283
9283
  if (this.segments.length === 0) {
9284
9284
  return;
9285
9285
  }
@@ -10323,7 +10323,7 @@ var parsersHTML = {
10323
10323
  "comment-item": parseHTMLComment
10324
10324
  };
10325
10325
  var decodeHtml = (htmlString) => {
10326
- const parser = conf2.getDOMParser();
10326
+ const parser = conf.getDOMParser();
10327
10327
  const doc = parser.parseFromString(htmlString, "text/html");
10328
10328
  return doc.documentElement.textContent || "";
10329
10329
  };
@@ -10352,10 +10352,10 @@ function parseHTMLRichText(el, options) {
10352
10352
  italic: node.style.fontStyle === "italic",
10353
10353
  underline: node.style.textDecoration.includes("underline"),
10354
10354
  "line-through": node.style.textDecoration.includes("line-through"),
10355
- fontColor: node.style.color || conf2.DEFAULT_TEXT_STYLES.fontColor,
10356
- fontHighlight: node.style.backgroundColor || conf2.DEFAULT_TEXT_STYLES.fontHighlight,
10357
- fontSize: parseFloat(node.style.fontSize) || conf2.DEFAULT_TEXT_STYLES.fontSize,
10358
- fontFamily: node.style.fontFamily || conf2.DEFAULT_TEXT_STYLES.fontFamily,
10355
+ fontColor: node.style.color || conf.DEFAULT_TEXT_STYLES.fontColor,
10356
+ fontHighlight: node.style.backgroundColor || conf.DEFAULT_TEXT_STYLES.fontHighlight,
10357
+ fontSize: parseFloat(node.style.fontSize) || conf.DEFAULT_TEXT_STYLES.fontSize,
10358
+ fontFamily: node.style.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily,
10359
10359
  overline: false,
10360
10360
  subscript: false,
10361
10361
  superscript: false
@@ -10420,7 +10420,7 @@ function parseHTMLRichText(el, options) {
10420
10420
  return {
10421
10421
  type: "paragraph",
10422
10422
  ...extractCommonProps(),
10423
- lineHeight: parseFloat(node.style.lineHeight) || conf2.DEFAULT_TEXT_STYLES.lineHeight,
10423
+ lineHeight: parseFloat(node.style.lineHeight) || conf.DEFAULT_TEXT_STYLES.lineHeight,
10424
10424
  children: children2
10425
10425
  };
10426
10426
  default:
@@ -16900,8 +16900,8 @@ class LinkTo {
16900
16900
  const ctx = context.ctx;
16901
16901
  ctx.save();
16902
16902
  ctx.globalCompositeOperation = "destination-out";
16903
- const size = conf2.LINK_BTN_SIZE / scale;
16904
- const offset = conf2.LINK_BTN_OFFSET / scale;
16903
+ const size = conf.LINK_BTN_SIZE / scale;
16904
+ const offset = conf.LINK_BTN_OFFSET / scale;
16905
16905
  ctx.fillRect(right - size - offset, top + offset, size, size);
16906
16906
  ctx.restore();
16907
16907
  }
@@ -17052,7 +17052,7 @@ function getBlockNode(data, maxWidth, isFrame, listData, listMark, newLine = fal
17052
17052
  } else if (node3.type === "ul_list" && !listData) {
17053
17053
  listData = { level: 0, isNumberedList: false };
17054
17054
  }
17055
- const listMarks = conf2[getListMarkType((listData?.level || 0) + 1)];
17055
+ const listMarks = conf[getListMarkType((listData?.level || 0) + 1)];
17056
17056
  for (let i = 0;i < data.children.length; i++) {
17057
17057
  const child = structuredClone(data.children[i]);
17058
17058
  switch (child.type) {
@@ -17457,8 +17457,8 @@ function measureText(text, style, paddingTop = 0, marginLeft = 0) {
17457
17457
  rect2.height += paddingTop;
17458
17458
  }
17459
17459
  }
17460
- conf2.measureCtx.font = style.font;
17461
- const measure = conf2.measureCtx.measureText(text);
17460
+ conf.measureCtx.font = style.font;
17461
+ const measure = conf.measureCtx.measureText(text);
17462
17462
  const actualBoundingBoxAscent = toFiniteNumber2(measure.actualBoundingBoxAscent);
17463
17463
  const actualBoundingBoxDescent = toFiniteNumber2(measure.actualBoundingBoxDescent);
17464
17464
  const actualBoundingBoxLeft = toFiniteNumber2(measure.actualBoundingBoxLeft);
@@ -19188,7 +19188,7 @@ var create2 = (key) => {
19188
19188
  return false;
19189
19189
  };
19190
19190
  };
19191
- var hotkeys2 = {
19191
+ var hotkeys = {
19192
19192
  isBold: create2("bold"),
19193
19193
  isCompose: create2("compose"),
19194
19194
  isMoveBackward: create2("moveBackward"),
@@ -26580,7 +26580,7 @@ var convertLinkNodeToTextNode = (node4) => {
26580
26580
  const link = node4.link;
26581
26581
  const text3 = node4.children.map((child) => child.text).join("");
26582
26582
  return {
26583
- ...conf2.DEFAULT_TEXT_STYLES,
26583
+ ...conf.DEFAULT_TEXT_STYLES,
26584
26584
  type: "text",
26585
26585
  text: text3,
26586
26586
  link,
@@ -26596,9 +26596,9 @@ function setNodeChildrenStyles({
26596
26596
  horisontalAlignment,
26597
26597
  node: node4
26598
26598
  }) {
26599
- let fontStyles = conf2.DEFAULT_TEXT_STYLES;
26599
+ let fontStyles = conf.DEFAULT_TEXT_STYLES;
26600
26600
  if (editor) {
26601
- fontStyles = Editor.marks(editor) || conf2.DEFAULT_TEXT_STYLES;
26601
+ fontStyles = Editor.marks(editor) || conf.DEFAULT_TEXT_STYLES;
26602
26602
  }
26603
26603
  switch (node4.type) {
26604
26604
  case "heading_one":
@@ -26630,7 +26630,7 @@ function setNodeChildrenStyles({
26630
26630
  children.text += " ";
26631
26631
  }
26632
26632
  let fontColor = fontStyles.fontColor;
26633
- if (fontColor === conf2.DEFAULT_TEXT_STYLES.fontColor && children.link) {
26633
+ if (fontColor === conf.DEFAULT_TEXT_STYLES.fontColor && children.link) {
26634
26634
  fontColor = "rgba(71, 120, 245, 1)";
26635
26635
  }
26636
26636
  return {
@@ -26670,8 +26670,6 @@ function setNodeStyles({
26670
26670
  }
26671
26671
 
26672
26672
  // src/Items/RichText/editorHelpers/markdown/markdownProcessor.ts
26673
- var { i18n: i18n2 } = conf2;
26674
-
26675
26673
  class MarkdownProcessor {
26676
26674
  chunksQueue = [];
26677
26675
  isProcessingChunk = false;
@@ -26702,7 +26700,7 @@ class MarkdownProcessor {
26702
26700
  this.subject.publish(this);
26703
26701
  return true;
26704
26702
  }
26705
- if (i18n2.t && text3.startsWith(i18n2.t("AIInput.generatingResponse"))) {
26703
+ if (text3.startsWith(conf.i18n.t("AIInput.generatingResponse"))) {
26706
26704
  return true;
26707
26705
  }
26708
26706
  const isPrevTextEmpty = isTextEmpty(this.editor.children);
@@ -26760,7 +26758,7 @@ class MarkdownProcessor {
26760
26758
  return;
26761
26759
  }
26762
26760
  const prevText = this.getText()?.[this.getText().length - 1]?.children[0]?.text;
26763
- if (i18n2.t && prevText?.startsWith(i18n2.t("AIInput.generatingResponse"))) {
26761
+ if (prevText?.startsWith(conf.i18n.t("AIInput.generatingResponse"))) {
26764
26762
  clearText(this.editor);
26765
26763
  }
26766
26764
  if (chunk.includes(`
@@ -27786,7 +27784,7 @@ class RichTextCommand {
27786
27784
  item: id,
27787
27785
  operation: {
27788
27786
  ...this.operation,
27789
- fontColor: this.board.items.getById(id)?.getRichText()?.getFontColor() || conf2.DEFAULT_TEXT_STYLES.fontColor
27787
+ fontColor: this.board.items.getById(id)?.getRichText()?.getFontColor() || conf.DEFAULT_TEXT_STYLES.fontColor
27790
27788
  }
27791
27789
  }));
27792
27790
  case "setBlockType":
@@ -27810,7 +27808,7 @@ class RichTextCommand {
27810
27808
  item: id,
27811
27809
  operation: {
27812
27810
  ...this.operation,
27813
- fontFamily: this.board.items.getById(id)?.getRichText()?.getFontFamily() || conf2.DEFAULT_TEXT_STYLES.fontFamily
27811
+ fontFamily: this.board.items.getById(id)?.getRichText()?.getFontFamily() || conf.DEFAULT_TEXT_STYLES.fontFamily
27814
27812
  }
27815
27813
  }));
27816
27814
  case "setFontSize":
@@ -27818,7 +27816,7 @@ class RichTextCommand {
27818
27816
  item: id,
27819
27817
  operation: {
27820
27818
  ...this.operation,
27821
- fontSize: this.board.items.getById(id)?.getRichText()?.getFontSize() || conf2.DEFAULT_TEXT_STYLES.fontSize
27819
+ fontSize: this.board.items.getById(id)?.getRichText()?.getFontSize() || conf.DEFAULT_TEXT_STYLES.fontSize
27822
27820
  }
27823
27821
  }));
27824
27822
  case "setFontHighlight":
@@ -27826,7 +27824,7 @@ class RichTextCommand {
27826
27824
  item: id,
27827
27825
  operation: {
27828
27826
  ...this.operation,
27829
- fontHighlight: this.board.items.getById(id)?.getRichText()?.getFontHighlight() || conf2.DEFAULT_TEXT_STYLES.fontHighlight
27827
+ fontHighlight: this.board.items.getById(id)?.getRichText()?.getFontHighlight() || conf.DEFAULT_TEXT_STYLES.fontHighlight
27830
27828
  }
27831
27829
  }));
27832
27830
  case "setHorisontalAlignment":
@@ -29045,7 +29043,6 @@ class BaseItem extends Mbr {
29045
29043
  }
29046
29044
 
29047
29045
  // src/Items/RichText/RichText.ts
29048
- var { i18n: i18n3 } = conf2;
29049
29046
  var isEditInProcessValue = false;
29050
29047
  var counter = 0;
29051
29048
 
@@ -29066,7 +29063,7 @@ class RichText extends BaseItem {
29066
29063
  isContainerSet = false;
29067
29064
  isRenderEnabled = true;
29068
29065
  layoutNodes;
29069
- clipPath = new conf2.path2DFactory;
29066
+ clipPath = new conf.path2DFactory;
29070
29067
  updateRequired = false;
29071
29068
  autoSizeScale = 1;
29072
29069
  containerMaxWidth;
@@ -29081,7 +29078,7 @@ class RichText extends BaseItem {
29081
29078
  shrinkWidth = false;
29082
29079
  prevMbr = null;
29083
29080
  rtCounter = 0;
29084
- constructor(board, container, id = "", transformation = new Transformation(id, board.events), linkTo, placeholderText = i18n3?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles = conf2.DEFAULT_TEXT_STYLES) {
29081
+ constructor(board, container, id = "", transformation = new Transformation(id, board.events), linkTo, placeholderText = conf.i18n?.t("board.textPlaceholder"), isInShape = false, autoSize = false, insideOf, initialTextStyles = conf.DEFAULT_TEXT_STYLES) {
29085
29082
  super(board, id);
29086
29083
  this.container = container;
29087
29084
  this.transformation = transformation;
@@ -29215,11 +29212,11 @@ class RichText extends BaseItem {
29215
29212
  return;
29216
29213
  }
29217
29214
  try {
29218
- conf2.reactEditorFocus(this.editor.editor);
29215
+ conf.reactEditorFocus(this.editor.editor);
29219
29216
  } catch {}
29220
29217
  };
29221
29218
  updateElement = () => {
29222
- if (conf2.isNode()) {
29219
+ if (conf.isNode()) {
29223
29220
  return;
29224
29221
  }
29225
29222
  if (this.updateRequired) {
@@ -29348,7 +29345,7 @@ class RichText extends BaseItem {
29348
29345
  const container = this.getTransformedContainer();
29349
29346
  const width = container.getWidth();
29350
29347
  const height = container.getHeight();
29351
- this.clipPath = new conf2.path2DFactory;
29348
+ this.clipPath = new conf.path2DFactory;
29352
29349
  this.clipPath.rect(0, 0, width, height);
29353
29350
  }
29354
29351
  setContainer(container) {
@@ -29625,24 +29622,24 @@ class RichText extends BaseItem {
29625
29622
  this.clearLastClickPoint();
29626
29623
  const domMbr = ref.getBoundingClientRect();
29627
29624
  const refMbr = new Mbr(domMbr.left, domMbr.top, domMbr.right, domMbr.bottom);
29628
- if (refMbr.isInside(point5) && (conf2.documentFactory.caretPositionFromPoint || conf2.documentFactory.caretRangeFromPoint)) {
29629
- const domRange = conf2.documentFactory.caretPositionFromPoint ? conf2.documentFactory.caretPositionFromPoint(point5.x, point5.y) : conf2.documentFactory.caretRangeFromPoint(point5.x, point5.y);
29630
- const textNode = conf2.documentFactory.caretPositionFromPoint ? domRange.offsetNode : domRange.startContainer;
29631
- const offset = conf2.documentFactory.caretPositionFromPoint ? domRange.offset : domRange.startOffset;
29632
- const slatePoint = conf2.reactEditorToSlatePoint(this.editor.editor, textNode, offset, {
29625
+ if (refMbr.isInside(point5) && (conf.documentFactory.caretPositionFromPoint || conf.documentFactory.caretRangeFromPoint)) {
29626
+ const domRange = conf.documentFactory.caretPositionFromPoint ? conf.documentFactory.caretPositionFromPoint(point5.x, point5.y) : conf.documentFactory.caretRangeFromPoint(point5.x, point5.y);
29627
+ const textNode = conf.documentFactory.caretPositionFromPoint ? domRange.offsetNode : domRange.startContainer;
29628
+ const offset = conf.documentFactory.caretPositionFromPoint ? domRange.offset : domRange.startOffset;
29629
+ const slatePoint = conf.reactEditorToSlatePoint(this.editor.editor, textNode, offset, {
29633
29630
  exactMatch: false,
29634
29631
  suppressThrow: false
29635
29632
  });
29636
29633
  if (slatePoint) {
29637
29634
  const nRange = { anchor: slatePoint, focus: slatePoint };
29638
29635
  this.editorTransforms.select(this.editor.editor, nRange);
29639
- conf2.reactEditorFocus(this.editor.editor);
29636
+ conf.reactEditorFocus(this.editor.editor);
29640
29637
  }
29641
29638
  } else {
29642
- if (!(conf2.documentFactory.caretPositionFromPoint || conf2.documentFactory.caretRangeFromPoint)) {
29639
+ if (!(conf.documentFactory.caretPositionFromPoint || conf.documentFactory.caretRangeFromPoint)) {
29643
29640
  console.error("document.caretPositionFromPoint and document.caretRangeFromPoint are not available!");
29644
29641
  }
29645
- conf2.reactEditorFocus(this.editor.editor);
29642
+ conf.reactEditorFocus(this.editor.editor);
29646
29643
  }
29647
29644
  }
29648
29645
  }
@@ -29749,11 +29746,11 @@ class RichText extends BaseItem {
29749
29746
  if (node4.type === "text" || "text" in node4) {
29750
29747
  node4 = node4;
29751
29748
  const text3 = node4.text.trim() !== "" ? decodeHtml(escapeHtml2(node4.text)) : " ";
29752
- const textElement = node4.link ? Object.assign(conf2.documentFactory.createElement("a"), {
29749
+ const textElement = node4.link ? Object.assign(conf.documentFactory.createElement("a"), {
29753
29750
  href: node4.link,
29754
29751
  target: "_blank",
29755
29752
  rel: "noreferrer"
29756
- }) : conf2.documentFactory.createElement("span");
29753
+ }) : conf.documentFactory.createElement("span");
29757
29754
  Object.assign(textElement.style, {
29758
29755
  fontWeight: node4.bold ? "700" : "400",
29759
29756
  fontStyle: node4.italic ? "italic" : "",
@@ -29761,10 +29758,10 @@ class RichText extends BaseItem {
29761
29758
  node4.underline ? "underline" : "",
29762
29759
  node4["line-through"] ? "line-through" : ""
29763
29760
  ].filter(Boolean).join(" "),
29764
- color: node4.fontColor || conf2.DEFAULT_TEXT_STYLES.fontColor,
29765
- backgroundColor: node4.fontHighlight || conf2.DEFAULT_TEXT_STYLES.fontHighlight,
29766
- fontSize: node4.fontSize ? `${node4.fontSize}px` : `${conf2.DEFAULT_TEXT_STYLES.fontSize}px`,
29767
- fontFamily: node4.fontFamily || conf2.DEFAULT_TEXT_STYLES.fontFamily
29761
+ color: node4.fontColor || conf.DEFAULT_TEXT_STYLES.fontColor,
29762
+ backgroundColor: node4.fontHighlight || conf.DEFAULT_TEXT_STYLES.fontHighlight,
29763
+ fontSize: node4.fontSize ? `${node4.fontSize}px` : `${conf.DEFAULT_TEXT_STYLES.fontSize}px`,
29764
+ fontFamily: node4.fontFamily || conf.DEFAULT_TEXT_STYLES.fontFamily
29768
29765
  });
29769
29766
  if (this.insideOf === "Frame") {
29770
29767
  Object.assign(textElement.style, {
@@ -29799,14 +29796,14 @@ class RichText extends BaseItem {
29799
29796
  four: 4,
29800
29797
  five: 5
29801
29798
  };
29802
- const header = conf2.documentFactory.createElement(`h${levels2[level]}`);
29799
+ const header = conf.documentFactory.createElement(`h${levels2[level]}`);
29803
29800
  applyCommonStyles(header);
29804
29801
  header.append(...children);
29805
29802
  return header;
29806
29803
  }
29807
29804
  case "code_block": {
29808
- const pre = conf2.documentFactory.createElement("pre");
29809
- const code = conf2.documentFactory.createElement("code");
29805
+ const pre = conf.documentFactory.createElement("pre");
29806
+ const code = conf.documentFactory.createElement("code");
29810
29807
  applyCommonStyles(pre);
29811
29808
  if (node4.language) {
29812
29809
  code.classList.add(`language-${node4.language}`);
@@ -29820,35 +29817,35 @@ class RichText extends BaseItem {
29820
29817
  return pre;
29821
29818
  }
29822
29819
  case "block-quote": {
29823
- const blockquote = conf2.documentFactory.createElement("blockquote");
29820
+ const blockquote = conf.documentFactory.createElement("blockquote");
29824
29821
  applyCommonStyles(blockquote);
29825
29822
  blockquote.append(...children);
29826
29823
  return blockquote;
29827
29824
  }
29828
29825
  case "ul_list": {
29829
- const ul = conf2.documentFactory.createElement("ul");
29826
+ const ul = conf.documentFactory.createElement("ul");
29830
29827
  applyCommonStyles(ul);
29831
29828
  ul.append(...children);
29832
29829
  return ul;
29833
29830
  }
29834
29831
  case "ol_list": {
29835
- const ol = conf2.documentFactory.createElement("ol");
29832
+ const ol = conf.documentFactory.createElement("ol");
29836
29833
  applyCommonStyles(ol);
29837
29834
  ol.append(...children);
29838
29835
  return ol;
29839
29836
  }
29840
29837
  case "list_item": {
29841
- const li = conf2.documentFactory.createElement("li");
29838
+ const li = conf.documentFactory.createElement("li");
29842
29839
  applyCommonStyles(li);
29843
29840
  li.append(...children);
29844
29841
  return li;
29845
29842
  }
29846
29843
  case "paragraph":
29847
29844
  default: {
29848
- const par = conf2.documentFactory.createElement("p");
29845
+ const par = conf.documentFactory.createElement("p");
29849
29846
  applyCommonStyles(par);
29850
29847
  Object.assign(par.style, {
29851
- lineHeight: node4.lineHeight ? `${node4.lineHeight}` : conf2.DEFAULT_TEXT_STYLES.lineHeight,
29848
+ lineHeight: node4.lineHeight ? `${node4.lineHeight}` : conf.DEFAULT_TEXT_STYLES.lineHeight,
29852
29849
  margin: "0"
29853
29850
  });
29854
29851
  par.append(...children);
@@ -29856,7 +29853,7 @@ class RichText extends BaseItem {
29856
29853
  }
29857
29854
  }
29858
29855
  }
29859
- return conf2.documentFactory.createElement("div");
29856
+ return conf.documentFactory.createElement("div");
29860
29857
  };
29861
29858
  const escapeHtml2 = (unsafe) => {
29862
29859
  return unsafe.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#039;");
@@ -42919,7 +42916,7 @@ var transformHtmlOrTextToMarkdown = async (text5, html4) => {
42919
42916
  markdownString = String(file).trim();
42920
42917
  }
42921
42918
  let slateNodes = [];
42922
- if (conf2.URL_REGEX.test(text5)) {
42919
+ if (conf.URL_REGEX.test(text5)) {
42923
42920
  slateNodes = [createLinkNode(text5)];
42924
42921
  } else {
42925
42922
  slateNodes = await convertMarkdownToSlate(markdownString.replace(/<!--(Start|End)Fragment-->/g, ""));
@@ -42935,7 +42932,7 @@ function createLinkNode(link2) {
42935
42932
  type: "text",
42936
42933
  link: link2,
42937
42934
  text: link2,
42938
- ...conf2.DEFAULT_TEXT_STYLES,
42935
+ ...conf.DEFAULT_TEXT_STYLES,
42939
42936
  fontColor: "rgba(71, 120, 245, 1)"
42940
42937
  };
42941
42938
  }
@@ -43046,7 +43043,7 @@ class AINode extends BaseItem {
43046
43043
  constructor(board, isUserRequest = false, parentNodeId, contextItems = [], threadDirection, id = "") {
43047
43044
  super(board, id);
43048
43045
  this.id = id;
43049
- this.buttonIcon = conf2.documentFactory.createElement("img");
43046
+ this.buttonIcon = conf.documentFactory.createElement("img");
43050
43047
  this.buttonIcon.src = ICON_SRC;
43051
43048
  this.contextItems = contextItems;
43052
43049
  this.isUserRequest = isUserRequest;
@@ -44217,7 +44214,6 @@ function getLine(lineStyle, start2, end2, middle) {
44217
44214
  }
44218
44215
  }
44219
44216
  // src/Items/Connector/Connector.ts
44220
- var { i18n: i18n4 } = conf2;
44221
44217
  var ConnectionLineWidths = [1, 2, 3, 4, 5, 6, 7, 8, 12];
44222
44218
  var CONNECTOR_COLOR = "rgb(20, 21, 26)";
44223
44219
  var CONNECTOR_LINE_WIDTH = 1;
@@ -44272,12 +44268,12 @@ class Connector2 extends BaseItem {
44272
44268
  this.lineColor = lineColor ?? CONNECTOR_COLOR;
44273
44269
  this.lineWidth = lineWidth ?? CONNECTOR_LINE_WIDTH;
44274
44270
  this.borderStyle = strokeStyle ?? CONNECTOR_BORDER_STYLE;
44275
- this.text = new RichText(board, this.getMbr(), this.id, new Transformation, this.linkTo, i18n4.t("connector.textPlaceholder", {
44271
+ this.text = new RichText(board, this.getMbr(), this.id, new Transformation, this.linkTo, conf.i18n.t("connector.textPlaceholder", {
44276
44272
  ns: "default"
44277
44273
  }), true, false, "Connector", {
44278
- ...conf2.DEFAULT_TEXT_STYLES,
44279
- fontSize: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextSize") ? Number(localStorage.getItem("lastConnectorTextSize")) : conf2.DEFAULT_TEXT_STYLES.fontSize,
44280
- fontColor: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextColor") ? localStorage.getItem("lastConnectorTextColor") : conf2.DEFAULT_TEXT_STYLES.fontColor
44274
+ ...conf.DEFAULT_TEXT_STYLES,
44275
+ fontSize: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextSize") ? Number(localStorage.getItem("lastConnectorTextSize")) : conf.DEFAULT_TEXT_STYLES.fontSize,
44276
+ fontColor: typeof window !== "undefined" && localStorage.getItem("lastConnectorTextColor") ? localStorage.getItem("lastConnectorTextColor") : conf.DEFAULT_TEXT_STYLES.fontColor
44281
44277
  });
44282
44278
  this.startPointer = getStartPointer(this.startPoint, this.startPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.3);
44283
44279
  this.endPointer = getEndPointer(this.endPoint, this.endPointerStyle, this.lineStyle, this.lines, this.lineWidth * 0.1 + 0.3);
@@ -44727,7 +44723,7 @@ class Connector2 extends BaseItem {
44727
44723
  this.text.transformation.applyTranslateTo(x - textWidth / 2, y - textHeight / 2);
44728
44724
  this.text.render(context);
44729
44725
  if (DRAW_TEXT_BORDER && (selectionContext === "EditUnderPointer" || selectionContext === "EditTextUnderPointer") && this.board.selection.items.list().includes(this)) {
44730
- ctx.strokeStyle = conf2.SELECTION_COLOR;
44726
+ ctx.strokeStyle = conf.SELECTION_COLOR;
44731
44727
  ctx.lineWidth = 1;
44732
44728
  ctx.beginPath();
44733
44729
  ctx.rect(textMbr.left - TEXT_BORDER_PADDING, textMbr.top - TEXT_BORDER_PADDING, textMbr.getWidth() + TEXT_BORDER_PADDING * 2, textMbr.getHeight() + TEXT_BORDER_PADDING * 2);
@@ -44954,7 +44950,7 @@ class Connector2 extends BaseItem {
44954
44950
  }
44955
44951
  }
44956
44952
  updatePaths() {
44957
- if (conf2.isNode()) {
44953
+ if (conf.isNode()) {
44958
44954
  return;
44959
44955
  }
44960
44956
  const startPoint = this.startPoint;
@@ -45765,7 +45761,7 @@ class DefaultShapeData {
45765
45761
  text;
45766
45762
  linkTo;
45767
45763
  itemType = "Shape";
45768
- constructor(shapeType = "Rectangle", backgroundColor = "none", backgroundOpacity = 1, borderColor = conf2.SHAPE_DEFAULT_STROKE_COLOR, borderOpacity = 1, borderStyle = "solid", borderWidth = 1, transformation = new DefaultTransformationData, text5 = new DefaultRichTextData, linkTo) {
45764
+ constructor(shapeType = "Rectangle", backgroundColor = "none", backgroundOpacity = 1, borderColor = conf.SHAPE_DEFAULT_STROKE_COLOR, borderOpacity = 1, borderStyle = "solid", borderWidth = 1, transformation = new DefaultTransformationData, text5 = new DefaultRichTextData, linkTo) {
45769
45765
  this.shapeType = shapeType;
45770
45766
  this.backgroundColor = backgroundColor;
45771
45767
  this.backgroundOpacity = backgroundOpacity;
@@ -46963,7 +46959,7 @@ class Shape extends BaseItem {
46963
46959
  this.text.updateElement();
46964
46960
  }
46965
46961
  transformPath() {
46966
- if (conf2.isNode()) {
46962
+ if (conf.isNode()) {
46967
46963
  return;
46968
46964
  }
46969
46965
  this.path = Shapes[this.shapeType].createPath(this.mbr);
@@ -47156,7 +47152,7 @@ class Sticker extends BaseItem {
47156
47152
  return this;
47157
47153
  }
47158
47154
  transformPath() {
47159
- if (conf2.isNode()) {
47155
+ if (conf.isNode()) {
47160
47156
  return;
47161
47157
  }
47162
47158
  this.stickerPath = StickerShape.stickerPath.copy();
@@ -47642,7 +47638,7 @@ class Frame extends BaseItem {
47642
47638
  this.path = Frames[this.shapeType].path.copy();
47643
47639
  this.transformation = new Transformation(this.id, this.board.events);
47644
47640
  this.linkTo = new LinkTo(this.id, this.board.events);
47645
- this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf2.DEFAULT_TEXT_STYLES, fontColor: FRAME_TITLE_COLOR });
47641
+ this.text = new RichText(board, this.textContainer, this.id, this.transformation, this.linkTo, this.name, true, false, "Frame", { ...conf.DEFAULT_TEXT_STYLES, fontColor: FRAME_TITLE_COLOR });
47646
47642
  this.text.setSelectionHorisontalAlignment("left");
47647
47643
  this.transformation.subject.subscribe(() => {
47648
47644
  this.transformPath();
@@ -48188,10 +48184,10 @@ class Frame extends BaseItem {
48188
48184
  }
48189
48185
  // src/Items/Video/Video.ts
48190
48186
  var VIDEO_ICON_SRC = "data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 22 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M15 0C15.2652 0 15.5196 0.105357 15.7071 0.292893C15.8946 0.48043 16 0.734784 16 1V5.2L21.213 1.55C21.288 1.49746 21.3759 1.4665 21.4672 1.4605C21.5586 1.4545 21.6498 1.4737 21.731 1.51599C21.8122 1.55829 21.8802 1.62206 21.9276 1.70035C21.9751 1.77865 22.0001 1.86846 22 1.96V14.04C22.0001 14.1315 21.9751 14.2214 21.9276 14.2996C21.8802 14.3779 21.8122 14.4417 21.731 14.484C21.6498 14.5263 21.5586 14.5455 21.4672 14.5395C21.3759 14.5335 21.288 14.5025 21.213 14.45L16 10.8V15C16 15.2652 15.8946 15.5196 15.7071 15.7071C15.5196 15.8946 15.2652 16 15 16H1C0.734784 16 0.48043 15.8946 0.292893 15.7071C0.105357 15.5196 0 15.2652 0 15V1C0 0.734784 0.105357 0.48043 0.292893 0.292893C0.48043 0.105357 0.734784 0 1 0H15ZM14 2H2V14H14V2ZM6.4 4.829C6.47611 4.82879 6.55069 4.8503 6.615 4.891L10.97 7.663C11.0266 7.69917 11.0731 7.749 11.1054 7.80789C11.1376 7.86679 11.1545 7.93285 11.1545 8C11.1545 8.06715 11.1376 8.13321 11.1054 8.19211C11.0731 8.251 11.0266 8.30083 10.97 8.337L6.615 11.11C6.55434 11.1487 6.48438 11.1703 6.41248 11.1725C6.34059 11.1748 6.26941 11.1576 6.20646 11.1228C6.14351 11.088 6.0911 11.0368 6.05477 10.9747C6.01844 10.9127 5.99951 10.8419 6 10.77V5.23C6 5.009 6.18 4.83 6.4 4.83V4.829ZM20 4.84L16 7.64V8.358L20 11.158V4.84Z' fill='%23FFFFFF'/%3E%3C/svg%3E";
48191
- var videoIcon = conf2.documentFactory.createElement("img");
48187
+ var videoIcon = conf.documentFactory.createElement("img");
48192
48188
  videoIcon.src = VIDEO_ICON_SRC;
48193
48189
  var createPlaceholderImage = (width2, height2) => {
48194
- const canvas = conf2.documentFactory.createElement("canvas");
48190
+ const canvas = conf.documentFactory.createElement("canvas");
48195
48191
  canvas.width = width2;
48196
48192
  canvas.height = height2;
48197
48193
  const ctx = canvas.getContext("2d");
@@ -48233,7 +48229,7 @@ class VideoItem extends BaseItem {
48233
48229
  super(board, id);
48234
48230
  this.events = events2;
48235
48231
  this.extension = extension2;
48236
- this.isStorageUrl = !conf2.getYouTubeId(url);
48232
+ this.isStorageUrl = !conf.getYouTubeId(url);
48237
48233
  this.preview = createPlaceholderImage(videoDimension.width, videoDimension.height);
48238
48234
  this.linkTo = new LinkTo(this.id, events2);
48239
48235
  this.board = board;
@@ -48603,59 +48599,59 @@ async function fileTosha256(file) {
48603
48599
  var catchErrorResponse = async (response, mediaType) => {
48604
48600
  if (response.status === 403) {
48605
48601
  const data = await response.json();
48606
- let errorBody = conf2.i18n.t("toolsPanel.addMedia.limitReached.bodyWithoutLimit");
48602
+ let errorBody = conf.i18n.t("toolsPanel.addMedia.limitReached.bodyWithoutLimit");
48607
48603
  if (!data.isOwnerRequest) {
48608
- errorBody = conf2.i18n.t("toolsPanel.addMedia.limitReached.bodyOwner");
48604
+ errorBody = conf.i18n.t("toolsPanel.addMedia.limitReached.bodyOwner");
48609
48605
  } else if (data.currentUsage && data.storageLimit) {
48610
- errorBody = conf2.i18n.t(`toolsPanel.addMedia.limitReached.body.${parseInt(data.storageLimit) < 1e5 ? "basic" : "plus"}`);
48606
+ errorBody = conf.i18n.t(`toolsPanel.addMedia.limitReached.body.${parseInt(data.storageLimit) < 1e5 ? "basic" : "plus"}`);
48611
48607
  }
48612
- conf2.notify({
48608
+ conf.notify({
48613
48609
  variant: "warning",
48614
- header: conf2.i18n.t("toolsPanel.addMedia.limitReached.header"),
48610
+ header: conf.i18n.t("toolsPanel.addMedia.limitReached.header"),
48615
48611
  body: errorBody,
48616
48612
  button: data.isOwnerRequest && data.storageLimit <= 100 ? {
48617
- text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48618
- onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
48613
+ text: conf.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48614
+ onClick: () => conf.openModal("USER_PLAN_MODAL_ID")
48619
48615
  } : undefined,
48620
48616
  duration: 8000
48621
48617
  });
48622
48618
  } else if (response.status === 413) {
48623
48619
  const data = await response.json();
48624
- let errorBody = conf2.i18n.t("toolsPanel.addMedia.tooLarge.bodyWithoutLimit");
48620
+ let errorBody = conf.i18n.t("toolsPanel.addMedia.tooLarge.bodyWithoutLimit");
48625
48621
  let isBasicPlan = false;
48626
48622
  if (data.fileSizeLimit && data.fileSize) {
48627
48623
  if (mediaType === "image") {
48628
48624
  isBasicPlan = parseInt(data.fileSizeLimit) < 20;
48629
- errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
48625
+ errorBody = conf.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
48630
48626
  } else {
48631
48627
  isBasicPlan = parseInt(data.fileSizeLimit) < 1000;
48632
- errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
48628
+ errorBody = conf.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
48633
48629
  }
48634
48630
  }
48635
- conf2.notify({
48631
+ conf.notify({
48636
48632
  variant: "warning",
48637
- header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
48633
+ header: conf.i18n.t("toolsPanel.addMedia.tooLarge.header"),
48638
48634
  body: errorBody,
48639
48635
  button: isBasicPlan ? {
48640
- text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48641
- onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
48636
+ text: conf.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48637
+ onClick: () => conf.openModal("USER_PLAN_MODAL_ID")
48642
48638
  } : undefined,
48643
48639
  duration: 4000
48644
48640
  });
48645
48641
  } else if (response.status === 401) {
48646
- conf2.openModal("MEDIA_UNAVAILABLE_MODAL_ID");
48642
+ conf.openModal("MEDIA_UNAVAILABLE_MODAL_ID");
48647
48643
  } else if (response.status === 415) {
48648
- conf2.notify({
48644
+ conf.notify({
48649
48645
  variant: "warning",
48650
- header: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
48651
- body: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
48646
+ header: conf.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
48647
+ body: conf.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
48652
48648
  duration: 4000
48653
48649
  });
48654
48650
  } else {
48655
- conf2.notify({
48651
+ conf.notify({
48656
48652
  variant: "error",
48657
- header: conf2.i18n.t("toolsPanel.addMedia.unhandled.header"),
48658
- body: conf2.i18n.t("toolsPanel.addMedia.unhandled.body"),
48653
+ header: conf.i18n.t("toolsPanel.addMedia.unhandled.header"),
48654
+ body: conf.i18n.t("toolsPanel.addMedia.unhandled.body"),
48659
48655
  duration: 4000
48660
48656
  });
48661
48657
  }
@@ -48663,17 +48659,17 @@ var catchErrorResponse = async (response, mediaType) => {
48663
48659
  };
48664
48660
  var catchDuplicateErrorResponse = async (response) => {
48665
48661
  if (response.status === 403) {
48666
- conf2.notify({
48662
+ conf.notify({
48667
48663
  variant: "warning",
48668
- header: conf2.i18n.t("toolsPanel.addMedia.limitReached.header"),
48669
- body: conf2.i18n.t("toolsPanel.addMedia.limitReached.duplicateBody"),
48664
+ header: conf.i18n.t("toolsPanel.addMedia.limitReached.header"),
48665
+ body: conf.i18n.t("toolsPanel.addMedia.limitReached.duplicateBody"),
48670
48666
  duration: 4000
48671
48667
  });
48672
48668
  } else {
48673
- conf2.notify({
48669
+ conf.notify({
48674
48670
  variant: "error",
48675
- header: conf2.i18n.t("toolsPanel.addMedia.unhandled.header"),
48676
- body: conf2.i18n.t("toolsPanel.addMedia.unhandled.body"),
48671
+ header: conf.i18n.t("toolsPanel.addMedia.unhandled.header"),
48672
+ body: conf.i18n.t("toolsPanel.addMedia.unhandled.body"),
48677
48673
  duration: 4000
48678
48674
  });
48679
48675
  }
@@ -48681,40 +48677,40 @@ var catchDuplicateErrorResponse = async (response) => {
48681
48677
  };
48682
48678
  var validateMediaFile = (file, account2) => {
48683
48679
  const fileExtension = file.name.split(".").pop()?.toLowerCase() || "";
48684
- if (!file.type.startsWith("image") && !conf2.AUDIO_FORMATS.includes(fileExtension) && !conf2.VIDEO_FORMATS.includes(fileExtension)) {
48685
- conf2.notify({
48680
+ if (!file.type.startsWith("image") && !conf.AUDIO_FORMATS.includes(fileExtension) && !conf.VIDEO_FORMATS.includes(fileExtension)) {
48681
+ conf.notify({
48686
48682
  variant: "warning",
48687
- header: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
48688
- body: conf2.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
48683
+ header: conf.i18n.t("toolsPanel.addMedia.unsupportedFormat.header"),
48684
+ body: conf.i18n.t("toolsPanel.addMedia.unsupportedFormat.body"),
48689
48685
  duration: 4000
48690
48686
  });
48691
48687
  return false;
48692
48688
  }
48693
48689
  const isBasicPlan = account2.billingInfo?.plan.name === "basic";
48694
- let errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
48695
- if (conf2.AUDIO_FORMATS.includes(fileExtension) || conf2.VIDEO_FORMATS.includes(fileExtension)) {
48696
- errorBody = conf2.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
48690
+ let errorBody = conf.i18n.t(`toolsPanel.addMedia.tooLarge.imageBody.${isBasicPlan ? "basic" : "plus"}`);
48691
+ if (conf.AUDIO_FORMATS.includes(fileExtension) || conf.VIDEO_FORMATS.includes(fileExtension)) {
48692
+ errorBody = conf.i18n.t(`toolsPanel.addMedia.tooLarge.audioOrVideoBody.${isBasicPlan ? "basic" : "plus"}`);
48697
48693
  if (file.size / 1024 ** 2 > (account2.billingInfo?.storage.maxMediaSize || Infinity)) {
48698
- conf2.notify({
48694
+ conf.notify({
48699
48695
  variant: "warning",
48700
- header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
48696
+ header: conf.i18n.t("toolsPanel.addMedia.tooLarge.header"),
48701
48697
  body: errorBody,
48702
48698
  button: isBasicPlan ? {
48703
- text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48704
- onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
48699
+ text: conf.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48700
+ onClick: () => conf.openModal("USER_PLAN_MODAL_ID")
48705
48701
  } : undefined,
48706
48702
  duration: 4000
48707
48703
  });
48708
48704
  return false;
48709
48705
  }
48710
48706
  } else if (file.size / 1024 ** 2 > (account2.billingInfo?.storage.maxImageSize || Infinity)) {
48711
- conf2.notify({
48707
+ conf.notify({
48712
48708
  variant: "warning",
48713
- header: conf2.i18n.t("toolsPanel.addMedia.tooLarge.header"),
48709
+ header: conf.i18n.t("toolsPanel.addMedia.tooLarge.header"),
48714
48710
  body: errorBody,
48715
48711
  button: isBasicPlan ? {
48716
- text: conf2.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48717
- onClick: () => conf2.openModal("USER_PLAN_MODAL_ID")
48712
+ text: conf.i18n.t("toolsPanel.addMedia.upgradeToPlus"),
48713
+ onClick: () => conf.openModal("USER_PLAN_MODAL_ID")
48718
48714
  } : undefined,
48719
48715
  duration: 4000
48720
48716
  });
@@ -48793,7 +48789,7 @@ var resizeAndConvertToPng = async (inp) => {
48793
48789
  };
48794
48790
  if (base64String.startsWith("data:image/svg+xml")) {
48795
48791
  image2.onload = async () => {
48796
- const parser = conf2.getDOMParser();
48792
+ const parser = conf.getDOMParser();
48797
48793
  const svgDoc = parser.parseFromString(atob(base64String.split(",")[1]), "image/svg+xml");
48798
48794
  const svgElement = svgDoc.documentElement;
48799
48795
  svgElement.removeAttribute("width");
@@ -49005,8 +49001,8 @@ class AudioItem extends BaseItem {
49005
49001
  this.subject.publish(this);
49006
49002
  });
49007
49003
  this.transformation.subject.subscribe(this.onTransform);
49008
- this.right = this.left + conf2.AUDIO_DIMENSIONS.width;
49009
- this.bottom = this.top + conf2.AUDIO_DIMENSIONS.height;
49004
+ this.right = this.left + conf.AUDIO_DIMENSIONS.width;
49005
+ this.bottom = this.top + conf.AUDIO_DIMENSIONS.height;
49010
49006
  this.shouldUseCustomRender = true;
49011
49007
  }
49012
49008
  setCurrentTime(time2) {
@@ -49075,8 +49071,8 @@ class AudioItem extends BaseItem {
49075
49071
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
49076
49072
  this.left = translateX;
49077
49073
  this.top = translateY;
49078
- this.right = this.left + conf2.AUDIO_DIMENSIONS.width * scaleX;
49079
- this.bottom = this.top + conf2.AUDIO_DIMENSIONS.height * scaleY;
49074
+ this.right = this.left + conf.AUDIO_DIMENSIONS.width * scaleX;
49075
+ this.bottom = this.top + conf.AUDIO_DIMENSIONS.height * scaleY;
49080
49076
  }
49081
49077
  render(context) {
49082
49078
  if (this.transformationRenderBlock) {
@@ -49105,8 +49101,8 @@ class AudioItem extends BaseItem {
49105
49101
  const { translateX, translateY, scaleX, scaleY } = this.transformation.matrix;
49106
49102
  const transform = `translate(${translateX}px, ${translateY}px) scale(${scaleX}, ${scaleY})`;
49107
49103
  div.id = this.getId();
49108
- div.style.width = `${conf2.AUDIO_DIMENSIONS.width}px`;
49109
- div.style.height = `${conf2.AUDIO_DIMENSIONS.height}px`;
49104
+ div.style.width = `${conf.AUDIO_DIMENSIONS.width}px`;
49105
+ div.style.height = `${conf.AUDIO_DIMENSIONS.height}px`;
49110
49106
  div.style.transformOrigin = "top left";
49111
49107
  div.style.transform = transform;
49112
49108
  div.style.position = "absolute";
@@ -49225,7 +49221,7 @@ class AudioItem extends BaseItem {
49225
49221
  }
49226
49222
  download() {
49227
49223
  if (this.extension) {
49228
- const linkElem = conf2.documentFactory.createElement("a");
49224
+ const linkElem = conf.documentFactory.createElement("a");
49229
49225
  linkElem.href = this.url;
49230
49226
  linkElem.setAttribute("download", `${this.board.getBoardId()}.${this.extension}`);
49231
49227
  linkElem.click();
@@ -49566,7 +49562,7 @@ class Placeholder extends BaseItem {
49566
49562
  }
49567
49563
  // src/Items/Image/Image.ts
49568
49564
  function getPlaceholderImage(board, imageDimension) {
49569
- const placeholderCanvas = conf2.documentFactory.createElement("canvas");
49565
+ const placeholderCanvas = conf.documentFactory.createElement("canvas");
49570
49566
  const placeholderContext = placeholderCanvas.getContext("2d");
49571
49567
  const context = new DrawingContext(board.camera, placeholderContext);
49572
49568
  const placeholder = new Placeholder;
@@ -49847,7 +49843,7 @@ class Drawing extends BaseItem {
49847
49843
  itemType = "Drawing";
49848
49844
  parent = "Board";
49849
49845
  transformation;
49850
- path2d = new conf2.path2DFactory;
49846
+ path2d = new conf.path2DFactory;
49851
49847
  subject = new Subject;
49852
49848
  untransformedMbr = new Mbr;
49853
49849
  lines = [];
@@ -49922,7 +49918,7 @@ class Drawing extends BaseItem {
49922
49918
  this.bottom = mbr.bottom;
49923
49919
  }
49924
49920
  updatePath2d() {
49925
- this.path2d = new conf2.path2DFactory;
49921
+ this.path2d = new conf.path2DFactory;
49926
49922
  const context = this.path2d;
49927
49923
  const points = this.points;
49928
49924
  if (points.length < 3) {
@@ -51174,14 +51170,14 @@ class AddConnector extends BoardTool {
51174
51170
  class AddDrawing extends BoardTool {
51175
51171
  drawing = null;
51176
51172
  isDown = false;
51177
- strokeWidth = conf2.PEN_INITIAL_STROKE_WIDTH;
51178
- strokeColor = conf2.PEN_DEFAULT_COLOR;
51179
- strokeStyle = conf2.PEN_STROKE_STYLE;
51173
+ strokeWidth = conf.PEN_INITIAL_STROKE_WIDTH;
51174
+ strokeColor = conf.PEN_DEFAULT_COLOR;
51175
+ strokeStyle = conf.PEN_STROKE_STYLE;
51180
51176
  constructor(board) {
51181
51177
  super(board);
51182
51178
  this.setCursor();
51183
- if (conf2.PEN_SETTINGS_KEY) {
51184
- const drawingSettings = localStorage.getItem(conf2.PEN_SETTINGS_KEY);
51179
+ if (conf.PEN_SETTINGS_KEY) {
51180
+ const drawingSettings = localStorage.getItem(conf.PEN_SETTINGS_KEY);
51185
51181
  if (drawingSettings) {
51186
51182
  const { strokeWidth, strokeColor, strokeStyle } = JSON.parse(drawingSettings);
51187
51183
  this.strokeWidth = strokeWidth;
@@ -51191,7 +51187,7 @@ class AddDrawing extends BoardTool {
51191
51187
  }
51192
51188
  }
51193
51189
  updateSettings() {
51194
- localStorage.setItem(conf2.PEN_SETTINGS_KEY, JSON.stringify({
51190
+ localStorage.setItem(conf.PEN_SETTINGS_KEY, JSON.stringify({
51195
51191
  strokeWidth: this.strokeWidth,
51196
51192
  strokeColor: this.strokeColor,
51197
51193
  strokeStyle: this.strokeStyle
@@ -51221,7 +51217,7 @@ class AddDrawing extends BoardTool {
51221
51217
  ctx.beginPath();
51222
51218
  ctx.arc(point7.x, point7.y, this.strokeWidth / 2, 0, 2 * Math.PI, false);
51223
51219
  ctx.lineWidth = 1;
51224
- ctx.strokeStyle = conf2.PEN_POINTER_CIRCLE_COLOR;
51220
+ ctx.strokeStyle = conf.PEN_POINTER_CIRCLE_COLOR;
51225
51221
  ctx.stroke();
51226
51222
  }
51227
51223
  setCursor() {
@@ -51303,7 +51299,7 @@ class AddDrawing extends BoardTool {
51303
51299
  this.setCursor();
51304
51300
  };
51305
51301
  render(context) {
51306
- if (conf2.PEN_RENDER_POINTER_CIRCLE) {
51302
+ if (conf.PEN_RENDER_POINTER_CIRCLE) {
51307
51303
  this.renderPointerCircle(this.board.pointer.point, context);
51308
51304
  }
51309
51305
  if (!this.drawing) {
@@ -51318,14 +51314,14 @@ class AddDrawing extends BoardTool {
51318
51314
  }
51319
51315
  // src/Tools/AddDrawing/AddHighlighter.ts
51320
51316
  class AddHighlighter extends AddDrawing {
51321
- strokeWidth = conf2.HIGHLIGHTER_INITIAL_STROKE_WIDTH;
51322
- strokeColor = conf2.HIGHLIGHTER_DEFAULT_COLOR;
51323
- strokeStyle = conf2.PEN_STROKE_STYLE;
51317
+ strokeWidth = conf.HIGHLIGHTER_INITIAL_STROKE_WIDTH;
51318
+ strokeColor = conf.HIGHLIGHTER_DEFAULT_COLOR;
51319
+ strokeStyle = conf.PEN_STROKE_STYLE;
51324
51320
  constructor(board) {
51325
51321
  super(board);
51326
51322
  this.setCursor();
51327
- if (conf2.HIGHLIGHTER_SETTINGS_KEY) {
51328
- const highlighterSettings = localStorage.getItem(conf2.HIGHLIGHTER_SETTINGS_KEY);
51323
+ if (conf.HIGHLIGHTER_SETTINGS_KEY) {
51324
+ const highlighterSettings = localStorage.getItem(conf.HIGHLIGHTER_SETTINGS_KEY);
51329
51325
  if (highlighterSettings) {
51330
51326
  const { strokeWidth, strokeColor, strokeStyle } = JSON.parse(highlighterSettings);
51331
51327
  this.strokeWidth = strokeWidth;
@@ -51338,7 +51334,7 @@ class AddHighlighter extends AddDrawing {
51338
51334
  return true;
51339
51335
  }
51340
51336
  updateSettings() {
51341
- localStorage.setItem(conf2.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
51337
+ localStorage.setItem(conf.HIGHLIGHTER_SETTINGS_KEY, JSON.stringify({
51342
51338
  strokeWidth: this.strokeWidth,
51343
51339
  strokeColor: this.strokeColor,
51344
51340
  strokeStyle: this.strokeStyle
@@ -51662,7 +51658,7 @@ class AddShape extends BoardTool {
51662
51658
  const point7 = this.board.pointer.point;
51663
51659
  this.line = new Line(point7.copy(), point7.copy());
51664
51660
  this.bounds = this.line.getMbr();
51665
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51661
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51666
51662
  this.shape.apply({
51667
51663
  class: "Shape",
51668
51664
  method: "setShapeType",
@@ -51686,7 +51682,7 @@ class AddShape extends BoardTool {
51686
51682
  }
51687
51683
  this.line = new Line(startPoint, endPoint);
51688
51684
  this.bounds = this.line.getMbr();
51689
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51685
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51690
51686
  this.initTransformation();
51691
51687
  this.board.tools.publish();
51692
51688
  return true;
@@ -51758,7 +51754,7 @@ class AddShape extends BoardTool {
51758
51754
  const y = (top + bottom) / 2 - 50;
51759
51755
  this.bounds = new Mbr(x, y, x, y);
51760
51756
  this.line = new Line(new Point(x, y), new Point(x, y));
51761
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51757
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51762
51758
  this.shape.apply({
51763
51759
  class: "Shape",
51764
51760
  method: "setShapeType",
@@ -51791,8 +51787,8 @@ class AddSticker extends BoardTool {
51791
51787
  this.setCursor(this.sticker.getBackgroundColor());
51792
51788
  }
51793
51789
  setCursor(color2) {
51794
- if (conf2.STICKER_COLOR_NAMES) {
51795
- const colorName = color2 ? conf2.STICKER_COLOR_NAMES[conf2.STICKER_COLORS.indexOf(color2)] : undefined;
51790
+ if (conf.STICKER_COLOR_NAMES) {
51791
+ const colorName = color2 ? conf.STICKER_COLOR_NAMES[conf.STICKER_COLORS.indexOf(color2)] : undefined;
51796
51792
  this.board.pointer.setCursor(colorName ? `sticker-${colorName}` : "crosshair");
51797
51793
  } else {
51798
51794
  this.board.pointer.setCursor("crosshair");
@@ -51816,7 +51812,7 @@ class AddSticker extends BoardTool {
51816
51812
  const point7 = this.board.pointer.point;
51817
51813
  this.line = new Line(point7.copy(), point7.copy());
51818
51814
  this.bounds = this.line.getMbr();
51819
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51815
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51820
51816
  this.board.tools.publish();
51821
51817
  return true;
51822
51818
  }
@@ -51825,7 +51821,7 @@ class AddSticker extends BoardTool {
51825
51821
  this.line = new Line(this.line.start.copy(), this.board.pointer.point.copy());
51826
51822
  this.sticker.applyDiagonal(this.line);
51827
51823
  this.bounds = this.sticker.getMbr();
51828
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51824
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51829
51825
  this.board.tools.publish();
51830
51826
  return true;
51831
51827
  }
@@ -51925,7 +51921,7 @@ class AddText extends BoardTool {
51925
51921
  const point7 = this.board.pointer.point;
51926
51922
  this.line = new Line(point7.copy(), point7.copy());
51927
51923
  this.bounds = this.line.getMbr();
51928
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51924
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51929
51925
  this.board.tools.publish();
51930
51926
  return true;
51931
51927
  }
@@ -51936,7 +51932,7 @@ class AddText extends BoardTool {
51936
51932
  const end2 = new Point(cursorPoint.x, start2.y + height2);
51937
51933
  this.line = new Line(start2, end2);
51938
51934
  this.bounds = this.line.getMbr();
51939
- this.bounds.borderColor = conf2.SELECTION_COLOR;
51935
+ this.bounds.borderColor = conf.SELECTION_COLOR;
51940
51936
  this.board.tools.publish();
51941
51937
  return true;
51942
51938
  }
@@ -52001,11 +51997,11 @@ class AddText extends BoardTool {
52001
51997
  class Eraser extends BoardTool {
52002
51998
  itemType = "Eraser";
52003
51999
  isDown = false;
52004
- strokeWidth = conf2.ERASER_STROKE_WIDTH;
52005
- strokeColor = conf2.ERASER_DEFAULT_COLOR;
52006
- strokeStyle = conf2.PEN_STROKE_STYLE;
52000
+ strokeWidth = conf.ERASER_STROKE_WIDTH;
52001
+ strokeColor = conf.ERASER_DEFAULT_COLOR;
52002
+ strokeStyle = conf.PEN_STROKE_STYLE;
52007
52003
  drawing = new Drawing(this.board, []);
52008
- maxPointsInLine = conf2.ERASER_MAX_LINE_LENGTH;
52004
+ maxPointsInLine = conf.ERASER_MAX_LINE_LENGTH;
52009
52005
  constructor(board) {
52010
52006
  super(board);
52011
52007
  this.setCursor();
@@ -52141,8 +52137,8 @@ function getResizeType(cursorPoint, cameraScale, mbr, anchorDistance = 5) {
52141
52137
 
52142
52138
  // src/Tools/ExportSnapshot/getDecorationResizeType.ts
52143
52139
  function getDecorationResizeType(point7, mbr, tolerance = 10) {
52144
- for (const key in conf2.EXPORT_FRAME_DECORATIONS) {
52145
- const decoration = conf2.EXPORT_FRAME_DECORATIONS[key];
52140
+ for (const key in conf.EXPORT_FRAME_DECORATIONS) {
52141
+ const decoration = conf.EXPORT_FRAME_DECORATIONS[key];
52146
52142
  const decorationBounds = {
52147
52143
  left: mbr.left + (decoration.offsetX ?? 0),
52148
52144
  top: mbr.top + (decoration.offsetY ?? 0),
@@ -52183,7 +52179,7 @@ class ExportSnapshot extends Tool {
52183
52179
  super();
52184
52180
  this.board = board;
52185
52181
  const cameraCenter = this.board.camera.getMbr().getCenter();
52186
- this.mbr = new Mbr(cameraCenter.x - conf2.EXPORT_SELECTION_BOX_WIDTH / 2, cameraCenter.y - conf2.EXPORT_SELECTION_BOX_HEIGHT / 2, cameraCenter.x + conf2.EXPORT_SELECTION_BOX_WIDTH / 2, cameraCenter.y + conf2.EXPORT_SELECTION_BOX_HEIGHT / 2, "transparent", "transparent", 1);
52182
+ this.mbr = new Mbr(cameraCenter.x - conf.EXPORT_SELECTION_BOX_WIDTH / 2, cameraCenter.y - conf.EXPORT_SELECTION_BOX_HEIGHT / 2, cameraCenter.x + conf.EXPORT_SELECTION_BOX_WIDTH / 2, cameraCenter.y + conf.EXPORT_SELECTION_BOX_HEIGHT / 2, "transparent", "transparent", 1);
52187
52183
  this.board.selection.disable();
52188
52184
  this.tempDrawingContext = new DrawingContext(board.camera, this.tempCtx);
52189
52185
  }
@@ -52195,11 +52191,11 @@ class ExportSnapshot extends Tool {
52195
52191
  resize() {
52196
52192
  if (this.resizeType && this.mbr && this.oppositePoint) {
52197
52193
  const resize = getResize(this.resizeType, this.board.pointer.point, this.mbr, this.oppositePoint);
52198
- if (resize.mbr.getWidth() > conf2.EXPORT_MIN_WIDTH) {
52194
+ if (resize.mbr.getWidth() > conf.EXPORT_MIN_WIDTH) {
52199
52195
  this.mbr.left = resize.mbr.left;
52200
52196
  this.mbr.right = resize.mbr.right;
52201
52197
  }
52202
- if (resize.mbr.getHeight() > conf2.EXPORT_MIN_HEIGHT) {
52198
+ if (resize.mbr.getHeight() > conf.EXPORT_MIN_HEIGHT) {
52203
52199
  this.mbr.top = resize.mbr.top;
52204
52200
  this.mbr.bottom = resize.mbr.bottom;
52205
52201
  }
@@ -52288,7 +52284,7 @@ class ExportSnapshot extends Tool {
52288
52284
  }
52289
52285
  const res = await exportBoardSnapshot({
52290
52286
  board: this.board,
52291
- bgColor: conf2.CANVAS_BG_COLOR,
52287
+ bgColor: conf.CANVAS_BG_COLOR,
52292
52288
  selection: this.mbr,
52293
52289
  upscaleTo: 4000,
52294
52290
  nameToExport: this.board.getName()
@@ -52312,18 +52308,18 @@ class ExportSnapshot extends Tool {
52312
52308
  const cameraMbr = context.camera.getMbr();
52313
52309
  this.tempDrawingContext.setCamera(this.board.camera);
52314
52310
  this.tempDrawingContext.clear();
52315
- cameraMbr.backgroundColor = conf2.EXPORT_BLUR_BACKGROUND_COLOR;
52311
+ cameraMbr.backgroundColor = conf.EXPORT_BLUR_BACKGROUND_COLOR;
52316
52312
  cameraMbr.strokeWidth = 0;
52317
52313
  cameraMbr.render(this.tempDrawingContext);
52318
52314
  this.tempCtx.clearRect(this.mbr.left, this.mbr.top, this.mbr.getWidth(), this.mbr.getHeight());
52319
- if (conf2.EXPORT_FRAME_DECORATIONS) {
52320
- const topLeft = conf2.EXPORT_FRAME_DECORATIONS["top-left"];
52315
+ if (conf.EXPORT_FRAME_DECORATIONS) {
52316
+ const topLeft = conf.EXPORT_FRAME_DECORATIONS["top-left"];
52321
52317
  this.renderDecoration(this.tempDrawingContext, topLeft.path, this.mbr.left + (topLeft.offsetX ?? 0), this.mbr.top + (topLeft.offsetY ?? 0), topLeft.color, topLeft.lineWidth);
52322
- const topRight = conf2.EXPORT_FRAME_DECORATIONS["top-right"];
52318
+ const topRight = conf.EXPORT_FRAME_DECORATIONS["top-right"];
52323
52319
  this.renderDecoration(this.tempDrawingContext, topRight.path, this.mbr.right + (topRight.offsetX ?? 0), this.mbr.top + (topRight.offsetY ?? 0), topRight.color, topRight.lineWidth);
52324
- const bottomLeft = conf2.EXPORT_FRAME_DECORATIONS["bottom-left"];
52320
+ const bottomLeft = conf.EXPORT_FRAME_DECORATIONS["bottom-left"];
52325
52321
  this.renderDecoration(this.tempDrawingContext, bottomLeft.path, this.mbr.left + (bottomLeft.offsetX ?? 0), this.mbr.bottom + (bottomLeft.offsetY ?? 0), bottomLeft.color, bottomLeft.lineWidth);
52326
- const bottomRight = conf2.EXPORT_FRAME_DECORATIONS["bottom-right"];
52322
+ const bottomRight = conf.EXPORT_FRAME_DECORATIONS["bottom-right"];
52327
52323
  this.renderDecoration(this.tempDrawingContext, bottomRight.path, this.mbr.left + this.mbr.getWidth() - bottomRight.width, this.mbr.top + this.mbr.getHeight() - bottomRight.width, bottomRight.color, bottomRight.lineWidth);
52328
52324
  }
52329
52325
  }
@@ -52425,7 +52421,7 @@ function createCanvasDrawer(board) {
52425
52421
  borderDiv.id = "canvasBorder";
52426
52422
  borderDiv.style.position = "absolute";
52427
52423
  borderDiv.style.transformOrigin = "left top";
52428
- borderDiv.style.border = `1px solid ${conf2.SELECTION_COLOR}`;
52424
+ borderDiv.style.border = `1px solid ${conf.SELECTION_COLOR}`;
52429
52425
  borderDiv.style.boxSizing = "border-box";
52430
52426
  borderDiv.style.left = `${leftOffset}px`;
52431
52427
  borderDiv.style.top = `${topOffset}px`;
@@ -52435,7 +52431,7 @@ function createCanvasDrawer(board) {
52435
52431
  canvas.style.boxSizing = "border-box";
52436
52432
  container.appendChild(borderDiv);
52437
52433
  } else {
52438
- canvas.style.border = `1px solid ${conf2.SELECTION_COLOR}`;
52434
+ canvas.style.border = `1px solid ${conf.SELECTION_COLOR}`;
52439
52435
  canvas.style.boxSizing = "border-box";
52440
52436
  }
52441
52437
  const createAnchorDiv = (left, top, radius) => {
@@ -52443,8 +52439,8 @@ function createCanvasDrawer(board) {
52443
52439
  anchorDiv.style.position = "absolute";
52444
52440
  anchorDiv.style.width = `${2 * radius}px`;
52445
52441
  anchorDiv.style.height = `${2 * radius}px`;
52446
- anchorDiv.style.backgroundColor = `${conf2.SELECTION_ANCHOR_COLOR}`;
52447
- anchorDiv.style.border = `${conf2.SELECTION_ANCHOR_WIDTH}px solid ${conf2.SELECTION_COLOR}`;
52442
+ anchorDiv.style.backgroundColor = `${conf.SELECTION_ANCHOR_COLOR}`;
52443
+ anchorDiv.style.border = `${conf.SELECTION_ANCHOR_WIDTH}px solid ${conf.SELECTION_COLOR}`;
52448
52444
  anchorDiv.style.borderRadius = "2px";
52449
52445
  anchorDiv.style.left = `calc(${left} - ${radius}px)`;
52450
52446
  anchorDiv.style.top = `calc(${top} - ${radius}px)`;
@@ -52452,10 +52448,10 @@ function createCanvasDrawer(board) {
52452
52448
  return anchorDiv;
52453
52449
  };
52454
52450
  const anchors = [
52455
- createAnchorDiv("0%", "0%", conf2.SELECTION_ANCHOR_RADIUS),
52456
- createAnchorDiv("100% + 1px", "0%", conf2.SELECTION_ANCHOR_RADIUS),
52457
- createAnchorDiv("0%", "100% + 1px", conf2.SELECTION_ANCHOR_RADIUS),
52458
- createAnchorDiv("100% + 1px", "100% + 1px", conf2.SELECTION_ANCHOR_RADIUS)
52451
+ createAnchorDiv("0%", "0%", conf.SELECTION_ANCHOR_RADIUS),
52452
+ createAnchorDiv("100% + 1px", "0%", conf.SELECTION_ANCHOR_RADIUS),
52453
+ createAnchorDiv("0%", "100% + 1px", conf.SELECTION_ANCHOR_RADIUS),
52454
+ createAnchorDiv("100% + 1px", "100% + 1px", conf.SELECTION_ANCHOR_RADIUS)
52459
52455
  ];
52460
52456
  const canvasBorder = Array.from(container.children).find((child) => child.id === "canvasBorder");
52461
52457
  for (const anchor of anchors) {
@@ -53808,8 +53804,8 @@ class Select extends Tool {
53808
53804
  const { x, y } = pointer.point;
53809
53805
  this.line = new Line(new Point(x, y), new Point(x, y));
53810
53806
  this.rect = this.line.getMbr();
53811
- this.rect.borderColor = conf2.SELECTION_COLOR;
53812
- this.rect.backgroundColor = conf2.SELECTION_BACKGROUND;
53807
+ this.rect.borderColor = conf.SELECTION_COLOR;
53808
+ this.rect.backgroundColor = conf.SELECTION_BACKGROUND;
53813
53809
  this.board.tools.publish();
53814
53810
  this.board.presence.throttledEmit({
53815
53811
  method: "DrawSelect",
@@ -53894,8 +53890,8 @@ class Select extends Tool {
53894
53890
  const point7 = this.board.pointer.point.copy();
53895
53891
  this.line = new Line(this.line.start, point7);
53896
53892
  this.rect = this.line.getMbr();
53897
- this.rect.borderColor = conf2.SELECTION_COLOR;
53898
- this.rect.backgroundColor = conf2.SELECTION_BACKGROUND;
53893
+ this.rect.borderColor = conf.SELECTION_COLOR;
53894
+ this.rect.backgroundColor = conf.SELECTION_BACKGROUND;
53899
53895
  this.board.tools.publish();
53900
53896
  this.board.presence.throttledEmit({
53901
53897
  method: "DrawSelect",
@@ -54406,7 +54402,7 @@ class ShapeTool extends CustomTool {
54406
54402
  const point7 = this.board.pointer.point;
54407
54403
  this.line = new Line(point7.copy(), point7.copy());
54408
54404
  this.bounds = this.line.getMbr();
54409
- this.bounds.borderColor = conf2.SELECTION_COLOR;
54405
+ this.bounds.borderColor = conf.SELECTION_COLOR;
54410
54406
  this.initTransformation();
54411
54407
  this.board.tools.publish();
54412
54408
  return true;
@@ -54424,7 +54420,7 @@ class ShapeTool extends CustomTool {
54424
54420
  }
54425
54421
  this.line = new Line(startPoint, endPoint);
54426
54422
  this.bounds = this.line.getMbr();
54427
- this.bounds.borderColor = conf2.SELECTION_COLOR;
54423
+ this.bounds.borderColor = conf.SELECTION_COLOR;
54428
54424
  this.initTransformation();
54429
54425
  this.board.tools.publish();
54430
54426
  return true;
@@ -55393,9 +55389,9 @@ class Camera {
55393
55389
  matrix = new Matrix2;
55394
55390
  pointer = new Point;
55395
55391
  window = {
55396
- width: conf2.getDocumentWidth(),
55397
- height: conf2.getDocumentHeight(),
55398
- dpi: conf2.getDPI(),
55392
+ width: conf.getDocumentWidth(),
55393
+ height: conf.getDocumentHeight(),
55394
+ dpi: conf.getDPI(),
55399
55395
  getMbr: () => {
55400
55396
  return new Mbr(0, 0, this.window.width, this.window.height);
55401
55397
  }
@@ -55771,9 +55767,9 @@ class Camera {
55771
55767
  this.updateBoardPointer();
55772
55768
  }
55773
55769
  onWindowResize() {
55774
- this.window.width = conf2.getDocumentWidth();
55775
- this.window.height = conf2.getDocumentHeight();
55776
- this.window.dpi = conf2.getDPI();
55770
+ this.window.width = conf.getDocumentWidth();
55771
+ this.window.height = conf.getDocumentHeight();
55772
+ this.window.dpi = conf.getDPI();
55777
55773
  this.resizeSubject.publish(this);
55778
55774
  this.subject.publish(this);
55779
55775
  }
@@ -55786,10 +55782,10 @@ class Camera {
55786
55782
  let y = 0;
55787
55783
  const { activeKeys } = keyboard;
55788
55784
  const directions = {
55789
- ArrowRight: [-conf2.NAVIGATION_STEP, 0],
55790
- ArrowLeft: [conf2.NAVIGATION_STEP, 0],
55791
- ArrowDown: [0, -conf2.NAVIGATION_STEP],
55792
- ArrowUp: [0, conf2.NAVIGATION_STEP]
55785
+ ArrowRight: [-conf.NAVIGATION_STEP, 0],
55786
+ ArrowLeft: [conf.NAVIGATION_STEP, 0],
55787
+ ArrowDown: [0, -conf.NAVIGATION_STEP],
55788
+ ArrowUp: [0, conf.NAVIGATION_STEP]
55793
55789
  };
55794
55790
  const activeArrowKeys = Array.from(activeKeys).filter((key) => (key in directions)).sort();
55795
55791
  if (activeArrowKeys.length === 2) {
@@ -56172,6 +56168,322 @@ function isHotkeyPushed(hotkey, event) {
56172
56168
  }
56173
56169
  // src/isMacos.ts
56174
56170
  var isMacos = () => navigator.platform.toUpperCase().includes("MAC");
56171
+ // src/Keyboard/hotkeys.json
56172
+ var hotkeys_default2 = {
56173
+ select: {
56174
+ key: {
56175
+ button: "KeyV"
56176
+ },
56177
+ label: {
56178
+ windows: "V",
56179
+ mac: "V"
56180
+ }
56181
+ },
56182
+ navigateMode: {
56183
+ key: {
56184
+ button: "Space"
56185
+ },
56186
+ label: {
56187
+ windows: "Space",
56188
+ mac: "Space"
56189
+ }
56190
+ },
56191
+ text: {
56192
+ key: {
56193
+ button: "KeyT"
56194
+ },
56195
+ label: {
56196
+ windows: "T",
56197
+ mac: "T"
56198
+ }
56199
+ },
56200
+ sticker: {
56201
+ key: {
56202
+ button: "KeyN"
56203
+ },
56204
+ label: {
56205
+ mac: "N",
56206
+ windows: "N"
56207
+ }
56208
+ },
56209
+ shape: {
56210
+ key: {
56211
+ button: "KeyS"
56212
+ },
56213
+ label: {
56214
+ mac: "S",
56215
+ windows: "S"
56216
+ }
56217
+ },
56218
+ connector: {
56219
+ key: {
56220
+ button: "KeyL"
56221
+ },
56222
+ label: {
56223
+ mac: "L",
56224
+ windows: "L"
56225
+ }
56226
+ },
56227
+ pen: {
56228
+ key: {
56229
+ button: "KeyP"
56230
+ },
56231
+ label: {
56232
+ mac: "P",
56233
+ windows: "P"
56234
+ }
56235
+ },
56236
+ eraser: {
56237
+ key: {
56238
+ button: "KeyE"
56239
+ },
56240
+ label: {
56241
+ mac: "E",
56242
+ windows: "E"
56243
+ }
56244
+ },
56245
+ frame: {
56246
+ key: {
56247
+ button: "KeyF"
56248
+ },
56249
+ label: {
56250
+ mac: "F",
56251
+ windows: "F"
56252
+ }
56253
+ },
56254
+ undo: {
56255
+ key: {
56256
+ button: "KeyZ",
56257
+ ctrl: true
56258
+ },
56259
+ label: {
56260
+ mac: "⌘Z",
56261
+ windows: "Ctrl + Z"
56262
+ }
56263
+ },
56264
+ redo: {
56265
+ key: {
56266
+ button: "KeyZ",
56267
+ ctrl: true,
56268
+ shift: true
56269
+ },
56270
+ label: {
56271
+ mac: "⌘⇧Z",
56272
+ windows: "Ctrl + Shift + Z"
56273
+ }
56274
+ },
56275
+ textBold: {
56276
+ key: {
56277
+ button: "KeyB",
56278
+ ctrl: true
56279
+ },
56280
+ label: {
56281
+ mac: "⌘B",
56282
+ windows: "Ctrl + B"
56283
+ }
56284
+ },
56285
+ textStrike: {
56286
+ key: {
56287
+ button: "KeyS",
56288
+ ctrl: true
56289
+ },
56290
+ label: {
56291
+ mac: "⌘S",
56292
+ windows: "Ctrl + S"
56293
+ }
56294
+ },
56295
+ textUnderline: {
56296
+ key: {
56297
+ button: "KeyU",
56298
+ ctrl: true
56299
+ },
56300
+ label: {
56301
+ mac: "⌘U",
56302
+ windows: "Ctrl + U"
56303
+ }
56304
+ },
56305
+ textItalic: {
56306
+ key: {
56307
+ button: "KeyI",
56308
+ ctrl: true
56309
+ },
56310
+ label: {
56311
+ mac: "⌘I",
56312
+ windows: "Ctrl + I"
56313
+ }
56314
+ },
56315
+ zoomOut: {
56316
+ key: {
56317
+ button: "Minus",
56318
+ ctrl: true
56319
+ },
56320
+ label: {
56321
+ mac: "⌘-",
56322
+ windows: "Ctrl + -"
56323
+ }
56324
+ },
56325
+ zoomIn: {
56326
+ key: {
56327
+ button: "Equal",
56328
+ ctrl: true
56329
+ },
56330
+ label: {
56331
+ mac: "⌘+",
56332
+ windows: "Ctrl + +"
56333
+ }
56334
+ },
56335
+ zoomDefault: {
56336
+ key: {
56337
+ button: "Digit0",
56338
+ ctrl: true
56339
+ },
56340
+ label: {
56341
+ mac: "⌘0",
56342
+ windows: "Ctrl + 0"
56343
+ }
56344
+ },
56345
+ duplicate: {
56346
+ key: {
56347
+ button: "KeyD",
56348
+ ctrl: true
56349
+ },
56350
+ label: {
56351
+ mac: "⌘D",
56352
+ windows: "Ctrl + D"
56353
+ }
56354
+ },
56355
+ bringToFront: {
56356
+ key: {
56357
+ button: "PageUp"
56358
+ },
56359
+ label: {
56360
+ mac: "fn↑ (PgUp)",
56361
+ windows: "PgUp"
56362
+ }
56363
+ },
56364
+ sendToBack: {
56365
+ key: {
56366
+ button: "PageDown"
56367
+ },
56368
+ label: {
56369
+ mac: "fn↓ (PgDn)",
56370
+ windows: "PgDn"
56371
+ }
56372
+ },
56373
+ delete: {
56374
+ key: {
56375
+ button: ["Delete", "Backspace"]
56376
+ },
56377
+ label: {
56378
+ mac: "Delete",
56379
+ windows: "Delete"
56380
+ }
56381
+ },
56382
+ cancel: {
56383
+ key: {
56384
+ button: "Escape"
56385
+ },
56386
+ label: {
56387
+ mac: "Esc",
56388
+ windows: "Esc"
56389
+ }
56390
+ },
56391
+ selectAll: {
56392
+ key: {
56393
+ button: "KeyA",
56394
+ ctrl: true
56395
+ },
56396
+ label: {
56397
+ mac: "⌘A",
56398
+ windows: "Ctrl + A"
56399
+ }
56400
+ },
56401
+ copy: {
56402
+ key: {
56403
+ button: "KeyC",
56404
+ ctrl: true
56405
+ },
56406
+ label: {
56407
+ mac: "⌘C",
56408
+ windows: "Ctrl + C"
56409
+ }
56410
+ },
56411
+ paste: {
56412
+ key: {
56413
+ button: "KeyV",
56414
+ ctrl: true
56415
+ },
56416
+ label: {
56417
+ mac: "⌘V",
56418
+ windows: "Ctrl + V"
56419
+ }
56420
+ },
56421
+ confirm: {
56422
+ key: {
56423
+ button: "Enter"
56424
+ },
56425
+ label: {
56426
+ mac: "⏎",
56427
+ windows: "⏎"
56428
+ }
56429
+ },
56430
+ frameNavigationNext: {
56431
+ key: {
56432
+ button: "ArrowRight",
56433
+ ctrl: true
56434
+ },
56435
+ label: {
56436
+ mac: "⌘→",
56437
+ windows: "Ctrl→"
56438
+ }
56439
+ },
56440
+ frameNavigationPrev: {
56441
+ key: {
56442
+ button: "ArrowLeft",
56443
+ ctrl: true
56444
+ },
56445
+ label: {
56446
+ mac: "⌘←",
56447
+ windows: "Ctrl←"
56448
+ }
56449
+ },
56450
+ navigationRight: {
56451
+ key: {
56452
+ button: "ArrowRight"
56453
+ },
56454
+ label: {
56455
+ mac: "→",
56456
+ windows: "→"
56457
+ }
56458
+ },
56459
+ navigationLeft: {
56460
+ key: {
56461
+ button: "ArrowLeft"
56462
+ },
56463
+ label: {
56464
+ mac: "←",
56465
+ windows: "←"
56466
+ }
56467
+ },
56468
+ navigationUp: {
56469
+ key: {
56470
+ button: "ArrowUp"
56471
+ },
56472
+ label: {
56473
+ mac: "↑",
56474
+ windows: "↑"
56475
+ }
56476
+ },
56477
+ navigationDown: {
56478
+ key: {
56479
+ button: "ArrowDown"
56480
+ },
56481
+ label: {
56482
+ mac: "↓",
56483
+ windows: "↓"
56484
+ }
56485
+ }
56486
+ };
56175
56487
 
56176
56488
  // src/Keyboard/logHotkey.ts
56177
56489
  function logHotkey(hotkeyConfig, hotkeyName, status, context) {
@@ -56179,7 +56491,7 @@ function logHotkey(hotkeyConfig, hotkeyName, status, context) {
56179
56491
  return;
56180
56492
  }
56181
56493
  const isFunction = typeof hotkeyConfig === "function";
56182
- const hotkeyData = hotkeys[hotkeyName];
56494
+ const hotkeyData = hotkeys_default2[hotkeyName];
56183
56495
  switch (status) {
56184
56496
  case "triggered":
56185
56497
  console.groupCollapsed(`%cDebug%c Triggered hotkey%c ${hotkeyName}`, "color: #00f; font-size: 16px; display: inline-block; padding: 2px 5px; border-radius: 5px; background-color: #f0f0f0; margin-left: 8px", "font-size: 14px; display: inline-block; color: #808080; font-weight: 500;", "font-size: 14px; display: inline-block; color: #ffd800; font-weight: 700;");
@@ -56267,7 +56579,7 @@ function checkHotkeys(hotkeyMap, event, board) {
56267
56579
  // src/Keyboard/getHotkeyLabel.ts
56268
56580
  function getHotkeyLabel(hotkey) {
56269
56581
  const hotkeyLabel = hotkeys_default[hotkey].label;
56270
- switch (conf2.FORCE_HOTKEYS || "auto") {
56582
+ switch (conf.FORCE_HOTKEYS || "auto") {
56271
56583
  case "windows":
56272
56584
  return hotkeyLabel.windows;
56273
56585
  case "macos":
@@ -58244,7 +58556,7 @@ class SpatialIndex {
58244
58556
  this.itemsArray.push(item);
58245
58557
  this.itemsIndex.insert(item);
58246
58558
  }
58247
- if (conf2.isNode()) {
58559
+ if (conf.isNode()) {
58248
58560
  return;
58249
58561
  }
58250
58562
  if (this.Mbr.getWidth() === 0 && this.Mbr.getHeight() === 0) {
@@ -59773,7 +60085,7 @@ class Transformer extends Tool {
59773
60085
  const isLockedItems = this.selection.getIsLockedSelection();
59774
60086
  if (mbr) {
59775
60087
  mbr.strokeWidth = 1 / context.matrix.scaleX;
59776
- const selectionColor = isLockedItems ? conf2.SELECTION_LOCKED_COLOR : conf2.SELECTION_COLOR;
60088
+ const selectionColor = isLockedItems ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
59777
60089
  mbr.borderColor = selectionColor;
59778
60090
  mbr.render(context);
59779
60091
  }
@@ -59799,7 +60111,7 @@ class Transformer extends Tool {
59799
60111
  new Point(right, bottom)
59800
60112
  ];
59801
60113
  for (const point7 of points) {
59802
- const circle = new Anchor(point7.x, point7.y, conf2.SELECTION_ANCHOR_RADIUS, conf2.SELECTION_COLOR, conf2.SELECTION_ANCHOR_COLOR, conf2.SELECTION_ANCHOR_WIDTH);
60114
+ const circle = new Anchor(point7.x, point7.y, conf.SELECTION_ANCHOR_RADIUS, conf.SELECTION_COLOR, conf.SELECTION_ANCHOR_COLOR, conf.SELECTION_ANCHOR_WIDTH);
59803
60115
  anchors.push(circle);
59804
60116
  }
59805
60117
  }
@@ -61000,7 +61312,7 @@ class BoardSelection {
61000
61312
  renderItemMbr(context, item, customScale) {
61001
61313
  const mbr = item.getMbr();
61002
61314
  mbr.strokeWidth = !customScale ? 1 / context.matrix.scaleX : 1 / customScale;
61003
- const selectionColor = item.transformation.isLocked ? conf2.SELECTION_LOCKED_COLOR : conf2.SELECTION_COLOR;
61315
+ const selectionColor = item.transformation.isLocked ? conf.SELECTION_LOCKED_COLOR : conf.SELECTION_COLOR;
61004
61316
  mbr.borderColor = selectionColor;
61005
61317
  mbr.render(context);
61006
61318
  }
@@ -61447,7 +61759,7 @@ class Board {
61447
61759
  const loadLinksImagesScript = LOAD_LINKS_IMAGES_JS;
61448
61760
  const css = INDEX_CSS;
61449
61761
  const boardName = this.getName() || this.getBoardId();
61450
- const items = this.items.getWholeHTML(conf2.documentFactory);
61762
+ const items = this.items.getWholeHTML(conf.documentFactory);
61451
61763
  const itemsDiv = `<div id="items">${items}</div>`;
61452
61764
  const scripts = `
61453
61765
  <script type="module">${customTagsScript}</script>
@@ -61487,7 +61799,7 @@ class Board {
61487
61799
  return `${head}${body}`;
61488
61800
  }
61489
61801
  deserializeHTMLAndEmit(stringedHTML) {
61490
- const parser = conf2.getDOMParser();
61802
+ const parser = conf.getDOMParser();
61491
61803
  const doc = parser.parseFromString(stringedHTML, "text/html");
61492
61804
  const items = doc.body.querySelector("#items");
61493
61805
  if (items) {
@@ -61539,7 +61851,7 @@ class Board {
61539
61851
  return [];
61540
61852
  }
61541
61853
  deserializeHTML(stringedHTML) {
61542
- const parser = conf2.getDOMParser();
61854
+ const parser = conf.getDOMParser();
61543
61855
  const doc = parser.parseFromString(stringedHTML, "text/html");
61544
61856
  const itemsDiv = doc.body.querySelector("#items");
61545
61857
  if (!itemsDiv) {
@@ -62678,19 +62990,19 @@ function removeNode_removeNode(confirmed, toTransform) {
62678
62990
  // src/Events/Transform/splitNode_insertNode.ts
62679
62991
  function splitNode_insertNode(confirmed, toTransform) {
62680
62992
  const transformed = { ...toTransform };
62681
- const conf3 = confirmed.path;
62993
+ const conf2 = confirmed.path;
62682
62994
  const path4 = transformed.path;
62683
- if (Path3.equals(conf3, path4)) {
62995
+ if (Path3.equals(conf2, path4)) {
62684
62996
  return transformed;
62685
62997
  }
62686
- const isDescendant = path4.length > conf3.length && path4.slice(0, conf3.length).every((seg, i) => seg === conf3[i]);
62998
+ const isDescendant = path4.length > conf2.length && path4.slice(0, conf2.length).every((seg, i) => seg === conf2[i]);
62687
62999
  if (isDescendant) {
62688
63000
  const newPath = [...path4];
62689
63001
  newPath[0] = newPath[0] + 1;
62690
63002
  transformed.path = newPath;
62691
63003
  return transformed;
62692
63004
  }
62693
- if (Path3.isBefore(conf3, path4)) {
63005
+ if (Path3.isBefore(conf2, path4)) {
62694
63006
  transformPath(confirmed, transformed);
62695
63007
  }
62696
63008
  return transformed;
@@ -62699,23 +63011,23 @@ function splitNode_insertNode(confirmed, toTransform) {
62699
63011
  // src/Events/Transform/splitNode_removeNode.ts
62700
63012
  function splitNode_removeNode(confirmed, toTransform) {
62701
63013
  const transformed = { ...toTransform };
62702
- const conf3 = confirmed.path;
63014
+ const conf2 = confirmed.path;
62703
63015
  const path4 = transformed.path;
62704
- if (Path3.equals(conf3, path4)) {
63016
+ if (Path3.equals(conf2, path4)) {
62705
63017
  return transformed;
62706
63018
  }
62707
- if (path4.length === conf3.length + 1 && path4.slice(0, conf3.length).every((seg, i) => seg === conf3[i])) {
63019
+ if (path4.length === conf2.length + 1 && path4.slice(0, conf2.length).every((seg, i) => seg === conf2[i])) {
62708
63020
  const newPath = [...path4];
62709
- if (conf3.length === 1) {
63021
+ if (conf2.length === 1) {
62710
63022
  newPath[0] = newPath[0] + 1;
62711
63023
  } else {
62712
- newPath[conf3.length] = newPath[conf3.length] + 1;
63024
+ newPath[conf2.length] = newPath[conf2.length] + 1;
62713
63025
  }
62714
63026
  transformed.path = newPath;
62715
63027
  return transformed;
62716
63028
  }
62717
- const isDescendant = path4.length > conf3.length && path4.slice(0, conf3.length).every((seg, i) => seg === conf3[i]);
62718
- if (Path3.isBefore(conf3, path4) && !isDescendant) {
63029
+ const isDescendant = path4.length > conf2.length && path4.slice(0, conf2.length).every((seg, i) => seg === conf2[i]);
63030
+ if (Path3.isBefore(conf2, path4) && !isDescendant) {
62719
63031
  transformPath(confirmed, transformed);
62720
63032
  }
62721
63033
  return transformed;
@@ -63295,8 +63607,8 @@ function transformEvents(confirmed, toTransform) {
63295
63607
  const transformed = [];
63296
63608
  for (const transf of toTransform) {
63297
63609
  let actualyTransformed = { ...transf };
63298
- for (const conf3 of confirmed) {
63299
- const { operation: confOp } = conf3.body;
63610
+ for (const conf2 of confirmed) {
63611
+ const { operation: confOp } = conf2.body;
63300
63612
  const { operation: transfOp } = actualyTransformed.body;
63301
63613
  const transformedOp = transfromOperation(confOp, transfOp);
63302
63614
  if (transformedOp) {
@@ -63928,7 +64240,7 @@ class Events2 {
63928
64240
  return record !== null;
63929
64241
  }
63930
64242
  sendPresenceEvent(event) {
63931
- conf2.connection.publishPresenceEvent(this.board.getBoardId(), event);
64243
+ conf.connection.publishPresenceEvent(this.board.getBoardId(), event);
63932
64244
  }
63933
64245
  canUndoEvent(op, byUserId) {
63934
64246
  if (op.method === "undo") {
@@ -64006,81 +64318,53 @@ function handleChatChunk(chunk, board) {
64006
64318
  const item = board.items.getById(itemId);
64007
64319
  switch (chunk.type) {
64008
64320
  case "chunk":
64009
- if (!item || item.itemType !== "AINode") {
64321
+ if (!item2 || item2.itemType !== "AINode") {
64010
64322
  return;
64011
64323
  }
64012
- item.text.editor.markdownProcessor.processMarkdown(chunk.content || "");
64324
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown(chunk.content || "");
64013
64325
  break;
64014
64326
  case "done":
64015
- if (!item || item.itemType !== "AINode") {
64327
+ if (!item2 || item2.itemType !== "AINode") {
64016
64328
  board.aiGeneratingOnItem = undefined;
64017
64329
  return;
64018
64330
  }
64019
- item.getRichText().editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
64331
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
64020
64332
  break;
64021
64333
  case "end":
64022
- if (!item || item.itemType !== "AINode") {
64334
+ if (!item2 || item2.itemType !== "AINode") {
64023
64335
  board.aiGeneratingOnItem = undefined;
64024
64336
  return;
64025
64337
  }
64026
- item.getRichText().editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
64338
+ item2.getRichText()?.editor.markdownProcessor.processMarkdown("StopProcessingMarkdown");
64027
64339
  break;
64028
64340
  case "error":
64029
- board.camera.unsubscribeFromItem();
64030
- if (board.aiGeneratingOnItem) {
64031
- const item2 = board.items.getById(board.aiGeneratingOnItem);
64032
- if (item2) {
64033
- board.selection.removeAll();
64034
- board.selection.add(item2);
64035
- if (item2.itemType === "AINode") {
64036
- item2.getRichText().editor.markdownProcessor.setStopProcessingMarkDownCb(null);
64037
- if (chunk.isExternalApiError) {
64038
- const editor = item2.getRichText().editor;
64039
- editor.clearText();
64040
- editor.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
64041
- }
64042
- }
64043
- board.camera.zoomToFit(item2.getMbr(), 20);
64044
- }
64045
- }
64046
- console.log("Error AI generate", chunk.error);
64047
- if (!chunk.isExternalApiError) {
64048
- conf2.notify({
64049
- header: conf2.i18n.t("AIInput.textGenerationError.header"),
64050
- body: conf2.i18n.t("AIInput.textGenerationError.body"),
64051
- variant: "error",
64052
- duration: 4000
64053
- });
64054
- }
64055
- board.aiGeneratingOnItem = undefined;
64056
- break;
64057
64341
  default:
64058
64342
  board.camera.unsubscribeFromItem();
64059
64343
  if (!chunk.isExternalApiError) {
64060
- conf2.notify({
64061
- header: conf2.i18n.t("AIInput.textGenerationError.header"),
64062
- body: conf2.i18n.t("AIInput.textGenerationError.body"),
64344
+ conf.notify({
64345
+ header: conf.i18n.t("AIInput.textGenerationError.header"),
64346
+ body: conf.i18n.t("AIInput.textGenerationError.body"),
64063
64347
  variant: "error",
64064
64348
  duration: 4000
64065
64349
  });
64066
64350
  }
64067
- if (board.aiGeneratingOnItem) {
64068
- const item2 = board.items.getById(board.aiGeneratingOnItem);
64069
- if (item2) {
64070
- board.selection.removeAll();
64071
- board.selection.add(item2);
64072
- if (item2.itemType === "AINode") {
64073
- item2.getRichText().editor.markdownProcessor.setStopProcessingMarkDownCb(null);
64074
- if (chunk.isExternalApiError) {
64075
- const editor = item2.getRichText().editor;
64076
- editor.clearText();
64077
- editor.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
64078
- }
64351
+ const item2 = board.items.getById(board.aiGeneratingOnItem || "");
64352
+ if (board.aiGeneratingOnItem && item2) {
64353
+ board.selection.removeAll();
64354
+ board.selection.add(item2);
64355
+ const rt = item2?.getRichText();
64356
+ if (item2.itemType === "AINode" && rt) {
64357
+ const editor = rt.editor;
64358
+ editor.markdownProcessor.setStopProcessingMarkDownCb(null);
64359
+ if (chunk.isExternalApiError) {
64360
+ editor.clearText();
64361
+ editor.insertCopiedText(conf.i18n.t("AIInput.nodeErrorText"));
64079
64362
  }
64080
- board.camera.zoomToFit(item2.getMbr(), 20);
64081
64363
  }
64364
+ board.camera.zoomToFit(item2.getMbr(), 20);
64082
64365
  }
64083
64366
  board.aiGeneratingOnItem = undefined;
64367
+ break;
64084
64368
  }
64085
64369
  }
64086
64370
  function handleAudioGenerate(response, board) {
@@ -64101,7 +64385,7 @@ function handleAudioGenerate(response, board) {
64101
64385
  }
64102
64386
  const audio = new AudioItem(board, true, audioUrl2, board.events, "", "wav");
64103
64387
  const { left, top, right } = placeholderNode.getMbr();
64104
- audio.transformation.applyTranslateTo(left + (right - left - conf2.AUDIO_DIMENSIONS.width) / 2, top);
64388
+ audio.transformation.applyTranslateTo(left + (right - left - conf.AUDIO_DIMENSIONS.width) / 2, top);
64105
64389
  audio.updateMbr();
64106
64390
  const threadDirection = placeholderNode.getThreadDirection();
64107
64391
  board.remove(placeholderNode, false);
@@ -64123,7 +64407,7 @@ function handleAudioGenerate(response, board) {
64123
64407
  type: "audio/wav"
64124
64408
  });
64125
64409
  const audioUrl2 = URL.createObjectURL(audioBlob);
64126
- const linkElem = conf2.documentFactory.createElement("a");
64410
+ const linkElem = conf.documentFactory.createElement("a");
64127
64411
  linkElem.href = audioUrl2;
64128
64412
  linkElem.setAttribute("download", `${board.getBoardId()}-generated.wav`);
64129
64413
  linkElem.click();
@@ -64142,9 +64426,9 @@ function handleAudioGenerate(response, board) {
64142
64426
  board.selection.add(placeholderNode);
64143
64427
  }
64144
64428
  console.error("Audio generation error:", response.message);
64145
- conf2.notify({
64146
- header: conf2.i18n.t("AIInput.audioGenerationError.header"),
64147
- body: conf2.i18n.t("AIInput.audioGenerationError.body"),
64429
+ conf.notify({
64430
+ header: conf.i18n.t("AIInput.audioGenerationError.header"),
64431
+ body: conf.i18n.t("AIInput.audioGenerationError.body"),
64148
64432
  variant: "error",
64149
64433
  duration: 4000
64150
64434
  });
@@ -64207,14 +64491,14 @@ function handleImageGenerate(response, board) {
64207
64491
  board.selection.add(item);
64208
64492
  const editor = item.getRichText()?.editor;
64209
64493
  editor?.clearText();
64210
- editor?.insertCopiedText(conf2.i18n.t("AIInput.nodeErrorText"));
64494
+ editor?.insertCopiedText(conf.i18n.t("AIInput.nodeErrorText"));
64211
64495
  board.camera.zoomToFit(item.getMbr(), 20);
64212
64496
  }
64213
64497
  }
64214
64498
  } else {
64215
- conf2.notify({
64216
- header: conf2.i18n.t("AIInput.imageGenerationError.header"),
64217
- body: conf2.i18n.t("AIInput.imageGenerationError.body"),
64499
+ conf.notify({
64500
+ header: conf.i18n.t("AIInput.imageGenerationError.header"),
64501
+ body: conf.i18n.t("AIInput.imageGenerationError.body"),
64218
64502
  variant: "error",
64219
64503
  duration: 4000
64220
64504
  });
@@ -64281,10 +64565,10 @@ function startIntervals(board) {
64281
64565
  }
64282
64566
  log.publishIntervalTimer = setInterval(() => {
64283
64567
  tryPublishEvent(board);
64284
- }, conf2.EVENTS_PUBLISH_INTERVAL);
64568
+ }, conf.EVENTS_PUBLISH_INTERVAL);
64285
64569
  log.resendIntervalTimer = setInterval(() => {
64286
64570
  tryResendEvent(board);
64287
- }, conf2.EVENTS_RESEND_INTERVAL);
64571
+ }, conf.EVENTS_RESEND_INTERVAL);
64288
64572
  }
64289
64573
  function tryPublishEvent(board) {
64290
64574
  const { log } = board.events;
@@ -64303,14 +64587,14 @@ function tryResendEvent(board) {
64303
64587
  return;
64304
64588
  }
64305
64589
  const date = Date.now();
64306
- const isTimeToSendPendingEvent = date - log.pendingEvent.lastSentTime >= conf2.EVENTS_RESEND_INTERVAL;
64590
+ const isTimeToSendPendingEvent = date - log.pendingEvent.lastSentTime >= conf.EVENTS_RESEND_INTERVAL;
64307
64591
  if (!isTimeToSendPendingEvent) {
64308
64592
  return;
64309
64593
  }
64310
- const isProbablyLostConnection = log.firstSentTime && date - log.firstSentTime >= conf2.EVENTS_RESEND_INTERVAL * 5;
64594
+ const isProbablyLostConnection = log.firstSentTime && date - log.firstSentTime >= conf.EVENTS_RESEND_INTERVAL * 5;
64311
64595
  if (isProbablyLostConnection) {
64312
64596
  board.presence.clear();
64313
- conf2.connection?.notifyAboutLostConnection();
64597
+ conf.connection?.notifyAboutLostConnection();
64314
64598
  }
64315
64599
  sendBoardEvent(board, log.pendingEvent.event, log.currentSequenceNumber);
64316
64600
  }
@@ -64341,12 +64625,12 @@ function sendBoardEvent(board, event, sequenceNumber) {
64341
64625
  lastKnownOrder: log.getLastIndex()
64342
64626
  }
64343
64627
  };
64344
- conf2.connection.send({
64628
+ conf.connection.send({
64345
64629
  type: "BoardEvent",
64346
64630
  boardId: board.getBoardId(),
64347
64631
  event: toSend,
64348
64632
  sequenceNumber,
64349
- userId: conf2.connection.getCurrentUser()
64633
+ userId: conf.connection.getCurrentUser()
64350
64634
  });
64351
64635
  const date = Date.now();
64352
64636
  log.pendingEvent = {
@@ -64392,7 +64676,7 @@ function handleConfirmation(msg2, board) {
64392
64676
  if (!isPendingEventConfirmation) {
64393
64677
  return;
64394
64678
  }
64395
- conf2.connection?.dismissNotificationAboutLostConnection();
64679
+ conf.connection?.dismissNotificationAboutLostConnection();
64396
64680
  log.currentSequenceNumber++;
64397
64681
  log.pendingEvent.event.order = msg2.order;
64398
64682
  log.confirmSentLocalEvent(log.pendingEvent.event);
@@ -64404,7 +64688,7 @@ function handleConfirmation(msg2, board) {
64404
64688
  // src/Events/MessageRouter/handleCreateSnapshotRequestMessage.ts
64405
64689
  function handleCreateSnapshotRequestMessage(msg2, board) {
64406
64690
  const { boardId, snapshot, lastOrder } = getSnapshotToPublish(board);
64407
- conf2.connection.send({
64691
+ conf.connection.send({
64408
64692
  type: "BoardSnapshot",
64409
64693
  boardId,
64410
64694
  snapshot,
@@ -64435,9 +64719,9 @@ function handleModeMessage(message, board) {
64435
64719
  if (isTemplateView()) {
64436
64720
  return;
64437
64721
  }
64438
- conf2.notify({
64439
- header: conf2.i18n.t("sharing.settingsChanged.heading"),
64440
- body: message.mode === "edit" ? conf2.i18n.t("sharing.settingsChanged.bodyEdit") : conf2.i18n.t("sharing.settingsChanged.bodyView"),
64722
+ conf.notify({
64723
+ header: conf.i18n.t("sharing.settingsChanged.heading"),
64724
+ body: message.mode === "edit" ? conf.i18n.t("sharing.settingsChanged.bodyEdit") : conf.i18n.t("sharing.settingsChanged.bodyView"),
64441
64725
  duration: 5000
64442
64726
  });
64443
64727
  }
@@ -64471,10 +64755,19 @@ messageRouter.addHandler("AiChat", handleAiChatMassage);
64471
64755
  messageRouter.addHandler("Mode", handleModeMessage);
64472
64756
  messageRouter.addHandler("PresenceEvent", handlePresenceEventMessage);
64473
64757
  messageRouter.addHandler("UserJoin", handleUserJoinMessage);
64758
+ // src/api/initI18N.ts
64759
+ function initI18N(i18nInstance) {
64760
+ conf.i18n = i18nInstance;
64761
+ conf.planNames = {
64762
+ basic: i18nInstance.t("userPlan.plans.basic.name"),
64763
+ plus: i18nInstance.t("userPlan.plans.plus.name")
64764
+ };
64765
+ return i18nInstance;
64766
+ }
64474
64767
  // src/api/getMeasureCtx.ts
64475
64768
  function getMeasureCtx() {
64476
64769
  if (typeof document !== "undefined") {
64477
- const measureCanvas = conf2.documentFactory.createElement("canvas");
64770
+ const measureCanvas = conf.documentFactory.createElement("canvas");
64478
64771
  const measureCtx = measureCanvas.getContext("2d");
64479
64772
  if (!measureCtx) {
64480
64773
  throw new Error("Failde to create canvas and get 2d context");
@@ -64495,7 +64788,7 @@ function getBrowserDOMParser() {
64495
64788
 
64496
64789
  // src/api/initPaths.ts
64497
64790
  function initPaths(path2D) {
64498
- conf2.EXPORT_FRAME_DECORATIONS = {
64791
+ conf.EXPORT_FRAME_DECORATIONS = {
64499
64792
  "top-left": {
64500
64793
  path: new path2D("M13 1H1V13"),
64501
64794
  lineWidth: 2,
@@ -64535,105 +64828,24 @@ function initPaths(path2D) {
64535
64828
  };
64536
64829
  }
64537
64830
 
64538
- // node_modules/react-i18next/dist/es/unescape.js
64539
- var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
64540
- var htmlEntities = {
64541
- "&amp;": "&",
64542
- "&#38;": "&",
64543
- "&lt;": "<",
64544
- "&#60;": "<",
64545
- "&gt;": ">",
64546
- "&#62;": ">",
64547
- "&apos;": "'",
64548
- "&#39;": "'",
64549
- "&quot;": '"',
64550
- "&#34;": '"',
64551
- "&nbsp;": " ",
64552
- "&#160;": " ",
64553
- "&copy;": "©",
64554
- "&#169;": "©",
64555
- "&reg;": "®",
64556
- "&#174;": "®",
64557
- "&hellip;": "…",
64558
- "&#8230;": "…",
64559
- "&#x2F;": "/",
64560
- "&#47;": "/"
64561
- };
64562
- var unescapeHtmlEntity = (m) => htmlEntities[m];
64563
- var unescape = (text5) => text5.replace(matchHtmlEntity, unescapeHtmlEntity);
64564
-
64565
- // node_modules/react-i18next/dist/es/defaults.js
64566
- var defaultOptions = {
64567
- bindI18n: "languageChanged",
64568
- bindI18nStore: "",
64569
- transEmptyNodeValue: "",
64570
- transSupportBasicHtmlNodes: true,
64571
- transWrapTextNodes: "",
64572
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
64573
- useSuspense: true,
64574
- unescape
64575
- };
64576
- function setDefaults() {
64577
- let options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
64578
- defaultOptions = {
64579
- ...defaultOptions,
64580
- ...options
64581
- };
64582
- }
64583
-
64584
- // node_modules/react-i18next/dist/es/i18nInstance.js
64585
- var i18nInstance;
64586
- function setI18n(instance2) {
64587
- i18nInstance = instance2;
64588
- }
64589
-
64590
- // node_modules/react-i18next/dist/es/initReactI18next.js
64591
- var initReactI18next = {
64592
- type: "3rdParty",
64593
- init(instance2) {
64594
- setDefaults(instance2.options.react);
64595
- setI18n(instance2);
64596
- }
64597
- };
64598
- // src/api/initI18NBrowser.ts
64599
- function initI18NReact(isNode = false) {
64600
- const i18nBrowser = createInstance();
64601
- i18nBrowser.use(initReactI18next).use(Browser).init({
64602
- debug: conf2.debug,
64603
- detection: {
64604
- order: ["navigator"]
64605
- },
64606
- supportedLngs: ["en", "ru"],
64607
- defaultNS,
64608
- resources,
64609
- fallbackLng: conf2.FALLBACK_LNG,
64610
- interpolation: {
64611
- escapeValue: false
64612
- }
64613
- });
64614
- conf2.i18n = i18nBrowser;
64615
- return i18nBrowser;
64616
- }
64617
-
64618
64831
  // src/api/initBrowserSettings.ts
64619
64832
  function initBrowserSettings() {
64620
- conf2.documentFactory = new BrowserDocumentFactory;
64621
- conf2.path2DFactory = BrowserPath2D;
64622
- conf2.measureCtx = getMeasureCtx();
64623
- conf2.getDocumentWidth = () => document.documentElement.clientWidth;
64624
- conf2.getDocumentHeight = () => document.documentElement.clientHeight;
64625
- conf2.getDPI = () => window.devicePixelRatio;
64626
- conf2.getDOMParser = getBrowserDOMParser;
64627
- initI18NReact();
64833
+ conf.documentFactory = new BrowserDocumentFactory;
64834
+ conf.path2DFactory = BrowserPath2D;
64835
+ conf.measureCtx = getMeasureCtx();
64836
+ conf.getDocumentWidth = () => document.documentElement.clientWidth;
64837
+ conf.getDocumentHeight = () => document.documentElement.clientHeight;
64838
+ conf.getDPI = () => window.devicePixelRatio;
64839
+ conf.getDOMParser = getBrowserDOMParser;
64628
64840
  initPaths(BrowserPath2D);
64629
- conf2.reactEditorFocus = (editor) => {
64841
+ conf.reactEditorFocus = (editor) => {
64630
64842
  try {
64631
64843
  ReactEditor.focus(editor);
64632
64844
  } catch (e) {
64633
64845
  console.warn("Failed to focus editor:", e);
64634
64846
  }
64635
64847
  };
64636
- conf2.reactEditorToSlatePoint = (editor, domNode, offset, options) => {
64848
+ conf.reactEditorToSlatePoint = (editor, domNode, offset, options) => {
64637
64849
  try {
64638
64850
  return ReactEditor.toSlatePoint(editor, [domNode, offset], options);
64639
64851
  } catch (e) {
@@ -64641,7 +64853,7 @@ function initBrowserSettings() {
64641
64853
  return null;
64642
64854
  }
64643
64855
  };
64644
- return conf2;
64856
+ return conf;
64645
64857
  }
64646
64858
 
64647
64859
  // src/browser.ts
@@ -64687,6 +64899,7 @@ export {
64687
64899
  isHotkeyPushed,
64688
64900
  isFiniteNumber,
64689
64901
  isControlCharacter,
64902
+ initI18N,
64690
64903
  getYouTubeVideoPreview,
64691
64904
  getYouTubeThumbnail,
64692
64905
  getVideoMetadata,
@@ -64706,7 +64919,7 @@ export {
64706
64919
  defaultCursors as cursors,
64707
64920
  createVideoItem,
64708
64921
  createEvents,
64709
- conf2 as conf,
64922
+ conf,
64710
64923
  checkHotkeys,
64711
64924
  catmullRomInterpolate,
64712
64925
  catchErrorResponse,