@univerjs/sheets-formula-ui 0.8.1 → 0.8.2-nightly.202506201607

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.
package/lib/es/index.js CHANGED
@@ -1,54 +1,54 @@
1
1
  var Vr = Object.defineProperty;
2
2
  var Wr = (e, t, n) => t in e ? Vr(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
- var q = (e, t, n) => Wr(e, typeof t != "symbol" ? t + "" : t, n);
4
- import { CommandType as Te, ICommandService as de, createIdentifier as Hr, IContextService as on, IUniverInstanceService as ee, Rectangle as Gn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as sn, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Zn, DEFAULT_EMPTY_DOCUMENT_VALUE as zn, isRealNum as Br, CellValueType as bn, getCellValueType as jr, LocaleService as lt, Tools as it, Inject as B, Injector as _t, ThemeService as Rt, toDisposable as Xn, DisposableCollection as He, RANGE_TYPE as Se, UniverInstanceType as j, ColorKit as cn, getBodySlice as yn, Direction as ae, EDITOR_ACTIVATED as xt, createInternalEditorID as qr, generateRandomId as Kr, BuildTextUtils as Yr, RichTextBuilder as Gr, Disposable as ut, ObjectMatrix as Fe, Range as Zr, isFormulaString as ye, isFormulaId as Be, FOCUSING_DOC as zr, FOCUSING_UNIVER_EDITOR as Xr, isICellData as Qr, ILogService as Jr, RxDisposable as eo, InterceptorEffectEnum as to, DependentOn as no, IConfigService as ro, Plugin as oo, merge as so, registerDependencies as io, touchDependencies as co } from "@univerjs/core";
5
- import { SheetPasteCommand as ao, PREDEFINED_HOOK_NAME as ot, IEditorBridgeService as an, SetCellEditVisibleOperation as Qn, SheetSkeletonManagerService as Wt, BaseSelectionRenderService as lo, getCoordByOffset as Tn, checkInHeaderRanges as xn, getAllSelection as uo, genNormalSelectionStyle as Jn, getSheetObject as ho, attachSelectionWithCoord as Qt, SelectionControl as er, MoveSelectionCommand as On, JumpOver as Nn, ExpandSelectionCommand as Mn, EMBEDDING_FORMULA_EDITOR as fo, IMarkSelectionService as go, HoverManagerService as mo, CellAlertManagerService as po, CellAlertType as vo, IAutoFillService as So, APPLY_TYPE as Co, DATA_TYPE as wn, ISheetClipboardService as _o, COPY_TYPE as tr, SELECTION_SHAPE_DEPTH as Ro, useActiveWorkbook as Eo, getCurrentRangeDisable$ as je, PASTE_SPECIAL_MENU_ID as Io, whenFormulaEditorActivated as Et, whenSheetEditorFocused as bo, SheetsUIPart as yo, RANGE_SELECTOR_COMPONENT_KEY as To, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as xo } from "@univerjs/sheets-ui";
6
- import { sequenceNodeType as z, serializeRange as Ce, LexerTreeBuilder as _e, deserializeRangeWithSheetWithCache as Oo, matchRefDrawToken as No, isFormulaLexerToken as Mo, matchToken as ct, deserializeRangeWithSheet as dt, serializeRangeToRefString as wo, serializeRangeWithSheet as St, generateStringWithSequence as ko, operatorToken as nr, FormulaDataModel as It, ERROR_TYPE_SET as Ao, ErrorType as ce, SetFormulaCalculationResultMutation as Fo, SetArrayFormulaDataMutation as Do, SetFormulaCalculationStopMutation as Lo, FunctionType as $o, UniverFormulaEnginePlugin as Po } from "@univerjs/engine-formula";
7
- import { Subject as gt, BehaviorSubject as rr, throttleTime as Uo, debounceTime as ln, filter as Jt, map as or, distinctUntilChanged as Vo, merge as Wo, combineLatestWith as Ho, switchMap as Bo, of as kn, Observable as jo } from "rxjs";
8
- import { IEditorService as qe, DocSelectionRenderService as sr, ReplaceTextRunsCommand as An, MoveSelectionOperation as qo, MoveCursorOperation as Ko, useKeyboardEvent as Yo, useResize as Go, DocBackScrollRenderController as Zo, RichTextEditor as zo } from "@univerjs/docs-ui";
9
- import { DeviceInputEventType as xe, ScrollTimerType as Gt, SHEET_VIEWPORT_KEY as Fn, Vector2 as Dn, IRenderManagerService as Oe } from "@univerjs/engine-render";
10
- import { SheetsSelectionsService as un, getSheetCommandTarget as ir, getCellAtRowCol as Xo, SetSelectionsOperation as dn, IRefSelectionsService as Ht, SelectionMoveType as Zt, convertSelectionDataToRange as Qo, setEndForRange as Jo, REF_SELECTIONS_ENABLED as Ln, SetWorksheetActiveOperation as $n, SheetInterceptorService as hn, ReorderRangeCommand as es, SetRangeValuesMutation as wt, SetRangeValuesUndoMutationFactory as ts, BEFORE_CELL_EDIT as ns, SetWorksheetRowAutoHeightMutation as rs, INTERCEPTOR_POINT as os, WorksheetSetCellValuePermission as Ke, WorksheetEditPermission as Ye, RangeProtectionPermissionEditPoint as Ge, WorkbookEditablePermission as Ze } from "@univerjs/sheets";
11
- import { InsertFunctionCommand as ss, IDescriptionService as Bt, TriggerCalculationController as is, QuickSumCommand as cs, UniverSheetsFormulaPlugin as as } from "@univerjs/sheets-formula";
12
- import { ISidebarService as fn, useDependency as T, useEvent as J, useObservable as ge, RectPopup as en, IShortcutService as jt, KeyCode as L, MetaKeys as P, IContextMenuService as ls, useUpdateEffect as us, IZenZoneService as ds, ProgressBar as hs, MenuItemType as ze, getMenuHiddenObservable as ht, IClipboardInterfaceService as Pn, RibbonFormulasGroup as Un, IMenuManagerService as fs, IUIPartsService as cr, ComponentManager as ar, connectInjector as lr, BuiltInUIPart as gs } from "@univerjs/ui";
3
+ var K = (e, t, n) => Wr(e, typeof t != "symbol" ? t + "" : t, n);
4
+ import { CommandType as Te, ICommandService as fe, createIdentifier as Hr, IContextService as an, IUniverInstanceService as te, Rectangle as Qn, DOCS_NORMAL_EDITOR_UNIT_ID_KEY as ln, DOCS_FORMULA_BAR_EDITOR_UNIT_ID_KEY as Jn, DEFAULT_EMPTY_DOCUMENT_VALUE as er, isRealNum as Br, CellValueType as On, getCellValueType as jr, LocaleService as ct, Tools as ot, Inject as j, Injector as Rt, ThemeService as It, toDisposable as tr, DisposableCollection as We, RANGE_TYPE as _e, UniverInstanceType as q, ColorKit as un, getBodySlice as Nn, Direction as le, EDITOR_ACTIVATED as wt, createInternalEditorID as qr, generateRandomId as Kr, BuildTextUtils as Yr, RichTextBuilder as Gr, Disposable as at, ObjectMatrix as De, Range as Zr, isFormulaString as ye, isFormulaId as He, FOCUSING_DOC as zr, FOCUSING_UNIVER_EDITOR as Xr, isICellData as Qr, ILogService as Jr, RxDisposable as eo, InterceptorEffectEnum as to, DependentOn as no, IConfigService as ro, Plugin as oo, merge as so, registerDependencies as io, touchDependencies as co } from "@univerjs/core";
5
+ import { SheetPasteCommand as ao, PREDEFINED_HOOK_NAME as nt, IEditorBridgeService as dn, SetCellEditVisibleOperation as nr, SheetSkeletonManagerService as qt, BaseSelectionRenderService as lo, getCoordByOffset as Mn, checkInHeaderRanges as wn, getAllSelection as uo, genNormalSelectionStyle as rr, getSheetObject as ho, attachSelectionWithCoord as tn, SelectionControl as or, MoveSelectionCommand as kn, JumpOver as An, ExpandSelectionCommand as Fn, EMBEDDING_FORMULA_EDITOR as fo, IMarkSelectionService as go, HoverManagerService as mo, CellAlertManagerService as po, CellAlertType as vo, IAutoFillService as So, APPLY_TYPE as Co, DATA_TYPE as Dn, ISheetClipboardService as _o, COPY_TYPE as sr, SELECTION_SHAPE_DEPTH as Ro, useActiveWorkbook as Io, getCurrentRangeDisable$ as Be, PASTE_SPECIAL_MENU_ID as Eo, whenFormulaEditorActivated as Et, whenSheetEditorFocused as bo, SheetsUIPart as yo, RANGE_SELECTOR_COMPONENT_KEY as To, EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY as xo } from "@univerjs/sheets-ui";
6
+ import { sequenceNodeType as X, serializeRange as Re, LexerTreeBuilder as Ie, deserializeRangeWithSheetWithCache as Oo, matchRefDrawToken as No, isFormulaLexerToken as Mo, matchToken as st, deserializeRangeWithSheet as lt, serializeRangeToRefString as wo, serializeRangeWithSheet as Ct, generateStringWithSequence as ko, operatorToken as ir, FormulaDataModel as bt, ERROR_TYPE_SET as Ao, ErrorType as ae, SetFormulaCalculationResultMutation as Fo, SetArrayFormulaDataMutation as Do, SetFormulaCalculationStopMutation as Lo, FunctionType as $o, UniverFormulaEnginePlugin as Po } from "@univerjs/engine-formula";
7
+ import { Subject as mt, BehaviorSubject as cr, throttleTime as Uo, debounceTime as hn, filter as nn, map as ar, distinctUntilChanged as Vo, merge as Wo, combineLatestWith as Ho, switchMap as Bo, of as Ln, Observable as jo } from "rxjs";
8
+ import { IEditorService as je, DocSelectionRenderService as lr, ReplaceTextRunsCommand as $n, MoveSelectionOperation as qo, MoveCursorOperation as Ko, useKeyboardEvent as Yo, useResize as Go, DocBackScrollRenderController as Zo, RichTextEditor as zo } from "@univerjs/docs-ui";
9
+ import { DeviceInputEventType as xe, ScrollTimerType as Xt, SHEET_VIEWPORT_KEY as Pn, Vector2 as Un, IRenderManagerService as Oe } from "@univerjs/engine-render";
10
+ import { SheetsSelectionsService as fn, getSheetCommandTarget as ur, getCellAtRowCol as Xo, SetSelectionsOperation as gn, IRefSelectionsService as Kt, SelectionMoveType as Qt, convertSelectionDataToRange as Qo, setEndForRange as Jo, REF_SELECTIONS_ENABLED as Vn, SetWorksheetActiveOperation as Wn, SheetInterceptorService as mn, ReorderRangeCommand as es, SetRangeValuesMutation as Dt, SetRangeValuesUndoMutationFactory as ts, BEFORE_CELL_EDIT as ns, SetWorksheetRowAutoHeightMutation as rs, INTERCEPTOR_POINT as os, WorksheetSetCellValuePermission as qe, WorksheetEditPermission as Ke, RangeProtectionPermissionEditPoint as Ye, WorkbookEditablePermission as Ge } from "@univerjs/sheets";
11
+ import { InsertFunctionCommand as ss, IDescriptionService as Yt, TriggerCalculationController as is, QuickSumCommand as cs, UniverSheetsFormulaPlugin as as } from "@univerjs/sheets-formula";
12
+ import { ISidebarService as pn, useDependency as T, useEvent as J, useObservable as ve, RectPopup as rn, IShortcutService as Gt, KeyCode as L, MetaKeys as P, IContextMenuService as ls, useUpdateEffect as us, IZenZoneService as ds, ProgressBar as hs, MenuItemType as Ze, getMenuHiddenObservable as ut, IClipboardInterfaceService as Hn, RibbonFormulasGroup as Bn, IMenuManagerService as fs, IUIPartsService as dr, ComponentManager as hr, connectInjector as fr, BuiltInUIPart as gs } from "@univerjs/ui";
13
13
  import { jsx as O, jsxs as W, Fragment as ms } from "react/jsx-runtime";
14
- import { clsx as re, borderTopClassName as ps, scrollbarClassName as at, borderClassName as gn, Tooltip as vs, Dialog as Ss, Input as ur, Button as st, borderLeftClassName as Cs, Select as _s } from "@univerjs/design";
15
- import { forwardRef as Ne, useRef as G, createElement as Xe, useEffect as $, useMemo as ne, useState as V, useCallback as kt, useLayoutEffect as At, useImperativeHandle as Rs } from "react";
16
- import { DocSelectionManagerService as dr } from "@univerjs/docs";
17
- import { debounceTime as Es } from "rxjs/operators";
18
- const mn = {
14
+ import { clsx as re, borderTopClassName as ps, scrollbarClassName as it, borderClassName as vn, Tooltip as vs, Dialog as Ss, Input as gr, Button as rt, borderLeftClassName as Cs, Select as _s } from "@univerjs/design";
15
+ import { forwardRef as Ne, useRef as z, createElement as ze, useEffect as $, useMemo as ne, useState as V, useCallback as Lt, useLayoutEffect as $t, useImperativeHandle as Rs } from "react";
16
+ import { DocSelectionManagerService as mr } from "@univerjs/docs";
17
+ import { debounceTime as Is } from "rxjs/operators";
18
+ const Sn = {
19
19
  id: "sheet.command.paste-formula",
20
20
  type: Te.COMMAND,
21
- handler: async (e) => e.get(de).executeCommand(ao.id, {
22
- value: ot.SPECIAL_PASTE_FORMULA
21
+ handler: async (e) => e.get(fe).executeCommand(ao.id, {
22
+ value: nt.SPECIAL_PASTE_FORMULA
23
23
  })
24
- }, ft = {
24
+ }, dt = {
25
25
  id: "formula-ui.operation.select-editor-formula",
26
26
  type: Te.OPERATION,
27
27
  handler: (e, t) => !0
28
28
  };
29
- var Is = Object.getOwnPropertyDescriptor, bs = (e, t, n, o) => {
30
- for (var r = o > 1 ? void 0 : o ? Is(t, n) : t, s = e.length - 1, c; s >= 0; s--)
29
+ var Es = Object.getOwnPropertyDescriptor, bs = (e, t, n, o) => {
30
+ for (var r = o > 1 ? void 0 : o ? Es(t, n) : t, s = e.length - 1, c; s >= 0; s--)
31
31
  (c = e[s]) && (r = c(r) || r);
32
32
  return r;
33
33
  }, ys = (e, t) => (n, o) => t(n, o, e);
34
- const Ts = "FORMULA_PROMPT_ACTIVATED", pn = Hr("formula-ui.prompt-service");
35
- let tn = class {
34
+ const Ts = "FORMULA_PROMPT_ACTIVATED", Cn = Hr("formula-ui.prompt-service");
35
+ let on = class {
36
36
  constructor(e) {
37
- q(this, "_search$", new gt());
38
- q(this, "_help$", new gt());
39
- q(this, "_navigate$", new gt());
40
- q(this, "_accept$", new gt());
41
- q(this, "_acceptFormulaName$", new gt());
42
- q(this, "search$", this._search$.asObservable());
43
- q(this, "help$", this._help$.asObservable());
44
- q(this, "navigate$", this._navigate$.asObservable());
45
- q(this, "accept$", this._accept$.asObservable());
46
- q(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
47
- q(this, "_searching", !1);
48
- q(this, "_helping", !1);
49
- q(this, "_sequenceNodes", []);
50
- q(this, "_isLockedOnSelectionChangeRefString", !1);
51
- q(this, "_isLockedOnSelectionInsertRefString", !1);
37
+ K(this, "_search$", new mt());
38
+ K(this, "_help$", new mt());
39
+ K(this, "_navigate$", new mt());
40
+ K(this, "_accept$", new mt());
41
+ K(this, "_acceptFormulaName$", new mt());
42
+ K(this, "search$", this._search$.asObservable());
43
+ K(this, "help$", this._help$.asObservable());
44
+ K(this, "navigate$", this._navigate$.asObservable());
45
+ K(this, "accept$", this._accept$.asObservable());
46
+ K(this, "acceptFormulaName$", this._acceptFormulaName$.asObservable());
47
+ K(this, "_searching", !1);
48
+ K(this, "_helping", !1);
49
+ K(this, "_sequenceNodes", []);
50
+ K(this, "_isLockedOnSelectionChangeRefString", !1);
51
+ K(this, "_isLockedOnSelectionInsertRefString", !1);
52
52
  this._contextService = e;
53
53
  }
54
54
  dispose() {
@@ -117,7 +117,7 @@ let tn = class {
117
117
  */
118
118
  updateSequenceRef(e, t) {
119
119
  const n = this._sequenceNodes[e];
120
- if (typeof n == "string" || n.nodeType !== z.REFERENCE)
120
+ if (typeof n == "string" || n.nodeType !== X.REFERENCE)
121
121
  return;
122
122
  const o = t.length - n.token.length, r = { ...n };
123
123
  r.token = t, r.endIndex += o, this._sequenceNodes[e] = r;
@@ -141,7 +141,7 @@ let tn = class {
141
141
  token: t,
142
142
  startIndex: e,
143
143
  endIndex: e + n - 1,
144
- nodeType: z.REFERENCE
144
+ nodeType: X.REFERENCE
145
145
  });
146
146
  for (let r = o + 1, s = this._sequenceNodes.length; r < s; r++) {
147
147
  const c = this._sequenceNodes[r];
@@ -187,44 +187,44 @@ let tn = class {
187
187
  return this._isLockedOnSelectionInsertRefString;
188
188
  }
189
189
  };
190
- tn = bs([
191
- ys(0, on)
192
- ], tn);
190
+ on = bs([
191
+ ys(0, an)
192
+ ], on);
193
193
  const xs = {
194
194
  id: "formula-ui.operation.help-function",
195
195
  type: Te.OPERATION,
196
- handler: async (e, t) => (e.get(pn).help(t), !0)
197
- }, fe = {
196
+ handler: async (e, t) => (e.get(Cn).help(t), !0)
197
+ }, pe = {
198
198
  id: "formula-ui.operation.insert-function",
199
199
  type: Te.OPERATION,
200
200
  // eslint-disable-next-line
201
201
  handler: async (e, t) => {
202
- var S, _;
203
- const n = e.get(un), o = e.get(qe), r = n.getCurrentSelections();
202
+ var C, _;
203
+ const n = e.get(fn), o = e.get(je), r = n.getCurrentSelections();
204
204
  if (!r || !r.length)
205
205
  return !1;
206
- const s = ir(e.get(ee));
206
+ const s = ur(e.get(te));
207
207
  if (!s) return !1;
208
- const { worksheet: c, unitId: i, subUnitId: l } = s, f = c.getCellMatrix(), { value: h } = t, m = e.get(de);
209
- e.get(an);
208
+ const { worksheet: c, unitId: i, subUnitId: l } = s, f = c.getCellMatrix(), { value: h } = t, g = e.get(fe);
209
+ e.get(dn);
210
210
  const u = [], d = [];
211
- let a = null, v = 0, g = 0, p = "";
212
- if (r.length === 1 && (Ms(r[0].range) || ws(r[0].range) && Wn(f, r[0].range))) {
213
- const { range: R, primary: C } = r[0], y = (S = C == null ? void 0 : C.actualRow) != null ? S : R.startRow, N = (_ = C == null ? void 0 : C.actualColumn) != null ? _ : R.startColumn;
214
- a = R, v = y, g = N;
215
- const A = Vn(f, y, N);
216
- A && (p = Ce(A));
211
+ let a = null, v = 0, m = 0, p = "";
212
+ if (r.length === 1 && (Ms(r[0].range) || ws(r[0].range) && qn(f, r[0].range))) {
213
+ const { range: R, primary: S } = r[0], y = (C = S == null ? void 0 : S.actualRow) != null ? C : R.startRow, N = (_ = S == null ? void 0 : S.actualColumn) != null ? _ : R.startColumn;
214
+ a = R, v = y, m = N;
215
+ const A = jn(f, y, N);
216
+ A && (p = Re(A));
217
217
  } else
218
218
  r.some((R) => {
219
219
  var N, A;
220
- const { range: C, primary: y } = R;
221
- if (Wn(f, C)) {
222
- const F = (N = y == null ? void 0 : y.actualRow) != null ? N : C.startRow, x = (A = y == null ? void 0 : y.actualColumn) != null ? A : C.startColumn, w = Vn(f, F, x);
223
- if (!w)
224
- return a = C, v = F, g = x, !0;
225
- const M = Ce(w), b = `=${h}(${M})`;
220
+ const { range: S, primary: y } = R;
221
+ if (qn(f, S)) {
222
+ const F = (N = y == null ? void 0 : y.actualRow) != null ? N : S.startRow, x = (A = y == null ? void 0 : y.actualColumn) != null ? A : S.startColumn, k = jn(f, F, x);
223
+ if (!k)
224
+ return a = S, v = F, m = x, !0;
225
+ const w = Re(k), b = `=${h}(${w})`;
226
226
  u.push({
227
- range: C,
227
+ range: S,
228
228
  primary: {
229
229
  row: F,
230
230
  column: x
@@ -232,41 +232,41 @@ const xs = {
232
232
  formula: b
233
233
  });
234
234
  } else {
235
- const { startRow: F, startColumn: x, endRow: w, endColumn: M } = C;
236
- if (F === w) {
237
- const b = ks(f, F, M, c.getColumnCount() - 1), E = b === M ? M - 1 : M, I = Ce({
235
+ const { startRow: F, startColumn: x, endRow: k, endColumn: w } = S;
236
+ if (F === k) {
237
+ const b = ks(f, F, w, c.getColumnCount() - 1), I = b === w ? w - 1 : w, E = Re({
238
238
  startRow: F,
239
- endRow: w,
239
+ endRow: k,
240
240
  startColumn: x,
241
- endColumn: E
242
- }), k = `=${h}(${I})`;
241
+ endColumn: I
242
+ }), M = `=${h}(${E})`;
243
243
  d.push({
244
- range: C,
244
+ range: S,
245
245
  primary: {
246
246
  row: F,
247
247
  column: b
248
248
  },
249
- formula: k
249
+ formula: M
250
250
  });
251
251
  } else {
252
252
  let b = -1;
253
- for (let I = x; I <= M; I++) {
254
- const k = As(f, I, w, c.getRowCount() - 1);
255
- b = Math.max(b, k);
253
+ for (let E = x; E <= w; E++) {
254
+ const M = As(f, E, k, c.getRowCount() - 1);
255
+ b = Math.max(b, M);
256
256
  }
257
- const E = b === w ? w - 1 : w;
258
- for (let I = x; I <= M; I++) {
259
- const k = Ce({
257
+ const I = b === k ? k - 1 : k;
258
+ for (let E = x; E <= w; E++) {
259
+ const M = Re({
260
260
  startRow: F,
261
- endRow: E,
262
- startColumn: I,
263
- endColumn: I
264
- }), D = `=${h}(${k})`;
261
+ endRow: I,
262
+ startColumn: E,
263
+ endColumn: E
264
+ }), D = `=${h}(${M})`;
265
265
  d.push({
266
- range: C,
266
+ range: S,
267
267
  primary: {
268
268
  row: b,
269
- column: I
269
+ column: E
270
270
  },
271
271
  formula: D
272
272
  });
@@ -276,26 +276,26 @@ const xs = {
276
276
  return !1;
277
277
  });
278
278
  if (a) {
279
- const R = Xo(v, g, c), C = {
280
- range: Gn.clone(a),
279
+ const R = Xo(v, m, c), S = {
280
+ range: Qn.clone(a),
281
281
  primary: {
282
282
  startRow: R.startRow,
283
283
  startColumn: R.startColumn,
284
284
  endRow: R.endRow,
285
285
  endColumn: R.endColumn,
286
286
  actualRow: v,
287
- actualColumn: g,
287
+ actualColumn: m,
288
288
  isMerged: R.isMerged,
289
- isMergedMainCell: R.startRow === v && R.startColumn === g
289
+ isMergedMainCell: R.startRow === v && R.startColumn === m
290
290
  }
291
291
  }, y = {
292
292
  unitId: i,
293
293
  subUnitId: l,
294
- selections: [C]
294
+ selections: [S]
295
295
  };
296
- await m.executeCommand(dn.id, y);
297
- const N = o.getEditor(sn), A = o.getEditor(Zn);
298
- m.syncExecuteCommand(Qn.id, {
296
+ await g.executeCommand(gn.id, y);
297
+ const N = o.getEditor(ln), A = o.getEditor(Jn);
298
+ g.syncExecuteCommand(nr.id, {
299
299
  visible: !0,
300
300
  unitId: i,
301
301
  eventType: xe.Dblclick
@@ -303,13 +303,13 @@ const xs = {
303
303
  const F = `=${h}(${p}`;
304
304
  N == null || N.replaceText(F), A == null || A.replaceText(F, !1);
305
305
  }
306
- return u.length === 0 && d.length === 0 ? !1 : m.executeCommand(ss.id, {
306
+ return u.length === 0 && d.length === 0 ? !1 : g.executeCommand(ss.id, {
307
307
  list: u,
308
308
  listOfRangeHasNumber: d
309
309
  });
310
310
  }
311
311
  };
312
- function Vn(e, t, n) {
312
+ function jn(e, t, n) {
313
313
  const o = Os(e, t, n);
314
314
  if (o !== t)
315
315
  return {
@@ -331,11 +331,11 @@ function Os(e, t, n) {
331
331
  if (t === 0) return t;
332
332
  for (let r = t - 1; r >= 0; r--) {
333
333
  const s = e.getValue(r, n);
334
- if (Ct(s) && !o) {
334
+ if (_t(s) && !o) {
335
335
  if (r === 0) return 0;
336
336
  o = !0;
337
337
  } else {
338
- if (o && !Ct(s))
338
+ if (o && !_t(s))
339
339
  return r + 1;
340
340
  if (o && r === 0)
341
341
  return 0;
@@ -348,11 +348,11 @@ function Ns(e, t, n) {
348
348
  if (n === 0) return n;
349
349
  for (let r = n - 1; r >= 0; r--) {
350
350
  const s = e.getValue(t, r);
351
- if (Ct(s) && !o) {
351
+ if (_t(s) && !o) {
352
352
  if (r === 0) return 0;
353
353
  o = !0;
354
354
  } else {
355
- if (o && !Ct(s))
355
+ if (o && !_t(s))
356
356
  return r + 1;
357
357
  if (o && r === 0)
358
358
  return 0;
@@ -360,15 +360,15 @@ function Ns(e, t, n) {
360
360
  }
361
361
  return n;
362
362
  }
363
- function Ct(e) {
363
+ function _t(e) {
364
364
  if (e != null && e.p) {
365
365
  const t = e == null ? void 0 : e.p.body;
366
366
  if (t == null)
367
367
  return !1;
368
- const n = t.dataStream, r = n.substring(n.length - 2, n.length) === zn ? n.substring(0, n.length - 2) : n;
368
+ const n = t.dataStream, r = n.substring(n.length - 2, n.length) === er ? n.substring(0, n.length - 2) : n;
369
369
  return Br(r);
370
370
  }
371
- return e && (e.t === bn.NUMBER || jr(e) === bn.NUMBER);
371
+ return e && (e.t === On.NUMBER || jr(e) === On.NUMBER);
372
372
  }
373
373
  function Ms(e) {
374
374
  return e.startRow === e.endRow && e.startColumn === e.endColumn;
@@ -376,10 +376,10 @@ function Ms(e) {
376
376
  function ws(e) {
377
377
  return e.startRow !== e.endRow && e.startColumn !== e.endColumn;
378
378
  }
379
- function Wn(e, t) {
379
+ function qn(e, t) {
380
380
  for (let n = t.startRow; n <= t.endRow; n++)
381
381
  for (let o = t.startColumn; o <= t.endColumn; o++)
382
- if (Ct(e.getValue(n, o)))
382
+ if (_t(e.getValue(n, o)))
383
383
  return !1;
384
384
  return !0;
385
385
  }
@@ -395,22 +395,22 @@ function As(e, t, n, o) {
395
395
  return r;
396
396
  return o;
397
397
  }
398
- const hr = "SHEET_FORMULA_UI_PLUGIN", fr = `${hr}_MORE_FUNCTIONS_COMPONENT`, vn = {
398
+ const pr = "SHEET_FORMULA_UI_PLUGIN", vr = `${pr}_MORE_FUNCTIONS_COMPONENT`, _n = {
399
399
  id: "formula-ui.operation.more-functions",
400
400
  type: Te.OPERATION,
401
- handler: async (e) => (e.get(fn).open({
401
+ handler: async (e) => (e.get(pn).open({
402
402
  header: { title: "formula.insert.tooltip" },
403
- children: { label: fr }
403
+ children: { label: vr }
404
404
  }), !0)
405
- }, gr = {
405
+ }, Sr = {
406
406
  id: "formula-ui.operation.change-ref-to-absolute",
407
407
  type: Te.OPERATION,
408
408
  handler: async (e) => !0
409
409
  }, Fs = {
410
410
  id: "formula-ui.operation.search-function",
411
411
  type: Te.OPERATION,
412
- handler: async (e, t) => (e.get(pn).search(t), !0)
413
- }, Sn = (e, t, n = !0) => {
412
+ handler: async (e, t) => (e.get(Cn).search(t), !0)
413
+ }, Rn = (e, t, n = !0) => {
414
414
  let o = -1;
415
415
  return e.reduce((r, s, c) => {
416
416
  if (r.isFinish)
@@ -424,24 +424,24 @@ const hr = "SHEET_FORMULA_UI_PLUGIN", fr = `${hr}_MORE_FUNCTIONS_COMPONENT`, vn
424
424
  }
425
425
  return (n ? r.currentIndex === t : t > i && t <= r.currentIndex) && (o = c, r.isFinish = !0), r;
426
426
  }, { currentIndex: 0, isFinish: !1 }), o;
427
- }, mr = (e, t) => {
427
+ }, Cr = (e, t) => {
428
428
  const n = e[t];
429
429
  let o = -1;
430
- if (!n || typeof n == "string" || n.nodeType !== z.REFERENCE) return -1;
430
+ if (!n || typeof n == "string" || n.nodeType !== X.REFERENCE) return -1;
431
431
  for (let r = 0; r <= t; r++) {
432
432
  const s = e[r];
433
- typeof s != "string" && s.nodeType === z.REFERENCE && o++;
433
+ typeof s != "string" && s.nodeType === X.REFERENCE && o++;
434
434
  }
435
435
  return o;
436
436
  };
437
- var ue = function() {
438
- return ue = Object.assign || function(e) {
437
+ var he = function() {
438
+ return he = Object.assign || function(e) {
439
439
  for (var t, n = 1, o = arguments.length; n < o; n++) {
440
440
  t = arguments[n];
441
441
  for (var r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r]);
442
442
  }
443
443
  return e;
444
- }, ue.apply(this, arguments);
444
+ }, he.apply(this, arguments);
445
445
  }, Ds = function(e, t) {
446
446
  var n = {};
447
447
  for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && t.indexOf(o) < 0 && (n[o] = e[o]);
@@ -449,17 +449,17 @@ var ue = function() {
449
449
  for (var r = 0, o = Object.getOwnPropertySymbols(e); r < o.length; r++)
450
450
  t.indexOf(o[r]) < 0 && Object.prototype.propertyIsEnumerable.call(e, o[r]) && (n[o[r]] = e[o[r]]);
451
451
  return n;
452
- }, Qe = Ne(function(e, t) {
453
- var n = e.icon, o = e.id, r = e.className, s = e.extend, c = Ds(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = G("_".concat(Ps()));
454
- return pr(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, ue({ ref: t, className: i }, c), s);
452
+ }, Xe = Ne(function(e, t) {
453
+ var n = e.icon, o = e.id, r = e.className, s = e.extend, c = Ds(e, ["icon", "id", "className", "extend"]), i = "univerjs-icon univerjs-icon-".concat(o, " ").concat(r || "").trim(), l = z("_".concat(Ps()));
454
+ return _r(n, "".concat(o), { defIds: n.defIds, idSuffix: l.current }, he({ ref: t, className: i }, c), s);
455
455
  });
456
- function pr(e, t, n, o, r) {
457
- return Xe(e.tag, ue(ue({ key: t }, Ls(e, n, r)), o), ($s(e, n).children || []).map(function(s, c) {
458
- return pr(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
456
+ function _r(e, t, n, o, r) {
457
+ return ze(e.tag, he(he({ key: t }, Ls(e, n, r)), o), ($s(e, n).children || []).map(function(s, c) {
458
+ return _r(s, "".concat(t, "-").concat(e.tag, "-").concat(c), n, void 0, r);
459
459
  }));
460
460
  }
461
461
  function Ls(e, t, n) {
462
- var o = ue({}, e.attrs);
462
+ var o = he({}, e.attrs);
463
463
  n != null && n.colorChannel1 && o.fill === "colorChannel1" && (o.fill = n.colorChannel1), e.tag === "mask" && o.id && (o.id = o.id + t.idSuffix), Object.entries(o).forEach(function(s) {
464
464
  var c = s[0], i = s[1];
465
465
  c === "mask" && typeof i == "string" && (o[c] = i.replace(/url\(#(.*)\)/, "url(#$1".concat(t.idSuffix, ")")));
@@ -472,69 +472,69 @@ function Ls(e, t, n) {
472
472
  }
473
473
  function $s(e, t) {
474
474
  var n, o = t.defIds;
475
- return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? ue(ue({}, e), { children: e.children.map(function(r) {
476
- return typeof r.attrs.id == "string" && o && o.includes(r.attrs.id) ? ue(ue({}, r), { attrs: ue(ue({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
475
+ return !o || o.length === 0 ? e : e.tag === "defs" && (!((n = e.children) === null || n === void 0) && n.length) ? he(he({}, e), { children: e.children.map(function(r) {
476
+ return typeof r.attrs.id == "string" && o && o.includes(r.attrs.id) ? he(he({}, r), { attrs: he(he({}, r.attrs), { id: r.attrs.id + t.idSuffix }) }) : r;
477
477
  }) }) : e;
478
478
  }
479
479
  function Ps() {
480
480
  return Math.random().toString(36).substring(2, 8);
481
481
  }
482
- Qe.displayName = "UniverIcon";
483
- var Us = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, vr = Ne(function(e, t) {
484
- return Xe(Qe, Object.assign({}, e, {
482
+ Xe.displayName = "UniverIcon";
483
+ var Us = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rr = Ne(function(e, t) {
484
+ return ze(Xe, Object.assign({}, e, {
485
485
  id: "check-mark-icon",
486
486
  ref: t,
487
487
  icon: Us
488
488
  }));
489
489
  });
490
- vr.displayName = "CheckMarkIcon";
491
- var Vs = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, Sr = Ne(function(e, t) {
492
- return Xe(Qe, Object.assign({}, e, {
490
+ Rr.displayName = "CheckMarkIcon";
491
+ var Vs = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M3.71274 2.86421C3.47843 2.6299 3.09853 2.6299 2.86421 2.86421C2.6299 3.09853 2.6299 3.47843 2.86421 3.71274L7.15154 8.00007L2.86421 12.2874C2.6299 12.5217 2.6299 12.9016 2.86421 13.1359C3.09853 13.3702 3.47843 13.3702 3.71274 13.1359L8.00007 8.84859L12.2874 13.1359C12.5217 13.3702 12.9016 13.3702 13.1359 13.1359C13.3702 12.9016 13.3702 12.5217 13.1359 12.2874L8.84859 8.00007L13.1359 3.71274C13.3702 3.47843 13.3702 3.09853 13.1359 2.86421C12.9016 2.6299 12.5217 2.6299 12.2874 2.86421L8.00007 7.15154L3.71274 2.86421Z" } }] }, Ir = Ne(function(e, t) {
492
+ return ze(Xe, Object.assign({}, e, {
493
493
  id: "close-icon",
494
494
  ref: t,
495
495
  icon: Vs
496
496
  }));
497
497
  });
498
- Sr.displayName = "CloseIcon";
499
- var Ws = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Cr = Ne(function(e, t) {
500
- return Xe(Qe, Object.assign({}, e, {
498
+ Ir.displayName = "CloseIcon";
499
+ var Ws = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.3313 1.4667C5.3313 1.13533 5.59993 0.866699 5.9313 0.866699H10.069C10.4004 0.866699 10.669 1.13533 10.669 1.4667C10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443C14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928L9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171C10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778L9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539C9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263L6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539C5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778L6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Er = Ne(function(e, t) {
500
+ return ze(Xe, Object.assign({}, e, {
501
501
  id: "delete-icon",
502
502
  ref: t,
503
503
  icon: Ws
504
504
  }));
505
505
  });
506
- Cr.displayName = "DeleteIcon";
507
- var Hs = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, _r = Ne(function(e, t) {
508
- return Xe(Qe, Object.assign({}, e, {
506
+ Er.displayName = "DeleteIcon";
507
+ var Hs = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z" } }] }, br = Ne(function(e, t) {
508
+ return ze(Xe, Object.assign({}, e, {
509
509
  id: "increase-icon",
510
510
  ref: t,
511
511
  icon: Hs
512
512
  }));
513
513
  });
514
- _r.displayName = "IncreaseIcon";
515
- var Bs = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Rr = Ne(function(e, t) {
516
- return Xe(Qe, Object.assign({}, e, {
514
+ br.displayName = "IncreaseIcon";
515
+ var Bs = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M5.90913 3.57564C6.14345 3.34132 6.52335 3.34132 6.75766 3.57564L10.7577 7.57564C10.992 7.80995 10.992 8.18985 10.7577 8.42417L6.75766 12.4242C6.52335 12.6585 6.14345 12.6585 5.90913 12.4242C5.67482 12.1899 5.67482 11.81 5.90913 11.5756L9.48487 7.9999L5.90913 4.42417C5.67482 4.18985 5.67482 3.80995 5.90913 3.57564Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, yr = Ne(function(e, t) {
516
+ return ze(Xe, Object.assign({}, e, {
517
517
  id: "more-icon",
518
518
  ref: t,
519
519
  icon: Bs
520
520
  }));
521
521
  });
522
- Rr.displayName = "MoreIcon";
523
- var js = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Er = Ne(function(e, t) {
524
- return Xe(Qe, Object.assign({}, e, {
522
+ yr.displayName = "MoreIcon";
523
+ var js = { tag: "svg", attrs: { xmlns: "http://www.w3.org/2000/svg", fill: "none", viewBox: "0 0 16 16", width: "1em", height: "1em" }, children: [{ tag: "path", attrs: { fill: "currentColor", d: "M12.6185 12.4423C12.5907 12.2749 12.7773 12.15 12.9343 12.2308L15.4242 13.5126C15.6102 13.6084 15.5544 13.8745 15.3439 13.8955L14.2456 14.184L13.4521 15.1286C13.3495 15.2939 13.085 15.2463 13.0534 15.0568L12.6185 12.4423Z" } }, { tag: "path", attrs: { fill: "currentColor", d: "M1 3.6C1 2.16406 2.16406 1 3.6 1H12.3C13.7359 1 14.9 2.16406 14.9 3.6V5.81156C14.9003 5.81881 14.9004 5.82609 14.9004 5.8334C14.9004 5.84071 14.9003 5.84799 14.9 5.85524V10.045C14.9003 10.0522 14.9004 10.0595 14.9004 10.0668C14.9004 10.3982 14.6318 10.6668 14.3004 10.6668H11.1668C10.8907 10.6668 10.6668 10.8907 10.6668 11.1668V14.3C10.6668 14.6314 10.3982 14.9 10.0668 14.9L10.05 14.8998L3.6 14.9C2.16406 14.9 1 13.7359 1 12.3V3.6ZM13.2 5.2334C13.4761 5.2334 13.7 5.00954 13.7 4.7334V3.6C13.7 2.8268 13.0732 2.2 12.3 2.2H11.1668C10.8907 2.2 10.6668 2.42386 10.6668 2.7V4.7334C10.6668 5.00954 10.8907 5.2334 11.1668 5.2334H13.2ZM10.6668 6.9334C10.6668 6.65726 10.8907 6.4334 11.1668 6.4334H13.2C13.4761 6.4334 13.7 6.65726 13.7 6.9334V8.9668C13.7 9.24294 13.4761 9.4668 13.2 9.4668H11.1668C10.8907 9.4668 10.6668 9.24294 10.6668 8.9668V6.9334ZM8.9668 5.2334C9.24294 5.2334 9.4668 5.00954 9.4668 4.7334V2.7C9.4668 2.42386 9.24294 2.2 8.9668 2.2H6.9334C6.65726 2.2 6.4334 2.42386 6.4334 2.7V4.7334C6.4334 5.00954 6.65726 5.2334 6.9334 5.2334L8.9668 5.2334ZM6.4334 6.9334C6.4334 6.65726 6.65726 6.4334 6.9334 6.4334L8.9668 6.4334C9.24294 6.4334 9.4668 6.65726 9.4668 6.9334V8.9668C9.4668 9.24294 9.24294 9.4668 8.9668 9.4668L6.9334 9.4668C6.65726 9.4668 6.4334 9.24294 6.4334 8.9668V6.9334ZM4.7334 5.2334C5.00954 5.2334 5.2334 5.00954 5.2334 4.7334V2.7C5.2334 2.42386 5.00954 2.2 4.7334 2.2H3.6C2.8268 2.2 2.2 2.8268 2.2 3.6V4.7334C2.2 5.00954 2.42386 5.2334 2.7 5.2334H4.7334ZM2.2 6.9334C2.2 6.65726 2.42386 6.4334 2.7 6.4334H4.7334C5.00954 6.4334 5.2334 6.65725 5.2334 6.9334V8.9668C5.2334 9.24294 5.00954 9.4668 4.7334 9.4668H2.7C2.42386 9.4668 2.2 9.24294 2.2 8.9668V6.9334ZM5.2334 11.1668C5.2334 10.8907 5.00954 10.6668 4.7334 10.6668H2.7C2.42386 10.6668 2.2 10.8907 2.2 11.1668V12.3C2.2 13.0732 2.8268 13.7 3.6 13.7H4.7334C5.00954 13.7 5.2334 13.4761 5.2334 13.2V11.1668ZM9.4668 11.1668C9.4668 10.8907 9.24294 10.6668 8.9668 10.6668H6.9334C6.65726 10.6668 6.4334 10.8907 6.4334 11.1668V13.2C6.4334 13.4761 6.65726 13.7 6.9334 13.7H8.9668C9.24294 13.7 9.4668 13.4761 9.4668 13.2V11.1668Z", fillRule: "evenodd", clipRule: "evenodd" } }] }, Tr = Ne(function(e, t) {
524
+ return ze(Xe, Object.assign({}, e, {
525
525
  id: "select-range-icon",
526
526
  ref: t,
527
527
  icon: js
528
528
  }));
529
529
  });
530
- Er.displayName = "SelectRangeIcon";
530
+ Tr.displayName = "SelectRangeIcon";
531
531
  function qs(e, t) {
532
532
  return Object.keys(e).filter((n) => isNaN(Number(n)) && n !== "DefinedName").map((n) => ({
533
533
  label: t.t(`formula.functionType.${n.toLocaleLowerCase()}`),
534
534
  value: `${e[n]}`
535
535
  }));
536
536
  }
537
- function Ir(e) {
537
+ function xr(e) {
538
538
  if (!e.require && !e.repeat)
539
539
  return `[${e.name}]`;
540
540
  if (e.require && !e.repeat)
@@ -557,20 +557,20 @@ const Ks = (e, t = 100) => {
557
557
  };
558
558
  }, [e, t]);
559
559
  };
560
- function br(e, t, n) {
561
- const o = T(qe), r = ne(() => new rr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(fn), c = T(ee), i = J(() => {
560
+ function Or(e, t, n) {
561
+ const o = T(je), r = ne(() => new cr({ left: -999, top: -999, right: -999, bottom: -999 }), []), s = T(pn), c = T(te), i = J(() => {
562
562
  var _;
563
563
  const l = o.getEditor(e);
564
564
  if (!l)
565
565
  return;
566
- const f = l.getBoundingClientRect(), { marginTop: h = 0, marginBottom: m = 0 } = l.getDocumentData().documentStyle, u = l.getSkeleton();
566
+ const f = l.getBoundingClientRect(), { marginTop: h = 0, marginBottom: g = 0 } = l.getDocumentData().documentStyle, u = l.getSkeleton();
567
567
  if (!u) return;
568
568
  const d = (_ = u.getSkeletonData()) == null ? void 0 : _.pages[0].height;
569
- let { left: a, top: v, right: g, bottom: p } = f;
570
- v = v + h, p = d ? v + d : p - m;
571
- const S = r.getValue();
572
- if (!(S.left === a && S.top === v && S.right === g && S.bottom === p))
573
- return r.next({ left: a - 1, right: g + 1, top: v - 1, bottom: p + 1 }), f;
569
+ let { left: a, top: v, right: m, bottom: p } = f;
570
+ v = v + h, p = d ? v + d : p - g;
571
+ const C = r.getValue();
572
+ if (!(C.left === a && C.top === v && C.right === m && C.bottom === p))
573
+ return r.next({ left: a - 1, right: m + 1, top: v - 1, bottom: p + 1 }), f;
574
574
  });
575
575
  return $(() => {
576
576
  t && i();
@@ -581,34 +581,34 @@ function br(e, t, n) {
581
581
  };
582
582
  }, []), [r, i];
583
583
  }
584
- const Je = (e) => {
585
- const t = G(e);
584
+ const Qe = (e) => {
585
+ const t = z(e);
586
586
  return t.current = e, t;
587
587
  }, Ys = (e, t, n) => {
588
- const o = T(Bt), r = T(_e), [s, c] = V(), [i, l] = V(-1), [f, h] = V(!0), m = Je(f), u = G(t);
588
+ const o = T(Yt), r = T(Ie), [s, c] = V(), [i, l] = V(-1), [f, h] = V(!0), g = Qe(f), u = z(t);
589
589
  u.current = t;
590
590
  const d = () => {
591
591
  c(void 0), l(-1), h(!1);
592
592
  };
593
593
  return $(() => {
594
594
  if (n && e) {
595
- const a = n.selectionChange$.pipe(ln(50)).subscribe((g) => {
596
- if (g.textRanges.length === 1) {
597
- const [p] = g.textRanges;
598
- if (p.collapsed && m.current) {
599
- const S = r.getFunctionAndParameter(`${u.current}A`, p.startOffset - 1);
600
- if (S) {
601
- const { functionName: _, paramIndex: R } = S, C = o.getFunctionInfo(_);
602
- c(C), l(R);
595
+ const a = n.selectionChange$.pipe(hn(50)).subscribe((m) => {
596
+ if (m.textRanges.length === 1) {
597
+ const [p] = m.textRanges;
598
+ if (p.collapsed && g.current) {
599
+ const C = r.getFunctionAndParameter(`${u.current}A`, p.startOffset - 1);
600
+ if (C) {
601
+ const { functionName: _, paramIndex: R } = C, S = o.getFunctionInfo(_);
602
+ c(S), l(R);
603
603
  return;
604
604
  }
605
605
  }
606
606
  }
607
607
  c(void 0), l(-1);
608
608
  }), v = n.selectionChange$.pipe(
609
- Jt((g) => g.isEditing),
610
- Jt((g) => g.textRanges.length === 1),
611
- or((g) => g.textRanges[0].startOffset),
609
+ nn((m) => m.isEditing),
610
+ nn((m) => m.textRanges.length === 1),
611
+ ar((m) => m.textRanges[0].startOffset),
612
612
  Vo()
613
613
  ).subscribe(() => {
614
614
  h(!0);
@@ -631,7 +631,7 @@ const Je = (e) => {
631
631
  onClick: e,
632
632
  children: "?"
633
633
  }
634
- ), zt = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
634
+ ), Jt = ({ className: e, title: t, value: n }) => /* @__PURE__ */ W("div", { className: "univer-my-2", children: [
635
635
  /* @__PURE__ */ O(
636
636
  "div",
637
637
  {
@@ -659,29 +659,29 @@ const Je = (e) => {
659
659
  {
660
660
  className: o === c ? "univer-text-primary-500" : "",
661
661
  onClick: () => r(c),
662
- children: Ir(s)
662
+ children: xr(s)
663
663
  }
664
664
  ),
665
665
  c === n.length - 1 ? "" : ","
666
666
  ] }, s.name)),
667
667
  ")"
668
668
  ] });
669
- }, Hn = () => {
669
+ }, Kn = () => {
670
670
  };
671
671
  function zs(e) {
672
- const { onParamsSwitch: t = Hn, onClose: n = Hn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } = Ys(o, s, r), f = ne(() => !!c && i >= 0, [c, i]), h = T(an), m = !ge(h.helpFunctionVisible$), [u, d] = V(!0), a = T(lt), v = a.t("formula.prompt.required"), g = a.t("formula.prompt.optional"), p = r.getEditorId(), [S] = br(p, f, [c, i]);
672
+ const { onParamsSwitch: t = Kn, onClose: n = Kn, isFocus: o, editor: r, formulaText: s } = e, { functionInfo: c, paramIndex: i, reset: l } = Ys(o, s, r), f = ne(() => !!c && i >= 0, [c, i]), h = T(dn), g = !ve(h.helpFunctionVisible$), [u, d] = V(!0), a = T(ct), v = a.t("formula.prompt.required"), m = a.t("formula.prompt.optional"), p = r.getEditorId(), [C] = Or(p, f, [c, i]);
673
673
  function _(y) {
674
674
  t && t(y);
675
675
  }
676
676
  const R = J((y) => {
677
677
  h.helpFunctionVisible$.next(!y);
678
- }), C = () => {
678
+ }), S = () => {
679
679
  R(!0), n();
680
680
  };
681
- return f && c ? m ? /* @__PURE__ */ O(en, { portal: !0, anchorRect$: S, direction: "left-center", children: /* @__PURE__ */ O(Gs, { onClick: () => R(!1) }) }, "hidden") : /* @__PURE__ */ O(en, { portal: !0, onClickOutside: () => l(), anchorRect$: S, direction: "vertical", children: /* @__PURE__ */ W(
681
+ return f && c ? g ? /* @__PURE__ */ O(rn, { portal: !0, anchorRect$: C, direction: "left-center", children: /* @__PURE__ */ O(Gs, { onClick: () => R(!1) }) }, "hidden") : /* @__PURE__ */ O(rn, { portal: !0, onClickOutside: () => l(), anchorRect$: C, direction: "vertical", children: /* @__PURE__ */ W(
682
682
  "div",
683
683
  {
684
- className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", gn),
684
+ className: re("univer-m-0 univer-box-border univer-w-[250px] univer-select-none univer-list-none univer-rounded-lg univer-bg-white univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", vn),
685
685
  children: [
686
686
  /* @__PURE__ */ W(
687
687
  "div",
@@ -704,15 +704,15 @@ function zs(e) {
704
704
  className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-500 univer-outline-none univer-transition-colors hover:univer-bg-gray-200 dark:hover:!univer-bg-gray-600",
705
705
  style: { transform: u ? "rotateZ(-90deg)" : "rotateZ(90deg)" },
706
706
  onClick: () => d(!u),
707
- children: /* @__PURE__ */ O(Rr, {})
707
+ children: /* @__PURE__ */ O(yr, {})
708
708
  }
709
709
  ),
710
710
  /* @__PURE__ */ O(
711
711
  "div",
712
712
  {
713
713
  className: "univer-ml-2 univer-flex univer-h-6 univer-w-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-bg-transparent univer-p-0 univer-text-xs univer-text-gray-600 univer-outline-none univer-transition-colors hover:univer-bg-gray-300 dark:!univer-text-gray-200 dark:hover:!univer-bg-gray-600",
714
- onClick: C,
715
- children: /* @__PURE__ */ O(Sr, {})
714
+ onClick: S,
715
+ children: /* @__PURE__ */ O(Ir, {})
716
716
  }
717
717
  )
718
718
  ] })
@@ -722,32 +722,32 @@ function zs(e) {
722
722
  /* @__PURE__ */ O(
723
723
  "div",
724
724
  {
725
- className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", at),
725
+ className: re("univer-box-border univer-max-h-[350px] univer-overflow-y-auto univer-px-4 univer-pb-3 univer-pt-0", it),
726
726
  style: {
727
727
  height: u ? "unset" : 0,
728
728
  padding: u ? "revert-layer" : 0
729
729
  },
730
730
  children: /* @__PURE__ */ W("div", { className: "univer-mt-3", children: [
731
731
  /* @__PURE__ */ O(
732
- zt,
732
+ Jt,
733
733
  {
734
734
  title: a.t("formula.prompt.helpExample"),
735
735
  value: `${c.functionName}(${c.functionParameter.map((y) => y.example).join(",")})`
736
736
  }
737
737
  ),
738
738
  /* @__PURE__ */ O(
739
- zt,
739
+ Jt,
740
740
  {
741
741
  title: a.t("formula.prompt.helpAbstract"),
742
742
  value: c.description
743
743
  }
744
744
  ),
745
745
  c && c.functionParameter && c.functionParameter.map((y, N) => /* @__PURE__ */ O(
746
- zt,
746
+ Jt,
747
747
  {
748
748
  className: i === N ? "univer-text-primary-500" : "",
749
749
  title: y.name,
750
- value: `${y.require ? v : g} ${y.detail}`
750
+ value: `${y.require ? v : m} ${y.detail}`
751
751
  },
752
752
  N
753
753
  ))
@@ -759,13 +759,13 @@ function zs(e) {
759
759
  ) }, "show") : null;
760
760
  }
761
761
  const Xs = (e) => {
762
- const t = T(qe);
762
+ const t = T(je);
763
763
  return J((o) => {
764
764
  var r, s;
765
765
  if (e) {
766
766
  t.focus(e.getEditorId());
767
767
  const c = [...e.getSelectionRanges()];
768
- if (it.isDefine(o))
768
+ if (ot.isDefine(o))
769
769
  e.setSelectionRanges([{ startOffset: o, endOffset: o }]);
770
770
  else if (!c.length && !e.docSelectionRenderService.isOnPointerEvent) {
771
771
  const i = (s = (r = e.getDocumentData().body) == null ? void 0 : r.dataStream) != null ? s : `\r
@@ -780,8 +780,8 @@ var Qs = Object.getOwnPropertyDescriptor, Js = (e, t, n, o) => {
780
780
  for (var r = o > 1 ? void 0 : o ? Qs(t, n) : t, s = e.length - 1, c; s >= 0; s--)
781
781
  (c = e[s]) && (r = c(r) || r);
782
782
  return r;
783
- }, rt = (e, t) => (n, o) => t(n, o, e);
784
- let De = class extends lo {
783
+ }, tt = (e, t) => (n, o) => t(n, o, e);
784
+ let Le = class extends lo {
785
785
  constructor(t, n, o, r, s, c, i) {
786
786
  super(
787
787
  n,
@@ -790,8 +790,8 @@ let De = class extends lo {
790
790
  s,
791
791
  c
792
792
  );
793
- q(this, "_workbookSelections");
794
- q(this, "_eventDisposables");
793
+ K(this, "_workbookSelections");
794
+ K(this, "_eventDisposables");
795
795
  this._context = t, this._contextService = c, this._refSelectionsService = i, this._workbookSelections = this._refSelectionsService.getWorkbookSelections(this._context.unitId), this._initSelectionChangeListener(), this._initSkeletonChangeListener(), this._initUserActionSyncListener(), this._setSelectionStyle(ei(this._themeService)), this._remainLastEnabled = !0, this._highlightHeader = !1;
796
796
  }
797
797
  getLocation() {
@@ -816,7 +816,7 @@ let De = class extends lo {
816
816
  * Call this method and user will be able to select on the canvas to update selections.
817
817
  */
818
818
  enableSelectionChanging() {
819
- return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), Xn(() => this._disableSelectionChanging());
819
+ return this._disableSelectionChanging(), this._eventDisposables = this._initCanvasEventListeners(), tr(() => this._disableSelectionChanging());
820
820
  }
821
821
  _disableSelectionChanging() {
822
822
  var t;
@@ -826,23 +826,23 @@ let De = class extends lo {
826
826
  this._disableSelectionChanging();
827
827
  }
828
828
  _initCanvasEventListeners() {
829
- const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new He();
829
+ const t = this._getSheetObject(), { spreadsheetRowHeader: n, spreadsheetColumnHeader: o, spreadsheet: r, spreadsheetLeftTopPlaceholder: s } = t, { scene: c } = this._context, i = new We();
830
830
  return i.add(r == null ? void 0 : r.onPointerDown$.subscribeEvent((l, f) => {
831
- this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, Se.NORMAL, this._getActiveViewport(l)), l.button !== 2 && f.stopPropagation());
831
+ this.inRefSelectionMode() && (this._onPointerDown(l, r.zIndex + 1, _e.NORMAL, this._getActiveViewport(l)), l.button !== 2 && f.stopPropagation());
832
832
  })), i.add(
833
833
  n == null ? void 0 : n.onPointerDown$.subscribeEvent((l, f) => {
834
834
  if (!this.inRefSelectionMode()) return;
835
- const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: m } = Tn(l.offsetX, l.offsetY, c, h);
836
- xn(this._workbookSelections.getCurrentSelections(), m, Se.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Se.ROW, this._getActiveViewport(l), Gt.Y), l.button !== 2 && f.stopPropagation());
835
+ const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { row: g } = Mn(l.offsetX, l.offsetY, c, h);
836
+ wn(this._workbookSelections.getCurrentSelections(), g, _e.ROW) || (this._onPointerDown(l, (r.zIndex || 1) + 1, _e.ROW, this._getActiveViewport(l), Xt.Y), l.button !== 2 && f.stopPropagation());
837
837
  })
838
838
  ), i.add(o == null ? void 0 : o.onPointerDown$.subscribeEvent((l, f) => {
839
839
  if (!this.inRefSelectionMode()) return;
840
- const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: m } = Tn(l.offsetX, l.offsetY, c, h);
841
- xn(this._workbookSelections.getCurrentSelections(), m, Se.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, Se.COLUMN, this._getActiveViewport(l), Gt.X), l.button !== 2 && f.stopPropagation());
840
+ const h = this._sheetSkeletonManagerService.getCurrent().skeleton, { column: g } = Mn(l.offsetX, l.offsetY, c, h);
841
+ wn(this._workbookSelections.getCurrentSelections(), g, _e.COLUMN) || (this._onPointerDown(l, (r.zIndex || 1) + 1, _e.COLUMN, this._getActiveViewport(l), Xt.X), l.button !== 2 && f.stopPropagation());
842
842
  })), i.add(s == null ? void 0 : s.onPointerDown$.subscribeEvent((l, f) => {
843
843
  if (this._reset(), !this.inRefSelectionMode()) return;
844
- const h = this._sheetSkeletonManagerService.getCurrent().skeleton, m = uo(h);
845
- this._addSelectionControlByModelData(m), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
844
+ const h = this._sheetSkeletonManagerService.getCurrent().skeleton, g = uo(h);
845
+ this._addSelectionControlByModelData(g), this._selectionMoveStart$.next(this.getSelectionDataWithStyle());
846
846
  const u = c.onPointerUp$.subscribeEvent(() => {
847
847
  u.unsubscribe(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle());
848
848
  });
@@ -856,7 +856,7 @@ let De = class extends lo {
856
856
  */
857
857
  _addSelectionControlByModelData(t) {
858
858
  var c;
859
- const n = this._skeleton, o = (c = t.style) != null ? c : Jn(this._themeService), r = this._scene;
859
+ const n = this._skeleton, o = (c = t.style) != null ? c : rr(this._themeService), r = this._scene;
860
860
  return t.style = o, this.newSelectionControl(r, n, t);
861
861
  }
862
862
  _initSelectionChangeListener() {
@@ -869,11 +869,11 @@ let De = class extends lo {
869
869
  */
870
870
  _initUserActionSyncListener() {
871
871
  this.disposeWithMe(this.selectionMoveStart$.subscribe((t) => {
872
- this._updateSelections(t, Zt.MOVE_START);
872
+ this._updateSelections(t, Qt.MOVE_START);
873
873
  })), this.disposeWithMe(this.selectionMoving$.subscribe((t) => {
874
- this._updateSelections(t, Zt.MOVING);
874
+ this._updateSelections(t, Qt.MOVING);
875
875
  })), this.disposeWithMe(this.selectionMoveEnd$.subscribe((t) => {
876
- this._updateSelections(t, Zt.MOVE_END);
876
+ this._updateSelections(t, Qt.MOVE_END);
877
877
  }));
878
878
  }
879
879
  _updateSelections(t, n) {
@@ -888,7 +888,7 @@ let De = class extends lo {
888
888
  this.disposeWithMe(this._sheetSkeletonManagerService.currentSkeleton$.subscribe((t) => {
889
889
  if (!t)
890
890
  return;
891
- const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Fn.VIEW_MAIN);
891
+ const { skeleton: n } = t, { scene: o } = this._context, r = o.getViewport(Pn.VIEW_MAIN);
892
892
  this._skeleton && this._skeleton.worksheet.getSheetId() !== n.worksheet.getSheetId() && this._reset(), this._changeRuntime(n, o, r);
893
893
  const s = this._workbookSelections.getCurrentSelections();
894
894
  this.resetSelectionsByModelData(s);
@@ -896,7 +896,7 @@ let De = class extends lo {
896
896
  }
897
897
  _getActiveViewport(t) {
898
898
  const n = this._getSheetObject();
899
- return n == null ? void 0 : n.scene.getActiveViewportByCoord(Dn.FromArray([t.offsetX, t.offsetY]));
899
+ return n == null ? void 0 : n.scene.getActiveViewportByCoord(Un.FromArray([t.offsetX, t.offsetY]));
900
900
  }
901
901
  _getSheetObject() {
902
902
  return ho(this._context.unit, this._context);
@@ -912,63 +912,63 @@ let De = class extends lo {
912
912
  * @param scrollTimerType
913
913
  */
914
914
  // eslint-disable-next-line complexity, max-lines-per-function
915
- _onPointerDown(t, n = 0, o = Se.NORMAL, r, s = Gt.ALL) {
915
+ _onPointerDown(t, n = 0, o = _e.NORMAL, r, s = Xt.ALL) {
916
916
  var x;
917
917
  this._rangeType = o;
918
918
  const c = this._skeleton, i = this._scene;
919
919
  if (!i || !c)
920
920
  return;
921
921
  r && (this._activeViewport = r);
922
- const { offsetX: l, offsetY: f } = t, h = i.getViewport(Fn.VIEW_MAIN);
922
+ const { offsetX: l, offsetY: f } = t, h = i.getViewport(Pn.VIEW_MAIN);
923
923
  if (!h) return;
924
- const m = i.getCoordRelativeToViewport(Dn.FromArray([l, f])), { x: u, y: d } = m;
924
+ const g = i.getCoordRelativeToViewport(Un.FromArray([l, f])), { x: u, y: d } = g;
925
925
  this._startViewportPosX = u, this._startViewportPosY = d;
926
- const a = i.getScrollXYInfoByViewport(m), { scaleX: v, scaleY: g } = i.getAncestorScale(), p = this._skeleton.getCellByOffset(u, d, v, g, a);
926
+ const a = i.getScrollXYInfoByViewport(g), { scaleX: v, scaleY: m } = i.getAncestorScale(), p = this._skeleton.getCellByOffset(u, d, v, m, a);
927
927
  if (!p) return;
928
928
  switch (o) {
929
- case Se.NORMAL:
929
+ case _e.NORMAL:
930
930
  break;
931
- case Se.ROW:
931
+ case _e.ROW:
932
932
  p.startColumn = 0, p.endColumn = this._skeleton.getColumnCount() - 1;
933
933
  break;
934
- case Se.COLUMN:
934
+ case _e.COLUMN:
935
935
  p.startRow = 0, p.endRow = this._skeleton.getRowCount() - 1;
936
936
  break;
937
- case Se.ALL:
937
+ case _e.ALL:
938
938
  p.startRow = 0, p.startColumn = 0, p.endRow = this._skeleton.getRowCount() - 1, p.endColumn = this._skeleton.getColumnCount() - 1;
939
939
  }
940
- const S = { range: p, primary: p, style: null };
941
- S.range.rangeType = o;
942
- const _ = Qt(S, this._skeleton);
940
+ const C = { range: p, primary: p, style: null };
941
+ C.range.rangeType = o;
942
+ const _ = tn(C, this._skeleton);
943
943
  this._startRangeWhenPointerDown = { ..._.rangeWithCoord };
944
944
  const R = { ..._.rangeWithCoord, rangeType: o };
945
- let C = this.getActiveSelectionControl();
945
+ let S = this.getActiveSelectionControl();
946
946
  const y = this.getSelectionControls();
947
- for (const w of y) {
948
- if (t.button === 2 && Gn.contains(w.model, R)) {
949
- C = w;
947
+ for (const k of y) {
948
+ if (t.button === 2 && Qn.contains(k.model, R)) {
949
+ S = k;
950
950
  return;
951
951
  }
952
- if (w.model.isEqual(R)) {
953
- C = w;
952
+ if (k.model.isEqual(R)) {
953
+ S = k;
954
954
  break;
955
955
  }
956
956
  }
957
957
  this._checkClearPreviousControls(t);
958
- const N = C == null ? void 0 : C.model.currentCell, A = t.shiftKey && N, F = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
958
+ const N = S == null ? void 0 : S.model.currentCell, A = t.shiftKey && N, F = this._remainLastEnabled && !t.ctrlKey && !t.shiftKey && !this._skipLastEnabled && !this._singleSelectionEnabled;
959
959
  A && N ? this._makeSelectionByTwoCells(
960
960
  N,
961
961
  R,
962
962
  c,
963
963
  o,
964
- C
964
+ S
965
965
  // Get updated in this method
966
- ) : F && C ? C.updateRangeBySelectionWithCoord(_) : C = this.newSelectionControl(i, c, S);
967
- for (let w = 0; w < this.getSelectionControls().length - 1; w++)
968
- this.getSelectionControls()[w].clearHighlight();
969
- this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (x = i.getTransformer()) == null || x.clearSelectedObjects(), this._setupPointerMoveListener(h, C, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
970
- var w;
971
- this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (w = this._escapeShortcutDisposable) == null || w.dispose(), this._escapeShortcutDisposable = null;
966
+ ) : F && S ? S.updateRangeBySelectionWithCoord(_) : S = this.newSelectionControl(i, c, C);
967
+ for (let k = 0; k < this.getSelectionControls().length - 1; k++)
968
+ this.getSelectionControls()[k].clearHighlight();
969
+ this._selectionMoveStart$.next(this.getSelectionDataWithStyle()), i.disableObjectsEvent(), this._clearUpdatingListeners(), this._addEndingListeners(), (x = i.getTransformer()) == null || x.clearSelectedObjects(), this._setupPointerMoveListener(h, S, o, s, u, d), this._escapeShortcutDisposable = this._shortcutService.forceEscape(), this._scenePointerUpSub = i.onPointerUp$.subscribeEvent(() => {
970
+ var k;
971
+ this._clearUpdatingListeners(), this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()), (k = this._escapeShortcutDisposable) == null || k.dispose(), this._escapeShortcutDisposable = null;
972
972
  });
973
973
  }
974
974
  /**
@@ -979,12 +979,12 @@ let De = class extends lo {
979
979
  * @returns {SelectionControl} selectionControl just created
980
980
  */
981
981
  newSelectionControl(t, n, o) {
982
- const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: c } = n, i = new er(t, r, this._themeService, {
982
+ const r = this.getSelectionControls().length, { rowHeaderWidth: s, columnHeaderHeight: c } = n, i = new or(t, r, this._themeService, {
983
983
  highlightHeader: this._highlightHeader,
984
984
  enableAutoFill: !1,
985
985
  rowHeaderWidth: s,
986
986
  columnHeaderHeight: c
987
- }), l = Qt(o, n);
987
+ }), l = tn(o, n);
988
988
  return i.updateRangeBySelectionWithCoord(l), this._selectionControls.push(i), i.setControlExtension({
989
989
  skeleton: n,
990
990
  scene: t,
@@ -998,102 +998,102 @@ let De = class extends lo {
998
998
  }), i;
999
999
  }
1000
1000
  };
1001
- De = Js([
1002
- rt(1, B(_t)),
1003
- rt(2, B(Rt)),
1004
- rt(3, jt),
1005
- rt(4, B(Wt)),
1006
- rt(5, on),
1007
- rt(6, Ht)
1008
- ], De);
1001
+ Le = Js([
1002
+ tt(1, j(Rt)),
1003
+ tt(2, j(It)),
1004
+ tt(3, Gt),
1005
+ tt(4, j(qt)),
1006
+ tt(5, an),
1007
+ tt(6, Kt)
1008
+ ], Le);
1009
1009
  function ei(e) {
1010
- const t = Jn(e);
1010
+ const t = rr(e);
1011
1011
  return t.widgets = { tl: !0, tc: !0, tr: !0, ml: !0, mr: !0, bl: !0, bc: !0, br: !0 }, t;
1012
1012
  }
1013
1013
  function ti(e) {
1014
1014
  var r, s;
1015
- const n = e.get(ee).getCurrentUniverDocInstance();
1015
+ const n = e.get(te).getCurrentUniverDocInstance();
1016
1016
  return n != null && n.getBody() ? { dataStream: (s = (r = n.getBody()) == null ? void 0 : r.dataStream) != null ? s : "", offset: 0 } : void 0;
1017
1017
  }
1018
- var Ae = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e))(Ae || {});
1018
+ var Fe = /* @__PURE__ */ ((e) => (e[e.NOT_SELECT = 0] = "NOT_SELECT", e[e.NEED_ADD = 1] = "NEED_ADD", e[e.CAN_EDIT = 2] = "CAN_EDIT", e[e.EDIT_OTHER_SHEET_REFERENCE = 3] = "EDIT_OTHER_SHEET_REFERENCE", e))(Fe || {});
1019
1019
  function ni(e) {
1020
1020
  var N;
1021
- const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(Oe), i = T(ee), l = c.getRenderById(r), f = c.getRenderById(t), h = f == null ? void 0 : f.with(sr), m = T(dr), u = T(_t), [d, a] = V(
1021
+ const { editorId: t, isFocus: n, disableOnClick: o, unitId: r, subUnitId: s } = e, c = T(Oe), i = T(te), l = c.getRenderById(r), f = c.getRenderById(t), h = f == null ? void 0 : f.with(lr), g = T(mr), u = T(Rt), [d, a] = V(
1022
1022
  0
1023
1023
  /* NOT_SELECT */
1024
- ), v = T(_e), g = G(!0), p = l == null ? void 0 : l.with(De), S = Je(d), _ = i.getUnit(r, j.UNIVER_SHEET), R = _ == null ? void 0 : _.getSheetBySheetId(s), C = J((A) => {
1024
+ ), v = T(Ie), m = z(!0), p = l == null ? void 0 : l.with(Le), C = Qe(d), _ = i.getUnit(r, q.UNIVER_SHEET), R = _ == null ? void 0 : _.getSheetBySheetId(s), S = J((A) => {
1025
1025
  p && p.setSkipLastEnabled(
1026
1026
  A === 1 || A === 3
1027
1027
  /* EDIT_OTHER_SHEET_REFERENCE */
1028
- ), S.current = A, a(A);
1028
+ ), C.current = A, a(A);
1029
1029
  }), y = J(() => {
1030
- var H, ie;
1030
+ var H, ce;
1031
1031
  if (!_) return;
1032
- const A = _.getActiveSheet(), F = h == null ? void 0 : h.getActiveTextRange(), x = F != null && F.collapsed ? F.startOffset : -1, w = ti(u);
1033
- if (!w) return;
1034
- const M = (H = w == null ? void 0 : w.dataStream) == null ? void 0 : H.slice(0, -2), b = ((ie = v.sequenceNodesBuilder(M)) != null ? ie : []).map((K) => typeof K == "object" ? K.nodeType === z.REFERENCE ? {
1035
- ...K,
1036
- range: Oo(K.token)
1032
+ const A = _.getActiveSheet(), F = h == null ? void 0 : h.getActiveTextRange(), x = F != null && F.collapsed ? F.startOffset : -1, k = ti(u);
1033
+ if (!k) return;
1034
+ const w = (H = k == null ? void 0 : k.dataStream) == null ? void 0 : H.slice(0, -2), b = ((ce = v.sequenceNodesBuilder(w)) != null ? ce : []).map((Y) => typeof Y == "object" ? Y.nodeType === X.REFERENCE ? {
1035
+ ...Y,
1036
+ range: Oo(Y.token)
1037
1037
  } : {
1038
- ...K,
1038
+ ...Y,
1039
1039
  range: void 0
1040
- } : K), E = M[x - 1], I = M[x], k = b.find((K) => typeof K == "object" && K.nodeType === z.REFERENCE && x === K.endIndex + 2), D = E && No(E) && (!I || Mo(I) && I !== ct.OPEN_BRACKET), U = !!k;
1041
- if ((M == null ? void 0 : M.substring(0, 1)) === "=" && (D || U))
1040
+ } : Y), I = w[x - 1], E = w[x], M = b.find((Y) => typeof Y == "object" && Y.nodeType === X.REFERENCE && x === Y.endIndex + 2), D = I && No(I) && (!E || Mo(E) && E !== st.OPEN_BRACKET), U = !!M;
1041
+ if ((w == null ? void 0 : w.substring(0, 1)) === "=" && (D || U))
1042
1042
  if (U) {
1043
- if (g.current)
1043
+ if (m.current)
1044
1044
  return;
1045
- !k.range.sheetName && A.getSheetId() === (R == null ? void 0 : R.getSheetId()) || k.range.sheetName === A.getName() ? C(
1045
+ !M.range.sheetName && A.getSheetId() === (R == null ? void 0 : R.getSheetId()) || M.range.sheetName === A.getName() ? S(
1046
1046
  2
1047
1047
  /* CAN_EDIT */
1048
- ) : C(
1048
+ ) : S(
1049
1049
  3
1050
1050
  /* EDIT_OTHER_SHEET_REFERENCE */
1051
1051
  );
1052
1052
  } else
1053
- g.current = !1, C(
1053
+ m.current = !1, S(
1054
1054
  1
1055
1055
  /* NEED_ADD */
1056
1056
  );
1057
1057
  else
1058
- C(
1058
+ S(
1059
1059
  0
1060
1060
  /* NOT_SELECT */
1061
1061
  );
1062
1062
  });
1063
1063
  return $(() => {
1064
- const A = m.textSelection$.pipe(Jt((F) => F.unitId === t)).subscribe(() => {
1064
+ const A = g.textSelection$.pipe(nn((F) => F.unitId === t)).subscribe(() => {
1065
1065
  y();
1066
1066
  });
1067
1067
  return () => A.unsubscribe();
1068
- }, [y, m.textSelection$, t]), $(() => {
1069
- n || (C(
1068
+ }, [y, g.textSelection$, t]), $(() => {
1069
+ n || (S(
1070
1070
  0
1071
1071
  /* NOT_SELECT */
1072
- ), g.current = !0);
1073
- }, [n, C]), $(() => {
1072
+ ), m.current = !0);
1073
+ }, [n, S]), $(() => {
1074
1074
  var F;
1075
1075
  if (!o) return;
1076
1076
  const A = (F = f == null ? void 0 : f.mainComponent) == null ? void 0 : F.onPointerDown$.subscribeEvent(() => {
1077
- C(
1077
+ S(
1078
1078
  0
1079
1079
  /* NOT_SELECT */
1080
- ), g.current = !0;
1080
+ ), m.current = !0;
1081
1081
  });
1082
1082
  return () => A == null ? void 0 : A.unsubscribe();
1083
- }, [o, (N = f == null ? void 0 : f.mainComponent) == null ? void 0 : N.onPointerDown$, C]), $(() => {
1083
+ }, [o, (N = f == null ? void 0 : f.mainComponent) == null ? void 0 : N.onPointerDown$, S]), $(() => {
1084
1084
  if (!n) return;
1085
1085
  const A = _ == null ? void 0 : _.activeSheet$.subscribe(() => {
1086
1086
  y();
1087
1087
  });
1088
1088
  return () => A == null ? void 0 : A.unsubscribe();
1089
- }, [y, n, _ == null ? void 0 : _.activeSheet$]), { isSelecting: d, isSelectingRef: S };
1089
+ }, [y, n, _ == null ? void 0 : _.activeSheet$]), { isSelecting: d, isSelectingRef: C };
1090
1090
  }
1091
1091
  const ri = () => {
1092
- const e = T(_e);
1093
- return kt((n) => e.sequenceNodesBuilder(n) || [], [e]);
1092
+ const e = T(Ie);
1093
+ return Lt((n) => e.sequenceNodesBuilder(n) || [], [e]);
1094
1094
  };
1095
1095
  function oi(e, t, n) {
1096
- const o = new cn(t).setAlpha(0.05).toRgbString();
1096
+ const o = new un(t).setAlpha(0.05).toRgbString();
1097
1097
  return {
1098
1098
  id: n,
1099
1099
  strokeWidth: 1,
@@ -1105,8 +1105,8 @@ function oi(e, t, n) {
1105
1105
  widgetStroke: e.getColorFromTheme("white")
1106
1106
  };
1107
1107
  }
1108
- function yr(e) {
1109
- var _, R, C;
1108
+ function Nr(e) {
1109
+ var _, R, S;
1110
1110
  const {
1111
1111
  unitId: t,
1112
1112
  subUnitId: n,
@@ -1118,43 +1118,43 @@ function yr(e) {
1118
1118
  sheetSkeletonManagerService: l,
1119
1119
  themeService: f,
1120
1120
  univerInstanceService: h
1121
- } = e, m = o.getUnitId(), u = h.getUnit(t, j.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(), a = [];
1121
+ } = e, g = o.getUnitId(), u = h.getUnit(t, q.UNIVER_SHEET), d = u == null ? void 0 : u.getActiveSheet(), a = [];
1122
1122
  if (!u || !d) {
1123
1123
  c.setSelections(a);
1124
1124
  return;
1125
1125
  }
1126
- const v = d.getSheetId(), g = (y) => {
1126
+ const v = d.getSheetId(), m = (y) => {
1127
1127
  var N;
1128
1128
  return (N = u == null ? void 0 : u.getSheetBySheetName(y)) == null ? void 0 : N.getSheetId();
1129
1129
  };
1130
1130
  if (!((_ = l == null ? void 0 : l.getWorksheetSkeleton(v)) == null ? void 0 : _.skeleton)) return;
1131
- const S = [];
1131
+ const C = [];
1132
1132
  for (let y = 0, N = r.length; y < N; y++) {
1133
- const A = r[y], { themeColor: F, token: x, refIndex: w, endIndex: M } = A, b = dt(x), { unitId: E, sheetName: I, range: k } = b, D = g(I);
1134
- if (!D && I || m !== t && E !== m || E && E !== m || D && D !== v || !D && v !== n)
1133
+ const A = r[y], { themeColor: F, token: x, refIndex: k, endIndex: w } = A, b = lt(x), { unitId: I, sheetName: E, range: M } = b, D = m(E);
1134
+ if (!D && E || g !== t && I !== g || I && I !== g || D && D !== v || !D && v !== n)
1135
1135
  continue;
1136
- const U = Jo(k, d.getRowCount(), d.getColumnCount());
1136
+ const U = Jo(M, d.getRowCount(), d.getColumnCount());
1137
1137
  U.unitId = t, U.sheetId = v, a.push({
1138
1138
  range: U,
1139
1139
  primary: null,
1140
- style: oi(f, F, w.toString())
1141
- }), S.push(M);
1140
+ style: oi(f, F, k.toString())
1141
+ }), C.push(w);
1142
1142
  }
1143
1143
  if (s) {
1144
- const y = (C = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : C.startOffset, N = S.findIndex((A) => A + 2 === y);
1144
+ const y = (S = (R = s.getSelectionRanges()) == null ? void 0 : R[0]) == null ? void 0 : S.startOffset, N = C.findIndex((A) => A + 2 === y);
1145
1145
  N !== -1 ? i == null || i.setActiveSelectionIndex(N) : i == null || i.resetActiveSelectionIndex();
1146
1146
  }
1147
1147
  return a;
1148
1148
  }
1149
1149
  function si(e, t) {
1150
- const n = T(ee), o = T(Rt), r = T(Ht), s = T(Oe), c = ge(ne(() => n.getCurrentTypeOfUnit$(j.UNIVER_SHEET), [n])), i = c ? s.getRenderById(c.getUnitId()) : null, l = i == null ? void 0 : i.with(De), f = i == null ? void 0 : i.with(Wt), h = J((m, u) => {
1151
- const d = n.getCurrentUnitOfType(j.UNIVER_SHEET);
1150
+ const n = T(te), o = T(It), r = T(Kt), s = T(Oe), c = ve(ne(() => n.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [n])), i = c ? s.getRenderById(c.getUnitId()) : null, l = i == null ? void 0 : i.with(Le), f = i == null ? void 0 : i.with(qt), h = J((g, u) => {
1151
+ const d = n.getCurrentUnitOfType(q.UNIVER_SHEET);
1152
1152
  if (!d || l != null && l.selectionMoving) return;
1153
- const a = yr({
1153
+ const a = Nr({
1154
1154
  unitId: e,
1155
1155
  subUnitId: t,
1156
1156
  currentWorkbook: d,
1157
- refSelections: m,
1157
+ refSelections: g,
1158
1158
  editor: u,
1159
1159
  refSelectionsService: r,
1160
1160
  refSelectionsRenderService: l,
@@ -1168,10 +1168,10 @@ function si(e, t) {
1168
1168
  l == null || l.resetActiveSelectionIndex();
1169
1169
  }, [l]), h;
1170
1170
  }
1171
- function Tr(e = "") {
1172
- const t = T(Bt), n = ii(), o = T(de), r = ne(() => e.length, [e]);
1171
+ function Mr(e = "") {
1172
+ const t = T(Yt), n = ii(), o = T(fe), r = ne(() => e.length, [e]);
1173
1173
  return J((c, i, l = !0, f) => {
1174
- const h = c.getDocumentData(), m = c.getEditorId();
1174
+ const h = c.getDocumentData(), g = c.getEditorId();
1175
1175
  if (!h)
1176
1176
  return [];
1177
1177
  const u = h.body;
@@ -1180,36 +1180,36 @@ function Tr(e = "") {
1180
1180
  const d = u.dataStream.slice(0, u.dataStream.length - 2), a = { dataStream: "", ...h.body };
1181
1181
  if (!d.startsWith(e)) return [];
1182
1182
  if (i == null || i.length === 0)
1183
- return a.textRuns = [], o.syncExecuteCommand(An.id, {
1184
- unitId: m,
1185
- body: yn(a, 0, a.dataStream.length - 2)
1183
+ return a.textRuns = [], o.syncExecuteCommand($n.id, {
1184
+ unitId: g,
1185
+ body: Nn(a, 0, a.dataStream.length - 2)
1186
1186
  }), [];
1187
1187
  {
1188
- const { textRuns: v, refSelections: g } = ci(t, n, i);
1188
+ const { textRuns: v, refSelections: m } = ci(t, n, i);
1189
1189
  r && v.forEach((_) => {
1190
1190
  _.ed = _.ed + r, _.st = _.st + r;
1191
1191
  }), a.textRuns = [{ st: 0, ed: 1, ts: { fs: 11 } }, ...v];
1192
1192
  const p = i.reduce((_, R) => typeof R == "string" ? `${_}${R}` : `${_}${R.token}`, "");
1193
1193
  a.dataStream = `${e}${p}\r
1194
1194
  `;
1195
- let S;
1195
+ let C;
1196
1196
  if (l) {
1197
- S = c.getSelectionRanges();
1197
+ C = c.getSelectionRanges();
1198
1198
  const _ = a.dataStream.length - 2 + r;
1199
- S.forEach((R) => {
1199
+ C.forEach((R) => {
1200
1200
  R.startOffset = Math.max(0, Math.min(R.startOffset, _)), R.endOffset = Math.max(0, Math.min(R.endOffset, _));
1201
1201
  });
1202
1202
  }
1203
- return o.syncExecuteCommand(An.id, {
1204
- unitId: m,
1205
- body: yn(a, 0, a.dataStream.length - 2),
1206
- textRanges: f != null ? f : S
1207
- }), g;
1203
+ return o.syncExecuteCommand($n.id, {
1204
+ unitId: g,
1205
+ body: Nn(a, 0, a.dataStream.length - 2),
1206
+ textRanges: f != null ? f : C
1207
+ }), m;
1208
1208
  }
1209
1209
  });
1210
1210
  }
1211
1211
  function ii() {
1212
- const e = T(Rt), t = e.getCurrentTheme();
1212
+ const e = T(It), t = e.getCurrentTheme();
1213
1213
  return ne(() => {
1214
1214
  const o = [
1215
1215
  e.getColorFromTheme("loop-color.1"),
@@ -1231,13 +1231,13 @@ function ii() {
1231
1231
  function ci(e, t, n) {
1232
1232
  const { formulaRefColors: o, numberColor: r, stringColor: s, plainTextColor: c } = t, i = [], l = [], f = /* @__PURE__ */ new Map();
1233
1233
  let h = 0;
1234
- for (let m = 0, u = n.length; m < u; m++) {
1235
- const d = n[m];
1234
+ for (let g = 0, u = n.length; g < u; g++) {
1235
+ const d = n[g];
1236
1236
  if (typeof d == "string") {
1237
- const _ = i[i.length - 1], R = _ ? _.ed : 0, C = R + d.length;
1237
+ const _ = i[i.length - 1], R = _ ? _.ed : 0, S = R + d.length;
1238
1238
  i.push({
1239
1239
  st: R,
1240
- ed: C,
1240
+ ed: S,
1241
1241
  ts: {
1242
1242
  cl: {
1243
1243
  rgb: c
@@ -1260,30 +1260,30 @@ function ci(e, t, n) {
1260
1260
  });
1261
1261
  continue;
1262
1262
  }
1263
- const { startIndex: a, endIndex: v, nodeType: g, token: p } = d;
1264
- let S = "";
1265
- if (g === z.REFERENCE) {
1263
+ const { startIndex: a, endIndex: v, nodeType: m, token: p } = d;
1264
+ let C = "";
1265
+ if (m === X.REFERENCE) {
1266
1266
  if (f.has(p))
1267
- S = f.get(p);
1267
+ C = f.get(p);
1268
1268
  else {
1269
1269
  const _ = h % o.length;
1270
- S = o[_], f.set(p, S), h++;
1270
+ C = o[_], f.set(p, C), h++;
1271
1271
  }
1272
1272
  l.push({
1273
- refIndex: m,
1274
- themeColor: S,
1273
+ refIndex: g,
1274
+ themeColor: C,
1275
1275
  token: p,
1276
1276
  startIndex: d.startIndex,
1277
1277
  endIndex: d.endIndex,
1278
1278
  index: l.length
1279
1279
  });
1280
- } else g === z.NUMBER ? S = r : (g === z.STRING || g === z.ARRAY) && (S = s);
1281
- S && S.length > 0 ? i.push({
1280
+ } else m === X.NUMBER ? C = r : (m === X.STRING || m === X.ARRAY) && (C = s);
1281
+ C && C.length > 0 ? i.push({
1282
1282
  st: a,
1283
1283
  ed: v + 1,
1284
1284
  ts: {
1285
1285
  cl: {
1286
- rgb: S
1286
+ rgb: C
1287
1287
  },
1288
1288
  fs: 11
1289
1289
  }
@@ -1301,49 +1301,49 @@ function ci(e, t, n) {
1301
1301
  return { textRuns: i, refSelections: l };
1302
1302
  }
1303
1303
  const ai = (e, t, n, o) => {
1304
- const r = T(de), s = T(jt), c = G(t);
1304
+ const r = T(fe), s = T(Gt), c = z(t);
1305
1305
  c.current = t;
1306
- const i = G(o);
1306
+ const i = z(o);
1307
1307
  i.current = o, $(() => {
1308
1308
  if (!n || !e)
1309
1309
  return;
1310
- const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new He(), m = (a, v) => {
1310
+ const f = `sheet.formula-embedding-editor.${n.getEditorId()}`, h = new We(), g = (a, v) => {
1311
1311
  if (i.current) {
1312
1312
  i.current(a, v);
1313
1313
  return;
1314
1314
  }
1315
- let g = ae.LEFT;
1316
- a === L.ARROW_DOWN ? g = ae.DOWN : a === L.ARROW_UP ? g = ae.UP : a === L.ARROW_RIGHT && (g = ae.RIGHT), v === P.SHIFT ? r.executeCommand(qo.id, {
1317
- direction: g
1315
+ let m = le.LEFT;
1316
+ a === L.ARROW_DOWN ? m = le.DOWN : a === L.ARROW_UP ? m = le.UP : a === L.ARROW_RIGHT && (m = le.RIGHT), v === P.SHIFT ? r.executeCommand(qo.id, {
1317
+ direction: m
1318
1318
  }) : r.executeCommand(Ko.id, {
1319
- direction: g
1319
+ direction: m
1320
1320
  });
1321
1321
  }, u = (a, v) => {
1322
- let g = ae.DOWN;
1323
- a === L.ARROW_DOWN ? g = ae.DOWN : a === L.ARROW_UP ? g = ae.UP : a === L.ARROW_LEFT ? g = ae.LEFT : a === L.ARROW_RIGHT && (g = ae.RIGHT), c.current ? v === P.CTRL_COMMAND ? r.executeCommand(On.id, {
1324
- direction: g,
1325
- jumpOver: Nn.moveGap,
1322
+ let m = le.DOWN;
1323
+ a === L.ARROW_DOWN ? m = le.DOWN : a === L.ARROW_UP ? m = le.UP : a === L.ARROW_LEFT ? m = le.LEFT : a === L.ARROW_RIGHT && (m = le.RIGHT), c.current ? v === P.CTRL_COMMAND ? r.executeCommand(kn.id, {
1324
+ direction: m,
1325
+ jumpOver: An.moveGap,
1326
1326
  extra: "formula-editor",
1327
- fromCurrentSelection: c.current === Ae.NEED_ADD || c.current === Ae.EDIT_OTHER_SHEET_REFERENCE
1328
- }) : v === P.SHIFT ? r.executeCommand(Mn.id, {
1329
- direction: g,
1327
+ fromCurrentSelection: c.current === Fe.NEED_ADD || c.current === Fe.EDIT_OTHER_SHEET_REFERENCE
1328
+ }) : v === P.SHIFT ? r.executeCommand(Fn.id, {
1329
+ direction: m,
1330
1330
  extra: "formula-editor"
1331
- }) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(Mn.id, {
1332
- direction: g,
1333
- jumpOver: Nn.moveGap,
1331
+ }) : v === (P.CTRL_COMMAND | P.SHIFT) ? r.executeCommand(Fn.id, {
1332
+ direction: m,
1333
+ jumpOver: An.moveGap,
1334
1334
  extra: "formula-editor"
1335
- }) : r.executeCommand(On.id, {
1336
- direction: g,
1335
+ }) : r.executeCommand(kn.id, {
1336
+ direction: m,
1337
1337
  extra: "formula-editor",
1338
- fromCurrentSelection: c.current === Ae.NEED_ADD || c.current === Ae.EDIT_OTHER_SHEET_REFERENCE
1339
- }) : m(a, v);
1338
+ fromCurrentSelection: c.current === Fe.NEED_ADD || c.current === Fe.EDIT_OTHER_SHEET_REFERENCE
1339
+ }) : g(a, v);
1340
1340
  };
1341
1341
  return h.add(r.registerCommand({
1342
1342
  id: f,
1343
1343
  type: Te.OPERATION,
1344
1344
  handler(a, v) {
1345
- const { keyCode: g, metaKey: p } = v;
1346
- u(g, p);
1345
+ const { keyCode: m, metaKey: p } = v;
1346
+ u(m, p);
1347
1347
  }
1348
1348
  })), [
1349
1349
  { keyCode: L.ARROW_DOWN },
@@ -1380,42 +1380,42 @@ const ai = (e, t, n, o) => {
1380
1380
  }, [r, n, e, s]);
1381
1381
  }, li = (e, t, n, o = !0) => {
1382
1382
  var u;
1383
- const r = T(Oe), s = T(on), c = T(ls), i = T(Ht), l = T(ee), f = ge(ne(() => l.getCurrentTypeOfUnit$(j.UNIVER_SHEET), [l])), h = r.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), m = h == null ? void 0 : h.with(De);
1384
- At(() => {
1383
+ const r = T(Oe), s = T(an), c = T(ls), i = T(Kt), l = T(te), f = ve(ne(() => l.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [l])), h = r.getRenderById((u = f == null ? void 0 : f.getUnitId()) != null ? u : ""), g = h == null ? void 0 : h.with(Le);
1384
+ $t(() => {
1385
1385
  if (e)
1386
- return s.setContextValue(xt, !0), () => {
1387
- s.setContextValue(xt, !1), i.clear();
1386
+ return s.setContextValue(wt, !0), () => {
1387
+ s.setContextValue(wt, !1), i.clear();
1388
1388
  };
1389
- }, [s, e, i]), At(() => {
1389
+ }, [s, e, i]), $t(() => {
1390
1390
  if (e && t) {
1391
- const d = m == null ? void 0 : m.enableSelectionChanging();
1392
- return s.setContextValue(Ln, !0), () => {
1393
- s.setContextValue(Ln, !1), d == null || d.dispose();
1391
+ const d = g == null ? void 0 : g.enableSelectionChanging();
1392
+ return s.setContextValue(Vn, !0), () => {
1393
+ s.setContextValue(Vn, !1), d == null || d.dispose();
1394
1394
  };
1395
1395
  }
1396
- }, [s, e, m, t]), $(() => {
1396
+ }, [s, e, g, t]), $(() => {
1397
1397
  if (e)
1398
- return s.setContextValue(xt, !0), o && c.disable(), () => {
1399
- s.setContextValue(xt, !1), o && c.enable();
1398
+ return s.setContextValue(wt, !0), o && c.disable(), () => {
1399
+ s.setContextValue(wt, !1), o && c.enable();
1400
1400
  };
1401
1401
  }, [c, s, e, o]), $(() => {
1402
- e && (m == null || m.setSkipLastEnabled(!1));
1403
- }, [e, m]);
1402
+ e && (g == null || g.setSkipLastEnabled(!1));
1403
+ }, [e, g]);
1404
1404
  }, ui = (e, t, n) => {
1405
- const o = T(ee), r = T(un);
1406
- return kt(() => {
1405
+ const o = T(te), r = T(fn);
1406
+ return Lt(() => {
1407
1407
  if (e) {
1408
- const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(j.UNIVER_SHEET), l = i == null ? void 0 : i.getActiveSheet();
1408
+ const c = [...r.getWorkbookSelections(t).getSelectionsOfWorksheet(n)], i = o.getCurrentUnitForType(q.UNIVER_SHEET), l = i == null ? void 0 : i.getActiveSheet();
1409
1409
  (i == null ? void 0 : i.getUnitId()) !== t && o.setCurrentUnitForType(t), l && l.getSheetId() === n && r.setSelections(c);
1410
1410
  }
1411
1411
  }, [e, r, n, t, o]);
1412
- }, di = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), nn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), Ot = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Ce(r.range)) : e.map((r) => o ? wo(r) : r.sheetName !== "" && r.sheetName !== n ? St(r.sheetName, r.range) : Ce(r.range)), hi = (e) => {
1413
- var h, m, u;
1412
+ }, di = (e) => e.reduce((t, n) => typeof n == "string" ? t + n.length : t + n.token.length, 0), sn = (e) => e.map((t) => typeof t == "string" ? t : t.token).join(""), kt = (e, t = !1, n = "", o = !1) => !t && !o ? e.map((r) => Re(r.range)) : e.map((r) => o ? wo(r) : r.sheetName !== "" && r.sheetName !== n ? Ct(r.sheetName, r.range) : Re(r.range)), hi = (e) => {
1413
+ var h, g, u;
1414
1414
  const { editor: t, lexerTreeBuilder: n } = e, o = t == null ? void 0 : t.getSelectionRanges();
1415
1415
  if ((o == null ? void 0 : o.length) !== 1)
1416
1416
  return;
1417
- const s = o[0].startOffset - 1, c = ((m = (h = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : h.dataStream) != null ? m : `\r
1418
- `).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [], l = Sn(i, s, !1), f = mr(i, l);
1417
+ const s = o[0].startOffset - 1, c = ((g = (h = t == null ? void 0 : t.getDocumentData().body) == null ? void 0 : h.dataStream) != null ? g : `\r
1418
+ `).slice(0, -2), i = (u = n.sequenceNodesBuilder(c.slice(1))) != null ? u : [], l = Rn(i, s, !1), f = Cr(i, l);
1419
1419
  return {
1420
1420
  nodeIndex: l,
1421
1421
  updatingRefIndex: f,
@@ -1424,162 +1424,162 @@ const ai = (e, t, n, o) => {
1424
1424
  };
1425
1425
  }, fi = () => {
1426
1426
  }, gi = (e, t, n, o, r, s, c, i, l, f = fi) => {
1427
- var w;
1428
- const h = T(Oe), m = T(ee), u = T(de), d = T(dr), a = T(Rt), v = T(_e), g = m.getUnit(o), p = J((M) => {
1429
- var b, E;
1430
- return (E = (b = g == null ? void 0 : g.getSheetBySheetId(M)) == null ? void 0 : b.getName()) != null ? E : "";
1431
- }), S = ne(() => p(r), [p, r]), _ = ge(g == null ? void 0 : g.activeSheet$), R = Je({ activeSheet: _, sheetName: S }), C = ge(ne(() => m.getCurrentTypeOfUnit$(j.UNIVER_SHEET), [m])), y = h.getRenderById((w = C == null ? void 0 : C.getUnitId()) != null ? w : ""), N = y == null ? void 0 : y.with(De), A = y == null ? void 0 : y.with(Wt), F = T(Ht), x = J((M, b) => {
1432
- var H, ie, K, Re, et, oe;
1433
- const E = hi({ editor: l, lexerTreeBuilder: v });
1434
- if (!E) return;
1435
- const { nodeIndex: I, updatingRefIndex: k, sequenceNodes: D, offset: U } = E;
1436
- if (n.current === Ae.NEED_ADD)
1427
+ var k;
1428
+ const h = T(Oe), g = T(te), u = T(fe), d = T(mr), a = T(It), v = T(Ie), m = g.getUnit(o), p = J((w, b) => {
1429
+ var I, E, M;
1430
+ return (M = (E = (I = g.getUnit(w)) == null ? void 0 : I.getSheetBySheetId(b)) == null ? void 0 : E.getName()) != null ? M : "";
1431
+ }), C = ne(() => p(o, r), [p, r, o]), _ = ve(m == null ? void 0 : m.activeSheet$), R = Qe({ activeSheet: _, sheetName: C }), S = ve(ne(() => g.getCurrentTypeOfUnit$(q.UNIVER_SHEET), [g])), y = h.getRenderById((k = S == null ? void 0 : S.getUnitId()) != null ? k : ""), N = y == null ? void 0 : y.with(Le), A = y == null ? void 0 : y.with(qt), F = T(Kt), x = J((w, b) => {
1432
+ var H, ce, Y, Ee, Je, oe, yt, ht, Tt;
1433
+ const I = hi({ editor: l, lexerTreeBuilder: v });
1434
+ if (!I) return;
1435
+ const { nodeIndex: E, updatingRefIndex: M, sequenceNodes: D, offset: U } = I;
1436
+ if (n.current === Fe.NEED_ADD)
1437
1437
  if (U !== 0) {
1438
- if (I === -1 && D.length)
1438
+ if (E === -1 && D.length)
1439
1439
  return;
1440
- const X = M[M.length - 1], Q = D.splice(I + 1), me = (H = X.sheetId) != null ? H : r, te = {
1441
- range: X,
1442
- unitId: (ie = X.unitId) != null ? ie : C.getUnitId(),
1443
- sheetName: p(me)
1444
- }, pe = me !== r, le = (C == null ? void 0 : C.getUnitId()) !== o, tt = Ot([te], c && (pe || le), S, le);
1445
- D.push({ token: tt[0], nodeType: z.REFERENCE });
1446
- const Le = [...D, ...Q], he = nn(Le);
1447
- f(he, di(D), b);
1440
+ const B = w[w.length - 1], ee = D.splice(E + 1), ge = (H = B.sheetId) != null ? H : r, Se = {
1441
+ range: B,
1442
+ unitId: (ce = B.unitId) != null ? ce : S.getUnitId(),
1443
+ sheetName: p((Y = B.unitId) != null ? Y : S.getUnitId(), ge)
1444
+ }, ue = ge !== r, Q = (S == null ? void 0 : S.getUnitId()) !== o, Ce = kt([Se], c && (ue || Q), C, Q);
1445
+ D.push({ token: Ce[0], nodeType: X.REFERENCE });
1446
+ const ft = [...D, ...ee], Me = sn(ft);
1447
+ f(Me, di(D), b);
1448
1448
  } else {
1449
- const X = M[M.length - 1], Q = (K = X.sheetId) != null ? K : r, me = {
1450
- range: X,
1451
- unitId: (Re = X.unitId) != null ? Re : o,
1452
- sheetName: p(Q)
1453
- }, pe = Ot([me], c && Q !== r);
1454
- D.unshift({ token: pe[0], nodeType: z.REFERENCE });
1455
- const le = nn(D);
1456
- f(le, pe[0].length, b);
1449
+ const B = w[w.length - 1], ee = (Ee = B.sheetId) != null ? Ee : r, ge = {
1450
+ range: B,
1451
+ unitId: (Je = B.unitId) != null ? Je : S.getUnitId(),
1452
+ sheetName: p((oe = B.unitId) != null ? oe : S.getUnitId(), ee)
1453
+ }, Se = ee !== r, ue = (S == null ? void 0 : S.getUnitId()) !== o, Q = kt([ge], c && (Se || ue), C, ue);
1454
+ D.unshift({ token: Q[0], nodeType: X.REFERENCE });
1455
+ const Ce = sn(D);
1456
+ f(Ce, Q[0].length, b);
1457
1457
  }
1458
- else if (n.current === Ae.EDIT_OTHER_SHEET_REFERENCE) {
1459
- const X = M.pop();
1460
- if (!X) return;
1461
- const Q = D[I];
1462
- if (typeof Q == "object" && Q.nodeType === z.REFERENCE) {
1463
- const me = Q.token;
1464
- Q.token = S === (_ == null ? void 0 : _.getName()) ? Ce(X) : St(_.getName(), X);
1465
- const te = U + (Q.token.length - me.length);
1466
- f(ko(D), te, b);
1458
+ else if (n.current === Fe.EDIT_OTHER_SHEET_REFERENCE) {
1459
+ const B = w.pop();
1460
+ if (!B) return;
1461
+ const ee = D[E];
1462
+ if (typeof ee == "object" && ee.nodeType === X.REFERENCE) {
1463
+ const ge = ee.token;
1464
+ ee.token = C === (_ == null ? void 0 : _.getName()) ? Re(B) : Ct(_.getName(), B);
1465
+ const Se = U + (ee.token.length - ge.length);
1466
+ f(ko(D), Se, b);
1467
1467
  }
1468
1468
  } else {
1469
- const X = [...M];
1470
- if (k !== -1) {
1471
- const Z = X.pop();
1472
- Z && X.splice(k, 0, Z);
1469
+ const B = [...w];
1470
+ if (M !== -1) {
1471
+ const G = B.pop();
1472
+ G && B.splice(M, 0, G);
1473
1473
  }
1474
- let Q = 0;
1475
- const me = D.map((Z) => {
1476
- var ve, Ee, Me;
1477
- if (typeof Z == "string")
1478
- return Z;
1479
- if (Z.nodeType === z.REFERENCE) {
1480
- const $e = dt(Z.token);
1481
- if ($e.sheetName || ($e.sheetName = S), c && ((ve = R.current.activeSheet) == null ? void 0 : ve.getName()) !== $e.sheetName)
1482
- return Z.token;
1483
- const Ie = X[Q];
1484
- if (Q++, !Ie)
1474
+ let ee = 0;
1475
+ const ge = D.map((G) => {
1476
+ var de, we, et, $e;
1477
+ if (typeof G == "string")
1478
+ return G;
1479
+ if (G.nodeType === X.REFERENCE) {
1480
+ const me = lt(G.token);
1481
+ if (me.sheetName || (me.sheetName = C), c && ((de = R.current.activeSheet) == null ? void 0 : de.getName()) !== me.sheetName)
1482
+ return G.token;
1483
+ const se = B[ee];
1484
+ if (ee++, !se)
1485
1485
  return "";
1486
- const Kt = (Ee = Ie.sheetId) != null ? Ee : r, Yt = {
1487
- range: Ie,
1488
- unitId: (Me = Ie.unitId) != null ? Me : o,
1489
- sheetName: p(Kt)
1490
- };
1491
- return Ot([Yt], c, S)[0];
1486
+ const gt = (we = se.sheetId) != null ? we : r, zt = {
1487
+ range: se,
1488
+ unitId: (et = se.unitId) != null ? et : S.getUnitId(),
1489
+ sheetName: p(($e = se.unitId) != null ? $e : S.getUnitId(), gt)
1490
+ }, xt = (S == null ? void 0 : S.getUnitId()) !== o;
1491
+ return kt([zt], c && (gt !== r || xt), C, xt)[0];
1492
1492
  }
1493
- return Z.token;
1493
+ return G.token;
1494
1494
  });
1495
- let te = "", pe;
1496
- me.forEach((Z, ve) => {
1497
- te += Z, ve === I && (pe = te.length);
1495
+ let Se = "", ue;
1496
+ ge.forEach((G, de) => {
1497
+ Se += G, de === E && (ue = Se.length);
1498
1498
  });
1499
- const le = [];
1500
- for (let Z = Q; Z <= M.length - 1; Z++) {
1501
- const ve = M[Z], Ee = (et = ve.sheetId) != null ? et : r, Me = {
1502
- range: ve,
1503
- unitId: (oe = ve.unitId) != null ? oe : o,
1504
- sheetName: p(Ee)
1505
- }, Ie = Ot([Me], c && Ee !== r, S);
1506
- le.push(Ie[0]);
1499
+ const Q = [];
1500
+ for (let G = ee; G <= w.length - 1; G++) {
1501
+ const de = w[G], we = (yt = de.sheetId) != null ? yt : r, et = {
1502
+ range: de,
1503
+ unitId: (ht = de.unitId) != null ? ht : S.getUnitId(),
1504
+ sheetName: p((Tt = de.unitId) != null ? Tt : S.getUnitId(), we)
1505
+ }, $e = (S == null ? void 0 : S.getUnitId()) !== o, se = kt([et], c && (we !== r || $e), C, $e);
1506
+ Q.push(se[0]);
1507
1507
  }
1508
- const tt = D[D.length - 1], Le = tt && (typeof tt == "string" ? !1 : tt.nodeType === z.REFERENCE), he = `${te}${le.length && Le ? "," : ""}${le.join(",")}`;
1509
- f(he, !le.length && pe ? pe : he.length, b);
1508
+ const Ce = D[D.length - 1], ft = Ce && (typeof Ce == "string" ? !1 : Ce.nodeType === X.REFERENCE), Me = `${Se}${Q.length && ft ? "," : ""}${Q.join(",")}`;
1509
+ f(Me, !Q.length && ue ? ue : Me.length, b);
1510
1510
  }
1511
1511
  });
1512
1512
  $(() => {
1513
1513
  if (N && e) {
1514
- let M = !0;
1515
- const b = (I, k) => {
1516
- if (M) {
1517
- M = !1;
1514
+ let w = !0;
1515
+ const b = (E, M) => {
1516
+ if (w) {
1517
+ w = !1;
1518
1518
  return;
1519
1519
  }
1520
- x(I.map((D) => D.rangeWithCoord), k);
1521
- }, E = new He();
1522
- return E.add(N.selectionMoving$.subscribe((I) => {
1523
- b(I, !1);
1524
- })), E.add(N.selectionMoveEnd$.subscribe((I) => {
1525
- b(I, !0);
1520
+ x(E.map((D) => D.rangeWithCoord), M);
1521
+ }, I = new We();
1522
+ return I.add(N.selectionMoving$.subscribe((E) => {
1523
+ b(E, !1);
1524
+ })), I.add(N.selectionMoveEnd$.subscribe((E) => {
1525
+ b(E, !0);
1526
1526
  })), () => {
1527
- E.dispose();
1527
+ I.dispose();
1528
1528
  };
1529
1529
  }
1530
1530
  }, [e, x, N]), $(() => {
1531
1531
  if (t && N && l) {
1532
- const M = new He(), b = () => {
1533
- M.dispose(), N.getSelectionControls().forEach((k, D) => {
1534
- M.add(
1535
- k.selectionScaling$.subscribe((U) => {
1536
- const H = N.getSelectionDataWithStyle().map((K) => K.rangeWithCoord), ie = H[D];
1537
- U.sheetId = ie.sheetId, U.unitId = ie.unitId, H[D] = U, x(H, !1);
1532
+ const w = new We(), b = () => {
1533
+ w.dispose(), N.getSelectionControls().forEach((M, D) => {
1534
+ w.add(
1535
+ M.selectionScaling$.subscribe((U) => {
1536
+ const H = N.getSelectionDataWithStyle().map((Y) => Y.rangeWithCoord), ce = H[D];
1537
+ U.sheetId = ce.sheetId, U.unitId = ce.unitId, H[D] = U, x(H, !1);
1538
1538
  })
1539
- ), M.add(
1540
- k.selectionMoving$.subscribe((U) => {
1541
- const H = N.getSelectionDataWithStyle().map((K) => K.rangeWithCoord), ie = H[D];
1542
- U.sheetId = ie.sheetId, U.unitId = ie.unitId, H[D] = U, x(H, !0);
1539
+ ), w.add(
1540
+ M.selectionMoving$.subscribe((U) => {
1541
+ const H = N.getSelectionDataWithStyle().map((Y) => Y.rangeWithCoord), ce = H[D];
1542
+ U.sheetId = ce.sheetId, U.unitId = ce.unitId, H[D] = U, x(H, !0);
1543
1543
  })
1544
1544
  );
1545
1545
  });
1546
- }, E = Wo(
1546
+ }, I = Wo(
1547
1547
  l.input$,
1548
1548
  F.selectionSet$,
1549
1549
  N.selectionMoveEnd$
1550
1550
  ).pipe(
1551
- Es(50)
1551
+ Is(50)
1552
1552
  ).subscribe(() => {
1553
1553
  b();
1554
1554
  });
1555
1555
  return () => {
1556
- E.unsubscribe(), M.dispose();
1556
+ I.unsubscribe(), w.dispose();
1557
1557
  };
1558
1558
  }
1559
1559
  }, [l, t, x, N, F.selectionSet$]), N == null || N.getSelectionDataWithStyle(), $(() => {
1560
1560
  if (i) {
1561
- const M = u.onCommandExecuted((b) => {
1562
- var I;
1563
- if (b.id !== dn.id)
1561
+ const w = u.onCommandExecuted((b) => {
1562
+ var E;
1563
+ if (b.id !== gn.id)
1564
1564
  return;
1565
- const E = b.params;
1566
- if (E.extra === "formula-editor" && E.selections.length) {
1567
- const k = E.selections[E.selections.length - 1];
1568
- if (k) {
1569
- const D = n.current === Ae.NEED_ADD, U = ((I = N == null ? void 0 : N.getSelectionDataWithStyle()) != null ? I : []).map((H) => H.rangeWithCoord);
1570
- D ? U.push(k.range) : U[U.length - 1] = k.range, x(U, !0);
1565
+ const I = b.params;
1566
+ if (I.extra === "formula-editor" && I.selections.length) {
1567
+ const M = I.selections[I.selections.length - 1];
1568
+ if (M) {
1569
+ const D = n.current === Fe.NEED_ADD, U = ((E = N == null ? void 0 : N.getSelectionDataWithStyle()) != null ? E : []).map((H) => H.rangeWithCoord);
1570
+ D ? U.push(M.range) : U[U.length - 1] = M.range, x(U, !0);
1571
1571
  }
1572
1572
  }
1573
1573
  });
1574
1574
  return () => {
1575
- M.dispose();
1575
+ w.dispose();
1576
1576
  };
1577
1577
  }
1578
1578
  }, [u, l, n, v, i, x, N]), $(() => {
1579
1579
  if (!l)
1580
1580
  return;
1581
- const M = d.textSelection$.subscribe((b) => {
1582
- b.unitId === l.getEditorId() && yr({
1581
+ const w = d.textSelection$.subscribe((b) => {
1582
+ b.unitId === l.getEditorId() && Nr({
1583
1583
  unitId: o,
1584
1584
  subUnitId: r,
1585
1585
  refSelections: s.current,
@@ -1588,27 +1588,27 @@ const ai = (e, t, n, o) => {
1588
1588
  refSelectionsRenderService: N,
1589
1589
  sheetSkeletonManagerService: A,
1590
1590
  themeService: a,
1591
- univerInstanceService: m,
1592
- currentWorkbook: C
1591
+ univerInstanceService: g,
1592
+ currentWorkbook: S
1593
1593
  });
1594
1594
  });
1595
- return () => M.unsubscribe();
1596
- }, [d.textSelection$, l, s, N, F, A, r, a, o, m]);
1595
+ return () => w.unsubscribe();
1596
+ }, [d.textSelection$, l, s, N, F, A, r, a, o, g]);
1597
1597
  }, mi = (e, t, n, o, r, s) => {
1598
- const c = T(de), i = T(qe), f = T(Oe).getRenderById(t), h = T(ee), m = f == null ? void 0 : f.with(De);
1598
+ const c = T(fe), i = T(je), f = T(Oe).getRenderById(t), h = T(te), g = f == null ? void 0 : f.with(Le);
1599
1599
  $(() => {
1600
- if (e && m)
1600
+ if (e && g)
1601
1601
  if (n) {
1602
1602
  const u = () => {
1603
- const v = m.getSelectionControls().length;
1604
- for (let g = 1; g <= v; g++)
1605
- m.clearLastSelection();
1603
+ const v = g.getSelectionControls().length;
1604
+ for (let m = 1; m <= v; m++)
1605
+ g.clearLastSelection();
1606
1606
  return setTimeout(() => {
1607
1607
  s();
1608
1608
  }, 30);
1609
1609
  }, d = c.onCommandExecuted((v) => {
1610
- v.id === $n.id && u();
1611
- }), a = h.getCurrentTypeOfUnit$(j.UNIVER_SHEET).subscribe((v) => {
1610
+ v.id === Wn.id && u();
1611
+ }), a = h.getCurrentTypeOfUnit$(q.UNIVER_SHEET).subscribe((v) => {
1612
1612
  u();
1613
1613
  });
1614
1614
  return () => {
@@ -1616,9 +1616,9 @@ const ai = (e, t, n, o) => {
1616
1616
  };
1617
1617
  } else {
1618
1618
  const u = c.beforeCommandExecuted((d) => {
1619
- if (d.id === $n.id) {
1619
+ if (d.id === Wn.id) {
1620
1620
  o(!1), r(), s();
1621
- const a = i.getEditor(sn);
1621
+ const a = i.getEditor(ln);
1622
1622
  a == null || a.focus();
1623
1623
  }
1624
1624
  });
@@ -1626,9 +1626,9 @@ const ai = (e, t, n, o) => {
1626
1626
  u.dispose();
1627
1627
  };
1628
1628
  }
1629
- }, [e, m]);
1629
+ }, [e, g]);
1630
1630
  }, pi = (e, t, n) => {
1631
- const o = T(_e), r = G(!0);
1631
+ const o = T(Ie), r = z(!0);
1632
1632
  $(() => {
1633
1633
  if (e) {
1634
1634
  const s = setTimeout(() => {
@@ -1641,27 +1641,27 @@ const ai = (e, t, n, o) => {
1641
1641
  }, [e]), $(() => {
1642
1642
  if (!r.current && t) {
1643
1643
  const s = o.checkIfAddBracket(n);
1644
- t(s === 0 && n.startsWith(nr.EQUALS), `${n}`);
1644
+ t(s === 0 && n.startsWith(ir.EQUALS), `${n}`);
1645
1645
  }
1646
1646
  }, [n, t]);
1647
1647
  }, vi = (e, t = [], n) => {
1648
- const o = T(Bt), [r, s] = V([]), [c, i] = V(""), l = G(-1), f = Je({ nodes: t }), h = () => {
1648
+ const o = T(Yt), [r, s] = V([]), [c, i] = V(""), l = z(-1), f = Qe({ nodes: t }), h = () => {
1649
1649
  s([]), i(""), l.current = -1;
1650
1650
  };
1651
1651
  return $(() => {
1652
1652
  if (n && e) {
1653
- const u = n.input$.pipe(ln(300)).subscribe(() => {
1653
+ const u = n.input$.pipe(hn(300)).subscribe(() => {
1654
1654
  const d = n.getSelectionRanges();
1655
1655
  if (d.length === 1) {
1656
1656
  const a = f.current.nodes, v = d[0];
1657
1657
  if (v.collapsed) {
1658
- const g = Sn(a, v.startOffset - 1, !1);
1659
- l.current = g;
1660
- const p = a[g];
1661
- if (p && typeof p != "string" && p.nodeType === z.FUNCTION) {
1662
- l.current = g;
1663
- const S = p.token, _ = o.getSearchListByNameFirstLetter(S);
1664
- s(_), i(S);
1658
+ const m = Rn(a, v.startOffset - 1, !1);
1659
+ l.current = m;
1660
+ const p = a[m];
1661
+ if (p && typeof p != "string" && p.nodeType === X.FUNCTION) {
1662
+ l.current = m;
1663
+ const C = p.token, _ = o.getSearchListByNameFirstLetter(C);
1664
+ s(_), i(C);
1665
1665
  return;
1666
1666
  }
1667
1667
  }
@@ -1681,8 +1681,8 @@ const ai = (e, t, n, o) => {
1681
1681
  const d = [...f.current.nodes];
1682
1682
  if (l.current !== -1) {
1683
1683
  const a = d.splice(l.current + 1), v = d.pop() || "";
1684
- let g = (typeof v == "string" ? v.length : v.token.length) - u.length;
1685
- return d.push(u), a[0] !== ct.OPEN_BRACKET && (d.push(ct.OPEN_BRACKET), g--), { text: nn([...d, ...a]), offset: g };
1684
+ let m = (typeof v == "string" ? v.length : v.token.length) - u.length;
1685
+ return d.push(u), a[0] !== st.OPEN_BRACKET && (d.push(st.OPEN_BRACKET), m--), { text: sn([...d, ...a]), offset: m };
1686
1686
  }
1687
1687
  },
1688
1688
  reset: h
@@ -1690,40 +1690,40 @@ const ai = (e, t, n, o) => {
1690
1690
  }, Si = () => {
1691
1691
  }, Ci = Ne(_i);
1692
1692
  function _i(e, t) {
1693
- const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = Si } = e, i = s.getEditorId(), l = T(jt), f = T(de), { searchList: h, searchText: m, handlerFormulaReplace: u, reset: d } = vi(n, o, s), a = ne(() => !!h.length, [h]), v = G(void 0), [g, p] = V(0), S = G(!1), [_] = br(i, a, [m, h]), R = Je({ searchList: h, active: g }), C = (x) => {
1694
- const w = u(x);
1695
- w && (d(), r(w));
1693
+ const { isFocus: n, sequenceNodes: o, onSelect: r, editor: s, onClose: c = Si } = e, i = s.getEditorId(), l = T(Gt), f = T(fe), { searchList: h, searchText: g, handlerFormulaReplace: u, reset: d } = vi(n, o, s), a = ne(() => !!h.length, [h]), v = z(void 0), [m, p] = V(0), C = z(!1), [_] = Or(i, a, [g, h]), R = Qe({ searchList: h, active: m }), S = (x) => {
1694
+ const k = u(x);
1695
+ k && (d(), r(k));
1696
1696
  };
1697
1697
  function y(x) {
1698
- S.current && p(x);
1698
+ C.current && p(x);
1699
1699
  }
1700
1700
  function N() {
1701
- S.current && p(-1);
1701
+ C.current && p(-1);
1702
1702
  }
1703
1703
  $(() => {
1704
1704
  if (!h.length)
1705
1705
  return;
1706
- const x = `sheet.formula-embedding-editor.search_function.${i}`, w = new He(), M = (b) => {
1707
- const { searchList: E, active: I } = R.current;
1706
+ const x = `sheet.formula-embedding-editor.search_function.${i}`, k = new We(), w = (b) => {
1707
+ const { searchList: I, active: E } = R.current;
1708
1708
  switch (b) {
1709
1709
  case L.ARROW_UP: {
1710
- p((k) => {
1711
- const D = Math.max(0, k - 1);
1710
+ p((M) => {
1711
+ const D = Math.max(0, M - 1);
1712
1712
  return A(D), D;
1713
1713
  });
1714
1714
  break;
1715
1715
  }
1716
1716
  case L.ARROW_DOWN: {
1717
- p((k) => {
1718
- const D = Math.min(E.length - 1, k + 1);
1717
+ p((M) => {
1718
+ const D = Math.min(I.length - 1, M + 1);
1719
1719
  return A(D), D;
1720
1720
  });
1721
1721
  break;
1722
1722
  }
1723
1723
  case L.TAB:
1724
1724
  case L.ENTER: {
1725
- const k = E[I];
1726
- C(k.name);
1725
+ const M = I[E];
1726
+ S(M.name);
1727
1727
  break;
1728
1728
  }
1729
1729
  case L.ESC: {
@@ -1732,12 +1732,12 @@ function _i(e, t) {
1732
1732
  }
1733
1733
  }
1734
1734
  };
1735
- return w.add(f.registerCommand({
1735
+ return k.add(f.registerCommand({
1736
1736
  id: x,
1737
1737
  type: Te.OPERATION,
1738
- handler(b, E) {
1739
- const { keyCode: I } = E;
1740
- M(I);
1738
+ handler(b, I) {
1739
+ const { keyCode: E } = I;
1740
+ w(E);
1741
1741
  }
1742
1742
  })), [L.ARROW_UP, L.ARROW_DOWN, L.ENTER, L.ESC, L.TAB].map((b) => ({
1743
1743
  id: x,
@@ -1749,21 +1749,21 @@ function _i(e, t) {
1749
1749
  keyCode: b
1750
1750
  }
1751
1751
  })).forEach((b) => {
1752
- w.add(l.registerShortcut(b));
1752
+ k.add(l.registerShortcut(b));
1753
1753
  }), () => {
1754
- w.dispose();
1754
+ k.dispose();
1755
1755
  };
1756
1756
  }, [h]);
1757
1757
  function A(x) {
1758
- const w = v.current;
1758
+ const k = v.current;
1759
+ if (!k) return;
1760
+ const w = k.children[x];
1759
1761
  if (!w) return;
1760
- const M = w.children[x];
1761
- if (!M) return;
1762
- const E = w.getBoundingClientRect().top, I = w.offsetHeight, k = M.getBoundingClientRect(), D = k.top, U = k.height;
1763
- if (D >= 0 && D > E && D - E + U <= I)
1762
+ const I = k.getBoundingClientRect().top, E = k.offsetHeight, M = w.getBoundingClientRect(), D = M.top, U = M.height;
1763
+ if (D >= 0 && D > I && D - I + U <= E)
1764
1764
  return;
1765
- const H = M.offsetTop - (I - U) / 2;
1766
- w.scrollTo({
1765
+ const H = w.offsetTop - (E - U) / 2;
1766
+ k.scrollTo({
1767
1767
  top: H,
1768
1768
  behavior: "smooth"
1769
1769
  });
@@ -1771,35 +1771,35 @@ function _i(e, t) {
1771
1771
  const F = ne(() => {
1772
1772
  let x = "";
1773
1773
  return () => {
1774
- clearTimeout(x), S.current = !0, x = setTimeout(() => {
1775
- S.current = !1;
1774
+ clearTimeout(x), C.current = !0, x = setTimeout(() => {
1775
+ C.current = !1;
1776
1776
  }, 300);
1777
1777
  };
1778
1778
  }, []);
1779
- return h.length > 0 && a && /* @__PURE__ */ O(en, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ O(
1779
+ return h.length > 0 && a && /* @__PURE__ */ O(rn, { portal: !0, anchorRect$: _, direction: "vertical", children: /* @__PURE__ */ O(
1780
1780
  "ul",
1781
1781
  {
1782
1782
  ref: (x) => {
1783
1783
  v.current = x, t && (t.current = x);
1784
1784
  },
1785
1785
  "data-u-comp": "sheets-formula-editor",
1786
- className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", gn, at),
1787
- children: h.map((x, w) => /* @__PURE__ */ W(
1786
+ className: re("univer-m-0 univer-box-border univer-max-h-[400px] univer-w-[250px] univer-list-none univer-overflow-y-auto univer-rounded-lg univer-bg-white univer-p-2 univer-leading-5 univer-shadow-md univer-outline-none dark:!univer-bg-gray-900", vn, it),
1787
+ children: h.map((x, k) => /* @__PURE__ */ W(
1788
1788
  "li",
1789
1789
  {
1790
1790
  className: re("univer-box-border univer-cursor-pointer univer-rounded univer-px-2 univer-py-1 univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
1791
- "univer-bg-gray-200 dark:!univer-bg-gray-600": g === w
1791
+ "univer-bg-gray-200 dark:!univer-bg-gray-600": m === k
1792
1792
  }),
1793
- onMouseEnter: () => y(w),
1793
+ onMouseEnter: () => y(k),
1794
1794
  onMouseLeave: N,
1795
1795
  onMouseMove: F,
1796
1796
  onClick: () => {
1797
- C(x.name), s && s.focus();
1797
+ S(x.name), s && s.focus();
1798
1798
  },
1799
1799
  children: [
1800
1800
  /* @__PURE__ */ W("span", { className: "univer-text-xs", children: [
1801
- /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: x.name.substring(0, m.length) }),
1802
- /* @__PURE__ */ O("span", { children: x.name.slice(m.length) })
1801
+ /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: x.name.substring(0, g.length) }),
1802
+ /* @__PURE__ */ O("span", { children: x.name.slice(g.length) })
1803
1803
  ] }),
1804
1804
  /* @__PURE__ */ O(
1805
1805
  "span",
@@ -1815,9 +1815,9 @@ function _i(e, t) {
1815
1815
  }
1816
1816
  ) });
1817
1817
  }
1818
- const Ri = (e) => e.startsWith(nr.EQUALS) ? e.slice(1) : "", Bn = () => {
1819
- }, Ei = Ne((e, t) => {
1820
- var _n, Rn;
1818
+ const Ri = (e) => e.startsWith(ir.EQUALS) ? e.slice(1) : "", Yn = () => {
1819
+ }, Ii = Ne((e, t) => {
1820
+ var bn, yn;
1821
1821
  const {
1822
1822
  errorText: n,
1823
1823
  initValue: o,
@@ -1825,70 +1825,70 @@ const Ri = (e) => e.startsWith(nr.EQUALS) ? e.slice(1) : "", Bn = () => {
1825
1825
  subUnitId: s,
1826
1826
  isFocus: c = !0,
1827
1827
  isSupportAcrossSheet: i = !1,
1828
- onFocus: l = Bn,
1829
- onBlur: f = Bn,
1828
+ onFocus: l = Yn,
1829
+ onBlur: f = Yn,
1830
1830
  onChange: h,
1831
- onVerify: m,
1831
+ onVerify: g,
1832
1832
  className: u,
1833
1833
  editorId: d,
1834
1834
  moveCursor: a = !0,
1835
1835
  onFormulaSelectingChange: v,
1836
- keyboardEventConfig: g,
1836
+ keyboardEventConfig: m,
1837
1837
  onMoveInEditor: p,
1838
- resetSelectionOnBlur: S = !0,
1838
+ resetSelectionOnBlur: C = !0,
1839
1839
  autoScrollbar: _ = !0,
1840
1840
  isSingle: R = !0,
1841
- disableSelectionOnClick: C = !1,
1841
+ disableSelectionOnClick: S = !1,
1842
1842
  autofocus: y = !0,
1843
1843
  disableContextMenu: N,
1844
1844
  style: A
1845
- } = e, F = T(qe), x = G(null), w = J(h);
1845
+ } = e, F = T(je), x = z(null), k = J(h);
1846
1846
  Rs(t, () => ({
1847
- isClickOutSide: (Y) => x.current ? !x.current.contains(Y.target) : !1
1847
+ isClickOutSide: (Z) => x.current ? !x.current.contains(Z.target) : !1
1848
1848
  }));
1849
- const M = J(v), b = G(null), E = G(void 0), I = E.current, [k, D] = V(c), U = G(null), H = ne(() => d != null ? d : qr(`${fo}-${Kr(4)}`), []), ie = ne(() => n !== void 0, [n]), K = T(ee), Re = K.getUnit(H);
1850
- ge(Re == null ? void 0 : Re.change$);
1851
- const et = ri(), oe = Yr.transform.getPlainText((Rn = (_n = Re == null ? void 0 : Re.getBody()) == null ? void 0 : _n.dataStream) != null ? Rn : ""), X = Je(oe), Q = ne(() => Ri(oe), [oe]), me = ne(() => et(Q), [Q, et]), { isSelecting: te, isSelectingRef: pe } = ni({ unitId: r, subUnitId: s, editorId: H, isFocus: k, disableOnClick: C }), le = G(""), Le = T(Oe).getRenderById(H), he = Le == null ? void 0 : Le.with(sr), Z = he == null ? void 0 : he.isFocusing, ve = ne(() => K.getCurrentTypeOfUnit$(j.UNIVER_DOC), [K]), Ee = ge(ve), Me = (Ee == null ? void 0 : Ee.getUnitId()) === H, $e = G([]), Ie = te;
1849
+ const w = J(v), b = z(null), I = z(void 0), E = I.current, [M, D] = V(c), U = z(null), H = ne(() => d != null ? d : qr(`${fo}-${Kr(4)}`), []), ce = ne(() => n !== void 0, [n]), Y = T(te), Ee = Y.getUnit(H);
1850
+ ve(Ee == null ? void 0 : Ee.change$);
1851
+ const Je = ri(), oe = Yr.transform.getPlainText((yn = (bn = Ee == null ? void 0 : Ee.getBody()) == null ? void 0 : bn.dataStream) != null ? yn : ""), yt = Qe(oe), ht = ne(() => Ri(oe), [oe]), Tt = ne(() => Je(ht), [ht, Je]), { isSelecting: B, isSelectingRef: ee } = ni({ unitId: r, subUnitId: s, editorId: H, isFocus: M, disableOnClick: S }), ge = z(""), ue = T(Oe).getRenderById(H), Q = ue == null ? void 0 : ue.with(lr), Ce = Q == null ? void 0 : Q.isFocusing, ft = ne(() => Y.getCurrentTypeOfUnit$(q.UNIVER_DOC), [Y]), Me = ve(ft), G = (Me == null ? void 0 : Me.getUnitId()) === H, de = z([]), we = B;
1852
1852
  us(() => {
1853
- w(oe);
1854
- }, [oe, w]);
1855
- const Kt = Tr("="), Yt = si(r, s), Pe = J((Y, se = !0, we, be) => {
1856
- if (!E.current) return;
1857
- le.current = Y;
1858
- const bt = Y[0] === "=" ? Y.slice(1) : "", ke = et(bt), $r = ke.reduce((Ue, Tt) => typeof Tt == "object" ? `${Ue}${Tt.token}` : `${Ue}${Tt}`, ""), yt = Kt(
1859
- E.current,
1860
- $r === bt ? ke : [],
1861
- se,
1853
+ k(oe);
1854
+ }, [oe, k]);
1855
+ const et = Mr("="), $e = si(r, s), me = J((Z, ie = !0, ke, be) => {
1856
+ if (!I.current) return;
1857
+ ge.current = Z;
1858
+ const Ot = Z[0] === "=" ? Z.slice(1) : "", Ae = Je(Ot), $r = Ae.reduce((Pe, Mt) => typeof Mt == "object" ? `${Pe}${Mt.token}` : `${Pe}${Mt}`, ""), Nt = et(
1859
+ I.current,
1860
+ $r === Ot ? Ae : [],
1861
+ ie,
1862
1862
  be
1863
1863
  );
1864
- if ($e.current = yt, we) {
1865
- const Ue = be != null ? be : I == null ? void 0 : I.getSelectionRanges();
1866
- if ((Ue == null ? void 0 : Ue.length) !== 1)
1864
+ if (de.current = Nt, ke) {
1865
+ const Pe = be != null ? be : E == null ? void 0 : E.getSelectionRanges();
1866
+ if ((Pe == null ? void 0 : Pe.length) !== 1)
1867
1867
  return;
1868
- const Pr = Ue[0].startOffset - 1, Ur = Sn(ke, Pr, !1), En = mr(ke, Ur);
1869
- if (En >= 0) {
1870
- const In = yt.splice(En, 1)[0];
1871
- In && yt.push(In);
1868
+ const Pr = Pe[0].startOffset - 1, Ur = Rn(Ae, Pr, !1), Tn = Cr(Ae, Ur);
1869
+ if (Tn >= 0) {
1870
+ const xn = Nt.splice(Tn, 1)[0];
1871
+ xn && Nt.push(xn);
1872
1872
  }
1873
- Yt(k ? yt : [], E.current);
1873
+ $e(M ? Nt : [], I.current);
1874
1874
  }
1875
1875
  });
1876
1876
  $(() => {
1877
- k && Pe(oe, !1, !0);
1878
- }, [k]), $(() => {
1879
- if (k) {
1880
- if (le.current === oe) return;
1881
- Pe(oe, !1, !0);
1877
+ M && me(oe, !1, !0);
1878
+ }, [M]), $(() => {
1879
+ if (M) {
1880
+ if (ge.current === oe) return;
1881
+ me(oe, !1, !0);
1882
1882
  }
1883
- }, [oe]), pi(k, m, oe);
1884
- const nt = Xs(I), Cn = ui(k, r, s);
1883
+ }, [oe]), pi(M, g, oe);
1884
+ const se = Xs(E), gt = ui(M, r, s);
1885
1885
  $(() => {
1886
- var Y;
1887
- M(te, (Y = he == null ? void 0 : he.isFocusing) != null ? Y : !0);
1888
- }, [M, te]), Yo(k, g, I), At(() => {
1889
- let Y;
1886
+ var Z;
1887
+ w(B, (Z = Q == null ? void 0 : Q.isFocusing) != null ? Z : !0);
1888
+ }, [w, B]), Yo(M, m, E), $t(() => {
1889
+ let Z;
1890
1890
  if (U.current) {
1891
- Y = F.register({
1891
+ Z = F.register({
1892
1892
  autofocus: y,
1893
1893
  editorUnitId: H,
1894
1894
  initialSnapshot: {
@@ -1904,56 +1904,56 @@ const Ri = (e) => e.startsWith(nr.EQUALS) ? e.slice(1) : "", Bn = () => {
1904
1904
  documentStyle: {}
1905
1905
  }
1906
1906
  }, U.current);
1907
- const se = F.getEditor(H);
1908
- E.current = se, Pe(o, !1, !0);
1907
+ const ie = F.getEditor(H);
1908
+ I.current = ie, me(o, !1, !0);
1909
1909
  }
1910
1910
  return () => {
1911
- Y == null || Y.dispose();
1911
+ Z == null || Z.dispose();
1912
1912
  };
1913
- }, []), At(() => {
1914
- c ? (D(c), nt()) : (S && (I == null || I.blur(), Cn()), D(c));
1915
- }, [c, I, nt, Cn, S]);
1916
- const { checkScrollBar: Ar } = Go(I, R, _);
1917
- li(k, !!(te && Me), r, N), ai(!!(k && Z && a), Ie, I, p);
1918
- const Fr = J((Y, se, we) => {
1919
- if (!Z)
1913
+ }, []), $t(() => {
1914
+ c ? (D(c), se()) : (C && (E == null || E.blur(), gt()), D(c));
1915
+ }, [c, E, se, gt, C]);
1916
+ const { checkScrollBar: zt } = Go(E, R, _);
1917
+ li(M, !!(B && G), r, N), ai(!!(M && Ce && a), we, E, p);
1918
+ const xt = J((Z, ie, ke) => {
1919
+ if (!Ce)
1920
1920
  return;
1921
- const be = se !== -1 ? [{ startOffset: se + 1, endOffset: se + 1, collapsed: !0 }] : void 0;
1922
- Pe(`=${Y}`, !0, we, be), we && (nt(), se !== -1 && setTimeout(() => {
1923
- const bt = { startOffset: se + 1, endOffset: se + 1 }, ke = I == null ? void 0 : I.render.with(Zo);
1924
- ke == null || ke.scrollToRange({ ...bt, collapsed: !0 });
1925
- }, 50), Ar());
1921
+ const be = ie !== -1 ? [{ startOffset: ie + 1, endOffset: ie + 1, collapsed: !0 }] : void 0;
1922
+ me(`=${Z}`, !0, ke, be), ke && (se(), ie !== -1 && setTimeout(() => {
1923
+ const Ot = { startOffset: ie + 1, endOffset: ie + 1 }, Ae = E == null ? void 0 : E.render.with(Zo);
1924
+ Ae == null || Ae.scrollToRange({ ...Ot, collapsed: !0 });
1925
+ }, 50), zt());
1926
1926
  });
1927
1927
  gi(
1928
- k && !!(te && Me),
1929
- k,
1930
- pe,
1928
+ M && !!(B && G),
1929
+ M,
1930
+ ee,
1931
1931
  r,
1932
1932
  s,
1933
- $e,
1933
+ de,
1934
1934
  i,
1935
- !!Ie,
1936
- I,
1937
- Fr
1938
- ), mi(k && !!(te && Me), r, i, D, f, () => {
1939
- Pe(X.current, !1, !0);
1935
+ !!we,
1936
+ E,
1937
+ xt
1938
+ ), mi(M && !!(B && G), r, i, D, f, () => {
1939
+ me(yt.current, !1, !0);
1940
1940
  });
1941
- const Dr = (Y) => {
1942
- if (Y) {
1943
- const se = I == null ? void 0 : I.getSelectionRanges();
1944
- if (se && se.length === 1) {
1945
- const we = se[0];
1946
- if (we.collapsed) {
1947
- const be = Y.offset;
1941
+ const In = (Z) => {
1942
+ if (Z) {
1943
+ const ie = E == null ? void 0 : E.getSelectionRanges();
1944
+ if (ie && ie.length === 1) {
1945
+ const ke = ie[0];
1946
+ if (ke.collapsed) {
1947
+ const be = Z.offset;
1948
1948
  setTimeout(() => {
1949
- I == null || I.setSelectionRanges([{ startOffset: we.startOffset - be, endOffset: we.endOffset - be }]);
1949
+ E == null || E.setSelectionRanges([{ startOffset: ke.startOffset - be, endOffset: ke.endOffset - be }]);
1950
1950
  }, 30);
1951
1951
  }
1952
1952
  }
1953
- nt(), Pe(`=${Y.text}`);
1953
+ se(), me(`=${Z.text}`);
1954
1954
  }
1955
- }, Lr = () => {
1956
- D(!0), l(), nt();
1955
+ }, En = () => {
1956
+ D(!0), l(), se();
1957
1957
  };
1958
1958
  return /* @__PURE__ */ W("div", { className: u, children: [
1959
1959
  /* @__PURE__ */ O(
@@ -1965,8 +1965,8 @@ const Ri = (e) => e.startsWith(nr.EQUALS) ? e.slice(1) : "", Bn = () => {
1965
1965
  univer-justify-around univer-gap-2 univer-rounded-none univer-p-0 univer-ring-1
1966
1966
  `,
1967
1967
  {
1968
- "univer-ring-primary-500": k,
1969
- "univer-ring-red-500": ie
1968
+ "univer-ring-primary-500": M,
1969
+ "univer-ring-red-500": ce
1970
1970
  }
1971
1971
  ),
1972
1972
  ref: x,
@@ -1975,35 +1975,35 @@ const Ri = (e) => e.startsWith(nr.EQUALS) ? e.slice(1) : "", Bn = () => {
1975
1975
  {
1976
1976
  ref: U,
1977
1977
  className: "univer-relative univer-h-full univer-w-full",
1978
- onMouseUp: Lr
1978
+ onMouseUp: En
1979
1979
  }
1980
1980
  )
1981
1981
  }
1982
1982
  ),
1983
1983
  n !== void 0 ? /* @__PURE__ */ O("div", { className: "univer-my-1 univer-text-xs univer-text-red-500", children: n }) : null,
1984
- I ? /* @__PURE__ */ O(
1984
+ E ? /* @__PURE__ */ O(
1985
1985
  zs,
1986
1986
  {
1987
- editor: I,
1988
- isFocus: k,
1987
+ editor: E,
1988
+ isFocus: M,
1989
1989
  formulaText: oe,
1990
- onClose: () => nt()
1990
+ onClose: () => se()
1991
1991
  }
1992
1992
  ) : null,
1993
- I ? /* @__PURE__ */ O(
1993
+ E ? /* @__PURE__ */ O(
1994
1994
  Ci,
1995
1995
  {
1996
- isFocus: k,
1997
- sequenceNodes: me,
1998
- onSelect: Dr,
1996
+ isFocus: M,
1997
+ sequenceNodes: Tt,
1998
+ onSelect: In,
1999
1999
  ref: b,
2000
- editor: I
2000
+ editor: E
2001
2001
  }
2002
2002
  ) : null
2003
2003
  ] });
2004
2004
  });
2005
- function Ii(e, t, n, o) {
2006
- const r = T(_e), s = Tr(""), c = ge(e == null ? void 0 : e.getDocumentDataModel().change$), [i, l] = V([]), f = T(go), h = G(""), m = T(ee);
2005
+ function Ei(e, t, n, o) {
2006
+ const r = T(Ie), s = Mr(""), c = ve(e == null ? void 0 : e.getDocumentDataModel().change$), [i, l] = V([]), f = T(go), h = z(""), g = T(te);
2007
2007
  return $(() => {
2008
2008
  if (!e) return;
2009
2009
  const u = e.getDocumentDataModel().getPlainText();
@@ -2016,39 +2016,39 @@ function Ii(e, t, n, o) {
2016
2016
  var a, v;
2017
2017
  if (!e) return;
2018
2018
  if (!t) {
2019
- const g = e.getDocumentData();
2019
+ const m = e.getDocumentData();
2020
2020
  e.setDocumentData({
2021
- ...g,
2021
+ ...m,
2022
2022
  body: {
2023
- ...g.body,
2024
- dataStream: (v = (a = g.body) == null ? void 0 : a.dataStream) != null ? v : "",
2023
+ ...m.body,
2024
+ dataStream: (v = (a = m.body) == null ? void 0 : a.dataStream) != null ? v : "",
2025
2025
  textRuns: []
2026
2026
  }
2027
2027
  });
2028
2028
  return;
2029
2029
  }
2030
- const u = s(e, i, !1), d = new He();
2031
- return u.forEach((g) => {
2032
- const p = dt(g.token), S = m.getCurrentUnitForType(j.UNIVER_SHEET), _ = S == null ? void 0 : S.getActiveSheet();
2030
+ const u = s(e, i, !1), d = new We();
2031
+ return u.forEach((m) => {
2032
+ const p = lt(m.token), C = g.getCurrentUnitForType(q.UNIVER_SHEET), _ = C == null ? void 0 : C.getActiveSheet();
2033
2033
  if (!p.sheetName && o !== (_ == null ? void 0 : _.getSheetId()) || p.sheetName && (_ == null ? void 0 : _.getName()) !== p.sheetName)
2034
2034
  return;
2035
- const R = new cn(g.themeColor).toRgb(), C = f.addShape({
2035
+ const R = new un(m.themeColor).toRgb(), S = f.addShape({
2036
2036
  range: p.range,
2037
2037
  style: {
2038
- stroke: g.themeColor,
2038
+ stroke: m.themeColor,
2039
2039
  fill: `rgba(${R.r}, ${R.g}, ${R.b}, 0.1)`,
2040
2040
  strokeDash: 12
2041
2041
  },
2042
2042
  primary: null
2043
2043
  });
2044
- C && d.add(() => f.removeShape(C));
2044
+ S && d.add(() => f.removeShape(S));
2045
2045
  }), () => {
2046
2046
  d.dispose();
2047
2047
  };
2048
2048
  }, [e, t, s, f, i]), { sequenceNodes: i };
2049
2049
  }
2050
2050
  function bi(e) {
2051
- const t = T(un), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = e, i = T(ee).getUnit(o, j.UNIVER_SHEET), l = J(s), f = J((h, m) => {
2051
+ const t = T(fn), { supportAcrossSheet: n = !1, unitId: o, subUnitId: r, onChange: s } = e, i = T(te).getUnit(o, q.UNIVER_SHEET), l = J(s), f = J((h, g) => {
2052
2052
  const u = i == null ? void 0 : i.getActiveSheet();
2053
2053
  if (!u || !n && u.getSheetId() !== r || !(h != null && h.length)) return;
2054
2054
  const d = h.map((a) => ({
@@ -2056,26 +2056,26 @@ function bi(e) {
2056
2056
  unitId: o,
2057
2057
  sheetName: u.getSheetId() === r ? "" : u.getName()
2058
2058
  }));
2059
- l(d, m);
2059
+ l(d, g);
2060
2060
  });
2061
2061
  $(() => {
2062
- const h = new He();
2063
- return h.add(t.selectionMoveStart$.subscribe((m) => {
2064
- f(m, !0);
2065
- })), h.add(t.selectionMoving$.subscribe((m) => {
2066
- f(m, !1);
2067
- })), h.add(t.selectionMoveEnd$.subscribe((m) => {
2068
- f(m, !1);
2062
+ const h = new We();
2063
+ return h.add(t.selectionMoveStart$.subscribe((g) => {
2064
+ f(g, !0);
2065
+ })), h.add(t.selectionMoving$.subscribe((g) => {
2066
+ f(g, !1);
2067
+ })), h.add(t.selectionMoveEnd$.subscribe((g) => {
2068
+ f(g, !1);
2069
2069
  })), () => {
2070
2070
  h.dispose();
2071
2071
  };
2072
2072
  }, [f, t.selectionMoveEnd$, t.selectionMoveStart$, t.selectionMoving$]);
2073
2073
  }
2074
- const jn = (e) => !e.some((n) => {
2074
+ const Gn = (e) => !e.some((n) => {
2075
2075
  if (typeof n == "string") {
2076
- if (n !== ct.COMMA)
2076
+ if (n !== st.COMMA)
2077
2077
  return !0;
2078
- } else if (n.nodeType !== z.REFERENCE)
2078
+ } else if (n.nodeType !== X.REFERENCE)
2079
2079
  return !0;
2080
2080
  return !1;
2081
2081
  }), yi = (e) => {
@@ -2100,18 +2100,18 @@ function Ti(e) {
2100
2100
  onConfirm: i,
2101
2101
  onClose: l,
2102
2102
  onShowBySelection: f
2103
- } = e, h = T(lt), m = T(_e), [u, d] = V([]), [a, v] = V(0), g = G(null);
2103
+ } = e, h = T(ct), g = T(Ie), [u, d] = V([]), [a, v] = V(0), m = z(null);
2104
2104
  $(() => {
2105
2105
  if (t && n.length) {
2106
- const R = n.map((C) => C.sheetName ? St(C.sheetName, C.range) : Ce(C.range));
2106
+ const R = n.map((S) => S.sheetName ? Ct(S.sheetName, S.range) : Re(S.range));
2107
2107
  d(R), v(R.length - 1);
2108
2108
  } else
2109
2109
  d([""]), v(0);
2110
2110
  }, [t]);
2111
- const p = (R, C) => {
2111
+ const p = (R, S) => {
2112
2112
  const y = [...u];
2113
- y[R] = C, d(y);
2114
- }, S = () => {
2113
+ y[R] = S, d(y);
2114
+ }, C = () => {
2115
2115
  d([...u, ""]), v(u.length);
2116
2116
  }, _ = (R) => {
2117
2117
  u.splice(R, 1), d([...u]);
@@ -2120,18 +2120,18 @@ function Ti(e) {
2120
2120
  unitId: o,
2121
2121
  subUnitId: r,
2122
2122
  supportAcrossSheet: c,
2123
- onChange: (R, C) => {
2123
+ onChange: (R, S) => {
2124
2124
  if (!t && f != null && f(R))
2125
2125
  return;
2126
- const y = new Set(u), N = R.map((x) => x.sheetName ? St(x.sheetName, x.range) : Ce(x.range)), A = N.filter((x) => !y.has(x));
2126
+ const y = new Set(u), N = R.map((x) => x.sheetName ? Ct(x.sheetName, x.range) : Re(x.range)), A = N.filter((x) => !y.has(x));
2127
2127
  if (!A.length) return;
2128
2128
  const F = [...u];
2129
2129
  if (N.length > 1) {
2130
- C || F.splice(a, 1), F.push(...A);
2130
+ S || F.splice(a, 1), F.push(...A);
2131
2131
  const x = F.slice(0, s);
2132
2132
  d(x), v(x.length - 1), requestAnimationFrame(() => {
2133
- var w;
2134
- (w = g.current) == null || w.scrollTo({ top: g.current.scrollHeight });
2133
+ var k;
2134
+ (k = m.current) == null || k.scrollTo({ top: m.current.scrollHeight });
2135
2135
  });
2136
2136
  } else {
2137
2137
  F.splice(a, 1, ...A);
@@ -2149,17 +2149,17 @@ function Ti(e) {
2149
2149
  mask: !1,
2150
2150
  maskClosable: !1,
2151
2151
  footer: /* @__PURE__ */ W("footer", { className: "univer-flex univer-gap-2", children: [
2152
- /* @__PURE__ */ O(st, { onClick: l, children: h.t("rangeSelector.cancel") }),
2152
+ /* @__PURE__ */ O(rt, { onClick: l, children: h.t("rangeSelector.cancel") }),
2153
2153
  /* @__PURE__ */ O(
2154
- st,
2154
+ rt,
2155
2155
  {
2156
2156
  variant: "primary",
2157
2157
  onClick: () => {
2158
2158
  i(
2159
2159
  u.filter((R) => {
2160
- const C = m.sequenceNodesBuilder(R);
2161
- return C && C.length === 1 && typeof C[0] != "string" && C[0].nodeType === z.REFERENCE;
2162
- }).map((R) => dt(R)).map((R) => ({ ...R, range: yi(R.range) }))
2160
+ const S = g.sequenceNodesBuilder(R);
2161
+ return S && S.length === 1 && typeof S[0] != "string" && S[0].nodeType === X.REFERENCE;
2162
+ }).map((R) => lt(R)).map((R) => ({ ...R, range: yi(R.range) }))
2163
2163
  );
2164
2164
  },
2165
2165
  children: h.t("rangeSelector.confirm")
@@ -2170,39 +2170,39 @@ function Ti(e) {
2170
2170
  children: /* @__PURE__ */ W(
2171
2171
  "div",
2172
2172
  {
2173
- ref: g,
2174
- className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", at),
2173
+ ref: m,
2174
+ className: re("-univer-mx-6 univer-max-h-60 univer-overflow-y-auto univer-px-6", it),
2175
2175
  children: [
2176
- u.map((R, C) => /* @__PURE__ */ W(
2176
+ u.map((R, S) => /* @__PURE__ */ W(
2177
2177
  "div",
2178
2178
  {
2179
2179
  className: "univer-mb-2 univer-flex univer-items-center univer-gap-4",
2180
2180
  children: [
2181
2181
  /* @__PURE__ */ O(
2182
- ur,
2182
+ gr,
2183
2183
  {
2184
2184
  className: re("univer-w-full", {
2185
- "univer-border-primary-600": a === C
2185
+ "univer-border-primary-600": a === S
2186
2186
  }),
2187
2187
  placeholder: h.t("rangeSelector.placeHolder"),
2188
- onFocus: () => v(C),
2188
+ onFocus: () => v(S),
2189
2189
  value: R,
2190
- onChange: (y) => p(C, y)
2190
+ onChange: (y) => p(S, y)
2191
2191
  }
2192
2192
  ),
2193
2193
  u.length > 1 && /* @__PURE__ */ O(
2194
- Cr,
2194
+ Er,
2195
2195
  {
2196
2196
  className: "univer-cursor-pointer",
2197
- onClick: () => _(C)
2197
+ onClick: () => _(S)
2198
2198
  }
2199
2199
  )
2200
2200
  ]
2201
2201
  },
2202
- C
2202
+ S
2203
2203
  )),
2204
- u.length < s && /* @__PURE__ */ O("div", { children: /* @__PURE__ */ W(st, { variant: "link", onClick: S, children: [
2205
- /* @__PURE__ */ O(_r, {}),
2204
+ u.length < s && /* @__PURE__ */ O("div", { children: /* @__PURE__ */ W(rt, { variant: "link", onClick: C, children: [
2205
+ /* @__PURE__ */ O(br, {}),
2206
2206
  /* @__PURE__ */ O("span", { children: h.t("rangeSelector.addAnotherRange") })
2207
2207
  ] }) })
2208
2208
  ]
@@ -2212,12 +2212,12 @@ function Ti(e) {
2212
2212
  );
2213
2213
  }
2214
2214
  function xi(e) {
2215
- return e.split(ct.COMMA).filter((t) => !!t).map((t) => dt(t));
2215
+ return e.split(st.COMMA).filter((t) => !!t).map((t) => lt(t));
2216
2216
  }
2217
2217
  function Oi(e) {
2218
- return e.map((t) => t.sheetName ? St(t.sheetName, t.range) : Ce(t.range)).join(ct.COMMA);
2218
+ return e.map((t) => t.sheetName ? Ct(t.sheetName, t.range) : Re(t.range)).join(st.COMMA);
2219
2219
  }
2220
- function xr(e) {
2220
+ function wr(e) {
2221
2221
  const [t, n] = V(null), {
2222
2222
  onVerify: o,
2223
2223
  selectorRef: r,
@@ -2227,17 +2227,17 @@ function xr(e) {
2227
2227
  supportAcrossSheet: l,
2228
2228
  autoFocus: f,
2229
2229
  onChange: h,
2230
- onRangeSelectorDialogVisibleChange: m,
2230
+ onRangeSelectorDialogVisibleChange: g,
2231
2231
  onClickOutside: u,
2232
2232
  onFocusChange: d,
2233
2233
  forceShowDialogWhenSelectionChanged: a,
2234
2234
  hideEditor: v,
2235
- resetRange: g
2236
- } = e, [p, S] = V(f != null ? f : !1), [_, R] = V(!1), [C, y] = V([]), N = T(lt), A = T(qe), { sequenceNodes: F } = Ii(t, p, s, c), x = Je(F), w = T(de), M = J(() => {
2235
+ resetRange: m
2236
+ } = e, [p, C] = V(f != null ? f : !1), [_, R] = V(!1), [S, y] = V([]), N = T(ct), A = T(je), { sequenceNodes: F } = Ei(t, p, s, c), x = Qe(F), k = T(fe), w = J(() => {
2237
2237
  t == null || t.setSelectionRanges([]), t == null || t.blur(), A.blur();
2238
2238
  }), b = J(() => {
2239
- var E;
2240
- M(), y(xi((E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "")), R(!0);
2239
+ var I;
2240
+ w(), y(xi((I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "")), R(!0);
2241
2241
  });
2242
2242
  return $(() => {
2243
2243
  r && (r.current = {
@@ -2247,33 +2247,33 @@ function xr(e) {
2247
2247
  focus() {
2248
2248
  A.focus(t.getEditorId());
2249
2249
  },
2250
- blur: M,
2251
- verify: () => jn(x.current),
2252
- showDialog: (E) => {
2253
- M(), y(E), R(!0);
2250
+ blur: w,
2251
+ verify: () => Gn(x.current),
2252
+ showDialog: (I) => {
2253
+ w(), y(I), R(!0);
2254
2254
  },
2255
2255
  hideDialog: () => {
2256
2256
  y([]), R(!1);
2257
2257
  },
2258
2258
  getValue: () => {
2259
- var E;
2260
- return (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "";
2259
+ var I;
2260
+ return (I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "";
2261
2261
  }
2262
2262
  });
2263
- }, [M, t, A, r, x]), $(() => {
2264
- var E;
2265
- o == null || o(jn(F), (E = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? E : "");
2263
+ }, [w, t, A, r, x]), $(() => {
2264
+ var I;
2265
+ o == null || o(Gn(F), (I = t == null ? void 0 : t.getDocumentDataModel().getPlainText()) != null ? I : "");
2266
2266
  }, [F]), $(() => {
2267
- m == null || m(_);
2267
+ g == null || g(_);
2268
2268
  }, [_]), $(() => {
2269
- if (_ && g)
2269
+ if (_ && m)
2270
2270
  return () => {
2271
- const E = {
2271
+ const I = {
2272
2272
  unitId: s,
2273
2273
  subUnitId: c,
2274
- selections: g
2274
+ selections: m
2275
2275
  };
2276
- w.executeCommand(dn.id, E);
2276
+ k.executeCommand(gn.id, I);
2277
2277
  };
2278
2278
  }, [_]), /* @__PURE__ */ W(ms, { children: [
2279
2279
  v ? null : /* @__PURE__ */ O(
@@ -2281,15 +2281,15 @@ function xr(e) {
2281
2281
  {
2282
2282
  isSingle: !0,
2283
2283
  ...e,
2284
- onFocusChange: (E, I) => {
2285
- S(E), d == null || d(E, I);
2284
+ onFocusChange: (I, E) => {
2285
+ C(I), d == null || d(I, E);
2286
2286
  },
2287
2287
  editorRef: n,
2288
2288
  onClickOutside: () => {
2289
- S(!1), M(), u == null || u();
2289
+ C(!1), w(), u == null || u();
2290
2290
  },
2291
2291
  icon: /* @__PURE__ */ O(vs, { title: N.t("rangeSelector.buttonTooltip"), placement: "bottom", children: /* @__PURE__ */ O(
2292
- Er,
2292
+ Tr,
2293
2293
  {
2294
2294
  className: "univer-cursor-pointer dark:!univer-text-gray-300",
2295
2295
  onClick: b
@@ -2300,30 +2300,30 @@ function xr(e) {
2300
2300
  /* @__PURE__ */ O(
2301
2301
  Ti,
2302
2302
  {
2303
- initialValue: C,
2303
+ initialValue: S,
2304
2304
  unitId: s,
2305
2305
  subUnitId: c,
2306
2306
  visible: _,
2307
2307
  maxRangeCount: i,
2308
- onConfirm: (E) => {
2309
- const I = Oi(E), k = Gr.newEmptyData();
2310
- k.body.dataStream = I, t == null || t.replaceText(I, !1), h == null || h(k, I), R(!1), y([]), requestAnimationFrame(() => {
2311
- M();
2308
+ onConfirm: (I) => {
2309
+ const E = Oi(I), M = Gr.newEmptyData();
2310
+ M.body.dataStream = E, t == null || t.replaceText(E, !1), h == null || h(M, E), R(!1), y([]), requestAnimationFrame(() => {
2311
+ w();
2312
2312
  });
2313
2313
  },
2314
2314
  onClose: () => {
2315
2315
  R(!1), y([]);
2316
2316
  },
2317
2317
  supportAcrossSheet: l,
2318
- onShowBySelection: (E) => p || a ? (y(E), R(!0), !1) : !0
2318
+ onShowBySelection: (I) => p || a ? (y(I), R(!0), !1) : !0
2319
2319
  }
2320
2320
  )
2321
2321
  ] });
2322
2322
  }
2323
- class Or {
2323
+ class kr {
2324
2324
  constructor() {
2325
- q(this, "_currentSelector$", new rr(null));
2326
- q(this, "currentSelector$", this._currentSelector$.asObservable());
2325
+ K(this, "_currentSelector$", new cr(null));
2326
+ K(this, "currentSelector$", this._currentSelector$.asObservable());
2327
2327
  }
2328
2328
  showRangeSelectorDialog(t) {
2329
2329
  const n = t.callback, o = new Promise((r) => {
@@ -2338,8 +2338,8 @@ var Ni = Object.getOwnPropertyDescriptor, Mi = (e, t, n, o) => {
2338
2338
  for (var r = o > 1 ? void 0 : o ? Ni(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2339
2339
  (c = e[s]) && (r = c(r) || r);
2340
2340
  return r;
2341
- }, Nt = (e, t) => (n, o) => t(n, o, e);
2342
- let Ft = class extends ut {
2341
+ }, At = (e, t) => (n, o) => t(n, o, e);
2342
+ let Pt = class extends at {
2343
2343
  constructor(e, t, n, o) {
2344
2344
  super(), this._sheetInterceptorService = e, this._univerInstanceService = t, this._formulaDataModel = n, this._lexerTreeBuilder = o, this._initialize();
2345
2345
  }
@@ -2358,36 +2358,36 @@ let Ft = class extends ut {
2358
2358
  redos: t,
2359
2359
  undos: n
2360
2360
  };
2361
- const f = l.getCellMatrix(), h = new Fe(), m = new Fe();
2361
+ const f = l.getCellMatrix(), h = new De(), g = new De();
2362
2362
  let u = !1;
2363
2363
  return Zr.foreach(s, (d, a) => {
2364
2364
  let v = d;
2365
2365
  c.hasOwnProperty(d) && (v = c[d]);
2366
- const g = f.getValue(v, a);
2367
- if (g != null && g.f || g != null && g.si) {
2366
+ const m = f.getValue(v, a);
2367
+ if (m != null && m.f || m != null && m.si) {
2368
2368
  u = !0;
2369
- const p = this._formulaDataModel.getFormulaStringByCell(v, a, r, o), S = this._lexerTreeBuilder.moveFormulaRefOffset(
2369
+ const p = this._formulaDataModel.getFormulaStringByCell(v, a, r, o), C = this._lexerTreeBuilder.moveFormulaRefOffset(
2370
2370
  p,
2371
2371
  0,
2372
2372
  d - v
2373
- ), _ = it.deepClone(g);
2374
- _.f = S, _.si = null, h.setValue(d, a, _);
2373
+ ), _ = ot.deepClone(m);
2374
+ _.f = C, _.si = null, h.setValue(d, a, _);
2375
2375
  } else
2376
- h.setValue(d, a, g);
2377
- m.setValue(d, a, f.getValue(d, a));
2376
+ h.setValue(d, a, m);
2377
+ g.setValue(d, a, f.getValue(d, a));
2378
2378
  }), u ? (t.push({
2379
- id: wt.id,
2379
+ id: Dt.id,
2380
2380
  params: {
2381
2381
  unitId: o,
2382
2382
  subUnitId: r,
2383
2383
  cellValue: h.getMatrix()
2384
2384
  }
2385
2385
  }), n.push({
2386
- id: wt.id,
2386
+ id: Dt.id,
2387
2387
  params: {
2388
2388
  unitId: o,
2389
2389
  subUnitId: r,
2390
- cellValue: m.getMatrix()
2390
+ cellValue: g.getMatrix()
2391
2391
  }
2392
2392
  }), {
2393
2393
  redos: t,
@@ -2398,39 +2398,39 @@ let Ft = class extends ut {
2398
2398
  };
2399
2399
  }
2400
2400
  };
2401
- Ft = Mi([
2402
- Nt(0, B(hn)),
2403
- Nt(1, B(ee)),
2404
- Nt(2, B(It)),
2405
- Nt(3, B(_e))
2406
- ], Ft);
2407
- const wi = "sheets-formula-ui.base.config", qn = {};
2401
+ Pt = Mi([
2402
+ At(0, j(mn)),
2403
+ At(1, j(te)),
2404
+ At(2, j(bt)),
2405
+ At(3, j(Ie))
2406
+ ], Pt);
2407
+ const wi = "sheets-formula-ui.base.config", Zn = {};
2408
2408
  function ki(e) {
2409
2409
  return e.getContextValue(zr) && e.getContextValue(Xr);
2410
2410
  }
2411
- function Nr(e, t = !1) {
2412
- return !t && !(ye(e == null ? void 0 : e.f) || Be(e == null ? void 0 : e.si)) ? null : typeof (e == null ? void 0 : e.v) == "string" && Ao.has(e.v) ? e.v : null;
2411
+ function Ar(e, t = !1) {
2412
+ return !t && !(ye(e == null ? void 0 : e.f) || He(e == null ? void 0 : e.si)) ? null : typeof (e == null ? void 0 : e.v) == "string" && Ao.has(e.v) ? e.v : null;
2413
2413
  }
2414
2414
  var Ai = Object.getOwnPropertyDescriptor, Fi = (e, t, n, o) => {
2415
2415
  for (var r = o > 1 ? void 0 : o ? Ai(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2416
2416
  (c = e[s]) && (r = c(r) || r);
2417
2417
  return r;
2418
- }, mt = (e, t) => (n, o) => t(n, o, e);
2419
- const Xt = "SHEET_FORMULA_ALERT", Di = {
2420
- [ce.DIV_BY_ZERO]: "divByZero",
2421
- [ce.NAME]: "name",
2422
- [ce.VALUE]: "value",
2423
- [ce.NUM]: "num",
2424
- [ce.NA]: "na",
2425
- [ce.CYCLE]: "cycle",
2426
- [ce.REF]: "ref",
2427
- [ce.SPILL]: "spill",
2428
- [ce.CALC]: "calc",
2429
- [ce.ERROR]: "error",
2430
- [ce.CONNECT]: "connect",
2431
- [ce.NULL]: "null"
2418
+ }, pt = (e, t) => (n, o) => t(n, o, e);
2419
+ const en = "SHEET_FORMULA_ALERT", Di = {
2420
+ [ae.DIV_BY_ZERO]: "divByZero",
2421
+ [ae.NAME]: "name",
2422
+ [ae.VALUE]: "value",
2423
+ [ae.NUM]: "num",
2424
+ [ae.NA]: "na",
2425
+ [ae.CYCLE]: "cycle",
2426
+ [ae.REF]: "ref",
2427
+ [ae.SPILL]: "spill",
2428
+ [ae.CALC]: "calc",
2429
+ [ae.ERROR]: "error",
2430
+ [ae.CONNECT]: "connect",
2431
+ [ae.NULL]: "null"
2432
2432
  };
2433
- let rn = class extends ut {
2433
+ let cn = class extends at {
2434
2434
  constructor(e, t, n, o, r, s) {
2435
2435
  super(), this._context = e, this._hoverManagerService = t, this._cellAlertManagerService = n, this._localeService = o, this._formulaDataModel = r, this._zenZoneService = s, this._init();
2436
2436
  }
@@ -2438,19 +2438,19 @@ let rn = class extends ut {
2438
2438
  this._initCellAlertPopup(), this._initZenService();
2439
2439
  }
2440
2440
  _initCellAlertPopup() {
2441
- this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(ln(100)).subscribe((e) => {
2441
+ this.disposeWithMe(this._hoverManagerService.currentCell$.pipe(hn(100)).subscribe((e) => {
2442
2442
  var t, n, o, r, s;
2443
2443
  if (e) {
2444
2444
  const i = this._context.unit.getActiveSheet();
2445
2445
  if (!i) return;
2446
2446
  const l = i.getCell(e.location.row, e.location.col), f = (r = (o = (n = (t = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : t[e.location.unitId]) == null ? void 0 : n[e.location.subUnitId]) == null ? void 0 : o[e.location.row]) == null ? void 0 : r[e.location.col];
2447
2447
  if (Qr(l)) {
2448
- const h = Nr(l, !!f);
2448
+ const h = Ar(l, !!f);
2449
2449
  if (!h) {
2450
2450
  this._hideAlert();
2451
2451
  return;
2452
2452
  }
2453
- const m = this._cellAlertManagerService.currentAlert.get(Xt), u = (s = m == null ? void 0 : m.alert) == null ? void 0 : s.location;
2453
+ const g = this._cellAlertManagerService.currentAlert.get(en), u = (s = g == null ? void 0 : g.alert) == null ? void 0 : s.location;
2454
2454
  if (u && u.row === e.location.row && u.col === e.location.col && u.subUnitId === e.location.subUnitId && u.unitId === e.location.unitId)
2455
2455
  return;
2456
2456
  this._cellAlertManagerService.showAlert({
@@ -2460,7 +2460,7 @@ let rn = class extends ut {
2460
2460
  location: e.location,
2461
2461
  width: 200,
2462
2462
  height: 74,
2463
- key: Xt
2463
+ key: en
2464
2464
  });
2465
2465
  return;
2466
2466
  }
@@ -2474,31 +2474,31 @@ let rn = class extends ut {
2474
2474
  }));
2475
2475
  }
2476
2476
  _hideAlert() {
2477
- this._cellAlertManagerService.removeAlert(Xt);
2477
+ this._cellAlertManagerService.removeAlert(en);
2478
2478
  }
2479
2479
  };
2480
- rn = Fi([
2481
- mt(1, B(mo)),
2482
- mt(2, B(po)),
2483
- mt(3, B(lt)),
2484
- mt(4, B(It)),
2485
- mt(5, ds)
2486
- ], rn);
2480
+ cn = Fi([
2481
+ pt(1, j(mo)),
2482
+ pt(2, j(po)),
2483
+ pt(3, j(ct)),
2484
+ pt(4, j(bt)),
2485
+ pt(5, ds)
2486
+ ], cn);
2487
2487
  var Li = Object.getOwnPropertyDescriptor, $i = (e, t, n, o) => {
2488
2488
  for (var r = o > 1 ? void 0 : o ? Li(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2489
2489
  (c = e[s]) && (r = c(r) || r);
2490
2490
  return r;
2491
- }, Kn = (e, t) => (n, o) => t(n, o, e);
2492
- let Dt = class extends ut {
2491
+ }, zn = (e, t) => (n, o) => t(n, o, e);
2492
+ let Ut = class extends at {
2493
2493
  constructor(e, t) {
2494
2494
  super(), this._autoFillService = e, this._lexerTreeBuilder = t, this._registerAutoFill();
2495
2495
  }
2496
2496
  _registerAutoFill() {
2497
2497
  const e = {
2498
- type: wn.FORMULA,
2498
+ type: Dn.FORMULA,
2499
2499
  priority: 1001,
2500
- match: (t) => ye(t == null ? void 0 : t.f) || Be(t == null ? void 0 : t.si),
2501
- isContinue: (t, n) => t.type === wn.FORMULA,
2500
+ match: (t) => ye(t == null ? void 0 : t.f) || He(t == null ? void 0 : t.si),
2501
+ isContinue: (t, n) => t.type === Dn.FORMULA,
2502
2502
  applyFunctions: {
2503
2503
  [Co.COPY]: (t, n, o, r, s) => {
2504
2504
  const { data: c, index: i } = t;
@@ -2511,22 +2511,22 @@ let Dt = class extends ut {
2511
2511
  _fillCopyFormula(e, t, n, o, r, s) {
2512
2512
  var f, h;
2513
2513
  const c = Ui(r), i = [], l = /* @__PURE__ */ new Map();
2514
- for (let m = 1; m <= t; m++) {
2515
- const u = (m - 1) % e.length, d = o[u], a = it.deepClone(e[u]);
2514
+ for (let g = 1; g <= t; g++) {
2515
+ const u = (g - 1) % e.length, d = o[u], a = ot.deepClone(e[u]);
2516
2516
  if (a) {
2517
- const v = ((f = e[u]) == null ? void 0 : f.f) || "", g = ((h = e[u]) == null ? void 0 : h.si) || "", p = ye(v);
2518
- if (Be(g))
2519
- a.si = g, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
2517
+ const v = ((f = e[u]) == null ? void 0 : f.f) || "", m = ((h = e[u]) == null ? void 0 : h.si) || "", p = ye(v);
2518
+ if (He(m))
2519
+ a.si = m, a.f = null, a.v = null, a.p = null, a.t = null, i.push(a);
2520
2520
  else if (p) {
2521
2521
  let _ = l.get(u);
2522
2522
  if (_)
2523
2523
  a.si = _, a.f = null, a.v = null, a.p = null, a.t = null;
2524
2524
  else {
2525
- _ = it.generateRandomId(6), l.set(u, _);
2526
- const { offsetX: R, offsetY: C } = Pi(c, t, n, s, d), y = this._lexerTreeBuilder.moveFormulaRefOffset(
2525
+ _ = ot.generateRandomId(6), l.set(u, _);
2526
+ const { offsetX: R, offsetY: S } = Pi(c, t, n, s, d), y = this._lexerTreeBuilder.moveFormulaRefOffset(
2527
2527
  v,
2528
2528
  R,
2529
- C
2529
+ S
2530
2530
  );
2531
2531
  a.si = _, a.f = y, a.v = null, a.p = null, a.t = null;
2532
2532
  }
@@ -2537,24 +2537,24 @@ let Dt = class extends ut {
2537
2537
  return i;
2538
2538
  }
2539
2539
  };
2540
- Dt = $i([
2541
- Kn(0, So),
2542
- Kn(1, B(_e))
2543
- ], Dt);
2540
+ Ut = $i([
2541
+ zn(0, So),
2542
+ zn(1, j(Ie))
2543
+ ], Ut);
2544
2544
  function Pi(e, t, n, o, r) {
2545
2545
  const { source: s, target: c } = o, { rows: i } = c, { rows: l } = s;
2546
2546
  let f = 0, h = 0;
2547
2547
  switch (n) {
2548
- case ae.UP:
2548
+ case le.UP:
2549
2549
  h = i[r] - l[r];
2550
2550
  break;
2551
- case ae.RIGHT:
2551
+ case le.RIGHT:
2552
2552
  f = e;
2553
2553
  break;
2554
- case ae.DOWN:
2554
+ case le.DOWN:
2555
2555
  h = i[r] - l[r];
2556
2556
  break;
2557
- case ae.LEFT:
2557
+ case le.LEFT:
2558
2558
  f = -e * t;
2559
2559
  break;
2560
2560
  }
@@ -2572,9 +2572,9 @@ var Vi = Object.getOwnPropertyDescriptor, Wi = (e, t, n, o) => {
2572
2572
  for (var r = o > 1 ? void 0 : o ? Vi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2573
2573
  (c = e[s]) && (r = c(r) || r);
2574
2574
  return r;
2575
- }, pt = (e, t) => (n, o) => t(n, o, e);
2575
+ }, vt = (e, t) => (n, o) => t(n, o, e);
2576
2576
  const Hi = "default-paste-formula";
2577
- let Lt = class extends ut {
2577
+ let Vt = class extends at {
2578
2578
  constructor(e, t, n, o, r) {
2579
2579
  super(), this._currentUniverSheet = e, this._lexerTreeBuilder = t, this._sheetClipboardService = n, this._injector = o, this._formulaDataModel = r, this._initialize();
2580
2580
  }
@@ -2586,7 +2586,7 @@ let Lt = class extends ut {
2586
2586
  }
2587
2587
  _pasteFormulaHook() {
2588
2588
  return {
2589
- id: ot.SPECIAL_PASTE_FORMULA,
2589
+ id: nt.SPECIAL_PASTE_FORMULA,
2590
2590
  priority: 10,
2591
2591
  specialPasteInfo: { label: "specialPaste.formula" },
2592
2592
  onPasteCells: (e, t, n, o) => this._onPasteCells(e, t, n, o, !0)
@@ -2602,21 +2602,21 @@ let Lt = class extends ut {
2602
2602
  _onPasteCells(e, t, n, o, r) {
2603
2603
  var u;
2604
2604
  if ([
2605
- ot.SPECIAL_PASTE_FORMAT,
2606
- ot.SPECIAL_PASTE_COL_WIDTH
2605
+ nt.SPECIAL_PASTE_FORMAT,
2606
+ nt.SPECIAL_PASTE_COL_WIDTH
2607
2607
  ].includes(o.pasteType))
2608
2608
  return {
2609
2609
  undos: [],
2610
2610
  redos: []
2611
2611
  };
2612
- const c = this._currentUniverSheet.getCurrentUnitForType(j.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((u = c.getActiveSheet()) == null ? void 0 : u.getSheetId());
2612
+ const c = this._currentUniverSheet.getCurrentUnitForType(q.UNIVER_SHEET), i = t.unitId || c.getUnitId(), l = t.subUnitId || ((u = c.getActiveSheet()) == null ? void 0 : u.getSheetId());
2613
2613
  if (!i || !l)
2614
2614
  return {
2615
2615
  undos: [],
2616
2616
  redos: []
2617
2617
  };
2618
- const f = t.range, h = n, m = {
2619
- copyType: o.copyType || tr.COPY,
2618
+ const f = t.range, h = n, g = {
2619
+ copyType: o.copyType || sr.COPY,
2620
2620
  copyRange: e == null ? void 0 : e.range,
2621
2621
  pasteType: o.pasteType
2622
2622
  };
@@ -2626,7 +2626,7 @@ let Lt = class extends ut {
2626
2626
  f,
2627
2627
  h,
2628
2628
  d,
2629
- m,
2629
+ g,
2630
2630
  this._lexerTreeBuilder,
2631
2631
  this._formulaDataModel,
2632
2632
  r,
@@ -2634,15 +2634,15 @@ let Lt = class extends ut {
2634
2634
  ));
2635
2635
  }
2636
2636
  };
2637
- Lt = Wi([
2638
- pt(0, ee),
2639
- pt(1, B(_e)),
2640
- pt(2, _o),
2641
- pt(3, B(_t)),
2642
- pt(4, B(It))
2643
- ], Lt);
2637
+ Vt = Wi([
2638
+ vt(0, te),
2639
+ vt(1, j(Ie)),
2640
+ vt(2, _o),
2641
+ vt(3, j(Rt)),
2642
+ vt(4, j(bt))
2643
+ ], Vt);
2644
2644
  function Bi(e, t, n, o, r, s, c, i, l = !1, f) {
2645
- const h = [], m = [], u = ji(e, t, n, o, s, c, i, f);
2645
+ const h = [], g = [], u = ji(e, t, n, o, s, c, i, f);
2646
2646
  if (!u.hasValue())
2647
2647
  return {
2648
2648
  undos: [],
@@ -2654,82 +2654,82 @@ function Bi(e, t, n, o, r, s, c, i, l = !1, f) {
2654
2654
  cellValue: u.getData()
2655
2655
  };
2656
2656
  h.push({
2657
- id: wt.id,
2657
+ id: Dt.id,
2658
2658
  params: d
2659
2659
  });
2660
2660
  const a = ts(
2661
2661
  r,
2662
2662
  d
2663
2663
  );
2664
- return m.push({
2665
- id: wt.id,
2664
+ return g.push({
2665
+ id: Dt.id,
2666
2666
  params: a
2667
2667
  }), {
2668
- undos: m,
2668
+ undos: g,
2669
2669
  redos: h
2670
2670
  };
2671
2671
  }
2672
2672
  function ji(e, t, n, o, r, s, c, i) {
2673
- return i ? r.pasteType === ot.SPECIAL_PASTE_VALUE ? Ki(e, t, n, o, c, i) : r.pasteType === ot.SPECIAL_PASTE_FORMULA ? Yi(e, t, n, o, s, c, i) : Gi(e, t, n, o, r.copyType, s, c, i) : qi(e, t, n, o, c);
2673
+ return i ? r.pasteType === nt.SPECIAL_PASTE_VALUE ? Ki(e, t, n, o, c, i) : r.pasteType === nt.SPECIAL_PASTE_FORMULA ? Yi(e, t, n, o, s, c, i) : Gi(e, t, n, o, r.copyType, s, c, i) : qi(e, t, n, o, c);
2674
2674
  }
2675
2675
  function qi(e, t, n, o, r) {
2676
- const s = new Fe(), c = r.getSheetFormulaData(e, t);
2676
+ const s = new De(), c = r.getSheetFormulaData(e, t);
2677
2677
  return o.forValue((i, l, f) => {
2678
2678
  var d;
2679
- const h = n.rows[i], m = n.cols[l], u = {};
2680
- ye(f.v) ? (u.v = null, u.f = `${f.v}`, u.si = null, u.p = null, s.setValue(h, m, u)) : (d = c == null ? void 0 : c[h]) != null && d[m] && (u.v = f.v, u.f = null, u.si = null, u.p = null, s.setValue(h, m, u));
2679
+ const h = n.rows[i], g = n.cols[l], u = {};
2680
+ ye(f.v) ? (u.v = null, u.f = `${f.v}`, u.si = null, u.p = null, s.setValue(h, g, u)) : (d = c == null ? void 0 : c[h]) != null && d[g] && (u.v = f.v, u.f = null, u.si = null, u.p = null, s.setValue(h, g, u));
2681
2681
  }), s;
2682
2682
  }
2683
2683
  function Ki(e, t, n, o, r, s) {
2684
2684
  var f, h;
2685
- const c = new Fe(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId], l = r.getSheetFormulaData(e, t);
2686
- return o.forValue((m, u, d) => {
2685
+ const c = new De(), i = (h = (f = r.getArrayFormulaCellData()) == null ? void 0 : f[s.unitId]) == null ? void 0 : h[s.subUnitId], l = r.getSheetFormulaData(e, t);
2686
+ return o.forValue((g, u, d) => {
2687
2687
  var _, R;
2688
- const a = s.range.rows[m % s.range.rows.length], v = s.range.cols[u % s.range.cols.length], g = n.rows[m], p = n.cols[u], S = {};
2689
- if (ye(d.f) || Be(d.si))
2690
- S.v = d.v, S.f = null, S.si = null, S.p = null, c.setValue(g, p, S);
2688
+ const a = s.range.rows[g % s.range.rows.length], v = s.range.cols[u % s.range.cols.length], m = n.rows[g], p = n.cols[u], C = {};
2689
+ if (ye(d.f) || He(d.si))
2690
+ C.v = d.v, C.f = null, C.si = null, C.p = null, c.setValue(m, p, C);
2691
2691
  else if ((_ = i == null ? void 0 : i[a]) != null && _[v]) {
2692
- const C = i[a][v];
2693
- S.v = C.v, S.f = null, S.si = null, S.p = null, c.setValue(g, p, S);
2694
- } else if ((R = l == null ? void 0 : l[g]) != null && R[p]) {
2695
- if (S.v = d.v, S.f = null, S.si = null, S.p = null, d.p) {
2696
- const C = Mr(d);
2697
- C && (S.v = C);
2692
+ const S = i[a][v];
2693
+ C.v = S.v, C.f = null, C.si = null, C.p = null, c.setValue(m, p, C);
2694
+ } else if ((R = l == null ? void 0 : l[m]) != null && R[p]) {
2695
+ if (C.v = d.v, C.f = null, C.si = null, C.p = null, d.p) {
2696
+ const S = Fr(d);
2697
+ S && (C.v = S);
2698
2698
  }
2699
- c.setValue(g, p, S);
2699
+ c.setValue(m, p, C);
2700
2700
  }
2701
2701
  }), c;
2702
2702
  }
2703
2703
  function Yi(e, t, n, o, r, s, c) {
2704
- const i = new Fe(), l = /* @__PURE__ */ new Map();
2705
- return o.forValue((f, h, m) => {
2704
+ const i = new De(), l = /* @__PURE__ */ new Map();
2705
+ return o.forValue((f, h, g) => {
2706
2706
  const u = n.rows[f], d = n.cols[h], a = {};
2707
- if (Be(m.si)) {
2707
+ if (He(g.si)) {
2708
2708
  if (c.unitId !== e || c.subUnitId !== t) {
2709
2709
  const v = s.getFormulaStringByCell(
2710
2710
  c.range.rows[f % c.range.rows.length],
2711
2711
  c.range.cols[h % c.range.cols.length],
2712
2712
  c.subUnitId,
2713
2713
  c.unitId
2714
- ), g = n.cols[h] - c.range.cols[h % c.range.cols.length], p = n.rows[f] - c.range.rows[f % c.range.rows.length], S = r.moveFormulaRefOffset(v || "", g, p);
2715
- a.si = null, a.f = S;
2714
+ ), m = n.cols[h] - c.range.cols[h % c.range.cols.length], p = n.rows[f] - c.range.rows[f % c.range.rows.length], C = r.moveFormulaRefOffset(v || "", m, p);
2715
+ a.si = null, a.f = C;
2716
2716
  } else
2717
- a.si = m.si, a.f = null;
2717
+ a.si = g.si, a.f = null;
2718
2718
  a.v = null, a.p = null, i.setValue(u, d, a);
2719
- } else if (ye(m.f)) {
2719
+ } else if (ye(g.f)) {
2720
2720
  const v = `${f % c.range.rows.length}_${h % c.range.cols.length}`;
2721
- let g = l.get(v);
2722
- if (g)
2723
- a.si = g, a.f = null;
2721
+ let m = l.get(v);
2722
+ if (m)
2723
+ a.si = m, a.f = null;
2724
2724
  else {
2725
- g = it.generateRandomId(6), l.set(v, g);
2726
- const p = n.cols[h] - c.range.cols[h % c.range.cols.length], S = n.rows[f] - c.range.rows[f % c.range.rows.length], _ = r.moveFormulaRefOffset(m.f || "", p, S);
2727
- a.si = g, a.f = _;
2725
+ m = ot.generateRandomId(6), l.set(v, m);
2726
+ const p = n.cols[h] - c.range.cols[h % c.range.cols.length], C = n.rows[f] - c.range.rows[f % c.range.rows.length], _ = r.moveFormulaRefOffset(g.f || "", p, C);
2727
+ a.si = m, a.f = _;
2728
2728
  }
2729
2729
  a.v = null, a.p = null, i.setValue(u, d, a);
2730
2730
  } else {
2731
- if (a.v = m.v, a.f = null, a.si = null, a.p = null, m.p) {
2732
- const v = Mr(m);
2731
+ if (a.v = g.v, a.f = null, a.si = null, a.p = null, g.p) {
2732
+ const v = Fr(g);
2733
2733
  v && (a.v = v);
2734
2734
  }
2735
2735
  i.setValue(u, d, a);
@@ -2737,54 +2737,54 @@ function Yi(e, t, n, o, r, s, c) {
2737
2737
  }), i;
2738
2738
  }
2739
2739
  function Gi(e, t, n, o, r, s, c, i) {
2740
- const l = new Fe(), f = /* @__PURE__ */ new Map(), h = c.getSheetFormulaData(e, t), m = [];
2741
- return r === tr.CUT ? o.forValue((u, d, a) => {
2742
- const v = n.rows[u], g = n.cols[d], p = {};
2743
- if (Be(a.si)) {
2740
+ const l = new De(), f = /* @__PURE__ */ new Map(), h = c.getSheetFormulaData(e, t), g = [];
2741
+ return r === sr.CUT ? o.forValue((u, d, a) => {
2742
+ const v = n.rows[u], m = n.cols[d], p = {};
2743
+ if (He(a.si)) {
2744
2744
  if (ye(a.f))
2745
- m.push(a.si), p.f = a.f, p.si = a.si;
2746
- else if (m.includes(a.si))
2745
+ g.push(a.si), p.f = a.f, p.si = a.si;
2746
+ else if (g.includes(a.si))
2747
2747
  p.f = null, p.si = a.si;
2748
2748
  else {
2749
- const S = c.getFormulaStringByCell(
2749
+ const C = c.getFormulaStringByCell(
2750
2750
  i.range.rows[u % i.range.rows.length],
2751
2751
  i.range.cols[d % i.range.cols.length],
2752
2752
  i.subUnitId,
2753
2753
  i.unitId
2754
2754
  );
2755
- p.f = S, p.si = null;
2755
+ p.f = C, p.si = null;
2756
2756
  }
2757
- p.v = null, p.p = null, l.setValue(v, g, p);
2758
- } else ye(a.f) && (p.f = a.f, p.si = null, p.v = null, p.p = null, l.setValue(v, g, p));
2757
+ p.v = null, p.p = null, l.setValue(v, m, p);
2758
+ } else ye(a.f) && (p.f = a.f, p.si = null, p.v = null, p.p = null, l.setValue(v, m, p));
2759
2759
  }) : o.forValue((u, d, a) => {
2760
- var S;
2761
- const v = n.rows[u], g = n.cols[d], p = {};
2762
- if (Be(a.si)) {
2760
+ var C;
2761
+ const v = n.rows[u], m = n.cols[d], p = {};
2762
+ if (He(a.si)) {
2763
2763
  if (i.unitId !== e || i.subUnitId !== t) {
2764
2764
  const _ = c.getFormulaStringByCell(
2765
2765
  i.range.rows[u % i.range.rows.length],
2766
2766
  i.range.cols[d % i.range.cols.length],
2767
2767
  i.subUnitId,
2768
2768
  i.unitId
2769
- ), R = n.cols[d] - i.range.cols[d % i.range.cols.length], C = n.rows[u] - i.range.rows[u % i.range.rows.length], y = s.moveFormulaRefOffset(_ || "", R, C);
2769
+ ), R = n.cols[d] - i.range.cols[d % i.range.cols.length], S = n.rows[u] - i.range.rows[u % i.range.rows.length], y = s.moveFormulaRefOffset(_ || "", R, S);
2770
2770
  p.si = null, p.f = y;
2771
2771
  } else
2772
2772
  p.si = a.si, p.f = null;
2773
- p.v = null, p.p = null, l.setValue(v, g, p);
2773
+ p.v = null, p.p = null, l.setValue(v, m, p);
2774
2774
  } else if (ye(a.f)) {
2775
2775
  const _ = `${u % i.range.rows.length}_${d % i.range.cols.length}`;
2776
2776
  let R = f.get(_);
2777
2777
  if (R)
2778
2778
  p.si = R, p.f = null;
2779
2779
  else {
2780
- R = it.generateRandomId(6), f.set(_, R);
2781
- const C = n.cols[d] - i.range.cols[d % i.range.cols.length], y = n.rows[u] - i.range.rows[u % i.range.rows.length], N = s.moveFormulaRefOffset(a.f || "", C, y);
2780
+ R = ot.generateRandomId(6), f.set(_, R);
2781
+ const S = n.cols[d] - i.range.cols[d % i.range.cols.length], y = n.rows[u] - i.range.rows[u % i.range.rows.length], N = s.moveFormulaRefOffset(a.f || "", S, y);
2782
2782
  p.si = R, p.f = N;
2783
2783
  }
2784
- p.v = null, p.p = null, l.setValue(v, g, p);
2785
- } else (S = h == null ? void 0 : h[v]) != null && S[g] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, l.setValue(v, g, p));
2786
- }), m.length > 0 && new Fe(h).forValue((u, d, a) => {
2787
- if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && m.includes(a == null ? void 0 : a.si)) {
2784
+ p.v = null, p.p = null, l.setValue(v, m, p);
2785
+ } else (C = h == null ? void 0 : h[v]) != null && C[m] && (p.v = a.v, p.f = null, p.si = null, p.p = a.p, l.setValue(v, m, p));
2786
+ }), g.length > 0 && new De(h).forValue((u, d, a) => {
2787
+ if (!(i.range.rows.includes(u) && i.range.cols.includes(d)) && !(n.rows.includes(u) && n.cols.includes(d)) && g.includes(a == null ? void 0 : a.si)) {
2788
2788
  const v = c.getFormulaStringByCell(
2789
2789
  u,
2790
2790
  d,
@@ -2800,25 +2800,25 @@ function Gi(e, t, n, o, r, s, c, i) {
2800
2800
  }
2801
2801
  }), l;
2802
2802
  }
2803
- function Mr(e) {
2803
+ function Fr(e) {
2804
2804
  if (e != null && e.p) {
2805
2805
  const t = e == null ? void 0 : e.p.body;
2806
2806
  if (t == null)
2807
2807
  return;
2808
2808
  const n = t.dataStream;
2809
- return n.substring(n.length - 2, n.length) === zn ? n.substring(0, n.length - 2) : n;
2809
+ return n.substring(n.length - 2, n.length) === er ? n.substring(0, n.length - 2) : n;
2810
2810
  }
2811
2811
  }
2812
2812
  var Zi = Object.getOwnPropertyDescriptor, zi = (e, t, n, o) => {
2813
2813
  for (var r = o > 1 ? void 0 : o ? Zi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2814
2814
  (c = e[s]) && (r = c(r) || r);
2815
2815
  return r;
2816
- }, Ve = (e, t) => (n, o) => t(n, o, e);
2817
- let $t = class extends ut {
2816
+ }, Ue = (e, t) => (n, o) => t(n, o, e);
2817
+ let Wt = class extends at {
2818
2818
  constructor(t, n, o, r, s, c, i, l) {
2819
2819
  super();
2820
- q(this, "_previousShape");
2821
- q(this, "_skeleton");
2820
+ K(this, "_previousShape");
2821
+ K(this, "_skeleton");
2822
2822
  this._context = t, this._sheetInterceptorService = n, this._formulaDataModel = o, this._themeService = r, this._renderManagerService = s, this._sheetSkeletonManagerService = c, this._commandService = i, this._logService = l, this._initSkeletonChangeListener(), this._initInterceptorEditorStart(), this._commandExecutedListener();
2823
2823
  }
2824
2824
  _initSkeletonChangeListener() {
@@ -2844,19 +2844,19 @@ let $t = class extends ut {
2844
2844
  }
2845
2845
  _initInterceptorEditorStart() {
2846
2846
  this.disposeWithMe(
2847
- Xn(
2847
+ tr(
2848
2848
  this._sheetInterceptorService.writeCellInterceptor.intercept(ns, {
2849
2849
  handler: (t, n, o) => {
2850
- var a, v, g, p;
2850
+ var a, v, m, p;
2851
2851
  const { row: r, col: s, unitId: c, subUnitId: i, worksheet: l } = n, f = this._formulaDataModel.getArrayFormulaRange(), h = this._formulaDataModel.getArrayFormulaCellData();
2852
2852
  if (this._removeArrayFormulaRangeShape(), t == null)
2853
2853
  return o(t);
2854
- let m = null;
2854
+ let g = null;
2855
2855
  const u = this._formulaDataModel.getFormulaStringByCell(r, s, i, c);
2856
- if (u !== null && (m = { f: u }), t.v != null && t.v !== "" && ((g = (v = (a = h[c]) == null ? void 0 : a[i]) == null ? void 0 : v[r]) == null ? void 0 : g[s]) == null)
2857
- return m ? { ...t, ...m } : o(t);
2856
+ if (u !== null && (g = { f: u }), t.v != null && t.v !== "" && ((m = (v = (a = h[c]) == null ? void 0 : a[i]) == null ? void 0 : v[r]) == null ? void 0 : m[s]) == null)
2857
+ return g ? { ...t, ...g } : o(t);
2858
2858
  const d = (p = f == null ? void 0 : f[c]) == null ? void 0 : p[i];
2859
- return d != null && (m = this._displayArrayFormulaRangeShape(d, r, s, c, i, l, m)), m ? { ...t, ...m } : o(t);
2859
+ return d != null && (g = this._displayArrayFormulaRangeShape(d, r, s, c, i, l, g)), g ? { ...t, ...g } : o(t);
2860
2860
  }
2861
2861
  })
2862
2862
  )
@@ -2876,22 +2876,22 @@ let $t = class extends ut {
2876
2876
  }
2877
2877
  _displayArrayFormulaRangeShape(t, n, o, r, s, c, i) {
2878
2878
  const l = this._formulaDataModel.getSheetFormulaData(r, s);
2879
- return new Fe(t).forValue((f, h, m) => {
2880
- var g;
2881
- if (m == null)
2879
+ return new De(t).forValue((f, h, g) => {
2880
+ var m;
2881
+ if (g == null)
2882
2882
  return !0;
2883
- const { startRow: u, startColumn: d, endRow: a, endColumn: v } = m;
2883
+ const { startRow: u, startColumn: d, endRow: a, endColumn: v } = g;
2884
2884
  if (f === n && h === o)
2885
- return this._createArrayFormulaRangeShape(m, r), !1;
2885
+ return this._createArrayFormulaRangeShape(g, r), !1;
2886
2886
  if (n >= u && n <= a && o >= d && o <= v) {
2887
2887
  const p = c.getCell(u, d);
2888
- if ((p == null ? void 0 : p.v) === ce.SPILL)
2888
+ if ((p == null ? void 0 : p.v) === ae.SPILL)
2889
2889
  return;
2890
- const S = (g = l == null ? void 0 : l[f]) == null ? void 0 : g[h];
2891
- return S == null || S.f == null ? !0 : (i == null && (i = {
2892
- f: S.f,
2890
+ const C = (m = l == null ? void 0 : l[f]) == null ? void 0 : m[h];
2891
+ return C == null || C.f == null ? !0 : (i == null && (i = {
2892
+ f: C.f,
2893
2893
  isInArrayFormulaRange: !0
2894
- }), this._createArrayFormulaRangeShape(m, r), !1);
2894
+ }), this._createArrayFormulaRangeShape(g, r), !1);
2895
2895
  }
2896
2896
  }), i;
2897
2897
  }
@@ -2906,10 +2906,10 @@ let $t = class extends ut {
2906
2906
  style: {
2907
2907
  strokeWidth: 1,
2908
2908
  stroke: this._themeService.getColorFromTheme("primary.600"),
2909
- fill: new cn(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
2909
+ fill: new un(this._themeService.getColorFromTheme("white")).setAlpha(0).toString(),
2910
2910
  widgets: {}
2911
2911
  }
2912
- }, i = Qt(c, r), { rowHeaderWidth: l, columnHeaderHeight: f } = r, h = new er(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
2912
+ }, i = tn(c, r), { rowHeaderWidth: l, columnHeaderHeight: f } = r, h = new or(s, Ro.FORMULA_EDITOR_SHOW, this._themeService, {
2913
2913
  highlightHeader: !1,
2914
2914
  rowHeaderWidth: l,
2915
2915
  columnHeaderHeight: f
@@ -2952,27 +2952,27 @@ let $t = class extends ut {
2952
2952
  }
2953
2953
  }
2954
2954
  };
2955
- $t = zi([
2956
- Ve(1, B(hn)),
2957
- Ve(2, B(It)),
2958
- Ve(3, B(Rt)),
2959
- Ve(4, Oe),
2960
- Ve(5, B(Wt)),
2961
- Ve(6, de),
2962
- Ve(7, Jr)
2963
- ], $t);
2955
+ Wt = zi([
2956
+ Ue(1, j(mn)),
2957
+ Ue(2, j(bt)),
2958
+ Ue(3, j(It)),
2959
+ Ue(4, Oe),
2960
+ Ue(5, j(qt)),
2961
+ Ue(6, fe),
2962
+ Ue(7, Jr)
2963
+ ], Wt);
2964
2964
  var Xi = Object.getOwnPropertyDescriptor, Qi = (e, t, n, o) => {
2965
2965
  for (var r = o > 1 ? void 0 : o ? Xi(t, n) : t, s = e.length - 1, c; s >= 0; s--)
2966
2966
  (c = e[s]) && (r = c(r) || r);
2967
2967
  return r;
2968
- }, Yn = (e, t) => (n, o) => t(n, o, e);
2968
+ }, Xn = (e, t) => (n, o) => t(n, o, e);
2969
2969
  const Ji = {
2970
2970
  tl: {
2971
2971
  size: 6,
2972
2972
  color: "#409f11"
2973
2973
  }
2974
2974
  };
2975
- let Pt = class extends eo {
2975
+ let Ht = class extends eo {
2976
2976
  constructor(e, t) {
2977
2977
  super(), this._sheetInterceptorService = e, this._formulaDataModel = t, this.disposeWithMe(this._sheetInterceptorService.intercept(
2978
2978
  os.CELL_CONTENT,
@@ -2981,7 +2981,7 @@ let Pt = class extends eo {
2981
2981
  handler: (n, o, r) => {
2982
2982
  var i, l, f, h;
2983
2983
  const s = (h = (f = (l = (i = this._formulaDataModel.getArrayFormulaCellData()) == null ? void 0 : i[o.unitId]) == null ? void 0 : l[o.subUnitId]) == null ? void 0 : f[o.row]) == null ? void 0 : h[o.col];
2984
- return !Nr(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
2984
+ return !Ar(n, !!s) || !n || (n === o.rawData && (n = { ...o.rawData }), n.markers = {
2985
2985
  ...n == null ? void 0 : n.markers,
2986
2986
  ...Ji
2987
2987
  }), r(n);
@@ -2991,19 +2991,19 @@ let Pt = class extends eo {
2991
2991
  ));
2992
2992
  }
2993
2993
  };
2994
- Pt = Qi([
2995
- Yn(0, B(hn)),
2996
- Yn(1, B(It))
2997
- ], Pt);
2994
+ Ht = Qi([
2995
+ Xn(0, j(mn)),
2996
+ Xn(1, j(bt))
2997
+ ], Ht);
2998
2998
  function ec() {
2999
- const e = T(is), t = T(de), n = ge(e.progress$), o = kt(() => {
2999
+ const e = T(is), t = T(fe), n = ve(e.progress$), o = Lt(() => {
3000
3000
  t.executeCommand(Lo.id);
3001
- }, [t]), r = kt(() => {
3001
+ }, [t]), r = Lt(() => {
3002
3002
  e.clearProgress();
3003
3003
  }, [e]);
3004
3004
  return /* @__PURE__ */ O(hs, { progress: n, onTerminate: o, onClearProgress: r });
3005
3005
  }
3006
- function wr(e) {
3006
+ function Dr(e) {
3007
3007
  const { prefix: t, value: n } = e;
3008
3008
  return /* @__PURE__ */ W("div", { children: [
3009
3009
  /* @__PURE__ */ W("span", { children: [
@@ -3011,13 +3011,13 @@ function wr(e) {
3011
3011
  "("
3012
3012
  ] }),
3013
3013
  n && n.map((o, r) => /* @__PURE__ */ W("span", { children: [
3014
- /* @__PURE__ */ O("span", { children: Ir(o) }),
3014
+ /* @__PURE__ */ O("span", { children: xr(o) }),
3015
3015
  r === n.length - 1 ? "" : ","
3016
3016
  ] }, r)),
3017
3017
  ")"
3018
3018
  ] });
3019
3019
  }
3020
- function vt(e) {
3020
+ function St(e) {
3021
3021
  const { className: t, value: n, title: o } = e;
3022
3022
  return /* @__PURE__ */ W("div", { className: "univer-mb-2 univer-text-xs", children: [
3023
3023
  /* @__PURE__ */ O(
@@ -3041,81 +3041,81 @@ function tc(e) {
3041
3041
  if (!t) return null;
3042
3042
  const [o, r] = V([]), [s, c] = V(t.functionParameter), [i, l] = V(-1);
3043
3043
  return /* @__PURE__ */ W("div", { children: [
3044
- /* @__PURE__ */ O("div", { className: re("univer-h-[364px] univer-overflow-y-auto", at), children: s.map((f, h) => /* @__PURE__ */ W("div", { children: [
3044
+ /* @__PURE__ */ O("div", { className: re("univer-h-[364px] univer-overflow-y-auto", it), children: s.map((f, h) => /* @__PURE__ */ W("div", { children: [
3045
3045
  /* @__PURE__ */ O("div", { className: "univer-text-sm", children: f.name }),
3046
3046
  /* @__PURE__ */ O("div", { className: "univer-mb-2 univer-mt-1" })
3047
3047
  ] }, h)) }),
3048
3048
  /* @__PURE__ */ O("div", { className: re("univer-flex-1 univer-p-3", Cs), children: /* @__PURE__ */ O(
3049
- vt,
3049
+ St,
3050
3050
  {
3051
- title: i === -1 ? /* @__PURE__ */ O(wr, { prefix: t.functionName, value: s }) : s[i].name,
3051
+ title: i === -1 ? /* @__PURE__ */ O(Dr, { prefix: t.functionName, value: s }) : s[i].name,
3052
3052
  value: i === -1 ? t.description : s[i].detail
3053
3053
  }
3054
3054
  ) })
3055
3055
  ] });
3056
3056
  }
3057
3057
  function nc(e) {
3058
- const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [f, h] = V(n), [m, u] = V(0), [d, a] = V(null), v = T(Bt), g = T(lt), p = T(fn), S = ge(p.sidebarOptions$), _ = qs($o, g);
3058
+ const { onChange: t } = e, n = "-1", [o, r] = V(""), [s, c] = V([]), [i, l] = V(0), [f, h] = V(n), [g, u] = V(0), [d, a] = V(null), v = T(Yt), m = T(ct), p = T(pn), C = ve(p.sidebarOptions$), _ = qs($o, m);
3059
3059
  _.unshift({
3060
- label: g.t("formula.moreFunctions.allFunctions"),
3060
+ label: m.t("formula.moreFunctions.allFunctions"),
3061
3061
  value: n
3062
3062
  });
3063
- const R = g.t("formula.prompt.required"), C = g.t("formula.prompt.optional");
3063
+ const R = m.t("formula.prompt.required"), S = m.t("formula.prompt.optional");
3064
3064
  $(() => {
3065
3065
  A(n);
3066
3066
  }, []), $(() => {
3067
3067
  N(0);
3068
3068
  }, [s]), $(() => {
3069
- S != null && S.visible && (r(""), c([]), l(0), h(n), u(0), a(null), A(n));
3070
- }, [S]);
3069
+ C != null && C.visible && (r(""), c([]), l(0), h(n), u(0), a(null), A(n));
3070
+ }, [C]);
3071
3071
  const y = (b) => {
3072
3072
  if (o.trim() === "") return b;
3073
- const E = new RegExp(`(${o.toLocaleUpperCase()})`);
3074
- return b.split(E).filter(Boolean).map((k, D) => k.match(E) ? /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: k }, D) : k);
3073
+ const I = new RegExp(`(${o.toLocaleUpperCase()})`);
3074
+ return b.split(I).filter(Boolean).map((M, D) => M.match(I) ? /* @__PURE__ */ O("span", { className: "univer-text-red-500", children: M }, D) : M);
3075
3075
  }, N = (b) => {
3076
3076
  if (s.length === 0) {
3077
3077
  a(null);
3078
3078
  return;
3079
3079
  }
3080
3080
  u(b);
3081
- const E = v.getFunctionInfo(s[b].name);
3082
- if (!E) {
3081
+ const I = v.getFunctionInfo(s[b].name);
3082
+ if (!I) {
3083
3083
  a(null);
3084
3084
  return;
3085
3085
  }
3086
- a(E), t(E);
3086
+ a(I), t(I);
3087
3087
  };
3088
3088
  function A(b) {
3089
3089
  h(b);
3090
- const E = v.getSearchListByType(+b);
3091
- c(E);
3090
+ const I = v.getSearchListByType(+b);
3091
+ c(I);
3092
3092
  }
3093
3093
  function F(b) {
3094
3094
  r(b);
3095
- const E = v.getSearchListByName(b);
3096
- c(E);
3095
+ const I = v.getSearchListByName(b);
3096
+ c(I);
3097
3097
  }
3098
3098
  function x(b) {
3099
3099
  if (b.stopPropagation(), b.key === "ArrowDown") {
3100
- const E = i + 1;
3101
- l(E === s.length ? 0 : E);
3100
+ const I = i + 1;
3101
+ l(I === s.length ? 0 : I);
3102
3102
  } else if (b.key === "ArrowUp") {
3103
- const E = i - 1;
3104
- l(E === -1 ? s.length - 1 : E);
3103
+ const I = i - 1;
3104
+ l(I === -1 ? s.length - 1 : I);
3105
3105
  } else b.key === "Enter" && N(i);
3106
3106
  }
3107
- const w = (b) => {
3107
+ const k = (b) => {
3108
3108
  l(b);
3109
- }, M = () => {
3109
+ }, w = () => {
3110
3110
  l(-1);
3111
3111
  };
3112
3112
  return /* @__PURE__ */ W("div", { children: [
3113
3113
  /* @__PURE__ */ W("div", { className: "univer-flex univer-items-center univer-justify-between univer-gap-2", children: [
3114
3114
  /* @__PURE__ */ O(_s, { value: f, options: _, onChange: A }),
3115
3115
  /* @__PURE__ */ O(
3116
- ur,
3116
+ gr,
3117
3117
  {
3118
- placeholder: g.t("formula.moreFunctions.searchFunctionPlaceholder"),
3118
+ placeholder: m.t("formula.moreFunctions.searchFunctionPlaceholder"),
3119
3119
  onKeyDown: x,
3120
3120
  value: o,
3121
3121
  onChange: F,
@@ -3127,21 +3127,21 @@ function nc(e) {
3127
3127
  s.length > 0 && /* @__PURE__ */ O(
3128
3128
  "ul",
3129
3129
  {
3130
- className: re("univer-m-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", gn, at),
3130
+ className: re("univer-m-0 univer-mt-2 univer-box-border univer-max-h-72 univer-w-full univer-select-none univer-list-none univer-overflow-y-auto univer-rounded univer-p-3 univer-outline-none", vn, it),
3131
3131
  onKeyDown: x,
3132
3132
  tabIndex: -1,
3133
- children: s.map(({ name: b }, E) => /* @__PURE__ */ W(
3133
+ children: s.map(({ name: b }, I) => /* @__PURE__ */ W(
3134
3134
  "li",
3135
3135
  {
3136
3136
  className: re("univer-relative univer-box-border univer-cursor-pointer univer-rounded univer-px-7 univer-py-1 univer-text-sm univer-text-gray-900 univer-transition-colors dark:!univer-text-white", {
3137
- "univer-bg-gray-200 dark:!univer-bg-gray-600": i === E
3137
+ "univer-bg-gray-200 dark:!univer-bg-gray-600": i === I
3138
3138
  }),
3139
- onMouseEnter: () => w(E),
3140
- onMouseLeave: M,
3141
- onClick: () => N(E),
3139
+ onMouseEnter: () => k(I),
3140
+ onMouseLeave: w,
3141
+ onClick: () => N(I),
3142
3142
  children: [
3143
- m === E && /* @__PURE__ */ O(
3144
- vr,
3143
+ g === I && /* @__PURE__ */ O(
3144
+ Rr,
3145
3145
  {
3146
3146
  className: "univer-absolute univer-left-1.5 univer-top-1/2 univer-inline-flex -univer-translate-y-1/2 univer-text-base univer-text-primary-600"
3147
3147
  }
@@ -3149,31 +3149,31 @@ function nc(e) {
3149
3149
  /* @__PURE__ */ O("span", { className: "univer-block", children: y(b) })
3150
3150
  ]
3151
3151
  },
3152
- E
3152
+ I
3153
3153
  ))
3154
3154
  }
3155
3155
  ),
3156
- d && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-max-h-80 univer-overflow-y-auto", at), children: [
3157
- /* @__PURE__ */ O(vt, { title: d.functionName, value: d.description }),
3156
+ d && /* @__PURE__ */ W("div", { className: re("univer-mx-0 univer-my-2 univer-overflow-y-auto", it), children: [
3157
+ /* @__PURE__ */ O(St, { title: d.functionName, value: d.description }),
3158
3158
  /* @__PURE__ */ O(
3159
- vt,
3159
+ St,
3160
3160
  {
3161
- title: g.t("formula.moreFunctions.syntax"),
3162
- value: /* @__PURE__ */ O(wr, { prefix: d.functionName, value: d.functionParameter })
3161
+ title: m.t("formula.moreFunctions.syntax"),
3162
+ value: /* @__PURE__ */ O(Dr, { prefix: d.functionName, value: d.functionParameter })
3163
3163
  }
3164
3164
  ),
3165
3165
  /* @__PURE__ */ O(
3166
- vt,
3166
+ St,
3167
3167
  {
3168
- title: g.t("formula.prompt.helpExample"),
3168
+ title: m.t("formula.prompt.helpExample"),
3169
3169
  value: `${d.functionName}(${d.functionParameter.map((b) => b.example).join(",")})`
3170
3170
  }
3171
3171
  ),
3172
3172
  d.functionParameter && d.functionParameter.map((b) => /* @__PURE__ */ O(
3173
- vt,
3173
+ St,
3174
3174
  {
3175
3175
  title: b.name,
3176
- value: `${b.require ? R : C} ${b.detail}`
3176
+ value: `${b.require ? R : S} ${b.detail}`
3177
3177
  },
3178
3178
  b.name
3179
3179
  ))
@@ -3181,45 +3181,45 @@ function nc(e) {
3181
3181
  ] });
3182
3182
  }
3183
3183
  function rc() {
3184
- const e = Eo(), [t, n] = V(!0), [o, r] = V(!1), [s, c] = V(null);
3185
- T(an);
3186
- const i = T(lt), l = T(qe), f = T(ee), h = T(de);
3187
- function m() {
3184
+ const e = Io(), [t, n] = V(!0), [o, r] = V(!1), [s, c] = V(null);
3185
+ T(dn);
3186
+ const i = T(ct), l = T(je), f = T(te), h = T(fe);
3187
+ function g() {
3188
3188
  n(!t), r(!o);
3189
3189
  }
3190
3190
  function u() {
3191
- const d = ir(f);
3191
+ const d = ur(f);
3192
3192
  if (!d) return;
3193
- h.executeCommand(Qn.id, {
3193
+ h.executeCommand(nr.id, {
3194
3194
  visible: !0,
3195
3195
  unitId: d.unitId,
3196
3196
  eventType: xe.Dblclick
3197
3197
  });
3198
- const a = l.getEditor(sn), v = l.getEditor(Zn), g = `=${s == null ? void 0 : s.functionName}(`;
3199
- a == null || a.replaceText(g), v == null || v.replaceText(g, !1);
3198
+ const a = l.getEditor(ln), v = l.getEditor(Jn), m = `=${s == null ? void 0 : s.functionName}(`;
3199
+ a == null || a.replaceText(m), v == null || v.replaceText(m, !1);
3200
3200
  }
3201
3201
  return /* @__PURE__ */ W(
3202
3202
  "div",
3203
3203
  {
3204
3204
  "data-u-comp": "sheets-formula-functions-panel",
3205
- className: "univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
3205
+ className: "univer-box-border univer-flex univer-h-full univer-flex-col univer-justify-between univer-py-2",
3206
3206
  children: [
3207
3207
  t && /* @__PURE__ */ O(nc, { onChange: c }),
3208
3208
  o && /* @__PURE__ */ O(tc, { functionInfo: s, onChange: () => {
3209
3209
  } }),
3210
3210
  /* @__PURE__ */ W("div", { className: "univer-flex univer-justify-end", children: [
3211
3211
  o && /* @__PURE__ */ O(
3212
- st,
3212
+ rt,
3213
3213
  {
3214
3214
  variant: "primary",
3215
- onClick: m,
3215
+ onClick: g,
3216
3216
  className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0",
3217
3217
  children: i.t("formula.moreFunctions.next")
3218
3218
  }
3219
3219
  ),
3220
- o && /* @__PURE__ */ O(st, { onClick: m, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
3220
+ o && /* @__PURE__ */ O(rt, { onClick: g, className: "univer-mb-5 univer-ml-4 univer-mr-0 univer-mt-0", children: i.t("formula.moreFunctions.prev") }),
3221
3221
  t && !!e && /* @__PURE__ */ O(
3222
- st,
3222
+ rt,
3223
3223
  {
3224
3224
  variant: "primary",
3225
3225
  onClick: u,
@@ -3234,169 +3234,169 @@ function rc() {
3234
3234
  }
3235
3235
  function oc(e) {
3236
3236
  return {
3237
- id: fe.id,
3237
+ id: pe.id,
3238
3238
  title: "SUM",
3239
3239
  icon: "SumIcon",
3240
- type: ze.BUTTON,
3240
+ type: Ze.BUTTON,
3241
3241
  params: {
3242
3242
  value: "SUM"
3243
3243
  },
3244
- hidden$: ht(e, j.UNIVER_SHEET),
3245
- disabled$: je(e, {
3246
- workbookTypes: [Ze],
3247
- worksheetTypes: [Ye, Ke],
3248
- rangeTypes: [Ge]
3244
+ hidden$: ut(e, q.UNIVER_SHEET),
3245
+ disabled$: Be(e, {
3246
+ workbookTypes: [Ge],
3247
+ worksheetTypes: [Ke, qe],
3248
+ rangeTypes: [Ye]
3249
3249
  })
3250
3250
  };
3251
3251
  }
3252
3252
  function sc(e) {
3253
3253
  return {
3254
- id: fe.id,
3254
+ id: pe.id,
3255
3255
  title: "COUNT",
3256
3256
  icon: "CntIcon",
3257
- type: ze.BUTTON,
3257
+ type: Ze.BUTTON,
3258
3258
  params: {
3259
3259
  value: "COUNT"
3260
3260
  },
3261
- hidden$: ht(e, j.UNIVER_SHEET),
3262
- disabled$: je(e, {
3263
- workbookTypes: [Ze],
3264
- worksheetTypes: [Ye, Ke],
3265
- rangeTypes: [Ge]
3261
+ hidden$: ut(e, q.UNIVER_SHEET),
3262
+ disabled$: Be(e, {
3263
+ workbookTypes: [Ge],
3264
+ worksheetTypes: [Ke, qe],
3265
+ rangeTypes: [Ye]
3266
3266
  })
3267
3267
  };
3268
3268
  }
3269
3269
  function ic(e) {
3270
3270
  return {
3271
- id: fe.id,
3271
+ id: pe.id,
3272
3272
  title: "AVERAGE",
3273
3273
  icon: "AvgIcon",
3274
- type: ze.BUTTON,
3274
+ type: Ze.BUTTON,
3275
3275
  params: {
3276
3276
  value: "AVERAGE"
3277
3277
  },
3278
- hidden$: ht(e, j.UNIVER_SHEET),
3279
- disabled$: je(e, {
3280
- workbookTypes: [Ze],
3281
- worksheetTypes: [Ye, Ke],
3282
- rangeTypes: [Ge]
3278
+ hidden$: ut(e, q.UNIVER_SHEET),
3279
+ disabled$: Be(e, {
3280
+ workbookTypes: [Ge],
3281
+ worksheetTypes: [Ke, qe],
3282
+ rangeTypes: [Ye]
3283
3283
  })
3284
3284
  };
3285
3285
  }
3286
3286
  function cc(e) {
3287
3287
  return {
3288
- id: fe.id,
3288
+ id: pe.id,
3289
3289
  title: "MAX",
3290
3290
  icon: "MaxIcon",
3291
- type: ze.BUTTON,
3291
+ type: Ze.BUTTON,
3292
3292
  params: {
3293
3293
  value: "MAX"
3294
3294
  },
3295
- hidden$: ht(e, j.UNIVER_SHEET),
3296
- disabled$: je(e, {
3297
- workbookTypes: [Ze],
3298
- worksheetTypes: [Ye, Ke],
3299
- rangeTypes: [Ge]
3295
+ hidden$: ut(e, q.UNIVER_SHEET),
3296
+ disabled$: Be(e, {
3297
+ workbookTypes: [Ge],
3298
+ worksheetTypes: [Ke, qe],
3299
+ rangeTypes: [Ye]
3300
3300
  })
3301
3301
  };
3302
3302
  }
3303
3303
  function ac(e) {
3304
3304
  return {
3305
- id: fe.id,
3305
+ id: pe.id,
3306
3306
  title: "MIN",
3307
3307
  icon: "MinIcon",
3308
- type: ze.BUTTON,
3308
+ type: Ze.BUTTON,
3309
3309
  params: {
3310
3310
  value: "MIN"
3311
3311
  },
3312
- hidden$: ht(e, j.UNIVER_SHEET),
3313
- disabled$: je(e, {
3314
- workbookTypes: [Ze],
3315
- worksheetTypes: [Ye, Ke],
3316
- rangeTypes: [Ge]
3312
+ hidden$: ut(e, q.UNIVER_SHEET),
3313
+ disabled$: Be(e, {
3314
+ workbookTypes: [Ge],
3315
+ worksheetTypes: [Ke, qe],
3316
+ rangeTypes: [Ye]
3317
3317
  })
3318
3318
  };
3319
3319
  }
3320
3320
  function lc(e) {
3321
3321
  return {
3322
- id: vn.id,
3322
+ id: _n.id,
3323
3323
  title: "formula.insert.more",
3324
3324
  tooltip: "formula.insert.tooltip",
3325
- type: ze.BUTTON,
3326
- hidden$: ht(e, j.UNIVER_SHEET),
3327
- disabled$: je(e, {
3328
- workbookTypes: [Ze],
3329
- worksheetTypes: [Ye, Ke],
3330
- rangeTypes: [Ge]
3325
+ type: Ze.BUTTON,
3326
+ hidden$: ut(e, q.UNIVER_SHEET),
3327
+ disabled$: Be(e, {
3328
+ workbookTypes: [Ge],
3329
+ worksheetTypes: [Ke, qe],
3330
+ rangeTypes: [Ye]
3331
3331
  })
3332
3332
  };
3333
3333
  }
3334
3334
  function uc(e) {
3335
- return e.get(ee).getCurrentTypeOfUnit$(j.UNIVER_SHEET).pipe(
3336
- Bo((o) => o ? e.get(Pn) ? new jo((s) => s.next(!e.get(Pn).supportClipboard)) : kn(!0) : kn(!0))
3335
+ return e.get(te).getCurrentTypeOfUnit$(q.UNIVER_SHEET).pipe(
3336
+ Bo((o) => o ? e.get(Hn) ? new jo((s) => s.next(!e.get(Hn).supportClipboard)) : Ln(!0) : Ln(!0))
3337
3337
  );
3338
3338
  }
3339
3339
  function dc(e) {
3340
3340
  return {
3341
- id: mn.id,
3342
- type: ze.BUTTON,
3341
+ id: Sn.id,
3342
+ type: Ze.BUTTON,
3343
3343
  title: "formula.operation.pasteFormula",
3344
3344
  disabled$: uc(e).pipe(
3345
- Ho(je(e, {
3346
- workbookTypes: [Ze],
3347
- rangeTypes: [Ge],
3348
- worksheetTypes: [Ke, Ye]
3345
+ Ho(Be(e, {
3346
+ workbookTypes: [Ge],
3347
+ rangeTypes: [Ye],
3348
+ worksheetTypes: [qe, Ke]
3349
3349
  })),
3350
- or(([t, n]) => t || n)
3350
+ ar(([t, n]) => t || n)
3351
3351
  )
3352
3352
  };
3353
3353
  }
3354
3354
  const hc = {
3355
- [Un.BASIC]: {
3356
- [`${fe.id}.sum`]: {
3355
+ [Bn.BASIC]: {
3356
+ [`${pe.id}.sum`]: {
3357
3357
  order: 0,
3358
3358
  menuItemFactory: oc
3359
3359
  },
3360
- [`${fe.id}.count`]: {
3360
+ [`${pe.id}.count`]: {
3361
3361
  order: 1,
3362
3362
  menuItemFactory: sc
3363
3363
  },
3364
- [`${fe.id}.average`]: {
3364
+ [`${pe.id}.average`]: {
3365
3365
  order: 2,
3366
3366
  menuItemFactory: ic
3367
3367
  },
3368
- [`${fe.id}.max`]: {
3368
+ [`${pe.id}.max`]: {
3369
3369
  order: 3,
3370
3370
  menuItemFactory: cc
3371
3371
  },
3372
- [`${fe.id}.min`]: {
3372
+ [`${pe.id}.min`]: {
3373
3373
  order: 4,
3374
3374
  menuItemFactory: ac
3375
3375
  }
3376
3376
  },
3377
- [Un.OTHERS]: {
3378
- [vn.id]: {
3377
+ [Bn.OTHERS]: {
3378
+ [_n.id]: {
3379
3379
  order: 0,
3380
3380
  menuItemFactory: lc
3381
3381
  }
3382
3382
  },
3383
- [Io]: {
3384
- [mn.id]: {
3383
+ [Eo]: {
3384
+ [Sn.id]: {
3385
3385
  order: 4,
3386
3386
  menuItemFactory: dc
3387
3387
  }
3388
3388
  }
3389
- }, fc = "meta_key_ctrl_And_Shift", qt = [
3389
+ }, fc = "meta_key_ctrl_And_Shift", Zt = [
3390
3390
  L.ARROW_DOWN,
3391
3391
  L.ARROW_UP,
3392
3392
  L.ARROW_LEFT,
3393
3393
  L.ARROW_RIGHT
3394
- ], gc = [...qt, L.ENTER, L.TAB, L.ESC];
3394
+ ], gc = [...Zt, L.ENTER, L.TAB, L.ESC];
3395
3395
  function mc() {
3396
3396
  const e = [];
3397
3397
  for (const t of gc)
3398
3398
  e.push({
3399
- id: ft.id,
3399
+ id: dt.id,
3400
3400
  binding: t,
3401
3401
  preconditions: (n) => Et(n),
3402
3402
  staticParameters: {
@@ -3408,9 +3408,9 @@ function mc() {
3408
3408
  }
3409
3409
  function pc() {
3410
3410
  const e = [];
3411
- for (const t of qt)
3411
+ for (const t of Zt)
3412
3412
  e.push({
3413
- id: ft.id,
3413
+ id: dt.id,
3414
3414
  binding: t | P.SHIFT,
3415
3415
  preconditions: (n) => Et(n),
3416
3416
  staticParameters: {
@@ -3423,9 +3423,9 @@ function pc() {
3423
3423
  }
3424
3424
  function vc() {
3425
3425
  const e = [];
3426
- for (const t of qt)
3426
+ for (const t of Zt)
3427
3427
  e.push({
3428
- id: ft.id,
3428
+ id: dt.id,
3429
3429
  binding: t | P.CTRL_COMMAND,
3430
3430
  preconditions: (n) => Et(n),
3431
3431
  staticParameters: {
@@ -3438,9 +3438,9 @@ function vc() {
3438
3438
  }
3439
3439
  function Sc() {
3440
3440
  const e = [];
3441
- for (const t of qt)
3441
+ for (const t of Zt)
3442
3442
  e.push({
3443
- id: ft.id,
3443
+ id: dt.id,
3444
3444
  binding: t | P.SHIFT | P.CTRL_COMMAND,
3445
3445
  preconditions: (n) => Et(n),
3446
3446
  staticParameters: {
@@ -3452,7 +3452,7 @@ function Sc() {
3452
3452
  return e;
3453
3453
  }
3454
3454
  const Cc = {
3455
- id: gr.id,
3455
+ id: Sr.id,
3456
3456
  binding: L.F4,
3457
3457
  preconditions: (e) => Et(e)
3458
3458
  };
@@ -3460,7 +3460,7 @@ function _c() {
3460
3460
  const e = [];
3461
3461
  for (const t of [L.ENTER, L.TAB, L.ARROW_DOWN, L.ARROW_UP])
3462
3462
  e.push({
3463
- id: ft.id,
3463
+ id: dt.id,
3464
3464
  binding: t,
3465
3465
  preconditions: (n) => ki(n),
3466
3466
  staticParameters: {
@@ -3479,12 +3479,12 @@ const Rc = {
3479
3479
  description: "shortcut.sheets-formula-ui.quick-sum",
3480
3480
  group: "4_sheet-edit"
3481
3481
  };
3482
- var Ec = Object.getOwnPropertyDescriptor, Ic = (e, t, n, o) => {
3483
- for (var r = o > 1 ? void 0 : o ? Ec(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3482
+ var Ic = Object.getOwnPropertyDescriptor, Ec = (e, t, n, o) => {
3483
+ for (var r = o > 1 ? void 0 : o ? Ic(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3484
3484
  (c = e[s]) && (r = c(r) || r);
3485
3485
  return r;
3486
- }, We = (e, t) => (n, o) => t(n, o, e);
3487
- let Ut = class extends ut {
3486
+ }, Ve = (e, t) => (n, o) => t(n, o, e);
3487
+ let Bt = class extends at {
3488
3488
  constructor(e, t, n, o, r, s, c) {
3489
3489
  super(), this._injector = e, this._menuManagerService = t, this._commandService = n, this._shortcutService = o, this._uiPartsService = r, this._renderManagerService = s, this._componentManager = c, this._initialize();
3490
3490
  }
@@ -3496,13 +3496,13 @@ let Ut = class extends ut {
3496
3496
  }
3497
3497
  _registerCommands() {
3498
3498
  [
3499
- mn,
3500
- fe,
3501
- vn,
3499
+ Sn,
3500
+ pe,
3501
+ _n,
3502
3502
  Fs,
3503
3503
  xs,
3504
- ft,
3505
- gr
3504
+ dt,
3505
+ Sr
3506
3506
  ].forEach((e) => this.disposeWithMe(this._commandService.registerCommand(e)));
3507
3507
  }
3508
3508
  _registerShortcuts() {
@@ -3519,24 +3519,24 @@ let Ut = class extends ut {
3519
3519
  });
3520
3520
  }
3521
3521
  _registerComponents() {
3522
- this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => lr(ec, this._injector))), this._componentManager.register(fr, rc);
3522
+ this.disposeWithMe(this._uiPartsService.registerComponent(yo.FORMULA_AUX, () => fr(ec, this._injector))), this._componentManager.register(vr, rc);
3523
3523
  }
3524
3524
  _registerRenderModules() {
3525
- this.disposeWithMe(this._renderManagerService.registerRenderModule(j.UNIVER_SHEET, [$t]));
3525
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, [Wt]));
3526
3526
  }
3527
3527
  };
3528
- Ut = Ic([
3529
- We(0, B(_t)),
3530
- We(1, fs),
3531
- We(2, de),
3532
- We(3, jt),
3533
- We(4, cr),
3534
- We(5, Oe),
3535
- We(6, B(ar))
3536
- ], Ut);
3528
+ Bt = Ec([
3529
+ Ve(0, j(Rt)),
3530
+ Ve(1, fs),
3531
+ Ve(2, fe),
3532
+ Ve(3, Gt),
3533
+ Ve(4, dr),
3534
+ Ve(5, Oe),
3535
+ Ve(6, j(hr))
3536
+ ], Bt);
3537
3537
  const bc = () => {
3538
3538
  var o, r;
3539
- const e = T(Or), t = ge(e.currentSelector$), n = G(null);
3539
+ const e = T(kr), t = ve(e.currentSelector$), n = z(null);
3540
3540
  return $(() => {
3541
3541
  var s, c;
3542
3542
  if (t)
@@ -3545,7 +3545,7 @@ const bc = () => {
3545
3545
  (i = n.current) == null || i.hideDialog();
3546
3546
  };
3547
3547
  }, [t]), /* @__PURE__ */ O(
3548
- xr,
3548
+ wr,
3549
3549
  {
3550
3550
  unitId: (o = t == null ? void 0 : t.unitId) != null ? o : "",
3551
3551
  subUnitId: (r = t == null ? void 0 : t.subUnitId) != null ? r : "",
@@ -3553,7 +3553,7 @@ const bc = () => {
3553
3553
  selectorRef: n,
3554
3554
  onChange: (s, c) => {
3555
3555
  var i;
3556
- t == null || t.callback((i = c == null ? void 0 : c.split(",").map((l) => dt(l))) != null ? i : []);
3556
+ t == null || t.callback((i = c == null ? void 0 : c.split(",").map((l) => lt(l))) != null ? i : []);
3557
3557
  }
3558
3558
  }
3559
3559
  );
@@ -3562,77 +3562,77 @@ var yc = Object.defineProperty, Tc = Object.getOwnPropertyDescriptor, xc = (e, t
3562
3562
  for (var r = o > 1 ? void 0 : o ? Tc(t, n) : t, s = e.length - 1, c; s >= 0; s--)
3563
3563
  (c = e[s]) && (r = c(r) || r);
3564
3564
  return r;
3565
- }, Mt = (e, t) => (n, o) => t(n, o, e), kr = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
3566
- let Vt = class extends oo {
3567
- constructor(e = qn, t, n, o, r) {
3565
+ }, Ft = (e, t) => (n, o) => t(n, o, e), Lr = (e, t, n) => xc(e, typeof t != "symbol" ? t + "" : t, n);
3566
+ let jt = class extends oo {
3567
+ constructor(e = Zn, t, n, o, r) {
3568
3568
  super(), this._config = e, this._injector = t, this._renderManagerService = n, this._configService = o, this._uiPartsService = r;
3569
3569
  const { menu: s, ...c } = so(
3570
- qn,
3570
+ Zn,
3571
3571
  this._config
3572
3572
  );
3573
3573
  s && this._configService.setConfig("menu", s, { merge: !0 }), this._configService.setConfig(wi, c, { merge: !0 });
3574
3574
  }
3575
3575
  onStarting() {
3576
3576
  io(this._injector, [
3577
- [pn, { useClass: tn }],
3578
- [Or],
3577
+ [Cn, { useClass: on }],
3578
+ [kr],
3579
+ [Bt],
3579
3580
  [Ut],
3580
- [Dt],
3581
- [Lt],
3582
- [$t],
3583
- [Pt],
3584
- [Ft]
3581
+ [Vt],
3582
+ [Wt],
3583
+ [Ht],
3584
+ [Pt]
3585
3585
  ]), this._initUIPart();
3586
3586
  }
3587
3587
  onReady() {
3588
3588
  [
3589
- [De]
3589
+ [Le]
3590
3590
  ].forEach((e) => {
3591
- this.disposeWithMe(this._renderManagerService.registerRenderModule(j.UNIVER_SHEET, e));
3591
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, e));
3592
3592
  });
3593
3593
  }
3594
3594
  onRendered() {
3595
3595
  [
3596
- [rn]
3596
+ [cn]
3597
3597
  ].forEach((e) => {
3598
- this.disposeWithMe(this._renderManagerService.registerRenderModule(j.UNIVER_SHEET, e));
3598
+ this.disposeWithMe(this._renderManagerService.registerRenderModule(q.UNIVER_SHEET, e));
3599
3599
  }), co(this._injector, [
3600
- [Ut],
3600
+ [Bt],
3601
3601
  // FormulaProgressBar relies on TriggerCalculationController, but it is necessary to ensure that the formula calculation is done after rendered.
3602
- [Lt],
3603
- [Pt]
3602
+ [Vt],
3603
+ [Ht]
3604
3604
  ]);
3605
3605
  }
3606
3606
  onSteady() {
3607
- this._injector.get(Dt), this._injector.get(Ft);
3607
+ this._injector.get(Ut), this._injector.get(Pt);
3608
3608
  }
3609
3609
  _initUIPart() {
3610
- const e = this._injector.get(ar);
3611
- this.disposeWithMe(e.register(To, xr)), this.disposeWithMe(e.register(xo, Ei)), this.disposeWithMe(this._uiPartsService.registerComponent(gs.GLOBAL, () => lr(bc, this._injector)));
3610
+ const e = this._injector.get(hr);
3611
+ this.disposeWithMe(e.register(To, wr)), this.disposeWithMe(e.register(xo, Ii)), this.disposeWithMe(this._uiPartsService.registerComponent(gs.GLOBAL, () => fr(bc, this._injector)));
3612
3612
  }
3613
3613
  };
3614
- kr(Vt, "pluginName", hr);
3615
- kr(Vt, "type", j.UNIVER_SHEET);
3616
- Vt = Oc([
3614
+ Lr(jt, "pluginName", pr);
3615
+ Lr(jt, "type", q.UNIVER_SHEET);
3616
+ jt = Oc([
3617
3617
  no(Po, as),
3618
- Mt(1, B(_t)),
3619
- Mt(2, Oe),
3620
- Mt(3, ro),
3621
- Mt(4, cr)
3622
- ], Vt);
3618
+ Ft(1, j(Rt)),
3619
+ Ft(2, Oe),
3620
+ Ft(3, ro),
3621
+ Ft(4, dr)
3622
+ ], jt);
3623
3623
  export {
3624
3624
  Ts as FORMULA_PROMPT_ACTIVATED,
3625
- Ei as FormulaEditor,
3626
- Ft as FormulaReorderController,
3627
- Or as GlobalRangeSelectorService,
3625
+ Ii as FormulaEditor,
3626
+ Pt as FormulaReorderController,
3627
+ kr as GlobalRangeSelectorService,
3628
3628
  xs as HelpFunctionOperation,
3629
- fe as InsertFunctionOperation,
3630
- vn as MoreFunctionsOperation,
3631
- xr as RangeSelector,
3632
- De as RefSelectionsRenderService,
3633
- gr as ReferenceAbsoluteOperation,
3629
+ pe as InsertFunctionOperation,
3630
+ _n as MoreFunctionsOperation,
3631
+ wr as RangeSelector,
3632
+ Le as RefSelectionsRenderService,
3633
+ Sr as ReferenceAbsoluteOperation,
3634
3634
  Fs as SearchFunctionOperation,
3635
- ft as SelectEditorFormulaOperation,
3636
- mn as SheetOnlyPasteFormulaCommand,
3637
- Vt as UniverSheetsFormulaUIPlugin
3635
+ dt as SelectEditorFormulaOperation,
3636
+ Sn as SheetOnlyPasteFormulaCommand,
3637
+ jt as UniverSheetsFormulaUIPlugin
3638
3638
  };