rj-editor 1.2.0 → 1.3.1
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/README.md +35 -3
- package/dist/LexicalCodePrism.prod-aiocbvfq.js +1416 -0
- package/dist/components/code-block/actions/code-block-action/CodeBlockAction.d.ts +3 -1
- package/dist/components/rj-text-editor/createInitialConfig.d.ts +6 -2
- package/dist/nodes/ExtendedCodeNode.d.ts +29 -0
- package/dist/nodes/index.d.ts +1 -0
- package/dist/plugins/CodeCompletionPlugin.d.ts +1 -0
- package/dist/plugins/CodeHighlightPlugin.d.ts +1 -0
- package/dist/plugins/InlineCodeStylePlugin.d.ts +1 -0
- package/dist/prism-2TqtsDnJ.js +1917 -0
- package/dist/prism-bash-HogikaHd.js +175 -0
- package/dist/prism-docker-DI1lriSm.js +75 -0
- package/dist/prism-json-CPmaNewv.js +25 -0
- package/dist/prism-jsx-DCSoxYIa.js +46 -0
- package/dist/prism-tsx-BRUTQfCu.js +8 -0
- package/dist/prism-yaml-D6c5M_c9.js +68 -0
- package/dist/rj-editor.css +1 -1
- package/dist/rj-editor.js +2654 -2566
- package/dist/rj-editor.umd.cjs +12 -4
- package/dist/types/InsertCodeBlockPayload.d.ts +1 -0
- package/dist/types/RJEditorTranslations.d.ts +1 -0
- package/dist/utils/helpers/normalizePastedCodeBlockHtml.d.ts +1 -0
- package/package.json +4 -1
|
@@ -0,0 +1,1917 @@
|
|
|
1
|
+
import { $applyNodeReplacement as e, $create as t, $createLineBreakNode as n, $createNodeSelection as r, $createParagraphNode as i, $createRangeSelection as a, $createTabNode as o, $getEditor as s, $getNodeByKey as c, $getNodeFromDOMNode as l, $getRoot as u, $getSelection as d, $getSiblingCaret as f, $getState as p, $isBlockElementNode as m, $isEditorState as h, $isElementNode as g, $isLineBreakNode as _, $isNodeSelection as ee, $isRangeSelection as v, $isTabNode as te, $isTextNode as ne, $normalizeSelection__EXPERIMENTAL as y, $setSelection as b, $setState as x, CLEAR_EDITOR_COMMAND as S, CLICK_COMMAND as C, COMMAND_PRIORITY_CRITICAL as w, COMMAND_PRIORITY_EDITOR as re, COMMAND_PRIORITY_LOW as T, DecoratorNode as E, ElementNode as D, FORMAT_TEXT_COMMAND as O, HISTORY_MERGE_TAG as ie, INDENT_CONTENT_COMMAND as k, INSERT_TAB_COMMAND as A, KEY_ENTER_COMMAND as ae, KEY_TAB_COMMAND as oe, LineBreakNode as se, OUTDENT_CONTENT_COMMAND as ce, ParagraphNode as le, RootNode as ue, TEXT_TYPE_TO_FORMAT as de, TabNode as fe, TextNode as pe, addClassNamesToElement as j, createCommand as me, createEditor as he, createState as ge, defineExtension as M, getTextDirection as _e, isDOMNode as ve, isHTMLElement as ye, mergeRegister as N, removeClassNamesFromElement as be, safeCast as P, setDOMStyleFromCSS as xe, shallowMergeConfig as Se, toggleTextFormatType as Ce } from "lexical";
|
|
2
|
+
import { $getNearestBlockElementAncestorOrThrow as we, $handleIndentAndOutdent as Te, $insertNodeToNearestRoot as Ee, selectionAlwaysOnDisplay as De } from "@lexical/utils";
|
|
3
|
+
//#region \0rolldown/runtime.js
|
|
4
|
+
var Oe = Object.create, ke = Object.defineProperty, Ae = Object.getOwnPropertyDescriptor, je = Object.getOwnPropertyNames, Me = Object.getPrototypeOf, Ne = Object.prototype.hasOwnProperty, Pe = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), Fe = (e, t, n, r) => {
|
|
5
|
+
if (t && typeof t == "object" || typeof t == "function") for (var i = je(t), a = 0, o = i.length, s; a < o; a++) s = i[a], !Ne.call(e, s) && s !== n && ke(e, s, {
|
|
6
|
+
get: ((e) => t[e]).bind(null, s),
|
|
7
|
+
enumerable: !(r = Ae(t, s)) || r.enumerable
|
|
8
|
+
});
|
|
9
|
+
return e;
|
|
10
|
+
}, Ie = (e, t, n) => (n = e == null ? {} : Oe(Me(e)), Fe(t || !e || !e.__esModule ? ke(n, "default", {
|
|
11
|
+
value: e,
|
|
12
|
+
enumerable: !0
|
|
13
|
+
}) : n, e)), Le = Symbol.for("preact-signals");
|
|
14
|
+
function Re() {
|
|
15
|
+
if (R > 1) return void R--;
|
|
16
|
+
let e, t = !1;
|
|
17
|
+
for (function() {
|
|
18
|
+
let e = L;
|
|
19
|
+
for (L = void 0; e !== void 0;) e.S.v === e.v && (e.S.i = e.i), e = e.o;
|
|
20
|
+
}(); I !== void 0;) {
|
|
21
|
+
let n = I;
|
|
22
|
+
for (I = void 0, z++; n !== void 0;) {
|
|
23
|
+
let r = n.u;
|
|
24
|
+
if (n.u = void 0, n.f &= -3, !(8 & n.f) && Ge(n)) try {
|
|
25
|
+
n.c();
|
|
26
|
+
} catch (n) {
|
|
27
|
+
t ||= (e = n, !0);
|
|
28
|
+
}
|
|
29
|
+
n = r;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (z = 0, R--, t) throw e;
|
|
33
|
+
}
|
|
34
|
+
function ze(e) {
|
|
35
|
+
if (R > 0) return e();
|
|
36
|
+
He = ++Ve, R++;
|
|
37
|
+
try {
|
|
38
|
+
return e();
|
|
39
|
+
} finally {
|
|
40
|
+
Re();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
var F, I;
|
|
44
|
+
function Be(e) {
|
|
45
|
+
let t = F;
|
|
46
|
+
F = void 0;
|
|
47
|
+
try {
|
|
48
|
+
return e();
|
|
49
|
+
} finally {
|
|
50
|
+
F = t;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
var L, R = 0, z = 0, Ve = 0, He = 0, Ue = 0;
|
|
54
|
+
function We(e) {
|
|
55
|
+
if (F === void 0) return;
|
|
56
|
+
let t = e.n;
|
|
57
|
+
return t === void 0 || t.t !== F ? (t = {
|
|
58
|
+
i: 0,
|
|
59
|
+
S: e,
|
|
60
|
+
p: F.s,
|
|
61
|
+
n: void 0,
|
|
62
|
+
t: F,
|
|
63
|
+
e: void 0,
|
|
64
|
+
x: void 0,
|
|
65
|
+
r: t
|
|
66
|
+
}, F.s !== void 0 && (F.s.n = t), F.s = t, e.n = t, 32 & F.f && e.S(t), t) : t.i === -1 ? (t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = F.s, t.n = void 0, F.s.n = t, F.s = t), t) : void 0;
|
|
67
|
+
}
|
|
68
|
+
function B(e, t) {
|
|
69
|
+
this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
|
|
70
|
+
}
|
|
71
|
+
function V(e, t) {
|
|
72
|
+
return new B(e, t);
|
|
73
|
+
}
|
|
74
|
+
function Ge(e) {
|
|
75
|
+
for (let t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;
|
|
76
|
+
return !1;
|
|
77
|
+
}
|
|
78
|
+
function Ke(e) {
|
|
79
|
+
for (let t = e.s; t !== void 0; t = t.n) {
|
|
80
|
+
let n = t.S.n;
|
|
81
|
+
if (n !== void 0 && (t.r = n), t.S.n = t, t.i = -1, t.n === void 0) {
|
|
82
|
+
e.s = t;
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function qe(e) {
|
|
88
|
+
let t, n = e.s;
|
|
89
|
+
for (; n !== void 0;) {
|
|
90
|
+
let e = n.p;
|
|
91
|
+
n.i === -1 ? (n.S.U(n), e !== void 0 && (e.n = n.n), n.n !== void 0 && (n.n.p = e)) : t = n, n.S.n = n.r, n.r !== void 0 && (n.r = void 0), n = e;
|
|
92
|
+
}
|
|
93
|
+
e.s = t;
|
|
94
|
+
}
|
|
95
|
+
function H(e, t) {
|
|
96
|
+
B.call(this, void 0), this.x = e, this.s = void 0, this.g = Ue - 1, this.f = 4, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;
|
|
97
|
+
}
|
|
98
|
+
function Je(e, t) {
|
|
99
|
+
return new H(e, t);
|
|
100
|
+
}
|
|
101
|
+
function Ye(e) {
|
|
102
|
+
let t = e.m;
|
|
103
|
+
if (e.m = void 0, typeof t == "function") {
|
|
104
|
+
R++;
|
|
105
|
+
let n = F;
|
|
106
|
+
F = void 0;
|
|
107
|
+
try {
|
|
108
|
+
t();
|
|
109
|
+
} catch (t) {
|
|
110
|
+
throw e.f &= -2, e.f |= 8, Xe(e), t;
|
|
111
|
+
} finally {
|
|
112
|
+
F = n, Re();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
function Xe(e) {
|
|
117
|
+
for (let t = e.s; t !== void 0; t = t.n) t.S.U(t);
|
|
118
|
+
e.x = void 0, e.s = void 0, Ye(e);
|
|
119
|
+
}
|
|
120
|
+
function Ze(e) {
|
|
121
|
+
if (F !== this) throw Error("Out-of-order effect");
|
|
122
|
+
qe(this), F = e, this.f &= -2, 8 & this.f && Xe(this), Re();
|
|
123
|
+
}
|
|
124
|
+
function U(e, t) {
|
|
125
|
+
this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name;
|
|
126
|
+
}
|
|
127
|
+
function W(e, t) {
|
|
128
|
+
let n = new U(e, t);
|
|
129
|
+
try {
|
|
130
|
+
n.c();
|
|
131
|
+
} catch (e) {
|
|
132
|
+
throw n.d(), e;
|
|
133
|
+
}
|
|
134
|
+
let r = n.d.bind(n);
|
|
135
|
+
return r[Symbol.dispose] = r, r;
|
|
136
|
+
}
|
|
137
|
+
function G(e, t = {}) {
|
|
138
|
+
let n = {};
|
|
139
|
+
for (let r in e) {
|
|
140
|
+
let i = t[r];
|
|
141
|
+
n[r] = V(i === void 0 ? e[r] : i);
|
|
142
|
+
}
|
|
143
|
+
return n;
|
|
144
|
+
}
|
|
145
|
+
B.prototype.brand = Le, B.prototype.h = function() {
|
|
146
|
+
return !0;
|
|
147
|
+
}, B.prototype.S = function(e) {
|
|
148
|
+
let t = this.t;
|
|
149
|
+
t !== e && e.e === void 0 && (e.x = t, this.t = e, t === void 0 ? Be(() => {
|
|
150
|
+
var e;
|
|
151
|
+
(e = this.W) == null || e.call(this);
|
|
152
|
+
}) : t.e = e);
|
|
153
|
+
}, B.prototype.U = function(e) {
|
|
154
|
+
if (this.t !== void 0) {
|
|
155
|
+
let t = e.e, n = e.x;
|
|
156
|
+
t !== void 0 && (t.x = n, e.e = void 0), n !== void 0 && (n.e = t, e.x = void 0), e === this.t && (this.t = n, n === void 0 && Be(() => {
|
|
157
|
+
var e;
|
|
158
|
+
(e = this.Z) == null || e.call(this);
|
|
159
|
+
}));
|
|
160
|
+
}
|
|
161
|
+
}, B.prototype.subscribe = function(e) {
|
|
162
|
+
return W(() => {
|
|
163
|
+
let t = this.value, n = F;
|
|
164
|
+
F = void 0;
|
|
165
|
+
try {
|
|
166
|
+
e(t);
|
|
167
|
+
} finally {
|
|
168
|
+
F = n;
|
|
169
|
+
}
|
|
170
|
+
}, { name: "sub" });
|
|
171
|
+
}, B.prototype.valueOf = function() {
|
|
172
|
+
return this.value;
|
|
173
|
+
}, B.prototype.toString = function() {
|
|
174
|
+
return this.value + "";
|
|
175
|
+
}, B.prototype.toJSON = function() {
|
|
176
|
+
return this.value;
|
|
177
|
+
}, B.prototype.peek = function() {
|
|
178
|
+
let e = F;
|
|
179
|
+
F = void 0;
|
|
180
|
+
try {
|
|
181
|
+
return this.value;
|
|
182
|
+
} finally {
|
|
183
|
+
F = e;
|
|
184
|
+
}
|
|
185
|
+
}, Object.defineProperty(B.prototype, "value", {
|
|
186
|
+
get() {
|
|
187
|
+
let e = We(this);
|
|
188
|
+
return e !== void 0 && (e.i = this.i), this.v;
|
|
189
|
+
},
|
|
190
|
+
set(e) {
|
|
191
|
+
if (e !== this.v) {
|
|
192
|
+
if (z > 100) throw Error("Cycle detected");
|
|
193
|
+
(function(e) {
|
|
194
|
+
R !== 0 && z === 0 && e.l !== He && (e.l = He, L = {
|
|
195
|
+
S: e,
|
|
196
|
+
v: e.v,
|
|
197
|
+
i: e.i,
|
|
198
|
+
o: L
|
|
199
|
+
});
|
|
200
|
+
})(this), this.v = e, this.i++, Ue++, R++;
|
|
201
|
+
try {
|
|
202
|
+
for (let e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
203
|
+
} finally {
|
|
204
|
+
Re();
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}), H.prototype = new B(), H.prototype.h = function() {
|
|
209
|
+
if (this.f &= -3, 1 & this.f) return !1;
|
|
210
|
+
if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ue)) return !0;
|
|
211
|
+
if (this.g = Ue, this.f |= 1, this.i > 0 && !Ge(this)) return this.f &= -2, !0;
|
|
212
|
+
let e = F;
|
|
213
|
+
try {
|
|
214
|
+
Ke(this), F = this;
|
|
215
|
+
let e = this.x();
|
|
216
|
+
(16 & this.f || this.v !== e || this.i === 0) && (this.v = e, this.f &= -17, this.i++);
|
|
217
|
+
} catch (e) {
|
|
218
|
+
this.v = e, this.f |= 16, this.i++;
|
|
219
|
+
}
|
|
220
|
+
return F = e, qe(this), this.f &= -2, !0;
|
|
221
|
+
}, H.prototype.S = function(e) {
|
|
222
|
+
if (this.t === void 0) {
|
|
223
|
+
this.f |= 36;
|
|
224
|
+
for (let e = this.s; e !== void 0; e = e.n) e.S.S(e);
|
|
225
|
+
}
|
|
226
|
+
B.prototype.S.call(this, e);
|
|
227
|
+
}, H.prototype.U = function(e) {
|
|
228
|
+
if (this.t !== void 0 && (B.prototype.U.call(this, e), this.t === void 0)) {
|
|
229
|
+
this.f &= -33;
|
|
230
|
+
for (let e = this.s; e !== void 0; e = e.n) e.S.U(e);
|
|
231
|
+
}
|
|
232
|
+
}, H.prototype.N = function() {
|
|
233
|
+
if (!(2 & this.f)) {
|
|
234
|
+
this.f |= 6;
|
|
235
|
+
for (let e = this.t; e !== void 0; e = e.x) e.t.N();
|
|
236
|
+
}
|
|
237
|
+
}, Object.defineProperty(H.prototype, "value", { get() {
|
|
238
|
+
if (1 & this.f) throw Error("Cycle detected");
|
|
239
|
+
let e = We(this);
|
|
240
|
+
if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;
|
|
241
|
+
return this.v;
|
|
242
|
+
} }), U.prototype.c = function() {
|
|
243
|
+
let e = this.S();
|
|
244
|
+
try {
|
|
245
|
+
if (8 & this.f || this.x === void 0) return;
|
|
246
|
+
let e = this.x();
|
|
247
|
+
typeof e == "function" && (this.m = e);
|
|
248
|
+
} finally {
|
|
249
|
+
e();
|
|
250
|
+
}
|
|
251
|
+
}, U.prototype.S = function() {
|
|
252
|
+
if (1 & this.f) throw Error("Cycle detected");
|
|
253
|
+
this.f |= 1, this.f &= -9, Ye(this), Ke(this), R++;
|
|
254
|
+
let e = F;
|
|
255
|
+
return F = this, Ze.bind(this, e);
|
|
256
|
+
}, U.prototype.N = function() {
|
|
257
|
+
2 & this.f || (this.f |= 2, this.u = I, I = this);
|
|
258
|
+
}, U.prototype.d = function() {
|
|
259
|
+
this.f |= 8, 1 & this.f || Xe(this);
|
|
260
|
+
}, U.prototype.dispose = function() {
|
|
261
|
+
this.d();
|
|
262
|
+
}, M({
|
|
263
|
+
build: (e, t, n) => G(t),
|
|
264
|
+
config: P({
|
|
265
|
+
defaultSelection: "rootEnd",
|
|
266
|
+
disabled: !1
|
|
267
|
+
}),
|
|
268
|
+
name: "@lexical/extension/AutoFocus",
|
|
269
|
+
register(e, t, n) {
|
|
270
|
+
let r = n.getOutput();
|
|
271
|
+
return W(() => r.disabled.value ? void 0 : e.registerRootListener((t) => {
|
|
272
|
+
e.focus(() => {
|
|
273
|
+
let e = document.activeElement;
|
|
274
|
+
t === null || e !== null && t.contains(e) || t.focus({ preventScroll: !0 });
|
|
275
|
+
}, { defaultSelection: r.defaultSelection.peek() });
|
|
276
|
+
}));
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
function Qe() {
|
|
280
|
+
let e = u(), t = d(), n = i();
|
|
281
|
+
e.clear(), e.append(n), t !== null && n.select(), v(t) && (t.format = 0);
|
|
282
|
+
}
|
|
283
|
+
function $e(e, t = Qe) {
|
|
284
|
+
return e.registerCommand(S, (n) => (e.update(t), !0), re);
|
|
285
|
+
}
|
|
286
|
+
M({
|
|
287
|
+
build: (e, t, n) => G(t),
|
|
288
|
+
config: P({ $onClear: Qe }),
|
|
289
|
+
name: "@lexical/extension/ClearEditor",
|
|
290
|
+
register(e, t, n) {
|
|
291
|
+
let { $onClear: r } = n.getOutput();
|
|
292
|
+
return W(() => $e(e, r.value));
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
function et(e) {
|
|
296
|
+
return (typeof e.nodes == "function" ? e.nodes() : e.nodes) || [];
|
|
297
|
+
}
|
|
298
|
+
var tt = ge("format", { parse: (e) => typeof e == "number" ? e : 0 }), nt = class extends E {
|
|
299
|
+
$config() {
|
|
300
|
+
return this.config("decorator-text", {
|
|
301
|
+
extends: E,
|
|
302
|
+
stateConfigs: [{
|
|
303
|
+
flat: !0,
|
|
304
|
+
stateConfig: tt
|
|
305
|
+
}]
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
getFormat() {
|
|
309
|
+
return p(this, tt);
|
|
310
|
+
}
|
|
311
|
+
getFormatFlags(e, t) {
|
|
312
|
+
return Ce(this.getFormat(), e, t);
|
|
313
|
+
}
|
|
314
|
+
hasFormat(e) {
|
|
315
|
+
let t = de[e];
|
|
316
|
+
return (this.getFormat() & t) !== 0;
|
|
317
|
+
}
|
|
318
|
+
setFormat(e) {
|
|
319
|
+
return x(this, tt, e);
|
|
320
|
+
}
|
|
321
|
+
toggleFormat(e) {
|
|
322
|
+
let t = Ce(this.getFormat(), e, null);
|
|
323
|
+
return this.setFormat(t);
|
|
324
|
+
}
|
|
325
|
+
isInline() {
|
|
326
|
+
return !0;
|
|
327
|
+
}
|
|
328
|
+
createDOM() {
|
|
329
|
+
return document.createElement("span");
|
|
330
|
+
}
|
|
331
|
+
updateDOM() {
|
|
332
|
+
return !1;
|
|
333
|
+
}
|
|
334
|
+
};
|
|
335
|
+
function rt(e) {
|
|
336
|
+
return e instanceof nt;
|
|
337
|
+
}
|
|
338
|
+
M({
|
|
339
|
+
name: "@lexical/extension/DecoratorText",
|
|
340
|
+
nodes: () => [nt],
|
|
341
|
+
register: (e, t, n) => e.registerCommand(O, (e) => {
|
|
342
|
+
let t = d();
|
|
343
|
+
if (ee(t) || v(t)) for (let n of t.getNodes()) rt(n) && n.toggleFormat(e);
|
|
344
|
+
return !1;
|
|
345
|
+
}, T)
|
|
346
|
+
});
|
|
347
|
+
function it(e, t) {
|
|
348
|
+
let n;
|
|
349
|
+
return V(e(), {
|
|
350
|
+
unwatched() {
|
|
351
|
+
n &&= (n(), void 0);
|
|
352
|
+
},
|
|
353
|
+
watched() {
|
|
354
|
+
this.value = e(), n = t(this);
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
}
|
|
358
|
+
var at = M({
|
|
359
|
+
build: (e) => it(() => e.getEditorState(), (t) => e.registerUpdateListener((e) => {
|
|
360
|
+
t.value = e.editorState;
|
|
361
|
+
})),
|
|
362
|
+
name: "@lexical/extension/EditorState"
|
|
363
|
+
});
|
|
364
|
+
function K(e, ...t) {
|
|
365
|
+
let n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
366
|
+
r.append("code", e);
|
|
367
|
+
for (let e of t) r.append("v", e);
|
|
368
|
+
throw n.search = r.toString(), Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
369
|
+
}
|
|
370
|
+
function ot(e, t) {
|
|
371
|
+
if (e && t && !Array.isArray(t) && typeof e == "object" && typeof t == "object") {
|
|
372
|
+
let n = e, r = t;
|
|
373
|
+
for (let e in r) n[e] = ot(n[e], r[e]);
|
|
374
|
+
return e;
|
|
375
|
+
}
|
|
376
|
+
return t;
|
|
377
|
+
}
|
|
378
|
+
var st = 0, ct = 1, lt = 2, ut = 3, q = 4, J = 5, dt = 6, Y = 7;
|
|
379
|
+
function ft(e) {
|
|
380
|
+
return e.id === st;
|
|
381
|
+
}
|
|
382
|
+
function pt(e) {
|
|
383
|
+
return e.id === lt;
|
|
384
|
+
}
|
|
385
|
+
function mt(e) {
|
|
386
|
+
return function(e) {
|
|
387
|
+
return e.id === ct;
|
|
388
|
+
}(e) || K(305, String(e.id), String(ct)), Object.assign(e, { id: lt });
|
|
389
|
+
}
|
|
390
|
+
var ht = /* @__PURE__ */ new Set(), gt = class {
|
|
391
|
+
builder;
|
|
392
|
+
configs;
|
|
393
|
+
_dependency;
|
|
394
|
+
_peerNameSet;
|
|
395
|
+
extension;
|
|
396
|
+
state;
|
|
397
|
+
_signal;
|
|
398
|
+
constructor(e, t) {
|
|
399
|
+
this.builder = e, this.extension = t, this.configs = /* @__PURE__ */ new Set(), this.state = { id: st };
|
|
400
|
+
}
|
|
401
|
+
mergeConfigs() {
|
|
402
|
+
let e = this.extension.config || {}, t = this.extension.mergeConfig ? this.extension.mergeConfig.bind(this.extension) : Se;
|
|
403
|
+
for (let n of this.configs) e = t(e, n);
|
|
404
|
+
return e;
|
|
405
|
+
}
|
|
406
|
+
init(e) {
|
|
407
|
+
let t = this.state;
|
|
408
|
+
pt(t) || K(306, String(t.id));
|
|
409
|
+
let n = {
|
|
410
|
+
getDependency: this.getInitDependency.bind(this),
|
|
411
|
+
getDirectDependentNames: this.getDirectDependentNames.bind(this),
|
|
412
|
+
getPeer: this.getInitPeer.bind(this),
|
|
413
|
+
getPeerNameSet: this.getPeerNameSet.bind(this)
|
|
414
|
+
}, r = {
|
|
415
|
+
...n,
|
|
416
|
+
getDependency: this.getDependency.bind(this),
|
|
417
|
+
getInitResult: this.getInitResult.bind(this),
|
|
418
|
+
getPeer: this.getPeer.bind(this)
|
|
419
|
+
}, i = function(e, t, n) {
|
|
420
|
+
return Object.assign(e, {
|
|
421
|
+
config: t,
|
|
422
|
+
id: ut,
|
|
423
|
+
registerState: n
|
|
424
|
+
});
|
|
425
|
+
}(t, this.mergeConfigs(), n), a;
|
|
426
|
+
this.state = i, this.extension.init && (a = this.extension.init(e, i.config, n)), this.state = function(e, t, n) {
|
|
427
|
+
return Object.assign(e, {
|
|
428
|
+
id: q,
|
|
429
|
+
initResult: t,
|
|
430
|
+
registerState: n
|
|
431
|
+
});
|
|
432
|
+
}(i, a, r);
|
|
433
|
+
}
|
|
434
|
+
build(e) {
|
|
435
|
+
let t = this.state, n;
|
|
436
|
+
t.id !== q && K(307, String(t.id), String(J)), this.extension.build && (n = this.extension.build(e, t.config, t.registerState));
|
|
437
|
+
let r = {
|
|
438
|
+
...t.registerState,
|
|
439
|
+
getOutput: () => n,
|
|
440
|
+
getSignal: this.getSignal.bind(this)
|
|
441
|
+
};
|
|
442
|
+
this.state = function(e, t, n) {
|
|
443
|
+
return Object.assign(e, {
|
|
444
|
+
id: J,
|
|
445
|
+
output: t,
|
|
446
|
+
registerState: n
|
|
447
|
+
});
|
|
448
|
+
}(t, n, r);
|
|
449
|
+
}
|
|
450
|
+
register(e, t) {
|
|
451
|
+
this._signal = t;
|
|
452
|
+
let n = this.state;
|
|
453
|
+
n.id !== J && K(308, String(n.id), String(J));
|
|
454
|
+
let r = this.extension.register && this.extension.register(e, n.config, n.registerState);
|
|
455
|
+
return this.state = function(e) {
|
|
456
|
+
return Object.assign(e, { id: dt });
|
|
457
|
+
}(n), () => {
|
|
458
|
+
let e = this.state;
|
|
459
|
+
e.id !== Y && K(309, String(n.id), String(Y)), this.state = function(e) {
|
|
460
|
+
return Object.assign(e, { id: J });
|
|
461
|
+
}(e), r && r();
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
afterRegistration(e) {
|
|
465
|
+
let t = this.state, n;
|
|
466
|
+
return t.id !== dt && K(310, String(t.id), String(dt)), this.extension.afterRegistration && (n = this.extension.afterRegistration(e, t.config, t.registerState)), this.state = function(e) {
|
|
467
|
+
return Object.assign(e, { id: Y });
|
|
468
|
+
}(t), n;
|
|
469
|
+
}
|
|
470
|
+
getSignal() {
|
|
471
|
+
return this._signal === void 0 && K(311), this._signal;
|
|
472
|
+
}
|
|
473
|
+
getInitResult() {
|
|
474
|
+
this.extension.init === void 0 && K(312, this.extension.name);
|
|
475
|
+
let e = this.state;
|
|
476
|
+
return function(e) {
|
|
477
|
+
return e.id >= q;
|
|
478
|
+
}(e) || K(313, String(e.id), String(q)), e.initResult;
|
|
479
|
+
}
|
|
480
|
+
getInitPeer(e) {
|
|
481
|
+
let t = this.builder.extensionNameMap.get(e);
|
|
482
|
+
return t ? t.getExtensionInitDependency() : void 0;
|
|
483
|
+
}
|
|
484
|
+
getExtensionInitDependency() {
|
|
485
|
+
let e = this.state;
|
|
486
|
+
return function(e) {
|
|
487
|
+
return e.id >= ut;
|
|
488
|
+
}(e) || K(314, String(e.id), String(ut)), { config: e.config };
|
|
489
|
+
}
|
|
490
|
+
getPeer(e) {
|
|
491
|
+
let t = this.builder.extensionNameMap.get(e);
|
|
492
|
+
return t ? t.getExtensionDependency() : void 0;
|
|
493
|
+
}
|
|
494
|
+
getInitDependency(e) {
|
|
495
|
+
let t = this.builder.getExtensionRep(e);
|
|
496
|
+
return t === void 0 && K(315, this.extension.name, e.name), t.getExtensionInitDependency();
|
|
497
|
+
}
|
|
498
|
+
getDependency(e) {
|
|
499
|
+
let t = this.builder.getExtensionRep(e);
|
|
500
|
+
return t === void 0 && K(315, this.extension.name, e.name), t.getExtensionDependency();
|
|
501
|
+
}
|
|
502
|
+
getState() {
|
|
503
|
+
let e = this.state;
|
|
504
|
+
return function(e) {
|
|
505
|
+
return e.id >= Y;
|
|
506
|
+
}(e) || K(316, String(e.id), String(Y)), e;
|
|
507
|
+
}
|
|
508
|
+
getDirectDependentNames() {
|
|
509
|
+
return this.builder.incomingEdges.get(this.extension.name) || ht;
|
|
510
|
+
}
|
|
511
|
+
getPeerNameSet() {
|
|
512
|
+
let e = this._peerNameSet;
|
|
513
|
+
return e || (e = new Set((this.extension.peerDependencies || []).map(([e]) => e)), this._peerNameSet = e), e;
|
|
514
|
+
}
|
|
515
|
+
getExtensionDependency() {
|
|
516
|
+
if (!this._dependency) {
|
|
517
|
+
let e = this.state;
|
|
518
|
+
(function(e) {
|
|
519
|
+
return e.id >= J;
|
|
520
|
+
})(e) || K(317, this.extension.name), this._dependency = {
|
|
521
|
+
config: e.config,
|
|
522
|
+
init: e.initResult,
|
|
523
|
+
output: e.output
|
|
524
|
+
};
|
|
525
|
+
}
|
|
526
|
+
return this._dependency;
|
|
527
|
+
}
|
|
528
|
+
}, _t = { tag: ie };
|
|
529
|
+
function vt() {
|
|
530
|
+
let e = u();
|
|
531
|
+
e.isEmpty() && e.append(i());
|
|
532
|
+
}
|
|
533
|
+
var yt = M({
|
|
534
|
+
config: P({
|
|
535
|
+
setOptions: _t,
|
|
536
|
+
updateOptions: _t
|
|
537
|
+
}),
|
|
538
|
+
init: ({ $initialEditorState: e = vt }) => ({
|
|
539
|
+
$initialEditorState: e,
|
|
540
|
+
initialized: !1
|
|
541
|
+
}),
|
|
542
|
+
afterRegistration(e, { updateOptions: t, setOptions: n }, r) {
|
|
543
|
+
let i = r.getInitResult();
|
|
544
|
+
if (!i.initialized) {
|
|
545
|
+
i.initialized = !0;
|
|
546
|
+
let { $initialEditorState: r } = i;
|
|
547
|
+
if (h(r)) e.setEditorState(r, n);
|
|
548
|
+
else if (typeof r == "function") e.update(() => {
|
|
549
|
+
r(e);
|
|
550
|
+
}, t);
|
|
551
|
+
else if (r && (typeof r == "string" || typeof r == "object")) {
|
|
552
|
+
let t = e.parseEditorState(r);
|
|
553
|
+
e.setEditorState(t, n);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
return () => {};
|
|
557
|
+
},
|
|
558
|
+
name: "@lexical/extension/InitialState",
|
|
559
|
+
nodes: [
|
|
560
|
+
ue,
|
|
561
|
+
pe,
|
|
562
|
+
se,
|
|
563
|
+
fe,
|
|
564
|
+
le
|
|
565
|
+
]
|
|
566
|
+
}), bt = Symbol.for("@lexical/extension/LexicalBuilder");
|
|
567
|
+
function xt() {}
|
|
568
|
+
function St(e) {
|
|
569
|
+
throw e;
|
|
570
|
+
}
|
|
571
|
+
function Ct(e) {
|
|
572
|
+
return Array.isArray(e) ? e : [e];
|
|
573
|
+
}
|
|
574
|
+
var wt = "0.44.0+prod.esm", Tt = class e {
|
|
575
|
+
roots;
|
|
576
|
+
extensionNameMap;
|
|
577
|
+
outgoingConfigEdges;
|
|
578
|
+
incomingEdges;
|
|
579
|
+
conflicts;
|
|
580
|
+
_sortedExtensionReps;
|
|
581
|
+
PACKAGE_VERSION;
|
|
582
|
+
constructor(e) {
|
|
583
|
+
this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = wt, this.roots = e;
|
|
584
|
+
for (let t of e) this.addExtension(t);
|
|
585
|
+
}
|
|
586
|
+
static fromExtensions(t) {
|
|
587
|
+
let n = [Ct(yt)];
|
|
588
|
+
for (let e of t) n.push(Ct(e));
|
|
589
|
+
return new e(n);
|
|
590
|
+
}
|
|
591
|
+
static maybeFromEditor(t) {
|
|
592
|
+
let n = t[bt];
|
|
593
|
+
return n && (n.PACKAGE_VERSION !== wt && K(292, n.PACKAGE_VERSION, wt), n instanceof e || K(293)), n;
|
|
594
|
+
}
|
|
595
|
+
static fromEditor(t) {
|
|
596
|
+
let n = e.maybeFromEditor(t);
|
|
597
|
+
return n === void 0 && K(294), n;
|
|
598
|
+
}
|
|
599
|
+
constructEditor() {
|
|
600
|
+
let { $initialEditorState: e, onError: t, ...n } = this.buildCreateEditorArgs(), r = Object.assign(he({
|
|
601
|
+
...n,
|
|
602
|
+
...t ? { onError: (e) => {
|
|
603
|
+
t(e, r);
|
|
604
|
+
} } : {}
|
|
605
|
+
}), { [bt]: this });
|
|
606
|
+
for (let e of this.sortedExtensionReps()) e.build(r);
|
|
607
|
+
return r;
|
|
608
|
+
}
|
|
609
|
+
buildEditor() {
|
|
610
|
+
let e = xt;
|
|
611
|
+
function t() {
|
|
612
|
+
try {
|
|
613
|
+
e();
|
|
614
|
+
} finally {
|
|
615
|
+
e = xt;
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
let n = Object.assign(this.constructEditor(), {
|
|
619
|
+
dispose: t,
|
|
620
|
+
[Symbol.dispose]: t
|
|
621
|
+
});
|
|
622
|
+
return e = N(this.registerEditor(n), () => n.setRootElement(null)), n;
|
|
623
|
+
}
|
|
624
|
+
hasExtensionByName(e) {
|
|
625
|
+
return this.extensionNameMap.has(e);
|
|
626
|
+
}
|
|
627
|
+
getExtensionRep(e) {
|
|
628
|
+
let t = this.extensionNameMap.get(e.name);
|
|
629
|
+
if (t) return t.extension !== e && K(295, e.name), t;
|
|
630
|
+
}
|
|
631
|
+
addEdge(e, t, n) {
|
|
632
|
+
let r = this.outgoingConfigEdges.get(e);
|
|
633
|
+
r ? r.set(t, n) : this.outgoingConfigEdges.set(e, new Map([[t, n]]));
|
|
634
|
+
let i = this.incomingEdges.get(t);
|
|
635
|
+
i ? i.add(e) : this.incomingEdges.set(t, new Set([e]));
|
|
636
|
+
}
|
|
637
|
+
addExtension(e) {
|
|
638
|
+
this._sortedExtensionReps !== void 0 && K(296);
|
|
639
|
+
let [t] = Ct(e);
|
|
640
|
+
typeof t.name != "string" && K(297, typeof t.name);
|
|
641
|
+
let n = this.extensionNameMap.get(t.name);
|
|
642
|
+
if (n !== void 0 && n.extension !== t && K(298, t.name), !n) {
|
|
643
|
+
n = new gt(this, t), this.extensionNameMap.set(t.name, n);
|
|
644
|
+
let e = this.conflicts.get(t.name);
|
|
645
|
+
typeof e == "string" && K(299, t.name, e);
|
|
646
|
+
for (let e of t.conflictsWith || []) this.extensionNameMap.has(e) && K(299, t.name, e), this.conflicts.set(e, t.name);
|
|
647
|
+
for (let e of t.dependencies || []) {
|
|
648
|
+
let n = Ct(e);
|
|
649
|
+
this.addEdge(t.name, n[0].name, n.slice(1)), this.addExtension(n);
|
|
650
|
+
}
|
|
651
|
+
for (let [e, n] of t.peerDependencies || []) this.addEdge(t.name, e, n ? [n] : []);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
sortedExtensionReps() {
|
|
655
|
+
if (this._sortedExtensionReps) return this._sortedExtensionReps;
|
|
656
|
+
let e = [], t = (n, r) => {
|
|
657
|
+
let i = n.state;
|
|
658
|
+
if (pt(i)) return;
|
|
659
|
+
let a = n.extension.name;
|
|
660
|
+
var o;
|
|
661
|
+
ft(i) || K(300, a, r || "[unknown]"), ft(o = i) || K(304, String(o.id), String(st)), i = Object.assign(o, { id: ct }), n.state = i;
|
|
662
|
+
let s = this.outgoingConfigEdges.get(a);
|
|
663
|
+
if (s) for (let e of s.keys()) {
|
|
664
|
+
let n = this.extensionNameMap.get(e);
|
|
665
|
+
n && t(n, a);
|
|
666
|
+
}
|
|
667
|
+
i = mt(i), n.state = i, e.push(n);
|
|
668
|
+
};
|
|
669
|
+
for (let e of this.extensionNameMap.values()) ft(e.state) && t(e);
|
|
670
|
+
for (let t of e) for (let [e, n] of this.outgoingConfigEdges.get(t.extension.name) || []) if (n.length > 0) {
|
|
671
|
+
let t = this.extensionNameMap.get(e);
|
|
672
|
+
if (t) for (let e of n) t.configs.add(e);
|
|
673
|
+
}
|
|
674
|
+
for (let [e, ...t] of this.roots) if (t.length > 0) {
|
|
675
|
+
let n = this.extensionNameMap.get(e.name);
|
|
676
|
+
n === void 0 && K(301, e.name);
|
|
677
|
+
for (let e of t) n.configs.add(e);
|
|
678
|
+
}
|
|
679
|
+
return this._sortedExtensionReps = e, this._sortedExtensionReps;
|
|
680
|
+
}
|
|
681
|
+
registerEditor(e) {
|
|
682
|
+
let t = this.sortedExtensionReps(), n = new AbortController(), r = [() => n.abort()], i = n.signal;
|
|
683
|
+
for (let n of t) {
|
|
684
|
+
let t = n.register(e, i);
|
|
685
|
+
t && r.push(t);
|
|
686
|
+
}
|
|
687
|
+
for (let n of t) {
|
|
688
|
+
let t = n.afterRegistration(e);
|
|
689
|
+
t && r.push(t);
|
|
690
|
+
}
|
|
691
|
+
return N(...r);
|
|
692
|
+
}
|
|
693
|
+
buildCreateEditorArgs() {
|
|
694
|
+
let e = {}, t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = {}, a = {}, o = this.sortedExtensionReps();
|
|
695
|
+
for (let s of o) {
|
|
696
|
+
let { extension: o } = s;
|
|
697
|
+
if (o.onError !== void 0 && (e.onError = o.onError), o.disableEvents !== void 0 && (e.disableEvents = o.disableEvents), o.parentEditor !== void 0 && (e.parentEditor = o.parentEditor), o.editable !== void 0 && (e.editable = o.editable), o.namespace !== void 0 && (e.namespace = o.namespace), o.$initialEditorState !== void 0 && (e.$initialEditorState = o.$initialEditorState), o.nodes) for (let e of et(o)) {
|
|
698
|
+
if (typeof e != "function") {
|
|
699
|
+
let t = n.get(e.replace);
|
|
700
|
+
t && K(302, o.name, e.replace.name, t.extension.name), n.set(e.replace, s);
|
|
701
|
+
}
|
|
702
|
+
t.add(e);
|
|
703
|
+
}
|
|
704
|
+
if (o.html) {
|
|
705
|
+
if (o.html.export) for (let [e, t] of o.html.export.entries()) r.set(e, t);
|
|
706
|
+
o.html.import && Object.assign(i, o.html.import);
|
|
707
|
+
}
|
|
708
|
+
o.theme && ot(a, o.theme);
|
|
709
|
+
}
|
|
710
|
+
Object.keys(a).length > 0 && (e.theme = a), t.size && (e.nodes = [...t]);
|
|
711
|
+
let s = Object.keys(i).length > 0, c = r.size > 0;
|
|
712
|
+
(s || c) && (e.html = {}, s && (e.html.import = i), c && (e.html.export = r));
|
|
713
|
+
for (let t of o) t.init(e);
|
|
714
|
+
return e.onError ||= St, e;
|
|
715
|
+
}
|
|
716
|
+
};
|
|
717
|
+
function Et(e, t) {
|
|
718
|
+
let n = Tt.maybeFromEditor(e);
|
|
719
|
+
if (!n) return;
|
|
720
|
+
let r = n.extensionNameMap.get(t);
|
|
721
|
+
return r ? r.getExtensionDependency() : void 0;
|
|
722
|
+
}
|
|
723
|
+
var Dt = /* @__PURE__ */ new Set(), Ot = M({
|
|
724
|
+
build(e, t, n) {
|
|
725
|
+
let r = n.getDependency(at).output, i = V({ watchedNodeKeys: /* @__PURE__ */ new Map() }), a = it(() => {}, () => W(() => {
|
|
726
|
+
let e = a.peek(), { watchedNodeKeys: t } = i.value, n, o = !1;
|
|
727
|
+
r.value.read(() => {
|
|
728
|
+
if (d()) for (let [r, i] of t.entries()) {
|
|
729
|
+
if (i.size === 0) {
|
|
730
|
+
t.delete(r);
|
|
731
|
+
continue;
|
|
732
|
+
}
|
|
733
|
+
let a = c(r), s = a && a.isSelected() || !1;
|
|
734
|
+
o ||= s !== (!!e && e.has(r)), s && (n ||= /* @__PURE__ */ new Set(), n.add(r));
|
|
735
|
+
}
|
|
736
|
+
}), !o && n && e && n.size === e.size || (a.value = n);
|
|
737
|
+
}));
|
|
738
|
+
return { watchNodeKey: function(e) {
|
|
739
|
+
let t = Je(() => (a.value || Dt).has(e)), { watchedNodeKeys: n } = i.peek(), r = n.get(e), o = r !== void 0;
|
|
740
|
+
return r ||= /* @__PURE__ */ new Set(), r.add(t), o || (n.set(e, r), i.value = { watchedNodeKeys: n }), t;
|
|
741
|
+
} };
|
|
742
|
+
},
|
|
743
|
+
dependencies: [at],
|
|
744
|
+
name: "@lexical/extension/NodeSelection"
|
|
745
|
+
}), kt = me("INSERT_HORIZONTAL_RULE_COMMAND"), At = class e extends E {
|
|
746
|
+
static getType() {
|
|
747
|
+
return "horizontalrule";
|
|
748
|
+
}
|
|
749
|
+
static clone(t) {
|
|
750
|
+
return new e(t.__key);
|
|
751
|
+
}
|
|
752
|
+
static importJSON(e) {
|
|
753
|
+
return Mt().updateFromJSON(e);
|
|
754
|
+
}
|
|
755
|
+
static importDOM() {
|
|
756
|
+
return { hr: () => ({
|
|
757
|
+
conversion: jt,
|
|
758
|
+
priority: 0
|
|
759
|
+
}) };
|
|
760
|
+
}
|
|
761
|
+
exportDOM() {
|
|
762
|
+
return { element: document.createElement("hr") };
|
|
763
|
+
}
|
|
764
|
+
createDOM(e) {
|
|
765
|
+
let t = document.createElement("hr");
|
|
766
|
+
return j(t, e.theme.hr), t;
|
|
767
|
+
}
|
|
768
|
+
getTextContent() {
|
|
769
|
+
return "\n";
|
|
770
|
+
}
|
|
771
|
+
isInline() {
|
|
772
|
+
return !1;
|
|
773
|
+
}
|
|
774
|
+
updateDOM() {
|
|
775
|
+
return !1;
|
|
776
|
+
}
|
|
777
|
+
};
|
|
778
|
+
function jt() {
|
|
779
|
+
return { node: Mt() };
|
|
780
|
+
}
|
|
781
|
+
function Mt() {
|
|
782
|
+
return t(At);
|
|
783
|
+
}
|
|
784
|
+
function Nt(e) {
|
|
785
|
+
return e instanceof At;
|
|
786
|
+
}
|
|
787
|
+
M({
|
|
788
|
+
dependencies: [at, Ot],
|
|
789
|
+
name: "@lexical/extension/HorizontalRule",
|
|
790
|
+
nodes: () => [At],
|
|
791
|
+
register(e, t, n) {
|
|
792
|
+
let { watchNodeKey: i } = n.getDependency(Ot).output, a = V({ nodeSelections: /* @__PURE__ */ new Map() }), o = e._config.theme.hrSelected ?? "selected";
|
|
793
|
+
return N(e.registerCommand(kt, (e) => {
|
|
794
|
+
let t = d();
|
|
795
|
+
return v(t) ? (t.focus.getNode() !== null && Ee(Mt()), !0) : !1;
|
|
796
|
+
}, re), e.registerCommand(C, (e) => {
|
|
797
|
+
if (ve(e.target)) {
|
|
798
|
+
let t = l(e.target);
|
|
799
|
+
if (Nt(t)) return function(e, t = !1) {
|
|
800
|
+
let n = d(), i = e.isSelected(), a = e.getKey(), o;
|
|
801
|
+
t && ee(n) ? o = n : (o = r(), b(o)), i ? o.delete(a) : o.add(a);
|
|
802
|
+
}(t, e.shiftKey), !0;
|
|
803
|
+
}
|
|
804
|
+
return !1;
|
|
805
|
+
}, T), e.registerMutationListener(At, (t, n) => {
|
|
806
|
+
ze(() => {
|
|
807
|
+
let n = !1, { nodeSelections: r } = a.peek();
|
|
808
|
+
for (let [a, o] of t.entries()) if (o === "destroyed") r.delete(a), n = !0;
|
|
809
|
+
else {
|
|
810
|
+
let t = r.get(a), o = e.getElementByKey(a);
|
|
811
|
+
t ? t.domNode.value = o : (n = !0, r.set(a, {
|
|
812
|
+
domNode: V(o),
|
|
813
|
+
selectedSignal: i(a)
|
|
814
|
+
}));
|
|
815
|
+
}
|
|
816
|
+
n && (a.value = { nodeSelections: r });
|
|
817
|
+
});
|
|
818
|
+
}), W(() => {
|
|
819
|
+
let e = [];
|
|
820
|
+
for (let { domNode: t, selectedSignal: n } of a.value.nodeSelections.values()) e.push(W(() => {
|
|
821
|
+
let e = t.value;
|
|
822
|
+
e && (n.value ? j(e, o) : be(e, o));
|
|
823
|
+
}));
|
|
824
|
+
return N(...e);
|
|
825
|
+
}));
|
|
826
|
+
}
|
|
827
|
+
}), M({
|
|
828
|
+
build: (e, t) => G({ inheritEditableFromParent: t.inheritEditableFromParent }),
|
|
829
|
+
config: P({
|
|
830
|
+
$getParentEditor: function() {
|
|
831
|
+
let e = s();
|
|
832
|
+
return Tt.fromEditor(e), e;
|
|
833
|
+
},
|
|
834
|
+
inheritEditableFromParent: !1
|
|
835
|
+
}),
|
|
836
|
+
init: (e, t, n) => {
|
|
837
|
+
let r = t.$getParentEditor();
|
|
838
|
+
e.parentEditor = r, e.theme = e.theme || r._config.theme;
|
|
839
|
+
},
|
|
840
|
+
name: "@lexical/extension/NestedEditor",
|
|
841
|
+
register: (e, t, n) => W(() => {
|
|
842
|
+
let t = e._parentEditor;
|
|
843
|
+
if (t && n.getOutput().inheritEditableFromParent.value) return e.setEditable(t.isEditable()), t.registerEditableListener(e.setEditable.bind(e));
|
|
844
|
+
})
|
|
845
|
+
}), M({
|
|
846
|
+
build: (e, t, n) => G(t),
|
|
847
|
+
config: P({
|
|
848
|
+
disabled: !1,
|
|
849
|
+
onReposition: void 0
|
|
850
|
+
}),
|
|
851
|
+
name: "@lexical/utils/SelectionAlwaysOnDisplay",
|
|
852
|
+
register: (e, t, n) => {
|
|
853
|
+
let r = n.getOutput();
|
|
854
|
+
return W(() => {
|
|
855
|
+
if (!r.disabled.value) return De(e, r.onReposition.value);
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
});
|
|
859
|
+
function Pt(e) {
|
|
860
|
+
return e.canBeEmpty();
|
|
861
|
+
}
|
|
862
|
+
function Ft(e, t, n = Pt) {
|
|
863
|
+
return N(e.registerCommand(oe, (t) => {
|
|
864
|
+
let n = d();
|
|
865
|
+
if (!v(n)) return !1;
|
|
866
|
+
t.preventDefault();
|
|
867
|
+
let r = function(e) {
|
|
868
|
+
if (e.getNodes().filter((e) => m(e) && e.canIndent()).length > 0) return !0;
|
|
869
|
+
let t = e.anchor, n = e.focus, r = n.isBefore(t) ? n : t, i = we(r.getNode());
|
|
870
|
+
if (i.canIndent()) {
|
|
871
|
+
let e = i.getKey(), t = a();
|
|
872
|
+
if (t.anchor.set(e, 0, "element"), t.focus.set(e, 0, "element"), t = y(t), t.anchor.is(r)) return !0;
|
|
873
|
+
}
|
|
874
|
+
return !1;
|
|
875
|
+
}(n) ? t.shiftKey ? ce : k : A;
|
|
876
|
+
return e.dispatchCommand(r, void 0);
|
|
877
|
+
}, re), e.registerCommand(k, () => {
|
|
878
|
+
let e = typeof t == "number" ? t : t ? t.peek() : null;
|
|
879
|
+
if (!v(d())) return !1;
|
|
880
|
+
let r = typeof n == "function" ? n : n.peek();
|
|
881
|
+
return Te((t) => {
|
|
882
|
+
if (r(t)) {
|
|
883
|
+
let n = t.getIndent() + 1;
|
|
884
|
+
(!e || n < e) && t.setIndent(n);
|
|
885
|
+
}
|
|
886
|
+
});
|
|
887
|
+
}, w));
|
|
888
|
+
}
|
|
889
|
+
M({
|
|
890
|
+
build: (e, t, n) => G(t),
|
|
891
|
+
config: P({
|
|
892
|
+
$canIndent: Pt,
|
|
893
|
+
disabled: !1,
|
|
894
|
+
maxIndent: null
|
|
895
|
+
}),
|
|
896
|
+
name: "@lexical/extension/TabIndentation",
|
|
897
|
+
register(e, t, n) {
|
|
898
|
+
let { disabled: r, maxIndent: i, $canIndent: a } = n.getOutput();
|
|
899
|
+
return W(() => {
|
|
900
|
+
if (!r.value) return Ft(e, i, a);
|
|
901
|
+
});
|
|
902
|
+
}
|
|
903
|
+
});
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region node_modules/@lexical/code-core/LexicalCodeCore.prod.mjs
|
|
906
|
+
function It(e, ...t) {
|
|
907
|
+
let n = new URL("https://lexical.dev/docs/error"), r = new URLSearchParams();
|
|
908
|
+
r.append("code", e);
|
|
909
|
+
for (let e of t) r.append("v", e);
|
|
910
|
+
throw n.search = r.toString(), Error(`Minified Lexical error #${e}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
|
|
911
|
+
}
|
|
912
|
+
function Lt(e, t) {
|
|
913
|
+
let n = e;
|
|
914
|
+
for (let r = f(e, t); r && ($(r.origin) || te(r.origin)); r = r.getAdjacentCaret()) n = r.origin;
|
|
915
|
+
return n;
|
|
916
|
+
}
|
|
917
|
+
function Rt(e) {
|
|
918
|
+
return Lt(e, "previous");
|
|
919
|
+
}
|
|
920
|
+
function zt(e) {
|
|
921
|
+
return Lt(e, "next");
|
|
922
|
+
}
|
|
923
|
+
function Bt(e) {
|
|
924
|
+
let t = Rt(e), n = zt(e), r = t;
|
|
925
|
+
for (; r !== null;) {
|
|
926
|
+
if ($(r)) {
|
|
927
|
+
let e = _e(r.getTextContent());
|
|
928
|
+
if (e !== null) return e;
|
|
929
|
+
}
|
|
930
|
+
if (r === n) break;
|
|
931
|
+
r = r.getNextSibling();
|
|
932
|
+
}
|
|
933
|
+
let i = t.getParent();
|
|
934
|
+
if (g(i)) {
|
|
935
|
+
let e = i.getDirection();
|
|
936
|
+
if (e === "ltr" || e === "rtl") return e;
|
|
937
|
+
}
|
|
938
|
+
return null;
|
|
939
|
+
}
|
|
940
|
+
function Vt(e, t) {
|
|
941
|
+
let n = null, r = null, i = e, a = t, o = e.getTextContent();
|
|
942
|
+
for (;;) {
|
|
943
|
+
if (a === 0) {
|
|
944
|
+
if (i = i.getPreviousSibling(), i === null) break;
|
|
945
|
+
if ($(i) || te(i) || _(i) || It(167), _(i)) {
|
|
946
|
+
n = {
|
|
947
|
+
node: i,
|
|
948
|
+
offset: 1
|
|
949
|
+
};
|
|
950
|
+
break;
|
|
951
|
+
}
|
|
952
|
+
a = Math.max(0, i.getTextContentSize() - 1), o = i.getTextContent();
|
|
953
|
+
} else a--;
|
|
954
|
+
let e = o[a];
|
|
955
|
+
$(i) && e !== " " && (r = {
|
|
956
|
+
node: i,
|
|
957
|
+
offset: a
|
|
958
|
+
});
|
|
959
|
+
}
|
|
960
|
+
if (r !== null) return r;
|
|
961
|
+
let s = null;
|
|
962
|
+
if (t < e.getTextContentSize()) $(e) && (s = e.getTextContent()[t]);
|
|
963
|
+
else {
|
|
964
|
+
let t = e.getNextSibling();
|
|
965
|
+
$(t) && (s = t.getTextContent()[0]);
|
|
966
|
+
}
|
|
967
|
+
if (s !== null && s !== " ") return n;
|
|
968
|
+
{
|
|
969
|
+
let r = function(e, t) {
|
|
970
|
+
let n = e, r = t, i = e.getTextContent(), a = e.getTextContentSize();
|
|
971
|
+
for (;;) {
|
|
972
|
+
if (!$(n) || r === a) {
|
|
973
|
+
if (n = n.getNextSibling(), n === null || _(n)) return null;
|
|
974
|
+
$(n) && (r = 0, i = n.getTextContent(), a = n.getTextContentSize());
|
|
975
|
+
}
|
|
976
|
+
if ($(n)) {
|
|
977
|
+
if (i[r] !== " ") return {
|
|
978
|
+
node: n,
|
|
979
|
+
offset: r
|
|
980
|
+
};
|
|
981
|
+
r++;
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
}(e, t);
|
|
985
|
+
return r === null ? n : r;
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
function Ht(e) {
|
|
989
|
+
let t = zt(e);
|
|
990
|
+
return _(t) && It(168), t;
|
|
991
|
+
}
|
|
992
|
+
var Ut = "javascript";
|
|
993
|
+
function Wt(e, t) {
|
|
994
|
+
for (let n of e.childNodes) {
|
|
995
|
+
if (ye(n) && n.tagName === t) return !0;
|
|
996
|
+
Wt(n, t);
|
|
997
|
+
}
|
|
998
|
+
return !1;
|
|
999
|
+
}
|
|
1000
|
+
var X = "data-language", Z = "data-highlight-language", Gt = "data-theme", Kt = class e extends D {
|
|
1001
|
+
__language;
|
|
1002
|
+
__theme;
|
|
1003
|
+
__isSyntaxHighlightSupported;
|
|
1004
|
+
static getType() {
|
|
1005
|
+
return "code";
|
|
1006
|
+
}
|
|
1007
|
+
static clone(t) {
|
|
1008
|
+
return new e(t.__language, t.__key);
|
|
1009
|
+
}
|
|
1010
|
+
constructor(e, t) {
|
|
1011
|
+
super(t), this.__language = e || void 0, this.__isSyntaxHighlightSupported = !1, this.__theme = void 0;
|
|
1012
|
+
}
|
|
1013
|
+
afterCloneFrom(e) {
|
|
1014
|
+
super.afterCloneFrom(e), this.__language = e.__language, this.__theme = e.__theme, this.__isSyntaxHighlightSupported = e.__isSyntaxHighlightSupported;
|
|
1015
|
+
}
|
|
1016
|
+
createDOM(e) {
|
|
1017
|
+
let t = document.createElement("code");
|
|
1018
|
+
j(t, e.theme.code), t.setAttribute("spellcheck", "false");
|
|
1019
|
+
let n = this.getLanguage();
|
|
1020
|
+
n && (t.setAttribute(X, n), this.getIsSyntaxHighlightSupported() && t.setAttribute(Z, n));
|
|
1021
|
+
let r = this.getTheme();
|
|
1022
|
+
r && t.setAttribute(Gt, r);
|
|
1023
|
+
let i = this.getStyle();
|
|
1024
|
+
return i && xe(t.style, i), t;
|
|
1025
|
+
}
|
|
1026
|
+
updateDOM(e, t, n) {
|
|
1027
|
+
let r = this.__language, i = e.__language;
|
|
1028
|
+
r ? r !== i && t.setAttribute(X, r) : i && t.removeAttribute(X);
|
|
1029
|
+
let a = this.__isSyntaxHighlightSupported;
|
|
1030
|
+
e.__isSyntaxHighlightSupported && i ? a && r ? r !== i && t.setAttribute(Z, r) : t.removeAttribute(Z) : a && r && t.setAttribute(Z, r);
|
|
1031
|
+
let o = this.__theme, s = e.__theme;
|
|
1032
|
+
o ? o !== s && t.setAttribute(Gt, o) : s && t.removeAttribute(Gt);
|
|
1033
|
+
let c = this.__style, l = e.__style;
|
|
1034
|
+
return c !== l && xe(t.style, c, l), !1;
|
|
1035
|
+
}
|
|
1036
|
+
exportDOM(e) {
|
|
1037
|
+
let t = document.createElement("pre");
|
|
1038
|
+
j(t, e._config.theme.code), t.setAttribute("spellcheck", "false");
|
|
1039
|
+
let n = this.getLanguage();
|
|
1040
|
+
n && (t.setAttribute(X, n), this.getIsSyntaxHighlightSupported() && t.setAttribute(Z, n));
|
|
1041
|
+
let r = this.getTheme();
|
|
1042
|
+
r && t.setAttribute(Gt, r);
|
|
1043
|
+
let i = this.getStyle();
|
|
1044
|
+
return i && xe(t.style, i), { element: t };
|
|
1045
|
+
}
|
|
1046
|
+
static importDOM() {
|
|
1047
|
+
return {
|
|
1048
|
+
code: (e) => e.textContent != null && (/\r?\n/.test(e.textContent) || Wt(e, "BR")) ? {
|
|
1049
|
+
conversion: Jt,
|
|
1050
|
+
priority: 1
|
|
1051
|
+
} : null,
|
|
1052
|
+
div: () => ({
|
|
1053
|
+
conversion: Yt,
|
|
1054
|
+
priority: 1
|
|
1055
|
+
}),
|
|
1056
|
+
pre: () => ({
|
|
1057
|
+
conversion: Jt,
|
|
1058
|
+
priority: 0
|
|
1059
|
+
}),
|
|
1060
|
+
table: (e) => $t(e) ? {
|
|
1061
|
+
conversion: Xt,
|
|
1062
|
+
priority: 3
|
|
1063
|
+
} : null,
|
|
1064
|
+
td: (e) => {
|
|
1065
|
+
let t = e, n = t.closest("table");
|
|
1066
|
+
return t.classList.contains("js-file-line") || n && $t(n) ? {
|
|
1067
|
+
conversion: Zt,
|
|
1068
|
+
priority: 3
|
|
1069
|
+
} : null;
|
|
1070
|
+
},
|
|
1071
|
+
tr: (e) => {
|
|
1072
|
+
let t = e.closest("table");
|
|
1073
|
+
return t && $t(t) ? {
|
|
1074
|
+
conversion: Zt,
|
|
1075
|
+
priority: 3
|
|
1076
|
+
} : null;
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
}
|
|
1080
|
+
static importJSON(e) {
|
|
1081
|
+
return Q().updateFromJSON(e);
|
|
1082
|
+
}
|
|
1083
|
+
updateFromJSON(e) {
|
|
1084
|
+
return super.updateFromJSON(e).setLanguage(e.language).setTheme(e.theme);
|
|
1085
|
+
}
|
|
1086
|
+
exportJSON() {
|
|
1087
|
+
return {
|
|
1088
|
+
...super.exportJSON(),
|
|
1089
|
+
language: this.getLanguage(),
|
|
1090
|
+
theme: this.getTheme()
|
|
1091
|
+
};
|
|
1092
|
+
}
|
|
1093
|
+
insertNewAfter(e, t = !0) {
|
|
1094
|
+
if (!Et(s(), "@lexical/code")) {
|
|
1095
|
+
let t = en(e);
|
|
1096
|
+
if (t) return t;
|
|
1097
|
+
}
|
|
1098
|
+
let { anchor: r, focus: i } = e, a = (r.isBefore(i) ? r : i).getNode();
|
|
1099
|
+
if (ne(a)) {
|
|
1100
|
+
let e = Rt(a), t = [];
|
|
1101
|
+
for (;;) if (te(e)) t.push(o()), e = e.getNextSibling();
|
|
1102
|
+
else {
|
|
1103
|
+
if (!$(e)) break;
|
|
1104
|
+
{
|
|
1105
|
+
let n = 0, r = e.getTextContent(), i = e.getTextContentSize();
|
|
1106
|
+
for (; n < i && r[n] === " ";) n++;
|
|
1107
|
+
if (n !== 0 && t.push(rn(" ".repeat(n))), n !== i) break;
|
|
1108
|
+
e = e.getNextSibling();
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
let i = a.splitText(r.offset)[0], s = r.offset === 0 ? 0 : 1, c = i.getIndexWithinParent() + s, l = a.getParentOrThrow(), u = [n(), ...t];
|
|
1112
|
+
l.splice(c, 0, u);
|
|
1113
|
+
let d = t[t.length - 1];
|
|
1114
|
+
d ? d.select() : r.offset === 0 ? i.selectPrevious() : i.getNextSibling().selectNext(0, 0);
|
|
1115
|
+
}
|
|
1116
|
+
if (qt(a)) {
|
|
1117
|
+
let { offset: t } = e.anchor;
|
|
1118
|
+
a.splice(t, 0, [n()]), a.select(t + 1, t + 1);
|
|
1119
|
+
}
|
|
1120
|
+
return null;
|
|
1121
|
+
}
|
|
1122
|
+
canIndent() {
|
|
1123
|
+
return !1;
|
|
1124
|
+
}
|
|
1125
|
+
collapseAtStart() {
|
|
1126
|
+
let e = i();
|
|
1127
|
+
return this.getChildren().forEach((t) => e.append(t)), this.replace(e), !0;
|
|
1128
|
+
}
|
|
1129
|
+
setLanguage(e) {
|
|
1130
|
+
let t = this.getWritable();
|
|
1131
|
+
return t.__language = e || void 0, t;
|
|
1132
|
+
}
|
|
1133
|
+
getLanguage() {
|
|
1134
|
+
return this.getLatest().__language;
|
|
1135
|
+
}
|
|
1136
|
+
setIsSyntaxHighlightSupported(e) {
|
|
1137
|
+
let t = this.getWritable();
|
|
1138
|
+
return t.__isSyntaxHighlightSupported = e, t;
|
|
1139
|
+
}
|
|
1140
|
+
getIsSyntaxHighlightSupported() {
|
|
1141
|
+
return this.getLatest().__isSyntaxHighlightSupported;
|
|
1142
|
+
}
|
|
1143
|
+
setTheme(e) {
|
|
1144
|
+
let t = this.getWritable();
|
|
1145
|
+
return t.__theme = e || void 0, t;
|
|
1146
|
+
}
|
|
1147
|
+
getTheme() {
|
|
1148
|
+
return this.getLatest().__theme;
|
|
1149
|
+
}
|
|
1150
|
+
};
|
|
1151
|
+
function Q(e, n) {
|
|
1152
|
+
return t(Kt).setLanguage(e).setTheme(n);
|
|
1153
|
+
}
|
|
1154
|
+
function qt(e) {
|
|
1155
|
+
return e instanceof Kt;
|
|
1156
|
+
}
|
|
1157
|
+
function Jt(e) {
|
|
1158
|
+
return { node: Q(e.getAttribute(X)) };
|
|
1159
|
+
}
|
|
1160
|
+
function Yt(e) {
|
|
1161
|
+
let t = e, n = Qt(t);
|
|
1162
|
+
return n || function(e) {
|
|
1163
|
+
let t = e.parentElement;
|
|
1164
|
+
for (; t !== null;) {
|
|
1165
|
+
if (Qt(t)) return !0;
|
|
1166
|
+
t = t.parentElement;
|
|
1167
|
+
}
|
|
1168
|
+
return !1;
|
|
1169
|
+
}(t) ? { node: n ? Q() : null } : { node: null };
|
|
1170
|
+
}
|
|
1171
|
+
function Xt() {
|
|
1172
|
+
return { node: Q() };
|
|
1173
|
+
}
|
|
1174
|
+
function Zt() {
|
|
1175
|
+
return { node: null };
|
|
1176
|
+
}
|
|
1177
|
+
function Qt(e) {
|
|
1178
|
+
return e.style.fontFamily.match("monospace") !== null;
|
|
1179
|
+
}
|
|
1180
|
+
function $t(e) {
|
|
1181
|
+
return e.classList.contains("js-file-line-container");
|
|
1182
|
+
}
|
|
1183
|
+
function en(e) {
|
|
1184
|
+
let { anchor: t } = e;
|
|
1185
|
+
if (e.isCollapsed() && t.type === "element") {
|
|
1186
|
+
let e = t.getNode();
|
|
1187
|
+
if (qt(e)) {
|
|
1188
|
+
let n = e.getChildrenSize();
|
|
1189
|
+
if (n >= 2 && t.offset === n) {
|
|
1190
|
+
let t = e.getLastChild();
|
|
1191
|
+
if (_(t) && _(t.getPreviousSibling())) {
|
|
1192
|
+
let t = i();
|
|
1193
|
+
return e.splice(n - 2, 2, []).insertAfter(t, !1), t.select(), t;
|
|
1194
|
+
}
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
return null;
|
|
1199
|
+
}
|
|
1200
|
+
var tn = class e extends pe {
|
|
1201
|
+
__highlightType;
|
|
1202
|
+
constructor(e = "", t, n) {
|
|
1203
|
+
super(e, n), this.__highlightType = t;
|
|
1204
|
+
}
|
|
1205
|
+
static getType() {
|
|
1206
|
+
return "code-highlight";
|
|
1207
|
+
}
|
|
1208
|
+
static clone(t) {
|
|
1209
|
+
return new e(t.__text, t.__highlightType || void 0, t.__key);
|
|
1210
|
+
}
|
|
1211
|
+
afterCloneFrom(e) {
|
|
1212
|
+
super.afterCloneFrom(e), this.__highlightType = e.__highlightType;
|
|
1213
|
+
}
|
|
1214
|
+
getHighlightType() {
|
|
1215
|
+
return this.getLatest().__highlightType;
|
|
1216
|
+
}
|
|
1217
|
+
setHighlightType(e) {
|
|
1218
|
+
let t = this.getWritable();
|
|
1219
|
+
return t.__highlightType = e || void 0, t;
|
|
1220
|
+
}
|
|
1221
|
+
canHaveFormat() {
|
|
1222
|
+
return !1;
|
|
1223
|
+
}
|
|
1224
|
+
createDOM(e) {
|
|
1225
|
+
let t = super.createDOM(e);
|
|
1226
|
+
return j(t, nn(e.theme, this.__highlightType)), t;
|
|
1227
|
+
}
|
|
1228
|
+
updateDOM(e, t, n) {
|
|
1229
|
+
let r = super.updateDOM(e, t, n), i = nn(n.theme, e.__highlightType), a = nn(n.theme, this.__highlightType);
|
|
1230
|
+
return i !== a && (i && be(t, i), a && j(t, a)), r;
|
|
1231
|
+
}
|
|
1232
|
+
static importJSON(e) {
|
|
1233
|
+
return rn().updateFromJSON(e);
|
|
1234
|
+
}
|
|
1235
|
+
updateFromJSON(e) {
|
|
1236
|
+
return super.updateFromJSON(e).setHighlightType(e.highlightType);
|
|
1237
|
+
}
|
|
1238
|
+
exportJSON() {
|
|
1239
|
+
return {
|
|
1240
|
+
...super.exportJSON(),
|
|
1241
|
+
highlightType: this.getHighlightType()
|
|
1242
|
+
};
|
|
1243
|
+
}
|
|
1244
|
+
setFormat(e) {
|
|
1245
|
+
return this;
|
|
1246
|
+
}
|
|
1247
|
+
isParentRequired() {
|
|
1248
|
+
return !0;
|
|
1249
|
+
}
|
|
1250
|
+
createParentElementNode() {
|
|
1251
|
+
return Q();
|
|
1252
|
+
}
|
|
1253
|
+
};
|
|
1254
|
+
function nn(e, t) {
|
|
1255
|
+
return t && e && e.codeHighlight && e.codeHighlight[t];
|
|
1256
|
+
}
|
|
1257
|
+
function rn(t = "", n) {
|
|
1258
|
+
return e(new tn(t, n));
|
|
1259
|
+
}
|
|
1260
|
+
function $(e) {
|
|
1261
|
+
return e instanceof tn;
|
|
1262
|
+
}
|
|
1263
|
+
var an = M({
|
|
1264
|
+
name: "@lexical/code",
|
|
1265
|
+
nodes: () => [Kt, tn],
|
|
1266
|
+
register: (e) => e.registerCommand(ae, (e) => {
|
|
1267
|
+
let t = d();
|
|
1268
|
+
return !(!v(t) || !en(t)) && (e.preventDefault(), !0);
|
|
1269
|
+
}, T)
|
|
1270
|
+
}), on = /* @__PURE__ */ Pe(((e, t) => {
|
|
1271
|
+
var n = function(e) {
|
|
1272
|
+
var t = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, n = 0, r = {}, i = {
|
|
1273
|
+
manual: e.Prism && e.Prism.manual,
|
|
1274
|
+
disableWorkerMessageHandler: e.Prism && e.Prism.disableWorkerMessageHandler,
|
|
1275
|
+
util: {
|
|
1276
|
+
encode: function e(t) {
|
|
1277
|
+
return t instanceof a ? new a(t.type, e(t.content), t.alias) : Array.isArray(t) ? t.map(e) : t.replace(/&/g, "&").replace(/</g, "<").replace(/\u00a0/g, " ");
|
|
1278
|
+
},
|
|
1279
|
+
type: function(e) {
|
|
1280
|
+
return Object.prototype.toString.call(e).slice(8, -1);
|
|
1281
|
+
},
|
|
1282
|
+
objId: function(e) {
|
|
1283
|
+
return e.__id || Object.defineProperty(e, "__id", { value: ++n }), e.__id;
|
|
1284
|
+
},
|
|
1285
|
+
clone: function e(t, n) {
|
|
1286
|
+
n ||= {};
|
|
1287
|
+
var r, a;
|
|
1288
|
+
switch (i.util.type(t)) {
|
|
1289
|
+
case "Object":
|
|
1290
|
+
if (a = i.util.objId(t), n[a]) return n[a];
|
|
1291
|
+
for (var o in r = {}, n[a] = r, t) t.hasOwnProperty(o) && (r[o] = e(t[o], n));
|
|
1292
|
+
return r;
|
|
1293
|
+
case "Array": return a = i.util.objId(t), n[a] ? n[a] : (r = [], n[a] = r, t.forEach(function(t, i) {
|
|
1294
|
+
r[i] = e(t, n);
|
|
1295
|
+
}), r);
|
|
1296
|
+
default: return t;
|
|
1297
|
+
}
|
|
1298
|
+
},
|
|
1299
|
+
getLanguage: function(e) {
|
|
1300
|
+
for (; e;) {
|
|
1301
|
+
var n = t.exec(e.className);
|
|
1302
|
+
if (n) return n[1].toLowerCase();
|
|
1303
|
+
e = e.parentElement;
|
|
1304
|
+
}
|
|
1305
|
+
return "none";
|
|
1306
|
+
},
|
|
1307
|
+
setLanguage: function(e, n) {
|
|
1308
|
+
e.className = e.className.replace(RegExp(t, "gi"), ""), e.classList.add("language-" + n);
|
|
1309
|
+
},
|
|
1310
|
+
currentScript: function() {
|
|
1311
|
+
if (typeof document > "u") return null;
|
|
1312
|
+
if (document.currentScript && document.currentScript.tagName === "SCRIPT") return document.currentScript;
|
|
1313
|
+
try {
|
|
1314
|
+
throw Error();
|
|
1315
|
+
} catch (r) {
|
|
1316
|
+
var e = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(r.stack) || [])[1];
|
|
1317
|
+
if (e) {
|
|
1318
|
+
var t = document.getElementsByTagName("script");
|
|
1319
|
+
for (var n in t) if (t[n].src == e) return t[n];
|
|
1320
|
+
}
|
|
1321
|
+
return null;
|
|
1322
|
+
}
|
|
1323
|
+
},
|
|
1324
|
+
isActive: function(e, t, n) {
|
|
1325
|
+
for (var r = "no-" + t; e;) {
|
|
1326
|
+
var i = e.classList;
|
|
1327
|
+
if (i.contains(t)) return !0;
|
|
1328
|
+
if (i.contains(r)) return !1;
|
|
1329
|
+
e = e.parentElement;
|
|
1330
|
+
}
|
|
1331
|
+
return !!n;
|
|
1332
|
+
}
|
|
1333
|
+
},
|
|
1334
|
+
languages: {
|
|
1335
|
+
plain: r,
|
|
1336
|
+
plaintext: r,
|
|
1337
|
+
text: r,
|
|
1338
|
+
txt: r,
|
|
1339
|
+
extend: function(e, t) {
|
|
1340
|
+
var n = i.util.clone(i.languages[e]);
|
|
1341
|
+
for (var r in t) n[r] = t[r];
|
|
1342
|
+
return n;
|
|
1343
|
+
},
|
|
1344
|
+
insertBefore: function(e, t, n, r) {
|
|
1345
|
+
r ||= i.languages;
|
|
1346
|
+
var a = r[e], o = {};
|
|
1347
|
+
for (var s in a) if (a.hasOwnProperty(s)) {
|
|
1348
|
+
if (s == t) for (var c in n) n.hasOwnProperty(c) && (o[c] = n[c]);
|
|
1349
|
+
n.hasOwnProperty(s) || (o[s] = a[s]);
|
|
1350
|
+
}
|
|
1351
|
+
var l = r[e];
|
|
1352
|
+
return r[e] = o, i.languages.DFS(i.languages, function(t, n) {
|
|
1353
|
+
n === l && t != e && (this[t] = o);
|
|
1354
|
+
}), o;
|
|
1355
|
+
},
|
|
1356
|
+
DFS: function e(t, n, r, a) {
|
|
1357
|
+
a ||= {};
|
|
1358
|
+
var o = i.util.objId;
|
|
1359
|
+
for (var s in t) if (t.hasOwnProperty(s)) {
|
|
1360
|
+
n.call(t, s, t[s], r || s);
|
|
1361
|
+
var c = t[s], l = i.util.type(c);
|
|
1362
|
+
l === "Object" && !a[o(c)] ? (a[o(c)] = !0, e(c, n, null, a)) : l === "Array" && !a[o(c)] && (a[o(c)] = !0, e(c, n, s, a));
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
},
|
|
1366
|
+
plugins: {},
|
|
1367
|
+
highlightAll: function(e, t) {
|
|
1368
|
+
i.highlightAllUnder(document, e, t);
|
|
1369
|
+
},
|
|
1370
|
+
highlightAllUnder: function(e, t, n) {
|
|
1371
|
+
var r = {
|
|
1372
|
+
callback: n,
|
|
1373
|
+
container: e,
|
|
1374
|
+
selector: "code[class*=\"language-\"], [class*=\"language-\"] code, code[class*=\"lang-\"], [class*=\"lang-\"] code"
|
|
1375
|
+
};
|
|
1376
|
+
i.hooks.run("before-highlightall", r), r.elements = Array.prototype.slice.apply(r.container.querySelectorAll(r.selector)), i.hooks.run("before-all-elements-highlight", r);
|
|
1377
|
+
for (var a = 0, o; o = r.elements[a++];) i.highlightElement(o, t === !0, r.callback);
|
|
1378
|
+
},
|
|
1379
|
+
highlightElement: function(t, n, r) {
|
|
1380
|
+
var a = i.util.getLanguage(t), o = i.languages[a];
|
|
1381
|
+
i.util.setLanguage(t, a);
|
|
1382
|
+
var s = t.parentElement;
|
|
1383
|
+
s && s.nodeName.toLowerCase() === "pre" && i.util.setLanguage(s, a);
|
|
1384
|
+
var c = {
|
|
1385
|
+
element: t,
|
|
1386
|
+
language: a,
|
|
1387
|
+
grammar: o,
|
|
1388
|
+
code: t.textContent
|
|
1389
|
+
};
|
|
1390
|
+
function l(e) {
|
|
1391
|
+
c.highlightedCode = e, i.hooks.run("before-insert", c), c.element.innerHTML = c.highlightedCode, i.hooks.run("after-highlight", c), i.hooks.run("complete", c), r && r.call(c.element);
|
|
1392
|
+
}
|
|
1393
|
+
if (i.hooks.run("before-sanity-check", c), s = c.element.parentElement, s && s.nodeName.toLowerCase() === "pre" && !s.hasAttribute("tabindex") && s.setAttribute("tabindex", "0"), !c.code) {
|
|
1394
|
+
i.hooks.run("complete", c), r && r.call(c.element);
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
if (i.hooks.run("before-highlight", c), !c.grammar) {
|
|
1398
|
+
l(i.util.encode(c.code));
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
if (n && e.Worker) {
|
|
1402
|
+
var u = new Worker(i.filename);
|
|
1403
|
+
u.onmessage = function(e) {
|
|
1404
|
+
l(e.data);
|
|
1405
|
+
}, u.postMessage(JSON.stringify({
|
|
1406
|
+
language: c.language,
|
|
1407
|
+
code: c.code,
|
|
1408
|
+
immediateClose: !0
|
|
1409
|
+
}));
|
|
1410
|
+
} else l(i.highlight(c.code, c.grammar, c.language));
|
|
1411
|
+
},
|
|
1412
|
+
highlight: function(e, t, n) {
|
|
1413
|
+
var r = {
|
|
1414
|
+
code: e,
|
|
1415
|
+
grammar: t,
|
|
1416
|
+
language: n
|
|
1417
|
+
};
|
|
1418
|
+
if (i.hooks.run("before-tokenize", r), !r.grammar) throw Error("The language \"" + r.language + "\" has no grammar.");
|
|
1419
|
+
return r.tokens = i.tokenize(r.code, r.grammar), i.hooks.run("after-tokenize", r), a.stringify(i.util.encode(r.tokens), r.language);
|
|
1420
|
+
},
|
|
1421
|
+
tokenize: function(e, t) {
|
|
1422
|
+
var n = t.rest;
|
|
1423
|
+
if (n) {
|
|
1424
|
+
for (var r in n) t[r] = n[r];
|
|
1425
|
+
delete t.rest;
|
|
1426
|
+
}
|
|
1427
|
+
var i = new c();
|
|
1428
|
+
return l(i, i.head, e), s(e, i, t, i.head, 0), d(i);
|
|
1429
|
+
},
|
|
1430
|
+
hooks: {
|
|
1431
|
+
all: {},
|
|
1432
|
+
add: function(e, t) {
|
|
1433
|
+
var n = i.hooks.all;
|
|
1434
|
+
n[e] = n[e] || [], n[e].push(t);
|
|
1435
|
+
},
|
|
1436
|
+
run: function(e, t) {
|
|
1437
|
+
var n = i.hooks.all[e];
|
|
1438
|
+
if (!(!n || !n.length)) for (var r = 0, a; a = n[r++];) a(t);
|
|
1439
|
+
}
|
|
1440
|
+
},
|
|
1441
|
+
Token: a
|
|
1442
|
+
};
|
|
1443
|
+
e.Prism = i, globalThis.Prism = i;
|
|
1444
|
+
function a(e, t, n, r) {
|
|
1445
|
+
this.type = e, this.content = t, this.alias = n, this.length = (r || "").length | 0;
|
|
1446
|
+
}
|
|
1447
|
+
a.stringify = function e(t, n) {
|
|
1448
|
+
if (typeof t == "string") return t;
|
|
1449
|
+
if (Array.isArray(t)) {
|
|
1450
|
+
var r = "";
|
|
1451
|
+
return t.forEach(function(t) {
|
|
1452
|
+
r += e(t, n);
|
|
1453
|
+
}), r;
|
|
1454
|
+
}
|
|
1455
|
+
var a = {
|
|
1456
|
+
type: t.type,
|
|
1457
|
+
content: e(t.content, n),
|
|
1458
|
+
tag: "span",
|
|
1459
|
+
classes: ["token", t.type],
|
|
1460
|
+
attributes: {},
|
|
1461
|
+
language: n
|
|
1462
|
+
}, o = t.alias;
|
|
1463
|
+
o && (Array.isArray(o) ? Array.prototype.push.apply(a.classes, o) : a.classes.push(o)), i.hooks.run("wrap", a);
|
|
1464
|
+
var s = "";
|
|
1465
|
+
for (var c in a.attributes) s += " " + c + "=\"" + (a.attributes[c] || "").replace(/"/g, """) + "\"";
|
|
1466
|
+
return "<" + a.tag + " class=\"" + a.classes.join(" ") + "\"" + s + ">" + a.content + "</" + a.tag + ">";
|
|
1467
|
+
};
|
|
1468
|
+
function o(e, t, n, r) {
|
|
1469
|
+
e.lastIndex = t;
|
|
1470
|
+
var i = e.exec(n);
|
|
1471
|
+
if (i && r && i[1]) {
|
|
1472
|
+
var a = i[1].length;
|
|
1473
|
+
i.index += a, i[0] = i[0].slice(a);
|
|
1474
|
+
}
|
|
1475
|
+
return i;
|
|
1476
|
+
}
|
|
1477
|
+
function s(e, t, n, r, c, d) {
|
|
1478
|
+
for (var f in n) if (!(!n.hasOwnProperty(f) || !n[f])) {
|
|
1479
|
+
var p = n[f];
|
|
1480
|
+
p = Array.isArray(p) ? p : [p];
|
|
1481
|
+
for (var m = 0; m < p.length; ++m) {
|
|
1482
|
+
if (d && d.cause == f + "," + m) return;
|
|
1483
|
+
var h = p[m], g = h.inside, _ = !!h.lookbehind, ee = !!h.greedy, v = h.alias;
|
|
1484
|
+
if (ee && !h.pattern.global) {
|
|
1485
|
+
var te = h.pattern.toString().match(/[imsuy]*$/)[0];
|
|
1486
|
+
h.pattern = RegExp(h.pattern.source, te + "g");
|
|
1487
|
+
}
|
|
1488
|
+
for (var ne = h.pattern || h, y = r.next, b = c; y !== t.tail && !(d && b >= d.reach); b += y.value.length, y = y.next) {
|
|
1489
|
+
var x = y.value;
|
|
1490
|
+
if (t.length > e.length) return;
|
|
1491
|
+
if (!(x instanceof a)) {
|
|
1492
|
+
var S = 1, C;
|
|
1493
|
+
if (ee) {
|
|
1494
|
+
if (C = o(ne, b, e, _), !C || C.index >= e.length) break;
|
|
1495
|
+
var w = C.index, re = C.index + C[0].length, T = b;
|
|
1496
|
+
for (T += y.value.length; w >= T;) y = y.next, T += y.value.length;
|
|
1497
|
+
if (T -= y.value.length, b = T, y.value instanceof a) continue;
|
|
1498
|
+
for (var E = y; E !== t.tail && (T < re || typeof E.value == "string"); E = E.next) S++, T += E.value.length;
|
|
1499
|
+
S--, x = e.slice(b, T), C.index -= b;
|
|
1500
|
+
} else if (C = o(ne, 0, x, _), !C) continue;
|
|
1501
|
+
var w = C.index, D = C[0], O = x.slice(0, w), ie = x.slice(w + D.length), k = b + x.length;
|
|
1502
|
+
d && k > d.reach && (d.reach = k);
|
|
1503
|
+
var A = y.prev;
|
|
1504
|
+
O && (A = l(t, A, O), b += O.length), u(t, A, S);
|
|
1505
|
+
var ae = new a(f, g ? i.tokenize(D, g) : D, v, D);
|
|
1506
|
+
if (y = l(t, A, ae), ie && l(t, y, ie), S > 1) {
|
|
1507
|
+
var oe = {
|
|
1508
|
+
cause: f + "," + m,
|
|
1509
|
+
reach: k
|
|
1510
|
+
};
|
|
1511
|
+
s(e, t, n, y.prev, b, oe), d && oe.reach > d.reach && (d.reach = oe.reach);
|
|
1512
|
+
}
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
function c() {
|
|
1519
|
+
var e = {
|
|
1520
|
+
value: null,
|
|
1521
|
+
prev: null,
|
|
1522
|
+
next: null
|
|
1523
|
+
}, t = {
|
|
1524
|
+
value: null,
|
|
1525
|
+
prev: e,
|
|
1526
|
+
next: null
|
|
1527
|
+
};
|
|
1528
|
+
e.next = t, this.head = e, this.tail = t, this.length = 0;
|
|
1529
|
+
}
|
|
1530
|
+
function l(e, t, n) {
|
|
1531
|
+
var r = t.next, i = {
|
|
1532
|
+
value: n,
|
|
1533
|
+
prev: t,
|
|
1534
|
+
next: r
|
|
1535
|
+
};
|
|
1536
|
+
return t.next = i, r.prev = i, e.length++, i;
|
|
1537
|
+
}
|
|
1538
|
+
function u(e, t, n) {
|
|
1539
|
+
for (var r = t.next, i = 0; i < n && r !== e.tail; i++) r = r.next;
|
|
1540
|
+
t.next = r, r.prev = t, e.length -= i;
|
|
1541
|
+
}
|
|
1542
|
+
function d(e) {
|
|
1543
|
+
for (var t = [], n = e.head.next; n !== e.tail;) t.push(n.value), n = n.next;
|
|
1544
|
+
return t;
|
|
1545
|
+
}
|
|
1546
|
+
if (!e.document) return e.addEventListener && (i.disableWorkerMessageHandler || e.addEventListener("message", function(t) {
|
|
1547
|
+
var n = JSON.parse(t.data), r = n.language, a = n.code, o = n.immediateClose;
|
|
1548
|
+
e.postMessage(i.highlight(a, i.languages[r], r)), o && e.close();
|
|
1549
|
+
}, !1)), i;
|
|
1550
|
+
var f = i.util.currentScript();
|
|
1551
|
+
f && (i.filename = f.src, f.hasAttribute("data-manual") && (i.manual = !0));
|
|
1552
|
+
function p() {
|
|
1553
|
+
i.manual || i.highlightAll();
|
|
1554
|
+
}
|
|
1555
|
+
if (!i.manual) {
|
|
1556
|
+
var m = document.readyState;
|
|
1557
|
+
m === "loading" || m === "interactive" && f && f.defer ? document.addEventListener("DOMContentLoaded", p) : window.requestAnimationFrame ? window.requestAnimationFrame(p) : window.setTimeout(p, 16);
|
|
1558
|
+
}
|
|
1559
|
+
return i;
|
|
1560
|
+
}(typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {});
|
|
1561
|
+
t !== void 0 && t.exports && (t.exports = n), typeof global < "u" && (global.Prism = n), globalThis.Prism.languages.markup = {
|
|
1562
|
+
comment: {
|
|
1563
|
+
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
1564
|
+
greedy: !0
|
|
1565
|
+
},
|
|
1566
|
+
prolog: {
|
|
1567
|
+
pattern: /<\?[\s\S]+?\?>/,
|
|
1568
|
+
greedy: !0
|
|
1569
|
+
},
|
|
1570
|
+
doctype: {
|
|
1571
|
+
pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
|
|
1572
|
+
greedy: !0,
|
|
1573
|
+
inside: {
|
|
1574
|
+
"internal-subset": {
|
|
1575
|
+
pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
|
|
1576
|
+
lookbehind: !0,
|
|
1577
|
+
greedy: !0,
|
|
1578
|
+
inside: null
|
|
1579
|
+
},
|
|
1580
|
+
string: {
|
|
1581
|
+
pattern: /"[^"]*"|'[^']*'/,
|
|
1582
|
+
greedy: !0
|
|
1583
|
+
},
|
|
1584
|
+
punctuation: /^<!|>$|[[\]]/,
|
|
1585
|
+
"doctype-tag": /^DOCTYPE/i,
|
|
1586
|
+
name: /[^\s<>'"]+/
|
|
1587
|
+
}
|
|
1588
|
+
},
|
|
1589
|
+
cdata: {
|
|
1590
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1591
|
+
greedy: !0
|
|
1592
|
+
},
|
|
1593
|
+
tag: {
|
|
1594
|
+
pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
|
|
1595
|
+
greedy: !0,
|
|
1596
|
+
inside: {
|
|
1597
|
+
tag: {
|
|
1598
|
+
pattern: /^<\/?[^\s>\/]+/,
|
|
1599
|
+
inside: {
|
|
1600
|
+
punctuation: /^<\/?/,
|
|
1601
|
+
namespace: /^[^\s>\/:]+:/
|
|
1602
|
+
}
|
|
1603
|
+
},
|
|
1604
|
+
"special-attr": [],
|
|
1605
|
+
"attr-value": {
|
|
1606
|
+
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
|
|
1607
|
+
inside: { punctuation: [{
|
|
1608
|
+
pattern: /^=/,
|
|
1609
|
+
alias: "attr-equals"
|
|
1610
|
+
}, {
|
|
1611
|
+
pattern: /^(\s*)["']|["']$/,
|
|
1612
|
+
lookbehind: !0
|
|
1613
|
+
}] }
|
|
1614
|
+
},
|
|
1615
|
+
punctuation: /\/?>/,
|
|
1616
|
+
"attr-name": {
|
|
1617
|
+
pattern: /[^\s>\/]+/,
|
|
1618
|
+
inside: { namespace: /^[^\s>\/:]+:/ }
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
},
|
|
1622
|
+
entity: [{
|
|
1623
|
+
pattern: /&[\da-z]{1,8};/i,
|
|
1624
|
+
alias: "named-entity"
|
|
1625
|
+
}, /&#x?[\da-f]{1,8};/i]
|
|
1626
|
+
}, globalThis.Prism.languages.markup.tag.inside["attr-value"].inside.entity = globalThis.Prism.languages.markup.entity, globalThis.Prism.languages.markup.doctype.inside["internal-subset"].inside = globalThis.Prism.languages.markup, globalThis.Prism.hooks.add("wrap", function(e) {
|
|
1627
|
+
e.type === "entity" && (e.attributes.title = e.content.replace(/&/, "&"));
|
|
1628
|
+
}), Object.defineProperty(globalThis.Prism.languages.markup.tag, "addInlined", { value: function(e, t) {
|
|
1629
|
+
var n = {};
|
|
1630
|
+
n["language-" + t] = {
|
|
1631
|
+
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1632
|
+
lookbehind: !0,
|
|
1633
|
+
inside: globalThis.Prism.languages[t]
|
|
1634
|
+
}, n.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1635
|
+
var r = { "included-cdata": {
|
|
1636
|
+
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1637
|
+
inside: n
|
|
1638
|
+
} };
|
|
1639
|
+
r["language-" + t] = {
|
|
1640
|
+
pattern: /[\s\S]+/,
|
|
1641
|
+
inside: globalThis.Prism.languages[t]
|
|
1642
|
+
};
|
|
1643
|
+
var i = {};
|
|
1644
|
+
i[e] = {
|
|
1645
|
+
pattern: RegExp("(<__[^>]*>)(?:<!\\[CDATA\\[(?:[^\\]]|\\](?!\\]>))*\\]\\]>|(?!<!\\[CDATA\\[)[\\s\\S])*?(?=<\\/__>)".replace(/__/g, function() {
|
|
1646
|
+
return e;
|
|
1647
|
+
}), "i"),
|
|
1648
|
+
lookbehind: !0,
|
|
1649
|
+
greedy: !0,
|
|
1650
|
+
inside: r
|
|
1651
|
+
}, globalThis.Prism.languages.insertBefore("markup", "cdata", i);
|
|
1652
|
+
} }), Object.defineProperty(globalThis.Prism.languages.markup.tag, "addAttribute", { value: function(e, t) {
|
|
1653
|
+
globalThis.Prism.languages.markup.tag.inside["special-attr"].push({
|
|
1654
|
+
pattern: RegExp("(^|[\"'\\s])(?:" + e + ")\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s'\">=]+(?=[\\s>]))", "i"),
|
|
1655
|
+
lookbehind: !0,
|
|
1656
|
+
inside: {
|
|
1657
|
+
"attr-name": /^[^\s=]+/,
|
|
1658
|
+
"attr-value": {
|
|
1659
|
+
pattern: /=[\s\S]+/,
|
|
1660
|
+
inside: {
|
|
1661
|
+
value: {
|
|
1662
|
+
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1663
|
+
lookbehind: !0,
|
|
1664
|
+
alias: [t, "language-" + t],
|
|
1665
|
+
inside: globalThis.Prism.languages[t]
|
|
1666
|
+
},
|
|
1667
|
+
punctuation: [{
|
|
1668
|
+
pattern: /^=/,
|
|
1669
|
+
alias: "attr-equals"
|
|
1670
|
+
}, /"|'/]
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
});
|
|
1675
|
+
} }), globalThis.Prism.languages.html = globalThis.Prism.languages.markup, globalThis.Prism.languages.mathml = globalThis.Prism.languages.markup, globalThis.Prism.languages.svg = globalThis.Prism.languages.markup, globalThis.Prism.languages.xml = globalThis.Prism.languages.extend("markup", {}), globalThis.Prism.languages.ssml = globalThis.Prism.languages.xml, globalThis.Prism.languages.atom = globalThis.Prism.languages.xml, globalThis.Prism.languages.rss = globalThis.Prism.languages.xml, (function(e) {
|
|
1676
|
+
var t = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1677
|
+
globalThis.Prism.languages.css = {
|
|
1678
|
+
comment: /\/\*[\s\S]*?\*\//,
|
|
1679
|
+
atrule: {
|
|
1680
|
+
pattern: RegExp("@[\\w-](?:[^;{\\s\"']|\\s+(?!\\s)|" + t.source + ")*?(?:;|(?=\\s*\\{))"),
|
|
1681
|
+
inside: {
|
|
1682
|
+
rule: /^@[\w-]+/,
|
|
1683
|
+
"selector-function-argument": {
|
|
1684
|
+
pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
|
|
1685
|
+
lookbehind: !0,
|
|
1686
|
+
alias: "selector"
|
|
1687
|
+
},
|
|
1688
|
+
keyword: {
|
|
1689
|
+
pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
|
|
1690
|
+
lookbehind: !0
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
},
|
|
1694
|
+
url: {
|
|
1695
|
+
pattern: RegExp("\\burl\\((?:" + t.source + "|(?:[^\\\\\\r\\n()\"']|\\\\[\\s\\S])*)\\)", "i"),
|
|
1696
|
+
greedy: !0,
|
|
1697
|
+
inside: {
|
|
1698
|
+
function: /^url/i,
|
|
1699
|
+
punctuation: /^\(|\)$/,
|
|
1700
|
+
string: {
|
|
1701
|
+
pattern: RegExp("^" + t.source + "$"),
|
|
1702
|
+
alias: "url"
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
selector: {
|
|
1707
|
+
pattern: RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|" + t.source + ")*(?=\\s*\\{)"),
|
|
1708
|
+
lookbehind: !0
|
|
1709
|
+
},
|
|
1710
|
+
string: {
|
|
1711
|
+
pattern: t,
|
|
1712
|
+
greedy: !0
|
|
1713
|
+
},
|
|
1714
|
+
property: {
|
|
1715
|
+
pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
|
|
1716
|
+
lookbehind: !0
|
|
1717
|
+
},
|
|
1718
|
+
important: /!important\b/i,
|
|
1719
|
+
function: {
|
|
1720
|
+
pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
|
|
1721
|
+
lookbehind: !0
|
|
1722
|
+
},
|
|
1723
|
+
punctuation: /[(){};:,]/
|
|
1724
|
+
}, globalThis.Prism.languages.css.atrule.inside.rest = globalThis.Prism.languages.css;
|
|
1725
|
+
var n = globalThis.Prism.languages.markup;
|
|
1726
|
+
n && (n.tag.addInlined("style", "css"), n.tag.addAttribute("style", "css"));
|
|
1727
|
+
})(globalThis.Prism), globalThis.Prism.languages.clike = {
|
|
1728
|
+
comment: [{
|
|
1729
|
+
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
|
1730
|
+
lookbehind: !0,
|
|
1731
|
+
greedy: !0
|
|
1732
|
+
}, {
|
|
1733
|
+
pattern: /(^|[^\\:])\/\/.*/,
|
|
1734
|
+
lookbehind: !0,
|
|
1735
|
+
greedy: !0
|
|
1736
|
+
}],
|
|
1737
|
+
string: {
|
|
1738
|
+
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
|
1739
|
+
greedy: !0
|
|
1740
|
+
},
|
|
1741
|
+
"class-name": {
|
|
1742
|
+
pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
|
1743
|
+
lookbehind: !0,
|
|
1744
|
+
inside: { punctuation: /[.\\]/ }
|
|
1745
|
+
},
|
|
1746
|
+
keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
|
1747
|
+
boolean: /\b(?:false|true)\b/,
|
|
1748
|
+
function: /\b\w+(?=\()/,
|
|
1749
|
+
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
|
1750
|
+
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
|
1751
|
+
punctuation: /[{}[\];(),.:]/
|
|
1752
|
+
}, globalThis.Prism.languages.javascript = globalThis.Prism.languages.extend("clike", {
|
|
1753
|
+
"class-name": [globalThis.Prism.languages.clike["class-name"], {
|
|
1754
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
|
|
1755
|
+
lookbehind: !0
|
|
1756
|
+
}],
|
|
1757
|
+
keyword: [{
|
|
1758
|
+
pattern: /((?:^|\})\s*)catch\b/,
|
|
1759
|
+
lookbehind: !0
|
|
1760
|
+
}, {
|
|
1761
|
+
pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
|
|
1762
|
+
lookbehind: !0
|
|
1763
|
+
}],
|
|
1764
|
+
function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
|
|
1765
|
+
number: {
|
|
1766
|
+
pattern: RegExp("(^|[^\\w$])(?:NaN|Infinity|0[bB][01]+(?:_[01]+)*n?|0[oO][0-7]+(?:_[0-7]+)*n?|0[xX][\\dA-Fa-f]+(?:_[\\dA-Fa-f]+)*n?|\\d+(?:_\\d+)*n|(?:\\d+(?:_\\d+)*(?:\\.(?:\\d+(?:_\\d+)*)?)?|\\.\\d+(?:_\\d+)*)(?:[Ee][+-]?\\d+(?:_\\d+)*)?)(?![\\w$])"),
|
|
1767
|
+
lookbehind: !0
|
|
1768
|
+
},
|
|
1769
|
+
operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
|
|
1770
|
+
}), globalThis.Prism.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, globalThis.Prism.languages.insertBefore("javascript", "keyword", {
|
|
1771
|
+
regex: {
|
|
1772
|
+
pattern: RegExp("((?:^|[^$\\w\\xA0-\\uFFFF.\"'\\])\\s]|\\b(?:return|yield))\\s*)\\/(?:(?:\\[(?:[^\\]\\\\\\r\\n]|\\\\.)*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}|(?:\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.|\\[(?:[^[\\]\\\\\\r\\n]|\\\\.)*\\])*\\])*\\]|\\\\.|[^/\\\\\\[\\r\\n])+\\/[dgimyus]{0,7}v[dgimyus]{0,7})(?=(?:\\s|\\/\\*(?:[^*]|\\*(?!\\/))*\\*\\/)*(?:$|[\\r\\n,.;:})\\]]|\\/\\/))"),
|
|
1773
|
+
lookbehind: !0,
|
|
1774
|
+
greedy: !0,
|
|
1775
|
+
inside: {
|
|
1776
|
+
"regex-source": {
|
|
1777
|
+
pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
|
|
1778
|
+
lookbehind: !0,
|
|
1779
|
+
alias: "language-regex",
|
|
1780
|
+
inside: globalThis.Prism.languages.regex
|
|
1781
|
+
},
|
|
1782
|
+
"regex-delimiter": /^\/|\/$/,
|
|
1783
|
+
"regex-flags": /^[a-z]+$/
|
|
1784
|
+
}
|
|
1785
|
+
},
|
|
1786
|
+
"function-variable": {
|
|
1787
|
+
pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
|
1788
|
+
alias: "function"
|
|
1789
|
+
},
|
|
1790
|
+
parameter: [
|
|
1791
|
+
{
|
|
1792
|
+
pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
|
|
1793
|
+
lookbehind: !0,
|
|
1794
|
+
inside: globalThis.Prism.languages.javascript
|
|
1795
|
+
},
|
|
1796
|
+
{
|
|
1797
|
+
pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
|
|
1798
|
+
lookbehind: !0,
|
|
1799
|
+
inside: globalThis.Prism.languages.javascript
|
|
1800
|
+
},
|
|
1801
|
+
{
|
|
1802
|
+
pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
|
|
1803
|
+
lookbehind: !0,
|
|
1804
|
+
inside: globalThis.Prism.languages.javascript
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
|
|
1808
|
+
lookbehind: !0,
|
|
1809
|
+
inside: globalThis.Prism.languages.javascript
|
|
1810
|
+
}
|
|
1811
|
+
],
|
|
1812
|
+
constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
|
|
1813
|
+
}), globalThis.Prism.languages.insertBefore("javascript", "string", {
|
|
1814
|
+
hashbang: {
|
|
1815
|
+
pattern: /^#!.*/,
|
|
1816
|
+
greedy: !0,
|
|
1817
|
+
alias: "comment"
|
|
1818
|
+
},
|
|
1819
|
+
"template-string": {
|
|
1820
|
+
pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
|
|
1821
|
+
greedy: !0,
|
|
1822
|
+
inside: {
|
|
1823
|
+
"template-punctuation": {
|
|
1824
|
+
pattern: /^`|`$/,
|
|
1825
|
+
alias: "string"
|
|
1826
|
+
},
|
|
1827
|
+
interpolation: {
|
|
1828
|
+
pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
|
1829
|
+
lookbehind: !0,
|
|
1830
|
+
inside: {
|
|
1831
|
+
"interpolation-punctuation": {
|
|
1832
|
+
pattern: /^\$\{|\}$/,
|
|
1833
|
+
alias: "punctuation"
|
|
1834
|
+
},
|
|
1835
|
+
rest: globalThis.Prism.languages.javascript
|
|
1836
|
+
}
|
|
1837
|
+
},
|
|
1838
|
+
string: /[\s\S]+/
|
|
1839
|
+
}
|
|
1840
|
+
},
|
|
1841
|
+
"string-property": {
|
|
1842
|
+
pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
|
|
1843
|
+
lookbehind: !0,
|
|
1844
|
+
greedy: !0,
|
|
1845
|
+
alias: "property"
|
|
1846
|
+
}
|
|
1847
|
+
}), globalThis.Prism.languages.insertBefore("javascript", "operator", { "literal-property": {
|
|
1848
|
+
pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
|
|
1849
|
+
lookbehind: !0,
|
|
1850
|
+
alias: "property"
|
|
1851
|
+
} }), globalThis.Prism.languages.markup && (globalThis.Prism.languages.markup.tag.addInlined("script", "javascript"), globalThis.Prism.languages.markup.tag.addAttribute("on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)", "javascript")), globalThis.Prism.languages.js = globalThis.Prism.languages.javascript, (function() {
|
|
1852
|
+
if (n === void 0 || typeof document > "u") return;
|
|
1853
|
+
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1854
|
+
var e = "Loading…", t = function(e, t) {
|
|
1855
|
+
return "✖ Error " + e + " while fetching file: " + t;
|
|
1856
|
+
}, r = "✖ Error: File does not exist or is empty", i = {
|
|
1857
|
+
js: "javascript",
|
|
1858
|
+
py: "python",
|
|
1859
|
+
rb: "ruby",
|
|
1860
|
+
ps1: "powershell",
|
|
1861
|
+
psm1: "powershell",
|
|
1862
|
+
sh: "bash",
|
|
1863
|
+
bat: "batch",
|
|
1864
|
+
h: "c",
|
|
1865
|
+
tex: "latex"
|
|
1866
|
+
}, a = "data-src-status", o = "loading", s = "loaded", c = "failed", l = "pre[data-src]:not([" + a + "=\"" + s + "\"]):not([" + a + "=\"" + o + "\"])";
|
|
1867
|
+
function u(e, n, i) {
|
|
1868
|
+
var a = new XMLHttpRequest();
|
|
1869
|
+
a.open("GET", e, !0), a.onreadystatechange = function() {
|
|
1870
|
+
a.readyState == 4 && (a.status < 400 && a.responseText ? n(a.responseText) : a.status >= 400 ? i(t(a.status, a.statusText)) : i(r));
|
|
1871
|
+
}, a.send(null);
|
|
1872
|
+
}
|
|
1873
|
+
function d(e) {
|
|
1874
|
+
var t = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(e || "");
|
|
1875
|
+
if (t) {
|
|
1876
|
+
var n = Number(t[1]), r = t[2], i = t[3];
|
|
1877
|
+
return r ? i ? [n, Number(i)] : [n, void 0] : [n, n];
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
globalThis.Prism.hooks.add("before-highlightall", function(e) {
|
|
1881
|
+
e.selector += ", " + l;
|
|
1882
|
+
}), globalThis.Prism.hooks.add("before-sanity-check", function(t) {
|
|
1883
|
+
var r = t.element;
|
|
1884
|
+
if (r.matches(l)) {
|
|
1885
|
+
t.code = "", r.setAttribute(a, o);
|
|
1886
|
+
var f = r.appendChild(document.createElement("CODE"));
|
|
1887
|
+
f.textContent = e;
|
|
1888
|
+
var p = r.getAttribute("data-src"), m = t.language;
|
|
1889
|
+
if (m === "none") {
|
|
1890
|
+
var h = (/\.(\w+)$/.exec(p) || [, "none"])[1];
|
|
1891
|
+
m = i[h] || h;
|
|
1892
|
+
}
|
|
1893
|
+
n.util.setLanguage(f, m), n.util.setLanguage(r, m);
|
|
1894
|
+
var g = globalThis.Prism.plugins.autoloader;
|
|
1895
|
+
g && g.loadLanguages(m), u(p, function(e) {
|
|
1896
|
+
r.setAttribute(a, s);
|
|
1897
|
+
var t = d(r.getAttribute("data-range"));
|
|
1898
|
+
if (t) {
|
|
1899
|
+
var i = e.split(/\r\n?|\n/g), o = t[0], c = t[1] == null ? i.length : t[1];
|
|
1900
|
+
o < 0 && (o += i.length), o = Math.max(0, Math.min(o - 1, i.length)), c < 0 && (c += i.length), c = Math.max(0, Math.min(c, i.length)), e = i.slice(o, c).join("\n"), r.hasAttribute("data-start") || r.setAttribute("data-start", String(o + 1));
|
|
1901
|
+
}
|
|
1902
|
+
f.textContent = e, n.highlightElement(f);
|
|
1903
|
+
}, function(e) {
|
|
1904
|
+
r.setAttribute(a, c), f.textContent = e;
|
|
1905
|
+
});
|
|
1906
|
+
}
|
|
1907
|
+
}), globalThis.Prism.plugins.fileHighlight = { highlight: function(e) {
|
|
1908
|
+
for (var t = (e || document).querySelectorAll(l), r = 0, i; i = t[r++];) n.highlightElement(i);
|
|
1909
|
+
} };
|
|
1910
|
+
var f = !1;
|
|
1911
|
+
globalThis.Prism.fileHighlight = function() {
|
|
1912
|
+
f ||= (console.warn("globalThis.Prism.fileHighlight is deprecated. Use `globalThis.Prism.plugins.fileHighlight.highlight` instead."), !0), globalThis.Prism.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1913
|
+
};
|
|
1914
|
+
})();
|
|
1915
|
+
}));
|
|
1916
|
+
//#endregion
|
|
1917
|
+
export { Ut as a, Rt as c, $ as d, an as f, Ie as g, G as h, Bt as i, rn as l, W as m, zt as n, tn as o, Kt as p, Ht as r, Vt as s, on as t, qt as u };
|