@aintela/chat 0.4.2 → 0.4.3

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.
@@ -199,7 +199,7 @@ const L = /* @__PURE__ */ new Set(), v = class v {
199
199
  o.querySelectorAll("td, th").forEach((r) => {
200
200
  const l = r.textContent.trim().match(/^([\d,]+\.?\d*)[eE][+-]?(\d+)$/);
201
201
  if (l) {
202
- const c = parseFloat(l[1].replace(/,/g, "")), p = parseInt(l[2]), u = c * Math.pow(10, p), h = this.formatNumber(u);
202
+ const c = parseFloat(l[1].replace(/,/g, "")), u = parseInt(l[2]), p = c * Math.pow(10, u), h = this.formatNumber(p);
203
203
  r.textContent = h;
204
204
  }
205
205
  });
@@ -293,8 +293,8 @@ const L = /* @__PURE__ */ new Set(), v = class v {
293
293
  const l = this.extractValue(r), c = this.extractValue(a);
294
294
  if (this.options.customSorters[e])
295
295
  return this.options.customSorters[e](l, c, s);
296
- const p = this.compareValues(l, c);
297
- return s === "asc" ? p : -p;
296
+ const u = this.compareValues(l, c);
297
+ return s === "asc" ? u : -u;
298
298
  });
299
299
  }
