md-editor-v3 4.5.0 → 4.6.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,40 +1,40 @@
1
- var xt = Object.defineProperty;
2
- var St = (e, o, l) => o in e ? xt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
- var U = (e, o, l) => (St(e, typeof o != "symbol" ? o + "" : o, l), l);
4
- import { defineComponent as R, createVNode as t, inject as L, ref as K, onMounted as Y, reactive as Q, computed as ke, watch as B, nextTick as me, Fragment as pt, cloneVNode as nt, toRef as ne, shallowRef as At, onBeforeUnmount as Mt } from "vue";
5
- import { p as n, a as X, s as It, b as Lt, d as Dt } from "./chunks/config.mjs";
6
- import { draggingScroll as Et, linkTo as Ht, debounce as Nt, throttle as Vt, smoothScroll as rt } from "@vavt/util";
7
- import { a as ae, D as Ot } from "./chunks/index2.mjs";
8
- import { b, a as Bt } from "./chunks/index4.mjs";
9
- import { C as Ft, a as Rt, O as Ct, T as Pt, c as qt, b as Ut, e as Gt, d as Kt, u as _t, f as jt, g as Wt, h as zt, i as Zt, j as Xt, k as Yt, M as Jt } from "./chunks/index.mjs";
10
- import { a as Qt } from "./chunks/dom.mjs";
11
- import { M as $t, I as C } from "./chunks/index3.mjs";
12
- import { minimalSetup as el, EditorView as ue } from "codemirror";
13
- import { EditorView as pe, placeholder as tl, keymap as ll } from "@codemirror/view";
14
- import { languages as ol } from "@codemirror/language-data";
15
- import { markdown as al } from "@codemirror/lang-markdown";
16
- import { deleteLine as nl, indentWithTab as rl, undo as il, redo as sl } from "@codemirror/commands";
17
- import { HighlightStyle as yt, syntaxHighlighting as Tt, indentUnit as cl } from "@codemirror/language";
1
+ var Dt = Object.defineProperty;
2
+ var It = (e, o, l) => o in e ? Dt(e, o, { enumerable: !0, configurable: !0, writable: !0, value: l }) : e[o] = l;
3
+ var q = (e, o, l) => (It(e, typeof o != "symbol" ? o + "" : o, l), l);
4
+ import { defineComponent as P, createVNode as t, inject as I, ref as K, onMounted as J, reactive as ee, computed as ye, watch as B, nextTick as be, Fragment as yt, cloneVNode as ct, toRef as se, shallowRef as Et, onBeforeUnmount as Ht } from "vue";
5
+ import { p as n, a as Y, s as Nt, b as Ot, d as Vt } from "./chunks/config.mjs";
6
+ import { draggingScroll as Ft, linkTo as Bt, debounce as Rt, createSmoothScroll as Pt, throttle as Ut } from "@vavt/util";
7
+ import { a as ie, D as _t } from "./chunks/index2.mjs";
8
+ import { b, C as qt, E as te, U as Te, a as Gt, O as $e, R as w, c as Kt, d as Tt, e as wt, f as xt, T as jt } from "./chunks/index4.mjs";
9
+ import { a as Wt } from "./chunks/dom.mjs";
10
+ import { M as St, I as p } from "./chunks/index3.mjs";
11
+ import { minimalSetup as zt, EditorView as ge } from "codemirror";
12
+ import { EditorView as we, placeholder as Zt, keymap as Xt } from "@codemirror/view";
13
+ import { languages as Yt } from "@codemirror/language-data";
14
+ import { markdown as Jt } from "@codemirror/lang-markdown";
15
+ import { deleteLine as Qt, indentWithTab as el, undo as tl, redo as ll } from "@codemirror/commands";
16
+ import { HighlightStyle as At, syntaxHighlighting as Mt, indentUnit as ol } from "@codemirror/language";
18
17
  import { tags as s } from "@lezer/highlight";
19
- import { EditorSelection as G, EditorState as fe, Compartment as ul, StateEffect as dl } from "@codemirror/state";
20
- import { autocompletion as ml } from "@codemirror/autocomplete";
21
- import wt from "./MdCatalog.mjs";
22
- import { g as it } from "./chunks/vue-tsx.mjs";
23
- import gl from "./NormalToolbar.mjs";
24
- import fl from "./ModalToolbar.mjs";
18
+ import { EditorSelection as G, EditorState as ve, Compartment as al, StateEffect as nl } from "@codemirror/state";
19
+ import { autocompletion as rl } from "@codemirror/autocomplete";
20
+ import { c as il, C as sl, e as cl, a as ul, u as dl, b as ml, d as gl, f as fl, g as bl, h as hl, i as vl, M as kl } from "./chunks/index.mjs";
21
+ import Lt from "./MdCatalog.mjs";
22
+ import { g as ut } from "./chunks/vue-tsx.mjs";
23
+ import Cl from "./NormalToolbar.mjs";
24
+ import pl from "./ModalToolbar.mjs";
25
25
  import "medium-zoom";
26
26
  import "copy-to-clipboard";
27
27
  import "markdown-it";
28
28
  import "markdown-it-image-figures";
29
29
  import "markdown-it-task-lists";
30
30
  import "lru-cache";
