@pagelines/sdk 1.0.385 → 1.0.387
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{AgentProvider.vue_vue_type_script_setup_true_lang-5V_TRBPP.js → AgentProvider.vue_vue_type_script_setup_true_lang.js} +889 -1027
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/{AgentWidgetInline-DOoug3lh.js → AgentWidgetInline.js} +3 -3
- package/dist/AgentWidgetInline.js.map +1 -0
- package/dist/{AgentWidgetModal-C-dDlu8w.js → AgentWidgetModal.js} +4 -4
- package/dist/AgentWidgetModal.js.map +1 -0
- package/dist/AgentWidgetOnboard.js +5 -0
- package/dist/AgentWidgetOnboard.js.map +1 -0
- package/dist/{AgentWrap.vue_vue_type_script_setup_true_lang-CHgCPDEe.js → AgentWrap.vue_vue_type_script_setup_true_lang.js} +878 -737
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/{FModal.vue_vue_type_script_setup_true_lang-DI6cyWhd.js → FModal.vue_vue_type_script_setup_true_lang.js} +1 -1
- package/dist/FModal.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/agent/ui/ElAuthPanel.vue.d.ts +6 -0
- package/dist/agent/ui/ElCreateAgent.vue.d.ts +180 -0
- package/dist/agent/ui/ElProvisioningStatus.vue.d.ts +13 -0
- package/dist/agent.js +5 -5
- package/dist/clients/AgentClient.d.ts +24 -0
- package/dist/clients/ChatClient.d.ts +22 -0
- package/dist/demo/index.d.ts +2 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +766 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk.js +9 -8
- package/dist/sdkClient.d.ts +9 -3
- package/dist/sdkClient.js +721 -0
- package/dist/sdkClient.js.map +1 -0
- package/dist/{socialPlatforms-Ck-b3SnQ.js → socialPlatforms.js} +1 -1
- package/dist/socialPlatforms.js.map +1 -0
- package/dist/test/agent-client.test.d.ts +4 -0
- package/dist/test/chat-authenticated.test.d.ts +1 -0
- package/dist/test/derive-mode.test.d.ts +1 -0
- package/dist/widget/PLWidget.d.ts +1 -1
- package/dist/widget/composables/useWidgetState.d.ts +6 -3
- package/dist/widget/index.d.ts +1 -0
- package/dist/widget/ui/AgentWidgetOnboard.vue.d.ts +7 -0
- package/dist/widget.js +4 -3
- package/package.json +1 -1
- package/dist/AgentProvider.vue_vue_type_script_setup_true_lang-5V_TRBPP.js.map +0 -1
- package/dist/AgentWidgetInline-DOoug3lh.js.map +0 -1
- package/dist/AgentWidgetModal-C-dDlu8w.js.map +0 -1
- package/dist/AgentWrap.vue_vue_type_script_setup_true_lang-CHgCPDEe.js.map +0 -1
- package/dist/FModal.vue_vue_type_script_setup_true_lang-DI6cyWhd.js.map +0 -1
- package/dist/index-C9cSPVgs.js +0 -379
- package/dist/index-C9cSPVgs.js.map +0 -1
- package/dist/sdkClient-6j3pmwVP.js +0 -625
- package/dist/sdkClient-6j3pmwVP.js.map +0 -1
- package/dist/socialPlatforms-Ck-b3SnQ.js.map +0 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var h = (l, t) =>
|
|
4
|
-
var
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { SettingsObject as Ss, Agent as
|
|
7
|
-
import { P as Es } from "./sdkClient
|
|
1
|
+
var _n = Object.defineProperty;
|
|
2
|
+
var ws = (l, t, e) => t in l ? _n(l, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : l[t] = e;
|
|
3
|
+
var h = (l, t) => _n(l, "name", { value: t, configurable: !0 });
|
|
4
|
+
var R = (l, t, e) => ws(l, typeof t != "symbol" ? t + "" : t, e);
|
|
5
|
+
import { defineComponent as _e, openBlock as v, createElementBlock as y, createElementVNode as w, normalizeClass as T, ref as K, watch as Ke, computed as W, createCommentVNode as H, renderSlot as qn, onMounted as Zt, Fragment as Se, renderList as dt, withDirectives as Vn, vModelText as Yn, unref as jt, toDisplayString as ce, nextTick as Pt, createVNode as $t, createTextVNode as vs, normalizeStyle as ys, shallowRef as Ts } from "vue";
|
|
6
|
+
import { SettingsObject as Ss, Agent as xt, getDefaultAvatarUrl as Zn, createLogger as As } from "@pagelines/core";
|
|
7
|
+
import { P as Es } from "./sdkClient.js";
|
|
8
8
|
const _s = { class: "spinner max-w-sm" }, Rs = {
|
|
9
9
|
class: "ring-circular h-full w-full origin-center",
|
|
10
10
|
viewBox: "25 25 50 50"
|
|
11
|
-
},
|
|
11
|
+
}, Rn = /* @__PURE__ */ _e({
|
|
12
12
|
__name: "FSpinner",
|
|
13
13
|
props: {
|
|
14
14
|
width: { type: String, default: "" },
|
|
15
15
|
colorMode: { type: String, default: "primary" }
|
|
16
16
|
},
|
|
17
17
|
setup(l) {
|
|
18
|
-
return (t, e) => (
|
|
19
|
-
(
|
|
18
|
+
return (t, e) => (v(), y("div", _s, [
|
|
19
|
+
(v(), y("svg", Rs, [
|
|
20
20
|
w("circle", {
|
|
21
21
|
class: T([l.colorMode, "ring-path"]),
|
|
22
22
|
cx: "50",
|
|
@@ -30,24 +30,24 @@ const _s = { class: "spinner max-w-sm" }, Rs = {
|
|
|
30
30
|
]))
|
|
31
31
|
]));
|
|
32
32
|
}
|
|
33
|
-
}),
|
|
33
|
+
}), an = class an extends Ss {
|
|
34
34
|
constructor(e) {
|
|
35
35
|
super("AgentChatController", e);
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
R(this, "isTextMode", !1);
|
|
37
|
+
R(this, "lastMessage", { hash: "", time: 0 });
|
|
38
|
+
R(this, "isConnecting", !1);
|
|
39
39
|
// Chat conversation tracking (server-managed persistence)
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
R(this, "conversationId");
|
|
41
|
+
R(this, "textState", K({
|
|
42
42
|
isActive: !1,
|
|
43
43
|
isConnected: !1,
|
|
44
44
|
isThinking: !1,
|
|
45
45
|
connectionStatus: "disconnected"
|
|
46
46
|
}));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
this._agent = e.agent instanceof
|
|
47
|
+
R(this, "agentMode", K("self"));
|
|
48
|
+
R(this, "sharedMessages", K([]));
|
|
49
|
+
R(this, "_agent");
|
|
50
|
+
this._agent = e.agent instanceof xt ? e.agent : new xt({ config: e.agent }), this.setupModeWatcher();
|
|
51
51
|
}
|
|
52
52
|
get chatEnabled() {
|
|
53
53
|
return this._agent.chatAvailable.value;
|
|
@@ -100,7 +100,7 @@ Current User:
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
setupModeWatcher() {
|
|
103
|
-
|
|
103
|
+
Ke(this.agentMode, async (e, n) => {
|
|
104
104
|
this.logger.info(`Mode changed from ${n} to ${e}`), this.isTextMode && (n === "talk" || n === "chat") && await this.endConversation();
|
|
105
105
|
});
|
|
106
106
|
}
|
|
@@ -160,22 +160,22 @@ Current User:
|
|
|
160
160
|
return;
|
|
161
161
|
}
|
|
162
162
|
this.addMessage(e, "user", n), this.updateState(this.textState, { isThinking: !0 });
|
|
163
|
-
const a = `stream-${Date.now()}`, o = /* @__PURE__ */ h((
|
|
163
|
+
const a = `stream-${Date.now()}`, o = /* @__PURE__ */ h((u) => {
|
|
164
164
|
this.textState.value.isThinking && (this.updateState(this.textState, { isThinking: !1 }), this.sharedMessages.value = [
|
|
165
165
|
...this.sharedMessages.value,
|
|
166
166
|
{ id: a, text: "", sender: "agent", timestamp: /* @__PURE__ */ new Date() }
|
|
167
167
|
]);
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
}, "onDelta"), c = /* @__PURE__ */ h((
|
|
171
|
-
|
|
172
|
-
}, "onDone"),
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
const
|
|
176
|
-
this.isTransientError(
|
|
177
|
-
}, "onError"),
|
|
178
|
-
this.addMessage(
|
|
168
|
+
const g = this.sharedMessages.value, m = g[g.length - 1];
|
|
169
|
+
m?.id === a && (m.text += u, this.sharedMessages.value = [...g]);
|
|
170
|
+
}, "onDelta"), c = /* @__PURE__ */ h((u) => {
|
|
171
|
+
u && (this.conversationId = u), this.updateState(this.textState, { isThinking: !1 });
|
|
172
|
+
}, "onDone"), f = /* @__PURE__ */ h((u) => {
|
|
173
|
+
const g = this.sharedMessages.value, m = g[g.length - 1];
|
|
174
|
+
m?.id === a && !m.text && (this.sharedMessages.value = g.slice(0, -1));
|
|
175
|
+
const S = this.mapChatError(u);
|
|
176
|
+
this.isTransientError(u) ? (this.addMessage(S, "system"), this.updateState(this.textState, { isThinking: !1 })) : this.handleError(new Error(S));
|
|
177
|
+
}, "onError"), d = /* @__PURE__ */ h((u) => {
|
|
178
|
+
this.addMessage(u, "system");
|
|
179
179
|
}, "onStatus");
|
|
180
180
|
try {
|
|
181
181
|
if (s)
|
|
@@ -186,11 +186,11 @@ Current User:
|
|
|
186
186
|
history: this.buildHistory(),
|
|
187
187
|
onDelta: o,
|
|
188
188
|
onDone: c,
|
|
189
|
-
onError:
|
|
190
|
-
onStatus:
|
|
189
|
+
onError: f,
|
|
190
|
+
onStatus: d
|
|
191
191
|
});
|
|
192
192
|
else {
|
|
193
|
-
const { context:
|
|
193
|
+
const { context: u } = this.getDynamicSettings();
|
|
194
194
|
await r.chatStream({
|
|
195
195
|
handle: this._agent.handle.value,
|
|
196
196
|
message: e,
|
|
@@ -198,15 +198,15 @@ Current User:
|
|
|
198
198
|
conversationId: this.conversationId,
|
|
199
199
|
history: this.buildHistory(),
|
|
200
200
|
visitorId: r.generateAnonId(),
|
|
201
|
-
context:
|
|
201
|
+
context: u || void 0,
|
|
202
202
|
onDelta: o,
|
|
203
203
|
onDone: c,
|
|
204
|
-
onError:
|
|
205
|
-
onStatus:
|
|
204
|
+
onError: f,
|
|
205
|
+
onStatus: d
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
|
-
} catch (
|
|
209
|
-
this.handleError(
|
|
208
|
+
} catch (u) {
|
|
209
|
+
this.handleError(u);
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
212
|
buildHistory() {
|
|
@@ -226,30 +226,168 @@ Current User:
|
|
|
226
226
|
await this.endConversation();
|
|
227
227
|
}
|
|
228
228
|
};
|
|
229
|
-
h(
|
|
230
|
-
let
|
|
231
|
-
function
|
|
229
|
+
h(an, "AgentChatController");
|
|
230
|
+
let Dn = an;
|
|
231
|
+
function Cn(l) {
|
|
232
232
|
return l ? typeof l == "string" ? l : l.src || "" : "";
|
|
233
233
|
}
|
|
234
|
-
h(
|
|
235
|
-
function
|
|
236
|
-
return
|
|
234
|
+
h(Cn, "getImageSrc");
|
|
235
|
+
function Ri(l) {
|
|
236
|
+
return Cn(l.cover) || Cn(l.avatar) || Zn(l.name);
|
|
237
237
|
}
|
|
238
|
-
h(
|
|
239
|
-
function
|
|
238
|
+
h(Ri, "getAgentAvatarUrl");
|
|
239
|
+
function In(l) {
|
|
240
240
|
const t = l.target;
|
|
241
|
-
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src =
|
|
241
|
+
t.dataset.fallbackUsed || (t.dataset.fallbackUsed = "true", t.src = Zn());
|
|
242
242
|
}
|
|
243
|
-
h(
|
|
244
|
-
function
|
|
243
|
+
h(In, "handleImageError");
|
|
244
|
+
function Di(l) {
|
|
245
245
|
const { template: t, agent: e } = l;
|
|
246
246
|
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 || "");
|
|
247
247
|
}
|
|
248
|
-
h(
|
|
249
|
-
const Ds = {
|
|
248
|
+
h(Di, "parseButtonTemplate");
|
|
249
|
+
const Ds = {
|
|
250
|
+
key: 0,
|
|
251
|
+
class: "absolute inset-0 flex items-center justify-center"
|
|
252
|
+
}, Ci = /* @__PURE__ */ _e({
|
|
253
|
+
__name: "ElAgentButton",
|
|
254
|
+
props: {
|
|
255
|
+
theme: { default: "primary" },
|
|
256
|
+
size: { default: "lg" },
|
|
257
|
+
loading: { type: Boolean, default: !1 },
|
|
258
|
+
icon: {},
|
|
259
|
+
iconAfter: {}
|
|
260
|
+
},
|
|
261
|
+
setup(l) {
|
|
262
|
+
const t = W(() => ({
|
|
263
|
+
primary: "bg-primary-600 border-primary-400 hover:border-primary-300 hover:bg-primary-500",
|
|
264
|
+
green: "bg-green-600 border-green-400 hover:border-green-300 hover:bg-green-500",
|
|
265
|
+
red: "bg-red-600 border-red-400 hover:border-red-300 hover:bg-red-500",
|
|
266
|
+
default: "bg-white/10 border-white/20 hover:border-white/40 hover:bg-white/20"
|
|
267
|
+
})[l.theme]), e = W(() => ({
|
|
268
|
+
sm: "px-4 py-2 text-sm",
|
|
269
|
+
md: "px-6 py-3 text-base",
|
|
270
|
+
lg: "px-8 py-4 text-base"
|
|
271
|
+
})[l.size]), n = W(() => ({
|
|
272
|
+
sm: "size-4",
|
|
273
|
+
md: "size-4",
|
|
274
|
+
lg: "size-5"
|
|
275
|
+
})[l.size]);
|
|
276
|
+
return (s, r) => (v(), y("button", {
|
|
277
|
+
class: T(["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]])
|
|
278
|
+
}, [
|
|
279
|
+
l.loading ? (v(), y("div", Ds, [...r[0] || (r[0] = [
|
|
280
|
+
w("i", { class: "i-svg-spinners-90-ring-with-bg size-5" }, null, -1)
|
|
281
|
+
])])) : H("", !0),
|
|
282
|
+
w("span", {
|
|
283
|
+
class: T(["flex items-center gap-2 transition-opacity duration-200", l.loading ? "opacity-0" : "opacity-100"])
|
|
284
|
+
}, [
|
|
285
|
+
l.icon ? (v(), y("i", {
|
|
286
|
+
key: 0,
|
|
287
|
+
class: T([l.icon, n.value])
|
|
288
|
+
}, null, 2)) : H("", !0),
|
|
289
|
+
qn(s.$slots, "default"),
|
|
290
|
+
l.iconAfter ? (v(), y("i", {
|
|
291
|
+
key: 1,
|
|
292
|
+
class: T([l.iconAfter, n.value])
|
|
293
|
+
}, null, 2)) : H("", !0)
|
|
294
|
+
], 2)
|
|
295
|
+
], 2));
|
|
296
|
+
}
|
|
297
|
+
}), Cs = ["value"], Ii = /* @__PURE__ */ _e({
|
|
298
|
+
__name: "AgentInputEmail",
|
|
299
|
+
props: {
|
|
300
|
+
modelValue: { default: "" }
|
|
301
|
+
},
|
|
302
|
+
emits: ["update:modelValue"],
|
|
303
|
+
setup(l, { emit: t }) {
|
|
304
|
+
const e = t;
|
|
305
|
+
return (n, s) => (v(), y("input", {
|
|
306
|
+
type: "email",
|
|
307
|
+
autocomplete: "email",
|
|
308
|
+
placeholder: "Enter Your Email",
|
|
309
|
+
value: l.modelValue,
|
|
310
|
+
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",
|
|
311
|
+
style: { "font-size": "16px" },
|
|
312
|
+
onInput: s[0] || (s[0] = (r) => e("update:modelValue", r.target.value))
|
|
313
|
+
}, null, 40, Cs));
|
|
314
|
+
}
|
|
315
|
+
}), Is = { class: "flex gap-1.5 justify-center" }, Ms = ["onUpdate:modelValue", "onInput", "onKeydown", "onPaste", "onFocus"], Mi = /* @__PURE__ */ _e({
|
|
316
|
+
__name: "AgentInputOneTimeCode",
|
|
317
|
+
props: {
|
|
318
|
+
modelValue: {},
|
|
319
|
+
length: {},
|
|
320
|
+
focusFirst: { type: Boolean }
|
|
321
|
+
},
|
|
322
|
+
emits: ["update:modelValue", "autoSubmit"],
|
|
323
|
+
setup(l, { emit: t }) {
|
|
324
|
+
const e = l, n = t, s = K([]), r = K(Array.from({ length: e.length }).fill("")), a = K(!1);
|
|
325
|
+
Zt(() => {
|
|
326
|
+
e.modelValue && (r.value = e.modelValue.split("").slice(0, e.length)), e.focusFirst && !("ontouchstart" in window) && s.value[0]?.focus();
|
|
327
|
+
}), Ke(() => e.modelValue, (u) => {
|
|
328
|
+
r.value = u ? u.split("").slice(0, e.length) : Array.from({ length: e.length }).fill("");
|
|
329
|
+
}), Ke(r, () => {
|
|
330
|
+
const u = r.value.filter(Boolean).join("");
|
|
331
|
+
n("update:modelValue", u), u.length === e.length && n("autoSubmit", u);
|
|
332
|
+
}, { deep: !0 });
|
|
333
|
+
function o(u, g) {
|
|
334
|
+
g.preventDefault(), a.value = !0;
|
|
335
|
+
const m = (g.clipboardData?.getData("text") || "").replace(/\D/g, "");
|
|
336
|
+
if (m.length === e.length)
|
|
337
|
+
r.value = m.split(""), setTimeout(() => {
|
|
338
|
+
s.value[e.length - 1]?.focus(), a.value = !1;
|
|
339
|
+
}, 10);
|
|
340
|
+
else {
|
|
341
|
+
const S = [...r.value];
|
|
342
|
+
m.split("").slice(0, e.length - u).forEach(($, me) => {
|
|
343
|
+
S[u + me] = $;
|
|
344
|
+
}), r.value = S;
|
|
345
|
+
const D = Math.min(u + m.length, e.length - 1);
|
|
346
|
+
setTimeout(() => {
|
|
347
|
+
s.value[D]?.focus(), a.value = !1;
|
|
348
|
+
}, 10);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
h(o, "onPaste");
|
|
352
|
+
function c(u, g) {
|
|
353
|
+
const m = g.target.value.slice(-1).replace(/\D/g, "");
|
|
354
|
+
r.value[u] = m, m && u < e.length - 1 && s.value[u + 1]?.focus();
|
|
355
|
+
}
|
|
356
|
+
h(c, "onInput");
|
|
357
|
+
function f(u, g) {
|
|
358
|
+
g.key === "Backspace" ? (g.preventDefault(), r.value[u] = "", u > 0 && s.value[u - 1]?.focus()) : g.key === "ArrowLeft" && u > 0 ? s.value[u - 1]?.focus() : g.key === "ArrowRight" && u < e.length - 1 && s.value[u + 1]?.focus();
|
|
359
|
+
}
|
|
360
|
+
h(f, "onKeydown");
|
|
361
|
+
function d(u) {
|
|
362
|
+
if (s.value[u]?.select(), !a.value && r.value[u])
|
|
363
|
+
for (let g = u; g < e.length; g++)
|
|
364
|
+
r.value[g] = "";
|
|
365
|
+
}
|
|
366
|
+
return h(d, "onFocus"), (u, g) => (v(), y("div", Is, [
|
|
367
|
+
(v(!0), y(Se, null, dt(l.length, (m) => Vn((v(), y("input", {
|
|
368
|
+
key: m,
|
|
369
|
+
ref_for: !0,
|
|
370
|
+
ref: /* @__PURE__ */ h((S) => s.value[m - 1] = S, "ref"),
|
|
371
|
+
"onUpdate:modelValue": /* @__PURE__ */ h((S) => r.value[m - 1] = S, "onUpdate:modelValue"),
|
|
372
|
+
type: "text",
|
|
373
|
+
inputmode: "numeric",
|
|
374
|
+
autocomplete: "one-time-code",
|
|
375
|
+
class: "size-11 text-center font-mono text-theme-900 bg-white border border-white rounded-lg focus:outline-none transition-all",
|
|
376
|
+
style: { "font-size": "16px" },
|
|
377
|
+
maxlength: "1",
|
|
378
|
+
onInput: /* @__PURE__ */ h((S) => c(m - 1, S), "onInput"),
|
|
379
|
+
onKeydown: /* @__PURE__ */ h((S) => f(m - 1, S), "onKeydown"),
|
|
380
|
+
onPaste: /* @__PURE__ */ h((S) => o(m - 1, S), "onPaste"),
|
|
381
|
+
onFocus: /* @__PURE__ */ h((S) => d(m - 1), "onFocus")
|
|
382
|
+
}, null, 40, Ms)), [
|
|
383
|
+
[Yn, r.value[m - 1]]
|
|
384
|
+
])), 128))
|
|
385
|
+
]));
|
|
386
|
+
}
|
|
387
|
+
}), Ls = { class: "relative flex-shrink-0" }, zs = ["src", "alt"], Os = { class: "absolute top-1 right-1" }, Ns = {
|
|
250
388
|
key: 1,
|
|
251
389
|
class: "size-3 bg-theme-400 rounded-full ring-2 ring-white"
|
|
252
|
-
},
|
|
390
|
+
}, Ps = { class: "min-w-0" }, $s = /* @__PURE__ */ _e({
|
|
253
391
|
__name: "ElModeHeader",
|
|
254
392
|
props: {
|
|
255
393
|
agent: {},
|
|
@@ -258,12 +396,12 @@ const Ds = { class: "relative flex-shrink-0" }, Cs = ["src", "alt"], Ms = { clas
|
|
|
258
396
|
layout: { default: "centered" }
|
|
259
397
|
},
|
|
260
398
|
setup(l) {
|
|
261
|
-
return (t, e) => (
|
|
399
|
+
return (t, e) => (v(), y("div", {
|
|
262
400
|
class: T(["flex gap-4", [
|
|
263
401
|
l.layout === "centered" ? "flex-col items-center text-center" : "flex-row items-center justify-center"
|
|
264
402
|
]])
|
|
265
403
|
}, [
|
|
266
|
-
w("div",
|
|
404
|
+
w("div", Ls, [
|
|
267
405
|
w("div", {
|
|
268
406
|
class: T(["rounded-full overflow-hidden border-white", l.size === "lg" ? "w-20 h-20 sm:w-24 sm:h-24 border-4" : "w-16 sm:size-16 border-2"])
|
|
269
407
|
}, [
|
|
@@ -272,20 +410,20 @@ const Ds = { class: "relative flex-shrink-0" }, Cs = ["src", "alt"], Ms = { clas
|
|
|
272
410
|
alt: l.agent.displayName.value,
|
|
273
411
|
class: "w-full h-full object-cover",
|
|
274
412
|
onError: e[0] || (e[0] = //@ts-ignore
|
|
275
|
-
(...n) => jt(
|
|
276
|
-
}, null, 40,
|
|
413
|
+
(...n) => jt(In) && jt(In)(...n))
|
|
414
|
+
}, null, 40, zs)
|
|
277
415
|
], 2),
|
|
278
|
-
w("div",
|
|
279
|
-
l.isOnline ? (
|
|
416
|
+
w("div", Os, [
|
|
417
|
+
l.isOnline ? (v(), y(Se, { key: 0 }, [
|
|
280
418
|
e[1] || (e[1] = w("div", {
|
|
281
419
|
class: "size-3 bg-green-500 rounded-full ring-2 ring-white absolute animate-ping",
|
|
282
420
|
style: { "animation-duration": "3s" }
|
|
283
421
|
}, null, -1)),
|
|
284
422
|
e[2] || (e[2] = w("div", { class: "size-3 bg-green-500 rounded-full ring-2 ring-white" }, null, -1))
|
|
285
|
-
], 64)) : (
|
|
423
|
+
], 64)) : (v(), y("div", Ns))
|
|
286
424
|
])
|
|
287
425
|
]),
|
|
288
|
-
w("div",
|
|
426
|
+
w("div", Ps, [
|
|
289
427
|
w("h1", {
|
|
290
428
|
class: T(["font-light text-white mb-1 truncate", [
|
|
291
429
|
l.size === "lg" ? "text-3xl mb-2" : "text-xl sm:text-2xl tracking-wide leading-tight",
|
|
@@ -303,24 +441,24 @@ const Ds = { class: "relative flex-shrink-0" }, Cs = ["src", "alt"], Ms = { clas
|
|
|
303
441
|
}
|
|
304
442
|
});
|
|
305
443
|
const {
|
|
306
|
-
entries:
|
|
444
|
+
entries: Xn,
|
|
307
445
|
setPrototypeOf: Mn,
|
|
308
|
-
isFrozen:
|
|
309
|
-
getPrototypeOf:
|
|
310
|
-
getOwnPropertyDescriptor:
|
|
446
|
+
isFrozen: Us,
|
|
447
|
+
getPrototypeOf: Bs,
|
|
448
|
+
getOwnPropertyDescriptor: Fs
|
|
311
449
|
} = Object;
|
|
312
450
|
let {
|
|
313
451
|
freeze: Z,
|
|
314
|
-
seal:
|
|
315
|
-
create:
|
|
452
|
+
seal: ee,
|
|
453
|
+
create: gt
|
|
316
454
|
} = Object, {
|
|
317
455
|
apply: qt,
|
|
318
|
-
construct:
|
|
456
|
+
construct: Vt
|
|
319
457
|
} = typeof Reflect < "u" && Reflect;
|
|
320
458
|
Z || (Z = /* @__PURE__ */ h(function(t) {
|
|
321
459
|
return t;
|
|
322
460
|
}, "freeze"));
|
|
323
|
-
|
|
461
|
+
ee || (ee = /* @__PURE__ */ h(function(t) {
|
|
324
462
|
return t;
|
|
325
463
|
}, "seal"));
|
|
326
464
|
qt || (qt = /* @__PURE__ */ h(function(t, e) {
|
|
@@ -328,12 +466,12 @@ qt || (qt = /* @__PURE__ */ h(function(t, e) {
|
|
|
328
466
|
s[r - 2] = arguments[r];
|
|
329
467
|
return t.apply(e, s);
|
|
330
468
|
}, "apply"));
|
|
331
|
-
|
|
469
|
+
Vt || (Vt = /* @__PURE__ */ h(function(t) {
|
|
332
470
|
for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
|
|
333
471
|
n[s - 1] = arguments[s];
|
|
334
472
|
return new t(...n);
|
|
335
473
|
}, "construct"));
|
|
336
|
-
const
|
|
474
|
+
const ht = X(Array.prototype.forEach), Hs = X(Array.prototype.lastIndexOf), Ln = X(Array.prototype.pop), We = X(Array.prototype.push), Gs = X(Array.prototype.splice), mt = X(String.prototype.toLowerCase), Ut = X(String.prototype.toString), Bt = X(String.prototype.match), je = X(String.prototype.replace), Ws = X(String.prototype.indexOf), js = X(String.prototype.trim), J = X(Object.prototype.hasOwnProperty), V = X(RegExp.prototype.test), qe = qs(TypeError);
|
|
337
475
|
function X(l) {
|
|
338
476
|
return function(t) {
|
|
339
477
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
@@ -343,78 +481,78 @@ function X(l) {
|
|
|
343
481
|
};
|
|
344
482
|
}
|
|
345
483
|
h(X, "unapply");
|
|
346
|
-
function
|
|
484
|
+
function qs(l) {
|
|
347
485
|
return function() {
|
|
348
486
|
for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
|
|
349
487
|
e[n] = arguments[n];
|
|
350
|
-
return
|
|
488
|
+
return Vt(l, e);
|
|
351
489
|
};
|
|
352
490
|
}
|
|
353
|
-
h(
|
|
354
|
-
function
|
|
355
|
-
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
491
|
+
h(qs, "unconstruct");
|
|
492
|
+
function _(l, t) {
|
|
493
|
+
let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : mt;
|
|
356
494
|
Mn && Mn(l, null);
|
|
357
495
|
let n = t.length;
|
|
358
496
|
for (; n--; ) {
|
|
359
497
|
let s = t[n];
|
|
360
498
|
if (typeof s == "string") {
|
|
361
499
|
const r = e(s);
|
|
362
|
-
r !== s && (
|
|
500
|
+
r !== s && (Us(t) || (t[n] = r), s = r);
|
|
363
501
|
}
|
|
364
502
|
l[s] = !0;
|
|
365
503
|
}
|
|
366
504
|
return l;
|
|
367
505
|
}
|
|
368
|
-
h(
|
|
369
|
-
function
|
|
506
|
+
h(_, "addToSet");
|
|
507
|
+
function Vs(l) {
|
|
370
508
|
for (let t = 0; t < l.length; t++)
|
|
371
|
-
|
|
509
|
+
J(l, t) || (l[t] = null);
|
|
372
510
|
return l;
|
|
373
511
|
}
|
|
374
|
-
h(
|
|
512
|
+
h(Vs, "cleanArray");
|
|
375
513
|
function le(l) {
|
|
376
|
-
const t =
|
|
377
|
-
for (const [e, n] of
|
|
378
|
-
|
|
514
|
+
const t = gt(null);
|
|
515
|
+
for (const [e, n] of Xn(l))
|
|
516
|
+
J(l, e) && (Array.isArray(n) ? t[e] = Vs(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = le(n) : t[e] = n);
|
|
379
517
|
return t;
|
|
380
518
|
}
|
|
381
519
|
h(le, "clone");
|
|
382
|
-
function
|
|
520
|
+
function Ve(l, t) {
|
|
383
521
|
for (; l !== null; ) {
|
|
384
|
-
const n =
|
|
522
|
+
const n = Fs(l, t);
|
|
385
523
|
if (n) {
|
|
386
524
|
if (n.get)
|
|
387
525
|
return X(n.get);
|
|
388
526
|
if (typeof n.value == "function")
|
|
389
527
|
return X(n.value);
|
|
390
528
|
}
|
|
391
|
-
l =
|
|
529
|
+
l = Bs(l);
|
|
392
530
|
}
|
|
393
531
|
function e() {
|
|
394
532
|
return null;
|
|
395
533
|
}
|
|
396
534
|
return h(e, "fallbackValue"), e;
|
|
397
535
|
}
|
|
398
|
-
h(
|
|
399
|
-
const
|
|
536
|
+
h(Ve, "lookupGetter");
|
|
537
|
+
const zn = Z(["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"]), Ft = Z(["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"]), Ht = Z(["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"]), Ys = Z(["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"]), Gt = Z(["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"]), Zs = Z(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), On = Z(["#text"]), Nn = Z(["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", "slot"]), Wt = Z(["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"]), Pn = Z(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "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"]), pt = Z(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), Xs = ee(/\{\{[\w\W]*|[\w\W]*\}\}/gm), Qs = ee(/<%[\w\W]*|[\w\W]*%>/gm), Ks = ee(/\$\{[\w\W]*/gm), Js = ee(/^data-[\-\w.\u00B7-\uFFFF]+$/), er = ee(/^aria-[\-\w]+$/), Qn = ee(
|
|
400
538
|
/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
|
|
401
539
|
// eslint-disable-line no-useless-escape
|
|
402
|
-
),
|
|
540
|
+
), tr = ee(/^(?:\w+script|data):/i), nr = ee(
|
|
403
541
|
/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
|
|
404
542
|
// eslint-disable-line no-control-regex
|
|
405
|
-
),
|
|
406
|
-
var
|
|
543
|
+
), Kn = ee(/^html$/i), sr = ee(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
544
|
+
var $n = /* @__PURE__ */ Object.freeze({
|
|
407
545
|
__proto__: null,
|
|
408
|
-
ARIA_ATTR:
|
|
409
|
-
ATTR_WHITESPACE:
|
|
410
|
-
CUSTOM_ELEMENT:
|
|
411
|
-
DATA_ATTR:
|
|
412
|
-
DOCTYPE_NAME:
|
|
413
|
-
ERB_EXPR:
|
|
414
|
-
IS_ALLOWED_URI:
|
|
415
|
-
IS_SCRIPT_OR_DATA:
|
|
416
|
-
MUSTACHE_EXPR:
|
|
417
|
-
TMPLIT_EXPR:
|
|
546
|
+
ARIA_ATTR: er,
|
|
547
|
+
ATTR_WHITESPACE: nr,
|
|
548
|
+
CUSTOM_ELEMENT: sr,
|
|
549
|
+
DATA_ATTR: Js,
|
|
550
|
+
DOCTYPE_NAME: Kn,
|
|
551
|
+
ERB_EXPR: Qs,
|
|
552
|
+
IS_ALLOWED_URI: Qn,
|
|
553
|
+
IS_SCRIPT_OR_DATA: tr,
|
|
554
|
+
MUSTACHE_EXPR: Xs,
|
|
555
|
+
TMPLIT_EXPR: Ks
|
|
418
556
|
});
|
|
419
557
|
const Ye = {
|
|
420
558
|
element: 1,
|
|
@@ -423,9 +561,9 @@ const Ye = {
|
|
|
423
561
|
progressingInstruction: 7,
|
|
424
562
|
comment: 8,
|
|
425
563
|
document: 9
|
|
426
|
-
},
|
|
564
|
+
}, rr = /* @__PURE__ */ h(function() {
|
|
427
565
|
return typeof window > "u" ? null : window;
|
|
428
|
-
}, "getGlobal"),
|
|
566
|
+
}, "getGlobal"), ir = /* @__PURE__ */ h(function(t, e) {
|
|
429
567
|
if (typeof t != "object" || typeof t.createPolicy != "function")
|
|
430
568
|
return null;
|
|
431
569
|
let n = null;
|
|
@@ -444,7 +582,7 @@ const Ye = {
|
|
|
444
582
|
} catch {
|
|
445
583
|
return console.warn("TrustedTypes policy " + r + " could not be created."), null;
|
|
446
584
|
}
|
|
447
|
-
}, "_createTrustedTypesPolicy"),
|
|
585
|
+
}, "_createTrustedTypesPolicy"), Un = /* @__PURE__ */ h(function() {
|
|
448
586
|
return {
|
|
449
587
|
afterSanitizeAttributes: [],
|
|
450
588
|
afterSanitizeElements: [],
|
|
@@ -457,9 +595,9 @@ const Ye = {
|
|
|
457
595
|
uponSanitizeShadowNode: []
|
|
458
596
|
};
|
|
459
597
|
}, "_createHooksMap");
|
|
460
|
-
function
|
|
461
|
-
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
462
|
-
const t = /* @__PURE__ */ h((k) =>
|
|
598
|
+
function Jn() {
|
|
599
|
+
let l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : rr();
|
|
600
|
+
const t = /* @__PURE__ */ h((k) => Jn(k), "DOMPurify");
|
|
463
601
|
if (t.version = "3.3.3", t.removed = [], !l || !l.document || l.document.nodeType !== Ye.document || !l.Element)
|
|
464
602
|
return t.isSupported = !1, t;
|
|
465
603
|
let {
|
|
@@ -470,44 +608,44 @@ function Vn() {
|
|
|
470
608
|
HTMLTemplateElement: a,
|
|
471
609
|
Node: o,
|
|
472
610
|
Element: c,
|
|
473
|
-
NodeFilter:
|
|
474
|
-
NamedNodeMap:
|
|
475
|
-
HTMLFormElement:
|
|
476
|
-
DOMParser:
|
|
477
|
-
trustedTypes:
|
|
478
|
-
} = l,
|
|
611
|
+
NodeFilter: f,
|
|
612
|
+
NamedNodeMap: d = l.NamedNodeMap || l.MozNamedAttrMap,
|
|
613
|
+
HTMLFormElement: u,
|
|
614
|
+
DOMParser: g,
|
|
615
|
+
trustedTypes: m
|
|
616
|
+
} = l, S = c.prototype, D = Ve(S, "cloneNode"), $ = Ve(S, "remove"), me = Ve(S, "nextSibling"), xe = Ve(S, "childNodes"), te = Ve(S, "parentNode");
|
|
479
617
|
if (typeof a == "function") {
|
|
480
618
|
const k = e.createElement("template");
|
|
481
619
|
k.content && k.content.ownerDocument && (e = k.content.ownerDocument);
|
|
482
620
|
}
|
|
483
|
-
let
|
|
621
|
+
let U, q = "";
|
|
484
622
|
const {
|
|
485
|
-
implementation:
|
|
623
|
+
implementation: ne,
|
|
486
624
|
createNodeIterator: ue,
|
|
487
|
-
createDocumentFragment:
|
|
488
|
-
getElementsByTagName:
|
|
625
|
+
createDocumentFragment: et,
|
|
626
|
+
getElementsByTagName: tt
|
|
489
627
|
} = e, {
|
|
490
|
-
importNode:
|
|
628
|
+
importNode: Tt
|
|
491
629
|
} = n;
|
|
492
|
-
let
|
|
493
|
-
t.isSupported = typeof
|
|
630
|
+
let F = Un();
|
|
631
|
+
t.isSupported = typeof Xn == "function" && typeof te == "function" && ne && ne.createHTMLDocument !== void 0;
|
|
494
632
|
const {
|
|
495
|
-
MUSTACHE_EXPR:
|
|
496
|
-
ERB_EXPR:
|
|
497
|
-
TMPLIT_EXPR:
|
|
498
|
-
DATA_ATTR:
|
|
499
|
-
ARIA_ATTR:
|
|
500
|
-
IS_SCRIPT_OR_DATA:
|
|
501
|
-
ATTR_WHITESPACE:
|
|
502
|
-
CUSTOM_ELEMENT:
|
|
503
|
-
} =
|
|
633
|
+
MUSTACHE_EXPR: Ue,
|
|
634
|
+
ERB_EXPR: L,
|
|
635
|
+
TMPLIT_EXPR: Be,
|
|
636
|
+
DATA_ATTR: St,
|
|
637
|
+
ARIA_ATTR: At,
|
|
638
|
+
IS_SCRIPT_OR_DATA: nt,
|
|
639
|
+
ATTR_WHITESPACE: Fe,
|
|
640
|
+
CUSTOM_ELEMENT: A
|
|
641
|
+
} = $n;
|
|
504
642
|
let {
|
|
505
|
-
IS_ALLOWED_URI:
|
|
506
|
-
} =
|
|
507
|
-
const
|
|
508
|
-
let
|
|
509
|
-
const he =
|
|
510
|
-
let
|
|
643
|
+
IS_ALLOWED_URI: E
|
|
644
|
+
} = $n, b = null;
|
|
645
|
+
const z = _({}, [...zn, ...Ft, ...Ht, ...Gt, ...On]);
|
|
646
|
+
let I = null;
|
|
647
|
+
const he = _({}, [...Nn, ...Wt, ...Pn, ...pt]);
|
|
648
|
+
let O = Object.seal(gt(null, {
|
|
511
649
|
tagNameCheck: {
|
|
512
650
|
writable: !0,
|
|
513
651
|
configurable: !1,
|
|
@@ -526,8 +664,8 @@ function Vn() {
|
|
|
526
664
|
enumerable: !0,
|
|
527
665
|
value: !1
|
|
528
666
|
}
|
|
529
|
-
})), pe = null,
|
|
530
|
-
const ke = Object.seal(
|
|
667
|
+
})), pe = null, st = null;
|
|
668
|
+
const ke = Object.seal(gt(null, {
|
|
531
669
|
tagCheck: {
|
|
532
670
|
writable: !0,
|
|
533
671
|
configurable: !1,
|
|
@@ -541,170 +679,170 @@ function Vn() {
|
|
|
541
679
|
value: null
|
|
542
680
|
}
|
|
543
681
|
}));
|
|
544
|
-
let
|
|
545
|
-
const
|
|
546
|
-
let
|
|
547
|
-
const
|
|
548
|
-
let
|
|
549
|
-
const
|
|
550
|
-
let
|
|
551
|
-
const
|
|
552
|
-
let
|
|
553
|
-
const
|
|
554
|
-
let
|
|
555
|
-
const
|
|
556
|
-
let
|
|
557
|
-
const
|
|
558
|
-
let
|
|
559
|
-
const
|
|
682
|
+
let ln = !0, Et = !0, on = !1, cn = !0, De = !1, rt = !0, ye = !1, _t = !1, Rt = !1, Ce = !1, it = !1, at = !1, un = !0, hn = !1;
|
|
683
|
+
const ps = "user-content-";
|
|
684
|
+
let Dt = !0, He = !1, Ie = {}, ie = null;
|
|
685
|
+
const Ct = _({}, ["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"]);
|
|
686
|
+
let pn = null;
|
|
687
|
+
const fn = _({}, ["audio", "video", "img", "source", "image", "track"]);
|
|
688
|
+
let It = null;
|
|
689
|
+
const dn = _({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), lt = "http://www.w3.org/1998/Math/MathML", ot = "http://www.w3.org/2000/svg", fe = "http://www.w3.org/1999/xhtml";
|
|
690
|
+
let Me = fe, Mt = !1, Lt = null;
|
|
691
|
+
const fs = _({}, [lt, ot, fe], Ut);
|
|
692
|
+
let ct = _({}, ["mi", "mo", "mn", "ms", "mtext"]), ut = _({}, ["annotation-xml"]);
|
|
693
|
+
const ds = _({}, ["title", "style", "font", "a", "script"]);
|
|
694
|
+
let Ge = null;
|
|
695
|
+
const gs = ["application/xhtml+xml", "text/html"], ms = "text/html";
|
|
696
|
+
let B = null, Le = null;
|
|
697
|
+
const xs = e.createElement("form"), gn = /* @__PURE__ */ h(function(i) {
|
|
560
698
|
return i instanceof RegExp || i instanceof Function;
|
|
561
|
-
}, "isRegexOrFunction"),
|
|
699
|
+
}, "isRegexOrFunction"), zt = /* @__PURE__ */ h(function() {
|
|
562
700
|
let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
563
|
-
if (!(
|
|
564
|
-
if ((!i || typeof i != "object") && (i = {}), i = le(i),
|
|
565
|
-
|
|
701
|
+
if (!(Le && Le === i)) {
|
|
702
|
+
if ((!i || typeof i != "object") && (i = {}), i = le(i), Ge = // eslint-disable-next-line unicorn/prefer-includes
|
|
703
|
+
gs.indexOf(i.PARSER_MEDIA_TYPE) === -1 ? ms : i.PARSER_MEDIA_TYPE, B = Ge === "application/xhtml+xml" ? Ut : mt, b = J(i, "ALLOWED_TAGS") ? _({}, i.ALLOWED_TAGS, B) : z, I = J(i, "ALLOWED_ATTR") ? _({}, i.ALLOWED_ATTR, B) : he, Lt = J(i, "ALLOWED_NAMESPACES") ? _({}, i.ALLOWED_NAMESPACES, Ut) : fs, It = J(i, "ADD_URI_SAFE_ATTR") ? _(le(dn), i.ADD_URI_SAFE_ATTR, B) : dn, pn = J(i, "ADD_DATA_URI_TAGS") ? _(le(fn), i.ADD_DATA_URI_TAGS, B) : fn, ie = J(i, "FORBID_CONTENTS") ? _({}, i.FORBID_CONTENTS, B) : Ct, pe = J(i, "FORBID_TAGS") ? _({}, i.FORBID_TAGS, B) : le({}), st = J(i, "FORBID_ATTR") ? _({}, i.FORBID_ATTR, B) : le({}), Ie = J(i, "USE_PROFILES") ? i.USE_PROFILES : !1, ln = i.ALLOW_ARIA_ATTR !== !1, Et = i.ALLOW_DATA_ATTR !== !1, on = i.ALLOW_UNKNOWN_PROTOCOLS || !1, cn = i.ALLOW_SELF_CLOSE_IN_ATTR !== !1, De = i.SAFE_FOR_TEMPLATES || !1, rt = i.SAFE_FOR_XML !== !1, ye = i.WHOLE_DOCUMENT || !1, Ce = i.RETURN_DOM || !1, it = i.RETURN_DOM_FRAGMENT || !1, at = i.RETURN_TRUSTED_TYPE || !1, Rt = i.FORCE_BODY || !1, un = i.SANITIZE_DOM !== !1, hn = i.SANITIZE_NAMED_PROPS || !1, Dt = i.KEEP_CONTENT !== !1, He = i.IN_PLACE || !1, E = i.ALLOWED_URI_REGEXP || Qn, Me = i.NAMESPACE || fe, ct = i.MATHML_TEXT_INTEGRATION_POINTS || ct, ut = i.HTML_INTEGRATION_POINTS || ut, O = i.CUSTOM_ELEMENT_HANDLING || {}, i.CUSTOM_ELEMENT_HANDLING && gn(i.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && (O.tagNameCheck = i.CUSTOM_ELEMENT_HANDLING.tagNameCheck), i.CUSTOM_ELEMENT_HANDLING && gn(i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && (O.attributeNameCheck = i.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), i.CUSTOM_ELEMENT_HANDLING && typeof i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && (O.allowCustomizedBuiltInElements = i.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), De && (Et = !1), it && (Ce = !0), Ie && (b = _({}, On), I = gt(null), Ie.html === !0 && (_(b, zn), _(I, Nn)), Ie.svg === !0 && (_(b, Ft), _(I, Wt), _(I, pt)), Ie.svgFilters === !0 && (_(b, Ht), _(I, Wt), _(I, pt)), Ie.mathMl === !0 && (_(b, Gt), _(I, Pn), _(I, pt))), J(i, "ADD_TAGS") || (ke.tagCheck = null), J(i, "ADD_ATTR") || (ke.attributeCheck = null), i.ADD_TAGS && (typeof i.ADD_TAGS == "function" ? ke.tagCheck = i.ADD_TAGS : (b === z && (b = le(b)), _(b, i.ADD_TAGS, B))), i.ADD_ATTR && (typeof i.ADD_ATTR == "function" ? ke.attributeCheck = i.ADD_ATTR : (I === he && (I = le(I)), _(I, i.ADD_ATTR, B))), i.ADD_URI_SAFE_ATTR && _(It, i.ADD_URI_SAFE_ATTR, B), i.FORBID_CONTENTS && (ie === Ct && (ie = le(ie)), _(ie, i.FORBID_CONTENTS, B)), i.ADD_FORBID_CONTENTS && (ie === Ct && (ie = le(ie)), _(ie, i.ADD_FORBID_CONTENTS, B)), Dt && (b["#text"] = !0), ye && _(b, ["html", "head", "body"]), b.table && (_(b, ["tbody"]), delete pe.tbody), i.TRUSTED_TYPES_POLICY) {
|
|
566
704
|
if (typeof i.TRUSTED_TYPES_POLICY.createHTML != "function")
|
|
567
|
-
throw
|
|
705
|
+
throw qe('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
568
706
|
if (typeof i.TRUSTED_TYPES_POLICY.createScriptURL != "function")
|
|
569
|
-
throw
|
|
570
|
-
|
|
707
|
+
throw qe('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
708
|
+
U = i.TRUSTED_TYPES_POLICY, q = U.createHTML("");
|
|
571
709
|
} else
|
|
572
|
-
|
|
573
|
-
Z && Z(i),
|
|
710
|
+
U === void 0 && (U = ir(m, s)), U !== null && typeof q == "string" && (q = U.createHTML(""));
|
|
711
|
+
Z && Z(i), Le = i;
|
|
574
712
|
}
|
|
575
|
-
}, "_parseConfig"),
|
|
576
|
-
let
|
|
577
|
-
(!
|
|
578
|
-
namespaceURI:
|
|
713
|
+
}, "_parseConfig"), mn = _({}, [...Ft, ...Ht, ...Ys]), xn = _({}, [...Gt, ...Zs]), ks = /* @__PURE__ */ h(function(i) {
|
|
714
|
+
let p = te(i);
|
|
715
|
+
(!p || !p.tagName) && (p = {
|
|
716
|
+
namespaceURI: Me,
|
|
579
717
|
tagName: "template"
|
|
580
718
|
});
|
|
581
|
-
const
|
|
582
|
-
return
|
|
719
|
+
const x = mt(i.tagName), N = mt(p.tagName);
|
|
720
|
+
return Lt[i.namespaceURI] ? i.namespaceURI === ot ? p.namespaceURI === fe ? x === "svg" : p.namespaceURI === lt ? x === "svg" && (N === "annotation-xml" || ct[N]) : !!mn[x] : i.namespaceURI === lt ? p.namespaceURI === fe ? x === "math" : p.namespaceURI === ot ? x === "math" && ut[N] : !!xn[x] : i.namespaceURI === fe ? p.namespaceURI === ot && !ut[N] || p.namespaceURI === lt && !ct[N] ? !1 : !xn[x] && (ds[x] || !mn[x]) : !!(Ge === "application/xhtml+xml" && Lt[i.namespaceURI]) : !1;
|
|
583
721
|
}, "_checkValidNamespace"), ae = /* @__PURE__ */ h(function(i) {
|
|
584
|
-
|
|
722
|
+
We(t.removed, {
|
|
585
723
|
element: i
|
|
586
724
|
});
|
|
587
725
|
try {
|
|
588
|
-
|
|
726
|
+
te(i).removeChild(i);
|
|
589
727
|
} catch {
|
|
590
|
-
|
|
728
|
+
$(i);
|
|
591
729
|
}
|
|
592
|
-
}, "_forceRemove"),
|
|
730
|
+
}, "_forceRemove"), Te = /* @__PURE__ */ h(function(i, p) {
|
|
593
731
|
try {
|
|
594
|
-
|
|
595
|
-
attribute:
|
|
596
|
-
from:
|
|
732
|
+
We(t.removed, {
|
|
733
|
+
attribute: p.getAttributeNode(i),
|
|
734
|
+
from: p
|
|
597
735
|
});
|
|
598
736
|
} catch {
|
|
599
|
-
|
|
737
|
+
We(t.removed, {
|
|
600
738
|
attribute: null,
|
|
601
|
-
from:
|
|
739
|
+
from: p
|
|
602
740
|
});
|
|
603
741
|
}
|
|
604
|
-
if (
|
|
605
|
-
if (
|
|
742
|
+
if (p.removeAttribute(i), i === "is")
|
|
743
|
+
if (Ce || it)
|
|
606
744
|
try {
|
|
607
|
-
ae(
|
|
745
|
+
ae(p);
|
|
608
746
|
} catch {
|
|
609
747
|
}
|
|
610
748
|
else
|
|
611
749
|
try {
|
|
612
|
-
|
|
750
|
+
p.setAttribute(i, "");
|
|
613
751
|
} catch {
|
|
614
752
|
}
|
|
615
753
|
}, "_removeAttribute"), kn = /* @__PURE__ */ h(function(i) {
|
|
616
|
-
let
|
|
617
|
-
if (
|
|
754
|
+
let p = null, x = null;
|
|
755
|
+
if (Rt)
|
|
618
756
|
i = "<remove></remove>" + i;
|
|
619
757
|
else {
|
|
620
|
-
const P =
|
|
621
|
-
|
|
758
|
+
const P = Bt(i, /^[\r\n\t ]+/);
|
|
759
|
+
x = P && P[0];
|
|
622
760
|
}
|
|
623
|
-
|
|
624
|
-
const N =
|
|
625
|
-
if (
|
|
761
|
+
Ge === "application/xhtml+xml" && Me === fe && (i = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + i + "</body></html>");
|
|
762
|
+
const N = U ? U.createHTML(i) : i;
|
|
763
|
+
if (Me === fe)
|
|
626
764
|
try {
|
|
627
|
-
|
|
765
|
+
p = new g().parseFromString(N, Ge);
|
|
628
766
|
} catch {
|
|
629
767
|
}
|
|
630
|
-
if (!
|
|
631
|
-
|
|
768
|
+
if (!p || !p.documentElement) {
|
|
769
|
+
p = ne.createDocument(Me, "template", null);
|
|
632
770
|
try {
|
|
633
|
-
|
|
771
|
+
p.documentElement.innerHTML = Mt ? q : N;
|
|
634
772
|
} catch {
|
|
635
773
|
}
|
|
636
774
|
}
|
|
637
|
-
const
|
|
638
|
-
return i &&
|
|
639
|
-
}, "_initDocument"),
|
|
775
|
+
const j = p.body || p.documentElement;
|
|
776
|
+
return i && x && j.insertBefore(e.createTextNode(x), j.childNodes[0] || null), Me === fe ? tt.call(p, ye ? "html" : "body")[0] : ye ? p.documentElement : j;
|
|
777
|
+
}, "_initDocument"), bn = /* @__PURE__ */ h(function(i) {
|
|
640
778
|
return ue.call(
|
|
641
779
|
i.ownerDocument || i,
|
|
642
780
|
i,
|
|
643
781
|
// eslint-disable-next-line no-bitwise
|
|
644
|
-
|
|
782
|
+
f.SHOW_ELEMENT | f.SHOW_COMMENT | f.SHOW_TEXT | f.SHOW_PROCESSING_INSTRUCTION | f.SHOW_CDATA_SECTION,
|
|
645
783
|
null
|
|
646
784
|
);
|
|
647
|
-
}, "_createNodeIterator"),
|
|
648
|
-
return i instanceof
|
|
649
|
-
}, "_isClobbered"),
|
|
785
|
+
}, "_createNodeIterator"), Ot = /* @__PURE__ */ h(function(i) {
|
|
786
|
+
return i instanceof u && (typeof i.nodeName != "string" || typeof i.textContent != "string" || typeof i.removeChild != "function" || !(i.attributes instanceof d) || typeof i.removeAttribute != "function" || typeof i.setAttribute != "function" || typeof i.namespaceURI != "string" || typeof i.insertBefore != "function" || typeof i.hasChildNodes != "function");
|
|
787
|
+
}, "_isClobbered"), wn = /* @__PURE__ */ h(function(i) {
|
|
650
788
|
return typeof o == "function" && i instanceof o;
|
|
651
789
|
}, "_isNode");
|
|
652
|
-
function de(k, i,
|
|
653
|
-
|
|
654
|
-
|
|
790
|
+
function de(k, i, p) {
|
|
791
|
+
ht(k, (x) => {
|
|
792
|
+
x.call(t, i, p, Le);
|
|
655
793
|
});
|
|
656
794
|
}
|
|
657
795
|
h(de, "_executeHooks");
|
|
658
|
-
const
|
|
659
|
-
let
|
|
660
|
-
if (de(
|
|
796
|
+
const vn = /* @__PURE__ */ h(function(i) {
|
|
797
|
+
let p = null;
|
|
798
|
+
if (de(F.beforeSanitizeElements, i, null), Ot(i))
|
|
661
799
|
return ae(i), !0;
|
|
662
|
-
const
|
|
663
|
-
if (de(
|
|
664
|
-
tagName:
|
|
665
|
-
allowedTags:
|
|
666
|
-
}),
|
|
800
|
+
const x = B(i.nodeName);
|
|
801
|
+
if (de(F.uponSanitizeElement, i, {
|
|
802
|
+
tagName: x,
|
|
803
|
+
allowedTags: b
|
|
804
|
+
}), rt && i.hasChildNodes() && !wn(i.firstElementChild) && V(/<[/\w!]/g, i.innerHTML) && V(/<[/\w!]/g, i.textContent) || i.nodeType === Ye.progressingInstruction || rt && i.nodeType === Ye.comment && V(/<[/\w]/g, i.data))
|
|
667
805
|
return ae(i), !0;
|
|
668
|
-
if (!(ke.tagCheck instanceof Function && ke.tagCheck(
|
|
669
|
-
if (!pe[
|
|
806
|
+
if (!(ke.tagCheck instanceof Function && ke.tagCheck(x)) && (!b[x] || pe[x])) {
|
|
807
|
+
if (!pe[x] && Tn(x) && (O.tagNameCheck instanceof RegExp && V(O.tagNameCheck, x) || O.tagNameCheck instanceof Function && O.tagNameCheck(x)))
|
|
670
808
|
return !1;
|
|
671
|
-
if (
|
|
672
|
-
const N =
|
|
673
|
-
if (
|
|
674
|
-
const P =
|
|
675
|
-
for (let
|
|
676
|
-
const ge = D(
|
|
677
|
-
ge.__removalCount = (i.__removalCount || 0) + 1, N.insertBefore(ge,
|
|
809
|
+
if (Dt && !ie[x]) {
|
|
810
|
+
const N = te(i) || i.parentNode, j = xe(i) || i.childNodes;
|
|
811
|
+
if (j && N) {
|
|
812
|
+
const P = j.length;
|
|
813
|
+
for (let Q = P - 1; Q >= 0; --Q) {
|
|
814
|
+
const ge = D(j[Q], !0);
|
|
815
|
+
ge.__removalCount = (i.__removalCount || 0) + 1, N.insertBefore(ge, me(i));
|
|
678
816
|
}
|
|
679
817
|
}
|
|
680
818
|
}
|
|
681
819
|
return ae(i), !0;
|
|
682
820
|
}
|
|
683
|
-
return i instanceof c && !
|
|
684
|
-
|
|
685
|
-
}), i.textContent !==
|
|
821
|
+
return i instanceof c && !ks(i) || (x === "noscript" || x === "noembed" || x === "noframes") && V(/<\/no(script|embed|frames)/i, i.innerHTML) ? (ae(i), !0) : (De && i.nodeType === Ye.text && (p = i.textContent, ht([Ue, L, Be], (N) => {
|
|
822
|
+
p = je(p, N, " ");
|
|
823
|
+
}), i.textContent !== p && (We(t.removed, {
|
|
686
824
|
element: i.cloneNode()
|
|
687
|
-
}), i.textContent =
|
|
688
|
-
}, "_sanitizeElements"), yn = /* @__PURE__ */ h(function(i,
|
|
689
|
-
if (
|
|
825
|
+
}), i.textContent = p)), de(F.afterSanitizeElements, i, null), !1);
|
|
826
|
+
}, "_sanitizeElements"), yn = /* @__PURE__ */ h(function(i, p, x) {
|
|
827
|
+
if (st[p] || un && (p === "id" || p === "name") && (x in e || x in xs))
|
|
690
828
|
return !1;
|
|
691
|
-
if (!(
|
|
692
|
-
if (!(
|
|
693
|
-
if (!(ke.attributeCheck instanceof Function && ke.attributeCheck(
|
|
694
|
-
if (!
|
|
829
|
+
if (!(Et && !st[p] && V(St, p))) {
|
|
830
|
+
if (!(ln && V(At, p))) {
|
|
831
|
+
if (!(ke.attributeCheck instanceof Function && ke.attributeCheck(p, i))) {
|
|
832
|
+
if (!I[p] || st[p]) {
|
|
695
833
|
if (
|
|
696
834
|
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
697
835
|
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
698
836
|
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
699
|
-
!(
|
|
837
|
+
!(Tn(i) && (O.tagNameCheck instanceof RegExp && V(O.tagNameCheck, i) || O.tagNameCheck instanceof Function && O.tagNameCheck(i)) && (O.attributeNameCheck instanceof RegExp && V(O.attributeNameCheck, p) || O.attributeNameCheck instanceof Function && O.attributeNameCheck(p, i)) || // Alternative, second condition checks if it's an `is`-attribute, AND
|
|
700
838
|
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
701
|
-
|
|
839
|
+
p === "is" && O.allowCustomizedBuiltInElements && (O.tagNameCheck instanceof RegExp && V(O.tagNameCheck, x) || O.tagNameCheck instanceof Function && O.tagNameCheck(x)))
|
|
702
840
|
) return !1;
|
|
703
|
-
} else if (!
|
|
704
|
-
if (!
|
|
705
|
-
if (!((
|
|
706
|
-
if (!(
|
|
707
|
-
if (
|
|
841
|
+
} else if (!It[p]) {
|
|
842
|
+
if (!V(E, je(x, Fe, ""))) {
|
|
843
|
+
if (!((p === "src" || p === "xlink:href" || p === "href") && i !== "script" && Ws(x, "data:") === 0 && pn[i])) {
|
|
844
|
+
if (!(on && !V(nt, je(x, Fe, "")))) {
|
|
845
|
+
if (x)
|
|
708
846
|
return !1;
|
|
709
847
|
}
|
|
710
848
|
}
|
|
@@ -714,185 +852,185 @@ function Vn() {
|
|
|
714
852
|
}
|
|
715
853
|
}
|
|
716
854
|
return !0;
|
|
717
|
-
}, "_isValidAttribute"),
|
|
718
|
-
return i !== "annotation-xml" &&
|
|
719
|
-
}, "_isBasicCustomElement"),
|
|
720
|
-
de(
|
|
855
|
+
}, "_isValidAttribute"), Tn = /* @__PURE__ */ h(function(i) {
|
|
856
|
+
return i !== "annotation-xml" && Bt(i, A);
|
|
857
|
+
}, "_isBasicCustomElement"), Sn = /* @__PURE__ */ h(function(i) {
|
|
858
|
+
de(F.beforeSanitizeAttributes, i, null);
|
|
721
859
|
const {
|
|
722
|
-
attributes:
|
|
860
|
+
attributes: p
|
|
723
861
|
} = i;
|
|
724
|
-
if (!
|
|
862
|
+
if (!p || Ot(i))
|
|
725
863
|
return;
|
|
726
|
-
const
|
|
864
|
+
const x = {
|
|
727
865
|
attrName: "",
|
|
728
866
|
attrValue: "",
|
|
729
867
|
keepAttr: !0,
|
|
730
|
-
allowedAttributes:
|
|
868
|
+
allowedAttributes: I,
|
|
731
869
|
forceKeepAttr: void 0
|
|
732
870
|
};
|
|
733
|
-
let N =
|
|
871
|
+
let N = p.length;
|
|
734
872
|
for (; N--; ) {
|
|
735
|
-
const
|
|
873
|
+
const j = p[N], {
|
|
736
874
|
name: P,
|
|
737
|
-
namespaceURI:
|
|
875
|
+
namespaceURI: Q,
|
|
738
876
|
value: ge
|
|
739
|
-
} =
|
|
740
|
-
let
|
|
741
|
-
if (
|
|
742
|
-
|
|
877
|
+
} = j, ze = B(P), Nt = ge;
|
|
878
|
+
let G = P === "value" ? Nt : js(Nt);
|
|
879
|
+
if (x.attrName = ze, x.attrValue = G, x.keepAttr = !0, x.forceKeepAttr = void 0, de(F.uponSanitizeAttribute, i, x), G = x.attrValue, hn && (ze === "id" || ze === "name") && (Te(P, i), G = ps + G), rt && V(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, G)) {
|
|
880
|
+
Te(P, i);
|
|
743
881
|
continue;
|
|
744
882
|
}
|
|
745
|
-
if (
|
|
746
|
-
|
|
883
|
+
if (ze === "attributename" && Bt(G, "href")) {
|
|
884
|
+
Te(P, i);
|
|
747
885
|
continue;
|
|
748
886
|
}
|
|
749
|
-
if (
|
|
887
|
+
if (x.forceKeepAttr)
|
|
750
888
|
continue;
|
|
751
|
-
if (!
|
|
752
|
-
|
|
889
|
+
if (!x.keepAttr) {
|
|
890
|
+
Te(P, i);
|
|
753
891
|
continue;
|
|
754
892
|
}
|
|
755
|
-
if (!
|
|
756
|
-
|
|
893
|
+
if (!cn && V(/\/>/i, G)) {
|
|
894
|
+
Te(P, i);
|
|
757
895
|
continue;
|
|
758
896
|
}
|
|
759
|
-
|
|
760
|
-
|
|
897
|
+
De && ht([Ue, L, Be], (En) => {
|
|
898
|
+
G = je(G, En, " ");
|
|
761
899
|
});
|
|
762
|
-
const
|
|
763
|
-
if (!yn(
|
|
764
|
-
|
|
900
|
+
const An = B(i.nodeName);
|
|
901
|
+
if (!yn(An, ze, G)) {
|
|
902
|
+
Te(P, i);
|
|
765
903
|
continue;
|
|
766
904
|
}
|
|
767
|
-
if (
|
|
768
|
-
switch (
|
|
905
|
+
if (U && typeof m == "object" && typeof m.getAttributeType == "function" && !Q)
|
|
906
|
+
switch (m.getAttributeType(An, ze)) {
|
|
769
907
|
case "TrustedHTML": {
|
|
770
|
-
|
|
908
|
+
G = U.createHTML(G);
|
|
771
909
|
break;
|
|
772
910
|
}
|
|
773
911
|
case "TrustedScriptURL": {
|
|
774
|
-
|
|
912
|
+
G = U.createScriptURL(G);
|
|
775
913
|
break;
|
|
776
914
|
}
|
|
777
915
|
}
|
|
778
|
-
if (
|
|
916
|
+
if (G !== Nt)
|
|
779
917
|
try {
|
|
780
|
-
|
|
918
|
+
Q ? i.setAttributeNS(Q, P, G) : i.setAttribute(P, G), Ot(i) ? ae(i) : Ln(t.removed);
|
|
781
919
|
} catch {
|
|
782
|
-
|
|
920
|
+
Te(P, i);
|
|
783
921
|
}
|
|
784
922
|
}
|
|
785
|
-
de(
|
|
786
|
-
}, "_sanitizeAttributes"),
|
|
787
|
-
let
|
|
788
|
-
const
|
|
789
|
-
for (de(
|
|
790
|
-
de(
|
|
791
|
-
de(
|
|
923
|
+
de(F.afterSanitizeAttributes, i, null);
|
|
924
|
+
}, "_sanitizeAttributes"), bs = /* @__PURE__ */ h(function k(i) {
|
|
925
|
+
let p = null;
|
|
926
|
+
const x = bn(i);
|
|
927
|
+
for (de(F.beforeSanitizeShadowDOM, i, null); p = x.nextNode(); )
|
|
928
|
+
de(F.uponSanitizeShadowNode, p, null), vn(p), Sn(p), p.content instanceof r && k(p.content);
|
|
929
|
+
de(F.afterSanitizeShadowDOM, i, null);
|
|
792
930
|
}, "_sanitizeShadowDOM");
|
|
793
931
|
return t.sanitize = function(k) {
|
|
794
|
-
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
795
|
-
if (
|
|
932
|
+
let i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, p = null, x = null, N = null, j = null;
|
|
933
|
+
if (Mt = !k, Mt && (k = "<!-->"), typeof k != "string" && !wn(k))
|
|
796
934
|
if (typeof k.toString == "function") {
|
|
797
935
|
if (k = k.toString(), typeof k != "string")
|
|
798
|
-
throw
|
|
936
|
+
throw qe("dirty is not a string, aborting");
|
|
799
937
|
} else
|
|
800
|
-
throw
|
|
938
|
+
throw qe("toString is not a function");
|
|
801
939
|
if (!t.isSupported)
|
|
802
940
|
return k;
|
|
803
|
-
if (
|
|
941
|
+
if (_t || zt(i), t.removed = [], typeof k == "string" && (He = !1), He) {
|
|
804
942
|
if (k.nodeName) {
|
|
805
|
-
const ge =
|
|
806
|
-
if (!
|
|
807
|
-
throw
|
|
943
|
+
const ge = B(k.nodeName);
|
|
944
|
+
if (!b[ge] || pe[ge])
|
|
945
|
+
throw qe("root node is forbidden and cannot be sanitized in-place");
|
|
808
946
|
}
|
|
809
947
|
} else if (k instanceof o)
|
|
810
|
-
|
|
948
|
+
p = kn("<!---->"), x = p.ownerDocument.importNode(k, !0), x.nodeType === Ye.element && x.nodeName === "BODY" || x.nodeName === "HTML" ? p = x : p.appendChild(x);
|
|
811
949
|
else {
|
|
812
|
-
if (!
|
|
950
|
+
if (!Ce && !De && !ye && // eslint-disable-next-line unicorn/prefer-includes
|
|
813
951
|
k.indexOf("<") === -1)
|
|
814
|
-
return
|
|
815
|
-
if (
|
|
816
|
-
return
|
|
952
|
+
return U && at ? U.createHTML(k) : k;
|
|
953
|
+
if (p = kn(k), !p)
|
|
954
|
+
return Ce ? null : at ? q : "";
|
|
817
955
|
}
|
|
818
|
-
|
|
819
|
-
const P =
|
|
956
|
+
p && Rt && ae(p.firstChild);
|
|
957
|
+
const P = bn(He ? k : p);
|
|
820
958
|
for (; N = P.nextNode(); )
|
|
821
|
-
|
|
822
|
-
if (
|
|
959
|
+
vn(N), Sn(N), N.content instanceof r && bs(N.content);
|
|
960
|
+
if (He)
|
|
823
961
|
return k;
|
|
824
|
-
if (
|
|
825
|
-
if (
|
|
826
|
-
for (
|
|
827
|
-
|
|
962
|
+
if (Ce) {
|
|
963
|
+
if (it)
|
|
964
|
+
for (j = et.call(p.ownerDocument); p.firstChild; )
|
|
965
|
+
j.appendChild(p.firstChild);
|
|
828
966
|
else
|
|
829
|
-
|
|
830
|
-
return (
|
|
967
|
+
j = p;
|
|
968
|
+
return (I.shadowroot || I.shadowrootmode) && (j = Tt.call(n, j, !0)), j;
|
|
831
969
|
}
|
|
832
|
-
let
|
|
833
|
-
return ye &&
|
|
834
|
-
` +
|
|
835
|
-
|
|
836
|
-
}),
|
|
970
|
+
let Q = ye ? p.outerHTML : p.innerHTML;
|
|
971
|
+
return ye && b["!doctype"] && p.ownerDocument && p.ownerDocument.doctype && p.ownerDocument.doctype.name && V(Kn, p.ownerDocument.doctype.name) && (Q = "<!DOCTYPE " + p.ownerDocument.doctype.name + `>
|
|
972
|
+
` + Q), De && ht([Ue, L, Be], (ge) => {
|
|
973
|
+
Q = je(Q, ge, " ");
|
|
974
|
+
}), U && at ? U.createHTML(Q) : Q;
|
|
837
975
|
}, t.setConfig = function() {
|
|
838
976
|
let k = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
839
|
-
|
|
977
|
+
zt(k), _t = !0;
|
|
840
978
|
}, t.clearConfig = function() {
|
|
841
|
-
|
|
842
|
-
}, t.isValidAttribute = function(k, i,
|
|
843
|
-
|
|
844
|
-
const
|
|
845
|
-
return yn(
|
|
979
|
+
Le = null, _t = !1;
|
|
980
|
+
}, t.isValidAttribute = function(k, i, p) {
|
|
981
|
+
Le || zt({});
|
|
982
|
+
const x = B(k), N = B(i);
|
|
983
|
+
return yn(x, N, p);
|
|
846
984
|
}, t.addHook = function(k, i) {
|
|
847
|
-
typeof i == "function" &&
|
|
985
|
+
typeof i == "function" && We(F[k], i);
|
|
848
986
|
}, t.removeHook = function(k, i) {
|
|
849
987
|
if (i !== void 0) {
|
|
850
|
-
const
|
|
851
|
-
return
|
|
988
|
+
const p = Hs(F[k], i);
|
|
989
|
+
return p === -1 ? void 0 : Gs(F[k], p, 1)[0];
|
|
852
990
|
}
|
|
853
|
-
return
|
|
991
|
+
return Ln(F[k]);
|
|
854
992
|
}, t.removeHooks = function(k) {
|
|
855
|
-
|
|
993
|
+
F[k] = [];
|
|
856
994
|
}, t.removeAllHooks = function() {
|
|
857
|
-
|
|
995
|
+
F = Un();
|
|
858
996
|
}, t;
|
|
859
997
|
}
|
|
860
|
-
h(
|
|
861
|
-
var
|
|
998
|
+
h(Jn, "createDOMPurify");
|
|
999
|
+
var ar = Jn();
|
|
862
1000
|
function Xt() {
|
|
863
1001
|
return { async: !1, breaks: !1, extensions: null, gfm: !0, hooks: null, pedantic: !1, renderer: null, silent: !1, tokenizer: null, walkTokens: null };
|
|
864
1002
|
}
|
|
865
1003
|
h(Xt, "M");
|
|
866
|
-
var
|
|
867
|
-
function
|
|
868
|
-
|
|
1004
|
+
var Re = Xt();
|
|
1005
|
+
function es(l) {
|
|
1006
|
+
Re = l;
|
|
869
1007
|
}
|
|
870
|
-
h(
|
|
871
|
-
var
|
|
872
|
-
function
|
|
1008
|
+
h(es, "G");
|
|
1009
|
+
var Ae = { exec: /* @__PURE__ */ h(() => null, "exec") };
|
|
1010
|
+
function C(l, t = "") {
|
|
873
1011
|
let e = typeof l == "string" ? l : l.source, n = { replace: /* @__PURE__ */ h((s, r) => {
|
|
874
1012
|
let a = typeof r == "string" ? r : r.source;
|
|
875
1013
|
return a = a.replace(Y.caret, "$1"), e = e.replace(s, a), n;
|
|
876
1014
|
}, "replace"), getRegex: /* @__PURE__ */ h(() => new RegExp(e, t), "getRegex") };
|
|
877
1015
|
return n;
|
|
878
1016
|
}
|
|
879
|
-
h(
|
|
880
|
-
var
|
|
1017
|
+
h(C, "k");
|
|
1018
|
+
var lr = (() => {
|
|
881
1019
|
try {
|
|
882
1020
|
return !!new RegExp("(?<=1)(?<!1)");
|
|
883
1021
|
} catch {
|
|
884
1022
|
return !1;
|
|
885
1023
|
}
|
|
886
|
-
})(), Y = { 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((l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}>`), "blockquoteBeginRegex") },
|
|
887
|
-
]`).replace("lheading",
|
|
1024
|
+
})(), Y = { 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((l) => new RegExp(`^( {0,3}${l})((?:[ ][^\\n]*)?(?:\\n|$))`), "listItemRegex"), nextBulletRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), "nextBulletRegex"), hrRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), "hrRegex"), fencesBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}(?:\`\`\`|~~~)`), "fencesBeginRegex"), headingBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}#`), "headingBeginRegex"), htmlBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}<(?:[a-z].*>|!--)`, "i"), "htmlBeginRegex"), blockquoteBeginRegex: /* @__PURE__ */ h((l) => new RegExp(`^ {0,${Math.min(3, l - 1)}}>`), "blockquoteBeginRegex") }, or = /^(?:[ \t]*(?:\n|$))+/, cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, ur = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Je = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, hr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Qt = / {0,3}(?:[*+-]|\d{1,9}[.)])/, ts = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ns = C(ts).replace(/bull/g, Qt).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(), pr = C(ts).replace(/bull/g, Qt).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(), Kt = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, fr = /^[^\n]+/, Jt = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, dr = C(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Jt).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), gr = C(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Qt).getRegex(), vt = "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", en = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, mr = 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", en).replace("tag", vt).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ss = C(Kt).replace("hr", Je).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", vt).getRegex(), xr = C(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ss).getRegex(), tn = { blockquote: xr, code: cr, def: dr, fences: ur, heading: hr, hr: Je, html: mr, lheading: ns, list: gr, newline: or, paragraph: ss, table: Ae, text: fr }, Bn = C("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Je).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", vt).getRegex(), kr = { ...tn, lheading: pr, table: Bn, paragraph: C(Kt).replace("hr", Je).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Bn).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", vt).getRegex() }, br = { ...tn, html: C(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", en).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: Ae, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: C(Kt).replace("hr", Je).replace("heading", ` *#{1,6} *[^
|
|
1025
|
+
]`).replace("lheading", ns).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, vr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, rs = /^( {2,}|\\)\n(?!\s*$)/, yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, yt = /[\p{P}\p{S}]/u, nn = /[\s\p{P}\p{S}]/u, is = /[^\s\p{P}\p{S}]/u, Tr = C(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, nn).getRegex(), as = /(?!~)[\p{P}\p{S}]/u, Sr = /(?!~)[\s\p{P}\p{S}]/u, Ar = /(?:[^\s\p{P}\p{S}]|~)/u, ls = /(?![*_])[\p{P}\p{S}]/u, Er = /(?![*_])[\s\p{P}\p{S}]/u, _r = /(?:[^\s\p{P}\p{S}]|[*_])/u, Rr = C(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", lr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), os = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, Dr = C(os, "u").replace(/punct/g, yt).getRegex(), Cr = C(os, "u").replace(/punct/g, as).getRegex(), cs = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", Ir = C(cs, "gu").replace(/notPunctSpace/g, is).replace(/punctSpace/g, nn).replace(/punct/g, yt).getRegex(), Mr = C(cs, "gu").replace(/notPunctSpace/g, Ar).replace(/punctSpace/g, Sr).replace(/punct/g, as).getRegex(), Lr = C("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, is).replace(/punctSpace/g, nn).replace(/punct/g, yt).getRegex(), zr = C(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, ls).getRegex(), Or = "^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", Nr = C(Or, "gu").replace(/notPunctSpace/g, _r).replace(/punctSpace/g, Er).replace(/punct/g, ls).getRegex(), Pr = C(/\\(punct)/, "gu").replace(/punct/g, yt).getRegex(), $r = 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(), Ur = C(en).replace("(?:-->|$)", "-->").getRegex(), Br = 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", Ur).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), kt = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, Fr = C(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", kt).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), us = C(/^!?\[(label)\]\[(ref)\]/).replace("label", kt).replace("ref", Jt).getRegex(), hs = C(/^!?\[(ref)\](?:\[\])?/).replace("ref", Jt).getRegex(), Hr = C("reflink|nolink(?!\\()", "g").replace("reflink", us).replace("nolink", hs).getRegex(), Fn = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, sn = { _backpedal: Ae, anyPunctuation: Pr, autolink: $r, blockSkip: Rr, br: rs, code: vr, del: Ae, delLDelim: Ae, delRDelim: Ae, emStrongLDelim: Dr, emStrongRDelimAst: Ir, emStrongRDelimUnd: Lr, escape: wr, link: Fr, nolink: hs, punctuation: Tr, reflink: us, reflinkSearch: Hr, tag: Br, text: yr, url: Ae }, Gr = { ...sn, link: C(/^!?\[(label)\]\((.*?)\)/).replace("label", kt).getRegex(), reflink: C(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", kt).getRegex() }, Yt = { ...sn, emStrongRDelimAst: Mr, emStrongLDelim: Cr, delLDelim: zr, delRDelim: Nr, url: C(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", Fn).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", Fn).getRegex() }, Wr = { ...Yt, br: C(rs).replace("{2,}", "*").getRegex(), text: C(Yt.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, ft = { normal: tn, gfm: kr, pedantic: br }, Ze = { normal: sn, gfm: Yt, breaks: Wr, pedantic: Gr }, jr = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, Hn = /* @__PURE__ */ h((l) => jr[l], "de");
|
|
888
1026
|
function oe(l, t) {
|
|
889
1027
|
if (t) {
|
|
890
|
-
if (Y.escapeTest.test(l)) return l.replace(Y.escapeReplace,
|
|
891
|
-
} else if (Y.escapeTestNoEncode.test(l)) return l.replace(Y.escapeReplaceNoEncode,
|
|
1028
|
+
if (Y.escapeTest.test(l)) return l.replace(Y.escapeReplace, Hn);
|
|
1029
|
+
} else if (Y.escapeTestNoEncode.test(l)) return l.replace(Y.escapeReplaceNoEncode, Hn);
|
|
892
1030
|
return l;
|
|
893
1031
|
}
|
|
894
1032
|
h(oe, "O");
|
|
895
|
-
function
|
|
1033
|
+
function Gn(l) {
|
|
896
1034
|
try {
|
|
897
1035
|
l = encodeURI(l).replace(Y.percentDecode, "%");
|
|
898
1036
|
} catch {
|
|
@@ -900,11 +1038,11 @@ function Hn(l) {
|
|
|
900
1038
|
}
|
|
901
1039
|
return l;
|
|
902
1040
|
}
|
|
903
|
-
h(
|
|
904
|
-
function
|
|
1041
|
+
h(Gn, "X");
|
|
1042
|
+
function Wn(l, t) {
|
|
905
1043
|
let e = l.replace(Y.findPipe, (r, a, o) => {
|
|
906
|
-
let c = !1,
|
|
907
|
-
for (; --
|
|
1044
|
+
let c = !1, f = a;
|
|
1045
|
+
for (; --f >= 0 && o[f] === "\\"; ) c = !c;
|
|
908
1046
|
return c ? "|" : " |";
|
|
909
1047
|
}), n = e.split(Y.splitPipe), s = 0;
|
|
910
1048
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) if (n.length > t) n.splice(t);
|
|
@@ -912,7 +1050,7 @@ function Gn(l, t) {
|
|
|
912
1050
|
for (; s < n.length; s++) n[s] = n[s].trim().replace(Y.slashPipe, "|");
|
|
913
1051
|
return n;
|
|
914
1052
|
}
|
|
915
|
-
h(
|
|
1053
|
+
h(Wn, "J");
|
|
916
1054
|
function Xe(l, t, e) {
|
|
917
1055
|
let n = l.length;
|
|
918
1056
|
if (n === 0) return "";
|
|
@@ -922,7 +1060,7 @@ function Xe(l, t, e) {
|
|
|
922
1060
|
return l.slice(0, n - s);
|
|
923
1061
|
}
|
|
924
1062
|
h(Xe, "E");
|
|
925
|
-
function
|
|
1063
|
+
function qr(l, t) {
|
|
926
1064
|
if (l.indexOf(t[1]) === -1) return -1;
|
|
927
1065
|
let e = 0;
|
|
928
1066
|
for (let n = 0; n < l.length; n++) if (l[n] === "\\") n++;
|
|
@@ -930,8 +1068,8 @@ function Hr(l, t) {
|
|
|
930
1068
|
else if (l[n] === t[1] && (e--, e < 0)) return n;
|
|
931
1069
|
return e > 0 ? -2 : -1;
|
|
932
1070
|
}
|
|
933
|
-
h(
|
|
934
|
-
function
|
|
1071
|
+
h(qr, "ge");
|
|
1072
|
+
function Vr(l, t = 0) {
|
|
935
1073
|
let e = t, n = "";
|
|
936
1074
|
for (let s of l) if (s === " ") {
|
|
937
1075
|
let r = 4 - e % 4;
|
|
@@ -939,15 +1077,15 @@ function Gr(l, t = 0) {
|
|
|
939
1077
|
} else n += s, e++;
|
|
940
1078
|
return n;
|
|
941
1079
|
}
|
|
942
|
-
h(
|
|
943
|
-
function
|
|
1080
|
+
h(Vr, "fe");
|
|
1081
|
+
function jn(l, t, e, n, s) {
|
|
944
1082
|
let r = t.href, a = t.title || null, o = l[1].replace(s.other.outputLinkReplace, "$1");
|
|
945
1083
|
n.state.inLink = !0;
|
|
946
1084
|
let c = { type: l[0].charAt(0) === "!" ? "image" : "link", raw: e, href: r, title: a, text: o, tokens: n.inlineTokens(o) };
|
|
947
1085
|
return n.state.inLink = !1, c;
|
|
948
1086
|
}
|
|
949
|
-
h(
|
|
950
|
-
function
|
|
1087
|
+
h(jn, "me");
|
|
1088
|
+
function Yr(l, t, e) {
|
|
951
1089
|
let n = l.match(e.other.indentCodeCompensation);
|
|
952
1090
|
if (n === null) return t;
|
|
953
1091
|
let s = n[1];
|
|
@@ -960,13 +1098,13 @@ function Wr(l, t, e) {
|
|
|
960
1098
|
}).join(`
|
|
961
1099
|
`);
|
|
962
1100
|
}
|
|
963
|
-
h(
|
|
964
|
-
var Oe,
|
|
1101
|
+
h(Yr, "it");
|
|
1102
|
+
var Oe, bt = (Oe = class {
|
|
965
1103
|
constructor(t) {
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
this.options = t ||
|
|
1104
|
+
R(this, "options");
|
|
1105
|
+
R(this, "rules");
|
|
1106
|
+
R(this, "lexer");
|
|
1107
|
+
this.options = t || Re;
|
|
970
1108
|
}
|
|
971
1109
|
space(t) {
|
|
972
1110
|
let e = this.rules.block.newline.exec(t);
|
|
@@ -983,7 +1121,7 @@ var Oe, mt = (Oe = class {
|
|
|
983
1121
|
fences(t) {
|
|
984
1122
|
let e = this.rules.block.fences.exec(t);
|
|
985
1123
|
if (e) {
|
|
986
|
-
let n = e[0], s =
|
|
1124
|
+
let n = e[0], s = Yr(n, e[3] || "", this.rules);
|
|
987
1125
|
return { type: "code", raw: n, lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2], text: s };
|
|
988
1126
|
}
|
|
989
1127
|
}
|
|
@@ -1010,32 +1148,32 @@ var Oe, mt = (Oe = class {
|
|
|
1010
1148
|
`).split(`
|
|
1011
1149
|
`), s = "", r = "", a = [];
|
|
1012
1150
|
for (; n.length > 0; ) {
|
|
1013
|
-
let o = !1, c = [],
|
|
1014
|
-
for (
|
|
1015
|
-
else if (!o) c.push(n[
|
|
1151
|
+
let o = !1, c = [], f;
|
|
1152
|
+
for (f = 0; f < n.length; f++) if (this.rules.other.blockquoteStart.test(n[f])) c.push(n[f]), o = !0;
|
|
1153
|
+
else if (!o) c.push(n[f]);
|
|
1016
1154
|
else break;
|
|
1017
|
-
n = n.slice(
|
|
1018
|
-
let
|
|
1019
|
-
`),
|
|
1155
|
+
n = n.slice(f);
|
|
1156
|
+
let d = c.join(`
|
|
1157
|
+
`), u = d.replace(this.rules.other.blockquoteSetextReplace, `
|
|
1020
1158
|
$1`).replace(this.rules.other.blockquoteSetextReplace2, "");
|
|
1021
1159
|
s = s ? `${s}
|
|
1022
|
-
${
|
|
1023
|
-
${
|
|
1024
|
-
let
|
|
1025
|
-
if (this.lexer.state.top = !0, this.lexer.blockTokens(
|
|
1026
|
-
let
|
|
1027
|
-
if (
|
|
1028
|
-
if (
|
|
1029
|
-
let
|
|
1160
|
+
${d}` : d, r = r ? `${r}
|
|
1161
|
+
${u}` : u;
|
|
1162
|
+
let g = this.lexer.state.top;
|
|
1163
|
+
if (this.lexer.state.top = !0, this.lexer.blockTokens(u, a, !0), this.lexer.state.top = g, n.length === 0) break;
|
|
1164
|
+
let m = a.at(-1);
|
|
1165
|
+
if (m?.type === "code") break;
|
|
1166
|
+
if (m?.type === "blockquote") {
|
|
1167
|
+
let S = m, D = S.raw + `
|
|
1030
1168
|
` + n.join(`
|
|
1031
|
-
`),
|
|
1032
|
-
a[a.length - 1] =
|
|
1169
|
+
`), $ = this.blockquote(D);
|
|
1170
|
+
a[a.length - 1] = $, s = s.substring(0, s.length - S.raw.length) + $.raw, r = r.substring(0, r.length - S.text.length) + $.text;
|
|
1033
1171
|
break;
|
|
1034
|
-
} else if (
|
|
1035
|
-
let
|
|
1172
|
+
} else if (m?.type === "list") {
|
|
1173
|
+
let S = m, D = S.raw + `
|
|
1036
1174
|
` + n.join(`
|
|
1037
|
-
`),
|
|
1038
|
-
a[a.length - 1] =
|
|
1175
|
+
`), $ = this.list(D);
|
|
1176
|
+
a[a.length - 1] = $, s = s.substring(0, s.length - m.raw.length) + $.raw, r = r.substring(0, r.length - S.raw.length) + $.raw, n = D.substring(a.at(-1).raw.length).split(`
|
|
1039
1177
|
`);
|
|
1040
1178
|
continue;
|
|
1041
1179
|
}
|
|
@@ -1050,59 +1188,59 @@ ${d}` : d;
|
|
|
1050
1188
|
n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
|
|
1051
1189
|
let a = this.rules.other.listItemRegex(n), o = !1;
|
|
1052
1190
|
for (; t; ) {
|
|
1053
|
-
let
|
|
1191
|
+
let f = !1, d = "", u = "";
|
|
1054
1192
|
if (!(e = a.exec(t)) || this.rules.block.hr.test(t)) break;
|
|
1055
|
-
|
|
1056
|
-
let
|
|
1057
|
-
`, 1)[0], e[1].length),
|
|
1058
|
-
`, 1)[0],
|
|
1059
|
-
if (this.options.pedantic ? (D = 2,
|
|
1060
|
-
`, t = t.substring(
|
|
1061
|
-
let
|
|
1193
|
+
d = e[0], t = t.substring(d.length);
|
|
1194
|
+
let g = Vr(e[2].split(`
|
|
1195
|
+
`, 1)[0], e[1].length), m = t.split(`
|
|
1196
|
+
`, 1)[0], S = !g.trim(), D = 0;
|
|
1197
|
+
if (this.options.pedantic ? (D = 2, u = g.trimStart()) : S ? D = e[1].length + 1 : (D = g.search(this.rules.other.nonSpaceChar), D = D > 4 ? 1 : D, u = g.slice(D), D += e[1].length), S && this.rules.other.blankLine.test(m) && (d += m + `
|
|
1198
|
+
`, t = t.substring(m.length + 1), f = !0), !f) {
|
|
1199
|
+
let $ = this.rules.other.nextBulletRegex(D), me = this.rules.other.hrRegex(D), xe = this.rules.other.fencesBeginRegex(D), te = this.rules.other.headingBeginRegex(D), U = this.rules.other.htmlBeginRegex(D), q = this.rules.other.blockquoteBeginRegex(D);
|
|
1062
1200
|
for (; t; ) {
|
|
1063
|
-
let
|
|
1201
|
+
let ne = t.split(`
|
|
1064
1202
|
`, 1)[0], ue;
|
|
1065
|
-
if (
|
|
1066
|
-
if (ue.search(this.rules.other.nonSpaceChar) >= D || !
|
|
1203
|
+
if (m = ne, this.options.pedantic ? (m = m.replace(this.rules.other.listReplaceNesting, " "), ue = m) : ue = m.replace(this.rules.other.tabCharGlobal, " "), xe.test(m) || te.test(m) || U.test(m) || q.test(m) || $.test(m) || me.test(m)) break;
|
|
1204
|
+
if (ue.search(this.rules.other.nonSpaceChar) >= D || !m.trim()) u += `
|
|
1067
1205
|
` + ue.slice(D);
|
|
1068
1206
|
else {
|
|
1069
|
-
if (
|
|
1070
|
-
|
|
1071
|
-
` +
|
|
1207
|
+
if (S || g.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || xe.test(g) || te.test(g) || me.test(g)) break;
|
|
1208
|
+
u += `
|
|
1209
|
+
` + m;
|
|
1072
1210
|
}
|
|
1073
|
-
|
|
1074
|
-
`, t = t.substring(
|
|
1211
|
+
S = !m.trim(), d += ne + `
|
|
1212
|
+
`, t = t.substring(ne.length + 1), g = ue.slice(D);
|
|
1075
1213
|
}
|
|
1076
1214
|
}
|
|
1077
|
-
r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1215
|
+
r.loose || (o ? r.loose = !0 : this.rules.other.doubleBlankLine.test(d) && (o = !0)), r.items.push({ type: "list_item", raw: d, task: !!this.options.gfm && this.rules.other.listIsTask.test(u), loose: !1, text: u, tokens: [] }), r.raw += d;
|
|
1078
1216
|
}
|
|
1079
1217
|
let c = r.items.at(-1);
|
|
1080
1218
|
if (c) c.raw = c.raw.trimEnd(), c.text = c.text.trimEnd();
|
|
1081
1219
|
else return;
|
|
1082
1220
|
r.raw = r.raw.trimEnd();
|
|
1083
|
-
for (let
|
|
1084
|
-
if (this.lexer.state.top = !1,
|
|
1085
|
-
if (
|
|
1086
|
-
|
|
1087
|
-
for (let
|
|
1088
|
-
this.lexer.inlineQueue[
|
|
1221
|
+
for (let f of r.items) {
|
|
1222
|
+
if (this.lexer.state.top = !1, f.tokens = this.lexer.blockTokens(f.text, []), f.task) {
|
|
1223
|
+
if (f.text = f.text.replace(this.rules.other.listReplaceTask, ""), f.tokens[0]?.type === "text" || f.tokens[0]?.type === "paragraph") {
|
|
1224
|
+
f.tokens[0].raw = f.tokens[0].raw.replace(this.rules.other.listReplaceTask, ""), f.tokens[0].text = f.tokens[0].text.replace(this.rules.other.listReplaceTask, "");
|
|
1225
|
+
for (let u = this.lexer.inlineQueue.length - 1; u >= 0; u--) if (this.rules.other.listIsTask.test(this.lexer.inlineQueue[u].src)) {
|
|
1226
|
+
this.lexer.inlineQueue[u].src = this.lexer.inlineQueue[u].src.replace(this.rules.other.listReplaceTask, "");
|
|
1089
1227
|
break;
|
|
1090
1228
|
}
|
|
1091
1229
|
}
|
|
1092
|
-
let
|
|
1093
|
-
if (
|
|
1094
|
-
let
|
|
1095
|
-
|
|
1230
|
+
let d = this.rules.other.listTaskCheckbox.exec(f.raw);
|
|
1231
|
+
if (d) {
|
|
1232
|
+
let u = { type: "checkbox", raw: d[0] + " ", checked: d[0] !== "[ ]" };
|
|
1233
|
+
f.checked = u.checked, r.loose ? f.tokens[0] && ["paragraph", "text"].includes(f.tokens[0].type) && "tokens" in f.tokens[0] && f.tokens[0].tokens ? (f.tokens[0].raw = u.raw + f.tokens[0].raw, f.tokens[0].text = u.raw + f.tokens[0].text, f.tokens[0].tokens.unshift(u)) : f.tokens.unshift({ type: "paragraph", raw: u.raw, text: u.raw, tokens: [u] }) : f.tokens.unshift(u);
|
|
1096
1234
|
}
|
|
1097
1235
|
}
|
|
1098
1236
|
if (!r.loose) {
|
|
1099
|
-
let
|
|
1100
|
-
r.loose =
|
|
1237
|
+
let d = f.tokens.filter((g) => g.type === "space"), u = d.length > 0 && d.some((g) => this.rules.other.anyLine.test(g.raw));
|
|
1238
|
+
r.loose = u;
|
|
1101
1239
|
}
|
|
1102
1240
|
}
|
|
1103
|
-
if (r.loose) for (let
|
|
1104
|
-
|
|
1105
|
-
for (let
|
|
1241
|
+
if (r.loose) for (let f of r.items) {
|
|
1242
|
+
f.loose = !0;
|
|
1243
|
+
for (let d of f.tokens) d.type === "text" && (d.type = "paragraph");
|
|
1106
1244
|
}
|
|
1107
1245
|
return r;
|
|
1108
1246
|
}
|
|
@@ -1121,12 +1259,12 @@ ${d}` : d;
|
|
|
1121
1259
|
table(t) {
|
|
1122
1260
|
let e = this.rules.block.table.exec(t);
|
|
1123
1261
|
if (!e || !this.rules.other.tableDelimiter.test(e[2])) return;
|
|
1124
|
-
let n =
|
|
1262
|
+
let n = Wn(e[1]), s = e[2].replace(this.rules.other.tableAlignChars, "").split("|"), r = e[3]?.trim() ? e[3].replace(this.rules.other.tableRowBlankLine, "").split(`
|
|
1125
1263
|
`) : [], a = { type: "table", raw: e[0], header: [], align: [], rows: [] };
|
|
1126
1264
|
if (n.length === s.length) {
|
|
1127
1265
|
for (let o of s) this.rules.other.tableAlignRight.test(o) ? a.align.push("right") : this.rules.other.tableAlignCenter.test(o) ? a.align.push("center") : this.rules.other.tableAlignLeft.test(o) ? a.align.push("left") : a.align.push(null);
|
|
1128
1266
|
for (let o = 0; o < n.length; o++) a.header.push({ text: n[o], tokens: this.lexer.inline(n[o]), header: !0, align: a.align[o] });
|
|
1129
|
-
for (let o of r) a.rows.push(
|
|
1267
|
+
for (let o of r) a.rows.push(Wn(o, a.header.length).map((c, f) => ({ text: c, tokens: this.lexer.inline(c), header: !1, align: a.align[f] })));
|
|
1130
1268
|
return a;
|
|
1131
1269
|
}
|
|
1132
1270
|
}
|
|
@@ -1163,7 +1301,7 @@ ${d}` : d;
|
|
|
1163
1301
|
let a = Xe(n.slice(0, -1), "\\");
|
|
1164
1302
|
if ((n.length - a.length) % 2 === 0) return;
|
|
1165
1303
|
} else {
|
|
1166
|
-
let a =
|
|
1304
|
+
let a = qr(e[2], "()");
|
|
1167
1305
|
if (a === -2) return;
|
|
1168
1306
|
if (a > -1) {
|
|
1169
1307
|
let o = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + a;
|
|
@@ -1175,7 +1313,7 @@ ${d}` : d;
|
|
|
1175
1313
|
let a = this.rules.other.pedanticHrefTitle.exec(s);
|
|
1176
1314
|
a && (s = a[1], r = a[3]);
|
|
1177
1315
|
} else r = e[3] ? e[3].slice(1, -1) : "";
|
|
1178
|
-
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)),
|
|
1316
|
+
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)), jn(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);
|
|
1179
1317
|
}
|
|
1180
1318
|
}
|
|
1181
1319
|
reflink(t, e) {
|
|
@@ -1186,31 +1324,31 @@ ${d}` : d;
|
|
|
1186
1324
|
let a = n[0].charAt(0);
|
|
1187
1325
|
return { type: "text", raw: a, text: a };
|
|
1188
1326
|
}
|
|
1189
|
-
return
|
|
1327
|
+
return jn(n, r, n[0], this.lexer, this.rules);
|
|
1190
1328
|
}
|
|
1191
1329
|
}
|
|
1192
1330
|
emStrong(t, e, n = "") {
|
|
1193
1331
|
let s = this.rules.inline.emStrongLDelim.exec(t);
|
|
1194
1332
|
if (!(!s || s[3] && n.match(this.rules.other.unicodeAlphaNumeric)) && (!(s[1] || s[2]) || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1195
|
-
let r = [...s[0]].length - 1, a, o, c = r,
|
|
1196
|
-
for (
|
|
1333
|
+
let r = [...s[0]].length - 1, a, o, c = r, f = 0, d = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
|
|
1334
|
+
for (d.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = d.exec(e)) != null; ) {
|
|
1197
1335
|
if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a) continue;
|
|
1198
1336
|
if (o = [...a].length, s[3] || s[4]) {
|
|
1199
1337
|
c += o;
|
|
1200
1338
|
continue;
|
|
1201
1339
|
} else if ((s[5] || s[6]) && r % 3 && !((r + o) % 3)) {
|
|
1202
|
-
|
|
1340
|
+
f += o;
|
|
1203
1341
|
continue;
|
|
1204
1342
|
}
|
|
1205
1343
|
if (c -= o, c > 0) continue;
|
|
1206
|
-
o = Math.min(o, o + c +
|
|
1207
|
-
let
|
|
1344
|
+
o = Math.min(o, o + c + f);
|
|
1345
|
+
let u = [...s[0]][0].length, g = t.slice(0, r + s.index + u + o);
|
|
1208
1346
|
if (Math.min(r, o) % 2) {
|
|
1209
|
-
let
|
|
1210
|
-
return { type: "em", raw:
|
|
1347
|
+
let S = g.slice(1, -1);
|
|
1348
|
+
return { type: "em", raw: g, text: S, tokens: this.lexer.inlineTokens(S) };
|
|
1211
1349
|
}
|
|
1212
|
-
let
|
|
1213
|
-
return { type: "strong", raw:
|
|
1350
|
+
let m = g.slice(2, -2);
|
|
1351
|
+
return { type: "strong", raw: g, text: m, tokens: this.lexer.inlineTokens(m) };
|
|
1214
1352
|
}
|
|
1215
1353
|
}
|
|
1216
1354
|
}
|
|
@@ -1228,8 +1366,8 @@ ${d}` : d;
|
|
|
1228
1366
|
del(t, e, n = "") {
|
|
1229
1367
|
let s = this.rules.inline.delLDelim.exec(t);
|
|
1230
1368
|
if (s && (!s[1] || !n || this.rules.inline.punctuation.exec(n))) {
|
|
1231
|
-
let r = [...s[0]].length - 1, a, o, c = r,
|
|
1232
|
-
for (
|
|
1369
|
+
let r = [...s[0]].length - 1, a, o, c = r, f = this.rules.inline.delRDelim;
|
|
1370
|
+
for (f.lastIndex = 0, e = e.slice(-1 * t.length + r); (s = f.exec(e)) != null; ) {
|
|
1233
1371
|
if (a = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !a || (o = [...a].length, o !== r)) continue;
|
|
1234
1372
|
if (s[3] || s[4]) {
|
|
1235
1373
|
c += o;
|
|
@@ -1237,8 +1375,8 @@ ${d}` : d;
|
|
|
1237
1375
|
}
|
|
1238
1376
|
if (c -= o, c > 0) continue;
|
|
1239
1377
|
o = Math.min(o, o + c);
|
|
1240
|
-
let
|
|
1241
|
-
return { type: "del", raw:
|
|
1378
|
+
let d = [...s[0]][0].length, u = t.slice(0, r + s.index + d + o), g = u.slice(r, -r);
|
|
1379
|
+
return { type: "del", raw: u, text: g, tokens: this.lexer.inlineTokens(g) };
|
|
1242
1380
|
}
|
|
1243
1381
|
}
|
|
1244
1382
|
}
|
|
@@ -1271,25 +1409,25 @@ ${d}` : d;
|
|
|
1271
1409
|
return { type: "text", raw: e[0], text: e[0], escaped: n };
|
|
1272
1410
|
}
|
|
1273
1411
|
}
|
|
1274
|
-
}, h(Oe, "w"), Oe),
|
|
1412
|
+
}, h(Oe, "w"), Oe), we, se = (we = class {
|
|
1275
1413
|
constructor(t) {
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t ||
|
|
1282
|
-
let e = { other: Y, block:
|
|
1283
|
-
this.options.pedantic ? (e.block =
|
|
1414
|
+
R(this, "tokens");
|
|
1415
|
+
R(this, "options");
|
|
1416
|
+
R(this, "state");
|
|
1417
|
+
R(this, "inlineQueue");
|
|
1418
|
+
R(this, "tokenizer");
|
|
1419
|
+
this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || Re, this.options.tokenizer = this.options.tokenizer || new bt(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = { inLink: !1, inRawBlock: !1, top: !0 };
|
|
1420
|
+
let e = { other: Y, block: ft.normal, inline: Ze.normal };
|
|
1421
|
+
this.options.pedantic ? (e.block = ft.pedantic, e.inline = Ze.pedantic) : this.options.gfm && (e.block = ft.gfm, this.options.breaks ? e.inline = Ze.breaks : e.inline = Ze.gfm), this.tokenizer.rules = e;
|
|
1284
1422
|
}
|
|
1285
1423
|
static get rules() {
|
|
1286
|
-
return { block:
|
|
1424
|
+
return { block: ft, inline: Ze };
|
|
1287
1425
|
}
|
|
1288
1426
|
static lex(t, e) {
|
|
1289
|
-
return new
|
|
1427
|
+
return new we(e).lex(t);
|
|
1290
1428
|
}
|
|
1291
1429
|
static lexInline(t, e) {
|
|
1292
|
-
return new
|
|
1430
|
+
return new we(e).inlineTokens(t);
|
|
1293
1431
|
}
|
|
1294
1432
|
lex(t) {
|
|
1295
1433
|
t = t.replace(Y.carriageReturn, `
|
|
@@ -1364,8 +1502,8 @@ ${d}` : d;
|
|
|
1364
1502
|
let r = t;
|
|
1365
1503
|
if (this.options.extensions?.startBlock) {
|
|
1366
1504
|
let a = 1 / 0, o = t.slice(1), c;
|
|
1367
|
-
this.options.extensions.startBlock.forEach((
|
|
1368
|
-
c =
|
|
1505
|
+
this.options.extensions.startBlock.forEach((f) => {
|
|
1506
|
+
c = f.call({ lexer: this }, o), typeof c == "number" && c >= 0 && (a = Math.min(a, c));
|
|
1369
1507
|
}), a < 1 / 0 && a >= 0 && (r = t.substring(0, a + 1));
|
|
1370
1508
|
}
|
|
1371
1509
|
if (this.state.top && (s = this.tokenizer.paragraph(r))) {
|
|
@@ -1412,7 +1550,7 @@ ${d}` : d;
|
|
|
1412
1550
|
for (; t; ) {
|
|
1413
1551
|
a || (o = ""), a = !1;
|
|
1414
1552
|
let c;
|
|
1415
|
-
if (this.options.extensions?.inline?.some((
|
|
1553
|
+
if (this.options.extensions?.inline?.some((d) => (c = d.call({ lexer: this }, t, e)) ? (t = t.substring(c.raw.length), e.push(c), !0) : !1)) continue;
|
|
1416
1554
|
if (c = this.tokenizer.escape(t)) {
|
|
1417
1555
|
t = t.substring(c.raw.length), e.push(c);
|
|
1418
1556
|
continue;
|
|
@@ -1427,8 +1565,8 @@ ${d}` : d;
|
|
|
1427
1565
|
}
|
|
1428
1566
|
if (c = this.tokenizer.reflink(t, this.tokens.links)) {
|
|
1429
1567
|
t = t.substring(c.raw.length);
|
|
1430
|
-
let
|
|
1431
|
-
c.type === "text" &&
|
|
1568
|
+
let d = e.at(-1);
|
|
1569
|
+
c.type === "text" && d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
|
|
1432
1570
|
continue;
|
|
1433
1571
|
}
|
|
1434
1572
|
if (c = this.tokenizer.emStrong(t, n, o)) {
|
|
@@ -1455,34 +1593,34 @@ ${d}` : d;
|
|
|
1455
1593
|
t = t.substring(c.raw.length), e.push(c);
|
|
1456
1594
|
continue;
|
|
1457
1595
|
}
|
|
1458
|
-
let
|
|
1596
|
+
let f = t;
|
|
1459
1597
|
if (this.options.extensions?.startInline) {
|
|
1460
|
-
let
|
|
1461
|
-
this.options.extensions.startInline.forEach((
|
|
1462
|
-
|
|
1463
|
-
}),
|
|
1598
|
+
let d = 1 / 0, u = t.slice(1), g;
|
|
1599
|
+
this.options.extensions.startInline.forEach((m) => {
|
|
1600
|
+
g = m.call({ lexer: this }, u), typeof g == "number" && g >= 0 && (d = Math.min(d, g));
|
|
1601
|
+
}), d < 1 / 0 && d >= 0 && (f = t.substring(0, d + 1));
|
|
1464
1602
|
}
|
|
1465
|
-
if (c = this.tokenizer.inlineText(
|
|
1603
|
+
if (c = this.tokenizer.inlineText(f)) {
|
|
1466
1604
|
t = t.substring(c.raw.length), c.raw.slice(-1) !== "_" && (o = c.raw.slice(-1)), a = !0;
|
|
1467
|
-
let
|
|
1468
|
-
|
|
1605
|
+
let d = e.at(-1);
|
|
1606
|
+
d?.type === "text" ? (d.raw += c.raw, d.text += c.text) : e.push(c);
|
|
1469
1607
|
continue;
|
|
1470
1608
|
}
|
|
1471
1609
|
if (t) {
|
|
1472
|
-
let
|
|
1610
|
+
let d = "Infinite loop on byte: " + t.charCodeAt(0);
|
|
1473
1611
|
if (this.options.silent) {
|
|
1474
|
-
console.error(
|
|
1612
|
+
console.error(d);
|
|
1475
1613
|
break;
|
|
1476
|
-
} else throw new Error(
|
|
1614
|
+
} else throw new Error(d);
|
|
1477
1615
|
}
|
|
1478
1616
|
}
|
|
1479
1617
|
return e;
|
|
1480
1618
|
}
|
|
1481
|
-
}, h(
|
|
1619
|
+
}, h(we, "u"), we), Ne, wt = (Ne = class {
|
|
1482
1620
|
constructor(t) {
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
this.options = t ||
|
|
1621
|
+
R(this, "options");
|
|
1622
|
+
R(this, "parser");
|
|
1623
|
+
this.options = t || Re;
|
|
1486
1624
|
}
|
|
1487
1625
|
space(t) {
|
|
1488
1626
|
return "";
|
|
@@ -1578,7 +1716,7 @@ ${t}</tr>
|
|
|
1578
1716
|
return `<del>${this.parser.parseInline(t)}</del>`;
|
|
1579
1717
|
}
|
|
1580
1718
|
link({ href: t, title: e, tokens: n }) {
|
|
1581
|
-
let s = this.parser.parseInline(n), r =
|
|
1719
|
+
let s = this.parser.parseInline(n), r = Gn(t);
|
|
1582
1720
|
if (r === null) return s;
|
|
1583
1721
|
t = r;
|
|
1584
1722
|
let a = '<a href="' + t + '"';
|
|
@@ -1586,7 +1724,7 @@ ${t}</tr>
|
|
|
1586
1724
|
}
|
|
1587
1725
|
image({ href: t, title: e, text: n, tokens: s }) {
|
|
1588
1726
|
s && (n = this.parser.parseInline(s, this.parser.textRenderer));
|
|
1589
|
-
let r =
|
|
1727
|
+
let r = Gn(t);
|
|
1590
1728
|
if (r === null) return oe(n);
|
|
1591
1729
|
t = r;
|
|
1592
1730
|
let a = `<img src="${t}" alt="${oe(n)}"`;
|
|
@@ -1595,7 +1733,7 @@ ${t}</tr>
|
|
|
1595
1733
|
text(t) {
|
|
1596
1734
|
return "tokens" in t && t.tokens ? this.parser.parseInline(t.tokens) : "escaped" in t && t.escaped ? t.text : oe(t.text);
|
|
1597
1735
|
}
|
|
1598
|
-
}, h(
|
|
1736
|
+
}, h(Ne, "y"), Ne), Pe, rn = (Pe = class {
|
|
1599
1737
|
strong({ text: t }) {
|
|
1600
1738
|
return t;
|
|
1601
1739
|
}
|
|
@@ -1626,18 +1764,18 @@ ${t}</tr>
|
|
|
1626
1764
|
checkbox({ raw: t }) {
|
|
1627
1765
|
return t;
|
|
1628
1766
|
}
|
|
1629
|
-
}, h(
|
|
1767
|
+
}, h(Pe, "$"), Pe), ve, re = (ve = class {
|
|
1630
1768
|
constructor(t) {
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
this.options = t ||
|
|
1769
|
+
R(this, "options");
|
|
1770
|
+
R(this, "renderer");
|
|
1771
|
+
R(this, "textRenderer");
|
|
1772
|
+
this.options = t || Re, this.options.renderer = this.options.renderer || new wt(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new rn();
|
|
1635
1773
|
}
|
|
1636
1774
|
static parse(t, e) {
|
|
1637
|
-
return new
|
|
1775
|
+
return new ve(e).parse(t);
|
|
1638
1776
|
}
|
|
1639
1777
|
static parseInline(t, e) {
|
|
1640
|
-
return new
|
|
1778
|
+
return new ve(e).parseInline(t);
|
|
1641
1779
|
}
|
|
1642
1780
|
parse(t) {
|
|
1643
1781
|
let e = "";
|
|
@@ -1775,11 +1913,11 @@ ${t}</tr>
|
|
|
1775
1913
|
}
|
|
1776
1914
|
return n;
|
|
1777
1915
|
}
|
|
1778
|
-
}, h(
|
|
1916
|
+
}, h(ve, "u"), ve), be, Qe = (be = class {
|
|
1779
1917
|
constructor(t) {
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
this.options = t ||
|
|
1918
|
+
R(this, "options");
|
|
1919
|
+
R(this, "block");
|
|
1920
|
+
this.options = t || Re;
|
|
1783
1921
|
}
|
|
1784
1922
|
preprocess(t) {
|
|
1785
1923
|
return t;
|
|
@@ -1799,18 +1937,18 @@ ${t}</tr>
|
|
|
1799
1937
|
provideParser() {
|
|
1800
1938
|
return this.block ? re.parse : re.parseInline;
|
|
1801
1939
|
}
|
|
1802
|
-
}, h(
|
|
1940
|
+
}, h(be, "P"), R(be, "passThroughHooks", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens", "emStrongMask"])), R(be, "passThroughHooksRespectAsync", /* @__PURE__ */ new Set(["preprocess", "postprocess", "processAllTokens"])), be), $e, Zr = ($e = class {
|
|
1803
1941
|
constructor(...t) {
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1942
|
+
R(this, "defaults", Xt());
|
|
1943
|
+
R(this, "options", this.setOptions);
|
|
1944
|
+
R(this, "parse", this.parseMarkdown(!0));
|
|
1945
|
+
R(this, "parseInline", this.parseMarkdown(!1));
|
|
1946
|
+
R(this, "Parser", re);
|
|
1947
|
+
R(this, "Renderer", wt);
|
|
1948
|
+
R(this, "TextRenderer", rn);
|
|
1949
|
+
R(this, "Lexer", se);
|
|
1950
|
+
R(this, "Tokenizer", bt);
|
|
1951
|
+
R(this, "Hooks", Qe);
|
|
1814
1952
|
this.use(...t);
|
|
1815
1953
|
}
|
|
1816
1954
|
walkTokens(t, e) {
|
|
@@ -1857,51 +1995,51 @@ ${t}</tr>
|
|
|
1857
1995
|
}
|
|
1858
1996
|
"childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
|
|
1859
1997
|
}), s.extensions = e), n.renderer) {
|
|
1860
|
-
let r = this.defaults.renderer || new
|
|
1998
|
+
let r = this.defaults.renderer || new wt(this.defaults);
|
|
1861
1999
|
for (let a in n.renderer) {
|
|
1862
2000
|
if (!(a in r)) throw new Error(`renderer '${a}' does not exist`);
|
|
1863
2001
|
if (["options", "parser"].includes(a)) continue;
|
|
1864
|
-
let o = a, c = n.renderer[o],
|
|
1865
|
-
r[o] = (...
|
|
1866
|
-
let
|
|
1867
|
-
return
|
|
2002
|
+
let o = a, c = n.renderer[o], f = r[o];
|
|
2003
|
+
r[o] = (...d) => {
|
|
2004
|
+
let u = c.apply(r, d);
|
|
2005
|
+
return u === !1 && (u = f.apply(r, d)), u || "";
|
|
1868
2006
|
};
|
|
1869
2007
|
}
|
|
1870
2008
|
s.renderer = r;
|
|
1871
2009
|
}
|
|
1872
2010
|
if (n.tokenizer) {
|
|
1873
|
-
let r = this.defaults.tokenizer || new
|
|
2011
|
+
let r = this.defaults.tokenizer || new bt(this.defaults);
|
|
1874
2012
|
for (let a in n.tokenizer) {
|
|
1875
2013
|
if (!(a in r)) throw new Error(`tokenizer '${a}' does not exist`);
|
|
1876
2014
|
if (["options", "rules", "lexer"].includes(a)) continue;
|
|
1877
|
-
let o = a, c = n.tokenizer[o],
|
|
1878
|
-
r[o] = (...
|
|
1879
|
-
let
|
|
1880
|
-
return
|
|
2015
|
+
let o = a, c = n.tokenizer[o], f = r[o];
|
|
2016
|
+
r[o] = (...d) => {
|
|
2017
|
+
let u = c.apply(r, d);
|
|
2018
|
+
return u === !1 && (u = f.apply(r, d)), u;
|
|
1881
2019
|
};
|
|
1882
2020
|
}
|
|
1883
2021
|
s.tokenizer = r;
|
|
1884
2022
|
}
|
|
1885
2023
|
if (n.hooks) {
|
|
1886
|
-
let r = this.defaults.hooks || new
|
|
2024
|
+
let r = this.defaults.hooks || new Qe();
|
|
1887
2025
|
for (let a in n.hooks) {
|
|
1888
2026
|
if (!(a in r)) throw new Error(`hook '${a}' does not exist`);
|
|
1889
2027
|
if (["options", "block"].includes(a)) continue;
|
|
1890
|
-
let o = a, c = n.hooks[o],
|
|
1891
|
-
|
|
1892
|
-
if (this.defaults.async &&
|
|
1893
|
-
let
|
|
1894
|
-
return
|
|
2028
|
+
let o = a, c = n.hooks[o], f = r[o];
|
|
2029
|
+
Qe.passThroughHooks.has(a) ? r[o] = (d) => {
|
|
2030
|
+
if (this.defaults.async && Qe.passThroughHooksRespectAsync.has(a)) return (async () => {
|
|
2031
|
+
let g = await c.call(r, d);
|
|
2032
|
+
return f.call(r, g);
|
|
1895
2033
|
})();
|
|
1896
|
-
let
|
|
1897
|
-
return
|
|
1898
|
-
} : r[o] = (...
|
|
2034
|
+
let u = c.call(r, d);
|
|
2035
|
+
return f.call(r, u);
|
|
2036
|
+
} : r[o] = (...d) => {
|
|
1899
2037
|
if (this.defaults.async) return (async () => {
|
|
1900
|
-
let
|
|
1901
|
-
return
|
|
2038
|
+
let g = await c.apply(r, d);
|
|
2039
|
+
return g === !1 && (g = await f.apply(r, d)), g;
|
|
1902
2040
|
})();
|
|
1903
|
-
let
|
|
1904
|
-
return
|
|
2041
|
+
let u = c.apply(r, d);
|
|
2042
|
+
return u === !1 && (u = f.apply(r, d)), u;
|
|
1905
2043
|
};
|
|
1906
2044
|
}
|
|
1907
2045
|
s.hooks = r;
|
|
@@ -1932,10 +2070,10 @@ ${t}</tr>
|
|
|
1932
2070
|
if (typeof e > "u" || e === null) return a(new Error("marked(): input parameter is undefined or null"));
|
|
1933
2071
|
if (typeof e != "string") return a(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(e) + ", string expected"));
|
|
1934
2072
|
if (r.hooks && (r.hooks.options = r, r.hooks.block = t), r.async) return (async () => {
|
|
1935
|
-
let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer() : t ? se.lex : se.lexInline)(o, r),
|
|
1936
|
-
r.walkTokens && await Promise.all(this.walkTokens(
|
|
1937
|
-
let
|
|
1938
|
-
return r.hooks ? await r.hooks.postprocess(
|
|
2073
|
+
let o = r.hooks ? await r.hooks.preprocess(e) : e, c = await (r.hooks ? await r.hooks.provideLexer() : t ? se.lex : se.lexInline)(o, r), f = r.hooks ? await r.hooks.processAllTokens(c) : c;
|
|
2074
|
+
r.walkTokens && await Promise.all(this.walkTokens(f, r.walkTokens));
|
|
2075
|
+
let d = await (r.hooks ? await r.hooks.provideParser() : t ? re.parse : re.parseInline)(f, r);
|
|
2076
|
+
return r.hooks ? await r.hooks.postprocess(d) : d;
|
|
1939
2077
|
})().catch(a);
|
|
1940
2078
|
try {
|
|
1941
2079
|
r.hooks && (e = r.hooks.preprocess(e));
|
|
@@ -1959,31 +2097,31 @@ Please report this to https://github.com/markedjs/marked.`, t) {
|
|
|
1959
2097
|
throw n;
|
|
1960
2098
|
};
|
|
1961
2099
|
}
|
|
1962
|
-
}, h(
|
|
2100
|
+
}, h($e, "B"), $e), Ee = new Zr();
|
|
1963
2101
|
function M(l, t) {
|
|
1964
|
-
return
|
|
2102
|
+
return Ee.parse(l, t);
|
|
1965
2103
|
}
|
|
1966
2104
|
h(M, "g");
|
|
1967
2105
|
M.options = M.setOptions = function(l) {
|
|
1968
|
-
return
|
|
2106
|
+
return Ee.setOptions(l), M.defaults = Ee.defaults, es(M.defaults), M;
|
|
1969
2107
|
};
|
|
1970
2108
|
M.getDefaults = Xt;
|
|
1971
|
-
M.defaults =
|
|
2109
|
+
M.defaults = Re;
|
|
1972
2110
|
M.use = function(...l) {
|
|
1973
|
-
return
|
|
2111
|
+
return Ee.use(...l), M.defaults = Ee.defaults, es(M.defaults), M;
|
|
1974
2112
|
};
|
|
1975
2113
|
M.walkTokens = function(l, t) {
|
|
1976
|
-
return
|
|
2114
|
+
return Ee.walkTokens(l, t);
|
|
1977
2115
|
};
|
|
1978
|
-
M.parseInline =
|
|
2116
|
+
M.parseInline = Ee.parseInline;
|
|
1979
2117
|
M.Parser = re;
|
|
1980
2118
|
M.parser = re.parse;
|
|
1981
|
-
M.Renderer =
|
|
1982
|
-
M.TextRenderer =
|
|
2119
|
+
M.Renderer = wt;
|
|
2120
|
+
M.TextRenderer = rn;
|
|
1983
2121
|
M.Lexer = se;
|
|
1984
2122
|
M.lexer = se.lex;
|
|
1985
|
-
M.Tokenizer =
|
|
1986
|
-
M.Hooks =
|
|
2123
|
+
M.Tokenizer = bt;
|
|
2124
|
+
M.Hooks = Qe;
|
|
1987
2125
|
M.parse = M;
|
|
1988
2126
|
M.options;
|
|
1989
2127
|
M.setOptions;
|
|
@@ -1992,31 +2130,31 @@ M.walkTokens;
|
|
|
1992
2130
|
M.parseInline;
|
|
1993
2131
|
re.parse;
|
|
1994
2132
|
se.lex;
|
|
1995
|
-
const
|
|
2133
|
+
const Xr = { class: "flex flex-col h-full relative" }, Qr = {
|
|
1996
2134
|
key: 0,
|
|
1997
2135
|
class: "pb-4"
|
|
1998
|
-
},
|
|
2136
|
+
}, Kr = {
|
|
1999
2137
|
key: 0,
|
|
2000
2138
|
class: "flex flex-col items-center justify-center pt-12 pb-6 px-4"
|
|
2001
|
-
},
|
|
2139
|
+
}, Jr = { class: "relative mb-3" }, ei = ["src", "alt"], ti = ["title"], ni = {
|
|
2002
2140
|
key: 0,
|
|
2003
2141
|
class: "flex items-center gap-3 py-3 px-2"
|
|
2004
|
-
},
|
|
2142
|
+
}, si = ["src", "alt"], ri = ["src", "alt"], ii = ["src"], ai = ["href"], li = ["innerHTML"], oi = {
|
|
2005
2143
|
key: 1,
|
|
2006
2144
|
class: "flex gap-2 justify-start items-end mb-4"
|
|
2007
|
-
},
|
|
2145
|
+
}, ci = { class: "flex-shrink-0" }, ui = ["src", "alt"], hi = { class: "flex-shrink-0 pt-4 pb-2 px-3" }, pi = {
|
|
2008
2146
|
key: 0,
|
|
2009
2147
|
class: "flex items-center gap-2 px-3 pb-2 overflow-x-auto"
|
|
2010
|
-
},
|
|
2148
|
+
}, fi = ["src", "alt"], di = { class: "max-w-20 truncate" }, gi = ["onClick"], mi = {
|
|
2011
2149
|
key: 0,
|
|
2012
2150
|
class: "shrink-0 flex items-center justify-center size-14"
|
|
2013
|
-
},
|
|
2151
|
+
}, xi = ["disabled"], ki = {
|
|
2014
2152
|
key: 0,
|
|
2015
2153
|
class: "i-svg-spinners-ring-resize size-4"
|
|
2016
|
-
},
|
|
2154
|
+
}, bi = {
|
|
2017
2155
|
key: 1,
|
|
2018
2156
|
class: "i-tabler-paperclip size-5"
|
|
2019
|
-
},
|
|
2157
|
+
}, wi = ["placeholder", "disabled"], vi = ["disabled"], Li = /* @__PURE__ */ _e({
|
|
2020
2158
|
__name: "ElAgentChat",
|
|
2021
2159
|
props: {
|
|
2022
2160
|
chatController: {},
|
|
@@ -2031,12 +2169,12 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2031
2169
|
},
|
|
2032
2170
|
setup(l) {
|
|
2033
2171
|
const t = new M.Renderer();
|
|
2034
|
-
t.link = ({ href:
|
|
2035
|
-
function e(
|
|
2036
|
-
if (!
|
|
2172
|
+
t.link = ({ href: A, text: E }) => `<a href="${A}" target="_blank" rel="noopener noreferrer">${E}</a>`, M.setOptions({ breaks: !0, gfm: !0, renderer: t });
|
|
2173
|
+
function e(A) {
|
|
2174
|
+
if (!A)
|
|
2037
2175
|
return "";
|
|
2038
|
-
const
|
|
2039
|
-
return
|
|
2176
|
+
const E = M.parse(A, { async: !1 });
|
|
2177
|
+
return ar.sanitize(E, { ADD_ATTR: ["target"] });
|
|
2040
2178
|
}
|
|
2041
2179
|
h(e, "renderMarkdown");
|
|
2042
2180
|
const n = {
|
|
@@ -2047,142 +2185,142 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2047
2185
|
private: { icon: "i-tabler-lock", label: "Private", tooltip: "Only you can see this conversation" },
|
|
2048
2186
|
org: { icon: "i-tabler-users", label: "Workspace", tooltip: "Visible to workspace members" },
|
|
2049
2187
|
public: { icon: "i-tabler-globe", label: "Public", tooltip: "Anyone with the link can see this" }
|
|
2050
|
-
}, r =
|
|
2051
|
-
const
|
|
2052
|
-
return l.scope === "org" && l.scopeName && (
|
|
2053
|
-
}), o =
|
|
2054
|
-
function
|
|
2055
|
-
const
|
|
2056
|
-
return !
|
|
2188
|
+
}, r = W(() => l.setupHint ?? n[l.scope]), a = W(() => {
|
|
2189
|
+
const A = { ...s[l.scope] };
|
|
2190
|
+
return l.scope === "org" && l.scopeName && (A.label = l.scopeName, A.tooltip = `Visible to ${l.scopeName} members`), A;
|
|
2191
|
+
}), o = W(() => l.scale === "lg"), c = K(""), f = K(), d = K(), u = K(), g = K([]), m = K(!1);
|
|
2192
|
+
function S(A, E) {
|
|
2193
|
+
const b = A[E], z = A[E + 1];
|
|
2194
|
+
return !z || z.sender !== b.sender;
|
|
2057
2195
|
}
|
|
2058
|
-
h(
|
|
2059
|
-
const D =
|
|
2060
|
-
|
|
2061
|
-
if (l.chatController &&
|
|
2196
|
+
h(S, "shouldShowAvatar");
|
|
2197
|
+
const D = W(() => l.chatController?.textState.value), $ = W(() => D.value?.isConnected ?? !1), me = W(() => D.value?.isThinking ?? !1), xe = W(() => D.value?.connectionStatus === "disconnected" && !!D.value?.error), te = W(() => D.value?.connectionStatus !== "connected" && !D.value?.error), U = W(() => D.value?.error), q = W(() => l.chatController?.sharedMessages.value?.filter((A) => A.sender !== "system") ?? []), ne = W(() => !$.value), ue = W(() => xe.value ? "Agent is offline" : te.value ? "Connecting..." : "Message"), et = W(() => (c.value.trim() || g.value.length > 0) && !ne.value && !m.value);
|
|
2198
|
+
Zt(async () => {
|
|
2199
|
+
if (l.chatController && !$.value)
|
|
2062
2200
|
try {
|
|
2063
2201
|
await l.chatController.startTextConversation();
|
|
2064
|
-
} catch (
|
|
2065
|
-
console.error("Failed to start text conversation:",
|
|
2202
|
+
} catch (A) {
|
|
2203
|
+
console.error("Failed to start text conversation:", A);
|
|
2066
2204
|
}
|
|
2067
2205
|
});
|
|
2068
|
-
async function
|
|
2069
|
-
const
|
|
2070
|
-
if (!
|
|
2206
|
+
async function tt() {
|
|
2207
|
+
const A = c.value.trim(), E = g.value.length > 0;
|
|
2208
|
+
if (!A && !E || !l.chatController || !$.value || m.value)
|
|
2071
2209
|
return;
|
|
2072
|
-
const
|
|
2073
|
-
c.value = "",
|
|
2210
|
+
const b = c.value, z = E ? [...g.value] : void 0;
|
|
2211
|
+
c.value = "", g.value = [], d.value && (d.value.style.height = "auto", d.value.focus());
|
|
2074
2212
|
try {
|
|
2075
|
-
await l.chatController.sendChatMessage(
|
|
2076
|
-
} catch (
|
|
2077
|
-
console.error("Error sending message:",
|
|
2213
|
+
await l.chatController.sendChatMessage(b, z), F();
|
|
2214
|
+
} catch (I) {
|
|
2215
|
+
console.error("Error sending message:", I);
|
|
2078
2216
|
}
|
|
2079
2217
|
}
|
|
2080
|
-
h(
|
|
2081
|
-
function
|
|
2082
|
-
|
|
2218
|
+
h(tt, "sendMessage");
|
|
2219
|
+
function Tt(A) {
|
|
2220
|
+
A.key === "Enter" && !A.shiftKey && (A.preventDefault(), tt());
|
|
2083
2221
|
}
|
|
2084
|
-
h(
|
|
2085
|
-
function
|
|
2086
|
-
|
|
2087
|
-
|
|
2222
|
+
h(Tt, "handleKeydown");
|
|
2223
|
+
function F() {
|
|
2224
|
+
f.value && Pt(() => {
|
|
2225
|
+
f.value.scrollTop = f.value.scrollHeight;
|
|
2088
2226
|
});
|
|
2089
2227
|
}
|
|
2090
|
-
h(
|
|
2091
|
-
function $e() {
|
|
2092
|
-
f.value && (f.value.style.height = "auto", f.value.style.height = `${Math.min(f.value.scrollHeight, 150)}px`);
|
|
2093
|
-
}
|
|
2094
|
-
h($e, "adjustTextareaHeight"), Wt(c, () => zt(() => $e()));
|
|
2095
|
-
const I = Q(() => l.variant === "light");
|
|
2228
|
+
h(F, "scrollToBottom");
|
|
2096
2229
|
function Ue() {
|
|
2097
|
-
d.value
|
|
2230
|
+
d.value && (d.value.style.height = "auto", d.value.style.height = `${Math.min(d.value.scrollHeight, 150)}px`);
|
|
2231
|
+
}
|
|
2232
|
+
h(Ue, "adjustTextareaHeight"), Ke(c, () => Pt(() => Ue()));
|
|
2233
|
+
const L = W(() => l.variant === "light");
|
|
2234
|
+
function Be() {
|
|
2235
|
+
u.value?.click();
|
|
2098
2236
|
}
|
|
2099
|
-
h(
|
|
2100
|
-
async function
|
|
2101
|
-
const
|
|
2102
|
-
if (!(!
|
|
2103
|
-
|
|
2237
|
+
h(Be, "triggerFileInput");
|
|
2238
|
+
async function St(A) {
|
|
2239
|
+
const E = A.target, b = E.files?.[0];
|
|
2240
|
+
if (!(!b || !l.uploadFn)) {
|
|
2241
|
+
m.value = !0;
|
|
2104
2242
|
try {
|
|
2105
|
-
const
|
|
2106
|
-
|
|
2107
|
-
} catch (
|
|
2108
|
-
console.error("Upload failed:",
|
|
2243
|
+
const z = await l.uploadFn(b);
|
|
2244
|
+
g.value = [...g.value, z];
|
|
2245
|
+
} catch (z) {
|
|
2246
|
+
console.error("Upload failed:", z);
|
|
2109
2247
|
} finally {
|
|
2110
|
-
|
|
2248
|
+
m.value = !1, E.value = "";
|
|
2111
2249
|
}
|
|
2112
2250
|
}
|
|
2113
2251
|
}
|
|
2114
|
-
h(
|
|
2115
|
-
function
|
|
2116
|
-
|
|
2252
|
+
h(St, "handleFileSelect");
|
|
2253
|
+
function At(A) {
|
|
2254
|
+
g.value = g.value.filter((E, b) => b !== A);
|
|
2117
2255
|
}
|
|
2118
|
-
h(
|
|
2119
|
-
function
|
|
2120
|
-
if (
|
|
2121
|
-
const pe =
|
|
2122
|
-
return pe?.timestamp ?
|
|
2123
|
-
}
|
|
2124
|
-
const
|
|
2125
|
-
if (!
|
|
2126
|
-
const
|
|
2127
|
-
return new Date(
|
|
2256
|
+
h(At, "removeAttachment");
|
|
2257
|
+
function nt(A, E) {
|
|
2258
|
+
if (E === 0) {
|
|
2259
|
+
const pe = A[E];
|
|
2260
|
+
return pe?.timestamp ? Fe(new Date(pe.timestamp)) : null;
|
|
2261
|
+
}
|
|
2262
|
+
const b = A[E - 1], z = A[E];
|
|
2263
|
+
if (!b?.timestamp || !z?.timestamp) return null;
|
|
2264
|
+
const I = new Date(b.timestamp).getTime();
|
|
2265
|
+
return new Date(z.timestamp).getTime() - I > 36e5 ? Fe(new Date(z.timestamp)) : null;
|
|
2128
2266
|
}
|
|
2129
|
-
h(
|
|
2130
|
-
function
|
|
2131
|
-
const
|
|
2132
|
-
|
|
2133
|
-
const
|
|
2134
|
-
if (
|
|
2135
|
-
if (
|
|
2136
|
-
const
|
|
2137
|
-
return `${
|
|
2267
|
+
h(nt, "shouldShowTimeDivider");
|
|
2268
|
+
function Fe(A) {
|
|
2269
|
+
const E = /* @__PURE__ */ new Date(), b = A.toDateString() === E.toDateString(), z = new Date(E);
|
|
2270
|
+
z.setDate(z.getDate() - 1);
|
|
2271
|
+
const I = A.toDateString() === z.toDateString(), he = A.toLocaleTimeString("en-US", { hour: "numeric", minute: "2-digit" });
|
|
2272
|
+
if (b) return he;
|
|
2273
|
+
if (I) return `Yesterday, ${he}`;
|
|
2274
|
+
const O = A.getFullYear() === E.getFullYear();
|
|
2275
|
+
return `${A.toLocaleDateString("en-US", {
|
|
2138
2276
|
weekday: "long",
|
|
2139
2277
|
month: "short",
|
|
2140
2278
|
day: "numeric",
|
|
2141
|
-
...
|
|
2279
|
+
...O ? {} : { year: "numeric" }
|
|
2142
2280
|
})}, ${he}`;
|
|
2143
2281
|
}
|
|
2144
|
-
return h(
|
|
2145
|
-
|
|
2146
|
-
}, { immediate: !0, deep: !0 }), (
|
|
2147
|
-
|
|
2148
|
-
|
|
2282
|
+
return h(Fe, "formatTimeDivider"), Ke(q, (A) => {
|
|
2283
|
+
A.length > 0 && Pt(() => F());
|
|
2284
|
+
}, { immediate: !0, deep: !0 }), (A, E) => (v(), y("div", Xr, [
|
|
2285
|
+
L.value ? H("", !0) : (v(), y("div", Qr, [
|
|
2286
|
+
$t($s, {
|
|
2149
2287
|
agent: l.agent,
|
|
2150
|
-
"is-online":
|
|
2288
|
+
"is-online": $.value
|
|
2151
2289
|
}, null, 8, ["agent", "is-online"])
|
|
2152
2290
|
])),
|
|
2153
|
-
|
|
2291
|
+
xe.value ? (v(), y("div", {
|
|
2154
2292
|
key: 1,
|
|
2155
|
-
class: T(["py-16 flex flex-col items-center justify-center gap-3 text-sm",
|
|
2293
|
+
class: T(["py-16 flex flex-col items-center justify-center gap-3 text-sm", L.value ? "text-theme-400" : "text-white/60"])
|
|
2156
2294
|
}, [
|
|
2157
2295
|
w("i", {
|
|
2158
|
-
class: T(["i-heroicons-cloud-arrow-down size-8",
|
|
2296
|
+
class: T(["i-heroicons-cloud-arrow-down size-8", L.value ? "text-theme-300" : "text-white/40"])
|
|
2159
2297
|
}, null, 2),
|
|
2160
|
-
w("span", null, ce(
|
|
2161
|
-
], 2)) :
|
|
2298
|
+
w("span", null, ce(U.value), 1)
|
|
2299
|
+
], 2)) : te.value ? (v(), y("div", {
|
|
2162
2300
|
key: 2,
|
|
2163
|
-
class: T(["py-16 flex flex-col items-center justify-center gap-2 text-sm",
|
|
2301
|
+
class: T(["py-16 flex flex-col items-center justify-center gap-2 text-sm", L.value ? "text-theme-400" : "text-theme-600"])
|
|
2164
2302
|
}, [
|
|
2165
|
-
|
|
2166
|
-
], 2)) : r.value ? (
|
|
2303
|
+
$t(Rn, { class: "size-4" })
|
|
2304
|
+
], 2)) : r.value ? (v(), y("div", {
|
|
2167
2305
|
key: 3,
|
|
2168
|
-
class: T(["flex items-center justify-center gap-1.5 py-2 text-[11px]",
|
|
2306
|
+
class: T(["flex items-center justify-center gap-1.5 py-2 text-[11px]", L.value ? "text-theme-300" : "text-white/30"])
|
|
2169
2307
|
}, [
|
|
2170
|
-
|
|
2308
|
+
E[2] || (E[2] = w("i", { class: "i-tabler-tool size-3" }, null, -1)),
|
|
2171
2309
|
w("span", null, ce(r.value), 1)
|
|
2172
|
-
], 2)) :
|
|
2310
|
+
], 2)) : H("", !0),
|
|
2173
2311
|
w("div", {
|
|
2174
2312
|
ref_key: "messagesContainer",
|
|
2175
|
-
ref:
|
|
2313
|
+
ref: f,
|
|
2176
2314
|
class: "flex-1 overflow-y-auto overflow-x-hidden py-4 px-3 space-y-1 min-h-0 [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden"
|
|
2177
2315
|
}, [
|
|
2178
|
-
|
|
2179
|
-
w("div",
|
|
2316
|
+
q.value.length === 0 && !te.value && !xe.value ? (v(), y("div", Kr, [
|
|
2317
|
+
w("div", Jr, [
|
|
2180
2318
|
w("img", {
|
|
2181
2319
|
src: l.agent.avatarUrl.value,
|
|
2182
2320
|
alt: l.agent.displayName.value,
|
|
2183
2321
|
class: T(["rounded-full object-cover", o.value ? "size-28" : "size-20"])
|
|
2184
|
-
}, null, 10,
|
|
2185
|
-
|
|
2322
|
+
}, null, 10, ei),
|
|
2323
|
+
$.value ? (v(), y("span", {
|
|
2186
2324
|
key: 0,
|
|
2187
2325
|
class: T(["absolute bottom-0.5 right-0.5 flex items-center justify-center", o.value ? "size-6" : "size-5"])
|
|
2188
2326
|
}, [
|
|
@@ -2193,209 +2331,209 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2193
2331
|
w("span", {
|
|
2194
2332
|
class: T(["relative inline-flex rounded-full bg-emerald-500 ring-2", [
|
|
2195
2333
|
o.value ? "size-3" : "size-2.5",
|
|
2196
|
-
|
|
2334
|
+
L.value ? "ring-white" : "ring-theme-900"
|
|
2197
2335
|
]])
|
|
2198
2336
|
}, null, 2)
|
|
2199
|
-
], 2)) :
|
|
2337
|
+
], 2)) : H("", !0)
|
|
2200
2338
|
]),
|
|
2201
2339
|
w("div", {
|
|
2202
|
-
class: T(["font-semibold", [
|
|
2340
|
+
class: T(["font-semibold", [L.value ? "text-theme-900" : "text-white", o.value ? "text-lg" : "text-base"]])
|
|
2203
2341
|
}, ce(l.agent.displayName.value), 3),
|
|
2204
2342
|
w("p", {
|
|
2205
|
-
class: T(["mt-1 text-center", [
|
|
2343
|
+
class: T(["mt-1 text-center", [L.value ? "text-theme-300" : "text-white/30", o.value ? "text-sm" : "text-xs"]])
|
|
2206
2344
|
}, ce(l.emptyStateMessage || "Send a message to get started"), 3),
|
|
2207
2345
|
w("div", {
|
|
2208
|
-
class: T(["inline-flex items-center gap-1.5 mt-6 px-2.5 py-1 rounded-full text-[11px]",
|
|
2346
|
+
class: T(["inline-flex items-center gap-1.5 mt-6 px-2.5 py-1 rounded-full text-[11px]", L.value ? "bg-theme-50 border border-theme-100 text-theme-400" : "bg-white/10 border border-white/20 text-white/40"]),
|
|
2209
2347
|
title: a.value.tooltip
|
|
2210
2348
|
}, [
|
|
2211
2349
|
w("i", {
|
|
2212
2350
|
class: T([a.value.icon, "size-3"])
|
|
2213
2351
|
}, null, 2),
|
|
2214
2352
|
w("span", null, ce(a.value.label), 1)
|
|
2215
|
-
], 10,
|
|
2216
|
-
])) :
|
|
2217
|
-
(
|
|
2218
|
-
key:
|
|
2353
|
+
], 10, ti)
|
|
2354
|
+
])) : H("", !0),
|
|
2355
|
+
(v(!0), y(Se, null, dt(q.value, (b, z) => (v(), y(Se, {
|
|
2356
|
+
key: b.id
|
|
2219
2357
|
}, [
|
|
2220
|
-
|
|
2358
|
+
nt(q.value, z) ? (v(), y("div", ni, [
|
|
2221
2359
|
w("div", {
|
|
2222
|
-
class: T(["flex-1 h-px",
|
|
2360
|
+
class: T(["flex-1 h-px", L.value ? "bg-theme-200" : "bg-white/10"])
|
|
2223
2361
|
}, null, 2),
|
|
2224
2362
|
w("span", {
|
|
2225
|
-
class: T(["font-medium shrink-0", [
|
|
2226
|
-
}, ce(
|
|
2363
|
+
class: T(["font-medium shrink-0", [L.value ? "text-theme-400" : "text-white/40", o.value ? "text-xs" : "text-[11px]"]])
|
|
2364
|
+
}, ce(nt(q.value, z)), 3),
|
|
2227
2365
|
w("div", {
|
|
2228
|
-
class: T(["flex-1 h-px",
|
|
2366
|
+
class: T(["flex-1 h-px", L.value ? "bg-theme-200" : "bg-white/10"])
|
|
2229
2367
|
}, null, 2)
|
|
2230
|
-
])) :
|
|
2368
|
+
])) : H("", !0),
|
|
2231
2369
|
w("div", {
|
|
2232
2370
|
class: T(["flex gap-2 items-end", {
|
|
2233
|
-
"justify-end":
|
|
2234
|
-
"justify-start":
|
|
2235
|
-
"mb-4":
|
|
2371
|
+
"justify-end": b.sender === "user",
|
|
2372
|
+
"justify-start": b.sender === "agent",
|
|
2373
|
+
"mb-4": S(q.value, z)
|
|
2236
2374
|
}])
|
|
2237
2375
|
}, [
|
|
2238
|
-
|
|
2376
|
+
b.sender === "agent" ? (v(), y("div", {
|
|
2239
2377
|
key: 0,
|
|
2240
2378
|
class: T(["flex-shrink-0", o.value ? "size-10" : "size-8"])
|
|
2241
2379
|
}, [
|
|
2242
|
-
|
|
2380
|
+
S(q.value, z) ? (v(), y("img", {
|
|
2243
2381
|
key: 0,
|
|
2244
2382
|
src: l.agent.avatarUrl.value,
|
|
2245
2383
|
alt: l.agent.displayName.value,
|
|
2246
2384
|
class: T(["rounded-full object-cover", o.value ? "size-10" : "size-7"])
|
|
2247
|
-
}, null, 10,
|
|
2248
|
-
], 2)) :
|
|
2385
|
+
}, null, 10, si)) : H("", !0)
|
|
2386
|
+
], 2)) : H("", !0),
|
|
2249
2387
|
w("div", {
|
|
2250
|
-
class: T(
|
|
2388
|
+
class: T(b.sender === "user" ? "max-w-[75%]" : "max-w-[85%]")
|
|
2251
2389
|
}, [
|
|
2252
|
-
|
|
2390
|
+
b.attachments?.length ? (v(), y("div", {
|
|
2253
2391
|
key: 0,
|
|
2254
|
-
class: T(["mb-1 space-y-1",
|
|
2392
|
+
class: T(["mb-1 space-y-1", b.sender === "user" ? "flex flex-col items-end" : ""])
|
|
2255
2393
|
}, [
|
|
2256
|
-
(
|
|
2257
|
-
|
|
2394
|
+
(v(!0), y(Se, null, dt(b.attachments, (I, he) => (v(), y(Se, { key: he }, [
|
|
2395
|
+
I.type === "image" ? (v(), y("img", {
|
|
2258
2396
|
key: 0,
|
|
2259
|
-
src:
|
|
2260
|
-
alt:
|
|
2397
|
+
src: I.url,
|
|
2398
|
+
alt: I.name,
|
|
2261
2399
|
class: T(["rounded-xl object-cover max-h-48", o.value ? "max-w-[320px]" : "max-w-[240px]"])
|
|
2262
|
-
}, null, 10,
|
|
2400
|
+
}, null, 10, ri)) : I.type === "audio" ? (v(), y("audio", {
|
|
2263
2401
|
key: 1,
|
|
2264
|
-
src:
|
|
2402
|
+
src: I.url,
|
|
2265
2403
|
controls: "",
|
|
2266
2404
|
class: "max-w-full"
|
|
2267
|
-
}, null, 8,
|
|
2405
|
+
}, null, 8, ii)) : (v(), y("a", {
|
|
2268
2406
|
key: 2,
|
|
2269
|
-
href:
|
|
2407
|
+
href: I.url,
|
|
2270
2408
|
target: "_blank",
|
|
2271
2409
|
rel: "noopener",
|
|
2272
|
-
class: T(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs",
|
|
2410
|
+
class: T(["inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs", L.value ? "bg-theme-100 text-theme-600 hover:bg-theme-200" : "bg-white/10 text-white/80 hover:bg-white/20"])
|
|
2273
2411
|
}, [
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
], 10,
|
|
2412
|
+
E[3] || (E[3] = w("i", { class: "i-tabler-file size-3.5" }, null, -1)),
|
|
2413
|
+
vs(" " + ce(I.name), 1)
|
|
2414
|
+
], 10, ai))
|
|
2277
2415
|
], 64))), 128))
|
|
2278
|
-
], 2)) :
|
|
2279
|
-
|
|
2416
|
+
], 2)) : H("", !0),
|
|
2417
|
+
b.text ? (v(), y("div", {
|
|
2280
2418
|
key: 1,
|
|
2281
|
-
class: T(["rounded-2xl px-3.5 py-2",
|
|
2419
|
+
class: T(["rounded-2xl px-3.5 py-2", b.sender === "user" ? "bg-primary-500 text-white" : L.value ? "bg-theme-100 text-theme-800" : "bg-white/15 backdrop-blur-sm text-white/95"])
|
|
2282
2420
|
}, [
|
|
2283
2421
|
w("div", {
|
|
2284
2422
|
class: T(["chat-msg-prose break-words", [
|
|
2285
2423
|
o.value ? "text-[15px] leading-[1.6]" : "text-[13px] leading-[1.55]",
|
|
2286
|
-
|
|
2424
|
+
b.sender === "user" || !L.value ? "chat-msg-prose-invert" : ""
|
|
2287
2425
|
]]),
|
|
2288
|
-
innerHTML: e(
|
|
2289
|
-
}, null, 10,
|
|
2290
|
-
], 2)) :
|
|
2426
|
+
innerHTML: e(b.text)
|
|
2427
|
+
}, null, 10, li)
|
|
2428
|
+
], 2)) : H("", !0)
|
|
2291
2429
|
], 2)
|
|
2292
2430
|
], 2)
|
|
2293
2431
|
], 64))), 128)),
|
|
2294
|
-
|
|
2295
|
-
w("div",
|
|
2432
|
+
me.value ? (v(), y("div", oi, [
|
|
2433
|
+
w("div", ci, [
|
|
2296
2434
|
w("img", {
|
|
2297
2435
|
src: l.agent.avatarUrl.value,
|
|
2298
2436
|
alt: l.agent.displayName.value,
|
|
2299
2437
|
class: T(["rounded-full object-cover", o.value ? "size-10" : "size-8"])
|
|
2300
|
-
}, null, 10,
|
|
2438
|
+
}, null, 10, ui)
|
|
2301
2439
|
]),
|
|
2302
2440
|
w("div", {
|
|
2303
|
-
class: T(["rounded-2xl px-4 py-2.5 flex items-center",
|
|
2441
|
+
class: T(["rounded-2xl px-4 py-2.5 flex items-center", L.value ? "bg-theme-100" : "bg-white/15 backdrop-blur-sm"])
|
|
2304
2442
|
}, [
|
|
2305
2443
|
w("i", {
|
|
2306
|
-
class: T(["i-svg-spinners-3-dots-fade size-6",
|
|
2444
|
+
class: T(["i-svg-spinners-3-dots-fade size-6", L.value ? "text-theme-400" : "text-white/70"])
|
|
2307
2445
|
}, null, 2)
|
|
2308
2446
|
], 2)
|
|
2309
|
-
])) :
|
|
2447
|
+
])) : H("", !0)
|
|
2310
2448
|
], 512),
|
|
2311
|
-
w("div",
|
|
2312
|
-
|
|
2313
|
-
(
|
|
2314
|
-
key:
|
|
2449
|
+
w("div", hi, [
|
|
2450
|
+
g.value.length > 0 ? (v(), y("div", pi, [
|
|
2451
|
+
(v(!0), y(Se, null, dt(g.value, (b, z) => (v(), y("div", {
|
|
2452
|
+
key: z,
|
|
2315
2453
|
class: "relative shrink-0 group"
|
|
2316
2454
|
}, [
|
|
2317
|
-
|
|
2455
|
+
b.type === "image" ? (v(), y("img", {
|
|
2318
2456
|
key: 0,
|
|
2319
|
-
src:
|
|
2320
|
-
alt:
|
|
2321
|
-
class: T(["size-14 rounded-lg object-cover border",
|
|
2322
|
-
}, null, 10,
|
|
2457
|
+
src: b.url,
|
|
2458
|
+
alt: b.name,
|
|
2459
|
+
class: T(["size-14 rounded-lg object-cover border", L.value ? "border-theme-200" : "border-white/20"])
|
|
2460
|
+
}, null, 10, fi)) : (v(), y("div", {
|
|
2323
2461
|
key: 1,
|
|
2324
|
-
class: T(["h-14 px-3 rounded-lg flex items-center gap-1.5 text-xs border",
|
|
2462
|
+
class: T(["h-14 px-3 rounded-lg flex items-center gap-1.5 text-xs border", L.value ? "border-theme-200 bg-theme-50 text-theme-600" : "border-white/20 bg-white/10 text-white/70"])
|
|
2325
2463
|
}, [
|
|
2326
|
-
|
|
2327
|
-
w("span",
|
|
2464
|
+
E[4] || (E[4] = w("i", { class: "i-tabler-file size-4" }, null, -1)),
|
|
2465
|
+
w("span", di, ce(b.name), 1)
|
|
2328
2466
|
], 2)),
|
|
2329
2467
|
w("button", {
|
|
2330
2468
|
class: "absolute -top-1.5 -right-1.5 size-5 flex items-center justify-center rounded-full bg-theme-600 text-white text-xs opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer",
|
|
2331
|
-
onClick: /* @__PURE__ */ h((
|
|
2332
|
-
}, [...
|
|
2469
|
+
onClick: /* @__PURE__ */ h((I) => At(z), "onClick")
|
|
2470
|
+
}, [...E[5] || (E[5] = [
|
|
2333
2471
|
w("i", { class: "i-tabler-x size-3" }, null, -1)
|
|
2334
|
-
])], 8,
|
|
2472
|
+
])], 8, gi)
|
|
2335
2473
|
]))), 128)),
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
])) :
|
|
2339
|
-
])) :
|
|
2340
|
-
l.uploadFn ? (
|
|
2474
|
+
m.value ? (v(), y("div", mi, [
|
|
2475
|
+
$t(Rn, { class: "size-5" })
|
|
2476
|
+
])) : H("", !0)
|
|
2477
|
+
])) : H("", !0),
|
|
2478
|
+
l.uploadFn ? (v(), y("input", {
|
|
2341
2479
|
key: 1,
|
|
2342
2480
|
ref_key: "fileInput",
|
|
2343
|
-
ref:
|
|
2481
|
+
ref: u,
|
|
2344
2482
|
type: "file",
|
|
2345
2483
|
accept: "image/*,audio/*,video/*",
|
|
2346
2484
|
class: "hidden",
|
|
2347
|
-
onChange:
|
|
2348
|
-
}, null, 544)) :
|
|
2485
|
+
onChange: St
|
|
2486
|
+
}, null, 544)) : H("", !0),
|
|
2349
2487
|
w("div", {
|
|
2350
|
-
class: T(["flex items-end gap-1 w-full rounded-3xl px-3 py-1.5",
|
|
2488
|
+
class: T(["flex items-end gap-1 w-full rounded-3xl px-3 py-1.5", L.value ? "bg-theme-50 border border-theme-200 focus-within:border-theme-300" : "bg-white/10 backdrop-blur-sm border border-white/20 focus-within:border-white/40"])
|
|
2351
2489
|
}, [
|
|
2352
|
-
l.uploadFn ? (
|
|
2490
|
+
l.uploadFn ? (v(), y("button", {
|
|
2353
2491
|
key: 0,
|
|
2354
2492
|
class: T(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5 cursor-pointer", [
|
|
2355
2493
|
o.value ? "size-10" : "size-9",
|
|
2356
|
-
|
|
2357
|
-
|
|
2494
|
+
L.value ? "text-theme-400 hover:text-theme-600" : "text-white/50 hover:text-white/80",
|
|
2495
|
+
m.value ? "opacity-50 pointer-events-none" : ""
|
|
2358
2496
|
]]),
|
|
2359
|
-
disabled:
|
|
2360
|
-
onClick:
|
|
2497
|
+
disabled: ne.value || m.value,
|
|
2498
|
+
onClick: Be
|
|
2361
2499
|
}, [
|
|
2362
|
-
|
|
2363
|
-
], 10,
|
|
2364
|
-
|
|
2500
|
+
m.value ? (v(), y("i", ki)) : (v(), y("i", bi))
|
|
2501
|
+
], 10, xi)) : H("", !0),
|
|
2502
|
+
Vn(w("textarea", {
|
|
2365
2503
|
ref_key: "textarea",
|
|
2366
|
-
ref:
|
|
2367
|
-
"onUpdate:modelValue":
|
|
2504
|
+
ref: d,
|
|
2505
|
+
"onUpdate:modelValue": E[0] || (E[0] = (b) => c.value = b),
|
|
2368
2506
|
rows: "1",
|
|
2369
2507
|
enterkeyhint: "send",
|
|
2370
2508
|
placeholder: ue.value,
|
|
2371
|
-
disabled:
|
|
2372
|
-
style:
|
|
2373
|
-
class: T(["flex-1 min-w-0 bg-transparent px-2 py-1.5 focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden",
|
|
2374
|
-
onKeydown:
|
|
2375
|
-
}, null, 46,
|
|
2376
|
-
[
|
|
2509
|
+
disabled: ne.value,
|
|
2510
|
+
style: ys({ fontSize: (o.value, "16px"), resize: "none" }),
|
|
2511
|
+
class: T(["flex-1 min-w-0 bg-transparent px-2 py-1.5 focus:outline-none disabled:opacity-50 overflow-y-auto [scrollbar-width:none] [-ms-overflow-style:none] [&::-webkit-scrollbar]:hidden", L.value ? "text-theme-800 placeholder-theme-400" : "text-white placeholder-white/50"]),
|
|
2512
|
+
onKeydown: Tt
|
|
2513
|
+
}, null, 46, wi), [
|
|
2514
|
+
[Yn, c.value]
|
|
2377
2515
|
]),
|
|
2378
2516
|
w("button", {
|
|
2379
2517
|
class: T(["shrink-0 flex items-center justify-center rounded-full transition-colors mb-0.5", [
|
|
2380
2518
|
o.value ? "size-10" : "size-9",
|
|
2381
|
-
|
|
2519
|
+
et.value ? "bg-primary-500 text-white hover:bg-primary-600 cursor-pointer" : L.value ? "bg-theme-100 text-theme-300" : "bg-white/10 text-white/30"
|
|
2382
2520
|
]]),
|
|
2383
|
-
disabled: !
|
|
2384
|
-
onClick:
|
|
2385
|
-
}, [...
|
|
2521
|
+
disabled: !et.value,
|
|
2522
|
+
onClick: E[1] || (E[1] = (b) => tt())
|
|
2523
|
+
}, [...E[6] || (E[6] = [
|
|
2386
2524
|
w("i", { class: "i-tabler-arrow-up size-5" }, null, -1)
|
|
2387
|
-
])], 10,
|
|
2525
|
+
])], 10, vi)
|
|
2388
2526
|
], 2),
|
|
2389
2527
|
w("div", {
|
|
2390
|
-
class: T(["text-[10px] text-center mt-2",
|
|
2528
|
+
class: T(["text-[10px] text-center mt-2 select-none", L.value ? "text-theme-300" : "text-white/40"])
|
|
2391
2529
|
}, " Press Enter to send, Shift+Enter for new line ", 2)
|
|
2392
2530
|
])
|
|
2393
2531
|
]));
|
|
2394
2532
|
}
|
|
2395
|
-
}),
|
|
2533
|
+
}), yi = { class: "agent-wrap" }, Ti = {
|
|
2396
2534
|
key: 0,
|
|
2397
2535
|
class: "flex items-center justify-center h-full"
|
|
2398
|
-
},
|
|
2536
|
+
}, zi = /* @__PURE__ */ _e({
|
|
2399
2537
|
__name: "AgentWrap",
|
|
2400
2538
|
props: {
|
|
2401
2539
|
sdk: {},
|
|
@@ -2412,8 +2550,8 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2412
2550
|
const t = As("AgentWrap"), e = l, n = e.sdk || Es.getInstance({
|
|
2413
2551
|
isDev: typeof window < "u" ? window.location.hostname === "localhost" || window.location.hostname.includes("127.0.0.1") : !1,
|
|
2414
2552
|
...e.apiBase && { apiBase: e.apiBase }
|
|
2415
|
-
}), s =
|
|
2416
|
-
return
|
|
2553
|
+
}), s = K(!e.agent), r = Ts(e.agent ? new xt({ config: e.agent }) : void 0), a = K();
|
|
2554
|
+
return Zt(async () => {
|
|
2417
2555
|
if (e.agent) {
|
|
2418
2556
|
t.debug("Agent provided via props, skipping fetch", {
|
|
2419
2557
|
agentId: e.agent.agentId,
|
|
@@ -2439,7 +2577,7 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2439
2577
|
try {
|
|
2440
2578
|
s.value = !0, t.debug("Fetching public agent", { handle: e.handle });
|
|
2441
2579
|
const o = await n.getPublicAgent({ handle: e.handle });
|
|
2442
|
-
o ? (r.value = new
|
|
2580
|
+
o ? (r.value = new xt({ config: o }), t.debug("Successfully fetched public agent", {
|
|
2443
2581
|
agentId: o.agentId,
|
|
2444
2582
|
handle: o.handle
|
|
2445
2583
|
}), o.agentId && n.track({
|
|
@@ -2489,10 +2627,10 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2489
2627
|
}
|
|
2490
2628
|
});
|
|
2491
2629
|
}
|
|
2492
|
-
}), (o, c) => (
|
|
2493
|
-
s.value ? (
|
|
2630
|
+
}), (o, c) => (v(), y("div", yi, [
|
|
2631
|
+
s.value ? (v(), y("div", Ti, [...c[0] || (c[0] = [
|
|
2494
2632
|
w("div", { class: "animate-spin rounded-full size-6 border-b-2 border-white" }, null, -1)
|
|
2495
|
-
])])) : r.value ?
|
|
2633
|
+
])])) : r.value ? qn(o.$slots, "default", {
|
|
2496
2634
|
key: 1,
|
|
2497
2635
|
sdk: jt(n),
|
|
2498
2636
|
agent: r.value,
|
|
@@ -2501,18 +2639,21 @@ const qr = { class: "flex flex-col h-full relative" }, Yr = {
|
|
|
2501
2639
|
buttonText: l.buttonText,
|
|
2502
2640
|
buttonIcon: l.buttonIcon,
|
|
2503
2641
|
loading: s.value
|
|
2504
|
-
}) :
|
|
2642
|
+
}) : H("", !0)
|
|
2505
2643
|
]));
|
|
2506
2644
|
}
|
|
2507
2645
|
});
|
|
2508
2646
|
export {
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2647
|
+
Dn as A,
|
|
2648
|
+
zi as _,
|
|
2649
|
+
Li as a,
|
|
2650
|
+
Ii as b,
|
|
2651
|
+
Ci as c,
|
|
2652
|
+
Mi as d,
|
|
2653
|
+
Rn as e,
|
|
2654
|
+
$s as f,
|
|
2655
|
+
Ri as g,
|
|
2656
|
+
In as h,
|
|
2657
|
+
Di as p
|
|
2517
2658
|
};
|
|
2518
|
-
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang
|
|
2659
|
+
//# sourceMappingURL=AgentWrap.vue_vue_type_script_setup_true_lang.js.map
|