@pagelines/sdk 1.0.472 → 1.0.474
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/AgentWrap.vue_vue_type_script_setup_true_lang.js +1226 -1144
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/agent/AgentController.d.ts +15 -0
- package/dist/agent/ui/ElAgentChat.vue.d.ts +2 -0
- package/dist/clients/ChatClient.d.ts +13 -2
- package/dist/index.js +54 -54
- package/dist/index.js.map +1 -1
- package/dist/sdkClient.d.ts +0 -4
- package/dist/sdkClient.js +297 -231
- package/dist/sdkClient.js.map +1 -1
- package/package.json +13 -13
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { SettingsObject as
|
|
7
|
-
import { P as
|
|
8
|
-
const
|
|
1
|
+
var Mn = Object.defineProperty;
|
|
2
|
+
var Es = (a, t, e) => t in a ? Mn(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
|
|
3
|
+
var h = (a, t) => Mn(a, "name", { value: t, configurable: !0 });
|
|
4
|
+
var D = (a, t, e) => Es(a, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as Le, openBlock as T, createElementBlock as S, createElementVNode as y, normalizeClass as A, ref as ee, watch as ct, computed as G, createCommentVNode as B, renderSlot as ts, onMounted as nn, Fragment as Te, renderList as at, withDirectives as ns, vModelText as ss, unref as Qt, toDisplayString as ie, nextTick as Wt, createVNode as qt, createTextVNode as Je, withModifiers as _s, shallowRef as Rs } from "vue";
|
|
6
|
+
import { SettingsObject as Is, Agent as Tt, getDefaultAvatarUrl as rs, createLogger as Ds } from "@pagelines/core";
|
|
7
|
+
import { P as Cs } from "./sdkClient.js";
|
|
8
|
+
const Ms = { class: "spinner max-w-sm" }, Ls = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
},
|
|
11
|
+
}, Ln = /* @__PURE__ */ Le({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
18
|
-
return (t, e) => (
|
|
19
|
-
(
|
|
20
|
-
|
|
21
|
-
class:
|
|
17
|
+
setup(a) {
|
|
18
|
+
return (t, e) => (T(), S("div", Ms, [
|
|
19
|
+
(T(), S("svg", Ls, [
|
|
20
|
+
y("circle", {
|
|
21
|
+
class: A([a.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
23
23
|
cy: "50",
|
|
24
24
|
r: "20",
|
|
@@ -30,27 +30,27 @@ const Es = { class: "spinner max-w-sm" }, _s = {
|
|
|
30
30
|
]))
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), Os = [
|
|
34
34
|
{ pattern: /\bNO_REP\w*\b/g, label: "NO_REPLY — bot chose not to respond" },
|
|
35
35
|
{ pattern: /\bHEARTBEAT_OK\b/g, label: "HEARTBEAT_OK — scheduled check, nothing to do" }
|
|
36
|
-
],
|
|
36
|
+
], zs = 9e4, dn = class dn extends Is {
|
|
37
37
|
constructor(e) {
|
|
38
38
|
super("AgentChatController", e);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
D(this, "isTextMode", !1);
|
|
40
|
+
D(this, "lastMessage", { hash: "", time: 0 });
|
|
41
|
+
D(this, "isConnecting", !1);
|
|
42
42
|
// Chat conversation tracking (server-managed persistence)
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
D(this, "conversationId");
|
|
44
|
+
D(this, "textState", ee({
|
|
45
45
|
isActive: !1,
|
|
46
46
|
isConnected: !1,
|
|
47
47
|
isThinking: !1,
|
|
48
48
|
connectionStatus: "disconnected"
|
|
49
49
|
}));
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this._agent = e.agent instanceof
|
|
50
|
+
D(this, "agentMode", ee("self"));
|
|
51
|
+
D(this, "sharedMessages", ee([]));
|
|
52
|
+
D(this, "_agent");
|
|
53
|
+
this._agent = e.agent instanceof Tt ? e.agent : new Tt({ config: e.agent }), this.setupModeWatcher();
|
|
54
54
|
}
|
|
55
55
|
get chatEnabled() {
|
|
56
56
|
return this._agent.chatAvailable.value;
|
|
@@ -59,14 +59,21 @@ const Es = { class: "spinner max-w-sm" }, _s = {
|
|
|
59
59
|
return this._agent.chatUnavailable.value;
|
|
60
60
|
}
|
|
61
61
|
mapChatError(e) {
|
|
62
|
-
return e.includes("429") || e.includes("Too many") ? "Too many messages. Please wait a moment." : e.includes("503") || e.includes("not available") ? "Agent is currently offline." : e.includes("timed out") ? "This request timed out. Try again in a few minutes." : e.includes("starting up") ? "Agent is starting up. Please try again." : e.includes("404") ? "Agent not found." : "Something went wrong.
|
|
62
|
+
return e.includes("429") || e.includes("Too many") ? "Too many messages. Please wait a moment." : e.includes("503") || e.includes("not available") ? "Agent is currently offline." : e.includes("timed out") ? "This request timed out. Try again in a few minutes." : e.includes("starting up") ? "Agent is starting up. Please try again." : e.includes("404") ? "Agent not found." : e.includes("[no-reply]") ? "The reply didn't make it back. Refresh to see if it landed." : e.includes("[stream-open]") || e.includes("[stream-read]") ? "Lost connection mid-reply. Try again." : e.includes("[api]") ? "Couldn't send. Try again." : "Something went wrong. Try again.";
|
|
63
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Errors we treat as recoverable mid-conversation: rate limits, timeouts,
|
|
66
|
+
* transient infra blips, dropped streams. We render an inline system bubble
|
|
67
|
+
* and keep the input enabled so the next attempt can succeed without
|
|
68
|
+
* forcing a manual reload. Hard errors (auth lost, agent missing) still
|
|
69
|
+
* fall through to handleError which marks the conversation dead.
|
|
70
|
+
*/
|
|
64
71
|
isTransientError(e) {
|
|
65
|
-
return e.includes("timed out") || e.includes("starting up") || e.includes("503");
|
|
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]");
|
|
66
73
|
}
|
|
67
74
|
isDuplicateMessage(e, n) {
|
|
68
|
-
const s = `${n}:${e.toLowerCase().trim()}`, r = Date.now(),
|
|
69
|
-
return
|
|
75
|
+
const s = `${n}:${e.toLowerCase().trim()}`, r = Date.now(), l = s === this.lastMessage.hash && r - this.lastMessage.time < 500;
|
|
76
|
+
return l || (this.lastMessage = { hash: s, time: r }), l;
|
|
70
77
|
}
|
|
71
78
|
addMessage(e, n, s, r) {
|
|
72
79
|
this.isDuplicateMessage(e, n) || (this.sharedMessages.value = [
|
|
@@ -77,7 +84,7 @@ const Es = { class: "spinner max-w-sm" }, _s = {
|
|
|
77
84
|
getDynamicSettings() {
|
|
78
85
|
const { sdk: e } = this.settings;
|
|
79
86
|
if (!e) return { context: this.settings.context || "", firstMessage: this.settings.firstMessage || "" };
|
|
80
|
-
const n = e.activeUser.value, s = n?.agents?.find((
|
|
87
|
+
const n = e.activeUser.value, s = n?.agents?.find((l) => l.agentId === n.primaryAgentId), r = n ? `
|
|
81
88
|
|
|
82
89
|
Current User:
|
|
83
90
|
- Name: ${s?.name || "Anonymous"}
|
|
@@ -103,14 +110,22 @@ Current User:
|
|
|
103
110
|
});
|
|
104
111
|
}
|
|
105
112
|
setupModeWatcher() {
|
|
106
|
-
|
|
113
|
+
ct(this.agentMode, async (e, n) => {
|
|
107
114
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
108
115
|
});
|
|
109
116
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
117
|
+
/**
|
|
118
|
+
* Hard error path. Resets the connection and surfaces an inline bubble so
|
|
119
|
+
* the user actually sees what happened — `connectionStatus: 'error'`
|
|
120
|
+
* alone doesn't render anywhere. The raw error is kept on console.error
|
|
121
|
+
* so devs can tell which pipeline stage failed (the `[api]` /
|
|
122
|
+
* `[stream-open]` / `[stream-read]` / `[no-reply]` tags from
|
|
123
|
+
* agent/client.ts survive into the console line).
|
|
124
|
+
*/
|
|
125
|
+
handleError(e, n) {
|
|
126
|
+
const s = e.message;
|
|
127
|
+
this.logger.error("Conversation error:", { message: s, raw: n, error: e }), this.addMessage(s, "system"), this.resetState(), this.updateState(this.textState, {
|
|
128
|
+
error: s,
|
|
114
129
|
connectionStatus: "error"
|
|
115
130
|
});
|
|
116
131
|
}
|
|
@@ -157,7 +172,13 @@ Current User:
|
|
|
157
172
|
* conversation and the user wants a clean slate after resolving it.
|
|
158
173
|
*/
|
|
159
174
|
newConversation() {
|
|
160
|
-
this.conversationId = void 0, this.sharedMessages.value = [], this.lastMessage = { hash: "", time: 0 }, this.updateState(this.textState, {
|
|
175
|
+
this.conversationId = void 0, this.sharedMessages.value = [], this.lastMessage = { hash: "", time: 0 }, this.updateState(this.textState, {
|
|
176
|
+
isThinking: !1,
|
|
177
|
+
accountGated: !1,
|
|
178
|
+
isConnected: this.chatEnabled,
|
|
179
|
+
connectionStatus: this.chatEnabled ? "connected" : "disconnected",
|
|
180
|
+
error: void 0
|
|
181
|
+
});
|
|
161
182
|
}
|
|
162
183
|
async sendChatMessage(e, n) {
|
|
163
184
|
if (!this.isTextMode)
|
|
@@ -173,52 +194,52 @@ Current User:
|
|
|
173
194
|
return;
|
|
174
195
|
}
|
|
175
196
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
|
|
176
|
-
const
|
|
197
|
+
const l = `stream-${Date.now()}`;
|
|
177
198
|
let o = !1;
|
|
178
|
-
const c = /* @__PURE__ */ h((
|
|
199
|
+
const c = /* @__PURE__ */ h((f) => {
|
|
179
200
|
o || (o = !0, this.sharedMessages.value = [
|
|
180
201
|
...this.sharedMessages.value,
|
|
181
|
-
{ id:
|
|
202
|
+
{ id: l, text: "", sender: "agent", timestamp: (/* @__PURE__ */ new Date()).toISOString() }
|
|
182
203
|
]);
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
}, "onDelta"),
|
|
204
|
+
const m = this.sharedMessages.value, w = m[m.length - 1];
|
|
205
|
+
w?.id === l && (w.text += f, this.sharedMessages.value = [...m]);
|
|
206
|
+
}, "onDelta"), p = /* @__PURE__ */ h((f) => {
|
|
186
207
|
if (!o) {
|
|
187
208
|
g("empty_stream — assistant returned no content");
|
|
188
209
|
return;
|
|
189
210
|
}
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
192
|
-
let
|
|
193
|
-
for (const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
}, "onDone"), g = /* @__PURE__ */ h((
|
|
199
|
-
const
|
|
200
|
-
if (
|
|
201
|
-
const { bucket:
|
|
202
|
-
if (
|
|
203
|
-
const
|
|
204
|
-
this.addMessage(
|
|
211
|
+
const m = this.sharedMessages.value, w = m[m.length - 1];
|
|
212
|
+
if (w?.id === l && w.text) {
|
|
213
|
+
let E = w.text;
|
|
214
|
+
for (const O of Os)
|
|
215
|
+
O.pattern.test(E) && (console.debug(`[chat] filtered directive: ${O.label}`), E = E.replace(O.pattern, "").trim(), O.pattern.lastIndex = 0);
|
|
216
|
+
E ? E !== w.text && (w.text = E, this.sharedMessages.value = [...m]) : this.sharedMessages.value = m.slice(0, -1);
|
|
217
|
+
}
|
|
218
|
+
f && (this.conversationId = f), this.updateState(this.textState, { isThinking: !1 });
|
|
219
|
+
}, "onDone"), g = /* @__PURE__ */ h((f) => {
|
|
220
|
+
const m = this.sharedMessages.value, w = m[m.length - 1];
|
|
221
|
+
if (w?.id === l && !w.text && (this.sharedMessages.value = m.slice(0, -1)), typeof f == "object" && f.code && f.error) {
|
|
222
|
+
const { bucket: U, actionUrl: ae, actionLabel: le, help: z } = f;
|
|
223
|
+
if (U !== void 0 || (/* @__PURE__ */ new Set(["CREDIT_LIMIT", "OVERAGE_CAP", "EMPTY_STREAM", "RATE_LIMIT"])).has(f.code)) {
|
|
224
|
+
const V = U && ae && le ? { code: f.code, bucket: U, actionLabel: le, actionUrl: ae, ...z ? { help: z } : {} } : void 0;
|
|
225
|
+
this.addMessage(f.error, "system", void 0, V), U === "account" ? this.updateState(this.textState, { isThinking: !1, accountGated: !0 }) : this.updateState(this.textState, { isThinking: !1 });
|
|
205
226
|
} else
|
|
206
|
-
this.handleError(new Error(
|
|
227
|
+
this.handleError(new Error(f.error));
|
|
207
228
|
return;
|
|
208
229
|
}
|
|
209
|
-
const
|
|
210
|
-
this.isTransientError(
|
|
211
|
-
}, "onError"), d = /* @__PURE__ */ h((
|
|
212
|
-
this.addMessage(
|
|
230
|
+
const E = typeof f == "string" ? f : f.error, O = this.mapChatError(E);
|
|
231
|
+
this.isTransientError(E) ? (this.logger.warn("Chat turn failed (transient):", { raw: E, friendly: O }), this.addMessage(O, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(O), E);
|
|
232
|
+
}, "onError"), d = /* @__PURE__ */ h((f) => {
|
|
233
|
+
this.addMessage(f, "system");
|
|
213
234
|
}, "onStatus");
|
|
214
235
|
try {
|
|
215
|
-
const
|
|
236
|
+
const f = s ? s({
|
|
216
237
|
message: e,
|
|
217
238
|
attachments: n,
|
|
218
239
|
conversationId: this.conversationId,
|
|
219
240
|
history: this.buildHistory(),
|
|
220
241
|
onDelta: c,
|
|
221
|
-
onDone:
|
|
242
|
+
onDone: p,
|
|
222
243
|
onError: g,
|
|
223
244
|
onStatus: d
|
|
224
245
|
}) : r.chatStream({
|
|
@@ -230,16 +251,16 @@ Current User:
|
|
|
230
251
|
visitorId: r.generateAnonId(),
|
|
231
252
|
context: this.getDynamicSettings().context || void 0,
|
|
232
253
|
onDelta: c,
|
|
233
|
-
onDone:
|
|
254
|
+
onDone: p,
|
|
234
255
|
onError: g,
|
|
235
256
|
onStatus: d
|
|
236
257
|
});
|
|
237
258
|
await Promise.race([
|
|
238
|
-
|
|
239
|
-
new Promise((
|
|
259
|
+
f,
|
|
260
|
+
new Promise((m, w) => setTimeout(() => w(new Error("timed out")), zs))
|
|
240
261
|
]);
|
|
241
|
-
} catch (
|
|
242
|
-
g(
|
|
262
|
+
} catch (f) {
|
|
263
|
+
g(f.message || "Something went wrong");
|
|
243
264
|
}
|
|
244
265
|
}
|
|
245
266
|
buildHistory() {
|
|
@@ -263,30 +284,30 @@ Current User:
|
|
|
263
284
|
await this.endConversation();
|
|
264
285
|
}
|
|
265
286
|
};
|
|
266
|
-
h(
|
|
267
|
-
let
|
|
268
|
-
function
|
|
269
|
-
return
|
|
287
|
+
h(dn, "AgentChatController");
|
|
288
|
+
let On = dn;
|
|
289
|
+
function zn(a) {
|
|
290
|
+
return a ? typeof a == "string" ? a : a.src || "" : "";
|
|
270
291
|
}
|
|
271
|
-
h(
|
|
272
|
-
function
|
|
273
|
-
return
|
|
292
|
+
h(zn, "getImageSrc");
|
|
293
|
+
function Hi(a) {
|
|
294
|
+
return zn(a.cover) || zn(a.avatar) || rs(a.name);
|
|
274
295
|
}
|
|
275
|
-
h(
|
|
276
|
-
function
|
|
277
|
-
const t =
|
|
278
|
-
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src =
|
|
296
|
+
h(Hi, "getAgentAvatarUrl");
|
|
297
|
+
function Pn(a) {
|
|
298
|
+
const t = a.target;
|
|
299
|
+
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = rs());
|
|
279
300
|
}
|
|
280
|
-
h(
|
|
281
|
-
function
|
|
282
|
-
const { template: t, agent: e } =
|
|
301
|
+
h(Pn, "handleImageError");
|
|
302
|
+
function Gi(a) {
|
|
303
|
+
const { template: t, agent: e } = a;
|
|
283
304
|
return t.replace(/{name}/g, e.name || "Digital Agent").replace(/{title}/g, e.title || "").replace(/{handle}/g, e.handle || "").replace(/{orgName}/g, e.org?.name || "");
|
|
284
305
|
}
|
|
285
|
-
h(
|
|
286
|
-
const
|
|
306
|
+
h(Gi, "parseButtonTemplate");
|
|
307
|
+
const Ps = {
|
|
287
308
|
key: 0,
|
|
288
309
|
class: "absolute inset-0 flex items-center justify-center"
|
|
289
|
-
},
|
|
310
|
+
}, ji = /* @__PURE__ */ Le({
|
|
290
311
|
__name: "ElAgentButton",
|
|
291
312
|
props: {
|
|
292
313
|
theme: { default: "primary" },
|
|
@@ -295,61 +316,61 @@ const Is = {
|
|
|
295
316
|
icon: {},
|
|
296
317
|
iconAfter: {}
|
|
297
318
|
},
|
|
298
|
-
setup(
|
|
299
|
-
const t =
|
|
319
|
+
setup(a) {
|
|
320
|
+
const t = G(() => ({
|
|
300
321
|
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
301
322
|
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
302
323
|
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
303
324
|
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
|
|
304
|
-
})[
|
|
325
|
+
})[a.theme]), e = G(() => ({
|
|
305
326
|
sm: "px-4 py-2 text-sm",
|
|
306
327
|
md: "px-6 py-3 text-base",
|
|
307
328
|
lg: "px-8 py-4 text-base"
|
|
308
|
-
})[
|
|
329
|
+
})[a.size]), n = G(() => ({
|
|
309
330
|
sm: "size-4",
|
|
310
331
|
md: "size-4",
|
|
311
332
|
lg: "size-5"
|
|
312
|
-
})[
|
|
313
|
-
return (s, r) => (
|
|
314
|
-
class:
|
|
333
|
+
})[a.size]);
|
|
334
|
+
return (s, r) => (T(), S("button", {
|
|
335
|
+
class: A(["relative inline-flex items-center justify-center gap-2 font-medium rounded-full backdrop-blur-sm border-2 text-white transition-all duration-200 focus:outline-none active:opacity-80 disabled:opacity-50 disabled:cursor-not-allowed cursor-pointer", [t.value, e.value]])
|
|
315
336
|
}, [
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
])])) :
|
|
319
|
-
|
|
320
|
-
class:
|
|
337
|
+
a.loading ? (T(), S("div", Ps, [...r[0] || (r[0] = [
|
|
338
|
+
y("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
339
|
+
])])) : B("", !0),
|
|
340
|
+
y("span", {
|
|
341
|
+
class: A(["flex items-center gap-2 transition-opacity duration-200", a.loading ? "opacity-0" : "opacity-100"])
|
|
321
342
|
}, [
|
|
322
|
-
|
|
343
|
+
a.icon ? (T(), S("i", {
|
|
323
344
|
key: 0,
|
|
324
|
-
class:
|
|
325
|
-
}, null, 2)) :
|
|
326
|
-
|
|
327
|
-
|
|
345
|
+
class: A([a.icon, n.value])
|
|
346
|
+
}, null, 2)) : B("", !0),
|
|
347
|
+
ts(s.$slots, "default"),
|
|
348
|
+
a.iconAfter ? (T(), S("i", {
|
|
328
349
|
key: 1,
|
|
329
|
-
class:
|
|
330
|
-
}, null, 2)) :
|
|
350
|
+
class: A([a.iconAfter, n.value])
|
|
351
|
+
}, null, 2)) : B("", !0)
|
|
331
352
|
], 2)
|
|
332
353
|
], 2));
|
|
333
354
|
}
|
|
334
|
-
}),
|
|
355
|
+
}), Ns = ["value"], Wi = /* @__PURE__ */ Le({
|
|
335
356
|
__name: "AgentInputEmail",
|
|
336
357
|
props: {
|
|
337
358
|
modelValue: { default: "" }
|
|
338
359
|
},
|
|
339
360
|
emits: ["update:modelValue"],
|
|
340
|
-
setup(
|
|
361
|
+
setup(a, { emit: t }) {
|
|
341
362
|
const e = t;
|
|
342
|
-
return (n, s) => (
|
|
363
|
+
return (n, s) => (T(), S("input", {
|
|
343
364
|
type: "email",
|
|
344
365
|
autocomplete: "email",
|
|
345
366
|
placeholder: "Enter Your Email",
|
|
346
|
-
value:
|
|
367
|
+
value: a.modelValue,
|
|
347
368
|
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",
|
|
348
369
|
style: { "font-size": "16px" },
|
|
349
370
|
onInput: s[0] || (s[0] = (r) => e("update:modelValue", r.target.value))
|
|
350
|
-
}, null, 40,
|
|
371
|
+
}, null, 40, Ns));
|
|
351
372
|
}
|
|
352
|
-
}),
|
|
373
|
+
}), $s = { class: "flex gap-1.5 justify-center" }, Bs = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], qi = /* @__PURE__ */ Le({
|
|
353
374
|
__name: "AgentInputOneTimeCode",
|
|
354
375
|
props: {
|
|
355
376
|
modelValue: {},
|
|
@@ -357,74 +378,74 @@ const Is = {
|
|
|
357
378
|
focusFirst: { type: Boolean }
|
|
358
379
|
},
|
|
359
380
|
emits: ["update:modelValue", "autoSubmit"],
|
|
360
|
-
setup(
|
|
361
|
-
const e =
|
|
362
|
-
|
|
381
|
+
setup(a, { emit: t }) {
|
|
382
|
+
const e = a, n = t, s = ee([]), r = ee(Array.from({ length: e.length }).fill("")), l = ee(!1);
|
|
383
|
+
nn(() => {
|
|
363
384
|
e.modelValue && (r.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && s.value[0]?.focus();
|
|
364
|
-
}),
|
|
385
|
+
}), ct(() => e.modelValue, (d) => {
|
|
365
386
|
r.value = d ? d.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
|
|
366
|
-
}),
|
|
387
|
+
}), ct(r, () => {
|
|
367
388
|
const d = r.value.filter(Boolean).join("");
|
|
368
389
|
n("update:modelValue", d), d.length === e.length && n("autoSubmit", d);
|
|
369
390
|
}, { deep: !0 });
|
|
370
|
-
function o(d,
|
|
371
|
-
|
|
372
|
-
const
|
|
373
|
-
if (
|
|
374
|
-
r.value =
|
|
375
|
-
s.value[e.length - 1]?.focus(),
|
|
391
|
+
function o(d, f) {
|
|
392
|
+
f.preventDefault(), l.value = !0;
|
|
393
|
+
const m = (f.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
394
|
+
if (m.length === e.length)
|
|
395
|
+
r.value = m.split(""), setTimeout(() => {
|
|
396
|
+
s.value[e.length - 1]?.focus(), l.value = !1;
|
|
376
397
|
}, 10);
|
|
377
398
|
else {
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
}), r.value =
|
|
382
|
-
const
|
|
399
|
+
const w = [...r.value];
|
|
400
|
+
m.split("").slice(0, e.length - d).forEach((O, U) => {
|
|
401
|
+
w[d + U] = O;
|
|
402
|
+
}), r.value = w;
|
|
403
|
+
const E = Math.min(d + m.length, e.length - 1);
|
|
383
404
|
setTimeout(() => {
|
|
384
|
-
s.value[
|
|
405
|
+
s.value[E]?.focus(), l.value = !1;
|
|
385
406
|
}, 10);
|
|
386
407
|
}
|
|
387
408
|
}
|
|
388
409
|
h(o, "onPaste");
|
|
389
|
-
function c(d,
|
|
390
|
-
const
|
|
391
|
-
r.value[d] =
|
|
410
|
+
function c(d, f) {
|
|
411
|
+
const m = f.target.value.slice(-1).replace(/\D/g, "");
|
|
412
|
+
r.value[d] = m, m && d < e.length - 1 && s.value[d + 1]?.focus();
|
|
392
413
|
}
|
|
393
414
|
h(c, "onInput");
|
|
394
|
-
function
|
|
395
|
-
|
|
415
|
+
function p(d, f) {
|
|
416
|
+
f.key === "Backspace" ? (f.preventDefault(), r.value[d] = "", d > 0 && s.value[d - 1]?.focus()) : f.key === "ArrowLeft" && d > 0 ? s.value[d - 1]?.focus() : f.key === "ArrowRight" && d < e.length - 1 && s.value[d + 1]?.focus();
|
|
396
417
|
}
|
|
397
|
-
h(
|
|
418
|
+
h(p, "onKeydown");
|
|
398
419
|
function g(d) {
|
|
399
|
-
if (s.value[d]?.select(), !
|
|
400
|
-
for (let
|
|
401
|
-
r.value[
|
|
420
|
+
if (s.value[d]?.select(), !l.value && r.value[d])
|
|
421
|
+
for (let f = d; f < e.length; f++)
|
|
422
|
+
r.value[f] = "";
|
|
402
423
|
}
|
|
403
|
-
return h(g, "onFocus"), (d,
|
|
404
|
-
(
|
|
405
|
-
key:
|
|
424
|
+
return h(g, "onFocus"), (d, f) => (T(), S("div", $s, [
|
|
425
|
+
(T(!0), S(Te, null, at(a.length, (m) => ns((T(), S("input", {
|
|
426
|
+
key: m,
|
|
406
427
|
ref_for: !0,
|
|
407
|
-
ref: /* @__PURE__ */ h((
|
|
408
|
-
"onUpdate:modelValue": /* @__PURE__ */ h((
|
|
428
|
+
ref: /* @__PURE__ */ h((w) => s.value[m - 1] = w, "ref"),
|
|
429
|
+
"onUpdate:modelValue": /* @__PURE__ */ h((w) => r.value[m - 1] = w, "onUpdate:modelValue"),
|
|
409
430
|
type: "text",
|
|
410
431
|
inputmode: "numeric",
|
|
411
432
|
autocomplete: "one-time-code",
|
|
412
433
|
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
413
434
|
style: { "font-size": "16px" },
|
|
414
435
|
maxlength: "1",
|
|
415
|
-
onInput: /* @__PURE__ */ h((
|
|
416
|
-
onKeydown: /* @__PURE__ */ h((
|
|
417
|
-
onPaste: /* @__PURE__ */ h((
|
|
418
|
-
onFocus: /* @__PURE__ */ h((
|
|
419
|
-
}, null, 40,
|
|
420
|
-
[
|
|
436
|
+
onInput: /* @__PURE__ */ h((w) => c(m - 1, w), "onInput"),
|
|
437
|
+
onKeydown: /* @__PURE__ */ h((w) => p(m - 1, w), "onKeydown"),
|
|
438
|
+
onPaste: /* @__PURE__ */ h((w) => o(m - 1, w), "onPaste"),
|
|
439
|
+
onFocus: /* @__PURE__ */ h((w) => g(m - 1), "onFocus")
|
|
440
|
+
}, null, 40, Bs)), [
|
|
441
|
+
[ss, r.value[m - 1]]
|
|
421
442
|
])), 128))
|
|
422
443
|
]));
|
|
423
444
|
}
|
|
424
|
-
}),
|
|
445
|
+
}), Us = { class: "relative flex-shrink-0" }, Fs = ["src", "alt"], Hs = { class: "absolute top-1 right-1" }, Gs = {
|
|
425
446
|
key: 1,
|
|
426
447
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
427
|
-
},
|
|
448
|
+
}, js = { class: "min-w-0" }, Ws = /* @__PURE__ */ Le({
|
|
428
449
|
__name: "ElModeHeader",
|
|
429
450
|
props: {
|
|
430
451
|
agent: {},
|
|
@@ -432,175 +453,214 @@ const Is = {
|
|
|
432
453
|
isOnline: { type: Boolean, default: !1 },
|
|
433
454
|
layout: { default: "centered" }
|
|
434
455
|
},
|
|
435
|
-
setup(
|
|
436
|
-
return (t, e) => (
|
|
437
|
-
class:
|
|
438
|
-
|
|
456
|
+
setup(a) {
|
|
457
|
+
return (t, e) => (T(), S("div", {
|
|
458
|
+
class: A(["flex gap-4", [
|
|
459
|
+
a.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
439
460
|
]])
|
|
440
461
|
}, [
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
class:
|
|
462
|
+
y("div", Us, [
|
|
463
|
+
y("div", {
|
|
464
|
+
class: A(["rounded-full overflow-hidden border-white", a.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
444
465
|
}, [
|
|
445
|
-
|
|
446
|
-
src:
|
|
447
|
-
alt:
|
|
466
|
+
y("img", {
|
|
467
|
+
src: a.agent.avatarUrl.value,
|
|
468
|
+
alt: a.agent.displayName.value,
|
|
448
469
|
class: "w-full h-full object-cover",
|
|
449
470
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
450
|
-
(...n) =>
|
|
451
|
-
}, null, 40,
|
|
471
|
+
(...n) => Qt(Pn) && Qt(Pn)(...n))
|
|
472
|
+
}, null, 40, Fs)
|
|
452
473
|
], 2),
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
e[1] || (e[1] =
|
|
474
|
+
y("div", Hs, [
|
|
475
|
+
a.isOnline ? (T(), S(Te, { key: 0 }, [
|
|
476
|
+
e[1] || (e[1] = y("div", {
|
|
456
477
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
457
478
|
style: { "animation-duration": "3s" }
|
|
458
479
|
}, null, -1)),
|
|
459
|
-
e[2] || (e[2] =
|
|
460
|
-
], 64)) : (
|
|
480
|
+
e[2] || (e[2] = y("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
481
|
+
], 64)) : (T(), S("div", Gs))
|
|
461
482
|
])
|
|
462
483
|
]),
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
class:
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
y("div", js, [
|
|
485
|
+
y("h1", {
|
|
486
|
+
class: A(["font-light text-white mb-1 truncate", [
|
|
487
|
+
a.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
488
|
+
a.layout === "horizontal" ? "text-white/95" : ""
|
|
468
489
|
]])
|
|
469
|
-
},
|
|
470
|
-
|
|
471
|
-
class:
|
|
472
|
-
|
|
473
|
-
|
|
490
|
+
}, ie(a.agent.displayName.value), 3),
|
|
491
|
+
y("p", {
|
|
492
|
+
class: A(["font-light line-clamp-1", [
|
|
493
|
+
a.size === "lg" ? "text-base text-white/60" : "text-sm sm:text-base",
|
|
494
|
+
a.layout === "horizontal" ? "text-white/70 truncate" : "text-white/60"
|
|
474
495
|
]])
|
|
475
|
-
},
|
|
496
|
+
}, ie(a.layout === "horizontal" ? a.agent.title.value || "Digital Agent" : a.agent.title.value), 3)
|
|
476
497
|
])
|
|
477
498
|
], 2));
|
|
478
499
|
}
|
|
479
500
|
});
|
|
480
501
|
const {
|
|
481
|
-
entries:
|
|
482
|
-
setPrototypeOf:
|
|
483
|
-
isFrozen:
|
|
484
|
-
getPrototypeOf:
|
|
485
|
-
getOwnPropertyDescriptor:
|
|
502
|
+
entries: is,
|
|
503
|
+
setPrototypeOf: Nn,
|
|
504
|
+
isFrozen: qs,
|
|
505
|
+
getPrototypeOf: Vs,
|
|
506
|
+
getOwnPropertyDescriptor: Ys
|
|
486
507
|
} = Object;
|
|
487
508
|
let {
|
|
488
|
-
freeze:
|
|
489
|
-
seal:
|
|
490
|
-
create:
|
|
509
|
+
freeze: ne,
|
|
510
|
+
seal: ue,
|
|
511
|
+
create: Ue
|
|
491
512
|
} = Object, {
|
|
492
|
-
apply:
|
|
493
|
-
construct:
|
|
513
|
+
apply: Jt,
|
|
514
|
+
construct: en
|
|
494
515
|
} = typeof Reflect < "u" && Reflect;
|
|
495
|
-
|
|
516
|
+
ne || (ne = /* @__PURE__ */ h(function(t) {
|
|
496
517
|
return t;
|
|
497
518
|
}, "freeze"));
|
|
498
|
-
|
|
519
|
+
ue || (ue = /* @__PURE__ */ h(function(t) {
|
|
499
520
|
return t;
|
|
500
521
|
}, "seal"));
|
|
501
|
-
|
|
522
|
+
Jt || (Jt = /* @__PURE__ */ h(function(t, e) {
|
|
502
523
|
for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), r = 2; r < n; r++)
|
|
503
524
|
s[r - 2] = arguments[r];
|
|
504
525
|
return t.apply(e, s);
|
|
505
526
|
}, "apply"));
|
|
506
|
-
|
|
527
|
+
en || (en = /* @__PURE__ */ h(function(t) {
|
|
507
528
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
|
|
508
529
|
n[s - 1] = arguments[s];
|
|
509
530
|
return new t(...n);
|
|
510
531
|
}, "construct"));
|
|
511
|
-
const
|
|
512
|
-
function
|
|
532
|
+
const et = j(Array.prototype.forEach), Zs = j(Array.prototype.lastIndexOf), $n = j(Array.prototype.pop), tt = j(Array.prototype.push), Xs = j(Array.prototype.splice), J = Array.isArray, lt = j(String.prototype.toLowerCase), Vt = j(String.prototype.toString), Bn = j(String.prototype.match), Be = j(String.prototype.replace), Un = j(String.prototype.indexOf), Ks = j(String.prototype.trim), Qs = j(Number.prototype.toString), Js = j(Boolean.prototype.toString), Fn = typeof BigInt > "u" ? null : j(BigInt.prototype.toString), Hn = typeof Symbol > "u" ? null : j(Symbol.prototype.toString), $ = j(Object.prototype.hasOwnProperty), nt = j(Object.prototype.toString), K = j(RegExp.prototype.test), wt = er(TypeError);
|
|
533
|
+
function j(a) {
|
|
513
534
|
return function(t) {
|
|
514
535
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
515
536
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
|
|
516
537
|
n[s - 1] = arguments[s];
|
|
517
|
-
return
|
|
538
|
+
return Jt(a, t, n);
|
|
518
539
|
};
|
|
519
540
|
}
|
|
520
|
-
h(
|
|
521
|
-
function
|
|
541
|
+
h(j, "unapply");
|
|
542
|
+
function er(a) {
|
|
522
543
|
return function() {
|
|
523
544
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
524
545
|
e[n] = arguments[n];
|
|
525
|
-
return
|
|
546
|
+
return en(a, e);
|
|
526
547
|
};
|
|
527
548
|
}
|
|
528
|
-
h(
|
|
529
|
-
function R(
|
|
530
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
531
|
-
|
|
549
|
+
h(er, "unconstruct");
|
|
550
|
+
function R(a, t) {
|
|
551
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : lt;
|
|
552
|
+
if (Nn && Nn(a, null), !J(t))
|
|
553
|
+
return a;
|
|
532
554
|
let n = t.length;
|
|
533
555
|
for (; n--; ) {
|
|
534
556
|
let s = t[n];
|
|
535
557
|
if (typeof s == "string") {
|
|
536
558
|
const r = e(s);
|
|
537
|
-
r !== s && (
|
|
559
|
+
r !== s && (qs(t) || (t[n] = r), s = r);
|
|
538
560
|
}
|
|
539
|
-
|
|
561
|
+
a[s] = !0;
|
|
540
562
|
}
|
|
541
|
-
return
|
|
563
|
+
return a;
|
|
542
564
|
}
|
|
543
565
|
h(R, "addToSet");
|
|
544
|
-
function
|
|
545
|
-
for (let t = 0; t <
|
|
546
|
-
|
|
547
|
-
return
|
|
566
|
+
function tr(a) {
|
|
567
|
+
for (let t = 0; t < a.length; t++)
|
|
568
|
+
$(a, t) || (a[t] = null);
|
|
569
|
+
return a;
|
|
548
570
|
}
|
|
549
|
-
h(
|
|
550
|
-
function
|
|
551
|
-
const t =
|
|
552
|
-
for (const [e, n] of
|
|
553
|
-
|
|
571
|
+
h(tr, "cleanArray");
|
|
572
|
+
function re(a) {
|
|
573
|
+
const t = Ue(null);
|
|
574
|
+
for (const [e, n] of is(a))
|
|
575
|
+
$(a, e) && (J(n) ? t[e] = tr(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = re(n) : t[e] = n);
|
|
554
576
|
return t;
|
|
555
577
|
}
|
|
556
|
-
h(
|
|
557
|
-
function
|
|
558
|
-
|
|
559
|
-
|
|
578
|
+
h(re, "clone");
|
|
579
|
+
function nr(a) {
|
|
580
|
+
switch (typeof a) {
|
|
581
|
+
case "string":
|
|
582
|
+
return a;
|
|
583
|
+
case "number":
|
|
584
|
+
return Qs(a);
|
|
585
|
+
case "boolean":
|
|
586
|
+
return Js(a);
|
|
587
|
+
case "bigint":
|
|
588
|
+
return Fn ? Fn(a) : "0";
|
|
589
|
+
case "symbol":
|
|
590
|
+
return Hn ? Hn(a) : "Symbol()";
|
|
591
|
+
case "undefined":
|
|
592
|
+
return nt(a);
|
|
593
|
+
case "function":
|
|
594
|
+
case "object": {
|
|
595
|
+
if (a === null)
|
|
596
|
+
return nt(a);
|
|
597
|
+
const t = a, e = Fe(t, "toString");
|
|
598
|
+
if (typeof e == "function") {
|
|
599
|
+
const n = e(t);
|
|
600
|
+
return typeof n == "string" ? n : nt(n);
|
|
601
|
+
}
|
|
602
|
+
return nt(a);
|
|
603
|
+
}
|
|
604
|
+
default:
|
|
605
|
+
return nt(a);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
h(nr, "stringifyValue");
|
|
609
|
+
function Fe(a, t) {
|
|
610
|
+
for (; a !== null; ) {
|
|
611
|
+
const n = Ys(a, t);
|
|
560
612
|
if (n) {
|
|
561
613
|
if (n.get)
|
|
562
|
-
return
|
|
614
|
+
return j(n.get);
|
|
563
615
|
if (typeof n.value == "function")
|
|
564
|
-
return
|
|
616
|
+
return j(n.value);
|
|
565
617
|
}
|
|
566
|
-
|
|
618
|
+
a = Vs(a);
|
|
567
619
|
}
|
|
568
620
|
function e() {
|
|
569
621
|
return null;
|
|
570
622
|
}
|
|
571
623
|
return h(e, "fallbackValue"), e;
|
|
572
624
|
}
|
|
573
|
-
h(
|
|
574
|
-
|
|
625
|
+
h(Fe, "lookupGetter");
|
|
626
|
+
function sr(a) {
|
|
627
|
+
try {
|
|
628
|
+
return K(a, ""), !0;
|
|
629
|
+
} catch {
|
|
630
|
+
return !1;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
h(sr, "isRegex");
|
|
634
|
+
const Gn = ne(["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"]), Yt = ne(["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"]), Zt = ne(["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"]), rr = ne(["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"]), Xt = ne(["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"]), ir = ne(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), jn = ne(["#text"]), Wn = ne(["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"]), Kt = ne(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "mask-type", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qn = ne(["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"]), yt = ne(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), ar = ue(/\{\{[\w\W]*|[\w\W]*\}\}/gm), lr = ue(/<%[\w\W]*|[\w\W]*%>/gm), or = ue(/\$\{[\w\W]*/gm), cr = ue(/^data-[\-\w.\u00B7-\uFFFF]+$/), ur = ue(/^aria-[\-\w]+$/), as = ue(
|
|
575
635
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
576
636
|
// eslint-disable-line no-useless-escape
|
|
577
|
-
),
|
|
637
|
+
), hr = ue(/^(?:\w+script|data):/i), pr = ue(
|
|
578
638
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
579
639
|
// eslint-disable-line no-control-regex
|
|
580
|
-
),
|
|
581
|
-
var
|
|
640
|
+
), ls = ue(/^html$/i), dr = ue(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
641
|
+
var Vn = /* @__PURE__ */ Object.freeze({
|
|
582
642
|
__proto__: null,
|
|
583
|
-
ARIA_ATTR:
|
|
584
|
-
ATTR_WHITESPACE:
|
|
585
|
-
CUSTOM_ELEMENT:
|
|
586
|
-
DATA_ATTR:
|
|
587
|
-
DOCTYPE_NAME:
|
|
588
|
-
ERB_EXPR:
|
|
589
|
-
IS_ALLOWED_URI:
|
|
590
|
-
IS_SCRIPT_OR_DATA:
|
|
591
|
-
MUSTACHE_EXPR:
|
|
592
|
-
TMPLIT_EXPR:
|
|
643
|
+
ARIA_ATTR: ur,
|
|
644
|
+
ATTR_WHITESPACE: pr,
|
|
645
|
+
CUSTOM_ELEMENT: dr,
|
|
646
|
+
DATA_ATTR: cr,
|
|
647
|
+
DOCTYPE_NAME: ls,
|
|
648
|
+
ERB_EXPR: lr,
|
|
649
|
+
IS_ALLOWED_URI: as,
|
|
650
|
+
IS_SCRIPT_OR_DATA: hr,
|
|
651
|
+
MUSTACHE_EXPR: ar,
|
|
652
|
+
TMPLIT_EXPR: or
|
|
593
653
|
});
|
|
594
|
-
const
|
|
654
|
+
const st = {
|
|
595
655
|
element: 1,
|
|
596
656
|
text: 3,
|
|
597
657
|
// Deprecated
|
|
598
658
|
progressingInstruction: 7,
|
|
599
659
|
comment: 8,
|
|
600
660
|
document: 9
|
|
601
|
-
},
|
|
661
|
+
}, fr = /* @__PURE__ */ h(function() {
|
|
602
662
|
return typeof window > "u" ? null : window;
|
|
603
|
-
}, "getGlobal"),
|
|
663
|
+
}, "getGlobal"), gr = /* @__PURE__ */ h(function(t, e) {
|
|
604
664
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
605
665
|
return null;
|
|
606
666
|
let n = null;
|
|
@@ -609,17 +669,17 @@ const Je = {
|
|
|
609
669
|
const r = "dompurify" + (n ? "#" + n : "");
|
|
610
670
|
try {
|
|
611
671
|
return t.createPolicy(r, {
|
|
612
|
-
createHTML(
|
|
613
|
-
return
|
|
672
|
+
createHTML(l) {
|
|
673
|
+
return l;
|
|
614
674
|
},
|
|
615
|
-
createScriptURL(
|
|
616
|
-
return
|
|
675
|
+
createScriptURL(l) {
|
|
676
|
+
return l;
|
|
617
677
|
}
|
|
618
678
|
});
|
|
619
679
|
} catch {
|
|
620
680
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
621
681
|
}
|
|
622
|
-
}, "_createTrustedTypesPolicy"),
|
|
682
|
+
}, "_createTrustedTypesPolicy"), Yn = /* @__PURE__ */ h(function() {
|
|
623
683
|
return {
|
|
624
684
|
afterSanitizeAttributes: [],
|
|
625
685
|
afterSanitizeElements: [],
|
|
@@ -632,57 +692,57 @@ const Je = {
|
|
|
632
692
|
uponSanitizeShadowNode: []
|
|
633
693
|
};
|
|
634
694
|
}, "_createHooksMap");
|
|
635
|
-
function
|
|
636
|
-
let
|
|
637
|
-
const t = /* @__PURE__ */ h((
|
|
638
|
-
if (t.version = "3.4.
|
|
695
|
+
function os() {
|
|
696
|
+
let a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : fr();
|
|
697
|
+
const t = /* @__PURE__ */ h((v) => os(v), "DOMPurify");
|
|
698
|
+
if (t.version = "3.4.1", t.removed = [], !a || !a.document || a.document.nodeType !== st.document || !a.Element)
|
|
639
699
|
return t.isSupported = !1, t;
|
|
640
700
|
let {
|
|
641
701
|
document: e
|
|
642
|
-
} =
|
|
702
|
+
} = a;
|
|
643
703
|
const n = e, s = n.currentScript, {
|
|
644
704
|
DocumentFragment: r,
|
|
645
|
-
HTMLTemplateElement:
|
|
705
|
+
HTMLTemplateElement: l,
|
|
646
706
|
Node: o,
|
|
647
707
|
Element: c,
|
|
648
|
-
NodeFilter:
|
|
649
|
-
NamedNodeMap: g =
|
|
708
|
+
NodeFilter: p,
|
|
709
|
+
NamedNodeMap: g = a.NamedNodeMap || a.MozNamedAttrMap,
|
|
650
710
|
HTMLFormElement: d,
|
|
651
|
-
DOMParser:
|
|
652
|
-
trustedTypes:
|
|
653
|
-
} =
|
|
654
|
-
if (typeof
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
}
|
|
658
|
-
let
|
|
711
|
+
DOMParser: f,
|
|
712
|
+
trustedTypes: m
|
|
713
|
+
} = a, w = c.prototype, E = Fe(w, "cloneNode"), O = Fe(w, "remove"), U = Fe(w, "nextSibling"), ae = Fe(w, "childNodes"), le = Fe(w, "parentNode");
|
|
714
|
+
if (typeof l == "function") {
|
|
715
|
+
const v = e.createElement("template");
|
|
716
|
+
v.content && v.content.ownerDocument && (e = v.content.ownerDocument);
|
|
717
|
+
}
|
|
718
|
+
let z, oe = "";
|
|
659
719
|
const {
|
|
660
|
-
implementation:
|
|
661
|
-
createNodeIterator:
|
|
662
|
-
createDocumentFragment:
|
|
663
|
-
getElementsByTagName:
|
|
720
|
+
implementation: me,
|
|
721
|
+
createNodeIterator: V,
|
|
722
|
+
createDocumentFragment: ht,
|
|
723
|
+
getElementsByTagName: _e
|
|
664
724
|
} = e, {
|
|
665
|
-
importNode:
|
|
725
|
+
importNode: It
|
|
666
726
|
} = n;
|
|
667
|
-
let
|
|
668
|
-
t.isSupported = typeof
|
|
727
|
+
let Y = Yn();
|
|
728
|
+
t.isSupported = typeof is == "function" && typeof le == "function" && me && me.createHTMLDocument !== void 0;
|
|
669
729
|
const {
|
|
670
|
-
MUSTACHE_EXPR:
|
|
671
|
-
ERB_EXPR:
|
|
672
|
-
TMPLIT_EXPR:
|
|
673
|
-
DATA_ATTR:
|
|
674
|
-
ARIA_ATTR:
|
|
675
|
-
IS_SCRIPT_OR_DATA:
|
|
676
|
-
ATTR_WHITESPACE:
|
|
677
|
-
CUSTOM_ELEMENT:
|
|
678
|
-
} =
|
|
730
|
+
MUSTACHE_EXPR: I,
|
|
731
|
+
ERB_EXPR: Re,
|
|
732
|
+
TMPLIT_EXPR: ve,
|
|
733
|
+
DATA_ATTR: Dt,
|
|
734
|
+
ARIA_ATTR: Ve,
|
|
735
|
+
IS_SCRIPT_OR_DATA: Ct,
|
|
736
|
+
ATTR_WHITESPACE: pt,
|
|
737
|
+
CUSTOM_ELEMENT: dt
|
|
738
|
+
} = Vn;
|
|
679
739
|
let {
|
|
680
|
-
IS_ALLOWED_URI:
|
|
681
|
-
} =
|
|
682
|
-
const
|
|
683
|
-
let
|
|
684
|
-
const
|
|
685
|
-
let
|
|
740
|
+
IS_ALLOWED_URI: ft
|
|
741
|
+
} = Vn, F = null;
|
|
742
|
+
const gt = R({}, [...Gn, ...Yt, ...Zt, ...Xt, ...jn]);
|
|
743
|
+
let W = null;
|
|
744
|
+
const Ye = R({}, [...Wn, ...Kt, ...qn, ...yt]);
|
|
745
|
+
let P = Object.seal(Ue(null, {
|
|
686
746
|
tagNameCheck: {
|
|
687
747
|
writable: !0,
|
|
688
748
|
configurable: !1,
|
|
@@ -701,8 +761,8 @@ function ns() {
|
|
|
701
761
|
enumerable: !0,
|
|
702
762
|
value: !1
|
|
703
763
|
}
|
|
704
|
-
})),
|
|
705
|
-
const
|
|
764
|
+
})), _ = null, x = null;
|
|
765
|
+
const b = Object.seal(Ue(null, {
|
|
706
766
|
tagCheck: {
|
|
707
767
|
writable: !0,
|
|
708
768
|
configurable: !1,
|
|
@@ -716,70 +776,72 @@ function ns() {
|
|
|
716
776
|
value: null
|
|
717
777
|
}
|
|
718
778
|
}));
|
|
719
|
-
let
|
|
720
|
-
const
|
|
721
|
-
let
|
|
722
|
-
const
|
|
723
|
-
let
|
|
724
|
-
const
|
|
725
|
-
let
|
|
726
|
-
const
|
|
727
|
-
let
|
|
728
|
-
const
|
|
729
|
-
let
|
|
730
|
-
const
|
|
731
|
-
let
|
|
732
|
-
const
|
|
733
|
-
let
|
|
734
|
-
const
|
|
779
|
+
let L = !0, Z = !0, we = !1, Ze = !0, he = !1, Xe = !0, Ie = !1, Mt = !1, Lt = !1, ze = !1, mt = !1, bt = !1, fn = !0, gn = !1;
|
|
780
|
+
const mn = "user-content-";
|
|
781
|
+
let Ot = !0, Ke = !1, Pe = {}, be = null;
|
|
782
|
+
const zt = 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"]);
|
|
783
|
+
let bn = null;
|
|
784
|
+
const xn = R({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
785
|
+
let Pt = null;
|
|
786
|
+
const kn = R({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), xt = "http://www.w3.org/1998/Math/MathML", kt = "http://www.w3.org/2000/svg", xe = "http://www.w3.org/1999/xhtml";
|
|
787
|
+
let Ne = xe, Nt = !1, $t = null;
|
|
788
|
+
const ks = R({}, [xt, kt, xe], Vt);
|
|
789
|
+
let Bt = R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = R({}, ["annotation-xml"]);
|
|
790
|
+
const ws = R({}, ["title", "style", "font", "a", "script"]);
|
|
791
|
+
let Qe = null;
|
|
792
|
+
const ys = ["application/xhtml+xml", "text/html"], vs = "text/html";
|
|
793
|
+
let q = null, $e = null;
|
|
794
|
+
const Ts = e.createElement("form"), wn = /* @__PURE__ */ h(function(i) {
|
|
735
795
|
return i instanceof RegExp || i instanceof Function;
|
|
736
|
-
}, "isRegexOrFunction"),
|
|
796
|
+
}, "isRegexOrFunction"), Ft = /* @__PURE__ */ h(function() {
|
|
737
797
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
738
|
-
if (
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}
|
|
750
|
-
|
|
751
|
-
|
|
798
|
+
if ($e && $e === i)
|
|
799
|
+
return;
|
|
800
|
+
(!i || typeof i != "object") && (i = {}), i = re(i), Qe = // eslint-disable-next-line unicorn/prefer-includes
|
|
801
|
+
ys.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? vs : i.PARSER_MEDIA_TYPE, q = Qe === "application/xhtml+xml" ? Vt : lt, F = $(i, "ALLOWED_TAGS") && J(i.ALLOWED_TAGS) ? R({}, i.ALLOWED_TAGS, q) : gt, W = $(i, "ALLOWED_ATTR") && J(i.ALLOWED_ATTR) ? R({}, i.ALLOWED_ATTR, q) : Ye, $t = $(i, "ALLOWED_NAMESPACES") && J(i.ALLOWED_NAMESPACES) ? R({}, i.ALLOWED_NAMESPACES, Vt) : ks, Pt = $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) ? R(re(kn), i.ADD_URI_SAFE_ATTR, q) : kn, bn = $(i, "ADD_DATA_URI_TAGS") && J(i.ADD_DATA_URI_TAGS) ? R(re(xn), i.ADD_DATA_URI_TAGS, q) : xn, be = $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) ? R({}, i.FORBID_CONTENTS, q) : zt, _ = $(i, "FORBID_TAGS") && J(i.FORBID_TAGS) ? R({}, i.FORBID_TAGS, q) : re({}), x = $(i, "FORBID_ATTR") && J(i.FORBID_ATTR) ? R({}, i.FORBID_ATTR, q) : re({}), Pe = $(i, "USE_PROFILES") ? i.USE_PROFILES && typeof i.USE_PROFILES == "object" ? re(i.USE_PROFILES) : i.USE_PROFILES : !1, L = i.ALLOW_ARIA_ATTR !== !1, Z = i.ALLOW_DATA_ATTR !== !1, we = i.ALLOW_UNKNOWN_PROTOCOLS || !1, Ze = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, he = i.SAFE_FOR_TEMPLATES || !1, Xe = i.SAFE_FOR_XML !== !1, Ie = i.WHOLE_DOCUMENT || !1, ze = i.RETURN_DOM || !1, mt = i.RETURN_DOM_FRAGMENT || !1, bt = i.RETURN_TRUSTED_TYPE || !1, Lt = i.FORCE_BODY || !1, fn = i.SANITIZE_DOM !== !1, gn = i.SANITIZE_NAMED_PROPS || !1, Ot = i.KEEP_CONTENT !== !1, Ke = i.IN_PLACE || !1, ft = sr(i.ALLOWED_URI_REGEXP) ? i.ALLOWED_URI_REGEXP : as, Ne = typeof i.NAMESPACE == "string" ? i.NAMESPACE : xe, Bt = $(i, "MATHML_TEXT_INTEGRATION_POINTS") && i.MATHML_TEXT_INTEGRATION_POINTS && typeof i.MATHML_TEXT_INTEGRATION_POINTS == "object" ? re(i.MATHML_TEXT_INTEGRATION_POINTS) : R({}, ["mi", "mo", "mn", "ms", "mtext"]), Ut = $(i, "HTML_INTEGRATION_POINTS") && i.HTML_INTEGRATION_POINTS && typeof i.HTML_INTEGRATION_POINTS == "object" ? re(i.HTML_INTEGRATION_POINTS) : R({}, ["annotation-xml"]);
|
|
802
|
+
const u = $(i, "CUSTOM_ELEMENT_HANDLING") && i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING == "object" ? re(i.CUSTOM_ELEMENT_HANDLING) : Ue(null);
|
|
803
|
+
if (P = Ue(null), $(u, "tagNameCheck") && wn(u.tagNameCheck) && (P.tagNameCheck = u.tagNameCheck), $(u, "attributeNameCheck") && wn(u.attributeNameCheck) && (P.attributeNameCheck = u.attributeNameCheck), $(u, "allowCustomizedBuiltInElements") && typeof u.allowCustomizedBuiltInElements == "boolean" && (P.allowCustomizedBuiltInElements = u.allowCustomizedBuiltInElements), he && (Z = !1), mt && (ze = !0), Pe && (F = R({}, jn), W = Ue(null), Pe.html === !0 && (R(F, Gn), R(W, Wn)), Pe.svg === !0 && (R(F, Yt), R(W, Kt), R(W, yt)), Pe.svgFilters === !0 && (R(F, Zt), R(W, Kt), R(W, yt)), Pe.mathMl === !0 && (R(F, Xt), R(W, qn), R(W, yt))), b.tagCheck = null, b.attributeCheck = null, $(i, "ADD_TAGS") && (typeof i.ADD_TAGS == "function" ? b.tagCheck = i.ADD_TAGS : J(i.ADD_TAGS) && (F === gt && (F = re(F)), R(F, i.ADD_TAGS, q))), $(i, "ADD_ATTR") && (typeof i.ADD_ATTR == "function" ? b.attributeCheck = i.ADD_ATTR : J(i.ADD_ATTR) && (W === Ye && (W = re(W)), R(W, i.ADD_ATTR, q))), $(i, "ADD_URI_SAFE_ATTR") && J(i.ADD_URI_SAFE_ATTR) && R(Pt, i.ADD_URI_SAFE_ATTR, q), $(i, "FORBID_CONTENTS") && J(i.FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.FORBID_CONTENTS, q)), $(i, "ADD_FORBID_CONTENTS") && J(i.ADD_FORBID_CONTENTS) && (be === zt && (be = re(be)), R(be, i.ADD_FORBID_CONTENTS, q)), Ot && (F["#text"] = !0), Ie && R(F, ["html", "head", "body"]), F.table && (R(F, ["tbody"]), delete _.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
804
|
+
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
805
|
+
throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
806
|
+
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
807
|
+
throw wt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
808
|
+
z = i.TRUSTED_TYPES_POLICY, oe = z.createHTML("");
|
|
809
|
+
} else
|
|
810
|
+
z === void 0 && (z = gr(m, s)), z !== null && typeof oe == "string" && (oe = z.createHTML(""));
|
|
811
|
+
ne && ne(i), $e = i;
|
|
812
|
+
}, "_parseConfig"), yn = R({}, [...Yt, ...Zt, ...rr]), vn = R({}, [...Xt, ...ir]), Ss = /* @__PURE__ */ h(function(i) {
|
|
813
|
+
let u = le(i);
|
|
752
814
|
(!u || !u.tagName) && (u = {
|
|
753
|
-
namespaceURI:
|
|
815
|
+
namespaceURI: Ne,
|
|
754
816
|
tagName: "template"
|
|
755
817
|
});
|
|
756
|
-
const
|
|
757
|
-
return
|
|
758
|
-
}, "_checkValidNamespace"),
|
|
759
|
-
|
|
818
|
+
const k = lt(i.tagName), N = lt(u.tagName);
|
|
819
|
+
return $t[i.namespaceURI] ? i.namespaceURI === kt ? u.namespaceURI === xe ? k === "svg" : u.namespaceURI === xt ? k === "svg" && (N === "annotation-xml" || Bt[N]) : !!yn[k] : i.namespaceURI === xt ? u.namespaceURI === xe ? k === "math" : u.namespaceURI === kt ? k === "math" && Ut[N] : !!vn[k] : i.namespaceURI === xe ? u.namespaceURI === kt && !Ut[N] || u.namespaceURI === xt && !Bt[N] ? !1 : !vn[k] && (ws[k] || !yn[k]) : !!(Qe === "application/xhtml+xml" && $t[i.namespaceURI]) : !1;
|
|
820
|
+
}, "_checkValidNamespace"), pe = /* @__PURE__ */ h(function(i) {
|
|
821
|
+
tt(t.removed, {
|
|
760
822
|
element: i
|
|
761
823
|
});
|
|
762
824
|
try {
|
|
763
|
-
|
|
825
|
+
le(i).removeChild(i);
|
|
764
826
|
} catch {
|
|
765
|
-
|
|
827
|
+
O(i);
|
|
766
828
|
}
|
|
767
|
-
}, "_forceRemove"),
|
|
829
|
+
}, "_forceRemove"), De = /* @__PURE__ */ h(function(i, u) {
|
|
768
830
|
try {
|
|
769
|
-
|
|
831
|
+
tt(t.removed, {
|
|
770
832
|
attribute: u.getAttributeNode(i),
|
|
771
833
|
from: u
|
|
772
834
|
});
|
|
773
835
|
} catch {
|
|
774
|
-
|
|
836
|
+
tt(t.removed, {
|
|
775
837
|
attribute: null,
|
|
776
838
|
from: u
|
|
777
839
|
});
|
|
778
840
|
}
|
|
779
841
|
if (u.removeAttribute(i), i === "is")
|
|
780
|
-
if (
|
|
842
|
+
if (ze || mt)
|
|
781
843
|
try {
|
|
782
|
-
|
|
844
|
+
pe(u);
|
|
783
845
|
} catch {
|
|
784
846
|
}
|
|
785
847
|
else
|
|
@@ -787,99 +849,99 @@ function ns() {
|
|
|
787
849
|
u.setAttribute(i, "");
|
|
788
850
|
} catch {
|
|
789
851
|
}
|
|
790
|
-
}, "_removeAttribute"),
|
|
791
|
-
let u = null,
|
|
792
|
-
if (
|
|
852
|
+
}, "_removeAttribute"), Tn = /* @__PURE__ */ h(function(i) {
|
|
853
|
+
let u = null, k = null;
|
|
854
|
+
if (Lt)
|
|
793
855
|
i = "<remove></remove>" + i;
|
|
794
856
|
else {
|
|
795
|
-
const
|
|
796
|
-
|
|
857
|
+
const H = Bn(i, /^[\r\n\t ]+/);
|
|
858
|
+
k = H && H[0];
|
|
797
859
|
}
|
|
798
|
-
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
860
|
+
Qe === "application/xhtml+xml" && Ne === xe && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
|
|
861
|
+
const N = z ? z.createHTML(i) : i;
|
|
862
|
+
if (Ne === xe)
|
|
801
863
|
try {
|
|
802
|
-
u = new
|
|
864
|
+
u = new f().parseFromString(N, Qe);
|
|
803
865
|
} catch {
|
|
804
866
|
}
|
|
805
867
|
if (!u || !u.documentElement) {
|
|
806
|
-
u =
|
|
868
|
+
u = me.createDocument(Ne, "template", null);
|
|
807
869
|
try {
|
|
808
|
-
u.documentElement.innerHTML =
|
|
870
|
+
u.documentElement.innerHTML = Nt ? oe : N;
|
|
809
871
|
} catch {
|
|
810
872
|
}
|
|
811
873
|
}
|
|
812
|
-
const
|
|
813
|
-
return i &&
|
|
814
|
-
}, "_initDocument"),
|
|
815
|
-
return
|
|
874
|
+
const Q = u.body || u.documentElement;
|
|
875
|
+
return i && k && Q.insertBefore(e.createTextNode(k), Q.childNodes[0] || null), Ne === xe ? _e.call(u, Ie ? "html" : "body")[0] : Ie ? u.documentElement : Q;
|
|
876
|
+
}, "_initDocument"), Sn = /* @__PURE__ */ h(function(i) {
|
|
877
|
+
return V.call(
|
|
816
878
|
i.ownerDocument || i,
|
|
817
879
|
i,
|
|
818
880
|
// eslint-disable-next-line no-bitwise
|
|
819
|
-
|
|
881
|
+
p.SHOW_ELEMENT | p.SHOW_COMMENT | p.SHOW_TEXT | p.SHOW_PROCESSING_INSTRUCTION | p.SHOW_CDATA_SECTION,
|
|
820
882
|
null
|
|
821
883
|
);
|
|
822
|
-
}, "_createNodeIterator"),
|
|
884
|
+
}, "_createNodeIterator"), Ht = /* @__PURE__ */ h(function(i) {
|
|
823
885
|
return i instanceof d && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof g) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
|
|
824
|
-
}, "_isClobbered"),
|
|
886
|
+
}, "_isClobbered"), Gt = /* @__PURE__ */ h(function(i) {
|
|
825
887
|
return typeof o == "function" && i instanceof o;
|
|
826
888
|
}, "_isNode");
|
|
827
|
-
function
|
|
828
|
-
|
|
829
|
-
|
|
889
|
+
function ye(v, i, u) {
|
|
890
|
+
et(v, (k) => {
|
|
891
|
+
k.call(t, i, u, $e);
|
|
830
892
|
});
|
|
831
893
|
}
|
|
832
|
-
h(
|
|
833
|
-
const
|
|
894
|
+
h(ye, "_executeHooks");
|
|
895
|
+
const An = /* @__PURE__ */ h(function(i) {
|
|
834
896
|
let u = null;
|
|
835
|
-
if (
|
|
836
|
-
return
|
|
837
|
-
const
|
|
838
|
-
if (
|
|
839
|
-
tagName:
|
|
840
|
-
allowedTags:
|
|
841
|
-
}),
|
|
842
|
-
return
|
|
843
|
-
if (
|
|
844
|
-
if (!
|
|
897
|
+
if (ye(Y.beforeSanitizeElements, i, null), Ht(i))
|
|
898
|
+
return pe(i), !0;
|
|
899
|
+
const k = q(i.nodeName);
|
|
900
|
+
if (ye(Y.uponSanitizeElement, i, {
|
|
901
|
+
tagName: k,
|
|
902
|
+
allowedTags: F
|
|
903
|
+
}), Xe && i.hasChildNodes() && !Gt(i.firstElementChild) && K(/<[/\w!]/g, i.innerHTML) && K(/<[/\w!]/g, i.textContent) || Xe && i.namespaceURI === xe && k === "style" && Gt(i.firstElementChild) || i.nodeType === st.progressingInstruction || Xe && i.nodeType === st.comment && K(/<[/\w]/g, i.data))
|
|
904
|
+
return pe(i), !0;
|
|
905
|
+
if (_[k] || !(b.tagCheck instanceof Function && b.tagCheck(k)) && !F[k]) {
|
|
906
|
+
if (!_[k] && _n(k) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, k) || P.tagNameCheck instanceof Function && P.tagNameCheck(k)))
|
|
845
907
|
return !1;
|
|
846
|
-
if (
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
849
|
-
const
|
|
850
|
-
for (let
|
|
851
|
-
const
|
|
852
|
-
|
|
908
|
+
if (Ot && !be[k]) {
|
|
909
|
+
const N = le(i) || i.parentNode, Q = ae(i) || i.childNodes;
|
|
910
|
+
if (Q && N) {
|
|
911
|
+
const H = Q.length;
|
|
912
|
+
for (let se = H - 1; se >= 0; --se) {
|
|
913
|
+
const ce = E(Q[se], !0);
|
|
914
|
+
N.insertBefore(ce, U(i));
|
|
853
915
|
}
|
|
854
916
|
}
|
|
855
917
|
}
|
|
856
|
-
return
|
|
918
|
+
return pe(i), !0;
|
|
857
919
|
}
|
|
858
|
-
return i instanceof c && !
|
|
859
|
-
u =
|
|
860
|
-
}), i.textContent !== u && (
|
|
920
|
+
return i instanceof c && !Ss(i) || (k === "noscript" || k === "noembed" || k === "noframes") && K(/<\/no(script|embed|frames)/i, i.innerHTML) ? (pe(i), !0) : (he && i.nodeType === st.text && (u = i.textContent, et([I, Re, ve], (N) => {
|
|
921
|
+
u = Be(u, N, " ");
|
|
922
|
+
}), i.textContent !== u && (tt(t.removed, {
|
|
861
923
|
element: i.cloneNode()
|
|
862
|
-
}), i.textContent = u)),
|
|
863
|
-
}, "_sanitizeElements"),
|
|
864
|
-
if (
|
|
924
|
+
}), i.textContent = u)), ye(Y.afterSanitizeElements, i, null), !1);
|
|
925
|
+
}, "_sanitizeElements"), En = /* @__PURE__ */ h(function(i, u, k) {
|
|
926
|
+
if (x[u] || fn && (u === "id" || u === "name") && (k in e || k in Ts))
|
|
865
927
|
return !1;
|
|
866
|
-
if (!(
|
|
867
|
-
if (!(
|
|
868
|
-
if (!(
|
|
869
|
-
if (!
|
|
928
|
+
if (!(Z && !x[u] && K(Dt, u))) {
|
|
929
|
+
if (!(L && K(Ve, u))) {
|
|
930
|
+
if (!(b.attributeCheck instanceof Function && b.attributeCheck(u, i))) {
|
|
931
|
+
if (!W[u] || x[u]) {
|
|
870
932
|
if (
|
|
871
933
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
872
934
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
873
935
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
874
|
-
!(
|
|
936
|
+
!(_n(i) && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, i) || P.tagNameCheck instanceof Function && P.tagNameCheck(i)) && (P.attributeNameCheck instanceof RegExp && K(P.attributeNameCheck, u) || P.attributeNameCheck instanceof Function && P.attributeNameCheck(u, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
875
937
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
876
|
-
u === "is" &&
|
|
938
|
+
u === "is" && P.allowCustomizedBuiltInElements && (P.tagNameCheck instanceof RegExp && K(P.tagNameCheck, k) || P.tagNameCheck instanceof Function && P.tagNameCheck(k)))
|
|
877
939
|
) return !1;
|
|
878
|
-
} else if (!
|
|
879
|
-
if (!
|
|
880
|
-
if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" &&
|
|
881
|
-
if (!(
|
|
882
|
-
if (
|
|
940
|
+
} else if (!Pt[u]) {
|
|
941
|
+
if (!K(ft, Be(k, pt, ""))) {
|
|
942
|
+
if (!((u === "src" || u === "xlink:href" || u === "href") && i !== "script" && Un(k, "data:") === 0 && bn[i])) {
|
|
943
|
+
if (!(we && !K(Ct, Be(k, pt, "")))) {
|
|
944
|
+
if (k)
|
|
883
945
|
return !1;
|
|
884
946
|
}
|
|
885
947
|
}
|
|
@@ -889,266 +951,263 @@ function ns() {
|
|
|
889
951
|
}
|
|
890
952
|
}
|
|
891
953
|
return !0;
|
|
892
|
-
}, "_isValidAttribute"),
|
|
893
|
-
return i
|
|
894
|
-
}, "_isBasicCustomElement"),
|
|
895
|
-
|
|
954
|
+
}, "_isValidAttribute"), As = R({}, ["annotation-xml", "color-profile", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "missing-glyph"]), _n = /* @__PURE__ */ h(function(i) {
|
|
955
|
+
return !As[lt(i)] && K(dt, i);
|
|
956
|
+
}, "_isBasicCustomElement"), Rn = /* @__PURE__ */ h(function(i) {
|
|
957
|
+
ye(Y.beforeSanitizeAttributes, i, null);
|
|
896
958
|
const {
|
|
897
959
|
attributes: u
|
|
898
960
|
} = i;
|
|
899
|
-
if (!u ||
|
|
961
|
+
if (!u || Ht(i))
|
|
900
962
|
return;
|
|
901
|
-
const
|
|
963
|
+
const k = {
|
|
902
964
|
attrName: "",
|
|
903
965
|
attrValue: "",
|
|
904
966
|
keepAttr: !0,
|
|
905
|
-
allowedAttributes:
|
|
967
|
+
allowedAttributes: W,
|
|
906
968
|
forceKeepAttr: void 0
|
|
907
969
|
};
|
|
908
|
-
let
|
|
909
|
-
for (;
|
|
910
|
-
const
|
|
911
|
-
name:
|
|
912
|
-
namespaceURI:
|
|
913
|
-
value:
|
|
914
|
-
} =
|
|
915
|
-
let
|
|
916
|
-
if (
|
|
917
|
-
|
|
970
|
+
let N = u.length;
|
|
971
|
+
for (; N--; ) {
|
|
972
|
+
const Q = u[N], {
|
|
973
|
+
name: H,
|
|
974
|
+
namespaceURI: se,
|
|
975
|
+
value: ce
|
|
976
|
+
} = Q, de = q(H), jt = ce;
|
|
977
|
+
let X = H === "value" ? jt : Ks(jt);
|
|
978
|
+
if (k.attrName = de, k.attrValue = X, k.keepAttr = !0, k.forceKeepAttr = void 0, ye(Y.uponSanitizeAttribute, i, k), X = k.attrValue, gn && (de === "id" || de === "name") && Un(X, mn) !== 0 && (De(H, i), X = mn + X), Xe && K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, X)) {
|
|
979
|
+
De(H, i);
|
|
918
980
|
continue;
|
|
919
981
|
}
|
|
920
|
-
if (
|
|
921
|
-
|
|
982
|
+
if (de === "attributename" && Bn(X, "href")) {
|
|
983
|
+
De(H, i);
|
|
922
984
|
continue;
|
|
923
985
|
}
|
|
924
|
-
if (
|
|
986
|
+
if (k.forceKeepAttr)
|
|
925
987
|
continue;
|
|
926
|
-
if (!
|
|
927
|
-
|
|
988
|
+
if (!k.keepAttr) {
|
|
989
|
+
De(H, i);
|
|
928
990
|
continue;
|
|
929
991
|
}
|
|
930
|
-
if (!
|
|
931
|
-
|
|
992
|
+
if (!Ze && K(/\/>/i, X)) {
|
|
993
|
+
De(H, i);
|
|
932
994
|
continue;
|
|
933
995
|
}
|
|
934
|
-
|
|
935
|
-
|
|
996
|
+
he && et([I, Re, ve], (Cn) => {
|
|
997
|
+
X = Be(X, Cn, " ");
|
|
936
998
|
});
|
|
937
|
-
const
|
|
938
|
-
if (!
|
|
939
|
-
|
|
999
|
+
const Dn = q(i.nodeName);
|
|
1000
|
+
if (!En(Dn, de, X)) {
|
|
1001
|
+
De(H, i);
|
|
940
1002
|
continue;
|
|
941
1003
|
}
|
|
942
|
-
if (
|
|
943
|
-
switch (
|
|
1004
|
+
if (z && typeof m == "object" && typeof m.getAttributeType == "function" && !se)
|
|
1005
|
+
switch (m.getAttributeType(Dn, de)) {
|
|
944
1006
|
case "TrustedHTML": {
|
|
945
|
-
|
|
1007
|
+
X = z.createHTML(X);
|
|
946
1008
|
break;
|
|
947
1009
|
}
|
|
948
1010
|
case "TrustedScriptURL": {
|
|
949
|
-
|
|
1011
|
+
X = z.createScriptURL(X);
|
|
950
1012
|
break;
|
|
951
1013
|
}
|
|
952
1014
|
}
|
|
953
|
-
if (
|
|
1015
|
+
if (X !== jt)
|
|
954
1016
|
try {
|
|
955
|
-
|
|
1017
|
+
se ? i.setAttributeNS(se, H, X) : i.setAttribute(H, X), Ht(i) ? pe(i) : $n(t.removed);
|
|
956
1018
|
} catch {
|
|
957
|
-
|
|
1019
|
+
De(H, i);
|
|
958
1020
|
}
|
|
959
1021
|
}
|
|
960
|
-
|
|
961
|
-
}, "_sanitizeAttributes"),
|
|
1022
|
+
ye(Y.afterSanitizeAttributes, i, null);
|
|
1023
|
+
}, "_sanitizeAttributes"), In = /* @__PURE__ */ h(function(i) {
|
|
962
1024
|
let u = null;
|
|
963
|
-
const
|
|
964
|
-
for (
|
|
965
|
-
|
|
966
|
-
|
|
1025
|
+
const k = Sn(i);
|
|
1026
|
+
for (ye(Y.beforeSanitizeShadowDOM, i, null); u = k.nextNode(); )
|
|
1027
|
+
ye(Y.uponSanitizeShadowNode, u, null), An(u), Rn(u), u.content instanceof r && In(u.content);
|
|
1028
|
+
ye(Y.afterSanitizeShadowDOM, i, null);
|
|
967
1029
|
}, "_sanitizeShadowDOM");
|
|
968
|
-
return t.sanitize = function(
|
|
969
|
-
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null,
|
|
970
|
-
if (
|
|
971
|
-
|
|
972
|
-
if (y = y.toString(), typeof y != "string")
|
|
973
|
-
throw Ke("dirty is not a string, aborting");
|
|
974
|
-
} else
|
|
975
|
-
throw Ke("toString is not a function");
|
|
1030
|
+
return t.sanitize = function(v) {
|
|
1031
|
+
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, u = null, k = null, N = null, Q = null;
|
|
1032
|
+
if (Nt = !v, Nt && (v = "<!-->"), typeof v != "string" && !Gt(v) && (v = nr(v), typeof v != "string"))
|
|
1033
|
+
throw wt("dirty is not a string, aborting");
|
|
976
1034
|
if (!t.isSupported)
|
|
977
|
-
return
|
|
978
|
-
if (
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
1035
|
+
return v;
|
|
1036
|
+
if (Mt || Ft(i), t.removed = [], typeof v == "string" && (Ke = !1), Ke) {
|
|
1037
|
+
const ce = v.nodeName;
|
|
1038
|
+
if (typeof ce == "string") {
|
|
1039
|
+
const de = q(ce);
|
|
1040
|
+
if (!F[de] || _[de])
|
|
1041
|
+
throw wt("root node is forbidden and cannot be sanitized in-place");
|
|
1042
|
+
}
|
|
1043
|
+
} else if (v instanceof o)
|
|
1044
|
+
u = Tn("<!---->"), k = u.ownerDocument.importNode(v, !0), k.nodeType === st.element && k.nodeName === "BODY" || k.nodeName === "HTML" ? u = k : u.appendChild(k);
|
|
986
1045
|
else {
|
|
987
|
-
if (!
|
|
988
|
-
|
|
989
|
-
return
|
|
990
|
-
if (u =
|
|
991
|
-
return
|
|
992
|
-
}
|
|
993
|
-
u &&
|
|
994
|
-
const
|
|
995
|
-
for (;
|
|
996
|
-
|
|
997
|
-
if (
|
|
998
|
-
return
|
|
999
|
-
if (
|
|
1000
|
-
if (
|
|
1046
|
+
if (!ze && !he && !Ie && // eslint-disable-next-line unicorn/prefer-includes
|
|
1047
|
+
v.indexOf("<") === -1)
|
|
1048
|
+
return z && bt ? z.createHTML(v) : v;
|
|
1049
|
+
if (u = Tn(v), !u)
|
|
1050
|
+
return ze ? null : bt ? oe : "";
|
|
1051
|
+
}
|
|
1052
|
+
u && Lt && pe(u.firstChild);
|
|
1053
|
+
const H = Sn(Ke ? v : u);
|
|
1054
|
+
for (; N = H.nextNode(); )
|
|
1055
|
+
An(N), Rn(N), N.content instanceof r && In(N.content);
|
|
1056
|
+
if (Ke)
|
|
1057
|
+
return v;
|
|
1058
|
+
if (ze) {
|
|
1059
|
+
if (he) {
|
|
1001
1060
|
u.normalize();
|
|
1002
|
-
let
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}), u.innerHTML =
|
|
1006
|
-
}
|
|
1007
|
-
if (
|
|
1008
|
-
for (
|
|
1009
|
-
|
|
1061
|
+
let ce = u.innerHTML;
|
|
1062
|
+
et([I, Re, ve], (de) => {
|
|
1063
|
+
ce = Be(ce, de, " ");
|
|
1064
|
+
}), u.innerHTML = ce;
|
|
1065
|
+
}
|
|
1066
|
+
if (mt)
|
|
1067
|
+
for (Q = ht.call(u.ownerDocument); u.firstChild; )
|
|
1068
|
+
Q.appendChild(u.firstChild);
|
|
1010
1069
|
else
|
|
1011
|
-
|
|
1012
|
-
return (
|
|
1013
|
-
}
|
|
1014
|
-
let
|
|
1015
|
-
return
|
|
1016
|
-
` +
|
|
1017
|
-
|
|
1018
|
-
}),
|
|
1070
|
+
Q = u;
|
|
1071
|
+
return (W.shadowroot || W.shadowrootmode) && (Q = It.call(n, Q, !0)), Q;
|
|
1072
|
+
}
|
|
1073
|
+
let se = Ie ? u.outerHTML : u.innerHTML;
|
|
1074
|
+
return Ie && F["!doctype"] && u.ownerDocument && u.ownerDocument.doctype && u.ownerDocument.doctype.name && K(ls, u.ownerDocument.doctype.name) && (se = "<!DOCTYPE " + u.ownerDocument.doctype.name + `>
|
|
1075
|
+
` + se), he && et([I, Re, ve], (ce) => {
|
|
1076
|
+
se = Be(se, ce, " ");
|
|
1077
|
+
}), z && bt ? z.createHTML(se) : se;
|
|
1019
1078
|
}, t.setConfig = function() {
|
|
1020
|
-
let
|
|
1021
|
-
|
|
1079
|
+
let v = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
1080
|
+
Ft(v), Mt = !0;
|
|
1022
1081
|
}, t.clearConfig = function() {
|
|
1023
|
-
|
|
1024
|
-
}, t.isValidAttribute = function(
|
|
1025
|
-
|
|
1026
|
-
const
|
|
1027
|
-
return
|
|
1028
|
-
}, t.addHook = function(
|
|
1029
|
-
typeof i == "function" &&
|
|
1030
|
-
}, t.removeHook = function(
|
|
1082
|
+
$e = null, Mt = !1;
|
|
1083
|
+
}, t.isValidAttribute = function(v, i, u) {
|
|
1084
|
+
$e || Ft({});
|
|
1085
|
+
const k = q(v), N = q(i);
|
|
1086
|
+
return En(k, N, u);
|
|
1087
|
+
}, t.addHook = function(v, i) {
|
|
1088
|
+
typeof i == "function" && tt(Y[v], i);
|
|
1089
|
+
}, t.removeHook = function(v, i) {
|
|
1031
1090
|
if (i !== void 0) {
|
|
1032
|
-
const u =
|
|
1033
|
-
return u === -1 ? void 0 :
|
|
1091
|
+
const u = Zs(Y[v], i);
|
|
1092
|
+
return u === -1 ? void 0 : Xs(Y[v], u, 1)[0];
|
|
1034
1093
|
}
|
|
1035
|
-
return
|
|
1036
|
-
}, t.removeHooks = function(
|
|
1037
|
-
|
|
1094
|
+
return $n(Y[v]);
|
|
1095
|
+
}, t.removeHooks = function(v) {
|
|
1096
|
+
Y[v] = [];
|
|
1038
1097
|
}, t.removeAllHooks = function() {
|
|
1039
|
-
|
|
1098
|
+
Y = Yn();
|
|
1040
1099
|
}, t;
|
|
1041
1100
|
}
|
|
1042
|
-
h(
|
|
1043
|
-
var
|
|
1044
|
-
function
|
|
1101
|
+
h(os, "createDOMPurify");
|
|
1102
|
+
var mr = os();
|
|
1103
|
+
function sn() {
|
|
1045
1104
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
1046
1105
|
}
|
|
1047
|
-
h(
|
|
1048
|
-
var
|
|
1049
|
-
function
|
|
1050
|
-
|
|
1106
|
+
h(sn, "M");
|
|
1107
|
+
var Oe = sn();
|
|
1108
|
+
function cs(a) {
|
|
1109
|
+
Oe = a;
|
|
1051
1110
|
}
|
|
1052
|
-
h(
|
|
1053
|
-
var
|
|
1054
|
-
function
|
|
1055
|
-
let e = typeof
|
|
1056
|
-
let
|
|
1057
|
-
return
|
|
1111
|
+
h(cs, "G");
|
|
1112
|
+
var Ce = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1113
|
+
function C(a, t = "") {
|
|
1114
|
+
let e = typeof a == "string" ? a : a.source, n = { replace: /* @__PURE__ */ h((s, r) => {
|
|
1115
|
+
let l = typeof r == "string" ? r : r.source;
|
|
1116
|
+
return l = l.replace(te.caret, "$1"), e = e.replace(s, l), n;
|
|
1058
1117
|
}, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
|
|
1059
1118
|
return n;
|
|
1060
1119
|
}
|
|
1061
|
-
h(
|
|
1062
|
-
var
|
|
1120
|
+
h(C, "k");
|
|
1121
|
+
var br = (() => {
|
|
1063
1122
|
try {
|
|
1064
1123
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
1065
1124
|
} catch {
|
|
1066
1125
|
return !1;
|
|
1067
1126
|
}
|
|
1068
|
-
})(),
|
|
1069
|
-
]`).replace("lheading",
|
|
1070
|
-
function
|
|
1127
|
+
})(), te = { 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") }, xr = /^(?:[ \t]*(?:\n|$))+/, kr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, ut = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, yr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, us = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, hs = C(us).replace(/bull/g, rn).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(), vr = C(us).replace(/bull/g, rn).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(), an = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Tr = /^[^\n]+/, ln = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Sr = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", ln).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Ar = C(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rn).getRegex(), _t = "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", on = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Er = C("^ {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", on).replace("tag", _t).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ps = C(an).replace("hr", ut).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", _t).getRegex(), _r = C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ps).getRegex(), cn = { blockquote: _r, code: kr, def: Sr, fences: wr, heading: yr, hr: ut, html: Er, lheading: hs, list: Ar, newline: xr, paragraph: ps, table: Ce, text: Tr }, Zn = C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", ut).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", _t).getRegex(), Rr = { ...cn, lheading: vr, table: Zn, paragraph: C(an).replace("hr", ut).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Zn).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", _t).getRegex() }, Ir = { ...cn, html: C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", on).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: Ce, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: C(an).replace("hr", ut).replace("heading", ` *#{1,6} *[^
|
|
1128
|
+
]`).replace("lheading", hs).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Dr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Cr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ds = /^( {2,}|\\)\n(?!\s*$)/, Mr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, qe = /[\p{P}\p{S}]/u, Rt = /[\s\p{P}\p{S}]/u, un = /[^\s\p{P}\p{S}]/u, Lr = C(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Rt).getRegex(), fs = /(?!~)[\p{P}\p{S}]/u, Or = /(?!~)[\s\p{P}\p{S}]/u, zr = /(?:[^\s\p{P}\p{S}]|~)/u, Pr = C(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", br ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), gs = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Nr = C(gs, "u").replace(/punct/g, qe).getRegex(), $r = C(gs, "u").replace(/punct/g, fs).getRegex(), ms = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Br = C(ms, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, qe).getRegex(), Ur = C(ms, "gu").replace(/notPunctSpace/g, zr).replace(/punctSpace/g, Or).replace(/punct/g, fs).getRegex(), Fr = C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, qe).getRegex(), Hr = C(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, qe).getRegex(), Gr = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", jr = C(Gr, "gu").replace(/notPunctSpace/g, un).replace(/punctSpace/g, Rt).replace(/punct/g, qe).getRegex(), Wr = C(/\\(punct)/, "gu").replace(/punct/g, qe).getRegex(), qr = C(/^<(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(), Vr = C(on).replace("(?:-->|$)", "-->").getRegex(), Yr = C("^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", Vr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), St = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/, Zr = C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", St).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), bs = C(/^!?\[(label)\]\[(ref)\]/).replace("label", St).replace("ref", ln).getRegex(), xs = C(/^!?\[(ref)\](?:\[\])?/).replace("ref", ln).getRegex(), Xr = C("reflink|nolink(?!\\()", "g").replace("reflink", bs).replace("nolink", xs).getRegex(), Xn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, hn = { _backpedal: Ce, anyPunctuation: Wr, autolink: qr, blockSkip: Pr, br: ds, code: Cr, del: Ce, delLDelim: Ce, delRDelim: Ce, emStrongLDelim: Nr, emStrongRDelimAst: Br, emStrongRDelimUnd: Fr, escape: Dr, link: Zr, nolink: xs, punctuation: Lr, reflink: bs, reflinkSearch: Xr, tag: Yr, text: Mr, url: Ce }, Kr = { ...hn, link: C(/^!?\[(label)\]\((.*?)\)/).replace("label", St).getRegex(), reflink: C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", St).getRegex() }, tn = { ...hn, emStrongRDelimAst: Ur, emStrongLDelim: $r, delLDelim: Hr, delRDelim: jr, url: C(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Xn).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: C(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", Xn).getRegex() }, Qr = { ...tn, br: C(ds).replace("{2,}", "*").getRegex(), text: C(tn.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, vt = { normal: cn, gfm: Rr, pedantic: Ir }, rt = { normal: hn, gfm: tn, breaks: Qr, pedantic: Kr }, Jr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Kn = /* @__PURE__ */ h((a) => Jr[a], "ke");
|
|
1129
|
+
function ke(a, t) {
|
|
1071
1130
|
if (t) {
|
|
1072
|
-
if (
|
|
1073
|
-
} else if (
|
|
1074
|
-
return
|
|
1131
|
+
if (te.escapeTest.test(a)) return a.replace(te.escapeReplace, Kn);
|
|
1132
|
+
} else if (te.escapeTestNoEncode.test(a)) return a.replace(te.escapeReplaceNoEncode, Kn);
|
|
1133
|
+
return a;
|
|
1075
1134
|
}
|
|
1076
|
-
h(
|
|
1077
|
-
function
|
|
1135
|
+
h(ke, "T");
|
|
1136
|
+
function Qn(a) {
|
|
1078
1137
|
try {
|
|
1079
|
-
|
|
1138
|
+
a = encodeURI(a).replace(te.percentDecode, "%");
|
|
1080
1139
|
} catch {
|
|
1081
1140
|
return null;
|
|
1082
1141
|
}
|
|
1083
|
-
return
|
|
1142
|
+
return a;
|
|
1084
1143
|
}
|
|
1085
|
-
h(
|
|
1086
|
-
function
|
|
1087
|
-
let e =
|
|
1088
|
-
let c = !1,
|
|
1089
|
-
for (; --
|
|
1144
|
+
h(Qn, "J");
|
|
1145
|
+
function Jn(a, t) {
|
|
1146
|
+
let e = a.replace(te.findPipe, (r, l, o) => {
|
|
1147
|
+
let c = !1, p = l;
|
|
1148
|
+
for (; --p >= 0 && o[p] === "\\"; ) c = !c;
|
|
1090
1149
|
return c ? "|" : " |";
|
|
1091
|
-
}), n = e.split(
|
|
1150
|
+
}), n = e.split(te.splitPipe), s = 0;
|
|
1092
1151
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
1093
1152
|
else for (; n.length < t; ) n.push("");
|
|
1094
|
-
for (; s < n.length; s++) n[s] = n[s].trim().replace(
|
|
1153
|
+
for (; s < n.length; s++) n[s] = n[s].trim().replace(te.slashPipe, "|");
|
|
1095
1154
|
return n;
|
|
1096
1155
|
}
|
|
1097
|
-
h(
|
|
1098
|
-
function
|
|
1099
|
-
let n =
|
|
1156
|
+
h(Jn, "V");
|
|
1157
|
+
function it(a, t, e) {
|
|
1158
|
+
let n = a.length;
|
|
1100
1159
|
if (n === 0) return "";
|
|
1101
1160
|
let s = 0;
|
|
1102
|
-
for (; s < n &&
|
|
1161
|
+
for (; s < n && a.charAt(n - s - 1) === t; )
|
|
1103
1162
|
s++;
|
|
1104
|
-
return
|
|
1163
|
+
return a.slice(0, n - s);
|
|
1105
1164
|
}
|
|
1106
|
-
h(
|
|
1107
|
-
function
|
|
1108
|
-
if (
|
|
1165
|
+
h(it, "I");
|
|
1166
|
+
function ei(a, t) {
|
|
1167
|
+
if (a.indexOf(t[1]) === -1) return -1;
|
|
1109
1168
|
let e = 0;
|
|
1110
|
-
for (let n = 0; n <
|
|
1111
|
-
else if (
|
|
1112
|
-
else if (
|
|
1169
|
+
for (let n = 0; n < a.length; n++) if (a[n] === "\\") n++;
|
|
1170
|
+
else if (a[n] === t[0]) e++;
|
|
1171
|
+
else if (a[n] === t[1] && (e--, e < 0)) return n;
|
|
1113
1172
|
return e > 0 ? -2 : -1;
|
|
1114
1173
|
}
|
|
1115
|
-
h(
|
|
1116
|
-
function
|
|
1174
|
+
h(ei, "de");
|
|
1175
|
+
function ti(a, t = 0) {
|
|
1117
1176
|
let e = t, n = "";
|
|
1118
|
-
for (let s of
|
|
1177
|
+
for (let s of a) if (s === " ") {
|
|
1119
1178
|
let r = 4 - e % 4;
|
|
1120
1179
|
n += " ".repeat(r), e += r;
|
|
1121
1180
|
} else n += s, e++;
|
|
1122
1181
|
return n;
|
|
1123
1182
|
}
|
|
1124
|
-
h(
|
|
1125
|
-
function
|
|
1126
|
-
let r = t.href,
|
|
1183
|
+
h(ti, "ge");
|
|
1184
|
+
function es(a, t, e, n, s) {
|
|
1185
|
+
let r = t.href, l = t.title || null, o = a[1].replace(s.other.outputLinkReplace, "$1");
|
|
1127
1186
|
n.state.inLink = !0;
|
|
1128
|
-
let c = { type:
|
|
1187
|
+
let c = { type: a[0].charAt(0) === "!" ? "image" : "link", raw: e, href: r, title: l, text: o, tokens: n.inlineTokens(o) };
|
|
1129
1188
|
return n.state.inLink = !1, c;
|
|
1130
1189
|
}
|
|
1131
|
-
h(
|
|
1132
|
-
function
|
|
1133
|
-
let n =
|
|
1190
|
+
h(es, "fe");
|
|
1191
|
+
function ni(a, t, e) {
|
|
1192
|
+
let n = a.match(e.other.indentCodeCompensation);
|
|
1134
1193
|
if (n === null) return t;
|
|
1135
1194
|
let s = n[1];
|
|
1136
1195
|
return t.split(`
|
|
1137
1196
|
`).map((r) => {
|
|
1138
|
-
let
|
|
1139
|
-
if (
|
|
1140
|
-
let [o] =
|
|
1197
|
+
let l = r.match(e.other.beginningSpace);
|
|
1198
|
+
if (l === null) return r;
|
|
1199
|
+
let [o] = l;
|
|
1141
1200
|
return o.length >= s.length ? r.slice(s.length) : r;
|
|
1142
1201
|
}).join(`
|
|
1143
1202
|
`);
|
|
1144
1203
|
}
|
|
1145
|
-
h(
|
|
1146
|
-
var
|
|
1204
|
+
h(ni, "nt");
|
|
1205
|
+
var He, At = (He = class {
|
|
1147
1206
|
constructor(t) {
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
this.options = t ||
|
|
1207
|
+
D(this, "options");
|
|
1208
|
+
D(this, "rules");
|
|
1209
|
+
D(this, "lexer");
|
|
1210
|
+
this.options = t || Oe;
|
|
1152
1211
|
}
|
|
1153
1212
|
space(t) {
|
|
1154
1213
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -1158,14 +1217,14 @@ var $e, yt = ($e = class {
|
|
|
1158
1217
|
let e = this.rules.block.code.exec(t);
|
|
1159
1218
|
if (e) {
|
|
1160
1219
|
let n = e[0].replace(this.rules.other.codeRemoveIndent, "");
|
|
1161
|
-
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n :
|
|
1220
|
+
return { type: "code", raw: e[0], codeBlockStyle: "indented", text: this.options.pedantic ? n : it(n, `
|
|
1162
1221
|
`) };
|
|
1163
1222
|
}
|
|
1164
1223
|
}
|
|
1165
1224
|
fences(t) {
|
|
1166
1225
|
let e = this.rules.block.fences.exec(t);
|
|
1167
1226
|
if (e) {
|
|
1168
|
-
let n = e[0], s =
|
|
1227
|
+
let n = e[0], s = ni(n, e[3] || "", this.rules);
|
|
1169
1228
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
|
|
1170
1229
|
}
|
|
1171
1230
|
}
|
|
@@ -1174,7 +1233,7 @@ var $e, yt = ($e = class {
|
|
|
1174
1233
|
if (e) {
|
|
1175
1234
|
let n = e[2].trim();
|
|
1176
1235
|
if (this.rules.other.endingHash.test(n)) {
|
|
1177
|
-
let s =
|
|
1236
|
+
let s = it(n, "#");
|
|
1178
1237
|
(this.options.pedantic || !s || this.rules.other.endingSpaceChar.test(s)) && (n = s.trim());
|
|
1179
1238
|
}
|
|
1180
1239
|
return { type: "heading", raw: e[0], depth: e[1].length, text: n, tokens: this.lexer.inline(n) };
|
|
@@ -1182,47 +1241,47 @@ var $e, yt = ($e = class {
|
|
|
1182
1241
|
}
|
|
1183
1242
|
hr(t) {
|
|
1184
1243
|
let e = this.rules.block.hr.exec(t);
|
|
1185
|
-
if (e) return { type: "hr", raw:
|
|
1244
|
+
if (e) return { type: "hr", raw: it(e[0], `
|
|
1186
1245
|
`) };
|
|
1187
1246
|
}
|
|
1188
1247
|
blockquote(t) {
|
|
1189
1248
|
let e = this.rules.block.blockquote.exec(t);
|
|
1190
1249
|
if (e) {
|
|
1191
|
-
let n =
|
|
1250
|
+
let n = it(e[0], `
|
|
1192
1251
|
`).split(`
|
|
1193
|
-
`), s = "", r = "",
|
|
1252
|
+
`), s = "", r = "", l = [];
|
|
1194
1253
|
for (; n.length > 0; ) {
|
|
1195
|
-
let o = !1, c = [],
|
|
1196
|
-
for (
|
|
1197
|
-
else if (!o) c.push(n[
|
|
1254
|
+
let o = !1, c = [], p;
|
|
1255
|
+
for (p = 0; p < n.length; p++) if (this.rules.other.blockquoteStart.test(n[p])) c.push(n[p]), o = !0;
|
|
1256
|
+
else if (!o) c.push(n[p]);
|
|
1198
1257
|
else break;
|
|
1199
|
-
n = n.slice(
|
|
1258
|
+
n = n.slice(p);
|
|
1200
1259
|
let g = c.join(`
|
|
1201
1260
|
`), d = g.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1202
1261
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1203
1262
|
s = s ? `${s}
|
|
1204
1263
|
${g}` : g, r = r ? `${r}
|
|
1205
1264
|
${d}` : d;
|
|
1206
|
-
let
|
|
1207
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(d,
|
|
1208
|
-
let
|
|
1209
|
-
if (
|
|
1210
|
-
if (
|
|
1211
|
-
let
|
|
1265
|
+
let f = this.lexer.state.top;
|
|
1266
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(d, l, !0), this.lexer.state.top = f, n.length === 0) break;
|
|
1267
|
+
let m = l.at(-1);
|
|
1268
|
+
if (m?.type === "code") break;
|
|
1269
|
+
if (m?.type === "blockquote") {
|
|
1270
|
+
let w = m, E = w.raw + `
|
|
1212
1271
|
` + n.join(`
|
|
1213
|
-
`),
|
|
1214
|
-
|
|
1272
|
+
`), O = this.blockquote(E);
|
|
1273
|
+
l[l.length - 1] = O, s = s.substring(0, s.length - w.raw.length) + O.raw, r = r.substring(0, r.length - w.text.length) + O.text;
|
|
1215
1274
|
break;
|
|
1216
|
-
} else if (
|
|
1217
|
-
let
|
|
1275
|
+
} else if (m?.type === "list") {
|
|
1276
|
+
let w = m, E = w.raw + `
|
|
1218
1277
|
` + n.join(`
|
|
1219
|
-
`),
|
|
1220
|
-
|
|
1278
|
+
`), O = this.list(E);
|
|
1279
|
+
l[l.length - 1] = O, s = s.substring(0, s.length - m.raw.length) + O.raw, r = r.substring(0, r.length - w.raw.length) + O.raw, n = E.substring(l.at(-1).raw.length).split(`
|
|
1221
1280
|
`);
|
|
1222
1281
|
continue;
|
|
1223
1282
|
}
|
|
1224
1283
|
}
|
|
1225
|
-
return { type: "blockquote", raw: s, tokens:
|
|
1284
|
+
return { type: "blockquote", raw: s, tokens: l, text: r };
|
|
1226
1285
|
}
|
|
1227
1286
|
}
|
|
1228
1287
|
list(t) {
|
|
@@ -1230,30 +1289,30 @@ ${d}` : d;
|
|
|
1230
1289
|
if (e) {
|
|
1231
1290
|
let n = e[1].trim(), s = n.length > 1, r = { type: "list", raw: "", ordered: s, start: s ? +n.slice(0, -1) : "", loose: !1, items: [] };
|
|
1232
1291
|
n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
|
|
1233
|
-
let
|
|
1292
|
+
let l = this.rules.other.listItemRegex(n), o = !1;
|
|
1234
1293
|
for (; t; ) {
|
|
1235
|
-
let
|
|
1236
|
-
if (!(e =
|
|
1294
|
+
let p = !1, g = "", d = "";
|
|
1295
|
+
if (!(e = l.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1237
1296
|
g = e[0], t = t.substring(g.length);
|
|
1238
|
-
let
|
|
1239
|
-
`, 1)[0], e[1].length),
|
|
1240
|
-
`, 1)[0],
|
|
1241
|
-
if (this.options.pedantic ? (
|
|
1242
|
-
`, t = t.substring(
|
|
1243
|
-
let
|
|
1297
|
+
let f = ti(e[2].split(`
|
|
1298
|
+
`, 1)[0], e[1].length), m = t.split(`
|
|
1299
|
+
`, 1)[0], w = !f.trim(), E = 0;
|
|
1300
|
+
if (this.options.pedantic ? (E = 2, d = f.trimStart()) : w ? E = e[1].length + 1 : (E = f.search(this.rules.other.nonSpaceChar), E = E > 4 ? 1 : E, d = f.slice(E), E += e[1].length), w && this.rules.other.blankLine.test(m) && (g += m + `
|
|
1301
|
+
`, t = t.substring(m.length + 1), p = !0), !p) {
|
|
1302
|
+
let O = this.rules.other.nextBulletRegex(E), U = this.rules.other.hrRegex(E), ae = this.rules.other.fencesBeginRegex(E), le = this.rules.other.headingBeginRegex(E), z = this.rules.other.htmlBeginRegex(E), oe = this.rules.other.blockquoteBeginRegex(E);
|
|
1244
1303
|
for (; t; ) {
|
|
1245
|
-
let
|
|
1246
|
-
`, 1)[0],
|
|
1247
|
-
if (
|
|
1248
|
-
if (
|
|
1249
|
-
` +
|
|
1304
|
+
let me = t.split(`
|
|
1305
|
+
`, 1)[0], V;
|
|
1306
|
+
if (m = me, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), V = m) : V = m.replace(this.rules.other.tabCharGlobal, " "), ae.test(m) || le.test(m) || z.test(m) || oe.test(m) || O.test(m) || U.test(m)) break;
|
|
1307
|
+
if (V.search(this.rules.other.nonSpaceChar) >= E || !m.trim()) d += `
|
|
1308
|
+
` + V.slice(E);
|
|
1250
1309
|
else {
|
|
1251
|
-
if (
|
|
1310
|
+
if (w || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || ae.test(f) || le.test(f) || U.test(f)) break;
|
|
1252
1311
|
d += `
|
|
1253
|
-
` +
|
|
1312
|
+
` + m;
|
|
1254
1313
|
}
|
|
1255
|
-
|
|
1256
|
-
`, t = t.substring(
|
|
1314
|
+
w = !m.trim(), g += me + `
|
|
1315
|
+
`, t = t.substring(me.length + 1), f = V.slice(E);
|
|
1257
1316
|
}
|
|
1258
1317
|
}
|
|
1259
1318
|
r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(g) && (o = !0)), r.items.push({ type: "list_item", raw: g, task: !!this.options.gfm && this.rules.other.listIsTask.test(d), loose: !1, text: d, tokens: [] }), r.raw += g;
|
|
@@ -1262,29 +1321,29 @@ ${d}` : d;
|
|
|
1262
1321
|
if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
|
|
1263
1322
|
else return;
|
|
1264
1323
|
r.raw = r.raw.trimEnd();
|
|
1265
|
-
for (let
|
|
1266
|
-
if (this.lexer.state.top = !1,
|
|
1267
|
-
if (
|
|
1268
|
-
|
|
1324
|
+
for (let p of r.items) {
|
|
1325
|
+
if (this.lexer.state.top = !1, p.tokens = this.lexer.blockTokens(p.text, []), p.task) {
|
|
1326
|
+
if (p.text = p.text.replace(this.rules.other.listReplaceTask, ""), p.tokens[0]?.type === "text" || p.tokens[0]?.type === "paragraph") {
|
|
1327
|
+
p.tokens[0].raw = p.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), p.tokens[0].text = p.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
1269
1328
|
for (let d = this.lexer.inlineQueue.length - 1; d >= 0; d--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)) {
|
|
1270
1329
|
this.lexer.inlineQueue[d].src = this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask, "");
|
|
1271
1330
|
break;
|
|
1272
1331
|
}
|
|
1273
1332
|
}
|
|
1274
|
-
let g = this.rules.other.listTaskCheckbox.exec(
|
|
1333
|
+
let g = this.rules.other.listTaskCheckbox.exec(p.raw);
|
|
1275
1334
|
if (g) {
|
|
1276
1335
|
let d = { type: "checkbox", raw: g[0] + " ", checked: g[0] !== "[ ]" };
|
|
1277
|
-
|
|
1336
|
+
p.checked = d.checked, r.loose ? p.tokens[0] && ["paragraph", "text"].includes(p.tokens[0].type) && "tokens" in p.tokens[0] && p.tokens[0].tokens ? (p.tokens[0].raw = d.raw + p.tokens[0].raw, p.tokens[0].text = d.raw + p.tokens[0].text, p.tokens[0].tokens.unshift(d)) : p.tokens.unshift({ type: "paragraph", raw: d.raw, text: d.raw, tokens: [d] }) : p.tokens.unshift(d);
|
|
1278
1337
|
}
|
|
1279
1338
|
}
|
|
1280
1339
|
if (!r.loose) {
|
|
1281
|
-
let g =
|
|
1340
|
+
let g = p.tokens.filter((f) => f.type === "space"), d = g.length > 0 && g.some((f) => this.rules.other.anyLine.test(f.raw));
|
|
1282
1341
|
r.loose = d;
|
|
1283
1342
|
}
|
|
1284
1343
|
}
|
|
1285
|
-
if (r.loose) for (let
|
|
1286
|
-
|
|
1287
|
-
for (let g of
|
|
1344
|
+
if (r.loose) for (let p of r.items) {
|
|
1345
|
+
p.loose = !0;
|
|
1346
|
+
for (let g of p.tokens) g.type === "text" && (g.type = "paragraph");
|
|
1288
1347
|
}
|
|
1289
1348
|
return r;
|
|
1290
1349
|
}
|
|
@@ -1303,13 +1362,13 @@ ${d}` : d;
|
|
|
1303
1362
|
table(t) {
|
|
1304
1363
|
let e = this.rules.block.table.exec(t);
|
|
1305
1364
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1306
|
-
let n =
|
|
1307
|
-
`) : [],
|
|
1365
|
+
let n = Jn(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1366
|
+
`) : [], l = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
1308
1367
|
if (n.length === s.length) {
|
|
1309
|
-
for (let o of s) this.rules.other.tableAlignRight.test(o) ?
|
|
1310
|
-
for (let o = 0; o < n.length; o++)
|
|
1311
|
-
for (let o of r)
|
|
1312
|
-
return
|
|
1368
|
+
for (let o of s) 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);
|
|
1369
|
+
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] });
|
|
1370
|
+
for (let o of r) l.rows.push(Jn(o, l.header.length).map((c, p) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: l.align[p] })));
|
|
1371
|
+
return l;
|
|
1313
1372
|
}
|
|
1314
1373
|
}
|
|
1315
1374
|
lheading(t) {
|
|
@@ -1345,22 +1404,22 @@ ${d}` : d;
|
|
|
1345
1404
|
let n = e[2].trim();
|
|
1346
1405
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(n)) {
|
|
1347
1406
|
if (!this.rules.other.endAngleBracket.test(n)) return;
|
|
1348
|
-
let
|
|
1349
|
-
if ((n.length -
|
|
1407
|
+
let l = it(n.slice(0, -1), "\\");
|
|
1408
|
+
if ((n.length - l.length) % 2 === 0) return;
|
|
1350
1409
|
} else {
|
|
1351
|
-
let
|
|
1352
|
-
if (
|
|
1353
|
-
if (
|
|
1354
|
-
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length +
|
|
1355
|
-
e[2] = e[2].substring(0,
|
|
1410
|
+
let l = ei(e[2], "()");
|
|
1411
|
+
if (l === -2) return;
|
|
1412
|
+
if (l > -1) {
|
|
1413
|
+
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + l;
|
|
1414
|
+
e[2] = e[2].substring(0, l), e[0] = e[0].substring(0, o).trim(), e[3] = "";
|
|
1356
1415
|
}
|
|
1357
1416
|
}
|
|
1358
1417
|
let s = e[2], r = "";
|
|
1359
1418
|
if (this.options.pedantic) {
|
|
1360
|
-
let
|
|
1361
|
-
|
|
1419
|
+
let l = this.rules.other.pedanticHrefTitle.exec(s);
|
|
1420
|
+
l && (s = l[1], r = l[3]);
|
|
1362
1421
|
} else r = e[3] ? e[3].slice(1, -1) : "";
|
|
1363
|
-
return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)),
|
|
1422
|
+
return s = s.trim(), this.rules.other.startAngleBracket.test(s) && (this.options.pedantic && !this.rules.other.endAngleBracket.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), es(e, { href: s && s.replace(this.rules.inline.anyPunctuation, "$1"), title: r && r.replace(this.rules.inline.anyPunctuation, "$1") }, e[0], this.lexer, this.rules);
|
|
1364
1423
|
}
|
|
1365
1424
|
}
|
|
1366
1425
|
reflink(t, e) {
|
|
@@ -1368,34 +1427,34 @@ ${d}` : d;
|
|
|
1368
1427
|
if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
|
|
1369
1428
|
let s = (n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "), r = e[s.toLowerCase()];
|
|
1370
1429
|
if (!r) {
|
|
1371
|
-
let
|
|
1372
|
-
return { type: "text", raw:
|
|
1430
|
+
let l = n[0].charAt(0);
|
|
1431
|
+
return { type: "text", raw: l, text: l };
|
|
1373
1432
|
}
|
|
1374
|
-
return
|
|
1433
|
+
return es(n, r, n[0], this.lexer, this.rules);
|
|
1375
1434
|
}
|
|
1376
1435
|
}
|
|
1377
1436
|
emStrong(t, e, n = "") {
|
|
1378
1437
|
let s = this.rules.inline.emStrongLDelim.exec(t);
|
|
1379
1438
|
if (!(!s || !s[1] && !s[2] && !s[3] && !s[4] || s[4] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[3]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1380
|
-
let r = [...s[0]].length - 1,
|
|
1439
|
+
let r = [...s[0]].length - 1, l, o, c = r, p = 0, g = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1381
1440
|
for (g.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = g.exec(e)) !== null; ) {
|
|
1382
|
-
if (
|
|
1383
|
-
if (o = [...
|
|
1441
|
+
if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l) continue;
|
|
1442
|
+
if (o = [...l].length, s[3] || s[4]) {
|
|
1384
1443
|
c += o;
|
|
1385
1444
|
continue;
|
|
1386
1445
|
} else if ((s[5] || s[6]) && r % 3 && !((r + o) % 3)) {
|
|
1387
|
-
|
|
1446
|
+
p += o;
|
|
1388
1447
|
continue;
|
|
1389
1448
|
}
|
|
1390
1449
|
if (c -= o, c > 0) continue;
|
|
1391
|
-
o = Math.min(o, o + c +
|
|
1392
|
-
let d = [...s[0]][0].length,
|
|
1450
|
+
o = Math.min(o, o + c + p);
|
|
1451
|
+
let d = [...s[0]][0].length, f = t.slice(0, r + s.index + d + o);
|
|
1393
1452
|
if (Math.min(r, o) % 2) {
|
|
1394
|
-
let
|
|
1395
|
-
return { type: "em", raw:
|
|
1453
|
+
let w = f.slice(1, -1);
|
|
1454
|
+
return { type: "em", raw: f, text: w, tokens: this.lexer.inlineTokens(w) };
|
|
1396
1455
|
}
|
|
1397
|
-
let
|
|
1398
|
-
return { type: "strong", raw:
|
|
1456
|
+
let m = f.slice(2, -2);
|
|
1457
|
+
return { type: "strong", raw: f, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
1399
1458
|
}
|
|
1400
1459
|
}
|
|
1401
1460
|
}
|
|
@@ -1413,17 +1472,17 @@ ${d}` : d;
|
|
|
1413
1472
|
del(t, e, n = "") {
|
|
1414
1473
|
let s = this.rules.inline.delLDelim.exec(t);
|
|
1415
1474
|
if (s && (!s[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1416
|
-
let r = [...s[0]].length - 1,
|
|
1417
|
-
for (
|
|
1418
|
-
if (
|
|
1475
|
+
let r = [...s[0]].length - 1, l, o, c = r, p = this.rules.inline.delRDelim;
|
|
1476
|
+
for (p.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = p.exec(e)) !== null; ) {
|
|
1477
|
+
if (l = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !l || (o = [...l].length, o !== r)) continue;
|
|
1419
1478
|
if (s[3] || s[4]) {
|
|
1420
1479
|
c += o;
|
|
1421
1480
|
continue;
|
|
1422
1481
|
}
|
|
1423
1482
|
if (c -= o, c > 0) continue;
|
|
1424
1483
|
o = Math.min(o, o + c);
|
|
1425
|
-
let g = [...s[0]][0].length, d = t.slice(0, r + s.index + g + o),
|
|
1426
|
-
return { type: "del", raw: d, text:
|
|
1484
|
+
let g = [...s[0]][0].length, d = t.slice(0, r + s.index + g + o), f = d.slice(r, -r);
|
|
1485
|
+
return { type: "del", raw: d, text: f, tokens: this.lexer.inlineTokens(f) };
|
|
1427
1486
|
}
|
|
1428
1487
|
}
|
|
1429
1488
|
}
|
|
@@ -1456,28 +1515,28 @@ ${d}` : d;
|
|
|
1456
1515
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1457
1516
|
}
|
|
1458
1517
|
}
|
|
1459
|
-
}, h(
|
|
1518
|
+
}, h(He, "w"), He), Ae, fe = (Ae = class {
|
|
1460
1519
|
constructor(t) {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
1467
|
-
let e = { other:
|
|
1468
|
-
this.options.pedantic ? (e.block =
|
|
1520
|
+
D(this, "tokens");
|
|
1521
|
+
D(this, "options");
|
|
1522
|
+
D(this, "state");
|
|
1523
|
+
D(this, "inlineQueue");
|
|
1524
|
+
D(this, "tokenizer");
|
|
1525
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Oe, this.options.tokenizer = this.options.tokenizer || new At(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1526
|
+
let e = { other: te, block: vt.normal, inline: rt.normal };
|
|
1527
|
+
this.options.pedantic ? (e.block = vt.pedantic, e.inline = rt.pedantic) : this.options.gfm && (e.block = vt.gfm, this.options.breaks ? e.inline = rt.breaks : e.inline = rt.gfm), this.tokenizer.rules = e;
|
|
1469
1528
|
}
|
|
1470
1529
|
static get rules() {
|
|
1471
|
-
return { block:
|
|
1530
|
+
return { block: vt, inline: rt };
|
|
1472
1531
|
}
|
|
1473
1532
|
static lex(t, e) {
|
|
1474
|
-
return new
|
|
1533
|
+
return new Ae(e).lex(t);
|
|
1475
1534
|
}
|
|
1476
1535
|
static lexInline(t, e) {
|
|
1477
|
-
return new
|
|
1536
|
+
return new Ae(e).inlineTokens(t);
|
|
1478
1537
|
}
|
|
1479
1538
|
lex(t) {
|
|
1480
|
-
t = t.replace(
|
|
1539
|
+
t = t.replace(te.carriageReturn, `
|
|
1481
1540
|
`), this.blockTokens(t, this.tokens);
|
|
1482
1541
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1483
1542
|
let n = this.inlineQueue[e];
|
|
@@ -1486,23 +1545,23 @@ ${d}` : d;
|
|
|
1486
1545
|
return this.inlineQueue = [], this.tokens;
|
|
1487
1546
|
}
|
|
1488
1547
|
blockTokens(t, e = [], n = !1) {
|
|
1489
|
-
for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(
|
|
1548
|
+
for (this.tokenizer.lexer = this, this.options.pedantic && (t = t.replace(te.tabCharGlobal, " ").replace(te.spaceLine, "")); t; ) {
|
|
1490
1549
|
let s;
|
|
1491
|
-
if (this.options.extensions?.block?.some((
|
|
1550
|
+
if (this.options.extensions?.block?.some((l) => (s = l.call({ lexer: this }, t, e)) ? (t = t.substring(s.raw.length), e.push(s), !0) : !1)) continue;
|
|
1492
1551
|
if (s = this.tokenizer.space(t)) {
|
|
1493
1552
|
t = t.substring(s.raw.length);
|
|
1494
|
-
let
|
|
1495
|
-
s.raw.length === 1 &&
|
|
1553
|
+
let l = e.at(-1);
|
|
1554
|
+
s.raw.length === 1 && l !== void 0 ? l.raw += `
|
|
1496
1555
|
` : e.push(s);
|
|
1497
1556
|
continue;
|
|
1498
1557
|
}
|
|
1499
1558
|
if (s = this.tokenizer.code(t)) {
|
|
1500
1559
|
t = t.substring(s.raw.length);
|
|
1501
|
-
let
|
|
1502
|
-
|
|
1560
|
+
let l = e.at(-1);
|
|
1561
|
+
l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith(`
|
|
1503
1562
|
`) ? "" : `
|
|
1504
|
-
`) + s.raw,
|
|
1505
|
-
` + s.text, this.inlineQueue.at(-1).src =
|
|
1563
|
+
`) + s.raw, l.text += `
|
|
1564
|
+
` + s.text, this.inlineQueue.at(-1).src = l.text) : e.push(s);
|
|
1506
1565
|
continue;
|
|
1507
1566
|
}
|
|
1508
1567
|
if (s = this.tokenizer.fences(t)) {
|
|
@@ -1531,11 +1590,11 @@ ${d}` : d;
|
|
|
1531
1590
|
}
|
|
1532
1591
|
if (s = this.tokenizer.def(t)) {
|
|
1533
1592
|
t = t.substring(s.raw.length);
|
|
1534
|
-
let
|
|
1535
|
-
|
|
1593
|
+
let l = e.at(-1);
|
|
1594
|
+
l?.type === "paragraph" || l?.type === "text" ? (l.raw += (l.raw.endsWith(`
|
|
1536
1595
|
`) ? "" : `
|
|
1537
|
-
`) + s.raw,
|
|
1538
|
-
` + s.raw, this.inlineQueue.at(-1).src =
|
|
1596
|
+
`) + s.raw, l.text += `
|
|
1597
|
+
` + s.raw, this.inlineQueue.at(-1).src = l.text) : this.tokens.links[s.tag] || (this.tokens.links[s.tag] = { href: s.href, title: s.title }, e.push(s));
|
|
1539
1598
|
continue;
|
|
1540
1599
|
}
|
|
1541
1600
|
if (s = this.tokenizer.table(t)) {
|
|
@@ -1548,34 +1607,34 @@ ${d}` : d;
|
|
|
1548
1607
|
}
|
|
1549
1608
|
let r = t;
|
|
1550
1609
|
if (this.options.extensions?.startBlock) {
|
|
1551
|
-
let
|
|
1552
|
-
this.options.extensions.startBlock.forEach((
|
|
1553
|
-
c =
|
|
1554
|
-
}),
|
|
1610
|
+
let l = 1 / 0, o = t.slice(1), c;
|
|
1611
|
+
this.options.extensions.startBlock.forEach((p) => {
|
|
1612
|
+
c = p.call({ lexer: this }, o), typeof c == "number" && c >= 0 && (l = Math.min(l, c));
|
|
1613
|
+
}), l < 1 / 0 && l >= 0 && (r = t.substring(0, l + 1));
|
|
1555
1614
|
}
|
|
1556
1615
|
if (this.state.top && (s = this.tokenizer.paragraph(r))) {
|
|
1557
|
-
let
|
|
1558
|
-
n &&
|
|
1616
|
+
let l = e.at(-1);
|
|
1617
|
+
n && l?.type === "paragraph" ? (l.raw += (l.raw.endsWith(`
|
|
1559
1618
|
`) ? "" : `
|
|
1560
|
-
`) + s.raw,
|
|
1561
|
-
` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src =
|
|
1619
|
+
`) + s.raw, l.text += `
|
|
1620
|
+
` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : e.push(s), n = r.length !== t.length, t = t.substring(s.raw.length);
|
|
1562
1621
|
continue;
|
|
1563
1622
|
}
|
|
1564
1623
|
if (s = this.tokenizer.text(t)) {
|
|
1565
1624
|
t = t.substring(s.raw.length);
|
|
1566
|
-
let
|
|
1567
|
-
|
|
1625
|
+
let l = e.at(-1);
|
|
1626
|
+
l?.type === "text" ? (l.raw += (l.raw.endsWith(`
|
|
1568
1627
|
`) ? "" : `
|
|
1569
|
-
`) + s.raw,
|
|
1570
|
-
` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src =
|
|
1628
|
+
`) + s.raw, l.text += `
|
|
1629
|
+
` + s.text, this.inlineQueue.pop(), this.inlineQueue.at(-1).src = l.text) : e.push(s);
|
|
1571
1630
|
continue;
|
|
1572
1631
|
}
|
|
1573
1632
|
if (t) {
|
|
1574
|
-
let
|
|
1633
|
+
let l = "Infinite loop on byte: " + t.charCodeAt(0);
|
|
1575
1634
|
if (this.options.silent) {
|
|
1576
|
-
console.error(
|
|
1635
|
+
console.error(l);
|
|
1577
1636
|
break;
|
|
1578
|
-
} else throw new Error(
|
|
1637
|
+
} else throw new Error(l);
|
|
1579
1638
|
}
|
|
1580
1639
|
}
|
|
1581
1640
|
return this.state.top = !0, e;
|
|
@@ -1594,9 +1653,9 @@ ${d}` : d;
|
|
|
1594
1653
|
let r;
|
|
1595
1654
|
for (; (s = this.tokenizer.rules.inline.blockSkip.exec(n)) !== null; ) r = s[2] ? s[2].length : 0, n = n.slice(0, s.index + r) + "[" + "a".repeat(s[0].length - r - 2) + "]" + n.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
|
|
1596
1655
|
n = this.options.hooks?.emStrongMask?.call({ lexer: this }, n) ?? n;
|
|
1597
|
-
let
|
|
1656
|
+
let l = !1, o = "";
|
|
1598
1657
|
for (; t; ) {
|
|
1599
|
-
|
|
1658
|
+
l || (o = ""), l = !1;
|
|
1600
1659
|
let c;
|
|
1601
1660
|
if (this.options.extensions?.inline?.some((g) => (c = g.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
|
|
1602
1661
|
if (c = this.tokenizer.escape(t)) {
|
|
@@ -1641,15 +1700,15 @@ ${d}` : d;
|
|
|
1641
1700
|
t = t.substring(c.raw.length), e.push(c);
|
|
1642
1701
|
continue;
|
|
1643
1702
|
}
|
|
1644
|
-
let
|
|
1703
|
+
let p = t;
|
|
1645
1704
|
if (this.options.extensions?.startInline) {
|
|
1646
|
-
let g = 1 / 0, d = t.slice(1),
|
|
1647
|
-
this.options.extensions.startInline.forEach((
|
|
1648
|
-
|
|
1649
|
-
}), g < 1 / 0 && g >= 0 && (
|
|
1705
|
+
let g = 1 / 0, d = t.slice(1), f;
|
|
1706
|
+
this.options.extensions.startInline.forEach((m) => {
|
|
1707
|
+
f = m.call({ lexer: this }, d), typeof f == "number" && f >= 0 && (g = Math.min(g, f));
|
|
1708
|
+
}), g < 1 / 0 && g >= 0 && (p = t.substring(0, g + 1));
|
|
1650
1709
|
}
|
|
1651
|
-
if (c = this.tokenizer.inlineText(
|
|
1652
|
-
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)),
|
|
1710
|
+
if (c = this.tokenizer.inlineText(p)) {
|
|
1711
|
+
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), l = !0;
|
|
1653
1712
|
let g = e.at(-1);
|
|
1654
1713
|
g?.type === "text" ? (g.raw += c.raw, g.text += c.text) : e.push(c);
|
|
1655
1714
|
continue;
|
|
@@ -1664,20 +1723,20 @@ ${d}` : d;
|
|
|
1664
1723
|
}
|
|
1665
1724
|
return e;
|
|
1666
1725
|
}
|
|
1667
|
-
}, h(
|
|
1726
|
+
}, h(Ae, "u"), Ae), Ge, Et = (Ge = class {
|
|
1668
1727
|
constructor(t) {
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
this.options = t ||
|
|
1728
|
+
D(this, "options");
|
|
1729
|
+
D(this, "parser");
|
|
1730
|
+
this.options = t || Oe;
|
|
1672
1731
|
}
|
|
1673
1732
|
space(t) {
|
|
1674
1733
|
return "";
|
|
1675
1734
|
}
|
|
1676
1735
|
code({ text: t, lang: e, escaped: n }) {
|
|
1677
|
-
let s = (e || "").match(
|
|
1736
|
+
let s = (e || "").match(te.notSpaceStart)?.[0], r = t.replace(te.endingNewline, "") + `
|
|
1678
1737
|
`;
|
|
1679
|
-
return s ? '<pre><code class="language-' +
|
|
1680
|
-
` : "<pre><code>" + (n ? r :
|
|
1738
|
+
return s ? '<pre><code class="language-' + ke(s) + '">' + (n ? r : ke(r, !0)) + `</code></pre>
|
|
1739
|
+
` : "<pre><code>" + (n ? r : ke(r, !0)) + `</code></pre>
|
|
1681
1740
|
`;
|
|
1682
1741
|
}
|
|
1683
1742
|
blockquote({ tokens: t }) {
|
|
@@ -1705,8 +1764,8 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1705
1764
|
let c = t.items[o];
|
|
1706
1765
|
s += this.listitem(c);
|
|
1707
1766
|
}
|
|
1708
|
-
let r = e ? "ol" : "ul",
|
|
1709
|
-
return "<" + r +
|
|
1767
|
+
let r = e ? "ol" : "ul", l = e && n !== 1 ? ' start="' + n + '"' : "";
|
|
1768
|
+
return "<" + r + l + `>
|
|
1710
1769
|
` + s + "</" + r + `>
|
|
1711
1770
|
`;
|
|
1712
1771
|
}
|
|
@@ -1727,9 +1786,9 @@ ${this.parser.parse(t)}</blockquote>
|
|
|
1727
1786
|
e += this.tablerow({ text: n });
|
|
1728
1787
|
let s = "";
|
|
1729
1788
|
for (let r = 0; r < t.rows.length; r++) {
|
|
1730
|
-
let
|
|
1789
|
+
let l = t.rows[r];
|
|
1731
1790
|
n = "";
|
|
1732
|
-
for (let o = 0; o <
|
|
1791
|
+
for (let o = 0; o < l.length; o++) n += this.tablecell(l[o]);
|
|
1733
1792
|
s += this.tablerow({ text: n });
|
|
1734
1793
|
}
|
|
1735
1794
|
return s && (s = `<tbody>${s}</tbody>`), `<table>
|
|
@@ -1755,7 +1814,7 @@ ${t}</tr>
|
|
|
1755
1814
|
return `<em>${this.parser.parseInline(t)}</em>`;
|
|
1756
1815
|
}
|
|
1757
1816
|
codespan({ text: t }) {
|
|
1758
|
-
return `<code>${
|
|
1817
|
+
return `<code>${ke(t, !0)}</code>`;
|
|
1759
1818
|
}
|
|
1760
1819
|
br(t) {
|
|
1761
1820
|
return "<br>";
|
|
@@ -1764,24 +1823,24 @@ ${t}</tr>
|
|
|
1764
1823
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1765
1824
|
}
|
|
1766
1825
|
link({ href: t, title: e, tokens: n }) {
|
|
1767
|
-
let s = this.parser.parseInline(n), r =
|
|
1826
|
+
let s = this.parser.parseInline(n), r = Qn(t);
|
|
1768
1827
|
if (r === null) return s;
|
|
1769
1828
|
t = r;
|
|
1770
|
-
let
|
|
1771
|
-
return e && (
|
|
1829
|
+
let l = '<a href="' + t + '"';
|
|
1830
|
+
return e && (l += ' title="' + ke(e) + '"'), l += ">" + s + "</a>", l;
|
|
1772
1831
|
}
|
|
1773
1832
|
image({ href: t, title: e, text: n, tokens: s }) {
|
|
1774
1833
|
s && (n = this.parser.parseInline(s, this.parser.textRenderer));
|
|
1775
|
-
let r =
|
|
1776
|
-
if (r === null) return
|
|
1834
|
+
let r = Qn(t);
|
|
1835
|
+
if (r === null) return ke(n);
|
|
1777
1836
|
t = r;
|
|
1778
|
-
let
|
|
1779
|
-
return e && (
|
|
1837
|
+
let l = `<img src="${t}" alt="${ke(n)}"`;
|
|
1838
|
+
return e && (l += ` title="${ke(e)}"`), l += ">", l;
|
|
1780
1839
|
}
|
|
1781
1840
|
text(t) {
|
|
1782
|
-
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text :
|
|
1841
|
+
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : ke(t.text);
|
|
1783
1842
|
}
|
|
1784
|
-
}, h(
|
|
1843
|
+
}, h(Ge, "y"), Ge), je, pn = (je = class {
|
|
1785
1844
|
strong({ text: t }) {
|
|
1786
1845
|
return t;
|
|
1787
1846
|
}
|
|
@@ -1812,18 +1871,18 @@ ${t}</tr>
|
|
|
1812
1871
|
checkbox({ raw: t }) {
|
|
1813
1872
|
return t;
|
|
1814
1873
|
}
|
|
1815
|
-
}, h(
|
|
1874
|
+
}, h(je, "$"), je), Ee, ge = (Ee = class {
|
|
1816
1875
|
constructor(t) {
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
this.options = t ||
|
|
1876
|
+
D(this, "options");
|
|
1877
|
+
D(this, "renderer");
|
|
1878
|
+
D(this, "textRenderer");
|
|
1879
|
+
this.options = t || Oe, this.options.renderer = this.options.renderer || new Et(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new pn();
|
|
1821
1880
|
}
|
|
1822
1881
|
static parse(t, e) {
|
|
1823
|
-
return new
|
|
1882
|
+
return new Ee(e).parse(t);
|
|
1824
1883
|
}
|
|
1825
1884
|
static parseInline(t, e) {
|
|
1826
|
-
return new
|
|
1885
|
+
return new Ee(e).parseInline(t);
|
|
1827
1886
|
}
|
|
1828
1887
|
parse(t) {
|
|
1829
1888
|
this.renderer.parser = this;
|
|
@@ -1831,8 +1890,8 @@ ${t}</tr>
|
|
|
1831
1890
|
for (let n = 0; n < t.length; n++) {
|
|
1832
1891
|
let s = t[n];
|
|
1833
1892
|
if (this.options.extensions?.renderers?.[s.type]) {
|
|
1834
|
-
let
|
|
1835
|
-
if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(
|
|
1893
|
+
let l = s, o = this.options.extensions.renderers[l.type].call({ parser: this }, l);
|
|
1894
|
+
if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "def", "paragraph", "text"].includes(l.type)) {
|
|
1836
1895
|
e += o || "";
|
|
1837
1896
|
continue;
|
|
1838
1897
|
}
|
|
@@ -1888,9 +1947,9 @@ ${t}</tr>
|
|
|
1888
1947
|
break;
|
|
1889
1948
|
}
|
|
1890
1949
|
default: {
|
|
1891
|
-
let
|
|
1892
|
-
if (this.options.silent) return console.error(
|
|
1893
|
-
throw new Error(
|
|
1950
|
+
let l = 'Token with "' + r.type + '" type was not found.';
|
|
1951
|
+
if (this.options.silent) return console.error(l), "";
|
|
1952
|
+
throw new Error(l);
|
|
1894
1953
|
}
|
|
1895
1954
|
}
|
|
1896
1955
|
}
|
|
@@ -1908,54 +1967,54 @@ ${t}</tr>
|
|
|
1908
1967
|
continue;
|
|
1909
1968
|
}
|
|
1910
1969
|
}
|
|
1911
|
-
let
|
|
1912
|
-
switch (
|
|
1970
|
+
let l = r;
|
|
1971
|
+
switch (l.type) {
|
|
1913
1972
|
case "escape": {
|
|
1914
|
-
n += e.text(
|
|
1973
|
+
n += e.text(l);
|
|
1915
1974
|
break;
|
|
1916
1975
|
}
|
|
1917
1976
|
case "html": {
|
|
1918
|
-
n += e.html(
|
|
1977
|
+
n += e.html(l);
|
|
1919
1978
|
break;
|
|
1920
1979
|
}
|
|
1921
1980
|
case "link": {
|
|
1922
|
-
n += e.link(
|
|
1981
|
+
n += e.link(l);
|
|
1923
1982
|
break;
|
|
1924
1983
|
}
|
|
1925
1984
|
case "image": {
|
|
1926
|
-
n += e.image(
|
|
1985
|
+
n += e.image(l);
|
|
1927
1986
|
break;
|
|
1928
1987
|
}
|
|
1929
1988
|
case "checkbox": {
|
|
1930
|
-
n += e.checkbox(
|
|
1989
|
+
n += e.checkbox(l);
|
|
1931
1990
|
break;
|
|
1932
1991
|
}
|
|
1933
1992
|
case "strong": {
|
|
1934
|
-
n += e.strong(
|
|
1993
|
+
n += e.strong(l);
|
|
1935
1994
|
break;
|
|
1936
1995
|
}
|
|
1937
1996
|
case "em": {
|
|
1938
|
-
n += e.em(
|
|
1997
|
+
n += e.em(l);
|
|
1939
1998
|
break;
|
|
1940
1999
|
}
|
|
1941
2000
|
case "codespan": {
|
|
1942
|
-
n += e.codespan(
|
|
2001
|
+
n += e.codespan(l);
|
|
1943
2002
|
break;
|
|
1944
2003
|
}
|
|
1945
2004
|
case "br": {
|
|
1946
|
-
n += e.br(
|
|
2005
|
+
n += e.br(l);
|
|
1947
2006
|
break;
|
|
1948
2007
|
}
|
|
1949
2008
|
case "del": {
|
|
1950
|
-
n += e.del(
|
|
2009
|
+
n += e.del(l);
|
|
1951
2010
|
break;
|
|
1952
2011
|
}
|
|
1953
2012
|
case "text": {
|
|
1954
|
-
n += e.text(
|
|
2013
|
+
n += e.text(l);
|
|
1955
2014
|
break;
|
|
1956
2015
|
}
|
|
1957
2016
|
default: {
|
|
1958
|
-
let o = 'Token with "' +
|
|
2017
|
+
let o = 'Token with "' + l.type + '" type was not found.';
|
|
1959
2018
|
if (this.options.silent) return console.error(o), "";
|
|
1960
2019
|
throw new Error(o);
|
|
1961
2020
|
}
|
|
@@ -1963,11 +2022,11 @@ ${t}</tr>
|
|
|
1963
2022
|
}
|
|
1964
2023
|
return n;
|
|
1965
2024
|
}
|
|
1966
|
-
}, h(
|
|
2025
|
+
}, h(Ee, "u"), Ee), Se, ot = (Se = class {
|
|
1967
2026
|
constructor(t) {
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
this.options = t ||
|
|
2027
|
+
D(this, "options");
|
|
2028
|
+
D(this, "block");
|
|
2029
|
+
this.options = t || Oe;
|
|
1971
2030
|
}
|
|
1972
2031
|
preprocess(t) {
|
|
1973
2032
|
return t;
|
|
@@ -1982,23 +2041,23 @@ ${t}</tr>
|
|
|
1982
2041
|
return t;
|
|
1983
2042
|
}
|
|
1984
2043
|
provideLexer(t = this.block) {
|
|
1985
|
-
return t ?
|
|
2044
|
+
return t ? fe.lex : fe.lexInline;
|
|
1986
2045
|
}
|
|
1987
2046
|
provideParser(t = this.block) {
|
|
1988
|
-
return t ?
|
|
2047
|
+
return t ? ge.parse : ge.parseInline;
|
|
1989
2048
|
}
|
|
1990
|
-
}, h(
|
|
2049
|
+
}, h(Se, "P"), D(Se, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), D(Se, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), Se), We, si = (We = class {
|
|
1991
2050
|
constructor(...t) {
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2051
|
+
D(this, "defaults", sn());
|
|
2052
|
+
D(this, "options", this.setOptions);
|
|
2053
|
+
D(this, "parse", this.parseMarkdown(!0));
|
|
2054
|
+
D(this, "parseInline", this.parseMarkdown(!1));
|
|
2055
|
+
D(this, "Parser", ge);
|
|
2056
|
+
D(this, "Renderer", Et);
|
|
2057
|
+
D(this, "TextRenderer", pn);
|
|
2058
|
+
D(this, "Lexer", fe);
|
|
2059
|
+
D(this, "Tokenizer", At);
|
|
2060
|
+
D(this, "Hooks", ot);
|
|
2002
2061
|
this.use(...t);
|
|
2003
2062
|
}
|
|
2004
2063
|
walkTokens(t, e) {
|
|
@@ -2006,8 +2065,8 @@ ${t}</tr>
|
|
|
2006
2065
|
for (let s of t) switch (n = n.concat(e.call(this, s)), s.type) {
|
|
2007
2066
|
case "table": {
|
|
2008
2067
|
let r = s;
|
|
2009
|
-
for (let
|
|
2010
|
-
for (let
|
|
2068
|
+
for (let l of r.header) n = n.concat(this.walkTokens(l.tokens, e));
|
|
2069
|
+
for (let l of r.rows) for (let o of l) n = n.concat(this.walkTokens(o.tokens, e));
|
|
2011
2070
|
break;
|
|
2012
2071
|
}
|
|
2013
2072
|
case "list": {
|
|
@@ -2017,8 +2076,8 @@ ${t}</tr>
|
|
|
2017
2076
|
}
|
|
2018
2077
|
default: {
|
|
2019
2078
|
let r = s;
|
|
2020
|
-
this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((
|
|
2021
|
-
let o = r[
|
|
2079
|
+
this.defaults.extensions?.childTokens?.[r.type] ? this.defaults.extensions.childTokens[r.type].forEach((l) => {
|
|
2080
|
+
let o = r[l].flat(1 / 0);
|
|
2022
2081
|
n = n.concat(this.walkTokens(o, e));
|
|
2023
2082
|
}) : r.tokens && (n = n.concat(this.walkTokens(r.tokens, e)));
|
|
2024
2083
|
}
|
|
@@ -2032,73 +2091,73 @@ ${t}</tr>
|
|
|
2032
2091
|
if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
|
|
2033
2092
|
if (!r.name) throw new Error("extension name required");
|
|
2034
2093
|
if ("renderer" in r) {
|
|
2035
|
-
let
|
|
2036
|
-
|
|
2094
|
+
let l = e.renderers[r.name];
|
|
2095
|
+
l ? e.renderers[r.name] = function(...o) {
|
|
2037
2096
|
let c = r.renderer.apply(this, o);
|
|
2038
|
-
return c === !1 && (c =
|
|
2097
|
+
return c === !1 && (c = l.apply(this, o)), c;
|
|
2039
2098
|
} : e.renderers[r.name] = r.renderer;
|
|
2040
2099
|
}
|
|
2041
2100
|
if ("tokenizer" in r) {
|
|
2042
2101
|
if (!r.level || r.level !== "block" && r.level !== "inline") throw new Error("extension level must be 'block' or 'inline'");
|
|
2043
|
-
let
|
|
2044
|
-
|
|
2102
|
+
let l = e[r.level];
|
|
2103
|
+
l ? l.unshift(r.tokenizer) : e[r.level] = [r.tokenizer], r.start && (r.level === "block" ? e.startBlock ? e.startBlock.push(r.start) : e.startBlock = [r.start] : r.level === "inline" && (e.startInline ? e.startInline.push(r.start) : e.startInline = [r.start]));
|
|
2045
2104
|
}
|
|
2046
2105
|
"childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
|
|
2047
2106
|
}), s.extensions = e), n.renderer) {
|
|
2048
|
-
let r = this.defaults.renderer || new
|
|
2049
|
-
for (let
|
|
2050
|
-
if (!(
|
|
2051
|
-
if (["options", "parser"].includes(
|
|
2052
|
-
let o =
|
|
2107
|
+
let r = this.defaults.renderer || new Et(this.defaults);
|
|
2108
|
+
for (let l in n.renderer) {
|
|
2109
|
+
if (!(l in r)) throw new Error(`renderer '${l}' does not exist`);
|
|
2110
|
+
if (["options", "parser"].includes(l)) continue;
|
|
2111
|
+
let o = l, c = n.renderer[o], p = r[o];
|
|
2053
2112
|
r[o] = (...g) => {
|
|
2054
2113
|
let d = c.apply(r, g);
|
|
2055
|
-
return d === !1 && (d =
|
|
2114
|
+
return d === !1 && (d = p.apply(r, g)), d || "";
|
|
2056
2115
|
};
|
|
2057
2116
|
}
|
|
2058
2117
|
s.renderer = r;
|
|
2059
2118
|
}
|
|
2060
2119
|
if (n.tokenizer) {
|
|
2061
|
-
let r = this.defaults.tokenizer || new
|
|
2062
|
-
for (let
|
|
2063
|
-
if (!(
|
|
2064
|
-
if (["options", "rules", "lexer"].includes(
|
|
2065
|
-
let o =
|
|
2120
|
+
let r = this.defaults.tokenizer || new At(this.defaults);
|
|
2121
|
+
for (let l in n.tokenizer) {
|
|
2122
|
+
if (!(l in r)) throw new Error(`tokenizer '${l}' does not exist`);
|
|
2123
|
+
if (["options", "rules", "lexer"].includes(l)) continue;
|
|
2124
|
+
let o = l, c = n.tokenizer[o], p = r[o];
|
|
2066
2125
|
r[o] = (...g) => {
|
|
2067
2126
|
let d = c.apply(r, g);
|
|
2068
|
-
return d === !1 && (d =
|
|
2127
|
+
return d === !1 && (d = p.apply(r, g)), d;
|
|
2069
2128
|
};
|
|
2070
2129
|
}
|
|
2071
2130
|
s.tokenizer = r;
|
|
2072
2131
|
}
|
|
2073
2132
|
if (n.hooks) {
|
|
2074
|
-
let r = this.defaults.hooks || new
|
|
2075
|
-
for (let
|
|
2076
|
-
if (!(
|
|
2077
|
-
if (["options", "block"].includes(
|
|
2078
|
-
let o =
|
|
2079
|
-
|
|
2080
|
-
if (this.defaults.async &&
|
|
2081
|
-
let
|
|
2082
|
-
return
|
|
2133
|
+
let r = this.defaults.hooks || new ot();
|
|
2134
|
+
for (let l in n.hooks) {
|
|
2135
|
+
if (!(l in r)) throw new Error(`hook '${l}' does not exist`);
|
|
2136
|
+
if (["options", "block"].includes(l)) continue;
|
|
2137
|
+
let o = l, c = n.hooks[o], p = r[o];
|
|
2138
|
+
ot.passThroughHooks.has(l) ? r[o] = (g) => {
|
|
2139
|
+
if (this.defaults.async && ot.passThroughHooksRespectAsync.has(l)) return (async () => {
|
|
2140
|
+
let f = await c.call(r, g);
|
|
2141
|
+
return p.call(r, f);
|
|
2083
2142
|
})();
|
|
2084
2143
|
let d = c.call(r, g);
|
|
2085
|
-
return
|
|
2144
|
+
return p.call(r, d);
|
|
2086
2145
|
} : r[o] = (...g) => {
|
|
2087
2146
|
if (this.defaults.async) return (async () => {
|
|
2088
|
-
let
|
|
2089
|
-
return
|
|
2147
|
+
let f = await c.apply(r, g);
|
|
2148
|
+
return f === !1 && (f = await p.apply(r, g)), f;
|
|
2090
2149
|
})();
|
|
2091
2150
|
let d = c.apply(r, g);
|
|
2092
|
-
return d === !1 && (d =
|
|
2151
|
+
return d === !1 && (d = p.apply(r, g)), d;
|
|
2093
2152
|
};
|
|
2094
2153
|
}
|
|
2095
2154
|
s.hooks = r;
|
|
2096
2155
|
}
|
|
2097
2156
|
if (n.walkTokens) {
|
|
2098
|
-
let r = this.defaults.walkTokens,
|
|
2157
|
+
let r = this.defaults.walkTokens, l = n.walkTokens;
|
|
2099
2158
|
s.walkTokens = function(o) {
|
|
2100
2159
|
let c = [];
|
|
2101
|
-
return c.push(
|
|
2160
|
+
return c.push(l.call(this, o)), r && (c = c.concat(r.call(this, o))), c;
|
|
2102
2161
|
};
|
|
2103
2162
|
}
|
|
2104
2163
|
this.defaults = { ...this.defaults, ...s };
|
|
@@ -2108,31 +2167,31 @@ ${t}</tr>
|
|
|
2108
2167
|
return this.defaults = { ...this.defaults, ...t }, this;
|
|
2109
2168
|
}
|
|
2110
2169
|
lexer(t, e) {
|
|
2111
|
-
return
|
|
2170
|
+
return fe.lex(t, e ?? this.defaults);
|
|
2112
2171
|
}
|
|
2113
2172
|
parser(t, e) {
|
|
2114
|
-
return
|
|
2173
|
+
return ge.parse(t, e ?? this.defaults);
|
|
2115
2174
|
}
|
|
2116
2175
|
parseMarkdown(t) {
|
|
2117
2176
|
return (e, n) => {
|
|
2118
|
-
let s = { ...n }, r = { ...this.defaults, ...s },
|
|
2119
|
-
if (this.defaults.async === !0 && s.async === !1) return
|
|
2120
|
-
if (typeof e > "u" || e === null) return
|
|
2121
|
-
if (typeof e != "string") return
|
|
2177
|
+
let s = { ...n }, r = { ...this.defaults, ...s }, l = this.onError(!!r.silent, !!r.async);
|
|
2178
|
+
if (this.defaults.async === !0 && s.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."));
|
|
2179
|
+
if (typeof e > "u" || e === null) return l(new Error("marked(): input parameter is undefined or null"));
|
|
2180
|
+
if (typeof e != "string") return l(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
2122
2181
|
if (r.hooks && (r.hooks.options = r, r.hooks.block = t), r.async) return (async () => {
|
|
2123
|
-
let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer(t) : t ?
|
|
2124
|
-
r.walkTokens && await Promise.all(this.walkTokens(
|
|
2125
|
-
let g = await (r.hooks ? await r.hooks.provideParser(t) : t ?
|
|
2182
|
+
let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(o, r), p = r.hooks ? await r.hooks.processAllTokens(c) : c;
|
|
2183
|
+
r.walkTokens && await Promise.all(this.walkTokens(p, r.walkTokens));
|
|
2184
|
+
let g = await (r.hooks ? await r.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(p, r);
|
|
2126
2185
|
return r.hooks ? await r.hooks.postprocess(g) : g;
|
|
2127
|
-
})().catch(
|
|
2186
|
+
})().catch(l);
|
|
2128
2187
|
try {
|
|
2129
2188
|
r.hooks && (e = r.hooks.preprocess(e));
|
|
2130
|
-
let o = (r.hooks ? r.hooks.provideLexer(t) : t ?
|
|
2189
|
+
let o = (r.hooks ? r.hooks.provideLexer(t) : t ? fe.lex : fe.lexInline)(e, r);
|
|
2131
2190
|
r.hooks && (o = r.hooks.processAllTokens(o)), r.walkTokens && this.walkTokens(o, r.walkTokens);
|
|
2132
|
-
let c = (r.hooks ? r.hooks.provideParser(t) : t ?
|
|
2191
|
+
let c = (r.hooks ? r.hooks.provideParser(t) : t ? ge.parse : ge.parseInline)(o, r);
|
|
2133
2192
|
return r.hooks && (c = r.hooks.postprocess(c)), c;
|
|
2134
2193
|
} catch (o) {
|
|
2135
|
-
return
|
|
2194
|
+
return l(o);
|
|
2136
2195
|
}
|
|
2137
2196
|
};
|
|
2138
2197
|
}
|
|
@@ -2140,77 +2199,80 @@ ${t}</tr>
|
|
|
2140
2199
|
return (n) => {
|
|
2141
2200
|
if (n.message += `
|
|
2142
2201
|
Please report this to https://github.com/markedjs/marked.`, t) {
|
|
2143
|
-
let s = "<p>An error occurred:</p><pre>" +
|
|
2202
|
+
let s = "<p>An error occurred:</p><pre>" + ke(n.message + "", !0) + "</pre>";
|
|
2144
2203
|
return e ? Promise.resolve(s) : s;
|
|
2145
2204
|
}
|
|
2146
2205
|
if (e) return Promise.reject(n);
|
|
2147
2206
|
throw n;
|
|
2148
2207
|
};
|
|
2149
2208
|
}
|
|
2150
|
-
}, h(
|
|
2151
|
-
function M(
|
|
2152
|
-
return
|
|
2209
|
+
}, h(We, "D"), We), Me = new si();
|
|
2210
|
+
function M(a, t) {
|
|
2211
|
+
return Me.parse(a, t);
|
|
2153
2212
|
}
|
|
2154
2213
|
h(M, "g");
|
|
2155
|
-
M.options = M.setOptions = function(
|
|
2156
|
-
return
|
|
2214
|
+
M.options = M.setOptions = function(a) {
|
|
2215
|
+
return Me.setOptions(a), M.defaults = Me.defaults, cs(M.defaults), M;
|
|
2157
2216
|
};
|
|
2158
|
-
M.getDefaults =
|
|
2159
|
-
M.defaults =
|
|
2160
|
-
M.use = function(...
|
|
2161
|
-
return
|
|
2217
|
+
M.getDefaults = sn;
|
|
2218
|
+
M.defaults = Oe;
|
|
2219
|
+
M.use = function(...a) {
|
|
2220
|
+
return Me.use(...a), M.defaults = Me.defaults, cs(M.defaults), M;
|
|
2162
2221
|
};
|
|
2163
|
-
M.walkTokens = function(
|
|
2164
|
-
return
|
|
2222
|
+
M.walkTokens = function(a, t) {
|
|
2223
|
+
return Me.walkTokens(a, t);
|
|
2165
2224
|
};
|
|
2166
|
-
M.parseInline =
|
|
2167
|
-
M.Parser =
|
|
2168
|
-
M.parser =
|
|
2169
|
-
M.Renderer =
|
|
2170
|
-
M.TextRenderer =
|
|
2171
|
-
M.Lexer =
|
|
2172
|
-
M.lexer =
|
|
2173
|
-
M.Tokenizer =
|
|
2174
|
-
M.Hooks =
|
|
2225
|
+
M.parseInline = Me.parseInline;
|
|
2226
|
+
M.Parser = ge;
|
|
2227
|
+
M.parser = ge.parse;
|
|
2228
|
+
M.Renderer = Et;
|
|
2229
|
+
M.TextRenderer = pn;
|
|
2230
|
+
M.Lexer = fe;
|
|
2231
|
+
M.lexer = fe.lex;
|
|
2232
|
+
M.Tokenizer = At;
|
|
2233
|
+
M.Hooks = ot;
|
|
2175
2234
|
M.parse = M;
|
|
2176
2235
|
M.options;
|
|
2177
2236
|
M.setOptions;
|
|
2178
2237
|
M.use;
|
|
2179
2238
|
M.walkTokens;
|
|
2180
2239
|
M.parseInline;
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
const
|
|
2240
|
+
ge.parse;
|
|
2241
|
+
fe.lex;
|
|
2242
|
+
const ri = { class: "@container/chat flex flex-col h-full relative" }, ii = {
|
|
2184
2243
|
key: 0,
|
|
2185
2244
|
class: "pb-4"
|
|
2186
|
-
},
|
|
2245
|
+
}, ai = {
|
|
2187
2246
|
key: 0,
|
|
2188
2247
|
class: "flex flex-col items-center justify-center px-4 min-h-full"
|
|
2189
|
-
},
|
|
2248
|
+
}, li = { class: "relative mb-4 size-20 @sm/chat:size-24" }, oi = ["src", "alt"], ci = {
|
|
2249
|
+
key: 0,
|
|
2250
|
+
class: "mt-5 flex flex-col items-stretch gap-2 w-full max-w-xs"
|
|
2251
|
+
}, ui = ["onClick"], hi = ["title"], pi = {
|
|
2190
2252
|
key: 1,
|
|
2191
2253
|
class: "flex justify-end px-2 pb-2"
|
|
2192
|
-
},
|
|
2254
|
+
}, di = {
|
|
2193
2255
|
key: 0,
|
|
2194
2256
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2195
|
-
},
|
|
2257
|
+
}, fi = ["data-issue-code", "data-issue-bucket"], gi = { class: "flex flex-col gap-1 min-w-0" }, mi = ["href"], bi = ["data-test"], xi = {
|
|
2196
2258
|
key: 0,
|
|
2197
2259
|
class: "flex-shrink-0 size-7 @sm/chat:size-8"
|
|
2198
|
-
},
|
|
2260
|
+
}, ki = ["src", "alt"], wi = ["src", "alt"], yi = ["src"], vi = ["href"], Ti = ["innerHTML"], Si = {
|
|
2199
2261
|
key: 2,
|
|
2200
2262
|
class: "flex gap-2 justify-start items-center mb-4"
|
|
2201
|
-
},
|
|
2263
|
+
}, Ai = ["src", "alt"], Ei = {
|
|
2202
2264
|
key: 0,
|
|
2203
2265
|
class: "flex items-center gap-2 px-2 pb-2 overflow-x-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
|
|
2204
|
-
},
|
|
2266
|
+
}, _i = ["src", "alt"], Ri = { class: "max-w-20 truncate" }, Ii = ["onClick"], Di = {
|
|
2205
2267
|
key: 0,
|
|
2206
2268
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2207
|
-
},
|
|
2269
|
+
}, Ci = ["disabled"], Mi = {
|
|
2208
2270
|
key: 0,
|
|
2209
2271
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2210
|
-
},
|
|
2272
|
+
}, Li = {
|
|
2211
2273
|
key: 1,
|
|
2212
2274
|
class: "i-tabler-paperclip size-5"
|
|
2213
|
-
},
|
|
2275
|
+
}, Oi = ["placeholder", "disabled"], zi = ["disabled"], Vi = /* @__PURE__ */ Le({
|
|
2214
2276
|
__name: "ElAgentChat",
|
|
2215
2277
|
props: {
|
|
2216
2278
|
chatController: {},
|
|
@@ -2220,25 +2282,26 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2220
2282
|
scope: { default: "private" },
|
|
2221
2283
|
scopeName: {},
|
|
2222
2284
|
setupHint: {},
|
|
2223
|
-
emptyStateMessage: {}
|
|
2285
|
+
emptyStateMessage: {},
|
|
2286
|
+
starterPrompts: {}
|
|
2224
2287
|
},
|
|
2225
|
-
setup(
|
|
2288
|
+
setup(a) {
|
|
2226
2289
|
const t = new M.Renderer();
|
|
2227
|
-
t.link = ({ href:
|
|
2228
|
-
let
|
|
2290
|
+
t.link = ({ href: _, text: x }) => {
|
|
2291
|
+
let b = !1;
|
|
2229
2292
|
if (typeof window < "u")
|
|
2230
2293
|
try {
|
|
2231
|
-
|
|
2294
|
+
b = new URL(_, window.location.href).origin === window.location.origin;
|
|
2232
2295
|
} catch {
|
|
2233
|
-
|
|
2296
|
+
b = !1;
|
|
2234
2297
|
}
|
|
2235
|
-
return
|
|
2298
|
+
return b ? `<a href="${_}">${x}</a>` : `<a href="${_}" target="_blank" rel="noopener noreferrer">${x}</a>`;
|
|
2236
2299
|
}, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
|
|
2237
|
-
function e(
|
|
2238
|
-
if (!
|
|
2300
|
+
function e(_) {
|
|
2301
|
+
if (!_)
|
|
2239
2302
|
return "";
|
|
2240
|
-
const
|
|
2241
|
-
return
|
|
2303
|
+
const x = M.parse(_, { async: !1 });
|
|
2304
|
+
return mr.sanitize(x, { ADD_ATTR: ["target"], ADD_DATA_URI_TAGS: ["img"] });
|
|
2242
2305
|
}
|
|
2243
2306
|
h(e, "renderMarkdown");
|
|
2244
2307
|
const n = {
|
|
@@ -2249,398 +2312,417 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2249
2312
|
private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
|
|
2250
2313
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
2251
2314
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
2252
|
-
}, r =
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2315
|
+
}, r = [
|
|
2316
|
+
"Brief me on tomorrow",
|
|
2317
|
+
"Triage my inbox",
|
|
2318
|
+
"What's on my plate this week"
|
|
2319
|
+
], l = G(
|
|
2320
|
+
() => a.starterPrompts ?? r
|
|
2321
|
+
), o = G(() => a.setupHint ?? n[a.scope]), c = G(() => {
|
|
2322
|
+
const _ = { ...s[a.scope] };
|
|
2323
|
+
return a.scope === "org" && a.scopeName && (_.label = a.scopeName, _.tooltip = `Visible to ${a.scopeName} members`), _;
|
|
2324
|
+
}), p = ee(""), g = ee(!1), d = ee(), f = ee(), m = ee(), w = ee([]), E = ee(!1);
|
|
2325
|
+
function O(_, x) {
|
|
2326
|
+
const b = _[x], L = _[x + 1];
|
|
2327
|
+
return !L || L.sender !== b.sender;
|
|
2328
|
+
}
|
|
2329
|
+
h(O, "shouldShowAvatar");
|
|
2330
|
+
const U = G(() => a.chatController?.textState.value), ae = G(() => U.value?.isConnected ?? !1), le = G(() => U.value?.isThinking ?? !1), z = G(() => U.value?.connectionStatus === "disconnected" && !!U.value?.error), oe = G(() => U.value?.connectionStatus !== "connected" && !U.value?.error), me = G(() => U.value?.error), V = G(() => a.chatController?.sharedMessages.value ?? []), ht = G(() => U.value?.accountGated ?? !1), _e = G(() => !ae.value || ht.value), It = G(() => z.value ? "Agent is offline" : oe.value ? "Connecting..." : ht.value ? "Resolve the billing issue above to continue" : "Message"), Y = G(() => (p.value.trim() || w.value.length > 0) && !_e.value && !E.value), I = G(() => a.variant === "light"), Re = G(
|
|
2262
2331
|
() => I.value ? "bg-gradient-to-r from-transparent via-black/5 to-transparent" : "bg-gradient-to-r from-transparent via-white/5 to-transparent"
|
|
2263
|
-
),
|
|
2264
|
-
|
|
2265
|
-
if (
|
|
2332
|
+
), ve = G(() => I.value ? "text-theme-300" : "text-white/30");
|
|
2333
|
+
nn(async () => {
|
|
2334
|
+
if (a.chatController && !ae.value)
|
|
2266
2335
|
try {
|
|
2267
|
-
await
|
|
2268
|
-
} catch (
|
|
2269
|
-
console.error("Failed to start text conversation:",
|
|
2336
|
+
await a.chatController.startTextConversation();
|
|
2337
|
+
} catch (_) {
|
|
2338
|
+
console.error("Failed to start text conversation:", _);
|
|
2270
2339
|
}
|
|
2271
2340
|
});
|
|
2272
|
-
function
|
|
2273
|
-
|
|
2341
|
+
function Dt() {
|
|
2342
|
+
a.chatController?.newConversation();
|
|
2274
2343
|
}
|
|
2275
|
-
h(
|
|
2276
|
-
async function
|
|
2277
|
-
const
|
|
2278
|
-
if (!
|
|
2344
|
+
h(Dt, "startNewConversation");
|
|
2345
|
+
async function Ve() {
|
|
2346
|
+
const _ = p.value.trim(), x = w.value.length > 0;
|
|
2347
|
+
if (!_ && !x || !a.chatController || !ae.value || E.value)
|
|
2279
2348
|
return;
|
|
2280
|
-
const
|
|
2281
|
-
|
|
2349
|
+
const b = p.value, L = x ? [...w.value] : void 0;
|
|
2350
|
+
p.value = "", w.value = [], f.value && (f.value.style.height = "auto", f.value.focus());
|
|
2282
2351
|
try {
|
|
2283
|
-
await
|
|
2284
|
-
} catch (
|
|
2285
|
-
console.error("Error sending message:",
|
|
2352
|
+
await a.chatController.sendChatMessage(b, L), dt();
|
|
2353
|
+
} catch (Z) {
|
|
2354
|
+
console.error("Error sending message:", Z);
|
|
2286
2355
|
}
|
|
2287
2356
|
}
|
|
2288
|
-
h(
|
|
2289
|
-
function
|
|
2290
|
-
|
|
2357
|
+
h(Ve, "sendMessage");
|
|
2358
|
+
function Ct(_) {
|
|
2359
|
+
_e.value || (p.value = _, Ve());
|
|
2360
|
+
}
|
|
2361
|
+
h(Ct, "sendStarterPrompt");
|
|
2362
|
+
function pt(_) {
|
|
2363
|
+
_.key === "Enter" && !_.shiftKey && (_.preventDefault(), Ve());
|
|
2291
2364
|
}
|
|
2292
|
-
h(
|
|
2293
|
-
function
|
|
2294
|
-
|
|
2295
|
-
|
|
2365
|
+
h(pt, "handleKeydown");
|
|
2366
|
+
function dt() {
|
|
2367
|
+
d.value && Wt(() => {
|
|
2368
|
+
d.value.scrollTop = d.value.scrollHeight;
|
|
2296
2369
|
});
|
|
2297
2370
|
}
|
|
2298
|
-
h(
|
|
2299
|
-
function
|
|
2300
|
-
|
|
2371
|
+
h(dt, "scrollToBottom");
|
|
2372
|
+
function ft() {
|
|
2373
|
+
f.value && (f.value.style.height = "auto", f.value.style.height = `${Math.min(f.value.scrollHeight, 150)}px`);
|
|
2301
2374
|
}
|
|
2302
|
-
h(
|
|
2303
|
-
function
|
|
2304
|
-
|
|
2375
|
+
h(ft, "adjustTextareaHeight"), ct(p, () => Wt(() => ft()));
|
|
2376
|
+
function F() {
|
|
2377
|
+
m.value?.click();
|
|
2305
2378
|
}
|
|
2306
|
-
h(
|
|
2307
|
-
async function
|
|
2308
|
-
const
|
|
2309
|
-
if (!(!
|
|
2310
|
-
|
|
2379
|
+
h(F, "triggerFileInput");
|
|
2380
|
+
async function gt(_) {
|
|
2381
|
+
const x = _.target, b = x.files?.[0];
|
|
2382
|
+
if (!(!b || !a.uploadFn)) {
|
|
2383
|
+
E.value = !0;
|
|
2311
2384
|
try {
|
|
2312
|
-
const L = await
|
|
2313
|
-
|
|
2385
|
+
const L = await a.uploadFn(b);
|
|
2386
|
+
w.value = [...w.value, L];
|
|
2314
2387
|
} catch (L) {
|
|
2315
2388
|
console.error("Upload failed:", L);
|
|
2316
2389
|
} finally {
|
|
2317
|
-
|
|
2390
|
+
E.value = !1, x.value = "";
|
|
2318
2391
|
}
|
|
2319
2392
|
}
|
|
2320
2393
|
}
|
|
2321
|
-
h(
|
|
2322
|
-
function
|
|
2323
|
-
|
|
2394
|
+
h(gt, "handleFileSelect");
|
|
2395
|
+
function W(_) {
|
|
2396
|
+
w.value = w.value.filter((x, b) => b !== _);
|
|
2324
2397
|
}
|
|
2325
|
-
h(
|
|
2326
|
-
function
|
|
2327
|
-
if (
|
|
2328
|
-
const
|
|
2329
|
-
return
|
|
2398
|
+
h(W, "removeAttachment");
|
|
2399
|
+
function Ye(_, x) {
|
|
2400
|
+
if (x === 0) {
|
|
2401
|
+
const he = _[x];
|
|
2402
|
+
return he?.timestamp ? P(new Date(he.timestamp)) : null;
|
|
2330
2403
|
}
|
|
2331
|
-
const
|
|
2332
|
-
if (!
|
|
2333
|
-
const
|
|
2334
|
-
return new Date(L.timestamp).getTime() -
|
|
2404
|
+
const b = _[x - 1], L = _[x];
|
|
2405
|
+
if (!b?.timestamp || !L?.timestamp) return null;
|
|
2406
|
+
const Z = new Date(b.timestamp).getTime();
|
|
2407
|
+
return new Date(L.timestamp).getTime() - Z > 36e5 ? P(new Date(L.timestamp)) : null;
|
|
2335
2408
|
}
|
|
2336
|
-
h(
|
|
2337
|
-
function
|
|
2338
|
-
const
|
|
2409
|
+
h(Ye, "shouldShowTimeDivider");
|
|
2410
|
+
function P(_) {
|
|
2411
|
+
const x = /* @__PURE__ */ new Date(), b = _.toDateString() === x.toDateString(), L = new Date(x);
|
|
2339
2412
|
L.setDate(L.getDate() - 1);
|
|
2340
|
-
const
|
|
2341
|
-
if (
|
|
2342
|
-
if (
|
|
2343
|
-
const
|
|
2344
|
-
return `${
|
|
2413
|
+
const Z = _.toDateString() === L.toDateString(), we = _.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2414
|
+
if (b) return we;
|
|
2415
|
+
if (Z) return `Yesterday, ${we}`;
|
|
2416
|
+
const Ze = _.getFullYear() === x.getFullYear();
|
|
2417
|
+
return `${_.toLocaleDateString("en-US", {
|
|
2345
2418
|
weekday: "long",
|
|
2346
2419
|
month: "short",
|
|
2347
2420
|
day: "numeric",
|
|
2348
|
-
...
|
|
2349
|
-
})}, ${
|
|
2350
|
-
}
|
|
2351
|
-
return h(
|
|
2352
|
-
|
|
2353
|
-
}, { immediate: !0, deep: !0 }), (
|
|
2354
|
-
I.value ?
|
|
2355
|
-
|
|
2356
|
-
agent:
|
|
2357
|
-
"is-online":
|
|
2421
|
+
...Ze ? {} : { year: "numeric" }
|
|
2422
|
+
})}, ${we}`;
|
|
2423
|
+
}
|
|
2424
|
+
return h(P, "formatTimeDivider"), ct(V, (_) => {
|
|
2425
|
+
_.length > 0 && Wt(() => dt());
|
|
2426
|
+
}, { immediate: !0, deep: !0 }), (_, x) => (T(), S("div", ri, [
|
|
2427
|
+
I.value ? B("", !0) : (T(), S("div", ii, [
|
|
2428
|
+
qt(Ws, {
|
|
2429
|
+
agent: a.agent,
|
|
2430
|
+
"is-online": ae.value
|
|
2358
2431
|
}, null, 8, ["agent", "is-online"])
|
|
2359
2432
|
])),
|
|
2360
|
-
|
|
2433
|
+
z.value ? (T(), S("div", {
|
|
2361
2434
|
key: 1,
|
|
2362
|
-
class:
|
|
2435
|
+
class: A(["py-16 flex flex-col items-center justify-center gap-3 text-sm", I.value ? "text-theme-400" : "text-white/60"])
|
|
2363
2436
|
}, [
|
|
2364
|
-
|
|
2365
|
-
class:
|
|
2437
|
+
y("i", {
|
|
2438
|
+
class: A(["i-heroicons-cloud-arrow-down size-8", I.value ? "text-theme-300" : "text-white/40"])
|
|
2366
2439
|
}, null, 2),
|
|
2367
|
-
|
|
2368
|
-
], 2)) :
|
|
2440
|
+
y("span", null, ie(me.value), 1)
|
|
2441
|
+
], 2)) : oe.value ? (T(), S("div", {
|
|
2369
2442
|
key: 2,
|
|
2370
|
-
class:
|
|
2443
|
+
class: A(["py-16 flex flex-col items-center justify-center gap-2 text-sm", I.value ? "text-theme-400" : "text-theme-600"])
|
|
2371
2444
|
}, [
|
|
2372
|
-
|
|
2373
|
-
], 2)) :
|
|
2445
|
+
qt(Ln, { class: "size-4" })
|
|
2446
|
+
], 2)) : o.value ? (T(), S("div", {
|
|
2374
2447
|
key: 3,
|
|
2375
|
-
class:
|
|
2448
|
+
class: A(["flex items-center justify-center gap-1.5 py-2 text-[11px]", ve.value])
|
|
2376
2449
|
}, [
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
], 2)) :
|
|
2380
|
-
|
|
2450
|
+
x[6] || (x[6] = y("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2451
|
+
y("span", null, ie(o.value), 1)
|
|
2452
|
+
], 2)) : B("", !0),
|
|
2453
|
+
y("div", {
|
|
2381
2454
|
ref_key: "messagesContainer",
|
|
2382
|
-
ref:
|
|
2455
|
+
ref: d,
|
|
2383
2456
|
class: "flex-1 overflow-y-auto overflow-x-hidden pt-4 pb-[120px] px-3 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
|
2384
2457
|
}, [
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
src:
|
|
2389
|
-
alt:
|
|
2390
|
-
class:
|
|
2391
|
-
}, null, 10,
|
|
2392
|
-
|
|
2458
|
+
V.value.length === 0 && !oe.value && !z.value ? (T(), S("div", ai, [
|
|
2459
|
+
y("div", li, [
|
|
2460
|
+
y("img", {
|
|
2461
|
+
src: a.agent.avatarUrl.value,
|
|
2462
|
+
alt: a.agent.displayName.value,
|
|
2463
|
+
class: A(["size-full rounded-full object-cover ring-1", I.value ? "ring-black/5" : "ring-white/10"])
|
|
2464
|
+
}, null, 10, oi),
|
|
2465
|
+
ae.value ? (T(), S("span", {
|
|
2393
2466
|
key: 0,
|
|
2394
|
-
class:
|
|
2395
|
-
}, [...
|
|
2396
|
-
|
|
2397
|
-
])], 2)) :
|
|
2467
|
+
class: A(["absolute top-[85%] left-[85%] -translate-x-1/2 -translate-y-1/2 size-[18%] min-w-2.5 min-h-2.5 flex items-center justify-center rounded-full", I.value ? "bg-white" : "bg-theme-900"])
|
|
2468
|
+
}, [...x[7] || (x[7] = [
|
|
2469
|
+
y("span", { class: "size-[70%] inline-flex rounded-full bg-emerald-500" }, null, -1)
|
|
2470
|
+
])], 2)) : B("", !0)
|
|
2398
2471
|
]),
|
|
2399
|
-
|
|
2400
|
-
class:
|
|
2401
|
-
},
|
|
2402
|
-
|
|
2403
|
-
class:
|
|
2404
|
-
},
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2472
|
+
y("div", {
|
|
2473
|
+
class: A(["text-base @sm/chat:text-lg font-semibold", I.value ? "text-theme-900" : "text-white"])
|
|
2474
|
+
}, ie(a.agent.displayName.value), 3),
|
|
2475
|
+
y("p", {
|
|
2476
|
+
class: A(["mt-1 text-center text-xs @sm/chat:text-sm", ve.value])
|
|
2477
|
+
}, ie(a.emptyStateMessage || "Tap a prompt to get started, or type your own."), 3),
|
|
2478
|
+
l.value.length > 0 && !_e.value ? (T(), S("div", ci, [
|
|
2479
|
+
(T(!0), S(Te, null, at(l.value, (b) => (T(), S("button", {
|
|
2480
|
+
key: b,
|
|
2481
|
+
type: "button",
|
|
2482
|
+
"data-test": "chat-starter-prompt",
|
|
2483
|
+
class: A(["text-left text-sm rounded-2xl px-4 py-2.5 transition-colors cursor-pointer", I.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"]),
|
|
2484
|
+
onClick: /* @__PURE__ */ h((L) => Ct(b), "onClick")
|
|
2485
|
+
}, ie(b), 11, ui))), 128))
|
|
2486
|
+
])) : B("", !0),
|
|
2487
|
+
y("div", {
|
|
2488
|
+
class: A(["inline-flex items-center gap-1.5 mt-5 px-2.5 py-1 rounded-full text-[11px]", I.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2489
|
+
title: c.value.tooltip
|
|
2408
2490
|
}, [
|
|
2409
|
-
|
|
2410
|
-
class:
|
|
2491
|
+
y("i", {
|
|
2492
|
+
class: A([c.value.icon, "size-3"])
|
|
2411
2493
|
}, null, 2),
|
|
2412
|
-
|
|
2413
|
-
], 10,
|
|
2414
|
-
])) :
|
|
2415
|
-
|
|
2416
|
-
|
|
2494
|
+
y("span", null, ie(c.value.label), 1)
|
|
2495
|
+
], 10, hi)
|
|
2496
|
+
])) : B("", !0),
|
|
2497
|
+
V.value.length > 0 ? (T(), S("div", pi, [
|
|
2498
|
+
y("button", {
|
|
2417
2499
|
type: "button",
|
|
2418
2500
|
"data-test": "chat-new-session",
|
|
2419
|
-
class:
|
|
2420
|
-
onClick:
|
|
2421
|
-
}, [...
|
|
2422
|
-
|
|
2423
|
-
|
|
2501
|
+
class: A(["inline-flex items-center gap-1 text-[11px] rounded-full px-2 py-1 transition-colors", I.value ? "text-theme-400 hover:text-theme-700 hover:bg-theme-50" : "text-white/40 hover:text-white hover:bg-white/5"]),
|
|
2502
|
+
onClick: Dt
|
|
2503
|
+
}, [...x[8] || (x[8] = [
|
|
2504
|
+
y("i", { class: "i-tabler-refresh size-3" }, null, -1),
|
|
2505
|
+
y("span", null, "New chat", -1)
|
|
2424
2506
|
])], 2)
|
|
2425
|
-
])) :
|
|
2426
|
-
(
|
|
2427
|
-
key:
|
|
2507
|
+
])) : B("", !0),
|
|
2508
|
+
(T(!0), S(Te, null, at(V.value, (b, L) => (T(), S(Te, {
|
|
2509
|
+
key: b.id
|
|
2428
2510
|
}, [
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
class:
|
|
2511
|
+
Ye(V.value, L) ? (T(), S("div", di, [
|
|
2512
|
+
y("div", {
|
|
2513
|
+
class: A(["flex-1 h-px", Re.value])
|
|
2432
2514
|
}, null, 2),
|
|
2433
|
-
|
|
2434
|
-
class:
|
|
2435
|
-
},
|
|
2436
|
-
|
|
2437
|
-
class:
|
|
2515
|
+
y("span", {
|
|
2516
|
+
class: A(["text-[10px] @sm/chat:text-[11px] font-medium shrink-0 tracking-widest uppercase", ve.value])
|
|
2517
|
+
}, ie(Ye(V.value, L)), 3),
|
|
2518
|
+
y("div", {
|
|
2519
|
+
class: A(["flex-1 h-px", Re.value])
|
|
2438
2520
|
}, null, 2)
|
|
2439
|
-
])) :
|
|
2440
|
-
|
|
2521
|
+
])) : B("", !0),
|
|
2522
|
+
b.sender === "system" ? (T(), S("div", {
|
|
2441
2523
|
key: 1,
|
|
2442
2524
|
"data-test": "messaging-system-msg",
|
|
2443
|
-
"data-issue-code":
|
|
2444
|
-
"data-issue-bucket":
|
|
2445
|
-
class:
|
|
2525
|
+
"data-issue-code": b.issue?.code,
|
|
2526
|
+
"data-issue-bucket": b.issue?.bucket,
|
|
2527
|
+
class: A(["flex items-start gap-2 px-3 py-2 text-[13px] leading-relaxed", I.value ? "text-theme-500" : "text-white/70"])
|
|
2446
2528
|
}, [
|
|
2447
|
-
|
|
2448
|
-
class:
|
|
2529
|
+
y("i", {
|
|
2530
|
+
class: A(["i-tabler-alert-circle size-4 mt-0.5 shrink-0", b.issue?.bucket === "account" ? I.value ? "text-amber-500" : "text-amber-300" : I.value ? "text-red-500" : "text-red-300"])
|
|
2449
2531
|
}, null, 2),
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2532
|
+
y("div", gi, [
|
|
2533
|
+
y("span", null, ie(b.text), 1),
|
|
2534
|
+
b.issue?.help ? (T(), S("span", {
|
|
2453
2535
|
key: 0,
|
|
2454
|
-
class:
|
|
2455
|
-
},
|
|
2456
|
-
|
|
2536
|
+
class: A(["text-[12px]", I.value ? "text-theme-400" : "text-white/55"])
|
|
2537
|
+
}, ie(b.issue.help), 3)) : B("", !0),
|
|
2538
|
+
b.issue?.actionUrl ? (T(), S("a", {
|
|
2457
2539
|
key: 1,
|
|
2458
|
-
href:
|
|
2540
|
+
href: b.issue.actionUrl,
|
|
2459
2541
|
"data-test": "messaging-system-msg-action",
|
|
2460
|
-
class:
|
|
2542
|
+
class: A(["text-[12px] font-medium inline-flex items-center gap-1", I.value ? "text-theme-900 hover:text-theme-700" : "text-white hover:text-white/80"])
|
|
2461
2543
|
}, [
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
], 10,
|
|
2544
|
+
Je(ie(b.issue.actionLabel) + " ", 1),
|
|
2545
|
+
x[9] || (x[9] = y("i", { class: "i-tabler-arrow-right size-3" }, null, -1))
|
|
2546
|
+
], 10, mi)) : B("", !0)
|
|
2465
2547
|
])
|
|
2466
|
-
], 10,
|
|
2548
|
+
], 10, fi)) : (T(), S("div", {
|
|
2467
2549
|
key: 2,
|
|
2468
|
-
"data-test":
|
|
2469
|
-
class:
|
|
2470
|
-
"justify-end":
|
|
2471
|
-
"justify-start":
|
|
2472
|
-
"mb-4":
|
|
2550
|
+
"data-test": b.sender === "agent" ? "messaging-assistant-msg" : b.sender === "user" ? "messaging-user-msg" : void 0,
|
|
2551
|
+
class: A(["flex gap-2 items-end", {
|
|
2552
|
+
"justify-end": b.sender === "user",
|
|
2553
|
+
"justify-start": b.sender === "agent",
|
|
2554
|
+
"mb-4": O(V.value, L)
|
|
2473
2555
|
}])
|
|
2474
2556
|
}, [
|
|
2475
|
-
|
|
2476
|
-
|
|
2557
|
+
b.sender === "agent" ? (T(), S("div", xi, [
|
|
2558
|
+
O(V.value, L) ? (T(), S("img", {
|
|
2477
2559
|
key: 0,
|
|
2478
|
-
src:
|
|
2479
|
-
alt:
|
|
2480
|
-
class:
|
|
2481
|
-
}, null, 10,
|
|
2482
|
-
])) :
|
|
2483
|
-
|
|
2484
|
-
class:
|
|
2560
|
+
src: a.agent.avatarUrl.value,
|
|
2561
|
+
alt: a.agent.displayName.value,
|
|
2562
|
+
class: A(["size-6 @sm/chat:size-7 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
|
|
2563
|
+
}, null, 10, ki)) : B("", !0)
|
|
2564
|
+
])) : B("", !0),
|
|
2565
|
+
y("div", {
|
|
2566
|
+
class: A(b.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2485
2567
|
}, [
|
|
2486
|
-
|
|
2568
|
+
b.attachments?.length ? (T(), S("div", {
|
|
2487
2569
|
key: 0,
|
|
2488
|
-
class:
|
|
2570
|
+
class: A(["mb-1 space-y-1", b.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2489
2571
|
}, [
|
|
2490
|
-
(
|
|
2491
|
-
|
|
2572
|
+
(T(!0), S(Te, null, at(b.attachments, (Z, we) => (T(), S(Te, { key: we }, [
|
|
2573
|
+
Z.type === "image" ? (T(), S("img", {
|
|
2492
2574
|
key: 0,
|
|
2493
|
-
src:
|
|
2494
|
-
alt:
|
|
2575
|
+
src: Z.url,
|
|
2576
|
+
alt: Z.name,
|
|
2495
2577
|
class: "rounded-xl object-cover max-h-48 max-w-[240px] @sm/chat:max-w-[320px]"
|
|
2496
|
-
}, null, 8,
|
|
2578
|
+
}, null, 8, wi)) : Z.type === "audio" ? (T(), S("audio", {
|
|
2497
2579
|
key: 1,
|
|
2498
|
-
src:
|
|
2580
|
+
src: Z.url,
|
|
2499
2581
|
controls: "",
|
|
2500
2582
|
class: "max-w-full"
|
|
2501
|
-
}, null, 8,
|
|
2583
|
+
}, null, 8, yi)) : (T(), S("a", {
|
|
2502
2584
|
key: 2,
|
|
2503
|
-
href:
|
|
2585
|
+
href: Z.url,
|
|
2504
2586
|
target: "_blank",
|
|
2505
2587
|
rel: "noopener",
|
|
2506
|
-
class:
|
|
2588
|
+
class: A(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", I.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2507
2589
|
}, [
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
], 10,
|
|
2590
|
+
x[10] || (x[10] = y("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2591
|
+
Je(" " + ie(Z.name), 1)
|
|
2592
|
+
], 10, vi))
|
|
2511
2593
|
], 64))), 128))
|
|
2512
|
-
], 2)) :
|
|
2513
|
-
|
|
2594
|
+
], 2)) : B("", !0),
|
|
2595
|
+
b.text ? (T(), S("div", {
|
|
2514
2596
|
key: 1,
|
|
2515
|
-
class:
|
|
2516
|
-
|
|
2597
|
+
class: A(["rounded-2xl px-3.5 py-2", [
|
|
2598
|
+
b.sender === "user" ? "bg-primary-500 text-white rounded-br-[4px]" : I.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]"
|
|
2517
2599
|
]])
|
|
2518
2600
|
}, [
|
|
2519
|
-
|
|
2520
|
-
class:
|
|
2521
|
-
innerHTML: e(
|
|
2522
|
-
onClick:
|
|
2601
|
+
y("div", {
|
|
2602
|
+
class: A(["chat-msg-prose break-words text-[14px] leading-relaxed @sm/chat:text-[15px] @sm/chat:leading-relaxed", b.sender === "user" || !I.value ? "chat-msg-prose-invert" : ""]),
|
|
2603
|
+
innerHTML: e(b.text),
|
|
2604
|
+
onClick: x[0] || (x[0] = _s(() => {
|
|
2523
2605
|
}, ["stop"]))
|
|
2524
|
-
}, null, 10,
|
|
2525
|
-
], 2)) :
|
|
2606
|
+
}, null, 10, Ti)
|
|
2607
|
+
], 2)) : B("", !0)
|
|
2526
2608
|
], 2)
|
|
2527
|
-
], 10,
|
|
2609
|
+
], 10, bi))
|
|
2528
2610
|
], 64))), 128)),
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
src:
|
|
2532
|
-
alt:
|
|
2533
|
-
class:
|
|
2534
|
-
}, null, 10,
|
|
2535
|
-
|
|
2536
|
-
class:
|
|
2611
|
+
le.value ? (T(), S("div", Si, [
|
|
2612
|
+
y("img", {
|
|
2613
|
+
src: a.agent.avatarUrl.value,
|
|
2614
|
+
alt: a.agent.displayName.value,
|
|
2615
|
+
class: A(["size-7 @sm/chat:size-8 flex-shrink-0 rounded-full object-cover shadow-sm", I.value ? "ring-1 ring-black/5" : ""])
|
|
2616
|
+
}, null, 10, Ai),
|
|
2617
|
+
y("div", {
|
|
2618
|
+
class: A(["rounded-2xl px-3.5 py-2.5 flex items-center", I.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2537
2619
|
}, [
|
|
2538
|
-
|
|
2539
|
-
class:
|
|
2620
|
+
y("i", {
|
|
2621
|
+
class: A(["i-svg-spinners-3-dots-bounce size-7", I.value ? "text-theme-400" : "text-white/50"])
|
|
2540
2622
|
}, null, 2)
|
|
2541
2623
|
], 2)
|
|
2542
|
-
])) :
|
|
2624
|
+
])) : B("", !0)
|
|
2543
2625
|
], 512),
|
|
2544
|
-
|
|
2545
|
-
class:
|
|
2626
|
+
y("div", {
|
|
2627
|
+
class: A(["absolute bottom-0 left-0 right-0 z-30 px-5 pb-4 pt-3", I.value ? "bg-gradient-to-t from-white via-white/95 to-white/70" : "bg-gradient-to-t from-black/80 via-black/70 to-black/40"])
|
|
2546
2628
|
}, [
|
|
2547
|
-
|
|
2548
|
-
(
|
|
2629
|
+
w.value.length > 0 ? (T(), S("div", Ei, [
|
|
2630
|
+
(T(!0), S(Te, null, at(w.value, (b, L) => (T(), S("div", {
|
|
2549
2631
|
key: L,
|
|
2550
2632
|
class: "relative shrink-0 group"
|
|
2551
2633
|
}, [
|
|
2552
|
-
|
|
2634
|
+
b.type === "image" ? (T(), S("img", {
|
|
2553
2635
|
key: 0,
|
|
2554
|
-
src:
|
|
2555
|
-
alt:
|
|
2556
|
-
class:
|
|
2557
|
-
}, null, 10,
|
|
2636
|
+
src: b.url,
|
|
2637
|
+
alt: b.name,
|
|
2638
|
+
class: A(["size-14 rounded-xl object-cover border", I.value ? "border-black/10" : "border-white/20"])
|
|
2639
|
+
}, null, 10, _i)) : (T(), S("div", {
|
|
2558
2640
|
key: 1,
|
|
2559
|
-
class:
|
|
2641
|
+
class: A(["h-14 px-3 rounded-xl flex items-center gap-1.5 text-xs border", I.value ? "border-black/10 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2560
2642
|
}, [
|
|
2561
|
-
|
|
2562
|
-
|
|
2643
|
+
x[11] || (x[11] = y("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2644
|
+
y("span", Ri, ie(b.name), 1)
|
|
2563
2645
|
], 2)),
|
|
2564
|
-
|
|
2646
|
+
y("button", {
|
|
2565
2647
|
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",
|
|
2566
|
-
onClick: /* @__PURE__ */ h((
|
|
2567
|
-
}, [...
|
|
2568
|
-
|
|
2569
|
-
])], 8,
|
|
2648
|
+
onClick: /* @__PURE__ */ h((Z) => W(L), "onClick")
|
|
2649
|
+
}, [...x[12] || (x[12] = [
|
|
2650
|
+
y("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2651
|
+
])], 8, Ii)
|
|
2570
2652
|
]))), 128)),
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
])) :
|
|
2574
|
-
])) :
|
|
2575
|
-
|
|
2653
|
+
E.value ? (T(), S("div", Di, [
|
|
2654
|
+
qt(Ln, { class: "size-5" })
|
|
2655
|
+
])) : B("", !0)
|
|
2656
|
+
])) : B("", !0),
|
|
2657
|
+
a.uploadFn ? (T(), S("input", {
|
|
2576
2658
|
key: 1,
|
|
2577
2659
|
ref_key: "fileInput",
|
|
2578
|
-
ref:
|
|
2660
|
+
ref: m,
|
|
2579
2661
|
type: "file",
|
|
2580
2662
|
accept: "image/*,audio/*,video/*",
|
|
2581
2663
|
class: "hidden",
|
|
2582
|
-
onChange:
|
|
2583
|
-
}, null, 544)) :
|
|
2584
|
-
|
|
2585
|
-
class:
|
|
2664
|
+
onChange: gt
|
|
2665
|
+
}, null, 544)) : B("", !0),
|
|
2666
|
+
y("div", {
|
|
2667
|
+
class: A(["flex items-end gap-1 w-full rounded-[24px] p-1.5 transition-all duration-300", I.value ? g.value ? "bg-white ring-1 ring-black/10 shadow-[0_4px_16px_rgba(0,0,0,0.06)]" : "bg-theme-50 ring-1 ring-transparent hover:ring-black/5" : g.value ? "bg-white/15 ring-1 ring-white/25" : "bg-white/10 ring-1 ring-transparent hover:ring-white/15"])
|
|
2586
2668
|
}, [
|
|
2587
|
-
|
|
2588
|
-
class:
|
|
2589
|
-
|
|
2669
|
+
y("button", {
|
|
2670
|
+
class: A(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 ml-0.5 size-9 @sm/chat:size-10", [
|
|
2671
|
+
a.uploadFn ? "cursor-pointer" : "cursor-default",
|
|
2590
2672
|
I.value ? "text-theme-400 hover:text-theme-600 hover:bg-black/5" : "text-white/50 hover:text-white/80 hover:bg-white/10",
|
|
2591
|
-
|
|
2673
|
+
E.value ? "opacity-50 pointer-events-none" : ""
|
|
2592
2674
|
]]),
|
|
2593
|
-
disabled:
|
|
2594
|
-
onClick:
|
|
2675
|
+
disabled: _e.value || E.value || !a.uploadFn,
|
|
2676
|
+
onClick: x[1] || (x[1] = (b) => a.uploadFn && F())
|
|
2595
2677
|
}, [
|
|
2596
|
-
|
|
2597
|
-
], 10,
|
|
2598
|
-
|
|
2678
|
+
E.value ? (T(), S("i", Mi)) : (T(), S("i", Li))
|
|
2679
|
+
], 10, Ci),
|
|
2680
|
+
ns(y("textarea", {
|
|
2599
2681
|
ref_key: "textarea",
|
|
2600
|
-
ref:
|
|
2601
|
-
"onUpdate:modelValue":
|
|
2682
|
+
ref: f,
|
|
2683
|
+
"onUpdate:modelValue": x[2] || (x[2] = (b) => p.value = b),
|
|
2602
2684
|
"data-test": "messaging-input",
|
|
2603
2685
|
rows: "1",
|
|
2604
2686
|
enterkeyhint: "send",
|
|
2605
|
-
placeholder:
|
|
2606
|
-
disabled:
|
|
2687
|
+
placeholder: It.value,
|
|
2688
|
+
disabled: _e.value,
|
|
2607
2689
|
style: { fontSize: "16px", resize: "none" },
|
|
2608
|
-
class:
|
|
2609
|
-
onKeydown:
|
|
2610
|
-
onFocus:
|
|
2611
|
-
onBlur:
|
|
2612
|
-
}, null, 42,
|
|
2613
|
-
[
|
|
2690
|
+
class: A(["flex-1 min-w-0 bg-transparent px-1 py-2 focus:outline-none disabled:opacity-50 overflow-y-auto leading-relaxed [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", I.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2691
|
+
onKeydown: pt,
|
|
2692
|
+
onFocus: x[3] || (x[3] = (b) => g.value = !0),
|
|
2693
|
+
onBlur: x[4] || (x[4] = (b) => g.value = !1)
|
|
2694
|
+
}, null, 42, Oi), [
|
|
2695
|
+
[ss, p.value]
|
|
2614
2696
|
]),
|
|
2615
|
-
|
|
2697
|
+
y("button", {
|
|
2616
2698
|
"data-test": "messaging-send-btn",
|
|
2617
|
-
class:
|
|
2618
|
-
disabled: !
|
|
2619
|
-
onClick:
|
|
2620
|
-
}, [...
|
|
2621
|
-
|
|
2622
|
-
])], 10,
|
|
2699
|
+
class: A(["shrink-0 flex items-center justify-center rounded-full transition-all duration-300 mb-0.5 mr-0.5 size-9 @sm/chat:size-10", Y.value ? "bg-primary-500 text-white shadow-md hover:scale-105 active:scale-95 cursor-pointer" : I.value ? "bg-black/5 text-black/20" : "bg-white/10 text-white/30"]),
|
|
2700
|
+
disabled: !Y.value,
|
|
2701
|
+
onClick: x[5] || (x[5] = (b) => Ve())
|
|
2702
|
+
}, [...x[13] || (x[13] = [
|
|
2703
|
+
y("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2704
|
+
])], 10, zi)
|
|
2623
2705
|
], 2),
|
|
2624
|
-
|
|
2625
|
-
class:
|
|
2706
|
+
y("div", {
|
|
2707
|
+
class: A(["text-[10px] text-center mt-2.5 select-none opacity-70", I.value ? "text-theme-400" : "text-white/50"])
|
|
2626
2708
|
}, [
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
class:
|
|
2709
|
+
x[14] || (x[14] = Je(" Press ", -1)),
|
|
2710
|
+
y("kbd", {
|
|
2711
|
+
class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
|
|
2630
2712
|
}, "Enter", 2),
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
class:
|
|
2713
|
+
x[15] || (x[15] = Je(" to send, ", -1)),
|
|
2714
|
+
y("kbd", {
|
|
2715
|
+
class: A(["font-sans px-1.5 py-0.5 rounded-md text-[10px]", I.value ? "bg-black/[0.04] border border-black/[0.05]" : "bg-white/10 border border-white/15"])
|
|
2634
2716
|
}, "Shift+Enter", 2),
|
|
2635
|
-
|
|
2717
|
+
x[16] || (x[16] = Je(" for new line ", -1))
|
|
2636
2718
|
], 2)
|
|
2637
2719
|
], 2)
|
|
2638
2720
|
]));
|
|
2639
2721
|
}
|
|
2640
|
-
}),
|
|
2722
|
+
}), Pi = { class: "agent-wrap" }, Ni = {
|
|
2641
2723
|
key: 0,
|
|
2642
2724
|
class: "flex items-center justify-center h-full"
|
|
2643
|
-
},
|
|
2725
|
+
}, Yi = /* @__PURE__ */ Le({
|
|
2644
2726
|
__name: "AgentWrap",
|
|
2645
2727
|
props: {
|
|
2646
2728
|
sdk: {},
|
|
@@ -2653,12 +2735,12 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2653
2735
|
hasClose: { type: Boolean },
|
|
2654
2736
|
apiBase: {}
|
|
2655
2737
|
},
|
|
2656
|
-
setup(
|
|
2657
|
-
const t =
|
|
2738
|
+
setup(a) {
|
|
2739
|
+
const t = Ds("AgentWrap"), e = a, n = e.sdk || Cs.getInstance({
|
|
2658
2740
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2659
2741
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2660
|
-
}), s =
|
|
2661
|
-
return
|
|
2742
|
+
}), s = ee(!e.agent), r = Rs(e.agent ? new Tt({ config: e.agent }) : void 0), l = ee();
|
|
2743
|
+
return nn(async () => {
|
|
2662
2744
|
if (e.agent) {
|
|
2663
2745
|
t.debug("Agent provided via props, skipping fetch", {
|
|
2664
2746
|
agentId: e.agent.agentId,
|
|
@@ -2667,7 +2749,7 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2667
2749
|
return;
|
|
2668
2750
|
}
|
|
2669
2751
|
if (!e.handle) {
|
|
2670
|
-
|
|
2752
|
+
l.value = "No handle or agent provided", t.warn("AgentWrap mounted without handle or agent", {
|
|
2671
2753
|
propsReceived: {
|
|
2672
2754
|
handle: e.handle,
|
|
2673
2755
|
agent: e.agent,
|
|
@@ -2684,7 +2766,7 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2684
2766
|
try {
|
|
2685
2767
|
s.value = !0, t.debug("Fetching public agent", { handle: e.handle });
|
|
2686
2768
|
const o = await n.getPublicAgent({ handle: e.handle });
|
|
2687
|
-
o ? (r.value = new
|
|
2769
|
+
o ? (r.value = new Tt({ config: o }), t.debug("Successfully fetched public agent", {
|
|
2688
2770
|
agentId: o.agentId,
|
|
2689
2771
|
handle: o.handle
|
|
2690
2772
|
}), o.agentId && n.track({
|
|
@@ -2693,7 +2775,7 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2693
2775
|
properties: {
|
|
2694
2776
|
viewSource: "widget"
|
|
2695
2777
|
}
|
|
2696
|
-
})) : (
|
|
2778
|
+
})) : (l.value = n.error.value || "Agent not found", t.error("Failed to fetch public agent - no data returned", {
|
|
2697
2779
|
handle: e.handle,
|
|
2698
2780
|
sdkError: n.error.value,
|
|
2699
2781
|
sdkState: {
|
|
@@ -2703,7 +2785,7 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2703
2785
|
}
|
|
2704
2786
|
}));
|
|
2705
2787
|
} catch (o) {
|
|
2706
|
-
|
|
2788
|
+
l.value = o instanceof Error ? o.message : "Failed to fetch agent", t.error("Exception while fetching public agent", {
|
|
2707
2789
|
handle: e.handle,
|
|
2708
2790
|
error: o instanceof Error ? {
|
|
2709
2791
|
message: o.message,
|
|
@@ -2720,7 +2802,7 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2720
2802
|
state: {
|
|
2721
2803
|
loading: s.value,
|
|
2722
2804
|
hasAgent: !!r.value,
|
|
2723
|
-
error:
|
|
2805
|
+
error: l.value
|
|
2724
2806
|
},
|
|
2725
2807
|
props: {
|
|
2726
2808
|
handle: e.handle,
|
|
@@ -2734,33 +2816,33 @@ const Zr = { class: "@container/chat flex flex-col h-full relative" }, Xr = {
|
|
|
2734
2816
|
}
|
|
2735
2817
|
});
|
|
2736
2818
|
}
|
|
2737
|
-
}), (o, c) => (
|
|
2738
|
-
s.value ? (
|
|
2739
|
-
|
|
2740
|
-
])])) : r.value ?
|
|
2819
|
+
}), (o, c) => (T(), S("div", Pi, [
|
|
2820
|
+
s.value ? (T(), S("div", Ni, [...c[0] || (c[0] = [
|
|
2821
|
+
y("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
2822
|
+
])])) : r.value ? ts(o.$slots, "default", {
|
|
2741
2823
|
key: 1,
|
|
2742
|
-
sdk:
|
|
2824
|
+
sdk: Qt(n),
|
|
2743
2825
|
agent: r.value,
|
|
2744
|
-
context:
|
|
2745
|
-
firstMessage:
|
|
2746
|
-
buttonText:
|
|
2747
|
-
buttonIcon:
|
|
2826
|
+
context: a.context,
|
|
2827
|
+
firstMessage: a.firstMessage,
|
|
2828
|
+
buttonText: a.buttonText,
|
|
2829
|
+
buttonIcon: a.buttonIcon,
|
|
2748
2830
|
loading: s.value
|
|
2749
|
-
}) :
|
|
2831
|
+
}) : B("", !0)
|
|
2750
2832
|
]));
|
|
2751
2833
|
}
|
|
2752
2834
|
});
|
|
2753
2835
|
export {
|
|
2754
|
-
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2836
|
+
On as A,
|
|
2837
|
+
Yi as _,
|
|
2838
|
+
Vi as a,
|
|
2839
|
+
Wi as b,
|
|
2840
|
+
ji as c,
|
|
2841
|
+
qi as d,
|
|
2842
|
+
Ln as e,
|
|
2843
|
+
Ws as f,
|
|
2844
|
+
Hi as g,
|
|
2845
|
+
Pn as h,
|
|
2846
|
+
Gi as p
|
|
2765
2847
|
};
|
|
2766
2848
|
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|