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