@aintela/chat 0.14.7 → 0.14.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/agent-team.d.ts +1 -1
  2. package/dist/components.d.ts +1 -1
  3. package/dist/components.js +3 -3
  4. package/dist/components.js.map +1 -1
  5. package/dist/hooks.d.ts +1 -1
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/interfaces.d.ts +1 -1
  9. package/dist/models.d.ts +1 -1
  10. package/dist/{predictionRows-Damfwthh.js → predictionRows-BkBwfvt4.js} +169 -168
  11. package/dist/{predictionRows-Damfwthh.js.map → predictionRows-BkBwfvt4.js.map} +1 -1
  12. package/dist/services.d.ts +1 -1
  13. package/dist/src/ErrorBondary.d.ts +1 -1
  14. package/dist/src/components/AgentTeam/BillingLimitBanner.d.ts +1 -1
  15. package/dist/src/components/AgentTeam/ChatAgentHeader.d.ts +4 -4
  16. package/dist/src/components/AgentTeam/HandoffDivider.d.ts +1 -1
  17. package/dist/src/components/AgentTeam/PersonaAvatar.d.ts +2 -2
  18. package/dist/src/components/AiChat/ChatPane/AgentAvatar.d.ts +2 -2
  19. package/dist/src/components/AiChat/ChatPane/FloatingConnectionStatus.d.ts +1 -1
  20. package/dist/src/components/AiChat/ChatPane/GuestIcon.d.ts +2 -2
  21. package/dist/src/components/AiChat/ChatPane/parts/ReadOnlyGuard.d.ts +1 -1
  22. package/dist/src/components/Library/LinearBackgroundProgress.d.ts +1 -1
  23. package/dist/src/components/Library/LinearProgressBarWithMarkers.d.ts +1 -1
  24. package/dist/src/components/Library/SessionUsagePanel.d.ts +1 -1
  25. package/dist/src/components/Library/TurnAwareButton.d.ts +1 -1
  26. package/dist/src/components/v2/DetachedRunTaskBox.d.ts +1 -1
  27. package/dist/src/components/v2/DetachedRunTranscript.d.ts +1 -1
  28. package/dist/src/components/v2/MentionPickerPanel.d.ts +1 -1
  29. package/dist/src/components/v2/PromptDateMarkers.d.ts +1 -1
  30. package/dist/src/components/v2/PromptGhostHint.d.ts +1 -1
  31. package/dist/src/components/v2/SharedSessionTranscript.d.ts +1 -1
  32. package/dist/src/components/v2/TriggerDropdown.d.ts +1 -1
  33. package/dist/src/utils/promptHighlight.d.ts +2 -1
  34. package/dist/src/utils/promptHighlight.test.d.ts +1 -0
  35. package/dist/utils.d.ts +1 -1
  36. package/dist/utils.js +1 -1
  37. package/package.json +2 -2
@@ -1,79 +1,79 @@
1
1
  var R = Object.defineProperty;
