@pagelines/sdk 1.0.519 → 1.0.526
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 +82 -81
- 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 +1051 -1074
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/ui/ElAgentChat.vue.d.ts +0 -2
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +32 -40
- package/dist/clients/AgentClient.d.ts +1 -1
- package/dist/contract/build.d.ts +1 -1
- package/dist/demo/index.d.ts +16 -20
- package/dist/index.js +1 -1
- package/dist/sdkClient.d.ts +3 -12
- package/dist/sdkClient.js +1 -1
- package/dist/sdkClient.js.map +1 -1
- package/dist/widget/composables/useWidgetState.d.ts +48 -60
- package/package.json +1 -1
|
@@ -2,23 +2,23 @@ var Ln = Object.defineProperty;
|
|
|
2
2
|
var Ds = (a, t, e) => t in a ? Ln(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
3
|
var h = (a, t) => Ln(a, "name", { value: t, configurable: !0 });
|
|
4
4
|
var D = (a, t, e) => Ds(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { SettingsObject as Os, Agent as
|
|
5
|
+
import { defineComponent as ke, openBlock as T, createElementBlock as S, createElementVNode as A, normalizeClass as _, ref as Z, watch as Ze, computed as B, createCommentVNode as j, renderSlot as en, onMounted as St, Fragment as De, renderList as kt, withDirectives as is, vModelText as rs, unref as Xt, toDisplayString as ce, shallowRef as as, onBeforeUnmount as ls, nextTick as Ms, createVNode as Ce, withCtx as Ls, withModifiers as gt, createTextVNode as On } from "vue";
|
|
6
|
+
import { SettingsObject as Os, Agent as wt, getDefaultAvatarUrl as os, createLogger as zs } from "@pagelines/core";
|
|
7
7
|
import { P as Ps } from "./sdkClient.js";
|
|
8
8
|
const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
}, zn = /* @__PURE__ */
|
|
11
|
+
}, zn = /* @__PURE__ */ ke({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(a) {
|
|
18
|
-
return (t, e) => (
|
|
19
|
-
(
|
|
18
|
+
return (t, e) => (T(), S("div", Ns, [
|
|
19
|
+
(T(), S("svg", $s, [
|
|
20
20
|
A("circle", {
|
|
21
|
-
class:
|
|
21
|
+
class: _([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -33,7 +33,7 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
33
33
|
}), Us = [
|
|
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
|
-
], Bs = 9e4, cs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...cs, "EMPTY_STREAM", "RATE_LIMIT"]),
|
|
36
|
+
], Bs = 9e4, cs = /* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP"]), Fs = /* @__PURE__ */ new Set([...cs, "EMPTY_STREAM", "RATE_LIMIT"]), hn = class hn extends Os {
|
|
37
37
|
constructor(e) {
|
|
38
38
|
super("AgentChatController", e);
|
|
39
39
|
D(this, "isTextMode", !1);
|
|
@@ -41,16 +41,16 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
41
41
|
D(this, "isConnecting", !1);
|
|
42
42
|
// Chat conversation tracking (server-managed persistence)
|
|
43
43
|
D(this, "conversationId");
|
|
44
|
-
D(this, "textState",
|
|
44
|
+
D(this, "textState", Z({
|
|
45
45
|
isActive: !1,
|
|
46
46
|
isConnected: !1,
|
|
47
47
|
isThinking: !1,
|
|
48
48
|
connectionStatus: "disconnected"
|
|
49
49
|
}));
|
|
50
|
-
D(this, "agentMode",
|
|
51
|
-
D(this, "sharedMessages",
|
|
50
|
+
D(this, "agentMode", Z("self"));
|
|
51
|
+
D(this, "sharedMessages", Z([]));
|
|
52
52
|
D(this, "_agent");
|
|
53
|
-
this._agent = e.agent instanceof
|
|
53
|
+
this._agent = e.agent instanceof wt ? e.agent : new wt({ config: e.agent }), this.setupModeWatcher(), this.setupAvailabilityWatcher();
|
|
54
54
|
}
|
|
55
55
|
get chatEnabled() {
|
|
56
56
|
return this._agent.chatAvailable.value;
|
|
@@ -72,13 +72,13 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
72
72
|
return e.includes("timed out") || e.includes("starting up") || e.includes("503") || e.includes("429") || e.includes("[no-reply]") || e.includes("[stream-open]") || e.includes("[stream-read]") || e.includes("[api]");
|
|
73
73
|
}
|
|
74
74
|
isDuplicateMessage(e, n) {
|
|
75
|
-
const
|
|
76
|
-
return l || (this.lastMessage = { hash:
|
|
75
|
+
const i = `${n}:${e.toLowerCase().trim()}`, s = Date.now(), l = i === this.lastMessage.hash && s - this.lastMessage.time < 500;
|
|
76
|
+
return l || (this.lastMessage = { hash: i, time: s }), l;
|
|
77
77
|
}
|
|
78
|
-
addMessage(e, n,
|
|
78
|
+
addMessage(e, n, i, s) {
|
|
79
79
|
this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
|
|
80
80
|
...this.sharedMessages.value,
|
|
81
|
-
{ id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments:
|
|
81
|
+
{ id: Date.now().toString(), text: e, sender: n, timestamp: (/* @__PURE__ */ new Date()).toISOString(), attachments: i, ...s ? { issue: s } : {} }
|
|
82
82
|
]);
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
@@ -96,13 +96,13 @@ const Ns = { class: "spinner max-w-sm" }, $s = {
|
|
|
96
96
|
getDynamicSettings() {
|
|
97
97
|
const { sdk: e } = this.settings;
|
|
98
98
|
if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
|
|
99
|
-
const n = e.activeUser.value,
|
|
99
|
+
const n = e.activeUser.value, i = n?.agents?.find((l) => l.agentId === n.primaryAgentId), s = n ? `
|
|
100
100
|
|
|
101
101
|
Current User:
|
|
102
|
-
- Name: ${
|
|
102
|
+
- Name: ${i?.name || "Anonymous"}
|
|
103
103
|
- Email: ${n.email}
|
|
104
|
-
- Title: ${
|
|
105
|
-
- About: ${
|
|
104
|
+
- Title: ${i?.title || ""}
|
|
105
|
+
- About: ${i?.summary || ""}
|
|
106
106
|
` : "";
|
|
107
107
|
return {
|
|
108
108
|
context: `${this.settings.context || ""}${s}`.trim(),
|
|
@@ -122,12 +122,12 @@ Current User:
|
|
|
122
122
|
});
|
|
123
123
|
}
|
|
124
124
|
setupModeWatcher() {
|
|
125
|
-
|
|
125
|
+
Ze(this.agentMode, async (e, n) => {
|
|
126
126
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
setupAvailabilityWatcher() {
|
|
130
|
-
|
|
130
|
+
Ze(() => this._agent.chatAvailable.value, (e) => {
|
|
131
131
|
if (!(!this.isTextMode || this.isConnecting)) {
|
|
132
132
|
if (e) {
|
|
133
133
|
this.textState.value.isConnected || this.updateState(this.textState, {
|
|
@@ -154,9 +154,9 @@ Current User:
|
|
|
154
154
|
* agent/client.ts survive into the console line).
|
|
155
155
|
*/
|
|
156
156
|
handleError(e, n) {
|
|
157
|
-
const
|
|
158
|
-
this.logger.error("Conversation error:", { message:
|
|
159
|
-
error:
|
|
157
|
+
const i = e.message;
|
|
158
|
+
this.logger.error("Conversation error:", { message: i, raw: n, error: e }), this.addMessage(i, "system"), this.resetState(), this.updateState(this.textState, {
|
|
159
|
+
error: i,
|
|
160
160
|
connectionStatus: "error"
|
|
161
161
|
});
|
|
162
162
|
}
|
|
@@ -198,86 +198,86 @@ Current User:
|
|
|
198
198
|
async sendChatMessage(e, n) {
|
|
199
199
|
if (!this.isTextMode)
|
|
200
200
|
return;
|
|
201
|
-
const { chatStreamFn:
|
|
201
|
+
const { chatStreamFn: i } = this.settings;
|
|
202
202
|
if (!this.chatEnabled) {
|
|
203
203
|
this.addMessage("Agent is currently offline.", "system");
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
206
|
const { sdk: s } = this.settings;
|
|
207
|
-
if (!
|
|
207
|
+
if (!i && !this._agent.handle.value) {
|
|
208
208
|
this.handleError(new Error("Agent handle required for chat"));
|
|
209
209
|
return;
|
|
210
210
|
}
|
|
211
211
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
|
|
212
212
|
const l = `stream-${Date.now()}`;
|
|
213
|
-
let o = !1,
|
|
214
|
-
const c = /* @__PURE__ */ h((
|
|
213
|
+
let o = !1, p = !1;
|
|
214
|
+
const c = /* @__PURE__ */ h((f, E = "assistant") => {
|
|
215
215
|
o || (o = !0, this.sharedMessages.value = [
|
|
216
216
|
...this.sharedMessages.value,
|
|
217
|
-
{ id: l, text: "", sender:
|
|
217
|
+
{ id: l, text: "", sender: E === "system" ? "system" : "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
218
218
|
]);
|
|
219
219
|
const I = this.sharedMessages.value, z = I[I.length - 1];
|
|
220
|
-
z?.id === l && (z.text +=
|
|
221
|
-
}, "onDelta"),
|
|
222
|
-
|
|
223
|
-
const
|
|
220
|
+
z?.id === l && (z.text += f, this.sharedMessages.value = [...I]);
|
|
221
|
+
}, "onDelta"), w = /* @__PURE__ */ h((f) => {
|
|
222
|
+
p = !0, o = !0;
|
|
223
|
+
const E = this.sharedMessages.value, I = E.findIndex((z) => z.id === f.id);
|
|
224
224
|
if (I >= 0)
|
|
225
225
|
this.sharedMessages.value = [
|
|
226
|
-
...
|
|
227
|
-
|
|
228
|
-
...
|
|
226
|
+
...E.slice(0, I),
|
|
227
|
+
f,
|
|
228
|
+
...E.slice(I + 1)
|
|
229
229
|
];
|
|
230
230
|
else {
|
|
231
|
-
const z =
|
|
232
|
-
this.sharedMessages.value = z?.id === l ? [...
|
|
231
|
+
const z = E[E.length - 1];
|
|
232
|
+
this.sharedMessages.value = z?.id === l ? [...E.slice(0, -1), f] : [...E, f];
|
|
233
233
|
}
|
|
234
|
-
|
|
235
|
-
}, "onMessage"),
|
|
236
|
-
if (!o && !
|
|
237
|
-
|
|
234
|
+
f.sender === "system" && f.issue?.bucket === "account" && this.updateState(this.textState, { accountGated: !0 });
|
|
235
|
+
}, "onMessage"), d = /* @__PURE__ */ h((f) => {
|
|
236
|
+
if (!o && !p) {
|
|
237
|
+
x("empty_stream — assistant returned no content");
|
|
238
238
|
return;
|
|
239
239
|
}
|
|
240
|
-
const
|
|
240
|
+
const E = this.sharedMessages.value, I = E[E.length - 1];
|
|
241
241
|
if (I?.id === l && I.sender === "agent" && I.text) {
|
|
242
242
|
let z = I.text;
|
|
243
|
-
for (const
|
|
244
|
-
|
|
245
|
-
z ? z !== I.text && (I.text = z, this.sharedMessages.value = [...
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
}, "onDone"),
|
|
249
|
-
const
|
|
250
|
-
if (I?.id === l && !I.text && (this.sharedMessages.value =
|
|
251
|
-
const { bucket:
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
code:
|
|
255
|
-
bucket:
|
|
256
|
-
...
|
|
257
|
-
|
|
258
|
-
...
|
|
243
|
+
for (const Q of Us)
|
|
244
|
+
Q.pattern.test(z) && (console.debug(`[chat] filtered directive: ${Q.label}`), z = z.replace(Q.pattern, "").trim(), Q.pattern.lastIndex = 0);
|
|
245
|
+
z ? z !== I.text && (I.text = z, this.sharedMessages.value = [...E]) : this.sharedMessages.value = E.slice(0, -1);
|
|
246
|
+
}
|
|
247
|
+
f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
|
|
248
|
+
}, "onDone"), x = /* @__PURE__ */ h((f) => {
|
|
249
|
+
const E = this.sharedMessages.value, I = E[E.length - 1];
|
|
250
|
+
if (I?.id === l && !I.text && (this.sharedMessages.value = E.slice(0, -1)), typeof f == "object" && f.code && f.error) {
|
|
251
|
+
const { bucket: W, actionUrl: N, actionLabel: ie, help: se } = f;
|
|
252
|
+
if (W !== void 0 || Fs.has(f.code)) {
|
|
253
|
+
const ze = W ?? (cs.has(f.code) ? "account" : "error"), Pe = {
|
|
254
|
+
code: f.code,
|
|
255
|
+
bucket: ze,
|
|
256
|
+
...ie ? { actionLabel: ie } : {},
|
|
257
|
+
...N ? { actionUrl: N } : {},
|
|
258
|
+
...se ? { help: se } : {}
|
|
259
259
|
};
|
|
260
|
-
this.addMessage(
|
|
260
|
+
this.addMessage(f.error, "system", void 0, Pe), ze === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
|
|
261
261
|
} else
|
|
262
|
-
this.handleError(new Error(
|
|
262
|
+
this.handleError(new Error(f.error));
|
|
263
263
|
return;
|
|
264
264
|
}
|
|
265
|
-
const z = typeof
|
|
266
|
-
this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly:
|
|
267
|
-
}, "onError"),
|
|
268
|
-
this.addMessage(
|
|
265
|
+
const z = typeof f == "string" ? f : f.error, Q = this.mapChatError(z);
|
|
266
|
+
this.isTransientError(z) ? (this.logger.warn("Chat turn failed (transient):", { raw: z, friendly: Q }), this.addMessage(Q, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(Q), z);
|
|
267
|
+
}, "onError"), m = /* @__PURE__ */ h((f) => {
|
|
268
|
+
this.addMessage(f, "system");
|
|
269
269
|
}, "onStatus");
|
|
270
270
|
try {
|
|
271
|
-
const
|
|
271
|
+
const f = i ? i({
|
|
272
272
|
message: e,
|
|
273
273
|
attachments: n,
|
|
274
274
|
conversationId: this.conversationId,
|
|
275
275
|
history: this.buildHistory(),
|
|
276
276
|
onDelta: c,
|
|
277
|
-
onMessage:
|
|
278
|
-
onDone:
|
|
279
|
-
onError:
|
|
280
|
-
onStatus:
|
|
277
|
+
onMessage: w,
|
|
278
|
+
onDone: d,
|
|
279
|
+
onError: x,
|
|
280
|
+
onStatus: m
|
|
281
281
|
}) : s.chat.chatStreamPublic({
|
|
282
282
|
handle: this._agent.handle.value,
|
|
283
283
|
message: e,
|
|
@@ -285,17 +285,17 @@ Current User:
|
|
|
285
285
|
anonymousId: s.user.generateAnonId(),
|
|
286
286
|
context: this.getDynamicSettings().context || void 0,
|
|
287
287
|
onDelta: c,
|
|
288
|
-
onMessage:
|
|
289
|
-
onDone:
|
|
290
|
-
onError:
|
|
291
|
-
onStatus:
|
|
288
|
+
onMessage: w,
|
|
289
|
+
onDone: d,
|
|
290
|
+
onError: x,
|
|
291
|
+
onStatus: m
|
|
292
292
|
});
|
|
293
293
|
await Promise.race([
|
|
294
|
-
|
|
295
|
-
new Promise((
|
|
294
|
+
f,
|
|
295
|
+
new Promise((E, I) => setTimeout(() => I(new Error("timed out")), Bs))
|
|
296
296
|
]);
|
|
297
|
-
} catch (
|
|
298
|
-
|
|
297
|
+
} catch (f) {
|
|
298
|
+
x(f.message || "Something went wrong");
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
301
|
buildHistory() {
|
|
@@ -315,30 +315,30 @@ Current User:
|
|
|
315
315
|
await this.endConversation();
|
|
316
316
|
}
|
|
317
317
|
};
|
|
318
|
-
h(
|
|
319
|
-
let Pn =
|
|
318
|
+
h(hn, "AgentChatController");
|
|
319
|
+
let Pn = hn;
|
|
320
320
|
function Nn(a) {
|
|
321
321
|
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
322
322
|
}
|
|
323
323
|
h(Nn, "getImageSrc");
|
|
324
|
-
function
|
|
324
|
+
function Yr(a) {
|
|
325
325
|
return Nn(a.cover) || Nn(a.avatar) || os(a.name);
|
|
326
326
|
}
|
|
327
|
-
h(
|
|
327
|
+
h(Yr, "getAgentAvatarUrl");
|
|
328
328
|
function $n(a) {
|
|
329
329
|
const t = a.target;
|
|
330
330
|
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = os());
|
|
331
331
|
}
|
|
332
332
|
h($n, "handleImageError");
|
|
333
|
-
function
|
|
333
|
+
function Zr(a) {
|
|
334
334
|
const { template: t, agent: e } = a;
|
|
335
335
|
return t.replace(/{name}/g, e.name || "Assistant").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
336
336
|
}
|
|
337
|
-
h(
|
|
337
|
+
h(Zr, "parseButtonTemplate");
|
|
338
338
|
const Hs = {
|
|
339
339
|
key: 0,
|
|
340
340
|
class: "absolute inset-0 flex items-center justify-center"
|
|
341
|
-
},
|
|
341
|
+
}, Xr = /* @__PURE__ */ ke({
|
|
342
342
|
__name: "ElAgentButton",
|
|
343
343
|
props: {
|
|
344
344
|
theme: { default: "primary" },
|
|
@@ -362,28 +362,28 @@ const Hs = {
|
|
|
362
362
|
md: "size-4",
|
|
363
363
|
lg: "size-5"
|
|
364
364
|
})[a.size]);
|
|
365
|
-
return (
|
|
366
|
-
class:
|
|
365
|
+
return (i, s) => (T(), S("button", {
|
|
366
|
+
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]])
|
|
367
367
|
}, [
|
|
368
|
-
a.loading ? (
|
|
368
|
+
a.loading ? (T(), S("div", Hs, [...s[0] || (s[0] = [
|
|
369
369
|
A("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
370
370
|
])])) : j("", !0),
|
|
371
371
|
A("span", {
|
|
372
|
-
class:
|
|
372
|
+
class: _(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
373
373
|
}, [
|
|
374
|
-
a.icon ? (
|
|
374
|
+
a.icon ? (T(), S("i", {
|
|
375
375
|
key: 0,
|
|
376
|
-
class:
|
|
376
|
+
class: _([a.icon, n.value])
|
|
377
377
|
}, null, 2)) : j("", !0),
|
|
378
|
-
|
|
379
|
-
a.iconAfter ? (
|
|
378
|
+
en(i.$slots, "default"),
|
|
379
|
+
a.iconAfter ? (T(), S("i", {
|
|
380
380
|
key: 1,
|
|
381
|
-
class:
|
|
381
|
+
class: _([a.iconAfter, n.value])
|
|
382
382
|
}, null, 2)) : j("", !0)
|
|
383
383
|
], 2)
|
|
384
384
|
], 2));
|
|
385
385
|
}
|
|
386
|
-
}), Gs = ["value"],
|
|
386
|
+
}), Gs = ["value"], Kr = /* @__PURE__ */ ke({
|
|
387
387
|
__name: "AgentInputEmail",
|
|
388
388
|
props: {
|
|
389
389
|
modelValue: { default: "" }
|
|
@@ -391,17 +391,17 @@ const Hs = {
|
|
|
391
391
|
emits: ["update:modelValue"],
|
|
392
392
|
setup(a, { emit: t }) {
|
|
393
393
|
const e = t;
|
|
394
|
-
return (n,
|
|
394
|
+
return (n, i) => (T(), S("input", {
|
|
395
395
|
type: "email",
|
|
396
396
|
autocomplete: "email",
|
|
397
397
|
placeholder: "Enter your email",
|
|
398
398
|
value: a.modelValue,
|
|
399
399
|
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",
|
|
400
400
|
style: { "font-size": "16px" },
|
|
401
|
-
onInput:
|
|
401
|
+
onInput: i[0] || (i[0] = (s) => e("update:modelValue", s.target.value))
|
|
402
402
|
}, null, 40, Gs));
|
|
403
403
|
}
|
|
404
|
-
}), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"],
|
|
404
|
+
}), js = { class: "flex gap-1.5 justify-center" }, Ws = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Qr = /* @__PURE__ */ ke({
|
|
405
405
|
__name: "AgentInputOneTimeCode",
|
|
406
406
|
props: {
|
|
407
407
|
modelValue: {},
|
|
@@ -410,73 +410,73 @@ const Hs = {
|
|
|
410
410
|
},
|
|
411
411
|
emits: ["update:modelValue", "autoSubmit"],
|
|
412
412
|
setup(a, { emit: t }) {
|
|
413
|
-
const e = a, n = t,
|
|
414
|
-
|
|
415
|
-
e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) &&
|
|
416
|
-
}),
|
|
417
|
-
s.value =
|
|
418
|
-
}),
|
|
419
|
-
const
|
|
420
|
-
n("update:modelValue",
|
|
413
|
+
const e = a, n = t, i = Z([]), s = Z(Array.from({ length: e.length }).fill("")), l = Z(!1);
|
|
414
|
+
St(() => {
|
|
415
|
+
e.modelValue && (s.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && i.value[0]?.focus();
|
|
416
|
+
}), Ze(() => e.modelValue, (d) => {
|
|
417
|
+
s.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
|
|
418
|
+
}), Ze(s, () => {
|
|
419
|
+
const d = s.value.filter(Boolean).join("");
|
|
420
|
+
n("update:modelValue", d), d.length === e.length && n("autoSubmit", d);
|
|
421
421
|
}, { deep: !0 });
|
|
422
|
-
function o(
|
|
423
|
-
|
|
424
|
-
const
|
|
425
|
-
if (
|
|
426
|
-
s.value =
|
|
427
|
-
|
|
422
|
+
function o(d, x) {
|
|
423
|
+
x.preventDefault(), l.value = !0;
|
|
424
|
+
const m = (x.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
425
|
+
if (m.length === e.length)
|
|
426
|
+
s.value = m.split(""), setTimeout(() => {
|
|
427
|
+
i.value[e.length - 1]?.focus(), l.value = !1;
|
|
428
428
|
}, 10);
|
|
429
429
|
else {
|
|
430
|
-
const
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
}), s.value =
|
|
434
|
-
const
|
|
430
|
+
const f = [...s.value];
|
|
431
|
+
m.split("").slice(0, e.length - d).forEach((I, z) => {
|
|
432
|
+
f[d + z] = I;
|
|
433
|
+
}), s.value = f;
|
|
434
|
+
const E = Math.min(d + m.length, e.length - 1);
|
|
435
435
|
setTimeout(() => {
|
|
436
|
-
|
|
436
|
+
i.value[E]?.focus(), l.value = !1;
|
|
437
437
|
}, 10);
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
h(o, "onPaste");
|
|
441
|
-
function d
|
|
442
|
-
const
|
|
443
|
-
s.value[
|
|
441
|
+
function p(d, x) {
|
|
442
|
+
const m = x.target.value.slice(-1).replace(/\D/g, "");
|
|
443
|
+
s.value[d] = m, m && d < e.length - 1 && i.value[d + 1]?.focus();
|
|
444
444
|
}
|
|
445
|
-
h(
|
|
446
|
-
function c(
|
|
447
|
-
|
|
445
|
+
h(p, "onInput");
|
|
446
|
+
function c(d, x) {
|
|
447
|
+
x.key === "Backspace" ? (x.preventDefault(), s.value[d] = "", d > 0 && i.value[d - 1]?.focus()) : x.key === "ArrowLeft" && d > 0 ? i.value[d - 1]?.focus() : x.key === "ArrowRight" && d < e.length - 1 && i.value[d + 1]?.focus();
|
|
448
448
|
}
|
|
449
449
|
h(c, "onKeydown");
|
|
450
|
-
function
|
|
451
|
-
if (
|
|
452
|
-
for (let
|
|
453
|
-
s.value[
|
|
454
|
-
}
|
|
455
|
-
return h(
|
|
456
|
-
(
|
|
457
|
-
key:
|
|
450
|
+
function w(d) {
|
|
451
|
+
if (i.value[d]?.select(), !l.value && s.value[d])
|
|
452
|
+
for (let x = d; x < e.length; x++)
|
|
453
|
+
s.value[x] = "";
|
|
454
|
+
}
|
|
455
|
+
return h(w, "onFocus"), (d, x) => (T(), S("div", js, [
|
|
456
|
+
(T(!0), S(De, null, kt(a.length, (m) => is((T(), S("input", {
|
|
457
|
+
key: m,
|
|
458
458
|
ref_for: !0,
|
|
459
|
-
ref: /* @__PURE__ */ h((
|
|
460
|
-
"onUpdate:modelValue": /* @__PURE__ */ h((
|
|
459
|
+
ref: /* @__PURE__ */ h((f) => i.value[m - 1] = f, "ref"),
|
|
460
|
+
"onUpdate:modelValue": /* @__PURE__ */ h((f) => s.value[m - 1] = f, "onUpdate:modelValue"),
|
|
461
461
|
type: "text",
|
|
462
462
|
inputmode: "numeric",
|
|
463
463
|
autocomplete: "one-time-code",
|
|
464
464
|
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
465
465
|
style: { "font-size": "16px" },
|
|
466
466
|
maxlength: "1",
|
|
467
|
-
onInput: /* @__PURE__ */ h((
|
|
468
|
-
onKeydown: /* @__PURE__ */ h((
|
|
469
|
-
onPaste: /* @__PURE__ */ h((
|
|
470
|
-
onFocus: /* @__PURE__ */ h((
|
|
467
|
+
onInput: /* @__PURE__ */ h((f) => p(m - 1, f), "onInput"),
|
|
468
|
+
onKeydown: /* @__PURE__ */ h((f) => c(m - 1, f), "onKeydown"),
|
|
469
|
+
onPaste: /* @__PURE__ */ h((f) => o(m - 1, f), "onPaste"),
|
|
470
|
+
onFocus: /* @__PURE__ */ h((f) => w(m - 1), "onFocus")
|
|
471
471
|
}, null, 40, Ws)), [
|
|
472
|
-
[
|
|
472
|
+
[rs, s.value[m - 1]]
|
|
473
473
|
])), 128))
|
|
474
474
|
]));
|
|
475
475
|
}
|
|
476
476
|
}), qs = { class: "relative flex-shrink-0" }, Vs = ["src", "alt"], Ys = { class: "absolute top-1 right-1" }, Zs = {
|
|
477
477
|
key: 1,
|
|
478
478
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
479
|
-
}, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */
|
|
479
|
+
}, Xs = { class: "min-w-0" }, Ks = /* @__PURE__ */ ke({
|
|
480
480
|
__name: "ElModeHeader",
|
|
481
481
|
props: {
|
|
482
482
|
agent: {},
|
|
@@ -485,46 +485,46 @@ const Hs = {
|
|
|
485
485
|
layout: { default: "centered" }
|
|
486
486
|
},
|
|
487
487
|
setup(a) {
|
|
488
|
-
return (t, e) => (
|
|
489
|
-
class:
|
|
488
|
+
return (t, e) => (T(), S("div", {
|
|
489
|
+
class: _(["flex gap-4", [
|
|
490
490
|
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
491
491
|
]])
|
|
492
492
|
}, [
|
|
493
493
|
A("div", qs, [
|
|
494
494
|
A("div", {
|
|
495
|
-
class:
|
|
495
|
+
class: _(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
496
496
|
}, [
|
|
497
497
|
A("img", {
|
|
498
498
|
src: a.agent.avatarUrl.value,
|
|
499
499
|
alt: a.agent.displayName.value,
|
|
500
500
|
class: "w-full h-full object-cover",
|
|
501
501
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
502
|
-
(...n) =>
|
|
502
|
+
(...n) => Xt($n) && Xt($n)(...n))
|
|
503
503
|
}, null, 40, Vs)
|
|
504
504
|
], 2),
|
|
505
505
|
A("div", Ys, [
|
|
506
|
-
a.isOnline ? (
|
|
506
|
+
a.isOnline ? (T(), S(De, { key: 0 }, [
|
|
507
507
|
e[1] || (e[1] = A("div", {
|
|
508
508
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
509
509
|
style: { "animation-duration": "3s" }
|
|
510
510
|
}, null, -1)),
|
|
511
511
|
e[2] || (e[2] = A("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
512
|
-
], 64)) : (
|
|
512
|
+
], 64)) : (T(), S("div", Zs))
|
|
513
513
|
])
|
|
514
514
|
]),
|
|
515
515
|
A("div", Xs, [
|
|
516
516
|
A("h1", {
|
|
517
|
-
class:
|
|
517
|
+
class: _(["font-light text-white mb-1 truncate", [
|
|
518
518
|
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
519
519
|
a.layout === "horizontal" ? "text-white/95" : ""
|
|
520
520
|
]])
|
|
521
|
-
},
|
|
521
|
+
}, ce(a.agent.displayName.value), 3),
|
|
522
522
|
A("p", {
|
|
523
|
-
class:
|
|
523
|
+
class: _(["font-light line-clamp-1", [
|
|
524
524
|
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
525
525
|
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
526
526
|
]])
|
|
527
|
-
},
|
|
527
|
+
}, ce(a.layout === "horizontal" ? a.agent.title.value || "Assistant" : a.agent.title.value), 3)
|
|
528
528
|
])
|
|
529
529
|
], 2));
|
|
530
530
|
}
|
|
@@ -534,117 +534,117 @@ const {
|
|
|
534
534
|
setPrototypeOf: Un,
|
|
535
535
|
isFrozen: Qs,
|
|
536
536
|
getPrototypeOf: Js,
|
|
537
|
-
getOwnPropertyDescriptor:
|
|
537
|
+
getOwnPropertyDescriptor: ei
|
|
538
538
|
} = Object;
|
|
539
539
|
let {
|
|
540
|
-
freeze:
|
|
541
|
-
seal:
|
|
542
|
-
create:
|
|
540
|
+
freeze: ee,
|
|
541
|
+
seal: ue,
|
|
542
|
+
create: Ge
|
|
543
543
|
} = Object, {
|
|
544
|
-
apply:
|
|
545
|
-
construct:
|
|
544
|
+
apply: Kt,
|
|
545
|
+
construct: Qt
|
|
546
546
|
} = typeof Reflect < "u" && Reflect;
|
|
547
|
-
|
|
547
|
+
ee || (ee = /* @__PURE__ */ h(function(t) {
|
|
548
548
|
return t;
|
|
549
549
|
}, "freeze"));
|
|
550
|
-
|
|
550
|
+
ue || (ue = /* @__PURE__ */ h(function(t) {
|
|
551
551
|
return t;
|
|
552
552
|
}, "seal"));
|
|
553
|
-
|
|
554
|
-
for (var n = arguments.length,
|
|
555
|
-
|
|
556
|
-
return t.apply(e,
|
|
553
|
+
Kt || (Kt = /* @__PURE__ */ h(function(t, e) {
|
|
554
|
+
for (var n = arguments.length, i = new Array(n > 2 ? n - 2 : 0), s = 2; s < n; s++)
|
|
555
|
+
i[s - 2] = arguments[s];
|
|
556
|
+
return t.apply(e, i);
|
|
557
557
|
}, "apply"));
|
|
558
|
-
|
|
559
|
-
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0),
|
|
560
|
-
n[
|
|
558
|
+
Qt || (Qt = /* @__PURE__ */ h(function(t) {
|
|
559
|
+
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
560
|
+
n[i - 1] = arguments[i];
|
|
561
561
|
return new t(...n);
|
|
562
562
|
}, "construct"));
|
|
563
|
-
const
|
|
564
|
-
function
|
|
563
|
+
const tt = H(Array.prototype.forEach), ti = H(Array.prototype.lastIndexOf), Bn = H(Array.prototype.pop), nt = H(Array.prototype.push), ni = H(Array.prototype.splice), J = Array.isArray, at = H(String.prototype.toLowerCase), jt = H(String.prototype.toString), Fn = H(String.prototype.match), He = H(String.prototype.replace), Hn = H(String.prototype.indexOf), si = H(String.prototype.trim), ii = H(Number.prototype.toString), ri = H(Boolean.prototype.toString), Gn = typeof BigInt > "u" ? null : H(BigInt.prototype.toString), jn = typeof Symbol > "u" ? null : H(Symbol.prototype.toString), U = H(Object.prototype.hasOwnProperty), st = H(Object.prototype.toString), Y = H(RegExp.prototype.test), mt = ai(TypeError);
|
|
564
|
+
function H(a) {
|
|
565
565
|
return function(t) {
|
|
566
566
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
567
|
-
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0),
|
|
568
|
-
n[
|
|
569
|
-
return
|
|
567
|
+
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), i = 1; i < e; i++)
|
|
568
|
+
n[i - 1] = arguments[i];
|
|
569
|
+
return Kt(a, t, n);
|
|
570
570
|
};
|
|
571
571
|
}
|
|
572
|
-
h(
|
|
573
|
-
function
|
|
572
|
+
h(H, "unapply");
|
|
573
|
+
function ai(a) {
|
|
574
574
|
return function() {
|
|
575
575
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
576
576
|
e[n] = arguments[n];
|
|
577
|
-
return
|
|
577
|
+
return Qt(a, e);
|
|
578
578
|
};
|
|
579
579
|
}
|
|
580
|
-
h(
|
|
580
|
+
h(ai, "unconstruct");
|
|
581
581
|
function R(a, t) {
|
|
582
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
583
|
-
if (Un && Un(a, null), !
|
|
582
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : at;
|
|
583
|
+
if (Un && Un(a, null), !J(t))
|
|
584
584
|
return a;
|
|
585
585
|
let n = t.length;
|
|
586
586
|
for (; n--; ) {
|
|
587
|
-
let
|
|
588
|
-
if (typeof
|
|
589
|
-
const s = e(
|
|
590
|
-
s !==
|
|
587
|
+
let i = t[n];
|
|
588
|
+
if (typeof i == "string") {
|
|
589
|
+
const s = e(i);
|
|
590
|
+
s !== i && (Qs(t) || (t[n] = s), i = s);
|
|
591
591
|
}
|
|
592
|
-
a[
|
|
592
|
+
a[i] = !0;
|
|
593
593
|
}
|
|
594
594
|
return a;
|
|
595
595
|
}
|
|
596
596
|
h(R, "addToSet");
|
|
597
|
-
function
|
|
597
|
+
function li(a) {
|
|
598
598
|
for (let t = 0; t < a.length; t++)
|
|
599
599
|
U(a, t) || (a[t] = null);
|
|
600
600
|
return a;
|
|
601
601
|
}
|
|
602
|
-
h(
|
|
603
|
-
function
|
|
604
|
-
const t =
|
|
602
|
+
h(li, "cleanArray");
|
|
603
|
+
function ne(a) {
|
|
604
|
+
const t = Ge(null);
|
|
605
605
|
for (const [e, n] of us(a))
|
|
606
|
-
U(a, e) && (
|
|
606
|
+
U(a, e) && (J(n) ? t[e] = li(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = ne(n) : t[e] = n);
|
|
607
607
|
return t;
|
|
608
608
|
}
|
|
609
|
-
h(
|
|
610
|
-
function
|
|
609
|
+
h(ne, "clone");
|
|
610
|
+
function oi(a) {
|
|
611
611
|
switch (typeof a) {
|
|
612
612
|
case "string":
|
|
613
613
|
return a;
|
|
614
614
|
case "number":
|
|
615
|
-
return
|
|
615
|
+
return ii(a);
|
|
616
616
|
case "boolean":
|
|
617
|
-
return
|
|
617
|
+
return ri(a);
|
|
618
618
|
case "bigint":
|
|
619
619
|
return Gn ? Gn(a) : "0";
|
|
620
620
|
case "symbol":
|
|
621
621
|
return jn ? jn(a) : "Symbol()";
|
|
622
622
|
case "undefined":
|
|
623
|
-
return
|
|
623
|
+
return st(a);
|
|
624
624
|
case "function":
|
|
625
625
|
case "object": {
|
|
626
626
|
if (a === null)
|
|
627
|
-
return
|
|
628
|
-
const t = a, e =
|
|
627
|
+
return st(a);
|
|
628
|
+
const t = a, e = je(t, "toString");
|
|
629
629
|
if (typeof e == "function") {
|
|
630
630
|
const n = e(t);
|
|
631
|
-
return typeof n == "string" ? n :
|
|
631
|
+
return typeof n == "string" ? n : st(n);
|
|
632
632
|
}
|
|
633
|
-
return
|
|
633
|
+
return st(a);
|
|
634
634
|
}
|
|
635
635
|
default:
|
|
636
|
-
return
|
|
636
|
+
return st(a);
|
|
637
637
|
}
|
|
638
638
|
}
|
|
639
|
-
h(
|
|
640
|
-
function
|
|
639
|
+
h(oi, "stringifyValue");
|
|
640
|
+
function je(a, t) {
|
|
641
641
|
for (; a !== null; ) {
|
|
642
|
-
const n =
|
|
642
|
+
const n = ei(a, t);
|
|
643
643
|
if (n) {
|
|
644
644
|
if (n.get)
|
|
645
|
-
return
|
|
645
|
+
return H(n.get);
|
|
646
646
|
if (typeof n.value == "function")
|
|
647
|
-
return
|
|
647
|
+
return H(n.value);
|
|
648
648
|
}
|
|
649
649
|
a = Js(a);
|
|
650
650
|
}
|
|
@@ -653,50 +653,50 @@ function We(a, t) {
|
|
|
653
653
|
}
|
|
654
654
|
return h(e, "fallbackValue"), e;
|
|
655
655
|
}
|
|
656
|
-
h(
|
|
657
|
-
function
|
|
656
|
+
h(je, "lookupGetter");
|
|
657
|
+
function ci(a) {
|
|
658
658
|
try {
|
|
659
|
-
return
|
|
659
|
+
return Y(a, ""), !0;
|
|
660
660
|
} catch {
|
|
661
661
|
return !1;
|
|
662
662
|
}
|
|
663
663
|
}
|
|
664
|
-
h(
|
|
665
|
-
const Wn =
|
|
664
|
+
h(ci, "isRegex");
|
|
665
|
+
const Wn = ee(["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"]), Wt = ee(["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"]), qt = ee(["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"]), ui = ee(["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"]), Vt = ee(["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"]), hi = ee(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), qn = ee(["#text"]), Vn = ee(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "exportparts", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inert", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "part", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "slot", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns"]), Yt = ee(["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"]), Yn = ee(["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"]), xt = ee(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), pi = ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm), di = ue(/<%[\w\W]*|[\w\W]*%>/gm), fi = ue(/\$\{[\w\W]*/gm), gi = ue(/^data-[\-\w.\u00B7-\uFFFF]+$/), mi = ue(/^aria-[\-\w]+$/), hs = ue(
|
|
666
666
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
667
667
|
// eslint-disable-line no-useless-escape
|
|
668
|
-
),
|
|
668
|
+
), xi = ue(/^(?:\w+script|data):/i), bi = ue(
|
|
669
669
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
670
670
|
// eslint-disable-line no-control-regex
|
|
671
|
-
), ps =
|
|
671
|
+
), ps = ue(/^html$/i), ki = ue(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
672
672
|
var Zn = /* @__PURE__ */ Object.freeze({
|
|
673
673
|
__proto__: null,
|
|
674
|
-
ARIA_ATTR:
|
|
675
|
-
ATTR_WHITESPACE:
|
|
676
|
-
CUSTOM_ELEMENT:
|
|
677
|
-
DATA_ATTR:
|
|
674
|
+
ARIA_ATTR: mi,
|
|
675
|
+
ATTR_WHITESPACE: bi,
|
|
676
|
+
CUSTOM_ELEMENT: ki,
|
|
677
|
+
DATA_ATTR: gi,
|
|
678
678
|
DOCTYPE_NAME: ps,
|
|
679
|
-
ERB_EXPR:
|
|
679
|
+
ERB_EXPR: di,
|
|
680
680
|
IS_ALLOWED_URI: hs,
|
|
681
|
-
IS_SCRIPT_OR_DATA:
|
|
682
|
-
MUSTACHE_EXPR:
|
|
683
|
-
TMPLIT_EXPR:
|
|
681
|
+
IS_SCRIPT_OR_DATA: xi,
|
|
682
|
+
MUSTACHE_EXPR: pi,
|
|
683
|
+
TMPLIT_EXPR: fi
|
|
684
684
|
});
|
|
685
|
-
const
|
|
685
|
+
const it = {
|
|
686
686
|
element: 1,
|
|
687
687
|
text: 3,
|
|
688
688
|
// Deprecated
|
|
689
689
|
progressingInstruction: 7,
|
|
690
690
|
comment: 8,
|
|
691
691
|
document: 9
|
|
692
|
-
},
|
|
692
|
+
}, wi = /* @__PURE__ */ h(function() {
|
|
693
693
|
return typeof window > "u" ? null : window;
|
|
694
|
-
}, "getGlobal"),
|
|
694
|
+
}, "getGlobal"), vi = /* @__PURE__ */ h(function(t, e) {
|
|
695
695
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
696
696
|
return null;
|
|
697
697
|
let n = null;
|
|
698
|
-
const
|
|
699
|
-
e && e.hasAttribute(
|
|
698
|
+
const i = "data-tt-policy-suffix";
|
|
699
|
+
e && e.hasAttribute(i) && (n = e.getAttribute(i));
|
|
700
700
|
const s = "dompurify" + (n ? "#" + n : "");
|
|
701
701
|
try {
|
|
702
702
|
return t.createPolicy(s, {
|
|
@@ -724,56 +724,56 @@ const at = {
|
|
|
724
724
|
};
|
|
725
725
|
}, "_createHooksMap");
|
|
726
726
|
function ds() {
|
|
727
|
-
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
728
|
-
const t = /* @__PURE__ */ h((
|
|
729
|
-
if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !==
|
|
727
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : wi();
|
|
728
|
+
const t = /* @__PURE__ */ h((y) => ds(y), "DOMPurify");
|
|
729
|
+
if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== it.document || !a.Element)
|
|
730
730
|
return t.isSupported = !1, t;
|
|
731
731
|
let {
|
|
732
732
|
document: e
|
|
733
733
|
} = a;
|
|
734
|
-
const n = e,
|
|
734
|
+
const n = e, i = n.currentScript, {
|
|
735
735
|
DocumentFragment: s,
|
|
736
736
|
HTMLTemplateElement: l,
|
|
737
737
|
Node: o,
|
|
738
|
-
Element:
|
|
738
|
+
Element: p,
|
|
739
739
|
NodeFilter: c,
|
|
740
|
-
NamedNodeMap:
|
|
741
|
-
HTMLFormElement:
|
|
742
|
-
DOMParser:
|
|
743
|
-
trustedTypes:
|
|
744
|
-
} = a,
|
|
740
|
+
NamedNodeMap: w = a.NamedNodeMap || a.MozNamedAttrMap,
|
|
741
|
+
HTMLFormElement: d,
|
|
742
|
+
DOMParser: x,
|
|
743
|
+
trustedTypes: m
|
|
744
|
+
} = a, f = p.prototype, E = je(f, "cloneNode"), I = je(f, "remove"), z = je(f, "nextSibling"), Q = je(f, "childNodes"), W = je(f, "parentNode");
|
|
745
745
|
if (typeof l == "function") {
|
|
746
|
-
const
|
|
747
|
-
|
|
746
|
+
const y = e.createElement("template");
|
|
747
|
+
y.content && y.content.ownerDocument && (e = y.content.ownerDocument);
|
|
748
748
|
}
|
|
749
|
-
let
|
|
749
|
+
let N, ie = "";
|
|
750
750
|
const {
|
|
751
|
-
implementation:
|
|
752
|
-
createNodeIterator:
|
|
753
|
-
createDocumentFragment:
|
|
754
|
-
getElementsByTagName:
|
|
751
|
+
implementation: se,
|
|
752
|
+
createNodeIterator: re,
|
|
753
|
+
createDocumentFragment: ze,
|
|
754
|
+
getElementsByTagName: Pe
|
|
755
755
|
} = e, {
|
|
756
|
-
importNode:
|
|
756
|
+
importNode: L
|
|
757
757
|
} = n;
|
|
758
|
-
let
|
|
759
|
-
t.isSupported = typeof us == "function" && typeof
|
|
758
|
+
let q = Xn();
|
|
759
|
+
t.isSupported = typeof us == "function" && typeof W == "function" && se && se.createHTMLDocument !== void 0;
|
|
760
760
|
const {
|
|
761
|
-
MUSTACHE_EXPR:
|
|
762
|
-
ERB_EXPR:
|
|
763
|
-
TMPLIT_EXPR:
|
|
764
|
-
DATA_ATTR:
|
|
765
|
-
ARIA_ATTR:
|
|
766
|
-
IS_SCRIPT_OR_DATA:
|
|
767
|
-
ATTR_WHITESPACE:
|
|
768
|
-
CUSTOM_ELEMENT:
|
|
761
|
+
MUSTACHE_EXPR: we,
|
|
762
|
+
ERB_EXPR: Ae,
|
|
763
|
+
TMPLIT_EXPR: Ne,
|
|
764
|
+
DATA_ATTR: _t,
|
|
765
|
+
ARIA_ATTR: Rt,
|
|
766
|
+
IS_SCRIPT_OR_DATA: It,
|
|
767
|
+
ATTR_WHITESPACE: ct,
|
|
768
|
+
CUSTOM_ELEMENT: ut
|
|
769
769
|
} = Zn;
|
|
770
770
|
let {
|
|
771
|
-
IS_ALLOWED_URI:
|
|
772
|
-
} = Zn,
|
|
773
|
-
const
|
|
774
|
-
let
|
|
775
|
-
const
|
|
776
|
-
let
|
|
771
|
+
IS_ALLOWED_URI: Ke
|
|
772
|
+
} = Zn, v = null;
|
|
773
|
+
const k = R({}, [...Wn, ...Wt, ...qt, ...Vt, ...qn]);
|
|
774
|
+
let g = null;
|
|
775
|
+
const P = R({}, [...Vn, ...Yt, ...Yn, ...xt]);
|
|
776
|
+
let C = Object.seal(Ge(null, {
|
|
777
777
|
tagNameCheck: {
|
|
778
778
|
writable: !0,
|
|
779
779
|
configurable: !1,
|
|
@@ -792,8 +792,8 @@ function ds() {
|
|
|
792
792
|
enumerable: !0,
|
|
793
793
|
value: !1
|
|
794
794
|
}
|
|
795
|
-
})),
|
|
796
|
-
const
|
|
795
|
+
})), ae = null, Ee = null;
|
|
796
|
+
const le = Object.seal(Ge(null, {
|
|
797
797
|
tagCheck: {
|
|
798
798
|
writable: !0,
|
|
799
799
|
configurable: !1,
|
|
@@ -807,172 +807,172 @@ function ds() {
|
|
|
807
807
|
value: null
|
|
808
808
|
}
|
|
809
809
|
}));
|
|
810
|
-
let
|
|
810
|
+
let pn = !0, Ct = !0, dn = !1, fn = !0, _e = !1, Qe = !0, Re = !1, Dt = !1, Mt = !1, $e = !1, ht = !1, pt = !1, gn = !0, mn = !1;
|
|
811
811
|
const xn = "user-content-";
|
|
812
|
-
let
|
|
813
|
-
const
|
|
812
|
+
let Lt = !0, Je = !1, Ue = {}, ge = null;
|
|
813
|
+
const Ot = R({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
|
|
814
814
|
let bn = null;
|
|
815
815
|
const kn = R({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
816
|
-
let
|
|
817
|
-
const wn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]),
|
|
818
|
-
let
|
|
819
|
-
const Ss = R({}, [
|
|
820
|
-
let
|
|
816
|
+
let zt = null;
|
|
817
|
+
const wn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), dt = "http://www.w3.org/1998/Math/MathML", ft = "http://www.w3.org/2000/svg", me = "http://www.w3.org/1999/xhtml";
|
|
818
|
+
let Be = me, Pt = !1, Nt = null;
|
|
819
|
+
const Ss = R({}, [dt, ft, me], jt);
|
|
820
|
+
let $t = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
|
|
821
821
|
const As = R({}, ["title", "style", "font", "a", "script"]);
|
|
822
|
-
let
|
|
822
|
+
let et = null;
|
|
823
823
|
const Es = ["application/xhtml+xml", "text/html"], _s = "text/html";
|
|
824
|
-
let
|
|
825
|
-
const Rs = e.createElement("form"), vn = /* @__PURE__ */ h(function(
|
|
826
|
-
return
|
|
827
|
-
}, "isRegexOrFunction"),
|
|
828
|
-
let
|
|
829
|
-
if (
|
|
824
|
+
let G = null, Fe = null;
|
|
825
|
+
const Rs = e.createElement("form"), vn = /* @__PURE__ */ h(function(r) {
|
|
826
|
+
return r instanceof RegExp || r instanceof Function;
|
|
827
|
+
}, "isRegexOrFunction"), Bt = /* @__PURE__ */ h(function() {
|
|
828
|
+
let r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
829
|
+
if (Fe && Fe === r)
|
|
830
830
|
return;
|
|
831
|
-
(!
|
|
832
|
-
Es.indexOf(
|
|
833
|
-
const u = U(
|
|
834
|
-
if (
|
|
835
|
-
if (typeof
|
|
836
|
-
throw
|
|
837
|
-
if (typeof
|
|
838
|
-
throw
|
|
839
|
-
|
|
831
|
+
(!r || typeof r != "object") && (r = {}), r = ne(r), et = // eslint-disable-next-line unicorn/prefer-includes
|
|
832
|
+
Es.indexOf(r.PARSER_MEDIA_TYPE) === -1 ? _s : r.PARSER_MEDIA_TYPE, G = et === "application/xhtml+xml" ? jt : at, v = U(r, "ALLOWED_TAGS") && J(r.ALLOWED_TAGS) ? R({}, r.ALLOWED_TAGS, G) : k, g = U(r, "ALLOWED_ATTR") && J(r.ALLOWED_ATTR) ? R({}, r.ALLOWED_ATTR, G) : P, Nt = U(r, "ALLOWED_NAMESPACES") && J(r.ALLOWED_NAMESPACES) ? R({}, r.ALLOWED_NAMESPACES, jt) : Ss, zt = U(r, "ADD_URI_SAFE_ATTR") && J(r.ADD_URI_SAFE_ATTR) ? R(ne(wn), r.ADD_URI_SAFE_ATTR, G) : wn, bn = U(r, "ADD_DATA_URI_TAGS") && J(r.ADD_DATA_URI_TAGS) ? R(ne(kn), r.ADD_DATA_URI_TAGS, G) : kn, ge = U(r, "FORBID_CONTENTS") && J(r.FORBID_CONTENTS) ? R({}, r.FORBID_CONTENTS, G) : Ot, ae = U(r, "FORBID_TAGS") && J(r.FORBID_TAGS) ? R({}, r.FORBID_TAGS, G) : ne({}), Ee = U(r, "FORBID_ATTR") && J(r.FORBID_ATTR) ? R({}, r.FORBID_ATTR, G) : ne({}), Ue = U(r, "USE_PROFILES") ? r.USE_PROFILES && typeof r.USE_PROFILES == "object" ? ne(r.USE_PROFILES) : r.USE_PROFILES : !1, pn = r.ALLOW_ARIA_ATTR !== !1, Ct = r.ALLOW_DATA_ATTR !== !1, dn = r.ALLOW_UNKNOWN_PROTOCOLS || !1, fn = r.ALLOW_SELF_CLOSE_IN_ATTR !== !1, _e = r.SAFE_FOR_TEMPLATES || !1, Qe = r.SAFE_FOR_XML !== !1, Re = r.WHOLE_DOCUMENT || !1, $e = r.RETURN_DOM || !1, ht = r.RETURN_DOM_FRAGMENT || !1, pt = r.RETURN_TRUSTED_TYPE || !1, Mt = r.FORCE_BODY || !1, gn = r.SANITIZE_DOM !== !1, mn = r.SANITIZE_NAMED_PROPS || !1, Lt = r.KEEP_CONTENT !== !1, Je = r.IN_PLACE || !1, Ke = ci(r.ALLOWED_URI_REGEXP) ? r.ALLOWED_URI_REGEXP : hs, Be = typeof r.NAMESPACE == "string" ? r.NAMESPACE : me, $t = U(r, "MATHML_TEXT_INTEGRATION_POINTS") && r.MATHML_TEXT_INTEGRATION_POINTS && typeof r.MATHML_TEXT_INTEGRATION_POINTS == "object" ? ne(r.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = U(r, "HTML_INTEGRATION_POINTS") && r.HTML_INTEGRATION_POINTS && typeof r.HTML_INTEGRATION_POINTS == "object" ? ne(r.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
833
|
+
const u = U(r, "CUSTOM_ELEMENT_HANDLING") && r.CUSTOM_ELEMENT_HANDLING && typeof r.CUSTOM_ELEMENT_HANDLING == "object" ? ne(r.CUSTOM_ELEMENT_HANDLING) : Ge(null);
|
|
834
|
+
if (C = Ge(null), U(u, "tagNameCheck") && vn(u.tagNameCheck) && (C.tagNameCheck = u.tagNameCheck), U(u, "attributeNameCheck") && vn(u.attributeNameCheck) && (C.attributeNameCheck = u.attributeNameCheck), U(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (C.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), _e && (Ct = !1), ht && ($e = !0), Ue && (v = R({}, qn), g = Ge(null), Ue.html === !0 && (R(v, Wn), R(g, Vn)), Ue.svg === !0 && (R(v, Wt), R(g, Yt), R(g, xt)), Ue.svgFilters === !0 && (R(v, qt), R(g, Yt), R(g, xt)), Ue.mathMl === !0 && (R(v, Vt), R(g, Yn), R(g, xt))), le.tagCheck = null, le.attributeCheck = null, U(r, "ADD_TAGS") && (typeof r.ADD_TAGS == "function" ? le.tagCheck = r.ADD_TAGS : J(r.ADD_TAGS) && (v === k && (v = ne(v)), R(v, r.ADD_TAGS, G))), U(r, "ADD_ATTR") && (typeof r.ADD_ATTR == "function" ? le.attributeCheck = r.ADD_ATTR : J(r.ADD_ATTR) && (g === P && (g = ne(g)), R(g, r.ADD_ATTR, G))), U(r, "ADD_URI_SAFE_ATTR") && J(r.ADD_URI_SAFE_ATTR) && R(zt, r.ADD_URI_SAFE_ATTR, G), U(r, "FORBID_CONTENTS") && J(r.FORBID_CONTENTS) && (ge === Ot && (ge = ne(ge)), R(ge, r.FORBID_CONTENTS, G)), U(r, "ADD_FORBID_CONTENTS") && J(r.ADD_FORBID_CONTENTS) && (ge === Ot && (ge = ne(ge)), R(ge, r.ADD_FORBID_CONTENTS, G)), Lt && (v["#text"] = !0), Re && R(v, ["html", "head", "body"]), v.table && (R(v, ["tbody"]), delete ae.tbody), r.TRUSTED_TYPES_POLICY) {
|
|
835
|
+
if (typeof r.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
836
|
+
throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
837
|
+
if (typeof r.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
838
|
+
throw mt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
839
|
+
N = r.TRUSTED_TYPES_POLICY, ie = N.createHTML("");
|
|
840
840
|
} else
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
}, "_parseConfig"), yn = R({}, [...
|
|
844
|
-
let u =
|
|
841
|
+
N === void 0 && (N = vi(m, i)), N !== null && typeof ie == "string" && (ie = N.createHTML(""));
|
|
842
|
+
ee && ee(r), Fe = r;
|
|
843
|
+
}, "_parseConfig"), yn = R({}, [...Wt, ...qt, ...ui]), Tn = R({}, [...Vt, ...hi]), Is = /* @__PURE__ */ h(function(r) {
|
|
844
|
+
let u = W(r);
|
|
845
845
|
(!u || !u.tagName) && (u = {
|
|
846
|
-
namespaceURI:
|
|
846
|
+
namespaceURI: Be,
|
|
847
847
|
tagName: "template"
|
|
848
848
|
});
|
|
849
|
-
const
|
|
850
|
-
return
|
|
851
|
-
}, "_checkValidNamespace"),
|
|
852
|
-
|
|
853
|
-
element:
|
|
849
|
+
const b = at(r.tagName), $ = at(u.tagName);
|
|
850
|
+
return Nt[r.namespaceURI] ? r.namespaceURI === ft ? u.namespaceURI === me ? b === "svg" : u.namespaceURI === dt ? b === "svg" && ($ === "annotation-xml" || $t[$]) : !!yn[b] : r.namespaceURI === dt ? u.namespaceURI === me ? b === "math" : u.namespaceURI === ft ? b === "math" && Ut[$] : !!Tn[b] : r.namespaceURI === me ? u.namespaceURI === ft && !Ut[$] || u.namespaceURI === dt && !$t[$] ? !1 : !Tn[b] && (As[b] || !yn[b]) : !!(et === "application/xhtml+xml" && Nt[r.namespaceURI]) : !1;
|
|
851
|
+
}, "_checkValidNamespace"), he = /* @__PURE__ */ h(function(r) {
|
|
852
|
+
nt(t.removed, {
|
|
853
|
+
element: r
|
|
854
854
|
});
|
|
855
855
|
try {
|
|
856
|
-
|
|
856
|
+
W(r).removeChild(r);
|
|
857
857
|
} catch {
|
|
858
|
-
I(
|
|
858
|
+
I(r);
|
|
859
859
|
}
|
|
860
|
-
}, "_forceRemove"),
|
|
860
|
+
}, "_forceRemove"), Ie = /* @__PURE__ */ h(function(r, u) {
|
|
861
861
|
try {
|
|
862
|
-
|
|
863
|
-
attribute: u.getAttributeNode(
|
|
862
|
+
nt(t.removed, {
|
|
863
|
+
attribute: u.getAttributeNode(r),
|
|
864
864
|
from: u
|
|
865
865
|
});
|
|
866
866
|
} catch {
|
|
867
|
-
|
|
867
|
+
nt(t.removed, {
|
|
868
868
|
attribute: null,
|
|
869
869
|
from: u
|
|
870
870
|
});
|
|
871
871
|
}
|
|
872
|
-
if (u.removeAttribute(
|
|
873
|
-
if (
|
|
872
|
+
if (u.removeAttribute(r), r === "is")
|
|
873
|
+
if ($e || ht)
|
|
874
874
|
try {
|
|
875
|
-
|
|
875
|
+
he(u);
|
|
876
876
|
} catch {
|
|
877
877
|
}
|
|
878
878
|
else
|
|
879
879
|
try {
|
|
880
|
-
u.setAttribute(
|
|
880
|
+
u.setAttribute(r, "");
|
|
881
881
|
} catch {
|
|
882
882
|
}
|
|
883
|
-
}, "_removeAttribute"), Sn = /* @__PURE__ */ h(function(
|
|
884
|
-
let u = null,
|
|
885
|
-
if (
|
|
886
|
-
|
|
883
|
+
}, "_removeAttribute"), Sn = /* @__PURE__ */ h(function(r) {
|
|
884
|
+
let u = null, b = null;
|
|
885
|
+
if (Mt)
|
|
886
|
+
r = "<remove></remove>" + r;
|
|
887
887
|
else {
|
|
888
|
-
const
|
|
889
|
-
|
|
888
|
+
const F = Fn(r, /^[\r\n\t ]+/);
|
|
889
|
+
b = F && F[0];
|
|
890
890
|
}
|
|
891
|
-
|
|
892
|
-
const
|
|
893
|
-
if (
|
|
891
|
+
et === "application/xhtml+xml" && Be === me && (r = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + r + "</body></html>");
|
|
892
|
+
const $ = N ? N.createHTML(r) : r;
|
|
893
|
+
if (Be === me)
|
|
894
894
|
try {
|
|
895
|
-
u = new
|
|
895
|
+
u = new x().parseFromString($, et);
|
|
896
896
|
} catch {
|
|
897
897
|
}
|
|
898
898
|
if (!u || !u.documentElement) {
|
|
899
|
-
u =
|
|
899
|
+
u = se.createDocument(Be, "template", null);
|
|
900
900
|
try {
|
|
901
|
-
u.documentElement.innerHTML =
|
|
901
|
+
u.documentElement.innerHTML = Pt ? ie : $;
|
|
902
902
|
} catch {
|
|
903
903
|
}
|
|
904
904
|
}
|
|
905
|
-
const
|
|
906
|
-
return
|
|
907
|
-
}, "_initDocument"), An = /* @__PURE__ */ h(function(
|
|
908
|
-
return
|
|
909
|
-
|
|
910
|
-
|
|
905
|
+
const X = u.body || u.documentElement;
|
|
906
|
+
return r && b && X.insertBefore(e.createTextNode(b), X.childNodes[0] || null), Be === me ? Pe.call(u, Re ? "html" : "body")[0] : Re ? u.documentElement : X;
|
|
907
|
+
}, "_initDocument"), An = /* @__PURE__ */ h(function(r) {
|
|
908
|
+
return re.call(
|
|
909
|
+
r.ownerDocument || r,
|
|
910
|
+
r,
|
|
911
911
|
// eslint-disable-next-line no-bitwise
|
|
912
912
|
c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
|
|
913
913
|
null
|
|
914
914
|
);
|
|
915
|
-
}, "_createNodeIterator"),
|
|
916
|
-
return
|
|
917
|
-
}, "_isClobbered"),
|
|
918
|
-
return typeof o == "function" &&
|
|
915
|
+
}, "_createNodeIterator"), Ft = /* @__PURE__ */ h(function(r) {
|
|
916
|
+
return r instanceof d && (typeof r.nodeName != "string" || typeof r.textContent != "string" || typeof r.removeChild != "function" || !(r.attributes instanceof w) || typeof r.removeAttribute != "function" || typeof r.setAttribute != "function" || typeof r.namespaceURI != "string" || typeof r.insertBefore != "function" || typeof r.hasChildNodes != "function");
|
|
917
|
+
}, "_isClobbered"), Ht = /* @__PURE__ */ h(function(r) {
|
|
918
|
+
return typeof o == "function" && r instanceof o;
|
|
919
919
|
}, "_isNode");
|
|
920
|
-
function
|
|
921
|
-
|
|
922
|
-
|
|
920
|
+
function be(y, r, u) {
|
|
921
|
+
tt(y, (b) => {
|
|
922
|
+
b.call(t, r, u, Fe);
|
|
923
923
|
});
|
|
924
924
|
}
|
|
925
|
-
h(
|
|
926
|
-
const En = /* @__PURE__ */ h(function(
|
|
925
|
+
h(be, "_executeHooks");
|
|
926
|
+
const En = /* @__PURE__ */ h(function(r) {
|
|
927
927
|
let u = null;
|
|
928
|
-
if (
|
|
929
|
-
return
|
|
930
|
-
const
|
|
931
|
-
if (
|
|
932
|
-
tagName:
|
|
933
|
-
allowedTags:
|
|
934
|
-
}),
|
|
935
|
-
return
|
|
936
|
-
if (
|
|
937
|
-
if (!
|
|
928
|
+
if (be(q.beforeSanitizeElements, r, null), Ft(r))
|
|
929
|
+
return he(r), !0;
|
|
930
|
+
const b = G(r.nodeName);
|
|
931
|
+
if (be(q.uponSanitizeElement, r, {
|
|
932
|
+
tagName: b,
|
|
933
|
+
allowedTags: v
|
|
934
|
+
}), Qe && r.hasChildNodes() && !Ht(r.firstElementChild) && Y(/<[/\w!]/g, r.innerHTML) && Y(/<[/\w!]/g, r.textContent) || Qe && r.namespaceURI === me && b === "style" && Ht(r.firstElementChild) || r.nodeType === it.progressingInstruction || Qe && r.nodeType === it.comment && Y(/<[/\w]/g, r.data))
|
|
935
|
+
return he(r), !0;
|
|
936
|
+
if (ae[b] || !(le.tagCheck instanceof Function && le.tagCheck(b)) && !v[b]) {
|
|
937
|
+
if (!ae[b] && Rn(b) && (C.tagNameCheck instanceof RegExp && Y(C.tagNameCheck, b) || C.tagNameCheck instanceof Function && C.tagNameCheck(b)))
|
|
938
938
|
return !1;
|
|
939
|
-
if (
|
|
940
|
-
const
|
|
941
|
-
if (
|
|
942
|
-
const
|
|
943
|
-
for (let
|
|
944
|
-
const oe =
|
|
945
|
-
|
|
939
|
+
if (Lt && !ge[b]) {
|
|
940
|
+
const $ = W(r) || r.parentNode, X = Q(r) || r.childNodes;
|
|
941
|
+
if (X && $) {
|
|
942
|
+
const F = X.length;
|
|
943
|
+
for (let te = F - 1; te >= 0; --te) {
|
|
944
|
+
const oe = E(X[te], !0);
|
|
945
|
+
$.insertBefore(oe, z(r));
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
}
|
|
949
|
-
return
|
|
949
|
+
return he(r), !0;
|
|
950
950
|
}
|
|
951
|
-
return
|
|
952
|
-
u =
|
|
953
|
-
}),
|
|
954
|
-
element:
|
|
955
|
-
}),
|
|
956
|
-
}, "_sanitizeElements"), _n = /* @__PURE__ */ h(function(
|
|
957
|
-
if (
|
|
951
|
+
return r instanceof p && !Is(r) || (b === "noscript" || b === "noembed" || b === "noframes") && Y(/<\/no(script|embed|frames)/i, r.innerHTML) ? (he(r), !0) : (_e && r.nodeType === it.text && (u = r.textContent, tt([we, Ae, Ne], ($) => {
|
|
952
|
+
u = He(u, $, " ");
|
|
953
|
+
}), r.textContent !== u && (nt(t.removed, {
|
|
954
|
+
element: r.cloneNode()
|
|
955
|
+
}), r.textContent = u)), be(q.afterSanitizeElements, r, null), !1);
|
|
956
|
+
}, "_sanitizeElements"), _n = /* @__PURE__ */ h(function(r, u, b) {
|
|
957
|
+
if (Ee[u] || gn && (u === "id" || u === "name") && (b in e || b in Rs))
|
|
958
958
|
return !1;
|
|
959
|
-
if (!(
|
|
960
|
-
if (!(
|
|
961
|
-
if (!(
|
|
962
|
-
if (!
|
|
959
|
+
if (!(Ct && !Ee[u] && Y(_t, u))) {
|
|
960
|
+
if (!(pn && Y(Rt, u))) {
|
|
961
|
+
if (!(le.attributeCheck instanceof Function && le.attributeCheck(u, r))) {
|
|
962
|
+
if (!g[u] || Ee[u]) {
|
|
963
963
|
if (
|
|
964
964
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
965
965
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
966
966
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
967
|
-
!(Rn(
|
|
967
|
+
!(Rn(r) && (C.tagNameCheck instanceof RegExp && Y(C.tagNameCheck, r) || C.tagNameCheck instanceof Function && C.tagNameCheck(r)) && (C.attributeNameCheck instanceof RegExp && Y(C.attributeNameCheck, u) || C.attributeNameCheck instanceof Function && C.attributeNameCheck(u, r)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
968
968
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
969
|
-
u === "is" &&
|
|
969
|
+
u === "is" && C.allowCustomizedBuiltInElements && (C.tagNameCheck instanceof RegExp && Y(C.tagNameCheck, b) || C.tagNameCheck instanceof Function && C.tagNameCheck(b)))
|
|
970
970
|
) return !1;
|
|
971
|
-
} else if (!
|
|
972
|
-
if (!
|
|
973
|
-
if (!((u === "src" || u === "xlink:href" || u === "href") &&
|
|
974
|
-
if (!(
|
|
975
|
-
if (
|
|
971
|
+
} else if (!zt[u]) {
|
|
972
|
+
if (!Y(Ke, He(b, ct, ""))) {
|
|
973
|
+
if (!((u === "src" || u === "xlink:href" || u === "href") && r !== "script" && Hn(b, "data:") === 0 && bn[r])) {
|
|
974
|
+
if (!(dn && !Y(It, He(b, ct, "")))) {
|
|
975
|
+
if (b)
|
|
976
976
|
return !1;
|
|
977
977
|
}
|
|
978
978
|
}
|
|
@@ -982,191 +982,191 @@ function ds() {
|
|
|
982
982
|
}
|
|
983
983
|
}
|
|
984
984
|
return !0;
|
|
985
|
-
}, "_isValidAttribute"), Cs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Rn = /* @__PURE__ */ h(function(
|
|
986
|
-
return !Cs[
|
|
987
|
-
}, "_isBasicCustomElement"), In = /* @__PURE__ */ h(function(
|
|
988
|
-
|
|
985
|
+
}, "_isValidAttribute"), Cs = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), Rn = /* @__PURE__ */ h(function(r) {
|
|
986
|
+
return !Cs[at(r)] && Y(ut, r);
|
|
987
|
+
}, "_isBasicCustomElement"), In = /* @__PURE__ */ h(function(r) {
|
|
988
|
+
be(q.beforeSanitizeAttributes, r, null);
|
|
989
989
|
const {
|
|
990
990
|
attributes: u
|
|
991
|
-
} =
|
|
992
|
-
if (!u ||
|
|
991
|
+
} = r;
|
|
992
|
+
if (!u || Ft(r))
|
|
993
993
|
return;
|
|
994
|
-
const
|
|
994
|
+
const b = {
|
|
995
995
|
attrName: "",
|
|
996
996
|
attrValue: "",
|
|
997
997
|
keepAttr: !0,
|
|
998
|
-
allowedAttributes:
|
|
998
|
+
allowedAttributes: g,
|
|
999
999
|
forceKeepAttr: void 0
|
|
1000
1000
|
};
|
|
1001
|
-
let
|
|
1002
|
-
for (;
|
|
1003
|
-
const
|
|
1004
|
-
name:
|
|
1005
|
-
namespaceURI:
|
|
1001
|
+
let $ = u.length;
|
|
1002
|
+
for (; $--; ) {
|
|
1003
|
+
const X = u[$], {
|
|
1004
|
+
name: F,
|
|
1005
|
+
namespaceURI: te,
|
|
1006
1006
|
value: oe
|
|
1007
|
-
} =
|
|
1008
|
-
let
|
|
1009
|
-
if (
|
|
1010
|
-
|
|
1007
|
+
} = X, pe = G(F), Gt = oe;
|
|
1008
|
+
let V = F === "value" ? Gt : si(Gt);
|
|
1009
|
+
if (b.attrName = pe, b.attrValue = V, b.keepAttr = !0, b.forceKeepAttr = void 0, be(q.uponSanitizeAttribute, r, b), V = b.attrValue, mn && (pe === "id" || pe === "name") && Hn(V, xn) !== 0 && (Ie(F, r), V = xn + V), Qe && Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, V)) {
|
|
1010
|
+
Ie(F, r);
|
|
1011
1011
|
continue;
|
|
1012
1012
|
}
|
|
1013
|
-
if (
|
|
1014
|
-
|
|
1013
|
+
if (pe === "attributename" && Fn(V, "href")) {
|
|
1014
|
+
Ie(F, r);
|
|
1015
1015
|
continue;
|
|
1016
1016
|
}
|
|
1017
|
-
if (
|
|
1017
|
+
if (b.forceKeepAttr)
|
|
1018
1018
|
continue;
|
|
1019
|
-
if (!
|
|
1020
|
-
|
|
1019
|
+
if (!b.keepAttr) {
|
|
1020
|
+
Ie(F, r);
|
|
1021
1021
|
continue;
|
|
1022
1022
|
}
|
|
1023
|
-
if (!fn &&
|
|
1024
|
-
|
|
1023
|
+
if (!fn && Y(/\/>/i, V)) {
|
|
1024
|
+
Ie(F, r);
|
|
1025
1025
|
continue;
|
|
1026
1026
|
}
|
|
1027
|
-
|
|
1028
|
-
|
|
1027
|
+
_e && tt([we, Ae, Ne], (Mn) => {
|
|
1028
|
+
V = He(V, Mn, " ");
|
|
1029
1029
|
});
|
|
1030
|
-
const Dn =
|
|
1031
|
-
if (!_n(Dn,
|
|
1032
|
-
|
|
1030
|
+
const Dn = G(r.nodeName);
|
|
1031
|
+
if (!_n(Dn, pe, V)) {
|
|
1032
|
+
Ie(F, r);
|
|
1033
1033
|
continue;
|
|
1034
1034
|
}
|
|
1035
|
-
if (
|
|
1036
|
-
switch (
|
|
1035
|
+
if (N && typeof m == "object" && typeof m.getAttributeType == "function" && !te)
|
|
1036
|
+
switch (m.getAttributeType(Dn, pe)) {
|
|
1037
1037
|
case "TrustedHTML": {
|
|
1038
|
-
|
|
1038
|
+
V = N.createHTML(V);
|
|
1039
1039
|
break;
|
|
1040
1040
|
}
|
|
1041
1041
|
case "TrustedScriptURL": {
|
|
1042
|
-
|
|
1042
|
+
V = N.createScriptURL(V);
|
|
1043
1043
|
break;
|
|
1044
1044
|
}
|
|
1045
1045
|
}
|
|
1046
|
-
if (
|
|
1046
|
+
if (V !== Gt)
|
|
1047
1047
|
try {
|
|
1048
|
-
|
|
1048
|
+
te ? r.setAttributeNS(te, F, V) : r.setAttribute(F, V), Ft(r) ? he(r) : Bn(t.removed);
|
|
1049
1049
|
} catch {
|
|
1050
|
-
|
|
1050
|
+
Ie(F, r);
|
|
1051
1051
|
}
|
|
1052
1052
|
}
|
|
1053
|
-
|
|
1054
|
-
}, "_sanitizeAttributes"), Cn = /* @__PURE__ */ h(function(
|
|
1053
|
+
be(q.afterSanitizeAttributes, r, null);
|
|
1054
|
+
}, "_sanitizeAttributes"), Cn = /* @__PURE__ */ h(function(r) {
|
|
1055
1055
|
let u = null;
|
|
1056
|
-
const
|
|
1057
|
-
for (
|
|
1058
|
-
|
|
1059
|
-
|
|
1056
|
+
const b = An(r);
|
|
1057
|
+
for (be(q.beforeSanitizeShadowDOM, r, null); u = b.nextNode(); )
|
|
1058
|
+
be(q.uponSanitizeShadowNode, u, null), En(u), In(u), u.content instanceof s && Cn(u.content);
|
|
1059
|
+
be(q.afterSanitizeShadowDOM, r, null);
|
|
1060
1060
|
}, "_sanitizeShadowDOM");
|
|
1061
|
-
return t.sanitize = function(
|
|
1062
|
-
let
|
|
1063
|
-
if (
|
|
1064
|
-
throw
|
|
1061
|
+
return t.sanitize = function(y) {
|
|
1062
|
+
let r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, b = null, $ = null, X = null;
|
|
1063
|
+
if (Pt = !y, Pt && (y = "<!-->"), typeof y != "string" && !Ht(y) && (y = oi(y), typeof y != "string"))
|
|
1064
|
+
throw mt("dirty is not a string, aborting");
|
|
1065
1065
|
if (!t.isSupported)
|
|
1066
|
-
return
|
|
1067
|
-
if (
|
|
1068
|
-
const oe =
|
|
1066
|
+
return y;
|
|
1067
|
+
if (Dt || Bt(r), t.removed = [], typeof y == "string" && (Je = !1), Je) {
|
|
1068
|
+
const oe = y.nodeName;
|
|
1069
1069
|
if (typeof oe == "string") {
|
|
1070
|
-
const
|
|
1071
|
-
if (!
|
|
1072
|
-
throw
|
|
1070
|
+
const pe = G(oe);
|
|
1071
|
+
if (!v[pe] || ae[pe])
|
|
1072
|
+
throw mt("root node is forbidden and cannot be sanitized in-place");
|
|
1073
1073
|
}
|
|
1074
|
-
} else if (
|
|
1075
|
-
u = Sn("<!---->"),
|
|
1074
|
+
} else if (y instanceof o)
|
|
1075
|
+
u = Sn("<!---->"), b = u.ownerDocument.importNode(y, !0), b.nodeType === it.element && b.nodeName === "BODY" || b.nodeName === "HTML" ? u = b : u.appendChild(b);
|
|
1076
1076
|
else {
|
|
1077
|
-
if (
|
|
1078
|
-
|
|
1079
|
-
return
|
|
1080
|
-
if (u = Sn(
|
|
1081
|
-
return
|
|
1082
|
-
}
|
|
1083
|
-
u &&
|
|
1084
|
-
const
|
|
1085
|
-
for (;
|
|
1086
|
-
En(
|
|
1087
|
-
if (
|
|
1088
|
-
return
|
|
1089
|
-
if (
|
|
1090
|
-
if (
|
|
1077
|
+
if (!$e && !_e && !Re && // eslint-disable-next-line unicorn/prefer-includes
|
|
1078
|
+
y.indexOf("<") === -1)
|
|
1079
|
+
return N && pt ? N.createHTML(y) : y;
|
|
1080
|
+
if (u = Sn(y), !u)
|
|
1081
|
+
return $e ? null : pt ? ie : "";
|
|
1082
|
+
}
|
|
1083
|
+
u && Mt && he(u.firstChild);
|
|
1084
|
+
const F = An(Je ? y : u);
|
|
1085
|
+
for (; $ = F.nextNode(); )
|
|
1086
|
+
En($), In($), $.content instanceof s && Cn($.content);
|
|
1087
|
+
if (Je)
|
|
1088
|
+
return y;
|
|
1089
|
+
if ($e) {
|
|
1090
|
+
if (_e) {
|
|
1091
1091
|
u.normalize();
|
|
1092
1092
|
let oe = u.innerHTML;
|
|
1093
|
-
|
|
1094
|
-
oe =
|
|
1093
|
+
tt([we, Ae, Ne], (pe) => {
|
|
1094
|
+
oe = He(oe, pe, " ");
|
|
1095
1095
|
}), u.innerHTML = oe;
|
|
1096
1096
|
}
|
|
1097
|
-
if (
|
|
1098
|
-
for (
|
|
1099
|
-
|
|
1097
|
+
if (ht)
|
|
1098
|
+
for (X = ze.call(u.ownerDocument); u.firstChild; )
|
|
1099
|
+
X.appendChild(u.firstChild);
|
|
1100
1100
|
else
|
|
1101
|
-
|
|
1102
|
-
return (
|
|
1103
|
-
}
|
|
1104
|
-
let
|
|
1105
|
-
return
|
|
1106
|
-
` +
|
|
1107
|
-
|
|
1108
|
-
}),
|
|
1101
|
+
X = u;
|
|
1102
|
+
return (g.shadowroot || g.shadowrootmode) && (X = L.call(n, X, !0)), X;
|
|
1103
|
+
}
|
|
1104
|
+
let te = Re ? u.outerHTML : u.innerHTML;
|
|
1105
|
+
return Re && v["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && Y(ps, u.ownerDocument.doctype.name) && (te = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1106
|
+
` + te), _e && tt([we, Ae, Ne], (oe) => {
|
|
1107
|
+
te = He(te, oe, " ");
|
|
1108
|
+
}), N && pt ? N.createHTML(te) : te;
|
|
1109
1109
|
}, t.setConfig = function() {
|
|
1110
|
-
let
|
|
1111
|
-
|
|
1110
|
+
let y = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1111
|
+
Bt(y), Dt = !0;
|
|
1112
1112
|
}, t.clearConfig = function() {
|
|
1113
|
-
|
|
1114
|
-
}, t.isValidAttribute = function(
|
|
1115
|
-
|
|
1116
|
-
const
|
|
1117
|
-
return _n(
|
|
1118
|
-
}, t.addHook = function(
|
|
1119
|
-
typeof
|
|
1120
|
-
}, t.removeHook = function(
|
|
1121
|
-
if (
|
|
1122
|
-
const u =
|
|
1123
|
-
return u === -1 ? void 0 :
|
|
1124
|
-
}
|
|
1125
|
-
return Bn(
|
|
1126
|
-
}, t.removeHooks = function(
|
|
1127
|
-
|
|
1113
|
+
Fe = null, Dt = !1;
|
|
1114
|
+
}, t.isValidAttribute = function(y, r, u) {
|
|
1115
|
+
Fe || Bt({});
|
|
1116
|
+
const b = G(y), $ = G(r);
|
|
1117
|
+
return _n(b, $, u);
|
|
1118
|
+
}, t.addHook = function(y, r) {
|
|
1119
|
+
typeof r == "function" && nt(q[y], r);
|
|
1120
|
+
}, t.removeHook = function(y, r) {
|
|
1121
|
+
if (r !== void 0) {
|
|
1122
|
+
const u = ti(q[y], r);
|
|
1123
|
+
return u === -1 ? void 0 : ni(q[y], u, 1)[0];
|
|
1124
|
+
}
|
|
1125
|
+
return Bn(q[y]);
|
|
1126
|
+
}, t.removeHooks = function(y) {
|
|
1127
|
+
q[y] = [];
|
|
1128
1128
|
}, t.removeAllHooks = function() {
|
|
1129
|
-
|
|
1129
|
+
q = Xn();
|
|
1130
1130
|
}, t;
|
|
1131
1131
|
}
|
|
1132
1132
|
h(ds, "createDOMPurify");
|
|
1133
|
-
var
|
|
1134
|
-
function
|
|
1133
|
+
var yi = ds();
|
|
1134
|
+
function tn() {
|
|
1135
1135
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1136
1136
|
}
|
|
1137
|
-
h(
|
|
1138
|
-
var
|
|
1137
|
+
h(tn, "z");
|
|
1138
|
+
var Oe = tn();
|
|
1139
1139
|
function fs(a) {
|
|
1140
|
-
|
|
1140
|
+
Oe = a;
|
|
1141
1141
|
}
|
|
1142
1142
|
h(fs, "G");
|
|
1143
|
-
var
|
|
1143
|
+
var Me = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1144
1144
|
function M(a, t = "") {
|
|
1145
|
-
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((
|
|
1145
|
+
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((i, s) => {
|
|
1146
1146
|
let l = typeof s == "string" ? s : s.source;
|
|
1147
|
-
return l = l.replace(
|
|
1147
|
+
return l = l.replace(K.caret, "$1"), e = e.replace(i, l), n;
|
|
1148
1148
|
}, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
|
|
1149
1149
|
return n;
|
|
1150
1150
|
}
|
|
1151
1151
|
h(M, "d");
|
|
1152
|
-
var
|
|
1152
|
+
var Ti = ((a = "") => {
|
|
1153
1153
|
try {
|
|
1154
1154
|
return !!new RegExp("(?<=1)(?<!1)" + a);
|
|
1155
1155
|
} catch {
|
|
1156
1156
|
return !1;
|
|
1157
1157
|
}
|
|
1158
|
-
})(),
|
|
1159
|
-
]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() },
|
|
1158
|
+
})(), K = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] +\S/, listReplaceTask: /^\[[ xX]\] +/, listTaskCheckbox: /\[[ xX]\]/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: /* @__PURE__ */ h((a) => new RegExp(`^( {0,3}${a})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((a) => new RegExp(`^ {0,${Math.min(3, a - 1)}}>`), "blockquoteBeginRegex") }, Si = /^(?:[ \t]*(?:\n|$))+/, Ai = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Ei = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ot = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, _i = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, nn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, gs = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ms = M(gs).replace(/bull/g, nn).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(), Ri = M(gs).replace(/bull/g, nn).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(), sn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Ii = /^[^\n]+/, rn = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ci = M(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", rn).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Di = M(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, nn).getRegex(), At = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", an = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Mi = M("^ {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", an).replace("tag", At).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), xs = M(sn).replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), Li = M(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", xs).getRegex(), ln = { blockquote: Li, code: Ai, def: Ci, fences: Ei, heading: _i, hr: ot, html: Mi, lheading: ms, list: Di, newline: Si, paragraph: xs, table: Me, text: Ii }, Kn = M("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex(), Oi = { ...ln, lheading: Ri, table: Kn, paragraph: M(sn).replace("hr", ot).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Kn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", At).getRegex() }, zi = { ...ln, html: M(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", an).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: Me, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: M(sn).replace("hr", ot).replace("heading", ` *#{1,6} *[^
|
|
1159
|
+
]`).replace("lheading", ms).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Pi = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Ni = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, bs = /^( {2,}|\\)\n(?!\s*$)/, $i = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Xe = /[\p{P}\p{S}]/u, Et = /[\s\p{P}\p{S}]/u, on = /[^\s\p{P}\p{S}]/u, Ui = M(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Et).getRegex(), ks = /(?!~)[\p{P}\p{S}]/u, Bi = /(?!~)[\s\p{P}\p{S}]/u, Fi = /(?:[^\s\p{P}\p{S}]|~)/u, Hi = M(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", Ti ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ws = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Gi = M(ws, "u").replace(/punct/g, Xe).getRegex(), ji = M(ws, "u").replace(/punct/g, ks).getRegex(), vs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Wi = M(vs, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Xe).getRegex(), qi = M(vs, "gu").replace(/notPunctSpace/g, Fi).replace(/punctSpace/g, Bi).replace(/punct/g, ks).getRegex(), Vi = M("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Xe).getRegex(), Yi = M(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Xe).getRegex(), Zi = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Xi = M(Zi, "gu").replace(/notPunctSpace/g, on).replace(/punctSpace/g, Et).replace(/punct/g, Xe).getRegex(), Ki = M(/\\(punct)/, "gu").replace(/punct/g, Xe).getRegex(), Qi = M(/^<(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(), Ji = M(an).replace("(?:-->|$)", "-->").getRegex(), er = M("^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", Ji).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), vt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, tr = M(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", vt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), ys = M(/^!?\[(label)\]\[(ref)\]/).replace("label", vt).replace("ref", rn).getRegex(), Ts = M(/^!?\[(ref)\](?:\[\])?/).replace("ref", rn).getRegex(), nr = M("reflink|nolink(?!\\()", "g").replace("reflink", ys).replace("nolink", Ts).getRegex(), Qn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, cn = { _backpedal: Me, anyPunctuation: Ki, autolink: Qi, blockSkip: Hi, br: bs, code: Ni, del: Me, delLDelim: Me, delRDelim: Me, emStrongLDelim: Gi, emStrongRDelimAst: Wi, emStrongRDelimUnd: Vi, escape: Pi, link: tr, nolink: Ts, punctuation: Ui, reflink: ys, reflinkSearch: nr, tag: er, text: $i, url: Me }, sr = { ...cn, link: M(/^!?\[(label)\]\((.*?)\)/).replace("label", vt).getRegex(), reflink: M(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", vt).getRegex() }, Jt = { ...cn, emStrongRDelimAst: qi, emStrongLDelim: ji, delLDelim: Yi, delRDelim: Xi, url: M(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Qn).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: M(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Qn).getRegex() }, ir = { ...Jt, br: M(bs).replace("{2,}", "*").getRegex(), text: M(Jt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, bt = { normal: ln, gfm: Oi, pedantic: zi }, rt = { normal: cn, gfm: Jt, breaks: ir, pedantic: sr }, rr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Jn = /* @__PURE__ */ h((a) => rr[a], "de");
|
|
1160
1160
|
function xe(a, t) {
|
|
1161
1161
|
if (t) {
|
|
1162
|
-
if (
|
|
1163
|
-
} else if (
|
|
1162
|
+
if (K.escapeTest.test(a)) return a.replace(K.escapeReplace, Jn);
|
|
1163
|
+
} else if (K.escapeTestNoEncode.test(a)) return a.replace(K.escapeReplaceNoEncode, Jn);
|
|
1164
1164
|
return a;
|
|
1165
1165
|
}
|
|
1166
1166
|
h(xe, "O");
|
|
1167
1167
|
function es(a) {
|
|
1168
1168
|
try {
|
|
1169
|
-
a = encodeURI(a).replace(
|
|
1169
|
+
a = encodeURI(a).replace(K.percentDecode, "%");
|
|
1170
1170
|
} catch {
|
|
1171
1171
|
return null;
|
|
1172
1172
|
}
|
|
@@ -1174,35 +1174,35 @@ function es(a) {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
h(es, "J");
|
|
1176
1176
|
function ts(a, t) {
|
|
1177
|
-
let e = a.replace(
|
|
1178
|
-
let
|
|
1179
|
-
for (; --c >= 0 && o[c] === "\\"; )
|
|
1180
|
-
return
|
|
1181
|
-
}), n = e.split(
|
|
1177
|
+
let e = a.replace(K.findPipe, (s, l, o) => {
|
|
1178
|
+
let p = !1, c = l;
|
|
1179
|
+
for (; --c >= 0 && o[c] === "\\"; ) p = !p;
|
|
1180
|
+
return p ? "|" : " |";
|
|
1181
|
+
}), n = e.split(K.splitPipe), i = 0;
|
|
1182
1182
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
1183
1183
|
else for (; n.length < t; ) n.push("");
|
|
1184
|
-
for (;
|
|
1184
|
+
for (; i < n.length; i++) n[i] = n[i].trim().replace(K.slashPipe, "|");
|
|
1185
1185
|
return n;
|
|
1186
1186
|
}
|
|
1187
1187
|
h(ts, "V");
|
|
1188
|
-
function
|
|
1188
|
+
function ve(a, t, e) {
|
|
1189
1189
|
let n = a.length;
|
|
1190
1190
|
if (n === 0) return "";
|
|
1191
|
-
let
|
|
1192
|
-
for (;
|
|
1193
|
-
|
|
1194
|
-
return a.slice(0, n -
|
|
1191
|
+
let i = 0;
|
|
1192
|
+
for (; i < n && a.charAt(n - i - 1) === t; )
|
|
1193
|
+
i++;
|
|
1194
|
+
return a.slice(0, n - i);
|
|
1195
1195
|
}
|
|
1196
|
-
h(
|
|
1196
|
+
h(ve, "$");
|
|
1197
1197
|
function ns(a) {
|
|
1198
1198
|
let t = a.split(`
|
|
1199
1199
|
`), e = t.length - 1;
|
|
1200
|
-
for (; e >= 0 &&
|
|
1200
|
+
for (; e >= 0 && K.blankLine.test(t[e]); ) e--;
|
|
1201
1201
|
return t.length - e <= 2 ? a : t.slice(0, e + 1).join(`
|
|
1202
1202
|
`);
|
|
1203
1203
|
}
|
|
1204
1204
|
h(ns, "Y");
|
|
1205
|
-
function
|
|
1205
|
+
function ar(a, t) {
|
|
1206
1206
|
if (a.indexOf(t[1]) === -1) return -1;
|
|
1207
1207
|
let e = 0;
|
|
1208
1208
|
for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
|
|
@@ -1210,43 +1210,43 @@ function ai(a, t) {
|
|
|
1210
1210
|
else if (a[n] === t[1] && (e--, e < 0)) return n;
|
|
1211
1211
|
return e > 0 ? -2 : -1;
|
|
1212
1212
|
}
|
|
1213
|
-
h(
|
|
1214
|
-
function
|
|
1213
|
+
h(ar, "ge");
|
|
1214
|
+
function lr(a, t = 0) {
|
|
1215
1215
|
let e = t, n = "";
|
|
1216
|
-
for (let
|
|
1216
|
+
for (let i of a) if (i === " ") {
|
|
1217
1217
|
let s = 4 - e % 4;
|
|
1218
1218
|
n += " ".repeat(s), e += s;
|
|
1219
|
-
} else n +=
|
|
1219
|
+
} else n += i, e++;
|
|
1220
1220
|
return n;
|
|
1221
1221
|
}
|
|
1222
|
-
h(
|
|
1223
|
-
function ss(a, t, e, n,
|
|
1224
|
-
let s = t.href, l = t.title || null, o = a[1].replace(
|
|
1222
|
+
h(lr, "fe");
|
|
1223
|
+
function ss(a, t, e, n, i) {
|
|
1224
|
+
let s = t.href, l = t.title || null, o = a[1].replace(i.other.outputLinkReplace, "$1");
|
|
1225
1225
|
n.state.inLink = !0;
|
|
1226
|
-
let
|
|
1227
|
-
return n.state.inLink = !1,
|
|
1226
|
+
let p = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: s, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
1227
|
+
return n.state.inLink = !1, p;
|
|
1228
1228
|
}
|
|
1229
1229
|
h(ss, "me");
|
|
1230
|
-
function
|
|
1230
|
+
function or(a, t, e) {
|
|
1231
1231
|
let n = a.match(e.other.indentCodeCompensation);
|
|
1232
1232
|
if (n === null) return t;
|
|
1233
|
-
let
|
|
1233
|
+
let i = n[1];
|
|
1234
1234
|
return t.split(`
|
|
1235
1235
|
`).map((s) => {
|
|
1236
1236
|
let l = s.match(e.other.beginningSpace);
|
|
1237
1237
|
if (l === null) return s;
|
|
1238
1238
|
let [o] = l;
|
|
1239
|
-
return o.length >=
|
|
1239
|
+
return o.length >= i.length ? s.slice(i.length) : s;
|
|
1240
1240
|
}).join(`
|
|
1241
1241
|
`);
|
|
1242
1242
|
}
|
|
1243
|
-
h(
|
|
1244
|
-
var
|
|
1243
|
+
h(or, "rt");
|
|
1244
|
+
var We, yt = (We = class {
|
|
1245
1245
|
constructor(t) {
|
|
1246
1246
|
D(this, "options");
|
|
1247
1247
|
D(this, "rules");
|
|
1248
1248
|
D(this, "lexer");
|
|
1249
|
-
this.options = t ||
|
|
1249
|
+
this.options = t || Oe;
|
|
1250
1250
|
}
|
|
1251
1251
|
space(t) {
|
|
1252
1252
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -1255,15 +1255,15 @@ var qe, St = (qe = class {
|
|
|
1255
1255
|
code(t) {
|
|
1256
1256
|
let e = this.rules.block.code.exec(t);
|
|
1257
1257
|
if (e) {
|
|
1258
|
-
let n = this.options.pedantic ? e[0] : ns(e[0]),
|
|
1259
|
-
return { type: "code", raw: n, codeBlockStyle: "indented", text:
|
|
1258
|
+
let n = this.options.pedantic ? e[0] : ns(e[0]), i = n.replace(this.rules.other.codeRemoveIndent, "");
|
|
1259
|
+
return { type: "code", raw: n, codeBlockStyle: "indented", text: i };
|
|
1260
1260
|
}
|
|
1261
1261
|
}
|
|
1262
1262
|
fences(t) {
|
|
1263
1263
|
let e = this.rules.block.fences.exec(t);
|
|
1264
1264
|
if (e) {
|
|
1265
|
-
let n = e[0],
|
|
1266
|
-
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text:
|
|
1265
|
+
let n = e[0], i = or(n, e[3] || "", this.rules);
|
|
1266
|
+
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: i };
|
|
1267
1267
|
}
|
|
1268
1268
|
}
|
|
1269
1269
|
heading(t) {
|
|
@@ -1271,118 +1271,118 @@ var qe, St = (qe = class {
|
|
|
1271
1271
|
if (e) {
|
|
1272
1272
|
let n = e[2].trim();
|
|
1273
1273
|
if (this.rules.other.endingHash.test(n)) {
|
|
1274
|
-
let
|
|
1275
|
-
(this.options.pedantic || !
|
|
1274
|
+
let i = ve(n, "#");
|
|
1275
|
+
(this.options.pedantic || !i || this.rules.other.endingSpaceChar.test(i)) && (n = i.trim());
|
|
1276
1276
|
}
|
|
1277
|
-
return { type: "heading", raw:
|
|
1277
|
+
return { type: "heading", raw: ve(e[0], `
|
|
1278
1278
|
`), depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
1279
1279
|
}
|
|
1280
1280
|
}
|
|
1281
1281
|
hr(t) {
|
|
1282
1282
|
let e = this.rules.block.hr.exec(t);
|
|
1283
|
-
if (e) return { type: "hr", raw:
|
|
1283
|
+
if (e) return { type: "hr", raw: ve(e[0], `
|
|
1284
1284
|
`) };
|
|
1285
1285
|
}
|
|
1286
1286
|
blockquote(t) {
|
|
1287
1287
|
let e = this.rules.block.blockquote.exec(t);
|
|
1288
1288
|
if (e) {
|
|
1289
|
-
let n =
|
|
1289
|
+
let n = ve(e[0], `
|
|
1290
1290
|
`).split(`
|
|
1291
|
-
`),
|
|
1291
|
+
`), i = "", s = "", l = [];
|
|
1292
1292
|
for (; n.length > 0; ) {
|
|
1293
|
-
let o = !1,
|
|
1294
|
-
for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c]))
|
|
1295
|
-
else if (!o)
|
|
1293
|
+
let o = !1, p = [], c;
|
|
1294
|
+
for (c = 0; c < n.length; c++) if (this.rules.other.blockquoteStart.test(n[c])) p.push(n[c]), o = !0;
|
|
1295
|
+
else if (!o) p.push(n[c]);
|
|
1296
1296
|
else break;
|
|
1297
1297
|
n = n.slice(c);
|
|
1298
|
-
let
|
|
1299
|
-
`),
|
|
1298
|
+
let w = p.join(`
|
|
1299
|
+
`), d = w.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1300
1300
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1301
|
-
|
|
1302
|
-
${
|
|
1303
|
-
${
|
|
1304
|
-
let
|
|
1305
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
1306
|
-
let
|
|
1307
|
-
if (
|
|
1308
|
-
if (
|
|
1309
|
-
let
|
|
1301
|
+
i = i ? `${i}
|
|
1302
|
+
${w}` : w, s = s ? `${s}
|
|
1303
|
+
${d}` : d;
|
|
1304
|
+
let x = this.lexer.state.top;
|
|
1305
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = x, n.length === 0) break;
|
|
1306
|
+
let m = l.at(-1);
|
|
1307
|
+
if (m?.type === "code") break;
|
|
1308
|
+
if (m?.type === "blockquote") {
|
|
1309
|
+
let f = m, E = f.raw + `
|
|
1310
1310
|
` + n.join(`
|
|
1311
|
-
`), I = this.blockquote(
|
|
1312
|
-
l[l.length - 1] = I,
|
|
1311
|
+
`), I = this.blockquote(E);
|
|
1312
|
+
l[l.length - 1] = I, i = i.substring(0, i.length - f.raw.length) + I.raw, s = s.substring(0, s.length - f.text.length) + I.text;
|
|
1313
1313
|
break;
|
|
1314
|
-
} else if (
|
|
1315
|
-
let
|
|
1314
|
+
} else if (m?.type === "list") {
|
|
1315
|
+
let f = m, E = f.raw + `
|
|
1316
1316
|
` + n.join(`
|
|
1317
|
-
`), I = this.list(
|
|
1318
|
-
l[l.length - 1] = I,
|
|
1317
|
+
`), I = this.list(E);
|
|
1318
|
+
l[l.length - 1] = I, i = i.substring(0, i.length - m.raw.length) + I.raw, s = s.substring(0, s.length - f.raw.length) + I.raw, n = E.substring(l.at(-1).raw.length).split(`
|
|
1319
1319
|
`);
|
|
1320
1320
|
continue;
|
|
1321
1321
|
}
|
|
1322
1322
|
}
|
|
1323
|
-
return { type: "blockquote", raw:
|
|
1323
|
+
return { type: "blockquote", raw: i, tokens: l, text: s };
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
1326
1326
|
list(t) {
|
|
1327
1327
|
let e = this.rules.block.list.exec(t);
|
|
1328
1328
|
if (e) {
|
|
1329
|
-
let n = e[1].trim(),
|
|
1330
|
-
n =
|
|
1329
|
+
let n = e[1].trim(), i = n.length > 1, s = { type: "list", raw: "", ordered: i, start: i ? +n.slice(0, -1) : "", loose: !1, items: [] };
|
|
1330
|
+
n = i ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = i ? n : "[*+-]");
|
|
1331
1331
|
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1332
1332
|
for (; t; ) {
|
|
1333
|
-
let c = !1,
|
|
1333
|
+
let c = !1, w = "", d = "";
|
|
1334
1334
|
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1335
|
-
|
|
1336
|
-
let
|
|
1337
|
-
`, 1)[0], e[1].length),
|
|
1338
|
-
`, 1)[0],
|
|
1339
|
-
if (this.options.pedantic ? (
|
|
1340
|
-
`, t = t.substring(
|
|
1341
|
-
let I = this.rules.other.nextBulletRegex(
|
|
1335
|
+
w = e[0], t = t.substring(w.length);
|
|
1336
|
+
let x = lr(e[2].split(`
|
|
1337
|
+
`, 1)[0], e[1].length), m = t.split(`
|
|
1338
|
+
`, 1)[0], f = !x.trim(), E = 0;
|
|
1339
|
+
if (this.options.pedantic ? (E = 2, d = x.trimStart()) : f ? E = e[1].length + 1 : (E = x.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, d = x.slice(E), E += e[1].length), f && this.rules.other.blankLine.test(m) && (w += m + `
|
|
1340
|
+
`, t = t.substring(m.length + 1), c = !0), !c) {
|
|
1341
|
+
let I = this.rules.other.nextBulletRegex(E), z = this.rules.other.hrRegex(E), Q = this.rules.other.fencesBeginRegex(E), W = this.rules.other.headingBeginRegex(E), N = this.rules.other.htmlBeginRegex(E), ie = this.rules.other.blockquoteBeginRegex(E);
|
|
1342
1342
|
for (; t; ) {
|
|
1343
|
-
let
|
|
1344
|
-
`, 1)[0],
|
|
1345
|
-
if (
|
|
1346
|
-
if (
|
|
1347
|
-
` +
|
|
1343
|
+
let se = t.split(`
|
|
1344
|
+
`, 1)[0], re;
|
|
1345
|
+
if (m = se, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), re = m) : re = m.replace(this.rules.other.tabCharGlobal, " "), Q.test(m) || W.test(m) || N.test(m) || ie.test(m) || I.test(m) || z.test(m)) break;
|
|
1346
|
+
if (re.search(this.rules.other.nonSpaceChar) >= E || !m.trim()) d += `
|
|
1347
|
+
` + re.slice(E);
|
|
1348
1348
|
else {
|
|
1349
|
-
if (
|
|
1350
|
-
|
|
1351
|
-
` +
|
|
1349
|
+
if (f || x.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || Q.test(x) || W.test(x) || z.test(x)) break;
|
|
1350
|
+
d += `
|
|
1351
|
+
` + m;
|
|
1352
1352
|
}
|
|
1353
|
-
|
|
1354
|
-
`, t = t.substring(
|
|
1353
|
+
f = !m.trim(), w += se + `
|
|
1354
|
+
`, t = t.substring(se.length + 1), x = re.slice(E);
|
|
1355
1355
|
}
|
|
1356
1356
|
}
|
|
1357
|
-
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1357
|
+
s.loose || (o ? s.loose = !0 : this.rules.other.doubleBlankLine.test(w) && (o = !0)), s.items.push({ type: "list_item", raw: w, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), s.raw += w;
|
|
1358
1358
|
}
|
|
1359
|
-
let
|
|
1360
|
-
if (
|
|
1359
|
+
let p = s.items.at(-1);
|
|
1360
|
+
if (p) p.raw = p.raw.trimEnd(), p.text = p.text.trimEnd();
|
|
1361
1361
|
else return;
|
|
1362
1362
|
s.raw = s.raw.trimEnd();
|
|
1363
1363
|
for (let c of s.items) {
|
|
1364
1364
|
this.lexer.state.top = !1, c.tokens = this.lexer.blockTokens(c.text, []);
|
|
1365
|
-
let
|
|
1366
|
-
if (c.task && (
|
|
1367
|
-
c.text = c.text.replace(this.rules.other.listReplaceTask, ""),
|
|
1368
|
-
for (let
|
|
1369
|
-
this.lexer.inlineQueue[
|
|
1365
|
+
let w = c.tokens[0];
|
|
1366
|
+
if (c.task && (w?.type === "text" || w?.type === "paragraph")) {
|
|
1367
|
+
c.text = c.text.replace(this.rules.other.listReplaceTask, ""), w.raw = w.raw.replace(this.rules.other.listReplaceTask, ""), w.text = w.text.replace(this.rules.other.listReplaceTask, "");
|
|
1368
|
+
for (let x = this.lexer.inlineQueue.length - 1; x >= 0; x--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[x].src)) {
|
|
1369
|
+
this.lexer.inlineQueue[x].src = this.lexer.inlineQueue[x].src.replace(this.rules.other.listReplaceTask, "");
|
|
1370
1370
|
break;
|
|
1371
1371
|
}
|
|
1372
|
-
let
|
|
1373
|
-
if (
|
|
1374
|
-
let
|
|
1375
|
-
c.checked =
|
|
1372
|
+
let d = this.rules.other.listTaskCheckbox.exec(c.raw);
|
|
1373
|
+
if (d) {
|
|
1374
|
+
let x = { type: "checkbox", raw: d[0] + " ", checked: d[0] !== "[ ]" };
|
|
1375
|
+
c.checked = x.checked, s.loose ? c.tokens[0] && ["paragraph", "text"].includes(c.tokens[0].type) && "tokens" in c.tokens[0] && c.tokens[0].tokens ? (c.tokens[0].raw = x.raw + c.tokens[0].raw, c.tokens[0].text = x.raw + c.tokens[0].text, c.tokens[0].tokens.unshift(x)) : c.tokens.unshift({ type: "paragraph", raw: x.raw, text: x.raw, tokens: [x] }) : c.tokens.unshift(x);
|
|
1376
1376
|
}
|
|
1377
1377
|
} else c.task && (c.task = !1);
|
|
1378
1378
|
if (!s.loose) {
|
|
1379
|
-
let
|
|
1380
|
-
s.loose =
|
|
1379
|
+
let d = c.tokens.filter((m) => m.type === "space"), x = d.length > 0 && d.some((m) => this.rules.other.anyLine.test(m.raw));
|
|
1380
|
+
s.loose = x;
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
if (s.loose) for (let c of s.items) {
|
|
1384
1384
|
c.loose = !0;
|
|
1385
|
-
for (let
|
|
1385
|
+
for (let w of c.tokens) w.type === "text" && (w.type = "paragraph");
|
|
1386
1386
|
}
|
|
1387
1387
|
return s;
|
|
1388
1388
|
}
|
|
@@ -1397,21 +1397,21 @@ ${p}` : p;
|
|
|
1397
1397
|
def(t) {
|
|
1398
1398
|
let e = this.rules.block.def.exec(t);
|
|
1399
1399
|
if (e) {
|
|
1400
|
-
let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "),
|
|
1401
|
-
return { type: "def", tag: n, raw:
|
|
1402
|
-
`), href:
|
|
1400
|
+
let n = e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal, " "), i = e[2] ? e[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", s = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
|
|
1401
|
+
return { type: "def", tag: n, raw: ve(e[0], `
|
|
1402
|
+
`), href: i, title: s };
|
|
1403
1403
|
}
|
|
1404
1404
|
}
|
|
1405
1405
|
table(t) {
|
|
1406
1406
|
let e = this.rules.block.table.exec(t);
|
|
1407
1407
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1408
|
-
let n = ts(e[1]),
|
|
1409
|
-
`) : [], l = { type: "table", raw:
|
|
1408
|
+
let n = ts(e[1]), i = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), s = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1409
|
+
`) : [], l = { type: "table", raw: ve(e[0], `
|
|
1410
1410
|
`), header: [], align: [], rows: [] };
|
|
1411
|
-
if (n.length ===
|
|
1412
|
-
for (let o of
|
|
1411
|
+
if (n.length === i.length) {
|
|
1412
|
+
for (let o of i) 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);
|
|
1413
1413
|
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] });
|
|
1414
|
-
for (let o of s) l.rows.push(ts(o, l.header.length).map((
|
|
1414
|
+
for (let o of s) l.rows.push(ts(o, l.header.length).map((p, c) => ({ text: p, tokens: this.lexer.inline(p), header: !1, align: l.align[c] })));
|
|
1415
1415
|
return l;
|
|
1416
1416
|
}
|
|
1417
1417
|
}
|
|
@@ -1419,7 +1419,7 @@ ${p}` : p;
|
|
|
1419
1419
|
let e = this.rules.block.lheading.exec(t);
|
|
1420
1420
|
if (e) {
|
|
1421
1421
|
let n = e[1].trim();
|
|
1422
|
-
return { type: "heading", raw:
|
|
1422
|
+
return { type: "heading", raw: ve(e[0], `
|
|
1423
1423
|
`), depth: e[2].charAt(0) === "=" ? 1 : 2, text: n, tokens: this.lexer.inline(n) };
|
|
1424
1424
|
}
|
|
1425
1425
|
}
|
|
@@ -1449,28 +1449,28 @@ ${p}` : p;
|
|
|
1449
1449
|
let n = e[2].trim();
|
|
1450
1450
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
1451
1451
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
1452
|
-
let l =
|
|
1452
|
+
let l = ve(n.slice(0, -1), "\\");
|
|
1453
1453
|
if ((n.length - l.length) % 2 === 0) return;
|
|
1454
1454
|
} else {
|
|
1455
|
-
let l =
|
|
1455
|
+
let l = ar(e[2], "()");
|
|
1456
1456
|
if (l === -2) return;
|
|
1457
1457
|
if (l > -1) {
|
|
1458
1458
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
|
|
1459
1459
|
e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
|
|
1460
1460
|
}
|
|
1461
1461
|
}
|
|
1462
|
-
let
|
|
1462
|
+
let i = e[2], s = "";
|
|
1463
1463
|
if (this.options.pedantic) {
|
|
1464
|
-
let l = this.rules.other.pedanticHrefTitle.exec(
|
|
1465
|
-
l && (
|
|
1464
|
+
let l = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1465
|
+
l && (i = l[1], s = l[3]);
|
|
1466
1466
|
} else s = e[3] ? e[3].slice(1, -1) : "";
|
|
1467
|
-
return
|
|
1467
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? i = i.slice(1) : i = i.slice(1, -1)), ss(e, { href: i && i.replace(this.rules.inline.anyPunctuation, "$1"), title: s && s.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
1468
1468
|
}
|
|
1469
1469
|
}
|
|
1470
1470
|
reflink(t, e) {
|
|
1471
1471
|
let n;
|
|
1472
1472
|
if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
|
|
1473
|
-
let
|
|
1473
|
+
let i = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), s = e[i.toLowerCase()];
|
|
1474
1474
|
if (!s) {
|
|
1475
1475
|
let l = n[0].charAt(0);
|
|
1476
1476
|
return { type: "text", raw: l, text: l };
|
|
@@ -1479,35 +1479,35 @@ ${p}` : p;
|
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
1481
|
emStrong(t, e, n = "") {
|
|
1482
|
-
let
|
|
1483
|
-
if (!(!
|
|
1484
|
-
let s = [...
|
|
1485
|
-
for (
|
|
1486
|
-
if (l =
|
|
1487
|
-
if (o = [...l].length,
|
|
1488
|
-
|
|
1482
|
+
let i = this.rules.inline.emStrongLDelim.exec(t);
|
|
1483
|
+
if (!(!i || !i[1] && !i[2] && !i[3] && !i[4] || i[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(i[1] || i[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1484
|
+
let s = [...i[0]].length - 1, l, o, p = s, c = 0, w = i[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1485
|
+
for (w.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = w.exec(e)) !== null; ) {
|
|
1486
|
+
if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l) continue;
|
|
1487
|
+
if (o = [...l].length, i[3] || i[4]) {
|
|
1488
|
+
p += o;
|
|
1489
1489
|
continue;
|
|
1490
|
-
} else if ((
|
|
1490
|
+
} else if ((i[5] || i[6]) && s % 3 && !((s + o) % 3)) {
|
|
1491
1491
|
c += o;
|
|
1492
1492
|
continue;
|
|
1493
1493
|
}
|
|
1494
|
-
if (
|
|
1495
|
-
o = Math.min(o, o +
|
|
1496
|
-
let
|
|
1494
|
+
if (p -= o, p > 0) continue;
|
|
1495
|
+
o = Math.min(o, o + p + c);
|
|
1496
|
+
let d = [...i[0]][0].length, x = t.slice(0, s + i.index + d + o);
|
|
1497
1497
|
if (Math.min(s, o) % 2) {
|
|
1498
|
-
let
|
|
1499
|
-
return { type: "em", raw:
|
|
1498
|
+
let f = x.slice(1, -1);
|
|
1499
|
+
return { type: "em", raw: x, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
1500
1500
|
}
|
|
1501
|
-
let
|
|
1502
|
-
return { type: "strong", raw:
|
|
1501
|
+
let m = x.slice(2, -2);
|
|
1502
|
+
return { type: "strong", raw: x, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
}
|
|
1506
1506
|
codespan(t) {
|
|
1507
1507
|
let e = this.rules.inline.code.exec(t);
|
|
1508
1508
|
if (e) {
|
|
1509
|
-
let n = e[2].replace(this.rules.other.newLineCharGlobal, " "),
|
|
1510
|
-
return
|
|
1509
|
+
let n = e[2].replace(this.rules.other.newLineCharGlobal, " "), i = this.rules.other.nonSpaceChar.test(n), s = this.rules.other.startingSpaceChar.test(n) && this.rules.other.endingSpaceChar.test(n);
|
|
1510
|
+
return i && s && (n = n.substring(1, n.length - 1)), { type: "codespan", raw: e[0], text: n };
|
|
1511
1511
|
}
|
|
1512
1512
|
}
|
|
1513
1513
|
br(t) {
|
|
@@ -1515,42 +1515,42 @@ ${p}` : p;
|
|
|
1515
1515
|
if (e) return { type: "br", raw: e[0] };
|
|
1516
1516
|
}
|
|
1517
1517
|
del(t, e, n = "") {
|
|
1518
|
-
let
|
|
1519
|
-
if (
|
|
1520
|
-
let s = [...
|
|
1521
|
-
for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (
|
|
1522
|
-
if (l =
|
|
1523
|
-
if (
|
|
1524
|
-
|
|
1518
|
+
let i = this.rules.inline.delLDelim.exec(t);
|
|
1519
|
+
if (i && (!i[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1520
|
+
let s = [...i[0]].length - 1, l, o, p = s, c = this.rules.inline.delRDelim;
|
|
1521
|
+
for (c.lastIndex = 0, e = e.slice(-1 * t.length + s); (i = c.exec(e)) !== null; ) {
|
|
1522
|
+
if (l = i[1] || i[2] || i[3] || i[4] || i[5] || i[6], !l || (o = [...l].length, o !== s)) continue;
|
|
1523
|
+
if (i[3] || i[4]) {
|
|
1524
|
+
p += o;
|
|
1525
1525
|
continue;
|
|
1526
1526
|
}
|
|
1527
|
-
if (
|
|
1528
|
-
o = Math.min(o, o +
|
|
1529
|
-
let
|
|
1530
|
-
return { type: "del", raw:
|
|
1527
|
+
if (p -= o, p > 0) continue;
|
|
1528
|
+
o = Math.min(o, o + p);
|
|
1529
|
+
let w = [...i[0]][0].length, d = t.slice(0, s + i.index + w + o), x = d.slice(s, -s);
|
|
1530
|
+
return { type: "del", raw: d, text: x, tokens: this.lexer.inlineTokens(x) };
|
|
1531
1531
|
}
|
|
1532
1532
|
}
|
|
1533
1533
|
}
|
|
1534
1534
|
autolink(t) {
|
|
1535
1535
|
let e = this.rules.inline.autolink.exec(t);
|
|
1536
1536
|
if (e) {
|
|
1537
|
-
let n,
|
|
1538
|
-
return e[2] === "@" ? (n = e[1],
|
|
1537
|
+
let n, i;
|
|
1538
|
+
return e[2] === "@" ? (n = e[1], i = "mailto:" + n) : (n = e[1], i = n), { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
|
|
1539
1539
|
}
|
|
1540
1540
|
}
|
|
1541
1541
|
url(t) {
|
|
1542
1542
|
let e;
|
|
1543
1543
|
if (e = this.rules.inline.url.exec(t)) {
|
|
1544
|
-
let n,
|
|
1545
|
-
if (e[2] === "@") n = e[0],
|
|
1544
|
+
let n, i;
|
|
1545
|
+
if (e[2] === "@") n = e[0], i = "mailto:" + n;
|
|
1546
1546
|
else {
|
|
1547
1547
|
let s;
|
|
1548
1548
|
do
|
|
1549
1549
|
s = e[0], e[0] = this.rules.inline._backpedal.exec(e[0])?.[0] ?? "";
|
|
1550
1550
|
while (s !== e[0]);
|
|
1551
|
-
n = e[0], e[1] === "www." ?
|
|
1551
|
+
n = e[0], e[1] === "www." ? i = "http://" + e[0] : i = e[0];
|
|
1552
1552
|
}
|
|
1553
|
-
return { type: "link", raw: e[0], text: n, href:
|
|
1553
|
+
return { type: "link", raw: e[0], text: n, href: i, tokens: [{ type: "text", raw: n, text: n }] };
|
|
1554
1554
|
}
|
|
1555
1555
|
}
|
|
1556
1556
|
inlineText(t) {
|
|
@@ -1560,28 +1560,28 @@ ${p}` : p;
|
|
|
1560
1560
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1561
1561
|
}
|
|
1562
1562
|
}
|
|
1563
|
-
}, h(
|
|
1563
|
+
}, h(We, "w"), We), Te, de = (Te = class {
|
|
1564
1564
|
constructor(t) {
|
|
1565
1565
|
D(this, "tokens");
|
|
1566
1566
|
D(this, "options");
|
|
1567
1567
|
D(this, "state");
|
|
1568
1568
|
D(this, "inlineQueue");
|
|
1569
1569
|
D(this, "tokenizer");
|
|
1570
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
1571
|
-
let e = { other:
|
|
1572
|
-
this.options.pedantic ? (e.block =
|
|
1570
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Oe, this.options.tokenizer = this.options.tokenizer || new yt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1571
|
+
let e = { other: K, block: bt.normal, inline: rt.normal };
|
|
1572
|
+
this.options.pedantic ? (e.block = bt.pedantic, e.inline = rt.pedantic) : this.options.gfm && (e.block = bt.gfm, this.options.breaks ? e.inline = rt.breaks : e.inline = rt.gfm), this.tokenizer.rules = e;
|
|
1573
1573
|
}
|
|
1574
1574
|
static get rules() {
|
|
1575
|
-
return { block:
|
|
1575
|
+
return { block: bt, inline: rt };
|
|
1576
1576
|
}
|
|
1577
1577
|
static lex(t, e) {
|
|
1578
|
-
return new
|
|
1578
|
+
return new Te(e).lex(t);
|
|
1579
1579
|
}
|
|
1580
1580
|
static lexInline(t, e) {
|
|
1581
|
-
return new
|
|
1581
|
+
return new Te(e).inlineTokens(t);
|
|
1582
1582
|
}
|
|
1583
1583
|
lex(t) {
|
|
1584
|
-
t = t.replace(
|
|
1584
|
+
t = t.replace(K.carriageReturn, `
|
|
1585
1585
|
`), this.blockTokens(t, this.tokens);
|
|
1586
1586
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1587
1587
|
let n = this.inlineQueue[e];
|
|
@@ -1590,10 +1590,10 @@ ${p}` : p;
|
|
|
1590
1590
|
return this.inlineQueue = [], this.tokens;
|
|
1591
1591
|
}
|
|
1592
1592
|
blockTokens(t, e = [], n = !1) {
|
|
1593
|
-
this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(
|
|
1594
|
-
let
|
|
1593
|
+
this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(K.tabCharGlobal, " ").replace(K.spaceLine, ""));
|
|
1594
|
+
let i = 1 / 0;
|
|
1595
1595
|
for (; t; ) {
|
|
1596
|
-
if (t.length <
|
|
1596
|
+
if (t.length < i) i = t.length;
|
|
1597
1597
|
else {
|
|
1598
1598
|
this.infiniteLoopError(t.charCodeAt(0));
|
|
1599
1599
|
break;
|
|
@@ -1659,9 +1659,9 @@ ${p}` : p;
|
|
|
1659
1659
|
}
|
|
1660
1660
|
let l = t;
|
|
1661
1661
|
if (this.options.extensions?.startBlock) {
|
|
1662
|
-
let o = 1 / 0,
|
|
1663
|
-
this.options.extensions.startBlock.forEach((
|
|
1664
|
-
c =
|
|
1662
|
+
let o = 1 / 0, p = t.slice(1), c;
|
|
1663
|
+
this.options.extensions.startBlock.forEach((w) => {
|
|
1664
|
+
c = w.call({ lexer: this }, p), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
|
|
1665
1665
|
}), o < 1 / 0 && o >= 0 && (l = t.substring(0, o + 1));
|
|
1666
1666
|
}
|
|
1667
1667
|
if (this.state.top && (s = this.tokenizer.paragraph(l))) {
|
|
@@ -1693,25 +1693,25 @@ ${p}` : p;
|
|
|
1693
1693
|
}
|
|
1694
1694
|
inlineTokens(t, e = []) {
|
|
1695
1695
|
this.tokenizer.lexer = this;
|
|
1696
|
-
let n = t,
|
|
1696
|
+
let n = t, i = null;
|
|
1697
1697
|
if (this.tokens.links) {
|
|
1698
1698
|
let c = Object.keys(this.tokens.links);
|
|
1699
|
-
if (c.length > 0) for (; (
|
|
1699
|
+
if (c.length > 0) for (; (i = this.tokenizer.rules.inline.reflinkSearch.exec(n)) !== null; ) c.includes(i[0].slice(i[0].lastIndexOf("[") + 1, -1)) && (n = n.slice(0, i.index) + "[" + "a".repeat(i[0].length - 2) + "]" + n.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
|
|
1700
1700
|
}
|
|
1701
|
-
for (; (
|
|
1701
|
+
for (; (i = this.tokenizer.rules.inline.anyPunctuation.exec(n)) !== null; ) n = n.slice(0, i.index) + "++" + n.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
|
|
1702
1702
|
let s;
|
|
1703
|
-
for (; (
|
|
1703
|
+
for (; (i = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) s = i[2] ? i[2].length : 0, n = n.slice(0, i.index + s) + "[" + "a".repeat(i[0].length - s - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1704
1704
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
1705
|
-
let l = !1, o = "",
|
|
1705
|
+
let l = !1, o = "", p = 1 / 0;
|
|
1706
1706
|
for (; t; ) {
|
|
1707
|
-
if (t.length <
|
|
1707
|
+
if (t.length < p) p = t.length;
|
|
1708
1708
|
else {
|
|
1709
1709
|
this.infiniteLoopError(t.charCodeAt(0));
|
|
1710
1710
|
break;
|
|
1711
1711
|
}
|
|
1712
1712
|
l || (o = ""), l = !1;
|
|
1713
1713
|
let c;
|
|
1714
|
-
if (this.options.extensions?.inline?.some((
|
|
1714
|
+
if (this.options.extensions?.inline?.some((d) => (c = d.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
|
|
1715
1715
|
if (c = this.tokenizer.escape(t)) {
|
|
1716
1716
|
t = t.substring(c.raw.length), e.push(c);
|
|
1717
1717
|
continue;
|
|
@@ -1726,8 +1726,8 @@ ${p}` : p;
|
|
|
1726
1726
|
}
|
|
1727
1727
|
if (c = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
1728
1728
|
t = t.substring(c.raw.length);
|
|
1729
|
-
let
|
|
1730
|
-
c.type === "text" &&
|
|
1729
|
+
let d = e.at(-1);
|
|
1730
|
+
c.type === "text" && d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
|
|
1731
1731
|
continue;
|
|
1732
1732
|
}
|
|
1733
1733
|
if (c = this.tokenizer.emStrong(t, n, o)) {
|
|
@@ -1754,17 +1754,17 @@ ${p}` : p;
|
|
|
1754
1754
|
t = t.substring(c.raw.length), e.push(c);
|
|
1755
1755
|
continue;
|
|
1756
1756
|
}
|
|
1757
|
-
let
|
|
1757
|
+
let w = t;
|
|
1758
1758
|
if (this.options.extensions?.startInline) {
|
|
1759
|
-
let
|
|
1760
|
-
this.options.extensions.startInline.forEach((
|
|
1761
|
-
|
|
1762
|
-
}),
|
|
1759
|
+
let d = 1 / 0, x = t.slice(1), m;
|
|
1760
|
+
this.options.extensions.startInline.forEach((f) => {
|
|
1761
|
+
m = f.call({ lexer: this }, x), typeof m == "number" && m >= 0 && (d = Math.min(d, m));
|
|
1762
|
+
}), d < 1 / 0 && d >= 0 && (w = t.substring(0, d + 1));
|
|
1763
1763
|
}
|
|
1764
|
-
if (c = this.tokenizer.inlineText(
|
|
1764
|
+
if (c = this.tokenizer.inlineText(w)) {
|
|
1765
1765
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1766
|
-
let
|
|
1767
|
-
|
|
1766
|
+
let d = e.at(-1);
|
|
1767
|
+
d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
|
|
1768
1768
|
continue;
|
|
1769
1769
|
}
|
|
1770
1770
|
if (t) {
|
|
@@ -1779,19 +1779,19 @@ ${p}` : p;
|
|
|
1779
1779
|
if (this.options.silent) console.error(e);
|
|
1780
1780
|
else throw new Error(e);
|
|
1781
1781
|
}
|
|
1782
|
-
}, h(
|
|
1782
|
+
}, h(Te, "l"), Te), qe, Tt = (qe = class {
|
|
1783
1783
|
constructor(t) {
|
|
1784
1784
|
D(this, "options");
|
|
1785
1785
|
D(this, "parser");
|
|
1786
|
-
this.options = t ||
|
|
1786
|
+
this.options = t || Oe;
|
|
1787
1787
|
}
|
|
1788
1788
|
space(t) {
|
|
1789
1789
|
return "";
|
|
1790
1790
|
}
|
|
1791
1791
|
code({ text: t, lang: e, escaped: n }) {
|
|
1792
|
-
let
|
|
1792
|
+
let i = (e || "").match(K.notSpaceStart)?.[0], s = t.replace(K.endingNewline, "") + `
|
|
1793
1793
|
`;
|
|
1794
|
-
return
|
|
1794
|
+
return i ? '<pre><code class="language-' + xe(i) + '">' + (n ? s : xe(s, !0)) + `</code></pre>
|
|
1795
1795
|
` : "<pre><code>" + (n ? s : xe(s, !0)) + `</code></pre>
|
|
1796
1796
|
`;
|
|
1797
1797
|
}
|
|
@@ -1815,14 +1815,14 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1815
1815
|
`;
|
|
1816
1816
|
}
|
|
1817
1817
|
list(t) {
|
|
1818
|
-
let e = t.ordered, n = t.start,
|
|
1818
|
+
let e = t.ordered, n = t.start, i = "";
|
|
1819
1819
|
for (let o = 0; o < t.items.length; o++) {
|
|
1820
|
-
let
|
|
1821
|
-
|
|
1820
|
+
let p = t.items[o];
|
|
1821
|
+
i += this.listitem(p);
|
|
1822
1822
|
}
|
|
1823
1823
|
let s = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
|
|
1824
1824
|
return "<" + s + l + `>
|
|
1825
|
-
` +
|
|
1825
|
+
` + i + "</" + s + `>
|
|
1826
1826
|
`;
|
|
1827
1827
|
}
|
|
1828
1828
|
listitem(t) {
|
|
@@ -1840,17 +1840,17 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1840
1840
|
let e = "", n = "";
|
|
1841
1841
|
for (let s = 0; s < t.header.length; s++) n += this.tablecell(t.header[s]);
|
|
1842
1842
|
e += this.tablerow({ text: n });
|
|
1843
|
-
let
|
|
1843
|
+
let i = "";
|
|
1844
1844
|
for (let s = 0; s < t.rows.length; s++) {
|
|
1845
1845
|
let l = t.rows[s];
|
|
1846
1846
|
n = "";
|
|
1847
1847
|
for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
|
|
1848
|
-
|
|
1848
|
+
i += this.tablerow({ text: n });
|
|
1849
1849
|
}
|
|
1850
|
-
return
|
|
1850
|
+
return i && (i = `<tbody>${i}</tbody>`), `<table>
|
|
1851
1851
|
<thead>
|
|
1852
1852
|
` + e + `</thead>
|
|
1853
|
-
` +
|
|
1853
|
+
` + i + `</table>
|
|
1854
1854
|
`;
|
|
1855
1855
|
}
|
|
1856
1856
|
tablerow({ text: t }) {
|
|
@@ -1879,14 +1879,14 @@ ${t}</tr>
|
|
|
1879
1879
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1880
1880
|
}
|
|
1881
1881
|
link({ href: t, title: e, tokens: n }) {
|
|
1882
|
-
let
|
|
1883
|
-
if (s === null) return
|
|
1882
|
+
let i = this.parser.parseInline(n), s = es(t);
|
|
1883
|
+
if (s === null) return i;
|
|
1884
1884
|
t = s;
|
|
1885
1885
|
let l = '<a href="' + t + '"';
|
|
1886
|
-
return e && (l += ' title="' + xe(e) + '"'), l += ">" +
|
|
1886
|
+
return e && (l += ' title="' + xe(e) + '"'), l += ">" + i + "</a>", l;
|
|
1887
1887
|
}
|
|
1888
|
-
image({ href: t, title: e, text: n, tokens:
|
|
1889
|
-
|
|
1888
|
+
image({ href: t, title: e, text: n, tokens: i }) {
|
|
1889
|
+
i && (n = this.parser.parseInline(i, this.parser.textRenderer));
|
|
1890
1890
|
let s = es(t);
|
|
1891
1891
|
if (s === null) return xe(n);
|
|
1892
1892
|
t = s;
|
|
@@ -1896,7 +1896,7 @@ ${t}</tr>
|
|
|
1896
1896
|
text(t) {
|
|
1897
1897
|
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : xe(t.text);
|
|
1898
1898
|
}
|
|
1899
|
-
}, h(
|
|
1899
|
+
}, h(qe, "y"), qe), Ve, un = (Ve = class {
|
|
1900
1900
|
strong({ text: t }) {
|
|
1901
1901
|
return t;
|
|
1902
1902
|
}
|
|
@@ -1927,32 +1927,32 @@ ${t}</tr>
|
|
|
1927
1927
|
checkbox({ raw: t }) {
|
|
1928
1928
|
return t;
|
|
1929
1929
|
}
|
|
1930
|
-
}, h(
|
|
1930
|
+
}, h(Ve, "L"), Ve), Se, fe = (Se = class {
|
|
1931
1931
|
constructor(t) {
|
|
1932
1932
|
D(this, "options");
|
|
1933
1933
|
D(this, "renderer");
|
|
1934
1934
|
D(this, "textRenderer");
|
|
1935
|
-
this.options = t ||
|
|
1935
|
+
this.options = t || Oe, this.options.renderer = this.options.renderer || new Tt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new un();
|
|
1936
1936
|
}
|
|
1937
1937
|
static parse(t, e) {
|
|
1938
|
-
return new
|
|
1938
|
+
return new Se(e).parse(t);
|
|
1939
1939
|
}
|
|
1940
1940
|
static parseInline(t, e) {
|
|
1941
|
-
return new
|
|
1941
|
+
return new Se(e).parseInline(t);
|
|
1942
1942
|
}
|
|
1943
1943
|
parse(t) {
|
|
1944
1944
|
this.renderer.parser = this;
|
|
1945
1945
|
let e = "";
|
|
1946
1946
|
for (let n = 0; n < t.length; n++) {
|
|
1947
|
-
let
|
|
1948
|
-
if (this.options.extensions?.renderers?.[
|
|
1949
|
-
let l =
|
|
1947
|
+
let i = t[n];
|
|
1948
|
+
if (this.options.extensions?.renderers?.[i.type]) {
|
|
1949
|
+
let l = i, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
|
|
1950
1950
|
if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
|
|
1951
1951
|
e += o || "";
|
|
1952
1952
|
continue;
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
1955
|
-
let s =
|
|
1955
|
+
let s = i;
|
|
1956
1956
|
switch (s.type) {
|
|
1957
1957
|
case "space": {
|
|
1958
1958
|
e += this.renderer.space(s);
|
|
@@ -2014,8 +2014,8 @@ ${t}</tr>
|
|
|
2014
2014
|
parseInline(t, e = this.renderer) {
|
|
2015
2015
|
this.renderer.parser = this;
|
|
2016
2016
|
let n = "";
|
|
2017
|
-
for (let
|
|
2018
|
-
let s = t[
|
|
2017
|
+
for (let i = 0; i < t.length; i++) {
|
|
2018
|
+
let s = t[i];
|
|
2019
2019
|
if (this.options.extensions?.renderers?.[s.type]) {
|
|
2020
2020
|
let o = this.options.extensions.renderers[s.type].call({ parser: this }, s);
|
|
2021
2021
|
if (o !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(s.type)) {
|
|
@@ -2078,11 +2078,11 @@ ${t}</tr>
|
|
|
2078
2078
|
}
|
|
2079
2079
|
return n;
|
|
2080
2080
|
}
|
|
2081
|
-
}, h(
|
|
2081
|
+
}, h(Se, "l"), Se), ye, lt = (ye = class {
|
|
2082
2082
|
constructor(t) {
|
|
2083
2083
|
D(this, "options");
|
|
2084
2084
|
D(this, "block");
|
|
2085
|
-
this.options = t ||
|
|
2085
|
+
this.options = t || Oe;
|
|
2086
2086
|
}
|
|
2087
2087
|
preprocess(t) {
|
|
2088
2088
|
return t;
|
|
@@ -2097,41 +2097,41 @@ ${t}</tr>
|
|
|
2097
2097
|
return t;
|
|
2098
2098
|
}
|
|
2099
2099
|
provideLexer(t = this.block) {
|
|
2100
|
-
return t ?
|
|
2100
|
+
return t ? de.lex : de.lexInline;
|
|
2101
2101
|
}
|
|
2102
2102
|
provideParser(t = this.block) {
|
|
2103
|
-
return t ?
|
|
2103
|
+
return t ? fe.parse : fe.parseInline;
|
|
2104
2104
|
}
|
|
2105
|
-
}, h(
|
|
2105
|
+
}, h(ye, "P"), D(ye, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(ye, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), ye), Ye, cr = (Ye = class {
|
|
2106
2106
|
constructor(...t) {
|
|
2107
|
-
D(this, "defaults",
|
|
2107
|
+
D(this, "defaults", tn());
|
|
2108
2108
|
D(this, "options", this.setOptions);
|
|
2109
2109
|
D(this, "parse", this.parseMarkdown(!0));
|
|
2110
2110
|
D(this, "parseInline", this.parseMarkdown(!1));
|
|
2111
|
-
D(this, "Parser",
|
|
2112
|
-
D(this, "Renderer",
|
|
2113
|
-
D(this, "TextRenderer",
|
|
2114
|
-
D(this, "Lexer",
|
|
2115
|
-
D(this, "Tokenizer",
|
|
2116
|
-
D(this, "Hooks",
|
|
2111
|
+
D(this, "Parser", fe);
|
|
2112
|
+
D(this, "Renderer", Tt);
|
|
2113
|
+
D(this, "TextRenderer", un);
|
|
2114
|
+
D(this, "Lexer", de);
|
|
2115
|
+
D(this, "Tokenizer", yt);
|
|
2116
|
+
D(this, "Hooks", lt);
|
|
2117
2117
|
this.use(...t);
|
|
2118
2118
|
}
|
|
2119
2119
|
walkTokens(t, e) {
|
|
2120
2120
|
let n = [];
|
|
2121
|
-
for (let
|
|
2121
|
+
for (let i of t) switch (n = n.concat(e.call(this, i)), i.type) {
|
|
2122
2122
|
case "table": {
|
|
2123
|
-
let s =
|
|
2123
|
+
let s = i;
|
|
2124
2124
|
for (let l of s.header) n = n.concat(this.walkTokens(l.tokens, e));
|
|
2125
2125
|
for (let l of s.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
|
|
2126
2126
|
break;
|
|
2127
2127
|
}
|
|
2128
2128
|
case "list": {
|
|
2129
|
-
let s =
|
|
2129
|
+
let s = i;
|
|
2130
2130
|
n = n.concat(this.walkTokens(s.items, e));
|
|
2131
2131
|
break;
|
|
2132
2132
|
}
|
|
2133
2133
|
default: {
|
|
2134
|
-
let s =
|
|
2134
|
+
let s = i;
|
|
2135
2135
|
this.defaults.extensions?.childTokens?.[s.type] ? this.defaults.extensions.childTokens[s.type].forEach((l) => {
|
|
2136
2136
|
let o = s[l].flat(1 / 0);
|
|
2137
2137
|
n = n.concat(this.walkTokens(o, e));
|
|
@@ -2143,14 +2143,14 @@ ${t}</tr>
|
|
|
2143
2143
|
use(...t) {
|
|
2144
2144
|
let e = this.defaults.extensions || { renderers: {}, childTokens: {} };
|
|
2145
2145
|
return t.forEach((n) => {
|
|
2146
|
-
let
|
|
2147
|
-
if (
|
|
2146
|
+
let i = { ...n };
|
|
2147
|
+
if (i.async = this.defaults.async || i.async || !1, n.extensions && (n.extensions.forEach((s) => {
|
|
2148
2148
|
if (!s.name) throw new Error("extension name required");
|
|
2149
2149
|
if ("renderer" in s) {
|
|
2150
2150
|
let l = e.renderers[s.name];
|
|
2151
2151
|
l ? e.renderers[s.name] = function(...o) {
|
|
2152
|
-
let
|
|
2153
|
-
return
|
|
2152
|
+
let p = s.renderer.apply(this, o);
|
|
2153
|
+
return p === !1 && (p = l.apply(this, o)), p;
|
|
2154
2154
|
} : e.renderers[s.name] = s.renderer;
|
|
2155
2155
|
}
|
|
2156
2156
|
if ("tokenizer" in s) {
|
|
@@ -2159,93 +2159,93 @@ ${t}</tr>
|
|
|
2159
2159
|
l ? l.unshift(s.tokenizer) : e[s.level] = [s.tokenizer], s.start && (s.level === "block" ? e.startBlock ? e.startBlock.push(s.start) : e.startBlock = [s.start] : s.level === "inline" && (e.startInline ? e.startInline.push(s.start) : e.startInline = [s.start]));
|
|
2160
2160
|
}
|
|
2161
2161
|
"childTokens" in s && s.childTokens && (e.childTokens[s.name] = s.childTokens);
|
|
2162
|
-
}),
|
|
2163
|
-
let s = this.defaults.renderer || new
|
|
2162
|
+
}), i.extensions = e), n.renderer) {
|
|
2163
|
+
let s = this.defaults.renderer || new Tt(this.defaults);
|
|
2164
2164
|
for (let l in n.renderer) {
|
|
2165
2165
|
if (!(l in s)) throw new Error(`renderer '${l}' does not exist`);
|
|
2166
2166
|
if (["options", "parser"].includes(l)) continue;
|
|
2167
|
-
let o = l,
|
|
2168
|
-
s[o] = (...
|
|
2169
|
-
let
|
|
2170
|
-
return
|
|
2167
|
+
let o = l, p = n.renderer[o], c = s[o];
|
|
2168
|
+
s[o] = (...w) => {
|
|
2169
|
+
let d = p.apply(s, w);
|
|
2170
|
+
return d === !1 && (d = c.apply(s, w)), d || "";
|
|
2171
2171
|
};
|
|
2172
2172
|
}
|
|
2173
|
-
|
|
2173
|
+
i.renderer = s;
|
|
2174
2174
|
}
|
|
2175
2175
|
if (n.tokenizer) {
|
|
2176
|
-
let s = this.defaults.tokenizer || new
|
|
2176
|
+
let s = this.defaults.tokenizer || new yt(this.defaults);
|
|
2177
2177
|
for (let l in n.tokenizer) {
|
|
2178
2178
|
if (!(l in s)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2179
2179
|
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2180
|
-
let o = l,
|
|
2181
|
-
s[o] = (...
|
|
2182
|
-
let
|
|
2183
|
-
return
|
|
2180
|
+
let o = l, p = n.tokenizer[o], c = s[o];
|
|
2181
|
+
s[o] = (...w) => {
|
|
2182
|
+
let d = p.apply(s, w);
|
|
2183
|
+
return d === !1 && (d = c.apply(s, w)), d;
|
|
2184
2184
|
};
|
|
2185
2185
|
}
|
|
2186
|
-
|
|
2186
|
+
i.tokenizer = s;
|
|
2187
2187
|
}
|
|
2188
2188
|
if (n.hooks) {
|
|
2189
|
-
let s = this.defaults.hooks || new
|
|
2189
|
+
let s = this.defaults.hooks || new lt();
|
|
2190
2190
|
for (let l in n.hooks) {
|
|
2191
2191
|
if (!(l in s)) throw new Error(`hook '${l}' does not exist`);
|
|
2192
2192
|
if (["options", "block"].includes(l)) continue;
|
|
2193
|
-
let o = l,
|
|
2194
|
-
|
|
2195
|
-
if (this.defaults.async &&
|
|
2196
|
-
let
|
|
2197
|
-
return c.call(s,
|
|
2193
|
+
let o = l, p = n.hooks[o], c = s[o];
|
|
2194
|
+
lt.passThroughHooks.has(l) ? s[o] = (w) => {
|
|
2195
|
+
if (this.defaults.async && lt.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2196
|
+
let x = await p.call(s, w);
|
|
2197
|
+
return c.call(s, x);
|
|
2198
2198
|
})();
|
|
2199
|
-
let
|
|
2200
|
-
return c.call(s,
|
|
2201
|
-
} : s[o] = (...
|
|
2199
|
+
let d = p.call(s, w);
|
|
2200
|
+
return c.call(s, d);
|
|
2201
|
+
} : s[o] = (...w) => {
|
|
2202
2202
|
if (this.defaults.async) return (async () => {
|
|
2203
|
-
let
|
|
2204
|
-
return
|
|
2203
|
+
let x = await p.apply(s, w);
|
|
2204
|
+
return x === !1 && (x = await c.apply(s, w)), x;
|
|
2205
2205
|
})();
|
|
2206
|
-
let
|
|
2207
|
-
return
|
|
2206
|
+
let d = p.apply(s, w);
|
|
2207
|
+
return d === !1 && (d = c.apply(s, w)), d;
|
|
2208
2208
|
};
|
|
2209
2209
|
}
|
|
2210
|
-
|
|
2210
|
+
i.hooks = s;
|
|
2211
2211
|
}
|
|
2212
2212
|
if (n.walkTokens) {
|
|
2213
2213
|
let s = this.defaults.walkTokens, l = n.walkTokens;
|
|
2214
|
-
|
|
2215
|
-
let
|
|
2216
|
-
return
|
|
2214
|
+
i.walkTokens = function(o) {
|
|
2215
|
+
let p = [];
|
|
2216
|
+
return p.push(l.call(this, o)), s && (p = p.concat(s.call(this, o))), p;
|
|
2217
2217
|
};
|
|
2218
2218
|
}
|
|
2219
|
-
this.defaults = { ...this.defaults, ...
|
|
2219
|
+
this.defaults = { ...this.defaults, ...i };
|
|
2220
2220
|
}), this;
|
|
2221
2221
|
}
|
|
2222
2222
|
setOptions(t) {
|
|
2223
2223
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
2224
2224
|
}
|
|
2225
2225
|
lexer(t, e) {
|
|
2226
|
-
return
|
|
2226
|
+
return de.lex(t, e ?? this.defaults);
|
|
2227
2227
|
}
|
|
2228
2228
|
parser(t, e) {
|
|
2229
|
-
return
|
|
2229
|
+
return fe.parse(t, e ?? this.defaults);
|
|
2230
2230
|
}
|
|
2231
2231
|
parseMarkdown(t) {
|
|
2232
2232
|
return (e, n) => {
|
|
2233
|
-
let
|
|
2234
|
-
if (this.defaults.async === !0 &&
|
|
2233
|
+
let i = { ...n }, s = { ...this.defaults, ...i }, l = this.onError(!!s.silent, !!s.async);
|
|
2234
|
+
if (this.defaults.async === !0 && i.async === !1) return l(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));
|
|
2235
2235
|
if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
|
|
2236
2236
|
if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
2237
2237
|
if (s.hooks && (s.hooks.options = s, s.hooks.block = t), s.async) return (async () => {
|
|
2238
|
-
let o = s.hooks ? await s.hooks.preprocess(e) : e,
|
|
2238
|
+
let o = s.hooks ? await s.hooks.preprocess(e) : e, p = await (s.hooks ? await s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(o, s), c = s.hooks ? await s.hooks.processAllTokens(p) : p;
|
|
2239
2239
|
s.walkTokens && await Promise.all(this.walkTokens(c, s.walkTokens));
|
|
2240
|
-
let
|
|
2241
|
-
return s.hooks ? await s.hooks.postprocess(
|
|
2240
|
+
let w = await (s.hooks ? await s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(c, s);
|
|
2241
|
+
return s.hooks ? await s.hooks.postprocess(w) : w;
|
|
2242
2242
|
})().catch(l);
|
|
2243
2243
|
try {
|
|
2244
2244
|
s.hooks && (e = s.hooks.preprocess(e));
|
|
2245
|
-
let o = (s.hooks ? s.hooks.provideLexer(t) : t ?
|
|
2245
|
+
let o = (s.hooks ? s.hooks.provideLexer(t) : t ? de.lex : de.lexInline)(e, s);
|
|
2246
2246
|
s.hooks && (o = s.hooks.processAllTokens(o)), s.walkTokens && this.walkTokens(o, s.walkTokens);
|
|
2247
|
-
let
|
|
2248
|
-
return s.hooks && (
|
|
2247
|
+
let p = (s.hooks ? s.hooks.provideParser(t) : t ? fe.parse : fe.parseInline)(o, s);
|
|
2248
|
+
return s.hooks && (p = s.hooks.postprocess(p)), p;
|
|
2249
2249
|
} catch (o) {
|
|
2250
2250
|
return l(o);
|
|
2251
2251
|
}
|
|
@@ -2255,47 +2255,47 @@ ${t}</tr>
|
|
|
2255
2255
|
return (n) => {
|
|
2256
2256
|
if (n.message += `
|
|
2257
2257
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
2258
|
-
let
|
|
2259
|
-
return e ? Promise.resolve(
|
|
2258
|
+
let i = "<p>An error occurred:</p><pre>" + xe(n.message + "", !0) + "</pre>";
|
|
2259
|
+
return e ? Promise.resolve(i) : i;
|
|
2260
2260
|
}
|
|
2261
2261
|
if (e) return Promise.reject(n);
|
|
2262
2262
|
throw n;
|
|
2263
2263
|
};
|
|
2264
2264
|
}
|
|
2265
|
-
}, h(
|
|
2265
|
+
}, h(Ye, "D"), Ye), Le = new cr();
|
|
2266
2266
|
function O(a, t) {
|
|
2267
|
-
return
|
|
2267
|
+
return Le.parse(a, t);
|
|
2268
2268
|
}
|
|
2269
2269
|
h(O, "g");
|
|
2270
2270
|
O.options = O.setOptions = function(a) {
|
|
2271
|
-
return
|
|
2271
|
+
return Le.setOptions(a), O.defaults = Le.defaults, fs(O.defaults), O;
|
|
2272
2272
|
};
|
|
2273
|
-
O.getDefaults =
|
|
2274
|
-
O.defaults =
|
|
2273
|
+
O.getDefaults = tn;
|
|
2274
|
+
O.defaults = Oe;
|
|
2275
2275
|
O.use = function(...a) {
|
|
2276
|
-
return
|
|
2276
|
+
return Le.use(...a), O.defaults = Le.defaults, fs(O.defaults), O;
|
|
2277
2277
|
};
|
|
2278
2278
|
O.walkTokens = function(a, t) {
|
|
2279
|
-
return
|
|
2279
|
+
return Le.walkTokens(a, t);
|
|
2280
2280
|
};
|
|
2281
|
-
O.parseInline =
|
|
2282
|
-
O.Parser =
|
|
2283
|
-
O.parser =
|
|
2284
|
-
O.Renderer =
|
|
2285
|
-
O.TextRenderer =
|
|
2286
|
-
O.Lexer =
|
|
2287
|
-
O.lexer =
|
|
2288
|
-
O.Tokenizer =
|
|
2289
|
-
O.Hooks =
|
|
2281
|
+
O.parseInline = Le.parseInline;
|
|
2282
|
+
O.Parser = fe;
|
|
2283
|
+
O.parser = fe.parse;
|
|
2284
|
+
O.Renderer = Tt;
|
|
2285
|
+
O.TextRenderer = un;
|
|
2286
|
+
O.Lexer = de;
|
|
2287
|
+
O.lexer = de.lex;
|
|
2288
|
+
O.Tokenizer = yt;
|
|
2289
|
+
O.Hooks = lt;
|
|
2290
2290
|
O.parse = O;
|
|
2291
2291
|
O.options;
|
|
2292
2292
|
O.setOptions;
|
|
2293
2293
|
O.use;
|
|
2294
2294
|
O.walkTokens;
|
|
2295
2295
|
O.parseInline;
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
const
|
|
2296
|
+
fe.parse;
|
|
2297
|
+
de.lex;
|
|
2298
|
+
const ur = ["innerHTML"], Zt = /* @__PURE__ */ ke({
|
|
2299
2299
|
__name: "ChatRichText",
|
|
2300
2300
|
props: {
|
|
2301
2301
|
text: {},
|
|
@@ -2305,7 +2305,7 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2305
2305
|
setup(a) {
|
|
2306
2306
|
const t = a, e = as(t.text);
|
|
2307
2307
|
let n;
|
|
2308
|
-
|
|
2308
|
+
Ze(
|
|
2309
2309
|
[() => t.text, () => t.streaming],
|
|
2310
2310
|
([l, o]) => {
|
|
2311
2311
|
if (!o) {
|
|
@@ -2319,33 +2319,33 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2319
2319
|
), ls(() => {
|
|
2320
2320
|
n !== void 0 && cancelAnimationFrame(n);
|
|
2321
2321
|
});
|
|
2322
|
-
const
|
|
2323
|
-
|
|
2324
|
-
let
|
|
2322
|
+
const i = new O.Renderer();
|
|
2323
|
+
i.link = ({ href: l, text: o }) => {
|
|
2324
|
+
let p = !1;
|
|
2325
2325
|
if (typeof window < "u")
|
|
2326
2326
|
try {
|
|
2327
|
-
|
|
2327
|
+
p = new URL(l, window.location.href).origin === window.location.origin;
|
|
2328
2328
|
} catch {
|
|
2329
|
-
|
|
2329
|
+
p = !1;
|
|
2330
2330
|
}
|
|
2331
|
-
return
|
|
2332
|
-
}, O.setOptions({ breaks: !0, gfm: !0, renderer:
|
|
2331
|
+
return p ? `<a href="${l}">${o}</a>` : `<a href="${l}" target="_blank" rel="noopener noreferrer">${o}</a>`;
|
|
2332
|
+
}, O.setOptions({ breaks: !0, gfm: !0, renderer: i });
|
|
2333
2333
|
const s = B(() => {
|
|
2334
2334
|
const l = e.value;
|
|
2335
2335
|
if (!l) return "";
|
|
2336
2336
|
const o = O.parse(l, { async: !1 });
|
|
2337
|
-
return
|
|
2337
|
+
return yi.sanitize(o, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2338
2338
|
});
|
|
2339
|
-
return (l, o) => (
|
|
2340
|
-
class:
|
|
2339
|
+
return (l, o) => (T(), S("div", {
|
|
2340
|
+
class: _(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", a.inverted ? "chat-msg-prose-invert" : ""]),
|
|
2341
2341
|
innerHTML: s.value
|
|
2342
|
-
}, null, 10,
|
|
2342
|
+
}, null, 10, ur));
|
|
2343
2343
|
}
|
|
2344
|
-
}),
|
|
2344
|
+
}), hr = 80, pr = /* @__PURE__ */ ke({
|
|
2345
2345
|
__name: "ChatScroller",
|
|
2346
2346
|
setup(a, { expose: t }) {
|
|
2347
|
-
const e =
|
|
2348
|
-
let
|
|
2347
|
+
const e = Z(), n = Z();
|
|
2348
|
+
let i = !0, s;
|
|
2349
2349
|
function l() {
|
|
2350
2350
|
const c = e.value;
|
|
2351
2351
|
c && (c.scrollTop = c.scrollHeight);
|
|
@@ -2353,21 +2353,21 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2353
2353
|
h(l, "scrollToBottom");
|
|
2354
2354
|
function o() {
|
|
2355
2355
|
const c = e.value;
|
|
2356
|
-
c && (
|
|
2356
|
+
c && (i = c.scrollHeight - c.scrollTop - c.clientHeight <= hr);
|
|
2357
2357
|
}
|
|
2358
2358
|
h(o, "onScroll");
|
|
2359
|
-
function
|
|
2360
|
-
|
|
2359
|
+
function p() {
|
|
2360
|
+
i = !0, l();
|
|
2361
2361
|
}
|
|
2362
|
-
return h(
|
|
2362
|
+
return h(p, "pin"), t({ pin: p }), St(() => {
|
|
2363
2363
|
requestAnimationFrame(() => {
|
|
2364
2364
|
l(), requestAnimationFrame(l);
|
|
2365
2365
|
}), n.value && (s = new ResizeObserver(() => {
|
|
2366
|
-
|
|
2366
|
+
i && l();
|
|
2367
2367
|
}), s.observe(n.value));
|
|
2368
2368
|
}), ls(() => {
|
|
2369
2369
|
s?.disconnect();
|
|
2370
|
-
}), (c,
|
|
2370
|
+
}), (c, w) => (T(), S("div", {
|
|
2371
2371
|
ref_key: "viewport",
|
|
2372
2372
|
ref: e,
|
|
2373
2373
|
class: "overflow-y-auto overflow-x-hidden min-h-0 [overflow-anchor:none] [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
@@ -2377,42 +2377,39 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2377
2377
|
ref_key: "content",
|
|
2378
2378
|
ref: n
|
|
2379
2379
|
}, [
|
|
2380
|
-
|
|
2380
|
+
en(c.$slots, "default")
|
|
2381
2381
|
], 512)
|
|
2382
2382
|
], 544));
|
|
2383
2383
|
}
|
|
2384
|
-
}),
|
|
2384
|
+
}), dr = { class: "@container/chat flex flex-col h-full relative" }, fr = {
|
|
2385
2385
|
key: 0,
|
|
2386
2386
|
class: "pb-4"
|
|
2387
|
-
},
|
|
2387
|
+
}, gr = { class: "pt-4 pb-[120px] px-3 space-y-1" }, mr = {
|
|
2388
2388
|
key: 0,
|
|
2389
2389
|
class: "flex flex-col items-center justify-center px-4 min-h-full"
|
|
2390
|
-
},
|
|
2391
|
-
key: 0,
|
|
2392
|
-
class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
|
|
2393
|
-
}, wi = ["onClick"], vi = ["title"], yi = {
|
|
2390
|
+
}, xr = { class: "relative mb-4 size-20 @sm/chat:size-24" }, br = ["src", "alt"], kr = ["title"], wr = {
|
|
2394
2391
|
key: 0,
|
|
2395
2392
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2396
|
-
},
|
|
2393
|
+
}, vr = ["data-issue-code", "data-issue-bucket"], yr = { class: "max-w-[85%] min-w-0" }, Tr = ["href"], Sr = ["data-test"], Ar = {
|
|
2397
2394
|
key: 0,
|
|
2398
2395
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2399
|
-
},
|
|
2396
|
+
}, Er = ["src", "alt"], _r = ["src", "alt"], Rr = ["src"], Ir = ["href"], Cr = {
|
|
2400
2397
|
key: 1,
|
|
2401
2398
|
"data-test": "messaging-thinking-indicator",
|
|
2402
2399
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
2403
|
-
},
|
|
2400
|
+
}, Dr = ["src", "alt"], Mr = {
|
|
2404
2401
|
key: 0,
|
|
2405
2402
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2406
|
-
},
|
|
2403
|
+
}, Lr = ["src", "alt"], Or = { class: "max-w-20 truncate" }, zr = ["onClick"], Pr = {
|
|
2407
2404
|
key: 0,
|
|
2408
2405
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2409
|
-
},
|
|
2406
|
+
}, Nr = ["disabled"], $r = {
|
|
2410
2407
|
key: 0,
|
|
2411
2408
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2412
|
-
},
|
|
2409
|
+
}, Ur = {
|
|
2413
2410
|
key: 1,
|
|
2414
2411
|
class: "i-tabler-paperclip size-5"
|
|
2415
|
-
},
|
|
2412
|
+
}, Br = ["placeholder", "disabled"], Fr = ["disabled"], Jr = /* @__PURE__ */ ke({
|
|
2416
2413
|
__name: "ElAgentChat",
|
|
2417
2414
|
props: {
|
|
2418
2415
|
chatController: {},
|
|
@@ -2422,328 +2419,308 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2422
2419
|
scope: { default: "private" },
|
|
2423
2420
|
scopeName: {},
|
|
2424
2421
|
setupHint: {},
|
|
2425
|
-
emptyStateMessage: {}
|
|
2426
|
-
starterPrompts: {}
|
|
2422
|
+
emptyStateMessage: {}
|
|
2427
2423
|
},
|
|
2428
2424
|
setup(a) {
|
|
2429
2425
|
const t = {
|
|
2430
2426
|
private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
|
|
2431
2427
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
2432
2428
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
2433
|
-
}, e =
|
|
2434
|
-
|
|
2435
|
-
"
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
()
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
const
|
|
2453
|
-
return
|
|
2454
|
-
}
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
return f?.sender === "agent" || f?.sender === "system" ? f.id : void 0;
|
|
2460
|
-
}), fe = B(() => z.value ? te.value === void 0 : !1), Re = B(() => v.value?.accountGated ?? !1), be = B(() => !I.value || Re.value), It = B(() => X.value ? "Agent is offline" : re.value ? "Connecting..." : Re.value ? "Resolve the billing issue above to continue" : "Message"), Y = B(() => (s.value.trim() || x.value.length > 0) && !be.value && !p.value), C = B(() => a.variant === "light"), Ie = B(
|
|
2461
|
-
() => C.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2462
|
-
), ye = B(() => C.value ? "text-theme-300" : "text-white/30");
|
|
2463
|
-
Et(async () => {
|
|
2464
|
-
a.chatController && !I.value && await a.chatController.startTextConversation();
|
|
2429
|
+
}, e = B(() => {
|
|
2430
|
+
const v = { ...t[a.scope] };
|
|
2431
|
+
return a.scope === "org" && a.scopeName && (v.label = a.scopeName, v.tooltip = `Visible to ${a.scopeName} members`), v;
|
|
2432
|
+
}), n = Z(""), i = Z(!1), s = Z(), l = Z(), o = Z(), p = Z([]), c = Z(!1);
|
|
2433
|
+
function w(v) {
|
|
2434
|
+
return v ? /\[[^\]]+\]\([^)]+\)/.test(v) : !1;
|
|
2435
|
+
}
|
|
2436
|
+
h(w, "containsMarkdownLink");
|
|
2437
|
+
function d(v) {
|
|
2438
|
+
return v.sender === "system" && (!!v.issue || v.id === N.value);
|
|
2439
|
+
}
|
|
2440
|
+
h(d, "isSystemExplainerMessage");
|
|
2441
|
+
function x(v, k) {
|
|
2442
|
+
const g = v[k], P = v[k + 1];
|
|
2443
|
+
return !P || P.sender !== g.sender;
|
|
2444
|
+
}
|
|
2445
|
+
h(x, "shouldShowAvatar");
|
|
2446
|
+
const m = B(() => a.chatController?.textState.value), f = B(() => m.value?.isConnected ?? !1), E = B(() => m.value?.isThinking ?? !1), I = B(() => m.value?.connectionStatus === "disconnected" && !!m.value?.error), z = B(() => m.value?.connectionStatus !== "connected" && !m.value?.error), Q = B(() => m.value?.error), W = B(() => a.chatController?.sharedMessages.value ?? []), N = B(() => {
|
|
2447
|
+
if (!E.value) return;
|
|
2448
|
+
const v = W.value, k = v[v.length - 1];
|
|
2449
|
+
return k?.sender === "agent" || k?.sender === "system" ? k.id : void 0;
|
|
2450
|
+
}), ie = B(() => E.value ? N.value === void 0 : !1), se = B(() => m.value?.accountGated ?? !1), re = B(() => !f.value || se.value), ze = B(() => I.value ? "Agent is offline" : z.value ? "Connecting..." : se.value ? "Resolve the billing issue above to continue" : "Message"), Pe = B(() => (n.value.trim() || p.value.length > 0) && !re.value && !c.value), L = B(() => a.variant === "light"), q = B(
|
|
2451
|
+
() => L.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2452
|
+
), we = B(() => L.value ? "text-theme-300" : "text-white/30");
|
|
2453
|
+
St(async () => {
|
|
2454
|
+
a.chatController && !f.value && await a.chatController.startTextConversation();
|
|
2465
2455
|
});
|
|
2466
|
-
async function
|
|
2467
|
-
const
|
|
2468
|
-
if (!
|
|
2456
|
+
async function Ae() {
|
|
2457
|
+
const v = n.value.trim(), k = p.value.length > 0;
|
|
2458
|
+
if (!v && !k || !a.chatController || !f.value || c.value)
|
|
2469
2459
|
return;
|
|
2470
|
-
const
|
|
2471
|
-
|
|
2472
|
-
}
|
|
2473
|
-
h(
|
|
2474
|
-
async function
|
|
2475
|
-
|
|
2476
|
-
}
|
|
2477
|
-
h(
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
}
|
|
2481
|
-
h(
|
|
2482
|
-
function
|
|
2483
|
-
|
|
2484
|
-
}
|
|
2485
|
-
h(
|
|
2486
|
-
function
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
async function dt(_) {
|
|
2491
|
-
const f = _.target, k = f.files?.[0];
|
|
2492
|
-
if (!(!k || !a.uploadFn)) {
|
|
2493
|
-
p.value = !0;
|
|
2460
|
+
const g = n.value, P = k ? [...p.value] : void 0;
|
|
2461
|
+
n.value = "", p.value = [], l.value && (l.value.style.height = "auto", l.value.focus()), s.value?.pin(), await a.chatController.sendChatMessage(g, P);
|
|
2462
|
+
}
|
|
2463
|
+
h(Ae, "sendMessage");
|
|
2464
|
+
async function Ne(v) {
|
|
2465
|
+
v.key === "Enter" && !v.shiftKey && (v.preventDefault(), await Ae());
|
|
2466
|
+
}
|
|
2467
|
+
h(Ne, "handleKeydown");
|
|
2468
|
+
function _t() {
|
|
2469
|
+
l.value && (l.value.style.height = "auto", l.value.style.height = `${Math.min(l.value.scrollHeight, 150)}px`);
|
|
2470
|
+
}
|
|
2471
|
+
h(_t, "adjustTextareaHeight"), Ze(n, () => Ms(() => _t()));
|
|
2472
|
+
function Rt() {
|
|
2473
|
+
o.value?.click();
|
|
2474
|
+
}
|
|
2475
|
+
h(Rt, "triggerFileInput");
|
|
2476
|
+
async function It(v) {
|
|
2477
|
+
const k = v.target, g = k.files?.[0];
|
|
2478
|
+
if (!(!g || !a.uploadFn)) {
|
|
2479
|
+
c.value = !0;
|
|
2494
2480
|
try {
|
|
2495
|
-
const
|
|
2496
|
-
|
|
2497
|
-
} catch (
|
|
2498
|
-
const
|
|
2499
|
-
a.chatController?.notify(`Upload failed — ${
|
|
2481
|
+
const P = await a.uploadFn(g);
|
|
2482
|
+
p.value = [...p.value, P];
|
|
2483
|
+
} catch (P) {
|
|
2484
|
+
const C = P instanceof Error ? P.message : "Couldn't attach that file.";
|
|
2485
|
+
a.chatController?.notify(`Upload failed — ${C}`);
|
|
2500
2486
|
} finally {
|
|
2501
|
-
|
|
2487
|
+
c.value = !1, k.value = "";
|
|
2502
2488
|
}
|
|
2503
2489
|
}
|
|
2504
2490
|
}
|
|
2505
|
-
h(
|
|
2506
|
-
function
|
|
2507
|
-
|
|
2508
|
-
}
|
|
2509
|
-
h(
|
|
2510
|
-
function
|
|
2511
|
-
if (
|
|
2512
|
-
const
|
|
2513
|
-
return
|
|
2514
|
-
}
|
|
2515
|
-
const
|
|
2516
|
-
if (!
|
|
2517
|
-
const
|
|
2518
|
-
return new Date(
|
|
2519
|
-
}
|
|
2520
|
-
h(
|
|
2521
|
-
function
|
|
2522
|
-
const
|
|
2523
|
-
|
|
2524
|
-
const
|
|
2525
|
-
if (
|
|
2526
|
-
if (
|
|
2527
|
-
const
|
|
2528
|
-
return `${
|
|
2491
|
+
h(It, "handleFileSelect");
|
|
2492
|
+
function ct(v) {
|
|
2493
|
+
p.value = p.value.filter((k, g) => g !== v);
|
|
2494
|
+
}
|
|
2495
|
+
h(ct, "removeAttachment");
|
|
2496
|
+
function ut(v, k) {
|
|
2497
|
+
if (k === 0) {
|
|
2498
|
+
const le = v[k];
|
|
2499
|
+
return le?.timestamp ? Ke(new Date(le.timestamp)) : null;
|
|
2500
|
+
}
|
|
2501
|
+
const g = v[k - 1], P = v[k];
|
|
2502
|
+
if (!g?.timestamp || !P?.timestamp) return null;
|
|
2503
|
+
const C = new Date(g.timestamp).getTime();
|
|
2504
|
+
return new Date(P.timestamp).getTime() - C > 36e5 ? Ke(new Date(P.timestamp)) : null;
|
|
2505
|
+
}
|
|
2506
|
+
h(ut, "shouldShowTimeDivider");
|
|
2507
|
+
function Ke(v) {
|
|
2508
|
+
const k = /* @__PURE__ */ new Date(), g = v.toDateString() === k.toDateString(), P = new Date(k);
|
|
2509
|
+
P.setDate(P.getDate() - 1);
|
|
2510
|
+
const C = v.toDateString() === P.toDateString(), ae = v.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2511
|
+
if (g) return ae;
|
|
2512
|
+
if (C) return `Yesterday, ${ae}`;
|
|
2513
|
+
const Ee = v.getFullYear() === k.getFullYear();
|
|
2514
|
+
return `${v.toLocaleDateString("en-US", {
|
|
2529
2515
|
weekday: "long",
|
|
2530
2516
|
month: "short",
|
|
2531
2517
|
day: "numeric",
|
|
2532
|
-
...
|
|
2533
|
-
})}, ${
|
|
2518
|
+
...Ee ? {} : { year: "numeric" }
|
|
2519
|
+
})}, ${ae}`;
|
|
2534
2520
|
}
|
|
2535
|
-
return h(
|
|
2536
|
-
|
|
2537
|
-
|
|
2521
|
+
return h(Ke, "formatTimeDivider"), (v, k) => (T(), S("div", dr, [
|
|
2522
|
+
L.value ? j("", !0) : (T(), S("div", fr, [
|
|
2523
|
+
Ce(Ks, {
|
|
2538
2524
|
agent: a.agent,
|
|
2539
|
-
"is-online":
|
|
2525
|
+
"is-online": f.value
|
|
2540
2526
|
}, null, 8, ["agent", "is-online"])
|
|
2541
2527
|
])),
|
|
2542
|
-
|
|
2528
|
+
I.value ? (T(), S("div", {
|
|
2543
2529
|
key: 1,
|
|
2544
|
-
class:
|
|
2530
|
+
class: _(["py-16 flex flex-col items-center justify-center gap-3 text-sm", L.value ? "text-theme-400" : "text-white/60"])
|
|
2545
2531
|
}, [
|
|
2546
2532
|
A("i", {
|
|
2547
|
-
class:
|
|
2533
|
+
class: _(["i-heroicons-cloud-arrow-down size-8", L.value ? "text-theme-300" : "text-white/40"])
|
|
2548
2534
|
}, null, 2),
|
|
2549
|
-
A("span", null,
|
|
2550
|
-
], 2)) :
|
|
2535
|
+
A("span", null, ce(Q.value), 1)
|
|
2536
|
+
], 2)) : z.value ? (T(), S("div", {
|
|
2551
2537
|
key: 2,
|
|
2552
|
-
class:
|
|
2538
|
+
class: _(["py-16 flex flex-col items-center justify-center gap-2 text-sm", L.value ? "text-theme-400" : "text-theme-600"])
|
|
2553
2539
|
}, [
|
|
2554
|
-
|
|
2555
|
-
], 2)) : a.setupHint ? (
|
|
2540
|
+
Ce(zn, { class: "size-4" })
|
|
2541
|
+
], 2)) : a.setupHint ? (T(), S("div", {
|
|
2556
2542
|
key: 3,
|
|
2557
|
-
class:
|
|
2543
|
+
class: _(["flex items-center justify-center gap-1.5 py-2 text-[11px]", we.value])
|
|
2558
2544
|
}, [
|
|
2559
|
-
|
|
2560
|
-
A("span", null,
|
|
2545
|
+
k[9] || (k[9] = A("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2546
|
+
A("span", null, ce(a.setupHint), 1)
|
|
2561
2547
|
], 2)) : j("", !0),
|
|
2562
|
-
|
|
2548
|
+
Ce(pr, {
|
|
2563
2549
|
ref_key: "chatScroller",
|
|
2564
|
-
ref:
|
|
2550
|
+
ref: s,
|
|
2565
2551
|
class: "flex-1"
|
|
2566
2552
|
}, {
|
|
2567
2553
|
default: Ls(() => [
|
|
2568
|
-
A("div",
|
|
2569
|
-
|
|
2570
|
-
A("div",
|
|
2554
|
+
A("div", gr, [
|
|
2555
|
+
W.value.length === 0 && !z.value && !I.value ? (T(), S("div", mr, [
|
|
2556
|
+
A("div", xr, [
|
|
2571
2557
|
A("img", {
|
|
2572
2558
|
src: a.agent.avatarUrl.value,
|
|
2573
2559
|
alt: a.agent.displayName.value,
|
|
2574
|
-
class:
|
|
2575
|
-
}, null, 10,
|
|
2576
|
-
|
|
2560
|
+
class: _(["size-full rounded-full object-cover ring-1", L.value ? "ring-black/5" : "ring-white/10"])
|
|
2561
|
+
}, null, 10, br),
|
|
2562
|
+
f.value ? (T(), S("span", {
|
|
2577
2563
|
key: 0,
|
|
2578
|
-
class:
|
|
2579
|
-
}, [...
|
|
2564
|
+
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", L.value ? "bg-white" : "bg-theme-900"])
|
|
2565
|
+
}, [...k[10] || (k[10] = [
|
|
2580
2566
|
A("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
2581
2567
|
])], 2)) : j("", !0)
|
|
2582
2568
|
]),
|
|
2583
2569
|
A("div", {
|
|
2584
|
-
class:
|
|
2585
|
-
},
|
|
2570
|
+
class: _(["text-base @sm/chat:text-lg font-semibold", L.value ? "text-theme-900" : "text-white"])
|
|
2571
|
+
}, ce(a.agent.displayName.value), 3),
|
|
2586
2572
|
A("p", {
|
|
2587
|
-
class:
|
|
2588
|
-
},
|
|
2589
|
-
n.value.length > 0 && !be.value ? (y(), T("div", ki, [
|
|
2590
|
-
(y(!0), T(Se, null, ot(n.value, (k) => (y(), T("button", {
|
|
2591
|
-
key: k,
|
|
2592
|
-
type: "button",
|
|
2593
|
-
"data-test": "chat-starter-prompt",
|
|
2594
|
-
class: E(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", C.value ? "bg-theme-25 border border-theme-200 text-theme-700 hover:bg-theme-50 hover:border-theme-300" : "bg-white/5 border border-white/10 text-white/80 hover:bg-white/10 hover:border-white/20"]),
|
|
2595
|
-
onClick: /* @__PURE__ */ h((L) => Ct(k), "onClick")
|
|
2596
|
-
}, le(k), 11, wi))), 128))
|
|
2597
|
-
])) : j("", !0),
|
|
2573
|
+
class: _(["mt-1 text-center text-xs @sm/chat:text-sm", we.value])
|
|
2574
|
+
}, ce(a.emptyStateMessage || "Type your message to get started."), 3),
|
|
2598
2575
|
A("div", {
|
|
2599
|
-
class:
|
|
2600
|
-
title:
|
|
2576
|
+
class: _(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", L.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2577
|
+
title: e.value.tooltip
|
|
2601
2578
|
}, [
|
|
2602
2579
|
A("i", {
|
|
2603
|
-
class:
|
|
2580
|
+
class: _([e.value.icon, "size-3"])
|
|
2604
2581
|
}, null, 2),
|
|
2605
|
-
A("span", null,
|
|
2606
|
-
], 10,
|
|
2582
|
+
A("span", null, ce(e.value.label), 1)
|
|
2583
|
+
], 10, kr)
|
|
2607
2584
|
])) : j("", !0),
|
|
2608
|
-
(
|
|
2609
|
-
key:
|
|
2585
|
+
(T(!0), S(De, null, kt(W.value, (g, P) => (T(), S(De, {
|
|
2586
|
+
key: g.id
|
|
2610
2587
|
}, [
|
|
2611
|
-
|
|
2588
|
+
ut(W.value, P) ? (T(), S("div", wr, [
|
|
2612
2589
|
A("div", {
|
|
2613
|
-
class:
|
|
2590
|
+
class: _(["flex-1 h-px", q.value])
|
|
2614
2591
|
}, null, 2),
|
|
2615
2592
|
A("span", {
|
|
2616
|
-
class:
|
|
2617
|
-
},
|
|
2593
|
+
class: _(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", we.value])
|
|
2594
|
+
}, ce(ut(W.value, P)), 3),
|
|
2618
2595
|
A("div", {
|
|
2619
|
-
class:
|
|
2596
|
+
class: _(["flex-1 h-px", q.value])
|
|
2620
2597
|
}, null, 2)
|
|
2621
2598
|
])) : j("", !0),
|
|
2622
|
-
|
|
2599
|
+
d(g) ? (T(), S("div", {
|
|
2623
2600
|
key: 1,
|
|
2624
2601
|
"data-test": "messaging-system-msg",
|
|
2625
|
-
"data-issue-code":
|
|
2626
|
-
"data-issue-bucket":
|
|
2602
|
+
"data-issue-code": g.issue?.code,
|
|
2603
|
+
"data-issue-bucket": g.issue?.bucket,
|
|
2627
2604
|
class: "flex gap-2 items-end justify-start mb-4"
|
|
2628
2605
|
}, [
|
|
2629
|
-
A("div",
|
|
2606
|
+
A("div", yr, [
|
|
2630
2607
|
A("div", {
|
|
2631
|
-
class:
|
|
2608
|
+
class: _(["mb-1 pl-1 text-[11px] font-medium", L.value ? "text-theme-500" : "text-white/45"])
|
|
2632
2609
|
}, " System Message ", 2),
|
|
2633
2610
|
A("div", {
|
|
2634
|
-
class:
|
|
2611
|
+
class: _(["rounded-2xl rounded-bl-[4px] px-3.5 py-2 border system-msg-content", L.value ? "bg-theme-100 border-theme-200 text-theme-800" : "bg-white/[0.18] border-white/15 text-white/90"])
|
|
2635
2612
|
}, [
|
|
2636
|
-
|
|
2637
|
-
text:
|
|
2638
|
-
inverted: !
|
|
2639
|
-
streaming:
|
|
2640
|
-
onClick:
|
|
2613
|
+
Ce(Zt, {
|
|
2614
|
+
text: g.text,
|
|
2615
|
+
inverted: !L.value,
|
|
2616
|
+
streaming: g.id === N.value,
|
|
2617
|
+
onClick: k[0] || (k[0] = gt(() => {
|
|
2641
2618
|
}, ["stop"]))
|
|
2642
2619
|
}, null, 8, ["text", "inverted", "streaming"]),
|
|
2643
|
-
|
|
2620
|
+
g.issue?.help ? (T(), S("span", {
|
|
2644
2621
|
key: 0,
|
|
2645
|
-
class:
|
|
2646
|
-
},
|
|
2647
|
-
|
|
2622
|
+
class: _(["mt-1.5 block text-[12px]", L.value ? "text-theme-500" : "text-white/55"])
|
|
2623
|
+
}, ce(g.issue.help), 3)) : j("", !0),
|
|
2624
|
+
g.issue?.actionUrl && !w(g.text) ? (T(), S("a", {
|
|
2648
2625
|
key: 1,
|
|
2649
|
-
href:
|
|
2626
|
+
href: g.issue.actionUrl,
|
|
2650
2627
|
"data-test": "messaging-system-msg-action",
|
|
2651
|
-
class:
|
|
2652
|
-
onClick:
|
|
2628
|
+
class: _(["mt-2 text-[12px] font-medium inline-flex items-center gap-1", L.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"]),
|
|
2629
|
+
onClick: k[1] || (k[1] = gt(() => {
|
|
2653
2630
|
}, ["stop"]))
|
|
2654
2631
|
}, [
|
|
2655
|
-
On(
|
|
2656
|
-
|
|
2657
|
-
], 10,
|
|
2632
|
+
On(ce(g.issue.actionLabel) + " ", 1),
|
|
2633
|
+
k[11] || (k[11] = A("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2634
|
+
], 10, Tr)) : j("", !0)
|
|
2658
2635
|
], 2)
|
|
2659
2636
|
])
|
|
2660
|
-
], 8,
|
|
2637
|
+
], 8, vr)) : g.sender === "system" ? (T(), S("div", {
|
|
2661
2638
|
key: 2,
|
|
2662
2639
|
"data-test": "messaging-system-status-msg",
|
|
2663
|
-
class:
|
|
2640
|
+
class: _(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", L.value ? "text-theme-500" : "text-white/60"])
|
|
2664
2641
|
}, [
|
|
2665
|
-
|
|
2666
|
-
|
|
2667
|
-
text:
|
|
2668
|
-
inverted: !
|
|
2669
|
-
onClick:
|
|
2642
|
+
k[12] || (k[12] = A("i", { class: "i-tabler-info-circle size-4 mt-0.5 shrink-0" }, null, -1)),
|
|
2643
|
+
Ce(Zt, {
|
|
2644
|
+
text: g.text,
|
|
2645
|
+
inverted: !L.value,
|
|
2646
|
+
onClick: k[2] || (k[2] = gt(() => {
|
|
2670
2647
|
}, ["stop"]))
|
|
2671
2648
|
}, null, 8, ["text", "inverted"])
|
|
2672
|
-
], 2)) : (
|
|
2649
|
+
], 2)) : (T(), S("div", {
|
|
2673
2650
|
key: 3,
|
|
2674
|
-
"data-test":
|
|
2675
|
-
class:
|
|
2676
|
-
"justify-end":
|
|
2677
|
-
"justify-start":
|
|
2678
|
-
"mb-4":
|
|
2651
|
+
"data-test": g.sender === "agent" ? "messaging-assistant-msg" : g.sender === "user" ? "messaging-user-msg" : void 0,
|
|
2652
|
+
class: _(["flex gap-2 items-end", {
|
|
2653
|
+
"justify-end": g.sender === "user",
|
|
2654
|
+
"justify-start": g.sender === "agent",
|
|
2655
|
+
"mb-4": x(W.value, P)
|
|
2679
2656
|
}])
|
|
2680
2657
|
}, [
|
|
2681
|
-
|
|
2682
|
-
|
|
2658
|
+
g.sender === "agent" ? (T(), S("div", Ar, [
|
|
2659
|
+
x(W.value, P) ? (T(), S("img", {
|
|
2683
2660
|
key: 0,
|
|
2684
2661
|
src: a.agent.avatarUrl.value,
|
|
2685
2662
|
alt: a.agent.displayName.value,
|
|
2686
|
-
class:
|
|
2687
|
-
}, null, 10,
|
|
2663
|
+
class: _(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
|
|
2664
|
+
}, null, 10, Er)) : j("", !0)
|
|
2688
2665
|
])) : j("", !0),
|
|
2689
2666
|
A("div", {
|
|
2690
|
-
class:
|
|
2667
|
+
class: _(g.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2691
2668
|
}, [
|
|
2692
|
-
|
|
2669
|
+
g.attachments?.length ? (T(), S("div", {
|
|
2693
2670
|
key: 0,
|
|
2694
|
-
class:
|
|
2671
|
+
class: _(["mb-1 space-y-1", g.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2695
2672
|
}, [
|
|
2696
|
-
(
|
|
2697
|
-
|
|
2673
|
+
(T(!0), S(De, null, kt(g.attachments, (C, ae) => (T(), S(De, { key: ae }, [
|
|
2674
|
+
C.type === "image" ? (T(), S("img", {
|
|
2698
2675
|
key: 0,
|
|
2699
|
-
src:
|
|
2700
|
-
alt:
|
|
2676
|
+
src: C.src,
|
|
2677
|
+
alt: C.filename,
|
|
2701
2678
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2702
|
-
}, null, 8,
|
|
2679
|
+
}, null, 8, _r)) : C.type === "audio" ? (T(), S("audio", {
|
|
2703
2680
|
key: 1,
|
|
2704
|
-
src:
|
|
2681
|
+
src: C.src,
|
|
2705
2682
|
controls: "",
|
|
2706
2683
|
class: "max-w-full"
|
|
2707
|
-
}, null, 8,
|
|
2684
|
+
}, null, 8, Rr)) : (T(), S("a", {
|
|
2708
2685
|
key: 2,
|
|
2709
|
-
href:
|
|
2686
|
+
href: C.src,
|
|
2710
2687
|
target: "_blank",
|
|
2711
2688
|
rel: "noopener",
|
|
2712
|
-
class:
|
|
2689
|
+
class: _(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", L.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2713
2690
|
}, [
|
|
2714
|
-
|
|
2715
|
-
On(" " +
|
|
2716
|
-
], 10,
|
|
2691
|
+
k[13] || (k[13] = A("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2692
|
+
On(" " + ce(C.filename), 1)
|
|
2693
|
+
], 10, Ir))
|
|
2717
2694
|
], 64))), 128))
|
|
2718
2695
|
], 2)) : j("", !0),
|
|
2719
|
-
|
|
2696
|
+
g.text ? (T(), S("div", {
|
|
2720
2697
|
key: 1,
|
|
2721
|
-
class:
|
|
2722
|
-
|
|
2698
|
+
class: _(["rounded-2xl px-3.5 py-2", [
|
|
2699
|
+
g.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : L.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]"
|
|
2723
2700
|
]])
|
|
2724
2701
|
}, [
|
|
2725
|
-
|
|
2726
|
-
text:
|
|
2727
|
-
inverted:
|
|
2728
|
-
streaming:
|
|
2729
|
-
onClick:
|
|
2702
|
+
Ce(Zt, {
|
|
2703
|
+
text: g.text,
|
|
2704
|
+
inverted: g.sender === "user" || !L.value,
|
|
2705
|
+
streaming: g.id === N.value,
|
|
2706
|
+
onClick: k[3] || (k[3] = gt(() => {
|
|
2730
2707
|
}, ["stop"]))
|
|
2731
2708
|
}, null, 8, ["text", "inverted", "streaming"])
|
|
2732
2709
|
], 2)) : j("", !0)
|
|
2733
2710
|
], 2)
|
|
2734
|
-
], 10,
|
|
2711
|
+
], 10, Sr))
|
|
2735
2712
|
], 64))), 128)),
|
|
2736
|
-
|
|
2713
|
+
ie.value ? (T(), S("div", Cr, [
|
|
2737
2714
|
A("img", {
|
|
2738
2715
|
src: a.agent.avatarUrl.value,
|
|
2739
2716
|
alt: a.agent.displayName.value,
|
|
2740
|
-
class:
|
|
2741
|
-
}, null, 10,
|
|
2717
|
+
class: _(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", L.value ? "ring-1 ring-black/5" : ""])
|
|
2718
|
+
}, null, 10, Dr),
|
|
2742
2719
|
A("div", {
|
|
2743
|
-
class:
|
|
2720
|
+
class: _(["rounded-2xl px-3.5 py-2.5 flex items-center", L.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2744
2721
|
}, [
|
|
2745
2722
|
A("i", {
|
|
2746
|
-
class:
|
|
2723
|
+
class: _(["i-svg-spinners-3-dots-bounce size-7", L.value ? "text-theme-400" : "text-white/50"])
|
|
2747
2724
|
}, null, 2)
|
|
2748
2725
|
], 2)
|
|
2749
2726
|
])) : j("", !0)
|
|
@@ -2752,92 +2729,92 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2752
2729
|
_: 1
|
|
2753
2730
|
}, 512),
|
|
2754
2731
|
A("div", {
|
|
2755
|
-
class:
|
|
2732
|
+
class: _(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", L.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"])
|
|
2756
2733
|
}, [
|
|
2757
|
-
|
|
2758
|
-
(
|
|
2759
|
-
key:
|
|
2734
|
+
p.value.length > 0 ? (T(), S("div", Mr, [
|
|
2735
|
+
(T(!0), S(De, null, kt(p.value, (g, P) => (T(), S("div", {
|
|
2736
|
+
key: P,
|
|
2760
2737
|
class: "relative shrink-0 group"
|
|
2761
2738
|
}, [
|
|
2762
|
-
|
|
2739
|
+
g.type === "image" ? (T(), S("img", {
|
|
2763
2740
|
key: 0,
|
|
2764
|
-
src:
|
|
2765
|
-
alt:
|
|
2766
|
-
class:
|
|
2767
|
-
}, null, 10,
|
|
2741
|
+
src: g.src,
|
|
2742
|
+
alt: g.filename,
|
|
2743
|
+
class: _(["size-14 rounded-xl object-cover border", L.value ? "border-black/10" : "border-white/20"])
|
|
2744
|
+
}, null, 10, Lr)) : (T(), S("div", {
|
|
2768
2745
|
key: 1,
|
|
2769
|
-
class:
|
|
2746
|
+
class: _(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", L.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2770
2747
|
}, [
|
|
2771
|
-
|
|
2772
|
-
A("span",
|
|
2748
|
+
k[14] || (k[14] = A("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2749
|
+
A("span", Or, ce(g.filename), 1)
|
|
2773
2750
|
], 2)),
|
|
2774
2751
|
A("button", {
|
|
2775
2752
|
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",
|
|
2776
|
-
onClick: /* @__PURE__ */ h((
|
|
2777
|
-
}, [...
|
|
2753
|
+
onClick: /* @__PURE__ */ h((C) => ct(P), "onClick")
|
|
2754
|
+
}, [...k[15] || (k[15] = [
|
|
2778
2755
|
A("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2779
|
-
])], 8,
|
|
2756
|
+
])], 8, zr)
|
|
2780
2757
|
]))), 128)),
|
|
2781
|
-
|
|
2782
|
-
|
|
2758
|
+
c.value ? (T(), S("div", Pr, [
|
|
2759
|
+
Ce(zn, { class: "size-5" })
|
|
2783
2760
|
])) : j("", !0)
|
|
2784
2761
|
])) : j("", !0),
|
|
2785
|
-
a.uploadFn ? (
|
|
2762
|
+
a.uploadFn ? (T(), S("input", {
|
|
2786
2763
|
key: 1,
|
|
2787
2764
|
ref_key: "fileInput",
|
|
2788
|
-
ref:
|
|
2765
|
+
ref: o,
|
|
2789
2766
|
type: "file",
|
|
2790
2767
|
accept: "image/*,audio/*,video/*",
|
|
2791
2768
|
class: "hidden",
|
|
2792
|
-
onChange:
|
|
2769
|
+
onChange: It
|
|
2793
2770
|
}, null, 544)) : j("", !0),
|
|
2794
2771
|
A("div", {
|
|
2795
|
-
class:
|
|
2772
|
+
class: _(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-colors duration-200", L.value ? i.value ? "bg-theme-50 ring-1 ring-theme-300" : "bg-theme-25 ring-1 ring-theme-200 hover:ring-theme-300" : i.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
2796
2773
|
}, [
|
|
2797
2774
|
A("button", {
|
|
2798
|
-
class:
|
|
2775
|
+
class: _(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
2799
2776
|
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
2800
|
-
|
|
2801
|
-
|
|
2777
|
+
L.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
2778
|
+
c.value ? "opacity-50 pointer-events-none" : ""
|
|
2802
2779
|
]]),
|
|
2803
|
-
disabled:
|
|
2804
|
-
onClick:
|
|
2780
|
+
disabled: re.value || c.value || !a.uploadFn,
|
|
2781
|
+
onClick: k[4] || (k[4] = (g) => a.uploadFn && Rt())
|
|
2805
2782
|
}, [
|
|
2806
|
-
|
|
2807
|
-
], 10,
|
|
2808
|
-
|
|
2783
|
+
c.value ? (T(), S("i", $r)) : (T(), S("i", Ur))
|
|
2784
|
+
], 10, Nr),
|
|
2785
|
+
is(A("textarea", {
|
|
2809
2786
|
ref_key: "textarea",
|
|
2810
|
-
ref:
|
|
2811
|
-
"onUpdate:modelValue":
|
|
2787
|
+
ref: l,
|
|
2788
|
+
"onUpdate:modelValue": k[5] || (k[5] = (g) => n.value = g),
|
|
2812
2789
|
"data-test": "messaging-input",
|
|
2813
2790
|
rows: "1",
|
|
2814
2791
|
enterkeyhint: "send",
|
|
2815
|
-
placeholder:
|
|
2816
|
-
disabled:
|
|
2792
|
+
placeholder: ze.value,
|
|
2793
|
+
disabled: re.value,
|
|
2817
2794
|
style: { fontSize: "16px", resize: "none" },
|
|
2818
|
-
class:
|
|
2819
|
-
onKeydown:
|
|
2820
|
-
onFocus:
|
|
2821
|
-
onBlur:
|
|
2822
|
-
}, null, 42,
|
|
2823
|
-
[
|
|
2795
|
+
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", L.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2796
|
+
onKeydown: Ne,
|
|
2797
|
+
onFocus: k[6] || (k[6] = (g) => i.value = !0),
|
|
2798
|
+
onBlur: k[7] || (k[7] = (g) => i.value = !1)
|
|
2799
|
+
}, null, 42, Br), [
|
|
2800
|
+
[rs, n.value]
|
|
2824
2801
|
]),
|
|
2825
2802
|
A("button", {
|
|
2826
2803
|
"data-test": "messaging-send-btn",
|
|
2827
|
-
class:
|
|
2828
|
-
disabled: !
|
|
2829
|
-
onClick:
|
|
2830
|
-
}, [...
|
|
2804
|
+
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", Pe.value ? "bg-primary-500 text-white hover:scale-105 active:scale-95 cursor-pointer" : L.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
2805
|
+
disabled: !Pe.value,
|
|
2806
|
+
onClick: k[8] || (k[8] = (g) => Ae())
|
|
2807
|
+
}, [...k[16] || (k[16] = [
|
|
2831
2808
|
A("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2832
|
-
])], 10,
|
|
2809
|
+
])], 10, Fr)
|
|
2833
2810
|
], 2)
|
|
2834
2811
|
], 2)
|
|
2835
2812
|
]));
|
|
2836
2813
|
}
|
|
2837
|
-
}),
|
|
2814
|
+
}), Hr = { class: "agent-wrap" }, Gr = {
|
|
2838
2815
|
key: 0,
|
|
2839
2816
|
class: "flex items-center justify-center h-full"
|
|
2840
|
-
},
|
|
2817
|
+
}, ea = /* @__PURE__ */ ke({
|
|
2841
2818
|
__name: "AgentWrap",
|
|
2842
2819
|
props: {
|
|
2843
2820
|
sdk: {},
|
|
@@ -2854,13 +2831,13 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2854
2831
|
const t = zs("AgentWrap"), e = a, n = e.sdk || Ps.getInstance({
|
|
2855
2832
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2856
2833
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2857
|
-
}),
|
|
2858
|
-
return
|
|
2834
|
+
}), i = Z(!e.agent), s = as(e.agent ? new wt({ config: e.agent }) : void 0), l = Z();
|
|
2835
|
+
return St(async () => {
|
|
2859
2836
|
if (e.agent) {
|
|
2860
2837
|
t.debug("Agent provided via props, skipping fetch", {
|
|
2861
2838
|
agentId: e.agent.agentId,
|
|
2862
2839
|
handle: e.agent.handle
|
|
2863
|
-
}),
|
|
2840
|
+
}), i.value = !1;
|
|
2864
2841
|
return;
|
|
2865
2842
|
}
|
|
2866
2843
|
if (!e.handle) {
|
|
@@ -2875,13 +2852,13 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2875
2852
|
isDev: n.isDev,
|
|
2876
2853
|
apiBase: n.apiBase
|
|
2877
2854
|
}
|
|
2878
|
-
}),
|
|
2855
|
+
}), i.value = !1;
|
|
2879
2856
|
return;
|
|
2880
2857
|
}
|
|
2881
2858
|
try {
|
|
2882
|
-
|
|
2859
|
+
i.value = !0, t.debug("Fetching public agent", { handle: e.handle });
|
|
2883
2860
|
const o = await n.user.getPublicAgent({ handle: e.handle });
|
|
2884
|
-
o ? (s.value = new
|
|
2861
|
+
o ? (s.value = new wt({ config: o }), t.debug("Successfully fetched public agent", {
|
|
2885
2862
|
agentId: o.agentId,
|
|
2886
2863
|
handle: o.handle
|
|
2887
2864
|
}), o.agentId && n.user.track({
|
|
@@ -2913,9 +2890,9 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2913
2890
|
}
|
|
2914
2891
|
});
|
|
2915
2892
|
} finally {
|
|
2916
|
-
|
|
2893
|
+
i.value = !1, s.value || t.debug("AgentWrap component will render empty (silent failure)", {
|
|
2917
2894
|
state: {
|
|
2918
|
-
loading:
|
|
2895
|
+
loading: i.value,
|
|
2919
2896
|
hasAgent: !!s.value,
|
|
2920
2897
|
error: l.value
|
|
2921
2898
|
},
|
|
@@ -2931,33 +2908,33 @@ const ui = ["innerHTML"], Kt = /* @__PURE__ */ ve({
|
|
|
2931
2908
|
}
|
|
2932
2909
|
});
|
|
2933
2910
|
}
|
|
2934
|
-
}), (o,
|
|
2935
|
-
|
|
2911
|
+
}), (o, p) => (T(), S("div", Hr, [
|
|
2912
|
+
i.value ? (T(), S("div", Gr, [...p[0] || (p[0] = [
|
|
2936
2913
|
A("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
2937
|
-
])])) : s.value ?
|
|
2914
|
+
])])) : s.value ? en(o.$slots, "default", {
|
|
2938
2915
|
key: 1,
|
|
2939
|
-
sdk:
|
|
2916
|
+
sdk: Xt(n),
|
|
2940
2917
|
agent: s.value,
|
|
2941
2918
|
context: a.context,
|
|
2942
2919
|
firstMessage: a.firstMessage,
|
|
2943
2920
|
buttonText: a.buttonText,
|
|
2944
2921
|
buttonIcon: a.buttonIcon,
|
|
2945
|
-
loading:
|
|
2922
|
+
loading: i.value
|
|
2946
2923
|
}) : j("", !0)
|
|
2947
2924
|
]));
|
|
2948
2925
|
}
|
|
2949
2926
|
});
|
|
2950
2927
|
export {
|
|
2951
2928
|
Pn as A,
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2929
|
+
ea as _,
|
|
2930
|
+
Jr as a,
|
|
2931
|
+
Kr as b,
|
|
2932
|
+
Xr as c,
|
|
2933
|
+
Qr as d,
|
|
2957
2934
|
zn as e,
|
|
2958
2935
|
Ks as f,
|
|
2959
|
-
|
|
2936
|
+
Yr as g,
|
|
2960
2937
|
$n as h,
|
|
2961
|
-
|
|
2938
|
+
Zr as p
|
|
2962
2939
|
};
|
|
2963
2940
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|