@useknest/widget-core 0.1.0-beta.10 → 0.1.0-beta.12
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/attachments.d.ts +44 -0
- package/dist/attachments.d.ts.map +1 -0
- package/dist/constants.d.ts +12 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/index.d.ts +6 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +625 -479
- package/dist/persistence.d.ts +27 -0
- package/dist/persistence.d.ts.map +1 -0
- package/dist/streaming.d.ts +2 -0
- package/dist/streaming.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -0
- package/dist/utils.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,71 +1,85 @@
|
|
|
1
|
-
import { createClient as
|
|
2
|
-
import { marked as
|
|
3
|
-
import * as
|
|
4
|
-
const
|
|
5
|
-
function
|
|
6
|
-
return `${
|
|
1
|
+
import { createClient as be } from "@supabase/supabase-js";
|
|
2
|
+
import { marked as Y } from "marked";
|
|
3
|
+
import * as Z from "@sentry/browser";
|
|
4
|
+
const W = "https://useknest.com", X = "/api/v1", et = "https://lghrsugmhzpccpriqhrx.supabase.co", tt = "sb_publishable_-KUwilDA78QM849gk662FA_kEzMezNS";
|
|
5
|
+
function Ie(n = W) {
|
|
6
|
+
return `${n}${X}/chat-messages`;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return `${
|
|
8
|
+
function ye(n = W) {
|
|
9
|
+
return `${n}${X}/widget-config`;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
11
|
+
const Re = "Sorry, I didn't get a response.", re = "Unknown error occurred", Oe = "This domain is not authorized. Please add it to your allowed origins in the Knest dashboard.", ve = "This chatbot has reached its usage limit. Please contact the site owner to upgrade their plan.", nt = "https://useknest.com/default-avatar.svg", at = "#3b82f6", rt = "Hi! I'm your AI assistant. I'm trained to answer questions about your documentation. How can I help you today?", st = [
|
|
12
12
|
"How do I get started?",
|
|
13
13
|
"What features are available?",
|
|
14
14
|
"How do I integrate this?"
|
|
15
|
-
],
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
], fe = ["image/jpeg", "image/png", "image/gif", "image/webp"], Ne = [
|
|
16
|
+
"application/pdf",
|
|
17
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
18
|
+
"text/plain"
|
|
19
|
+
], Ee = [...fe, ...Ne], it = Ee.join(","), we = 10 * 1024 * 1024, ot = 5;
|
|
20
|
+
function Le(n = W) {
|
|
21
|
+
return `${n}${X}/chat-attachments/upload-url`;
|
|
18
22
|
}
|
|
19
|
-
function
|
|
23
|
+
function Fe(n = W) {
|
|
24
|
+
return `${n}${X}/chat-attachments/signed-url`;
|
|
25
|
+
}
|
|
26
|
+
function ut(n) {
|
|
27
|
+
return fe.includes(n);
|
|
28
|
+
}
|
|
29
|
+
const Ce = "knest-widget-config-", ke = 1440 * 60 * 1e3;
|
|
30
|
+
function J(n) {
|
|
31
|
+
return Ce + n;
|
|
32
|
+
}
|
|
33
|
+
function _e(n, o) {
|
|
20
34
|
try {
|
|
21
|
-
const e = localStorage.getItem(
|
|
35
|
+
const e = localStorage.getItem(J(n));
|
|
22
36
|
if (!e) return null;
|
|
23
|
-
const { config:
|
|
24
|
-
return Date.now() - c >
|
|
37
|
+
const { config: l, cachedAt: c } = JSON.parse(e);
|
|
38
|
+
return Date.now() - c > ke ? (localStorage.removeItem(J(n)), null) : (o && l.updatedAt, l);
|
|
25
39
|
} catch {
|
|
26
40
|
return null;
|
|
27
41
|
}
|
|
28
42
|
}
|
|
29
|
-
function
|
|
43
|
+
function De(n, o) {
|
|
30
44
|
try {
|
|
31
|
-
const e = { config:
|
|
32
|
-
localStorage.setItem(
|
|
45
|
+
const e = { config: o, cachedAt: Date.now() };
|
|
46
|
+
localStorage.setItem(J(n), JSON.stringify(e));
|
|
33
47
|
} catch {
|
|
34
48
|
}
|
|
35
49
|
}
|
|
36
|
-
async function
|
|
50
|
+
async function se(n, o) {
|
|
37
51
|
try {
|
|
38
|
-
const e = await fetch(
|
|
52
|
+
const e = await fetch(ye(o), {
|
|
39
53
|
method: "GET",
|
|
40
54
|
headers: {
|
|
41
|
-
"X-Api-Key":
|
|
55
|
+
"X-Api-Key": n
|
|
42
56
|
}
|
|
43
57
|
});
|
|
44
58
|
if (e.ok) {
|
|
45
59
|
const c = await e.json();
|
|
46
|
-
return
|
|
60
|
+
return De(n, c), { config: c, error: null };
|
|
47
61
|
}
|
|
48
62
|
if (e.status === 401 || e.status === 403) {
|
|
49
63
|
const c = await e.json().catch(() => ({}));
|
|
50
64
|
return console.warn("Widget config auth error:", e.status, c), { config: null, error: "auth" };
|
|
51
65
|
}
|
|
52
|
-
const
|
|
53
|
-
return console.warn("Failed to fetch widget config:", e.status,
|
|
66
|
+
const l = await e.text();
|
|
67
|
+
return console.warn("Failed to fetch widget config:", e.status, l), { config: null, error: "network" };
|
|
54
68
|
} catch (e) {
|
|
55
69
|
return console.error("Error fetching widget config:", e), { config: null, error: "network" };
|
|
56
70
|
}
|
|
57
71
|
}
|
|
58
|
-
async function
|
|
59
|
-
const
|
|
60
|
-
return
|
|
61
|
-
c.config && c.config.updatedAt !==
|
|
62
|
-
}), { config:
|
|
72
|
+
async function lt(n, o, e) {
|
|
73
|
+
const l = _e(n);
|
|
74
|
+
return l ? (e && se(n, o).then((c) => {
|
|
75
|
+
c.config && c.config.updatedAt !== l.updatedAt && e(c.config);
|
|
76
|
+
}), { config: l, error: null }) : se(n, o);
|
|
63
77
|
}
|
|
64
|
-
let
|
|
65
|
-
async function
|
|
66
|
-
return x || (
|
|
78
|
+
let _ = null, H = !1, x = null;
|
|
79
|
+
async function ct(n, o) {
|
|
80
|
+
return x || (H && _ ? !0 : (x = (async () => {
|
|
67
81
|
try {
|
|
68
|
-
|
|
82
|
+
_ = be(n, o, {
|
|
69
83
|
auth: {
|
|
70
84
|
// Persist session in localStorage for cross-page persistence.
|
|
71
85
|
persistSession: !0,
|
|
@@ -75,11 +89,11 @@ async function je(a, g) {
|
|
|
75
89
|
});
|
|
76
90
|
const {
|
|
77
91
|
data: { session: e }
|
|
78
|
-
} = await
|
|
92
|
+
} = await _.auth.getSession();
|
|
79
93
|
if (e)
|
|
80
|
-
return
|
|
81
|
-
const { error:
|
|
82
|
-
return
|
|
94
|
+
return H = !0, !0;
|
|
95
|
+
const { error: l } = await _.auth.signInAnonymously();
|
|
96
|
+
return l ? (console.error("Widget auth error:", l.message), !1) : (H = !0, !0);
|
|
83
97
|
} catch (e) {
|
|
84
98
|
return console.error("Widget auth initialization failed:", e), !1;
|
|
85
99
|
} finally {
|
|
@@ -87,94 +101,94 @@ async function je(a, g) {
|
|
|
87
101
|
}
|
|
88
102
|
})(), x));
|
|
89
103
|
}
|
|
90
|
-
async function
|
|
91
|
-
if (!
|
|
104
|
+
async function Q() {
|
|
105
|
+
if (!_)
|
|
92
106
|
return null;
|
|
93
107
|
const {
|
|
94
|
-
data: { session:
|
|
95
|
-
} = await
|
|
96
|
-
return
|
|
108
|
+
data: { session: n }
|
|
109
|
+
} = await _.auth.getSession();
|
|
110
|
+
return n?.access_token || null;
|
|
97
111
|
}
|
|
98
|
-
function
|
|
99
|
-
return
|
|
112
|
+
function Pe() {
|
|
113
|
+
return H;
|
|
100
114
|
}
|
|
101
|
-
function
|
|
102
|
-
return
|
|
115
|
+
function xe() {
|
|
116
|
+
return _;
|
|
103
117
|
}
|
|
104
|
-
async function
|
|
105
|
-
const { publishableApiKey:
|
|
118
|
+
async function dt(n) {
|
|
119
|
+
const { publishableApiKey: o, content: e, threadId: l, callbacks: c, baseUrl: E, metadata: T } = n;
|
|
106
120
|
try {
|
|
107
|
-
if (!
|
|
121
|
+
if (!Pe())
|
|
108
122
|
throw new Error("Widget not authenticated. Call initWidgetAuth() first.");
|
|
109
|
-
const
|
|
110
|
-
if (!
|
|
123
|
+
const u = await Q();
|
|
124
|
+
if (!u)
|
|
111
125
|
throw new Error("No access token available. Please refresh and try again.");
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
const
|
|
126
|
+
const m = { content: e };
|
|
127
|
+
l && (m.threadId = l), T && (m.metadata = T);
|
|
128
|
+
const y = await fetch(Ie(E), {
|
|
115
129
|
method: "POST",
|
|
116
130
|
headers: {
|
|
117
131
|
"Content-Type": "application/json",
|
|
118
|
-
"X-Api-Key":
|
|
119
|
-
Authorization: `Bearer ${
|
|
132
|
+
"X-Api-Key": o,
|
|
133
|
+
Authorization: `Bearer ${u}`
|
|
120
134
|
},
|
|
121
135
|
credentials: "include",
|
|
122
|
-
body: JSON.stringify(
|
|
136
|
+
body: JSON.stringify(m)
|
|
123
137
|
});
|
|
124
|
-
if (!
|
|
125
|
-
if (
|
|
126
|
-
throw new Error(
|
|
127
|
-
if (
|
|
128
|
-
const
|
|
129
|
-
throw
|
|
138
|
+
if (!y.ok) {
|
|
139
|
+
if (y.status === 401 || y.status === 403)
|
|
140
|
+
throw new Error(Oe);
|
|
141
|
+
if (y.status === 429) {
|
|
142
|
+
const h = await y.json();
|
|
143
|
+
throw h.code === "USAGE_LIMIT_EXCEEDED" ? new Error(ve) : new Error(h.error || "Rate limited");
|
|
130
144
|
}
|
|
131
|
-
const
|
|
132
|
-
throw new Error(
|
|
145
|
+
const N = await y.json();
|
|
146
|
+
throw new Error(N.error || "Failed to send message");
|
|
133
147
|
}
|
|
134
|
-
const F =
|
|
148
|
+
const F = y.body?.getReader();
|
|
135
149
|
if (!F)
|
|
136
150
|
throw new Error("Response body is not readable");
|
|
137
|
-
const
|
|
138
|
-
let
|
|
151
|
+
const C = new TextDecoder();
|
|
152
|
+
let O = "", k = !1;
|
|
139
153
|
for (; ; ) {
|
|
140
|
-
const { done:
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
const
|
|
154
|
+
const { done: N, value: h } = await F.read();
|
|
155
|
+
if (N) break;
|
|
156
|
+
O += C.decode(h, { stream: !0 });
|
|
157
|
+
const f = O.split(`
|
|
144
158
|
`);
|
|
145
|
-
|
|
146
|
-
for (const
|
|
147
|
-
if (
|
|
159
|
+
O = f.pop() || "";
|
|
160
|
+
for (const A of f)
|
|
161
|
+
if (A.startsWith("data: "))
|
|
148
162
|
try {
|
|
149
|
-
const
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
else if (
|
|
153
|
-
|
|
154
|
-
else if (
|
|
155
|
-
c.onComplete && c.onComplete(
|
|
156
|
-
else if (
|
|
157
|
-
|
|
158
|
-
else if (
|
|
159
|
-
throw new Error(
|
|
160
|
-
} catch (
|
|
161
|
-
console.error("Error parsing SSE data:",
|
|
163
|
+
const t = JSON.parse(A.slice(6));
|
|
164
|
+
if (t.type === "init")
|
|
165
|
+
t.threadId && c.onInit && c.onInit(t.threadId);
|
|
166
|
+
else if (t.type === "content")
|
|
167
|
+
t.content && (k = !0, c.onContent(t.content));
|
|
168
|
+
else if (t.type === "complete")
|
|
169
|
+
c.onComplete && c.onComplete(t.sources || []);
|
|
170
|
+
else if (t.type === "done")
|
|
171
|
+
t.humanTakeover && (k = !0), c.onDone && c.onDone({ humanTakeover: t.humanTakeover });
|
|
172
|
+
else if (t.type === "error")
|
|
173
|
+
throw new Error(t.error || re);
|
|
174
|
+
} catch (t) {
|
|
175
|
+
console.error("Error parsing SSE data:", t, A);
|
|
162
176
|
}
|
|
163
177
|
}
|
|
164
|
-
|
|
165
|
-
} catch (
|
|
166
|
-
const
|
|
167
|
-
c.onError(
|
|
178
|
+
k || c.onError(Re);
|
|
179
|
+
} catch (u) {
|
|
180
|
+
const m = u instanceof Error ? u.message : re;
|
|
181
|
+
c.onError(m);
|
|
168
182
|
}
|
|
169
183
|
}
|
|
170
|
-
var
|
|
171
|
-
function
|
|
172
|
-
return
|
|
184
|
+
var ie = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
185
|
+
function Ue(n) {
|
|
186
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
173
187
|
}
|
|
174
|
-
var
|
|
175
|
-
function
|
|
176
|
-
return
|
|
177
|
-
var
|
|
188
|
+
var V = { exports: {} }, oe;
|
|
189
|
+
function Me() {
|
|
190
|
+
return oe || (oe = 1, (function(n) {
|
|
191
|
+
var o = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
178
192
|
/**
|
|
179
193
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
180
194
|
*
|
|
@@ -183,8 +197,8 @@ function we() {
|
|
|
183
197
|
* @namespace
|
|
184
198
|
* @public
|
|
185
199
|
*/
|
|
186
|
-
var e = (function(
|
|
187
|
-
var c = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,
|
|
200
|
+
var e = (function(l) {
|
|
201
|
+
var c = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, E = 0, T = {}, u = {
|
|
188
202
|
/**
|
|
189
203
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
190
204
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -206,7 +220,7 @@ function we() {
|
|
|
206
220
|
* @memberof Prism
|
|
207
221
|
* @public
|
|
208
222
|
*/
|
|
209
|
-
manual:
|
|
223
|
+
manual: l.Prism && l.Prism.manual,
|
|
210
224
|
/**
|
|
211
225
|
* By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
|
|
212
226
|
* `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
|
|
@@ -228,7 +242,7 @@ function we() {
|
|
|
228
242
|
* @memberof Prism
|
|
229
243
|
* @public
|
|
230
244
|
*/
|
|
231
|
-
disableWorkerMessageHandler:
|
|
245
|
+
disableWorkerMessageHandler: l.Prism && l.Prism.disableWorkerMessageHandler,
|
|
232
246
|
/**
|
|
233
247
|
* A namespace for utility methods.
|
|
234
248
|
*
|
|
@@ -239,8 +253,8 @@ function we() {
|
|
|
239
253
|
* @memberof Prism
|
|
240
254
|
*/
|
|
241
255
|
util: {
|
|
242
|
-
encode: function
|
|
243
|
-
return
|
|
256
|
+
encode: function t(a) {
|
|
257
|
+
return a instanceof m ? new m(a.type, t(a.content), a.alias) : Array.isArray(a) ? a.map(t) : a.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
244
258
|
},
|
|
245
259
|
/**
|
|
246
260
|
* Returns the name of the type of the given value.
|
|
@@ -258,8 +272,8 @@ function we() {
|
|
|
258
272
|
* type(String) === 'Function'
|
|
259
273
|
* type(/abc+/) === 'RegExp'
|
|
260
274
|
*/
|
|
261
|
-
type: function(
|
|
262
|
-
return Object.prototype.toString.call(
|
|
275
|
+
type: function(t) {
|
|
276
|
+
return Object.prototype.toString.call(t).slice(8, -1);
|
|
263
277
|
},
|
|
264
278
|
/**
|
|
265
279
|
* Returns a unique number for the given object. Later calls will still return the same number.
|
|
@@ -267,8 +281,8 @@ function we() {
|
|
|
267
281
|
* @param {Object} obj
|
|
268
282
|
* @returns {number}
|
|
269
283
|
*/
|
|
270
|
-
objId: function(
|
|
271
|
-
return
|
|
284
|
+
objId: function(t) {
|
|
285
|
+
return t.__id || Object.defineProperty(t, "__id", { value: ++E }), t.__id;
|
|
272
286
|
},
|
|
273
287
|
/**
|
|
274
288
|
* Creates a deep clone of the given object.
|
|
@@ -280,30 +294,30 @@ function we() {
|
|
|
280
294
|
* @returns {T}
|
|
281
295
|
* @template T
|
|
282
296
|
*/
|
|
283
|
-
clone: function
|
|
297
|
+
clone: function t(a, r) {
|
|
284
298
|
r = r || {};
|
|
285
299
|
var s, i;
|
|
286
|
-
switch (
|
|
300
|
+
switch (u.util.type(a)) {
|
|
287
301
|
case "Object":
|
|
288
|
-
if (i =
|
|
302
|
+
if (i = u.util.objId(a), r[i])
|
|
289
303
|
return r[i];
|
|
290
304
|
s = /** @type {Record<string, any>} */
|
|
291
305
|
{}, r[i] = s;
|
|
292
|
-
for (var
|
|
293
|
-
|
|
306
|
+
for (var g in a)
|
|
307
|
+
a.hasOwnProperty(g) && (s[g] = t(a[g], r));
|
|
294
308
|
return (
|
|
295
309
|
/** @type {any} */
|
|
296
310
|
s
|
|
297
311
|
);
|
|
298
312
|
case "Array":
|
|
299
|
-
return i =
|
|
313
|
+
return i = u.util.objId(a), r[i] ? r[i] : (s = [], r[i] = s, /** @type {Array} */
|
|
300
314
|
/** @type {any} */
|
|
301
|
-
|
|
302
|
-
s[
|
|
315
|
+
a.forEach(function(p, d) {
|
|
316
|
+
s[d] = t(p, r);
|
|
303
317
|
}), /** @type {any} */
|
|
304
318
|
s);
|
|
305
319
|
default:
|
|
306
|
-
return
|
|
320
|
+
return a;
|
|
307
321
|
}
|
|
308
322
|
},
|
|
309
323
|
/**
|
|
@@ -314,12 +328,12 @@ function we() {
|
|
|
314
328
|
* @param {Element} element
|
|
315
329
|
* @returns {string}
|
|
316
330
|
*/
|
|
317
|
-
getLanguage: function(
|
|
318
|
-
for (;
|
|
319
|
-
var
|
|
320
|
-
if (
|
|
321
|
-
return
|
|
322
|
-
|
|
331
|
+
getLanguage: function(t) {
|
|
332
|
+
for (; t; ) {
|
|
333
|
+
var a = c.exec(t.className);
|
|
334
|
+
if (a)
|
|
335
|
+
return a[1].toLowerCase();
|
|
336
|
+
t = t.parentElement;
|
|
323
337
|
}
|
|
324
338
|
return "none";
|
|
325
339
|
},
|
|
@@ -330,8 +344,8 @@ function we() {
|
|
|
330
344
|
* @param {string} language
|
|
331
345
|
* @returns {void}
|
|
332
346
|
*/
|
|
333
|
-
setLanguage: function(
|
|
334
|
-
|
|
347
|
+
setLanguage: function(t, a) {
|
|
348
|
+
t.className = t.className.replace(RegExp(c, "gi"), ""), t.classList.add("language-" + a);
|
|
335
349
|
},
|
|
336
350
|
/**
|
|
337
351
|
* Returns the script element that is currently executing.
|
|
@@ -351,12 +365,12 @@ function we() {
|
|
|
351
365
|
try {
|
|
352
366
|
throw new Error();
|
|
353
367
|
} catch (s) {
|
|
354
|
-
var
|
|
355
|
-
if (
|
|
356
|
-
var
|
|
357
|
-
for (var r in
|
|
358
|
-
if (
|
|
359
|
-
return
|
|
368
|
+
var t = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(s.stack) || [])[1];
|
|
369
|
+
if (t) {
|
|
370
|
+
var a = document.getElementsByTagName("script");
|
|
371
|
+
for (var r in a)
|
|
372
|
+
if (a[r].src == t)
|
|
373
|
+
return a[r];
|
|
360
374
|
}
|
|
361
375
|
return null;
|
|
362
376
|
}
|
|
@@ -380,14 +394,14 @@ function we() {
|
|
|
380
394
|
* @param {boolean} [defaultActivation=false]
|
|
381
395
|
* @returns {boolean}
|
|
382
396
|
*/
|
|
383
|
-
isActive: function(
|
|
384
|
-
for (var s = "no-" +
|
|
385
|
-
var i =
|
|
386
|
-
if (i.contains(
|
|
397
|
+
isActive: function(t, a, r) {
|
|
398
|
+
for (var s = "no-" + a; t; ) {
|
|
399
|
+
var i = t.classList;
|
|
400
|
+
if (i.contains(a))
|
|
387
401
|
return !0;
|
|
388
402
|
if (i.contains(s))
|
|
389
403
|
return !1;
|
|
390
|
-
|
|
404
|
+
t = t.parentElement;
|
|
391
405
|
}
|
|
392
406
|
return !!r;
|
|
393
407
|
}
|
|
@@ -403,10 +417,10 @@ function we() {
|
|
|
403
417
|
/**
|
|
404
418
|
* The grammar for plain, unformatted text.
|
|
405
419
|
*/
|
|
406
|
-
plain:
|
|
407
|
-
plaintext:
|
|
408
|
-
text:
|
|
409
|
-
txt:
|
|
420
|
+
plain: T,
|
|
421
|
+
plaintext: T,
|
|
422
|
+
text: T,
|
|
423
|
+
txt: T,
|
|
410
424
|
/**
|
|
411
425
|
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
412
426
|
*
|
|
@@ -435,10 +449,10 @@ function we() {
|
|
|
435
449
|
* 'color': /\b(?:red|green|blue)\b/
|
|
436
450
|
* });
|
|
437
451
|
*/
|
|
438
|
-
extend: function(
|
|
439
|
-
var r =
|
|
440
|
-
for (var s in
|
|
441
|
-
r[s] =
|
|
452
|
+
extend: function(t, a) {
|
|
453
|
+
var r = u.util.clone(u.languages[t]);
|
|
454
|
+
for (var s in a)
|
|
455
|
+
r[s] = a[s];
|
|
442
456
|
return r;
|
|
443
457
|
},
|
|
444
458
|
/**
|
|
@@ -516,31 +530,31 @@ function we() {
|
|
|
516
530
|
* @returns {Grammar} The new grammar object.
|
|
517
531
|
* @public
|
|
518
532
|
*/
|
|
519
|
-
insertBefore: function(
|
|
533
|
+
insertBefore: function(t, a, r, s) {
|
|
520
534
|
s = s || /** @type {any} */
|
|
521
|
-
|
|
522
|
-
var i = s[
|
|
523
|
-
for (var
|
|
524
|
-
if (i.hasOwnProperty(
|
|
525
|
-
if (
|
|
526
|
-
for (var
|
|
527
|
-
r.hasOwnProperty(
|
|
528
|
-
r.hasOwnProperty(
|
|
535
|
+
u.languages;
|
|
536
|
+
var i = s[t], g = {};
|
|
537
|
+
for (var p in i)
|
|
538
|
+
if (i.hasOwnProperty(p)) {
|
|
539
|
+
if (p == a)
|
|
540
|
+
for (var d in r)
|
|
541
|
+
r.hasOwnProperty(d) && (g[d] = r[d]);
|
|
542
|
+
r.hasOwnProperty(p) || (g[p] = i[p]);
|
|
529
543
|
}
|
|
530
|
-
var
|
|
531
|
-
return s[
|
|
532
|
-
|
|
533
|
-
}),
|
|
544
|
+
var S = s[t];
|
|
545
|
+
return s[t] = g, u.languages.DFS(u.languages, function(b, w) {
|
|
546
|
+
w === S && b != t && (this[b] = g);
|
|
547
|
+
}), g;
|
|
534
548
|
},
|
|
535
549
|
// Traverse a language definition with Depth First Search
|
|
536
|
-
DFS: function
|
|
550
|
+
DFS: function t(a, r, s, i) {
|
|
537
551
|
i = i || {};
|
|
538
|
-
var
|
|
539
|
-
for (var
|
|
540
|
-
if (
|
|
541
|
-
r.call(
|
|
542
|
-
var
|
|
543
|
-
|
|
552
|
+
var g = u.util.objId;
|
|
553
|
+
for (var p in a)
|
|
554
|
+
if (a.hasOwnProperty(p)) {
|
|
555
|
+
r.call(a, p, a[p], s || p);
|
|
556
|
+
var d = a[p], S = u.util.type(d);
|
|
557
|
+
S === "Object" && !i[g(d)] ? (i[g(d)] = !0, t(d, r, null, i)) : S === "Array" && !i[g(d)] && (i[g(d)] = !0, t(d, r, p, i));
|
|
544
558
|
}
|
|
545
559
|
}
|
|
546
560
|
},
|
|
@@ -557,8 +571,8 @@ function we() {
|
|
|
557
571
|
* @memberof Prism
|
|
558
572
|
* @public
|
|
559
573
|
*/
|
|
560
|
-
highlightAll: function(
|
|
561
|
-
|
|
574
|
+
highlightAll: function(t, a) {
|
|
575
|
+
u.highlightAllUnder(document, t, a);
|
|
562
576
|
},
|
|
563
577
|
/**
|
|
564
578
|
* Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
|
|
@@ -575,15 +589,15 @@ function we() {
|
|
|
575
589
|
* @memberof Prism
|
|
576
590
|
* @public
|
|
577
591
|
*/
|
|
578
|
-
highlightAllUnder: function(
|
|
592
|
+
highlightAllUnder: function(t, a, r) {
|
|
579
593
|
var s = {
|
|
580
594
|
callback: r,
|
|
581
|
-
container:
|
|
595
|
+
container: t,
|
|
582
596
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
583
597
|
};
|
|
584
|
-
|
|
585
|
-
for (var i = 0,
|
|
586
|
-
|
|
598
|
+
u.hooks.run("before-highlightall", s), s.elements = Array.prototype.slice.apply(s.container.querySelectorAll(s.selector)), u.hooks.run("before-all-elements-highlight", s);
|
|
599
|
+
for (var i = 0, g; g = s.elements[i++]; )
|
|
600
|
+
u.highlightElement(g, a === !0, s.callback);
|
|
587
601
|
},
|
|
588
602
|
/**
|
|
589
603
|
* Highlights the code inside a single element.
|
|
@@ -613,39 +627,39 @@ function we() {
|
|
|
613
627
|
* @memberof Prism
|
|
614
628
|
* @public
|
|
615
629
|
*/
|
|
616
|
-
highlightElement: function(
|
|
617
|
-
var s =
|
|
618
|
-
|
|
619
|
-
var
|
|
620
|
-
|
|
621
|
-
var
|
|
622
|
-
element:
|
|
630
|
+
highlightElement: function(t, a, r) {
|
|
631
|
+
var s = u.util.getLanguage(t), i = u.languages[s];
|
|
632
|
+
u.util.setLanguage(t, s);
|
|
633
|
+
var g = t.parentElement;
|
|
634
|
+
g && g.nodeName.toLowerCase() === "pre" && u.util.setLanguage(g, s);
|
|
635
|
+
var p = t.textContent, d = {
|
|
636
|
+
element: t,
|
|
623
637
|
language: s,
|
|
624
638
|
grammar: i,
|
|
625
|
-
code:
|
|
639
|
+
code: p
|
|
626
640
|
};
|
|
627
|
-
function
|
|
628
|
-
|
|
641
|
+
function S(w) {
|
|
642
|
+
d.highlightedCode = w, u.hooks.run("before-insert", d), d.element.innerHTML = d.highlightedCode, u.hooks.run("after-highlight", d), u.hooks.run("complete", d), r && r.call(d.element);
|
|
629
643
|
}
|
|
630
|
-
if (
|
|
631
|
-
|
|
644
|
+
if (u.hooks.run("before-sanity-check", d), g = d.element.parentElement, g && g.nodeName.toLowerCase() === "pre" && !g.hasAttribute("tabindex") && g.setAttribute("tabindex", "0"), !d.code) {
|
|
645
|
+
u.hooks.run("complete", d), r && r.call(d.element);
|
|
632
646
|
return;
|
|
633
647
|
}
|
|
634
|
-
if (
|
|
635
|
-
|
|
648
|
+
if (u.hooks.run("before-highlight", d), !d.grammar) {
|
|
649
|
+
S(u.util.encode(d.code));
|
|
636
650
|
return;
|
|
637
651
|
}
|
|
638
|
-
if (
|
|
639
|
-
var b = new Worker(
|
|
640
|
-
b.onmessage = function(
|
|
641
|
-
|
|
652
|
+
if (a && l.Worker) {
|
|
653
|
+
var b = new Worker(u.filename);
|
|
654
|
+
b.onmessage = function(w) {
|
|
655
|
+
S(w.data);
|
|
642
656
|
}, b.postMessage(JSON.stringify({
|
|
643
|
-
language:
|
|
644
|
-
code:
|
|
657
|
+
language: d.language,
|
|
658
|
+
code: d.code,
|
|
645
659
|
immediateClose: !0
|
|
646
660
|
}));
|
|
647
661
|
} else
|
|
648
|
-
|
|
662
|
+
S(u.highlight(d.code, d.grammar, d.language));
|
|
649
663
|
},
|
|
650
664
|
/**
|
|
651
665
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
@@ -667,15 +681,15 @@ function we() {
|
|
|
667
681
|
* @example
|
|
668
682
|
* Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
|
|
669
683
|
*/
|
|
670
|
-
highlight: function(
|
|
684
|
+
highlight: function(t, a, r) {
|
|
671
685
|
var s = {
|
|
672
|
-
code:
|
|
673
|
-
grammar:
|
|
686
|
+
code: t,
|
|
687
|
+
grammar: a,
|
|
674
688
|
language: r
|
|
675
689
|
};
|
|
676
|
-
if (
|
|
690
|
+
if (u.hooks.run("before-tokenize", s), !s.grammar)
|
|
677
691
|
throw new Error('The language "' + s.language + '" has no grammar.');
|
|
678
|
-
return s.tokens =
|
|
692
|
+
return s.tokens = u.tokenize(s.code, s.grammar), u.hooks.run("after-tokenize", s), m.stringify(u.util.encode(s.tokens), s.language);
|
|
679
693
|
},
|
|
680
694
|
/**
|
|
681
695
|
* This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
|
|
@@ -701,15 +715,15 @@ function we() {
|
|
|
701
715
|
* }
|
|
702
716
|
* });
|
|
703
717
|
*/
|
|
704
|
-
tokenize: function(
|
|
705
|
-
var r =
|
|
718
|
+
tokenize: function(t, a) {
|
|
719
|
+
var r = a.rest;
|
|
706
720
|
if (r) {
|
|
707
721
|
for (var s in r)
|
|
708
|
-
|
|
709
|
-
delete
|
|
722
|
+
a[s] = r[s];
|
|
723
|
+
delete a.rest;
|
|
710
724
|
}
|
|
711
|
-
var i = new
|
|
712
|
-
return
|
|
725
|
+
var i = new C();
|
|
726
|
+
return O(i, i.head, t), F(t, i, a, i.head, 0), N(i);
|
|
713
727
|
},
|
|
714
728
|
/**
|
|
715
729
|
* @namespace
|
|
@@ -730,9 +744,9 @@ function we() {
|
|
|
730
744
|
* @param {HookCallback} callback The callback function which is given environment variables.
|
|
731
745
|
* @public
|
|
732
746
|
*/
|
|
733
|
-
add: function(
|
|
734
|
-
var r =
|
|
735
|
-
r[
|
|
747
|
+
add: function(t, a) {
|
|
748
|
+
var r = u.hooks.all;
|
|
749
|
+
r[t] = r[t] || [], r[t].push(a);
|
|
736
750
|
},
|
|
737
751
|
/**
|
|
738
752
|
* Runs a hook invoking all registered callbacks with the given environment variables.
|
|
@@ -743,135 +757,135 @@ function we() {
|
|
|
743
757
|
* @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
|
|
744
758
|
* @public
|
|
745
759
|
*/
|
|
746
|
-
run: function(
|
|
747
|
-
var r =
|
|
760
|
+
run: function(t, a) {
|
|
761
|
+
var r = u.hooks.all[t];
|
|
748
762
|
if (!(!r || !r.length))
|
|
749
763
|
for (var s = 0, i; i = r[s++]; )
|
|
750
|
-
i(
|
|
764
|
+
i(a);
|
|
751
765
|
}
|
|
752
766
|
},
|
|
753
767
|
Token: m
|
|
754
768
|
};
|
|
755
|
-
|
|
756
|
-
function m(
|
|
757
|
-
this.type =
|
|
769
|
+
l.Prism = u;
|
|
770
|
+
function m(t, a, r, s) {
|
|
771
|
+
this.type = t, this.content = a, this.alias = r, this.length = (s || "").length | 0;
|
|
758
772
|
}
|
|
759
|
-
m.stringify = function
|
|
760
|
-
if (typeof
|
|
761
|
-
return
|
|
762
|
-
if (Array.isArray(
|
|
773
|
+
m.stringify = function t(a, r) {
|
|
774
|
+
if (typeof a == "string")
|
|
775
|
+
return a;
|
|
776
|
+
if (Array.isArray(a)) {
|
|
763
777
|
var s = "";
|
|
764
|
-
return
|
|
765
|
-
s +=
|
|
778
|
+
return a.forEach(function(S) {
|
|
779
|
+
s += t(S, r);
|
|
766
780
|
}), s;
|
|
767
781
|
}
|
|
768
782
|
var i = {
|
|
769
|
-
type:
|
|
770
|
-
content:
|
|
783
|
+
type: a.type,
|
|
784
|
+
content: t(a.content, r),
|
|
771
785
|
tag: "span",
|
|
772
|
-
classes: ["token",
|
|
786
|
+
classes: ["token", a.type],
|
|
773
787
|
attributes: {},
|
|
774
788
|
language: r
|
|
775
|
-
},
|
|
776
|
-
|
|
777
|
-
var
|
|
778
|
-
for (var
|
|
779
|
-
|
|
780
|
-
return "<" + i.tag + ' class="' + i.classes.join(" ") + '"' +
|
|
789
|
+
}, g = a.alias;
|
|
790
|
+
g && (Array.isArray(g) ? Array.prototype.push.apply(i.classes, g) : i.classes.push(g)), u.hooks.run("wrap", i);
|
|
791
|
+
var p = "";
|
|
792
|
+
for (var d in i.attributes)
|
|
793
|
+
p += " " + d + '="' + (i.attributes[d] || "").replace(/"/g, """) + '"';
|
|
794
|
+
return "<" + i.tag + ' class="' + i.classes.join(" ") + '"' + p + ">" + i.content + "</" + i.tag + ">";
|
|
781
795
|
};
|
|
782
|
-
function
|
|
783
|
-
|
|
784
|
-
var i =
|
|
796
|
+
function y(t, a, r, s) {
|
|
797
|
+
t.lastIndex = a;
|
|
798
|
+
var i = t.exec(r);
|
|
785
799
|
if (i && s && i[1]) {
|
|
786
|
-
var
|
|
787
|
-
i.index +=
|
|
800
|
+
var g = i[1].length;
|
|
801
|
+
i.index += g, i[0] = i[0].slice(g);
|
|
788
802
|
}
|
|
789
803
|
return i;
|
|
790
804
|
}
|
|
791
|
-
function
|
|
792
|
-
for (var
|
|
793
|
-
if (!(!r.hasOwnProperty(
|
|
794
|
-
var
|
|
795
|
-
|
|
796
|
-
for (var
|
|
797
|
-
if (
|
|
805
|
+
function F(t, a, r, s, i, g) {
|
|
806
|
+
for (var p in r)
|
|
807
|
+
if (!(!r.hasOwnProperty(p) || !r[p])) {
|
|
808
|
+
var d = r[p];
|
|
809
|
+
d = Array.isArray(d) ? d : [d];
|
|
810
|
+
for (var S = 0; S < d.length; ++S) {
|
|
811
|
+
if (g && g.cause == p + "," + S)
|
|
798
812
|
return;
|
|
799
|
-
var b =
|
|
800
|
-
if (
|
|
801
|
-
var
|
|
802
|
-
b.pattern = RegExp(b.pattern.source,
|
|
813
|
+
var b = d[S], w = b.inside, ee = !!b.lookbehind, te = !!b.greedy, me = b.alias;
|
|
814
|
+
if (te && !b.pattern.global) {
|
|
815
|
+
var Ae = b.pattern.toString().match(/[imsuy]*$/)[0];
|
|
816
|
+
b.pattern = RegExp(b.pattern.source, Ae + "g");
|
|
803
817
|
}
|
|
804
|
-
for (var
|
|
805
|
-
var
|
|
806
|
-
if (
|
|
818
|
+
for (var ne = b.pattern || b, I = s.next, v = i; I !== a.tail && !(g && v >= g.reach); v += I.value.length, I = I.next) {
|
|
819
|
+
var D = I.value;
|
|
820
|
+
if (a.length > t.length)
|
|
807
821
|
return;
|
|
808
|
-
if (!(
|
|
809
|
-
var
|
|
810
|
-
if (
|
|
811
|
-
if (
|
|
822
|
+
if (!(D instanceof m)) {
|
|
823
|
+
var M = 1, R;
|
|
824
|
+
if (te) {
|
|
825
|
+
if (R = y(ne, v, t, ee), !R || R.index >= t.length)
|
|
812
826
|
break;
|
|
813
|
-
var
|
|
814
|
-
for (
|
|
815
|
-
I = I.next,
|
|
816
|
-
if (
|
|
827
|
+
var $ = R.index, Se = R.index + R[0].length, L = v;
|
|
828
|
+
for (L += I.value.length; $ >= L; )
|
|
829
|
+
I = I.next, L += I.value.length;
|
|
830
|
+
if (L -= I.value.length, v = L, I.value instanceof m)
|
|
817
831
|
continue;
|
|
818
|
-
for (var P = I; P !==
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
} else if (
|
|
832
|
+
for (var P = I; P !== a.tail && (L < Se || typeof P.value == "string"); P = P.next)
|
|
833
|
+
M++, L += P.value.length;
|
|
834
|
+
M--, D = t.slice(v, L), R.index -= v;
|
|
835
|
+
} else if (R = y(ne, 0, D, ee), !R)
|
|
822
836
|
continue;
|
|
823
|
-
var
|
|
824
|
-
|
|
825
|
-
var
|
|
826
|
-
|
|
827
|
-
var
|
|
828
|
-
if (I =
|
|
829
|
-
var
|
|
830
|
-
cause:
|
|
831
|
-
reach:
|
|
837
|
+
var $ = R.index, G = R[0], j = D.slice(0, $), ae = D.slice($ + G.length), K = v + D.length;
|
|
838
|
+
g && K > g.reach && (g.reach = K);
|
|
839
|
+
var B = I.prev;
|
|
840
|
+
j && (B = O(a, B, j), v += j.length), k(a, B, M);
|
|
841
|
+
var Te = new m(p, w ? u.tokenize(G, w) : G, me, G);
|
|
842
|
+
if (I = O(a, B, Te), ae && O(a, I, ae), M > 1) {
|
|
843
|
+
var q = {
|
|
844
|
+
cause: p + "," + S,
|
|
845
|
+
reach: K
|
|
832
846
|
};
|
|
833
|
-
|
|
847
|
+
F(t, a, r, I.prev, v, q), g && q.reach > g.reach && (g.reach = q.reach);
|
|
834
848
|
}
|
|
835
849
|
}
|
|
836
850
|
}
|
|
837
851
|
}
|
|
838
852
|
}
|
|
839
853
|
}
|
|
840
|
-
function
|
|
841
|
-
var
|
|
842
|
-
|
|
854
|
+
function C() {
|
|
855
|
+
var t = { value: null, prev: null, next: null }, a = { value: null, prev: t, next: null };
|
|
856
|
+
t.next = a, this.head = t, this.tail = a, this.length = 0;
|
|
843
857
|
}
|
|
844
|
-
function
|
|
845
|
-
var s =
|
|
846
|
-
return
|
|
858
|
+
function O(t, a, r) {
|
|
859
|
+
var s = a.next, i = { value: r, prev: a, next: s };
|
|
860
|
+
return a.next = i, s.prev = i, t.length++, i;
|
|
847
861
|
}
|
|
848
|
-
function
|
|
849
|
-
for (var s =
|
|
862
|
+
function k(t, a, r) {
|
|
863
|
+
for (var s = a.next, i = 0; i < r && s !== t.tail; i++)
|
|
850
864
|
s = s.next;
|
|
851
|
-
|
|
865
|
+
a.next = s, s.prev = a, t.length -= i;
|
|
852
866
|
}
|
|
853
|
-
function N(
|
|
854
|
-
for (var
|
|
855
|
-
|
|
856
|
-
return
|
|
867
|
+
function N(t) {
|
|
868
|
+
for (var a = [], r = t.head.next; r !== t.tail; )
|
|
869
|
+
a.push(r.value), r = r.next;
|
|
870
|
+
return a;
|
|
857
871
|
}
|
|
858
|
-
if (!
|
|
859
|
-
return
|
|
860
|
-
var
|
|
861
|
-
|
|
862
|
-
}, !1)),
|
|
863
|
-
var
|
|
864
|
-
|
|
865
|
-
function
|
|
866
|
-
|
|
872
|
+
if (!l.document)
|
|
873
|
+
return l.addEventListener && (u.disableWorkerMessageHandler || l.addEventListener("message", function(t) {
|
|
874
|
+
var a = JSON.parse(t.data), r = a.language, s = a.code, i = a.immediateClose;
|
|
875
|
+
l.postMessage(u.highlight(s, u.languages[r], r)), i && l.close();
|
|
876
|
+
}, !1)), u;
|
|
877
|
+
var h = u.util.currentScript();
|
|
878
|
+
h && (u.filename = h.src, h.hasAttribute("data-manual") && (u.manual = !0));
|
|
879
|
+
function f() {
|
|
880
|
+
u.manual || u.highlightAll();
|
|
867
881
|
}
|
|
868
|
-
if (!
|
|
869
|
-
var
|
|
870
|
-
|
|
882
|
+
if (!u.manual) {
|
|
883
|
+
var A = document.readyState;
|
|
884
|
+
A === "loading" || A === "interactive" && h && h.defer ? document.addEventListener("DOMContentLoaded", f) : window.requestAnimationFrame ? window.requestAnimationFrame(f) : window.setTimeout(f, 16);
|
|
871
885
|
}
|
|
872
|
-
return
|
|
873
|
-
})(
|
|
874
|
-
|
|
886
|
+
return u;
|
|
887
|
+
})(o);
|
|
888
|
+
n.exports && (n.exports = e), typeof ie < "u" && (ie.Prism = e), e.languages.markup = {
|
|
875
889
|
comment: {
|
|
876
890
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
877
891
|
greedy: !0
|
|
@@ -948,8 +962,8 @@ function we() {
|
|
|
948
962
|
},
|
|
949
963
|
/&#x?[\da-f]{1,8};/i
|
|
950
964
|
]
|
|
951
|
-
}, e.languages.markup.tag.inside["attr-value"].inside.entity = e.languages.markup.entity, e.languages.markup.doctype.inside["internal-subset"].inside = e.languages.markup, e.hooks.add("wrap", function(
|
|
952
|
-
|
|
965
|
+
}, e.languages.markup.tag.inside["attr-value"].inside.entity = e.languages.markup.entity, e.languages.markup.doctype.inside["internal-subset"].inside = e.languages.markup, e.hooks.add("wrap", function(l) {
|
|
966
|
+
l.type === "entity" && (l.attributes.title = l.content.replace(/&/, "&"));
|
|
953
967
|
}), Object.defineProperty(e.languages.markup.tag, "addInlined", {
|
|
954
968
|
/**
|
|
955
969
|
* Adds an inlined language to markup.
|
|
@@ -962,22 +976,22 @@ function we() {
|
|
|
962
976
|
* @example
|
|
963
977
|
* addInlined('style', 'css');
|
|
964
978
|
*/
|
|
965
|
-
value: function(c,
|
|
966
|
-
var
|
|
967
|
-
|
|
979
|
+
value: function(c, E) {
|
|
980
|
+
var T = {};
|
|
981
|
+
T["language-" + E] = {
|
|
968
982
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
969
983
|
lookbehind: !0,
|
|
970
|
-
inside: e.languages[
|
|
971
|
-
},
|
|
972
|
-
var
|
|
984
|
+
inside: e.languages[E]
|
|
985
|
+
}, T.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
986
|
+
var u = {
|
|
973
987
|
"included-cdata": {
|
|
974
988
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
975
|
-
inside:
|
|
989
|
+
inside: T
|
|
976
990
|
}
|
|
977
991
|
};
|
|
978
|
-
|
|
992
|
+
u["language-" + E] = {
|
|
979
993
|
pattern: /[\s\S]+/,
|
|
980
|
-
inside: e.languages[
|
|
994
|
+
inside: e.languages[E]
|
|
981
995
|
};
|
|
982
996
|
var m = {};
|
|
983
997
|
m[c] = {
|
|
@@ -986,7 +1000,7 @@ function we() {
|
|
|
986
1000
|
}), "i"),
|
|
987
1001
|
lookbehind: !0,
|
|
988
1002
|
greedy: !0,
|
|
989
|
-
inside:
|
|
1003
|
+
inside: u
|
|
990
1004
|
}, e.languages.insertBefore("markup", "cdata", m);
|
|
991
1005
|
}
|
|
992
1006
|
}), Object.defineProperty(e.languages.markup.tag, "addAttribute", {
|
|
@@ -1001,10 +1015,10 @@ function we() {
|
|
|
1001
1015
|
* @example
|
|
1002
1016
|
* addAttribute('style', 'css');
|
|
1003
1017
|
*/
|
|
1004
|
-
value: function(
|
|
1018
|
+
value: function(l, c) {
|
|
1005
1019
|
e.languages.markup.tag.inside["special-attr"].push({
|
|
1006
1020
|
pattern: RegExp(
|
|
1007
|
-
/(^|["'\s])/.source + "(?:" +
|
|
1021
|
+
/(^|["'\s])/.source + "(?:" + l + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1008
1022
|
"i"
|
|
1009
1023
|
),
|
|
1010
1024
|
lookbehind: !0,
|
|
@@ -1031,9 +1045,9 @@ function we() {
|
|
|
1031
1045
|
}
|
|
1032
1046
|
});
|
|
1033
1047
|
}
|
|
1034
|
-
}), e.languages.html = e.languages.markup, e.languages.mathml = e.languages.markup, e.languages.svg = e.languages.markup, e.languages.xml = e.languages.extend("markup", {}), e.languages.ssml = e.languages.xml, e.languages.atom = e.languages.xml, e.languages.rss = e.languages.xml, (function(
|
|
1048
|
+
}), e.languages.html = e.languages.markup, e.languages.mathml = e.languages.markup, e.languages.svg = e.languages.markup, e.languages.xml = e.languages.extend("markup", {}), e.languages.ssml = e.languages.xml, e.languages.atom = e.languages.xml, e.languages.rss = e.languages.xml, (function(l) {
|
|
1035
1049
|
var c = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1036
|
-
|
|
1050
|
+
l.languages.css = {
|
|
1037
1051
|
comment: /\/\*[\s\S]*?\*\//,
|
|
1038
1052
|
atrule: {
|
|
1039
1053
|
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + c.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
@@ -1082,9 +1096,9 @@ function we() {
|
|
|
1082
1096
|
lookbehind: !0
|
|
1083
1097
|
},
|
|
1084
1098
|
punctuation: /[(){};:,]/
|
|
1085
|
-
},
|
|
1086
|
-
var
|
|
1087
|
-
|
|
1099
|
+
}, l.languages.css.atrule.inside.rest = l.languages.css;
|
|
1100
|
+
var E = l.languages.markup;
|
|
1101
|
+
E && (E.tag.addInlined("style", "css"), E.tag.addAttribute("style", "css"));
|
|
1088
1102
|
})(e), e.languages.clike = {
|
|
1089
1103
|
comment: [
|
|
1090
1104
|
{
|
|
@@ -1249,9 +1263,9 @@ function we() {
|
|
|
1249
1263
|
if (typeof e > "u" || typeof document > "u")
|
|
1250
1264
|
return;
|
|
1251
1265
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1252
|
-
var
|
|
1253
|
-
return "✖ Error " +
|
|
1254
|
-
},
|
|
1266
|
+
var l = "Loading…", c = function(h, f) {
|
|
1267
|
+
return "✖ Error " + h + " while fetching file: " + f;
|
|
1268
|
+
}, E = "✖ Error: File does not exist or is empty", T = {
|
|
1255
1269
|
js: "javascript",
|
|
1256
1270
|
py: "python",
|
|
1257
1271
|
rb: "ruby",
|
|
@@ -1261,52 +1275,52 @@ function we() {
|
|
|
1261
1275
|
bat: "batch",
|
|
1262
1276
|
h: "c",
|
|
1263
1277
|
tex: "latex"
|
|
1264
|
-
},
|
|
1265
|
-
function
|
|
1266
|
-
var
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
},
|
|
1278
|
+
}, u = "data-src-status", m = "loading", y = "loaded", F = "failed", C = "pre[data-src]:not([" + u + '="' + y + '"]):not([' + u + '="' + m + '"])';
|
|
1279
|
+
function O(h, f, A) {
|
|
1280
|
+
var t = new XMLHttpRequest();
|
|
1281
|
+
t.open("GET", h, !0), t.onreadystatechange = function() {
|
|
1282
|
+
t.readyState == 4 && (t.status < 400 && t.responseText ? f(t.responseText) : t.status >= 400 ? A(c(t.status, t.statusText)) : A(E));
|
|
1283
|
+
}, t.send(null);
|
|
1270
1284
|
}
|
|
1271
|
-
function
|
|
1272
|
-
var
|
|
1273
|
-
if (
|
|
1274
|
-
var
|
|
1275
|
-
return
|
|
1285
|
+
function k(h) {
|
|
1286
|
+
var f = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(h || "");
|
|
1287
|
+
if (f) {
|
|
1288
|
+
var A = Number(f[1]), t = f[2], a = f[3];
|
|
1289
|
+
return t ? a ? [A, Number(a)] : [A, void 0] : [A, A];
|
|
1276
1290
|
}
|
|
1277
1291
|
}
|
|
1278
|
-
e.hooks.add("before-highlightall", function(
|
|
1279
|
-
|
|
1280
|
-
}), e.hooks.add("before-sanity-check", function(
|
|
1281
|
-
var
|
|
1292
|
+
e.hooks.add("before-highlightall", function(h) {
|
|
1293
|
+
h.selector += ", " + C;
|
|
1294
|
+
}), e.hooks.add("before-sanity-check", function(h) {
|
|
1295
|
+
var f = (
|
|
1282
1296
|
/** @type {HTMLPreElement} */
|
|
1283
|
-
|
|
1297
|
+
h.element
|
|
1284
1298
|
);
|
|
1285
|
-
if (
|
|
1286
|
-
|
|
1287
|
-
var
|
|
1288
|
-
|
|
1289
|
-
var
|
|
1290
|
-
if (
|
|
1291
|
-
var r = (/\.(\w+)$/.exec(
|
|
1292
|
-
|
|
1299
|
+
if (f.matches(C)) {
|
|
1300
|
+
h.code = "", f.setAttribute(u, m);
|
|
1301
|
+
var A = f.appendChild(document.createElement("CODE"));
|
|
1302
|
+
A.textContent = l;
|
|
1303
|
+
var t = f.getAttribute("data-src"), a = h.language;
|
|
1304
|
+
if (a === "none") {
|
|
1305
|
+
var r = (/\.(\w+)$/.exec(t) || [, "none"])[1];
|
|
1306
|
+
a = T[r] || r;
|
|
1293
1307
|
}
|
|
1294
|
-
e.util.setLanguage(
|
|
1308
|
+
e.util.setLanguage(A, a), e.util.setLanguage(f, a);
|
|
1295
1309
|
var s = e.plugins.autoloader;
|
|
1296
|
-
s && s.loadLanguages(
|
|
1297
|
-
|
|
1310
|
+
s && s.loadLanguages(a), O(
|
|
1311
|
+
t,
|
|
1298
1312
|
function(i) {
|
|
1299
|
-
|
|
1300
|
-
var
|
|
1301
|
-
if (
|
|
1302
|
-
var
|
|
1303
|
-
|
|
1304
|
-
`),
|
|
1313
|
+
f.setAttribute(u, y);
|
|
1314
|
+
var g = k(f.getAttribute("data-range"));
|
|
1315
|
+
if (g) {
|
|
1316
|
+
var p = i.split(/\r\n?|\n/g), d = g[0], S = g[1] == null ? p.length : g[1];
|
|
1317
|
+
d < 0 && (d += p.length), d = Math.max(0, Math.min(d - 1, p.length)), S < 0 && (S += p.length), S = Math.max(0, Math.min(S, p.length)), i = p.slice(d, S).join(`
|
|
1318
|
+
`), f.hasAttribute("data-start") || f.setAttribute("data-start", String(d + 1));
|
|
1305
1319
|
}
|
|
1306
|
-
|
|
1320
|
+
A.textContent = i, e.highlightElement(A);
|
|
1307
1321
|
},
|
|
1308
1322
|
function(i) {
|
|
1309
|
-
|
|
1323
|
+
f.setAttribute(u, F), A.textContent = i;
|
|
1310
1324
|
}
|
|
1311
1325
|
);
|
|
1312
1326
|
}
|
|
@@ -1318,9 +1332,9 @@ function we() {
|
|
|
1318
1332
|
*
|
|
1319
1333
|
* @param {ParentNode} [container=document]
|
|
1320
1334
|
*/
|
|
1321
|
-
highlight: function(
|
|
1322
|
-
for (var
|
|
1323
|
-
e.highlightElement(
|
|
1335
|
+
highlight: function(f) {
|
|
1336
|
+
for (var A = (f || document).querySelectorAll(C), t = 0, a; a = A[t++]; )
|
|
1337
|
+
e.highlightElement(a);
|
|
1324
1338
|
}
|
|
1325
1339
|
};
|
|
1326
1340
|
var N = !1;
|
|
@@ -1328,13 +1342,13 @@ function we() {
|
|
|
1328
1342
|
N || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), N = !0), e.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1329
1343
|
};
|
|
1330
1344
|
})();
|
|
1331
|
-
})(
|
|
1345
|
+
})(V)), V.exports;
|
|
1332
1346
|
}
|
|
1333
|
-
var
|
|
1334
|
-
const
|
|
1335
|
-
var
|
|
1336
|
-
function
|
|
1337
|
-
return
|
|
1347
|
+
var $e = Me();
|
|
1348
|
+
const ue = /* @__PURE__ */ Ue($e);
|
|
1349
|
+
var le = {}, ce;
|
|
1350
|
+
function Ge() {
|
|
1351
|
+
return ce || (ce = 1, Prism.languages.python = {
|
|
1338
1352
|
comment: {
|
|
1339
1353
|
pattern: /(^|[^\\])#.*/,
|
|
1340
1354
|
lookbehind: !0,
|
|
@@ -1394,13 +1408,13 @@ function ke() {
|
|
|
1394
1408
|
number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
|
|
1395
1409
|
operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
|
|
1396
1410
|
punctuation: /[{}[\];(),.:]/
|
|
1397
|
-
}, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python),
|
|
1411
|
+
}, Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python, Prism.languages.py = Prism.languages.python), le;
|
|
1398
1412
|
}
|
|
1399
|
-
|
|
1400
|
-
var
|
|
1401
|
-
function
|
|
1402
|
-
return
|
|
1403
|
-
|
|
1413
|
+
Ge();
|
|
1414
|
+
var de = {}, ge;
|
|
1415
|
+
function Be() {
|
|
1416
|
+
return ge || (ge = 1, (function(n) {
|
|
1417
|
+
n.languages.typescript = n.languages.extend("javascript", {
|
|
1404
1418
|
"class-name": {
|
|
1405
1419
|
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|type)\s+)(?!keyof\b)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?:\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,
|
|
1406
1420
|
lookbehind: !0,
|
|
@@ -1409,15 +1423,15 @@ function De() {
|
|
|
1409
1423
|
// see below
|
|
1410
1424
|
},
|
|
1411
1425
|
builtin: /\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/
|
|
1412
|
-
}),
|
|
1426
|
+
}), n.languages.typescript.keyword.push(
|
|
1413
1427
|
/\b(?:abstract|declare|is|keyof|readonly|require)\b/,
|
|
1414
1428
|
// keywords that have to be followed by an identifier
|
|
1415
1429
|
/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,
|
|
1416
1430
|
// This is for `import type *, {}`
|
|
1417
1431
|
/\btype\b(?=\s*(?:[\{*]|$))/
|
|
1418
|
-
), delete
|
|
1419
|
-
var
|
|
1420
|
-
delete
|
|
1432
|
+
), delete n.languages.typescript.parameter, delete n.languages.typescript["literal-property"];
|
|
1433
|
+
var o = n.languages.extend("typescript", {});
|
|
1434
|
+
delete o["class-name"], n.languages.typescript["class-name"].inside = o, n.languages.insertBefore("typescript", "function", {
|
|
1421
1435
|
decorator: {
|
|
1422
1436
|
pattern: /@[$\w\xA0-\uFFFF]+/,
|
|
1423
1437
|
inside: {
|
|
@@ -1438,26 +1452,26 @@ function De() {
|
|
|
1438
1452
|
pattern: /<[\s\S]+/,
|
|
1439
1453
|
// everything after the first <
|
|
1440
1454
|
alias: "class-name",
|
|
1441
|
-
inside:
|
|
1455
|
+
inside: o
|
|
1442
1456
|
}
|
|
1443
1457
|
}
|
|
1444
1458
|
}
|
|
1445
|
-
}),
|
|
1446
|
-
})(Prism)),
|
|
1459
|
+
}), n.languages.ts = n.languages.typescript;
|
|
1460
|
+
})(Prism)), de;
|
|
1447
1461
|
}
|
|
1448
|
-
|
|
1449
|
-
(function(
|
|
1450
|
-
var
|
|
1462
|
+
Be();
|
|
1463
|
+
(function(n) {
|
|
1464
|
+
var o = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", e = {
|
|
1451
1465
|
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
|
|
1452
1466
|
lookbehind: !0,
|
|
1453
1467
|
alias: "punctuation",
|
|
1454
1468
|
// this looks reasonably well in all themes
|
|
1455
1469
|
inside: null
|
|
1456
1470
|
// see below
|
|
1457
|
-
},
|
|
1471
|
+
}, l = {
|
|
1458
1472
|
bash: e,
|
|
1459
1473
|
environment: {
|
|
1460
|
-
pattern: RegExp("\\$" +
|
|
1474
|
+
pattern: RegExp("\\$" + o),
|
|
1461
1475
|
alias: "constant"
|
|
1462
1476
|
},
|
|
1463
1477
|
variable: [
|
|
@@ -1497,7 +1511,7 @@ De();
|
|
|
1497
1511
|
operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
|
|
1498
1512
|
punctuation: /[\[\]]/,
|
|
1499
1513
|
environment: {
|
|
1500
|
-
pattern: RegExp("(\\{)" +
|
|
1514
|
+
pattern: RegExp("(\\{)" + o),
|
|
1501
1515
|
lookbehind: !0,
|
|
1502
1516
|
alias: "constant"
|
|
1503
1517
|
}
|
|
@@ -1508,7 +1522,7 @@ De();
|
|
|
1508
1522
|
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|
1509
1523
|
entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
|
|
1510
1524
|
};
|
|
1511
|
-
|
|
1525
|
+
n.languages.bash = {
|
|
1512
1526
|
shebang: {
|
|
1513
1527
|
pattern: /^#!\s*\/.*/,
|
|
1514
1528
|
alias: "important"
|
|
@@ -1546,7 +1560,7 @@ De();
|
|
|
1546
1560
|
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
|
|
1547
1561
|
inside: {
|
|
1548
1562
|
environment: {
|
|
1549
|
-
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" +
|
|
1563
|
+
pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + o),
|
|
1550
1564
|
lookbehind: !0,
|
|
1551
1565
|
alias: "constant"
|
|
1552
1566
|
}
|
|
@@ -1566,7 +1580,7 @@ De();
|
|
|
1566
1580
|
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
|
|
1567
1581
|
lookbehind: !0,
|
|
1568
1582
|
greedy: !0,
|
|
1569
|
-
inside:
|
|
1583
|
+
inside: l
|
|
1570
1584
|
},
|
|
1571
1585
|
// Here-document with quotes around the tag
|
|
1572
1586
|
// → No expansion (so no “inside”).
|
|
@@ -1584,7 +1598,7 @@ De();
|
|
|
1584
1598
|
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
|
|
1585
1599
|
lookbehind: !0,
|
|
1586
1600
|
greedy: !0,
|
|
1587
|
-
inside:
|
|
1601
|
+
inside: l
|
|
1588
1602
|
},
|
|
1589
1603
|
{
|
|
1590
1604
|
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|
@@ -1597,15 +1611,15 @@ De();
|
|
|
1597
1611
|
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
|
|
1598
1612
|
greedy: !0,
|
|
1599
1613
|
inside: {
|
|
1600
|
-
entity:
|
|
1614
|
+
entity: l.entity
|
|
1601
1615
|
}
|
|
1602
1616
|
}
|
|
1603
1617
|
],
|
|
1604
1618
|
environment: {
|
|
1605
|
-
pattern: RegExp("\\$?" +
|
|
1619
|
+
pattern: RegExp("\\$?" + o),
|
|
1606
1620
|
alias: "constant"
|
|
1607
1621
|
},
|
|
1608
|
-
variable:
|
|
1622
|
+
variable: l.variable,
|
|
1609
1623
|
function: {
|
|
1610
1624
|
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
|
|
1611
1625
|
lookbehind: !0
|
|
@@ -1644,7 +1658,7 @@ De();
|
|
|
1644
1658
|
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
|
|
1645
1659
|
lookbehind: !0
|
|
1646
1660
|
}
|
|
1647
|
-
}, e.inside =
|
|
1661
|
+
}, e.inside = n.languages.bash;
|
|
1648
1662
|
for (var c = [
|
|
1649
1663
|
"comment",
|
|
1650
1664
|
"function-name",
|
|
@@ -1661,9 +1675,9 @@ De();
|
|
|
1661
1675
|
"operator",
|
|
1662
1676
|
"punctuation",
|
|
1663
1677
|
"number"
|
|
1664
|
-
],
|
|
1665
|
-
|
|
1666
|
-
|
|
1678
|
+
], E = l.variable[1].inside, T = 0; T < c.length; T++)
|
|
1679
|
+
E[c[T]] = n.languages.bash[c[T]];
|
|
1680
|
+
n.languages.sh = n.languages.bash, n.languages.shell = n.languages.bash;
|
|
1667
1681
|
})(Prism);
|
|
1668
1682
|
Prism.languages.json = {
|
|
1669
1683
|
property: {
|
|
@@ -1690,12 +1704,12 @@ Prism.languages.json = {
|
|
|
1690
1704
|
}
|
|
1691
1705
|
};
|
|
1692
1706
|
Prism.languages.webmanifest = Prism.languages.json;
|
|
1693
|
-
(function(
|
|
1694
|
-
var
|
|
1695
|
-
|
|
1707
|
+
(function(n) {
|
|
1708
|
+
var o = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1709
|
+
n.languages.css = {
|
|
1696
1710
|
comment: /\/\*[\s\S]*?\*\//,
|
|
1697
1711
|
atrule: {
|
|
1698
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" +
|
|
1712
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + o.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1699
1713
|
inside: {
|
|
1700
1714
|
rule: /^@[\w-]+/,
|
|
1701
1715
|
"selector-function-argument": {
|
|
@@ -1712,23 +1726,23 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
1712
1726
|
},
|
|
1713
1727
|
url: {
|
|
1714
1728
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1715
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
1729
|
+
pattern: RegExp("\\burl\\((?:" + o.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1716
1730
|
greedy: !0,
|
|
1717
1731
|
inside: {
|
|
1718
1732
|
function: /^url/i,
|
|
1719
1733
|
punctuation: /^\(|\)$/,
|
|
1720
1734
|
string: {
|
|
1721
|
-
pattern: RegExp("^" +
|
|
1735
|
+
pattern: RegExp("^" + o.source + "$"),
|
|
1722
1736
|
alias: "url"
|
|
1723
1737
|
}
|
|
1724
1738
|
}
|
|
1725
1739
|
},
|
|
1726
1740
|
selector: {
|
|
1727
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` +
|
|
1741
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + o.source + ")*(?=\\s*\\{)"),
|
|
1728
1742
|
lookbehind: !0
|
|
1729
1743
|
},
|
|
1730
1744
|
string: {
|
|
1731
|
-
pattern:
|
|
1745
|
+
pattern: o,
|
|
1732
1746
|
greedy: !0
|
|
1733
1747
|
},
|
|
1734
1748
|
property: {
|
|
@@ -1741,8 +1755,8 @@ Prism.languages.webmanifest = Prism.languages.json;
|
|
|
1741
1755
|
lookbehind: !0
|
|
1742
1756
|
},
|
|
1743
1757
|
punctuation: /[(){};:,]/
|
|
1744
|
-
},
|
|
1745
|
-
var e =
|
|
1758
|
+
}, n.languages.css.atrule.inside.rest = n.languages.css;
|
|
1759
|
+
var e = n.languages.markup;
|
|
1746
1760
|
e && (e.tag.addInlined("style", "css"), e.tag.addAttribute("style", "css"));
|
|
1747
1761
|
})(Prism);
|
|
1748
1762
|
Prism.languages.markup = {
|
|
@@ -1825,8 +1839,8 @@ Prism.languages.markup = {
|
|
|
1825
1839
|
};
|
|
1826
1840
|
Prism.languages.markup.tag.inside["attr-value"].inside.entity = Prism.languages.markup.entity;
|
|
1827
1841
|
Prism.languages.markup.doctype.inside["internal-subset"].inside = Prism.languages.markup;
|
|
1828
|
-
Prism.hooks.add("wrap", function(
|
|
1829
|
-
|
|
1842
|
+
Prism.hooks.add("wrap", function(n) {
|
|
1843
|
+
n.type === "entity" && (n.attributes.title = n.content.replace(/&/, "&"));
|
|
1830
1844
|
});
|
|
1831
1845
|
Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
|
|
1832
1846
|
/**
|
|
@@ -1840,32 +1854,32 @@ Object.defineProperty(Prism.languages.markup.tag, "addInlined", {
|
|
|
1840
1854
|
* @example
|
|
1841
1855
|
* addInlined('style', 'css');
|
|
1842
1856
|
*/
|
|
1843
|
-
value: function(
|
|
1844
|
-
var
|
|
1845
|
-
|
|
1857
|
+
value: function(o, e) {
|
|
1858
|
+
var l = {};
|
|
1859
|
+
l["language-" + e] = {
|
|
1846
1860
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1847
1861
|
lookbehind: !0,
|
|
1848
1862
|
inside: Prism.languages[e]
|
|
1849
|
-
},
|
|
1863
|
+
}, l.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1850
1864
|
var c = {
|
|
1851
1865
|
"included-cdata": {
|
|
1852
1866
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1853
|
-
inside:
|
|
1867
|
+
inside: l
|
|
1854
1868
|
}
|
|
1855
1869
|
};
|
|
1856
1870
|
c["language-" + e] = {
|
|
1857
1871
|
pattern: /[\s\S]+/,
|
|
1858
1872
|
inside: Prism.languages[e]
|
|
1859
1873
|
};
|
|
1860
|
-
var
|
|
1861
|
-
|
|
1874
|
+
var E = {};
|
|
1875
|
+
E[o] = {
|
|
1862
1876
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1863
|
-
return
|
|
1877
|
+
return o;
|
|
1864
1878
|
}), "i"),
|
|
1865
1879
|
lookbehind: !0,
|
|
1866
1880
|
greedy: !0,
|
|
1867
1881
|
inside: c
|
|
1868
|
-
}, Prism.languages.insertBefore("markup", "cdata",
|
|
1882
|
+
}, Prism.languages.insertBefore("markup", "cdata", E);
|
|
1869
1883
|
}
|
|
1870
1884
|
});
|
|
1871
1885
|
Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
@@ -1880,10 +1894,10 @@ Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
|
1880
1894
|
* @example
|
|
1881
1895
|
* addAttribute('style', 'css');
|
|
1882
1896
|
*/
|
|
1883
|
-
value: function(
|
|
1897
|
+
value: function(n, o) {
|
|
1884
1898
|
Prism.languages.markup.tag.inside["special-attr"].push({
|
|
1885
1899
|
pattern: RegExp(
|
|
1886
|
-
/(^|["'\s])/.source + "(?:" +
|
|
1900
|
+
/(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
1887
1901
|
"i"
|
|
1888
1902
|
),
|
|
1889
1903
|
lookbehind: !0,
|
|
@@ -1895,8 +1909,8 @@ Object.defineProperty(Prism.languages.markup.tag, "addAttribute", {
|
|
|
1895
1909
|
value: {
|
|
1896
1910
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1897
1911
|
lookbehind: !0,
|
|
1898
|
-
alias: [
|
|
1899
|
-
inside: Prism.languages[
|
|
1912
|
+
alias: [o, "language-" + o],
|
|
1913
|
+
inside: Prism.languages[o]
|
|
1900
1914
|
},
|
|
1901
1915
|
punctuation: [
|
|
1902
1916
|
{
|
|
@@ -1951,7 +1965,7 @@ Prism.languages.sql = {
|
|
|
1951
1965
|
operator: /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,
|
|
1952
1966
|
punctuation: /[;[\]()`,.]/
|
|
1953
1967
|
};
|
|
1954
|
-
const
|
|
1968
|
+
const He = {
|
|
1955
1969
|
js: "javascript",
|
|
1956
1970
|
ts: "typescript",
|
|
1957
1971
|
shell: "bash",
|
|
@@ -1959,24 +1973,101 @@ const _e = {
|
|
|
1959
1973
|
html: "markup",
|
|
1960
1974
|
xml: "markup"
|
|
1961
1975
|
};
|
|
1962
|
-
|
|
1976
|
+
Y.setOptions({
|
|
1963
1977
|
breaks: !0,
|
|
1964
1978
|
gfm: !0
|
|
1965
1979
|
});
|
|
1966
|
-
const
|
|
1967
|
-
|
|
1968
|
-
const e =
|
|
1969
|
-
if (
|
|
1970
|
-
const
|
|
1971
|
-
return `<pre><code class="language-${e}">${
|
|
1980
|
+
const he = new Y.Renderer();
|
|
1981
|
+
he.code = ({ text: n, lang: o }) => {
|
|
1982
|
+
const e = o ? He[o] || o : "plaintext", l = ue.languages[e];
|
|
1983
|
+
if (l) {
|
|
1984
|
+
const E = ue.highlight(n, l, e);
|
|
1985
|
+
return `<pre><code class="language-${e}">${E}</code></pre>`;
|
|
1972
1986
|
}
|
|
1973
|
-
return `<pre><code>${
|
|
1987
|
+
return `<pre><code>${n.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">")}</code></pre>`;
|
|
1974
1988
|
};
|
|
1975
|
-
|
|
1976
|
-
function
|
|
1977
|
-
return
|
|
1989
|
+
Y.use({ renderer: he });
|
|
1990
|
+
function gt(n) {
|
|
1991
|
+
return Y.parse(n);
|
|
1992
|
+
}
|
|
1993
|
+
function pt(n) {
|
|
1994
|
+
return n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : `${(n / (1024 * 1024)).toFixed(1)} MB`;
|
|
1995
|
+
}
|
|
1996
|
+
function ft(n) {
|
|
1997
|
+
return Ee.includes(n.type) ? n.size > we ? "File exceeds the 10MB size limit." : null : `File type "${n.type}" is not supported.`;
|
|
1998
|
+
}
|
|
1999
|
+
async function ze({
|
|
2000
|
+
publishableApiKey: n,
|
|
2001
|
+
threadId: o,
|
|
2002
|
+
fileName: e,
|
|
2003
|
+
fileType: l,
|
|
2004
|
+
fileSize: c,
|
|
2005
|
+
baseUrl: E
|
|
2006
|
+
}) {
|
|
2007
|
+
const T = await Q(), u = await fetch(Le(E), {
|
|
2008
|
+
method: "POST",
|
|
2009
|
+
headers: {
|
|
2010
|
+
"Content-Type": "application/json",
|
|
2011
|
+
"X-Api-Key": n,
|
|
2012
|
+
...T ? { Authorization: `Bearer ${T}` } : {}
|
|
2013
|
+
},
|
|
2014
|
+
body: JSON.stringify({ threadId: o, fileName: e, fileType: l, fileSize: c })
|
|
2015
|
+
});
|
|
2016
|
+
if (!u.ok) {
|
|
2017
|
+
const m = await u.json().catch(() => ({}));
|
|
2018
|
+
throw new Error(
|
|
2019
|
+
m.error || `Upload URL request failed: ${u.status}`
|
|
2020
|
+
);
|
|
2021
|
+
}
|
|
2022
|
+
return u.json();
|
|
2023
|
+
}
|
|
2024
|
+
async function Ye(n, o) {
|
|
2025
|
+
const e = await fetch(n, {
|
|
2026
|
+
method: "PUT",
|
|
2027
|
+
headers: { "Content-Type": o.type },
|
|
2028
|
+
body: o
|
|
2029
|
+
});
|
|
2030
|
+
if (!e.ok)
|
|
2031
|
+
throw new Error(`Storage upload failed: ${e.status}`);
|
|
2032
|
+
}
|
|
2033
|
+
async function Et({
|
|
2034
|
+
publishableApiKey: n,
|
|
2035
|
+
threadId: o,
|
|
2036
|
+
file: e,
|
|
2037
|
+
baseUrl: l
|
|
2038
|
+
}) {
|
|
2039
|
+
const { uploadUrl: c, storagePath: E } = await ze({
|
|
2040
|
+
publishableApiKey: n,
|
|
2041
|
+
threadId: o,
|
|
2042
|
+
fileName: e.name,
|
|
2043
|
+
fileType: e.type,
|
|
2044
|
+
fileSize: e.size,
|
|
2045
|
+
baseUrl: l
|
|
2046
|
+
});
|
|
2047
|
+
return await Ye(c, e), { fileName: e.name, fileType: e.type, fileSize: e.size, storagePath: E };
|
|
2048
|
+
}
|
|
2049
|
+
async function ht({
|
|
2050
|
+
publishableApiKey: n,
|
|
2051
|
+
storagePath: o,
|
|
2052
|
+
baseUrl: e
|
|
2053
|
+
}) {
|
|
2054
|
+
const l = await Q();
|
|
2055
|
+
try {
|
|
2056
|
+
const c = await fetch(Fe(e), {
|
|
2057
|
+
method: "POST",
|
|
2058
|
+
headers: {
|
|
2059
|
+
"Content-Type": "application/json",
|
|
2060
|
+
"X-Api-Key": n,
|
|
2061
|
+
...l ? { Authorization: `Bearer ${l}` } : {}
|
|
2062
|
+
},
|
|
2063
|
+
body: JSON.stringify({ storagePath: o })
|
|
2064
|
+
});
|
|
2065
|
+
return c.ok && (await c.json()).url || null;
|
|
2066
|
+
} catch {
|
|
2067
|
+
return null;
|
|
2068
|
+
}
|
|
1978
2069
|
}
|
|
1979
|
-
const
|
|
2070
|
+
const We = "https://005d25250a41bd0071570b0c0a2b2c4d@o4510467570073600.ingest.us.sentry.io/4510472944156672", Xe = [
|
|
1980
2071
|
"@useknest",
|
|
1981
2072
|
"useknest",
|
|
1982
2073
|
"widget-core",
|
|
@@ -1986,22 +2077,22 @@ const Pe = "https://005d25250a41bd0071570b0c0a2b2c4d@o4510467570073600.ingest.us
|
|
|
1986
2077
|
"widget.js",
|
|
1987
2078
|
"knest"
|
|
1988
2079
|
];
|
|
1989
|
-
function
|
|
1990
|
-
if (
|
|
1991
|
-
const
|
|
1992
|
-
return !
|
|
1993
|
-
const
|
|
1994
|
-
return
|
|
2080
|
+
function je(n) {
|
|
2081
|
+
if (n.tags?.source === "knest-widget") return !0;
|
|
2082
|
+
const o = n.exception?.values?.[0]?.stacktrace?.frames;
|
|
2083
|
+
return !o || o.length === 0 ? !1 : o.some((e) => {
|
|
2084
|
+
const l = e.filename || "";
|
|
2085
|
+
return Xe.some((c) => l.includes(c));
|
|
1995
2086
|
});
|
|
1996
2087
|
}
|
|
1997
|
-
let
|
|
1998
|
-
function
|
|
1999
|
-
|
|
2000
|
-
dsn:
|
|
2088
|
+
let pe = !1;
|
|
2089
|
+
function mt() {
|
|
2090
|
+
pe || (Z.init({
|
|
2091
|
+
dsn: We,
|
|
2001
2092
|
// Only capture errors, not performance data.
|
|
2002
2093
|
tracesSampleRate: 0,
|
|
2003
2094
|
integrations: [
|
|
2004
|
-
|
|
2095
|
+
Z.breadcrumbsIntegration({
|
|
2005
2096
|
console: !1,
|
|
2006
2097
|
dom: !0,
|
|
2007
2098
|
fetch: !0,
|
|
@@ -2016,53 +2107,108 @@ function Ve() {
|
|
|
2016
2107
|
}
|
|
2017
2108
|
},
|
|
2018
2109
|
// Filter out errors that don't originate from our widget code.
|
|
2019
|
-
beforeSend(
|
|
2020
|
-
return
|
|
2110
|
+
beforeSend(n) {
|
|
2111
|
+
return je(n) ? n : null;
|
|
2021
2112
|
}
|
|
2022
|
-
}),
|
|
2113
|
+
}), pe = !0);
|
|
2023
2114
|
}
|
|
2024
|
-
function
|
|
2025
|
-
const e = typeof
|
|
2026
|
-
|
|
2115
|
+
function At(n, o) {
|
|
2116
|
+
const e = typeof n == "string" ? new Error(n) : n;
|
|
2117
|
+
Z.captureException(e, {
|
|
2027
2118
|
tags: { source: "knest-widget" },
|
|
2028
|
-
extra:
|
|
2119
|
+
extra: o
|
|
2029
2120
|
});
|
|
2030
2121
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const e =
|
|
2122
|
+
function St(n, o) {
|
|
2123
|
+
const e = xe();
|
|
2033
2124
|
if (!e)
|
|
2034
2125
|
return () => {
|
|
2035
2126
|
};
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2127
|
+
const l = e.channel(`thread:${n}`).on("broadcast", { event: "new-message" }, (c) => {
|
|
2128
|
+
o(c.payload);
|
|
2038
2129
|
}).subscribe();
|
|
2039
2130
|
return () => {
|
|
2040
|
-
|
|
2131
|
+
l.unsubscribe();
|
|
2041
2132
|
};
|
|
2042
2133
|
}
|
|
2134
|
+
const Ke = "knest-widget-chat-", qe = 14400 * 1e3, Ve = 300, U = /* @__PURE__ */ new Map();
|
|
2135
|
+
function z(n) {
|
|
2136
|
+
return Ke + n;
|
|
2137
|
+
}
|
|
2138
|
+
function Tt(n) {
|
|
2139
|
+
try {
|
|
2140
|
+
const o = localStorage.getItem(z(n));
|
|
2141
|
+
if (!o) return null;
|
|
2142
|
+
const e = JSON.parse(o);
|
|
2143
|
+
return Date.now() - e.savedAt > qe ? (localStorage.removeItem(z(n)), null) : e;
|
|
2144
|
+
} catch {
|
|
2145
|
+
return null;
|
|
2146
|
+
}
|
|
2147
|
+
}
|
|
2148
|
+
function Ze(n, o) {
|
|
2149
|
+
try {
|
|
2150
|
+
localStorage.setItem(z(n), JSON.stringify(o));
|
|
2151
|
+
} catch {
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function bt(n, o) {
|
|
2155
|
+
const e = U.get(n);
|
|
2156
|
+
e !== void 0 && clearTimeout(e);
|
|
2157
|
+
const l = setTimeout(() => {
|
|
2158
|
+
Ze(n, o), U.delete(n);
|
|
2159
|
+
}, Ve);
|
|
2160
|
+
U.set(n, l);
|
|
2161
|
+
}
|
|
2162
|
+
function It(n) {
|
|
2163
|
+
const o = U.get(n);
|
|
2164
|
+
o !== void 0 && (clearTimeout(o), U.delete(n));
|
|
2165
|
+
try {
|
|
2166
|
+
localStorage.removeItem(z(n));
|
|
2167
|
+
} catch {
|
|
2168
|
+
}
|
|
2169
|
+
}
|
|
2043
2170
|
export {
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2171
|
+
it as ACCEPTED_FILE_TYPES_STRING,
|
|
2172
|
+
Ee as ALLOWED_ATTACHMENT_TYPES,
|
|
2173
|
+
Ne as ALLOWED_DOCUMENT_TYPES,
|
|
2174
|
+
fe as ALLOWED_IMAGE_TYPES,
|
|
2175
|
+
X as API_PATH,
|
|
2176
|
+
Oe as AUTH_ERROR_MESSAGE,
|
|
2177
|
+
nt as DEFAULT_AVATAR_URL,
|
|
2178
|
+
W as DEFAULT_BASE_URL,
|
|
2179
|
+
at as DEFAULT_BRAND_COLOR,
|
|
2180
|
+
re as DEFAULT_ERROR_MESSAGE,
|
|
2181
|
+
st as DEFAULT_EXAMPLE_QUESTIONS,
|
|
2182
|
+
rt as DEFAULT_WELCOME_MESSAGE,
|
|
2183
|
+
Re as FALLBACK_ERROR_MESSAGE,
|
|
2184
|
+
ot as MAX_ATTACHMENTS_PER_MESSAGE,
|
|
2185
|
+
we as MAX_ATTACHMENT_SIZE_BYTES,
|
|
2186
|
+
tt as PUBLIC_SUPABASE_ANON_KEY,
|
|
2187
|
+
et as PUBLIC_SUPABASE_URL,
|
|
2188
|
+
ve as USAGE_LIMIT_MESSAGE,
|
|
2189
|
+
At as captureWidgetException,
|
|
2190
|
+
It as clearChatState,
|
|
2191
|
+
ht as fetchSignedUrl,
|
|
2192
|
+
lt as fetchWidgetConfig,
|
|
2193
|
+
gt as formatContent,
|
|
2194
|
+
pt as formatFileSize,
|
|
2195
|
+
Q as getAccessToken,
|
|
2196
|
+
Fe as getAttachmentSignedUrlEndpoint,
|
|
2197
|
+
Le as getAttachmentUploadUrl,
|
|
2198
|
+
Ie as getChatApiUrl,
|
|
2199
|
+
ye as getConfigApiUrl,
|
|
2200
|
+
xe as getSupabaseClient,
|
|
2201
|
+
ct as initWidgetAuth,
|
|
2202
|
+
mt as initWidgetSentry,
|
|
2203
|
+
Pe as isAuthenticated,
|
|
2204
|
+
ut as isImageType,
|
|
2205
|
+
Tt as loadChatState,
|
|
2206
|
+
ze as requestUploadUrl,
|
|
2207
|
+
Ze as saveChatState,
|
|
2208
|
+
bt as saveChatStateDebounced,
|
|
2209
|
+
dt as streamChatMessage,
|
|
2210
|
+
St as subscribeToThread,
|
|
2211
|
+
Et as uploadAttachment,
|
|
2212
|
+
Ye as uploadToStorage,
|
|
2213
|
+
ft as validateAttachment
|
|
2068
2214
|
};
|