@univerjs/docs-ui 0.6.0-alpha.0 → 0.6.0-experimental.20250212-dbe9830

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.
Files changed (53) hide show
  1. package/lib/cjs/index.js +16 -16
  2. package/lib/es/index.js +694 -690
  3. package/lib/types/basics/const/default-univer-doc-config.d.ts +1 -1
  4. package/lib/types/basics/const/index.d.ts +1 -1
  5. package/lib/types/basics/const/plugin-name.d.ts +1 -1
  6. package/lib/types/basics/docs-view-key.d.ts +1 -1
  7. package/lib/types/basics/editor.d.ts +1 -1
  8. package/lib/types/basics/index.d.ts +1 -1
  9. package/lib/types/basics/interfaces/component-config/i-doc-ui-plugin-config.d.ts +1 -1
  10. package/lib/types/basics/interfaces/component-config/index.d.ts +1 -1
  11. package/lib/types/basics/interfaces/index.d.ts +1 -1
  12. package/lib/types/basics/paragraph.d.ts +2 -2
  13. package/lib/types/components/color-picker/index.d.ts +1 -1
  14. package/lib/types/components/color-picker/interface.d.ts +1 -1
  15. package/lib/types/components/const.d.ts +1 -1
  16. package/lib/types/components/font-family/index.d.ts +1 -1
  17. package/lib/types/components/font-family/interface.d.ts +1 -1
  18. package/lib/types/components/font-size/index.d.ts +1 -1
  19. package/lib/types/components/font-size/interface.d.ts +1 -1
  20. package/lib/types/components/list-type-picker/index.d.ts +1 -1
  21. package/lib/types/controllers/index.d.ts +1 -1
  22. package/lib/types/facade/index.d.ts +1 -1
  23. package/lib/types/index.d.ts +1 -1
  24. package/lib/types/locale/zh-CN.d.ts +1 -1
  25. package/lib/types/services/clipboard/__test__/html-and-udm-convert.spec.d.ts +1 -1
  26. package/lib/types/services/clipboard/html-to-udm/parse-to-dom.d.ts +1 -1
  27. package/lib/types/services/clipboard/udm-to-html/__test__/convertor.spec.d.ts +1 -1
  28. package/lib/types/services/index.d.ts +1 -1
  29. package/lib/types/types/const/padding.d.ts +1 -1
  30. package/lib/types/types/delete-direction.d.ts +1 -1
  31. package/lib/types/views/count-bar/CountBar.d.ts +1 -1
  32. package/lib/types/views/count-bar/ZoomSlider.d.ts +1 -1
  33. package/lib/types/views/count-bar/index.d.ts +1 -1
  34. package/lib/types/views/doc-container/index.d.ts +1 -1
  35. package/lib/types/views/doc-footer/DocFooter.d.ts +1 -1
  36. package/lib/types/views/doc-footer/index.d.ts +1 -1
  37. package/lib/types/views/header-footer/panel/DocHeaderFooterOptions.d.ts +1 -1
  38. package/lib/types/views/header-footer/panel/DocHeaderFooterPanel.d.ts +1 -1
  39. package/lib/types/views/header-footer/panel/component-name.d.ts +1 -1
  40. package/lib/types/views/paragraph-setting/Setting.d.ts +1 -1
  41. package/lib/types/views/paragraph-setting/hook/utils.d.ts +1 -1
  42. package/lib/types/views/paragraph-setting/index.d.ts +1 -1
  43. package/lib/types/views/rich-text-editor/hooks/index.d.ts +3 -3
  44. package/lib/types/views/rich-text-editor/index.d.ts +1 -1
  45. package/lib/types/views/table/create/TableCreate.d.ts +1 -1
  46. package/lib/types/views/table/create/component-name.d.ts +1 -1
  47. package/lib/umd/index.js +17 -17
  48. package/package.json +12 -12
  49. package/LICENSE +0 -176
  50. /package/lib/types/views/rich-text-editor/hooks/{useEditor.d.ts → use-editor.d.ts} +0 -0
  51. /package/lib/types/views/rich-text-editor/hooks/{useKeyboardEvent.d.ts → use-keyboard-event.d.ts} +0 -0
  52. /package/lib/types/views/rich-text-editor/hooks/{useLeftAndRightArrow.d.ts → use-left-and-right-arrow.d.ts} +0 -0
  53. /package/lib/types/views/rich-text-editor/hooks/{useOnChange.d.ts → use-on-change.d.ts} +0 -0
package/lib/es/index.js CHANGED
@@ -1,16 +1,16 @@
1
1
  var Pa = Object.defineProperty;
