@pagelines/sdk 1.0.504 → 1.0.506
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/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js +400 -374
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/AgentController.d.ts +1 -0
- package/dist/agent/schema.d.ts +2 -2
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var Mn = Object.defineProperty;
|
|
2
|
-
var
|
|
2
|
+
var Rs = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var h = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as Me, openBlock as T, createElementBlock as S, createElementVNode as w, normalizeClass as A, ref as ee, watch as
|
|
6
|
-
import { SettingsObject as
|
|
7
|
-
import { P as
|
|
8
|
-
const
|
|
4
|
+
var I = (a, t, e) => Rs(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as Me, openBlock as T, createElementBlock as S, createElementVNode as w, normalizeClass as A, ref as ee, watch as Ye, computed as W, createCommentVNode as U, renderSlot as ns, onMounted as tn, Fragment as Te, renderList as at, withDirectives as ss, vModelText as rs, unref as Kt, toDisplayString as ie, nextTick as jt, createVNode as Wt, createTextVNode as et, withModifiers as Cs, shallowRef as Is } from "vue";
|
|
6
|
+
import { SettingsObject as Ds, Agent as yt, getDefaultAvatarUrl as is, createLogger as Ms } from "@pagelines/core";
|
|
7
|
+
import { P as Ls } from "./sdkClient.js";
|
|
8
|
+
const Os = { class: "spinner max-w-sm" }, zs = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
11
|
}, Ln = /* @__PURE__ */ Me({
|
|
@@ -15,8 +15,8 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
|
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(a) {
|
|
18
|
-
return (t, e) => (T(), S("div",
|
|
19
|
-
(T(), S("svg",
|
|
18
|
+
return (t, e) => (T(), S("div", Os, [
|
|
19
|
+
(T(), S("svg", zs, [
|
|
20
20
|
w("circle", {
|
|
21
21
|
class: A([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
@@ -30,27 +30,27 @@ const Ls = { class: "spinner max-w-sm" }, Os = {
|
|
|
30
30
|
]))
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), Ps = [
|
|
34
34
|
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
35
35
|
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
36
|
-
],
|
|
36
|
+
], Ns = 9e4, as = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), $s = /* @__PURE__ */ new Set([...as, "EMPTY_STREAM", "RATE_LIMIT"]), pn = class pn extends Ds {
|
|
37
37
|
constructor(e) {
|
|
38
38
|
super("AgentChatController", e);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
I(this, "isTextMode", !1);
|
|
40
|
+
I(this, "lastMessage", { hash: "", time: 0 });
|
|
41
|
+
I(this, "isConnecting", !1);
|
|
42
42
|
// Chat conversation tracking (server-managed persistence)
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
I(this, "conversationId");
|
|
44
|
+
I(this, "textState", ee({
|
|
45
45
|
isActive: !1,
|
|
46
46
|
isConnected: !1,
|
|
47
47
|
isThinking: !1,
|
|
48
48
|
connectionStatus: "disconnected"
|
|
49
49
|
}));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher();
|
|
50
|
+
I(this, "agentMode", ee("self"));
|
|
51
|
+
I(this, "sharedMessages", ee([]));
|
|
52
|
+
I(this, "_agent");
|
|
53
|
+
this._agent = e.agent instanceof yt ? e.agent : new yt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
|
|
54
54
|
}
|
|
55
55
|
get chatEnabled() {
|
|
56
56
|
return this._agent.chatAvailable.value;
|
|
@@ -122,10 +122,29 @@ Current User:
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
setupModeWatcher() {
|
|
125
|
-
|
|
125
|
+
Ye(this.agentMode, async (e, n) => {
|
|
126
126
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
+
setupAvailabilityWatcher() {
|
|
130
|
+
Ye(() => this._agent.chatAvailable.value, (e) => {
|
|
131
|
+
if (!(!this.isTextMode || this.isConnecting)) {
|
|
132
|
+
if (e) {
|
|
133
|
+
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
134
|
+
isConnected: !0,
|
|
135
|
+
connectionStatus: "connected",
|
|
136
|
+
error: void 0
|
|
137
|
+
});
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
this.textState.value.isConnected && this.updateState(this.textState, {
|
|
141
|
+
isConnected: !1,
|
|
142
|
+
connectionStatus: "disconnected",
|
|
143
|
+
error: this.chatUnavailableReason
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
129
148
|
/**
|
|
130
149
|
* Hard error path. Resets the connection and surfaces an inline bubble so
|
|
131
150
|
* the user actually sees what happened — `connectionStatus: 'error'`
|
|
@@ -223,7 +242,7 @@ Current User:
|
|
|
223
242
|
const g = this.sharedMessages.value, y = g[g.length - 1];
|
|
224
243
|
if (y?.id === o && y.text) {
|
|
225
244
|
let E = y.text;
|
|
226
|
-
for (const O of
|
|
245
|
+
for (const O of Ps)
|
|
227
246
|
O.pattern.test(E) && (console.debug(`[chat] filtered directive: ${O.label}`), E = E.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
|
|
228
247
|
E ? E !== y.text && (y.text = E, this.sharedMessages.value = [...g]) : this.sharedMessages.value = g.slice(0, -1);
|
|
229
248
|
}
|
|
@@ -231,9 +250,15 @@ Current User:
|
|
|
231
250
|
}, "onDone"), b = /* @__PURE__ */ h((d) => {
|
|
232
251
|
const g = this.sharedMessages.value, y = g[g.length - 1];
|
|
233
252
|
if (y?.id === o && !y.text && (this.sharedMessages.value = g.slice(0, -1)), typeof d == "object" && d.code && d.error) {
|
|
234
|
-
const { bucket:
|
|
235
|
-
if (
|
|
236
|
-
const
|
|
253
|
+
const { bucket: ce, actionUrl: ue, actionLabel: ne, help: N } = d;
|
|
254
|
+
if (ce !== void 0 || $s.has(d.code)) {
|
|
255
|
+
const ae = ce ?? (as.has(d.code) ? "account" : "error"), Q = {
|
|
256
|
+
code: d.code,
|
|
257
|
+
bucket: ae,
|
|
258
|
+
...ne ? { actionLabel: ne } : {},
|
|
259
|
+
...ue ? { actionUrl: ue } : {},
|
|
260
|
+
...N ? { help: N } : {}
|
|
261
|
+
};
|
|
237
262
|
this.addMessage(d.error, "system", void 0, Q), ae === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
|
|
238
263
|
} else
|
|
239
264
|
this.handleError(new Error(d.error));
|
|
@@ -267,7 +292,7 @@ Current User:
|
|
|
267
292
|
});
|
|
268
293
|
await Promise.race([
|
|
269
294
|
d,
|
|
270
|
-
new Promise((g, y) => setTimeout(() => y(new Error("timed out")),
|
|
295
|
+
new Promise((g, y) => setTimeout(() => y(new Error("timed out")), Ns))
|
|
271
296
|
]);
|
|
272
297
|
} catch (d) {
|
|
273
298
|
b(d.message || "Something went wrong");
|
|
@@ -300,24 +325,24 @@ function zn(a) {
|
|
|
300
325
|
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
301
326
|
}
|
|
302
327
|
h(zn, "getImageSrc");
|
|
303
|
-
function
|
|
328
|
+
function Wi(a) {
|
|
304
329
|
return zn(a.cover) || zn(a.avatar) || is(a.name);
|
|
305
330
|
}
|
|
306
|
-
h(
|
|
331
|
+
h(Wi, "getAgentAvatarUrl");
|
|
307
332
|
function Pn(a) {
|
|
308
333
|
const t = a.target;
|
|
309
334
|
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = is());
|
|
310
335
|
}
|
|
311
336
|
h(Pn, "handleImageError");
|
|
312
|
-
function
|
|
337
|
+
function qi(a) {
|
|
313
338
|
const { template: t, agent: e } = a;
|
|
314
339
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
315
340
|
}
|
|
316
|
-
h(
|
|
317
|
-
const
|
|
341
|
+
h(qi, "parseButtonTemplate");
|
|
342
|
+
const Us = {
|
|
318
343
|
key: 0,
|
|
319
344
|
class: "absolute inset-0 flex items-center justify-center"
|
|
320
|
-
},
|
|
345
|
+
}, Vi = /* @__PURE__ */ Me({
|
|
321
346
|
__name: "ElAgentButton",
|
|
322
347
|
props: {
|
|
323
348
|
theme: { default: "primary" },
|
|
@@ -344,25 +369,25 @@ const Ns = {
|
|
|
344
369
|
return (r, s) => (T(), S("button", {
|
|
345
370
|
class: A(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
|
|
346
371
|
}, [
|
|
347
|
-
a.loading ? (T(), S("div",
|
|
372
|
+
a.loading ? (T(), S("div", Us, [...s[0] || (s[0] = [
|
|
348
373
|
w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
349
|
-
])])) :
|
|
374
|
+
])])) : U("", !0),
|
|
350
375
|
w("span", {
|
|
351
376
|
class: A(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
352
377
|
}, [
|
|
353
378
|
a.icon ? (T(), S("i", {
|
|
354
379
|
key: 0,
|
|
355
380
|
class: A([a.icon, n.value])
|
|
356
|
-
}, null, 2)) :
|
|
381
|
+
}, null, 2)) : U("", !0),
|
|
357
382
|
ns(r.$slots, "default"),
|
|
358
383
|
a.iconAfter ? (T(), S("i", {
|
|
359
384
|
key: 1,
|
|
360
385
|
class: A([a.iconAfter, n.value])
|
|
361
|
-
}, null, 2)) :
|
|
386
|
+
}, null, 2)) : U("", !0)
|
|
362
387
|
], 2)
|
|
363
388
|
], 2));
|
|
364
389
|
}
|
|
365
|
-
}),
|
|
390
|
+
}), Bs = ["value"], Yi = /* @__PURE__ */ Me({
|
|
366
391
|
__name: "AgentInputEmail",
|
|
367
392
|
props: {
|
|
368
393
|
modelValue: { default: "" }
|
|
@@ -378,9 +403,9 @@ const Ns = {
|
|
|
378
403
|
class: "w-full px-6 py-3 text-theme-900 placeholder-theme-500 bg-white border border-white rounded-full focus:outline-none transition-all",
|
|
379
404
|
style: { "font-size": "16px" },
|
|
380
405
|
onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
|
|
381
|
-
}, null, 40,
|
|
406
|
+
}, null, 40, Bs));
|
|
382
407
|
}
|
|
383
|
-
}),
|
|
408
|
+
}), Fs = { class: "flex gap-1.5 justify-center" }, Hs = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Zi = /* @__PURE__ */ Me({
|
|
384
409
|
__name: "AgentInputOneTimeCode",
|
|
385
410
|
props: {
|
|
386
411
|
modelValue: {},
|
|
@@ -392,9 +417,9 @@ const Ns = {
|
|
|
392
417
|
const e = a, n = t, r = ee([]), s = ee(Array.from({ length: e.length }).fill("")), o = ee(!1);
|
|
393
418
|
tn(() => {
|
|
394
419
|
e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
|
|
395
|
-
}),
|
|
420
|
+
}), Ye(() => e.modelValue, (p) => {
|
|
396
421
|
s.value = p ? p.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
|
|
397
|
-
}),
|
|
422
|
+
}), Ye(s, () => {
|
|
398
423
|
const p = s.value.filter(Boolean).join("");
|
|
399
424
|
n("update:modelValue", p), p.length === e.length && n("autoSubmit", p);
|
|
400
425
|
}, { deep: !0 });
|
|
@@ -407,8 +432,8 @@ const Ns = {
|
|
|
407
432
|
}, 10);
|
|
408
433
|
else {
|
|
409
434
|
const y = [...s.value];
|
|
410
|
-
g.split("").slice(0, e.length - p).forEach((O,
|
|
411
|
-
y[p +
|
|
435
|
+
g.split("").slice(0, e.length - p).forEach((O, ce) => {
|
|
436
|
+
y[p + ce] = O;
|
|
412
437
|
}), s.value = y;
|
|
413
438
|
const E = Math.min(p + g.length, e.length - 1);
|
|
414
439
|
setTimeout(() => {
|
|
@@ -431,8 +456,8 @@ const Ns = {
|
|
|
431
456
|
for (let d = p; d < e.length; d++)
|
|
432
457
|
s.value[d] = "";
|
|
433
458
|
}
|
|
434
|
-
return h(b, "onFocus"), (p, d) => (T(), S("div",
|
|
435
|
-
(T(!0), S(Te, null,
|
|
459
|
+
return h(b, "onFocus"), (p, d) => (T(), S("div", Fs, [
|
|
460
|
+
(T(!0), S(Te, null, at(a.length, (g) => ss((T(), S("input", {
|
|
436
461
|
key: g,
|
|
437
462
|
ref_for: !0,
|
|
438
463
|
ref: /* @__PURE__ */ h((y) => r.value[g - 1] = y, "ref"),
|
|
@@ -447,15 +472,15 @@ const Ns = {
|
|
|
447
472
|
onKeydown: /* @__PURE__ */ h((y) => c(g - 1, y), "onKeydown"),
|
|
448
473
|
onPaste: /* @__PURE__ */ h((y) => l(g - 1, y), "onPaste"),
|
|
449
474
|
onFocus: /* @__PURE__ */ h((y) => b(g - 1), "onFocus")
|
|
450
|
-
}, null, 40,
|
|
475
|
+
}, null, 40, Hs)), [
|
|
451
476
|
[rs, s.value[g - 1]]
|
|
452
477
|
])), 128))
|
|
453
478
|
]));
|
|
454
479
|
}
|
|
455
|
-
}),
|
|
480
|
+
}), Gs = { class: "relative flex-shrink-0" }, js = ["src", "alt"], Ws = { class: "absolute top-1 right-1" }, qs = {
|
|
456
481
|
key: 1,
|
|
457
482
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
458
|
-
},
|
|
483
|
+
}, Vs = { class: "min-w-0" }, Ys = /* @__PURE__ */ Me({
|
|
459
484
|
__name: "ElModeHeader",
|
|
460
485
|
props: {
|
|
461
486
|
agent: {},
|
|
@@ -469,7 +494,7 @@ const Ns = {
|
|
|
469
494
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
470
495
|
]])
|
|
471
496
|
}, [
|
|
472
|
-
w("div",
|
|
497
|
+
w("div", Gs, [
|
|
473
498
|
w("div", {
|
|
474
499
|
class: A(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
475
500
|
}, [
|
|
@@ -479,19 +504,19 @@ const Ns = {
|
|
|
479
504
|
class: "w-full h-full object-cover",
|
|
480
505
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
481
506
|
(...n) => Kt(Pn) && Kt(Pn)(...n))
|
|
482
|
-
}, null, 40,
|
|
507
|
+
}, null, 40, js)
|
|
483
508
|
], 2),
|
|
484
|
-
w("div",
|
|
509
|
+
w("div", Ws, [
|
|
485
510
|
a.isOnline ? (T(), S(Te, { key: 0 }, [
|
|
486
511
|
e[1] || (e[1] = w("div", {
|
|
487
512
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
488
513
|
style: { "animation-duration": "3s" }
|
|
489
514
|
}, null, -1)),
|
|
490
515
|
e[2] || (e[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
491
|
-
], 64)) : (T(), S("div",
|
|
516
|
+
], 64)) : (T(), S("div", qs))
|
|
492
517
|
])
|
|
493
518
|
]),
|
|
494
|
-
w("div",
|
|
519
|
+
w("div", Vs, [
|
|
495
520
|
w("h1", {
|
|
496
521
|
class: A(["font-light text-white mb-1 truncate", [
|
|
497
522
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
@@ -509,11 +534,11 @@ const Ns = {
|
|
|
509
534
|
}
|
|
510
535
|
});
|
|
511
536
|
const {
|
|
512
|
-
entries:
|
|
537
|
+
entries: ls,
|
|
513
538
|
setPrototypeOf: Nn,
|
|
514
|
-
isFrozen:
|
|
515
|
-
getPrototypeOf:
|
|
516
|
-
getOwnPropertyDescriptor:
|
|
539
|
+
isFrozen: Zs,
|
|
540
|
+
getPrototypeOf: Xs,
|
|
541
|
+
getOwnPropertyDescriptor: Ks
|
|
517
542
|
} = Object;
|
|
518
543
|
let {
|
|
519
544
|
freeze: te,
|
|
@@ -539,7 +564,7 @@ Jt || (Jt = /* @__PURE__ */ h(function(t) {
|
|
|
539
564
|
n[r - 1] = arguments[r];
|
|
540
565
|
return new t(...n);
|
|
541
566
|
}, "construct"));
|
|
542
|
-
const
|
|
567
|
+
const tt = G(Array.prototype.forEach), Qs = G(Array.prototype.lastIndexOf), $n = G(Array.prototype.pop), nt = G(Array.prototype.push), Js = G(Array.prototype.splice), J = Array.isArray, lt = G(String.prototype.toLowerCase), qt = G(String.prototype.toString), Un = G(String.prototype.match), Fe = G(String.prototype.replace), Bn = G(String.prototype.indexOf), er = G(String.prototype.trim), tr = G(Number.prototype.toString), nr = G(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), $ = G(Object.prototype.hasOwnProperty), st = G(Object.prototype.toString), Z = G(RegExp.prototype.test), xt = sr(TypeError);
|
|
543
568
|
function G(a) {
|
|
544
569
|
return function(t) {
|
|
545
570
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -549,16 +574,16 @@ function G(a) {
|
|
|
549
574
|
};
|
|
550
575
|
}
|
|
551
576
|
h(G, "unapply");
|
|
552
|
-
function
|
|
577
|
+
function sr(a) {
|
|
553
578
|
return function() {
|
|
554
579
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
555
580
|
e[n] = arguments[n];
|
|
556
581
|
return Jt(a, e);
|
|
557
582
|
};
|
|
558
583
|
}
|
|
559
|
-
h(
|
|
584
|
+
h(sr, "unconstruct");
|
|
560
585
|
function R(a, t) {
|
|
561
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
586
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lt;
|
|
562
587
|
if (Nn && Nn(a, null), !J(t))
|
|
563
588
|
return a;
|
|
564
589
|
let n = t.length;
|
|
@@ -566,66 +591,66 @@ function R(a, t) {
|
|
|
566
591
|
let r = t[n];
|
|
567
592
|
if (typeof r == "string") {
|
|
568
593
|
const s = e(r);
|
|
569
|
-
s !== r && (
|
|
594
|
+
s !== r && (Zs(t) || (t[n] = s), r = s);
|
|
570
595
|
}
|
|
571
596
|
a[r] = !0;
|
|
572
597
|
}
|
|
573
598
|
return a;
|
|
574
599
|
}
|
|
575
600
|
h(R, "addToSet");
|
|
576
|
-
function
|
|
601
|
+
function rr(a) {
|
|
577
602
|
for (let t = 0; t < a.length; t++)
|
|
578
603
|
$(a, t) || (a[t] = null);
|
|
579
604
|
return a;
|
|
580
605
|
}
|
|
581
|
-
h(
|
|
606
|
+
h(rr, "cleanArray");
|
|
582
607
|
function re(a) {
|
|
583
608
|
const t = He(null);
|
|
584
|
-
for (const [e, n] of
|
|
585
|
-
$(a, e) && (J(n) ? t[e] =
|
|
609
|
+
for (const [e, n] of ls(a))
|
|
610
|
+
$(a, e) && (J(n) ? t[e] = rr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
|
|
586
611
|
return t;
|
|
587
612
|
}
|
|
588
613
|
h(re, "clone");
|
|
589
|
-
function
|
|
614
|
+
function ir(a) {
|
|
590
615
|
switch (typeof a) {
|
|
591
616
|
case "string":
|
|
592
617
|
return a;
|
|
593
618
|
case "number":
|
|
594
|
-
return
|
|
619
|
+
return tr(a);
|
|
595
620
|
case "boolean":
|
|
596
|
-
return
|
|
621
|
+
return nr(a);
|
|
597
622
|
case "bigint":
|
|
598
623
|
return Fn ? Fn(a) : "0";
|
|
599
624
|
case "symbol":
|
|
600
625
|
return Hn ? Hn(a) : "Symbol()";
|
|
601
626
|
case "undefined":
|
|
602
|
-
return
|
|
627
|
+
return st(a);
|
|
603
628
|
case "function":
|
|
604
629
|
case "object": {
|
|
605
630
|
if (a === null)
|
|
606
|
-
return
|
|
631
|
+
return st(a);
|
|
607
632
|
const t = a, e = Ge(t, "toString");
|
|
608
633
|
if (typeof e == "function") {
|
|
609
634
|
const n = e(t);
|
|
610
|
-
return typeof n == "string" ? n :
|
|
635
|
+
return typeof n == "string" ? n : st(n);
|
|
611
636
|
}
|
|
612
|
-
return
|
|
637
|
+
return st(a);
|
|
613
638
|
}
|
|
614
639
|
default:
|
|
615
|
-
return
|
|
640
|
+
return st(a);
|
|
616
641
|
}
|
|
617
642
|
}
|
|
618
|
-
h(
|
|
643
|
+
h(ir, "stringifyValue");
|
|
619
644
|
function Ge(a, t) {
|
|
620
645
|
for (; a !== null; ) {
|
|
621
|
-
const n =
|
|
646
|
+
const n = Ks(a, t);
|
|
622
647
|
if (n) {
|
|
623
648
|
if (n.get)
|
|
624
649
|
return G(n.get);
|
|
625
650
|
if (typeof n.value == "function")
|
|
626
651
|
return G(n.value);
|
|
627
652
|
}
|
|
628
|
-
a =
|
|
653
|
+
a = Xs(a);
|
|
629
654
|
}
|
|
630
655
|
function e() {
|
|
631
656
|
return null;
|
|
@@ -633,44 +658,44 @@ function Ge(a, t) {
|
|
|
633
658
|
return h(e, "fallbackValue"), e;
|
|
634
659
|
}
|
|
635
660
|
h(Ge, "lookupGetter");
|
|
636
|
-
function
|
|
661
|
+
function ar(a) {
|
|
637
662
|
try {
|
|
638
663
|
return Z(a, ""), !0;
|
|
639
664
|
} catch {
|
|
640
665
|
return !1;
|
|
641
666
|
}
|
|
642
667
|
}
|
|
643
|
-
h(
|
|
644
|
-
const Gn = te(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Vt = te(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Yt = te(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]),
|
|
668
|
+
h(ar, "isRegex");
|
|
669
|
+
const Gn = te(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "search", "section", "select", "shadow", "slot", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), Vt = te(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "enterkeyhint", "exportparts", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "inputmode", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "part", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), Yt = te(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), lr = te(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), Zt = te(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), or = te(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = te(["#text"]), Wn = te(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Xt = te(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = te(["accent", "accentunder", "align", "bevelled", "close", "columnalign", "columnlines", "columnspacing", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lquote", "lspace", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), kt = te(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), cr = oe(/\{\{[\w\W]*|[\w\W]*\}\}/gm), ur = oe(/<%[\w\W]*|[\w\W]*%>/gm), hr = oe(/\$\{[\w\W]*/gm), pr = oe(/^data-[\-\w.\u00B7-\uFFFF]+$/), dr = oe(/^aria-[\-\w]+$/), os = oe(
|
|
645
670
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
646
671
|
// eslint-disable-line no-useless-escape
|
|
647
|
-
),
|
|
672
|
+
), fr = oe(/^(?:\w+script|data):/i), gr = oe(
|
|
648
673
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
649
674
|
// eslint-disable-line no-control-regex
|
|
650
|
-
),
|
|
675
|
+
), cs = oe(/^html$/i), mr = oe(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
651
676
|
var Vn = /* @__PURE__ */ Object.freeze({
|
|
652
677
|
__proto__: null,
|
|
653
|
-
ARIA_ATTR:
|
|
654
|
-
ATTR_WHITESPACE:
|
|
655
|
-
CUSTOM_ELEMENT:
|
|
656
|
-
DATA_ATTR:
|
|
657
|
-
DOCTYPE_NAME:
|
|
658
|
-
ERB_EXPR:
|
|
659
|
-
IS_ALLOWED_URI:
|
|
660
|
-
IS_SCRIPT_OR_DATA:
|
|
661
|
-
MUSTACHE_EXPR:
|
|
662
|
-
TMPLIT_EXPR:
|
|
678
|
+
ARIA_ATTR: dr,
|
|
679
|
+
ATTR_WHITESPACE: gr,
|
|
680
|
+
CUSTOM_ELEMENT: mr,
|
|
681
|
+
DATA_ATTR: pr,
|
|
682
|
+
DOCTYPE_NAME: cs,
|
|
683
|
+
ERB_EXPR: ur,
|
|
684
|
+
IS_ALLOWED_URI: os,
|
|
685
|
+
IS_SCRIPT_OR_DATA: fr,
|
|
686
|
+
MUSTACHE_EXPR: cr,
|
|
687
|
+
TMPLIT_EXPR: hr
|
|
663
688
|
});
|
|
664
|
-
const
|
|
689
|
+
const rt = {
|
|
665
690
|
element: 1,
|
|
666
691
|
text: 3,
|
|
667
692
|
// Deprecated
|
|
668
693
|
progressingInstruction: 7,
|
|
669
694
|
comment: 8,
|
|
670
695
|
document: 9
|
|
671
|
-
},
|
|
696
|
+
}, br = /* @__PURE__ */ h(function() {
|
|
672
697
|
return typeof window > "u" ? null : window;
|
|
673
|
-
}, "getGlobal"),
|
|
698
|
+
}, "getGlobal"), xr = /* @__PURE__ */ h(function(t, e) {
|
|
674
699
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
675
700
|
return null;
|
|
676
701
|
let n = null;
|
|
@@ -702,10 +727,10 @@ const st = {
|
|
|
702
727
|
uponSanitizeShadowNode: []
|
|
703
728
|
};
|
|
704
729
|
}, "_createHooksMap");
|
|
705
|
-
function
|
|
706
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
707
|
-
const t = /* @__PURE__ */ h((v) =>
|
|
708
|
-
if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
730
|
+
function us() {
|
|
731
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : br();
|
|
732
|
+
const t = /* @__PURE__ */ h((v) => us(v), "DOMPurify");
|
|
733
|
+
if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== rt.document || !a.Element)
|
|
709
734
|
return t.isSupported = !1, t;
|
|
710
735
|
let {
|
|
711
736
|
document: e
|
|
@@ -720,36 +745,36 @@ function cs() {
|
|
|
720
745
|
HTMLFormElement: p,
|
|
721
746
|
DOMParser: d,
|
|
722
747
|
trustedTypes: g
|
|
723
|
-
} = a, y = m.prototype, E = Ge(y, "cloneNode"), O = Ge(y, "remove"),
|
|
748
|
+
} = a, y = m.prototype, E = Ge(y, "cloneNode"), O = Ge(y, "remove"), ce = Ge(y, "nextSibling"), ue = Ge(y, "childNodes"), ne = Ge(y, "parentNode");
|
|
724
749
|
if (typeof o == "function") {
|
|
725
750
|
const v = e.createElement("template");
|
|
726
751
|
v.content && v.content.ownerDocument && (e = v.content.ownerDocument);
|
|
727
752
|
}
|
|
728
753
|
let N, Y = "";
|
|
729
754
|
const {
|
|
730
|
-
implementation:
|
|
755
|
+
implementation: ae,
|
|
731
756
|
createNodeIterator: Q,
|
|
732
757
|
createDocumentFragment: _t,
|
|
733
758
|
getElementsByTagName: ut
|
|
734
759
|
} = e, {
|
|
735
|
-
importNode:
|
|
760
|
+
importNode: C
|
|
736
761
|
} = n;
|
|
737
762
|
let q = Yn();
|
|
738
|
-
t.isSupported = typeof
|
|
763
|
+
t.isSupported = typeof ls == "function" && typeof ne == "function" && ae && ae.createHTMLDocument !== void 0;
|
|
739
764
|
const {
|
|
740
765
|
MUSTACHE_EXPR: we,
|
|
741
766
|
ERB_EXPR: Oe,
|
|
742
767
|
TMPLIT_EXPR: ye,
|
|
743
768
|
DATA_ATTR: Rt,
|
|
744
|
-
ARIA_ATTR:
|
|
769
|
+
ARIA_ATTR: Ct,
|
|
745
770
|
IS_SCRIPT_OR_DATA: ht,
|
|
746
771
|
ATTR_WHITESPACE: pt,
|
|
747
|
-
CUSTOM_ELEMENT:
|
|
772
|
+
CUSTOM_ELEMENT: It
|
|
748
773
|
} = Vn;
|
|
749
774
|
let {
|
|
750
775
|
IS_ALLOWED_URI: dt
|
|
751
|
-
} = Vn,
|
|
752
|
-
const
|
|
776
|
+
} = Vn, B = null;
|
|
777
|
+
const Xe = R({}, [...Gn, ...Vt, ...Yt, ...Zt, ...jn]);
|
|
753
778
|
let F = null;
|
|
754
779
|
const _ = R({}, [...Wn, ...Xt, ...qn, ...kt]);
|
|
755
780
|
let f = Object.seal(He(null, {
|
|
@@ -786,49 +811,49 @@ function cs() {
|
|
|
786
811
|
value: null
|
|
787
812
|
}
|
|
788
813
|
}));
|
|
789
|
-
let xe = !0, ze = !0, Pe = !1, dn = !0, _e = !1,
|
|
814
|
+
let xe = !0, ze = !0, Pe = !1, dn = !0, _e = !1, Ke = !0, Re = !1, Dt = !1, Mt = !1, Ne = !1, ft = !1, gt = !1, fn = !0, gn = !1;
|
|
790
815
|
const mn = "user-content-";
|
|
791
|
-
let Lt = !0,
|
|
816
|
+
let Lt = !0, Qe = !1, $e = {}, ge = null;
|
|
792
817
|
const Ot = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
793
818
|
let bn = null;
|
|
794
819
|
const xn = R({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
795
820
|
let zt = null;
|
|
796
821
|
const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), mt = "http://www.w3.org/1998/Math/MathML", bt = "http://www.w3.org/2000/svg", me = "http://www.w3.org/1999/xhtml";
|
|
797
|
-
let
|
|
798
|
-
const
|
|
799
|
-
let $t = R({}, ["mi", "mo", "mn", "ms", "mtext"]),
|
|
800
|
-
const
|
|
801
|
-
let
|
|
802
|
-
const
|
|
803
|
-
let j = null,
|
|
804
|
-
const
|
|
822
|
+
let Ue = me, Pt = !1, Nt = null;
|
|
823
|
+
const ys = R({}, [mt, bt, me], qt);
|
|
824
|
+
let $t = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
|
|
825
|
+
const vs = R({}, ["title", "style", "font", "a", "script"]);
|
|
826
|
+
let Je = null;
|
|
827
|
+
const Ts = ["application/xhtml+xml", "text/html"], Ss = "text/html";
|
|
828
|
+
let j = null, Be = null;
|
|
829
|
+
const As = e.createElement("form"), wn = /* @__PURE__ */ h(function(i) {
|
|
805
830
|
return i instanceof RegExp || i instanceof Function;
|
|
806
|
-
}, "isRegexOrFunction"),
|
|
831
|
+
}, "isRegexOrFunction"), Bt = /* @__PURE__ */ h(function() {
|
|
807
832
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
808
|
-
if (
|
|
833
|
+
if (Be && Be === i)
|
|
809
834
|
return;
|
|
810
|
-
(!i || typeof i != "object") && (i = {}), i = re(i),
|
|
811
|
-
|
|
835
|
+
(!i || typeof i != "object") && (i = {}), i = re(i), Je = // eslint-disable-next-line unicorn/prefer-includes
|
|
836
|
+
Ts.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? Ss : i.PARSER_MEDIA_TYPE, j = Je === "application/xhtml+xml" ? qt : lt, B = $(i, "ALLOWED_TAGS") && J(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, j) : Xe, F = $(i, "ALLOWED_ATTR") && J(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, j) : _, Nt = $(i, "ALLOWED_NAMESPACES") && J(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, qt) : ys, zt = $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, j) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && J(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, j) : xn, ge = $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, j) : Ot, x = $(i, "FORBID_TAGS") && J(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, j) : re({}), M = $(i, "FORBID_ATTR") && J(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, j) : re({}), $e = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, xe = i.ALLOW_ARIA_ATTR !== !1, ze = i.ALLOW_DATA_ATTR !== !1, Pe = i.ALLOW_UNKNOWN_PROTOCOLS || !1, dn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, _e = i.SAFE_FOR_TEMPLATES || !1, Ke = i.SAFE_FOR_XML !== !1, Re = i.WHOLE_DOCUMENT || !1, Ne = i.RETURN_DOM || !1, ft = i.RETURN_DOM_FRAGMENT || !1, gt = i.RETURN_TRUSTED_TYPE || !1, Mt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Lt = i.KEEP_CONTENT !== !1, Qe = i.IN_PLACE || !1, dt = ar(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : os, Ue = typeof i.NAMESPACE == "string" ? i.NAMESPACE : me, $t = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
812
837
|
const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : He(null);
|
|
813
|
-
if (f = He(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (f.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (f.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), _e && (ze = !1), ft && (Ne = !0), $e && (
|
|
838
|
+
if (f = He(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (f.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (f.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (f.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), _e && (ze = !1), ft && (Ne = !0), $e && (B = R({}, jn), F = He(null), $e.html === !0 && (R(B, Gn), R(F, Wn)), $e.svg === !0 && (R(B, Vt), R(F, Xt), R(F, kt)), $e.svgFilters === !0 && (R(B, Yt), R(F, Xt), R(F, kt)), $e.mathMl === !0 && (R(B, Zt), R(F, qn), R(F, kt))), P.tagCheck = null, P.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? P.tagCheck = i.ADD_TAGS : J(i.ADD_TAGS) && (B === Xe && (B = re(B)), R(B, i.ADD_TAGS, j))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? P.attributeCheck = i.ADD_ATTR : J(i.ADD_ATTR) && (F === _ && (F = re(F)), R(F, i.ADD_ATTR, j))), $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) && R(zt, i.ADD_URI_SAFE_ATTR, j), $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) && (ge === Ot && (ge = re(ge)), R(ge, i.FORBID_CONTENTS, j)), $(i, "ADD_FORBID_CONTENTS") && J(i.ADD_FORBID_CONTENTS) && (ge === Ot && (ge = re(ge)), R(ge, i.ADD_FORBID_CONTENTS, j)), Lt && (B["#text"] = !0), Re && R(B, ["html", "head", "body"]), B.table && (R(B, ["tbody"]), delete x.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
814
839
|
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
815
840
|
throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
816
841
|
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
817
842
|
throw xt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
818
843
|
N = i.TRUSTED_TYPES_POLICY, Y = N.createHTML("");
|
|
819
844
|
} else
|
|
820
|
-
N === void 0 && (N =
|
|
821
|
-
te && te(i),
|
|
822
|
-
}, "_parseConfig"), yn = R({}, [...Vt, ...Yt, ...
|
|
845
|
+
N === void 0 && (N = xr(g, r)), N !== null && typeof Y == "string" && (Y = N.createHTML(""));
|
|
846
|
+
te && te(i), Be = i;
|
|
847
|
+
}, "_parseConfig"), yn = R({}, [...Vt, ...Yt, ...lr]), vn = R({}, [...Zt, ...or]), Es = /* @__PURE__ */ h(function(i) {
|
|
823
848
|
let u = ne(i);
|
|
824
849
|
(!u || !u.tagName) && (u = {
|
|
825
|
-
namespaceURI:
|
|
850
|
+
namespaceURI: Ue,
|
|
826
851
|
tagName: "template"
|
|
827
852
|
});
|
|
828
|
-
const k =
|
|
829
|
-
return Nt[i.namespaceURI] ? i.namespaceURI === bt ? u.namespaceURI === me ? k === "svg" : u.namespaceURI === mt ? k === "svg" && (z === "annotation-xml" || $t[z]) : !!yn[k] : i.namespaceURI === mt ? u.namespaceURI === me ? k === "math" : u.namespaceURI === bt ? k === "math" &&
|
|
853
|
+
const k = lt(i.tagName), z = lt(u.tagName);
|
|
854
|
+
return Nt[i.namespaceURI] ? i.namespaceURI === bt ? u.namespaceURI === me ? k === "svg" : u.namespaceURI === mt ? k === "svg" && (z === "annotation-xml" || $t[z]) : !!yn[k] : i.namespaceURI === mt ? u.namespaceURI === me ? k === "math" : u.namespaceURI === bt ? k === "math" && Ut[z] : !!vn[k] : i.namespaceURI === me ? u.namespaceURI === bt && !Ut[z] || u.namespaceURI === mt && !$t[z] ? !1 : !vn[k] && (vs[k] || !yn[k]) : !!(Je === "application/xhtml+xml" && Nt[i.namespaceURI]) : !1;
|
|
830
855
|
}, "_checkValidNamespace"), he = /* @__PURE__ */ h(function(i) {
|
|
831
|
-
|
|
856
|
+
nt(t.removed, {
|
|
832
857
|
element: i
|
|
833
858
|
});
|
|
834
859
|
try {
|
|
@@ -836,14 +861,14 @@ function cs() {
|
|
|
836
861
|
} catch {
|
|
837
862
|
O(i);
|
|
838
863
|
}
|
|
839
|
-
}, "_forceRemove"),
|
|
864
|
+
}, "_forceRemove"), Ce = /* @__PURE__ */ h(function(i, u) {
|
|
840
865
|
try {
|
|
841
|
-
|
|
866
|
+
nt(t.removed, {
|
|
842
867
|
attribute: u.getAttributeNode(i),
|
|
843
868
|
from: u
|
|
844
869
|
});
|
|
845
870
|
} catch {
|
|
846
|
-
|
|
871
|
+
nt(t.removed, {
|
|
847
872
|
attribute: null,
|
|
848
873
|
from: u
|
|
849
874
|
});
|
|
@@ -864,25 +889,25 @@ function cs() {
|
|
|
864
889
|
if (Mt)
|
|
865
890
|
i = "<remove></remove>" + i;
|
|
866
891
|
else {
|
|
867
|
-
const H =
|
|
892
|
+
const H = Un(i, /^[\r\n\t ]+/);
|
|
868
893
|
k = H && H[0];
|
|
869
894
|
}
|
|
870
|
-
|
|
895
|
+
Je === "application/xhtml+xml" && Ue === me && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
|
|
871
896
|
const z = N ? N.createHTML(i) : i;
|
|
872
|
-
if (
|
|
897
|
+
if (Ue === me)
|
|
873
898
|
try {
|
|
874
|
-
u = new d().parseFromString(z,
|
|
899
|
+
u = new d().parseFromString(z, Je);
|
|
875
900
|
} catch {
|
|
876
901
|
}
|
|
877
902
|
if (!u || !u.documentElement) {
|
|
878
|
-
u =
|
|
903
|
+
u = ae.createDocument(Ue, "template", null);
|
|
879
904
|
try {
|
|
880
905
|
u.documentElement.innerHTML = Pt ? Y : z;
|
|
881
906
|
} catch {
|
|
882
907
|
}
|
|
883
908
|
}
|
|
884
909
|
const X = u.body || u.documentElement;
|
|
885
|
-
return i && k && X.insertBefore(e.createTextNode(k), X.childNodes[0] || null),
|
|
910
|
+
return i && k && X.insertBefore(e.createTextNode(k), X.childNodes[0] || null), Ue === me ? ut.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : X;
|
|
886
911
|
}, "_initDocument"), Sn = /* @__PURE__ */ h(function(i) {
|
|
887
912
|
return Q.call(
|
|
888
913
|
i.ownerDocument || i,
|
|
@@ -897,8 +922,8 @@ function cs() {
|
|
|
897
922
|
return typeof l == "function" && i instanceof l;
|
|
898
923
|
}, "_isNode");
|
|
899
924
|
function ke(v, i, u) {
|
|
900
|
-
|
|
901
|
-
k.call(t, i, u,
|
|
925
|
+
tt(v, (k) => {
|
|
926
|
+
k.call(t, i, u, Be);
|
|
902
927
|
});
|
|
903
928
|
}
|
|
904
929
|
h(ke, "_executeHooks");
|
|
@@ -909,34 +934,34 @@ function cs() {
|
|
|
909
934
|
const k = j(i.nodeName);
|
|
910
935
|
if (ke(q.uponSanitizeElement, i, {
|
|
911
936
|
tagName: k,
|
|
912
|
-
allowedTags:
|
|
913
|
-
}),
|
|
937
|
+
allowedTags: B
|
|
938
|
+
}), Ke && i.hasChildNodes() && !Ht(i.firstElementChild) && Z(/<[/\w!]/g, i.innerHTML) && Z(/<[/\w!]/g, i.textContent) || Ke && i.namespaceURI === me && k === "style" && Ht(i.firstElementChild) || i.nodeType === rt.progressingInstruction || Ke && i.nodeType === rt.comment && Z(/<[/\w]/g, i.data))
|
|
914
939
|
return he(i), !0;
|
|
915
|
-
if (x[k] || !(P.tagCheck instanceof Function && P.tagCheck(k)) && !
|
|
940
|
+
if (x[k] || !(P.tagCheck instanceof Function && P.tagCheck(k)) && !B[k]) {
|
|
916
941
|
if (!x[k] && _n(k) && (f.tagNameCheck instanceof RegExp && Z(f.tagNameCheck, k) || f.tagNameCheck instanceof Function && f.tagNameCheck(k)))
|
|
917
942
|
return !1;
|
|
918
943
|
if (Lt && !ge[k]) {
|
|
919
|
-
const z = ne(i) || i.parentNode, X =
|
|
944
|
+
const z = ne(i) || i.parentNode, X = ue(i) || i.childNodes;
|
|
920
945
|
if (X && z) {
|
|
921
946
|
const H = X.length;
|
|
922
947
|
for (let se = H - 1; se >= 0; --se) {
|
|
923
948
|
const le = E(X[se], !0);
|
|
924
|
-
z.insertBefore(le,
|
|
949
|
+
z.insertBefore(le, ce(i));
|
|
925
950
|
}
|
|
926
951
|
}
|
|
927
952
|
}
|
|
928
953
|
return he(i), !0;
|
|
929
954
|
}
|
|
930
|
-
return i instanceof m && !
|
|
955
|
+
return i instanceof m && !Es(i) || (k === "noscript" || k === "noembed" || k === "noframes") && Z(/<\/no(script|embed|frames)/i, i.innerHTML) ? (he(i), !0) : (_e && i.nodeType === rt.text && (u = i.textContent, tt([we, Oe, ye], (z) => {
|
|
931
956
|
u = Fe(u, z, " ");
|
|
932
|
-
}), i.textContent !== u && (
|
|
957
|
+
}), i.textContent !== u && (nt(t.removed, {
|
|
933
958
|
element: i.cloneNode()
|
|
934
959
|
}), i.textContent = u)), ke(q.afterSanitizeElements, i, null), !1);
|
|
935
960
|
}, "_sanitizeElements"), En = /* @__PURE__ */ h(function(i, u, k) {
|
|
936
|
-
if (M[u] || fn && (u === "id" || u === "name") && (k in e || k in
|
|
961
|
+
if (M[u] || fn && (u === "id" || u === "name") && (k in e || k in As))
|
|
937
962
|
return !1;
|
|
938
963
|
if (!(ze && !M[u] && Z(Rt, u))) {
|
|
939
|
-
if (!(xe && Z(
|
|
964
|
+
if (!(xe && Z(Ct, u))) {
|
|
940
965
|
if (!(P.attributeCheck instanceof Function && P.attributeCheck(u, i))) {
|
|
941
966
|
if (!F[u] || M[u]) {
|
|
942
967
|
if (
|
|
@@ -949,7 +974,7 @@ function cs() {
|
|
|
949
974
|
) return !1;
|
|
950
975
|
} else if (!zt[u]) {
|
|
951
976
|
if (!Z(dt, Fe(k, pt, ""))) {
|
|
952
|
-
if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" &&
|
|
977
|
+
if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Bn(k, "data:") === 0 && bn[i])) {
|
|
953
978
|
if (!(Pe && !Z(ht, Fe(k, pt, "")))) {
|
|
954
979
|
if (k)
|
|
955
980
|
return !1;
|
|
@@ -961,8 +986,8 @@ function cs() {
|
|
|
961
986
|
}
|
|
962
987
|
}
|
|
963
988
|
return !0;
|
|
964
|
-
}, "_isValidAttribute"),
|
|
965
|
-
return !
|
|
989
|
+
}, "_isValidAttribute"), _s = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ h(function(i) {
|
|
990
|
+
return !_s[lt(i)] && Z(It, i);
|
|
966
991
|
}, "_isBasicCustomElement"), Rn = /* @__PURE__ */ h(function(i) {
|
|
967
992
|
ke(q.beforeSanitizeAttributes, i, null);
|
|
968
993
|
const {
|
|
@@ -984,35 +1009,35 @@ function cs() {
|
|
|
984
1009
|
namespaceURI: se,
|
|
985
1010
|
value: le
|
|
986
1011
|
} = X, pe = j(H), Gt = le;
|
|
987
|
-
let V = H === "value" ? Gt :
|
|
988
|
-
if (k.attrName = pe, k.attrValue = V, k.keepAttr = !0, k.forceKeepAttr = void 0, ke(q.uponSanitizeAttribute, i, k), V = k.attrValue, gn && (pe === "id" || pe === "name") &&
|
|
989
|
-
|
|
1012
|
+
let V = H === "value" ? Gt : er(Gt);
|
|
1013
|
+
if (k.attrName = pe, k.attrValue = V, k.keepAttr = !0, k.forceKeepAttr = void 0, ke(q.uponSanitizeAttribute, i, k), V = k.attrValue, gn && (pe === "id" || pe === "name") && Bn(V, mn) !== 0 && (Ce(H, i), V = mn + V), Ke && Z(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
|
|
1014
|
+
Ce(H, i);
|
|
990
1015
|
continue;
|
|
991
1016
|
}
|
|
992
|
-
if (pe === "attributename" &&
|
|
993
|
-
|
|
1017
|
+
if (pe === "attributename" && Un(V, "href")) {
|
|
1018
|
+
Ce(H, i);
|
|
994
1019
|
continue;
|
|
995
1020
|
}
|
|
996
1021
|
if (k.forceKeepAttr)
|
|
997
1022
|
continue;
|
|
998
1023
|
if (!k.keepAttr) {
|
|
999
|
-
|
|
1024
|
+
Ce(H, i);
|
|
1000
1025
|
continue;
|
|
1001
1026
|
}
|
|
1002
1027
|
if (!dn && Z(/\/>/i, V)) {
|
|
1003
|
-
|
|
1028
|
+
Ce(H, i);
|
|
1004
1029
|
continue;
|
|
1005
1030
|
}
|
|
1006
|
-
_e &&
|
|
1031
|
+
_e && tt([we, Oe, ye], (Dn) => {
|
|
1007
1032
|
V = Fe(V, Dn, " ");
|
|
1008
1033
|
});
|
|
1009
|
-
const
|
|
1010
|
-
if (!En(
|
|
1011
|
-
|
|
1034
|
+
const In = j(i.nodeName);
|
|
1035
|
+
if (!En(In, pe, V)) {
|
|
1036
|
+
Ce(H, i);
|
|
1012
1037
|
continue;
|
|
1013
1038
|
}
|
|
1014
1039
|
if (N && typeof g == "object" && typeof g.getAttributeType == "function" && !se)
|
|
1015
|
-
switch (g.getAttributeType(
|
|
1040
|
+
switch (g.getAttributeType(In, pe)) {
|
|
1016
1041
|
case "TrustedHTML": {
|
|
1017
1042
|
V = N.createHTML(V);
|
|
1018
1043
|
break;
|
|
@@ -1026,32 +1051,32 @@ function cs() {
|
|
|
1026
1051
|
try {
|
|
1027
1052
|
se ? i.setAttributeNS(se, H, V) : i.setAttribute(H, V), Ft(i) ? he(i) : $n(t.removed);
|
|
1028
1053
|
} catch {
|
|
1029
|
-
|
|
1054
|
+
Ce(H, i);
|
|
1030
1055
|
}
|
|
1031
1056
|
}
|
|
1032
1057
|
ke(q.afterSanitizeAttributes, i, null);
|
|
1033
|
-
}, "_sanitizeAttributes"),
|
|
1058
|
+
}, "_sanitizeAttributes"), Cn = /* @__PURE__ */ h(function(i) {
|
|
1034
1059
|
let u = null;
|
|
1035
1060
|
const k = Sn(i);
|
|
1036
1061
|
for (ke(q.beforeSanitizeShadowDOM, i, null); u = k.nextNode(); )
|
|
1037
|
-
ke(q.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof s &&
|
|
1062
|
+
ke(q.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof s && Cn(u.content);
|
|
1038
1063
|
ke(q.afterSanitizeShadowDOM, i, null);
|
|
1039
1064
|
}, "_sanitizeShadowDOM");
|
|
1040
1065
|
return t.sanitize = function(v) {
|
|
1041
1066
|
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, k = null, z = null, X = null;
|
|
1042
|
-
if (Pt = !v, Pt && (v = "<!-->"), typeof v != "string" && !Ht(v) && (v =
|
|
1067
|
+
if (Pt = !v, Pt && (v = "<!-->"), typeof v != "string" && !Ht(v) && (v = ir(v), typeof v != "string"))
|
|
1043
1068
|
throw xt("dirty is not a string, aborting");
|
|
1044
1069
|
if (!t.isSupported)
|
|
1045
1070
|
return v;
|
|
1046
|
-
if (Dt ||
|
|
1071
|
+
if (Dt || Bt(i), t.removed = [], typeof v == "string" && (Qe = !1), Qe) {
|
|
1047
1072
|
const le = v.nodeName;
|
|
1048
1073
|
if (typeof le == "string") {
|
|
1049
1074
|
const pe = j(le);
|
|
1050
|
-
if (!
|
|
1075
|
+
if (!B[pe] || x[pe])
|
|
1051
1076
|
throw xt("root node is forbidden and cannot be sanitized in-place");
|
|
1052
1077
|
}
|
|
1053
1078
|
} else if (v instanceof l)
|
|
1054
|
-
u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType ===
|
|
1079
|
+
u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === rt.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
|
|
1055
1080
|
else {
|
|
1056
1081
|
if (!Ne && !_e && !Re && // eslint-disable-next-line unicorn/prefer-includes
|
|
1057
1082
|
v.indexOf("<") === -1)
|
|
@@ -1060,16 +1085,16 @@ function cs() {
|
|
|
1060
1085
|
return Ne ? null : gt ? Y : "";
|
|
1061
1086
|
}
|
|
1062
1087
|
u && Mt && he(u.firstChild);
|
|
1063
|
-
const H = Sn(
|
|
1088
|
+
const H = Sn(Qe ? v : u);
|
|
1064
1089
|
for (; z = H.nextNode(); )
|
|
1065
|
-
An(z), Rn(z), z.content instanceof s &&
|
|
1066
|
-
if (
|
|
1090
|
+
An(z), Rn(z), z.content instanceof s && Cn(z.content);
|
|
1091
|
+
if (Qe)
|
|
1067
1092
|
return v;
|
|
1068
1093
|
if (Ne) {
|
|
1069
1094
|
if (_e) {
|
|
1070
1095
|
u.normalize();
|
|
1071
1096
|
let le = u.innerHTML;
|
|
1072
|
-
|
|
1097
|
+
tt([we, Oe, ye], (pe) => {
|
|
1073
1098
|
le = Fe(le, pe, " ");
|
|
1074
1099
|
}), u.innerHTML = le;
|
|
1075
1100
|
}
|
|
@@ -1078,28 +1103,28 @@ function cs() {
|
|
|
1078
1103
|
X.appendChild(u.firstChild);
|
|
1079
1104
|
else
|
|
1080
1105
|
X = u;
|
|
1081
|
-
return (F.shadowroot || F.shadowrootmode) && (X =
|
|
1106
|
+
return (F.shadowroot || F.shadowrootmode) && (X = C.call(n, X, !0)), X;
|
|
1082
1107
|
}
|
|
1083
1108
|
let se = Re ? u.outerHTML : u.innerHTML;
|
|
1084
|
-
return Re &&
|
|
1085
|
-
` + se), _e &&
|
|
1109
|
+
return Re && B["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && Z(cs, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1110
|
+
` + se), _e && tt([we, Oe, ye], (le) => {
|
|
1086
1111
|
se = Fe(se, le, " ");
|
|
1087
1112
|
}), N && gt ? N.createHTML(se) : se;
|
|
1088
1113
|
}, t.setConfig = function() {
|
|
1089
1114
|
let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1090
|
-
|
|
1115
|
+
Bt(v), Dt = !0;
|
|
1091
1116
|
}, t.clearConfig = function() {
|
|
1092
|
-
|
|
1117
|
+
Be = null, Dt = !1;
|
|
1093
1118
|
}, t.isValidAttribute = function(v, i, u) {
|
|
1094
|
-
|
|
1119
|
+
Be || Bt({});
|
|
1095
1120
|
const k = j(v), z = j(i);
|
|
1096
1121
|
return En(k, z, u);
|
|
1097
1122
|
}, t.addHook = function(v, i) {
|
|
1098
|
-
typeof i == "function" &&
|
|
1123
|
+
typeof i == "function" && nt(q[v], i);
|
|
1099
1124
|
}, t.removeHook = function(v, i) {
|
|
1100
1125
|
if (i !== void 0) {
|
|
1101
|
-
const u =
|
|
1102
|
-
return u === -1 ? void 0 :
|
|
1126
|
+
const u = Qs(q[v], i);
|
|
1127
|
+
return u === -1 ? void 0 : Js(q[v], u, 1)[0];
|
|
1103
1128
|
}
|
|
1104
1129
|
return $n(q[v]);
|
|
1105
1130
|
}, t.removeHooks = function(v) {
|
|
@@ -1108,18 +1133,18 @@ function cs() {
|
|
|
1108
1133
|
q = Yn();
|
|
1109
1134
|
}, t;
|
|
1110
1135
|
}
|
|
1111
|
-
h(
|
|
1112
|
-
var
|
|
1136
|
+
h(us, "createDOMPurify");
|
|
1137
|
+
var kr = us();
|
|
1113
1138
|
function nn() {
|
|
1114
1139
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1115
1140
|
}
|
|
1116
1141
|
h(nn, "z");
|
|
1117
1142
|
var Le = nn();
|
|
1118
|
-
function
|
|
1143
|
+
function hs(a) {
|
|
1119
1144
|
Le = a;
|
|
1120
1145
|
}
|
|
1121
|
-
h(
|
|
1122
|
-
var
|
|
1146
|
+
h(hs, "G");
|
|
1147
|
+
var Ie = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1123
1148
|
function D(a, t = "") {
|
|
1124
1149
|
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((r, s) => {
|
|
1125
1150
|
let o = typeof s == "string" ? s : s.source;
|
|
@@ -1128,14 +1153,14 @@ function D(a, t = "") {
|
|
|
1128
1153
|
return n;
|
|
1129
1154
|
}
|
|
1130
1155
|
h(D, "k");
|
|
1131
|
-
var
|
|
1156
|
+
var wr = ((a = "") => {
|
|
1132
1157
|
try {
|
|
1133
1158
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
1134
1159
|
} catch {
|
|
1135
1160
|
return !1;
|
|
1136
1161
|
}
|
|
1137
|
-
})(), K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") },
|
|
1138
|
-
]`).replace("lheading",
|
|
1162
|
+
})(), K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, yr = /^(?:[ \t]*(?:\n|$))+/, vr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Tr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ct = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Sr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, sn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ps = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ds = D(ps).replace(/bull/g, sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ar = D(ps).replace(/bull/g, sn).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), rn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Er = /^[^\n]+/, an = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, _r = D(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", an).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Rr = D(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, sn).getRegex(), At = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", ln = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Cr = D("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", ln).replace("tag", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), fs = D(rn).replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), Ir = D(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", fs).getRegex(), on = { blockquote: Ir, code: vr, def: _r, fences: Tr, heading: Sr, hr: ct, html: Cr, lheading: ds, list: Rr, newline: yr, paragraph: fs, table: Ie, text: Er }, Zn = D("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), Dr = { ...on, lheading: Ar, table: Zn, paragraph: D(rn).replace("hr", ct).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex() }, Mr = { ...on, html: D(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", ln).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: Ie, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: D(rn).replace("hr", ct).replace("heading", ` *#{1,6} *[^
|
|
1163
|
+
]`).replace("lheading", ds).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Lr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Or = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, gs = /^( {2,}|\\)\n(?!\s*$)/, zr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Ze = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, cn = /[^\s\p{P}\p{S}]/u, Pr = D(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), ms = /(?!~)[\p{P}\p{S}]/u, Nr = /(?!~)[\s\p{P}\p{S}]/u, $r = /(?:[^\s\p{P}\p{S}]|~)/u, Ur = D(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", wr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), bs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Br = D(bs, "u").replace(/punct/g, Ze).getRegex(), Fr = D(bs, "u").replace(/punct/g, ms).getRegex(), xs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Hr = D(xs, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ze).getRegex(), Gr = D(xs, "gu").replace(/notPunctSpace/g, $r).replace(/punctSpace/g, Nr).replace(/punct/g, ms).getRegex(), jr = D("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ze).getRegex(), Wr = D(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Ze).getRegex(), qr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Vr = D(qr, "gu").replace(/notPunctSpace/g, cn).replace(/punctSpace/g, Et).replace(/punct/g, Ze).getRegex(), Yr = D(/\\(punct)/, "gu").replace(/punct/g, Ze).getRegex(), Zr = D(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), Xr = D(ln).replace("(?:-->|$)", "-->").getRegex(), Kr = D("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", Xr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Qr = D(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ks = D(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", an).getRegex(), ws = D(/^!?\[(ref)\](?:\[\])?/).replace("ref", an).getRegex(), Jr = D("reflink|nolink(?!\\()", "g").replace("reflink", ks).replace("nolink", ws).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, un = { _backpedal: Ie, anyPunctuation: Yr, autolink: Zr, blockSkip: Ur, br: gs, code: Or, del: Ie, delLDelim: Ie, delRDelim: Ie, emStrongLDelim: Br, emStrongRDelimAst: Hr, emStrongRDelimUnd: jr, escape: Lr, link: Qr, nolink: ws, punctuation: Pr, reflink: ks, reflinkSearch: Jr, tag: Kr, text: zr, url: Ie }, ei = { ...un, link: D(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: D(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, en = { ...un, emStrongRDelimAst: Gr, emStrongLDelim: Fr, delLDelim: Wr, delRDelim: Vr, url: D(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: D(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, ti = { ...en, br: D(gs).replace("{2,}", "*").getRegex(), text: D(en.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, wt = { normal: on, gfm: Dr, pedantic: Mr }, it = { normal: un, gfm: en, breaks: ti, pedantic: ei }, ni = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Kn = /* @__PURE__ */ h((a) => ni[a], "de");
|
|
1139
1164
|
function be(a, t) {
|
|
1140
1165
|
if (t) {
|
|
1141
1166
|
if (K.escapeTest.test(a)) return a.replace(K.escapeReplace, Kn);
|
|
@@ -1181,7 +1206,7 @@ function es(a) {
|
|
|
1181
1206
|
`);
|
|
1182
1207
|
}
|
|
1183
1208
|
h(es, "Y");
|
|
1184
|
-
function
|
|
1209
|
+
function si(a, t) {
|
|
1185
1210
|
if (a.indexOf(t[1]) === -1) return -1;
|
|
1186
1211
|
let e = 0;
|
|
1187
1212
|
for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
|
|
@@ -1189,8 +1214,8 @@ function ti(a, t) {
|
|
|
1189
1214
|
else if (a[n] === t[1] && (e--, e < 0)) return n;
|
|
1190
1215
|
return e > 0 ? -2 : -1;
|
|
1191
1216
|
}
|
|
1192
|
-
h(
|
|
1193
|
-
function
|
|
1217
|
+
h(si, "ge");
|
|
1218
|
+
function ri(a, t = 0) {
|
|
1194
1219
|
let e = t, n = "";
|
|
1195
1220
|
for (let r of a) if (r === " ") {
|
|
1196
1221
|
let s = 4 - e % 4;
|
|
@@ -1198,7 +1223,7 @@ function ni(a, t = 0) {
|
|
|
1198
1223
|
} else n += r, e++;
|
|
1199
1224
|
return n;
|
|
1200
1225
|
}
|
|
1201
|
-
h(
|
|
1226
|
+
h(ri, "fe");
|
|
1202
1227
|
function ts(a, t, e, n, r) {
|
|
1203
1228
|
let s = t.href, o = t.title || null, l = a[1].replace(r.other.outputLinkReplace, "$1");
|
|
1204
1229
|
n.state.inLink = !0;
|
|
@@ -1206,7 +1231,7 @@ function ts(a, t, e, n, r) {
|
|
|
1206
1231
|
return n.state.inLink = !1, m;
|
|
1207
1232
|
}
|
|
1208
1233
|
h(ts, "me");
|
|
1209
|
-
function
|
|
1234
|
+
function ii(a, t, e) {
|
|
1210
1235
|
let n = a.match(e.other.indentCodeCompensation);
|
|
1211
1236
|
if (n === null) return t;
|
|
1212
1237
|
let r = n[1];
|
|
@@ -1219,12 +1244,12 @@ function si(a, t, e) {
|
|
|
1219
1244
|
}).join(`
|
|
1220
1245
|
`);
|
|
1221
1246
|
}
|
|
1222
|
-
h(
|
|
1247
|
+
h(ii, "rt");
|
|
1223
1248
|
var je, Tt = (je = class {
|
|
1224
1249
|
constructor(t) {
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1250
|
+
I(this, "options");
|
|
1251
|
+
I(this, "rules");
|
|
1252
|
+
I(this, "lexer");
|
|
1228
1253
|
this.options = t || Le;
|
|
1229
1254
|
}
|
|
1230
1255
|
space(t) {
|
|
@@ -1241,7 +1266,7 @@ var je, Tt = (je = class {
|
|
|
1241
1266
|
fences(t) {
|
|
1242
1267
|
let e = this.rules.block.fences.exec(t);
|
|
1243
1268
|
if (e) {
|
|
1244
|
-
let n = e[0], r =
|
|
1269
|
+
let n = e[0], r = ii(n, e[3] || "", this.rules);
|
|
1245
1270
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
|
|
1246
1271
|
}
|
|
1247
1272
|
}
|
|
@@ -1312,25 +1337,25 @@ ${p}` : p;
|
|
|
1312
1337
|
let c = !1, b = "", p = "";
|
|
1313
1338
|
if (!(e = o.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1314
1339
|
b = e[0], t = t.substring(b.length);
|
|
1315
|
-
let d =
|
|
1340
|
+
let d = ri(e[2].split(`
|
|
1316
1341
|
`, 1)[0], e[1].length), g = t.split(`
|
|
1317
1342
|
`, 1)[0], y = !d.trim(), E = 0;
|
|
1318
1343
|
if (this.options.pedantic ? (E = 2, p = d.trimStart()) : y ? E = e[1].length + 1 : (E = d.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, p = d.slice(E), E += e[1].length), y && this.rules.other.blankLine.test(g) && (b += g + `
|
|
1319
1344
|
`, t = t.substring(g.length + 1), c = !0), !c) {
|
|
1320
|
-
let O = this.rules.other.nextBulletRegex(E),
|
|
1345
|
+
let O = this.rules.other.nextBulletRegex(E), ce = this.rules.other.hrRegex(E), ue = this.rules.other.fencesBeginRegex(E), ne = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), Y = this.rules.other.blockquoteBeginRegex(E);
|
|
1321
1346
|
for (; t; ) {
|
|
1322
|
-
let
|
|
1347
|
+
let ae = t.split(`
|
|
1323
1348
|
`, 1)[0], Q;
|
|
1324
|
-
if (g =
|
|
1349
|
+
if (g = ae, this.options.pedantic ? (g = g.replace(this.rules.other.listReplaceNesting, " "), Q = g) : Q = g.replace(this.rules.other.tabCharGlobal, " "), ue.test(g) || ne.test(g) || N.test(g) || Y.test(g) || O.test(g) || ce.test(g)) break;
|
|
1325
1350
|
if (Q.search(this.rules.other.nonSpaceChar) >= E || !g.trim()) p += `
|
|
1326
1351
|
` + Q.slice(E);
|
|
1327
1352
|
else {
|
|
1328
|
-
if (y || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 ||
|
|
1353
|
+
if (y || d.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ue.test(d) || ne.test(d) || ce.test(d)) break;
|
|
1329
1354
|
p += `
|
|
1330
1355
|
` + g;
|
|
1331
1356
|
}
|
|
1332
|
-
y = !g.trim(), b +=
|
|
1333
|
-
`, t = t.substring(
|
|
1357
|
+
y = !g.trim(), b += ae + `
|
|
1358
|
+
`, t = t.substring(ae.length + 1), d = Q.slice(E);
|
|
1334
1359
|
}
|
|
1335
1360
|
}
|
|
1336
1361
|
s.loose || (l ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (l = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(p), loose: !1, text: p, tokens: [] }), s.raw += b;
|
|
@@ -1431,7 +1456,7 @@ ${p}` : p;
|
|
|
1431
1456
|
let o = ve(n.slice(0, -1), "\\");
|
|
1432
1457
|
if ((n.length - o.length) % 2 === 0) return;
|
|
1433
1458
|
} else {
|
|
1434
|
-
let o =
|
|
1459
|
+
let o = si(e[2], "()");
|
|
1435
1460
|
if (o === -2) return;
|
|
1436
1461
|
if (o > -1) {
|
|
1437
1462
|
let l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + o;
|
|
@@ -1541,17 +1566,17 @@ ${p}` : p;
|
|
|
1541
1566
|
}
|
|
1542
1567
|
}, h(je, "w"), je), Ae, de = (Ae = class {
|
|
1543
1568
|
constructor(t) {
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1569
|
+
I(this, "tokens");
|
|
1570
|
+
I(this, "options");
|
|
1571
|
+
I(this, "state");
|
|
1572
|
+
I(this, "inlineQueue");
|
|
1573
|
+
I(this, "tokenizer");
|
|
1549
1574
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Tt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1550
|
-
let e = { other: K, block: wt.normal, inline:
|
|
1551
|
-
this.options.pedantic ? (e.block = wt.pedantic, e.inline =
|
|
1575
|
+
let e = { other: K, block: wt.normal, inline: it.normal };
|
|
1576
|
+
this.options.pedantic ? (e.block = wt.pedantic, e.inline = it.pedantic) : this.options.gfm && (e.block = wt.gfm, this.options.breaks ? e.inline = it.breaks : e.inline = it.gfm), this.tokenizer.rules = e;
|
|
1552
1577
|
}
|
|
1553
1578
|
static get rules() {
|
|
1554
|
-
return { block: wt, inline:
|
|
1579
|
+
return { block: wt, inline: it };
|
|
1555
1580
|
}
|
|
1556
1581
|
static lex(t, e) {
|
|
1557
1582
|
return new Ae(e).lex(t);
|
|
@@ -1760,8 +1785,8 @@ ${p}` : p;
|
|
|
1760
1785
|
}
|
|
1761
1786
|
}, h(Ae, "l"), Ae), We, St = (We = class {
|
|
1762
1787
|
constructor(t) {
|
|
1763
|
-
|
|
1764
|
-
|
|
1788
|
+
I(this, "options");
|
|
1789
|
+
I(this, "parser");
|
|
1765
1790
|
this.options = t || Le;
|
|
1766
1791
|
}
|
|
1767
1792
|
space(t) {
|
|
@@ -1908,9 +1933,9 @@ ${t}</tr>
|
|
|
1908
1933
|
}
|
|
1909
1934
|
}, h(qe, "L"), qe), Ee, fe = (Ee = class {
|
|
1910
1935
|
constructor(t) {
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1936
|
+
I(this, "options");
|
|
1937
|
+
I(this, "renderer");
|
|
1938
|
+
I(this, "textRenderer");
|
|
1914
1939
|
this.options = t || Le, this.options.renderer = this.options.renderer || new St(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new hn();
|
|
1915
1940
|
}
|
|
1916
1941
|
static parse(t, e) {
|
|
@@ -2057,10 +2082,10 @@ ${t}</tr>
|
|
|
2057
2082
|
}
|
|
2058
2083
|
return n;
|
|
2059
2084
|
}
|
|
2060
|
-
}, h(Ee, "l"), Ee), Se,
|
|
2085
|
+
}, h(Ee, "l"), Ee), Se, ot = (Se = class {
|
|
2061
2086
|
constructor(t) {
|
|
2062
|
-
|
|
2063
|
-
|
|
2087
|
+
I(this, "options");
|
|
2088
|
+
I(this, "block");
|
|
2064
2089
|
this.options = t || Le;
|
|
2065
2090
|
}
|
|
2066
2091
|
preprocess(t) {
|
|
@@ -2081,18 +2106,18 @@ ${t}</tr>
|
|
|
2081
2106
|
provideParser(t = this.block) {
|
|
2082
2107
|
return t ? fe.parse : fe.parseInline;
|
|
2083
2108
|
}
|
|
2084
|
-
}, h(Se, "P"),
|
|
2109
|
+
}, h(Se, "P"), I(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), I(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), Ve, ai = (Ve = class {
|
|
2085
2110
|
constructor(...t) {
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2111
|
+
I(this, "defaults", nn());
|
|
2112
|
+
I(this, "options", this.setOptions);
|
|
2113
|
+
I(this, "parse", this.parseMarkdown(!0));
|
|
2114
|
+
I(this, "parseInline", this.parseMarkdown(!1));
|
|
2115
|
+
I(this, "Parser", fe);
|
|
2116
|
+
I(this, "Renderer", St);
|
|
2117
|
+
I(this, "TextRenderer", hn);
|
|
2118
|
+
I(this, "Lexer", de);
|
|
2119
|
+
I(this, "Tokenizer", Tt);
|
|
2120
|
+
I(this, "Hooks", ot);
|
|
2096
2121
|
this.use(...t);
|
|
2097
2122
|
}
|
|
2098
2123
|
walkTokens(t, e) {
|
|
@@ -2165,13 +2190,13 @@ ${t}</tr>
|
|
|
2165
2190
|
r.tokenizer = s;
|
|
2166
2191
|
}
|
|
2167
2192
|
if (n.hooks) {
|
|
2168
|
-
let s = this.defaults.hooks || new
|
|
2193
|
+
let s = this.defaults.hooks || new ot();
|
|
2169
2194
|
for (let o in n.hooks) {
|
|
2170
2195
|
if (!(o in s)) throw new Error(`hook '${o}' does not exist`);
|
|
2171
2196
|
if (["options", "block"].includes(o)) continue;
|
|
2172
2197
|
let l = o, m = n.hooks[l], c = s[l];
|
|
2173
|
-
|
|
2174
|
-
if (this.defaults.async &&
|
|
2198
|
+
ot.passThroughHooks.has(o) ? s[l] = (b) => {
|
|
2199
|
+
if (this.defaults.async && ot.passThroughHooksRespectAsync.has(o)) return (async () => {
|
|
2175
2200
|
let d = await m.call(s, b);
|
|
2176
2201
|
return c.call(s, d);
|
|
2177
2202
|
})();
|
|
@@ -2241,18 +2266,18 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
2241
2266
|
throw n;
|
|
2242
2267
|
};
|
|
2243
2268
|
}
|
|
2244
|
-
}, h(Ve, "D"), Ve), De = new
|
|
2269
|
+
}, h(Ve, "D"), Ve), De = new ai();
|
|
2245
2270
|
function L(a, t) {
|
|
2246
2271
|
return De.parse(a, t);
|
|
2247
2272
|
}
|
|
2248
2273
|
h(L, "g");
|
|
2249
2274
|
L.options = L.setOptions = function(a) {
|
|
2250
|
-
return De.setOptions(a), L.defaults = De.defaults,
|
|
2275
|
+
return De.setOptions(a), L.defaults = De.defaults, hs(L.defaults), L;
|
|
2251
2276
|
};
|
|
2252
2277
|
L.getDefaults = nn;
|
|
2253
2278
|
L.defaults = Le;
|
|
2254
2279
|
L.use = function(...a) {
|
|
2255
|
-
return De.use(...a), L.defaults = De.defaults,
|
|
2280
|
+
return De.use(...a), L.defaults = De.defaults, hs(L.defaults), L;
|
|
2256
2281
|
};
|
|
2257
2282
|
L.walkTokens = function(a, t) {
|
|
2258
2283
|
return De.walkTokens(a, t);
|
|
@@ -2265,7 +2290,7 @@ L.TextRenderer = hn;
|
|
|
2265
2290
|
L.Lexer = de;
|
|
2266
2291
|
L.lexer = de.lex;
|
|
2267
2292
|
L.Tokenizer = Tt;
|
|
2268
|
-
L.Hooks =
|
|
2293
|
+
L.Hooks = ot;
|
|
2269
2294
|
L.parse = L;
|
|
2270
2295
|
L.options;
|
|
2271
2296
|
L.setOptions;
|
|
@@ -2274,40 +2299,41 @@ L.walkTokens;
|
|
|
2274
2299
|
L.parseInline;
|
|
2275
2300
|
fe.parse;
|
|
2276
2301
|
de.lex;
|
|
2277
|
-
const
|
|
2302
|
+
const li = { class: "@container/chat flex flex-col h-full relative" }, oi = {
|
|
2278
2303
|
key: 0,
|
|
2279
2304
|
class: "pb-4"
|
|
2280
|
-
},
|
|
2305
|
+
}, ci = {
|
|
2281
2306
|
key: 0,
|
|
2282
2307
|
class: "flex flex-col items-center justify-center px-4 min-h-full"
|
|
2283
|
-
},
|
|
2308
|
+
}, ui = { class: "relative mb-4 size-20 @sm/chat:size-24" }, hi = ["src", "alt"], pi = {
|
|
2284
2309
|
key: 0,
|
|
2285
2310
|
class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
|
|
2286
|
-
},
|
|
2311
|
+
}, di = ["onClick"], fi = ["title"], gi = {
|
|
2287
2312
|
key: 1,
|
|
2288
2313
|
class: "flex justify-end px-2 pb-2"
|
|
2289
|
-
},
|
|
2314
|
+
}, mi = {
|
|
2290
2315
|
key: 0,
|
|
2291
2316
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2292
|
-
},
|
|
2317
|
+
}, bi = ["data-issue-code", "data-issue-bucket"], xi = { class: "flex flex-col gap-1 min-w-0" }, ki = ["href"], wi = ["data-test"], yi = {
|
|
2293
2318
|
key: 0,
|
|
2294
2319
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2295
|
-
},
|
|
2320
|
+
}, vi = ["src", "alt"], Ti = ["src", "alt"], Si = ["src"], Ai = ["href"], Ei = ["innerHTML"], _i = {
|
|
2296
2321
|
key: 2,
|
|
2322
|
+
"data-test": "messaging-thinking-indicator",
|
|
2297
2323
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
2298
|
-
},
|
|
2324
|
+
}, Ri = ["src", "alt"], Ci = {
|
|
2299
2325
|
key: 0,
|
|
2300
2326
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2301
|
-
},
|
|
2327
|
+
}, Ii = ["src", "alt"], Di = { class: "max-w-20 truncate" }, Mi = ["onClick"], Li = {
|
|
2302
2328
|
key: 0,
|
|
2303
2329
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2304
|
-
},
|
|
2330
|
+
}, Oi = ["disabled"], zi = {
|
|
2305
2331
|
key: 0,
|
|
2306
2332
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2307
|
-
},
|
|
2333
|
+
}, Pi = {
|
|
2308
2334
|
key: 1,
|
|
2309
2335
|
class: "i-tabler-paperclip size-5"
|
|
2310
|
-
},
|
|
2336
|
+
}, Ni = ["placeholder", "disabled"], $i = ["disabled"], Xi = /* @__PURE__ */ Me({
|
|
2311
2337
|
__name: "ElAgentChat",
|
|
2312
2338
|
props: {
|
|
2313
2339
|
chatController: {},
|
|
@@ -2336,7 +2362,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2336
2362
|
if (!_)
|
|
2337
2363
|
return "";
|
|
2338
2364
|
const f = L.parse(_, { async: !1 });
|
|
2339
|
-
return
|
|
2365
|
+
return kr.sanitize(f, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2340
2366
|
}
|
|
2341
2367
|
h(e, "renderMarkdown");
|
|
2342
2368
|
const n = {
|
|
@@ -2358,9 +2384,9 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2358
2384
|
return !M || M.sender !== x.sender;
|
|
2359
2385
|
}
|
|
2360
2386
|
h(y, "shouldShowAvatar");
|
|
2361
|
-
const E = W(() => a.chatController?.textState.value), O = W(() => E.value?.isConnected ?? !1),
|
|
2362
|
-
() =>
|
|
2363
|
-
), we = W(() =>
|
|
2387
|
+
const E = W(() => a.chatController?.textState.value), O = W(() => E.value?.isConnected ?? !1), ce = W(() => E.value?.isThinking ?? !1), ue = W(() => E.value?.connectionStatus === "disconnected" && !!E.value?.error), ne = W(() => E.value?.connectionStatus !== "connected" && !E.value?.error), N = W(() => E.value?.error), Y = W(() => a.chatController?.sharedMessages.value ?? []), ae = W(() => E.value?.accountGated ?? !1), Q = W(() => !O.value || ae.value), _t = W(() => ue.value ? "Agent is offline" : ne.value ? "Connecting..." : ae.value ? "Resolve the billing issue above to continue" : "Message"), ut = W(() => (l.value.trim() || d.value.length > 0) && !Q.value && !g.value), C = W(() => a.variant === "light"), q = W(
|
|
2388
|
+
() => C.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2389
|
+
), we = W(() => C.value ? "text-theme-300" : "text-white/30");
|
|
2364
2390
|
tn(async () => {
|
|
2365
2391
|
a.chatController && !O.value && await a.chatController.startTextConversation();
|
|
2366
2392
|
});
|
|
@@ -2380,10 +2406,10 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2380
2406
|
Q.value || (l.value = _, await ye());
|
|
2381
2407
|
}
|
|
2382
2408
|
h(Rt, "sendStarterPrompt");
|
|
2383
|
-
async function
|
|
2409
|
+
async function Ct(_) {
|
|
2384
2410
|
_.key === "Enter" && !_.shiftKey && (_.preventDefault(), await ye());
|
|
2385
2411
|
}
|
|
2386
|
-
h(
|
|
2412
|
+
h(Ct, "handleKeydown");
|
|
2387
2413
|
function ht() {
|
|
2388
2414
|
c.value && jt(() => {
|
|
2389
2415
|
c.value.scrollTop = c.value.scrollHeight;
|
|
@@ -2393,11 +2419,11 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2393
2419
|
function pt() {
|
|
2394
2420
|
b.value && (b.value.style.height = "auto", b.value.style.height = `${Math.min(b.value.scrollHeight, 150)}px`);
|
|
2395
2421
|
}
|
|
2396
|
-
h(pt, "adjustTextareaHeight"),
|
|
2397
|
-
function
|
|
2422
|
+
h(pt, "adjustTextareaHeight"), Ye(l, () => jt(() => pt()));
|
|
2423
|
+
function It() {
|
|
2398
2424
|
p.value?.click();
|
|
2399
2425
|
}
|
|
2400
|
-
h(
|
|
2426
|
+
h(It, "triggerFileInput");
|
|
2401
2427
|
async function dt(_) {
|
|
2402
2428
|
const f = _.target, x = f.files?.[0];
|
|
2403
2429
|
if (!(!x || !a.uploadFn)) {
|
|
@@ -2414,11 +2440,11 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2414
2440
|
}
|
|
2415
2441
|
}
|
|
2416
2442
|
h(dt, "handleFileSelect");
|
|
2417
|
-
function
|
|
2443
|
+
function B(_) {
|
|
2418
2444
|
d.value = d.value.filter((f, x) => x !== _);
|
|
2419
2445
|
}
|
|
2420
|
-
h(
|
|
2421
|
-
function
|
|
2446
|
+
h(B, "removeAttachment");
|
|
2447
|
+
function Xe(_, f) {
|
|
2422
2448
|
if (f === 0) {
|
|
2423
2449
|
const Pe = _[f];
|
|
2424
2450
|
return Pe?.timestamp ? F(new Date(Pe.timestamp)) : null;
|
|
@@ -2428,7 +2454,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2428
2454
|
const P = new Date(x.timestamp).getTime();
|
|
2429
2455
|
return new Date(M.timestamp).getTime() - P > 36e5 ? F(new Date(M.timestamp)) : null;
|
|
2430
2456
|
}
|
|
2431
|
-
h(
|
|
2457
|
+
h(Xe, "shouldShowTimeDivider");
|
|
2432
2458
|
function F(_) {
|
|
2433
2459
|
const f = /* @__PURE__ */ new Date(), x = _.toDateString() === f.toDateString(), M = new Date(f);
|
|
2434
2460
|
M.setDate(M.getDate() - 1);
|
|
@@ -2443,26 +2469,26 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2443
2469
|
...ze ? {} : { year: "numeric" }
|
|
2444
2470
|
})}, ${xe}`;
|
|
2445
2471
|
}
|
|
2446
|
-
return h(F, "formatTimeDivider"),
|
|
2472
|
+
return h(F, "formatTimeDivider"), Ye(Y, (_) => {
|
|
2447
2473
|
_.length > 0 && jt(() => ht());
|
|
2448
|
-
}, { immediate: !0, deep: !0 }), (_, f) => (T(), S("div",
|
|
2449
|
-
|
|
2450
|
-
Wt(
|
|
2474
|
+
}, { immediate: !0, deep: !0 }), (_, f) => (T(), S("div", li, [
|
|
2475
|
+
C.value ? U("", !0) : (T(), S("div", oi, [
|
|
2476
|
+
Wt(Ys, {
|
|
2451
2477
|
agent: a.agent,
|
|
2452
2478
|
"is-online": O.value
|
|
2453
2479
|
}, null, 8, ["agent", "is-online"])
|
|
2454
2480
|
])),
|
|
2455
|
-
|
|
2481
|
+
ue.value ? (T(), S("div", {
|
|
2456
2482
|
key: 1,
|
|
2457
|
-
class: A(["py-16 flex flex-col items-center justify-center gap-3 text-sm",
|
|
2483
|
+
class: A(["py-16 flex flex-col items-center justify-center gap-3 text-sm", C.value ? "text-theme-400" : "text-white/60"])
|
|
2458
2484
|
}, [
|
|
2459
2485
|
w("i", {
|
|
2460
|
-
class: A(["i-heroicons-cloud-arrow-down size-8",
|
|
2486
|
+
class: A(["i-heroicons-cloud-arrow-down size-8", C.value ? "text-theme-300" : "text-white/40"])
|
|
2461
2487
|
}, null, 2),
|
|
2462
2488
|
w("span", null, ie(N.value), 1)
|
|
2463
2489
|
], 2)) : ne.value ? (T(), S("div", {
|
|
2464
2490
|
key: 2,
|
|
2465
|
-
class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm",
|
|
2491
|
+
class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm", C.value ? "text-theme-400" : "text-theme-600"])
|
|
2466
2492
|
}, [
|
|
2467
2493
|
Wt(Ln, { class: "size-4" })
|
|
2468
2494
|
], 2)) : a.setupHint ? (T(), S("div", {
|
|
@@ -2471,103 +2497,103 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2471
2497
|
}, [
|
|
2472
2498
|
f[6] || (f[6] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2473
2499
|
w("span", null, ie(a.setupHint), 1)
|
|
2474
|
-
], 2)) :
|
|
2500
|
+
], 2)) : U("", !0),
|
|
2475
2501
|
w("div", {
|
|
2476
2502
|
ref_key: "messagesContainer",
|
|
2477
2503
|
ref: c,
|
|
2478
2504
|
class: "flex-1 overflow-y-auto overflow-x-hidden pt-4 pb-[120px] px-3 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
|
2479
2505
|
}, [
|
|
2480
|
-
Y.value.length === 0 && !ne.value && !
|
|
2481
|
-
w("div",
|
|
2506
|
+
Y.value.length === 0 && !ne.value && !ue.value ? (T(), S("div", ci, [
|
|
2507
|
+
w("div", ui, [
|
|
2482
2508
|
w("img", {
|
|
2483
2509
|
src: a.agent.avatarUrl.value,
|
|
2484
2510
|
alt: a.agent.displayName.value,
|
|
2485
|
-
class: A(["size-full rounded-full object-cover ring-1",
|
|
2486
|
-
}, null, 10,
|
|
2511
|
+
class: A(["size-full rounded-full object-cover ring-1", C.value ? "ring-black/5" : "ring-white/10"])
|
|
2512
|
+
}, null, 10, hi),
|
|
2487
2513
|
O.value ? (T(), S("span", {
|
|
2488
2514
|
key: 0,
|
|
2489
|
-
class: A(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full",
|
|
2515
|
+
class: A(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", C.value ? "bg-white" : "bg-theme-900"])
|
|
2490
2516
|
}, [...f[7] || (f[7] = [
|
|
2491
2517
|
w("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
2492
|
-
])], 2)) :
|
|
2518
|
+
])], 2)) : U("", !0)
|
|
2493
2519
|
]),
|
|
2494
2520
|
w("div", {
|
|
2495
|
-
class: A(["text-base @sm/chat:text-lg font-semibold",
|
|
2521
|
+
class: A(["text-base @sm/chat:text-lg font-semibold", C.value ? "text-theme-900" : "text-white"])
|
|
2496
2522
|
}, ie(a.agent.displayName.value), 3),
|
|
2497
2523
|
w("p", {
|
|
2498
2524
|
class: A(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
|
|
2499
2525
|
}, ie(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
|
|
2500
|
-
s.value.length > 0 && !Q.value ? (T(), S("div",
|
|
2501
|
-
(T(!0), S(Te, null,
|
|
2526
|
+
s.value.length > 0 && !Q.value ? (T(), S("div", pi, [
|
|
2527
|
+
(T(!0), S(Te, null, at(s.value, (x) => (T(), S("button", {
|
|
2502
2528
|
key: x,
|
|
2503
2529
|
type: "button",
|
|
2504
2530
|
"data-test": "chat-starter-prompt",
|
|
2505
|
-
class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer",
|
|
2531
|
+
class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", C.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
|
|
2506
2532
|
onClick: /* @__PURE__ */ h((M) => Rt(x), "onClick")
|
|
2507
|
-
}, ie(x), 11,
|
|
2508
|
-
])) :
|
|
2533
|
+
}, ie(x), 11, di))), 128))
|
|
2534
|
+
])) : U("", !0),
|
|
2509
2535
|
w("div", {
|
|
2510
|
-
class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]",
|
|
2536
|
+
class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", C.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2511
2537
|
title: o.value.tooltip
|
|
2512
2538
|
}, [
|
|
2513
2539
|
w("i", {
|
|
2514
2540
|
class: A([o.value.icon, "size-3"])
|
|
2515
2541
|
}, null, 2),
|
|
2516
2542
|
w("span", null, ie(o.value.label), 1)
|
|
2517
|
-
], 10,
|
|
2518
|
-
])) :
|
|
2519
|
-
Y.value.length > 0 ? (T(), S("div",
|
|
2543
|
+
], 10, fi)
|
|
2544
|
+
])) : U("", !0),
|
|
2545
|
+
Y.value.length > 0 ? (T(), S("div", gi, [
|
|
2520
2546
|
w("button", {
|
|
2521
2547
|
type: "button",
|
|
2522
2548
|
"data-test": "chat-new-session",
|
|
2523
|
-
class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors",
|
|
2549
|
+
class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", C.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
|
|
2524
2550
|
onClick: Oe
|
|
2525
2551
|
}, [...f[8] || (f[8] = [
|
|
2526
2552
|
w("i", { class: "i-tabler-refresh size-3" }, null, -1),
|
|
2527
2553
|
w("span", null, "New chat", -1)
|
|
2528
2554
|
])], 2)
|
|
2529
|
-
])) :
|
|
2530
|
-
(T(!0), S(Te, null,
|
|
2555
|
+
])) : U("", !0),
|
|
2556
|
+
(T(!0), S(Te, null, at(Y.value, (x, M) => (T(), S(Te, {
|
|
2531
2557
|
key: x.id
|
|
2532
2558
|
}, [
|
|
2533
|
-
|
|
2559
|
+
Xe(Y.value, M) ? (T(), S("div", mi, [
|
|
2534
2560
|
w("div", {
|
|
2535
2561
|
class: A(["flex-1 h-px", q.value])
|
|
2536
2562
|
}, null, 2),
|
|
2537
2563
|
w("span", {
|
|
2538
2564
|
class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
|
|
2539
|
-
}, ie(
|
|
2565
|
+
}, ie(Xe(Y.value, M)), 3),
|
|
2540
2566
|
w("div", {
|
|
2541
2567
|
class: A(["flex-1 h-px", q.value])
|
|
2542
2568
|
}, null, 2)
|
|
2543
|
-
])) :
|
|
2569
|
+
])) : U("", !0),
|
|
2544
2570
|
x.sender === "system" ? (T(), S("div", {
|
|
2545
2571
|
key: 1,
|
|
2546
2572
|
"data-test": "messaging-system-msg",
|
|
2547
2573
|
"data-issue-code": x.issue?.code,
|
|
2548
2574
|
"data-issue-bucket": x.issue?.bucket,
|
|
2549
|
-
class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed",
|
|
2575
|
+
class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", C.value ? "text-theme-500" : "text-white/70"])
|
|
2550
2576
|
}, [
|
|
2551
2577
|
w("i", {
|
|
2552
|
-
class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", x.issue?.bucket === "account" ?
|
|
2578
|
+
class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", x.issue?.bucket === "account" ? C.value ? "text-amber-500" : "text-amber-300" : C.value ? "text-red-500" : "text-red-300"])
|
|
2553
2579
|
}, null, 2),
|
|
2554
|
-
w("div",
|
|
2580
|
+
w("div", xi, [
|
|
2555
2581
|
w("span", null, ie(x.text), 1),
|
|
2556
2582
|
x.issue?.help ? (T(), S("span", {
|
|
2557
2583
|
key: 0,
|
|
2558
|
-
class: A(["text-[12px]",
|
|
2559
|
-
}, ie(x.issue.help), 3)) :
|
|
2584
|
+
class: A(["text-[12px]", C.value ? "text-theme-400" : "text-white/55"])
|
|
2585
|
+
}, ie(x.issue.help), 3)) : U("", !0),
|
|
2560
2586
|
x.issue?.actionUrl ? (T(), S("a", {
|
|
2561
2587
|
key: 1,
|
|
2562
2588
|
href: x.issue.actionUrl,
|
|
2563
2589
|
"data-test": "messaging-system-msg-action",
|
|
2564
|
-
class: A(["text-[12px] font-medium inline-flex items-center gap-1",
|
|
2590
|
+
class: A(["text-[12px] font-medium inline-flex items-center gap-1", C.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
|
|
2565
2591
|
}, [
|
|
2566
|
-
|
|
2592
|
+
et(ie(x.issue.actionLabel) + " ", 1),
|
|
2567
2593
|
f[9] || (f[9] = w("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2568
|
-
], 10,
|
|
2594
|
+
], 10, ki)) : U("", !0)
|
|
2569
2595
|
])
|
|
2570
|
-
], 10,
|
|
2596
|
+
], 10, bi)) : (T(), S("div", {
|
|
2571
2597
|
key: 2,
|
|
2572
2598
|
"data-test": x.sender === "agent" ? "messaging-assistant-msg" : x.sender === "user" ? "messaging-user-msg" : void 0,
|
|
2573
2599
|
class: A(["flex gap-2 items-end", {
|
|
@@ -2576,14 +2602,14 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2576
2602
|
"mb-4": y(Y.value, M)
|
|
2577
2603
|
}])
|
|
2578
2604
|
}, [
|
|
2579
|
-
x.sender === "agent" ? (T(), S("div",
|
|
2605
|
+
x.sender === "agent" ? (T(), S("div", yi, [
|
|
2580
2606
|
y(Y.value, M) ? (T(), S("img", {
|
|
2581
2607
|
key: 0,
|
|
2582
2608
|
src: a.agent.avatarUrl.value,
|
|
2583
2609
|
alt: a.agent.displayName.value,
|
|
2584
|
-
class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm",
|
|
2585
|
-
}, null, 10,
|
|
2586
|
-
])) :
|
|
2610
|
+
class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
|
|
2611
|
+
}, null, 10, vi)) : U("", !0)
|
|
2612
|
+
])) : U("", !0),
|
|
2587
2613
|
w("div", {
|
|
2588
2614
|
class: A(x.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2589
2615
|
}, [
|
|
@@ -2591,65 +2617,65 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2591
2617
|
key: 0,
|
|
2592
2618
|
class: A(["mb-1 space-y-1", x.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2593
2619
|
}, [
|
|
2594
|
-
(T(!0), S(Te, null,
|
|
2620
|
+
(T(!0), S(Te, null, at(x.attachments, (P, xe) => (T(), S(Te, { key: xe }, [
|
|
2595
2621
|
P.type === "image" ? (T(), S("img", {
|
|
2596
2622
|
key: 0,
|
|
2597
2623
|
src: P.url,
|
|
2598
2624
|
alt: P.name,
|
|
2599
2625
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2600
|
-
}, null, 8,
|
|
2626
|
+
}, null, 8, Ti)) : P.type === "audio" ? (T(), S("audio", {
|
|
2601
2627
|
key: 1,
|
|
2602
2628
|
src: P.url,
|
|
2603
2629
|
controls: "",
|
|
2604
2630
|
class: "max-w-full"
|
|
2605
|
-
}, null, 8,
|
|
2631
|
+
}, null, 8, Si)) : (T(), S("a", {
|
|
2606
2632
|
key: 2,
|
|
2607
2633
|
href: P.url,
|
|
2608
2634
|
target: "_blank",
|
|
2609
2635
|
rel: "noopener",
|
|
2610
|
-
class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
2636
|
+
class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", C.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2611
2637
|
}, [
|
|
2612
2638
|
f[10] || (f[10] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2613
|
-
|
|
2614
|
-
], 10,
|
|
2639
|
+
et(" " + ie(P.name), 1)
|
|
2640
|
+
], 10, Ai))
|
|
2615
2641
|
], 64))), 128))
|
|
2616
|
-
], 2)) :
|
|
2642
|
+
], 2)) : U("", !0),
|
|
2617
2643
|
x.text ? (T(), S("div", {
|
|
2618
2644
|
key: 1,
|
|
2619
2645
|
class: A(["rounded-2xl px-3.5 py-2", [
|
|
2620
|
-
x.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" :
|
|
2646
|
+
x.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : C.value ? "bg-theme-50 text-theme-800 border border-black/[0.02] rounded-bl-[4px]" : "bg-white/15 backdrop-blur-sm text-white/95 rounded-bl-[4px]"
|
|
2621
2647
|
]])
|
|
2622
2648
|
}, [
|
|
2623
2649
|
w("div", {
|
|
2624
|
-
class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", x.sender === "user" || !
|
|
2650
|
+
class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", x.sender === "user" || !C.value ? "chat-msg-prose-invert" : ""]),
|
|
2625
2651
|
innerHTML: e(x.text),
|
|
2626
|
-
onClick: f[0] || (f[0] =
|
|
2652
|
+
onClick: f[0] || (f[0] = Cs(() => {
|
|
2627
2653
|
}, ["stop"]))
|
|
2628
|
-
}, null, 10,
|
|
2629
|
-
], 2)) :
|
|
2654
|
+
}, null, 10, Ei)
|
|
2655
|
+
], 2)) : U("", !0)
|
|
2630
2656
|
], 2)
|
|
2631
|
-
], 10,
|
|
2657
|
+
], 10, wi))
|
|
2632
2658
|
], 64))), 128)),
|
|
2633
|
-
|
|
2659
|
+
ce.value ? (T(), S("div", _i, [
|
|
2634
2660
|
w("img", {
|
|
2635
2661
|
src: a.agent.avatarUrl.value,
|
|
2636
2662
|
alt: a.agent.displayName.value,
|
|
2637
|
-
class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm",
|
|
2638
|
-
}, null, 10,
|
|
2663
|
+
class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", C.value ? "ring-1 ring-black/5" : ""])
|
|
2664
|
+
}, null, 10, Ri),
|
|
2639
2665
|
w("div", {
|
|
2640
|
-
class: A(["rounded-2xl px-3.5 py-2.5 flex items-center",
|
|
2666
|
+
class: A(["rounded-2xl px-3.5 py-2.5 flex items-center", C.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2641
2667
|
}, [
|
|
2642
2668
|
w("i", {
|
|
2643
|
-
class: A(["i-svg-spinners-3-dots-bounce size-7",
|
|
2669
|
+
class: A(["i-svg-spinners-3-dots-bounce size-7", C.value ? "text-theme-400" : "text-white/50"])
|
|
2644
2670
|
}, null, 2)
|
|
2645
2671
|
], 2)
|
|
2646
|
-
])) :
|
|
2672
|
+
])) : U("", !0)
|
|
2647
2673
|
], 512),
|
|
2648
2674
|
w("div", {
|
|
2649
|
-
class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3",
|
|
2675
|
+
class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", C.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2650
2676
|
}, [
|
|
2651
|
-
d.value.length > 0 ? (T(), S("div",
|
|
2652
|
-
(T(!0), S(Te, null,
|
|
2677
|
+
d.value.length > 0 ? (T(), S("div", Ci, [
|
|
2678
|
+
(T(!0), S(Te, null, at(d.value, (x, M) => (T(), S("div", {
|
|
2653
2679
|
key: M,
|
|
2654
2680
|
class: "relative shrink-0 group"
|
|
2655
2681
|
}, [
|
|
@@ -2657,25 +2683,25 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2657
2683
|
key: 0,
|
|
2658
2684
|
src: x.url,
|
|
2659
2685
|
alt: x.name,
|
|
2660
|
-
class: A(["size-14 rounded-xl object-cover border",
|
|
2661
|
-
}, null, 10,
|
|
2686
|
+
class: A(["size-14 rounded-xl object-cover border", C.value ? "border-black/10" : "border-white/20"])
|
|
2687
|
+
}, null, 10, Ii)) : (T(), S("div", {
|
|
2662
2688
|
key: 1,
|
|
2663
|
-
class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border",
|
|
2689
|
+
class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", C.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2664
2690
|
}, [
|
|
2665
2691
|
f[11] || (f[11] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2666
|
-
w("span",
|
|
2692
|
+
w("span", Di, ie(x.name), 1)
|
|
2667
2693
|
], 2)),
|
|
2668
2694
|
w("button", {
|
|
2669
2695
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-800 text-white text-xs scale-0 group-hover:scale-100 transition-transform cursor-pointer",
|
|
2670
|
-
onClick: /* @__PURE__ */ h((P) =>
|
|
2696
|
+
onClick: /* @__PURE__ */ h((P) => B(M), "onClick")
|
|
2671
2697
|
}, [...f[12] || (f[12] = [
|
|
2672
2698
|
w("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2673
|
-
])], 8,
|
|
2699
|
+
])], 8, Mi)
|
|
2674
2700
|
]))), 128)),
|
|
2675
|
-
g.value ? (T(), S("div",
|
|
2701
|
+
g.value ? (T(), S("div", Li, [
|
|
2676
2702
|
Wt(Ln, { class: "size-5" })
|
|
2677
|
-
])) :
|
|
2678
|
-
])) :
|
|
2703
|
+
])) : U("", !0)
|
|
2704
|
+
])) : U("", !0),
|
|
2679
2705
|
a.uploadFn ? (T(), S("input", {
|
|
2680
2706
|
key: 1,
|
|
2681
2707
|
ref_key: "fileInput",
|
|
@@ -2684,21 +2710,21 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2684
2710
|
accept: "image/*,audio/*,video/*",
|
|
2685
2711
|
class: "hidden",
|
|
2686
2712
|
onChange: dt
|
|
2687
|
-
}, null, 544)) :
|
|
2713
|
+
}, null, 544)) : U("", !0),
|
|
2688
2714
|
w("div", {
|
|
2689
|
-
class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300",
|
|
2715
|
+
class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", C.value ? m.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : m.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
2690
2716
|
}, [
|
|
2691
2717
|
w("button", {
|
|
2692
2718
|
class: A(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
2693
2719
|
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
2694
|
-
|
|
2720
|
+
C.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
2695
2721
|
g.value ? "opacity-50 pointer-events-none" : ""
|
|
2696
2722
|
]]),
|
|
2697
2723
|
disabled: Q.value || g.value || !a.uploadFn,
|
|
2698
|
-
onClick: f[1] || (f[1] = (x) => a.uploadFn &&
|
|
2724
|
+
onClick: f[1] || (f[1] = (x) => a.uploadFn && It())
|
|
2699
2725
|
}, [
|
|
2700
|
-
g.value ? (T(), S("i",
|
|
2701
|
-
], 10,
|
|
2726
|
+
g.value ? (T(), S("i", zi)) : (T(), S("i", Pi))
|
|
2727
|
+
], 10, Oi),
|
|
2702
2728
|
ss(w("textarea", {
|
|
2703
2729
|
ref_key: "textarea",
|
|
2704
2730
|
ref: b,
|
|
@@ -2709,42 +2735,42 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2709
2735
|
placeholder: _t.value,
|
|
2710
2736
|
disabled: Q.value,
|
|
2711
2737
|
style: { fontSize: "16px", resize: "none" },
|
|
2712
|
-
class: A(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
2713
|
-
onKeydown:
|
|
2738
|
+
class: A(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", C.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2739
|
+
onKeydown: Ct,
|
|
2714
2740
|
onFocus: f[3] || (f[3] = (x) => m.value = !0),
|
|
2715
2741
|
onBlur: f[4] || (f[4] = (x) => m.value = !1)
|
|
2716
|
-
}, null, 42,
|
|
2742
|
+
}, null, 42, Ni), [
|
|
2717
2743
|
[rs, l.value]
|
|
2718
2744
|
]),
|
|
2719
2745
|
w("button", {
|
|
2720
2746
|
"data-test": "messaging-send-btn",
|
|
2721
|
-
class: A(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ut.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" :
|
|
2747
|
+
class: A(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ut.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : C.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
2722
2748
|
disabled: !ut.value,
|
|
2723
2749
|
onClick: f[5] || (f[5] = (x) => ye())
|
|
2724
2750
|
}, [...f[13] || (f[13] = [
|
|
2725
2751
|
w("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2726
|
-
])], 10,
|
|
2752
|
+
])], 10, $i)
|
|
2727
2753
|
], 2),
|
|
2728
2754
|
w("div", {
|
|
2729
|
-
class: A(["text-[10px] text-center mt-2.5 select-none opacity-70",
|
|
2755
|
+
class: A(["text-[10px] text-center mt-2.5 select-none opacity-70", C.value ? "text-theme-400" : "text-white/50"])
|
|
2730
2756
|
}, [
|
|
2731
|
-
f[14] || (f[14] =
|
|
2757
|
+
f[14] || (f[14] = et(" Press ", -1)),
|
|
2732
2758
|
w("kbd", {
|
|
2733
|
-
class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]",
|
|
2759
|
+
class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
|
|
2734
2760
|
}, "Enter", 2),
|
|
2735
|
-
f[15] || (f[15] =
|
|
2761
|
+
f[15] || (f[15] = et(" to send, ", -1)),
|
|
2736
2762
|
w("kbd", {
|
|
2737
|
-
class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]",
|
|
2763
|
+
class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", C.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
|
|
2738
2764
|
}, "Shift+Enter", 2),
|
|
2739
|
-
f[16] || (f[16] =
|
|
2765
|
+
f[16] || (f[16] = et(" for new line ", -1))
|
|
2740
2766
|
], 2)
|
|
2741
2767
|
], 2)
|
|
2742
2768
|
]));
|
|
2743
2769
|
}
|
|
2744
|
-
}),
|
|
2770
|
+
}), Ui = { class: "agent-wrap" }, Bi = {
|
|
2745
2771
|
key: 0,
|
|
2746
2772
|
class: "flex items-center justify-center h-full"
|
|
2747
|
-
},
|
|
2773
|
+
}, Ki = /* @__PURE__ */ Me({
|
|
2748
2774
|
__name: "AgentWrap",
|
|
2749
2775
|
props: {
|
|
2750
2776
|
sdk: {},
|
|
@@ -2758,7 +2784,7 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2758
2784
|
apiBase: {}
|
|
2759
2785
|
},
|
|
2760
2786
|
setup(a) {
|
|
2761
|
-
const t =
|
|
2787
|
+
const t = Ms("AgentWrap"), e = a, n = e.sdk || Ls.getInstance({
|
|
2762
2788
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2763
2789
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2764
2790
|
}), r = ee(!e.agent), s = Is(e.agent ? new yt({ config: e.agent }) : void 0), o = ee();
|
|
@@ -2838,8 +2864,8 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2838
2864
|
}
|
|
2839
2865
|
});
|
|
2840
2866
|
}
|
|
2841
|
-
}), (l, m) => (T(), S("div",
|
|
2842
|
-
r.value ? (T(), S("div",
|
|
2867
|
+
}), (l, m) => (T(), S("div", Ui, [
|
|
2868
|
+
r.value ? (T(), S("div", Bi, [...m[0] || (m[0] = [
|
|
2843
2869
|
w("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
2844
2870
|
])])) : s.value ? ns(l.$slots, "default", {
|
|
2845
2871
|
key: 1,
|
|
@@ -2850,21 +2876,21 @@ const ii = { class: "@container/chat flex flex-col h-full relative" }, ai = {
|
|
|
2850
2876
|
buttonText: a.buttonText,
|
|
2851
2877
|
buttonIcon: a.buttonIcon,
|
|
2852
2878
|
loading: r.value
|
|
2853
|
-
}) :
|
|
2879
|
+
}) : U("", !0)
|
|
2854
2880
|
]));
|
|
2855
2881
|
}
|
|
2856
2882
|
});
|
|
2857
2883
|
export {
|
|
2858
2884
|
On as A,
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2885
|
+
Ki as _,
|
|
2886
|
+
Xi as a,
|
|
2887
|
+
Yi as b,
|
|
2888
|
+
Vi as c,
|
|
2889
|
+
Zi as d,
|
|
2864
2890
|
Ln as e,
|
|
2865
|
-
|
|
2866
|
-
|
|
2891
|
+
Ys as f,
|
|
2892
|
+
Wi as g,
|
|
2867
2893
|
Pn as h,
|
|
2868
|
-
|
|
2894
|
+
qi as p
|
|
2869
2895
|
};
|
|
2870
2896
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|