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