31
- const bl = /* @__PURE__ */ R({
31
+ const $l = /* @__PURE__ */ P({
32
32
  setup() {
33
33
  return () => t("div", {
34
34
  class: `${n}-divider`
35
35
  }, null);
36
36
  }
37
- }), hl = {
37
+ }), yl = {
38
38
  noPrettier: {
39
39
  type: Boolean
40
40
  },
@@ -83,38 +83,38 @@ const bl = /* @__PURE__ */ R({
83
83
  showToolbarName: {
84
84
  type: Boolean
85
85
  }
86
- }, vl = (e) => {
87
- var c, g, m, h;
88
- const o = L("editorId");
89
- let l = (g = (c = X.editorExtensions) == null ? void 0 : c.screenfull) == null ? void 0 : g.instance;
90
- const a = (h = (m = X.editorExtensions) == null ? void 0 : m.screenfull) == null ? void 0 : h.js, r = K(!1), i = ($) => {
86
+ }, Tl = (e) => {
87
+ var u, m, d, v;
88
+ const o = I("editorId");
89
+ let l = (m = (u = Y.editorExtensions) == null ? void 0 : u.screenfull) == null ? void 0 : m.instance;
90
+ const a = (v = (d = Y.editorExtensions) == null ? void 0 : d.screenfull) == null ? void 0 : v.js, r = K(!1), i = ($) => {
91
91
  if (!l) {
92
- b.emit(o, "errorCatcher", {
92
+ b.emit(o, te, {
93
93
  name: "fullscreen",
94
94
  message: "fullscreen is undefined"
95
95
  });
96
96
  return;
97
97
  }
98
98
  l.isEnabled ? (r.value = !0, ($ === void 0 ? !l.isFullscreen : $) ? l.request() : l.exit()) : console.error("browser does not support screenfull!");
99
- }, d = () => {
99
+ }, g = () => {
100
100
  l && l.isEnabled && l.on("change", () => {
101
101
  (r.value || e.setting.fullscreen) && (r.value = !1, e.updateSetting("fullscreen"));
102
102
  });
103
- }, u = () => {
104
- l = window.screenfull, d();
103
+ }, c = () => {
104
+ l = window.screenfull, g();
105
105
  };
106
- return Y(() => {
107
- if (d(), !l) {
106
+ return J(() => {
107
+ if (g(), !l) {
108
108
  const $ = document.createElement("script");
109
- $.src = a || It, $.onload = u, $.id = `${n}-screenfull`, Qt($, "screenfull");
109
+ $.src = a || Nt, $.onload = c, $.id = `${n}-screenfull`, Wt($, "screenfull");
110
110
  }
111
- }), Y(() => {
111
+ }), J(() => {
112
112
  b.on(o, {
113
- name: Ft,
113
+ name: qt,
114
114
  callback: i
115
115
  });
116
116
  }), { fullscreenHandler: i };
117
- }, kl = {
117
+ }, wl = {
118
118
  tableShape: {
119
119
  type: Array,
120
120
  default: () => [6, 4]
@@ -124,11 +124,11 @@ const bl = /* @__PURE__ */ R({
124
124
  default: () => {
125
125
  }
126
126
  }
127
- }, pl = /* @__PURE__ */ R({
127
+ }, xl = /* @__PURE__ */ P({
128
128
  name: "TableShape",
129
- props: kl,
129
+ props: wl,
130
130
  setup(e) {
131
- const o = Q({
131
+ const o = ee({
132
132
  x: -1,
133
133
  y: -1
134
134
  });
@@ -153,7 +153,7 @@ const bl = /* @__PURE__ */ R({
153
153
  class: [`${n}-table-shape-col-default`, a <= o.x && i <= o.y && `${n}-table-shape-col-include`]
154
154
  }, null)]))]))]);
155
155
  }
156
- }), Cl = pl, $l = {
156
+ }), Sl = xl, Al = {
157
157
  type: {
158
158
  type: String,
159
159
  default: "link"
@@ -172,20 +172,20 @@ const bl = /* @__PURE__ */ R({
172
172
  default: () => {
173
173
  }
174
174
  }
175
- }, yl = /* @__PURE__ */ R({
176
- props: $l,
175
+ }, Ml = /* @__PURE__ */ P({
176
+ props: Al,
177
177
  setup(e) {
178
- const o = L("usedLanguageText"), l = L("editorId"), a = ke(() => {
179
- var i, d;
178
+ const o = I("usedLanguageText"), l = I("editorId"), a = ye(() => {
179
+ var i, g;
180
180
  switch (e.type) {
181
181
  case "link":
182
182
  return (i = o.value.linkModalTips) == null ? void 0 : i.linkTitle;
183
183
  case "image":
184
- return (d = o.value.linkModalTips) == null ? void 0 : d.imageTitle;
184
+ return (g = o.value.linkModalTips) == null ? void 0 : g.imageTitle;
185
185
  default:
186
186
  return "";
187
187
  }
188
- }), r = Q({
188
+ }), r = ee({
189
189
  desc: "",
190
190
  url: ""
191
191
  });
@@ -193,26 +193,26 @@ const bl = /* @__PURE__ */ R({
193
193
  i || setTimeout(() => {
194
194
  r.desc = "", r.url = "";
195
195
  }, 200);
196
- }), () => t($t, {
196
+ }), () => t(St, {
197
197
  title: a.value,
198
198
  visible: e.visible,
199
199
  onClose: e.onCancel
200
200
  }, {
201
201
  default: () => {
202
- var i, d, u, c, g;
202
+ var i, g, c, u, m;
203
203
  return [t("div", {
204
204
  class: `${n}-form-item`
205
205
  }, [t("label", {
206
206
  class: `${n}-label`,
207
207
  for: `link-desc-${l}`
208
208
  }, [(i = o.value.linkModalTips) == null ? void 0 : i.descLabel]), t("input", {
209
- placeholder: (d = o.value.linkModalTips) == null ? void 0 : d.descLabelPlaceHolder,
209
+ placeholder: (g = o.value.linkModalTips) == null ? void 0 : g.descLabelPlaceHolder,
210
210
  class: `${n}-input`,
211
211
  id: `link-desc-${l}`,
212
212
  type: "text",
213
213
  value: r.desc,
214
- onChange: (m) => {
215
- r.desc = m.target.value;
214
+ onChange: (d) => {
215
+ r.desc = d.target.value;
216
216
  },
217
217
  autocomplete: "off"
218
218
  }, null)]), t("div", {
@@ -220,14 +220,14 @@ const bl = /* @__PURE__ */ R({
220
220
  }, [t("label", {
221
221
  class: `${n}-label`,
222
222
  for: `link-url-${l}`
223
- }, [(u = o.value.linkModalTips) == null ? void 0 : u.urlLabel]), t("input", {
224
- placeholder: (c = o.value.linkModalTips) == null ? void 0 : c.urlLabelPlaceHolder,
223
+ }, [(c = o.value.linkModalTips) == null ? void 0 : c.urlLabel]), t("input", {
224
+ placeholder: (u = o.value.linkModalTips) == null ? void 0 : u.urlLabelPlaceHolder,
225
225
  class: `${n}-input`,
226
226
  id: `link-url-${l}`,
227
227
  type: "text",
228
228
  value: r.url,
229
- onChange: (m) => {
230
- r.url = m.target.value;
229
+ onChange: (d) => {
230
+ r.url = d.target.value;
231
231
  },
232
232
  autocomplete: "off"
233
233
  }, null)]), t("div", {
@@ -238,11 +238,11 @@ const bl = /* @__PURE__ */ R({
238
238
  onClick: () => {
239
239
  e.onOk(r), r.desc = "", r.url = "";
240
240
  }
241
- }, [(g = o.value.linkModalTips) == null ? void 0 : g.buttonOK])])];
241
+ }, [(m = o.value.linkModalTips) == null ? void 0 : m.buttonOK])])];
242
242
  }
243
243
  });
244
244
  }
245
- }), Tl = {
245
+ }), Ll = {
246
246
  visible: {
247
247
  type: Boolean,
248
248
  default: !1
@@ -257,82 +257,82 @@ const bl = /* @__PURE__ */ R({
257
257
  default: () => {
258
258
  }
259
259
  }
260
- }, wl = /* @__PURE__ */ R({
261
- props: Tl,
260
+ }, Dl = /* @__PURE__ */ P({
261
+ props: Ll,
262
262
  setup(e) {
263
- var m, h, $;
264
- const o = L("usedLanguageText"), l = L("editorId");
265
- let a = ($ = (h = (m = X) == null ? void 0 : m.editorExtensions) == null ? void 0 : h.cropper) == null ? void 0 : $.instance;
266
- const r = K(), i = K(), d = K(), u = Q({
263
+ var d, v, $;
264
+ const o = I("usedLanguageText"), l = I("editorId");
265
+ let a = ($ = (v = (d = Y) == null ? void 0 : d.editorExtensions) == null ? void 0 : v.cropper) == null ? void 0 : $.instance;
266
+ const r = K(), i = K(), g = K(), c = ee({
267
267
  cropperInited: !1,
268
268
  imgSelected: !1,
269
269
  imgSrc: "",
270
270
  // 是否全屏
271
271
  isFullscreen: !1
272
272
  });
273
- let c = null;
273
+ let u = null;
274
274
  B(() => e.visible, () => {
275
- e.visible && !u.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
275
+ e.visible && !c.cropperInited && (a = a || window.Cropper, r.value.onchange = () => {
276
276
  if (!a) {
277
- b.emit(l, "errorCatcher", {
277
+ b.emit(l, te, {
278
278
  name: "Cropper",
279
279
  message: "Cropper is undefined"
280
280
  });
281
281
  return;
282
282
  }
283
283
  const T = r.value.files || [];
284
- if (u.imgSelected = !0, (T == null ? void 0 : T.length) > 0) {
285
- const v = new FileReader();
286
- v.onload = (f) => {
287
- u.imgSrc = f.target.result, me(() => {
288
- c = new a(i.value, {
284
+ if (c.imgSelected = !0, (T == null ? void 0 : T.length) > 0) {
285
+ const k = new FileReader();
286
+ k.onload = (f) => {
287
+ c.imgSrc = f.target.result, be(() => {
288
+ u = new a(i.value, {
289
289
  viewMode: 2,
290
290
  preview: `.${n}-clip-preview-target`
291
291
  // aspectRatio: 16 / 9,
292
292
  });
293
293
  });
294
- }, v.readAsDataURL(T[0]);
294
+ }, k.readAsDataURL(T[0]);
295
295
  }
296
296
  });
297
- }), B(() => [u.imgSelected], () => {
298
- d.value.style = "";
299
- }), B(() => u.isFullscreen, () => {
300
- me(() => {
301
- c == null || c.destroy(), d.value.style = "", i.value && (c = new a(i.value, {
297
+ }), B(() => [c.imgSelected], () => {
298
+ g.value.style = "";
299
+ }), B(() => c.isFullscreen, () => {
300
+ be(() => {
301
+ u == null || u.destroy(), g.value.style = "", i.value && (u = new a(i.value, {
302
302
  viewMode: 2,
303
303
  preview: `.${n}-clip-preview-target`
304
304
  // aspectRatio: 16 / 9,
305
305
  }));
306
306
  });
307
307
  });
308
- const g = () => {
309
- c.clear(), c.destroy(), c = null, r.value.value = "", u.imgSelected = !1;
308
+ const m = () => {
309
+ u.clear(), u.destroy(), u = null, r.value.value = "", c.imgSelected = !1;
310
310
  };
311
311
  return () => {
312
312
  var T;
313
- return t($t, {
313
+ return t(St, {
314
314
  class: `${n}-modal-clip`,
315
315
  title: (T = o.value.clipModalTips) == null ? void 0 : T.title,
316
316
  visible: e.visible,
317
317
  onClose: e.onCancel,
318
318
  showAdjust: !0,
319
- isFullscreen: u.isFullscreen,
320
- onAdjust: (v) => {
321
- u.isFullscreen = v;
319
+ isFullscreen: c.isFullscreen,
320
+ onAdjust: (k) => {
321
+ c.isFullscreen = k;
322
322
  },
323
323
  width: "668px",
324
324
  height: "421px"
325
325
  }, {
326
326
  default: () => {
327
- var v, f;
327
+ var k, f;
328
328
  return [t("div", {
329
329
  class: `${n}-form-item ${n}-clip`
330
330
  }, [t("div", {
331
331
  class: `${n}-clip-main`
332
- }, [u.imgSelected ? t("div", {
332
+ }, [c.imgSelected ? t("div", {
333
333
  class: `${n}-clip-cropper`
334
334
  }, [t("img", {
335
- src: u.imgSrc,
335
+ src: c.imgSrc,
336
336
  ref: i,
337
337
  style: {
338
338
  display: "none"
@@ -340,33 +340,33 @@ const bl = /* @__PURE__ */ R({
340
340
  alt: ""
341
341
  }, null), t("div", {
342
342
  class: `${n}-clip-delete`,
343
- onClick: g
344
- }, [t(C, {
343
+ onClick: m
344
+ }, [t(p, {
345
345
  name: "delete"
346
346
  }, null)])]) : t("div", {
347
347
  class: `${n}-clip-upload`,
348
348
  onClick: () => {
349
349
  r.value.click();
350
350
  }
351
- }, [t(C, {
351
+ }, [t(p, {
352
352
  name: "upload"
353
353
  }, null)])]), t("div", {
354
354
  class: `${n}-clip-preview`
355
355
  }, [t("div", {
356
356
  class: `${n}-clip-preview-target`,
357
- ref: d
357
+ ref: g
358
358
  }, null)])]), t("div", {
359
359
  class: `${n}-form-item`
360
360
  }, [t("button", {
361
361
  class: `${n}-btn`,
362
362
  type: "button",
363
363
  onClick: () => {
364
- if (c) {
365
- const k = c.getCroppedCanvas();
366
- b.emit(l, "uploadImage", [Bt(k.toDataURL("image/png"))], e.onOk), g();
364
+ if (u) {
365
+ const h = u.getCroppedCanvas();
366
+ b.emit(l, Te, [Gt(h.toDataURL("image/png"))], e.onOk), m();
367
367
  }
368
368
  }
369
- }, [((v = o.value.clipModalTips) == null ? void 0 : v.buttonUpload) || ((f = o.value.linkModalTips) == null ? void 0 : f.buttonOK)])]), t("input", {
369
+ }, [((k = o.value.clipModalTips) == null ? void 0 : k.buttonUpload) || ((f = o.value.linkModalTips) == null ? void 0 : f.buttonOK)])]), t("input", {
370
370
  ref: r,
371
371
  accept: "image/*",
372
372
  type: "file",
@@ -379,7 +379,7 @@ const bl = /* @__PURE__ */ R({
379
379
  });
380
380
  };
381
381
  }
382
- }), xl = {
382
+ }), Il = {
383
383
  type: {
384
384
  type: String,
385
385
  default: "link"
@@ -402,27 +402,27 @@ const bl = /* @__PURE__ */ R({
402
402
  default: () => {
403
403
  }
404
404
  }
405
- }, Sl = /* @__PURE__ */ R({
406
- props: xl,
405
+ }, El = /* @__PURE__ */ P({
406
+ props: Il,
407
407
  setup(e) {
408
- return () => t(pt, null, [t(yl, {
408
+ return () => t(yt, null, [t(Ml, {
409
409
  type: e.type,
410
410
  visible: e.linkVisible,
411
411
  onOk: e.onOk,
412
412
  onCancel: e.onCancel
413
- }, null), t(wl, {
413
+ }, null), t(Dl, {
414
414
  visible: e.clipVisible,
415
415
  onOk: e.onOk,
416
416
  onCancel: e.onCancel
417
417
  }, null)]);
418
418
  }
419
- }), Al = /* @__PURE__ */ R({
419
+ }), Hl = /* @__PURE__ */ P({
420
420
  name: "MDEditorToolbar",
421
- props: hl,
421
+ props: yl,
422
422
  setup(e) {
423
- const o = L("editorId"), l = L("usedLanguageText"), {
423
+ const o = I("editorId"), l = I("usedLanguageText"), {
424
424
  fullscreenHandler: a
425
- } = vl(e), r = `${o}-toolbar-wrapper`, i = K(), d = Q({
425
+ } = Tl(e), r = `${o}-toolbar-wrapper`, i = K(), g = ee({
426
426
  title: !1,
427
427
  catalog: !1,
428
428
  // 图片上传下拉
@@ -432,138 +432,138 @@ const bl = /* @__PURE__ */ R({
432
432
  // mermaid
433
433
  mermaid: !1,
434
434
  katex: !1
435
- }), u = (v, f) => {
436
- b.emit(o, "replace", v, f);
437
- }, c = Q({
435
+ }), c = (k, f) => {
436
+ b.emit(o, w, k, f);
437
+ }, u = ee({
438
438
  type: "link",
439
439
  linkVisible: !1,
440
440
  clipVisible: !1
441
- }), g = K();
442
- Y(() => {
441
+ }), m = K();
442
+ J(() => {
443
443
  b.on(o, {
444
- name: "openModals",
445
- callback(v) {
446
- c.type = v, c.linkVisible = !0;
444
+ name: $e,
445
+ callback(k) {
446
+ u.type = k, u.linkVisible = !0;
447
447
  }
448
448
  });
449
449
  });
450
- const m = ke(() => {
451
- const v = e.toolbars.filter((w) => !e.toolbarsExclude.includes(w)), f = v.indexOf("="), k = f === -1 ? v : v.slice(0, f + 1), y = f === -1 ? [] : v.slice(f, Number.MAX_SAFE_INTEGER);
452
- return [k, y];
453
- }), h = K(), $ = () => {
454
- b.emit(o, "uploadImage", Array.from(h.value.files || [])), h.value.value = "";
450
+ const d = ye(() => {
451
+ const k = e.toolbars.filter((x) => !e.toolbarsExclude.includes(x)), f = k.indexOf("="), h = f === -1 ? k : k.slice(0, f + 1), y = f === -1 ? [] : k.slice(f, Number.MAX_SAFE_INTEGER);
452
+ return [h, y];
453
+ }), v = K(), $ = () => {
454
+ b.emit(o, Te, Array.from(v.value.files || [])), v.value.value = "";
455
455
  };
456
- Y(() => {
457
- h.value.addEventListener("change", $);
456
+ J(() => {
457
+ v.value.addEventListener("change", $);
458
458
  });
459
- const T = (v) => {
460
- var f, k, y, w, x, H, M, ee, S, A, q, P, N, D, E, V, _, j, se, te, Z, W, le, z, O, F, oe, ce, Ce, $e, ye, Te, we, xe, Se, Ae, Me, Ie, Le, De, Ee, He, Ne, Ve, Oe, Be, Fe, Re, Pe, qe, Ue, Ge, Ke, _e, je, We, ze, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at;
461
- if (Lt.includes(v))
462
- switch (v) {
459
+ const T = (k) => {
460
+ var f, h, y, x, S, N, L, le, oe, A, M, _, U, O, E, H, V, j, W, de, ae, X, z, ne, Z, F, R, re, me, xe, Se, Ae, Me, Le, De, Ie, Ee, He, Ne, Oe, Ve, Fe, Be, Re, Pe, Ue, _e, qe, Ge, Ke, je, We, ze, Ze, Xe, Ye, Je, Qe, et, tt, lt, ot, at, nt, rt, it, st;
461
+ if (Ot.includes(k))
462
+ switch (k) {
463
463
  case "-":
464
- return t(bl, null, null);
464
+ return t($l, null, null);
465
465
  case "bold":
466
466
  return t("div", {
467
467
  class: `${n}-toolbar-item`,
468
468
  title: (f = l.value.toolbarTips) == null ? void 0 : f.bold,
469
469
  onClick: () => {
470
- u("bold");
470
+ c("bold");
471
471
  }
472
- }, [t(C, {
472
+ }, [t(p, {
473
473
  name: "bold"
474
474
  }, null), e.showToolbarName && t("div", {
475
475
  class: `${n}-toolbar-item-name`
476
- }, [(k = l.value.toolbarTips) == null ? void 0 : k.bold])]);
476
+ }, [(h = l.value.toolbarTips) == null ? void 0 : h.bold])]);
477
477
  case "underline":
478
478
  return t("div", {
479
479
  class: `${n}-toolbar-item`,
480
480
  title: (y = l.value.toolbarTips) == null ? void 0 : y.underline,
481
481
  onClick: () => {
482
- u("underline");
482
+ c("underline");
483
483
  }
484
- }, [t(C, {
484
+ }, [t(p, {
485
485
  name: "underline"
486
486
  }, null), e.showToolbarName && t("div", {
487
487
  class: `${n}-toolbar-item-name`
488
- }, [(w = l.value.toolbarTips) == null ? void 0 : w.underline])]);
488
+ }, [(x = l.value.toolbarTips) == null ? void 0 : x.underline])]);
489
489
  case "italic":
490
490
  return t("div", {
491
491
  class: `${n}-toolbar-item`,
492
- title: (x = l.value.toolbarTips) == null ? void 0 : x.italic,
492
+ title: (S = l.value.toolbarTips) == null ? void 0 : S.italic,
493
493
  onClick: () => {
494
- u("italic");
494
+ c("italic");
495
495
  }
496
- }, [t(C, {
496
+ }, [t(p, {
497
497
  name: "italic"
498
498
  }, null), e.showToolbarName && t("div", {
499
499
  class: `${n}-toolbar-item-name`
500
- }, [(H = l.value.toolbarTips) == null ? void 0 : H.italic])]);
500
+ }, [(N = l.value.toolbarTips) == null ? void 0 : N.italic])]);
501
501
  case "strikeThrough":
502
502
  return t("div", {
503
503
  class: `${n}-toolbar-item`,
504
- title: (M = l.value.toolbarTips) == null ? void 0 : M.strikeThrough,
504
+ title: (L = l.value.toolbarTips) == null ? void 0 : L.strikeThrough,
505
505
  onClick: () => {
506
- u("strikeThrough");
506
+ c("strikeThrough");
507
507
  }
508
- }, [t(C, {
508
+ }, [t(p, {
509
509
  name: "strike-through"
510
510
  }, null), e.showToolbarName && t("div", {
511
511
  class: `${n}-toolbar-item-name`
512
- }, [(ee = l.value.toolbarTips) == null ? void 0 : ee.strikeThrough])]);
512
+ }, [(le = l.value.toolbarTips) == null ? void 0 : le.strikeThrough])]);
513
513
  case "title":
514
- return t(ae, {
514
+ return t(ie, {
515
515
  relative: `#${r}`,
516
- visible: d.title,
517
- onChange: (p) => {
518
- d.title = p;
516
+ visible: g.title,
517
+ onChange: (C) => {
518
+ g.title = C;
519
519
  },
520
520
  overlay: t("ul", {
521
521
  class: `${n}-menu`,
522
522
  onClick: () => {
523
- d.title = !1;
523
+ g.title = !1;
524
524
  }
525
525
  }, [t("li", {
526
526
  class: `${n}-menu-item`,
527
527
  onClick: () => {
528
- u("h1");
528
+ c("h1");
529
529
  }
530
- }, [(S = l.value.titleItem) == null ? void 0 : S.h1]), t("li", {
530
+ }, [(oe = l.value.titleItem) == null ? void 0 : oe.h1]), t("li", {
531
531
  class: `${n}-menu-item`,
532
532
  onClick: () => {
533
- u("h2");
533
+ c("h2");
534
534
  }
535
535
  }, [(A = l.value.titleItem) == null ? void 0 : A.h2]), t("li", {
536
536
  class: `${n}-menu-item`,
537
537
  onClick: () => {
538
- u("h3");
538
+ c("h3");
539
539
  }
540
- }, [(q = l.value.titleItem) == null ? void 0 : q.h3]), t("li", {
540
+ }, [(M = l.value.titleItem) == null ? void 0 : M.h3]), t("li", {
541
541
  class: `${n}-menu-item`,
542
542
  onClick: () => {
543
- u("h4");
543
+ c("h4");
544
544
  }
545
- }, [(P = l.value.titleItem) == null ? void 0 : P.h4]), t("li", {
545
+ }, [(_ = l.value.titleItem) == null ? void 0 : _.h4]), t("li", {
546
546
  class: `${n}-menu-item`,
547
547
  onClick: () => {
548
- u("h5");
548
+ c("h5");
549
549
  }
550
- }, [(N = l.value.titleItem) == null ? void 0 : N.h5]), t("li", {
550
+ }, [(U = l.value.titleItem) == null ? void 0 : U.h5]), t("li", {
551
551
  class: `${n}-menu-item`,
552
552
  onClick: () => {
553
- u("h6");
553
+ c("h6");
554
554
  }
555
- }, [(D = l.value.titleItem) == null ? void 0 : D.h6])])
555
+ }, [(O = l.value.titleItem) == null ? void 0 : O.h6])])
556
556
  }, {
557
557
  default: () => {
558
- var p, I;
558
+ var C, D;
559
559
  return [t("div", {
560
560
  class: `${n}-toolbar-item`,
561
- title: (p = l.value.toolbarTips) == null ? void 0 : p.title
562
- }, [t(C, {
561
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.title
562
+ }, [t(p, {
563
563
  name: "title"
564
564
  }, null), e.showToolbarName && t("div", {
565
565
  class: `${n}-toolbar-item-name`
566
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.title])])];
566
+ }, [(D = l.value.toolbarTips) == null ? void 0 : D.title])])];
567
567
  }
568
568
  });
569
569
  case "sub":
@@ -571,21 +571,21 @@ const bl = /* @__PURE__ */ R({
571
571
  class: `${n}-toolbar-item`,
572
572
  title: (E = l.value.toolbarTips) == null ? void 0 : E.sub,
573
573
  onClick: () => {
574
- u("sub");
574
+ c("sub");
575
575
  }
576
- }, [t(C, {
576
+ }, [t(p, {
577
577
  name: "sub"
578
578
  }, null), e.showToolbarName && t("div", {
579
579
  class: `${n}-toolbar-item-name`
580
- }, [(V = l.value.toolbarTips) == null ? void 0 : V.sub])]);
580
+ }, [(H = l.value.toolbarTips) == null ? void 0 : H.sub])]);
581
581
  case "sup":
582
582
  return t("div", {
583
583
  class: `${n}-toolbar-item`,
584
- title: (_ = l.value.toolbarTips) == null ? void 0 : _.sup,
584
+ title: (V = l.value.toolbarTips) == null ? void 0 : V.sup,
585
585
  onClick: () => {
586
- u("sup");
586
+ c("sup");
587
587
  }
588
- }, [t(C, {
588
+ }, [t(p, {
589
589
  name: "sup"
590
590
  }, null), e.showToolbarName && t("div", {
591
591
  class: `${n}-toolbar-item-name`
@@ -593,47 +593,47 @@ const bl = /* @__PURE__ */ R({
593
593
  case "quote":
594
594
  return t("div", {
595
595
  class: `${n}-toolbar-item`,
596
- title: (se = l.value.toolbarTips) == null ? void 0 : se.quote,
596
+ title: (W = l.value.toolbarTips) == null ? void 0 : W.quote,
597
597
  onClick: () => {
598
- u("quote");
598
+ c("quote");
599
599
  }
600
- }, [t(C, {
600
+ }, [t(p, {
601
601
  name: "quote"
602
602
  }, null), e.showToolbarName && t("div", {
603
603
  class: `${n}-toolbar-item-name`
604
- }, [(te = l.value.toolbarTips) == null ? void 0 : te.quote])]);
604
+ }, [(de = l.value.toolbarTips) == null ? void 0 : de.quote])]);
605
605
  case "unorderedList":
606
606
  return t("div", {
607
607
  class: `${n}-toolbar-item`,
608
- title: (Z = l.value.toolbarTips) == null ? void 0 : Z.unorderedList,
608
+ title: (ae = l.value.toolbarTips) == null ? void 0 : ae.unorderedList,
609
609
  onClick: () => {
610
- u("unorderedList");
610
+ c("unorderedList");
611
611
  }
612
- }, [t(C, {
612
+ }, [t(p, {
613
613
  name: "unordered-list"
614
614
  }, null), e.showToolbarName && t("div", {
615
615
  class: `${n}-toolbar-item-name`
616
- }, [(W = l.value.toolbarTips) == null ? void 0 : W.unorderedList])]);
616
+ }, [(X = l.value.toolbarTips) == null ? void 0 : X.unorderedList])]);
617
617
  case "orderedList":
618
618
  return t("div", {
619
619
  class: `${n}-toolbar-item`,
620
- title: (le = l.value.toolbarTips) == null ? void 0 : le.orderedList,
620
+ title: (z = l.value.toolbarTips) == null ? void 0 : z.orderedList,
621
621
  onClick: () => {
622
- u("orderedList");
622
+ c("orderedList");
623
623
  }
624
- }, [t(C, {
624
+ }, [t(p, {
625
625
  name: "ordered-list"
626
626
  }, null), e.showToolbarName && t("div", {
627
627
  class: `${n}-toolbar-item-name`
628
- }, [(z = l.value.toolbarTips) == null ? void 0 : z.orderedList])]);
628
+ }, [(ne = l.value.toolbarTips) == null ? void 0 : ne.orderedList])]);
629
629
  case "task":
630
630
  return t("div", {
631
631
  class: `${n}-toolbar-item`,
632
- title: (O = l.value.toolbarTips) == null ? void 0 : O.task,
632
+ title: (Z = l.value.toolbarTips) == null ? void 0 : Z.task,
633
633
  onClick: () => {
634
- u("task");
634
+ c("task");
635
635
  }
636
- }, [t(C, {
636
+ }, [t(p, {
637
637
  name: "task"
638
638
  }, null), e.showToolbarName && t("div", {
639
639
  class: `${n}-toolbar-item-name`
@@ -641,358 +641,358 @@ const bl = /* @__PURE__ */ R({
641
641
  case "codeRow":
642
642
  return t("div", {
643
643
  class: `${n}-toolbar-item`,
644
- title: (oe = l.value.toolbarTips) == null ? void 0 : oe.codeRow,
644
+ title: (R = l.value.toolbarTips) == null ? void 0 : R.codeRow,
645
645
  onClick: () => {
646
- u("codeRow");
646
+ c("codeRow");
647
647
  }
648
- }, [t(C, {
648
+ }, [t(p, {
649
649
  name: "code-row"
650
650
  }, null), e.showToolbarName && t("div", {
651
651
  class: `${n}-toolbar-item-name`
652
- }, [(ce = l.value.toolbarTips) == null ? void 0 : ce.codeRow])]);
652
+ }, [(re = l.value.toolbarTips) == null ? void 0 : re.codeRow])]);
653
653
  case "code":
654
654
  return t("div", {
655
655
  class: `${n}-toolbar-item`,
656
- title: (Ce = l.value.toolbarTips) == null ? void 0 : Ce.code,
656
+ title: (me = l.value.toolbarTips) == null ? void 0 : me.code,
657
657
  onClick: () => {
658
- u("code");
658
+ c("code");
659
659
  }
660
- }, [t(C, {
660
+ }, [t(p, {
661
661
  name: "code"
662
662
  }, null), e.showToolbarName && t("div", {
663
663
  class: `${n}-toolbar-item-name`
664
- }, [($e = l.value.toolbarTips) == null ? void 0 : $e.code])]);
664
+ }, [(xe = l.value.toolbarTips) == null ? void 0 : xe.code])]);
665
665
  case "link":
666
666
  return t("div", {
667
667
  class: `${n}-toolbar-item`,
668
- title: (ye = l.value.toolbarTips) == null ? void 0 : ye.link,
668
+ title: (Se = l.value.toolbarTips) == null ? void 0 : Se.link,
669
669
  onClick: () => {
670
- c.type = "link", c.linkVisible = !0;
670
+ u.type = "link", u.linkVisible = !0;
671
671
  }
672
- }, [t(C, {
672
+ }, [t(p, {
673
673
  name: "link"
674
674
  }, null), e.showToolbarName && t("div", {
675
675
  class: `${n}-toolbar-item-name`
676
- }, [(Te = l.value.toolbarTips) == null ? void 0 : Te.link])]);
676
+ }, [(Ae = l.value.toolbarTips) == null ? void 0 : Ae.link])]);
677
677
  case "image":
678
678
  return e.noUploadImg ? t("div", {
679
679
  class: `${n}-toolbar-item`,
680
- title: (we = l.value.toolbarTips) == null ? void 0 : we.image,
680
+ title: (Me = l.value.toolbarTips) == null ? void 0 : Me.image,
681
681
  onClick: () => {
682
- c.type = "image", c.linkVisible = !0;
682
+ u.type = "image", u.linkVisible = !0;
683
683
  }
684
- }, [t(C, {
684
+ }, [t(p, {
685
685
  name: "image"
686
686
  }, null), e.showToolbarName && t("div", {
687
687
  class: `${n}-toolbar-item-name`
688
- }, [(xe = l.value.toolbarTips) == null ? void 0 : xe.image])]) : t(ae, {
688
+ }, [(Le = l.value.toolbarTips) == null ? void 0 : Le.image])]) : t(ie, {
689
689
  relative: `#${r}`,
690
- visible: d.image,
691
- onChange: (p) => {
692
- d.image = p;
690
+ visible: g.image,
691
+ onChange: (C) => {
692
+ g.image = C;
693
693
  },
694
694
  overlay: t("ul", {
695
695
  class: `${n}-menu`,
696
696
  onClick: () => {
697
- d.title = !1;
697
+ g.title = !1;
698
698
  }
699
699
  }, [t("li", {
700
700
  class: `${n}-menu-item`,
701
701
  onClick: () => {
702
- c.type = "image", c.linkVisible = !0;
702
+ u.type = "image", u.linkVisible = !0;
703
703
  }
704
- }, [(Se = l.value.imgTitleItem) == null ? void 0 : Se.link]), t("li", {
704
+ }, [(De = l.value.imgTitleItem) == null ? void 0 : De.link]), t("li", {
705
705
  class: `${n}-menu-item`,
706
706
  onClick: () => {
707
- h.value.click();
707
+ v.value.click();
708
708
  }
709
- }, [(Ae = l.value.imgTitleItem) == null ? void 0 : Ae.upload]), t("li", {
709
+ }, [(Ie = l.value.imgTitleItem) == null ? void 0 : Ie.upload]), t("li", {
710
710
  class: `${n}-menu-item`,
711
711
  onClick: () => {
712
- c.clipVisible = !0;
712
+ u.clipVisible = !0;
713
713
  }
714
- }, [(Me = l.value.imgTitleItem) == null ? void 0 : Me.clip2upload])])
714
+ }, [(Ee = l.value.imgTitleItem) == null ? void 0 : Ee.clip2upload])])
715
715
  }, {
716
716
  default: () => {
717
- var p, I;
717
+ var C, D;
718
718
  return [t("div", {
719
719
  class: `${n}-toolbar-item`,
720
- title: (p = l.value.toolbarTips) == null ? void 0 : p.image
721
- }, [t(C, {
720
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.image
721
+ }, [t(p, {
722
722
  name: "image"
723
723
  }, null), e.showToolbarName && t("div", {
724
724
  class: `${n}-toolbar-item-name`
725
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.image])])];
725
+ }, [(D = l.value.toolbarTips) == null ? void 0 : D.image])])];
726
726
  }
727
727
  });
728
728
  case "table":
729
- return t(ae, {
729
+ return t(ie, {
730
730
  relative: `#${r}`,
731
- visible: d.table,
732
- onChange: (p) => {
733
- d.table = p;
731
+ visible: g.table,
732
+ onChange: (C) => {
733
+ g.table = C;
734
734
  },
735
735
  key: "bar-table",
736
- overlay: t(Cl, {
736
+ overlay: t(Sl, {
737
737
  tableShape: e.tableShape,
738
- onSelected: (p) => {
739
- u("table", {
740
- selectedShape: p
738
+ onSelected: (C) => {
739
+ c("table", {
740
+ selectedShape: C
741
741
  });
742
742
  }
743
743
  }, null)
744
744
  }, {
745
745
  default: () => {
746
- var p, I;
746
+ var C, D;
747
747
  return [t("div", {
748
748
  class: `${n}-toolbar-item`,
749
- title: (p = l.value.toolbarTips) == null ? void 0 : p.table
750
- }, [t(C, {
749
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.table
750
+ }, [t(p, {
751
751
  name: "table"
752
752
  }, null), e.showToolbarName && t("div", {
753
753
  class: `${n}-toolbar-item-name`
754
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.table])])];
754
+ }, [(D = l.value.toolbarTips) == null ? void 0 : D.table])])];
755
755
  }
756
756
  });
757
757
  case "revoke":
758
758
  return t("div", {
759
759
  class: `${n}-toolbar-item`,
760
- title: (Ie = l.value.toolbarTips) == null ? void 0 : Ie.revoke,
760
+ title: (He = l.value.toolbarTips) == null ? void 0 : He.revoke,
761
761
  onClick: () => {
762
- b.emit(o, "ctrlZ");
762
+ b.emit(o, xt);
763
763
  }
764
- }, [t(C, {
764
+ }, [t(p, {
765
765
  name: "revoke"
766
766
  }, null), e.showToolbarName && t("div", {
767
767
  class: `${n}-toolbar-item-name`
768
- }, [(Le = l.value.toolbarTips) == null ? void 0 : Le.revoke])]);
768
+ }, [(Ne = l.value.toolbarTips) == null ? void 0 : Ne.revoke])]);
769
769
  case "next":
770
770
  return t("div", {
771
771
  class: `${n}-toolbar-item`,
772
- title: (De = l.value.toolbarTips) == null ? void 0 : De.next,
772
+ title: (Oe = l.value.toolbarTips) == null ? void 0 : Oe.next,
773
773
  onClick: () => {
774
- b.emit(o, "ctrlShiftZ");
774
+ b.emit(o, wt);
775
775
  }
776
- }, [t(C, {
776
+ }, [t(p, {
777
777
  name: "next"
778
778
  }, null), e.showToolbarName && t("div", {
779
779
  class: `${n}-toolbar-item-name`
780
- }, [(Ee = l.value.toolbarTips) == null ? void 0 : Ee.next])]);
780
+ }, [(Ve = l.value.toolbarTips) == null ? void 0 : Ve.next])]);
781
781
  case "save":
782
782
  return t("div", {
783
783
  class: `${n}-toolbar-item`,
784
- title: (He = l.value.toolbarTips) == null ? void 0 : He.save,
784
+ title: (Fe = l.value.toolbarTips) == null ? void 0 : Fe.save,
785
785
  onClick: () => {
786
- b.emit(o, Ct);
786
+ b.emit(o, Tt);
787
787
  }
788
- }, [t(C, {
788
+ }, [t(p, {
789
789
  name: "baocun"
790
790
  }, null), e.showToolbarName && t("div", {
791
791
  class: `${n}-toolbar-item-name`
792
- }, [(Ne = l.value.toolbarTips) == null ? void 0 : Ne.save])]);
792
+ }, [(Be = l.value.toolbarTips) == null ? void 0 : Be.save])]);
793
793
  case "prettier":
794
794
  return e.noPrettier ? "" : t("div", {
795
795
  class: `${n}-toolbar-item`,
796
- title: (Ve = l.value.toolbarTips) == null ? void 0 : Ve.prettier,
796
+ title: (Re = l.value.toolbarTips) == null ? void 0 : Re.prettier,
797
797
  onClick: () => {
798
- u("prettier");
798
+ c("prettier");
799
799
  }
800
- }, [t(C, {
800
+ }, [t(p, {
801
801
  name: "prettier"
802
802
  }, null), e.showToolbarName && t("div", {
803
803
  class: `${n}-toolbar-item-name`
804
- }, [(Oe = l.value.toolbarTips) == null ? void 0 : Oe.prettier])]);
804
+ }, [(Pe = l.value.toolbarTips) == null ? void 0 : Pe.prettier])]);
805
805
  case "pageFullscreen":
806
806
  return !e.setting.fullscreen && t("div", {
807
807
  class: `${n}-toolbar-item`,
808
- title: (Be = l.value.toolbarTips) == null ? void 0 : Be.pageFullscreen,
808
+ title: (Ue = l.value.toolbarTips) == null ? void 0 : Ue.pageFullscreen,
809
809
  onClick: () => {
810
810
  e.updateSetting("pageFullscreen");
811
811
  }
812
- }, [t(C, {
812
+ }, [t(p, {
813
813
  name: e.setting.pageFullscreen ? "suoxiao" : "fangda"
814
814
  }, null), e.showToolbarName && t("div", {
815
815
  class: `${n}-toolbar-item-name`
816
- }, [(Fe = l.value.toolbarTips) == null ? void 0 : Fe.pageFullscreen])]);
816
+ }, [(_e = l.value.toolbarTips) == null ? void 0 : _e.pageFullscreen])]);
817
817
  case "fullscreen":
818
818
  return t("div", {
819
819
  class: `${n}-toolbar-item`,
820
- title: (Re = l.value.toolbarTips) == null ? void 0 : Re.fullscreen,
820
+ title: (qe = l.value.toolbarTips) == null ? void 0 : qe.fullscreen,
821
821
  onClick: () => {
822
822
  a();
823
823
  }
824
- }, [t(C, {
824
+ }, [t(p, {
825
825
  name: e.setting.fullscreen ? "fullscreen-exit" : "fullscreen"
826
826
  }, null), e.showToolbarName && t("div", {
827
827
  class: `${n}-toolbar-item-name`
828
- }, [(Pe = l.value.toolbarTips) == null ? void 0 : Pe.fullscreen])]);
828
+ }, [(Ge = l.value.toolbarTips) == null ? void 0 : Ge.fullscreen])]);
829
829
  case "preview":
830
830
  return t("div", {
831
831
  class: `${n}-toolbar-item`,
832
- title: (qe = l.value.toolbarTips) == null ? void 0 : qe.preview,
832
+ title: (Ke = l.value.toolbarTips) == null ? void 0 : Ke.preview,
833
833
  onClick: () => {
834
834
  e.updateSetting("preview");
835
835
  }
836
- }, [t(C, {
836
+ }, [t(p, {
837
837
  name: "preview"
838
838
  }, null), e.showToolbarName && t("div", {
839
839
  class: `${n}-toolbar-item-name`
840
- }, [(Ue = l.value.toolbarTips) == null ? void 0 : Ue.preview])]);
840
+ }, [(je = l.value.toolbarTips) == null ? void 0 : je.preview])]);
841
841
  case "htmlPreview":
842
842
  return t("div", {
843
843
  class: `${n}-toolbar-item`,
844
- title: (Ge = l.value.toolbarTips) == null ? void 0 : Ge.htmlPreview,
844
+ title: (We = l.value.toolbarTips) == null ? void 0 : We.htmlPreview,
845
845
  onClick: () => {
846
846
  e.updateSetting("htmlPreview");
847
847
  }
848
- }, [t(C, {
848
+ }, [t(p, {
849
849
  name: "coding"
850
850
  }, null), e.showToolbarName && t("div", {
851
851
  class: `${n}-toolbar-item-name`
852
- }, [(Ke = l.value.toolbarTips) == null ? void 0 : Ke.htmlPreview])]);
852
+ }, [(ze = l.value.toolbarTips) == null ? void 0 : ze.htmlPreview])]);
853
853
  case "catalog":
854
854
  return t("div", {
855
855
  class: `${n}-toolbar-item`,
856
- title: (_e = l.value.toolbarTips) == null ? void 0 : _e.catalog,
856
+ title: (Ze = l.value.toolbarTips) == null ? void 0 : Ze.catalog,
857
857
  onClick: () => {
858
- b.emit(o, Rt);
858
+ b.emit(o, Kt);
859
859
  },
860
860
  key: "bar-catalog"
861
- }, [t(C, {
861
+ }, [t(p, {
862
862
  name: "catalog"
863
863
  }, null), e.showToolbarName && t("div", {
864
864
  class: `${n}-toolbar-item-name`
865
- }, [(je = l.value.toolbarTips) == null ? void 0 : je.catalog])]);
865
+ }, [(Xe = l.value.toolbarTips) == null ? void 0 : Xe.catalog])]);
866
866
  case "github":
867
867
  return t("div", {
868
868
  class: `${n}-toolbar-item`,
869
- title: (We = l.value.toolbarTips) == null ? void 0 : We.github,
870
- onClick: () => Ht("https://github.com/imzbf/md-editor-v3")
871
- }, [t(C, {
869
+ title: (Ye = l.value.toolbarTips) == null ? void 0 : Ye.github,
870
+ onClick: () => Bt("https://github.com/imzbf/md-editor-v3")
871
+ }, [t(p, {
872
872
  name: "github"
873
873
  }, null), e.showToolbarName && t("div", {
874
874
  class: `${n}-toolbar-item-name`
875
- }, [(ze = l.value.toolbarTips) == null ? void 0 : ze.github])]);
875
+ }, [(Je = l.value.toolbarTips) == null ? void 0 : Je.github])]);
876
876
  case "mermaid":
877
- return t(ae, {
877
+ return t(ie, {
878
878
  relative: `#${r}`,
879
- visible: d.mermaid,
880
- onChange: (p) => {
881
- d.mermaid = p;
879
+ visible: g.mermaid,
880
+ onChange: (C) => {
881
+ g.mermaid = C;
882
882
  },
883
883
  overlay: t("ul", {
884
884
  class: `${n}-menu`,
885
885
  onClick: () => {
886
- d.mermaid = !1;
886
+ g.mermaid = !1;
887
887
  }
888
888
  }, [t("li", {
889
889
  class: `${n}-menu-item`,
890
890
  onClick: () => {
891
- u("flow");
891
+ c("flow");
892
892
  }
893
- }, [(Ze = l.value.mermaid) == null ? void 0 : Ze.flow]), t("li", {
893
+ }, [(Qe = l.value.mermaid) == null ? void 0 : Qe.flow]), t("li", {
894
894
  class: `${n}-menu-item`,
895
895
  onClick: () => {
896
- u("sequence");
896
+ c("sequence");
897
897
  }
898
- }, [(Xe = l.value.mermaid) == null ? void 0 : Xe.sequence]), t("li", {
898
+ }, [(et = l.value.mermaid) == null ? void 0 : et.sequence]), t("li", {
899
899
  class: `${n}-menu-item`,
900
900
  onClick: () => {
901
- u("gantt");
901
+ c("gantt");
902
902
  }
903
- }, [(Ye = l.value.mermaid) == null ? void 0 : Ye.gantt]), t("li", {
903
+ }, [(tt = l.value.mermaid) == null ? void 0 : tt.gantt]), t("li", {
904
904
  class: `${n}-menu-item`,
905
905
  onClick: () => {
906
- u("class");
906
+ c("class");
907
907
  }
908
- }, [(Je = l.value.mermaid) == null ? void 0 : Je.class]), t("li", {
908
+ }, [(lt = l.value.mermaid) == null ? void 0 : lt.class]), t("li", {
909
909
  class: `${n}-menu-item`,
910
910
  onClick: () => {
911
- u("state");
911
+ c("state");
912
912
  }
913
- }, [(Qe = l.value.mermaid) == null ? void 0 : Qe.state]), t("li", {
913
+ }, [(ot = l.value.mermaid) == null ? void 0 : ot.state]), t("li", {
914
914
  class: `${n}-menu-item`,
915
915
  onClick: () => {
916
- u("pie");
916
+ c("pie");
917
917
  }
918
- }, [(et = l.value.mermaid) == null ? void 0 : et.pie]), t("li", {
918
+ }, [(at = l.value.mermaid) == null ? void 0 : at.pie]), t("li", {
919
919
  class: `${n}-menu-item`,
920
920
  onClick: () => {
921
- u("relationship");
921
+ c("relationship");
922
922
  }
923
- }, [(tt = l.value.mermaid) == null ? void 0 : tt.relationship]), t("li", {
923
+ }, [(nt = l.value.mermaid) == null ? void 0 : nt.relationship]), t("li", {
924
924
  class: `${n}-menu-item`,
925
925
  onClick: () => {
926
- u("journey");
926
+ c("journey");
927
927
  }
928
- }, [(lt = l.value.mermaid) == null ? void 0 : lt.journey])]),
928
+ }, [(rt = l.value.mermaid) == null ? void 0 : rt.journey])]),
929
929
  key: "bar-mermaid"
930
930
  }, {
931
931
  default: () => {
932
- var p, I;
932
+ var C, D;
933
933
  return [t("div", {
934
934
  class: `${n}-toolbar-item`,
935
- title: (p = l.value.toolbarTips) == null ? void 0 : p.mermaid
936
- }, [t(C, {
935
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.mermaid
936
+ }, [t(p, {
937
937
  name: "mermaid"
938
938
  }, null), e.showToolbarName && t("div", {
939
939
  class: `${n}-toolbar-item-name`
940
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.mermaid])])];
940
+ }, [(D = l.value.toolbarTips) == null ? void 0 : D.mermaid])])];
941
941
  }
942
942
  });
943
943
  case "katex":
944
- return t(ae, {
944
+ return t(ie, {
945
945
  relative: `#${r}`,
946
- visible: d.katex,
947
- onChange: (p) => {
948
- d.katex = p;
946
+ visible: g.katex,
947
+ onChange: (C) => {
948
+ g.katex = C;
949
949
  },
950
950
  overlay: t("ul", {
951
951
  class: `${n}-menu`,
952
952
  onClick: () => {
953
- d.katex = !1;
953
+ g.katex = !1;
954
954
  }
955
955
  }, [t("li", {
956
956
  class: `${n}-menu-item`,
957
957
  onClick: () => {
958
- u("katexInline");
958
+ c("katexInline");
959
959
  }
960
- }, [(ot = l.value.katex) == null ? void 0 : ot.inline]), t("li", {
960
+ }, [(it = l.value.katex) == null ? void 0 : it.inline]), t("li", {
961
961
  class: `${n}-menu-item`,
962
962
  onClick: () => {
963
- u("katexBlock");
963
+ c("katexBlock");
964
964
  }
965
- }, [(at = l.value.katex) == null ? void 0 : at.block])]),
965
+ }, [(st = l.value.katex) == null ? void 0 : st.block])]),
966
966
  key: "bar-katex"
967
967
  }, {
968
968
  default: () => {
969
- var p, I;
969
+ var C, D;
970
970
  return [t("div", {
971
971
  class: `${n}-toolbar-item`,
972
- title: (p = l.value.toolbarTips) == null ? void 0 : p.katex
973
- }, [t(C, {
972
+ title: (C = l.value.toolbarTips) == null ? void 0 : C.katex
973
+ }, [t(p, {
974
974
  name: "formula"
975
975
  }, null), e.showToolbarName && t("div", {
976
976
  class: `${n}-toolbar-item-name`
977
- }, [(I = l.value.toolbarTips) == null ? void 0 : I.katex])])];
977
+ }, [(D = l.value.toolbarTips) == null ? void 0 : D.katex])])];
978
978
  }
979
979
  });
980
980
  }
981
981
  else if (e.defToolbars instanceof Array) {
982
- const p = e.defToolbars[v];
983
- return p ? nt(p, {
984
- insert(ge) {
985
- b.emit(o, "replace", "universal", {
986
- generate: ge
982
+ const C = e.defToolbars[k];
983
+ return C ? ct(C, {
984
+ insert(he) {
985
+ b.emit(o, w, "universal", {
986
+ generate: he
987
987
  });
988
988
  }
989
989
  }) : "";
990
990
  } else if (e.defToolbars && e.defToolbars.children instanceof Array) {
991
- const p = e.defToolbars.children[v];
992
- return p ? nt(p, {
993
- insert(ge) {
994
- b.emit(o, "replace", "universal", {
995
- generate: ge
991
+ const C = e.defToolbars.children[k];
992
+ return C ? ct(C, {
993
+ insert(he) {
994
+ b.emit(o, w, "universal", {
995
+ generate: he
996
996
  });
997
997
  }
998
998
  }) : "";
@@ -1000,14 +1000,14 @@ const bl = /* @__PURE__ */ R({
1000
1000
  return "";
1001
1001
  };
1002
1002
  return B(() => e.toolbars, () => {
1003
- me(() => {
1004
- i.value && Et(i.value);
1003
+ be(() => {
1004
+ i.value && Ft(i.value);
1005
1005
  });
1006
1006
  }, {
1007
1007
  immediate: !0
1008
1008
  }), () => {
1009
- const v = m.value[0].map((k) => T(k)), f = m.value[1].map((k) => T(k));
1010
- return t(pt, null, [e.toolbars.length > 0 && t("div", {
1009
+ const k = d.value[0].map((h) => T(h)), f = d.value[1].map((h) => T(h));
1010
+ return t(yt, null, [e.toolbars.length > 0 && t("div", {
1011
1011
  class: `${n}-toolbar-wrapper`,
1012
1012
  ref: i,
1013
1013
  id: r
@@ -1015,43 +1015,43 @@ const bl = /* @__PURE__ */ R({
1015
1015
  class: [`${n}-toolbar`, e.showToolbarName && `${n}-stn`]
1016
1016
  }, [t("div", {
1017
1017
  class: `${n}-toolbar-left`,
1018
- ref: g
1019
- }, [v]), t("div", {
1018
+ ref: m
1019
+ }, [k]), t("div", {
1020
1020
  class: `${n}-toolbar-right`
1021
1021
  }, [f])])]), t("input", {
1022
- ref: h,
1022
+ ref: v,
1023
1023
  accept: "image/*",
1024
1024
  type: "file",
1025
1025
  multiple: !0,
1026
1026
  style: {
1027
1027
  display: "none"
1028
1028
  }
1029
- }, null), t(Sl, {
1030
- linkVisible: c.linkVisible,
1031
- clipVisible: c.clipVisible,
1032
- type: c.type,
1029
+ }, null), t(El, {
1030
+ linkVisible: u.linkVisible,
1031
+ clipVisible: u.clipVisible,
1032
+ type: u.type,
1033
1033
  onCancel: () => {
1034
- c.linkVisible = !1, c.clipVisible = !1;
1034
+ u.linkVisible = !1, u.clipVisible = !1;
1035
1035
  },
1036
- onOk: (k) => {
1037
- k && u(c.type, {
1038
- desc: k.desc,
1039
- url: k.url
1040
- }), c.linkVisible = !1, c.clipVisible = !1;
1036
+ onOk: (h) => {
1037
+ h && c(u.type, {
1038
+ desc: h.desc,
1039
+ url: h.url
1040
+ }), u.linkVisible = !1, u.clipVisible = !1;
1041
1041
  }
1042
1042
  }, null)]);
1043
1043
  };
1044
1044
  }
1045
- }), Ml = (e, o) => {
1046
- const l = Nt(() => {
1045
+ }), Nl = (e, o) => {
1046
+ const l = Rt(() => {
1047
1047
  e.removeEventListener("scroll", a), e.addEventListener("scroll", a), o.removeEventListener("scroll", a), o.addEventListener("scroll", a);
1048
1048
  }, 50), a = (r) => {
1049
- const i = e.clientHeight, d = o.clientHeight, u = e.scrollHeight, c = o.scrollHeight, g = (u - i) / (c - d);
1049
+ const i = e.clientHeight, g = o.clientHeight, c = e.scrollHeight, u = o.scrollHeight, m = (c - i) / (u - g);
1050
1050
  r.target === e ? (o.removeEventListener("scroll", a), o.scrollTo({
1051
- top: e.scrollTop / g
1051
+ top: e.scrollTop / m
1052
1052
  // behavior: 'smooth'
1053
1053
  }), l()) : (e.removeEventListener("scroll", a), e.scrollTo({
1054
- top: o.scrollTop * g
1054
+ top: o.scrollTop * m
1055
1055
  // behavior: 'smooth'
1056
1056
  }), l());
1057
1057
  };
@@ -1065,252 +1065,254 @@ const bl = /* @__PURE__ */ R({
1065
1065
  e.removeEventListener("scroll", a), o.removeEventListener("scroll", a);
1066
1066
  }
1067
1067
  ];
1068
- }, Il = (e, o, l) => {
1069
- const { view: a } = l, r = (h) => a.lineBlockAt(a.state.doc.line(h).from).top, i = (h) => a.lineBlockAt(a.state.doc.line(h).from).height;
1070
- let d = [];
1068
+ }, Ol = (e, o, l) => {
1069
+ const { view: a } = l, r = Pt(), i = ($) => a.lineBlockAt(a.state.doc.line($).from).top, g = ($) => a.lineBlockAt(a.state.doc.line($).from).height;
1070
+ let c = [];
1071
1071
  const u = () => {
1072
- d = [];
1073
- const h = Array.from(o.querySelectorAll("[data-line]")).map(
1074
- (f) => Number(f.dataset.line) + 1
1075
- ), { lines: $ } = a.state.doc;
1076
- let T = 1, v = h.shift() ?? $;
1077
- for (let f = 1; f <= $; f++)
1078
- f === v && (T = f, v = h.shift() || $ + 1), d.push({
1079
- start: T,
1080
- end: v - 1
1072
+ c = [];
1073
+ const $ = Array.from(o.querySelectorAll("[data-line]")).map(
1074
+ (h) => Number(h.dataset.line) + 1
1075
+ ), { lines: T } = a.state.doc;
1076
+ let k = 1, f = $.shift() ?? T;
1077
+ for (let h = 1; h <= T; h++)
1078
+ h === f && (k = h, f = $.shift() || T + 1), c.push({
1079
+ start: k,
1080
+ end: f - 1
1081
1081
  });
1082
1082
  };
1083
- let c = 0, g = 0;
1084
- const m = Vt((h) => {
1085
- var k, y, w, x, H, M, ee;
1086
- if (!((k = o.firstElementChild) != null && k.firstElementChild))
1083
+ let m = 0, d = 0;
1084
+ const v = Ut(($) => {
1085
+ var y, x, S, N, L, le, oe;
1086
+ if (!((y = o.firstElementChild) != null && y.firstElementChild))
1087
1087
  return;
1088
- const $ = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: T } = a.state.doc.lineAt($.from);
1089
- if (T > d.length || a.state.doc.lines < d[d.length - 1].end)
1088
+ const T = a.lineBlockAtHeight(a.scrollDOM.scrollTop), { number: k } = a.state.doc.lineAt(T.from);
1089
+ if (k > c.length || a.state.doc.lines < c[c.length - 1].end)
1090
1090
  return;
1091
- let v = +getComputedStyle(o).paddingTop.replace("px", "");
1092
- const f = +getComputedStyle(o).paddingBottom.replace("px", "");
1093
- if (h.target === e) {
1094
- if (g !== 0)
1091
+ let f = +getComputedStyle(o).paddingTop.replace("px", "");
1092
+ const h = +getComputedStyle(o).paddingBottom.replace("px", "");
1093
+ if ($.target === e) {
1094
+ if (d !== 0)
1095
1095
  return;
1096
- c++;
1097
- const S = d[T - 1];
1098
- let A = r(S.end) + i(S.end), q = 0;
1099
- const P = r(S.start), N = o.querySelector(`[data-line="${S.start - 1}"]`) || ((y = o.firstElementChild) == null ? void 0 : y.firstElementChild), D = o.querySelector(`[data-line="${S.end}"]`) || ((w = o.lastElementChild) == null ? void 0 : w.lastElementChild);
1100
- let E = 0, V = 0;
1101
- P === 0 ? N === D ? (v = 0, A = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, q = a.scrollDOM.scrollTop / A, E = D.offsetTop + D.offsetHeight - o.clientHeight) : (q = a.scrollDOM.scrollTop / A, E = D.offsetTop) : A > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (q = (a.scrollDOM.scrollTop - P) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - P), V = N.offsetTop, E = o.scrollHeight - o.clientHeight - V + 10) : (q = (a.scrollDOM.scrollTop - P) / (A - P), V = N.offsetTop, E = D.offsetTop - V);
1102
- const _ = V - v + E * q;
1103
- rt(o, _, () => {
1104
- c--;
1096
+ m++;
1097
+ const A = c[k - 1];
1098
+ let M = i(A.end) + g(A.end), _ = 0;
1099
+ const U = i(A.start), O = o.querySelector(`[data-line="${A.start - 1}"]`) || ((x = o.firstElementChild) == null ? void 0 : x.firstElementChild), E = o.querySelector(`[data-line="${A.end}"]`) || ((S = o.lastElementChild) == null ? void 0 : S.lastElementChild);
1100
+ let H = 0, V = 0;
1101
+ U === 0 ? O === E ? (f = 0, M = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight, _ = a.scrollDOM.scrollTop / M, H = E.offsetTop + E.offsetHeight - o.clientHeight) : (_ = a.scrollDOM.scrollTop / M, H = E.offsetTop) : M > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (_ = (a.scrollDOM.scrollTop - U) / (a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight - U), V = O.offsetTop, H = o.scrollHeight - o.clientHeight - V + 10) : (_ = (a.scrollDOM.scrollTop - U) / (M - U), V = O.offsetTop, H = E.offsetTop - V);
1102
+ const j = V - f + H * _;
1103
+ r(o, j, () => {
1104
+ m--;
1105
1105
  });
1106
1106
  } else {
1107
- if (c !== 0)
1107
+ if (m !== 0)
1108
1108
  return;
1109
- g++;
1110
- const S = Array.from(
1109
+ d++;
1110
+ const A = Array.from(
1111
1111
  o.querySelectorAll("[data-line]")
1112
- ), A = o.scrollTop, q = o.scrollHeight;
1113
- let P = S.length === 0 ? 1 : Math.ceil(
1114
- Number(S[S.length - 1].dataset.line) * (A / q)
1115
- ), N = (x = o.firstElementChild) == null ? void 0 : x.firstElementChild;
1116
- for (let O = P; O >= 0; O--) {
1117
- const F = o.querySelector(`[data-line="${O}"]`);
1118
- if (F && F.offsetTop <= A) {
1119
- N = F, P = O;
1112
+ ), M = o.scrollTop, _ = o.scrollHeight;
1113
+ let U = A.length === 0 ? 1 : Math.ceil(
1114
+ Number(A[A.length - 1].dataset.line) * (M / _)
1115
+ ), O = (N = o.firstElementChild) == null ? void 0 : N.firstElementChild;
1116
+ for (let F = U; F >= 0; F--) {
1117
+ const R = o.querySelector(`[data-line="${F}"]`);
1118
+ if (R && R.offsetTop <= M) {
1119
+ O = R, U = F;
1120
1120
  break;
1121
1121
  }
1122
1122
  }
1123
- let D = (H = o.firstElementChild) == null ? void 0 : H.firstElementChild, E = (M = o.firstElementChild) == null ? void 0 : M.lastElementChild;
1124
- for (; S.length > 0; ) {
1125
- const O = S.indexOf(N);
1126
- if (O + 1 >= S.length)
1123
+ let E = (L = o.firstElementChild) == null ? void 0 : L.firstElementChild, H = (le = o.firstElementChild) == null ? void 0 : le.lastElementChild;
1124
+ for (; A.length > 0; ) {
1125
+ const F = A.indexOf(O);
1126
+ if (F + 1 >= A.length)
1127
1127
  break;
1128
- const F = S[O + 1];
1129
- if (O === -1) {
1130
- E = F;
1128
+ const R = A[F + 1];
1129
+ if (F === -1) {
1130
+ H = R;
1131
1131
  break;
1132
1132
  }
1133
- const oe = N.offsetTop;
1134
- if (oe > A) {
1135
- if (O === 0) {
1136
- D = N, E = F;
1133
+ const re = O.offsetTop;
1134
+ if (re > M) {
1135
+ if (F === 0) {
1136
+ E = O, H = R;
1137
1137
  break;
1138
1138
  }
1139
- N = S[O - 1];
1139
+ O = A[F - 1];
1140
1140
  continue;
1141
1141
  }
1142
- const ce = F.offsetTop;
1143
- if (oe <= A && ce > A) {
1144
- D = N, E = F;
1142
+ const me = R.offsetTop;
1143
+ if (re <= M && me > M) {
1144
+ E = O, H = R;
1145
1145
  break;
1146
1146
  }
1147
- N = F;
1147
+ O = R;
1148
1148
  }
1149
- const V = D.offsetTop;
1150
- let _ = E.offsetTop, j = 0;
1151
- const { start: se, end: te } = d[Number(D.dataset.line || 0)], Z = r(se);
1152
- let W = r(te);
1153
- const le = i(te);
1154
- let z = 0;
1155
- D === ((ee = o.firstElementChild) == null ? void 0 : ee.firstElementChild) ? (D === E ? (_ = E.offsetHeight - o.offsetHeight + v + f, z = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : z = W + le - Z, j = Math.max(A / _, 0)) : W > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (j = Math.max(
1156
- (A - V) / (o.scrollHeight - V - o.clientHeight),
1149
+ const V = E.offsetTop;
1150
+ let j = H.offsetTop, W = 0;
1151
+ const { start: de, end: ae } = c[Number(E.dataset.line || 0)], X = i(de);
1152
+ let z = i(ae);
1153
+ const ne = g(ae);
1154
+ let Z = 0;
1155
+ E === ((oe = o.firstElementChild) == null ? void 0 : oe.firstElementChild) ? (E === H ? (j = H.offsetHeight - o.offsetHeight + f + h, Z = a.contentDOM.offsetHeight - a.scrollDOM.offsetHeight) : Z = z + ne - X, W = Math.max(M / j, 0)) : z > a.scrollDOM.scrollHeight - a.scrollDOM.clientHeight ? (W = Math.max(
1156
+ (M - V) / (o.scrollHeight - V - o.clientHeight),
1157
1157
  0
1158
- ), W = r(a.state.doc.lines) + i(a.state.doc.lines), z = 8 + W - Z - e.clientHeight) : (j = Math.max(
1159
- (A - V) / (_ - V),
1158
+ ), z = i(a.state.doc.lines) + g(a.state.doc.lines), Z = 8 + z - X - e.clientHeight) : (W = Math.max(
1159
+ (M - V) / (j - V),
1160
1160
  0
1161
- ), z = W + le - Z), rt(e, Z + z * j, () => {
1162
- g--;
1161
+ ), Z = z + ne - X), r(e, X + Z * W, () => {
1162
+ d--;
1163
1163
  });
1164
1164
  }
1165
1165
  }, 10);
1166
1166
  return [
1167
1167
  () => {
1168
- u(), e.addEventListener("scroll", m), o.addEventListener("scroll", m), e.dispatchEvent(new Event("scroll"));
1168
+ u(), e.addEventListener("scroll", v), o.addEventListener("scroll", v), e.dispatchEvent(new Event("scroll"));
1169
1169
  },
1170
1170
  () => {
1171
- d = [], e.removeEventListener("scroll", m), o.removeEventListener("scroll", m);
1171
+ c = [], e.removeEventListener("scroll", v), o.removeEventListener("scroll", v);
1172
1172
  }
1173
1173
  ];
1174
- }, Ll = (e, o, l) => {
1175
- const a = L("editorId");
1174
+ }, Vl = (e, o, l) => {
1175
+ const a = I("editorId");
1176
1176
  let r = () => {
1177
1177
  }, i = () => {
1178
1178
  };
1179
- const d = () => {
1179
+ const g = () => {
1180
1180
  r();
1181
- const u = document.querySelector(".cm-scroller"), c = document.querySelector(
1181
+ const c = document.querySelector(
1182
+ `#${a} .cm-scroller`
1183
+ ), u = document.querySelector(
1182
1184
  `[id="${a}-preview-wrapper"][data-show="true"]`
1183
- ), g = document.querySelector(
1185
+ ), m = document.querySelector(
1184
1186
  `[id="${a}-html-wrapper"][data-show="true"]`
1185
1187
  );
1186
- (c || g) && ([i, r] = (c ? Il : Ml)(
1187
- u,
1188
- c || g,
1188
+ (u || m) && ([i, r] = (u ? Ol : Nl)(
1189
+ c,
1190
+ u || m,
1189
1191
  l.value
1190
1192
  )), e.scrollAuto && i();
1191
1193
  };
1192
1194
  B(
1193
1195
  [
1194
1196
  o,
1195
- ne(e.setting, "preview"),
1196
- ne(e.setting, "htmlPreview"),
1197
- ne(e.setting, "fullscreen"),
1198
- ne(e.setting, "pageFullscreen")
1197
+ se(e.setting, "preview"),
1198
+ se(e.setting, "htmlPreview"),
1199
+ se(e.setting, "fullscreen"),
1200
+ se(e.setting, "pageFullscreen")
1199
1201
  ],
1200
1202
  () => {
1201
- me(d);
1203
+ be(g);
1202
1204
  }
1203
1205
  ), B(
1204
1206
  () => e.scrollAuto,
1205
- (u) => {
1206
- u ? i() : r();
1207
+ (c) => {
1208
+ c ? i() : r();
1207
1209
  }
1208
- ), Y(d);
1209
- }, Dl = Ll, El = (e, o, l) => {
1210
- var m, h, $, T, v, f;
1211
- let a = "", r = 0, i = 0, d = !0, u = !1;
1212
- const c = o.getSelectedText(), g = (m = X.editorConfig) == null ? void 0 : m.mermaidTemplate;
1210
+ ), J(g);
1211
+ }, Fl = Vl, Bl = (e, o, l) => {
1212
+ var d, v, $, T, k, f;
1213
+ let a = "", r = 0, i = 0, g = !0, c = !1;
1214
+ const u = o.getSelectedText(), m = (d = Y.editorConfig) == null ? void 0 : d.mermaidTemplate;
1213
1215
  if (/^h[1-6]{1}$/.test(e)) {
1214
- const k = e.replace(/^h(\d)/, (y, w) => new Array(Number(w)).fill("#", 0, w).join(""));
1215
- a = `${k} ${c}`, r = k.length + 1;
1216
+ const h = e.replace(/^h(\d)/, (y, x) => new Array(Number(x)).fill("#", 0, x).join(""));
1217
+ a = `${h} ${u}`, r = h.length + 1;
1216
1218
  } else if (e === "prettier") {
1217
- const k = window.prettier || (($ = (h = X.editorExtensions) == null ? void 0 : h.prettier) == null ? void 0 : $.prettierInstance), y = [
1218
- ((T = window.prettierPlugins) == null ? void 0 : T.markdown) || ((f = (v = X.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : f.parserMarkdownInstance)
1219
+ const h = window.prettier || (($ = (v = Y.editorExtensions) == null ? void 0 : v.prettier) == null ? void 0 : $.prettierInstance), y = [
1220
+ ((T = window.prettierPlugins) == null ? void 0 : T.markdown) || ((f = (k = Y.editorExtensions) == null ? void 0 : k.prettier) == null ? void 0 : f.parserMarkdownInstance)
1219
1221
  ];
1220
- !k || y[0] === void 0 ? (b.emit(l.editorId, "errorCatcher", {
1222
+ !h || y[0] === void 0 ? (b.emit(l.editorId, te, {
1221
1223
  name: "prettier",
1222
1224
  message: "prettier is undefined"
1223
- }), a = o.getValue()) : a = k.format(o.getValue(), {
1225
+ }), a = o.getValue()) : a = h.format(o.getValue(), {
1224
1226
  parser: "markdown",
1225
1227
  plugins: y
1226
- }), d = !1, u = !0;
1228
+ }), g = !1, c = !0;
1227
1229
  } else
1228
1230
  switch (e) {
1229
1231
  case "bold": {
1230
- a = `**${c}**`, r = 2, i = -2;
1232
+ a = `**${u}**`, r = 2, i = -2;
1231
1233
  break;
1232
1234
  }
1233
1235
  case "underline": {
1234
- a = `<u>${c}</u>`, r = 3, i = -4;
1236
+ a = `<u>${u}</u>`, r = 3, i = -4;
1235
1237
  break;
1236
1238
  }
1237
1239
  case "italic": {
1238
- a = `*${c}*`, r = 1, i = -1;
1240
+ a = `*${u}*`, r = 1, i = -1;
1239
1241
  break;
1240
1242
  }
1241
1243
  case "strikeThrough": {
1242
- a = `~~${c}~~`, r = 2, i = -2;
1244
+ a = `~~${u}~~`, r = 2, i = -2;
1243
1245
  break;
1244
1246
  }
1245
1247
  case "sub": {
1246
- a = `<sub>${c}</sub>`, r = 5, i = -6;
1248
+ a = `<sub>${u}</sub>`, r = 5, i = -6;
1247
1249
  break;
1248
1250
  }
1249
1251
  case "sup": {
1250
- a = `<sup>${c}</sup>`, r = 5, i = -6;
1252
+ a = `<sup>${u}</sup>`, r = 5, i = -6;
1251
1253
  break;
1252
1254
  }
1253
1255
  case "codeRow": {
1254
- a = "`" + c + "`", r = 1, i = -1;
1256
+ a = "`" + u + "`", r = 1, i = -1;
1255
1257
  break;
1256
1258
  }
1257
1259
  case "quote": {
1258
- a = `> ${c}`, r = 2;
1260
+ a = `> ${u}`, r = 2;
1259
1261
  break;
1260
1262
  }
1261
1263
  case "orderedList": {
1262
- a = `1. ${c}`, r = 3;
1264
+ a = `1. ${u}`, r = 3;
1263
1265
  break;
1264
1266
  }
1265
1267
  case "unorderedList": {
1266
- a = `- ${c}`, r = 2;
1268
+ a = `- ${u}`, r = 2;
1267
1269
  break;
1268
1270
  }
1269
1271
  case "task": {
1270
- a = `- [ ] ${c}`, r = 6;
1272
+ a = `- [ ] ${u}`, r = 6;
1271
1273
  break;
1272
1274
  }
1273
1275
  case "code": {
1274
- const k = l.text || c || "", y = l.mode || "language";
1276
+ const h = l.text || u || "", y = l.mode || "language";
1275
1277
  a = `\`\`\`${y}
1276
- ${k}
1278
+ ${h}
1277
1279
  \`\`\`
1278
1280
  `, r = 3, i = 3 + y.length - a.length;
1279
1281
  break;
1280
1282
  }
1281
1283
  case "table": {
1282
1284
  a = "|";
1283
- const { selectedShape: k = { x: 1, y: 1 } } = l, { x: y, y: w } = k;
1284
- for (let x = 0; x <= w; x++)
1285
+ const { selectedShape: h = { x: 1, y: 1 } } = l, { x: y, y: x } = h;
1286
+ for (let S = 0; S <= x; S++)
1285
1287
  a += " col |";
1286
1288
  a += `
1287
1289
  |`;
1288
- for (let x = 0; x <= w; x++)
1290
+ for (let S = 0; S <= x; S++)
1289
1291
  a += " - |";
1290
- for (let x = 0; x <= y; x++) {
1292
+ for (let S = 0; S <= y; S++) {
1291
1293
  a += `
1292
1294
  |`;
1293
- for (let H = 0; H <= w; H++)
1295
+ for (let N = 0; N <= x; N++)
1294
1296
  a += " content |";
1295
1297
  }
1296
1298
  r = 2, i = 5 - a.length;
1297
1299
  break;
1298
1300
  }
1299
1301
  case "link": {
1300
- const { desc: k, url: y } = l;
1301
- a = `[${k}](${y})`, d = !1;
1302
+ const { desc: h, url: y } = l;
1303
+ a = `[${h}](${y})`, g = !1;
1302
1304
  break;
1303
1305
  }
1304
1306
  case "image": {
1305
- const { desc: k, url: y, urls: w } = l;
1306
- w instanceof Array ? a = w.reduce((x, H) => x + `![${k}](${H})
1307
- `, "") : a = `![${k}](${y})
1308
- `, d = !1;
1307
+ const { desc: h, url: y, urls: x } = l;
1308
+ x instanceof Array ? a = x.reduce((S, N) => S + `![${h}](${N})
1309
+ `, "") : a = `![${h}](${y})
1310
+ `, g = !1;
1309
1311
  break;
1310
1312
  }
1311
1313
  case "flow": {
1312
1314
  a = `\`\`\`mermaid
1313
- ${(g == null ? void 0 : g.flow) || `flowchart TD
1315
+ ${(m == null ? void 0 : m.flow) || `flowchart TD
1314
1316
  Start --> Stop`}
1315
1317
  \`\`\`
1316
1318
  `, r = 3, i = 10 - a.length;
@@ -1318,7 +1320,7 @@ ${(g == null ? void 0 : g.flow) || `flowchart TD
1318
1320
  }
1319
1321
  case "sequence": {
1320
1322
  a = `\`\`\`mermaid
1321
- ${(g == null ? void 0 : g.sequence) || `sequenceDiagram
1323
+ ${(m == null ? void 0 : m.sequence) || `sequenceDiagram
1322
1324
  A->>B: hello!
1323
1325
  B-->>A: hi!
1324
1326
  A-)B: bye!`}
@@ -1328,7 +1330,7 @@ ${(g == null ? void 0 : g.sequence) || `sequenceDiagram
1328
1330
  }
1329
1331
  case "gantt": {
1330
1332
  a = `\`\`\`mermaid
1331
- ${(g == null ? void 0 : g.gantt) || `gantt
1333
+ ${(m == null ? void 0 : m.gantt) || `gantt
1332
1334
  title A Gantt Diagram
1333
1335
  dateFormat YYYY-MM-DD
1334
1336
  section Section
@@ -1340,7 +1342,7 @@ Another task :after a1, 20d`}
1340
1342
  }
1341
1343
  case "class": {
1342
1344
  a = `\`\`\`mermaid
1343
- ${(g == null ? void 0 : g.class) || `classDiagram
1345
+ ${(m == null ? void 0 : m.class) || `classDiagram
1344
1346
  class Animal
1345
1347
  Vehicle <|-- Car`}
1346
1348
  \`\`\`
@@ -1349,7 +1351,7 @@ ${(g == null ? void 0 : g.class) || `classDiagram
1349
1351
  }
1350
1352
  case "state": {
1351
1353
  a = `\`\`\`mermaid
1352
- ${(g == null ? void 0 : g.state) || `stateDiagram-v2
1354
+ ${(m == null ? void 0 : m.state) || `stateDiagram-v2
1353
1355
  s1 --> s2`}
1354
1356
  \`\`\`
1355
1357
  `, r = 3, i = 10 - a.length;
@@ -1357,7 +1359,7 @@ ${(g == null ? void 0 : g.state) || `stateDiagram-v2
1357
1359
  }
1358
1360
  case "pie": {
1359
1361
  a = `\`\`\`mermaid
1360
- ${(g == null ? void 0 : g.pie) || `pie title Pets adopted by volunteers
1362
+ ${(m == null ? void 0 : m.pie) || `pie title Pets adopted by volunteers
1361
1363
  "Dogs" : 386
1362
1364
  "Cats" : 85
1363
1365
  "Rats" : 15`}
@@ -1367,7 +1369,7 @@ ${(g == null ? void 0 : g.pie) || `pie title Pets adopted by volunteers
1367
1369
  }
1368
1370
  case "relationship": {
1369
1371
  a = `\`\`\`mermaid
1370
- ${(g == null ? void 0 : g.relationship) || `erDiagram
1372
+ ${(m == null ? void 0 : m.relationship) || `erDiagram
1371
1373
  CAR ||--o{ NAMED-DRIVER : allows
1372
1374
  PERSON ||--o{ NAMED-DRIVER : is`}
1373
1375
  \`\`\`
@@ -1376,7 +1378,7 @@ ${(g == null ? void 0 : g.relationship) || `erDiagram
1376
1378
  }
1377
1379
  case "journey": {
1378
1380
  a = `\`\`\`mermaid
1379
- ${(g == null ? void 0 : g.journey) || `journey
1381
+ ${(m == null ? void 0 : m.journey) || `journey
1380
1382
  title My working day
1381
1383
  section Go to work
1382
1384
  Make tea: 5: Me
@@ -1401,35 +1403,35 @@ $$
1401
1403
  break;
1402
1404
  }
1403
1405
  case "universal": {
1404
- const { generate: k } = l, y = k(c);
1405
- a = y.targetValue, d = y.select, r = y.deviationStart, i = y.deviationEnd;
1406
+ const { generate: h } = l, y = h(u);
1407
+ a = y.targetValue, g = y.select, r = y.deviationStart, i = y.deviationEnd;
1406
1408
  }
1407
1409
  }
1408
1410
  return {
1409
1411
  text: a,
1410
1412
  options: {
1411
1413
  // 是否选中
1412
- select: d,
1414
+ select: g,
1413
1415
  // 选中时,开始位置的偏移量
1414
1416
  deviationStart: r,
1415
1417
  // 结束的偏移量
1416
1418
  deviationEnd: i,
1417
1419
  // 是否整个替换
1418
- replaceAll: u
1420
+ replaceAll: c
1419
1421
  }
1420
1422
  };
1421
- }, Hl = "#e5c07b", st = "var(--md-color)", Nl = "#56b6c2", Vl = "#ffffff", re = "var(--md-color)", ct = "#e5c07b", Ol = "#e5c07b", Bl = "var(--md-color)", ut = "#d19a66", Fl = "#c678dd", Rl = "#21252b", Pl = "#2c313a", dt = "var(--md-bk-color)", be = "var(--md-bk-color)", ql = "#ceedfa33", mt = "#528bff", Ul = pe.theme(
1423
+ }, Rl = "#e5c07b", dt = "var(--md-color)", Pl = "#56b6c2", Ul = "#ffffff", ce = "var(--md-color)", mt = "#e5c07b", _l = "#e5c07b", ql = "var(--md-color)", gt = "#d19a66", Gl = "#c678dd", Kl = "#21252b", jl = "#2c313a", ft = "var(--md-bk-color)", ke = "var(--md-bk-color)", Wl = "#ceedfa33", bt = "#528bff", zl = we.theme(
1422
1424
  {
1423
1425
  "&": {
1424
- color: re,
1425
- backgroundColor: dt
1426
+ color: ce,
1427
+ backgroundColor: ft
1426
1428
  },
1427
1429
  ".cm-content": {
1428
- caretColor: mt
1430
+ caretColor: bt
1429
1431
  },
1430
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: mt },
1431
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: ql },
1432
- ".cm-panels": { backgroundColor: Rl, color: re },
1432
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: bt },
1433
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Wl },
1434
+ ".cm-panels": { backgroundColor: Kl, color: ce },
1433
1435
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1434
1436
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1435
1437
  ".cm-searchMatch": {
@@ -1445,13 +1447,13 @@ $$
1445
1447
  backgroundColor: "#bad0f847"
1446
1448
  },
1447
1449
  ".cm-gutters": {
1448
- backgroundColor: dt,
1449
- color: re,
1450
+ backgroundColor: ft,
1451
+ color: ce,
1450
1452
  borderRight: "1px solid",
1451
1453
  borderColor: "var(--md-border-color)"
1452
1454
  },
1453
1455
  ".cm-activeLineGutter": {
1454
- backgroundColor: Pl
1456
+ backgroundColor: jl
1455
1457
  },
1456
1458
  ".cm-foldPlaceholder": {
1457
1459
  backgroundColor: "transparent",
@@ -1460,29 +1462,29 @@ $$
1460
1462
  },
1461
1463
  ".cm-tooltip": {
1462
1464
  border: "1px solid var(--md-border-color)",
1463
- backgroundColor: be
1465
+ backgroundColor: ke
1464
1466
  },
1465
1467
  ".cm-tooltip .cm-tooltip-arrow:before": {
1466
1468
  borderTopColor: "transparent",
1467
1469
  borderBottomColor: "transparent"
1468
1470
  },
1469
1471
  ".cm-tooltip .cm-tooltip-arrow:after": {
1470
- borderTopColor: be,
1471
- borderBottomColor: be
1472
+ borderTopColor: ke,
1473
+ borderBottomColor: ke
1472
1474
  },
1473
1475
  ".cm-tooltip-autocomplete": {
1474
1476
  "& > ul > li[aria-selected]": {
1475
- color: re
1477
+ color: ce
1476
1478
  }
1477
1479
  }
1478
1480
  },
1479
1481
  { dark: !0 }
1480
- ), Gl = yt.define([
1481
- { tag: s.keyword, color: Fl },
1482
- { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: st },
1483
- { tag: [s.function(s.variableName), s.labelName], color: Ol },
1484
- { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: ut },
1485
- { tag: [s.definition(s.name), s.separator], color: re },
1482
+ ), Zl = At.define([
1483
+ { tag: s.keyword, color: Gl },
1484
+ { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: dt },
1485
+ { tag: [s.function(s.variableName), s.labelName], color: _l },
1486
+ { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: gt },
1487
+ { tag: [s.definition(s.name), s.separator], color: ce },
1486
1488
  {
1487
1489
  tag: [
1488
1490
  s.typeName,
@@ -1494,7 +1496,7 @@ $$
1494
1496
  s.self,
1495
1497
  s.namespace
1496
1498
  ],
1497
- color: Hl
1499
+ color: Rl
1498
1500
  },
1499
1501
  {
1500
1502
  tag: [
@@ -1506,32 +1508,32 @@ $$
1506
1508
  s.link,
1507
1509
  s.special(s.string)
1508
1510
  ],
1509
- color: Nl
1511
+ color: Pl
1510
1512
  },
1511
- { tag: [s.meta, s.comment], color: ct },
1513
+ { tag: [s.meta, s.comment], color: mt },
1512
1514
  { tag: s.strong, fontWeight: "bold" },
1513
1515
  { tag: s.emphasis, fontStyle: "italic" },
1514
1516
  { tag: s.strikethrough, textDecoration: "line-through" },
1515
- { tag: s.link, color: ct, textDecoration: "underline" },
1516
- { tag: s.heading, fontWeight: "bold", color: st },
1517
- { tag: [s.atom, s.bool, s.special(s.variableName)], color: ut },
1518
- { tag: [s.processingInstruction, s.string, s.inserted], color: Bl },
1519
- { tag: s.invalid, color: Vl }
1520
- ]), Kl = [
1521
- Ul,
1522
- Tt(Gl)
1523
- ], _l = "#e5c07b", gt = "#3f4a54", jl = "#56b6c2", Wl = "#fff", ie = "#3f4a54", ft = "#2d8cf0", zl = "#2d8cf0", Zl = "#3f4a54", bt = "#d19a66", Xl = "#c678dd", Yl = "#21252b", Jl = "#ceedfa33", ht = "var(--md-bk-color)", he = "var(--md-bk-color)", Ql = "#bad5fa", vt = "#3f4a54", eo = pe.theme(
1517
+ { tag: s.link, color: mt, textDecoration: "underline" },
1518
+ { tag: s.heading, fontWeight: "bold", color: dt },
1519
+ { tag: [s.atom, s.bool, s.special(s.variableName)], color: gt },
1520
+ { tag: [s.processingInstruction, s.string, s.inserted], color: ql },
1521
+ { tag: s.invalid, color: Ul }
1522
+ ]), Xl = [
1523
+ zl,
1524
+ Mt(Zl)
1525
+ ], Yl = "#e5c07b", ht = "#3f4a54", Jl = "#56b6c2", Ql = "#fff", ue = "#3f4a54", vt = "#2d8cf0", eo = "#2d8cf0", to = "#3f4a54", kt = "#d19a66", lo = "#c678dd", oo = "#21252b", ao = "#ceedfa33", Ct = "var(--md-bk-color)", Ce = "var(--md-bk-color)", no = "#bad5fa", pt = "#3f4a54", ro = we.theme(
1524
1526
  {
1525
1527
  "&": {
1526
- color: ie,
1527
- backgroundColor: ht
1528
+ color: ue,
1529
+ backgroundColor: Ct
1528
1530
  },
1529
1531
  ".cm-content": {
1530
- caretColor: vt
1532
+ caretColor: pt
1531
1533
  },
1532
- ".cm-cursor, .cm-dropCursor": { borderLeftColor: vt },
1533
- "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: Ql },
1534
- ".cm-panels": { backgroundColor: Yl, color: ie },
1534
+ ".cm-cursor, .cm-dropCursor": { borderLeftColor: pt },
1535
+ "&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection": { backgroundColor: no },
1536
+ ".cm-panels": { backgroundColor: oo, color: ue },
1535
1537
  ".cm-panels.cm-panels-top": { borderBottom: "2px solid black" },
1536
1538
  ".cm-panels.cm-panels-bottom": { borderTop: "2px solid black" },
1537
1539
  ".cm-searchMatch": {
@@ -1547,13 +1549,13 @@ $$
1547
1549
  backgroundColor: "#bad0f847"
1548
1550
  },
1549
1551
  ".cm-gutters": {
1550
- backgroundColor: ht,
1551
- color: ie,
1552
+ backgroundColor: Ct,
1553
+ color: ue,
1552
1554
  borderRight: "1px solid",
1553
1555
  borderColor: "var(--md-border-color)"
1554
1556
  },
1555
1557
  ".cm-activeLineGutter": {
1556
- backgroundColor: Jl
1558
+ backgroundColor: ao
1557
1559
  },
1558
1560
  ".cm-foldPlaceholder": {
1559
1561
  backgroundColor: "transparent",
@@ -1562,29 +1564,29 @@ $$
1562
1564
  },
1563
1565
  ".cm-tooltip": {
1564
1566
  border: "1px solid var(--md-border-color)",
1565
- backgroundColor: he
1567
+ backgroundColor: Ce
1566
1568
  },
1567
1569
  ".cm-tooltip .cm-tooltip-arrow:before": {
1568
1570
  borderTopColor: "transparent",
1569
1571
  borderBottomColor: "transparent"
1570
1572
  },
1571
1573
  ".cm-tooltip .cm-tooltip-arrow:after": {
1572
- borderTopColor: he,
1573
- borderBottomColor: he
1574
+ borderTopColor: Ce,
1575
+ borderBottomColor: Ce
1574
1576
  },
1575
1577
  ".cm-tooltip-autocomplete": {
1576
1578
  "& > ul > li[aria-selected]": {
1577
- color: ie
1579
+ color: ue
1578
1580
  }
1579
1581
  }
1580
1582
  }
1581
1583
  // { dark: true }
1582
- ), to = yt.define([
1583
- { tag: s.keyword, color: Xl },
1584
- { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: gt },
1585
- { tag: [s.function(s.variableName), s.labelName], color: zl },
1586
- { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: bt },
1587
- { tag: [s.definition(s.name), s.separator], color: ie },
1584
+ ), io = At.define([
1585
+ { tag: s.keyword, color: lo },
1586
+ { tag: [s.name, s.deleted, s.character, s.propertyName, s.macroName], color: ht },
1587
+ { tag: [s.function(s.variableName), s.labelName], color: eo },
1588
+ { tag: [s.color, s.constant(s.name), s.standard(s.name)], color: kt },
1589
+ { tag: [s.definition(s.name), s.separator], color: ue },
1588
1590
  {
1589
1591
  tag: [
1590
1592
  s.typeName,
@@ -1596,7 +1598,7 @@ $$
1596
1598
  s.self,
1597
1599
  s.namespace
1598
1600
  ],
1599
- color: _l
1601
+ color: Yl
1600
1602
  },
1601
1603
  {
1602
1604
  tag: [
@@ -1608,40 +1610,40 @@ $$
1608
1610
  s.link,
1609
1611
  s.special(s.string)
1610
1612
  ],
1611
- color: jl
1613
+ color: Jl
1612
1614
  },
1613
- { tag: [s.meta, s.comment], color: ft },
1615
+ { tag: [s.meta, s.comment], color: vt },
1614
1616
  { tag: s.strong, fontWeight: "bold" },
1615
1617
  { tag: s.emphasis, fontStyle: "italic" },
1616
1618
  { tag: s.strikethrough, textDecoration: "line-through" },
1617
- { tag: s.link, color: ft, textDecoration: "underline" },
1618
- { tag: s.heading, fontWeight: "bold", color: gt },
1619
- { tag: [s.atom, s.bool, s.special(s.variableName)], color: bt },
1620
- { tag: [s.processingInstruction, s.string, s.inserted], color: Zl },
1621
- { tag: s.invalid, color: Wl }
1622
- ]), lo = [
1623
- eo,
1624
- Tt(to)
1625
- ], de = (e, o, l, a, r) => (i, d, u, c) => {
1626
- const g = `${e}${o}`.slice(c - u);
1627
- i.dispatch(i.state.replaceSelection(`${g}${l}${a}`));
1628
- const m = u + d.label.length + (r === "title" ? l.length : 0);
1619
+ { tag: s.link, color: vt, textDecoration: "underline" },
1620
+ { tag: s.heading, fontWeight: "bold", color: ht },
1621
+ { tag: [s.atom, s.bool, s.special(s.variableName)], color: kt },
1622
+ { tag: [s.processingInstruction, s.string, s.inserted], color: to },
1623
+ { tag: s.invalid, color: Ql }
1624
+ ]), so = [
1625
+ ro,
1626
+ Mt(io)
1627
+ ], fe = (e, o, l, a, r) => (i, g, c, u) => {
1628
+ const m = `${e}${o}`.slice(u - c);
1629
+ i.dispatch(i.state.replaceSelection(`${m}${l}${a}`));
1630
+ const d = c + g.label.length + (r === "title" ? l.length : 0);
1629
1631
  i.dispatch({
1630
1632
  selection: G.create(
1631
1633
  [
1632
1634
  G.range(
1633
- u + d.label.length + (r === "title" ? 1 : -o.length),
1634
- m
1635
+ c + g.label.length + (r === "title" ? 1 : -o.length),
1636
+ d
1635
1637
  ),
1636
- G.cursor(m)
1638
+ G.cursor(d)
1637
1639
  ],
1638
1640
  1
1639
1641
  )
1640
1642
  }), i.focus();
1641
- }, kt = (e) => (o, l, a, r) => {
1643
+ }, $t = (e) => (o, l, a, r) => {
1642
1644
  const i = e.slice(r - a);
1643
1645
  o.dispatch(o.state.replaceSelection(`${i} `));
1644
- }, oo = (e) => {
1646
+ }, co = (e) => {
1645
1647
  const o = (l) => {
1646
1648
  const a = l.matchBefore(
1647
1649
  /^#+|^-\s*\[*\s*\]*|`+|\[|!\[*|^\|\s?\|?|^\$\$?|!+\s*\w*/
@@ -1651,11 +1653,11 @@ $$
1651
1653
  options: [
1652
1654
  // 标题
1653
1655
  ...["h1", "h2", "h3", "h4", "h5", "h6"].map((r, i) => {
1654
- const d = new Array(i + 1).fill("#").join("");
1656
+ const g = new Array(i + 1).fill("#").join("");
1655
1657
  return {
1656
- label: d,
1658
+ label: g,
1657
1659
  type: "text",
1658
- apply: kt(d)
1660
+ apply: $t(g)
1659
1661
  };
1660
1662
  }),
1661
1663
  // 任务列表
@@ -1664,7 +1666,7 @@ $$
1664
1666
  return {
1665
1667
  label: i,
1666
1668
  type: "text",
1667
- apply: kt(i)
1669
+ apply: $t(i)
1668
1670
  };
1669
1671
  }),
1670
1672
  // 代码
@@ -1675,7 +1677,7 @@ $$
1675
1677
  ].map((r) => ({
1676
1678
  label: `${r[0]}${r[1]}`,
1677
1679
  type: "text",
1678
- apply: de(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1680
+ apply: fe(r[0], r[1], "", r[0] === "`" ? "`" : "\n```", "type")
1679
1681
  })),
1680
1682
  // 链接
1681
1683
  {
@@ -1700,12 +1702,12 @@ $$
1700
1702
  {
1701
1703
  label: "$",
1702
1704
  type: "text",
1703
- apply: de("$", "", "", "$", "type")
1705
+ apply: fe("$", "", "", "$", "type")
1704
1706
  },
1705
1707
  {
1706
1708
  label: "$$",
1707
1709
  type: "text",
1708
- apply: de("$$", "", `
1710
+ apply: fe("$$", "", `
1709
1711
  `, `
1710
1712
  $$`, "title")
1711
1713
  },
@@ -1730,37 +1732,37 @@ $$`, "title")
1730
1732
  ].map((r) => ({
1731
1733
  label: `!!! ${r}`,
1732
1734
  type: "text",
1733
- apply: de("!!!", ` ${r}`, " Title", `
1735
+ apply: fe("!!!", ` ${r}`, " Title", `
1734
1736
 
1735
1737
  !!!`, "title")
1736
1738
  }))
1737
1739
  ]
1738
1740
  };
1739
1741
  };
1740
- return ml({
1742
+ return rl({
1741
1743
  override: e ? [o, ...e] : [o]
1742
1744
  });
1743
- }, ao = oo, J = (e) => {
1744
- const o = new ul();
1745
+ }, uo = co, Q = (e) => {
1746
+ const o = new al();
1745
1747
  return (a) => (o.get(e.state) ? e.dispatch({ effects: o.reconfigure(a) }) : e.dispatch({
1746
- effects: dl.appendConfig.of(o.of(a))
1748
+ effects: nl.appendConfig.of(o.of(a))
1747
1749
  }), !0);
1748
1750
  };
1749
- class no {
1751
+ class mo {
1750
1752
  constructor(o) {
1751
- U(this, "view");
1752
- U(this, "maxLength", Number.MAX_SAFE_INTEGER);
1753
+ q(this, "view");
1754
+ q(this, "maxLength", Number.MAX_SAFE_INTEGER);
1753
1755
  // 切换tabSize的执行方法。切换时,Compartment实例需要相同
1754
- U(this, "toggleTabSize");
1755
- U(this, "togglePlaceholder");
1756
+ q(this, "toggleTabSize");
1757
+ q(this, "togglePlaceholder");
1756
1758
  /**
1757
1759
  * 设置全部的扩展
1758
1760
  */
1759
- U(this, "setExtensions");
1760
- U(this, "toggleDisabled");
1761
- U(this, "toggleReadOnly");
1762
- U(this, "toggleMaxlength");
1763
- this.view = o, this.toggleTabSize = J(this.view), this.togglePlaceholder = J(this.view), this.setExtensions = J(this.view), this.toggleDisabled = J(this.view), this.toggleReadOnly = J(this.view), this.toggleMaxlength = J(this.view);
1761
+ q(this, "setExtensions");
1762
+ q(this, "toggleDisabled");
1763
+ q(this, "toggleReadOnly");
1764
+ q(this, "toggleMaxlength");
1765
+ this.view = o, this.toggleTabSize = Q(this.view), this.togglePlaceholder = Q(this.view), this.setExtensions = Q(this.view), this.toggleDisabled = Q(this.view), this.toggleReadOnly = Q(this.view), this.toggleMaxlength = Q(this.view);
1764
1766
  }
1765
1767
  getValue() {
1766
1768
  return this.view.state.doc.toString();
@@ -1828,7 +1830,7 @@ class no {
1828
1830
  this.view.focus();
1829
1831
  } catch (r) {
1830
1832
  if (r.message === "The input text is too long")
1831
- b.emit(a, "errorCatcher", {
1833
+ b.emit(a, te, {
1832
1834
  name: "overlength",
1833
1835
  message: r.message,
1834
1836
  data: o
@@ -1844,8 +1846,8 @@ class no {
1844
1846
  */
1845
1847
  setTabSize(o) {
1846
1848
  this.toggleTabSize([
1847
- fe.tabSize.of(o),
1848
- cl.of(" ".repeat(o))
1849
+ ve.tabSize.of(o),
1850
+ ol.of(" ".repeat(o))
1849
1851
  ]);
1850
1852
  }
1851
1853
  /**
@@ -1854,7 +1856,7 @@ class no {
1854
1856
  * @param t 目标内容
1855
1857
  */
1856
1858
  setPlaceholder(o) {
1857
- this.togglePlaceholder(tl(o));
1859
+ this.togglePlaceholder(Zt(o));
1858
1860
  }
1859
1861
  focus(o) {
1860
1862
  if (this.view.focus(), !o)
@@ -1879,19 +1881,19 @@ class no {
1879
1881
  });
1880
1882
  }
1881
1883
  setDisabled(o) {
1882
- this.toggleDisabled([pe.editable.of(!o)]);
1884
+ this.toggleDisabled([we.editable.of(!o)]);
1883
1885
  }
1884
1886
  setReadOnly(o) {
1885
- this.toggleReadOnly([fe.readOnly.of(o)]);
1887
+ this.toggleReadOnly([ve.readOnly.of(o)]);
1886
1888
  }
1887
1889
  setMaxLength(o) {
1888
1890
  this.maxLength = o, this.toggleMaxlength([
1889
- fe.changeFilter.of((l) => l.newDoc.length <= o)
1891
+ ve.changeFilter.of((l) => l.newDoc.length <= o)
1890
1892
  ]);
1891
1893
  }
1892
1894
  }
1893
- const ro = (e) => {
1894
- const o = L("editorId");
1895
+ const go = (e) => {
1896
+ const o = I("editorId");
1895
1897
  return (a) => {
1896
1898
  if (!a.clipboardData)
1897
1899
  return;
@@ -1899,197 +1901,198 @@ const ro = (e) => {
1899
1901
  const { files: i } = a.clipboardData;
1900
1902
  b.emit(
1901
1903
  o,
1902
- "uploadImage",
1903
- Array.from(i).filter((d) => /image\/.*/.test(d.type))
1904
+ Te,
1905
+ Array.from(i).filter((g) => /image\/.*/.test(g.type))
1904
1906
  ), a.preventDefault();
1905
1907
  return;
1906
1908
  }
1907
1909
  if (e.autoDetectCode && a.clipboardData.types.includes("vscode-editor-data")) {
1908
1910
  const i = JSON.parse(a.clipboardData.getData("vscode-editor-data"));
1909
- b.emit(o, "replace", "code", {
1911
+ b.emit(o, w, "code", {
1910
1912
  mode: i.mode,
1911
1913
  text: a.clipboardData.getData("text/plain")
1912
1914
  }), a.preventDefault();
1913
1915
  return;
1914
1916
  }
1915
1917
  const r = a.clipboardData.getData("text/plain");
1916
- e.maxlength && r.length + e.modelValue.length > e.maxlength && b.emit(o, "errorCatcher", {
1918
+ e.maxlength && r.length + e.modelValue.length > e.maxlength && b.emit(o, te, {
1917
1919
  name: "overlength",
1918
1920
  message: "The input text is too long",
1919
1921
  data: r
1920
1922
  });
1921
1923
  };
1922
- }, io = ro, so = (e) => {
1923
- const o = L("editorId");
1924
- Y(() => {
1924
+ }, fo = go, bo = (e) => {
1925
+ const o = I("editorId");
1926
+ J(() => {
1925
1927
  b.on(o, {
1926
- name: Pt,
1928
+ name: jt,
1927
1929
  callback(l) {
1928
1930
  var a;
1929
1931
  (a = e.value) == null || a.focus(l);
1930
1932
  }
1931
1933
  });
1932
1934
  });
1933
- }, co = so, uo = (e, o) => [
1935
+ }, ho = bo, vo = (e, o) => [
1934
1936
  {
1935
1937
  key: "Ctrl-b",
1936
1938
  mac: "Cmd-b",
1937
- run: () => (b.emit(e, "replace", "bold"), !0)
1939
+ run: () => (b.emit(e, w, "bold"), !0)
1938
1940
  },
1939
1941
  {
1940
1942
  key: "Ctrl-d",
1941
1943
  mac: "Cmd-d",
1942
- run: nl,
1944
+ run: Qt,
1943
1945
  preventDefault: !0
1944
1946
  },
1945
1947
  {
1946
1948
  key: "Ctrl-s",
1947
1949
  mac: "Cmd-s",
1948
- run: (H) => (b.emit(e, Ct, H.state.doc.toString()), !0),
1949
- shift: () => (b.emit(e, "replace", "strikeThrough"), !0)
1950
+ run: (N) => (b.emit(e, Tt, N.state.doc.toString()), !0),
1951
+ shift: () => (b.emit(e, w, "strikeThrough"), !0)
1950
1952
  },
1951
1953
  {
1952
1954
  key: "Ctrl-u",
1953
1955
  mac: "Cmd-u",
1954
- run: () => (b.emit(e, "replace", "underline"), !0),
1955
- shift: () => (b.emit(e, "replace", "unorderedList"), !0)
1956
+ run: () => (b.emit(e, w, "underline"), !0),
1957
+ shift: () => (b.emit(e, w, "unorderedList"), !0)
1956
1958
  },
1957
1959
  {
1958
1960
  key: "Ctrl-i",
1959
1961
  mac: "Cmd-i",
1960
- run: () => (b.emit(e, "replace", "italic"), !0),
1961
- shift: () => (b.emit(e, "openModals", "image"), !0)
1962
+ run: () => (b.emit(e, w, "italic"), !0),
1963
+ shift: () => (b.emit(e, $e, "image"), !0)
1962
1964
  },
1963
1965
  {
1964
1966
  key: "Ctrl-1",
1965
1967
  mac: "Cmd-1",
1966
- run: () => (b.emit(e, "replace", "h1"), !0)
1968
+ run: () => (b.emit(e, w, "h1"), !0)
1967
1969
  },
1968
1970
  {
1969
1971
  key: "Ctrl-2",
1970
1972
  mac: "Cmd-2",
1971
- run: () => (b.emit(e, "replace", "h2"), !0)
1973
+ run: () => (b.emit(e, w, "h2"), !0)
1972
1974
  },
1973
1975
  {
1974
1976
  key: "Ctrl-3",
1975
1977
  mac: "Cmd-3",
1976
- run: () => (b.emit(e, "replace", "h3"), !0)
1978
+ run: () => (b.emit(e, w, "h3"), !0)
1977
1979
  },
1978
1980
  {
1979
1981
  key: "Ctrl-4",
1980
1982
  mac: "Cmd-4",
1981
- run: () => (b.emit(e, "replace", "h4"), !0)
1983
+ run: () => (b.emit(e, w, "h4"), !0)
1982
1984
  },
1983
1985
  {
1984
1986
  key: "Ctrl-5",
1985
1987
  mac: "Cmd-5",
1986
- run: () => (b.emit(e, "replace", "h5"), !0)
1988
+ run: () => (b.emit(e, w, "h5"), !0)
1987
1989
  },
1988
1990
  {
1989
1991
  key: "Ctrl-6",
1990
1992
  mac: "Cmd-6",
1991
- run: () => (b.emit(e, "replace", "h6"), !0)
1993
+ run: () => (b.emit(e, w, "h6"), !0)
1992
1994
  },
1993
1995
  {
1994
1996
  key: "Ctrl-ArrowUp",
1995
1997
  mac: "Cmd-ArrowUp",
1996
- run: () => (b.emit(e, "replace", "sup"), !0)
1998
+ run: () => (b.emit(e, w, "sup"), !0)
1997
1999
  },
1998
2000
  {
1999
2001
  key: "Ctrl-ArrowDown",
2000
2002
  mac: "Cmd-ArrowDown",
2001
- run: () => (b.emit(e, "replace", "sub"), !0)
2003
+ run: () => (b.emit(e, w, "sub"), !0)
2002
2004
  },
2003
2005
  {
2004
2006
  key: "Ctrl-o",
2005
2007
  mac: "Cmd-o",
2006
- run: () => (b.emit(e, "replace", "orderedList"), !0)
2008
+ run: () => (b.emit(e, w, "orderedList"), !0)
2007
2009
  },
2008
2010
  {
2009
2011
  key: "Ctrl-c",
2010
2012
  mac: "Cmd-c",
2011
- shift: () => (b.emit(e, "replace", "code"), !0),
2012
- any(H, M) {
2013
- return (M.ctrlKey || M.metaKey) && M.altKey && M.code === "KeyC" ? (b.emit(e, "replace", "codeRow"), !0) : !1;
2013
+ shift: () => (b.emit(e, w, "code"), !0),
2014
+ any(N, L) {
2015
+ return (L.ctrlKey || L.metaKey) && L.altKey && L.code === "KeyC" ? (b.emit(e, w, "codeRow"), !0) : !1;
2014
2016
  }
2015
2017
  },
2016
2018
  {
2017
2019
  key: "Ctrl-l",
2018
2020
  mac: "Cmd-l",
2019
- run: () => (b.emit(e, "openModals", "link"), !0)
2021
+ run: () => (b.emit(e, $e, "link"), !0)
2020
2022
  },
2021
2023
  {
2022
2024
  key: "Ctrl-f",
2023
2025
  mac: "Cmd-f",
2024
- shift: () => o.noPrettier ? !1 : (b.emit(e, "replace", "prettier"), !0)
2026
+ shift: () => o.noPrettier ? !1 : (b.emit(e, w, "prettier"), !0)
2025
2027
  },
2026
2028
  {
2027
- any: (H, M) => (M.ctrlKey || M.metaKey) && M.altKey && M.shiftKey && M.code === "KeyT" ? (b.emit(e, "replace", "table"), !0) : !1
2029
+ any: (N, L) => (L.ctrlKey || L.metaKey) && L.altKey && L.shiftKey && L.code === "KeyT" ? (b.emit(e, w, "table"), !0) : !1
2028
2030
  }
2029
- ], mo = uo, go = (e) => {
2030
- const o = L("tabWidth"), l = L("editorId"), a = L("theme"), r = K(), i = At(), d = mo(l, e), u = io(e), c = [
2031
- ll.of([...d, rl]),
2032
- el,
2033
- al({ codeLanguages: ol }),
2031
+ ], ko = vo, Co = (e) => {
2032
+ const o = I("tabWidth"), l = I("editorId"), a = I("theme"), r = K(), i = Et(), g = ko(l, e), c = fo(e), u = [
2033
+ Xt.of([...g, el]),
2034
+ zt,
2035
+ Jt({ codeLanguages: Yt }),
2034
2036
  // 横向换行
2035
- ue.lineWrapping,
2036
- ue.updateListener.of((m) => {
2037
- m.docChanged && e.onChange(m.state.doc.toString());
2037
+ ge.lineWrapping,
2038
+ ge.updateListener.of((d) => {
2039
+ d.docChanged && e.onChange(d.state.doc.toString());
2038
2040
  }),
2039
- ue.domEventHandlers({
2040
- paste: u,
2041
+ ge.domEventHandlers({
2042
+ paste: c,
2041
2043
  blur: e.onBlur,
2042
2044
  focus: e.onFocus,
2043
- input: (m) => {
2044
- e.onInput && e.onInput(m);
2045
- const { data: h } = m;
2046
- e.maxlength && e.modelValue.length + h.length > e.maxlength && b.emit(l, "errorCatcher", {
2045
+ drop: e.onDrop,
2046
+ input: (d) => {
2047
+ e.onInput && e.onInput(d);
2048
+ const { data: v } = d;
2049
+ e.maxlength && e.modelValue.length + v.length > e.maxlength && b.emit(l, te, {
2047
2050
  name: "overlength",
2048
2051
  message: "The input text is too long",
2049
- data: h
2052
+ data: v
2050
2053
  });
2051
2054
  }
2052
2055
  })
2053
- ], g = () => {
2054
- const m = [
2055
- ...c,
2056
- a.value === "light" ? lo : Kl,
2057
- ao(e.completions)
2056
+ ], m = () => {
2057
+ const d = [
2058
+ ...u,
2059
+ a.value === "light" ? so : Xl,
2060
+ uo(e.completions)
2058
2061
  ];
2059
- return X.codeMirrorExtensions(a.value, m, [
2060
- ...d
2062
+ return Y.codeMirrorExtensions(a.value, d, [
2063
+ ...g
2061
2064
  ]);
2062
2065
  };
2063
- return Y(() => {
2064
- const m = new ue({
2066
+ return J(() => {
2067
+ const d = new ge({
2065
2068
  doc: e.modelValue,
2066
2069
  parent: r.value
2067
- }), h = new no(m);
2068
- i.value = h, setTimeout(() => {
2069
- h.setTabSize(o), h.setDisabled(e.disabled), h.setReadOnly(e.readonly), h.setExtensions(g()), e.placeholder && h.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && h.setMaxLength(e.maxlength), e.autofocus && m.focus();
2070
+ }), v = new mo(d);
2071
+ i.value = v, setTimeout(() => {
2072
+ v.setTabSize(o), v.setDisabled(e.disabled), v.setReadOnly(e.readonly), v.setExtensions(m()), e.placeholder && v.setPlaceholder(e.placeholder), typeof e.maxlength == "number" && v.setMaxLength(e.maxlength), e.autofocus && d.focus();
2070
2073
  }, 0), b.on(l, {
2071
- name: "ctrlZ",
2074
+ name: xt,
2072
2075
  callback() {
2073
- il(m);
2076
+ tl(d);
2074
2077
  }
2075
2078
  }), b.on(l, {
2076
- name: "ctrlShiftZ",
2079
+ name: wt,
2077
2080
  callback() {
2078
- sl(m);
2081
+ ll(d);
2079
2082
  }
2080
2083
  }), b.on(l, {
2081
- name: "replace",
2084
+ name: w,
2082
2085
  callback($, T = {}) {
2083
- var k;
2084
- const { text: v, options: f } = El($, i.value, T);
2085
- (k = i.value) == null || k.replaceSelectedText(v, f, l);
2086
+ var h;
2087
+ const { text: k, options: f } = Bl($, i.value, T);
2088
+ (h = i.value) == null || h.replaceSelectedText(k, f, l);
2086
2089
  }
2087
2090
  });
2088
2091
  }), B(
2089
- [a, ne(e, "completions")],
2092
+ [a, se(e, "completions")],
2090
2093
  () => {
2091
- var m;
2092
- (m = i.value) == null || m.setExtensions(g());
2094
+ var d;
2095
+ (d = i.value) == null || d.setExtensions(m());
2093
2096
  },
2094
2097
  {
2095
2098
  deep: !0
@@ -2097,51 +2100,51 @@ const ro = (e) => {
2097
2100
  ), B(
2098
2101
  () => e.modelValue,
2099
2102
  () => {
2100
- var m, h;
2101
- ((m = i.value) == null ? void 0 : m.getValue()) !== e.modelValue && ((h = i.value) == null || h.setValue(e.modelValue));
2103
+ var d, v;
2104
+ ((d = i.value) == null ? void 0 : d.getValue()) !== e.modelValue && ((v = i.value) == null || v.setValue(e.modelValue));
2102
2105
  }
2103
2106
  ), B(
2104
2107
  () => e.placeholder,
2105
2108
  () => {
2106
- var m;
2107
- (m = i.value) == null || m.setPlaceholder(e.placeholder);
2109
+ var d;
2110
+ (d = i.value) == null || d.setPlaceholder(e.placeholder);
2108
2111
  }
2109
2112
  ), B(
2110
2113
  () => e.disabled,
2111
2114
  () => {
2112
- var m;
2113
- (m = i.value) == null || m.setDisabled(e.disabled);
2115
+ var d;
2116
+ (d = i.value) == null || d.setDisabled(e.disabled);
2114
2117
  }
2115
2118
  ), B(
2116
2119
  () => e.readonly,
2117
2120
  () => {
2118
- var m;
2119
- (m = i.value) == null || m.setDisabled(e.readonly);
2121
+ var d;
2122
+ (d = i.value) == null || d.setDisabled(e.readonly);
2120
2123
  }
2121
2124
  ), B(
2122
2125
  () => e.maxlength,
2123
2126
  () => {
2124
- var m;
2125
- e.maxlength && ((m = i.value) == null || m.setMaxLength(e.maxlength));
2127
+ var d;
2128
+ e.maxlength && ((d = i.value) == null || d.setMaxLength(e.maxlength));
2126
2129
  }
2127
- ), co(i), {
2130
+ ), ho(i), {
2128
2131
  inputWrapperRef: r,
2129
2132
  codeMirrorUt: i
2130
2133
  };
2131
- }, fo = go, bo = /* @__PURE__ */ R({
2134
+ }, po = Co, $o = /* @__PURE__ */ P({
2132
2135
  name: "MDEditorContent",
2133
- props: qt,
2136
+ props: il,
2134
2137
  setup(e) {
2135
- const o = L("editorId"), l = K(""), {
2138
+ const o = I("editorId"), l = K(""), {
2136
2139
  inputWrapperRef: a,
2137
2140
  codeMirrorUt: r
2138
- } = fo(e);
2139
- return Dl(e, l, r), () => t("div", {
2141
+ } = po(e);
2142
+ return Fl(e, l, r), () => t("div", {
2140
2143
  class: `${n}-content`
2141
2144
  }, [t("div", {
2142
2145
  class: `${n}-input-wrapper`,
2143
2146
  ref: a
2144
- }, null), t(Ut, {
2147
+ }, null), t(sl, {
2145
2148
  modelValue: e.modelValue,
2146
2149
  setting: e.setting,
2147
2150
  onHtmlChanged: (i) => {
@@ -2155,7 +2158,7 @@ const ro = (e) => {
2155
2158
  formatCopiedText: e.formatCopiedText,
2156
2159
  noHighlight: e.noHighlight,
2157
2160
  noImgZoomIn: e.noImgZoomIn
2158
- }, null), e.catalogVisible && t(wt, {
2161
+ }, null), e.catalogVisible && t(Lt, {
2159
2162
  theme: e.theme,
2160
2163
  class: `${n}-catalog-editor`,
2161
2164
  editorId: o,
@@ -2163,7 +2166,7 @@ const ro = (e) => {
2163
2166
  key: "internal-catalog"
2164
2167
  }, null)]);
2165
2168
  }
2166
- }), ho = /* @__PURE__ */ R({
2169
+ }), yo = /* @__PURE__ */ P({
2167
2170
  props: {
2168
2171
  modelValue: {
2169
2172
  type: String,
@@ -2171,7 +2174,7 @@ const ro = (e) => {
2171
2174
  }
2172
2175
  },
2173
2176
  setup(e) {
2174
- const o = L("usedLanguageText");
2177
+ const o = I("usedLanguageText");
2175
2178
  return () => {
2176
2179
  var l, a;
2177
2180
  return t("div", {
@@ -2181,7 +2184,7 @@ const ro = (e) => {
2181
2184
  }, [`${(l = o.value.footer) == null ? void 0 : l.markdownTotal}:`]), t("span", null, [((a = e.modelValue) == null ? void 0 : a.length) || 0])]);
2182
2185
  };
2183
2186
  }
2184
- }), vo = {
2187
+ }), To = {
2185
2188
  checked: {
2186
2189
  type: Boolean,
2187
2190
  default: !1
@@ -2191,8 +2194,8 @@ const ro = (e) => {
2191
2194
  default: () => {
2192
2195
  }
2193
2196
  }
2194
- }, ko = /* @__PURE__ */ R({
2195
- props: vo,
2197
+ }, wo = /* @__PURE__ */ P({
2198
+ props: To,
2196
2199
  setup(e) {
2197
2200
  return () => t("div", {
2198
2201
  class: [`${n}-checkbox`, e.checked && `${n}-checkbox-checked`],
@@ -2201,7 +2204,7 @@ const ro = (e) => {
2201
2204
  }
2202
2205
  }, null);
2203
2206
  }
2204
- }), po = {
2207
+ }), xo = {
2205
2208
  scrollAuto: {
2206
2209
  type: Boolean
2207
2210
  },
@@ -2210,10 +2213,10 @@ const ro = (e) => {
2210
2213
  default: () => {
2211
2214
  }
2212
2215
  }
2213
- }, Co = /* @__PURE__ */ R({
2214
- props: po,
2216
+ }, So = /* @__PURE__ */ P({
2217
+ props: xo,
2215
2218
  setup(e) {
2216
- const o = L("usedLanguageText");
2219
+ const o = I("usedLanguageText");
2217
2220
  return () => {
2218
2221
  var l;
2219
2222
  return t("div", {
@@ -2223,13 +2226,13 @@ const ro = (e) => {
2223
2226
  onClick: () => {
2224
2227
  e.onScrollAutoChange(!e.scrollAuto);
2225
2228
  }
2226
- }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(ko, {
2229
+ }, [(l = o.value.footer) == null ? void 0 : l.scrollAuto]), t(wo, {
2227
2230
  checked: e.scrollAuto,
2228
2231
  onChange: e.onScrollAutoChange
2229
2232
  }, null)]);
2230
2233
  };
2231
2234
  }
2232
- }), $o = {
2235
+ }), Ao = {
2233
2236
  modelValue: {
2234
2237
  type: String,
2235
2238
  default: ""
@@ -2249,22 +2252,22 @@ const ro = (e) => {
2249
2252
  defFooters: {
2250
2253
  type: Object
2251
2254
  }
2252
- }, yo = /* @__PURE__ */ R({
2255
+ }, Mo = /* @__PURE__ */ P({
2253
2256
  name: "MDEditorFooter",
2254
- props: $o,
2257
+ props: Ao,
2255
2258
  setup(e) {
2256
- const o = ke(() => {
2259
+ const o = ye(() => {
2257
2260
  const a = e.footers.indexOf("="), r = a === -1 ? e.footers : e.footers.slice(0, a), i = a === -1 ? [] : e.footers.slice(a, Number.MAX_SAFE_INTEGER);
2258
2261
  return [r, i];
2259
2262
  }), l = (a) => {
2260
- if (Dt.includes(a))
2263
+ if (Vt.includes(a))
2261
2264
  switch (a) {
2262
2265
  case "markdownTotal":
2263
- return t(ho, {
2266
+ return t(yo, {
2264
2267
  modelValue: e.modelValue
2265
2268
  }, null);
2266
2269
  case "scrollSwitch":
2267
- return t(Co, {
2270
+ return t(So, {
2268
2271
  scrollAuto: e.scrollAuto,
2269
2272
  onScrollAutoChange: e.onScrollAutoChange
2270
2273
  }, null);
@@ -2283,65 +2286,65 @@ const ro = (e) => {
2283
2286
  }, [r])]);
2284
2287
  };
2285
2288
  }
2286
- }), To = /* @__PURE__ */ R({
2289
+ }), Lo = /* @__PURE__ */ P({
2287
2290
  name: "MdEditorV3",
2288
- props: Gt,
2289
- emits: Kt,
2291
+ props: cl,
2292
+ emits: ul,
2290
2293
  setup(e, o) {
2291
2294
  const {
2292
2295
  editorId: l,
2293
2296
  noKatex: a,
2294
2297
  noMermaid: r,
2295
2298
  noPrettier: i,
2296
- noUploadImg: d,
2297
- noHighlight: u
2298
- } = e, c = Q({
2299
+ noUploadImg: g,
2300
+ noHighlight: c
2301
+ } = e, u = ee({
2299
2302
  scrollAuto: e.scrollAuto
2300
2303
  });
2301
- _t(e, o), jt(e), Wt(e), zt(e, o);
2302
- const [g, m] = Zt(e, o), h = Xt(e);
2303
- return Mt(() => {
2304
+ dl(e, o), ml(e), gl(e), fl(e, o);
2305
+ const [m, d] = bl(e, o), v = hl(e);
2306
+ return Ht(() => {
2304
2307
  b.clear(l);
2305
- }), Yt(e, o, h, g, m), () => {
2306
- var v;
2307
- const $ = it({
2308
+ }), vl(e, o, v, m, d), () => {
2309
+ var k;
2310
+ const $ = ut({
2308
2311
  props: e,
2309
2312
  ctx: o
2310
- }, "defToolbars"), T = it({
2313
+ }, "defToolbars"), T = ut({
2311
2314
  props: e,
2312
2315
  ctx: o
2313
2316
  }, "defFooters");
2314
2317
  return t("div", {
2315
2318
  id: l,
2316
- class: [n, e.class, e.theme === "dark" && `${n}-dark`, g.fullscreen || g.pageFullscreen ? `${n}-fullscreen` : ""],
2319
+ class: [n, e.class, e.theme === "dark" && `${n}-dark`, m.fullscreen || m.pageFullscreen ? `${n}-fullscreen` : ""],
2317
2320
  style: e.style
2318
- }, [t(Al, {
2321
+ }, [t(Hl, {
2319
2322
  noPrettier: i,
2320
2323
  toolbars: e.toolbars,
2321
2324
  toolbarsExclude: e.toolbarsExclude,
2322
- setting: g,
2323
- updateSetting: m,
2325
+ setting: m,
2326
+ updateSetting: d,
2324
2327
  tableShape: e.tableShape,
2325
2328
  defToolbars: $,
2326
- noUploadImg: d,
2329
+ noUploadImg: g,
2327
2330
  showToolbarName: e.showToolbarName
2328
- }, null), t(bo, {
2331
+ }, null), t($o, {
2329
2332
  modelValue: e.modelValue,
2330
- setting: g,
2333
+ setting: m,
2331
2334
  mdHeadingId: e.mdHeadingId,
2332
2335
  noMermaid: r,
2333
2336
  noPrettier: i,
2334
2337
  sanitize: e.sanitize,
2335
2338
  placeholder: e.placeholder,
2336
2339
  noKatex: a,
2337
- scrollAuto: c.scrollAuto,
2340
+ scrollAuto: u.scrollAuto,
2338
2341
  formatCopiedText: e.formatCopiedText,
2339
2342
  autofocus: e.autoFocus,
2340
2343
  disabled: e.disabled,
2341
2344
  readonly: e.readOnly,
2342
2345
  maxlength: e.maxLength,
2343
2346
  autoDetectCode: e.autoDetectCode,
2344
- noHighlight: u,
2347
+ noHighlight: c,
2345
2348
  onChange: (f) => {
2346
2349
  e.onChange ? e.onChange(f) : (o.emit("update:modelValue", f), o.emit("onChange", f));
2347
2350
  },
@@ -2361,20 +2364,23 @@ const ro = (e) => {
2361
2364
  e.onInput ? e.onInput(f) : o.emit("onInput", f);
2362
2365
  },
2363
2366
  completions: e.completions,
2364
- catalogVisible: h.value,
2367
+ catalogVisible: v.value,
2365
2368
  theme: e.theme,
2366
- noImgZoomIn: e.noImgZoomIn
2367
- }, null), ((v = e.footers) == null ? void 0 : v.length) > 0 && t(yo, {
2369
+ noImgZoomIn: e.noImgZoomIn,
2370
+ onDrop: (f) => {
2371
+ e.onDrop ? e.onDrop(f) : o.emit("onDrop", f);
2372
+ }
2373
+ }, null), ((k = e.footers) == null ? void 0 : k.length) > 0 && t(Mo, {
2368
2374
  modelValue: e.modelValue,
2369
2375
  footers: e.footers,
2370
2376
  defFooters: T,
2371
- scrollAuto: c.scrollAuto,
2372
- onScrollAutoChange: (f) => c.scrollAuto = f
2377
+ scrollAuto: u.scrollAuto,
2378
+ onScrollAutoChange: (f) => u.scrollAuto = f
2373
2379
  }, null)]);
2374
2380
  };
2375
2381
  }
2376
- }), ve = To;
2377
- ve.install = (e) => (e.component(ve.name, ve), e.use(gl).use(Ot).use(fl).use(wt).use(Jt), e);
2382
+ }), pe = Lo;
2383
+ pe.install = (e) => (e.component(pe.name, pe), e.use(Cl).use(_t).use(pl).use(Lt).use(kl), e);
2378
2384
  export {
2379
- ve as default
2385
+ pe as default
2380
2386
  };