300
300
  /**
@@ -311,8 +311,8 @@ const L = /* @__PURE__ */ new Set(), v = class v {
311
311
  return parseFloat(i[1].replace(/,/g, ""));
312
312
  const r = e.match(/^([\d,]+\.?\d*)[eE][+-]?(\d+)$/);
313
313
  if (r) {
314
- const p = parseFloat(r[1].replace(/,/g, "")), u = parseInt(r[2]);
315
- return p * Math.pow(10, u);
314
+ const u = parseFloat(r[1].replace(/,/g, "")), p = parseInt(r[2]);
315
+ return u * Math.pow(10, p);
316
316
  }
317
317
  if (e.match(/^[\d,]+\.?\d*[KMB]?$/))
318
318
  return this.parseNumber(e);
@@ -369,12 +369,12 @@ const L = /* @__PURE__ */ new Set(), v = class v {
369
369
  z-index: 10;
370
370
  `, t.appendChild(i);
371
371
  let r = !1, a = 0, l = 0;
372
- i.addEventListener("mousedown", (u) => {
373
- u.preventDefault(), u.stopPropagation(), u.stopImmediatePropagation(), r = !0, a = u.clientX, l = t.offsetWidth, t.style.borderRight = "2px solid var(--primary-main, #2196F3)", t.style.background = "var(--background-active, rgba(255, 255, 255, 0.1))", document.addEventListener("mousemove", c), document.addEventListener("mouseup", p), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
372
+ i.addEventListener("mousedown", (p) => {
373
+ p.preventDefault(), p.stopPropagation(), p.stopImmediatePropagation(), r = !0, a = p.clientX, l = t.offsetWidth, t.style.borderRight = "2px solid var(--primary-main, #2196F3)", t.style.background = "var(--background-active, rgba(255, 255, 255, 0.1))", document.addEventListener("mousemove", c), document.addEventListener("mouseup", u), document.body.style.cursor = "col-resize", document.body.style.userSelect = "none";
374
374
  });
375
- const c = /* @__PURE__ */ d((u) => {
375
+ const c = /* @__PURE__ */ d((p) => {
376
376
  if (!r) return;
377
- const h = l + (u.clientX - a);
377
+ const h = l + (p.clientX - a);
378
378
  if (h > 30) {
379
379
  t.style.width = h + "px";
380
380
  const g = Array.from(t.parentNode.children).indexOf(t), f = e.querySelector("tbody");
@@ -383,8 +383,8 @@ const L = /* @__PURE__ */ new Set(), v = class v {
383
383
  b && (b.style.width = h + "px");
384
384
  }), this.updateTableWidth(e);
385
385
  }
386
- }, "handleResize"), p = /* @__PURE__ */ d(() => {
387
- r = !1, t.style.borderRight = "", t.style.background = "", document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", p), document.body.style.cursor = "", document.body.style.userSelect = "";
386
+ }, "handleResize"), u = /* @__PURE__ */ d(() => {
387
+ r = !1, t.style.borderRight = "", t.style.background = "", document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", u), document.body.style.cursor = "", document.body.style.userSelect = "";
388
388
  }, "stopResize");
389
389
  }
390
390
  /**
@@ -514,14 +514,14 @@ const L = /* @__PURE__ */ new Set(), v = class v {
514
514
  }
515
515
  if (s === o)
516
516
  return;
517
- const c = a[s], p = a[o];
518
- s < o ? i.insertBefore(c, p.nextSibling) : i.insertBefore(c, p), l.forEach((h, g) => {
517
+ const c = a[s], u = a[o];
518
+ s < o ? i.insertBefore(c, u.nextSibling) : i.insertBefore(c, u), l.forEach((h, g) => {
519
519
  const f = Array.from(h.children), m = f[s], y = f[o];
520
520
  s < o ? h.insertBefore(m, y.nextSibling) : h.insertBefore(m, y);
521
521
  });
522
- const u = this.originalColumnOrder.get(e);
523
- if (u) {
524
- const h = [...u], g = h[s];
522
+ const p = this.originalColumnOrder.get(e);
523
+ if (p) {
524
+ const h = [...p], g = h[s];
525
525
  h.splice(s, 1), h.splice(o, 0, g), this.originalColumnOrder.set(e, h);
526
526
  }
527
527
  this.applyTableStyles(t), this.refreshDragAndDropListeners(t, e);
@@ -561,7 +561,7 @@ const L = /* @__PURE__ */ new Set(), v = class v {
561
561
  * Calculate intelligent table width based on header text length
562
562
  */
563
563
  calculateTableWidth(t) {
564
- var u;
564
+ var p;
565
565
  const e = t.getAttribute("data-original-width"), s = e ? parseFloat(e) : 0, o = t.querySelectorAll("th");
566
566
  let i = 0;
567
567
  t.parentElement.clientWidth;
@@ -570,7 +570,7 @@ const L = /* @__PURE__ */ new Set(), v = class v {
570
570
  let f = h.textContent.replace(/[📊🔍]/g, "").trim().length * this.charWidth + 15;
571
571
  r.push(f), i += f;
572
572
  });
573
- const a = t.querySelectorAll("tr"), l = ((u = t.parentElement) == null ? void 0 : u.getBoundingClientRect().width) ?? i;
573
+ const a = t.querySelectorAll("tr"), l = ((p = t.parentElement) == null ? void 0 : p.getBoundingClientRect().width) ?? i;
574
574
  var c = 0;
575
575
  for (const h of a)
576
576
  h.querySelectorAll("td").forEach((f, m) => {
@@ -584,8 +584,8 @@ const L = /* @__PURE__ */ new Set(), v = class v {
584
584
  } else
585
585
  h.style.width = `${r[g]}px`;
586
586
  });
587
- let p = 0;
588
- return c > l ? p = "100%" : p = `${Math.max(c, s)}px`, p;
587
+ let u = 0;
588
+ return c > l ? u = "100%" : u = `${Math.max(c, s)}px`, u;
589
589
  }
590
590
  /**
591
591
  * Apply inline styles to ensure text clipping and horizontal scroll work
@@ -823,7 +823,7 @@ function G(n, t, e = t, s = 600) {
823
823
  const o = n.value;
824
824
  let i = !1;
825
825
  const r = /* @__PURE__ */ d(() => {
826
- i || (i = !0, document.removeEventListener("selectionchange", l), n.removeEventListener("keydown", r), n.removeEventListener("input", r), n.removeEventListener("pointerdown", r), window.clearTimeout(c), window.clearInterval(p));
826
+ i || (i = !0, document.removeEventListener("selectionchange", l), n.removeEventListener("keydown", r), n.removeEventListener("input", r), n.removeEventListener("pointerdown", r), window.clearTimeout(c), window.clearInterval(u));
827
827
  }, "stop"), a = /* @__PURE__ */ d(() => {
828
828
  if (n.value !== o) {
829
829
  r();
@@ -834,7 +834,7 @@ function G(n, t, e = t, s = 600) {
834
834
  document.activeElement === n && a();
835
835
  }, "onSelectionChange");
836
836
  a();
837
- const c = window.setTimeout(r, s), p = window.setInterval(a, 50);
837
+ const c = window.setTimeout(r, s), u = window.setInterval(a, 50);
838
838
  return document.addEventListener("selectionchange", l), n.addEventListener("keydown", r), n.addEventListener("input", r), n.addEventListener("pointerdown", r), r;
839
839
  }
840
840
  d(G, "placeCaret");
@@ -927,16 +927,16 @@ function Y(n, t, e) {
927
927
  return { next: `${s}${a}${o}`, selectionStart: l, selectionEnd: l, reopenTrigger: !1 };
928
928
  }
929
929
  d(Y, "applyTriggerInsertion");
930
- async function Q(n, { onAtQuery: t, onAtPersonQuery: e }, { personConfidence: s = 0, locationConfidence: o = 0, personFirstThreshold: i = 0.5 } = {}) {
931
- const [r, a] = await Promise.all([
932
- t ? t(n).catch(() => []) : Promise.resolve([]),
930
+ async function Q(n, { onAtQuery: t, onAtPersonQuery: e }, { personConfidence: s = 0, locationConfidence: o = 0, personFirstThreshold: i = 0.5, vertical: r = "air" } = {}) {
931
+ const [a, l] = await Promise.all([
932
+ t ? t(n, { vertical: r }).catch(() => []) : Promise.resolve([]),
933
933
  e ? e(n).catch(() => []) : Promise.resolve([])
934
934
  ]);
935
935
  if (t && e) {
936
- const l = a.map((u) => ({ ...u, group: "person" })), c = r.map((u) => ({ ...u, group: "location" }));
937
- return s >= i && s >= o ? [...l, ...c] : [...c, ...l];
936
+ const c = l.map((h) => ({ ...h, group: "person" })), u = a.map((h) => ({ ...h, group: "location" }));
937
+ return s >= i && s >= o ? [...c, ...u] : [...u, ...c];
938
938
  }
939
- return [...a, ...r];
939
+ return [...l, ...a];
940
940
  }
941
941
  d(Q, "fetchAtMentions");
942
942
  function tt(n, t) {
@@ -967,4 +967,4 @@ export {
967
967
  z as s,
968
968
  U as t
969
969
  };
970
- //# sourceMappingURL=atMentions-BhAwZTm1.js.map
970
+ //# sourceMappingURL=atMentions-DrCm42jN.js.map