2
2
  var Da = (n, e, t) => e in n ? Pa(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
3
3
  var O = (n, e, t) => Da(n, typeof e != "symbol" ? e + "" : e, t);
4
- import { Inject as z, Disposable as he, toDisposable as $n, UniverInstanceType as _, BuildTextUtils as ve, IUniverInstanceService as N, JSONX as H, ObjectRelativeFromH as eo, ObjectRelativeFromV as st, useDependency as $, ICommandService as y, generateRandomId as mt, DisposableCollection as wn, CommandType as w, debounce as ui, Tools as X, IUndoRedoService as to, TextX as Ee, TextXActionType as j, DOC_RANGE_TYPE as Ye, RANGE_DIRECTION as xe, COLORS as tn, BooleanNumber as U, Rectangle as wa, RxDisposable as lt, DataStreamTreeTokenType as Q, ILogService as gs, isInternalEditorID as no, createIdentifier as fs, EDITOR_ACTIVATED as Nn, FOCUSING_EDITOR_STANDALONE as cr, DEFAULT_EMPTY_DOCUMENT_VALUE as hi, VerticalAlign as Na, HorizontalAlign as Pe, IContextService as ps, Direction as se, createInternalEditorID as Qa, useObservable as Qn, LocaleService as $e, DocumentFlavor as Be, PresetListType as Te, sequenceExecuteAsync as ms, FOCUSING_DOC as gn, FOCUSING_UNIVER_EDITOR as Es, FOCUSING_COMMON_DRAWINGS as gi, MemoryCursor as It, BaselineOffset as Qe, getBodySlice as fi, PRESET_LIST_TYPE as Ua, GridType as La, sortRulesFactory as Fa, UpdateDocsAttributeType as oo, TableRowHeightRule as Ha, TableSizeType as pi, TableAlignmentType as ka, TableTextWrapType as Va, SHEET_EDITOR_UNITS as sn, PositionedObjectLayoutType as so, LRUMap as Wa, ColorKit as Ar, DrawingTypeEnum as Ss, skipParseTagNames as ja, CustomRangeType as mi, DataStreamTreeNodeType as Kt, SliceBodyType as lr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Is, normalizeBody as za, SpacingRule as Mt, DEFAULT_STYLES as Ei, ThemeService as Si, DOCS_ZEN_EDITOR_UNIT_ID_KEY as et, Injector as ro, connectInjector as Ga, IConfigService as Cs, QuickListTypeMap as Oo, fromEventSubject as nn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Ya, checkForSubstrings as qa, UndoCommandId as dr, RedoCommandId as ur, DependentOn as Ka, Plugin as Xa, merge as Ja, touchDependencies as hr, mergeOverrideWithDependencies as Za } from "@univerjs/core";
5
- import { DocSelectionManagerService as G, RichTextEditingMutation as J, DocSkeletonManagerService as ie, SetTextSelectionsOperation as we, DocStateEmitService as $a, DocInterceptorService as ec } from "@univerjs/docs";
6
- import { DeviceInputEventType as Ii, ScrollBar as Vo, IRenderManagerService as pe, Liquid as Ci, GlyphType as vi, DocumentSkeletonPageType as Ce, getPageFromPath as Wo, getTableIdAndSliceIndex as gr, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as rn, getColor as on, RegularPolygon as Ri, Rect as Bn, getOffsetRectForDom as tc, ScrollTimer as nc, CURSOR_TYPE as Et, getSystemHighlightColor as oc, Vector2 as an, PageLayoutType as cn, DocumentEditArea as fe, Shape as sc, Path as fr, getCharSpaceApply as rc, getNumberUnitValue as Ge, hasListGlyph as ic, isIndentByGlyph as ac, isFirstGlyph as cc, getParagraphByGlyph as Ac, pixelToPt as lc, ptToPixel as pr, parseDataStreamToTree as dc, Viewport as uc, Layer as mr, Documents as hc, DocBackground as gc, lineIterator as fc, getLastColumn as pc, getLastLine as mc, pxToNum as bi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as Oi, UniverRenderEnginePlugin as Ec } from "@univerjs/engine-render";
7
- import { IShortcutService as io, KeyCode as W, ILayoutService as vs, MetaKeys as K, useEvent as xo, ComponentManager as ao, ISidebarService as xi, IClipboardInterfaceService as Ti, FILE_PNG_CLIPBOARD_MIME_TYPE as Sc, FILE__WEBP_CLIPBOARD_MIME_TYPE as Ic, FILE__JPEG_CLIPBOARD_MIME_TYPE as Cc, FILE__BMP_CLIPBOARD_MIME_TYPE as vc, HTML_CLIPBOARD_MIME_TYPE as yi, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Bi, CopyCommand as Rc, CutCommand as bc, PasteCommand as Oc, IConfirmService as xc, MenuItemType as Z, getMenuHiddenObservable as ee, FONT_FAMILY_LIST as Tc, FONT_SIZE_LIST as yc, RibbonStartGroup as Er, ContextMenuPosition as Mi, ContextMenuGroup as Sr, FontFamily as Bc, FontFamilyItem as Mc, FontSize as _c, BuiltInUIPart as Pc, IMenuManagerService as Dc, IUIPartsService as wc, ICanvasPopupService as Nc, imageMimeTypeSet as Qc, IContextMenuService as Uc } from "@univerjs/ui";
4
+ import { Inject as z, Disposable as he, toDisposable as Zn, UniverInstanceType as _, BuildTextUtils as ve, IUniverInstanceService as N, JSONX as H, ObjectRelativeFromH as $n, ObjectRelativeFromV as rt, ICommandService as y, generateRandomId as mt, DisposableCollection as Dn, CommandType as w, debounce as ui, Tools as X, IUndoRedoService as eo, TextX as Ee, TextXActionType as j, DOC_RANGE_TYPE as Ye, RANGE_DIRECTION as xe, COLORS as en, BooleanNumber as U, Rectangle as wa, RxDisposable as dt, DataStreamTreeTokenType as Q, ILogService as gs, isInternalEditorID as to, createIdentifier as fs, EDITOR_ACTIVATED as wn, FOCUSING_EDITOR_STANDALONE as cr, DEFAULT_EMPTY_DOCUMENT_VALUE as hi, VerticalAlign as Na, HorizontalAlign as Pe, IContextService as ps, Direction as se, createInternalEditorID as Qa, LocaleService as $e, DocumentFlavor as Be, PresetListType as Te, sequenceExecuteAsync as ms, FOCUSING_DOC as hn, FOCUSING_UNIVER_EDITOR as Es, FOCUSING_COMMON_DRAWINGS as gi, MemoryCursor as It, BaselineOffset as Ne, getBodySlice as fi, PRESET_LIST_TYPE as Ua, GridType as La, sortRulesFactory as Fa, UpdateDocsAttributeType as no, TableRowHeightRule as Ha, TableSizeType as pi, TableAlignmentType as ka, TableTextWrapType as Va, SHEET_EDITOR_UNITS as on, PositionedObjectLayoutType as oo, LRUMap as Wa, ColorKit as Ar, DrawingTypeEnum as Ss, skipParseTagNames as ja, CustomRangeType as mi, DataStreamTreeNodeType as qt, SliceBodyType as lr, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as Is, normalizeBody as za, SpacingRule as Mt, DEFAULT_STYLES as Ei, ThemeService as Si, DOCS_ZEN_EDITOR_UNIT_ID_KEY as et, Injector as so, IConfigService as Cs, QuickListTypeMap as Oo, fromEventSubject as tn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Ga, checkForSubstrings as Ya, UndoCommandId as dr, RedoCommandId as ur, DependentOn as qa, Plugin as Ka, merge as Xa, touchDependencies as hr, mergeOverrideWithDependencies as Ja } from "@univerjs/core";
5
+ import { DocSelectionManagerService as G, RichTextEditingMutation as J, DocSkeletonManagerService as ie, SetTextSelectionsOperation as we, DocStateEmitService as Za, DocInterceptorService as $a } from "@univerjs/docs";
6
+ import { DeviceInputEventType as Ii, ScrollBar as Vo, IRenderManagerService as pe, Liquid as Ci, GlyphType as vi, DocumentSkeletonPageType as Ce, getPageFromPath as Wo, getTableIdAndSliceIndex as gr, NORMAL_TEXT_SELECTION_PLUGIN_STYLE as sn, getColor as nn, RegularPolygon as Ri, Rect as yn, getOffsetRectForDom as ec, ScrollTimer as tc, CURSOR_TYPE as Et, getSystemHighlightColor as nc, Vector2 as rn, PageLayoutType as an, DocumentEditArea as fe, Shape as oc, Path as fr, getCharSpaceApply as sc, getNumberUnitValue as Ge, hasListGlyph as rc, isIndentByGlyph as ic, isFirstGlyph as ac, getParagraphByGlyph as cc, pixelToPt as Ac, ptToPixel as pr, parseDataStreamToTree as lc, Viewport as dc, Layer as mr, Documents as uc, DocBackground as hc, lineIterator as gc, getLastColumn as fc, getLastLine as pc, pxToNum as bi, TRANSFORM_CHANGE_OBSERVABLE_TYPE as Oi, UniverRenderEnginePlugin as mc } from "@univerjs/engine-render";
7
+ import { useDependency as $, IShortcutService as ro, KeyCode as W, ILayoutService as vs, MetaKeys as K, useEvent as xo, useObservable as Nn, ComponentManager as io, ISidebarService as xi, IClipboardInterfaceService as Ti, FILE_PNG_CLIPBOARD_MIME_TYPE as Ec, FILE__WEBP_CLIPBOARD_MIME_TYPE as Sc, FILE__JPEG_CLIPBOARD_MIME_TYPE as Ic, FILE__BMP_CLIPBOARD_MIME_TYPE as Cc, HTML_CLIPBOARD_MIME_TYPE as yi, PLAIN_TEXT_CLIPBOARD_MIME_TYPE as Bi, CopyCommand as vc, CutCommand as Rc, PasteCommand as bc, IConfirmService as Oc, MenuItemType as Z, getMenuHiddenObservable as ee, FONT_FAMILY_LIST as xc, FONT_SIZE_LIST as Tc, RibbonStartGroup as Er, ContextMenuPosition as Mi, ContextMenuGroup as Sr, FontFamily as yc, FontFamilyItem as Bc, FontSize as Mc, BuiltInUIPart as _c, connectInjector as Pc, IMenuManagerService as Dc, IUIPartsService as wc, ICanvasPopupService as Nc, imageMimeTypeSet as Qc, IContextMenuService as Uc } from "@univerjs/ui";
8
8
  import * as Lc from "react";
9
- import Ir, { useMemo as He, useEffect as be, useCallback as _i, useState as Re, useLayoutEffect as Fc, useRef as An, forwardRef as Ct, useImperativeHandle as Hc, createElement as Ht } from "react";
9
+ import Ir, { useMemo as Fe, useEffect as be, useCallback as _i, useState as Re, useLayoutEffect as Fc, useRef as cn, forwardRef as Ct, useImperativeHandle as Hc, createElement as Ht } from "react";
10
10
  import { jsx as V, jsxs as ce } from "react/jsx-runtime";
11
- import { Subject as Se, BehaviorSubject as Fe, merge as Pi, filter as Un, takeUntil as rt, fromEvent as Le, combineLatest as co, Observable as me, map as fn, distinctUntilChanged as Cr, throttleTime as Di, switchMap as kc, take as Vc, animationFrameScheduler as Wc } from "rxjs";
11
+ import { Subject as Se, BehaviorSubject as Le, merge as Pi, filter as Qn, takeUntil as it, fromEvent as Ue, combineLatest as ao, Observable as me, map as gn, distinctUntilChanged as Cr, throttleTime as Di, switchMap as kc, take as Vc, animationFrameScheduler as Wc } from "rxjs";
12
12
  import { filter as jo, bufferTime as jc, map as zc } from "rxjs/operators";
13
- import { Checkbox as vr, InputNumber as ln, Button as Gc, Slider as Yc, Tooltip as qc, Select as Kc, ColorPicker as Xc } from "@univerjs/design";
13
+ import { Checkbox as vr, InputNumber as An, Button as Gc, Slider as Yc, Tooltip as qc, Select as Kc, ColorPicker as Xc } from "@univerjs/design";
14
14
  import { ImageSourceType as Rs } from "@univerjs/drawing";
15
15
  var Jc = Object.defineProperty, Zc = Object.getOwnPropertyDescriptor, $c = (n, e, t, o) => {
16
16
  for (var s = o > 1 ? void 0 : o ? Zc(e, t) : e, r = n.length - 1, i; r >= 0; r--)
@@ -46,7 +46,7 @@ let St = class extends he {
46
46
  return t ? (t.push(e), t.sort((o, s) => {
47
47
  var r, i;
48
48
  return ((r = s.priority) != null ? r : 0) - ((i = o.priority) != null ? i : 0);
49
- })) : this._matches.set(e.id, [e]), $n(() => {
49
+ })) : this._matches.set(e.id, [e]), Zn(() => {
50
50
  const o = this._matches.get(e.id);
51
51
  if (o) {
52
52
  const s = o.findIndex((r) => r === e);
@@ -120,7 +120,7 @@ const tA = {
120
120
  }, oA = "DOC_UI_PLUGIN";
121
121
  var ze = /* @__PURE__ */ ((n) => (n.MAIN = "__Document_Render_Main__", n.BACKGROUND = "__Document_Render_Background__", n))(ze || {}), Je = /* @__PURE__ */ ((n) => (n.VIEW_MAIN = "viewMain", n.VIEW_TOP = "viewTop", n.VIEW_LEFT = "viewLeft", n.VIEW_LEFT_TOP = "viewLeftTop", n))(Je || {});
122
122
  const sA = 0, To = 2, rA = 4, br = 10, Xg = "normalTextSelectionPluginName";
123
- function it(n) {
123
+ function at(n) {
124
124
  const { mainComponent: e, scene: t, engine: o, components: s } = n, r = e, i = s.get(ze.BACKGROUND);
125
125
  return {
126
126
  document: r,
@@ -206,30 +206,32 @@ function $g(n, e) {
206
206
  function ef(n, e) {
207
207
  return e.some((t) => n.startIndex > t.startIndex && n.startIndex < t.endIndex);
208
208
  }
209
- function Ao(n, e, t, o, s) {
210
- const r = {
209
+ function co(n, e, t, o, s) {
210
+ const { textRuns: r = [], dataStream: i } = n, a = s && i.startsWith("="), c = {
211
211
  st: 0,
212
212
  ed: 0,
213
213
  ts: s ? {} : t
214
214
  };
215
- for (let i = n.length - 1; i >= 0; i--) {
216
- const a = n[i], { st: c, ed: A } = a;
217
- e > c && e <= A && (r.st = c, r.ed = A, r.ts = {
218
- ...r.ts,
219
- ...a.ts
215
+ if (a)
216
+ return c;
217
+ for (let A = r.length - 1; A >= 0; A--) {
218
+ const l = r[A], { st: d, ed: h } = l;
219
+ e > d && e <= h && (c.st = d, c.ed = h, c.ts = {
220
+ ...c.ts,
221
+ ...l.ts
220
222
  });
221
223
  }
222
224
  if (e === 0) {
223
- const i = n == null ? void 0 : n[0];
224
- i && i.st === 0 && (r.ts = {
225
- ...r.ts,
226
- ...i.ts
225
+ const A = r == null ? void 0 : r[0];
226
+ A && A.st === 0 && (c.ts = {
227
+ ...c.ts,
228
+ ...A.ts
227
229
  });
228
230
  }
229
- return o && (r.ts = {
230
- ...r.ts,
231
+ return o && (c.ts = {
232
+ ...c.ts,
231
233
  ...o
232
- }), r;
234
+ }), c;
233
235
  }
234
236
  function bs(n, e, t) {
235
237
  if (t) {
@@ -257,22 +259,22 @@ function nf(n, e = 0, t = 0) {
257
259
  height: n.height
258
260
  },
259
261
  positionH: {
260
- relativeFrom: eo.MARGIN,
262
+ relativeFrom: $n.MARGIN,
261
263
  posOffset: (n.left || 0) - e
262
264
  },
263
265
  positionV: {
264
- relativeFrom: st.PAGE,
266
+ relativeFrom: rt.PAGE,
265
267
  posOffset: (n.top || 0) - t
266
268
  },
267
269
  angle: n.angle || 0
268
270
  };
269
271
  }
270
272
  function cA(n, e, t) {
271
- const o = $(y), s = $(io), r = He(() => mt(4), []);
273
+ const o = $(y), s = $(ro), r = Fe(() => mt(4), []);
272
274
  be(() => {
273
275
  if (!t || !n || !e)
274
276
  return;
275
- const a = `sheet.operation.editor-${t.getEditorId()}-keyboard-${r}`, c = new wn();
277
+ const a = `sheet.operation.editor-${t.getEditorId()}-keyboard-${r}`, c = new Dn();
276
278
  return c.add(o.registerCommand({
277
279
  id: a,
278
280
  type: w.OPERATION,
@@ -306,7 +308,7 @@ const AA = (n, e = !0, t, o) => {
306
308
  height: l
307
309
  }), a == null || a.resize(A, l);
308
310
  }
309
- }, [n, e]), r = He(() => ui(() => {
311
+ }, [n, e]), r = Fe(() => ui(() => {
310
312
  var E, I;
311
313
  if (!t || !n || !t)
312
314
  return;
@@ -357,11 +359,11 @@ function wi(n) {
357
359
  } else for (t in n) n[t] && (o && (o += " "), o += t);
358
360
  return o;
359
361
  }
360
- function Ln() {
362
+ function Un() {
361
363
  for (var n, e, t = 0, o = "", s = arguments.length; t < s; t++) (n = arguments[t]) && (e = wi(n)) && (o && (o += " "), o += e);
362
364
  return o;
363
365
  }
364
- function Ve(n, e) {
366
+ function ke(n, e) {
365
367
  var o;
366
368
  return (o = n.get(pe).getRenderById(e)) == null ? void 0 : o.with(ie);
367
369
  }
@@ -463,7 +465,7 @@ const Ni = {
463
465
  id: "doc.command-cover-content",
464
466
  type: w.COMMAND,
465
467
  handler: async (n, e) => {
466
- const { unitId: t, body: o, segmentId: s = "" } = e, r = n.get(N), i = n.get(y), a = n.get(to), c = r.getUniverDocInstance(t), A = c == null ? void 0 : c.getSnapshot().body;
468
+ const { unitId: t, body: o, segmentId: s = "" } = e, r = n.get(N), i = n.get(y), a = n.get(eo), c = r.getUniverDocInstance(t), A = c == null ? void 0 : c.getSnapshot().body;
467
469
  if (c == null || A == null)
468
470
  return !1;
469
471
  const l = Qi(t, s, c, A, o);
@@ -528,7 +530,7 @@ const hA = {
528
530
  return h.params.actions = u.editOp(d.serialize(), g), h.params.textRanges = s, i && (h.params.options = i), !!c.syncExecuteCommand(h.id, h.params);
529
531
  }
530
532
  };
531
- var Mn = /* @__PURE__ */ ((n) => (n[n.page = 0] = "page", n[n.section = 1] = "section", n[n.column = 2] = "column", n[n.line = 3] = "line", n[n.divide = 4] = "divide", n[n.glyph = 5] = "glyph", n))(Mn || {});
533
+ var Bn = /* @__PURE__ */ ((n) => (n[n.page = 0] = "page", n[n.section = 1] = "section", n[n.column = 2] = "column", n[n.line = 3] = "line", n[n.divide = 4] = "divide", n[n.glyph = 5] = "glyph", n))(Bn || {});
532
534
  const yt = {
533
535
  page: 0,
534
536
  section: 1,
@@ -590,7 +592,7 @@ function Go(n) {
590
592
  y: t
591
593
  }), r;
592
594
  }
593
- class at {
595
+ class ct {
594
596
  constructor(e, t) {
595
597
  O(this, "_liquid", new Ci());
596
598
  O(this, "_currentStartState", {
@@ -635,7 +637,7 @@ class at {
635
637
  return;
636
638
  const { x: S, y: C } = this._liquid;
637
639
  let T, x;
638
- const P = v[A], b = v[l], B = v[A - 1], M = (P == null ? void 0 : P.left) || 0, F = (P == null ? void 0 : P.width) || 0, L = (b == null ? void 0 : b.left) || 0, D = (b == null ? void 0 : b.width) || 0, te = (P == null ? void 0 : P.glyphType) === vi.LIST, { startOffset: q, endOffset: k } = gA(v, A, l, R), Y = a.glyph === A && d ? a.isBack : !0, oe = c.glyph === l && h ? c.isBack : !1, Ae = a === c, ge = Y && B != null ? B : P;
640
+ const P = v[A], b = v[l], B = v[A - 1], M = (P == null ? void 0 : P.left) || 0, F = (P == null ? void 0 : P.width) || 0, L = (b == null ? void 0 : b.left) || 0, D = (b == null ? void 0 : b.width) || 0, te = (P == null ? void 0 : P.glyphType) === vi.LIST, { startOffset: Y, endOffset: k } = gA(v, A, l, R), q = a.glyph === A && d ? a.isBack : !0, oe = c.glyph === l && h ? c.isBack : !1, Ae = a === c, ge = q && B != null ? B : P;
639
641
  if (A === 0 && l === v.length - 1)
640
642
  T = {
641
643
  startX: S + M + (te ? F : 0),
@@ -649,7 +651,7 @@ class at {
649
651
  endY: C + m + p + ge.bBox.bd
650
652
  };
651
653
  else {
652
- const le = Y && !te;
654
+ const le = q && !te;
653
655
  T = {
654
656
  startX: S + M + (le ? 0 : F),
655
657
  startY: C,
@@ -663,7 +665,7 @@ class at {
663
665
  };
664
666
  }
665
667
  o.push(Go(T)), s.push(Go(x)), r.push({
666
- startOffset: Y ? q : q + P.count,
668
+ startOffset: q ? Y : Y + P.count,
667
669
  endOffset: oe ? k : k + b.count,
668
670
  collapsed: Ae
669
671
  });
@@ -702,7 +704,7 @@ class at {
702
704
  _checkPreviousNodePositionState(e, t = !0) {
703
705
  let o = e, s;
704
706
  for (; o >= 0; ) {
705
- const r = Mn[o];
707
+ const r = Bn[o];
706
708
  let i;
707
709
  if (t ? i = this._currentStartState[r] : i = this._currentEndState[r], i === void 0)
708
710
  return;
@@ -714,7 +716,7 @@ class at {
714
716
  }
715
717
  _getSelectionRuler(e, t, o, s, r) {
716
718
  let i = 0, a = s;
717
- const c = Mn[e], A = Mn[e + 1];
719
+ const c = Bn[e], A = Bn[e + 1];
718
720
  if (A === null || c === null)
719
721
  return {
720
722
  start_next: i,
@@ -777,8 +779,8 @@ class at {
777
779
  }
778
780
  case Ce.CELL: {
779
781
  this._liquid.translatePagePadding(C);
780
- const L = b.parent, D = L.parent, { left: te } = b, { top: q, left: k } = D, { top: Y } = L;
781
- this._liquid.translate(k + te, q + Y), this._liquid.translatePagePadding(b);
782
+ const L = b.parent, D = L.parent, { left: te } = b, { top: Y, left: k } = D, { top: q } = L;
783
+ this._liquid.translate(k + te, Y + q), this._liquid.translatePagePadding(b);
782
784
  break;
783
785
  }
784
786
  default:
@@ -786,7 +788,7 @@ class at {
786
788
  break;
787
789
  }
788
790
  for (let L = M; L <= F; L++) {
789
- const D = B[L], te = D.columns, { start_next: q, end_next: k } = this._getSelectionRuler(
791
+ const D = B[L], te = D.columns, { start_next: Y, end_next: k } = this._getSelectionRuler(
790
792
  yt.section,
791
793
  e,
792
794
  t,
@@ -794,17 +796,17 @@ class at {
794
796
  L
795
797
  );
796
798
  this._liquid.translateSection(D);
797
- for (let Y = q; Y <= k; Y++) {
798
- const oe = te[Y], Ae = oe.lines, { start_next: ge, end_next: le } = this._getSelectionRuler(
799
+ for (let q = Y; q <= k; q++) {
800
+ const oe = te[q], Ae = oe.lines, { start_next: ge, end_next: le } = this._getSelectionRuler(
799
801
  yt.column,
800
802
  e,
801
803
  t,
802
804
  Ae.length - 1,
803
- Y
805
+ q
804
806
  );
805
807
  this._liquid.translateColumn(oe);
806
808
  for (let ne = ge; ne <= le; ne++) {
807
- const ae = Ae[ne], { divides: ye } = ae, { start_next: je, end_next: ht } = this._getSelectionRuler(
809
+ const ae = Ae[ne], { divides: ye } = ae, { start_next: We, end_next: ot } = this._getSelectionRuler(
808
810
  yt.line,
809
811
  e,
810
812
  t,
@@ -812,18 +814,18 @@ class at {
812
814
  ne
813
815
  );
814
816
  this._liquid.translateSave(), this._liquid.translateLine(ae, !0, !1);
815
- for (let Ne = je; Ne <= ht; Ne++) {
816
- const qt = ye[Ne];
817
- this._liquid.translateSave(), this._liquid.translateDivide(qt);
818
- const { glyphGroup: Ba } = qt, { start_next: Ma, end_next: _a } = this._getSelectionRuler(
817
+ for (let je = We; je <= ot; je++) {
818
+ const bo = ye[je];
819
+ this._liquid.translateSave(), this._liquid.translateDivide(bo);
820
+ const { glyphGroup: Ba } = bo, { start_next: Ma, end_next: _a } = this._getSelectionRuler(
819
821
  yt.divide,
820
822
  e,
821
823
  t,
822
824
  Ba.length - 1,
823
- Ne
825
+ je
824
826
  );
825
827
  let ir = !1, ar = !1;
826
- S === E && L === M && Y === q && ne === ge && Ne === je && (ir = !0), S === I && L === F && Y === k && ne === le && Ne === ht && (ar = !0), o && o(Ma, _a, ir, ar, qt, ae, oe, D, b), this._liquid.translateRestore();
828
+ S === E && L === M && q === Y && ne === ge && je === We && (ir = !0), S === I && L === F && q === k && ne === le && je === ot && (ar = !0), o && o(Ma, _a, ir, ar, bo, ae, oe, D, b), this._liquid.translateRestore();
827
829
  }
828
830
  this._liquid.translateRestore();
829
831
  }
@@ -992,7 +994,7 @@ class Fi {
992
994
  }
993
995
  }
994
996
  const mA = "__TestSelectionRange__", EA = "__TestSelectionAnchor__", xr = 6, Bo = 500, SA = 500, Yo = 3;
995
- function _n(n) {
997
+ function Mn(n) {
996
998
  const e = n[0], t = e[0], o = e[2], { x: s, y: r } = t, { x: i, y: a } = o;
997
999
  return {
998
1000
  left: s,
@@ -1015,7 +1017,7 @@ function Ts(n) {
1015
1017
  });
1016
1018
  }
1017
1019
  class _t {
1018
- constructor(e, t, o, s, r, i = rn, a = "", c = -1) {
1020
+ constructor(e, t, o, s, r, i = sn, a = "", c = -1) {
1019
1021
  O(this, "rangeType", Ye.TEXT);
1020
1022
  // Identifies whether the range is the current one, most of which is the last range.
1021
1023
  O(this, "_current", !1);
@@ -1088,12 +1090,12 @@ class _t {
1088
1090
  const e = this.anchorNodePosition, t = this.focusNodePosition;
1089
1091
  if (this._isEmpty())
1090
1092
  return;
1091
- const o = this._document.getOffsetConfig(), { docsLeft: s, docsTop: r } = o, i = new at(o, this._docSkeleton);
1093
+ const o = this._document.getOffsetConfig(), { docsLeft: s, docsTop: r } = o, i = new ct(o, this._docSkeleton);
1092
1094
  if (this._isCollapsed()) {
1093
1095
  const { contentBoxPointGroup: l, cursorList: d } = i.getRangePointData(e, e);
1094
1096
  if (this._setCursorList(d), l.length === 0)
1095
1097
  return;
1096
- const h = _n(l);
1098
+ const h = Mn(l);
1097
1099
  return {
1098
1100
  ...h,
1099
1101
  left: h.left + s,
@@ -1103,7 +1105,7 @@ class _t {
1103
1105
  const { borderBoxPointGroup: a, cursorList: c } = i.getRangePointData(e, t);
1104
1106
  if (this._setCursorList(c), a.length === 0)
1105
1107
  return;
1106
- const A = _n(a);
1108
+ const A = Mn(a);
1107
1109
  return {
1108
1110
  ...A,
1109
1111
  left: A.left + s,
@@ -1116,13 +1118,13 @@ class _t {
1116
1118
  activeStatic() {
1117
1119
  var e, t;
1118
1120
  (t = this._anchorShape) == null || t.setProps({
1119
- stroke: ((e = this.style) == null ? void 0 : e.strokeActive) || on(tn.black, 1)
1121
+ stroke: ((e = this.style) == null ? void 0 : e.strokeActive) || nn(en.black, 1)
1120
1122
  });
1121
1123
  }
1122
1124
  deactivateStatic() {
1123
1125
  var e, t;
1124
1126
  (t = this._anchorShape) == null || t.setProps({
1125
- stroke: ((e = this.style) == null ? void 0 : e.stroke) || on(tn.black, 0)
1127
+ stroke: ((e = this.style) == null ? void 0 : e.stroke) || nn(en.black, 0)
1126
1128
  });
1127
1129
  }
1128
1130
  isActive() {
@@ -1148,7 +1150,7 @@ class _t {
1148
1150
  const { _document: e, _docSkeleton: t } = this, o = this.anchorNodePosition, s = this.focusNodePosition;
1149
1151
  if ((d = this._anchorShape) == null || d.hide(), (h = this._rangeShape) == null || h.hide(), this._isEmpty())
1150
1152
  return;
1151
- const r = e.getOffsetConfig(), { docsLeft: i, docsTop: a } = r, c = new at(r, t);
1153
+ const r = e.getOffsetConfig(), { docsLeft: i, docsTop: a } = r, c = new ct(r, t);
1152
1154
  if (this._isCollapsed()) {
1153
1155
  const { contentBoxPointGroup: u, cursorList: g } = c.getRangePointData(o, o);
1154
1156
  if (this._setCursorList(g), u.length > 0) {
@@ -1185,7 +1187,7 @@ class _t {
1185
1187
  }
1186
1188
  const s = 0.3, r = new Ri(mA + X.generateRandomId(xr), {
1187
1189
  pointsGroup: e,
1188
- fill: ((i = this.style) == null ? void 0 : i.fill) || on(tn.black, s),
1190
+ fill: ((i = this.style) == null ? void 0 : i.fill) || nn(en.black, s),
1189
1191
  left: t,
1190
1192
  top: o,
1191
1193
  evented: !1,
@@ -1195,7 +1197,7 @@ class _t {
1195
1197
  }
1196
1198
  _createOrUpdateAnchor(e, t, o, s) {
1197
1199
  var f, p, m;
1198
- const r = _n(e), { left: i } = r;
1200
+ const r = Mn(e), { left: i } = r;
1199
1201
  let { top: a, height: c } = r;
1200
1202
  const A = 14;
1201
1203
  c < A && (a -= A - c, c = A);
@@ -1206,12 +1208,12 @@ class _t {
1206
1208
  this._anchorShape.transformByState({ left: d, top: h, height: c }), this._anchorShape.show(), u ? this._anchorShape.skew(-12, 0) : this._anchorShape.skew(0, 0);
1207
1209
  return;
1208
1210
  }
1209
- const g = new Bn(EA + X.generateRandomId(xr), {
1211
+ const g = new yn(EA + X.generateRandomId(xr), {
1210
1212
  left: d,
1211
1213
  top: h,
1212
1214
  height: c,
1213
1215
  strokeWidth: ((p = this.style) == null ? void 0 : p.strokeWidth) || 1.5,
1214
- stroke: ((m = this.style) == null ? void 0 : m.strokeActive) || on(tn.black, 1),
1216
+ stroke: ((m = this.style) == null ? void 0 : m.strokeActive) || nn(en.black, 1),
1215
1217
  evented: !1
1216
1218
  });
1217
1219
  u && g.skew(-12, 0), this._anchorShape = g, this._scene.addObject(g, Yo), this.activeStatic();
@@ -1221,7 +1223,7 @@ class _t {
1221
1223
  }
1222
1224
  }
1223
1225
  const IA = "__DocTableRectRange__", CA = 6;
1224
- function Mo(n, e, t, o, s, r = rn, i = "", a = -1) {
1226
+ function Mo(n, e, t, o, s, r = sn, i = "", a = -1) {
1225
1227
  const c = e.getOffsetConfig(), l = new Fi(c, t).getNodePositionGroup(o, s);
1226
1228
  return (l != null ? l : []).map((d) => new Hi(
1227
1229
  n,
@@ -1235,7 +1237,7 @@ function Mo(n, e, t, o, s, r = rn, i = "", a = -1) {
1235
1237
  ));
1236
1238
  }
1237
1239
  class Hi {
1238
- constructor(e, t, o, s, r, i = rn, a = "", c = -1) {
1240
+ constructor(e, t, o, s, r, i = sn, a = "", c = -1) {
1239
1241
  O(this, "rangeType", Ye.RECT);
1240
1242
  // The rendered rect range
1241
1243
  O(this, "_rangeShape");
@@ -1363,7 +1365,7 @@ class Hi {
1363
1365
  }
1364
1366
  const s = 0.3, r = new Ri(IA + X.generateRandomId(CA), {
1365
1367
  pointsGroup: e,
1366
- fill: ((i = this.style) == null ? void 0 : i.fill) || on(tn.black, s),
1368
+ fill: ((i = this.style) == null ? void 0 : i.fill) || nn(en.black, s),
1367
1369
  left: t,
1368
1370
  top: o,
1369
1371
  evented: !1,
@@ -1435,26 +1437,26 @@ function qo(n, e, t, o, s, r, i, a) {
1435
1437
  if (P) {
1436
1438
  const { startIndex: B, endIndex: M, children: F } = P;
1437
1439
  let L = null, D = null;
1438
- const te = F.find((k) => k.startIndex <= f && k.endIndex >= f), q = F.find((k) => k.startIndex <= p && k.endIndex >= p);
1440
+ const te = F.find((k) => k.startIndex <= f && k.endIndex >= f), Y = F.find((k) => k.startIndex <= p && k.endIndex >= p);
1439
1441
  if (f > B && f < M)
1440
1442
  L = s.findNodePositionByCharIndex(te.startIndex + 2, !0, i, a), D = s.findNodePositionByCharIndex(M - 4, !0, i, a), m = M + 1;
1441
1443
  else if (p > B && p < M)
1442
- L = s.findNodePositionByCharIndex(B + 3, !0, i, a), D = s.findNodePositionByCharIndex(q.endIndex - 3, !0, i, a), E = B - 1, b = !0;
1444
+ L = s.findNodePositionByCharIndex(B + 3, !0, i, a), D = s.findNodePositionByCharIndex(Y.endIndex - 3, !0, i, a), E = B - 1, b = !0;
1443
1445
  else if (B > f && M < p) {
1444
1446
  if (L = s.findNodePositionByCharIndex(B + 3, !0, i, a), D = s.findNodePositionByCharIndex(M - 4, !0, i, a), m <= B - 1) {
1445
- const k = s.findNodePositionByCharIndex(m, !0, i, a), Y = s.findNodePositionByCharIndex(B - 1, !1, i, a), oe = g === xe.FORWARD ? k : Y, Ae = g === xe.FORWARD ? Y : k;
1447
+ const k = s.findNodePositionByCharIndex(m, !0, i, a), q = s.findNodePositionByCharIndex(B - 1, !1, i, a), oe = g === xe.FORWARD ? k : q, Ae = g === xe.FORWARD ? q : k;
1446
1448
  c.push(new _t(t, o, s, oe, Ae, r, i, a));
1447
1449
  }
1448
1450
  m = M + 1;
1449
1451
  }
1450
1452
  if (L && D) {
1451
- const k = g === xe.FORWARD ? L : D, Y = g === xe.FORWARD ? D : L;
1453
+ const k = g === xe.FORWARD ? L : D, q = g === xe.FORWARD ? D : L;
1452
1454
  A.push(...Mo(
1453
1455
  t,
1454
1456
  o,
1455
1457
  s,
1456
1458
  k,
1457
- Y,
1459
+ q,
1458
1460
  r,
1459
1461
  i,
1460
1462
  a
@@ -1480,7 +1482,7 @@ function bA(n) {
1480
1482
  left: 0,
1481
1483
  top: 0
1482
1484
  };
1483
- const { top: t, left: o } = tc(e);
1485
+ const { top: t, left: o } = ec(e);
1484
1486
  return {
1485
1487
  left: o,
1486
1488
  top: t
@@ -1546,8 +1548,8 @@ var xA = Object.defineProperty, TA = Object.getOwnPropertyDescriptor, yA = (n, e
1546
1548
  for (var s = o > 1 ? void 0 : o ? TA(e, t) : e, r = n.length - 1, i; r >= 0; r--)
1547
1549
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
1548
1550
  return o && s && xA(e, t, s), s;
1549
- }, vn = (n, e) => (t, o) => e(t, o, n);
1550
- let Ie = class extends lt {
1551
+ }, Cn = (n, e) => (t, o) => e(t, o, n);
1552
+ let Ie = class extends dt {
1551
1553
  constructor(e, t, o, s, r) {
1552
1554
  super();
1553
1555
  O(this, "_onInputBefore$", new Se());
@@ -1556,22 +1558,22 @@ let Ie = class extends lt {
1556
1558
  O(this, "onKeydown$", this._onKeydown$.asObservable());
1557
1559
  O(this, "_onInput$", new Se());
1558
1560
  O(this, "onInput$", this._onInput$.asObservable());
1559
- O(this, "_onCompositionstart$", new Fe(null));
1561
+ O(this, "_onCompositionstart$", new Le(null));
1560
1562
  O(this, "onCompositionstart$", this._onCompositionstart$.asObservable());
1561
- O(this, "_onCompositionupdate$", new Fe(null));
1563
+ O(this, "_onCompositionupdate$", new Le(null));
1562
1564
  O(this, "onCompositionupdate$", this._onCompositionupdate$.asObservable());
1563
- O(this, "_onCompositionend$", new Fe(null));
1565
+ O(this, "_onCompositionend$", new Le(null));
1564
1566
  O(this, "onCompositionend$", this._onCompositionend$.asObservable());
1565
- O(this, "_onSelectionStart$", new Fe(null));
1567
+ O(this, "_onSelectionStart$", new Le(null));
1566
1568
  O(this, "onSelectionStart$", this._onSelectionStart$.asObservable());
1567
1569
  O(this, "onChangeByEvent$", Pi(
1568
1570
  this._onInput$,
1569
- this._onKeydown$.pipe(Un((e) => e.event.keyCode === W.BACKSPACE)),
1571
+ this._onKeydown$.pipe(Qn((e) => e.event.keyCode === W.BACKSPACE)),
1570
1572
  this._onCompositionend$
1571
1573
  ));
1572
1574
  O(this, "_onPaste$", new Se());
1573
1575
  O(this, "onPaste$", this._onPaste$.asObservable());
1574
- O(this, "_textSelectionInner$", new Fe(null));
1576
+ O(this, "_textSelectionInner$", new Le(null));
1575
1577
  O(this, "textSelectionInner$", this._textSelectionInner$.asObservable());
1576
1578
  O(this, "_onFocus$", new Se());
1577
1579
  O(this, "onFocus$", this._onFocus$.asObservable());
@@ -1594,7 +1596,7 @@ let Ie = class extends lt {
1594
1596
  O(this, "_focusNodePosition", null);
1595
1597
  O(this, "_currentSegmentId", "");
1596
1598
  O(this, "_currentSegmentPage", -1);
1597
- O(this, "_selectionStyle", rn);
1599
+ O(this, "_selectionStyle", sn);
1598
1600
  O(this, "_onPointerEvent", !1);
1599
1601
  O(this, "_viewPortObserverMap", /* @__PURE__ */ new Map());
1600
1602
  O(this, "_isIMEInputApply", !1);
@@ -1614,7 +1616,7 @@ let Ie = class extends lt {
1614
1616
  return this.isFocusing || document.activeElement === document.body || document.activeElement === null;
1615
1617
  }
1616
1618
  _listenCurrentUnitChange() {
1617
- this._univerInstanceService.getCurrentTypeOfUnit$(_.UNIVER_DOC).pipe(rt(this.dispose$)).subscribe((e) => {
1619
+ this._univerInstanceService.getCurrentTypeOfUnit$(_.UNIVER_DOC).pipe(it(this.dispose$)).subscribe((e) => {
1618
1620
  if (e == null)
1619
1621
  return;
1620
1622
  e.getUnitId() !== this._context.unitId && !this._reserveRanges && this.removeAllRanges();
@@ -1638,7 +1640,7 @@ let Ie = class extends lt {
1638
1640
  setReserveRangesStatus(e) {
1639
1641
  this._reserveRanges = e;
1640
1642
  }
1641
- _setRangeStyle(e = rn) {
1643
+ _setRangeStyle(e = sn) {
1642
1644
  this._selectionStyle = e;
1643
1645
  }
1644
1646
  // eslint-disable-next-line max-lines-per-function
@@ -1839,7 +1841,7 @@ let Ie = class extends lt {
1839
1841
  }
1840
1842
  const { segmentId: l, segmentPage: d } = a;
1841
1843
  l && this._currentSegmentId && l !== this._currentSegmentId && this.setSegment(l), l && d !== this._currentSegmentPage && this.setSegmentPage(d), this._anchorNodePosition = c, e.shiftKey && this._getActiveRangeInstance() ? this._updateActiveRangePosition(c) : e.ctrlKey ? this._removeAllCollapsedTextRanges() : this._isEmpty() || this._removeAllRanges(), t.disableObjectsEvent();
1842
- const h = nc.create(t);
1844
+ const h = tc.create(t);
1843
1845
  this._scrollTimers.push(h), h.startScroll(r, i), this._onSelectionStart$.next((f = this._getActiveRangeInstance()) == null ? void 0 : f.startNodePosition), (p = t.getTransformer()) == null || p.clearSelectedObjects();
1844
1846
  let u = r, g = i;
1845
1847
  this._onPointerEvent = !0, this._scenePointerMoveSubs.push(t.onPointerMove$.subscribeEvent((m) => {
@@ -1886,7 +1888,7 @@ let Ie = class extends lt {
1886
1888
  }), this._scrollTimers = [];
1887
1889
  }
1888
1890
  _setSystemHighlightColorToStyle() {
1889
- const { r: e, g: t, b: o, a: s } = oc(), r = {
1891
+ const { r: e, g: t, b: o, a: s } = nc(), r = {
1890
1892
  strokeWidth: 1.5,
1891
1893
  stroke: "rgba(0, 0, 0, 0)",
1892
1894
  strokeActive: "rgba(0, 0, 0, 1)",
@@ -2076,7 +2078,7 @@ let Ie = class extends lt {
2076
2078
  this.focus();
2077
2079
  return;
2078
2080
  }
2079
- const { left: s, top: r } = o, i = this.activeViewPort.getAbsoluteVector(an.FromArray([s, r])), { x: a, y: c } = i;
2081
+ const { left: s, top: r } = o, i = this.activeViewPort.getAbsoluteVector(rn.FromArray([s, r])), { x: a, y: c } = i;
2080
2082
  let { left: A, top: l } = this._getCanvasOffset();
2081
2083
  A += a, l += c, this.activate(A, l, e);
2082
2084
  }
@@ -2146,13 +2148,13 @@ let Ie = class extends lt {
2146
2148
  // eslint-disable-next-line max-lines-per-function
2147
2149
  _initInputEvents() {
2148
2150
  this.disposeWithMe(
2149
- Le(this._input, "keydown").subscribe((e) => {
2151
+ Ue(this._input, "keydown").subscribe((e) => {
2150
2152
  this._isIMEInputApply || this._eventHandle(e, (t) => {
2151
2153
  this._onKeydown$.next(t);
2152
2154
  });
2153
2155
  })
2154
2156
  ), this.disposeWithMe(
2155
- Le(this._input, "input").subscribe((e) => {
2157
+ Ue(this._input, "input").subscribe((e) => {
2156
2158
  if (!(e.inputType === "historyUndo" || e.inputType === "historyRedo")) {
2157
2159
  if (this._rectRangeList.length > 0)
2158
2160
  return e.stopPropagation(), e.preventDefault();
@@ -2162,7 +2164,7 @@ let Ie = class extends lt {
2162
2164
  }
2163
2165
  })
2164
2166
  ), this.disposeWithMe(
2165
- Le(this._input, "compositionstart").subscribe((e) => {
2167
+ Ue(this._input, "compositionstart").subscribe((e) => {
2166
2168
  if (this._rectRangeList.length > 0)
2167
2169
  return e.stopPropagation(), e.preventDefault();
2168
2170
  this._isIMEInputApply = !0, this._eventHandle(e, (t) => {
@@ -2170,31 +2172,31 @@ let Ie = class extends lt {
2170
2172
  });
2171
2173
  })
2172
2174
  ), this.disposeWithMe(
2173
- Le(this._input, "compositionend").subscribe((e) => {
2175
+ Ue(this._input, "compositionend").subscribe((e) => {
2174
2176
  this._isIMEInputApply = !1, this._eventHandle(e, (t) => {
2175
2177
  this._onCompositionend$.next(t);
2176
2178
  });
2177
2179
  })
2178
2180
  ), this.disposeWithMe(
2179
- Le(this._input, "compositionupdate").subscribe((e) => {
2181
+ Ue(this._input, "compositionupdate").subscribe((e) => {
2180
2182
  this._eventHandle(e, (t) => {
2181
2183
  this._onInputBefore$.next(t), this._onCompositionupdate$.next(t);
2182
2184
  });
2183
2185
  })
2184
2186
  ), this.disposeWithMe(
2185
- Le(this._input, "paste").subscribe((e) => {
2187
+ Ue(this._input, "paste").subscribe((e) => {
2186
2188
  this._eventHandle(e, (t) => {
2187
2189
  this._onPaste$.next(t);
2188
2190
  });
2189
2191
  })
2190
2192
  ), this.disposeWithMe(
2191
- Le(this._input, "focus").subscribe((e) => {
2193
+ Ue(this._input, "focus").subscribe((e) => {
2192
2194
  this._eventHandle(e, (t) => {
2193
2195
  this._onFocus$.next(t);
2194
2196
  });
2195
2197
  })
2196
2198
  ), this.disposeWithMe(
2197
- Le(this._input, "blur").subscribe((e) => {
2199
+ Ue(this._input, "blur").subscribe((e) => {
2198
2200
  this._eventHandle(e, (t) => {
2199
2201
  this._onBlur$.next(t);
2200
2202
  });
@@ -2216,7 +2218,7 @@ let Ie = class extends lt {
2216
2218
  const o = this._context.mainComponent, { documentTransform: s } = o.getOffsetConfig();
2217
2219
  if (this.activeViewPort == null || s == null)
2218
2220
  return;
2219
- const r = this.activeViewPort.transformVector2SceneCoord(an.FromArray([e, t]));
2221
+ const r = this.activeViewPort.transformVector2SceneCoord(rn.FromArray([e, t]));
2220
2222
  if (r)
2221
2223
  return s.clone().invert().applyPoint(r);
2222
2224
  }
@@ -2225,7 +2227,7 @@ let Ie = class extends lt {
2225
2227
  if (s == null)
2226
2228
  return;
2227
2229
  const r = this._context.mainComponent, i = this._docSkeletonManagerService.getSkeleton(), {
2228
- pageLayoutType: a = cn.VERTICAL,
2230
+ pageLayoutType: a = an.VERTICAL,
2229
2231
  pageMarginLeft: c,
2230
2232
  pageMarginTop: A
2231
2233
  } = r.getOffsetConfig();
@@ -2242,10 +2244,10 @@ let Ie = class extends lt {
2242
2244
  }
2243
2245
  };
2244
2246
  Ie = yA([
2245
- vn(1, vs),
2246
- vn(2, gs),
2247
- vn(3, N),
2248
- vn(4, z(ie))
2247
+ Cn(1, vs),
2248
+ Cn(2, gs),
2249
+ Cn(3, N),
2250
+ Cn(4, z(ie))
2249
2251
  ], Ie);
2250
2252
  class BA extends he {
2251
2253
  constructor(t, o, s, r, i) {
@@ -2451,7 +2453,7 @@ class BA extends he {
2451
2453
  return this._param.visible;
2452
2454
  }
2453
2455
  isSheetEditor() {
2454
- return no(this._getEditorId());
2456
+ return to(this._getEditorId());
2455
2457
  }
2456
2458
  /**
2457
2459
  * @deprecated use getDocumentData.
@@ -2522,7 +2524,7 @@ let Xo = class extends he {
2522
2524
  // I moved from the layout service. https://github.com/dream-num/univer-pro/issues/1708
2523
2525
  _initUniverFocusListener() {
2524
2526
  this.disposeWithMe(
2525
- Le(window, "focusin").subscribe((e) => {
2527
+ Ue(window, "focusin").subscribe((e) => {
2526
2528
  const t = e.target;
2527
2529
  this._blurSheetEditor(t);
2528
2530
  })
@@ -2553,17 +2555,17 @@ let Xo = class extends he {
2553
2555
  }
2554
2556
  blur(e) {
2555
2557
  const t = this.getFocusEditor();
2556
- e && (t == null || t.setSelectionRanges([])), t == null || t.blur(), this._contextService.setContextValue(Nn, !1), this._contextService.setContextValue(cr, !1), this._setFocusId(null), this._blur$.next(null);
2558
+ e && (t == null || t.setSelectionRanges([])), t == null || t.blur(), this._contextService.setContextValue(wn, !1), this._contextService.setContextValue(cr, !1), this._setFocusId(null), this._blur$.next(null);
2557
2559
  }
2558
2560
  focus(e) {
2559
- if (this._focusEditorUnitId && this.blur(), e == null)
2561
+ if (e === this._focusEditorUnitId || (this._focusEditorUnitId && this.blur(), e == null))
2560
2562
  return;
2561
2563
  const t = this.getEditor(e);
2562
2564
  if (t == null)
2563
2565
  return;
2564
2566
  this._univerInstanceService.setCurrentUnitForType(e);
2565
2567
  const o = t.getValue().length;
2566
- this._contextService.setContextValue(Nn, !0), no(e) || this._contextService.setContextValue(cr, !0), t.focus(), this._setFocusId(e), this._focus$.next({
2568
+ this._contextService.setContextValue(wn, !0), to(e) || this._contextService.setContextValue(cr, !0), t.focus(), this._setFocusId(e), this._focus$.next({
2567
2569
  startOffset: o,
2568
2570
  endOffset: o
2569
2571
  });
@@ -2597,7 +2599,7 @@ let Xo = class extends he {
2597
2599
  );
2598
2600
  this._editors.set(r, h), e.scrollBar || (d = (l = (A = (c = a.mainComponent) == null ? void 0 : c.getScene()) == null ? void 0 : A.getViewports()) == null ? void 0 : l[0].getScrollBar()) == null || d.dispose();
2599
2601
  }
2600
- return $n(() => {
2602
+ return Zn(() => {
2601
2603
  this._unRegister(r);
2602
2604
  });
2603
2605
  }
@@ -2638,11 +2640,11 @@ Xo = PA([
2638
2640
  bt(2, z(G)),
2639
2641
  bt(3, ps),
2640
2642
  bt(4, y),
2641
- bt(5, to)
2643
+ bt(5, eo)
2642
2644
  ], Xo);
2643
- const ke = fs("univer.editor.service");
2645
+ const He = fs("univer.editor.service");
2644
2646
  function wA(n) {
2645
- const { editorId: e, initialValue: t, container: o, autoFocus: s, isSingle: r } = n, i = He(() => s != null ? s : !1, []), [a, c] = Re(), A = $(ke);
2647
+ const { editorId: e, initialValue: t, container: o, autoFocus: s, isSingle: r } = n, i = Fe(() => s != null ? s : !1, []), [a, c] = Re(), A = $(He);
2646
2648
  return Fc(() => {
2647
2649
  var l, d;
2648
2650
  if (o.current) {
@@ -2686,30 +2688,30 @@ function wA(n) {
2686
2688
  }
2687
2689
  }, []), a;
2688
2690
  }
2689
- const ct = {
2691
+ const At = {
2690
2692
  id: "doc.operation.move-cursor",
2691
2693
  type: w.OPERATION,
2692
2694
  handler: (n, e) => !!e
2693
- }, At = {
2695
+ }, lt = {
2694
2696
  id: "doc.operation.move-selection",
2695
2697
  type: w.OPERATION,
2696
2698
  handler: (n, e) => !!e
2697
2699
  }, NA = (n, e, t, o) => {
2698
- const s = $(y), r = $(io), i = An(e);
2700
+ const s = $(y), r = $(ro), i = cn(e);
2699
2701
  i.current = e;
2700
- const a = An(o);
2702
+ const a = cn(o);
2701
2703
  a.current = o, be(() => {
2702
2704
  if (!t || !n)
2703
2705
  return;
2704
- const A = `sheet.formula-embedding-editor.${t.getEditorId()}`, l = new wn(), d = (u, g) => {
2706
+ const A = `sheet.formula-embedding-editor.${t.getEditorId()}`, l = new Dn(), d = (u, g) => {
2705
2707
  if (a.current) {
2706
2708
  a.current(u, g);
2707
2709
  return;
2708
2710
  }
2709
2711
  let f = se.LEFT;
2710
- u === W.ARROW_DOWN ? f = se.DOWN : u === W.ARROW_UP ? f = se.UP : u === W.ARROW_RIGHT && (f = se.RIGHT), g === K.SHIFT ? s.executeCommand(At.id, {
2712
+ u === W.ARROW_DOWN ? f = se.DOWN : u === W.ARROW_UP ? f = se.UP : u === W.ARROW_RIGHT && (f = se.RIGHT), g === K.SHIFT ? s.executeCommand(lt.id, {
2711
2713
  direction: f
2712
- }) : s.executeCommand(ct.id, {
2714
+ }) : s.executeCommand(At.id, {
2713
2715
  direction: f
2714
2716
  });
2715
2717
  };
@@ -2768,7 +2770,7 @@ function QA(n, e) {
2768
2770
  };
2769
2771
  }, [n, e, t]);
2770
2772
  }
2771
- const UA = "univer-rich-text-editor-active", LA = "univer-rich-text-editor-wrap", FA = "univer-rich-text-editor-text", HA = "univer-rich-text-editor-error-wrap", kA = "univer-rich-text-editor-placeholder", Xt = {
2773
+ const UA = "univer-rich-text-editor-active", LA = "univer-rich-text-editor-wrap", FA = "univer-rich-text-editor-text", HA = "univer-rich-text-editor-error-wrap", kA = "univer-rich-text-editor-placeholder", Kt = {
2772
2774
  richTextEditorActive: UA,
2773
2775
  richTextEditorWrap: LA,
2774
2776
  richTextEditorText: FA,
@@ -2791,44 +2793,44 @@ const UA = "univer-rich-text-editor-active", LA = "univer-rich-text-editor-wrap"
2791
2793
  onChange: u,
2792
2794
  defaultHeight: g = 32,
2793
2795
  maxHeight: f = 32
2794
- } = n, p = $(ke), m = xo(s), E = xo(i), [I, v] = Re(g), R = Ir.useRef(null), S = He(() => d != null ? d : Qa(`RICH_TEXT_EDITOR-${mt(4)}`), [d]), C = wA({
2796
+ } = n, p = $(He), m = xo(s), E = xo(i), [I, v] = Re(g), R = Ir.useRef(null), S = Fe(() => d != null ? d : Qa(`RICH_TEXT_EDITOR-${mt(4)}`), [d]), C = wA({
2795
2797
  editorId: S,
2796
2798
  initialValue: r,
2797
2799
  container: R,
2798
2800
  autoFocus: o,
2799
2801
  isSingle: l
2800
2802
  }), x = $(pe).getRenderById(S), P = x == null ? void 0 : x.with(Ie), b = (te = P == null ? void 0 : P.isFocusing) != null ? te : !1, B = Ir.useRef(null), [M, F] = Re(() => {
2801
- var q, k;
2802
- return !ve.transform.getPlainText((k = (q = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : q.dataStream) != null ? k : "");
2803
- }), { checkScrollBar: L } = AA(C, l, !0, !0), D = xo((q) => {
2804
- const k = x == null ? void 0 : x.with(ie), Y = k == null ? void 0 : k.getSkeleton().getActualSize();
2805
- Y && (h == null || h(Y.actualHeight), v(Math.max(g, Math.min(Y.actualHeight + 10, f)))), u == null || u(q), L();
2803
+ var Y, k;
2804
+ return !ve.transform.getPlainText((k = (Y = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : Y.dataStream) != null ? k : "");
2805
+ }), { checkScrollBar: L } = AA(C, l, !0, !0), D = xo((Y) => {
2806
+ const k = x == null ? void 0 : x.with(ie), q = k == null ? void 0 : k.getSkeleton().getActualSize();
2807
+ q && (h == null || h(q.actualHeight), v(Math.max(g, Math.min(q.actualHeight + 10, f)))), u == null || u(Y), L();
2806
2808
  });
2807
2809
  return be(() => {
2808
- var k, Y;
2809
- F(!ve.transform.getPlainText((Y = (k = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : k.dataStream) != null ? Y : ""));
2810
- const q = C == null ? void 0 : C.selectionChange$.subscribe(() => {
2810
+ var k, q;
2811
+ F(!ve.transform.getPlainText((q = (k = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : k.dataStream) != null ? q : ""));
2812
+ const Y = C == null ? void 0 : C.selectionChange$.subscribe(() => {
2811
2813
  var oe, Ae;
2812
2814
  F(!ve.transform.getPlainText((Ae = (oe = C == null ? void 0 : C.getDocumentData().body) == null ? void 0 : oe.dataStream) != null ? Ae : ""));
2813
2815
  });
2814
- return () => q == null ? void 0 : q.unsubscribe();
2815
- }, [C]), Qn(C == null ? void 0 : C.blur$), Qn(C == null ? void 0 : C.focus$), be(() => {
2816
+ return () => Y == null ? void 0 : Y.unsubscribe();
2817
+ }, [C]), Nn(C == null ? void 0 : C.blur$), Nn(C == null ? void 0 : C.focus$), be(() => {
2816
2818
  m == null || m(b);
2817
2819
  }, [b, m]), be(() => {
2818
- const q = (k) => {
2820
+ const Y = (k) => {
2819
2821
  var oe, Ae;
2820
2822
  p.getFocusId() !== S || ((Ae = (oe = k.target) == null ? void 0 : oe.dataset) == null ? void 0 : Ae.editorid) === S || B.current && !B.current.contains(k.target) && (E == null || E());
2821
2823
  };
2822
2824
  return setTimeout(() => {
2823
- document.addEventListener("click", q);
2825
+ document.addEventListener("click", Y);
2824
2826
  }, 100), () => {
2825
- document.removeEventListener("click", q);
2827
+ document.removeEventListener("click", Y);
2826
2828
  };
2827
- }, [C, S, p, E]), NA(b && c, !1, C), cA(b, a, C), Hc(e, () => C, [C]), QA(C, D), /* @__PURE__ */ V("div", { className: Ln(Xt.richTextEditor, t), style: A, children: /* @__PURE__ */ ce(
2829
+ }, [C, S, p, E]), NA(b && c, !1, C), cA(b, a, C), Hc(e, () => C, [C]), QA(C, D), /* @__PURE__ */ V("div", { className: Un(Kt.richTextEditor, t), style: A, children: /* @__PURE__ */ ce(
2828
2830
  "div",
2829
2831
  {
2830
- className: Ln(Xt.richTextEditorWrap, {
2831
- [Xt.richTextEditorActive]: b
2832
+ className: Un(Kt.richTextEditorWrap, {
2833
+ [Kt.richTextEditorActive]: b
2832
2834
  }),
2833
2835
  style: { height: I },
2834
2836
  ref: B,
@@ -2836,24 +2838,24 @@ const UA = "univer-rich-text-editor-active", LA = "univer-rich-text-editor-wrap"
2836
2838
  /* @__PURE__ */ V(
2837
2839
  "div",
2838
2840
  {
2839
- className: Xt.richTextEditorText,
2841
+ className: Kt.richTextEditorText,
2840
2842
  ref: R,
2841
2843
  onMouseUp: () => C == null ? void 0 : C.focus()
2842
2844
  }
2843
2845
  ),
2844
- M ? /* @__PURE__ */ V("div", { className: Xt.richTextEditorPlaceholder, children: n.placeholder }) : null
2846
+ M ? /* @__PURE__ */ V("div", { className: Kt.richTextEditorPlaceholder, children: n.placeholder }) : null
2845
2847
  ]
2846
2848
  }
2847
2849
  ) });
2848
2850
  });
2849
- var Ue = function() {
2850
- return Ue = Object.assign || function(n) {
2851
+ var Qe = function() {
2852
+ return Qe = Object.assign || function(n) {
2851
2853
  for (var e, t = 1, o = arguments.length; t < o; t++) {
2852
2854
  e = arguments[t];
2853
2855
  for (var s in e) Object.prototype.hasOwnProperty.call(e, s) && (n[s] = e[s]);
2854
2856
  }
2855
2857
  return n;
2856
- }, Ue.apply(this, arguments);
2858
+ }, Qe.apply(this, arguments);
2857
2859
  }, VA = function(n, e) {
2858
2860
  var t = {};
2859
2861
  for (var o in n) Object.prototype.hasOwnProperty.call(n, o) && e.indexOf(o) < 0 && (t[o] = n[o]);
@@ -2862,16 +2864,16 @@ var Ue = function() {
2862
2864
  e.indexOf(o[s]) < 0 && Object.prototype.propertyIsEnumerable.call(n, o[s]) && (t[o[s]] = n[o[s]]);
2863
2865
  return t;
2864
2866
  }, kt = Ct(function(n, e) {
2865
- var t = n.icon, o = n.id, s = n.className, r = n.extend, i = VA(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(o, " ").concat(s || "").trim(), c = An("_".concat(zA()));
2866
- return ki(t, "".concat(o), { defIds: t.defIds, idSuffix: c.current }, Ue({ ref: e, className: a }, i), r);
2867
+ var t = n.icon, o = n.id, s = n.className, r = n.extend, i = VA(n, ["icon", "id", "className", "extend"]), a = "univerjs-icon univerjs-icon-".concat(o, " ").concat(s || "").trim(), c = cn("_".concat(zA()));
2868
+ return ki(t, "".concat(o), { defIds: t.defIds, idSuffix: c.current }, Qe({ ref: e, className: a }, i), r);
2867
2869
  });
2868
2870
  function ki(n, e, t, o, s) {
2869
- return Ht(n.tag, Ue(Ue({ key: e }, WA(n, t, s)), o), (jA(n, t).children || []).map(function(r, i) {
2871
+ return Ht(n.tag, Qe(Qe({ key: e }, WA(n, t, s)), o), (jA(n, t).children || []).map(function(r, i) {
2870
2872
  return ki(r, "".concat(e, "-").concat(n.tag, "-").concat(i), t, void 0, s);
2871
2873
  }));
2872
2874
  }
2873
2875
  function WA(n, e, t) {
2874
- var o = Ue({}, n.attrs);
2876
+ var o = Qe({}, n.attrs);
2875
2877
  t != null && t.colorChannel1 && o.fill === "colorChannel1" && (o.fill = t.colorChannel1);
2876
2878
  var s = e.defIds;
2877
2879
  return !s || s.length === 0 || (n.tag === "use" && o["xlink:href"] && (o["xlink:href"] = o["xlink:href"] + e.idSuffix), Object.entries(o).forEach(function(r) {
@@ -2881,8 +2883,8 @@ function WA(n, e, t) {
2881
2883
  }
2882
2884
  function jA(n, e) {
2883
2885
  var t, o = e.defIds;
2884
- return !o || o.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? Ue(Ue({}, n), { children: n.children.map(function(s) {
2885
- return typeof s.attrs.id == "string" && o && o.indexOf(s.attrs.id) > -1 ? Ue(Ue({}, s), { attrs: Ue(Ue({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
2886
+ return !o || o.length === 0 ? n : n.tag === "defs" && (!((t = n.children) === null || t === void 0) && t.length) ? Qe(Qe({}, n), { children: n.children.map(function(s) {
2887
+ return typeof s.attrs.id == "string" && o && o.indexOf(s.attrs.id) > -1 ? Qe(Qe({}, s), { attrs: Qe(Qe({}, s.attrs), { id: s.attrs.id + e.idSuffix }) }) : s;
2886
2888
  }) }) : n;
2887
2889
  }
2888
2890
  function zA() {
@@ -2979,7 +2981,7 @@ const ol = (n) => {
2979
2981
  let S = !1;
2980
2982
  if (g === "useFirstPageHeaderFooter" && u === !0 && ((I === fe.HEADER && !p.firstPageHeaderId || I === fe.FOOTER && !p.firstPageFooterId) && (v = !0), v && R === 0 && (S = !0)), g === "evenAndOddHeaders" && u === !0 && ((I === fe.HEADER && !p.evenPageHeaderId || I === fe.FOOTER && !p.evenPageFooterId) && (v = !0), v && R % 2 === 1 && (S = !0)), v) {
2981
2983
  const x = X.generateRandomId(6);
2982
- S && a.setSegment(x), s.executeCommand(Pn, {
2984
+ S && a.setSegment(x), s.executeCommand(_n, {
2983
2985
  unitId: i,
2984
2986
  segmentId: x,
2985
2987
  headerFooterProps: {
@@ -2995,7 +2997,7 @@ const ol = (n) => {
2995
2997
  I,
2996
2998
  T
2997
2999
  );
2998
- P && P !== x && a.setSegment(P), s.executeCommand(Pn, {
3000
+ P && P !== x && a.setSegment(P), s.executeCommand(_n, {
2999
3001
  unitId: i,
3000
3002
  headerFooterProps: {
3001
3003
  [g]: u ? U.TRUE : U.FALSE
@@ -3007,7 +3009,7 @@ const ol = (n) => {
3007
3009
  A((f) => ({
3008
3010
  ...f,
3009
3011
  [g]: u
3010
- })), await s.executeCommand(Pn, {
3012
+ })), await s.executeCommand(_n, {
3011
3013
  unitId: i,
3012
3014
  headerFooterProps: {
3013
3015
  [g]: u
@@ -3057,11 +3059,11 @@ const ol = (n) => {
3057
3059
  }
3058
3060
  ) })
3059
3061
  ] }),
3060
- /* @__PURE__ */ ce("div", { className: Ln(De.optionsSection, De.optionsMarginSetting), children: [
3062
+ /* @__PURE__ */ ce("div", { className: Un(De.optionsSection, De.optionsMarginSetting), children: [
3061
3063
  /* @__PURE__ */ ce("div", { className: De.optionsMarginItem, children: [
3062
3064
  /* @__PURE__ */ V("span", { children: e.t("headerFooter.headerTopMargin") }),
3063
3065
  /* @__PURE__ */ V(
3064
- ln,
3066
+ An,
3065
3067
  {
3066
3068
  min: 0,
3067
3069
  max: 200,
@@ -3077,7 +3079,7 @@ const ol = (n) => {
3077
3079
  /* @__PURE__ */ ce("div", { className: De.optionsMarginItem, children: [
3078
3080
  /* @__PURE__ */ V("span", { children: e.t("headerFooter.footerBottomMargin") }),
3079
3081
  /* @__PURE__ */ V(
3080
- ln,
3082
+ An,
3081
3083
  {
3082
3084
  min: 0,
3083
3085
  max: 200,
@@ -3113,7 +3115,7 @@ function il(n, e) {
3113
3115
  let r = 0;
3114
3116
  r = Math.min(t, o / 2, s / 2), n.beginPath(), n.moveTo(0, 0), n.lineTo(o, 0), n.lineTo(o, s - r), n.arc(o - r, s - r, r, 0, Math.PI / 2, !1), n.lineTo(0, s), n.lineTo(0, 0), n.closePath(), e.fill && (n.save(), n.fillStyle = e.fill, e.fillRule === "evenodd" ? n.fill("evenodd") : n.fill(), n.restore());
3115
3117
  }
3116
- class Fn extends sc {
3118
+ class Ln extends oc {
3117
3119
  constructor(t, o) {
3118
3120
  super(t, o);
3119
3121
  O(this, "color");
@@ -3152,14 +3154,14 @@ class Fn extends sc {
3152
3154
  t.restore();
3153
3155
  }
3154
3156
  _draw(t) {
3155
- Fn.drawWith(t, this);
3157
+ Ln.drawWith(t, this);
3156
3158
  }
3157
3159
  }
3158
3160
  var al = Object.defineProperty, cl = Object.getOwnPropertyDescriptor, Al = (n, e, t, o) => {
3159
3161
  for (var s = o > 1 ? void 0 : o ? cl(e, t) : e, r = n.length - 1, i; r >= 0; r--)
3160
3162
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
3161
3163
  return o && s && al(e, t, s), s;
3162
- }, ot = (n, e) => (t, o) => e(t, o, n);
3164
+ }, st = (n, e) => (t, o) => e(t, o, n);
3163
3165
  const _r = "rgba(58, 96, 247, 1)", Pr = "rgba(58, 96, 247, 0.08)";
3164
3166
  var _e = /* @__PURE__ */ ((n) => (n[n.FIRST_PAGE_HEADER = 0] = "FIRST_PAGE_HEADER", n[n.FIRST_PAGE_FOOTER = 1] = "FIRST_PAGE_FOOTER", n[n.DEFAULT_HEADER = 2] = "DEFAULT_HEADER", n[n.DEFAULT_FOOTER = 3] = "DEFAULT_FOOTER", n[n.EVEN_PAGE_HEADER = 4] = "EVEN_PAGE_HEADER", n[n.EVEN_PAGE_FOOTER = 5] = "EVEN_PAGE_FOOTER", n))(_e || {});
3165
3167
  function ll(n, e, t) {
@@ -3238,16 +3240,16 @@ let Jo = class extends he {
3238
3240
  this.disposeWithMe(e.register(qi, sl));
3239
3241
  }
3240
3242
  _init() {
3241
- const { unitId: e } = this._context, t = it(this._context);
3243
+ const { unitId: e } = this._context, t = at(this._context);
3242
3244
  t == null || t.document == null || this._loadedMap.has(t.document) || (this._initialMain(e), this._loadedMap.add(t.document));
3243
3245
  }
3244
3246
  _initialMain(e) {
3245
- const t = it(this._context), { document: o } = t;
3247
+ const t = at(this._context), { document: o } = t;
3246
3248
  this.disposeWithMe(o.onDblclick$.subscribeEvent(async (s) => {
3247
3249
  if (this._isEditorReadOnly(e) || !this._isTraditionalMode())
3248
3250
  return;
3249
3251
  const { offsetX: r, offsetY: i } = s, {
3250
- pageLayoutType: a = cn.VERTICAL,
3252
+ pageLayoutType: a = an.VERTICAL,
3251
3253
  pageMarginLeft: c,
3252
3254
  pageMarginTop: A
3253
3255
  } = o.getOffsetConfig(), l = this._getTransformCoordForDocumentOffset(r, i);
@@ -3276,10 +3278,10 @@ let Jo = class extends he {
3276
3278
  }));
3277
3279
  }
3278
3280
  _getTransformCoordForDocumentOffset(e, t) {
3279
- const o = it(this._context), { document: s, scene: r } = o, { documentTransform: i } = s.getOffsetConfig(), a = r.getViewports()[0];
3281
+ const o = at(this._context), { document: s, scene: r } = o, { documentTransform: i } = s.getOffsetConfig(), a = r.getViewports()[0];
3280
3282
  if (a == null)
3281
3283
  return;
3282
- const c = a.transformVector2SceneCoord(an.FromArray([e, t]));
3284
+ const c = a.transformVector2SceneCoord(rn.FromArray([e, t]));
3283
3285
  return i.clone().invert().applyPoint(c);
3284
3286
  }
3285
3287
  // eslint-disable-next-line max-lines-per-function
@@ -3293,25 +3295,25 @@ let Jo = class extends he {
3293
3295
  return;
3294
3296
  const { mainComponent: s } = o, r = s;
3295
3297
  this.disposeWithMe(
3296
- $n(
3298
+ Zn(
3297
3299
  // eslint-disable-next-line max-lines-per-function
3298
3300
  r.pageRender$.subscribe((i) => {
3299
3301
  if (this._editorService.isEditor(t) || !this._isTraditionalMode())
3300
3302
  return;
3301
3303
  const A = this._docSkeletonManagerService.getViewModel().getEditArea() === fe.BODY, { page: l, pageLeft: d, pageTop: h, ctx: u } = i, { pageWidth: g, pageHeight: f, marginTop: p, marginBottom: m } = l;
3302
- if (u.save(), u.translate(d - 0.5, h - 0.5), A ? (Bn.drawWith(u, {
3304
+ if (u.save(), u.translate(d - 0.5, h - 0.5), A ? (yn.drawWith(u, {
3303
3305
  left: 0,
3304
3306
  top: 0,
3305
3307
  width: g,
3306
3308
  height: p,
3307
3309
  fill: "rgba(255, 255, 255, 0.5)"
3308
- }), u.save(), u.translate(0, f - m), Bn.drawWith(u, {
3310
+ }), u.save(), u.translate(0, f - m), yn.drawWith(u, {
3309
3311
  left: 0,
3310
3312
  top: 0,
3311
3313
  width: g,
3312
3314
  height: m,
3313
3315
  fill: "rgba(255, 255, 255, 0.5)"
3314
- }), u.restore()) : (u.save(), u.translate(0, p), Bn.drawWith(u, {
3316
+ }), u.restore()) : (u.save(), u.translate(0, p), yn.drawWith(u, {
3315
3317
  left: 0,
3316
3318
  top: p,
3317
3319
  width: g,
@@ -3339,10 +3341,10 @@ let Jo = class extends he {
3339
3341
  strokeWidth: 1,
3340
3342
  stroke: _r
3341
3343
  };
3342
- fr.drawWith(u, E), fr.drawWith(u, I), u.translate(0, p + 1), Fn.drawWith(u, {
3344
+ fr.drawWith(u, E), fr.drawWith(u, I), u.translate(0, p + 1), Ln.drawWith(u, {
3343
3345
  text: e.t("headerFooter.header"),
3344
3346
  color: Pr
3345
- }), u.translate(0, f - p - m), Fn.drawWith(u, {
3347
+ }), u.translate(0, f - p - m), Ln.drawWith(u, {
3346
3348
  text: e.t("headerFooter.footer"),
3347
3349
  color: Pr
3348
3350
  });
@@ -3362,14 +3364,14 @@ let Jo = class extends he {
3362
3364
  }
3363
3365
  };
3364
3366
  Jo = Al([
3365
- ot(1, y),
3366
- ot(2, ke),
3367
- ot(3, N),
3368
- ot(4, pe),
3369
- ot(5, z(ie)),
3370
- ot(6, z(Ie)),
3371
- ot(7, z($e)),
3372
- ot(8, z(ao))
3367
+ st(1, y),
3368
+ st(2, He),
3369
+ st(3, N),
3370
+ st(4, pe),
3371
+ st(5, z(ie)),
3372
+ st(6, z(Ie)),
3373
+ st(7, z($e)),
3374
+ st(8, z(io))
3373
3375
  ], Jo);
3374
3376
  const ys = {
3375
3377
  id: "sidebar.operation.doc-header-footer-panel",
@@ -3468,8 +3470,8 @@ function Po(n, e, t, o) {
3468
3470
  }
3469
3471
  return o;
3470
3472
  }
3471
- const Pn = "doc.command.core-header-footer", Ki = {
3472
- id: Pn,
3473
+ const _n = "doc.command.core-header-footer", Ki = {
3474
+ id: _n,
3473
3475
  type: w.COMMAND,
3474
3476
  // eslint-disable-next-line max-lines-per-function
3475
3477
  handler: async (n, e) => {
@@ -3620,26 +3622,26 @@ const Pn = "doc.command.core-header-footer", Ki = {
3620
3622
  const o = n.get(St).onAutoFormat(Pt.id, e);
3621
3623
  return (await ms(o, n.get(y))).result;
3622
3624
  }
3623
- }, Sl = "doc.command.after-space", lo = {
3625
+ }, Sl = "doc.command.after-space", Ao = {
3624
3626
  id: Sl,
3625
3627
  type: w.COMMAND,
3626
3628
  async handler(n) {
3627
- const t = n.get(St).onAutoFormat(lo.id);
3629
+ const t = n.get(St).onAutoFormat(Ao.id);
3628
3630
  return (await ms(t, n.get(y))).result;
3629
3631
  }
3630
- }, dn = {
3632
+ }, ln = {
3631
3633
  id: "doc.command.enter",
3632
3634
  type: w.COMMAND,
3633
3635
  async handler(n) {
3634
- const t = n.get(St).onAutoFormat(dn.id);
3636
+ const t = n.get(St).onAutoFormat(ln.id);
3635
3637
  return (await ms(t, n.get(y))).result;
3636
3638
  }
3637
3639
  };
3638
3640
  function ue(n) {
3639
- return n.getContextValue(gn) && n.getContextValue(Es) && !n.getContextValue(gi);
3641
+ return n.getContextValue(hn) && n.getContextValue(Es) && !n.getContextValue(gi);
3640
3642
  }
3641
3643
  function Il(n) {
3642
- return n.getContextValue(gn) && n.getContextValue(Es) && !n.getContextValue(gi);
3644
+ return n.getContextValue(hn) && n.getContextValue(Es) && !n.getContextValue(gi);
3643
3645
  }
3644
3646
  const Cl = {
3645
3647
  id: Pt.id,
@@ -3658,7 +3660,7 @@ var Rl = Object.defineProperty, bl = Object.getOwnPropertyDescriptor, Ol = (n, e
3658
3660
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
3659
3661
  return o && s && Rl(e, t, s), s;
3660
3662
  }, wo = (n, e) => (t, o) => e(t, o, n);
3661
- const xl = 11, Tl = 9, Rn = {
3663
+ const xl = 11, Tl = 9, vn = {
3662
3664
  /**
3663
3665
  * fontFamily
3664
3666
  */
@@ -3692,15 +3694,15 @@ let Ze = class extends he {
3692
3694
  const e = this._univerInstanceService.getCurrentUnitForType(_.UNIVER_DOC);
3693
3695
  if (e == null)
3694
3696
  return {
3695
- ...Rn
3697
+ ...vn
3696
3698
  };
3697
3699
  const t = e == null ? void 0 : e.getUnitId(), o = (i = this._renderManagerService.getRenderById(t)) == null ? void 0 : i.with(ie), s = o == null ? void 0 : o.getViewModel();
3698
3700
  return s == null ? {
3699
- ...Rn
3701
+ ...vn
3700
3702
  } : s.getEditArea() === fe.BODY ? {
3701
- ...Rn
3703
+ ...vn
3702
3704
  } : {
3703
- ...Rn,
3705
+ ...vn,
3704
3706
  fs: Tl
3705
3707
  };
3706
3708
  }
@@ -3719,8 +3721,8 @@ Ze = Ol([
3719
3721
  wo(1, N),
3720
3722
  wo(2, pe)
3721
3723
  ], Ze);
3722
- function We(n, e, t) {
3723
- return t.executeCommand(dt.id, {
3724
+ function Ve(n, e, t) {
3725
+ return t.executeCommand(ut.id, {
3724
3726
  preCommandId: n,
3725
3727
  ...e != null ? e : {}
3726
3728
  });
@@ -3730,7 +3732,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3730
3732
  type: w.COMMAND,
3731
3733
  handler: async (n, e) => {
3732
3734
  const t = n.get(y);
3733
- return We(
3735
+ return Ve(
3734
3736
  wr,
3735
3737
  e,
3736
3738
  t
@@ -3741,7 +3743,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3741
3743
  type: w.COMMAND,
3742
3744
  handler: async (n, e) => {
3743
3745
  const t = n.get(y);
3744
- return We(
3746
+ return Ve(
3745
3747
  Nr,
3746
3748
  e,
3747
3749
  t
@@ -3752,7 +3754,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3752
3754
  type: w.COMMAND,
3753
3755
  handler: async (n, e) => {
3754
3756
  const t = n.get(y);
3755
- return We(
3757
+ return Ve(
3756
3758
  Qr,
3757
3759
  e,
3758
3760
  t
@@ -3763,7 +3765,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3763
3765
  type: w.COMMAND,
3764
3766
  handler: async (n, e) => {
3765
3767
  const t = n.get(y);
3766
- return We(
3768
+ return Ve(
3767
3769
  Ur,
3768
3770
  e,
3769
3771
  t
@@ -3774,7 +3776,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3774
3776
  type: w.COMMAND,
3775
3777
  handler: async (n, e) => {
3776
3778
  const t = n.get(y);
3777
- return We(
3779
+ return Ve(
3778
3780
  Lr,
3779
3781
  e,
3780
3782
  t
@@ -3785,7 +3787,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3785
3787
  type: w.COMMAND,
3786
3788
  handler: async (n, e) => {
3787
3789
  const t = n.get(y);
3788
- return We(
3790
+ return Ve(
3789
3791
  Fr,
3790
3792
  e,
3791
3793
  t
@@ -3796,7 +3798,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3796
3798
  type: w.COMMAND,
3797
3799
  handler: async (n, e) => {
3798
3800
  const t = n.get(y);
3799
- return We(
3801
+ return Ve(
3800
3802
  Hr,
3801
3803
  e,
3802
3804
  t
@@ -3807,7 +3809,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3807
3809
  type: w.COMMAND,
3808
3810
  handler: async (n, e) => {
3809
3811
  const t = n.get(y);
3810
- return We(
3812
+ return Ve(
3811
3813
  kr,
3812
3814
  e,
3813
3815
  t
@@ -3818,7 +3820,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3818
3820
  type: w.COMMAND,
3819
3821
  handler: async (n, e) => {
3820
3822
  const t = n.get(y);
3821
- return We(
3823
+ return Ve(
3822
3824
  Vr,
3823
3825
  e,
3824
3826
  t
@@ -3829,18 +3831,18 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3829
3831
  type: w.COMMAND,
3830
3832
  handler: async (n, e) => {
3831
3833
  const t = n.get(y);
3832
- return We(
3834
+ return Ve(
3833
3835
  Wr,
3834
3836
  e,
3835
3837
  t
3836
3838
  );
3837
3839
  }
3838
- }, jr = "doc.command.reset-inline-format-text-background-color", pn = {
3840
+ }, jr = "doc.command.reset-inline-format-text-background-color", fn = {
3839
3841
  id: jr,
3840
3842
  type: w.COMMAND,
3841
3843
  handler: async (n, e) => {
3842
3844
  const t = n.get(y);
3843
- return We(
3845
+ return Ve(
3844
3846
  jr,
3845
3847
  e,
3846
3848
  t
@@ -3855,10 +3857,10 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3855
3857
  [wt.id]: "ff",
3856
3858
  [Nt.id]: "cl",
3857
3859
  [Qt.id]: "bg",
3858
- [pn.id]: "bg",
3860
+ [fn.id]: "bg",
3859
3861
  [vt.id]: "va",
3860
3862
  [Yt.id]: "va"
3861
- }, dt = {
3863
+ }, ut = {
3862
3864
  id: "doc.command.set-inline-format",
3863
3865
  type: w.COMMAND,
3864
3866
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -3910,7 +3912,7 @@ const wr = "doc.command.set-inline-format-bold", Wt = {
3910
3912
  };
3911
3913
  break;
3912
3914
  }
3913
- case pn.id: {
3915
+ case fn.id: {
3914
3916
  g = {
3915
3917
  rgb: null
3916
3918
  };
@@ -3983,7 +3985,7 @@ function na(n, e, t) {
3983
3985
  s: U.TRUE
3984
3986
  };
3985
3987
  if (/va/.test(e))
3986
- return t === vt.id ? (n == null ? void 0 : n[e]) === Qe.SUBSCRIPT ? Qe.NORMAL : Qe.SUBSCRIPT : (n == null ? void 0 : n[e]) === Qe.SUPERSCRIPT ? Qe.NORMAL : Qe.SUPERSCRIPT;
3988
+ return t === vt.id ? (n == null ? void 0 : n[e]) === Ne.SUBSCRIPT ? Ne.NORMAL : Ne.SUBSCRIPT : (n == null ? void 0 : n[e]) === Ne.SUPERSCRIPT ? Ne.NORMAL : Ne.SUPERSCRIPT;
3987
3989
  }
3988
3990
  function oa(n, e, t) {
3989
3991
  var A, l, d, h, u, g, f, p, m, E, I, v, R, S;
@@ -4046,7 +4048,7 @@ function Bl(n, e) {
4046
4048
  const t = Zo[e];
4047
4049
  return na(n, t, e);
4048
4050
  }
4049
- const mn = {
4051
+ const pn = {
4050
4052
  id: "doc.command.list-operation",
4051
4053
  type: w.COMMAND,
4052
4054
  handler: (n, e) => {
@@ -4057,7 +4059,7 @@ const mn = {
4057
4059
  const c = a[0].segmentId, A = (I = i.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : I.paragraphs;
4058
4060
  if (A == null)
4059
4061
  return !1;
4060
- const l = En(a, A), d = i.getUnitId(), h = {
4062
+ const l = mn(a, A), d = i.getUnitId(), h = {
4061
4063
  id: J.id,
4062
4064
  params: {
4063
4065
  unitId: d,
@@ -4075,7 +4077,7 @@ const mn = {
4075
4077
  }), f = H.getInstance(), p = de(i, c);
4076
4078
  return h.params.actions = f.editOp(g.serialize(), p), !!s.syncExecuteCommand(h.id, h.params);
4077
4079
  }
4078
- }, uo = {
4080
+ }, lo = {
4079
4081
  id: "doc.command.change-list-type",
4080
4082
  type: w.COMMAND,
4081
4083
  handler: (n, e) => {
@@ -4086,7 +4088,7 @@ const mn = {
4086
4088
  const { segmentId: c } = a[0], A = (E = t.getDocRanges()) != null ? E : [], l = (I = i.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : I.paragraphs;
4087
4089
  if (l == null)
4088
4090
  return !1;
4089
- const d = En(A, l), h = i.getUnitId(), u = ve.paragraph.bullet.set({
4091
+ const d = mn(A, l), h = i.getUnitId(), u = ve.paragraph.bullet.set({
4090
4092
  paragraphs: d,
4091
4093
  listType: r,
4092
4094
  segmentId: c,
@@ -4106,7 +4108,7 @@ const mn = {
4106
4108
  return f.params.actions = g.editOp(u.serialize(), p), !!s.syncExecuteCommand(f.id, f.params);
4107
4109
  }
4108
4110
  };
4109
- var Dn = /* @__PURE__ */ ((n) => (n[n.increase = 1] = "increase", n[n.decrease = -1] = "decrease", n))(Dn || {});
4111
+ var Pn = /* @__PURE__ */ ((n) => (n[n.increase = 1] = "increase", n[n.decrease = -1] = "decrease", n))(Pn || {});
4110
4112
  const $o = {
4111
4113
  id: "doc.command.change-list-nesting-level",
4112
4114
  type: w.COMMAND,
@@ -4136,14 +4138,14 @@ const $o = {
4136
4138
  }, p = de(i, c);
4137
4139
  return f.params.actions = u.editOp(g.serialize(), p), !!r.syncExecuteCommand(f.id, f.params);
4138
4140
  }
4139
- }, ho = {
4141
+ }, uo = {
4140
4142
  id: "doc.command.bullet-list",
4141
4143
  type: w.COMMAND,
4142
4144
  handler: (n, e) => {
4143
4145
  const t = n.get(y);
4144
- return e != null && e.value ? t.syncExecuteCommand(uo.id, {
4146
+ return e != null && e.value ? t.syncExecuteCommand(lo.id, {
4145
4147
  listType: e.value
4146
- }) : t.syncExecuteCommand(mn.id, {
4148
+ }) : t.syncExecuteCommand(pn.id, {
4147
4149
  listType: Te.BULLET_LIST
4148
4150
  });
4149
4151
  }
@@ -4152,9 +4154,9 @@ const $o = {
4152
4154
  type: w.COMMAND,
4153
4155
  handler: (n, e) => {
4154
4156
  const t = n.get(y);
4155
- return e != null && e.value ? t.syncExecuteCommand(uo.id, {
4157
+ return e != null && e.value ? t.syncExecuteCommand(lo.id, {
4156
4158
  listType: e.value
4157
- }) : t.syncExecuteCommand(mn.id, {
4159
+ }) : t.syncExecuteCommand(pn.id, {
4158
4160
  listType: Te.CHECK_LIST
4159
4161
  });
4160
4162
  }
@@ -4187,14 +4189,14 @@ const $o = {
4187
4189
  const h = H.getInstance(), u = de(a, r);
4188
4190
  return l.params.actions = h.editOp(d.serialize(), u), !!o.syncExecuteCommand(l.id, l.params);
4189
4191
  }
4190
- }, go = {
4192
+ }, ho = {
4191
4193
  id: "doc.command.order-list",
4192
4194
  type: w.COMMAND,
4193
4195
  handler: (n, e) => {
4194
4196
  const t = n.get(y);
4195
- return e != null && e.value ? t.syncExecuteCommand(uo.id, {
4197
+ return e != null && e.value ? t.syncExecuteCommand(lo.id, {
4196
4198
  listType: e.value
4197
- }) : t.syncExecuteCommand(mn.id, {
4199
+ }) : t.syncExecuteCommand(pn.id, {
4198
4200
  listType: Te.ORDER_LIST
4199
4201
  });
4200
4202
  }
@@ -4209,11 +4211,11 @@ const $o = {
4209
4211
  const t = n.get(G), o = n.get(N), s = n.get(y), r = o.getCurrentUnitForType(_.UNIVER_DOC), i = t.getActiveTextRange();
4210
4212
  if (r == null || i == null)
4211
4213
  return !1;
4212
- const { segmentId: a } = i, { listType: c, paragraph: A } = e, { paragraphStart: l, paragraphEnd: d } = A, h = new Ee(), u = H.getInstance(), { defaultTabStop: g = 36 } = r.getSnapshot().documentStyle, f = (Ae = (oe = r.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : oe.sectionBreaks) != null ? Ae : [], { startIndex: p, paragraphStyle: m = {} } = A, { indentFirstLine: E, snapToGrid: I, indentStart: v } = m, R = Ua[c].nestingLevel[0].paragraphProperties || {}, { hanging: S, indentStart: C } = R, T = R.textStyle, { charSpace: x, gridType: P } = Ml(p, f) || { charSpace: 0, gridType: La.LINES }, b = rc(x, g, P, I);
4214
+ const { segmentId: a } = i, { listType: c, paragraph: A } = e, { paragraphStart: l, paragraphEnd: d } = A, h = new Ee(), u = H.getInstance(), { defaultTabStop: g = 36 } = r.getSnapshot().documentStyle, f = (Ae = (oe = r.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : oe.sectionBreaks) != null ? Ae : [], { startIndex: p, paragraphStyle: m = {} } = A, { indentFirstLine: E, snapToGrid: I, indentStart: v } = m, R = Ua[c].nestingLevel[0].paragraphProperties || {}, { hanging: S, indentStart: C } = R, T = R.textStyle, { charSpace: x, gridType: P } = Ml(p, f) || { charSpace: 0, gridType: La.LINES }, b = sc(x, g, P, I);
4213
4215
  let M = X.generateRandomId(6);
4214
4216
  const F = (le = (ge = r.getBody()) == null ? void 0 : ge.paragraphs) != null ? le : [], L = F.findIndex((ae) => ae.startIndex === A.startIndex), D = F[L - 1], te = F[L + 1];
4215
4217
  D && D.bullet && D.bullet.listType.indexOf(c) === 0 ? M = D.bullet.listId : te && te.bullet && te.bullet.listType.indexOf(c) === 0 && (M = te.bullet.listId);
4216
- const q = {
4218
+ const Y = {
4217
4219
  id: J.id,
4218
4220
  params: {
4219
4221
  unitId: r.getUnitId(),
@@ -4265,7 +4267,7 @@ const $o = {
4265
4267
  }
4266
4268
  });
4267
4269
  const k = de(r, a);
4268
- return q.params.actions = u.editOp(h.serialize(), k), !!s.syncExecuteCommand(q.id, q.params);
4270
+ return Y.params.actions = u.editOp(h.serialize(), k), !!s.syncExecuteCommand(Y.id, Y.params);
4269
4271
  }
4270
4272
  };
4271
4273
  function ws(n, e) {
@@ -4277,7 +4279,7 @@ function ws(n, e) {
4277
4279
  }
4278
4280
  return s;
4279
4281
  }
4280
- function En(n, e) {
4282
+ function mn(n, e) {
4281
4283
  const t = [];
4282
4284
  for (const o of n) {
4283
4285
  const s = ws(o, e);
@@ -4308,7 +4310,7 @@ const tt = {
4308
4310
  const c = a[0].segmentId, A = (I = i.getSelfOrHeaderFooterModel(c).getBody()) == null ? void 0 : I.paragraphs;
4309
4311
  if (A == null)
4310
4312
  return !1;
4311
- const l = En(a, A), d = i.getUnitId(), h = l.every((v) => {
4313
+ const l = mn(a, A), d = i.getUnitId(), h = l.every((v) => {
4312
4314
  var R;
4313
4315
  return ((R = v.paragraphStyle) == null ? void 0 : R.horizontalAlign) === r;
4314
4316
  }), u = {
@@ -4344,31 +4346,31 @@ const tt = {
4344
4346
  }
4345
4347
  ]
4346
4348
  },
4347
- coverType: oo.REPLACE
4349
+ coverType: no.REPLACE
4348
4350
  }), g.moveCursorTo(R + 1);
4349
4351
  }
4350
4352
  const m = de(i, c);
4351
4353
  return u.params.actions = p.editOp(f.serialize(), m), !!s.syncExecuteCommand(u.id, u.params);
4352
4354
  }
4353
- }, fo = {
4355
+ }, go = {
4354
4356
  id: "doc.command.align-left",
4355
4357
  type: w.COMMAND,
4356
4358
  handler: (n) => n.get(y).syncExecuteCommand(tt.id, {
4357
4359
  alignType: Pe.LEFT
4358
4360
  })
4359
- }, po = {
4361
+ }, fo = {
4360
4362
  id: "doc.command.align-center",
4361
4363
  type: w.COMMAND,
4362
4364
  handler: (n) => n.get(y).syncExecuteCommand(tt.id, {
4363
4365
  alignType: Pe.CENTER
4364
4366
  })
4365
- }, mo = {
4367
+ }, po = {
4366
4368
  id: "doc.command.align-right",
4367
4369
  type: w.COMMAND,
4368
4370
  handler: (n) => n.get(y).syncExecuteCommand(tt.id, {
4369
4371
  alignType: Pe.RIGHT
4370
4372
  })
4371
- }, Eo = {
4373
+ }, mo = {
4372
4374
  id: "doc.command.align-justify",
4373
4375
  type: w.COMMAND,
4374
4376
  handler: (n) => n.get(y).syncExecuteCommand(tt.id, {
@@ -4399,27 +4401,27 @@ const tt = {
4399
4401
  binding: W.PERIOD | K.CTRL_COMMAND,
4400
4402
  preconditions: ue
4401
4403
  }, Ul = {
4402
- id: fo.id,
4404
+ id: go.id,
4403
4405
  binding: W.L | K.CTRL_COMMAND | K.SHIFT,
4404
4406
  preconditions: ue
4405
4407
  }, Ll = {
4406
- id: mo.id,
4408
+ id: po.id,
4407
4409
  binding: W.R | K.CTRL_COMMAND | K.SHIFT,
4408
4410
  preconditions: ue
4409
4411
  }, Fl = {
4410
- id: po.id,
4412
+ id: fo.id,
4411
4413
  binding: W.E | K.CTRL_COMMAND | K.SHIFT,
4412
4414
  preconditions: ue
4413
4415
  }, Hl = {
4414
- id: Eo.id,
4416
+ id: mo.id,
4415
4417
  binding: W.J | K.CTRL_COMMAND | K.SHIFT,
4416
4418
  preconditions: ue
4417
4419
  }, kl = {
4418
- id: go.id,
4420
+ id: ho.id,
4419
4421
  binding: W.Digit7 | K.CTRL_COMMAND | K.SHIFT,
4420
4422
  preconditions: ue
4421
4423
  }, Vl = {
4422
- id: ho.id,
4424
+ id: uo.id,
4423
4425
  binding: W.Digit8 | K.CTRL_COMMAND | K.SHIFT,
4424
4426
  preconditions: ue
4425
4427
  }, Wl = "univer-doc-count-bar", jl = {
@@ -4444,7 +4446,7 @@ const tt = {
4444
4446
  }
4445
4447
  }, Gl = [50, 80, 100, 130, 150, 170, 200, 400], Yl = [10, 400];
4446
4448
  function ql() {
4447
- const n = $(y), e = $(N), t = He(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), []), o = Qn(t), s = _i(() => {
4449
+ const n = $(y), e = $(N), t = Fe(() => e.getCurrentTypeOfUnit$(_.UNIVER_DOC), []), o = Nn(t), s = _i(() => {
4448
4450
  var A, l;
4449
4451
  if (!o) return 100;
4450
4452
  const c = ((l = (A = o.getSettings()) == null ? void 0 : A.zoomRatio) != null ? l : 1) * 100;
@@ -4489,7 +4491,7 @@ const Xl = "univer-doc-footer-container", Jl = {
4489
4491
  toolbarConfig: tA
4490
4492
  }
4491
4493
  };
4492
- var So = /* @__PURE__ */ ((n) => (n[n.ABOVE = 0] = "ABOVE", n[n.BELLOW = 1] = "BELLOW", n))(So || {}), Qs = /* @__PURE__ */ ((n) => (n[n.LEFT = 0] = "LEFT", n[n.RIGHT = 1] = "RIGHT", n))(Qs || {});
4494
+ var Eo = /* @__PURE__ */ ((n) => (n[n.ABOVE = 0] = "ABOVE", n[n.BELLOW = 1] = "BELLOW", n))(Eo || {}), Qs = /* @__PURE__ */ ((n) => (n[n.LEFT = 0] = "LEFT", n[n.RIGHT = 1] = "RIGHT", n))(Qs || {});
4493
4495
  function $l(n, e) {
4494
4496
  let t = Q.TABLE_START;
4495
4497
  const o = [], s = [];
@@ -4566,11 +4568,11 @@ function ra(n, e, t) {
4566
4568
  textWrap: Va.NONE,
4567
4569
  position: {
4568
4570
  positionH: {
4569
- relativeFrom: eo.PAGE,
4571
+ relativeFrom: $n.PAGE,
4570
4572
  posOffset: 0
4571
4573
  },
4572
4574
  positionV: {
4573
- relativeFrom: st.PAGE,
4575
+ relativeFrom: rt.PAGE,
4574
4576
  posOffset: 0
4575
4577
  }
4576
4578
  },
@@ -4602,7 +4604,7 @@ function ra(n, e, t) {
4602
4604
  }
4603
4605
  };
4604
4606
  }
4605
- function Sn(n, e) {
4607
+ function En(n, e) {
4606
4608
  if (!n && !e)
4607
4609
  return null;
4608
4610
  if (e && e.length > 0) {
@@ -4960,7 +4962,7 @@ function cd(n) {
4960
4962
  return t ? (t == null ? void 0 : t.path.indexOf("cells")) > -1 : !1;
4961
4963
  });
4962
4964
  }
4963
- const Ad = sn, ca = {
4965
+ const Ad = on, ca = {
4964
4966
  id: "doc.command.inner-paste",
4965
4967
  type: w.COMMAND,
4966
4968
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -4986,28 +4988,28 @@ const Ad = sn, ca = {
4986
4988
  if (R && t || R && cd(c) || c.length && (A != null && A.length))
4987
4989
  return !1;
4988
4990
  for (let L = 0; L < c.length; L++) {
4989
- const D = c[L], { startOffset: te, endOffset: q, collapsed: k } = D, Y = te - m.cursor, oe = X.deepClone(l);
4991
+ const D = c[L], { startOffset: te, endOffset: Y, collapsed: k } = D, q = te - m.cursor, oe = X.deepClone(l);
4990
4992
  if (R)
4991
4993
  for (const le of oe.tables) {
4992
4994
  const { tableId: ne } = le, ae = X.generateRandomId(6);
4993
4995
  le.tableId = ae;
4994
4996
  const ye = X.deepClone(d[ne]);
4995
4997
  ye.tableId = ae;
4996
- const je = I.insertOp(["tableSource", ae], ye);
4997
- v.push(je);
4998
+ const We = I.insertOp(["tableSource", ae], ye);
4999
+ v.push(We);
4998
5000
  }
4999
5001
  if (S && h) {
5000
5002
  const le = (B = (b = u.getSnapshot().drawingsOrder) == null ? void 0 : b.length) != null ? B : 0;
5001
5003
  for (const ne of oe.customBlocks) {
5002
5004
  const { blockId: ae } = ne, ye = X.generateRandomId(6);
5003
5005
  ne.blockId = ye;
5004
- const je = X.deepClone(h[ae]);
5005
- je.drawingId = ye;
5006
- const ht = I.insertOp(["drawings", ye], je), Ne = I.insertOp(["drawingsOrder", le], ye);
5007
- v.push(ht), v.push(Ne);
5006
+ const We = X.deepClone(h[ae]);
5007
+ We.drawingId = ye;
5008
+ const ot = I.insertOp(["drawings", ye], We), je = I.insertOp(["drawingsOrder", le], ye);
5009
+ v.push(ot), v.push(je);
5008
5010
  }
5009
5011
  }
5010
- const Ae = bs((M = g.customRanges) != null ? M : [], q, Ad.includes(f)), ge = Os((F = g.customDecorations) != null ? F : [], q);
5012
+ const Ae = bs((M = g.customRanges) != null ? M : [], Y, Ad.includes(f)), ge = Os((F = g.customDecorations) != null ? F : [], Y);
5011
5013
  if (Ae && (oe.customRanges = [{
5012
5014
  ...Ae,
5013
5015
  startIndex: 0,
@@ -5019,7 +5021,7 @@ const Ad = sn, ca = {
5019
5021
  }))), k)
5020
5022
  E.push({
5021
5023
  t: j.RETAIN,
5022
- len: Y
5024
+ len: q
5023
5025
  }), E.push({
5024
5026
  t: j.INSERT,
5025
5027
  body: oe,
@@ -5029,7 +5031,7 @@ const Ad = sn, ca = {
5029
5031
  const le = ve.selection.delete([D], l, m.cursor, oe, c.length === 1);
5030
5032
  E.push(...le);
5031
5033
  }
5032
- m.reset(), m.moveCursor(q);
5034
+ m.reset(), m.moveCursor(Y);
5033
5035
  }
5034
5036
  const C = de(u, t);
5035
5037
  return v.push(I.editOp(E.serialize(), C)), p.params.actions = v.reduce((L, D) => H.compose(L, D), null), !!r.syncExecuteCommand(p.id, p.params);
@@ -5155,7 +5157,7 @@ const Ut = {
5155
5157
  const l = i.getUniverDocInstance(A);
5156
5158
  if (l == null)
5157
5159
  return !1;
5158
- const d = Ve(n, A);
5160
+ const d = ke(n, A);
5159
5161
  if (d == null)
5160
5162
  return !1;
5161
5163
  const h = d.getViewModel(), u = {
@@ -5218,7 +5220,7 @@ const gd = "doc.command.insert-text", Hs = {
5218
5220
  const v = de(l, s);
5219
5221
  return m.params.actions = I.editOp(E.serialize(), v), !!t.syncExecuteCommand(m.id, m.params);
5220
5222
  }
5221
- }, un = {
5223
+ }, dn = {
5222
5224
  id: "doc.command.delete-text",
5223
5225
  type: w.COMMAND,
5224
5226
  handler: async (n, e) => {
@@ -5367,7 +5369,7 @@ const gd = "doc.command.insert-text", Hs = {
5367
5369
  }), C.push({
5368
5370
  t: j.RETAIN,
5369
5371
  len: 1,
5370
- coverType: oo.REPLACE,
5372
+ coverType: no.REPLACE,
5371
5373
  body: {
5372
5374
  dataStream: "",
5373
5375
  paragraphs: [
@@ -5402,7 +5404,7 @@ function Ws(n, e) {
5402
5404
  }
5403
5405
  return t;
5404
5406
  }
5405
- const Io = {
5407
+ const So = {
5406
5408
  id: "doc.command.delete-left",
5407
5409
  type: w.COMMAND,
5408
5410
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -5413,7 +5415,7 @@ const Io = {
5413
5415
  const r = t.getCurrentUniverDocInstance();
5414
5416
  if (r == null)
5415
5417
  return !1;
5416
- const i = r.getUnitId(), a = Ve(n, i), c = e.getActiveTextRange(), A = e.getRectRanges(), l = e.getTextRanges(), d = a == null ? void 0 : a.getSkeleton();
5418
+ const i = r.getUnitId(), a = ke(n, i), c = e.getActiveTextRange(), A = e.getRectRanges(), l = e.getTextRanges(), d = a == null ? void 0 : a.getSkeleton();
5417
5419
  if (d == null)
5418
5420
  return !1;
5419
5421
  if (A != null && A.length) {
@@ -5433,11 +5435,11 @@ const Io = {
5433
5435
  const { segmentId: h, style: u, segmentPage: g } = c, f = r.getSelfOrHeaderFooterModel(h).getBody();
5434
5436
  if (f == null)
5435
5437
  return !1;
5436
- const p = c, { startOffset: m, collapsed: E } = p, I = d.findNodeByCharIndex(m, h, g), v = ic(I), R = ac(I, f);
5438
+ const p = c, { startOffset: m, collapsed: E } = p, I = d.findNodeByCharIndex(m, h, g), v = rc(I), R = ic(I, f);
5437
5439
  let S = m;
5438
5440
  const C = d.findNodeByCharIndex(m - 1, h, g);
5439
- if (cc(I) && C !== I && (v === !0 || R === !0) && E) {
5440
- const b = Ac(I, f);
5441
+ if (ac(I) && C !== I && (v === !0 || R === !0) && E) {
5442
+ const b = cc(I, f);
5441
5443
  if (b == null)
5442
5444
  return !1;
5443
5445
  const B = b == null ? void 0 : b.startIndex, M = { startIndex: 0 }, F = b.paragraphStyle;
@@ -5470,7 +5472,7 @@ const Io = {
5470
5472
  endOffset: B + 1
5471
5473
  },
5472
5474
  textRanges: L,
5473
- coverType: oo.REPLACE,
5475
+ coverType: no.REPLACE,
5474
5476
  segmentId: h
5475
5477
  });
5476
5478
  } else if (E === !0) {
@@ -5485,7 +5487,7 @@ const Io = {
5485
5487
  const b = (P = r.getSnapshot().drawings) == null ? void 0 : P[(x = C.drawingId) != null ? x : ""];
5486
5488
  if (b == null)
5487
5489
  return !0;
5488
- if (b.layoutType === so.INLINE) {
5490
+ if (b.layoutType === oo.INLINE) {
5489
5491
  const M = r.getUnitId();
5490
5492
  s = await o.executeCommand(ks.id, {
5491
5493
  direction: Me.LEFT,
@@ -5505,7 +5507,7 @@ const Io = {
5505
5507
  style: u
5506
5508
  }
5507
5509
  ];
5508
- s = await o.executeCommand(un.id, {
5510
+ s = await o.executeCommand(dn.id, {
5509
5511
  unitId: r.getUnitId(),
5510
5512
  range: {
5511
5513
  ...c,
@@ -5519,7 +5521,7 @@ const Io = {
5519
5521
  });
5520
5522
  }
5521
5523
  } else
5522
- S -= C.count, s = await o.executeCommand(un.id, {
5524
+ S -= C.count, s = await o.executeCommand(dn.id, {
5523
5525
  unitId: r.getUnitId(),
5524
5526
  range: p,
5525
5527
  segmentId: h,
@@ -5545,7 +5547,7 @@ const Io = {
5545
5547
  const e = n.get(G), o = n.get(N).getCurrentUniverDocInstance();
5546
5548
  if (!o)
5547
5549
  return !1;
5548
- const s = Ve(n, o.getUnitId()), r = n.get(y), i = e.getActiveTextRange(), a = e.getRectRanges(), c = e.getTextRanges(), A = s == null ? void 0 : s.getSkeleton();
5550
+ const s = ke(n, o.getUnitId()), r = n.get(y), i = e.getActiveTextRange(), a = e.getRectRanges(), c = e.getTextRanges(), A = s == null ? void 0 : s.getSkeleton();
5549
5551
  if (a != null && a.length) {
5550
5552
  const R = Ws(c, a), S = a[0].segmentId, C = [
5551
5553
  {
@@ -5580,7 +5582,7 @@ const Io = {
5580
5582
  const C = (v = o.getSnapshot().drawings) == null ? void 0 : v[(I = R.drawingId) != null ? I : ""];
5581
5583
  if (C == null)
5582
5584
  return !0;
5583
- if (C.layoutType === so.INLINE) {
5585
+ if (C.layoutType === oo.INLINE) {
5584
5586
  const x = o.getUnitId();
5585
5587
  E = await r.executeCommand(ks.id, {
5586
5588
  direction: Me.RIGHT,
@@ -5598,7 +5600,7 @@ const Io = {
5598
5600
  style: d
5599
5601
  }
5600
5602
  ];
5601
- E = await r.executeCommand(un.id, {
5603
+ E = await r.executeCommand(dn.id, {
5602
5604
  unitId: o.getUnitId(),
5603
5605
  range: {
5604
5606
  ...i,
@@ -5619,7 +5621,7 @@ const Io = {
5619
5621
  style: d
5620
5622
  }
5621
5623
  ];
5622
- E = await r.executeCommand(un.id, {
5624
+ E = await r.executeCommand(dn.id, {
5623
5625
  unitId: o.getUnitId(),
5624
5626
  range: g,
5625
5627
  segmentId: l,
@@ -5703,7 +5705,7 @@ function js(n) {
5703
5705
  }
5704
5706
  case "sub":
5705
5707
  case "sup": {
5706
- t.va = o === "sup" ? Qe.SUPERSCRIPT : Qe.SUBSCRIPT;
5708
+ t.va = o === "sup" ? Ne.SUPERSCRIPT : Ne.SUBSCRIPT;
5707
5709
  break;
5708
5710
  }
5709
5711
  }
@@ -5716,7 +5718,7 @@ function js(n) {
5716
5718
  }
5717
5719
  case "font-size": {
5718
5720
  const a = Number.parseInt(i);
5719
- Number.isNaN(a) || (i.endsWith("pt") ? t.fs = a : i.endsWith("px") && (t.fs = lc(a)));
5721
+ Number.isNaN(a) || (i.endsWith("pt") ? t.fs = a : i.endsWith("px") && (t.fs = Ac(a)));
5720
5722
  break;
5721
5723
  }
5722
5724
  case "font-style": {
@@ -5766,7 +5768,7 @@ function Yr(n, e) {
5766
5768
  const t = n.tagName.toLowerCase();
5767
5769
  return typeof e == "string" ? t === e : Array.isArray(e) ? e.some((o) => o === t) : e(n);
5768
5770
  }
5769
- const qr = 660, Zn = class Zn {
5771
+ const qr = 660, Jn = class Jn {
5770
5772
  constructor() {
5771
5773
  O(this, "_tableCache", []);
5772
5774
  O(this, "_styleCache", /* @__PURE__ */ new Map());
@@ -5780,7 +5782,7 @@ const qr = 660, Zn = class Zn {
5780
5782
  }
5781
5783
  convert(e, t = {}) {
5782
5784
  var a;
5783
- const o = Zn._pluginList.find((c) => c.checkPasteType(e)), s = Id(e), i = {
5785
+ const o = Jn._pluginList.find((c) => c.checkPasteType(e)), s = Id(e), i = {
5784
5786
  body: {
5785
5787
  dataStream: "",
5786
5788
  paragraphs: [],
@@ -5824,15 +5826,15 @@ const qr = 660, Zn = class Zn {
5824
5826
  size: { width: f, height: p },
5825
5827
  angle: 0,
5826
5828
  positionH: {
5827
- relativeFrom: eo.PAGE,
5829
+ relativeFrom: $n.PAGE,
5828
5830
  posOffset: 0
5829
5831
  },
5830
5832
  positionV: {
5831
- relativeFrom: st.PARAGRAPH,
5833
+ relativeFrom: rt.PARAGRAPH,
5832
5834
  posOffset: 0
5833
5835
  }
5834
5836
  },
5835
- layoutType: so.INLINE,
5837
+ layoutType: oo.INLINE,
5836
5838
  drawingType: Ss.DRAWING_IMAGE,
5837
5839
  unitId: o.id || "",
5838
5840
  subUnitId: o.id || ""
@@ -5925,8 +5927,8 @@ ${Q.TABLE_CELL_END}`;
5925
5927
  }));
5926
5928
  }
5927
5929
  };
5928
- O(Zn, "_pluginList", []);
5929
- let Lt = Zn;
5930
+ O(Jn, "_pluginList", []);
5931
+ let Lt = Jn;
5930
5932
  const Cd = {
5931
5933
  name: "univer-doc-paste-plugin-lark",
5932
5934
  checkPasteType(n) {
@@ -6058,7 +6060,7 @@ function Kr(n, e) {
6058
6060
  const { st: t, ed: o, ts: s = {} } = e, { ff: r, fs: i, it: a, bl: c, ul: A, st: l, ol: d, bg: h, cl: u, va: g } = s;
6059
6061
  let f = n.slice(t, o);
6060
6062
  const p = [];
6061
- return a === U.TRUE && (f = `<i>${f}</i>`), g === Qe.SUPERSCRIPT ? f = `<sup>${f}</sup>` : g === Qe.SUBSCRIPT && (f = `<sub>${f}</sub>`), (A == null ? void 0 : A.s) === U.TRUE && (f = `<u>${f}</u>`), (l == null ? void 0 : l.s) === U.TRUE && (f = `<s>${f}</s>`), c === U.TRUE && (f = `<strong>${f}</strong>`), r && p.push(`font-family: ${r}`), u && p.push(`color: ${u.rgb}`), i && p.push(`font-size: ${i}pt`), d && p.push("text-decoration: overline"), h && p.push(`background: ${h.rgb}`), p.length ? `<span style="${p.join("; ")};">${f}</span>` : f;
6063
+ return a === U.TRUE && (f = `<i>${f}</i>`), g === Ne.SUPERSCRIPT ? f = `<sup>${f}</sup>` : g === Ne.SUBSCRIPT && (f = `<sub>${f}</sub>`), (A == null ? void 0 : A.s) === U.TRUE && (f = `<u>${f}</u>`), (l == null ? void 0 : l.s) === U.TRUE && (f = `<s>${f}</s>`), c === U.TRUE && (f = `<strong>${f}</strong>`), r && p.push(`font-family: ${r}`), u && p.push(`color: ${u.rgb}`), i && p.push(`font-size: ${i}pt`), d && p.push("text-decoration: overline"), h && p.push(`background: ${h.rgb}`), p.length ? `<span style="${p.join("; ")};">${f}</span>` : f;
6062
6064
  }
6063
6065
  function Qo(n, e, t) {
6064
6066
  const { dataStream: o, textRuns: s = [] } = n;
@@ -6131,7 +6133,7 @@ function xd(n) {
6131
6133
  }), o.push({
6132
6134
  startIndex: s.length - 1
6133
6135
  }), e.dataStream = s, e.paragraphs = t, e.sectionBreaks = o);
6134
- const r = { html: "" }, i = dc(s).sectionList;
6136
+ const r = { html: "" }, i = lc(s).sectionList;
6135
6137
  for (const a of i)
6136
6138
  Bt(a, n, r);
6137
6139
  return r.html;
@@ -6139,12 +6141,12 @@ function xd(n) {
6139
6141
  function Bt(n, e, t) {
6140
6142
  var o, s;
6141
6143
  switch (n.nodeType) {
6142
- case Kt.SECTION_BREAK: {
6144
+ case qt.SECTION_BREAK: {
6143
6145
  for (const r of n.children)
6144
6146
  Bt(r, e, t);
6145
6147
  break;
6146
6148
  }
6147
- case Kt.PARAGRAPH: {
6149
+ case qt.PARAGRAPH: {
6148
6150
  const { children: r, startIndex: i, endIndex: a } = n, c = (s = (o = e.body) == null ? void 0 : o.paragraphs.find((g) => g.startIndex === a)) != null ? s : {}, { paragraphStyle: A = {} } = c, { spaceAbove: l, spaceBelow: d, lineSpacing: h } = A, u = [];
6149
6151
  if (l != null && (typeof l == "number" ? u.push(`margin-top: ${l}px`) : u.push(`margin-top: ${l.v}px`)), d != null && (typeof d == "number" ? u.push(`margin-bottom: ${d}px`) : u.push(`margin-bottom: ${d.v}px`)), h != null && u.push(`line-height: ${h}`), t.html += `<p class="UniverNormal" ${u.length ? `style="${u.join("; ")};"` : ""}>`, r.length)
6150
6152
  for (const g of r)
@@ -6152,7 +6154,7 @@ function Bt(n, e, t) {
6152
6154
  t.html += `${Od(e, i, a)}</p>`;
6153
6155
  break;
6154
6156
  }
6155
- case Kt.TABLE: {
6157
+ case qt.TABLE: {
6156
6158
  const { children: r } = n;
6157
6159
  t.html += '<table class="UniverTable" style="width: 100%; border-collapse: collapse;"><tbody>';
6158
6160
  for (const i of r)
@@ -6160,7 +6162,7 @@ function Bt(n, e, t) {
6160
6162
  t.html += "</tbody></table>";
6161
6163
  break;
6162
6164
  }
6163
- case Kt.TABLE_ROW: {
6165
+ case qt.TABLE_ROW: {
6164
6166
  const { children: r } = n;
6165
6167
  t.html += '<tr class="UniverTableRow">';
6166
6168
  for (const i of r)
@@ -6168,7 +6170,7 @@ function Bt(n, e, t) {
6168
6170
  t.html += "</tr>";
6169
6171
  break;
6170
6172
  }
6171
- case Kt.TABLE_CELL: {
6173
+ case qt.TABLE_CELL: {
6172
6174
  const { children: r } = n;
6173
6175
  t.html += '<td class="UniverTableCell">';
6174
6176
  for (const i of r)
@@ -6194,7 +6196,7 @@ var yd = Object.defineProperty, Bd = Object.getOwnPropertyDescriptor, Md = (n, e
6194
6196
  for (var s = o > 1 ? void 0 : o ? Bd(e, t) : e, r = n.length - 1, i; r >= 0; r--)
6195
6197
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
6196
6198
  return o && s && yd(e, t, s), s;
6197
- }, Jt = (n, e) => (t, o) => e(t, o, n);
6199
+ }, Xt = (n, e) => (t, o) => e(t, o, n);
6198
6200
  Lt.use(Rd);
6199
6201
  Lt.use(Cd);
6200
6202
  Lt.use(vd);
@@ -6212,7 +6214,7 @@ function Xr(n, e, t) {
6212
6214
  c.startIndex = A + 3;
6213
6215
  }), o;
6214
6216
  }
6215
- const In = fs("doc.clipboard-service");
6217
+ const Sn = fs("doc.clipboard-service");
6216
6218
  let ts = class extends he {
6217
6219
  constructor(e, t, o, s, r) {
6218
6220
  super();
@@ -6356,7 +6358,7 @@ let ts = class extends he {
6356
6358
  return this._clipboardInterfaceService.write(s, r);
6357
6359
  }
6358
6360
  addClipboardHook(e) {
6359
- return this._clipboardHooks.push(e), $n(() => {
6361
+ return this._clipboardHooks.push(e), Zn(() => {
6360
6362
  const t = this._clipboardHooks.indexOf(e);
6361
6363
  t > -1 && this._clipboardHooks.splice(t, 1);
6362
6364
  });
@@ -6405,10 +6407,10 @@ let ts = class extends he {
6405
6407
  t = await r.getType(i).then((a) => a && a.text());
6406
6408
  break;
6407
6409
  }
6408
- case vc:
6409
6410
  case Cc:
6410
6411
  case Ic:
6411
- case Sc: {
6412
+ case Sc:
6413
+ case Ec: {
6412
6414
  const a = await r.getType(i), c = new File([a], `pasted_image.${i.split("/")[1]}`, { type: i });
6413
6415
  s.push(c);
6414
6416
  break;
@@ -6481,7 +6483,7 @@ let ts = class extends he {
6481
6483
  title: "",
6482
6484
  source: d.source,
6483
6485
  description: "",
6484
- layoutType: so.INLINE,
6486
+ layoutType: oo.INLINE,
6485
6487
  drawingType: Ss.DRAWING_IMAGE,
6486
6488
  transform: {
6487
6489
  width: h,
@@ -6491,51 +6493,51 @@ let ts = class extends he {
6491
6493
  docTransform: {
6492
6494
  angle: 0,
6493
6495
  size: { width: h, height: u },
6494
- positionH: { relativeFrom: eo.CHARACTER, posOffset: 0 },
6495
- positionV: { relativeFrom: st.LINE, posOffset: 0 }
6496
+ positionH: { relativeFrom: $n.CHARACTER, posOffset: 0 },
6497
+ positionV: { relativeFrom: rt.LINE, posOffset: 0 }
6496
6498
  }
6497
6499
  };
6498
6500
  })), this._umdToHtml.convert([t]);
6499
6501
  }
6500
6502
  };
6501
6503
  ts = Md([
6502
- Jt(0, N),
6503
- Jt(1, gs),
6504
- Jt(2, y),
6505
- Jt(3, Ti),
6506
- Jt(4, z(G))
6504
+ Xt(0, N),
6505
+ Xt(1, gs),
6506
+ Xt(2, y),
6507
+ Xt(3, Ti),
6508
+ Xt(4, z(G))
6507
6509
  ], ts);
6508
- function Co(n) {
6509
- return n.getContextValue(gn) || n.getContextValue(Nn);
6510
+ function Io(n) {
6511
+ return n.getContextValue(hn) || n.getContextValue(wn);
6510
6512
  }
6511
- const zs = 999, Hn = {
6512
- id: Rc.id,
6513
+ const zs = 999, Fn = {
6514
+ id: vc.id,
6513
6515
  name: "doc.command.copy",
6514
6516
  type: w.COMMAND,
6515
6517
  multi: !0,
6516
6518
  priority: zs,
6517
- preconditions: Co,
6518
- handler: async (n) => n.get(In).copy()
6519
+ preconditions: Io,
6520
+ handler: async (n) => n.get(Sn).copy()
6519
6521
  }, Gs = {
6520
- id: bc.id,
6522
+ id: Rc.id,
6521
6523
  name: "doc.command.cut",
6522
6524
  type: w.COMMAND,
6523
6525
  multi: !0,
6524
6526
  priority: zs,
6525
- preconditions: Co,
6526
- handler: async (n) => n.get(In).cut()
6527
+ preconditions: Io,
6528
+ handler: async (n) => n.get(Sn).cut()
6527
6529
  }, Ys = {
6528
- id: Oc.id,
6530
+ id: bc.id,
6529
6531
  name: "doc.command.paste",
6530
6532
  type: w.COMMAND,
6531
6533
  multi: !0,
6532
6534
  priority: zs,
6533
- preconditions: Co,
6535
+ preconditions: Io,
6534
6536
  handler: async (n) => {
6535
- const e = n.get(In), o = await n.get(Ti).read();
6537
+ const e = n.get(Sn), o = await n.get(Ti).read();
6536
6538
  return o.length === 0 ? !1 : e.paste(o);
6537
6539
  }
6538
- }, vo = {
6540
+ }, Co = {
6539
6541
  id: "doc.command.switch-mode",
6540
6542
  type: w.COMMAND,
6541
6543
  // eslint-disable-next-line max-lines-per-function, complexity
@@ -6567,16 +6569,16 @@ const zs = 999, Hn = {
6567
6569
  if (M == null)
6568
6570
  continue;
6569
6571
  const F = B.docTransform.positionV, { relativeFrom: L, posOffset: D } = F;
6570
- if (L === st.PARAGRAPH)
6572
+ if (L === rt.PARAGRAPH)
6571
6573
  continue;
6572
- const { startIndex: te } = M, q = a.findNodeByCharIndex(te, A, l), k = (R = q == null ? void 0 : q.parent) == null ? void 0 : R.parent, Y = k == null ? void 0 : k.parent, oe = Y == null ? void 0 : Y.lines.find((ae) => ae.paragraphIndex === (k == null ? void 0 : k.paragraphIndex) && ae.paragraphStart), Ae = (S = Y == null ? void 0 : Y.parent) == null ? void 0 : S.parent;
6573
- if (q == null || k == null || oe == null || Y == null || Ae == null)
6574
+ const { startIndex: te } = M, Y = a.findNodeByCharIndex(te, A, l), k = (R = Y == null ? void 0 : Y.parent) == null ? void 0 : R.parent, q = k == null ? void 0 : k.parent, oe = q == null ? void 0 : q.lines.find((ae) => ae.paragraphIndex === (k == null ? void 0 : k.paragraphIndex) && ae.paragraphStart), Ae = (S = q == null ? void 0 : q.parent) == null ? void 0 : S.parent;
6575
+ if (Y == null || k == null || oe == null || q == null || Ae == null)
6574
6576
  continue;
6575
6577
  let ge = 0;
6576
- L === st.LINE ? ge -= k.top : L === st.PAGE && (ge += Ae.marginTop), ge += oe.top;
6578
+ L === rt.LINE ? ge -= k.top : L === rt.PAGE && (ge += Ae.marginTop), ge += oe.top;
6577
6579
  const le = {
6578
6580
  ...F,
6579
- relativeFrom: st.PARAGRAPH,
6581
+ relativeFrom: rt.PARAGRAPH,
6580
6582
  posOffset: (D != null ? D : 0) - ge
6581
6583
  }, ne = g.replaceOp(["drawings", b, "docTransform", "positionV"], F, le);
6582
6584
  ne && f.push(ne);
@@ -6589,13 +6591,13 @@ const zs = 999, Hn = {
6589
6591
  type: w.COMMAND,
6590
6592
  // eslint-disable-next-line max-lines-per-function
6591
6593
  handler: async (n) => {
6592
- const e = n.get(G), t = n.get(N), o = n.get(y), s = e.getRectRanges(), r = e.getActiveTextRange(), i = Sn(r, s);
6594
+ const e = n.get(G), t = n.get(N), o = n.get(y), s = e.getRectRanges(), r = e.getActiveTextRange(), i = En(r, s);
6593
6595
  if (i == null)
6594
6596
  return !1;
6595
6597
  const { segmentId: a } = i, c = t.getCurrentUniverDocInstance(), A = c == null ? void 0 : c.getSelfOrHeaderFooterModel(a).getBody();
6596
6598
  if (c == null || A == null)
6597
6599
  return !1;
6598
- const l = Ve(n, c.getUnitId());
6600
+ const l = ke(n, c.getUnitId());
6599
6601
  if (l == null)
6600
6602
  return !1;
6601
6603
  const d = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = H.getInstance(), f = ia(i, d);
@@ -6603,7 +6605,7 @@ const zs = 999, Hn = {
6603
6605
  return !1;
6604
6606
  const { offset: p, rowIndexes: m, len: E, tableId: I, cursor: v, selectWholeTable: R } = f;
6605
6607
  if (R)
6606
- return o.executeCommand(Cn.id);
6608
+ return o.executeCommand(In.id);
6607
6609
  const S = [], C = [{
6608
6610
  startOffset: v,
6609
6611
  endOffset: v,
@@ -6636,13 +6638,13 @@ const zs = 999, Hn = {
6636
6638
  type: w.COMMAND,
6637
6639
  // eslint-disable-next-line max-lines-per-function
6638
6640
  handler: async (n) => {
6639
- const e = n.get(G), t = n.get(N), o = n.get(y), s = e.getRectRanges(), r = e.getActiveTextRange(), i = Sn(r, s);
6641
+ const e = n.get(G), t = n.get(N), o = n.get(y), s = e.getRectRanges(), r = e.getActiveTextRange(), i = En(r, s);
6640
6642
  if (i == null)
6641
6643
  return !1;
6642
6644
  const { segmentId: a } = i, c = t.getCurrentUniverDocInstance(), A = c == null ? void 0 : c.getSelfOrHeaderFooterModel(a).getBody();
6643
6645
  if (c == null || A == null)
6644
6646
  return !1;
6645
- const l = Ve(n, c.getUnitId());
6647
+ const l = ke(n, c.getUnitId());
6646
6648
  if (l == null)
6647
6649
  return !1;
6648
6650
  const d = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = H.getInstance(), f = rd(i, d);
@@ -6650,7 +6652,7 @@ const zs = 999, Hn = {
6650
6652
  return !1;
6651
6653
  const { offsets: p, columnIndexes: m, tableId: E, cursor: I, rowCount: v, selectWholeTable: R } = f;
6652
6654
  if (R)
6653
- return o.executeCommand(Cn.id);
6655
+ return o.executeCommand(In.id);
6654
6656
  const S = [], C = [{
6655
6657
  startOffset: I,
6656
6658
  endOffset: I,
@@ -6686,18 +6688,18 @@ const zs = 999, Hn = {
6686
6688
  }
6687
6689
  return T.params.actions = S.reduce((b, B) => H.compose(b, B), null), !!o.syncExecuteCommand(T.id, T.params);
6688
6690
  }
6689
- }, Cn = {
6691
+ }, In = {
6690
6692
  id: "doc.table.delete-table",
6691
6693
  type: w.COMMAND,
6692
6694
  // eslint-disable-next-line max-lines-per-function
6693
6695
  handler: async (n) => {
6694
- const e = n.get(G), t = n.get(N), o = n.get(y), s = e.getRectRanges(), r = e.getActiveTextRange(), i = Sn(r, s);
6696
+ const e = n.get(G), t = n.get(N), o = n.get(y), s = e.getRectRanges(), r = e.getActiveTextRange(), i = En(r, s);
6695
6697
  if (i == null)
6696
6698
  return !1;
6697
6699
  const { segmentId: a } = i, c = t.getCurrentUniverDocInstance(), A = c == null ? void 0 : c.getSelfOrHeaderFooterModel(a).getBody();
6698
6700
  if (c == null || A == null)
6699
6701
  return !1;
6700
- const l = Ve(n, c.getUnitId());
6702
+ const l = ke(n, c.getUnitId());
6701
6703
  if (l == null)
6702
6704
  return !1;
6703
6705
  const d = l.getViewModel(), h = c == null ? void 0 : c.getUnitId(), u = new Ee(), g = H.getInstance(), f = aa(i, d);
@@ -6730,11 +6732,11 @@ const zs = 999, Hn = {
6730
6732
  }, Xs = "doc.command.table-insert-row", Js = "doc.command.table-insert-column", _d = "doc.command.table-insert-row-above", Pd = "doc.command.table-insert-row-bellow", Dd = "doc.command.table-insert-column-left", wd = "doc.command.table-insert-column-right", Zs = {
6731
6733
  id: _d,
6732
6734
  type: w.COMMAND,
6733
- handler: async (n) => n.get(y).executeCommand(Xs, { position: So.ABOVE })
6735
+ handler: async (n) => n.get(y).executeCommand(Xs, { position: Eo.ABOVE })
6734
6736
  }, $s = {
6735
6737
  id: Pd,
6736
6738
  type: w.COMMAND,
6737
- handler: async (n) => n.get(y).executeCommand(Xs, { position: So.BELLOW })
6739
+ handler: async (n) => n.get(y).executeCommand(Xs, { position: Eo.BELLOW })
6738
6740
  }, er = {
6739
6741
  id: Dd,
6740
6742
  type: w.COMMAND,
@@ -6748,13 +6750,13 @@ const zs = 999, Hn = {
6748
6750
  type: w.COMMAND,
6749
6751
  // eslint-disable-next-line max-lines-per-function
6750
6752
  handler: async (n, e) => {
6751
- const { position: t } = e, o = n.get(G), s = n.get(N), r = n.get(y), i = o.getRectRanges(), a = o.getActiveTextRange(), c = Sn(a, i);
6753
+ const { position: t } = e, o = n.get(G), s = n.get(N), r = n.get(y), i = o.getRectRanges(), a = o.getActiveTextRange(), c = En(a, i);
6752
6754
  if (c == null)
6753
6755
  return !1;
6754
6756
  const { segmentId: A } = c, l = s.getCurrentUnitForType(_.UNIVER_DOC), d = l == null ? void 0 : l.getSelfOrHeaderFooterModel(A).getBody();
6755
6757
  if (l == null || d == null)
6756
6758
  return !1;
6757
- const h = Ve(n, l.getUnitId());
6759
+ const h = ke(n, l.getUnitId());
6758
6760
  if (h == null)
6759
6761
  return !1;
6760
6762
  const u = h.getViewModel(), g = l == null ? void 0 : l.getUnitId(), f = new Ee(), p = H.getInstance(), m = nd(c, t, u);
@@ -6793,13 +6795,13 @@ const zs = 999, Hn = {
6793
6795
  // eslint-disable-next-line max-lines-per-function
6794
6796
  handler: async (n, e) => {
6795
6797
  var Ae, ge, le;
6796
- const { position: t } = e, o = n.get(G), s = n.get(N), r = n.get(y), i = o.getRectRanges(), a = o.getActiveTextRange(), c = Sn(a, i);
6798
+ const { position: t } = e, o = n.get(G), s = n.get(N), r = n.get(y), i = o.getRectRanges(), a = o.getActiveTextRange(), c = En(a, i);
6797
6799
  if (c == null)
6798
6800
  return !1;
6799
6801
  const { segmentId: A } = c, l = s.getCurrentUniverDocInstance(), d = l == null ? void 0 : l.getSelfOrHeaderFooterModel(A).getBody();
6800
6802
  if (l == null || d == null)
6801
6803
  return !1;
6802
- const h = Ve(n, l.getUnitId());
6804
+ const h = ke(n, l.getUnitId());
6803
6805
  if (h == null)
6804
6806
  return !1;
6805
6807
  const u = h.getViewModel(), g = l == null ? void 0 : l.getUnitId(), f = new Ee(), p = H.getInstance(), m = od(c, t, u);
@@ -6835,13 +6837,13 @@ const zs = 999, Hn = {
6835
6837
  const ae = Us(), ye = p.insertOp(["tableSource", v, "tableRows", ne, "tableCells", I], ae);
6836
6838
  S.push(ye);
6837
6839
  }
6838
- const b = l.getSnapshot(), B = b.documentStyle, { marginLeft: M = 0, marginRight: F = 0 } = B, L = ((ge = (Ae = B.pageSize) == null ? void 0 : Ae.width) != null ? ge : 800) - M - F, D = (le = b == null ? void 0 : b.tableSource) == null ? void 0 : le[v].tableColumns, { newColWidth: te, widths: q } = sd(L, D, I);
6839
- for (let ne = 0; ne < q.length; ne++) {
6840
- const ae = p.replaceOp(["tableSource", v, "tableColumns", ne, "size", "width", "v"], D[ne].size.width.v, q[ne]);
6840
+ const b = l.getSnapshot(), B = b.documentStyle, { marginLeft: M = 0, marginRight: F = 0 } = B, L = ((ge = (Ae = B.pageSize) == null ? void 0 : Ae.width) != null ? ge : 800) - M - F, D = (le = b == null ? void 0 : b.tableSource) == null ? void 0 : le[v].tableColumns, { newColWidth: te, widths: Y } = sd(L, D, I);
6841
+ for (let ne = 0; ne < Y.length; ne++) {
6842
+ const ae = p.replaceOp(["tableSource", v, "tableColumns", ne, "size", "width", "v"], D[ne].size.width.v, Y[ne]);
6841
6843
  S.push(ae);
6842
6844
  }
6843
- const k = Fs(te), Y = p.insertOp(["tableSource", v, "tableColumns", I], k);
6844
- return S.push(Y), x.params.actions = S.reduce((ne, ae) => H.compose(ne, ae), null), !!r.syncExecuteCommand(x.id, x.params);
6845
+ const k = Fs(te), q = p.insertOp(["tableSource", v, "tableColumns", I], k);
6846
+ return S.push(q), x.params.actions = S.reduce((ne, ae) => H.compose(ne, ae), null), !!r.syncExecuteCommand(x.id, x.params);
6845
6847
  }
6846
6848
  }, ga = "COMPONENT_DOC_CREATE_TABLE_CONFIRM";
6847
6849
  function fa(n, e) {
@@ -6860,24 +6862,24 @@ const pa = {
6860
6862
  type: w.COMMAND,
6861
6863
  // eslint-disable-next-line max-lines-per-function
6862
6864
  handler: async (n) => {
6863
- var S, C, T;
6865
+ var S, C;
6864
6866
  const e = n.get(G), t = n.get(N), o = n.get(y), s = n.get(Ze), r = e.getActiveTextRange(), i = e.getRectRanges();
6865
6867
  if (r == null)
6866
6868
  return !1;
6867
6869
  if (i && i.length) {
6868
- const { startOffset: x } = r;
6870
+ const { startOffset: T } = r;
6869
6871
  return e.replaceDocRanges([{
6870
- startOffset: x,
6871
- endOffset: x
6872
+ startOffset: T,
6873
+ endOffset: T
6872
6874
  }]), !0;
6873
6875
  }
6874
6876
  const { segmentId: a } = r, c = t.getCurrentUnitForType(_.UNIVER_DOC), A = c == null ? void 0 : c.getSelfOrHeaderFooterModel(a != null ? a : "").getBody();
6875
6877
  if (c == null || A == null)
6876
6878
  return !1;
6877
- const l = c.getUnitId(), { startOffset: d, endOffset: h } = r, g = ((S = A.paragraphs) != null ? S : []).find((x) => x.startIndex >= d);
6879
+ const l = c.getUnitId(), { startOffset: d, endOffset: h } = r, g = ((S = A.paragraphs) != null ? S : []).find((T) => T.startIndex >= d);
6878
6880
  if (!g)
6879
6881
  return !1;
6880
- const f = g.startIndex, p = s.getDefaultStyle(), m = s.getStyleCache(), E = Ao((C = A.textRuns) != null ? C : [], h, p, m), I = {
6882
+ const f = g.startIndex, p = s.getDefaultStyle(), m = s.getStyleCache(), E = co(A, h, p, m), I = {
6881
6883
  dataStream: Q.PARAGRAPH,
6882
6884
  paragraphs: fa(Q.PARAGRAPH, g),
6883
6885
  textRuns: [{
@@ -6897,8 +6899,8 @@ const pa = {
6897
6899
  range: v,
6898
6900
  segmentId: a
6899
6901
  });
6900
- if (((T = g.bullet) == null ? void 0 : T.listType) === Te.CHECK_LIST_CHECKED) {
6901
- const x = {
6902
+ if (((C = g.bullet) == null ? void 0 : C.listType) === Te.CHECK_LIST_CHECKED) {
6903
+ const T = {
6902
6904
  index: f + 1 - (h - d),
6903
6905
  segmentId: a,
6904
6906
  textRanges: [{
@@ -6906,7 +6908,7 @@ const pa = {
6906
6908
  endOffset: d + 1
6907
6909
  }]
6908
6910
  };
6909
- return !!await o.executeCommand(Ds.id, x) && R;
6911
+ return !!await o.executeCommand(Ds.id, T) && R;
6910
6912
  }
6911
6913
  return R;
6912
6914
  }
@@ -6915,17 +6917,17 @@ const pa = {
6915
6917
  type: w.COMMAND,
6916
6918
  // eslint-disable-next-line max-lines-per-function
6917
6919
  handler: async (n, e) => {
6918
- var le, ne, ae, ye, je, ht;
6920
+ var le, ne, ae, ye, We;
6919
6921
  const { rowCount: t, colCount: o } = e, s = n.get(G), r = n.get(N), i = n.get(y), a = n.get(Ze), c = s.getActiveTextRange();
6920
6922
  if (c == null)
6921
6923
  return !1;
6922
6924
  const { segmentId: A, segmentPage: l } = c, d = r.getCurrentUniverDocInstance(), h = d == null ? void 0 : d.getSelfOrHeaderFooterModel(A).getBody();
6923
6925
  if (d == null || h == null)
6924
6926
  return !1;
6925
- const u = d.getUnitId(), g = Ve(n, u), f = g == null ? void 0 : g.getSkeleton();
6927
+ const u = d.getUnitId(), g = ke(n, u), f = g == null ? void 0 : g.getSkeleton();
6926
6928
  if (f == null)
6927
6929
  return !1;
6928
- const { startOffset: p } = c, E = ((le = h.paragraphs) != null ? le : []).find((Ne) => Ne.startIndex >= p), I = f.findNodeByCharIndex(p, A, l);
6930
+ const { startOffset: p } = c, E = ((le = h.paragraphs) != null ? le : []).find((ot) => ot.startIndex >= p), I = f.findNodeByCharIndex(p, A, l);
6929
6931
  if (I == null)
6930
6932
  return !1;
6931
6933
  const v = new Ee(), R = H.getInstance(), S = [], C = p + 4, T = [{
@@ -6951,15 +6953,15 @@ const pa = {
6951
6953
  },
6952
6954
  len: 1
6953
6955
  });
6954
- const P = a.getDefaultStyle(), b = a.getStyleCache(), B = Ao(
6955
- (ne = h.textRuns) != null ? ne : [],
6956
+ const P = a.getDefaultStyle(), b = a.getStyleCache(), B = co(
6957
+ h,
6956
6958
  p,
6957
6959
  P,
6958
6960
  b
6959
- ), { dataStream: M, paragraphs: F, sectionBreaks: L } = $l(t, o), D = (ht = (je = (ye = (ae = I.parent) == null ? void 0 : ae.parent) == null ? void 0 : ye.parent) == null ? void 0 : je.parent) == null ? void 0 : ht.parent;
6961
+ ), { dataStream: M, paragraphs: F, sectionBreaks: L } = $l(t, o), D = (We = (ye = (ae = (ne = I.parent) == null ? void 0 : ne.parent) == null ? void 0 : ae.parent) == null ? void 0 : ye.parent) == null ? void 0 : We.parent;
6960
6962
  if (D == null)
6961
6963
  return !1;
6962
- const { pageWidth: te, marginLeft: q, marginRight: k } = D, Y = ra(t, o, te - q - k);
6964
+ const { pageWidth: te, marginLeft: Y, marginRight: k } = D, q = ra(t, o, te - Y - k);
6963
6965
  v.push({
6964
6966
  t: j.INSERT,
6965
6967
  body: {
@@ -6975,7 +6977,7 @@ const pa = {
6975
6977
  {
6976
6978
  startIndex: 0,
6977
6979
  endIndex: M.length,
6978
- tableId: Y.tableId
6980
+ tableId: q.tableId
6979
6981
  }
6980
6982
  ]
6981
6983
  },
@@ -6983,14 +6985,14 @@ const pa = {
6983
6985
  });
6984
6986
  const oe = de(d, A);
6985
6987
  S.push(R.editOp(v.serialize(), oe));
6986
- const Ae = R.insertOp(["tableSource", Y.tableId], Y);
6987
- return S.push(Ae), x.params.actions = S.reduce((Ne, qt) => H.compose(Ne, qt), null), !!i.syncExecuteCommand(x.id, x.params);
6988
+ const Ae = R.insertOp(["tableSource", q.tableId], q);
6989
+ return S.push(Ae), x.params.actions = S.reduce((ot, je) => H.compose(ot, je), null), !!i.syncExecuteCommand(x.id, x.params);
6988
6990
  }
6989
6991
  }, Uo = "doc.component.create-table-confirm", nr = {
6990
6992
  id: "doc.operation.create-table",
6991
6993
  type: w.COMMAND,
6992
6994
  handler: async (n) => {
6993
- const e = n.get($e), t = n.get(xc), o = n.get(y), s = {
6995
+ const e = n.get($e), t = n.get(Oc), o = n.get(y), s = {
6994
6996
  rowCount: 3,
6995
6997
  colCount: 5
6996
6998
  }, r = (i, a) => {
@@ -7025,7 +7027,7 @@ const pa = {
7025
7027
  const t = n.get(G), o = n.get(N), s = n.get(y), r = o.getCurrentUnitForType(_.UNIVER_DOC), i = t.getDocRanges();
7026
7028
  if (!r || i.length === 0 || !e)
7027
7029
  return !1;
7028
- const a = i[0].segmentId, c = r.getUnitId(), A = (E = (m = r.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : m.paragraphs) != null ? E : [], l = En(i, A), d = {
7030
+ const a = i[0].segmentId, c = r.getUnitId(), A = (E = (m = r.getSelfOrHeaderFooterModel(a).getBody()) == null ? void 0 : m.paragraphs) != null ? E : [], l = mn(i, A), d = {
7029
7031
  id: J.id,
7030
7032
  params: {
7031
7033
  unitId: c,
@@ -7058,14 +7060,14 @@ const pa = {
7058
7060
  }
7059
7061
  ]
7060
7062
  },
7061
- coverType: oo.REPLACE
7063
+ coverType: no.REPLACE
7062
7064
  }), h.moveCursorTo(v + 1);
7063
7065
  }
7064
7066
  const f = de(r, a);
7065
7067
  return d.params.actions = g.editOp(u.serialize(), f), !!s.syncExecuteCommand(d.id, d.params);
7066
7068
  }
7067
7069
  }, Ud = () => {
7068
- const n = $(G), e = $(Ft), t = He(() => n.getDocRanges(), []);
7070
+ const n = $(G), e = $(Ft), t = Fe(() => n.getDocRanges(), []);
7069
7071
  return be(() => {
7070
7072
  t.length || e.closePanel();
7071
7073
  }, [t]), t;
@@ -7075,7 +7077,7 @@ const pa = {
7075
7077
  if (!e || t.length === 0)
7076
7078
  return [];
7077
7079
  const o = t[0].segmentId, s = (a = (i = e.getSelfOrHeaderFooterModel(o).getBody()) == null ? void 0 : i.paragraphs) != null ? a : [];
7078
- return En(t, s);
7080
+ return mn(t, s);
7079
7081
  }, Fd = (n, e) => {
7080
7082
  const t = $(y), [o, s] = Re(() => {
7081
7083
  var a, c;
@@ -7140,16 +7142,16 @@ const pa = {
7140
7142
  paragraph: { spaceBelow: { v: r } }
7141
7143
  }))];
7142
7144
  }, Gd = (n) => {
7143
- const e = $(y), t = $(pe), o = $(N), s = He(() => {
7145
+ const e = $(y), t = $(pe), o = $(N), s = Fe(() => {
7144
7146
  var g;
7145
7147
  const u = o.getCurrentUnitForType(_.UNIVER_DOC);
7146
7148
  if (u)
7147
7149
  return (g = t.getRenderById(u == null ? void 0 : u.getUnitId())) == null ? void 0 : g.with(ie).getSkeleton();
7148
- }, []), r = He(() => new Fe({}), []), [i, a] = Re(() => {
7150
+ }, []), r = Fe(() => new Le({}), []), [i, a] = Re(() => {
7149
7151
  var g, f;
7150
7152
  const u = n[0];
7151
7153
  return u && (f = (g = u.paragraphStyle) == null ? void 0 : g.lineSpacing) != null ? f : 1;
7152
- }), c = An(i), [A, l] = Re(() => {
7154
+ }), c = cn(i), [A, l] = Re(() => {
7153
7155
  var g, f;
7154
7156
  const u = n[0];
7155
7157
  return u ? (f = (g = u.paragraphStyle) == null ? void 0 : g.spacingRule) != null ? f : Mt.AUTO : Mt.AUTO;
@@ -7194,7 +7196,7 @@ const pa = {
7194
7196
  }, gt = (n) => {
7195
7197
  const { value: e, onChange: t, className: o = "", min: s = 0, max: r = 100, step: i = 1 } = n, a = Lc.useRef(null);
7196
7198
  return /* @__PURE__ */ V(
7197
- ln,
7199
+ An,
7198
7200
  {
7199
7201
  step: i,
7200
7202
  ref: a,
@@ -7214,7 +7216,7 @@ const pa = {
7214
7216
  );
7215
7217
  };
7216
7218
  function tu() {
7217
- const n = $($e), e = He(
7219
+ const n = $($e), e = Fe(
7218
7220
  () => [
7219
7221
  { label: n.t("toolbar.alignLeft"), value: String(Pe.LEFT), icon: /* @__PURE__ */ V(ji, {}) },
7220
7222
  { label: n.t("toolbar.alignCenter"), value: String(Pe.CENTER), icon: /* @__PURE__ */ V(Wi, {}) },
@@ -7222,7 +7224,7 @@ function tu() {
7222
7224
  { label: n.t("toolbar.alignJustify"), value: String(Pe.JUSTIFIED), icon: /* @__PURE__ */ V(Vi, {}) }
7223
7225
  ],
7224
7226
  []
7225
- ), t = Ld(), [o, s] = Fd(t, e[0].value), [r, i] = Hd(t), [a, c] = kd(t), [A, l] = Vd(t), [d, h] = Wd(t), [u, g] = jd(t), [f, p] = zd(t), { lineSpacing: [m, E], spacingRule: [I, v] } = Gd(t), R = He(() => I === Mt.AUTO ? { min: 1, max: 5, step: m < 2 ? 0.5 : 1 } : { min: 1, max: 100 }, [I, m]);
7227
+ ), t = Ld(), [o, s] = Fd(t, e[0].value), [r, i] = Hd(t), [a, c] = kd(t), [A, l] = Vd(t), [d, h] = Wd(t), [u, g] = jd(t), [f, p] = zd(t), { lineSpacing: [m, E], spacingRule: [I, v] } = Gd(t), R = Fe(() => I === Mt.AUTO ? { min: 1, max: 5, step: m < 2 ? 0.5 : 1 } : { min: 1, max: 100 }, [I, m]);
7226
7228
  return /* @__PURE__ */ ce("div", { className: re.paragraphSetting, children: [
7227
7229
  /* @__PURE__ */ V("div", { className: re.paragraphSettingTitle, children: n.t("doc.paragraphSetting.alignment") }),
7228
7230
  /* @__PURE__ */ V(
@@ -7235,7 +7237,7 @@ function tu() {
7235
7237
  children: e.map((S) => /* @__PURE__ */ V(qc, { title: S.label, placement: "bottom", children: /* @__PURE__ */ V(
7236
7238
  "span",
7237
7239
  {
7238
- className: Ln(
7240
+ className: Un(
7239
7241
  re.paragraphSettingIconListItem,
7240
7242
  { [re.paragraphSettingIconListActive]: o === S.value }
7241
7243
  ),
@@ -7331,7 +7333,7 @@ function tu() {
7331
7333
  }
7332
7334
  const nu = (n, e) => e.length === n.length && n.some((t) => e.some((o) => o.startOffset === t.startOffset && o.endOffset === t.endOffset));
7333
7335
  function ou() {
7334
- const n = $(y), e = $($e), t = Qn(e.currentLocale$), [o, s] = Re(""), r = He(() => ui(() => s(mt(4)), 300), []), i = An([]);
7336
+ const n = $(y), e = $($e), t = Nn(e.currentLocale$), [o, s] = Re(""), r = Fe(() => ui(() => s(mt(4)), 300), []), i = cn([]);
7335
7337
  return be(() => {
7336
7338
  const a = n.onCommandExecuted((c) => {
7337
7339
  if (we.id === c.id) {
@@ -7377,7 +7379,7 @@ let Ft = class extends he {
7377
7379
  };
7378
7380
  Ft = iu([
7379
7381
  Lo(0, y),
7380
- Lo(1, z(ao)),
7382
+ Lo(1, z(io)),
7381
7383
  Lo(2, z(xi))
7382
7384
  ], Ft);
7383
7385
  const or = {
@@ -7427,8 +7429,8 @@ const nt = (n) => {
7427
7429
  return Zr(o, e, t), () => s.unsubscribe();
7428
7430
  });
7429
7431
  }, cu = (n) => ({
7430
- id: Hn.name,
7431
- commandId: Hn.id,
7432
+ id: Fn.name,
7433
+ commandId: Fn.id,
7432
7434
  type: Z.BUTTON,
7433
7435
  icon: "Copy",
7434
7436
  title: "rightClick.copy",
@@ -7454,7 +7456,7 @@ const nt = (n) => {
7454
7456
  title: "rightClick.paste",
7455
7457
  hidden$: ee(n, _.UNIVER_DOC)
7456
7458
  }), uu = (n) => ({
7457
- id: Io.id,
7459
+ id: So.id,
7458
7460
  type: Z.BUTTON,
7459
7461
  icon: "PasteSpecial",
7460
7462
  title: "rightClick.delete",
@@ -7467,7 +7469,7 @@ function hu(n) {
7467
7469
  type: Z.SUBITEMS,
7468
7470
  title: "table.insert",
7469
7471
  icon: "Insert",
7470
- hidden$: co(ee(n, _.UNIVER_DOC), nt(n), (e, t) => e || t)
7472
+ hidden$: ao(ee(n, _.UNIVER_DOC), nt(n), (e, t) => e || t)
7471
7473
  };
7472
7474
  }
7473
7475
  function gu(n) {
@@ -7517,7 +7519,7 @@ function Eu(n) {
7517
7519
  type: Z.SUBITEMS,
7518
7520
  title: "table.delete",
7519
7521
  icon: "Reduce",
7520
- hidden$: co(ee(n, _.UNIVER_DOC), nt(n), (e, t) => e || t)
7522
+ hidden$: ao(ee(n, _.UNIVER_DOC), nt(n), (e, t) => e || t)
7521
7523
  };
7522
7524
  }
7523
7525
  function Su(n) {
@@ -7542,7 +7544,7 @@ function Iu(n) {
7542
7544
  }
7543
7545
  function Cu(n) {
7544
7546
  return {
7545
- id: Cn.id,
7547
+ id: In.id,
7546
7548
  type: Z.BUTTON,
7547
7549
  title: "table.deleteTable",
7548
7550
  icon: "GridSingle",
@@ -7619,7 +7621,7 @@ function bu(n) {
7619
7621
  o.next(!0);
7620
7622
  return;
7621
7623
  }
7622
- const h = Ve(n, d.getUnitId());
7624
+ const h = ke(n, d.getUnitId());
7623
7625
  if (h == null) {
7624
7626
  o.next(!0);
7625
7627
  return;
@@ -7670,8 +7672,8 @@ function Ou(n) {
7670
7672
  const o = e.onCommandExecuted((s) => {
7671
7673
  var i;
7672
7674
  const r = s.id;
7673
- if (r === we.id || r === dt.id) {
7674
- const a = ut(n);
7675
+ if (r === we.id || r === ut.id) {
7676
+ const a = ht(n);
7675
7677
  if (a == null) {
7676
7678
  t.next(!1);
7677
7679
  return;
@@ -7698,8 +7700,8 @@ function xu(n) {
7698
7700
  const o = e.onCommandExecuted((s) => {
7699
7701
  var i;
7700
7702
  const r = s.id;
7701
- if (r === we.id || r === dt.id) {
7702
- const a = ut(n);
7703
+ if (r === we.id || r === ut.id) {
7704
+ const a = ht(n);
7703
7705
  if (a == null) {
7704
7706
  t.next(!1);
7705
7707
  return;
@@ -7726,8 +7728,8 @@ function Tu(n) {
7726
7728
  const o = e.onCommandExecuted((s) => {
7727
7729
  var i;
7728
7730
  const r = s.id;
7729
- if (r === we.id || r === dt.id) {
7730
- const a = ut(n);
7731
+ if (r === we.id || r === ut.id) {
7732
+ const a = ht(n);
7731
7733
  if (a == null) {
7732
7734
  t.next(!1);
7733
7735
  return;
@@ -7754,8 +7756,8 @@ function yu(n) {
7754
7756
  const o = e.onCommandExecuted((s) => {
7755
7757
  var i;
7756
7758
  const r = s.id;
7757
- if (r === we.id || r === dt.id) {
7758
- const a = ut(n);
7759
+ if (r === we.id || r === ut.id) {
7760
+ const a = ht(n);
7759
7761
  if (a == null) {
7760
7762
  t.next(!1);
7761
7763
  return;
@@ -7781,14 +7783,14 @@ function Bu(n) {
7781
7783
  const o = e.onCommandExecuted((s) => {
7782
7784
  var i;
7783
7785
  const r = s.id;
7784
- if (r === we.id || r === dt.id) {
7785
- const a = ut(n);
7786
+ if (r === we.id || r === ut.id) {
7787
+ const a = ht(n);
7786
7788
  if (a == null) {
7787
7789
  t.next(!1);
7788
7790
  return;
7789
7791
  }
7790
7792
  const c = (i = a.ts) == null ? void 0 : i.va;
7791
- t.next(c === Qe.SUBSCRIPT);
7793
+ t.next(c === Ne.SUBSCRIPT);
7792
7794
  }
7793
7795
  });
7794
7796
  return t.next(!1), o.dispose;
@@ -7808,14 +7810,14 @@ function Mu(n) {
7808
7810
  const o = e.onCommandExecuted((s) => {
7809
7811
  var i;
7810
7812
  const r = s.id;
7811
- if (r === we.id || r === dt.id) {
7812
- const a = ut(n);
7813
+ if (r === we.id || r === ut.id) {
7814
+ const a = ht(n);
7813
7815
  if (a == null) {
7814
7816
  t.next(!1);
7815
7817
  return;
7816
7818
  }
7817
7819
  const c = (i = a.ts) == null ? void 0 : i.va;
7818
- t.next(c === Qe.SUPERSCRIPT);
7820
+ t.next(c === Ne.SUPERSCRIPT);
7819
7821
  }
7820
7822
  });
7821
7823
  return t.next(!1), o.dispose;
@@ -7831,7 +7833,7 @@ function _u(n) {
7831
7833
  tooltip: "toolbar.font",
7832
7834
  type: Z.SELECTOR,
7833
7835
  label: Xi,
7834
- selections: Tc.map((t) => ({
7836
+ selections: xc.map((t) => ({
7835
7837
  label: {
7836
7838
  name: Ji,
7837
7839
  hoverable: !0
@@ -7844,7 +7846,7 @@ function _u(n) {
7844
7846
  var a;
7845
7847
  const i = r.id;
7846
7848
  if (i === we.id || i === wt.id) {
7847
- const c = ut(n);
7849
+ const c = ht(n);
7848
7850
  if (c == null) {
7849
7851
  t.next(o);
7850
7852
  return;
@@ -7873,14 +7875,14 @@ function Pu(n) {
7873
7875
  // disabled$,
7874
7876
  }
7875
7877
  },
7876
- selections: yc,
7878
+ selections: Tc,
7877
7879
  // disabled$,
7878
7880
  value$: new me((t) => {
7879
7881
  const o = Ei.fs, s = e.onCommandExecuted((r) => {
7880
7882
  var a;
7881
7883
  const i = r.id;
7882
7884
  if (i === we.id || i === Dt.id) {
7883
- const c = ut(n);
7885
+ const c = ht(n);
7884
7886
  if (c == null) {
7885
7887
  t.next(o);
7886
7888
  return;
@@ -7930,7 +7932,7 @@ function wu(n) {
7930
7932
  type: Z.BUTTON,
7931
7933
  icon: "HeaderFooterSingle",
7932
7934
  tooltip: "toolbar.headerFooter",
7933
- hidden$: co(ee(n, _.UNIVER_DOC, void 0, et), Ru(n), (e, t) => e || t)
7935
+ hidden$: ao(ee(n, _.UNIVER_DOC, void 0, et), Ru(n), (e, t) => e || t)
7934
7936
  };
7935
7937
  }
7936
7938
  const Nu = "GridSingle", Ia = "doc.menu.table";
@@ -7942,7 +7944,7 @@ function Qu(n) {
7942
7944
  tooltip: "toolbar.table.main",
7943
7945
  disabled$: bu(n),
7944
7946
  // Do not show header footer menu and insert table at zen mode.
7945
- hidden$: co(ee(n, _.UNIVER_DOC, void 0, et), vu(n), (e, t) => e || t)
7947
+ hidden$: ao(ee(n, _.UNIVER_DOC, void 0, et), vu(n), (e, t) => e || t)
7946
7948
  };
7947
7949
  }
7948
7950
  function Uu(n) {
@@ -7956,7 +7958,7 @@ function Uu(n) {
7956
7958
  function Lu(n) {
7957
7959
  const e = n.get(y);
7958
7960
  return {
7959
- id: fo.id,
7961
+ id: go.id,
7960
7962
  type: Z.BUTTON,
7961
7963
  icon: "LeftJustifyingSingle",
7962
7964
  tooltip: "toolbar.alignLeft",
@@ -7966,7 +7968,7 @@ function Lu(n) {
7966
7968
  var i;
7967
7969
  const r = s.id;
7968
7970
  if (r === we.id || r === tt.id) {
7969
- const a = Ro(n);
7971
+ const a = vo(n);
7970
7972
  if (a == null)
7971
7973
  return;
7972
7974
  const c = (i = a.paragraphStyle) == null ? void 0 : i.horizontalAlign;
@@ -7981,7 +7983,7 @@ function Lu(n) {
7981
7983
  function Fu(n) {
7982
7984
  const e = n.get(y);
7983
7985
  return {
7984
- id: po.id,
7986
+ id: fo.id,
7985
7987
  type: Z.BUTTON,
7986
7988
  icon: "HorizontallySingle",
7987
7989
  tooltip: "toolbar.alignCenter",
@@ -7990,7 +7992,7 @@ function Fu(n) {
7990
7992
  var i;
7991
7993
  const r = s.id;
7992
7994
  if (r === we.id || r === tt.id) {
7993
- const a = Ro(n);
7995
+ const a = vo(n);
7994
7996
  if (a == null)
7995
7997
  return;
7996
7998
  const c = (i = a.paragraphStyle) == null ? void 0 : i.horizontalAlign;
@@ -8006,7 +8008,7 @@ function Fu(n) {
8006
8008
  function Hu(n) {
8007
8009
  const e = n.get(y);
8008
8010
  return {
8009
- id: mo.id,
8011
+ id: po.id,
8010
8012
  type: Z.BUTTON,
8011
8013
  icon: "RightJustifyingSingle",
8012
8014
  tooltip: "toolbar.alignRight",
@@ -8015,7 +8017,7 @@ function Hu(n) {
8015
8017
  var i;
8016
8018
  const r = s.id;
8017
8019
  if (r === we.id || r === tt.id) {
8018
- const a = Ro(n);
8020
+ const a = vo(n);
8019
8021
  if (a == null)
8020
8022
  return;
8021
8023
  const c = (i = a.paragraphStyle) == null ? void 0 : i.horizontalAlign;
@@ -8031,7 +8033,7 @@ function Hu(n) {
8031
8033
  function ku(n) {
8032
8034
  const e = n.get(y);
8033
8035
  return {
8034
- id: Eo.id,
8036
+ id: mo.id,
8035
8037
  type: Z.BUTTON,
8036
8038
  icon: "AlignTextBothSingle",
8037
8039
  tooltip: "toolbar.alignJustify",
@@ -8040,7 +8042,7 @@ function ku(n) {
8040
8042
  var i;
8041
8043
  const r = s.id;
8042
8044
  if (r === we.id || r === tt.id) {
8043
- const a = Ro(n);
8045
+ const a = vo(n);
8044
8046
  if (a == null)
8045
8047
  return;
8046
8048
  const c = (i = a.paragraphStyle) == null ? void 0 : i.horizontalAlign;
@@ -8053,7 +8055,7 @@ function ku(n) {
8053
8055
  hidden$: ee(n, _.UNIVER_DOC, void 0, et)
8054
8056
  };
8055
8057
  }
8056
- const hn = (n) => new me((e) => {
8058
+ const un = (n) => new me((e) => {
8057
8059
  const t = n.get(N), o = n.get(G);
8058
8060
  let s;
8059
8061
  const r = t.focused$.subscribe((i) => {
@@ -8083,7 +8085,7 @@ const hn = (n) => new me((e) => {
8083
8085
  });
8084
8086
  function Vu(n) {
8085
8087
  return {
8086
- id: go.id,
8088
+ id: ho.id,
8087
8089
  type: Z.BUTTON_SELECTOR,
8088
8090
  selections: [
8089
8091
  {
@@ -8091,19 +8093,19 @@ function Vu(n) {
8091
8093
  name: ea,
8092
8094
  hoverable: !1
8093
8095
  },
8094
- value$: hn(n)
8096
+ value$: un(n)
8095
8097
  }
8096
8098
  ],
8097
8099
  icon: "OrderSingle",
8098
8100
  tooltip: "toolbar.order",
8099
8101
  hidden$: ee(n, _.UNIVER_DOC),
8100
8102
  disabled$: Oe(n),
8101
- activated$: hn(n).pipe(fn((e) => e && e.indexOf("ORDER_LIST") === 0))
8103
+ activated$: un(n).pipe(gn((e) => e && e.indexOf("ORDER_LIST") === 0))
8102
8104
  };
8103
8105
  }
8104
8106
  function Wu(n) {
8105
8107
  return {
8106
- id: ho.id,
8108
+ id: uo.id,
8107
8109
  type: Z.BUTTON_SELECTOR,
8108
8110
  selections: [
8109
8111
  {
@@ -8111,14 +8113,14 @@ function Wu(n) {
8111
8113
  name: ta,
8112
8114
  hoverable: !1
8113
8115
  },
8114
- value$: hn(n)
8116
+ value$: un(n)
8115
8117
  }
8116
8118
  ],
8117
8119
  icon: "UnorderSingle",
8118
8120
  tooltip: "toolbar.unorder",
8119
8121
  disabled$: Oe(n),
8120
8122
  hidden$: ee(n, _.UNIVER_DOC),
8121
- activated$: hn(n).pipe(fn((e) => e && e.indexOf("BULLET_LIST") === 0))
8123
+ activated$: un(n).pipe(gn((e) => e && e.indexOf("BULLET_LIST") === 0))
8122
8124
  };
8123
8125
  }
8124
8126
  function ju(n) {
@@ -8129,13 +8131,13 @@ function ju(n) {
8129
8131
  tooltip: "toolbar.checklist",
8130
8132
  disabled$: Oe(n),
8131
8133
  hidden$: ee(n, _.UNIVER_DOC),
8132
- activated$: hn(n).pipe(fn((e) => e && e.indexOf("CHECK_LIST") === 0))
8134
+ activated$: un(n).pipe(gn((e) => e && e.indexOf("CHECK_LIST") === 0))
8133
8135
  };
8134
8136
  }
8135
8137
  function zu(n) {
8136
8138
  const e = n.get(y), t = n.get(N);
8137
8139
  return {
8138
- id: vo.id,
8140
+ id: Co.id,
8139
8141
  type: Z.BUTTON,
8140
8142
  icon: "KeyboardSingle",
8141
8143
  tooltip: "toolbar.documentFlavor",
@@ -8155,7 +8157,7 @@ function zu(n) {
8155
8157
  }
8156
8158
  function Gu(n) {
8157
8159
  return {
8158
- id: pn.id,
8160
+ id: fn.id,
8159
8161
  type: Z.BUTTON,
8160
8162
  title: "toolbar.resetColor",
8161
8163
  icon: "NoColor"
@@ -8189,7 +8191,7 @@ function Yu(n) {
8189
8191
  hidden$: ee(n, _.UNIVER_DOC)
8190
8192
  };
8191
8193
  }
8192
- function ut(n) {
8194
+ function ht(n) {
8193
8195
  var h, u;
8194
8196
  const e = n.get(N), t = n.get(G), o = n.get(Ze), s = e.getCurrentUnitForType(_.UNIVER_DOC), r = t.getDocRanges(), i = (h = r.find((g) => g.isActive)) != null ? h : r[0], a = o.getDefaultStyle(), c = (u = o.getStyleCache()) != null ? u : {};
8195
8197
  if (s == null || i == null)
@@ -8212,7 +8214,7 @@ function ut(n) {
8212
8214
  }
8213
8215
  };
8214
8216
  }
8215
- function Ro(n) {
8217
+ function vo(n) {
8216
8218
  var l, d;
8217
8219
  const e = n.get(N), t = n.get(G), o = e.getCurrentUniverDocInstance(), s = t.getDocRanges(), r = (l = s.find((h) => h.isActive)) != null ? l : s[0];
8218
8220
  if (o == null || r == null)
@@ -8270,7 +8272,7 @@ const qu = {
8270
8272
  [Qt.id]: {
8271
8273
  order: 9,
8272
8274
  menuItemFactory: Yu,
8273
- [pn.id]: {
8275
+ [fn.id]: {
8274
8276
  order: 0,
8275
8277
  menuItemFactory: Gu
8276
8278
  }
@@ -8285,27 +8287,27 @@ const qu = {
8285
8287
  menuItemFactory: Uu
8286
8288
  }
8287
8289
  },
8288
- [fo.id]: {
8290
+ [go.id]: {
8289
8291
  order: 2,
8290
8292
  menuItemFactory: Lu
8291
8293
  },
8292
- [po.id]: {
8294
+ [fo.id]: {
8293
8295
  order: 3,
8294
8296
  menuItemFactory: Fu
8295
8297
  },
8296
- [mo.id]: {
8298
+ [po.id]: {
8297
8299
  order: 4,
8298
8300
  menuItemFactory: Hu
8299
8301
  },
8300
- [Eo.id]: {
8302
+ [mo.id]: {
8301
8303
  order: 5,
8302
8304
  menuItemFactory: ku
8303
8305
  },
8304
- [go.id]: {
8306
+ [ho.id]: {
8305
8307
  order: 6,
8306
8308
  menuItemFactory: Vu
8307
8309
  },
8308
- [ho.id]: {
8310
+ [uo.id]: {
8309
8311
  order: 7,
8310
8312
  menuItemFactory: Wu
8311
8313
  },
@@ -8317,14 +8319,14 @@ const qu = {
8317
8319
  order: 9,
8318
8320
  menuItemFactory: wu
8319
8321
  },
8320
- [vo.id]: {
8322
+ [Co.id]: {
8321
8323
  order: 10,
8322
8324
  menuItemFactory: zu
8323
8325
  }
8324
8326
  },
8325
8327
  [Mi.MAIN_AREA]: {
8326
8328
  [Sr.FORMAT]: {
8327
- [Hn.name]: {
8329
+ [Fn.name]: {
8328
8330
  order: 0,
8329
8331
  menuItemFactory: cu
8330
8332
  },
@@ -8336,7 +8338,7 @@ const qu = {
8336
8338
  order: 2,
8337
8339
  menuItemFactory: du
8338
8340
  },
8339
- [Io.id]: {
8341
+ [So.id]: {
8340
8342
  order: 3,
8341
8343
  menuItemFactory: uu
8342
8344
  }
@@ -8377,7 +8379,7 @@ const qu = {
8377
8379
  order: 2,
8378
8380
  menuItemFactory: Iu
8379
8381
  },
8380
- [Cn.id]: {
8382
+ [In.id]: {
8381
8383
  order: 3,
8382
8384
  menuItemFactory: Cu
8383
8385
  }
@@ -8390,19 +8392,19 @@ var Ku = Object.defineProperty, Xu = Object.getOwnPropertyDescriptor, Ju = (n, e
8390
8392
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
8391
8393
  return o && s && Ku(e, t, s), s;
8392
8394
  }, Xe = (n, e) => (t, o) => e(t, o, n);
8393
- let kn = class extends he {
8395
+ let Hn = class extends he {
8394
8396
  constructor(n, e, t, o, s, r, i, a, c) {
8395
8397
  super(), this._injector = n, this._componentManager = e, this._commandService = t, this._layoutService = o, this._menuManagerService = s, this._uiPartsService = r, this._univerInstanceService = i, this._shortcutService = a, this._configService = c, this._init();
8396
8398
  }
8397
8399
  _initCustomComponents() {
8398
8400
  const n = this._componentManager;
8399
- this.disposeWithMe(n.register(_s, Xc)), this.disposeWithMe(n.register(Xi, Bc)), this.disposeWithMe(n.register(Ji, Mc)), this.disposeWithMe(n.register(Zi, _c)), this.disposeWithMe(n.register(ta, ml)), this.disposeWithMe(n.register(ea, fl)), this.disposeWithMe(n.register("TodoList", Gi));
8401
+ this.disposeWithMe(n.register(_s, Xc)), this.disposeWithMe(n.register(Xi, yc)), this.disposeWithMe(n.register(Ji, Bc)), this.disposeWithMe(n.register(Zi, Mc)), this.disposeWithMe(n.register(ta, ml)), this.disposeWithMe(n.register(ea, fl)), this.disposeWithMe(n.register("TodoList", Gi));
8400
8402
  }
8401
8403
  // TODO: @zhangwei, why add workbook to docs-ui?
8402
8404
  _initUiParts() {
8403
8405
  var t, o;
8404
8406
  const n = this._univerInstanceService.getCurrentUnitForType(_.UNIVER_SHEET), e = this._configService.getConfig(Ns);
8405
- (o = (t = e == null ? void 0 : e.layout) == null ? void 0 : t.docContainerConfig) != null && o.footer && !n && this.disposeWithMe(this._uiPartsService.registerComponent(Pc.FOOTER, () => Ga(Zl, this._injector)));
8407
+ (o = (t = e == null ? void 0 : e.layout) == null ? void 0 : t.docContainerConfig) != null && o.footer && !n && this.disposeWithMe(this._uiPartsService.registerComponent(_c.FOOTER, () => Pc(Zl, this._injector)));
8406
8408
  }
8407
8409
  _initMenus() {
8408
8410
  this._menuManagerService.mergeMenu(qu);
@@ -8444,29 +8446,29 @@ let kn = class extends he {
8444
8446
  );
8445
8447
  }
8446
8448
  };
8447
- kn = Ju([
8448
- Xe(0, z(ro)),
8449
- Xe(1, z(ao)),
8449
+ Hn = Ju([
8450
+ Xe(0, z(so)),
8451
+ Xe(1, z(io)),
8450
8452
  Xe(2, y),
8451
8453
  Xe(3, vs),
8452
8454
  Xe(4, Dc),
8453
8455
  Xe(5, wc),
8454
8456
  Xe(6, N),
8455
- Xe(7, io),
8457
+ Xe(7, ro),
8456
8458
  Xe(8, Cs)
8457
- ], kn);
8459
+ ], Hn);
8458
8460
  var Zu = Object.defineProperty, $u = Object.getOwnPropertyDescriptor, eh = (n, e, t, o) => {
8459
8461
  for (var s = o > 1 ? void 0 : o ? $u(e, t) : e, r = n.length - 1, i; r >= 0; r--)
8460
8462
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
8461
8463
  return o && s && Zu(e, t, s), s;
8462
8464
  }, Fo = (n, e) => (t, o) => e(t, o, n);
8463
8465
  const $r = 1.5;
8464
- let Vn = class extends lt {
8466
+ let kn = class extends dt {
8465
8467
  constructor(n, e, t, o) {
8466
8468
  super(), this._context = n, this._textSelectionManagerService = e, this._editorService = t, this._docSkeletonManagerService = o, this._init();
8467
8469
  }
8468
8470
  _init() {
8469
- this._textSelectionManagerService.textSelection$.pipe(rt(this.dispose$)).subscribe((n) => {
8471
+ this._textSelectionManagerService.textSelection$.pipe(it(this.dispose$)).subscribe((n) => {
8470
8472
  if (n == null)
8471
8473
  return;
8472
8474
  const { isEditing: e, unitId: t } = n;
@@ -8485,7 +8487,7 @@ let Vn = class extends lt {
8485
8487
  const { unitId: e, scene: t, mainComponent: o } = this._context, s = this._docSkeletonManagerService.getSkeleton();
8486
8488
  if (o == null || s == null)
8487
8489
  return;
8488
- const r = o.getOffsetConfig(), { docsLeft: i, docsTop: a } = r, c = new at(r, s), { contentBoxPointGroup: A } = c.getRangePointData(n, n), { left: l, top: d, height: h } = _n(A), u = l + i, g = d + a, f = t.getViewport(Je.VIEW_MAIN), p = this._editorService.getEditor(e);
8490
+ const r = o.getOffsetConfig(), { docsLeft: i, docsTop: a } = r, c = new ct(r, s), { contentBoxPointGroup: A } = c.getRangePointData(n, n), { left: l, top: d, height: h } = Mn(A), u = l + i, g = d + a, f = t.getViewport(Je.VIEW_MAIN), p = this._editorService.getEditor(e);
8489
8491
  if (f == null)
8490
8492
  return;
8491
8493
  const {
@@ -8509,17 +8511,17 @@ let Vn = class extends lt {
8509
8511
  e && this.scrollToNode(t);
8510
8512
  }
8511
8513
  };
8512
- Vn = eh([
8514
+ kn = eh([
8513
8515
  Fo(1, z(G)),
8514
- Fo(2, ke),
8516
+ Fo(2, He),
8515
8517
  Fo(3, z(ie))
8516
- ], Vn);
8518
+ ], kn);
8517
8519
  var th = Object.defineProperty, nh = Object.getOwnPropertyDescriptor, oh = (n, e, t, o) => {
8518
8520
  for (var s = o > 1 ? void 0 : o ? nh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
8519
8521
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
8520
8522
  return o && s && th(e, t, s), s;
8521
8523
  }, Ot = (n, e) => (t, o) => e(t, o, n);
8522
- let ns = class extends lt {
8524
+ let ns = class extends dt {
8523
8525
  constructor(n, e, t, o, s, r, i) {
8524
8526
  super(), this._context = n, this._commandService = e, this._docSelectionRenderService = t, this._docSkeletonManagerService = o, this._editorService = s, this._renderManagerService = r, this._univerInstanceService = i, this._addNewRender(), this._initRenderRefresh(), this._initCommandListener();
8525
8527
  }
@@ -8537,42 +8539,44 @@ let ns = class extends lt {
8537
8539
  this._recalculateSizeBySkeleton(t);
8538
8540
  }
8539
8541
  _addNewRender() {
8540
- const { scene: n, engine: e } = this._context, t = new uc(Je.VIEW_MAIN, n, {
8542
+ const { scene: n, engine: e } = this._context, t = new dc(Je.VIEW_MAIN, n, {
8541
8543
  left: 0,
8542
8544
  top: 0,
8543
8545
  bottom: 0,
8544
8546
  right: 0,
8545
8547
  isWheelPreventDefaultX: !0
8546
8548
  });
8547
- n.attachControl(), n.onMouseWheel$.subscribeEvent((o, s) => {
8548
- const r = this._univerInstanceService.getCurrentUnitForType(_.UNIVER_DOC);
8549
- if ((r == null ? void 0 : r.getUnitId()) !== this._context.unitId)
8549
+ n.attachControl(), n.onMouseWheel$.subscribeEvent((s, r) => {
8550
+ const i = this._univerInstanceService.getCurrentUnitForType(_.UNIVER_DOC);
8551
+ if ((i == null ? void 0 : i.getUnitId()) !== this._context.unitId)
8550
8552
  return;
8551
- const i = o;
8552
- if (i.ctrlKey) {
8553
- const a = Math.abs(i.deltaX);
8554
- let c = a < 40 ? 0.2 : a < 80 ? 0.4 : 0.2;
8555
- c *= i.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (c /= 2), n.scaleX + c > 4 ? n.scale(4, 4) : n.scaleX + c < 0.1 ? n.scale(0.1, 0.1) : i.preventDefault();
8553
+ const a = s;
8554
+ if (a.ctrlKey) {
8555
+ const c = Math.abs(a.deltaX);
8556
+ let A = c < 40 ? 0.2 : c < 80 ? 0.4 : 0.2;
8557
+ A *= a.deltaY > 0 ? -1 : 1, n.scaleX < 1 && (A /= 2), n.scaleX + A > 4 ? n.scale(4, 4) : n.scaleX + A < 0.1 ? n.scale(0.1, 0.1) : a.preventDefault();
8556
8558
  } else
8557
- t.onMouseWheel(i, s);
8559
+ t.onMouseWheel(a, r);
8558
8560
  }), new Vo(t), n.addLayer(
8559
8561
  new mr(n, [], To),
8560
8562
  new mr(n, [], rA)
8561
- ), this._addComponent(), e.runRenderLoop(() => {
8562
- n.render();
8563
- }), this._docSelectionRenderService.__attachScrollEvent();
8563
+ ), this._addComponent();
8564
+ const o = () => n.render();
8565
+ this.disposeWithMe(this._context.activated$.subscribe((s) => {
8566
+ s ? e.runRenderLoop(o) : e.stopRenderLoop(o);
8567
+ })), this._docSelectionRenderService.__attachScrollEvent();
8564
8568
  }
8565
8569
  _addComponent() {
8566
8570
  const { scene: n, unit: e, components: t } = this._context, r = {
8567
8571
  pageMarginLeft: 20,
8568
8572
  pageMarginTop: 20
8569
- }, i = new hc(ze.MAIN, void 0, r);
8573
+ }, i = new uc(ze.MAIN, void 0, r);
8570
8574
  i.zIndex = br;
8571
- const a = new gc(ze.BACKGROUND, void 0, r);
8575
+ const a = new hc(ze.BACKGROUND, void 0, r);
8572
8576
  a.zIndex = br, this._context.mainComponent = i, t.set(ze.MAIN, i), t.set(ze.BACKGROUND, a), n.addObjects([i], To), n.addObjects([a], sA), this._editorService.getEditor(e.getUnitId()) == null && n.enableLayerCache(To);
8573
8577
  }
8574
8578
  _initRenderRefresh() {
8575
- this._docSkeletonManagerService.currentSkeletonBefore$.pipe(rt(this.dispose$)).subscribe((n) => {
8579
+ this._docSkeletonManagerService.currentSkeletonBefore$.pipe(it(this.dispose$)).subscribe((n) => {
8576
8580
  this._create(n);
8577
8581
  });
8578
8582
  }
@@ -8612,7 +8616,7 @@ let ns = class extends lt {
8612
8616
  const I = sh(p);
8613
8617
  m = I.pageWidth, E = I.pageHeight;
8614
8618
  }
8615
- r.pageLayoutType === cn.VERTICAL ? (A += E, A += r.pageMarginTop, g === f - 1 && (A += r.pageMarginTop), c = Math.max(c, m)) : r.pageLayoutType === cn.HORIZONTAL && (c += m, g !== f - 1 && (c += r.pageMarginLeft), A = Math.max(A, E));
8619
+ r.pageLayoutType === an.VERTICAL ? (A += E, A += r.pageMarginTop, g === f - 1 && (A += r.pageMarginTop), c = Math.max(c, m)) : r.pageLayoutType === an.HORIZONTAL && (c += m, g !== f - 1 && (c += r.pageMarginLeft), A = Math.max(A, E));
8616
8620
  }
8617
8621
  r.resize(c, A), i.resize(c, A);
8618
8622
  const h = this._editorService.getEditor(o);
@@ -8623,7 +8627,7 @@ ns = oh([
8623
8627
  Ot(1, y),
8624
8628
  Ot(2, z(Ie)),
8625
8629
  Ot(3, z(ie)),
8626
- Ot(4, ke),
8630
+ Ot(4, He),
8627
8631
  Ot(5, pe),
8628
8632
  Ot(6, N)
8629
8633
  ], ns);
@@ -8674,7 +8678,7 @@ const Ca = {
8674
8678
  }, !1), !0;
8675
8679
  }
8676
8680
  };
8677
- class bo extends lt {
8681
+ class Ro extends dt {
8678
8682
  constructor(t) {
8679
8683
  super();
8680
8684
  O(this, "_previousActiveRange", null);
@@ -8728,8 +8732,8 @@ const va = {
8728
8732
  type: w.COMMAND,
8729
8733
  // eslint-disable-next-line max-lines-per-function
8730
8734
  handler: async (n, e) => {
8731
- var D, te, q, k;
8732
- const { unitId: t, newText: o, oldTextLen: s, isCompositionEnd: r, isCompositionStart: i } = e, a = n.get(y), c = n.get(pe), A = n.get(N), l = n.get(Ze), d = (D = c.getRenderById(t)) == null ? void 0 : D.with(bo), h = A.getUnit(t, _.UNIVER_DOC);
8735
+ var D, te, Y;
8736
+ const { unitId: t, newText: o, oldTextLen: s, isCompositionEnd: r, isCompositionStart: i } = e, a = n.get(y), c = n.get(pe), A = n.get(N), l = n.get(Ze), d = (D = c.getRenderById(t)) == null ? void 0 : D.with(Ro), h = A.getUnit(t, _.UNIVER_DOC);
8733
8737
  if (h == null || d == null)
8734
8738
  return !1;
8735
8739
  const u = d.getActiveRange();
@@ -8753,16 +8757,16 @@ const va = {
8753
8757
  actions: [],
8754
8758
  textRanges: R
8755
8759
  }
8756
- }, C = l.getDefaultStyle(), T = l.getStyleCache(), x = bs((te = p.customRanges) != null ? te : [], E + s, sn.includes(t)), P = Ao(
8757
- (q = p.textRuns) != null ? q : [],
8760
+ }, C = l.getDefaultStyle(), T = l.getStyleCache(), x = bs((te = p.customRanges) != null ? te : [], E + s, on.includes(t)), P = co(
8761
+ p,
8758
8762
  i ? I : E + s,
8759
8763
  C,
8760
8764
  T,
8761
- sn.includes(t)
8762
- ), b = Os((k = p.customDecorations) != null ? k : [], E + s), B = new Ee(), M = H.getInstance();
8765
+ on.includes(t)
8766
+ ), b = Os((Y = p.customDecorations) != null ? Y : [], E + s), B = new Ee(), M = H.getInstance();
8763
8767
  if (!u.collapsed && i) {
8764
- const Y = ve.selection.delete([u], p, 0, null, !1);
8765
- B.push(...Y), S.params.textRanges = [{
8768
+ const k = ve.selection.delete([u], p, 0, null, !1);
8769
+ B.push(...k), S.params.textRanges = [{
8766
8770
  startOffset: E + v,
8767
8771
  endOffset: E + v,
8768
8772
  collapsed: !0
@@ -8789,8 +8793,8 @@ const va = {
8789
8793
  startIndex: 0,
8790
8794
  endIndex: o.length - 1
8791
8795
  }] : [],
8792
- customDecorations: b.map((Y) => ({
8793
- ...Y,
8796
+ customDecorations: b.map((k) => ({
8797
+ ...k,
8794
8798
  startIndex: 0,
8795
8799
  endIndex: o.length - 1
8796
8800
  }))
@@ -8807,7 +8811,7 @@ const va = {
8807
8811
  id: "doc.command.set-zoom-ratio",
8808
8812
  handler: async (n, e) => {
8809
8813
  var d, h, u;
8810
- const t = n.get(y), o = n.get(to), s = n.get(N);
8814
+ const t = n.get(y), o = n.get(eo), s = n.get(N);
8811
8815
  let r = (d = s.getCurrentUniverDocInstance()) == null ? void 0 : d.getUnitId();
8812
8816
  if (!r) return !1;
8813
8817
  let i = 1;
@@ -8830,7 +8834,7 @@ const va = {
8830
8834
  const { shift: t } = e, o = n.get(G), s = o.getDocRanges(), r = n.get(y), a = n.get(N).getCurrentUniverDocInstance();
8831
8835
  if (!a)
8832
8836
  return !1;
8833
- const c = (g = s.find((f) => f.isActive)) != null ? g : s[0], A = a.getUnitId(), l = Ve(n, A), d = l == null ? void 0 : l.getSkeleton(), h = d == null ? void 0 : d.getViewModel().getSelfOrHeaderFooterViewModel(c == null ? void 0 : c.segmentId);
8837
+ const c = (g = s.find((f) => f.isActive)) != null ? g : s[0], A = a.getUnitId(), l = ke(n, A), d = l == null ? void 0 : l.getSkeleton(), h = d == null ? void 0 : d.getViewModel().getSelfOrHeaderFooterViewModel(c == null ? void 0 : c.segmentId);
8834
8838
  if (h == null || c == null)
8835
8839
  return !1;
8836
8840
  let u = null;
@@ -8842,7 +8846,7 @@ const va = {
8842
8846
  return o.replaceDocRanges(m), !0;
8843
8847
  }
8844
8848
  return t === !1 ? await r.executeCommand(ha.id, {
8845
- position: So.BELLOW
8849
+ position: Eo.BELLOW
8846
8850
  }) : !0;
8847
8851
  }
8848
8852
  };
@@ -8892,7 +8896,7 @@ let ss = class {
8892
8896
  };
8893
8897
  ss = ah([
8894
8898
  Ho(0, z($e)),
8895
- Ho(1, z(ro)),
8899
+ Ho(1, z(so)),
8896
8900
  Ho(2, Cs)
8897
8901
  ], ss);
8898
8902
  var ch = Object.defineProperty, Ah = Object.getOwnPropertyDescriptor, lh = (n, e, t, o) => {
@@ -8900,22 +8904,22 @@ var ch = Object.defineProperty, Ah = Object.getOwnPropertyDescriptor, lh = (n, e
8900
8904
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
8901
8905
  return o && s && ch(e, t, s), s;
8902
8906
  }, dh = (n, e) => (t, o) => e(t, o, n);
8903
- let Wn = class extends lt {
8907
+ let Vn = class extends dt {
8904
8908
  constructor(e) {
8905
8909
  super();
8906
8910
  O(this, "_docContainerController");
8907
8911
  this._injector = e, this._docContainerController = this._injector.createInstance(ss);
8908
8912
  }
8909
8913
  };
8910
- Wn = lh([
8911
- dh(0, z(ro))
8912
- ], Wn);
8914
+ Vn = lh([
8915
+ dh(0, z(so))
8916
+ ], Vn);
8913
8917
  var uh = Object.defineProperty, hh = Object.getOwnPropertyDescriptor, gh = (n, e, t, o) => {
8914
8918
  for (var s = o > 1 ? void 0 : o ? hh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
8915
8919
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
8916
8920
  return o && s && uh(e, t, s), s;
8917
8921
  }, ei = (n, e) => (t, o) => e(t, o, n);
8918
- let jn = class extends he {
8922
+ let Wn = class extends he {
8919
8923
  constructor(n, e) {
8920
8924
  super(), this._docAutoFormatService = n, this._renderManagerService = e, this._initListTabAutoFormat(), this._initListSpaceAutoFormat(), this._initDefaultEnterFormat(), this._initExitListAutoFormat();
8921
8925
  }
@@ -8942,7 +8946,7 @@ let jn = class extends he {
8942
8946
  return [{
8943
8947
  id: $o.id,
8944
8948
  params: {
8945
- type: e != null && e.shift ? Dn.decrease : Dn.increase
8949
+ type: e != null && e.shift ? Pn.decrease : Pn.increase
8946
8950
  }
8947
8951
  }];
8948
8952
  },
@@ -8971,7 +8975,7 @@ let jn = class extends he {
8971
8975
  _initListSpaceAutoFormat() {
8972
8976
  this.disposeWithMe(
8973
8977
  this._docAutoFormatService.registerAutoFormat({
8974
- id: lo.id,
8978
+ id: Ao.id,
8975
8979
  match: (n) => {
8976
8980
  var r;
8977
8981
  const { selection: e, paragraphs: t, unit: o } = n;
@@ -9001,7 +9005,7 @@ let jn = class extends he {
9001
9005
  _initExitListAutoFormat() {
9002
9006
  this.disposeWithMe(
9003
9007
  this._docAutoFormatService.registerAutoFormat({
9004
- id: dn.id,
9008
+ id: ln.id,
9005
9009
  match: (n) => {
9006
9010
  const { paragraphs: e } = n;
9007
9011
  return !!(e.length === 1 && e[0].bullet && e[0].paragraphStart === e[0].paragraphEnd);
@@ -9011,10 +9015,10 @@ let jn = class extends he {
9011
9015
  return e ? e.nestingLevel > 0 ? [{
9012
9016
  id: $o.id,
9013
9017
  params: {
9014
- type: Dn.decrease
9018
+ type: Pn.decrease
9015
9019
  }
9016
9020
  }] : [{
9017
- id: mn.id,
9021
+ id: pn.id,
9018
9022
  params: {
9019
9023
  listType: n.paragraphs[0].bullet.listType
9020
9024
  }
@@ -9026,7 +9030,7 @@ let jn = class extends he {
9026
9030
  _initDefaultEnterFormat() {
9027
9031
  this.disposeWithMe(
9028
9032
  this._docAutoFormatService.registerAutoFormat({
9029
- id: dn.id,
9033
+ id: ln.id,
9030
9034
  match: () => !0,
9031
9035
  getMutations() {
9032
9036
  return [{
@@ -9038,16 +9042,16 @@ let jn = class extends he {
9038
9042
  );
9039
9043
  }
9040
9044
  };
9041
- jn = gh([
9045
+ Wn = gh([
9042
9046
  ei(0, z(St)),
9043
9047
  ei(1, pe)
9044
- ], jn);
9048
+ ], Wn);
9045
9049
  function fh(n) {
9046
9050
  return n.rows[0].cells[0].sections[0].columns[0].lines[0];
9047
9051
  }
9048
9052
  function ph(n) {
9049
9053
  const e = n.rows[n.rows.length - 1], t = e.cells[e.cells.length - 1];
9050
- return mc(t);
9054
+ return pc(t);
9051
9055
  }
9052
9056
  function mh(n, e) {
9053
9057
  const { ed: t } = n, { skeTables: o } = e;
@@ -9068,7 +9072,7 @@ function ti(n) {
9068
9072
  lineAfterTable: o
9069
9073
  };
9070
9074
  const { st: s, ed: r } = n, i = e.type === Ce.CELL ? [e] : e.parent.pages;
9071
- return fc(i, (a) => {
9075
+ return gc(i, (a) => {
9072
9076
  a.st === r + 1 ? o = a : a.ed === s - 1 && (t = a);
9073
9077
  }), {
9074
9078
  lineBeforeTable: t,
@@ -9144,15 +9148,15 @@ function Sh(n) {
9144
9148
  return n.sections[0].columns[0].lines[0];
9145
9149
  }
9146
9150
  function Ih(n) {
9147
- const e = pc(n);
9151
+ const e = fc(n);
9148
9152
  return e.lines[e.lines.length - 1];
9149
9153
  }
9150
9154
  var Ch = Object.defineProperty, vh = Object.getOwnPropertyDescriptor, Rh = (n, e, t, o) => {
9151
9155
  for (var s = o > 1 ? void 0 : o ? vh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
9152
9156
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
9153
9157
  return o && s && Ch(e, t, s), s;
9154
- }, bn = (n, e) => (t, o) => e(t, o, n);
9155
- let zn = class extends he {
9158
+ }, Rn = (n, e) => (t, o) => e(t, o, n);
9159
+ let jn = class extends he {
9156
9160
  constructor(e, t, o, s) {
9157
9161
  super();
9158
9162
  O(this, "_onInputSubscription");
@@ -9163,16 +9167,16 @@ let zn = class extends he {
9163
9167
  super.dispose(), (e = this._onInputSubscription) == null || e.unsubscribe();
9164
9168
  }
9165
9169
  _commandExecutedListener() {
9166
- const e = [ct.id, At.id];
9170
+ const e = [At.id, lt.id];
9167
9171
  this.disposeWithMe(
9168
9172
  this._commandService.onCommandExecuted((t) => {
9169
9173
  if (!e.includes(t.id))
9170
9174
  return;
9171
9175
  const o = t.params;
9172
9176
  switch (t.id) {
9173
- case ct.id:
9174
- return this._handleMoveCursor(o.direction);
9175
9177
  case At.id:
9178
+ return this._handleMoveCursor(o.direction);
9179
+ case lt.id:
9176
9180
  return this._handleShiftMoveSelection(o.direction);
9177
9181
  default:
9178
9182
  throw new Error("Unknown command");
@@ -9240,7 +9244,7 @@ let zn = class extends he {
9240
9244
  ], !1);
9241
9245
  return;
9242
9246
  }
9243
- const P = new at(C, r).getRangePointData(
9247
+ const P = new ct(C, r).getRangePointData(
9244
9248
  x,
9245
9249
  x
9246
9250
  ).cursorList[0];
@@ -9319,7 +9323,7 @@ let zn = class extends he {
9319
9323
  ], !1);
9320
9324
  return;
9321
9325
  }
9322
- const P = new at(T, r).getRangePointData(
9326
+ const P = new ct(T, r).getRangePointData(
9323
9327
  x,
9324
9328
  x
9325
9329
  ).cursorList[0];
@@ -9442,7 +9446,7 @@ let zn = class extends he {
9442
9446
  }
9443
9447
  _scrollToFocusNodePosition(e, t) {
9444
9448
  var s;
9445
- const o = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.with(Vn);
9449
+ const o = (s = this._renderManagerService.getRenderById(e)) == null ? void 0 : s.with(kn);
9446
9450
  o != null && o.scrollToRange({
9447
9451
  startOffset: t,
9448
9452
  endOffset: t,
@@ -9453,12 +9457,12 @@ let zn = class extends he {
9453
9457
  return iA(this._univerInstanceService, this._renderManagerService);
9454
9458
  }
9455
9459
  };
9456
- zn = Rh([
9457
- bn(0, N),
9458
- bn(1, pe),
9459
- bn(2, z(G)),
9460
- bn(3, y)
9461
- ], zn);
9460
+ jn = Rh([
9461
+ Rn(0, N),
9462
+ Rn(1, pe),
9463
+ Rn(2, z(G)),
9464
+ Rn(3, y)
9465
+ ], jn);
9462
9466
  function ni(n, e) {
9463
9467
  var o, s;
9464
9468
  let t = null;
@@ -9500,7 +9504,7 @@ const bh = "univer-create", Oh = "univer-create-item", xh = "univer-create-label
9500
9504
  /* @__PURE__ */ ce("div", { className: ft.createItem, children: [
9501
9505
  /* @__PURE__ */ V("span", { className: ft.createLabel, children: t.t("toolbar.table.rowCount") }),
9502
9506
  /* @__PURE__ */ V(
9503
- ln,
9507
+ An,
9504
9508
  {
9505
9509
  min: 1,
9506
9510
  max: 20,
@@ -9516,7 +9520,7 @@ const bh = "univer-create", Oh = "univer-create-item", xh = "univer-create-label
9516
9520
  /* @__PURE__ */ ce("div", { className: ft.createItem, children: [
9517
9521
  /* @__PURE__ */ V("span", { className: ft.createLabel, children: t.t("toolbar.table.colCount") }),
9518
9522
  /* @__PURE__ */ V(
9519
- ln,
9523
+ An,
9520
9524
  {
9521
9525
  min: 1,
9522
9526
  max: 20,
@@ -9536,7 +9540,7 @@ var Bh = Object.defineProperty, Mh = Object.getOwnPropertyDescriptor, _h = (n, e
9536
9540
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
9537
9541
  return o && s && Bh(e, t, s), s;
9538
9542
  }, oi = (n, e) => (t, o) => e(t, o, n);
9539
- let Gn = class extends he {
9543
+ let zn = class extends he {
9540
9544
  constructor(n, e) {
9541
9545
  super(), this._commandService = n, this._componentManager = e, this._initialize();
9542
9546
  }
@@ -9555,16 +9559,16 @@ let Gn = class extends he {
9555
9559
  _init() {
9556
9560
  }
9557
9561
  };
9558
- Gn = _h([
9562
+ zn = _h([
9559
9563
  oi(0, y),
9560
- oi(1, z(ao))
9561
- ], Gn);
9564
+ oi(1, z(io))
9565
+ ], zn);
9562
9566
  const si = 4;
9563
9567
  var Ph = Object.defineProperty, Dh = Object.getOwnPropertyDescriptor, wh = (n, e, t, o) => {
9564
9568
  for (var s = o > 1 ? void 0 : o ? Dh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
9565
9569
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
9566
9570
  return o && s && Ph(e, t, s), s;
9567
- }, On = (n, e) => (t, o) => e(t, o, n);
9571
+ }, bn = (n, e) => (t, o) => e(t, o, n);
9568
9572
  function Ta(n, e) {
9569
9573
  const t = ri(n.left, n.top, e), o = ri(n.right, n.bottom, e);
9570
9574
  return {
@@ -9604,7 +9608,7 @@ const ko = (n, e) => {
9604
9608
  const { scene: t, mainComponent: o, engine: s } = e, r = e.with(ie).getSkeleton(), i = r.findNodePositionByCharIndex(n.startOffset, !0, n.segmentId, n.segmentPage), a = r.findNodePositionByCharIndex(n.endOffset, !0, n.segmentId, n.segmentPage), c = o;
9605
9609
  if (!a || !i)
9606
9610
  return;
9607
- const A = c.getOffsetConfig(), { docsLeft: l, docsTop: d } = A, h = s.getCanvasElement(), u = h.getBoundingClientRect(), g = bi(h.style.width), { top: f, left: p, width: m } = u, E = m / g, { scaleX: I, scaleY: v } = t.getAncestorScale(), R = new at(A, r), { borderBoxPointGroup: S } = R.getRangePointData(i, a);
9611
+ const A = c.getOffsetConfig(), { docsLeft: l, docsTop: d } = A, h = s.getCanvasElement(), u = h.getBoundingClientRect(), g = bi(h.style.width), { top: f, left: p, width: m } = u, E = m / g, { scaleX: I, scaleY: v } = t.getAncestorScale(), R = new ct(A, r), { borderBoxPointGroup: S } = R.getRangePointData(i, a);
9608
9612
  return Ts(S).map((x) => Ta(x, t)).map((x) => ({
9609
9613
  left: (x.left + l * I) * E + p,
9610
9614
  right: (x.right + l * I) * E + p,
@@ -9630,7 +9634,7 @@ let rs = class extends he {
9630
9634
  top: m.top * R + E,
9631
9635
  bottom: m.bottom * R + E
9632
9636
  };
9633
- }, o = t(), s = new Fe(o), r = new wn();
9637
+ }, o = t(), s = new Le(o), r = new Dn();
9634
9638
  r.add(this._commandService.onCommandExecuted((a) => {
9635
9639
  if (a.id === qe.id || a.id === J.id) {
9636
9640
  const c = t();
@@ -9648,7 +9652,7 @@ let rs = class extends he {
9648
9652
  }
9649
9653
  _createRangePositionObserver(n, e) {
9650
9654
  var i;
9651
- const t = (i = ko(n, e)) != null ? i : [], o = new Fe(t), s = new wn();
9655
+ const t = (i = ko(n, e)) != null ? i : [], o = new Le(t), s = new Dn();
9652
9656
  s.add(this._commandService.onCommandExecuted((a) => {
9653
9657
  if ((a.id === qe.id || a.id === J.id) && a.params.unitId === e.unitId) {
9654
9658
  const A = ko(n, e);
@@ -9705,7 +9709,7 @@ let rs = class extends he {
9705
9709
  const { direction: s = "top", multipleDirection: r } = e, i = this._renderManagerService.getRenderById(t);
9706
9710
  if (!i)
9707
9711
  throw new Error(`Current render not found, unitId: ${t}`);
9708
- const { positions: a, positions$: c, disposable: A } = this._createRangePositionObserver(n, i), l = c.pipe(fn((h) => s.includes("top") ? h[0] : h[h.length - 1])), d = this._globalPopupManagerService.addPopup({
9712
+ const { positions: a, positions$: c, disposable: A } = this._createRangePositionObserver(n, i), l = c.pipe(gn((h) => s.includes("top") ? h[0] : h[h.length - 1])), d = this._globalPopupManagerService.addPopup({
9709
9713
  ...e,
9710
9714
  unitId: t,
9711
9715
  subUnitId: "default",
@@ -9726,10 +9730,10 @@ let rs = class extends he {
9726
9730
  // #endregion
9727
9731
  };
9728
9732
  rs = wh([
9729
- On(0, z(Nc)),
9730
- On(1, pe),
9731
- On(2, N),
9732
- On(3, y)
9733
+ bn(0, z(Nc)),
9734
+ bn(1, pe),
9735
+ bn(2, N),
9736
+ bn(3, y)
9733
9737
  ], rs);
9734
9738
  var Nh = Object.defineProperty, Qh = Object.getOwnPropertyDescriptor, Uh = (n, e, t, o) => {
9735
9739
  for (var s = o > 1 ? void 0 : o ? Qh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
@@ -9747,7 +9751,7 @@ const Fh = (n, e, t, o) => {
9747
9751
  const a = t.findNodePositionByCharIndex(i, !0, n.segmentId, o);
9748
9752
  if (!a || !s)
9749
9753
  return;
9750
- const c = e.getOffsetConfig(), A = new at(c, t), { borderBoxPointGroup: l } = A.getRangePointData(s, a);
9754
+ const c = e.getOffsetConfig(), A = new ct(c, t), { borderBoxPointGroup: l } = A.getRangePointData(s, a);
9751
9755
  return Ts(l).map((m) => ({
9752
9756
  top: m.top + c.docsTop - si,
9753
9757
  bottom: m.bottom + c.docsTop + si,
@@ -9758,7 +9762,7 @@ const Fh = (n, e, t, o) => {
9758
9762
  const s = t.findPositionByGlyph(n, o);
9759
9763
  if (!s)
9760
9764
  return;
9761
- const r = e.getOffsetConfig(), i = { ...s, isBack: !0 }, a = new at(r, t), { borderBoxPointGroup: c } = a.getRangePointData(i, i), l = Ts(c)[0];
9765
+ const r = e.getOffsetConfig(), i = { ...s, isBack: !0 }, a = new ct(r, t), { borderBoxPointGroup: c } = a.getRangePointData(i, i), l = Ts(c)[0];
9762
9766
  return {
9763
9767
  top: l.top + r.docsTop,
9764
9768
  bottom: l.bottom + r.docsTop,
@@ -9766,10 +9770,10 @@ const Fh = (n, e, t, o) => {
9766
9770
  right: l.left + r.docsLeft + n.width
9767
9771
  };
9768
9772
  };
9769
- let Yn = class extends he {
9773
+ let Gn = class extends he {
9770
9774
  constructor(e, t) {
9771
9775
  super();
9772
- O(this, "_hoverCustomRanges$", new Fe([]));
9776
+ O(this, "_hoverCustomRanges$", new Le([]));
9773
9777
  O(this, "hoverCustomRanges$", this._hoverCustomRanges$.pipe(Cr((e, t) => e.length === t.length && e.every((o, s) => t[s].range.rangeId === o.range.rangeId && t[s].segmentId === o.segmentId && t[s].segmentPageIndex === o.segmentPageIndex && t[s].range.startIndex === o.range.startIndex))));
9774
9778
  O(this, "_clickCustomRanges$", new Se());
9775
9779
  O(this, "clickCustomRanges$", this._clickCustomRanges$.asObservable());
@@ -9810,15 +9814,15 @@ let Yn = class extends he {
9810
9814
  this.disposeWithMe(this._skeleton.dirty$.subscribe(() => {
9811
9815
  this._customRangeDirty = !0, this._bulletDirty = !0;
9812
9816
  })), this.disposeWithMe(
9813
- nn(this._context.engine.onTransformChange$).pipe(
9814
- Un((e) => e.type === Oi.resize)
9817
+ tn(this._context.engine.onTransformChange$).pipe(
9818
+ Qn((e) => e.type === Oi.resize)
9815
9819
  ).subscribe(() => {
9816
9820
  this._customRangeDirty = !0, this._bulletDirty = !0;
9817
9821
  })
9818
9822
  );
9819
9823
  }
9820
9824
  _initEvents() {
9821
- this.disposeWithMe(nn(this._context.scene.onPointerMove$).pipe(Di(30)).subscribe((o) => {
9825
+ this.disposeWithMe(tn(this._context.scene.onPointerMove$).pipe(Di(30)).subscribe((o) => {
9822
9826
  this._hoverCustomRanges$.next(
9823
9827
  this._calcActiveRanges(o)
9824
9828
  ), this._hoverBullet$.next(
@@ -9827,10 +9831,10 @@ let Yn = class extends he {
9827
9831
  })), this.disposeWithMe(this._context.scene.onPointerEnter$.subscribeEvent(() => {
9828
9832
  this._hoverBullet$.next(null), this._hoverCustomRanges$.next([]);
9829
9833
  }));
9830
- const e = nn(this._context.mainComponent.onPointerDown$), t = nn(this._context.scene.onPointerUp$);
9834
+ const e = tn(this._context.mainComponent.onPointerDown$), t = tn(this._context.scene.onPointerUp$);
9831
9835
  this.disposeWithMe(e.pipe(
9832
- kc((o) => t.pipe(Vc(1), fn((s) => ({ down: o, up: s })))),
9833
- Un(({ down: o, up: s }) => o.target === s.target && s.timeStamp - o.timeStamp < 300)
9836
+ kc((o) => t.pipe(Vc(1), gn((s) => ({ down: o, up: s })))),
9837
+ Qn(({ down: o, up: s }) => o.target === s.target && s.timeStamp - o.timeStamp < 300)
9834
9838
  // filter(({ down, up }) => down.offsetX === up.offsetX && down.offsetY === up.offsetY)
9835
9839
  ).subscribe(({ down: o }) => {
9836
9840
  if (o.button === 2)
@@ -9943,14 +9947,14 @@ let Yn = class extends he {
9943
9947
  });
9944
9948
  }
9945
9949
  };
9946
- Yn = Uh([
9950
+ Gn = Uh([
9947
9951
  Lh(1, z(ie))
9948
- ], Yn);
9952
+ ], Gn);
9949
9953
  var kh = Object.defineProperty, Vh = Object.getOwnPropertyDescriptor, Wh = (n, e, t, o) => {
9950
9954
  for (var s = o > 1 ? void 0 : o ? Vh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
9951
9955
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
9952
9956
  return o && s && kh(e, t, s), s;
9953
- }, xn = (n, e) => (t, o) => e(t, o, n);
9957
+ }, On = (n, e) => (t, o) => e(t, o, n);
9954
9958
  let is = class extends he {
9955
9959
  constructor(n, e, t, o, s) {
9956
9960
  super(), this._context = n, this._docSkeletonManagerService = e, this._commandService = t, this._docEventManagerService = o, this._textSelectionManagerService = s, this._initPointerDownObserver(), this._initHoverCursor();
@@ -9973,23 +9977,23 @@ let is = class extends he {
9973
9977
  );
9974
9978
  }
9975
9979
  _getTransformCoordForDocumentOffset(n, e, t, o) {
9976
- const { documentTransform: s } = n.getOffsetConfig(), r = e.transformVector2SceneCoord(an.FromArray([t, o]));
9980
+ const { documentTransform: s } = n.getOffsetConfig(), r = e.transformVector2SceneCoord(rn.FromArray([t, o]));
9977
9981
  if (r)
9978
9982
  return s.clone().invert().applyPoint(r);
9979
9983
  }
9980
9984
  };
9981
9985
  is = Wh([
9982
- xn(1, z(ie)),
9983
- xn(2, y),
9984
- xn(3, z(Yn)),
9985
- xn(4, z(G))
9986
+ On(1, z(ie)),
9987
+ On(2, y),
9988
+ On(3, z(Gn)),
9989
+ On(4, z(G))
9986
9990
  ], is);
9987
9991
  var jh = Object.defineProperty, zh = Object.getOwnPropertyDescriptor, Gh = (n, e, t, o) => {
9988
9992
  for (var s = o > 1 ? void 0 : o ? zh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
9989
9993
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
9990
9994
  return o && s && jh(e, t, s), s;
9991
- }, Zt = (n, e) => (t, o) => e(t, o, n);
9992
- let qn = class extends lt {
9995
+ }, Jt = (n, e) => (t, o) => e(t, o, n);
9996
+ let Yn = class extends dt {
9993
9997
  constructor(n, e, t, o, s, r) {
9994
9998
  super(), this._context = n, this._commandService = e, this._docClipboardService = t, this._docSelectionRenderService = o, this._contextService = s, this._editorService = r, this._init();
9995
9999
  }
@@ -9998,9 +10002,9 @@ let qn = class extends lt {
9998
10002
  }
9999
10003
  _initLegacyPasteCommand() {
10000
10004
  var n;
10001
- (n = this._docSelectionRenderService) == null || n.onPaste$.pipe(rt(this.dispose$)).subscribe((e) => {
10005
+ (n = this._docSelectionRenderService) == null || n.onPaste$.pipe(it(this.dispose$)).subscribe((e) => {
10002
10006
  var a, c, A;
10003
- if (!Co(this._contextService))
10007
+ if (!Io(this._contextService))
10004
10008
  return;
10005
10009
  e.event.preventDefault();
10006
10010
  const t = e.event;
@@ -10010,13 +10014,13 @@ let qn = class extends lt {
10010
10014
  });
10011
10015
  }
10012
10016
  };
10013
- qn = Gh([
10014
- Zt(1, y),
10015
- Zt(2, In),
10016
- Zt(3, z(Ie)),
10017
- Zt(4, ps),
10018
- Zt(5, ke)
10019
- ], qn);
10017
+ Yn = Gh([
10018
+ Jt(1, y),
10019
+ Jt(2, Sn),
10020
+ Jt(3, z(Ie)),
10021
+ Jt(4, ps),
10022
+ Jt(5, He)
10023
+ ], Yn);
10020
10024
  var Yh = Object.defineProperty, qh = Object.getOwnPropertyDescriptor, Kh = (n, e, t, o) => {
10021
10025
  for (var s = o > 1 ? void 0 : o ? qh(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10022
10026
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
@@ -10024,7 +10028,7 @@ var Yh = Object.defineProperty, qh = Object.getOwnPropertyDescriptor, Kh = (n, e
10024
10028
  }, ai = (n, e) => (t, o) => e(t, o, n);
10025
10029
  const Xh = [
10026
10030
  hi,
10027
- Ya,
10031
+ Ga,
10028
10032
  Is,
10029
10033
  et
10030
10034
  ];
@@ -10056,7 +10060,7 @@ var Jh = Object.defineProperty, Zh = Object.getOwnPropertyDescriptor, $h = (n, e
10056
10060
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
10057
10061
  return o && s && Jh(e, t, s), s;
10058
10062
  }, xt = (n, e) => (t, o) => e(t, o, n);
10059
- let Kn = class extends he {
10063
+ let qn = class extends he {
10060
10064
  constructor(e, t, o, s, r, i, a) {
10061
10065
  super();
10062
10066
  O(this, "_initialEditors", /* @__PURE__ */ new Set());
@@ -10110,13 +10114,13 @@ let Kn = class extends he {
10110
10114
  "univer-formula-help-param"
10111
10115
  ];
10112
10116
  this.disposeWithMe(
10113
- Le(window, "mousedown").subscribe((o) => {
10117
+ Ue(window, "mousedown").subscribe((o) => {
10114
10118
  const r = o.target.classList[0] || "";
10115
- qa(r, e) && o.stopPropagation();
10119
+ Ya(r, e) && o.stopPropagation();
10116
10120
  })
10117
10121
  ), this._univerInstanceService.getAllUnitsForType(_.UNIVER_SHEET).forEach((o) => {
10118
10122
  const s = o.getUnitId(), r = this._renderManagerService.getRenderById(s), i = r == null ? void 0 : r.engine.getCanvas().getCanvasEle();
10119
- i != null && Le(i, "mousedown").subscribe((a) => {
10123
+ i != null && Ue(i, "mousedown").subscribe((a) => {
10120
10124
  a.stopPropagation();
10121
10125
  });
10122
10126
  });
@@ -10139,19 +10143,19 @@ let Kn = class extends he {
10139
10143
  );
10140
10144
  }
10141
10145
  };
10142
- Kn = $h([
10146
+ qn = $h([
10143
10147
  xt(1, N),
10144
- xt(2, ke),
10148
+ xt(2, He),
10145
10149
  xt(3, y),
10146
10150
  xt(4, z(Ie)),
10147
10151
  xt(5, z(ie)),
10148
10152
  xt(6, pe)
10149
- ], Kn);
10153
+ ], qn);
10150
10154
  var eg = Object.defineProperty, tg = Object.getOwnPropertyDescriptor, ng = (n, e, t, o) => {
10151
10155
  for (var s = o > 1 ? void 0 : o ? tg(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10152
10156
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
10153
10157
  return o && s && eg(e, t, s), s;
10154
- }, Tn = (n, e) => (t, o) => e(t, o, n);
10158
+ }, xn = (n, e) => (t, o) => e(t, o, n);
10155
10159
  let cs = class extends he {
10156
10160
  constructor(e, t, o, s, r) {
10157
10161
  super();
@@ -10208,16 +10212,16 @@ let cs = class extends he {
10208
10212
  }
10209
10213
  };
10210
10214
  cs = ng([
10211
- Tn(1, z(Ie)),
10212
- Tn(2, z(bo)),
10213
- Tn(3, z(ie)),
10214
- Tn(4, y)
10215
+ xn(1, z(Ie)),
10216
+ xn(2, z(Ro)),
10217
+ xn(3, z(ie)),
10218
+ xn(4, y)
10215
10219
  ], cs);
10216
10220
  var og = Object.defineProperty, sg = Object.getOwnPropertyDescriptor, rg = (n, e, t, o) => {
10217
10221
  for (var s = o > 1 ? void 0 : o ? sg(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10218
10222
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
10219
10223
  return o && s && og(e, t, s), s;
10220
- }, yn = (n, e) => (t, o) => e(t, o, n);
10224
+ }, Tn = (n, e) => (t, o) => e(t, o, n);
10221
10225
  let As = class extends he {
10222
10226
  constructor(e, t, o, s, r) {
10223
10227
  super();
@@ -10233,13 +10237,13 @@ let As = class extends he {
10233
10237
  }
10234
10238
  _initialNormalInput() {
10235
10239
  this._onInputSubscription = this._docSelectionRenderService.onInput$.subscribe(async (e) => {
10236
- var p, m, E;
10240
+ var p, m;
10237
10241
  if (e == null)
10238
10242
  return;
10239
10243
  const { unitId: t } = this._context, { event: o, content: s = "", activeRange: r } = e, i = o, a = this._docSkeletonManagerService.getSkeleton();
10240
10244
  if (i.data == null || a == null || r == null)
10241
10245
  return;
10242
- const { segmentId: c } = r, l = this._context.unit.getSelfOrHeaderFooterModel(c).getBody(), d = this._docMenuStyleService.getDefaultStyle(), h = this._docMenuStyleService.getStyleCache(), u = bs((p = l == null ? void 0 : l.customRanges) != null ? p : [], r.endOffset, sn.includes(t)), g = Ao((m = l == null ? void 0 : l.textRuns) != null ? m : [], r.endOffset, d, h, sn.includes(t)), f = Os((E = l == null ? void 0 : l.customDecorations) != null ? E : [], r.endOffset);
10246
+ const { segmentId: c } = r, l = this._context.unit.getSelfOrHeaderFooterModel(c).getBody(), d = this._docMenuStyleService.getDefaultStyle(), h = this._docMenuStyleService.getStyleCache(), u = bs((p = l == null ? void 0 : l.customRanges) != null ? p : [], r.endOffset, on.includes(t)), g = co(l, r.endOffset, d, h, on.includes(t)), f = Os((m = l == null ? void 0 : l.customDecorations) != null ? m : [], r.endOffset);
10243
10247
  await this._commandService.executeCommand(Hs.id, {
10244
10248
  unitId: t,
10245
10249
  body: {
@@ -10256,23 +10260,23 @@ let As = class extends he {
10256
10260
  startIndex: 0,
10257
10261
  endIndex: s.length - 1
10258
10262
  }] : [],
10259
- customDecorations: f.map((I) => ({
10260
- ...I,
10263
+ customDecorations: f.map((E) => ({
10264
+ ...E,
10261
10265
  startIndex: 0,
10262
10266
  endIndex: s.length - 1
10263
10267
  }))
10264
10268
  },
10265
10269
  range: r,
10266
10270
  segmentId: c
10267
- }), s === " " && await this._commandService.executeCommand(lo.id);
10271
+ }), s === " " && await this._commandService.executeCommand(Ao.id);
10268
10272
  });
10269
10273
  }
10270
10274
  };
10271
10275
  As = rg([
10272
- yn(1, z(Ie)),
10273
- yn(2, z(ie)),
10274
- yn(3, y),
10275
- yn(4, z(Ze))
10276
+ Tn(1, z(Ie)),
10277
+ Tn(2, z(ie)),
10278
+ Tn(3, y),
10279
+ Tn(4, z(Ze))
10276
10280
  ], As);
10277
10281
  class rr extends he {
10278
10282
  constructor(e) {
@@ -10280,7 +10284,7 @@ class rr extends he {
10280
10284
  }
10281
10285
  calculatePagePosition() {
10282
10286
  var v, R;
10283
- const e = it(this._context), o = (R = (v = this._context.unit.getSettings()) == null ? void 0 : v.zoomRatio) != null ? R : 1, { document: s, scene: r, docBackground: i } = e, a = r == null ? void 0 : r.getParent(), { width: c, height: A, pageMarginLeft: l, pageMarginTop: d } = s;
10287
+ const e = at(this._context), o = (R = (v = this._context.unit.getSettings()) == null ? void 0 : v.zoomRatio) != null ? R : 1, { document: s, scene: r, docBackground: i } = e, a = r == null ? void 0 : r.getParent(), { width: c, height: A, pageMarginLeft: l, pageMarginTop: d } = s;
10284
10288
  if (a == null || c === Number.POSITIVE_INFINITY || A === Number.POSITIVE_INFINITY)
10285
10289
  return;
10286
10290
  const { width: h, height: u } = a;
@@ -10301,13 +10305,13 @@ let ls = class extends he {
10301
10305
  constructor(n, e, t) {
10302
10306
  super(), this._context = n, this._docPageLayoutService = e, this._textSelectionManagerService = t;
10303
10307
  const o = this._context.unitId;
10304
- if (no(o) && o !== et) return this;
10308
+ if (to(o) && o !== et) return this;
10305
10309
  this._initResize();
10306
10310
  }
10307
10311
  _initResize() {
10308
10312
  this.disposeWithMe(
10309
- nn(this._context.engine.onTransformChange$).pipe(
10310
- Un((n) => n.type === Oi.resize),
10313
+ tn(this._context.engine.onTransformChange$).pipe(
10314
+ Qn((n) => n.type === Oi.resize),
10311
10315
  Di(0, Wc)
10312
10316
  ).subscribe(() => {
10313
10317
  this._docPageLayoutService.calculatePagePosition(), this._textSelectionManagerService.refreshSelection();
@@ -10334,7 +10338,7 @@ let ds = class extends he {
10334
10338
  this._init(), this._skeletonListener(), this._commandExecutedListener(), this._refreshListener(), this._syncSelection();
10335
10339
  }
10336
10340
  _init() {
10337
- const { unitId: e } = this._context, t = it(this._context);
10341
+ const { unitId: e } = this._context, t = at(this._context);
10338
10342
  t == null || t.document == null || this._loadedMap.has(t.document) || (this._initialMain(e), this._loadedMap.add(t.document));
10339
10343
  }
10340
10344
  _refreshListener() {
@@ -10359,7 +10363,7 @@ let ds = class extends he {
10359
10363
  }
10360
10364
  // eslint-disable-next-line max-lines-per-function
10361
10365
  _initialMain(e) {
10362
- const t = it(this._context), { document: o, scene: s } = t;
10366
+ const t = at(this._context), { document: o, scene: s } = t;
10363
10367
  this.disposeWithMe(o.onPointerEnter$.subscribeEvent(() => {
10364
10368
  this._isEditorReadOnly(e) || (o.cursor = Et.TEXT);
10365
10369
  })), this.disposeWithMe(o.onPointerLeave$.subscribeEvent(() => {
@@ -10372,7 +10376,7 @@ let ds = class extends he {
10372
10376
  const c = this._docSkeletonManagerService.getSkeleton(), { offsetX: A, offsetY: l } = r, d = this._getTransformCoordForDocumentOffset(A, l);
10373
10377
  if (d != null) {
10374
10378
  const {
10375
- pageLayoutType: h = cn.VERTICAL,
10379
+ pageLayoutType: h = an.VERTICAL,
10376
10380
  pageMarginLeft: u,
10377
10381
  pageMarginTop: g
10378
10382
  } = o.getOffsetConfig(), { editArea: f } = c.findEditAreaByCoord(
@@ -10398,10 +10402,10 @@ let ds = class extends he {
10398
10402
  }));
10399
10403
  }
10400
10404
  _getTransformCoordForDocumentOffset(e, t) {
10401
- const o = it(this._context), { document: s, scene: r } = o, { documentTransform: i } = s.getOffsetConfig(), a = r.getViewports()[0];
10405
+ const o = at(this._context), { document: s, scene: r } = o, { documentTransform: i } = s.getOffsetConfig(), a = r.getViewports()[0];
10402
10406
  if (a == null)
10403
10407
  return;
10404
- const c = a.transformVector2SceneCoord(an.FromArray([e, t]));
10408
+ const c = a.transformVector2SceneCoord(rn.FromArray([e, t]));
10405
10409
  return i.clone().invert().applyPoint(c);
10406
10410
  }
10407
10411
  _isEditorReadOnly(e) {
@@ -10429,7 +10433,7 @@ let ds = class extends he {
10429
10433
  this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe((e) => {
10430
10434
  if (!e) return;
10431
10435
  const { unitId: t } = this._context;
10432
- if (!no(t)) {
10436
+ if (!to(t)) {
10433
10437
  this._docSelectionRenderService.focus();
10434
10438
  const r = this._context.unit.getSnapshot(), i = Yi(r);
10435
10439
  this._docSelectionManagerService.replaceDocRanges([
@@ -10447,7 +10451,7 @@ let ds = class extends he {
10447
10451
  };
10448
10452
  ds = dg([
10449
10453
  Tt(1, y),
10450
- Tt(2, ke),
10454
+ Tt(2, He),
10451
10455
  Tt(3, N),
10452
10456
  Tt(4, z(Ie)),
10453
10457
  Tt(5, z(ie)),
@@ -10468,7 +10472,7 @@ let us = class extends he {
10468
10472
  return;
10469
10473
  const { unitId: e, scene: t } = this._context;
10470
10474
  this._editorService.isEditor(e) || this.disposeWithMe(t.onMouseWheel$.subscribeEvent((o) => {
10471
- if (!o.ctrlKey || !this._contextService.getContextValue(gn))
10475
+ if (!o.ctrlKey || !this._contextService.getContextValue(hn))
10472
10476
  return;
10473
10477
  const s = this._univerInstanceService.getCurrentUniverDocInstance();
10474
10478
  if (!s)
@@ -10507,7 +10511,7 @@ let us = class extends he {
10507
10511
  }
10508
10512
  })), this.disposeWithMe(
10509
10513
  this._commandService.beforeCommandExecuted((e) => {
10510
- e.id === vo.id && this._commandService.executeCommand(os.id, {
10514
+ e.id === Co.id && this._commandService.executeCommand(os.id, {
10511
10515
  zoomRatio: 1,
10512
10516
  unitId: this._context.unitId
10513
10517
  });
@@ -10516,7 +10520,7 @@ let us = class extends he {
10516
10520
  }
10517
10521
  updateViewZoom(n, e = !0) {
10518
10522
  var o;
10519
- const t = it(this._context);
10523
+ const t = at(this._context);
10520
10524
  t.scene.scale(n, n), this._editorService.isEditor(this._context.unitId) || this._docPageLayoutService.calculatePagePosition(), e && !this._editorService.isEditor(this._context.unitId) && this._textSelectionManagerService.refreshSelection(), (o = t.scene.getTransformer()) == null || o.clearSelectedObjects();
10521
10525
  }
10522
10526
  };
@@ -10526,19 +10530,19 @@ us = gg([
10526
10530
  pt(3, N),
10527
10531
  pt(4, y),
10528
10532
  pt(5, z(G)),
10529
- pt(6, ke),
10533
+ pt(6, He),
10530
10534
  pt(7, z(rr))
10531
10535
  ], us);
10532
10536
  var fg = Object.defineProperty, pg = Object.getOwnPropertyDescriptor, mg = (n, e, t, o) => {
10533
10537
  for (var s = o > 1 ? void 0 : o ? pg(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10534
10538
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
10535
10539
  return o && s && fg(e, t, s), s;
10536
- }, $t = (n, e) => (t, o) => e(t, o, n);
10540
+ }, Zt = (n, e) => (t, o) => e(t, o, n);
10537
10541
  const Ai = 300;
10538
- let Xn = class extends lt {
10542
+ let Kn = class extends dt {
10539
10543
  constructor(e, t, o, s, r) {
10540
10544
  super();
10541
- O(this, "_docStateChange$", new Fe(null));
10545
+ O(this, "_docStateChange$", new Le(null));
10542
10546
  O(this, "docStateChange$", this._docStateChange$.asObservable());
10543
10547
  // This cache used for history compose.
10544
10548
  O(this, "_historyStateCache", /* @__PURE__ */ new Map());
@@ -10575,11 +10579,11 @@ let Xn = class extends lt {
10575
10579
  );
10576
10580
  }
10577
10581
  _listenDocStateChange() {
10578
- this._docStateEmitService.docStateChangeParams$.pipe(rt(this.dispose$)).subscribe((e) => {
10582
+ this._docStateEmitService.docStateChangeParams$.pipe(it(this.dispose$)).subscribe((e) => {
10579
10583
  var a;
10580
10584
  if (e == null)
10581
10585
  return;
10582
- const { isCompositionEnd: t, isSync: o, syncer: s, ...r } = e, i = (a = this._renderManagerService.getRenderById(o ? s : e.unitId)) == null ? void 0 : a.with(bo);
10586
+ const { isCompositionEnd: t, isSync: o, syncer: s, ...r } = e, i = (a = this._renderManagerService.getRenderById(o ? s : e.unitId)) == null ? void 0 : a.with(Ro);
10583
10587
  if (i != null) {
10584
10588
  if (t) {
10585
10589
  const c = i.fetchComposedUndoRedoMutationParams();
@@ -10654,25 +10658,25 @@ let Xn = class extends lt {
10654
10658
  t.length = 0, this._docStateChange$.next(u);
10655
10659
  }
10656
10660
  };
10657
- Xn = mg([
10658
- $t(0, z(to)),
10659
- $t(1, y),
10660
- $t(2, N),
10661
- $t(3, z($a)),
10662
- $t(4, pe)
10663
- ], Xn);
10661
+ Kn = mg([
10662
+ Zt(0, z(eo)),
10663
+ Zt(1, y),
10664
+ Zt(2, N),
10665
+ Zt(3, z(Za)),
10666
+ Zt(4, pe)
10667
+ ], Kn);
10664
10668
  var Eg = Object.defineProperty, Sg = Object.getOwnPropertyDescriptor, Ig = (n, e, t, o) => {
10665
10669
  for (var s = o > 1 ? void 0 : o ? Sg(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10666
10670
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
10667
10671
  return o && s && Eg(e, t, s), s;
10668
10672
  }, li = (n, e) => (t, o) => e(t, o, n);
10669
10673
  const di = "univer-doc-main-canvas";
10670
- let Jn = class extends lt {
10674
+ let Xn = class extends dt {
10671
10675
  constructor(n, e) {
10672
10676
  super(), this._instanceSrv = n, this._renderManagerService = e, this._init();
10673
10677
  }
10674
10678
  _init() {
10675
- this._renderManagerService.createRender$.pipe(rt(this.dispose$)).subscribe((n) => this._createRenderWithId(n)), this._instanceSrv.getAllUnitsForType(_.UNIVER_DOC).forEach((n) => this._createRenderer(n)), this._instanceSrv.getTypeOfUnitAdded$(_.UNIVER_DOC).pipe(rt(this.dispose$)).subscribe((n) => this._createRenderer(n)), this._instanceSrv.getTypeOfUnitDisposed$(_.UNIVER_DOC).pipe(rt(this.dispose$)).subscribe((n) => this._disposeRenderer(n));
10679
+ this._renderManagerService.createRender$.pipe(it(this.dispose$)).subscribe((n) => this._createRenderWithId(n)), this._instanceSrv.getAllUnitsForType(_.UNIVER_DOC).forEach((n) => this._createRenderer(n)), this._instanceSrv.getTypeOfUnitAdded$(_.UNIVER_DOC).pipe(it(this.dispose$)).subscribe((n) => this._createRenderer(n)), this._instanceSrv.getTypeOfUnitDisposed$(_.UNIVER_DOC).pipe(it(this.dispose$)).subscribe((n) => this._disposeRenderer(n));
10676
10680
  }
10677
10681
  _createRenderer(n) {
10678
10682
  var o;
@@ -10689,10 +10693,10 @@ let Jn = class extends lt {
10689
10693
  this._renderManagerService.removeRender(e);
10690
10694
  }
10691
10695
  };
10692
- Jn = Ig([
10696
+ Xn = Ig([
10693
10697
  li(0, N),
10694
10698
  li(1, pe)
10695
- ], Jn);
10699
+ ], Xn);
10696
10700
  class Cg extends he {
10697
10701
  constructor() {
10698
10702
  super(...arguments);
@@ -10701,7 +10705,7 @@ class Cg extends he {
10701
10705
  O(this, "selectionChange$", this._selectionChange$.asObservable());
10702
10706
  O(this, "_openSelector$", new Se());
10703
10707
  O(this, "openSelector$", this._openSelector$.asObservable());
10704
- O(this, "_selectorModalVisible$", new Fe(!1));
10708
+ O(this, "_selectorModalVisible$", new Le(!1));
10705
10709
  O(this, "selectorModalVisible$", this._selectorModalVisible$.asObservable());
10706
10710
  }
10707
10711
  get selectorModalVisible() {
@@ -10726,11 +10730,11 @@ class Cg extends he {
10726
10730
  const vg = fs(
10727
10731
  "univer.range-selector.service"
10728
10732
  ), Rg = {
10729
- id: dn.id,
10733
+ id: ln.id,
10730
10734
  preconditions: Il,
10731
10735
  binding: W.ENTER
10732
10736
  }, bg = {
10733
- id: Io.id,
10737
+ id: So.id,
10734
10738
  preconditions: ue,
10735
10739
  binding: W.BACKSPACE
10736
10740
  }, Og = {
@@ -10738,56 +10742,56 @@ const vg = fs(
10738
10742
  preconditions: ue,
10739
10743
  binding: W.DELETE
10740
10744
  }, xg = {
10741
- id: ct.id,
10745
+ id: At.id,
10742
10746
  binding: W.ARROW_UP,
10743
10747
  preconditions: ue,
10744
10748
  staticParameters: {
10745
10749
  direction: se.UP
10746
10750
  }
10747
10751
  }, Tg = {
10748
- id: ct.id,
10752
+ id: At.id,
10749
10753
  binding: W.ARROW_DOWN,
10750
10754
  preconditions: ue,
10751
10755
  staticParameters: {
10752
10756
  direction: se.DOWN
10753
10757
  }
10754
10758
  }, yg = {
10755
- id: ct.id,
10759
+ id: At.id,
10756
10760
  binding: W.ARROW_LEFT,
10757
10761
  preconditions: ue,
10758
10762
  staticParameters: {
10759
10763
  direction: se.LEFT
10760
10764
  }
10761
10765
  }, Bg = {
10762
- id: ct.id,
10766
+ id: At.id,
10763
10767
  binding: W.ARROW_RIGHT,
10764
10768
  preconditions: ue,
10765
10769
  staticParameters: {
10766
10770
  direction: se.RIGHT
10767
10771
  }
10768
10772
  }, Mg = {
10769
- id: At.id,
10773
+ id: lt.id,
10770
10774
  binding: W.ARROW_UP | K.SHIFT,
10771
10775
  preconditions: ue,
10772
10776
  staticParameters: {
10773
10777
  direction: se.UP
10774
10778
  }
10775
10779
  }, _g = {
10776
- id: At.id,
10780
+ id: lt.id,
10777
10781
  binding: W.ARROW_DOWN | K.SHIFT,
10778
10782
  preconditions: ue,
10779
10783
  staticParameters: {
10780
10784
  direction: se.DOWN
10781
10785
  }
10782
10786
  }, Pg = {
10783
- id: At.id,
10787
+ id: lt.id,
10784
10788
  binding: W.ARROW_LEFT | K.SHIFT,
10785
10789
  preconditions: ue,
10786
10790
  staticParameters: {
10787
10791
  direction: se.LEFT
10788
10792
  }
10789
10793
  }, Dg = {
10790
- id: At.id,
10794
+ id: lt.id,
10791
10795
  binding: W.ARROW_RIGHT | K.SHIFT,
10792
10796
  preconditions: ue,
10793
10797
  staticParameters: {
@@ -10796,18 +10800,18 @@ const vg = fs(
10796
10800
  }, wg = {
10797
10801
  id: Ca.id,
10798
10802
  binding: W.A | K.CTRL_COMMAND,
10799
- preconditions: (n) => n.getContextValue(Es) && (n.getContextValue(gn) || n.getContextValue(Nn))
10803
+ preconditions: (n) => n.getContextValue(Es) && (n.getContextValue(hn) || n.getContextValue(wn))
10800
10804
  };
10801
10805
  var ya = Object.defineProperty, Ng = Object.getOwnPropertyDescriptor, Qg = (n, e, t) => e in n ? ya(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t, Ug = (n, e, t, o) => {
10802
10806
  for (var s = o > 1 ? void 0 : o ? Ng(e, t) : e, r = n.length - 1, i; r >= 0; r--)
10803
10807
  (i = n[r]) && (s = (o ? i(e, t, s) : i(s)) || s);
10804
10808
  return o && s && ya(e, t, s), s;
10805
- }, en = (n, e) => (t, o) => e(t, o, n), Lg = (n, e, t) => Qg(n, e + "", t);
10806
- let hs = class extends Xa {
10809
+ }, $t = (n, e) => (t, o) => e(t, o, n), Lg = (n, e, t) => Qg(n, e + "", t);
10810
+ let hs = class extends Ka {
10807
10811
  // static override type = UniverInstanceType.UNIVER_DOC;
10808
10812
  constructor(n = zr, e, t, o, s, r) {
10809
10813
  super(), this._config = n, this._injector = e, this._renderManagerSrv = t, this._commandService = o, this._logService = s, this._configService = r;
10810
- const { menu: i, ...a } = Ja(
10814
+ const { menu: i, ...a } = Xa(
10811
10815
  {},
10812
10816
  zr,
10813
10817
  this._config
@@ -10816,24 +10820,24 @@ let hs = class extends Xa {
10816
10820
  }
10817
10821
  onReady() {
10818
10822
  this._initRenderBasics(), this._markDocAsFocused(), hr(this._injector, [
10819
- [Xn],
10820
- [Jn]
10823
+ [Kn],
10824
+ [Xn]
10821
10825
  ]);
10822
10826
  }
10823
10827
  onRendered() {
10824
10828
  this._initUI(), this._initRenderModules(), hr(this._injector, [
10829
+ [Wn],
10825
10830
  [jn],
10826
- [zn],
10827
10831
  [Ft],
10828
- [Gn],
10832
+ [zn],
10829
10833
  // FIXME: LifecycleStages.Rendered must be used, otherwise the menu cannot be added to the DOM, but the sheet ui
10830
10834
  // plugin can be added in LifecycleStages.Ready
10831
- [kn]
10835
+ [Hn]
10832
10836
  ]);
10833
10837
  }
10834
10838
  _initCommand() {
10835
10839
  [
10836
- Io,
10840
+ So,
10837
10841
  la,
10838
10842
  Wt,
10839
10843
  jt,
@@ -10844,24 +10848,24 @@ let hs = class extends Xa {
10844
10848
  Dt,
10845
10849
  wt,
10846
10850
  Nt,
10847
- pn,
10851
+ fn,
10848
10852
  Qt,
10849
- dt,
10853
+ ut,
10850
10854
  pa,
10851
10855
  Hs,
10852
- un,
10856
+ dn,
10853
10857
  ks,
10854
10858
  Aa,
10855
10859
  Vs,
10856
10860
  qe,
10857
- go,
10858
10861
  ho,
10859
- mn,
10862
+ uo,
10863
+ pn,
10864
+ go,
10860
10865
  fo,
10861
10866
  po,
10862
- mo,
10863
10867
  tt,
10864
- Eo,
10868
+ mo,
10865
10869
  ma,
10866
10870
  ha,
10867
10871
  Zs,
@@ -10871,19 +10875,19 @@ let hs = class extends Xa {
10871
10875
  tr,
10872
10876
  qs,
10873
10877
  Ks,
10874
- Cn,
10878
+ In,
10875
10879
  Ms,
10876
10880
  Ra,
10877
10881
  Pt,
10878
- lo,
10879
- dn,
10882
+ Ao,
10883
+ ln,
10880
10884
  $o,
10881
- uo,
10885
+ lo,
10882
10886
  Ps,
10883
10887
  Ds,
10884
10888
  sa,
10885
10889
  va,
10886
- vo,
10890
+ Co,
10887
10891
  Ke,
10888
10892
  ca,
10889
10893
  Ut,
@@ -10893,12 +10897,12 @@ let hs = class extends Xa {
10893
10897
  os,
10894
10898
  Ca,
10895
10899
  or,
10896
- ct,
10897
10900
  At,
10901
+ lt,
10898
10902
  hA
10899
10903
  ].forEach((n) => {
10900
10904
  this._commandService.registerCommand(n);
10901
- }), [Hn, Gs, Ys].forEach((n) => this.disposeWithMe(this._commandService.registerMultipleCommand(n)));
10905
+ }), [Fn, Gs, Ys].forEach((n) => this.disposeWithMe(this._commandService.registerMultipleCommand(n)));
10902
10906
  }
10903
10907
  _initializeShortcut() {
10904
10908
  [
@@ -10916,31 +10920,31 @@ let hs = class extends Xa {
10916
10920
  Rg,
10917
10921
  vl
10918
10922
  ].forEach((n) => {
10919
- this._injector.get(io).registerShortcut(n);
10923
+ this._injector.get(ro).registerShortcut(n);
10920
10924
  });
10921
10925
  }
10922
10926
  _initDependencies(n) {
10923
- Za([
10927
+ Ja([
10928
+ [Yn],
10924
10929
  [qn],
10925
- [Kn],
10926
- [kn],
10927
- [jn],
10928
- [Gn],
10929
- [zn],
10930
+ [Hn],
10930
10931
  [Wn],
10932
+ [zn],
10933
+ [jn],
10934
+ [Vn],
10931
10935
  [Ft],
10932
- [ke, { useClass: Xo }],
10936
+ [He, { useClass: Xo }],
10933
10937
  [vg, { useClass: Cg }],
10934
- [In, { useClass: ts }],
10938
+ [Sn, { useClass: ts }],
10935
10939
  [rs],
10936
- [Jn],
10937
10940
  [Xn],
10941
+ [Kn],
10938
10942
  [St],
10939
10943
  [Ze]
10940
10944
  ], this._config.override).forEach((t) => n.add(t));
10941
10945
  }
10942
10946
  _markDocAsFocused() {
10943
- const n = this._injector.get(N), e = this._injector.get(ke);
10947
+ const n = this._injector.get(N), e = this._injector.get(He);
10944
10948
  try {
10945
10949
  const t = n.getCurrentUnitForType(_.UNIVER_DOC);
10946
10950
  if (!t) return;
@@ -10951,15 +10955,15 @@ let hs = class extends Xa {
10951
10955
  }
10952
10956
  }
10953
10957
  _initUI() {
10954
- this._injector.get(Wn);
10958
+ this._injector.get(Vn);
10955
10959
  }
10956
10960
  _initRenderBasics() {
10957
10961
  [
10958
10962
  [ie],
10959
10963
  [Ie],
10960
- [ec],
10964
+ [$a],
10961
10965
  [rr],
10962
- [bo],
10966
+ [Ro],
10963
10967
  [ns],
10964
10968
  [us]
10965
10969
  ].forEach((n) => {
@@ -10968,17 +10972,17 @@ let hs = class extends Xa {
10968
10972
  }
10969
10973
  _initRenderModules() {
10970
10974
  [
10971
- [Yn],
10972
- [Vn],
10975
+ [Gn],
10976
+ [kn],
10973
10977
  [ds],
10974
10978
  [Jo],
10975
10979
  [ls],
10976
10980
  [as],
10977
10981
  [is],
10978
- [qn],
10982
+ [Yn],
10979
10983
  [As],
10980
10984
  [cs],
10981
- [Kn]
10985
+ [qn]
10982
10986
  ].forEach((n) => {
10983
10987
  this._renderManagerSrv.registerRenderModule(_.UNIVER_DOC, n);
10984
10988
  });
@@ -10986,25 +10990,25 @@ let hs = class extends Xa {
10986
10990
  };
10987
10991
  Lg(hs, "pluginName", oA);
10988
10992
  hs = Ug([
10989
- Ka(Ec),
10990
- en(1, z(ro)),
10991
- en(2, pe),
10992
- en(3, y),
10993
- en(4, gs),
10994
- en(5, Cs)
10993
+ qa(mc),
10994
+ $t(1, z(so)),
10995
+ $t(2, pe),
10996
+ $t(3, y),
10997
+ $t(4, gs),
10998
+ $t(5, Cs)
10995
10999
  ], hs);
10996
11000
  export {
10997
- lo as AfterSpaceCommand,
10998
- po as AlignCenterCommand,
10999
- Eo as AlignJustifyCommand,
11000
- fo as AlignLeftCommand,
11001
+ Ao as AfterSpaceCommand,
11002
+ fo as AlignCenterCommand,
11003
+ mo as AlignJustifyCommand,
11004
+ go as AlignLeftCommand,
11001
11005
  tt as AlignOperationCommand,
11002
- mo as AlignRightCommand,
11006
+ po as AlignRightCommand,
11003
11007
  pa as BreakLineCommand,
11004
- ho as BulletListCommand,
11008
+ uo as BulletListCommand,
11005
11009
  $o as ChangeListNestingLevelCommand,
11006
- Dn as ChangeListNestingLevelType,
11007
- uo as ChangeListTypeCommand,
11010
+ Pn as ChangeListNestingLevelType,
11011
+ lo as ChangeListTypeCommand,
11008
11012
  Ps as CheckListCommand,
11009
11013
  dA as CoverContentCommand,
11010
11014
  ma as CreateDocTableCommand,
@@ -11018,26 +11022,26 @@ export {
11018
11022
  si as DOC_VERTICAL_PADDING,
11019
11023
  nA as DefaultDocContainerConfig,
11020
11024
  tA as DefaultToolbarConfig,
11021
- un as DeleteCommand,
11025
+ dn as DeleteCommand,
11022
11026
  ks as DeleteCustomBlockCommand,
11023
- Io as DeleteLeftCommand,
11027
+ So as DeleteLeftCommand,
11024
11028
  la as DeleteRightCommand,
11025
11029
  St as DocAutoFormatService,
11026
- Vn as DocBackScrollRenderController,
11030
+ kn as DocBackScrollRenderController,
11027
11031
  rs as DocCanvasPopManagerService,
11028
- Hn as DocCopyCommand,
11032
+ Fn as DocCopyCommand,
11029
11033
  nr as DocCreateTableOperation,
11030
11034
  Gs as DocCutCommand,
11031
- Yn as DocEventManagerService,
11032
- bo as DocIMEInputManagerService,
11035
+ Gn as DocEventManagerService,
11036
+ Ro as DocIMEInputManagerService,
11033
11037
  Ys as DocPasteCommand,
11034
11038
  ns as DocRenderController,
11035
11039
  Ca as DocSelectAllCommand,
11036
11040
  Ie as DocSelectionRenderService,
11037
- Xn as DocStateChangeManagerService,
11041
+ Kn as DocStateChangeManagerService,
11038
11042
  Ks as DocTableDeleteColumnsCommand,
11039
11043
  qs as DocTableDeleteRowsCommand,
11040
- Cn as DocTableDeleteTableCommand,
11044
+ In as DocTableDeleteTableCommand,
11041
11045
  Nd as DocTableInsertColumnCommand,
11042
11046
  er as DocTableInsertColumnLeftCommand,
11043
11047
  tr as DocTableInsertColumnRightCommand,
@@ -11045,27 +11049,27 @@ export {
11045
11049
  $s as DocTableInsertRowBellowCommand,
11046
11050
  ha as DocTableInsertRowCommand,
11047
11051
  Ra as DocTableTabCommand,
11048
- kn as DocUIController,
11049
- Jn as DocsRenderService,
11052
+ Hn as DocUIController,
11053
+ Xn as DocsRenderService,
11050
11054
  qu as DocsUIMenuSchema,
11051
11055
  BA as Editor,
11052
11056
  gd as EditorInsertTextCommandId,
11053
11057
  Xo as EditorService,
11054
- dn as EnterCommand,
11055
- In as IDocClipboardService,
11056
- ke as IEditorService,
11058
+ ln as EnterCommand,
11059
+ Sn as IDocClipboardService,
11060
+ He as IEditorService,
11057
11061
  va as IMEInputCommand,
11058
11062
  vg as IRangeSelectorService,
11059
11063
  ca as InnerPasteCommand,
11060
11064
  Hs as InsertCommand,
11061
- mn as ListOperationCommand,
11065
+ pn as ListOperationCommand,
11062
11066
  Vs as MergeTwoParagraphCommand,
11063
- ct as MoveCursorOperation,
11064
- At as MoveSelectionOperation,
11067
+ At as MoveCursorOperation,
11068
+ lt as MoveSelectionOperation,
11065
11069
  Xg as NORMAL_TEXT_SELECTION_PLUGIN_NAME,
11066
- at as NodePositionConvertToCursor,
11070
+ ct as NodePositionConvertToCursor,
11067
11071
  Fi as NodePositionConvertToRectRange,
11068
- go as OrderListCommand,
11072
+ ho as OrderListCommand,
11069
11073
  Cd as PastePluginLark,
11070
11074
  vd as PastePluginUniver,
11071
11075
  Rd as PastePluginWord,
@@ -11075,12 +11079,12 @@ export {
11075
11079
  lA as ReplaceContentCommand,
11076
11080
  Ni as ReplaceSnapshotCommand,
11077
11081
  hA as ReplaceTextRunsCommand,
11078
- pn as ResetInlineFormatTextBackgroundColorCommand,
11082
+ fn as ResetInlineFormatTextBackgroundColorCommand,
11079
11083
  of as RichTextEditor,
11080
11084
  os as SetDocZoomRatioCommand,
11081
11085
  qe as SetDocZoomRatioOperation,
11082
11086
  Wt as SetInlineFormatBoldCommand,
11083
- dt as SetInlineFormatCommand,
11087
+ ut as SetInlineFormatCommand,
11084
11088
  wt as SetInlineFormatFontFamilyCommand,
11085
11089
  Dt as SetInlineFormatFontSizeCommand,
11086
11090
  jt as SetInlineFormatItalicCommand,
@@ -11105,9 +11109,9 @@ export {
11105
11109
  tf as docDrawingPositionToTransform,
11106
11110
  ra as genTableSource,
11107
11111
  fa as generateParagraphs,
11108
- _n as getAnchorBounding,
11112
+ Mn as getAnchorBounding,
11109
11113
  bA as getCanvasOffsetByEngine,
11110
- Ve as getCommandSkeleton,
11114
+ ke as getCommandSkeleton,
11111
11115
  Ws as getCursorWhenDelete,
11112
11116
  ad as getCustomBlockIdsInSelections,
11113
11117
  hd as getCutActionsFromDocRanges,
@@ -11118,13 +11122,13 @@ export {
11118
11122
  Ts as getLineBounding,
11119
11123
  Or as getOneTextSelectionRange,
11120
11124
  ws as getParagraphsInRange,
11121
- En as getParagraphsInRanges,
11125
+ mn as getParagraphsInRanges,
11122
11126
  de as getRichTextEditPath,
11123
11127
  Fs as getTableColumn,
11124
11128
  ef as hasParagraphInTable,
11125
11129
  Ui as isInSameTableCell,
11126
11130
  fA as isValidRectRange,
11127
- it as neoGetDocObject,
11131
+ at as neoGetDocObject,
11128
11132
  nf as transformToDocDrawingPosition,
11129
11133
  cA as useKeyboardEvent,
11130
11134
  AA as useResize,