md-editor-v3 6.5.5 → 6.5.6

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.
@@ -1,15 +1,15 @@
1
- import { useId as He, provide as x, computed as F, reactive as le, watch as k, onMounted as M, ref as z, inject as C, nextTick as W, shallowRef as ee, onBeforeUnmount as te, toRef as Me, defineComponent as de, createVNode as N, Fragment as Pe, h as Le } from "vue";
2
- import { deepMerge as _e, deepClone as Oe, randomId as ie, debounce as Be } from "@vavt/util";
3
- import { p as h, g as L, f as me, s as fe, a as je, b as Ne } from "./config.mjs";
4
- import { b, R as De, U as Ve, C as ke, B as X, O as xe, E as Q, g as he, F as pe, h as ge, i as ve, H as ye, j as be, e as Ge, k as ue, d as Ue, f as ae, P as ze, T as We } from "./event-bus.mjs";
5
- import { a as O, u as qe, S as Ke, c as Ze, z as Je } from "./dom.mjs";
6
- import Xe from "@vavt/copy2clipboard";
7
- import Ye from "markdown-it";
8
- import Qe from "markdown-it-image-figures";
9
- import et from "markdown-it-sub";
10
- import tt from "markdown-it-sup";
11
- import { a as nt } from "./index5.mjs";
12
- import ot from "medium-zoom";
1
+ import { useId as Me, provide as T, computed as A, reactive as ie, watch as x, onMounted as M, ref as z, inject as $, nextTick as W, shallowRef as te, onBeforeUnmount as ne, toRef as Pe, defineComponent as de, createVNode as j, Fragment as Le, h as _e } from "vue";
2
+ import { deepMerge as Oe, deepClone as Ne, randomId as se, debounce as Be } from "@vavt/util";
3
+ import { p as h, g as L, f as me, s as fe, a as je, b as De } from "./config.mjs";
4
+ import { b, R as Ve, U as Ge, C as Te, B as Y, O as Se, E as ee, g as he, F as pe, h as ge, i as ve, H as ye, j as be, e as Ue, k as ue, d as ze, f as re, P as We, T as qe } from "./event-bus.mjs";
5
+ import { a as O, u as Ke, S as Ze, c as Je, z as Xe } from "./dom.mjs";
6
+ import Ye from "@vavt/copy2clipboard";
7
+ import Qe from "markdown-it";
8
+ import et from "markdown-it-image-figures";
9
+ import tt from "markdown-it-sub";
10
+ import nt from "markdown-it-sup";
11
+ import { a as ot } from "./index5.mjs";
12
+ import at from "medium-zoom";
13
13
  const P = {
14
14
  hljs: `${h}-hljs`,
15
15
  hlcss: `${h}-hlCss`,
@@ -23,68 +23,68 @@ const P = {
23
23
  katexjs: `${h}-katex`,
24
24
  katexcss: `${h}-katexCss`,
25
25
  echarts: `${h}-echarts`
26
- }, se = (e, t) => {
27
- b.emit(e, De, t);
28
- }, en = (e, t, a) => {
29
- const { editorId: n } = a, o = le({
26
+ }, ce = (e, t) => {
27
+ b.emit(e, Ve, t);
28
+ }, tn = (e, t, a) => {
29
+ const { editorId: o } = a, n = ie({
30
30
  // 是否已编译成html
31
31
  buildFinished: !1,
32
32
  // 存储当前最新的html
33
33
  html: ""
34
34
  });
35
- k(
35
+ x(
36
36
  () => e.modelValue,
37
37
  () => {
38
- o.buildFinished = !1;
38
+ n.buildFinished = !1;
39
39
  }
40
40
  ), M(() => {
41
- b.on(n, {
42
- name: X,
43
- callback(u) {
44
- o.buildFinished = !0, o.html = u;
41
+ b.on(o, {
42
+ name: Y,
43
+ callback(d) {
44
+ n.buildFinished = !0, n.html = d;
45
45
  }
46
- }), b.on(n, {
47
- name: xe,
46
+ }), b.on(o, {
47
+ name: Se,
48
48
  callback() {
49
- const u = new Promise((c) => {
50
- if (o.buildFinished)
51
- c(o.html);
49
+ const d = new Promise((s) => {
50
+ if (n.buildFinished)
51
+ s(n.html);
52
52
  else {
53
- const d = (s) => {
54
- c(s), b.remove(n, X, d);
53
+ const c = (u) => {
54
+ s(u), b.remove(o, Y, c);
55
55
  };
56
- b.on(n, {
57
- name: X,
58
- callback: d
56
+ b.on(o, {
57
+ name: Y,
58
+ callback: c
59
59
  });
60
60
  }
61
61
  });
62
- e.onSave ? e.onSave(e.modelValue, u) : t.emit("onSave", e.modelValue, u);
62
+ e.onSave ? e.onSave(e.modelValue, d) : t.emit("onSave", e.modelValue, d);
63
63
  }
64
64
  });
65
65
  });
66
- }, Te = (e, {
66
+ }, Ie = (e, {
67
67
  editorId: t,
68
68
  rootRef: a,
69
- setting: n
69
+ setting: o
70
70
  }) => {
71
- const o = L.editorExtensions.highlight, u = L.editorExtensionsAttrs.highlight;
72
- x("editorId", t), x("rootRef", a), x(
71
+ const n = L.editorExtensions.highlight, d = L.editorExtensionsAttrs.highlight;
72
+ T("editorId", t), T("rootRef", a), T(
73
73
  "theme",
74
- F(() => e.theme)
75
- ), x(
74
+ A(() => e.theme)
75
+ ), T(
76
76
  "language",
77
- F(() => e.language)
78
- ), x(
77
+ A(() => e.language)
78
+ ), T(
79
79
  "highlight",
80
- F(() => {
81
- const { js: d } = o, s = {
80
+ A(() => {
81
+ const { js: c } = n, u = {
82
82
  ...me,
83
- ...o.css
84
- }, { js: l, css: i = {} } = u || {}, r = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, m = s[e.codeTheme] ? s[e.codeTheme][r] : me.atom[r], f = s[e.codeTheme] && i[e.codeTheme] ? i[e.codeTheme][r] : i.atom ? i.atom[r] : {};
83
+ ...n.css
84
+ }, { js: l, css: i = {} } = d || {}, r = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, m = u[e.codeTheme] ? u[e.codeTheme][r] : me.atom[r], f = u[e.codeTheme] && i[e.codeTheme] ? i[e.codeTheme][r] : i.atom ? i.atom[r] : {};
85
85
  return {
86
86
  js: {
87
- src: d,
87
+ src: c,
88
88
  ...l
89
89
  },
90
90
  css: {
@@ -93,28 +93,28 @@ const P = {
93
93
  }
94
94
  };
95
95
  })
96
- ), x("showCodeRowNumber", e.showCodeRowNumber);
97
- const c = F(() => {
98
- const d = {
96
+ ), T("showCodeRowNumber", e.showCodeRowNumber);
97
+ const s = A(() => {
98
+ const c = {
99
99
  ...fe,
100
100
  ...L.editorConfig.languageUserDefined
101
101
  };
102
- return _e(
103
- Oe(fe["en-US"]),
104
- d[e.language] || {}
102
+ return Oe(
103
+ Ne(fe["en-US"]),
104
+ c[e.language] || {}
105
105
  );
106
106
  });
107
- return x("usedLanguageText", c), x(
107
+ return T("usedLanguageText", s), T(
108
108
  "previewTheme",
109
- F(() => e.previewTheme)
110
- ), x(
109
+ A(() => e.previewTheme)
110
+ ), T(
111
111
  "customIcon",
112
- F(() => e.customIcon)
113
- ), x(
112
+ A(() => e.customIcon)
113
+ ), T(
114
114
  "setting",
115
- F(() => n ? {
115
+ A(() => o ? {
116
116
  // setting是reactive,不转化是可以直接赋值的
117
- ...n
117
+ ...o
118
118
  } : {
119
119
  preview: !0,
120
120
  htmlPreview: !1,
@@ -123,105 +123,105 @@ const P = {
123
123
  fullscreen: !1
124
124
  })
125
125
  ), { editorId: t };
126
- }, tn = (e, t) => (x("tabWidth", e.tabWidth), x(
126
+ }, nn = (e, t) => (T("tabWidth", e.tabWidth), T(
127
127
  "disabled",
128
- F(() => e.disabled)
129
- ), x(
128
+ A(() => e.disabled)
129
+ ), T(
130
130
  "contentDisabled",
131
- F(() => e.disabled || e.readOnly)
132
- ), x(
131
+ A(() => e.disabled || e.readOnly)
132
+ ), T(
133
133
  "showToolbarName",
134
- F(() => e.showToolbarName)
135
- ), x("noUploadImg", e.noUploadImg), x(
134
+ A(() => e.showToolbarName)
135
+ ), T("noUploadImg", e.noUploadImg), T(
136
136
  "tableShape",
137
- F(() => e.tableShape)
138
- ), x("noPrettier", e.noPrettier), x(
137
+ A(() => e.tableShape)
138
+ ), T("noPrettier", e.noPrettier), T(
139
139
  "codeTheme",
140
- F(() => e.codeTheme)
141
- ), x("updateSetting", t.updateSetting), x(
140
+ A(() => e.codeTheme)
141
+ ), T("updateSetting", t.updateSetting), T(
142
142
  "catalogVisible",
143
- F(() => t.catalogVisible.value)
144
- ), x("defToolbars", t.defToolbars), x(
143
+ A(() => t.catalogVisible.value)
144
+ ), T("defToolbars", t.defToolbars), T(
145
145
  "floatingToolbars",
146
- F(() => e.floatingToolbars)
147
- ), Te(e, t)), nn = (e) => {
148
- const { noPrettier: t, noUploadImg: a } = e, { editorExtensions: n, editorExtensionsAttrs: o } = L, u = t || n.prettier.prettierInstance, c = t || n.prettier.parserMarkdownInstance, d = a || n.cropper.instance;
146
+ A(() => e.floatingToolbars)
147
+ ), Ie(e, t)), on = (e) => {
148
+ const { noPrettier: t, noUploadImg: a } = e, { editorExtensions: o, editorExtensionsAttrs: n } = L, d = t || o.prettier.prettierInstance, s = t || o.prettier.parserMarkdownInstance, c = a || o.cropper.instance;
149
149
  M(() => {
150
- if (!d) {
151
- const { js: s = {}, css: l = {} } = o.cropper || {};
150
+ if (!c) {
151
+ const { js: u = {}, css: l = {} } = n.cropper || {};
152
152
  O("link", {
153
153
  ...l,
154
154
  rel: "stylesheet",
155
- href: n.cropper.css,
155
+ href: o.cropper.css,
156
156
  id: P.croppercss
157
157
  }), O("script", {
158
- ...s,
159
- src: n.cropper.js,
158
+ ...u,
159
+ src: o.cropper.js,
160
160
  id: P.cropperjs
161
161
  });
162
162
  }
163
- if (!u) {
164
- const { standaloneJs: s = {} } = o.prettier || {};
163
+ if (!d) {
164
+ const { standaloneJs: u = {} } = n.prettier || {};
165
165
  O("script", {
166
- ...s,
167
- src: n.prettier.standaloneJs,
166
+ ...u,
167
+ src: o.prettier.standaloneJs,
168
168
  id: P.prettier
169
169
  });
170
170
  }
171
- if (!c) {
172
- const { parserMarkdownJs: s = {} } = o.prettier || {};
171
+ if (!s) {
172
+ const { parserMarkdownJs: u = {} } = n.prettier || {};
173
173
  O("script", {
174
- ...s,
175
- src: n.prettier.parserMarkdownJs,
174
+ ...u,
175
+ src: o.prettier.parserMarkdownJs,
176
176
  id: P.prettierMD
177
177
  });
178
178
  }
179
179
  });
180
- }, on = (e, t, a) => {
181
- const { editorId: n } = a;
180
+ }, an = (e, t, a) => {
181
+ const { editorId: o } = a;
182
182
  M(() => {
183
- b.on(n, {
184
- name: Q,
185
- callback: (o) => {
186
- e.onError?.(o), t.emit("onError", o);
183
+ b.on(o, {
184
+ name: ee,
185
+ callback: (n) => {
186
+ e.onError?.(n), t.emit("onError", n);
187
187
  }
188
188
  });
189
189
  });
190
- }, an = (e, t, a) => {
191
- const { editorId: n } = a, o = le({
190
+ }, rn = (e, t, a) => {
191
+ const { editorId: o } = a, n = ie({
192
192
  pageFullscreen: e.pageFullscreen,
193
193
  fullscreen: !1,
194
194
  preview: e.preview,
195
195
  htmlPreview: e.preview ? !1 : e.htmlPreview,
196
196
  previewOnly: !1
197
- }), u = le({ ...o }), c = (l, i) => {
198
- const r = i === void 0 ? !o[l] : i;
197
+ }), d = ie({ ...n }), s = (l, i) => {
198
+ const r = i === void 0 ? !n[l] : i;
199
199
  switch (l) {
200
200
  case "preview": {
201
- o.htmlPreview = !1, o.previewOnly = !1;
201
+ n.htmlPreview = !1, n.previewOnly = !1;
202
202
  break;
203
203
  }
204
204
  case "htmlPreview": {
205
- o.preview = !1, o.previewOnly = !1;
205
+ n.preview = !1, n.previewOnly = !1;
206
206
  break;
207
207
  }
208
208
  case "previewOnly": {
209
- r ? !o.preview && !o.htmlPreview && (o.preview = !0) : (u.preview || (o.preview = !1), u.htmlPreview || (o.htmlPreview = !1));
209
+ r ? !n.preview && !n.htmlPreview && (n.preview = !0) : (d.preview || (n.preview = !1), d.htmlPreview || (n.htmlPreview = !1));
210
210
  break;
211
211
  }
212
212
  }
213
- u[l] = r, o[l] = r;
213
+ d[l] = r, n[l] = r;
214
214
  };
215
- let d = "";
216
- const s = () => {
217
- o.pageFullscreen || o.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = d;
215
+ let c = "";
216
+ const u = () => {
217
+ n.pageFullscreen || n.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = c;
218
218
  };
219
- return k(() => [o.pageFullscreen, o.fullscreen], s), M(() => {
220
- b.on(n, {
221
- name: Ve,
219
+ return x(() => [n.pageFullscreen, n.fullscreen], u), M(() => {
220
+ b.on(o, {
221
+ name: Ge,
222
222
  callback(l, i) {
223
223
  const r = (m) => {
224
- se(n, {
224
+ ce(o, {
225
225
  direct: "image",
226
226
  params: {
227
227
  desc: "",
@@ -231,53 +231,53 @@ const P = {
231
231
  };
232
232
  e.onUploadImg ? e.onUploadImg(l, r) : t.emit("onUploadImg", l, r);
233
233
  }
234
- }), d = document.body.style.overflow, s();
235
- }), [o, c];
236
- }, rn = (e, t) => {
237
- const { editorId: a } = t, n = z(!1);
234
+ }), c = document.body.style.overflow, u();
235
+ }), [n, s];
236
+ }, ln = (e, t) => {
237
+ const { editorId: a } = t, o = z(!1);
238
238
  return M(() => {
239
239
  b.on(a, {
240
- name: ke,
241
- callback: (o) => {
242
- o === void 0 ? n.value = !n.value : n.value = o;
240
+ name: Te,
241
+ callback: (n) => {
242
+ n === void 0 ? o.value = !o.value : o.value = n;
243
243
  }
244
244
  });
245
- }), n;
246
- }, ln = (e, t, a) => {
247
- const { editorId: n, catalogVisible: o, setting: u, updateSetting: c, codeRef: d } = a;
248
- k(
249
- () => u.pageFullscreen,
245
+ }), o;
246
+ }, sn = (e, t, a) => {
247
+ const { editorId: o, catalogVisible: n, setting: d, updateSetting: s, codeRef: c } = a;
248
+ x(
249
+ () => d.pageFullscreen,
250
250
  (l) => {
251
- b.emit(n, he, l);
251
+ b.emit(o, he, l);
252
252
  }
253
- ), k(
254
- () => u.fullscreen,
253
+ ), x(
254
+ () => d.fullscreen,
255
255
  (l) => {
256
- b.emit(n, pe, l);
256
+ b.emit(o, pe, l);
257
257
  }
258
- ), k(
259
- () => u.preview,
258
+ ), x(
259
+ () => d.preview,
260
260
  (l) => {
261
- b.emit(n, ge, l);
261
+ b.emit(o, ge, l);
262
262
  }
263
- ), k(
264
- () => u.previewOnly,
263
+ ), x(
264
+ () => d.previewOnly,
265
265
  (l) => {
266
- b.emit(n, ve, l);
266
+ b.emit(o, ve, l);
267
267
  }
268
- ), k(
269
- () => u.htmlPreview,
268
+ ), x(
269
+ () => d.htmlPreview,
270
270
  (l) => {
271
- b.emit(n, ye, l);
271
+ b.emit(o, ye, l);
272
272
  }
273
- ), k(o, (l) => {
274
- b.emit(n, be, l);
273
+ ), x(n, (l) => {
274
+ b.emit(o, be, l);
275
275
  });
276
- const s = {
276
+ const u = {
277
277
  on(l, i) {
278
278
  switch (l) {
279
279
  case "pageFullscreen": {
280
- b.on(n, {
280
+ b.on(o, {
281
281
  name: he,
282
282
  callback(r) {
283
283
  i(r);
@@ -286,7 +286,7 @@ const P = {
286
286
  break;
287
287
  }
288
288
  case "fullscreen": {
289
- b.on(n, {
289
+ b.on(o, {
290
290
  name: pe,
291
291
  callback(r) {
292
292
  i(r);
@@ -295,7 +295,7 @@ const P = {
295
295
  break;
296
296
  }
297
297
  case "preview": {
298
- b.on(n, {
298
+ b.on(o, {
299
299
  name: ge,
300
300
  callback(r) {
301
301
  i(r);
@@ -304,7 +304,7 @@ const P = {
304
304
  break;
305
305
  }
306
306
  case "previewOnly": {
307
- b.on(n, {
307
+ b.on(o, {
308
308
  name: ve,
309
309
  callback(r) {
310
310
  i(r);
@@ -313,7 +313,7 @@ const P = {
313
313
  break;
314
314
  }
315
315
  case "htmlPreview": {
316
- b.on(n, {
316
+ b.on(o, {
317
317
  name: ye,
318
318
  callback(r) {
319
319
  i(r);
@@ -322,7 +322,7 @@ const P = {
322
322
  break;
323
323
  }
324
324
  case "catalog": {
325
- b.on(n, {
325
+ b.on(o, {
326
326
  name: be,
327
327
  callback(r) {
328
328
  i(r);
@@ -333,108 +333,108 @@ const P = {
333
333
  }
334
334
  },
335
335
  togglePageFullscreen(l) {
336
- c("pageFullscreen", l);
336
+ s("pageFullscreen", l);
337
337
  },
338
338
  toggleFullscreen(l) {
339
- b.emit(n, Ue, l);
339
+ b.emit(o, ze, l);
340
340
  },
341
341
  togglePreview(l) {
342
- c("preview", l);
342
+ s("preview", l);
343
343
  },
344
344
  togglePreviewOnly(l) {
345
- c("previewOnly", l);
345
+ s("previewOnly", l);
346
346
  },
347
347
  toggleHtmlPreview(l) {
348
- c("htmlPreview", l);
348
+ s("htmlPreview", l);
349
349
  },
350
350
  toggleCatalog(l) {
351
- b.emit(n, ke, l);
351
+ b.emit(o, Te, l);
352
352
  },
353
353
  triggerSave() {
354
- b.emit(n, xe);
354
+ b.emit(o, Se);
355
355
  },
356
356
  insert(l) {
357
- se(n, {
357
+ ce(o, {
358
358
  direct: "universal",
359
359
  params: { generate: l },
360
360
  source: "programmatic"
361
361
  });
362
362
  },
363
363
  focus(l) {
364
- d.value?.focus(l);
364
+ c.value?.focus(l);
365
365
  },
366
366
  rerender() {
367
- b.emit(n, ue);
367
+ b.emit(o, ue);
368
368
  },
369
369
  getSelectedText() {
370
- return d.value?.getSelectedText();
370
+ return c.value?.getSelectedText();
371
371
  },
372
372
  resetHistory() {
373
- d.value?.resetHistory();
373
+ c.value?.resetHistory();
374
374
  },
375
375
  domEventHandlers(l) {
376
- b.emit(n, Ge, l);
376
+ b.emit(o, Ue, l);
377
377
  },
378
378
  execCommand(l) {
379
- se(n, { direct: l, source: "programmatic" });
379
+ ce(o, { direct: l, source: "programmatic" });
380
380
  },
381
381
  getEditorView() {
382
- return d.value?.getEditorView();
382
+ return c.value?.getEditorView();
383
383
  }
384
384
  };
385
- t.expose(s);
386
- }, at = (e) => {
387
- const t = He();
385
+ t.expose(u);
386
+ }, rt = (e) => {
387
+ const t = Me();
388
388
  return e.id || e.editorId || `${h}-${t}`;
389
- }, rt = (e, t, a) => {
390
- const n = C("editorId"), o = C("rootRef"), u = C("usedLanguageText"), c = C("setting"), d = () => {
391
- o.value.querySelectorAll(`#${n} .${h}-preview .${h}-code`).forEach((i) => {
389
+ }, lt = (e, t, a) => {
390
+ const o = $("editorId"), n = $("rootRef"), d = $("usedLanguageText"), s = $("setting"), c = () => {
391
+ n.value.querySelectorAll(`#${o} .${h}-preview .${h}-code`).forEach((i) => {
392
392
  let r = -1;
393
393
  const m = i.querySelector(
394
394
  `.${h}-copy-button:not([data-processed])`
395
395
  );
396
396
  m && (m.onclick = (f) => {
397
397
  f.preventDefault(), clearTimeout(r);
398
- const g = (i.querySelector("input:checked + pre code") || i.querySelector("pre code")).textContent, { text: v, successTips: E, failTips: y } = u.value.copyCode;
399
- let $ = E;
400
- Xe(e.formatCopiedText(g || "")).catch(() => {
401
- $ = y;
398
+ const g = (i.querySelector("input:checked + pre code") || i.querySelector("pre code")).textContent, { text: v, successTips: E, failTips: y } = d.value.copyCode;
399
+ let w = E;
400
+ Ye(e.formatCopiedText(g || "")).catch(() => {
401
+ w = y;
402
402
  }).finally(() => {
403
- m.dataset.isIcon ? m.dataset.tips = $ : m.textContent = $, r = window.setTimeout(() => {
403
+ m.dataset.isIcon ? m.dataset.tips = w : m.textContent = w, r = window.setTimeout(() => {
404
404
  m.dataset.isIcon ? m.dataset.tips = v : m.textContent = v;
405
405
  }, 1500);
406
406
  });
407
407
  }, m.setAttribute("data-processed", "true"));
408
408
  });
409
- }, s = () => {
410
- W(d);
409
+ }, u = () => {
410
+ W(c);
411
411
  }, l = (i) => {
412
- i && W(d);
412
+ i && W(c);
413
413
  };
414
- k([t, a], s), k(() => c.value.preview, l), k(() => c.value.htmlPreview, l), M(d);
415
- }, lt = (e) => {
416
- const t = C("editorId"), a = C("theme"), n = C("rootRef"), { editorExtensions: o, editorExtensionsAttrs: u, echartsConfig: c } = L;
417
- let d = o.echarts.instance;
418
- const s = ee(-1), l = () => {
419
- !e.noEcharts && d && (s.value = s.value + 1);
414
+ x([t, a], u), x(() => s.value.preview, l), x(() => s.value.htmlPreview, l), M(c);
415
+ }, it = (e) => {
416
+ const t = $("editorId"), a = $("theme"), o = $("rootRef"), { editorExtensions: n, editorExtensionsAttrs: d, echartsConfig: s } = L;
417
+ let c = n.echarts.instance;
418
+ const u = te(-1), l = () => {
419
+ !e.noEcharts && c && (u.value = u.value + 1);
420
420
  };
421
- k(
421
+ x(
422
422
  () => a.value,
423
423
  () => {
424
424
  l();
425
425
  }
426
426
  ), M(() => {
427
- if (e.noEcharts || d)
427
+ if (e.noEcharts || c)
428
428
  return;
429
- const g = o.echarts.js;
429
+ const g = n.echarts.js;
430
430
  O(
431
431
  "script",
432
432
  {
433
- ...u.echarts?.js,
433
+ ...d.echarts?.js,
434
434
  src: g,
435
435
  id: P.echarts,
436
436
  onload() {
437
- d = window.echarts, l();
437
+ c = window.echarts, l();
438
438
  }
439
439
  },
440
440
  "echarts"
@@ -443,25 +443,25 @@ const P = {
443
443
  let i = [], r = [], m = [];
444
444
  const f = (g = !1) => {
445
445
  if (!i.length) {
446
- g && (r.forEach(($) => {
447
- $.dispose?.();
448
- }), m.forEach(($) => {
449
- $.disconnect?.();
446
+ g && (r.forEach((w) => {
447
+ w.dispose?.();
448
+ }), m.forEach((w) => {
449
+ w.disconnect?.();
450
450
  }), r = [], m = []);
451
451
  return;
452
452
  }
453
453
  const v = [], E = [], y = [];
454
- i.forEach(($, T) => {
455
- const w = r[T], I = m[T];
456
- if (g || !$ || !$.isConnected || (n?.value ? !n.value.contains($) : !1)) {
457
- w?.dispose?.(), I?.disconnect?.();
454
+ i.forEach((w, S) => {
455
+ const C = r[S], k = m[S];
456
+ if (g || !w || !w.isConnected || (o?.value ? !o.value.contains(w) : !1)) {
457
+ C?.dispose?.(), k?.disconnect?.();
458
458
  return;
459
459
  }
460
- v.push($), w && E.push(w), I && y.push(I);
460
+ v.push(w), C && E.push(C), k && y.push(k);
461
461
  }), i = v, r = E, m = y;
462
462
  }, p = () => {
463
- if (f(), !e.noEcharts && d) {
464
- const g = n.value;
463
+ if (f(), !e.noEcharts && c) {
464
+ const g = o.value;
465
465
  if (!g) return;
466
466
  Array.from(
467
467
  g.querySelectorAll(
@@ -471,17 +471,17 @@ const P = {
471
471
  if (E.dataset.closed === "false")
472
472
  return !1;
473
473
  try {
474
- const y = o.echarts.parseOption(E.innerText, {
474
+ const y = n.echarts.parseOption(E.innerText, {
475
475
  editorId: t,
476
476
  element: E
477
- }), $ = c(y), T = d.init(E, a.value);
478
- T.setOption($), E.setAttribute("data-processed", ""), i.push(E), r.push(T);
479
- const w = new ResizeObserver(() => {
480
- T.resize();
477
+ }), w = s(y), S = c.init(E, a.value);
478
+ S.setOption(w), E.setAttribute("data-processed", ""), i.push(E), r.push(S);
479
+ const C = new ResizeObserver(() => {
480
+ S.resize();
481
481
  });
482
- w.observe(E), m.push(w);
482
+ C.observe(E), m.push(C);
483
483
  } catch (y) {
484
- b.emit(t, Q, {
484
+ b.emit(t, ee, {
485
485
  name: "echarts",
486
486
  message: y?.message,
487
487
  error: y
@@ -490,11 +490,11 @@ const P = {
490
490
  });
491
491
  }
492
492
  };
493
- return te(() => {
493
+ return ne(() => {
494
494
  f(!0);
495
- }), { reRenderEcharts: s, replaceEcharts: p };
496
- }, it = (e) => {
497
- const t = C("highlight"), a = ee(L.editorExtensions.highlight.instance);
495
+ }), { reRenderEcharts: u, replaceEcharts: p };
496
+ }, st = (e) => {
497
+ const t = $("highlight"), a = te(L.editorExtensions.highlight.instance);
498
498
  return M(() => {
499
499
  e.noHighlight || a.value || (O("link", {
500
500
  ...t.value.css,
@@ -511,26 +511,26 @@ const P = {
511
511
  },
512
512
  "hljs"
513
513
  ));
514
- }), k(
514
+ }), x(
515
515
  () => t.value.css,
516
516
  () => {
517
- e.noHighlight || L.editorExtensions.highlight.instance || qe("link", {
517
+ e.noHighlight || L.editorExtensions.highlight.instance || Ke("link", {
518
518
  ...t.value.css,
519
519
  rel: "stylesheet",
520
520
  id: P.hlcss
521
521
  });
522
522
  }
523
523
  ), a;
524
- }, st = (e) => {
525
- const t = ee(L.editorExtensions.katex.instance);
524
+ }, ct = (e) => {
525
+ const t = te(L.editorExtensions.katex.instance);
526
526
  return M(() => {
527
527
  if (e.noKatex || t.value)
528
528
  return;
529
- const { editorExtensions: a, editorExtensionsAttrs: n } = L;
529
+ const { editorExtensions: a, editorExtensionsAttrs: o } = L;
530
530
  O(
531
531
  "script",
532
532
  {
533
- ...n.katex?.js,
533
+ ...o.katex?.js,
534
534
  src: a.katex.js,
535
535
  id: P.katexjs,
536
536
  onload() {
@@ -539,14 +539,14 @@ const P = {
539
539
  },
540
540
  "katex"
541
541
  ), O("link", {
542
- ...n.katex?.css,
542
+ ...o.katex?.css,
543
543
  rel: "stylesheet",
544
544
  href: a.katex.css,
545
545
  id: P.katexcss
546
546
  });
547
547
  }), t;
548
548
  };
549
- class ct {
549
+ class dt {
550
550
  constructor(t) {
551
551
  this.options = t;
552
552
  }
@@ -556,8 +556,8 @@ class ct {
556
556
  return t.expiresAt <= Date.now();
557
557
  }
558
558
  deleteExpired(t, a) {
559
- const n = a ?? this.cache.get(t);
560
- return !n || !this.isExpired(n) ? !1 : (this.cache.delete(t), !0);
559
+ const o = a ?? this.cache.get(t);
560
+ return !o || !this.isExpired(o) ? !1 : (this.cache.delete(t), !0);
561
561
  }
562
562
  trim() {
563
563
  for (const [t, a] of this.cache)
@@ -585,15 +585,15 @@ class ct {
585
585
  this.cache.clear();
586
586
  }
587
587
  }
588
- const Y = new ct({
588
+ const Q = new dt({
589
589
  max: 1e3,
590
590
  // 缓存10分钟
591
591
  ttl: 6e5
592
- }), dt = (e) => {
593
- const t = C("editorId"), a = C("theme"), n = C("rootRef"), { editorExtensions: o, editorExtensionsAttrs: u, mermaidConfig: c } = L;
594
- let d = o.mermaid.instance;
595
- const s = ee(-1), l = () => {
596
- if (!e.noMermaid && d) {
592
+ }), ut = (e) => {
593
+ const t = $("editorId"), a = $("theme"), o = $("rootRef"), { editorExtensions: n, editorExtensionsAttrs: d, mermaidConfig: s } = L;
594
+ let c = n.mermaid.instance;
595
+ const u = te(-1), l = () => {
596
+ if (!e.noMermaid && c) {
597
597
  const r = a.value === "dark" ? {
598
598
  startOnLoad: !1,
599
599
  theme: "dark"
@@ -613,20 +613,20 @@ const Y = new ct({
613
613
  clusterBorder: "#b7c0cc"
614
614
  }
615
615
  };
616
- d.initialize(c(r)), s.value = s.value + 1;
616
+ c.initialize(s(r)), u.value = u.value + 1;
617
617
  }
618
618
  };
619
- return k(
619
+ return x(
620
620
  () => a.value,
621
621
  () => {
622
- Y.clear(), l();
622
+ Q.clear(), l();
623
623
  }
624
624
  ), M(() => {
625
- if (e.noMermaid || d)
625
+ if (e.noMermaid || c)
626
626
  return;
627
- const r = o.mermaid.js;
627
+ const r = n.mermaid.js;
628
628
  /\.mjs/.test(r) ? (O("link", {
629
- ...u.mermaid?.js,
629
+ ...d.mermaid?.js,
630
630
  rel: "modulepreload",
631
631
  href: r,
632
632
  id: P.mermaidM
@@ -635,9 +635,9 @@ const Y = new ct({
635
635
  /* webpackIgnore: true */
636
636
  r
637
637
  ).then((m) => {
638
- d = m.default, l();
638
+ c = m.default, l();
639
639
  }).catch((m) => {
640
- b.emit(t, Q, {
640
+ b.emit(t, ee, {
641
641
  name: "mermaid",
642
642
  message: `Failed to load mermaid module: ${m.message}`,
643
643
  error: m
@@ -645,18 +645,18 @@ const Y = new ct({
645
645
  })) : O(
646
646
  "script",
647
647
  {
648
- ...u.mermaid?.js,
648
+ ...d.mermaid?.js,
649
649
  src: r,
650
650
  id: P.mermaid,
651
651
  onload() {
652
- d = window.mermaid, l();
652
+ c = window.mermaid, l();
653
653
  }
654
654
  },
655
655
  "mermaid"
656
656
  );
657
- }), { reRenderRef: s, replaceMermaid: async () => {
658
- if (!e.noMermaid && d) {
659
- const r = n.value;
657
+ }), { reRenderRef: u, replaceMermaid: async () => {
658
+ if (!e.noMermaid && c) {
659
+ const r = o.value;
660
660
  if (!r) return;
661
661
  const m = r.querySelectorAll(
662
662
  `div.${h}-mermaid`
@@ -669,20 +669,20 @@ const Y = new ct({
669
669
  Array.from(m).map((v) => (async (y) => {
670
670
  if (y.dataset.closed === "false")
671
671
  return !1;
672
- const $ = y.innerText;
673
- let T = Y.get($);
674
- if (!T) {
675
- const w = ie();
676
- let I = { svg: "" };
672
+ const w = y.innerText;
673
+ let S = Q.get(w);
674
+ if (!S) {
675
+ const C = se();
676
+ let k = { svg: "" };
677
677
  try {
678
- I = await d.render(w, $, f), T = await e.sanitizeMermaid(I.svg);
679
- const S = document.createElement("p");
680
- S.className = `${h}-mermaid`, S.setAttribute("data-processed", ""), S.setAttribute("data-content", $), S.innerHTML = T, S.children[0]?.removeAttribute("height"), Y.set($, S.innerHTML), y.dataset.line !== void 0 && (S.dataset.line = y.dataset.line), y.replaceWith(S);
681
- } catch (S) {
682
- b.emit(t, Q, {
678
+ k = await c.render(C, w, f), S = await e.sanitizeMermaid(k.svg);
679
+ const I = document.createElement("p");
680
+ I.className = `${h}-mermaid`, I.setAttribute("data-processed", ""), I.setAttribute("data-content", w), I.innerHTML = S, I.children[0]?.removeAttribute("height"), Q.set(w, I.innerHTML), y.dataset.line !== void 0 && (I.dataset.line = y.dataset.line), y.replaceWith(I);
681
+ } catch (I) {
682
+ b.emit(t, ee, {
683
683
  name: "mermaid",
684
- message: S.message,
685
- error: S
684
+ message: I.message,
685
+ error: I
686
686
  });
687
687
  }
688
688
  }
@@ -693,11 +693,11 @@ const Y = new ct({
693
693
  }
694
694
  }
695
695
  } };
696
- }, ut = (e, t) => {
696
+ }, mt = (e, t) => {
697
697
  t = t || {};
698
- const a = 3, n = t.marker || "!", o = n.charCodeAt(0), u = n.length;
699
- let c = "", d = "";
700
- const s = (i, r, m, f, p) => {
698
+ const a = 3, o = t.marker || "!", n = o.charCodeAt(0), d = o.length;
699
+ let s = "", c = "";
700
+ const u = (i, r, m, f, p) => {
701
701
  const g = i[r];
702
702
  return g.type === "admonition_open" ? i[r].attrPush([
703
703
  "class",
@@ -705,106 +705,106 @@ const Y = new ct({
705
705
  ]) : g.type === "admonition_title_open" && i[r].attrPush(["class", `${h}-admonition-title`]), p.renderToken(i, r, m);
706
706
  }, l = (i) => {
707
707
  const r = i.trim().split(" ", 2);
708
- d = "", c = r[0], r.length > 1 && (d = i.substring(c.length + 2));
708
+ c = "", s = r[0], r.length > 1 && (c = i.substring(s.length + 2));
709
709
  };
710
710
  e.block.ruler.before(
711
711
  "code",
712
712
  "admonition",
713
713
  (i, r, m, f) => {
714
- let p, g, v, E = !1, y = i.bMarks[r] + i.tShift[r], $ = i.eMarks[r];
715
- if (o !== i.src.charCodeAt(y))
714
+ let p, g, v, E = !1, y = i.bMarks[r] + i.tShift[r], w = i.eMarks[r];
715
+ if (n !== i.src.charCodeAt(y))
716
716
  return !1;
717
- for (p = y + 1; p <= $ && n[(p - y) % u] === i.src[p]; p++)
717
+ for (p = y + 1; p <= w && o[(p - y) % d] === i.src[p]; p++)
718
718
  ;
719
- const T = Math.floor((p - y) / u);
720
- if (T !== a)
719
+ const S = Math.floor((p - y) / d);
720
+ if (S !== a)
721
721
  return !1;
722
- p -= (p - y) % u;
723
- const w = i.src.slice(y, p), I = i.src.slice(p, $);
724
- if (l(I), f)
722
+ p -= (p - y) % d;
723
+ const C = i.src.slice(y, p), k = i.src.slice(p, w);
724
+ if (l(k), f)
725
725
  return !0;
726
- for (g = r; g++, !(g >= m || (y = i.bMarks[g] + i.tShift[g], $ = i.eMarks[g], y < $ && i.sCount[g] < i.blkIndent)); )
727
- if (o === i.src.charCodeAt(y) && !(i.sCount[g] - i.blkIndent >= 4)) {
728
- for (p = y + 1; p <= $ && n[(p - y) % u] === i.src[p]; p++)
726
+ for (g = r; g++, !(g >= m || (y = i.bMarks[g] + i.tShift[g], w = i.eMarks[g], y < w && i.sCount[g] < i.blkIndent)); )
727
+ if (n === i.src.charCodeAt(y) && !(i.sCount[g] - i.blkIndent >= 4)) {
728
+ for (p = y + 1; p <= w && o[(p - y) % d] === i.src[p]; p++)
729
729
  ;
730
- if (!(Math.floor((p - y) / u) < T) && (p -= (p - y) % u, p = i.skipSpaces(p), !(p < $))) {
730
+ if (!(Math.floor((p - y) / d) < S) && (p -= (p - y) % d, p = i.skipSpaces(p), !(p < w))) {
731
731
  E = !0;
732
732
  break;
733
733
  }
734
734
  }
735
- const S = i.parentType, R = i.lineMax;
736
- return i.parentType = "root", i.lineMax = g, v = i.push("admonition_open", "div", 1), v.markup = w, v.block = !0, v.info = c, v.map = [r, g], d && (v = i.push("admonition_title_open", "p", 1), v.markup = w + " " + c, v.map = [r, g], v = i.push("inline", "", 0), v.content = d, v.map = [r, i.line - 1], v.children = [], v = i.push("admonition_title_close", "p", -1), v.markup = w + " " + c), i.md.block.tokenize(i, r + 1, g), v = i.push("admonition_close", "div", -1), v.markup = i.src.slice(y, p), v.block = !0, i.parentType = S, i.lineMax = R, i.line = g + (E ? 1 : 0), !0;
735
+ const I = i.parentType, R = i.lineMax;
736
+ return i.parentType = "root", i.lineMax = g, v = i.push("admonition_open", "div", 1), v.markup = C, v.block = !0, v.info = s, v.map = [r, g], c && (v = i.push("admonition_title_open", "p", 1), v.markup = C + " " + s, v.map = [r, g], v = i.push("inline", "", 0), v.content = c, v.map = [r, i.line - 1], v.children = [], v = i.push("admonition_title_close", "p", -1), v.markup = C + " " + s), i.md.block.tokenize(i, r + 1, g), v = i.push("admonition_close", "div", -1), v.markup = i.src.slice(y, p), v.block = !0, i.parentType = I, i.lineMax = R, i.line = g + (E ? 1 : 0), !0;
737
737
  },
738
738
  {
739
739
  alt: ["paragraph", "reference", "blockquote", "list"]
740
740
  }
741
- ), e.renderer.rules.admonition_open = s, e.renderer.rules.admonition_title_open = s, e.renderer.rules.admonition_title_close = s, e.renderer.rules.admonition_close = s;
742
- }, ce = (e, t) => {
741
+ ), e.renderer.rules.admonition_open = u, e.renderer.rules.admonition_title_open = u, e.renderer.rules.admonition_title_close = u, e.renderer.rules.admonition_close = u;
742
+ }, J = (e, t, a) => `<${e.tag}${a.renderAttrs(e)}>${t}</${e.tag}>`, we = (e, t) => {
743
743
  const a = e.attrs ? e.attrs.slice() : [];
744
- return t.forEach((n) => {
745
- const o = e.attrIndex(n[0]);
746
- o < 0 ? a.push(n) : (a[o] = a[o].slice(), a[o][1] += ` ${n[1]}`);
744
+ return t.forEach((o) => {
745
+ const n = e.attrIndex(o[0]);
746
+ n < 0 ? a.push(o) : (a[n] = a[n].slice(), a[n][1] += ` ${o[1]}`);
747
747
  }), a;
748
- }, mt = (e) => Array.from(e).map(
748
+ }, ft = (e) => Array.from(e).map(
749
749
  (t) => /[A-Za-z0-9_-]/.test(t) ? t : `_${t.codePointAt(0).toString(16)}_`
750
- ).join(""), ft = (e, t) => {
751
- const a = e.renderer.rules.fence, n = e.utils.unescapeAll, o = /\[(\w*)(?::([\w ]*))?\]/, u = /::(open|close)/, c = mt(t.editorId), d = (m) => m.info ? n(m.info).trim() : "", s = (m) => {
752
- const f = d(m), [p = null, g = ""] = (o.exec(f) || []).slice(1);
750
+ ).join(""), ht = (e, t) => {
751
+ const a = e.renderer.rules.fence, o = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/, d = /::(open|close)/, s = ft(t.editorId), c = (m) => m.info ? o(m.info).trim() : "", u = (m) => {
752
+ const f = c(m), [p = null, g = ""] = (n.exec(f) || []).slice(1);
753
753
  return [p, g];
754
754
  }, l = (m) => {
755
- const f = d(m);
755
+ const f = c(m);
756
756
  return f ? f.split(/(\s+)/g)[0] : "";
757
757
  }, i = (m) => {
758
- const f = m.info.match(u) || [], p = f[1] === "open" || f[1] !== "close" && t.codeFoldable && m.content.trim().split(`
758
+ const f = m.info.match(d) || [], p = f[1] === "open" || f[1] !== "close" && t.codeFoldable && m.content.trim().split(`
759
759
  `).length < t.autoFoldThreshold, g = f[1] || t.codeFoldable ? "details" : "div", v = f[1] || t.codeFoldable ? "summary" : "div";
760
760
  return { open: p, tagContainer: g, tagHeader: v };
761
761
  }, r = (m, f, p, g, v) => {
762
762
  if (m[f].hidden)
763
763
  return "";
764
- const E = t.usedLanguageTextRef.value?.copyCode.text || "", y = t.customIconRef.value.copy, $ = e.utils.escapeHtml(E), T = y || $, w = !!y, I = `<span class="${h}-collapse-tips">${Ke("collapse-tips", t.customIconRef.value)}</span>`, [S] = s(m[f]);
765
- if (S === null) {
766
- const { open: A, tagContainer: _, tagHeader: J } = i(m[f]), U = [["class", `${h}-code`]];
767
- A && U.push(["open", ""]);
768
- const Fe = {
769
- attrs: ce(m[f], U)
764
+ const E = t.usedLanguageTextRef.value?.copyCode.text || "", y = t.customIconRef.value.copy, w = e.utils.escapeHtml(E), S = y || w, C = !!y, k = `<span class="${h}-collapse-tips">${Ze("collapse-tips", t.customIconRef.value)}</span>`, [I] = u(m[f]);
765
+ if (I === null) {
766
+ const { open: F, tagContainer: _, tagHeader: X } = i(m[f]), U = [["class", `${h}-code`]];
767
+ F && U.push(["open", ""]);
768
+ const Re = {
769
+ attrs: we(m[f], U)
770
770
  };
771
- m[f].info = m[f].info.replace(u, "");
772
- const Re = a(m, f, p, g, v);
771
+ m[f].info = m[f].info.replace(d, "");
772
+ const He = a(m, f, p, g, v);
773
773
  return `
774
- <${_} ${v.renderAttrs(Fe)}>
775
- <${J} class="${h}-code-head">
774
+ <${_} ${v.renderAttrs(Re)}>
775
+ <${X} class="${h}-code-head">
776
776
  <div class="${h}-code-flag"><span></span><span></span><span></span></div>
777
777
  <div class="${h}-code-action">
778
778
  <span class="${h}-code-lang">${e.utils.escapeHtml(m[f].info.trim())}</span>
779
- <span class="${h}-copy-button" data-tips="${$}"${w ? " data-is-icon=true" : ""}>${T}</span>
779
+ <span class="${h}-copy-button" data-tips="${w}"${C ? " data-is-icon=true" : ""}>${S}</span>
780
780
  ${t.extraTools instanceof Function ? t.extraTools({ lang: m[f].info.trim() }) : t.extraTools || ""}
781
- ${_ === "details" ? I : ""}
781
+ ${_ === "details" ? k : ""}
782
782
  </div>
783
- </${J}>
784
- ${Re}
783
+ </${X}>
784
+ ${He}
785
785
  </${_}>
786
786
  `;
787
787
  }
788
- let R, B, V, j, q = "", K = "", Z = "";
789
- const { open: ne, tagContainer: G, tagHeader: H } = i(m[f]), D = [["class", `${h}-code`]];
790
- ne && D.push(["open", ""]);
791
- const oe = {
792
- attrs: ce(m[f], D)
788
+ let R, N, V, B, q = "", K = "", Z = "";
789
+ const { open: oe, tagContainer: G, tagHeader: H } = i(m[f]), D = [["class", `${h}-code`]];
790
+ oe && D.push(["open", ""]);
791
+ const ae = {
792
+ attrs: we(m[f], D)
793
793
  };
794
- for (let A = f; A < m.length && (R = m[A], [B, V] = s(R), B === S); A++) {
795
- R.info = R.info.replace(o, "").replace(u, ""), R.hidden = !0;
796
- const _ = `${h}-codetab-${c}-${f}-${A - f}`;
797
- j = A - f > 0 ? "" : "checked", q += `
794
+ for (let F = f; F < m.length && (R = m[F], [N, V] = u(R), N === I); F++) {
795
+ R.info = R.info.replace(n, "").replace(d, ""), R.hidden = !0;
796
+ const _ = `${h}-codetab-${s}-${f}-${F - f}`;
797
+ B = F - f > 0 ? "" : "checked", q += `
798
798
  <li>
799
799
  <input
800
800
  type="radio"
801
- id="label-${h}-codetab-label-1-${c}-${f}-${A - f}"
802
- name="${h}-codetab-label-${c}-${f}"
801
+ id="label-${h}-codetab-label-1-${s}-${f}-${F - f}"
802
+ name="${h}-codetab-label-${s}-${f}"
803
803
  class="${_}"
804
- ${j}
804
+ ${B}
805
805
  >
806
806
  <label
807
- for="label-${h}-codetab-label-1-${c}-${f}-${A - f}"
807
+ for="label-${h}-codetab-label-1-${s}-${f}-${F - f}"
808
808
  onclick="this.getRootNode().querySelectorAll('.${_}').forEach(e => e.click())"
809
809
  >
810
810
  ${e.utils.escapeHtml(V || l(R))}
@@ -813,31 +813,31 @@ const Y = new ct({
813
813
  <div role="tabpanel">
814
814
  <input
815
815
  type="radio"
816
- name="${h}-codetab-pre-${c}-${f}"
816
+ name="${h}-codetab-pre-${s}-${f}"
817
817
  class="${_}"
818
- ${j}
818
+ ${B}
819
819
  role="presentation">
820
- ${a(m, A, p, g, v)}
820
+ ${a(m, F, p, g, v)}
821
821
  </div>`, Z += `
822
822
  <input
823
823
  type="radio"
824
- name="${h}-codetab-lang-${c}-${f}"
824
+ name="${h}-codetab-lang-${s}-${f}"
825
825
  class="${_}"
826
- ${j}
826
+ ${B}
827
827
  role="presentation">
828
828
  <span class=${h}-code-lang role="note">${e.utils.escapeHtml(l(R))}</span>`;
829
829
  }
830
830
  return `
831
- <${G} ${v.renderAttrs(oe)}>
831
+ <${G} ${v.renderAttrs(ae)}>
832
832
  <${H} class="${h}-code-head">
833
833
  <div class="${h}-code-flag">
834
834
  <ul class="${h}-codetab-label" role="tablist">${q}</ul>
835
835
  </div>
836
836
  <div class="${h}-code-action">
837
837
  <span class="${h}-codetab-lang">${Z}</span>
838
- <span class="${h}-copy-button" data-tips="${$}"${w ? " data-is-icon=true" : ""}>${T}</span>
838
+ <span class="${h}-copy-button" data-tips="${w}"${C ? " data-is-icon=true" : ""}>${S}</span>
839
839
  ${t.extraTools instanceof Function ? t.extraTools({ lang: m[f].info.trim() }) : t.extraTools || ""}
840
- ${G === "details" ? I : ""}
840
+ ${G === "details" ? k : ""}
841
841
  </div>
842
842
  </${H}>
843
843
  ${K}
@@ -845,40 +845,41 @@ const Y = new ct({
845
845
  `;
846
846
  };
847
847
  e.renderer.rules.fence = r, e.renderer.rules.code_block = r;
848
- }, ht = (e, t) => {
849
- const a = e.renderer.rules.fence.bind(e.renderer.rules);
850
- e.renderer.rules.fence = (n, o, u, c, d) => {
851
- const s = n[o], l = s.content.trim();
852
- if (s.info === "echarts") {
853
- if (s.attrSet("class", `${h}-echarts`), s.attrSet("data-echarts-theme", t.themeRef.value), s.map && s.level === 0) {
854
- const i = s.map[1] - 1, m = !!c.srcLines[i]?.trim()?.startsWith("```");
855
- s.attrSet("data-closed", `${m}`), s.attrSet("data-line", String(s.map[0]));
848
+ }, pt = (e, t) => {
849
+ e.core.ruler.after("block", "echarts-token-attrs", (o) => {
850
+ o.tokens.forEach((n) => {
851
+ if (!(n.type !== "fence" || n.info !== "echarts") && (n.tag = "div", n.attrJoin("class", `${h}-echarts`), n.attrSet("data-echarts-theme", t.themeRef.value), n.attrSet("style", "width: 100%; aspect-ratio: 4 / 3;"), n.map && n.level === 0)) {
852
+ const d = n.map[1] - 1, c = !!o.env.srcLines?.[d]?.trim()?.startsWith("```");
853
+ n.attrSet("data-closed", `${c}`), n.attrSet("data-line", String(n.map[0]));
856
854
  }
857
- return `<div ${d.renderAttrs(s)} style="width: 100%; aspect-ratio: 4 / 3;">${e.utils.escapeHtml(l)}</div>`;
858
- }
859
- return a(n, o, u, c, d);
855
+ });
856
+ });
857
+ const a = e.renderer.rules.fence.bind(e.renderer.rules);
858
+ e.renderer.rules.fence = (o, n, d, s, c) => {
859
+ const u = o[n], l = u.content.trim();
860
+ return u.info === "echarts" ? J(u, e.utils.escapeHtml(l), c) : a(o, n, d, s, c);
860
861
  };
861
- }, pt = (e, t) => {
862
- e.renderer.rules.heading_open = (a, n) => {
863
- const o = a[n], u = a[n + 1].children?.reduce((d, s) => d + (["text", "code_inline", "math_inline"].includes(s.type) && s.content || ""), "") || "", c = o.markup.length;
862
+ }, gt = (e, t) => {
863
+ e.renderer.rules.heading_open = (a, o) => {
864
+ const n = a[o], d = a[o + 1].children?.reduce((c, u) => c + (["text", "code_inline", "math_inline"].includes(u.type) && u.content || ""), "") || "", s = n.markup.length;
864
865
  return t.headsRef.value.push({
865
- text: u,
866
- level: c,
867
- line: o.map[0],
868
- currentToken: o,
869
- nextToken: a[n + 1]
870
- }), o.map && o.level === 0 && o.attrSet(
866
+ text: d,
867
+ level: s,
868
+ line: n.map[0],
869
+ currentToken: n,
870
+ nextToken: a[o + 1]
871
+ }), n.map && n.level === 0 && n.attrSet(
871
872
  "id",
872
873
  t.mdHeadingId({
873
- text: u,
874
- level: c,
874
+ text: d,
875
+ level: s,
875
876
  index: t.headsRef.value.length,
876
- currentToken: o,
877
- nextToken: a[n + 1]
877
+ currentToken: n,
878
+ nextToken: a[o + 1]
878
879
  })
879
- ), e.renderer.renderToken(a, n, t);
880
- }, e.renderer.rules.heading_close = (a, n, o, u, c) => c.renderToken(a, n, o);
881
- }, $e = {
880
+ ), e.renderer.renderToken(a, o, t);
881
+ }, e.renderer.rules.heading_close = (a, o, n, d, s) => s.renderToken(a, o, n);
882
+ }, Ce = {
882
883
  block: [
883
884
  { open: "$$", close: "$$" },
884
885
  { open: "\\[", close: "\\]" }
@@ -889,197 +890,202 @@ const Y = new ct({
889
890
  { open: "\\[", close: "\\]" },
890
891
  { open: "\\(", close: "\\)" }
891
892
  ]
892
- }, gt = (e) => (t, a) => {
893
- const n = e.delimiters;
894
- for (const o of n) {
895
- if (!t.src.startsWith(o.open, t.pos))
893
+ }, vt = (e) => (t, a) => {
894
+ const o = e.delimiters;
895
+ for (const n of o) {
896
+ if (!t.src.startsWith(n.open, t.pos))
896
897
  continue;
897
- const u = t.pos + o.open.length;
898
- let c = u;
899
- for (; (c = t.src.indexOf(o.close, c)) !== -1; ) {
900
- let d = 0, s = c - 1;
901
- for (; s >= 0 && t.src[s] === "\\"; )
902
- d++, s--;
903
- if (d % 2 === 0)
898
+ const d = t.pos + n.open.length;
899
+ let s = d;
900
+ for (; (s = t.src.indexOf(n.close, s)) !== -1; ) {
901
+ let c = 0, u = s - 1;
902
+ for (; u >= 0 && t.src[u] === "\\"; )
903
+ c++, u--;
904
+ if (c % 2 === 0)
904
905
  break;
905
- c += o.close.length;
906
+ s += n.close.length;
906
907
  }
907
- if (c !== -1) {
908
- if (c - u === 0)
909
- return a || (t.pending += o.open + o.close), t.pos = c + o.close.length, !0;
908
+ if (s !== -1) {
909
+ if (s - d === 0)
910
+ return a || (t.pending += n.open + n.close), t.pos = s + n.close.length, !0;
910
911
  if (!a) {
911
- const d = t.push("math_inline", "math", 0);
912
- d.markup = o.open, d.content = t.src.slice(u, c);
912
+ const c = t.push("math_inline", e.tag, 0);
913
+ c.attrSet("class", e.className), c.markup = n.open, c.content = t.src.slice(d, s);
913
914
  }
914
- return t.pos = c + o.close.length, !0;
915
+ return t.pos = s + n.close.length, !0;
915
916
  }
916
917
  }
917
918
  return !1;
918
- }, vt = (e) => (t, a, n, o) => {
919
- const u = e.delimiters, c = t.bMarks[a] + t.tShift[a], d = t.eMarks[a], s = (l, i, r) => {
919
+ }, yt = (e) => (t, a, o, n) => {
920
+ const d = e.delimiters, s = t.bMarks[a] + t.tShift[a], c = t.eMarks[a], u = (l, i, r) => {
920
921
  t.line = i;
921
- const m = t.push("math_block", "math", 0);
922
- return m.block = !0, m.content = l, m.map = [a, t.line], m.markup = r, !0;
922
+ const m = t.push("math_block", e.tag, 0);
923
+ return m.attrSet("class", e.className), m.block = !0, m.content = l, m.map = [a, t.line], m.markup = r, !0;
923
924
  };
924
- for (const l of u) {
925
- const i = c;
925
+ for (const l of d) {
926
+ const i = s;
926
927
  if (t.src.slice(i, i + l.open.length) !== l.open)
927
928
  continue;
928
- const r = i + l.open.length, m = t.src.slice(r, d).trim(), f = m === "", p = m === l.close, g = m.endsWith(l.close);
929
+ const r = i + l.open.length, m = t.src.slice(r, c).trim(), f = m === "", p = m === l.close, g = m.endsWith(l.close);
929
930
  if (!f && !p && !g)
930
931
  continue;
931
- if (o)
932
+ if (n)
932
933
  return !0;
933
934
  if (p)
934
- return s("", a + 1, l.open);
935
+ return u("", a + 1, l.open);
935
936
  if (!f && g) {
936
- const w = m.slice(0, -l.close.length);
937
- return s(w, a + 1, l.open);
937
+ const C = m.slice(0, -l.close.length);
938
+ return u(C, a + 1, l.open);
938
939
  }
939
940
  let v = a + 1, E = !1, y = "";
940
- for (; v < n; v++) {
941
- const w = t.bMarks[v] + t.tShift[v], I = t.eMarks[v];
942
- if (w < I && t.tShift[v] < t.blkIndent)
941
+ for (; v < o; v++) {
942
+ const C = t.bMarks[v] + t.tShift[v], k = t.eMarks[v];
943
+ if (C < k && t.tShift[v] < t.blkIndent)
943
944
  break;
944
- if (t.src.slice(w, I).trim().endsWith(l.close)) {
945
- const R = t.src.slice(0, I).lastIndexOf(l.close);
946
- y = t.src.slice(w, R), E = !0;
945
+ if (t.src.slice(C, k).trim().endsWith(l.close)) {
946
+ const R = t.src.slice(0, k).lastIndexOf(l.close);
947
+ y = t.src.slice(C, R), E = !0;
947
948
  break;
948
949
  }
949
950
  }
950
951
  if (!E)
951
952
  continue;
952
- const T = t.getLines(a + 1, v, t.tShift[a], !0) + (y.trim() ? y : "");
953
- return s(T, v + 1, l.open);
953
+ const S = t.getLines(a + 1, v, t.tShift[a], !0) + (y.trim() ? y : "");
954
+ return u(S, v + 1, l.open);
954
955
  }
955
956
  return !1;
956
- }, yt = (e, { katexRef: t, inlineDelimiters: a, blockDelimiters: n }) => {
957
- const o = (d, s, l, i, r = !1) => {
958
- const m = {
959
- attrs: ce(d, [["class", s]])
960
- }, f = i.renderAttrs(m);
957
+ }, bt = (e, { katexRef: t, inlineDelimiters: a, blockDelimiters: o }) => {
958
+ const n = (c, u, l = !1) => {
961
959
  if (!t.value)
962
- return `<${l} ${f}>${d.content}</${l}>`;
963
- const p = t.value.renderToString(
964
- d.content,
960
+ return J(c, e.utils.escapeHtml(c.content), u);
961
+ const i = t.value.renderToString(
962
+ c.content,
965
963
  L.katexConfig({
966
964
  throwOnError: !1,
967
- displayMode: r
965
+ displayMode: l
968
966
  })
969
967
  );
970
- return `<${l} ${f} data-processed>${p}</${l}>`;
971
- }, u = (d, s, l, i, r) => o(d[s], `${h}-katex-inline`, "span", r), c = (d, s, l, i, r) => o(d[s], `${h}-katex-block`, "p", r, !0);
968
+ return c.attrSet("data-processed", ""), J(c, String(i), u);
969
+ }, d = (c, u, l, i, r) => n(c[u], r), s = (c, u, l, i, r) => n(c[u], r, !0);
972
970
  e.inline.ruler.before(
973
971
  "escape",
974
972
  "math_inline",
975
- gt({
976
- delimiters: a || $e.inline
973
+ vt({
974
+ delimiters: a || Ce.inline,
975
+ className: `${h}-katex-inline`,
976
+ tag: "span"
977
977
  })
978
978
  ), e.block.ruler.after(
979
979
  "blockquote",
980
980
  "math_block",
981
- vt({
982
- delimiters: n || $e.block
981
+ yt({
982
+ delimiters: o || Ce.block,
983
+ className: `${h}-katex-block`,
984
+ tag: "p"
983
985
  }),
984
986
  {
985
987
  alt: ["paragraph", "reference", "blockquote", "list"]
986
988
  }
987
- ), e.renderer.rules.math_inline = u, e.renderer.rules.math_block = c;
988
- }, bt = (e, t) => {
989
- const a = e.renderer.rules.fence.bind(e.renderer.rules);
990
- e.renderer.rules.fence = (n, o, u, c, d) => {
991
- const s = n[o], l = s.content.trim();
992
- if (s.info === "mermaid") {
993
- if (s.attrSet("class", `${h}-mermaid`), s.attrSet("data-mermaid-theme", t.themeRef.value), s.map && s.level === 0) {
994
- const r = s.map[1] - 1, f = !!c.srcLines[r]?.trim()?.startsWith("```");
995
- s.attrSet("data-closed", `${f}`), s.attrSet("data-line", String(s.map[0]));
989
+ ), e.renderer.rules.math_inline = d, e.renderer.rules.math_block = s;
990
+ }, wt = (e, t) => {
991
+ e.core.ruler.after("block", "mermaid-token-attrs", (o) => {
992
+ o.tokens.forEach((n) => {
993
+ if (!(n.type !== "fence" || n.info !== "mermaid") && (n.tag = "div", n.attrJoin("class", `${h}-mermaid`), n.attrSet("data-mermaid-theme", t.themeRef.value), n.map && n.level === 0)) {
994
+ const d = n.map[1] - 1, c = !!o.env.srcLines?.[d]?.trim()?.startsWith("```");
995
+ n.attrSet("data-closed", `${c}`), n.attrSet("data-line", String(n.map[0]));
996
996
  }
997
- const i = Y.get(l);
998
- return i ? (s.attrSet("data-processed", ""), s.attrSet("data-content", l), `<p ${d.renderAttrs(s)}>${i}</p>`) : `<div ${d.renderAttrs(s)}>${e.utils.escapeHtml(l)}</div>`;
997
+ });
998
+ });
999
+ const a = e.renderer.rules.fence.bind(e.renderer.rules);
1000
+ e.renderer.rules.fence = (o, n, d, s, c) => {
1001
+ const u = o[n], l = u.content.trim();
1002
+ if (u.info === "mermaid") {
1003
+ const i = Q.get(l);
1004
+ return i ? (u.tag = "p", u.attrSet("data-processed", ""), u.attrSet("data-content", l), J(u, i, c)) : J(u, e.utils.escapeHtml(l), c);
999
1005
  }
1000
- return a(n, o, u, c, d);
1006
+ return a(o, n, d, s, c);
1001
1007
  };
1002
- }, we = (e, t, a) => {
1003
- const n = e.attrIndex(t), o = [t, a];
1004
- n < 0 ? e.attrPush(o) : (e.attrs = e.attrs || [], e.attrs[n] = o);
1005
- }, $t = (e) => e.type === "inline", wt = (e) => e.type === "paragraph_open", Ct = (e) => e.type === "list_item_open", Et = (e) => e.content.indexOf("[ ] ") === 0 || e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0, kt = (e, t) => $t(e[t]) && wt(e[t - 1]) && Ct(e[t - 2]) && Et(e[t]), xt = (e, t) => {
1008
+ }, $e = (e, t, a) => {
1009
+ const o = e.attrIndex(t), n = [t, a];
1010
+ o < 0 ? e.attrPush(n) : (e.attrs = e.attrs || [], e.attrs[o] = n);
1011
+ }, Ct = (e) => e.type === "inline", $t = (e) => e.type === "paragraph_open", Et = (e) => e.type === "list_item_open", xt = (e) => e.content.indexOf("[ ] ") === 0 || e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0, Tt = (e, t) => Ct(e[t]) && $t(e[t - 1]) && Et(e[t - 2]) && xt(e[t]), St = (e, t) => {
1006
1012
  const a = e[t].level - 1;
1007
- for (let n = t - 1; n >= 0; n--)
1008
- if (e[n].level === a)
1009
- return n;
1013
+ for (let o = t - 1; o >= 0; o--)
1014
+ if (e[o].level === a)
1015
+ return o;
1010
1016
  return -1;
1011
- }, Tt = (e) => {
1017
+ }, It = (e) => {
1012
1018
  const t = new e("html_inline", "", 0);
1013
1019
  return t.content = "<label>", t;
1014
- }, St = (e) => {
1020
+ }, kt = (e) => {
1015
1021
  const t = new e("html_inline", "", 0);
1016
1022
  return t.content = "</label>", t;
1017
- }, It = (e, t, a) => {
1018
- const n = new a("html_inline", "", 0);
1019
- return n.content = '<label class="task-list-item-label" for="' + t + '">' + e + "</label>", n.attrs = [["for", t]], n;
1020
- }, At = (e, t, a) => {
1021
- const n = new t("html_inline", "", 0), o = a.enabled ? " " : ' disabled="" ';
1022
- return e.content.indexOf("[ ] ") === 0 ? n.content = '<input class="task-list-item-checkbox"' + o + 'type="checkbox">' : (e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0) && (n.content = '<input class="task-list-item-checkbox" checked=""' + o + 'type="checkbox">'), n;
1023
1023
  }, Ft = (e, t, a) => {
1024
+ const o = new a("html_inline", "", 0);
1025
+ return o.content = '<label class="task-list-item-label" for="' + t + '">' + e + "</label>", o.attrs = [["for", t]], o;
1026
+ }, At = (e, t, a) => {
1027
+ const o = new t("html_inline", "", 0), n = a.enabled ? " " : ' disabled="" ';
1028
+ return e.content.indexOf("[ ] ") === 0 ? o.content = '<input class="task-list-item-checkbox"' + n + 'type="checkbox">' : (e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0) && (o.content = '<input class="task-list-item-checkbox" checked=""' + n + 'type="checkbox">'), o;
1029
+ }, Rt = (e, t, a) => {
1024
1030
  if (e.children = e.children || [], e.children.unshift(At(e, t, a)), e.children[1].content = e.children[1].content.slice(3), e.content = e.content.slice(3), a.label)
1025
1031
  if (a.labelAfter) {
1026
1032
  e.children.pop();
1027
- const n = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
1028
- e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + n + '">', e.children.push(It(e.content, n, t));
1033
+ const o = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
1034
+ e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + o + '">', e.children.push(Ft(e.content, o, t));
1029
1035
  } else
1030
- e.children.unshift(Tt(t)), e.children.push(St(t));
1031
- }, Rt = (e, t = {}) => {
1036
+ e.children.unshift(It(t)), e.children.push(kt(t));
1037
+ }, Ht = (e, t = {}) => {
1032
1038
  e.core.ruler.after("inline", "github-task-lists", (a) => {
1033
- const n = a.tokens;
1034
- for (let o = 2; o < n.length; o++)
1035
- kt(n, o) && (Ft(n[o], a.Token, t), we(
1036
- n[o - 2],
1039
+ const o = a.tokens;
1040
+ for (let n = 2; n < o.length; n++)
1041
+ Tt(o, n) && (Rt(o[n], a.Token, t), $e(
1042
+ o[n - 2],
1037
1043
  "class",
1038
1044
  "task-list-item" + (t.enabled ? " enabled" : " ")
1039
- ), we(n[xt(n, o - 2)], "class", "contains-task-list"));
1045
+ ), $e(o[St(o, n - 2)], "class", "contains-task-list"));
1040
1046
  });
1041
- }, Ht = (e) => {
1047
+ }, Mt = (e) => {
1042
1048
  e.core.ruler.push("init-line-number", (t) => (t.tokens.forEach((a) => {
1043
- a.map && (a.attrs || (a.attrs = []), a.attrs.push(["data-line", a.map[0].toString()]));
1049
+ a.map && a.attrSet("data-line", a.map[0].toString());
1044
1050
  }), !0));
1045
- }, Mt = (e, t) => {
1046
- const { editorConfig: a, markdownItConfig: n, markdownItPlugins: o, editorExtensions: u } = L, c = C("editorId"), d = C("language"), s = C(
1051
+ }, Pt = (e, t) => {
1052
+ const { editorConfig: a, markdownItConfig: o, markdownItPlugins: n, editorExtensions: d } = L, s = $("editorId"), c = $("language"), u = $(
1047
1053
  "usedLanguageText"
1048
- ), l = C("showCodeRowNumber"), i = C("theme"), r = C("customIcon"), m = C("rootRef"), f = C("setting"), p = z([]), g = it(e), v = st(e), { reRenderRef: E, replaceMermaid: y } = dt(e), { reRenderEcharts: $, replaceEcharts: T } = lt(e), w = Ye({
1054
+ ), l = $("showCodeRowNumber"), i = $("theme"), r = $("customIcon"), m = $("rootRef"), f = $("setting"), p = z([]), g = st(e), v = ct(e), { reRenderRef: E, replaceMermaid: y } = ut(e), { reRenderEcharts: w, replaceEcharts: S } = it(e), C = Qe({
1049
1055
  html: !0,
1050
1056
  breaks: !0,
1051
1057
  linkify: !0
1052
1058
  });
1053
- n(w, {
1054
- editorId: c
1059
+ o(C, {
1060
+ editorId: s
1055
1061
  });
1056
- const I = [
1062
+ const k = [
1057
1063
  {
1058
1064
  type: "image",
1059
- plugin: Qe,
1065
+ plugin: et,
1060
1066
  options: { figcaption: !0, classes: "md-zoom" }
1061
1067
  },
1062
1068
  {
1063
1069
  type: "admonition",
1064
- plugin: ut,
1070
+ plugin: mt,
1065
1071
  options: {}
1066
1072
  },
1067
1073
  {
1068
1074
  type: "taskList",
1069
- plugin: Rt,
1075
+ plugin: Ht,
1070
1076
  options: {}
1071
1077
  },
1072
1078
  {
1073
1079
  type: "heading",
1074
- plugin: pt,
1080
+ plugin: gt,
1075
1081
  options: { mdHeadingId: e.mdHeadingId, headsRef: p }
1076
1082
  },
1077
1083
  {
1078
1084
  type: "code",
1079
- plugin: ft,
1085
+ plugin: ht,
1080
1086
  options: {
1081
- editorId: c,
1082
- usedLanguageTextRef: s,
1087
+ editorId: s,
1088
+ usedLanguageTextRef: u,
1083
1089
  // showCodeRowNumber,
1084
1090
  codeFoldable: e.codeFoldable,
1085
1091
  autoFoldThreshold: e.autoFoldThreshold,
@@ -1088,131 +1094,131 @@ const Y = new ct({
1088
1094
  },
1089
1095
  {
1090
1096
  type: "sub",
1091
- plugin: et,
1097
+ plugin: tt,
1092
1098
  options: {}
1093
1099
  },
1094
1100
  {
1095
1101
  type: "sup",
1096
- plugin: tt,
1102
+ plugin: nt,
1097
1103
  options: {}
1098
1104
  }
1099
1105
  ];
1100
- e.noKatex || I.push({
1106
+ e.noKatex || k.push({
1101
1107
  type: "katex",
1102
- plugin: yt,
1108
+ plugin: bt,
1103
1109
  options: { katexRef: v }
1104
- }), e.noMermaid || I.push({
1110
+ }), e.noMermaid || k.push({
1105
1111
  type: "mermaid",
1106
- plugin: bt,
1112
+ plugin: wt,
1107
1113
  options: { themeRef: i }
1108
- }), e.noEcharts || I.push({
1114
+ }), e.noEcharts || k.push({
1109
1115
  type: "echarts",
1110
- plugin: ht,
1116
+ plugin: pt,
1111
1117
  options: { themeRef: i }
1112
- }), o(I, {
1113
- editorId: c
1118
+ }), n(k, {
1119
+ editorId: s
1114
1120
  }).forEach((H) => {
1115
- w.use(H.plugin, H.options);
1121
+ C.use(H.plugin, H.options);
1116
1122
  });
1117
- const S = w.options.highlight;
1118
- w.set({
1119
- highlight: (H, D, oe) => {
1120
- if (S) {
1121
- const U = S(H, D, oe);
1123
+ const I = C.options.highlight;
1124
+ C.set({
1125
+ highlight: (H, D, ae) => {
1126
+ if (I) {
1127
+ const U = I(H, D, ae);
1122
1128
  if (U)
1123
1129
  return U;
1124
1130
  }
1125
- let A;
1126
- !e.noHighlight && g.value ? g.value.getLanguage(D) ? A = g.value.highlight(H, {
1131
+ let F;
1132
+ !e.noHighlight && g.value ? g.value.getLanguage(D) ? F = g.value.highlight(H, {
1127
1133
  language: D,
1128
1134
  ignoreIllegals: !0
1129
- }).value : A = g.value.highlightAuto(H).value : A = w.utils.escapeHtml(H);
1130
- const _ = w.utils.escapeHtml(D), J = l ? nt(
1131
- A.replace(/^\n+|\n+$/g, ""),
1135
+ }).value : F = g.value.highlightAuto(H).value : F = C.utils.escapeHtml(H);
1136
+ const _ = C.utils.escapeHtml(D), X = l ? ot(
1137
+ F.replace(/^\n+|\n+$/g, ""),
1132
1138
  H.replace(/^\n+|\n+$/g, "")
1133
- ) : `<span class="${h}-code-block">${A.replace(/^\n+|\n+$/g, "")}</span>`;
1134
- return `<pre><code class="language-${_}" language="${_}">${J}</code></pre>`;
1139
+ ) : `<span class="${h}-code-block">${F.replace(/^\n+|\n+$/g, "")}</span>`;
1140
+ return `<pre><code class="language-${_}" language="${_}">${X}</code></pre>`;
1135
1141
  }
1136
- }), Ht(w);
1137
- const R = z(`_article-key_${ie()}`), B = z(
1142
+ }), Mt(C);
1143
+ const R = z(`_article-key_${se()}`), N = z(
1138
1144
  e.sanitize(
1139
- w.render(e.modelValue, {
1145
+ C.render(e.modelValue, {
1140
1146
  srcLines: e.modelValue.split(`
1141
1147
  `)
1142
1148
  })
1143
1149
  )
1144
1150
  );
1145
1151
  let V = () => {
1146
- }, j = () => {
1152
+ }, B = () => {
1147
1153
  };
1148
1154
  const q = () => {
1149
1155
  const H = m.value?.querySelectorAll(
1150
- `#${c} p.${h}-mermaid:not([data-closed=false])`
1156
+ `#${s} p.${h}-mermaid:not([data-closed=false])`
1151
1157
  );
1152
- j(), j = Ze(H, {
1158
+ B(), B = Je(H, {
1153
1159
  customIcon: r.value
1154
- }), u.mermaid?.enableZoom && (V(), V = Je(H, {
1160
+ }), d.mermaid?.enableZoom && (V(), V = Xe(H, {
1155
1161
  customIcon: r.value
1156
1162
  }));
1157
1163
  }, K = () => {
1158
- b.emit(c, X, B.value), e.onHtmlChanged(B.value), e.onGetCatalog(p.value), b.emit(c, ae, p.value), W(() => {
1159
- y().then(q), T();
1164
+ b.emit(s, Y, N.value), e.onHtmlChanged(N.value), e.onGetCatalog(p.value), b.emit(s, re, p.value), W(() => {
1165
+ y().then(q), S();
1160
1166
  });
1161
1167
  }, Z = () => {
1162
- p.value = [], B.value = e.sanitize(
1163
- w.render(e.modelValue, {
1168
+ p.value = [], N.value = e.sanitize(
1169
+ C.render(e.modelValue, {
1164
1170
  srcLines: e.modelValue.split(`
1165
1171
  `)
1166
1172
  })
1167
1173
  );
1168
- }, ne = F(() => (e.noKatex || !!v.value) && (e.noHighlight || !!g.value));
1174
+ }, oe = A(() => (e.noKatex || !!v.value) && (e.noHighlight || !!g.value));
1169
1175
  let G = -1;
1170
- return k([Me(e, "modelValue"), ne, E, d], () => {
1176
+ return x([Pe(e, "modelValue"), oe, E, c], () => {
1171
1177
  G = window.setTimeout(
1172
1178
  () => {
1173
1179
  Z();
1174
1180
  },
1175
1181
  t ? 0 : a.renderDelay
1176
1182
  );
1177
- }), k(
1183
+ }), x(
1178
1184
  () => f.value.preview,
1179
1185
  () => {
1180
1186
  f.value.preview && W(() => {
1181
- y().then(q), T(), b.emit(c, ae, p.value);
1187
+ y().then(q), S(), b.emit(s, re, p.value);
1182
1188
  });
1183
1189
  }
1184
- ), k([B, $], () => {
1190
+ ), x([N, w], () => {
1185
1191
  K();
1186
1192
  }), M(K), M(() => {
1187
- b.on(c, {
1188
- name: ze,
1193
+ b.on(s, {
1194
+ name: We,
1189
1195
  callback() {
1190
- b.emit(c, ae, p.value);
1196
+ b.emit(s, re, p.value);
1191
1197
  }
1192
- }), b.on(c, {
1198
+ }), b.on(s, {
1193
1199
  name: ue,
1194
1200
  callback: () => {
1195
- R.value = `_article-key_${ie()}`, Z();
1201
+ R.value = `_article-key_${se()}`, Z();
1196
1202
  }
1197
1203
  });
1198
- }), te(() => {
1199
- V(), j(), clearTimeout(G);
1200
- }), { html: B, key: R };
1201
- }, Pt = (e, t) => {
1202
- const a = C("editorId"), n = C("setting"), { noImgZoomIn: o } = e, u = Be(() => {
1203
- const c = document.querySelectorAll(
1204
+ }), ne(() => {
1205
+ V(), B(), clearTimeout(G);
1206
+ }), { html: N, key: R };
1207
+ }, Lt = (e, t) => {
1208
+ const a = $("editorId"), o = $("setting"), { noImgZoomIn: n } = e, d = Be(() => {
1209
+ const s = document.querySelectorAll(
1204
1210
  `#${a}-preview img:not(.not-zoom):not(.medium-zoom-image)`
1205
1211
  );
1206
- c.length !== 0 && ot(c, {
1212
+ s.length !== 0 && at(s, {
1207
1213
  background: "#00000073"
1208
1214
  });
1209
1215
  });
1210
1216
  M(async () => {
1211
- !o && n.value.preview && await u();
1212
- }), k([t, () => n.value.preview], async () => {
1213
- !o && n.value.preview && await u();
1217
+ !n && o.value.preview && await d();
1218
+ }), x([t, () => o.value.preview], async () => {
1219
+ !n && o.value.preview && await d();
1214
1220
  });
1215
- }, Ce = {
1221
+ }, Ee = {
1216
1222
  checked: {
1217
1223
  regexp: /- \[x\]/,
1218
1224
  value: "- [ ]"
@@ -1221,55 +1227,55 @@ const Y = new ct({
1221
1227
  regexp: /- \[\s\]/,
1222
1228
  value: "- [x]"
1223
1229
  }
1224
- }, Lt = (e, t) => {
1225
- const a = C("editorId"), n = C("rootRef");
1226
- let o = () => {
1230
+ }, _t = (e, t) => {
1231
+ const a = $("editorId"), o = $("rootRef");
1232
+ let n = () => {
1227
1233
  };
1228
- const u = () => {
1229
- if (!n.value)
1234
+ const d = () => {
1235
+ if (!o.value)
1230
1236
  return !1;
1231
- const c = n.value.querySelectorAll(".task-list-item.enabled"), d = (s) => {
1232
- s.preventDefault();
1233
- const l = s.target.checked ? "unChecked" : "checked", i = s.target.parentElement?.dataset.line;
1237
+ const s = o.value.querySelectorAll(".task-list-item.enabled"), c = (u) => {
1238
+ u.preventDefault();
1239
+ const l = u.target.checked ? "unChecked" : "checked", i = u.target.parentElement?.dataset.line;
1234
1240
  if (!i)
1235
1241
  return;
1236
1242
  const r = Number(i), m = e.modelValue.split(`
1237
1243
  `), f = m[Number(r)].replace(
1238
- Ce[l].regexp,
1239
- Ce[l].value
1244
+ Ee[l].regexp,
1245
+ Ee[l].value
1240
1246
  );
1241
1247
  e.previewOnly ? (m[Number(r)] = f, e.onChange(m.join(`
1242
- `))) : b.emit(a, We, r + 1, f);
1248
+ `))) : b.emit(a, qe, r + 1, f);
1243
1249
  };
1244
- c.forEach((s) => {
1245
- s.addEventListener("click", d);
1246
- }), o = () => {
1247
- c.forEach((s) => {
1248
- s.removeEventListener("click", d);
1250
+ s.forEach((u) => {
1251
+ u.addEventListener("click", c);
1252
+ }), n = () => {
1253
+ s.forEach((u) => {
1254
+ u.removeEventListener("click", c);
1249
1255
  });
1250
1256
  };
1251
1257
  };
1252
- te(() => {
1253
- o();
1254
- }), k(
1258
+ ne(() => {
1259
+ n();
1260
+ }), x(
1255
1261
  [t],
1256
1262
  () => {
1257
- o(), W(u);
1263
+ n(), W(d);
1258
1264
  },
1259
1265
  {
1260
1266
  immediate: !0
1261
1267
  }
1262
1268
  );
1263
- }, _t = (e, t, a) => {
1264
- const n = C("setting"), o = () => {
1269
+ }, Ot = (e, t, a) => {
1270
+ const o = $("setting"), n = () => {
1265
1271
  W(() => {
1266
1272
  e.onRemount?.();
1267
1273
  });
1268
- }, u = (c) => {
1269
- c && o();
1274
+ }, d = (s) => {
1275
+ s && n();
1270
1276
  };
1271
- k([t, a], o), k(() => n.value.preview, u), k(() => n.value.htmlPreview, u), M(o);
1272
- }, Se = {
1277
+ x([t, a], n), x(() => o.value.preview, d), x(() => o.value.htmlPreview, d), M(n);
1278
+ }, ke = {
1273
1279
  modelValue: {
1274
1280
  type: String,
1275
1281
  default: ""
@@ -1340,8 +1346,8 @@ const Y = new ct({
1340
1346
  type: [Object, Function],
1341
1347
  default: void 0
1342
1348
  }
1343
- }, sn = {
1344
- ...Se,
1349
+ }, cn = {
1350
+ ...ke,
1345
1351
  updateModelValue: {
1346
1352
  type: Function,
1347
1353
  default: () => {
@@ -1409,10 +1415,10 @@ const Y = new ct({
1409
1415
  catalogMaxDepth: {
1410
1416
  type: Number
1411
1417
  }
1412
- }, Ee = (e) => {
1418
+ }, xe = (e) => {
1413
1419
  const a = new DOMParser().parseFromString(e, "text/html");
1414
1420
  return Array.from(a.body.childNodes);
1415
- }, Ot = (e, t) => e.nodeType !== t.nodeType ? !1 : e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE ? e.textContent === t.textContent : e.nodeType === Node.ELEMENT_NODE ? e.outerHTML === t.outerHTML : e.isEqualNode ? e.isEqualNode(t) : !1, Bt = /* @__PURE__ */ de({
1421
+ }, Nt = (e, t) => e.nodeType !== t.nodeType ? !1 : e.nodeType === Node.TEXT_NODE || e.nodeType === Node.COMMENT_NODE ? e.textContent === t.textContent : e.nodeType === Node.ELEMENT_NODE ? e.outerHTML === t.outerHTML : e.isEqualNode ? e.isEqualNode(t) : !1, Bt = /* @__PURE__ */ de({
1416
1422
  name: "UpdateOnDemand",
1417
1423
  props: {
1418
1424
  id: {
@@ -1429,32 +1435,32 @@ const Y = new ct({
1429
1435
  }
1430
1436
  },
1431
1437
  setup(e) {
1432
- const t = z(), a = e.html, n = (o, u) => {
1438
+ const t = z(), a = e.html, o = (n, d) => {
1433
1439
  if (!t.value) return;
1434
- const c = t.value, d = Array.from(c.childNodes), s = Math.min(o.length, u.length);
1440
+ const s = t.value, c = Array.from(s.childNodes), u = Math.min(n.length, d.length);
1435
1441
  let l = -1;
1436
- for (let r = 0; r < s; r++)
1437
- if (!Ot(o[r], u[r])) {
1442
+ for (let r = 0; r < u; r++)
1443
+ if (!Nt(n[r], d[r])) {
1438
1444
  l = r;
1439
1445
  break;
1440
1446
  }
1441
1447
  if (l === -1)
1442
- if (u.length > o.length)
1443
- l = o.length;
1444
- else if (o.length > u.length)
1445
- l = u.length;
1448
+ if (d.length > n.length)
1449
+ l = n.length;
1450
+ else if (n.length > d.length)
1451
+ l = d.length;
1446
1452
  else
1447
1453
  return;
1448
- const i = Math.min(l, d.length);
1449
- for (let r = d.length - 1; r >= i; r--)
1450
- d[r].remove();
1451
- for (let r = l; r < o.length; r++)
1452
- c.appendChild(o[r].cloneNode(!0));
1454
+ const i = Math.min(l, c.length);
1455
+ for (let r = c.length - 1; r >= i; r--)
1456
+ c[r].remove();
1457
+ for (let r = l; r < n.length; r++)
1458
+ s.appendChild(n[r].cloneNode(!0));
1453
1459
  };
1454
- return k(() => e.html, (o, u) => {
1455
- const c = Ee(o), d = Ee(u || "");
1456
- n(c, d);
1457
- }), () => N("div", {
1460
+ return x(() => e.html, (n, d) => {
1461
+ const s = xe(n), c = xe(d || "");
1462
+ o(s, c);
1463
+ }), () => j("div", {
1458
1464
  id: e.id,
1459
1465
  class: e.class,
1460
1466
  innerHTML: a,
@@ -1463,40 +1469,40 @@ const Y = new ct({
1463
1469
  }
1464
1470
  }), jt = /* @__PURE__ */ de({
1465
1471
  name: "ContentPreview",
1466
- props: Se,
1472
+ props: ke,
1467
1473
  setup(e) {
1468
- const t = C("editorId"), a = C("setting"), n = C("previewTheme"), o = C("showCodeRowNumber"), {
1469
- html: u,
1470
- key: c
1471
- } = Mt(e, e.previewOnly);
1472
- rt(e, u, c), Pt(e, u), Lt(e, u), _t(e, u, c);
1473
- const d = F(() => [`${h}-preview`, `${n?.value}-theme`, o && `${h}-scrn`].filter(Boolean)), s = () => {
1474
+ const t = $("editorId"), a = $("setting"), o = $("previewTheme"), n = $("showCodeRowNumber"), {
1475
+ html: d,
1476
+ key: s
1477
+ } = Pt(e, e.previewOnly);
1478
+ lt(e, d, s), Lt(e, d), _t(e, d), Ot(e, d, s);
1479
+ const c = A(() => [`${h}-preview`, `${o?.value}-theme`, n && `${h}-scrn`].filter(Boolean)), u = () => {
1474
1480
  const l = `${t}-preview`;
1475
- return e.previewComponent ? Le(e.previewComponent, {
1476
- key: c.value,
1477
- html: u.value,
1481
+ return e.previewComponent ? _e(e.previewComponent, {
1482
+ key: s.value,
1483
+ html: d.value,
1478
1484
  id: l,
1479
- class: d.value
1480
- }) : N(Bt, {
1481
- key: c.value,
1482
- html: u.value,
1485
+ class: c.value
1486
+ }) : j(Bt, {
1487
+ key: s.value,
1488
+ html: d.value,
1483
1489
  id: l,
1484
- class: d.value
1490
+ class: c.value
1485
1491
  }, null);
1486
1492
  };
1487
- return () => N(Pe, null, [a.value.preview && (e.previewOnly ? s() : N("div", {
1493
+ return () => j(Le, null, [a.value.preview && (e.previewOnly ? u() : j("div", {
1488
1494
  id: `${t}-preview-wrapper`,
1489
1495
  class: `${h}-preview-wrapper`,
1490
1496
  key: "content-preview-wrapper"
1491
- }, [s()])), a.value.htmlPreview && N("div", {
1497
+ }, [u()])), a.value.htmlPreview && j("div", {
1492
1498
  id: `${t}-html-wrapper`,
1493
1499
  class: `${h}-preview-wrapper`,
1494
1500
  key: "html-preview-wrapper"
1495
- }, [N("div", {
1501
+ }, [j("div", {
1496
1502
  class: `${h}-html`
1497
- }, [u.value])])]);
1503
+ }, [d.value])])]);
1498
1504
  }
1499
- }), Nt = ({ text: e }) => e, Ie = {
1505
+ }), Dt = ({ text: e }) => e, Fe = {
1500
1506
  /**
1501
1507
  * markdown content.
1502
1508
  *
@@ -1605,7 +1611,7 @@ const Y = new ct({
1605
1611
  */
1606
1612
  mdHeadingId: {
1607
1613
  type: Function,
1608
- default: Nt
1614
+ default: Dt
1609
1615
  },
1610
1616
  /**
1611
1617
  *
@@ -1734,8 +1740,8 @@ const Y = new ct({
1734
1740
  type: [Object, Function],
1735
1741
  default: void 0
1736
1742
  }
1737
- }, cn = {
1738
- ...Ie,
1743
+ }, dn = {
1744
+ ...Fe,
1739
1745
  /**
1740
1746
  * input回调事件
1741
1747
  */
@@ -1795,7 +1801,7 @@ const Y = new ct({
1795
1801
  */
1796
1802
  toolbars: {
1797
1803
  type: Array,
1798
- default: Ne
1804
+ default: De
1799
1805
  },
1800
1806
  /**
1801
1807
  * 浮动工具栏
@@ -2046,7 +2052,7 @@ const Y = new ct({
2046
2052
  "onChange",
2047
2053
  "onRemount",
2048
2054
  "update:modelValue"
2049
- ], dn = [
2055
+ ], un = [
2050
2056
  ...Ae,
2051
2057
  "onSave",
2052
2058
  "onUploadImg",
@@ -2056,56 +2062,56 @@ const Y = new ct({
2056
2062
  "onInput",
2057
2063
  "onDrop",
2058
2064
  "oninputBoxWidthChange"
2059
- ], Dt = (e, t, a) => {
2060
- const { editorId: n } = a, o = {
2065
+ ], Vt = (e, t, a) => {
2066
+ const { editorId: o } = a, n = {
2061
2067
  rerender() {
2062
- b.emit(n, ue);
2068
+ b.emit(o, ue);
2063
2069
  }
2064
2070
  };
2065
- t.expose(o);
2066
- }, re = /* @__PURE__ */ de({
2071
+ t.expose(n);
2072
+ }, le = /* @__PURE__ */ de({
2067
2073
  name: "MdPreview",
2068
- props: Ie,
2074
+ props: Fe,
2069
2075
  emits: Ae,
2070
2076
  setup(e, t) {
2071
2077
  const {
2072
2078
  noKatex: a,
2073
- noMermaid: n,
2074
- noHighlight: o
2075
- } = e, u = z(), c = at(e);
2076
- Te(e, {
2077
- rootRef: u,
2078
- editorId: c
2079
- }), Dt(e, t, {
2080
- editorId: c
2081
- }), te(() => {
2082
- b.clear(c);
2079
+ noMermaid: o,
2080
+ noHighlight: n
2081
+ } = e, d = z(), s = rt(e);
2082
+ Ie(e, {
2083
+ rootRef: d,
2084
+ editorId: s
2085
+ }), Vt(e, t, {
2086
+ editorId: s
2087
+ }), ne(() => {
2088
+ b.clear(s);
2083
2089
  });
2084
- const d = (r) => {
2090
+ const c = (r) => {
2085
2091
  e.onChange?.(r), t.emit("onChange", r), t.emit("update:modelValue", r);
2086
- }, s = (r) => {
2092
+ }, u = (r) => {
2087
2093
  e.onHtmlChanged?.(r), t.emit("onHtmlChanged", r);
2088
2094
  }, l = (r) => {
2089
2095
  e.onGetCatalog?.(r), t.emit("onGetCatalog", r);
2090
2096
  }, i = () => {
2091
2097
  e.onRemount?.(), t.emit("onRemount");
2092
2098
  };
2093
- return () => N("div", {
2094
- id: c,
2099
+ return () => j("div", {
2100
+ id: s,
2095
2101
  class: [h, e.class, e.theme === "dark" && `${h}-dark`, `${h}-previewOnly`],
2096
2102
  style: e.style,
2097
- ref: u
2098
- }, [N(jt, {
2103
+ ref: d
2104
+ }, [j(jt, {
2099
2105
  modelValue: e.modelValue,
2100
- onChange: d,
2101
- onHtmlChanged: s,
2106
+ onChange: c,
2107
+ onHtmlChanged: u,
2102
2108
  onGetCatalog: l,
2103
2109
  mdHeadingId: e.mdHeadingId,
2104
- noMermaid: n,
2110
+ noMermaid: o,
2105
2111
  sanitize: e.sanitize,
2106
2112
  noKatex: a,
2107
2113
  formatCopiedText: e.formatCopiedText,
2108
- noHighlight: o,
2114
+ noHighlight: n,
2109
2115
  noImgZoomIn: e.noImgZoomIn,
2110
2116
  previewOnly: !0,
2111
2117
  sanitizeMermaid: e.sanitizeMermaid,
@@ -2117,21 +2123,21 @@ const Y = new ct({
2117
2123
  }, null)]);
2118
2124
  }
2119
2125
  });
2120
- re.install = (e) => (e.component(re.name, re), e);
2126
+ le.install = (e) => (e.component(le.name, le), e);
2121
2127
  export {
2122
2128
  P as C,
2123
- re as M,
2129
+ le as M,
2124
2130
  jt as a,
2125
- dn as b,
2126
- sn as c,
2127
- cn as d,
2128
- se as e,
2129
- an as f,
2130
- rn as g,
2131
- en as h,
2132
- nn as i,
2133
- on as j,
2134
- ln as k,
2135
- tn as l,
2136
- at as u
2131
+ un as b,
2132
+ cn as c,
2133
+ dn as d,
2134
+ ce as e,
2135
+ rn as f,
2136
+ ln as g,
2137
+ tn as h,
2138
+ on as i,
2139
+ an as j,
2140
+ sn as k,
2141
+ nn as l,
2142
+ rt as u
2137
2143
  };