xiaodao-spreader 0.1.2 → 0.1.3

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,5 +1,5 @@
1
- import { defineComponent as kn, computed as I, useModel as Rn, reactive as wl, ref as N, onMounted as Mn, nextTick as J, watch as Ve, onBeforeUnmount as Tn, openBlock as j, createElementBlock as P, normalizeStyle as Ce, createElementVNode as $, Fragment as Yt, renderList as Ut, withModifiers as ue, normalizeClass as vt, toDisplayString as dt, unref as se, createCommentVNode as Fe, createBlock as Dn, Teleport as Hn, mergeModels as _n } from "vue";
2
- const w = 52, y = 24, Je = 100, Ze = 24, Q = 11, En = 50, $n = {
1
+ import { defineComponent as Rt, ref as D, computed as A, watch as He, nextTick as ee, onMounted as Go, onBeforeUnmount as Ht, openBlock as S, createElementBlock as H, normalizeStyle as Me, normalizeClass as oe, createElementVNode as c, toDisplayString as Le, createCommentVNode as ye, createBlock as ne, Teleport as ae, createVNode as ke, Transition as xt, withCtx as St, Fragment as Ie, renderList as Ve, withModifiers as re, unref as G, withDirectives as Ma, vShow as Ra, useModel as Da, reactive as Fl, mergeModels as Fa } from "vue";
2
+ const I = 52, W = 24, Ct = 100, Ta = 24, Ea = 30, Tl = 24, Oa = 1e3, za = 500, Se = 11, La = 50, $a = {
3
3
  "zh-CN": {
4
4
  insert: "插入",
5
5
  delete: "删除",
@@ -17,7 +17,86 @@ const w = 52, y = 24, Je = 100, Ze = 24, Q = 11, En = 50, $n = {
17
17
  scrollLeft: "向左滚动",
18
18
  scrollRight: "向右滚动",
19
19
  calculate: "计算",
20
- sum: "求和"
20
+ sum: "求和",
21
+ undo: "撤销",
22
+ redo: "重做",
23
+ paintFormat: "格式刷",
24
+ clearFormat: "清除格式",
25
+ fontFamily: "字体",
26
+ fontSize: "字号",
27
+ fontSizeIncrease: "增大字号",
28
+ fontSizeDecrease: "减小字号",
29
+ bold: "加粗",
30
+ italic: "斜体",
31
+ underline: "下划线",
32
+ strikethrough: "删除线",
33
+ fontColor: "文字颜色",
34
+ fillColor: "填充颜色",
35
+ borders: "边框",
36
+ borderBottom: "下框线",
37
+ borderTop: "上框线",
38
+ borderLeft: "左框线",
39
+ borderRight: "右框线",
40
+ borderNone: "无框线",
41
+ borderAll: "所有框线",
42
+ borderOuter: "外框线",
43
+ borderThickOuter: "粗外框线",
44
+ fontDefault: "默认",
45
+ rowHeight: "行高",
46
+ colWidth: "列宽",
47
+ defaultRowHeight: "默认行高",
48
+ defaultColWidth: "默认列宽",
49
+ ok: "确定",
50
+ cancel: "取消",
51
+ dimNumberError: "请输入数字",
52
+ dimRangeError: "请输入 {min}~{max} 之间的数值",
53
+ colorAutomatic: "自动",
54
+ colorNoFill: "无填充",
55
+ colorWhite: "白色",
56
+ colorBlack: "黑色",
57
+ colorLightGray: "浅灰",
58
+ colorLightBlue: "浅蓝",
59
+ colorLightOrange: "浅橙",
60
+ colorLightYellow: "浅黄",
61
+ colorLightGreen: "浅绿",
62
+ colorPaleBlue: "淡蓝",
63
+ colorPaleOrange: "淡橙",
64
+ colorPaleYellow: "淡黄",
65
+ colorPaleGreen: "淡绿",
66
+ colorSilver: "银色",
67
+ colorSkyBlue: "天蓝",
68
+ colorCoral: "珊瑚",
69
+ colorGold: "金色",
70
+ colorMint: "薄荷",
71
+ colorGray: "灰色",
72
+ colorMediumBlue: "中蓝",
73
+ colorOrange: "橙色",
74
+ colorAmber: "琥珀",
75
+ colorMediumGreen: "中绿",
76
+ colorDarkGray: "深灰",
77
+ colorRoyalBlue: "宝蓝",
78
+ colorRed: "红色",
79
+ colorDarkGold: "深金",
80
+ colorDarkGreen: "深绿",
81
+ colorCharcoal: "炭灰",
82
+ colorDeepBlue: "深蓝",
83
+ colorDarkRed: "深红",
84
+ colorOlive: "橄榄",
85
+ colorForest: "森林",
86
+ colorSlate: "石板灰",
87
+ colorNavy: "藏青",
88
+ colorCrimson: "绯红",
89
+ colorDarkOlive: "深橄榄",
90
+ colorDeepForest: "深林",
91
+ colorDarkSlate: "深石板灰",
92
+ colorMidnight: "午夜蓝",
93
+ colorMaroon: "栗色",
94
+ colorCoffee: "咖啡色",
95
+ colorEvergreen: "常青",
96
+ colorDarkNavy: "深藏青",
97
+ colorDarkMaroon: "深栗",
98
+ colorDarkCoffee: "深咖",
99
+ colorInkGreen: "墨绿"
21
100
  },
22
101
  "en-US": {
23
102
  insert: "Insert",
@@ -36,14 +115,125 @@ const w = 52, y = 24, Je = 100, Ze = 24, Q = 11, En = 50, $n = {
36
115
  scrollLeft: "Scroll left",
37
116
  scrollRight: "Scroll right",
38
117
  calculate: "Calculate",
39
- sum: "Sum"
118
+ sum: "Sum",
119
+ undo: "Undo",
120
+ redo: "Redo",
121
+ paintFormat: "Paint Format",
122
+ clearFormat: "Clear Format",
123
+ fontFamily: "Font Family",
124
+ fontSize: "Font Size",
125
+ fontSizeIncrease: "Increase Font Size",
126
+ fontSizeDecrease: "Decrease Font Size",
127
+ bold: "Bold",
128
+ italic: "Italic",
129
+ underline: "Underline",
130
+ strikethrough: "Strikethrough",
131
+ fontColor: "Font Color",
132
+ fillColor: "Fill Color",
133
+ borders: "Borders",
134
+ borderBottom: "Bottom Border",
135
+ borderTop: "Top Border",
136
+ borderLeft: "Left Border",
137
+ borderRight: "Right Border",
138
+ borderNone: "No Border",
139
+ borderAll: "All Borders",
140
+ borderOuter: "Outside Borders",
141
+ borderThickOuter: "Thick Box Border",
142
+ fontDefault: "Default",
143
+ rowHeight: "Row Height",
144
+ colWidth: "Column Width",
145
+ defaultRowHeight: "Default Row Height",
146
+ defaultColWidth: "Default Column Width",
147
+ ok: "OK",
148
+ cancel: "Cancel",
149
+ dimNumberError: "Please enter a number",
150
+ dimRangeError: "Please enter a value between {min} and {max}",
151
+ colorAutomatic: "Automatic",
152
+ colorNoFill: "No Fill",
153
+ colorWhite: "White",
154
+ colorBlack: "Black",
155
+ colorLightGray: "Light Gray",
156
+ colorLightBlue: "Light Blue",
157
+ colorLightOrange: "Light Orange",
158
+ colorLightYellow: "Light Yellow",
159
+ colorLightGreen: "Light Green",
160
+ colorPaleBlue: "Pale Blue",
161
+ colorPaleOrange: "Pale Orange",
162
+ colorPaleYellow: "Pale Yellow",
163
+ colorPaleGreen: "Pale Green",
164
+ colorSilver: "Silver",
165
+ colorSkyBlue: "Sky Blue",
166
+ colorCoral: "Coral",
167
+ colorGold: "Gold",
168
+ colorMint: "Mint",
169
+ colorGray: "Gray",
170
+ colorMediumBlue: "Medium Blue",
171
+ colorOrange: "Orange",
172
+ colorAmber: "Amber",
173
+ colorMediumGreen: "Medium Green",
174
+ colorDarkGray: "Dark Gray",
175
+ colorRoyalBlue: "Royal Blue",
176
+ colorRed: "Red",
177
+ colorDarkGold: "Dark Gold",
178
+ colorDarkGreen: "Dark Green",
179
+ colorCharcoal: "Charcoal",
180
+ colorDeepBlue: "Deep Blue",
181
+ colorDarkRed: "Dark Red",
182
+ colorOlive: "Olive",
183
+ colorForest: "Forest",
184
+ colorSlate: "Slate",
185
+ colorNavy: "Navy",
186
+ colorCrimson: "Crimson",
187
+ colorDarkOlive: "Dark Olive",
188
+ colorDeepForest: "Deep Forest",
189
+ colorDarkSlate: "Dark Slate",
190
+ colorMidnight: "Midnight",
191
+ colorMaroon: "Maroon",
192
+ colorCoffee: "Coffee",
193
+ colorEvergreen: "Evergreen",
194
+ colorDarkNavy: "Dark Navy",
195
+ colorDarkMaroon: "Dark Maroon",
196
+ colorDarkCoffee: "Dark Coffee",
197
+ colorInkGreen: "Ink Green"
40
198
  }
41
199
  };
42
- function C(u, f) {
200
+ function B(a, h) {
43
201
  var s;
44
- return ((s = $n[u]) == null ? void 0 : s[f]) ?? f;
202
+ return ((s = $a[a]) == null ? void 0 : s[h]) ?? h;
45
203
  }
46
- const In = {
204
+ const El = '-apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif', st = 10, Aa = [
205
+ { label: "", value: "" },
206
+ { label: "微软雅黑", value: '"Microsoft YaHei", "微软雅黑", sans-serif' },
207
+ { label: "宋体", value: '"SimSun", "宋体", serif' },
208
+ { label: "黑体", value: '"SimHei", "黑体", sans-serif' },
209
+ { label: "楷体", value: '"KaiTi", "楷体", serif' },
210
+ { label: "Arial", value: "Arial, sans-serif" },
211
+ { label: "Arial Black", value: '"Arial Black", sans-serif' },
212
+ { label: "Times New Roman", value: '"Times New Roman", serif' },
213
+ { label: "Courier New", value: '"Courier New", monospace' },
214
+ { label: "Verdana", value: "Verdana, sans-serif" },
215
+ { label: "Georgia", value: "Georgia, serif" },
216
+ { label: "Impact", value: "Impact, sans-serif" },
217
+ { label: "Tahoma", value: "Tahoma, sans-serif" },
218
+ { label: "Trebuchet MS", value: '"Trebuchet MS", sans-serif' },
219
+ { label: "Comic Sans MS", value: '"Comic Sans MS", cursive' }
220
+ ], Ha = [
221
+ { label: "9", value: 9 },
222
+ { label: "10", value: 10 },
223
+ { label: "11", value: 11 },
224
+ { label: "12", value: 12 },
225
+ { label: "13", value: 13 },
226
+ { label: "14", value: 14 },
227
+ { label: "16", value: 16 },
228
+ { label: "18", value: 18 },
229
+ { label: "20", value: 20 },
230
+ { label: "24", value: 24 },
231
+ { label: "28", value: 28 },
232
+ { label: "32", value: 32 },
233
+ { label: "36", value: 36 },
234
+ { label: "48", value: 48 },
235
+ { label: "72", value: 72 }
236
+ ], Ia = {
47
237
  bg: "#f4f4f4",
48
238
  gridBg: "#ffffff",
49
239
  headerBg: "#e8e8e8",
@@ -91,8 +281,14 @@ const In = {
91
281
  scrollBtnColor: "#666",
92
282
  scrollBtnHoverBg: "#d0d0d0",
93
283
  scrollBtnActiveBg: "#c0c0c0",
94
- scrollTrackBg: "rgba(0,0,0,0.06)"
95
- }, Wn = {
284
+ scrollTrackBg: "rgba(0,0,0,0.06)",
285
+ toolbarBg: "#f7f7f7",
286
+ toolbarBorder: "#d8d8d8",
287
+ toolbarBtnColor: "#444",
288
+ toolbarBtnHoverBg: "#e6e6e6",
289
+ toolbarBtnDisabledColor: "#b0b0b0",
290
+ toolbarBtnActiveColor: "#0078d7"
291
+ }, Wa = {
96
292
  bg: "#1e1e1e",
97
293
  gridBg: "#252526",
98
294
  headerBg: "#252525",
@@ -140,208 +336,1442 @@ const In = {
140
336
  scrollBtnColor: "#999",
141
337
  scrollBtnHoverBg: "#3d3d3d",
142
338
  scrollBtnActiveBg: "#4d4d4d",
143
- scrollTrackBg: "rgba(255,255,255,0.05)"
144
- };
145
- function ce(u) {
146
- let f = "", s = u;
339
+ scrollTrackBg: "rgba(255,255,255,0.05)",
340
+ toolbarBg: "#2a2a2a",
341
+ toolbarBorder: "#3e3e3e",
342
+ toolbarBtnColor: "#ccc",
343
+ toolbarBtnHoverBg: "#3a3a3a",
344
+ toolbarBtnDisabledColor: "#666",
345
+ toolbarBtnActiveColor: "#4ea1ff"
346
+ }, Na = ["title"], Ga = { class: "sp-dropdown__value" }, Pa = ["disabled"], Ua = ["onClick"], Ya = ["disabled"], Ka = /* @__PURE__ */ Rt({
347
+ __name: "dropdown",
348
+ props: {
349
+ modelValue: {},
350
+ options: {},
351
+ width: { default: "auto" },
352
+ visibleCount: { default: 8 },
353
+ title: { default: "" },
354
+ modelOpen: { type: Boolean, default: void 0 },
355
+ hideTrigger: { type: Boolean, default: !1 }
356
+ },
357
+ emits: ["update:modelValue", "change", "update:modelOpen"],
358
+ setup(a, { emit: h }) {
359
+ const s = a, v = h, i = D(!1), x = D(0), F = D(null), p = D(null), $ = D(null), w = D({ left: 0, top: 0, up: !1 }), g = D(0), E = D(!1), V = A(() => s.options.find((b) => String(b.value) === String(s.modelValue))), z = A(() => Math.min(s.visibleCount, s.options.length)), X = A(() => s.options.slice(x.value, x.value + z.value)), M = A(() => x.value > 0), O = A(() => x.value + z.value < s.options.length);
360
+ function P(b) {
361
+ x.value = Math.max(0, Math.min(s.options.length - z.value, x.value + b));
362
+ }
363
+ function _() {
364
+ i.value = !0, s.modelOpen !== void 0 && v("update:modelOpen", !0);
365
+ const b = F.value;
366
+ if (!b)
367
+ return;
368
+ const C = b.getBoundingClientRect(), N = z.value * 26 + 2 * 15 + 8, Qe = window.innerHeight - C.bottom - 4 < N && C.top - 4 > N;
369
+ w.value = {
370
+ left: C.left,
371
+ top: Qe ? C.top - N - 4 : C.bottom + 4,
372
+ up: Qe
373
+ };
374
+ const we = s.options.findIndex((Xe) => String(Xe.value) === String(s.modelValue));
375
+ x.value = we >= 0 ? Math.max(0, Math.min(we - Math.floor(z.value / 2), s.options.length - z.value)) : 0;
376
+ }
377
+ function Y() {
378
+ i.value = !1, s.modelOpen !== void 0 && v("update:modelOpen", !1);
379
+ }
380
+ function ce() {
381
+ i.value ? Y() : _();
382
+ }
383
+ function ie(b) {
384
+ v("update:modelValue", b.value), v("change", b.value), Y();
385
+ }
386
+ function de(b) {
387
+ var N, Q;
388
+ if (!i.value)
389
+ return;
390
+ const C = b.target;
391
+ (N = F.value) != null && N.contains(C) || (Q = $.value) != null && Q.contains(C) || Y();
392
+ }
393
+ function We(b) {
394
+ i.value && (b.preventDefault(), P(b.deltaY > 0 ? 1 : -1));
395
+ }
396
+ He(i, (b) => {
397
+ ee(() => {
398
+ var C, N;
399
+ b ? (C = p.value) == null || C.addEventListener("wheel", We, { passive: !1 }) : (N = p.value) == null || N.removeEventListener("wheel", We);
400
+ });
401
+ }), He(() => s.modelOpen, (b) => {
402
+ b !== void 0 && b !== i.value && (b ? _() : Y());
403
+ });
404
+ function Je(b) {
405
+ i.value && (g.value = b.touches[0].clientY, E.value = !0);
406
+ }
407
+ function L(b) {
408
+ if (!i.value || !E.value)
409
+ return;
410
+ const C = b.touches[0].clientY - g.value;
411
+ Math.abs(C) > 5 && (P(C < 0 ? 1 : -1), g.value = b.touches[0].clientY);
412
+ }
413
+ function U() {
414
+ E.value = !1;
415
+ }
416
+ function u(b) {
417
+ b.key === "Escape" && Y();
418
+ }
419
+ return Go(() => {
420
+ document.addEventListener("mousedown", de), window.addEventListener("resize", Y), window.addEventListener("scroll", Y, !0);
421
+ }), Ht(() => {
422
+ document.removeEventListener("mousedown", de), window.removeEventListener("resize", Y), window.removeEventListener("scroll", Y, !0);
423
+ }), (b, C) => {
424
+ var N;
425
+ return S(), H("div", {
426
+ ref_key: "rootRef",
427
+ ref: F,
428
+ class: "sp-dropdown",
429
+ style: Me(typeof a.width == "number" ? { width: a.width + "px" } : { width: a.width })
430
+ }, [
431
+ a.hideTrigger ? ye("", !0) : (S(), H("button", {
432
+ key: 0,
433
+ type: "button",
434
+ class: oe(["sp-dropdown__trigger", { "sp-dropdown__trigger--open": i.value }]),
435
+ title: a.title,
436
+ onClick: ce
437
+ }, [
438
+ c("span", Ga, Le(((N = V.value) == null ? void 0 : N.label) ?? ""), 1),
439
+ C[2] || (C[2] = c("svg", {
440
+ class: "sp-dropdown__caret",
441
+ viewBox: "0 0 1024 1024",
442
+ fill: "currentColor"
443
+ }, [
444
+ c("path", { d: "M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z" })
445
+ ], -1))
446
+ ], 10, Na)),
447
+ (S(), ne(ae, { to: "body" }, [
448
+ ke(xt, { name: "menu-pop" }, {
449
+ default: St(() => [
450
+ i.value ? (S(), H("div", {
451
+ key: 0,
452
+ ref_key: "menuRef",
453
+ ref: $,
454
+ class: oe(["sp-dropdown__menu", { "sp-dropdown__menu--up": w.value.up }]),
455
+ style: Me({ left: w.value.left + "px", top: w.value.top + "px", width: typeof a.width == "number" ? a.width + "px" : a.width }),
456
+ onKeydown: u
457
+ }, [
458
+ c("button", {
459
+ type: "button",
460
+ class: oe(["sp-dropdown__nav", { "sp-dropdown__nav--disabled": !M.value }]),
461
+ disabled: !M.value,
462
+ onClick: C[0] || (C[0] = (Q) => P(-1))
463
+ }, [...C[3] || (C[3] = [
464
+ c("svg", {
465
+ viewBox: "0 0 1024 1024",
466
+ fill: "currentColor"
467
+ }, [
468
+ c("path", { d: "M180.053333 662.613333a32 32 0 0 0 45.226667 0L512 375.893333l286.72 286.72a32 32 0 1 0 45.226667-45.226666l-309.333334-309.333334a32 32 0 0 0-45.226666 0l-309.333334 309.333334a32 32 0 0 0 0 45.226666z" })
469
+ ], -1)
470
+ ])], 10, Pa),
471
+ c("div", {
472
+ ref_key: "listRef",
473
+ ref: p,
474
+ class: "sp-dropdown__list",
475
+ onTouchstart: Je,
476
+ onTouchmove: L,
477
+ onTouchend: U
478
+ }, [
479
+ (S(!0), H(Ie, null, Ve(X.value, (Q) => (S(), H("button", {
480
+ key: String(Q.value),
481
+ type: "button",
482
+ class: oe(["sp-dropdown__item", { "sp-dropdown__item--active": String(Q.value) === String(a.modelValue) }]),
483
+ onClick: (Qe) => ie(Q)
484
+ }, Le(Q.label), 11, Ua))), 128))
485
+ ], 544),
486
+ c("button", {
487
+ type: "button",
488
+ class: oe(["sp-dropdown__nav", { "sp-dropdown__nav--disabled": !O.value }]),
489
+ disabled: !O.value,
490
+ onClick: C[1] || (C[1] = (Q) => P(1))
491
+ }, [...C[4] || (C[4] = [
492
+ c("svg", {
493
+ viewBox: "0 0 1024 1024",
494
+ fill: "currentColor"
495
+ }, [
496
+ c("path", { d: "M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z" })
497
+ ], -1)
498
+ ])], 10, Ya)
499
+ ], 38)) : ye("", !0)
500
+ ]),
501
+ _: 1
502
+ })
503
+ ]))
504
+ ], 4);
505
+ };
506
+ }
507
+ }), Dt = (a, h) => {
508
+ const s = a.__vccOpts || a;
509
+ for (const [v, i] of h)
510
+ s[v] = i;
511
+ return s;
512
+ }, Ol = /* @__PURE__ */ Dt(Ka, [["__scopeId", "data-v-47e5c681"]]), Va = ["title", "onClick"], Xa = /* @__PURE__ */ Rt({
513
+ __name: "colorPicker",
514
+ props: {
515
+ modelOpen: { type: Boolean, default: void 0 },
516
+ colorKey: { default: "text" },
517
+ currentColor: { default: "" },
518
+ locale: { default: "zh-CN" }
519
+ },
520
+ emits: ["update:modelValue", "change", "update:modelOpen"],
521
+ setup(a, { expose: h, emit: s }) {
522
+ const v = a, i = s, x = [
523
+ [
524
+ { key: "colorAutomatic", value: "" },
525
+ { key: "colorLightBlue", value: "#DEEBF7" },
526
+ { key: "colorLightOrange", value: "#FCE4D6" },
527
+ { key: "colorLightYellow", value: "#FFE79A" },
528
+ { key: "colorLightGreen", value: "#E2EFDA" }
529
+ ],
530
+ [
531
+ { key: "colorLightGray", value: "#F2F2F2" },
532
+ { key: "colorPaleBlue", value: "#BDD7EE" },
533
+ { key: "colorPaleOrange", value: "#F8CBAD" },
534
+ { key: "colorPaleYellow", value: "#FFD966" },
535
+ { key: "colorPaleGreen", value: "#C6EFCE" }
536
+ ],
537
+ [
538
+ { key: "colorSilver", value: "#D9D9D9" },
539
+ { key: "colorSkyBlue", value: "#9BC2E6" },
540
+ { key: "colorCoral", value: "#F4B183" },
541
+ { key: "colorGold", value: "#FFC000" },
542
+ { key: "colorMint", value: "#A9D18E" }
543
+ ],
544
+ [
545
+ { key: "colorGray", value: "#BFBFBF" },
546
+ { key: "colorMediumBlue", value: "#6FA8DC" },
547
+ { key: "colorOrange", value: "#ED7D31" },
548
+ { key: "colorAmber", value: "#F1C232" },
549
+ { key: "colorMediumGreen", value: "#70AD47" }
550
+ ],
551
+ [
552
+ { key: "colorDarkGray", value: "#A5A5A5" },
553
+ { key: "colorRoyalBlue", value: "#4A86E8" },
554
+ { key: "colorRed", value: "#E06666" },
555
+ { key: "colorDarkGold", value: "#BF8F00" },
556
+ { key: "colorDarkGreen", value: "#548235" }
557
+ ],
558
+ [
559
+ { key: "colorCharcoal", value: "#808080" },
560
+ { key: "colorDeepBlue", value: "#2E75B6" },
561
+ { key: "colorDarkRed", value: "#CC4125" },
562
+ { key: "colorOlive", value: "#806000" },
563
+ { key: "colorForest", value: "#375623" }
564
+ ],
565
+ [
566
+ { key: "colorSlate", value: "#595959" },
567
+ { key: "colorNavy", value: "#1F4E79" },
568
+ { key: "colorCrimson", value: "#993300" },
569
+ { key: "colorDarkOlive", value: "#5C4500" },
570
+ { key: "colorDeepForest", value: "#2D6A4F" }
571
+ ],
572
+ [
573
+ { key: "colorDarkSlate", value: "#404040" },
574
+ { key: "colorMidnight", value: "#17375E" },
575
+ { key: "colorMaroon", value: "#5A1E00" },
576
+ { key: "colorCoffee", value: "#3D3000" },
577
+ { key: "colorEvergreen", value: "#1B4332" }
578
+ ],
579
+ [
580
+ { key: "colorBlack", value: "#000000" },
581
+ { key: "colorDarkNavy", value: "#0C2340" },
582
+ { key: "colorDarkMaroon", value: "#2E0A00" },
583
+ { key: "colorDarkCoffee", value: "#1F1800" },
584
+ { key: "colorInkGreen", value: "#081C15" }
585
+ ]
586
+ ], F = [
587
+ [
588
+ { key: "colorNoFill", value: "" },
589
+ { key: "colorLightBlue", value: "#DEEBF7" },
590
+ { key: "colorLightOrange", value: "#FCE4D6" },
591
+ { key: "colorLightYellow", value: "#FFE79A" },
592
+ { key: "colorLightGreen", value: "#E2EFDA" }
593
+ ],
594
+ [
595
+ { key: "colorWhite", value: "#FFFFFF" },
596
+ { key: "colorPaleBlue", value: "#BDD7EE" },
597
+ { key: "colorPaleOrange", value: "#F8CBAD" },
598
+ { key: "colorPaleYellow", value: "#FFD966" },
599
+ { key: "colorPaleGreen", value: "#C6EFCE" }
600
+ ],
601
+ [
602
+ { key: "colorLightGray", value: "#F2F2F2" },
603
+ { key: "colorSkyBlue", value: "#9BC2E6" },
604
+ { key: "colorCoral", value: "#F4B183" },
605
+ { key: "colorGold", value: "#FFC000" },
606
+ { key: "colorMint", value: "#A9D18E" }
607
+ ],
608
+ [
609
+ { key: "colorSilver", value: "#D9D9D9" },
610
+ { key: "colorMediumBlue", value: "#6FA8DC" },
611
+ { key: "colorOrange", value: "#ED7D31" },
612
+ { key: "colorAmber", value: "#F1C232" },
613
+ { key: "colorMediumGreen", value: "#70AD47" }
614
+ ],
615
+ [
616
+ { key: "colorGray", value: "#BFBFBF" },
617
+ { key: "colorRoyalBlue", value: "#4A86E8" },
618
+ { key: "colorRed", value: "#E06666" },
619
+ { key: "colorDarkGold", value: "#BF8F00" },
620
+ { key: "colorDarkGreen", value: "#548235" }
621
+ ],
622
+ [
623
+ { key: "colorDarkGray", value: "#A5A5A5" },
624
+ { key: "colorDeepBlue", value: "#2E75B6" },
625
+ { key: "colorDarkRed", value: "#CC4125" },
626
+ { key: "colorOlive", value: "#806000" },
627
+ { key: "colorForest", value: "#375623" }
628
+ ],
629
+ [
630
+ { key: "colorCharcoal", value: "#808080" },
631
+ { key: "colorNavy", value: "#1F4E79" },
632
+ { key: "colorCrimson", value: "#993300" },
633
+ { key: "colorDarkOlive", value: "#5C4500" },
634
+ { key: "colorDeepForest", value: "#2D6A4F" }
635
+ ],
636
+ [
637
+ { key: "colorSlate", value: "#595959" },
638
+ { key: "colorMidnight", value: "#17375E" },
639
+ { key: "colorMaroon", value: "#5A1E00" },
640
+ { key: "colorCoffee", value: "#3D3000" },
641
+ { key: "colorEvergreen", value: "#1B4332" }
642
+ ],
643
+ [
644
+ { key: "colorDarkSlate", value: "#404040" },
645
+ { key: "colorDarkNavy", value: "#0C2340" },
646
+ { key: "colorDarkMaroon", value: "#2E0A00" },
647
+ { key: "colorDarkCoffee", value: "#1F1800" },
648
+ { key: "colorInkGreen", value: "#081C15" }
649
+ ]
650
+ ], p = A(
651
+ () => v.colorKey === "fill" ? F : x
652
+ );
653
+ function $(P) {
654
+ return B(v.locale, P);
655
+ }
656
+ function w(P) {
657
+ const _ = v.currentColor;
658
+ return !_ && !P ? !0 : _ ? _.toLowerCase() === P.toLowerCase() : !1;
659
+ }
660
+ const g = D(!1), E = D(null), V = D(null);
661
+ He(() => v.modelOpen, (P) => {
662
+ P !== void 0 && P !== g.value && (P ? X() : M());
663
+ });
664
+ function z(P) {
665
+ const _ = E.value;
666
+ _ && !_.contains(P.target) && M();
667
+ }
668
+ function X() {
669
+ g.value = !0, v.modelOpen !== void 0 && i("update:modelOpen", !0), ee(() => {
670
+ document.addEventListener("mousedown", z);
671
+ });
672
+ }
673
+ function M() {
674
+ g.value = !1, v.modelOpen !== void 0 && i("update:modelOpen", !1), document.removeEventListener("mousedown", z);
675
+ }
676
+ function O(P) {
677
+ i("update:modelValue", P), i("change", P), M();
678
+ }
679
+ return Ht(() => {
680
+ document.removeEventListener("mousedown", z);
681
+ }), h({ open: g, openMenu: X, close: M }), (P, _) => (S(), H("div", {
682
+ ref_key: "rootRef",
683
+ ref: E,
684
+ class: "color-picker"
685
+ }, [
686
+ ke(xt, { name: "menu-pop" }, {
687
+ default: St(() => [
688
+ g.value ? (S(), H("div", {
689
+ key: 0,
690
+ ref_key: "menuRef",
691
+ ref: V,
692
+ class: "color-picker__menu",
693
+ onMousedown: _[0] || (_[0] = re(() => {
694
+ }, ["stop"]))
695
+ }, [
696
+ (S(!0), H(Ie, null, Ve(p.value, (Y, ce) => (S(), H("div", {
697
+ key: ce,
698
+ class: "color-picker__row"
699
+ }, [
700
+ (S(!0), H(Ie, null, Ve(Y, (ie) => (S(), H("button", {
701
+ key: ie.value,
702
+ class: oe(["color-picker__swatch", { "color-picker__swatch--selected": w(ie.value) }]),
703
+ title: $(ie.key),
704
+ style: Me({
705
+ background: ie.value || "transparent",
706
+ border: ie.value ? "1px solid rgba(0,0,0,0.15)" : "1px dashed #999"
707
+ }),
708
+ onClick: (de) => O(ie.value)
709
+ }, null, 14, Va))), 128))
710
+ ]))), 128))
711
+ ], 544)) : ye("", !0)
712
+ ]),
713
+ _: 1
714
+ })
715
+ ], 512));
716
+ }
717
+ }), zl = /* @__PURE__ */ Dt(Xa, [["__scopeId", "data-v-c262a5e5"]]), ja = ["title", "onClick"], qa = {
718
+ viewBox: "0 0 30 30",
719
+ class: "border-picker__icon"
720
+ }, _a = ["x1", "y1", "x2", "y2", "stroke-width", "stroke-dasharray", "stroke-linecap"], Za = { class: "border-picker__label" }, Ja = /* @__PURE__ */ Rt({
721
+ __name: "borderPicker",
722
+ props: {
723
+ modelOpen: { type: Boolean, default: void 0 },
724
+ locale: { default: "zh-CN" },
725
+ currentBorder: { default: "none" }
726
+ },
727
+ emits: ["update:modelOpen", "change"],
728
+ setup(a, { expose: h, emit: s }) {
729
+ const v = a, i = s, x = [
730
+ { key: "bottom", i18nKey: "borderBottom" },
731
+ { key: "top", i18nKey: "borderTop" },
732
+ { key: "left", i18nKey: "borderLeft" },
733
+ { key: "right", i18nKey: "borderRight" },
734
+ { key: "none", i18nKey: "borderNone" },
735
+ { key: "all", i18nKey: "borderAll" },
736
+ { key: "outer", i18nKey: "borderOuter" },
737
+ { key: "thickOuter", i18nKey: "borderThickOuter" }
738
+ ], F = [
739
+ { name: "top", x1: 4, y1: 4, x2: 26, y2: 4 },
740
+ { name: "bottom", x1: 4, y1: 26, x2: 26, y2: 26 },
741
+ { name: "left", x1: 4, y1: 4, x2: 4, y2: 26 },
742
+ { name: "right", x1: 26, y1: 4, x2: 26, y2: 26 },
743
+ { name: "vMid", x1: 15, y1: 4, x2: 15, y2: 26 },
744
+ { name: "hMid", x1: 4, y1: 15, x2: 26, y2: 15 }
745
+ ], p = {
746
+ bottom: ["bottom"],
747
+ top: ["top"],
748
+ left: ["left"],
749
+ right: ["right"],
750
+ none: [],
751
+ all: ["top", "bottom", "left", "right", "vMid", "hMid"],
752
+ outer: ["top", "bottom", "left", "right"],
753
+ thickOuter: ["top", "bottom", "left", "right"]
754
+ }, $ = {
755
+ bottom: [],
756
+ top: [],
757
+ left: [],
758
+ right: [],
759
+ none: [],
760
+ all: [],
761
+ outer: [],
762
+ thickOuter: ["top", "bottom", "left", "right"]
763
+ };
764
+ function w(O, P) {
765
+ return $[O].includes(P) ? "thick" : p[O].includes(P) ? "solid" : "dashed";
766
+ }
767
+ const g = D(!1), E = D(null);
768
+ He(() => v.modelOpen, (O) => {
769
+ O !== void 0 && O !== g.value && (O ? z() : X());
770
+ });
771
+ function V(O) {
772
+ const P = E.value;
773
+ P && !P.contains(O.target) && X();
774
+ }
775
+ function z() {
776
+ g.value = !0, v.modelOpen !== void 0 && i("update:modelOpen", !0), ee(() => {
777
+ document.addEventListener("mousedown", V);
778
+ });
779
+ }
780
+ function X() {
781
+ g.value = !1, v.modelOpen !== void 0 && i("update:modelOpen", !1), document.removeEventListener("mousedown", V);
782
+ }
783
+ function M(O) {
784
+ i("change", O), X();
785
+ }
786
+ return Ht(() => {
787
+ document.removeEventListener("mousedown", V);
788
+ }), h({ open: g, openMenu: z, close: X }), (O, P) => (S(), H("div", {
789
+ ref_key: "rootRef",
790
+ ref: E,
791
+ class: "border-picker"
792
+ }, [
793
+ ke(xt, { name: "menu-pop" }, {
794
+ default: St(() => [
795
+ g.value ? (S(), H("div", {
796
+ key: 0,
797
+ class: "border-picker__menu",
798
+ onMousedown: P[0] || (P[0] = re(() => {
799
+ }, ["stop"]))
800
+ }, [
801
+ (S(), H(Ie, null, Ve(x, (_) => c("button", {
802
+ key: _.key,
803
+ class: "border-picker__item",
804
+ title: G(B)(a.locale, _.i18nKey),
805
+ onClick: (Y) => M(_.key)
806
+ }, [
807
+ (S(), H("svg", qa, [
808
+ (S(), H(Ie, null, Ve(F, (Y) => c("line", {
809
+ key: Y.name,
810
+ x1: Y.x1,
811
+ y1: Y.y1,
812
+ x2: Y.x2,
813
+ y2: Y.y2,
814
+ stroke: "currentColor",
815
+ "stroke-width": w(_.key, Y.name) === "thick" ? 3 : 1.5,
816
+ "stroke-dasharray": w(_.key, Y.name) === "dashed" ? "0 4" : "none",
817
+ "stroke-linecap": w(_.key, Y.name) === "dashed" ? "round" : "square"
818
+ }, null, 8, _a)), 64))
819
+ ])),
820
+ c("span", Za, Le(G(B)(a.locale, _.i18nKey)), 1)
821
+ ], 8, ja)), 64))
822
+ ], 32)) : ye("", !0)
823
+ ]),
824
+ _: 1
825
+ })
826
+ ], 512));
827
+ }
828
+ }), Qa = /* @__PURE__ */ Dt(Ja, [["__scopeId", "data-v-c9b0ba80"]]), er = {
829
+ class: "tb-item",
830
+ "data-key": "undo"
831
+ }, tr = ["title", "disabled"], or = {
832
+ class: "tb-item",
833
+ "data-key": "redo"
834
+ }, lr = ["title", "disabled"], nr = {
835
+ class: "tb-item",
836
+ "data-key": "paint"
837
+ }, ar = ["title", "disabled"], rr = {
838
+ class: "tb-item",
839
+ "data-key": "clear"
840
+ }, ir = ["title", "disabled"], sr = {
841
+ class: "tb-item",
842
+ "data-key": "font"
843
+ }, ur = {
844
+ class: "tb-item",
845
+ "data-key": "fontSize"
846
+ }, cr = { class: "toolbar-font-size" }, dr = ["value", "title"], fr = ["title"], vr = ["title", "disabled"], br = ["title", "disabled"], mr = {
847
+ class: "tb-item",
848
+ "data-key": "bold"
849
+ }, hr = ["title", "disabled"], pr = {
850
+ class: "tb-item",
851
+ "data-key": "italic"
852
+ }, gr = ["title", "disabled"], yr = {
853
+ class: "tb-item",
854
+ "data-key": "underline"
855
+ }, kr = ["title", "disabled"], wr = {
856
+ class: "tb-item",
857
+ "data-key": "strike"
858
+ }, Cr = ["title", "disabled"], Br = {
859
+ class: "tb-item",
860
+ "data-key": "textColor"
861
+ }, xr = { class: "toolbar-split" }, Sr = ["title", "disabled"], Mr = {
862
+ viewBox: "0 0 1024 1024",
863
+ fill: "currentColor"
864
+ }, Rr = ["fill"], Dr = ["title", "disabled"], Fr = {
865
+ class: "tb-item",
866
+ "data-key": "fillColor"
867
+ }, Tr = { class: "toolbar-split" }, Er = ["title", "disabled"], Or = {
868
+ viewBox: "0 0 1024 1024",
869
+ fill: "currentColor"
870
+ }, zr = ["fill"], Lr = ["title", "disabled"], $r = {
871
+ class: "tb-item",
872
+ "data-key": "border"
873
+ }, Ar = { class: "toolbar-split" }, Hr = ["title", "disabled"], Ir = {
874
+ viewBox: "0 0 30 30",
875
+ fill: "none",
876
+ stroke: "currentColor"
877
+ }, Wr = ["x1", "y1", "x2", "y2", "stroke-width", "stroke-dasharray", "stroke-linecap"], Nr = ["title", "disabled"], Io = 2, Gr = 6, Pr = 34, Ur = /* @__PURE__ */ Rt({
878
+ __name: "toolbar",
879
+ props: {
880
+ locale: {},
881
+ canUndo: { type: Boolean },
882
+ canRedo: { type: Boolean },
883
+ paintFmtActive: { type: Boolean },
884
+ hasSelection: { type: Boolean },
885
+ fontFamilyOptions: {},
886
+ fontSizeOptions: {},
887
+ selFontFamily: {},
888
+ selFontSize: {},
889
+ fontSizeInput: {},
890
+ fontSizeMenuOpen: { type: Boolean },
891
+ selFontWeight: { type: Boolean },
892
+ selFontStyle: { type: Boolean },
893
+ selUnderline: { type: Boolean },
894
+ selStrikethrough: { type: Boolean },
895
+ selTextColor: {},
896
+ textColorMenuOpen: { type: Boolean },
897
+ selFillColor: {},
898
+ fillColorMenuOpen: { type: Boolean },
899
+ cachedTextColor: {},
900
+ cachedFillColor: {},
901
+ borderMenuOpen: { type: Boolean },
902
+ cachedBorder: {}
903
+ },
904
+ emits: ["undo", "redo", "paint-format", "clear-format", "font-family-change", "font-size-input", "font-size-blur", "font-size-keydown", "font-size-change", "update:font-size-menu-open", "font-size-toggle", "font-size-step-up", "font-size-step-down", "bold-toggle", "italic-toggle", "underline-toggle", "strikethrough-toggle", "text-color-change", "update:text-color-menu-open", "fill-color-change", "update:fill-color-menu-open", "apply-text-color", "apply-fill-color", "update:border-menu-open", "border-change", "apply-border"],
905
+ setup(a, { emit: h }) {
906
+ const s = [
907
+ { name: "top", x1: 4, y1: 4, x2: 26, y2: 4 },
908
+ { name: "bottom", x1: 4, y1: 26, x2: 26, y2: 26 },
909
+ { name: "left", x1: 4, y1: 4, x2: 4, y2: 26 },
910
+ { name: "right", x1: 26, y1: 4, x2: 26, y2: 26 },
911
+ { name: "vMid", x1: 15, y1: 4, x2: 15, y2: 26 },
912
+ { name: "hMid", x1: 4, y1: 15, x2: 26, y2: 15 }
913
+ ], v = {
914
+ bottom: ["bottom"],
915
+ top: ["top"],
916
+ left: ["left"],
917
+ right: ["right"],
918
+ none: [],
919
+ all: ["top", "bottom", "left", "right", "vMid", "hMid"],
920
+ outer: ["top", "bottom", "left", "right"],
921
+ thickOuter: ["top", "bottom", "left", "right"]
922
+ }, i = {
923
+ bottom: [],
924
+ top: [],
925
+ left: [],
926
+ right: [],
927
+ none: [],
928
+ all: [],
929
+ outer: [],
930
+ thickOuter: ["top", "bottom", "left", "right"]
931
+ };
932
+ function x(U, u) {
933
+ return i[U].includes(u) ? "thick" : v[U].includes(u) ? "solid" : "dashed";
934
+ }
935
+ const F = [
936
+ "undo",
937
+ "redo",
938
+ "paint",
939
+ "clear",
940
+ "sep1",
941
+ "font",
942
+ "fontSize",
943
+ "sep2",
944
+ "bold",
945
+ "italic",
946
+ "underline",
947
+ "strike",
948
+ "sep3",
949
+ "textColor",
950
+ "fillColor",
951
+ "border"
952
+ ], p = D(null), $ = D(null), w = D(null), g = D(/* @__PURE__ */ new Set()), E = D(!1), V = D(!1), z = /* @__PURE__ */ new Map(), X = A(() => g.value.size > 0);
953
+ function M(U) {
954
+ return g.value.has(U);
955
+ }
956
+ function O() {
957
+ if (!p.value)
958
+ return;
959
+ p.value.querySelectorAll(".tb-item").forEach((u) => {
960
+ const b = u.dataset.key;
961
+ b && z.set(b, u.offsetWidth);
962
+ });
963
+ }
964
+ function P(U, u) {
965
+ if (U.size !== u.size)
966
+ return !1;
967
+ for (const b of U)
968
+ if (!u.has(b))
969
+ return !1;
970
+ return !0;
971
+ }
972
+ function _() {
973
+ if (!p.value)
974
+ return;
975
+ const U = p.value.clientWidth - Gr * 2;
976
+ if (U <= 0)
977
+ return;
978
+ z.size === 0 && O();
979
+ let u = 0;
980
+ for (const C of F)
981
+ u += (z.get(C) ?? 0) + Io;
982
+ const b = /* @__PURE__ */ new Set();
983
+ if (u > U) {
984
+ const C = U - Pr - Io;
985
+ let N = 0;
986
+ for (let Q = 0; Q < F.length; Q++) {
987
+ const Qe = F[Q], we = (z.get(Qe) ?? 0) + Io;
988
+ if (N + we > C) {
989
+ for (let Xe = Q; Xe < F.length; Xe++)
990
+ b.add(F[Xe]);
991
+ break;
992
+ }
993
+ N += we;
994
+ }
995
+ }
996
+ P(b, g.value) || (g.value = b, b.size === 0 && (E.value = !1));
997
+ }
998
+ let Y = null;
999
+ const ce = D(0), ie = A(() => {
1000
+ const U = w.value;
1001
+ if (!U)
1002
+ return { position: "fixed", top: "0px", right: "0px" };
1003
+ ce.value;
1004
+ const u = U.getBoundingClientRect();
1005
+ return {
1006
+ position: "fixed",
1007
+ top: `${u.bottom + 4}px`,
1008
+ right: `${window.innerWidth - u.right}px`
1009
+ };
1010
+ });
1011
+ function de() {
1012
+ E.value && (ce.value++, ee(() => _()));
1013
+ }
1014
+ function We(U) {
1015
+ var b, C;
1016
+ if (!E.value)
1017
+ return;
1018
+ const u = U.target;
1019
+ (b = $.value) != null && b.contains(u) || (C = w.value) != null && C.contains(u) || (V.value = !0, E.value = !1, ee(() => {
1020
+ V.value = !1;
1021
+ }));
1022
+ }
1023
+ function Je() {
1024
+ E.value = !E.value;
1025
+ }
1026
+ Go(() => {
1027
+ ee(() => {
1028
+ O(), _();
1029
+ }), p.value && (Y = new ResizeObserver(() => {
1030
+ E.value || _();
1031
+ }), Y.observe(p.value)), document.addEventListener("mousedown", We, !0), window.addEventListener("resize", de);
1032
+ }), Ht(() => {
1033
+ Y == null || Y.disconnect(), document.removeEventListener("mousedown", We, !0), window.removeEventListener("resize", de);
1034
+ });
1035
+ const L = h;
1036
+ return (U, u) => (S(), H(Ie, null, [
1037
+ c("div", {
1038
+ ref_key: "rootEl",
1039
+ ref: p,
1040
+ class: "toolbar"
1041
+ }, [
1042
+ (S(), ne(ae, {
1043
+ disabled: !M("undo"),
1044
+ to: $.value ?? void 0
1045
+ }, [
1046
+ c("div", er, [
1047
+ c("button", {
1048
+ class: oe(["toolbar-btn", { "toolbar-btn--disabled": !a.canUndo }]),
1049
+ title: G(B)(a.locale, "undo"),
1050
+ disabled: !a.canUndo,
1051
+ onClick: u[0] || (u[0] = (b) => L("undo"))
1052
+ }, [...u[32] || (u[32] = [
1053
+ c("svg", {
1054
+ class: "toolbar-btn__icon",
1055
+ viewBox: "0 0 1024 1024",
1056
+ fill: "currentColor"
1057
+ }, [
1058
+ c("path", { d: "M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272" })
1059
+ ], -1)
1060
+ ])], 10, tr)
1061
+ ])
1062
+ ], 8, ["disabled", "to"])),
1063
+ (S(), ne(ae, {
1064
+ disabled: !M("redo"),
1065
+ to: $.value ?? void 0
1066
+ }, [
1067
+ c("div", or, [
1068
+ c("button", {
1069
+ class: oe(["toolbar-btn", { "toolbar-btn--disabled": !a.canRedo }]),
1070
+ title: G(B)(a.locale, "redo"),
1071
+ disabled: !a.canRedo,
1072
+ onClick: u[1] || (u[1] = (b) => L("redo"))
1073
+ }, [...u[33] || (u[33] = [
1074
+ c("svg", {
1075
+ class: "toolbar-btn__icon",
1076
+ viewBox: "0 0 1024 1024",
1077
+ fill: "currentColor"
1078
+ }, [
1079
+ c("path", {
1080
+ transform: "translate(1024, 0) scale(-1, 1)",
1081
+ d: "M596.16 284.064H258.56l101.376-101.44a31.968 31.968 0 1 0-45.248-45.216L178.56 273.504c-11.904 11.872-18.496 27.84-18.56 44.8a63.04 63.04 0 0 0 18.56 45.28l136.128 136.16a31.904 31.904 0 0 0 45.248 0 31.968 31.968 0 0 0 0-45.248l-106.752-106.496H596.16c114.88 0 208.32 93.312 208.32 208s-93.44 208-208.32 208h-223.36a32 32 0 0 0 0 64h223.36c150.144 0 272.32-122.016 272.32-272 0-149.984-122.176-272-272.32-272"
1082
+ })
1083
+ ], -1)
1084
+ ])], 10, lr)
1085
+ ])
1086
+ ], 8, ["disabled", "to"])),
1087
+ (S(), ne(ae, {
1088
+ disabled: !M("paint"),
1089
+ to: $.value ?? void 0
1090
+ }, [
1091
+ c("div", nr, [
1092
+ c("button", {
1093
+ class: oe(["toolbar-btn", { "toolbar-btn--active": a.paintFmtActive }]),
1094
+ title: G(B)(a.locale, "paintFormat"),
1095
+ disabled: !a.hasSelection,
1096
+ onClick: u[2] || (u[2] = (b) => L("paint-format"))
1097
+ }, [...u[34] || (u[34] = [
1098
+ c("svg", {
1099
+ class: "toolbar-btn__icon",
1100
+ viewBox: "0 0 1024 1024",
1101
+ fill: "currentColor"
1102
+ }, [
1103
+ c("path", { d: "M722.285714 438.857143a36.571429 36.571429 0 0 1-36.571428 36.571428h-512a36.571429 36.571429 0 0 1-36.571429-36.571428V164.571429a36.571429 36.571429 0 0 1 36.571429-36.571429h512a36.571429 36.571429 0 0 1 36.571428 36.571429V256h128a36.571429 36.571429 0 0 1 36.571429 36.571429v294.4a36.571429 36.571429 0 0 1-31.890286 36.278857L448 675.766857V859.428571a36.571429 36.571429 0 0 1-32.292571 36.315429l-4.278858 0.256a36.571429 36.571429 0 0 1-36.571428-36.571429v-215.771428a36.571429 36.571429 0 0 1 31.890286-36.278857l406.966857-52.553143V329.142857h-91.428572v109.714286z m-73.142857-237.714286h-438.857143V402.285714h438.857143V201.142857z" })
1104
+ ], -1)
1105
+ ])], 10, ar)
1106
+ ])
1107
+ ], 8, ["disabled", "to"])),
1108
+ (S(), ne(ae, {
1109
+ disabled: !M("clear"),
1110
+ to: $.value ?? void 0
1111
+ }, [
1112
+ c("div", rr, [
1113
+ c("button", {
1114
+ class: oe(["toolbar-btn", { "toolbar-btn--disabled": !a.hasSelection }]),
1115
+ title: G(B)(a.locale, "clearFormat"),
1116
+ disabled: !a.hasSelection,
1117
+ onClick: u[3] || (u[3] = (b) => L("clear-format"))
1118
+ }, [...u[35] || (u[35] = [
1119
+ c("svg", {
1120
+ class: "toolbar-btn__icon",
1121
+ viewBox: "0 0 1024 1024",
1122
+ fill: "currentColor"
1123
+ }, [
1124
+ c("path", { d: "M672.748 105.674c-3.666-3.799-8.778-5.949-14.125-5.949-5.341 0-10.459 2.15-14.119 5.949L10.418 754.633c-7.789 8.163-7.789 20.798 0 28.967l123.353 126.213c7.782 7.979 23.113 14.461 34.111 14.461h395.042c12.774-0.742 24.882-5.854 34.162-14.461l416.525-426.362c7.751-8.163 7.751-20.76 0-28.916l-340.92-348.861h0.057zM557.85 832.801c-9.273 8.582-21.343 13.707-34.111 14.461H217.888c-12.781-0.742-24.882-5.867-34.162-14.461l-58.074-59.482c-7.782-8.163-7.782-20.804 0-28.967l232.333-237.87c3.666-3.799 8.778-5.949 14.125-5.949s10.453 2.15 14.119 5.949l231.102 236.551c7.744 8.157 7.744 20.753 0 28.916l-59.539 60.909 0.058-0.057z m0 0" })
1125
+ ], -1)
1126
+ ])], 10, ir)
1127
+ ])
1128
+ ], 8, ["disabled", "to"])),
1129
+ (S(), ne(ae, {
1130
+ disabled: !M("sep1"),
1131
+ to: $.value ?? void 0
1132
+ }, [
1133
+ u[36] || (u[36] = c("div", {
1134
+ class: "tb-item",
1135
+ "data-key": "sep1"
1136
+ }, [
1137
+ c("div", { class: "toolbar-sep" })
1138
+ ], -1))
1139
+ ], 8, ["disabled", "to"])),
1140
+ (S(), ne(ae, {
1141
+ disabled: !M("font"),
1142
+ to: $.value ?? void 0
1143
+ }, [
1144
+ c("div", sr, [
1145
+ ke(Ol, {
1146
+ class: "toolbar-font",
1147
+ "model-value": a.selFontFamily,
1148
+ options: a.fontFamilyOptions,
1149
+ width: 110,
1150
+ "visible-count": 8,
1151
+ title: G(B)(a.locale, "fontFamily"),
1152
+ onChange: u[4] || (u[4] = (b) => L("font-family-change", b))
1153
+ }, null, 8, ["model-value", "options", "title"])
1154
+ ])
1155
+ ], 8, ["disabled", "to"])),
1156
+ (S(), ne(ae, {
1157
+ disabled: !M("fontSize"),
1158
+ to: $.value ?? void 0
1159
+ }, [
1160
+ c("div", ur, [
1161
+ c("div", cr, [
1162
+ c("input", {
1163
+ class: "toolbar-font-size__input",
1164
+ type: "text",
1165
+ value: a.fontSizeInput,
1166
+ title: G(B)(a.locale, "fontSize"),
1167
+ onInput: u[5] || (u[5] = (b) => L("font-size-input", b.target.value)),
1168
+ onBlur: u[6] || (u[6] = (b) => L("font-size-blur")),
1169
+ onKeydown: u[7] || (u[7] = (b) => L("font-size-keydown", b))
1170
+ }, null, 40, dr),
1171
+ ke(Ol, {
1172
+ class: "toolbar-font-size__dropdown",
1173
+ "model-value": a.selFontSize,
1174
+ options: a.fontSizeOptions,
1175
+ width: 56,
1176
+ "visible-count": 9,
1177
+ title: G(B)(a.locale, "fontSize"),
1178
+ "hide-trigger": !0,
1179
+ "model-open": a.fontSizeMenuOpen,
1180
+ "onUpdate:modelOpen": u[8] || (u[8] = (b) => L("update:font-size-menu-open", b)),
1181
+ onChange: u[9] || (u[9] = (b) => L("font-size-change", b))
1182
+ }, null, 8, ["model-value", "options", "title", "model-open"]),
1183
+ c("button", {
1184
+ class: "toolbar-font-size__btn",
1185
+ type: "button",
1186
+ title: G(B)(a.locale, "fontSize"),
1187
+ onMousedown: u[10] || (u[10] = re(() => {
1188
+ }, ["prevent"])),
1189
+ onClick: u[11] || (u[11] = (b) => L("font-size-toggle"))
1190
+ }, [...u[37] || (u[37] = [
1191
+ c("svg", {
1192
+ viewBox: "0 0 1024 1024",
1193
+ fill: "currentColor"
1194
+ }, [
1195
+ c("path", { d: "M180.053333 361.386667a32 32 0 0 1 45.226667 0L512 648.106667l286.72-286.72a32 32 0 1 1 45.226667 45.226666l-309.333334 309.333334a32 32 0 0 1-45.226666 0L180.053333 406.613333a32 32 0 0 1 0-45.226666z" })
1196
+ ], -1)
1197
+ ])], 40, fr),
1198
+ c("button", {
1199
+ class: "toolbar-btn toolbar-btn--step",
1200
+ type: "button",
1201
+ title: G(B)(a.locale, "fontSizeDecrease"),
1202
+ disabled: !a.hasSelection,
1203
+ onMousedown: u[12] || (u[12] = re(() => {
1204
+ }, ["prevent"])),
1205
+ onClick: u[13] || (u[13] = (b) => L("font-size-step-down"))
1206
+ }, [...u[38] || (u[38] = [
1207
+ c("svg", {
1208
+ viewBox: "0 0 1024 1024",
1209
+ fill: "currentColor"
1210
+ }, [
1211
+ c("path", { d: "M481.28 125.95a29.506 29.506 0 0 0-27.45-18.7h-63.34c-12.13 0-23.02 7.42-27.45 18.7L67.94 876.46c-7.61 19.35 6.66 40.29 27.45 40.29h35.47c12.26 0 23.24-7.58 27.58-19.04l80.89-213.35h364.54l81.94 213.46a29.51 29.51 0 0 0 27.54 18.93h35.56c20.8 0 35.06-20.94 27.45-40.29L481.28 125.95zM273.47 594.06l145.38-384.38h2.2l147.58 384.38H273.47zM928.64 195.74h-177c-16.29 0-29.5 13.21-29.5 29.5s13.21 29.5 29.5 29.5h177c16.29 0 29.5-13.21 29.5-29.5s-13.21-29.5-29.5-29.5z" })
1212
+ ], -1)
1213
+ ])], 40, vr),
1214
+ c("button", {
1215
+ class: "toolbar-btn toolbar-btn--step",
1216
+ type: "button",
1217
+ title: G(B)(a.locale, "fontSizeIncrease"),
1218
+ disabled: !a.hasSelection,
1219
+ onMousedown: u[14] || (u[14] = re(() => {
1220
+ }, ["prevent"])),
1221
+ onClick: u[15] || (u[15] = (b) => L("font-size-step-up"))
1222
+ }, [...u[39] || (u[39] = [
1223
+ c("svg", {
1224
+ viewBox: "0 0 1024 1024",
1225
+ fill: "currentColor"
1226
+ }, [
1227
+ c("path", { d: "M481.28 125.95a29.506 29.506 0 0 0-27.45-18.7h-63.34c-12.13 0-23.02 7.42-27.45 18.7L67.94 876.46c-7.61 19.35 6.66 40.29 27.45 40.29h35.47c12.26 0 23.24-7.58 27.58-19.04l80.89-213.35h364.54l81.94 213.46a29.51 29.51 0 0 0 27.54 18.93h35.56c20.8 0 35.06-20.94 27.45-40.29L481.28 125.95zM273.47 594.06l145.38-384.38h2.2l147.58 384.38H273.47zM928.64 195.74h-59v-59c0-16.29-13.21-29.5-29.5-29.5s-29.5 13.21-29.5 29.5v59h-59c-16.29 0-29.5 13.21-29.5 29.5s13.21 29.5 29.5 29.5h59v59c0 16.29 13.21 29.5 29.5 29.5s29.5-13.21 29.5-29.5v-59h59c16.29 0 29.5-13.21 29.5-29.5s-13.21-29.5-29.5-29.5z" })
1228
+ ], -1)
1229
+ ])], 40, br)
1230
+ ])
1231
+ ])
1232
+ ], 8, ["disabled", "to"])),
1233
+ (S(), ne(ae, {
1234
+ disabled: !M("sep2"),
1235
+ to: $.value ?? void 0
1236
+ }, [
1237
+ u[40] || (u[40] = c("div", {
1238
+ class: "tb-item",
1239
+ "data-key": "sep2"
1240
+ }, [
1241
+ c("div", { class: "toolbar-sep" })
1242
+ ], -1))
1243
+ ], 8, ["disabled", "to"])),
1244
+ (S(), ne(ae, {
1245
+ disabled: !M("bold"),
1246
+ to: $.value ?? void 0
1247
+ }, [
1248
+ c("div", mr, [
1249
+ c("button", {
1250
+ class: oe(["toolbar-btn", { "toolbar-btn--active": a.selFontWeight }]),
1251
+ title: G(B)(a.locale, "bold"),
1252
+ disabled: !a.hasSelection,
1253
+ onClick: u[16] || (u[16] = (b) => L("bold-toggle"))
1254
+ }, [...u[41] || (u[41] = [
1255
+ c("svg", {
1256
+ viewBox: "0 0 1024 1024",
1257
+ fill: "currentColor"
1258
+ }, [
1259
+ c("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
1260
+ c("path", { d: "M733.610667 467.712A267.562667 267.562667 0 0 0 548.010667 10.581333H183.466667a53.333333 53.333333 0 0 0 0 106.666667h43.221333a10.666667 10.666667 0 0 1 10.666667 10.666667V896a10.666667 10.666667 0 0 1-10.666667 10.666667H183.466667a53.333333 53.333333 0 1 0 0 106.666666h425.088a287.658667 287.658667 0 0 0 125.013333-545.536z m-185.6-350.464a160.512 160.512 0 0 1 0 320.981333H354.688a10.666667 10.666667 0 0 1-10.666667-10.666666V128a10.666667 10.666667 0 0 1 10.666667-10.666667z m60.586666 789.333333H354.688a10.666667 10.666667 0 0 1-10.666667-10.666666v-340.352a10.666667 10.666667 0 0 1 10.666667-10.666667H608.597333a180.864 180.864 0 0 1 0 361.685333z" })
1261
+ ])
1262
+ ], -1)
1263
+ ])], 10, hr)
1264
+ ])
1265
+ ], 8, ["disabled", "to"])),
1266
+ (S(), ne(ae, {
1267
+ disabled: !M("italic"),
1268
+ to: $.value ?? void 0
1269
+ }, [
1270
+ c("div", pr, [
1271
+ c("button", {
1272
+ class: oe(["toolbar-btn", { "toolbar-btn--active": a.selFontStyle }]),
1273
+ title: G(B)(a.locale, "italic"),
1274
+ disabled: !a.hasSelection,
1275
+ onClick: u[17] || (u[17] = (b) => L("italic-toggle"))
1276
+ }, [...u[42] || (u[42] = [
1277
+ c("svg", {
1278
+ viewBox: "0 0 1024 1024",
1279
+ fill: "currentColor"
1280
+ }, [
1281
+ c("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
1282
+ c("path", { d: "M960 10.581333h-325.845333a53.333333 53.333333 0 0 0 0 106.666667h46.336a10.666667 10.666667 0 0 1 9.002666 16.384L203.946667 896.725333a21.333333 21.333333 0 0 1-18.005334 9.856H64a53.333333 53.333333 0 0 0 0 106.666667h325.845333a53.333333 53.333333 0 0 0 0-106.666667H343.509333a10.666667 10.666667 0 0 1-9.002666-16.384L820.053333 127.146667a21.333333 21.333333 0 0 1 18.005334-9.898667H960a53.333333 53.333333 0 0 0 0-106.666667z" })
1283
+ ])
1284
+ ], -1)
1285
+ ])], 10, gr)
1286
+ ])
1287
+ ], 8, ["disabled", "to"])),
1288
+ (S(), ne(ae, {
1289
+ disabled: !M("underline"),
1290
+ to: $.value ?? void 0
1291
+ }, [
1292
+ c("div", yr, [
1293
+ c("button", {
1294
+ class: oe(["toolbar-btn", { "toolbar-btn--active": a.selUnderline }]),
1295
+ title: G(B)(a.locale, "underline"),
1296
+ disabled: !a.hasSelection,
1297
+ onClick: u[18] || (u[18] = (b) => L("underline-toggle"))
1298
+ }, [...u[43] || (u[43] = [
1299
+ c("svg", {
1300
+ viewBox: "0 0 1024 1024",
1301
+ fill: "currentColor"
1302
+ }, [
1303
+ c("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
1304
+ c("path", { d: "M960 906.581333h-896a53.333333 53.333333 0 0 0 0 106.666667h896a53.333333 53.333333 0 0 0 0-106.666667zM84.394667 117.248h58.154666a10.666667 10.666667 0 0 1 10.666667 10.666667v363.648a358.784 358.784 0 0 0 717.568 0V128a10.666667 10.666667 0 0 1 10.666667-10.666667h58.154666a53.333333 53.333333 0 0 0 0-106.666666H695.466667a53.333333 53.333333 0 0 0 0 106.666666h58.154666a10.666667 10.666667 0 0 1 10.666667 10.666667v363.648a252.117333 252.117333 0 0 1-504.234667 0V128a10.666667 10.666667 0 0 1 10.666667-10.666667H328.533333a53.333333 53.333333 0 1 0 0-106.666666H84.394667a53.333333 53.333333 0 0 0 0 106.666666z" })
1305
+ ])
1306
+ ], -1)
1307
+ ])], 10, kr)
1308
+ ])
1309
+ ], 8, ["disabled", "to"])),
1310
+ (S(), ne(ae, {
1311
+ disabled: !M("strike"),
1312
+ to: $.value ?? void 0
1313
+ }, [
1314
+ c("div", wr, [
1315
+ c("button", {
1316
+ class: oe(["toolbar-btn", { "toolbar-btn--active": a.selStrikethrough }]),
1317
+ title: G(B)(a.locale, "strikethrough"),
1318
+ disabled: !a.hasSelection,
1319
+ onClick: u[19] || (u[19] = (b) => L("strikethrough-toggle"))
1320
+ }, [...u[44] || (u[44] = [
1321
+ c("svg", {
1322
+ viewBox: "0 0 1024 1024",
1323
+ fill: "currentColor"
1324
+ }, [
1325
+ c("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
1326
+ c("path", { d: "M1013.333333 552.618667A53.333333 53.333333 0 0 0 960 499.2h-381.269333a20.992 20.992 0 0 1-12.032-3.84c-30.805333-21.888-63.232-41.856-94.634667-61.098667-119.466667-73.173333-192-123.733333-192-207.488 0-95.36 94.165333-109.610667 150.314667-109.610666a193.706667 193.706667 0 0 1 131.456 32.597333 113.578667 113.578667 0 0 1 19.072 84.906667v12.8a53.333333 53.333333 0 1 0 106.666666 0v-11.434667a208.512 208.512 0 0 0-49.706666-161.152C595.157333 31.616 527.317333 10.581333 430.549333 10.581333c-156.074667 0-256.981333 84.864-256.981333 216.277334 0 118.314667 80.725333 192.512 170.666667 252.885333a10.666667 10.666667 0 0 1-5.930667 19.541333H64a53.333333 53.333333 0 0 0 0 106.666667h468.352a10.709333 10.709333 0 0 1 6.784 2.474667 185.130667 185.130667 0 0 1 82.432 147.882666c0 139.434667-146.176 150.272-191.018667 150.272-77.397333 0-133.930667-17.28-163.584-50.048a144.810667 144.810667 0 0 1-27.733333-115.2 53.333333 53.333333 0 0 0-106.154667-10.496A245.76 245.76 0 0 0 187.733333 928.128c51.2 56.490667 132.864 85.333333 242.688 85.333333 178.090667 0 297.685333-103.253333 297.685334-256.938666a258.517333 258.517333 0 0 0-36.224-134.272 10.666667 10.666667 0 0 1 9.216-16.085334H960a53.333333 53.333333 0 0 0 53.333333-53.546666z" })
1327
+ ])
1328
+ ], -1)
1329
+ ])], 10, Cr)
1330
+ ])
1331
+ ], 8, ["disabled", "to"])),
1332
+ (S(), ne(ae, {
1333
+ disabled: !M("sep3"),
1334
+ to: $.value ?? void 0
1335
+ }, [
1336
+ u[45] || (u[45] = c("div", {
1337
+ class: "tb-item",
1338
+ "data-key": "sep3"
1339
+ }, [
1340
+ c("div", { class: "toolbar-sep" })
1341
+ ], -1))
1342
+ ], 8, ["disabled", "to"])),
1343
+ (S(), ne(ae, {
1344
+ disabled: !M("textColor"),
1345
+ to: $.value ?? void 0
1346
+ }, [
1347
+ c("div", Br, [
1348
+ c("div", xr, [
1349
+ c("button", {
1350
+ class: "toolbar-btn toolbar-split__main",
1351
+ title: G(B)(a.locale, "fontColor"),
1352
+ disabled: !a.hasSelection,
1353
+ onClick: u[20] || (u[20] = (b) => L("apply-text-color"))
1354
+ }, [
1355
+ (S(), H("svg", Mr, [
1356
+ u[46] || (u[46] = c("g", { transform: "translate(102.4, 102.4) scale(0.8)" }, [
1357
+ c("path", { d: "M663.120842 529.946947H364.759579l-84.07579 212.884211a53.894737 53.894737 0 0 1-50.122105 34.169263h-14.551579a34.869895 34.869895 0 0 1-32.498526-47.696842L443.715368 70.063158a53.894737 53.894737 0 0 1 50.122106-34.115369h41.768421a53.894737 53.894737 0 0 1 50.176 34.277053l257.670737 659.078737a34.977684 34.977684 0 0 1-32.552421 47.696842h-14.389895a53.894737 53.894737 0 0 1-50.229895-34.277053l-83.159579-212.776421z m-35.139368-89.788631l-113.340632-289.953684-114.472421 289.953684h227.813053z" })
1358
+ ], -1)),
1359
+ c("path", {
1360
+ d: "M62.895 844.369m53.895 0l790.474 0q53.895 0 53.895 53.895l0 26.947q0 53.895-53.895 53.895l-790.474 0q-53.895 0-53.895-53.895l0-26.947q0-53.895 53.895-53.895z",
1361
+ fill: a.cachedTextColor || "#000000"
1362
+ }, null, 8, Rr)
1363
+ ]))
1364
+ ], 8, Sr),
1365
+ c("button", {
1366
+ class: "toolbar-btn toolbar-split__arrow",
1367
+ title: G(B)(a.locale, "fontColor"),
1368
+ disabled: !a.hasSelection,
1369
+ onClick: u[21] || (u[21] = (b) => L("update:text-color-menu-open", !a.textColorMenuOpen))
1370
+ }, [...u[47] || (u[47] = [
1371
+ c("svg", {
1372
+ viewBox: "0 0 1024 1024",
1373
+ fill: "currentColor"
1374
+ }, [
1375
+ c("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
1376
+ ], -1)
1377
+ ])], 8, Dr),
1378
+ ke(zl, {
1379
+ "model-open": a.textColorMenuOpen,
1380
+ "color-key": "text",
1381
+ "current-color": a.selTextColor,
1382
+ locale: a.locale,
1383
+ "onUpdate:modelOpen": u[22] || (u[22] = (b) => L("update:text-color-menu-open", b)),
1384
+ onChange: u[23] || (u[23] = (b) => L("text-color-change", b))
1385
+ }, null, 8, ["model-open", "current-color", "locale"])
1386
+ ])
1387
+ ])
1388
+ ], 8, ["disabled", "to"])),
1389
+ (S(), ne(ae, {
1390
+ disabled: !M("fillColor"),
1391
+ to: $.value ?? void 0
1392
+ }, [
1393
+ c("div", Fr, [
1394
+ c("div", Tr, [
1395
+ c("button", {
1396
+ class: "toolbar-btn toolbar-split__main",
1397
+ title: G(B)(a.locale, "fillColor"),
1398
+ disabled: !a.hasSelection,
1399
+ onClick: u[24] || (u[24] = (b) => L("apply-fill-color"))
1400
+ }, [
1401
+ (S(), H("svg", Or, [
1402
+ u[48] || (u[48] = c("path", { d: "M447.018667 37.952l352.298666 352.298667c6.613333 6.613333 6.613333 17.344 0 23.957333L446.101333 767.424a16.938667 16.938667 0 0 1-23.957333 0L121.429333 466.688a16.938667 16.938667 0 0 1 0-23.957333L428.608 135.552 388.992 96a8.469333 8.469333 0 0 1 0-11.989333l46.058667-46.037334a8.469333 8.469333 0 0 1 11.968 0z m346.325333 517.461333l57.514667 60.074667c31.744 33.194667 31.744 86.997333 0 120.192a78.869333 78.869333 0 0 1-115.008 0c-31.765333-33.194667-31.765333-86.997333 0-120.192l57.493333-60.074667zM486.101333 193.066667l-261.12 261.12 20.458667 20.458666 380.16-1.728 70.186667-70.186666-209.706667-209.664z" }, null, -1)),
1403
+ c("path", {
1404
+ d: "M85.333333 853.333333m8.896 0l835.541334 0q8.896 0 8.896 8.896l0 110.208q0 8.896-8.896 8.896l-835.541334 0q-8.896 0-8.896-8.896l0-110.208q0-8.896 8.896-8.896Z",
1405
+ fill: a.cachedFillColor || "currentColor"
1406
+ }, null, 8, zr)
1407
+ ]))
1408
+ ], 8, Er),
1409
+ c("button", {
1410
+ class: "toolbar-btn toolbar-split__arrow",
1411
+ title: G(B)(a.locale, "fillColor"),
1412
+ disabled: !a.hasSelection,
1413
+ onClick: u[25] || (u[25] = (b) => L("update:fill-color-menu-open", !a.fillColorMenuOpen))
1414
+ }, [...u[49] || (u[49] = [
1415
+ c("svg", {
1416
+ viewBox: "0 0 1024 1024",
1417
+ fill: "currentColor"
1418
+ }, [
1419
+ c("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
1420
+ ], -1)
1421
+ ])], 8, Lr),
1422
+ ke(zl, {
1423
+ "model-open": a.fillColorMenuOpen,
1424
+ "color-key": "fill",
1425
+ "current-color": a.selFillColor,
1426
+ locale: a.locale,
1427
+ "onUpdate:modelOpen": u[26] || (u[26] = (b) => L("update:fill-color-menu-open", b)),
1428
+ onChange: u[27] || (u[27] = (b) => L("fill-color-change", b))
1429
+ }, null, 8, ["model-open", "current-color", "locale"])
1430
+ ])
1431
+ ])
1432
+ ], 8, ["disabled", "to"])),
1433
+ (S(), ne(ae, {
1434
+ disabled: !M("border"),
1435
+ to: $.value ?? void 0
1436
+ }, [
1437
+ c("div", $r, [
1438
+ c("div", Ar, [
1439
+ c("button", {
1440
+ class: "toolbar-btn toolbar-split__main",
1441
+ title: G(B)(a.locale, "borders"),
1442
+ disabled: !a.hasSelection,
1443
+ onClick: u[28] || (u[28] = (b) => L("apply-border"))
1444
+ }, [
1445
+ (S(), H("svg", Ir, [
1446
+ (S(), H(Ie, null, Ve(s, (b) => c("line", {
1447
+ key: b.name,
1448
+ x1: b.x1,
1449
+ y1: b.y1,
1450
+ x2: b.x2,
1451
+ y2: b.y2,
1452
+ "stroke-width": x(a.cachedBorder, b.name) === "thick" ? 3 : 1.5,
1453
+ "stroke-dasharray": x(a.cachedBorder, b.name) === "dashed" ? "0 4" : "none",
1454
+ "stroke-linecap": x(a.cachedBorder, b.name) === "dashed" ? "round" : "square"
1455
+ }, null, 8, Wr)), 64))
1456
+ ]))
1457
+ ], 8, Hr),
1458
+ c("button", {
1459
+ class: "toolbar-btn toolbar-split__arrow",
1460
+ title: G(B)(a.locale, "borders"),
1461
+ disabled: !a.hasSelection,
1462
+ onClick: u[29] || (u[29] = (b) => L("update:border-menu-open", !a.borderMenuOpen))
1463
+ }, [...u[50] || (u[50] = [
1464
+ c("svg", {
1465
+ viewBox: "0 0 1024 1024",
1466
+ fill: "currentColor"
1467
+ }, [
1468
+ c("path", { d: "M180.053 361.387a32 32 0 0 1 45.227 0L512 648.107l286.72-286.72a32 32 0 1 1 45.227 45.227l-309.334 309.333a32 32 0 0 1-45.226 0L180.053 406.613a32 32 0 0 1 0-45.226z" })
1469
+ ], -1)
1470
+ ])], 8, Nr),
1471
+ ke(Qa, {
1472
+ "model-open": a.borderMenuOpen,
1473
+ locale: a.locale,
1474
+ "current-border": a.cachedBorder,
1475
+ "onUpdate:modelOpen": u[30] || (u[30] = (b) => L("update:border-menu-open", b)),
1476
+ onChange: u[31] || (u[31] = (b) => L("border-change", b))
1477
+ }, null, 8, ["model-open", "locale", "current-border"])
1478
+ ])
1479
+ ])
1480
+ ], 8, ["disabled", "to"])),
1481
+ X.value ? (S(), H("button", {
1482
+ key: 0,
1483
+ ref_key: "moreBtnEl",
1484
+ ref: w,
1485
+ class: oe(["toolbar-more", { "toolbar-more--active": E.value }]),
1486
+ type: "button",
1487
+ onClick: Je
1488
+ }, [...u[51] || (u[51] = [
1489
+ c("svg", {
1490
+ viewBox: "0 0 1024 1024",
1491
+ fill: "currentColor"
1492
+ }, [
1493
+ c("circle", {
1494
+ cx: "512",
1495
+ cy: "160",
1496
+ r: "96"
1497
+ }),
1498
+ c("circle", {
1499
+ cx: "512",
1500
+ cy: "512",
1501
+ r: "96"
1502
+ }),
1503
+ c("circle", {
1504
+ cx: "512",
1505
+ cy: "864",
1506
+ r: "96"
1507
+ })
1508
+ ], -1)
1509
+ ])], 2)) : ye("", !0)
1510
+ ], 512),
1511
+ (S(), ne(ae, { to: "body" }, [
1512
+ ke(xt, { name: "menu-pop" }, {
1513
+ default: St(() => [
1514
+ Ma(c("div", {
1515
+ ref_key: "overflowMenuEl",
1516
+ ref: $,
1517
+ class: oe(["overflow-menu", { "no-anim": V.value }]),
1518
+ style: Me(ie.value)
1519
+ }, null, 6), [
1520
+ [Ra, E.value]
1521
+ ])
1522
+ ]),
1523
+ _: 1
1524
+ })
1525
+ ]))
1526
+ ], 64));
1527
+ }
1528
+ }), Yr = /* @__PURE__ */ Dt(Ur, [["__scopeId", "data-v-69401a37"]]), Kr = { class: "tab-list" }, Vr = ["onClick", "onDblclick", "onContextmenu"], Xr = ["value"], jr = {
1529
+ key: 1,
1530
+ class: "tab-item__name"
1531
+ }, qr = ["title"], _r = /* @__PURE__ */ Rt({
1532
+ __name: "tabbar",
1533
+ props: {
1534
+ locale: {},
1535
+ sheets: {},
1536
+ activeSheetIndex: {},
1537
+ renTab: {},
1538
+ renTabVal: {}
1539
+ },
1540
+ emits: ["tab-click", "tab-dblclick", "tab-contextmenu", "tab-rename-input", "tab-rename-keydown", "tab-rename-commit", "tabbar-contextmenu", "add-sheet"],
1541
+ setup(a, { emit: h }) {
1542
+ const s = h;
1543
+ return (v, i) => (S(), H("div", {
1544
+ class: "tab-bar",
1545
+ onContextmenu: i[5] || (i[5] = (x) => s("tabbar-contextmenu", x))
1546
+ }, [
1547
+ c("div", Kr, [
1548
+ (S(!0), H(Ie, null, Ve(a.sheets, (x, F) => (S(), H("div", {
1549
+ key: x.id,
1550
+ class: oe(["tab-item", { "tab-item--active": F === a.activeSheetIndex }]),
1551
+ onClick: (p) => s("tab-click", F),
1552
+ onDblclick: re((p) => s("tab-dblclick", F), ["prevent"]),
1553
+ onContextmenu: (p) => s("tab-contextmenu", { ev: p, i: F })
1554
+ }, [
1555
+ a.renTab === F ? (S(), H("input", {
1556
+ key: 0,
1557
+ class: "tab-rename-input",
1558
+ value: a.renTabVal,
1559
+ onInput: i[0] || (i[0] = (p) => s("tab-rename-input", p.target.value)),
1560
+ onKeydown: i[1] || (i[1] = (p) => s("tab-rename-keydown", p)),
1561
+ onBlur: i[2] || (i[2] = (p) => s("tab-rename-commit")),
1562
+ onClick: i[3] || (i[3] = re(() => {
1563
+ }, ["stop"]))
1564
+ }, null, 40, Xr)) : (S(), H("span", jr, Le(x.name), 1))
1565
+ ], 42, Vr))), 128))
1566
+ ]),
1567
+ c("button", {
1568
+ class: "tab-bar__add-btn",
1569
+ title: G(B)(a.locale, "addSheet"),
1570
+ onClick: i[4] || (i[4] = (x) => s("add-sheet"))
1571
+ }, " + ", 8, qr)
1572
+ ], 32));
1573
+ }
1574
+ }), Zr = /* @__PURE__ */ Dt(_r, [["__scopeId", "data-v-49f54625"]]);
1575
+ function ze(a) {
1576
+ let h = "", s = a;
147
1577
  do
148
- f = String.fromCharCode(65 + s % 26) + f, s = Math.floor(s / 26) - 1;
1578
+ h = String.fromCharCode(65 + s % 26) + h, s = Math.floor(s / 26) - 1;
149
1579
  while (s >= 0);
150
- return f;
1580
+ return h;
151
1581
  }
152
- function Kt(u) {
153
- let f = 0;
154
- for (let s = 0; s < u.length; s++)
155
- f = f * 26 + (u.toUpperCase().charCodeAt(s) - 64);
156
- return f - 1;
1582
+ function No(a) {
1583
+ let h = 0;
1584
+ for (let s = 0; s < a.length; s++)
1585
+ h = h * 26 + (a.toUpperCase().charCodeAt(s) - 64);
1586
+ return h - 1;
157
1587
  }
158
- function Se(u) {
159
- if (u == null)
1588
+ function ut(a) {
1589
+ if (a == null)
160
1590
  return null;
161
- if (typeof u == "number")
162
- return u;
163
- if (typeof u == "string") {
164
- const f = parseFloat(u);
165
- return u.endsWith("%") || isNaN(f) ? null : f;
1591
+ if (typeof a == "number")
1592
+ return a;
1593
+ if (typeof a == "string") {
1594
+ const h = parseFloat(a);
1595
+ return a.endsWith("%") || isNaN(h) ? null : h;
166
1596
  }
167
1597
  return null;
168
1598
  }
169
- function jt(u) {
170
- navigator.clipboard.writeText(u).catch(() => {
171
- const f = document.createElement("textarea");
172
- f.value = u, f.style.position = "fixed", f.style.opacity = "0", document.body.appendChild(f), f.select(), document.execCommand("copy"), document.body.removeChild(f);
1599
+ function Wo(a) {
1600
+ navigator.clipboard.writeText(a).catch(() => {
1601
+ const h = document.createElement("textarea");
1602
+ h.value = a, h.style.position = "fixed", h.style.opacity = "0", document.body.appendChild(h), h.select(), document.execCommand("copy"), document.body.removeChild(h);
173
1603
  });
174
1604
  }
175
- function Xe(u, f) {
176
- return `${u},${f}`;
1605
+ function Mt(a, h) {
1606
+ return `${a},${h}`;
177
1607
  }
178
- function ht(u, f, s) {
179
- const c = u.match(/^\$?([A-Z]+)\$?(\d+)$/i);
180
- if (!c)
1608
+ function io(a, h, s) {
1609
+ const v = a.match(/^\$?([A-Z]+)\$?(\d+)$/i);
1610
+ if (!v)
181
1611
  return null;
182
- const r = Kt(c[1]), m = parseInt(c[2], 10) - 1;
183
- return r < 0 || r >= f || m < 0 || m >= s ? null : { col: r, row: m };
1612
+ const i = No(v[1]), x = parseInt(v[2], 10) - 1;
1613
+ return i < 0 || i >= h || x < 0 || x >= s ? null : { col: i, row: x };
184
1614
  }
185
- function ke(u, f) {
186
- if (!f)
1615
+ function ct(a, h) {
1616
+ if (!h)
187
1617
  return { x: 0, y: 0 };
188
- const s = f.getBoundingClientRect();
189
- return { x: u.clientX - s.left, y: u.clientY - s.top };
1618
+ const s = h.getBoundingClientRect();
1619
+ return { x: a.clientX - s.left, y: a.clientY - s.top };
190
1620
  }
191
- function An(u, f, s) {
192
- const c = u.split(":");
193
- if (c.length !== 2)
1621
+ function Jr(a, h, s) {
1622
+ const v = a.split(":");
1623
+ if (v.length !== 2)
194
1624
  return null;
195
- const r = ht(c[0], f, s), m = ht(c[1], f, s);
196
- return !r || !m ? null : {
197
- sc: Math.min(r.col, m.col),
198
- sr: Math.min(r.row, m.row),
199
- ec: Math.max(r.col, m.col),
200
- er: Math.max(r.row, m.row)
1625
+ const i = io(v[0], h, s), x = io(v[1], h, s);
1626
+ return !i || !x ? null : {
1627
+ sc: Math.min(i.col, x.col),
1628
+ sr: Math.min(i.row, x.row),
1629
+ ec: Math.max(i.col, x.col),
1630
+ er: Math.max(i.row, x.row)
201
1631
  };
202
1632
  }
203
- function Nn(u, f, s, c, r) {
204
- const m = s[Xe(u, f)];
205
- if (!m)
1633
+ function Qr(a, h, s, v, i) {
1634
+ const x = s[Mt(a, h)];
1635
+ if (!x)
206
1636
  return 0;
207
- const k = m.value;
208
- if (k.startsWith("="))
209
- return Bl(Xe(u, f), s, c, r) ?? 0;
210
- const b = parseFloat(k);
211
- return isNaN(b) ? 0 : b;
1637
+ const F = x.value;
1638
+ if (F.startsWith("="))
1639
+ return Al(Mt(a, h), s, v, i) ?? 0;
1640
+ const p = parseFloat(F);
1641
+ return isNaN(p) ? 0 : p;
212
1642
  }
213
- const Oe = /* @__PURE__ */ new Map();
214
- function yl() {
215
- Oe.clear();
1643
+ const Bt = /* @__PURE__ */ new Map();
1644
+ function Ll() {
1645
+ Bt.clear();
216
1646
  }
217
- function Bl(u, f, s, c) {
218
- return Ln(u, f, s, c);
1647
+ function Al(a, h, s, v) {
1648
+ return ei(a, h, s, v);
219
1649
  }
220
- function Ln(u, f, s, c, r) {
221
- if (Oe.has(u))
1650
+ function ei(a, h, s, v, i) {
1651
+ if (Bt.has(a))
222
1652
  return NaN;
223
- Oe.set(u, NaN);
224
- const m = f[u];
225
- if (!m)
1653
+ Bt.set(a, NaN);
1654
+ const x = h[a];
1655
+ if (!x)
226
1656
  return NaN;
227
- const k = m.value;
228
- if (!k.startsWith("=")) {
229
- const g = parseFloat(k), h = isNaN(g) ? 0 : g;
230
- return Oe.set(u, h), h;
1657
+ const F = x.value;
1658
+ if (!F.startsWith("=")) {
1659
+ const w = parseFloat(F), g = isNaN(w) ? 0 : w;
1660
+ return Bt.set(a, g), g;
231
1661
  }
232
- const b = k.slice(1).trim();
233
- if (b.toUpperCase().startsWith("SUM(") && b.endsWith(")")) {
234
- const g = b.slice(4, -1).trim(), h = An(g, s, c);
235
- if (h) {
236
- let R = 0;
237
- for (let O = h.sc; O <= h.ec; O++)
238
- for (let H = h.sr; H <= h.er; H++)
239
- R += Nn(O, H, f, s, c);
240
- return isNaN(R) ? NaN : (Oe.set(u, R), R);
1662
+ const p = F.slice(1).trim();
1663
+ if (p.toUpperCase().startsWith("SUM(") && p.endsWith(")")) {
1664
+ const w = p.slice(4, -1).trim(), g = Jr(w, s, v);
1665
+ if (g) {
1666
+ let E = 0;
1667
+ for (let V = g.sc; V <= g.ec; V++)
1668
+ for (let z = g.sr; z <= g.er; z++)
1669
+ E += Qr(V, z, h, s, v);
1670
+ return isNaN(E) ? NaN : (Bt.set(a, E), E);
241
1671
  }
242
1672
  return NaN;
243
1673
  }
244
1674
  return NaN;
245
1675
  }
246
- function xl(u, f, s) {
247
- const c = [], r = /(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;
248
- let m;
249
- for (; (m = r.exec(u)) !== null; ) {
250
- const k = ht(m[1], f, s);
251
- if (k)
252
- if (m[2]) {
253
- const b = ht(m[2], f, s);
254
- if (!b)
1676
+ function Hl(a, h, s) {
1677
+ const v = [], i = /(\$?[A-Z]+\$?\d+)(?::(\$?[A-Z]+\$?\d+))?/gi;
1678
+ let x;
1679
+ for (; (x = i.exec(a)) !== null; ) {
1680
+ const F = io(x[1], h, s);
1681
+ if (F)
1682
+ if (x[2]) {
1683
+ const p = io(x[2], h, s);
1684
+ if (!p)
255
1685
  continue;
256
- for (let Y = Math.min(k.col, b.col); Y <= Math.max(k.col, b.col); Y++)
257
- for (let g = Math.min(k.row, b.row); g <= Math.max(k.row, b.row); g++)
258
- c.push(Xe(Y, g));
1686
+ for (let $ = Math.min(F.col, p.col); $ <= Math.max(F.col, p.col); $++)
1687
+ for (let w = Math.min(F.row, p.row); w <= Math.max(F.row, p.row); w++)
1688
+ v.push(Mt($, w));
259
1689
  } else
260
- c.push(Xe(k.col, k.row));
1690
+ v.push(Mt(F.col, F.row));
261
1691
  }
262
- return c;
1692
+ return v;
263
1693
  }
264
- function Fn(u, f, s, c, r) {
265
- const m = s[Xe(u, f)];
266
- if (!m)
1694
+ function ti(a, h, s, v, i) {
1695
+ const x = s[Mt(a, h)];
1696
+ if (!x)
267
1697
  return "";
268
- const k = m.value;
269
- if (!k.startsWith("="))
270
- return k;
271
- const b = Bl(Xe(u, f), s, c, r);
272
- return isNaN(b) ? "#ERROR" : String(b);
1698
+ const F = x.value;
1699
+ if (!F.startsWith("="))
1700
+ return F;
1701
+ const p = Al(Mt(a, h), s, v, i);
1702
+ return isNaN(p) ? "#ERROR" : String(p);
273
1703
  }
274
- function On(u, f, s, c, r, m) {
275
- return f === 0 && s === 0 ? u : u.replace(
1704
+ function oi(a, h, s, v, i, x) {
1705
+ return h === 0 && s === 0 ? a : a.replace(
276
1706
  /(\$?)([A-Z]+)(\$?)(\d+)/gi,
277
- (k, b, Y, g, h) => {
278
- const R = b ? Kt(Y) : Kt(Y) + f, O = g ? parseInt(h, 10) - 1 : parseInt(h, 10) - 1 + s;
279
- let H;
280
- R < 0 ? H = "A" : R >= c ? H = m(c - 1) : H = m(R);
281
- let E;
282
- return O < 0 ? E = "1" : O >= r ? E = String(r) : E = String(O + 1), (b || "") + H + (g || "") + E;
1707
+ (F, p, $, w, g) => {
1708
+ const E = p ? No($) : No($) + h, V = w ? parseInt(g, 10) - 1 : parseInt(g, 10) - 1 + s;
1709
+ let z;
1710
+ E < 0 ? z = "A" : E >= v ? z = x(v - 1) : z = x(E);
1711
+ let X;
1712
+ return V < 0 ? X = "1" : V >= i ? X = String(i) : X = String(V + 1), (p || "") + z + (w || "") + X;
283
1713
  }
284
1714
  );
285
1715
  }
286
- class Xn {
1716
+ class li {
287
1717
  constructor() {
288
1718
  this.deps = /* @__PURE__ */ new Map(), this.rev = /* @__PURE__ */ new Map(), this.dirty = /* @__PURE__ */ new Set();
289
1719
  }
290
- clear(f) {
291
- var c;
292
- const s = this.deps.get(f);
1720
+ clear(h) {
1721
+ var v;
1722
+ const s = this.deps.get(h);
293
1723
  if (s) {
294
- for (const r of s)
295
- (c = this.rev.get(r)) == null || c.delete(f);
296
- this.deps.delete(f);
1724
+ for (const i of s)
1725
+ (v = this.rev.get(i)) == null || v.delete(h);
1726
+ this.deps.delete(h);
297
1727
  }
298
1728
  }
299
- set(f, s) {
300
- if (this.clear(f), s.length !== 0) {
301
- this.deps.set(f, s);
302
- for (const c of s)
303
- this.rev.has(c) || this.rev.set(c, /* @__PURE__ */ new Set()), this.rev.get(c).add(f);
1729
+ set(h, s) {
1730
+ if (this.clear(h), s.length !== 0) {
1731
+ this.deps.set(h, s);
1732
+ for (const v of s)
1733
+ this.rev.has(v) || this.rev.set(v, /* @__PURE__ */ new Set()), this.rev.get(v).add(h);
304
1734
  }
305
1735
  }
306
- markDirty(f) {
307
- const s = [f];
1736
+ markDirty(h) {
1737
+ const s = [h];
308
1738
  for (; s.length > 0; ) {
309
- const c = s.pop(), r = this.rev.get(c);
310
- if (r)
311
- for (const m of r)
312
- this.dirty.has(m) || (this.dirty.add(m), s.push(m));
1739
+ const v = s.pop(), i = this.rev.get(v);
1740
+ if (i)
1741
+ for (const x of i)
1742
+ this.dirty.has(x) || (this.dirty.add(x), s.push(x));
313
1743
  }
314
1744
  }
315
1745
  getDirtyAndClear() {
316
- const f = this.dirty;
317
- return this.dirty = /* @__PURE__ */ new Set(), f;
1746
+ const h = this.dirty;
1747
+ return this.dirty = /* @__PURE__ */ new Set(), h;
318
1748
  }
319
1749
  /** 从 cells 快照重建所有依赖关系 */
320
- rebuild(f, s, c) {
321
- this.deps.clear(), this.rev.clear(), this.dirty.clear(), Oe.clear();
322
- for (const [r, m] of Object.entries(f))
323
- if (m.value.startsWith("=")) {
324
- const k = xl(m.value.slice(1), s, c);
325
- this.set(r, k);
1750
+ rebuild(h, s, v) {
1751
+ this.deps.clear(), this.rev.clear(), this.dirty.clear(), Bt.clear();
1752
+ for (const [i, x] of Object.entries(h))
1753
+ if (x.value.startsWith("=")) {
1754
+ const F = Hl(x.value.slice(1), s, v);
1755
+ this.set(i, F);
326
1756
  }
327
1757
  }
328
1758
  }
329
- function Yn(u, f, s, c) {
330
- const r = {}, m = c(f), k = c(s);
331
- return m != null && (r.width = `${m}px`), k != null && (r.height = `${k}px`), r["--sp-formula-bar-bg"] = u.formulaBarBg, r["--sp-formula-bar-border"] = u.formulaBarBorder, r["--sp-formula-bar-label-color"] = u.formulaBarLabelText, r["--sp-formula-bar-label-bg"] = u.formulaBarLabelBg, r["--sp-formula-bar-label-border"] = u.formulaBarLabelBorder, r["--sp-formula-bar-input-bg"] = u.formulaBarInputBg, r["--sp-formula-bar-input-border"] = u.formulaBarInputBorder, r["--sp-formula-bar-input-color"] = u.formulaBarInputText, r["--sp-formula-bar-input-focus-border"] = u.formulaBarInputFocusBorder, r["--sp-formula-bar-input-focus-shadow"] = u.formulaBarInputFocusShadow, r["--sp-wrapper-bg"] = u.wrapperBg, r["--sp-cell-editor-border"] = u.cellEditorBorder, r["--sp-cell-editor-color"] = u.cellEditorText, r["--sp-cell-editor-bg"] = u.cellEditorBg, r["--sp-cell-editor-shadow"] = u.cellEditorShadow, r["--sp-tab-bar-bg"] = u.tabBarBg, r["--sp-tab-bar-border"] = u.tabBarBorder, r["--sp-tab-active-bg"] = u.tabActiveBg, r["--sp-tab-active-color"] = u.tabActiveText, r["--sp-tab-active-border"] = u.tabActiveBorder, r["--sp-tab-inactive-bg"] = u.tabInactiveBg, r["--sp-tab-inactive-color"] = u.tabInactiveText, r["--sp-tab-inactive-border"] = u.tabInactiveBorder, r["--sp-tab-hover-bg"] = u.tabHoverBg, r["--sp-tab-add-btn-color"] = u.tabAddBtnColor, r["--sp-tab-add-btn-hover-bg"] = u.tabAddBtnHoverBg, r["--sp-tab-scroll-btn-color"] = u.tabScrollBtnColor, r["--sp-tab-scroll-btn-hover-bg"] = u.tabScrollBtnHoverBg, r["--sp-scroll-thumb"] = u.scrollbarThumb, r["--sp-scroll-thumb-hover"] = u.scrollbarThumbHover, r["--sp-scroll-btn-bg"] = u.scrollBtnBg, r["--sp-scroll-btn-color"] = u.scrollBtnColor, r["--sp-scroll-btn-hover-bg"] = u.scrollBtnHoverBg, r["--sp-scroll-btn-active-bg"] = u.scrollBtnActiveBg, r["--sp-scroll-track-bg"] = u.scrollTrackBg, r;
1759
+ function ni(a, h, s, v) {
1760
+ const i = {}, x = v(h), F = v(s);
1761
+ return x != null && (i.width = `${x}px`), F != null && (i.height = `${F}px`), i["--sp-formula-bar-bg"] = a.formulaBarBg, i["--sp-formula-bar-border"] = a.formulaBarBorder, i["--sp-formula-bar-label-color"] = a.formulaBarLabelText, i["--sp-formula-bar-label-bg"] = a.formulaBarLabelBg, i["--sp-formula-bar-label-border"] = a.formulaBarLabelBorder, i["--sp-formula-bar-input-bg"] = a.formulaBarInputBg, i["--sp-formula-bar-input-border"] = a.formulaBarInputBorder, i["--sp-formula-bar-input-color"] = a.formulaBarInputText, i["--sp-formula-bar-input-focus-border"] = a.formulaBarInputFocusBorder, i["--sp-formula-bar-input-focus-shadow"] = a.formulaBarInputFocusShadow, i["--sp-wrapper-bg"] = a.wrapperBg, i["--sp-cell-editor-border"] = a.cellEditorBorder, i["--sp-cell-editor-color"] = a.cellEditorText, i["--sp-cell-editor-bg"] = a.cellEditorBg, i["--sp-cell-editor-shadow"] = a.cellEditorShadow, i["--sp-tab-bar-bg"] = a.tabBarBg, i["--sp-tab-bar-border"] = a.tabBarBorder, i["--sp-tab-active-bg"] = a.tabActiveBg, i["--sp-tab-active-color"] = a.tabActiveText, i["--sp-tab-active-border"] = a.tabActiveBorder, i["--sp-tab-inactive-bg"] = a.tabInactiveBg, i["--sp-tab-inactive-color"] = a.tabInactiveText, i["--sp-tab-inactive-border"] = a.tabInactiveBorder, i["--sp-tab-hover-bg"] = a.tabHoverBg, i["--sp-tab-add-btn-color"] = a.tabAddBtnColor, i["--sp-tab-add-btn-hover-bg"] = a.tabAddBtnHoverBg, i["--sp-tab-scroll-btn-color"] = a.tabScrollBtnColor, i["--sp-tab-scroll-btn-hover-bg"] = a.tabScrollBtnHoverBg, i["--sp-scroll-thumb"] = a.scrollbarThumb, i["--sp-scroll-thumb-hover"] = a.scrollbarThumbHover, i["--sp-scroll-btn-bg"] = a.scrollBtnBg, i["--sp-scroll-btn-color"] = a.scrollBtnColor, i["--sp-scroll-btn-hover-bg"] = a.scrollBtnHoverBg, i["--sp-scroll-btn-active-bg"] = a.scrollBtnActiveBg, i["--sp-scroll-track-bg"] = a.scrollTrackBg, i["--sp-toolbar-bg"] = a.toolbarBg, i["--sp-toolbar-border"] = a.toolbarBorder, i["--sp-toolbar-btn-color"] = a.toolbarBtnColor, i["--sp-toolbar-btn-hover-bg"] = a.toolbarBtnHoverBg, i["--sp-toolbar-btn-disabled-color"] = a.toolbarBtnDisabledColor, i["--sp-toolbar-btn-active-color"] = a.toolbarBtnActiveColor, i;
332
1762
  }
333
- const Un = { class: "tab-list" }, jn = ["onClick", "onDblclick", "onContextmenu"], Kn = ["value"], Pn = {
334
- key: 1,
335
- class: "tab-item__name"
336
- }, zn = ["title"], Vn = { class: "formula-bar" }, Jn = { class: "formula-bar__cell-label" }, Zn = ["value"], qn = ["value"], Gn = ["title"], Qn = ["title"], eo = ["title"], to = ["title"], lo = {
1763
+ const ai = { class: "formula-bar" }, ri = { class: "formula-bar__cell-label" }, ii = ["value"], si = ["value"], ui = ["title"], ci = ["title"], di = ["title"], fi = ["title"], vi = {
337
1764
  key: 2,
338
1765
  class: "sb-corner"
339
- }, no = ["onClick", "onMouseenter"], oo = { class: "context-menu__label" }, ao = {
1766
+ }, bi = ["onClick", "onMouseenter"], mi = { class: "context-menu__label" }, hi = {
340
1767
  key: 0,
341
1768
  class: "context-menu__arrow"
342
- }, ro = ["onClick"], uo = /* @__PURE__ */ kn({
1769
+ }, pi = ["onClick"], gi = { class: "dim-panel__title" }, yi = { class: "dim-panel__body" }, ki = ["value"], wi = {
1770
+ key: 0,
1771
+ class: "dim-panel__error"
1772
+ }, Ci = { class: "dim-panel__footer" }, Bi = "\0", $l = "#444", xi = /* @__PURE__ */ Rt({
343
1773
  __name: "spreader",
344
- props: /* @__PURE__ */ _n({
1774
+ props: /* @__PURE__ */ Fa({
345
1775
  rowCount: { default: 200 },
346
1776
  colCount: { default: 26 },
347
1777
  width: {},
@@ -353,173 +1783,466 @@ const Un = { class: "tab-list" }, jn = ["onClick", "onDblclick", "onContextmenu"
353
1783
  dataModifiers: {}
354
1784
  }),
355
1785
  emits: ["update:data"],
356
- setup(u) {
357
- const f = u, s = I(() => f.locale === "zh-CN" ? "zh-CN" : "en-US"), c = f.colCount, r = f.rowCount, m = Rn(u, "data");
358
- let k = "";
359
- const b = wl({}), Y = new Xn(), g = N(null), h = N({ col: 0, row: 0 }), R = N(null), O = N(""), H = N(new Array(c).fill(Je)), E = N(new Array(r).fill(Ze)), M = N(0), T = N(0), he = I(() => {
1786
+ setup(a) {
1787
+ const h = a, s = A(() => h.locale === "zh-CN" ? "zh-CN" : "en-US"), v = h.colCount, i = h.rowCount, x = Da(a, "data");
1788
+ let F = "";
1789
+ const p = Fl({}), $ = new li(), w = D(null), g = D({ col: 0, row: 0 }), E = D(null), V = D(""), z = D(new Array(v).fill(Ct)), X = D(new Array(i).fill(void 0)), M = D(0), O = D(0), P = (() => {
1790
+ if (typeof window > "u")
1791
+ return 1;
1792
+ const e = window.devicePixelRatio || 1;
1793
+ return e > 1 ? Math.min(1.5, 1 + (e - 1) * 0.25) : 1;
1794
+ })();
1795
+ function _(e, t) {
1796
+ var n;
1797
+ const o = (n = p[C(e, t)]) == null ? void 0 : n.style;
1798
+ return typeof (o == null ? void 0 : o.fontSize) == "number" && o.fontSize > 0 ? o.fontSize : st;
1799
+ }
1800
+ function Y(e) {
1801
+ return Math.round(e * P);
1802
+ }
1803
+ const ce = A(() => {
360
1804
  const e = [0];
361
- for (let t = 0; t < c; t++)
362
- e.push(e[t] + H.value[t]);
1805
+ for (let t = 0; t < v; t++)
1806
+ e.push(e[t] + z.value[t]);
363
1807
  return e;
364
- }), pe = I(() => {
1808
+ });
1809
+ function ie(e) {
1810
+ const t = X.value[e];
1811
+ if (t != null && t > 0)
1812
+ return t;
1813
+ let o = st;
1814
+ for (let l = 0; l < v; l++) {
1815
+ const r = _(l, e);
1816
+ r > o && (o = r);
1817
+ }
1818
+ const n = Y(o);
1819
+ return Math.max(Ta, Math.round(n * 1.2 + 8));
1820
+ }
1821
+ const de = A(() => {
365
1822
  const e = [0];
366
- for (let t = 0; t < r; t++)
367
- e.push(e[t] + E.value[t]);
1823
+ for (let t = 0; t < i; t++)
1824
+ e.push(e[t] + ie(t));
368
1825
  return e;
369
- }), pt = I(() => he.value[c]), bt = I(() => pe.value[r]);
370
- function ee(e, t) {
371
- h.value = { col: e, row: t }, g.value = { startCol: e, startRow: t, endCol: e, endRow: t };
372
- }
373
- function te(e, t, n, l) {
374
- h.value = { col: e, row: t }, g.value = {
375
- startCol: Math.min(e, n),
376
- startRow: Math.min(t, l),
377
- endCol: Math.max(e, n),
378
- endRow: Math.max(t, l)
1826
+ }), We = A(() => ce.value[v]), Je = A(() => de.value[i]);
1827
+ function L(e, t) {
1828
+ g.value = { col: e, row: t }, w.value = { startCol: e, startRow: t, endCol: e, endRow: t };
1829
+ }
1830
+ function U(e, t, o, n) {
1831
+ g.value = { col: e, row: t }, w.value = {
1832
+ startCol: Math.min(e, o),
1833
+ startRow: Math.min(t, n),
1834
+ endCol: Math.max(e, o),
1835
+ endRow: Math.max(t, n)
379
1836
  };
380
1837
  }
381
- function mt() {
382
- te(0, 0, c - 1, r - 1);
1838
+ function u() {
1839
+ U(0, 0, v - 1, i - 1);
383
1840
  }
384
- function Pt(e, t) {
385
- const n = g.value;
386
- return n ? e >= n.startCol && e <= n.endCol && t >= n.startRow && t <= n.endRow : !1;
1841
+ function b(e, t) {
1842
+ const o = w.value;
1843
+ return o ? e >= o.startCol && e <= o.endCol && t >= o.startRow && t <= o.endRow : !1;
387
1844
  }
388
- function L(e, t) {
1845
+ function C(e, t) {
389
1846
  return `${e},${t}`;
390
1847
  }
391
- function X(e) {
392
- Reflect.deleteProperty(b, e);
1848
+ function N(e) {
1849
+ Reflect.deleteProperty(p, e);
393
1850
  }
394
- function Re(e, t) {
395
- var n;
396
- return ((n = b[L(e, t)]) == null ? void 0 : n.value) ?? "";
1851
+ function Q(e, t) {
1852
+ var o;
1853
+ return ((o = p[C(e, t)]) == null ? void 0 : o.value) ?? "";
397
1854
  }
398
- function Cl(e, t) {
399
- return yl(), Fn(e, t, b, c, r);
1855
+ function Qe(e, t) {
1856
+ return Ll(), ti(e, t, p, v, i);
400
1857
  }
401
- function Me(e, t, n) {
1858
+ function we(e, t, o) {
402
1859
  var d;
403
- const l = L(e, t);
404
- if (yl(), n === "" || n == null) {
405
- Y.clear(l), X(l), Y.markDirty(l);
1860
+ const n = C(e, t);
1861
+ if (Ll(), o === "" || o == null) {
1862
+ $.clear(n), N(n), $.markDirty(n);
406
1863
  return;
407
1864
  }
408
- const o = String(n), a = ((d = b[l]) == null ? void 0 : d.style) ?? null;
409
- b[l] = { value: o, style: a }, o.startsWith("=") ? Y.set(l, xl(o.slice(1), c, r)) : Y.clear(l), Y.markDirty(l);
410
- }
411
- function zt(e, t, n, l) {
412
- for (let o = e; o <= t; o++)
413
- for (let a = n; a <= l; a++) {
414
- const d = L(o, a);
415
- Y.clear(d), X(d), Y.markDirty(d);
1865
+ const l = String(o), r = ((d = p[n]) == null ? void 0 : d.style) ?? null;
1866
+ p[n] = { value: l, style: r }, l.startsWith("=") ? $.set(n, Hl(l.slice(1), v, i)) : $.clear(n), $.markDirty(n);
1867
+ }
1868
+ function Xe(e, t, o, n) {
1869
+ for (let l = e; l <= t; l++)
1870
+ for (let r = o; r <= n; r++) {
1871
+ const d = C(l, r);
1872
+ $.clear(d), N(d), $.markDirty(d);
416
1873
  }
417
1874
  }
418
- function ve(e) {
419
- R.value || (R.value = { ...h.value }, O.value = e ?? Re(h.value.col, h.value.row));
1875
+ function je(e) {
1876
+ E.value || (E.value = { ...g.value }, V.value = e ?? Q(g.value.col, g.value.row));
420
1877
  }
421
- function be() {
422
- R.value && (Me(R.value.col, R.value.row, O.value), R.value = null, O.value = "");
1878
+ function qe() {
1879
+ E.value && (j(), we(E.value.col, E.value.row, V.value), E.value = null, V.value = "");
423
1880
  }
424
- function me() {
425
- R.value = null, O.value = "";
1881
+ function et() {
1882
+ E.value = null, V.value = "";
426
1883
  }
427
- function ie(e, t) {
428
- ee(
429
- Math.max(0, Math.min(c - 1, h.value.col + e)),
430
- Math.max(0, Math.min(r - 1, h.value.row + t))
1884
+ function Ne(e, t) {
1885
+ L(
1886
+ Math.max(0, Math.min(v - 1, g.value.col + e)),
1887
+ Math.max(0, Math.min(i - 1, g.value.row + t))
431
1888
  );
432
1889
  }
433
- function W(e, t) {
434
- const n = Math.max(0, U.w - w - Q), l = Math.max(0, U.h - y - Q), o = he.value[e], a = pe.value[t], d = H.value[e], p = E.value[t];
435
- let B = M.value, S = T.value;
436
- o < B ? B = o : o + d > B + n && (B = o + d - n), a < S ? S = a : a + p > S + l && (S = a + p - l), z(B, S);
1890
+ function le(e, t) {
1891
+ const o = Math.max(0, se.w - I - Se), n = Math.max(0, se.h - W - Se), l = ce.value[e], r = de.value[t], d = z.value[e], m = ie(t);
1892
+ let k = M.value, T = O.value;
1893
+ l < k ? k = l : l + d > k + o && (k = l + d - o), r < T ? T = r : r + m > T + n && (T = r + m - n), fe(k, T);
437
1894
  }
438
- function le(e) {
439
- const t = he.value;
440
- if (e < 0 || e >= t[c])
1895
+ function Re(e) {
1896
+ const t = ce.value;
1897
+ if (e < 0 || e >= t[v])
441
1898
  return -1;
442
- let n = 0, l = c - 1;
443
- for (; n < l; ) {
444
- const o = n + l + 1 >> 1;
445
- t[o] <= e ? n = o : l = o - 1;
1899
+ let o = 0, n = v - 1;
1900
+ for (; o < n; ) {
1901
+ const l = o + n + 1 >> 1;
1902
+ t[l] <= e ? o = l : n = l - 1;
446
1903
  }
447
- return n;
1904
+ return o;
448
1905
  }
449
- function ne(e) {
450
- const t = pe.value;
451
- if (e < 0 || e >= t[r])
1906
+ function De(e) {
1907
+ const t = de.value;
1908
+ if (e < 0 || e >= t[i])
452
1909
  return -1;
453
- let n = 0, l = r - 1;
454
- for (; n < l; ) {
455
- const o = n + l + 1 >> 1;
456
- t[o] <= e ? n = o : l = o - 1;
1910
+ let o = 0, n = i - 1;
1911
+ for (; o < n; ) {
1912
+ const l = o + n + 1 >> 1;
1913
+ t[l] <= e ? o = l : n = l - 1;
457
1914
  }
458
- return n;
1915
+ return o;
1916
+ }
1917
+ const Ge = D([]), Ft = D([]);
1918
+ function Po(e) {
1919
+ const t = {};
1920
+ for (const [o, n] of Object.entries(e))
1921
+ t[o] = { value: n.value, style: n.style };
1922
+ return t;
1923
+ }
1924
+ function so() {
1925
+ return dt(), {
1926
+ sheets: q.value.map((e) => ({
1927
+ id: e.id,
1928
+ name: e.name,
1929
+ cells: Po(e.cells),
1930
+ selection: e.selection ? { ...e.selection } : null,
1931
+ activeCell: e.activeCell ? { ...e.activeCell } : { col: 0, row: 0 },
1932
+ scrollX: e.scrollX,
1933
+ scrollY: e.scrollY,
1934
+ colWidths: [...e.colWidths],
1935
+ rowHeights: [...e.rowHeights]
1936
+ })),
1937
+ activeSheetIndex: he.value
1938
+ };
459
1939
  }
460
- const de = N([]), qe = N([]);
461
- function gt() {
462
- const e = {};
463
- for (const [t, n] of Object.entries(b))
464
- e[t] = { value: n.value, style: n.style };
465
- return { cells: e, colWidths: [...H.value], rowHeights: [...E.value] };
1940
+ function Uo(e) {
1941
+ q.value = e.sheets.map((t) => ({ ...t, cells: Po(t.cells) })), Ze(Math.max(0, Math.min(e.activeSheetIndex, q.value.length - 1))), $.rebuild(p, v, i);
466
1942
  }
467
- function Vt(e) {
468
- Object.keys(b).forEach((t) => X(t)), Object.assign(b, e.cells), H.value = e.colWidths, E.value = e.rowHeights, Y.rebuild(b, c, r);
1943
+ function j() {
1944
+ const e = so(), t = Ge.value[Ge.value.length - 1];
1945
+ t && JSON.stringify(t) === JSON.stringify(e) || (Ge.value.push(e), Ft.value = [], Ge.value.length > La && Ge.value.shift());
469
1946
  }
470
- function K() {
471
- const e = gt(), t = de.value[de.value.length - 1];
472
- t && JSON.stringify(t) === JSON.stringify(e) || (de.value.push(e), qe.value = [], de.value.length > En && de.value.shift());
1947
+ function Yo() {
1948
+ Ge.value.length && (Ft.value.push(so()), Uo(Ge.value.pop()), y(), ee(Z));
473
1949
  }
474
- function Sl() {
475
- de.value.length && (qe.value.push(gt()), Vt(de.value.pop()), g.value = null, v());
1950
+ function Ko() {
1951
+ Ft.value.length && (Ge.value.push(so()), Uo(Ft.value.pop()), y(), ee(Z));
476
1952
  }
477
- function kl() {
478
- qe.value.length && (de.value.push(gt()), Vt(qe.value.pop()), g.value = null, v());
1953
+ const Il = A(() => Ge.value.length > 0), Wl = A(() => Ft.value.length > 0), Nl = A(() => !!w.value), tt = D(null);
1954
+ function Gl() {
1955
+ var o;
1956
+ const e = w.value;
1957
+ if (!e)
1958
+ return;
1959
+ const t = {};
1960
+ for (let n = e.startCol; n <= e.endCol; n++)
1961
+ for (let l = e.startRow; l <= e.endRow; l++)
1962
+ t[`${n - e.startCol},${l - e.startRow}`] = ((o = p[C(n, l)]) == null ? void 0 : o.style) ?? null;
1963
+ tt.value = { styles: t };
1964
+ }
1965
+ function Pl() {
1966
+ var o;
1967
+ const e = tt.value, t = w.value;
1968
+ if (!(!e || !t)) {
1969
+ j();
1970
+ for (let n = t.startCol; n <= t.endCol; n++)
1971
+ for (let l = t.startRow; l <= t.endRow; l++) {
1972
+ const r = e.styles[`${n - t.startCol},${l - t.startRow}`] ?? null, d = C(n, l), m = ((o = p[d]) == null ? void 0 : o.value) ?? "";
1973
+ m === "" && r === null ? N(d) : p[d] = { value: m, style: r };
1974
+ }
1975
+ tt.value = null, y(), Z();
1976
+ }
479
1977
  }
480
- let Jt = null;
481
- function Ge() {
482
- const e = g.value;
1978
+ function Ul() {
1979
+ var t;
1980
+ const e = w.value;
1981
+ if (e) {
1982
+ j();
1983
+ for (let o = e.startCol; o <= e.endCol; o++)
1984
+ for (let n = e.startRow; n <= e.endRow; n++) {
1985
+ const l = C(o, n), r = ((t = p[l]) == null ? void 0 : t.value) ?? "";
1986
+ r === "" ? N(l) : p[l] = { value: r, style: null };
1987
+ }
1988
+ y(), Z();
1989
+ }
1990
+ }
1991
+ const Yl = A(
1992
+ () => Aa.map((e) => ({ ...e, label: e.value === "" ? B(s.value, "fontDefault") : e.label }))
1993
+ ), Kl = A(
1994
+ () => Ha.map((e) => ({ ...e, label: String(e.value) }))
1995
+ ), Vl = A(() => {
1996
+ var n;
1997
+ const e = w.value;
1998
+ if (!e)
1999
+ return "";
2000
+ let t, o = !1;
2001
+ for (let l = e.startCol; l <= e.endCol && !o; l++)
2002
+ for (let r = e.startRow; r <= e.endRow && !o; r++) {
2003
+ const d = (n = p[C(l, r)]) == null ? void 0 : n.style, m = typeof (d == null ? void 0 : d.fontFamily) == "string" ? d.fontFamily : "";
2004
+ t === void 0 ? t = m : m !== t && (o = !0);
2005
+ }
2006
+ return o ? Bi : t ?? "";
2007
+ }), Pe = A(() => {
2008
+ const e = w.value;
2009
+ if (!e)
2010
+ return st;
2011
+ let t, o = !1;
2012
+ for (let n = e.startCol; n <= e.endCol && !o; n++)
2013
+ for (let l = e.startRow; l <= e.endRow && !o; l++) {
2014
+ const r = _(n, l);
2015
+ t === void 0 ? t = r : r !== t && (o = !0);
2016
+ }
2017
+ return o ? 0 : t ?? st;
2018
+ });
2019
+ function me(e, t) {
2020
+ var n, l;
2021
+ const o = w.value;
2022
+ if (o) {
2023
+ j();
2024
+ for (let r = o.startCol; r <= o.endCol; r++)
2025
+ for (let d = o.startRow; d <= o.endRow; d++) {
2026
+ const m = C(r, d), k = ((n = p[m]) == null ? void 0 : n.value) ?? "", T = (l = p[m]) != null && l.style ? { ...p[m].style } : {};
2027
+ t === "" || t === null || t === void 0 || t === 0 ? delete T[e] : T[e] = t;
2028
+ const Oe = Object.keys(T).length ? T : null;
2029
+ k === "" && Oe === null ? N(m) : p[m] = { value: k, style: Oe };
2030
+ }
2031
+ y(), Z();
2032
+ }
2033
+ }
2034
+ function Xl(e) {
2035
+ me("fontFamily", e === "" ? "" : e);
2036
+ }
2037
+ function jl(e) {
2038
+ me("fontSize", e), ot.value = !1;
2039
+ }
2040
+ const _e = D(""), ot = D(!1);
2041
+ He(Pe, (e) => {
2042
+ _e.value = e === 0 ? "" : String(e);
2043
+ }, { immediate: !0 });
2044
+ function ql(e) {
2045
+ const t = e.target;
2046
+ _e.value = t.value.replace(/[^\d]/g, "");
2047
+ }
2048
+ function _l() {
2049
+ const e = _e.value.trim();
2050
+ if (!e) {
2051
+ _e.value = Pe.value === 0 ? "" : String(Pe.value);
2052
+ return;
2053
+ }
2054
+ let t = parseInt(e, 10);
2055
+ isNaN(t) && (t = st), t = Math.max(5, Math.min(72, t)), _e.value = String(t), t !== Pe.value && me("fontSize", t);
2056
+ }
2057
+ function Zl(e) {
2058
+ e.key === "Enter" && e.target.blur();
2059
+ }
2060
+ function Jl(e) {
2061
+ ot.value = !ot.value;
2062
+ }
2063
+ function Ql() {
2064
+ const e = Pe.value === 0 ? st : Pe.value, t = Math.min(72, e + 1);
2065
+ me("fontSize", t), _e.value = String(t), ot.value = !1;
2066
+ }
2067
+ function en() {
2068
+ const e = Pe.value === 0 ? st : Pe.value, t = Math.max(5, e - 1);
2069
+ me("fontSize", t), _e.value = String(t), ot.value = !1;
2070
+ }
2071
+ function It(e) {
2072
+ var l;
2073
+ const t = w.value;
2074
+ if (!t)
2075
+ return !1;
2076
+ let o, n = !1;
2077
+ for (let r = t.startCol; r <= t.endCol && !n; r++)
2078
+ for (let d = t.startRow; d <= t.endRow && !n; d++) {
2079
+ const m = (l = p[C(r, d)]) == null ? void 0 : l.style, k = !!(m != null && m[e]);
2080
+ o === void 0 ? o = k : k !== o && (n = !0);
2081
+ }
2082
+ return !n && o === !0;
2083
+ }
2084
+ const Vo = A(() => It("fontWeight")), Xo = A(() => It("fontStyle")), jo = A(() => It("underline")), qo = A(() => It("strikethrough"));
2085
+ function tn() {
2086
+ me("fontWeight", Vo.value ? "" : "bold");
2087
+ }
2088
+ function on() {
2089
+ me("fontStyle", Xo.value ? "" : "italic");
2090
+ }
2091
+ function ln() {
2092
+ me("underline", jo.value ? "" : "underline");
2093
+ }
2094
+ function nn() {
2095
+ me("strikethrough", qo.value ? "" : "line-through");
2096
+ }
2097
+ const Wt = D(""), Nt = D(""), uo = D(!1), co = D(!1);
2098
+ function an(e) {
2099
+ _o.value = e, e && (uo.value = !1, co.value = !1);
2100
+ }
2101
+ function rn(e) {
2102
+ Wt.value = e, me("color", e === "" ? "" : e);
2103
+ }
2104
+ function sn(e) {
2105
+ Nt.value = e, me("backgroundColor", e === "" ? "" : e);
2106
+ }
2107
+ function un() {
2108
+ me("color", Wt.value === "" ? "" : Wt.value);
2109
+ }
2110
+ function cn() {
2111
+ me("backgroundColor", Nt.value === "" ? "" : Nt.value);
2112
+ }
2113
+ const dn = A(() => {
2114
+ var n;
2115
+ const e = w.value;
2116
+ if (!e)
2117
+ return "";
2118
+ let t, o = !1;
2119
+ for (let l = e.startCol; l <= e.endCol && !o; l++)
2120
+ for (let r = e.startRow; r <= e.endRow && !o; r++) {
2121
+ const d = (n = p[C(l, r)]) == null ? void 0 : n.style, m = typeof (d == null ? void 0 : d.color) == "string" ? d.color : "";
2122
+ t === void 0 ? t = m : m !== t && (o = !0);
2123
+ }
2124
+ return o ? "" : t ?? "";
2125
+ }), fn = A(() => {
2126
+ var n;
2127
+ const e = w.value;
2128
+ if (!e)
2129
+ return "";
2130
+ let t, o = !1;
2131
+ for (let l = e.startCol; l <= e.endCol && !o; l++)
2132
+ for (let r = e.startRow; r <= e.endRow && !o; r++) {
2133
+ const d = (n = p[C(l, r)]) == null ? void 0 : n.style, m = typeof (d == null ? void 0 : d.backgroundColor) == "string" ? d.backgroundColor : "";
2134
+ t === void 0 ? t = m : m !== t && (o = !0);
2135
+ }
2136
+ return o ? "" : t ?? "";
2137
+ }), fo = D("none"), _o = D(!1);
2138
+ function vn(e, t, o, n) {
2139
+ const l = o === n.startRow, r = o === n.endRow, d = t === n.startCol, m = t === n.endCol, k = { top: 0, bottom: 0, left: 0, right: 0 };
2140
+ switch (e) {
2141
+ case "none":
2142
+ return k;
2143
+ case "bottom":
2144
+ r && (k.bottom = 1);
2145
+ break;
2146
+ case "top":
2147
+ l && (k.top = 1);
2148
+ break;
2149
+ case "left":
2150
+ d && (k.left = 1);
2151
+ break;
2152
+ case "right":
2153
+ m && (k.right = 1);
2154
+ break;
2155
+ case "all":
2156
+ k.top = 1, k.bottom = 1, k.left = 1, k.right = 1;
2157
+ break;
2158
+ case "outer":
2159
+ l && (k.top = 1), r && (k.bottom = 1), d && (k.left = 1), m && (k.right = 1);
2160
+ break;
2161
+ case "thickOuter":
2162
+ l && (k.top = 2), r && (k.bottom = 2), d && (k.left = 2), m && (k.right = 2);
2163
+ break;
2164
+ }
2165
+ return k;
2166
+ }
2167
+ function Zo(e) {
2168
+ fo.value = e;
2169
+ const t = w.value;
2170
+ if (t) {
2171
+ if (j(), e === "none")
2172
+ for (let o = t.startCol; o <= t.endCol; o++)
2173
+ for (let n = t.startRow; n <= t.endRow; n++)
2174
+ Jo(o, n, { top: 0, bottom: 0, left: 0, right: 0 }, !0);
2175
+ else
2176
+ for (let o = t.startCol; o <= t.endCol; o++)
2177
+ for (let n = t.startRow; n <= t.endRow; n++) {
2178
+ const l = vn(e, o, n, t);
2179
+ Jo(o, n, l, !1);
2180
+ }
2181
+ y(), Z();
2182
+ }
2183
+ }
2184
+ function Jo(e, t, o, n = !0) {
2185
+ var $e, rt;
2186
+ const l = C(e, t), r = (($e = p[l]) == null ? void 0 : $e.value) ?? "", d = (rt = p[l]) != null && rt.style ? { ...p[l].style } : {}, m = ["Top", "Bottom", "Left", "Right"], k = [o.top, o.bottom, o.left, o.right];
2187
+ for (let ve = 0; ve < 4; ve++) {
2188
+ const it = `border${m[ve]}Width`;
2189
+ k[ve] === 0 ? n && delete d[it] : (d[it] = k[ve], d.borderColor = $l);
2190
+ }
2191
+ m.some((ve) => d[`border${ve}Width`] !== void 0) || delete d.borderColor;
2192
+ const Oe = Object.keys(d).length ? d : null;
2193
+ r === "" && Oe === null ? N(l) : p[l] = { value: r, style: Oe };
2194
+ }
2195
+ function bn() {
2196
+ Zo(fo.value);
2197
+ }
2198
+ function Qo(e, t, o) {
2199
+ var l;
2200
+ const n = (l = p[C(e, t)]) == null ? void 0 : l.style;
2201
+ return (n == null ? void 0 : n[`border${o}Width`]) || 0;
2202
+ }
2203
+ let el = null;
2204
+ function Gt() {
2205
+ const e = w.value;
483
2206
  if (!e)
484
2207
  return;
485
- Jt = { ...e };
2208
+ el = { ...e };
486
2209
  const t = [];
487
- for (let n = e.startRow; n <= e.endRow; n++) {
488
- const l = [];
489
- for (let o = e.startCol; o <= e.endCol; o++)
490
- l.push(Re(o, n));
491
- t.push(l.join(" "));
2210
+ for (let o = e.startRow; o <= e.endRow; o++) {
2211
+ const n = [];
2212
+ for (let l = e.startCol; l <= e.endCol; l++)
2213
+ n.push(Q(l, o));
2214
+ t.push(n.join(" "));
492
2215
  }
493
- jt(t.join(`
2216
+ Wo(t.join(`
494
2217
  `));
495
2218
  }
496
- function Qe() {
497
- const e = g.value;
2219
+ function Pt() {
2220
+ const e = w.value;
498
2221
  if (e) {
499
- if (e.startCol === 0 && e.endCol === c - 1) {
2222
+ if (e.startCol === 0 && e.endCol === v - 1) {
500
2223
  const t = [];
501
- for (let n = e.startRow; n <= e.endRow; n++) {
502
- const l = [];
503
- for (let o = 0; o < c; o++)
504
- l.push(Re(o, n));
505
- t.push(l.join(" "));
2224
+ for (let o = e.startRow; o <= e.endRow; o++) {
2225
+ const n = [];
2226
+ for (let l = 0; l < v; l++)
2227
+ n.push(Q(l, o));
2228
+ t.push(n.join(" "));
506
2229
  }
507
- jt(t.join(`
2230
+ Wo(t.join(`
508
2231
  `));
509
- } else if (e.startRow === 0 && e.endRow === r - 1) {
2232
+ } else if (e.startRow === 0 && e.endRow === i - 1) {
510
2233
  const t = [];
511
- for (let n = 0; n < r; n++) {
512
- const l = [];
513
- for (let o = e.startCol; o <= e.endCol; o++)
514
- l.push(Re(o, n));
515
- t.push(l.join(" "));
2234
+ for (let o = 0; o < i; o++) {
2235
+ const n = [];
2236
+ for (let l = e.startCol; l <= e.endCol; l++)
2237
+ n.push(Q(l, o));
2238
+ t.push(n.join(" "));
516
2239
  }
517
- jt(t.join(`
2240
+ Wo(t.join(`
518
2241
  `));
519
2242
  }
520
2243
  }
521
2244
  }
522
- async function Ye() {
2245
+ async function Tt() {
523
2246
  let e = "";
524
2247
  try {
525
2248
  e = await navigator.clipboard.readText();
@@ -528,186 +2251,186 @@ const Un = { class: "tab-list" }, jn = ["onClick", "onDblclick", "onContextmenu"
528
2251
  }
529
2252
  if (!e && e !== "")
530
2253
  return;
531
- const t = e.split(/\r?\n/), n = h.value, l = Jt;
532
- for (let o = 0; o < t.length; o++) {
533
- const a = t[o].split(" ");
534
- for (let d = 0; d < a.length; d++) {
535
- const p = n.col + d, B = n.row + o;
536
- if (p < c && B < r) {
537
- let S = a[d];
538
- S.startsWith("=") && l && (S = On(
539
- S,
540
- p - (l.startCol + d),
541
- B - (l.startRow + o),
542
- c,
543
- r,
544
- ce
545
- )), Me(p, B, S);
2254
+ const t = e.split(/\r?\n/), o = g.value, n = el;
2255
+ for (let l = 0; l < t.length; l++) {
2256
+ const r = t[l].split(" ");
2257
+ for (let d = 0; d < r.length; d++) {
2258
+ const m = o.col + d, k = o.row + l;
2259
+ if (m < v && k < i) {
2260
+ let T = r[d];
2261
+ T.startsWith("=") && n && (T = oi(
2262
+ T,
2263
+ m - (n.startCol + d),
2264
+ k - (n.startRow + l),
2265
+ v,
2266
+ i,
2267
+ ze
2268
+ )), we(m, k, T);
546
2269
  }
547
2270
  }
548
2271
  }
549
2272
  }
550
- function wt() {
551
- if (Ge(), g.value) {
552
- const e = g.value;
553
- zt(e.startCol, e.endCol, e.startRow, e.endRow), v();
2273
+ function vo() {
2274
+ if (Gt(), w.value) {
2275
+ const e = w.value;
2276
+ Xe(e.startCol, e.endCol, e.startRow, e.endRow), y();
554
2277
  }
555
2278
  }
556
- function yt() {
557
- if (g.value) {
558
- const e = g.value;
559
- zt(e.startCol, e.endCol, e.startRow, e.endRow), v();
2279
+ function bo() {
2280
+ if (w.value) {
2281
+ const e = w.value;
2282
+ Xe(e.startCol, e.endCol, e.startRow, e.endRow), y();
560
2283
  }
561
2284
  }
562
- function Rl() {
563
- const e = g.value;
2285
+ function mn() {
2286
+ const e = w.value;
564
2287
  if (!e)
565
2288
  return;
566
- K();
567
- const t = e.startCol, n = e.startRow, l = e.endCol, o = e.endRow;
568
- if (n === o)
569
- if (l + 1 < c) {
570
- const a = `${ce(t)}${n + 1}:${ce(l)}${n + 1}`;
571
- Me(l + 1, n, `=SUM(${a})`);
2289
+ j();
2290
+ const t = e.startCol, o = e.startRow, n = e.endCol, l = e.endRow;
2291
+ if (o === l)
2292
+ if (n + 1 < v) {
2293
+ const r = `${ze(t)}${o + 1}:${ze(n)}${o + 1}`;
2294
+ we(n + 1, o, `=SUM(${r})`);
572
2295
  } else {
573
- const a = `${ce(t)}${n + 1}:${ce(l - 1)}${n + 1}`;
574
- Me(l, n, `=SUM(${a})`);
2296
+ const r = `${ze(t)}${o + 1}:${ze(n - 1)}${o + 1}`;
2297
+ we(n, o, `=SUM(${r})`);
575
2298
  }
576
2299
  else
577
- for (let a = t; a <= l; a++)
578
- if (o + 1 < r) {
579
- const d = `${ce(a)}${n + 1}:${ce(a)}${o + 1}`;
580
- Me(a, o + 1, `=SUM(${d})`);
2300
+ for (let r = t; r <= n; r++)
2301
+ if (l + 1 < i) {
2302
+ const d = `${ze(r)}${o + 1}:${ze(r)}${l + 1}`;
2303
+ we(r, l + 1, `=SUM(${d})`);
581
2304
  } else {
582
- const d = `${ce(a)}${n + 1}:${ce(a)}${o}`;
583
- Me(a, o, `=SUM(${d})`);
2305
+ const d = `${ze(r)}${o + 1}:${ze(r)}${l}`;
2306
+ we(r, l, `=SUM(${d})`);
584
2307
  }
585
- v(), A();
586
- }
587
- function Ml(e, t) {
588
- const n = t - e + 1;
589
- for (let l = e; l <= t; l++)
590
- for (let o = 0; o < c; o++)
591
- X(L(o, l));
592
- for (let l = e; l < r - n; l++) {
593
- for (let o = 0; o < c; o++) {
594
- const a = L(o, l + n), d = L(o, l);
595
- b[a] ? (b[d] = b[a], X(a)) : X(d);
2308
+ y(), Z();
2309
+ }
2310
+ function hn(e, t) {
2311
+ const o = t - e + 1;
2312
+ for (let n = e; n <= t; n++)
2313
+ for (let l = 0; l < v; l++)
2314
+ N(C(l, n));
2315
+ for (let n = e; n < i - o; n++) {
2316
+ for (let l = 0; l < v; l++) {
2317
+ const r = C(l, n + o), d = C(l, n);
2318
+ p[r] ? (p[d] = p[r], N(r)) : N(d);
596
2319
  }
597
- E.value[l] = E.value[l + n];
2320
+ X.value[n] = X.value[n + o];
598
2321
  }
599
- for (let l = r - n; l < r; l++) {
600
- for (let o = 0; o < c; o++)
601
- X(L(o, l));
602
- E.value[l] = Ze;
2322
+ for (let n = i - o; n < i; n++) {
2323
+ for (let l = 0; l < v; l++)
2324
+ N(C(l, n));
2325
+ X.value[n] = void 0;
603
2326
  }
604
2327
  }
605
- function Tl(e, t) {
606
- const n = t - e + 1;
607
- if (!(t >= r - 1)) {
608
- for (let l = r - 1; l > t; l--) {
609
- for (let o = 0; o < c; o++) {
610
- const a = L(o, l - n), d = L(o, l);
611
- b[a] ? b[d] = b[a] : X(d);
2328
+ function pn(e, t) {
2329
+ const o = t - e + 1;
2330
+ if (!(t >= i - 1)) {
2331
+ for (let n = i - 1; n > t; n--) {
2332
+ for (let l = 0; l < v; l++) {
2333
+ const r = C(l, n - o), d = C(l, n);
2334
+ p[r] ? p[d] = p[r] : N(d);
612
2335
  }
613
- E.value[l] = E.value[l - n];
2336
+ X.value[n] = X.value[n - o];
614
2337
  }
615
- for (let l = t + 1; l <= t + n; l++) {
616
- for (let o = 0; o < c; o++)
617
- X(L(o, l));
618
- E.value[l] = Ze;
2338
+ for (let n = t + 1; n <= t + o; n++) {
2339
+ for (let l = 0; l < v; l++)
2340
+ N(C(l, n));
2341
+ X.value[n] = void 0;
619
2342
  }
620
2343
  }
621
2344
  }
622
- function Dl(e, t) {
623
- const n = t - e + 1;
624
- if (!(t >= c - 1)) {
625
- for (let l = c - 1; l > t; l--) {
626
- for (let o = 0; o < r; o++) {
627
- const a = L(l - n, o), d = L(l, o);
628
- b[a] ? b[d] = b[a] : X(d);
2345
+ function gn(e, t) {
2346
+ const o = t - e + 1;
2347
+ if (!(t >= v - 1)) {
2348
+ for (let n = v - 1; n > t; n--) {
2349
+ for (let l = 0; l < i; l++) {
2350
+ const r = C(n - o, l), d = C(n, l);
2351
+ p[r] ? p[d] = p[r] : N(d);
629
2352
  }
630
- H.value[l] = H.value[l - n];
2353
+ z.value[n] = z.value[n - o];
631
2354
  }
632
- for (let l = t + 1; l <= t + n; l++) {
633
- for (let o = 0; o < r; o++)
634
- X(L(l, o));
635
- H.value[l] = Je;
2355
+ for (let n = t + 1; n <= t + o; n++) {
2356
+ for (let l = 0; l < i; l++)
2357
+ N(C(n, l));
2358
+ z.value[n] = Ct;
636
2359
  }
637
2360
  }
638
2361
  }
639
- function Hl(e, t) {
640
- const n = t - e + 1;
641
- for (let l = e; l <= t; l++)
642
- for (let o = 0; o < r; o++)
643
- X(L(l, o));
644
- for (let l = e; l < c - n; l++) {
645
- for (let o = 0; o < r; o++) {
646
- const a = L(l + n, o), d = L(l, o);
647
- b[a] ? (b[d] = b[a], X(a)) : X(d);
2362
+ function yn(e, t) {
2363
+ const o = t - e + 1;
2364
+ for (let n = e; n <= t; n++)
2365
+ for (let l = 0; l < i; l++)
2366
+ N(C(n, l));
2367
+ for (let n = e; n < v - o; n++) {
2368
+ for (let l = 0; l < i; l++) {
2369
+ const r = C(n + o, l), d = C(n, l);
2370
+ p[r] ? (p[d] = p[r], N(r)) : N(d);
648
2371
  }
649
- H.value[l] = H.value[l + n];
2372
+ z.value[n] = z.value[n + o];
650
2373
  }
651
- for (let l = c - n; l < c; l++) {
652
- for (let o = 0; o < r; o++)
653
- X(L(l, o));
654
- H.value[l] = Je;
2374
+ for (let n = v - o; n < v; n++) {
2375
+ for (let l = 0; l < i; l++)
2376
+ N(C(n, l));
2377
+ z.value[n] = Ct;
655
2378
  }
656
2379
  }
657
- let Zt = 0;
658
- function qt() {
659
- return Zt++, `s_${Zt}`;
2380
+ let tl = 0;
2381
+ function ol() {
2382
+ return tl++, `s_${tl}`;
660
2383
  }
661
- function et(e) {
2384
+ function Ut(e) {
662
2385
  return {
663
- id: qt(),
2386
+ id: ol(),
664
2387
  name: e,
665
2388
  cells: {},
666
2389
  selection: { startCol: 0, startRow: 0, endCol: 0, endRow: 0 },
667
2390
  activeCell: { col: 0, row: 0 },
668
2391
  scrollX: 0,
669
2392
  scrollY: 0,
670
- colWidths: new Array(c).fill(Je),
671
- rowHeights: new Array(r).fill(Ze)
2393
+ colWidths: new Array(v).fill(Ct),
2394
+ rowHeights: new Array(i).fill(void 0)
672
2395
  };
673
2396
  }
674
- const D = N([et("Sheet1")]), Z = N(0);
675
- function Ue() {
676
- const e = D.value[Z.value];
677
- e && (e.cells = { ...b }, e.selection = g.value ? { ...g.value } : null, e.activeCell = { ...h.value }, e.scrollX = M.value, e.scrollY = T.value, e.colWidths = [...H.value], e.rowHeights = [...E.value]);
2397
+ const q = D([Ut("Sheet1")]), he = D(0);
2398
+ function dt() {
2399
+ const e = q.value[he.value];
2400
+ e && (e.cells = { ...p }, e.selection = w.value ? { ...w.value } : null, e.activeCell = { ...g.value }, e.scrollX = M.value, e.scrollY = O.value, e.colWidths = [...z.value], e.rowHeights = [...X.value]);
678
2401
  }
679
- function ge(e) {
680
- const t = D.value[e];
681
- t && (Object.keys(b).forEach((n) => X(n)), Object.assign(b, t.cells), g.value = t.selection ? { ...t.selection } : null, h.value = { ...t.activeCell }, M.value = t.scrollX, T.value = t.scrollY, H.value = [...t.colWidths], E.value = [...t.rowHeights], Z.value = e);
2402
+ function Ze(e) {
2403
+ const t = q.value[e];
2404
+ t && (Object.keys(p).forEach((o) => N(o)), Object.assign(p, t.cells), w.value = t.selection ? { ...t.selection } : null, g.value = { ...t.activeCell }, M.value = t.scrollX, O.value = t.scrollY, z.value = [...t.colWidths], X.value = [...t.rowHeights], he.value = e);
682
2405
  }
683
- function _l(e) {
684
- e === Z.value || e < 0 || e >= D.value.length || (me(), Ue(), ge(e));
2406
+ function kn(e) {
2407
+ e === he.value || e < 0 || e >= q.value.length || (et(), dt(), Ze(e));
685
2408
  }
686
- function Bt(e) {
687
- return me(), Ue(), D.value.push(et(`Sheet${D.value.length + 1}`)), ge(D.value.length - 1), D.value.length - 1;
2409
+ function mo(e) {
2410
+ return j(), et(), dt(), q.value.push(Ut(`Sheet${q.value.length + 1}`)), Ze(q.value.length - 1), q.value.length - 1;
688
2411
  }
689
- function El(e) {
690
- return D.value.length <= 1 || (me(), D.value.splice(e, 1), ge(Math.min(e, D.value.length - 1))), Z.value;
2412
+ function wn(e) {
2413
+ return q.value.length <= 1 || (j(), et(), q.value.splice(e, 1), Ze(Math.min(e, q.value.length - 1))), he.value;
691
2414
  }
692
- function $l(e, t) {
693
- D.value[e] && t.trim() && (D.value[e].name = t.trim());
2415
+ function Cn(e, t) {
2416
+ q.value[e] && t.trim() && (j(), q.value[e].name = t.trim());
694
2417
  }
695
- function Il(e) {
696
- me(), Ue();
697
- const t = D.value[e];
2418
+ function Bn(e) {
2419
+ j(), et(), dt();
2420
+ const t = q.value[e];
698
2421
  if (!t)
699
2422
  return e;
700
- let n = t.name;
701
- const l = n.match(/^(.*?)\s*\((\d+)\)$/);
702
- let o = l ? parseInt(l[2], 10) + 1 : 2;
703
- l && (n = l[1]);
704
- let a = `${n} (${o})`;
705
- const d = new Set(D.value.map((B) => B.name));
706
- for (; d.has(a); )
707
- o++, a = `${n} (${o})`;
708
- const p = {
709
- id: qt(),
710
- name: a,
2423
+ let o = t.name;
2424
+ const n = o.match(/^(.*?)\s*\((\d+)\)$/);
2425
+ let l = n ? parseInt(n[2], 10) + 1 : 2;
2426
+ n && (o = n[1]);
2427
+ let r = `${o} (${l})`;
2428
+ const d = new Set(q.value.map((k) => k.name));
2429
+ for (; d.has(r); )
2430
+ l++, r = `${o} (${l})`;
2431
+ const m = {
2432
+ id: ol(),
2433
+ name: r,
711
2434
  cells: { ...t.cells },
712
2435
  selection: t.selection ? { ...t.selection } : null,
713
2436
  activeCell: t.activeCell ? { ...t.activeCell } : { col: 0, row: 0 },
@@ -716,917 +2439,1141 @@ const Un = { class: "tab-list" }, jn = ["onClick", "onDblclick", "onContextmenu"
716
2439
  colWidths: [...t.colWidths],
717
2440
  rowHeights: [...t.rowHeights]
718
2441
  };
719
- return D.value.splice(e + 1, 0, p), ge(e + 1), e + 1;
2442
+ return q.value.splice(e + 1, 0, m), Ze(e + 1), e + 1;
720
2443
  }
721
- function Gt(e, t) {
722
- const n = e + t;
723
- if (n < 0 || n >= D.value.length)
2444
+ function ll(e, t) {
2445
+ const o = e + t;
2446
+ if (o < 0 || o >= q.value.length)
724
2447
  return;
725
- const l = Z.value, o = D.value.splice(e, 1)[0];
726
- D.value.splice(n, 0, o), l === e ? Z.value = n : e < l && n >= l ? Z.value = l - 1 : e > l && n <= l && (Z.value = l + 1), v();
727
- }
728
- const Wl = I(() => D.value.length);
729
- function A() {
730
- Ue();
731
- const e = D.value.map((n) => {
732
- const l = {};
733
- for (const [p, B] of Object.entries(n.cells))
734
- l[p] = { value: B.value }, B.style && (l[p].style = B.style);
735
- const o = { name: n.name, cells: l }, a = {};
736
- for (let p = 0; p < n.colWidths.length; p++)
737
- n.colWidths[p] !== 100 && (a[p] = n.colWidths[p]);
738
- Object.keys(a).length && (o.colWidths = a);
2448
+ j();
2449
+ const n = he.value, l = q.value.splice(e, 1)[0];
2450
+ q.value.splice(o, 0, l), n === e ? he.value = o : e < n && o >= n ? he.value = n - 1 : e > n && o <= n && (he.value = n + 1), y();
2451
+ }
2452
+ const xn = A(() => q.value.length);
2453
+ function Z() {
2454
+ dt();
2455
+ const e = q.value.map((o) => {
2456
+ const n = {};
2457
+ for (const [m, k] of Object.entries(o.cells))
2458
+ n[m] = { value: k.value }, k.style && (n[m].style = k.style);
2459
+ const l = { name: o.name, cells: n }, r = {};
2460
+ for (let m = 0; m < o.colWidths.length; m++)
2461
+ o.colWidths[m] !== 100 && (r[m] = o.colWidths[m]);
2462
+ Object.keys(r).length && (l.colWidths = r);
739
2463
  const d = {};
740
- for (let p = 0; p < n.rowHeights.length; p++)
741
- n.rowHeights[p] !== 24 && (d[p] = n.rowHeights[p]);
742
- return Object.keys(d).length && (o.rowHeights = d), o;
2464
+ for (let m = 0; m < o.rowHeights.length; m++) {
2465
+ const k = o.rowHeights[m];
2466
+ k != null && (d[m] = k);
2467
+ }
2468
+ return Object.keys(d).length && (l.rowHeights = d), l;
743
2469
  }), t = JSON.stringify(e);
744
- t !== k && (k = t, m.value = e);
2470
+ t !== F && (F = t, x.value = e);
745
2471
  }
746
- let xt = !1;
747
- function Qt() {
748
- xt || (xt = !0, Promise.resolve().then(() => {
749
- xt = !1, A();
2472
+ let ho = !1;
2473
+ function nl() {
2474
+ ho || (ho = !0, Promise.resolve().then(() => {
2475
+ ho = !1, Z();
750
2476
  }));
751
2477
  }
752
- const el = I(() => f.theme === "dark" ? Wn : In), Al = I(() => Yn(el.value, f.width, f.height, Se)), we = N(null), oe = N(null), Ct = N(null), St = N(null), U = wl({ w: 800, h: 600 }), Te = I(() => Math.max(0, pt.value - Math.max(0, U.w - w - Q))), De = I(() => Math.max(0, bt.value - Math.max(0, U.h - y - Q)));
753
- function z(e, t) {
754
- const n = Math.max(0, U.w - w - Q), l = Math.max(0, U.h - y - Q);
755
- M.value = Math.max(0, Math.min(e ?? M.value, Math.max(0, pt.value - n))), T.value = Math.max(0, Math.min(t ?? T.value, Math.max(0, bt.value - l)));
2478
+ const al = A(() => h.theme === "dark" ? Wa : Ia), Sn = A(() => ni(al.value, h.width, h.height, ut)), lt = D(null), Fe = D(null), po = D(null), go = D(null), se = Fl({ w: 800, h: 600 }), ft = A(() => Math.max(0, We.value - Math.max(0, se.w - I - Se))), vt = A(() => Math.max(0, Je.value - Math.max(0, se.h - W - Se)));
2479
+ function fe(e, t) {
2480
+ const o = Math.max(0, se.w - I - Se), n = Math.max(0, se.h - W - Se);
2481
+ M.value = Math.max(0, Math.min(e ?? M.value, Math.max(0, We.value - o))), O.value = Math.max(0, Math.min(t ?? O.value, Math.max(0, Je.value - n)));
756
2482
  }
757
- function Nl() {
2483
+ function Mn() {
758
2484
  var e;
759
2485
  return typeof window > "u" ? !1 : !((e = window.matchMedia) != null && e.call(window, "(hover: none) and (pointer: coarse)").matches);
760
2486
  }
761
- function V(e = !1) {
762
- J(() => {
763
- const t = Ct.value;
2487
+ function pe(e = !1) {
2488
+ ee(() => {
2489
+ const t = po.value;
764
2490
  if (t) {
765
- if (!R.value && !Nl()) {
2491
+ if (!E.value && !Mn()) {
766
2492
  document.activeElement === t && t.blur();
767
2493
  return;
768
2494
  }
769
- t.focus(), e && t.select();
2495
+ t.focus({ preventScroll: !0 }), e && t.select();
770
2496
  }
771
2497
  });
772
2498
  }
773
- function Ll() {
774
- V();
2499
+ function Rn() {
2500
+ pe();
775
2501
  }
776
- let kt = !1, i = null, je = 1;
777
- function v() {
778
- kt || (kt = !0, requestAnimationFrame(() => {
779
- kt = !1, Fl();
2502
+ let yo = !1, f = null, Et = 1;
2503
+ function y() {
2504
+ yo || (yo = !0, requestAnimationFrame(() => {
2505
+ yo = !1, Dn();
780
2506
  }));
781
2507
  }
782
- function Fl() {
783
- const e = oe.value;
2508
+ function Dn() {
2509
+ var Bl, xl, Sl;
2510
+ const e = Fe.value;
784
2511
  if (!e)
785
2512
  return;
786
- const t = we.value;
787
- if (!t || (i = e.getContext("2d"), !i))
2513
+ const t = lt.value;
2514
+ if (!t || (f = e.getContext("2d"), !f))
788
2515
  return;
789
- je = window.devicePixelRatio || 1;
790
- const n = t.getBoundingClientRect(), l = n.width, o = n.height;
791
- U.w = l, U.h = o, e.width = l * je, e.height = o * je, e.style.width = l + "px", e.style.height = o + "px", i.setTransform(je, 0, 0, je, 0, 0);
792
- const a = M.value, d = T.value, p = w, B = y, S = el.value, Ft = he.value, Ot = pe.value, vl = H.value, dl = E.value, it = Math.max(0, le(a));
793
- let hl = it;
794
- for (let x = it; x < c && !(p + Ft[x] - a >= l); x++)
795
- hl = x;
796
- const pl = hl, ft = Math.max(0, ne(d));
797
- let bl = ft;
798
- for (let x = ft; x < r && !(B + Ot[x] - d >= o); x++)
799
- bl = x;
800
- const ml = bl;
801
- i.fillStyle = S.bg, i.fillRect(0, 0, l, o), i.fillStyle = S.gridBg, i.fillRect(p, B, l - p, o - B), i.save(), i.beginPath(), i.rect(p + 0.5, B + 0.5, l - p - 1, o - B - 1), i.clip();
802
- const G = g.value, Xt = R.value;
803
- for (let x = ft; x <= ml; x++)
804
- for (let _ = it; _ <= pl; _++) {
805
- const F = p + Ft[_] - a, xe = B + Ot[x] - d, ze = vl[_], Le = dl[x];
806
- if (!(F + ze < p || xe + Le < B || F > l || xe > o) && (Pt(_, x) && (i.fillStyle = S.selectionBg, i.fillRect(F, xe, ze, Le)), h.value.col === _ && h.value.row === x && (i.strokeStyle = S.activeCellBorder, i.lineWidth = 2, i.strokeRect(F + 1, xe + 1, ze - 2, Le - 2)), i.strokeStyle = S.gridLine, i.lineWidth = 0.5, i.strokeRect(F + 0.25, xe + 0.25, ze - 0.5, Le - 0.5), !(Xt && Xt.col === _ && Xt.row === x))) {
807
- const gl = Cl(_, x);
808
- gl && (i.fillStyle = S.cellText, i.font = '13px -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif', i.textBaseline = "middle", i.save(), i.beginPath(), i.rect(F + 5, xe + 1, ze - 10, Le - 2), i.clip(), i.fillText(gl, F + 5, xe + Le / 2 + 0.5), i.restore());
2516
+ Et = window.devicePixelRatio || 1;
2517
+ const o = t.getBoundingClientRect(), n = o.width, l = o.height;
2518
+ se.w = n, se.h = l, e.width = n * Et, e.height = l * Et, e.style.width = n + "px", e.style.height = l + "px", f.setTransform(Et, 0, 0, Et, 0, 0);
2519
+ const r = M.value, d = O.value, m = I, k = W, T = al.value, Oe = ce.value, $e = de.value, rt = z.value, ve = [];
2520
+ for (let R = 0; R < i; R++)
2521
+ ve[R] = $e[R + 1] - $e[R];
2522
+ const it = Math.max(0, Re(r));
2523
+ let wl = it;
2524
+ for (let R = it; R < v && !(m + Oe[R] - r >= n); R++)
2525
+ wl = R;
2526
+ const Lo = wl, Qt = Math.max(0, De(d));
2527
+ let Cl = Qt;
2528
+ for (let R = Qt; R < i && !(k + $e[R] - d >= l); R++)
2529
+ Cl = R;
2530
+ const $o = Cl;
2531
+ f.fillStyle = T.bg, f.fillRect(0, 0, n, l), f.fillStyle = T.gridBg, f.fillRect(m, k, n - m, l - k), f.save(), f.beginPath(), f.rect(m + 0.5, k + 0.5, n - m - 1, l - k - 1), f.clip();
2532
+ const Be = w.value, Ao = E.value;
2533
+ for (let R = Qt; R <= $o; R++)
2534
+ for (let K = it; K <= Lo; K++) {
2535
+ const J = m + Oe[K] - r, be = k + $e[R] - d, Ye = rt[K], Ae = ve[R];
2536
+ if (J + Ye < m || be + Ae < k || J > n || be > l)
2537
+ continue;
2538
+ b(K, R) && (f.fillStyle = T.selectionBg, f.fillRect(J, be, Ye, Ae)), g.value.col === K && g.value.row === R && (f.strokeStyle = T.activeCellBorder, f.lineWidth = 2, f.strokeRect(J + 1, be + 1, Ye - 2, Ae - 2)), f.strokeStyle = T.gridLine, f.lineWidth = 0.5, f.strokeRect(J + 0.25, be + 0.25, Ye - 0.5, Ae - 0.5);
2539
+ const eo = (Bl = p[C(K, R)]) == null ? void 0 : Bl.style, Ml = typeof (eo == null ? void 0 : eo.backgroundColor) == "string" ? eo.backgroundColor : "";
2540
+ if (Ml && (f.fillStyle = Ml, f.fillRect(J, be, Ye, Ae)), !(Ao && Ao.col === K && Ao.row === R)) {
2541
+ const ue = Qe(K, R);
2542
+ if (ue) {
2543
+ const te = (xl = p[C(K, R)]) == null ? void 0 : xl.style, Rl = Y(_(K, R)), ya = typeof (te == null ? void 0 : te.fontFamily) == "string" && te.fontFamily ? te.fontFamily : El, ka = (te == null ? void 0 : te.fontWeight) === "bold" ? "bold" : "normal", wa = (te == null ? void 0 : te.fontStyle) === "italic" ? "italic" : "normal", Ca = (te == null ? void 0 : te.underline) === "underline", Ba = (te == null ? void 0 : te.strikethrough) === "line-through", Ho = typeof (te == null ? void 0 : te.color) == "string" ? te.color : "";
2544
+ f.fillStyle = Ho || T.cellText, f.font = `${wa} ${ka} ${Rl}px ${ya}`, f.textBaseline = "alphabetic", f.save(), f.beginPath(), f.rect(J + 5, be + 1, Ye - 10, Ae - 2), f.clip();
2545
+ const Ke = f.measureText(ue), xa = (Ke.actualBoundingBoxAscent - Ke.actualBoundingBoxDescent) / 2, $t = J + 5, ao = be + Ae / 2 + xa;
2546
+ if (f.fillText(ue, $t, ao), Ca) {
2547
+ const At = Ke.actualBoundingBoxLeft ?? 0, ro = Ke.actualBoundingBoxDescent ?? 0;
2548
+ f.strokeStyle = Ho || T.cellText, f.lineWidth = 1, f.beginPath(), f.moveTo($t + At, ao + ro + 1), f.lineTo($t + At + Ke.width, ao + ro + 1), f.stroke();
2549
+ }
2550
+ if (Ba) {
2551
+ const At = Ke.actualBoundingBoxLeft ?? 0, ro = Ke.actualBoundingBoxDescent ?? 0, Sa = Ke.actualBoundingBoxAscent ?? Rl;
2552
+ f.strokeStyle = Ho || T.cellText, f.lineWidth = 1;
2553
+ const Dl = ao - (Sa - ro) * 0.25;
2554
+ f.beginPath(), f.moveTo($t + At, Dl), f.lineTo($t + At + Ke.width, Dl), f.stroke();
2555
+ }
2556
+ f.restore();
2557
+ }
2558
+ }
2559
+ const xe = (Sl = p[C(K, R)]) == null ? void 0 : Sl.style, pa = (xe == null ? void 0 : xe.borderTopWidth) || 0, ga = (xe == null ? void 0 : xe.borderLeftWidth) || 0, to = (xe == null ? void 0 : xe.borderBottomWidth) || 0, oo = (xe == null ? void 0 : xe.borderRightWidth) || 0, lo = Math.max(pa, Qo(K, R - 1, "Bottom")), no = Math.max(ga, Qo(K - 1, R, "Right"));
2560
+ if (lo > 0 || no > 0 || to > 0 || oo > 0) {
2561
+ if (f.strokeStyle = $l, lo > 0) {
2562
+ f.lineWidth = lo, f.beginPath();
2563
+ const ue = be + lo / 2 - 0.5;
2564
+ f.moveTo(J, ue), f.lineTo(J + Ye, ue), f.stroke();
2565
+ }
2566
+ if (no > 0) {
2567
+ f.lineWidth = no, f.beginPath();
2568
+ const ue = J + no / 2 - 0.5;
2569
+ f.moveTo(ue, be), f.lineTo(ue, be + Ae), f.stroke();
2570
+ }
2571
+ if (R === $o && to > 0) {
2572
+ f.lineWidth = to, f.beginPath();
2573
+ const ue = be + Ae - to / 2 + 0.5;
2574
+ f.moveTo(J, ue), f.lineTo(J + Ye, ue), f.stroke();
2575
+ }
2576
+ if (K === Lo && oo > 0) {
2577
+ f.lineWidth = oo, f.beginPath();
2578
+ const ue = J + Ye - oo / 2 + 0.5;
2579
+ f.moveTo(ue, be), f.lineTo(ue, be + Ae), f.stroke();
2580
+ }
809
2581
  }
810
2582
  }
811
- i.restore(), i.fillStyle = S.headerBg, i.fillRect(p, 0, l - p, B);
812
- for (let x = it; x <= pl; x++) {
813
- const _ = p + Ft[x] - a, F = vl[x];
814
- _ + F < p || _ > l || (G && x >= G.startCol && x <= G.endCol && (i.fillStyle = S.selectionBg, i.fillRect(_, 0, F, B)), i.strokeStyle = S.headerBorder, i.lineWidth = 0.5, i.strokeRect(_ + 0.25, 0.25, F - 0.5, B - 0.5), G && x >= G.startCol && x <= G.endCol && (i.strokeStyle = S.activeCellBorder, i.lineWidth = 2, i.beginPath(), i.moveTo(_, B - 1), i.lineTo(_ + F, B - 1), i.stroke()), i.fillStyle = S.headerText, i.font = '11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', i.textAlign = "center", i.textBaseline = "middle", i.fillText(ce(x), _ + F / 2, B / 2));
2583
+ f.restore(), f.fillStyle = T.headerBg, f.fillRect(m, 0, n - m, k);
2584
+ for (let R = it; R <= Lo; R++) {
2585
+ const K = m + Oe[R] - r, J = rt[R];
2586
+ K + J < m || K > n || (Be && R >= Be.startCol && R <= Be.endCol && (f.fillStyle = T.selectionBg, f.fillRect(K, 0, J, k)), f.strokeStyle = T.headerBorder, f.lineWidth = 0.5, f.strokeRect(K + 0.25, 0.25, J - 0.5, k - 0.5), Be && R >= Be.startCol && R <= Be.endCol && (f.strokeStyle = T.activeCellBorder, f.lineWidth = 2, f.beginPath(), f.moveTo(K, k - 1), f.lineTo(K + J, k - 1), f.stroke()), f.fillStyle = T.headerText, f.font = '11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', f.textAlign = "center", f.textBaseline = "middle", f.fillText(ze(R), K + J / 2, k / 2));
815
2587
  }
816
- i.strokeStyle = S.headerSep, i.lineWidth = 1, i.beginPath(), i.moveTo(p, B + 0.5), i.lineTo(l, B + 0.5), i.stroke(), i.fillStyle = S.headerBg, i.fillRect(0, B, p, o - B);
817
- for (let x = ft; x <= ml; x++) {
818
- const _ = B + Ot[x] - d, F = dl[x];
819
- _ + F < B || _ > o || (G && x >= G.startRow && x <= G.endRow && (i.fillStyle = S.selectionBg, i.fillRect(0, _, p, F)), i.strokeStyle = S.headerBorder, i.lineWidth = 0.5, i.strokeRect(0.25, _ + 0.25, p - 0.5, F - 0.5), G && x >= G.startRow && x <= G.endRow && (i.strokeStyle = S.activeCellBorder, i.lineWidth = 2, i.beginPath(), i.moveTo(p - 1, _), i.lineTo(p - 1, _ + F), i.stroke()), i.fillStyle = S.headerText, i.font = '11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', i.textAlign = "center", i.textBaseline = "middle", i.fillText(String(x + 1), p / 2, _ + F / 2 + 0.5));
2588
+ f.strokeStyle = T.headerSep, f.lineWidth = 1, f.beginPath(), f.moveTo(m, k + 0.5), f.lineTo(n, k + 0.5), f.stroke(), f.fillStyle = T.headerBg, f.fillRect(0, k, m, l - k);
2589
+ for (let R = Qt; R <= $o; R++) {
2590
+ const K = k + $e[R] - d, J = ve[R];
2591
+ K + J < k || K > l || (Be && R >= Be.startRow && R <= Be.endRow && (f.fillStyle = T.selectionBg, f.fillRect(0, K, m, J)), f.strokeStyle = T.headerBorder, f.lineWidth = 0.5, f.strokeRect(0.25, K + 0.25, m - 0.5, J - 0.5), Be && R >= Be.startRow && R <= Be.endRow && (f.strokeStyle = T.activeCellBorder, f.lineWidth = 2, f.beginPath(), f.moveTo(m - 1, K), f.lineTo(m - 1, K + J), f.stroke()), f.fillStyle = T.headerText, f.font = '11px -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif', f.textAlign = "center", f.textBaseline = "middle", f.fillText(String(R + 1), m / 2, K + J / 2 + 0.5));
820
2592
  }
821
- i.strokeStyle = S.headerSep, i.lineWidth = 1, i.beginPath(), i.moveTo(p + 0.5, B), i.lineTo(p + 0.5, o), i.stroke(), i.fillStyle = S.headerBg, i.fillRect(0, 0, p, B), i.strokeStyle = S.headerSep, i.lineWidth = 1, i.strokeRect(0.5, 0.5, p - 0.5, B - 0.5);
2593
+ f.strokeStyle = T.headerSep, f.lineWidth = 1, f.beginPath(), f.moveTo(m + 0.5, k), f.lineTo(m + 0.5, l), f.stroke(), f.fillStyle = T.headerBg, f.fillRect(0, 0, m, k), f.strokeStyle = T.headerSep, f.lineWidth = 1, f.strokeRect(0.5, 0.5, m - 0.5, k - 0.5);
822
2594
  }
823
- const Ol = I(() => ce(h.value.col) + String(h.value.row + 1)), Xl = I(() => R.value ? O.value : Re(h.value.col, h.value.row));
824
- function Yl() {
825
- R.value || (W(h.value.col, h.value.row), O.value = Re(h.value.col, h.value.row), ve(), v());
2595
+ const Fn = A(() => ze(g.value.col) + String(g.value.row + 1)), Tn = A(() => E.value ? V.value : Q(g.value.col, g.value.row));
2596
+ function En() {
2597
+ E.value || (le(g.value.col, g.value.row), V.value = Q(g.value.col, g.value.row), je(), y());
826
2598
  }
827
- function Ul(e) {
828
- O.value = e.target.value;
2599
+ function On(e) {
2600
+ V.value = e.target.value;
829
2601
  }
830
- function jl(e) {
831
- var t, n;
832
- e.key === "Enter" ? (e.preventDefault(), be(), ie(0, 1), W(h.value.col, h.value.row), (t = St.value) == null || t.blur(), v(), V()) : e.key === "Escape" && (e.preventDefault(), me(), (n = St.value) == null || n.blur(), v(), V());
2602
+ function zn(e) {
2603
+ var t, o;
2604
+ e.key === "Enter" ? (e.preventDefault(), qe(), Ne(0, 1), le(g.value.col, g.value.row), (t = go.value) == null || t.blur(), y(), pe()) : e.key === "Escape" && (e.preventDefault(), et(), (o = go.value) == null || o.blur(), y(), pe());
833
2605
  }
834
- function Kl() {
2606
+ function Ln() {
835
2607
  setTimeout(() => {
836
- R.value && (be(), v());
2608
+ E.value && (qe(), y());
837
2609
  }, 0);
838
2610
  }
839
- const ye = N(null), He = N("");
840
- function Pl(e) {
841
- ye.value === null && (_l(e), v());
2611
+ const nt = D(null), bt = D("");
2612
+ function $n(e) {
2613
+ nt.value === null && (kn(e), y());
842
2614
  }
843
- function tl(e) {
844
- e !== Z.value && (Ue(), ge(e), v()), ye.value = e, He.value = D.value[e].name, J(() => {
2615
+ function rl(e) {
2616
+ e !== he.value && (dt(), Ze(e), y()), nt.value = e, bt.value = q.value[e].name, ee(() => {
845
2617
  const t = document.querySelector(".tab-rename-input");
846
2618
  t == null || t.focus(), t == null || t.select();
847
2619
  });
848
2620
  }
849
- function ll() {
850
- ye.value !== null && ($l(ye.value, He.value), J(A)), ye.value = null, He.value = "";
2621
+ function il() {
2622
+ nt.value !== null && (Cn(nt.value, bt.value), ee(Z)), nt.value = null, bt.value = "";
851
2623
  }
852
- function zl() {
853
- ye.value = null, He.value = "";
2624
+ function An() {
2625
+ nt.value = null, bt.value = "";
854
2626
  }
855
- function Vl(e) {
856
- e.key === "Enter" ? (e.preventDefault(), ll()) : e.key === "Escape" && (e.preventDefault(), zl());
2627
+ function Hn(e) {
2628
+ e.key === "Enter" ? (e.preventDefault(), il()) : e.key === "Escape" && (e.preventDefault(), An());
857
2629
  }
858
- const fe = N(null);
859
- let Ke = null;
860
- function nl() {
861
- Ke && (document.removeEventListener("click", Ke), Ke = null);
2630
+ const Ue = D(null);
2631
+ let Ot = null;
2632
+ function sl() {
2633
+ Ot && (document.removeEventListener("click", Ot), Ot = null);
862
2634
  }
863
- function _e(e, t, n) {
864
- nl();
865
- const l = 140, o = n.length * 28 + 8, a = window.innerWidth, d = window.innerHeight;
866
- e + l > a && (e -= l), t + o > d && (t -= o), fe.value = { x: e, y: t, items: n }, Ke = () => {
867
- fe.value = null, nl();
868
- }, setTimeout(() => document.addEventListener("click", Ke, { once: !0 }), 0);
2635
+ function mt(e, t, o) {
2636
+ sl();
2637
+ const n = 140, l = o.length * 28 + 8, r = window.innerWidth, d = window.innerHeight;
2638
+ e + n > r && (e -= n), t + l > d && (t -= l), Ue.value = { x: e, y: t, items: o }, Ot = () => {
2639
+ Ue.value = null, sl();
2640
+ }, setTimeout(() => document.addEventListener("click", Ot, { once: !0 }), 0);
869
2641
  }
870
- const tt = N(!1);
871
- function Jl(e, t) {
2642
+ const Yt = D(!1);
2643
+ function In(e, t) {
872
2644
  if (!t.children) {
873
- tt.value = !1;
2645
+ Yt.value = !1;
874
2646
  return;
875
2647
  }
876
- const l = e.currentTarget.querySelector(".context-submenu");
877
- if (!l) {
878
- tt.value = !1;
2648
+ const n = e.currentTarget.querySelector(".context-submenu");
2649
+ if (!n) {
2650
+ Yt.value = !1;
879
2651
  return;
880
2652
  }
881
- const o = l.getBoundingClientRect();
882
- tt.value = o.right > window.innerWidth;
2653
+ const l = n.getBoundingClientRect();
2654
+ Yt.value = l.right > window.innerWidth;
883
2655
  }
884
- function Zl(e, t) {
885
- e.preventDefault(), e.stopPropagation(), _e(e.clientX, e.clientY, [
2656
+ function Wn(e, t) {
2657
+ e.preventDefault(), e.stopPropagation(), mt(e.clientX, e.clientY, [
886
2658
  {
887
- label: C(s.value, "insert"),
2659
+ label: B(s.value, "insert"),
888
2660
  action: () => {
889
- Bt(), v();
2661
+ mo(), y();
890
2662
  }
891
2663
  },
892
- { label: C(s.value, "copy"), action: () => {
893
- Il(t);
2664
+ { label: B(s.value, "copy"), action: () => {
2665
+ Bn(t);
894
2666
  } },
895
- { label: C(s.value, "rename"), action: () => {
896
- tl(t);
2667
+ { label: B(s.value, "rename"), action: () => {
2668
+ rl(t);
897
2669
  } },
898
2670
  {
899
- label: C(s.value, "delete"),
2671
+ label: B(s.value, "delete"),
900
2672
  action: () => {
901
- El(t), v();
2673
+ wn(t), y();
902
2674
  },
903
- disabled: Wl.value <= 1
2675
+ disabled: xn.value <= 1
904
2676
  },
905
- { label: C(s.value, "moveSheetLeft"), action: () => {
906
- Gt(t, -1);
2677
+ { label: B(s.value, "moveSheetLeft"), action: () => {
2678
+ ll(t, -1);
907
2679
  }, disabled: t === 0 },
908
- { label: C(s.value, "moveSheetRight"), action: () => {
909
- Gt(t, 1);
910
- }, disabled: t === D.value.length - 1 }
2680
+ { label: B(s.value, "moveSheetRight"), action: () => {
2681
+ ll(t, 1);
2682
+ }, disabled: t === q.value.length - 1 }
911
2683
  ]);
912
2684
  }
913
- function ql(e) {
914
- e.preventDefault(), !(e.target.closest(".tab-item") || e.target.closest(".tab-bar__add-btn")) && _e(e.clientX, e.clientY, [
2685
+ function Nn(e) {
2686
+ e.preventDefault(), !(e.target.closest(".tab-item") || e.target.closest(".tab-bar__add-btn")) && mt(e.clientX, e.clientY, [
915
2687
  {
916
- label: C(s.value, "insert"),
2688
+ label: B(s.value, "insert"),
917
2689
  action: () => {
918
- Bt(), v();
2690
+ mo(), y();
919
2691
  }
920
2692
  }
921
2693
  ]);
922
2694
  }
923
- function Gl(e) {
924
- e.preventDefault(), mt(), v(), _e(e.clientX, e.clientY, [
2695
+ function Gn(e) {
2696
+ e.preventDefault(), u(), y(), mt(e.clientX, e.clientY, [
925
2697
  {
926
- label: C(s.value, "cut"),
2698
+ label: B(s.value, "cut"),
927
2699
  action: () => {
928
- wt(), A();
2700
+ vo(), Z();
929
2701
  }
930
2702
  },
931
- { label: C(s.value, "copy"), action: () => Ge() },
2703
+ { label: B(s.value, "copy"), action: () => Gt() },
932
2704
  {
933
- label: C(s.value, "paste"),
2705
+ label: B(s.value, "paste"),
934
2706
  action: () => {
935
- K(), Ye().then(() => {
936
- v(), J(A);
2707
+ j(), Tt().then(() => {
2708
+ y(), ee(Z);
937
2709
  });
938
2710
  }
939
2711
  },
940
- { label: C(s.value, "delete"), action: () => {
941
- K(), yt();
942
- for (let t = 0; t < c; t++)
943
- H.value[t] = Je;
944
- for (let t = 0; t < r; t++)
945
- E.value[t] = Ze;
946
- v(), A();
2712
+ { label: B(s.value, "delete"), action: () => {
2713
+ j(), bo();
2714
+ for (let t = 0; t < v; t++)
2715
+ z.value[t] = Ct;
2716
+ for (let t = 0; t < i; t++)
2717
+ X.value[t] = void 0;
2718
+ y(), Z();
947
2719
  } }
948
2720
  ]);
949
2721
  }
950
- function Ql(e, t) {
2722
+ function Pn(e, t) {
951
2723
  e.preventDefault();
952
- const n = g.value;
953
- n && n.startCol === 0 && n.endCol === c - 1 && t >= n.startRow && t <= n.endRow || (te(0, t, c - 1, t), v());
954
- const l = g.value;
955
- _e(e.clientX, e.clientY, [
2724
+ const o = e.clientX, n = e.clientY, l = w.value;
2725
+ l && l.startCol === 0 && l.endCol === v - 1 && t >= l.startRow && t <= l.endRow || (U(0, t, v - 1, t), y());
2726
+ const r = w.value;
2727
+ mt(e.clientX, e.clientY, [
956
2728
  {
957
- label: C(s.value, "insert"),
2729
+ label: B(s.value, "insert"),
958
2730
  action: () => {
959
- K(), Tl(l.startRow, l.endRow), v(), A();
2731
+ j(), pn(r.startRow, r.endRow), y(), Z();
960
2732
  },
961
- disabled: l.endRow >= r - 1
2733
+ disabled: r.endRow >= i - 1
962
2734
  },
963
- { label: C(s.value, "cut"), action: () => {
964
- K(), Qe();
965
- for (let o = l.startRow; o <= l.endRow; o++)
966
- for (let a = 0; a < c; a++)
967
- X(L(a, o));
968
- v(), A();
2735
+ { label: B(s.value, "cut"), action: () => {
2736
+ j(), Pt();
2737
+ for (let d = r.startRow; d <= r.endRow; d++)
2738
+ for (let m = 0; m < v; m++)
2739
+ N(C(m, d));
2740
+ y(), Z();
969
2741
  } },
970
- { label: C(s.value, "copy"), action: () => Qe() },
2742
+ { label: B(s.value, "copy"), action: () => Pt() },
971
2743
  {
972
- label: C(s.value, "paste"),
2744
+ label: B(s.value, "paste"),
973
2745
  action: () => {
974
- K(), Ye().then(() => {
975
- v(), J(A);
2746
+ j(), Tt().then(() => {
2747
+ y(), ee(Z);
976
2748
  });
977
2749
  }
978
2750
  },
979
2751
  {
980
- label: C(s.value, "delete"),
2752
+ label: B(s.value, "delete"),
981
2753
  action: () => {
982
- K(), Ml(l.startRow, l.endRow), v(), A();
2754
+ j(), hn(r.startRow, r.endRow), y(), Z();
983
2755
  }
2756
+ },
2757
+ { label: `${B(s.value, "rowHeight")}...`, action: () => dl("row", o, n) },
2758
+ {
2759
+ label: B(s.value, "defaultRowHeight"),
2760
+ action: () => Xn()
984
2761
  }
985
2762
  ]);
986
2763
  }
987
- function en(e, t) {
2764
+ function Un(e, t) {
988
2765
  e.preventDefault();
989
- const n = g.value;
990
- n && n.startRow === 0 && n.endRow === r - 1 && t >= n.startCol && t <= n.endCol || (te(t, 0, t, r - 1), v());
991
- const l = g.value;
992
- _e(e.clientX, e.clientY, [
2766
+ const o = e.clientX, n = e.clientY, l = w.value;
2767
+ l && l.startRow === 0 && l.endRow === i - 1 && t >= l.startCol && t <= l.endCol || (U(t, 0, t, i - 1), y());
2768
+ const r = w.value;
2769
+ mt(e.clientX, e.clientY, [
993
2770
  {
994
- label: C(s.value, "insert"),
2771
+ label: B(s.value, "insert"),
995
2772
  action: () => {
996
- K(), Dl(l.startCol, l.endCol), v(), A();
2773
+ j(), gn(r.startCol, r.endCol), y(), Z();
997
2774
  },
998
- disabled: l.endCol >= c - 1
2775
+ disabled: r.endCol >= v - 1
999
2776
  },
1000
- { label: C(s.value, "cut"), action: () => {
1001
- K(), Qe();
1002
- for (let o = l.startCol; o <= l.endCol; o++)
1003
- for (let a = 0; a < r; a++)
1004
- X(L(o, a));
1005
- v(), A();
2777
+ { label: B(s.value, "cut"), action: () => {
2778
+ j(), Pt();
2779
+ for (let d = r.startCol; d <= r.endCol; d++)
2780
+ for (let m = 0; m < i; m++)
2781
+ N(C(d, m));
2782
+ y(), Z();
1006
2783
  } },
1007
- { label: C(s.value, "copy"), action: () => Qe() },
2784
+ { label: B(s.value, "copy"), action: () => Pt() },
1008
2785
  {
1009
- label: C(s.value, "paste"),
2786
+ label: B(s.value, "paste"),
1010
2787
  action: () => {
1011
- K(), Ye().then(() => {
1012
- v(), J(A);
2788
+ j(), Tt().then(() => {
2789
+ y(), ee(Z);
1013
2790
  });
1014
2791
  }
1015
2792
  },
1016
2793
  {
1017
- label: C(s.value, "delete"),
2794
+ label: B(s.value, "delete"),
1018
2795
  action: () => {
1019
- K(), Hl(l.startCol, l.endCol), v(), A();
2796
+ j(), yn(r.startCol, r.endCol), y(), Z();
1020
2797
  }
2798
+ },
2799
+ { label: `${B(s.value, "colWidth")}...`, action: () => dl("col", o, n) },
2800
+ {
2801
+ label: B(s.value, "defaultColWidth"),
2802
+ action: () => jn()
1021
2803
  }
1022
2804
  ]);
1023
2805
  }
1024
- function tn(e, t, n) {
1025
- e.preventDefault(), Pt(t, n) || (ee(t, n), v());
1026
- const l = g.value, o = !!(l && l.startCol === l.endCol && l.startRow === l.endRow);
1027
- _e(e.clientX, e.clientY, [
2806
+ function Yn(e, t, o) {
2807
+ e.preventDefault(), b(t, o) || (L(t, o), y());
2808
+ const n = w.value, l = !!(n && n.startCol === n.endCol && n.startRow === n.endRow);
2809
+ mt(e.clientX, e.clientY, [
1028
2810
  {
1029
- label: C(s.value, "cut"),
2811
+ label: B(s.value, "cut"),
1030
2812
  action: () => {
1031
- wt(), A();
2813
+ vo(), Z();
1032
2814
  }
1033
2815
  },
1034
- { label: C(s.value, "copy"), action: () => Ge() },
2816
+ { label: B(s.value, "copy"), action: () => Gt() },
1035
2817
  {
1036
- label: C(s.value, "paste"),
2818
+ label: B(s.value, "paste"),
1037
2819
  action: () => {
1038
- K(), Ye().then(() => {
1039
- v(), J(A);
2820
+ j(), Tt().then(() => {
2821
+ y(), ee(Z);
1040
2822
  });
1041
2823
  }
1042
2824
  },
1043
2825
  {
1044
- label: C(s.value, "delete"),
2826
+ label: B(s.value, "delete"),
1045
2827
  action: () => {
1046
- K(), yt(), v(), A();
2828
+ j(), bo(), y(), Z();
1047
2829
  }
1048
2830
  },
1049
2831
  {
1050
- label: C(s.value, "calculate"),
2832
+ label: B(s.value, "calculate"),
1051
2833
  children: [
1052
- { label: C(s.value, "sum"), action: Rl, disabled: o }
2834
+ { label: B(s.value, "sum"), action: mn, disabled: l }
1053
2835
  ]
1054
2836
  }
1055
2837
  ]);
1056
2838
  }
1057
- const ln = I(() => {
1058
- const e = !R.value, t = R.value ?? h.value, n = t.col, l = t.row;
2839
+ const ul = D(null), ge = D(null);
2840
+ let zt = null;
2841
+ function cl() {
2842
+ zt && (document.removeEventListener("mousedown", zt), zt = null);
2843
+ }
2844
+ function dl(e, t, o) {
2845
+ cl();
2846
+ const n = w.value;
2847
+ let l = "";
2848
+ if (n) {
2849
+ const T = e === "row" ? ie(n.startRow) : z.value[n.startCol];
2850
+ l = T != null && T > 0 ? String(Math.round(T)) : "";
2851
+ }
2852
+ const r = 220, d = 118;
2853
+ let m = t, k = o;
2854
+ m + r > window.innerWidth && (m = window.innerWidth - r - 8), k + d > window.innerHeight && (k = window.innerHeight - d - 8), m < 8 && (m = 8), k < 8 && (k = 8), ge.value = { type: e, x: m, y: k, value: l, error: "" }, zt = () => {
2855
+ ge.value = null;
2856
+ }, setTimeout(() => document.addEventListener("mousedown", zt, { once: !0 }), 0), ee(() => {
2857
+ const T = ul.value;
2858
+ T && (T.focus(), T.select());
2859
+ });
2860
+ }
2861
+ function Kn(e) {
2862
+ const t = ge.value;
2863
+ if (!t)
2864
+ return;
2865
+ const o = e.target, n = o.value, l = n.replace(/[^\d]/g, "");
2866
+ t.value = l, n !== l && (o.value = l), t.error = "";
2867
+ }
2868
+ function Vn(e) {
2869
+ e.key === "Enter" ? (e.preventDefault(), fl()) : e.key === "Escape" && ko();
2870
+ }
2871
+ function fl() {
2872
+ const e = ge.value, t = w.value;
2873
+ if (!e || !t)
2874
+ return;
2875
+ const o = e.value.trim(), n = Number(o), l = e.type === "row", r = l ? Tl : Ea, d = l ? za : Oa;
2876
+ if (o === "" || !Number.isFinite(n)) {
2877
+ e.error = B(s.value, "dimNumberError");
2878
+ return;
2879
+ }
2880
+ if (n < r || n > d) {
2881
+ e.error = B(s.value, "dimRangeError").replace("{min}", String(r)).replace("{max}", String(d));
2882
+ return;
2883
+ }
2884
+ const m = n;
2885
+ if (j(), l)
2886
+ for (let k = t.startRow; k <= t.endRow; k++)
2887
+ X.value[k] = m;
2888
+ else
2889
+ for (let k = t.startCol; k <= t.endCol; k++)
2890
+ z.value[k] = m;
2891
+ y(), Z(), ko();
2892
+ }
2893
+ function ko() {
2894
+ cl(), ge.value = null;
2895
+ }
2896
+ function Xn() {
2897
+ const e = w.value;
2898
+ if (e) {
2899
+ j();
2900
+ for (let t = e.startRow; t <= e.endRow; t++)
2901
+ X.value[t] = void 0;
2902
+ y(), Z();
2903
+ }
2904
+ }
2905
+ function jn() {
2906
+ const e = w.value;
2907
+ if (e) {
2908
+ j();
2909
+ for (let t = e.startCol; t <= e.endCol; t++)
2910
+ z.value[t] = Ct;
2911
+ y(), Z();
2912
+ }
2913
+ }
2914
+ const qn = A(() => {
2915
+ var ve;
2916
+ const e = !E.value, t = E.value ?? g.value, o = t.col, n = t.row, l = (ve = p[C(o, n)]) == null ? void 0 : ve.style, r = Y(_(o, n)), d = typeof (l == null ? void 0 : l.fontFamily) == "string" && l.fontFamily ? l.fontFamily : El, m = (l == null ? void 0 : l.fontWeight) === "bold" ? "bold" : "normal", k = (l == null ? void 0 : l.fontStyle) === "italic" ? "italic" : "normal", T = (l == null ? void 0 : l.underline) === "underline" ? "underline" : (l == null ? void 0 : l.strikethrough) === "line-through" ? "line-through" : "none", Oe = (l == null ? void 0 : l.underline) === "underline" && (l == null ? void 0 : l.strikethrough) === "line-through" ? "underline line-through" : T, $e = typeof (l == null ? void 0 : l.color) == "string" ? l.color : void 0, rt = typeof (l == null ? void 0 : l.backgroundColor) == "string" ? l.backgroundColor : void 0;
1059
2917
  return {
1060
- left: `${w + he.value[n] - M.value}px`,
1061
- top: `${y + pe.value[l] - T.value}px`,
1062
- width: `${H.value[n]}px`,
1063
- height: `${E.value[l]}px`,
2918
+ left: `${I + ce.value[o] - M.value}px`,
2919
+ top: `${W + de.value[n] - O.value}px`,
2920
+ width: `${z.value[o]}px`,
2921
+ height: `${ie(n)}px`,
2922
+ fontFamily: d,
2923
+ fontSize: `${r}px`,
2924
+ fontWeight: m,
2925
+ fontStyle: k,
2926
+ textDecoration: Oe,
1064
2927
  opacity: e ? 0 : 1,
1065
2928
  pointerEvents: e ? "none" : "auto",
1066
- color: e ? "transparent" : void 0,
2929
+ color: e ? "transparent" : $e,
1067
2930
  caretColor: e ? "transparent" : void 0,
1068
2931
  borderColor: e ? "transparent" : void 0,
1069
- background: e ? "transparent" : void 0,
2932
+ background: e ? "transparent" : rt,
1070
2933
  boxShadow: e ? "none" : void 0
1071
2934
  };
1072
- }), nn = I(() => Math.max(0, U.w - w - Q)), on = I(() => Math.max(0, U.h - y - Q)), lt = I(() => Math.max(0, nn.value - 11 * 2)), nt = I(() => Math.max(0, on.value - 11 * 2));
1073
- function Rt() {
1074
- return Math.max(0, U.w - w - Q);
1075
- }
1076
- function Mt() {
1077
- return Math.max(0, U.h - y - Q);
1078
- }
1079
- const ot = I(() => Te.value <= 0 ? lt.value : Math.max(24, Rt() / pt.value * lt.value)), Tt = I(() => Te.value <= 0 ? 0 : M.value / Te.value * (lt.value - ot.value)), at = I(() => De.value <= 0 ? nt.value : Math.max(24, Mt() / bt.value * nt.value)), Dt = I(() => De.value <= 0 ? 0 : T.value / De.value * (nt.value - at.value));
1080
- let Be = null, rt = 0, ut = 0;
1081
- function an(e) {
1082
- e.preventDefault(), Be = "v", rt = e.clientY, ut = T.value, document.addEventListener("mousemove", Ht), document.addEventListener("mouseup", _t);
1083
- }
1084
- function rn(e) {
1085
- e.preventDefault(), Be = "h", rt = e.clientX, ut = M.value, document.addEventListener("mousemove", Ht), document.addEventListener("mouseup", _t);
1086
- }
1087
- function Ht(e) {
1088
- if (Be === "v") {
1089
- const n = (e.clientY - rt) / (nt.value - at.value);
1090
- z(null, ut + n * De.value), v();
1091
- } else if (Be === "h") {
1092
- const n = (e.clientX - rt) / (lt.value - ot.value);
1093
- z(ut + n * Te.value, null), v();
2935
+ }), _n = A(() => Math.max(0, se.w - I - Se)), Zn = A(() => Math.max(0, se.h - W - Se)), Kt = A(() => Math.max(0, _n.value - 11 * 2)), Vt = A(() => Math.max(0, Zn.value - 11 * 2));
2936
+ function wo() {
2937
+ return Math.max(0, se.w - I - Se);
2938
+ }
2939
+ function Co() {
2940
+ return Math.max(0, se.h - W - Se);
2941
+ }
2942
+ const Xt = A(() => ft.value <= 0 ? Kt.value : Math.max(24, wo() / We.value * Kt.value)), Bo = A(() => ft.value <= 0 ? 0 : M.value / ft.value * (Kt.value - Xt.value)), jt = A(() => vt.value <= 0 ? Vt.value : Math.max(24, Co() / Je.value * Vt.value)), xo = A(() => vt.value <= 0 ? 0 : O.value / vt.value * (Vt.value - jt.value));
2943
+ let at = null, qt = 0, _t = 0;
2944
+ function Jn(e) {
2945
+ e.preventDefault(), at = "v", qt = e.clientY, _t = O.value, document.addEventListener("mousemove", So), document.addEventListener("mouseup", Mo);
2946
+ }
2947
+ function Qn(e) {
2948
+ e.preventDefault(), at = "h", qt = e.clientX, _t = M.value, document.addEventListener("mousemove", So), document.addEventListener("mouseup", Mo);
2949
+ }
2950
+ function So(e) {
2951
+ if (at === "v") {
2952
+ const o = (e.clientY - qt) / (Vt.value - jt.value);
2953
+ fe(null, _t + o * vt.value), y();
2954
+ } else if (at === "h") {
2955
+ const o = (e.clientX - qt) / (Kt.value - Xt.value);
2956
+ fe(_t + o * ft.value, null), y();
1094
2957
  }
1095
2958
  }
1096
- function _t() {
1097
- Be = null, document.removeEventListener("mousemove", Ht), document.removeEventListener("mouseup", _t);
2959
+ function Mo() {
2960
+ at = null, document.removeEventListener("mousemove", So), document.removeEventListener("mouseup", Mo);
1098
2961
  }
1099
- function un(e) {
1100
- if (Be)
2962
+ function ea(e) {
2963
+ if (at)
1101
2964
  return;
1102
- const t = e.currentTarget.getBoundingClientRect(), n = e.clientY - t.top;
1103
- n < Dt.value ? z(null, T.value - Mt()) : n > Dt.value + at.value && z(null, T.value + Mt()), v();
2965
+ const t = e.currentTarget.getBoundingClientRect(), o = e.clientY - t.top;
2966
+ o < xo.value ? fe(null, O.value - Co()) : o > xo.value + jt.value && fe(null, O.value + Co()), y();
1104
2967
  }
1105
- function sn(e) {
1106
- if (Be)
2968
+ function ta(e) {
2969
+ if (at)
1107
2970
  return;
1108
- const t = e.currentTarget.getBoundingClientRect(), n = e.clientX - t.left;
1109
- n < Tt.value ? z(M.value - Rt(), null) : n > Tt.value + ot.value && z(M.value + Rt(), null), v();
2971
+ const t = e.currentTarget.getBoundingClientRect(), o = e.clientX - t.left;
2972
+ o < Bo.value ? fe(M.value - wo(), null) : o > Bo.value + Xt.value && fe(M.value + wo(), null), y();
1110
2973
  }
1111
- let Ee = !1, ae = 0, re = 0, $e = !1, Ie = !1, ol = 0, al = 0, We = 0, st = 0, Et = 0, $t = 0, rl = 0, ul = 0, Pe = !1, It = !1, Ae = 0, Ne = 0, Wt = 0, sl = -1, cl = -1;
1112
- function cn(e) {
2974
+ let ht = !1, Te = 0, Ee = 0, pt = !1, gt = !1, vl = 0, bl = 0, yt = 0, Zt = 0, Ro = 0, Do = 0, ml = 0, hl = 0, Lt = !1, Fo = !1, kt = 0, wt = 0, To = 0, pl = -1, gl = -1;
2975
+ function oa(e) {
1113
2976
  if (e.button !== 0)
1114
2977
  return;
1115
- e.preventDefault(), fe.value = null;
1116
- const t = ke(e, oe.value);
1117
- if (t.y < y && t.x >= w) {
1118
- const o = t.x - w + M.value, a = le(o);
1119
- if (a >= 0 && Math.abs(t.x - (w + he.value[a + 1] - M.value)) <= 4) {
1120
- $e = !0, ol = a, We = H.value[a], st = o, v();
2978
+ e.preventDefault(), Ue.value = null;
2979
+ const t = ct(e, Fe.value);
2980
+ if (t.y < W && t.x >= I) {
2981
+ const l = t.x - I + M.value, r = Re(l);
2982
+ if (r >= 0 && Math.abs(t.x - (I + ce.value[r + 1] - M.value)) <= 4) {
2983
+ j(), pt = !0, vl = r, yt = z.value[r], Zt = l, y();
1121
2984
  return;
1122
2985
  }
1123
2986
  }
1124
- if (t.x < w && t.y >= y) {
1125
- const o = t.y - y + T.value, a = ne(o);
1126
- if (a >= 0 && Math.abs(t.y - (y + pe.value[a + 1] - T.value)) <= 4) {
1127
- Ie = !0, al = a, We = E.value[a], st = o, v();
2987
+ if (t.x < I && t.y >= W) {
2988
+ const l = t.y - W + O.value, r = De(l);
2989
+ if (r >= 0 && Math.abs(t.y - (W + de.value[r + 1] - O.value)) <= 4) {
2990
+ j(), gt = !0, bl = r, yt = ie(r), Zt = l, y();
1128
2991
  return;
1129
2992
  }
1130
2993
  }
1131
- if (t.x < w || t.y < y) {
1132
- if (t.y < y && t.x >= w) {
1133
- const o = le(t.x - w + M.value);
1134
- o >= 0 && (te(o, 0, o, r - 1), Ee = !0, ae = o, re = 0);
1135
- } else if (t.x < w && t.y >= y) {
1136
- const o = ne(t.y - y + T.value);
1137
- o >= 0 && (te(0, o, c - 1, o), Ee = !0, ae = 0, re = o);
2994
+ if (t.x < I || t.y < W) {
2995
+ if (qe(), t.y < W && t.x >= I) {
2996
+ const l = Re(t.x - I + M.value);
2997
+ l >= 0 && (U(l, 0, l, i - 1), ht = !0, Te = l, Ee = 0);
2998
+ } else if (t.x < I && t.y >= W) {
2999
+ const l = De(t.y - W + O.value);
3000
+ l >= 0 && (U(0, l, v - 1, l), ht = !0, Te = 0, Ee = l);
1138
3001
  } else
1139
- t.x < w && t.y < y && mt();
1140
- v();
3002
+ t.x < I && t.y < W && u();
3003
+ y();
1141
3004
  return;
1142
3005
  }
1143
- const n = le(t.x - w + M.value), l = ne(t.y - y + T.value);
1144
- if (!(n < 0 || l < 0)) {
1145
- if (be(), e.shiftKey && g.value) {
1146
- const o = g.value;
1147
- te(o.startCol, o.startRow, n, l);
3006
+ const o = Re(t.x - I + M.value), n = De(t.y - W + O.value);
3007
+ if (!(o < 0 || n < 0)) {
3008
+ if (qe(), e.shiftKey && w.value) {
3009
+ const l = w.value;
3010
+ U(l.startCol, l.startRow, o, n);
1148
3011
  } else
1149
- ee(n, l);
1150
- Ee = !0, ae = n, re = l, V(), v();
3012
+ L(o, n);
3013
+ ht = !0, Te = o, Ee = n, pe(), y();
1151
3014
  }
1152
3015
  }
1153
- function fn(e) {
1154
- if ($e) {
1155
- const a = ke(e, oe.value).x - w + M.value - st;
1156
- We + a >= 30 && (H.value[ol] = We + a), v();
3016
+ function la(e) {
3017
+ if (pt) {
3018
+ const r = ct(e, Fe.value).x - I + M.value - Zt;
3019
+ yt + r >= 30 && (z.value[vl] = yt + r), y();
1157
3020
  return;
1158
3021
  }
1159
- if (Ie) {
1160
- const a = ke(e, oe.value).y - y + T.value - st;
1161
- We + a >= 24 && (E.value[al] = We + a), v();
3022
+ if (gt) {
3023
+ const r = ct(e, Fe.value).y - W + O.value - Zt;
3024
+ yt + r >= Tl && (X.value[bl] = yt + r), y();
1162
3025
  return;
1163
3026
  }
1164
- if (!Ee) {
1165
- const o = oe.value;
1166
- if (!o)
3027
+ if (!ht) {
3028
+ const l = Fe.value;
3029
+ if (!l)
3030
+ return;
3031
+ if (tt.value) {
3032
+ l.style.cursor = "copy";
1167
3033
  return;
1168
- const a = ke(e, o);
1169
- if (a.y < y && a.x >= w) {
1170
- const d = le(a.x - w + M.value);
1171
- if (d >= 0 && Math.abs(a.x - (w + he.value[d + 1] - M.value)) <= 4) {
1172
- o.style.cursor = "col-resize";
3034
+ }
3035
+ const r = ct(e, l);
3036
+ if (r.y < W && r.x >= I) {
3037
+ const d = Re(r.x - I + M.value);
3038
+ if (d >= 0 && Math.abs(r.x - (I + ce.value[d + 1] - M.value)) <= 4) {
3039
+ l.style.cursor = "col-resize";
1173
3040
  return;
1174
3041
  }
1175
3042
  }
1176
- if (a.x < w && a.y >= y) {
1177
- const d = ne(a.y - y + T.value);
1178
- if (d >= 0 && Math.abs(a.y - (y + pe.value[d + 1] - T.value)) <= 4) {
1179
- o.style.cursor = "row-resize";
3043
+ if (r.x < I && r.y >= W) {
3044
+ const d = De(r.y - W + O.value);
3045
+ if (d >= 0 && Math.abs(r.y - (W + de.value[d + 1] - O.value)) <= 4) {
3046
+ l.style.cursor = "row-resize";
1180
3047
  return;
1181
3048
  }
1182
3049
  }
1183
- o.style.cursor = "cell";
3050
+ l.style.cursor = "cell";
1184
3051
  return;
1185
3052
  }
1186
- const t = ke(e, oe.value);
1187
- if (ae < 0 || re < 0)
3053
+ const t = ct(e, Fe.value);
3054
+ if (Te < 0 || Ee < 0)
1188
3055
  return;
1189
- if (t.x < w || t.y < y) {
1190
- if (t.y < y && t.x >= w) {
1191
- const o = le(t.x - w + M.value);
1192
- o >= 0 && te(Math.min(ae, o), 0, Math.max(ae, o), r - 1);
1193
- } else if (t.x < w && t.y >= y) {
1194
- const o = ne(t.y - y + T.value);
1195
- o >= 0 && te(0, Math.min(re, o), c - 1, Math.max(re, o));
3056
+ if (t.x < I || t.y < W) {
3057
+ if (t.y < W && t.x >= I) {
3058
+ const l = Re(t.x - I + M.value);
3059
+ l >= 0 && U(Math.min(Te, l), 0, Math.max(Te, l), i - 1);
3060
+ } else if (t.x < I && t.y >= W) {
3061
+ const l = De(t.y - W + O.value);
3062
+ l >= 0 && U(0, Math.min(Ee, l), v - 1, Math.max(Ee, l));
1196
3063
  }
1197
- v();
3064
+ y();
1198
3065
  return;
1199
3066
  }
1200
- const n = le(t.x - w + M.value), l = ne(t.y - y + T.value);
1201
- n < 0 || l < 0 || (re === 0 && ae >= 0 && g.value && g.value.startRow === 0 && g.value.endRow === r - 1 ? te(Math.min(ae, n), 0, Math.max(ae, n), r - 1) : ae === 0 && re >= 0 && g.value && g.value.startCol === 0 && g.value.endCol === c - 1 ? te(0, Math.min(re, l), c - 1, Math.max(re, l)) : te(ae, re, n, l), v());
3067
+ const o = Re(t.x - I + M.value), n = De(t.y - W + O.value);
3068
+ o < 0 || n < 0 || (Ee === 0 && Te >= 0 && w.value && w.value.startRow === 0 && w.value.endRow === i - 1 ? U(Math.min(Te, o), 0, Math.max(Te, o), i - 1) : Te === 0 && Ee >= 0 && w.value && w.value.startCol === 0 && w.value.endCol === v - 1 ? U(0, Math.min(Ee, n), v - 1, Math.max(Ee, n)) : U(Te, Ee, o, n), y());
1202
3069
  }
1203
- function vn() {
1204
- const e = $e || Ie;
1205
- Ee = !1, $e = !1, Ie = !1, e && Qt();
3070
+ function na(e) {
3071
+ const t = pt || gt;
3072
+ ht = !1, pt = !1, gt = !1, t && nl(), tt.value && Pl();
1206
3073
  }
1207
- function dn() {
1208
- const e = $e || Ie;
1209
- Ee = !1, $e = !1, Ie = !1, e && Qt();
3074
+ function aa() {
3075
+ const e = pt || gt;
3076
+ ht = !1, pt = !1, gt = !1, e && nl();
1210
3077
  }
1211
- function hn(e) {
3078
+ function ra(e) {
1212
3079
  e.preventDefault();
1213
- const t = ke(e, oe.value);
1214
- if (t.x < w && t.y < y) {
1215
- Gl(e);
3080
+ const t = ct(e, Fe.value);
3081
+ if (t.x < I && t.y < W) {
3082
+ Gn(e);
1216
3083
  return;
1217
3084
  }
1218
- if (t.y < y && t.x >= w) {
1219
- const n = le(t.x - w + M.value);
1220
- n >= 0 && en(e, n);
3085
+ if (t.y < W && t.x >= I) {
3086
+ const o = Re(t.x - I + M.value);
3087
+ o >= 0 && Un(e, o);
1221
3088
  return;
1222
3089
  }
1223
- if (t.x < w && t.y >= y) {
1224
- const n = ne(t.y - y + T.value);
1225
- n >= 0 && Ql(e, n);
3090
+ if (t.x < I && t.y >= W) {
3091
+ const o = De(t.y - W + O.value);
3092
+ o >= 0 && Pn(e, o);
1226
3093
  return;
1227
3094
  }
1228
- if (t.x >= w && t.y >= y) {
1229
- const n = le(t.x - w + M.value), l = ne(t.y - y + T.value);
1230
- n >= 0 && l >= 0 && tn(e, n, l);
3095
+ if (t.x >= I && t.y >= W) {
3096
+ const o = Re(t.x - I + M.value), n = De(t.y - W + O.value);
3097
+ o >= 0 && n >= 0 && Yn(e, o, n);
1231
3098
  }
1232
3099
  }
1233
- function pn(e) {
1234
- const t = ke(e, oe.value);
1235
- if (t.x < w || t.y < y)
3100
+ function ia(e) {
3101
+ const t = ct(e, Fe.value);
3102
+ if (t.x < I || t.y < W)
1236
3103
  return;
1237
- const n = le(t.x - w + M.value), l = ne(t.y - y + T.value);
1238
- n < 0 || l < 0 || (ee(n, l), W(n, l), ve(), v(), V());
3104
+ const o = Re(t.x - I + M.value), n = De(t.y - W + O.value);
3105
+ o < 0 || n < 0 || (L(o, n), le(o, n), je(), y(), pe());
1239
3106
  }
1240
- function bn(e) {
1241
- z(M.value + e.deltaX, T.value + e.deltaY), v();
3107
+ function sa(e) {
3108
+ fe(M.value + e.deltaX, O.value + e.deltaY), y();
1242
3109
  }
1243
- function mn(e) {
3110
+ function ua(e) {
1244
3111
  if (e.touches.length !== 1) {
1245
- Pe = !1;
3112
+ Lt = !1;
1246
3113
  return;
1247
3114
  }
1248
- const t = e.touches[0], n = oe.value;
1249
- if (!n)
3115
+ const t = e.touches[0], o = Fe.value;
3116
+ if (!o)
1250
3117
  return;
1251
- const l = n.getBoundingClientRect(), o = t.clientX - l.left, a = t.clientY - l.top;
1252
- o >= w && a >= y && (e.preventDefault(), Pe = !0, It = !1, Et = o, $t = a, rl = M.value, ul = T.value, Ae = le(o - w + M.value), Ne = ne(a - y + T.value));
3118
+ const n = o.getBoundingClientRect(), l = t.clientX - n.left, r = t.clientY - n.top;
3119
+ l >= I && r >= W && (e.preventDefault(), Lt = !0, Fo = !1, Ro = l, Do = r, ml = M.value, hl = O.value, kt = Re(l - I + M.value), wt = De(r - W + O.value));
1253
3120
  }
1254
- function gn(e) {
1255
- if (!Pe || e.touches.length !== 1)
3121
+ function ca(e) {
3122
+ if (!Lt || e.touches.length !== 1)
1256
3123
  return;
1257
- const t = e.touches[0], n = oe.value;
1258
- if (!n)
3124
+ const t = e.touches[0], o = Fe.value;
3125
+ if (!o)
1259
3126
  return;
1260
- const l = n.getBoundingClientRect(), o = t.clientX - l.left, a = t.clientY - l.top;
1261
- (Math.abs(o - Et) > 8 || Math.abs(a - $t) > 8) && (It = !0, e.preventDefault(), z(rl + (Et - o), ul + ($t - a)), v());
3127
+ const n = o.getBoundingClientRect(), l = t.clientX - n.left, r = t.clientY - n.top;
3128
+ (Math.abs(l - Ro) > 8 || Math.abs(r - Do) > 8) && (Fo = !0, e.preventDefault(), fe(ml + (Ro - l), hl + (Do - r)), y());
1262
3129
  }
1263
- function wn() {
1264
- if (Pe && (Pe = !1, !It && Ae >= 0 && Ne >= 0)) {
3130
+ function da() {
3131
+ if (Lt && (Lt = !1, !Fo && kt >= 0 && wt >= 0)) {
1265
3132
  const e = Date.now();
1266
- Ae === sl && Ne === cl && e - Wt < 300 ? (ee(Ae, Ne), ve(), v(), V(), Wt = 0) : (be(), ee(Ae, Ne), v(), Wt = e), sl = Ae, cl = Ne, V();
3133
+ kt === pl && wt === gl && e - To < 300 ? (L(kt, wt), je(), y(), pe(), To = 0) : (qe(), L(kt, wt), y(), To = e), pl = kt, gl = wt, pe();
1267
3134
  }
1268
3135
  }
1269
- function At(e) {
3136
+ function Eo(e) {
1270
3137
  return e.isComposing || e.key === "Process" || e.keyCode === 229;
1271
3138
  }
1272
- function il(e) {
3139
+ function yl(e) {
1273
3140
  return e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey;
1274
3141
  }
1275
- function fl(e) {
1276
- if (R.value)
3142
+ function kl(e) {
3143
+ if (E.value)
1277
3144
  return;
1278
- const t = e.ctrlKey || e.metaKey, n = e.shiftKey;
3145
+ const t = e.ctrlKey || e.metaKey, o = e.shiftKey;
1279
3146
  switch (!0) {
1280
3147
  case (t && (e.key === "c" || e.key === "C")):
1281
- e.preventDefault(), Ge();
3148
+ e.preventDefault(), Gt();
1282
3149
  return;
1283
3150
  case (t && (e.key === "x" || e.key === "X")):
1284
- e.preventDefault(), wt();
3151
+ e.preventDefault(), vo();
1285
3152
  return;
1286
3153
  case (t && (e.key === "z" || e.key === "Z")):
1287
- e.preventDefault(), Sl();
3154
+ e.preventDefault(), Yo();
1288
3155
  return;
1289
3156
  case (t && (e.key === "y" || e.key === "Y")):
1290
- e.preventDefault(), kl();
3157
+ e.preventDefault(), Ko();
1291
3158
  return;
1292
3159
  case (t && (e.key === "v" || e.key === "V")):
1293
- e.preventDefault(), K(), Ye().then(() => {
1294
- v(), J(A);
3160
+ e.preventDefault(), j(), Tt().then(() => {
3161
+ y(), ee(Z);
1295
3162
  });
1296
3163
  return;
1297
3164
  case (t && (e.key === "a" || e.key === "A")):
1298
- e.preventDefault(), mt(), v();
3165
+ e.preventDefault(), u(), y();
1299
3166
  return;
1300
3167
  case (t && e.key === "Home"):
1301
- e.preventDefault(), ee(0, 0), W(0, 0), v();
3168
+ e.preventDefault(), L(0, 0), le(0, 0), y();
1302
3169
  return;
1303
3170
  case (t && e.key === "End"):
1304
- e.preventDefault(), ee(c - 1, r - 1), W(c - 1, r - 1), v();
3171
+ e.preventDefault(), L(v - 1, i - 1), le(v - 1, i - 1), y();
1305
3172
  return;
1306
3173
  case e.key === "Home":
1307
- e.preventDefault(), ee(0, h.value.row), W(0, h.value.row), v();
3174
+ e.preventDefault(), L(0, g.value.row), le(0, g.value.row), y();
1308
3175
  return;
1309
3176
  case e.key === "End":
1310
- e.preventDefault(), ee(c - 1, h.value.row), W(c - 1, h.value.row), v();
3177
+ e.preventDefault(), L(v - 1, g.value.row), le(v - 1, g.value.row), y();
1311
3178
  return;
1312
3179
  case e.key === "ArrowUp":
1313
- e.preventDefault(), ie(0, -1), W(h.value.col, h.value.row), v();
3180
+ e.preventDefault(), Ne(0, -1), le(g.value.col, g.value.row), y();
1314
3181
  return;
1315
3182
  case e.key === "ArrowDown":
1316
- e.preventDefault(), ie(0, 1), W(h.value.col, h.value.row), v();
3183
+ e.preventDefault(), Ne(0, 1), le(g.value.col, g.value.row), y();
1317
3184
  return;
1318
3185
  case e.key === "ArrowLeft":
1319
- e.preventDefault(), ie(-1, 0), W(h.value.col, h.value.row), v();
3186
+ e.preventDefault(), Ne(-1, 0), le(g.value.col, g.value.row), y();
1320
3187
  return;
1321
3188
  case e.key === "ArrowRight":
1322
- e.preventDefault(), ie(1, 0), W(h.value.col, h.value.row), v();
3189
+ e.preventDefault(), Ne(1, 0), le(g.value.col, g.value.row), y();
1323
3190
  return;
1324
3191
  case e.key === "Tab":
1325
- e.preventDefault(), ie(n ? -1 : 1, 0), W(h.value.col, h.value.row), v();
3192
+ e.preventDefault(), Ne(o ? -1 : 1, 0), le(g.value.col, g.value.row), y();
1326
3193
  return;
1327
3194
  case e.key === "Enter":
1328
- e.preventDefault(), ie(0, n ? -1 : 1), W(h.value.col, h.value.row), v();
3195
+ e.preventDefault(), Ne(0, o ? -1 : 1), le(g.value.col, g.value.row), y();
1329
3196
  return;
1330
3197
  case e.key === "F2":
1331
- e.preventDefault(), W(h.value.col, h.value.row), ve(), v(), V();
3198
+ e.preventDefault(), le(g.value.col, g.value.row), je(), y(), pe();
1332
3199
  return;
1333
3200
  case e.key === "Delete":
1334
3201
  case e.key === "Backspace":
1335
- e.preventDefault(), K(), yt(), v();
3202
+ e.preventDefault(), j(), bo(), y();
1336
3203
  return;
1337
3204
  case e.key === "Escape":
1338
- e.preventDefault(), me(), v();
3205
+ e.preventDefault(), et(), tt.value = null, y();
1339
3206
  return;
1340
- case il(e):
1341
- if (At(e)) {
1342
- W(h.value.col, h.value.row), ve(""), v(), V();
3207
+ case yl(e):
3208
+ if (Eo(e)) {
3209
+ le(g.value.col, g.value.row), je(""), y(), pe();
1343
3210
  return;
1344
3211
  }
1345
- e.preventDefault(), W(h.value.col, h.value.row), ve(e.key), v(), J(() => {
1346
- const l = Ct.value;
1347
- l && (l.focus(), l.setSelectionRange(1, 1));
3212
+ e.preventDefault(), le(g.value.col, g.value.row), je(e.key), y(), ee(() => {
3213
+ const n = po.value;
3214
+ n && (n.focus(), n.setSelectionRange(1, 1));
1348
3215
  });
1349
3216
  return;
1350
3217
  }
1351
3218
  }
1352
- let Nt = !1, Lt = !1;
1353
- function yn(e) {
3219
+ let Oo = !1, zo = !1;
3220
+ function fa(e) {
1354
3221
  const t = e.target.value;
1355
- if (!R.value) {
1356
- W(h.value.col, h.value.row), ve(t), v();
3222
+ if (!E.value) {
3223
+ le(g.value.col, g.value.row), je(t), y();
1357
3224
  return;
1358
3225
  }
1359
- O.value = t;
3226
+ V.value = t;
1360
3227
  }
1361
- function Bn() {
1362
- Nt = !0, R.value || (W(h.value.col, h.value.row), ve(""), v());
3228
+ function va() {
3229
+ Oo = !0, E.value || (le(g.value.col, g.value.row), je(""), y());
1363
3230
  }
1364
- function xn(e) {
1365
- Nt = !1, Lt = !0, setTimeout(() => {
1366
- Lt = !1;
1367
- }, 0), O.value = e.target.value;
3231
+ function ba(e) {
3232
+ Oo = !1, zo = !0, setTimeout(() => {
3233
+ zo = !1;
3234
+ }, 0), V.value = e.target.value;
1368
3235
  }
1369
- function Cn(e) {
1370
- if (!R.value) {
1371
- if (il(e) || At(e))
3236
+ function ma(e) {
3237
+ if (!E.value) {
3238
+ if (yl(e) || Eo(e))
1372
3239
  return;
1373
- fl(e);
3240
+ kl(e);
1374
3241
  return;
1375
3242
  }
1376
- Nt || At(e) || Lt && (e.key === "Enter" || e.key === "Escape") || (e.key === "Enter" ? (e.preventDefault(), be(), ie(0, 1), W(h.value.col, h.value.row), v(), V()) : e.key === "Tab" ? (e.preventDefault(), be(), ie(e.shiftKey ? -1 : 1, 0), W(h.value.col, h.value.row), v(), V()) : e.key === "Escape" && (e.preventDefault(), me(), v(), V()));
3243
+ Oo || Eo(e) || zo && (e.key === "Enter" || e.key === "Escape") || (e.key === "Enter" ? (e.preventDefault(), qe(), Ne(0, 1), le(g.value.col, g.value.row), y(), pe()) : e.key === "Tab" ? (e.preventDefault(), qe(), Ne(e.shiftKey ? -1 : 1, 0), le(g.value.col, g.value.row), y(), pe()) : e.key === "Escape" && (e.preventDefault(), et(), y(), pe()));
1377
3244
  }
1378
- function Sn() {
3245
+ function ha() {
1379
3246
  setTimeout(() => {
1380
- R.value && (be(), v());
3247
+ E.value && (qe(), y());
1381
3248
  }, 0);
1382
3249
  }
1383
- function ct() {
3250
+ function Jt() {
1384
3251
  var t;
1385
- const e = (t = we.value) == null ? void 0 : t.getBoundingClientRect();
3252
+ const e = (t = lt.value) == null ? void 0 : t.getBoundingClientRect();
1386
3253
  if (e) {
1387
- const n = Se(f.width), l = Se(f.height);
1388
- n != null ? U.w = n : U.w = e.width, l != null ? U.h = l : U.h = e.height;
3254
+ const o = ut(h.width), n = ut(h.height);
3255
+ o != null ? se.w = o : se.w = e.width, n != null ? se.h = n : se.h = e.height;
1389
3256
  }
1390
- z(null, null), v();
1391
- }
1392
- let q = null;
1393
- return Mn(() => {
1394
- const e = Se(f.width), t = Se(f.height);
1395
- (e == null || t == null) && (q = new ResizeObserver(() => ct()), we.value && q.observe(we.value)), J(() => {
1396
- ct(), V();
1397
- }), ee(0, 0), m.value && m.value.length > 0 && (k = JSON.stringify(m.value), D.value = m.value.map((n) => {
1398
- const l = et(n.name);
1399
- for (const [o, a] of Object.entries(n.cells))
1400
- l.cells[o] = { value: a.value, style: a.style ?? null };
1401
- if (n.colWidths)
1402
- for (const [o, a] of Object.entries(n.colWidths)) {
1403
- const d = Number(o);
1404
- d >= 0 && d < c && a >= 30 && (l.colWidths[d] = a);
3257
+ fe(null, null), y();
3258
+ }
3259
+ let Ce = null;
3260
+ return Go(() => {
3261
+ const e = ut(h.width), t = ut(h.height);
3262
+ (e == null || t == null) && (Ce = new ResizeObserver(() => Jt()), lt.value && Ce.observe(lt.value)), ee(() => {
3263
+ Jt(), pe();
3264
+ }), L(0, 0), x.value && x.value.length > 0 && (F = JSON.stringify(x.value), q.value = x.value.map((o) => {
3265
+ const n = Ut(o.name);
3266
+ for (const [l, r] of Object.entries(o.cells))
3267
+ n.cells[l] = { value: r.value, style: r.style ?? null };
3268
+ if (o.colWidths)
3269
+ for (const [l, r] of Object.entries(o.colWidths)) {
3270
+ const d = Number(l);
3271
+ d >= 0 && d < v && r >= 30 && (n.colWidths[d] = r);
1405
3272
  }
1406
- if (n.rowHeights)
1407
- for (const [o, a] of Object.entries(n.rowHeights)) {
1408
- const d = Number(o);
1409
- d >= 0 && d < r && a >= 24 && (l.rowHeights[d] = a);
3273
+ if (o.rowHeights)
3274
+ for (const [l, r] of Object.entries(o.rowHeights)) {
3275
+ const d = Number(l);
3276
+ d >= 0 && d < i && r >= 24 && (n.rowHeights[d] = r);
1410
3277
  }
1411
- return l;
1412
- }), D.value.length > 0 && ge(0));
1413
- }), Ve(() => [f.width, f.height], () => {
1414
- const e = Se(f.width), t = Se(f.height);
1415
- e != null && t != null ? (q == null || q.disconnect(), q = null) : !q && we.value && (q = new ResizeObserver(() => ct()), q.observe(we.value)), J(() => ct());
1416
- }), Ve(() => f.theme, () => v()), Ve(() => ({ ...b }), () => J(A), { deep: !1 }), Ve(Z, () => J(A)), Ve(() => m.value, (e) => {
3278
+ return n;
3279
+ }), q.value.length > 0 && Ze(0));
3280
+ }), He(() => [h.width, h.height], () => {
3281
+ const e = ut(h.width), t = ut(h.height);
3282
+ e != null && t != null ? (Ce == null || Ce.disconnect(), Ce = null) : !Ce && lt.value && (Ce = new ResizeObserver(() => Jt()), Ce.observe(lt.value)), ee(() => Jt());
3283
+ }), He(() => h.theme, () => y()), He(() => ({ ...p }), () => ee(Z), { deep: !1 }), He(he, () => ee(Z)), He(() => x.value, (e) => {
1417
3284
  if (!e || e.length === 0)
1418
3285
  return;
1419
3286
  const t = JSON.stringify(e);
1420
- t !== k && (k = t, D.value = e.map((n) => {
1421
- const l = et(n.name);
1422
- for (const [o, a] of Object.entries(n.cells))
1423
- l.cells[o] = { value: a.value, style: a.style ?? null };
1424
- if (n.colWidths)
1425
- for (const [o, a] of Object.entries(n.colWidths)) {
1426
- const d = Number(o);
1427
- d >= 0 && d < c && a >= 30 && (l.colWidths[d] = a);
3287
+ t !== F && (F = t, q.value = e.map((o) => {
3288
+ const n = Ut(o.name);
3289
+ for (const [l, r] of Object.entries(o.cells))
3290
+ n.cells[l] = { value: r.value, style: r.style ?? null };
3291
+ if (o.colWidths)
3292
+ for (const [l, r] of Object.entries(o.colWidths)) {
3293
+ const d = Number(l);
3294
+ d >= 0 && d < v && r >= 30 && (n.colWidths[d] = r);
1428
3295
  }
1429
- if (n.rowHeights)
1430
- for (const [o, a] of Object.entries(n.rowHeights)) {
1431
- const d = Number(o);
1432
- d >= 0 && d < r && a >= 24 && (l.rowHeights[d] = a);
3296
+ if (o.rowHeights)
3297
+ for (const [l, r] of Object.entries(o.rowHeights)) {
3298
+ const d = Number(l);
3299
+ d >= 0 && d < i && r >= 24 && (n.rowHeights[d] = r);
1433
3300
  }
1434
- return l;
1435
- }), D.value.length > 0 && ge(0), v());
1436
- }, { deep: !0 }), Tn(() => {
1437
- q == null || q.disconnect();
1438
- }), (e, t) => (j(), P("div", {
3301
+ return n;
3302
+ }), q.value.length > 0 && Ze(0), y());
3303
+ }, { deep: !0 }), Ht(() => {
3304
+ Ce == null || Ce.disconnect();
3305
+ }), (e, t) => (S(), H("div", {
1439
3306
  class: "spreadsheet-outer",
1440
- style: Ce(Al.value)
3307
+ style: Me(Sn.value)
1441
3308
  }, [
1442
- $("div", {
1443
- class: "tab-bar",
1444
- onContextmenu: ql
1445
- }, [
1446
- $("div", Un, [
1447
- (j(!0), P(Yt, null, Ut(D.value, (n, l) => (j(), P("div", {
1448
- key: n.id,
1449
- class: vt(["tab-item", { "tab-item--active": l === Z.value }]),
1450
- onClick: (o) => Pl(l),
1451
- onDblclick: ue((o) => tl(l), ["prevent"]),
1452
- onContextmenu: (o) => Zl(o, l)
1453
- }, [
1454
- ye.value === l ? (j(), P("input", {
1455
- key: 0,
1456
- class: "tab-rename-input",
1457
- value: He.value,
1458
- onInput: t[0] || (t[0] = (o) => He.value = o.target.value),
1459
- onKeydown: Vl,
1460
- onBlur: ll,
1461
- onClick: t[1] || (t[1] = ue(() => {
1462
- }, ["stop"]))
1463
- }, null, 40, Kn)) : (j(), P("span", Pn, dt(n.name), 1))
1464
- ], 42, jn))), 128))
1465
- ]),
1466
- $("button", {
1467
- class: "tab-bar__add-btn",
1468
- title: se(C)(s.value, "addSheet"),
1469
- onClick: t[2] || (t[2] = (n) => {
1470
- Bt(), v();
1471
- })
1472
- }, " + ", 8, zn)
1473
- ], 32),
1474
- $("div", Vn, [
1475
- $("div", Jn, dt(Ol.value), 1),
1476
- $("input", {
3309
+ ke(Yr, {
3310
+ locale: s.value,
3311
+ "can-undo": Il.value,
3312
+ "can-redo": Wl.value,
3313
+ "paint-fmt-active": tt.value !== null,
3314
+ "has-selection": Nl.value,
3315
+ "font-family-options": Yl.value,
3316
+ "font-size-options": Kl.value,
3317
+ "sel-font-family": Vl.value,
3318
+ "sel-font-size": Pe.value,
3319
+ "font-size-input": _e.value,
3320
+ "font-size-menu-open": ot.value,
3321
+ "sel-font-weight": Vo.value,
3322
+ "sel-font-style": Xo.value,
3323
+ "sel-underline": jo.value,
3324
+ "sel-strikethrough": qo.value,
3325
+ "sel-text-color": dn.value,
3326
+ "text-color-menu-open": uo.value,
3327
+ "sel-fill-color": fn.value,
3328
+ "fill-color-menu-open": co.value,
3329
+ "cached-text-color": Wt.value,
3330
+ "cached-fill-color": Nt.value,
3331
+ "border-menu-open": _o.value,
3332
+ "cached-border": fo.value,
3333
+ onUndo: t[0] || (t[0] = (o) => Yo()),
3334
+ onRedo: t[1] || (t[1] = (o) => Ko()),
3335
+ onPaintFormat: Gl,
3336
+ onClearFormat: t[2] || (t[2] = (o) => Ul()),
3337
+ onFontFamilyChange: t[3] || (t[3] = (o) => Xl(o)),
3338
+ onFontSizeInput: t[4] || (t[4] = (o) => ql(o)),
3339
+ onFontSizeBlur: _l,
3340
+ onFontSizeKeydown: t[5] || (t[5] = (o) => Zl(o)),
3341
+ onFontSizeChange: t[6] || (t[6] = (o) => jl(o)),
3342
+ "onUpdate:fontSizeMenuOpen": t[7] || (t[7] = (o) => ot.value = o),
3343
+ onFontSizeToggle: t[8] || (t[8] = (o) => Jl()),
3344
+ onFontSizeStepUp: Ql,
3345
+ onFontSizeStepDown: en,
3346
+ onBoldToggle: tn,
3347
+ onItalicToggle: on,
3348
+ onUnderlineToggle: ln,
3349
+ onStrikethroughToggle: nn,
3350
+ onTextColorChange: t[9] || (t[9] = (o) => rn(o)),
3351
+ "onUpdate:textColorMenuOpen": t[10] || (t[10] = (o) => uo.value = o),
3352
+ onFillColorChange: t[11] || (t[11] = (o) => sn(o)),
3353
+ "onUpdate:fillColorMenuOpen": t[12] || (t[12] = (o) => co.value = o),
3354
+ onApplyTextColor: un,
3355
+ onApplyFillColor: cn,
3356
+ "onUpdate:borderMenuOpen": t[13] || (t[13] = (o) => an(o)),
3357
+ onBorderChange: t[14] || (t[14] = (o) => Zo(o)),
3358
+ onApplyBorder: bn
3359
+ }, null, 8, ["locale", "can-undo", "can-redo", "paint-fmt-active", "has-selection", "font-family-options", "font-size-options", "sel-font-family", "sel-font-size", "font-size-input", "font-size-menu-open", "sel-font-weight", "sel-font-style", "sel-underline", "sel-strikethrough", "sel-text-color", "text-color-menu-open", "sel-fill-color", "fill-color-menu-open", "cached-text-color", "cached-fill-color", "border-menu-open", "cached-border"]),
3360
+ c("div", ai, [
3361
+ c("div", ri, Le(Fn.value), 1),
3362
+ c("input", {
1477
3363
  ref_key: "formulaBarRef",
1478
- ref: St,
3364
+ ref: go,
1479
3365
  class: "formula-bar__input",
1480
- value: Xl.value,
1481
- onFocus: Yl,
1482
- onInput: Ul,
1483
- onKeydown: jl,
1484
- onBlur: Kl
1485
- }, null, 40, Zn)
3366
+ value: Tn.value,
3367
+ onFocus: En,
3368
+ onInput: On,
3369
+ onKeydown: zn,
3370
+ onBlur: Ln
3371
+ }, null, 40, ii)
1486
3372
  ]),
1487
- $("div", {
3373
+ c("div", {
1488
3374
  ref_key: "wrapperRef",
1489
- ref: we,
3375
+ ref: lt,
1490
3376
  class: "spreadsheet-wrapper"
1491
3377
  }, [
1492
- $("canvas", {
3378
+ c("canvas", {
1493
3379
  ref_key: "canvasRef",
1494
- ref: oe,
3380
+ ref: Fe,
1495
3381
  class: "grid-canvas",
1496
3382
  tabindex: "0",
1497
- onMousedown: cn,
1498
- onMousemove: fn,
1499
- onMouseup: vn,
1500
- onMouseleave: dn,
1501
- onDblclick: pn,
1502
- onWheel: ue(bn, ["prevent"]),
1503
- onFocus: Ll,
1504
- onKeydown: fl,
1505
- onContextmenu: hn,
1506
- onTouchstart: ue(mn, ["prevent"]),
1507
- onTouchmove: ue(gn, ["prevent"]),
1508
- onTouchend: wn
3383
+ onMousedown: oa,
3384
+ onMousemove: la,
3385
+ onMouseup: na,
3386
+ onMouseleave: aa,
3387
+ onDblclick: ia,
3388
+ onWheel: re(sa, ["prevent"]),
3389
+ onFocus: Rn,
3390
+ onKeydown: kl,
3391
+ onContextmenu: ra,
3392
+ onTouchstart: re(ua, ["prevent"]),
3393
+ onTouchmove: re(ca, ["prevent"]),
3394
+ onTouchend: da
1509
3395
  }, null, 544),
1510
- $("input", {
3396
+ c("input", {
1511
3397
  ref_key: "editInputRef",
1512
- ref: Ct,
3398
+ ref: po,
1513
3399
  class: "cell-editor",
1514
- value: O.value,
1515
- style: Ce(ln.value),
1516
- onInput: yn,
1517
- onKeydown: Cn,
1518
- onCompositionstart: Bn,
1519
- onCompositionend: xn,
1520
- onBlur: Sn
1521
- }, null, 44, qn),
1522
- De.value > 0 ? (j(), P("div", {
3400
+ value: V.value,
3401
+ style: Me(qn.value),
3402
+ onInput: fa,
3403
+ onKeydown: ma,
3404
+ onCompositionstart: va,
3405
+ onCompositionend: ba,
3406
+ onBlur: ha
3407
+ }, null, 44, si),
3408
+ vt.value > 0 ? (S(), H("div", {
1523
3409
  key: 0,
1524
3410
  class: "v-scrollbar",
1525
- style: Ce({ top: se(y) + "px", height: `calc(100% - ${se(y) + se(Q)}px)` })
3411
+ style: Me({ top: G(W) + "px", height: `calc(100% - ${G(W) + G(Se)}px)` })
1526
3412
  }, [
1527
- $("button", {
3413
+ c("button", {
1528
3414
  class: "sb-btn sb-btn--up",
1529
- title: se(C)(s.value, "scrollUp"),
1530
- onMousedown: t[3] || (t[3] = ue((n) => {
1531
- z(null, T.value - 50), v();
3415
+ title: G(B)(s.value, "scrollUp"),
3416
+ onMousedown: t[15] || (t[15] = re((o) => {
3417
+ fe(null, O.value - 50), y();
1532
3418
  }, ["prevent"]))
1533
- }, [...t[8] || (t[8] = [
1534
- $("span", { class: "sb-arrow sb-arrow--up" }, null, -1)
1535
- ])], 40, Gn),
1536
- $("div", {
3419
+ }, [...t[29] || (t[29] = [
3420
+ c("span", { class: "sb-arrow sb-arrow--up" }, null, -1)
3421
+ ])], 40, ui),
3422
+ c("div", {
1537
3423
  class: "sb-track sb-track--v",
1538
- onMousedown: un
3424
+ onMousedown: ea
1539
3425
  }, [
1540
- $("div", {
3426
+ c("div", {
1541
3427
  class: "sb-thumb sb-thumb--v",
1542
- style: Ce({ top: Dt.value + "px", height: at.value + "px" }),
1543
- onMousedown: an
3428
+ style: Me({ top: xo.value + "px", height: jt.value + "px" }),
3429
+ onMousedown: Jn
1544
3430
  }, null, 36)
1545
3431
  ], 32),
1546
- $("button", {
3432
+ c("button", {
1547
3433
  class: "sb-btn sb-btn--down",
1548
- title: se(C)(s.value, "scrollDown"),
1549
- onMousedown: t[4] || (t[4] = ue((n) => {
1550
- z(null, T.value + 50), v();
3434
+ title: G(B)(s.value, "scrollDown"),
3435
+ onMousedown: t[16] || (t[16] = re((o) => {
3436
+ fe(null, O.value + 50), y();
1551
3437
  }, ["prevent"]))
1552
- }, [...t[9] || (t[9] = [
1553
- $("span", { class: "sb-arrow sb-arrow--down" }, null, -1)
1554
- ])], 40, Qn)
1555
- ], 4)) : Fe("", !0),
1556
- Te.value > 0 ? (j(), P("div", {
3438
+ }, [...t[30] || (t[30] = [
3439
+ c("span", { class: "sb-arrow sb-arrow--down" }, null, -1)
3440
+ ])], 40, ci)
3441
+ ], 4)) : ye("", !0),
3442
+ ft.value > 0 ? (S(), H("div", {
1557
3443
  key: 1,
1558
3444
  class: "h-scrollbar",
1559
- style: Ce({ left: se(w) + "px", width: `calc(100% - ${se(w) + se(Q)}px)` })
3445
+ style: Me({ left: G(I) + "px", width: `calc(100% - ${G(I) + G(Se)}px)` })
1560
3446
  }, [
1561
- $("button", {
3447
+ c("button", {
1562
3448
  class: "sb-btn sb-btn--left",
1563
- title: se(C)(s.value, "scrollLeft"),
1564
- onMousedown: t[5] || (t[5] = ue((n) => {
1565
- z(M.value - 50, null), v();
3449
+ title: G(B)(s.value, "scrollLeft"),
3450
+ onMousedown: t[17] || (t[17] = re((o) => {
3451
+ fe(M.value - 50, null), y();
1566
3452
  }, ["prevent"]))
1567
- }, [...t[10] || (t[10] = [
1568
- $("span", { class: "sb-arrow sb-arrow--left" }, null, -1)
1569
- ])], 40, eo),
1570
- $("div", {
3453
+ }, [...t[31] || (t[31] = [
3454
+ c("span", { class: "sb-arrow sb-arrow--left" }, null, -1)
3455
+ ])], 40, di),
3456
+ c("div", {
1571
3457
  class: "sb-track sb-track--h",
1572
- onMousedown: sn
3458
+ onMousedown: ta
1573
3459
  }, [
1574
- $("div", {
3460
+ c("div", {
1575
3461
  class: "sb-thumb sb-thumb--h",
1576
- style: Ce({ left: Tt.value + "px", width: ot.value + "px" }),
1577
- onMousedown: rn
3462
+ style: Me({ left: Bo.value + "px", width: Xt.value + "px" }),
3463
+ onMousedown: Qn
1578
3464
  }, null, 36)
1579
3465
  ], 32),
1580
- $("button", {
3466
+ c("button", {
1581
3467
  class: "sb-btn sb-btn--right",
1582
- title: se(C)(s.value, "scrollRight"),
1583
- onMousedown: t[6] || (t[6] = ue((n) => {
1584
- z(M.value + 50, null), v();
3468
+ title: G(B)(s.value, "scrollRight"),
3469
+ onMousedown: t[18] || (t[18] = re((o) => {
3470
+ fe(M.value + 50, null), y();
1585
3471
  }, ["prevent"]))
1586
- }, [...t[11] || (t[11] = [
1587
- $("span", { class: "sb-arrow sb-arrow--right" }, null, -1)
1588
- ])], 40, to)
1589
- ], 4)) : Fe("", !0),
1590
- Te.value > 0 && De.value > 0 ? (j(), P("div", lo)) : Fe("", !0)
3472
+ }, [...t[32] || (t[32] = [
3473
+ c("span", { class: "sb-arrow sb-arrow--right" }, null, -1)
3474
+ ])], 40, fi)
3475
+ ], 4)) : ye("", !0),
3476
+ ft.value > 0 && vt.value > 0 ? (S(), H("div", vi)) : ye("", !0)
1591
3477
  ], 512),
1592
- (j(), Dn(Hn, { to: "body" }, [
1593
- fe.value ? (j(), P("div", {
1594
- key: 0,
1595
- class: "context-menu",
1596
- style: Ce({ left: fe.value.x + "px", top: fe.value.y + "px" }),
1597
- onClick: t[7] || (t[7] = ue(() => {
1598
- }, ["stop"]))
1599
- }, [
1600
- (j(!0), P(Yt, null, Ut(fe.value.items, (n, l) => (j(), P("div", {
1601
- key: l,
1602
- class: vt(["context-menu__item", { "context-menu__item--disabled": n.disabled }]),
1603
- onClick: (o) => !n.disabled && n.action && (n.action(), fe.value = null),
1604
- onMouseenter: (o) => Jl(o, n)
1605
- }, [
1606
- $("span", oo, dt(n.label), 1),
1607
- n.children ? (j(), P("span", ao)) : Fe("", !0),
1608
- n.children ? (j(), P("div", {
1609
- key: 1,
1610
- class: vt(["context-submenu", { "context-submenu--left": tt.value }])
3478
+ ke(Zr, {
3479
+ locale: s.value,
3480
+ sheets: q.value,
3481
+ "active-sheet-index": he.value,
3482
+ "ren-tab": nt.value,
3483
+ "ren-tab-val": bt.value,
3484
+ onTabClick: t[19] || (t[19] = (o) => $n(o)),
3485
+ onTabDblclick: t[20] || (t[20] = (o) => rl(o)),
3486
+ onTabContextmenu: t[21] || (t[21] = (o) => Wn(o.ev, o.i)),
3487
+ onTabRenameInput: t[22] || (t[22] = (o) => bt.value = o),
3488
+ onTabRenameKeydown: t[23] || (t[23] = (o) => Hn(o)),
3489
+ onTabRenameCommit: il,
3490
+ onTabbarContextmenu: t[24] || (t[24] = (o) => Nn(o)),
3491
+ onAddSheet: t[25] || (t[25] = (o) => {
3492
+ mo(), y();
3493
+ })
3494
+ }, null, 8, ["locale", "sheets", "active-sheet-index", "ren-tab", "ren-tab-val"]),
3495
+ (S(), ne(ae, { to: "body" }, [
3496
+ ke(xt, { name: "menu-pop" }, {
3497
+ default: St(() => [
3498
+ Ue.value ? (S(), H("div", {
3499
+ key: 0,
3500
+ class: "context-menu",
3501
+ style: Me({ left: Ue.value.x + "px", top: Ue.value.y + "px" }),
3502
+ onClick: t[26] || (t[26] = re(() => {
3503
+ }, ["stop"]))
3504
+ }, [
3505
+ (S(!0), H(Ie, null, Ve(Ue.value.items, (o, n) => (S(), H("div", {
3506
+ key: n,
3507
+ class: oe(["context-menu__item", { "context-menu__item--disabled": o.disabled }]),
3508
+ onClick: (l) => !o.disabled && o.action && (o.action(), Ue.value = null),
3509
+ onMouseenter: (l) => In(l, o)
3510
+ }, [
3511
+ c("span", mi, Le(o.label), 1),
3512
+ o.children ? (S(), H("span", hi)) : ye("", !0),
3513
+ o.children ? (S(), H("div", {
3514
+ key: 1,
3515
+ class: oe(["context-submenu", { "context-submenu--left": Yt.value }])
3516
+ }, [
3517
+ (S(!0), H(Ie, null, Ve(o.children, (l, r) => (S(), H("div", {
3518
+ key: r,
3519
+ class: oe(["context-menu__item", { "context-menu__item--disabled": l.disabled }]),
3520
+ onClick: re((d) => !l.disabled && l.action && (l.action(), Ue.value = null), ["stop"])
3521
+ }, Le(l.label), 11, pi))), 128))
3522
+ ], 2)) : ye("", !0)
3523
+ ], 42, bi))), 128))
3524
+ ], 4)) : ye("", !0)
3525
+ ]),
3526
+ _: 1
3527
+ })
3528
+ ])),
3529
+ (S(), ne(ae, { to: "body" }, [
3530
+ ke(xt, { name: "menu-pop" }, {
3531
+ default: St(() => [
3532
+ ge.value ? (S(), H("div", {
3533
+ key: 0,
3534
+ class: "dim-panel",
3535
+ style: Me({ left: ge.value.x + "px", top: ge.value.y + "px" }),
3536
+ onMousedown: t[27] || (t[27] = re(() => {
3537
+ }, ["stop"])),
3538
+ onClick: t[28] || (t[28] = re(() => {
3539
+ }, ["stop"]))
1611
3540
  }, [
1612
- (j(!0), P(Yt, null, Ut(n.children, (o, a) => (j(), P("div", {
1613
- key: a,
1614
- class: vt(["context-menu__item", { "context-menu__item--disabled": o.disabled }]),
1615
- onClick: ue((d) => !o.disabled && o.action && (o.action(), fe.value = null), ["stop"])
1616
- }, dt(o.label), 11, ro))), 128))
1617
- ], 2)) : Fe("", !0)
1618
- ], 42, no))), 128))
1619
- ], 4)) : Fe("", !0)
3541
+ c("div", gi, Le(ge.value.type === "row" ? G(B)(s.value, "rowHeight") : G(B)(s.value, "colWidth")), 1),
3542
+ c("div", yi, [
3543
+ c("input", {
3544
+ ref_key: "dimInputRef",
3545
+ ref: ul,
3546
+ class: oe(["dim-panel__input", { "dim-panel__input--error": ge.value.error }]),
3547
+ type: "number",
3548
+ step: "1",
3549
+ min: "1",
3550
+ inputmode: "numeric",
3551
+ value: ge.value.value,
3552
+ onInput: Kn,
3553
+ onKeydown: Vn
3554
+ }, null, 42, ki),
3555
+ t[33] || (t[33] = c("span", { class: "dim-panel__unit" }, "px", -1))
3556
+ ]),
3557
+ ge.value.error ? (S(), H("div", wi, Le(ge.value.error), 1)) : ye("", !0),
3558
+ c("div", Ci, [
3559
+ c("button", {
3560
+ class: "dim-panel__btn dim-panel__btn--primary",
3561
+ onClick: fl
3562
+ }, Le(G(B)(s.value, "ok")), 1),
3563
+ c("button", {
3564
+ class: "dim-panel__btn",
3565
+ onClick: ko
3566
+ }, Le(G(B)(s.value, "cancel")), 1)
3567
+ ])
3568
+ ], 36)) : ye("", !0)
3569
+ ]),
3570
+ _: 1
3571
+ })
1620
3572
  ]))
1621
3573
  ], 4));
1622
3574
  }
1623
- }), so = (u, f) => {
1624
- const s = u.__vccOpts || u;
1625
- for (const [c, r] of f)
1626
- s[c] = r;
1627
- return s;
1628
- }, io = /* @__PURE__ */ so(uo, [["__scopeId", "data-v-5100e6d6"]]);
3575
+ }), Mi = /* @__PURE__ */ Dt(xi, [["__scopeId", "data-v-59bd8e5f"]]);
1629
3576
  export {
1630
- io as Spreader,
1631
- io as default
3577
+ Mi as Spreader,
3578
+ Mi as default
1632
3579
  };