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