2
- var z = (n, t, e) => t in n ? R(n, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : n[t] = e;
3
- var d = (n, t) => R(n, "name", { value: t, configurable: !0 });
4
- var q = (n, t, e) => z(n, typeof t != "symbol" ? t + "" : t, e);
5
- const F = /^[a-z][a-z0-9+.-]*:\/\//i, K = /* @__PURE__ */ d((n, t, e) => {
6
- let o = "URL", r = null, i = null, s = null;
7
- if (n[0] == "#") {
8
- const a = n.indexOf("-"), l = n.slice(1, a);
9
- switch (s = n.slice(a + 1), l.toLowerCase()) {
2
+ var I = (r, t, e) => t in r ? R(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
3
+ var d = (r, t) => R(r, "name", { value: t, configurable: !0 });
4
+ var q = (r, t, e) => I(r, typeof t != "symbol" ? t + "" : t, e);
5
+ const z = /^[a-z][a-z0-9+.-]*:\/\//i, Z = /* @__PURE__ */ d((r, t, e) => {
6
+ let o = "URL", n = null, i = null, s = null;
7
+ if (r[0] == "#") {
8
+ const a = r.indexOf("-"), l = r.slice(1, a);
9
+ switch (s = r.slice(a + 1), l.toLowerCase()) {
10
10
  case "opendashboard":
11
11
  o = "OpenDashboard";
12
12
  break;
13
13
  case "ask":
14
- o = "Question", r = e;
14
+ o = "Question", n = e;
15
15
  break;
16
16
  }
17
- } else F.test(n) ? (o = "URL", i = n) : n[0] === "/" ? (o = "Navigate", i = n) : (n = n.replaceAll("exported/", `exported/${t}/`), o = "Export");
18
- return { action: o, url: i, question: r, parameter: s };
19
- }, "extractLinkAction"), I = /* @__PURE__ */ d((n, t) => Array.from(
20
- { length: Math.ceil(n.length / t) },
21
- (e, o) => n.slice(o * t, o * t + t)
22
- ), "chunkArray"), Z = /* @__PURE__ */ d((n) => {
23
- n = n.replaceAll("\\n", `
17
+ } else z.test(r) ? (o = "URL", i = r) : r[0] === "/" ? (o = "Navigate", i = r) : (r = r.replaceAll("exported/", `exported/${t}/`), o = "Export");
18
+ return { action: o, url: i, question: n, parameter: s };
19
+ }, "extractLinkAction"), F = /* @__PURE__ */ d((r, t) => Array.from(
20
+ { length: Math.ceil(r.length / t) },
21
+ (e, o) => r.slice(o * t, o * t + t)
22
+ ), "chunkArray"), J = /* @__PURE__ */ d((r) => {
23
+ r = r.replaceAll("\\n", `
24
24
  `);
25
- const t = 90, e = n.split(" "), o = [];
26
- let r = !1;
25
+ const t = 90, e = r.split(" "), o = [];
26
+ let n = !1;
27
27
  for (const i of e)
28
28
  if (i.length > t) {
29
- r = !0;
30
- const s = [...i], l = I(s, t).map((c) => c.join("")).join(`
29
+ n = !0;
30
+ const s = [...i], l = F(s, t).map((c) => c.join("")).join(`
31
31
  `);
32
32
  o.push(l);
33
33
  } else
34
34
  o.push(i);
35
- return r ? o.join(" ") : n;
35
+ return n ? o.join(" ") : r;
36
36
  }, "splitBigLinesWithSpaces");
37
- function B(n) {
38
- let t = parseFloat(n);
37
+ function B(r) {
38
+ let t = parseFloat(r);
39
39
  if (!isNaN(t))
40
- return n = n.replaceAll(/[,\.]/g, ""), parseInt(n);
40
+ return r = r.replaceAll(/[,\.]/g, ""), parseInt(r);
41
41
  var e = "";
42
- for (const r of n)
43
- r.match(/[0-9]/) && (e += r);
44
- const o = e.length / n.length;
42
+ for (const n of r)
43
+ n.match(/[0-9]/) && (e += n);
44
+ const o = e.length / r.length;
45
45
  return t = parseInt(e), !isNaN(t) && o > 0.5 ? t : NaN;
46
46
  }
47
47
  d(B, "parseRawNumber");
48
48
  const V = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/i, P = /^[0-9a-f]{32}/i;
49
- function J(n) {
50
- if (!n || typeof n != "string")
49
+ function Y(r) {
50
+ if (!r || typeof r != "string")
51
51
  return !1;
52
- const t = U(n);
53
- return t === null ? !1 : n.startsWith(t);
52
+ const t = U(r);
53
+ return t === null ? !1 : r.startsWith(t);
54
54
  }
55
- d(J, "startsWithInteractionId");
56
- function U(n) {
57
- if (!n || typeof n != "string")
55
+ d(Y, "startsWithInteractionId");
56
+ function U(r) {
57
+ if (!r || typeof r != "string")
58
58
  return null;
59
- const t = n.match(V);
59
+ const t = r.match(V);
60
60
  if (t)
61
61
  return t[0];
62
- const e = n.match(P);
62
+ const e = r.match(P);
63
63
  return e ? e[0] : null;
64
64
  }
65
65
  d(U, "extractInteractionId");
66
- function Y(n) {
67
- if (n.length == 0)
68
- return n;
69
- const t = n.replaceAll("_", " ").replaceAll("-", " ");
66
+ function Q(r) {
67
+ if (r.length == 0)
68
+ return r;
69
+ const t = r.replaceAll("_", " ").replaceAll("-", " ");
70
70
  return t[0].toUpperCase() + t.slice(1);
71
71
  }
72
- d(Y, "prettiffyPythonFunctionName");
73
- function Q(n) {
74
- return !n || typeof n != "string" ? !1 : !!(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n) || /^[0-9a-f]{32}$/i.test(n));
72
+ d(Q, "prettiffyPythonFunctionName");
73
+ function tt(r) {
74
+ return !r || typeof r != "string" ? !1 : !!(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(r) || /^[0-9a-f]{32}$/i.test(r));
75
75
  }
76
- d(Q, "isValidInteractionId");
76
+ d(tt, "isValidInteractionId");
77
77
  const M = /* @__PURE__ */ new Set(), E = class E {
78
78
  constructor(t = {}) {
79
79
  this.options = {
@@ -172,8 +172,8 @@ const M = /* @__PURE__ */ new Set(), E = class E {
172
172
  * Make a specific table sortable
173
173
  */
174
174
  makeTableSortable(t, e) {
175
- let o = t.querySelector("thead"), r = null, i = [];
176
- if (o && (r = o.querySelector("tr"), r && (i = r.querySelectorAll("th"))), i.length === 0) {
175
+ let o = t.querySelector("thead"), n = null, i = [];
176
+ if (o && (n = o.querySelector("tr"), n && (i = n.querySelectorAll("th"))), i.length === 0) {
177
177
  console.warn("Table has no sortable columns, skipping");
178
178
  return;
179
179
  }
@@ -194,8 +194,8 @@ const M = /* @__PURE__ */ new Set(), E = class E {
194
194
  replaceExponentialValues(t) {
195
195
  const e = t.querySelector("tbody");
196
196
  if (!e) return;
197
- e.querySelectorAll("tr").forEach((r) => {
198
- r.querySelectorAll("td, th").forEach((s) => {
197
+ e.querySelectorAll("tr").forEach((n) => {
198
+ n.querySelectorAll("td, th").forEach((s) => {
199
199
  const l = s.textContent.trim().match(/^([\d,]+\.?\d*)[eE][+-]?(\d+)$/);
200
200
  if (l) {
201
201
  const c = parseFloat(l[1].replace(/,/g, "")), u = parseInt(l[2]), f = c * Math.pow(10, u), h = this.formatNumber(f);
@@ -221,24 +221,24 @@ const M = /* @__PURE__ */ new Set(), E = class E {
221
221
  */
222
222
  convertRowToHeader(t, e, o) {
223
223
  try {
224
- const r = t.cloneNode(!0);
225
- return r.querySelectorAll("td").forEach((s) => {
224
+ const n = t.cloneNode(!0);
225
+ return n.querySelectorAll("td").forEach((s) => {
226
226
  const a = document.createElement("th");
227
227
  Array.from(s.attributes).forEach((l) => {
228
228
  a.setAttribute(l.name, l.value);
229
229
  }), a.innerHTML = s.innerHTML, a.style.cssText = s.style.cssText, s.parentNode.replaceChild(a, s);
230
- }), o && o.contains(t) ? o.removeChild(t) : t.parentNode && t.parentNode.removeChild(t), e.appendChild(r), r;
231
- } catch (r) {
232
- return console.error("Error converting row to header:", r), null;
230
+ }), o && o.contains(t) ? o.removeChild(t) : t.parentNode && t.parentNode.removeChild(t), e.appendChild(n), n;
231
+ } catch (n) {
232
+ return console.error("Error converting row to header:", n), null;
233
233
  }
234
234
  }
235
235
  /**
236
236
  * Make a specific header sortable
237
237
  */
238
- makeHeaderSortable(t, e, o, r) {
239
- t.classList.add(this.options.sortableClass), t.style.cursor = "pointer", (!this.options.preserveExistingIcons || !t.querySelector(".material-icons")) && this.addSortIcon(t), this.options.enableResizing && this.addResizing(t, e, o, r), this.options.enableReordering && this.addDragAndDrop(t, e, o, r);
238
+ makeHeaderSortable(t, e, o, n) {
239
+ t.classList.add(this.options.sortableClass), t.style.cursor = "pointer", (!this.options.preserveExistingIcons || !t.querySelector(".material-icons")) && this.addSortIcon(t), this.options.enableResizing && this.addResizing(t, e, o, n), this.options.enableReordering && this.addDragAndDrop(t, e, o, n);
240
240
  const i = /* @__PURE__ */ d((l) => {
241
- l.preventDefault(), this.sortTable(e, o, r);
241
+ l.preventDefault(), this.sortTable(e, o, n);
242
242
  }, "clickListener"), s = /* @__PURE__ */ d((l) => {
243
243
  t.classList.contains(this.options.activeSortClass) || (t.style.background = this.options.theme.palette.surface.hover);
244
244
  }, "mouseEnterListener"), a = /* @__PURE__ */ d((l) => {
@@ -263,12 +263,12 @@ const M = /* @__PURE__ */ new Set(), E = class E {
263
263
  * Sort table by column
264
264
  */
265
265
  sortTable(t, e, o) {
266
- const r = t.querySelector("tbody");
267
- if (!r) {
266
+ const n = t.querySelector("tbody");
267
+ if (!n) {
268
268
  console.warn("Table has no tbody element");
269
269
  return;
270
270
  }
271
- const i = Array.from(r.querySelectorAll("tr"));
271
+ const i = Array.from(n.querySelectorAll("tr"));
272
272
  if (i.length === 0) {
273
273
  console.warn("Table has no data rows");
274
274
  return;
@@ -280,14 +280,14 @@ const M = /* @__PURE__ */ new Set(), E = class E {
280
280
  this.restoreOriginalOrder(t, i);
281
281
  return;
282
282
  }
283
- this.sortRows(i, o, a).forEach((c) => r.appendChild(c));
283
+ this.sortRows(i, o, a).forEach((c) => n.appendChild(c));
284
284
  }
285
285
  /**
286
286
  * Sort rows based on column data
287
287
  */
288
288
  sortRows(t, e, o) {
289
- return t.sort((r, i) => {
290
- const s = r.cells[e], a = i.cells[e];
289
+ return t.sort((n, i) => {
290
+ const s = n.cells[e], a = i.cells[e];
291
291
  if (!s || !a) return 0;
292
292
  const l = this.extractValue(s), c = this.extractValue(a);
293
293
  if (this.options.customSorters[e])
@@ -330,17 +330,17 @@ const M = /* @__PURE__ */ new Set(), E = class E {
330
330
  /**
331
331
  * Update visual indicators for sort state
332
332
  */
333
- updateSortIndicators(t, e, o, r) {
333
+ updateSortIndicators(t, e, o, n) {
334
334
  const i = t.querySelectorAll("thead tr th");
335
335
  if (i.forEach((s, a) => {
336
336
  s.classList.remove(this.options.activeSortClass, this.options.ascendingClass, this.options.descendingClass);
337
337
  const l = s.querySelector(".material-icons");
338
338
  l && (l.textContent = this.options.unsortedIcon, l.style.opacity = "0.6");
339
- }), r !== "none") {
339
+ }), n !== "none") {
340
340
  const s = i[o];
341
341
  s.classList.add(this.options.activeSortClass);
342
342
  const a = s.querySelector(".material-icons");
343
- a && (r === "asc" ? (s.classList.add(this.options.ascendingClass), a.textContent = this.options.ascendingIcon) : (s.classList.add(this.options.descendingClass), a.textContent = this.options.descendingIcon), a.style.opacity = "1");
343
+ a && (n === "asc" ? (s.classList.add(this.options.ascendingClass), a.textContent = this.options.ascendingIcon) : (s.classList.add(this.options.descendingClass), a.textContent = this.options.descendingIcon), a.style.opacity = "1");
344
344
  }
345
345
  }
346
346
  /**
@@ -348,12 +348,12 @@ const M = /* @__PURE__ */ new Set(), E = class E {
348
348
  */
349
349
  restoreOriginalOrder(t, e) {
350
350
  const o = t.querySelector("tbody");
351
- e.forEach((r) => o.appendChild(r));
351
+ e.forEach((n) => o.appendChild(n));
352
352
  }
353
353
  /**
354
354
  * Add resizing functionality to a header
355
355
  */
356
- addResizing(t, e, o, r) {
356
+ addResizing(t, e, o, n) {
357
357
  if (t.classList.add(this.options.resizableClass), t.style.position = "relative", t.querySelector(".resize-handle"))
358
358
  return;
359
359
  const i = document.createElement("div");
@@ -389,7 +389,7 @@ const M = /* @__PURE__ */ new Set(), E = class E {
389
389
  /**
390
390
  * Add drag and drop functionality to a header
391
391
  */
392
- addDragAndDrop(t, e, o, r) {
392
+ addDragAndDrop(t, e, o, n) {
393
393
  if (t.querySelector(".drag-handle"))
394
394
  return;
395
395
  t.classList.add(this.options.draggableClass), t.draggable = !0;
@@ -426,8 +426,8 @@ const M = /* @__PURE__ */ new Set(), E = class E {
426
426
  * Create a custom drag image for better UX
427
427
  */
428
428
  createCustomDragImage(t, e, o) {
429
- const r = document.createElement("div");
430
- r.style.cssText = `
429
+ const n = document.createElement("div");
430
+ n.style.cssText = `
431
431
  position: absolute;
432
432
  top: -1000px;
433
433
  left: -1000px;
@@ -451,22 +451,22 @@ const M = /* @__PURE__ */ new Set(), E = class E {
451
451
  align-items: center;
452
452
  `;
453
453
  const i = o;
454
- r.innerHTML = `
454
+ n.innerHTML = `
455
455
  <div style="display: flex; align-items: center; gap: 5px; align-content: center;color:white;">
456
456
  <span style="overflow: hidden; text-overflow: ellipsis">${i}</span>
457
457
  <svg style="fill: grey; font-size: 10px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="20" height="20" viewBox="0 0 20 20" ><defs><path id="a" d="M0 0h24v24H0V0z"/></defs><clipPath id="b"><use xlink:href="#a" overflow="visible"/></clipPath><path clip-path="url(#b)" d="M9.01 14H2v2h7.01v3L13 15l-3.99-4v3zm5.98-1v-3H22V8h-7.01V5L11 9l3.99 4z"/></svg>
458
458
  </div>
459
- `, document.body.appendChild(r), t.dataTransfer.setDragImage(r, 50, 12), setTimeout(() => {
460
- document.body.contains(r) && document.body.removeChild(r);
459
+ `, document.body.appendChild(n), t.dataTransfer.setDragImage(n, 50, 12), setTimeout(() => {
460
+ document.body.contains(n) && document.body.removeChild(n);
461
461
  }, 100);
462
462
  }
463
463
  /**
464
464
  * Highlight an entire column during drag operations
465
465
  */
466
466
  highlightColumn(t, e, o) {
467
- const r = t.querySelector("thead tr"), i = t.querySelector("tbody");
468
- if (!r || !i) return;
469
- const s = r.children[e];
467
+ const n = t.querySelector("thead tr"), i = t.querySelector("tbody");
468
+ if (!n || !i) return;
469
+ const s = n.children[e];
470
470
  if (s)
471
471
  if (o) {
472
472
  s.classList.add(this.options.dragOverClass);
@@ -490,9 +490,9 @@ const M = /* @__PURE__ */ new Set(), E = class E {
490
490
  clearAllColumnHighlights(t) {
491
491
  const e = t.querySelector("thead tr"), o = t.querySelector("tbody");
492
492
  if (!e || !o) return;
493
- const r = e.children;
494
- for (let s = 0; s < r.length; s++)
495
- r[s].classList.remove(this.options.dragOverClass);
493
+ const n = e.children;
494
+ for (let s = 0; s < n.length; s++)
495
+ n[s].classList.remove(this.options.dragOverClass);
496
496
  const i = o.children;
497
497
  for (let s = 0; s < i.length; s++) {
498
498
  const a = i[s].children;
@@ -503,25 +503,25 @@ const M = /* @__PURE__ */ new Set(), E = class E {
503
503
  /**
504
504
  * Reorder columns in a table
505
505
  */
506
- reorderColumns(t, e, o, r) {
506
+ reorderColumns(t, e, o, n) {
507
507
  const i = t.querySelector("thead tr"), s = t.querySelector("tbody");
508
508
  if (!i || !s) return;
509
509
  const a = Array.from(i.children), l = Array.from(s.children);
510
- if (o < 0 || o >= a.length || r < 0 || r >= a.length) {
510
+ if (o < 0 || o >= a.length || n < 0 || n >= a.length) {
511
511
  console.warn("Invalid column indices for reordering");
512
512
  return;
513
513
  }
514
- if (o === r)
514
+ if (o === n)
515
515
  return;
516
- const c = a[o], u = a[r];
517
- o < r ? i.insertBefore(c, u.nextSibling) : i.insertBefore(c, u), l.forEach((h, m) => {
518
- const p = Array.from(h.children), y = p[o], v = p[r];
519
- o < r ? h.insertBefore(y, v.nextSibling) : h.insertBefore(y, v);
516
+ const c = a[o], u = a[n];
517
+ o < n ? i.insertBefore(c, u.nextSibling) : i.insertBefore(c, u), l.forEach((h, m) => {
518
+ const p = Array.from(h.children), y = p[o], v = p[n];
519
+ o < n ? h.insertBefore(y, v.nextSibling) : h.insertBefore(y, v);
520
520
  });
521
521
  const f = this.originalColumnOrder.get(e);
522
522
  if (f) {
523
523
  const h = [...f], m = h[o];
524
- h.splice(o, 1), h.splice(r, 0, m), this.originalColumnOrder.set(e, h);
524
+ h.splice(o, 1), h.splice(n, 0, m), this.originalColumnOrder.set(e, h);
525
525
  }
526
526
  this.applyTableStyles(t), this.refreshDragAndDropListeners(t, e);
527
527
  }
@@ -545,13 +545,13 @@ const M = /* @__PURE__ */ new Set(), E = class E {
545
545
  updateTableWidth(t) {
546
546
  const e = t.querySelectorAll("th");
547
547
  let o = 0;
548
- e.forEach((r) => {
549
- const i = r.style.width;
548
+ e.forEach((n) => {
549
+ const i = n.style.width;
550
550
  if (i) {
551
551
  const s = parseInt(i.replace("px", ""));
552
552
  o += s;
553
553
  } else {
554
- const s = r.textContent.replace(/[📊🔍]/g, "").trim();
554
+ const s = n.textContent.replace(/[📊🔍]/g, "").trim();
555
555
  o += s.length;
556
556
  }
557
557
  }), t.style.width = `${o}px`;
@@ -561,11 +561,11 @@ const M = /* @__PURE__ */ new Set(), E = class E {
561
561
  */
562
562
  calculateTableWidth(t) {
563
563
  var f;
564
- const e = t.getAttribute("data-original-width"), o = e ? parseFloat(e) : 0, r = t.querySelectorAll("th");
564
+ const e = t.getAttribute("data-original-width"), o = e ? parseFloat(e) : 0, n = t.querySelectorAll("th");
565
565
  let i = 0;
566
566
  t.parentElement.clientWidth;
567
567
  const s = [];
568
- r.forEach((h) => {
568
+ n.forEach((h) => {
569
569
  let p = h.textContent.replace(/[📊🔍]/g, "").trim().length * this.charWidth + 15;
570
570
  s.push(p), i += p;
571
571
  });
@@ -576,7 +576,7 @@ const M = /* @__PURE__ */ new Set(), E = class E {
576
576
  const b = p.textContent.length * this.charWidth + 15;
577
577
  b > s[y] && y < s.length && (s[y] = b);
578
578
  });
579
- c = s.reduce((h, m) => h += m, 0), r.forEach((h, m) => {
579
+ c = s.reduce((h, m) => h += m, 0), n.forEach((h, m) => {
580
580
  if (c > l) {
581
581
  const p = s[m] / c;
582
582
  h.style.width = `${l * p}px`;
@@ -739,15 +739,15 @@ const M = /* @__PURE__ */ new Set(), E = class E {
739
739
  */
740
740
  destroy() {
741
741
  this.tables.forEach((e) => {
742
- e.querySelectorAll(`.${this.options.sortableClass}`).forEach((r) => {
743
- r.classList.remove(
742
+ e.querySelectorAll(`.${this.options.sortableClass}`).forEach((n) => {
743
+ n.classList.remove(
744
744
  this.options.sortableClass,
745
745
  this.options.activeSortClass,
746
746
  this.options.ascendingClass,
747
747
  this.options.descendingClass
748
- ), r.style.cursor = "", r.style.background = "";
749
- const i = r.cloneNode(!0);
750
- r.parentNode.replaceChild(i, r);
748
+ ), n.style.cursor = "", n.style.background = "";
749
+ const i = n.cloneNode(!0);
750
+ n.parentNode.replaceChild(i, n);
751
751
  });
752
752
  });
753
753
  const t = document.getElementById("sortable-table-styles");
@@ -764,45 +764,46 @@ d(E, "SortableTable"), /** Fallback advance width, in px, for one character of t
764
764
  q(E, "DEFAULT_CHAR_WIDTH", 8);
765
765
  let A = E;
766
766
  typeof window < "u" && (window.SortableTable = A);
767
- const H = /* @__PURE__ */ new Set(["/", "@", "#"]), X = /* @__PURE__ */ d((n) => n === "/" ? "slash" : n === "@" ? "at" : "hash", "triggerTypeFor"), T = /[ \t\r\n\f\v]/, G = /\[[^\]\n]+\]/g, _ = /* @__PURE__ */ d((n, t, e) => {
767
+ const _ = /* @__PURE__ */ new Set(["/", "@", "#"]), G = /* @__PURE__ */ d((r) => r === "/" ? "slash" : r === "@" ? "at" : "hash", "triggerTypeFor"), k = /[ \t\r\n\f\v]/, X = /[,;:.!?]/, j = /\[[^\]\n]+\]/g, H = /* @__PURE__ */ d((r, t, e) => {
768
768
  let o = 0;
769
- const r = /* @__PURE__ */ d((i) => {
770
- const s = i === 0 ? t : n[i - 1];
771
- return s === void 0 || T.test(s);
769
+ const n = /* @__PURE__ */ d((i) => {
770
+ const s = i === 0 ? t : r[i - 1];
771
+ return s === void 0 || k.test(s);
772
772
  }, "boundaryBefore");
773
- for (; o < n.length; ) {
774
- const i = n[o];
775
- if (r(o) && H.has(i)) {
773
+ for (; o < r.length; ) {
774
+ const i = r[o];
775
+ if (n(o) && _.has(i)) {
776
776
  let s = o + 1;
777
- for (; s < n.length && !T.test(n[s]); ) s += 1;
778
- e.push({ type: X(i), text: n.slice(o, s) }), o = s;
777
+ for (; s < r.length && !k.test(r[s]); ) s += 1;
778
+ for (; s > o + 1 && X.test(r[s - 1]); ) s -= 1;
779
+ e.push({ type: G(i), text: r.slice(o, s) }), o = s;
779
780
  } else {
780
781
  let s = o + 1;
781
- for (; s < n.length; ) {
782
- const a = n[s];
783
- if (H.has(a) && T.test(n[s - 1])) break;
782
+ for (; s < r.length; ) {
783
+ const a = r[s];
784
+ if (_.has(a) && k.test(r[s - 1])) break;
784
785
  s += 1;
785
786
  }
786
- e.push({ type: "plain", text: n.slice(o, s) }), o = s;
787
+ e.push({ type: "plain", text: r.slice(o, s) }), o = s;
787
788
  }
788
789
  }
789
- }, "tokenizeSegment"), tt = /* @__PURE__ */ d((n) => {
790
- if (!n) return [];
791
- const t = [], e = new RegExp(G.source, "g");
790
+ }, "tokenizeSegment"), et = /* @__PURE__ */ d((r) => {
791
+ if (!r) return [];
792
+ const t = [], e = new RegExp(j.source, "g");
792
793
  let o = 0;
793
- for (let r = e.exec(n); r; r = e.exec(n))
794
- r.index > o && _(n.slice(o, r.index), o === 0 ? void 0 : n[o - 1], t), t.push({ type: "placeholder", text: r[0] }), o = r.index + r[0].length;
795
- return o < n.length && _(n.slice(o), o === 0 ? void 0 : n[o - 1], t), t;
796
- }, "tokenizeForHighlight"), et = /* @__PURE__ */ d((n, t) => {
797
- const e = t.filter((r) => r.trim().length > 0).sort((r, i) => i.length - r.length);
798
- if (e.length === 0) return n;
794
+ for (let n = e.exec(r); n; n = e.exec(r))
795
+ n.index > o && H(r.slice(o, n.index), o === 0 ? void 0 : r[o - 1], t), t.push({ type: "placeholder", text: n[0] }), o = n.index + n[0].length;
796
+ return o < r.length && H(r.slice(o), o === 0 ? void 0 : r[o - 1], t), t;
797
+ }, "tokenizeForHighlight"), st = /* @__PURE__ */ d((r, t) => {
798
+ const e = t.filter((n) => n.trim().length > 0).sort((n, i) => i.length - n.length);
799
+ if (e.length === 0) return r;
799
800
  const o = [];
800
- for (const r of n) {
801
- if (r.type !== "plain") {
802
- o.push(r);
801
+ for (const n of r) {
802
+ if (n.type !== "plain") {
803
+ o.push(n);
803
804
  continue;
804
805
  }
805
- let i = r.text;
806
+ let i = n.text;
806
807
  for (; i.length > 0; ) {
807
808
  let s = -1, a = 0;
808
809
  for (const l of e) {
@@ -818,41 +819,41 @@ const H = /* @__PURE__ */ new Set(["/", "@", "#"]), X = /* @__PURE__ */ d((n) =>
818
819
  }
819
820
  return o;
820
821
  }, "chipLocations");
821
- function st(n, t, e = t, o = 600) {
822
- const r = n.value;
822
+ function ot(r, t, e = t, o = 600) {
823
+ const n = r.value;
823
824
  let i = !1;
824
825
  const s = /* @__PURE__ */ d(() => {
825
- i || (i = !0, document.removeEventListener("selectionchange", l), n.removeEventListener("keydown", s), n.removeEventListener("input", s), n.removeEventListener("pointerdown", s), window.clearTimeout(c), window.clearInterval(u));
826
+ i || (i = !0, document.removeEventListener("selectionchange", l), r.removeEventListener("keydown", s), r.removeEventListener("input", s), r.removeEventListener("pointerdown", s), window.clearTimeout(c), window.clearInterval(u));
826
827
  }, "stop"), a = /* @__PURE__ */ d(() => {
827
- if (n.value !== r) {
828
+ if (r.value !== n) {
828
829
  s();
829
830
  return;
830
831
  }
831
- n.selectionStart === t && n.selectionEnd === e || n.setSelectionRange(t, e);
832
+ r.selectionStart === t && r.selectionEnd === e || r.setSelectionRange(t, e);
832
833
  }, "apply"), l = /* @__PURE__ */ d(() => {
833
- document.activeElement === n && a();
834
+ document.activeElement === r && a();
834
835
  }, "onSelectionChange");
835
836
  a();
836
837
  const c = window.setTimeout(s, o), u = window.setInterval(a, 50);
837
- return document.addEventListener("selectionchange", l), n.addEventListener("keydown", s), n.addEventListener("input", s), n.addEventListener("pointerdown", s), s;
838
+ return document.addEventListener("selectionchange", l), r.addEventListener("keydown", s), r.addEventListener("input", s), r.addEventListener("pointerdown", s), s;
838
839
  }
839
- d(st, "placeCaret");
840
- function ot(n = {}) {
840
+ d(ot, "placeCaret");
841
+ function rt(r = {}) {
841
842
  if (typeof document > "u") return;
842
843
  const t = /* @__PURE__ */ d((i) => {
843
844
  i.stopPropagation(), i.preventDefault(), o();
844
845
  }, "onClick"), e = /* @__PURE__ */ d((i) => {
845
846
  i.stopPropagation(), i.preventDefault(), document.removeEventListener("mousedown", e, !0);
846
847
  }, "onMouseDown"), o = /* @__PURE__ */ d(() => {
847
- document.removeEventListener("click", t, !0), document.removeEventListener("mousedown", e, !0), document.removeEventListener("pointerdown", o, !0), window.clearTimeout(r);
848
- }, "cleanup"), r = window.setTimeout(o, 500);
849
- document.addEventListener("click", t, !0), n.mousedown && (document.addEventListener("mousedown", e, !0), document.addEventListener("pointerdown", o, !0));
848
+ document.removeEventListener("click", t, !0), document.removeEventListener("mousedown", e, !0), document.removeEventListener("pointerdown", o, !0), window.clearTimeout(n);
849
+ }, "cleanup"), n = window.setTimeout(o, 500);
850
+ document.addEventListener("click", t, !0), r.mousedown && (document.addEventListener("mousedown", e, !0), document.addEventListener("pointerdown", o, !0));
850
851
  }
851
- d(ot, "swallowNextClick");
852
- const rt = 3;
853
- async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
852
+ d(rt, "swallowNextClick");
853
+ const nt = 3;
854
+ async function it(r, { onAtQuery: t, onAtPersonQuery: e }, {
854
855
  personConfidence: o = 0,
855
- locationConfidence: r = 0,
856
+ locationConfidence: n = 0,
856
857
  personFirstThreshold: i = 0.5,
857
858
  vertical: s = "air",
858
859
  hotelConfidence: a = 0,
@@ -862,12 +863,12 @@ async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
862
863
  byPriority: f = !1,
863
864
  capLeading: h
864
865
  } = {}) {
865
- const m = o >= i && o >= r;
866
+ const m = o >= i && o >= n;
866
867
  let p = [], y = [], v = !t, b = !e, D = null;
867
868
  const N = /* @__PURE__ */ d((g, w, C, W) => w && h !== void 0 && t && e && !(W && C.length === 0) ? g.slice(0, h) : g, "cap"), L = /* @__PURE__ */ d((g, w) => {
868
869
  const C = N(g, !m, w, b), $ = N(w, m, g, v).map((S) => S.kind ? S : { ...S, kind: "person" });
869
870
  if (t && e) {
870
- const S = $.map((k) => ({ ...k, group: "person" })), O = C.map((k) => ({ ...k, group: "location" }));
871
+ const S = $.map((T) => ({ ...T, group: "person" })), O = C.map((T) => ({ ...T, group: "location" }));
871
872
  return m ? [...S, ...O] : [...O, ...S];
872
873
  }
873
874
  return [...$, ...C];
@@ -884,7 +885,7 @@ async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
884
885
  w !== D && (D = w, u(g));
885
886
  }, "publish");
886
887
  return await Promise.all([
887
- t ? t(n, {
888
+ t ? t(r, {
888
889
  vertical: s,
889
890
  hotelConfidence: a,
890
891
  hotelNameConfidence: l,
@@ -896,20 +897,20 @@ async function nt(n, { onAtQuery: t, onAtPersonQuery: e }, {
896
897
  }).catch(() => p).then((g) => {
897
898
  p = g, v = !0, x();
898
899
  }) : void 0,
899
- e ? e(n, { leading: m, signal: c }).catch(() => []).then((g) => {
900
+ e ? e(r, { leading: m, signal: c }).catch(() => []).then((g) => {
900
901
  y = g, b = !0, x();
901
902
  }) : void 0
902
903
  ]), L(p, y);
903
904
  }
904
- d(nt, "fetchAtMentions");
905
- function it(n, t) {
906
- var o, r;
907
- const e = (o = n[t]) == null ? void 0 : o.group;
908
- return e !== void 0 && (t === 0 || ((r = n[t - 1]) == null ? void 0 : r.group) !== e);
905
+ d(it, "fetchAtMentions");
906
+ function at(r, t) {
907
+ var o, n;
908
+ const e = (o = r[t]) == null ? void 0 : o.group;
909
+ return e !== void 0 && (t === 0 || ((n = r[t - 1]) == null ? void 0 : n.group) !== e);
909
910
  }
910
- d(it, "isSectionStart");
911
- function at(n) {
912
- return (n ?? []).map((t) => ({
911
+ d(at, "isSectionStart");
912
+ function lt(r) {
913
+ return (r ?? []).map((t) => ({
913
914
  id: t.key,
914
915
  label: t.label,
915
916
  value: t.insert ?? t.label,
@@ -921,23 +922,23 @@ function at(n) {
921
922
  pred: t
922
923
  }));
923
924
  }
924
- d(at, "toPredictionRows");
925
+ d(lt, "toPredictionRows");
925
926
  export {
926
- rt as P,
927
+ nt as P,
927
928
  A as S,
928
- I as a,
929
- K as b,
930
- et as c,
931
- Q as d,
929
+ F as a,
930
+ Z as b,
931
+ st as c,
932
+ tt as d,
932
933
  U as e,
933
- nt as f,
934
- Y as g,
935
- J as h,
936
- it as i,
937
- ot as j,
938
- tt as k,
939
- st as p,
940
- Z as s,
941
- at as t
934
+ it as f,
935
+ Q as g,
936
+ Y as h,
937
+ at as i,
938
+ rt as j,
939
+ et as k,
940
+ ot as p,
941
+ J as s,
942
+ lt as t
942
943
  };
943
- //# sourceMappingURL=predictionRows-Damfwthh.js.map
944
+ //# sourceMappingURL=predictionRows-BkBwfvt4.js.map