@pagelines/sdk 1.0.543 → 1.0.545
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 +476 -473
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/schema.d.ts +4 -6
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +2 -2
- package/dist/demo/index.d.ts +1 -1
- package/dist/widget/composables/useWidgetState.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (i, t) =>
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as ke, openBlock as T, createElementBlock as A, createElementVNode as S, normalizeClass as _, ref as
|
|
6
|
-
import { SettingsObject as
|
|
7
|
-
import { P as
|
|
8
|
-
const
|
|
1
|
+
var Bn = Object.defineProperty;
|
|
2
|
+
var Bs = (i, t, e) => t in i ? Bn(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
|
|
3
|
+
var h = (i, t) => Bn(i, "name", { value: t, configurable: !0 });
|
|
4
|
+
var O = (i, t, e) => Bs(i, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as ke, openBlock as T, createElementBlock as A, createElementVNode as S, normalizeClass as _, ref as Q, watch as Je, computed as U, createCommentVNode as q, renderSlot as ln, onMounted as Mt, Fragment as De, renderList as Rt, withDirectives as ds, vModelText as fs, unref as nn, toDisplayString as ce, shallowRef as gs, onBeforeUnmount as ms, nextTick as Fs, createVNode as He, withCtx as Us, createBlock as Fn, withModifiers as Tt, createTextVNode as Un } from "vue";
|
|
6
|
+
import { SettingsObject as Hs, Agent as It, getDefaultAvatarUrl as xs, createLogger as js } from "@pagelines/core";
|
|
7
|
+
import { P as Gs } from "./sdkClient.js";
|
|
8
|
+
const Ws = { class: "spinner max-w-sm" }, qs = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
11
|
}, Hn = /* @__PURE__ */ ke({
|
|
@@ -15,8 +15,8 @@ const Gs = { class: "spinner max-w-sm" }, Ws = {
|
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(i) {
|
|
18
|
-
return (t, e) => (T(), A("div",
|
|
19
|
-
(T(), A("svg",
|
|
18
|
+
return (t, e) => (T(), A("div", Ws, [
|
|
19
|
+
(T(), A("svg", qs, [
|
|
20
20
|
S("circle", {
|
|
21
21
|
class: _([i.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
@@ -30,26 +30,26 @@ const Gs = { class: "spinner max-w-sm" }, Ws = {
|
|
|
30
30
|
]))
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), Vs = [
|
|
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
|
+
], Ys = 9e4, bs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Zs = /* @__PURE__ */ new Set([...bs, "EMPTY_STREAM", "RATE_LIMIT"]), jn = /* @__PURE__ */ new Set(["agent_deleted", "AGENT_DELETED"]), xn = class xn extends Hs {
|
|
37
37
|
constructor(e) {
|
|
38
38
|
super("AgentChatController", e);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
O(this, "isTextMode", !1);
|
|
40
|
+
O(this, "lastMessage", { hash: "", time: 0 });
|
|
41
|
+
O(this, "isConnecting", !1);
|
|
42
42
|
// Chat conversation tracking (server-managed persistence)
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
O(this, "conversationId");
|
|
44
|
+
O(this, "textState", Q({
|
|
45
45
|
isActive: !1,
|
|
46
46
|
isConnected: !1,
|
|
47
47
|
isThinking: !1,
|
|
48
48
|
connectionStatus: "disconnected"
|
|
49
49
|
}));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
O(this, "agentMode", Q("self"));
|
|
51
|
+
O(this, "sharedMessages", Q([]));
|
|
52
|
+
O(this, "_agent");
|
|
53
53
|
this._agent = e.agent instanceof It ? e.agent : new It({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
|
|
54
54
|
}
|
|
55
55
|
get chatEnabled() {
|
|
@@ -122,7 +122,8 @@ Current User:
|
|
|
122
122
|
isConnected: !1,
|
|
123
123
|
isThinking: !1,
|
|
124
124
|
connectionStatus: "disconnected",
|
|
125
|
-
error: void 0
|
|
125
|
+
error: void 0,
|
|
126
|
+
sendBlockedReason: void 0
|
|
126
127
|
});
|
|
127
128
|
}
|
|
128
129
|
setupModeWatcher() {
|
|
@@ -207,6 +208,8 @@ Current User:
|
|
|
207
208
|
this.addMessage("Agent is currently offline.", "system");
|
|
208
209
|
return;
|
|
209
210
|
}
|
|
211
|
+
if (this.textState.value.sendBlockedReason)
|
|
212
|
+
return;
|
|
210
213
|
const { sdk: s } = this.settings;
|
|
211
214
|
if (!r && !this._agent.handle.value) {
|
|
212
215
|
this.handleError(new Error("Agent handle required for chat"));
|
|
@@ -222,7 +225,7 @@ Current User:
|
|
|
222
225
|
]);
|
|
223
226
|
const C = this.sharedMessages.value, z = C[C.length - 1];
|
|
224
227
|
z?.id === l && (z.text += f, this.sharedMessages.value = [...C]);
|
|
225
|
-
}, "onDelta"),
|
|
228
|
+
}, "onDelta"), b = /* @__PURE__ */ h((f) => {
|
|
226
229
|
p = !0, o = !0;
|
|
227
230
|
const v = this.sharedMessages.value, C = v.findIndex((z) => z.id === f.id);
|
|
228
231
|
if (C >= 0)
|
|
@@ -235,7 +238,7 @@ Current User:
|
|
|
235
238
|
const z = v[v.length - 1];
|
|
236
239
|
this.sharedMessages.value = z?.id === l ? [...v.slice(0, -1), f] : [...v, f];
|
|
237
240
|
}
|
|
238
|
-
f.sender === "system" && f.issue?.bucket === "account" && this.updateState(this.textState, {
|
|
241
|
+
f.sender === "system" && f.issue?.bucket === "account" ? this.updateState(this.textState, { sendBlockedReason: "account" }) : f.sender === "system" && f.issue?.code && jn.has(f.issue.code) && this.updateState(this.textState, { sendBlockedReason: "agent_deleted" });
|
|
239
242
|
}, "onMessage"), d = /* @__PURE__ */ h((f) => {
|
|
240
243
|
if (!o && !p) {
|
|
241
244
|
m("empty_stream — assistant returned no content");
|
|
@@ -244,7 +247,7 @@ Current User:
|
|
|
244
247
|
const v = this.sharedMessages.value, C = v[v.length - 1];
|
|
245
248
|
if (C?.id === l && C.sender === "agent" && C.text) {
|
|
246
249
|
let z = C.text;
|
|
247
|
-
for (const ee of
|
|
250
|
+
for (const ee of Vs)
|
|
248
251
|
ee.pattern.test(z) && (console.debug(`[chat] filtered directive: ${ee.label}`), z = z.replace(ee.pattern, "").trim(), ee.pattern.lastIndex = 0);
|
|
249
252
|
z ? z !== C.text && (C.text = z, this.sharedMessages.value = [...v]) : this.sharedMessages.value = v.slice(0, -1);
|
|
250
253
|
}
|
|
@@ -253,7 +256,7 @@ Current User:
|
|
|
253
256
|
const v = this.sharedMessages.value, C = v[v.length - 1];
|
|
254
257
|
if (C?.id === l && !C.text && (this.sharedMessages.value = v.slice(0, -1)), typeof f == "object" && f.code && f.error) {
|
|
255
258
|
const { bucket: te, actionUrl: re, actionLabel: ge, help: $ } = f;
|
|
256
|
-
if (te !== void 0 ||
|
|
259
|
+
if (te !== void 0 || Zs.has(f.code)) {
|
|
257
260
|
const me = te ?? (bs.has(f.code) ? "account" : "error"), ye = {
|
|
258
261
|
code: f.code,
|
|
259
262
|
bucket: me,
|
|
@@ -261,14 +264,14 @@ Current User:
|
|
|
261
264
|
...re ? { actionUrl: re } : {},
|
|
262
265
|
...$ ? { help: $ } : {}
|
|
263
266
|
};
|
|
264
|
-
this.addMessage(f.error, "system", void 0, ye), me === "account" ? this.updateState(this.textState, { isThinking: !1,
|
|
267
|
+
this.addMessage(f.error, "system", void 0, ye), me === "account" ? this.updateState(this.textState, { isThinking: !1, sendBlockedReason: "account" }) : jn.has(f.code) ? this.updateState(this.textState, { isThinking: !1, sendBlockedReason: "agent_deleted" }) : this.updateState(this.textState, { isThinking: !1 });
|
|
265
268
|
} else
|
|
266
269
|
this.handleError(new Error(f.error));
|
|
267
270
|
return;
|
|
268
271
|
}
|
|
269
272
|
const z = typeof f == "string" ? f : f.error, ee = this.mapChatError(z);
|
|
270
273
|
this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: ee }), this.addMessage(ee, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(ee), z);
|
|
271
|
-
}, "onError"),
|
|
274
|
+
}, "onError"), x = /* @__PURE__ */ h((f) => {
|
|
272
275
|
this.addMessage(f, "system");
|
|
273
276
|
}, "onStatus");
|
|
274
277
|
try {
|
|
@@ -278,10 +281,10 @@ Current User:
|
|
|
278
281
|
conversationId: this.conversationId,
|
|
279
282
|
history: this.buildHistory(),
|
|
280
283
|
onDelta: c,
|
|
281
|
-
onMessage:
|
|
284
|
+
onMessage: b,
|
|
282
285
|
onDone: d,
|
|
283
286
|
onError: m,
|
|
284
|
-
onStatus:
|
|
287
|
+
onStatus: x
|
|
285
288
|
}) : s.chat.chatStreamPublic({
|
|
286
289
|
handle: this._agent.handle.value,
|
|
287
290
|
message: e,
|
|
@@ -289,14 +292,14 @@ Current User:
|
|
|
289
292
|
anonymousId: s.user.generateAnonId(),
|
|
290
293
|
context: this.getDynamicSettings().context || void 0,
|
|
291
294
|
onDelta: c,
|
|
292
|
-
onMessage:
|
|
295
|
+
onMessage: b,
|
|
293
296
|
onDone: d,
|
|
294
297
|
onError: m,
|
|
295
|
-
onStatus:
|
|
298
|
+
onStatus: x
|
|
296
299
|
});
|
|
297
300
|
await Promise.race([
|
|
298
301
|
f,
|
|
299
|
-
new Promise((v, C) => setTimeout(() => C(new Error("timed out")),
|
|
302
|
+
new Promise((v, C) => setTimeout(() => C(new Error("timed out")), Ys))
|
|
300
303
|
]);
|
|
301
304
|
} catch (f) {
|
|
302
305
|
m(f.message || "Something went wrong");
|
|
@@ -319,30 +322,30 @@ Current User:
|
|
|
319
322
|
await this.endConversation();
|
|
320
323
|
}
|
|
321
324
|
};
|
|
322
|
-
h(
|
|
323
|
-
let
|
|
324
|
-
function
|
|
325
|
+
h(xn, "AgentChatController");
|
|
326
|
+
let Gn = xn;
|
|
327
|
+
function Wn(i) {
|
|
325
328
|
return i ? typeof i == "string" ? i : i.src || "" : "";
|
|
326
329
|
}
|
|
327
|
-
h(
|
|
328
|
-
function
|
|
329
|
-
return
|
|
330
|
+
h(Wn, "getImageSrc");
|
|
331
|
+
function oa(i) {
|
|
332
|
+
return Wn(i.cover) || Wn(i.avatar) || xs(i.name);
|
|
330
333
|
}
|
|
331
|
-
h(
|
|
332
|
-
function
|
|
334
|
+
h(oa, "getAgentAvatarUrl");
|
|
335
|
+
function qn(i) {
|
|
333
336
|
const t = i.target;
|
|
334
|
-
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src =
|
|
337
|
+
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = xs());
|
|
335
338
|
}
|
|
336
|
-
h(
|
|
337
|
-
function
|
|
339
|
+
h(qn, "handleImageError");
|
|
340
|
+
function ca(i) {
|
|
338
341
|
const { template: t, agent: e } = i;
|
|
339
342
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
340
343
|
}
|
|
341
|
-
h(
|
|
342
|
-
const
|
|
344
|
+
h(ca, "parseButtonTemplate");
|
|
345
|
+
const Xs = {
|
|
343
346
|
key: 0,
|
|
344
347
|
class: "absolute inset-0 flex items-center justify-center"
|
|
345
|
-
},
|
|
348
|
+
}, ua = /* @__PURE__ */ ke({
|
|
346
349
|
__name: "ElAgentButton",
|
|
347
350
|
props: {
|
|
348
351
|
theme: { default: "primary" },
|
|
@@ -369,7 +372,7 @@ const Zs = {
|
|
|
369
372
|
return (r, s) => (T(), A("button", {
|
|
370
373
|
class: _(["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]])
|
|
371
374
|
}, [
|
|
372
|
-
i.loading ? (T(), A("div",
|
|
375
|
+
i.loading ? (T(), A("div", Xs, [...s[0] || (s[0] = [
|
|
373
376
|
S("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
374
377
|
])])) : q("", !0),
|
|
375
378
|
S("span", {
|
|
@@ -387,7 +390,7 @@ const Zs = {
|
|
|
387
390
|
], 2)
|
|
388
391
|
], 2));
|
|
389
392
|
}
|
|
390
|
-
}),
|
|
393
|
+
}), Ks = ["value"], ha = /* @__PURE__ */ ke({
|
|
391
394
|
__name: "AgentInputEmail",
|
|
392
395
|
props: {
|
|
393
396
|
modelValue: { default: "" }
|
|
@@ -403,9 +406,9 @@ const Zs = {
|
|
|
403
406
|
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",
|
|
404
407
|
style: { "font-size": "16px" },
|
|
405
408
|
onInput: r[0] || (r[0] = (s) => e("update:modelValue", s.target.value))
|
|
406
|
-
}, null, 40,
|
|
409
|
+
}, null, 40, Ks));
|
|
407
410
|
}
|
|
408
|
-
}),
|
|
411
|
+
}), Qs = { class: "flex gap-1.5 justify-center" }, Js = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], pa = /* @__PURE__ */ ke({
|
|
409
412
|
__name: "AgentInputOneTimeCode",
|
|
410
413
|
props: {
|
|
411
414
|
modelValue: {},
|
|
@@ -414,8 +417,8 @@ const Zs = {
|
|
|
414
417
|
},
|
|
415
418
|
emits: ["update:modelValue", "autoSubmit"],
|
|
416
419
|
setup(i, { emit: t }) {
|
|
417
|
-
const e = i, n = t, r =
|
|
418
|
-
|
|
420
|
+
const e = i, n = t, r = Q([]), s = Q(Array.from({ length: e.length }).fill("")), l = Q(!1);
|
|
421
|
+
Mt(() => {
|
|
419
422
|
e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && r.value[0]?.focus();
|
|
420
423
|
}), Je(() => e.modelValue, (d) => {
|
|
421
424
|
s.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
|
|
@@ -425,17 +428,17 @@ const Zs = {
|
|
|
425
428
|
}, { deep: !0 });
|
|
426
429
|
function o(d, m) {
|
|
427
430
|
m.preventDefault(), l.value = !0;
|
|
428
|
-
const
|
|
429
|
-
if (
|
|
430
|
-
s.value =
|
|
431
|
+
const x = (m.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
432
|
+
if (x.length === e.length)
|
|
433
|
+
s.value = x.split(""), setTimeout(() => {
|
|
431
434
|
r.value[e.length - 1]?.focus(), l.value = !1;
|
|
432
435
|
}, 10);
|
|
433
436
|
else {
|
|
434
437
|
const f = [...s.value];
|
|
435
|
-
|
|
438
|
+
x.split("").slice(0, e.length - d).forEach((C, z) => {
|
|
436
439
|
f[d + z] = C;
|
|
437
440
|
}), s.value = f;
|
|
438
|
-
const v = Math.min(d +
|
|
441
|
+
const v = Math.min(d + x.length, e.length - 1);
|
|
439
442
|
setTimeout(() => {
|
|
440
443
|
r.value[v]?.focus(), l.value = !1;
|
|
441
444
|
}, 10);
|
|
@@ -443,44 +446,44 @@ const Zs = {
|
|
|
443
446
|
}
|
|
444
447
|
h(o, "onPaste");
|
|
445
448
|
function p(d, m) {
|
|
446
|
-
const
|
|
447
|
-
s.value[d] =
|
|
449
|
+
const x = m.target.value.slice(-1).replace(/\D/g, "");
|
|
450
|
+
s.value[d] = x, x && d < e.length - 1 && r.value[d + 1]?.focus();
|
|
448
451
|
}
|
|
449
452
|
h(p, "onInput");
|
|
450
453
|
function c(d, m) {
|
|
451
454
|
m.key === "Backspace" ? (m.preventDefault(), s.value[d] = "", d > 0 && r.value[d - 1]?.focus()) : m.key === "ArrowLeft" && d > 0 ? r.value[d - 1]?.focus() : m.key === "ArrowRight" && d < e.length - 1 && r.value[d + 1]?.focus();
|
|
452
455
|
}
|
|
453
456
|
h(c, "onKeydown");
|
|
454
|
-
function
|
|
457
|
+
function b(d) {
|
|
455
458
|
if (r.value[d]?.select(), !l.value && s.value[d])
|
|
456
459
|
for (let m = d; m < e.length; m++)
|
|
457
460
|
s.value[m] = "";
|
|
458
461
|
}
|
|
459
|
-
return h(
|
|
460
|
-
(T(!0), A(De, null, Rt(i.length, (
|
|
461
|
-
key:
|
|
462
|
+
return h(b, "onFocus"), (d, m) => (T(), A("div", Qs, [
|
|
463
|
+
(T(!0), A(De, null, Rt(i.length, (x) => ds((T(), A("input", {
|
|
464
|
+
key: x,
|
|
462
465
|
ref_for: !0,
|
|
463
|
-
ref: /* @__PURE__ */ h((f) => r.value[
|
|
464
|
-
"onUpdate:modelValue": /* @__PURE__ */ h((f) => s.value[
|
|
466
|
+
ref: /* @__PURE__ */ h((f) => r.value[x - 1] = f, "ref"),
|
|
467
|
+
"onUpdate:modelValue": /* @__PURE__ */ h((f) => s.value[x - 1] = f, "onUpdate:modelValue"),
|
|
465
468
|
type: "text",
|
|
466
469
|
inputmode: "numeric",
|
|
467
470
|
autocomplete: "one-time-code",
|
|
468
471
|
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
469
472
|
style: { "font-size": "16px" },
|
|
470
473
|
maxlength: "1",
|
|
471
|
-
onInput: /* @__PURE__ */ h((f) => p(
|
|
472
|
-
onKeydown: /* @__PURE__ */ h((f) => c(
|
|
473
|
-
onPaste: /* @__PURE__ */ h((f) => o(
|
|
474
|
-
onFocus: /* @__PURE__ */ h((f) => x
|
|
475
|
-
}, null, 40,
|
|
476
|
-
[
|
|
474
|
+
onInput: /* @__PURE__ */ h((f) => p(x - 1, f), "onInput"),
|
|
475
|
+
onKeydown: /* @__PURE__ */ h((f) => c(x - 1, f), "onKeydown"),
|
|
476
|
+
onPaste: /* @__PURE__ */ h((f) => o(x - 1, f), "onPaste"),
|
|
477
|
+
onFocus: /* @__PURE__ */ h((f) => b(x - 1), "onFocus")
|
|
478
|
+
}, null, 40, Js)), [
|
|
479
|
+
[fs, s.value[x - 1]]
|
|
477
480
|
])), 128))
|
|
478
481
|
]));
|
|
479
482
|
}
|
|
480
|
-
}),
|
|
483
|
+
}), er = { class: "relative flex-shrink-0" }, tr = ["src", "alt"], nr = { class: "absolute top-1 right-1" }, sr = {
|
|
481
484
|
key: 1,
|
|
482
485
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
483
|
-
},
|
|
486
|
+
}, rr = { class: "min-w-0" }, ir = /* @__PURE__ */ ke({
|
|
484
487
|
__name: "ElModeHeader",
|
|
485
488
|
props: {
|
|
486
489
|
agent: {},
|
|
@@ -494,7 +497,7 @@ const Zs = {
|
|
|
494
497
|
i.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
495
498
|
]])
|
|
496
499
|
}, [
|
|
497
|
-
S("div",
|
|
500
|
+
S("div", er, [
|
|
498
501
|
S("div", {
|
|
499
502
|
class: _(["rounded-full overflow-hidden border-white", i.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
500
503
|
}, [
|
|
@@ -503,20 +506,20 @@ const Zs = {
|
|
|
503
506
|
alt: i.agent.displayName.value,
|
|
504
507
|
class: "w-full h-full object-cover",
|
|
505
508
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
506
|
-
(...n) => nn(
|
|
507
|
-
}, null, 40,
|
|
509
|
+
(...n) => nn(qn) && nn(qn)(...n))
|
|
510
|
+
}, null, 40, tr)
|
|
508
511
|
], 2),
|
|
509
|
-
S("div",
|
|
512
|
+
S("div", nr, [
|
|
510
513
|
i.isOnline ? (T(), A(De, { key: 0 }, [
|
|
511
514
|
e[1] || (e[1] = S("div", {
|
|
512
515
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
513
516
|
style: { "animation-duration": "3s" }
|
|
514
517
|
}, null, -1)),
|
|
515
518
|
e[2] || (e[2] = S("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
516
|
-
], 64)) : (T(), A("div",
|
|
519
|
+
], 64)) : (T(), A("div", sr))
|
|
517
520
|
])
|
|
518
521
|
]),
|
|
519
|
-
S("div",
|
|
522
|
+
S("div", rr, [
|
|
520
523
|
S("h1", {
|
|
521
524
|
class: _(["font-light text-white mb-1 truncate", [
|
|
522
525
|
i.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
@@ -533,24 +536,24 @@ const Zs = {
|
|
|
533
536
|
], 2));
|
|
534
537
|
}
|
|
535
538
|
});
|
|
536
|
-
function
|
|
539
|
+
function Vn(i, t) {
|
|
537
540
|
(t == null || t > i.length) && (t = i.length);
|
|
538
541
|
for (var e = 0, n = Array(t); e < t; e++) n[e] = i[e];
|
|
539
542
|
return n;
|
|
540
543
|
}
|
|
541
|
-
h(
|
|
542
|
-
function
|
|
544
|
+
h(Vn, "_arrayLikeToArray");
|
|
545
|
+
function ar(i) {
|
|
543
546
|
if (Array.isArray(i)) return i;
|
|
544
547
|
}
|
|
545
|
-
h(
|
|
546
|
-
function
|
|
548
|
+
h(ar, "_arrayWithHoles");
|
|
549
|
+
function lr(i, t) {
|
|
547
550
|
var e = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
|
|
548
551
|
if (e != null) {
|
|
549
552
|
var n, r, s, l, o = [], p = !0, c = !1;
|
|
550
553
|
try {
|
|
551
554
|
if (s = (e = e.call(i)).next, t !== 0) for (; !(p = (n = s.call(e)).done) && (o.push(n.value), o.length !== t); p = !0) ;
|
|
552
|
-
} catch (
|
|
553
|
-
c = !0, r =
|
|
555
|
+
} catch (b) {
|
|
556
|
+
c = !0, r = b;
|
|
554
557
|
} finally {
|
|
555
558
|
try {
|
|
556
559
|
if (!p && e.return != null && (l = e.return(), Object(l) !== l)) return;
|
|
@@ -561,26 +564,26 @@ function ar(i, t) {
|
|
|
561
564
|
return o;
|
|
562
565
|
}
|
|
563
566
|
}
|
|
564
|
-
h(
|
|
565
|
-
function
|
|
567
|
+
h(lr, "_iterableToArrayLimit");
|
|
568
|
+
function or() {
|
|
566
569
|
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
567
570
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
568
571
|
}
|
|
569
|
-
h(
|
|
570
|
-
function or(i, t) {
|
|
571
|
-
return ir(i) || ar(i, t) || cr(i, t) || lr();
|
|
572
|
-
}
|
|
573
|
-
h(or, "_slicedToArray");
|
|
572
|
+
h(or, "_nonIterableRest");
|
|
574
573
|
function cr(i, t) {
|
|
574
|
+
return ar(i) || lr(i, t) || ur(i, t) || or();
|
|
575
|
+
}
|
|
576
|
+
h(cr, "_slicedToArray");
|
|
577
|
+
function ur(i, t) {
|
|
575
578
|
if (i) {
|
|
576
|
-
if (typeof i == "string") return
|
|
579
|
+
if (typeof i == "string") return Vn(i, t);
|
|
577
580
|
var e = {}.toString.call(i).slice(8, -1);
|
|
578
|
-
return e === "Object" && i.constructor && (e = i.constructor.name), e === "Map" || e === "Set" ? Array.from(i) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ?
|
|
581
|
+
return e === "Object" && i.constructor && (e = i.constructor.name), e === "Map" || e === "Set" ? Array.from(i) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Vn(i, t) : void 0;
|
|
579
582
|
}
|
|
580
583
|
}
|
|
581
|
-
h(
|
|
582
|
-
const
|
|
583
|
-
let se = Object.freeze, le = Object.seal, Ye = Object.create,
|
|
584
|
+
h(ur, "_unsupportedIterableToArray");
|
|
585
|
+
const ks = Object.entries, Yn = Object.setPrototypeOf, hr = Object.isFrozen, pr = Object.getPrototypeOf, dr = Object.getOwnPropertyDescriptor;
|
|
586
|
+
let se = Object.freeze, le = Object.seal, Ye = Object.create, ys = typeof Reflect < "u" && Reflect, sn = ys.apply, rn = ys.construct;
|
|
584
587
|
se || (se = /* @__PURE__ */ h(function(t) {
|
|
585
588
|
return t;
|
|
586
589
|
}, "freeze"));
|
|
@@ -597,7 +600,7 @@ rn || (rn = /* @__PURE__ */ h(function(t) {
|
|
|
597
600
|
n[r - 1] = arguments[r];
|
|
598
601
|
return new t(...n);
|
|
599
602
|
}, "construct"));
|
|
600
|
-
const je = G(Array.prototype.forEach),
|
|
603
|
+
const je = G(Array.prototype.forEach), fr = G(Array.prototype.lastIndexOf), Zn = G(Array.prototype.pop), Ge = G(Array.prototype.push), gr = G(Array.prototype.splice), ne = Array.isArray, ct = G(String.prototype.toLowerCase), Kt = G(String.prototype.toString), Xn = G(String.prototype.match), We = G(String.prototype.replace), Kn = G(String.prototype.indexOf), mr = G(String.prototype.trim), xr = G(Number.prototype.toString), br = G(Boolean.prototype.toString), Qn = typeof BigInt > "u" ? null : G(BigInt.prototype.toString), Jn = typeof Symbol > "u" ? null : G(Symbol.prototype.toString), F = G(Object.prototype.hasOwnProperty), lt = G(Object.prototype.toString), K = G(RegExp.prototype.test), St = kr(TypeError);
|
|
601
604
|
function G(i) {
|
|
602
605
|
return function(t) {
|
|
603
606
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -607,58 +610,58 @@ function G(i) {
|
|
|
607
610
|
};
|
|
608
611
|
}
|
|
609
612
|
h(G, "unapply");
|
|
610
|
-
function
|
|
613
|
+
function kr(i) {
|
|
611
614
|
return function() {
|
|
612
615
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
613
616
|
e[n] = arguments[n];
|
|
614
617
|
return rn(i, e);
|
|
615
618
|
};
|
|
616
619
|
}
|
|
617
|
-
h(
|
|
620
|
+
h(kr, "unconstruct");
|
|
618
621
|
function R(i, t) {
|
|
619
622
|
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct;
|
|
620
|
-
if (
|
|
623
|
+
if (Yn && Yn(i, null), !ne(t))
|
|
621
624
|
return i;
|
|
622
625
|
let n = t.length;
|
|
623
626
|
for (; n--; ) {
|
|
624
627
|
let r = t[n];
|
|
625
628
|
if (typeof r == "string") {
|
|
626
629
|
const s = e(r);
|
|
627
|
-
s !== r && (
|
|
630
|
+
s !== r && (hr(t) || (t[n] = s), r = s);
|
|
628
631
|
}
|
|
629
632
|
i[r] = !0;
|
|
630
633
|
}
|
|
631
634
|
return i;
|
|
632
635
|
}
|
|
633
636
|
h(R, "addToSet");
|
|
634
|
-
function
|
|
637
|
+
function yr(i) {
|
|
635
638
|
for (let t = 0; t < i.length; t++)
|
|
636
|
-
|
|
639
|
+
F(i, t) || (i[t] = null);
|
|
637
640
|
return i;
|
|
638
641
|
}
|
|
639
|
-
h(
|
|
642
|
+
h(yr, "cleanArray");
|
|
640
643
|
function ae(i) {
|
|
641
644
|
const t = Ye(null);
|
|
642
|
-
for (const n of
|
|
643
|
-
var e =
|
|
645
|
+
for (const n of ks(i)) {
|
|
646
|
+
var e = cr(n, 2);
|
|
644
647
|
const r = e[0], s = e[1];
|
|
645
|
-
|
|
648
|
+
F(i, r) && (ne(s) ? t[r] = yr(s) : s && typeof s == "object" && s.constructor === Object ? t[r] = ae(s) : t[r] = s);
|
|
646
649
|
}
|
|
647
650
|
return t;
|
|
648
651
|
}
|
|
649
652
|
h(ae, "clone");
|
|
650
|
-
function
|
|
653
|
+
function wr(i) {
|
|
651
654
|
switch (typeof i) {
|
|
652
655
|
case "string":
|
|
653
656
|
return i;
|
|
654
657
|
case "number":
|
|
655
|
-
return
|
|
658
|
+
return xr(i);
|
|
656
659
|
case "boolean":
|
|
657
660
|
return br(i);
|
|
658
661
|
case "bigint":
|
|
659
|
-
return
|
|
662
|
+
return Qn ? Qn(i) : "0";
|
|
660
663
|
case "symbol":
|
|
661
|
-
return
|
|
664
|
+
return Jn ? Jn(i) : "Symbol()";
|
|
662
665
|
case "undefined":
|
|
663
666
|
return lt(i);
|
|
664
667
|
case "function":
|
|
@@ -676,17 +679,17 @@ function yr(i) {
|
|
|
676
679
|
return lt(i);
|
|
677
680
|
}
|
|
678
681
|
}
|
|
679
|
-
h(
|
|
682
|
+
h(wr, "stringifyValue");
|
|
680
683
|
function Ce(i, t) {
|
|
681
684
|
for (; i !== null; ) {
|
|
682
|
-
const n =
|
|
685
|
+
const n = dr(i, t);
|
|
683
686
|
if (n) {
|
|
684
687
|
if (n.get)
|
|
685
688
|
return G(n.get);
|
|
686
689
|
if (typeof n.value == "function")
|
|
687
690
|
return G(n.value);
|
|
688
691
|
}
|
|
689
|
-
i =
|
|
692
|
+
i = pr(i);
|
|
690
693
|
}
|
|
691
694
|
function e() {
|
|
692
695
|
return null;
|
|
@@ -694,30 +697,30 @@ function Ce(i, t) {
|
|
|
694
697
|
return h(e, "fallbackValue"), e;
|
|
695
698
|
}
|
|
696
699
|
h(Ce, "lookupGetter");
|
|
697
|
-
function
|
|
700
|
+
function vr(i) {
|
|
698
701
|
try {
|
|
699
|
-
return
|
|
702
|
+
return K(i, ""), !0;
|
|
700
703
|
} catch {
|
|
701
704
|
return !1;
|
|
702
705
|
}
|
|
703
706
|
}
|
|
704
|
-
h(
|
|
705
|
-
const
|
|
707
|
+
h(vr, "isRegex");
|
|
708
|
+
const es = se(["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"]), Qt = se(["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"]), Jt = se(["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"]), Tr = se(["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"]), en = se(["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"]), Sr = se(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), ts = se(["#text"]), ns = se(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "command", "commandfor", "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"]), tn = se(["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"]), ss = se(["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"]), At = se(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Ar = le(/{{[\w\W]*|^[\w\W]*}}/g), Er = le(/<%[\w\W]*|^[\w\W]*%>/g), _r = le(/\${[\w\W]*/g), Rr = le(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ir = le(/^aria-[\-\w]+$/), rs = le(
|
|
706
709
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
707
710
|
// eslint-disable-line no-useless-escape
|
|
708
|
-
),
|
|
711
|
+
), Cr = le(/^(?:\w+script|data):/i), Dr = le(
|
|
709
712
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
710
713
|
// eslint-disable-line no-control-regex
|
|
711
|
-
),
|
|
714
|
+
), Or = le(/^html$/i), Mr = le(/^[a-z][.\w]*(-[.\w]+)+$/i), qe = {
|
|
712
715
|
element: 1,
|
|
713
716
|
text: 3,
|
|
714
717
|
// Deprecated
|
|
715
718
|
progressingInstruction: 7,
|
|
716
719
|
comment: 8,
|
|
717
720
|
document: 9
|
|
718
|
-
},
|
|
721
|
+
}, Lr = /* @__PURE__ */ h(function() {
|
|
719
722
|
return typeof window > "u" ? null : window;
|
|
720
|
-
}, "getGlobal"),
|
|
723
|
+
}, "getGlobal"), Nr = /* @__PURE__ */ h(function(t, e) {
|
|
721
724
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
722
725
|
return null;
|
|
723
726
|
let n = null;
|
|
@@ -736,7 +739,7 @@ const Jn = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
736
739
|
} catch {
|
|
737
740
|
return console.warn("TrustedTypes policy " + s + " could not be created."), null;
|
|
738
741
|
}
|
|
739
|
-
}, "_createTrustedTypesPolicy"),
|
|
742
|
+
}, "_createTrustedTypesPolicy"), is = /* @__PURE__ */ h(function() {
|
|
740
743
|
return {
|
|
741
744
|
afterSanitizeAttributes: [],
|
|
742
745
|
afterSanitizeElements: [],
|
|
@@ -749,26 +752,26 @@ const Jn = se(["a", "abbr", "acronym", "address", "area", "article", "aside", "a
|
|
|
749
752
|
uponSanitizeShadowNode: []
|
|
750
753
|
};
|
|
751
754
|
}, "_createHooksMap");
|
|
752
|
-
function
|
|
753
|
-
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
754
|
-
const t = /* @__PURE__ */ h((w) =>
|
|
755
|
+
function ws() {
|
|
756
|
+
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : Lr();
|
|
757
|
+
const t = /* @__PURE__ */ h((w) => ws(w), "DOMPurify");
|
|
755
758
|
if (t.version = "3.4.5", t.removed = [], !i || !i.document || i.document.nodeType !== qe.document || !i.Element)
|
|
756
759
|
return t.isSupported = !1, t;
|
|
757
760
|
let e = i.document;
|
|
758
|
-
const n = e, r = n.currentScript, s = i.DocumentFragment, l = i.HTMLTemplateElement, o = i.Node, p = i.Element, c = i.NodeFilter,
|
|
761
|
+
const n = e, r = n.currentScript, s = i.DocumentFragment, l = i.HTMLTemplateElement, o = i.Node, p = i.Element, c = i.NodeFilter, b = i.NamedNodeMap, d = b === void 0 ? i.NamedNodeMap || i.MozNamedAttrMap : b, m = i.HTMLFormElement, x = i.DOMParser, f = i.trustedTypes, v = p.prototype, C = Ce(v, "cloneNode"), z = Ce(v, "remove"), ee = Ce(v, "nextSibling"), te = Ce(v, "childNodes"), re = Ce(v, "parentNode"), ge = o && o.prototype ? Ce(o.prototype, "nodeType") : null;
|
|
759
762
|
if (typeof l == "function") {
|
|
760
763
|
const w = e.createElement("template");
|
|
761
764
|
w.content && w.content.ownerDocument && (e = w.content.ownerDocument);
|
|
762
765
|
}
|
|
763
|
-
let $,
|
|
764
|
-
const me = e, ye = me.implementation,
|
|
765
|
-
let
|
|
766
|
-
t.isSupported = typeof
|
|
767
|
-
const Ne =
|
|
768
|
-
let y =
|
|
769
|
-
const
|
|
770
|
-
let
|
|
771
|
-
const nt = R({}, [...
|
|
766
|
+
let $, Y = "";
|
|
767
|
+
const me = e, ye = me.implementation, M = me.createNodeIterator, pt = me.createDocumentFragment, tt = me.getElementsByTagName, dt = n.importNode;
|
|
768
|
+
let Z = is();
|
|
769
|
+
t.isSupported = typeof ks == "function" && typeof re == "function" && ye && ye.createHTMLDocument !== void 0;
|
|
770
|
+
const Ne = Ar, ze = Er, $e = _r, zt = Rr, ft = Ir, gt = Cr, I = Dr, k = Mr;
|
|
771
|
+
let y = rs, E = null;
|
|
772
|
+
const X = R({}, [...es, ...Qt, ...Jt, ...en, ...ts]);
|
|
773
|
+
let B = null;
|
|
774
|
+
const nt = R({}, [...ns, ...tn, ...ss, ...At]);
|
|
772
775
|
let P = Object.seal(Ye(null, {
|
|
773
776
|
tagNameCheck: {
|
|
774
777
|
writable: !0,
|
|
@@ -803,43 +806,43 @@ function ys() {
|
|
|
803
806
|
value: null
|
|
804
807
|
}
|
|
805
808
|
}));
|
|
806
|
-
let
|
|
809
|
+
let bn = !0, $t = !0, kn = !1, yn = !0, ve = !1, rt = !0, Re = !1, Pt = !1, Bt = !1, Pe = !1, xt = !1, bt = !1, wn = !0, vn = !1;
|
|
807
810
|
const Tn = "user-content-";
|
|
808
|
-
let
|
|
811
|
+
let Ft = !0, it = !1, Be = {}, pe = null;
|
|
809
812
|
const Ut = 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"]);
|
|
810
813
|
let Sn = null;
|
|
811
814
|
const An = R({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
812
815
|
let Ht = null;
|
|
813
816
|
const En = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), kt = "http://www.w3.org/1998/Math/MathML", yt = "http://www.w3.org/2000/svg", de = "http://www.w3.org/1999/xhtml";
|
|
814
|
-
let
|
|
815
|
-
const
|
|
817
|
+
let Fe = de, jt = !1, Gt = null;
|
|
818
|
+
const Os = R({}, [kt, yt, de], Kt);
|
|
816
819
|
let Wt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), qt = R({}, ["annotation-xml"]);
|
|
817
820
|
const Ms = R({}, ["title", "style", "font", "a", "script"]);
|
|
818
821
|
let at = null;
|
|
819
|
-
const
|
|
822
|
+
const Ls = ["application/xhtml+xml", "text/html"], Ns = "text/html";
|
|
820
823
|
let W = null, Ue = null;
|
|
821
|
-
const
|
|
824
|
+
const zs = e.createElement("form"), _n = /* @__PURE__ */ h(function(a) {
|
|
822
825
|
return a instanceof RegExp || a instanceof Function;
|
|
823
826
|
}, "isRegexOrFunction"), Vt = /* @__PURE__ */ h(function() {
|
|
824
827
|
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
825
828
|
if (Ue && Ue === a)
|
|
826
829
|
return;
|
|
827
830
|
(!a || typeof a != "object") && (a = {}), a = ae(a), at = // eslint-disable-next-line unicorn/prefer-includes
|
|
828
|
-
|
|
829
|
-
const u =
|
|
830
|
-
if (P = Ye(null),
|
|
831
|
+
Ls.indexOf(a.PARSER_MEDIA_TYPE) === -1 ? Ns : a.PARSER_MEDIA_TYPE, W = at === "application/xhtml+xml" ? Kt : ct, E = F(a, "ALLOWED_TAGS") && ne(a.ALLOWED_TAGS) ? R({}, a.ALLOWED_TAGS, W) : X, B = F(a, "ALLOWED_ATTR") && ne(a.ALLOWED_ATTR) ? R({}, a.ALLOWED_ATTR, W) : nt, Gt = F(a, "ALLOWED_NAMESPACES") && ne(a.ALLOWED_NAMESPACES) ? R({}, a.ALLOWED_NAMESPACES, Kt) : Os, Ht = F(a, "ADD_URI_SAFE_ATTR") && ne(a.ADD_URI_SAFE_ATTR) ? R(ae(En), a.ADD_URI_SAFE_ATTR, W) : En, Sn = F(a, "ADD_DATA_URI_TAGS") && ne(a.ADD_DATA_URI_TAGS) ? R(ae(An), a.ADD_DATA_URI_TAGS, W) : An, pe = F(a, "FORBID_CONTENTS") && ne(a.FORBID_CONTENTS) ? R({}, a.FORBID_CONTENTS, W) : Ut, st = F(a, "FORBID_TAGS") && ne(a.FORBID_TAGS) ? R({}, a.FORBID_TAGS, W) : ae({}), mt = F(a, "FORBID_ATTR") && ne(a.FORBID_ATTR) ? R({}, a.FORBID_ATTR, W) : ae({}), Be = F(a, "USE_PROFILES") ? a.USE_PROFILES && typeof a.USE_PROFILES == "object" ? ae(a.USE_PROFILES) : a.USE_PROFILES : !1, bn = a.ALLOW_ARIA_ATTR !== !1, $t = a.ALLOW_DATA_ATTR !== !1, kn = a.ALLOW_UNKNOWN_PROTOCOLS || !1, yn = a.ALLOW_SELF_CLOSE_IN_ATTR !== !1, ve = a.SAFE_FOR_TEMPLATES || !1, rt = a.SAFE_FOR_XML !== !1, Re = a.WHOLE_DOCUMENT || !1, Pe = a.RETURN_DOM || !1, xt = a.RETURN_DOM_FRAGMENT || !1, bt = a.RETURN_TRUSTED_TYPE || !1, Bt = a.FORCE_BODY || !1, wn = a.SANITIZE_DOM !== !1, vn = a.SANITIZE_NAMED_PROPS || !1, Ft = a.KEEP_CONTENT !== !1, it = a.IN_PLACE || !1, y = vr(a.ALLOWED_URI_REGEXP) ? a.ALLOWED_URI_REGEXP : rs, Fe = typeof a.NAMESPACE == "string" ? a.NAMESPACE : de, Wt = F(a, "MATHML_TEXT_INTEGRATION_POINTS") && a.MATHML_TEXT_INTEGRATION_POINTS && typeof a.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ae(a.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), qt = F(a, "HTML_INTEGRATION_POINTS") && a.HTML_INTEGRATION_POINTS && typeof a.HTML_INTEGRATION_POINTS == "object" ? ae(a.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
832
|
+
const u = F(a, "CUSTOM_ELEMENT_HANDLING") && a.CUSTOM_ELEMENT_HANDLING && typeof a.CUSTOM_ELEMENT_HANDLING == "object" ? ae(a.CUSTOM_ELEMENT_HANDLING) : Ye(null);
|
|
833
|
+
if (P = Ye(null), F(u, "tagNameCheck") && _n(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), F(u, "attributeNameCheck") && _n(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), F(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), ve && ($t = !1), xt && (Pe = !0), Be && (E = R({}, ts), B = Ye(null), Be.html === !0 && (R(E, es), R(B, ns)), Be.svg === !0 && (R(E, Qt), R(B, tn), R(B, At)), Be.svgFilters === !0 && (R(E, Jt), R(B, tn), R(B, At)), Be.mathMl === !0 && (R(E, en), R(B, ss), R(B, At))), we.tagCheck = null, we.attributeCheck = null, F(a, "ADD_TAGS") && (typeof a.ADD_TAGS == "function" ? we.tagCheck = a.ADD_TAGS : ne(a.ADD_TAGS) && (E === X && (E = ae(E)), R(E, a.ADD_TAGS, W))), F(a, "ADD_ATTR") && (typeof a.ADD_ATTR == "function" ? we.attributeCheck = a.ADD_ATTR : ne(a.ADD_ATTR) && (B === nt && (B = ae(B)), R(B, a.ADD_ATTR, W))), F(a, "ADD_URI_SAFE_ATTR") && ne(a.ADD_URI_SAFE_ATTR) && R(Ht, a.ADD_URI_SAFE_ATTR, W), F(a, "FORBID_CONTENTS") && ne(a.FORBID_CONTENTS) && (pe === Ut && (pe = ae(pe)), R(pe, a.FORBID_CONTENTS, W)), F(a, "ADD_FORBID_CONTENTS") && ne(a.ADD_FORBID_CONTENTS) && (pe === Ut && (pe = ae(pe)), R(pe, a.ADD_FORBID_CONTENTS, W)), Ft && (E["#text"] = !0), Re && R(E, ["html", "head", "body"]), E.table && (R(E, ["tbody"]), delete st.tbody), a.TRUSTED_TYPES_POLICY) {
|
|
831
834
|
if (typeof a.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
832
835
|
throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
833
836
|
if (typeof a.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
834
837
|
throw St('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
835
|
-
$ = a.TRUSTED_TYPES_POLICY,
|
|
838
|
+
$ = a.TRUSTED_TYPES_POLICY, Y = $.createHTML("");
|
|
836
839
|
} else
|
|
837
|
-
$ === void 0 && ($ =
|
|
840
|
+
$ === void 0 && ($ = Nr(f, r)), $ !== null && typeof Y == "string" && (Y = $.createHTML(""));
|
|
838
841
|
se && se(a), Ue = a;
|
|
839
|
-
}, "_parseConfig"), Rn = R({}, [...Qt, ...Jt, ...
|
|
842
|
+
}, "_parseConfig"), Rn = R({}, [...Qt, ...Jt, ...Tr]), In = R({}, [...en, ...Sr]), $s = /* @__PURE__ */ h(function(a) {
|
|
840
843
|
let u = re(a);
|
|
841
844
|
(!u || !u.tagName) && (u = {
|
|
842
|
-
namespaceURI:
|
|
845
|
+
namespaceURI: Fe,
|
|
843
846
|
tagName: "template"
|
|
844
847
|
});
|
|
845
848
|
const g = ct(a.tagName), D = ct(u.tagName);
|
|
@@ -866,7 +869,7 @@ function ys() {
|
|
|
866
869
|
});
|
|
867
870
|
}
|
|
868
871
|
if (u.removeAttribute(a), a === "is")
|
|
869
|
-
if (Pe ||
|
|
872
|
+
if (Pe || xt)
|
|
870
873
|
try {
|
|
871
874
|
oe(u);
|
|
872
875
|
} catch {
|
|
@@ -878,39 +881,39 @@ function ys() {
|
|
|
878
881
|
}
|
|
879
882
|
}, "_removeAttribute"), Cn = /* @__PURE__ */ h(function(a) {
|
|
880
883
|
let u = null, g = null;
|
|
881
|
-
if (
|
|
884
|
+
if (Bt)
|
|
882
885
|
a = "<remove></remove>" + a;
|
|
883
886
|
else {
|
|
884
|
-
const j =
|
|
887
|
+
const j = Xn(a, /^[\r\n\t ]+/);
|
|
885
888
|
g = j && j[0];
|
|
886
889
|
}
|
|
887
|
-
at === "application/xhtml+xml" &&
|
|
890
|
+
at === "application/xhtml+xml" && Fe === de && (a = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + a + "</body></html>");
|
|
888
891
|
const D = $ ? $.createHTML(a) : a;
|
|
889
|
-
if (
|
|
892
|
+
if (Fe === de)
|
|
890
893
|
try {
|
|
891
|
-
u = new
|
|
894
|
+
u = new x().parseFromString(D, at);
|
|
892
895
|
} catch {
|
|
893
896
|
}
|
|
894
897
|
if (!u || !u.documentElement) {
|
|
895
|
-
u = ye.createDocument(
|
|
898
|
+
u = ye.createDocument(Fe, "template", null);
|
|
896
899
|
try {
|
|
897
|
-
u.documentElement.innerHTML = jt ?
|
|
900
|
+
u.documentElement.innerHTML = jt ? Y : D;
|
|
898
901
|
} catch {
|
|
899
902
|
}
|
|
900
903
|
}
|
|
901
904
|
const H = u.body || u.documentElement;
|
|
902
|
-
return a && g && H.insertBefore(e.createTextNode(g), H.childNodes[0] || null),
|
|
905
|
+
return a && g && H.insertBefore(e.createTextNode(g), H.childNodes[0] || null), Fe === de ? tt.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : H;
|
|
903
906
|
}, "_initDocument"), Dn = /* @__PURE__ */ h(function(a) {
|
|
904
|
-
return
|
|
907
|
+
return M.call(
|
|
905
908
|
a.ownerDocument || a,
|
|
906
909
|
a,
|
|
907
910
|
// eslint-disable-next-line no-bitwise
|
|
908
911
|
c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
|
|
909
912
|
null
|
|
910
913
|
);
|
|
911
|
-
}, "_createNodeIterator"),
|
|
914
|
+
}, "_createNodeIterator"), On = /* @__PURE__ */ h(function(a) {
|
|
912
915
|
a.normalize();
|
|
913
|
-
const u =
|
|
916
|
+
const u = M.call(
|
|
914
917
|
a.ownerDocument || a,
|
|
915
918
|
a,
|
|
916
919
|
// eslint-disable-next-line no-bitwise
|
|
@@ -935,26 +938,26 @@ function ys() {
|
|
|
935
938
|
return !1;
|
|
936
939
|
}
|
|
937
940
|
}, "_isNode");
|
|
938
|
-
function
|
|
941
|
+
function xe(w, a, u) {
|
|
939
942
|
je(w, (g) => {
|
|
940
943
|
g.call(t, a, u, Ue);
|
|
941
944
|
});
|
|
942
945
|
}
|
|
943
|
-
h(
|
|
944
|
-
const
|
|
946
|
+
h(xe, "_executeHooks");
|
|
947
|
+
const Mn = /* @__PURE__ */ h(function(a) {
|
|
945
948
|
let u = null;
|
|
946
|
-
if (
|
|
949
|
+
if (xe(Z.beforeSanitizeElements, a, null), Yt(a))
|
|
947
950
|
return oe(a), !0;
|
|
948
951
|
const g = W(a.nodeName);
|
|
949
|
-
if (
|
|
952
|
+
if (xe(Z.uponSanitizeElement, a, {
|
|
950
953
|
tagName: g,
|
|
951
954
|
allowedTags: E
|
|
952
|
-
}), rt && a.hasChildNodes() && !wt(a.firstElementChild) &&
|
|
955
|
+
}), rt && a.hasChildNodes() && !wt(a.firstElementChild) && K(/<[/\w!]/g, a.innerHTML) && K(/<[/\w!]/g, a.textContent) || rt && a.namespaceURI === de && g === "style" && wt(a.firstElementChild) || a.nodeType === qe.progressingInstruction || rt && a.nodeType === qe.comment && K(/<[/\w]/g, a.data))
|
|
953
956
|
return oe(a), !0;
|
|
954
957
|
if (st[g] || !(we.tagCheck instanceof Function && we.tagCheck(g)) && !E[g]) {
|
|
955
|
-
if (!st[g] && Nn(g) && (P.tagNameCheck instanceof RegExp &&
|
|
958
|
+
if (!st[g] && Nn(g) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
|
|
956
959
|
return !1;
|
|
957
|
-
if (
|
|
960
|
+
if (Ft && !pe[g]) {
|
|
958
961
|
const D = re(a) || a.parentNode, H = te(a) || a.childNodes;
|
|
959
962
|
if (H && D) {
|
|
960
963
|
const j = H.length;
|
|
@@ -966,30 +969,30 @@ function ys() {
|
|
|
966
969
|
}
|
|
967
970
|
return oe(a), !0;
|
|
968
971
|
}
|
|
969
|
-
return a instanceof p &&
|
|
972
|
+
return a instanceof p && !$s(a) || (g === "noscript" || g === "noembed" || g === "noframes") && K(/<\/no(script|embed|frames)/i, a.innerHTML) ? (oe(a), !0) : (ve && a.nodeType === qe.text && (u = a.textContent, je([Ne, ze, $e], (D) => {
|
|
970
973
|
u = We(u, D, " ");
|
|
971
974
|
}), a.textContent !== u && (Ge(t.removed, {
|
|
972
975
|
element: a.cloneNode()
|
|
973
|
-
}), a.textContent = u)),
|
|
976
|
+
}), a.textContent = u)), xe(Z.afterSanitizeElements, a, null), !1);
|
|
974
977
|
}, "_sanitizeElements"), Ln = /* @__PURE__ */ h(function(a, u, g) {
|
|
975
|
-
if (mt[u] || wn && (u === "id" || u === "name") && (g in e || g in
|
|
978
|
+
if (mt[u] || wn && (u === "id" || u === "name") && (g in e || g in zs))
|
|
976
979
|
return !1;
|
|
977
|
-
const D =
|
|
978
|
-
if (!($t && !mt[u] &&
|
|
979
|
-
if (!(
|
|
980
|
+
const D = B[u] || we.attributeCheck instanceof Function && we.attributeCheck(u, a);
|
|
981
|
+
if (!($t && !mt[u] && K(zt, u))) {
|
|
982
|
+
if (!(bn && K(ft, u))) {
|
|
980
983
|
if (!D || mt[u]) {
|
|
981
984
|
if (
|
|
982
985
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
983
986
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
984
987
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
985
|
-
!(Nn(a) && (P.tagNameCheck instanceof RegExp &&
|
|
988
|
+
!(Nn(a) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, a) || P.tagNameCheck instanceof Function && P.tagNameCheck(a)) && (P.attributeNameCheck instanceof RegExp && K(P.attributeNameCheck, u) || P.attributeNameCheck instanceof Function && P.attributeNameCheck(u, a)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
986
989
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
987
|
-
u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp &&
|
|
990
|
+
u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, g) || P.tagNameCheck instanceof Function && P.tagNameCheck(g)))
|
|
988
991
|
) return !1;
|
|
989
992
|
} else if (!Ht[u]) {
|
|
990
|
-
if (!
|
|
991
|
-
if (!((u === "src" || u === "xlink:href" || u === "href") && a !== "script" &&
|
|
992
|
-
if (!(kn && !
|
|
993
|
+
if (!K(y, We(g, I, ""))) {
|
|
994
|
+
if (!((u === "src" || u === "xlink:href" || u === "href") && a !== "script" && Kn(g, "data:") === 0 && Sn[a])) {
|
|
995
|
+
if (!(kn && !K(gt, We(g, I, "")))) {
|
|
993
996
|
if (g)
|
|
994
997
|
return !1;
|
|
995
998
|
}
|
|
@@ -999,10 +1002,10 @@ function ys() {
|
|
|
999
1002
|
}
|
|
1000
1003
|
}
|
|
1001
1004
|
return !0;
|
|
1002
|
-
}, "_isValidAttribute"),
|
|
1003
|
-
return
|
|
1005
|
+
}, "_isValidAttribute"), Ps = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Nn = /* @__PURE__ */ h(function(a) {
|
|
1006
|
+
return !Ps[ct(a)] && K(k, a);
|
|
1004
1007
|
}, "_isBasicCustomElement"), zn = /* @__PURE__ */ h(function(a) {
|
|
1005
|
-
|
|
1008
|
+
xe(Z.beforeSanitizeAttributes, a, null);
|
|
1006
1009
|
const u = a.attributes;
|
|
1007
1010
|
if (!u || Yt(a))
|
|
1008
1011
|
return;
|
|
@@ -1010,18 +1013,18 @@ function ys() {
|
|
|
1010
1013
|
attrName: "",
|
|
1011
1014
|
attrValue: "",
|
|
1012
1015
|
keepAttr: !0,
|
|
1013
|
-
allowedAttributes:
|
|
1016
|
+
allowedAttributes: B,
|
|
1014
1017
|
forceKeepAttr: void 0
|
|
1015
1018
|
};
|
|
1016
1019
|
let D = u.length;
|
|
1017
1020
|
for (; D--; ) {
|
|
1018
|
-
const H = u[D], j = H.name, ie = H.namespaceURI, Te = H.value,
|
|
1019
|
-
let V = j === "value" ? Xt :
|
|
1020
|
-
if (g.attrName =
|
|
1021
|
+
const H = u[D], j = H.name, ie = H.namespaceURI, Te = H.value, be = W(j), Xt = Te;
|
|
1022
|
+
let V = j === "value" ? Xt : mr(Xt);
|
|
1023
|
+
if (g.attrName = be, g.attrValue = V, g.keepAttr = !0, g.forceKeepAttr = void 0, xe(Z.uponSanitizeAttribute, a, g), V = g.attrValue, vn && (be === "id" || be === "name") && Kn(V, Tn) !== 0 && (Ie(j, a), V = Tn + V), rt && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
|
|
1021
1024
|
Ie(j, a);
|
|
1022
1025
|
continue;
|
|
1023
1026
|
}
|
|
1024
|
-
if (
|
|
1027
|
+
if (be === "attributename" && Xn(V, "href")) {
|
|
1025
1028
|
Ie(j, a);
|
|
1026
1029
|
continue;
|
|
1027
1030
|
}
|
|
@@ -1031,7 +1034,7 @@ function ys() {
|
|
|
1031
1034
|
Ie(j, a);
|
|
1032
1035
|
continue;
|
|
1033
1036
|
}
|
|
1034
|
-
if (!yn &&
|
|
1037
|
+
if (!yn && K(/\/>/i, V)) {
|
|
1035
1038
|
Ie(j, a);
|
|
1036
1039
|
continue;
|
|
1037
1040
|
}
|
|
@@ -1039,12 +1042,12 @@ function ys() {
|
|
|
1039
1042
|
V = We(V, Pn, " ");
|
|
1040
1043
|
});
|
|
1041
1044
|
const $n = W(a.nodeName);
|
|
1042
|
-
if (!Ln($n,
|
|
1045
|
+
if (!Ln($n, be, V)) {
|
|
1043
1046
|
Ie(j, a);
|
|
1044
1047
|
continue;
|
|
1045
1048
|
}
|
|
1046
1049
|
if ($ && typeof f == "object" && typeof f.getAttributeType == "function" && !ie)
|
|
1047
|
-
switch (f.getAttributeType($n,
|
|
1050
|
+
switch (f.getAttributeType($n, be)) {
|
|
1048
1051
|
case "TrustedHTML": {
|
|
1049
1052
|
V = $.createHTML(V);
|
|
1050
1053
|
break;
|
|
@@ -1056,18 +1059,18 @@ function ys() {
|
|
|
1056
1059
|
}
|
|
1057
1060
|
if (V !== Xt)
|
|
1058
1061
|
try {
|
|
1059
|
-
ie ? a.setAttributeNS(ie, j, V) : a.setAttribute(j, V), Yt(a) ? oe(a) :
|
|
1062
|
+
ie ? a.setAttributeNS(ie, j, V) : a.setAttribute(j, V), Yt(a) ? oe(a) : Zn(t.removed);
|
|
1060
1063
|
} catch {
|
|
1061
1064
|
Ie(j, a);
|
|
1062
1065
|
}
|
|
1063
1066
|
}
|
|
1064
|
-
|
|
1067
|
+
xe(Z.afterSanitizeAttributes, a, null);
|
|
1065
1068
|
}, "_sanitizeAttributes"), Zt = /* @__PURE__ */ h(function(a) {
|
|
1066
1069
|
let u = null;
|
|
1067
1070
|
const g = Dn(a);
|
|
1068
|
-
for (
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
+
for (xe(Z.beforeSanitizeShadowDOM, a, null); u = g.nextNode(); )
|
|
1072
|
+
xe(Z.uponSanitizeShadowNode, u, null), Mn(u), zn(u), u.content instanceof s && Zt(u.content);
|
|
1073
|
+
xe(Z.afterSanitizeShadowDOM, a, null);
|
|
1071
1074
|
}, "_sanitizeShadowDOM"), vt = /* @__PURE__ */ h(function(a) {
|
|
1072
1075
|
if (a.nodeType === qe.element && a.shadowRoot instanceof s) {
|
|
1073
1076
|
const D = a.shadowRoot;
|
|
@@ -1085,15 +1088,15 @@ function ys() {
|
|
|
1085
1088
|
}, "_sanitizeAttachedShadowRoots");
|
|
1086
1089
|
return t.sanitize = function(w) {
|
|
1087
1090
|
let a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, g = null, D = null, H = null;
|
|
1088
|
-
if (jt = !w, jt && (w = "<!-->"), typeof w != "string" && !wt(w) && (w =
|
|
1091
|
+
if (jt = !w, jt && (w = "<!-->"), typeof w != "string" && !wt(w) && (w = wr(w), typeof w != "string"))
|
|
1089
1092
|
throw St("dirty is not a string, aborting");
|
|
1090
1093
|
if (!t.isSupported)
|
|
1091
1094
|
return w;
|
|
1092
1095
|
if (Pt || Vt(a), t.removed = [], typeof w == "string" && (it = !1), it) {
|
|
1093
1096
|
const Te = w.nodeName;
|
|
1094
1097
|
if (typeof Te == "string") {
|
|
1095
|
-
const
|
|
1096
|
-
if (!E[
|
|
1098
|
+
const be = W(Te);
|
|
1099
|
+
if (!E[be] || st[be])
|
|
1097
1100
|
throw St("root node is forbidden and cannot be sanitized in-place");
|
|
1098
1101
|
}
|
|
1099
1102
|
vt(w);
|
|
@@ -1102,29 +1105,29 @@ function ys() {
|
|
|
1102
1105
|
else {
|
|
1103
1106
|
if (!Pe && !ve && !Re && // eslint-disable-next-line unicorn/prefer-includes
|
|
1104
1107
|
w.indexOf("<") === -1)
|
|
1105
|
-
return $ &&
|
|
1108
|
+
return $ && bt ? $.createHTML(w) : w;
|
|
1106
1109
|
if (u = Cn(w), !u)
|
|
1107
|
-
return Pe ? null :
|
|
1110
|
+
return Pe ? null : bt ? Y : "";
|
|
1108
1111
|
}
|
|
1109
|
-
u &&
|
|
1112
|
+
u && Bt && oe(u.firstChild);
|
|
1110
1113
|
const j = Dn(it ? w : u);
|
|
1111
1114
|
for (; D = j.nextNode(); )
|
|
1112
|
-
|
|
1115
|
+
Mn(D), zn(D), D.content instanceof s && Zt(D.content);
|
|
1113
1116
|
if (it)
|
|
1114
|
-
return ve &&
|
|
1117
|
+
return ve && On(w), w;
|
|
1115
1118
|
if (Pe) {
|
|
1116
|
-
if (ve &&
|
|
1119
|
+
if (ve && On(u), xt)
|
|
1117
1120
|
for (H = pt.call(u.ownerDocument); u.firstChild; )
|
|
1118
1121
|
H.appendChild(u.firstChild);
|
|
1119
1122
|
else
|
|
1120
1123
|
H = u;
|
|
1121
|
-
return (
|
|
1124
|
+
return (B.shadowroot || B.shadowrootmode) && (H = dt.call(n, H, !0)), H;
|
|
1122
1125
|
}
|
|
1123
1126
|
let ie = Re ? u.outerHTML : u.innerHTML;
|
|
1124
|
-
return Re && E["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name &&
|
|
1127
|
+
return Re && E["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(Or, u.ownerDocument.doctype.name) && (ie = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1125
1128
|
` + ie), ve && je([Ne, ze, $e], (Te) => {
|
|
1126
1129
|
ie = We(ie, Te, " ");
|
|
1127
|
-
}), $ &&
|
|
1130
|
+
}), $ && bt ? $.createHTML(ie) : ie;
|
|
1128
1131
|
}, t.setConfig = function() {
|
|
1129
1132
|
let w = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1130
1133
|
Vt(w), Pt = !0;
|
|
@@ -1135,31 +1138,31 @@ function ys() {
|
|
|
1135
1138
|
const g = W(w), D = W(a);
|
|
1136
1139
|
return Ln(g, D, u);
|
|
1137
1140
|
}, t.addHook = function(w, a) {
|
|
1138
|
-
typeof a == "function" && Ge(
|
|
1141
|
+
typeof a == "function" && Ge(Z[w], a);
|
|
1139
1142
|
}, t.removeHook = function(w, a) {
|
|
1140
1143
|
if (a !== void 0) {
|
|
1141
|
-
const u =
|
|
1142
|
-
return u === -1 ? void 0 :
|
|
1144
|
+
const u = fr(Z[w], a);
|
|
1145
|
+
return u === -1 ? void 0 : gr(Z[w], u, 1)[0];
|
|
1143
1146
|
}
|
|
1144
|
-
return
|
|
1147
|
+
return Zn(Z[w]);
|
|
1145
1148
|
}, t.removeHooks = function(w) {
|
|
1146
|
-
|
|
1149
|
+
Z[w] = [];
|
|
1147
1150
|
}, t.removeAllHooks = function() {
|
|
1148
|
-
|
|
1151
|
+
Z = is();
|
|
1149
1152
|
}, t;
|
|
1150
1153
|
}
|
|
1151
|
-
h(
|
|
1152
|
-
var
|
|
1154
|
+
h(ws, "createDOMPurify");
|
|
1155
|
+
var zr = ws();
|
|
1153
1156
|
function on() {
|
|
1154
1157
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1155
1158
|
}
|
|
1156
1159
|
h(on, "M");
|
|
1157
1160
|
var Le = on();
|
|
1158
|
-
function
|
|
1161
|
+
function vs(i) {
|
|
1159
1162
|
Le = i;
|
|
1160
1163
|
}
|
|
1161
|
-
h(
|
|
1162
|
-
var
|
|
1164
|
+
h(vs, "N");
|
|
1165
|
+
var Oe = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1163
1166
|
function Ve(i) {
|
|
1164
1167
|
let t = [];
|
|
1165
1168
|
return (e) => {
|
|
@@ -1176,22 +1179,22 @@ function L(i, t = "") {
|
|
|
1176
1179
|
return n;
|
|
1177
1180
|
}
|
|
1178
1181
|
h(L, "d");
|
|
1179
|
-
var
|
|
1182
|
+
var $r = ((i = "") => {
|
|
1180
1183
|
try {
|
|
1181
1184
|
return !!new RegExp("(?<=1)(?<!1)" + i);
|
|
1182
1185
|
} catch {
|
|
1183
1186
|
return !1;
|
|
1184
1187
|
}
|
|
1185
|
-
})(), J = { 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((i) => new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ve((i) => new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}#`)), htmlBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}>`)) },
|
|
1186
|
-
]`).replace("lheading",
|
|
1188
|
+
})(), J = { 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((i) => new RegExp(`^( {0,3}${i})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)), hrRegex: Ve((i) => new RegExp(`^ {0,${i}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)), fencesBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}(?:\`\`\`|~~~)`)), headingBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}#`)), htmlBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}<(?:[a-z].*>|!--)`, "i")), blockquoteBeginRegex: Ve((i) => new RegExp(`^ {0,${i}}>`)) }, Pr = /^(?:[ \t]*(?:\n|$))+/, Br = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Fr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ht = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Ur = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, cn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Ts = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Ss = L(Ts).replace(/bull/g, cn).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(), Hr = L(Ts).replace(/bull/g, cn).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(), un = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, jr = /^[^\n]+/, hn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Gr = L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", hn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Wr = L(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, cn).getRegex(), Lt = "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", pn = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, qr = L("^ {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", pn).replace("tag", Lt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), As = L(un).replace("hr", ht).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", Lt).getRegex(), Vr = L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", As).getRegex(), dn = { blockquote: Vr, code: Br, def: Gr, fences: Fr, heading: Ur, hr: ht, html: qr, lheading: Ss, list: Wr, newline: Pr, paragraph: As, table: Oe, text: jr }, as = L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ht).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", Lt).getRegex(), Yr = { ...dn, lheading: Hr, table: as, paragraph: L(un).replace("hr", ht).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", as).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", Lt).getRegex() }, Zr = { ...dn, html: L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", pn).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: Oe, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: L(un).replace("hr", ht).replace("heading", ` *#{1,6} *[^
|
|
1189
|
+
]`).replace("lheading", Ss).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Xr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Kr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Es = /^( {2,}|\\)\n(?!\s*$)/, Qr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, et = /[\p{P}\p{S}]/u, Nt = /[\s\p{P}\p{S}]/u, fn = /[^\s\p{P}\p{S}]/u, Jr = L(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Nt).getRegex(), _s = /(?!~)[\p{P}\p{S}]/u, ei = /(?!~)[\s\p{P}\p{S}]/u, ti = /(?:[^\s\p{P}\p{S}]|~)/u, ni = L(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", $r ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Rs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, si = L(Rs, "u").replace(/punct/g, et).getRegex(), ri = L(Rs, "u").replace(/punct/g, _s).getRegex(), Is = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ii = L(Is, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), ai = L(Is, "gu").replace(/notPunctSpace/g, ti).replace(/punctSpace/g, ei).replace(/punct/g, _s).getRegex(), li = L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), oi = L(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, et).getRegex(), ci = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", ui = L(ci, "gu").replace(/notPunctSpace/g, fn).replace(/punctSpace/g, Nt).replace(/punct/g, et).getRegex(), hi = L(/\\(punct)/, "gu").replace(/punct/g, et).getRegex(), pi = L(/^<(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(), di = L(pn).replace("(?:-->|$)", "-->").getRegex(), fi = L("^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", di).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), Ct = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, gi = L(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", Ct).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Cs = L(/^!?\[(label)\]\[(ref)\]/).replace("label", Ct).replace("ref", hn).getRegex(), Ds = L(/^!?\[(ref)\](?:\[\])?/).replace("ref", hn).getRegex(), mi = L("reflink|nolink(?!\\()", "g").replace("reflink", Cs).replace("nolink", Ds).getRegex(), ls = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, gn = { _backpedal: Oe, anyPunctuation: hi, autolink: pi, blockSkip: ni, br: Es, code: Kr, del: Oe, delLDelim: Oe, delRDelim: Oe, emStrongLDelim: si, emStrongRDelimAst: ii, emStrongRDelimUnd: li, escape: Xr, link: gi, nolink: Ds, punctuation: Jr, reflink: Cs, reflinkSearch: mi, tag: fi, text: Qr, url: Oe }, xi = { ...gn, link: L(/^!?\[(label)\]\((.*?)\)/).replace("label", Ct).getRegex(), reflink: L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Ct).getRegex() }, an = { ...gn, emStrongRDelimAst: ai, emStrongLDelim: ri, delLDelim: oi, delRDelim: ui, url: L(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", ls).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: L(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", ls).getRegex() }, bi = { ...an, br: L(Es).replace("{2,}", "*").getRegex(), text: L(an.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, Et = { normal: dn, gfm: Yr, pedantic: Zr }, ot = { normal: gn, gfm: an, breaks: bi, pedantic: xi }, ki = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, os = /* @__PURE__ */ h((i) => ki[i], "ge");
|
|
1187
1190
|
function fe(i, t) {
|
|
1188
1191
|
if (t) {
|
|
1189
|
-
if (J.escapeTest.test(i)) return i.replace(J.escapeReplace,
|
|
1190
|
-
} else if (J.escapeTestNoEncode.test(i)) return i.replace(J.escapeReplaceNoEncode,
|
|
1192
|
+
if (J.escapeTest.test(i)) return i.replace(J.escapeReplace, os);
|
|
1193
|
+
} else if (J.escapeTestNoEncode.test(i)) return i.replace(J.escapeReplaceNoEncode, os);
|
|
1191
1194
|
return i;
|
|
1192
1195
|
}
|
|
1193
1196
|
h(fe, "O");
|
|
1194
|
-
function
|
|
1197
|
+
function cs(i) {
|
|
1195
1198
|
try {
|
|
1196
1199
|
i = encodeURI(i).replace(J.percentDecode, "%");
|
|
1197
1200
|
} catch {
|
|
@@ -1199,8 +1202,8 @@ function os(i) {
|
|
|
1199
1202
|
}
|
|
1200
1203
|
return i;
|
|
1201
1204
|
}
|
|
1202
|
-
h(
|
|
1203
|
-
function
|
|
1205
|
+
h(cs, "V");
|
|
1206
|
+
function us(i, t) {
|
|
1204
1207
|
let e = i.replace(J.findPipe, (s, l, o) => {
|
|
1205
1208
|
let p = !1, c = l;
|
|
1206
1209
|
for (; --c >= 0 && o[c] === "\\"; ) p = !p;
|
|
@@ -1211,7 +1214,7 @@ function cs(i, t) {
|
|
|
1211
1214
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(J.slashPipe, "|");
|
|
1212
1215
|
return n;
|
|
1213
1216
|
}
|
|
1214
|
-
h(
|
|
1217
|
+
h(us, "Y");
|
|
1215
1218
|
function Se(i, t, e) {
|
|
1216
1219
|
let n = i.length;
|
|
1217
1220
|
if (n === 0) return "";
|
|
@@ -1221,15 +1224,15 @@ function Se(i, t, e) {
|
|
|
1221
1224
|
return i.slice(0, n - r);
|
|
1222
1225
|
}
|
|
1223
1226
|
h(Se, "$");
|
|
1224
|
-
function
|
|
1227
|
+
function hs(i) {
|
|
1225
1228
|
let t = i.split(`
|
|
1226
1229
|
`), e = t.length - 1;
|
|
1227
1230
|
for (; e >= 0 && J.blankLine.test(t[e]); ) e--;
|
|
1228
1231
|
return t.length - e <= 2 ? i : t.slice(0, e + 1).join(`
|
|
1229
1232
|
`);
|
|
1230
1233
|
}
|
|
1231
|
-
h(
|
|
1232
|
-
function
|
|
1234
|
+
h(hs, "ee");
|
|
1235
|
+
function yi(i, t) {
|
|
1233
1236
|
if (i.indexOf(t[1]) === -1) return -1;
|
|
1234
1237
|
let e = 0;
|
|
1235
1238
|
for (let n = 0; n < i.length; n++) if (i[n] === "\\") n++;
|
|
@@ -1237,8 +1240,8 @@ function ki(i, t) {
|
|
|
1237
1240
|
else if (i[n] === t[1] && (e--, e < 0)) return n;
|
|
1238
1241
|
return e > 0 ? -2 : -1;
|
|
1239
1242
|
}
|
|
1240
|
-
h(
|
|
1241
|
-
function
|
|
1243
|
+
h(yi, "fe");
|
|
1244
|
+
function wi(i, t = 0) {
|
|
1242
1245
|
let e = t, n = "";
|
|
1243
1246
|
for (let r of i) if (r === " ") {
|
|
1244
1247
|
let s = 4 - e % 4;
|
|
@@ -1246,15 +1249,15 @@ function yi(i, t = 0) {
|
|
|
1246
1249
|
} else n += r, e++;
|
|
1247
1250
|
return n;
|
|
1248
1251
|
}
|
|
1249
|
-
h(
|
|
1250
|
-
function
|
|
1252
|
+
h(wi, "me");
|
|
1253
|
+
function ps(i, t, e, n, r) {
|
|
1251
1254
|
let s = t.href, l = t.title || null, o = i[1].replace(r.other.outputLinkReplace, "$1");
|
|
1252
1255
|
n.state.inLink = !0;
|
|
1253
1256
|
let p = { type: i[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
1254
1257
|
return n.state.inLink = !1, p;
|
|
1255
1258
|
}
|
|
1256
|
-
h(
|
|
1257
|
-
function
|
|
1259
|
+
h(ps, "xe");
|
|
1260
|
+
function vi(i, t, e) {
|
|
1258
1261
|
let n = i.match(e.other.indentCodeCompensation);
|
|
1259
1262
|
if (n === null) return t;
|
|
1260
1263
|
let r = n[1];
|
|
@@ -1267,12 +1270,12 @@ function wi(i, t, e) {
|
|
|
1267
1270
|
}).join(`
|
|
1268
1271
|
`);
|
|
1269
1272
|
}
|
|
1270
|
-
h(
|
|
1273
|
+
h(vi, "st");
|
|
1271
1274
|
var Ze, Dt = (Ze = class {
|
|
1272
1275
|
constructor(t) {
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
+
O(this, "options");
|
|
1277
|
+
O(this, "rules");
|
|
1278
|
+
O(this, "lexer");
|
|
1276
1279
|
this.options = t || Le;
|
|
1277
1280
|
}
|
|
1278
1281
|
space(t) {
|
|
@@ -1282,14 +1285,14 @@ var Ze, Dt = (Ze = class {
|
|
|
1282
1285
|
code(t) {
|
|
1283
1286
|
let e = this.rules.block.code.exec(t);
|
|
1284
1287
|
if (e) {
|
|
1285
|
-
let n = this.options.pedantic ? e[0] :
|
|
1288
|
+
let n = this.options.pedantic ? e[0] : hs(e[0]), r = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
1286
1289
|
return { type: "code", raw: n, codeBlockStyle: "indented", text: r };
|
|
1287
1290
|
}
|
|
1288
1291
|
}
|
|
1289
1292
|
fences(t) {
|
|
1290
1293
|
let e = this.rules.block.fences.exec(t);
|
|
1291
1294
|
if (e) {
|
|
1292
|
-
let n = e[0], r =
|
|
1295
|
+
let n = e[0], r = vi(n, e[3] || "", this.rules);
|
|
1293
1296
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: r };
|
|
1294
1297
|
}
|
|
1295
1298
|
}
|
|
@@ -1322,27 +1325,27 @@ var Ze, Dt = (Ze = class {
|
|
|
1322
1325
|
else if (!o) p.push(n[c]);
|
|
1323
1326
|
else break;
|
|
1324
1327
|
n = n.slice(c);
|
|
1325
|
-
let
|
|
1326
|
-
`), d =
|
|
1328
|
+
let b = p.join(`
|
|
1329
|
+
`), d = b.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1327
1330
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1328
1331
|
r = r ? `${r}
|
|
1329
|
-
${
|
|
1332
|
+
${b}` : b, s = s ? `${s}
|
|
1330
1333
|
${d}` : d;
|
|
1331
1334
|
let m = this.lexer.state.top;
|
|
1332
1335
|
if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = m, n.length === 0) break;
|
|
1333
|
-
let
|
|
1334
|
-
if (
|
|
1335
|
-
if (
|
|
1336
|
-
let f =
|
|
1336
|
+
let x = l.at(-1);
|
|
1337
|
+
if (x?.type === "code") break;
|
|
1338
|
+
if (x?.type === "blockquote") {
|
|
1339
|
+
let f = x, v = f.raw + `
|
|
1337
1340
|
` + n.join(`
|
|
1338
1341
|
`), C = this.blockquote(v);
|
|
1339
1342
|
l[l.length - 1] = C, r = r.substring(0, r.length - f.raw.length) + C.raw, s = s.substring(0, s.length - f.text.length) + C.text;
|
|
1340
1343
|
break;
|
|
1341
|
-
} else if (
|
|
1342
|
-
let f =
|
|
1344
|
+
} else if (x?.type === "list") {
|
|
1345
|
+
let f = x, v = f.raw + `
|
|
1343
1346
|
` + n.join(`
|
|
1344
1347
|
`), C = this.list(v);
|
|
1345
|
-
l[l.length - 1] = C, r = r.substring(0, r.length -
|
|
1348
|
+
l[l.length - 1] = C, r = r.substring(0, r.length - x.raw.length) + C.raw, s = s.substring(0, s.length - f.raw.length) + C.raw, n = v.substring(l.at(-1).raw.length).split(`
|
|
1346
1349
|
`);
|
|
1347
1350
|
continue;
|
|
1348
1351
|
}
|
|
@@ -1357,31 +1360,31 @@ ${d}` : d;
|
|
|
1357
1360
|
n = r ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = r ? n : "[*+-]");
|
|
1358
1361
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1359
1362
|
for (; t; ) {
|
|
1360
|
-
let c = !1,
|
|
1363
|
+
let c = !1, b = "", d = "";
|
|
1361
1364
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1362
|
-
|
|
1363
|
-
let m =
|
|
1364
|
-
`, 1)[0], e[1].length),
|
|
1365
|
+
b = e[0], t = t.substring(b.length);
|
|
1366
|
+
let m = wi(e[2].split(`
|
|
1367
|
+
`, 1)[0], e[1].length), x = t.split(`
|
|
1365
1368
|
`, 1)[0], f = !m.trim(), v = 0;
|
|
1366
|
-
if (this.options.pedantic ? (v = 2, d = m.trimStart()) : f ? v = e[1].length + 1 : (v = m.search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, d = m.slice(v), v += e[1].length), f && this.rules.other.blankLine.test(
|
|
1367
|
-
`, t = t.substring(
|
|
1369
|
+
if (this.options.pedantic ? (v = 2, d = m.trimStart()) : f ? v = e[1].length + 1 : (v = m.search(this.rules.other.nonSpaceChar), v = v > 4 ? 1 : v, d = m.slice(v), v += e[1].length), f && this.rules.other.blankLine.test(x) && (b += x + `
|
|
1370
|
+
`, t = t.substring(x.length + 1), c = !0), !c) {
|
|
1368
1371
|
let C = this.rules.other.nextBulletRegex(v), z = this.rules.other.hrRegex(v), ee = this.rules.other.fencesBeginRegex(v), te = this.rules.other.headingBeginRegex(v), re = this.rules.other.htmlBeginRegex(v), ge = this.rules.other.blockquoteBeginRegex(v);
|
|
1369
1372
|
for (; t; ) {
|
|
1370
1373
|
let $ = t.split(`
|
|
1371
|
-
`, 1)[0],
|
|
1372
|
-
if (
|
|
1373
|
-
if (
|
|
1374
|
-
` +
|
|
1374
|
+
`, 1)[0], Y;
|
|
1375
|
+
if (x = $, this.options.pedantic ? (x = x.replace(this.rules.other.listReplaceNesting, " "), Y = x) : Y = x.replace(this.rules.other.tabCharGlobal, " "), ee.test(x) || te.test(x) || re.test(x) || ge.test(x) || C.test(x) || z.test(x)) break;
|
|
1376
|
+
if (Y.search(this.rules.other.nonSpaceChar) >= v || !x.trim()) d += `
|
|
1377
|
+
` + Y.slice(v);
|
|
1375
1378
|
else {
|
|
1376
1379
|
if (f || m.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ee.test(m) || te.test(m) || z.test(m)) break;
|
|
1377
1380
|
d += `
|
|
1378
|
-
` +
|
|
1381
|
+
` + x;
|
|
1379
1382
|
}
|
|
1380
|
-
f = !
|
|
1381
|
-
`, t = t.substring($.length + 1), m =
|
|
1383
|
+
f = !x.trim(), b += $ + `
|
|
1384
|
+
`, t = t.substring($.length + 1), m = Y.slice(v);
|
|
1382
1385
|
}
|
|
1383
1386
|
}
|
|
1384
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1387
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(b) && (o = !0)), s.items.push({ type: "list_item", raw: b, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), s.raw += b;
|
|
1385
1388
|
}
|
|
1386
1389
|
let p = s.items.at(-1);
|
|
1387
1390
|
if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
|
|
@@ -1389,9 +1392,9 @@ ${d}` : d;
|
|
|
1389
1392
|
s.raw = s.raw.trimEnd();
|
|
1390
1393
|
for (let c of s.items) {
|
|
1391
1394
|
this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
|
|
1392
|
-
let
|
|
1393
|
-
if (c.task && (
|
|
1394
|
-
c.text = c.text.replace(this.rules.other.listReplaceTask, ""),
|
|
1395
|
+
let b = c.tokens[0];
|
|
1396
|
+
if (c.task && (b?.type === "text" || b?.type === "paragraph")) {
|
|
1397
|
+
c.text = c.text.replace(this.rules.other.listReplaceTask, ""), b.raw = b.raw.replace(this.rules.other.listReplaceTask, ""), b.text = b.text.replace(this.rules.other.listReplaceTask, "");
|
|
1395
1398
|
for (let m = this.lexer.inlineQueue.length - 1; m >= 0; m--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[m].src)) {
|
|
1396
1399
|
this.lexer.inlineQueue[m].src = this.lexer.inlineQueue[m].src.replace(this.rules.other.listReplaceTask, "");
|
|
1397
1400
|
break;
|
|
@@ -1403,13 +1406,13 @@ ${d}` : d;
|
|
|
1403
1406
|
}
|
|
1404
1407
|
} else c.task && (c.task = !1);
|
|
1405
1408
|
if (!s.loose) {
|
|
1406
|
-
let d = c.tokens.filter((
|
|
1409
|
+
let d = c.tokens.filter((x) => x.type === "space"), m = d.length > 0 && d.some((x) => this.rules.other.anyLine.test(x.raw));
|
|
1407
1410
|
s.loose = m;
|
|
1408
1411
|
}
|
|
1409
1412
|
}
|
|
1410
1413
|
if (s.loose) for (let c of s.items) {
|
|
1411
1414
|
c.loose = !0;
|
|
1412
|
-
for (let
|
|
1415
|
+
for (let b of c.tokens) b.type === "text" && (b.type = "paragraph");
|
|
1413
1416
|
}
|
|
1414
1417
|
return s;
|
|
1415
1418
|
}
|
|
@@ -1417,7 +1420,7 @@ ${d}` : d;
|
|
|
1417
1420
|
html(t) {
|
|
1418
1421
|
let e = this.rules.block.html.exec(t);
|
|
1419
1422
|
if (e) {
|
|
1420
|
-
let n =
|
|
1423
|
+
let n = hs(e[0]);
|
|
1421
1424
|
return { type: "html", block: !0, raw: n, pre: e[1] === "pre" || e[1] === "script" || e[1] === "style", text: n };
|
|
1422
1425
|
}
|
|
1423
1426
|
}
|
|
@@ -1432,13 +1435,13 @@ ${d}` : d;
|
|
|
1432
1435
|
table(t) {
|
|
1433
1436
|
let e = this.rules.block.table.exec(t);
|
|
1434
1437
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1435
|
-
let n =
|
|
1438
|
+
let n = us(e[1]), r = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1436
1439
|
`) : [], l = { type: "table", raw: Se(e[0], `
|
|
1437
1440
|
`), header: [], align: [], rows: [] };
|
|
1438
1441
|
if (n.length === r.length) {
|
|
1439
1442
|
for (let o of r) this.rules.other.tableAlignRight.test(o) ? l.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? l.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? l.align.push("left") : l.align.push(null);
|
|
1440
1443
|
for (let o = 0; o < n.length; o++) l.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: l.align[o] });
|
|
1441
|
-
for (let o of s) l.rows.push(
|
|
1444
|
+
for (let o of s) l.rows.push(us(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
|
|
1442
1445
|
return l;
|
|
1443
1446
|
}
|
|
1444
1447
|
}
|
|
@@ -1479,7 +1482,7 @@ ${d}` : d;
|
|
|
1479
1482
|
let l = Se(n.slice(0, -1), "\\");
|
|
1480
1483
|
if ((n.length - l.length) % 2 === 0) return;
|
|
1481
1484
|
} else {
|
|
1482
|
-
let l =
|
|
1485
|
+
let l = yi(e[2], "()");
|
|
1483
1486
|
if (l === -2) return;
|
|
1484
1487
|
if (l > -1) {
|
|
1485
1488
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
|
|
@@ -1491,7 +1494,7 @@ ${d}` : d;
|
|
|
1491
1494
|
let l = this.rules.other.pedanticHrefTitle.exec(r);
|
|
1492
1495
|
l && (r = l[1], s = l[3]);
|
|
1493
1496
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
1494
|
-
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)),
|
|
1497
|
+
return r = r.trim(), this.rules.other.startAngleBracket.test(r) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? r = r.slice(1) : r = r.slice(1, -1)), ps(e, { href: r && r.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
1495
1498
|
}
|
|
1496
1499
|
}
|
|
1497
1500
|
reflink(t, e) {
|
|
@@ -1502,14 +1505,14 @@ ${d}` : d;
|
|
|
1502
1505
|
let l = n[0].charAt(0);
|
|
1503
1506
|
return { type: "text", raw: l, text: l };
|
|
1504
1507
|
}
|
|
1505
|
-
return
|
|
1508
|
+
return ps(n, s, n[0], this.lexer, this.rules);
|
|
1506
1509
|
}
|
|
1507
1510
|
}
|
|
1508
1511
|
emStrong(t, e, n = "") {
|
|
1509
1512
|
let r = this.rules.inline.emStrongLDelim.exec(t);
|
|
1510
1513
|
if (!(!r || !r[1] && !r[2] && !r[3] && !r[4] || r[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(r[1] || r[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1511
|
-
let s = [...r[0]].length - 1, l, o, p = s, c = 0,
|
|
1512
|
-
for (
|
|
1514
|
+
let s = [...r[0]].length - 1, l, o, p = s, c = 0, b = r[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1515
|
+
for (b.lastIndex = 0, e = e.slice(-1 * t.length + s); (r = b.exec(e)) !== null; ) {
|
|
1513
1516
|
if (l = r[1] || r[2] || r[3] || r[4] || r[5] || r[6], !l) continue;
|
|
1514
1517
|
if (o = [...l].length, r[3] || r[4]) {
|
|
1515
1518
|
p += o;
|
|
@@ -1525,8 +1528,8 @@ ${d}` : d;
|
|
|
1525
1528
|
let f = m.slice(1, -1);
|
|
1526
1529
|
return { type: "em", raw: m, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
1527
1530
|
}
|
|
1528
|
-
let
|
|
1529
|
-
return { type: "strong", raw: m, text:
|
|
1531
|
+
let x = m.slice(2, -2);
|
|
1532
|
+
return { type: "strong", raw: m, text: x, tokens: this.lexer.inlineTokens(x) };
|
|
1530
1533
|
}
|
|
1531
1534
|
}
|
|
1532
1535
|
}
|
|
@@ -1553,7 +1556,7 @@ ${d}` : d;
|
|
|
1553
1556
|
}
|
|
1554
1557
|
if (p -= o, p > 0) continue;
|
|
1555
1558
|
o = Math.min(o, o + p);
|
|
1556
|
-
let
|
|
1559
|
+
let b = [...r[0]][0].length, d = t.slice(0, s + r.index + b + o), m = d.slice(s, -s);
|
|
1557
1560
|
return { type: "del", raw: d, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
1558
1561
|
}
|
|
1559
1562
|
}
|
|
@@ -1589,11 +1592,11 @@ ${d}` : d;
|
|
|
1589
1592
|
}
|
|
1590
1593
|
}, h(Ze, "w"), Ze), Ee, ue = (Ee = class {
|
|
1591
1594
|
constructor(t) {
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1595
|
+
O(this, "tokens");
|
|
1596
|
+
O(this, "options");
|
|
1597
|
+
O(this, "state");
|
|
1598
|
+
O(this, "inlineQueue");
|
|
1599
|
+
O(this, "tokenizer");
|
|
1597
1600
|
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Le, this.options.tokenizer = this.options.tokenizer || new Dt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1598
1601
|
let e = { other: J, block: Et.normal, inline: ot.normal };
|
|
1599
1602
|
this.options.pedantic ? (e.block = Et.pedantic, e.inline = ot.pedantic) : this.options.gfm && (e.block = Et.gfm, this.options.breaks ? e.inline = ot.breaks : e.inline = ot.gfm), this.tokenizer.rules = e;
|
|
@@ -1687,8 +1690,8 @@ ${d}` : d;
|
|
|
1687
1690
|
let l = t;
|
|
1688
1691
|
if (this.options.extensions?.startBlock) {
|
|
1689
1692
|
let o = 1 / 0, p = t.slice(1), c;
|
|
1690
|
-
this.options.extensions.startBlock.forEach((
|
|
1691
|
-
c =
|
|
1693
|
+
this.options.extensions.startBlock.forEach((b) => {
|
|
1694
|
+
c = b.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
1692
1695
|
}), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
|
|
1693
1696
|
}
|
|
1694
1697
|
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
|
|
@@ -1781,14 +1784,14 @@ ${d}` : d;
|
|
|
1781
1784
|
t = t.substring(c.raw.length), e.push(c);
|
|
1782
1785
|
continue;
|
|
1783
1786
|
}
|
|
1784
|
-
let
|
|
1787
|
+
let b = t;
|
|
1785
1788
|
if (this.options.extensions?.startInline) {
|
|
1786
|
-
let d = 1 / 0, m = t.slice(1),
|
|
1789
|
+
let d = 1 / 0, m = t.slice(1), x;
|
|
1787
1790
|
this.options.extensions.startInline.forEach((f) => {
|
|
1788
|
-
|
|
1789
|
-
}), d < 1 / 0 && d >= 0 && (
|
|
1791
|
+
x = f.call({ lexer: this }, m), typeof x == "number" && x >= 0 && (d = Math.min(d, x));
|
|
1792
|
+
}), d < 1 / 0 && d >= 0 && (b = t.substring(0, d + 1));
|
|
1790
1793
|
}
|
|
1791
|
-
if (c = this.tokenizer.inlineText(
|
|
1794
|
+
if (c = this.tokenizer.inlineText(b)) {
|
|
1792
1795
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1793
1796
|
let d = e.at(-1);
|
|
1794
1797
|
d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
|
|
@@ -1806,10 +1809,10 @@ ${d}` : d;
|
|
|
1806
1809
|
if (this.options.silent) console.error(e);
|
|
1807
1810
|
else throw new Error(e);
|
|
1808
1811
|
}
|
|
1809
|
-
}, h(Ee, "l"), Ee), Xe,
|
|
1812
|
+
}, h(Ee, "l"), Ee), Xe, Ot = (Xe = class {
|
|
1810
1813
|
constructor(t) {
|
|
1811
|
-
|
|
1812
|
-
|
|
1814
|
+
O(this, "options");
|
|
1815
|
+
O(this, "parser");
|
|
1813
1816
|
this.options = t || Le;
|
|
1814
1817
|
}
|
|
1815
1818
|
space(t) {
|
|
@@ -1906,7 +1909,7 @@ ${t}</tr>
|
|
|
1906
1909
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1907
1910
|
}
|
|
1908
1911
|
link({ href: t, title: e, tokens: n }) {
|
|
1909
|
-
let r = this.parser.parseInline(n), s =
|
|
1912
|
+
let r = this.parser.parseInline(n), s = cs(t);
|
|
1910
1913
|
if (s === null) return r;
|
|
1911
1914
|
t = s;
|
|
1912
1915
|
let l = '<a href="' + t + '"';
|
|
@@ -1914,7 +1917,7 @@ ${t}</tr>
|
|
|
1914
1917
|
}
|
|
1915
1918
|
image({ href: t, title: e, text: n, tokens: r }) {
|
|
1916
1919
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1917
|
-
let s =
|
|
1920
|
+
let s = cs(t);
|
|
1918
1921
|
if (s === null) return fe(n);
|
|
1919
1922
|
t = s;
|
|
1920
1923
|
let l = `<img src="${t}" alt="${fe(n)}"`;
|
|
@@ -1956,10 +1959,10 @@ ${t}</tr>
|
|
|
1956
1959
|
}
|
|
1957
1960
|
}, h(Ke, "L"), Ke), _e, he = (_e = class {
|
|
1958
1961
|
constructor(t) {
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
this.options = t || Le, this.options.renderer = this.options.renderer || new
|
|
1962
|
+
O(this, "options");
|
|
1963
|
+
O(this, "renderer");
|
|
1964
|
+
O(this, "textRenderer");
|
|
1965
|
+
this.options = t || Le, this.options.renderer = this.options.renderer || new Ot(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new mn();
|
|
1963
1966
|
}
|
|
1964
1967
|
static parse(t, e) {
|
|
1965
1968
|
return new _e(e).parse(t);
|
|
@@ -2107,8 +2110,8 @@ ${t}</tr>
|
|
|
2107
2110
|
}
|
|
2108
2111
|
}, h(_e, "l"), _e), Ae, ut = (Ae = class {
|
|
2109
2112
|
constructor(t) {
|
|
2110
|
-
|
|
2111
|
-
|
|
2113
|
+
O(this, "options");
|
|
2114
|
+
O(this, "block");
|
|
2112
2115
|
this.options = t || Le;
|
|
2113
2116
|
}
|
|
2114
2117
|
preprocess(t) {
|
|
@@ -2129,18 +2132,18 @@ ${t}</tr>
|
|
|
2129
2132
|
provideParser(t = this.block) {
|
|
2130
2133
|
return t ? he.parse : he.parseInline;
|
|
2131
2134
|
}
|
|
2132
|
-
}, h(Ae, "P"),
|
|
2135
|
+
}, h(Ae, "P"), O(Ae, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), O(Ae, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Ae), Qe, Ti = (Qe = class {
|
|
2133
2136
|
constructor(...t) {
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2137
|
+
O(this, "defaults", on());
|
|
2138
|
+
O(this, "options", this.setOptions);
|
|
2139
|
+
O(this, "parse", this.parseMarkdown(!0));
|
|
2140
|
+
O(this, "parseInline", this.parseMarkdown(!1));
|
|
2141
|
+
O(this, "Parser", he);
|
|
2142
|
+
O(this, "Renderer", Ot);
|
|
2143
|
+
O(this, "TextRenderer", mn);
|
|
2144
|
+
O(this, "Lexer", ue);
|
|
2145
|
+
O(this, "Tokenizer", Dt);
|
|
2146
|
+
O(this, "Hooks", ut);
|
|
2144
2147
|
this.use(...t);
|
|
2145
2148
|
}
|
|
2146
2149
|
walkTokens(t, e) {
|
|
@@ -2187,14 +2190,14 @@ ${t}</tr>
|
|
|
2187
2190
|
}
|
|
2188
2191
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
2189
2192
|
}), r.extensions = e), n.renderer) {
|
|
2190
|
-
let s = this.defaults.renderer || new
|
|
2193
|
+
let s = this.defaults.renderer || new Ot(this.defaults);
|
|
2191
2194
|
for (let l in n.renderer) {
|
|
2192
2195
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
2193
2196
|
if (["options", "parser"].includes(l)) continue;
|
|
2194
2197
|
let o = l, p = n.renderer[o], c = s[o];
|
|
2195
|
-
s[o] = (...
|
|
2196
|
-
let d = p.apply(s,
|
|
2197
|
-
return d === !1 && (d = c.apply(s,
|
|
2198
|
+
s[o] = (...b) => {
|
|
2199
|
+
let d = p.apply(s, b);
|
|
2200
|
+
return d === !1 && (d = c.apply(s, b)), d || "";
|
|
2198
2201
|
};
|
|
2199
2202
|
}
|
|
2200
2203
|
r.renderer = s;
|
|
@@ -2205,9 +2208,9 @@ ${t}</tr>
|
|
|
2205
2208
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2206
2209
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2207
2210
|
let o = l, p = n.tokenizer[o], c = s[o];
|
|
2208
|
-
s[o] = (...
|
|
2209
|
-
let d = p.apply(s,
|
|
2210
|
-
return d === !1 && (d = c.apply(s,
|
|
2211
|
+
s[o] = (...b) => {
|
|
2212
|
+
let d = p.apply(s, b);
|
|
2213
|
+
return d === !1 && (d = c.apply(s, b)), d;
|
|
2211
2214
|
};
|
|
2212
2215
|
}
|
|
2213
2216
|
r.tokenizer = s;
|
|
@@ -2218,20 +2221,20 @@ ${t}</tr>
|
|
|
2218
2221
|
if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
|
|
2219
2222
|
if (["options", "block"].includes(l)) continue;
|
|
2220
2223
|
let o = l, p = n.hooks[o], c = s[o];
|
|
2221
|
-
ut.passThroughHooks.has(l) ? s[o] = (
|
|
2224
|
+
ut.passThroughHooks.has(l) ? s[o] = (b) => {
|
|
2222
2225
|
if (this.defaults.async && ut.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2223
|
-
let m = await p.call(s,
|
|
2226
|
+
let m = await p.call(s, b);
|
|
2224
2227
|
return c.call(s, m);
|
|
2225
2228
|
})();
|
|
2226
|
-
let d = p.call(s,
|
|
2229
|
+
let d = p.call(s, b);
|
|
2227
2230
|
return c.call(s, d);
|
|
2228
|
-
} : s[o] = (...
|
|
2231
|
+
} : s[o] = (...b) => {
|
|
2229
2232
|
if (this.defaults.async) return (async () => {
|
|
2230
|
-
let m = await p.apply(s,
|
|
2231
|
-
return m === !1 && (m = await c.apply(s,
|
|
2233
|
+
let m = await p.apply(s, b);
|
|
2234
|
+
return m === !1 && (m = await c.apply(s, b)), m;
|
|
2232
2235
|
})();
|
|
2233
|
-
let d = p.apply(s,
|
|
2234
|
-
return d === !1 && (d = c.apply(s,
|
|
2236
|
+
let d = p.apply(s, b);
|
|
2237
|
+
return d === !1 && (d = c.apply(s, b)), d;
|
|
2235
2238
|
};
|
|
2236
2239
|
}
|
|
2237
2240
|
r.hooks = s;
|
|
@@ -2264,8 +2267,8 @@ ${t}</tr>
|
|
|
2264
2267
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2265
2268
|
let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? ue.lex : ue.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
2266
2269
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2267
|
-
let
|
|
2268
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
2270
|
+
let b = await (s.hooks ? await s.hooks.provideParser(t) : t ? he.parse : he.parseInline)(c, s);
|
|
2271
|
+
return s.hooks ? await s.hooks.postprocess(b) : b;
|
|
2269
2272
|
})().catch(l);
|
|
2270
2273
|
try {
|
|
2271
2274
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
@@ -2289,26 +2292,26 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
2289
2292
|
throw n;
|
|
2290
2293
|
};
|
|
2291
2294
|
}
|
|
2292
|
-
}, h(Qe, "q"), Qe),
|
|
2295
|
+
}, h(Qe, "q"), Qe), Me = new Ti();
|
|
2293
2296
|
function N(i, t) {
|
|
2294
|
-
return
|
|
2297
|
+
return Me.parse(i, t);
|
|
2295
2298
|
}
|
|
2296
2299
|
h(N, "g");
|
|
2297
2300
|
N.options = N.setOptions = function(i) {
|
|
2298
|
-
return
|
|
2301
|
+
return Me.setOptions(i), N.defaults = Me.defaults, vs(N.defaults), N;
|
|
2299
2302
|
};
|
|
2300
2303
|
N.getDefaults = on;
|
|
2301
2304
|
N.defaults = Le;
|
|
2302
2305
|
N.use = function(...i) {
|
|
2303
|
-
return
|
|
2306
|
+
return Me.use(...i), N.defaults = Me.defaults, vs(N.defaults), N;
|
|
2304
2307
|
};
|
|
2305
2308
|
N.walkTokens = function(i, t) {
|
|
2306
|
-
return
|
|
2309
|
+
return Me.walkTokens(i, t);
|
|
2307
2310
|
};
|
|
2308
|
-
N.parseInline =
|
|
2311
|
+
N.parseInline = Me.parseInline;
|
|
2309
2312
|
N.Parser = he;
|
|
2310
2313
|
N.parser = he.parse;
|
|
2311
|
-
N.Renderer =
|
|
2314
|
+
N.Renderer = Ot;
|
|
2312
2315
|
N.TextRenderer = mn;
|
|
2313
2316
|
N.Lexer = ue;
|
|
2314
2317
|
N.lexer = ue.lex;
|
|
@@ -2322,7 +2325,7 @@ N.walkTokens;
|
|
|
2322
2325
|
N.parseInline;
|
|
2323
2326
|
he.parse;
|
|
2324
2327
|
ue.lex;
|
|
2325
|
-
const
|
|
2328
|
+
const Si = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
2326
2329
|
__name: "ChatRichText",
|
|
2327
2330
|
props: {
|
|
2328
2331
|
text: {},
|
|
@@ -2330,7 +2333,7 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2330
2333
|
streaming: { type: Boolean }
|
|
2331
2334
|
},
|
|
2332
2335
|
setup(i) {
|
|
2333
|
-
const t = i, e =
|
|
2336
|
+
const t = i, e = gs(t.text);
|
|
2334
2337
|
let n;
|
|
2335
2338
|
Je(
|
|
2336
2339
|
[() => t.text, () => t.streaming],
|
|
@@ -2343,7 +2346,7 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2343
2346
|
n = void 0, e.value = t.text;
|
|
2344
2347
|
}));
|
|
2345
2348
|
}
|
|
2346
|
-
),
|
|
2349
|
+
), ms(() => {
|
|
2347
2350
|
n !== void 0 && cancelAnimationFrame(n);
|
|
2348
2351
|
});
|
|
2349
2352
|
const r = new N.Renderer();
|
|
@@ -2364,17 +2367,17 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2364
2367
|
const l = e.value;
|
|
2365
2368
|
if (!l) return "";
|
|
2366
2369
|
const o = N.parse(l, { async: !1 });
|
|
2367
|
-
return
|
|
2370
|
+
return zr.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2368
2371
|
});
|
|
2369
2372
|
return (l, o) => (T(), A("div", {
|
|
2370
2373
|
class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", i.inverted ? "chat-msg-prose-invert" : ""]),
|
|
2371
2374
|
innerHTML: s.value
|
|
2372
|
-
}, null, 10,
|
|
2375
|
+
}, null, 10, Si));
|
|
2373
2376
|
}
|
|
2374
|
-
}),
|
|
2377
|
+
}), Ai = 80, Ei = /* @__PURE__ */ ke({
|
|
2375
2378
|
__name: "ChatScroller",
|
|
2376
2379
|
setup(i, { expose: t }) {
|
|
2377
|
-
const e =
|
|
2380
|
+
const e = Q(), n = Q();
|
|
2378
2381
|
let r = !0, s;
|
|
2379
2382
|
function l() {
|
|
2380
2383
|
const c = e.value;
|
|
@@ -2383,21 +2386,21 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2383
2386
|
h(l, "scrollToBottom");
|
|
2384
2387
|
function o() {
|
|
2385
2388
|
const c = e.value;
|
|
2386
|
-
c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <=
|
|
2389
|
+
c && (r = c.scrollHeight - c.scrollTop - c.clientHeight <= Ai);
|
|
2387
2390
|
}
|
|
2388
2391
|
h(o, "onScroll");
|
|
2389
2392
|
function p() {
|
|
2390
2393
|
r = !0, l();
|
|
2391
2394
|
}
|
|
2392
|
-
return h(p, "pin"), t({ pin: p }),
|
|
2395
|
+
return h(p, "pin"), t({ pin: p }), Mt(() => {
|
|
2393
2396
|
requestAnimationFrame(() => {
|
|
2394
2397
|
l(), requestAnimationFrame(l);
|
|
2395
2398
|
}), n.value && (s = new ResizeObserver(() => {
|
|
2396
2399
|
r && l();
|
|
2397
2400
|
}), s.observe(n.value));
|
|
2398
|
-
}),
|
|
2401
|
+
}), ms(() => {
|
|
2399
2402
|
s?.disconnect();
|
|
2400
|
-
}), (c,
|
|
2403
|
+
}), (c, b) => (T(), A("div", {
|
|
2401
2404
|
ref_key: "viewport",
|
|
2402
2405
|
ref: e,
|
|
2403
2406
|
class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
@@ -2411,35 +2414,35 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2411
2414
|
], 512)
|
|
2412
2415
|
], 544));
|
|
2413
2416
|
}
|
|
2414
|
-
}),
|
|
2417
|
+
}), _i = { class: "@container/chat flex flex-col h-full relative" }, Ri = {
|
|
2415
2418
|
key: 0,
|
|
2416
2419
|
class: "pb-4"
|
|
2417
|
-
},
|
|
2420
|
+
}, Ii = { class: "pt-4 pb-[120px] px-3 space-y-1" }, Ci = {
|
|
2418
2421
|
key: 0,
|
|
2419
2422
|
class: "flex flex-col items-center justify-center px-4 min-h-full"
|
|
2420
|
-
},
|
|
2423
|
+
}, Di = { class: "relative mb-4 size-20 @sm/chat:size-24" }, Oi = ["src", "alt"], Mi = ["title"], Li = {
|
|
2421
2424
|
key: 0,
|
|
2422
2425
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2423
|
-
},
|
|
2426
|
+
}, Ni = ["data-issue-code", "data-issue-bucket"], zi = { class: "max-w-[85%] min-w-0" }, $i = ["href"], Pi = ["data-test"], Bi = {
|
|
2424
2427
|
key: 0,
|
|
2425
2428
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2426
|
-
}, Fi = ["src", "alt"],
|
|
2429
|
+
}, Fi = ["src", "alt"], Ui = ["src", "alt"], Hi = ["src"], ji = ["href"], Gi = {
|
|
2427
2430
|
key: 1,
|
|
2428
2431
|
"data-test": "messaging-thinking-indicator",
|
|
2429
2432
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
2430
|
-
},
|
|
2433
|
+
}, Wi = ["src", "alt"], qi = {
|
|
2431
2434
|
key: 0,
|
|
2432
2435
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2433
|
-
},
|
|
2436
|
+
}, Vi = ["src", "alt"], Yi = { class: "max-w-20 truncate" }, Zi = ["onClick"], Xi = {
|
|
2434
2437
|
key: 0,
|
|
2435
2438
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2436
|
-
},
|
|
2439
|
+
}, Ki = ["disabled"], Qi = {
|
|
2437
2440
|
key: 0,
|
|
2438
2441
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2439
|
-
},
|
|
2442
|
+
}, Ji = {
|
|
2440
2443
|
key: 1,
|
|
2441
2444
|
class: "i-tabler-paperclip size-5"
|
|
2442
|
-
},
|
|
2445
|
+
}, ea = ["placeholder", "disabled"], ta = ["disabled"], da = /* @__PURE__ */ ke({
|
|
2443
2446
|
__name: "ElAgentChat",
|
|
2444
2447
|
props: {
|
|
2445
2448
|
chatController: {},
|
|
@@ -2459,11 +2462,11 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2459
2462
|
}, e = U(() => {
|
|
2460
2463
|
const I = { ...t[i.scope] };
|
|
2461
2464
|
return i.scope === "org" && i.scopeName && (I.label = i.scopeName, I.tooltip = `Visible to ${i.scopeName} members`), I;
|
|
2462
|
-
}), n =
|
|
2463
|
-
function
|
|
2465
|
+
}), n = Q(""), r = Q(!1), s = Q(), l = Q(), o = Q(), p = Q([]), c = Q(!1);
|
|
2466
|
+
function b(I) {
|
|
2464
2467
|
return I ? /\[[^\]]+\]\([^)]+\)/.test(I) : !1;
|
|
2465
2468
|
}
|
|
2466
|
-
h(
|
|
2469
|
+
h(b, "containsMarkdownLink");
|
|
2467
2470
|
function d(I) {
|
|
2468
2471
|
return I.sender === "system" && (!!I.issue || I.id === re.value);
|
|
2469
2472
|
}
|
|
@@ -2473,28 +2476,28 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2473
2476
|
return !E || E.sender !== y.sender;
|
|
2474
2477
|
}
|
|
2475
2478
|
h(m, "shouldShowAvatar");
|
|
2476
|
-
const
|
|
2479
|
+
const x = U(() => i.chatController?.textState.value), f = U(() => x.value?.isConnected ?? !1), v = U(() => x.value?.isThinking ?? !1), C = U(() => x.value?.connectionStatus === "disconnected" && !!x.value?.error), z = U(() => x.value?.connectionStatus !== "connected" && !x.value?.error), ee = U(() => x.value?.error), te = U(() => i.chatController?.sharedMessages.value ?? []), re = U(() => {
|
|
2477
2480
|
if (!v.value) return;
|
|
2478
2481
|
const I = te.value, k = I[I.length - 1];
|
|
2479
2482
|
return k?.sender === "agent" || k?.sender === "system" ? k.id : void 0;
|
|
2480
|
-
}), ge = U(() => v.value ? re.value === void 0 : !1), $ = U(() =>
|
|
2481
|
-
() =>
|
|
2482
|
-
), tt = U(() =>
|
|
2483
|
-
|
|
2483
|
+
}), ge = U(() => v.value ? re.value === void 0 : !1), $ = U(() => x.value?.sendBlockedReason), Y = U(() => !f.value || $.value !== void 0), me = U(() => C.value ? "Agent is offline" : z.value ? "Connecting..." : $.value === "agent_deleted" ? "This assistant was deleted" : $.value === "account" ? "Resolve the billing issue above to continue" : "Message"), ye = U(() => (n.value.trim() || p.value.length > 0) && !Y.value && !c.value), M = U(() => i.variant === "light"), pt = U(
|
|
2484
|
+
() => M.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2485
|
+
), tt = U(() => M.value ? "text-theme-300" : "text-white/30");
|
|
2486
|
+
Mt(async () => {
|
|
2484
2487
|
i.chatController && !f.value && await i.chatController.startTextConversation();
|
|
2485
2488
|
});
|
|
2486
2489
|
async function dt() {
|
|
2487
2490
|
const I = n.value.trim(), k = p.value.length > 0;
|
|
2488
|
-
if (!I && !k || !i.chatController ||
|
|
2491
|
+
if (!I && !k || !i.chatController || Y.value || c.value)
|
|
2489
2492
|
return;
|
|
2490
2493
|
const y = n.value, E = k ? [...p.value] : void 0;
|
|
2491
2494
|
n.value = "", p.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await i.chatController.sendChatMessage(y, E);
|
|
2492
2495
|
}
|
|
2493
2496
|
h(dt, "sendMessage");
|
|
2494
|
-
async function
|
|
2497
|
+
async function Z(I) {
|
|
2495
2498
|
I.key === "Enter" && !I.shiftKey && (I.preventDefault(), await dt());
|
|
2496
2499
|
}
|
|
2497
|
-
h(
|
|
2500
|
+
h(Z, "handleKeydown");
|
|
2498
2501
|
function Ne() {
|
|
2499
2502
|
l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
|
|
2500
2503
|
}
|
|
@@ -2511,8 +2514,8 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2511
2514
|
const E = await i.uploadFn(y);
|
|
2512
2515
|
p.value = [...p.value, E];
|
|
2513
2516
|
} catch (E) {
|
|
2514
|
-
const
|
|
2515
|
-
i.chatController?.notify(`Upload failed — ${
|
|
2517
|
+
const X = E instanceof Error ? E.message : "Couldn't attach that file.";
|
|
2518
|
+
i.chatController?.notify(`Upload failed — ${X}`);
|
|
2516
2519
|
} finally {
|
|
2517
2520
|
c.value = !1, k.value = "";
|
|
2518
2521
|
}
|
|
@@ -2530,42 +2533,42 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2530
2533
|
}
|
|
2531
2534
|
const y = I[k - 1], E = I[k];
|
|
2532
2535
|
if (!y?.timestamp || !E?.timestamp) return null;
|
|
2533
|
-
const
|
|
2534
|
-
return new Date(E.timestamp).getTime() -
|
|
2536
|
+
const X = new Date(y.timestamp).getTime();
|
|
2537
|
+
return new Date(E.timestamp).getTime() - X > 36e5 ? gt(new Date(E.timestamp)) : null;
|
|
2535
2538
|
}
|
|
2536
2539
|
h(ft, "shouldShowTimeDivider");
|
|
2537
2540
|
function gt(I) {
|
|
2538
2541
|
const k = /* @__PURE__ */ new Date(), y = I.toDateString() === k.toDateString(), E = new Date(k);
|
|
2539
2542
|
E.setDate(E.getDate() - 1);
|
|
2540
|
-
const
|
|
2541
|
-
if (y) return
|
|
2542
|
-
if (
|
|
2543
|
+
const X = I.toDateString() === E.toDateString(), B = I.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2544
|
+
if (y) return B;
|
|
2545
|
+
if (X) return `Yesterday, ${B}`;
|
|
2543
2546
|
const nt = I.getFullYear() === k.getFullYear();
|
|
2544
2547
|
return `${I.toLocaleDateString("en-US", {
|
|
2545
2548
|
weekday: "long",
|
|
2546
2549
|
month: "short",
|
|
2547
2550
|
day: "numeric",
|
|
2548
2551
|
...nt ? {} : { year: "numeric" }
|
|
2549
|
-
})}, ${
|
|
2552
|
+
})}, ${B}`;
|
|
2550
2553
|
}
|
|
2551
|
-
return h(gt, "formatTimeDivider"), (I, k) => (T(), A("div",
|
|
2552
|
-
|
|
2553
|
-
He(
|
|
2554
|
+
return h(gt, "formatTimeDivider"), (I, k) => (T(), A("div", _i, [
|
|
2555
|
+
M.value ? q("", !0) : (T(), A("div", Ri, [
|
|
2556
|
+
He(ir, {
|
|
2554
2557
|
agent: i.agent,
|
|
2555
2558
|
"is-online": f.value
|
|
2556
2559
|
}, null, 8, ["agent", "is-online"])
|
|
2557
2560
|
])),
|
|
2558
2561
|
C.value ? (T(), A("div", {
|
|
2559
2562
|
key: 1,
|
|
2560
|
-
class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm",
|
|
2563
|
+
class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", M.value ? "text-theme-400" : "text-white/60"])
|
|
2561
2564
|
}, [
|
|
2562
2565
|
S("i", {
|
|
2563
|
-
class: _(["i-heroicons-cloud-arrow-down size-8",
|
|
2566
|
+
class: _(["i-heroicons-cloud-arrow-down size-8", M.value ? "text-theme-300" : "text-white/40"])
|
|
2564
2567
|
}, null, 2),
|
|
2565
2568
|
S("span", null, ce(ee.value), 1)
|
|
2566
2569
|
], 2)) : z.value ? (T(), A("div", {
|
|
2567
2570
|
key: 2,
|
|
2568
|
-
class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm",
|
|
2571
|
+
class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", M.value ? "text-theme-400" : "text-theme-600"])
|
|
2569
2572
|
}, [
|
|
2570
2573
|
He(Hn, { class: "size-4" })
|
|
2571
2574
|
], 2)) : i.setupHint ? (T(), A("div", {
|
|
@@ -2575,35 +2578,35 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2575
2578
|
k[9] || (k[9] = S("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2576
2579
|
S("span", null, ce(i.setupHint), 1)
|
|
2577
2580
|
], 2)) : q("", !0),
|
|
2578
|
-
He(
|
|
2581
|
+
He(Ei, {
|
|
2579
2582
|
ref_key: "chatScroller",
|
|
2580
2583
|
ref: s,
|
|
2581
2584
|
class: "flex-1"
|
|
2582
2585
|
}, {
|
|
2583
|
-
default:
|
|
2584
|
-
S("div",
|
|
2585
|
-
te.value.length === 0 && !z.value && !C.value ? (T(), A("div",
|
|
2586
|
-
S("div",
|
|
2586
|
+
default: Us(() => [
|
|
2587
|
+
S("div", Ii, [
|
|
2588
|
+
te.value.length === 0 && !z.value && !C.value ? (T(), A("div", Ci, [
|
|
2589
|
+
S("div", Di, [
|
|
2587
2590
|
S("img", {
|
|
2588
2591
|
src: i.agent.avatarUrl.value,
|
|
2589
2592
|
alt: i.agent.displayName.value,
|
|
2590
|
-
class: _(["size-full rounded-full object-cover ring-1",
|
|
2591
|
-
}, null, 10,
|
|
2593
|
+
class: _(["size-full rounded-full object-cover ring-1", M.value ? "ring-black/5" : "ring-white/10"])
|
|
2594
|
+
}, null, 10, Oi),
|
|
2592
2595
|
f.value ? (T(), A("span", {
|
|
2593
2596
|
key: 0,
|
|
2594
|
-
class: _(["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",
|
|
2597
|
+
class: _(["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", M.value ? "bg-white" : "bg-theme-900"])
|
|
2595
2598
|
}, [...k[10] || (k[10] = [
|
|
2596
2599
|
S("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
2597
2600
|
])], 2)) : q("", !0)
|
|
2598
2601
|
]),
|
|
2599
2602
|
S("div", {
|
|
2600
|
-
class: _(["text-base @sm/chat:text-lg font-semibold",
|
|
2603
|
+
class: _(["text-base @sm/chat:text-lg font-semibold", M.value ? "text-theme-900" : "text-white"])
|
|
2601
2604
|
}, ce(i.agent.displayName.value), 3),
|
|
2602
2605
|
S("p", {
|
|
2603
2606
|
class: _(["mt-1 text-center text-xs @sm/chat:text-sm", tt.value])
|
|
2604
2607
|
}, ce(i.emptyStateMessage || "Type your message to get started."), 3),
|
|
2605
2608
|
S("div", {
|
|
2606
|
-
class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]",
|
|
2609
|
+
class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", M.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2607
2610
|
title: e.value.tooltip
|
|
2608
2611
|
}, [
|
|
2609
2612
|
S("i", {
|
|
@@ -2615,7 +2618,7 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2615
2618
|
(T(!0), A(De, null, Rt(te.value, (y, E) => (T(), A(De, {
|
|
2616
2619
|
key: y.id
|
|
2617
2620
|
}, [
|
|
2618
|
-
ft(te.value, E) ? (T(), A("div",
|
|
2621
|
+
ft(te.value, E) ? (T(), A("div", Li, [
|
|
2619
2622
|
S("div", {
|
|
2620
2623
|
class: _(["flex-1 h-px", pt.value])
|
|
2621
2624
|
}, null, 2),
|
|
@@ -2633,47 +2636,47 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2633
2636
|
"data-issue-bucket": y.issue?.bucket,
|
|
2634
2637
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
2635
2638
|
}, [
|
|
2636
|
-
S("div",
|
|
2639
|
+
S("div", zi, [
|
|
2637
2640
|
S("div", {
|
|
2638
|
-
class: _(["mb-1 pl-1 text-[11px] font-medium",
|
|
2641
|
+
class: _(["mb-1 pl-1 text-[11px] font-medium", M.value ? "text-theme-500" : "text-white/45"])
|
|
2639
2642
|
}, " System Message ", 2),
|
|
2640
2643
|
S("div", {
|
|
2641
|
-
class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content",
|
|
2644
|
+
class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", M.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
2642
2645
|
}, [
|
|
2643
|
-
y.text ? (T(),
|
|
2646
|
+
y.text ? (T(), Fn(_t, {
|
|
2644
2647
|
key: 0,
|
|
2645
2648
|
text: y.text,
|
|
2646
|
-
inverted: !
|
|
2649
|
+
inverted: !M.value,
|
|
2647
2650
|
streaming: y.id === re.value,
|
|
2648
2651
|
onClick: k[0] || (k[0] = Tt(() => {
|
|
2649
2652
|
}, ["stop"]))
|
|
2650
|
-
}, null, 8, ["text", "inverted", "streaming"])) : y.issue?.help ? (T(),
|
|
2653
|
+
}, null, 8, ["text", "inverted", "streaming"])) : y.issue?.help ? (T(), Fn(_t, {
|
|
2651
2654
|
key: 1,
|
|
2652
2655
|
text: y.issue.help,
|
|
2653
|
-
inverted: !
|
|
2656
|
+
inverted: !M.value
|
|
2654
2657
|
}, null, 8, ["text", "inverted"])) : q("", !0),
|
|
2655
|
-
y.issue?.actionUrl && !
|
|
2658
|
+
y.issue?.actionUrl && !b(y.text) ? (T(), A("a", {
|
|
2656
2659
|
key: 2,
|
|
2657
2660
|
href: y.issue.actionUrl,
|
|
2658
2661
|
"data-test": "messaging-system-msg-action",
|
|
2659
|
-
class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1",
|
|
2662
|
+
class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", M.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
2660
2663
|
onClick: k[1] || (k[1] = Tt(() => {
|
|
2661
2664
|
}, ["stop"]))
|
|
2662
2665
|
}, [
|
|
2663
2666
|
Un(ce(y.issue.actionLabel) + " ", 1),
|
|
2664
2667
|
k[11] || (k[11] = S("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2665
|
-
], 10,
|
|
2668
|
+
], 10, $i)) : q("", !0)
|
|
2666
2669
|
], 2)
|
|
2667
2670
|
])
|
|
2668
|
-
], 8,
|
|
2671
|
+
], 8, Ni)) : y.sender === "system" ? (T(), A("div", {
|
|
2669
2672
|
key: 2,
|
|
2670
2673
|
"data-test": "messaging-system-status-msg",
|
|
2671
|
-
class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed",
|
|
2674
|
+
class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", M.value ? "text-theme-500" : "text-white/60"])
|
|
2672
2675
|
}, [
|
|
2673
2676
|
k[12] || (k[12] = S("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
2674
2677
|
He(_t, {
|
|
2675
2678
|
text: y.text,
|
|
2676
|
-
inverted: !
|
|
2679
|
+
inverted: !M.value,
|
|
2677
2680
|
onClick: k[2] || (k[2] = Tt(() => {
|
|
2678
2681
|
}, ["stop"]))
|
|
2679
2682
|
}, null, 8, ["text", "inverted"])
|
|
@@ -2686,12 +2689,12 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2686
2689
|
"mb-4": m(te.value, E)
|
|
2687
2690
|
}])
|
|
2688
2691
|
}, [
|
|
2689
|
-
y.sender === "agent" ? (T(), A("div",
|
|
2692
|
+
y.sender === "agent" ? (T(), A("div", Bi, [
|
|
2690
2693
|
m(te.value, E) ? (T(), A("img", {
|
|
2691
2694
|
key: 0,
|
|
2692
2695
|
src: i.agent.avatarUrl.value,
|
|
2693
2696
|
alt: i.agent.displayName.value,
|
|
2694
|
-
class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm",
|
|
2697
|
+
class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", M.value ? "ring-1 ring-black/5" : ""])
|
|
2695
2698
|
}, null, 10, Fi)) : q("", !0)
|
|
2696
2699
|
])) : q("", !0),
|
|
2697
2700
|
S("div", {
|
|
@@ -2701,57 +2704,57 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2701
2704
|
key: 0,
|
|
2702
2705
|
class: _(["mb-1 space-y-1", y.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2703
2706
|
}, [
|
|
2704
|
-
(T(!0), A(De, null, Rt(y.attachments, (
|
|
2705
|
-
|
|
2707
|
+
(T(!0), A(De, null, Rt(y.attachments, (X, B) => (T(), A(De, { key: B }, [
|
|
2708
|
+
X.type === "image" ? (T(), A("img", {
|
|
2706
2709
|
key: 0,
|
|
2707
|
-
src:
|
|
2708
|
-
alt:
|
|
2710
|
+
src: X.src,
|
|
2711
|
+
alt: X.filename,
|
|
2709
2712
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2710
|
-
}, null, 8,
|
|
2713
|
+
}, null, 8, Ui)) : X.type === "audio" ? (T(), A("audio", {
|
|
2711
2714
|
key: 1,
|
|
2712
|
-
src:
|
|
2715
|
+
src: X.src,
|
|
2713
2716
|
controls: "",
|
|
2714
2717
|
class: "max-w-full"
|
|
2715
|
-
}, null, 8,
|
|
2718
|
+
}, null, 8, Hi)) : (T(), A("a", {
|
|
2716
2719
|
key: 2,
|
|
2717
|
-
href:
|
|
2720
|
+
href: X.src,
|
|
2718
2721
|
target: "_blank",
|
|
2719
2722
|
rel: "noopener",
|
|
2720
|
-
class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
2723
|
+
class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", M.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2721
2724
|
}, [
|
|
2722
2725
|
k[13] || (k[13] = S("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2723
|
-
Un(" " + ce(
|
|
2724
|
-
], 10,
|
|
2726
|
+
Un(" " + ce(X.filename), 1)
|
|
2727
|
+
], 10, ji))
|
|
2725
2728
|
], 64))), 128))
|
|
2726
2729
|
], 2)) : q("", !0),
|
|
2727
2730
|
y.text ? (T(), A("div", {
|
|
2728
2731
|
key: 1,
|
|
2729
2732
|
class: _(["rounded-2xl px-3.5 py-2", [
|
|
2730
|
-
y.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" :
|
|
2733
|
+
y.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : M.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]"
|
|
2731
2734
|
]])
|
|
2732
2735
|
}, [
|
|
2733
2736
|
He(_t, {
|
|
2734
2737
|
text: y.text,
|
|
2735
|
-
inverted: y.sender === "user" || !
|
|
2738
|
+
inverted: y.sender === "user" || !M.value,
|
|
2736
2739
|
streaming: y.id === re.value,
|
|
2737
2740
|
onClick: k[3] || (k[3] = Tt(() => {
|
|
2738
2741
|
}, ["stop"]))
|
|
2739
2742
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
2740
2743
|
], 2)) : q("", !0)
|
|
2741
2744
|
], 2)
|
|
2742
|
-
], 10,
|
|
2745
|
+
], 10, Pi))
|
|
2743
2746
|
], 64))), 128)),
|
|
2744
|
-
ge.value ? (T(), A("div",
|
|
2747
|
+
ge.value ? (T(), A("div", Gi, [
|
|
2745
2748
|
S("img", {
|
|
2746
2749
|
src: i.agent.avatarUrl.value,
|
|
2747
2750
|
alt: i.agent.displayName.value,
|
|
2748
|
-
class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm",
|
|
2749
|
-
}, null, 10,
|
|
2751
|
+
class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", M.value ? "ring-1 ring-black/5" : ""])
|
|
2752
|
+
}, null, 10, Wi),
|
|
2750
2753
|
S("div", {
|
|
2751
|
-
class: _(["rounded-2xl px-3.5 py-2.5 flex items-center",
|
|
2754
|
+
class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", M.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2752
2755
|
}, [
|
|
2753
2756
|
S("i", {
|
|
2754
|
-
class: _(["i-svg-spinners-3-dots-bounce size-7",
|
|
2757
|
+
class: _(["i-svg-spinners-3-dots-bounce size-7", M.value ? "text-theme-400" : "text-white/50"])
|
|
2755
2758
|
}, null, 2)
|
|
2756
2759
|
], 2)
|
|
2757
2760
|
])) : q("", !0)
|
|
@@ -2760,9 +2763,9 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2760
2763
|
_: 1
|
|
2761
2764
|
}, 512),
|
|
2762
2765
|
S("div", {
|
|
2763
|
-
class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3",
|
|
2766
|
+
class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", M.value ? "bg-gradient-to-t from-theme-50/90 via-theme-50/55 to-transparent" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2764
2767
|
}, [
|
|
2765
|
-
p.value.length > 0 ? (T(), A("div",
|
|
2768
|
+
p.value.length > 0 ? (T(), A("div", qi, [
|
|
2766
2769
|
(T(!0), A(De, null, Rt(p.value, (y, E) => (T(), A("div", {
|
|
2767
2770
|
key: E,
|
|
2768
2771
|
class: "relative shrink-0 group"
|
|
@@ -2771,22 +2774,22 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2771
2774
|
key: 0,
|
|
2772
2775
|
src: y.src,
|
|
2773
2776
|
alt: y.filename,
|
|
2774
|
-
class: _(["size-14 rounded-xl object-cover border",
|
|
2775
|
-
}, null, 10,
|
|
2777
|
+
class: _(["size-14 rounded-xl object-cover border", M.value ? "border-black/10" : "border-white/20"])
|
|
2778
|
+
}, null, 10, Vi)) : (T(), A("div", {
|
|
2776
2779
|
key: 1,
|
|
2777
|
-
class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border",
|
|
2780
|
+
class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", M.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2778
2781
|
}, [
|
|
2779
2782
|
k[14] || (k[14] = S("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2780
|
-
S("span",
|
|
2783
|
+
S("span", Yi, ce(y.filename), 1)
|
|
2781
2784
|
], 2)),
|
|
2782
2785
|
S("button", {
|
|
2783
2786
|
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",
|
|
2784
|
-
onClick: /* @__PURE__ */ h((
|
|
2787
|
+
onClick: /* @__PURE__ */ h((X) => zt(E), "onClick")
|
|
2785
2788
|
}, [...k[15] || (k[15] = [
|
|
2786
2789
|
S("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2787
|
-
])], 8,
|
|
2790
|
+
])], 8, Zi)
|
|
2788
2791
|
]))), 128)),
|
|
2789
|
-
c.value ? (T(), A("div",
|
|
2792
|
+
c.value ? (T(), A("div", Xi, [
|
|
2790
2793
|
He(Hn, { class: "size-5" })
|
|
2791
2794
|
])) : q("", !0)
|
|
2792
2795
|
])) : q("", !0),
|
|
@@ -2800,20 +2803,20 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2800
2803
|
onChange: $e
|
|
2801
2804
|
}, null, 544)) : q("", !0),
|
|
2802
2805
|
S("div", {
|
|
2803
|
-
class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200",
|
|
2806
|
+
class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", M.value ? r.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : r.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
2804
2807
|
}, [
|
|
2805
2808
|
S("button", {
|
|
2806
2809
|
class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
2807
2810
|
i.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
2808
|
-
|
|
2811
|
+
M.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
2809
2812
|
c.value ? "opacity-50 pointer-events-none" : ""
|
|
2810
2813
|
]]),
|
|
2811
|
-
disabled:
|
|
2814
|
+
disabled: Y.value || c.value || !i.uploadFn,
|
|
2812
2815
|
onClick: k[4] || (k[4] = (y) => i.uploadFn && ze())
|
|
2813
2816
|
}, [
|
|
2814
|
-
c.value ? (T(), A("i",
|
|
2815
|
-
], 10,
|
|
2816
|
-
|
|
2817
|
+
c.value ? (T(), A("i", Qi)) : (T(), A("i", Ji))
|
|
2818
|
+
], 10, Ki),
|
|
2819
|
+
ds(S("textarea", {
|
|
2817
2820
|
ref_key: "textarea",
|
|
2818
2821
|
ref: l,
|
|
2819
2822
|
"onUpdate:modelValue": k[5] || (k[5] = (y) => n.value = y),
|
|
@@ -2821,31 +2824,31 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2821
2824
|
rows: "1",
|
|
2822
2825
|
enterkeyhint: "send",
|
|
2823
2826
|
placeholder: me.value,
|
|
2824
|
-
disabled:
|
|
2827
|
+
disabled: Y.value,
|
|
2825
2828
|
style: { fontSize: "16px", resize: "none" },
|
|
2826
|
-
class: _(["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",
|
|
2827
|
-
onKeydown:
|
|
2829
|
+
class: _(["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", M.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2830
|
+
onKeydown: Z,
|
|
2828
2831
|
onFocus: k[6] || (k[6] = (y) => r.value = !0),
|
|
2829
2832
|
onBlur: k[7] || (k[7] = (y) => r.value = !1)
|
|
2830
|
-
}, null, 42,
|
|
2831
|
-
[
|
|
2833
|
+
}, null, 42, ea), [
|
|
2834
|
+
[fs, n.value]
|
|
2832
2835
|
]),
|
|
2833
2836
|
S("button", {
|
|
2834
2837
|
"data-test": "messaging-send-btn",
|
|
2835
|
-
class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ye.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" :
|
|
2838
|
+
class: _(["shrink-0 flex items-center justify-center rounded-full transition-transform duration-200 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", ye.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : M.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
2836
2839
|
disabled: !ye.value,
|
|
2837
2840
|
onClick: k[8] || (k[8] = (y) => dt())
|
|
2838
2841
|
}, [...k[16] || (k[16] = [
|
|
2839
2842
|
S("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2840
|
-
])], 10,
|
|
2843
|
+
])], 10, ta)
|
|
2841
2844
|
], 2)
|
|
2842
2845
|
], 2)
|
|
2843
2846
|
]));
|
|
2844
2847
|
}
|
|
2845
|
-
}),
|
|
2848
|
+
}), na = { class: "agent-wrap" }, sa = {
|
|
2846
2849
|
key: 0,
|
|
2847
2850
|
class: "flex items-center justify-center h-full"
|
|
2848
|
-
},
|
|
2851
|
+
}, fa = /* @__PURE__ */ ke({
|
|
2849
2852
|
__name: "AgentWrap",
|
|
2850
2853
|
props: {
|
|
2851
2854
|
sdk: {},
|
|
@@ -2859,11 +2862,11 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2859
2862
|
apiBase: {}
|
|
2860
2863
|
},
|
|
2861
2864
|
setup(i) {
|
|
2862
|
-
const t =
|
|
2865
|
+
const t = js("AgentWrap"), e = i, n = e.sdk || Gs.getInstance({
|
|
2863
2866
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2864
2867
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2865
|
-
}), r =
|
|
2866
|
-
return
|
|
2868
|
+
}), r = Q(!e.agent), s = gs(e.agent ? new It({ config: e.agent }) : void 0), l = Q();
|
|
2869
|
+
return Mt(async () => {
|
|
2867
2870
|
if (e.agent) {
|
|
2868
2871
|
t.debug("Agent provided via props, skipping fetch", {
|
|
2869
2872
|
agentId: e.agent.agentId,
|
|
@@ -2939,8 +2942,8 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2939
2942
|
}
|
|
2940
2943
|
});
|
|
2941
2944
|
}
|
|
2942
|
-
}), (o, p) => (T(), A("div",
|
|
2943
|
-
r.value ? (T(), A("div",
|
|
2945
|
+
}), (o, p) => (T(), A("div", na, [
|
|
2946
|
+
r.value ? (T(), A("div", sa, [...p[0] || (p[0] = [
|
|
2944
2947
|
S("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
2945
2948
|
])])) : s.value ? ln(o.$slots, "default", {
|
|
2946
2949
|
key: 1,
|
|
@@ -2956,16 +2959,16 @@ const Ti = ["innerHTML"], _t = /* @__PURE__ */ ke({
|
|
|
2956
2959
|
}
|
|
2957
2960
|
});
|
|
2958
2961
|
export {
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2964
|
-
|
|
2962
|
+
Gn as A,
|
|
2963
|
+
fa as _,
|
|
2964
|
+
da as a,
|
|
2965
|
+
ha as b,
|
|
2966
|
+
ua as c,
|
|
2967
|
+
pa as d,
|
|
2965
2968
|
Hn as e,
|
|
2966
|
-
|
|
2967
|
-
|
|
2968
|
-
|
|
2969
|
-
|
|
2969
|
+
ir as f,
|
|
2970
|
+
oa as g,
|
|
2971
|
+
qn as h,
|
|
2972
|
+
ca as p
|
|
2970
2973
|
};
|
|
2971
2974
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|