md-editor-v3 6.0.1 → 6.1.0-0

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,17 +1,17 @@
1
- import { useId as Ae, provide as k, computed as F, reactive as ae, watch as w, onMounted as A, ref as V, inject as b, nextTick as U, shallowRef as ee, onBeforeUnmount as te, toRef as Re, defineComponent as ie, createVNode as O, Fragment as He } from "vue";
2
- import { deepMerge as Pe, deepClone as Me, randomId as re, debounce as Le } from "@vavt/util";
3
- import { p as h, g as R, f as ce, s as de, b as _e, a as Ne } from "./config.mjs";
4
- import { b as v, U as Oe, C as ke, B as J, O as Ce, E as Y, P as ue, F as me, f as fe, g as he, H as pe, h as ge, R as le, e as je, i as se, d as Be, j as ne, k as De, T as Ve } from "./event-bus.mjs";
5
- import { a as _, u as Ue, S as Ge, z as ve } from "./dom.mjs";
6
- import ze from "@vavt/copy2clipboard";
7
- import We from "markdown-it";
8
- import qe from "markdown-it-image-figures";
9
- import Ke from "markdown-it-sub";
10
- import Ze from "markdown-it-sup";
11
- import { g as Je } from "./index5.mjs";
12
- import { LRUCache as Xe } from "lru-cache";
13
- import Ye from "medium-zoom";
14
- const P = {
1
+ import { useId as Fe, provide as E, computed as x, reactive as le, watch as w, onMounted as F, ref as U, inject as b, nextTick as G, shallowRef as te, onBeforeUnmount as ne, toRef as Ae, defineComponent as ce, createVNode as N, Fragment as Re } from "vue";
2
+ import { deepMerge as He, deepClone as Pe, randomId as ie, debounce as Me } from "@vavt/util";
3
+ import { p as h, g as R, f as ue, s as me, b as Le, a as _e } from "./config.mjs";
4
+ import { b as v, U as Ne, C as ke, B as X, O as Ee, E as Q, P as fe, F as he, f as pe, g as ge, H as ve, h as ye, R as se, e as Oe, i as de, d as je, j as ae, k as Be, T as De } from "./event-bus.mjs";
5
+ import { a as L, u as Ve, S as Ue, c as Ge, z as ze } from "./dom.mjs";
6
+ import We from "@vavt/copy2clipboard";
7
+ import qe from "markdown-it";
8
+ import Ke from "markdown-it-image-figures";
9
+ import Ze from "markdown-it-sub";
10
+ import Je from "markdown-it-sup";
11
+ import { g as Xe } from "./index5.mjs";
12
+ import { LRUCache as Ye } from "lru-cache";
13
+ import Qe from "medium-zoom";
14
+ const M = {
15
15
  hljs: `${h}-hljs`,
16
16
  hlcss: `${h}-hlCss`,
17
17
  prettier: `${h}-prettier`,
@@ -24,8 +24,8 @@ const P = {
24
24
  katexjs: `${h}-katex`,
25
25
  katexcss: `${h}-katexCss`,
26
26
  echarts: `${h}-echarts`
27
- }, Kt = (e, t, r) => {
28
- const { editorId: o } = r, n = ae({
27
+ }, Zt = (e, t, r) => {
28
+ const { editorId: o } = r, n = le({
29
29
  // 是否已编译成html
30
30
  buildFinished: !1,
31
31
  // 存储当前最新的html
@@ -36,24 +36,24 @@ const P = {
36
36
  () => {
37
37
  n.buildFinished = !1;
38
38
  }
39
- ), A(() => {
39
+ ), F(() => {
40
40
  v.on(o, {
41
- name: J,
41
+ name: X,
42
42
  callback(m) {
43
43
  n.buildFinished = !0, n.html = m;
44
44
  }
45
45
  }), v.on(o, {
46
- name: Ce,
46
+ name: Ee,
47
47
  callback() {
48
48
  const m = new Promise((s) => {
49
49
  if (n.buildFinished)
50
50
  s(n.html);
51
51
  else {
52
52
  const d = (i) => {
53
- s(i), v.remove(o, J, d);
53
+ s(i), v.remove(o, X, d);
54
54
  };
55
55
  v.on(o, {
56
- name: J,
56
+ name: X,
57
57
  callback: d
58
58
  });
59
59
  }
@@ -68,19 +68,19 @@ const P = {
68
68
  setting: o
69
69
  }) => {
70
70
  const n = R.editorExtensions.highlight, m = R.editorExtensionsAttrs.highlight;
71
- k("editorId", t), k("rootRef", r), k(
71
+ E("editorId", t), E("rootRef", r), E(
72
72
  "theme",
73
- F(() => e.theme)
74
- ), k(
73
+ x(() => e.theme)
74
+ ), E(
75
75
  "language",
76
- F(() => e.language)
77
- ), k(
76
+ x(() => e.language)
77
+ ), E(
78
78
  "highlight",
79
- F(() => {
79
+ x(() => {
80
80
  const { js: d } = n, i = {
81
- ...ce,
81
+ ...ue,
82
82
  ...n.css
83
- }, { js: u, css: l = {} } = m || {}, a = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, c = i[e.codeTheme] ? i[e.codeTheme][a] : ce.atom[a], p = i[e.codeTheme] && l[e.codeTheme] ? l[e.codeTheme][a] : l.atom ? l.atom[a] : {};
83
+ }, { js: u, css: l = {} } = m || {}, a = e.codeStyleReverse && e.codeStyleReverseList.includes(e.previewTheme) ? "dark" : e.theme, c = i[e.codeTheme] ? i[e.codeTheme][a] : ue.atom[a], p = i[e.codeTheme] && l[e.codeTheme] ? l[e.codeTheme][a] : l.atom ? l.atom[a] : {};
84
84
  return {
85
85
  js: {
86
86
  src: d,
@@ -92,26 +92,26 @@ const P = {
92
92
  }
93
93
  };
94
94
  })
95
- ), k("showCodeRowNumber", e.showCodeRowNumber);
96
- const s = F(() => {
95
+ ), E("showCodeRowNumber", e.showCodeRowNumber);
96
+ const s = x(() => {
97
97
  const d = {
98
- ...de,
98
+ ...me,
99
99
  ...R.editorConfig.languageUserDefined
100
100
  };
101
- return Pe(
102
- Me(de["en-US"]),
101
+ return He(
102
+ Pe(me["en-US"]),
103
103
  d[e.language] || {}
104
104
  );
105
105
  });
106
- return k("usedLanguageText", s), k(
106
+ return E("usedLanguageText", s), E(
107
107
  "previewTheme",
108
- F(() => e.previewTheme)
109
- ), k(
108
+ x(() => e.previewTheme)
109
+ ), E(
110
110
  "customIcon",
111
- F(() => e.customIcon)
112
- ), k(
111
+ x(() => e.customIcon)
112
+ ), E(
113
113
  "setting",
114
- F(() => o ? {
114
+ x(() => o ? {
115
115
  // setting是reactive,不转化是可以直接赋值的
116
116
  ...o
117
117
  } : {
@@ -122,75 +122,75 @@ const P = {
122
122
  fullscreen: !1
123
123
  })
124
124
  ), { editorId: t };
125
- }, Zt = (e, t) => (k("tabWidth", e.tabWidth), k(
125
+ }, Jt = (e, t) => (E("tabWidth", e.tabWidth), E(
126
126
  "disabled",
127
- F(() => e.disabled)
128
- ), k(
127
+ x(() => e.disabled)
128
+ ), E(
129
129
  "showToolbarName",
130
- F(() => e.showToolbarName)
131
- ), k("noUploadImg", e.noUploadImg), k(
130
+ x(() => e.showToolbarName)
131
+ ), E("noUploadImg", e.noUploadImg), E(
132
132
  "tableShape",
133
- F(() => e.tableShape)
134
- ), k("noPrettier", e.noPrettier), k(
133
+ x(() => e.tableShape)
134
+ ), E("noPrettier", e.noPrettier), E(
135
135
  "codeTheme",
136
- F(() => e.codeTheme)
137
- ), k("updateSetting", t.updateSetting), k(
136
+ x(() => e.codeTheme)
137
+ ), E("updateSetting", t.updateSetting), E(
138
138
  "catalogVisible",
139
- F(() => t.catalogVisible.value)
140
- ), k("defToolbars", t.defToolbars), k(
139
+ x(() => t.catalogVisible.value)
140
+ ), E("defToolbars", t.defToolbars), E(
141
141
  "floatingToolbars",
142
- F(() => e.floatingToolbars)
143
- ), Ie(e, t)), Jt = (e) => {
142
+ x(() => e.floatingToolbars)
143
+ ), Ie(e, t)), Xt = (e) => {
144
144
  const { noPrettier: t, noUploadImg: r } = e, { editorExtensions: o, editorExtensionsAttrs: n } = R, m = t || o.prettier.prettierInstance, s = t || o.prettier.parserMarkdownInstance, d = r || o.cropper.instance;
145
- A(() => {
145
+ F(() => {
146
146
  if (!d) {
147
147
  const { js: i = {}, css: u = {} } = n.cropper || {};
148
- _("link", {
148
+ L("link", {
149
149
  ...u,
150
150
  rel: "stylesheet",
151
151
  href: o.cropper.css,
152
- id: P.croppercss
153
- }), _("script", {
152
+ id: M.croppercss
153
+ }), L("script", {
154
154
  ...i,
155
155
  src: o.cropper.js,
156
- id: P.cropperjs
156
+ id: M.cropperjs
157
157
  });
158
158
  }
159
159
  if (!m) {
160
160
  const { standaloneJs: i = {} } = n.prettier || {};
161
- _("script", {
161
+ L("script", {
162
162
  ...i,
163
163
  src: o.prettier.standaloneJs,
164
- id: P.prettier
164
+ id: M.prettier
165
165
  });
166
166
  }
167
167
  if (!s) {
168
168
  const { parserMarkdownJs: i = {} } = n.prettier || {};
169
- _("script", {
169
+ L("script", {
170
170
  ...i,
171
171
  src: o.prettier.parserMarkdownJs,
172
- id: P.prettierMD
172
+ id: M.prettierMD
173
173
  });
174
174
  }
175
175
  });
176
- }, Xt = (e, t, r) => {
176
+ }, Yt = (e, t, r) => {
177
177
  const { editorId: o } = r;
178
- A(() => {
178
+ F(() => {
179
179
  v.on(o, {
180
- name: Y,
180
+ name: Q,
181
181
  callback: (n) => {
182
182
  e.onError?.(n), t.emit("onError", n);
183
183
  }
184
184
  });
185
185
  });
186
- }, Yt = (e, t, r) => {
187
- const { editorId: o } = r, n = ae({
186
+ }, Qt = (e, t, r) => {
187
+ const { editorId: o } = r, n = le({
188
188
  pageFullscreen: e.pageFullscreen,
189
189
  fullscreen: !1,
190
190
  preview: e.preview,
191
191
  htmlPreview: e.preview ? !1 : e.htmlPreview,
192
192
  previewOnly: !1
193
- }), m = ae({ ...n }), s = (u, l) => {
193
+ }), m = le({ ...n }), s = (u, l) => {
194
194
  const a = l === void 0 ? !n[u] : l;
195
195
  switch (u) {
196
196
  case "preview": {
@@ -212,12 +212,12 @@ const P = {
212
212
  const i = () => {
213
213
  n.pageFullscreen || n.fullscreen ? document.body.style.overflow = "hidden" : document.body.style.overflow = d;
214
214
  };
215
- return w(() => [n.pageFullscreen, n.fullscreen], i), A(() => {
215
+ return w(() => [n.pageFullscreen, n.fullscreen], i), F(() => {
216
216
  v.on(o, {
217
- name: Oe,
217
+ name: Ne,
218
218
  callback(u, l) {
219
219
  const a = (c) => {
220
- v.emit(o, le, "image", {
220
+ v.emit(o, se, "image", {
221
221
  desc: "",
222
222
  urls: c
223
223
  }), l?.();
@@ -226,9 +226,9 @@ const P = {
226
226
  }
227
227
  }), d = document.body.style.overflow, i();
228
228
  }), [n, s];
229
- }, Qt = (e, t) => {
230
- const { editorId: r } = t, o = V(!1);
231
- return A(() => {
229
+ }, en = (e, t) => {
230
+ const { editorId: r } = t, o = U(!1);
231
+ return F(() => {
232
232
  v.on(r, {
233
233
  name: ke,
234
234
  callback: (n) => {
@@ -236,42 +236,42 @@ const P = {
236
236
  }
237
237
  });
238
238
  }), o;
239
- }, en = (e, t, r) => {
239
+ }, tn = (e, t, r) => {
240
240
  const { editorId: o, catalogVisible: n, setting: m, updateSetting: s, codeRef: d } = r;
241
241
  w(
242
242
  () => m.pageFullscreen,
243
243
  (u) => {
244
- v.emit(o, ue, u);
244
+ v.emit(o, fe, u);
245
245
  }
246
246
  ), w(
247
247
  () => m.fullscreen,
248
248
  (u) => {
249
- v.emit(o, me, u);
249
+ v.emit(o, he, u);
250
250
  }
251
251
  ), w(
252
252
  () => m.preview,
253
253
  (u) => {
254
- v.emit(o, fe, u);
254
+ v.emit(o, pe, u);
255
255
  }
256
256
  ), w(
257
257
  () => m.previewOnly,
258
258
  (u) => {
259
- v.emit(o, he, u);
259
+ v.emit(o, ge, u);
260
260
  }
261
261
  ), w(
262
262
  () => m.htmlPreview,
263
263
  (u) => {
264
- v.emit(o, pe, u);
264
+ v.emit(o, ve, u);
265
265
  }
266
266
  ), w(n, (u) => {
267
- v.emit(o, ge, u);
267
+ v.emit(o, ye, u);
268
268
  });
269
269
  const i = {
270
270
  on(u, l) {
271
271
  switch (u) {
272
272
  case "pageFullscreen": {
273
273
  v.on(o, {
274
- name: ue,
274
+ name: fe,
275
275
  callback(a) {
276
276
  l(a);
277
277
  }
@@ -280,7 +280,7 @@ const P = {
280
280
  }
281
281
  case "fullscreen": {
282
282
  v.on(o, {
283
- name: me,
283
+ name: he,
284
284
  callback(a) {
285
285
  l(a);
286
286
  }
@@ -289,7 +289,7 @@ const P = {
289
289
  }
290
290
  case "preview": {
291
291
  v.on(o, {
292
- name: fe,
292
+ name: pe,
293
293
  callback(a) {
294
294
  l(a);
295
295
  }
@@ -298,7 +298,7 @@ const P = {
298
298
  }
299
299
  case "previewOnly": {
300
300
  v.on(o, {
301
- name: he,
301
+ name: ge,
302
302
  callback(a) {
303
303
  l(a);
304
304
  }
@@ -307,7 +307,7 @@ const P = {
307
307
  }
308
308
  case "htmlPreview": {
309
309
  v.on(o, {
310
- name: pe,
310
+ name: ve,
311
311
  callback(a) {
312
312
  l(a);
313
313
  }
@@ -316,7 +316,7 @@ const P = {
316
316
  }
317
317
  case "catalog": {
318
318
  v.on(o, {
319
- name: ge,
319
+ name: ye,
320
320
  callback(a) {
321
321
  l(a);
322
322
  }
@@ -329,7 +329,7 @@ const P = {
329
329
  s("pageFullscreen", u);
330
330
  },
331
331
  toggleFullscreen(u) {
332
- v.emit(o, Be, u);
332
+ v.emit(o, je, u);
333
333
  },
334
334
  togglePreview(u) {
335
335
  s("preview", u);
@@ -344,16 +344,16 @@ const P = {
344
344
  v.emit(o, ke, u);
345
345
  },
346
346
  triggerSave() {
347
- v.emit(o, Ce);
347
+ v.emit(o, Ee);
348
348
  },
349
349
  insert(u) {
350
- v.emit(o, le, "universal", { generate: u });
350
+ v.emit(o, se, "universal", { generate: u });
351
351
  },
352
352
  focus(u) {
353
353
  d.value?.focus(u);
354
354
  },
355
355
  rerender() {
356
- v.emit(o, se);
356
+ v.emit(o, de);
357
357
  },
358
358
  getSelectedText() {
359
359
  return d.value?.getSelectedText();
@@ -362,20 +362,20 @@ const P = {
362
362
  d.value?.resetHistory();
363
363
  },
364
364
  domEventHandlers(u) {
365
- v.emit(o, je, u);
365
+ v.emit(o, Oe, u);
366
366
  },
367
367
  execCommand(u) {
368
- v.emit(o, le, u);
368
+ v.emit(o, se, u);
369
369
  },
370
370
  getEditorView() {
371
371
  return d.value?.getEditorView();
372
372
  }
373
373
  };
374
374
  t.expose(i);
375
- }, Qe = (e) => {
376
- const t = Ae();
375
+ }, et = (e) => {
376
+ const t = Fe();
377
377
  return e.id || e.editorId || `${h}-${t}`;
378
- }, et = (e, t, r) => {
378
+ }, tt = (e, t, r) => {
379
379
  const o = b("editorId"), n = b("rootRef"), m = b("usedLanguageText"), s = b("setting"), d = () => {
380
380
  n.value.querySelectorAll(`#${o} .${h}-preview .${h}-code`).forEach((l) => {
381
381
  let a = -1;
@@ -384,27 +384,27 @@ const P = {
384
384
  );
385
385
  c && (c.onclick = (p) => {
386
386
  p.preventDefault(), clearTimeout(a);
387
- const g = (l.querySelector("input:checked + pre code") || l.querySelector("pre code")).textContent, { text: y, successTips: S, failTips: $ } = m.value.copyCode;
388
- let C = S;
389
- ze(e.formatCopiedText(g || "")).catch(() => {
390
- C = $;
387
+ const g = (l.querySelector("input:checked + pre code") || l.querySelector("pre code")).textContent, { text: y, successTips: A, failTips: $ } = m.value.copyCode;
388
+ let I = A;
389
+ We(e.formatCopiedText(g || "")).catch(() => {
390
+ I = $;
391
391
  }).finally(() => {
392
- c.dataset.isIcon ? c.dataset.tips = C : c.innerHTML = C, a = window.setTimeout(() => {
392
+ c.dataset.isIcon ? c.dataset.tips = I : c.innerHTML = I, a = window.setTimeout(() => {
393
393
  c.dataset.isIcon ? c.dataset.tips = y : c.innerHTML = y;
394
394
  }, 1500);
395
395
  });
396
396
  });
397
397
  });
398
398
  }, i = () => {
399
- U(d);
399
+ G(d);
400
400
  }, u = (l) => {
401
- l && U(d);
401
+ l && G(d);
402
402
  };
403
- w([t, r], i), w(() => s.value.preview, u), w(() => s.value.htmlPreview, u), A(d);
404
- }, tt = (e) => {
403
+ w([t, r], i), w(() => s.value.preview, u), w(() => s.value.htmlPreview, u), F(d);
404
+ }, nt = (e) => {
405
405
  const t = b("editorId"), r = b("theme"), o = b("rootRef"), { editorExtensions: n, editorExtensionsAttrs: m } = R;
406
406
  let s = n.echarts.instance;
407
- const d = ee(-1), i = () => {
407
+ const d = te(-1), i = () => {
408
408
  !e.noEcharts && s && (d.value = d.value + 1);
409
409
  };
410
410
  w(
@@ -412,16 +412,16 @@ const P = {
412
412
  () => {
413
413
  i();
414
414
  }
415
- ), A(() => {
415
+ ), F(() => {
416
416
  if (e.noEcharts || s)
417
417
  return;
418
418
  const f = n.echarts.js;
419
- _(
419
+ L(
420
420
  "script",
421
421
  {
422
422
  ...m.echarts?.js,
423
423
  src: f,
424
- id: P.echarts,
424
+ id: M.echarts,
425
425
  onload() {
426
426
  s = window.echarts, i();
427
427
  }
@@ -447,12 +447,12 @@ const P = {
447
447
  try {
448
448
  const g = new Function(`return ${f.innerText}`)(), y = s.init(f, r.value);
449
449
  y.setOption(g), f.setAttribute("data-processed", ""), l.push(y);
450
- const S = new ResizeObserver(() => {
450
+ const A = new ResizeObserver(() => {
451
451
  y.resize();
452
452
  });
453
- S.observe(f), a.push(S);
453
+ A.observe(f), a.push(A);
454
454
  } catch (g) {
455
- v.emit(t, Y, {
455
+ v.emit(t, Q, {
456
456
  name: "echarts",
457
457
  message: g?.message,
458
458
  error: g
@@ -460,21 +460,21 @@ const P = {
460
460
  }
461
461
  }));
462
462
  };
463
- return te(() => {
463
+ return ne(() => {
464
464
  c();
465
465
  }), { reRenderEcharts: d, replaceEcharts: p };
466
- }, nt = (e) => {
467
- const t = b("highlight"), r = ee(R.editorExtensions.highlight.instance);
468
- return A(() => {
469
- e.noHighlight || r.value || (_("link", {
466
+ }, ot = (e) => {
467
+ const t = b("highlight"), r = te(R.editorExtensions.highlight.instance);
468
+ return F(() => {
469
+ e.noHighlight || r.value || (L("link", {
470
470
  ...t.value.css,
471
471
  rel: "stylesheet",
472
- id: P.hlcss
473
- }), _(
472
+ id: M.hlcss
473
+ }), L(
474
474
  "script",
475
475
  {
476
476
  ...t.value.js,
477
- id: P.hljs,
477
+ id: M.hljs,
478
478
  onload() {
479
479
  r.value = window.hljs;
480
480
  }
@@ -484,45 +484,45 @@ const P = {
484
484
  }), w(
485
485
  () => t.value.css,
486
486
  () => {
487
- e.noHighlight || R.editorExtensions.highlight.instance || Ue("link", {
487
+ e.noHighlight || R.editorExtensions.highlight.instance || Ve("link", {
488
488
  ...t.value.css,
489
489
  rel: "stylesheet",
490
- id: P.hlcss
490
+ id: M.hlcss
491
491
  });
492
492
  }
493
493
  ), r;
494
- }, ot = (e) => {
495
- const t = ee(R.editorExtensions.katex.instance);
496
- return A(() => {
494
+ }, at = (e) => {
495
+ const t = te(R.editorExtensions.katex.instance);
496
+ return F(() => {
497
497
  if (e.noKatex || t.value)
498
498
  return;
499
499
  const { editorExtensions: r, editorExtensionsAttrs: o } = R;
500
- _(
500
+ L(
501
501
  "script",
502
502
  {
503
503
  ...o.katex?.js,
504
504
  src: r.katex.js,
505
- id: P.katexjs,
505
+ id: M.katexjs,
506
506
  onload() {
507
507
  t.value = window.katex;
508
508
  }
509
509
  },
510
510
  "katex"
511
- ), _("link", {
511
+ ), L("link", {
512
512
  ...o.katex?.css,
513
513
  rel: "stylesheet",
514
514
  href: r.katex.css,
515
- id: P.katexcss
515
+ id: M.katexcss
516
516
  });
517
517
  }), t;
518
- }, X = new Xe({
518
+ }, Y = new Ye({
519
519
  max: 1e3,
520
520
  // 缓存10分钟
521
521
  ttl: 6e5
522
- }), at = (e) => {
522
+ }), rt = (e) => {
523
523
  const t = b("editorId"), r = b("theme"), o = b("rootRef"), { editorExtensions: n, editorExtensionsAttrs: m, mermaidConfig: s } = R;
524
524
  let d = n.mermaid.instance;
525
- const i = ee(-1), u = () => {
525
+ const i = te(-1), u = () => {
526
526
  !e.noMermaid && d && (d.initialize(
527
527
  s({
528
528
  startOnLoad: !1,
@@ -533,17 +533,17 @@ const P = {
533
533
  return w(
534
534
  () => r.value,
535
535
  () => {
536
- X.clear(), u();
536
+ Y.clear(), u();
537
537
  }
538
- ), A(() => {
538
+ ), F(() => {
539
539
  if (e.noMermaid || d)
540
540
  return;
541
541
  const a = n.mermaid.js;
542
- /\.mjs/.test(a) ? (_("link", {
542
+ /\.mjs/.test(a) ? (L("link", {
543
543
  ...m.mermaid?.js,
544
544
  rel: "modulepreload",
545
545
  href: a,
546
- id: P.mermaidM
546
+ id: M.mermaidM
547
547
  }), import(
548
548
  /* @vite-ignore */
549
549
  /* webpackIgnore: true */
@@ -551,17 +551,17 @@ const P = {
551
551
  ).then((c) => {
552
552
  d = c.default, u();
553
553
  }).catch((c) => {
554
- v.emit(t, Y, {
554
+ v.emit(t, Q, {
555
555
  name: "mermaid",
556
556
  message: `Failed to load mermaid module: ${c.message}`,
557
557
  error: c
558
558
  });
559
- })) : _(
559
+ })) : L(
560
560
  "script",
561
561
  {
562
562
  ...m.mermaid?.js,
563
563
  src: a,
564
- id: P.mermaid,
564
+ id: M.mermaid,
565
565
  onload() {
566
566
  d = window.mermaid, u();
567
567
  }
@@ -579,20 +579,20 @@ const P = {
579
579
  Array.from(a).map((y) => (async ($) => {
580
580
  if ($.dataset.closed === "false")
581
581
  return !1;
582
- const C = $.innerText;
583
- let M = X.get(C);
584
- if (!M) {
585
- const T = re();
586
- let E = { svg: "" };
582
+ const I = $.innerText;
583
+ let H = Y.get(I);
584
+ if (!H) {
585
+ const C = ie();
586
+ let P = { svg: "" };
587
587
  try {
588
- E = await d.render(T, C, c), M = await e.sanitizeMermaid(E.svg);
589
- const I = document.createElement("p");
590
- I.className = `${h}-mermaid`, I.setAttribute("data-processed", ""), I.innerHTML = M, I.children[0]?.removeAttribute("height"), X.set(C, I.innerHTML), $.dataset.line !== void 0 && (I.dataset.line = $.dataset.line), $.replaceWith(I);
591
- } catch (I) {
592
- v.emit(t, Y, {
588
+ P = await d.render(C, I, c), H = await e.sanitizeMermaid(P.svg);
589
+ const T = document.createElement("p");
590
+ T.className = `${h}-mermaid`, T.setAttribute("data-processed", ""), T.setAttribute("data-content", I), T.innerHTML = H, T.children[0]?.removeAttribute("height"), Y.set(I, T.innerHTML), $.dataset.line !== void 0 && (T.dataset.line = $.dataset.line), $.replaceWith(T);
591
+ } catch (T) {
592
+ v.emit(t, Q, {
593
593
  name: "mermaid",
594
- message: I.message,
595
- error: I
594
+ message: T.message,
595
+ error: T
596
596
  });
597
597
  }
598
598
  --g === 0 && c.remove();
@@ -601,7 +601,7 @@ const P = {
601
601
  );
602
602
  }
603
603
  } };
604
- }, rt = (e, t) => {
604
+ }, lt = (e, t) => {
605
605
  t = t || {};
606
606
  const r = 3, o = t.marker || "!", n = o.charCodeAt(0), m = o.length;
607
607
  let s = "", d = "";
@@ -619,41 +619,41 @@ const P = {
619
619
  "code",
620
620
  "admonition",
621
621
  (l, a, c, p) => {
622
- let f, g, y, S = !1, $ = l.bMarks[a] + l.tShift[a], C = l.eMarks[a];
622
+ let f, g, y, A = !1, $ = l.bMarks[a] + l.tShift[a], I = l.eMarks[a];
623
623
  if (n !== l.src.charCodeAt($))
624
624
  return !1;
625
- for (f = $ + 1; f <= C && o[(f - $) % m] === l.src[f]; f++)
625
+ for (f = $ + 1; f <= I && o[(f - $) % m] === l.src[f]; f++)
626
626
  ;
627
- const M = Math.floor((f - $) / m);
628
- if (M !== r)
627
+ const H = Math.floor((f - $) / m);
628
+ if (H !== r)
629
629
  return !1;
630
630
  f -= (f - $) % m;
631
- const T = l.src.slice($, f), E = l.src.slice(f, C);
632
- if (u(E), p)
631
+ const C = l.src.slice($, f), P = l.src.slice(f, I);
632
+ if (u(P), p)
633
633
  return !0;
634
- for (g = a; g++, !(g >= c || ($ = l.bMarks[g] + l.tShift[g], C = l.eMarks[g], $ < C && l.sCount[g] < l.blkIndent)); )
634
+ for (g = a; g++, !(g >= c || ($ = l.bMarks[g] + l.tShift[g], I = l.eMarks[g], $ < I && l.sCount[g] < l.blkIndent)); )
635
635
  if (n === l.src.charCodeAt($) && !(l.sCount[g] - l.blkIndent >= 4)) {
636
- for (f = $ + 1; f <= C && o[(f - $) % m] === l.src[f]; f++)
636
+ for (f = $ + 1; f <= I && o[(f - $) % m] === l.src[f]; f++)
637
637
  ;
638
- if (!(Math.floor((f - $) / m) < M) && (f -= (f - $) % m, f = l.skipSpaces(f), !(f < C))) {
639
- S = !0;
638
+ if (!(Math.floor((f - $) / m) < H) && (f -= (f - $) % m, f = l.skipSpaces(f), !(f < I))) {
639
+ A = !0;
640
640
  break;
641
641
  }
642
642
  }
643
- const I = l.parentType, N = l.lineMax;
644
- return l.parentType = "root", l.lineMax = g, y = l.push("admonition_open", "div", 1), y.markup = T, y.block = !0, y.info = s, y.map = [a, g], d && (y = l.push("admonition_title_open", "p", 1), y.markup = T + " " + s, y.map = [a, g], y = l.push("inline", "", 0), y.content = d, y.map = [a, l.line - 1], y.children = [], y = l.push("admonition_title_close", "p", -1), y.markup = T + " " + s), l.md.block.tokenize(l, a + 1, g), y = l.push("admonition_close", "div", -1), y.markup = l.src.slice($, f), y.block = !0, l.parentType = I, l.lineMax = N, l.line = g + (S ? 1 : 0), !0;
643
+ const T = l.parentType, _ = l.lineMax;
644
+ return l.parentType = "root", l.lineMax = g, y = l.push("admonition_open", "div", 1), y.markup = C, y.block = !0, y.info = s, y.map = [a, g], d && (y = l.push("admonition_title_open", "p", 1), y.markup = C + " " + s, y.map = [a, g], y = l.push("inline", "", 0), y.content = d, y.map = [a, l.line - 1], y.children = [], y = l.push("admonition_title_close", "p", -1), y.markup = C + " " + s), l.md.block.tokenize(l, a + 1, g), y = l.push("admonition_close", "div", -1), y.markup = l.src.slice($, f), y.block = !0, l.parentType = T, l.lineMax = _, l.line = g + (A ? 1 : 0), !0;
645
645
  },
646
646
  {
647
647
  alt: ["paragraph", "reference", "blockquote", "list"]
648
648
  }
649
649
  ), e.renderer.rules.admonition_open = i, e.renderer.rules.admonition_title_open = i, e.renderer.rules.admonition_title_close = i, e.renderer.rules.admonition_close = i;
650
- }, Q = (e, t) => {
650
+ }, ee = (e, t) => {
651
651
  const r = e.attrs ? e.attrs.slice() : [];
652
652
  return t.forEach((o) => {
653
653
  const n = e.attrIndex(o[0]);
654
654
  n < 0 ? r.push(o) : (r[n] = r[n].slice(), r[n][1] += ` ${o[1]}`);
655
655
  }), r;
656
- }, lt = (e, t) => {
656
+ }, it = (e, t) => {
657
657
  const r = e.renderer.rules.fence, o = e.utils.unescapeAll, n = /\[(\w*)(?::([\w ]*))?\]/, m = /::(open|close)/, s = (a) => a.info ? o(a.info).trim() : "", d = (a) => {
658
658
  const c = s(a), [p = null, f = ""] = (n.exec(c) || []).slice(1);
659
659
  return [p, f];
@@ -667,91 +667,91 @@ const P = {
667
667
  }, l = (a, c, p, f, g) => {
668
668
  if (a[c].hidden)
669
669
  return "";
670
- const y = t.usedLanguageTextRef.value?.copyCode.text, S = t.customIconRef.value.copy || y, $ = !!t.customIconRef.value.copy, C = `<span class="${h}-collapse-tips">${Ge("collapse-tips", t.customIconRef.value)}</span>`, [M] = d(a[c]);
671
- if (M === null) {
672
- const { open: H, tagContainer: x, tagHeader: Z } = u(a[c]), D = [["class", `${h}-code`]];
673
- H && D.push(["open", ""]);
674
- const xe = {
675
- attrs: Q(a[c], D)
670
+ const y = t.usedLanguageTextRef.value?.copyCode.text, A = t.customIconRef.value.copy || y, $ = !!t.customIconRef.value.copy, I = `<span class="${h}-collapse-tips">${Ue("collapse-tips", t.customIconRef.value)}</span>`, [H] = d(a[c]);
671
+ if (H === null) {
672
+ const { open: k, tagContainer: S, tagHeader: J } = u(a[c]), j = [["class", `${h}-code`]];
673
+ k && j.push(["open", ""]);
674
+ const oe = {
675
+ attrs: ee(a[c], j)
676
676
  };
677
677
  a[c].info = a[c].info.replace(m, "");
678
- const Fe = r(a, c, p, f, g);
678
+ const W = r(a, c, p, f, g);
679
679
  return `
680
- <${x} ${g.renderAttrs(xe)}>
681
- <${Z} class="${h}-code-head">
680
+ <${S} ${g.renderAttrs(oe)}>
681
+ <${J} class="${h}-code-head">
682
682
  <div class="${h}-code-flag"><span></span><span></span><span></span></div>
683
683
  <div class="${h}-code-action">
684
684
  <span class="${h}-code-lang">${e.utils.escapeHtml(a[c].info.trim())}</span>
685
- <span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${S}</span>
685
+ <span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${A}</span>
686
686
  ${t.extraTools instanceof Function ? t.extraTools({ lang: a[c].info.trim() }) : t.extraTools || ""}
687
- ${x === "details" ? C : ""}
687
+ ${S === "details" ? I : ""}
688
688
  </div>
689
- </${Z}>
690
- ${Fe}
691
- </${x}>
689
+ </${J}>
690
+ ${W}
691
+ </${S}>
692
692
  `;
693
693
  }
694
- let T, E, I, N, G = "", j = "", z = "";
695
- const { open: K, tagContainer: W, tagHeader: q } = u(a[c]), L = [["class", `${h}-code`]];
696
- K && L.push(["open", ""]);
697
- const B = {
698
- attrs: Q(a[c], L)
694
+ let C, P, T, _, O = "", B = "", D = "";
695
+ const { open: q, tagContainer: V, tagHeader: z } = u(a[c]), K = [["class", `${h}-code`]];
696
+ q && K.push(["open", ""]);
697
+ const Z = {
698
+ attrs: ee(a[c], K)
699
699
  };
700
- for (let H = c; H < a.length && (T = a[H], [E, I] = d(T), E === M); H++) {
701
- T.info = T.info.replace(n, "").replace(m, ""), T.hidden = !0;
702
- const x = `${h}-codetab-${t.editorId}-${c}-${H - c}`;
703
- N = H - c > 0 ? "" : "checked", G += `
700
+ for (let k = c; k < a.length && (C = a[k], [P, T] = d(C), P === H); k++) {
701
+ C.info = C.info.replace(n, "").replace(m, ""), C.hidden = !0;
702
+ const S = `${h}-codetab-${t.editorId}-${c}-${k - c}`;
703
+ _ = k - c > 0 ? "" : "checked", O += `
704
704
  <li>
705
705
  <input
706
706
  type="radio"
707
- id="label-${h}-codetab-label-1-${t.editorId}-${c}-${H - c}"
707
+ id="label-${h}-codetab-label-1-${t.editorId}-${c}-${k - c}"
708
708
  name="${h}-codetab-label-${t.editorId}-${c}"
709
- class="${x}"
710
- ${N}
709
+ class="${S}"
710
+ ${_}
711
711
  >
712
712
  <label
713
- for="label-${h}-codetab-label-1-${t.editorId}-${c}-${H - c}"
714
- onclick="this.getRootNode().querySelectorAll('.${x}').forEach(e => e.click())"
713
+ for="label-${h}-codetab-label-1-${t.editorId}-${c}-${k - c}"
714
+ onclick="this.getRootNode().querySelectorAll('.${S}').forEach(e => e.click())"
715
715
  >
716
- ${e.utils.escapeHtml(I || i(T))}
716
+ ${e.utils.escapeHtml(T || i(C))}
717
717
  </label>
718
- </li>`, j += `
718
+ </li>`, B += `
719
719
  <div role="tabpanel">
720
720
  <input
721
721
  type="radio"
722
722
  name="${h}-codetab-pre-${t.editorId}-${c}"
723
- class="${x}"
724
- ${N}
723
+ class="${S}"
724
+ ${_}
725
725
  role="presentation">
726
- ${r(a, H, p, f, g)}
727
- </div>`, z += `
726
+ ${r(a, k, p, f, g)}
727
+ </div>`, D += `
728
728
  <input
729
729
  type="radio"
730
730
  name="${h}-codetab-lang-${t.editorId}-${c}"
731
- class="${x}"
732
- ${N}
731
+ class="${S}"
732
+ ${_}
733
733
  role="presentation">
734
- <span class=${h}-code-lang role="note">${e.utils.escapeHtml(i(T))}</span>`;
734
+ <span class=${h}-code-lang role="note">${e.utils.escapeHtml(i(C))}</span>`;
735
735
  }
736
736
  return `
737
- <${W} ${g.renderAttrs(B)}>
738
- <${q} class="${h}-code-head">
737
+ <${V} ${g.renderAttrs(Z)}>
738
+ <${z} class="${h}-code-head">
739
739
  <div class="${h}-code-flag">
740
- <ul class="${h}-codetab-label" role="tablist">${G}</ul>
740
+ <ul class="${h}-codetab-label" role="tablist">${O}</ul>
741
741
  </div>
742
742
  <div class="${h}-code-action">
743
- <span class="${h}-codetab-lang">${z}</span>
744
- <span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${S}</span>
743
+ <span class="${h}-codetab-lang">${D}</span>
744
+ <span class="${h}-copy-button" data-tips="${y}"${$ ? " data-is-icon=true" : ""}>${A}</span>
745
745
  ${t.extraTools instanceof Function ? t.extraTools({ lang: a[c].info.trim() }) : t.extraTools || ""}
746
- ${W === "details" ? C : ""}
746
+ ${V === "details" ? I : ""}
747
747
  </div>
748
- </${q}>
749
- ${j}
750
- </${W}>
748
+ </${z}>
749
+ ${B}
750
+ </${V}>
751
751
  `;
752
752
  };
753
753
  e.renderer.rules.fence = l, e.renderer.rules.code_block = l;
754
- }, it = (e, t) => {
754
+ }, st = (e, t) => {
755
755
  const r = e.renderer.rules.fence.bind(e.renderer.rules);
756
756
  e.renderer.rules.fence = (o, n, m, s, d) => {
757
757
  const i = o[n], u = i.content.trim();
@@ -764,7 +764,7 @@ const P = {
764
764
  }
765
765
  return r(o, n, m, s, d);
766
766
  };
767
- }, st = (e, t) => {
767
+ }, ct = (e, t) => {
768
768
  e.renderer.rules.heading_open = (r, o) => {
769
769
  const n = r[o], m = r[o + 1].children?.reduce((d, i) => d + (["text", "code_inline", "math_inline"].includes(i.type) && i.content || ""), "") || "", s = n.markup.length;
770
770
  return t.headsRef.value.push({
@@ -784,7 +784,7 @@ const P = {
784
784
  })
785
785
  ), e.renderer.renderToken(r, o, t);
786
786
  }, e.renderer.rules.heading_close = (r, o, n, m, s) => s.renderToken(r, o, n);
787
- }, ye = {
787
+ }, be = {
788
788
  block: [
789
789
  { open: "$$", close: "$$" },
790
790
  { open: "\\[", close: "\\]" }
@@ -795,7 +795,7 @@ const P = {
795
795
  { open: "\\[", close: "\\]" },
796
796
  { open: "\\(", close: "\\)" }
797
797
  ]
798
- }, ct = (e) => (t, r) => {
798
+ }, dt = (e) => (t, r) => {
799
799
  const o = e.delimiters;
800
800
  let n, m, s;
801
801
  for (const d of o)
@@ -819,7 +819,7 @@ const P = {
819
819
  return t.pos = n + d.close.length, !0;
820
820
  }
821
821
  return !1;
822
- }, dt = (e) => (t, r, o, n) => {
822
+ }, ut = (e) => (t, r, o, n) => {
823
823
  const m = e.delimiters;
824
824
  let s, d, i, u, l = !1, a = t.bMarks[r] + t.tShift[r], c = t.eMarks[r];
825
825
  for (const p of m)
@@ -834,10 +834,10 @@ const P = {
834
834
  ` : "") + t.getLines(r + 1, i, t.tShift[r], !0) + (d && d.trim() ? d : ""), f.map = [r, t.line], f.markup = p.open, !0;
835
835
  }
836
836
  return !1;
837
- }, ut = (e, { katexRef: t, inlineDelimiters: r, blockDelimiters: o }) => {
837
+ }, mt = (e, { katexRef: t, inlineDelimiters: r, blockDelimiters: o }) => {
838
838
  const n = (s, d, i, u, l) => {
839
839
  const a = s[d], c = {
840
- attrs: Q(a, [["class", `${h}-katex-inline`]])
840
+ attrs: ee(a, [["class", `${h}-katex-inline`]])
841
841
  };
842
842
  if (t.value) {
843
843
  const p = t.value.renderToString(
@@ -851,7 +851,7 @@ const P = {
851
851
  return `<span ${l.renderAttrs(c)}>${a.content}</span>`;
852
852
  }, m = (s, d, i, u, l) => {
853
853
  const a = s[d], c = {
854
- attrs: Q(a, [["class", `${h}-katex-block`]])
854
+ attrs: ee(a, [["class", `${h}-katex-block`]])
855
855
  };
856
856
  if (t.value) {
857
857
  const p = t.value.renderToString(
@@ -868,20 +868,20 @@ const P = {
868
868
  e.inline.ruler.before(
869
869
  "escape",
870
870
  "math_inline",
871
- ct({
872
- delimiters: r || ye.inline
871
+ dt({
872
+ delimiters: r || be.inline
873
873
  })
874
874
  ), e.block.ruler.after(
875
875
  "blockquote",
876
876
  "math_block",
877
- dt({
878
- delimiters: o || ye.block
877
+ ut({
878
+ delimiters: o || be.block
879
879
  }),
880
880
  {
881
881
  alt: ["paragraph", "reference", "blockquote", "list"]
882
882
  }
883
883
  ), e.renderer.rules.math_inline = n, e.renderer.rules.math_block = m;
884
- }, mt = (e, t) => {
884
+ }, ft = (e, t) => {
885
885
  const r = e.renderer.rules.fence.bind(e.renderer.rules);
886
886
  e.renderer.rules.fence = (o, n, m, s, d) => {
887
887
  const i = o[n], u = i.content.trim();
@@ -890,77 +890,74 @@ const P = {
890
890
  const a = i.map[1] - 1, p = !!s.srcLines[a]?.trim()?.startsWith("```");
891
891
  i.attrSet("data-closed", `${p}`), i.attrSet("data-line", String(i.map[0]));
892
892
  }
893
- const l = X.get(u);
894
- return l ? (i.attrSet("data-processed", ""), `<p ${d.renderAttrs(i)}>${l}</p>`) : `<div ${d.renderAttrs(i)}>${e.utils.escapeHtml(u)}</div>`;
893
+ const l = Y.get(u);
894
+ return l ? (i.attrSet("data-processed", ""), i.attrSet("data-content", u), `<p ${d.renderAttrs(i)}>${l}</p>`) : `<div ${d.renderAttrs(i)}>${e.utils.escapeHtml(u)}</div>`;
895
895
  }
896
896
  return r(o, n, m, s, d);
897
897
  };
898
- }, be = (e, t, r) => {
898
+ }, $e = (e, t, r) => {
899
899
  const o = e.attrIndex(t), n = [t, r];
900
900
  o < 0 ? e.attrPush(n) : (e.attrs = e.attrs || [], e.attrs[o] = n);
901
- }, ft = (e) => e.type === "inline", ht = (e) => e.type === "paragraph_open", pt = (e) => e.type === "list_item_open", gt = (e) => e.content.indexOf("[ ] ") === 0 || e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0, vt = (e, t) => ft(e[t]) && ht(e[t - 1]) && pt(e[t - 2]) && gt(e[t]), yt = (e, t) => {
901
+ }, ht = (e) => e.type === "inline", pt = (e) => e.type === "paragraph_open", gt = (e) => e.type === "list_item_open", vt = (e) => e.content.indexOf("[ ] ") === 0 || e.content.indexOf("[x] ") === 0 || e.content.indexOf("[X] ") === 0, yt = (e, t) => ht(e[t]) && pt(e[t - 1]) && gt(e[t - 2]) && vt(e[t]), bt = (e, t) => {
902
902
  const r = e[t].level - 1;
903
903
  for (let o = t - 1; o >= 0; o--)
904
904
  if (e[o].level === r)
905
905
  return o;
906
906
  return -1;
907
- }, bt = (e) => {
907
+ }, $t = (e) => {
908
908
  const t = new e("html_inline", "", 0);
909
909
  return t.content = "<label>", t;
910
- }, $t = (e) => {
910
+ }, wt = (e) => {
911
911
  const t = new e("html_inline", "", 0);
912
912
  return t.content = "</label>", t;
913
- }, wt = (e, t, r) => {
913
+ }, Ct = (e, t, r) => {
914
914
  const o = new r("html_inline", "", 0);
915
915
  return o.content = '<label class="task-list-item-label" for="' + t + '">' + e + "</label>", o.attrs = [["for", t]], o;
916
916
  }, kt = (e, t, r) => {
917
917
  const o = new t("html_inline", "", 0), n = r.enabled ? " " : ' disabled="" ';
918
918
  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;
919
- }, Ct = (e, t, r) => {
919
+ }, Et = (e, t, r) => {
920
920
  if (e.children = e.children || [], e.children.unshift(kt(e, t, r)), e.children[1].content = e.children[1].content.slice(3), e.content = e.content.slice(3), r.label)
921
921
  if (r.labelAfter) {
922
922
  e.children.pop();
923
923
  const o = "task-item-" + Math.ceil(Math.random() * (1e4 * 1e3) - 1e3);
924
- e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + o + '">', e.children.push(wt(e.content, o, t));
924
+ e.children[0].content = e.children[0].content.slice(0, -1) + ' id="' + o + '">', e.children.push(Ct(e.content, o, t));
925
925
  } else
926
- e.children.unshift(bt(t)), e.children.push($t(t));
926
+ e.children.unshift($t(t)), e.children.push(wt(t));
927
927
  }, It = (e, t = {}) => {
928
928
  e.core.ruler.after("inline", "github-task-lists", (r) => {
929
929
  const o = r.tokens;
930
930
  for (let n = 2; n < o.length; n++)
931
- vt(o, n) && (Ct(o[n], r.Token, t), be(
931
+ yt(o, n) && (Et(o[n], r.Token, t), $e(
932
932
  o[n - 2],
933
933
  "class",
934
934
  "task-list-item" + (t.enabled ? " enabled" : " ")
935
- ), be(o[yt(o, n - 2)], "class", "contains-task-list"));
935
+ ), $e(o[bt(o, n - 2)], "class", "contains-task-list"));
936
936
  });
937
937
  }, Tt = (e) => {
938
938
  e.core.ruler.push("init-line-number", (t) => (t.tokens.forEach((r) => {
939
939
  r.map && (r.attrs || (r.attrs = []), r.attrs.push(["data-line", r.map[0].toString()]));
940
940
  }), !0));
941
- }, Et = (e, t) => {
941
+ }, St = (e, t) => {
942
942
  const { editorConfig: r, markdownItConfig: o, markdownItPlugins: n, editorExtensions: m } = R, s = b("editorId"), d = b("language"), i = b(
943
943
  "usedLanguageText"
944
- ), u = b("showCodeRowNumber"), l = b("theme"), a = b("customIcon"), c = b("rootRef"), p = b("setting"), f = V([]);
945
- let g = () => {
946
- };
947
- const y = nt(e), S = ot(e), { reRenderRef: $, replaceMermaid: C } = at(e), { reRenderEcharts: M, replaceEcharts: T } = tt(e), E = We({
944
+ ), u = b("showCodeRowNumber"), l = b("theme"), a = b("customIcon"), c = b("rootRef"), p = b("setting"), f = U([]), g = ot(e), y = at(e), { reRenderRef: A, replaceMermaid: $ } = rt(e), { reRenderEcharts: I, replaceEcharts: H } = nt(e), C = qe({
948
945
  html: !0,
949
946
  breaks: !0,
950
947
  linkify: !0
951
948
  });
952
- o(E, {
949
+ o(C, {
953
950
  editorId: s
954
951
  });
955
- const I = [
952
+ const P = [
956
953
  {
957
954
  type: "image",
958
- plugin: qe,
955
+ plugin: Ke,
959
956
  options: { figcaption: !0, classes: "md-zoom" }
960
957
  },
961
958
  {
962
959
  type: "admonition",
963
- plugin: rt,
960
+ plugin: lt,
964
961
  options: {}
965
962
  },
966
963
  {
@@ -970,12 +967,12 @@ const P = {
970
967
  },
971
968
  {
972
969
  type: "heading",
973
- plugin: st,
970
+ plugin: ct,
974
971
  options: { mdHeadingId: e.mdHeadingId, headsRef: f }
975
972
  },
976
973
  {
977
974
  type: "code",
978
- plugin: lt,
975
+ plugin: it,
979
976
  options: {
980
977
  editorId: s,
981
978
  usedLanguageTextRef: i,
@@ -987,136 +984,131 @@ const P = {
987
984
  },
988
985
  {
989
986
  type: "sub",
990
- plugin: Ke,
987
+ plugin: Ze,
991
988
  options: {}
992
989
  },
993
990
  {
994
991
  type: "sup",
995
- plugin: Ze,
992
+ plugin: Je,
996
993
  options: {}
997
994
  }
998
995
  ];
999
- e.noKatex || I.push({
996
+ e.noKatex || P.push({
1000
997
  type: "katex",
1001
- plugin: ut,
1002
- options: { katexRef: S }
1003
- }), e.noMermaid || I.push({
1004
- type: "mermaid",
1005
998
  plugin: mt,
999
+ options: { katexRef: y }
1000
+ }), e.noMermaid || P.push({
1001
+ type: "mermaid",
1002
+ plugin: ft,
1006
1003
  options: { themeRef: l }
1007
- }), e.noEcharts || I.push({
1004
+ }), e.noEcharts || P.push({
1008
1005
  type: "echarts",
1009
- plugin: it,
1006
+ plugin: st,
1010
1007
  options: { themeRef: l }
1011
- }), n(I, {
1008
+ }), n(P, {
1012
1009
  editorId: s
1013
- }).forEach((L) => {
1014
- E.use(L.plugin, L.options);
1010
+ }).forEach((k) => {
1011
+ C.use(k.plugin, k.options);
1015
1012
  });
1016
- const N = E.options.highlight;
1017
- E.set({
1018
- highlight: (L, B, H) => {
1019
- if (N) {
1020
- const D = N(L, B, H);
1021
- if (D)
1022
- return D;
1013
+ const T = C.options.highlight;
1014
+ C.set({
1015
+ highlight: (k, S, J) => {
1016
+ if (T) {
1017
+ const W = T(k, S, J);
1018
+ if (W)
1019
+ return W;
1023
1020
  }
1024
- let x;
1025
- !e.noHighlight && y.value ? y.value.getLanguage(B) ? x = y.value.highlight(L, {
1026
- language: B,
1021
+ let j;
1022
+ !e.noHighlight && g.value ? g.value.getLanguage(S) ? j = g.value.highlight(k, {
1023
+ language: S,
1027
1024
  ignoreIllegals: !0
1028
- }).value : x = y.value.highlightAuto(L).value : x = E.utils.escapeHtml(L);
1029
- const Z = u ? Je(
1030
- x.replace(/^\n+|\n+$/g, ""),
1031
- L.replace(/^\n+|\n+$/g, "")
1032
- ) : `<span class="${h}-code-block">${x.replace(/^\n+|\n+$/g, "")}</span>`;
1033
- return `<pre><code class="language-${B}" language=${B}>${Z}</code></pre>`;
1025
+ }).value : j = g.value.highlightAuto(k).value : j = C.utils.escapeHtml(k);
1026
+ const oe = u ? Xe(
1027
+ j.replace(/^\n+|\n+$/g, ""),
1028
+ k.replace(/^\n+|\n+$/g, "")
1029
+ ) : `<span class="${h}-code-block">${j.replace(/^\n+|\n+$/g, "")}</span>`;
1030
+ return `<pre><code class="language-${S}" language=${S}>${oe}</code></pre>`;
1034
1031
  }
1035
- }), Tt(E);
1036
- const G = V(`_article-key_${re()}`), j = V(
1032
+ }), Tt(C);
1033
+ const _ = U(`_article-key_${ie()}`), O = U(
1037
1034
  e.sanitize(
1038
- E.render(e.modelValue, {
1035
+ C.render(e.modelValue, {
1039
1036
  srcLines: e.modelValue.split(`
1040
1037
  `)
1041
1038
  })
1042
1039
  )
1043
- ), z = () => {
1044
- v.emit(s, J, j.value), e.onHtmlChanged(j.value), e.onGetCatalog(f.value), v.emit(s, ne, f.value), U(() => {
1045
- C().then(() => {
1046
- m.mermaid?.enableZoom && (g(), g = ve(
1047
- c.value?.querySelectorAll(
1048
- `#${s} p.${h}-mermaid:not([data-closed=false])`
1049
- ),
1050
- {
1051
- customIcon: a.value
1052
- }
1053
- ));
1054
- }), T();
1040
+ );
1041
+ let B = () => {
1042
+ }, D = () => {
1043
+ };
1044
+ const q = () => {
1045
+ const k = c.value?.querySelectorAll(
1046
+ `#${s} p.${h}-mermaid:not([data-closed=false])`
1047
+ );
1048
+ D(), D = Ge(k, {
1049
+ customIcon: a.value
1050
+ }), m.mermaid?.enableZoom && (B(), B = ze(k, {
1051
+ customIcon: a.value
1052
+ }));
1053
+ }, V = () => {
1054
+ v.emit(s, X, O.value), e.onHtmlChanged(O.value), e.onGetCatalog(f.value), v.emit(s, ae, f.value), G(() => {
1055
+ $().then(q), H();
1055
1056
  });
1056
- }, K = () => {
1057
- f.value = [], j.value = e.sanitize(
1058
- E.render(e.modelValue, {
1057
+ }, z = () => {
1058
+ f.value = [], O.value = e.sanitize(
1059
+ C.render(e.modelValue, {
1059
1060
  srcLines: e.modelValue.split(`
1060
1061
  `)
1061
1062
  })
1062
1063
  );
1063
- }, W = F(() => (e.noKatex || !!S.value) && (e.noHighlight || !!y.value));
1064
- let q = -1;
1065
- return w([Re(e, "modelValue"), W, $, d], () => {
1066
- q = window.setTimeout(
1064
+ }, K = x(() => (e.noKatex || !!y.value) && (e.noHighlight || !!g.value));
1065
+ let Z = -1;
1066
+ return w([Ae(e, "modelValue"), K, A, d], () => {
1067
+ Z = window.setTimeout(
1067
1068
  () => {
1068
- K();
1069
+ z();
1069
1070
  },
1070
1071
  t ? 0 : r.renderDelay
1071
1072
  );
1072
1073
  }), w(
1073
1074
  () => p.value.preview,
1074
1075
  () => {
1075
- p.value.preview && U(() => {
1076
- C().then(() => {
1077
- m.mermaid?.enableZoom && (g(), g = ve(
1078
- c.value?.querySelectorAll(
1079
- `#${s} p.${h}-mermaid:not([data-closed=false])`
1080
- ),
1081
- {
1082
- customIcon: a.value
1083
- }
1084
- ));
1085
- }), T(), v.emit(s, ne, f.value);
1076
+ p.value.preview && G(() => {
1077
+ $().then(q), H(), v.emit(s, ae, f.value);
1086
1078
  });
1087
1079
  }
1088
- ), w([j, M], () => {
1089
- z();
1090
- }), A(z), A(() => {
1080
+ ), w([O, I], () => {
1081
+ V();
1082
+ }), F(V), F(() => {
1091
1083
  v.on(s, {
1092
- name: De,
1084
+ name: Be,
1093
1085
  callback() {
1094
- v.emit(s, ne, f.value);
1086
+ v.emit(s, ae, f.value);
1095
1087
  }
1096
1088
  }), v.on(s, {
1097
- name: se,
1089
+ name: de,
1098
1090
  callback: () => {
1099
- G.value = `_article-key_${re()}`, K();
1091
+ _.value = `_article-key_${ie()}`, z();
1100
1092
  }
1101
1093
  });
1102
- }), te(() => {
1103
- g(), clearTimeout(q);
1104
- }), { html: j, key: G };
1105
- }, St = (e, t) => {
1106
- const r = b("editorId"), o = b("setting"), { noImgZoomIn: n } = e, m = Le(() => {
1094
+ }), ne(() => {
1095
+ B(), D(), clearTimeout(Z);
1096
+ }), { html: O, key: _ };
1097
+ }, xt = (e, t) => {
1098
+ const r = b("editorId"), o = b("setting"), { noImgZoomIn: n } = e, m = Me(() => {
1107
1099
  const s = document.querySelectorAll(
1108
1100
  `#${r}-preview img:not(.not-zoom):not(.medium-zoom-image)`
1109
1101
  );
1110
- s.length !== 0 && Ye(s, {
1102
+ s.length !== 0 && Qe(s, {
1111
1103
  background: "#00000073"
1112
1104
  });
1113
1105
  });
1114
- A(async () => {
1106
+ F(async () => {
1115
1107
  !n && o.value.preview && await m();
1116
1108
  }), w([t, () => o.value.preview], async () => {
1117
1109
  !n && o.value.preview && await m();
1118
1110
  });
1119
- }, $e = {
1111
+ }, we = {
1120
1112
  checked: {
1121
1113
  regexp: /- \[x\]/,
1122
1114
  value: "- [ ]"
@@ -1125,7 +1117,7 @@ const P = {
1125
1117
  regexp: /- \[\s\]/,
1126
1118
  value: "- [x]"
1127
1119
  }
1128
- }, xt = (e, t) => {
1120
+ }, Ft = (e, t) => {
1129
1121
  const r = b("editorId"), o = b("rootRef");
1130
1122
  let n = () => {
1131
1123
  };
@@ -1139,11 +1131,11 @@ const P = {
1139
1131
  return;
1140
1132
  const a = Number(l), c = e.modelValue.split(`
1141
1133
  `), p = c[Number(a)].replace(
1142
- $e[u].regexp,
1143
- $e[u].value
1134
+ we[u].regexp,
1135
+ we[u].value
1144
1136
  );
1145
1137
  e.previewOnly ? (c[Number(a)] = p, e.onChange(c.join(`
1146
- `))) : v.emit(r, Ve, a + 1, p);
1138
+ `))) : v.emit(r, De, a + 1, p);
1147
1139
  };
1148
1140
  s.forEach((i) => {
1149
1141
  i.addEventListener("click", d);
@@ -1153,26 +1145,26 @@ const P = {
1153
1145
  });
1154
1146
  };
1155
1147
  };
1156
- te(() => {
1148
+ ne(() => {
1157
1149
  n();
1158
1150
  }), w(
1159
1151
  [t],
1160
1152
  () => {
1161
- n(), U(m);
1153
+ n(), G(m);
1162
1154
  },
1163
1155
  {
1164
1156
  immediate: !0
1165
1157
  }
1166
1158
  );
1167
- }, Ft = (e, t, r) => {
1159
+ }, At = (e, t, r) => {
1168
1160
  const o = b("setting"), n = () => {
1169
- U(() => {
1161
+ G(() => {
1170
1162
  e.onRemount?.();
1171
1163
  });
1172
1164
  }, m = (s) => {
1173
1165
  s && n();
1174
1166
  };
1175
- w([t, r], n), w(() => o.value.preview, m), w(() => o.value.htmlPreview, m), A(n);
1167
+ w([t, r], n), w(() => o.value.preview, m), w(() => o.value.htmlPreview, m), F(n);
1176
1168
  }, Te = {
1177
1169
  modelValue: {
1178
1170
  type: String,
@@ -1240,7 +1232,7 @@ const P = {
1240
1232
  noEcharts: {
1241
1233
  type: Boolean
1242
1234
  }
1243
- }, tn = {
1235
+ }, nn = {
1244
1236
  ...Te,
1245
1237
  updateModelValue: {
1246
1238
  type: Function,
@@ -1309,10 +1301,10 @@ const P = {
1309
1301
  catalogMaxDepth: {
1310
1302
  type: Number
1311
1303
  }
1312
- }, At = (e) => {
1304
+ }, Rt = (e) => {
1313
1305
  const r = new DOMParser().parseFromString(e, "text/html");
1314
1306
  return Array.from(r.body.childNodes);
1315
- }, Rt = (e, t) => {
1307
+ }, Ht = (e, t) => {
1316
1308
  const r = [], o = [];
1317
1309
  if (e.forEach((n, m) => {
1318
1310
  const s = t[m];
@@ -1334,7 +1326,7 @@ const P = {
1334
1326
  updates: r,
1335
1327
  deletes: o
1336
1328
  };
1337
- }, we = /* @__PURE__ */ ie({
1329
+ }, Ce = /* @__PURE__ */ ce({
1338
1330
  name: "UpdateOnDemand",
1339
1331
  props: {
1340
1332
  html: {
@@ -1343,7 +1335,7 @@ const P = {
1343
1335
  }
1344
1336
  },
1345
1337
  setup(e) {
1346
- const t = b("editorId"), r = b("previewTheme"), o = b("showCodeRowNumber"), n = V(), m = e.html, s = (d, i) => {
1338
+ const t = b("editorId"), r = b("previewTheme"), o = b("showCodeRowNumber"), n = U(), m = e.html, s = (d, i) => {
1347
1339
  n.value && (i.forEach((u) => {
1348
1340
  u.remove();
1349
1341
  }), d.forEach(({
@@ -1355,45 +1347,45 @@ const P = {
1355
1347
  }));
1356
1348
  };
1357
1349
  return w(() => e.html, (d) => {
1358
- const i = At(d), u = Array.from(n.value?.childNodes || []), {
1350
+ const i = Rt(d), u = Array.from(n.value?.childNodes || []), {
1359
1351
  updates: l,
1360
1352
  deletes: a
1361
- } = Rt(i, u);
1353
+ } = Ht(i, u);
1362
1354
  s(l, a);
1363
- }), () => O("div", {
1355
+ }), () => N("div", {
1364
1356
  id: `${t}-preview`,
1365
1357
  class: [`${h}-preview`, `${r?.value}-theme`, o && `${h}-scrn`],
1366
1358
  innerHTML: m,
1367
1359
  ref: n
1368
1360
  }, null);
1369
1361
  }
1370
- }), Ht = /* @__PURE__ */ ie({
1362
+ }), Pt = /* @__PURE__ */ ce({
1371
1363
  name: "ContentPreview",
1372
1364
  props: Te,
1373
1365
  setup(e) {
1374
1366
  const t = b("editorId"), r = b("setting"), {
1375
1367
  html: o,
1376
1368
  key: n
1377
- } = Et(e, e.previewOnly);
1378
- return et(e, o, n), St(e, o), xt(e, o), Ft(e, o, n), () => O(He, null, [r.value.preview && (e.previewOnly ? O(we, {
1369
+ } = St(e, e.previewOnly);
1370
+ return tt(e, o, n), xt(e, o), Ft(e, o), At(e, o, n), () => N(Re, null, [r.value.preview && (e.previewOnly ? N(Ce, {
1379
1371
  key: n.value,
1380
1372
  html: o.value
1381
- }, null) : O("div", {
1373
+ }, null) : N("div", {
1382
1374
  id: `${t}-preview-wrapper`,
1383
1375
  class: `${h}-preview-wrapper`,
1384
1376
  key: "content-preview-wrapper"
1385
- }, [O(we, {
1377
+ }, [N(Ce, {
1386
1378
  key: n.value,
1387
1379
  html: o.value
1388
- }, null)])), r.value.htmlPreview && O("div", {
1380
+ }, null)])), r.value.htmlPreview && N("div", {
1389
1381
  id: `${t}-html-wrapper`,
1390
1382
  class: `${h}-preview-wrapper`,
1391
1383
  key: "html-preview-wrapper"
1392
- }, [O("div", {
1384
+ }, [N("div", {
1393
1385
  class: `${h}-html`
1394
1386
  }, [o.value])])]);
1395
1387
  }
1396
- }), Pt = ({ text: e }) => e, Ee = {
1388
+ }), Mt = ({ text: e }) => e, Se = {
1397
1389
  /**
1398
1390
  * markdown content.
1399
1391
  *
@@ -1502,7 +1494,7 @@ const P = {
1502
1494
  */
1503
1495
  mdHeadingId: {
1504
1496
  type: Function,
1505
- default: Pt
1497
+ default: Mt
1506
1498
  },
1507
1499
  /**
1508
1500
  *
@@ -1627,8 +1619,8 @@ const P = {
1627
1619
  type: Boolean,
1628
1620
  default: !1
1629
1621
  }
1630
- }, nn = {
1631
- ...Ee,
1622
+ }, on = {
1623
+ ...Se,
1632
1624
  /**
1633
1625
  * input回调事件
1634
1626
  */
@@ -1688,7 +1680,7 @@ const P = {
1688
1680
  */
1689
1681
  toolbars: {
1690
1682
  type: Array,
1691
- default: Ne
1683
+ default: _e
1692
1684
  },
1693
1685
  /**
1694
1686
  * 浮动工具栏
@@ -1766,7 +1758,7 @@ const P = {
1766
1758
  */
1767
1759
  footers: {
1768
1760
  type: Array,
1769
- default: _e
1761
+ default: Le
1770
1762
  },
1771
1763
  /**
1772
1764
  * 是否默认激活输入框和预览框同步滚动
@@ -1933,14 +1925,14 @@ const P = {
1933
1925
  type: Number,
1934
1926
  default: void 0
1935
1927
  }
1936
- }, Se = [
1928
+ }, xe = [
1937
1929
  "onHtmlChanged",
1938
1930
  "onGetCatalog",
1939
1931
  "onChange",
1940
1932
  "onRemount",
1941
1933
  "update:modelValue"
1942
- ], on = [
1943
- ...Se,
1934
+ ], an = [
1935
+ ...xe,
1944
1936
  "onSave",
1945
1937
  "onUploadImg",
1946
1938
  "onError",
@@ -1949,36 +1941,36 @@ const P = {
1949
1941
  "onInput",
1950
1942
  "onDrop",
1951
1943
  "oninputBoxWidthChange"
1952
- ], Mt = (e, t, r) => {
1944
+ ], Lt = (e, t, r) => {
1953
1945
  const { editorId: o } = r, n = {
1954
1946
  rerender() {
1955
- v.emit(o, se);
1947
+ v.emit(o, de);
1956
1948
  }
1957
1949
  };
1958
1950
  t.expose(n);
1959
- }, oe = /* @__PURE__ */ ie({
1951
+ }, re = /* @__PURE__ */ ce({
1960
1952
  name: "MdPreview",
1961
- props: Ee,
1962
- emits: Se,
1953
+ props: Se,
1954
+ emits: xe,
1963
1955
  setup(e, t) {
1964
1956
  const {
1965
1957
  noKatex: r,
1966
1958
  noMermaid: o,
1967
1959
  noHighlight: n
1968
- } = e, m = V(), s = Qe(e);
1960
+ } = e, m = U(), s = et(e);
1969
1961
  return Ie(e, {
1970
1962
  rootRef: m,
1971
1963
  editorId: s
1972
- }), Mt(e, t, {
1964
+ }), Lt(e, t, {
1973
1965
  editorId: s
1974
- }), te(() => {
1966
+ }), ne(() => {
1975
1967
  v.clear(s);
1976
- }), () => O("div", {
1968
+ }), () => N("div", {
1977
1969
  id: s,
1978
1970
  class: [h, e.class, e.theme === "dark" && `${h}-dark`, `${h}-previewOnly`],
1979
1971
  style: e.style,
1980
1972
  ref: m
1981
- }, [O(Ht, {
1973
+ }, [N(Pt, {
1982
1974
  modelValue: e.modelValue,
1983
1975
  onChange: (d) => {
1984
1976
  e.onChange?.(d), t.emit("onChange", d), t.emit("update:modelValue", d);
@@ -2007,20 +1999,20 @@ const P = {
2007
1999
  }, null)]);
2008
2000
  }
2009
2001
  });
2010
- oe.install = (e) => (e.component(oe.name, oe), e);
2002
+ re.install = (e) => (e.component(re.name, re), e);
2011
2003
  export {
2012
- P as C,
2013
- oe as M,
2014
- Ht as a,
2015
- nn as b,
2016
- tn as c,
2017
- Yt as d,
2018
- on as e,
2019
- Qt as f,
2020
- Kt as g,
2021
- Jt as h,
2022
- Xt as i,
2023
- en as j,
2024
- Zt as k,
2025
- Qe as u
2004
+ M as C,
2005
+ re as M,
2006
+ Pt as a,
2007
+ on as b,
2008
+ nn as c,
2009
+ Qt as d,
2010
+ an as e,
2011
+ en as f,
2012
+ Zt as g,
2013
+ Xt as h,
2014
+ Yt as i,
2015
+ tn as j,
2016
+ Jt as k,
2017
+ et as u
2026
2018
  };