md-editor-v3 4.3.0-beta.1 → 4.3.0-beta.2

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