md-editor-v3 4.3.0-beta.4 → 4.3.0-beta.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,41 +1,41 @@
1
1
  var wt = Object.defineProperty;
2
- var xt = (e, r, l) => r in e ? wt(e, r, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[r] = l;
3
- var K = (e, r, l) => (xt(e, typeof r != "symbol" ? r + "" : r, l), l);
4
- import { defineComponent as O, createVNode as t, inject as A, ref as q, onMounted as Y, reactive as J, computed as he, watch as H, nextTick as ce, Fragment as kt, cloneVNode as at, toRef as le, shallowRef as St, onBeforeUnmount as At } from "vue";
5
- import { p as o, a as z, s as Mt, b as Lt, d as It } from "./chunks/config.mjs";
6
- import { draggingScroll as Dt, linkTo as Nt, debounce as Et, throttle as Ht, smoothScroll as rt } from "@vavt/util";
2
+ var xt = (e, a, l) => a in e ? wt(e, a, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[a] = l;
3
+ var K = (e, a, l) => (xt(e, typeof a != "symbol" ? a + "" : a, l), l);
4
+ import { defineComponent as V, createVNode as t, inject as A, ref as q, onMounted as Y, reactive as J, computed as he, watch as H, nextTick as ce, Fragment as kt, cloneVNode as at, toRef as le, shallowRef as St, onBeforeUnmount as At } from "vue";
5
+ import { p as o, a as z, s as Mt, b as Lt, d as Dt } from "./chunks/config.mjs";
6
+ import { draggingScroll as It, linkTo as Nt, debounce as Et, throttle as Ht, smoothScroll as nt } from "@vavt/util";
7
7
  import { a as te, D as Bt } from "./chunks/index2.mjs";
8
8
  import { b as h, a as Ft } from "./chunks/index3.mjs";
9
- import { C as Ot, a as Vt, O as pt, T as Rt, b as Pt, e as qt, c as Ut, u as Gt, d as Kt, f as jt, g as _t, h as Wt, i as zt, M as Yt } from "./chunks/index.mjs";
10
- import { a as Zt } from "./chunks/dom.mjs";
9
+ import { C as Vt, a as Ot, O as pt, T as Rt, b as Pt, e as qt, c as Ut, u as Gt, d as Kt, f as jt, g as _t, h as Wt, i as zt, j as Yt, M as Zt } from "./chunks/index.mjs";
10
+ import { a as Jt } from "./chunks/dom.mjs";
11
11
  import Ct from "./MdModal.mjs";
12
- import { minimalSetup as Jt, EditorView as ie } from "codemirror";
13
- import { EditorView as be, placeholder as Xt, keymap as Qt } from "@codemirror/view";
14
- import { languages as el } from "@codemirror/language-data";
15
- import { markdown as tl } from "@codemirror/lang-markdown";
16
- import { htmlCompletionSource as ll, html as ol } from "@codemirror/lang-html";
17
- import { deleteLine as al, indentWithTab as rl, undo as nl, redo as il } from "@codemirror/commands";
18
- import { HighlightStyle as $t, syntaxHighlighting as yt, indentUnit as sl } from "@codemirror/language";
12
+ import { minimalSetup as Xt, EditorView as ie } from "codemirror";
13
+ import { EditorView as be, placeholder as Qt, keymap as el } from "@codemirror/view";
14
+ import { languages as tl } from "@codemirror/language-data";
15
+ import { markdown as ll } from "@codemirror/lang-markdown";
16
+ import { htmlCompletionSource as ol, html as al } from "@codemirror/lang-html";
17
+ import { deleteLine as nl, indentWithTab as rl, undo as il, redo as sl } from "@codemirror/commands";
18
+ import { HighlightStyle as $t, syntaxHighlighting as yt, indentUnit as cl } from "@codemirror/language";
19
19
  import { tags as s } from "@lezer/highlight";
20
- import { EditorSelection as P, EditorState as ue, Compartment as cl, StateEffect as dl } from "@codemirror/state";
21
- import { autocompletion as ul } from "@codemirror/autocomplete";
20
+ import { EditorSelection as P, EditorState as ue, Compartment as dl, StateEffect as ul } from "@codemirror/state";
21
+ import { autocompletion as ml } from "@codemirror/autocomplete";
22
22
  import Tt from "./MdCatalog.mjs";
23
- import { g as nt } from "./chunks/vue-tsx.mjs";
24
- import ml from "./NormalToolbar.mjs";
25
- import fl from "./ModalToolbar.mjs";
23
+ import { g as rt } from "./chunks/vue-tsx.mjs";
24
+ import fl from "./NormalToolbar.mjs";
25
+ import gl from "./ModalToolbar.mjs";
26
26
  import "medium-zoom";
27
27
  import "copy-to-clipboard";
28
28
  import "markdown-it";
29
29
  import "markdown-it-image-figures";
30
30
  import "markdown-it-task-lists";
31
31
  import "lru-cache";
32
- const gl = /* @__PURE__ */ O({
32
+ const hl = /* @__PURE__ */ V({
33
33
  setup() {
34
34
  return () => t("div", {
35
35
  class: `${o}-divider`
36
36
  }, null);
37
37
  }
38
- }), hl = {
38
+ }), bl = {
39
39
  noPrettier: {
40
40
  type: Boolean
41
41
  },
@@ -84,22 +84,22 @@ const gl = /* @__PURE__ */ O({
84
84
  showToolbarName: {
85
85
  type: Boolean
86
86
  }
87
- }, bl = (e) => {
88
- var c, m, f, b;
89
- const r = A("editorId");
90
- let l = (m = (c = z.editorExtensions) == null ? void 0 : c.screenfull) == null ? void 0 : m.instance;
91
- const a = (b = (f = z.editorExtensions) == null ? void 0 : f.screenfull) == null ? void 0 : b.js, n = q(!1), i = ($) => {
87
+ }, vl = (e) => {
88
+ var c, f, m, b;
89
+ const a = A("editorId");
90
+ let l = (f = (c = z.editorExtensions) == null ? void 0 : c.screenfull) == null ? void 0 : f.instance;
91
+ const n = (b = (m = z.editorExtensions) == null ? void 0 : m.screenfull) == null ? void 0 : b.js, r = q(!1), i = ($) => {
92
92
  if (!l) {
93
- h.emit(r, "errorCatcher", {
93
+ h.emit(a, "errorCatcher", {
94
94
  name: "fullscreen",
95
95
  message: "fullscreen is undefined"
96
96
  });
97
97
  return;
98
98
  }
99
- l.isEnabled ? (n.value = !0, ($ === void 0 ? !l.isFullscreen : $) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
+ l.isEnabled ? (r.value = !0, ($ === void 0 ? !l.isFullscreen : $) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
100
100
  }, u = () => {
101
101
  l && l.isEnabled && l.on("change", () => {
102
- (n.value || e.setting.fullscreen) && (n.value = !1, e.updateSetting("fullscreen"));
102
+ (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
103
103
  });
104
104
  }, d = () => {
105
105
  l = window.screenfull, u();
@@ -107,15 +107,15 @@ const gl = /* @__PURE__ */ O({
107
107
  return Y(() => {
108
108
  if (u(), !l) {
109
109
  const $ = document.createElement("script");
110
- $.src = a || Mt, $.onload = d, $.id = `${o}-screenfull`, Zt($, "screenfull");
110
+ $.src = n || Mt, $.onload = d, $.id = `${o}-screenfull`, Jt($, "screenfull");
111
111
  }
112
112
  }), Y(() => {
113
- h.on(r, {
114
- name: Ot,
113
+ h.on(a, {
114
+ name: Vt,
115
115
  callback: i
116
116
  });
117
117
  }), { fullscreenHandler: i };
118
- }, vl = {
118
+ }, kl = {
119
119
  tableShape: {
120
120
  type: Array,
121
121
  default: () => [6, 4]
@@ -125,36 +125,36 @@ const gl = /* @__PURE__ */ O({
125
125
  default: () => {
126
126
  }
127
127
  }
128
- }, kl = /* @__PURE__ */ O({
128
+ }, pl = /* @__PURE__ */ V({
129
129
  name: "TableShape",
130
- props: vl,
130
+ props: kl,
131
131
  setup(e) {
132
- const r = J({
132
+ const a = J({
133
133
  x: -1,
134
134
  y: -1
135
135
  });
136
136
  return () => t("div", {
137
137
  class: `${o}-table-shape`,
138
138
  onMouseleave: () => {
139
- r.x = -1, r.y = -1;
139
+ a.x = -1, a.y = -1;
140
140
  }
141
- }, [new Array(e.tableShape[1]).fill("").map((l, a) => t("div", {
141
+ }, [new Array(e.tableShape[1]).fill("").map((l, n) => t("div", {
142
142
  class: `${o}-table-shape-row`,
143
- key: `table-shape-row-${a}`
144
- }, [new Array(e.tableShape[0]).fill("").map((n, i) => t("div", {
143
+ key: `table-shape-row-${n}`
144
+ }, [new Array(e.tableShape[0]).fill("").map((r, i) => t("div", {
145
145
  class: `${o}-table-shape-col`,
146
146
  key: `table-shape-col-${i}`,
147
147
  onMouseenter: () => {
148
- r.x = a, r.y = i;
148
+ a.x = n, a.y = i;
149
149
  },
150
150
  onClick: () => {
151
- e.onSelected(r);
151
+ e.onSelected(a);
152
152
  }
153
153
  }, [t("div", {
154
- class: [`${o}-table-shape-col-default`, a <= r.x && i <= r.y && `${o}-table-shape-col-include`]
154
+ class: [`${o}-table-shape-col-default`, n <= a.x && i <= a.y && `${o}-table-shape-col-include`]
155
155
  }, null)]))]))]);
156
156
  }
157
- }), pl = kl, Cl = {
157
+ }), Cl = pl, $l = {
158
158
  type: {
159
159
  type: String,
160
160
  default: "link"
@@ -173,47 +173,47 @@ const gl = /* @__PURE__ */ O({
173
173
  default: () => {
174
174
  }
175
175
  }
176
- }, $l = /* @__PURE__ */ O({
177
- props: Cl,
176
+ }, yl = /* @__PURE__ */ V({
177
+ props: $l,
178
178
  setup(e) {
179
- const r = A("usedLanguageText"), l = A("editorId"), a = he(() => {
179
+ const a = A("usedLanguageText"), l = A("editorId"), n = he(() => {
180
180
  var i, u;
181
181
  switch (e.type) {
182
182
  case "link":
183
- return (i = r.value.linkModalTips) == null ? void 0 : i.linkTitle;
183
+ return (i = a.value.linkModalTips) == null ? void 0 : i.linkTitle;
184
184
  case "image":
185
- return (u = r.value.linkModalTips) == null ? void 0 : u.imageTitle;
185
+ return (u = a.value.linkModalTips) == null ? void 0 : u.imageTitle;
186
186
  default:
187
187
  return "";
188
188
  }
189
- }), n = J({
189
+ }), r = J({
190
190
  desc: "",
191
191
  url: ""
192
192
  });
193
193
  return H(() => e.visible, (i) => {
194
194
  i || setTimeout(() => {
195
- n.desc = "", n.url = "";
195
+ r.desc = "", r.url = "";
196
196
  }, 200);
197
197
  }), () => t(Ct, {
198
- title: a.value,
198
+ title: n.value,
199
199
  visible: e.visible,
200
200
  onClose: e.onCancel
201
201
  }, {
202
202
  default: () => {
203
- var i, u, d, c, m;
203
+ var i, u, d, c, f;
204
204
  return [t("div", {
205
205
  class: `${o}-form-item`
206
206
  }, [t("label", {
207
207
  class: `${o}-label`,
208
208
  for: `link-desc-${l}`
209
- }, [(i = r.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
210
- placeholder: (u = r.value.linkModalTips) == null ? void 0 : u.descLabelPlaceHolder,
209
+ }, [(i = a.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
210
+ placeholder: (u = a.value.linkModalTips) == null ? void 0 : u.descLabelPlaceHolder,
211
211
  class: `${o}-input`,
212
212
  id: `link-desc-${l}`,
213
213
  type: "text",
214
- value: n.desc,
215
- onChange: (f) => {
216
- n.desc = f.target.value;
214
+ value: r.desc,
215
+ onChange: (m) => {
216
+ r.desc = m.target.value;
217
217
  },
218
218
  autocomplete: "off"
219
219
  }, null)]), t("div", {
@@ -221,14 +221,14 @@ const gl = /* @__PURE__ */ O({
221
221
  }, [t("label", {
222
222
  class: `${o}-label`,
223
223
  for: `link-url-${l}`
224
- }, [(d = r.value.linkModalTips) == null ? void 0 : d.urlLabel]), t("input", {
225
- placeholder: (c = r.value.linkModalTips) == null ? void 0 : c.urlLabelPlaceHolder,
224
+ }, [(d = a.value.linkModalTips) == null ? void 0 : d.urlLabel]), t("input", {
225
+ placeholder: (c = a.value.linkModalTips) == null ? void 0 : c.urlLabelPlaceHolder,
226
226
  class: `${o}-input`,
227
227
  id: `link-url-${l}`,
228
228
  type: "text",
229
- value: n.url,
230
- onChange: (f) => {
231
- n.url = f.target.value;
229
+ value: r.url,
230
+ onChange: (m) => {
231
+ r.url = m.target.value;
232
232
  },
233
233
  autocomplete: "off"
234
234
  }, null)]), t("div", {
@@ -237,13 +237,13 @@ const gl = /* @__PURE__ */ O({
237
237
  class: [`${o}-btn`, `${o}-btn-row`],
238
238
  type: "button",
239
239
  onClick: () => {
240
- e.onOk(n), n.desc = "", n.url = "";
240
+ e.onOk(r), r.desc = "", r.url = "";
241
241
  }
242
- }, [(m = r.value.linkModalTips) == null ? void 0 : m.buttonOK])])];
242
+ }, [(f = a.value.linkModalTips) == null ? void 0 : f.buttonOK])])];
243
243
  }
244
244
  });
245
245
  }
246
- }), yl = {
246
+ }), Tl = {
247
247
  visible: {
248
248
  type: Boolean,
249
249
  default: !1
@@ -258,13 +258,13 @@ const gl = /* @__PURE__ */ O({
258
258
  default: () => {
259
259
  }
260
260
  }
261
- }, Tl = /* @__PURE__ */ O({
262
- props: yl,
261
+ }, wl = /* @__PURE__ */ V({
262
+ props: Tl,
263
263
  setup(e) {
264
- var f, b, $;
265
- const r = A("usedLanguageText"), l = A("editorId");
266
- let a = ($ = (b = (f = z) == null ? void 0 : f.editorExtensions) == null ? void 0 : b.cropper) == null ? void 0 : $.instance;
267
- const n = q(), i = q(), u = q(), d = J({
264
+ var m, b, $;
265
+ const a = A("usedLanguageText"), l = A("editorId");
266
+ let n = ($ = (b = (m = z) == null ? void 0 : m.editorExtensions) == null ? void 0 : b.cropper) == null ? void 0 : $.instance;
267
+ const r = q(), i = q(), u = q(), d = J({
268
268
  cropperInited: !1,
269
269
  imgSelected: !1,
270
270
  imgSrc: "",
@@ -273,20 +273,20 @@ const gl = /* @__PURE__ */ O({
273
273
  });
274
274
  let c = null;
275
275
  H(() => e.visible, () => {
276
- e.visible && !d.cropperInited && (a = a || window.Cropper, n.value.onchange = () => {
277
- if (!a) {
276
+ e.visible && !d.cropperInited && (n = n || window.Cropper, r.value.onchange = () => {
277
+ if (!n) {
278
278
  h.emit(l, "errorCatcher", {
279
279
  name: "Cropper",
280
280
  message: "Cropper is undefined"
281
281
  });
282
282
  return;
283
283
  }
284
- const T = n.value.files || [];
284
+ const T = r.value.files || [];
285
285
  if (d.imgSelected = !0, (T == null ? void 0 : T.length) > 0) {
286
286
  const v = new FileReader();
287
287
  v.onload = (g) => {
288
288
  d.imgSrc = g.target.result, ce(() => {
289
- c = new a(i.value, {
289
+ c = new n(i.value, {
290
290
  viewMode: 2,
291
291
  preview: `.${o}-clip-preview-target`
292
292
  // aspectRatio: 16 / 9,
@@ -299,21 +299,21 @@ const gl = /* @__PURE__ */ O({
299
299
  u.value.style = "";
300
300
  }), H(() => d.isFullscreen, () => {
301
301
  ce(() => {
302
- c == null || c.destroy(), u.value.style = "", i.value && (c = new a(i.value, {
302
+ c == null || c.destroy(), u.value.style = "", i.value && (c = new n(i.value, {
303
303
  viewMode: 2,
304
304
  preview: `.${o}-clip-preview-target`
305
305
  // aspectRatio: 16 / 9,
306
306
  }));
307
307
  });
308
308
  });
309
- const m = () => {
310
- c.clear(), c.destroy(), c = null, n.value.value = "", d.imgSelected = !1;
309
+ const f = () => {
310
+ c.clear(), c.destroy(), c = null, r.value.value = "", d.imgSelected = !1;
311
311
  };
312
312
  return () => {
313
313
  var T;
314
314
  return t(Ct, {
315
315
  class: `${o}-modal-clip`,
316
- title: (T = r.value.clipModalTips) == null ? void 0 : T.title,
316
+ title: (T = a.value.clipModalTips) == null ? void 0 : T.title,
317
317
  visible: e.visible,
318
318
  onClose: e.onCancel,
319
319
  showAdjust: !0,
@@ -341,7 +341,7 @@ const gl = /* @__PURE__ */ O({
341
341
  alt: ""
342
342
  }, null), t("div", {
343
343
  class: `${o}-clip-delete`,
344
- onClick: m
344
+ onClick: f
345
345
  }, [t("svg", {
346
346
  class: `${o}-icon`,
347
347
  "aria-hidden": "true"
@@ -350,7 +350,7 @@ const gl = /* @__PURE__ */ O({
350
350
  }, null)])])]) : t("div", {
351
351
  class: `${o}-clip-upload`,
352
352
  onClick: () => {
353
- n.value.click();
353
+ r.value.click();
354
354
  }
355
355
  }, [t("svg", {
356
356
  class: `${o}-icon`,
@@ -370,11 +370,11 @@ const gl = /* @__PURE__ */ O({
370
370
  onClick: () => {
371
371
  if (c) {
372
372
  const k = c.getCroppedCanvas();
373
- h.emit(l, "uploadImage", [Ft(k.toDataURL("image/png"))], e.onOk), m();
373
+ h.emit(l, "uploadImage", [Ft(k.toDataURL("image/png"))], e.onOk), f();
374
374
  }
375
375
  }
376
- }, [((v = r.value.clipModalTips) == null ? void 0 : v.buttonUpload) || ((g = r.value.linkModalTips) == null ? void 0 : g.buttonOK)])]), t("input", {
377
- ref: n,
376
+ }, [((v = a.value.clipModalTips) == null ? void 0 : v.buttonUpload) || ((g = a.value.linkModalTips) == null ? void 0 : g.buttonOK)])]), t("input", {
377
+ ref: r,
378
378
  accept: "image/*",
379
379
  type: "file",
380
380
  multiple: !1,
@@ -386,7 +386,7 @@ const gl = /* @__PURE__ */ O({
386
386
  });
387
387
  };
388
388
  }
389
- }), wl = {
389
+ }), xl = {
390
390
  type: {
391
391
  type: String,
392
392
  default: "link"
@@ -409,27 +409,27 @@ const gl = /* @__PURE__ */ O({
409
409
  default: () => {
410
410
  }
411
411
  }
412
- }, xl = /* @__PURE__ */ O({
413
- props: wl,
412
+ }, Sl = /* @__PURE__ */ V({
413
+ props: xl,
414
414
  setup(e) {
415
- return () => t(kt, null, [t($l, {
415
+ return () => t(kt, null, [t(yl, {
416
416
  type: e.type,
417
417
  visible: e.linkVisible,
418
418
  onOk: e.onOk,
419
419
  onCancel: e.onCancel
420
- }, null), t(Tl, {
420
+ }, null), t(wl, {
421
421
  visible: e.clipVisible,
422
422
  onOk: e.onOk,
423
423
  onCancel: e.onCancel
424
424
  }, null)]);
425
425
  }
426
- }), Sl = /* @__PURE__ */ O({
426
+ }), Al = /* @__PURE__ */ V({
427
427
  name: "MDEditorToolbar",
428
- props: hl,
428
+ props: bl,
429
429
  setup(e) {
430
- const r = A("editorId"), l = A("usedLanguageText"), {
431
- fullscreenHandler: a
432
- } = bl(e), n = `${r}-toolbar-wrapper`, i = q(), u = J({
430
+ const a = A("editorId"), l = A("usedLanguageText"), {
431
+ fullscreenHandler: n
432
+ } = vl(e), r = `${a}-toolbar-wrapper`, i = q(), u = J({
433
433
  title: !1,
434
434
  catalog: !1,
435
435
  // 图片上传下拉
@@ -440,35 +440,35 @@ const gl = /* @__PURE__ */ O({
440
440
  mermaid: !1,
441
441
  katex: !1
442
442
  }), d = (v, g) => {
443
- h.emit(r, "replace", v, g);
443
+ h.emit(a, "replace", v, g);
444
444
  }, c = J({
445
445
  type: "link",
446
446
  linkVisible: !1,
447
447
  clipVisible: !1
448
- }), m = q();
448
+ }), f = q();
449
449
  Y(() => {
450
- h.on(r, {
450
+ h.on(a, {
451
451
  name: "openModals",
452
452
  callback(v) {
453
453
  c.type = v, c.linkVisible = !0;
454
454
  }
455
455
  });
456
456
  });
457
- const f = he(() => {
457
+ const m = he(() => {
458
458
  const v = e.toolbars.filter((w) => !e.toolbarsExclude.includes(w)), g = v.indexOf("="), k = g === -1 ? v : v.slice(0, g + 1), y = g === -1 ? [] : v.slice(g, Number.MAX_SAFE_INTEGER);
459
459
  return [k, y];
460
460
  }), b = q(), $ = () => {
461
- h.emit(r, "uploadImage", Array.from(b.value.files || [])), b.value.value = "";
461
+ h.emit(a, "uploadImage", Array.from(b.value.files || [])), b.value.value = "";
462
462
  };
463
463
  Y(() => {
464
464
  b.value.addEventListener("change", $);
465
465
  });
466
466
  const T = (v) => {
467
- var g, k, y, w, x, L, C, M, R, I, D, V, B, N, j, U, re, X, _, G, Q, W, E, F, ee, ne, ve, ke, pe, Ce, $e, ye, Te, we, xe, Se, Ae, Me, Le, Ie, De, Ne, Ee, He, Be, Fe, Oe, Ve, Re, Pe, qe, Ue, Ge, Ke, je, _e, We, ze, Ye, Ze, Je, Xe, Qe, et, tt, lt, ot;
467
+ var g, k, y, w, x, L, C, M, R, D, I, O, B, N, j, U, ne, X, _, G, Q, W, E, F, ee, re, ve, ke, pe, Ce, $e, ye, Te, we, xe, Se, Ae, Me, Le, De, Ie, Ne, Ee, He, Be, Fe, Ve, Oe, Re, Pe, qe, Ue, Ge, Ke, je, _e, We, ze, Ye, Ze, Je, Xe, Qe, et, tt, lt, ot;
468
468
  if (Lt.includes(v))
469
469
  switch (v) {
470
470
  case "-":
471
- return t(gl, null, null);
471
+ return t(hl, null, null);
472
472
  case "bold":
473
473
  return t("div", {
474
474
  class: `${o}-toolbar-item`,
@@ -531,7 +531,7 @@ const gl = /* @__PURE__ */ O({
531
531
  }, [(M = l.value.toolbarTips) == null ? void 0 : M.strikeThrough])]);
532
532
  case "title":
533
533
  return t(te, {
534
- relative: `#${n}`,
534
+ relative: `#${r}`,
535
535
  visible: u.title,
536
536
  onChange: (p) => {
537
537
  u.title = p;
@@ -551,17 +551,17 @@ const gl = /* @__PURE__ */ O({
551
551
  onClick: () => {
552
552
  d("h2");
553
553
  }
554
- }, [(I = l.value.titleItem) == null ? void 0 : I.h2]), t("li", {
554
+ }, [(D = l.value.titleItem) == null ? void 0 : D.h2]), t("li", {
555
555
  class: `${o}-menu-item`,
556
556
  onClick: () => {
557
557
  d("h3");
558
558
  }
559
- }, [(D = l.value.titleItem) == null ? void 0 : D.h3]), t("li", {
559
+ }, [(I = l.value.titleItem) == null ? void 0 : I.h3]), t("li", {
560
560
  class: `${o}-menu-item`,
561
561
  onClick: () => {
562
562
  d("h4");
563
563
  }
564
- }, [(V = l.value.titleItem) == null ? void 0 : V.h4]), t("li", {
564
+ }, [(O = l.value.titleItem) == null ? void 0 : O.h4]), t("li", {
565
565
  class: `${o}-menu-item`,
566
566
  onClick: () => {
567
567
  d("h5");
@@ -606,7 +606,7 @@ const gl = /* @__PURE__ */ O({
606
606
  case "sup":
607
607
  return t("div", {
608
608
  class: `${o}-toolbar-item`,
609
- title: (re = l.value.toolbarTips) == null ? void 0 : re.sup,
609
+ title: (ne = l.value.toolbarTips) == null ? void 0 : ne.sup,
610
610
  onClick: () => {
611
611
  d("sup");
612
612
  }
@@ -677,7 +677,7 @@ const gl = /* @__PURE__ */ O({
677
677
  "xlink:href": "#md-editor-icon-task"
678
678
  }, null)]), e.showToolbarName && t("div", {
679
679
  class: `${o}-toolbar-item-name`
680
- }, [(ne = l.value.toolbarTips) == null ? void 0 : ne.task])]);
680
+ }, [(re = l.value.toolbarTips) == null ? void 0 : re.task])]);
681
681
  case "codeRow":
682
682
  return t("div", {
683
683
  class: `${o}-toolbar-item`,
@@ -738,7 +738,7 @@ const gl = /* @__PURE__ */ O({
738
738
  }, null)]), e.showToolbarName && t("div", {
739
739
  class: `${o}-toolbar-item-name`
740
740
  }, [(we = l.value.toolbarTips) == null ? void 0 : we.image])]) : t(te, {
741
- relative: `#${n}`,
741
+ relative: `#${r}`,
742
742
  visible: u.image,
743
743
  onChange: (p) => {
744
744
  u.image = p;
@@ -782,13 +782,13 @@ const gl = /* @__PURE__ */ O({
782
782
  });
783
783
  case "table":
784
784
  return t(te, {
785
- relative: `#${n}`,
785
+ relative: `#${r}`,
786
786
  visible: u.table,
787
787
  onChange: (p) => {
788
788
  u.table = p;
789
789
  },
790
790
  key: "bar-table",
791
- overlay: t(pl, {
791
+ overlay: t(Cl, {
792
792
  tableShape: e.tableShape,
793
793
  onSelected: (p) => {
794
794
  d("table", {
@@ -817,7 +817,7 @@ const gl = /* @__PURE__ */ O({
817
817
  class: `${o}-toolbar-item`,
818
818
  title: (Me = l.value.toolbarTips) == null ? void 0 : Me.revoke,
819
819
  onClick: () => {
820
- h.emit(r, "ctrlZ");
820
+ h.emit(a, "ctrlZ");
821
821
  }
822
822
  }, [t("svg", {
823
823
  class: `${o}-icon`,
@@ -830,9 +830,9 @@ const gl = /* @__PURE__ */ O({
830
830
  case "next":
831
831
  return t("div", {
832
832
  class: `${o}-toolbar-item`,
833
- title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.next,
833
+ title: (De = l.value.toolbarTips) == null ? void 0 : De.next,
834
834
  onClick: () => {
835
- h.emit(r, "ctrlShiftZ");
835
+ h.emit(a, "ctrlShiftZ");
836
836
  }
837
837
  }, [t("svg", {
838
838
  class: `${o}-icon`,
@@ -841,13 +841,13 @@ const gl = /* @__PURE__ */ O({
841
841
  "xlink:href": "#md-editor-icon-next"
842
842
  }, null)]), e.showToolbarName && t("div", {
843
843
  class: `${o}-toolbar-item-name`
844
- }, [(De = l.value.toolbarTips) == null ? void 0 : De.next])]);
844
+ }, [(Ie = l.value.toolbarTips) == null ? void 0 : Ie.next])]);
845
845
  case "save":
846
846
  return t("div", {
847
847
  class: `${o}-toolbar-item`,
848
848
  title: (Ne = l.value.toolbarTips) == null ? void 0 : Ne.save,
849
849
  onClick: () => {
850
- h.emit(r, pt);
850
+ h.emit(a, pt);
851
851
  }
852
852
  }, [t("svg", {
853
853
  class: `${o}-icon`,
@@ -886,13 +886,13 @@ const gl = /* @__PURE__ */ O({
886
886
  "xlink:href": `#md-editor-icon-${e.setting.pageFullscreen ? "suoxiao" : "fangda"}`
887
887
  }, null)]), e.showToolbarName && t("div", {
888
888
  class: `${o}-toolbar-item-name`
889
- }, [(Oe = l.value.toolbarTips) == null ? void 0 : Oe.pageFullscreen])]);
889
+ }, [(Ve = l.value.toolbarTips) == null ? void 0 : Ve.pageFullscreen])]);
890
890
  case "fullscreen":
891
891
  return t("div", {
892
892
  class: `${o}-toolbar-item`,
893
- title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.fullscreen,
893
+ title: (Oe = l.value.toolbarTips) == null ? void 0 : Oe.fullscreen,
894
894
  onClick: () => {
895
- a();
895
+ n();
896
896
  }
897
897
  }, [t("svg", {
898
898
  class: `${o}-icon`,
@@ -937,7 +937,7 @@ const gl = /* @__PURE__ */ O({
937
937
  class: `${o}-toolbar-item`,
938
938
  title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.catalog,
939
939
  onClick: () => {
940
- h.emit(r, Vt);
940
+ h.emit(a, Ot);
941
941
  },
942
942
  key: "bar-catalog"
943
943
  }, [t("svg", {
@@ -963,7 +963,7 @@ const gl = /* @__PURE__ */ O({
963
963
  }, [(We = l.value.toolbarTips) == null ? void 0 : We.github])]);
964
964
  case "mermaid":
965
965
  return t(te, {
966
- relative: `#${n}`,
966
+ relative: `#${r}`,
967
967
  visible: u.mermaid,
968
968
  onChange: (p) => {
969
969
  u.mermaid = p;
@@ -1033,7 +1033,7 @@ const gl = /* @__PURE__ */ O({
1033
1033
  });
1034
1034
  case "katex":
1035
1035
  return t(te, {
1036
- relative: `#${n}`,
1036
+ relative: `#${r}`,
1037
1037
  visible: u.katex,
1038
1038
  onChange: (p) => {
1039
1039
  u.katex = p;
@@ -1076,7 +1076,7 @@ const gl = /* @__PURE__ */ O({
1076
1076
  const p = e.defToolbars[v];
1077
1077
  return p ? at(p, {
1078
1078
  insert(de) {
1079
- h.emit(r, "replace", "universal", {
1079
+ h.emit(a, "replace", "universal", {
1080
1080
  generate: de
1081
1081
  });
1082
1082
  }
@@ -1085,7 +1085,7 @@ const gl = /* @__PURE__ */ O({
1085
1085
  const p = e.defToolbars.children[v];
1086
1086
  return p ? at(p, {
1087
1087
  insert(de) {
1088
- h.emit(r, "replace", "universal", {
1088
+ h.emit(a, "replace", "universal", {
1089
1089
  generate: de
1090
1090
  });
1091
1091
  }
@@ -1095,21 +1095,21 @@ const gl = /* @__PURE__ */ O({
1095
1095
  };
1096
1096
  return H(() => e.toolbars, () => {
1097
1097
  ce(() => {
1098
- i.value && Dt(i.value);
1098
+ i.value && It(i.value);
1099
1099
  });
1100
1100
  }, {
1101
1101
  immediate: !0
1102
1102
  }), () => {
1103
- const v = f.value[0].map((k) => T(k)), g = f.value[1].map((k) => T(k));
1103
+ const v = m.value[0].map((k) => T(k)), g = m.value[1].map((k) => T(k));
1104
1104
  return t(kt, null, [e.toolbars.length > 0 && t("div", {
1105
1105
  class: `${o}-toolbar-wrapper`,
1106
1106
  ref: i,
1107
- id: n
1107
+ id: r
1108
1108
  }, [t("div", {
1109
1109
  class: [`${o}-toolbar`, e.showToolbarName && `${o}-stn`]
1110
1110
  }, [t("div", {
1111
1111
  class: `${o}-toolbar-left`,
1112
- ref: m
1112
+ ref: f
1113
1113
  }, [v]), t("div", {
1114
1114
  class: `${o}-toolbar-right`
1115
1115
  }, [g])])]), t("input", {
@@ -1120,7 +1120,7 @@ const gl = /* @__PURE__ */ O({
1120
1120
  style: {
1121
1121
  display: "none"
1122
1122
  }
1123
- }, null), t(xl, {
1123
+ }, null), t(Sl, {
1124
1124
  linkVisible: c.linkVisible,
1125
1125
  clipVisible: c.clipVisible,
1126
1126
  type: c.type,
@@ -1136,16 +1136,16 @@ const gl = /* @__PURE__ */ O({
1136
1136
  }, null)]);
1137
1137
  };
1138
1138
  }
1139
- }), Al = (e, r) => {
1139
+ }), Ml = (e, a) => {
1140
1140
  const l = Et(() => {
1141
- e.removeEventListener("scroll", a), e.addEventListener("scroll", a), r.removeEventListener("scroll", a), r.addEventListener("scroll", a);
1142
- }, 50), a = (n) => {
1143
- const i = e.clientHeight, u = r.clientHeight, d = e.scrollHeight, c = r.scrollHeight, m = (d - i) / (c - u);
1144
- n.target === e ? (r.removeEventListener("scroll", a), r.scrollTo({
1145
- top: e.scrollTop / m
1141
+ e.removeEventListener("scroll", n), e.addEventListener("scroll", n), a.removeEventListener("scroll", n), a.addEventListener("scroll", n);
1142
+ }, 50), n = (r) => {
1143
+ const i = e.clientHeight, u = a.clientHeight, d = e.scrollHeight, c = a.scrollHeight, f = (d - i) / (c - u);
1144
+ r.target === e ? (a.removeEventListener("scroll", n), a.scrollTo({
1145
+ top: e.scrollTop / f
1146
1146
  // behavior: 'smooth'
1147
- }), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
1148
- top: r.scrollTop * m
1147
+ }), l()) : (e.removeEventListener("scroll", n), e.scrollTo({
1148
+ top: a.scrollTop * f
1149
1149
  // behavior: 'smooth'
1150
1150
  }), l());
1151
1151
  };
@@ -1156,17 +1156,17 @@ const gl = /* @__PURE__ */ O({
1156
1156
  });
1157
1157
  },
1158
1158
  () => {
1159
- e.removeEventListener("scroll", a), r.removeEventListener("scroll", a);
1159
+ e.removeEventListener("scroll", n), a.removeEventListener("scroll", n);
1160
1160
  }
1161
1161
  ];
1162
- }, Ml = (e, r, l) => {
1163
- const { view: a } = l, n = (b) => a.lineBlockAt(a.state.doc.line(b).from).top, i = (b) => a.lineBlockAt(a.state.doc.line(b).from).height;
1162
+ }, Ll = (e, a, l) => {
1163
+ const { view: n } = l, r = (b) => n.lineBlockAt(n.state.doc.line(b).from).top, i = (b) => n.lineBlockAt(n.state.doc.line(b).from).height;
1164
1164
  let u = [];
1165
1165
  const d = () => {
1166
1166
  u = [];
1167
- const b = Array.from(r.querySelectorAll("[data-line]")).map(
1167
+ const b = Array.from(a.querySelectorAll("[data-line]")).map(
1168
1168
  (g) => Number(g.dataset.line) + 1
1169
- ), { lines: $ } = a.state.doc;
1169
+ ), { lines: $ } = n.state.doc;
1170
1170
  let T = 1, v = b.shift() ?? $;
1171
1171
  for (let g = 1; g <= $; g++)
1172
1172
  g === v && (T = g, v = b.shift() || $ + 1), u.push({
@@ -1174,46 +1174,46 @@ const gl = /* @__PURE__ */ O({
1174
1174
  end: v - 1
1175
1175
  });
1176
1176
  };
1177
- let c = 0, m = 0;
1178
- const f = Ht((b) => {
1177
+ let c = 0, f = 0;
1178
+ const m = Ht((b) => {
1179
1179
  var v, g, k, y, w, x, L;
1180
- if (!((v = r.firstElementChild) != null && v.firstElementChild))
1180
+ if (!((v = a.firstElementChild) != null && v.firstElementChild))
1181
1181
  return;
1182
- const $ = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: T } = a.state.doc.lineAt($.from);
1183
- if (!(T > u.length) && !(a.state.doc.lines < u[u.length - 1].end))
1182
+ const $ = n.lineBlockAtHeight(n.scrollDOM.scrollTop), { number: T } = n.state.doc.lineAt($.from);
1183
+ if (!(T > u.length) && !(n.state.doc.lines < u[u.length - 1].end))
1184
1184
  if (b.target === e) {
1185
- if (m !== 0)
1185
+ if (f !== 0)
1186
1186
  return;
1187
1187
  c++;
1188
- const C = u[T - 1], M = n(C.end) + i(C.end);
1188
+ const C = u[T - 1], M = r(C.end) + i(C.end);
1189
1189
  let R = 0;
1190
- const I = n(C.start), D = r.querySelector(`[data-line="${C.start - 1}"]`) || ((g = r.firstElementChild) == null ? void 0 : g.firstElementChild), V = r.querySelector(`[data-line="${C.end}"]`) || ((k = r.lastElementChild) == null ? void 0 : k.lastElementChild);
1190
+ const D = r(C.start), I = a.querySelector(`[data-line="${C.start - 1}"]`) || ((g = a.firstElementChild) == null ? void 0 : g.firstElementChild), O = a.querySelector(`[data-line="${C.end}"]`) || ((k = a.lastElementChild) == null ? void 0 : k.lastElementChild);
1191
1191
  let B = 0, N = 0;
1192
- I === 0 ? (R = (a.scrollDOM.scrollTop - I) / (M - I), B = V.offsetTop) : M > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (R = (a.scrollDOM.scrollTop - I) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - I), N = D.offsetTop, B = r.scrollHeight - r.clientHeight - N + 10) : (R = (a.scrollDOM.scrollTop - I) / (M - I), N = D.offsetTop, B = V.offsetTop - N);
1192
+ D === 0 ? (R = (n.scrollDOM.scrollTop - D) / (M - D), B = O.offsetTop) : M > n.scrollDOM.scrollHeight - n.scrollDOM.clientHeight ? (R = (n.scrollDOM.scrollTop - D) / (n.scrollDOM.scrollHeight - n.scrollDOM.clientHeight - D), N = I.offsetTop, B = a.scrollHeight - a.clientHeight - N + 10) : (R = (n.scrollDOM.scrollTop - D) / (M - D), N = I.offsetTop, B = O.offsetTop - N);
1193
1193
  const j = N - 10 + B * R;
1194
- rt(r, j, () => {
1194
+ nt(a, j, () => {
1195
1195
  c--;
1196
1196
  });
1197
1197
  } else {
1198
1198
  if (c !== 0)
1199
1199
  return;
1200
- m++;
1200
+ f++;
1201
1201
  const C = Array.from(
1202
- r.querySelectorAll("[data-line]")
1203
- ), M = r.scrollTop, R = r.scrollHeight;
1204
- let I = C.length === 0 ? 1 : Math.ceil(
1202
+ a.querySelectorAll("[data-line]")
1203
+ ), M = a.scrollTop, R = a.scrollHeight;
1204
+ let D = C.length === 0 ? 1 : Math.ceil(
1205
1205
  Number(C[C.length - 1].dataset.line) * (M / R)
1206
- ), D = (y = r.firstElementChild) == null ? void 0 : y.firstElementChild;
1207
- for (let E = I; E >= 0; E--) {
1208
- const F = r.querySelector(`[data-line="${E}"]`);
1206
+ ), I = (y = a.firstElementChild) == null ? void 0 : y.firstElementChild;
1207
+ for (let E = D; E >= 0; E--) {
1208
+ const F = a.querySelector(`[data-line="${E}"]`);
1209
1209
  if (F && F.offsetTop <= M) {
1210
- D = F, I = E;
1210
+ I = F, D = E;
1211
1211
  break;
1212
1212
  }
1213
1213
  }
1214
- let V = (w = r.firstElementChild) == null ? void 0 : w.firstElementChild, B = (x = r.firstElementChild) == null ? void 0 : x.lastElementChild;
1214
+ let O = (w = a.firstElementChild) == null ? void 0 : w.firstElementChild, B = (x = a.firstElementChild) == null ? void 0 : x.lastElementChild;
1215
1215
  for (; C.length > 0; ) {
1216
- const E = C.indexOf(D);
1216
+ const E = C.indexOf(I);
1217
1217
  if (E + 1 >= C.length)
1218
1218
  break;
1219
1219
  const F = C[E + 1];
@@ -1221,68 +1221,68 @@ const gl = /* @__PURE__ */ O({
1221
1221
  B = F;
1222
1222
  break;
1223
1223
  }
1224
- const ee = D.offsetTop;
1224
+ const ee = I.offsetTop;
1225
1225
  if (ee > M) {
1226
1226
  if (E === 0) {
1227
- V = D, B = F;
1227
+ O = I, B = F;
1228
1228
  break;
1229
1229
  }
1230
- D = C[E - 1];
1230
+ I = C[E - 1];
1231
1231
  continue;
1232
1232
  }
1233
- const ne = F.offsetTop;
1234
- if (ee <= M && ne > M) {
1235
- V = D, B = F;
1233
+ const re = F.offsetTop;
1234
+ if (ee <= M && re > M) {
1235
+ O = I, B = F;
1236
1236
  break;
1237
1237
  }
1238
- D = F;
1238
+ I = F;
1239
1239
  }
1240
- const N = V.offsetTop, j = B.offsetTop;
1240
+ const N = O.offsetTop, j = B.offsetTop;
1241
1241
  let U = 0;
1242
- const { start: re, end: X } = u[Number(V.dataset.line || 0)], _ = n(re);
1243
- let G = n(X);
1242
+ const { start: ne, end: X } = u[Number(O.dataset.line || 0)], _ = r(ne);
1243
+ let G = r(X);
1244
1244
  const Q = i(X);
1245
1245
  let W = 0;
1246
- V === ((L = r.firstElementChild) == null ? void 0 : L.firstElementChild) ? (U = Math.max(M / j, 0), W = G + Q - _) : G > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (U = Math.max(
1247
- (M - N) / (r.scrollHeight - N - r.clientHeight),
1246
+ O === ((L = a.firstElementChild) == null ? void 0 : L.firstElementChild) ? (U = Math.max(M / j, 0), W = G + Q - _) : G > n.scrollDOM.scrollHeight - n.scrollDOM.clientHeight ? (U = Math.max(
1247
+ (M - N) / (a.scrollHeight - N - a.clientHeight),
1248
1248
  0
1249
- ), G = n(a.state.doc.lines) + i(a.state.doc.lines), W = 8 + G - _ - e.clientHeight) : (U = Math.max(
1249
+ ), G = r(n.state.doc.lines) + i(n.state.doc.lines), W = 8 + G - _ - e.clientHeight) : (U = Math.max(
1250
1250
  (M - N) / (j - N),
1251
1251
  0
1252
- ), W = G + Q - _), rt(e, _ + W * U, () => {
1253
- m--;
1252
+ ), W = G + Q - _), nt(e, _ + W * U, () => {
1253
+ f--;
1254
1254
  });
1255
1255
  }
1256
1256
  }, 10);
1257
1257
  return [
1258
1258
  () => {
1259
- d(), e.addEventListener("scroll", f), r.addEventListener("scroll", f), e.dispatchEvent(new Event("scroll"));
1259
+ d(), e.addEventListener("scroll", m), a.addEventListener("scroll", m), e.dispatchEvent(new Event("scroll"));
1260
1260
  },
1261
1261
  () => {
1262
- u = [], e.removeEventListener("scroll", f), r.removeEventListener("scroll", f);
1262
+ u = [], e.removeEventListener("scroll", m), a.removeEventListener("scroll", m);
1263
1263
  }
1264
1264
  ];
1265
- }, Ll = (e, r, l) => {
1266
- const a = A("editorId");
1267
- let n = () => {
1265
+ }, Dl = (e, a, l) => {
1266
+ const n = A("editorId");
1267
+ let r = () => {
1268
1268
  }, i = () => {
1269
1269
  };
1270
1270
  const u = () => {
1271
- n();
1271
+ r();
1272
1272
  const d = document.querySelector(".cm-scroller"), c = document.querySelector(
1273
- `[id="${a}-preview-wrapper"][data-show="true"]`
1274
- ), m = document.querySelector(
1275
- `[id="${a}-html-wrapper"][data-show="true"]`
1273
+ `[id="${n}-preview-wrapper"][data-show="true"]`
1274
+ ), f = document.querySelector(
1275
+ `[id="${n}-html-wrapper"][data-show="true"]`
1276
1276
  );
1277
- (c || m) && ([i, n] = (c ? Ml : Al)(
1277
+ (c || f) && ([i, r] = (c ? Ll : Ml)(
1278
1278
  d,
1279
- c || m,
1279
+ c || f,
1280
1280
  l.value
1281
1281
  )), e.scrollAuto && i();
1282
1282
  };
1283
1283
  H(
1284
1284
  [
1285
- r,
1285
+ a,
1286
1286
  le(e.setting, "preview"),
1287
1287
  le(e.setting, "htmlPreview"),
1288
1288
  le(e.setting, "fullscreen"),
@@ -1294,16 +1294,16 @@ const gl = /* @__PURE__ */ O({
1294
1294
  ), H(
1295
1295
  () => e.scrollAuto,
1296
1296
  (d) => {
1297
- d ? i() : n();
1297
+ d ? i() : r();
1298
1298
  }
1299
1299
  ), Y(u);
1300
- }, Il = Ll, Dl = (e, r, l) => {
1301
- var f, b, $, T, v, g;
1302
- let a = "", n = 0, i = 0, u = !0, d = !1;
1303
- const c = r.getSelectedText(), m = (f = z.editorConfig) == null ? void 0 : f.mermaidTemplate;
1300
+ }, Il = Dl, Nl = (e, a, l) => {
1301
+ var m, b, $, T, v, g;
1302
+ let n = "", r = 0, i = 0, u = !0, d = !1;
1303
+ const c = a.getSelectedText(), f = (m = z.editorConfig) == null ? void 0 : m.mermaidTemplate;
1304
1304
  if (/^h[1-6]{1}$/.test(e)) {
1305
1305
  const k = e.replace(/^h(\d)/, (y, w) => new Array(Number(w)).fill("#", 0, w).join(""));
1306
- a = `${k} ${c}`, n = k.length + 1;
1306
+ n = `${k} ${c}`, r = k.length + 1;
1307
1307
  } else if (e === "prettier") {
1308
1308
  const k = window.prettier || (($ = (b = z.editorExtensions) == null ? void 0 : b.prettier) == null ? void 0 : $.prettierInstance), y = [
1309
1309
  ((T = window.prettierPlugins) == null ? void 0 : T.markdown) || ((g = (v = z.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : g.parserMarkdownInstance)
@@ -1311,163 +1311,163 @@ const gl = /* @__PURE__ */ O({
1311
1311
  !k || y[0] === void 0 ? (h.emit(l.editorId, "errorCatcher", {
1312
1312
  name: "prettier",
1313
1313
  message: "prettier is undefined"
1314
- }), a = r.getValue()) : a = k.format(r.getValue(), {
1314
+ }), n = a.getValue()) : n = k.format(a.getValue(), {
1315
1315
  parser: "markdown",
1316
1316
  plugins: y
1317
1317
  }), u = !1, d = !0;
1318
1318
  } else
1319
1319
  switch (e) {
1320
1320
  case "bold": {
1321
- a = `**${c}**`, n = 2, i = -2;
1321
+ n = `**${c}**`, r = 2, i = -2;
1322
1322
  break;
1323
1323
  }
1324
1324
  case "underline": {
1325
- a = `<u>${c}</u>`, n = 3, i = -4;
1325
+ n = `<u>${c}</u>`, r = 3, i = -4;
1326
1326
  break;
1327
1327
  }
1328
1328
  case "italic": {
1329
- a = `*${c}*`, n = 1, i = -1;
1329
+ n = `*${c}*`, r = 1, i = -1;
1330
1330
  break;
1331
1331
  }
1332
1332
  case "strikeThrough": {
1333
- a = `~~${c}~~`, n = 2, i = -2;
1333
+ n = `~~${c}~~`, r = 2, i = -2;
1334
1334
  break;
1335
1335
  }
1336
1336
  case "sub": {
1337
- a = `<sub>${c}</sub>`, n = 5, i = -6;
1337
+ n = `<sub>${c}</sub>`, r = 5, i = -6;
1338
1338
  break;
1339
1339
  }
1340
1340
  case "sup": {
1341
- a = `<sup>${c}</sup>`, n = 5, i = -6;
1341
+ n = `<sup>${c}</sup>`, r = 5, i = -6;
1342
1342
  break;
1343
1343
  }
1344
1344
  case "codeRow": {
1345
- a = "`" + c + "`", n = 1, i = -1;
1345
+ n = "`" + c + "`", r = 1, i = -1;
1346
1346
  break;
1347
1347
  }
1348
1348
  case "quote": {
1349
- a = `> ${c}`, n = 2;
1349
+ n = `> ${c}`, r = 2;
1350
1350
  break;
1351
1351
  }
1352
1352
  case "orderedList": {
1353
- a = `1. ${c}`, n = 3;
1353
+ n = `1. ${c}`, r = 3;
1354
1354
  break;
1355
1355
  }
1356
1356
  case "unorderedList": {
1357
- a = `- ${c}`, n = 2;
1357
+ n = `- ${c}`, r = 2;
1358
1358
  break;
1359
1359
  }
1360
1360
  case "task": {
1361
- a = `- [ ] ${c}`, n = 6;
1361
+ n = `- [ ] ${c}`, r = 6;
1362
1362
  break;
1363
1363
  }
1364
1364
  case "code": {
1365
1365
  const k = l.text || c || "", y = l.mode || "language";
1366
- a = `\`\`\`${y}
1366
+ n = `\`\`\`${y}
1367
1367
  ${k}
1368
1368
  \`\`\`
1369
- `, n = 3, i = 3 + y.length - a.length;
1369
+ `, r = 3, i = 3 + y.length - n.length;
1370
1370
  break;
1371
1371
  }
1372
1372
  case "table": {
1373
- a = "|";
1373
+ n = "|";
1374
1374
  const { selectedShape: k = { x: 1, y: 1 } } = l, { x: y, y: w } = k;
1375
1375
  for (let x = 0; x <= w; x++)
1376
- a += " col |";
1377
- a += `
1376
+ n += " col |";
1377
+ n += `
1378
1378
  |`;
1379
1379
  for (let x = 0; x <= w; x++)
1380
- a += " - |";
1380
+ n += " - |";
1381
1381
  for (let x = 0; x <= y; x++) {
1382
- a += `
1382
+ n += `
1383
1383
  |`;
1384
1384
  for (let L = 0; L <= w; L++)
1385
- a += " content |";
1385
+ n += " content |";
1386
1386
  }
1387
- n = 2, i = 5 - a.length;
1387
+ r = 2, i = 5 - n.length;
1388
1388
  break;
1389
1389
  }
1390
1390
  case "link": {
1391
1391
  const { desc: k, url: y } = l;
1392
- a = `[${k}](${y})`, u = !1;
1392
+ n = `[${k}](${y})`, u = !1;
1393
1393
  break;
1394
1394
  }
1395
1395
  case "image": {
1396
1396
  const { desc: k, url: y, urls: w } = l;
1397
- w instanceof Array ? a = w.reduce((x, L) => x + `![${k}](${L})
1398
- `, "") : a = `![${k}](${y})
1397
+ w instanceof Array ? n = w.reduce((x, L) => x + `![${k}](${L})
1398
+ `, "") : n = `![${k}](${y})
1399
1399
  `, u = !1;
1400
1400
  break;
1401
1401
  }
1402
1402
  case "flow": {
1403
- a = `\`\`\`mermaid
1404
- ${(m == null ? void 0 : m.flow) || `flowchart TD
1403
+ n = `\`\`\`mermaid
1404
+ ${(f == null ? void 0 : f.flow) || `flowchart TD
1405
1405
  Start --> Stop`}
1406
1406
  \`\`\`
1407
- `, n = 3, i = 10 - a.length;
1407
+ `, r = 3, i = 10 - n.length;
1408
1408
  break;
1409
1409
  }
1410
1410
  case "sequence": {
1411
- a = `\`\`\`mermaid
1412
- ${(m == null ? void 0 : m.sequence) || `sequenceDiagram
1411
+ n = `\`\`\`mermaid
1412
+ ${(f == null ? void 0 : f.sequence) || `sequenceDiagram
1413
1413
  A->>B: hello!
1414
1414
  B-->>A: hi!
1415
1415
  A-)B: bye!`}
1416
1416
  \`\`\`
1417
- `, n = 3, i = 10 - a.length;
1417
+ `, r = 3, i = 10 - n.length;
1418
1418
  break;
1419
1419
  }
1420
1420
  case "gantt": {
1421
- a = `\`\`\`mermaid
1422
- ${(m == null ? void 0 : m.gantt) || `gantt
1421
+ n = `\`\`\`mermaid
1422
+ ${(f == null ? void 0 : f.gantt) || `gantt
1423
1423
  title A Gantt Diagram
1424
1424
  dateFormat YYYY-MM-DD
1425
1425
  section Section
1426
1426
  A task :a1, 2014-01-01, 30d
1427
1427
  Another task :after a1, 20d`}
1428
1428
  \`\`\`
1429
- `, n = 3, i = 10 - a.length;
1429
+ `, r = 3, i = 10 - n.length;
1430
1430
  break;
1431
1431
  }
1432
1432
  case "class": {
1433
- a = `\`\`\`mermaid
1434
- ${(m == null ? void 0 : m.class) || `classDiagram
1433
+ n = `\`\`\`mermaid
1434
+ ${(f == null ? void 0 : f.class) || `classDiagram
1435
1435
  class Animal
1436
1436
  Vehicle <|-- Car`}
1437
1437
  \`\`\`
1438
- `, n = 3, i = 10 - a.length;
1438
+ `, r = 3, i = 10 - n.length;
1439
1439
  break;
1440
1440
  }
1441
1441
  case "state": {
1442
- a = `\`\`\`mermaid
1443
- ${(m == null ? void 0 : m.state) || `stateDiagram-v2
1442
+ n = `\`\`\`mermaid
1443
+ ${(f == null ? void 0 : f.state) || `stateDiagram-v2
1444
1444
  s1 --> s2`}
1445
1445
  \`\`\`
1446
- `, n = 3, i = 10 - a.length;
1446
+ `, r = 3, i = 10 - n.length;
1447
1447
  break;
1448
1448
  }
1449
1449
  case "pie": {
1450
- a = `\`\`\`mermaid
1451
- ${(m == null ? void 0 : m.pie) || `pie title Pets adopted by volunteers
1450
+ n = `\`\`\`mermaid
1451
+ ${(f == null ? void 0 : f.pie) || `pie title Pets adopted by volunteers
1452
1452
  "Dogs" : 386
1453
1453
  "Cats" : 85
1454
1454
  "Rats" : 15`}
1455
1455
  \`\`\`
1456
- `, n = 3, i = 10 - a.length;
1456
+ `, r = 3, i = 10 - n.length;
1457
1457
  break;
1458
1458
  }
1459
1459
  case "relationship": {
1460
- a = `\`\`\`mermaid
1461
- ${(m == null ? void 0 : m.relationship) || `erDiagram
1460
+ n = `\`\`\`mermaid
1461
+ ${(f == null ? void 0 : f.relationship) || `erDiagram
1462
1462
  CAR ||--o{ NAMED-DRIVER : allows
1463
1463
  PERSON ||--o{ NAMED-DRIVER : is`}
1464
1464
  \`\`\`
1465
- `, n = 3, i = 10 - a.length;
1465
+ `, r = 3, i = 10 - n.length;
1466
1466
  break;
1467
1467
  }
1468
1468
  case "journey": {
1469
- a = `\`\`\`mermaid
1470
- ${(m == null ? void 0 : m.journey) || `journey
1469
+ n = `\`\`\`mermaid
1470
+ ${(f == null ? void 0 : f.journey) || `journey
1471
1471
  title My working day
1472
1472
  section Go to work
1473
1473
  Make tea: 5: Me
@@ -1477,39 +1477,39 @@ ${(m == null ? void 0 : m.journey) || `journey
1477
1477
  Go downstairs: 5: Me
1478
1478
  Sit down: 5: Me`}
1479
1479
  \`\`\`
1480
- `, n = 3, i = 10 - a.length;
1480
+ `, r = 3, i = 10 - n.length;
1481
1481
  break;
1482
1482
  }
1483
1483
  case "katexInline": {
1484
- a = "$$", n = 1, i = -1;
1484
+ n = "$$", r = 1, i = -1;
1485
1485
  break;
1486
1486
  }
1487
1487
  case "katexBlock": {
1488
- a = `$$
1488
+ n = `$$
1489
1489
 
1490
1490
  $$
1491
- `, n = 3, i = -4;
1491
+ `, r = 3, i = -4;
1492
1492
  break;
1493
1493
  }
1494
1494
  case "universal": {
1495
1495
  const { generate: k } = l, y = k(c);
1496
- a = y.targetValue, u = y.select, n = y.deviationStart, i = y.deviationEnd;
1496
+ n = y.targetValue, u = y.select, r = y.deviationStart, i = y.deviationEnd;
1497
1497
  }
1498
1498
  }
1499
1499
  return {
1500
- text: a,
1500
+ text: n,
1501
1501
  options: {
1502
1502
  // 是否选中
1503
1503
  select: u,
1504
1504
  // 选中时,开始位置的偏移量
1505
- deviationStart: n,
1505
+ deviationStart: r,
1506
1506
  // 结束的偏移量
1507
1507
  deviationEnd: i,
1508
1508
  // 是否整个替换
1509
1509
  replaceAll: d
1510
1510
  }
1511
1511
  };
1512
- }, Nl = "#e5c07b", it = "var(--md-color)", El = "#56b6c2", Hl = "#ffffff", oe = "var(--md-color)", st = "#e5c07b", Bl = "#e5c07b", Fl = "var(--md-color)", ct = "#d19a66", Ol = "#c678dd", Vl = "#21252b", Rl = "#2c313a", dt = "var(--md-bk-color)", me = "var(--md-bk-color)", Pl = "#ceedfa33", ut = "#528bff", ql = be.theme(
1512
+ }, El = "#e5c07b", it = "var(--md-color)", Hl = "#56b6c2", Bl = "#ffffff", oe = "var(--md-color)", st = "#e5c07b", Fl = "#e5c07b", Vl = "var(--md-color)", ct = "#d19a66", Ol = "#c678dd", Rl = "#21252b", Pl = "#2c313a", dt = "var(--md-bk-color)", me = "var(--md-bk-color)", ql = "#ceedfa33", ut = "#528bff", Ul = be.theme(
1513
1513
  {
1514
1514
  "&": {
1515
1515
  color: oe,
@@ -1519,8 +1519,8 @@ $$
1519
1519
  caretColor: ut
1520
1520
  },
1521
1521
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: ut },
1522
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Pl },
1523
- ".cm-panels": { backgroundColor: Vl, color: oe },
1522
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: ql },
1523
+ ".cm-panels": { backgroundColor: Rl, color: oe },
1524
1524
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1525
1525
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1526
1526
  ".cm-searchMatch": {
@@ -1542,7 +1542,7 @@ $$
1542
1542
  borderColor: "var(--md-border-color)"
1543
1543
  },
1544
1544
  ".cm-activeLineGutter": {
1545
- backgroundColor: Rl
1545
+ backgroundColor: Pl
1546
1546
  },
1547
1547
  ".cm-foldPlaceholder": {
1548
1548
  backgroundColor: "transparent",
@@ -1568,10 +1568,10 @@ $$
1568
1568
  }
1569
1569
  },
1570
1570
  { dark: !0 }
1571
- ), Ul = $t.define([
1571
+ ), Gl = $t.define([
1572
1572
  { tag: s.keyword, color: Ol },
1573
1573
  { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: it },
1574
- { tag: [s.function(s.variableName), s.labelName], color: Bl },
1574
+ { tag: [s.function(s.variableName), s.labelName], color: Fl },
1575
1575
  { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: ct },
1576
1576
  { tag: [s.definition(s.name), s.separator], color: oe },
1577
1577
  {
@@ -1585,7 +1585,7 @@ $$
1585
1585
  s.self,
1586
1586
  s.namespace
1587
1587
  ],
1588
- color: Nl
1588
+ color: El
1589
1589
  },
1590
1590
  {
1591
1591
  tag: [
@@ -1597,7 +1597,7 @@ $$
1597
1597
  s.link,
1598
1598
  s.special(s.string)
1599
1599
  ],
1600
- color: El
1600
+ color: Hl
1601
1601
  },
1602
1602
  { tag: [s.meta, s.comment], color: st },
1603
1603
  { tag: s.strong, fontWeight: "bold" },
@@ -1606,12 +1606,12 @@ $$
1606
1606
  { tag: s.link, color: st, textDecoration: "underline" },
1607
1607
  { tag: s.heading, fontWeight: "bold", color: it },
1608
1608
  { tag: [s.atom, s.bool, s.special(s.variableName)], color: ct },
1609
- { tag: [s.processingInstruction, s.string, s.inserted], color: Fl },
1610
- { tag: s.invalid, color: Hl }
1611
- ]), Gl = [
1612
- ql,
1613
- yt(Ul)
1614
- ], Kl = "#e5c07b", mt = "#3f4a54", jl = "#56b6c2", _l = "#fff", ae = "#3f4a54", ft = "#2d8cf0", Wl = "#2d8cf0", zl = "#3f4a54", gt = "#d19a66", Yl = "#c678dd", Zl = "#21252b", Jl = "#ceedfa33", ht = "var(--md-bk-color)", fe = "var(--md-bk-color)", Xl = "#bad5fa", bt = "#3f4a54", Ql = be.theme(
1609
+ { tag: [s.processingInstruction, s.string, s.inserted], color: Vl },
1610
+ { tag: s.invalid, color: Bl }
1611
+ ]), Kl = [
1612
+ Ul,
1613
+ yt(Gl)
1614
+ ], jl = "#e5c07b", mt = "#3f4a54", _l = "#56b6c2", Wl = "#fff", ae = "#3f4a54", ft = "#2d8cf0", zl = "#2d8cf0", Yl = "#3f4a54", gt = "#d19a66", Zl = "#c678dd", Jl = "#21252b", Xl = "#ceedfa33", ht = "var(--md-bk-color)", fe = "var(--md-bk-color)", Ql = "#bad5fa", bt = "#3f4a54", eo = be.theme(
1615
1615
  {
1616
1616
  "&": {
1617
1617
  color: ae,
@@ -1621,8 +1621,8 @@ $$
1621
1621
  caretColor: bt
1622
1622
  },
1623
1623
  ".cm-cursor, .cm-dropCursor": { borderLeftColor: bt },
1624
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Xl },
1625
- ".cm-panels": { backgroundColor: Zl, color: ae },
1624
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Ql },
1625
+ ".cm-panels": { backgroundColor: Jl, color: ae },
1626
1626
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1627
1627
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1628
1628
  ".cm-searchMatch": {
@@ -1644,7 +1644,7 @@ $$
1644
1644
  borderColor: "var(--md-border-color)"
1645
1645
  },
1646
1646
  ".cm-activeLineGutter": {
1647
- backgroundColor: Jl
1647
+ backgroundColor: Xl
1648
1648
  },
1649
1649
  ".cm-foldPlaceholder": {
1650
1650
  backgroundColor: "transparent",
@@ -1670,10 +1670,10 @@ $$
1670
1670
  }
1671
1671
  }
1672
1672
  // { dark: true }
1673
- ), eo = $t.define([
1674
- { tag: s.keyword, color: Yl },
1673
+ ), to = $t.define([
1674
+ { tag: s.keyword, color: Zl },
1675
1675
  { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: mt },
1676
- { tag: [s.function(s.variableName), s.labelName], color: Wl },
1676
+ { tag: [s.function(s.variableName), s.labelName], color: zl },
1677
1677
  { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: gt },
1678
1678
  { tag: [s.definition(s.name), s.separator], color: ae },
1679
1679
  {
@@ -1687,7 +1687,7 @@ $$
1687
1687
  s.self,
1688
1688
  s.namespace
1689
1689
  ],
1690
- color: Kl
1690
+ color: jl
1691
1691
  },
1692
1692
  {
1693
1693
  tag: [
@@ -1699,7 +1699,7 @@ $$
1699
1699
  s.link,
1700
1700
  s.special(s.string)
1701
1701
  ],
1702
- color: jl
1702
+ color: _l
1703
1703
  },
1704
1704
  { tag: [s.meta, s.comment], color: ft },
1705
1705
  { tag: s.strong, fontWeight: "bold" },
@@ -1708,40 +1708,40 @@ $$
1708
1708
  { tag: s.link, color: ft, textDecoration: "underline" },
1709
1709
  { tag: s.heading, fontWeight: "bold", color: mt },
1710
1710
  { tag: [s.atom, s.bool, s.special(s.variableName)], color: gt },
1711
- { tag: [s.processingInstruction, s.string, s.inserted], color: zl },
1712
- { tag: s.invalid, color: _l }
1713
- ]), to = [
1714
- Ql,
1715
- yt(eo)
1716
- ], se = (e, r, l, a, n) => (i, u, d, c) => {
1717
- const m = `${e}${r}`.slice(c - d);
1718
- i.dispatch(i.state.replaceSelection(`${m}${l}${a}`));
1719
- const f = d + u.label.length + (n === "title" ? l.length : 0);
1711
+ { tag: [s.processingInstruction, s.string, s.inserted], color: Yl },
1712
+ { tag: s.invalid, color: Wl }
1713
+ ]), lo = [
1714
+ eo,
1715
+ yt(to)
1716
+ ], se = (e, a, l, n, r) => (i, u, d, c) => {
1717
+ const f = `${e}${a}`.slice(c - d);
1718
+ i.dispatch(i.state.replaceSelection(`${f}${l}${n}`));
1719
+ const m = d + u.label.length + (r === "title" ? l.length : 0);
1720
1720
  i.dispatch({
1721
1721
  selection: P.create(
1722
1722
  [
1723
1723
  P.range(
1724
- d + u.label.length + (n === "title" ? 1 : -r.length),
1725
- f
1724
+ d + u.label.length + (r === "title" ? 1 : -a.length),
1725
+ m
1726
1726
  ),
1727
- P.cursor(f)
1727
+ P.cursor(m)
1728
1728
  ],
1729
1729
  1
1730
1730
  )
1731
1731
  }), i.focus();
1732
- }, vt = (e) => (r, l, a, n) => {
1733
- const i = e.slice(n - a);
1734
- r.dispatch(r.state.replaceSelection(`${i} `));
1735
- }, lo = (e) => {
1736
- const r = (l) => {
1737
- const a = l.matchBefore(
1732
+ }, vt = (e) => (a, l, n, r) => {
1733
+ const i = e.slice(r - n);
1734
+ a.dispatch(a.state.replaceSelection(`${i} `));
1735
+ }, oo = (e) => {
1736
+ const a = (l) => {
1737
+ const n = l.matchBefore(
1738
1738
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
1739
1739
  );
1740
- return a === null || a.from == a.to && l.explicit ? null : {
1741
- from: a.from,
1740
+ return n === null || n.from == n.to && l.explicit ? null : {
1741
+ from: n.from,
1742
1742
  options: [
1743
1743
  // 标题
1744
- ...["h1", "h2", "h3", "h4", "h5", "h6"].map((n, i) => {
1744
+ ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
1745
1745
  const u = new Array(i + 1).fill("#").join("");
1746
1746
  return {
1747
1747
  label: u,
@@ -1750,8 +1750,8 @@ $$
1750
1750
  };
1751
1751
  }),
1752
1752
  // 任务列表
1753
- ...["unchecked", "checked"].map((n) => {
1754
- const i = n === "checked" ? "- [x]" : "- [ ]";
1753
+ ...["unchecked", "checked"].map((r) => {
1754
+ const i = r === "checked" ? "- [x]" : "- [ ]";
1755
1755
  return {
1756
1756
  label: i,
1757
1757
  type: "text",
@@ -1763,10 +1763,10 @@ $$
1763
1763
  ["`", ""],
1764
1764
  ["```", "language"],
1765
1765
  ["```mermaid\n", ""]
1766
- ].map((n) => ({
1767
- label: `${n[0]}${n[1]}`,
1766
+ ].map((r) => ({
1767
+ label: `${r[0]}${r[1]}`,
1768
1768
  type: "text",
1769
- apply: se(n[0], n[1], "", n[0] === "`" ? "`" : "\n```", "type")
1769
+ apply: se(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1770
1770
  })),
1771
1771
  // 链接
1772
1772
  {
@@ -1818,27 +1818,27 @@ $$`, "title")
1818
1818
  "caution",
1819
1819
  "error",
1820
1820
  "attention"
1821
- ].map((n) => ({
1822
- label: `!!! ${n}`,
1821
+ ].map((r) => ({
1822
+ label: `!!! ${r}`,
1823
1823
  type: "text",
1824
- apply: se("!!!", ` ${n}`, " Title", `
1824
+ apply: se("!!!", ` ${r}`, " Title", `
1825
1825
 
1826
1826
  !!!`, "title")
1827
1827
  }))
1828
1828
  ]
1829
1829
  };
1830
1830
  };
1831
- return ul({
1832
- override: e ? [r, ll, ...e] : [r]
1831
+ return ml({
1832
+ override: e ? [a, ol, ...e] : [a]
1833
1833
  });
1834
- }, oo = lo, Z = (e) => {
1835
- const r = new cl();
1836
- return (a) => (r.get(e.state) ? e.dispatch({ effects: r.reconfigure(a) }) : e.dispatch({
1837
- effects: dl.appendConfig.of(r.of(a))
1834
+ }, ao = oo, Z = (e) => {
1835
+ const a = new dl();
1836
+ return (n) => (a.get(e.state) ? e.dispatch({ effects: a.reconfigure(n) }) : e.dispatch({
1837
+ effects: ul.appendConfig.of(a.of(n))
1838
1838
  }), !0);
1839
1839
  };
1840
- class ao {
1841
- constructor(r) {
1840
+ class no {
1841
+ constructor(a) {
1842
1842
  K(this, "view");
1843
1843
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
1844
1844
  K(this, "toggleTabSize");
@@ -1850,7 +1850,7 @@ class ao {
1850
1850
  K(this, "toggleDisabled");
1851
1851
  K(this, "toggleReadOnly");
1852
1852
  K(this, "toggleMaxlength");
1853
- this.view = r, this.toggleTabSize = Z(this.view), this.togglePlaceholder = Z(this.view), this.setExtensions = Z(this.view), this.toggleDisabled = Z(this.view), this.toggleReadOnly = Z(this.view), this.toggleMaxlength = Z(this.view);
1853
+ this.view = a, this.toggleTabSize = Z(this.view), this.togglePlaceholder = Z(this.view), this.setExtensions = Z(this.view), this.toggleDisabled = Z(this.view), this.toggleReadOnly = Z(this.view), this.toggleMaxlength = Z(this.view);
1854
1854
  }
1855
1855
  getValue() {
1856
1856
  return this.view.state.doc.toString();
@@ -1862,12 +1862,12 @@ class ao {
1862
1862
  * @param from 插入开始位置
1863
1863
  * @param to 插入结束位置
1864
1864
  */
1865
- setValue(r, l = 0, a = this.view.state.doc.length) {
1865
+ setValue(a, l = 0, n = this.view.state.doc.length) {
1866
1866
  this.view.dispatch({
1867
1867
  changes: {
1868
1868
  from: l,
1869
- to: a,
1870
- insert: r
1869
+ to: n,
1870
+ insert: a
1871
1871
  }
1872
1872
  });
1873
1873
  }
@@ -1875,8 +1875,8 @@ class ao {
1875
1875
  * 获取选中的文本
1876
1876
  */
1877
1877
  getSelectedText() {
1878
- const { from: r, to: l } = this.view.state.selection.main;
1879
- return this.view.state.sliceDoc(r, l);
1878
+ const { from: a, to: l } = this.view.state.selection.main;
1879
+ return this.view.state.sliceDoc(a, l);
1880
1880
  }
1881
1881
  /**
1882
1882
  * 使用新的内容替换选中的内容
@@ -1884,7 +1884,7 @@ class ao {
1884
1884
  * @param text 待替换内容
1885
1885
  * @param options 替换后是否选中
1886
1886
  */
1887
- replaceSelectedText(r, l = {
1887
+ replaceSelectedText(a, l = {
1888
1888
  // 是否选中
1889
1889
  select: !0,
1890
1890
  // 选中时,开始位置的偏移量
@@ -1893,35 +1893,47 @@ class ao {
1893
1893
  deviationEnd: 0,
1894
1894
  // 直接替换所有文本
1895
1895
  replaceAll: !1
1896
- }) {
1897
- if (l.replaceAll) {
1898
- this.setValue(r);
1899
- return;
1900
- }
1901
- const { from: a } = this.view.state.selection.main;
1902
- if (this.view.dispatch(this.view.state.replaceSelection(r)), l.select) {
1903
- const n = a + r.length + l.deviationEnd;
1904
- this.view.dispatch({
1905
- selection: P.create(
1906
- [
1907
- P.range(a + l.deviationStart, n),
1908
- P.cursor(n)
1909
- ],
1910
- 1
1911
- )
1912
- });
1896
+ }, n) {
1897
+ var r;
1898
+ try {
1899
+ if (l.replaceAll) {
1900
+ this.setValue(a);
1901
+ return;
1902
+ }
1903
+ const { from: i } = this.view.state.selection.main;
1904
+ if (this.view.dispatch(this.view.state.replaceSelection(a)), l.select) {
1905
+ const u = i + a.length + l.deviationEnd;
1906
+ this.view.dispatch({
1907
+ selection: P.create(
1908
+ [
1909
+ P.range(i + l.deviationStart, u),
1910
+ P.cursor(u)
1911
+ ],
1912
+ 1
1913
+ )
1914
+ });
1915
+ }
1916
+ this.view.focus();
1917
+ } catch (i) {
1918
+ if ((r = i.message) != null && r.includes("Selection points outside of document"))
1919
+ h.emit(n, "errorCatcher", {
1920
+ name: "overlength",
1921
+ message: "The input text is too long",
1922
+ data: a
1923
+ });
1924
+ else
1925
+ throw i;
1913
1926
  }
1914
- this.view.focus();
1915
1927
  }
1916
1928
  /**
1917
1929
  * 设置tabSize
1918
1930
  *
1919
1931
  * @param tabSize 需要切换的大小
1920
1932
  */
1921
- setTabSize(r) {
1933
+ setTabSize(a) {
1922
1934
  this.toggleTabSize([
1923
- ue.tabSize.of(r),
1924
- sl.of(" ".repeat(r))
1935
+ ue.tabSize.of(a),
1936
+ cl.of(" ".repeat(a))
1925
1937
  ]);
1926
1938
  }
1927
1939
  /**
@@ -1929,76 +1941,84 @@ class ao {
1929
1941
  *
1930
1942
  * @param t 目标内容
1931
1943
  */
1932
- setPlaceholder(r) {
1933
- this.togglePlaceholder(Xt(r));
1944
+ setPlaceholder(a) {
1945
+ this.togglePlaceholder(Qt(a));
1934
1946
  }
1935
- focus(r) {
1936
- if (this.view.focus(), !r)
1947
+ focus(a) {
1948
+ if (this.view.focus(), !a)
1937
1949
  return;
1938
- let l = 0, a = 0, n = 0;
1939
- switch (r) {
1950
+ let l = 0, n = 0, r = 0;
1951
+ switch (a) {
1940
1952
  case "start":
1941
1953
  break;
1942
1954
  case "end": {
1943
- l = a = n = this.getValue().length;
1955
+ l = n = r = this.getValue().length;
1944
1956
  break;
1945
1957
  }
1946
1958
  default:
1947
- l = r.rangeAnchor || r.cursorPos, a = r.rangeHead || r.cursorPos, n = r.cursorPos;
1959
+ l = a.rangeAnchor || a.cursorPos, n = a.rangeHead || a.cursorPos, r = a.cursorPos;
1948
1960
  }
1949
1961
  this.view.dispatch({
1950
1962
  scrollIntoView: !0,
1951
1963
  selection: P.create(
1952
- [P.range(l, a), P.cursor(n)],
1964
+ [P.range(l, n), P.cursor(r)],
1953
1965
  1
1954
1966
  )
1955
1967
  });
1956
1968
  }
1957
- setDisabled(r) {
1958
- this.toggleDisabled([be.editable.of(!r)]);
1969
+ setDisabled(a) {
1970
+ this.toggleDisabled([be.editable.of(!a)]);
1959
1971
  }
1960
- setReadOnly(r) {
1961
- this.toggleReadOnly([ue.readOnly.of(r)]);
1972
+ setReadOnly(a) {
1973
+ this.toggleReadOnly([ue.readOnly.of(a)]);
1962
1974
  }
1963
- setMaxLength(r) {
1975
+ setMaxLength(a) {
1964
1976
  this.toggleMaxlength([
1965
- ue.changeFilter.of((l) => l.newDoc.length <= r)
1977
+ ue.changeFilter.of((l) => l.newDoc.length <= a)
1966
1978
  ]);
1967
1979
  }
1968
1980
  }
1969
1981
  const ro = (e) => {
1970
- const r = A("editorId");
1971
- return (a) => {
1972
- if (a.clipboardData) {
1973
- if (a.clipboardData.files.length > 0) {
1974
- const { files: n } = a.clipboardData;
1975
- h.emit(
1976
- r,
1977
- "uploadImage",
1978
- Array.from(n).filter((i) => /image\/.*/.test(i.type))
1979
- ), a.preventDefault();
1980
- }
1981
- if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
1982
- const n = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1983
- h.emit(r, "replace", "code", {
1984
- mode: n.mode,
1985
- text: a.clipboardData.getData("text/plain")
1986
- }), a.preventDefault();
1987
- }
1982
+ const a = A("editorId");
1983
+ return (n) => {
1984
+ if (!n.clipboardData)
1985
+ return;
1986
+ if (n.clipboardData.files.length > 0) {
1987
+ const { files: i } = n.clipboardData;
1988
+ h.emit(
1989
+ a,
1990
+ "uploadImage",
1991
+ Array.from(i).filter((u) => /image\/.*/.test(u.type))
1992
+ ), n.preventDefault();
1993
+ return;
1988
1994
  }
1995
+ if (e.autoDetectCode && n.clipboardData.types.includes("vscode-editor-data")) {
1996
+ const i = JSON.parse(n.clipboardData.getData("vscode-editor-data"));
1997
+ h.emit(a, "replace", "code", {
1998
+ mode: i.mode,
1999
+ text: n.clipboardData.getData("text/plain")
2000
+ }), n.preventDefault();
2001
+ return;
2002
+ }
2003
+ const r = n.clipboardData.getData("text/plain");
2004
+ e.maxlength && r.length + e.value.length > e.maxlength && h.emit(a, "errorCatcher", {
2005
+ name: "overlength",
2006
+ message: "The input text is too long",
2007
+ data: r
2008
+ });
1989
2009
  };
1990
- }, no = ro, io = (e) => {
1991
- const r = A("editorId");
2010
+ }, io = ro, so = (e) => {
2011
+ const a = A("editorId");
1992
2012
  Y(() => {
1993
- h.on(r, {
2013
+ h.on(a, {
1994
2014
  name: Rt,
1995
2015
  callback(l) {
1996
- var a;
1997
- (a = e.value) == null || a.focus(l);
2016
+ var n;
2017
+ (n = e.value) == null || n.focus(l);
1998
2018
  }
1999
2019
  });
2000
2020
  });
2001
- }, so = io, co = (e, r) => [
2021
+ }, co = so, uo = (e, a) => [
2002
2022
  {
2003
2023
  key: "Ctrl-b",
2004
2024
  mac: "Cmd-b",
@@ -2007,7 +2027,7 @@ const ro = (e) => {
2007
2027
  {
2008
2028
  key: "Ctrl-d",
2009
2029
  mac: "Cmd-d",
2010
- run: al,
2030
+ run: nl,
2011
2031
  preventDefault: !0
2012
2032
  },
2013
2033
  {
@@ -2089,68 +2109,76 @@ const ro = (e) => {
2089
2109
  {
2090
2110
  key: "Ctrl-f",
2091
2111
  mac: "Cmd-f",
2092
- shift: () => r.noPrettier ? !1 : (h.emit(e, "replace", "prettier"), !0)
2112
+ shift: () => a.noPrettier ? !1 : (h.emit(e, "replace", "prettier"), !0)
2093
2113
  },
2094
2114
  {
2095
2115
  any: (L, C) => (C.ctrlKey || C.metaKey) && C.altKey && C.shiftKey && C.code === "KeyT" ? (h.emit(e, "replace", "table"), !0) : !1
2096
2116
  }
2097
- ], uo = co, mo = (e) => {
2098
- const r = A("tabWidth"), l = A("editorId"), a = A("theme"), n = q(), i = St(), u = uo(l, e), d = no(e), c = [
2099
- Qt.of([...u, rl]),
2100
- Jt,
2101
- ol(),
2102
- tl({ codeLanguages: el }),
2117
+ ], mo = uo, fo = (e) => {
2118
+ const a = A("tabWidth"), l = A("editorId"), n = A("theme"), r = q(), i = St(), u = mo(l, e), d = io(e), c = [
2119
+ el.of([...u, rl]),
2120
+ Xt,
2121
+ al(),
2122
+ ll({ codeLanguages: tl }),
2103
2123
  // 横向换行
2104
2124
  ie.lineWrapping,
2105
- ie.updateListener.of((f) => {
2106
- f.docChanged && e.onChange(f.state.doc.toString());
2125
+ ie.updateListener.of((m) => {
2126
+ m.docChanged && e.onChange(m.state.doc.toString());
2107
2127
  }),
2108
2128
  ie.domEventHandlers({
2109
2129
  paste: d,
2110
2130
  blur: e.onBlur,
2111
2131
  focus: e.onFocus,
2112
- input: e.onInput
2132
+ input: (m) => {
2133
+ e.onInput && e.onInput(m);
2134
+ const { data: b } = m;
2135
+ e.maxlength && e.value.length + b.length > e.maxlength && h.emit(l, "errorCatcher", {
2136
+ name: "overlength",
2137
+ message: "The input text is too long",
2138
+ data: b
2139
+ });
2140
+ }
2113
2141
  })
2114
- ], m = () => {
2115
- const f = [
2142
+ ], f = () => {
2143
+ const m = [
2116
2144
  ...c,
2117
- a.value === "light" ? to : Gl,
2118
- oo(e.completions)
2145
+ n.value === "light" ? lo : Kl,
2146
+ ao(e.completions)
2119
2147
  ];
2120
- return z.codeMirrorExtensions(a.value, f, [
2148
+ return z.codeMirrorExtensions(n.value, m, [
2121
2149
  ...u
2122
2150
  ]);
2123
2151
  };
2124
2152
  return Y(() => {
2125
- const f = new ie({
2153
+ const m = new ie({
2126
2154
  doc: e.value,
2127
- parent: n.value
2128
- }), b = new ao(f);
2155
+ parent: r.value
2156
+ }), b = new no(m);
2129
2157
  i.value = b, setTimeout(() => {
2130
- b.setTabSize(r), b.setDisabled(e.disabled), b.setReadOnly(e.readonly), b.setExtensions(m()), e.placeholder && b.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && b.setMaxLength(e.maxlength), e.autofocus && f.focus();
2158
+ b.setTabSize(a), b.setDisabled(e.disabled), b.setReadOnly(e.readonly), b.setExtensions(f()), e.placeholder && b.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && b.setMaxLength(e.maxlength), e.autofocus && m.focus();
2131
2159
  }, 0), h.on(l, {
2132
2160
  name: "ctrlZ",
2133
2161
  callback() {
2134
- nl(f);
2162
+ il(m);
2135
2163
  }
2136
2164
  }), h.on(l, {
2137
2165
  name: "ctrlShiftZ",
2138
2166
  callback() {
2139
- il(f);
2167
+ sl(m);
2140
2168
  }
2141
2169
  }), h.on(l, {
2142
2170
  name: "replace",
2143
2171
  callback($, T = {}) {
2144
2172
  var k;
2145
- const { text: v, options: g } = Dl($, i.value, T);
2146
- (k = i.value) == null || k.replaceSelectedText(v, g);
2173
+ const { text: v, options: g } = Nl($, i.value, T);
2174
+ (k = i.value) == null || k.replaceSelectedText(v, g, l);
2147
2175
  }
2148
2176
  });
2149
2177
  }), H(
2150
- [a, le(e, "completions")],
2178
+ [n, le(e, "completions")],
2151
2179
  () => {
2152
- var f;
2153
- (f = i.value) == null || f.setExtensions(m());
2180
+ var m;
2181
+ (m = i.value) == null || m.setExtensions(f());
2154
2182
  },
2155
2183
  {
2156
2184
  deep: !0
@@ -2158,38 +2186,38 @@ const ro = (e) => {
2158
2186
  ), H(
2159
2187
  () => e.value,
2160
2188
  () => {
2161
- var f, b;
2162
- ((f = i.value) == null ? void 0 : f.getValue()) !== e.value && ((b = i.value) == null || b.setValue(e.value));
2189
+ var m, b;
2190
+ ((m = i.value) == null ? void 0 : m.getValue()) !== e.value && ((b = i.value) == null || b.setValue(e.value));
2163
2191
  }
2164
2192
  ), H(
2165
2193
  () => e.placeholder,
2166
2194
  () => {
2167
- var f;
2168
- (f = i.value) == null || f.setPlaceholder(e.placeholder);
2195
+ var m;
2196
+ (m = i.value) == null || m.setPlaceholder(e.placeholder);
2169
2197
  }
2170
2198
  ), H(
2171
2199
  () => e.disabled,
2172
2200
  () => {
2173
- var f;
2174
- (f = i.value) == null || f.setDisabled(e.disabled);
2201
+ var m;
2202
+ (m = i.value) == null || m.setDisabled(e.disabled);
2175
2203
  }
2176
2204
  ), H(
2177
2205
  () => e.readonly,
2178
2206
  () => {
2179
- var f;
2180
- (f = i.value) == null || f.setDisabled(e.readonly);
2207
+ var m;
2208
+ (m = i.value) == null || m.setDisabled(e.readonly);
2181
2209
  }
2182
2210
  ), H(
2183
2211
  () => e.maxlength,
2184
2212
  () => {
2185
- var f;
2186
- e.maxlength && ((f = i.value) == null || f.setMaxLength(e.maxlength));
2213
+ var m;
2214
+ e.maxlength && ((m = i.value) == null || m.setMaxLength(e.maxlength));
2187
2215
  }
2188
- ), so(i), {
2189
- inputWrapperRef: n,
2216
+ ), co(i), {
2217
+ inputWrapperRef: r,
2190
2218
  codeMirrorUt: i
2191
2219
  };
2192
- }, fo = mo, go = {
2220
+ }, go = fo, ho = {
2193
2221
  value: {
2194
2222
  type: String,
2195
2223
  default: ""
@@ -2292,19 +2320,19 @@ const ro = (e) => {
2292
2320
  onInput: {
2293
2321
  type: Function
2294
2322
  }
2295
- }, ho = /* @__PURE__ */ O({
2323
+ }, bo = /* @__PURE__ */ V({
2296
2324
  name: "MDEditorContent",
2297
- props: go,
2325
+ props: ho,
2298
2326
  setup(e) {
2299
- const r = A("editorId"), l = q(""), {
2300
- inputWrapperRef: a,
2301
- codeMirrorUt: n
2302
- } = fo(e);
2303
- return Il(e, l, n), () => t("div", {
2327
+ const a = A("editorId"), l = q(""), {
2328
+ inputWrapperRef: n,
2329
+ codeMirrorUt: r
2330
+ } = go(e);
2331
+ return Il(e, l, r), () => t("div", {
2304
2332
  class: `${o}-content`
2305
2333
  }, [t("div", {
2306
2334
  class: `${o}-input-wrapper`,
2307
- ref: a
2335
+ ref: n
2308
2336
  }, null), t(Pt, {
2309
2337
  modelValue: e.value,
2310
2338
  setting: e.setting,
@@ -2321,12 +2349,12 @@ const ro = (e) => {
2321
2349
  }, null), e.catalogVisible && t(Tt, {
2322
2350
  theme: e.theme,
2323
2351
  class: `${o}-catalog-editor`,
2324
- editorId: r,
2352
+ editorId: a,
2325
2353
  mdHeadingId: e.mdHeadingId,
2326
2354
  key: "internal-catalog"
2327
2355
  }, null)]);
2328
2356
  }
2329
- }), bo = /* @__PURE__ */ O({
2357
+ }), vo = /* @__PURE__ */ V({
2330
2358
  props: {
2331
2359
  modelValue: {
2332
2360
  type: String,
@@ -2334,17 +2362,17 @@ const ro = (e) => {
2334
2362
  }
2335
2363
  },
2336
2364
  setup(e) {
2337
- const r = A("usedLanguageText");
2365
+ const a = A("usedLanguageText");
2338
2366
  return () => {
2339
- var l, a;
2367
+ var l, n;
2340
2368
  return t("div", {
2341
2369
  class: `${o}-footer-item`
2342
2370
  }, [t("label", {
2343
2371
  class: `${o}-footer-label`
2344
- }, [`${(l = r.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
2372
+ }, [`${(l = a.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((n = e.modelValue) == null ? void 0 : n.length) || 0])]);
2345
2373
  };
2346
2374
  }
2347
- }), vo = {
2375
+ }), ko = {
2348
2376
  checked: {
2349
2377
  type: Boolean,
2350
2378
  default: !1
@@ -2354,8 +2382,8 @@ const ro = (e) => {
2354
2382
  default: () => {
2355
2383
  }
2356
2384
  }
2357
- }, ko = /* @__PURE__ */ O({
2358
- props: vo,
2385
+ }, po = /* @__PURE__ */ V({
2386
+ props: ko,
2359
2387
  setup(e) {
2360
2388
  return () => t("div", {
2361
2389
  class: [`${o}-checkbox`, e.checked && `${o}-checkbox-checked`],
@@ -2364,7 +2392,7 @@ const ro = (e) => {
2364
2392
  }
2365
2393
  }, null);
2366
2394
  }
2367
- }), po = {
2395
+ }), Co = {
2368
2396
  scrollAuto: {
2369
2397
  type: Boolean
2370
2398
  },
@@ -2373,10 +2401,10 @@ const ro = (e) => {
2373
2401
  default: () => {
2374
2402
  }
2375
2403
  }
2376
- }, Co = /* @__PURE__ */ O({
2377
- props: po,
2404
+ }, $o = /* @__PURE__ */ V({
2405
+ props: Co,
2378
2406
  setup(e) {
2379
- const r = A("usedLanguageText");
2407
+ const a = A("usedLanguageText");
2380
2408
  return () => {
2381
2409
  var l;
2382
2410
  return t("div", {
@@ -2386,13 +2414,13 @@ const ro = (e) => {
2386
2414
  onClick: () => {
2387
2415
  e.onScrollAutoChange(!e.scrollAuto);
2388
2416
  }
2389
- }, [(l = r.value.footer) == null ? void 0 : l.scrollAuto]), t(ko, {
2417
+ }, [(l = a.value.footer) == null ? void 0 : l.scrollAuto]), t(po, {
2390
2418
  checked: e.scrollAuto,
2391
2419
  onChange: e.onScrollAutoChange
2392
2420
  }, null)]);
2393
2421
  };
2394
2422
  }
2395
- }), $o = {
2423
+ }), yo = {
2396
2424
  modelValue: {
2397
2425
  type: String,
2398
2426
  default: ""
@@ -2412,91 +2440,91 @@ const ro = (e) => {
2412
2440
  defFooters: {
2413
2441
  type: Object
2414
2442
  }
2415
- }, yo = /* @__PURE__ */ O({
2443
+ }, To = /* @__PURE__ */ V({
2416
2444
  name: "MDEditorFooter",
2417
- props: $o,
2445
+ props: yo,
2418
2446
  setup(e) {
2419
- const r = he(() => {
2420
- const a = e.footers.indexOf("="), n = a === -1 ? e.footers : e.footers.slice(0, a), i = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2421
- return [n, i];
2422
- }), l = (a) => {
2423
- if (It.includes(a))
2424
- switch (a) {
2447
+ const a = he(() => {
2448
+ const n = e.footers.indexOf("="), r = n === -1 ? e.footers : e.footers.slice(0, n), i = n === -1 ? [] : e.footers.slice(n, Number.MAX_SAFE_INTEGER);
2449
+ return [r, i];
2450
+ }), l = (n) => {
2451
+ if (Dt.includes(n))
2452
+ switch (n) {
2425
2453
  case "markdownTotal":
2426
- return t(bo, {
2454
+ return t(vo, {
2427
2455
  modelValue: e.modelValue
2428
2456
  }, null);
2429
2457
  case "scrollSwitch":
2430
- return t(Co, {
2458
+ return t($o, {
2431
2459
  scrollAuto: e.scrollAuto,
2432
2460
  onScrollAutoChange: e.onScrollAutoChange
2433
2461
  }, null);
2434
2462
  }
2435
2463
  else
2436
- return e.defFooters instanceof Array ? e.defFooters[a] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[a] || "";
2464
+ return e.defFooters instanceof Array ? e.defFooters[n] || "" : e.defFooters && e.defFooters.children instanceof Array && e.defFooters.children[n] || "";
2437
2465
  };
2438
2466
  return () => {
2439
- const a = r.value[0].map((i) => l(i)), n = r.value[1].map((i) => l(i));
2467
+ const n = a.value[0].map((i) => l(i)), r = a.value[1].map((i) => l(i));
2440
2468
  return t("div", {
2441
2469
  class: `${o}-footer`
2442
2470
  }, [t("div", {
2443
2471
  class: `${o}-footer-left`
2444
- }, [a]), t("div", {
2472
+ }, [n]), t("div", {
2445
2473
  class: `${o}-footer-right`
2446
- }, [n])]);
2474
+ }, [r])]);
2447
2475
  };
2448
2476
  }
2449
- }), To = /* @__PURE__ */ O({
2477
+ }), wo = /* @__PURE__ */ V({
2450
2478
  name: "MdEditorV3",
2451
2479
  props: qt,
2452
2480
  emits: Ut,
2453
- setup(e, r) {
2481
+ setup(e, a) {
2454
2482
  const {
2455
2483
  editorId: l,
2456
- noKatex: a,
2457
- noMermaid: n,
2484
+ noKatex: n,
2485
+ noMermaid: r,
2458
2486
  noPrettier: i,
2459
2487
  noUploadImg: u,
2460
2488
  noHighlight: d
2461
2489
  } = e, c = J({
2462
2490
  scrollAuto: e.scrollAuto
2463
2491
  });
2464
- Gt(e, r), Kt(e), jt(e);
2465
- const [m, f] = _t(e, r), b = Wt(e);
2492
+ Gt(e, a), Kt(e), jt(e), _t(e, a);
2493
+ const [f, m] = Wt(e, a), b = zt(e);
2466
2494
  return At(() => {
2467
2495
  h.clear(l);
2468
- }), zt(e, r, b, m, f), () => {
2496
+ }), Yt(e, a, b, f, m), () => {
2469
2497
  var v;
2470
- const $ = nt({
2498
+ const $ = rt({
2471
2499
  props: e,
2472
- ctx: r
2473
- }, "defToolbars"), T = nt({
2500
+ ctx: a
2501
+ }, "defToolbars"), T = rt({
2474
2502
  props: e,
2475
- ctx: r
2503
+ ctx: a
2476
2504
  }, "defFooters");
2477
2505
  return t("div", {
2478
2506
  id: l,
2479
- class: [o, e.class, e.theme === "dark" && `${o}-dark`, m.fullscreen || m.pageFullscreen ? `${o}-fullscreen` : ""],
2507
+ class: [o, e.class, e.theme === "dark" && `${o}-dark`, f.fullscreen || f.pageFullscreen ? `${o}-fullscreen` : ""],
2480
2508
  style: e.style
2481
- }, [t(Sl, {
2509
+ }, [t(Al, {
2482
2510
  noPrettier: i,
2483
2511
  toolbars: e.toolbars,
2484
2512
  toolbarsExclude: e.toolbarsExclude,
2485
- setting: m,
2486
- updateSetting: f,
2513
+ setting: f,
2514
+ updateSetting: m,
2487
2515
  tableShape: e.tableShape,
2488
2516
  defToolbars: $,
2489
2517
  noUploadImg: u,
2490
2518
  showToolbarName: e.showToolbarName
2491
- }, null), t(ho, {
2519
+ }, null), t(bo, {
2492
2520
  value: e.modelValue,
2493
- setting: m,
2521
+ setting: f,
2494
2522
  mdHeadingId: e.mdHeadingId,
2495
- noMermaid: n,
2523
+ noMermaid: r,
2496
2524
  noPrettier: i,
2497
2525
  sanitize: e.sanitize,
2498
2526
  placeholder: e.placeholder,
2499
- noKatex: a,
2527
+ noKatex: n,
2500
2528
  scrollAuto: c.scrollAuto,
2501
2529
  formatCopiedText: e.formatCopiedText,
2502
2530
  autofocus: e.autoFocus,
@@ -2506,27 +2534,27 @@ const ro = (e) => {
2506
2534
  autoDetectCode: e.autoDetectCode,
2507
2535
  noHighlight: d,
2508
2536
  onChange: (g) => {
2509
- e.onChange ? e.onChange(g) : (r.emit("update:modelValue", g), r.emit("onChange", g));
2537
+ e.onChange ? e.onChange(g) : (a.emit("update:modelValue", g), a.emit("onChange", g));
2510
2538
  },
2511
2539
  onHtmlChanged: (g) => {
2512
- e.onHtmlChanged ? e.onHtmlChanged(g) : r.emit("onHtmlChanged", g);
2540
+ e.onHtmlChanged ? e.onHtmlChanged(g) : a.emit("onHtmlChanged", g);
2513
2541
  },
2514
2542
  onGetCatalog: (g) => {
2515
- e.onGetCatalog ? e.onGetCatalog(g) : r.emit("onGetCatalog", g);
2543
+ e.onGetCatalog ? e.onGetCatalog(g) : a.emit("onGetCatalog", g);
2516
2544
  },
2517
2545
  onBlur: (g) => {
2518
- e.onBlur ? e.onBlur(g) : r.emit("onBlur", g);
2546
+ e.onBlur ? e.onBlur(g) : a.emit("onBlur", g);
2519
2547
  },
2520
2548
  onFocus: (g) => {
2521
- e.onFocus ? e.onFocus(g) : r.emit("onFocus", g);
2549
+ e.onFocus ? e.onFocus(g) : a.emit("onFocus", g);
2522
2550
  },
2523
2551
  onInput: (g) => {
2524
- e.onInput ? e.onInput(g) : r.emit("onInput", g);
2552
+ e.onInput ? e.onInput(g) : a.emit("onInput", g);
2525
2553
  },
2526
2554
  completions: e.completions,
2527
2555
  catalogVisible: b.value,
2528
2556
  theme: e.theme
2529
- }, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(yo, {
2557
+ }, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(To, {
2530
2558
  modelValue: e.modelValue,
2531
2559
  footers: e.footers,
2532
2560
  defFooters: T,
@@ -2535,8 +2563,8 @@ const ro = (e) => {
2535
2563
  }, null)]);
2536
2564
  };
2537
2565
  }
2538
- }), ge = To;
2539
- ge.install = (e) => (e.component(ge.name, ge), e.use(ml).use(Bt).use(fl).use(Tt).use(Yt), e);
2566
+ }), ge = wo;
2567
+ ge.install = (e) => (e.component(ge.name, ge), e.use(fl).use(Bt).use(gl).use(Tt).use(Zt), e);
2540
2568
  export {
2541
2569
  ge as default
2542
2570
  };